@mseva/digit-ui-module-obps 1.0.16 → 1.0.18
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("react"),l=e(t),n=require("react-i18next"),i=require("react-router-dom"),o=require("@mseva/digit-ui-react-components"),a=require("react-hook-form");require("react-dom");var r=e(require("exif-js")),u=require("react-query"),d=e(require("react-modal"));function s(){return(s=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var n in l)({}).hasOwnProperty.call(l,n)&&(e[n]=l[n])}return e}).apply(null,arguments)}function c(e,t){try{var l=e()}catch(e){return t(e)}return l&&l.then?l.then(void 0,t):l}function v(e,t){try{var l=e()}catch(e){return t(!0,e)}return l&&l.then?l.then(t.bind(null,!1),t.bind(null,!0)):t(!1,l)}"undefined"!=typeof Symbol&&(Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator"))),"undefined"!=typeof Symbol&&(Symbol.asyncIterator||(Symbol.asyncIterator=Symbol("Symbol.asyncIterator")));var p=function(e,t){return e===t||e!=e&&t!=t},m=function(e,t){for(var l=e.length;l--;)if(p(e[l][0],t))return l;return-1},E=Array.prototype.splice;function f(e){var t=-1,l=null==e?0:e.length;for(this.clear();++t<l;){var n=e[t];this.set(n[0],n[1])}}f.prototype.clear=function(){this.__data__=[],this.size=0},f.prototype.delete=function(e){var t=this.__data__,l=m(t,e);return!(l<0||(l==t.length-1?t.pop():E.call(t,l,1),--this.size,0))},f.prototype.get=function(e){var t=this.__data__,l=m(t,e);return l<0?void 0:t[l][1]},f.prototype.has=function(e){return m(this.__data__,e)>-1},f.prototype.set=function(e,t){var l=this.__data__,n=m(l,e);return n<0?(++this.size,l.push([e,t])):l[n][1]=t,this};var g=f,A="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function S(e,t){return e(t={exports:{}},t.exports),t.exports}var h,b="object"==typeof A&&A&&A.Object===Object&&A,y="object"==typeof self&&self&&self.Object===Object&&self,C=b||y||Function("return this")(),T=C.Symbol,D=Object.prototype,N=D.hasOwnProperty,P=D.toString,I=T?T.toStringTag:void 0,L=Object.prototype.toString,B=T?T.toStringTag:void 0,O=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":B&&B in Object(e)?function(e){var t=N.call(e,I),l=e[I];try{e[I]=void 0;var n=!0}catch(e){}var i=P.call(e);return n&&(t?e[I]=l:delete e[I]),i}(e):function(e){return L.call(e)}(e)},R=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},w=function(e){if(!R(e))return!1;var t=O(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t},x=C["__core-js_shared__"],M=(h=/[^.]+$/.exec(x&&x.keys&&x.keys.IE_PROTO||""))?"Symbol(src)_1."+h:"",F=Function.prototype.toString,k=function(e){if(null!=e){try{return F.call(e)}catch(e){}try{return e+""}catch(e){}}return""},U=/^\[object .+?Constructor\]$/,H=RegExp("^"+Function.prototype.toString.call(Object.prototype.hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),W=function(e,t){var l=function(e,t){return null==e?void 0:e[t]}(e,t);return function(e){return!(!R(e)||(t=e,M&&M in t))&&(w(e)?H:U).test(k(e));var t}(l)?l:void 0},j=W(C,"Map"),$=W(Object,"create"),Y=Object.prototype.hasOwnProperty,z=Object.prototype.hasOwnProperty;function G(e){var t=-1,l=null==e?0:e.length;for(this.clear();++t<l;){var n=e[t];this.set(n[0],n[1])}}G.prototype.clear=function(){this.__data__=$?$(null):{},this.size=0},G.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},G.prototype.get=function(e){var t=this.__data__;if($){var l=t[e];return"__lodash_hash_undefined__"===l?void 0:l}return Y.call(t,e)?t[e]:void 0},G.prototype.has=function(e){var t=this.__data__;return $?void 0!==t[e]:z.call(t,e)},G.prototype.set=function(e,t){var l=this.__data__;return this.size+=this.has(e)?0:1,l[e]=$&&void 0===t?"__lodash_hash_undefined__":t,this};var K=G,V=function(e,t){var l=e.__data__;return function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}(t)?l["string"==typeof t?"string":"hash"]:l.map};function q(e){var t=-1,l=null==e?0:e.length;for(this.clear();++t<l;){var n=e[t];this.set(n[0],n[1])}}q.prototype.clear=function(){this.size=0,this.__data__={hash:new K,map:new(j||g),string:new K}},q.prototype.delete=function(e){var t=V(this,e).delete(e);return this.size-=t?1:0,t},q.prototype.get=function(e){return V(this,e).get(e)},q.prototype.has=function(e){return V(this,e).has(e)},q.prototype.set=function(e,t){var l=V(this,e),n=l.size;return l.set(e,t),this.size+=l.size==n?0:1,this};var X=q;function J(e){var t=this.__data__=new g(e);this.size=t.size}J.prototype.clear=function(){this.__data__=new g,this.size=0},J.prototype.delete=function(e){var t=this.__data__,l=t.delete(e);return this.size=t.size,l},J.prototype.get=function(e){return this.__data__.get(e)},J.prototype.has=function(e){return this.__data__.has(e)},J.prototype.set=function(e,t){var l=this.__data__;if(l instanceof g){var n=l.__data__;if(!j||n.length<199)return n.push([e,t]),this.size=++l.size,this;l=this.__data__=new X(n)}return l.set(e,t),this.size=l.size,this};var Z=J,Q=function(){try{var e=W(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),ee=function(e,t,l){"__proto__"==t&&Q?Q(e,t,{configurable:!0,enumerable:!0,value:l,writable:!0}):e[t]=l},te=Object.prototype.hasOwnProperty,le=function(e,t,l){var n=e[t];te.call(e,t)&&p(n,l)&&(void 0!==l||t in e)||ee(e,t,l)},ne=function(e,t,l,n){var i=!l;l||(l={});for(var o=-1,a=t.length;++o<a;){var r=t[o],u=n?n(l[r],e[r],r,l,e):void 0;void 0===u&&(u=e[r]),i?ee(l,r,u):le(l,r,u)}return l},ie=function(e){return null!=e&&"object"==typeof e},oe=function(e){return ie(e)&&"[object Arguments]"==O(e)},ae=Object.prototype,re=ae.hasOwnProperty,ue=ae.propertyIsEnumerable,de=oe(function(){return arguments}())?oe:function(e){return ie(e)&&re.call(e,"callee")&&!ue.call(e,"callee")},se=Array.isArray,ce=function(){return!1},ve=S(function(e,t){var l=t&&!t.nodeType&&t,n=l&&e&&!e.nodeType&&e,i=n&&n.exports===l?C.Buffer:void 0;e.exports=(i?i.isBuffer:void 0)||ce}),pe=/^(?:0|[1-9]\d*)$/,me=function(e,t){var l=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==l||"symbol"!=l&&pe.test(e))&&e>-1&&e%1==0&&e<t},Ee=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991},fe={};fe["[object Float32Array]"]=fe["[object Float64Array]"]=fe["[object Int8Array]"]=fe["[object Int16Array]"]=fe["[object Int32Array]"]=fe["[object Uint8Array]"]=fe["[object Uint8ClampedArray]"]=fe["[object Uint16Array]"]=fe["[object Uint32Array]"]=!0,fe["[object Arguments]"]=fe["[object Array]"]=fe["[object ArrayBuffer]"]=fe["[object Boolean]"]=fe["[object DataView]"]=fe["[object Date]"]=fe["[object Error]"]=fe["[object Function]"]=fe["[object Map]"]=fe["[object Number]"]=fe["[object Object]"]=fe["[object RegExp]"]=fe["[object Set]"]=fe["[object String]"]=fe["[object WeakMap]"]=!1;var _e=function(e){return function(t){return e(t)}},ge=S(function(e,t){var l=t&&!t.nodeType&&t,n=l&&e&&!e.nodeType&&e,i=n&&n.exports===l&&b.process,o=function(){try{return n&&n.require&&n.require("util").types||i&&i.binding&&i.binding("util")}catch(e){}}();e.exports=o}),Ae=ge&&ge.isTypedArray,Se=Ae?_e(Ae):function(e){return ie(e)&&Ee(e.length)&&!!fe[O(e)]},he=Object.prototype.hasOwnProperty,be=function(e,t){var l=se(e),n=!l&&de(e),i=!l&&!n&&ve(e),o=!l&&!n&&!i&&Se(e),a=l||n||i||o,r=a?function(e,t){for(var l=-1,n=Array(e);++l<e;)n[l]=t(l);return n}(e.length,String):[],u=r.length;for(var d in e)!t&&!he.call(e,d)||a&&("length"==d||i&&("offset"==d||"parent"==d)||o&&("buffer"==d||"byteLength"==d||"byteOffset"==d)||me(d,u))||r.push(d);return r},ye=Object.prototype,Ce=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||ye)},Te=function(e,t){return function(l){return e(t(l))}},De=Te(Object.keys,Object),Ne=Object.prototype.hasOwnProperty,Pe=function(e){return null!=e&&Ee(e.length)&&!w(e)},Ie=function(e){return Pe(e)?be(e):function(e){if(!Ce(e))return De(e);var t=[];for(var l in Object(e))Ne.call(e,l)&&"constructor"!=l&&t.push(l);return t}(e)},Le=Object.prototype.hasOwnProperty,Be=function(e){return Pe(e)?be(e,!0):function(e){if(!R(e))return function(e){var t=[];if(null!=e)for(var l in Object(e))t.push(l);return t}(e);var t=Ce(e),l=[];for(var n in e)("constructor"!=n||!t&&Le.call(e,n))&&l.push(n);return l}(e)},Oe=S(function(e,t){var l=t&&!t.nodeType&&t,n=l&&e&&!e.nodeType&&e,i=n&&n.exports===l?C.Buffer:void 0,o=i?i.allocUnsafe:void 0;e.exports=function(e,t){if(t)return e.slice();var l=e.length,n=o?o(l):new e.constructor(l);return e.copy(n),n}}),Re=function(){return[]},we=Object.prototype.propertyIsEnumerable,xe=Object.getOwnPropertySymbols,Me=xe?function(e){return null==e?[]:(e=Object(e),function(t,l){for(var n=-1,i=null==t?0:t.length,o=0,a=[];++n<i;){var r=t[n];we.call(e,r)&&(a[o++]=r)}return a}(xe(e)))}:Re,Fe=function(e,t){for(var l=-1,n=t.length,i=e.length;++l<n;)e[i+l]=t[l];return e},ke=Te(Object.getPrototypeOf,Object),Ue=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)Fe(t,Me(e)),e=ke(e);return t}:Re,He=function(e,t,l){var n=t(e);return se(e)?n:Fe(n,l(e))},We=function(e){return He(e,Ie,Me)},je=function(e){return He(e,Be,Ue)},$e=W(C,"DataView"),Ye=W(C,"Promise"),ze=W(C,"Set"),Ge=W(C,"WeakMap"),Ke=k($e),Ve=k(j),qe=k(Ye),Xe=k(ze),Je=k(Ge),Ze=O;($e&&"[object DataView]"!=Ze(new $e(new ArrayBuffer(1)))||j&&"[object Map]"!=Ze(new j)||Ye&&"[object Promise]"!=Ze(Ye.resolve())||ze&&"[object Set]"!=Ze(new ze)||Ge&&"[object WeakMap]"!=Ze(new Ge))&&(Ze=function(e){var t=O(e),l="[object Object]"==t?e.constructor:void 0,n=l?k(l):"";if(n)switch(n){case Ke:return"[object DataView]";case Ve:return"[object Map]";case qe:return"[object Promise]";case Xe:return"[object Set]";case Je:return"[object WeakMap]"}return t});var Qe=Ze,et=Object.prototype.hasOwnProperty,tt=C.Uint8Array,lt=function(e){var t=new e.constructor(e.byteLength);return new tt(t).set(new tt(e)),t},nt=/\w*$/,it=T?T.prototype:void 0,ot=it?it.valueOf:void 0,at=Object.create,rt=function(){function e(){}return function(t){if(!R(t))return{};if(at)return at(t);e.prototype=t;var l=new e;return e.prototype=void 0,l}}(),ut=ge&&ge.isMap,dt=ut?_e(ut):function(e){return ie(e)&&"[object Map]"==Qe(e)},st=ge&&ge.isSet,ct=st?_e(st):function(e){return ie(e)&&"[object Set]"==Qe(e)},vt={};vt["[object Arguments]"]=vt["[object Array]"]=vt["[object ArrayBuffer]"]=vt["[object DataView]"]=vt["[object Boolean]"]=vt["[object Date]"]=vt["[object Float32Array]"]=vt["[object Float64Array]"]=vt["[object Int8Array]"]=vt["[object Int16Array]"]=vt["[object Int32Array]"]=vt["[object Map]"]=vt["[object Number]"]=vt["[object Object]"]=vt["[object RegExp]"]=vt["[object Set]"]=vt["[object String]"]=vt["[object Symbol]"]=vt["[object Uint8Array]"]=vt["[object Uint8ClampedArray]"]=vt["[object Uint16Array]"]=vt["[object Uint32Array]"]=!0,vt["[object Error]"]=vt["[object Function]"]=vt["[object WeakMap]"]=!1;var pt=function e(t,l,n,i,o,a){var r,u=1&l,d=2&l,s=4&l;if(n&&(r=o?n(t,i,o,a):n(t)),void 0!==r)return r;if(!R(t))return t;var c=se(t);if(c){if(r=function(e){var t=e.length,l=new e.constructor(t);return t&&"string"==typeof e[0]&&et.call(e,"index")&&(l.index=e.index,l.input=e.input),l}(t),!u)return function(e,t){var l=-1,n=e.length;for(t||(t=Array(n));++l<n;)t[l]=e[l];return t}(t,r)}else{var v=Qe(t),p="[object Function]"==v||"[object GeneratorFunction]"==v;if(ve(t))return Oe(t,u);if("[object Object]"==v||"[object Arguments]"==v||p&&!o){if(r=d||p?{}:function(e){return"function"!=typeof e.constructor||Ce(e)?{}:rt(ke(e))}(t),!u)return d?function(e,t){return ne(e,Ue(e),t)}(t,function(e,t){return e&&ne(t,Be(t),e)}(r,t)):function(e,t){return ne(e,Me(e),t)}(t,function(e,t){return e&&ne(t,Ie(t),e)}(r,t))}else{if(!vt[v])return o?t:{};r=function(e,t,l){var n,i,o=e.constructor;switch(t){case"[object ArrayBuffer]":return lt(e);case"[object Boolean]":case"[object Date]":return new o(+e);case"[object DataView]":return function(e,t){var l=t?lt(e.buffer):e.buffer;return new e.constructor(l,e.byteOffset,e.byteLength)}(e,l);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 l=t?lt(e.buffer):e.buffer;return new e.constructor(l,e.byteOffset,e.length)}(e,l);case"[object Map]":return new o;case"[object Number]":case"[object String]":return new o(e);case"[object RegExp]":return(i=new(n=e).constructor(n.source,nt.exec(n))).lastIndex=n.lastIndex,i;case"[object Set]":return new o;case"[object Symbol]":return ot?Object(ot.call(e)):{}}}(t,v,u)}}a||(a=new Z);var m=a.get(t);if(m)return m;a.set(t,r),ct(t)?t.forEach(function(i){r.add(e(i,l,n,i,t,a))}):dt(t)&&t.forEach(function(i,o){r.set(o,e(i,l,n,o,t,a))});var E=c?void 0:(s?d?je:We:d?Be:Ie)(t);return function(e,t){for(var l=-1,n=null==e?0:e.length;++l<n&&!1!==t(e[l],l););}(E||t,function(i,o){E&&(i=t[o=i]),le(r,o,e(i,l,n,o,t,a))}),r},mt=function(e){return pt(e,5)};const Et=e=>{switch(e){case"Name":return/^[^{0-9}^\$\"<>?\\\\~!@#$%^()+={}\[\]*,/_:;“”‘’]{1,50}$/i;case"MobileNo":return/^[6-9]{1}[0-9]{9}$/i}},ft=function(e,t,l){if(void 0===e&&(e=""),void 0===t&&(t=""),void 0===l&&(l=""),""==t)return e;for(;e.includes(t);)e=e.replace(t,l);return e},_t=(e,t,l)=>e.sort((e,n)=>l(e[t]).localeCompare(l(n[t]))),gt=()=>require("uuid/v4")(),At=(e,t)=>{var l,n;let i={Noc:e},o=(null==t||null===(l=t.nocDocuments)||void 0===l?void 0:l.nocDocuments.length)>0&&(null==t||null===(n=t.nocDocuments)||void 0===n?void 0:n.nocDocuments.filter(t=>{var l;return t.documentType.includes(null==e||null===(l=e.nocType)||void 0===l?void 0:l.split("_")[0])}).map(e=>({fileName:(null==e?void 0:e.fileName)||"",name:(null==e?void 0:e.name)||"",fileStoreId:null==e?void 0:e.fileStoreId,fileUrl:"",isClickable:!0,link:"",title:null==e?void 0:e.documentType,documentType:null==e?void 0:e.documentType,id:null==e?void 0:e.id,additionalDetails:{}})))||[];return o=[...o,...null!=t&&t.PrevStateNocDocuments?null==t?void 0:t.PrevStateNocDocuments.filter(t=>{var l;return t.documentType.includes(null==e||null===(l=e.nocType)||void 0===l?void 0:l.split("_")[0])}):[]],i.Noc.documents=o,i},St=function(e,t,l,n){try{return Promise.resolve(Digit.OBPSService.scrutinyDetails(null==e?void 0:e.tenantId,{edcrNumber:null==e?void 0:e.edcrNumber})).then(function(i){var o,a,r,u,d,s,c,v,p,m,E,f,_,g,A,S,h,b,y,C,T,D,N,P,I,L,B,O,R,w,x,M;const F=null==i?void 0:i.edcrDetail[0];var k,U,H,W;e.BlockIds=(e=>{let t={};return e&&e.map((e,l)=>{t["Block_"+(l+1)]=e.id}),t})(null==e||null===(o=e.landInfo)||void 0===o?void 0:o.unit),e.address=null==e||null===(a=e.landInfo)||void 0===a?void 0:a.address,e.address.locality.i18nkey=""+n(`${ft(null==e||null===(r=e.landInfo)||void 0===r||null===(u=r.address)||void 0===u?void 0:u.tenantId,".","_").toUpperCase()}_REVENUE_${null==e||null===(d=e.landInfo)||void 0===d||null===(s=d.address)||void 0===s||null===(c=s.locality)||void 0===c?void 0:c.code}`),e.placeName=(null==e||null===(v=e.additionalDetails)||void 0===v?void 0:v.GISPlaceName)||"",e.data={scrutinyNumber:{edcrNumber:null==F?void 0:F.edcrNumber},applicantName:null==F||null===(p=F.planDetail)||void 0===p||null===(m=p.planInformation)||void 0===m?void 0:m.applicantName,applicationDate:null==e||null===(E=e.auditDetails)||void 0===E?void 0:E.createdTime,applicationType:null==F?void 0:F.appliactionType,holdingNumber:null==e||null===(f=e.additionalDetails)||void 0===f?void 0:f.holdingNo,boundaryWallLength:null==e||null===(_=e.additionalDetails)||void 0===_?void 0:_.boundaryWallLength,occupancyType:null==F||null===(g=F.planDetail)||void 0===g||null===(A=g.planInformation)||void 0===A?void 0:A.occupancy,registrationDetails:null==e||null===(S=e.additionalDetails)||void 0===S?void 0:S.registrationDetails,riskType:Digit.Utils.obps.calculateRiskType(null==t||null===(h=t.BPA)||void 0===h?void 0:h.RiskTypeComputation,null==F||null===(b=F.planDetail)||void 0===b||null===(y=b.plot)||void 0===y?void 0:y.area,null==F||null===(C=F.planDetail)||void 0===C?void 0:C.blocks),serviceType:(null==e||null===(T=e.additionalDetails)||void 0===T?void 0:T.serviceType)||(null==F?void 0:F.applicationSubType)},null==e||e.landInfo.owners.map((e,t)=>{e.gender={active:!0,code:e.gender,i18nKey:"COMMON_GENDER_"+e.gender}}),e.owners={owners:null==e||null===(D=e.landInfo)||void 0===D?void 0:D.owners,ownershipCategory:{active:!0,code:null==e||null===(N=e.landInfo)||void 0===N?void 0:N.ownershipCategory,i18nKey:"COMMON_MASTERS_OWNERSHIPCATEGORY_"+(null==e||null===(P=e.landInfo)||void 0===P?void 0:P.ownershipCategory.replaceAll(".","_"))}},e.riskType=Digit.Utils.obps.calculateRiskType(null==t||null===(I=t.BPA)||void 0===I?void 0:I.RiskTypeComputation,null==F||null===(L=F.planDetail)||void 0===L||null===(B=L.plot)||void 0===B?void 0:B.area,null==F||null===(O=F.planDetail)||void 0===O?void 0:O.blocks),e.subOccupancy=(e=>{let t=[],l=[],i={};return e&&e.map((e,o)=>{var a,r;t=null==e||null===(a=e.usageCategory)||void 0===a?void 0:a.split(","),l=[],t&&(null===(r=t)||void 0===r?void 0:r.length)>0&&""!=t&&t.map((e,t)=>{l.push({code:e,i18nKey:"BPA_SUBOCCUPANCYTYPE_"+e.replaceAll(".","_"),name:n("BPA_SUBOCCUPANCYTYPE_"+e.replaceAll(".","_"))})}),i["Block_"+(o+1)]=l}),i})(null==e||null===(R=e.landInfo)||void 0===R?void 0:R.unit),e.uiFlow={flow:null!=e&&e.businessService.includes("OC")?"OCBPA":null==e||null===(w=e.businessService)||void 0===w?void 0:w.split(".")[0],applicationType:(null==e||null===(x=e.additionalDetails)||void 0===x?void 0:x.applicationType)||(null==F?void 0:F.appliactionType),serviceType:(null==e||null===(M=e.additionalDetails)||void 0===M?void 0:M.serviceType)||(null==F?void 0:F.applicationSubType)},null!=e&&e.businessService.includes("OC")?(sessionStorage.setItem("BPAintermediateValue",JSON.stringify({...e})),l.push(`/digit-ui/citizen/obps/ocbpa/${null==e||null===(k=e.additionalDetails)||void 0===k?void 0:k.applicationType.toLowerCase()}/${null==e||null===(U=e.additionalDetails)||void 0===U?void 0:U.serviceType.toLowerCase()}`)):(sessionStorage.setItem("BPAintermediateValue",JSON.stringify({...e})),l.push(`/digit-ui/citizen/obps/bpa/${null==e||null===(H=e.additionalDetails)||void 0===H?void 0:H.applicationType.toLowerCase()}/${null==e||null===(W=e.additionalDetails)||void 0===W?void 0:W.serviceType.toLowerCase()}`))})}catch(e){return Promise.reject(e)}},ht=(e,t)=>{let l=[];const n={documentType:"ARCHITECT.UNDERTAKING",fileStoreId:sessionStorage.getItem("ArchitectConsentdocFilestoreid"),fileStore:sessionStorage.getItem("ArchitectConsentdocFilestoreid")};return e&&e.map(e=>{let t;var n,i,o,a;console.log("ob",e),e.id?(t={documentType:e.documentType,fileStoreId:e.fileStoreId,fileStore:e.fileStoreId,fileName:"",fileUrl:"",additionalDetails:{},id:e.id},"SITEPHOTOGRAPH.ONE"===e.documentType&&(t.additionalDetails={latitude:null==e||null===(n=e.additionalDetails)||void 0===n?void 0:n.latitude,longitude:null==e||null===(i=e.additionalDetails)||void 0===i?void 0:i.longitude})):(t={documentType:e.documentType,fileStoreId:e.fileStoreId,fileStore:e.fileStoreId,fileName:"",fileUrl:"",additionalDetails:{}},"SITEPHOTOGRAPH.ONE"===e.documentType&&(t.additionalDetails={latitude:null==e||null===(o=e.additionalDetails)||void 0===o?void 0:o.latitude,longitude:null==e||null===(a=e.additionalDetails)||void 0===a?void 0:a.longitude})),l.push(t)}),l.push(n),l=[...l,...t||[]],l};function bt(e){let t="";return e.map((e,l)=>{t=t+(0!==l?",":"")+e.code}),t}const yt=e=>{var t;let l=[],n=null==e?void 0:e.subOccupancy;if(n){var i;let t=Object.entries(n);null==e||null===(i=e.landInfo)||void 0===i||i.unit.map((e,n)=>{t.map((t,n)=>{var i;e.id&&e.floorNo===(null===(i=t[0])||void 0===i?void 0:i.split("_")[1])&&l.push({...e,usageCategory:bt(t[1])})})}),t&&t.map((e,t)=>{var n;l.length>0&&(null==l?void 0:l.some(t=>{var l;return(null==t?void 0:t.floorNo)===(null===(l=e[0])||void 0===l?void 0:l.split("_")[1])}))||l.push({blockIndex:t,floorNo:null===(n=e[0])||void 0===n?void 0:n.split("_")[1],unitType:"Block",usageCategory:bt(e[1])})})}return l.length>0?l:null==e||null===(t=e.landInfo)||void 0===t?void 0:t.unit},Ct=(e,t)=>{var l,n,i;if(t)return e.landInfo.owners;let o=mt(null==e||null===(l=e.owners)||void 0===l?void 0:l.owners);return o&&(null==o||o.forEach(e=>{var t,l;null!=e&&null!==(t=e.gender)&&void 0!==t&&t.code&&(e.gender=null===(l=e.gender)||void 0===l?void 0:l.code),null!=e&&e.fatherOrHusbandName||(e.fatherOrHusbandName="NAME"),e.active=!0})),null==e||null===(n=e.landInfo)||void 0===n||null===(i=n.owners)||void 0===i||i.map(e=>{(null==o?void 0:o.length)>0&&(null==o?void 0:o.some(t=>t.id===e.id))||null==o||o.push({...e,active:!1})}),o},Tt=(e,t)=>{var l,n;return t?null==e||null===(l=e.landInfo)||void 0===l?void 0:l.ownershipCategory:e.owners.ownershipCategory.code||(null==e||null===(n=e.landInfo)||void 0===n?void 0:n.ownershipCategory)},Dt=function(e,t,l){var n,i,o,a,r,u,d,s,c,v,p,m,E,f,_,g,A,S,h,b,y,C,T,D,N,P,I;return void 0===t&&(t=!1),void 0===l&&(l=!1),t?(e.landInfo=e.landInfo,e.landInfo.owners.forEach((t,l)=>{var n,i;null!=t&&null!==(n=t.gender)&&void 0!==n&&n.code&&(e.landInfo.owners[l].gender=null==t||null===(i=t.gender)||void 0===i?void 0:i.code)})):(e.landInfo.owners.map((t,l)=>{var n;e.landInfo.owners[l].gender=null==t||null===(n=t.gender)||void 0===n?void 0:n.code}),e.landInfo.address.pincode=null==e||null===(E=e.address)||void 0===E?void 0:E.pincode,e.landInfo.address.city=null==e||null===(f=e.address)||void 0===f||null===(_=f.city)||void 0===_?void 0:_.code,e.landInfo.address.locality=null==e||null===(g=e.address)||void 0===g?void 0:g.locality,e.landInfo.address.landmark=null==e||null===(A=e.address)||void 0===A?void 0:A.landmark,e.landInfo.address.street=null!=e&&null!==(S=e.address)&&void 0!==S&&S.street?null==e||null===(h=e.address)||void 0===h?void 0:h.street:null,e.landInfo.address.city=(null==e||null===(b=e.landInfo)||void 0===b||null===(y=b.address)||void 0===y||null===(C=y.city)||void 0===C?void 0:C.code)||(null==e||null===(T=e.landInfo)||void 0===T||null===(D=T.address)||void 0===D?void 0:D.tenantId),e.landInfo.unit=null!=e&&null!==(N=e.landInfo)&&void 0!==N&&N.unit&&(null==e||null===(P=e.landInfo)||void 0===P?void 0:P.unit.length)>0?(e=>{let t=[];return e&&e.map((e,l)=>{t.push({blockIndex:l,usageCategory:e.usageCategory,occupancyType:e.occupancyType,floorNo:e.floorNo,unitType:e.unitType,id:e.id})}),t})(null==e||null===(I=e.landInfo)||void 0===I?void 0:I.unit):null!=e&&e.subOccupancy?(e=>{let t=[];return e&&Object.entries(e).map((e,l)=>{var n;t.push({blockIndex:l,floorNo:null===(n=e[0])||void 0===n?void 0:n.split("_")[1],unitType:"Block",usageCategory:bt(e[1])})}),t})(null==e?void 0:e.subOccupancy):[]),{BPA:{id:null==e?void 0:e.id,applicationNo:null==e?void 0:e.applicationNo,approvalNo:null==e?void 0:e.approvalNo,accountId:null==e?void 0:e.accountId,edcrNumber:null==e?void 0:e.edcrNumber,riskType:null==e?void 0:e.riskType,businessService:null==e?void 0:e.businessService,landId:null==e?void 0:e.landId,tenantId:(null==e?void 0:e.tenantId)||(null==e||null===(n=e.address)||void 0===n?void 0:n.tenantId),approvalDate:null==e?void 0:e.approvalDate,applicationDate:null==e?void 0:e.applicationDate,status:l||e.status?e.status:"INITIATED",documents:ht(null==e||null===(i=e.documents)||void 0===i?void 0:i.documents,null==e?void 0:e.PrevStateDocuments),landInfo:t?null==e?void 0:e.landInfo:{...null==e?void 0:e.landInfo,ownershipCategory:Tt(e,t),owners:Ct(e,t),unit:yt(e)},assignee:l?e.assignee:[],workflow:{action:"SEND_TO_CITIZEN",assignes:null,comments:null,varificationDocuments:null},auditDetails:null==e?void 0:e.auditDetails,additionalDetails:{...null==e?void 0:e.additionalDetails,OTPverfiedTimeSamp:sessionStorage.getItem("otpVerifiedTimestamp"),otherFeesDiscription:sessionStorage.getItem("otherChargesDisc"),lessAdjustmentFeeFiles:JSON.parse(sessionStorage.getItem("uploadedFileLess")),selfCertificationCharges:{BPA_MALBA_CHARGES:sessionStorage.getItem("Malbafees"),BPA_LABOUR_CESS:sessionStorage.getItem("LabourCess"),BPA_WATER_CHARGES:sessionStorage.getItem("WaterCharges"),BPA_GAUSHALA_CHARGES_CESS:sessionStorage.getItem("GaushalaFees"),BPA_LESS_ADJUSMENT_PLOT:sessionStorage.getItem("lessAdjusment"),BPA_DEVELOPMENT_CHARGES:sessionStorage.getItem("development"),BPA_OTHER_CHARGES:sessionStorage.getItem("otherCharges")},GISPlaceName:null==e||null===(o=e.address)||void 0===o?void 0:o.placeName,holdingNo:null!=e&&null!==(a=e.data)&&void 0!==a&&a.holdingNumber?null==e||null===(r=e.data)||void 0===r?void 0:r.holdingNumber:null==e||null===(u=e.additionalDetails)||void 0===u?void 0:u.holdingNo,boundaryWallLength:null!=e&&null!==(d=e.data)&&void 0!==d&&d.boundaryWallLength?null==e||null===(s=e.data)||void 0===s?void 0:s.boundaryWallLength:null==e||null===(c=e.additionalDetails)||void 0===c?void 0:c.boundaryWallLength,registrationDetails:null!=e&&null!==(v=e.data)&&void 0!==v&&v.registrationDetails?null==e||null===(p=e.data)||void 0===p?void 0:p.registrationDetails:null==e||null===(m=e.additionalDetails)||void 0===m?void 0:m.registrationDetails,architectconsentdocument:{documentType:"Architect Consent Form",fileStoreId:sessionStorage.getItem("ArchitectConsentform"),fileStore:sessionStorage.getItem("ArchitectConsentform")}},applicationType:"BUILDING_PLAN_SCRUTINY",serviceType:"NEW_CONSTRUCTION",occupancyType:"A"}}},Nt=e=>{var t;let l=[];return null===(t=e.documents)||void 0===t||t.documents.map(t=>{var n,i;l.push({fileStoreId:t.fileStoreId,fileStore:t.fileStoreId,fileName:t.fileName,fileUrl:"",documentType:t.documentType,tenantId:null==e||null===(n=e.result)||void 0===n||null===(i=n.Licenses[0])||void 0===i?void 0:i.tenantId})}),l},Pt=function(e,t){void 0===t&&(t="dayend");try{const l=e.match(/(\d{4})-(\d{1,2})-(\d{1,2})/),n=new Date(Date.UTC(l[1],l[2]-1,l[3]));return n.setMinutes(n.getMinutes()+n.getTimezoneOffset()),"dayend"===t&&(n.setHours(n.getHours()+24),n.setSeconds(n.getSeconds()-1)),n.getTime()}catch(t){return e}},It=e=>{if(null==e||null==e||""==e)return"NA";const t=new Date(e);let l=t.getMonth()+1,n=t.getDate();return l=(l>9?"":"0")+l,n=(n>9?"":"0")+n,`${n}/${l}/${t.getFullYear()}`},Lt=function(e,t,l,n,i){try{var o,a,r,u,d,s,c,v,p,m,E,f,_,g,A,S,h,b,y,C,T,D,N,P,I,L,B,O;const R=e=>{let t=[],l=[],n={};return e&&e.map((e,o)=>{var a;t=null==e||null===(a=e.usageCategory)||void 0===a?void 0:a.split(","),l=[],t&&t.map((e,t)=>{l.push({code:e,i18nKey:"BPA_SUBOCCUPANCYTYPE_"+e.replaceAll(".","_"),name:i("BPA_SUBOCCUPANCYTYPE_"+e.replaceAll(".","_"))})}),n["Block_"+(o+1)]=l}),n};e.BlockIds=(e=>{let t={};return e&&e.map((e,l)=>{t["Block_"+(l+1)]=e.id}),t})(null==e||null===(o=e.landInfo)||void 0===o?void 0:o.unit),e.address=null==e||null===(a=e.landInfo)||void 0===a?void 0:a.address,e.data={applicantName:null==t||null===(r=t.planDetail)||void 0===r||null===(u=r.planInformation)||void 0===u?void 0:u.applicantName,applicationDate:null==e||null===(d=e.auditDetails)||void 0===d?void 0:d.createdTime,applicationType:null==t?void 0:t.appliactionType,holdingNumber:null==e||null===(s=e.additionalDetails)||void 0===s?void 0:s.holdingNo,boundaryWallLength:null==e||null===(c=e.additionalDetails)||void 0===c?void 0:c.boundaryWallLength,occupancyType:null==t||null===(v=t.planDetail)||void 0===v||null===(p=v.planInformation)||void 0===p?void 0:p.occupancy,registrationDetails:null==e||null===(m=e.additionalDetails)||void 0===m?void 0:m.registrationDetails,riskType:Digit.Utils.obps.calculateRiskType(null==l||null===(E=l.BPA)||void 0===E?void 0:E.RiskTypeComputation,null==t||null===(f=t.planDetail)||void 0===f||null===(_=f.plot)||void 0===_?void 0:_.area,null==t||null===(g=t.planDetail)||void 0===g?void 0:g.blocks),serviceType:(null==e||null===(A=e.additionalDetails)||void 0===A?void 0:A.serviceType)||(null==t?void 0:t.applicationSubType),edcrDetails:t,scrutinyNumber:{edcrNumber:null==t?void 0:t.edcrNumber}};let w=[];null==e||e.documents.map(e=>w.push(e)),e.PrevStateDocuments=mt(w),e.documents={documents:[]};let x=[];n&&n.map((e,t)=>{e.documents&&e.documents.map((e,t)=>{x.push(e)})}),e.PrevStateNocDocuments=x,e.nocDocuments={NocDetails:n,nocDocuments:[]},null==e||e.landInfo.owners.map((e,t)=>{e.gender={active:!0,code:e.gender,i18nKey:"COMMON_GENDER_"+e.gender}}),e.owners={owners:null==e||null===(S=e.landInfo)||void 0===S?void 0:S.owners,ownershipCategory:{active:!0,code:null==e||null===(h=e.landInfo)||void 0===h?void 0:h.ownershipCategory,i18nKey:"COMMON_MASTERS_OWNERSHIPCATEGORY_"+(null==e||null===(b=e.landInfo)||void 0===b?void 0:b.ownershipCategory.replaceAll(".","_"))}},e.riskType=Digit.Utils.obps.calculateRiskType(null==l||null===(y=l.BPA)||void 0===y?void 0:y.RiskTypeComputation,null==t||null===(C=t.planDetail)||void 0===C||null===(T=C.plot)||void 0===T?void 0:T.area,null==t||null===(D=t.planDetail)||void 0===D?void 0:D.blocks),e.subOccupancy=R(null==e||null===(N=e.landInfo)||void 0===N?void 0:N.unit);let M="BPA";return null==l||null===(P=l.BPA)||void 0===P||null===(I=P.homePageUrlLinks)||void 0===I||I.map(e=>{(null==t?void 0:t.appliactionType)===(null==e?void 0:e.applicationType)&&(null==t?void 0:t.applicationSubType)===(null==e?void 0:e.serviceType)&&(M=null==e?void 0:e.flow)}),e.uiFlow={flow:null!=e&&e.businessService.includes("OC")?"OCBPA":null==e||null===(L=e.businessService)||void 0===L?void 0:L.split(".")[0],applicationType:(null==e||null===(B=e.additionalDetails)||void 0===B?void 0:B.applicationType)||(null==t?void 0:t.appliactionType),serviceType:(null==e||null===(O=e.additionalDetails)||void 0===O?void 0:O.serviceType)||(null==t?void 0:t.applicationSubType)},sessionStorage.setItem("BPA_IS_ALREADY_WENT_OFF_DETAILS",JSON.stringify(!0)),Promise.resolve(e)}catch(e){return Promise.reject(e)}},Bt=(e,t)=>(t&&Object.keys(t).map(l=>{e=e.replace(":"+l,t[l])}),e),Ot=e=>{try{const t=e.match(/(\d{2})-(\d{2})-(\d{4}) (\d{2}):(\d{2}):(\d{2})/);return Date.UTC(+t[3],t[2]-1,+t[1],+t[4],+t[5])}catch(t){return e}},Rt=(e,t)=>{let l="BPA.NC_APP_FEE";return"BPA_LOW"===e?l="BPA.LOW_RISK_PERMIT_FEE":"BPA"===e?l="PENDING_APPL_FEE"==t?"BPA.NC_APP_FEE":"BPA.NC_SAN_FEE":"BPA_OC"===e&&(l="PENDING_APPL_FEE"==t?"BPA.NC_OC_APP_FEE":"BPA.NC_OC_SAN_FEE"),l},wt=(e,t)=>{if(window.mSewaApp&&window.mSewaApp.isMsewaApp()&&window.mSewaApp.downloadBase64File){var l=new FileReader;l.readAsDataURL(e),l.onloadend=function(){mSewaApp.downloadBase64File(l.result,t)}}else{const l=document.createElement("a");l.href=URL.createObjectURL(e),l.download=t,document.body.append(l),l.click(),l.remove(),setTimeout(()=>URL.revokeObjectURL(l.href),7e3)}},xt=e=>{const t=URL.createObjectURL(e);var l=window.open(t);null!=l&&l.addEventListener("load",e=>{l.focus(),l.print()})},Mt=function(e,t,l,n,i,o){void 0===i&&(i="download");try{function a(){return Promise.resolve(Digit.PaymentService.printReciept(l,{fileStoreIds:e.filestoreIds[0]})).then(function(l){var n;window.open(l[null===(n=e)||void 0===n?void 0:n.filestoreIds[0]],"_blank");const o=parseInt(e.status,10);201!==o&&200!==o||("print"==i?xt(new Blob([e.data],{type:"application/pdf"})):wt(new Blob([e.data],{type:"application/pdf"}),`RECEIPT-${t}.pdf`))})}let e=null;console.log("payments",n);const o=function(t){if(null===(t=n[0])||void 0===t||!t.fileStoreId)return Promise.resolve(Digit.PaymentService.generatePdf(l,{Payments:n},"bpa-receipt")).then(function(t){e=t});var i;e={filestoreIds:[null===(i=n[0])||void 0===i?void 0:i.fileStoreId]}}();return Promise.resolve(o&&o.then?o.then(a):a())}catch(e){return Promise.reject(e)}},Ft=function(e,t){try{return Promise.resolve(Digit.OBPSService.scrutinyDetails(t,{edcrNumber:e})).then(function(l){return Promise.resolve(Digit.OBPSService.BPASearch(t,{edcrNumber:e})).then(function(e){var t,n,i,o,a,r,u,d,s,c,v,p;return 0==(null==e||null===(t=e.BPA)||void 0===t?void 0:t.length)?null!=l&&null!==(s=l.edcrDetail)&&void 0!==s&&s[0]?null==l||null===(c=l.edcrDetail)||void 0===c?void 0:c[0]:{type:"ERROR",message:"BPA_NO_RECORD_FOUND"}:(null==e||null===(n=e.BPA)||void 0===n?void 0:n.length)>0&&("INITIATED"==(null==e||null===(i=e.BPA)||void 0===i||null===(o=i[0])||void 0===o?void 0:o.status)||"REJECTED"==(null==e||null===(a=e.BPA)||void 0===a||null===(r=a[0])||void 0===r?void 0:r.status)||"PERMIT REVOCATION"==(null==e||null===(u=e.BPA)||void 0===u||null===(d=u[0])||void 0===d?void 0:d.status))?null!=l&&null!==(v=l.edcrDetail)&&void 0!==v&&v[0]?null==l||null===(p=l.edcrDetail)||void 0===p?void 0:p[0]:{type:"ERROR",message:"BPA_NO_RECORD_FOUND"}:{type:"ERROR",message:"APPLICATION_NUMBER_ALREADY_EXISTS"}})})}catch(e){return Promise.reject(e)}},kt=function(e,t){void 0===t&&(t=!1);let l=[];if((null==e?void 0:e.length)>0){let n=e.filter((t,l)=>e.findIndex(e=>{var l,n,i,o,a,r;return(null==e||null===(l=e.documentType)||void 0===l||null===(n=l.split("."))||void 0===n||null===(i=n.slice(0,2))||void 0===i?void 0:i.join("_"))===(null==t||null===(o=t.documentType)||void 0===o||null===(a=o.split("."))||void 0===a||null===(r=a.slice(0,2))||void 0===r?void 0:r.join("_"))})===l);null==n||n.map(n=>{var i,o,a,r;const u=null==e?void 0:e.filter(e=>{var t,l,i,o,a,r;return(null==n||null===(t=n.documentType)||void 0===t||null===(l=t.split("."))||void 0===l||null===(i=l.slice(0,2))||void 0===i?void 0:i.join("_"))==(null==e||null===(o=e.documentType)||void 0===o||null===(a=o.split("."))||void 0===a||null===(r=a.slice(0,2))||void 0===r?void 0:r.join("_"))});null==u||u.forEach(e=>e.title=e.documentType),l.push({title:t?"":null==u||null===(i=u[0])||void 0===i||null===(o=i.documentType)||void 0===o||null===(a=o.split("."))||void 0===a||null===(r=a.slice(0,2))||void 0===r?void 0:r.join("_"),values:u})})}return l},Ut=e=>{var n,i,r,u,d,s,c;let{formState:v,Controller:p,register:m,control:E,t:f,reset:_,previousPage:g}=e;const A=Digit.ULBService.getStateId(),S=Digit.ULBService.getCurrentTenantId(),h=sessionStorage.getItem("Digit.citizen.userRequestObject"),b=h?JSON.parse(h):{},y=null==b||null===(n=b.value)||void 0===n?void 0:n.info,C=null==y?void 0:y.mobileNumber,T=a.useWatch({control:E,name:"applicationType"}),D=sessionStorage.getItem("search_application")||"";D&&"undefined"!=D&&(null===(i=JSON.parse(D))||void 0===i?void 0:i.code)!==(null==T?void 0:T.code)&&E.setValue("status",""),sessionStorage.setItem("search_application",JSON.stringify(T));const{applicationTypes:N,ServiceTypes:P}=Digit.Hooks.obps.useServiceTypeFromApplicationType({Applicationtype:(null==T?void 0:T.code)||((null==y||null===(r=y.roles)||void 0===r?void 0:r.filter(e=>e.code.includes("BPAREG_")).length)>0&&(null==y||null===(u=y.roles)||void 0===u?void 0:u.filter(e=>e.code.includes("BPA_")||e.code.includes("CITIZEN")).length)<=0?"BPA_STAKEHOLDER_REGISTRATION":"BUILDING_PLAN_SCRUTINY"),tenantId:A}),{data:I}=Digit.Hooks.obps.useBusinessServiceData(S,"BPA,BPA_LOW,BPA_OC,ARCHITECT,BUILDER,ENGINEER,STRUCTURALENGINEER",{});let L=[],B=[],O=[],R=[];null==I||null===(d=I.BusinessServices)||void 0===d||d.map(e=>{e.states.map(t=>{t.state&&t.applicationStatus&&("BPAREG"==e.business?O.push({code:t.applicationStatus,i18nKey:"WF_ARCHITECT_"+t.state,module:e.business}):"BPA_OC"==(null==e?void 0:e.businessService)?B.push({code:t.applicationStatus,i18nKey:"WF_BPA_"+t.state,module:e.business}):L.push({code:t.applicationStatus,i18nKey:"WF_BPA_"+t.state,module:e.business}))})});let w,x=[],M=[];for(w=0;w<L.length;w++)x[L[w].code]||(x[L[w].code]=!0,M.push(L[w].code));let F,k=[],U=[];for(F=0;F<B.length;F++)k[B[F].code]||(k[B[F].code]=!0,U.push(B[F].code));let H,W=[],j=[];for(H=0;H<O.length;H++)W[O[H].code]||(W[O[H].code]=!0,j.push(O[H].code));const $=[],Y=[],z=[];return M.forEach(e=>$.push({i18nKey:"WF_BPA_"+e,code:e})),U.forEach(e=>Y.push({i18nKey:"WF_BPA_"+e,code:e})),j.forEach(e=>z.push({i18nKey:"WF_BPA_"+e,code:e})),$.forEach(e=>{L.map(t=>{(null==e?void 0:e.code)==(null==t?void 0:t.code)&&(e.i18nKey=t.i18nKey)})}),Y.forEach(e=>{B.map(t=>{(null==e?void 0:e.code)==(null==t?void 0:t.code)&&(e.i18nKey=t.i18nKey)})}),z.forEach(e=>{O.map(t=>{(null==e?void 0:e.code)==(null==t?void 0:t.code)&&(e.i18nKey=t.i18nKey)})}),R="BPA_STAKEHOLDER_REGISTRATION"===(null==T?void 0:T.code)?z:"BUILDING_PLAN_SCRUTINY"===(null==T?void 0:T.code)?$:"BUILDING_OC_PLAN_SCRUTINY"===(null==T?void 0:T.code)?Y:[],l.createElement(t.Fragment,null,l.createElement(o.SearchField,null,l.createElement("label",null,f("BPA_SEARCH_APPLICATION_NO_LABEL")),l.createElement(o.TextInput,{name:"applicationNo",inputRef:m({})})),l.createElement(o.SearchField,null,l.createElement("label",null,f("BPA_SEARCH_OWNER_NAME")),l.createElement(o.TextInput,{name:"name",inputRef:m({})})),!window.location.href.includes("citizen/obps/search/application")&&l.createElement(o.SearchField,null,l.createElement("label",null,f("BPA_APP_MOBILE_NO_SEARCH_PARAM")),l.createElement(o.MobileNumber,{name:"mobileNumber",disable:!!window.location.href.includes("obps/search/obps-application"),inputRef:m({minLength:{value:10,message:f("CORE_COMMON_MOBILE_ERROR")},maxLength:{value:10,message:f("CORE_COMMON_MOBILE_ERROR")},pattern:{value:/[6789][0-9]{9}/,message:f("CORE_COMMON_MOBILE_ERROR")}}),type:"number",componentInFront:l.createElement("div",{className:"employee-card-input employee-card-input--front"},"+91")}),l.createElement(o.CardLabelError,null,null==v||null===(s=v.errors)||void 0===s||null===(c=s.mobileNumber)||void 0===c?void 0:c.message)),l.createElement(o.SearchField,null,l.createElement("label",null,f("BPA_SEARCH_APPLICATION_TYPE_LABEL")),l.createElement(p,{control:E,name:"applicationType",render:e=>l.createElement(o.Dropdown,{selected:e.value,select:e.onChange,onBlur:e.onBlur,option:N,optionKey:"i18nKey",t:f})})),l.createElement(o.SearchField,null,l.createElement("label",null,f("BPA_BASIC_DETAILS_SERVICE_TYPE_LABEL")),l.createElement(p,{control:E,name:"serviceType",render:e=>l.createElement(o.Dropdown,{selected:P&&(null==P?void 0:P.length)>0?e.value:P[0],select:e.onChange,onBlur:e.onBlur,option:P,optionKey:"i18nKey",t:f,isBPAREG:!!(P&&(null==P?void 0:P.length)>0)})})),l.createElement(o.SearchField,null,l.createElement("label",null,f("BPA_APP_FROM_DATE_SEARCH_PARAM")),l.createElement(p,{render:e=>l.createElement(o.DatePicker,{date:e.value,onChange:e.onChange}),name:"fromDate",control:E})),l.createElement(o.SearchField,null,l.createElement("label",null,f("BPA_APP_TO_DATE_SEARCH_PARAM")),l.createElement(p,{render:e=>l.createElement(o.DatePicker,{date:e.value,onChange:e.onChange}),name:"toDate",control:E})),l.createElement(o.SearchField,null,l.createElement("label",null,f("BPA_SEARCH_APPLICATION_STATUS_LABEL")),l.createElement(p,{control:E,name:"status",render:e=>l.createElement(o.Dropdown,{selected:e.value,select:e.onChange,onBlur:e.onBlur,option:R,optionKey:"i18nKey",t:f})})),window.location.href.includes("citizen/obps/search/application")&&l.createElement(o.SearchField,null),l.createElement(o.SearchField,{className:"submit"},l.createElement(o.SubmitBar,{label:f("ES_COMMON_SEARCH"),submit:!0}),l.createElement("p",{style:{marginTop:"24px"},onClick:()=>{var e,t,l,n,i,o,a,r,u,d,s,c;_({applicationNo:"",mobileNumber:window.location.href.includes("/search/obps-application")?C:"",name:"",fromDate:"",toDate:"",status:"",offset:0,limit:10,sortBy:"commencementDate",sortOrder:"DESC",applicationType:(null==y||null===(e=y.roles)||void 0===e||null===(t=e.filter(e=>e.code.includes("BPAREG_")))||void 0===t?void 0:t.length)<=0&&(null==y||null===(l=y.roles)||void 0===l?void 0:l.filter(e=>e.code.includes("BPA_")||e.code.includes("CITIZEN")).length)>0?{code:"BUILDING_PLAN_SCRUTINY",i18nKey:"WF_BPA_BUILDING_PLAN_SCRUTINY"}:(null==y||null===(n=y.roles)||void 0===n||null===(i=n.filter(e=>e.code.includes("BPAREG_")))||void 0===i?void 0:i.length)>0&&(null==y||null===(o=y.roles)||void 0===o?void 0:o.filter(e=>e.code.includes("BPA_")||e.code.includes("CITIZEN")).length)<=0?{code:"BPA_STAKEHOLDER_REGISTRATION",i18nKey:"WF_BPA_BPA_STAKEHOLDER_REGISTRATION"}:{code:"BUILDING_PLAN_SCRUTINY",i18nKey:"WF_BPA_BUILDING_PLAN_SCRUTINY"},serviceType:(null==y||null===(a=y.roles)||void 0===a||null===(r=a.filter(e=>e.code.includes("BPAREG_")))||void 0===r?void 0:r.length)<=0&&(null==y||null===(u=y.roles)||void 0===u?void 0:u.filter(e=>e.code.includes("BPA_")||e.code.includes("CITIZEN")).length)>0?{applicationType:["BUILDING_PLAN_SCRUTINY","BUILDING_OC_PLAN_SCRUTINY"],code:"NEW_CONSTRUCTION",i18nKey:"BPA_SERVICETYPE_NEW_CONSTRUCTION"}:(null==y||null===(d=y.roles)||void 0===d||null===(s=d.filter(e=>e.code.includes("BPAREG_")))||void 0===s?void 0:s.length)>0&&(null==y||null===(c=y.roles)||void 0===c?void 0:c.filter(e=>e.code.includes("BPA_")||e.code.includes("CITIZEN")).length)<=0?"":{applicationType:["BUILDING_PLAN_SCRUTINY","BUILDING_OC_PLAN_SCRUTINY"],code:"NEW_CONSTRUCTION",i18nKey:"BPA_SERVICETYPE_NEW_CONSTRUCTION"},isSubmitSuccessful:!1}),g()}},f("ES_COMMON_CLEAR_ALL"))))},Ht=e=>{var o,a;const r=sessionStorage.getItem("Digit.citizen.userRequestObject"),u=r?JSON.parse(r):{},d=null==u||null===(o=u.value)||void 0===o?void 0:o.info,{t:s}=n.useTranslation(),c=Digit.ULBService.getCurrentTenantId(),v=i.useLocation(),[p,m]=t.useState((null==d||null===(E=d.roles)||void 0===E||null===(f=E.filter(e=>e.code.includes("BPAREG_")))||void 0===f?void 0:f.length)<=0&&(null==d||null===(_=d.roles)||void 0===_?void 0:_.filter(e=>e.code.includes("BPA_")||e.code.includes("CITIZEN")).length)>0?"BUILDING_PLAN_SCRUTINY":(null==d||null===(g=d.roles)||void 0===g||null===(A=g.filter(e=>e.code.includes("BPAREG_")))||void 0===A?void 0:A.length)>0&&(null==d||null===(S=d.roles)||void 0===S?void 0:S.filter(e=>e.code.includes("BPA_")||e.code.includes("CITIZEN")).length)<=0?"BPA_STAKEHOLDER_REGISTRATION":"BUILDING_PLAN_SCRUTINY");var E,f,_,g,A,S;const[h,b]=t.useState({}),[y,C]=t.useState({});t.useEffect(()=>{"/digit-ui/citizen/obps/search/application"!==v.pathname&&"/digit-ui/employee/obps/search/application"!==v.pathname||(Digit.SessionStorage.del("OBPS.INBOX"),Digit.SessionStorage.del("STAKEHOLDER.INBOX"))},[v.pathname]);const T=Digit.ComponentRegistryService.getComponent("OBPSSearchApplication"),[D,N]=t.useState("");let P={},I={};if(p&&p.includes("STAKEHOLDER")||Object.keys(h).length>0&&null!=h&&h.applicationType&&null!=h&&h.applicationType.includes("STAKEHOLDER"))Object.entries(h).length<=2&&0==Object.keys(h).filter(e=>"applicationType"===e).length||(h.applicationNo&&(h.applicationNumber=h.applicationNo,h.applicationNo=""),h&&h.applicationType&&delete h.applicationType,h&&h.serviceType&&(h.tradeType=h.serviceType,delete h.serviceType),P={...h,tenantId:Digit.ULBService.getStateId()});else{if(0===Object.keys(h).length){var L,B;let e={applicationType:"BUILDING_PLAN_SCRUTINY",serviceType:"NEW_CONSTRUCTION",...window.location.href.includes("/search/obps-application")&&{mobileNumber:null===(L=Digit.UserService.getUser())||void 0===L||null===(B=L.info)||void 0===B?void 0:B.mobileNumber}};b({...h,...e})}I=h}const{data:O=[],isLoading:R,isSuccess:w}=Digit.Hooks.obps.useOBPSSearch(p,h,c,I,P,{enabled:""===D});return l.createElement(T,{t:s,tenantId:c,onSubmit:function(e){var t,l,n;"BPA_STAKEHOLDER_REGISTRATION"===(null==e||null===(t=e.applicationType)||void 0===t?void 0:t.code)&&((e=>""!==(null==e?void 0:e.applicationNo)||""!==(null==e?void 0:e.fromDate)||""!==(null==e?void 0:e.mobileNumber)||""!==(null==e?void 0:e.serviceType)||""!==(null==e?void 0:e.status)||""!==(null==e?void 0:e.toDate))(e)||N("BPA_ADD_MORE_PARAM_STAKEHOLDER")),C(e);var i=new Date(null==e?void 0:e.fromDate);null==i||i.setSeconds((null==i?void 0:i.getSeconds())-19800);var o=new Date(null==e?void 0:e.toDate);m(null!=e&&null!==(l=e.applicationType)&&void 0!==l&&l.code?null==e||null===(n=e.applicationType)||void 0===n?void 0:n.code:p),null==o||o.setSeconds((null==o?void 0:o.getSeconds())+86399-19800);const a={...e,...e.toDate?{toDate:null==o?void 0:o.getTime()}:{},...e.fromDate?{fromDate:null==i?void 0:i.getTime()}:{}};b(Object.keys(a).filter(e=>a[e]).reduce((e,t)=>({...e,[t]:"object"==typeof a[t]?a[t].code:a[t]}),{}))},searchData:y,isLoading:R,Count:null==O||null===(a=O[0])||void 0===a?void 0:a.Count,error:D,data:!R&&w&&(null==O?void 0:O.length)>0?O:[{display:"ES_COMMON_NO_DATA"}],setparamerror:N})},Wt=()=>{var e,a,r,u;const{t:d}=n.useTranslation(),s=i.useHistory(),[c,v]=t.useState([]),[p,m]=t.useState(!1),E=Digit.ULBService.getCurrentTenantId(),f=sessionStorage.getItem("Digit.citizen.userRequestObject"),_=f?JSON.parse(f):{},g=null==_?void 0:_.value,A=null==g||null===(e=g.info)||void 0===e?void 0:e.mobileNumber,{data:S,isLoading:h,revalidate:b}=Digit.Hooks.obps.useBPAREGSearch(E,{},{mobileNumber:A},{cacheTime:0}),{data:y,isLoading:C,revalidate:T}=Digit.Hooks.obps.useBPASearch(E,{requestor:A,mobileNumber:A,limit:50-(null!=S&&null!==(a=S.Licenses)&&void 0!==a&&a.length?Number(null==S||null===(r=S.Licenses)||void 0===r?void 0:r.length):0),offset:0},{enabled:!h}),{data:D}=Digit.Hooks.obps.useMDMS(Digit.ULBService.getStateId(),"BPA",["RiskTypeComputation"]);return t.useEffect(()=>()=>{v([]),null==b||b(),null==T||T()},[]),t.useEffect(()=>{if(!h&&!C){var e,t,l,n,i,o,a,r;let d=[],s=[];var u;null!=S&&null!==(e=S.Licenses)&&void 0!==e&&e.length&&(null==S||null===(u=S.Licenses)||void 0===u||u.forEach(e=>{e.sortNumber=0,e.modifiedTime=e.auditDetails.lastModifiedTime,e.type="BPAREG",d.push(e)})),null!=y&&y.length&&(null==y||y.forEach(e=>{e.sortNumber=0,e.modifiedTime=e.auditDetails.lastModifiedTime,e.type="BPA",d.push(e)})),s=[].slice.call(d).sort(function(e,t){return new Date(t.modifiedTime)-new Date(e.modifiedTime)||e.sortNumber-t.sortNumber}),v(s);let c=sessionStorage.getItem("Digit.citizen.userRequestObject");const p=c?JSON.parse(c):{};1==(null==p||null===(t=p.value)||void 0===t||null===(l=t.info)||void 0===l||null===(n=l.roles)||void 0===n?void 0:n.length)&&"CITIZEN"==(null==p||null===(i=p.value)||void 0===i||null===(o=i.info)||void 0===o||null===(a=o.roles)||void 0===a||null===(r=a[0])||void 0===r?void 0:r.code)&&m(!0)}},[h,C,y,S]),h||C?l.createElement(o.Loader,null):l.createElement(t.Fragment,null,l.createElement(o.Header,{styles:{marginLeft:"10px"}},`${d("BPA_MY_APPLICATIONS")} ${((e,t)=>{let l=0;return"number"==typeof e&&(l+=e),"number"==typeof t&&(l+=t),l>0?`(${l})`:""})(null==S||null===(u=S.Licenses)||void 0===u?void 0:u.length,null==y?void 0:y.length)}`),null==c?void 0:c.map((e,t)=>{var n,a,r,u,c,v,m,E,f,_,g,A,S;return"BPAREG"===e.type?l.createElement(o.Card,{key:t},l.createElement(o.KeyNote,{keyValue:d("BPA_APPLICATION_NUMBER_LABEL"),note:null==e?void 0:e.applicationNumber}),l.createElement(o.KeyNote,{keyValue:d("BPA_LICENSE_TYPE"),note:d("TRADELICENSE_TRADETYPE_"+(null==e||null===(n=e.tradeLicenseDetail)||void 0===n||null===(a=n.tradeUnits)||void 0===a||null===(r=a[0])||void 0===r||null===(u=r.tradeType)||void 0===u?void 0:u.split(".")[0]))}),(null==e||null===(c=e.tradeLicenseDetail)||void 0===c||null===(v=c.tradeUnits)||void 0===v||null===(m=v[0])||void 0===m?void 0:m.tradeType.includes("ARCHITECT"))&&l.createElement(o.KeyNote,{keyValue:d("BPA_COUNCIL_OF_ARCH_NO_LABEL"),note:null==e||null===(E=e.tradeLicenseDetail)||void 0===E||null===(f=E.additionalDetail)||void 0===f?void 0:f.counsilForArchNo}),l.createElement(o.KeyNote,{keyValue:d("BPA_APPLICANT_NAME_LABEL"),note:null==e||null===(_=e.tradeLicenseDetail)||void 0===_||null===(g=_.owners)||void 0===g||null===(A=g[0])||void 0===A?void 0:A.name}),l.createElement(o.KeyNote,{keyValue:d("TL_COMMON_TABLE_COL_STATUS"),note:d("WF_ARCHITECT_"+(null==e?void 0:e.status)),noteStyle:"APPROVED"===(null==e?void 0:e.status)?{color:"#00703C"}:{color:"#D4351C"}}),"INITIATED"!==e.status?l.createElement(i.Link,{to:{pathname:"/digit-ui/citizen/obps/stakeholder/"+(null==e?void 0:e.applicationNumber),state:{tenantId:""}}},l.createElement(o.SubmitBar,{label:d("TL_VIEW_DETAILS")})):l.createElement(o.SubmitBar,{label:d("BPA_COMP_WORKFLOW"),onSubmit:()=>(e=>{var t,l,n,i,o,a,r,u,c,v,p,m,E,f,_,g,A,S,h,b,y,C,T,D,N,P,I,L,B,O,R,w,x,M,F,k,U,H,W,j,$,Y,z,G,K,V,q,X,J,Z,Q,ee,te,le,ne,ie,oe,ae,re,ue,de,se,ce,ve,pe,me;let Ee=e,fe={Correspondenceaddress:(null==Ee||null===(t=Ee.tradeLicenseDetail)||void 0===t||null===(l=t.owners)||void 0===l||null===(n=l[0])||void 0===n?void 0:n.correspondenceAddress)||`${null!=Ee&&null!==(i=Ee.tradeLicenseDetail)&&void 0!==i&&null!==(o=i.address)&&void 0!==o&&o.doorNo?(null==Ee||null===(a=Ee.tradeLicenseDetail)||void 0===a||null===(r=a.address)||void 0===r?void 0:r.doorNo)+", ":""} ${null!=Ee&&null!==(u=Ee.tradeLicenseDetail)&&void 0!==u&&null!==(c=u.address)&&void 0!==c&&c.street?(null==Ee||null===(v=Ee.tradeLicenseDetail)||void 0===v||null===(p=v.address)||void 0===p?void 0:p.street)+", ":""}${null!=Ee&&null!==(m=Ee.tradeLicenseDetail)&&void 0!==m&&null!==(E=m.address)&&void 0!==E&&E.landmark?(null==Ee||null===(f=Ee.tradeLicenseDetail)||void 0===f||null===(_=f.address)||void 0===_?void 0:_.landmark)+", ":""}${d(null==Ee||null===(g=Ee.tradeLicenseDetail)||void 0===g||null===(A=g.address)||void 0===A?void 0:A.locality.code)}, ${d(null!=Ee&&null!==(S=Ee.tradeLicenseDetail)&&void 0!==S&&null!==(h=S.address)&&void 0!==h&&h.city?null==Ee||null===(b=Ee.tradeLicenseDetail)||void 0===b||null===(y=b.address)||void 0===y?void 0:y.city.code:"")},${d(null==Ee||null===(C=Ee.tradeLicenseDetail)||void 0===C||null===(T=C.address)||void 0===T?void 0:T.pincode)?""+(null===(D=Ee.tradeLicenseDetail)||void 0===D||null===(N=D.address)||void 0===N?void 0:N.pincode):" "}`,formData:{LicneseDetails:{PanNumber:null==Ee||null===(P=Ee.tradeLicenseDetail)||void 0===P||null===(I=P.owners)||void 0===I||null===(L=I[0])||void 0===L?void 0:L.pan,PermanentAddress:null==Ee||null===(B=Ee.tradeLicenseDetail)||void 0===B||null===(O=B.owners)||void 0===O||null===(R=O[0])||void 0===R?void 0:R.permanentAddress,email:null==Ee||null===(w=Ee.tradeLicenseDetail)||void 0===w||null===(x=w.owners)||void 0===x||null===(M=x[0])||void 0===M?void 0:M.emailId,gender:{code:null==Ee||null===(F=Ee.tradeLicenseDetail)||void 0===F||null===(k=F.owners)||void 0===k||null===(U=k[0])||void 0===U?void 0:U.gender,i18nKey:"COMMON_GENDER_"+(null==Ee||null===(H=Ee.tradeLicenseDetail)||void 0===H||null===(W=H.owners)||void 0===W||null===(j=W[0])||void 0===j?void 0:j.gender),value:null==Ee||null===($=Ee.tradeLicenseDetail)||void 0===$||null===(Y=$.owners)||void 0===Y||null===(z=Y[0])||void 0===z?void 0:z.gender},mobileNumber:null==Ee||null===(G=Ee.tradeLicenseDetail)||void 0===G||null===(K=G.owners)||void 0===K||null===(V=K[0])||void 0===V?void 0:V.mobileNumber,name:null==Ee||null===(q=Ee.tradeLicenseDetail)||void 0===q||null===(X=q.owners)||void 0===X||null===(J=X[0])||void 0===J?void 0:J.name},LicneseType:{LicenseType:{i18nKey:"TRADELICENSE_TRADETYPE_"+(null==Ee||null===(Z=Ee.tradeLicenseDetail)||void 0===Z||null===(Q=Z.tradeUnits)||void 0===Q||null===(ee=Q[0])||void 0===ee?void 0:ee.tradeType.split(".")[0]),role:["BPA_"+(null==Ee||null===(te=Ee.tradeLicenseDetail)||void 0===te||null===(le=te.tradeUnits)||void 0===le||null===(ne=le[0])||void 0===ne?void 0:ne.tradeType.split(".")[0])],tradeType:null==Ee||null===(ie=Ee.tradeLicenseDetail)||void 0===ie||null===(oe=ie.tradeUnits)||void 0===oe||null===(ae=oe[0])||void 0===ae?void 0:ae.tradeType},ArchitectNo:(null==Ee||null===(re=Ee.tradeLicenseDetail)||void 0===re||null===(ue=re.additionalDetail)||void 0===ue?void 0:ue.counsilForArchNo)||null}},isAddressSame:(null==Ee||null===(de=Ee.tradeLicenseDetail)||void 0===de||null===(se=de.owners)||void 0===se||null===(ce=se[0])||void 0===ce?void 0:ce.correspondenceAddress)===(null==Ee||null===(ve=Ee.tradeLicenseDetail)||void 0===ve||null===(pe=ve.owners)||void 0===pe||null===(me=pe[0])||void 0===me?void 0:me.permanentAddress),result:{Licenses:[{...e}]},initiationFlow:!0};sessionStorage.setItem("BPAREGintermediateValue",JSON.stringify(fe)),s.push("/digit-ui/citizen/obps/stakeholder/apply/stakeholder-docs-required")})(e)}),"PENDINGPAYMENT"===e.status?l.createElement(i.Link,{to:{pathname:`/digit-ui/citizen/payment/collect/${null==e?void 0:e.businessService}/${null==e?void 0:e.applicationNumber}`}},l.createElement("div",{style:{marginTop:"10px"}},l.createElement(o.SubmitBar,{label:d("COMMON_MAKE_PAYMENT")}))):null):l.createElement(o.Card,{key:t},l.createElement(o.KeyNote,{keyValue:d("BPA_APPLICATION_NUMBER_LABEL"),note:null==e?void 0:e.applicationNo}),l.createElement(o.KeyNote,{keyValue:d("BPA_BASIC_DETAILS_APPLICATION_TYPE_LABEL"),note:d("BPA_OC"!==(null==e?void 0:e.businessService)?"WF_BPA_BUILDING_PLAN_SCRUTINY":"WF_BPA_BUILDING_OC_PLAN_SCRUTINY")}),l.createElement(o.KeyNote,{keyValue:d("BPA_COMMON_SERVICE"),note:d("BPA_SERVICETYPE_NEW_CONSTRUCTION")}),l.createElement(o.KeyNote,{keyValue:d("TL_COMMON_TABLE_COL_STATUS"),note:d("WF_BPA_"+(null==e?void 0:e.state)),noteStyle:"APPROVED"===(null==e?void 0:e.status)?{color:"#00703C"}:{color:"#D4351C"}}),l.createElement(o.KeyNote,{keyValue:d("BPA_COMMON_SLA"),note:"string"==typeof(null==e?void 0:e.sla)&&null!=e&&null!==(S=e.sla)&&void 0!==S&&S.includes("NA")?d("CS_NA"):null==e?void 0:e.sla}),"SEND_TO_ARCHITECT"===e.action||"INITIATED"!==e.status?l.createElement(i.Link,{to:{pathname:"/digit-ui/citizen/obps/bpa/"+(null==e?void 0:e.applicationNo),state:{tenantId:""}}},l.createElement(o.SubmitBar,{label:d("TL_VIEW_DETAILS")})):l.createElement("div",null,p?l.createElement(i.Link,{to:{pathname:"/digit-ui/citizen/obps/bpa/"+(null==e?void 0:e.applicationNo),state:{tenantId:""}}},l.createElement(o.SubmitBar,{label:d("TL_VIEW_DETAILS")})):l.createElement(o.SubmitBar,{label:d("BPA_COMP_WORKFLOW"),onSubmit:()=>St(e,D,s,d)})),"PENDINGPAYMENT"===e.status?l.createElement(i.Link,{to:{pathname:`/digit-ui/citizen/payment/collect/${null==e?void 0:e.businessService}/${null==e?void 0:e.applicationNumber}`}},l.createElement("div",{style:{marginTop:"10px"}},l.createElement(o.SubmitBar,{label:d("COMMON_MAKE_PAYMENT")}))):null)}),l.createElement("div",{style:{marginLeft:"16px",marginTop:"16px",marginBottom:"46px"}},l.createElement("span",null,d("BPA_NOT_ABLE_TO_FIND_APP_MSG")+" "," "),l.createElement("span",{className:"link"},l.createElement(i.Link,{to:"/digit-ui/citizen/obps/search/obps-application"},d("BPA_CLICK_HERE_TO_SEARCH_LINK")))))},jt=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))},$t=e=>{var i,a,r;let{data:u,OpenImage:d}=e;const{t:s}=n.useTranslation(),[c,v]=t.useState(!1);return l.createElement("div",null,u.date&&l.createElement("p",null,u.date),l.createElement("p",null,u.name),u.mobileNumber&&l.createElement(o.TelePhone,{mobile:u.mobileNumber}),u.source&&l.createElement("p",null,s("ES_APPLICATION_DETAILS_APPLICATION_CHANNEL_"+u.source.toUpperCase())),u.comment&&l.createElement(jt,{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,s("WF_COMMON_COMMENTS")),!c&&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"}},s("View More")):null),c&&l.createElement("div",null,l.createElement("p",{style:{overflow:"visible"}},e),l.createElement("button",{type:"button",onClick:()=>{v(!1)},style:{color:"#800000"}},s("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,s("CS_COMMON_ATTACHMENTS")),l.createElement(o.DisplayPhotos,{srcs:null==u?void 0:u.thumbnailsToShow.thumbs,onClick:(e,t)=>{d(e,t,null==u?void 0:u.thumbnailsToShow)}})):null)},Yt=e=>{var a,r,u,d,s;let{id:c,tenantId:v}=e;const{t:p}=n.useTranslation(),[m,E]=t.useState(!1),{isLoading:f,data:_}=Digit.Hooks.useWorkflowDetails({tenantId:v,id:c,moduleCode:"OBPS"});if(f)return l.createElement(o.Loader,null);function g(e,t,l){var n;window.open(null==l||null===(n=l.fullImage)||void 0===n?void 0:n[0],"_blank")}const A=e=>{var t,n,i,o,a;const r={date:null==e||null===(t=e.auditDetails)||void 0===t?void 0:t.lastModified,name:null==e||null===(n=e.assignes)||void 0===n||null===(i=n[0])||void 0===i?void 0:i.name,mobileNumber:null==e||null===(o=e.assignes)||void 0===o||null===(a=o[0])||void 0===a?void 0:a.mobileNumber,comment:p(null==e?void 0:e.comment),wfComment:e.wfComment,thumbnailsToShow:null==e?void 0:e.thumbnailsToShow};return l.createElement($t,{data:r,OpenImage:g})};return l.createElement(l.Fragment,null,!f&&l.createElement(t.Fragment,null,(null==_||null===(a=_.timeline)||void 0===a?void 0:a.length)>0&&l.createElement(o.CardSectionHeader,{style:{marginBottom:"16px",marginTop:"32px"}},p("CS_APPLICATION_DETAILS_APPLICATION_TIMELINE")),null!=_&&_.timeline&&1===(null==_||null===(r=_.timeline)||void 0===r?void 0:r.length)?l.createElement(o.CheckPoint,{isCompleted:!0,label:p((null==_||null===(u=_.timeline[0])||void 0===u?void 0:u.state)&&"WF_ARCHITECT_"+_.timeline[0].state||"NA"),customChild:A(null==_?void 0:_.timeline[0])}):l.createElement(o.ConnectingCheckPoints,null,(null==_?void 0:_.timeline)&&(null==_?void 0:_.timeline.slice(0,m?_.timeline.length:2).map((e,t,n)=>{let i="";var a,r,u,d;return window.location.href.includes("/obps")&&(i=null!=_&&null!==(a=_.timeline[t-1])&&void 0!==a&&null!==(r=a.state)&&void 0!==r&&r.includes("BACK_FROM")||null!=_&&null!==(u=_.timeline[t-1])&&void 0!==u&&null!==(d=u.state)&&void 0!==d&&d.includes("SEND_TO_CITIZEN")?"_NOT_DONE":"SEND_TO_ARCHITECT"===(null==e?void 0:e.performedAction)?"_BY_ARCHITECT_DONE":0==t?"":"_DONE"),l.createElement(l.Fragment,{key:t},l.createElement(o.CheckPoint,{keyValue:t,isCompleted:0===t,label:e.state?p(`WF_ARCHITECT_${e.state}${i}`):"NA",customChild:A(e)}))}))),(null==_||null===(d=_.timeline)||void 0===d?void 0:d.length)>2&&l.createElement(o.LinkButton,{label:p(m?"COLLAPSE":"VIEW_TIMELINE"),onClick:()=>{E(e=>!e)}})),_&&(e=>{var t,n,a,r,u,d;switch(null==e?void 0:e.action){case"PAY":return l.createElement("div",{style:{marginTop:"24px"},className:"action-bar-wrap"},l.createElement(i.Link,{to:{pathname:`/digit-ui/citizen/payment/collect/${null==_||null===(t=_.processInstances)||void 0===t||null===(n=t[0])||void 0===n?void 0:n.moduleName}/${null==_||null===(a=_.processInstances)||void 0===a||null===(r=a[0])||void 0===r?void 0:r.businessId}`,state:{tenantId:null==_||null===(u=_.processInstances)||void 0===u||null===(d=u[0])||void 0===d?void 0:d.tenantId}}},l.createElement(o.SubmitBar,{label:p("TL_COMMON_BUTTON_CITIZEN_MAKE_PAYMENT")})));case"SUBMIT_FEEDBACK":return l.createElement("div",{style:{marginTop:"24px"}},l.createElement(i.Link,{to:"/digit-ui/citizen/fsm/rate/"+props.id},l.createElement(o.SubmitBar,{label:p("CS_APPLICATION_DETAILS_RATE")})))}})(null==_||null===(s=_.nextActions)||void 0===s?void 0:s[0]))},zt=()=>{var e,a,r,u,d,s,c,v,p,m,E,f,_,g,A,S,h,b,y,C,T,D,N,P,I,L,B,O,R,w,x,M,F,k,U,H,W,j,$,Y;const{id:z}=i.useParams(),{t:G}=n.useTranslation(),[K,V]=t.useState({}),q=Digit.ULBService.getCurrentTenantId(),[X,J]=t.useState(!1),[Z,Q]=t.useState([]),{id:ee}=i.useParams(),te={applicationNumber:ee},le=Digit.ULBService.getStateId(),ne=window.Digit.Utils.browser.isMobile(),{data:ie,isLoading:oe}=Digit.Hooks.obps.useBPAREGSearch(le,{},te);let ae=null==ie||null===(e=ie.Licenses)||void 0===e?void 0:e[0];const{data:re}=Digit.Hooks.obps.useMDMS(le,"StakeholderRegistraition","TradeTypetoRoleMapping"),{data:ue}=Digit.Hooks.useRecieptSearch({tenantId:le,businessService:"BPAREG",consumerCodes:z,isEmployee:!1},{}),[de,se]=t.useState(!1);var ce,ve;return t.useEffect(()=>{var e,t;if(null!=ae&&null!==(e=ae.tradeLicenseDetail)&&void 0!==e&&null!==(t=e.applicationDocuments)&&void 0!==t&&t.length){var l,n;const e=null==ae||null===(l=ae.tradeLicenseDetail)||void 0===l||null===(n=l.applicationDocuments)||void 0===n?void 0:n.map(e=>null==e?void 0:e.fileStoreId);Digit.UploadServices.Filefetch(e,q.split(".")[0]).then(e=>V(null==e?void 0:e.data))}},[ae]),t.useEffect(()=>{var e,t,l;ae&&((null==ue||null===(e=ue.Payments)||void 0===e?void 0:e.length)>0&&Q([{label:G("TL_RECEIPT"),onClick:()=>Mt(0,null==ae?void 0:ae.applicationNumber,null==ae?void 0:ae.tenantId,null==ue?void 0:ue.Payments)}]),null==ae||null===(t=ae.tradeLicenseDetail)||void 0===t||null===(l=t.applicationDocuments)||void 0===l||l.map(e=>null==e?void 0:e.fileStoreId))},[ae,ue]),null!=ae&&null!==(a=ae.tradeLicenseDetail)&&void 0!==a&&null!==(r=a.applicationDocuments)&&void 0!==r&&r.length&&(null==re||null===(u=re.StakeholderRegistraition)||void 0===u||null===(d=u.TradeTypetoRoleMapping)||void 0===d?void 0:d.length)>0&&(null==re||null===(ce=re.StakeholderRegistraition)||void 0===ce||null===(ve=ce.TradeTypetoRoleMapping)||void 0===ve||ve.map(e=>{var t,l,n,i,o;(null==e||null===(t=e.docTypes)||void 0===t?void 0:t.length)>0&&(null==e?void 0:e.tradeType)==(null==ae||null===(l=ae.tradeLicenseDetail)||void 0===l||null===(n=l.tradeUnits)||void 0===n||null===(i=n[0])||void 0===i?void 0:i.tradeType)&&(null==e||null===(o=e.docTypes)||void 0===o||o.map(e=>{var t,l;null==ae||null===(t=ae.tradeLicenseDetail)||void 0===t||null===(l=t.applicationDocuments)||void 0===l||l.forEach(t=>{(null==e?void 0:e.code)==(null==t?void 0:t.documentType)&&null!=e&&e.info&&(t.info=null==e?void 0:e.info)})}))})),oe?l.createElement(o.Loader,null):l.createElement(t.Fragment,null,l.createElement("div",{className:"cardHeaderWithOptions",style:ne?{}:{maxWidth:"980px"}},l.createElement(o.Header,{styles:{fontSize:"32px",marginLeft:ne?"0px":"10px"}},G("BPA_TASK_DETAILS_HEADER")),l.createElement("div",null,(null==ue||null===(s=ue.Payments)||void 0===s?void 0:s.length)>0&&l.createElement(o.MultiLink,{className:"multilinkWrapper",onHeadClick:()=>J(!X),displayOptions:X,options:Z,style:{top:"90px"}}),l.createElement(o.LinkButton,{label:G("VIEW_TIMELINE"),style:{color:"#A52A2A"},onClick:()=>{se(!0);const e=document.getElementById("timeline");e&&e.scrollIntoView({behavior:"smooth"})}}))),l.createElement("div",null,l.createElement(o.Card,null,l.createElement(o.StatusTable,null,l.createElement(o.Row,{className:"border-none",label:G("BPA_APPLICATION_NUMBER_LABEL"),text:(null==ae?void 0:ae.applicationNumber)||"NA"}))),l.createElement(o.Card,null,l.createElement(o.CardHeader,{styles:{fontSize:"24px"}},G("BPA_LICENSE_DETAILS_LABEL")),l.createElement(o.StatusTable,null,l.createElement(o.Row,{className:"border-none",label:G("BPA_LICENSE_TYPE"),text:G("TRADELICENSE_TRADETYPE_"+(null==ae||null===(c=ae.tradeLicenseDetail)||void 0===c||null===(v=c.tradeUnits)||void 0===v||null===(p=v[0])||void 0===p||null===(m=p.tradeType)||void 0===m?void 0:m.split(".")[0]))}),(null==ae||null===(E=ae.tradeLicenseDetail)||void 0===E||null===(f=E.tradeUnits)||void 0===f||null===(_=f[0])||void 0===_?void 0:_.tradeType.includes("ARCHITECT"))&&l.createElement(o.Row,{className:"border-none",label:G("BPA_COUNCIL_OF_ARCH_NO_LABEL"),text:null==ae||null===(g=ae.tradeLicenseDetail)||void 0===g||null===(A=g.additionalDetail)||void 0===A?void 0:A.counsilForArchNo}))),l.createElement(o.Card,null,l.createElement(o.CardHeader,{styles:{fontSize:"24px"}},G("BPA_LICENSE_DET_CAPTION")),l.createElement(o.StatusTable,null,l.createElement(o.Row,{className:"border-none",label:G("BPA_APPLICANT_NAME_LABEL"),text:G(null==ae||null===(S=ae.tradeLicenseDetail)||void 0===S||null===(h=S.owners)||void 0===h||null===(b=h[0])||void 0===b?void 0:b.name)}),l.createElement(o.Row,{className:"border-none",label:G("BPA_APPLICANT_GENDER_LABEL"),text:G(null==ae||null===(y=ae.tradeLicenseDetail)||void 0===y||null===(C=y.owners)||void 0===C||null===(T=C[0])||void 0===T?void 0:T.gender)}),l.createElement(o.Row,{className:"border-none",label:G("BPA_OWNER_MOBILE_NO_LABEL"),text:null==ae||null===(D=ae.tradeLicenseDetail)||void 0===D||null===(N=D.owners)||void 0===N||null===(P=N[0])||void 0===P?void 0:P.mobileNumber}),l.createElement(o.Row,{className:"border-none",label:G("BPA_APPLICANT_EMAIL_LABEL"),text:(null==ae||null===(I=ae.tradeLicenseDetail)||void 0===I||null===(L=I.owners)||void 0===L||null===(B=L[0])||void 0===B?void 0:B.emailId)||G("CS_NA")}),l.createElement(o.Row,{className:"border-none",label:G("BPA_APPLICANT_PAN_NO"),text:(null==ae||null===(O=ae.tradeLicenseDetail)||void 0===O||null===(R=O.owners)||void 0===R||null===(w=R[0])||void 0===w?void 0:w.pan)||G("CS_NA")}))),l.createElement(o.Card,null,l.createElement(o.CardHeader,{styles:{fontSize:"24px"}},G("BPA_LICENSEE_PERMANENT_LABEL")),l.createElement(o.Row,{className:"border-none",text:(null==ae||null===(x=ae.tradeLicenseDetail)||void 0===x||null===(M=x.owners)||void 0===M||null===(F=M[0])||void 0===F?void 0:F.permanentAddress)||G("CS_NA")})),l.createElement(o.Card,null,l.createElement(o.CardHeader,{styles:{fontSize:"24px"}},G("BPA_CORRESPONDANCE_ADDRESS_LABEL")),l.createElement(o.Row,{className:"border-none",text:(null==ae||null===(k=ae.tradeLicenseDetail)||void 0===k||null===(U=k.owners)||void 0===U||null===(H=U[0])||void 0===H?void 0:H.correspondenceAddress)||G("CS_NA")})),(null==ae||null===(W=ae.tradeLicenseDetail)||void 0===W||null===(j=W.applicationDocuments)||void 0===j?void 0:j.length)>0&&l.createElement(o.Card,null,l.createElement(o.CardHeader,{styles:{fontSize:"24px"}},G("BPA_DOC_DETAILS_SUMMARY")),null==ae||null===($=ae.tradeLicenseDetail)||void 0===$||null===(Y=$.applicationDocuments)||void 0===Y?void 0:Y.map((e,n)=>{var i,a,r,u,d;return l.createElement(t.Fragment,null,l.createElement("div",null,l.createElement(o.CardSectionHeader,{styles:{fontSize:"18px"}},G("BPAREG_HEADER_"+ft(null==e||null===(i=e.documentType)||void 0===i?void 0:i.toUpperCase(),".","_"))),null!=e&&e.info?l.createElement("div",{style:{fontSize:"12px",color:"#505A5F",fontWeight:400,lineHeight:"15px",margin:"10px 0px"}},""+G(null==e?void 0:e.info)):null,l.createElement("a",{target:"_blank",href:null===(a=K[e.fileStoreId])||void 0===a?void 0:a.split(",")[0]},l.createElement(o.PDFSvg,null)),l.createElement("p",{style:{marginTop:"8px",fontWeight:"bold",fontSize:"16px",lineHeight:"19px",color:"#505A5F",fontWeight:"400"}},G("BPAREG_HEADER_"+ft(null==e||null===(r=e.documentType)||void 0===r?void 0:r.toUpperCase(),".","_")))),(null==ae||null===(u=ae.tradeLicenseDetail)||void 0===u||null===(d=u.applicationDocuments)||void 0===d?void 0:d.length)!=n+1?l.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",height:"2px",marginTop:"20px",marginBottom:"20px"}}):null)})),l.createElement("div",{id:"timeline"},l.createElement(o.Card,null,l.createElement(Yt,{id:z,tenantId:null==ae?void 0:ae.tenantId})))))},Gt=e=>{var a,r;const{state:u}=e.location,{t:d}=n.useTranslation(),s=Digit.ULBService.getCurrentTenantId(),c=null==u||null===(a=u.data)||void 0===a||null===(r=a.BPA)||void 0===r?void 0:r[0],[v,p]=t.useState({}),[m,E]=t.useState(!0),f=i.useHistory(),[_,g]=t.useState(""),[A,S]=t.useState(null);let h=null==v?void 0:v.businessService,b=null==v?void 0:v.status;"BPA_LOW"==h&&(h="BPA");let y=Digit.Hooks.useWorkflowDetails({tenantId:null==c?void 0:c.tenantId,id:null==c?void 0:c.applicationNo,moduleCode:"BPA"});t.useEffect(function(){try{return E(!0),Promise.resolve(Digit.OBPSService.BPASearch(s,{applicationNo:null==c?void 0:c.applicationNo})).then(function(e){var t,l,n,i;return Promise.resolve(Rt(null==e||null===(t=e.BPA)||void 0===t||null===(l=t[0])||void 0===l?void 0:l.businessService,null==e||null===(n=e.BPA)||void 0===n||null===(i=n[0])||void 0===i?void 0:i.status)).then(function(t){var l,n;return Promise.resolve(Digit.PaymentService.fetchBill(s,{consumerCode:null==e||null===(l=e.BPA)||void 0===l||null===(n=l[0])||void 0===n?void 0:n.applicationNo,businessService:t})).then(function(t){var l,n,i,o;"APPROVED"==(null==e||null===(l=e.BPA)||void 0===l||null===(n=l[0])||void 0===n?void 0:n.status)&&null!=t&&t.Bill[0]&&0!=(null==t||null===(i=t.Bill[0])||void 0===i?void 0:i.totalAmount)&&g("_SAN_FEE"),E(!1),p(null==e||null===(o=e.BPA)||void 0===o?void 0:o[0]),S(null==t?void 0:t.Bill)})})})}catch(e){return Promise.reject(e)}},[]);let C=!1;var T,D,N;return!y||null==y||!y.data||null!=y&&y.isLoading||null==y||null===(T=y.data)||void 0===T||null===(D=T.nextActions)||void 0===D||D.forEach(e=>{"PAY"!=e.action||C||(C=!0)}),l.createElement("div",null,m||null!=y&&y.isLoading?l.createElement(o.Loader,null):l.createElement(o.Card,null,l.createElement(o.Banner,{message:d(`BPA_HEADER_${h}_${null==c||null===(N=c.workflow)||void 0===N?void 0:N.action}_${ft(b," ","_").toUpperCase()}${_||""}`),applicationNumber:null==v?void 0:v.applicationNo,info:d("BPA"==h?"BPA_PERMIT_APPLICATION_NUMBER_LABEL":"BPA_OCCUPANCY_CERTIFICATE_APPLICATION_NUMBER_LABEL"),successful:"PERMIT REVOCATION"!=(null==v?void 0:v.status)&&"REJECTED"!=(null==v?void 0:v.status),style:{padding:"10px"},headerStyles:{fontSize:"32px",wordBreak:"break-word"}}),l.createElement(o.CardText,{style:{paddingBottom:"10px",marginBottom:"10px"}}),"PERMIT REVOCATION"==(null==v?void 0:v.status)?l.createElement("div",{className:"primary-label-btn d-grid",style:{marginLeft:"unset",marginBottom:"10px",padding:"0px 8px"},onClick:function(){try{return Promise.resolve(Digit.PaymentService.generatePdf(s,{Bpa:[v]},"bpa-revocation")).then(function(e){return Promise.resolve(Digit.PaymentService.printReciept(s,{fileStoreIds:e.filestoreIds[0]})).then(function(t){window.open(t[null==e?void 0:e.filestoreIds[0]],"_blank")})})}catch(e){return Promise.reject(e)}}},l.createElement("svg",{width:"20",height:"23",viewBox:"0 0 20 23",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l.createElement("path",{d:"M19.3334 8H14V0H6.00002V8H0.666687L10 17.3333L19.3334 8ZM0.666687 20V22.6667H19.3334V20H0.666687Z",fill:"#a82227"})),d("BPA_REVOCATION_PDF_LABEL")):null,window.location.href.includes("/citizen")?l.createElement("div",null,("PENDING_APPL_FEE"==(null==v?void 0:v.status)||"PENDING_FEE"==(null==v?void 0:v.status)||"PENDING_SANC_FEE_PAYMENT"==(null==v?void 0:v.status))&&(null==A?void 0:A.length)>0&&C?l.createElement("div",null,l.createElement(i.Link,{to:{pathname:`/digit-ui/citizen/payment/collect/${Rt(null==v?void 0:v.businessService,null==v?void 0:v.status)}/${null==v?void 0:v.applicationNo}/${null==v?void 0:v.tenantId}?tenantId=${null==v?void 0:v.tenantId}`}},l.createElement(o.SubmitBar,{label:d("WF_BPA_PAY"),style:{margin:"10px 0px 0px 0px"}})),l.createElement(i.Link,{to:"/digit-ui/citizen"},l.createElement(o.LinkButton,{label:d("CORE_COMMON_GO_TO_HOME")}))):l.createElement(i.Link,{to:{pathname:"/digit-ui/citizen"}},l.createElement(o.SubmitBar,{label:d("CORE_COMMON_GO_TO_HOME"),style:{margin:"10px 10px 0px 0px"}}))):l.createElement(o.ActionBar,{style:{display:"flex",justifyContent:"flex-end",alignItems:"baseline"}},l.createElement("div",null,("PENDING_APPL_FEE"==(null==v?void 0:v.status)||"PENDING_FEE"==(null==v?void 0:v.status)||"PENDING_SANC_FEE_PAYMENT"==(null==v?void 0:v.status))&&(null==A?void 0:A.length)>0&&C?l.createElement("div",null,l.createElement(o.SubmitBar,{label:d("WF_BPA_PAY"),onSubmit:()=>{f.push(`/digit-ui/employee/payment/collect/${Rt(null==v?void 0:v.businessService,null==v?void 0:v.status)}/${null==v?void 0:v.applicationNo}/${null==v?void 0:v.tenantId}?tenantId=${null==v?void 0:v.tenantId}`)},style:{margin:"10px 0px 0px 0px"}}),l.createElement(i.Link,{to:"/digit-ui/employee"},l.createElement("span",{style:{color:"#a82227",margin:"0px 10px"}},d("CORE_COMMON_GO_TO_HOME")))):l.createElement(o.SubmitBar,{label:d("CORE_COMMON_GO_TO_HOME"),onSubmit:()=>{f.push("/digit-ui/employee")},style:{margin:"10px 10px 0px 0px"}})))))},Kt=e=>{let{statuses:i,isInboxLoading:r,controlFilterForm:u,setFilterFormValue:d,filterFormState:s,localitiesForEmployeesCurrentTenant:c,loadingLocalitiesForEmployeesCurrentTenant:v}=e;const{t:p}=n.useTranslation(),m=Digit.ULBService.getCurrentTenantId(),{data:E,isLoading:f}=Digit.Hooks.obps.SearchMdmsTypes.useApplicationTypes(m),_=[{code:"ASSIGNED_TO_ME",name:""+p("ES_INBOX_ASSIGNED_TO_ME")},{code:"ASSIGNED_TO_ALL",name:""+p("ES_INBOX_ASSIGNED_TO_ALL")}],g=a.useWatch({control:u,name:"applicationType",defaultValue:(null==s?void 0:s.applicationType)||null}),A=Digit.Hooks.obps.useBusinessServiceBasedOnServiceType({applicationType:g}),S=a.useWatch({control:u,name:"businessService",defaultValue:(null==s?void 0:s.businessService)||null}),h=(e,t)=>{const l=e.map(e=>e[1]);return t.onChange(l)};return l.createElement(t.Fragment,null,window.location.href.includes("/citizen")?null:l.createElement(o.FilterFormField,null,l.createElement(a.Controller,{name:"assignee",control:u,render:e=>l.createElement(o.RadioButtons,{onSelect:t=>{e.onChange(t.code)},selectedOption:_.filter(t=>t.code===e.value)[0],optionsKey:"name",name:"assignee",options:_})})),window.location.href.includes("/citizen")?null:l.createElement(o.FilterFormField,null,l.createElement(a.Controller,{name:"locality",control:u,render:e=>{const n=t.useMemo(()=>{var t;return null==e||null===(t=e.value)||void 0===t?void 0:t.map((t,n)=>l.createElement(o.RemoveableTag,{key:n,text:t.i18nkey,onClick:()=>{var l;e.onChange(null==e||null===(l=e.value)||void 0===l?void 0:l.filter(e=>e.code!==t.code))}}))},[null==e?void 0:e.value]);return v?l.createElement(o.Loader,null):l.createElement(t.Fragment,null,l.createElement("div",{className:"filter-label sub-filter-label",style:{fontSize:"18px",fontWeight:"600"}},p("ES_INBOX_LOCALITY")),l.createElement(o.MultiSelectDropdown,{options:c||[],optionsKey:"i18nkey",props:e,isPropsNeeded:!0,onSelect:h,selected:null==e?void 0:e.value,defaultLabel:p("ES_BPA_ALL_SELECTED"),defaultUnit:p("BPA_SELECTED_TEXT")}),l.createElement("div",{className:"tag-container"},n))}})),l.createElement(o.FilterFormField,null,l.createElement(a.Controller,{name:"applicationType",control:u,render:e=>f?l.createElement(o.Loader,null):l.createElement(t.Fragment,null,l.createElement("div",{className:"filter-label sub-filter-label",style:{fontSize:"18px",fontWeight:"600"}},p("BPA_SEARCH_APPLICATION_TYPE_LABEL")),l.createElement(o.RadioButtons,{onSelect:t=>{e.onChange(t.code),d("applicationStatus",[]),d("businessService",[])},selectedOption:E.filter(t=>t.code===e.value)[0],optionsKey:"i18nKey",name:"applicationType",options:E}))})),(null==g?void 0:g.length)>0&&"BUILDING_OC_PLAN_SCRUTINY"!=g?l.createElement(o.FilterFormField,null,l.createElement(a.Controller,{name:"businessService",control:u,render:e=>l.createElement(t.Fragment,null,l.createElement("div",{className:"filter-label sub-filter-label",style:{fontSize:"18px",fontWeight:"600"}},p("ES_INBOX_RISK_TYPE")),l.createElement(o.RadioButtons,{onSelect:t=>{e.onChange(t.code),d("applicationStatus",[])},selectedOption:A.filter(t=>t.code===e.value)[0],optionsKey:"i18nKey",name:"businessService",options:A}))})):null,"BUILDING_OC_PLAN_SCRUTINY"==g||(null==g?void 0:g.length)>0&&(null==S?void 0:S.length)>0?l.createElement(o.FilterFormField,null,l.createElement("div",{className:"filter-label sub-filter-label",style:{fontSize:"18px",fontWeight:"600"}},p("ACTION_TEST_APPLICATION_STATUS")),l.createElement(a.Controller,{name:"applicationStatus",control:u,render:e=>{function n(t){e.onChange(t)}const a=t.useMemo(()=>{var t;return null==i||null===(t=i.filter(e=>{let t=mt(S);return"BUILDING_OC_PLAN_SCRUTINY"==g&&(t="BPA_OC"),e.businessservice===t}))||void 0===t?void 0:t.map((t,i)=>{var a;return l.createElement(o.CheckBox,{key:i,onChange:l=>{if(l.target.checked&&null!=e&&e.value)n([...null==e?void 0:e.value,null==t?void 0:t.statusid]);else if(l.target.checked)n([null==t?void 0:t.statusid]);else{var i;n(null==e||null===(i=e.value)||void 0===i?void 0:i.filter(e=>e!==(null==t?void 0:t.statusid)))}},checked:null==e||null===(a=e.value)||void 0===a?void 0:a.includes(null==t?void 0:t.statusid),label:`${p(`WF_STATE_${t.businessservice}_${t.applicationstatus}`)} (${t.count})`})})},[e.value,i,S,g]);return l.createElement(t.Fragment,null,r?l.createElement(o.Loader,null):l.createElement(t.Fragment,null,a))}})):null)},Vt=e=>{var i,a,r,u;let{registerRef:d,searchFormState:s,searchFieldComponents:c}=e;const{t:v}=n.useTranslation();var p,m,E,f;return window.Digit.Utils.browser.isMobile()?l.createElement(t.Fragment,null,l.createElement(o.SearchField,null,l.createElement("label",null,v("BPA_APPLICATION_NUMBER_LABEL")),l.createElement(o.TextInput,{name:"applicationNo",inputRef:d({})})),window.location.href.includes("/citizen")?null:l.createElement(o.SearchField,null,l.createElement("label",null,v("CORE_COMMON_MOBILE_NUMBER")),l.createElement(o.MobileNumber,{name:"mobileNumber",type:"number",inputRef:d({minLength:{value:10,message:v("CORE_COMMON_MOBILE_ERROR")},maxLength:{value:10,message:v("CORE_COMMON_MOBILE_ERROR")},pattern:{value:/[6789][0-9]{9}/,message:v("CORE_COMMON_MOBILE_ERROR")}})}),null!=s&&null!==(i=s.errors)&&void 0!==i&&null!==(a=i.mobileNumber)&&void 0!==a&&a.message?l.createElement(o.CardLabelError,null,null==s||null===(r=s.errors)||void 0===r||null===(u=r.mobileNumber)||void 0===u?void 0:u.message):null)):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:window.location.href.includes("/citizen")?{gridTemplateColumns:"33.33% 67.33%",textAlign:"start"}:{textAlign:"start"}},l.createElement(o.SearchField,null,l.createElement("label",null,v("BPA_APPLICATION_NUMBER_LABEL")),l.createElement(o.TextInput,{name:"applicationNo",inputRef:d({})})),window.location.href.includes("/citizen")?null:l.createElement(o.SearchField,null,l.createElement("label",null,v("CORE_COMMON_MOBILE_NUMBER")),l.createElement(o.MobileNumber,{name:"mobileNumber",type:"number",inputRef:d({minLength:{value:10,message:v("CORE_COMMON_MOBILE_ERROR")},maxLength:{value:10,message:v("CORE_COMMON_MOBILE_ERROR")},pattern:{value:/[6789][0-9]{9}/,message:v("CORE_COMMON_MOBILE_ERROR")}})}),null!=s&&null!==(p=s.errors)&&void 0!==p&&null!==(m=p.mobileNumber)&&void 0!==m&&m.message?l.createElement(o.CardLabelError,null,null==s||null===(E=s.errors)||void 0===E||null===(f=E.mobileNumber)||void 0===f?void 0:f.message):null),l.createElement("div",{className:"search-action-wrapper",style:{width:"100%"}},c)))))};function qt(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 Xt(e,t){if(t.length<e)throw new TypeError(e+" argument"+(e>1?"s":"")+" required, but only "+t.length+" present")}function Jt(e){Xt(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 Zt(e,t){Xt(2,arguments);var l=Jt(e).getTime(),n=qt(t);return new Date(l+n)}function Qt(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 el(e){return Xt(1,arguments),e instanceof Date||"object"==typeof e&&"[object Date]"===Object.prototype.toString.call(e)}function tl(e){if(Xt(1,arguments),!el(e)&&"number"!=typeof e)return!1;var t=Jt(e);return!isNaN(Number(t))}var ll={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 nl(e){return function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},l=t.width?String(t.width):e.defaultWidth,n=e.formats[l]||e.formats[e.defaultWidth];return n}}var il={date:nl({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:nl({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:nl({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},ol={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,l){var n,i=l||{};if("formatting"===(i.context?String(i.context):"standalone")&&e.formattingValues){var o=e.defaultFormattingWidth||e.defaultWidth,a=i.width?String(i.width):o;n=e.formattingValues[a]||e.formattingValues[o]}else{var r=e.defaultWidth,u=i.width?String(i.width):e.defaultWidth;n=e.values[u]||e.values[r]}return n[e.argumentCallback?e.argumentCallback(t):t]}}function rl(e){return function(t){var l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=l.width,i=n&&e.matchPatterns[n]||e.matchPatterns[e.defaultMatchWidth],o=t.match(i);if(!o)return null;var a,r=o[0],u=n&&e.parsePatterns[n]||e.parsePatterns[e.defaultParseWidth],d=Array.isArray(u)?dl(u,function(e){return e.test(r)}):ul(u,function(e){return e.test(r)});a=e.valueCallback?e.valueCallback(d):d,a=l.valueCallback?l.valueCallback(a):a;var s=t.slice(r.length);return{value:a,rest:s}}}function ul(e,t){for(var l in e)if(e.hasOwnProperty(l)&&t(e[l]))return l}function dl(e,t){for(var l=0;l<e.length;l++)if(t(e[l]))return l}var sl,cl={code:"en-US",formatDistance:function(e,t,l){var n,i=ll[e];return n="string"==typeof i?i:1===t?i.one:i.other.replace("{{count}}",t.toString()),null!=l&&l.addSuffix?l.comparison&&l.comparison>0?"in "+n:n+" ago":n},formatLong:il,formatRelative:function(e,t,l,n){return ol[e]},localize:{ordinalNumber:function(e,t){var l=Number(e),n=l%100;if(n>20||n<10)switch(n%10){case 1:return l+"st";case 2:return l+"nd";case 3:return l+"rd"}return l+"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:(sl={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]:{},l=e.match(sl.matchPattern);if(!l)return null;var n=l[0],i=e.match(sl.parsePattern);if(!i)return null;var o=sl.valueCallback?sl.valueCallback(i[0]):i[0];o=t.valueCallback?t.valueCallback(o):o;var a=e.slice(n.length);return{value:o,rest:a}}),era:rl({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:rl({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:rl({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:rl({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:rl({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 vl(e,t){Xt(2,arguments);var l=qt(t);return Zt(e,-l)}function pl(e){Xt(1,arguments);var t=1,l=Jt(e),n=l.getUTCDay(),i=(n<t?7:0)+n-t;return l.setUTCDate(l.getUTCDate()-i),l.setUTCHours(0,0,0,0),l}function ml(e){Xt(1,arguments);var t=Jt(e),l=t.getUTCFullYear(),n=new Date(0);n.setUTCFullYear(l+1,0,4),n.setUTCHours(0,0,0,0);var i=pl(n),o=new Date(0);o.setUTCFullYear(l,0,4),o.setUTCHours(0,0,0,0);var a=pl(o);return t.getTime()>=i.getTime()?l+1:t.getTime()>=a.getTime()?l:l-1}function El(e){Xt(1,arguments);var t=ml(e),l=new Date(0);l.setUTCFullYear(t,0,4),l.setUTCHours(0,0,0,0);var n=pl(l);return n}function fl(e,t){Xt(1,arguments);var l=t||{},n=l.locale,i=n&&n.options&&n.options.weekStartsOn,o=null==i?0:qt(i),a=null==l.weekStartsOn?o:qt(l.weekStartsOn);if(!(a>=0&&a<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var r=Jt(e),u=r.getUTCDay(),d=(u<a?7:0)+u-a;return r.setUTCDate(r.getUTCDate()-d),r.setUTCHours(0,0,0,0),r}function _l(e,t){Xt(1,arguments);var l=Jt(e),n=l.getUTCFullYear(),i=t||{},o=i.locale,a=o&&o.options&&o.options.firstWeekContainsDate,r=null==a?1:qt(a),u=null==i.firstWeekContainsDate?r:qt(i.firstWeekContainsDate);if(!(u>=1&&u<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var d=new Date(0);d.setUTCFullYear(n+1,0,u),d.setUTCHours(0,0,0,0);var s=fl(d,t),c=new Date(0);c.setUTCFullYear(n,0,u),c.setUTCHours(0,0,0,0);var v=fl(c,t);return l.getTime()>=s.getTime()?n+1:l.getTime()>=v.getTime()?n:n-1}function gl(e,t){Xt(1,arguments);var l=t||{},n=l.locale,i=n&&n.options&&n.options.firstWeekContainsDate,o=null==i?1:qt(i),a=null==l.firstWeekContainsDate?o:qt(l.firstWeekContainsDate),r=_l(e,t),u=new Date(0);u.setUTCFullYear(r,0,a),u.setUTCHours(0,0,0,0);var d=fl(u,t);return d}function Al(e,t){for(var l=e<0?"-":"",n=Math.abs(e).toString();n.length<t;)n="0"+n;return l+n}var Sl={G:function(e,t,l){var n=e.getUTCFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return l.era(n,{width:"abbreviated"});case"GGGGG":return l.era(n,{width:"narrow"});case"GGGG":default:return l.era(n,{width:"wide"})}},y:function(e,t,l){if("yo"===t){var n=e.getUTCFullYear();return l.ordinalNumber(n>0?n:1-n,{unit:"year"})}return function(e,t){var l=e.getUTCFullYear(),n=l>0?l:1-l;return Al("yy"===t?n%100:n,t.length)}(e,t)},Y:function(e,t,l,n){var i=_l(e,n),o=i>0?i:1-i;return"YY"===t?Al(o%100,2):"Yo"===t?l.ordinalNumber(o,{unit:"year"}):Al(o,t.length)},R:function(e,t){return Al(ml(e),t.length)},u:function(e,t){return Al(e.getUTCFullYear(),t.length)},Q:function(e,t,l){var n=Math.ceil((e.getUTCMonth()+1)/3);switch(t){case"Q":return String(n);case"QQ":return Al(n,2);case"Qo":return l.ordinalNumber(n,{unit:"quarter"});case"QQQ":return l.quarter(n,{width:"abbreviated",context:"formatting"});case"QQQQQ":return l.quarter(n,{width:"narrow",context:"formatting"});case"QQQQ":default:return l.quarter(n,{width:"wide",context:"formatting"})}},q:function(e,t,l){var n=Math.ceil((e.getUTCMonth()+1)/3);switch(t){case"q":return String(n);case"qq":return Al(n,2);case"qo":return l.ordinalNumber(n,{unit:"quarter"});case"qqq":return l.quarter(n,{width:"abbreviated",context:"standalone"});case"qqqqq":return l.quarter(n,{width:"narrow",context:"standalone"});case"qqqq":default:return l.quarter(n,{width:"wide",context:"standalone"})}},M:function(e,t,l){var n=e.getUTCMonth();switch(t){case"M":case"MM":return function(e,t){var l=e.getUTCMonth();return"M"===t?String(l+1):Al(l+1,2)}(e,t);case"Mo":return l.ordinalNumber(n+1,{unit:"month"});case"MMM":return l.month(n,{width:"abbreviated",context:"formatting"});case"MMMMM":return l.month(n,{width:"narrow",context:"formatting"});case"MMMM":default:return l.month(n,{width:"wide",context:"formatting"})}},L:function(e,t,l){var n=e.getUTCMonth();switch(t){case"L":return String(n+1);case"LL":return Al(n+1,2);case"Lo":return l.ordinalNumber(n+1,{unit:"month"});case"LLL":return l.month(n,{width:"abbreviated",context:"standalone"});case"LLLLL":return l.month(n,{width:"narrow",context:"standalone"});case"LLLL":default:return l.month(n,{width:"wide",context:"standalone"})}},w:function(e,t,l,n){var i=function(e,t){Xt(1,arguments);var l=Jt(e),n=fl(l,t).getTime()-gl(l,t).getTime();return Math.round(n/6048e5)+1}(e,n);return"wo"===t?l.ordinalNumber(i,{unit:"week"}):Al(i,t.length)},I:function(e,t,l){var n=function(e){Xt(1,arguments);var t=Jt(e),l=pl(t).getTime()-El(t).getTime();return Math.round(l/6048e5)+1}(e);return"Io"===t?l.ordinalNumber(n,{unit:"week"}):Al(n,t.length)},d:function(e,t,l){return"do"===t?l.ordinalNumber(e.getUTCDate(),{unit:"date"}):function(e,t){return Al(e.getUTCDate(),t.length)}(e,t)},D:function(e,t,l){var n=function(e){Xt(1,arguments);var t=Jt(e),l=t.getTime();t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0);var n=t.getTime(),i=l-n;return Math.floor(i/864e5)+1}(e);return"Do"===t?l.ordinalNumber(n,{unit:"dayOfYear"}):Al(n,t.length)},E:function(e,t,l){var n=e.getUTCDay();switch(t){case"E":case"EE":case"EEE":return l.day(n,{width:"abbreviated",context:"formatting"});case"EEEEE":return l.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return l.day(n,{width:"short",context:"formatting"});case"EEEE":default:return l.day(n,{width:"wide",context:"formatting"})}},e:function(e,t,l,n){var i=e.getUTCDay(),o=(i-n.weekStartsOn+8)%7||7;switch(t){case"e":return String(o);case"ee":return Al(o,2);case"eo":return l.ordinalNumber(o,{unit:"day"});case"eee":return l.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return l.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return l.day(i,{width:"short",context:"formatting"});case"eeee":default:return l.day(i,{width:"wide",context:"formatting"})}},c:function(e,t,l,n){var i=e.getUTCDay(),o=(i-n.weekStartsOn+8)%7||7;switch(t){case"c":return String(o);case"cc":return Al(o,t.length);case"co":return l.ordinalNumber(o,{unit:"day"});case"ccc":return l.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return l.day(i,{width:"narrow",context:"standalone"});case"cccccc":return l.day(i,{width:"short",context:"standalone"});case"cccc":default:return l.day(i,{width:"wide",context:"standalone"})}},i:function(e,t,l){var n=e.getUTCDay(),i=0===n?7:n;switch(t){case"i":return String(i);case"ii":return Al(i,t.length);case"io":return l.ordinalNumber(i,{unit:"day"});case"iii":return l.day(n,{width:"abbreviated",context:"formatting"});case"iiiii":return l.day(n,{width:"narrow",context:"formatting"});case"iiiiii":return l.day(n,{width:"short",context:"formatting"});case"iiii":default:return l.day(n,{width:"wide",context:"formatting"})}},a:function(e,t,l){var n=e.getUTCHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return l.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"aaa":return l.dayPeriod(n,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return l.dayPeriod(n,{width:"narrow",context:"formatting"});case"aaaa":default:return l.dayPeriod(n,{width:"wide",context:"formatting"})}},b:function(e,t,l){var n,i=e.getUTCHours();switch(n=12===i?"noon":0===i?"midnight":i/12>=1?"pm":"am",t){case"b":case"bb":return l.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"bbb":return l.dayPeriod(n,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return l.dayPeriod(n,{width:"narrow",context:"formatting"});case"bbbb":default:return l.dayPeriod(n,{width:"wide",context:"formatting"})}},B:function(e,t,l){var n,i=e.getUTCHours();switch(n=i>=17?"evening":i>=12?"afternoon":i>=4?"morning":"night",t){case"B":case"BB":case"BBB":return l.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"BBBBB":return l.dayPeriod(n,{width:"narrow",context:"formatting"});case"BBBB":default:return l.dayPeriod(n,{width:"wide",context:"formatting"})}},h:function(e,t,l){if("ho"===t){var n=e.getUTCHours()%12;return 0===n&&(n=12),l.ordinalNumber(n,{unit:"hour"})}return function(e,t){return Al(e.getUTCHours()%12||12,t.length)}(e,t)},H:function(e,t,l){return"Ho"===t?l.ordinalNumber(e.getUTCHours(),{unit:"hour"}):function(e,t){return Al(e.getUTCHours(),t.length)}(e,t)},K:function(e,t,l){var n=e.getUTCHours()%12;return"Ko"===t?l.ordinalNumber(n,{unit:"hour"}):Al(n,t.length)},k:function(e,t,l){var n=e.getUTCHours();return 0===n&&(n=24),"ko"===t?l.ordinalNumber(n,{unit:"hour"}):Al(n,t.length)},m:function(e,t,l){return"mo"===t?l.ordinalNumber(e.getUTCMinutes(),{unit:"minute"}):function(e,t){return Al(e.getUTCMinutes(),t.length)}(e,t)},s:function(e,t,l){return"so"===t?l.ordinalNumber(e.getUTCSeconds(),{unit:"second"}):function(e,t){return Al(e.getUTCSeconds(),t.length)}(e,t)},S:function(e,t){return function(e,t){var l=t.length,n=e.getUTCMilliseconds();return Al(Math.floor(n*Math.pow(10,l-3)),t.length)}(e,t)},X:function(e,t,l,n){var i=(n._originalDate||e).getTimezoneOffset();if(0===i)return"Z";switch(t){case"X":return bl(i);case"XXXX":case"XX":return yl(i);case"XXXXX":case"XXX":default:return yl(i,":")}},x:function(e,t,l,n){var i=(n._originalDate||e).getTimezoneOffset();switch(t){case"x":return bl(i);case"xxxx":case"xx":return yl(i);case"xxxxx":case"xxx":default:return yl(i,":")}},O:function(e,t,l,n){var i=(n._originalDate||e).getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+hl(i,":");case"OOOO":default:return"GMT"+yl(i,":")}},z:function(e,t,l,n){var i=(n._originalDate||e).getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+hl(i,":");case"zzzz":default:return"GMT"+yl(i,":")}},t:function(e,t,l,n){return Al(Math.floor((n._originalDate||e).getTime()/1e3),t.length)},T:function(e,t,l,n){return Al((n._originalDate||e).getTime(),t.length)}};function hl(e,t){var l=e>0?"-":"+",n=Math.abs(e),i=Math.floor(n/60),o=n%60;if(0===o)return l+String(i);var a=t||"";return l+String(i)+a+Al(o,2)}function bl(e,t){return e%60==0?(e>0?"-":"+")+Al(Math.abs(e)/60,2):yl(e,t)}function yl(e,t){var l=t||"",n=e>0?"-":"+",i=Math.abs(e);return n+Al(Math.floor(i/60),2)+l+Al(i%60,2)}function Cl(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 Tl(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 Dl={p:Tl,P:function(e,t){var l,n=e.match(/(P+)(p+)?/)||[],i=n[1],o=n[2];if(!o)return Cl(e,t);switch(i){case"P":l=t.dateTime({width:"short"});break;case"PP":l=t.dateTime({width:"medium"});break;case"PPP":l=t.dateTime({width:"long"});break;case"PPPP":default:l=t.dateTime({width:"full"})}return l.replace("{{date}}",Cl(i,t)).replace("{{time}}",Tl(o,t))}},Nl=["D","DD"],Pl=["YY","YYYY"];function Il(e){return-1!==Nl.indexOf(e)}function Ll(e){return-1!==Pl.indexOf(e)}function Bl(e,t,l){if("YYYY"===e)throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(t,"`) for formatting years to the input `").concat(l,"`; 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(l,"`; 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(l,"`; 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(l,"`; see: https://git.io/fxCyr"))}var Ol=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Rl=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,wl=/^'([^]*?)'?$/,xl=/''/g,Ml=/[a-zA-Z]/;function Fl(e,t,l){Xt(2,arguments);var n=String(t),i=l||{},o=i.locale||cl,a=o.options&&o.options.firstWeekContainsDate,r=null==a?1:qt(a),u=null==i.firstWeekContainsDate?r:qt(i.firstWeekContainsDate);if(!(u>=1&&u<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var d=o.options&&o.options.weekStartsOn,s=null==d?0:qt(d),c=null==i.weekStartsOn?s:qt(i.weekStartsOn);if(!(c>=0&&c<=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=Jt(e);if(!tl(v))throw new RangeError("Invalid time value");var p=Qt(v),m=vl(v,p),E={firstWeekContainsDate:u,weekStartsOn:c,locale:o,_originalDate:v},f=n.match(Rl).map(function(e){var t=e[0];return"p"===t||"P"===t?(0,Dl[t])(e,o.formatLong,E):e}).join("").match(Ol).map(function(l){if("''"===l)return"'";var n=l[0];if("'"===n)return kl(l);var a=Sl[n];if(a)return!i.useAdditionalWeekYearTokens&&Ll(l)&&Bl(l,t,e),!i.useAdditionalDayOfYearTokens&&Il(l)&&Bl(l,t,e),a(m,l,o.localize,E);if(n.match(Ml))throw new RangeError("Format string contains an unescaped latin alphabet character `"+n+"`");return l}).join("");return f}function kl(e){return e.match(wl)[1].replace(xl,"'")}const Ul=e=>{let{parentRoute:r}=e;window.scroll(0,0);const{t:u}=n.useTranslation(),d=Digit.ULBService.getCurrentTenantId(),c={},v={moduleName:"bpa-services",applicationStatus:[],locality:[],assignee:"ASSIGNED_TO_ALL",applicationType:[]},p={sortBy:"",limit:Digit.Utils.browser.isMobile()?50:10,offset:0,sortOrder:"DESC"},m=Digit.SessionStorage.get("OBPS.INBOX"),E=t.useMemo(()=>m||{filterForm:v,searchForm:c,tableForm:p},[Object.values((null==m?void 0:m.filterForm)||{}),Object.values((null==m?void 0:m.searchForm)||{}),Object.values((null==m?void 0:m.tableForm)||{})]),[f,_]=t.useReducer(function(e,t){switch(t.action){case"mutateSearchForm":return Digit.SessionStorage.set("OBPS.INBOX",{...e,searchForm:t.data}),{...e,searchForm:t.data};case"mutateFilterForm":return Digit.SessionStorage.set("OBPS.INBOX",{...e,filterForm:t.data}),{...e,filterForm:t.data};case"mutateTableForm":return Digit.SessionStorage.set("OBPS.INBOX",{...e,tableForm:t.data}),{...e,tableForm:t.data}}},E),{data:g,isLoading:A}=Digit.Hooks.useBoundaryLocalities(d,"revenue",{},u),{isLoading:S,data:{table:h,statuses:b,totalCount:y}={}}=Digit.Hooks.obps.useBPAInbox({tenantId:d,filters:{...f}}),C={logoIcon:l.createElement(o.CaseIcon,null),headerText:"CS_COMMON_OBPS",links:[{text:u("BPA_SEARCH_PAGE_TITLE"),link:window.location.href.includes("/citizen")?"/digit-ui/citizen/obps/search/application":"/digit-ui/employee/obps/search/application",businessService:"BPA",roles:["BPAREG_EMPLOYEE","BPAREG_APPROVER","BPAREG_DOC_VERIFIER","BPAREG_DOC_VERIFIER"]}]},T=t.useCallback(e=>{let{registerRef:t,searchFormState:n,searchFieldComponents:i}=e;return l.createElement(Vt,{registerRef:t,searchFormState:n,searchFieldComponents:i})},[]),D=t.useCallback(e=>{let{registerRef:t,controlFilterForm:n,setFilterFormValue:i,getFilterFormValue:o}=e;return l.createElement(Kt,{statuses:b,isInboxLoading:S,registerRef:t,controlFilterForm:n,setFilterFormValue:i,filterFormState:null==f?void 0:f.filterForm,getFilterFormValue:o,localitiesForEmployeesCurrentTenant:g,loadingLocalitiesForEmployeesCurrentTenant:A})},[b,S,g,A]),N={SearchFormFields:T,onSearchFormSubmit:e=>{e.hasOwnProperty("")&&(null==e||delete e[""]),_({action:"mutateTableForm",data:{...p}}),_({action:"mutateSearchForm",data:e})},searchFormDefaultValues:null==f?void 0:f.searchForm,resetSearchFormDefaultValues:c,onSearchFormReset:e=>{e("mobileNumber",null),e("applicationNo",null),_({action:"mutateSearchForm",data:c})}},P={FilterFormFields:D,onFilterFormSubmit:e=>{e.hasOwnProperty("")&&(null==e||delete e[""]),_({action:"mutateTableForm",data:{...p}}),_({action:"mutateFilterForm",data:e})},filterFormDefaultValues:null==f?void 0:f.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 o,a,r,u;let{parentRoute:d,onPageSizeChange:s,formState:c,totalCount:v,table:p,dispatch:m,onSortingByData:E}=e;const f=e=>l.createElement("span",{className:"cell-text styled-cell"},e),{t:_}=n.useTranslation(),g=t.useMemo(()=>[{Header:_("BPA_APPLICATION_NUMBER_LABEL"),accessor:"applicationNo",disableSortBy:!0,Cell:e=>{let{row:t}=e;return l.createElement("div",null,l.createElement(i.Link,{to:window.location.href.includes("/citizen")?`${d}/bpa/${t.original.applicationId}`:`${d}/inbox/bpa/${t.original.applicationId}`},l.createElement("span",{className:"link"},t.original.applicationId)))}},{Header:_("CS_APPLICATION_DETAILS_APPLICATION_DATE"),accessor:"applicationDate",Cell:e=>{var t,l;let{row:n}=e;return null!==(t=n.original)&&void 0!==t&&t.date?f(Fl(new Date(null===(l=n.original)||void 0===l?void 0:l.date),"dd/MM/yyyy")):""}},{Header:_("CS_APPLICATION_DETAILS_SUBMISSION_DATE"),accessor:"submissionDate",Cell:e=>{var t,l;let{row:n}=e;return null!==(t=n.original)&&void 0!==t&&t.submissionDate?f(Fl(new Date(null===(l=n.original)||void 0===l?void 0:l.submissionDate),"dd/MM/yyyy")):"NA"}},{Header:_("ES_INBOX_LOCALITY"),accessor:e=>_(null==e?void 0:e.locality),disableSortBy:!0},{Header:_("EVENTS_STATUS_LABEL"),accessor:e=>_(null!=e&&e.state?`WF_${null==e?void 0:e.businessService}_${null==e?void 0:e.state}`:`WF_${null==e?void 0:e.businessService}_${null==e?void 0:e.status}`),disableSortBy:!0},{Header:_("WF_INBOX_HEADER_OWNER_NAME"),accessor:e=>_(null==e?void 0:e.owner),disableSortBy:!0},{Header:_("BPA_SEARCH_APPLICATION_TYPE_LABEL"),accessor:e=>_(null==e?void 0:e.applicationType),disableSortBy:!0},{Header:_("ES_INBOX_SLA_DAYS_REMAINING"),accessor:e=>(e=>"CS_NA"===e?_(e):l.createElement("span","Active"===e||e>0?{className:"sla-cell-success"}:{className:"sla-cell-error"},e))(null==e?void 0:e.sla)}]);return{getCellProps:e=>({style:{padding:"20px 18px",fontSize:"16px"}}),disableSort:!1,autoSort:!1,manualPagination:!0,initSortId:"applicationDate",onPageSizeChange:s,currentPage:(null===(o=c.tableForm)||void 0===o?void 0:o.offset)/(null===(a=c.tableForm)||void 0===a?void 0:a.limit),onNextPage:()=>{var e,t;return m({action:"mutateTableForm",data:{...c.tableForm,offset:parseInt(null===(e=c.tableForm)||void 0===e?void 0:e.offset)+parseInt(null===(t=c.tableForm)||void 0===t?void 0:t.limit)}})},onPrevPage:()=>{var e,t;return m({action:"mutateTableForm",data:{...c.tableForm,offset:parseInt(null===(e=c.tableForm)||void 0===e?void 0:e.offset)-parseInt(null===(t=c.tableForm)||void 0===t?void 0:t.limit)}})},pageSizeLimit:null===(r=c.tableForm)||void 0===r?void 0:r.limit,onSort:E,totalRecords:v,onSearch:null==c||null===(u=c.searchForm)||void 0===u?void 0:u.message,onLastPage:()=>{var e;return m({action:"mutateTableForm",data:{...c.tableForm,offset:10*Math.ceil(v/10)-parseInt(null===(e=c.tableForm)||void 0===e?void 0:e.limit)}})},onFirstPage:()=>m({action:"mutateTableForm",data:{...c.tableForm,offset:0}}),data:p,columns:g}})({parentRoute:r,onPageSizeChange:e=>{_({action:"mutateTableForm",data:{...f.tableForm,limit:e.target.value}})},formState:f,totalCount:y,table:h,dispatch:_,onSortingByData:e=>{if(e.length>0){const[{id:t,desc:l}]=e,n=l?"DESC":"ASC";f.tableForm.sortBy===t&&f.tableForm.sortOrder===n||_({action:"mutateTableForm",data:{...f.tableForm,sortBy:t,sortOrder:l?"DESC":"ASC"}})}}}),L=(e=>{let{table:t,getRedirectionLink:i}=e;const{t:r}=n.useTranslation();return{data:null==t?void 0:t.map(e=>{let{applicationId:t,date:l,applicationType:n,businessService:i,locality:o,status:a,owner:u,sla:d,state:s}=e;return{[r("BPA_APPLICATION_NUMBER_LABEL")]:t,[r("CS_APPLICATION_DETAILS_APPLICATION_DATE")]:Fl(new Date(l),"dd/MM/yyyy"),[r("BPA_SEARCH_APPLICATION_TYPE_LABEL")]:r(n),[r("ES_INBOX_LOCALITY")]:r(o),[r("EVENTS_STATUS_LABEL")]:r(s?`WF_${i}_${s}`:`WF_${i}_${a}`),[r("WF_INBOX_HEADER_CURRENT_OWNER")]:u,[r("ES_INBOX_SLA_DAYS_REMAINING")]:d}}),isTwoDynamicPrefix:!0,linkPrefix:window.location.href.includes("/citizen")?"/digit-ui/citizen/obps/":"/digit-ui/employee/obps/",getRedirectionLink:i,serviceRequestIdKey:"applicationNo",MobileSortFormValues:()=>{const e=[{code:"DESC",i18nKey:"ES_COMMON_SORT_BY_DESC"},{code:"ASC",i18nKey:"ES_COMMON_SORT_BY_ASC"}],{control:t}=a.useFormContext();return l.createElement(o.SearchField,null,l.createElement(a.Controller,{name:"sortOrder",control:t,render:t=>{let{onChange:n,value:i}=t;return l.createElement(o.RadioButtons,{onSelect:e=>{n(e.code)},selectedOption:e.filter(e=>e.code===i)[0],optionsKey:"i18nKey",name:"sortOrder",options:e})}}))}}})({parentRoute:r,table:h,getRedirectionLink:e=>{let t="";return t="BPAREG"===e?"search/application/stakeholder":window.location.href.includes("/citizen")?"bpa":"search/application/bpa",t}}),B={onMobileSortOrderData:e=>{const{sortOrder:t}=e;_({action:"mutateTableForm",data:{...f.tableForm,sortOrder:t}})},sortFormDefaultValues:null==f?void 0:f.tableForm,onSortFormReset:e=>{e("sortOrder","DESC"),_({action:"mutateTableForm",data:p})}};return l.createElement(t.Fragment,null,l.createElement(o.Header,null,u("ES_COMMON_INBOX"),y?l.createElement("p",{className:"inbox-count"},y):null),Digit.Utils.browser.isMobile()&&l.createElement("div",{style:{marginLeft:"12px"}},l.createElement(i.Link,{to:window.location.href.includes("/citizen")?"/digit-ui/citizen/obps/search/application":"/digit-ui/employee/obps/search/application"},l.createElement("span",{className:"link"},u("BPA_SEARCH_PAGE_TITLE")))),l.createElement(o.InboxComposer,s({isInboxLoading:S,PropsForInboxLinks:C},N,P,B,{propsForInboxTable:I,propsForInboxMobileCards:L,formState:f})))},Hl=e=>{var t,a,r,u,d,c,v,p,m,E,f,_,g,A,S,h,b,y,C,T,D,N,P,I;let{path:L}=e;const B=i.useLocation(),{t:O}=n.useTranslation();window.location.href.includes("/ws/create-application/property-details"),window.location.href.includes("/acknowledgement")||window.location.href.includes("/disconnect-acknowledge");const R=null===(t=Digit)||void 0===t||null===(a=t.ComponentRegistryService)||void 0===a?void 0:a.getComponent("BPACitizenHomeScreen"),w=null===(r=Digit)||void 0===r||null===(u=r.ComponentRegistryService)||void 0===u?void 0:u.getComponent("ObpsCreateEDCR"),x=null===(d=Digit)||void 0===d||null===(c=d.ComponentRegistryService)||void 0===c?void 0:c.getComponent("ObpsCreateOCEDCR"),M=null===(v=Digit)||void 0===v||null===(p=v.ComponentRegistryService)||void 0===p?void 0:p.getComponent("ObpsNewBuildingPermit"),F=null===(m=Digit)||void 0===m||null===(E=m.ComponentRegistryService)||void 0===E?void 0:E.getComponent("ObpsOCBuildingPermit"),k=null===(f=Digit)||void 0===f||null===(_=f.ComponentRegistryService)||void 0===_?void 0:_.getComponent("ObpsStakeholderRegistration"),U=null===(g=Digit)||void 0===g||null===(A=g.ComponentRegistryService)||void 0===A?void 0:A.getComponent("ObpsEdcrInbox"),H=null===(S=Digit)||void 0===S||null===(h=S.ComponentRegistryService)||void 0===h?void 0:h.getComponent("ObpsCitizenBpaApplicationDetail"),W=null===(b=Digit)||void 0===b||null===(y=b.ComponentRegistryService)||void 0===y?void 0:y.getComponent("ObpsBPASendToArchitect"),j=null===(C=Digit)||void 0===C||null===(T=C.ComponentRegistryService)||void 0===T?void 0:T.getComponent("ObpsOCSendToArchitect"),$=null===(D=Digit)||void 0===D||null===(N=D.ComponentRegistryService)||void 0===N?void 0:N.getComponent("ObpsBPASendBackToCitizen"),Y=null===(P=Digit)||void 0===P||null===(I=P.ComponentRegistryService)||void 0===I?void 0:I.getComponent("ObpsOCSendBackToCitizen"),z="true"===sessionStorage.getItem("clickOnBPAApplyAfterEDCR");return l.createElement(l.Fragment,null,l.createElement("div",{className:"ws-citizen-wrapper"},!B.pathname.includes("response")&&!B.pathname.includes("openlink/stakeholder")&&!B.pathname.includes("/acknowledgement")&&!z&&l.createElement(o.BackButton,{style:{border:"none"}},O("CS_COMMON_BACK")),l.createElement(i.Switch,null,l.createElement(o.PrivateRoute,{path:L+"/home",component:R}),l.createElement(o.PrivateRoute,{path:L+"/search/application",component:e=>l.createElement(Ht,s({},e,{parentRoute:L}))}),l.createElement(o.PrivateRoute,{path:L+"/search/obps-application",component:e=>l.createElement(Ht,s({},e,{parentRoute:L}))}),l.createElement(o.PrivateRoute,{path:L+"/edcrscrutiny/apply",component:w}),l.createElement(o.PrivateRoute,{path:L+"/edcrscrutiny/oc-apply",component:x}),l.createElement(o.PrivateRoute,{path:L+"/bpa/:applicationType/:serviceType",component:M}),l.createElement(o.PrivateRoute,{path:L+"/ocbpa/:applicationType/:serviceType",component:F}),l.createElement(o.PrivateRoute,{path:L+"/stakeholder/apply",component:k}),l.createElement(i.Route,{path:L+"/openlink/stakeholder/apply",component:k}),l.createElement(o.PrivateRoute,{path:L+"/my-applications",component:Wt}),l.createElement(o.PrivateRoute,{path:L+"/bpa/inbox",component:e=>l.createElement(Ul,s({},e,{parentRoute:L}))}),l.createElement(o.PrivateRoute,{path:L+"/edcr/inbox",component:e=>l.createElement(U,s({},e,{parentRoute:L}))}),l.createElement(o.PrivateRoute,{path:L+"/stakeholder/:id",component:zt}),l.createElement(o.PrivateRoute,{path:L+"/bpa/:id",component:H}),l.createElement(o.PrivateRoute,{path:L+"/editApplication/bpa/:tenantId/:applicationNo",component:W}),l.createElement(o.PrivateRoute,{path:L+"/editApplication/ocbpa/:tenantId/:applicationNo",component:j}),l.createElement(o.PrivateRoute,{path:L+"/sendbacktocitizen/bpa/:tenantId/:applicationNo",component:$}),l.createElement(o.PrivateRoute,{path:L+"/sendbacktocitizen/ocbpa/:tenantId/:applicationNo",component:Y}),l.createElement(o.PrivateRoute,{path:L+"/response",component:Gt}))))},Wl=e=>{let{statuses:i,isInboxLoading:r,controlFilterForm:u,setFilterFormValue:d}=e;const{t:s}=n.useTranslation(),c=[{code:"ASSIGNED_TO_ME",name:""+s("ES_INBOX_ASSIGNED_TO_ME")},{code:"ASSIGNED_TO_ALL",name:""+s("ES_INBOX_ASSIGNED_TO_ALL")}],v=Digit.ULBService.getStateId(),{data:p,isLoading:m}=Digit.Hooks.obps.useMDMS(v,"StakeholderRegistraition","TradeTypetoRoleMapping",{select:e=>{var t;return null==e||null===(t=e.StakeholderRegistraition)||void 0===t?void 0:t.TradeTypetoRoleMapping.reduce((e,t)=>{const l=t.tradeType.split(".")[0];return e.find(e=>e.i18nKey.includes(l))?e:[...e,{role:t.role[0],i18nKey:"TRADELICENSE_TRADETYPE_"+t.tradeType.split(".")[0],tradeType:t.tradeType,identifier:l}]},[])}}),E=a.useWatch({control:u,name:"businessService",defaultValue:null});return l.createElement(t.Fragment,null,l.createElement(o.FilterFormField,null,l.createElement(a.Controller,{name:"assignee",control:u,render:e=>l.createElement(o.RadioButtons,{onSelect:t=>{e.onChange(t.code)},selectedOption:c.filter(t=>t.code===e.value)[0],optionsKey:"name",name:"assignee",options:c})})),l.createElement(o.FilterFormField,null,l.createElement(a.Controller,{name:"businessService",control:u,render:e=>m?l.createElement(o.Loader,null):l.createElement(t.Fragment,null,l.createElement("div",{className:"filter-label sub-filter-label",style:{fontSize:"18px",fontWeight:"600"}},s("BPA_LICENSE_TYPE")),l.createElement(o.RadioButtons,{onSelect:t=>{d("applicationStatus",[]),e.onChange(t)},selectedOption:e.value,optionsKey:"i18nKey",options:p}))})),E?l.createElement(o.FilterFormField,null,l.createElement("div",{className:"filter-label",style:{fontSize:"18px",fontWeight:"600"}},s("ACTION_TEST_APPLICATION_STATUS")),l.createElement(a.Controller,{name:"applicationStatus",control:u,render:e=>{const n=t.useMemo(()=>{var t;return null==i||null===(t=i.filter(e=>e.businessservice===E.identifier))||void 0===t?void 0:t.map((t,n)=>{var i;return l.createElement(o.CheckBox,{key:n,onChange:l=>{var n;return function(t){e.onChange(t)}(l.target.checked?[...e.value,null==t?void 0:t.statusid]:null===(n=e.value)||void 0===n?void 0:n.filter(e=>e!==(null==t?void 0:t.statusid)))},checked:null===(i=e.value)||void 0===i?void 0:i.includes(null==t?void 0:t.statusid),label:`${s(`WF_${t.businessservice}_${t.applicationstatus}`)} (${t.count})`})})},[e.value,i,E]);return l.createElement(t.Fragment,null,r?l.createElement(o.Loader,null):l.createElement(t.Fragment,null,n))}})):null)},jl=e=>{var i,a,r,u;let{registerRef:d,searchFormState:s,searchFieldComponents:c}=e;const{t:v}=n.useTranslation();var p,m,E,f;return window.Digit.Utils.browser.isMobile()?l.createElement(t.Fragment,null,l.createElement(o.SearchField,null,l.createElement("label",null,v("BPA_APPLICATION_NUMBER_LABEL")),l.createElement(o.TextInput,{name:"applicationNo",inputRef:d({})})),l.createElement(o.SearchField,null,l.createElement("label",null,v("CORE_COMMON_MOBILE_NUMBER")),l.createElement(o.MobileNumber,{name:"mobileNumber",type:"number",inputRef:d({minLength:{value:10,message:v("CORE_COMMON_MOBILE_ERROR")},maxLength:{value:10,message:v("CORE_COMMON_MOBILE_ERROR")},pattern:{value:/[6789][0-9]{9}/,message:v("CORE_COMMON_MOBILE_ERROR")}})}),null!=s&&null!==(i=s.errors)&&void 0!==i&&null!==(a=i.mobileNumber)&&void 0!==a&&a.message?l.createElement(o.CardLabelError,null,null==s||null===(r=s.errors)||void 0===r||null===(u=r.mobileNumber)||void 0===u?void 0:u.message):null)):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(o.SearchField,null,l.createElement("label",null,v("BPA_APPLICATION_NUMBER_LABEL")),l.createElement(o.TextInput,{name:"applicationNo",inputRef:d({})})),l.createElement(o.SearchField,null,l.createElement("label",null,v("CORE_COMMON_MOBILE_NUMBER")),l.createElement(o.MobileNumber,{name:"mobileNumber",type:"number",inputRef:d({minLength:{value:10,message:v("CORE_COMMON_MOBILE_ERROR")},maxLength:{value:10,message:v("CORE_COMMON_MOBILE_ERROR")},pattern:{value:/[6789][0-9]{9}/,message:v("CORE_COMMON_MOBILE_ERROR")}})}),null!=s&&null!==(p=s.errors)&&void 0!==p&&null!==(m=p.mobileNumber)&&void 0!==m&&m.message?l.createElement(o.CardLabelError,null,null==s||null===(E=s.errors)||void 0===E||null===(f=E.mobileNumber)||void 0===f?void 0:f.message):null),l.createElement("div",{className:"search-action-wrapper",style:{width:"100%"}},c)))))};let $l=[];const Yl=e=>{let{currentStep:t=1,flow:i=""}=e;const{t:a}=n.useTranslation(),r=window.Digit.Utils.browser.isMobile();return(e=>{switch(e){case"STAKEHOLDER":$l=["BPA_LICENSE_DETAILS_LABEL","BPA_NEW_ADDRESS_HEADER_DETAILS","BPA_DOC_DETAILS_SUMMARY","BPA_STEPPER_SUMMARY_HEADER"];break;case"OCBPA":$l=["BPA_BASIC_AND_PLOT_DETAILS_LABEL","BPA_SCRUTINY_DETAILS","BPA_DOCUMENT_AND_NOC_DETAILS_LABEL","BPA_STEPPER_SUMMARY_HEADER"];break;default:$l=["BPA_STEPPER_SCRUTINY_DETAILS_HEADER","COLONY_DETAILS","BPA_OWNER_AND_DOCUMENT_DETAILS_LABEL","BPA_STEPPER_SUMMARY_HEADER"]}})(i),l.createElement("div",{className:"timeline-container",style:r?{}:{margin:"0 8px 15px"}},$l.map((e,n,i)=>l.createElement("div",{className:"timeline-checkpoint",key:n},l.createElement("div",{className:"timeline-content"},l.createElement("span",{className:"circle "+(n<=t-1&&"active")},n<t-1?l.createElement(o.TickMark,null):n+1),l.createElement("span",{className:"secondary-color"},a(e))),n<i.length-1&&l.createElement("span",{className:"line "+(n<t-1&&"active")}))))};function zl(e){let{documents:t,svgStyles:i={},isSendBackFlow:a=!1,isHrLine:r=!1,titleStyles:u}=e;const{t:d}=n.useTranslation(),s=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"}},!s&&(null==t?void 0:t.map((e,n)=>{var i,s,c;return l.createElement(l.Fragment,{key:n},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((t,n)=>{var i;return l.createElement("div",{style:{width:"180px"}},l.createElement(o.CardSubHeader,{style:u||{marginTop:"32px",marginBottom:"8px",color:"#505A5F",fontSize:"24px"}},d(null==e?void 0:e.title)),l.createElement("a",{target:"_",href:null==t?void 0:t.url,style:{minWidth:"80px",marginRight:"10px",maxWidth:"100px",height:"auto",minWidth:"100px"},key:n},l.createElement("div",{style:{display:"flex",justifyContent:"flex-start"}},l.createElement(o.PDFSvg,null)),l.createElement("p",{style:{marginTop:"8px",fontWeight:"bold",textAlign:"start",color:"#505A5F"}},d(null==t?void 0:t.title)),a?null!=t&&null!==(i=t.documentType)&&void 0!==i&&i.includes("NOC")?l.createElement("p",{style:{textAlign:"center"}},d(null==t?void 0:t.documentType.split(".")[1])):l.createElement("p",{style:{textAlign:"center"}},d(null==t?void 0:t.documentType)):""))}):!window.location.href.includes("citizen")&&l.createElement("div",null,l.createElement("p",null,d("BPA_NO_DOCUMENTS_UPLOADED_LABEL")),l.createElement("div",{style:{width:"180px"}},l.createElement(o.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:n},l.createElement("div",{style:{display:"flex",justifyContent:"flex-start"}},l.createElement(o.PDFSvg,null)),l.createElement("p",{style:{marginTop:"8px",fontWeight:"bold",textAlign:"start",color:"#505A5F"}}),a?(null!==(s=value)&&void 0!==s&&null!==(c=s.documentType)&&void 0!==c&&c.includes("NOC"),l.createElement("p",{style:{textAlign:"center"}})):"")))),r&&(null==t?void 0:t.length)!=n+1?l.createElement("hr",{style:{color:"#D6D5D4",backgroundColor:"#D6D5D4",height:"2px",marginTop:"20px",marginBottom:"20px"}}):null))})),s&&(null==t?void 0:t.map((e,t)=>{var n;return l.createElement(l.Fragment,{key:t},null!=e&&e.title?l.createElement(o.CardSubHeader,{style:{marginTop:"32px",marginBottom:"8px",color:"#505A5F",fontSize:"24px"}},d(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===(n=e.values)||void 0===n?void 0:n.map((e,t)=>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:t},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"}},d(null==e?void 0:e.title)),null!=e&&e.docInfo?l.createElement("div",{style:{fontSize:"12px",color:"#505A5F",fontWeight:400,lineHeight:"15px",marginBottom:"10px"}},""+d(null==e?void 0:e.docInfo)):null,l.createElement(o.PDFSvg,null),l.createElement("p",{style:{marginTop:"8px",fontSize:"16px",lineHeight:"19px",color:"#505A5F",fontWeight:"400",textAlign:"center",color:"#505A5F"}},""+d(null==e?void 0:e.title))))):!window.location.href.includes("citizen")&&l.createElement("div",null,l.createElement("p",null,d("BPA_NO_DOCUMENTS_UPLOADED_LABEL")))))})))}const Gl=l.memo(function(e){var n,i,a;let{t:u,document:d,setDocuments:s,documents:c,formData:v,beforeUploadDocuments:p,setIsNextButtonDisabled:m}=e;const E=(null==c?void 0:c.filter(e=>{var t;return null==e||null===(t=e.documentType)||void 0===t?void 0:t.includes(null==d?void 0:d.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==d?void 0:d.code)})[0]),f=Digit.ULBService.getStateId(),[_,g]=t.useState(E?{...E,active:!0,code:null==E?void 0:E.documentType,i18nKey:null==E?void 0:E.documentType}:(null==d||null===(n=d.dropdownData)||void 0===n?void 0:n.length)>0?null==d?void 0:d.dropdownData[0]:{}),[A,S]=t.useState(null),[h,b]=t.useState(()=>(null==c?void 0:c.filter(e=>{var t;return null==e||null===(t=e.documentType)||void 0===t?void 0:t.includes(null==d?void 0:d.code)}).map(e=>({fileStoreId:null==e?void 0:e.fileStoreId,fileName:(null==e?void 0:e.fileName)||""})))||null),[y,C]=t.useState([]),[T,D]=t.useState([]),[N,P]=t.useState([]||(null==v||null===(i=v.documents)||void 0===i?void 0:i.documents.filter(e=>e.documentType===_.code))),[I,L]=t.useState(null),[B,O]=t.useState(null);function R(e){return e[0]+e[1]/60+e[2]/3600}t.useEffect(()=>{T.length>0&&null!=_&&_.code&&(s(e=>{if(null===h||null==(null==h?void 0:h.fileStoreId))return e;const t=null==e?void 0:e.filter(e=>(null==e?void 0:e.fileStoreId)!==h.fileStoreId);let l=[];return T&&T.map((e,t)=>{var n,i;l.push({documentType:null==_?void 0:_.code,fileStoreId:e.fileStoreId,additionalDetails:{category:null==_?void 0:_.code.split(".").slice(0,2).join("_"),latitude:I,longitude:B},documentUid:e.fileStoreId,fileName:(null===(n=N[t])||void 0===n?void 0:n.name)||"",id:c?null===(i=c.find(e=>e.documentType===(null==_?void 0:_.code)))||void 0===i?void 0:i.id:void 0})}),[...t,...l]}),D([])),null!=_&&_.code&&s(e=>{var t;return null===h||null==(null==h?void 0:h.fileStoreId)?((null==e?void 0:e.length)>0&&(null==e||e.forEach(e=>{var t,l,n,i,o;`${null==e||null===(t=e.documentType)||void 0===t?void 0:t.split(".")[0]}.${null==e||null===(l=e.documentType)||void 0===l?void 0:l.split(".")[1]}`==`${null==_||null===(n=_.code)||void 0===n?void 0:n.split(".")[0]}.${null==_||null===(i=_.code)||void 0===i?void 0:i.split(".")[1]}`&&(null!=e&&e.documentType&&(e.documentType=null==_?void 0:_.code),null!=e&&null!==(o=e.file)&&void 0!==o&&o.documentType&&(e.file.documentType=null==_?void 0:_.code))})),e):[...null==e?void 0:e.filter(e=>(null==e?void 0:e.fileStoreId)!==h.fileStoreId),{documentType:null==_?void 0:_.code,fileStoreId:h.fileStoreId,documentUid:h.fileStoreId,fileName:(null==A?void 0:A.name)||h.fileName||"document",id:c?null===(t=c.find(e=>e.documentType===(null==_?void 0:_.code)))||void 0===t?void 0:t.id:void 0}]})},[h,_]),t.useEffect(()=>{_.code||null===h||D([...T,h])},[h]);const w=t.useMemo(()=>{var e,t;let l=[];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=>l.push([e.fileName,{file:{name:e.fileName,type:e.documentType},fileStoreId:{fileStoreId:e.fileStoreId,tenantId:f}}])),l},[v]);return l.createElement("div",null,l.createElement(o.CardLabel,null,null!=d&&d.required?u(null==d?void 0:d.code)+" *":""+u(null==d?void 0:d.code)),l.createElement(o.Dropdown,{t:u,isMandatory:!1,option:Digit.Utils.locale.sortDropdownNames(null==d?void 0:d.dropdownData,"i18nKey",u),selected:_,optionKey:"i18nKey",select:e=>{if(null!=E&&E.documentType){E.documentType=null==e?void 0:e.code;let t=null==c?void 0:c.filter(e=>{var t;return null==e||null===(t=e.documentType)||void 0===t?void 0:t.includes(null==d?void 0:d.code)});t.map(t=>t.documentType=null==e?void 0:e.code);let l=[...null==c?void 0:c.filter(e=>{var t;return!(null!=e&&null!==(t=e.documentType)&&void 0!==t&&t.includes(null==d?void 0:d.code))}),...t];s(l)}g(e)}}),l.createElement(o.MultiUploadWrapper,{module:"BPA",tenantId:f,getFormState:function(e){let t,l,n=_.code;if((null==e?void 0:e.length)>0)(function(e){return new Promise(t=>{r.getData(e,function(){const e=r.getTag(this,"GPSLatitude"),l=r.getTag(this,"GPSLongitude");if(e&&l){const n=R(e),i=R(l);t({latitude:n,longitude:i})}else t({latitude:null,longitude:null}),"SITEPHOTOGRAPH.ONE"===(null==d?void 0:d.code)&&alert("Please Upload a Photo with Location Details")})})})(e[0][1].file).then(i=>{var o,a,r;console.log("Latitude:",i.latitude),console.log("Longitude:",i.longitude),L(i.latitude),O(i.longitude),"SITEPHOTOGRAPH.ONE"===(null==d?void 0:d.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),l=Object.values(t),l=null==v||null===(o=v.documents)||void 0===o||null===(a=o.documents)||void 0===a?void 0:a.filter(e=>e.documentType===_.code),C(l);let u=[];null==e||e.map((e,t)=>{var l,n,o,a;u.push({documentType:null==_?void 0:_.code,additionalDetails:{category:null==_?void 0:_.code.split(".").slice(0,2).join("_"),latitude:i.latitude,longitude:i.longitude},fileStoreId:null==e||null===(l=e[1])||void 0===l||null===(n=l.fileStoreId)||void 0===n?void 0:n.fileStoreId,documentUid:null==e||null===(o=e[1].fileStoreId)||void 0===o?void 0:o.fileStoreId,fileName:(null==e?void 0:e[0])||"",id:c?null===(a=c.find(e=>e.documentType===(null==_?void 0:_.code)))||void 0===a?void 0:a.id:void 0})});const p=[...c.filter(e=>e.documentType!==n),...u];s(p),null===(r=l)||void 0===r||r.map(e=>{null!=e&&e.file||(e.file={}),e.file.documentType=n,function(e,t){e&&S(e.file),e&&P([...N,e.file])}(e)})}).catch(e=>{console.error("Error extracting geo location:",e)});else if(0==(null==e?void 0:e.length)){const e=[...c.filter(e=>e.documentType!==n)];s(e)}},setuploadedstate:w,t:u,extraStyleName:"OBPS",allowedFileTypesRegex:/(.*?)(jpg|jpeg|png|image|pdf)$/i,allowedMaxSizeInMB:10,acceptFiles:"image/*, .pdf, .png, .jpeg, .jpg"}),(null==d||null===(a=d.uploadedDocuments)||void 0===a?void 0:a.length)&&l.createElement(zl,{isSendBackFlow:!0,documents:null==d?void 0:d.uploadedDocuments}),"SITEPHOTOGRAPH.ONE"===(null==d?void 0:d.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")),m(!1)," "):l.createElement("div",null,l.createElement("p",{style:{color:"red"}},"Please upload a Photo with Location details."),m(!0)," ")))});function Kl(e){var n,i,a;let{t:r,document:u,setNocDocuments:d,nocDocuments:s,formData:c,beforeUploadNocDocuments:v,pdfLoading:p}=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==u?void 0:u.code)})[0])||null==v||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)});const m=Digit.ULBService.getStateId(),[E,f]=t.useState(null==u||null===(n=u.dropdownData)||void 0===n?void 0:n[0]),[_,g]=t.useState(null),[A,S]=t.useState(()=>{var e,t;return{fileStoreId:null==s||null===(e=s.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])||void 0===e?void 0:e.fileStoreId,fileName:null==s||null===(t=s.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])||void 0===t?void 0:t.fileName}||null}),[h,b]=t.useState([]);t.useEffect(()=>{null==E||!E.documentType||0!=s.filter(e=>e.documentType===(null==E?void 0:E.documentType)).length&&h.filter(e=>{var t;return(null==e||null===(t=e.file)||void 0===t?void 0:t.documentType)===(null==E?void 0:E.documentType)}).length===s.filter(e=>e.documentType===(null==E?void 0:E.documentType)).length||d(e=>{var t,l;return null===A||null==(null==A?void 0:A.fileStoreId)?e:[...null==e?void 0:e.filter(e=>(null==e?void 0:e.fileStoreId)!==A.fileStoreId),{documentType:null==u||null===(t=u.dropdownData)||void 0===t||null===(l=t[0])||void 0===l?void 0:l.code,fileStoreId:A.fileStoreId,documentUid:A.fileStoreId,fileName:(null==A?void 0:A.fileName)||""}]})},[A,E]);const y=t.useMemo(()=>{var e,t;let l=[];const n=E.code;return null==c||null===(e=c.nocDocuments)||void 0===e||null===(t=e.nocDocuments)||void 0===t||t.filter(e=>e.documentType===n).forEach(e=>l.push([e.fileName,{file:{name:e.fileName,type:e.documentType},fileStoreId:{fileStoreId:e.fileStoreId,tenantId:m}}])),l},[c]);return l.createElement("div",{style:{border:"1px solid #D6D5D4",padding:"16px 8px 16px 8px",background:"#FAFAFA",borderRadius:"5px",marginBottom:"24px",marginTop:"5px"}},l.createElement("div",null,l.createElement("h1",{style:{color:"#0B0C0C",lineHeight:"37px",fontWeight:"700",fontSize:"32px",fontFamily:"Roboto Condensed",paddingBottom:"24px"}},r(`BPA_${null==u?void 0:u.nocType}_HEADER`)),l.createElement("div",{style:{display:"flex",paddingBottom:"24px"}},l.createElement("h1",{style:{color:"#0B0C0C",lineHeight:"19px",fontWeight:"700",fontSize:"16px",fontFamily:"Roboto",marginRight:"10px"}},r(`BPA_${null==u?void 0:u.nocType}_LABEL`)),l.createElement("h1",null,null==u||null===(i=u.additionalDetails)||void 0===i?void 0:i.appNumberLink))),!window.location.href.includes("sendbacktocitizen")&&l.createElement(o.MultiUploadWrapper,{module:"BPA",tenantId:m,getFormState:e=>function(e,t){var l;let n,i;if((null==e?void 0:e.length)>0){var o;n=Object.fromEntries(e),i=Object.values(n),i=null==c||null===(o=c.nocDocuments)||void 0===o?void 0:o.nocDocuments.filter(e=>e.documentType===t),b(i);let l=[];null==e||e.map((e,n)=>{var i,o,a,r;l.push({documentType:t,fileStoreId:null==e||null===(i=e[1])||void 0===i||null===(o=i.fileStoreId)||void 0===o?void 0:o.fileStoreId,documentUid:null==e||null===(a=e[1].fileStoreId)||void 0===a?void 0:a.fileStoreId,fileName:(null==e?void 0:e[0])||"",id:s?null===(r=s.find(e=>e.documentType===t))||void 0===r?void 0:r.id:void 0})});const a=[...s.filter(e=>e.documentType!==t),...l];d(a)}null===(l=i)||void 0===l||l.map(e=>{null!=e&&e.file||(e.file={}),e.file.documentType=t,function(e,t){e&&f({documentType:t}),e&&g(e.file)}(e,t)})}(e,u.dropdownData[0].code),setuploadedstate:y,t:r,allowedFileTypesRegex:/(.*?)(jpg|jpeg|png|image|pdf)$/i,allowedMaxSizeInMB:5,acceptFiles:"image/*, .pdf, .png, .jpeg, .jpg"}),(null==u||null===(a=u.uploadedDocuments)||void 0===a?void 0:a.length)&&!p&&l.createElement(zl,{documents:null==u?void 0:u.uploadedDocuments,svgStyles:{},isSendBackFlow:!1,isHrLine:!0,titleStyles:{fontSize:"18px",lineHeight:"24px",fontWeight:700,marginBottom:"10px"}}))}const Vl=e=>{var n,i;let{t:a,onSelect:r,formData:u={},handleRemove:d,onSave:s}=e;const[c,v]=t.useState((null==u||null===(n=u.address)||void 0===n?void 0:n.pincode)||""),[p,m]=t.useState((null==u||null===(i=u.address)||void 0===i?void 0:i.geoLocation)||{}),E=Digit.Hooks.obps.useTenants(),[f,_]=t.useState(null),[g,A]=t.useState("");Digit.ULBService.getCurrentTenantId(),Digit.ULBService.getStateId();let S=!Digit.Utils.browser.isMobile();return l.createElement("div",{style:{position:"fixed",background:"#00000050",width:"100%",height:"100vh",top:"0",left:"0"}},l.createElement("div",{style:{position:"relative",marginTop:"60px"}},l.createElement("div",{style:S?{marginLeft:"25%",marginRight:"25%"}:{}},l.createElement(o.LocationSearchCard,{style:{position:"relative",marginTop:"100px",marginBottom:"-100px"},header:a("BPA_GIS_LABEL"),cardText:a(""),nextText:a("BPA_PIN_LOCATION_LABEL"),skip:()=>r(),t:a,position:p,onSave:()=>s(p,c,g),onChange:(e,t,l)=>((e,t,l)=>{_(null),(null==E?void 0:E.find(t=>{var l;return null===(l=t.pincode)||void 0===l?void 0:l.find(t=>t==e)}))?(v(e),m(t),A(l)):(_("BPA_COMMON_PINCODE_NOT_SERVICABLE"),v(""),m({}),A(""))})(e,t,l),disabled:""===c,forcedError:a(f),isPlaceRequired:!0,handleRemove:d,Webview:S,isPopUp:!0}))))},ql=[{head:"ES_NEW_APPLICATION_PROPERTY_ASSESSMENT",body:[{route:"home",component:"EDCRForm",nextStep:"",hideInEmployee:!0,key:"ScrutinyDetails",texts:{headerCaption:"",header:"EDCR_COMMON_APPL_NEW",cardText:"BPA_PROVIDE_REQ_FOR_NEW_BPA",submitBarLabel:"EDCR_SCRUTINY_SUBMIT_BUTTON",skipText:"EDCR_CLEAR_FORM"}}]}],Xl=[{head:"ES_NEW_APPLICATION_PROPERTY_ASSESSMENT",body:[{route:"docs-required",component:"OCEDCRDocsRequired",key:"data",nextStep:"home"},{route:"home",component:"OCeDCRScrutiny",nextStep:"upload-diagram",hideInEmployee:!0,key:"ScrutinyDetails"},{route:"upload-diagram",component:"OCUploadPlanDiagram",nextStep:null,hideInEmployee:!0,key:"uploadData",texts:{headerCaption:"BPA_OC_NEW_BUILDING_CONSTRUCTION_LABEL",header:"BPA_UPLOAD_OC_PLAN_DIAGRAM_LABEL",cardText:"",submitBarLabel:"BPA_COMMON_BUTTON_SUBMIT",skipText:""}}]}],Jl=[{head:"ES_NEW_APPLICATION_PROPERTY_ASSESSMENT",body:[{route:"docs-required",component:"DocsRequired",key:"data",nextStep:"noc-number"},{route:"noc-number",component:"NOCNumber",nextStep:"basic-details",key:"nocnumber",texts:{headerCaption:"BPA_NOC_NUMBER_DETAILS",header:"",submitBarLabel:"CS_COMMON_NEXT"}},{route:"basic-details",component:"BasicDetails",key:"data",nextStep:"plot-details"},{route:"plot-details",component:"PlotDetails",key:"data",nextStep:"scrutiny-details",texts:{headerCaption:"BPA_SCRUTINY_DETAILS",header:"BPA_PLOT_DETAILS_TITLE",cardText:"",submitBarLabel:"CS_COMMON_NEXT"},inputs:[{label:"BPA_HOLDING_NUMBER_LABEL",type:"text",validation:{},name:"holdingNumber"},{label:"BPA_BOUNDARY_LAND_REG_DETAIL_LABEL",type:"textarea",validation:{},name:"registrationDetails"},{label:"BPA_BOUNDARY_WALL_LENGTH_LABEL_INPUT",type:"text",validation:{pattern:/^[0-9]*$/,title:"Enter in Numbers[0-9]",required:!0},name:"boundaryWallLength"}]},{route:"scrutiny-details",component:"ScrutinyDetails",nextStep:"location",hideInEmployee:!0,key:"subOccupancy",texts:{headerCaption:"BPA_STEPPER_SCRUTINY_DETAILS_HEADER",header:"BPA_STEPPER_SCRUTINY_DETAILS_HEADER",cardText:"",submitBarLabel:"CS_COMMON_NEXT",skipText:"CORE_COMMON_SKIP_CONTINUE"}},{route:"location",component:"LocationDetails",nextStep:"owner-details",hideInEmployee:!0,key:"address",texts:{headerCaption:"BPA_STEPPER_SCRUTINY_DETAILS_HEADER",header:"BPA_NEW_TRADE_DETAILS_HEADER_DETAILS",cardText:"",submitBarLabel:"CS_COMMON_NEXT",skipAndContinueText:""}},{route:"owner-details",component:"OwnerDetails",nextStep:"document-details",key:"owners",texts:{headerCaption:"BPA_OWNER_AND_DOCUMENT_DETAILS_LABEL",header:"BPA_APPLICANT_DETAILS_HEADER",submitBarLabel:"CS_COMMON_NEXT"}},{route:"document-details",component:"DocumentDetails",nextStep:null,key:"documents",texts:{headerCaption:"BPA_OWNER_AND_DOCUMENT_DETAILS_LABEL",header:"BPA_DOCUMENT_DETAILS_LABEL",submitBarLabel:"CS_COMMON_NEXT"}}]}],Zl=[{route:"docs-required",component:"DocsRequired",key:"data",nextStep:"basic-details"},{route:"basic-details",component:"BasicDetails",key:"data",nextStep:"plot-details"},{route:"plot-details",component:"PlotDetails",key:"data",nextStep:"scrutiny-details",texts:{headerCaption:"BPA_SCRUTINY_DETAILS",header:"BPA_PLOT_DETAILS_TITLE",cardText:"",submitBarLabel:"CS_COMMON_NEXT"},inputs:[{label:"BPA_BOUNDARY_LAND_REG_DETAIL_LABEL",type:"textarea",validation:{},name:"registrationDetails"},{label:"BPA_BOUNDARY_WALL_LENGTH_LABEL_INPUT",type:"text",validation:{pattern:"^[0-9]*$",title:"Enter in Numbers[0-9]",required:!0},name:"boundaryWallLength"},{label:"BPA_WARD_NUMBER_LABEL",type:"text",validation:{pattern:"^[a-zA-Z0-9 -]+$",required:!0},name:"wardnumber"},{label:"BPA_ZONE_NUMBER_LABEL",type:"text",validation:{},name:"zonenumber"},{label:"BPA_KHASRA_NUMBER_LABEL",type:"text",validation:{required:!0},name:"khasraNumber"},{label:"BPA_ARCHITECT_ID",type:"text",validation:{required:!0},name:"architectid"},{label:"BPA_PROPERTY_UID",type:"text",validation:{},name:"propertyuid"},{label:"BPA_NUMBER_OF_BATHS",type:"text",validation:{},name:"bathnumber"},{label:"BPA_NUMBER_OF_KITCHENS",type:"text",validation:{},name:"kitchenNumber"},{label:"BPA_APPROX_INHABITANTS_FOR_ACCOMODATION",type:"text",validation:{},name:"approxinhabitants"},{label:"BPA_DISTANCE_FROM_SEWER",type:"text",validation:{},name:"distancefromsewer"},{label:"BPA_SOURCE_OF_WATER",type:"text",validation:{},name:"sourceofwater"},{label:"BPA_NUMBER_OF_WATER_CLOSETS",type:"text",validation:{},name:"watercloset"},{label:"BPA_MATERIAL_TO-BE_USED_IN_WALLS",type:"text",validation:{},name:"materialused"},{label:"BPA_MATERIAL_TO-BE_USED_IN_FLOOR",type:"text",validation:{},name:"materialusedinfloor"},{label:"BPA_MATERIAL_TO-BE_USED_IN_ROOFS",type:"text",validation:{},name:"materialusedinroofs"}]},{route:"scrutiny-details",component:"ScrutinyDetails",nextStep:"location",hideInEmployee:!0,key:"subOccupancy",texts:{headerCaption:"BPA_STEPPER_SCRUTINY_DETAILS_HEADER",header:"BPA_STEPPER_SCRUTINY_DETAILS_HEADER",cardText:"",submitBarLabel:"CS_COMMON_NEXT",skipText:"CORE_COMMON_SKIP_CONTINUE"}},{type:"component",route:"search-property",isMandatory:!0,component:"CPTSearchProperty",key:"cptsearchproperty",withoutLabel:!0,nextStep:"search-results",hideInEmployee:!0},{type:"component",route:"search-results",isMandatory:!0,component:"CPTSearchResults",key:"cptsearchresults",withoutLabel:!0,nextStep:"location",hideInEmployee:!0},{type:"component",route:"create-property",isMandatory:!0,component:"CPTCreateProperty",key:"cptcreateproperty",withoutLabel:!0,nextStep:"acknowledge-create-property",hideInEmployee:!0},{type:"component",route:"acknowledge-create-property",isMandatory:!0,component:"CPTAcknowledgement",key:"cptacknowledgement",withoutLabel:!0,nextStep:"location",hideInEmployee:!0},{route:"location",component:"LocationDetails",nextStep:"additional-building-details",hideInEmployee:!0,key:"address",texts:{headerCaption:"BPA_STEPPER_SCRUTINY_DETAILS_HEADER",header:"BPA_NEW_TRADE_DETAILS_HEADER_DETAILS",cardText:"",submitBarLabel:"CS_COMMON_NEXT",skipAndContinueText:""}},{route:"additional-building-details",component:"BPANewBuildingdetails",nextStep:"owner-details",key:"owners",texts:{header:"BPA_ADDITIONAL_BUILDING_DETAILS",submitBarLabel:"CS_COMMON_NEXT"}},{route:"owner-details",component:"OwnerDetails",nextStep:"document-details",key:"owners",texts:{headerCaption:"BPA_OWNER_AND_DOCUMENT_DETAILS_LABEL",header:"BPA_APPLICANT_DETAILS_HEADER",submitBarLabel:"CS_COMMON_NEXT"}},{route:"document-details",component:"DocumentDetails",nextStep:null,key:"documents",texts:{headerCaption:"BPA_OWNER_AND_DOCUMENT_DETAILS_LABEL",header:"BPA_DOCUMENT_DETAILS_LABEL",submitBarLabel:"CS_COMMON_NEXT"}}],Ql=(e,t)=>(t&&Object.keys(t).map(l=>{e=e.replace(":"+l,t[l])}),e),en=[{head:"ES_NEW_APPLICATION_PROPERTY_ASSESSMENT",body:[{route:"docs-required",component:"DocsRequired",key:"data",nextStep:"basic-details"},{route:"basic-details",component:"OCBasicDetails",key:"data",nextStep:"plot-details"},{route:"plot-details",component:"PlotDetails",key:"data",nextStep:"scrutiny-details",texts:{headerCaption:"BPA_SCRUTINY_DETAILS",header:"BPA_PLOT_DETAILS_TITLE",cardText:"",submitBarLabel:"CS_COMMON_NEXT",skipText:"CORE_COMMON_SKIP_CONTINUE"},inputs:[{label:"BPA_HOLDING_NUMBER_LABEL",type:"text",validation:{},name:"holdingNumber"},{label:"BPA_BOUNDARY_LAND_REG_DETAIL_LABEL",type:"textarea",validation:{},name:"registrationDetails"}]},{route:"scrutiny-details",component:"ScrutinyDetails",nextStep:"document-details",hideInEmployee:!0,key:"subOccupancy",texts:{headerCaption:"BPA_STEPPER_SCRUTINY_DETAILS_HEADER",header:"BPA_STEPPER_SCRUTINY_DETAILS_HEADER",cardText:"",submitBarLabel:"CS_COMMON_NEXT",skipAndContinueText:""}},{route:"document-details",component:"DocumentDetails",nextStep:"noc-details",key:"documents",texts:{headerCaption:"BPA_OWNER_AND_DOCUMENT_DETAILS_LABEL",header:"BPA_DOCUMENT_DETAILS_LABEL",submitBarLabel:"CS_COMMON_NEXT"}},{route:"noc-details",component:"NOCDetails",nextStep:null,key:"nocDocuments",texts:{headerCaption:"BPA_NOC_DETAILS_SUMMARY",header:"",submitBarLabel:"CS_COMMON_NEXT",skipText:"CORE_COMMON_SKIP_CONTINUE"}}]}],tn=(e,t)=>(t&&Object.keys(t).map(l=>{e=e.replace(":"+l,t[l])}),e),ln=[{head:"ES_NEW_APPLICATION_PROPERTY_ASSESSMENT",body:[{route:"stakeholder-docs-required",component:"StakeholderDocsRequired",key:"data",nextStep:"provide-license-type"},{type:"component",route:"provide-license-type",isMandatory:!0,component:"LicenseType",texts:{headerCaption:"BPA_LICENSE_DET_CAPTION",header:"BPA_LICENSE_TYPE",cardText:"BPA_LICENSE_TYPE_TEXT",submitBarLabel:"CS_COMMON_NEXT"},nextStep:"license-details",key:"LicneseType",withoutLabel:!0,hideInEmployee:!0},{type:"component",route:"license-details",isMandatory:!0,component:"LicenseDetails",texts:{headerCaption:"BPA_LICENSE_DET_CAPTION",header:"BPA_LICENSE_DET_CAPTION",cardText:"BPA_LICENSE_DETAILS_TEXT",submitBarLabel:"CS_COMMON_NEXT"},nextStep:"Permanent-address",key:"LicneseDetails",withoutLabel:!0,hideInEmployee:!0},{type:"component",route:"Permanent-address",isMandatory:!0,component:"PermanentAddress",texts:{headerCaption:"BPA_NEW_ADDRESS_HEADER_DETAILS",header:"BPA_LICENSEE_PERM_ADDR_HEADER",cardText:"BPA_LICENSEE_PERMANENT_TEXT",submitBarLabel:"CS_COMMON_NEXT"},nextStep:"correspondence-address",key:"LicneseDetails",withoutLabel:!0,hideInEmployee:!0},{type:"component",route:"correspondence-address",isMandatory:!0,component:"CorrospondenceAddress",texts:{headerCaption:"BPA_NEW_ADDRESS_HEADER_DETAILS",header:"BPA_LICENSEE_CORRESPONDENCE_LABEL",cardText:"BPA_LICENSEE_CORRESPONDENCE_TEXT",submitBarLabel:"CS_COMMON_NEXT"},nextStep:"stakeholder-document-details",key:"LicneseDetails",withoutLabel:!0,hideInEmployee:!0},{route:"stakeholder-document-details",component:"StakeholderDocuments",nextStep:null,key:"documents",texts:{headerCaption:"BPA_DOCUMENT_DETAILS_LABEL",header:"BPA_LICENSEE_DOCUMENT_DETAILS_HEADER",submitBarLabel:"CS_COMMON_NEXT"}}]}],nn=e=>{var i,a,r,u,d,s;const{t:c}=n.useTranslation(),v=null===(i=e.application)||void 0===i?void 0:i.businessService,{isLoading:p,data:m}=Digit.Hooks.useWorkflowDetails({tenantId:null===(a=e.application)||void 0===a?void 0:a.tenantId,id:e.id,moduleCode:v}),[E,f]=t.useState(!1);function _(e,t,l){var n;window.open(null==l||null===(n=l.fullImage)||void 0===n?void 0:n[0],"_blank")}const g=e=>{var t,n,i,o,a;const r={date:null==e||null===(t=e.auditDetails)||void 0===t?void 0:t.lastModified,name:null==e||null===(n=e.assignes)||void 0===n||null===(i=n[0])||void 0===i?void 0:i.name,mobileNumber:null==e||null===(o=e.assignes)||void 0===o||null===(a=o[0])||void 0===a?void 0:a.mobileNumber,comment:c(null==e?void 0:e.comment),wfComment:e.wfComment,thumbnailsToShow:null==e?void 0:e.thumbnailsToShow};return l.createElement($t,{data:r,OpenImage:_})};return p?l.createElement(o.Loader,null):l.createElement(l.Fragment,null,!p&&l.createElement(t.Fragment,null,(null==m||null===(r=m.timeline)||void 0===r?void 0:r.length)>0&&l.createElement(o.CardSectionHeader,{style:{marginBottom:"16px",marginTop:"32px"}},c("CS_APPLICATION_DETAILS_APPLICATION_TIMELINE")),null!=m&&m.timeline&&1===(null==m||null===(u=m.timeline)||void 0===u?void 0:u.length)?l.createElement(o.CheckPoint,{isCompleted:!0,label:c((null==m||null===(d=m.timeline[0])||void 0===d?void 0:d.state)&&`WF_${v}_${m.timeline[0].state}`||"NA"),customChild:g(null==m?void 0:m.timeline[0])}):l.createElement(o.ConnectingCheckPoints,null,(null==m?void 0:m.timeline)&&(null==m?void 0:m.timeline.slice(0,E?m.timeline.length:2).map((e,t,n)=>{let i="";var a,r,u,d;return window.location.href.includes("/obps")&&(i=null!=m&&null!==(a=m.timeline[t-1])&&void 0!==a&&null!==(r=a.state)&&void 0!==r&&r.includes("BACK_FROM")||null!=m&&null!==(u=m.timeline[t-1])&&void 0!==u&&null!==(d=u.state)&&void 0!==d&&d.includes("SEND_TO_CITIZEN")?"_NOT_DONE":"SEND_TO_ARCHITECT"===(null==e?void 0:e.performedAction)?"_BY_ARCHITECT_DONE":0==t?"":"_DONE"),l.createElement(l.Fragment,{key:t},l.createElement(o.CheckPoint,{keyValue:t,isCompleted:0===t,label:e.state?c(`WF_${v}_${e.state}${i}`):"NA",customChild:g(e)}))}))),(null==m||null===(s=m.timeline)||void 0===s?void 0:s.length)>2&&l.createElement(o.LinkButton,{label:c(E?"COLLAPSE":"VIEW_TIMELINE"),onClick:()=>{f(e=>!e)}})))},on=e=>{let{t:t,action:n,selectFile:i,uploadedFile:a,error:r,isCommentRequired:u=!0,setUploadedFile:d}=e;return{label:{heading:"BPA_FORWARD_APPLICATION_HEADER",submit:`BPA_${n}_BUTTON`,cancel:"CS_COMMON_CANCEL"},form:[{body:[{label:t("ES_OBPS_ACTION_COMMENTS"),isMandatory:u,type:"textarea",populators:{name:"comments",validation:{required:u}}},{label:""+t("WF_APPROVAL_UPLOAD_HEAD"),populators:l.createElement(o.UploadFile,{id:"workflow-doc",onUpload:i,onDelete:()=>{d(null)},message:a?"1 "+t("ES_PT_ACTION_FILEUPLOADED"):t("CS_ACTION_NO_FILEUPLOADED"),accept:"image/*, .pdf, .png, .jpeg, .jpg",iserror:r})}]}]}},an=e=>l.createElement("h1",{style:{marginLeft:"22px"},className:"heading-m BPAheading-m"},e.label),rn=()=>l.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"#FFFFFF",xmlns:"http://www.w3.org/2000/svg"},l.createElement("path",{d:"M19 6.41L17.59 5L12 10.59L6.41 5L5 6.41L10.59 12L5 17.59L6.41 19L12 13.41L17.59 19L19 17.59L13.41 12L19 6.41Z",fill:"#0B0C0C"})),un=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick,style:{backgroundColor:"#FFFFFF"}},l.createElement(rn,null)),dn=e=>{var n,i,a,r,u;let{t:d,closeModal:s,submitAction:v,action:p,applicationData:m}=e;const[E,f]=t.useState({}),[_,g]=t.useState(null),[A,S]=t.useState(null),[h,b]=t.useState({}),[y,C]=t.useState(null),[T,D]=t.useState(!1),N=!!Digit.Utils.browser.isMobile(),P=e=>{g(e.target.files[0])};return t.useEffect(()=>{switch(p){case"APPROVE":f(on({t:d,action:p,selectFile:P,uploadedFile:A,error:y,isCommentRequired:!1,setUploadedFile:S,file:_,error:y}));break;case"SEND_TO_ARCHITECT":f(on({t:d,action:p,selectFile:P,uploadedFile:A,error:y,setUploadedFile:S,file:_,error:y}));break;case"TERMS_AND_CONDITIONS":D(!0),f((e=>{let{t:t,applicationData:l}=e;return{label:{heading:"",submit:null,cancel:null,hideSubmit:!0},data:[((e,t)=>"CITIZEN_APPROVAL_INPROCESS"==(null==t?void 0:t.status)?`${e("BPA_CITIZEN_1_DECLARAION_LABEL")}${e("BPA_CITIZEN_2_DECLARAION_LABEL")}`:"INPROGRESS"==(null==t?void 0:t.status)?`${e("BPA_STAKEHOLDER_1_DECLARAION_LABEL")}${e("BPA_STAKEHOLDER_2_DECLARAION_LABEL")}`:void 0)(t,l)]}})({t:d,applicationData:m}));break;default:f(on({t:d,action:p,selectFile:P,uploadedFile:A,error:y,isCommentRequired:!1,setUploadedFile:S,file:_,error:y}))}},[p,A,y]),t.useEffect(()=>{!function(){try{C(null);const e=function(){if(_){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(_.size>=5242880)C(d("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=_&&_.type&&!e.test(null==_?void 0:_.type))C(d("NOT_SUPPORTED_FILE_TYPE"));else{const e=c(function(){return S(null),Promise.resolve(Digit.UploadServices.Filestorage("BPA",_,Digit.ULBService.getStateId())).then(function(e){var t,l,n,i;(null==e||null===(t=e.data)||void 0===t||null===(l=t.files)||void 0===l?void 0:l.length)>0?S(null==e||null===(n=e.data)||void 0===n||null===(i=n.files[0])||void 0===i?void 0:i.fileStoreId):C(d("CS_FILE_UPLOAD_ERROR"))})},function(){C(d("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)}}()},[_]),l.createElement(o.Modal,{headerBarMain:l.createElement(an,{label:d(null==E||null===(n=E.label)||void 0===n?void 0:n.heading)}),headerBarEnd:l.createElement(un,{onClick:s}),actionCancelLabel:d(null==E||null===(i=E.label)||void 0===i?void 0:i.cancel),actionCancelOnSubmit:s,actionSaveLabel:d(null==E||null===(a=E.label)||void 0===a?void 0:a.submit),actionSaveOnSubmit:()=>{},formId:"modal-action",isDisabled:!1,isOBPSFlow:!0,popupStyles:N?{width:"720px"}:{},style:N?{minHeight:"45px",height:"auto",width:"160px"}:{minHeight:"45px",height:"auto",width:"107px",paddingLeft:"0px",paddingRight:"0px"},hideSubmit:!(null==E||null===(r=E.label)||void 0===r||!r.hideSubmit),popupModuleMianStyles:"TERMS_AND_CONDITIONS"==p?{height:"92%",boxSizing:"border-box"}:N?{paddingLeft:"0px"}:{},headerBarMainStyle:"TERMS_AND_CONDITIONS"==p?{margin:"0px",height:"35px"}:{}},null!=E&&E.form?l.createElement(o.FormComposer,{cardStyle:{minWidth:"unset",paddingRight:"unset",marginRight:"18px",paddingBottom:"64px"},config:null==E?void 0:E.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:e=>{let t={action:p};A&&(t.varificationDocuments=[{documentType:"Document - 1",fileName:(null==_?void 0:_.name)||"",fileStoreId:A}]),null!=e&&e.comments||delete e.comments,v({...e,...t})},defaultValues:h,formId:"modal-action"}):null,T?l.createElement("div",{style:{height:"100%"}},l.createElement("div",{style:{height:"95%"}},l.createElement("div",{style:{fontSize:"18px",paddingBottom:"16px",color:"#000000",fontWeight:"700"}},d("TERMS_AND_CONDITIONS")),(null==E?void 0:E.data)&&(null==E||null===(u=E.data)||void 0===u?void 0:u.map((e,t)=>l.createElement("div",{style:{height:"90%",overflow:"auto"}},""+e)))),l.createElement("div",{style:{display:"flex",justifyContent:"center",minHeight:"5%"}},l.createElement(o.ButtonSelector,{label:d("BPA_GO_BACK_LABEL"),onSubmit:s,style:{minWidth:"240px"}}))):null)};function sn(e){let{value:t={},Code:i,index:a,isNOC:r=!1,svgStyles:u={width:"100px",height:"100px",viewBox:"0 0 25 25",minWidth:"100px"},isStakeHolder:d=!1}=e;const{t:s}=n.useTranslation(),{isLoading:c,data:v}=Digit.Hooks.obps.useOBPSDocumentSearch({value:t},{value:t},i,a,r);let p=[];var m,E,f;return r?null!=t&&t.nocDocuments?(null==t||null===(m=t.nocDocuments)||void 0===m?void 0:m.nocDocuments.length)>0&&(null==t||null===(E=t.nocDocuments)||void 0===E||E.nocDocuments.filter(e=>{var t;return null==e||null===(t=e.documentType)||void 0===t?void 0:t.includes(i)}).map(e=>{p.push(e)})):(null==t?void 0:t.length)>0&&(null==t||t.filter(e=>{var t;return null==e||null===(t=e.documentType)||void 0===t?void 0:t.includes(i)}).map(e=>{p.push(e)})):null!=t&&t.documents?null==t||null===(f=t.documents)||void 0===f||f.documents.filter(e=>(null==e?void 0:e.documentType)===i).map(e=>{p.push(e)}):t.filter(e=>(null==e?void 0:e.documentType)===i).map(e=>{p.push(e)}),c?l.createElement(o.Loader,null):l.createElement("div",{style:{marginTop:"19px"}},l.createElement(l.Fragment,null,l.createElement("div",{style:{display:"flex",flexWrap:"wrap"}},p.length>0?l.createElement("div",{style:{display:"flex",justifyContent:"flex-start",flexWrap:"wrap"}},null==p?void 0:p.map((e,t)=>{let n=function(e,t,l){void 0===e&&(e={}),void 0===t&&(t="");let n=e[t]||"",i=(null==n?void 0:n.split(","))||[],o="";return i.length>0&&i.map(e=>{e.includes("large")||e.includes("medium")||e.includes("small")||(o=e)}),o}(v.pdfFiles,null==e?void 0:e.fileStoreId);return l.createElement("a",{target:"_blank",href:n,style:{minWidth:"80px",marginRight:"10px",maxWidth:"100px",height:"auto"},key:t},l.createElement("div",{style:{display:"flex",justifyContent:"center"}},l.createElement(o.PDFSvg,null)),d?l.createElement("p",{style:{marginTop:"8px",textAlign:"center",color:"#505A5F"}},s("BPAREG_HEADER_"+ft(null==i?void 0:i.toUpperCase(),".","_"))):null," ",d?null:l.createElement("p",{style:{marginTop:"8px",textAlign:"center",color:"#505A5F"}},""+s(i)))})):l.createElement(o.CardText,null,s("BPA_NO_DOCUMENTS_UPLOADED_LABEL")))))}const cn=e=>{var i,a,r,u,d;let{edcrDetails:s,applicationData:c}=e;const{t:v}=n.useTranslation(),p=window.Digit.Utils.browser.isMobile(),m=[{name:"BPA_TABLE_COL_FLOOR",id:"Floor"},{name:"BPA_TABLE_COL_LEVEL",id:"Level"},{name:"BPA_TABLE_COL_OCCUPANCY",id:"Occupancy"},{name:"BPA_TABLE_COL_BUILDUPAREA",id:"BuildupArea"},{name:"BPA_TABLE_COL_FLOORAREA",id:"FloorArea"}],E=e=>{const t=e;return(e,l,n)=>e[t]},f=t.useMemo(()=>m.map(e=>({Header:v(""+e.name),accessor:E(e.id),id:e.id})));function _(e){var t;let l=[];return null==e||null===(t=e.building)||void 0===t||t.floors.map(e=>{var t,n,i,o,a,r,u,d;l.push({Floor:v("BPA_FLOOR_NAME_"+e.number),Level:e.number,Occupancy:v(""+(null===(t=e.occupancies)||void 0===t||null===(n=t[0])||void 0===n?void 0:n.type)),BuildupArea:null===(i=e.occupancies)||void 0===i||null===(o=i[0])||void 0===o?void 0:o.builtUpArea,FloorArea:(null===(a=e.occupancies)||void 0===a||null===(r=a[0])||void 0===r?void 0:r.floorArea)||0,CarpetArea:(null===(u=e.occupancies)||void 0===u||null===(d=u[0])||void 0===d?void 0:d.CarpetArea)||0,key:v("BPA_FLOOR_NAME_"+e.number)})}),l}function g(e){var t;let l=null==c||null===(t=c.landInfo)||void 0===t?void 0:t.unit,n="";if((null==l?void 0:l.length)>0){var i,o;let t=null===(i=l[e])||void 0===i||null===(o=i.usageCategory)||void 0===o?void 0:o.split(",");null!=t&&t.length&&(n=t.map(e=>e?""+v("BPA_SUBOCCUPANCYTYPE_"+function(e,t,l){if(void 0===e&&(e=""),void 0===t&&(t=""),void 0===l&&(l=""),""==t)return e;for(;e.includes(t);)e=e.replace(t,l);return e}(null==e?void 0:e.toUpperCase(),"-","_")):"NA").join(", "))}return n||"NA"}return l.createElement(t.Fragment,null,l.createElement("div",{style:{background:"#FAFAFA",border:"1px solid #D6D5D4",padding:"8px",borderRadius:"4px",maxWidth:"950px",minWidth:"280px"}},l.createElement(o.StatusTable,null,null==s||null===(i=s.values)||void 0===i?void 0:i.map((e,t)=>null!=e&&e.isHeader?l.createElement(o.CardSubHeader,{style:{fontSize:"20px",paddingBottom:"10px"}},v(null==e?void 0:e.title)):l.createElement(o.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==s||null===(a=s.subOccupancyTableDetails)||void 0===a||null===(r=a[0])||void 0===r||null===(u=r.value)||void 0===u||null===(d=u.planDetail)||void 0===d?void 0:d.blocks.map((e,t)=>{var n,i,a,r,u;return l.createElement("div",{key:t,style:(null==s||null===(n=s.subOccupancyTableDetails)||void 0===n||null===(i=n[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(o.CardSubHeader,{style:{marginBottom:"8px",paddingBottom:"9px",color:"#0B0C0C",fontSize:"18px",lineHeight:"19px"}},v("BPA_BLOCK_SUBHEADER")," ",t+1),l.createElement(o.StatusTable,null,l.createElement(o.Row,{className:"border-none",textStyle:{wordBreak:"break-word"},label:""+v("BPA_SUB_OCCUPANCY_LABEL"),text:g(t)})),l.createElement("div",{style:window.location.href.includes("citizen")||p?{overflow:"scroll"}:{maxWidth:"950px",maxHeight:"280px"}},l.createElement(o.Table,{className:"customTable table-fixed-first-column table-border-style",t:v,disableSort:!1,autoSort:!0,manualPagination:!1,isPaginationRequired:!1,initSortId:"S N ",data:_(e),columns:f,getCellProps:e=>({style:{}})})))})))};function vn(e){let{fiReport:t,isCitizen:i=!1}=e;const{t:a}=n.useTranslation();return l.createElement(l.Fragment,null,l.createElement("div",{style:{marginTop:"10px"}},l.createElement(i?o.CardHeader:o.CardSectionHeader,{style:{fontSize:"24px"}},""+a("BPA_FI_REPORT")),t.map((e,n)=>{var i,r,u,d,s,c;return l.createElement("div",{style:{background:"#FAFAFA",border:"1px solid #D6D5D4",padding:"8px",borderRadius:"4px",maxWidth:"950px",minWidth:"280px",marginBottom:"24px"}},l.createElement(o.StatusTable,null,l.createElement(o.CardSectionHeader,{style:{fontSize:"20px"}},1==(null==t?void 0:t.length)?""+a("BPA_FI_REPORT"):`${a("BPA_FI_REPORT")} - ${n+1}`),l.createElement(o.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(o.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===(d=e.questions)||void 0===d?void 0:d.length)&&(null==e||null===(s=e.questions)||void 0===s?void 0:s.map(e=>l.createElement("div",{style:{background:"white",border:"1px solid #D6D5D4",padding:"8px",borderRadius:"4px",marginTop:"10px"}},l.createElement(o.Row,{className:"border-none",label:""+a(""+e.question),text:null!=e&&e.value?null==e?void 0:e.value:"NA"}),l.createElement(o.Row,{className:"border-none",label:""+a("BPA_ENTER_REMARKS"),text:e.remarks?e.remarks:"NA"})))),l.createElement(zl,{documents:(c=null==e?void 0:e.docs,[{title:"BPA_DOCUMENT_DETAILS_LABEL",values:null==c?void 0:c.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"}})))})))}const pn=e=>{var i,a,r,u,d,s,v,p,m,E,f,_,g,A,S,h,b,y,C,T,D,N,P;let{scrutinyDetails:I,paymentsList:L=[],additionalDetails:B,applicationData:O}=e;const R=(window.location.href.includes("editApplication")||"FIELDINSPECTION_INPROGRESS"==(null==O?void 0:O.status))&&window.location.href.includes("bpa"),[w,x]=t.useState(),[M,F]=t.useState(),[k,U]=t.useState(),H=Digit.ULBService.getStateId(),[W,j]=t.useState(),[$,Y]=t.useState(),[z,G]=t.useState([]),[K,V]=t.useState(),[q,X]=t.useState(""),[J,Z]=t.useState(null),[Q,ee]=t.useState({}),te={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))"}},[le,ne]=t.useState(!1),[ie,oe]=t.useState(!1);t.useEffect(()=>{!function(){try{Z(null);const e=function(){if(K&&null!=K&&K.type){const e=function(e,t,l){if(null!==(e=".pdf".split(","))&&void 0!==e&&e.includes("."+(null==K||null===(t=K.type)||void 0===t||null===(l=t.split("/"))||void 0===l?void 0:l.pop()))){const e=function(){if(K.size>=2e6)Z(ae("PT_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=c(function(){return Promise.resolve(Digit.UploadServices.Filestorage("property-upload",K,Digit.ULBService.getStateId())).then(function(e){var t,l,n,i;(null==e||null===(t=e.data)||void 0===t||null===(l=t.files)||void 0===l?void 0:l.length)>0?G([...z,{fileStoreId:null==e||null===(n=e.data)||void 0===n||null===(i=n.files[0])||void 0===i?void 0:i.fileStoreId,time:new Date}]):Z(ae("PT_FILE_UPLOAD_ERROR"))})},function(){});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}else Z(ae("PT_UPLOAD_FORMAT_NOT_SUPPORTED"))}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[K]),t.useEffect(()=>{sessionStorage.setItem("uploadedFileLess",JSON.stringify(z))},[z]),t.useEffect(()=>{var e,t,l,n,i,o,a;if(null!=B&&null!==(e=B.lessAdjustmentFeeFiles)&&void 0!==e&&e.length){const e=null==B?void 0:B.lessAdjustmentFeeFiles.map((e,t)=>{var l,n,i;return t===(null==B||null===(l=B.lessAdjustmentFeeFiles)||void 0===l?void 0:l.length)-1?null==B||null===(n=B.lessAdjustmentFeeFiles[(null==B||null===(i=B.lessAdjustmentFeeFiles)||void 0===i?void 0:i.length)-1])||void 0===n?void 0:n.fileStoreId:null});Digit.UploadServices.Filefetch(e,H).then(e=>ee(null==e?void 0:e.data))}x(null==B||null===(t=B.selfCertificationCharges)||void 0===t?void 0:t.BPA_DEVELOPMENT_CHARGES),sessionStorage.setItem("development",null==B||null===(l=B.selfCertificationCharges)||void 0===l?void 0:l.BPA_DEVELOPMENT_CHARGES),F(null==B||null===(n=B.selfCertificationCharges)||void 0===n?void 0:n.BPA_OTHER_CHARGES),sessionStorage.setItem("otherCharges",null==B||null===(i=B.selfCertificationCharges)||void 0===i?void 0:i.BPA_OTHER_CHARGES),U(null==B||null===(o=B.selfCertificationCharges)||void 0===o?void 0:o.BPA_LESS_ADJUSMENT_PLOT),sessionStorage.setItem("lessAdjusment",null==B||null===(a=B.selfCertificationCharges)||void 0===a?void 0:a.BPA_LESS_ADJUSMENT_PLOT),j(null==B?void 0:B.otherFeesDiscription),sessionStorage.setItem("otherChargesDisc",null==B?void 0:B.otherFeesDiscription),G(null==B?void 0:B.lessAdjustmentFeeFiles)},[B]);const{t:ae}=n.useTranslation(),re=e=>null!=e&&e.value&&null!=e&&e.isTransLate?l.createElement("span",{style:{color:"#00703C"}},ae(null==e?void 0:e.value)):null!=e&&e.value&&null!=e&&e.isTransLate?ae(null==e?void 0:e.value):null!=e&&e.value?null==e?void 0:e.value:void ae("NA");return l.createElement(t.Fragment,null,!(null!=I&&I.isChecklist)&&l.createElement("div",{style:{background:"#FAFAFA",border:"1px solid #D6D5D4",padding:"8px",borderRadius:"4px",maxWidth:"950px"}},l.createElement(o.StatusTable,null,l.createElement("div",null,null==I||null===(i=I.values)||void 0===i?void 0:i.map((e,t)=>null!=e&&e.isUnit?l.createElement(o.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:""+ae(""+e.title),text:null!=e&&e.value?`${re(e)} ${ae(null==e?void 0:e.isUnit)}`:ae("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(o.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:""+ae(""+e.title),text:re(e),labelStyle:null!=e&&e.isHeader?{fontSize:"20px"}:{}}):l.createElement(o.CardSubHeader,{style:{fontSize:"20px",paddingBottom:"10px",margin:"0px"}},ae(null==e?void 0:e.title)):l.createElement(o.CardSubHeader,{style:{fontSize:"20px",paddingBottom:"10px"}},ae(null==e?void 0:e.title))),null==I||null===(a=I.permit)||void 0===a?void 0:a.map((e,t)=>l.createElement(o.CardLabel,{style:{fontWeight:"400"}},null==e?void 0:e.title))),window.location.href.includes("employee")&&"BPA_APPL_FEES_DETAILS"==(null==I||null===(r=I.values[0])||void 0===r?void 0:r.title)&&l.createElement("div",null,!ie&&l.createElement("div",{style:te.buttonStyle},l.createElement("button",{type:"button",onClick:()=>{oe(!0)}},ae("SHOW_P1_FEES_DETAILS"))),ie&&l.createElement("div",{style:te.buttonStyle},l.createElement("button",{type:"button",onClick:()=>{oe(!1)}},ae("HIDE_P1_FEES_DETAILS"))),ie&&l.createElement("div",null,l.createElement(o.CardSubHeader,null,ae("BPA_P1_SUMMARY_FEE_EST")),l.createElement(o.Row,{className:"border-none",label:ae("BUILDING_APPLICATION_FEES"),text:"₹ "+Math.round(10.7639*(null==B?void 0:B.builtUpArea)*2.5)}),l.createElement(o.Row,{className:"border-none",label:ae("BOUNDARY_WALL_FEES"),text:"₹ "+2.5*(null==B?void 0:B.boundaryWallLength)}),l.createElement(o.Row,{className:"border-none"}))),window.location.href.includes("employee")&&"BPA_APPL_FEES_DETAILS"==(null==I||null===(u=I.values[0])||void 0===u?void 0:u.title)&&l.createElement("div",null,!le&&l.createElement("div",{style:te.buttonStyle},l.createElement("button",{type:"button",onClick:()=>{ne(!0)}},ae("SHOW_P2_FEES_DETAILS"))),le&&l.createElement("div",{style:te.buttonStyle},l.createElement("button",{type:"button",onClick:()=>{ne(!1)}},ae("HIDE_P2_FEES_DETAILS"))),le&&l.createElement("div",null,l.createElement(o.CardSubHeader,null,ae("BPA_P2_SUMMARY_FEE_EST")),l.createElement(o.Row,{className:"border-none",label:ae("BPA_COMMON_MALBA_AMT"),text:"₹ "+(null==B||null===(d=B.selfCertificationCharges)||void 0===d?void 0:d.BPA_MALBA_CHARGES)}),l.createElement(o.Row,{className:"border-none",label:ae("BPA_COMMON_LABOUR_AMT"),text:"₹ "+(null==B||null===(s=B.selfCertificationCharges)||void 0===s?void 0:s.BPA_LABOUR_CESS)}),l.createElement(o.Row,{className:"border-none",label:ae("BPA_COMMON_WATER_AMT"),text:"₹ "+(null==B||null===(v=B.selfCertificationCharges)||void 0===v?void 0:v.BPA_WATER_CHARGES)}),l.createElement(o.Row,{className:"border-none",label:ae("BPA_COMMON_GAUSHALA_AMT"),text:"₹ "+(null==B||null===(p=B.selfCertificationCharges)||void 0===p?void 0:p.BPA_GAUSHALA_CHARGES_CESS)}),l.createElement(o.CardSubHeader,null,ae("BPA_P2_SUMMARY_FEE_EST_MANUAL")),l.createElement(o.CardLabel,null,ae("BPA_COMMON_DEVELOPMENT_AMT")),l.createElement(o.TextInput,{t:ae,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"development",defaultValue:(null==B||null===(m=B.selfCertificationCharges)||void 0===m?void 0:m.BPA_DEVELOPMENT_CHARGES)||0,value:w,disabled:!R,onChange:e=>{!function(e){/^\d{0,9}$/.test(e)&&(x(e),sessionStorage.setItem("development",e))}(e.target.value)},required:!0,pattern:"^[0-9]*$",type:"text"}),l.createElement(o.CardLabel,null,ae("BPA_COMMON_OTHER_AMT")),l.createElement(o.TextInput,{t:ae,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"otherCharges",defaultValue:(null==B||null===(E=B.selfCertificationCharges)||void 0===E?void 0:E.BPA_OTHER_CHARGES)||0,value:M,disabled:!R,onChange:e=>{!function(e){/^[0-9]*$/.test(e)&&(F(e),sessionStorage.setItem("otherCharges",e))}(e.target.value)},required:!0,pattern:"^[0-9]*$",type:"text"}),parseInt(M)>0?l.createElement("div",null,l.createElement(o.CardLabel,null,ae("BPA_COMMON_OTHER_AMT_DISCRIPTION")),l.createElement(o.TextArea,{t:ae,type:"text",name:"otherChargesDiscription",defaultValue:null==B||null===(f=B.selfCertificationCharges)||void 0===f?void 0:f.BPA_COMMON_OTHER_AMT_DISCRIPTION,value:W,disabled:!R,onChange:e=>{!function(e){j(e),sessionStorage.setItem("otherChargesDisc",e)}(e.target.value)},required:!0})):null,l.createElement(o.CardLabel,null,ae("BPA_COMMON_LESS_AMT")),l.createElement(o.TextInput,{t:ae,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"lessAdjusment",defaultValue:(null==B||null===(_=B.selfCertificationCharges)||void 0===_?void 0:_.BPA_LESS_ADJUSMENT_PLOT)||"",value:k,disabled:!R,onChange:e=>{!function(e){var t,l,n,i;/^[0-9]*$/.test(e)&&(parseFloat(e)>(parseFloat(w)?parseFloat(w):0)+parseFloat(M?parseFloat(M):0)+parseFloat(null==B||null===(t=B.selfCertificationCharges)||void 0===t?void 0:t.BPA_MALBA_CHARGES)+parseFloat(null==B||null===(l=B.selfCertificationCharges)||void 0===l?void 0:l.BPA_LABOUR_CESS)+parseFloat(null==B||null===(n=B.selfCertificationCharges)||void 0===n?void 0:n.BPA_WATER_CHARGES)+parseFloat(null==B||null===(i=B.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(k)>0&&R?l.createElement("div",null,l.createElement(o.CardLabel,null,ae("BPA_COMMON_LESS_AMT_FILE")),l.createElement(o.UploadFile,{id:"noc-doc",style:{marginBottom:"200px"},onUpload:function(e){Y(e.target.files[0]),V(e.target.files[0])},disabled:!R,onDelete:()=>{Y(null),V("")},message:$?"1 "+ae("FILEUPLOADED"):ae("ES_NO_FILE_SELECTED_LABEL"),error:J,uploadMessage:q})):null,(null==Q||null===(g=Q.fileStoreIds)||void 0===g?void 0:g.length)&&parseInt(null==B||null===(A=B.selfCertificationCharges)||void 0===A?void 0:A.BPA_LESS_ADJUSMENT_PLOT)>0&&l.createElement(o.CardLabel,{style:{marginTop:"15px"}},ae("BPA_COMMON_LESS_AMT_PREVIOUS_FILE")),(null==Q||null===(S=Q.fileStoreIds)||void 0===S?void 0:S.length)&&parseInt(null==B||null===(h=B.selfCertificationCharges)||void 0===h?void 0:h.BPA_LESS_ADJUSMENT_PLOT)>0&&l.createElement("a",{target:"_blank",href:null==Q||null===(b=Q.fileStoreIds[(null==Q||null===(y=Q.fileStoreIds)||void 0===y?void 0:y.length)-1])||void 0===b?void 0:b.url},l.createElement(o.PDFSvg,null)),l.createElement(o.Row,{className:"border-none"}),l.createElement(o.Row,{className:"border-none",label:ae("BPA_P2_TOTAL_FEE"),text:"₹ "+((parseFloat(w)?parseFloat(w):0)+parseFloat(M?parseFloat(M):0)+parseFloat(null==B||null===(C=B.selfCertificationCharges)||void 0===C?void 0:C.BPA_MALBA_CHARGES)+parseFloat(null==B||null===(T=B.selfCertificationCharges)||void 0===T?void 0:T.BPA_LABOUR_CESS)+parseFloat(null==B||null===(D=B.selfCertificationCharges)||void 0===D?void 0:D.BPA_WATER_CHARGES)+parseFloat(null==B||null===(N=B.selfCertificationCharges)||void 0===N?void 0:N.BPA_GAUSHALA_CHARGES_CESS)-(parseFloat(k)?parseFloat(k):0))}))),l.createElement("div",null,null==I||null===(P=I.scruntinyDetails)||void 0===P?void 0:P.map((e,n)=>l.createElement(t.Fragment,null,l.createElement(o.Row,{className:"border-none",label:""+ae(null==e?void 0:e.title),labelStyle:{width:"150%"}}),l.createElement("a",{href:null==e?void 0:e.value}," ",l.createElement(o.PDFSvg,null)," "),l.createElement("p",{style:{margin:"8px 0px",fontWeight:"bold",fontSize:"16px",lineHeight:"19px",color:"#505A5F"}},ae(null==e?void 0:e.text))))))))},mn=e=>{var a,r,u,s,p,m,E,f,_,g,A,S,h,b,y,C,T,D,N,P,I,L,B,O;let{showTermsPopup:R,setShowTermsPopup:w,otpVerifiedTimestamp:x}=e;const[M,F]=t.useState(!1),{t:k}=n.useTranslation(),U=Digit.UserService.getUser(),H=null==U||null===(a=U.info)||void 0===a?void 0:a.name,W=null==U?void 0:U.info.mobileNumber,j=null==U||null===(r=U.info)||void 0===r?void 0:r.emailId,{id:$}=i.useParams(),Y=Digit.ULBService.getCurrentTenantId(),{data:z}=Digit.Hooks.obps.useBPADetailsPage(Y,{applicationNo:$});let G=Digit.Hooks.useWorkflowDetails({tenantId:null==z||null===(u=z.applicationData)||void 0===u?void 0:u.tenantId,id:$,moduleCode:"OBPS",config:{enabled:!!z}});const[K,V]=t.useState(!1),[q,X]=t.useState(!1),J=null==G||null===(s=G.data)||void 0===s||null===(p=s.timeline)||void 0===p||null===(m=p[0])||void 0===m||null===(E=m.assigner)||void 0===E?void 0:E.name,Z=null==z||null===(f=z.applicationData)||void 0===f||null===(_=f.additionalDetails)||void 0===_?void 0:_.khasraNumber,Q=null==z||null===(g=z.applicationData)||void 0===g||null===(A=g.additionalDetails)||void 0===A?void 0:A.UlbName,ee=null==z||null===(S=z.applicationData)||void 0===S||null===(h=S.additionalDetails)||void 0===h?void 0:h.District,te=null==z||null===(b=z.applicationData)||void 0===b||null===(y=b.additionalDetails)||void 0===y?void 0:y.wardnumber,le=null==z||null===(C=z.applicationData)||void 0===C||null===(T=C.additionalDetails)||void 0===T?void 0:T.area,ne=null==z||null===(D=z.applicationData)||void 0===D||null===(N=D.additionalDetails)||void 0===N?void 0:N.architectid,ie=null==z||null===(P=z.applicationData)||void 0===P||null===(I=P.additionalDetails)||void 0===I?void 0:I.typeOfArchitect,oe=x,ae="Municipal Corporation"===(null==z||null===(L=z.applicationData)||void 0===L||null===(B=L.additionalDetails)||void 0===B?void 0:B.Ulblisttype)?"Commissioner":"Executive Officer",re={...null==z||null===(O=z.applicationData)||void 0===O?void 0:O.additionalDetails,TimeStamp:x},ue={...z,applicationData:{...null==z?void 0:z.applicationData,additionalDetails:re}},de=`\n To,\n <b>${ae}</b>\n <b>${Q}</b> \n \n Dear Sir or Madam,\n\n I/We, Shri/Smt/Kum. <b>${H}</b> under signed owner of land bearing Kh. No. <b>${Z}</b> of ULB \n <b>${Q}</b> Area <b>${le}</b> (Sq.mts.), ward number <b>${te}</b>, City <b>${ee}</b>\n \n I/We hereby declare that the Architect name <b>${J}</b> (<b>${ie}</b>) Architect ID \n <b>${ne}</b> is appointed by me/us and is authorized to make representation/application \n with regard to aforesaid construction to any of the authorities.\n\n I/We further declare that I am/We are aware of all the action taken or representation made \n by the <b>${ie}</b> authorized by me/us.\n\n i) That I am/We are sole owner of the site.\n\n ii) There is no dispute regarding the site and if any dispute arises then I shall be solely resp\n -onsible for the same.\n\n iii) That construction of the building will be undertaken as per the approved building plans \n and strutural design given by the Structural Engineer.\n\n That above stated facts are true and the requisite documents have been uploaded with this E-\n Naksha plan.\n\n\n This Document is Verified By OTP at <b>${oe}\n\n\n Name of Owner - <b>${H}</b>\n Mobile Number - <b>${W}</b>\n Email Id - <b>${j}</b>\n \n `,se=e=>[`Name of Owner - <b>${H}</b>`,`Mobile Number - <b>${W}</b>`,`Email Id - <b>${j}</b>`].includes(e.trim()),ce=()=>{w(!1)},ve={modal:{width:"100%",height:"100%",top:"0",position:"relative",backgroundColor:"rgba(0, 0, 0, 0.7)",display:"flex",justifyContent:"center",alignItems:"center"},modalOverlay:{position:"fixed",top:"0",left:"0",width:"100%",height:"100%",backgroundColor:"rgba(0, 0, 0, 0.7)"},modalContent:{backgroundColor:"#FFFFFF",padding:"2rem",borderRadius:"0.5rem",maxWidth:"800px",margin:"auto",fontFamily:"Roboto, serif",overflowX:"hidden",textAlign:"justify",boxShadow:"0 4px 8px rgba(0, 0, 0, 0.2)",maxHeight:"80vh",overflowY:"auto",lineHeight:"2"},heading:{textAlign:"center",fontWeight:"bold",marginBottom:"10px"},subheading:{textAlign:"center",fontWeight:"bold",marginBottom:"20px"},rightAlignedText:{textAlign:"right",whiteSpace:"pre-wrap",wordWrap:"break-word",fontFamily:"Roboto, serif",lineHeight:"2"}};return l.createElement("div",null,l.createElement(d,{isOpen:R,onRequestClose:ce,contentLabel:"Self-Declaration",style:{modal:ve.modal,overlay:ve.modalOverlay,content:ve.modalContent}},l.createElement("div",null,l.createElement("h2",{style:ve.heading},"DECLARATION UNDER SELF-CERTIFICATION SCHEME"),l.createElement("h3",{style:ve.subheading},"(By OWNER)"),l.createElement("div",{style:{whiteSpace:"pre-wrap",wordWrap:"break-word",textAlign:"justify",fontFamily:"Roboto, serif"}},de.split("\n").map((e,t)=>l.createElement(l.Fragment,{key:t},l.createElement("div",{style:se(e)?ve.rightAlignedText:{},dangerouslySetInnerHTML:{__html:e}}),((e,t)=>{const l="This Document is Verified By OTP at "+oe;return"That above stated facts are true and the requisite documents have been uploaded with this E-Naksha plan."===e.trim()&&""===(null==t?void 0:t.trim())||e.trim()===l})(e,de.split("\n")[t+1])&&l.createElement("div",{style:{marginBottom:"2rem"}})))),l.createElement("div",{style:{display:"flex",justifyContent:"flex-end"}},l.createElement(o.SubmitBar,{label:k("BPA_CLOSE"),onSubmit:ce})),l.createElement("br",null),l.createElement("div",{style:{display:"flex",justifyContent:"flex-end"}},l.createElement("br",null),l.createElement(o.SubmitBar,{label:k("BPA_UPLOAD"),onSubmit:function(){try{const e=v(function(){return c(function(){return V(!0),Promise.resolve(Digit.PaymentService.generatePdf(Digit.ULBService.getStateId(),{Bpa:[ue]},"ownerconsent")).then(function(e){var t;(null==e||null===(t=e.filestoreIds[0])||void 0===t?void 0:t.length)>0?(alert("File Uploaded Successfully"),sessionStorage.setItem("CitizenConsentdocFilestoreid",null==e?void 0:e.filestoreIds[0]),X(!0)):alert("File Upload Failed")})},function(e){alert("Error Uploading PDF:",e)})},function(e,t){if(V(!1),e)throw t;return t});return Promise.resolve(e&&e.then?e.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},disabled:K||q})))))},En=(e,t)=>(t&&Object.keys(t).map(l=>{e=e.replace(":"+l,t[l])}),e),fn=(e,t)=>(t&&Object.keys(t).map(l=>{e=e.replace(":"+l,t[l])}),e),_n=e=>{let{controlFilterForm:i}=e;const{t:r}=n.useTranslation(),u=Digit.ULBService.getCurrentTenantId(),{data:d,isLoading:s}=Digit.Hooks.obps.SearchMdmsTypes.useApplicationTypes(u),c=[{code:"Accepted",name:""+r("EDCR_ACCEPTED")},{code:"Not Accepted",name:""+r("EDCR_NOT_ACCEPTED")}];return l.createElement(t.Fragment,null,l.createElement(o.FilterFormField,null,l.createElement(a.Controller,{name:"status",control:i,render:e=>l.createElement(t.Fragment,null,l.createElement("div",{className:"filter-label sub-filter-label",style:{fontWeight:"400",fontSize:"16px"}},r("BPA_COMMON_TABLE_COL_APP_STATUS_LABEL")),l.createElement(o.RadioButtons,{onSelect:t=>{e.onChange(t.code),Digit.SessionStorage.set("EDCR_BACK","")},selectedOption:c.filter(t=>t.code===e.value)[0],optionsKey:"name",name:"status",options:c}))})),l.createElement(o.FilterFormField,null,l.createElement(a.Controller,{name:"appliactionType",control:i,render:e=>s?l.createElement(o.Loader,null):l.createElement(t.Fragment,null,l.createElement("div",{className:"filter-label sub-filter-label",style:{fontWeight:"400",fontSize:"16px"}},r("BPA_BASIC_DETAILS_SERVICE_TYPE_LABEL")),l.createElement(o.Dropdown,{t:r,option:d,selected:d.filter(t=>t.code===e.value)[0],optionKey:"i18nKey",select:t=>{e.onChange(t.code),Digit.SessionStorage.set("EDCR_BACK","")}}))})))},gn=e=>{let{registerRef:i,searchFieldComponents:a}=e;const{t:r}=n.useTranslation();return window.Digit.Utils.browser.isMobile()?l.createElement(t.Fragment,null,l.createElement(o.SearchField,null,l.createElement("label",null,r("BPA_APPLICATION_NUMBER_LABEL")),l.createElement(o.TextInput,{name:"applicationNumber",inputRef:i({})})),l.createElement(o.SearchField,null,l.createElement("label",null,r("BPA_EDCR_NO_LABEL")),l.createElement(o.TextInput,{name:"edcrNumber",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(o.SearchField,null,l.createElement("label",null,r("BPA_APPLICATION_NUMBER_LABEL")),l.createElement(o.TextInput,{name:"applicationNumber",inputRef:i({})})),l.createElement(o.SearchField,null,l.createElement("label",null,r("BPA_EDCR_NO_LABEL")),l.createElement(o.TextInput,{name:"edcrNumber",inputRef:i({})})),l.createElement("div",{className:"search-action-wrapper",style:{width:"100%"}},a)))))},An=e=>{let{dowloadOptions:n}=e;const[i,a]=t.useState(!1);return l.createElement("div",null,l.createElement(o.MultiLink,{className:"multilinkWrapper",onHeadClick:()=>a(!i),displayOptions:i,options:n,style:{right:"0",position:"unset",top:"0px",margin:"0px"},optionsStyle:{right:"10px",top:"unset",margin:"0px",position:"absolute"}}))},Sn={ARCHITECT:"The registered architect shall be competent to carry out the work related to the building/development permit as given below:\na. Prepare and sign all plans, sub-division/layout plans and information connected with building permit.\nb. Layout Plans of plots measuring upto 1 Ha. in size.\nc. Issuing certificate of supervision and completion of all buildings.\nd. Issuing certificate of supervision for development permit of Layout Plans of plots measuring upto 1 Ha. in size.",ENGINEER:"The registered engineer shall be competent to carry out the work related to the building/development permit as given below:\na. Prepare and sign building plans of plots up to 500 sq.m.(for all types of Buildings), structural drawings and service plans and information connected with building permit;\nb. Preparation of structural drawings, details and calculations of buildings on plot up to 500 m2 and up to 5 storeys or 16 m in height, all service plans and related information.\nc. Issuing certificate of supervision and completion of plots upto 500 sq.m.(for all types of Buildings) pertaining including structure and building services.",STRUCTURALENGINEER:"The registered structural engineer shall be competent to prepare the structural design, calculations and details for all buildings and undertake their supervision.\nIn case of buildings having special structural features, as decided by the Authority, they shall be designed only by Structural engineers.",TOWNPLANNER:"The registered town planner shall be competent to carry out the work related to the development permit as given below:\na. Preparation of plans for land sub-division/ layout and related information connected development permit for all areas more than 1 Hectare.\nb. Issuing of certificate of supervision for development of land of all areas.\nc. Prepare and sign building plans of plots up to 500 sq.m.(for all types of Buildings), structural drawings and service plans and information connected with building permit;\nIssuing certificate of supervision and completion of plots upto 500 sq.m.(for all types of Buildings).\nNOTE — However, for land layouts for development permit above 5 hectare in area, landscape architect shall also be associated, and for land development infrastructural services for roads, water supplies, sewerage / drainage, electrification, etc, the registered engineers for utility services shall be associated.","LANDSCAPE ARCHITECT":"The registered landscape architect shall be competent to carry out the work related to landscape design for building/development permit for land areas 5 hectares and above. In case of metro-cities, this limit of land area shall be 2 hectares and above.\nNOTE — For smaller areas below the limits indicated above, association of landscape architect may also be considered from the point of view of desired landscape development.","URBAN DESIGNER":"The registered urban designer shall be competent to carry out the work related to urban design for city areas more than 5 hectares and campus area more than 2 hectares. He/She shall also be competent to carry out the work of urban renewal for all blighted/congested areas.\nNOTE — For smaller areas below the limits indicated above, association of urban designer may be considered from the point of view of desired urban design.",SUPERVISOR:"The Registered Building Designer and Supervisor shall be competent to carry out the work related to the building / development permit.\na. Prepare and (sign in case of plots upto 250 Sq.Mtr. Only) plans, sub division/layout plans and information connected with building permit.\nb. Issuing certificate of supervision and completion of (In case of plots upto 250 Sq.mtr. only) buildings."};function hn(e){var n,i,a;let{t:r,document:u,setDocuments:d,error:s,setError:v,documents:p,setCheckRequiredFields:m}=e;const E=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],f=Digit.ULBService.getCurrentTenantId(),[_,g]=t.useState(E?{...E,active:!0,code:null==E?void 0:E.documentType,i18nKey:null==E?void 0:E.documentType}:1===(null==u||null===(n=u.dropdownData)||void 0===n?void 0:n.length)?null==u?void 0:u.dropdownData[0]:{}),[A,S]=t.useState(null),[h,b]=t.useState(()=>(null==E?void 0:E.fileStoreId)||null);function y(e){S(e.target.files[0])}return t.useEffect(()=>{d(e=>{const t=null==e?void 0:e.filter(e=>(null==e?void 0:e.documentType)!==(null==u?void 0:u.code));return 0===(null==h?void 0:h.length)||null===h?t:[...null==t?void 0:t.filter(e=>(null==e?void 0:e.fileStoreId)!==h),{documentType:null==u?void 0:u.code,fileStoreId:h,documentUid:h,fileName:(null==A?void 0:A.name)||"",info:(null==u?void 0:u.info)||""}]})},[h,A]),t.useEffect(()=>{!function(){try{v(null);const e=function(){if(A){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(A.size>=5242880)v(r("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=A&&A.type&&!e.test(null==A?void 0:A.type))v(r("NOT_SUPPORTED_FILE_TYPE"));else{const e=c(function(){return b(null),Promise.resolve(Digit.UploadServices.Filestorage("PT",A,null==f?void 0:f.split(".")[0])).then(function(e){var t,l,n,i;(null==e||null===(t=e.data)||void 0===t||null===(l=t.files)||void 0===l?void 0:l.length)>0?b(null==e||null===(n=e.data)||void 0===n||null===(i=n.files[0])||void 0===i?void 0:i.fileStoreId):v(r("CS_FILE_UPLOAD_ERROR"))})},function(){v(r("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)}}()},[A]),l.createElement("div",{style:{marginBottom:"24px"}},l.createElement(o.CardLabel,{style:{marginBottom:"10px"}},null!=u&&u.required?r("BPAREG_HEADER_"+(null==u||null===(i=u.code)||void 0===i?void 0:i.replace(".","_")))+" *":""+r("BPAREG_HEADER_"+(null==u||null===(a=u.code)||void 0===a?void 0:a.replace(".","_")))),null!=u&&u.info?l.createElement("div",{style:{fontSize:"12px",color:"#505A5F",fontWeight:400,lineHeight:"15px",marginBottom:"10px"}},""+r(null==u?void 0:u.info)):null,l.createElement(o.UploadFile,"APPL.BPAREG_PASS_PORT_SIZE_PHOTO"===(null==u?void 0:u.code)?{extraStyleName:"OBPS",accept:".png, .jpeg, .jpg",onUpload:y,onDelete:()=>{b(null),m(!0)},message:h?"1 "+r("CS_ACTION_FILEUPLOADED"):r("CS_ACTION_NO_FILEUPLOADED"),iserror:s}:{extraStyleName:"OBPS",accept:"image/*, .pdf, .png, .jpeg, .jpg",onUpload:y,onDelete:()=>{b(null),m(!0)},message:h?"1 "+r("CS_ACTION_FILEUPLOADED"):r("CS_ACTION_NO_FILEUPLOADED"),iserror:s}))}const bn=e=>{var t,a,r,u,d,s;const{state:c}=e.location,{t:v}=n.useTranslation(),p=i.useHistory(),m=null==c||null===(t=c.data)||void 0===t||null===(a=t.Licenses)||void 0===a?void 0:a[0];return null==m||null===(r=m.tradeLicenseDetail)||void 0===r||null===(u=r.tradeUnits)||void 0===u||null===(d=u[0])||void 0===d||null===(s=d.tradeType)||void 0===s||s.split("."),l.createElement("div",null,l.createElement(o.Card,null,l.createElement(o.Banner,{message:v(`BPA_ARCHITECT_${null==m?void 0:m.status}_MAIN_HEAD`),applicationNumber:null==m?void 0:m.applicationNumber,info:v("BPA_NEW_STAKEHOLDER_REGISTRATION_APP_LABEL"),successful:"REJECTED"!=(null==m?void 0:m.status),style:{padding:"10px"},headerStyles:{fontSize:"32px",wordBreak:"break-word"}}),l.createElement(o.CardText,{style:{paddingBottom:"10px",marginBottom:"10px"}},v(`BPA_ARCHITECT_${null==m?void 0:m.status}_SUB_MAIN_HEAD`)),l.createElement(o.ActionBar,{style:{display:"flex",justifyContent:"flex-end",alignItems:"baseline"}},l.createElement(o.SubmitBar,{label:v("CORE_COMMON_GO_TO_HOME"),onSubmit:()=>{p.push("/digit-ui/employee")}}))))},yn=e=>{let{location:t}=e;const{t:i}=n.useTranslation(),a=[{path:"/digit-ui/employee",content:i("ES_COMMON_HOME"),show:!0},{path:"/digit-ui/employee/obps/inbox",content:i("ES_COMMON_OBPS_INBOX_LABEL"),show:!!t.pathname.includes("obps/inbox")},{path:"/digit-ui/employee/obps/stakeholder-inbox",content:i("ES_COMMON_STAKEHOLDER_INBOX_LABEL"),show:!!t.pathname.includes("obps/stakeholder-inbox")},{path:"/digit-ui/employee/obps/inbox/bpa/:id",content:i("ES_OBPS_SEARCH_BPA"),show:!!t.pathname.includes("obps/inbox/bpa")},{path:"/digit-ui/employee/obps/inbox/stakeholder/:id",content:i("ES_OBPS_SEARCH_BPA"),show:!!t.pathname.includes("obps/stakeholder-inbox/stakeholder")},{path:"/digit-ui/employee/obps/search/application",content:i("ES_OBPS_SEARCH"),show:!!t.pathname.includes("/obps/search/application")},{path:"/digit-ui/employee/obps/search/application/bpa/:id",content:i("ES_OBPS_SEARCH_BPA"),show:!!t.pathname.includes("/obps/search/application/bpa")},{path:"/digit-ui/employee/obps/search/application/stakeholder/:id",content:i("ES_OBPS_SEARCH_BPA"),show:!!t.pathname.includes("/obps/search/application/stakeholder/")}];return l.createElement(o.BreadCrumb,{crumbs:a})},Cn=e=>{let{path:a}=e;const r=i.useLocation(),{t:u}=n.useTranslation(),d=Digit.ComponentRegistryService.getComponent("BPAInbox"),c=Digit.ComponentRegistryService.getComponent("StakeholderInbox"),v=Digit.ComponentRegistryService.getComponent("ObpsEmpApplicationDetail"),p=Digit.ComponentRegistryService.getComponent("ObpsEmployeeBpaApplicationDetail"),m=window.location.href.includes("bpa")||window.location.href.includes("stakeholder-inbox/stakeholder")||window.location.href.includes("application"),E=window.location.href.includes("digit-ui/employee/obps/bpa/"),f=window.location.href.includes("obps/response")||window.location.href.includes("obps/stakeholder-response");return l.createElement(t.Fragment,null,E||f?null:l.createElement("div",{style:m?{marginLeft:"10px"}:{}},l.createElement(yn,{location:r})),E?l.createElement(o.BackButton,{style:{border:"none",margin:"0",padding:"0"}},u("CS_COMMON_BACK")):null,l.createElement(i.Switch,null,l.createElement(o.PrivateRoute,{path:a+"/stakeholder-inbox/stakeholder/:id",component:v}),l.createElement(o.PrivateRoute,{path:a+"/search/application/stakeholder/:id",component:v}),l.createElement(o.PrivateRoute,{path:a+"/search/application/editApplication/bpa/:id",component:p}),l.createElement(o.PrivateRoute,{path:a+"/search/application/bpa/:id",component:p}),l.createElement(o.PrivateRoute,{path:a+"/search/application",component:e=>l.createElement(Ht,s({},e,{parentRoute:a}))}),l.createElement(o.PrivateRoute,{path:a+"/inbox/editApplication/bpa/:id",component:p}),l.createElement(o.PrivateRoute,{path:a+"/inbox/bpa/:id",component:p}),l.createElement(o.PrivateRoute,{path:a+"/inbox",component:e=>l.createElement(d,s({},e,{parentRoute:a}))}),l.createElement(o.PrivateRoute,{path:a+"/stakeholder-inbox",component:e=>l.createElement(c,s({},e,{parentRoute:a}))}),l.createElement(o.PrivateRoute,{path:a+"/bpa/:id",component:p}),l.createElement(o.PrivateRoute,{path:a+"/response",component:Gt}),l.createElement(o.PrivateRoute,{path:a+"/stakeholder-response",component:bn})))};var Tn=S(function(e,t){(function(){var l="Expected a function",n="__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]",d="[object Error]",s="[object Function]",c="[object GeneratorFunction]",v="[object Map]",p="[object Number]",m="[object Object]",E="[object RegExp]",f="[object Set]",_="[object String]",g="[object Symbol]",S="[object WeakMap]",h="[object ArrayBuffer]",b="[object DataView]",y="[object Float32Array]",C="[object Float64Array]",T="[object Int8Array]",D="[object Int16Array]",N="[object Int32Array]",P="[object Uint8Array]",I="[object Uint16Array]",L="[object Uint32Array]",B=/\b__p \+= '';/g,O=/\b(__p \+=) '' \+/g,R=/(__e\(.*?\)|\b__t\)) \+\n'';/g,w=/&(?:amp|lt|gt|quot|#39);/g,x=/[&<>"']/g,M=RegExp(w.source),F=RegExp(x.source),k=/<%-([\s\S]+?)%>/g,U=/<%([\s\S]+?)%>/g,H=/<%=([\s\S]+?)%>/g,W=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,j=/^\w*$/,$=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Y=/[\\^$.*+?()[\]{}|]/g,z=RegExp(Y.source),G=/^\s+/,K=/\s/,V=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,q=/\{\n\/\* \[wrapped with (.+)\] \*/,X=/,? & /,J=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Z=/[()=,{}\[\]\/\s]/,Q=/\\(\\)?/g,ee=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,te=/\w*$/,le=/^[-+]0x[0-9a-f]+$/i,ne=/^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=/($^)/,de=/['\n\r\u2028\u2029\\]/g,se="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",ce="\\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="["+ce+"]",pe="["+se+"]",me="\\d+",Ee="[a-z\\xdf-\\xf6\\xf8-\\xff]",fe="[^\\ud800-\\udfff"+ce+me+"\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",_e="\\ud83c[\\udffb-\\udfff]",ge="[^\\ud800-\\udfff]",Ae="(?:\\ud83c[\\udde6-\\uddff]){2}",Se="[\\ud800-\\udbff][\\udc00-\\udfff]",he="[A-Z\\xc0-\\xd6\\xd8-\\xde]",be="(?:"+Ee+"|"+fe+")",ye="(?:"+he+"|"+fe+")",Ce="(?:"+pe+"|"+_e+")?",Te="[\\ufe0e\\ufe0f]?"+Ce+"(?:\\u200d(?:"+[ge,Ae,Se].join("|")+")[\\ufe0e\\ufe0f]?"+Ce+")*",De="(?:"+["[\\u2700-\\u27bf]",Ae,Se].join("|")+")"+Te,Ne="(?:"+[ge+pe+"?",pe,Ae,Se,"[\\ud800-\\udfff]"].join("|")+")",Pe=RegExp("['’]","g"),Ie=RegExp(pe,"g"),Le=RegExp(_e+"(?="+_e+")|"+Ne+Te,"g"),Be=RegExp([he+"?"+Ee+"+(?:['’](?:d|ll|m|re|s|t|ve))?(?="+[ve,he,"$"].join("|")+")",ye+"+(?:['’](?:D|LL|M|RE|S|T|VE))?(?="+[ve,he+be,"$"].join("|")+")",he+"?"+be+"+(?:['’](?:d|ll|m|re|s|t|ve))?",he+"+(?:['’](?:D|LL|M|RE|S|T|VE))?","\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",me,De].join("|"),"g"),Oe=RegExp("[\\u200d\\ud800-\\udfff"+se+"\\ufe0e\\ufe0f]"),Re=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,we=["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"],xe=-1,Me={};Me[y]=Me[C]=Me[T]=Me[D]=Me[N]=Me[P]=Me["[object Uint8ClampedArray]"]=Me[I]=Me[L]=!0,Me[o]=Me[a]=Me[h]=Me[r]=Me[b]=Me[u]=Me[d]=Me[s]=Me[v]=Me[p]=Me[m]=Me[E]=Me[f]=Me[_]=Me[S]=!1;var Fe={};Fe[o]=Fe[a]=Fe[h]=Fe[b]=Fe[r]=Fe[u]=Fe[y]=Fe[C]=Fe[T]=Fe[D]=Fe[N]=Fe[v]=Fe[p]=Fe[m]=Fe[E]=Fe[f]=Fe[_]=Fe[g]=Fe[P]=Fe["[object Uint8ClampedArray]"]=Fe[I]=Fe[L]=!0,Fe[d]=Fe[s]=Fe[S]=!1;var ke={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Ue=parseFloat,He=parseInt,We="object"==typeof A&&A&&A.Object===Object&&A,je="object"==typeof self&&self&&self.Object===Object&&self,$e=We||je||Function("return this")(),Ye=t&&!t.nodeType&&t,ze=Ye&&e&&!e.nodeType&&e,Ge=ze&&ze.exports===Ye,Ke=Ge&&We.process,Ve=function(){try{return ze&&ze.require&&ze.require("util").types||Ke&&Ke.binding&&Ke.binding("util")}catch(e){}}(),qe=Ve&&Ve.isArrayBuffer,Xe=Ve&&Ve.isDate,Je=Ve&&Ve.isMap,Ze=Ve&&Ve.isRegExp,Qe=Ve&&Ve.isSet,et=Ve&&Ve.isTypedArray;function tt(e,t,l){switch(l.length){case 0:return e.call(t);case 1:return e.call(t,l[0]);case 2:return e.call(t,l[0],l[1]);case 3:return e.call(t,l[0],l[1],l[2])}return e.apply(t,l)}function lt(e,t,l,n){for(var i=-1,o=null==e?0:e.length;++i<o;){var a=e[i];t(n,a,l(a),e)}return n}function nt(e,t){for(var l=-1,n=null==e?0:e.length;++l<n&&!1!==t(e[l],l,e););return e}function it(e,t){for(var l=null==e?0:e.length;l--&&!1!==t(e[l],l,e););return e}function ot(e,t){for(var l=-1,n=null==e?0:e.length;++l<n;)if(!t(e[l],l,e))return!1;return!0}function at(e,t){for(var l=-1,n=null==e?0:e.length,i=0,o=[];++l<n;){var a=e[l];t(a,l,e)&&(o[i++]=a)}return o}function rt(e,t){return!(null==e||!e.length)&&_t(e,t,0)>-1}function ut(e,t,l){for(var n=-1,i=null==e?0:e.length;++n<i;)if(l(t,e[n]))return!0;return!1}function dt(e,t){for(var l=-1,n=null==e?0:e.length,i=Array(n);++l<n;)i[l]=t(e[l],l,e);return i}function st(e,t){for(var l=-1,n=t.length,i=e.length;++l<n;)e[i+l]=t[l];return e}function ct(e,t,l,n){var i=-1,o=null==e?0:e.length;for(n&&o&&(l=e[++i]);++i<o;)l=t(l,e[i],i,e);return l}function vt(e,t,l,n){var i=null==e?0:e.length;for(n&&i&&(l=e[--i]);i--;)l=t(l,e[i],i,e);return l}function pt(e,t){for(var l=-1,n=null==e?0:e.length;++l<n;)if(t(e[l],l,e))return!0;return!1}var mt=ht("length");function Et(e,t,l){var n;return l(e,function(e,l,i){if(t(e,l,i))return n=l,!1}),n}function ft(e,t,l,n){for(var i=e.length,o=l+(n?1:-1);n?o--:++o<i;)if(t(e[o],o,e))return o;return-1}function _t(e,t,l){return t==t?function(e,t,l){for(var n=l-1,i=e.length;++n<i;)if(e[n]===t)return n;return-1}(e,t,l):ft(e,At,l)}function gt(e,t,l,n){for(var i=l-1,o=e.length;++i<o;)if(n(e[i],t))return i;return-1}function At(e){return e!=e}function St(e,t){var l=null==e?0:e.length;return l?Ct(e,t)/l:NaN}function ht(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,l,n,i){return i(e,function(e,i,o){l=n?(n=!1,e):t(l,e,i,o)}),l}function Ct(e,t){for(var l,n=-1,i=e.length;++n<i;){var o=t(e[n]);void 0!==o&&(l=void 0===l?o:l+o)}return l}function Tt(e,t){for(var l=-1,n=Array(e);++l<e;)n[l]=t(l);return n}function Dt(e){return e?e.slice(0,Yt(e)+1).replace(G,""):e}function Nt(e){return function(t){return e(t)}}function Pt(e,t){return dt(t,function(t){return e[t]})}function It(e,t){return e.has(t)}function Lt(e,t){for(var l=-1,n=e.length;++l<n&&_t(t,e[l],0)>-1;);return l}function Bt(e,t){for(var l=e.length;l--&&_t(t,e[l],0)>-1;);return l}function Ot(e,t){for(var l=e.length,n=0;l--;)e[l]===t&&++n;return n}var Rt=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"}),wt=bt({"&":"&","<":"<",">":">",'"':""","'":"'"});function xt(e){return"\\"+ke[e]}function Mt(e){return Oe.test(e)}function Ft(e){var t=-1,l=Array(e.size);return e.forEach(function(e,n){l[++t]=[n,e]}),l}function kt(e,t){return function(l){return e(t(l))}}function Ut(e,t){for(var l=-1,i=e.length,o=0,a=[];++l<i;){var r=e[l];r!==t&&r!==n||(e[l]=n,a[o++]=l)}return a}function Ht(e){var t=-1,l=Array(e.size);return e.forEach(function(e){l[++t]=e}),l}function Wt(e){var t=-1,l=Array(e.size);return e.forEach(function(e){l[++t]=[e,e]}),l}function jt(e){return Mt(e)?function(e){for(var t=Le.lastIndex=0;Le.test(e);)++t;return t}(e):mt(e)}function $t(e){return Mt(e)?function(e){return e.match(Le)||[]}(e):function(e){return e.split("")}(e)}function Yt(e){for(var t=e.length;t--&&K.test(e.charAt(t)););return t}var zt=bt({"&":"&","<":"<",">":">",""":'"',"'":"'"}),Gt=function e(t){var A=(t=null==t?$e:Gt.defaults($e.Object(),t,Gt.pick($e,we))).Array,K=t.Date,se=t.Error,ce=t.Function,ve=t.Math,pe=t.Object,me=t.RegExp,Ee=t.String,fe=t.TypeError,_e=A.prototype,ge=pe.prototype,Ae=t["__core-js_shared__"],Se=ce.prototype.toString,he=ge.hasOwnProperty,be=0,ye=function(){var e=/[^.]+$/.exec(Ae&&Ae.keys&&Ae.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),Ce=ge.toString,Te=Se.call(pe),De=$e._,Ne=me("^"+Se.call(he).replace(Y,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Le=Ge?t.Buffer:void 0,Oe=t.Symbol,ke=t.Uint8Array,We=Le?Le.allocUnsafe:void 0,je=kt(pe.getPrototypeOf,pe),Ye=pe.create,ze=ge.propertyIsEnumerable,Ke=_e.splice,Ve=Oe?Oe.isConcatSpreadable:void 0,mt=Oe?Oe.iterator:void 0,bt=Oe?Oe.toStringTag:void 0,Kt=function(){try{var e=Ji(pe,"defineProperty");return e({},"",{}),e}catch(e){}}(),Vt=t.clearTimeout!==$e.clearTimeout&&t.clearTimeout,qt=K&&K.now!==$e.Date.now&&K.now,Xt=t.setTimeout!==$e.setTimeout&&t.setTimeout,Jt=ve.ceil,Zt=ve.floor,Qt=pe.getOwnPropertySymbols,el=Le?Le.isBuffer:void 0,tl=t.isFinite,ll=_e.join,nl=kt(pe.keys,pe),il=ve.max,ol=ve.min,al=K.now,rl=t.parseInt,ul=ve.random,dl=_e.reverse,sl=Ji(t,"DataView"),cl=Ji(t,"Map"),vl=Ji(t,"Promise"),pl=Ji(t,"Set"),ml=Ji(t,"WeakMap"),El=Ji(pe,"create"),fl=ml&&new ml,_l={},gl=No(sl),Al=No(cl),Sl=No(vl),hl=No(pl),bl=No(ml),yl=Oe?Oe.prototype:void 0,Cl=yl?yl.valueOf:void 0,Tl=yl?yl.toString:void 0;function Dl(e){if(Ya(e)&&!Ra(e)&&!(e instanceof Ll)){if(e instanceof Il)return e;if(he.call(e,"__wrapped__"))return Po(e)}return new Il(e)}var Nl=function(){function e(){}return function(t){if(!$a(t))return{};if(Ye)return Ye(t);e.prototype=t;var l=new e;return e.prototype=void 0,l}}();function Pl(){}function Il(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=void 0}function Ll(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=4294967295,this.__views__=[]}function Bl(e){var t=-1,l=null==e?0:e.length;for(this.clear();++t<l;){var n=e[t];this.set(n[0],n[1])}}function Ol(e){var t=-1,l=null==e?0:e.length;for(this.clear();++t<l;){var n=e[t];this.set(n[0],n[1])}}function Rl(e){var t=-1,l=null==e?0:e.length;for(this.clear();++t<l;){var n=e[t];this.set(n[0],n[1])}}function wl(e){var t=-1,l=null==e?0:e.length;for(this.__data__=new Rl;++t<l;)this.add(e[t])}function xl(e){var t=this.__data__=new Ol(e);this.size=t.size}function Ml(e,t){var l=Ra(e),n=!l&&Oa(e),i=!l&&!n&&Fa(e),o=!l&&!n&&!i&&Za(e),a=l||n||i||o,r=a?Tt(e.length,Ee):[],u=r.length;for(var d in e)!t&&!he.call(e,d)||a&&("length"==d||i&&("offset"==d||"parent"==d)||o&&("buffer"==d||"byteLength"==d||"byteOffset"==d)||io(d,u))||r.push(d);return r}function Fl(e){var t=e.length;return t?e[wn(0,t-1)]:void 0}function kl(e,t){return bo(Ei(e),Kl(t,0,e.length))}function Ul(e){return bo(Ei(e))}function Hl(e,t,l){(void 0!==l&&!Ia(e[t],l)||void 0===l&&!(t in e))&&zl(e,t,l)}function Wl(e,t,l){var n=e[t];he.call(e,t)&&Ia(n,l)&&(void 0!==l||t in e)||zl(e,t,l)}function jl(e,t){for(var l=e.length;l--;)if(Ia(e[l][0],t))return l;return-1}function $l(e,t,l,n){return Zl(e,function(e,i,o){t(n,e,l(e),o)}),n}function Yl(e,t){return e&&fi(t,Sr(t),e)}function zl(e,t,l){"__proto__"==t&&Kt?Kt(e,t,{configurable:!0,enumerable:!0,value:l,writable:!0}):e[t]=l}function Gl(e,t){for(var l=-1,n=t.length,i=A(n),o=null==e;++l<n;)i[l]=o?void 0:Er(e,t[l]);return i}function Kl(e,t,l){return e==e&&(void 0!==l&&(e=e<=l?e:l),void 0!==t&&(e=e>=t?e:t)),e}function Vl(e,t,l,n,i,a){var d,A=1&t,S=2&t,B=4&t;if(l&&(d=i?l(e,n,i,a):l(e)),void 0!==d)return d;if(!$a(e))return e;var O=Ra(e);if(O){if(d=function(e){var t=e.length,l=new e.constructor(t);return t&&"string"==typeof e[0]&&he.call(e,"index")&&(l.index=e.index,l.input=e.input),l}(e),!A)return Ei(e,d)}else{var R=eo(e),w=R==s||R==c;if(Fa(e))return di(e,A);if(R==m||R==o||w&&!i){if(d=S||w?{}:lo(e),!A)return S?function(e,t){return fi(e,Qi(e),t)}(e,function(e,t){return e&&fi(t,hr(t),e)}(d,e)):function(e,t){return fi(e,Zi(e),t)}(e,Yl(d,e))}else{if(!Fe[R])return i?e:{};d=function(e,t,l){var n=e.constructor;switch(t){case h:return si(e);case r:case u:return new n(+e);case b:return function(e,t){var l=t?si(e.buffer):e.buffer;return new e.constructor(l,e.byteOffset,e.byteLength)}(e,l);case y:case C:case T:case D:case N:case P:case"[object Uint8ClampedArray]":case I:case L:return ci(e,l);case v:return new n;case p:case _:return new n(e);case E:return function(e){var t=new e.constructor(e.source,te.exec(e));return t.lastIndex=e.lastIndex,t}(e);case f:return new n;case g:return Cl?pe(Cl.call(e)):{}}}(e,R,A)}}a||(a=new xl);var x=a.get(e);if(x)return x;a.set(e,d),qa(e)?e.forEach(function(n){d.add(Vl(n,t,l,n,e,a))}):za(e)&&e.forEach(function(n,i){d.set(i,Vl(n,t,l,i,e,a))});var M=O?void 0:(B?S?Yi:$i:S?hr:Sr)(e);return nt(M||e,function(n,i){M&&(n=e[i=n]),Wl(d,i,Vl(n,t,l,i,e,a))}),d}function ql(e,t,l){var n=l.length;if(null==e)return!n;for(e=pe(e);n--;){var i=l[n],o=e[i];if(void 0===o&&!(i in e)||!(0,t[i])(o))return!1}return!0}function Xl(e,t,n){if("function"!=typeof e)throw new fe(l);return go(function(){e.apply(void 0,n)},t)}function Jl(e,t,l,n){var i=-1,o=rt,a=!0,r=e.length,u=[],d=t.length;if(!r)return u;l&&(t=dt(t,Nt(l))),n?(o=ut,a=!1):t.length>=200&&(o=It,a=!1,t=new wl(t));e:for(;++i<r;){var s=e[i],c=null==l?s:l(s);if(s=n||0!==s?s:0,a&&c==c){for(var v=d;v--;)if(t[v]===c)continue e;u.push(s)}else o(t,c,n)||u.push(s)}return u}Dl.templateSettings={escape:k,evaluate:U,interpolate:H,variable:"",imports:{_:Dl}},(Dl.prototype=Pl.prototype).constructor=Dl,(Il.prototype=Nl(Pl.prototype)).constructor=Il,(Ll.prototype=Nl(Pl.prototype)).constructor=Ll,Bl.prototype.clear=function(){this.__data__=El?El(null):{},this.size=0},Bl.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Bl.prototype.get=function(e){var t=this.__data__;if(El){var l=t[e];return"__lodash_hash_undefined__"===l?void 0:l}return he.call(t,e)?t[e]:void 0},Bl.prototype.has=function(e){var t=this.__data__;return El?void 0!==t[e]:he.call(t,e)},Bl.prototype.set=function(e,t){var l=this.__data__;return this.size+=this.has(e)?0:1,l[e]=El&&void 0===t?"__lodash_hash_undefined__":t,this},Ol.prototype.clear=function(){this.__data__=[],this.size=0},Ol.prototype.delete=function(e){var t=this.__data__,l=jl(t,e);return!(l<0||(l==t.length-1?t.pop():Ke.call(t,l,1),--this.size,0))},Ol.prototype.get=function(e){var t=this.__data__,l=jl(t,e);return l<0?void 0:t[l][1]},Ol.prototype.has=function(e){return jl(this.__data__,e)>-1},Ol.prototype.set=function(e,t){var l=this.__data__,n=jl(l,e);return n<0?(++this.size,l.push([e,t])):l[n][1]=t,this},Rl.prototype.clear=function(){this.size=0,this.__data__={hash:new Bl,map:new(cl||Ol),string:new Bl}},Rl.prototype.delete=function(e){var t=qi(this,e).delete(e);return this.size-=t?1:0,t},Rl.prototype.get=function(e){return qi(this,e).get(e)},Rl.prototype.has=function(e){return qi(this,e).has(e)},Rl.prototype.set=function(e,t){var l=qi(this,e),n=l.size;return l.set(e,t),this.size+=l.size==n?0:1,this},wl.prototype.add=wl.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},wl.prototype.has=function(e){return this.__data__.has(e)},xl.prototype.clear=function(){this.__data__=new Ol,this.size=0},xl.prototype.delete=function(e){var t=this.__data__,l=t.delete(e);return this.size=t.size,l},xl.prototype.get=function(e){return this.__data__.get(e)},xl.prototype.has=function(e){return this.__data__.has(e)},xl.prototype.set=function(e,t){var l=this.__data__;if(l instanceof Ol){var n=l.__data__;if(!cl||n.length<199)return n.push([e,t]),this.size=++l.size,this;l=this.__data__=new Rl(n)}return l.set(e,t),this.size=l.size,this};var Zl=Ai(rn),Ql=Ai(un,!0);function en(e,t){var l=!0;return Zl(e,function(e,n,i){return l=!!t(e,n,i)}),l}function tn(e,t,l){for(var n=-1,i=e.length;++n<i;){var o=e[n],a=t(o);if(null!=a&&(void 0===r?a==a&&!Ja(a):l(a,r)))var r=a,u=o}return u}function ln(e,t){var l=[];return Zl(e,function(e,n,i){t(e,n,i)&&l.push(e)}),l}function nn(e,t,l,n,i){var o=-1,a=e.length;for(l||(l=no),i||(i=[]);++o<a;){var r=e[o];t>0&&l(r)?t>1?nn(r,t-1,l,n,i):st(i,r):n||(i[i.length]=r)}return i}var on=Si(),an=Si(!0);function rn(e,t){return e&&on(e,t,Sr)}function un(e,t){return e&&an(e,t,Sr)}function dn(e,t){return at(t,function(t){return Ha(e[t])})}function sn(e,t){for(var l=0,n=(t=oi(t,e)).length;null!=e&&l<n;)e=e[Do(t[l++])];return l&&l==n?e:void 0}function cn(e,t,l){var n=t(e);return Ra(e)?n:st(n,l(e))}function vn(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":bt&&bt in pe(e)?function(e){var t=he.call(e,bt),l=e[bt];try{e[bt]=void 0;var n=!0}catch(e){}var i=Ce.call(e);return n&&(t?e[bt]=l:delete e[bt]),i}(e):function(e){return Ce.call(e)}(e)}function pn(e,t){return e>t}function mn(e,t){return null!=e&&he.call(e,t)}function En(e,t){return null!=e&&t in pe(e)}function fn(e,t,l){for(var n=l?ut:rt,i=e[0].length,o=e.length,a=o,r=A(o),u=Infinity,d=[];a--;){var s=e[a];a&&t&&(s=dt(s,Nt(t))),u=ol(s.length,u),r[a]=!l&&(t||i>=120&&s.length>=120)?new wl(a&&s):void 0}s=e[0];var c=-1,v=r[0];e:for(;++c<i&&d.length<u;){var p=s[c],m=t?t(p):p;if(p=l||0!==p?p:0,!(v?It(v,m):n(d,m,l))){for(a=o;--a;){var E=r[a];if(!(E?It(E,m):n(e[a],m,l)))continue e}v&&v.push(m),d.push(p)}}return d}function _n(e,t,l){var n=null==(e=mo(e,t=oi(t,e)))?e:e[Do(Uo(t))];return null==n?void 0:tt(n,e,l)}function gn(e){return Ya(e)&&vn(e)==o}function An(e,t,l,n,i){return e===t||(null==e||null==t||!Ya(e)&&!Ya(t)?e!=e&&t!=t:function(e,t,l,n,i,s){var c=Ra(e),A=Ra(t),S=c?a:eo(e),y=A?a:eo(t),C=(S=S==o?m:S)==m,T=(y=y==o?m:y)==m,D=S==y;if(D&&Fa(e)){if(!Fa(t))return!1;c=!0,C=!1}if(D&&!C)return s||(s=new xl),c||Za(e)?Wi(e,t,l,n,i,s):function(e,t,l,n,i,o,a){switch(l){case b:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case h:return!(e.byteLength!=t.byteLength||!o(new ke(e),new ke(t)));case r:case u:case p:return Ia(+e,+t);case d:return e.name==t.name&&e.message==t.message;case E:case _:return e==t+"";case v:var s=Ft;case f:if(s||(s=Ht),e.size!=t.size&&!(1&n))return!1;var c=a.get(e);if(c)return c==t;n|=2,a.set(e,t);var m=Wi(s(e),s(t),n,i,o,a);return a.delete(e),m;case g:if(Cl)return Cl.call(e)==Cl.call(t)}return!1}(e,t,S,l,n,i,s);if(!(1&l)){var N=C&&he.call(e,"__wrapped__"),P=T&&he.call(t,"__wrapped__");if(N||P){var I=N?e.value():e,L=P?t.value():t;return s||(s=new xl),i(I,L,l,n,s)}}return!!D&&(s||(s=new xl),function(e,t,l,n,i,o){var a=1&l,r=$i(e),u=r.length;if(u!=$i(t).length&&!a)return!1;for(var d=u;d--;){var s=r[d];if(!(a?s in t:he.call(t,s)))return!1}var c=o.get(e),v=o.get(t);if(c&&v)return c==t&&v==e;var p=!0;o.set(e,t),o.set(t,e);for(var m=a;++d<u;){var E=e[s=r[d]],f=t[s];if(n)var _=a?n(f,E,s,t,e,o):n(E,f,s,e,t,o);if(!(void 0===_?E===f||i(E,f,l,n,o):_)){p=!1;break}m||(m="constructor"==s)}if(p&&!m){var g=e.constructor,A=t.constructor;g==A||!("constructor"in e)||!("constructor"in t)||"function"==typeof g&&g instanceof g&&"function"==typeof A&&A instanceof A||(p=!1)}return o.delete(e),o.delete(t),p}(e,t,l,n,i,s))}(e,t,l,n,An,i))}function Sn(e,t,l,n){var i=l.length,o=i,a=!n;if(null==e)return!o;for(e=pe(e);i--;){var r=l[i];if(a&&r[2]?r[1]!==e[r[0]]:!(r[0]in e))return!1}for(;++i<o;){var u=(r=l[i])[0],d=e[u],s=r[1];if(a&&r[2]){if(void 0===d&&!(u in e))return!1}else{var c=new xl;if(n)var v=n(d,s,u,e,t,c);if(!(void 0===v?An(s,d,3,n,c):v))return!1}}return!0}function hn(e){return!(!$a(e)||(t=e,ye&&ye in t))&&(Ha(e)?Ne:ie).test(No(e));var t}function bn(e){return"function"==typeof e?e:null==e?Gr:"object"==typeof e?Ra(e)?Nn(e[0],e[1]):Dn(e):tu(e)}function yn(e){if(!so(e))return nl(e);var t=[];for(var l in pe(e))he.call(e,l)&&"constructor"!=l&&t.push(l);return t}function Cn(e,t){return e<t}function Tn(e,t){var l=-1,n=xa(e)?A(e.length):[];return Zl(e,function(e,i,o){n[++l]=t(e,i,o)}),n}function Dn(e){var t=Xi(e);return 1==t.length&&t[0][2]?vo(t[0][0],t[0][1]):function(l){return l===e||Sn(l,e,t)}}function Nn(e,t){return ao(e)&&co(t)?vo(Do(e),t):function(l){var n=Er(l,e);return void 0===n&&n===t?fr(l,e):An(t,n,3)}}function Pn(e,t,l,n,i){e!==t&&on(t,function(o,a){if(i||(i=new xl),$a(o))!function(e,t,l,n,i,o,a){var r=fo(e,l),u=fo(t,l),d=a.get(u);if(d)Hl(e,l,d);else{var s=o?o(r,u,l+"",e,t,a):void 0,c=void 0===s;if(c){var v=Ra(u),p=!v&&Fa(u),m=!v&&!p&&Za(u);s=u,v||p||m?Ra(r)?s=r:Ma(r)?s=Ei(r):p?(c=!1,s=di(u,!0)):m?(c=!1,s=ci(u,!0)):s=[]:Ka(u)||Oa(u)?(s=r,Oa(r)?s=ar(r):$a(r)&&!Ha(r)||(s=lo(u))):c=!1}c&&(a.set(u,s),i(s,u,n,o,a),a.delete(u)),Hl(e,l,s)}}(e,t,a,l,Pn,n,i);else{var r=n?n(fo(e,a),o,a+"",e,t,i):void 0;void 0===r&&(r=o),Hl(e,a,r)}},hr)}function In(e,t){var l=e.length;if(l)return io(t+=t<0?l:0,l)?e[t]:void 0}function Ln(e,t,l){t=t.length?dt(t,function(e){return Ra(e)?function(t){return sn(t,1===e.length?e[0]:e)}:e}):[Gr];var n=-1;return t=dt(t,Nt(Vi())),function(e,t){var n=e.length;for(e.sort(function(e,t){return function(e,t,l){for(var n=-1,i=e.criteria,o=t.criteria,a=i.length,r=l.length;++n<a;){var u=vi(i[n],o[n]);if(u)return n>=r?u:u*("desc"==l[n]?-1:1)}return e.index-t.index}(e,t,l)});n--;)e[n]=e[n].value;return e}(Tn(e,function(e,l,i){return{criteria:dt(t,function(t){return t(e)}),index:++n,value:e}}))}function Bn(e,t,l){for(var n=-1,i=t.length,o={};++n<i;){var a=t[n],r=sn(e,a);l(r,a)&&Un(o,oi(a,e),r)}return o}function On(e,t,l,n){var i=n?gt:_t,o=-1,a=t.length,r=e;for(e===t&&(t=Ei(t)),l&&(r=dt(e,Nt(l)));++o<a;)for(var u=0,d=t[o],s=l?l(d):d;(u=i(r,s,u,n))>-1;)r!==e&&Ke.call(r,u,1),Ke.call(e,u,1);return e}function Rn(e,t){for(var l=e?t.length:0,n=l-1;l--;){var i=t[l];if(l==n||i!==o){var o=i;io(i)?Ke.call(e,i,1):Jn(e,i)}}return e}function wn(e,t){return e+Zt(ul()*(t-e+1))}function xn(e,t){var l="";if(!e||t<1||t>9007199254740991)return l;do{t%2&&(l+=e),(t=Zt(t/2))&&(e+=e)}while(t);return l}function Mn(e,t){return Ao(po(e,t,Gr),e+"")}function Fn(e){return Fl(Ir(e))}function kn(e,t){var l=Ir(e);return bo(l,Kl(t,0,l.length))}function Un(e,t,l,n){if(!$a(e))return e;for(var i=-1,o=(t=oi(t,e)).length,a=o-1,r=e;null!=r&&++i<o;){var u=Do(t[i]),d=l;if("__proto__"===u||"constructor"===u||"prototype"===u)return e;if(i!=a){var s=r[u];void 0===(d=n?n(s,u,r):void 0)&&(d=$a(s)?s:io(t[i+1])?[]:{})}Wl(r,u,d),r=r[u]}return e}var Hn=fl?function(e,t){return fl.set(e,t),e}:Gr,Wn=Kt?function(e,t){return Kt(e,"toString",{configurable:!0,enumerable:!1,value:$r(t),writable:!0})}:Gr;function jn(e){return bo(Ir(e))}function $n(e,t,l){var n=-1,i=e.length;t<0&&(t=-t>i?0:i+t),(l=l>i?i:l)<0&&(l+=i),i=t>l?0:l-t>>>0,t>>>=0;for(var o=A(i);++n<i;)o[n]=e[n+t];return o}function Yn(e,t){var l;return Zl(e,function(e,n,i){return!(l=t(e,n,i))}),!!l}function zn(e,t,l){var n=0,i=null==e?n:e.length;if("number"==typeof t&&t==t&&i<=2147483647){for(;n<i;){var o=n+i>>>1,a=e[o];null!==a&&!Ja(a)&&(l?a<=t:a<t)?n=o+1:i=o}return i}return Gn(e,t,Gr,l)}function Gn(e,t,l,n){var i=0,o=null==e?0:e.length;if(0===o)return 0;for(var a=(t=l(t))!=t,r=null===t,u=Ja(t),d=void 0===t;i<o;){var s=Zt((i+o)/2),c=l(e[s]),v=void 0!==c,p=null===c,m=c==c,E=Ja(c);if(a)var f=n||m;else f=d?m&&(n||v):r?m&&v&&(n||!p):u?m&&v&&!p&&(n||!E):!p&&!E&&(n?c<=t:c<t);f?i=s+1:o=s}return ol(o,4294967294)}function Kn(e,t){for(var l=-1,n=e.length,i=0,o=[];++l<n;){var a=e[l],r=t?t(a):a;if(!l||!Ia(r,u)){var u=r;o[i++]=0===a?0:a}}return o}function Vn(e){return"number"==typeof e?e:Ja(e)?NaN:+e}function qn(e){if("string"==typeof e)return e;if(Ra(e))return dt(e,qn)+"";if(Ja(e))return Tl?Tl.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Xn(e,t,l){var n=-1,i=rt,o=e.length,a=!0,r=[],u=r;if(l)a=!1,i=ut;else if(o>=200){var d=t?null:xi(e);if(d)return Ht(d);a=!1,i=It,u=new wl}else u=t?[]:r;e:for(;++n<o;){var s=e[n],c=t?t(s):s;if(s=l||0!==s?s:0,a&&c==c){for(var v=u.length;v--;)if(u[v]===c)continue e;t&&u.push(c),r.push(s)}else i(u,c,l)||(u!==r&&u.push(c),r.push(s))}return r}function Jn(e,t){return null==(e=mo(e,t=oi(t,e)))||delete e[Do(Uo(t))]}function Zn(e,t,l,n){return Un(e,t,l(sn(e,t)),n)}function Qn(e,t,l,n){for(var i=e.length,o=n?i:-1;(n?o--:++o<i)&&t(e[o],o,e););return l?$n(e,n?0:o,n?o+1:i):$n(e,n?o+1:0,n?i:o)}function ei(e,t){var l=e;return l instanceof Ll&&(l=l.value()),ct(t,function(e,t){return t.func.apply(t.thisArg,st([e],t.args))},l)}function ti(e,t,l){var n=e.length;if(n<2)return n?Xn(e[0]):[];for(var i=-1,o=A(n);++i<n;)for(var a=e[i],r=-1;++r<n;)r!=i&&(o[i]=Jl(o[i]||a,e[r],t,l));return Xn(nn(o,1),t,l)}function li(e,t,l){for(var n=-1,i=e.length,o=t.length,a={};++n<i;)l(a,e[n],n<o?t[n]:void 0);return a}function ni(e){return Ma(e)?e:[]}function ii(e){return"function"==typeof e?e:Gr}function oi(e,t){return Ra(e)?e:ao(e,t)?[e]:To(rr(e))}var ai=Mn;function ri(e,t,l){var n=e.length;return l=void 0===l?n:l,!t&&l>=n?e:$n(e,t,l)}var ui=Vt||function(e){return $e.clearTimeout(e)};function di(e,t){if(t)return e.slice();var l=e.length,n=We?We(l):new e.constructor(l);return e.copy(n),n}function si(e){var t=new e.constructor(e.byteLength);return new ke(t).set(new ke(e)),t}function ci(e,t){var l=t?si(e.buffer):e.buffer;return new e.constructor(l,e.byteOffset,e.length)}function vi(e,t){if(e!==t){var l=void 0!==e,n=null===e,i=e==e,o=Ja(e),a=void 0!==t,r=null===t,u=t==t,d=Ja(t);if(!r&&!d&&!o&&e>t||o&&a&&u&&!r&&!d||n&&a&&u||!l&&u||!i)return 1;if(!n&&!o&&!d&&e<t||d&&l&&i&&!n&&!o||r&&l&&i||!a&&i||!u)return-1}return 0}function pi(e,t,l,n){for(var i=-1,o=e.length,a=l.length,r=-1,u=t.length,d=il(o-a,0),s=A(u+d),c=!n;++r<u;)s[r]=t[r];for(;++i<a;)(c||i<o)&&(s[l[i]]=e[i]);for(;d--;)s[r++]=e[i++];return s}function mi(e,t,l,n){for(var i=-1,o=e.length,a=-1,r=l.length,u=-1,d=t.length,s=il(o-r,0),c=A(s+d),v=!n;++i<s;)c[i]=e[i];for(var p=i;++u<d;)c[p+u]=t[u];for(;++a<r;)(v||i<o)&&(c[p+l[a]]=e[i++]);return c}function Ei(e,t){var l=-1,n=e.length;for(t||(t=A(n));++l<n;)t[l]=e[l];return t}function fi(e,t,l,n){var i=!l;l||(l={});for(var o=-1,a=t.length;++o<a;){var r=t[o],u=n?n(l[r],e[r],r,l,e):void 0;void 0===u&&(u=e[r]),i?zl(l,r,u):Wl(l,r,u)}return l}function _i(e,t){return function(l,n){var i=Ra(l)?lt:$l,o=t?t():{};return i(l,e,Vi(n,2),o)}}function gi(e){return Mn(function(t,l){var n=-1,i=l.length,o=i>1?l[i-1]:void 0,a=i>2?l[2]:void 0;for(o=e.length>3&&"function"==typeof o?(i--,o):void 0,a&&oo(l[0],l[1],a)&&(o=i<3?void 0:o,i=1),t=pe(t);++n<i;){var r=l[n];r&&e(t,r,n,o)}return t})}function Ai(e,t){return function(l,n){if(null==l)return l;if(!xa(l))return e(l,n);for(var i=l.length,o=t?i:-1,a=pe(l);(t?o--:++o<i)&&!1!==n(a[o],o,a););return l}}function Si(e){return function(t,l,n){for(var i=-1,o=pe(t),a=n(t),r=a.length;r--;){var u=a[e?r:++i];if(!1===l(o[u],u,o))break}return t}}function hi(e){return function(t){var l=Mt(t=rr(t))?$t(t):void 0,n=l?l[0]:t.charAt(0),i=l?ri(l,1).join(""):t.slice(1);return n[e]()+i}}function bi(e){return function(t){return ct(Hr(Or(t).replace(Pe,"")),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 l=Nl(e.prototype),n=e.apply(l,t);return $a(n)?n:l}}function Ci(e){return function(t,l,n){var i=pe(t);if(!xa(t)){var o=Vi(l,3);t=Sr(t),l=function(e){return o(i[e],e,i)}}var a=e(t,l,n);return a>-1?i[o?t[a]:a]:void 0}}function Ti(e){return ji(function(t){var n=t.length,i=n,o=Il.prototype.thru;for(e&&t.reverse();i--;){var a=t[i];if("function"!=typeof a)throw new fe(l);if(o&&!r&&"wrapper"==Gi(a))var r=new Il([],!0)}for(i=r?i:n;++i<n;){var u=Gi(a=t[i]),d="wrapper"==u?zi(a):void 0;r=d&&ro(d[0])&&424==d[1]&&!d[4].length&&1==d[9]?r[Gi(d[0])].apply(r,d[3]):1==a.length&&ro(a)?r[u]():r.thru(a)}return function(){var e=arguments,l=e[0];if(r&&1==e.length&&Ra(l))return r.plant(l).value();for(var i=0,o=n?t[i].apply(this,e):l;++i<n;)o=t[i].call(this,o);return o}})}function Di(e,t,l,n,i,o,a,r,u,d){var s=128&t,c=1&t,v=2&t,p=24&t,m=512&t,E=v?void 0:yi(e);return function f(){for(var _=arguments.length,g=A(_),S=_;S--;)g[S]=arguments[S];if(p)var h=Ki(f),b=Ot(g,h);if(n&&(g=pi(g,n,i,p)),o&&(g=mi(g,o,a,p)),_-=b,p&&_<d){var y=Ut(g,h);return Ri(e,t,Di,f.placeholder,l,g,y,r,u,d-_)}var C=c?l:this,T=v?C[e]:e;return _=g.length,r?g=Eo(g,r):m&&_>1&&g.reverse(),s&&u<_&&(g.length=u),this&&this!==$e&&this instanceof f&&(T=E||yi(T)),T.apply(C,g)}}function Ni(e,t){return function(l,n){return function(e,t,l,n){return rn(e,function(e,i,o){t(n,l(e),i,o)}),n}(l,e,t(n),{})}}function Pi(e,t){return function(l,n){var i;if(void 0===l&&void 0===n)return t;if(void 0!==l&&(i=l),void 0!==n){if(void 0===i)return n;"string"==typeof l||"string"==typeof n?(l=qn(l),n=qn(n)):(l=Vn(l),n=Vn(n)),i=e(l,n)}return i}}function Ii(e){return ji(function(t){return t=dt(t,Nt(Vi())),Mn(function(l){var n=this;return e(t,function(e){return tt(e,n,l)})})})}function Li(e,t){var l=(t=void 0===t?" ":qn(t)).length;if(l<2)return l?xn(t,e):t;var n=xn(t,Jt(e/jt(t)));return Mt(t)?ri($t(n),0,e).join(""):n.slice(0,e)}function Bi(e){return function(t,l,n){return n&&"number"!=typeof n&&oo(t,l,n)&&(l=n=void 0),t=lr(t),void 0===l?(l=t,t=0):l=lr(l),function(e,t,l,n){for(var i=-1,o=il(Jt((t-e)/(l||1)),0),a=A(o);o--;)a[n?o:++i]=e,e+=l;return a}(t,l,n=void 0===n?t<l?1:-1:lr(n),e)}}function Oi(e){return function(t,l){return"string"==typeof t&&"string"==typeof l||(t=or(t),l=or(l)),e(t,l)}}function Ri(e,t,l,n,i,o,a,r,u,d){var s=8&t;t|=s?32:64,4&(t&=~(s?64:32))||(t&=-4);var c=[e,t,i,s?o:void 0,s?a:void 0,s?void 0:o,s?void 0:a,r,u,d],v=l.apply(void 0,c);return ro(e)&&_o(v,c),v.placeholder=n,So(v,e,t)}function wi(e){var t=ve[e];return function(e,l){if(e=or(e),(l=null==l?0:ol(nr(l),292))&&tl(e)){var n=(rr(e)+"e").split("e");return+((n=(rr(t(n[0]+"e"+(+n[1]+l)))+"e").split("e"))[0]+"e"+(+n[1]-l))}return t(e)}}var xi=pl&&1/Ht(new pl([,-0]))[1]==1/0?function(e){return new pl(e)}:Jr;function Mi(e){return function(t){var l=eo(t);return l==v?Ft(t):l==f?Wt(t):function(e,t){return dt(t,function(t){return[t,e[t]]})}(t,e(t))}}function Fi(e,t,i,o,a,r,u,d){var s=2&t;if(!s&&"function"!=typeof e)throw new fe(l);var c=o?o.length:0;if(c||(t&=-97,o=a=void 0),u=void 0===u?u:il(nr(u),0),d=void 0===d?d:nr(d),c-=a?a.length:0,64&t){var v=o,p=a;o=a=void 0}var m=s?void 0:zi(e),E=[e,t,i,o,a,v,p,r,u,d];if(m&&function(e,t){var l=e[1],i=t[1],o=l|i;if(!(o<131||128==i&&8==l||128==i&&256==l&&e[7].length<=t[8]||384==i&&t[7].length<=t[8]&&8==l))return e;1&i&&(e[2]=t[2],o|=1&l?0:4);var a=t[3];if(a){var r=e[3];e[3]=r?pi(r,a,t[4]):a,e[4]=r?Ut(e[3],n):t[4]}(a=t[5])&&(e[5]=(r=e[5])?mi(r,a,t[6]):a,e[6]=r?Ut(e[5],n):t[6]),(a=t[7])&&(e[7]=a),128&i&&(e[8]=null==e[8]?t[8]:ol(e[8],t[8])),null==e[9]&&(e[9]=t[9]),e[0]=t[0],e[1]=o}(E,m),e=E[0],t=E[1],i=E[2],o=E[3],a=E[4],!(d=E[9]=void 0===E[9]?s?0:e.length:il(E[9]-c,0))&&24&t&&(t&=-25),t&&1!=t)f=8==t||16==t?function(e,t,l){var n=yi(e);return function i(){for(var o=arguments.length,a=A(o),r=o,u=Ki(i);r--;)a[r]=arguments[r];var d=o<3&&a[0]!==u&&a[o-1]!==u?[]:Ut(a,u);if((o-=d.length)<l)return Ri(e,t,Di,i.placeholder,void 0,a,d,void 0,void 0,l-o);var s=this&&this!==$e&&this instanceof i?n:e;return tt(s,this,a)}}(e,t,d):32!=t&&33!=t||a.length?Di.apply(void 0,E):function(e,t,l,n){var i=1&t,o=yi(e);return function t(){for(var a=-1,r=arguments.length,u=-1,d=n.length,s=A(d+r),c=this&&this!==$e&&this instanceof t?o:e;++u<d;)s[u]=n[u];for(;r--;)s[u++]=arguments[++a];return tt(c,i?l:this,s)}}(e,t,i,o);else var f=function(e,t,l){var n=1&t,i=yi(e);return function t(){var o=this&&this!==$e&&this instanceof t?i:e;return o.apply(n?l:this,arguments)}}(e,t,i);return So((m?Hn:_o)(f,E),e,t)}function ki(e,t,l,n){return void 0===e||Ia(e,ge[l])&&!he.call(n,l)?t:e}function Ui(e,t,l,n,i,o){return $a(e)&&$a(t)&&(o.set(t,e),Pn(e,t,void 0,Ui,o),o.delete(t)),e}function Hi(e){return Ka(e)?void 0:e}function Wi(e,t,l,n,i,o){var a=1&l,r=e.length,u=t.length;if(r!=u&&!(a&&u>r))return!1;var d=o.get(e),s=o.get(t);if(d&&s)return d==t&&s==e;var c=-1,v=!0,p=2&l?new wl:void 0;for(o.set(e,t),o.set(t,e);++c<r;){var m=e[c],E=t[c];if(n)var f=a?n(E,m,c,t,e,o):n(m,E,c,e,t,o);if(void 0!==f){if(f)continue;v=!1;break}if(p){if(!pt(t,function(e,t){if(!It(p,t)&&(m===e||i(m,e,l,n,o)))return p.push(t)})){v=!1;break}}else if(m!==E&&!i(m,E,l,n,o)){v=!1;break}}return o.delete(e),o.delete(t),v}function ji(e){return Ao(po(e,void 0,wo),e+"")}function $i(e){return cn(e,Sr,Zi)}function Yi(e){return cn(e,hr,Qi)}var zi=fl?function(e){return fl.get(e)}:Jr;function Gi(e){for(var t=e.name+"",l=_l[t],n=he.call(_l,t)?l.length:0;n--;){var i=l[n],o=i.func;if(null==o||o==e)return i.name}return t}function Ki(e){return(he.call(Dl,"placeholder")?Dl:e).placeholder}function Vi(){var e=Dl.iteratee||Kr;return e=e===Kr?bn:e,arguments.length?e(arguments[0],arguments[1]):e}function qi(e,t){var l=e.__data__;return function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}(t)?l["string"==typeof t?"string":"hash"]:l.map}function Xi(e){for(var t=Sr(e),l=t.length;l--;){var n=t[l],i=e[n];t[l]=[n,i,co(i)]}return t}function Ji(e,t){var l=function(e,t){return null==e?void 0:e[t]}(e,t);return hn(l)?l:void 0}var Zi=Qt?function(e){return null==e?[]:(e=pe(e),at(Qt(e),function(t){return ze.call(e,t)}))}:iu,Qi=Qt?function(e){for(var t=[];e;)st(t,Zi(e)),e=je(e);return t}:iu,eo=vn;function to(e,t,l){for(var n=-1,i=(t=oi(t,e)).length,o=!1;++n<i;){var a=Do(t[n]);if(!(o=null!=e&&l(e,a)))break;e=e[a]}return o||++n!=i?o:!!(i=null==e?0:e.length)&&ja(i)&&io(a,i)&&(Ra(e)||Oa(e))}function lo(e){return"function"!=typeof e.constructor||so(e)?{}:Nl(je(e))}function no(e){return Ra(e)||Oa(e)||!!(Ve&&e&&e[Ve])}function io(e,t){var l=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==l||"symbol"!=l&&ae.test(e))&&e>-1&&e%1==0&&e<t}function oo(e,t,l){if(!$a(l))return!1;var n=typeof t;return!!("number"==n?xa(l)&&io(t,l.length):"string"==n&&t in l)&&Ia(l[t],e)}function ao(e,t){if(Ra(e))return!1;var l=typeof e;return!("number"!=l&&"symbol"!=l&&"boolean"!=l&&null!=e&&!Ja(e))||j.test(e)||!W.test(e)||null!=t&&e in pe(t)}function ro(e){var t=Gi(e),l=Dl[t];if("function"!=typeof l||!(t in Ll.prototype))return!1;if(e===l)return!0;var n=zi(l);return!!n&&e===n[0]}(sl&&eo(new sl(new ArrayBuffer(1)))!=b||cl&&eo(new cl)!=v||vl&&"[object Promise]"!=eo(vl.resolve())||pl&&eo(new pl)!=f||ml&&eo(new ml)!=S)&&(eo=function(e){var t=vn(e),l=t==m?e.constructor:void 0,n=l?No(l):"";if(n)switch(n){case gl:return b;case Al:return v;case Sl:return"[object Promise]";case hl:return f;case bl:return S}return t});var uo=Ae?Ha:ou;function so(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||ge)}function co(e){return e==e&&!$a(e)}function vo(e,t){return function(l){return null!=l&&l[e]===t&&(void 0!==t||e in pe(l))}}function po(e,t,l){return t=il(void 0===t?e.length-1:t,0),function(){for(var n=arguments,i=-1,o=il(n.length-t,0),a=A(o);++i<o;)a[i]=n[t+i];i=-1;for(var r=A(t+1);++i<t;)r[i]=n[i];return r[t]=l(a),tt(e,this,r)}}function mo(e,t){return t.length<2?e:sn(e,$n(t,0,-1))}function Eo(e,t){for(var l=e.length,n=ol(t.length,l),i=Ei(e);n--;){var o=t[n];e[n]=io(o,l)?i[o]:void 0}return e}function fo(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var _o=ho(Hn),go=Xt||function(e,t){return $e.setTimeout(e,t)},Ao=ho(Wn);function So(e,t,l){var n=t+"";return Ao(e,function(e,t){var l=t.length;if(!l)return e;var n=l-1;return t[n]=(l>1?"& ":"")+t[n],t=t.join(l>2?", ":" "),e.replace(V,"{\n/* [wrapped with "+t+"] */\n")}(n,function(e,t){return nt(i,function(l){var n="_."+l[0];t&l[1]&&!rt(e,n)&&e.push(n)}),e.sort()}(function(e){var t=e.match(q);return t?t[1].split(X):[]}(n),l)))}function ho(e){var t=0,l=0;return function(){var n=al(),i=16-(n-l);if(l=n,i>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function bo(e,t){var l=-1,n=e.length,i=n-1;for(t=void 0===t?n:t;++l<t;){var o=wn(l,i),a=e[o];e[o]=e[l],e[l]=a}return e.length=t,e}var yo,Co,To=(yo=ya(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace($,function(e,l,n,i){t.push(n?i.replace(Q,"$1"):l||e)}),t},function(e){return 500===Co.size&&Co.clear(),e}),Co=yo.cache,yo);function Do(e){if("string"==typeof e||Ja(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function No(e){if(null!=e){try{return Se.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function Po(e){if(e instanceof Ll)return e.clone();var t=new Il(e.__wrapped__,e.__chain__);return t.__actions__=Ei(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var Io=Mn(function(e,t){return Ma(e)?Jl(e,nn(t,1,Ma,!0)):[]}),Lo=Mn(function(e,t){var l=Uo(t);return Ma(l)&&(l=void 0),Ma(e)?Jl(e,nn(t,1,Ma,!0),Vi(l,2)):[]}),Bo=Mn(function(e,t){var l=Uo(t);return Ma(l)&&(l=void 0),Ma(e)?Jl(e,nn(t,1,Ma,!0),void 0,l):[]});function Oo(e,t,l){var n=null==e?0:e.length;if(!n)return-1;var i=null==l?0:nr(l);return i<0&&(i=il(n+i,0)),ft(e,Vi(t,3),i)}function Ro(e,t,l){var n=null==e?0:e.length;if(!n)return-1;var i=n-1;return void 0!==l&&(i=nr(l),i=l<0?il(n+i,0):ol(i,n-1)),ft(e,Vi(t,3),i,!0)}function wo(e){return null!=e&&e.length?nn(e,1):[]}function xo(e){return e&&e.length?e[0]:void 0}var Mo=Mn(function(e){var t=dt(e,ni);return t.length&&t[0]===e[0]?fn(t):[]}),Fo=Mn(function(e){var t=Uo(e),l=dt(e,ni);return t===Uo(l)?t=void 0:l.pop(),l.length&&l[0]===e[0]?fn(l,Vi(t,2)):[]}),ko=Mn(function(e){var t=Uo(e),l=dt(e,ni);return(t="function"==typeof t?t:void 0)&&l.pop(),l.length&&l[0]===e[0]?fn(l,void 0,t):[]});function Uo(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}var Ho=Mn(Wo);function Wo(e,t){return e&&e.length&&t&&t.length?On(e,t):e}var jo=ji(function(e,t){var l=null==e?0:e.length,n=Gl(e,t);return Rn(e,dt(t,function(e){return io(e,l)?+e:e}).sort(vi)),n});function $o(e){return null==e?e:dl.call(e)}var Yo=Mn(function(e){return Xn(nn(e,1,Ma,!0))}),zo=Mn(function(e){var t=Uo(e);return Ma(t)&&(t=void 0),Xn(nn(e,1,Ma,!0),Vi(t,2))}),Go=Mn(function(e){var t=Uo(e);return t="function"==typeof t?t:void 0,Xn(nn(e,1,Ma,!0),void 0,t)});function Ko(e){if(!e||!e.length)return[];var t=0;return e=at(e,function(e){if(Ma(e))return t=il(e.length,t),!0}),Tt(t,function(t){return dt(e,ht(t))})}function Vo(e,t){if(!e||!e.length)return[];var l=Ko(e);return null==t?l:dt(l,function(e){return tt(t,void 0,e)})}var qo=Mn(function(e,t){return Ma(e)?Jl(e,t):[]}),Xo=Mn(function(e){return ti(at(e,Ma))}),Jo=Mn(function(e){var t=Uo(e);return Ma(t)&&(t=void 0),ti(at(e,Ma),Vi(t,2))}),Zo=Mn(function(e){var t=Uo(e);return t="function"==typeof t?t:void 0,ti(at(e,Ma),void 0,t)}),Qo=Mn(Ko),ea=Mn(function(e){var t=e.length,l=t>1?e[t-1]:void 0;return l="function"==typeof l?(e.pop(),l):void 0,Vo(e,l)});function ta(e){var t=Dl(e);return t.__chain__=!0,t}function la(e,t){return t(e)}var na=ji(function(e){var t=e.length,l=t?e[0]:0,n=this.__wrapped__,i=function(t){return Gl(t,e)};return!(t>1||this.__actions__.length)&&n instanceof Ll&&io(l)?((n=n.slice(l,+l+(t?1:0))).__actions__.push({func:la,args:[i],thisArg:void 0}),new Il(n,this.__chain__).thru(function(e){return t&&!e.length&&e.push(void 0),e})):this.thru(i)}),ia=_i(function(e,t,l){he.call(e,l)?++e[l]:zl(e,l,1)}),oa=Ci(Oo),aa=Ci(Ro);function ra(e,t){return(Ra(e)?nt:Zl)(e,Vi(t,3))}function ua(e,t){return(Ra(e)?it:Ql)(e,Vi(t,3))}var da=_i(function(e,t,l){he.call(e,l)?e[l].push(t):zl(e,l,[t])}),sa=Mn(function(e,t,l){var n=-1,i="function"==typeof t,o=xa(e)?A(e.length):[];return Zl(e,function(e){o[++n]=i?tt(t,e,l):_n(e,t,l)}),o}),ca=_i(function(e,t,l){zl(e,l,t)});function va(e,t){return(Ra(e)?dt:Tn)(e,Vi(t,3))}var pa=_i(function(e,t,l){e[l?0:1].push(t)},function(){return[[],[]]}),ma=Mn(function(e,t){if(null==e)return[];var l=t.length;return l>1&&oo(e,t[0],t[1])?t=[]:l>2&&oo(t[0],t[1],t[2])&&(t=[t[0]]),Ln(e,nn(t,1),[])}),Ea=qt||function(){return $e.Date.now()};function fa(e,t,l){return t=l?void 0:t,Fi(e,128,void 0,void 0,void 0,void 0,t=e&&null==t?e.length:t)}function _a(e,t){var n;if("function"!=typeof t)throw new fe(l);return e=nr(e),function(){return--e>0&&(n=t.apply(this,arguments)),e<=1&&(t=void 0),n}}var ga=Mn(function(e,t,l){var n=1;if(l.length){var i=Ut(l,Ki(ga));n|=32}return Fi(e,n,t,l,i)}),Aa=Mn(function(e,t,l){var n=3;if(l.length){var i=Ut(l,Ki(Aa));n|=32}return Fi(t,n,e,l,i)});function Sa(e,t,n){var i,o,a,r,u,d,s=0,c=!1,v=!1,p=!0;if("function"!=typeof e)throw new fe(l);function m(t){var l=i,n=o;return i=o=void 0,s=t,r=e.apply(n,l)}function E(e){return s=e,u=go(_,t),c?m(e):r}function f(e){var l=e-d;return void 0===d||l>=t||l<0||v&&e-s>=a}function _(){var e=Ea();if(f(e))return g(e);u=go(_,function(e){var l=t-(e-d);return v?ol(l,a-(e-s)):l}(e))}function g(e){return u=void 0,p&&i?m(e):(i=o=void 0,r)}function A(){var e=Ea(),l=f(e);if(i=arguments,o=this,d=e,l){if(void 0===u)return E(d);if(v)return ui(u),u=go(_,t),m(d)}return void 0===u&&(u=go(_,t)),r}return t=or(t)||0,$a(n)&&(c=!!n.leading,a=(v="maxWait"in n)?il(or(n.maxWait)||0,t):a,p="trailing"in n?!!n.trailing:p),A.cancel=function(){void 0!==u&&ui(u),s=0,i=d=o=u=void 0},A.flush=function(){return void 0===u?r:g(Ea())},A}var ha=Mn(function(e,t){return Xl(e,1,t)}),ba=Mn(function(e,t,l){return Xl(e,or(t)||0,l)});function ya(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new fe(l);var n=function(){var l=arguments,i=t?t.apply(this,l):l[0],o=n.cache;if(o.has(i))return o.get(i);var a=e.apply(this,l);return n.cache=o.set(i,a)||o,a};return n.cache=new(ya.Cache||Rl),n}function Ca(e){if("function"!=typeof e)throw new fe(l);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=Rl;var Ta=ai(function(e,t){var l=(t=1==t.length&&Ra(t[0])?dt(t[0],Nt(Vi())):dt(nn(t,1),Nt(Vi()))).length;return Mn(function(n){for(var i=-1,o=ol(n.length,l);++i<o;)n[i]=t[i].call(this,n[i]);return tt(e,this,n)})}),Da=Mn(function(e,t){return Fi(e,32,void 0,t,Ut(t,Ki(Da)))}),Na=Mn(function(e,t){return Fi(e,64,void 0,t,Ut(t,Ki(Na)))}),Pa=ji(function(e,t){return Fi(e,256,void 0,void 0,void 0,t)});function Ia(e,t){return e===t||e!=e&&t!=t}var La=Oi(pn),Ba=Oi(function(e,t){return e>=t}),Oa=gn(function(){return arguments}())?gn:function(e){return Ya(e)&&he.call(e,"callee")&&!ze.call(e,"callee")},Ra=A.isArray,wa=qe?Nt(qe):function(e){return Ya(e)&&vn(e)==h};function xa(e){return null!=e&&ja(e.length)&&!Ha(e)}function Ma(e){return Ya(e)&&xa(e)}var Fa=el||ou,ka=Xe?Nt(Xe):function(e){return Ya(e)&&vn(e)==u};function Ua(e){if(!Ya(e))return!1;var t=vn(e);return t==d||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!Ka(e)}function Ha(e){if(!$a(e))return!1;var t=vn(e);return t==s||t==c||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Wa(e){return"number"==typeof e&&e==nr(e)}function ja(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}function $a(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function Ya(e){return null!=e&&"object"==typeof e}var za=Je?Nt(Je):function(e){return Ya(e)&&eo(e)==v};function Ga(e){return"number"==typeof e||Ya(e)&&vn(e)==p}function Ka(e){if(!Ya(e)||vn(e)!=m)return!1;var t=je(e);if(null===t)return!0;var l=he.call(t,"constructor")&&t.constructor;return"function"==typeof l&&l instanceof l&&Se.call(l)==Te}var Va=Ze?Nt(Ze):function(e){return Ya(e)&&vn(e)==E},qa=Qe?Nt(Qe):function(e){return Ya(e)&&eo(e)==f};function Xa(e){return"string"==typeof e||!Ra(e)&&Ya(e)&&vn(e)==_}function Ja(e){return"symbol"==typeof e||Ya(e)&&vn(e)==g}var Za=et?Nt(et):function(e){return Ya(e)&&ja(e.length)&&!!Me[vn(e)]},Qa=Oi(Cn),er=Oi(function(e,t){return e<=t});function tr(e){if(!e)return[];if(xa(e))return Xa(e)?$t(e):Ei(e);if(mt&&e[mt])return function(e){for(var t,l=[];!(t=e.next()).done;)l.push(t.value);return l}(e[mt]());var t=eo(e);return(t==v?Ft:t==f?Ht:Ir)(e)}function lr(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 nr(e){var t=lr(e),l=t%1;return t==t?l?t-l:t:0}function ir(e){return e?Kl(nr(e),0,4294967295):0}function or(e){if("number"==typeof e)return e;if(Ja(e))return NaN;if($a(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=$a(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Dt(e);var l=ne.test(e);return l||oe.test(e)?He(e.slice(2),l?2:8):le.test(e)?NaN:+e}function ar(e){return fi(e,hr(e))}function rr(e){return null==e?"":qn(e)}var ur=gi(function(e,t){if(so(t)||xa(t))fi(t,Sr(t),e);else for(var l in t)he.call(t,l)&&Wl(e,l,t[l])}),dr=gi(function(e,t){fi(t,hr(t),e)}),sr=gi(function(e,t,l,n){fi(t,hr(t),e,n)}),cr=gi(function(e,t,l,n){fi(t,Sr(t),e,n)}),vr=ji(Gl),pr=Mn(function(e,t){e=pe(e);var l=-1,n=t.length,i=n>2?t[2]:void 0;for(i&&oo(t[0],t[1],i)&&(n=1);++l<n;)for(var o=t[l],a=hr(o),r=-1,u=a.length;++r<u;){var d=a[r],s=e[d];(void 0===s||Ia(s,ge[d])&&!he.call(e,d))&&(e[d]=o[d])}return e}),mr=Mn(function(e){return e.push(void 0,Ui),tt(yr,void 0,e)});function Er(e,t,l){var n=null==e?void 0:sn(e,t);return void 0===n?l:n}function fr(e,t){return null!=e&&to(e,t,En)}var _r=Ni(function(e,t,l){null!=t&&"function"!=typeof t.toString&&(t=Ce.call(t)),e[t]=l},$r(Gr)),gr=Ni(function(e,t,l){null!=t&&"function"!=typeof t.toString&&(t=Ce.call(t)),he.call(e,t)?e[t].push(l):e[t]=[l]},Vi),Ar=Mn(_n);function Sr(e){return xa(e)?Ml(e):yn(e)}function hr(e){return xa(e)?Ml(e,!0):function(e){if(!$a(e))return function(e){var t=[];if(null!=e)for(var l in pe(e))t.push(l);return t}(e);var t=so(e),l=[];for(var n in e)("constructor"!=n||!t&&he.call(e,n))&&l.push(n);return l}(e)}var br=gi(function(e,t,l){Pn(e,t,l)}),yr=gi(function(e,t,l,n){Pn(e,t,l,n)}),Cr=ji(function(e,t){var l={};if(null==e)return l;var n=!1;t=dt(t,function(t){return t=oi(t,e),n||(n=t.length>1),t}),fi(e,Yi(e),l),n&&(l=Vl(l,7,Hi));for(var i=t.length;i--;)Jn(l,t[i]);return l}),Tr=ji(function(e,t){return null==e?{}:function(e,t){return Bn(e,t,function(t,l){return fr(e,l)})}(e,t)});function Dr(e,t){if(null==e)return{};var l=dt(Yi(e),function(e){return[e]});return t=Vi(t),Bn(e,l,function(e,l){return t(e,l[0])})}var Nr=Mi(Sr),Pr=Mi(hr);function Ir(e){return null==e?[]:Pt(e,Sr(e))}var Lr=bi(function(e,t,l){return t=t.toLowerCase(),e+(l?Br(t):t)});function Br(e){return Ur(rr(e).toLowerCase())}function Or(e){return(e=rr(e))&&e.replace(re,Rt).replace(Ie,"")}var Rr=bi(function(e,t,l){return e+(l?"-":"")+t.toLowerCase()}),wr=bi(function(e,t,l){return e+(l?" ":"")+t.toLowerCase()}),xr=hi("toLowerCase"),Mr=bi(function(e,t,l){return e+(l?"_":"")+t.toLowerCase()}),Fr=bi(function(e,t,l){return e+(l?" ":"")+Ur(t)}),kr=bi(function(e,t,l){return e+(l?" ":"")+t.toUpperCase()}),Ur=hi("toUpperCase");function Hr(e,t,l){return e=rr(e),void 0===(t=l?void 0:t)?function(e){return Re.test(e)}(e)?function(e){return e.match(Be)||[]}(e):function(e){return e.match(J)||[]}(e):e.match(t)||[]}var Wr=Mn(function(e,t){try{return tt(e,void 0,t)}catch(e){return Ua(e)?e:new se(e)}}),jr=ji(function(e,t){return nt(t,function(t){t=Do(t),zl(e,t,ga(e[t],e))}),e});function $r(e){return function(){return e}}var Yr=Ti(),zr=Ti(!0);function Gr(e){return e}function Kr(e){return bn("function"==typeof e?e:Vl(e,1))}var Vr=Mn(function(e,t){return function(l){return _n(l,e,t)}}),qr=Mn(function(e,t){return function(l){return _n(e,l,t)}});function Xr(e,t,l){var n=Sr(t),i=dn(t,n);null!=l||$a(t)&&(i.length||!n.length)||(l=t,t=e,e=this,i=dn(t,Sr(t)));var o=!($a(l)&&"chain"in l&&!l.chain),a=Ha(e);return nt(i,function(l){var n=t[l];e[l]=n,a&&(e.prototype[l]=function(){var t=this.__chain__;if(o||t){var l=e(this.__wrapped__),i=l.__actions__=Ei(this.__actions__);return i.push({func:n,args:arguments,thisArg:e}),l.__chain__=t,l}return n.apply(e,st([this.value()],arguments))})}),e}function Jr(){}var Zr=Ii(dt),Qr=Ii(ot),eu=Ii(pt);function tu(e){return ao(e)?ht(Do(e)):function(e){return function(t){return sn(t,e)}}(e)}var lu=Bi(),nu=Bi(!0);function iu(){return[]}function ou(){return!1}var au,ru=Pi(function(e,t){return e+t},0),uu=wi("ceil"),du=Pi(function(e,t){return e/t},1),su=wi("floor"),cu=Pi(function(e,t){return e*t},1),vu=wi("round"),pu=Pi(function(e,t){return e-t},0);return Dl.after=function(e,t){if("function"!=typeof t)throw new fe(l);return e=nr(e),function(){if(--e<1)return t.apply(this,arguments)}},Dl.ary=fa,Dl.assign=ur,Dl.assignIn=dr,Dl.assignInWith=sr,Dl.assignWith=cr,Dl.at=vr,Dl.before=_a,Dl.bind=ga,Dl.bindAll=jr,Dl.bindKey=Aa,Dl.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return Ra(e)?e:[e]},Dl.chain=ta,Dl.chunk=function(e,t,l){t=(l?oo(e,t,l):void 0===t)?1:il(nr(t),0);var n=null==e?0:e.length;if(!n||t<1)return[];for(var i=0,o=0,a=A(Jt(n/t));i<n;)a[o++]=$n(e,i,i+=t);return a},Dl.compact=function(e){for(var t=-1,l=null==e?0:e.length,n=0,i=[];++t<l;){var o=e[t];o&&(i[n++]=o)}return i},Dl.concat=function(){var e=arguments.length;if(!e)return[];for(var t=A(e-1),l=arguments[0],n=e;n--;)t[n-1]=arguments[n];return st(Ra(l)?Ei(l):[l],nn(t,1))},Dl.cond=function(e){var t=null==e?0:e.length,n=Vi();return e=t?dt(e,function(e){if("function"!=typeof e[1])throw new fe(l);return[n(e[0]),e[1]]}):[],Mn(function(l){for(var n=-1;++n<t;){var i=e[n];if(tt(i[0],this,l))return tt(i[1],this,l)}})},Dl.conforms=function(e){return function(e){var t=Sr(e);return function(l){return ql(l,e,t)}}(Vl(e,1))},Dl.constant=$r,Dl.countBy=ia,Dl.create=function(e,t){var l=Nl(e);return null==t?l:Yl(l,t)},Dl.curry=function e(t,l,n){var i=Fi(t,8,void 0,void 0,void 0,void 0,void 0,l=n?void 0:l);return i.placeholder=e.placeholder,i},Dl.curryRight=function e(t,l,n){var i=Fi(t,16,void 0,void 0,void 0,void 0,void 0,l=n?void 0:l);return i.placeholder=e.placeholder,i},Dl.debounce=Sa,Dl.defaults=pr,Dl.defaultsDeep=mr,Dl.defer=ha,Dl.delay=ba,Dl.difference=Io,Dl.differenceBy=Lo,Dl.differenceWith=Bo,Dl.drop=function(e,t,l){var n=null==e?0:e.length;return n?$n(e,(t=l||void 0===t?1:nr(t))<0?0:t,n):[]},Dl.dropRight=function(e,t,l){var n=null==e?0:e.length;return n?$n(e,0,(t=n-(t=l||void 0===t?1:nr(t)))<0?0:t):[]},Dl.dropRightWhile=function(e,t){return e&&e.length?Qn(e,Vi(t,3),!0,!0):[]},Dl.dropWhile=function(e,t){return e&&e.length?Qn(e,Vi(t,3),!0):[]},Dl.fill=function(e,t,l,n){var i=null==e?0:e.length;return i?(l&&"number"!=typeof l&&oo(e,t,l)&&(l=0,n=i),function(e,t,l,n){var i=e.length;for((l=nr(l))<0&&(l=-l>i?0:i+l),(n=void 0===n||n>i?i:nr(n))<0&&(n+=i),n=l>n?0:ir(n);l<n;)e[l++]=t;return e}(e,t,l,n)):[]},Dl.filter=function(e,t){return(Ra(e)?at:ln)(e,Vi(t,3))},Dl.flatMap=function(e,t){return nn(va(e,t),1)},Dl.flatMapDeep=function(e,t){return nn(va(e,t),1/0)},Dl.flatMapDepth=function(e,t,l){return l=void 0===l?1:nr(l),nn(va(e,t),l)},Dl.flatten=wo,Dl.flattenDeep=function(e){return null!=e&&e.length?nn(e,1/0):[]},Dl.flattenDepth=function(e,t){return null!=e&&e.length?nn(e,t=void 0===t?1:nr(t)):[]},Dl.flip=function(e){return Fi(e,512)},Dl.flow=Yr,Dl.flowRight=zr,Dl.fromPairs=function(e){for(var t=-1,l=null==e?0:e.length,n={};++t<l;){var i=e[t];n[i[0]]=i[1]}return n},Dl.functions=function(e){return null==e?[]:dn(e,Sr(e))},Dl.functionsIn=function(e){return null==e?[]:dn(e,hr(e))},Dl.groupBy=da,Dl.initial=function(e){return null!=e&&e.length?$n(e,0,-1):[]},Dl.intersection=Mo,Dl.intersectionBy=Fo,Dl.intersectionWith=ko,Dl.invert=_r,Dl.invertBy=gr,Dl.invokeMap=sa,Dl.iteratee=Kr,Dl.keyBy=ca,Dl.keys=Sr,Dl.keysIn=hr,Dl.map=va,Dl.mapKeys=function(e,t){var l={};return t=Vi(t,3),rn(e,function(e,n,i){zl(l,t(e,n,i),e)}),l},Dl.mapValues=function(e,t){var l={};return t=Vi(t,3),rn(e,function(e,n,i){zl(l,n,t(e,n,i))}),l},Dl.matches=function(e){return Dn(Vl(e,1))},Dl.matchesProperty=function(e,t){return Nn(e,Vl(t,1))},Dl.memoize=ya,Dl.merge=br,Dl.mergeWith=yr,Dl.method=Vr,Dl.methodOf=qr,Dl.mixin=Xr,Dl.negate=Ca,Dl.nthArg=function(e){return e=nr(e),Mn(function(t){return In(t,e)})},Dl.omit=Cr,Dl.omitBy=function(e,t){return Dr(e,Ca(Vi(t)))},Dl.once=function(e){return _a(2,e)},Dl.orderBy=function(e,t,l,n){return null==e?[]:(Ra(t)||(t=null==t?[]:[t]),Ra(l=n?void 0:l)||(l=null==l?[]:[l]),Ln(e,t,l))},Dl.over=Zr,Dl.overArgs=Ta,Dl.overEvery=Qr,Dl.overSome=eu,Dl.partial=Da,Dl.partialRight=Na,Dl.partition=pa,Dl.pick=Tr,Dl.pickBy=Dr,Dl.property=tu,Dl.propertyOf=function(e){return function(t){return null==e?void 0:sn(e,t)}},Dl.pull=Ho,Dl.pullAll=Wo,Dl.pullAllBy=function(e,t,l){return e&&e.length&&t&&t.length?On(e,t,Vi(l,2)):e},Dl.pullAllWith=function(e,t,l){return e&&e.length&&t&&t.length?On(e,t,void 0,l):e},Dl.pullAt=jo,Dl.range=lu,Dl.rangeRight=nu,Dl.rearg=Pa,Dl.reject=function(e,t){return(Ra(e)?at:ln)(e,Ca(Vi(t,3)))},Dl.remove=function(e,t){var l=[];if(!e||!e.length)return l;var n=-1,i=[],o=e.length;for(t=Vi(t,3);++n<o;){var a=e[n];t(a,n,e)&&(l.push(a),i.push(n))}return Rn(e,i),l},Dl.rest=function(e,t){if("function"!=typeof e)throw new fe(l);return Mn(e,t=void 0===t?t:nr(t))},Dl.reverse=$o,Dl.sampleSize=function(e,t,l){return t=(l?oo(e,t,l):void 0===t)?1:nr(t),(Ra(e)?kl:kn)(e,t)},Dl.set=function(e,t,l){return null==e?e:Un(e,t,l)},Dl.setWith=function(e,t,l,n){return n="function"==typeof n?n:void 0,null==e?e:Un(e,t,l,n)},Dl.shuffle=function(e){return(Ra(e)?Ul:jn)(e)},Dl.slice=function(e,t,l){var n=null==e?0:e.length;return n?(l&&"number"!=typeof l&&oo(e,t,l)?(t=0,l=n):(t=null==t?0:nr(t),l=void 0===l?n:nr(l)),$n(e,t,l)):[]},Dl.sortBy=ma,Dl.sortedUniq=function(e){return e&&e.length?Kn(e):[]},Dl.sortedUniqBy=function(e,t){return e&&e.length?Kn(e,Vi(t,2)):[]},Dl.split=function(e,t,l){return l&&"number"!=typeof l&&oo(e,t,l)&&(t=l=void 0),(l=void 0===l?4294967295:l>>>0)?(e=rr(e))&&("string"==typeof t||null!=t&&!Va(t))&&!(t=qn(t))&&Mt(e)?ri($t(e),0,l):e.split(t,l):[]},Dl.spread=function(e,t){if("function"!=typeof e)throw new fe(l);return t=null==t?0:il(nr(t),0),Mn(function(l){var n=l[t],i=ri(l,0,t);return n&&st(i,n),tt(e,this,i)})},Dl.tail=function(e){var t=null==e?0:e.length;return t?$n(e,1,t):[]},Dl.take=function(e,t,l){return e&&e.length?$n(e,0,(t=l||void 0===t?1:nr(t))<0?0:t):[]},Dl.takeRight=function(e,t,l){var n=null==e?0:e.length;return n?$n(e,(t=n-(t=l||void 0===t?1:nr(t)))<0?0:t,n):[]},Dl.takeRightWhile=function(e,t){return e&&e.length?Qn(e,Vi(t,3),!1,!0):[]},Dl.takeWhile=function(e,t){return e&&e.length?Qn(e,Vi(t,3)):[]},Dl.tap=function(e,t){return t(e),e},Dl.throttle=function(e,t,n){var i=!0,o=!0;if("function"!=typeof e)throw new fe(l);return $a(n)&&(i="leading"in n?!!n.leading:i,o="trailing"in n?!!n.trailing:o),Sa(e,t,{leading:i,maxWait:t,trailing:o})},Dl.thru=la,Dl.toArray=tr,Dl.toPairs=Nr,Dl.toPairsIn=Pr,Dl.toPath=function(e){return Ra(e)?dt(e,Do):Ja(e)?[e]:Ei(To(rr(e)))},Dl.toPlainObject=ar,Dl.transform=function(e,t,l){var n=Ra(e),i=n||Fa(e)||Za(e);if(t=Vi(t,4),null==l){var o=e&&e.constructor;l=i?n?new o:[]:$a(e)&&Ha(o)?Nl(je(e)):{}}return(i?nt:rn)(e,function(e,n,i){return t(l,e,n,i)}),l},Dl.unary=function(e){return fa(e,1)},Dl.union=Yo,Dl.unionBy=zo,Dl.unionWith=Go,Dl.uniq=function(e){return e&&e.length?Xn(e):[]},Dl.uniqBy=function(e,t){return e&&e.length?Xn(e,Vi(t,2)):[]},Dl.uniqWith=function(e,t){return t="function"==typeof t?t:void 0,e&&e.length?Xn(e,void 0,t):[]},Dl.unset=function(e,t){return null==e||Jn(e,t)},Dl.unzip=Ko,Dl.unzipWith=Vo,Dl.update=function(e,t,l){return null==e?e:Zn(e,t,ii(l))},Dl.updateWith=function(e,t,l,n){return n="function"==typeof n?n:void 0,null==e?e:Zn(e,t,ii(l),n)},Dl.values=Ir,Dl.valuesIn=function(e){return null==e?[]:Pt(e,hr(e))},Dl.without=qo,Dl.words=Hr,Dl.wrap=function(e,t){return Da(ii(t),e)},Dl.xor=Xo,Dl.xorBy=Jo,Dl.xorWith=Zo,Dl.zip=Qo,Dl.zipObject=function(e,t){return li(e||[],t||[],Wl)},Dl.zipObjectDeep=function(e,t){return li(e||[],t||[],Un)},Dl.zipWith=ea,Dl.entries=Nr,Dl.entriesIn=Pr,Dl.extend=dr,Dl.extendWith=sr,Xr(Dl,Dl),Dl.add=ru,Dl.attempt=Wr,Dl.camelCase=Lr,Dl.capitalize=Br,Dl.ceil=uu,Dl.clamp=function(e,t,l){return void 0===l&&(l=t,t=void 0),void 0!==l&&(l=(l=or(l))==l?l:0),void 0!==t&&(t=(t=or(t))==t?t:0),Kl(or(e),t,l)},Dl.clone=function(e){return Vl(e,4)},Dl.cloneDeep=function(e){return Vl(e,5)},Dl.cloneDeepWith=function(e,t){return Vl(e,5,t="function"==typeof t?t:void 0)},Dl.cloneWith=function(e,t){return Vl(e,4,t="function"==typeof t?t:void 0)},Dl.conformsTo=function(e,t){return null==t||ql(e,t,Sr(t))},Dl.deburr=Or,Dl.defaultTo=function(e,t){return null==e||e!=e?t:e},Dl.divide=du,Dl.endsWith=function(e,t,l){e=rr(e),t=qn(t);var n=e.length,i=l=void 0===l?n:Kl(nr(l),0,n);return(l-=t.length)>=0&&e.slice(l,i)==t},Dl.eq=Ia,Dl.escape=function(e){return(e=rr(e))&&F.test(e)?e.replace(x,wt):e},Dl.escapeRegExp=function(e){return(e=rr(e))&&z.test(e)?e.replace(Y,"\\$&"):e},Dl.every=function(e,t,l){var n=Ra(e)?ot:en;return l&&oo(e,t,l)&&(t=void 0),n(e,Vi(t,3))},Dl.find=oa,Dl.findIndex=Oo,Dl.findKey=function(e,t){return Et(e,Vi(t,3),rn)},Dl.findLast=aa,Dl.findLastIndex=Ro,Dl.findLastKey=function(e,t){return Et(e,Vi(t,3),un)},Dl.floor=su,Dl.forEach=ra,Dl.forEachRight=ua,Dl.forIn=function(e,t){return null==e?e:on(e,Vi(t,3),hr)},Dl.forInRight=function(e,t){return null==e?e:an(e,Vi(t,3),hr)},Dl.forOwn=function(e,t){return e&&rn(e,Vi(t,3))},Dl.forOwnRight=function(e,t){return e&&un(e,Vi(t,3))},Dl.get=Er,Dl.gt=La,Dl.gte=Ba,Dl.has=function(e,t){return null!=e&&to(e,t,mn)},Dl.hasIn=fr,Dl.head=xo,Dl.identity=Gr,Dl.includes=function(e,t,l,n){e=xa(e)?e:Ir(e),l=l&&!n?nr(l):0;var i=e.length;return l<0&&(l=il(i+l,0)),Xa(e)?l<=i&&e.indexOf(t,l)>-1:!!i&&_t(e,t,l)>-1},Dl.indexOf=function(e,t,l){var n=null==e?0:e.length;if(!n)return-1;var i=null==l?0:nr(l);return i<0&&(i=il(n+i,0)),_t(e,t,i)},Dl.inRange=function(e,t,l){return t=lr(t),void 0===l?(l=t,t=0):l=lr(l),function(e,t,l){return e>=ol(t,l)&&e<il(t,l)}(e=or(e),t,l)},Dl.invoke=Ar,Dl.isArguments=Oa,Dl.isArray=Ra,Dl.isArrayBuffer=wa,Dl.isArrayLike=xa,Dl.isArrayLikeObject=Ma,Dl.isBoolean=function(e){return!0===e||!1===e||Ya(e)&&vn(e)==r},Dl.isBuffer=Fa,Dl.isDate=ka,Dl.isElement=function(e){return Ya(e)&&1===e.nodeType&&!Ka(e)},Dl.isEmpty=function(e){if(null==e)return!0;if(xa(e)&&(Ra(e)||"string"==typeof e||"function"==typeof e.splice||Fa(e)||Za(e)||Oa(e)))return!e.length;var t=eo(e);if(t==v||t==f)return!e.size;if(so(e))return!yn(e).length;for(var l in e)if(he.call(e,l))return!1;return!0},Dl.isEqual=function(e,t){return An(e,t)},Dl.isEqualWith=function(e,t,l){var n=(l="function"==typeof l?l:void 0)?l(e,t):void 0;return void 0===n?An(e,t,void 0,l):!!n},Dl.isError=Ua,Dl.isFinite=function(e){return"number"==typeof e&&tl(e)},Dl.isFunction=Ha,Dl.isInteger=Wa,Dl.isLength=ja,Dl.isMap=za,Dl.isMatch=function(e,t){return e===t||Sn(e,t,Xi(t))},Dl.isMatchWith=function(e,t,l){return l="function"==typeof l?l:void 0,Sn(e,t,Xi(t),l)},Dl.isNaN=function(e){return Ga(e)&&e!=+e},Dl.isNative=function(e){if(uo(e))throw new se("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return hn(e)},Dl.isNil=function(e){return null==e},Dl.isNull=function(e){return null===e},Dl.isNumber=Ga,Dl.isObject=$a,Dl.isObjectLike=Ya,Dl.isPlainObject=Ka,Dl.isRegExp=Va,Dl.isSafeInteger=function(e){return Wa(e)&&e>=-9007199254740991&&e<=9007199254740991},Dl.isSet=qa,Dl.isString=Xa,Dl.isSymbol=Ja,Dl.isTypedArray=Za,Dl.isUndefined=function(e){return void 0===e},Dl.isWeakMap=function(e){return Ya(e)&&eo(e)==S},Dl.isWeakSet=function(e){return Ya(e)&&"[object WeakSet]"==vn(e)},Dl.join=function(e,t){return null==e?"":ll.call(e,t)},Dl.kebabCase=Rr,Dl.last=Uo,Dl.lastIndexOf=function(e,t,l){var n=null==e?0:e.length;if(!n)return-1;var i=n;return void 0!==l&&(i=(i=nr(l))<0?il(n+i,0):ol(i,n-1)),t==t?function(e,t,l){for(var n=l+1;n--;)if(e[n]===t)return n;return n}(e,t,i):ft(e,At,i,!0)},Dl.lowerCase=wr,Dl.lowerFirst=xr,Dl.lt=Qa,Dl.lte=er,Dl.max=function(e){return e&&e.length?tn(e,Gr,pn):void 0},Dl.maxBy=function(e,t){return e&&e.length?tn(e,Vi(t,2),pn):void 0},Dl.mean=function(e){return St(e,Gr)},Dl.meanBy=function(e,t){return St(e,Vi(t,2))},Dl.min=function(e){return e&&e.length?tn(e,Gr,Cn):void 0},Dl.minBy=function(e,t){return e&&e.length?tn(e,Vi(t,2),Cn):void 0},Dl.stubArray=iu,Dl.stubFalse=ou,Dl.stubObject=function(){return{}},Dl.stubString=function(){return""},Dl.stubTrue=function(){return!0},Dl.multiply=cu,Dl.nth=function(e,t){return e&&e.length?In(e,nr(t)):void 0},Dl.noConflict=function(){return $e._===this&&($e._=De),this},Dl.noop=Jr,Dl.now=Ea,Dl.pad=function(e,t,l){e=rr(e);var n=(t=nr(t))?jt(e):0;if(!t||n>=t)return e;var i=(t-n)/2;return Li(Zt(i),l)+e+Li(Jt(i),l)},Dl.padEnd=function(e,t,l){e=rr(e);var n=(t=nr(t))?jt(e):0;return t&&n<t?e+Li(t-n,l):e},Dl.padStart=function(e,t,l){e=rr(e);var n=(t=nr(t))?jt(e):0;return t&&n<t?Li(t-n,l)+e:e},Dl.parseInt=function(e,t,l){return l||null==t?t=0:t&&(t=+t),rl(rr(e).replace(G,""),t||0)},Dl.random=function(e,t,l){if(l&&"boolean"!=typeof l&&oo(e,t,l)&&(t=l=void 0),void 0===l&&("boolean"==typeof t?(l=t,t=void 0):"boolean"==typeof e&&(l=e,e=void 0)),void 0===e&&void 0===t?(e=0,t=1):(e=lr(e),void 0===t?(t=e,e=0):t=lr(t)),e>t){var n=e;e=t,t=n}if(l||e%1||t%1){var i=ul();return ol(e+i*(t-e+Ue("1e-"+((i+"").length-1))),t)}return wn(e,t)},Dl.reduce=function(e,t,l){var n=Ra(e)?ct:yt,i=arguments.length<3;return n(e,Vi(t,4),l,i,Zl)},Dl.reduceRight=function(e,t,l){var n=Ra(e)?vt:yt,i=arguments.length<3;return n(e,Vi(t,4),l,i,Ql)},Dl.repeat=function(e,t,l){return t=(l?oo(e,t,l):void 0===t)?1:nr(t),xn(rr(e),t)},Dl.replace=function(){var e=arguments,t=rr(e[0]);return e.length<3?t:t.replace(e[1],e[2])},Dl.result=function(e,t,l){var n=-1,i=(t=oi(t,e)).length;for(i||(i=1,e=void 0);++n<i;){var o=null==e?void 0:e[Do(t[n])];void 0===o&&(n=i,o=l),e=Ha(o)?o.call(e):o}return e},Dl.round=vu,Dl.runInContext=e,Dl.sample=function(e){return(Ra(e)?Fl:Fn)(e)},Dl.size=function(e){if(null==e)return 0;if(xa(e))return Xa(e)?jt(e):e.length;var t=eo(e);return t==v||t==f?e.size:yn(e).length},Dl.snakeCase=Mr,Dl.some=function(e,t,l){var n=Ra(e)?pt:Yn;return l&&oo(e,t,l)&&(t=void 0),n(e,Vi(t,3))},Dl.sortedIndex=function(e,t){return zn(e,t)},Dl.sortedIndexBy=function(e,t,l){return Gn(e,t,Vi(l,2))},Dl.sortedIndexOf=function(e,t){var l=null==e?0:e.length;if(l){var n=zn(e,t);if(n<l&&Ia(e[n],t))return n}return-1},Dl.sortedLastIndex=function(e,t){return zn(e,t,!0)},Dl.sortedLastIndexBy=function(e,t,l){return Gn(e,t,Vi(l,2),!0)},Dl.sortedLastIndexOf=function(e,t){if(null!=e&&e.length){var l=zn(e,t,!0)-1;if(Ia(e[l],t))return l}return-1},Dl.startCase=Fr,Dl.startsWith=function(e,t,l){return e=rr(e),l=null==l?0:Kl(nr(l),0,e.length),t=qn(t),e.slice(l,l+t.length)==t},Dl.subtract=pu,Dl.sum=function(e){return e&&e.length?Ct(e,Gr):0},Dl.sumBy=function(e,t){return e&&e.length?Ct(e,Vi(t,2)):0},Dl.template=function(e,t,l){var n=Dl.templateSettings;l&&oo(e,t,l)&&(t=void 0),e=rr(e),t=sr({},t,n,ki);var i,o,a=sr({},t.imports,n.imports,ki),r=Sr(a),u=Pt(a,r),d=0,s=t.interpolate||ue,c="__p += '",v=me((t.escape||ue).source+"|"+s.source+"|"+(s===H?ee:ue).source+"|"+(t.evaluate||ue).source+"|$","g"),p="//# sourceURL="+(he.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++xe+"]")+"\n";e.replace(v,function(t,l,n,a,r,u){return n||(n=a),c+=e.slice(d,u).replace(de,xt),l&&(i=!0,c+="' +\n__e("+l+") +\n'"),r&&(o=!0,c+="';\n"+r+";\n__p += '"),n&&(c+="' +\n((__t = ("+n+")) == null ? '' : __t) +\n'"),d=u+t.length,t}),c+="';\n";var m=he.call(t,"variable")&&t.variable;if(m){if(Z.test(m))throw new se("Invalid `variable` option passed into `_.template`")}else c="with (obj) {\n"+c+"\n}\n";c=(o?c.replace(B,""):c).replace(O,"$1").replace(R,"$1;"),c="function("+(m||"obj")+") {\n"+(m?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(i?", __e = _.escape":"")+(o?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+c+"return __p\n}";var E=Wr(function(){return ce(r,p+"return "+c).apply(void 0,u)});if(E.source=c,Ua(E))throw E;return E},Dl.times=function(e,t){if((e=nr(e))<1||e>9007199254740991)return[];var l=4294967295,n=ol(e,4294967295);e-=4294967295;for(var i=Tt(n,t=Vi(t));++l<e;)t(l);return i},Dl.toFinite=lr,Dl.toInteger=nr,Dl.toLength=ir,Dl.toLower=function(e){return rr(e).toLowerCase()},Dl.toNumber=or,Dl.toSafeInteger=function(e){return e?Kl(nr(e),-9007199254740991,9007199254740991):0===e?e:0},Dl.toString=rr,Dl.toUpper=function(e){return rr(e).toUpperCase()},Dl.trim=function(e,t,l){if((e=rr(e))&&(l||void 0===t))return Dt(e);if(!e||!(t=qn(t)))return e;var n=$t(e),i=$t(t);return ri(n,Lt(n,i),Bt(n,i)+1).join("")},Dl.trimEnd=function(e,t,l){if((e=rr(e))&&(l||void 0===t))return e.slice(0,Yt(e)+1);if(!e||!(t=qn(t)))return e;var n=$t(e);return ri(n,0,Bt(n,$t(t))+1).join("")},Dl.trimStart=function(e,t,l){if((e=rr(e))&&(l||void 0===t))return e.replace(G,"");if(!e||!(t=qn(t)))return e;var n=$t(e);return ri(n,Lt(n,$t(t))).join("")},Dl.truncate=function(e,t){var l=30,n="...";if($a(t)){var i="separator"in t?t.separator:i;l="length"in t?nr(t.length):l,n="omission"in t?qn(t.omission):n}var o=(e=rr(e)).length;if(Mt(e)){var a=$t(e);o=a.length}if(l>=o)return e;var r=l-jt(n);if(r<1)return n;var u=a?ri(a,0,r).join(""):e.slice(0,r);if(void 0===i)return u+n;if(a&&(r+=u.length-r),Va(i)){if(e.slice(r).search(i)){var d,s=u;for(i.global||(i=me(i.source,rr(te.exec(i))+"g")),i.lastIndex=0;d=i.exec(s);)var c=d.index;u=u.slice(0,void 0===c?r:c)}}else if(e.indexOf(qn(i),r)!=r){var v=u.lastIndexOf(i);v>-1&&(u=u.slice(0,v))}return u+n},Dl.unescape=function(e){return(e=rr(e))&&M.test(e)?e.replace(w,zt):e},Dl.uniqueId=function(e){var t=++be;return rr(e)+t},Dl.upperCase=kr,Dl.upperFirst=Ur,Dl.each=ra,Dl.eachRight=ua,Dl.first=xo,Xr(Dl,(au={},rn(Dl,function(e,t){he.call(Dl.prototype,t)||(au[t]=e)}),au),{chain:!1}),Dl.VERSION="4.17.21",nt(["bind","bindKey","curry","curryRight","partial","partialRight"],function(e){Dl[e].placeholder=Dl}),nt(["drop","take"],function(e,t){Ll.prototype[e]=function(l){l=void 0===l?1:il(nr(l),0);var n=this.__filtered__&&!t?new Ll(this):this.clone();return n.__filtered__?n.__takeCount__=ol(l,n.__takeCount__):n.__views__.push({size:ol(l,4294967295),type:e+(n.__dir__<0?"Right":"")}),n},Ll.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}}),nt(["filter","map","takeWhile"],function(e,t){var l=t+1,n=1==l||3==l;Ll.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:Vi(e,3),type:l}),t.__filtered__=t.__filtered__||n,t}}),nt(["head","last"],function(e,t){var l="take"+(t?"Right":"");Ll.prototype[e]=function(){return this[l](1).value()[0]}}),nt(["initial","tail"],function(e,t){var l="drop"+(t?"":"Right");Ll.prototype[e]=function(){return this.__filtered__?new Ll(this):this[l](1)}}),Ll.prototype.compact=function(){return this.filter(Gr)},Ll.prototype.find=function(e){return this.filter(e).head()},Ll.prototype.findLast=function(e){return this.reverse().find(e)},Ll.prototype.invokeMap=Mn(function(e,t){return"function"==typeof e?new Ll(this):this.map(function(l){return _n(l,e,t)})}),Ll.prototype.reject=function(e){return this.filter(Ca(Vi(e)))},Ll.prototype.slice=function(e,t){e=nr(e);var l=this;return l.__filtered__&&(e>0||t<0)?new Ll(l):(e<0?l=l.takeRight(-e):e&&(l=l.drop(e)),void 0!==t&&(l=(t=nr(t))<0?l.dropRight(-t):l.take(t-e)),l)},Ll.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},Ll.prototype.toArray=function(){return this.take(4294967295)},rn(Ll.prototype,function(e,t){var l=/^(?:filter|find|map|reject)|While$/.test(t),n=/^(?:head|last)$/.test(t),i=Dl[n?"take"+("last"==t?"Right":""):t],o=n||/^find/.test(t);i&&(Dl.prototype[t]=function(){var t=this.__wrapped__,a=n?[1]:arguments,r=t instanceof Ll,u=a[0],d=r||Ra(t),s=function(e){var t=i.apply(Dl,st([e],a));return n&&c?t[0]:t};d&&l&&"function"==typeof u&&1!=u.length&&(r=d=!1);var c=this.__chain__,v=!!this.__actions__.length,p=o&&!c,m=r&&!v;if(!o&&d){t=m?t:new Ll(this);var E=e.apply(t,a);return E.__actions__.push({func:la,args:[s],thisArg:void 0}),new Il(E,c)}return p&&m?e.apply(this,a):(E=this.thru(s),p?n?E.value()[0]:E.value():E)})}),nt(["pop","push","shift","sort","splice","unshift"],function(e){var t=_e[e],l=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",n=/^(?:pop|shift)$/.test(e);Dl.prototype[e]=function(){var e=arguments;if(n&&!this.__chain__){var i=this.value();return t.apply(Ra(i)?i:[],e)}return this[l](function(l){return t.apply(Ra(l)?l:[],e)})}}),rn(Ll.prototype,function(e,t){var l=Dl[t];if(l){var n=l.name+"";he.call(_l,n)||(_l[n]=[]),_l[n].push({name:t,func:l})}}),_l[Di(void 0,2).name]=[{name:"wrapper",func:void 0}],Ll.prototype.clone=function(){var e=new Ll(this.__wrapped__);return e.__actions__=Ei(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=Ei(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=Ei(this.__views__),e},Ll.prototype.reverse=function(){if(this.__filtered__){var e=new Ll(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},Ll.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,l=Ra(e),n=t<0,i=l?e.length:0,o=function(e,t,l){for(var n=-1,i=l.length;++n<i;){var o=l[n],a=o.size;switch(o.type){case"drop":e+=a;break;case"dropRight":t-=a;break;case"take":t=ol(t,e+a);break;case"takeRight":e=il(e,t-a)}}return{start:e,end:t}}(0,i,this.__views__),a=o.start,r=o.end,u=r-a,d=n?r:a-1,s=this.__iteratees__,c=s.length,v=0,p=ol(u,this.__takeCount__);if(!l||!n&&i==u&&p==u)return ei(e,this.__actions__);var m=[];e:for(;u--&&v<p;){for(var E=-1,f=e[d+=t];++E<c;){var _=s[E],g=_.type,A=(0,_.iteratee)(f);if(2==g)f=A;else if(!A){if(1==g)continue e;break e}}m[v++]=f}return m},Dl.prototype.at=na,Dl.prototype.chain=function(){return ta(this)},Dl.prototype.commit=function(){return new Il(this.value(),this.__chain__)},Dl.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__++]}},Dl.prototype.plant=function(e){for(var t,l=this;l instanceof Pl;){var n=Po(l);n.__index__=0,n.__values__=void 0,t?i.__wrapped__=n:t=n;var i=n;l=l.__wrapped__}return i.__wrapped__=e,t},Dl.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof Ll){var t=e;return this.__actions__.length&&(t=new Ll(this)),(t=t.reverse()).__actions__.push({func:la,args:[$o],thisArg:void 0}),new Il(t,this.__chain__)}return this.thru($o)},Dl.prototype.toJSON=Dl.prototype.valueOf=Dl.prototype.value=function(){return ei(this.__wrapped__,this.__actions__)},Dl.prototype.first=Dl.prototype.head,mt&&(Dl.prototype[mt]=function(){return this}),Dl}();ze?((ze.exports=Gt)._=Gt,Ye._=Gt):$e._=Gt}).call(A)});const Dn=e=>{var n,a;let{t:r,config:u,formData:d,setError:s,clearErrors:c,formState:v,index:p,setFieldReports:m,documentList:E}=e;Digit.ULBService.getCurrentTenantId();const f=Digit.ULBService.getStateId(),[_,g]=t.useState((null==d||null===(n=d.FeildReports)||void 0===n||null===(a=n[p])||void 0===a?void 0:a.Documents)||[]),[A,S]=t.useState(null),[h,b]=t.useState((null==d?void 0:d.tradedetils1)||[]);let y="create";const{pathname:C}=i.useLocation();C.includes("/modify-application/")&&(y="update");const{isLoading:T}=Digit.Hooks.pt.usePropertyMDMS(f,"TradeLicense",["documentObj"]);window.location.href.includes("renew-application-details");let D=[];return E&&E.map(e=>{D.push({documentType:e.code,code:e.code})}),t.useEffect(()=>{(()=>{let e=d;e&&null!=e&&e.FieldReports&&(null==e?void 0:e.FieldReports.length)>0&&(null==_?void 0:_.length)>0&&(e.FieldReports[p]={...e.FieldReports[p],Documents:_}),e&&null!=e&&e.FieldReports&&(null==e?void 0:e.FieldReports.length)>0&&_.length>0&&m(e.FieldReports)})()},[_]),T?l.createElement(o.Loader,null):l.createElement("div",null,null==D?void 0:D.map((e,t)=>l.createElement("div",null,l.createElement(Nn,{key:t,document:e,action:y,t:r,id:"obps-doc-"+t,error:A,setError:S,setDocuments:g,documents:_,formData:d,setFormError:s,clearFormErrors:c,config:u,formState:v,stateId:f}))),A&&l.createElement(o.Toast,{label:A,onClose:()=>S(null),error:!0}))};function Nn(e){let{t:n,document:i,setDocuments:a,documents:r,formData:u,setFormError:d,clearFormErrors:s,config:c,formState:v,stateId:p={stateId:p}}=e;const m=null==r?void 0:r.filter(e=>null==e?void 0:e.documentType),E=Digit.ULBService.getCurrentTenantId(),[f,_]=t.useState(""),[g,A]=t.useState(null),[S,h]=t.useState(()=>(null==m?void 0:m.fileStoreId)||null),[b,y]=t.useState(!1),[C,T]=t.useState([]),D=()=>{var e,t;let l=null===(e=v.errors)||void 0===e||null===(t=e[c.key])||void 0===t?void 0:t.type;Array.isArray(l)||(l=[]),l.includes(null==i?void 0:i.documentType)&&(l=l.filter(e=>e!=(null==i?void 0:i.documentType)),l.length?d(c.key,{type:l}):s(c.key))};return t.useEffect(()=>{null==f||!f.documentType||0!=r.filter(e=>e.documentType===(null==f?void 0:f.documentType)).length&&C.filter(e=>{var t;return(null==e||null===(t=e.file)||void 0===t?void 0:t.documentType)===(null==f?void 0:f.documentType)}).length===r.filter(e=>e.documentType===(null==f?void 0:f.documentType)).length||a(e=>{if(0===(null==S?void 0:S.length)||null===S)return e;const t=null==e?void 0:e.filter(e=>(null==e?void 0:e.fileStoreId)!==S),l=null==e?void 0:e.filter(e=>(null==e?void 0:e.documentType)!==(null==f?void 0:f.documentType));if(null!=f&&f.id)return[...t,{documentType:null==f?void 0:f.documentType,fileStoreId:S,tenantId:E,id:null==f?void 0:f.id}];{let e=[];return C.map(t=>{var l,n;e.push({documentType:null==f?void 0:f.documentType,fileStoreId:null==t||null===(l=t.fileStoreId)||void 0===l?void 0:l.fileStoreId,tenantId:null==t||null===(n=t.fileStoreId)||void 0===n?void 0:n.tenantId})}),[...l,...e]}}),b?b&&D():window.location.href.includes("renew-application-details")||(S&&null!=f&&f.documentType?S&&null!=f&&f.documentType&&D():(()=>{var e,t;let l=null===(e=v.errors)||void 0===e||null===(t=e[c.key])||void 0===t?void 0:t.type;Array.isArray(l)||(l=[]),l.includes(i.documentType)||(l.push(i.documentType),d(c.key,{type:l}))})())},[S,f,b]),t.useEffect(()=>{var e,t;if(i&&(null==u||null===(e=u.documents)||void 0===e||null===(t=e.documents)||void 0===t?void 0:t.length)>0)for(let e=0;e<(null==u||null===(l=u.documents)||void 0===l||null===(n=l.documents)||void 0===n?void 0:n.length);e++){var l,n,o,a,r,d,s,c,v,p,m,E,f,g;(null==i?void 0:i.documentType)===(null==u||null===(o=u.documents)||void 0===o||null===(a=o.documents)||void 0===a||null===(r=a[e])||void 0===r?void 0:r.documentType)&&(_({documentType:null==u||null===(d=u.documents)||void 0===d||null===(s=d.documents)||void 0===s||null===(c=s[e])||void 0===c?void 0:c.documentType,id:null==u||null===(v=u.documents)||void 0===v||null===(p=v.documents)||void 0===p||null===(m=p[e])||void 0===m?void 0:m.id}),h(null==u||null===(E=u.documents)||void 0===E||null===(f=E.documents)||void 0===f||null===(g=f[e])||void 0===g?void 0:g.fileStoreId))}},[i]),l.createElement("div",{style:{marginBottom:"24px"}},l.createElement(o.LabelFieldPair,{style:{width:"100%"}},l.createElement(o.CardLabel,{className:"card-label-smaller",style:{width:"100%"}},""+n(""+(null==i?void 0:i.documentType.replaceAll(".","_")))),l.createElement("div",{className:"field",style:{width:"100%"}},l.createElement(o.MultiUploadWrapper,{module:"BPA",tenantId:p,getFormState:e=>function(e,t){let l=Object.fromEntries(e),n=Object.values(l);T(n),r&&n&&r.filter(e=>e.documentType===t).length>n.length&&a(r.filter(e=>e.documentType!==t)),n&&n.map(e=>{e.file.documentType=t,function(e,t){var l;e&&_({documentType:t}),e&&A(e.file),e&&h(null==e||null===(l=e.fileStoreId)||void 0===l?void 0:l.fileStoreId)}(e,t)})}(e,null==i?void 0:i.documentType.replaceAll(".","_")),t:n,allowedFileTypesRegex:/(.*?)(jpg|jpeg|png|image|pdf)$/i,allowedMaxSizeInMB:5,acceptFiles:"image/*, .pdf, .png, .jpeg, .jpg"}))))}const Pn=()=>({InspectionDate:"",InspectionTime:"",Checklist:[],Documents:[],key:Date.now()}),In=e=>{var n;const{unit:i,index:r,allFieldReport:u,removeUnit:d,setFieldReports:s,t:c,formData:v,config:p,onSelect:m,userType:E,setError:f,clearErrors:_,formState:g,isErrors:A,setIsErrors:S,questionList:h,documentList:b}=e,{control:y,formState:C,watch:T,trigger:D,getValues:N}=a.useForm(),P=T(),{errors:I}=C,L=t.useMemo(()=>{var e;return null==v||null===(e=v.ownershipCategory)||void 0===e?void 0:e.code.includes("INDIVIDUAL")},[null==v||null===(n=v.ownershipCategory)||void 0===n?void 0:n.code]);t.useEffect(()=>{D()},[]),t.useEffect(()=>{const e=Object.keys(P),t={};e.forEach(e=>t[e]=i[e]);let l=L?{}:{ownerType:{code:"NONE"}},n=h?{questionLength:h.length}:{questionLength:0},o=h?{questionList:h}:{questionList:[]};Tn.isEqual(P,t)||(Object.keys(P).map(e=>{"key"==e||null==P[e]||""==P[e]||null==P[e]||A||S(!0)}),s(e=>e.map(e=>e.key&&e.key===i.key?{...e,...P,...l,...n,...o}:{...e})),D())},[P]),t.useEffect(()=>{var e;Object.keys(I).length&&!Tn.isEqual((null===(e=g.errors[p.key])||void 0===e?void 0:e.type)||{},I)?f(p.key,{type:I}):!Object.keys(I).length&&g.errors[p.key]&&A&&_(p.key)},[I]);let B=window.location.href.includes("renew-application-details");window.location.href.includes("edit-application-details")&&(B=!0);const O=e=>{let t=[];return e.split("/").map(e=>{t.push({i18nKey:"SCORE_"+e,code:e})}),t};return l.createElement(l.Fragment,null,l.createElement("div",{style:{marginBottom:"16px",maxWidth:"950px"}},l.createElement("div",{className:"fieldInspectionWrapper"},(null==u?void 0:u.length)>1?l.createElement(o.LinkButton,{label:l.createElement(o.DeleteIcon,{style:{float:"right",position:"relative",bottom:"-6px"},fill:1!=u.length?"#494848":"#FAFAFA"}),style:{width:"100px",display:"inline",background:"black"},onClick:e=>d(i)}):null,l.createElement(o.CardSectionHeader,null,(null==u?void 0:u.length)>1?`${c("BPA_FI_REPORT")}-${r+1}`:""+c("BPA_FI_REPORT")),l.createElement(o.LabelFieldPair,{style:{width:"100%"}},l.createElement(o.CardLabel,{style:{marginTop:"0px",width:"100%"},className:"card-label-smaller"},c("BPA_FI_DATE_LABEL")+" * "),l.createElement("div",{className:"field",style:{width:"100%"}},l.createElement(a.Controller,{name:"InspectionDate",rules:{required:c("REQUIRED_FIELD")},control:y,render:e=>l.createElement(o.DatePicker,{date:e.value,name:"InspectionDate",onChange:e.onChange})}))),l.createElement(o.LabelFieldPair,{style:{width:"100%"}},l.createElement(o.CardLabel,{style:{marginTop:"0px",width:"100%"},className:"card-label-smaller"},c("ES_COMMON_TIME")+" * "),l.createElement("div",{className:"field",style:{width:"100%"}},l.createElement(a.Controller,{name:"InspectionTime",rules:{required:c("REQUIRED_FIELD")},control:y,render:e=>l.createElement(o.TextInput,{name:"InspectionTime",type:"time",value:e.value,onChange:e.onChange})}))),l.createElement(o.CardSectionHeader,null,c("BPA_CHECK_LIST_DETAILS")),h&&h.map((e,t)=>l.createElement("div",{key:t,className:"fieldInsepctionInsideWrapper",style:{maxWidth:"100%"}},l.createElement(o.LabelFieldPair,{style:{width:"100%"}},l.createElement(o.CardLabel,{style:{marginRight:"30px",width:"100%"},className:"card-label-smaller"},""+c(e.question)),l.createElement("div",{className:"field",style:{width:"100%"}},l.createElement(a.Controller,{control:y,name:"question_"+t,render:n=>l.createElement(o.Dropdown,{className:"form-field",style:{width:"100%",maxWidth:"100%"},selected:N("question"+t),disable:!1,option:O(e.fieldType),select:e=>{var t;if((null==n||null===(t=n.value)||void 0===t?void 0:t.code)==(null==e?void 0:e.code))return!0;n.onChange(e)},optionKey:"i18nKey",onBlur:n.onBlur,t:c})}))),l.createElement(o.LabelFieldPair,{style:{width:"100%"}},l.createElement(o.CardLabel,{style:{marginRight:"30px",width:"100%"},className:"card-label-smaller"},c("BPA_ENTER_REMARKS")),l.createElement("div",{className:"field",style:{width:"100%"}},l.createElement(a.Controller,{control:y,name:"Remarks_"+t,defaultValue:null==i?void 0:i.uomValue,render:e=>l.createElement(o.TextInput,{value:N("Remarks"+t),onChange:t=>{e.onChange(t)},onBlur:e.onBlur})}))))),l.createElement(o.CardSectionHeader,{style:{marginTop:"20px"}},c("BPA_FIELD_INSPECTION_DOCUMENTS")),l.createElement(Dn,{t:c,config:p,onSelect:m,userType:E,formData:v,setError:f,clearErrors:_,formState:g,index:r,setFieldReports:s,documentList:b}))))},Ln=e=>l.createElement("h1",{className:"heading-m"},e.label),Bn=()=>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(Bn,null)),Rn=e=>{var n,i;let{t:a,action:r,tenantId:u,closeModal:d,submitAction:s,applicationData:v,businessService:p,moduleCode:m}=e;const{data:E,isLoading:f}=Digit.Hooks.useEmployeeSearch(u,{roles:null==r||null===(n=r.assigneeRoles)||void 0===n||null===(i=n.map)||void 0===i?void 0:i.call(n,e=>({code:e})),isActive:!0},{enabled:!(null!=r&&r.isTerminateState)}),{isLoading:_,data:g}=Digit.Hooks.pt.useMDMS(u,p,"FINANCIAL_YEARLS",{},{details:{tenantId:Digit.ULBService.getStateId(),moduleDetails:[{moduleName:"egf-master",masterDetails:[{name:"FinancialYear",filter:"[?(@.module == 'PT')]"}]}]}}),[A,S]=t.useState({}),[h,b]=t.useState({}),[y,C]=t.useState([]),[T,D]=t.useState(null),[N,P]=t.useState(null),[I,L]=t.useState(null),[B,O]=t.useState(null),[R,w]=t.useState([]),[x,M]=t.useState(null),[F,k]=t.useState(!1);function U(e){P(e.target.files[0])}return t.useEffect(()=>{var e;g&&g["egf-master"]&&w(null===(e=g["egf-master"])||void 0===e?void 0:e.FinancialYear)},[g]),t.useEffect(()=>{var e;C(null==E||null===(e=E.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[E]),t.useEffect(()=>{!function(){try{O(null);const e=function(){if(N){const e=function(){if(N.size>=5242880)O(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=c(function(){return Promise.resolve(Digit.UploadServices.Filestorage("PT",N,Digit.ULBService.getStateId())).then(function(e){var t,l,n,i;(null==e||null===(t=e.data)||void 0===t||null===(l=t.files)||void 0===l?void 0:l.length)>0?L(null==e||null===(n=e.data)||void 0===n||null===(i=n.files[0])||void 0===i?void 0:i.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)}}()},[N]),t.useEffect(()=>{r&&S(null!=r&&r.showFinancialYearsModal?(e=>{let{t:t,action:n,financialYears:i,selectedFinancialYear:a,setSelectedFinancialYear:r}=e;return{label:{heading:`WF_${n.action}_APPLICATION`,submit:"WF_PT.CREATE_"+n.action,cancel:"ES_PT_COMMON_CANCEL"},form:[{body:[{label:t("ES_PT_FINANCIAL_YEARS"),isMandatory:!0,type:"radio",populators:l.createElement(o.RadioButtons,{options:i,optionsKey:"name",onSelect:r,selectedOption:a})}]}]}})({t:a,action:r,financialYears:R,selectedFinancialYear:x,setSelectedFinancialYear:M}):(e=>{var t;let{t:n,action:i,approvers:a,selectedApprover:r,setSelectedApprover:u,selectFile:d,uploadedFile:s,setUploadedFile:c,assigneeLabel:v,businessService:p}=e;return{label:{heading:`WF_${null==i?void 0:i.action}_APPLICATION`,submit:`WF_${p}_${null==i?void 0:i.action}`,cancel:"ES_PT_COMMON_CANCEL"},form:[{body:[{label:i.isTerminateState||"SENDBACKTOCITIZEN"===(null==i?void 0:i.action)?null:n(v||"WF_ROLE_"+(null===(t=i.assigneeRoles)||void 0===t?void 0:t[0])),type:"dropdown",populators:i.isTerminateState||"SENDBACKTOCITIZEN"===(null==i?void 0:i.action)?null:l.createElement(o.Dropdown,{option:a,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:u,selected:r})},{label:n("ES_PT_ACTION_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:`${n("ES_PT_ATTACH_FILE")}${i.docUploadRequired?" *":""}`,populators:l.createElement(o.UploadFile,{id:"workflow-doc",onUpload:d,onDelete:()=>{c(null)},showHint:!0,hintText:n("PT_ATTACH_RESTRICTIONS_SIZE"),message:s?"1 "+n("ES_PT_ACTION_FILEUPLOADED"):n("ES_PT_ACTION_NO_FILEUPLOADED")})}]}]}})({t:a,action:r,approvers:y,selectedApprover:T,setSelectedApprover:D,selectFile:U,uploadedFile:I,setUploadedFile:L,businessService:p}))},[r,y,R,x,I]),r&&A.form?l.createElement(o.Modal,{headerBarMain:l.createElement(Ln,{label:a(A.label.heading)}),headerBarEnd:l.createElement(On,{onClick:d}),actionCancelLabel:a(A.label.cancel),actionCancelOnSubmit:d,actionSaveLabel:a(A.label.submit),actionSaveOnSubmit:()=>{},isDisabled:r.showFinancialYearsModal?!x:f||(null==r?void 0:r.docUploadRequired)&&!I,formId:"modal-action"},_?l.createElement(o.Loader,null):l.createElement(o.FormComposer,{config:A.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",s({customFunctionToExecute:null==r?void 0:r.customFunctionToExecute,Property:{...v,workflow:t}})}else if(null!=r&&r.showFinancialYearsModal)s({customFunctionToExecute:null==r?void 0:r.customFunctionToExecute,Assessment:{financialYear:null==x?void 0:x.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:p,moduleName:m};t.assignes=null!=r&&r.isTerminateState||!T?[]:[T],I&&(t.documents=[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==N?void 0:N.name,fileStoreId:I}]),s({Property:{...v,workflow:t}})}},defaultValues:h,formId:"modal-action"})):l.createElement(o.Loader,null)},wn=e=>l.createElement("h1",{className:"heading-m"},e.label),xn=()=>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"})),Mn=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(xn,null)),Fn=e=>{var n,i;let{t:a,action:r,tenantId:u,closeModal:d,submitAction:s,applicationData:v,businessService:p}=e;const{data:m}=Digit.Hooks.useEmployeeSearch(u,{roles:null==r||null===(n=r.assigneeRoles)||void 0===n||null===(i=n.map)||void 0===i?void 0:i.call(n,e=>({code:e})),isActive:!0},{enabled:!(null!=r&&r.isTerminateState)}),{isLoading:E,data:f}=Digit.Hooks.pt.useMDMS(u,p,"FINANCIAL_YEARLS",{},{details:{tenantId:Digit.ULBService.getStateId(),moduleDetails:[{moduleName:"egf-master",masterDetails:[{name:"FinancialYear",filter:"[?(@.module == 'TL')]"}]}]}}),[_,g]=t.useState({}),[A,S]=t.useState({}),[h,b]=t.useState([]),[y,C]=t.useState({}),[T,D]=t.useState(null),[N,P]=t.useState(null),[I,L]=t.useState(null),[B,O]=t.useState([]),[R,w]=t.useState(null);t.useEffect(()=>{var e;f&&f["egf-master"]&&O(null===(e=f["egf-master"])||void 0===e?void 0:e.FinancialYear)},[f]);const{data:x}=Digit.Hooks.useCustomMDMS(u,"common-masters",[{name:"Department"}]);function M(e){D(e.target.files[0])}return t.useEffect(()=>{if(m&&x){var e;const t=x["common-masters"].Department;b(null==m||null===(e=m.Employees)||void 0===e?void 0:e.map(e=>{var l,n,i;const o=null==e||null===(l=e.assignments)||void 0===l||null===(n=l[0])||void 0===n?void 0:n.department,a=null==t?void 0:t.find(e=>(null==e?void 0:e.code)===o);return console.log("matchedDept===",a),{uuid:null==e?void 0:e.uuid,name:`${null==e||null===(i=e.user)||void 0===i?void 0:i.name} - ${null==a?void 0:a.name}`}}))}},[m]),t.useEffect(()=>{!function(){try{L(null);const e=function(){if(T){const e=function(){if(T.size>=5242880)L(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=c(function(){return Promise.resolve(Digit.UploadServices.Filestorage("PT",T,Digit.ULBService.getStateId())).then(function(e){var t,l,n,i;(null==e||null===(t=e.data)||void 0===t||null===(l=t.files)||void 0===l?void 0:l.length)>0?P(null==e||null===(n=e.data)||void 0===n||null===(i=n.files[0])||void 0===i?void 0:i.fileStoreId):L(a("CS_FILE_UPLOAD_ERROR"))})},function(){L(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]),t.useEffect(()=>{r&&g((e=>{let{t:t,action:n,approvers:i,selectedApprover:a,setSelectedApprover:r,selectFile:u,uploadedFile:d,setUploadedFile:s,businessService:c}=e,v=!0;return"SENDBACKTOCITIZEN"!=(null==n?void 0:n.action)&&"APPROVE"!=(null==n?void 0:n.action)||(v=!1),n.isTerminateState&&(v=!1),{label:{heading:`WF_${null==n?void 0:n.action}_APPLICATION`,submit:`WF_${null==c?void 0:c.toUpperCase()}_${null==n?void 0:n.action}`,cancel:"WF_EMPLOYEE_NEWTL_CANCEL"},form:[{body:[{label:v?t("WF_ASSIGNEE_NAME_LABEL"):null,placeholder:v?t("WF_ASSIGNEE_NAME_PLACEHOLDER"):null,type:"dropdown",populators:v?l.createElement(o.Dropdown,{option:i,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:r,selected:a}):null},{label:t("WF_COMMON_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:t("TL_APPROVAL_CHECKLIST_BUTTON_UP_FILE"),populators:l.createElement(o.UploadFile,{id:"workflow-doc",onUpload:u,onDelete:()=>{s(null)},message:d?"1 "+t("ES_PT_ACTION_FILEUPLOADED"):t("CS_ACTION_NO_FILEUPLOADED")})}]}]}})({t:a,action:r,approvers:h,selectedApprover:y,setSelectedApprover:C,selectFile:M,uploadedFile:N,setUploadedFile:P,businessService:p}))},[r,h,B,R,N]),r&&_.form?l.createElement(o.Modal,{headerBarMain:l.createElement(wn,{label:a(_.label.heading)}),headerBarEnd:l.createElement(Mn,{onClick:d}),actionCancelLabel:a(_.label.cancel),actionCancelOnSubmit:d,actionSaveLabel:a(_.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},E?l.createElement(o.Loader,null):l.createElement(o.FormComposer,{config:_.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){v={...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:N?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==T?void 0:T.name,fileStoreId:N}]:null},s({Licenses:[v]})},defaultValues:A,formId:"modal-action"})):l.createElement(o.Loader,null)},kn=e=>l.createElement("h1",{style:{marginLeft:"22px"},className:"heading-m BPAheading-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"})),Hn=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(Un,null)),Wn=e=>{var n,i;let{t:a,action:r,tenantId:u,closeModal:d,submitAction:s,applicationData:v,businessService:p}=e;const{data:m,isLoading:E}=Digit.Hooks.useEmployeeSearch(u,{roles:null==r||null===(n=r.assigneeRoles)||void 0===n||null===(i=n.map)||void 0===i?void 0:i.call(n,e=>({code:e})),isActive:!0},{enabled:!(null!=r&&r.isTerminateState)}),[f,_]=t.useState({}),[g,A]=t.useState({}),[S,h]=t.useState([]),[b,y]=t.useState({}),[C,T]=t.useState(null),[D,N]=t.useState(null),[P,I]=t.useState(null),L=!!Digit.Utils.browser.isMobile();function B(e){T(e.target.files[0])}return t.useEffect(()=>{var e;h(null==m||null===(e=m.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[m]),t.useEffect(()=>{!function(){try{I(null);const e=function(){if(C){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(C.size>=5242880)I(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=C&&C.type&&!e.test(null==C?void 0:C.type))I(a("NOT_SUPPORTED_FILE_TYPE"));else{const e=c(function(){return Promise.resolve(Digit.UploadServices.Filestorage("OBPS",C,Digit.ULBService.getStateId()||(null==u?void 0:u.split(".")[0]))).then(function(e){var t,l,n,i;(null==e||null===(t=e.data)||void 0===t||null===(l=t.files)||void 0===l?void 0:l.length)>0?N(null==e||null===(n=e.data)||void 0===n||null===(i=n.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(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]),t.useEffect(()=>{r&&_((e=>{let{t:t,action:n,approvers:i,selectedApprover:a,setSelectedApprover:r,selectFile:u,uploadedFile:d,setUploadedFile:s,businessService:c,error:v}=e,p=!0;return"SENDBACKTOCITIZEN"==(null==n?void 0:n.action)&&(p=!1),n.isTerminateState&&(p=!1),{label:{heading:`WF_${null==n?void 0:n.action}_APPLICATION`,submit:`WF_${null==c?void 0:c.toUpperCase()}_${null==n?void 0:n.action}`,cancel:"WF_EMPLOYEE_BPAREG_CANCEL"},form:[{body:[{label:p?t("WF_ASSIGNEE_NAME_LABEL"):null,placeholder:p?t("WF_ASSIGNEE_NAME_PLACEHOLDER"):null,type:"dropdown",populators:p?l.createElement(o.Dropdown,{option:i,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:r,selected:a}):null},{label:t("WF_COMMON_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:t("BPA_APPROVAL_CHECKLIST_BUTTON_UP_FILE"),populators:l.createElement(o.UploadFile,{id:"workflow-doc",onUpload:u,onDelete:()=>{s(null)},message:d?"1 "+t("ES_PT_ACTION_FILEUPLOADED"):t("CS_ACTION_NO_FILEUPLOADED"),accept:"image/*, .pdf, .png, .jpeg, .jpg",iserror:v})}]}]}})({t:a,action:r,approvers:S,selectedApprover:b,setSelectedApprover:y,selectFile:B,uploadedFile:D,setUploadedFile:N,businessService:p,error:P}))},[r,S,D,P]),r&&f.form?l.createElement(o.Modal,{headerBarMain:l.createElement(kn,{label:a(f.label.heading)}),headerBarEnd:l.createElement(Hn,{onClick:d}),actionCancelLabel:a(f.label.cancel),actionCancelOnSubmit:d,actionSaveLabel:a(f.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action",isOBPSFlow:!0,popupStyles:L?{width:"720px"}:{},style:L?{height:"45px",width:"44%"}:{height:"45px",width:"107px",paddingLeft:"0px",paddingRight:"0px"},popupModuleMianStyles:L?{paddingLeft:"5px"}:{}},E?l.createElement(o.Loader,null):l.createElement(o.FormComposer,{config:f.form,cardStyle:{marginLeft:"0px",marginRight:"0px",marginTop:"-25px"},className:"BPAemployeeCard",noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){v={...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:D?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==C?void 0:C.name,fileStoreId:D}]:null},s({Licenses:[v]},!1,{isStakeholder:!0,bpa:!1})},defaultValues:g,formId:"modal-action"})):l.createElement(o.Loader,null)},jn=e=>l.createElement("h1",{style:{marginLeft:"22px"},className:"heading-m BPAheading-m"},e.label),$n=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),Yn=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement($n,null)),zn=e=>{var n,i,a,r,d,s,v,p,m,E,f,_;let{t:g,action:A,tenantId:S,closeModal:h,submitAction:b,applicationDetails:y,applicationData:C,businessService:T,workflowDetails:D,blockReason:N}=e;console.log("applicationData",C),console.log("workflowDetails",D),Digit.Hooks.obps.useObpsAPI(null!==(n=C)&&void 0!==n&&null!==(i=n.landInfo)&&void 0!==i&&null!==(a=i.address)&&void 0!==a&&a.city?null===(r=C)||void 0===r||null===(d=r.landInfo)||void 0===d||null===(s=d.address)||void 0===s?void 0:s.city:S,!1);const{data:P,isLoading:I}=Digit.Hooks.useEmployeeSearch(S,{roles:null==D||null===(v=D.data)||void 0===v||null===(p=v.initialActionState)||void 0===p||null===(m=p.nextActions)||void 0===m||null===(E=m.filter(e=>(null==e?void 0:e.action)==(null==A?void 0:A.action)))||void 0===E||null===(f=E[0])||void 0===f||null===(_=f.assigneeRoles)||void 0===_?void 0:_.map(e=>({code:e})),isActive:!0},{enabled:!(null!=A&&A.isTerminateState)}),[L,B]=(u.useQueryClient(),t.useState({})),[O,R]=t.useState({}),[w,x]=t.useState([]),[M,F]=t.useState([]),[k,U]=t.useState({}),[H,W]=t.useState({}),[j,$]=t.useState(null),[Y,z]=t.useState(null),[G,K]=t.useState(null),[V,q]=t.useState(null),X=!!Digit.Utils.browser.isMobile();function J(e){$(e.target.files[0])}t.useEffect(()=>{var e;x(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]),t.useEffect(()=>{!function(){try{K(null);const e=function(){if(j){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(j.size>=5242880)K(g("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=j&&j.type&&!e.test(null==j?void 0:j.type))K(g("NOT_SUPPORTED_FILE_TYPE"));else{const e=c(function(){return Promise.resolve(Digit.UploadServices.Filestorage("OBPS",j,Digit.ULBService.getStateId()||(null==S?void 0:S.split(".")[0]))).then(function(e){var t,l,n,i;(null==e||null===(t=e.data)||void 0===t||null===(l=t.files)||void 0===l?void 0:l.length)>0?z(null==e||null===(n=e.data)||void 0===n||null===(i=n.files[0])||void 0===i?void 0:i.fileStoreId):K(g("CS_FILE_UPLOAD_ERROR"))})},function(){K(g("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[j]);const Z=e=>{let t=[];return e&&e.map((e,l)=>{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 l;for(l=0;l<(null==e?void 0:e.questionLength);l++){var n;t.push({remarks:e["Remarks_"+l],question:null==e?void 0:e.questionList[l].question,value:null==e||null===(n=e["question_"+l])||void 0===n?void 0:n.code})}return t},ee=e=>{var t,l;let n=[],i=[];var o,a;return(null==e||null===(t=e.additionalDetails)||void 0===t||null===(l=t.fieldinspection_pending)||void 0===l?void 0:l.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?(n=JSON.parse(sessionStorage.getItem("INSPECTION_DATA")),(null===(a=n)||void 0===a?void 0:a.length)>0&&n.map((e,t)=>{i.push({docs:Z(e.Documents),date:e.InspectionDate,questions:Q(e),time:null==e?void 0:e.InspectionTime})}),console.log("FIELDINSPECTION_INPROGRESS",i),i=i.filter(e=>e.date&&e.time),console.log("inspectionObinspectionOb",i)):sessionStorage.removeItem("INSPECTION_DATA"),[...i]},te=e=>{let t=JSON.parse(sessionStorage.getItem("BPA_DOCUMENTS")),l=[];return t.map(e=>{var t,n,i,o,a,r;(null==e||null===(t=e.uploadedDocuments)||void 0===t||null===(n=t[0])||void 0===n||null===(i=n.values)||void 0===i?void 0:i.length)>0&&(l=[...l,...null==e||null===(o=e.uploadedDocuments)||void 0===o||null===(a=o[0])||void 0===a?void 0:a.values]),(null==e||null===(r=e.newUploadedDocs)||void 0===r?void 0:r.length)>0&&(l=[...l,...null==e?void 0:e.newUploadedDocs])}),l},le=()=>{var e;const t=Digit.SessionStorage.get("OBPS_APPROVAL_CHECKS"),l=Digit.SessionStorage.get("OBPS_NEW_APPROVALS");let n=null==t?void 0:t.reduce((e,t)=>null!=t&&t.checked?e.push(null==t?void 0:t.label)&&e:e,[]);return n=null===(e=n)||void 0===e?void 0:e.concat(null!==l?l.filter(e=>""!==e.label).map(e=>null==e?void 0:e.label):[]),n};return t.useEffect(()=>{F(null==N?void 0:N.map(e=>({code:null==e?void 0:e.code,name:null==e?void 0:e.value}))),A&&B((e=>{var t,n,i,a,r,u,d;let{t:s,action:c,approvers:v,selectedApprover:p,setSelectedApprover:m,selectedBlockReason:E,setBlockReason:f,selectFile:_,uploadedFile:g,setUploadedFile:A,assigneeLabel:S,businessService:h,error:b,blockReasonFiltered:y}=e,C=!1;return"REVOCATE"!=(null==c?void 0:c.action)&&"REJECT"!=(null==c?void 0:c.action)&&"SKIP_PAYMENT"!=c.action&&"SEND_BACK_TO_CITIZEN"!=(null==c?void 0:c.action)&&"APPROVE"!=(null==c?void 0:c.action)||(C=!0),{label:{heading:`WF_${null==c?void 0:c.action}_APPLICATION`,submit:`WF_${h}_${null==c?void 0:c.action}`,cancel:"BPA_CITIZEN_CANCEL_BUTTON"},form:[{body:[{label:c.isTerminateState||C||"BLOCK"==(null==c?void 0:c.action)&&"PENDINGAPPROVAL"==(null==c||null===(t=c.state)||void 0===t?void 0:t.state)||"FORWARD"==(null==c?void 0:c.action)&&"FIELDINSPECTION_PENDING"==(null==c||null===(n=c.state)||void 0===n?void 0:n.state)?null:s(S||"WF_ROLE_"+(null===(i=c.assigneeRoles)||void 0===i?void 0:i[0])),type:"dropdown",populators:c.isTerminateState||C||"BLOCK"==(null==c?void 0:c.action)&&"PENDINGAPPROVAL"==(null==c||null===(a=c.state)||void 0===a?void 0:a.state)||"FORWARD"==(null==c?void 0:c.action)&&"FIELDINSPECTION_PENDING"==(null==c||null===(r=c.state)||void 0===r?void 0:r.state)?null:l.createElement(o.Dropdown,{option:v,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:m,selected:p})},{label:"BLOCK"==(null==c?void 0:c.action)&&"PENDINGAPPROVAL"==(null==c||null===(u=c.state)||void 0===u?void 0:u.state)?s("BLOCK_REASON"):null,type:"dropdown",populators:"BLOCK"==(null==c?void 0:c.action)&&"PENDINGAPPROVAL"==(null==c||null===(d=c.state)||void 0===d?void 0:d.state)?l.createElement(o.Dropdown,{option:y,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:f,selected:E,isMandatory:!0}):null},{label:s("WF_COMMON_COMMENTS"),type:"textarea",isMandatory:!0,populators:{name:"comments"}},{label:""+s("WF_APPROVAL_UPLOAD_HEAD"),populators:l.createElement(o.UploadFile,{id:"workflow-doc",onUpload:_,onDelete:()=>{A(null)},message:g?"1 "+s("ES_PT_ACTION_FILEUPLOADED"):s("CS_ACTION_NO_FILEUPLOADED"),accept:"image/*, .pdf, .png, .jpeg, .jpg",iserror:b})}]}]}})({t:g,action:A,approvers:w,selectedApprover:k,setSelectedApprover:U,selectedBlockReason:H,setBlockReason:W,selectFile:J,uploadedFile:Y,setUploadedFile:z,businessService:T,assigneeLabel:"WF_ASSIGNEE_NAME_LABEL_BPA",error:G,blockReasonFiltered:M}))},[A,w,V,Y,G]),A&&L.form?l.createElement(o.Modal,{headerBarMain:l.createElement(jn,{label:g(L.label.heading)}),headerBarEnd:l.createElement(Yn,{onClick:h}),actionCancelLabel:g(L.label.cancel),actionCancelOnSubmit:h,actionSaveLabel:g(L.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action",isOBPSFlow:!0,popupStyles:X?{width:"720px"}:{},style:X?{minHeight:"45px",height:"auto",width:"44%"}:{minHeight:"45px",height:"auto",width:"107px",paddingLeft:"0px",paddingRight:"0px"},popupModuleMianStyles:X?{paddingLeft:"5px"}:{}},I?l.createElement(o.Loader,null):l.createElement(o.FormComposer,{config:L.form,cardStyle:{marginLeft:"0px",marginRight:"0px",marginTop:"-25px"},className:"BPAemployeeCard",noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){try{var t,l,n,i,o,a,r,u,d,s,c,v,p,m,E,f,_,T,N,P,I,L,B,O,R,w,x;C={...C,documents:te(),additionalDetails:{...null===(t=C)||void 0===t?void 0:t.additionalDetails,fieldinspection_pending:ee(C),pendingapproval:le(),blockingReason:null==H?void 0:H.name},workflow:{action:null==A?void 0:A.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===(n=e.comments)||void 0===n?void 0:n.length)>0?null==e?void 0:e.comments:null,assignee:"FIELDINSPECTION_INPROGRESS"===(null==D||null===(i=D.data)||void 0===i||null===(o=i.processInstances)||void 0===o||null===(a=o[0])||void 0===a||null===(r=a.state)||void 0===r?void 0:r.applicationStatus)?[null==D||null===(u=D.data)||void 0===u||null===(d=u.processInstances)||void 0===d||null===(s=d[0])||void 0===s||null===(c=s.assigner)||void 0===c?void 0:c.uuid]:null!=k&&k.uuid?[null==k?void 0:k.uuid]:null,assignes:"FIELDINSPECTION_INPROGRESS"===(null==D||null===(v=D.data)||void 0===v||null===(p=v.processInstances)||void 0===p||null===(m=p[0])||void 0===m||null===(E=m.state)||void 0===E?void 0:E.applicationStatus)?[null==D||null===(f=D.data)||void 0===f||null===(_=f.processInstances)||void 0===_||null===(T=_[0])||void 0===T||null===(N=T.assigner)||void 0===N?void 0:N.uuid]:null!=k&&k.uuid?[null==k?void 0:k.uuid]:null,varificationDocuments:Y?[{documentType:(null==A?void 0:A.action)+" DOC",fileName:null==j?void 0:j.name,fileStoreId:Y}]:null},action:null==A?void 0:A.action,comment:null==e?void 0:e.comments,assignee:"FIELDINSPECTION_INPROGRESS"===(null==D||null===(P=D.data)||void 0===P||null===(I=P.processInstances)||void 0===I||null===(L=I[0])||void 0===L||null===(B=L.state)||void 0===B?void 0:B.applicationStatus)?[null==D||null===(O=D.data)||void 0===O||null===(R=O.processInstances)||void 0===R||null===(w=R[0])||void 0===w||null===(x=w.assigner)||void 0===x?void 0:x.uuid]:null!=k&&k.uuid?[null==k?void 0:k.uuid]:null,wfDocuments:Y?[{documentType:(null==A?void 0:A.action)+" DOC",fileName:null==j?void 0:j.name,fileStoreId:Y}]:null};const M=function(e,t,l,n,i,o,a,r,u,d,s,c){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===(l=t.selfCertificationCharges)||void 0===l?void 0:l.BPA_MALBA_CHARGES)+parseInt(null===(n=C)||void 0===n||null===(i=n.additionalDetails)||void 0===i||null===(o=i.selfCertificationCharges)||void 0===o?void 0:o.BPA_LABOUR_CESS)+parseInt(null===(a=C)||void 0===a||null===(r=a.additionalDetails)||void 0===r||null===(u=r.selfCertificationCharges)||void 0===u?void 0:u.BPA_WATER_CHARGES)+parseInt(null===(d=C)||void 0===d||null===(s=d.additionalDetails)||void 0===s||null===(c=s.selfCertificationCharges)||void 0===c?void 0:c.BPA_GAUSHALA_CHARGES_CESS))){var v,p,m;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:{...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===(m=p.Noc)||void 0===m?void 0:m.sourceRefId};return Promise.resolve(Digit.NOCSearch.all(S,t)).then(function(t){var l;let n=!0,i=!0;null==t||null===(l=t.Noc)||void 0===l||l.map(e=>{var t,l,o,a,r;"APPROVED"!==(null==e||null===(t=e.applicationStatus)||void 0===t?void 0:t.toUpperCase())&&"AUTO_APPROVED"!==(null==e||null===(l=e.applicationStatus)||void 0===l?void 0:l.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!=i||("AIRPORT_AUTHORITY"===(null==e?void 0:e.nocType)?n=!1:"FIRE_NOC"===(null==e?void 0:e.nocType)&&(i=!1))});let o=[];if(e&&e.map(e=>{var t,l,a,r,u,d,s,c,v,p,m,E;("APPROVED"!=(null==e||null===(t=e.Noc)||void 0===t||null===(l=t.applicationStatus)||void 0===l?void 0:l.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===(d=u.applicationStatus)||void 0===d?void 0:d.toUpperCase())&&"AUTO_REJECTED"!=(null==e||null===(s=e.Noc)||void 0===s||null===(c=s.applicationStatus)||void 0===c?void 0:c.toUpperCase())&&"VOIDED"!=(null==e||null===(v=e.Noc)||void 0===v||null===(p=v.applicationStatus)||void 0===p?void 0:p.toUpperCase())&&"AIRPORT_AUTHORITY"===(null==e||null===(m=e.Noc)||void 0===m?void 0:m.nocType)&&n||"FIRE_NOC"===(null==e||null===(E=e.Noc)||void 0===E?void 0:E.nocType)&&i)&&o.push(e)}),"FIELDINSPECTION_INPROGRESS"==C.status){let e=JSON.parse(sessionStorage.getItem("INSPECTION_DATA"));(null==e?void 0:e.length)>0&&e.map((e,t)=>{e.InspectionDate&&e.InspectionTime?b({BPA:C},(null==o?void 0:o.length)>0&&o,{isStakeholder:!1,bpa:!0}):(h(),alert(g("Please fill Inspection Date and Time"))),console.log(" ob.InspectionDate && ob.InspectionTime",e.InspectionDate,e.InspectionTime)})}else b({BPA:C},(null==o?void 0:o.length)>0&&o,{isStakeholder:!1,bpa:!0})})}h(),alert(g("Enterd Less Adjustment amount is invalid"))}();return Promise.resolve(M&&M.then?M.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},defaultValues:O,formId:"modal-action"})):l.createElement(o.Loader,null)},Gn=e=>l.createElement("h1",{style:{marginLeft:"22px"},className:"heading-m BPAheading-m"},e.label),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"})),Vn=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(Kn,null)),qn=e=>{var n,a;let{t:r,action:d,tenantId:s,closeModal:v,submitAction:p,applicationData:m,businessService:E}=e;const{data:f,isLoading:_}=Digit.Hooks.useEmployeeSearch(s,{roles:null==d||null===(n=d.assigneeRoles)||void 0===n||null===(a=n.map)||void 0===a?void 0:a.call(n,e=>({code:e})),isActive:!0},{enabled:!(null!=d&&d.isTerminateState)}),[g,A]=(u.useQueryClient(),t.useState({})),[S,h]=t.useState({}),[b,y]=t.useState([]),[C,T]=t.useState({}),[D,N]=t.useState(null),[P,I]=t.useState(null),[L,B]=t.useState(null),O=!!Digit.Utils.browser.isMobile();function R(e){N(e.target.files[0])}return i.useHistory(),t.useEffect(()=>{var e;y(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]),t.useEffect(()=>{!function(){try{B(null);const e=function(){if(D){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(D.size>=5242880)B(r("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=D&&D.type&&!e.test(null==D?void 0:D.type))B(r("NOT_SUPPORTED_FILE_TYPE"));else{const e=c(function(){return Promise.resolve(Digit.UploadServices.Filestorage("NOC",D,Digit.ULBService.getStateId()||(null==s?void 0:s.split(".")[0]))).then(function(e){var t,l,n,i;(null==e||null===(t=e.data)||void 0===t||null===(l=t.files)||void 0===l?void 0:l.length)>0?I(null==e||null===(n=e.data)||void 0===n||null===(i=n.files[0])||void 0===i?void 0:i.fileStoreId):B(r("CS_FILE_UPLOAD_ERROR"))})},function(){B(r("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)}}()},[D]),t.useEffect(()=>{d&&A((e=>{var t;let{t:n,action:i,approvers:a,selectedApprover:r,setSelectedApprover:u,selectFile:d,uploadedFile:s,setUploadedFile:c,assigneeLabel:v,businessService:p,error:m}=e,E=!1;"REVOCATE"!=(null==i?void 0:i.action)&&"REJECT"!=(null==i?void 0:i.action)||(E=!0);let f=!1;return"APPROVE"!=(null==i?void 0:i.action)&&"REJECT"!=(null==i?void 0:i.action)&&"AUTO_APPROVE"!=i.action&&"AUTO_REJECT"!=i.action||(f=!0),{label:{heading:`WF_${null==i?void 0:i.action}_APPLICATION`,submit:`WF_${p}_${null==i?void 0:i.action}`,cancel:"CORE_LOGOUTPOPUP_CANCEL"},form:[{body:[{label:i.isTerminateState||f?null:n(v||"WF_ROLE_"+(null===(t=i.assigneeRoles)||void 0===t?void 0:t[0])),type:"dropdown",populators:i.isTerminateState||f?null:l.createElement(o.Dropdown,{option:a,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:u,selected:r})},{label:n("WF_COMMON_COMMENTS"),type:"textarea",isMandatory:E,populators:{name:"comments"}},{label:""+n("WF_APPROVAL_UPLOAD_HEAD"),populators:l.createElement(o.UploadFile,{id:"workflow-doc",onUpload:d,onDelete:()=>{c(null)},showHint:!0,message:s?"1 "+n("ES_PT_ACTION_FILEUPLOADED"):n("CS_ACTION_NO_FILEUPLOADED"),accept:"image/*, .pdf, .png, .jpeg, .jpg",iserror:m})}]}]}})({t:r,action:d,approvers:b,selectedApprover:C,setSelectedApprover:T,selectFile:R,uploadedFile:P,setUploadedFile:I,businessService:E,assigneeLabel:"WF_ASSIGNEE_NAME_LABEL",error:L}))},[d,b,P,L]),d&&g.form?l.createElement(o.Modal,{headerBarMain:l.createElement(Gn,{label:r(g.label.heading)}),headerBarEnd:l.createElement(Vn,{onClick:v}),actionCancelLabel:r(g.label.cancel),actionCancelOnSubmit:v,actionSaveLabel:r(g.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action",isOBPSFlow:!0,popupStyles:O?{width:"720px"}:{},style:O?{height:"45px",width:"44%"}:{height:"45px",width:"107px",paddingLeft:"0px",paddingRight:"0px"},popupModuleMianStyles:O?{paddingLeft:"5px"}:{}},_?l.createElement(o.Loader,null):l.createElement(o.FormComposer,{config:g.form,cardStyle:{marginLeft:"0px",marginRight:"0px",marginTop:"-25px"},className:"BPAemployeeCard",noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){var t,l,n;let i=JSON.parse(sessionStorage.getItem("NewNOCDocs")),o=(null===(t=m)||void 0===t||null===(l=t.documents)||void 0===l?void 0:l.length)>0?[...null===(n=m)||void 0===n?void 0:n.documents]:[];i.map((e,t)=>{o.push(e)}),m={...m,workflow:{action:null==d?void 0:d.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:P?[{documentType:(null==d?void 0:d.action)+" DOC",fileName:null==D?void 0:D.name,fileStoreId:P}]:null},documents:o},p({Noc:m},!1,{isNoc:!0})},defaultValues:S,formId:"modal-action"})):l.createElement(o.Loader,null)},Xn=e=>l.createElement("h1",{className:"heading-m"},e.label),Jn=()=>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"})),Zn=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(Jn,null)),Qn=function(e,t){void 0===t&&(t="dayend");try{const l=e.match(/(\d{4})-(\d{1,2})-(\d{1,2})/),n=new Date(Date.UTC(l[1],l[2]-1,l[3]));return n.setMinutes(n.getMinutes()+n.getTimezoneOffset()),"dayend"===t&&(n.setHours(n.getHours()+24),n.setSeconds(n.getSeconds()-1)),n.getTime()}catch(t){return e}},ei=e=>{var n,i;let{t:a,action:r,tenantId:u,closeModal:d,submitAction:v,applicationData:p,businessService:m}=e;const{data:E,isLoading:f}=Digit.Hooks.useEmployeeSearch(u,{roles:null==r||null===(n=r.assigneeRoles)||void 0===n||null===(i=n.map)||void 0===i?void 0:i.call(n,e=>({code:e})),isActive:!0},{enabled:!(null!=r&&r.isTerminateState)}),[_,g]=t.useState({}),[A,S]=t.useState({}),[h,b]=t.useState([]),[y,C]=t.useState({}),[T,D]=t.useState(null),[N,P]=t.useState(null),[I,L]=t.useState(null),B=window.Digit.Utils.browser.isMobile(),O=window.location.href.includes("/employee");function R(e){D(e.target.files[0])}return t.useEffect(()=>{var e;b(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]),t.useEffect(()=>{!function(){try{L(null);const e=function(){if(T){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(T.size>=5242880)L(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=T&&T.type&&!e.test(null==T?void 0:T.type))L(a("NOT_SUPPORTED_FILE_TYPE"));else{const e=c(function(){return Promise.resolve(Digit.UploadServices.Filestorage("WS",T,Digit.ULBService.getCurrentTenantId())).then(function(e){var t,l,n,i;(null==e||null===(t=e.data)||void 0===t||null===(l=t.files)||void 0===l?void 0:l.length)>0?P(null==e||null===(n=e.data)||void 0===n||null===(i=n.files[0])||void 0===i?void 0:i.fileStoreId):L(a("CS_FILE_UPLOAD_ERROR"))})},function(e){console.error("Modal -> err ",e),L(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)}}()},[T]),t.useEffect(()=>{var e,t,n,i;"DisconnectWSConnection"==(null===(e=p)||void 0===e||null===(t=e.processInstance)||void 0===t?void 0:t.businessService)||"DisconnectSWConnection"==(null===(n=p)||void 0===n||null===(i=n.processInstance)||void 0===i?void 0:i.businessService)?r&&g((e=>{var t;let{t:n,action:i,approvers:a,selectedApprover:r,setSelectedApprover:u,selectFile:d,uploadedFile:c,setUploadedFile:v,businessService:p,error:m}=e,E=!0,f=!1;return(null!=i&&null!==(t=i.action)&&void 0!==t&&t.includes("SEND_BACK")||"APPROVE_FOR_DISCONNECTION"==(null==i?void 0:i.action)||"RESUBMIT_APPLICATION"==(null==i?void 0:i.action))&&(E=!1),i.isTerminateState&&(E=!1),"EXECUTE_DISCONNECTION"!=(null==i?void 0:i.action)&&"DISCONNECTION_EXECUTED"!=(null==i?void 0:i.action)||(f=!0),{label:{heading:`WF_${null==i?void 0:i.action}_APPLICATION`,submit:`WF_${null==p?void 0:p.toUpperCase()}_${null==i?void 0:i.action}`,cancel:"CS_COMMON_CANCEL"},form:[{body:[{label:E?n("WF_ASSIGNEE_NAME_LABEL"):null,placeholder:E?n("WF_ASSIGNEE_NAME_PLACEHOLDER"):null,type:"dropdown",populators:E?l.createElement(o.Dropdown,{option:a,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:u,selected:r}):null},f&&{label:n("ES_FSM_ACTION_SERVICE_DATE"),isMandatory:!!f,type:"custom",populators:f?{name:"date",validation:{required:!0},defaultValue:Digit.Utils.date.getDate(),component:(e,t)=>l.createElement(o.DatePicker,s({onChange:e.onChange,date:e.value},t))}:null},{label:n("WF_COMMON_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:n("WS_APPROVAL_CHECKLIST_BUTTON_UP_FILE"),populators:l.createElement(o.UploadFile,{id:"workflow-doc",accept:".jpg,.pdf,.png,.jpeg",onUpload:d,onDelete:()=>{v(null)},message:c?"1 "+n("ES_PT_ACTION_FILEUPLOADED"):n("CS_ACTION_NO_FILEUPLOADED"),error:m,iserror:m,showHintBelow:!0,hintText:"WS_HINT_TEXT_LABEL"})}]}]}})({t:a,action:r,approvers:h,selectedApprover:y,setSelectedApprover:C,selectFile:R,uploadedFile:N,setUploadedFile:P,businessService:m,error:I})):r&&g((e=>{var t;let{t:n,action:i,approvers:a,selectedApprover:r,setSelectedApprover:u,selectFile:d,uploadedFile:s,setUploadedFile:c,businessService:v,error:p}=e,m=!0;return(null!=i&&null!==(t=i.action)&&void 0!==t&&t.includes("SEND_BACK")||"APPROVE_FOR_CONNECTION"==(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==v?void 0:v.toUpperCase()}_${null==i?void 0:i.action}`,cancel:"CS_COMMON_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(o.Dropdown,{option:a,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:u,selected:r}):null},{label:n("WF_COMMON_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:n("WS_APPROVAL_CHECKLIST_BUTTON_UP_FILE"),populators:l.createElement(o.UploadFile,{id:"workflow-doc",accept:".jpg,.pdf,.png,.jpeg",onUpload:d,onDelete:()=>{c(null)},message:s?"1 "+n("ES_PT_ACTION_FILEUPLOADED"):n("CS_ACTION_NO_FILEUPLOADED"),error:p,iserror:p,showHintBelow:!0,hintText:"WS_HINT_TEXT_LABEL"})}]}]}})({t:a,action:r,approvers:h,selectedApprover:y,setSelectedApprover:C,selectFile:R,uploadedFile:N,setUploadedFile:P,businessService:m,error:I}))},[r,h,N,I]),r&&_.form?l.createElement(o.Modal,{headerBarMain:l.createElement(Xn,{label:a(_.label.heading)}),headerBarEnd:l.createElement(Zn,{onClick:d}),actionCancelLabel:a(_.label.cancel),actionCancelOnSubmit:d,actionSaveLabel:a(_.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action",style:B&&O?{width:"100%",height:"auto"}:{}},f?l.createElement(o.Loader,null):l.createElement(o.FormComposer,{config:_.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){var t,l,n,i,o,a,d,s,c,m;if(null!==(t=p)&&void 0!==t&&t.isBillAmend){var E,f,_,g,A,S,h,b,C;const t={...null===(E=p)||void 0===E||null===(f=E.billAmendmentDetails)||void 0===f?void 0:f.additionalDetails,comments:null!=e&&e.comments?e.comments:null},l={...null===(_=p)||void 0===_?void 0:_.billAmendmentDetails,workflow:{businessId:null===(g=p)||void 0===g||null===(A=g.billAmendmentDetails)||void 0===A?void 0:A.amendmentId,action:null==r?void 0:r.action,tenantId:u,businessService:null!==(S=p)&&void 0!==S&&null!==(h=S.applicationType)&&void 0!==h&&h.includes("WATER")?"WS.AMENDMENT":"SW.AMENDMENT",moduleName:null!==(b=p)&&void 0!==b&&null!==(C=b.applicationType)&&void 0!==C&&C.includes("WATER")?"WS":"SW",assignes:null!=y&&y.uuid?[{uuid:null==y?void 0:y.uuid}]:[],comment:(null==e?void 0:e.comments)||"",documents:N?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==T?void 0:T.name,fileStoreId:N}]:[]},additionalDetails:t,comment:(null==e?void 0:e.comments)||"",wfDocuments:N?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==T?void 0:T.name,fileStoreId:N}]:null,processInstance:{action:null==r?void 0:r.action,assignes:null!=y&&y.uuid?[{uuid:null==y?void 0:y.uuid}]:[],comment:(null==e?void 0:e.comments)||"",documents:N?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==T?void 0:T.name,fileStoreId:N}]:[]}};v({AmendmentUpdate:l})}else{if(p={...p,action:null==r?void 0:r.action,comment:(null==e?void 0:e.comments)||"",assignee:null!=y&&y.uuid?[null==y?void 0:y.uuid]:[],assignes:null!=y&&y.uuid?[{uuid:null==y?void 0:y.uuid}]:[],wfDocuments:N?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==T?void 0:T.name,fileStoreId:N}]:null,processInstance:{...null===(l=p)||void 0===l?void 0:l.processInstance,action:null==r?void 0:r.action,assignes:null!=y&&y.uuid?[{uuid:null==y?void 0:y.uuid}]:[],comment:(null==e?void 0:e.comments)||"",documents:N?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==T?void 0:T.name,fileStoreId:N}]:[]}},null!=e&&e.date&&null!==(n=p)&&void 0!==n&&null!==(i=n.applicationType)&&void 0!==i&&i.includes("DISCONNECT")){const t=mt(null==e?void 0:e.date);p.disconnectionExecutionDate=Qn(t)}else if(null!=e&&e.date){const t=mt(null==e?void 0:e.date);p.connectionExecutionDate=Qn(t)}var D;if("DisconnectWSConnection"==(null===(o=p)||void 0===o||null===(a=o.processInstance)||void 0===a?void 0:a.businessService)||"DisconnectSWConnection"==(null===(d=p)||void 0===d||null===(s=d.processInstance)||void 0===s?void 0:s.businessService)||window.location.href.includes("disconnection"))"WATER"==(null===(D=p)||void 0===D?void 0:D.serviceType)?v({WaterConnection:p,disconnectRequest:!0}):v({SewerageConnection:p,disconnectRequest:!0});else if("SEWERAGE_RECONNECTION"==(null===(c=p)||void 0===c?void 0:c.applicationType))v({SewerageConnection:p,disconnectRequest:!1,reconnectRequest:!0});else if("WATER_RECONNECTION"==(null===(m=p)||void 0===m?void 0:m.applicationType))v({WaterConnection:p,disconnectRequest:!1,reconnectRequest:!0});else{var P,I,L,B,O,R,w,x,M,F,k,U,H;const e=sessionStorage.getItem("Digit.ADHOC_ADD_REBATE_DATA"),t=e?JSON.parse(e):"";null!=t&&null!==(P=t.value)&&void 0!==P&&P.adhocPenalty&&(p.additionalDetails.adhocPenalty=parseInt(null==t||null===(I=t.value)||void 0===I?void 0:I.adhocPenalty)||""),null!=t&&null!==(L=t.value)&&void 0!==L&&L.adhocPenaltyComment&&(p.additionalDetails.adhocPenaltyComment=(null==t||null===(B=t.value)||void 0===B?void 0:B.adhocPenaltyComment)||""),null!=t&&null!==(O=t.value)&&void 0!==O&&O.adhocPenaltyReason&&(p.additionalDetails.adhocPenaltyReason=(null==t||null===(R=t.value)||void 0===R?void 0:R.adhocPenaltyReason)||""),null!=t&&null!==(w=t.value)&&void 0!==w&&w.adhocRebate&&(p.additionalDetails.adhocRebate=parseInt(null==t||null===(x=t.value)||void 0===x?void 0:x.adhocRebate)||""),null!=t&&null!==(M=t.value)&&void 0!==M&&M.adhocRebateComment&&(p.additionalDetails.adhocRebateComment=(null==t||null===(F=t.value)||void 0===F?void 0:F.adhocRebateComment)||""),null!=t&&null!==(k=t.value)&&void 0!==k&&k.adhocRebateReason&&(p.additionalDetails.adhocRebateReason=(null==t||null===(U=t.value)||void 0===U?void 0:U.adhocRebateReason)||""),"WATER"==(null===(H=p)||void 0===H?void 0:H.serviceType)?v({WaterConnection:p,disconnectRequest:!1,reconnectRequest:!1}):v({SewerageConnection:p,disconnectRequest:!1,reconnectRequest:!1})}}},defaultValues:A,formId:"modal-action"})):l.createElement(o.Loader,null)},ti=e=>l.createElement("h1",{className:"heading-m"},e.label),li=()=>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"})),ni=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(li,null)),ii=e=>{var n,i;let{t:a,action:r,tenantId:u,closeModal:d,submitAction:s,applicationData:v,businessService:p,moduleCode:m}=e;console.log("applicationData",v);const{data:E}=Digit.Hooks.useEmployeeSearch(u,{roles:null==r||null===(n=r.assigneeRoles)||void 0===n||null===(i=n.map)||void 0===i?void 0:i.call(n,e=>({code:e})),isActive:!0},{enabled:!(null!=r&&r.isTerminateState)}),[f,_]=t.useState({}),[g,A]=t.useState({}),[S,h]=t.useState([]),[b,y]=t.useState(null),[C,T]=t.useState(null),[D,N]=t.useState(null),[P,I]=t.useState(null),[L,B]=t.useState(!1);function O(e){T(e.target.files[0])}return t.useEffect(()=>{var e;h(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]),t.useEffect(()=>{!function(){try{I(null);const e=function(){if(C){const e=function(){if(C.size>=5242880)I(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=c(function(){return Promise.resolve(Digit.UploadServices.Filestorage("PTR",C,Digit.ULBService.getStateId())).then(function(e){var t,l,n,i;(null==e||null===(t=e.data)||void 0===t||null===(l=t.files)||void 0===l?void 0:l.length)>0?N(null==e||null===(n=e.data)||void 0===n||null===(i=n.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)}}()},[C]),t.useEffect(()=>{r&&_((e=>{let{t:t,action:l,businessService:n}=e;return{label:{heading:`WF_${null==l?void 0:l.action}_APPLICATION`,submit:`WF_${n}_${null==l?void 0:l.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:O,uploadedFile:D,setUploadedFile:N,businessService:p}))},[r,S,D]),r&&f.form?l.createElement(o.Modal,{headerBarMain:l.createElement(ti,{label:a(f.label.heading)}),headerBarEnd:l.createElement(ni,{onClick:d}),actionCancelLabel:a(f.label.cancel),actionCancelOnSubmit:d,actionSaveLabel:a(f.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},l.createElement(o.FormComposer,{config:f.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",s({PetRegistrationApplications:[{...v,workflow:t}]})}let t={action:null==r?void 0:r.action,comments:null==e?void 0:e.comments,businessService:p,moduleName:m};t.assignes=null!=r&&r.isTerminateState||!b?[]:[b],D&&(t.documents=[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==C?void 0:C.name,fileStoreId:D}]),s({PetRegistrationApplications:[{...v,workflow:t}]})},defaultValues:g,formId:"modal-action"})):l.createElement(o.Loader,null)},oi=e=>l.createElement("h1",{className:"heading-m"},e.label),ai=()=>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"})),ri=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(ai,null)),ui=e=>{var n,i,a;let{t:r,action:u,closeModal:d,submitAction:s,applicationData:c,businessService:v}=e;const p=Digit.ULBService.getStateId(),{data:m,isLoading:E}=Digit.Hooks.tl.useTradeLicenseMDMS(p,"TradeLicense","TradeUnits","[?(@.type=='TL')]");console.log("tradeMdmsData",null==m||null===(n=m.TradeLicense)||void 0===n?void 0:n.TradeType),console.log("applicationData",c);const[f,_]=t.useState({}),[g,A]=t.useState({}),[S,h]=t.useState([]),[b,y]=t.useState(""),[C,T]=t.useState([]),[D,N]=t.useState(null),P=null===(i=c)||void 0===i||null===(a=i.tradeLicenseDetail)||void 0===a?void 0:a.tradeUnits;console.log("tradeUnits",P);const I=t.useMemo(()=>{var e;if(E||!m||!P.length)return[];const t=new Set(P.map(e=>e.tradeType)),l=(null===(e=m.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",l),l?["1"]:["1","2","3"]},[E,m,P]);return console.log("years",I),t.useEffect(()=>{u&&_((e=>{let{t:t,action:n,years:i,selectedApprover:a,setSelectedApprover:r,businessService:u}=e;return{label:{heading:`WF_${null==n?void 0:n.action}_APPLICATION`,submit:`WF_${null==u?void 0:u.toUpperCase()}_${null==n?void 0:n.action}`,cancel:"WF_EMPLOYEE_NEWTL_CANCEL"},form:[{body:[{label:t("TL_VALID_FOR_NO_OF_YEARS"),type:"dropdown",populators:l.createElement(o.Dropdown,{option:i,autoComplete:"off",select:r,selected:a})}]}]}})({t:r,action:u,years:I,selectedApprover:b,setSelectedApprover:y,businessService:v}))},[u,I,C,D]),u&&f.form?l.createElement(o.Modal,{headerBarMain:l.createElement(oi,{label:r(f.label.heading)}),headerBarEnd:l.createElement(ri,{onClick:d}),actionCancelLabel:r(f.label.cancel),actionCancelOnSubmit:d,actionSaveLabel:r(f.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},E?l.createElement(o.Loader,null):l.createElement(o.FormComposer,{config:f.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){var t;let l=null===(t=c)||void 0===t?void 0:t.financialYear;const n=null==l?void 0:l.split("-")[1],i=`20${Number(n)}-${Number(n)+1}`;c={...c,financialYear:i,action:"INITIATE",additionalDetail:{...c.additionalDetail,validityYears:b.length>0?parseInt(b):""}},s({Licenses:[c]})},defaultValues:g,formId:"modal-action"})):l.createElement(o.Loader,null)},di=e=>l.createElement("h1",{className:"heading-m"},e.label),si=()=>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"})),ci=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(si,null)),vi=e=>{var n,i;let{t:a,action:r,tenantId:u,closeModal:d,submitAction:s,applicationData:p,businessService:m,moduleCode:E}=e;const{data:f}=Digit.Hooks.useEmployeeSearch(u,{roles:null==r||null===(n=r.assigneeRoles)||void 0===n||null===(i=n.map)||void 0===i?void 0:i.call(n,e=>({code:e})),isActive:!0},{enabled:null==r?void 0:r.isTerminateState}),[_,g]=t.useState({}),[A,S]=t.useState({}),[h,b]=t.useState([]),[y,C]=t.useState(null),[T,D]=t.useState(null),[N,P]=t.useState(null),[I,L]=t.useState(null),[B,O]=t.useState(!1);function R(e){O(!0),D(e.target.files[0])}return t.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]),t.useEffect(()=>{!function(){try{L(null);const e=function(){if(T){const e=function(){if(T.size>=5242880)L(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=v(function(){return c(function(){return Promise.resolve(Digit.UploadServices.Filestorage("StreetVending",T,u)).then(function(e){var t,l,n,i;(null==e||null===(t=e.data)||void 0===t||null===(l=t.files)||void 0===l?void 0:l.length)>0?P(null==e||null===(n=e.data)||void 0===n||null===(i=n.files[0])||void 0===i?void 0:i.fileStoreId):L(a("CS_FILE_UPLOAD_ERROR"))})},function(){L(a("CS_FILE_UPLOAD_ERROR"))})},function(e,t){if(O(!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)}}()},[T]),console.log("actyhdesh,jhfsefsef",r,p),t.useEffect(()=>{g((e=>{let{t:t,action:n,selectFile:i,uploadedFile:a,setUploadedFile:r,approvers:u,selectedApprover:d,setSelectedApprover:s,isUploading:c}=e;const v=()=>l.createElement("div",{className:"loading-spinner"});return console.log("isuploading ",c),{label:{heading:`WF_${null==n?void 0:n.action}_APPLICATION`,submit:"SV_"+(null==n?void 0:n.action),cancel:"SV_COMMON_CANCEL"},form:[{body:["APPROVE"===(null==n?void 0:n.action)||"REJECT"===(null==n?void 0:n.action)||"SENDBACKTOCITIZEN"===(null==n?void 0:n.action)?"":{label:t("SV_ASSIGNEE"),type:"dropdown",populators:l.createElement(o.Dropdown,{option:u,t:t,optionKey:"name",select:s,selected:d})},{label:t("SV_ACTION_COMMENTS"),isMandatory:!0,type:"textarea",populators:{name:"comments",validation:{required:!0}}},{label:`${t("SV_ATTATCH_FILE")}${n.docUploadRequired?" *":""}`,populators:l.createElement(o.UploadFile,{id:"workflow-doc-sv",onUpload:i,onDelete:()=>{r(null)},message:c?l.createElement("div",{style:{display:"flex",alignItems:"center",gap:"8px"}},l.createElement(v,null),l.createElement("span",null,"Uploading...")):a?"1 "+t("SV_FILE_UPLOADED"):t("SV_NO_FILE")})}]}]}})({t:a,action:r,approvers:h,selectedApprover:y,setSelectedApprover:C,selectFile:R,uploadedFile:N,setUploadedFile:P,businessService:m,isUploading:B}))},[r,h,N]),r&&_.form?l.createElement(o.Modal,{headerBarMain:l.createElement(di,{label:a(_.label.heading)}),headerBarEnd:l.createElement(ci,{onClick:d}),actionCancelLabel:a(_.label.cancel),actionCancelOnSubmit:d,actionSaveLabel:a(_.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},l.createElement(o.FormComposer,{config:_.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){var t;let l={action:null==r?void 0:r.action,comments:null==e?void 0:e.comments,businessService:m,moduleName:E,assignes:"SENDBACKTOCITIZEN"===(null==r?void 0:r.action)?[null==p||null===(t=p.auditDetails)||void 0===t?void 0:t.createdBy]:null!=y&&y.uuid?[null==y?void 0:y.uuid]:null};N&&(l.documents=[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==T?void 0:T.name,fileStoreId:N}]),s({streetVendingDetail:{...p,workflow:l}})},defaultValues:A,formId:"modal-action"})):l.createElement(o.Loader,null)},pi=e=>l.createElement("h1",{className:"heading-m"},e.label),mi=()=>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"})),Ei=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(mi,null)),fi=e=>{var n,i;let{t:a,action:r,tenantId:u,closeModal:d,submitAction:s,applicationData:v,businessService:p,moduleCode:m}=e;console.log("applicationData",v);const{data:E}=Digit.Hooks.useEmployeeSearch(u,{roles:null==r||null===(n=r.assigneeRoles)||void 0===n||null===(i=n.map)||void 0===i?void 0:i.call(n,e=>({code:e})),isActive:!0},{enabled:!(null!=r&&r.isTerminateState)}),[f,_]=t.useState({}),[g,A]=t.useState({}),[S,h]=t.useState([]),[b,y]=t.useState(null),[C,T]=t.useState(null),[D,N]=t.useState(null),[P,I]=t.useState(null),[L,B]=t.useState(!1);function O(e){T(e.target.files[0])}return t.useEffect(()=>{var e;h(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]),t.useEffect(()=>{!function(){try{I(null);const e=function(){if(C){const e=function(){if(C.size>=5242880)I(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=c(function(){return Promise.resolve(Digit.UploadServices.Filestorage("CHB",C,Digit.ULBService.getStateId())).then(function(e){var t,l,n,i;(null==e||null===(t=e.data)||void 0===t||null===(l=t.files)||void 0===l?void 0:l.length)>0?N(null==e||null===(n=e.data)||void 0===n||null===(i=n.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)}}()},[C]),t.useEffect(()=>{r&&_((e=>{let{t:t,action:n,selectFile:i,uploadedFile:a,setUploadedFile:r,businessService:u}=e;return{label:{heading:`WF_${null==n?void 0:n.action}_APPLICATION`,submit:`WF_${u}_${null==n?void 0:n.action}`,cancel:"ES_CHB_COMMON_CANCEL"},form:[{body:[{label:t("ES_CHB_ACTION_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:`${t("ES_CHB_ATTACH_FILE")}${n.docUploadRequired?" *":""}`,populators:l.createElement(o.UploadFile,{id:"workflow-doc",onUpload:i,onDelete:()=>{r(null)},showHint:!0,hintText:t("CHB_ATTACH_RESTRICTIONS_SIZE"),message:a?"1 "+t("ES_CHB_ACTION_FILEUPLOADED"):t("ES_CHB_ACTION_NO_FILEUPLOADED")})}]}]}})({t:a,action:r,approvers:S,selectedApprover:b,setSelectedApprover:y,selectFile:O,uploadedFile:D,setUploadedFile:N,businessService:p}))},[r,S,D]),r&&f.form?l.createElement(o.Modal,{headerBarMain:l.createElement(pi,{label:a(f.label.heading)}),headerBarEnd:l.createElement(Ei,{onClick:d}),actionCancelLabel:a(f.label.cancel),actionCancelOnSubmit:d,actionSaveLabel:a(f.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},l.createElement(o.FormComposer,{config:f.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){let t={action:null==r?void 0:r.action,comments:null==e?void 0:e.comments,businessService:p,moduleName:m};D&&(t.documents=[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==C?void 0:C.name,filestoreId:D}]),s({hallsBookingApplication:[{...v,workflow:t}]})},defaultValues:g,formId:"modal-action"})):l.createElement(o.Loader,null)},_i=e=>l.createElement("h1",{className:"heading-m"},e.label),gi=()=>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"})),Ai=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(gi,null)),Si=e=>{var n,a,r;let{t:u,action:d,tenantId:s,closeModal:c,submitAction:v,applicationData:p,businessService:m,moduleCode:E}=e;const{data:f}=Digit.Hooks.useEmployeeSearch(s,{roles:null==d||null===(n=d.roles)||void 0===n||null===(a=n[0])||void 0===a||null===(r=a.map)||void 0===r?void 0:r.call(a,e=>({code:e})),isActive:!0},{enabled:!(null!=d&&d.isTerminateState)}),_=i.useHistory(),[g,A]=t.useState({}),[S,h]=t.useState({}),[b,y]=t.useState([]),[C,T]=t.useState(null),[D,N]=t.useState(null);return t.useEffect(()=>{var e;y(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]),t.useEffect(()=>{"INITIATED"===(null==d?void 0:d.state)?_.push("/digit-ui/employee/asset/assetservice/edit/"+(null==p?void 0:p.applicationNo)):A((e=>{let{t:t,action:l,businessService:n}=e;return{label:{heading:`WF_${null==l?void 0:l.action}_APPLICATION`,submit:`WF_${n}_${null==l?void 0:l.action}`,cancel:"ES_AST_COMMON_CANCEL"},form:[{body:[{label:t("AST_ACTION_COMMENTS"),type:"textarea",populators:{name:"comments"}}]}]}})({t:u,action:d,approvers:b,selectedApprover:C,setSelectedApprover:T,uploadedFile:D,setUploadedFile:N,businessService:m}))},[d,b,D]),d&&g.form?l.createElement(o.Modal,{headerBarMain:l.createElement(_i,{label:u(g.label.heading)}),headerBarEnd:l.createElement(Ai,{onClick:c}),actionCancelLabel:u(g.label.cancel),actionCancelOnSubmit:c,actionSaveLabel:u(g.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},l.createElement(o.FormComposer,{config:g.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){let t={action:null==d?void 0:d.action,comment:null==e?void 0:e.comments,businessService:m,moduleName:E};D&&(t.documents=[]),v({Asset:{...p,workflow:t}})},defaultValues:S,formId:"modal-action"})):l.createElement(o.Loader,null)},hi=e=>null!=e&&e.businessService.includes("PT")?l.createElement(Rn,e):null!=e&&e.businessService.includes("ptr")?l.createElement(ii,e):null!=e&&e.businessService.includes("NewTL")||null!=e&&e.businessService.includes("TL")||null!=e&&e.businessService.includes("EDITRENEWAL")?l.createElement(Fn,e):null!=e&&e.businessService.includes("DIRECTRENEWAL")?l.createElement(ui,e):null!=e&&e.moduleCode.includes("BPAREG")?l.createElement(Wn,e):null!=e&&e.moduleCode.includes("BPA")?l.createElement(zn,e):null!=e&&e.moduleCode.includes("NOC")?l.createElement(qn,e):null!=e&&e.moduleCode.includes("WS")?l.createElement(ei,e):null!=e&&e.businessService.includes("street-vending")?l.createElement(vi,e):null!=e&&e.businessService.includes("chb")?l.createElement(fi,e):null!=e&&e.businessService.includes("asset-create")?l.createElement(Si,e):void 0,bi=e=>{var n,i;let{t:o,formData:a,applicationData:r,docs:u,bpaActionsDetails:d}=e;const s=(null==r?void 0:r.status)||"",c=(null==d||null===(n=d.data)||void 0===n?void 0:n.nextActions)||[],v=Digit.ULBService.getStateId(),[p,m]=t.useState((null==a||null===(i=a.documents)||void 0===i?void 0:i.documents)||[]),[E,f]=t.useState(null),[_,g]=t.useState([]),[A,S]=t.useState(!0),[h,b]=t.useState(!1),[y,C]=t.useState(!1),{isLoading:T,data:D}=Digit.Hooks.obps.useMDMS(v,"BPA",["DocTypeMapping"]),{isLoading:N,data:P}=Digit.Hooks.obps.useMDMS(v,"common-masters",["DocumentType"]);return t.useEffect(()=>{var e,t,l,n;let i=[];var o,a;null!=D&&null!==(e=D.BPA)&&void 0!==e&&e.DocTypeMapping&&(i=null==D||null===(o=D.BPA)||void 0===o||null===(a=o.DocTypeMapping)||void 0===a?void 0:a.filter(e=>{var t,l;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===(l=r.additionalDetails)||void 0===l?void 0:l.applicationType)}));let d=[];null===(t=i)||void 0===t||null===(l=t[0])||void 0===l||null===(n=l.docTypes)||void 0===n||n.forEach(e=>{var t,l,n,i;let o=e.code;e.dropdownData=[],e.uploadedDocuments=[],null==P||null===(t=P["common-masters"])||void 0===t||null===(l=t.DocumentType)||void 0===l||l.forEach(t=>{let l=t.code.slice(0,o.length);o===l&&(e.hasDropdown=!0,t.i18nKey=t.code,e.dropdownData.push(t))}),e.uploadedDocuments[0]={},e.uploadedDocuments[0].values=[],null==u||null===(n=u[0])||void 0===n||null===(i=n.values)||void 0===i||i.map(t=>{var l,n;o===`${null==t||null===(l=t.documentType)||void 0===l?void 0:l.split(".")[0]}.${null==t||null===(n=t.documentType)||void 0===n?void 0:n.split(".")[1]}`&&e.uploadedDocuments[0].values.push(t)}),d.push(e)}),sessionStorage.setItem("BPA_DOCUMENTS",JSON.stringify(d)),g(d)},[!T,!N]),t.useEffect(()=>{let e=0;_.map(t=>{let l=!1;p.map(e=>{t.required&&t.code==`${e.documentType.split(".")[0]}.${e.documentType.split(".")[1]}`&&(l=!0)}),!l&&t.required&&(e+=1)}),S("0"!=e&&0!=e||!(p.length>0))},[p,h]),t.useEffect(()=>{C("DOC_VERIFICATION_INPROGRESS"===s&&(null==c?void 0:c.length)>0)},[r,d]),l.createElement("div",{style:{display:"flex",flexWrap:"wrap"}},null==_?void 0:_.map((e,t)=>l.createElement("div",{style:{padding:"20px"}},l.createElement(yi,{key:t,index:t,document:e,t:o,error:E,setError:f,setDocuments:m,documents:p,setCheckRequiredFields:b,applicationStatus:s,actions:c,bpaTaxDocuments:_,checkEnablingDocs:y}))))};function yi(e){var n,i;let{t:a,document:r,setDocuments:u,documents:d,index:s,bpaTaxDocuments:c,checkEnablingDocs:v}=e;const p=null==d?void 0:d.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],m=Digit.ULBService.getStateId(),[E,f]=t.useState(p?{...p,active:!0,code:null==p?void 0:p.documentType,i18nKey:null==p?void 0:p.documentType}:1===(null==r||null===(n=r.dropdownData)||void 0===n?void 0:n.length)?null==r?void 0:r.dropdownData[0]:{}),[_,g]=t.useState(null),[A,S]=t.useState(()=>(null==p?void 0:p.fileStoreId)||null),[h,b]=t.useState([]);return t.useEffect(()=>{null!=E&&E.code&&u(e=>{var t;const l=null==e?void 0:e.filter(e=>(null==e?void 0:e.documentType)!==(null==E?void 0:E.code));return 0===(null==A?void 0:A.length)||null===A?l:[...null==l?void 0:l.filter(e=>(null==e?void 0:e.fileStoreId)!==A),{documentType:null==E?void 0:E.code,fileStoreId:A,documentUid:A,fileName:(null==_?void 0:_.name)||"",id:d?null===(t=d.find(e=>e.documentType===(null==E?void 0:E.code)))||void 0===t?void 0:t.id:void 0}]})},[A,E]),t.useEffect(()=>{try{h.length>0&&(sessionStorage.removeItem("BPA_DOCUMENTS"),r.newUploadedDocs=[],h.map(e=>{var t,l,n;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===(l=e.fileStoreId)||void 0===l?void 0:l.fileStoreId,tenantId:null==e||null===(n=e.fileStoreId)||void 0===n?void 0:n.tenantId})}),c[s]=r,sessionStorage.setItem("BPA_DOCUMENTS",JSON.stringify(c)))}catch(e){Promise.reject(e)}},[h,E]),t.useEffect(()=>{},[_]),l.createElement("div",{style:{marginBottom:"24px",maxWidth:"950px",minWidth:"280px",background:"#FAFAFA",borderRadius:"4px",border:"1px solid #D6D5D4",padding:"8px"}},l.createElement(o.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(zl,{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(o.LabelFieldPair,{style:{width:"100%"}},l.createElement(o.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(o.Dropdown,{className:"form-field",t:a,isMandatory:!1,option:null==r?void 0:r.dropdownData,selected:E,optionKey:"i18nKey",select:e=>f(e),style:{width:"100%"}})),l.createElement(o.LabelFieldPair,{style:{width:"100%"}},l.createElement(o.CardLabel,{className:"card-label-smaller",style:{width:"100%"}}),l.createElement("div",{className:"field",style:{width:"100%"}},l.createElement(o.MultiUploadWrapper,{module:"BPA",tenantId:m,getFormState:e=>((e,t)=>{let l=Object.fromEntries(t),n=Object.values(l);var i;0!==Object.keys(l).length&&b(n),(i=n[n.length-1])&&g(i.file)})(0,e),t:a,allowedFileTypesRegex:/(.*?)(jpg|jpeg|png|image|pdf)$/i,allowedMaxSizeInMB:5,acceptFiles:"image/*, .pdf, .png, .jpeg, .jpg"})))):null)}function Ci(e){let{t:n,document:i,setNocDocuments:a,setError:r,nocDocuments:u}=e;const d=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],s=Digit.ULBService.getStateId(),[v,p]=t.useState(),[m,E]=t.useState(null),[f,_]=t.useState(()=>(null==d?void 0:d.fileStoreId)||null);return t.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 l=null==e?void 0:e.filter(e=>{var t,l;return(null==e?void 0:e.documentType)!==(null==i||null===(t=i.dropdownData)||void 0===t||null===(l=t[0])||void 0===l?void 0:l.code)});return 0===(null==f?void 0:f.length)||null===f?l:[...null==l?void 0:l.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==m?void 0:m.name)||""}]})},[f]),t.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(n("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=m&&m.type&&!e.test(null==m?void 0:m.type))r(n("NOT_SUPPORTED_FILE_TYPE"));else{const e=c(function(){return _(null),Promise.resolve(Digit.UploadServices.Filestorage("PT",m,Digit.ULBService.getStateId())).then(function(e){var t,l,i,o;(null==e||null===(t=e.data)||void 0===t||null===(l=t.files)||void 0===l?void 0:l.length)>0?_(null==e||null===(i=e.data)||void 0===i||null===(o=i.files[0])||void 0===o?void 0:o.fileStoreId):r(n("CS_FILE_UPLOAD_ERROR"))})},function(){r(n("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(o.LabelFieldPair,{style:{width:"98%",marginRight:"10px"}},l.createElement(o.CardLabel,{style:{width:"100%"}},null!=i&&i.required?n("TL_BUTTON_UPLOAD FILE")+"*":""+n("TL_BUTTON_UPLOAD FILE")),l.createElement("div",{className:"field",style:{width:"100%"}},l.createElement(o.MultiUploadWrapper,{module:"NOC",tenantId:s,getFormState:e=>(e=>{let t=Object.fromEntries(e),l=Object.values(t);var n;(n=l[l.length-1])&&E(n.file)})(e),t:n,allowedFileTypesRegex:/(.*?)(jpg|jpeg|png|image|pdf)$/i,allowedMaxSizeInMB:5,acceptFiles:"image/*, .pdf, .png, .jpeg, .jpg"}))))}const Ti=e=>{var n;let{t:i,noc:a,docs:r,isNoc:u,applicationData:d,NOCdata:s,bpaActionsDetails:c}=e;Digit.ULBService.getStateId();const v=Digit.ULBService.getStateId(),p=(null==d?void 0:d.status)||"",m=(null==c||null===(n=c.data)||void 0===n?void 0:n.nextActions)||[],{data:E}=Digit.Hooks.obps.useMDMS(v,"NOC",["DocumentTypeMapping"],{enabled:u}),{data:f}=Digit.Hooks.obps.useMDMS(v,"BPA",["DocTypeMapping"],{enabled:!u}),{data:_}=Digit.Hooks.obps.useMDMS(v,"common-masters",["DocumentType"]),[g,A]=t.useState([]),[S,h]=t.useState([]),[b,y]=t.useState(!1),[C,T]=Digit.Hooks.useSessionStorage(null==a?void 0:a.nocType,[]),[D,N]=t.useState(null),P=window.location.href.includes("/employee/");return t.useEffect(()=>{var e;A(null==_||null===(e=_["common-masters"])||void 0===e?void 0:e.DocumentType)},[_]),t.useEffect(()=>{var e,t,l;let n,i=[];var o,r,s,c;n=u?null==E||null===(o=E.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==f||null===(s=f.BPA)||void 0===s||null===(c=s.DocTypeMapping)||void 0===c?void 0:c.filter(e=>{var t,l;return e.WFState==(null==d?void 0:d.status)&&e.RiskType==(null==d?void 0:d.riskType)&&e.ServiceType==(null==d||null===(t=d.additionalDetails)||void 0===t?void 0:t.serviceType)&&e.applicationType==(null==d||null===(l=d.additionalDetails)||void 0===l?void 0:l.applicationType)}),null!==(e=n)&&void 0!==e&&null!==(t=e[0])&&void 0!==t&&null!==(l=t.docTypes)&&void 0!==l&&l[0]&&(n[0].docTypes[0].nocType=n[0].nocType,n[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(n[0].docTypes[0]));let v=[];i&&i.length>0&&(i.map(e=>{let t=e.documentType;e.dropdownData=[],null==g||g.forEach(l=>{let n=l.code.slice(0,null==t?void 0:t.length);t===n&&(e.hasDropdown=!0,e.dropdownData.push(l))}),v.push(e)}),h(v))},[E,g]),t.useEffect(()=>{y("NOC_VERIFICATION_INPROGRESS"===p&&(null==m?void 0:m.length)>0)},[d,c]),l.createElement("div",{style:{border:"1px solid #D6D5D4",padding:"16px 0px 16px 8px",background:"#FAFAFA",borderRadius:"5px",marginBottom:"24px",maxWidth:"950px"}},l.createElement(o.StatusTable,null,l.createElement(o.Row,{label:P?""+i(`BPA_${null==a?void 0:a.nocType}_HEADER`):i(`BPA_${null==a?void 0:a.nocType}_HEADER`),labelStyle:{fontSize:"20px",width:"150%"}}),s&&s.map((e,t)=>{if(null!=e&&e.value)return l.createElement(o.Row,"STATUS"==(null==e?void 0:e.field)?{className:"border-none",label:P?""+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:P?""+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(zl,{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(Ci,{key:t,document:e,t:i,error:D,setError:N,setNocDocuments:T,nocDocuments:C,checkEnablingDocs:b}))))},Di=e=>{let{permissions:n,t:i}=e;const[a,r,u]=Digit.Hooks.useSessionStorage("OBPS_APPROVAL_CHECKS",null==n?void 0:n.map(e=>({label:e,checked:!1}))),[d,s,c]=Digit.Hooks.useSessionStorage("OBPS_NEW_APPROVALS",[]);t.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(o.CardSubHeader,{style:{marginBottom:"16px",fontSize:"24px"}},i("BPA_PERMIT_CONDITIONS")),null==a?void 0:a.map((e,t)=>l.createElement(o.CheckBox,{key:t,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,l)=>{const n=e.target.checked;r(()=>null==a?void 0:a.map((e,t)=>l===t?{...e,checked:n}:e))})(e,0,t),isLabelFirst:!0,index:t})),null==d?void 0:d.map((e,t)=>l.createElement("div",null,l.createElement(o.TextInput,{key:t,value:null==e?void 0:e.label,onChange:e=>((e,t)=>{s(()=>null==d?void 0:d.map((l,n)=>{var i;return t===n?{label:null==e||null===(i=e.target)||void 0===i?void 0:i.value}:l}))})(e,t),textInputStyle:{maxWidth:v?"96%":"830px",width:v?"96%":"830px"},style:v?{paddingRight:"10%"}:{},placeholder:i("BPA_ENTER_PERMIT_CONDITIONS_LABEL")}),l.createElement(o.LinkButton,{label:l.createElement("div",null,l.createElement("span",null,l.createElement(o.Close,{style:{float:"right",position:"relative",bottom:"32px",marginTop:"-22px",marginRight:v?"5%":"35%"}}))),style:{},onClick:e=>(e=>{const t=[...d];t.splice(e,1),s([...t])})(t)}))),l.createElement(o.LinkButton,{style:{color:"#a82227",maxWidth:v?"fit-content":"10%",marginRight:"3%"},label:i("BPA_ADD_MORE"),onClick:()=>{s([...d,{label:""}])}}))};function Ni(e){let{taxHeadEstimatesCalculation:t}=e;const{taxHeadEstimates:i}=t,{t:a}=n.useTranslation();return l.createElement("div",{style:{marginTop:"40px"}},l.createElement(o.StatusTable,null,l.createElement(o.Row,{label:a("ES_PT_TITLE_TAX_HEADS"),text:a("ES_PT_TITLE_AMOUNT"),className:"border-none",textStyle:{fontWeight:"bold"}}),l.createElement(o.BreakLine,{style:{margin:"16px 0",width:"40%"}}),null==i?void 0:i.map((e,t)=>l.createElement(o.Row,{key:a(e.taxHeadCode),label:a(e.taxHeadCode),text:"₹ "+e.estimateAmount||"N/A",last:t===(null==i?void 0:i.length)-1,className:"border-none",textStyle:{color:"#505A5F"},labelStyle:{color:"#505A5F"}})),l.createElement(o.BreakLine,{style:{margin:"16px 0",width:"40%"}}),l.createElement(o.Row,{label:a("ES_PT_TITLE_TOTAL_DUE_AMOUNT"),text:"₹ "+(null==t?void 0:t.totalAmount)||"N/A",className:"border-none",textStyle:{fontSize:"24px",fontWeight:"bold"}})))}function Pi(e){let{floors:t}=e;const{t:i}=n.useTranslation();return l.createElement(l.Fragment,null,t.map(e=>{var t;return l.createElement("div",{key:i(null==e?void 0:e.title),style:{marginTop:"19px"}},l.createElement(o.CardSubHeader,{style:{marginBottom:"8px",color:"#505A5F",fontSize:"24px"}},i(null==e?void 0:e.title)),null==e||null===(t=e.values)||void 0===t?void 0:t.map((e,t)=>{var n;return l.createElement(l.Fragment,{key:t},l.createElement(o.CardSectionHeader,{style:{marginBottom:"16px",color:"#505A5F",fontSize:"16px",marginTop:0!==t?"16px":"revert"}},i(e.title)),l.createElement(o.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===(n=e.values)||void 0===n?void 0:n.map((e,t)=>{var n;return l.createElement(o.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:t===(null==e||null===(n=e.values)||void 0===n?void 0:n.length)-1,caption:e.caption,className:"border-none"})}))))}))}))}function Ii(e){let{owners:t}=e,i={};i=window.location.href.includes("/employee/pt/")?t.slice().reverse():t;const{t:a}=n.useTranslation(),r=(null==t?void 0:t.length)||1;let u={marginTop:"19px"},d={position:"relative",padding:"8px"},s={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"},d={position:"relative",marginTop:"19px"}),window.location.href.includes("obps")&&(u={...u,maxWidth:"950px"},u={...u,maxWidth:"950px"},s={}),t.sort((e,t)=>{var l,n;return(null==e||null===(l=e.additionalDetails)||void 0===l?void 0:l.ownerSequence)-(null==t||null===(n=t.additionalDetails)||void 0===n?void 0:n.ownerSequence)}),l.createElement(l.Fragment,null,l.createElement("div",{className:"owner-details"},i.map((e,t)=>{var n;return l.createElement("div",{key:a(null==e?void 0:e.title),style:u,className:"owner-details-child"},l.createElement(o.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)} ${t+1}`:a(null==e?void 0:e.title)),l.createElement(l.Fragment,{key:t},l.createElement(o.StatusTable,{style:d},l.createElement("div",{style:{maxWidth:"640px",top:0,left:0,bottom:0,right:0,width:"auto"}}),null==e||null===(n=e.values)||void 0===n?void 0:n.map((e,t)=>{var n;return!0===e.map&&"N/A"!==e.value?l.createElement(o.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(o.Row,{key:a(e.title),label:""+a(e.title),text:a(e.value)||"N/A",last:t===(null==e||null===(n=e.values)||void 0===n?void 0:n.length)-1,caption:e.caption,className:"border-none",textStyle:e.textStyle,privacy:null==e?void 0:e.privacy,rowContainerStyle:s}))}))))})))}const Li=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))},Bi=e=>{var i,a,r;let{data:u,OpenImage:d,privacy:s={}}=e;const[c,v]=t.useState(!1),{t:p}=n.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(o.TelePhone,{mobile:u.mobileNumber,privacy:s}),l.createElement("p",null," ")),u.source&&l.createElement("p",null,p("ES_APPLICATION_DETAILS_APPLICATION_CHANNEL_"+u.source.toUpperCase())),u.comment&&l.createElement(Li,{otherComment:null==u?void 0:u.otherComment,headComment:null==u?void 0:u.comment}),null!=u&&u.wfComment?l.createElement("div",null,null==u||null===(i=u.wfComment)||void 0===i?void 0:i.map(e=>l.createElement("div",{className:"TLComments"},l.createElement("h3",null,p("WF_COMMON_COMMENTS")),!c&&l.createElement("div",null,l.createElement("p",{style:{overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitLineClamp:1,WebkitBoxOrient:"vertical"}},e),e.length>36?l.createElement("button",{type:"button",onClick:()=>{v(!0)},style:{color:"#800000"}},p("View More")):null),c&&l.createElement("div",null,l.createElement("p",{style:{overflow:"visible"}},e),l.createElement("button",{type:"button",onClick:()=>{v(!1)},style:{color:"#800000"}},p("View Less")))))):null,(null==u||null===(a=u.thumbnailsToShow)||void 0===a||null===(r=a.thumbs)||void 0===r?void 0:r.length)>0?l.createElement("div",{className:"TLComments"},l.createElement("h3",null,p("CS_COMMON_ATTACHMENTS")),l.createElement(o.DisplayPhotos,{srcs:null==u?void 0:u.thumbnailsToShow.thumbs,onClick:(e,t)=>{d(e,t,null==u?void 0:u.thumbnailsToShow)}})):null)};function Oi(e){let{units:t}=e;const{t:i}=n.useTranslation();return l.createElement(l.Fragment,null,t.map((e,t)=>{var n;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(o.CardSubHeader,{style:{marginBottom:"8px",paddingBottom:"9px",color:"#0B0C0C",fontSize:"16px",lineHeight:"19px"}},`${i(null==e?void 0:e.title)} ${t+1}`),l.createElement(l.Fragment,{key:t},l.createElement(o.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===(n=e.values)||void 0===n?void 0:n.map((e,t)=>{var n;return l.createElement(o.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:t===(null==e||null===(n=e.values)||void 0===n?void 0:n.length)-1,caption:e.caption,className:"border-none",rowContainerStyle:{justifyContent:"space-between",fontSize:"16px",lineHeight:"19px",color:"#0B0C0C"}})}))))}))}function Ri(e){let{units:t}=e;const{t:i}=n.useTranslation();return l.createElement(l.Fragment,null,t.map((e,t)=>{var n;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(o.CardSubHeader,{style:{marginBottom:"9px",paddingBottom:"9px",color:"#0B0C0C",fontSize:"16px",lineHeight:"19px"}},`${i(null==e?void 0:e.title)} ${t+1}`),l.createElement(l.Fragment,{key:t},l.createElement(o.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===(n=e.values)||void 0===n?void 0:n.map((e,t)=>{var n;return l.createElement(o.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:t===(null==e||null===(n=e.values)||void 0===n?void 0:n.length)-1,caption:e.caption,className:"border-none",rowContainerStyle:{justifyContent:"space-between",fontSize:"16px",lineHeight:"19px",color:"#0B0C0C"}})}))))}))}const wi=e=>{var i,a,r,u,d;let{wsAdditionalDetails:s}=e;const{t:c}=n.useTranslation();let v=(p=location.search)?(/^[?#]/.test(p)?p.slice(1):p).split("&").reduce((e,t)=>{let[l,n]=t.split("=");return e[l]=n?decodeURIComponent(n.replace(/\+/g," ")):"",e},{}):{};var p;const m=null==v?void 0:v.mode;var{connectionDetails:E,plumberDetails:f,roadCuttingDetails:_,roadCuttingAddlDetails:g,activationDetails:A}=(null==s?void 0:s.additionalDetails)||{connectionDetails:[],plumberDetails:[],roadCuttingAddlDetails:[]};return l.createElement(t.Fragment,null,l.createElement("div",{style:{lineHeight:"19px",maxWidth:"950px",minWidth:"280px"}},(null==s||null===(i=s.additionalDetails)||void 0===i?void 0:i.connectionDetails)&&l.createElement(o.StatusTable,null,l.createElement(o.CardSubHeader,{style:{fontSize:"24px",marginBottom:"16px",marginTop:"32px"}},c("WS_COMMON_CONNECTION_DETAIL")),l.createElement("div",null,l.createElement("div",{className:"connection-details-new-value-wrapper"},null==E?void 0:E.map((e,t)=>l.createElement("div",null,l.createElement(o.Row,{className:"border-none",key:""+e.title,label:""+c(""+e.title),text:null!=e&&e.oldValue?null==e?void 0:e.oldValue:null!=e&&e.value?null==e?void 0:e.value:""})))))),(null==s||null===(a=s.additionalDetails)||void 0===a?void 0:a.plumberDetails)&&"MODIFY"!=m&&l.createElement(o.StatusTable,null,l.createElement(o.CardSubHeader,{style:{fontSize:"24px",marginBottom:"16px",marginTop:"32px"}},c("WS_COMMON_PLUMBER_DETAILS")),l.createElement("div",null,l.createElement("div",{className:"plumber-details-new-value-wrapper"},null==f?void 0:f.map((e,t)=>l.createElement(o.Row,{className:"border-none",key:""+e.title,label:""+c(""+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==s||null===(r=s.additionalDetails)||void 0===r?void 0:r.roadCuttingDetails)&&"MODIFY"!=m&&l.createElement(o.StatusTable,null,l.createElement(o.CardSubHeader,{style:{fontSize:"24px",marginBottom:"16px",marginTop:"32px"}},c("WS_COMMON_ROAD_CUTTING_DETAILS")),l.createElement("div",null,l.createElement("div",{className:"road-cutting-details-new-value-wrapper"},null==_?void 0:_.map(e=>{var t;return l.createElement("div",{style:(null==_?void 0:_.length)>1?{border:"1px solid #D6D5D4",background:"#FAFAFA",borderRadius:"4px",padding:"10px 10px 0px 10px",margin:"5px 0px"}:{}},null==e||null===(t=e.values)||void 0===t?void 0:t.map(e=>l.createElement(o.Row,{className:"border-none",key:""+e.title,label:""+c(""+e.title),text:null!=e&&e.oldValue?null==e?void 0:e.oldValue:null!=e&&e.value?null==e?void 0:e.value:""})))}))),(null==s||null===(u=s.additionalDetails)||void 0===u?void 0:u.roadCuttingAddlDetails)&&l.createElement("div",null,l.createElement("br",null),l.createElement("div",{className:"road-cutting-addl-details-new-value-wrapper"},null==g?void 0:g.map((e,t)=>l.createElement("div",null,l.createElement(o.Row,{className:"border-none",key:""+e.title,label:""+c(""+e.title),text:null!=e&&e.oldValue?null==e?void 0:e.oldValue:null!=e&&e.value?null==e?void 0:e.value:""})))))),(null==s||null===(d=s.additionalDetails)||void 0===d?void 0:d.activationDetails)&&l.createElement(o.StatusTable,null,l.createElement(o.CardSubHeader,{style:{fontSize:"24px",marginBottom:"16px",marginTop:"32px"}},c("WS_ACTIVATION_DETAILS")),l.createElement("div",null,l.createElement("div",{className:"plumber-details-new-value-wrapper"},null==A?void 0:A.map((e,t)=>l.createElement(o.Row,{className:"border-none",key:""+e.title,label:""+c(""+e.title),text:null!=e&&e.oldValue?null==e?void 0:e.oldValue:null!=e&&e.value?null==e?void 0:e.value:""})))))))},xi=[{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"}],Mi=[{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"}],Fi=e=>{var i,a,r,u;let{wsAdditionalDetails:d}=e;const{t:c}=n.useTranslation(),[v,p,m]=Digit.Hooks.useSessionStorage("ADHOC_ADD_REBATE_DATA",{}),[E,f,g]=Digit.Hooks.useSessionStorage("ADHOC_BILL_ADD_REBATE_DATA",{}),A=!(null==d||null===(i=d.additionalDetails)||void 0===i||!i.isPaid),[S,h]=t.useState(!1),[b,y]=t.useState(v||{}),[C,T]=t.useState(null),[D,N]=t.useState(d.additionalDetails.data?d.additionalDetails.data:{}),[P,I]=t.useState(d.additionalDetails.values?d.additionalDetails.values:[]),L=Digit.ULBService.getStateId();Digit.Hooks.ws.useMDMS(L,"BillingService",["TaxHeadMaster"]),t.useEffect(()=>{var e,t,n;const i={...null==d||null===(e=d.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,s,c,m;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===(s=v.billDetails)||void 0===s||null===(c=s[0])||void 0===c?void 0:c.taxAmount)}];I(e),N(null==v||null===(m=v.billDetails)||void 0===m?void 0:m[0])}else p(i),y(i)},[]);let B={};const O=e=>l.createElement("h1",{className:"heading-m"},e.label),R=()=>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"})),w=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(R,null)),x=function(e,t,l){void 0===t&&(t=!1);let n={...b};if("adhocPenalty"!=e&&"adhocRebate"!=e||!l.target.value)t?(n[e+"_data"]=l,n[e]=l.title,"PT_OTHERS"==l.title&&"adhocPenaltyReason"==e&&(n.adhocPenaltyComment=""),"PT_OTHERS"==l.title&&"adhocRebateReason"==e&&(n.adhocRebateComment="")):n[e]=l.target.value;else{var i,o;const t=0==(null==l||null===(i=l.target)||void 0===i?void 0:i.value)?1:Math.sign(null==l||null===(o=l.target)||void 0===o?void 0:o.value)||-1;n[e]=1==t?l.target.value:""}y(n)};return l.createElement(t.Fragment,null,l.createElement("div",{style:{lineHeight:"19px",maxWidth:"950px",minWidth:"280px"}},P&&l.createElement(o.StatusTable,null,l.createElement("div",null,null==P?void 0:P.map((e,t)=>l.createElement(o.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(o.Row,{className:"border-none",key:"WS_COMMON_TOTAL_AMT",label:""+c("WS_COMMON_TOTAL_AMT"),text:l.createElement("span",null,"₹",(null==D?void 0:D.totalAmount)||0),textStyle:{fontSize:"24px",fontWeight:"700"}}),l.createElement(o.Row,{className:"border-none",key:"CS_INBOX_STATUS_FILTER",label:""+c("CS_INBOX_STATUS_FILTER"),text:c(A?"WS_COMMON_PAID_LABEL":"WS_COMMON_NOT_PAID"),textStyle:A?{color:"#00703C"}:{color:"#D4351C"}}))),null!=d&&null!==(a=d.additionalDetails)&&void 0!==a&&a.isAdhocRebate?l.createElement("div",{onClick:e=>{h(!0)}},l.createElement("span",{style:{cursor:"pointer",color:"#a82227"}},c("WS_PAYMENT_ADD_REBATE_PENALTY"))):null,S&&l.createElement(o.Modal,{headerBarMain:l.createElement(O,{label:c("PT_ADD_REBATE_PENALITY")}),headerBarEnd:l.createElement(w,{onClick:()=>{y(v),h(!1)}}),actionCancelLabel:c("PT_CANCEL"),actionCancelOnSubmit:()=>{y(v),h(!1)},actionSaveLabel:c("PT_ADD"),actionSaveOnSubmit:e=>(e=>{const t=null!=b&&b.adhocPenalty?Number(null==b?void 0:b.adhocPenalty):0,l=null!=b&&b.adhocRebate?Number(null==b?void 0:b.adhocRebate):0;var n,i;if(t||l)if(l>(null==d||null===(n=d.additionalDetails)||void 0===n||null===(i=n.data)||void 0===i?void 0:i.totalAmount))T({isError:!1,isWarning:!0,key:"error",message:c("ERR_WS_REBATE_GREATER_THAN_AMOUNT")});else{var o,a,r,u,s,v,m,E,g,A;const e=null==d||null===(o=d.additionalDetails)||void 0===o||null===(a=o.appDetails)||void 0===a?void 0:a.applicationNo,t=null==d||null===(r=d.additionalDetails)||void 0===r||null===(u=r.appDetails)||void 0===u?void 0:u.tenantId,l={...null==d||null===(s=d.additionalDetails)||void 0===s||null===(v=s.appDetails)||void 0===v?void 0:v.additionalDetails,...b};d.additionalDetails.appDetails.additionalDetails=l;const n={CalculationCriteria:"WATER"==(null==d||null===(m=d.additionalDetails)||void 0===m||null===(E=m.appDetails)||void 0===E?void 0:E.service)?[{applicationNo:e,tenantId:t,waterConnection:d.additionalDetails.appDetails}]:[{applicationNo:e,tenantId:t,sewerageConnection:d.additionalDetails.appDetails}],isconnectionCalculation:!1};let i="WATER"==(null==d||null===(g=d.additionalDetails)||void 0===g||null===(A=g.appDetails)||void 0===A?void 0:A.service)?"WS":"SW";Digit.WSService.wsCalculationEstimate(n,i).then((e,t)=>{var l,n,i,o,a,r,u,d,s,c,v,m,E,g,A;(null==e||null===(l=e.Calculation)||void 0===l||null===(n=l[0])||void 0===n||null===(i=n.taxHeadEstimates)||void 0===i?void 0:i.length)>0&&(null==e||null===(E=e.Calculation)||void 0===E||null===(g=E[0])||void 0===g||null===(A=g.taxHeadEstimates)||void 0===A||A.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===(d=e.Calculation)||void 0===d||null===(s=d[0])||void 0===s?void 0:s.charge},{title:"WS_TAX_HEADER",value:null===(c=e.Calculation)||void 0===c||null===(v=c[0])||void 0===v?void 0:v.taxAmount}];f(mt(e.Calculation[0])),N(null==e||null===(m=e.Calculation)||void 0===m?void 0:m[0]),I(S),b.billDetails=null==e?void 0:e.Calculation,p(b),h(!1)}).catch(e=>{var t,l,n,i,o,a;T({isError:!0,isWarning:!1,key:"error",message:null!=e&&null!==(t=e.response)&&void 0!==t&&null!==(l=t.data)&&void 0!==l&&null!==(n=l.Errors[0])&&void 0!==n&&n.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 T({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(o.Card,{style:{padding:"10px 10px 1px 10px",margin:"0px 0px 15px 0px"}},l.createElement(o.CardSectionHeader,{style:{fontSize:"16px",fontWeight:"700",lineHeight:"18px",padding:"0px",margin:"0px 0px 10px 0px"}},c("PT_AD_PENALTY")),l.createElement(o.CardLabel,null,c("PT_TX_HEADS")),l.createElement("div",{className:"field"},l.createElement(o.Dropdown,{isMandatory:!0,option:xi,optionKey:"title",select:e=>x("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(o.CardLabel,null,c("PT_REASON")),l.createElement("div",{className:"field"},l.createElement(o.TextInput,s({style:{background:"#FAFAFA"},t:c,type:"text",isMandatory:!1,name:"adhocPenaltyComment",value:(null==b?void 0:b.adhocPenaltyComment)||"",onChange:e=>x("adhocPenaltyComment",!1,e)},B={isRequired:!0,pattern:"^[a-zA-Z ]*$",type:"text",title:c("TL_NAME_ERROR_MESSAGE")})))),l.createElement(o.CardLabel,null,c("PT_HEAD_AMT")),l.createElement("div",{className:"field"},l.createElement(o.TextInput,s({style:{background:"#FAFAFA"},t:c,type:"number",isMandatory:!1,name:"adhocPenalty",value:(null==b?void 0:b.adhocPenalty)||"",onChange:e=>x("adhocPenalty",!1,e)},B={isRequired:!0,pattern:"^[1-9]+[0-9]*$",title:c("ERR_DEFAULT_INPUT_FIELD_MSG")})))),l.createElement(o.Card,{style:{padding:"10px 10px 1px 10px",margin:"0px 0px 15px 0px"}},l.createElement(o.CardSectionHeader,{style:{fontSize:"16px",fontWeight:"700",lineHeight:"18px",padding:"0px",margin:"0px 0px 10px 0px"}},c("PT_AD_REBATE")),l.createElement(o.CardLabel,null,c("PT_TX_HEADS")),l.createElement("div",{className:"field"},l.createElement(o.Dropdown,{isMandatory:!0,option:Mi,optionKey:"title",select:e=>x("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(o.CardLabel,null,c("PT_REASON")),l.createElement(o.TextInput,s({style:{background:"#FAFAFA"},t:c,type:"text",isMandatory:!1,name:"adhocRebateComment",value:(null==b?void 0:b.adhocRebateComment)||"",onChange:e=>x("adhocRebateComment",!1,e)},B={isRequired:!0,pattern:"^[a-zA-Z ]*$",type:"text",title:c("TL_NAME_ERROR_MESSAGE")}))),l.createElement(o.CardLabel,null,c("PT_HEAD_AMT")),l.createElement("div",{className:"field"},l.createElement(o.TextInput,s({style:{background:"#FAFAFA"},t:c,type:"number",isMandatory:!1,name:"adhocRebate",value:(null==b?void 0:b.adhocRebate)||"",onChange:e=>x("adhocRebate",!1,e)},B={isRequired:!0,pattern:"^[1-9]+[0-9]*$",title:c("ERR_DEFAULT_INPUT_FIELD_MSG")})))))," "),C&&l.createElement(o.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:()=>{T(!1)},isDleteBtn:!0})))},ki=e=>{let{style:t}=e;return l.createElement("span",null,l.createElement("svg",{style:{...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"})))},Ui=e=>{let{t:t,userType:n=!1,infoBannerLabel:i="",infoClickLable:a="",infoClickInfoLabel:r="",infoClickInfoLabel1:u=""}=e;n=n||Digit.SessionStorage.get("userType");const d=window.Digit.Utils.browser.isMobile();return l.createElement(l.Fragment,null,l.createElement("div",{style:d?{}:{width:"80%"}},l.createElement("div",{className:"info-banner-wrap",style:{color:"#3498DB",margin:"0px"}},l.createElement("div",null,l.createElement(o.InfoBannerIcon,null),l.createElement("h2",{style:{color:"#3498DB"}},t(i))),t(a)+" ",l.createElement(ki,{style:{display:"inline",marginBottom:"5px"}})," "+t(r),l.createElement("div",null," "+t(u)))))},Hi=e=>{var i,a,r,u,d,s,c;let{wsAdditionalDetails:v}=e;const{t:p}=n.useTranslation(),[m,E]=t.useState(!1),[f,_]=t.useState({}),g=e=>l.createElement("h1",{className:"heading-m"},e.label),A=()=>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(A,null));return l.createElement(t.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 l=sessionStorage.getItem("Digit.ADHOC_BILL_ADD_REBATE_DATA"),n=l?JSON.parse(l):{};null!=n&&null!==(e=n.value)&&void 0!==e&&e.totalAmount&&(t=null==n?void 0:n.value),_(t),E(!0)})(),style:{marginTop:"12px"}},l.createElement("span",{style:{cursor:"pointer",color:"#a82227"}},p("WS_PAYMENT_VIEW_BREAKUP"))):null,m&&l.createElement(o.Modal,{headerBarMain:l.createElement(g,{label:p("WS_CALCULATION_BREAKUP")}),headerBarEnd:l.createElement(S,{onClick:()=>{E(!1)}}),hideSubmit:!0,popupStyles:{overflowY:"auto"},headerBarMainStyle:{marginBottom:"0px"},popupModuleMianStyles:{paddingTop:"0px"}},l.createElement(o.StatusTable,{style:{padding:"10px",paddingTop:"0px"}},l.createElement(o.CardSectionHeader,{style:{margin:"10px 0px"}},p("WS_APPLICATION_FEE_HEADER")),null==f||null===(a=f.billSlabData)||void 0===a||null===(r=a.FEE)||void 0===r?void 0:r.map(e=>l.createElement(o.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:""+(null==e?void 0:e.taxHeadCode),label:""+p(""+(null==e?void 0:e.taxHeadCode)),text:l.createElement("span",null,"₹",Number(null==e?void 0:e.amount)||0),textStyle:{textAlign:"right"}})),l.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",marginBottom:"10px"}}),l.createElement(o.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:"PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT1",label:""+p("PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT"),text:l.createElement("span",null,"₹",Number(null==f?void 0:f.fee)||0),textStyle:{textAlign:"right",fontWeight:"700",fontSize:"24px"}}),l.createElement(o.CardSectionHeader,{style:{margin:"10px 0px"}},p("WS_SERVICE_FEE_HEADER")),null==f||null===(u=f.billSlabData)||void 0===u||null===(d=u.CHARGES)||void 0===d?void 0:d.map(e=>l.createElement(o.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:""+(null==e?void 0:e.taxHeadCode),label:""+p(""+(null==e?void 0:e.taxHeadCode)),text:l.createElement("span",null,"₹",Number(null==e?void 0:e.amount)||0),textStyle:{textAlign:"right"}})),l.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",marginBottom:"10px"}}),l.createElement(o.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:"PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT2",label:""+p("PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT"),text:l.createElement("span",null,"₹",Number(null==f?void 0:f.charge)||0),textStyle:{textAlign:"right",fontWeight:"700",fontSize:"24px"}}),null==f||null===(s=f.billSlabData)||void 0===s||null===(c=s.TAX)||void 0===c?void 0:c.map(e=>l.createElement(o.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:""+(null==e?void 0:e.taxHeadCode),label:""+p(""+(null==e?void 0:e.taxHeadCode)),text:l.createElement("span",null,"₹",Number(null==e?void 0:e.amount)||0),textStyle:{textAlign:"right"}})),l.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",marginBottom:"10px"}}),l.createElement(o.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:"PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT3",label:""+p("PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT"),text:l.createElement("span",null,"₹",Number(null==f?void 0:f.totalAmount)||0),textStyle:{textAlign:"right",fontWeight:"700",fontSize:"24px"}})))))},Wi={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:{}},ji=e=>{let{className:t="table",headers:i=[],values:o=[],arrears:a=0}=e;const{t:r}=n.useTranslation();return l.createElement(l.Fragment,null,l.createElement("div",{style:Wi.root},l.createElement("table",{className:"table-fixed-column-common-pay",style:Wi.table},l.createElement("thead",null,l.createElement("tr",null,l.createElement("th",{style:{...Wi.cell,...Wi.cellLeft,...Wi.cellHeader}},r("CS_BILL_PERIOD")),i.map((e,t)=>l.createElement("th",{style:{...Wi.cell,...i.length==t+1?Wi.cellRight:{},...Wi.cellHeader},key:t},r(e))))),l.createElement("tbody",null,Object.values(o).map((e,t)=>l.createElement("tr",{key:t},l.createElement("td",{style:{...Wi.cell,...Wi.cellLeft},component:"th",scope:"row"},Object.keys(o)[t]),i.map((t,n)=>l.createElement("td",{style:{...Wi.cell,textAlign:"left",...i.length==n+1?Wi.cellRight:{},whiteSpace:"pre"},key:n,numeric:!0},n>1&&"₹",e[t]&&e[t].value||"0")))),l.createElement("tr",null,l.createElement("td",{style:{...Wi.cell,...Wi.cellLeft}}),i.map((e,t)=>t==i.length-1?l.createElement("td",{style:{...Wi.cell,...Wi.cellRight,textAlign:"left",fontWeight:"700",whiteSpace:"pre"},key:t,numeric:!0},a):t==i.length-2?l.createElement("td",{style:{...Wi.cell,textAlign:"left"},key:t,numeric:!0},r("COMMON_ARREARS_TOTAL")):l.createElement("td",{style:Wi.cell,key:t,numeric:!0})))))))},$i={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))"}},Yi=e=>{var i,o,a;let{bill:r={}}=e;const{t:u}=n.useTranslation();let d={},s=(null==r||null===(i=r.billDetails)||void 0===i?void 0:i.sort((e,t)=>t.fromPeriod-e.fromPeriod))||[];s=[...s];const c=(null===(o=s)||void 0===o?void 0:o.reduce((e,t,l)=>e+t.amount,0))||0;let v="₹ "+((null==c||null===(a=c.toFixed)||void 0===a?void 0:a.call(c,0))||Number(0).toFixed(0));s.map(e=>{let t=function(e){var t,l,n;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===(l=e)||void 0===l?void 0:l.expiryDate)&&new Date(null===(n=e)||void 0===n?void 0:n.expiryDate).toLocaleDateString()||"NA",order:-1},i.TL_COMMON_TOTAL_AMT={value:e.amount,order:10},i}(e);d[((e,t)=>{const l=new Date(e),n=new Date(t);return n.getYear()-l.getYear()!=0?`FY${l.getYear()+1900}-${n.getYear()-100}`:`${l.toLocaleDateString()}-${n.toLocaleDateString()}`})(e.fromPeriod,e.toPeriod)]=t});let p={};!d||Object.keys(d).map((e,t)=>{Object.keys(d[e]).map(t=>{p[t]=d[e]&&d[e][t]&&d[e][t].order||0})});let m=[];m=Object.keys(p),m.sort((e,t)=>p[e]-p[t]);const[E,f]=t.useState(!1);return 0==c||c<0?l.createElement("span",null):l.createElement(l.Fragment,null,l.createElement("div",{style:$i.headerStyle},u("CS_ARREARS_DETAILS")),E&&l.createElement(ji,{headers:[...m],values:d,arrears:v}),!E&&l.createElement("div",{style:$i.buttonStyle},l.createElement("button",{type:"button",onClick:()=>{f(!0)}},u("CS_SHOW_CARD"))),E&&l.createElement("div",{style:$i.buttonStyle},l.createElement("button",{type:"button",onClick:()=>{f(!1)}},u("CS_HIDE_CARD"))))},zi=e=>{let{assessmentData:n}=e;const[i,o]=t.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"}},n.map((e,t)=>l.createElement("div",{key:t,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")," ")),t!==n.length-1&&l.createElement("hr",null)))))},Gi=e=>{var n;let{applicationData:o}=e;const[a,r]=t.useState(!1);return i.useHistory(),l.createElement("div",{className:"accordion",style:{width:"100%",margin:"auto",fontFamily:"Roboto, sans-serif",border:"1px solid #ccc",borderRadius:"4px",marginBottom:"10px"}},l.createElement("div",{className:"accordion-header",style:{backgroundColor:"#f0f0f0",padding:"15px",cursor:"pointer"},onClick:()=>{r(!a)}},l.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"}},l.createElement("h3",{style:{color:"#0d43a7",fontFamily:"Noto Sans,sans-serif",fontSize:"24px",fontWeight:"500"}},"Application History"),l.createElement("span",{style:{fontSize:"1.2em"}},a?"<":">"))),a&&l.createElement("div",{className:"accordion-body",style:{padding:" 15px",backgroundColor:"#fff"}},l.createElement("div",{className:"assessment-item",style:{marginBottom:"15px"}},l.createElement("div",{className:"assessment-row",style:{display:"flex",gap:"100px",marginBottom:"8px"}},l.createElement("span",{style:{fontWeight:"bold",minWidth:"60px",color:"black"}},"Application Number"),l.createElement("span",{style:{flex:"1",color:"black"}},o.acknowldgementNumber)),l.createElement("div",{className:"assessment-row",style:{display:"flex",gap:"132px",marginBottom:"8px",color:"black"}},l.createElement("span",{className:"label",style:{fontWeight:"bold",minWidth:"60px",color:"black"}},"Property ID No."),l.createElement("span",{className:"value",style:{flex:"1",color:"black"}},o.propertyId)),l.createElement("div",{className:"assessment-row",style:{display:"flex",gap:"120px",marginBottom:"8px",color:"black"}},l.createElement("span",{className:"label",style:{fontWeight:"bold",minWidth:"60px",color:"black"}},"Application Type"),l.createElement("span",{className:"value",style:{flex:"1",color:"black"}},"NEW PROPERTY")),l.createElement("div",{className:"assessment-row",style:{display:"flex",gap:"140px",marginBottom:"8px",color:"black"}},l.createElement("span",{className:"label",style:{fontWeight:"bold",minWidth:"60px",color:"black"}},"Creation Date"),l.createElement("span",{className:"value",style:{flex:"1",color:"black"}},(u=null===(n=o.auditDetails)||void 0===n?void 0:n.createdTime,new Date(u).toLocaleDateString("en-GB",{day:"2-digit",month:"short",year:"numeric"}).replace(/ /g,"-")))),l.createElement("div",{className:"assessment-row",style:{display:"flex",gap:"180px",marginBottom:"8px",color:"black"}},l.createElement("span",{className:"label",style:{fontWeight:"bold",minWidth:"60px",color:"black"}},"Status"),l.createElement("span",{className:"value",style:{flex:"1",color:"black"}},o.status)),l.createElement("div",null,l.createElement(i.Link,{to:{pathname:"/digit-ui/citizen/pt/property/application-preview/"+o.acknowldgementNumber,state:{propertyId:o.propertyId}},style:{color:"#2947a3",display:"inline",border:"1px solid",padding:"8px",borderRadius:"8px"}},"View History")))));var u},Ki=e=>{let{payments:n}=e;const[i,o]=t.useState(!1);return l.createElement("div",{className:"accordion",style:{width:"100%",margin:"auto",fontFamily:"Roboto, sans-serif",border:"1px solid #ccc",borderRadius:"4px",marginBottom:"10px"}},l.createElement("div",{className:"accordion-header",style:{backgroundColor:"#f0f0f0",padding:"15px",cursor:"pointer"},onClick:()=>{o(!i)}},l.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"}},l.createElement("h3",{style:{color:"#0d43a7",fontFamily:"Noto Sans,sans-serif",fontSize:"24px",fontWeight:"500"}},"Payment History"),l.createElement("span",{style:{fontSize:"1.2em"}},i?"<":">"))),i&&l.createElement("div",{className:"accordion-body",style:{padding:" 15px",backgroundColor:"#fff"}},0===(null==n?void 0:n.length)&&l.createElement("div",{style:{color:"red",fontSize:"16px"}},"No Payemnts found")))};function Vi(e){var a,r,u,d,s,c,v,p,m,E,f,g,A,S,h,b;let{applicationDetails:y,demandData:C,workflowDetails:T,isDataLoading:D,applicationData:N,timelineStatusPrefix:P,showTimeLine:I=!0,statusAttribute:L="status",paymentsList:B,oldValue:O,isInfoLabel:R=!1,propertyId:w}=e;const{t:x}=n.useTranslation(),M=i.useHistory(),F=Digit.ULBService.getCurrentTenantId(),[k,U]=t.useState(null),[H,W]=t.useState([]);let j=window.location.href.includes("editApplication")&&window.location.href.includes("bpa");function $(e,t,l){var n;window.open(null==l||null===(n=l.fullImage)||void 0===n?void 0:n[0],"_blank")}console.log("appl",y);const[Y,z]=t.useState({}),[G,K]=t.useState(),[V,q]=t.useState([]),[X,J]=t.useState({loading:!1,loaded:!1,canLoad:!1});"ACTIVE"!=(null==N?void 0:N.status)||X.loading||X.loaded||X.canLoad||J({loading:!1,loaded:!1,canLoad:!0}),null==X||!X.canLoad||X.loading||X.loaded||(J({loading:!0,loaded:!1,canLoad:!0}),function(e,t,l,n){try{Promise.resolve(Digit.PTService.assessmentSearch({tenantId:e,filters:{propertyIds:t}})).then(function(i){function o(){l(a),n({loading:!1,loaded:!0,canLoad:!0})}let a={};const r=function(l){if((null==i||null===(l=i.Assessments)||void 0===l?void 0:l.length)>0){const l=i.Assessments.filter(e=>"ACTIVE"===e.status),n=new Map;l.forEach(e=>{const t=`${function(e){const t=new Date(e);return t.setHours(0,0,0,0),t.getTime()}(e.assessmentDate)}_${e.financialYear}`,l=n.get(t);(!l||e.createdDate>l.createdDate)&&n.set(t,e)}),console.log("grouped",n);const o=Array.from(n.values());return q(o),console.log(o),K(null==i?void 0:i.Assessments),Promise.resolve(Digit.PaymentService.fetchBill(e,{businessService:"PT",consumerCode:t})).then(function(e){a=e})}}();return r&&r.then?r.then(o):o()})}catch(e){return Promise.reject(e)}}((null==N?void 0:N.tenantId)||F,null==N?void 0:N.propertyId,z,J));const Z=e=>{if(null==e||null==e||""==e)return"NA";const t=new Date(e);let l=t.getMonth()+1,n=t.getDate();return l=(l>9?"":"0")+l,n=(n>9?"":"0")+n,`${n}/${l}/${t.getFullYear()}`},Q=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:Z(null==N||null===(i=N.auditDetails)||void 0===i?void 0:i.createdTime),source:(null==N?void 0:N.channel)||""};return l.createElement(Bi,{data:e})}if(window.location.href.includes("/obps/")||window.location.href.includes("/noc/")||window.location.href.includes("/ws/")){var o,a,r,u,d,s,c,v,p,m,E,f,g,A,S,h,b,C;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==y?void 0:y.tenantId,businessIds:null==y?void 0:y.applicationNo,history:!0},jsonPath:"ProcessInstances[0].assignes[0].mobileNumber",isArray:!1,d:e=>{let l="";return l="+91 "+_.get(e,`ProcessInstances[${t}].assignes[0].mobileNumber`),l}}},T=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===(d=u[0])||void 0===d?void 0:d.name,mobileNumber:(null==N||null===(s=N.processInstance)||void 0===s||null===(c=s.assignes)||void 0===c||null===(v=c[0])||void 0===v?void 0:v.uuid)===(null==e||null===(p=e.assignes)||void 0===p||null===(m=p[0])||void 0===m?void 0:m.uuid)&&null!=N&&null!==(E=N.processInstance)&&void 0!==E&&null!==(f=E.assignes)&&void 0!==f&&null!==(g=f[0])&&void 0!==g&&g.mobileNumber?null==N||null===(A=N.processInstance)||void 0===A||null===(S=A.assignes)||void 0===S||null===(h=S[0])||void 0===h?void 0:h.mobileNumber:null==e||null===(b=e.assignes)||void 0===b||null===(C=b[0])||void 0===C?void 0:C.mobileNumber,comment:x(null==e?void 0:e.comment),wfComment:T?T.wfComment:[],thumbnailsToShow:null==e?void 0:e.thumbnailsToShow};return l.createElement(Bi,{data:D,OpenImage:$,privacy:i})}{var T,D,P,I,L;const t={date:Z(null==N||null===(T=N.auditDetails)||void 0===T?void 0:T.lastModifiedTime),name:null==e||null===(D=e.assignes)||void 0===D||null===(P=D[0])||void 0===P?void 0:P.name,wfComment:null==e?void 0:e.wfComment,mobileNumber:null==e||null===(I=e.assignes)||void 0===I||null===(L=I[0])||void 0===L?void 0:L.mobileNumber};return l.createElement(Bi,{data:t})}},ee=(e,t)=>e?t?e:x(e):x("NA"),te=window.location.href.includes("employee/tl")||window.location.href.includes("employee/obps")||window.location.href.includes("employee/noc"),le=window.location.href.includes("employee/noc"),ne=window.location.href.includes("employee/obps"),ie=(window.location.href.includes("employee/ws"),()=>window.location.href.includes("employee/obps")||window.location.href.includes("employee/noc")||te?{justifyContent:"space-between",fontSize:"16px",lineHeight:"19px",color:"#0B0C0C"}:{}),oe=e=>null!=e&&e.skip?e.value:null!=e&&e.isUnit?null!=e&&e.value?`${ee(null==e?void 0:e.value,null==e?void 0:e.isNotTranslated)} ${x(null==e?void 0:e.isUnit)}`:x("N/A"):null!=e&&e.value?ee(null==e?void 0:e.value,null==e?void 0:e.isNotTranslated):x("N/A"),[ae,re]=t.useState(!1);console.log("demand Data arr",C),null==C||C.reduce((e,t)=>e+t.demandInterest,0),null==C||C.reduce((e,t)=>e+t.demandPenality,0),null==C||C.reduce((e,t)=>e+t.collectionTax,0),null==C||C.reduce((e,t)=>e+t.collectionInterest,0),null==C||C.reduce((e,t)=>e+t.collectionPenality,0),null==C||C.reduce((e,t)=>e+t.balanceTax,0),null==C||C.reduce((e,t)=>e+t.balanceInterest,0),null==C||C.reduce((e,t)=>e+t.balancePenality,0);const ue=function(e,t,l){try{if(!window.confirm(`Are you sure you want to make this property ${t}?`))return Promise.resolve();const n={...e,status:t,isactive:"ACTIVE"===t,isinactive:"INACTIVE"===t,creationReason:"STATUS",additionalDetails:{...e.additionalDetails,propertytobestatus:t},workflow:{...e.workflow,businessService:"PT.CREATE",action:"OPEN",moduleName:"PT"}};return Promise.resolve(Digit.PTService.updatePT({Property:{...n}},F,l)).then(function(e){console.log("response from inactive/active",e)})}catch(e){return Promise.reject(e)}},de=null==y?void 0:y.applicationData,se=(null==y||null===(a=y.applicationData)||void 0===a?void 0:a.propertyId)||"",ce=null==y||null===(r=y.additionalDetails)||void 0===r?void 0:r.propertytobestatus;return console.log("applicationDetails?.applicationDetails",y),console.log("infolabel",R),console.log("assessment details",G),t.useEffect(()=>{try{Digit.PTService.paymentsearch({tenantId:F,filters:{consumerCodes:w},auth:!0}).then(e=>{W(null==e?void 0:e.Payments),console.log(e)})}catch(e){console.log(e)}},[]),l.createElement(o.Card,{style:{position:"relative"},className:"employeeCard-override"},R?l.createElement(Ui,{t:x,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==y||null===(u=y.applicationDetails)||void 0===u?void 0:u.map((e,n)=>{var a,r,u,d,s,c,v,p,m,E,f,_,g,A,S,h,b,C,D,N,P,I,L,R,w,M,F,k,U,H,W,$,z,G,K,V,q,X;return l.createElement(l.Fragment,{key:n},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"}:te?{lineHeight:"19px",maxWidth:"600px",minWidth:"280px"}:{}},0!==n||e.asSectionHeader?l.createElement(l.Fragment,null,l.createElement(o.CardSectionHeader,{style:0==n&&te?{marginBottom:"16px",fontSize:"24px"}:{marginBottom:"16px",marginTop:"32px",fontSize:"24px"}},le?""+x(e.title):x(e.title),null!=e&&e.Component?l.createElement(e.Component,null):null)):l.createElement(o.CardSubHeader,{style:{marginBottom:"16px",fontSize:"24px"}},x(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"}},x(e)))),null==e?void 0:e.tableRows.map((n,i)=>i===(null==e?void 0:e.tableRows.length)-1?l.createElement(t.Fragment,null,l.createElement("hr",{style:{width:"370%",marginTop:"15px"},className:"underline"}),l.createElement("tr",null,n.map(e=>l.createElement("td",{style:{textAlign:"left"}},x(e))))):l.createElement("tr",null,n.map(e=>l.createElement("td",{style:{paddingTop:"20px",textAlign:"left"}},x(e)))))),l.createElement(o.StatusTable,{style:window.location.href.includes("employee/obps")||window.location.href.includes("employee/noc")||te?{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((t,n)=>{var a,r,u;return!0===t.map&&"N/A"!==t.value?l.createElement(o.Row,{labelStyle:{wordBreak:"break-all"},textStyle:{wordBreak:"break-all"},key:x(t.title),label:x(t.title),text:l.createElement("img",{src:x(t.value),alt:"",privacy:null==t?void 0:t.privacy})}):1==(null==t?void 0:t.isLink)?l.createElement(o.Row,{key:x(t.title),label:window.location.href.includes("tl")||window.location.href.includes("ws")?l.createElement("div",{style:{width:"200%"}},l.createElement(i.Link,{to:null==t?void 0:t.to},l.createElement("span",{className:"link",style:{color:"#a82227"}},x(null==t?void 0:t.title)))):le||ne?""+x(t.title):x(t.title),text:l.createElement("div",null,l.createElement(i.Link,{to:null==t?void 0:t.to},l.createElement("span",{className:"link",style:{color:"#a82227"}},null==t?void 0:t.value))),last:n===(null==e||null===(u=e.values)||void 0===u?void 0:u.length)-1,caption:t.caption,className:"border-none",rowContainerStyle:ie(),labelStyle:{wordBreak:"break-all"},textStyle:{wordBreak:"break-all"}}):l.createElement("div",null,window.location.href.includes("modify")?l.createElement(o.Row,{className:"border-none",key:""+t.title,label:""+x(""+t.title),privacy:null==t?void 0:t.privacy,text:null!=t&&t.oldValue?null==t?void 0:t.oldValue:null!=t&&t.value?null==t?void 0:t.value:"",labelStyle:{wordBreak:"break-all"},textStyle:{wordBreak:"break-all"}}):l.createElement(o.Row,{key:x(t.title),label:x(t.title),text:oe(t),last:n===(null==e||null===(a=e.values)||void 0===a?void 0:a.length)-1,caption:t.caption,className:"border-none",privacy:null==t?void 0:t.privacy,rowContainerStyle:ie(),labelStyle:{wordBreak:"break-all"},textStyle:{wordBreak:"break-all"}}),"PT_TOTAL_DUES"===t.title?l.createElement(Yi,{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(pn,{scrutinyDetails:null==e?void 0:e.additionalDetails,paymentsList:B,additionalDetails:null==y||null===(u=y.applicationData)||void 0===u?void 0:u.additionalDetails,applicationData:null==y?void 0:y.applicationData}),(null==y||null===(d=y.applicationData)||void 0===d||null===(s=d.additionalDetails)||void 0===s||null===(c=s.fieldinspection_pending)||void 0===c?void 0:c.length)>0&&(null==e||null===(v=e.additionalDetails)||void 0===v?void 0:v.fiReport)&&l.createElement(vn,{fiReport:null==y||null===(p=y.applicationData)||void 0===p||null===(m=p.additionalDetails)||void 0===m?void 0:m.fieldinspection_pending}),(null==e||null===(E=e.additionalDetails)||void 0===E?void 0:E.floors)&&l.createElement(Pi,{floors:null==e||null===(f=e.additionalDetails)||void 0===f?void 0:f.floors}),(null==e||null===(_=e.additionalDetails)||void 0===_?void 0:_.owners)&&l.createElement(Ii,{owners:null==e||null===(g=e.additionalDetails)||void 0===g?void 0:g.owners}),(null==e||null===(A=e.additionalDetails)||void 0===A?void 0:A.units)&&l.createElement(Ri,{units:null==e||null===(S=e.additionalDetails)||void 0===S?void 0:S.units}),(null==e||null===(h=e.additionalDetails)||void 0===h?void 0:h.accessories)&&l.createElement(Oi,{units:null==e||null===(b=e.additionalDetails)||void 0===b?void 0:b.accessories}),!j&&(null==e||null===(C=e.additionalDetails)||void 0===C?void 0:C.permissions)&&(null==T||null===(D=T.data)||void 0===D||null===(N=D.nextActions)||void 0===N?void 0:N.length)>0&&l.createElement(Di,{applicationData:null==y?void 0:y.applicationData,t:x,permissions:null==e||null===(P=e.additionalDetails)||void 0===P?void 0:P.permissions}),(null==e||null===(I=e.additionalDetails)||void 0===I?void 0:I.obpsDocuments)&&l.createElement("div",{style:{display:"flex"}},l.createElement(bi,{t:x,applicationData:null==y?void 0:y.applicationData,docs:e.additionalDetails.obpsDocuments,bpaActionsDetails:T})),(null==e||null===(L=e.additionalDetails)||void 0===L?void 0:L.noc)&&l.createElement(Ti,{t:x,isNoc:!0,NOCdata:e.values,applicationData:null==y?void 0:y.applicationData,docs:e.additionalDetails.noc,noc:null===(R=e.additionalDetails)||void 0===R?void 0:R.data,bpaActionsDetails:T}),(null==e||null===(w=e.additionalDetails)||void 0===w?void 0:w.scruntinyDetails)&&l.createElement(pn,{scrutinyDetails:null==e?void 0:e.additionalDetails}),(null==e||null===(M=e.additionalDetails)||void 0===M?void 0:M.buildingExtractionDetails)&&l.createElement(pn,{scrutinyDetails:null==e?void 0:e.additionalDetails}),(null==e||null===(F=e.additionalDetails)||void 0===F?void 0:F.subOccupancyTableDetails)&&l.createElement(cn,{edcrDetails:null==e?void 0:e.additionalDetails,applicationData:null==y?void 0:y.applicationData}),(null==e||null===(k=e.additionalDetails)||void 0===k?void 0:k.documentsWithUrl)&&l.createElement(zl,{documents:null==e||null===(U=e.additionalDetails)||void 0===U?void 0:U.documentsWithUrl}),(null==e||null===(H=e.additionalDetails)||void 0===H?void 0:H.taxHeadEstimatesCalculation)&&l.createElement(Ni,{taxHeadEstimatesCalculation:null==e||null===(W=e.additionalDetails)||void 0===W?void 0:W.taxHeadEstimatesCalculation}),(null==e?void 0:e.isWaterConnectionDetails)&&l.createElement(wi,{wsAdditionalDetails:e,oldValue:O}),(null==e||null===($=e.additionalDetails)||void 0===$?void 0:$.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===(G=z.redirectUrl)||void 0===G?void 0:G.url},l.createElement("span",{className:"link",style:{color:"#a82227"}},null==e||null===(K=e.additionalDetails)||void 0===K||null===(V=K.redirectUrl)||void 0===V?void 0:V.title))),(null==e||null===(q=e.additionalDetails)||void 0===q?void 0:q.estimationDetails)&&l.createElement(Fi,{wsAdditionalDetails:e,workflowDetails:T}),(null==e||null===(X=e.additionalDetails)||void 0===X?void 0:X.estimationDetails)&&l.createElement(Hi,{wsAdditionalDetails:e,workflowDetails:T}))}),(null==G?void 0:G.length)>0&&l.createElement(zi,{assessmentData:V}),l.createElement(Ki,{payments:H}),l.createElement(Gi,{applicationData:null==y?void 0:y.applicationData}),I&&(null==T||null===(d=T.data)||void 0===d||null===(s=d.timeline)||void 0===s?void 0:s.length)>0&&l.createElement(l.Fragment,null,l.createElement(o.BreakLine,null),((null==T?void 0:T.isLoading)||D)&&l.createElement(o.Loader,null),!(null!=T&&T.isLoading)&&!D&&l.createElement(t.Fragment,null,l.createElement("div",{id:"timeline"},l.createElement(o.CardSectionHeader,{style:{marginBottom:"16px",marginTop:"32px"}},x("ES_APPLICATION_DETAILS_APPLICATION_TIMELINE")),null!=T&&null!==(c=T.data)&&void 0!==c&&c.timeline&&1===(null==T||null===(v=T.data)||void 0===v||null===(p=v.timeline)||void 0===p?void 0:p.length)?l.createElement(o.CheckPoint,{isCompleted:!0,label:x(`${P}${null==T||null===(m=T.data)||void 0===m||null===(E=m.timeline[0])||void 0===E?void 0:E.state}`),customChild:Q(null==T||null===(f=T.data)||void 0===f?void 0:f.timeline[0],null==T||null===(g=T.data)||void 0===g?void 0:g.timeline)}):l.createElement(o.ConnectingCheckPoints,null,(null==T||null===(A=T.data)||void 0===A?void 0:A.timeline)&&(null==T||null===(S=T.data)||void 0===S?void 0:S.timeline.slice(0,ae?null==T?void 0:T.data.timeline.length:2).map((e,t,n)=>{var i;let a="";var r,u,d,s,c,v;return window.location.href.includes("/obps/")&&(a=null!=T&&null!==(r=T.data)&&void 0!==r&&null!==(u=r.timeline[t-1])&&void 0!==u&&null!==(d=u.state)&&void 0!==d&&d.includes("BACK_FROM")||null!=T&&null!==(s=T.data)&&void 0!==s&&null!==(c=s.timeline[t-1])&&void 0!==c&&null!==(v=c.state)&&void 0!==v&&v.includes("SEND_TO_CITIZEN")?"_NOT_DONE":"SEND_TO_ARCHITECT"===(null==e?void 0:e.performedAction)?"_BY_ARCHITECT_DONE":0==t?"":"_DONE"),l.createElement(l.Fragment,{key:t},l.createElement(o.CheckPoint,{keyValue:t,isCompleted:0===t,info:e.comment,label:x(`${P}${"REOPEN"===(null==e?void 0:e.performedAction)?null==e?void 0:e.performedAction:null==e?void 0:e[L]}${a}`),customChild:Q(e,t,null==T||null===(i=T.data)||void 0===i?void 0:i.timeline)}))}))),(null==T||null===(h=T.data)||void 0===h||null===(b=h.timeline)||void 0===b?void 0:b.length)>2&&l.createElement(o.LinkButton,{label:x(ae?"COLLAPSE":"VIEW_TIMELINE"),onClick:()=>{re(e=>!e)}})))),window.location.href.includes("/pt/")?l.createElement(o.ActionBar,{className:"clear-search-container",style:{display:"block"}},l.createElement(o.SubmitBar,{label:"Make Property Active",style:{flex:1},onSubmit:()=>{window.location.href.includes("employee")?"INACTIVE"==ce?ue(de,"ACTIVE",se):alert("Property is already active."):alert("You are not authorized to change the property status.")}}),l.createElement(o.SubmitBar,{label:"Make Property Inactive",style:{marginLeft:"20px"},onSubmit:()=>{window.location.href.includes("employee")?"ACTIVE"==ce?ue(de,"INACTIVE",se):alert("Property is already inactive."):alert("You are not authorized to change the property status.")}}),l.createElement(o.SubmitBar,{label:"Edit Property",style:{marginLeft:"20px"},onSubmit:()=>{var e;const t=null==y||null===(e=y.applicationData)||void 0===e?void 0:e.propertyId;if(t)if(window.location.href.includes("employee")){var l,n,i;if("INACTIVE"===(null==y||null===(l=y.applicationData)||void 0===l?void 0:l.status))return void alert("Property is inactive, cannot edit.");if("INWORKFLOW"===(null==y||null===(n=y.applicationData)||void 0===n?void 0:n.status))return void alert("Property is in workflow, cannot edit.");"ACTIVE"===(null==y||null===(i=y.applicationData)||void 0===i?void 0:i.status)&&M.push({pathname:"/digit-ui/employee/pt/edit-application/"+t})}else{var o,a,r;if("INACTIVE"===(null==y||null===(o=y.applicationData)||void 0===o?void 0:o.status))return void alert("Property is inactive, cannot edit.");if("INWORKFLOW"===(null==y||null===(a=y.applicationData)||void 0===a?void 0:a.status))return void alert("Property is in workflow, cannot edit.");"ACTIVE"===(null==y||null===(r=y.applicationData)||void 0===r?void 0:r.status)&&M.push({pathname:"/digit-ui/citizen/pt/property/edit-application/"+t})}}}),l.createElement(o.SubmitBar,{label:"Access Property",style:{marginLeft:"20px"},onSubmit:()=>{alert("access property")}})):l.createElement("div",null),k&&l.createElement(o.Toast,{error:k.isError,label:x(k.label),onClose:()=>{U(null)},isDleteBtn:"false"}))}function qi(e){var t,n,i,a,r,u,d,s,c,v,p,m,E,f,_,g,A,S;let{t:h,showToast:b,closeToast:y,businessService:C}=e;if(null!=C&&C.includes("NewTL")||null!=C&&C.includes("TL")||null!=C&&C.includes("EDITRENEWAL")){var T;let e="";switch(null==b||null===(T=b.action)||void 0===T?void 0:T.action){case"SENDBACK":e="error"===(null==b?void 0:b.key)?null==b||null===(t=b.error)||void 0===t?void 0:t.message:h("TL_SENDBACK_CHECKLIST_MESSAGE_HEAD");break;case"FORWARD":e="error"===(null==b?void 0:b.key)?null==b||null===(n=b.error)||void 0===n?void 0:n.message:h("TL_FORWARD_SUCCESS_MESSAGE_MAIN");break;case"APPROVE":e="error"===(null==b?void 0:b.key)?null==b||null===(i=b.error)||void 0===i?void 0:i.message:h("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:h("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:h("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:h("TL_APPLICATION_RESUBMIT_SUCCESS_MESSAGE_MAIN");break;case"CANCEL":e="error"===(null==b?void 0:b.key)?null==b||null===(d=b.error)||void 0===d?void 0:d.message:h("TL_TL_CANCELLED_MESSAGE_HEAD");break;default:e="error"===(null==b?void 0:b.key)?null==b||null===(s=b.error)||void 0===s?void 0:s.message:h(`ES_${C}_${null==b||null===(c=b.action)||void 0===c?void 0:c.action}_UPDATE_SUCCESS`)}return l.createElement(l.Fragment,null,b&&l.createElement(o.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 D;const e=function(e){var t;void 0===e&&(e=[]);let l=e[0];return l=2==(null===(t=e)||void 0===t?void 0:t.length)&&null!=C&&C.includes("BPA_OC")?h(e[1]):h(e[0]),l};let t="";switch(null==b||null===(D=b.action)||void 0===D?void 0:D.action){case"REVOCATE":t="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":t="error"===(null==b?void 0:b.key)?null==b||null===(p=b.error)||void 0===p?void 0:p.message:e(["BPA_FORWARD_SUCCESS_MESSAGE_MAIN"]);break;case"SEND_BACK_TO_CITIZEN":t="error"===(null==b?void 0:b.key)?null==b||null===(m=b.error)||void 0===m?void 0:m.message:e(["BPA_SENDBACK_SUCCESS_MESSAGE_MAIN"]);break;case"APPROVE":t="error"===(null==b?void 0:b.key)?null==b||null===(E=b.error)||void 0===E?void 0:E.message:e(["BPA_APPROVAL_CHECKLIST_MESSAGE_HEAD"]);break;case"REJECT":t="error"===(null==b?void 0:b.key)?null==b||null===(f=b.error)||void 0===f?void 0:f.message:e(["BPA_APPROVAL_REJECTED_MESSAGE_HEAD","BPA_OC_APPROVAL_REJECTED_MESSAGE_HEAD"]);break;case"FORWARD":t="error"===(null==b?void 0:b.key)?null==b||null===(_=b.error)||void 0===_?void 0:_.message:e(["BPA_FORWARD_SUCCESS_MESSAGE_MAIN"]);break;case"SEND_BACK_FOR_DOCUMENT_VERIFICATION":case"SEND_BACK_FOR_FIELD_INSPECTION":t="error"===(null==b?void 0:b.key)?null==b||null===(g=b.error)||void 0===g?void 0:g.message:e(["BPA_SENDBACK_SUCCESS_MESSAGE_MAIN"]);break;default:t="error"===(null==b?void 0:b.key)?null==b||null===(A=b.error)||void 0===A?void 0:A.message:h(`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(o.Toast,{error:"error"===b.key,label:t,onClose:y}))}{var N,P;const e="error"===(null==b?void 0:b.key)?null==b||null===(N=b.error)||void 0===N?void 0:N.message:`ES_${C}_${null==b||null===(P=b.action)||void 0===P?void 0:P.action}_UPDATE_SUCCESS`;return l.createElement(l.Fragment,null,b&&l.createElement(o.Toast,{error:"error"===b.key,label:h(e),onClose:y}))}}function Xi(e){var i,a,r,u,d,s,c,v,p,m,E,f,_,g,A,S;let{workflowDetails:h,displayMenu:b,onActionSelect:y,setDisplayMenu:C,businessService:T,forcedActionPrefix:D,ActionBarStyle:N={},MenuStyle:P={}}=e;const{t:I}=n.useTranslation();let L=Digit.UserService.getUser();const B=t.useRef();if(window.location.href.includes("/obps")||window.location.href.includes("/noc")){const e=sessionStorage.getItem("Digit.citizen.userRequestObject"),t=e?JSON.parse(e):{};L=null==t?void 0:t.value}const O=null===(i=L)||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,w=!1,x=(null==h||null===(u=h.data)||void 0===u||null===(d=u.actionState)||void 0===d||null===(s=d.nextActions)||void 0===s?void 0:s.filter(e=>(null==O?void 0:O.some(t=>{var l;return null===(l=e.roles)||void 0===l?void 0:l.includes(t)}))||!e.roles))||(null==h||null===(c=h.data)||void 0===c||null===(v=c.nextActions)||void 0===v?void 0:v.filter(e=>(null==O?void 0:O.some(t=>{var l;return null===(l=e.roles)||void 0===l?void 0:l.includes(t)}))||!e.roles));return Digit.Hooks.useClickOutside(B,()=>{C(!1)},b),(window.location.href.includes("/obps")||window.location.href.includes("/noc"))&&1==(null==x?void 0:x.length)||null!=x&&null!==(p=x[0])&&void 0!==p&&null!==(m=p.redirectionUrl)&&void 0!==m&&m.pathname.includes("/pt/property-details/")&&1==(null==x?void 0:x.length)?(w=!1,R=!0):(null==x?void 0:x.length)>0&&(w=!0,R=!1),l.createElement(l.Fragment,null,!(null!=h&&h.isLoading)&&w&&!R&&l.createElement(o.ActionBar,{style:{...N}},b&&(null!=h&&null!==(E=h.data)&&void 0!==E&&null!==(f=E.actionState)&&void 0!==f&&f.nextActions||null!=h&&null!==(_=h.data)&&void 0!==_&&_.nextActions)?l.createElement(o.Menu,{localeKeyPrefix:D||"WF_EMPLOYEE_"+(null==T?void 0:T.toUpperCase()),options:x,optionKey:"action",t:I,onSelect:y,style:P}):null,l.createElement(o.SubmitBar,{ref:B,label:I("WF_TAKE_ACTION"),onSubmit:()=>C(!b)})),!(null!=h&&h.isLoading)&&!w&&R&&l.createElement(o.ActionBar,{style:{...N}},l.createElement("button",{style:{color:"#FFFFFF",fontSize:"18px"},className:"submit-bar",name:null==x||null===(g=x[0])||void 0===g?void 0:g.action,value:null==x||null===(A=x[0])||void 0===A?void 0:A.action,onClick:e=>{y((null==x?void 0:x[0])||{})}},I(`${D||"WF_EMPLOYEE_"+(null==T?void 0:T.toUpperCase())}_${null==x||null===(S=x[0])||void 0===S?void 0:S.action}`))))}const Ji=()=>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"})),Zi=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(Ji,null));function Qi(e){let{action:t,closeWarningPopup:i}=e;const{t:a}=n.useTranslation(),r=window.Digit.Utils.browser.isMobile();return l.createElement(l.Fragment,null,l.createElement(o.Modal,{headerBarMain:l.createElement("h1",{className:"heading-m"},a("PT_DUES_ARE_PENDING")),headerBarEnd:l.createElement(Zi,{onClick:()=>{i()}}),hideSubmit:!0,isDisabled:!1,popupStyles:r?{}:{width:"29%",marginTop:"auto"}},l.createElement(o.Card,null,l.createElement("div",{style:{marginBottom:"30px"}},l.createElement("h1",null,a("PT_YOU_HAVE")," ₹",null==t?void 0:t.AmountDueForPay," ",a("PT_DUE_WARNING_MSG2"))),l.createElement(o.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==t?void 0:t.AmountDueForPay)}),l.createElement("div",{style:{width:"100%",display:"flex",justifyContent:"flex-end"}},l.createElement(o.ButtonSelector,{theme:"border",label:a("ES_PT_COMMON_CANCEL"),onSubmit:i,style:{marginLeft:"10px"}}),l.createElement(o.ButtonSelector,{label:a("PT_COLLECT"),onSubmit:()=>{var e;return window.location.assign(`${window.location.origin}${null==t||null===(e=t.redirectionUrl)||void 0===e?void 0:e.pathname}`)},style:{marginLeft:"10px"}})))),")")}const eo=e=>{var a,r;console.log("props",e);let d=window.location.href.includes("editApplication")&&window.location.href.includes("bpa");const s=Digit.ULBService.getCurrentTenantId(),v=Digit.ULBService.getStateId(),{data:p}=Digit.Hooks.obps.useMDMS(v,"BPA",["BlockReason"]),{t:m}=n.useTranslation(),E=i.useHistory();let{id:f}=i.useParams();const[_,g]=t.useState(!1),[A,S]=t.useState(null),[h,b]=t.useState(!1),[y,C]=t.useState(!1),[T,D]=t.useState(!1),{data:N}=Digit.Hooks.obps.useMDMS(v,"BPA",["RiskTypeComputation"]),{applicationDetails:P,demandData:I,totalDemandTax:L,totalBalanceTax:B,showToast:O,setShowToast:R,isLoading:w,isDataLoading:x,applicationData:M,mutate:F,nocMutation:k,workflowDetails:U,id:H,businessService:W,closeToast:j,moduleCode:$,timelineStatusPrefix:Y,forcedActionPrefix:z,statusAttribute:G,ActionBarStyle:K,MenuStyle:V,paymentsList:q,showTimeLine:X=!0,oldValue:J,isInfoLabel:Z=!1,clearDataDetails:Q,propertyId:ee}=e;t.useEffect(()=>{O&&U.revalidate()},[O]);const te=u.useQueryClient(),le=()=>{S(null),b(!1)};return w||y?l.createElement(o.Loader,null):l.createElement(l.Fragment,null,w?l.createElement(o.Loader,null):l.createElement(l.Fragment,null,l.createElement(Vi,{applicationDetails:P,demandData:I,id:H,workflowDetails:U,isDataLoading:x,applicationData:M,totalDemandTax:L,totalBalanceTax:B,businessService:W,timelineStatusPrefix:Y,statusAttribute:G,paymentsList:q,showTimeLine:X,oldValue:J,isInfoLabel:Z,propertyId:ee}),h?l.createElement(hi,{t:m,action:A,tenantId:s,state:v,id:f,applicationDetails:P,applicationData:null==P?void 0:P.applicationData,closeModal:le,submitAction:function(e,t,l){void 0===t&&(t=!1),void 0===l&&(l={});try{let n=!1;const i=function(i,o,a,r,u,d,s,v,p,f,_,g,S,h,b,y,T,D){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===(d=e.Licenses)||void 0===d||null===(s=d[0])||void 0===s||null===(v=s.additionalDetail)||void 0===v||null===(p=v.validityYears)||void 0===p?void 0:p.length):0==(null==e||null===(f=e.Licenses)||void 0===f||null===(_=f[0])||void 0===_||null===(g=_.comment)||void 0===g?void 0:g.length))||0==(null==e||null===(S=e.WaterConnection)||void 0===S||null===(h=S.comment)||void 0===h?void 0:h.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===(T=e.BPA)||void 0===T||null===(D=T.comment)||void 0===D?void 0:D.length)){var N,P;"INITIATE"===(null==e||null===(N=e.Licenses)||void 0===N||null===(P=N[0])||void 0===P?void 0:P.action)?alert(m("Please fill in the validity before submitting")):alert(m("Please fill in the comments before submitting"))}else{const i=function(i,o,a,r,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 d(t){if(n)return t;F&&(C(!0),F(e,{onError:(e,t)=>{C(!1),R({key:"error",error:e}),setTimeout(j,5e3)},onSuccess:(e,t)=>{var n,i,o,a,r,u;if(sessionStorage.removeItem("WS_SESSION_APPLICATION_DETAILS"),C(!1),null!==(n=l)&&void 0!==n&&n.bpa&&(e.selectedAction=A,E.replace("/digit-ui/employee/obps/response",{data:e})),null!==(i=l)&&void 0!==i&&i.isStakeholder&&(e.selectedAction=A,E.push("/digit-ui/employee/obps/stakeholder-response",{data:e})),null!==(o=l)&&void 0!==o&&o.isNoc&&E.push("/digit-ui/employee/noc/response",{data:e}),(null==e||null===(a=e.Amendments)||void 0===a?void 0:a.length)>0){var d,s,c,v,p,f,_,g;null!=t&&null!==(d=t.AmendmentUpdate)&&void 0!==d&&null!==(s=d.workflow)&&void 0!==s&&s.action.includes("SEND_BACK")?R({key:"success",label:m("ES_MODIFYSWCONNECTION_SEND_BACK_UPDATE_SUCCESS")}):null!=t&&null!==(c=t.AmendmentUpdate)&&void 0!==c&&null!==(v=c.workflow)&&void 0!==v&&v.action.includes("RE-SUBMIT")?R({key:"success",label:m("ES_MODIFYSWCONNECTION_RE_SUBMIT_UPDATE_SUCCESS")}):null!=t&&null!==(p=t.AmendmentUpdate)&&void 0!==p&&null!==(f=p.workflow)&&void 0!==f&&f.action.includes("APPROVE")?R({key:"success",label:m("ES_MODIFYSWCONNECTION_APPROVE_UPDATE_SUCCESS")}):null!=t&&null!==(_=t.AmendmentUpdate)&&void 0!==_&&null!==(g=_.workflow)&&void 0!==g&&g.action.includes("REJECT")&&R({key:"success",label:m("ES_MODIFYWSCONNECTION_REJECT_UPDATE_SUCCESS")})}else{var S;if((null==e||null===(r=e.Licenses)||void 0===r?void 0:r.length)>0&&null!=e&&null!==(u=e.Licenses[0])&&void 0!==u&&u.applicationNumber)return R({key:"success",action:A}),void E.replace("/digit-ui/employee/tl/application-details/"+(null==e||null===(S=e.Licenses[0])||void 0===S?void 0:S.applicationNumber));R({key:"success",action:A}),Q&&setTimeout(Q,3e3),setTimeout(j,5e3),te.clear(),te.refetchQueries("APPLICATION_SEARCH")}}})),le()}C(!0),"function"==typeof(null==e?void 0:e.customFunctionToExecute)&&(null==e||e.customFunctionToExecute({...e}));const i=function(){if(!1!==t&&k){var e;const l=null===(e=t)||void 0===e?void 0:e.map(e=>null==k?void 0:k.mutateAsync(e)),i=c(function(){return C(!0),Promise.resolve(Promise.all(l)).then(function(e){e&&e.map(e=>{var t,l;Digit.SessionStorage.del(null==e||null===(t=e.Noc)||void 0===t||null===(l=t[0])||void 0===l?void 0:l.nocType)})})},function(e){var t,l,i,o,a,r,u,d,s,c,v,p;C(!1);let E=null!=e&&null!==(t=e.response)&&void 0!==t&&null!==(l=t.data)&&void 0!==l&&null!==(i=l.Errors)&&void 0!==i&&null!==(o=i[0])&&void 0!==o&&o.code?m(null==e||null===(a=e.response)||void 0===a||null===(r=a.data)||void 0===r||null===(u=r.Errors)||void 0===u||null===(d=u[0])||void 0===d?void 0:d.code):(null==e||null===(s=e.response)||void 0===s||null===(c=s.data)||void 0===c||null===(v=c.Errors)||void 0===v||null===(p=v[0])||void 0===p?void 0:p.message)||e;le(),R({key:"error",error:{message:E}}),setTimeout(j,5e3),n=!0});if(i&&i.then)return i.then(function(){})}}();return i&&i.then?i.then(d):d(i)}alert(m("Please select Blocking reason"))}();if(i&&i.then)return i.then(function(){})}}();return Promise.resolve(i&&i.then?i.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},actionData:null==U||null===(a=U.data)||void 0===a?void 0:a.timeline,businessService:W,workflowDetails:U,moduleCode:$,blockReason:null==p||null===(r=p.BPA)||void 0===r?void 0:r.BlockReason}):null,T?l.createElement(Qi,{action:A,workflowDetails:U,businessService:W,isWarningPop:T,closeWarningPopup:()=>{D(!1)}}):null,l.createElement(qi,{t:m,showToast:O,closeToast:j,businessService:W}),l.createElement("div",null,d?l.createElement(o.SubmitBar,{style:{marginRight:20},label:m("BPA_EDIT_UPDATE"),onSubmit:function(e){try{return Promise.resolve(Digit.OBPSService.BPASearch(s,{applicationNo:null==M?void 0:M.applicationNo})).then(function(e){var t,l,n,i,o,a;const r=Digit.Utils.obps.calculateRiskType(null==N||null===(t=N.BPA)||void 0===t?void 0:t.RiskTypeComputation,null==P||null===(l=P.edcrDetails)||void 0===l||null===(n=l.planDetail)||void 0===n||null===(i=n.plot)||void 0===i?void 0:i.area,null==P||null===(o=P.edcrDetails)||void 0===o||null===(a=o.planDetail)||void 0===a?void 0:a.blocks),u={BPA:e.BPA[0]};u.BPA.riskType=r,u.BPA.workflow={action:"EDIT PAY 2",assignes:[],comments:null,varificationDocuments:null},u.BPA.additionalDetails.selfCertificationCharges.BPA_DEVELOPMENT_CHARGES=sessionStorage.getItem("development")||"0",u.BPA.additionalDetails.selfCertificationCharges.BPA_OTHER_CHARGES=sessionStorage.getItem("otherCharges")||"0",u.BPA.additionalDetails.selfCertificationCharges.BPA_LESS_ADJUSMENT_PLOT=sessionStorage.getItem("lessAdjusment")||"0",u.BPA.additionalDetails.otherFeesDiscription=sessionStorage.getItem("otherChargesDisc"),u.BPA.additionalDetails.lessAdjustmentFeeFiles=JSON.parse(sessionStorage.getItem("uploadedFileLess"));const d=function(e,t,l,n,i,o,a,r,d,c,v,p){if(!(parseInt(sessionStorage.getItem("lessAdjusment"))>parseInt(sessionStorage.getItem("development"))+parseInt(sessionStorage.getItem("otherCharges"))+parseInt(null==u||null===(e=u.BPA)||void 0===e||null===(t=e.additionalDetails)||void 0===t||null===(l=t.selfCertificationCharges)||void 0===l?void 0:l.BPA_MALBA_CHARGES)+parseInt(null==u||null===(n=u.BPA)||void 0===n||null===(i=n.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===(d=r.selfCertificationCharges)||void 0===d?void 0:d.BPA_WATER_CHARGES)+parseInt(null==u||null===(c=u.BPA)||void 0===c||null===(v=c.additionalDetails)||void 0===v||null===(p=v.selfCertificationCharges)||void 0===p?void 0:p.BPA_GAUSHALA_CHARGES_CESS)))return Promise.resolve(Digit.OBPSService.update(u,s)).then(function(e){window.location.assign(window.location.href.split("/editApplication")[0]+window.location.href.split("editApplication")[1])});alert(m("Enterd Less Adjustment amount is invalid"))}();if(d&&d.then)return d.then(function(){})})}catch(e){return Promise.reject(e)}},id:!0}):!(window.location.href.includes("citizen")&&window.location.href.includes("/pt/"))&&l.createElement(Xi,{workflowDetails:U,displayMenu:_,onActionSelect:function(e){var t,l,n;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)D(!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))E.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 d,s;E.push(""+(null==e||null===(d=e.redirectionUrll)||void 0===d?void 0:d.pathname),{data:null==e||null===(s=e.redirectionUrll)||void 0===s?void 0:s.state})}else{var c;window.location.assign(`${window.location.origin}/digit-ui/employee/payment/collect/${null==e||null===(c=e.redirectionUrll)||void 0===c?void 0:c.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===(l=t.state)||void 0===l||null===(n=l.applicationData)||void 0===n?void 0:n.workflowCode))console.log("Got Inside Direct"),b(!0);else{var v,p;E.push({pathname:null===(v=e.redirectionUrl)||void 0===v?void 0:v.pathname,state:{...null===(p=e.redirectionUrl)||void 0===p?void 0:p.state}})}else b(!0);S(e),g(!1)},setDisplayMenu:g,businessService:W,forcedActionPrefix:z,ActionBarStyle:K,MenuStyle:V}))))},to=[{head:"",body:[{type:"component",component:"InspectionReport",key:"FieldReports",withoutLabel:!0,hideInCitizen:!0}]}];var lo=function(e){return"symbol"==typeof e||ie(e)&&"[object Symbol]"==O(e)},no=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,io=/^\w*$/,oo=function(e,t){if(se(e))return!1;var l=typeof e;return!("number"!=l&&"symbol"!=l&&"boolean"!=l&&null!=e&&!lo(e))||io.test(e)||!no.test(e)||null!=t&&e in Object(t)};function ao(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");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(ao.Cache||X),l}ao.Cache=X;var ro,uo,so=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,co=/\\(\\)?/g,vo=(ro=ao(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(so,function(e,l,n,i){t.push(n?i.replace(co,"$1"):l||e)}),t},function(e){return 500===uo.size&&uo.clear(),e}),uo=ro.cache,ro),po=function(e,t){for(var l=-1,n=null==e?0:e.length,i=Array(n);++l<n;)i[l]=t(e[l],l,e);return i},mo=T?T.prototype:void 0,Eo=mo?mo.toString:void 0,fo=function(e,t){return se(e)?e:oo(e,t)?[e]:vo(function(e){return null==e?"":function e(t){if("string"==typeof t)return t;if(se(t))return po(t,e)+"";if(lo(t))return Eo?Eo.call(t):"";var l=t+"";return"0"==l&&1/t==-1/0?"-0":l}(e)}(e))},_o=function(e){if("string"==typeof e||lo(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t},go=function(e,t){for(var l=0,n=(t=fo(t,e)).length;null!=e&&l<n;)e=e[_o(t[l++])];return l&&l==n?e:void 0},Ao=function(e,t,l){var n=null==e?void 0:go(e,t);return void 0===n?l:n};function So(e){var t=-1,l=null==e?0:e.length;for(this.__data__=new X;++t<l;)this.add(e[t])}So.prototype.add=So.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},So.prototype.has=function(e){return this.__data__.has(e)};var ho=So,bo=function(e,t){for(var l=-1,n=null==e?0:e.length;++l<n;)if(t(e[l],l,e))return!0;return!1},yo=function(e,t){return e.has(t)},Co=function(e,t,l,n,i,o){var a=1&l,r=e.length,u=t.length;if(r!=u&&!(a&&u>r))return!1;var d=o.get(e),s=o.get(t);if(d&&s)return d==t&&s==e;var c=-1,v=!0,p=2&l?new ho:void 0;for(o.set(e,t),o.set(t,e);++c<r;){var m=e[c],E=t[c];if(n)var f=a?n(E,m,c,t,e,o):n(m,E,c,e,t,o);if(void 0!==f){if(f)continue;v=!1;break}if(p){if(!bo(t,function(e,t){if(!yo(p,t)&&(m===e||i(m,e,l,n,o)))return p.push(t)})){v=!1;break}}else if(m!==E&&!i(m,E,l,n,o)){v=!1;break}}return o.delete(e),o.delete(t),v},To=function(e){var t=-1,l=Array(e.size);return e.forEach(function(e,n){l[++t]=[n,e]}),l},Do=function(e){var t=-1,l=Array(e.size);return e.forEach(function(e){l[++t]=e}),l},No=T?T.prototype:void 0,Po=No?No.valueOf:void 0,Io=Object.prototype.hasOwnProperty,Lo=Object.prototype.hasOwnProperty,Bo=function e(t,l,n,i,o){return t===l||(null==t||null==l||!ie(t)&&!ie(l)?t!=t&&l!=l:function(e,t,l,n,i,o){var a=se(e),r=se(t),u=a?"[object Array]":Qe(e),d=r?"[object Array]":Qe(t),s="[object Object]"==(u="[object Arguments]"==u?"[object Object]":u),c="[object Object]"==(d="[object Arguments]"==d?"[object Object]":d),v=u==d;if(v&&ve(e)){if(!ve(t))return!1;a=!0,s=!1}if(v&&!s)return o||(o=new Z),a||Se(e)?Co(e,t,l,n,i,o):function(e,t,l,n,i,o,a){switch(l){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!o(new tt(e),new tt(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return p(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var r=To;case"[object Set]":if(r||(r=Do),e.size!=t.size&&!(1&n))return!1;var u=a.get(e);if(u)return u==t;n|=2,a.set(e,t);var d=Co(r(e),r(t),n,i,o,a);return a.delete(e),d;case"[object Symbol]":if(Po)return Po.call(e)==Po.call(t)}return!1}(e,t,u,l,n,i,o);if(!(1&l)){var m=s&&Lo.call(e,"__wrapped__"),E=c&&Lo.call(t,"__wrapped__");if(m||E){var f=m?e.value():e,_=E?t.value():t;return o||(o=new Z),i(f,_,l,n,o)}}return!!v&&(o||(o=new Z),function(e,t,l,n,i,o){var a=1&l,r=We(e),u=r.length;if(u!=We(t).length&&!a)return!1;for(var d=u;d--;){var s=r[d];if(!(a?s in t:Io.call(t,s)))return!1}var c=o.get(e),v=o.get(t);if(c&&v)return c==t&&v==e;var p=!0;o.set(e,t),o.set(t,e);for(var m=a;++d<u;){var E=e[s=r[d]],f=t[s];if(n)var _=a?n(f,E,s,t,e,o):n(E,f,s,e,t,o);if(!(void 0===_?E===f||i(E,f,l,n,o):_)){p=!1;break}m||(m="constructor"==s)}if(p&&!m){var g=e.constructor,A=t.constructor;g==A||!("constructor"in e)||!("constructor"in t)||"function"==typeof g&&g instanceof g&&"function"==typeof A&&A instanceof A||(p=!1)}return o.delete(e),o.delete(t),p}(e,t,l,n,i,o))}(t,l,n,i,e,o))},Oo=function(e){return e==e&&!R(e)},Ro=function(e,t){return function(l){return null!=l&&l[e]===t&&(void 0!==t||e in Object(l))}},wo=function(e,t){return null!=e&&t in Object(e)},xo=function(e){return e},Mo=function(e){return"function"==typeof e?e:null==e?xo:"object"==typeof e?se(e)?(i=e[1],oo(n=e[0])&&Oo(i)?Ro(_o(n),i):function(e){var t=Ao(e,n);return void 0===t&&t===i?function(e,t){return null!=e&&function(e,t,l){for(var n=-1,i=(t=fo(t,e)).length,o=!1;++n<i;){var a=_o(t[n]);if(!(o=null!=e&&l(e,a)))break;e=e[a]}return o||++n!=i?o:!!(i=null==e?0:e.length)&&Ee(i)&&me(a,i)&&(se(e)||de(e))}(e,t,wo)}(e,n):Bo(i,t,3)}):1==(l=function(e){for(var t=Ie(e),l=t.length;l--;){var n=t[l],i=e[n];t[l]=[n,i,Oo(i)]}return t}(t=e)).length&&l[0][2]?Ro(l[0][0],l[0][1]):function(e){return e===t||function(e,t,l,n){var i=l.length,o=i;if(null==e)return!o;for(e=Object(e);i--;){var a=l[i];if(a[2]?a[1]!==e[a[0]]:!(a[0]in e))return!1}for(;++i<o;){var r=(a=l[i])[0],u=e[r],d=a[1];if(a[2]){if(void 0===u&&!(r in e))return!1}else{var s=new Z;if(!Bo(d,u,3,void 0,s))return!1}}return!0}(e,0,l)}:function(e){return oo(e)?(t=_o(e),function(e){return null==e?void 0:e[t]}):function(e){return function(t){return go(t,e)}}(e);var t}(e);var t,l,n,i},Fo=function(e,t){if(e!==t){var l=void 0!==e,n=null===e,i=e==e,o=lo(e),a=void 0!==t,r=null===t,u=t==t,d=lo(t);if(!r&&!d&&!o&&e>t||o&&a&&u&&!r&&!d||n&&a&&u||!l&&u||!i)return 1;if(!n&&!o&&!d&&e<t||d&&l&&i&&!n&&!o||r&&l&&i||!a&&i||!u)return-1}return 0};const ko=e=>{var a,r,u,s,p,m,E,f,_,g,A,S,h,b,y;let{showTermsPopup:C,setShowTermsPopup:T,otpVerifiedTimestamp:D}=e;const[N,P]=t.useState(!1),{state:I}=i.useLocation(),{t:L}=n.useTranslation(),B=Digit.UserService.getUser(),O=null==B||null===(a=B.info)||void 0===a?void 0:a.name,R=null==B?void 0:B.info.mobileNumber,[w,x]=Digit.Hooks.useSessionStorage("BUILDING_PERMIT",null!=I&&I.edcrNumber?{data:{scrutinyNumber:{edcrNumber:null==I?void 0:I.edcrNumber}}}:{}),[M,F]=t.useState(!1),[k,U]=t.useState(!1),H=null==w||null===(r=w.additionalDetails)||void 0===r?void 0:r.architectid,W=null==w||null===(u=w.owners)||void 0===u||null===(s=u.owners)||void 0===s||null===(p=s[0])||void 0===p?void 0:p.name,j=null==w||null===(m=w.owners)||void 0===m||null===(E=m.owners)||void 0===E||null===(f=E[0])||void 0===f?void 0:f.mobileNumber,$=null==w||null===(_=w.additionalDetails)||void 0===_?void 0:_.typeOfArchitect,Y=null==w||null===(g=w.additionalDetails)||void 0===g?void 0:g.khasraNumber,z=null==w||null===(A=w.additionalDetails)||void 0===A?void 0:A.UlbName,G=null==w||null===(S=w.additionalDetails)||void 0===S?void 0:S.wardnumber,K=null==w||null===(h=w.additionalDetails)||void 0===h?void 0:h.area,V=null==w||null===(b=w.additionalDetails)||void 0===b?void 0:b.zonenumber,q=null==w||null===(y=w.additionalDetails)||void 0===y?void 0:y.Ulblisttype,X=D;t.useEffect(()=>{null!=w&&w.additionalDetails&&!w.additionalDetails.TimeStamp&&x(e=>({...e,additionalDetails:{...e.additionalDetails,TimeStamp:D}}))},[w,D,x]);const J=`\n To,\n <b>${q}</b>\n <b>${z}</b>\n \n \n Dear Sir or Madam,\n\n I, under signed Shri/Smt/Kum <b>${O}</b> (<b>${$}</b>) having Registration No. \n <b>${H}</b> is appointed by the <b>${W}</b> Mobile number <b>${j}</b> for the development on\n land bearing Kh. No <b>${Y}</b> Area <b>${K}</b> (Sq.mts).\n \n This site falls in ward number <b>${G}</b> zone number <b>${V}</b> in the Master plan of \n <b>${z}</b> and the proposed Residential/Commercial/Industrial construction is permi\n -ssible in this area.\n \n I am currently registered as <b>${$}</b> with the Competent Authority and empane\n -lled under Self-Certification Scheme.\n \n I hereby certify that I/we have appointed by the owner to prepare the plans, sections and \n details, structural details as required under the Punjab Municipal Building Byelaws for the \n above mentioned project. \n \n That the drawings prepared and uploaded along with other necessary documents on this \n E-Naksha Platform are as per the provisions of Punjab Municipal Building Byelaws and th\n -is building plan has been applied under Self-Certification Scheme. \n \n I certify that:\n That I am fully conversant with the provisions of the Punjab Municipal Building Byelaws and \n other applicable instructions/ regulations, which are in force and I undertake to fulfill the \n same.\n \n That plans have been prepared within the framework of provisions of the Master Plan and app\n -licable Building Bye Laws / Regulations. \n \n That site does not falls in any prohibited area/ government land/ encroachment or any other \n land restricted for building construction or in any unauthorized colony. \n \n That plan is in conformity to structural safety norms. \n \n That I have seen the originals of all the documents uploaded and Nothing is concealed \n thereof. \n \n That all the requisite documents/NOC required to be uploaded have been uploaded on \n E-Naksha portal along with plan. \n \n That above stated facts are true and all the requisite documents uploaded with this E-Naksha plan.\n \n\n\n This Document is Verified By OTP at <b>${X}</b>\n\n\n Name of Professional - <b>${O}</b> \n Designation - <b>${$}</b>\n Architect Id - <b>${H}</b> \n Mobile Number - <b>${R}</b>\n \n \n `,Z=e=>[`Name of Professional - <b>${O}</b>`,`Designation - <b>${$}</b>`,`Architect Id - <b>${H}</b>`,`Mobile Number - <b>${R}</b>`].includes(e.trim()),Q=()=>{T(!1)},ee={modal:{width:"100%",height:"100%",top:"0",position:"relative",backgroundColor:"rgba(0, 0, 0, 0.7)",display:"flex",justifyContent:"center",alignItems:"center"},modalOverlay:{position:"fixed",top:"0",left:"0",width:"100%",height:"100%",backgroundColor:"rgba(0, 0, 0, 0.7)"},modalContent:{backgroundColor:"#FFFFFF",padding:"2rem",borderRadius:"0.5rem",maxWidth:"800px",margin:"auto",fontFamily:"Roboto, serif",overflowX:"hidden",textAlign:"justify",boxShadow:"0 4px 8px rgba(0, 0, 0, 0.2)",maxHeight:"80vh",overflowY:"auto"},heading:{textAlign:"center",fontWeight:"bold",marginBottom:"10px"},subheading:{textAlign:"center",fontWeight:"bold",marginBottom:"20px"},rightAlignedText:{textAlign:"right",whiteSpace:"pre-wrap",wordWrap:"break-word",fontFamily:"Roboto, serif"}};return l.createElement("div",null,l.createElement(d,{isOpen:C,onRequestClose:Q,contentLabel:"Self-Declaration",style:{modal:ee.modal,overlay:ee.modalOverlay,content:ee.modalContent}},l.createElement("div",null),l.createElement("div",null,l.createElement("h2",{style:ee.heading},"DECLARATION UNDER SELF-CERTIFICATION SCHEME"),l.createElement("h3",{style:ee.subheading},"(For proposed Construction)"),l.createElement("h3",{style:ee.subheading},"(By Architect/ Civil Engineer/ Building Designer and Supervisor)"),l.createElement("div",{style:{whiteSpace:"pre-wrap",wordWrap:"break-word",textAlign:"justify",fontFamily:"Roboto, serif"}},J.split("\n").map((e,t)=>l.createElement(l.Fragment,{key:t},l.createElement("div",{style:Z(e)?ee.rightAlignedText:{},dangerouslySetInnerHTML:{__html:e}}),((e,t)=>{const l=`This Document is Verified By OTP at <b>${X}</b>`;return"That above stated facts are true and all the requisite documents uploaded with this E-Naksha plan."===e.trim()&&""===(null==t?void 0:t.trim())||e.trim()===l})(e,J.split("\n")[t+1])&&l.createElement("div",{style:{marginBottom:"2rem"}})))),l.createElement("div",{style:{display:"flex",justifyContent:"flex-end"}},l.createElement(o.SubmitBar,{label:L("BPA_CLOSE"),onSubmit:Q})),l.createElement("br",null),l.createElement("div",{style:{display:"flex",justifyContent:"flex-end"}},l.createElement("br",null),l.createElement(o.SubmitBar,{label:L("BPA_UPLOAD"),onSubmit:function(){try{const e=v(function(){return c(function(){return F(!0),Promise.resolve(Digit.PaymentService.generatePdf(Digit.ULBService.getStateId(),{Bpa:[w]},"architectconsent")).then(function(e){var t;(null==e||null===(t=e.filestoreIds[0])||void 0===t?void 0:t.length)>0?(alert("File Uploaded Successfully"),sessionStorage.setItem("ArchitectConsentdocFilestoreid",null==e?void 0:e.filestoreIds[0]),U(!0)):alert("File Upload Failed")})},function(e){alert("Error Uploading PDF:",e)})},function(e,t){if(F(!1),e)throw t;return t});return Promise.resolve(e&&e.then?e.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},disabled:M||k})))))},Uo=e=>e.substr(0,1).toUpperCase()+e.substr(1);var Ho=function(e,t){return function(){for(var l=new Array(arguments.length),n=0;n<l.length;n++)l[n]=arguments[n];return e.apply(t,l)}},Wo=Object.prototype.toString;function jo(e){return"[object Array]"===Wo.call(e)}function $o(e){return void 0===e}function Yo(e){return null!==e&&"object"==typeof e}function zo(e){if("[object Object]"!==Wo.call(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function Go(e){return"[object Function]"===Wo.call(e)}function Ko(e,t){if(null!=e)if("object"!=typeof e&&(e=[e]),jo(e))for(var l=0,n=e.length;l<n;l++)t.call(null,e[l],l,e);else for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.call(null,e[i],i,e)}var Vo={isArray:jo,isArrayBuffer:function(e){return"[object ArrayBuffer]"===Wo.call(e)},isBuffer:function(e){return null!==e&&!$o(e)&&null!==e.constructor&&!$o(e.constructor)&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)},isFormData:function(e){return"undefined"!=typeof FormData&&e instanceof FormData},isArrayBufferView:function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&e.buffer instanceof ArrayBuffer},isString:function(e){return"string"==typeof e},isNumber:function(e){return"number"==typeof e},isObject:Yo,isPlainObject:zo,isUndefined:$o,isDate:function(e){return"[object Date]"===Wo.call(e)},isFile:function(e){return"[object File]"===Wo.call(e)},isBlob:function(e){return"[object Blob]"===Wo.call(e)},isFunction:Go,isStream:function(e){return Yo(e)&&Go(e.pipe)},isURLSearchParams:function(e){return"undefined"!=typeof URLSearchParams&&e instanceof URLSearchParams},isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&"undefined"!=typeof window&&"undefined"!=typeof document},forEach:Ko,merge:function e(){var t={};function l(l,n){t[n]=zo(t[n])&&zo(l)?e(t[n],l):zo(l)?e({},l):jo(l)?l.slice():l}for(var n=0,i=arguments.length;n<i;n++)Ko(arguments[n],l);return t},extend:function(e,t,l){return Ko(t,function(t,n){e[n]=l&&"function"==typeof t?Ho(t,l):t}),e},trim:function(e){return e.replace(/^\s*/,"").replace(/\s*$/,"")},stripBOM:function(e){return 65279===e.charCodeAt(0)&&(e=e.slice(1)),e}};function qo(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}var Xo=function(e,t,l){if(!t)return e;var n;if(l)n=l(t);else if(Vo.isURLSearchParams(t))n=t.toString();else{var i=[];Vo.forEach(t,function(e,t){null!=e&&(Vo.isArray(e)?t+="[]":e=[e],Vo.forEach(e,function(e){Vo.isDate(e)?e=e.toISOString():Vo.isObject(e)&&(e=JSON.stringify(e)),i.push(qo(t)+"="+qo(e))}))}),n=i.join("&")}if(n){var o=e.indexOf("#");-1!==o&&(e=e.slice(0,o)),e+=(-1===e.indexOf("?")?"?":"&")+n}return e};function Jo(){this.handlers=[]}Jo.prototype.use=function(e,t){return this.handlers.push({fulfilled:e,rejected:t}),this.handlers.length-1},Jo.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},Jo.prototype.forEach=function(e){Vo.forEach(this.handlers,function(t){null!==t&&e(t)})};var Zo=Jo,Qo=function(e,t,l){return Vo.forEach(l,function(l){e=l(e,t)}),e},ea=function(e){return!(!e||!e.__CANCEL__)},ta=function(e,t){Vo.forEach(e,function(l,n){n!==t&&n.toUpperCase()===t.toUpperCase()&&(e[t]=l,delete e[n])})},la=function(e,t,l,n,i){return function(e,t,l,n,i){return e.config=t,l&&(e.code=l),e.request=n,e.response=i,e.isAxiosError=!0,e.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code}},e}(new Error(e),t,l,n,i)},na=Vo.isStandardBrowserEnv()?{write:function(e,t,l,n,i,o){var a=[];a.push(e+"="+encodeURIComponent(t)),Vo.isNumber(l)&&a.push("expires="+new Date(l).toGMTString()),Vo.isString(n)&&a.push("path="+n),Vo.isString(i)&&a.push("domain="+i),!0===o&&a.push("secure"),document.cookie=a.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}},ia=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"],oa=Vo.isStandardBrowserEnv()?function(){var e,t=/(msie|trident)/i.test(navigator.userAgent),l=document.createElement("a");function n(e){var n=e;return t&&(l.setAttribute("href",n),n=l.href),l.setAttribute("href",n),{href:l.href,protocol:l.protocol?l.protocol.replace(/:$/,""):"",host:l.host,search:l.search?l.search.replace(/^\?/,""):"",hash:l.hash?l.hash.replace(/^#/,""):"",hostname:l.hostname,port:l.port,pathname:"/"===l.pathname.charAt(0)?l.pathname:"/"+l.pathname}}return e=n(window.location.href),function(t){var l=Vo.isString(t)?n(t):t;return l.protocol===e.protocol&&l.host===e.host}}():function(){return!0},aa={"Content-Type":"application/x-www-form-urlencoded"};function ra(e,t){!Vo.isUndefined(e)&&Vo.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var ua,da={adapter:(("undefined"!=typeof XMLHttpRequest||"undefined"!=typeof process&&"[object process]"===Object.prototype.toString.call(process))&&(ua=function(e){return new Promise(function(t,l){var n=e.data,i=e.headers;Vo.isFormData(n)&&delete i["Content-Type"];var o=new XMLHttpRequest;if(e.auth){var a=e.auth.username||"",r=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";i.Authorization="Basic "+btoa(a+":"+r)}var u,d,s=(d=e.url,(u=e.baseURL)&&!/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(d)?function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}(u,d):d);if(o.open(e.method.toUpperCase(),Xo(s,e.params,e.paramsSerializer),!0),o.timeout=e.timeout,o.onreadystatechange=function(){if(o&&4===o.readyState&&(0!==o.status||o.responseURL&&0===o.responseURL.indexOf("file:"))){var n,i,a,r,u,d="getAllResponseHeaders"in o?(n=o.getAllResponseHeaders(),u={},n?(Vo.forEach(n.split("\n"),function(e){if(r=e.indexOf(":"),i=Vo.trim(e.substr(0,r)).toLowerCase(),a=Vo.trim(e.substr(r+1)),i){if(u[i]&&ia.indexOf(i)>=0)return;u[i]="set-cookie"===i?(u[i]?u[i]:[]).concat([a]):u[i]?u[i]+", "+a:a}}),u):u):null;!function(e,t,l){var n=l.config.validateStatus;l.status&&n&&!n(l.status)?t(la("Request failed with status code "+l.status,l.config,null,l.request,l)):e(l)}(t,l,{data:e.responseType&&"text"!==e.responseType?o.response:o.responseText,status:o.status,statusText:o.statusText,headers:d,config:e,request:o}),o=null}},o.onabort=function(){o&&(l(la("Request aborted",e,"ECONNABORTED",o)),o=null)},o.onerror=function(){l(la("Network Error",e,null,o)),o=null},o.ontimeout=function(){var t="timeout of "+e.timeout+"ms exceeded";e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),l(la(t,e,"ECONNABORTED",o)),o=null},Vo.isStandardBrowserEnv()){var c=(e.withCredentials||oa(s))&&e.xsrfCookieName?na.read(e.xsrfCookieName):void 0;c&&(i[e.xsrfHeaderName]=c)}if("setRequestHeader"in o&&Vo.forEach(i,function(e,t){void 0===n&&"content-type"===t.toLowerCase()?delete i[t]:o.setRequestHeader(t,e)}),Vo.isUndefined(e.withCredentials)||(o.withCredentials=!!e.withCredentials),e.responseType)try{o.responseType=e.responseType}catch(t){if("json"!==e.responseType)throw t}"function"==typeof e.onDownloadProgress&&o.addEventListener("progress",e.onDownloadProgress),"function"==typeof e.onUploadProgress&&o.upload&&o.upload.addEventListener("progress",e.onUploadProgress),e.cancelToken&&e.cancelToken.promise.then(function(e){o&&(o.abort(),l(e),o=null)}),n||(n=null),o.send(n)})}),ua),transformRequest:[function(e,t){return ta(t,"Accept"),ta(t,"Content-Type"),Vo.isFormData(e)||Vo.isArrayBuffer(e)||Vo.isBuffer(e)||Vo.isStream(e)||Vo.isFile(e)||Vo.isBlob(e)?e:Vo.isArrayBufferView(e)?e.buffer:Vo.isURLSearchParams(e)?(ra(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):Vo.isObject(e)?(ra(t,"application/json;charset=utf-8"),JSON.stringify(e)):e}],transformResponse:[function(e){if("string"==typeof e)try{e=JSON.parse(e)}catch(e){}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};Vo.forEach(["delete","get","head"],function(e){da.headers[e]={}}),Vo.forEach(["post","put","patch"],function(e){da.headers[e]=Vo.merge(aa)});var sa=da;function ca(e){e.cancelToken&&e.cancelToken.throwIfRequested()}var va=function(e){return ca(e),e.headers=e.headers||{},e.data=Qo(e.data,e.headers,e.transformRequest),e.headers=Vo.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),Vo.forEach(["delete","get","head","post","put","patch","common"],function(t){delete e.headers[t]}),(e.adapter||sa.adapter)(e).then(function(t){return ca(e),t.data=Qo(t.data,t.headers,e.transformResponse),t},function(t){return ea(t)||(ca(e),t&&t.response&&(t.response.data=Qo(t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)})},pa=function(e,t){t=t||{};var l={},n=["url","method","data"],i=["headers","auth","proxy","params"],o=["baseURL","transformRequest","transformResponse","paramsSerializer","timeout","timeoutMessage","withCredentials","adapter","responseType","xsrfCookieName","xsrfHeaderName","onUploadProgress","onDownloadProgress","decompress","maxContentLength","maxBodyLength","maxRedirects","transport","httpAgent","httpsAgent","cancelToken","socketPath","responseEncoding"],a=["validateStatus"];function r(e,t){return Vo.isPlainObject(e)&&Vo.isPlainObject(t)?Vo.merge(e,t):Vo.isPlainObject(t)?Vo.merge({},t):Vo.isArray(t)?t.slice():t}function u(n){Vo.isUndefined(t[n])?Vo.isUndefined(e[n])||(l[n]=r(void 0,e[n])):l[n]=r(e[n],t[n])}Vo.forEach(n,function(e){Vo.isUndefined(t[e])||(l[e]=r(void 0,t[e]))}),Vo.forEach(i,u),Vo.forEach(o,function(n){Vo.isUndefined(t[n])?Vo.isUndefined(e[n])||(l[n]=r(void 0,e[n])):l[n]=r(void 0,t[n])}),Vo.forEach(a,function(n){n in t?l[n]=r(e[n],t[n]):n in e&&(l[n]=r(void 0,e[n]))});var d=n.concat(i).concat(o).concat(a),s=Object.keys(e).concat(Object.keys(t)).filter(function(e){return-1===d.indexOf(e)});return Vo.forEach(s,u),l};function ma(e){this.defaults=e,this.interceptors={request:new Zo,response:new Zo}}ma.prototype.request=function(e){"string"==typeof e?(e=arguments[1]||{}).url=arguments[0]:e=e||{},(e=pa(this.defaults,e)).method=e.method?e.method.toLowerCase():this.defaults.method?this.defaults.method.toLowerCase():"get";var t=[va,void 0],l=Promise.resolve(e);for(this.interceptors.request.forEach(function(e){t.unshift(e.fulfilled,e.rejected)}),this.interceptors.response.forEach(function(e){t.push(e.fulfilled,e.rejected)});t.length;)l=l.then(t.shift(),t.shift());return l},ma.prototype.getUri=function(e){return e=pa(this.defaults,e),Xo(e.url,e.params,e.paramsSerializer).replace(/^\?/,"")},Vo.forEach(["delete","get","head","options"],function(e){ma.prototype[e]=function(t,l){return this.request(pa(l||{},{method:e,url:t,data:(l||{}).data}))}}),Vo.forEach(["post","put","patch"],function(e){ma.prototype[e]=function(t,l,n){return this.request(pa(n||{},{method:e,url:t,data:l}))}});var Ea=ma;function fa(e){this.message=e}fa.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},fa.prototype.__CANCEL__=!0;var _a=fa;function ga(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise(function(e){t=e});var l=this;e(function(e){l.reason||(l.reason=new _a(e),t(l.reason))})}ga.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},ga.source=function(){var e;return{token:new ga(function(t){e=t}),cancel:e}};var Aa=ga;function Sa(e){var t=new Ea(e),l=Ho(Ea.prototype.request,t);return Vo.extend(l,Ea.prototype,t),Vo.extend(l,t),l}var ha=Sa(sa);ha.Axios=Ea,ha.create=function(e){return Sa(pa(ha.defaults,e))},ha.Cancel=_a,ha.CancelToken=Aa,ha.isCancel=ea,ha.all=function(e){return Promise.all(e)},ha.spread=function(e){return function(t){return e.apply(null,t)}},ha.isAxiosError=function(e){return"object"==typeof e&&!0===e.isAxiosError};var ba=ha;ba.default=ha,ba.interceptors.response.use(e=>e,e=>{var t,l;const n=window.location.pathname.split("/").includes("employee");if(null!=e&&null!==(t=e.response)&&void 0!==t&&null!==(l=t.data)&&void 0!==l&&l.Errors)for(const t of e.response.data.Errors){var i,o,a,r;t.message.includes("InvalidAccessTokenException")?(localStorage.clear(),sessionStorage.clear(),window.location.href=(n?"/digit-ui/employee/user/login":"/digit-ui/citizen/login")+"?from="+encodeURIComponent(window.location.pathname+window.location.search)):null!=t&&null!==(i=t.message)&&void 0!==i&&null!==(o=i.toLowerCase())&&void 0!==o&&o.includes("internal server error")||null!=t&&null!==(a=t.message)&&void 0!==a&&null!==(r=a.toLowerCase())&&void 0!==r&&r.includes("some error occured")?window.location.href=(n?"/digit-ui/employee/user/error":"/digit-ui/citizen/error")+"?type=maintenance&from="+encodeURIComponent(window.location.pathname+window.location.search):t.message.includes("ZuulRuntimeException")&&(window.location.href=(n?"/digit-ui/employee/user/error":"/digit-ui/citizen/error")+"?type=notfound&from="+encodeURIComponent(window.location.pathname+window.location.search))}throw e}),window.Digit=window.Digit||{},window.Digit={...window.Digit,RequestCache:window.Digit.RequestCache||{}};const ya=e=>{var t,l,n,i,o,a,r,u;const d=null==e||null===(t=e.data)||void 0===t||null===(l=t.BPA)||void 0===l?void 0:l[0];let s=null!=e&&null!==(n=e.data)&&void 0!==n&&null!==(i=n.BPA)&&void 0!==i&&null!==(o=i[0])&&void 0!==o&&o.businessService?null==e||null===(a=e.data)||void 0===a||null===(r=a.BPA)||void 0===r||null===(u=r[0])||void 0===u?void 0:u.businessService:"BPA",c=null==d?void 0:d.status;"BPA_LOW"==s&&(s="BPA");let v=sessionStorage.getItem("BPA_SUBMIT_APP")?JSON.parse(sessionStorage.getItem("BPA_SUBMIT_APP")):null;var p,m,E,f;return e.isSuccess?"BPA_SUBMIT_APP"==v?window.location.href.includes("editApplication")?null==e?void 0:e.t(`BPA_SUBMIT_HEADER_${s}_${null==d||null===(m=d.workflow)||void 0===m?void 0:m.action}_${ft(c," ","_").toUpperCase()}`):null==e?void 0:e.t(`BPA_SUBMIT_HEADER_${s}_${null==d||null===(p=d.workflow)||void 0===p?void 0:p.action}_${ft(c," ","_").toUpperCase()}`):window.location.href.includes("editApplication")?null==e?void 0:e.t(`BPA_HEADER_${s}_${null==d||null===(f=d.workflow)||void 0===f?void 0:f.action}_${ft(c," ","_").toUpperCase()}`):null==e?void 0:e.t(`BPA_HEADER_${s}_${null==d||null===(E=d.workflow)||void 0===E?void 0:E.action}_${ft(c," ","_").toUpperCase()}`):e.isLoading?(window.location.href.includes("editApplication"),null==e?void 0:e.t("CS_BPA_APPLICATION_PENDING")):e.isSuccess?void 0:(window.location.href.includes("editApplication"),null==e?void 0:e.t("CS_BPA_APPLICATION_FAILED"))},Ca=e=>{var t,l,n,i;let o=null!=e&&null!==(t=e.BPA)&&void 0!==t&&null!==(l=t[0])&&void 0!==l&&l.businessService?null==e||null===(n=e.BPA)||void 0===n||null===(i=n[0])||void 0===i?void 0:i.businessService:"BPA";return"BPA_LOW"==o&&(o="BPA"),"BPA"==o?null==e?void 0:e.t("BPA_PERMIT_APPLICATION_NUMBER_LABEL"):null==e?void 0:e.t("BPA_OCCUPANCY_CERTIFICATE_APPLICATION_NUMBER_LABEL")},Ta=e=>{var t;return l.createElement(o.Banner,{message:ya(e),applicationNumber:null===(t=e.data)||void 0===t?void 0:t.BPA[0].applicationNo,info:e.isSuccess?Ca(e):"",successful:e.isSuccess,headerStyles:{fontSize:"32px"}})},Da=e=>{var t,l,n,i,o,a,r,u;const d=null==e||null===(t=e.data)||void 0===t||null===(l=t.BPA)||void 0===l?void 0:l[0];let s=null!=e&&null!==(n=e.data)&&void 0!==n&&null!==(i=n.BPA)&&void 0!==i&&null!==(o=i[0])&&void 0!==o&&o.businessService?null==e||null===(a=e.data)||void 0===a||null===(r=a.BPA)||void 0===r||null===(u=r[0])||void 0===u?void 0:u.businessService:"BPA",c=null==d?void 0:d.status;"BPA_LOW"==s&&(s="BPA");let v=sessionStorage.getItem("BPA_SUBMIT_APP")?JSON.parse(sessionStorage.getItem("BPA_SUBMIT_APP")):null;var p,m,E,f;return e.isSuccess?"BPA_SUBMIT_APP"==v?window.location.href.includes("editApplication")?null==e?void 0:e.t(`BPA_SUBMIT_HEADER_${s}_${null==d||null===(m=d.workflow)||void 0===m?void 0:m.action}_${ft(c," ","_").toUpperCase()}`):null==e?void 0:e.t(`BPA_SUBMIT_HEADER_${s}_${null==d||null===(p=d.workflow)||void 0===p?void 0:p.action}_${ft(c," ","_").toUpperCase()}`):window.location.href.includes("editApplication")?null==e?void 0:e.t(`BPA_HEADER_${s}_${null==d||null===(f=d.workflow)||void 0===f?void 0:f.action}_${ft(c," ","_").toUpperCase()}`):null==e?void 0:e.t(`BPA_HEADER_${s}_${null==d||null===(E=d.workflow)||void 0===E?void 0:E.action}_${ft(c," ","_").toUpperCase()}`):e.isLoading?(window.location.href.includes("editApplication"),null==e?void 0:e.t("CS_BPA_APPLICATION_PENDING")):e.isSuccess?void 0:(window.location.href.includes("editApplication"),null==e?void 0:e.t("CS_BPA_APPLICATION_FAILED"))},Na=e=>{var t,l,n,i;let o=null!=e&&null!==(t=e.BPA)&&void 0!==t&&null!==(l=t[0])&&void 0!==l&&l.businessService?null==e||null===(n=e.BPA)||void 0===n||null===(i=n[0])||void 0===i?void 0:i.businessService:"BPA";return"BPA_LOW"==o&&(o="BPA"),"BPA"==o?null==e?void 0:e.t("BPA_PERMIT_APPLICATION_NUMBER_LABEL"):null==e?void 0:e.t("BPA_OCCUPANCY_CERTIFICATE_APPLICATION_NUMBER_LABEL")},Pa=e=>{var t;return l.createElement(o.Banner,{message:Da(e),applicationNumber:null===(t=e.data)||void 0===t?void 0:t.BPA[0].applicationNo,info:e.isSuccess?Na(e):"",successful:e.isSuccess,headerStyles:{fontSize:"32px"}})},Ia=e=>e.substr(0,1).toUpperCase()+e.substr(1),La=e=>{var t,l,i,o,a,r,u;const d=(null==e||null===(t=e.data)||void 0===t||null===(l=t.Licenses)||void 0===l||null===(i=l[0])||void 0===i||null===(o=i.tradeLicenseDetail)||void 0===o||null===(a=o.tradeUnits)||void 0===a||null===(r=a[0])||void 0===r||null===(u=r.tradeType)||void 0===u?void 0:u.split(".")[0])||"ARCHITECT",{t:s}=n.useTranslation();return e.isSuccess?window.location.href.includes("edit-application")?s("CS_PROPERTY_UPDATE_APPLICATION_SUCCESS"):`${s("TRADELICENSE_TRADETYPE_"+d)}${s("CS_STAKEHOLDER_APPLICATION_SUCCESS")}`:e.isLoading?window.location.href.includes("edit-application")?s("CS_PROPERTY_UPDATE_APPLICATION_PENDING"):s("CS_STAKEHOLDER_APPLICATION_PENDING"):e.isSuccess?void 0:window.location.href.includes("edit-application")?s("CS_PROPERTY_UPDATE_APPLICATION_FAILED"):s("CS_STAKEHOLDER_APPLICATION_FAILED")},Ba=e=>{var t,n,i,a,r,u,d,s;const c=(null==e||null===(t=e.data)||void 0===t||null===(n=t.Licenses)||void 0===n||null===(i=n[0])||void 0===i||null===(a=i.tradeLicenseDetail)||void 0===a||null===(r=a.tradeUnits)||void 0===r||null===(u=r[0])||void 0===u||null===(d=u.tradeType)||void 0===d?void 0:d.split(".")[0])||"ARCHITECT";return l.createElement(o.Banner,{message:La(e),applicationNumber:null===(s=e.data)||void 0===s?void 0:s.Licenses[0].applicationNumber,info:e.isSuccess?`${e.t("TRADELICENSE_TRADETYPE_"+c)} ${e.t("BPA_NEW_STAKEHOLDER_REGISTRATION_APP_LABEL")}`:"",successful:e.isSuccess,style:{padding:"10px"},headerStyles:{fontSize:"32px"}})},Oa={OBPSModule:e=>{let{stateCode:t,userType:n,tenants:a}=e;const{path:r}=i.useRouteMatch(),u=Digit.StoreData.getCurrentLanguage(),{isLoading:d}=Digit.Services.useStore({stateCode:t,moduleCode:["bpa","bpareg","common"],language:u});return Digit.SessionStorage.set("OBPS_TENANTS",a),d?l.createElement(o.Loader,null):l.createElement("citizen"===n?Hl:Cn,{path:r,stateCode:t})},OBPSLinks:e=>{let{matchPath:t}=e;const{t:i}=n.useTranslation(),a=[{link:t+"/my-applications",i18nKey:i("BPA_CITIZEN_HOME_VIEW_APP_BY_CITIZEN_LABEL")},{link:t+"/stakeholder/apply/stakeholder-docs-required",i18nKey:i("BPA_CITIZEN_HOME_STAKEHOLDER_LOGIN_LABEL")},{link:t+"/home",i18nKey:i("BPA_CITIZEN_HOME_ARCHITECT_LOGIN_LABEL")}];return l.createElement(o.CitizenHomeCard,{header:i("ACTION_TEST_BUILDING_PLAN_APPROVAL"),links:a,Icon:()=>l.createElement(o.OBPSIcon,null),Info:()=>l.createElement(o.CitizenInfoLabel,{style:{margin:"0px",padding:"10px"},info:i("CS_FILE_APPLICATION_INFO_LABEL"),text:i("BPA_CITIZEN_HOME_STAKEHOLDER_INCLUDES_INFO_LABEL")}),isInfo:!0})},OBPSCard:()=>{const[e,a]=t.useState(0),[r,u]=t.useState(0),{t:d}=n.useTranslation(),s=i.useLocation(),c=Digit.ULBService.getCurrentTenantId(),v=Digit.ULBService.getStateId(),p=function(e){var t;void 0===e&&(e=[]);let l=sessionStorage.getItem("Digit.citizen.userRequestObject");const n=l?JSON.parse(l):{};let i=[];return null===(t=e)||void 0===t||t.map(e=>{var t,l,o;null==n||null===(t=n.value)||void 0===t||null===(l=t.info)||void 0===l||null===(o=l.roles)||void 0===o||o.map(t=>{t.code===e.code&&t.tenantId===e.tenantId&&i.push(t)})}),null==i?void 0:i.length}([{code:"BPAREG_DOC_VERIFIER",tenantId:v},{code:"BPAREG_APPROVER",tenantId:v}]),m=function(e){var t;void 0===e&&(e=[]);const l=Digit.UserService.getUser(),n=Digit.ULBService.getCurrentTenantId();let i=[];return null===(t=e)||void 0===t||t.map(e=>{var t,o;null==l||null===(t=l.info)||void 0===t||null===(o=t.roles)||void 0===o||o.map(t=>{t.code==e&&t.tenantId===n&&i.push(t)})}),null==i?void 0:i.length}(["BPA_FIELD_INSPECTOR","BPA_NOC_VERIFIER","BPA_APPROVER","BPA_VERIFIER","CEMP"]),{isLoading:E,data:f}=Digit.Hooks.obps.useBPAInbox({tenantId:c,filters:{filterForm:{moduleName:"BPAREG",applicationStatus:"",locality:[],assignee:"ASSIGNED_TO_ALL"},searchForm:{},tableForm:{sortBy:"",limit:10,offset:0,sortOrder:"DESC"}},config:{enabled:!!p}}),{isLoading:_,data:g}=Digit.Hooks.obps.useBPAInbox({tenantId:c,filters:{filterForm:{moduleName:"bpa-services",applicationStatus:"",locality:[],assignee:"ASSIGNED_TO_ALL",applicationType:[]},searchForm:{},tableForm:{sortBy:"",limit:10,offset:0,sortOrder:"DESC"}},config:{enabled:!!m}});t.useEffect(()=>{_||E||(a((null!=g&&g.totalCount?null==g?void 0:g.totalCount:0)+(null!=f&&f.totalCount?null==f?void 0:f.totalCount:0)),u((null==g?void 0:g.nearingSlaCount)||0+(null==f?void 0:f.nearingSlaCount)||0))},[g,f]),t.useEffect(()=>{"/digit-ui/employee"===s.pathname&&(Digit.SessionStorage.del("OBPS.INBOX"),Digit.SessionStorage.del("STAKEHOLDER.INBOX"))},[s.pathname]);const A=t.useMemo(()=>({Icon:l.createElement(o.OBPSIconSolidBg,null),moduleName:d("MODULE_OBPS"),kpis:[{count:_||E?"":e,label:d("TOTAL_FSM"),link:"/digit-ui/employee/obps/inbox"},{count:_||E?"":r,label:d("TOTAL_NEARING_SLA"),link:"/digit-ui/employee/obps/inbox"}],links:[{count:E?"":null==f?void 0:f.totalCount,label:d("ES_COMMON_STAKEHOLDER_INBOX_LABEL"),link:"/digit-ui/employee/obps/stakeholder-inbox",field:"STAKEHOLDER"},{count:_?"":null==g?void 0:g.totalCount,label:d("ES_COMMON_OBPS_INBOX_LABEL"),link:"/digit-ui/employee/obps/inbox",field:"BPA"},{label:d("ES_COMMON_SEARCH_APPLICATION"),link:"/digit-ui/employee/obps/search/application"}]}),[_,E,f,g,e,r]);return p||(A.links=A.links.filter(e=>"STAKEHOLDER"!==e.field)),m||(A.links=A.links.filter(e=>"BPA"!==e.field)),m||p?l.createElement(o.EmployeeModuleCard,A):null},BPACitizenHomeScreen:e=>{var a,r,u,d;const s=Digit.UserService.getUser(),c=null==s||null===(a=s.info)||void 0===a||null===(r=a.roles)||void 0===r?void 0:r.map(e=>e.code),v=Digit.ULBService.getStateId(),[p,m]=t.useState(!1),{data:E,isLoading:f}=Digit.Hooks.obps.useMDMS(v,"StakeholderRegistraition","TradeTypetoRoleMapping"),[_,g]=t.useState([]),A=Digit.ULBService.getStateId(),{t:S}=n.useTranslation(),h=i.useLocation(),[b,y,C]=Digit.Hooks.useSessionStorage("BPA_HOME_CREATE",{}),{data:T,isLoading:D}=Digit.Hooks.obps.useMDMS(A,"BPA",["homePageUrlLinks"]),[N,P]=t.useState(null),[I,L]=t.useState("-"),[B,O]=t.useState({applicationStatus:[]});window.Digit.Utils.browser.isMobile();const[R,w]=t.useState(0),[x,M]=t.useState(window.Digit.Utils.browser.isMobile()?50:10),[F,k]=t.useState([{id:"createdTime",sortOrder:"DESC"}]),{isLoading:U,data:H}=Digit.Hooks.obps.useArchitectInbox({tenantId:v,moduleName:"bpa-services",businessService:["BPA_LOW","BPA","BPA_OC"],filters:{searchForm:{...B},tableForm:{sortBy:null==F||null===(u=F[0])||void 0===u?void 0:u.id,limit:x,offset:R,sortOrder:null==F||null===(d=F[0])||void 0===d?void 0:d.sortOrder},filterForm:{moduleName:"bpa-services",businessService:[],applicationStatus:null==B?void 0:B.applicationStatus,locality:[],assignee:"ASSIGNED_TO_ALL"}},config:{},withEDCRData:!1}),{isLoading:W,data:{totalCount:j}={}}=Digit.Hooks.obps.useEDCRInbox({tenantId:v,filters:{filterForm:{},searchForm:{},tableForm:{limit:10,offset:0}}});if(t.useEffect(()=>{"/digit-ui/citizen/obps/home"===h.pathname&&(Digit.SessionStorage.del("OBPS.INBOX"),Digit.SessionStorage.del("STAKEHOLDER.INBOX"))},[h.pathname]),t.useEffect(()=>{U||L((null==H?void 0:H.totalCount)||0)},[H]),t.useEffect(()=>{if(!f){var e,t;let l=[];null==E||null===(e=E.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=>{l.push(e)})});const n=null==l?void 0:l.filter((e,t,l)=>l.indexOf(e)===t);let i=!1;null==n||n.map(e=>{null!=c&&c.includes(e)&&!i&&(i=!0)}),i?m(!0):(m(!1),P({key:"true",message:S("BPA_LOGIN_HOME_VALIDATION_MESSAGE_LABEL")}))}},[f]),t.useEffect(()=>{var e,t;if(!D&&(null==T||null===(e=T.BPA)||void 0===e||null===(t=e.homePageUrlLinks)||void 0===t?void 0:t.length)>0){var l,n;let e=[];null==T||null===(l=T.BPA)||void 0===l||null===(n=l.homePageUrlLinks)||void 0===n||n.map(t=>{var l,n,i;e.push({link:`${null==t||null===(l=t.flow)||void 0===l?void 0:l.toLowerCase()}/${null==t||null===(n=t.applicationType)||void 0===n?void 0:n.toLowerCase()}/${null==t||null===(i=t.serviceType)||void 0===i?void 0:i.toLowerCase()}/docs-required`,i18nKey:S(`BPA_HOME_${null==t?void 0:t.applicationType}_${null==t?void 0:t.serviceType}_LABEL`),state:{linkData:t},linkState:!0})}),g(e)}},[!D]),t.useEffect(()=>{C()},[]),Digit.SessionStorage.set("EDCR_BACK","IS_EDCR_BACK"),N)return l.createElement(o.Toast,{error:!0,label:S(null==N?void 0:N.message),isDleteBtn:!0,onClose:()=>{window.location.replace("/digit-ui/citizen/all-services"),P(null)}});if(f||!p||U)return l.createElement(o.Loader,null);const $=[{Icon:l.createElement(o.BPAHomeIcon,null),moduleName:S("ACTION_TEST_BPA_STAKE_HOLDER_HOME"),name:"employeeCard",isCitizen:!0,kpis:[{count:!U&&!W&&I&&j?I+j:"-",label:S("BPA_PDF_TOTAL"),link:"/digit-ui/citizen/obps/bpa/inbox"}],links:[{count:U?"-":I,label:S("ES_COMMON_OBPS_INBOX_LABEL"),link:"/digit-ui/citizen/obps/bpa/inbox"},{count:W?"-":j,label:S("ES_COMMON_EDCR_INBOX_LABEL"),link:"/digit-ui/citizen/obps/edcr/inbox"}],className:"CitizenHomeCard",styles:{padding:"0px",minWidth:"90%",minHeight:"90%"}},{title:S("ACTION_TEST_EDCR_SCRUTINY"),Icon:l.createElement(o.EDCRIcon,{className:"fill-path-primary-main"}),links:[{link:"edcrscrutiny/apply",i18nKey:S("BPA_PLAN_SCRUTINY_FOR_NEW_CONSTRUCTION_LABEL")},{link:"edcrscrutiny/oc-apply",i18nKey:S("BPA_OC_PLAN_SCRUTINY_FOR_NEW_CONSTRUCTION_LABEL")}],styles:{minWidth:"90%",minHeight:"90%"}},{title:S("ACTION_TEST_BPA_STAKE_HOLDER_HOME"),Icon:l.createElement(o.BPAIcon,{className:"fill-path-primary-main"}),links:_,styles:{minWidth:"90%",minHeight:"90%"}}],Y=l.createElement("div",{className:"mainContent"},$.map(e=>l.createElement("div",null,"employeeCard"===e.name?l.createElement(o.EmployeeModuleCard,e):l.createElement(o.CitizenHomeCard,{header:e.title,links:e.links,Icon:()=>e.Icon,styles:null==e?void 0:e.styles}))));return sessionStorage.setItem("isPermitApplication",!0),sessionStorage.setItem("isEDCRDisable",JSON.stringify(!1)),Y},EDCRForm:e=>{var a;let{t:r,config:u,onSelect:d,formData:s,ownerIndex:c=0,isShowToast:v,isSubmitBtnDisable:p}=e;i.useLocation();const m=i.useHistory(),{approvedCS:E,approvedControlSheetOptions:f,areaType:_,areaTypeOptions:g,cityOptions:A,cluApprove:S,cluApproveOptions:h,coreArea:b,coreAreaOptions:y,error:C,file:T,handleAreaTypeChange:D,handleDXFUpload:N,handleLayoutUpload:P,isFormValid:I,layoutFile:L,layoutMessage:B,name:O,schName:R,schemeArea:w,schemeAreaOptions:x,selectedCity:M,setApprovedCS:F,setCitymoduleList:k,setCluApproved:U,setFile:H,setLayoutFile:W,setName:j,setSchName:$,setSchemeArea:Y,setSelectedCity:z,setSiteReserved:G,setUlb:K,setUploadMessage:V,setUploadedFile:q,setcoreArea:X,siteReserved:J,siteReservedOptions:Z,tenantIdData:Q,ulb:ee,uploadMessage:te,uploadedFile:le}=(e=>{var l,o,a,r,u,d,s,c,v,p,m,E,f,_,g,A,S,h,b,y,C,T,D,N,P,I,L,B,O,R,w;let{formData:x}=e;const M=Digit.ULBService.getStateId(),F=Digit.ULBService.getCurrentTenantId(),[k,U]=t.useState([]),[H,W]=t.useState((null==x||null===(l=x.Scrutiny)||void 0===l||null===(o=l[0])||void 0===o?void 0:o.applicantName)||""),[j,$]=t.useState((null==x||null===(a=x.Scrutiny)||void 0===a||null===(r=a[0])||void 0===r?void 0:r.ulbName)||""),[Y,z]=t.useState((null==x||null===(u=x.Scrutiny)||void 0===u||null===(d=u[0])||void 0===d?void 0:d.areaType)||null),[G,K]=t.useState((null==x||null===(s=x.Scrutiny)||void 0===s||null===(c=s[0])||void 0===c?void 0:c.schemeName)||""),[V,q]=t.useState((null==x||null===(v=x.Scrutiny)||void 0===v||null===(p=v[0])||void 0===p?void 0:p.schemeType)||null),[X,J]=t.useState((null==x||null===(m=x.Scrutiny)||void 0===m||null===(E=m[0])||void 0===E?void 0:E.isCluApproved)||null),[Z,Q]=t.useState(null==x||null===(f=x.Scrutiny)||void 0===f||null===(_=f[0])||void 0===_?void 0:_.coreArea),[ee,te]=t.useState((null==x||null===(g=x.Scrutiny)||void 0===g||null===(A=g[0])||void 0===A?void 0:A.siteReserved)||null),[le,ne]=t.useState((null==x||null===(S=x.Scrutiny)||void 0===S||null===(h=S[0])||void 0===h?void 0:h.approvedControlSheet)||null),[ie,oe]=t.useState((null==x||null===(b=x.Scrutiny)||void 0===b||null===(y=b[0])||void 0===y?void 0:y.tenantIdData)||null),[ae,re]=t.useState(()=>{var e,t,l;return(null==x||null===(e=x.Scrutiny)||void 0===e||null===(t=e[0])||void 0===t||null===(l=t.proofIdentity)||void 0===l?void 0:l.fileStoreId)||null}),[ue,de]=t.useState((null==x||null===(C=x.Scrutiny)||void 0===C||null===(T=C[0])||void 0===T||null===(D=T.proofIdentity)||void 0===D?void 0:D.fileStoreId)||null),[se,ce]=t.useState((null==x||null===(N=x.owners)||void 0===N||null===(P=N.documents)||void 0===P?void 0:P.proofIdentity)||null),[ve,pe]=t.useState(null),[me,Ee]=t.useState(""),[fe,_e]=t.useState(""),[ge,Ae]=t.useState(null),[Se,he]=t.useState(null),[be,ye]=t.useState(()=>({code:Digit.ULBService.getCitizenCurrentTenant(!0)})),{t:Ce}=n.useTranslation(),{data:Te,isLoading:De}=Digit.Hooks.obps.useMDMS(M,"tenant",["citymodule"]),{data:Ne}=Digit.Hooks.useCustomMDMS(M,"BPA",[{name:"EDCRNewBuildingPlanScrutiny"}]),{data:Pe}=Digit.Hooks.useTenants(),Ie=(i.useLocation(),(null==Ne||null===(I=Ne.BPA)||void 0===I||null===(L=I.EDCRNewBuildingPlanScrutiny)||void 0===L?void 0:L[0])||{}),Le=(null==Ie||null===(B=Ie.areaType)||void 0===B?void 0:B.filter(e=>e.active))||[],Be=(null==Ie||null===(O=Ie.schemeArea)||void 0===O?void 0:O.filter(e=>e.active))||[],Oe=(null==Ie||null===(R=Ie.cluApprove)||void 0===R?void 0:R.filter(e=>e.active))||[],Re=(null==Ie||null===(w=Ie.coreArea)||void 0===w?void 0:w.filter(e=>e.active))||[];function we(e){ye(e),console.log("selected city",e),setShowError(!1)}console.log("FORM DATA ---\x3e",JSON.stringify(x,null,2)),t.useEffect(()=>{var e,t;if((null==Te||null===(e=Te.tenant)||void 0===e||null===(t=e.citymodule)||void 0===t?void 0:t.length)>0){var l,n,i,o,a,r,u;const e=null==Te||null===(l=Te.tenant)||void 0===l||null===(n=l.citymodule)||void 0===n?void 0:n.filter(e=>"BPAAPPLY"===e.code);null==e||null===(i=e[0])||void 0===i||null===(o=i.tenants)||void 0===o||o.forEach(e=>{var t;e.i18nKey="TENANT_TENANTS_"+ft(null==e||null===(t=e.code)||void 0===t?void 0:t.toUpperCase(),".","_")}),Array.isArray(null==e||null===(a=e[0])||void 0===a?void 0:a.tenants)&&(null==e||null===(r=e[0])||void 0===r||r.tenants.reverse());const t=_t(null==e||null===(u=e[0])||void 0===u?void 0:u.tenants,"code",Ce);U(t)}},[Te]),t.useMemo(()=>({header:Ce("CS_COMMON_CHOOSE_LOCATION"),submitBarLabel:Ce("CORE_COMMON_CONTINUE")}),[Ce]),console.log("selected city",we),t.useMemo(()=>({options:Pe,optionsKey:"i18nKey",additionalWrapperClass:"reverse-radio-selection-wrapper",onSelect:we,selectedOption:be}),[Pe,Ce,be]);const xe=null==Pe?void 0:Pe.map(e=>({...e,displayName:Ce(e.i18nKey)})),Me=()=>{if(!H||null==be||!be.code||!Y)return!1;if("SCHEME_AREA"===(null==Y?void 0:Y.code)){if(!V||!G||!ee)return!1;if("YES"===(null==ee?void 0:ee.code)){if(!le)return!1;if("YES"===(null==le?void 0:le.code))return!!ge}return!!Se}return"NON_SCHEME_AREA"!==(null==Y?void 0:Y.code)||!!X&&!("NO"!==(null==X?void 0:X.code)&&!Z)&&!!Se};return console.log({areaType:Y,layoutFile:ge,name:H,siteReserved:ee,ulb:j,dxfFile:Se,areaType:Y,schemeArea:V,schName:G,cluApprove:X,coreArea:Z,uploadedFile:ae,approvedCS:le,formValid:Me()}),{approvedCS:le,approvedControlSheetOptions:[{code:"YES",value:"Yes"},{code:"NO",value:"No"}],areaType:Y,areaTypeOptions:Le,cityOptions:xe,citymoduleList:k,cluApprove:X,cluApproveOptions:Oe,coreArea:Z,coreAreaOptions:Re,dxfFile:Se,error:ve,file:se,getFormData:()=>{const e={applicantName:H,ulbName:j,areaType:Y,file:se};return"SCHEME_AREA"===(null==Y?void 0:Y.code)?(e.schemeType=V,e.schemeName=G,e.siteReserved=ee,"YES"===(null==ee?void 0:ee.code)&&(e.approvedControlSheet=le)):(e.isCluApproved=X,e.coreType=Z),e},handleAreaTypeChange:e=>{z(e),K(""),q(null),J(null),Q(null)},handleDXFUpload:e=>{re(e.target.files[0]),ce(e.target.files[0]),he(e.target.files[0])},handleLayoutUpload:e=>{de(e.target.files[0]),ce(e.target.files[0]),Ae(e.target.files[0])},isFormValid:Me,isLoading:De,layoutFile:ge,layoutMessage:fe,name:H,schName:G,schemeArea:V,schemeAreaOptions:Be,selectedCity:be,setApprovedCS:ne,setCitymoduleList:U,setCluApproved:J,setcoreArea:Q,setError:pe,setFile:ce,setLayoutFile:Ae,setLayoutMessage:_e,setName:W,setSchName:K,setSchemeArea:q,setSelectedCity:ye,setSiteReserved:te,setTenantIdData:oe,setUlb:$,setUploadMessage:Ee,setUploadedFile:re,setcoreArea:Q,setSelectLayout:de,siteReserved:ee,siteReservedOptions:[{code:"YES",value:"Yes"},{code:"NO",value:"No"}],stateId:M,tenantId:F,tenantIdData:ie,ulb:j,uploadMessage:me,uploadedFile:ae}})({formData:s});let ne=(null===(a=Digit.SessionStorage.get("CITIZEN.COMMON.HOME.CITY"))||void 0===a?void 0:a.code)||Digit.ULBService.getCurrentTenantId()||"pb.amritsar";const ie=Digit.ULBService.getStateId();console.log(ie,ne,r,"TEN STATE");const{isLoading:oe,data:ae}=Digit.Hooks.obps.useMDMS(ie,"tenant",["citymodule"]);return t.useEffect(()=>{var e,t;if((null==ae||null===(e=ae.tenant)||void 0===e||null===(t=e.citymodule)||void 0===t?void 0:t.length)>0){var l,n,i,o,a,u,d;const e=null==ae||null===(l=ae.tenant)||void 0===l||null===(n=l.citymodule)||void 0===n?void 0:n.filter(e=>"BPAAPPLY"==e.code);null==e||null===(i=e[0])||void 0===i||null===(o=i.tenants)||void 0===o||o.forEach(e=>{var t;e.i18nKey="TENANT_TENANTS_"+ft(null==e||null===(t=e.code)||void 0===t?void 0:t.toUpperCase(),".","_")}),Array.isArray(null==e||null===(a=e[0])||void 0===a?void 0:a.tenants)&&(null==e||null===(u=e[0])||void 0===u||u.tenants.reverse());let t=_t(null==e||null===(d=e[0])||void 0===d?void 0:d.tenants,"code",r);k(t)}},[ae]),t.useEffect(()=>{(te||v)&&(j(""),X(""),q(null),H(""),V("")),v&&m.replace("/digit-ui/citizen/obps/edcrscrutiny/apply/acknowledgement",{data:null!=v&&v.label?null==v?void 0:v.label:"BPA_INTERNAL_SERVER_ERROR",type:"ERROR"})},[te,v,p]),oe||p?l.createElement(o.Loader,null):l.createElement(l.Fragment,null,l.createElement(o.FormStep,{config:u,onSelect:()=>{const e={};e.tenantId=Q,e.applicantName=O,e.file=T,e.coreArea=b,e.ulb=ee,e.areaType=_,e.schemeArea=w,e.schName=R,e.siteReserved=J,e.approvedCS=E,e.cluApprove=S,e.layoutFile=L,"SCHEME_AREA"===(null==_?void 0:_.code)?e.coreArea="NO":"NON_SCHEME_AREA"===(null==_?void 0:_.code)&&(e.coreArea=b),d(u.key,e)},onSkip:()=>{V("NEED TO DELETE")},isDisabled:!I(),t:r},l.createElement(o.CardLabel,null,r("EDCR_APPLICANT_NAME")),l.createElement(o.TextInput,{t:r,isMandatory:!0,type:"text",name:"applicantName",value:O,onChange:e=>j(e.target.value)}),l.createElement(o.CardLabel,null,r("EDCR_ULB_NAME")),l.createElement(o.Dropdown,{t:r,isMandatory:!0,option:A,optionKey:"displayName",selected:M,select:e=>{z(e),K(null==e?void 0:e.code)},placeholder:r("COMMON_TABLE_SEARCH")}),l.createElement(o.CardLabel,null,r("EDCR_SCRUTINY_AREA_TYPE")),l.createElement(o.Dropdown,{t:r,isMandatory:!0,option:g,selected:_,optionKey:"value",select:D}),"SCHEME_AREA"===(null==_?void 0:_.code)&&l.createElement(l.Fragment,null,l.createElement(o.CardLabel,null,r("EDCR_SCRUTINY_SCHEME_AREA_TYPES")),l.createElement(o.Dropdown,{t:r,isMandatory:!0,option:x,selected:w,optionKey:"value",select:Y}),l.createElement(o.CardLabel,null,r("EDCR_SCHEME_NAME")),l.createElement(o.TextInput,{t:r,isMandatory:!0,type:"text",name:"schemeName",value:R,onChange:e=>$(e.target.value)}),l.createElement(o.CardLabel,null,r("EDCR_IS_SITE_RESERVED")),l.createElement(o.Dropdown,{t:r,isMandatory:!0,option:Z,selected:J,optionKey:"value",select:G}),"YES"===(null==J?void 0:J.code)&&l.createElement(l.Fragment,null,l.createElement(o.CardLabel,null,r("EDCR_IS_APPROVED_CONTROL_SHEET")),l.createElement(o.Dropdown,{t:r,isMandatory:!0,option:f,selected:E,optionKey:"value",select:F})),"YES"===(null==E?void 0:E.code)&&l.createElement(l.Fragment,null,l.createElement(o.CardLabel,null,r("EDCR_SCRUTINY_SCHEME_UPLOAD_LAYOUT")),l.createElement(o.UploadFile,{id:"edcr-layout",extraStyleName:"propertyCreate",onUpload:P,onDelete:()=>{W(null),H("")},message:L?"1 "+r("PT_ACTION_FILEUPLOADED"):r("ES_NO_FILE_SELECTED_LABEL"),error:C,uploadMessage:B}))),"NON_SCHEME_AREA"===(null==_?void 0:_.code)&&l.createElement(l.Fragment,null,l.createElement(o.CardLabel,null,r("EDCR_SCRUTINY_CLU_APPROVED")),l.createElement(o.Dropdown,{t:r,isMandatory:!0,option:h,selected:S,optionKey:"value",select:U}),"NO"!==(null==S?void 0:S.code)&&l.createElement(l.Fragment,null,l.createElement(o.CardLabel,null,r("EDCR_IS_CORE_AREA")),l.createElement(o.Dropdown,{t:r,isMandatory:!0,option:y,selected:b,optionKey:"value",select:X}))),"YES"!==(null==E?void 0:E.code)&&l.createElement(l.Fragment,null,l.createElement(o.CardLabel,null,r("EDCR_UPLOAD_DXF_FILE")),l.createElement(o.UploadFile,{id:"edcr-doc",extraStyleName:"propertyCreate",onUpload:N,onDelete:()=>{q(null),H("")},message:le?"1 "+r("PT_ACTION_FILEUPLOADED"):r("ES_NO_FILE_SELECTED_LABEL"),error:C,uploadMessage:te}))))},BasicDetails:e=>{var i,a,r,u,d,s,c,v,p,m,E,f;let{formData:_,onSelect:g,config:A}=e;const[S,h]=t.useState(null),[b,y]=t.useState((null==_||null===(i=_.data)||void 0===i?void 0:i.edcrDetails)||null),[C,T]=t.useState(null==_||null===(a=_.data)||void 0===a?void 0:a.scrutinyNumber),[D,N]=t.useState(!(null==_||null===(r=_.data)||void 0===r||!r.scrutinyNumber)),{t:P}=n.useTranslation(),I=Digit.ULBService.getStateId(),L=window.Digit.Utils.browser.isMobile(),{data:B}=Digit.Hooks.obps.useMDMS(I,"BPA",["RiskTypeComputation"]),O=Digit.Utils.obps.calculateRiskType(null==B||null===(u=B.BPA)||void 0===u?void 0:u.RiskTypeComputation,null==b||null===(d=b.planDetail)||void 0===d||null===(s=d.plot)||void 0===s?void 0:s.area,null==b||null===(c=b.planDetail)||void 0===c?void 0:c.blocks);let R=sessionStorage.getItem("isEDCRDisable");if(R=JSON.parse(R),R){let e=sessionStorage.getItem("isEDCRAPIType");e=!!e&&JSON.parse(e),e&&b||(sessionStorage.setItem("isEDCRAPIType",JSON.stringify(!0)),function(){try{Promise.resolve(Ft(null==C?void 0:C.edcrNumber,I)).then(function(e){"ERROR"==(null==e?void 0:e.type)&&(h({message:null==e?void 0:e.message}),y(null)),null!=e&&e.edcrNumber&&(y(e),h(null))})}catch(e){return Promise.reject(e)}}())}return l.createElement("div",null,S&&l.createElement(o.Toast,{error:!0,label:P(""+(null==S?void 0:S.message)),onClose:()=>{h(null)},isDleteBtn:!0}),l.createElement(Yl,null),l.createElement("div",{className:L?"obps-search":"",style:L?{}:{margin:"8px"}},l.createElement(o.Label,null,P("OBPS_SEARCH_EDCR_NUMBER")),l.createElement(o.TextInput,{className:"searchInput",onKeyPress:function(e){try{return Promise.resolve(function(){if("Enter"===e.key){if(null==C||!C.edcrNumber)return;return Promise.resolve(Ft(null==C?void 0:C.edcrNumber,I)).then(function(e){"ERROR"==(null==e?void 0:e.type)&&(h({message:null==e?void 0:e.message}),y(null)),null!=e&&e.edcrNumber&&(y(e),h(null))})}}())}catch(e){return Promise.reject(e)}},onChange:e=>T({edcrNumber:e.target.value}),value:null==C?void 0:C.edcrNumber,signature:!0,signatureImg:!R&&l.createElement(o.SearchIconSvg,{className:"signature-img",onClick:!R&&null!=C&&C.edcrNumber?()=>function(e){try{return Promise.resolve(Ft(null==C?void 0:C.edcrNumber,I)).then(function(e){"ERROR"==(null==e?void 0:e.type)&&(h({message:null==e?void 0:e.message}),y(null)),null!=e&&e.edcrNumber&&(y(e),h(null))})}catch(e){return Promise.reject(e)}}():null}),disable:R,style:{marginBottom:"10px"}})),b&&l.createElement(o.Card,null,l.createElement(o.CardCaption,null,P("BPA_SCRUTINY_DETAILS")),l.createElement(o.CardHeader,null,P("BPA_BASIC_DETAILS_TITLE")),l.createElement(o.StatusTable,null,l.createElement(o.Row,{className:"border-none",label:P("BPA_BASIC_DETAILS_APP_DATE_LABEL"),text:null!=b&&b.applicationDate?Fl(new Date(null==b?void 0:b.applicationDate),"dd/MM/yyyy"):null==b?void 0:b.applicationDate}),l.createElement(o.Row,{className:"border-none",label:P("BPA_BASIC_DETAILS_APPLICATION_TYPE_LABEL"),text:P("WF_BPA_"+(null==b?void 0:b.appliactionType))}),l.createElement(o.Row,{className:"border-none",label:P("BPA_BASIC_DETAILS_SERVICE_TYPE_LABEL"),text:P(null==b?void 0:b.applicationSubType)}),l.createElement(o.Row,{className:"border-none",label:P("BPA_BASIC_DETAILS_OCCUPANCY_LABEL"),text:null==b||null===(v=b.planDetail)||void 0===v||null===(p=v.planInformation)||void 0===p?void 0:p.occupancy}),l.createElement(o.Row,{className:"border-none",label:P("BPA_BASIC_DETAILS_RISK_TYPE_LABEL"),text:P("WF_BPA_"+O)}),l.createElement(o.Row,{className:"border-none",label:P("BPA_BASIC_DETAILS_APPLICATION_NAME_LABEL"),text:null==b||null===(m=b.planDetail)||void 0===m||null===(E=m.planInformation)||void 0===E?void 0:E.applicantName})),O?l.createElement(o.SubmitBar,{label:P("CS_COMMON_NEXT"),onSubmit:e=>{var t,l,n,i,o,a,r,u;g(null==A?void 0:A.key,{scrutinyNumber:C,applicantName:null==b||null===(t=b.planDetail)||void 0===t||null===(l=t.planInformation)||void 0===l?void 0:l.applicantName,occupancyType:null==b||null===(n=b.planDetail)||void 0===n||null===(i=n.planInformation)||void 0===i?void 0:i.occupancy,applicationType:null==b?void 0:b.appliactionType,serviceType:null==b?void 0:b.applicationSubType,applicationDate:null==b?void 0:b.applicationDate,riskType:Digit.Utils.obps.calculateRiskType(null==B||null===(o=B.BPA)||void 0===o?void 0:o.RiskTypeComputation,null==b||null===(a=b.planDetail)||void 0===a||null===(r=a.plot)||void 0===r?void 0:r.area,null==b||null===(u=b.planDetail)||void 0===u?void 0:u.blocks),edcrDetails:b})},disabled:!(null!=C&&null!==(f=C.edcrNumber)&&void 0!==f&&f.length)}):l.createElement(o.Loader,null)))},DocsRequired:e=>{var a,r;let{onSelect:u}=e;const{t:d}=n.useTranslation(),s=Digit.ULBService.getCurrentTenantId(),c=Digit.ULBService.getStateId(),[v,p]=(i.useHistory(),i.useParams(),t.useState([])),[m,E]=t.useState([]),{data:f,isLoading:_}=Digit.Hooks.obps.useMDMS(c,"BPA","DocumentTypes"),{data:g}=Digit.Hooks.obps.useMDMS(c,"common-masters",["DocumentType"]),A=(Digit.Hooks.obps.useMDMS(c,"BPA",["RiskTypeComputation"]),Digit.UserService.getUser()),S={0:{tenantId:c},1:{id:null==A||null===(a=A.info)||void 0===a?void 0:a.id}},{data:h}=Digit.Hooks.obps.useBPAREGSearch(s,S),b=window.location.href.includes("ocbpa");sessionStorage.removeItem("clickOnBPAApplyAfterEDCR");const{data:y,isLoading:C}=Digit.Hooks.obps.useMDMS(c,"BPA",["homePageUrlLinks"]);return t.useEffect(()=>{let e,t="",l="",n="",i="",o=!0;for(let P=0;P<(null==h||null===(a=h.Licenses)||void 0===a?void 0:a.length);P++){var a,r,u,d,s,c,v,p,m,E,f,_,g,A,S,b,y,C,T,D,N;"APPROVED"===(null==h||null===(r=h.Licenses)||void 0===r||null===(u=r[P])||void 0===u?void 0:u.status)&&o&&(o=!1,t=(null==h||null===(d=h.Licenses)||void 0===d||null===(s=d[P])||void 0===s||null===(c=s.tradeLicenseDetail)||void 0===c||null===(v=c.tradeUnits)||void 0===v||null===(p=v[0])||void 0===p||null===(m=p.tradeType)||void 0===m?void 0:m.split(".")[0])||"ARCHITECT",l=null==h||null===(E=h.Licenses)||void 0===E||null===(f=E[P])||void 0===f?void 0:f.applicationNumber,n=null==h||null===(_=h.Licenses)||void 0===_||null===(g=_[P])||void 0===g||null===(A=g.tradeLicenseDetail)||void 0===A||null===(S=A.owners[0])||void 0===S?void 0:S.name,i=null==h||null===(b=h.Licenses)||void 0===b||null===(y=b[P])||void 0===y||null===(C=y.tradeLicenseDetail)||void 0===C||null===(T=C.owners[0])||void 0===T?void 0:T.permanentAddress,sessionStorage.setItem("BPA_ARCHITECT_NAME",JSON.stringify(t)),sessionStorage.setItem("BPA_STAKEHOLDER_REGISTRATION_NUMBER",JSON.stringify(l)),sessionStorage.setItem("BPA_STAKEHOLDER_NAME",JSON.stringify(n)),sessionStorage.setItem("BPA_STAKEHOLDER_ADDRESS",JSON.stringify(i)),e=null==h||null===(D=h.Licenses)||void 0===D||null===(N=D[P])||void 0===N?void 0:N.tradeLicenseDetail.additionalDetail.isSelfCertificationRequired,sessionStorage.setItem("isSelfCertificationRequired",JSON.stringify(e)))}},[h]),t.useEffect(()=>{if(!C){var e,t;const l=window.location.href.split("/"),n=l[l.length-2],i=l[l.length-3];null==y||null===(e=y.BPA)||void 0===e||null===(t=e.homePageUrlLinks)||void 0===t||t.map(e=>{(null==i?void 0:i.toUpperCase())===(null==e?void 0:e.applicationType)&&(null==n?void 0:n.toUpperCase())===(null==e?void 0:e.serviceType)&&E({flow:null==e?void 0:e.flow,applicationType:null==e?void 0:e.applicationType,serviceType:null==e?void 0:e.serviceType})})}},[!C]),t.useEffect(()=>{if(!_){let e=[],t=[];const l=window.location.href.split("/"),n=l[l.length-2],i=l[l.length-3];for(let t=0;t<f.length;t++)e[f[t].applicationType]||e[f[t].ServiceType]||(e[f[t].applicationType]=f[t]);Object.values(e).map(e=>{var l;(null==e?void 0:e.applicationType)==(null==i?void 0:i.toUpperCase())&&(null==e?void 0:e.ServiceType)==(null==n?void 0:n.toUpperCase())&&t.push(null==e?void 0:e.docTypes),null==t||null===(l=t[0])||void 0===l||l.forEach(e=>{var t,l;let n=e.code;e.dropdownData=[],null==g||null===(t=g["common-masters"])||void 0===t||null===(l=t.DocumentType)||void 0===l||l.forEach(t=>{let l=t.code.slice(0,n.length);n===l&&(e.hasDropdown=!0,t.i18nKey=t.code,e.dropdownData.push(t))})}),p(t)})}},[!_]),_?l.createElement(o.Loader,null):l.createElement(t.Fragment,null,l.createElement(o.Card,null,l.createElement(o.CardHeader,null,d(b?"BPA_OOCUPANCY_CERTIFICATE_APP_LABEL":"OBPS_NEW_BUILDING_PERMIT")),l.createElement(o.CardText,{style:{color:"#0B0C0C",marginTop:"12px",fontSize:"16px",fontWeight:"400",lineHeight:"24px"}},d("OBPS_NEW_BUILDING_PERMIT_DESCRIPTION")),_?l.createElement(o.Loader,null):l.createElement(t.Fragment,null,null==v||null===(r=v[0])||void 0===r?void 0:r.map((e,t)=>{var n;return l.createElement("div",null,l.createElement("div",{style:{fontWeight:700,marginBottom:"8px"},key:t},l.createElement("div",{style:{display:"flex"}},l.createElement("div",null,t+1+"."," "),l.createElement("div",null," "+d(null==e?void 0:e.code.replace(".","_"))))),l.createElement("div",{style:{marginBottom:"16px"}},null==e||null===(n=e.dropdownData)||void 0===n?void 0:n.map((t,n)=>{var i;return(null==e||null===(i=e.dropdownData)||void 0===i?void 0:i.length)!==n+1?l.createElement("span",null,d(null==t?void 0:t.i18nKey)+", "):l.createElement("span",null,""+d(null==t?void 0:t.i18nKey))})))})),l.createElement(o.SubmitBar,{label:d("CS_COMMON_NEXT"),onSubmit:()=>{if(null!==JSON.parse(sessionStorage.getItem("BPAintermediateValue"))){let e=JSON.parse(sessionStorage.getItem("BPAintermediateValue"));sessionStorage.setItem("BPAintermediateValue",null),u("",e)}else u("uiFlow",m)}})),l.createElement(o.CitizenInfoLabel,{info:d("CS_FILE_APPLICATION_INFO_LABEL"),text:d("OBPS_DOCS_FILE_SIZE"),className:"info-banner-wrap-citizen-override"}))},PlotDetails:e=>{var i,a,r,u,d,s,c,v,p,m,E,f;let{formData:_,onSelect:g,config:A}=e;const S=window.location.href.includes("editApplication"),[h,b]=t.useState(A),{t:y}=n.useTranslation(),[C,T]=t.useState(""),[D,N]=t.useState(""),[P,I]=t.useState(""),[L,B]=t.useState(""),[O,R]=t.useState(""),[w,x]=t.useState(""),[M,F]=t.useState(""),[k,U]=t.useState(""),[H,W]=t.useState(""),[j,$]=t.useState(""),[Y,z]=t.useState(""),[G,K]=t.useState(""),[V,q]=t.useState(""),[X,J]=t.useState(""),[Z,Q]=t.useState(""),[ee,te]=t.useState(""),le=(Digit.ULBService.getCurrentTenantId(),null==_||null===(i=_.uiFlow)||void 0===i?void 0:i.flow),ne=Digit.ULBService.getStateId();t.useEffect(()=>{if(S){const e={...A,inputs:A.inputs.map(e=>"boundaryWallLength"===e.name?{...e,disable:!0}:e)};b(e)}},[le,S]);const{data:ie,isLoading:oe}=Digit.Hooks.obps.useScrutinyDetails(ne,null==_||null===(a=_.data)||void 0===a?void 0:a.scrutinyNumber);if(oe)return l.createElement(o.Loader,null);const ae={khasraNumber:null==ie||null===(r=ie.planDetail)||void 0===r||null===(u=r.planInfoProperties)||void 0===u?void 0:u.KHASRA_NO,...null==_?void 0:_.data};return l.createElement("div",null,l.createElement(Yl,{flow:"OCBPA"===le?"OCBPA":""}),l.createElement(o.FormStep,{config:h,onSelect:e=>{g(null==h?void 0:h.key,{...e})},childrenAtTheBottom:!1,t:y,_defaultValues:ae,onSkip:()=>g()},l.createElement(o.StatusTable,null,l.createElement(o.Row,{className:"border-none",label:y("BPA_BOUNDARY_PLOT_AREA_LABEL"),text:null!=ie&&null!==(d=ie.planDetail)&&void 0!==d&&null!==(s=d.planInformation)&&void 0!==s&&s.plotArea?`${null==ie||null===(c=ie.planDetail)||void 0===c||null===(v=c.planInformation)||void 0===v?void 0:v.plotArea} ${y("BPA_SQ_MTRS_LABEL")}`:"NA"}),l.createElement(o.Row,{className:"border-none",label:y("BPA_PLOT_NUMBER_LABEL"),text:null==ie||null===(p=ie.planDetail)||void 0===p||null===(m=p.planInformation)||void 0===m?void 0:m.plotNo}),l.createElement(o.Row,{className:"border-none",label:y("BPA_KHATHA_NUMBER_LABEL"),text:null==ie||null===(E=ie.planDetail)||void 0===E||null===(f=E.planInfoProperties)||void 0===f?void 0:f.KHATA_NO}))))},ScrutinyDetails:e=>{var a,r,u,d,s,c,v,p,m,E,f,_,g,A,S,h,b,y,C,T,D,N,P,I,L,B,O,R,w,x;let{onSelect:M,formData:F,config:k}=e;const{t:U}=n.useTranslation(),[H,W]=(i.useHistory(),t.useState([])),[j,$]=t.useState((null==F?void 0:F.subOccupancy)||(null==F||null===(a=F.landInfo)||void 0===a?void 0:a.unit)||{}),[Y,z]=t.useState([]),[G,K]=t.useState([]);let V=Digit.UserService.getUser();const q=(null==V||null===(r=V.info)||void 0===r?void 0:r.permanentCity)||Digit.ULBService.getCurrentTenantId(),X=null==F||null===(u=F.uiFlow)||void 0===u?void 0:u.flow,[J,Z]=t.useState(null),Q=Digit.ULBService.getStateId(),{isMdmsLoading:ee,data:te}=Digit.Hooks.obps.useMDMS(Q,"BPA",["SubOccupancyType"]),{data:le}=Digit.Hooks.obps.useScrutinyDetails(q,null==F||null===(d=F.data)||void 0===d?void 0:d.scrutinyNumber,{enabled:!0});function ne(e){var t,l;let n=[];return null==e||null===(t=e.building)||void 0===t||null===(l=t.floors)||void 0===l||l.map(e=>{var t,l,i,o,a,r,u,d;n.push({Floor:U("BPA_FLOOR_NAME_"+e.number),Level:e.number,Occupancy:U(""+(null===(t=e.occupancies)||void 0===t||null===(l=t[0])||void 0===l?void 0:l.type)),BuildupArea:null===(i=e.occupancies)||void 0===i||null===(o=i[0])||void 0===o?void 0:o.builtUpArea,FloorArea:(null===(a=e.occupancies)||void 0===a||null===(r=a[0])||void 0===r?void 0:r.floorArea)||0,CarpetArea:(null===(u=e.occupancies)||void 0===u||null===(d=u[0])||void 0===d?void 0:d.CarpetArea)||0,key:U("BPA_FLOOR_NAME_"+e.number)})}),n}function ie(){var e,t;let l=[];return null==te||null===(e=te.BPA)||void 0===e||null===(t=e.SubOccupancyType)||void 0===t||t.map(e=>{var t;l.push({code:e.code,name:e.name,i18nKey:"BPA_SUBOCCUPANCYTYPE_"+ft(null==e||null===(t=e.code)||void 0===t?void 0:t.toUpperCase(),"-","_")})}),Digit.Utils.locale.sortDropdownNames(l,"i18nKey",U)}const oe=e=>{let{label:t,jumpTo:a}=e;const{t:r}=n.useTranslation();return i.useHistory(),l.createElement(o.LinkButton,{label:r(t),onClick:function(){location.href=a}})},ae=[{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"}],re=e=>{const t=e;return(e,l,n)=>e[t]},ue=t.useMemo(()=>null==ae?void 0:ae.map(e=>({Header:U(""+e.name),accessor:re(e.id),id:e.id})));function de(e){var t,l,n,i,o;let a=null==F||null===(t=F.data)||void 0===t||null===(l=t.bpaData)||void 0===l||null===(n=l.bpaApprovalResponse)||void 0===n||null===(i=n[0])||void 0===i||null===(o=i.landInfo)||void 0===o?void 0:o.unit,r="";if((null==a?void 0:a.length)>0){var u,d;let t=null===(u=a[e])||void 0===u||null===(d=u.usageCategory)||void 0===d?void 0:d.split(",");null!=t&&t.length&&(r=(null==t?void 0:t.map(e=>e?""+U("BPA_SUBOCCUPANCYTYPE_"+ft(null==e?void 0:e.toUpperCase(),"-","_")):"NA")).join(", "))}return r||"NA"}return ee?l.createElement(o.Loader,null):l.createElement(l.Fragment,null,l.createElement(Yl,{currentStep:"OCBPA"===X?2:1,flow:"OCBPA"===X?"OCBPA":""}),l.createElement(o.FormStep,{t:U,config:k,onSelect:()=>{if("OCBPA"===X)if(null!=F&&F.id)M("",F,"",!0);else{var e,t,l,n,i,o,a,r,u,d,s,c,v,p,m,E,f,_,g,A,S,h,b,y,C;let T={};T.edcrNumber=null!=F&&null!==(e=F.edcrNumber)&&void 0!==e&&e.edcrNumber?null==F||null===(t=F.edcrNumber)||void 0===t?void 0:t.edcrNumber:null==F||null===(l=F.data)||void 0===l||null===(n=l.scrutinyNumber)||void 0===n?void 0:n.edcrNumber,T.riskType=null==F||null===(i=F.data)||void 0===i?void 0:i.riskType,T.applicationType=null==F||null===(o=F.data)||void 0===o?void 0:o.applicationType,T.serviceType=null==F||null===(a=F.data)||void 0===a?void 0:a.serviceType;const D=Digit.UserService.getUser(),N=null==D||null===(r=D.info)||void 0===r?void 0:r.uuid;T.tenantId=null==F||null===(u=F.data)||void 0===u||null===(d=u.bpaData)||void 0===d||null===(s=d.bpaApprovalResponse)||void 0===s||null===(c=s[0])||void 0===c||null===(v=c.landInfo)||void 0===v?void 0:v.tenantId,T.workflow={action:"INITIATE",assignes:[null==D||null===(p=D.info)||void 0===p?void 0:p.uuid]},T.accountId=N,T.documents=null,T.additionalDetails={},null!=F&&null!==(m=F.data)&&void 0!==m&&m.holdingNumber&&(T.additionalDetails.holdingNo=null==F||null===(E=F.data)||void 0===E?void 0:E.holdingNumber),null!=F&&null!==(f=F.data)&&void 0!==f&&f.registrationDetails&&(T.additionalDetails.registrationDetails=null==F||null===(_=F.data)||void 0===_?void 0:_.registrationDetails),null!=F&&null!==(g=F.data)&&void 0!==g&&g.applicationType&&(T.additionalDetails.applicationType=null==F||null===(A=F.data)||void 0===A?void 0:A.applicationType),null!=F&&null!==(S=F.data)&&void 0!==S&&S.serviceType&&(T.additionalDetails.serviceType=null==F||null===(h=F.data)||void 0===h?void 0:h.serviceType),T.landInfo=(null==F||null===(b=F.data)||void 0===b||null===(y=b.bpaData)||void 0===y||null===(C=y.bpaApprovalResponse)||void 0===C?void 0:C[0].landInfo)||{};let P=sessionStorage.getItem("BPA_ARCHITECT_NAME"),I=P?JSON.parse(P):"ARCHITECT";T.additionalDetails.typeOfArchitect=I,Digit.OBPSService.create({BPA:T},q).then((e,t)=>{var l;(null==e||null===(l=e.BPA)||void 0===l?void 0:l.length)>0&&(e.BPA[0].data=F.data,e.BPA[0].uiFlow=null==F?void 0:F.uiFlow,M("",e.BPA[0],"",!0))}).catch(e=>{var t,l,n;Z({key:"true",message:(null==e||null===(t=e.response)||void 0===t||null===(l=t.data)||void 0===l||null===(n=l.Errors[0])||void 0===n?void 0:n.message)||null})})}else M(k.key,j)},onSkip:()=>M()},l.createElement(o.CardSubHeader,{style:{fontSize:"20px"}},U("BPA_EDCR_DETAILS")),l.createElement(o.StatusTable,{style:{border:"none"}},l.createElement(o.Row,{className:"border-none",style:{border:"none"},label:U("OCBPA"===X?"BPA_OC_EDCR_NO_LABEL":"BPA_EDCR_NO_LABEL"),text:null==le?void 0:le.edcrNumber,labelStyle:{wordBreak:"break-all"},textStyle:{wordBreak:"break-all"}}),l.createElement(o.Row,{className:"border-none",label:U("BPA_UPLOADED_PLAN_DIAGRAM"),text:l.createElement(oe,{label:U("Uploaded Plan.pdf"),jumpTo:null==le?void 0:le.updatedDxfFile,onClick:()=>{console.log("")}})}),l.createElement(o.Row,{className:"border-none",label:U("BPA_SCRUNTINY_REPORT_OUTPUT"),text:l.createElement(oe,{label:U("BPA_SCRUTINY_REPORT_PDF"),jumpTo:null==le?void 0:le.planReport,onClick:()=>{console.log("")}})})),l.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",height:"2px",marginTop:"20px",marginBottom:"20px"}}),l.createElement(o.CardSubHeader,{style:{fontSize:"20px"}},U("OCBPA"===X?"BPA_ACTUAL_BUILDING_EXTRACT_HEADER":"BPA_BUILDING_EXTRACT_HEADER")),l.createElement(o.StatusTable,{style:{border:"none"}},l.createElement(o.Row,{className:"border-none",label:U("BPA_TOTAL_BUILT_UP_AREA_HEADER"),text:null!=le&&null!==(s=le.planDetail)&&void 0!==s&&null!==(c=s.blocks)&&void 0!==c&&null!==(v=c[0])&&void 0!==v&&null!==(p=v.building)&&void 0!==p&&p.totalBuitUpArea?`${null==le||null===(m=le.planDetail)||void 0===m||null===(E=m.blocks)||void 0===E||null===(f=E[0])||void 0===f||null===(_=f.building)||void 0===_?void 0:_.totalBuitUpArea} ${U("BPA_SQ_MTRS_LABEL")}`:U("NA")}),l.createElement(o.Row,{className:"border-none",label:U("BPA_SCRUTINY_DETAILS_NUMBER_OF_FLOORS_LABEL"),text:null==le||null===(g=le.planDetail)||void 0===g||null===(A=g.blocks)||void 0===A||null===(S=A[0])||void 0===S||null===(h=S.building)||void 0===h?void 0:h.totalFloors}),l.createElement(o.Row,{className:"border-none",label:U("BPA_HEIGHT_FROM_GROUND_LEVEL_FROM_MUMTY"),text:null!=le&&null!==(b=le.planDetail)&&void 0!==b&&null!==(y=b.blocks)&&void 0!==y&&null!==(C=y[0])&&void 0!==C&&null!==(T=C.building)&&void 0!==T&&T.declaredBuildingHeight?`${null==le||null===(D=le.planDetail)||void 0===D||null===(N=D.blocks)||void 0===N||null===(P=N[0])||void 0===P||null===(I=P.building)||void 0===I?void 0:I.declaredBuildingHeight} ${U("BPA_MTRS_LABEL")}`:U("NA")})),l.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",height:"2px",marginTop:"20px",marginBottom:"20px"}}),l.createElement(o.CardSubHeader,{style:{fontSize:"20px"}},U("BPA_OCC_SUBOCC_HEADER")),null==le||null===(L=le.planDetail)||void 0===L||null===(B=L.blocks)||void 0===B?void 0:B.map((e,t)=>{var n;return l.createElement("div",{key:t,style:{marginTop:"20px"}},l.createElement(o.CardSubHeader,{style:{fontSize:"18px"}},U("BPA_BLOCK_SUBHEADER")," ",t+1),"OCBPA"!==X?l.createElement(o.CardSectionHeader,{style:{fontWeight:"normal"},className:"card-label-smaller"},U("BPA_SUB_OCCUPANCY_LABEL")):null,"OCBPA"!==X?l.createElement(o.MultiSelectDropdown,{BlockNumber:e.number,className:"form-field",isMandatory:!0,defaultUnit:"Selected",selected:j["Block_"+e.number],options:ie(),onSelect:t=>((e,t,l)=>{let n=j,i=[];e&&(null==e||e.map(e=>{i.push(null==e?void 0:e[1])})),n["Block_"+l]=i,W(i),$(n)})(t,0,e.number),isOBPSMultiple:!0,optionsKey:"i18nKey",ServerStyle:{width:"100%",overflowX:"hidden"},t:U}):null,"OCBPA"!==X?l.createElement("div",{className:"tag-container"},j["Block_"+e.number]&&j["Block_"+e.number].length>0&&(null===(n=j["Block_"+e.number])||void 0===n?void 0:n.map((t,n)=>l.createElement(o.RemoveableTag,{key:n,text:""+U(t.i18nKey),onClick:()=>((e,t,l)=>{let n=j["Block_"+l].filter((t,l)=>l!==e);W(n);let i=j;i["Block_"+l]=n,$(i)})(n,0,e.number)})))):null,"OCBPA"!==X?j["Block_"+e.number]&&j["Block_"+e.number].length>0&&l.createElement(o.LinkButton,{style:{textAlign:"left"},label:"Clear All",onClick:()=>(e=>{let t=[],l=j;l["Block_"+e]=t,W(t),$(l)})(e.number)}):null,l.createElement("div",{style:{marginTop:"20px"}},"OCBPA"===X?l.createElement(o.StatusTable,null,l.createElement(o.Row,{className:"border-none",label:""+U("BPA_SUB_OCCUPANCY_LABEL"),text:de(t)})):null,l.createElement("div",{style:{overflowX:"scroll"}},l.createElement(o.Table,{className:"customTable table-fixed-first-column table-border-style",t:U,disableSort:!1,autoSort:!0,manualPagination:!1,isPaginationRequired:!1,initSortId:"S N ",data:ne(e),columns:ue,getCellProps:e=>({style:{}})}))))}),l.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",height:"2px",marginTop:"20px",marginBottom:"20px"}}),l.createElement(o.CardSubHeader,{style:{fontSize:"20px"}},U("BPA_APP_DETAILS_DEMOLITION_DETAILS_LABEL")),l.createElement(o.StatusTable,{style:{border:"none"}},l.createElement(o.Row,{label:U("BPA_APPLICATION_DEMOLITION_AREA_LABEL"),text:null!=le&&null!==(O=le.planDetail)&&void 0!==O&&null!==(R=O.planInformation)&&void 0!==R&&R.demolitionArea?`${null==le||null===(w=le.planDetail)||void 0===w||null===(x=w.planInformation)||void 0===x?void 0:x.demolitionArea} ${U("BPA_SQ_MTRS_LABEL")}`:U("CS_NA")}))),J&&l.createElement(o.Toast,{error:!0,label:U(null==J?void 0:J.message),isDleteBtn:!0,onClose:()=>{Z(null)}}))},BPANewBuildingdetails:e=>{var n,r,u,d,v,p,m,E,f,_,g,A,S,h,b,y,C,T,D;let{t:N,config:P,onSelect:I,formData:L}=e;i.useLocation();let B=window.location.href.charAt(window.location.href.length-1),O={};const[R,w]=t.useState((null==L||null===(n=L.owners)||void 0===n?void 0:n.approvedColony)||""),[x,M]=t.useState((null==L||null===(r=L.owners)||void 0===r?void 0:r.masterPlan)||""),[F,k]=t.useState((null==L||null===(u=L.owners)||void 0===u?void 0:u.UlbName)||""),[U,H]=t.useState((null==L||null===(d=L.owners)||void 0===d?void 0:d.buildingStatus)||""),[W,j]=t.useState((null==L||null===(v=L.owners)||void 0===v?void 0:v.schemes)||""),[$,Y]=t.useState((null==L||null===(p=L.owners)||void 0===p?void 0:p.purchasedFAR)||""),[z,G]=t.useState((null==L||null===(m=L.owners)||void 0===m?void 0:m.greenbuilding)||""),[K,V]=t.useState((null==L||null===(E=L.owners)||void 0===E?void 0:E.restrictedArea)||""),[q,X]=t.useState((null==L||null===(f=L.owners)||void 0===f?void 0:f.District)||""),[J,Z]=t.useState((null==L||null===(_=L.owners)||void 0===_?void 0:_.proposedSite)||""),[Q,ee]=t.useState((null==L||null===(g=L.owners)||void 0===g?void 0:g.nameofApprovedcolony)||""),[te,le]=t.useState((null==L||null===(A=L.owners)||void 0===A?void 0:A.NocNumber)||""),[ne,ie]=t.useState((null==L||null===(S=L.owners)||void 0===S?void 0:S.schemesselection)||""),[oe,ae]=t.useState((null==L||null===(h=L.owners)||void 0===h?void 0:h.schemeName)||""),[re,ue]=t.useState("Pre-Approved Standard Designs"),[de,se]=t.useState((null==L||null===(b=L.owners)||void 0===b?void 0:b.rating)||""),[ce,ve]=t.useState((null==L||null===(y=L.owners)||void 0===y?void 0:y.use)||""),[pe,me]=t.useState((null==L||null===(C=L.owners)||void 0===C?void 0:C.Ulblisttype)||""),[Ee,fe]=t.useState(null==L||null===(T=L.owners)||void 0===T?void 0:T.uploadedFile),[_e,ge]=t.useState(null==L||null===(D=L.owners)||void 0===D?void 0:D.greenuploadedFile),[Ae,Se]=t.useState(),[he,be]=t.useState(),[ye,Ce]=t.useState(null),[Te,De]=t.useState("");Digit.Utils.browser.isMobile(),t.useEffect(()=>{!function(){try{Ce(null);const e=function(){if(he&&null!=he&&he.type){const e=function(e,t,l){if(null!==(e=".pdf".split(","))&&void 0!==e&&e.includes("."+(null==he||null===(t=he.type)||void 0===t||null===(l=t.split("/"))||void 0===l?void 0:l.pop()))){const e=function(){if(he.size>=2e6)Ce(N("PT_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=c(function(){return Promise.resolve(Digit.UploadServices.Filestorage("property-upload",he,Digit.ULBService.getStateId())).then(function(e){var t,l,n,i;(null==e||null===(t=e.data)||void 0===t||null===(l=t.files)||void 0===l?void 0:l.length)>0?fe(null==e||null===(n=e.data)||void 0===n||null===(i=n.files[0])||void 0===i?void 0:i.fileStoreId):Ce(N("PT_FILE_UPLOAD_ERROR"))})},function(){});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}else Ce(N("PT_UPLOAD_FORMAT_NOT_SUPPORTED"))}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[he]),t.useEffect(()=>{!function(){try{Ce(null);const e=function(){if(Ae&&null!=Ae&&Ae.type){const e=function(e,t,l){if(null!==(e=".pdf".split(","))&&void 0!==e&&e.includes("."+(null==Ae||null===(t=Ae.type)||void 0===t||null===(l=t.split("/"))||void 0===l?void 0:l.pop()))){const e=function(){if(Ae.size>=2e6)Ce(N("PT_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=c(function(){return Promise.resolve(Digit.UploadServices.Filestorage("property-upload",Ae,Digit.ULBService.getStateId())).then(function(e){var t,l,n,i;(null==e||null===(t=e.data)||void 0===t||null===(l=t.files)||void 0===l?void 0:l.length)>0?ge(null==e||null===(n=e.data)||void 0===n||null===(i=n.files[0])||void 0===i?void 0:i.fileStoreId):Ce(N("PT_FILE_UPLOAD_ERROR"))})},function(){});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}else Ce(N("PT_UPLOAD_FORMAT_NOT_SUPPORTED"))}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[Ae]);const Ne=[{code:"YES",i18nKey:"YES"},{code:"NO",i18nKey:"NO"},{code:"LAL_LAKEER",i18nKey:"LAL LAKEER"}],Pe=[{code:"YES",i18nKey:"YES"},{code:"NO",i18nKey:"NO"}],Ie=[{code:"PROPOSED",i18nKey:"Proposed"}],Le=Digit.ULBService.getStateId(),{data:Be}=Digit.Hooks.obps.useUlbType(Le,"BPA","UlbType"),{data:Oe}=Digit.Hooks.obps.useDistricts(Le,"BPA","Districts"),{data:Re}=Digit.Hooks.obps.useULBList(Le,"BPA","Ulb");let we=[],xe=[],Me=[];Be&&Be.map(e=>{(null==e?void 0:e.Districts)===(null==F?void 0:F.code)&&we.push({i18nKey:""+e.name,code:""+e.code,value:""+e.name})}),Oe&&Oe.map(e=>{xe.push({i18nKey:""+e.name,code:""+e.code,value:""+e.name})}),Re&&Re.map(e=>{e.Districts==(null==F?void 0:F.code)&&Me.push({i18nKey:""+e.name,code:""+e.code,value:""+e.name})});const{data:Fe}=Digit.Hooks.useCustomMDMS(Digit.ULBService.getStateId(),"BPA",[{name:"BuildingStatus"}],{select:e=>{var t;return null==e||null===(t=e.BPA)||void 0===t?void 0:t.BuildingStatus}});let ke=[];Fe&&Fe.map(e=>{ke.push({i18nKey:"BPA_"+e.code,code:""+e.code,value:""+e.name})});const{data:Ue}=Digit.Hooks.useCustomMDMS(Digit.ULBService.getStateId(),"BPA",[{name:"RatingValue"}],{select:e=>{var t;return null==e||null===(t=e.BPA)||void 0===t?void 0:t.RatingValue}});let He=[];Ue&&Ue.map(e=>{He.push({i18nKey:"BPA_"+e.code,code:""+e.code,value:""+e.name})});const{data:We}=Digit.Hooks.useCustomMDMS(Digit.ULBService.getStateId(),"BPA",[{name:"MasterFields"}],{select:e=>{var t;return null==e||null===(t=e.BPA)||void 0===t?void 0:t.MasterFields}});let je=[];We&&We.map(e=>{je.push({i18nKey:"BPA_"+e.code,code:""+e.code,value:""+e.name})});const{data:$e}=Digit.Hooks.useCustomMDMS(Digit.ULBService.getStateId(),"BPA",[{name:"Scheme"}],{select:e=>{var t;return null==e||null===(t=e.BPA)||void 0===t?void 0:t.Scheme}});let Ye=[];$e&&$e.map(e=>{Ye.push({i18nKey:"BPA_"+e.code,code:""+e.code,value:""+e.name})});const{data:ze}=Digit.Hooks.useCustomMDMS(Digit.ULBService.getStateId(),"BPA",[{name:"SchemeType"}],{select:e=>{var t;return null==e||null===(t=e.BPA)||void 0===t?void 0:t.SchemeType}});let Ge=[];ze&&ze.map(e=>{Ge.push({i18nKey:"BPA_"+e.code,code:""+e.code,value:""+e.name})});const{control:Ke}=a.useForm();function Ve(e){ee(e.target.value)}function qe(e){le(e.target.value)}function Xe(e){ae(e.target.value)}function Je(e){ue(e.target.value)}function Ze(e){fe(e.target.files[0]),be(e.target.files[0])}function Qe(e){ge(e.target.files[0]),Se(e.target.files[0])}return l.createElement(l.Fragment,null,l.createElement(Yl,{currentStep:2}),l.createElement(o.FormStep,{config:P,onSelect:()=>{let e={...L.owners&&L.owners[B],approvedColony:R,use:ce,UlbName:F,Ulblisttype:pe,District:q,rating:de,masterPlan:x,buildingStatus:U,schemes:W,schemesselection:ne,purchasedFAR:$,greenbuilding:z,restrictedArea:K,proposedSite:J,nameofApprovedcolony:Q,schemeName:oe,transferredscheme:re,NocNumber:te,uploadedFile:Ee,greenuploadedFile:_e},t={...L};var l,n,i;t.owners||(t.owners=[]),"NO"==(null==R?void 0:R.code)?te||Ee||null!=L&&null!==(l=L.owners)&&void 0!==l&&l.uploadedFile?"YES"===(null==z?void 0:z.code)?_e||null!=L&&null!==(n=L.owners)&&void 0!==n&&n.greenuploadedFile?I(P.key,{...L[P.key],...e},t,!1,B):alert("Please Upload Document"):I(P.key,{...L[P.key],...e},t,!1,B):alert("Please fill NOC number or Upload NOC Document"):"YES"===(null==z?void 0:z.code)?_e||null!=L&&null!==(i=L.owners)&&void 0!==i&&i.greenuploadedFile?I(P.key,{...L[P.key],...e},t,!1,B):alert("Please Upload Document"):I(P.key,{...L[P.key],...e},t,!1,B)},onSkip:()=>I(),t:N,isDisabled:!(R&&x&&pe&&F&&U&&W&&$&&z&&K&&J)},l.createElement("div",null,l.createElement(o.CardLabel,null,""+N("BPA_APPROVED_COLONY")),l.createElement(a.Controller,{control:Ke,name:"approvedColony",defaultValue:R,rules:{required:N("CORE_COMMON_REQUIRED_ERRMSG")},render:e=>l.createElement(o.Dropdown,{className:"form-field",selected:R,select:w,option:Ne,optionKey:"i18nKey",t:N})}),(()=>{var e;switch(null==R?void 0:R.code){case"YES":return l.createElement(t.Fragment,null,l.createElement(o.CardLabel,null,""+N("BPA_APPROVED_COLONY_NAME")),l.createElement(o.TextInput,s({t:N,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"nameofApprovedcolony",value:Q,onChange:Ve,style:{width:"86%"},ValidationRequired:!1},O={isRequired:!0,pattern:"^[a-zA-Z ]*$",type:"text",title:N("TL_NAME_ERROR_MESSAGE")})));case"NO":return l.createElement(t.Fragment,null,l.createElement(o.CardLabel,null,""+N("BPA_NOC_NUMBER")),l.createElement("div",{className:"field-container"},l.createElement(o.TextInput,s({t:N,type:"text",isMandatory:!1,optionKey:"i18nKey",defaultValue:null==L||null===(e=L.owners)||void 0===e?void 0:e.NocNumber,name:"NocNumber",value:te,onChange:qe,style:{width:"86%"},ValidationRequired:!1},O={pattern:"^[a-zA-Z0-9]*$",type:"text",title:N("TL_NAME_ERROR_MESSAGE")})),l.createElement("div",{style:{position:"relative",zIndex:"100",right:"95px",marginTop:"-24px",marginRight:"-20px"},onClick:e=>{console.log("inside_NOC_search")}}," ",l.createElement(o.SearchIcon,null)," ")),l.createElement("div",{style:{position:"relative",fontWeight:"bold",left:"20px"}},"OR"),l.createElement(o.UploadFile,{id:"noc-doc",style:{width:"86%"},onUpload:Ze,onDelete:()=>{fe(null),be("")},message:Ee?"1 "+N("FILEUPLOADED"):N("ES_NO_FILE_SELECTED_LABEL"),error:ye,uploadMessage:Te}));default:return null}})(),l.createElement(o.CardLabel,{style:{marginTop:"15px"}},""+N("BPA_MASTER_PLAN")),l.createElement(a.Controller,{control:Ke,name:"masterPlan",defaultValue:x,rules:{required:N("CORE_COMMON_REQUIRED_ERRMSG")},render:e=>l.createElement(o.Dropdown,{className:"form-field",selected:x,select:M,option:Pe,optionKey:"i18nKey",t:N})}),(()=>{switch(null==x?void 0:x.code){case"YES":return l.createElement(t.Fragment,null,l.createElement(o.CardLabel,null,""+N("BPA_USE")),l.createElement(a.Controller,{control:Ke,name:"use",defaultValue:ce,rules:{required:N("CORE_COMMON_REQUIRED_ERRMSG")},render:e=>l.createElement(o.Dropdown,{className:"form-field",selected:ce,select:ve,option:je,optionKey:"i18nKey",t:N})}));case"NO":default:return null}})(),l.createElement(o.CardLabel,null,""+N("BPA_ULB_NAME")),l.createElement(a.Controller,{control:Ke,name:"UlbName",defaultValue:F,rules:{required:N("CORE_COMMON_REQUIRED_ERRMSG")},render:e=>l.createElement(o.Dropdown,{className:"form-field",selected:F,select:k,option:xe,optionKey:"i18nKey",t:N})}),l.createElement(o.CardLabel,null,""+N("BPA_DISTRICT")),l.createElement(a.Controller,{control:Ke,name:"District",defaultValue:q,rules:{required:N("CORE_COMMON_REQUIRED_ERRMSG")},render:e=>l.createElement(o.Dropdown,{className:"form-field",selected:q,select:X,option:Me,optionKey:"i18nKey",t:N})}),l.createElement(o.CardLabel,null,""+N("BPA_ULB_TYPE")),l.createElement(a.Controller,{control:Ke,name:"Ulblisttype",defaultValue:pe,rules:{required:N("CORE_COMMON_REQUIRED_ERRMSG")},render:e=>l.createElement(o.Dropdown,{className:"form-field",selected:pe,select:me,option:we,optionKey:"i18nKey",t:N})}),l.createElement(o.CardLabel,null,""+N("BPA_BUILDING_STATUS")),l.createElement(a.Controller,{control:Ke,name:"buildingStatus",defaultValue:U,rules:{required:N("CORE_COMMON_REQUIRED_ERRMSG")},render:e=>l.createElement(o.Dropdown,{className:"form-field",selected:U,select:H,option:ke,optionKey:"i18nKey",t:N})}),l.createElement(o.CardLabel,null,""+N("BPA_SCHEMES")),l.createElement(a.Controller,{control:Ke,name:"schemes",defaultValue:W,rules:{required:N("CORE_COMMON_REQUIRED_ERRMSG")},render:e=>l.createElement(o.Dropdown,{className:"form-field",selected:W,select:j,option:Ye,optionKey:"i18nKey",t:N})}),(()=>{switch(null==W?void 0:W.code){case"SCHEME":return l.createElement(t.Fragment,null,l.createElement(o.CardLabel,null,""+N("BPA_SCHEME_TYPE_LABEL")),l.createElement(a.Controller,{control:Ke,name:"schemesselection",defaultValue:ne,rules:{required:N("CORE_COMMON_REQUIRED_ERRMSG")},render:e=>l.createElement(o.Dropdown,{className:"form-field",selected:ne,select:ie,option:Ge,optionKey:"i18nKey",t:N})}),l.createElement(o.CardLabel,null,""+N("BPA_SCHEME_NAME")),l.createElement(o.TextInput,s({t:N,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"schemeName",value:oe,onChange:Xe,style:{width:"86%"},ValidationRequired:!1},O={isRequired:!0,pattern:"^[a-zA-Z-.`' ]*$",type:"text",title:N("PT_NAME_ERROR_MESSAGE")})),l.createElement(o.CardLabel,null,""+N("BPA_TRANFERRED_SCHEME_LABEL")),l.createElement(o.TextInput,s({t:N,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"transferredscheme",value:re,onChange:Je,style:{width:"86%"},ValidationRequired:!1},O={isRequired:!0,pattern:"^[a-zA-Z-.`' ]*$",type:"text",title:N("PT_NAME_ERROR_MESSAGE")})));case"NON_SCHEME":default:return null}})(),l.createElement(o.CardLabel,null,""+N("BPA_PURCHASED_FAR")),l.createElement(a.Controller,{control:Ke,name:"purchasedFAR",defaultValue:$,rules:{required:N("CORE_COMMON_REQUIRED_ERRMSG")},render:e=>l.createElement(o.Dropdown,{className:"form-field",selected:$,select:Y,option:Pe,optionKey:"i18nKey",t:N})}),l.createElement(o.CardLabel,null,""+N("BPA_GREEN_BUIDINGS")),l.createElement(a.Controller,{control:Ke,name:"greenbuilding",defaultValue:z,rules:{required:N("CORE_COMMON_REQUIRED_ERRMSG")},render:e=>l.createElement(o.Dropdown,{className:"form-field",selected:z,select:G,option:Pe,optionKey:"i18nKey",t:N})}),(()=>{switch(null==z?void 0:z.code){case"YES":return l.createElement(t.Fragment,null,l.createElement(o.UploadFile,{id:"green-building-doc",onUpload:Qe,onDelete:()=>{ge(null),Se("")},message:_e?"1 "+N("FILEUPLOADED"):N("ES_NO_FILE_SELECTED_LABEL"),error:ye,uploadMessage:Te}),l.createElement("br",null),l.createElement(o.CardLabel,null,""+N("BPA_SELECT_RATINGS")),l.createElement(a.Controller,{control:Ke,name:"rating",defaultValue:de,rules:{required:N("CORE_COMMON_REQUIRED_ERRMSG")},render:e=>l.createElement(o.Dropdown,{className:"form-field",selected:de,select:se,option:He,optionKey:"i18nKey",t:N})}));case"NO":default:return null}})(),l.createElement(o.CardLabel,null,""+N("BPA_RESTRICTED_AREA")),l.createElement(a.Controller,{control:Ke,name:"restrictedArea",defaultValue:K,rules:{required:N("CORE_COMMON_REQUIRED_ERRMSG")},render:e=>l.createElement(o.Dropdown,{className:"form-field",selected:K,select:V,option:Pe,optionKey:"i18nKey",t:N})}),l.createElement(o.CardLabel,null,""+N("BPA_PROPOSED_SITE_TYPE")),l.createElement(a.Controller,{control:Ke,name:"proposedSite",defaultValue:J,rules:{required:N("CORE_COMMON_REQUIRED_ERRMSG")},render:e=>l.createElement(o.Dropdown,{className:"form-field",selected:J,select:Z,option:Ie,optionKey:"i18nKey",t:N})}))))},OwnerDetails:e=>{var n,i,a,r,u,d,c,v,p;let{t:m,config:E,onSelect:f,formData:_}=e;console.log("formdatatstd",_);let g={};sessionStorage.removeItem("currentPincode");let A=window.location.href.includes("edit-application"),S=window.location.href.includes("renew-trade");Digit.ULBService.getCurrentTenantId();const h=Digit.ULBService.getStateId(),[b,y]=t.useState(!A&&!S),[C,T]=t.useState([]),[D,N]=t.useState([]),[P,I]=t.useState(null==_||null===(n=_.owners)||void 0===n?void 0:n.ownershipCategory),[L,B]=t.useState((null==_||null===(i=_.owners)||void 0===i?void 0:i.name)||""),[O,R]=t.useState((null==_||null===(a=_.owners)||void 0===a?void 0:a.emailId)||""),[w,x]=t.useState((null==_||null===(r=_.owners)||void 0===r?void 0:r.aadharNumber)||""),[M,F]=t.useState(!1),[k,U]=t.useState(null==_||null===(u=_.owners)||void 0===u?void 0:u.gender),[H,W]=t.useState((null==_||null===(d=_.owners)||void 0===d?void 0:d.mobileNumber)||""),[j,$]=t.useState(null),[Y,z]=t.useState(!1);Digit.Utils.browser.isMobile();const G=!(null==P||!P.code.includes("MULTIPLEOWNERS"));null==_||null===(c=_.owners)||void 0===c||null===(v=c.owners)||void 0===v||v.forEach(e=>{"false"==e.isPrimaryOwner&&(e.isPrimaryOwner=!1)});const[K,V]=t.useState((null==_?void 0:_.owners)&&(null==_||null===(p=_.owners)||void 0===p?void 0:p.owners)||[{name:"",gender:"",mobileNumber:null,isPrimaryOwner:!0}]),q=Digit.UserService.getUser();console.log("userrrr",q),t.useEffect(()=>{var e=0;K.map(t=>{null!=t&&t.isPrimaryOwner&&(e=1),y(!(null!=t&&t.name&&null!=t&&t.mobileNumber&&null!=t&&t.gender))}),b||!P||null!=P&&P.code.includes("SINGLEOWNER")||y(1!=e)},[K]),t.useEffect(()=>{const e=mt(K);P&&!G&&(null==e?void 0:e.length)>1&&V([{...e[0],isPrimaryOwner:!0}])},[P]);const{isLoading:X,data:J}=Digit.Hooks.obps.useMDMS(h,"common-masters",["OwnerShipCategory"]),{data:Z}=Digit.Hooks.obps.useMDMS(h,"common-masters",["GenderType"]);t.useEffect(()=>{var e;const t=null==J||null===(e=J["common-masters"])||void 0===e?void 0:e.OwnerShipCategory;if(t&&(null==t?void 0:t.length)>0){const e=t.filter(e=>{var t;return null==e||null===(t=e.code)||void 0===t?void 0:t.includes("INDIVIDUAL")});e.forEach(e=>{e.i18nKey="COMMON_MASTERS_OWNERSHIPCATEGORY_"+ft(null==e?void 0:e.code,".","_")}),T(e)}},[J]),t.useEffect(()=>{var e;const t=(null==Z||null===(e=Z["common-masters"])||void 0===e?void 0:e.GenderType)||[];if(t&&(null==t?void 0:t.length)>0){const e=t.filter(e=>e.active);e.forEach(e=>{e.i18nKey="COMMON_GENDER_"+e.code}),N(e)}},[Z]);const[Q,ee]=t.useState(null);function te(e){let t="";return e.map((e,l)=>{t=t+(0!==l?",":"")+e.code}),t}return l.createElement("div",null,l.createElement(Yl,{currentStep:3}),l.createElement(o.FormStep,{config:E,onSelect:function(){try{return ee(null),Promise.resolve(function(e,t){try{let e=!1,t=[];return t=null==K?void 0:K.map((e,t)=>{var l;return Digit.UserService.userSearch(Digit.ULBService.getStateId(),{userName:null==K||null===(l=K[t])||void 0===l?void 0:l.mobileNumber},{}).then(e=>e)}),Promise.resolve(Promise.all(t)).then(function(l){var n;t=l;let i=[],o=!1;return t&&(null===(n=t)||void 0===n?void 0:n.length)>0&&t.map(t=>{var l,n,a,r,u,d;o=null==t||null===(l=t.user)||void 0===l||null===(n=l[0])||void 0===n||null===(a=n.roles)||void 0===a||null===(r=a.filter(e=>"BPA_ARCHITECT"===e.code||"BPA_SUPERVISOR"===e.code))||void 0===r?void 0:r[0],K.find(e=>{var l,n,i,a,r,u;return!(null!=e&&e.uuid&&!o)&&((null==e?void 0:e.name)===(null==t||null===(l=t.user)||void 0===l||null===(n=l[0])||void 0===n?void 0:n.name)&&(null==e?void 0:e.mobileNumber)===(null==t||null===(i=t.user)||void 0===i||null===(a=i[0])||void 0===a?void 0:a.mobileNumber)||(null==e?void 0:e.mobileNumber)===(null==t||null===(r=t.user)||void 0===r||null===(u=r[0])||void 0===u?void 0:u.mobileNumber)&&o)})&&(e=!0,i.push(null==t||null===(u=t.user)||void 0===u||null===(d=u[0])||void 0===d?void 0:d.mobileNumber))}),(null==i?void 0:i.length)>0&&$({key:"true",error:!0,message:`${m("BPA_OWNER_VALIDATION_1")} ${null==i?void 0:i.join(", ")} ${m("BPA_OWNER_VALIDATION_2")}`}),1!=e})}catch(e){return Promise.reject(e)}}()).then(function(e){if(e)if(1==G&&1==K.length)window.scrollTo(0,0),ee("BPA_ERROR_MULTIPLE_OWNER");else{let e;if(e={..._.owners,owners:K,ownershipCategory:P},null!=_&&_.id)f(E.key,e);else{var t,l,n,i,o,a,r,u,d,s,c,v,p,m,g,A,S,h,b,y,C,T,D,N,I,L,B,O,R,w,x,M,F,k,U,H,W,j,$,Y,V,X,J,Z,Q,le,ne,ie,oe,ae,re,ue,de,se,ce,ve,pe,me,Ee,fe,_e,ge,Ae,Se,he,be,ye,Ce,Te,De,Ne,Pe,Ie,Le,Be,Oe,Re,we,xe,Me,Fe,ke,Ue,He,We,je,$e,Ye,ze,Ge,Ke,Ve,qe,Xe,Je,Ze,Qe,et,tt,lt,nt,it,ot,at,rt,ut,dt,st,ct,vt,pt,mt,Et,ft,_t,gt,At,St,ht,bt,yt,Ct,Tt,Dt,Nt,Pt,It,Lt,Bt,Ot,Rt,wt,xt,Mt,Ft,kt,Ut,Ht,Wt,jt,$t,Yt,zt,Gt,Kt,Vt,qt;z(!0);let E=[];null===(t=e)||void 0===t||null===(l=t.owners)||void 0===l||l.map(e=>{E.push({...e,active:!0,name:e.name,emailId:e.emailId,aadharNumber:e.aadharNumber,mobileNumber:e.mobileNumber,isPrimaryOwner:e.isPrimaryOwner,gender:e.gender.code,fatherOrHusbandName:"NAME"})});let G={};G.edcrNumber=null!=_&&null!==(n=_.edcrNumber)&&void 0!==n&&n.edcrNumber?null==_||null===(i=_.edcrNumber)||void 0===i?void 0:i.edcrNumber:null==_||null===(o=_.data)||void 0===o||null===(a=o.scrutinyNumber)||void 0===a?void 0:a.edcrNumber,G.riskType=null==_||null===(r=_.data)||void 0===r?void 0:r.riskType,G.applicationType=null==_||null===(u=_.data)||void 0===u?void 0:u.applicationType,G.serviceType=null==_||null===(d=_.data)||void 0===d?void 0:d.serviceType;const K=Digit.UserService.getUser(),ee=null==K||null===(s=K.info)||void 0===s?void 0:s.uuid;G.tenantId=null==_||null===(c=_.address)||void 0===c||null===(v=c.city)||void 0===v?void 0:v.code,G.workflow={action:"INITIATE",assignes:[null==K||null===(p=K.info)||void 0===p?void 0:p.uuid]},G.accountId=ee,G.documents=null,G.additionalDetails={GISPlaceName:null==_||null===(m=_.address)||void 0===m?void 0:m.placeName},G.additionalDetails.boundaryWallLength=(null==_||null===(g=_.data)||void 0===g?void 0:g.boundaryWallLength)||"NA",G.additionalDetails.area=(null==_?void 0:_.data.edcrDetails.planDetail.planInformation.plotArea).toString()||"NA",G.additionalDetails.height=(null==_?void 0:_.data.edcrDetails.planDetail.blocks[0].building.buildingHeight).toString()||"NA",G.additionalDetails.usage=(null==_?void 0:_.data.occupancyType)||"NA",G.additionalDetails.builtUpArea=(null==_?void 0:_.data.edcrDetails.planDetail.blocks[0].building.totalBuitUpArea).toString(),G.additionalDetails.ownerName=E.map(e=>e.name).join(","),null!=_&&null!==(A=_.data)&&void 0!==A&&A.registrationDetails&&(G.additionalDetails.registrationDetails=null==_||null===(S=_.data)||void 0===S?void 0:S.registrationDetails),null!=_&&null!==(h=_.data)&&void 0!==h&&h.applicationType&&(G.additionalDetails.applicationType=null==_||null===(b=_.data)||void 0===b?void 0:b.applicationType),null!=_&&null!==(y=_.data)&&void 0!==y&&y.serviceType&&(G.additionalDetails.serviceType=null==_||null===(C=_.data)||void 0===C?void 0:C.serviceType),null!=_&&null!==(T=_.data)&&void 0!==T&&T.wardnumber&&(G.additionalDetails.wardnumber=null==_||null===(D=_.data)||void 0===D?void 0:D.wardnumber),null!=_&&null!==(N=_.data)&&void 0!==N&&N.zonenumber&&(G.additionalDetails.zonenumber=null==_||null===(I=_.data)||void 0===I?void 0:I.zonenumber),null!=_&&null!==(L=_.data)&&void 0!==L&&L.khasraNumber&&(G.additionalDetails.khasraNumber=null==_||null===(B=_.data)||void 0===B?void 0:B.khasraNumber),null!=_&&null!==(O=_.data)&&void 0!==O&&O.applicationType&&(G.additionalDetails.applicationType=null==_||null===(R=_.data)||void 0===R?void 0:R.applicationType),null!=_&&null!==(w=_.data)&&void 0!==w&&w.serviceType&&(G.additionalDetails.serviceType=null==_||null===(x=_.data)||void 0===x?void 0:x.serviceType),null!=_&&null!==(M=_.data)&&void 0!==M&&M.architectid&&(G.additionalDetails.architectid=null==_||null===(F=_.data)||void 0===F?void 0:F.architectid),null!=_&&null!==(k=_.data)&&void 0!==k&&k.propertyuid&&(G.additionalDetails.propertyuid=null==_||null===(U=_.data)||void 0===U?void 0:U.propertyuid),null!=_&&null!==(H=_.data)&&void 0!==H&&H.bathnumber&&(G.additionalDetails.bathnumber=null==_||null===(W=_.data)||void 0===W?void 0:W.bathnumber),null!=_&&null!==(j=_.data)&&void 0!==j&&j.kitchenNumber&&(G.additionalDetails.kitchenNumber=null==_||null===($=_.data)||void 0===$?void 0:$.kitchenNumber),null!=_&&null!==(Y=_.data)&&void 0!==Y&&Y.approxinhabitants&&(G.additionalDetails.approxinhabitants=null==_||null===(V=_.data)||void 0===V?void 0:V.approxinhabitants),null!=_&&null!==(X=_.data)&&void 0!==X&&X.materialusedinfloor&&(G.additionalDetails.materialusedinfloor=null==_||null===(J=_.data)||void 0===J?void 0:J.materialusedinfloor),null!=_&&null!==(Z=_.data)&&void 0!==Z&&Z.distancefromsewer&&(G.additionalDetails.distancefromsewer=null==_||null===(Q=_.data)||void 0===Q?void 0:Q.distancefromsewer),null!=_&&null!==(le=_.data)&&void 0!==le&&le.sourceofwater&&(G.additionalDetails.sourceofwater=null==_||null===(ne=_.data)||void 0===ne?void 0:ne.sourceofwater),null!=_&&null!==(ie=_.data)&&void 0!==ie&&ie.watercloset&&(G.additionalDetails.watercloset=null==_||null===(oe=_.data)||void 0===oe?void 0:oe.watercloset),null!=_&&null!==(ae=_.data)&&void 0!==ae&&ae.materialused&&(G.additionalDetails.materialused=null==_||null===(re=_.data)||void 0===re?void 0:re.materialused),null!=_&&null!==(ue=_.data)&&void 0!==ue&&ue.materialusedinroofs&&(G.additionalDetails.materialusedinroofs=null==_||null===(de=_.data)||void 0===de?void 0:de.materialusedinroofs),null!=_&&null!==(se=_.owners)&&void 0!==se&&null!==(ce=se.approvedColony)&&void 0!==ce&&ce.code&&(G.additionalDetails.approvedColony=null==_||null===(ve=_.owners)||void 0===ve||null===(pe=ve.approvedColony)||void 0===pe?void 0:pe.code),null!=_&&null!==(me=_.owners)&&void 0!==me&&null!==(Ee=me.buildingStatus)&&void 0!==Ee&&Ee.code&&(G.additionalDetails.buildingStatus=null==_||null===(fe=_.owners)||void 0===fe||null===(_e=fe.buildingStatus)||void 0===_e?void 0:_e.code),null!=_&&null!==(ge=_.owners)&&void 0!==ge&&null!==(Ae=ge.greenbuilding)&&void 0!==Ae&&Ae.code&&(G.additionalDetails.greenbuilding=null==_||null===(Se=_.owners)||void 0===Se||null===(he=Se.greenbuilding)||void 0===he?void 0:he.code),null!=_&&null!==(be=_.owners)&&void 0!==be&&null!==(ye=be.masterPlan)&&void 0!==ye&&ye.code&&(G.additionalDetails.masterPlan=null==_||null===(Ce=_.owners)||void 0===Ce||null===(Te=Ce.masterPlan)||void 0===Te?void 0:Te.code),null!=_&&null!==(De=_.owners)&&void 0!==De&&null!==(Ne=De.proposedSite)&&void 0!==Ne&&Ne.code&&(G.additionalDetails.proposedSite=null==_||null===(Pe=_.owners)||void 0===Pe||null===(Ie=Pe.proposedSite)||void 0===Ie?void 0:Ie.code),null!=_&&null!==(Le=_.owners)&&void 0!==Le&&null!==(Be=Le.purchasedFAR)&&void 0!==Be&&Be.code&&(G.additionalDetails.purchasedFAR=null==_||null===(Oe=_.owners)||void 0===Oe||null===(Re=Oe.purchasedFAR)||void 0===Re?void 0:Re.code),null!=_&&null!==(we=_.owners)&&void 0!==we&&null!==(xe=we.restrictedArea)&&void 0!==xe&&xe.code&&(G.additionalDetails.restrictedArea=null==_||null===(Me=_.owners)||void 0===Me||null===(Fe=Me.restrictedArea)||void 0===Fe?void 0:Fe.code),null!=_&&null!==(ke=_.owners)&&void 0!==ke&&null!==(Ue=ke.schemes)&&void 0!==Ue&&Ue.i18nKey&&(G.additionalDetails.schemes=null==_||null===(He=_.owners)||void 0===He||null===(We=He.schemes)||void 0===We?void 0:We.i18nKey),null!=_&&null!==(je=_.owners)&&void 0!==je&&null!==($e=je.UlbName)&&void 0!==$e&&$e.code&&(G.additionalDetails.UlbName=null==_||null===(Ye=_.owners)||void 0===Ye||null===(ze=Ye.UlbName)||void 0===ze?void 0:ze.code.toLowerCase().replace(/^\w/,e=>e.toUpperCase())),null!=_&&null!==(Ge=_.owners)&&void 0!==Ge&&null!==(Ke=Ge.District)&&void 0!==Ke&&Ke.code&&(G.additionalDetails.District=null==_||null===(Ve=_.owners)||void 0===Ve||null===(qe=Ve.District)||void 0===qe?void 0:qe.code),null!=_&&null!==(Xe=_.owners)&&void 0!==Xe&&Xe.nameofApprovedcolony&&(G.additionalDetails.nameofApprovedcolony=null==_||null===(Je=_.owners)||void 0===Je?void 0:Je.nameofApprovedcolony),null!=_&&null!==(Ze=_.owners)&&void 0!==Ze&&Ze.NocNumber&&(G.additionalDetails.NocNumber=null==_||null===(Qe=_.owners)||void 0===Qe?void 0:Qe.NocNumber),null!=_&&null!==(et=_.owners)&&void 0!==et&&null!==(tt=et.coreArea)&&void 0!==tt&&tt.code&&(G.additionalDetails.coreArea=null==_||null===(lt=_.owners)||void 0===lt||null===(nt=lt.coreArea)||void 0===nt?void 0:nt.code),null!=_&&null!==(it=_.owners)&&void 0!==it&&null!==(ot=it.schemesselection)&&void 0!==ot&&ot.i18nKey&&(G.additionalDetails.schemesselection=null==_||null===(at=_.owners)||void 0===at||null===(rt=at.schemesselection)||void 0===rt?void 0:rt.i18nKey),null!=_&&null!==(ut=_.owners)&&void 0!==ut&&ut.schemeName&&(G.additionalDetails.schemeName=null==_||null===(dt=_.owners)||void 0===dt?void 0:dt.schemeName),null!=_&&null!==(st=_.owners)&&void 0!==st&&st.transferredscheme&&(G.additionalDetails.transferredscheme=null==_||null===(ct=_.owners)||void 0===ct?void 0:ct.transferredscheme),null!=_&&null!==(vt=_.owners)&&void 0!==vt&&null!==(pt=vt.Ulblisttype)&&void 0!==pt&&pt.value&&(G.additionalDetails.Ulblisttype=null==_||null===(mt=_.owners)||void 0===mt||null===(Et=mt.Ulblisttype)||void 0===Et?void 0:Et.value),null!=_&&null!==(ft=_.owners)&&void 0!==ft&&ft.uploadedFile&&(G.additionalDetails.uploadedFileNoc=null==_||null===(_t=_.owners)||void 0===_t?void 0:_t.uploadedFile),null!=_&&null!==(gt=_.owners)&&void 0!==gt&&null!==(At=gt.rating)&&void 0!==At&&At.code&&(G.additionalDetails.rating=null==_||null===(St=_.owners)||void 0===St||null===(ht=St.rating)||void 0===ht?void 0:ht.code),null!=_&&null!==(bt=_.owners)&&void 0!==bt&&bt.greenuploadedFile&&(G.additionalDetails.uploadedFileGreenBuilding=null==_||null===(yt=_.owners)||void 0===yt?void 0:yt.greenuploadedFile),null!=_&&null!==(Ct=_.owners)&&void 0!==Ct&&null!==(Tt=Ct.use)&&void 0!==Tt&&Tt.code&&(G.additionalDetails.use=null==_||null===(Dt=_.owners)||void 0===Dt||null===(Nt=Dt.use)||void 0===Nt?void 0:Nt.code),null!=q&&null!==(Pt=q.info)&&void 0!==Pt&&Pt.name&&(G.additionalDetails.architectName=null==q||null===(It=q.info)||void 0===It?void 0:It.name),null!=q&&null!==(Lt=q.info)&&void 0!==Lt&&Lt.mobileNumber&&(G.additionalDetails.architectMobileNumber=null==q||null===(Bt=q.info)||void 0===Bt?void 0:Bt.mobileNumber),G.landInfo={},G.landInfo.address={},null!=_&&null!==(Ot=_.address)&&void 0!==Ot&&null!==(Rt=Ot.city)&&void 0!==Rt&&Rt.code&&(G.landInfo.address.city=null==_||null===(wt=_.address)||void 0===wt||null===(xt=wt.city)||void 0===xt?void 0:xt.code),null!=_&&null!==(Mt=_.address)&&void 0!==Mt&&null!==(Ft=Mt.locality)&&void 0!==Ft&&Ft.code&&(G.landInfo.address.locality={code:null==_||null===(kt=_.address)||void 0===kt||null===(Ut=kt.locality)||void 0===Ut?void 0:Ut.code}),null!=_&&null!==(Ht=_.address)&&void 0!==Ht&&Ht.pincode&&(G.landInfo.address.pincode=null==_||null===(Wt=_.address)||void 0===Wt?void 0:Wt.pincode),null!=_&&null!==(jt=_.address)&&void 0!==jt&&jt.landmark&&(G.landInfo.address.landmark=null==_||null===($t=_.address)||void 0===$t?void 0:$t.landmark),null!=_&&null!==(Yt=_.address)&&void 0!==Yt&&Yt.street&&(G.landInfo.address.street=null==_||null===(zt=_.address)||void 0===zt?void 0:zt.street),null!=_&&null!==(Gt=_.address)&&void 0!==Gt&&Gt.geoLocation&&(G.landInfo.address.geoLocation=null==_||null===(Kt=_.address)||void 0===Kt?void 0:Kt.geoLocation),G.landInfo.owners=E,G.landInfo.ownershipCategory=P.code,G.landInfo.tenantId=null==_||null===(Vt=_.address)||void 0===Vt||null===(qt=Vt.city)||void 0===qt?void 0:qt.code,G.landInfo.unit=function(e){var t,l,n;const i=null==e?void 0:e.subOccupancy,o=(null==e||null===(t=e.data)||void 0===t||null===(l=t.edcrDetails)||void 0===l||null===(n=l.planDetail)||void 0===n?void 0:n.blocks)||[];let a=[];return i&&Object.entries(i).map((e,t)=>{var l,n,i,r,u,d;a.push({blockIndex:t,floorNo:e[0].split("_")[1],unitType:"Block",occupancyType:(null==o||null===(l=o[t])||void 0===l||null===(n=l.building)||void 0===n||null===(i=n.occupancies)||void 0===i||null===(r=i[0])||void 0===r||null===(u=r.typeHelper)||void 0===u||null===(d=u.type)||void 0===d?void 0:d.code)||"A",usageCategory:te(e[1])})}),a}(_);let Xt=sessionStorage.getItem("BPA_ARCHITECT_NAME"),Jt=Xt?JSON.parse(Xt):"ARCHITECT";G.additionalDetails.typeOfArchitect=Jt,G.additionalDetails.stakeholderName=JSON.parse(sessionStorage.getItem("BPA_STAKEHOLDER_NAME")),G.additionalDetails.stakeholderRegistrationNumber=JSON.parse(sessionStorage.getItem("BPA_STAKEHOLDER_REGISTRATION_NUMBER")),G.additionalDetails.stakeholderAddress=JSON.parse(sessionStorage.getItem("BPA_STAKEHOLDER_ADDRESS"));let Zt=sessionStorage.getItem("isSelfCertificationRequired");"undefined"!==Zt&&null!==Zt||(Zt="false"),G.additionalDetails.isSelfCertificationRequired=Zt.toString(),z(!1),f("",{},"",!0)}}})}catch(e){return Promise.reject(e)}},onSkip:()=>f(),t:m,isDisabled:b||function(){let e=0;return K&&(null==K||K.map(t=>{var l;1===e||null!=t&&t.name&&null!=t&&t.mobileNumber&&null!=t&&null!==(l=t.gender)&&void 0!==l&&l.code||(e=1)})),0!=e}()||!P||Y,forcedError:m(Q)},X?l.createElement(o.Loader,null):l.createElement("div",{style:{marginBottom:"10px"}},l.createElement("div",null,l.createElement(o.CardLabel,null,m("BPA_TYPE_OF_OWNER_LABEL")+" *"),l.createElement(o.RadioButtons,{isMandatory:E.isMandatory,options:C,selectedOption:P,optionsKey:"i18nKey",onSelect:function(e){I(e)},value:P,labelKey:"PT_OWNERSHIP",isDependent:!0})),K.map((e,t)=>l.createElement("div",{key:`${e}-${t}`},l.createElement("div",{style:{border:"solid",borderRadius:"5px",padding:"10px",paddingTop:"20px",marginTop:"10px",borderColor:"#f3f3f3",background:"#FAFAFA"}},l.createElement(o.CardLabel,{style:{marginBottom:"-15px"}},m("CORE_COMMON_MOBILE_NUMBER")+" *"),G&&l.createElement(o.LinkButton,{label:l.createElement(o.DeleteIcon,{style:{float:"right",position:"relative",bottom:"5px"},fill:1!=K.length?"#494848":"#FAFAFA"}),style:{width:"100px",display:"inline",background:"black"},onClick:e=>function(e){const t=[...K];1!=t.length&&(t.splice(e,1),1==t.length&&(t[0]={...t[0],isPrimaryOwner:!0}),V(t))}(t)}),l.createElement("div",{style:{marginTop:"30px"}},l.createElement("div",{className:"field-container"},l.createElement("div",{style:{position:"relative",zIndex:"100",left:"35px",marginTop:"-24.5px",marginLeft:"-25px"}},"+91"),l.createElement(o.TextInput,s({style:{background:"#FAFAFA",padding:"0px 35px"},type:"text",t:m,isMandatory:!1,optionKey:"i18nKey",name:"mobileNumber",value:e.mobileNumber,onChange:e=>function(e,t){let l=[...K];l[e].mobileNumber=t.target.value,W(t.target.value),V(l),l[e].gender&&l[e].mobileNumber&&l[e].name&&y(!1)}(t,e)},g={isRequired:!0,pattern:"[6-9]{1}[0-9]{9}",type:"tel",title:m("CORE_COMMON_APPLICANT_MOBILE_NUMBER_INVALID")})),l.createElement("div",{style:{position:"relative",zIndex:"100",right:"35px",marginTop:"-24px",marginRight:"-20px"},onClick:e=>function(e,t){try{var l,n,i,o;const t=mt(K),a=(null==t||null===(l=t[e])||void 0===l?void 0:l.mobileNumber)||"";if($(null),!a.match(Et("MobileNo")))return $({key:"true",error:!0,message:"ERR_MOBILE_NUMBER_INCORRECT"}),Promise.resolve();if(a===(null==t||null===(n=t[e])||void 0===n?void 0:n.userName)&&"BPA_ARCHITECT"!==(null===(i=ownerRoleCheck)||void 0===i?void 0:i.code)&&"BPA_SUPERVISOR"!==(null===(o=ownerRoleCheck)||void 0===o?void 0:o.code))return $({key:"true",error:!0,message:"ERR_OWNER_ALREADY_ADDED_TOGGLE_MSG"}),Promise.resolve();const r=t.findIndex(e=>e.userName===a);return Promise.resolve(function(l,n){var i;if(!(r>-1&&"BPA_ARCHITECT"!==(null===(l=ownerRoleCheck)||void 0===l?void 0:l.code)&&"BPA_SUPERVISOR"!==(null===(n=ownerRoleCheck)||void 0===n?void 0:n.code)))return Promise.resolve(Digit.UserService.userSearch(Digit.ULBService.getStateId(),{userName:null==K||null===(i=K[e])||void 0===i?void 0:i.mobileNumber},{})).then(function(l){var n,i,o,a,r;let u=null==l||null===(n=l.user)||void 0===n||null===(i=n[0])||void 0===i||null===(o=i.roles)||void 0===o||null===(a=o.filter(e=>"BPA_ARCHITECT"===e.code||"BPA_SUPERVISOR"===e.code))||void 0===a?void 0:a[0];if(0===(null==l||null===(r=l.user)||void 0===r?void 0:r.length))$({key:"true",warning:!0,message:"ERR_MOBILE_NUMBER_NOT_REGISTERED"});else{var d,s,c,v,p;const n=null==l||null===(d=l.user)||void 0===d?void 0:d[0];n.gender=n.gender?{code:n.gender,active:!0,i18nKey:"COMMON_GENDER_"+n.gender}:"",null!=n&&n.dob&&(n.dob=Pt(null==n?void 0:n.dob)),null!=n&&n.createdDate&&(n.createdDate=Ot(null==n?void 0:n.createdDate),n.lastModifiedDate=Ot(null==n?void 0:n.lastModifiedDate),n.pwdExpiryDate=Ot(null==n?void 0:n.pwdExpiryDate));let i=[...t];var m;i[e]&&(i[e]=n,i[e].isPrimaryOwner=(null===(m=K[e])||void 0===m?void 0:m.isPrimaryOwner)||!1),V(i),null!==(s=i[e])&&void 0!==s&&s.mobileNumber&&null!==(c=i[e])&&void 0!==c&&c.name&&null!==(v=i[e])&&void 0!==v&&null!==(p=v.gender)&&void 0!==p&&p.code?y(!0):y(!1),u&&(y(!1),$({key:"true",error:!0,message:"BPA_OWNER_VALIDATION_"+(null==u?void 0:u.code)}))}});$({key:"true",error:!0,message:"ERR_OWNER_ALREADY_ADDED"})}())}catch(e){return Promise.reject(e)}}(t)}," ",l.createElement(o.SearchIcon,null)," "))),l.createElement(o.CardLabel,null,m("CORE_COMMON_NAME")+" *"),l.createElement(o.TextInput,s({style:{background:"#FAFAFA"},t:m,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"name",value:e.name,onChange:e=>function(e,t){let l=[...K];l[e].name=t.target.value,B(t.target.value),V(l),l[e].gender&&l[e].mobileNumber&&l[e].name&&y(!1)}(t,e)},g={isRequired:!0,pattern:"^[a-zA-Z ]*$",type:"text",title:m("TL_NAME_ERROR_MESSAGE")})),l.createElement(o.CardLabel,null,m("BPA_APPLICANT_GENDER_LABEL")+" *"),l.createElement(o.RadioOrSelect,{name:"gender",options:D,selectedOption:e.gender,optionKey:"i18nKey",onSelect:e=>function(e,t){let l=[...K];l[e].gender=t,U(t),V(l),l[e].gender&&l[e].mobileNumber&&l[e].name&&y(!1)}(t,e),t:m}),l.createElement(o.CardLabel,null,""+m("BPA_AADHAAR_NUMBER_LABEL")),l.createElement(o.TextInput,s({style:{background:"#FAFAFA"},t:m,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"aadharNumber",value:e.aadharNumber,onChange:e=>function(e,t){let l=[...K];l[e].aadharNumber=t.target.value,x(t.target.value),V(l),l[e].gender&&l[e].mobileNumber&&l[e].name&&y(!1)}(t,e)},g={pattern:"^[2-9]{1}[0-9]{3}[0-9]{4}[0-9]{4}$",type:"tel",title:m("INVALID_AADHAAR_NUMBER")})),l.createElement(o.CardLabel,null,""+m("CORE_EMAIL_ID")),l.createElement(o.TextInput,s({style:{background:"#FAFAFA"},t:m,type:"emailId",isMandatory:!1,optionKey:"i18nKey",name:"emailId",value:e.emailId,onChange:e=>function(e,t){let l=[...K];l[e].emailId=t.target.value,R(t.target.value),V(l),l[e].gender&&l[e].mobileNumber&&l[e].name&&y(!1)}(t,e)},g={pattern:"[A-Za-z0-9._%+-]+@[a-z0-9.-]+.[a-z]{2,4}$",type:"emailId",title:m("TL_EMAIL_ID_ERROR_MESSAGE")},{disabled:!1})),G&&l.createElement(o.CheckBox,{label:m("BPA_IS_PRIMARY_OWNER_LABEL"),onChange:e=>function(e,t){let l=[...K];l.map(e=>{e.isPrimaryOwner=!1}),l[e].isPrimaryOwner=!G||t.target.checked,F(t.target.checked),V(l)}(t,e),value:e.isPrimaryOwner,checked:e.isPrimaryOwner,style:{paddingTop:"10px"}})))),G?l.createElement("div",null,l.createElement("div",{style:{display:"flex",paddingBottom:"15px",color:"#FF8C00"}},l.createElement("button",{type:"button",style:{paddingTop:"10px"},onClick:()=>function(){const e=[...K];e.push({name:"",gender:"",mobileNumber:null,isPrimaryOwner:!1}),V(e),y(!0)}()},m("BPA_ADD_OWNER")))):null)),j&&l.createElement(o.Toast,{error:null==j?void 0:j.error,warning:null==j?void 0:j.warning,label:m(null==j?void 0:j.message),isDleteBtn:!0,onClose:()=>{$(null)}}))},DocumentDetails:e=>{var n,i;let{t:a,config:r,onSelect:u,formData:d}=e;const s=Digit.ULBService.getStateId(),[c,v]=t.useState((null==d||null===(n=d.documents)||void 0===n?void 0:n.documents)||[]),[p,m]=t.useState(null),[E,f]=t.useState(!0),[_,g]=t.useState(!1),A=null==d||null===(i=d.uiFlow)||void 0===i?void 0:i.flow,[S,h]=t.useState(!1),b=mt((null==d?void 0:d.PrevStateDocuments)||[]),{data:y,isLoading:C}=Digit.Hooks.obps.useBPATaxDocuments(s,{status:"INPROGRESS",RiskType:"LOW",ServiceType:"NEW_CONSTRUCTION",applicationType:"BUILDING_PLAN_SCRUTINY"},b||[]);return t.useEffect(()=>{const e=y.filter(e=>e.required).map(e=>e.code),t=e.filter(e=>c.reduce((t,l)=>{var n,i,o,a;return e==`${null==l||null===(n=l.documentType)||void 0===n||null===(i=n.split("."))||void 0===i?void 0:i[0]}.${null==l||null===(o=l.documentType)||void 0===o||null===(a=o.split("."))||void 0===a?void 0:a[1]}`||t},!1));f(!(t.length==e.length&&c.length>0))},[c,_]),l.createElement("div",null,l.createElement(Yl,{currentStep:3,flow:"OCBPA"===A?"OCBPA":""}),C?l.createElement(o.Loader,null):l.createElement(o.FormStep,{t:a,config:r,onSelect:()=>{let e,t=d.documents,l=[];y&&y.map(e=>{c&&c.filter(t=>e.code===ft(null==t?void 0:t.additionalDetails.category,"_",".")).map(e=>{l.push(e)})}),e={...t,documents:l},u(r.key,e)},onSkip:()=>u(),onAdd:function(){}},null==y?void 0:y.filter(e=>"ARCHITECT.UNDERTAKING"!==e.code&&"CITIZEN.UNDERTAKING"!==e.code).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(Gl,{key:t,document:e,t:a,error:p,setError:m,setDocuments:v,documents:c,setCheckRequiredFields:g,formData:d,beforeUploadDocuments:b||[],isNextButtonDisabled:S,setIsNextButtonDisabled:h}))),p&&l.createElement(o.Toast,{label:p,onClose:()=>m(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!=d&&d.applicationNo?l.createElement(o.CitizenInfoLabel,{info:a("CS_FILE_APPLICATION_INFO_LABEL"),text:`${a("BPA_APPLICATION_NUMBER_LABEL")} ${null==d?void 0:d.applicationNo} ${a("BPA_DOCS_INFORMATION")}`,className:"info-banner-wrap-citizen-override"}):"")},NOCDetails:e=>{var n,i;let{t:a,config:r,onSelect:u,formData:d}=e;Digit.ULBService.getCurrentTenantId();const s=Digit.ULBService.getStateId(),[c,v]=t.useState((null==d||null===(n=d.nocDocuments)||void 0===n?void 0:n.nocDocuments)||[]),[p,m]=t.useState(null),[E,f]=t.useState([]),[_,g]=t.useState(!0),[A,S]=t.useState(!1);let[h,b]=t.useState(null!=d&&d.PrevStateNocDocuments?mt(null==d?void 0:d.PrevStateNocDocuments):[]);const y=null==d||null===(i=d.uiFlow)||void 0===i?void 0:i.flow,[C,T]=t.useState(null==d?void 0:d.applicationNo),[D,N]=t.useState([]),[P,I]=t.useState([]),[L,B]=t.useState([]),{data:O}=Digit.Hooks.obps.useNocDetails(null==d?void 0:d.tenantId,{sourceRefId:C}),{isLoading:R,data:w}=Digit.Hooks.obps.useMDMS(s,"NOC",["DocumentTypeMapping"]),{data:x}=Digit.Hooks.obps.useMDMS(s,"common-masters",["DocumentType"]),{data:M,isLoading:F}=Digit.Hooks.useDocumentSearch(h,{enabled:(null==h?void 0:h.length)>0});return t.useEffect(()=>{var e,t;(null==M||null===(e=M.pdfFiles)||void 0===e?void 0:e.length)>0&&(null==M||null===(t=M.pdfFiles)||void 0===t||t.forEach(e=>e.title=null==e?void 0:e.documentType),b(null==M?void 0:M.pdfFiles))},[null==M?void 0:M.pdfFiles]),t.useEffect(()=>{N(O)},[O]),t.useEffect(()=>{var e;I(null==w||null===(e=w.NOC)||void 0===e?void 0:e.DocumentTypeMapping)},[w]),t.useEffect(()=>{var e;B(null==x||null===(e=x["common-masters"])||void 0===e?void 0:e.DocumentType)},[x]),t.useEffect(()=>{if(null!=D&&D.length&&null!=P&&P.length){let e=[];D.map(t=>{var l,n;const i=P.filter(e=>e.applicationType===t.applicationType&&e.nocType===t.nocType);null!=i&&null!==(l=i[0])&&void 0!==l&&null!==(n=l.docTypes)&&void 0!==n&&n[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 l=e.documentType;e.dropdownData=[],e.uploadedDocuments=[],L&&L.forEach(t=>{let n=t.code.slice(0,l.length);l===n&&(e.hasDropdown=!0,e.dropdownData.push(t))}),e.uploadedDocuments[0]={},e.uploadedDocuments[0].values=[],h.map(t=>{var n,i;l===`${null==t||null===(n=t.documentType)||void 0===n?void 0:n.split(".")[0]}.${null==t||null===(i=t.documentType)||void 0===i?void 0:i.split(".")[1]}`&&e.uploadedDocuments[0].values.push(t)}),t.push(e)}),t.forEach(e=>{e.code=e.documentType,e.dropdownData.forEach(e=>{e.i18nKey=e.code})}),f(t)}},[D,P,L,h]),l.createElement("div",null,l.createElement(Yl,{currentStep:3,flow:"OCBPA"===y?"OCBPA":""}),R?l.createElement(o.Loader,null):l.createElement(o.FormStep,{t:a,config:r,onSelect:()=>{let e;e={...d.nocDocuments,nocDocuments:c,NocDetails:D,nocTaxDocuments:E},u(r.key,e)},onSkip:()=>{let e;e={...d.nocDocuments,nocDocuments:c,NocDetails:D,nocTaxDocuments:E},u(r.key,e)},onAdd:function(){}},null==E?void 0:E.map((e,t)=>l.createElement(Kl,{key:t,document:e,t:a,error:p,setError:m,setNocDocuments:v,nocDocuments:c,setCheckRequiredFields:S,formData:d,beforeUploadNocDocuments:h,pdfLoading:F})),p&&l.createElement(o.Toast,{label:p,onClose:()=>m(null),error:!0})))},NOCNumber:e=>{var n,i,a,r;let{t:u,config:d,onSelect:s,formData:c}=e;const[v,p]=t.useState((null==c||null===(n=c.additionalDetails)||void 0===n?void 0:n.nocNumber)||(null==c||null===(i=c.nocnumber)||void 0===i?void 0:i.nocNumber)||"");return Digit.ULBService.getCurrentTenantId(),Digit.Utils.browser.isMobile(),l.createElement("div",null,l.createElement(Yl,{currentStep:0}),l.createElement(o.FormStep,{t:u,config:d,onSelect:()=>{s(null==d?void 0:d.key,{nocNumber:v})},isDisabled:!v},l.createElement("div",{className:"field-container"},l.createElement(o.TextInput,{class:"card-input",type:"text",t:u,isMandatory:!1,optionKey:"i18nKey",name:"nocNumber",value:v,onChange:e=>{p(e.target.value)},defaultValue:(null==c||null===(a=c.nocnumber)||void 0===a?void 0:a.nocNumber)||(null==c||null===(r=c.additionalDetails)||void 0===r?void 0:r.nocNumber)}),l.createElement("div",{style:{position:"relative",zIndex:"100",right:"20px",marginTop:"-24px",marginRight:"-20px"},onClick:e=>{console.log("inside_search")}}," ",l.createElement(o.SearchIcon,null)," "))))},LocationDetails:e=>{var n,a,r,u,d,s,c,v,p,m,E,f,_,g,A,S,h,b,y,C,T,D,N,P,I,L,B,O,R,w;let{t:x,config:M,onSelect:F,userType:k,formData:U,ownerIndex:H=0}=e,W=JSON.parse(sessionStorage.getItem("Digit_OBPS_PT")),j=JSON.parse(sessionStorage.getItem("currentCity"))||{},$=sessionStorage.getItem("currentPincode");JSON.parse(sessionStorage.getItem("currentLocality"));const Y=Digit.Hooks.obps.useTenants(),z=(i.useLocation(),Digit.ULBService.getCurrentTenantId()),[G,K]=(Digit.ULBService.getStateId(),t.useState(null)),[V,q]=t.useState(!1),[X,J]=t.useState($||(null===(n=U)||void 0===n||null===(a=n.address)||void 0===a?void 0:a.pincode)||(null==W||null===(r=W.address)||void 0===r?void 0:r.pincode)||""),[Z,Q]=t.useState((null===(u=U)||void 0===u||null===(d=u.address)||void 0===d?void 0:d.geoLocation)||""),[ee,te]=t.useState(null===(s=U)||void 0===s||null===(c=s.Scrutiny)||void 0===c||null===(v=c[0])||void 0===v?void 0:v.tenantIdData),[le,ne]=t.useState(()=>{var e,t,l;return(null===(e=U)||void 0===e||null===(t=e.address)||void 0===t?void 0:t.city)||j||(null==W||null===(l=W.address)||void 0===l?void 0:l.pincode)||null}),[ie,oe]=t.useState((null===(p=U)||void 0===p||null===(m=p.address)||void 0===m?void 0:m.street)||(null==W||null===(E=W.address)||void 0===E?void 0:E.street)||""),[ae,re]=t.useState((null===(f=U)||void 0===f||null===(_=f.address)||void 0===_?void 0:_.landmark)||(null===(g=U)||void 0===g||null===(A=g.address)||void 0===A?void 0:A.Landmark)||(null==W||null===(S=W.address)||void 0===S?void 0:S.landmark)||""),[ue,de]=t.useState((null===(h=U)||void 0===h||null===(b=h.address)||void 0===b?void 0:b.placeName)||(null===(y=U)||void 0===y?void 0:y.placeName)||""),[se,ce]=t.useState(),[ve,pe]=t.useState((null==W||null===(C=W.address)||void 0===C?void 0:C.locality)||(null===(T=U)||void 0===T||null===(D=T.address)||void 0===D?void 0:D.locality)||null);let[me,Ee]=t.useState(Y),fe=null===(N=U)||void 0===N||null===(P=N.data)||void 0===P||null===(I=P.edcrDetails)||void 0===I?void 0:I.tenantId;U={address:{...null===(L=U)||void 0===L?void 0:L.address}};const _e=window.Digit.Utils.browser.isMobile();t.useEffect(()=>{var e;if(!le||!se)if(me=k&&"employee"===k?Y.filter(e=>e.code===z):X?Y.filter(e=>{var t;return null==e||null===(t=e.pincode)||void 0===t?void 0:t.some(e=>e==Number(X))}):Y,Ee(me),0==(null===(e=me)||void 0===e?void 0:e.length))K("BPA_PIN_NOT_VALID_ERROR");else if(1==me.length){var t;(null===(t=me)||void 0===t?void 0:t[0].code)!=(null!=le&&le.code?null==le?void 0:le.code:le||"")&&K("BPA_PIN_NOT_VALID_ERROR")}},[X]),t.useEffect(()=>{me.map((e,t)=>{e.code===fe&&(ne(e),sessionStorage.setItem("currentCity",JSON.stringify(e)))})},[me,null===(B=U)||void 0===B?void 0:B.data]),t.useEffect(()=>{var e;me&&1===me.length&&(null===(e=me)||void 0===e?void 0:e[0].code)===(null==le?void 0:le.code)&&(ne(me[0]),sessionStorage.setItem("currentCity",JSON.stringify(me[0])))},[me]);const{data:ge}=Digit.Hooks.useBoundaryLocalities(null==le?void 0:le.code,"revenue",{enabled:!!le},x);let Ae=window.location.href.includes("editApplication"),Se=window.location.href.includes("sendbacktocitizen");function he(e){K(null),""!==("object"==typeof e&&null!==e?e.target.value:e)&&(("object"==typeof e&&null!==e?e.target.value:e).match(/^[1-9][0-9]{5}$/)||K("BPA_PIN_NOT_VALID_ERROR")),U.address.pincode="object"==typeof e&&null!==e?e.target.value:e,J("object"==typeof e&&null!==e?e.target.value:e),sessionStorage.setItem("currentPincode","object"==typeof e&&null!==e?e.target.value:e),sessionStorage.setItem("currentCity",JSON.stringify({})),sessionStorage.setItem("currLocality",JSON.stringify({})),pe(null),ce(null)}return t.useEffect(()=>{var e,t;if(null!=W&&null!==(e=W.address)&&void 0!==e&&e.locality)pe(null==W||null===(t=W.address)||void 0===t?void 0:t.locality);else if(le&&ge&&!G){var l,n,i,o,a,r,u,d;let e=ge,t=[];var s,c;console.log("fetchedLocalities",ge),null!==(l=U)&&void 0!==l&&null!==(n=l.address)&&void 0!==n&&n.locality&&(null===(i=U)||void 0===i||null===(o=i.address)||void 0===o||null===(a=o.locality)||void 0===a?void 0:a.code)===(null==ve?void 0:ve.code)&&pe(U.address.locality),(null!==(r=U)&&void 0!==r&&null!==(u=r.address)&&void 0!==u&&u.pincode||X)&&!G&&(t=e.filter(e=>{var t;return null===(t=e.pincode)||void 0===t?void 0:t.find(e=>e==X)}),(null===(s=U)||void 0===s||null===(c=s.address)||void 0===c||!c.locality)&&t.length<=0&&pe()),(!se||t.length>0&&se.length!==t.length||t.length<=0&&se&&se.length!==e.length)&&(console.log("filteredLocalityList",t),ce(()=>t.length>0?t:e)),1===t.length&&(null==ve||ve&&(null===(d=t[0])||void 0===d?void 0:d.code)!==(null==ve?void 0:ve.code))&&(pe(t[0]),sessionStorage.setItem("currLocality",JSON.stringify(t[0])))}},[le,null===(O=U)||void 0===O?void 0:O.pincode,ge,X,Z]),l.createElement("div",null,!V&&l.createElement(Yl,null),V&&l.createElement(Vl,{t:x,onSelect:F,formData:U,handleRemove:()=>{q(!V)},onSave:function(e,t,l){he(t),sessionStorage.setItem("currentPincode",t),Q(e),de(l),q(!1),K(null)}}),!V&&l.createElement(o.FormStep,{t:x,config:M,onSelect:()=>{const e={};e.pincode=X,e.city=le,e.locality=ve,e.street=ie,e.landmark=ae,e.geoLocation=Z,e.placeName=ue,F(M.key,e)},isDisabled:!le||!ve||G,isMultipleAllow:!0,forcedError:x(G)},l.createElement(o.CardLabel,null,""+x("BPA_GIS_LABEL")),l.createElement("div",{style:{}},l.createElement(o.TextInput,{style:{},isMandatory:!1,optionKey:"i18nKey",t:x,name:"gis",value:Ae||Se?null!==Z.latitude?`${Z.latitude}, ${Z.longitude}`:"":ue,onChange:function(e){U.address.geoLocation="object"==typeof e&&null!==e?e.target.value:e,Q("object"==typeof e&&null!==e?e.target.value:e),de("object"==typeof e&&null!==e?e.target.value:e),sessionStorage.setItem("currentPincode",""),sessionStorage.setItem("currentCity",JSON.stringify({})),sessionStorage.setItem("currLocality",JSON.stringify({})),J(""),pe(null)}}),l.createElement(o.LinkButton,{label:l.createElement("div",null,l.createElement("span",null,l.createElement("svg",{style:_e?{float:"right",position:"relative",bottom:"25px",marginTop:"-20px",marginRight:"5px"}:{position:"relative",left:"515px",bottom:"25px",marginTop:"-20px"},width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l.createElement("path",{d:"M11 7C8.79 7 7 8.79 7 11C7 13.21 8.79 15 11 15C13.21 15 15 13.21 15 11C15 8.79 13.21 7 11 7ZM19.94 10C19.48 5.83 16.17 2.52 12 2.06V0H10V2.06C5.83 2.52 2.52 5.83 2.06 10H0V12H2.06C2.52 16.17 5.83 19.48 10 19.94V22H12V19.94C16.17 19.48 19.48 16.17 19.94 12H22V10H19.94ZM11 18C7.13 18 4 14.87 4 11C4 7.13 7.13 4 11 4C14.87 4 18 7.13 18 11C18 14.87 14.87 18 11 18Z",fill:"#505A5F"})))),style:{},onClick:e=>{q(!V)}})),l.createElement(o.CardLabel,null,""+x("BPA_DETAILS_PIN_LABEL")),!V&&l.createElement(o.TextInput,{isMandatory:!1,optionKey:"i18nKey",type:"text",t:x,name:"pincode",onChange:he,value:X,disabled:!(null==W||!W.address)}),l.createElement(o.CardLabel,null,x("BPA_CITY_LABEL")+"*"),!V&&l.createElement(o.RadioOrSelect,{options:me.sort((e,t)=>e.name.localeCompare(t.name)),selectedOption:le,optionKey:"code",onSelect:function(e){pe(null),ce(null),ne(e),sessionStorage.setItem("currentCity",JSON.stringify(e)),U.address.city=e},t:x,isDependent:!0,disabled:!(null==W||!W.address)}),l.createElement("span",{className:"form-pt-dropdown-only"},l.createElement(o.CardLabel,null,x("BPA_LOC_MOHALLA_LABEL")+"*"),V||!le||!se||null!=W&&W.address?l.createElement(o.TextInput,{optionCardStyles:{maxHeight:"20vmax",overflow:"scroll"},isMandatory:M.isMandatory,value:null==W||null===(R=W.address)||void 0===R||null===(w=R.locality)||void 0===w?void 0:w.name,optionKey:"i18nkey",t:x,isDependent:!0,labelKey:ft(null==le?void 0:le.code,".","_").toUpperCase()+"_REVENUE",disabled:!(null==W||!W.address)}):l.createElement(o.RadioOrSelect,{optionCardStyles:{maxHeight:"20vmax",overflow:"scroll"},isMandatory:M.isMandatory,options:se.sort((e,t)=>e.name.localeCompare(t.name)),selectedOption:ve,optionKey:"i18nkey",onSelect:function(e){var t,l;null!==(t=U)&&void 0!==t&&null!==(l=t.address)&&void 0!==l&&l.locality&&(U.address.locality=e),pe(e),sessionStorage.setItem("currLocality",JSON.stringify(e))},t:x,isDependent:!0,labelKey:ft(null==le?void 0:le.code,".","_").toUpperCase()+"_REVENUE"})),l.createElement(o.CardLabel,null,""+x("BPA_DETAILS_SRT_NAME_LABEL")),!V&&l.createElement(o.TextInput,{style:{},isMandatory:!1,optionKey:"i18nKey",t:x,name:"street",onChange:function(e){oe(e.target.value)},value:ie,disabled:!(null==W||!W.address)}),l.createElement(o.CardLabel,null,""+x("ES_NEW_APPLICATION_LOCATION_LANDMARK")),!V&&l.createElement(o.TextInput,{style:{},isMandatory:!1,optionKey:"i18nKey",t:x,name:"landmark",onChange:function(e){re(e.target.value)},value:ae,disabled:!(null==W||!W.address)})))},GIS:Vl,OCEDCRDocsRequired:e=>{let{onSelect:i}=e;const{t:a}=n.useTranslation(),r=[{code:"BPA_PERMIT_NUMBER_OC_SCRUTINY_LABEL"},{code:"BPA_PERMIT_DATE_LABEL"},{code:"BPA_OC_PLAN_DXF_FILE"}];return l.createElement(t.Fragment,null,l.createElement(o.Card,null,l.createElement(o.CardHeader,null,a("BPA_OC_NEW_BUILDING_CONSTRUCTION_LABEL")),l.createElement(o.CardText,{style:{color:"#0B0C0C",marginTop:"12px",fontSize:"16px",fontWeight:"400",lineHeight:"24px"}},a("OBPS_OCEDCR_BUILDING_PERMIT_DESCRIPTION")),l.createElement(t.Fragment,null,null==r?void 0:r.map((e,t)=>l.createElement(o.CardLabel,{style:{fontWeight:700},key:t},l.createElement("div",{style:{display:"flex"}},l.createElement("div",null,t+1+"."," "),l.createElement("div",null," "+a(null==e?void 0:e.code.replace(".","_"))))))),l.createElement(o.SubmitBar,{label:a("CS_COMMON_NEXT"),onSubmit:()=>{i()}})),l.createElement(o.CitizenInfoLabel,{info:a("CS_FILE_APPLICATION_INFO_LABEL"),text:a("OBPS_OC_DOCS_FILE_SIZE"),className:"info-banner-wrap-citizen-override"}))},OCeDCRScrutiny:e=>{var n,i,a,r,u,d,c;let{t:v,config:p,onSelect:m,formData:E,ownerIndex:f=0}=e;const _=Digit.ULBService.getCurrentTenantId(),[g,A]=(Digit.ULBService.getStateId(),t.useState(null==E||null===(n=E.ScrutinyDetails)||void 0===n?void 0:n.ocPermitNumber)),[S,h]=t.useState(null==E||null===(i=E.ScrutinyDetails)||void 0===i?void 0:i.ocPermitdate),[b,y]=t.useState(null==E?void 0:E.ScrutinyDetails),[C,T]=t.useState(null);let D={};function N(){}const P=()=>{},I=()=>{const e={};e.file=file,m(p.key,e)};return l.createElement("div",null,l.createElement(o.FormStep,{t:v,config:p,onSelect:I,onSkip:P,isDisabled:!g,onAdd:N,isMultipleAllow:!0},l.createElement(o.CardCaption,null,""+v("BPA_OC_NEW_BUILDING_CONSTRUCTION_LABEL")),l.createElement(o.CardHeader,null,""+v("BPA_OC_EDCR_SCRUTINY_LABEL")),l.createElement(o.CardText,null,""+v("BPA_PROVIDE_BPN_AND_BPD_APP_LABEL")),l.createElement(o.CardLabel,null,v("EDCR_BUILDING_PERMIT_NUM_LABEL")+" *"),l.createElement(o.TextInput,s({isMandatory:!1,optionKey:"i18nKey",t:v,name:"permitNumber",onChange:function(e){A(e.target.value)},value:g},D={isRequired:!0,pattern:Et("Name"),title:v("BPA_INVALID_NAME")})),l.createElement(o.CardLabel,null,v("EDCR_BUILDING_PERMIT_DATE_LABEL")+" *"),l.createElement(o.DatePicker,{date:S,name:"permitDate",onChange:function(e){h(e)}}),l.createElement("div",{onClick:function(){try{y({}),T(null);let e={permitDate:Pt(S),approvalNo:g};return Digit.OBPSService.BPASearch(_,e).then((e,t)=>{var l,n;if((null==e||null===(l=e.BPA)||void 0===l?void 0:l.length)>0){var i,o,a,r,u,d;const t=null==e||null===(i=e.BPA)||void 0===i||null===(o=i[0])||void 0===o?void 0:o.edcrNumber,l=null==e||null===(a=e.BPA)||void 0===a||null===(r=a[0])||void 0===r?void 0:r.tenantId;S===(e=>{if(e){const t=new Date(e);let l=t.getMonth()+1,n=t.getDate(),i=t.getFullYear();return l=(l>9?"":"0")+l,n=(n>9?"":"0")+n,`${i}-${l}-${n}`}return null})(null==e||null===(u=e.BPA)||void 0===u||null===(d=u[0])||void 0===d?void 0:d.approvalDate)?Digit.OBPSService.scrutinyDetails(l,{edcrNumber:t}).then(t=>{var n,i;Digit.WorkflowService.getAllApplication(l,{businessIds:null==e||null===(n=e.BPA)||void 0===n||null===(i=n[0])||void 0===i?void 0:i.applicationNo,history:!0}).then((l,n)=>{var i,o,a,r,u;const d=null==l||null===(i=l.ProcessInstances)||void 0===i?void 0:i[(null==l||null===(o=l.ProcessInstances)||void 0===o?void 0:o.length)-1],s=(null==d||null===(a=d.assignes)||void 0===a||null===(r=a[0])||void 0===r?void 0:r.name)||"";if((null==t||null===(u=t.edcrDetail)||void 0===u?void 0:u.length)>0){var c,v,p,m,E,f;const l=null==e||null===(c=e.BPA)||void 0===c||null===(v=c[0])||void 0===v||null===(p=v.landInfo)||void 0===p||null===(m=p.owners)||void 0===m?void 0:m.filter(e=>e.isPrimaryOwner&&"false"!=e.isPrimaryOwner);t.edcrDetail[0].applicantName=null==l||null===(E=l[0])||void 0===E?void 0:E.name,t.edcrDetail[0].ocPermitNumber=g,t.edcrDetail[0].ocPermitdate=S,t.edcrDetail[0].appliedBy=s,y(null==t||null===(f=t.edcrDetail)||void 0===f?void 0:f[0])}}).catch(e=>{var t,l,n;T({key:"error",error:!0,message:(null==e||null===(t=e.response)||void 0===t||null===(l=t.data)||void 0===l||null===(n=l.Errors[0])||void 0===n?void 0:n.message)||null})})}).catch(e=>{var t,l,n;T({key:"error",error:!0,message:(null==e||null===(t=e.response)||void 0===t||null===(l=t.data)||void 0===l||null===(n=l.Errors[0])||void 0===n?void 0:n.message)||null})}):T({key:"error",warning:!0,message:v("ERR_FILL_EDCR_PERMIT_INCORRECT_DATE")})}else 0==(null==e||null===(n=e.BPA)||void 0===n?void 0:n.length)&&T({key:"error",error:!0,message:v("BPA_NO_REC_FOUND_LABEL")})}).catch(e=>{var t,l,n;T({key:"error",error:!0,message:(null==e||null===(t=e.response)||void 0===t||null===(l=t.data)||void 0===l||null===(n=l.Errors[0])||void 0===n?void 0:n.message)||null})}),Promise.resolve()}catch(e){return Promise.reject(e)}}},l.createElement(o.SubmitBar,{label:v("ACTION_TEST_BPA_STAKE_HOLDER_SEARCH"),disabled:!g||!S})),C&&l.createElement(o.Toast,{error:null==C?void 0:C.error,warning:null==C?void 0:C.warning,label:v(null==C?void 0:C.message),isDleteBtn:!0,onClose:()=>{T(null)}})),null!=b&&b.edcrNumber?l.createElement(o.FormStep,{t:v,config:p,onSelect:I,onSkip:P,isDisabled:!g,onAdd:N,isMultipleAllow:!0},l.createElement(o.StatusTable,null,l.createElement(o.Row,{label:""+v("REPORT_FSM_RESULT_APPLICANTNAME"),text:v(null==b?void 0:b.applicantName),className:"border-none"}),l.createElement(o.Row,{label:""+v("BPA_BASIC_DETAILS_SERVICE_TYPE_LABEL"),text:v(null==b?void 0:b.applicationSubType),className:"border-none"}),l.createElement(o.Row,{label:""+v("EDCR_TOTAL_BUILD_UP_AREA_LABEL"),text:v(null==b||null===(a=b.planDetail)||void 0===a||null===(r=a.virtualBuilding)||void 0===r?void 0:r.totalBuitUpArea),className:"border-none"}),l.createElement(o.Row,{label:""+v("EDCR_BUILDING_HEIGHT_LABEL"),text:v(null==b||null===(u=b.planDetail)||void 0===u||null===(d=u.blocks[0])||void 0===d||null===(c=d.building)||void 0===c?void 0:c.buildingHeight),className:"border-none"}),l.createElement(o.Row,{label:""+v("BPA_ARCHITECT_NAME_LABEL"),text:v(null==b?void 0:b.appliedBy),className:"border-none"})),l.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",height:"2px",marginTop:"20px",marginBottom:"20px"}}),l.createElement("h1",{style:{fontSize:"18px",lineHeight:"21px",fontWeight:"700",padding:"0px 0px 16px 0px"}},""+v("BPA_PERMIT_EDCR_DETAILS_LABEL")),l.createElement(o.StatusTable,null,l.createElement(o.Row,{label:""+v("BPA_EDCR_NO_LABEL"),text:v(null==b?void 0:b.edcrNumber),className:"border-none"})),l.createElement("h1",{style:{fontSize:"18px",lineHeight:"21px",fontWeight:"700",padding:"0px 0px 16px 0px"}},""+v("BPA_UPLOADED_PLAN_DIAGRAM_LABEL")),l.createElement("a",{target:"_",href:null==b?void 0:b.updatedDxfFile,style:{minWidth:"160px",marginRight:"20px"},key:null==b?void 0:b.updatedDxfFile},l.createElement(o.PDFSvg,null),l.createElement("p",{style:{marginTop:"8px",fontWeight:"bold",fontSize:"14px",lineHeight:"19px",color:"#505A5F",fontWeight:"400"}},v("BPA_UPLOADED_PLAN_DXF"))),l.createElement("h1",{style:{fontSize:"18px",lineHeight:"21px",fontWeight:"700",padding:"0px 0px 16px 0px"}},""+v("BPA_SCRUTINY_REPORT_OUTPUT_LABEL")),l.createElement("a",{target:"_",href:null==b?void 0:b.planReport,style:{minWidth:"160px",marginRight:"20px"},key:null==b?void 0:b.planReport},l.createElement(o.PDFSvg,null),l.createElement("p",{style:{marginTop:"8px",fontWeight:"bold",fontSize:"14px",lineHeight:"19px",color:"#505A5F",fontWeight:"400"}},v("BPA_SCRUTINY_REPORT_PDF"))),l.createElement("div",{onClick:()=>{m(p.key,b)}},l.createElement(o.SubmitBar,{label:v("BPA_PROCEED_OC_SCRUTINY_LABEL")}))):null)},OCUploadPlanDiagram:e=>{var n;let{t:a,config:r,onSelect:u,formData:d,ownerIndex:s=0,isShowToast:c,isSubmitBtnDisable:v,setIsShowToast:p}=e;Digit.ULBService.getCurrentTenantId(),Digit.ULBService.getStateId();const[m,E]=t.useState(()=>{var e;return(null==d||null===(e=d.uploadData)||void 0===e?void 0:e.file)||null}),[f,_]=t.useState(null==d||null===(n=d.uploadData)||void 0===n?void 0:n.file),[g,A]=t.useState(""),S=i.useHistory();return t.useEffect(()=>{(g||c)&&(E(null),_(""),A("")),c&&S.push("/digit-ui/citizen/obps/edcrscrutiny/oc-apply/acknowledgement",{data:null!=c&&c.label?null==c?void 0:c.label:"BPA_INTERNAL_SERVER_ERROR",type:"ERROR"})},[g,c,v]),v?l.createElement(o.Loader,null):l.createElement(o.FormStep,{t:a,config:r,onSelect:()=>{const e={};e.file=f,u(r.key,e,!0,!0)},onSkip:()=>{},isDisabled:!f||v,onAdd:function(){},isMultipleAllow:!0},l.createElement(o.CardLabel,null,a("BPA_OC_PLAN_DIAGRAM_DXF")+" *"),l.createElement(o.UploadFile,{id:"oc-doc",extraStyleName:"propertyCreate",onUpload:function(e){E(e.target.files[0]),_(e.target.files[0])},onDelete:()=>{E(null),_("")},message:m?"1 "+a("PT_ACTION_FILEUPLOADED"):a("ES_NO_FILE_SELECTED_LABEL"),uploadMessage:g}),l.createElement("div",{style:{disabled:"true",height:"30px",width:"100%",fontSize:"14px"}}),c&&l.createElement(o.Toast,{error:c.key,label:a(c.label),onClose:()=>p(null),isDleteBtn:!0}))},StakeholderDocsRequired:e=>{var a,r,u,d;let{onSelect:s}=e;const{t:c}=n.useTranslation(),v=Digit.ULBService.getCurrentTenantId(),p=Digit.ULBService.getStateId(),{data:m,isLoading:E}=(i.useHistory(),Digit.Hooks.obps.useMDMS(p,"StakeholderRegistraition","TradeTypetoRoleMapping"));let f=window.location.href.includes("/openlink/");return Digit.Utils.browser.isMobile(),t.useEffect(()=>{v&&Digit.LocalizationService.getLocale({modules:["rainmaker-bpareg"],locale:Digit.StoreData.getCurrentLanguage(),tenantId:""+v})},[v]),E?l.createElement(o.Loader,null):l.createElement(t.Fragment,null,l.createElement("div",{className:f?"OpenlinkContainer":""},l.createElement(o.Card,null,l.createElement(o.CardHeader,null,c("BPA_NEW_BUILDING_HEADER")),l.createElement(o.CardText,{style:{color:"#0B0C0C",marginTop:"12px",fontSize:"16px",fontWeight:"400",lineHeight:"24px"}},c("BPA_NEW_BUILDING_PERMIT_DESCRIPTION")),E?l.createElement(o.Loader,null):l.createElement(t.Fragment,null,null==m||null===(a=m.StakeholderRegistraition)||void 0===a||null===(r=a.TradeTypetoRoleMapping)||void 0===r||null===(u=r[0])||void 0===u||null===(d=u.docTypes)||void 0===d?void 0:d.map((e,t)=>l.createElement("div",null,l.createElement("div",{style:{fontWeight:700,marginBottom:"8px"},key:t},l.createElement("div",{style:{display:"flex"}},l.createElement("div",{style:{minWidth:"20px"}},t+1+"."," "),l.createElement("div",null," "+c("BPAREG_HEADER_"+(null==e?void 0:e.code.replace(".","_")))))),l.createElement("div",{style:{marginBottom:"16px"}},l.createElement("div",{style:{display:"flex"}},l.createElement("div",{style:{minWidth:"20px"}}),null!=e&&e.info?l.createElement("div",{style:{color:"#505A5F",fontSize:"16px"}},""+c(null==e?void 0:e.info.replace(".","_"))):null))))),l.createElement(o.SubmitBar,{label:c("CS_COMMON_NEXT"),onSubmit:s})),l.createElement(o.CitizenInfoLabel,{info:c("CS_FILE_APPLICATION_INFO_LABEL"),text:c("OBPS_DOCS_FILE_SIZE"),className:"info-banner-wrap-citizen-override"})))},LicenseType:e=>{var n,i,a,r,u,d,s,c,v,p,m,E,f,_,g,A,S,h,b,y;let{t:C,config:T,onSelect:D,formData:N}=e;null!==JSON.parse(sessionStorage.getItem("BPAREGintermediateValue"))?(N=JSON.parse(sessionStorage.getItem("BPAREGintermediateValue")),sessionStorage.setItem("BPAREGintermediateValue",null)):N=N,null===(n=window.location.href)||void 0===n||n.split("/").pop(),Digit.ULBService.getCurrentTenantId();const P=Digit.ULBService.getStateId(),[I,L]=t.useState((null===(i=N)||void 0===i||null===(a=i.LicneseType)||void 0===a?void 0:a.qualificationType)||null),[B,O]=t.useState((null===(r=N)||void 0===r||null===(u=r.LicneseType)||void 0===u?void 0:u.LicenseType)||(null===(d=N)||void 0===d||null===(s=d.formData)||void 0===s||null===(c=s.LicneseType)||void 0===c?void 0:c.LicenseType)||null),[R,w]=t.useState((null===(v=N)||void 0===v||null===(p=v.LicneseType)||void 0===p?void 0:p.ArchitectNo)||(null===(m=N)||void 0===m||null===(E=m.formData)||void 0===E||null===(f=E.LicneseType)||void 0===f?void 0:f.ArchitectNo)||null),{data:x}=Digit.Hooks.obps.useQualificationTypes(P),{data:M}=Digit.Hooks.obps.useMDMS(P,"StakeholderRegistraition","TradeTypetoRoleMapping"),{data:F}=Digit.Hooks.useCustomMDMS(P,"StakeholderRegistraition",[{name:"TradeTypetoRoleMapping"}]),k=null==F||null===(_=F.StakeholderRegistraition)||void 0===_?void 0:_.TradeTypetoRoleMapping;let U=window.location.href.includes("/openlink/");Digit.Utils.browser.isMobile();const[H,W]=t.useState((null===(g=N)||void 0===g?void 0:g.selfCertification)||(null===(A=N)||void 0===A||null===(S=A.formData)||void 0===S?void 0:S.selfCertification)||null);console.log("OBPS_Formdata",N);const[j,$]=t.useState("");function Y(){let e=[];return null==k||k.forEach(t=>{if("true"===(null==t?void 0:t.isActive)){var l;console.log("item=====",t);const n="TRADELICENSE_TRADETYPE_"+(null==t||null===(l=t.tradeType)||void 0===l?void 0:l.split(".")[0]);e.some(e=>e.i18nKey===n)||e.push({role:t.role,i18nKey:n,tradeType:t.tradeType,code:null==t?void 0:t.code})}}),console.log("list",e),e}function z(e){let t=null;"B-Arch"==e.name?t=Y().find(e=>e.i18nKey.includes("ARCHITECT")):"BE/B-Tech"==e.name?t=Y().find(e=>e.i18nKey.includes("ENGINEER")):"Diploma in Civil Engineering/Architect"==e.name?t=Y().find(e=>e.i18nKey.includes("SUPERVISOR")):"Town and Country Planning"==e.name&&(t=Y().find(e=>e.i18nKey.includes("TOWNPLANNER"))),t&&O(t)}return U&&(window.onunload=function(){sessionStorage.removeItem("Digit.BUILDING_PERMIT")}),t.useEffect(()=>{I&&z(I)},[I]),console.log("qualificationTypeFinfing",I),t.useEffect(()=>{var e,t,l,n;if(console.log("selectedQualificationType 1",x,null===(e=N)||void 0===e||null===(t=e.LicneseType)||void 0===t?void 0:t.qualificationType,x),null!==(l=N)&&void 0!==l&&null!==(n=l.LicneseType)&&void 0!==n&&n.qualificationType&&x&&!I){var i,o;const e=x.find(e=>{var t,l;return e.name===(null===(t=N)||void 0===t||null===(l=t.LicneseType)||void 0===l?void 0:l.qualificationType)});L(e),console.log("selectedQualificationType",e,null===(i=N)||void 0===i||null===(o=i.LicneseType)||void 0===o?void 0:o.qualificationType,x)}},[]),console.log("License Type List",Y()),console.log("formData in LicenseType",N),l.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-start"}},l.createElement("div",{style:{flex:1,marginRight:"20px"}},l.createElement("div",{className:U?"OpenlinkContainer":""},U&&l.createElement(o.BackButton,{style:{border:"none"}},C("CS_COMMON_BACK")),l.createElement(Yl,{currentStep:1,flow:"STAKEHOLDER"}),l.createElement(o.FormStep,{t:C,config:T,onSelect:function(){var e,t,l,n;if(""===j)if(null!=B&&B.i18nKey.includes("ARCHITECT")&&null===R)$(C("BPA_INVALID_MESSAGE_FOR_COA"));else if(null!=B&&B.i18nKey.includes("TOWNPLANNER")&&null===R)$(C("BPA_INVALID_MESSAGE_FOR_AITP_OR_FITP"));else if(null!==I)if(null!==(e=N)&&void 0!==e&&e.result&&null!==(t=N)&&void 0!==t&&null!==(l=t.result)&&void 0!==l&&null!==(n=l.Licenses[0])&&void 0!==n&&n.id){var i;let e=null===(i=N)||void 0===i?void 0:i.formData;e.LicneseType.LicenseType=B,e.LicneseType.ArchitectNo=R,e.LicneseType.selfCertification=H||!1,e.qualificationType=I,D("",N)}else D(T.key,{LicenseType:B,ArchitectNo:R,selfCertification:H,qualificationType:I});else $(C("BPA_SELECT_QUALIFICATION_TYPE"))},onSkip:()=>D(),isDisabled:(null==B?void 0:B.i18nKey.includes("ARCHITECT"))&&!R||(null==B?void 0:B.i18nKey.includes("TOWNPLANNER"))&&!R||!I},l.createElement(o.CardLabel,null,C("BPA_QUALIFICATION_TYPE"),"*"),l.createElement("div",{className:"form-pt-dropdown-only"},l.createElement(o.Dropdown,{t:C,optionKey:"name",isMandatory:T.isMandatory,option:x||[],selected:I,select:e=>{!function(e){L(e),z(e),O(null),w(null),$("")}(e)}})),l.createElement(o.CardLabel,null,C("BPA_LICENSE_TYPE"),"*"),l.createElement("div",{className:"form-pt-dropdown-only"},M&&l.createElement(o.Dropdown,{t:C,optionKey:"code",isMandatory:T.isMandatory,option:Y()||{},selected:B,select:function(e){O(e)},disable:!0})),B&&(null==B?void 0:B.i18nKey.includes("ARCHITECT"))&&l.createElement("div",null,l.createElement(o.CardLabel,null,C("BPA_COUNCIL_NUMBER")+"*"),l.createElement(o.TextInput,{t:C,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"ArchitectNo",value:R,onChange:function(e){const t=e.target.value.trim();w(t),function(e){const t=e.match(/^CA\/(\d{4})\/\d{5}$/);if(!t)return!1;const l=parseInt(t[1],10),n=(new Date).getFullYear();return l>=1972&&l<=n}(t)||""===t?$(""):$(C("BPA_INVALID_MESSAGE_FOR_COA"))},onKeyPress:e=>{"Enter"===e.key&&e.preventDefault()}}),j&&l.createElement("div",{style:{color:"#d32f2f",fontSize:"12px",marginTop:"4px",marginBottom:"12px"}},j)),B&&(null==B?void 0:B.i18nKey.includes("TOWNPLANNER"))&&l.createElement("div",null,l.createElement(o.CardLabel,null,C("BPA_ASSOCIATE_OR_FELLOW_NUMBER"),"*"),l.createElement(o.TextInput,{t:C,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"ArchitectNo",value:R,onChange:function(e){const t=e.target.value.trim();w(t),function(e){const t=e.match(/^(AITP|FITP)\/(\d{4})\/\d{4}$/);if(!t)return!1;const l=parseInt(t[2],10);return l>=1972&&l<=(new Date).getFullYear()}(t)||""===t?$(""):$(C("BPA_INVALID_MESSAGE_FOR_AITP_OR_FITP"))},onKeyPress:e=>{"Enter"===e.key&&e.preventDefault()}}),j&&l.createElement("div",{style:{color:"#d32f2f",fontSize:"12px",marginTop:"4px",marginBottom:"12px"}},j)),B&&((null==B?void 0:B.i18nKey.includes("ARCHITECT"))||(null==B?void 0:B.i18nKey.includes("_ENGINEER"))||(null==B?void 0:B.i18nKey.includes("SUPERVISOR")))&&l.createElement("div",null,l.createElement(o.CheckBox,{label:null!=B&&B.i18nKey.includes("ARCHITECT")?C("DECLARATION_SELF_CERTIFICATION_RESIDENTIAL_ARCHITECT"):null!=B&&B.i18nKey.includes("_ENGINEER")?C("DECLARATION_SELF_CERTIFICATION_RESIDENTIAL_ENGINEER"):null!=B&&B.i18nKey.includes("SUPERVISOR")?C("DECLARATION_SELF_CERTIFICATION_RESIDENTIAL_SUPERVISOR"):C("DECLARATION_SELF_CERTIFICATION_RESIDENTIAL_DESIGNER"),onChange:function(e){W(e.target.checked)},value:H,checked:H||!1,style:{marginBottom:"40px"}}))),l.createElement("div",{style:{flex:"0 0 30%",border:"1px solid #dcdcdc",backgroundColor:"#f9f9f9",borderRadius:"8px",padding:"20px",boxShadow:"0 4px 8px rgba(0, 0, 0, 0.1)",marginTop:"20px"}},l.createElement("h1",{style:{fontSize:"22px",fontWeight:"600",color:"#333",marginBottom:"10px",textAlign:"center",textTransform:"uppercase",letterSpacing:"1px"}},C("BPA_COMPETENCIES")),l.createElement("ul",{style:{fontSize:"16px",color:"#555",lineHeight:"1.6",textAlign:"justify",margin:"0",paddingLeft:"20px"}},B&&(null===(h=Sn[null==B||null===(y=B.i18nKey)||void 0===y?void 0:y.split("_").pop()])||void 0===h||null===(b=h.split("\n"))||void 0===b?void 0:b.map((e,t)=>l.createElement("li",{key:t,style:{marginBottom:"8px"}},e.trim()))))))))},LicenseDetails:e=>{var n,a,r,u,d,c,v,p,m,E,f,_,g,A,S,h,b,y,C,T,D,N,P;let{t:I,config:L,onSelect:B,formData:O}=e;i.useLocation();const R=Digit.UserService.getUser();let w={};const x=Digit.ULBService.getCurrentTenantId();let M=window.location.href.includes("openlink");const F=null==R||null===(n=R.info)||void 0===n?void 0:n.uuid,{data:k,isLoading:U}=Digit.Hooks.useUserSearch(x,{uuid:[F]},{},{enabled:!!F}),[H,W]=t.useState(()=>{var e,t;const l=((null==O||null===(e=O.LicneseDetails)||void 0===e?void 0:e.name)||(M?"":null==R||null===(t=R.info)||void 0===t?void 0:t.name)||"").trim().split(" ");return l.length?l[0]:""}),[j,$]=t.useState(()=>{var e,t;const l=((null==O||null===(e=O.LicneseDetails)||void 0===e?void 0:e.name)||(M?"":null==R||null===(t=R.info)||void 0===t?void 0:t.name)||"").trim().split(" ");return l.length>1?l[l.length-1]:""}),[Y,z]=t.useState(()=>{var e,t;const l=((null==O||null===(e=O.LicneseDetails)||void 0===e?void 0:e.name)||(M?"":null==R||null===(t=R.info)||void 0===t?void 0:t.name)||"").trim().split(" ");return l.length>2?l.slice(1,-1).join(" "):""}),[G,K]=t.useState(""),[V,q]=t.useState(""),[X,J]=t.useState(!0),[Z,Q]=t.useState((null==O||null===(a=O.LicneseDetails)||void 0===a?void 0:a.dateOfBirth)||""),[ee,te]=t.useState((M?"":null==R||null===(r=R.info)||void 0===r?void 0:r.emailId)||(null==O||null===(u=O.LicneseDetails)||void 0===u?void 0:u.email)||(null==O||null===(d=O.formData)||void 0===d||null===(c=d.LicneseDetails)||void 0===c?void 0:c.email)||""),[le,ne]=t.useState((null==O||null===(v=O.LicneseDetails)||void 0===v?void 0:v.gender)||(!M&&k?{i18nKey:"COMMON_GENDER_"+(null==k||null===(p=k.user)||void 0===p||null===(m=p[0])||void 0===m?void 0:m.gender),code:null==k||null===(E=k.user)||void 0===E||null===(f=E[0])||void 0===f?void 0:f.gender,value:null==k||null===(_=k.user)||void 0===_||null===(g=_[0])||void 0===g?void 0:g.gender}:"")||(null==O||null===(A=O.formData)||void 0===A||null===(S=A.LicneseDetails)||void 0===S?void 0:S.gender)),[ie,oe]=t.useState((M?"":null==R||null===(h=R.info)||void 0===h?void 0:h.mobileNumber)||(null==O||null===(b=O.LicneseDetails)||void 0===b?void 0:b.mobileNumber)||(null==O||null===(y=O.formData)||void 0===y||null===(C=y.LicneseDetails)||void 0===C?void 0:C.mobileNumber)||""),[ae,re]=t.useState((null==O||null===(T=O.LicneseDetails)||void 0===T?void 0:T.PanNumber)||(null==O||null===(D=O.formData)||void 0===D||null===(N=D.LicneseDetails)||void 0===N?void 0:N.PanNumber)||""),[ue,de]=t.useState("");t.useEffect(()=>{var e,t,l,n,i,o,a,r;null!=le&&le.code||null==k||null===(e=k.user)||void 0===e||null===(t=e[0])||void 0===t||!t.gender||M||ne({i18nKey:"COMMON_GENDER_"+(null==k||null===(l=k.user)||void 0===l||null===(n=l[0])||void 0===n?void 0:n.gender),code:null==k||null===(i=k.user)||void 0===i||null===(o=i[0])||void 0===o?void 0:o.gender,value:null==k||null===(a=k.user)||void 0===a||null===(r=a[0])||void 0===r?void 0:r.gender})},[k]);const se=Digit.ULBService.getStateId();Digit.Utils.browser.isMobile(),M&&(window.onunload=function(){sessionStorage.removeItem("Digit.BUILDING_PERMIT")});const{isLoading:ce,data:ve}=Digit.Hooks.obps.useMDMS(se,"common-masters",["GenderType"]);let pe=[];return ve&&ve["common-masters"].GenderType.filter(e=>e.active).map(e=>{pe.push({i18nKey:"COMMON_GENDER_"+e.code,code:""+e.code,value:""+e.code})}),U?l.createElement(o.Loader,null):l.createElement("div",null,l.createElement("div",{className:M?"OpenlinkContainer":""},M&&l.createElement(o.BackButton,{style:{border:"none"}},I("CS_COMMON_BACK")),l.createElement(Yl,{currentStep:1,flow:"STAKEHOLDER"}),ce&&U?l.createElement(o.Loader,null):l.createElement(o.FormStep,{config:L,onSelect:()=>{var e,t;const l=new Date,n=new Date(Z);let i=l.getFullYear()-n.getFullYear();const o=l.getMonth()-n.getMonth();if((o<0||0===o&&l.getDate()<n.getDate())&&i--,null!==(null==le?void 0:le.code)){if(null!=O&&O.result&&null!=O&&null!==(e=O.result)&&void 0!==e&&null!==(t=e.Licenses[0])&&void 0!==t&&t.id){let e=null==O?void 0:O.formData;e.LicneseDetails.name=H,e.LicneseDetails.mobileNumber=ie,e.LicneseDetails.gender=le,e.LicneseDetails.email=ee,e.LicneseDetails.PanNumber=ae,B("",O)}else B(L.key,{name:`${H} ${Y} ${j}`,mobileNumber:ie,gender:le,email:ee,PanNumber:ae,dateOfBirth:Z});i<18&&alert(I("BPA_DOB_VALIDATION_MESSAGE"))}else de(I("BPA_APPLICANT_GENDER_PLACEHOLDER"))},onSkip:()=>B(),t:I,isDisabled:!(H&&ie&&le&&Z)},l.createElement("div",null,l.createElement(o.CardLabel,null,I("BPA_FIRST_NAME"),"*"),l.createElement(o.TextInput,s({t:I,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"name",value:H,onChange:function(e){W(e.target.value)},disable:!(!H||M)},w={isRequired:!0,pattern:"^[a-zA-Z ]*$",type:"text",title:I("PT_NAME_ERROR_MESSAGE")})),l.createElement(o.CardLabel,null,I("BPA_MIDDLE_NAME")),l.createElement(o.TextInput,s({t:I,type:"text",isMandatory:!1,name:"Mname",value:Y,onChange:function(e){z(e.target.value)}},w={isRequired:!1,pattern:"^[a-zA-Z ]*$",type:"text",title:I("PT_NAME_ERROR_MESSAGE")})),l.createElement(o.CardLabel,null,I("BPA_LAST_NAME"),"*"),l.createElement(o.TextInput,s({t:I,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"Lname",value:j,onChange:function(e){$(e.target.value)}},w={isRequired:!0,pattern:"^[a-zA-Z ]*$",type:"text",title:I("PT_NAME_ERROR_MESSAGE")})),l.createElement(o.CardLabel,null,I("BPA_APPLICANT_DOB_LABEL"),"*"),l.createElement(o.DatePicker,{date:Z,onChange:function(e){const t=new Date,l=new Date(e);let n=t.getFullYear()-l.getFullYear();const i=t.getMonth()-l.getMonth();(i<0||0===i&&t.getDate()<l.getDate())&&n--,n<18?alert(I("BPA_DOB_VALIDATION_MESSAGE")):Q(e)},min:"1900-01-01",max:(new Date).toISOString().split("T")[0],isRequired:!0}),l.createElement("div",null,l.createElement(o.CardLabel,null,I("BPA_APPLICANT_GENDER_LABEL")+"*"),l.createElement(o.RadioButtons,{t:I,options:pe,optionsKey:"code",name:"gender",value:le,selectedOption:le,onSelect:function(e){ne(e)},isDependent:!0,labelKey:"COMMON_GENDER",disable:!(!le||M)}),ue&&l.createElement("div",{style:{color:"#d32f2f",fontSize:"12px",marginTop:"4px",marginBottom:"12px"}},ue)),l.createElement(o.CardLabel,null,I("BPA_APPLICANT_MOBILE_NO_LABEL")+"*"),l.createElement(o.MobileNumber,{value:ie,name:"mobileNumber",onChange:e=>{oe({value:e}.value)},disable:!(!ie||M),required:!0,pattern:"[6-9]{1}[0-9]{9}",type:"tel",title:I("CORE_COMMON_APPLICANT_MOBILE_NUMBER_INVALID")}),l.createElement(o.CardLabel,null,I("BPA_APPLICANT_EMAIL_LABEL")),l.createElement(o.TextInput,{t:I,type:"email",isMandatory:!1,optionKey:"i18nKey",name:"email",value:ee,onChange:function(e){te(e.target.value)},disable:!(null==R||null===(P=R.info)||void 0===P||!P.emailId||M),required:!0,pattern:"[A-Za-z0-9._%+-]+@[a-z0-9.-]+.[a-z]{2,4}$",type:"email",title:I("CORE_COMMON_APPLICANT_MOBILE_NUMBER_INVALID")})))))},CorrospondenceAddress:e=>{var n,i;let{t:a,config:r,onSelect:u,formData:d}=e;const[s,c]=t.useState((null==d?void 0:d.Correspondenceaddress)||(null==d||null===(n=d.formData)||void 0===n?void 0:n.Correspondenceaddress)||""),[v,p]=t.useState((null==d?void 0:d.isAddressSame)||(null==d||null===(i=d.formData)||void 0===i?void 0:i.isAddressSame)||!1),[m,E]=t.useState(null),[f,_]=t.useState(null),[g,A]=t.useState(!1),S=Digit.ULBService.getCurrentTenantId(),h=Digit.ULBService.getStateId();let b=window.location.href.includes("/openlink/");return Digit.Utils.browser.isMobile(),b&&(window.onunload=function(){sessionStorage.removeItem("Digit.BUILDING_PERMIT")}),l.createElement(l.Fragment,null,l.createElement("div",{className:b?"OpenlinkContainer":""},b&&l.createElement(o.BackButton,{style:{border:"none"}},a("CS_COMMON_BACK")),l.createElement(Yl,{currentStep:2,flow:"STAKEHOLDER"}),l.createElement(o.FormStep,{config:r,onSelect:()=>{var e,t;if(null!=d&&d.result&&null!=d&&null!==(e=d.result)&&void 0!==e&&null!==(t=e.Licenses[0])&&void 0!==t&&t.id)d.Correspondenceaddress=s,d.isAddressSame=v,u("",d,"",!0);else{var l,n,i,o,a,r,c,p,m,f,g,b,y,C,T,D,N,P,I,L;A(!0),console.log("dob here in payload",null!=d&&null!==(l=d.LicneseDetails)&&void 0!==l&&l.dateOfBirth?Pt(null==d||null===(n=d.LicenseDetails)||void 0===n?void 0:n.dateOfBirth):null);let e={Licenses:[{tradeLicenseDetail:{owners:[{gender:null==d||null===(i=d.LicneseDetails)||void 0===i||null===(o=i.gender)||void 0===o?void 0:o.code,mobileNumber:null==d||null===(a=d.LicneseDetails)||void 0===a?void 0:a.mobileNumber,name:null==d||null===(r=d.LicneseDetails)||void 0===r?void 0:r.name,dob:null!=d&&null!==(c=d.LicneseDetails)&&void 0!==c&&c.dateOfBirth?Pt(null==d||null===(p=d.LicenseDetails)||void 0===p?void 0:p.dateOfBirth):null,emailId:null==d||null===(m=d.LicneseDetails)||void 0===m?void 0:m.email,permanentAddress:null==d||null===(f=d.LicneseDetails)||void 0===f?void 0:f.PermanentAddress,correspondenceAddress:s,pan:null==d||null===(g=d.LicneseDetails)||void 0===g?void 0:g.PanNumber}],subOwnerShipCategory:"INDIVIDUAL",tradeUnits:[{tradeType:null==d||null===(b=d.LicneseType)||void 0===b||null===(y=b.LicenseType)||void 0===y?void 0:y.tradeType}],additionalDetail:{qualificationType:null==d||null===(C=d.LicneseType)||void 0===C||null===(T=C.qualificationType)||void 0===T?void 0:T.name,counsilForArchNo:null==d||null===(D=d.LicneseType)||void 0===D?void 0:D.ArchitectNo,isSelfCertificationRequired:null!=d&&null!==(N=d.LicneseType)&&void 0!==N&&N.selfCertification?null==d||null===(P=d.LicneseType)||void 0===P?void 0:P.selfCertification:null,Ulb:null==d||null===(I=d.LicneseDetails)||void 0===I?void 0:I.Ulb},address:{city:"",landmark:"",pincode:null==d||null===(L=d.LicneseDetails)||void 0===L?void 0:L.Pincode},institution:null,applicationDocuments:null},licenseType:"PERMANENT",businessService:"BPAREG",tenantId:h,action:"NOWORKFLOW"}]};Digit.OBPSService.BPAREGCreate(e,S).then((e,t)=>{A(!1),u("",{result:e,formData:d,Correspondenceaddress:s,isAddressSame:v},"",!0)}).catch(e=>{var t,l,n,i,o,a;A(!1),_({key:"error"}),console.log("error message here",null==e||null===(t=e.response)||void 0===t||null===(l=t.data)||void 0===l||null===(n=l.Errors[0])||void 0===n?void 0:n.message),E((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.message)||null)})}},onSkip:()=>u(),t:a,isDisabled:g},l.createElement(o.CheckBox,{label:a("BPA_SAME_AS_PERMANENT_ADDRESS"),onChange:e=>{var t,l,n,i;0==v?(p(!0),c(null!=d&&null!==(t=d.LicneseDetails)&&void 0!==t&&t.PermanentAddress?null==d||null===(l=d.LicneseDetails)||void 0===l?void 0:l.PermanentAddress:null==d||null===(n=d.formData)||void 0===n||null===(i=n.LicneseDetails)||void 0===i?void 0:i.PermanentAddress)):(Array.from(document.querySelectorAll("input")).forEach(e=>e.value=""),p(!1),c(""))},checked:v,style:{paddingBottom:"10px",paddingTop:"10px"}}),l.createElement(o.CardLabel,null,""+a("BPA_APPLICANT_CORRESPONDENCE_ADDRESS_LABEL")),l.createElement(o.TextArea,{t:a,isMandatory:!1,type:"text",optionKey:"i18nKey",name:"Correspondenceaddress",onChange:function(e){c(e.target.value)},value:s,disable:v}))),l.createElement("div",{style:{disabled:"true",height:"30px",width:"100%",fontSize:"14px"}}),f&&l.createElement(o.Toast,{error:"error"===(null==f?void 0:f.key),label:m,isDleteBtn:!0,onClose:()=>{_(null),E(null)}}))},PermanentAddress:e=>{var n,i,a,r,u,d,c,v,p,m,E;let{t:f,config:_,onSelect:g,formData:A}=e,S={};const[h,b]=t.useState((null==A||null===(n=A.LicneseDetails)||void 0===n?void 0:n.PermanentAddress)||(null==A||null===(i=A.formData)||void 0===i||null===(a=i.LicneseDetails)||void 0===a?void 0:a.PermanentAddress)),y=Digit.ULBService.getCurrentTenantId();console.log("tenantId",y),Digit.ULBService.getStateId();let C=window.location.href.includes("/openlink/");Digit.Utils.browser.isMobile();const[T,D]=t.useState((null==A||null===(r=A.LicneseDetails)||void 0===r?void 0:r.Pincode)||(null==A||null===(u=A.formData)||void 0===u||null===(d=u.LicneseDetails)||void 0===d?void 0:d.Pincode)||""),[N,P]=t.useState(""),[I,L]=t.useState((null==A||null===(c=A.LicneseDetails)||void 0===c?void 0:c.Ulb)||(null==A||null===(v=A.formData)||void 0===v||null===(p=v.LicneseDetails)||void 0===p?void 0:p.Ulb)||[]),[B,O]=t.useState("");console.log("formData",A);const R=Digit.SessionStorage.get("OBPS_TENANTS").map(e=>e.name);return t.useEffect(()=>{var e,t;if("BPA_ARCHITECT"==(null==A||null===(e=A.LicneseType)||void 0===e||null===(t=e.LicenseType)||void 0===t?void 0:t.role)){const e=R.map(e=>({ulbname:e}));L(e),console.log("Initial ULBs for BPA_ARCHITECT:",e)}},[null==A||null===(m=A.LicneseType)||void 0===m||null===(E=m.LicenseType)||void 0===E?void 0:E.role]),C&&(window.onunload=function(){sessionStorage.removeItem("Digit.BUILDING_PERMIT")}),t.useEffect(()=>{},[I]),l.createElement(l.Fragment,null,l.createElement("div",{className:C?"OpenlinkContainer":""},C&&l.createElement(o.BackButton,{style:{border:"none"}},f("CS_COMMON_BACK")),l.createElement(Yl,{currentStep:2,flow:"STAKEHOLDER"}),l.createElement(o.FormStep,{config:_,onSelect:()=>{var e,t;if(""===T||T.length<6)O(f("BPA_PINCODE_ERROR_MESSAGE"));else if(null!=A&&A.result&&null!=A&&null!==(e=A.result)&&void 0!==e&&null!==(t=e.Licenses[0])&&void 0!==t&&t.id){let e=null==A?void 0:A.formData;console.log("data",e),e.LicneseDetails.PermanentAddress=h,e.LicneseDetails.Ulb=I,e.LicneseDetails.Pincode=T,g("",A)}else g(_.key,{PermanentAddress:h,Pincode:T,Ulb:I})},onSkip:()=>g(),t:f,isDisabled:!h||0===I.length||""===T},l.createElement(o.CardLabel,null,f("BPA_PERMANANT_ADDRESS_LABEL")+"*"),l.createElement(o.TextArea,{t:f,isMandatory:!1,type:"text",optionKey:"i18nKey",name:"PermanentAddress",onChange:function(e){b(e.target.value)},value:h}),l.createElement("div",null,l.createElement(o.CardLabel,null,f("BPA_DETAILS_PIN_LABEL"),"*"),l.createElement(o.TextInput,s({t:f,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"Pcode",minLength:"6",value:T,onChange:function(e){const t=e.target.value;/^[0-9]*$/.test(t)&&t.length<=6&&D(t)}},S={isRequired:!0,pattern:"^[0-9]{6}$",type:"number",title:f("BPA_PINCODE_ERROR_MESSAGE")})),B&&l.createElement("div",{style:{color:"#d32f2f",fontSize:"12px",marginTop:"4px",marginBottom:"12px"}},B)),l.createElement(o.CardLabel,null,"BPA_SELECT_ULB","*"),l.createElement(o.MultiSelectDropdown,{options:R.map(e=>({ulbname:e})),optionsKey:"ulbname",onSelect:e=>function(e){var t,l;const n=e.map(e=>e[1]);if("BPA_ARCHITECT"==(null==A||null===(t=A.LicneseType)||void 0===t||null===(l=t.LicenseType)||void 0===l?void 0:l.role)){const e=R.map(e=>({ulbname:e}));n.length<e.length?(L(n),console.log("Updated ULBs for BPA_ARCHITECT after deselection:",n)):(L(e),console.log("All ULBs selected for BPA_ARCHITECT:",e))}else L(n),console.log("Selected ULB Types:",n)}(e),defaultLabel:f("Select ULBs"),defaultUnit:f("ULBs"),selected:I}))))},StakeholderDocuments:e=>{var n,i,a,r;let{t:u,config:d,onSelect:s,formData:c}=e;Digit.ULBService.getCurrentTenantId();const v=Digit.ULBService.getStateId(),[p,m]=t.useState((null==c||null===(n=c.documents)||void 0===n?void 0:n.documents)||[]),[E,f]=t.useState(null),[_,g]=t.useState([]),[A,S]=t.useState(!0),[h,b]=t.useState(!1),y=!!Digit.Utils.browser.isMobile();let C=window.location.href.includes("/openlink/");C&&(window.onunload=function(){sessionStorage.removeItem("Digit.BUILDING_PERMIT")});const{data:T,isLoading:D}=Digit.Hooks.obps.useMDMS(v,"StakeholderRegistraition","TradeTypetoRoleMapping");return t.useEffect(()=>{var e,t,l,n;let i=[];var o,a;null!=T&&null!==(e=T.StakeholderRegistraition)&&void 0!==e&&e.TradeTypetoRoleMapping&&(i=null==T||null===(o=T.StakeholderRegistraition)||void 0===o||null===(a=o.TradeTypetoRoleMapping)||void 0===a?void 0:a.filter(e=>{var t,l,n;return e.tradeType===(null==c||null===(t=c.formData)||void 0===t||null===(l=t.LicneseType)||void 0===l||null===(n=l.LicenseType)||void 0===n?void 0:n.tradeType)}));let r=[];null===(t=i)||void 0===t||null===(l=t[0])||void 0===l||null===(n=l.docTypes)||void 0===n||n.forEach(e=>{r.push(e)}),g(r)},[!D]),t.useEffect(()=>{let e=0;_.map(t=>{let l=!1;p.map(e=>{t.required&&null!==e&&e&&t.code==`${e.documentType.split(".")[0]}.${e.documentType.split(".")[1]}`&&(l=!0)}),!l&&t.required&&(e+=1)}),S("0"!=e&&0!=e||!(p.length>0))},[p,h]),l.createElement("div",null,l.createElement("div",{className:C?"OpenlinkContainer":""},C&&l.createElement(o.BackButton,{style:{border:"none"}},u("CS_COMMON_BACK")),l.createElement(Yl,{currentStep:3,flow:"STAKEHOLDER"}),D?l.createElement(o.Loader,null):l.createElement(o.FormStep,{t:u,config:d,onSelect:()=>{let e,t=c.documents,l=[];_&&p&&null!==p&&_.map((e,t)=>{let n=p.find(t=>t&&null!==t&&t.documentType===e.code);n&&l.push(n)}),e={...t,documents:l},s(d.key,e)},onSkip:()=>s(),isDisabled:A,onAdd:function(){},cardStyle:{paddingRight:"16px"}},null==_?void 0:_.map((e,t)=>l.createElement(hn,{key:t,document:e,t:u,error:E,setError:f,setDocuments:m,documents:p,setCheckRequiredFields:b,isCitizenUrl:y})),E&&l.createElement(o.Toast,{label:E,isDleteBtn:!0,onClose:()=>f(null),error:!0})),!(null!=c&&c.initiationFlow)&&l.createElement(o.CitizenInfoLabel,{info:u("CS_FILE_APPLICATION_INFO_LABEL"),text:`${u("BPA_APPLICATION_NUMBER_LABEL")} ${null==c||null===(i=c.result)||void 0===i||null===(a=i.Licenses)||void 0===a||null===(r=a[0])||void 0===r?void 0:r.applicationNumber} ${u("BPA_DOCS_INFORMATION")}`,className:"info-banner-wrap-citizen-override"})))},OCBasicDetails:e=>{var i,a,r,u,d,s,v,p,m,E,f,_,g,A,S,h;let{formData:b,onSelect:y,config:C}=e;const[T,D]=t.useState(null),[N,P]=t.useState(null==b||null===(i=b.data)||void 0===i?void 0:i.scrutinyNumber),I=window.Digit.Utils.browser.isMobile(),[L,B]=t.useState(!(null==b||null===(a=b.data)||void 0===a||!a.scrutinyNumber)),{t:O}=n.useTranslation(),R=(Digit.ULBService.getCurrentTenantId(),Digit.ULBService.getStateId()),[w,x]=t.useState((null==b||null===(r=b.data)||void 0===r?void 0:r.bpaData)||{}),[M,F]=t.useState((null==b||null===(u=b.data)||void 0===u?void 0:u.edcrDetails)||null),[k,U]=t.useState(!1),{isMdmsLoading:H,data:W}=Digit.Hooks.obps.useMDMS(R,"BPA",["RiskTypeComputation"]);Digit.Utils.obps.calculateRiskType(null==W||null===(d=W.BPA)||void 0===d?void 0:d.RiskTypeComputation,null==M||null===(s=M.planDetail)||void 0===s||null===(v=s.plot)||void 0===v?void 0:v.area,null==M||null===(p=M.planDetail)||void 0===p?void 0:p.blocks),t.useEffect(()=>{},T);const j=function(){try{return F(null),x(null),U(!0),Promise.resolve((e=null==N?void 0:N.edcrNumber,t=R,Promise.resolve(function(e,t){try{return Promise.resolve(c(function(){return Promise.resolve(Digit.OBPSService.scrutinyDetails(t,{edcrNumber:e}))},function(e){var t,l;return null!=e&&null!==(t=e.response)&&void 0!==t&&t.statusText?null==e||null===(l=e.response)||void 0===l?void 0:l.statusText:"BPA_INTERNAL_SERVER_ERROR"}))}catch(e){return Promise.reject(e)}}(e,t)).then(function(l){var n,i,o,a;return null!=l&&null!==(n=l.edcrDetail)&&void 0!==n&&null!==(i=n[0])&&void 0!==i&&i.edcrNumber?Promise.resolve(Digit.OBPSService.BPASearch(t,{approvalNo:null==l||null===(o=l.edcrDetail)||void 0===o||null===(a=o[0])||void 0===a?void 0:a.permitNumber})).then(function(n){var i,o,a,r;const u=null==n||null===(i=n.BPA)||void 0===i||null===(o=i[0])||void 0===o?void 0:o.edcrNumber;return t=null==n||null===(a=n.BPA)||void 0===a||null===(r=a[0])||void 0===r?void 0:r.tenantId,Promise.resolve(Digit.OBPSService.scrutinyDetails(t,{edcrNumber:u})).then(function(i){return Promise.resolve(Digit.OBPSService.BPASearch(t,{edcrNumber:e})).then(function(e){var t,o,a,r,u;return null!=l&&null!==(t=l.edcrDetail)&&void 0!==t&&null!==(o=t[0])&&void 0!==o&&o.edcrNumber?null!=l&&null!==(a=l.edcrDetail)&&void 0!==a&&null!==(r=a[0])&&void 0!==r&&r.edcrNumber?{ocEdcrDetails:null==l||null===(u=l.edcrDetail)||void 0===u?void 0:u[0],otherDetails:{bpaApprovalResponse:null==n?void 0:n.BPA,edcrDetails:null==i?void 0:i.edcrDetail,bpaResponse:null==e?void 0:e.BPA}}:{type:"ERROR",message:"BPA_NO_RECORD_FOUND"}:{type:"ERROR",message:l||"BPA_NO_RECORD_FOUND"}})})}):{type:"ERROR",message:l||"BPA_NO_RECORD_FOUND"}}))).then(function(e){var t,l,n;U(!1),"ERROR"==(null==e?void 0:e.type)&&(D({key:"true",message:null==e?void 0:e.message}),F(null),x(null));let i=null==e?void 0:e.otherDetails,o=null==e?void 0:e.ocEdcrDetails;if(i&&o&&null!=o&&o.tenantId&&null!=i&&null!==(t=i.edcrDetails)&&void 0!==t&&null!==(l=t[0])&&void 0!==l&&l.tenantId){var a,r,u,d,s,c,v,p,m,E;if((null==i||null===(a=i.edcrDetails)||void 0===a||null===(r=a[0])||void 0===r?void 0:r.tenantId)!=(null==o?void 0:o.tenantId))return void D({key:"true",message:"BPA_INVALID_PERMIT_CITY"});if((null==i||null===(u=i.bpaApprovalResponse)||void 0===u||null===(d=u[0])||void 0===d?void 0:d.edcrNumber)===(null==o?void 0:o.edcrNumber)&&("REJECTED"!=(null==i||null===(s=i.bpaResponse)||void 0===s||null===(c=s[0])||void 0===c?void 0:c.status)&&"PERMIT REVOCATION"!=(null==i||null===(v=i.bpaResponse)||void 0===v||null===(p=v[0])||void 0===p?void 0:p.status)||"INITIATED"!=(null==i||null===(m=i.bpaResponse)||void 0===m||null===(E=m[0])||void 0===E?void 0:E.status)))return void D({key:"true",message:"APPLICATION_NUMBER_ALREADY_EXISTS"});sessionStorage.setItem("checkForProcced",JSON.stringify(!1)),D(null),F(M)}null!=e&&null!==(n=e.ocEdcrDetails)&&void 0!==n&&n.edcrNumber&&(F(null==e?void 0:e.ocEdcrDetails),x(null==e?void 0:e.otherDetails),D(null))})}catch(e){return Promise.reject(e)}var e,t};let $=sessionStorage.getItem("isEDCRDisable");$=JSON.parse($),t.useEffect(()=>{if($){let e=sessionStorage.getItem("isEDCRAPIType");e=!!e&&JSON.parse(e),e&&M||(sessionStorage.setItem("isEDCRAPIType",JSON.stringify(!0)),Promise.resolve(j()).then(function(){}))}},[]);const Y=e=>{let t=!1;if(w&&M){var l,n,i,o,a,r,u,d,s,c,v,p,m,E,f,_,g;const e=(null==w||null===(l=w.edcrDetails)||void 0===l?void 0:l[0])||{},A=M||{},S=null==A||null===(n=A.planDetail)||void 0===n||null===(i=n.planInformation)||void 0===i?void 0:i.khataNo,h=null==e||null===(o=e.planDetail)||void 0===o||null===(a=o.planInformation)||void 0===a?void 0:a.khataNo,b=null==A||null===(r=A.planDetail)||void 0===r||null===(u=r.planInformation)||void 0===u?void 0:u.plotNo,y=null==e||null===(d=e.planDetail)||void 0===d||null===(s=d.planInformation)||void 0===s?void 0:s.plotNo,C={LOW:0,MEDIUM:1,HIGH:2},T=Digit.Utils.obps.calculateRiskType(null==W||null===(c=W.BPA)||void 0===c?void 0:c.RiskTypeComputation,null==A||null===(v=A.planDetail)||void 0===v||null===(p=v.plot)||void 0===p?void 0:p.area,null==M||null===(m=M.planDetail)||void 0===m?void 0:m.blocks),N=Digit.Utils.obps.calculateRiskType(null==W||null===(E=W.BPA)||void 0===E?void 0:E.RiskTypeComputation,null==e||null===(f=e.planDetail)||void 0===f||null===(_=f.plot)||void 0===_?void 0:_.area,null==M||null===(g=M.planDetail)||void 0===g?void 0:g.blocks);if(S&&h&&b&&y){if(b!=y||S!=h)return S!=h&&b==y?(t=!1,D({key:"true",message:"Khata number from permit order XXXX(permit order number) is not matching with the khata number from occupancy certificate. You cannot proceed with the application"})):b!=y&&S==h?(t=!1,D({key:"true",message:"Plot number from permit order XXXX(permit order number) is not matching with the Plot number from occupancy certificate. You cannot proceed with the application"})):b!=y&&S!=h&&(t=!1,D({key:"true",message:"Khata No and plot No from permit order XXXX(permit order number) is not matching with the Khata No and plot No from occupancy certificate. You cannot proceed with the application"})),!1;t=!0}C[N]<C[T]?(t=!1,D({key:"true",message:O("BPA_RISK_TYPE_VALIDATION_ERROR"),labelName:"The Risk type from permit order XXXX(permit order number) to occupancy certificate application is changed from Low to high .You cannot proceed with the application."})):C[N]>C[T]?(t=JSON.parse(sessionStorage.getItem("checkForProcced")),D({warning:"true",message:O("BPA_RISK_TYPE_VALIDATION_WARNING"),labelName:"The Risk type in permit order XXXX is high where as the risk type in occupancy is Low , do you want to continue"})):t=!0}var A,S,h,b,T,P,I,L;t&&y(null==C?void 0:C.key,{scrutinyNumber:N,applicantName:null==M||null===(A=M.planDetail)||void 0===A||null===(S=A.planInformation)||void 0===S?void 0:S.applicantName,occupancyType:null==M||null===(h=M.planDetail)||void 0===h||null===(b=h.planInformation)||void 0===b?void 0:b.occupancy,applicationType:null==M?void 0:M.appliactionType,serviceType:null==M?void 0:M.applicationSubType,applicationDate:null==M?void 0:M.applicationDate,riskType:Digit.Utils.obps.calculateRiskType(null==W||null===(T=W.BPA)||void 0===T?void 0:T.RiskTypeComputation,null==M||null===(P=M.planDetail)||void 0===P||null===(I=P.plot)||void 0===I?void 0:I.area,null==M||null===(L=M.planDetail)||void 0===L?void 0:L.blocks),bpaData:w,edcrDetails:M})};return H?l.createElement(o.Loader,null):l.createElement("div",null,l.createElement(Yl,{currentStep:1,flow:"OCBPA"}),l.createElement("div",{className:I?"obps-search":"",style:I?{}:{maxWidth:"960px",minWidth:"640px",marginRight:"auto"}},l.createElement(o.Label,null,O("OBPS_SEARCH_EDCR_NUMBER")),l.createElement(o.TextInput,{className:"searchInput",onKeyPress:function(e){try{const t=function(t){if(null!=N&&null!==(t=N.edcrNumber)&&void 0!==t&&t.startsWith("OC")){const t=function(){if("Enter"===e.key)return Promise.resolve(j()).then(function(){})}();if(t&&t.then)return t.then(function(){})}else D({key:"true",message:O("BPA_INVALID_OCEDCR_NO"),labelName:"Please enter the valid OCeDCR Number."})}();return Promise.resolve(t&&t.then?t.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},onChange:e=>P({edcrNumber:e.target.value}),value:null==N?void 0:N.edcrNumber,signature:!0,signatureImg:!$&&l.createElement(o.SearchIconSvg,{className:"signature-img",onClick:!$&&null!=N&&N.edcrNumber?()=>function(e){try{const e=function(e){if(null!=N&&null!==(e=N.edcrNumber)&&void 0!==e&&e.startsWith("OC"))return Promise.resolve(j()).then(function(){});D({key:"true",message:O("BPA_INVALID_OCEDCR_NO"),labelName:"Please enter the valid OCeDCR Number."})}();return Promise.resolve(e&&e.then?e.then(function(){}):void 0)}catch(e){return Promise.reject(e)}}():null}),disable:L,style:{marginBottom:"10px"}})),k?l.createElement(o.Loader,null):null,M&&l.createElement(o.Card,null,l.createElement(o.CardCaption,null,O("BPA_SCRUTINY_DETAILS")),l.createElement(o.CardHeader,null,O("BPA_BASIC_DETAILS_TITLE")),l.createElement(o.StatusTable,null,l.createElement(o.Row,{className:"border-none",label:O("BPA_BASIC_DETAILS_APP_DATE_LABEL"),text:null!=M&&M.applicationDate?Fl(new Date(null==M?void 0:M.applicationDate),"dd/MM/yyyy"):null==M?void 0:M.applicationDate}),l.createElement(o.Row,{className:"border-none",label:O("BPA_BASIC_DETAILS_APPLICATION_TYPE_LABEL"),text:O("WF_BPA_"+(null==M?void 0:M.appliactionType))}),l.createElement(o.Row,{className:"border-none",label:O("BPA_BASIC_DETAILS_SERVICE_TYPE_LABEL"),text:O(null==M?void 0:M.applicationSubType)}),l.createElement(o.Row,{className:"border-none",label:O("BPA_BASIC_DETAILS_OCCUPANCY_LABEL"),text:null==M||null===(m=M.planDetail)||void 0===m||null===(E=m.planInformation)||void 0===E?void 0:E.occupancy}),l.createElement(o.Row,{className:"border-none",label:O("BPA_BASIC_DETAILS_RISK_TYPE_LABEL"),text:O("WF_BPA_"+Digit.Utils.obps.calculateRiskType(null==W||null===(f=W.BPA)||void 0===f?void 0:f.RiskTypeComputation,null==M||null===(_=M.planDetail)||void 0===_||null===(g=_.plot)||void 0===g?void 0:g.area,null==M||null===(A=M.planDetail)||void 0===A?void 0:A.blocks))}),l.createElement(o.Row,{className:"border-none",label:O("BPA_BASIC_DETAILS_APPLICATION_NAME_LABEL"),text:null==M||null===(S=M.planDetail)||void 0===S||null===(h=S.planInformation)||void 0===h?void 0:h.applicantName})),l.createElement(o.SubmitBar,{label:O("CS_COMMON_NEXT"),onSubmit:Y})),T&&l.createElement(o.Toast,{error:!(null==T||!T.key),warning:!(null==T||!T.warning),label:O(null==T?void 0:T.message),isDleteBtn:!0,onClose:()=>{D(null)},onNo:()=>{D(null)},onYes:()=>{sessionStorage.setItem("checkForProcced",JSON.stringify(!0)),Y()},isWarningButtons:!0}))},OBPSSearchApplication:e=>{var n,r,u,d,c,v,p,m,E,f,_,g,A,S,h,b,y;let{t:C,onSubmit:T,data:D,error:N,searchData:P,isLoading:I,Count:L,setparamerror:B}=e;const[O,R]=t.useState(null),w=sessionStorage.getItem("Digit.citizen.userRequestObject"),x=w?JSON.parse(w):{},M=null==x||null===(n=x.value)||void 0===n?void 0:n.info,F=null==x||null===(r=x.value)||void 0===r||null===(u=r.info)||void 0===u?void 0:u.mobileNumber,{register:k,control:U,handleSubmit:H,setValue:W,getValues:j,reset:$,formState:Y}=a.useForm({defaultValues:{applicationNo:"",mobileNumber:window.location.href.includes("/search/obps-application")?F:"",name:"",fromDate:"",toDate:"",status:"",offset:0,limit:10,sortBy:"commencementDate",sortOrder:"DESC",applicationType:(null==M||null===(d=M.roles)||void 0===d||null===(c=d.filter(e=>e.code.includes("BPAREG_")))||void 0===c?void 0:c.length)<=0&&(null==M||null===(v=M.roles)||void 0===v?void 0:v.filter(e=>e.code.includes("BPA_")||e.code.includes("CITIZEN")).length)>0?{code:"BUILDING_PLAN_SCRUTINY",i18nKey:"WF_BPA_BUILDING_PLAN_SCRUTINY"}:(null==M||null===(p=M.roles)||void 0===p||null===(m=p.filter(e=>e.code.includes("BPAREG_")))||void 0===m?void 0:m.length)>0&&(null==M||null===(E=M.roles)||void 0===E?void 0:E.filter(e=>e.code.includes("BPA_")||e.code.includes("CITIZEN")).length)<=0?{code:"BPA_STAKEHOLDER_REGISTRATION",i18nKey:"WF_BPA_BPA_STAKEHOLDER_REGISTRATION"}:{code:"BUILDING_PLAN_SCRUTINY",i18nKey:"WF_BPA_BUILDING_PLAN_SCRUTINY"},serviceType:(null==M||null===(f=M.roles)||void 0===f||null===(_=f.filter(e=>e.code.includes("BPAREG_")))||void 0===_?void 0:_.length)<=0&&(null==M||null===(g=M.roles)||void 0===g?void 0:g.filter(e=>e.code.includes("BPA_")||e.code.includes("CITIZEN")).length)>0?{applicationType:["BUILDING_PLAN_SCRUTINY","BUILDING_OC_PLAN_SCRUTINY"],code:"NEW_CONSTRUCTION",i18nKey:"BPA_SERVICETYPE_NEW_CONSTRUCTION"}:(null==M||null===(A=M.roles)||void 0===A||null===(S=A.filter(e=>e.code.includes("BPAREG_")))||void 0===S?void 0:S.length)>0&&(null==M||null===(h=M.roles)||void 0===h?void 0:h.filter(e=>e.code.includes("BPA_")||e.code.includes("CITIZEN")).length)<=0?"":{applicationType:["BUILDING_PLAN_SCRUTINY","BUILDING_OC_PLAN_SCRUTINY"],code:"NEW_CONSTRUCTION",i18nKey:"BPA_SERVICETYPE_NEW_CONSTRUCTION"},...P}});t.useEffect(()=>{k("offset",0),k("limit",10),k("sortBy","commencementDate"),k("sortOrder","DESC")},[k]),l.useEffect(()=>{var e,t,l,n,i,o,a,r,u,d,s,c,v,p;Y.isSubmitSuccessful&&$({applicationNo:"",mobileNumber:window.location.href.includes("/search/obps-application")?null===(e=Digit.UserService.getUser())||void 0===e||null===(t=e.info)||void 0===t?void 0:t.mobileNumber:"",name:"",fromDate:"",toDate:"",status:"",offset:0,limit:10,sortBy:"commencementDate",sortOrder:"DESC",applicationType:(null==M||null===(l=M.roles)||void 0===l||null===(n=l.filter(e=>e.code.includes("BPAREG_")))||void 0===n?void 0:n.length)<=0&&(null==M||null===(i=M.roles)||void 0===i?void 0:i.filter(e=>e.code.includes("BPA_")||e.code.includes("citizen")).length)>0?{code:"BUILDING_PLAN_SCRUTINY",i18nKey:"WF_BPA_BUILDING_PLAN_SCRUTINY"}:(null==M||null===(o=M.roles)||void 0===o||null===(a=o.filter(e=>e.code.includes("BPAREG_")))||void 0===a?void 0:a.length)>0&&(null==M||null===(r=M.roles)||void 0===r?void 0:r.filter(e=>e.code.includes("BPA_")||e.code.includes("citizen")).length)<=0?{code:"BPA_STAKEHOLDER_REGISTRATION",i18nKey:"WF_BPA_BPA_STAKEHOLDER_REGISTRATION"}:{code:"BUILDING_PLAN_SCRUTINY",i18nKey:"WF_BPA_BUILDING_PLAN_SCRUTINY"},serviceType:(null==M||null===(u=M.roles)||void 0===u||null===(d=u.filter(e=>e.code.includes("BPAREG_")))||void 0===d?void 0:d.length)<=0&&(null==M||null===(s=M.roles)||void 0===s?void 0:s.filter(e=>e.code.includes("BPA_")||e.code.includes("citizen")).length)>0?{applicationType:["BUILDING_PLAN_SCRUTINY","BUILDING_OC_PLAN_SCRUTINY"],code:"NEW_CONSTRUCTION",i18nKey:"BPA_SERVICETYPE_NEW_CONSTRUCTION"}:(null==M||null===(c=M.roles)||void 0===c||null===(v=c.filter(e=>e.code.includes("BPAREG_")))||void 0===v?void 0:v.length)>0&&(null==M||null===(p=M.roles)||void 0===p?void 0:p.filter(e=>e.code.includes("BPA_")||e.code.includes("citizen")).length)<=0?"":{applicationType:["BUILDING_PLAN_SCRUTINY","BUILDING_OC_PLAN_SCRUTINY"],code:"NEW_CONSTRUCTION",i18nKey:"BPA_SERVICETYPE_NEW_CONSTRUCTION"},...P,isSubmitSuccessful:!1})},[Y]);const z=(e=>{let{t:n}=e;const o=e=>{let t="BPAREG"===e?"search/application/stakeholder":"search/application/bpa";return window.location.href.includes("/citizen")&&(t="BPAREG"===e?"stakeholder":"bpa"),t},a=e=>l.createElement("span",{className:"cell-text"},e);return t.useMemo(()=>[{Header:n("BPA_APPLICATION_NUMBER_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:window.location.href.includes("/citizen")?`/digit-ui/citizen/obps/${o(t.original.businessService)||"--"}/${t.original.applicationNo||t.original.applicationNumber}`:`/digit-ui/employee/obps/${o(t.original.businessService)||"--"}/${t.original.applicationNo||t.original.applicationNumber}`},t.original.applicationNo||t.original.applicationNumber)))}},{Header:n("BPA_COMMON_TABLE_COL_APP_DATE_LABEL"),disableSortBy:!0,accessor:e=>{var t,l;return a(null!=e&&null!==(t=e.auditDetails)&&void 0!==t&&t.createdTime?It(null==e||null===(l=e.auditDetails)||void 0===l?void 0:l.createdTime):"")}},{Header:n("BPA_SEARCH_APPLICATION_TYPE_LABEL"),disableSortBy:!0,accessor:"applicationType",Cell:e=>{var t,i,o,a,r,u;let{row:d}=e;return l.createElement("div",null,l.createElement("span",{className:"cell-text"},null!==(t=d.original)&&void 0!==t&&null!==(i=t.additionalDetails)&&void 0!==i&&i.applicationType?n("WF_BPA_"+(null===(o=d.original)||void 0===o||null===(a=o.additionalDetails)||void 0===a?void 0:a.applicationType)):null!==(r=d.original)&&void 0!==r&&r.businessService?n("BPA_APPLICATIONTYPE_"+(null==d||null===(u=d.original)||void 0===u?void 0:u.businessService)):"-"))}},{Header:n("BPA_BASIC_DETAILS_SERVICE_TYPE_LABEL"),disableSortBy:!0,accessor:e=>{var t,l,i,o,r;return a(n((null===(t=e.additionalDetails)||void 0===t?void 0:t.serviceType)||n("TRADELICENSE_TRADETYPE_"+(null==e||null===(l=e.tradeLicenseDetail)||void 0===l||null===(i=l.tradeUnits)||void 0===i||null===(o=i[0])||void 0===o||null===(r=o.tradeType)||void 0===r?void 0:r.split(".")[0]))||"-"))}},{Header:n("BPA_OWNER_HEAD"),accessor:e=>{var t;return a((null==e||null===(t=e.additionalDetails)||void 0===t?void 0:t.ownerName)||"NA")},disableSortBy:!0},{Header:n("BPA_STATUS_LABEL"),accessor:e=>a(n((null==e?void 0:e.state)&&"WF_BPA_"+e.state||(null==e?void 0:e.state)&&"WF_BPA_"+e.status||"NA")),disableSortBy:!0}],[])})({t:C}),[G,K]=t.useState(j("offset")/j("limit"));t.useEffect(()=>{""!==N&&(B(""),R({key:!0,label:N}))},[N]);const V=t.useCallback(e=>{0!==e.length&&(W("sortBy",e.id),W("sortOrder",e.desc?"DESC":"ASC"))},[]);function q(){W("offset",j("offset")-j("limit")),H(T)()}t.useEffect(()=>{null!=j("offset")&&null!=j("limit")&&K(j("offset")/j("limit"))},[j("offset"),j("limit")]);const X=window.Digit.Utils.browser.isMobile(),J={formState:Y,Controller:a.Controller,register:k,control:U,t:C,reset:$,previousPage:q},Z=e=>{var t;const l="BPAREG"==(null==D||null===(t=D[0])||void 0===t?void 0:t.businessService)?"BPAREG":e;let n="BPAREG"===l?"search/application/stakeholder":"search/application/bpa";return window.location.href.includes("/citizen")&&(n="BPAREG"===l?"stakeholder":"bpa"),n},Q=t.useMemo(()=>null==D?void 0:D.map(e=>{var t,l,n,i,o,a,r,u;return{[C("BPA_APPLICATION_NUMBER_LABEL")]:e.applicationNo||e.applicationNumber,[C("BPA_COMMON_TABLE_COL_APP_DATE_LABEL")]:It(null===(t=e.auditDetails)||void 0===t?void 0:t.createdTime)||"",[C("BPA_SEARCH_APPLICATION_TYPE_LABEL")]:null!=e&&null!==(l=e.additionalDetails)&&void 0!==l&&l.applicationType?C("WF_BPA_"+(null==e||null===(n=e.additionalDetails)||void 0===n?void 0:n.applicationType)):C(null!=e&&e.businessService?"BPA_APPLICATIONTYPE_"+(null==e?void 0:e.businessService):"CS_NA"),[C("BPA_BASIC_DETAILS_SERVICE_TYPE_LABEL")]:C((null===(i=e.additionalDetails)||void 0===i?void 0:i.serviceType)||C("TRADELICENSE_TRADETYPE_"+(null==e||null===(o=e.tradeLicenseDetail)||void 0===o||null===(a=o.tradeUnits)||void 0===a||null===(r=a[0])||void 0===r||null===(u=r.tradeType)||void 0===u?void 0:u.split(".")[0]))||C("CS_NA")),[C("BPA_CURRENT_OWNER_HEAD")]:(null==e?void 0:e.assignee)||C("CS_NA"),[C("BPA_STATUS_LABEL")]:C((null==e?void 0:e.state)&&"WF_BPA_"+e.state||(null==e?void 0:e.state)&&"WF_BPA_"+e.status||C("CS_NA"))}}),[D]);if(X){var ee,te;const[e,n]=t.useReducer(function(e,t){switch(t.type){case"set":return t.payload;case"remove":return!1}},!1),i=()=>{n({type:"remove"})},a=()=>l.createElement("div",{className:"InboxMobilePopupCloseButtonWrapper",onClick:i},l.createElement(o.CloseSvg,null)),r=e=>{let{currentlyActiveMobileModal:n,searchFormFieldsComponentProps:i,...r}=e;const{closeMobilePopupModal:u}=r;switch(n){case"SearchFormComponent":return l.createElement(t.Fragment,null,l.createElement(o.SearchForm,r,l.createElement(a,null),l.createElement("div",{className:"MobilePopupHeadingWrapper"},l.createElement("h2",null,C("ES_COMMON_SEARCH_APPLICATION"),":")),window.location.href.includes("citizen/obps/search/application")&&l.createElement("div",{style:{background:"#ffffff",padding:"20px 0px",color:"#00000099"}},l.createElement("label",null,C("BPA_SEARCH_CREATED_BY_STAKEHOLDER_LABEL"))),l.createElement(Ut,s({},i,{closeMobilePopupModal:u}))));default:return l.createElement("span",null)}},u=t.useCallback(e=>{let{currentlyActiveMobileModal:t,searchFormFieldsComponentProps:l,...n}=e;return r({currentlyActiveMobileModal:t,searchFormFieldsComponentProps:l,...n})},[e]);return I?l.createElement(o.Loader,null):l.createElement(l.Fragment,null,l.createElement("div",{className:"searchBox"},l.createElement(o.SearchAction,{text:C("ES_COMMON_SEARCH_APPLICATION"),handleActionClick:()=>n({type:"set",payload:"SearchFormComponent"})})),e?l.createElement(o.PopUp,null,l.createElement(u,{onSubmit:e=>{n({type:"remove"}),T(e)},handleSubmit:H,id:"search-form",className:"rm-mb form-field-flex-one inboxPopupMobileWrapper",searchFormFieldsComponentProps:J,currentlyActiveMobileModal:e,closeMobilePopupModal:i})):null,null!=D&&null!==(ee=D[0])&&void 0!==ee&&ee.display?l.createElement(o.Card,{style:{marginTop:20}},C(null==D||null===(te=D[0])||void 0===te?void 0:te.display).split("\\n").map((e,t)=>l.createElement("p",{key:t,style:{textAlign:"center"}},e))):l.createElement(o.DetailsCard,{data:Q,isTwoDynamicPrefix:!0,linkPrefix:window.location.href.includes("/citizen")?"/digit-ui/citizen/obps/":"/digit-ui/employee/obps/",getRedirectionLink:Z,serviceRequestIdKey:"applicationNo"}))}return l.createElement(l.Fragment,null,l.createElement(o.Header,null,C("ES_COMMON_SEARCH_APPLICATION")),window.location.href.includes("citizen/obps/search/application")&&l.createElement("div",{style:{background:"#ffffff",paddingLeft:"25px",paddingTop:"10px",color:"#00000099"}},l.createElement("label",null,C("BPA_SEARCH_CREATED_BY_STAKEHOLDER_LABEL"))),l.createElement(o.SearchForm,{onSubmit:T,handleSubmit:H},l.createElement(Ut,J)),!I&&null!=D&&null!==(b=D[0])&&void 0!==b&&b.display?l.createElement(o.Card,{style:{marginTop:20}},C(null==D||null===(y=D[0])||void 0===y?void 0:y.display).split("\\n").map((e,t)=>l.createElement("p",{key:t,style:{textAlign:"center"}},e))):O?"":I?l.createElement(o.Loader,null):l.createElement(o.Table,{t:C,data:D,columns:z,getCellProps:e=>({style:{minWidth:e.column.Header===C("ES_INBOX_APPLICATION_NO")?"240px":"",padding:"20px 18px",fontSize:"16px"}}),onPageSizeChange:function(e){W("limit",Number(e.target.value)),H(T)()},currentPage:G,onNextPage:function(){W("offset",j("offset")+j("limit")),H(T)()},onPrevPage:q,pageSizeLimit:j("limit"),onSort:V,totalRecords:L,disableSort:!1,onLastPage:()=>{W("offset",L&&10*Math.ceil(L/10)-j("limit")),H(T)()},onFirstPage:()=>{W("offset",0),H(T)()},sortParams:[{id:j("sortBy"),desc:"DESC"===j("sortOrder")}]}),O&&l.createElement(o.Toast,{warning:"BPA_ADD_MORE_PARAM_STAKEHOLDER"==O.label,error:"BPA_ADD_MORE_PARAM_STAKEHOLDER"!=O.label&&O.key,label:C(O.label),isDleteBtn:!0,onClose:()=>{R(null)}}))},InspectionReport:e=>{let{config:a,onSelect:r,userType:u,formData:d,setError:c,formState:v,clearErrors:p}=e;const{t:m}=n.useTranslation(),{pathname:E}=i.useLocation(),f=E.includes("/modify-application/"),[_,g]=t.useState((null==d?void 0:d.FieldReports)||[Pn()]),[A,S]=t.useState({index:-1,type:""}),h=(Digit.ULBService.getCurrentTenantId(),Digit.ULBService.getStateId()),[b,y]=t.useState([]),[C,T]=t.useState([]),[D,N]=t.useState([]),[P,I]=t.useState([]),[L,B]=t.useState([]),[O,R]=t.useState([]),[w,x]=t.useState(!1),[M,F]=t.useState((null==d?void 0:d.tradedetils1)||[]);let k=window.location.href.includes("tl/renew-application-details");window.location.href.includes("tl/renew-application-details")&&(k=!0);const{data:U,isLoading:H}=Digit.Hooks.tl.useTradeLicenseMDMS(h,"TradeLicense","TradeUnits","[?(@.type=='TL')]"),{data:W}=Digit.Hooks.obps.useMDMS(h,"BPA",["CheckList"]);t.useEffect(()=>{const e=_.map(e=>e);r(null==a?void 0:a.key,e),sessionStorage.setItem("INSPECTION_DATA",JSON.stringify(e))},[_]),t.useEffect(()=>{r("tradedetils1",M)},[M]),t.useEffect(()=>{let e=[],t=[];W&&W.BPA.CheckList.map(l=>{"LOW"===(null==l?void 0:l.RiskType)&&"FIELDINSPECTION_PENDING"===(null==l?void 0:l.WFState)&&(e=[...l.questions],t=[...l.docTypes])}),B(t),I(e)},[W]);const j={focusIndex:A,allFieldReport:_,setFocusIndex:S,removeUnit:e=>{g(t=>t.filter(t=>t.key!=e.key))},formData:d,formState:v,setFieldReports:g,t:m,setError:c,clearErrors:p,config:a,onSelect:r,userType:u,tradeCategoryValues:C,tradeTypeOptionsList:D,setTradeTypeOptionsList:N,tradeTypeMdmsData:b,tradeSubTypeOptionsList:O,setTradeSubTypeOptionsList:R,setTradeTypeMdmsData:y,setTradeCategoryValues:T,tradeMdmsData:U,isErrors:w,setIsErrors:x,previousLicenseDetails:M,setPreviousLicenseDetails:F,isLoading:H,bpaDocs:W,type:"LOW",questionList:P,setquestionList:I,documentList:L};return f?l.createElement(l.Fragment,null):l.createElement("div",null,l.createElement(l.Fragment,null,_&&_.map((e,t)=>l.createElement(In,s({key:e.key,index:t,unit:e},j)))),l.createElement(o.LinkButton,{label:m("BPA_ADD_FIELD_INSPECTION"),onClick:()=>{const e=Pn();g(t=>[...t,e])},style:{color:"#a82227",width:"fit-content"}}))},BPAInbox:Ul,StakeholderInbox:e=>{let{parentRoute:r}=e;const{t:u}=n.useTranslation(),d=Digit.ULBService.getStateId(),c={},v={moduleName:"BPAREG",applicationStatus:[],businessService:null,locality:[],assignee:"ASSIGNED_TO_ALL"},p={sortBy:"",limit:window.Digit.Utils.browser.isMobile()?50:10,offset:0,sortOrder:"DESC"},m=Digit.SessionStorage.get("STAKEHOLDER.INBOX"),E=t.useMemo(()=>m||{filterForm:v,searchForm:c,tableForm:p},[Object.values((null==m?void 0:m.filterForm)||{}),Object.values((null==m?void 0:m.searchForm)||{}),Object.values((null==m?void 0:m.tableForm)||{})]),[f,_]=t.useReducer(function(e,t){switch(t.action){case"mutateSearchForm":return Digit.SessionStorage.set("STAKEHOLDER.INBOX",{...e,searchForm:t.data}),{...e,searchForm:t.data};case"mutateFilterForm":return Digit.SessionStorage.set("STAKEHOLDER.INBOX",{...e,filterForm:t.data}),{...e,filterForm:t.data};case"mutateTableForm":return Digit.SessionStorage.set("STAKEHOLDER.INBOX",{...e,tableForm:t.data}),{...e,tableForm:t.data}}},E),{data:g,isLoading:A}=Digit.Hooks.useBoundaryLocalities(d,"revenue",{},u),{isLoading:S,data:{table:h,statuses:b,totalCount:y}={}}=Digit.Hooks.obps.useBPAInbox({tenantId:d,filters:{...f}}),C={logoIcon:l.createElement(o.CaseIcon,null),headerText:"CS_COMMON_OBPS",links:[{text:u("BPA_SEARCH_PAGE_TITLE"),link:"/digit-ui/employee/obps/search/application",businessService:"BPA",roles:["BPAREG_EMPLOYEE","BPAREG_APPROVER","BPAREG_DOC_VERIFIER","BPAREG_DOC_VERIFIER"]}]},T=t.useCallback(e=>{let{registerRef:t,searchFormState:n,searchFieldComponents:i}=e;return l.createElement(jl,{registerRef:t,searchFormState:n,searchFieldComponents:i})},[]),D=t.useCallback(e=>{let{registerRef:t,controlFilterForm:n,setFilterFormValue:i,getFilterFormValue:o}=e;return l.createElement(Wl,{statuses:b,isInboxLoading:S,registerRef:t,controlFilterForm:n,setFilterFormValue:i,filterFormState:null==f?void 0:f.filterForm,getFilterFormValue:o,localitiesForEmployeesCurrentTenant:g,loadingLocalitiesForEmployeesCurrentTenant:A})},[b,S,g,A]),N={SearchFormFields:T,onSearchFormSubmit:e=>{e.hasOwnProperty("")&&(null==e||delete e[""]),_({action:"mutateTableForm",data:{...p}}),_({action:"mutateSearchForm",data:e})},searchFormDefaultValues:null==f?void 0:f.searchForm,resetSearchFormDefaultValues:c,onSearchFormReset:e=>{e("mobileNumber",null),e("applicationNo",null),_({action:"mutateSearchForm",data:c})}},P={FilterFormFields:D,onFilterFormSubmit:e=>{e.hasOwnProperty("")&&(null==e||delete e[""]),_({action:"mutateTableForm",data:{...p}}),_({action:"mutateFilterForm",data:e})},filterFormDefaultValues:null==f?void 0:f.filterForm,resetFilterFormDefaultValues:v,onFilterFormReset:e=>{e("moduleName","BPAREG"),e("applicationStatus",""),e("locality",[]),e("assignee","ASSIGNED_TO_ALL"),_({action:"mutateFilterForm",data:v})}},I=(e=>{var o,a,r,u;let{parentRoute:d,onPageSizeChange:s,formState:c,totalCount:v,table:p,dispatch:m,onSortingByData:E}=e;const{t:f}=n.useTranslation(),_=t.useMemo(()=>[{Header:f("BPA_APPLICATION_NUMBER_LABEL"),accessor:"applicationNo",Cell:e=>{let{row:t}=e;return l.createElement("div",null,l.createElement(i.Link,{to:`${d}/stakeholder-inbox/stakeholder/${t.original.applicationId}`},l.createElement("span",{className:"link"},t.original.applicationId)))}},{Header:f("CS_APPLICATION_DETAILS_APPLICATION_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))(Fl(new Date(null===(n=i.original)||void 0===n?void 0:n.date),"dd/MM/yyyy")):""}},{Header:f("EVENTS_STATUS_LABEL"),accessor:e=>f(`WF_${null==e?void 0:e.businessService}_${null==e?void 0:e.status}`)},{Header:f("WF_INBOX_HEADER_CURRENT_OWNER"),accessor:e=>null==e?void 0:e.owner},{Header:f("ES_INBOX_SLA_DAYS_REMAINING"),accessor:e=>(e=>l.createElement("span","Active"===e||e>0?{className:"sla-cell-success"}:{className:"sla-cell-error"},e))(null==e?void 0:e.sla)}]);return{getCellProps:e=>({style:{padding:"20px 18px",fontSize:"16px"}}),disableSort:!1,autoSort:!1,manualPagination:!0,initSortI:"applicationDate",onPageSizeChange:s,currentPage:(null===(o=c.tableForm)||void 0===o?void 0:o.offset)/(null===(a=c.tableForm)||void 0===a?void 0:a.limit),onNextPage:()=>{var e,t;return m({action:"mutateTableForm",data:{...c.tableForm,offset:parseInt(null===(e=c.tableForm)||void 0===e?void 0:e.offset)+parseInt(null===(t=c.tableForm)||void 0===t?void 0:t.limit)}})},onPrevPage:()=>{var e,t;return m({action:"mutateTableForm",data:{...c.tableForm,offset:parseInt(null===(e=c.tableForm)||void 0===e?void 0:e.offset)-parseInt(null===(t=c.tableForm)||void 0===t?void 0:t.limit)}})},pageSizeLimit:null===(r=c.tableForm)||void 0===r?void 0:r.limit,onSort:E,totalRecords:v,onSearch:null==c||null===(u=c.searchForm)||void 0===u?void 0:u.message,onLastPage:()=>{var e;return m({action:"mutateTableForm",data:{...c.tableForm,offset:10*Math.ceil(v/10)-parseInt(null===(e=c.tableForm)||void 0===e?void 0:e.limit)}})},onFirstPage:()=>m({action:"mutateTableForm",data:{...c.tableForm,offset:0}}),data:p,columns:_}})({parentRoute:r,onPageSizeChange:e=>{_({action:"mutateTableForm",data:{...f.tableForm,limit:e.target.value}})},formState:f,totalCount:y,table:h,dispatch:_,onSortingByData:e=>{if(e.length>0){const[{id:t,desc:l}]=e,n=l?"DESC":"ASC";f.tableForm.sortBy===t&&f.tableForm.sortOrder===n||_({action:"mutateTableForm",data:{...f.tableForm,sortBy:t,sortOrder:l?"DESC":"ASC"}})}}}),L=(e=>{let{parentRoute:t,table:i}=e;const{t:r}=n.useTranslation();return{data:null==i?void 0:i.map(e=>{let{applicationId:t,date:l,businessService:n,status:i,owner:o,sla:a}=e;return{[r("BPA_APPLICATION_NUMBER_LABEL")]:t,[r("CS_APPLICATION_DETAILS_APPLICATION_DATE")]:Fl(new Date(l),"dd/MM/yyyy"),[r("EVENTS_STATUS_LABEL")]:r(`WF_${n}_${i}`),[r("WF_INBOX_HEADER_CURRENT_OWNER")]:o,[r("ES_INBOX_SLA_DAYS_REMAINING")]:a}}),linkPrefix:t+"/stakeholder-inbox/stakeholder/",serviceRequestIdKey:r("BPA_APPLICATION_NUMBER_LABEL"),MobileSortFormValues:()=>{const e=[{code:"DESC",i18nKey:"ES_COMMON_SORT_BY_DESC"},{code:"ASC",i18nKey:"ES_COMMON_SORT_BY_ASC"}],{control:t}=a.useFormContext();return l.createElement(o.SearchField,null,l.createElement(a.Controller,{name:"sortOrder",control:t,render:t=>{let{onChange:n,value:i}=t;return l.createElement(o.RadioButtons,{onSelect:e=>{n(e.code)},selectedOption:e.filter(e=>e.code===i)[0],optionsKey:"i18nKey",name:"sortOrder",options:e})}}))}}})({parentRoute:r,table:h}),B={onMobileSortOrderData:e=>{const{sortOrder:t}=e;_({action:"mutateTableForm",data:{...f.tableForm,sortOrder:t}})},sortFormDefaultValues:null==f?void 0:f.tableForm,onSortFormReset:e=>{e("sortOrder","DESC"),_({action:"mutateTableForm",data:p})}};return l.createElement(t.Fragment,null,l.createElement(o.Header,null,u("ES_COMMON_INBOX"),y?l.createElement("p",{className:"inbox-count"},y):null),Digit.Utils.browser.isMobile()&&l.createElement("div",{style:{marginLeft:"12px"}},l.createElement(i.Link,{to:window.location.href.includes("/citizen")?"/digit-ui/citizen/obps/search/application":"/digit-ui/employee/obps/search/application"},l.createElement("span",{className:"link"},u("BPA_SEARCH_PAGE_TITLE")))),l.createElement(o.InboxComposer,s({isInboxLoading:S,PropsForInboxLinks:C},N,P,B,{propsForInboxTable:I,propsForInboxMobileCards:L,formState:f})))},StakeholderCheckPage:e=>{var t,a,r,u,d,s,c,v,p,m,E,f,_,g,A,S,h,b,y,C,T,D,N,P,I,L,B,O,R,w,x,M,F,k,U,H,W,j,$,Y,z,G,K,V,q,X,J;let{onSubmit:Z,value:Q}=e;const{t:ee}=n.useTranslation();i.useHistory(),i.useRouteMatch();let te=Digit.UserService.getUser();const le=te&&null!=te&&te.info&&null!=te&&null!==(t=te.info)&&void 0!==t&&t.permanentCity?null==te||null===(a=te.info)||void 0===a?void 0:a.permanentCity:Digit.ULBService.getCurrentTenantId(),ne=Digit.ULBService.getStateId();let ie=window.location.href.includes("/openlink/");const oe=window.Digit.Utils.browser.isMobile();Digit.Utils.browser.isMobile(),ie&&(window.onunload=function(){sessionStorage.removeItem("Digit.BUILDING_PERMIT")});const{result:ae,formData:re,documents:ue}=Q;let de=null==Q||null===(r=Q.result)||void 0===r?void 0:r.Licenses[0].applicationNumber;const se={consumerCode:de},{data:ce}=Digit.Hooks.obps.useBPAREGgetbill({businessService:"BPAREG",...se,tenantId:ne||le.split(".")[0]},{enabled:!!de,retry:!1});return l.createElement(l.Fragment,null,l.createElement("div",{className:ie?"OpenlinkContainer":""},l.createElement("div",null,ie&&l.createElement(o.BackButton,{style:{border:"none"}},ee("CS_COMMON_BACK")),l.createElement(Yl,{currentStep:4,flow:"STAKEHOLDER"}),l.createElement(o.Header,{styles:{fontSize:"32px",marginLeft:"10px"}},ee("BPA_STEPPER_SUMMARY_HEADER")),l.createElement(o.Card,{style:{paddingRight:"16px"}},l.createElement(o.StatusTable,null,l.createElement(o.Row,{className:"border-none",label:ee("BPA_APPLICATION_NUMBER_LABEL"),text:null!=ae&&null!==(u=ae.Licenses)&&void 0!==u&&null!==(d=u[0])&&void 0!==d&&d.applicationNumber?null==ae||null===(s=ae.Licenses)||void 0===s||null===(c=s[0])||void 0===c?void 0:c.applicationNumber:""}))),l.createElement(o.Card,{style:{paddingRight:"16px"}},l.createElement(o.StatusTable,null,l.createElement(o.CardHeader,{styles:{fontSize:"24px"}},ee("BPA_LICENSE_TYPE")),l.createElement(o.Row,{className:"border-none",label:ee("BPA_QUALIFICATION_TYPE"),text:ee(null==re||null===(v=re.LicneseType)||void 0===v||null===(p=v.qualificationType)||void 0===p?void 0:p.name)}),l.createElement(o.Row,{className:"border-none",label:ee("BPA_LICENSE_TYPE"),text:ee(null==re||null===(m=re.LicneseType)||void 0===m||null===(E=m.LicenseType)||void 0===E?void 0:E.i18nKey)}),(null==re||null===(f=re.LicneseType)||void 0===f||null===(_=f.LicenseType)||void 0===_?void 0:_.i18nKey.includes("ARCHITECT"))&&l.createElement(o.Row,{className:"border-none",label:ee("BPA_COUNCIL_NUMBER"),text:null==re||null===(g=re.LicneseType)||void 0===g?void 0:g.ArchitectNo}),(null==re||null===(A=re.LicneseType)||void 0===A||null===(S=A.LicenseType)||void 0===S?void 0:S.i18nKey.includes("TOWNPLANNER"))&&l.createElement(o.Row,{className:"border-none",label:ee("BPA_ASSOCIATE_OR_FELLOW_NUMBER"),text:null==re||null===(h=re.LicneseType)||void 0===h?void 0:h.ArchitectNo}))),l.createElement(o.Card,{style:{paddingRight:"16px"}},l.createElement(o.StatusTable,null,l.createElement(o.CardHeader,{styles:{fontSize:"24px"}},ee("BPA_LICENSE_DET_CAPTION")),l.createElement(o.Row,{className:"border-none",label:ee("BPA_APPLICANT_NAME_LABEL"),text:ee(null==re||null===(b=re.LicneseDetails)||void 0===b?void 0:b.name)}),l.createElement(o.Row,{className:"border-none",label:ee("BPA_APPLICANT_GENDER_LABEL"),text:ee(null==re||null===(y=re.LicneseDetails)||void 0===y?void 0:y.gender.i18nKey)}),l.createElement(o.Row,{className:"border-none",label:ee("BPA_OWNER_MOBILE_NO_LABEL"),text:null==re||null===(C=re.LicneseDetails)||void 0===C?void 0:C.mobileNumber}),l.createElement(o.Row,{className:"border-none",label:ee("BPA_APPLICANT_EMAIL_LABEL"),text:(null==re||null===(T=re.LicneseDetails)||void 0===T?void 0:T.email)||ee("CS_NA")}),l.createElement(o.Row,{className:"border-none",label:ee("BPA_APPLICANT_DOB_LABEL"),text:(null==re||null===(D=re.LicneseDetails)||void 0===D?void 0:D.dateOfBirth)||ee("CS_NA")}),l.createElement(o.Row,{className:"border-none",label:ee("BPA_DETAILS_PIN_LABEL"),text:(null==re||null===(N=re.LicneseDetails)||void 0===N?void 0:N.Pincode)||ee("CS_NA")}))),l.createElement(o.Card,{style:{paddingRight:"16px"}},l.createElement(o.StatusTable,null,l.createElement("div",{style:{marginRight:"24px"}},l.createElement(o.CardHeader,{styles:{fontSize:"24px"}},ee("BPA_PERMANANT_ADDRESS_LABEL"))),l.createElement(o.CardText,{style:oe?{color:"black"}:{color:"black",fontSize:"16px"}},ee(null==re||null===(P=re.LicneseDetails)||void 0===P?void 0:P.PermanentAddress)),null!=re&&null!==(I=re.LicneseType)&&void 0!==I&&null!==(L=I.LicenseType)&&void 0!==L&&L.i18nKey.includes("ARCHITECT")?l.createElement(o.Row,{className:"border-none",label:ee("BPA_SELECTED_ULB"),text:ee("BPA_ULB_SELECTED_MESSAGE ")}):l.createElement(o.Row,{className:"border-none",label:ee("BPA_SELECTED_ULB"),text:null==re||null===(B=re.LicneseDetails)||void 0===B||null===(O=B.Ulb)||void 0===O?void 0:O.map(e=>e.ulbname).join(", ")}))),l.createElement(o.Card,{style:{paddingRight:"16px"}},l.createElement(o.StatusTable,null,l.createElement("div",{style:{marginRight:"24px"}},l.createElement(o.CardHeader,{styles:{fontSize:"24px"}},ee("BPA_COMMUNICATION_ADDRESS_HEADER_DETAILS"))),l.createElement(o.CardText,{style:oe?{color:"black"}:{color:"black",fontSize:"16px"}},ee(null==Q?void 0:Q.Correspondenceaddress)))),l.createElement(o.Card,{style:{paddingRight:"16px"}},l.createElement(o.StatusTable,null,l.createElement(o.CardHeader,{styles:{fontSize:"24px"}},ee("BPA_DOC_DETAILS_SUMMARY")),null==ue?void 0:ue.documents.map((e,t)=>{var n,i;return l.createElement("div",{key:t},l.createElement(o.CardSectionHeader,{styles:{fontSize:"18px"}},ee("BPAREG_HEADER_"+(null==e||null===(n=e.documentType)||void 0===n?void 0:n.replace(".","_")))),null!=e&&e.info?l.createElement("div",{style:{fontSize:"12px",color:"#505A5F",fontWeight:400,lineHeight:"15px"}},""+ee(null==e?void 0:e.info)):null,l.createElement(o.StatusTable,null,l.createElement(sn,{value:Q,Code:null==e?void 0:e.documentType,index:t,isNOC:!1,svgStyles:{},isStakeHolder:!0}),(null==ue||null===(i=ue.documents)||void 0===i?void 0:i.length)!=t+1?l.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",height:"2px",marginTop:"20px",marginBottom:"20px"}}):null))}))),l.createElement(o.Card,{style:{paddingRight:"16px"}},l.createElement(o.CardHeader,{styles:{fontSize:"24px"}},ee("BPA_SUMMARY_FEE_EST")),l.createElement(o.StatusTable,null,null==ce||null===(R=ce.billResponse)||void 0===R||null===(w=R.Bill[0])||void 0===w||null===(x=w.billDetails[0])||void 0===x?void 0:x.billAccountDetails.map((e,t)=>l.createElement("div",{key:t},l.createElement(o.Row,{className:"border-none",label:ee(""+e.taxHeadCode),text:"₹ "+(null==e?void 0:e.amount)||ee("CS_NA")}))),l.createElement(o.Row,{className:"border-none",label:ee("BPA_COMMON_TOTAL_AMT"),text:"₹ "+(null==ce||null===(M=ce.billResponse)||void 0===M||null===(F=M.Bill)||void 0===F||null===(k=F[0])||void 0===k||null===(U=k.billDetails[0])||void 0===U?void 0:U.amount)||ee("CS_NA")})),l.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",height:"2px",marginTop:"20px",marginBottom:"20px"}}),l.createElement(o.CardHeader,{styles:{fontSize:"24px"}},ee("BPA_COMMON_TOTAL_AMT")),l.createElement(o.CardHeader,null,"₹ ",null==ce||null===(H=ce.billResponse)||void 0===H||null===(W=H.Bill)||void 0===W||null===(j=W[0])||void 0===j||null===($=j.billDetails[0])||void 0===$?void 0:$.amount),l.createElement(o.SubmitBar,{label:ee("CS_COMMON_SUBMIT"),onSubmit:Z,disabled:"number"!=typeof(null==ce||null===(Y=ce.billResponse)||void 0===Y||null===(z=Y.Bill)||void 0===z||null===(G=z[0])||void 0===G||null===(K=G.billDetails[0])||void 0===K?void 0:K.amount)||(null==ce||null===(V=ce.billResponse)||void 0===V||null===(q=V.Bill)||void 0===q||null===(X=q[0])||void 0===X||null===(J=X.billDetails[0])||void 0===J?void 0:J.amount)<0})))))},BPACheckPage:e=>{var a,r,u,d,s,v,p,m,E,f,_,g,A,S,h,b,y,C,T,D,N,P,I,L,B,O,R,w,x,M,F,k,U,H,W,j,$,Y,z,G,K,V,q,X,J,Z,Q,ee,te,le,ne,ie,oe,ae,re,ue,de,se,ce,ve,pe,me,Ee,fe,_e,ge,Ae,Se,he,be,ye,Ce,Te,De,Ne,Pe,Ie,Le,Be,Oe,Re,we,xe,Me,Fe;let{onSubmit:ke,value:Ue}=e;const[He,We]=t.useState(),[je,$e]=t.useState(),[Ye,ze]=t.useState(),[Ge,Ke]=t.useState(),[Ve,qe]=t.useState(),[Xe,Je]=t.useState(),[Ze,Qe]=t.useState(),{t:et}=n.useTranslation(),tt=(i.useHistory(),i.useRouteMatch(),Digit.UserService.getUser()),lt=Digit.ULBService.getStateId(),nt=(null==tt||null===(a=tt.info)||void 0===a?void 0:a.permanentCity)||(null==Ue?void 0:Ue.tenantId)||Digit.ULBService.getCurrentTenantId(),{data:it}=Digit.Hooks.obps.useMDMS(lt,"BPA",["GaushalaFees","MalbaCharges","LabourCess"]),[ot,at]=t.useState(),[rt,ut]=t.useState(),[dt,st]=t.useState([]),[ct,vt]=t.useState(),[pt,mt]=t.useState(""),[Et,_t]=t.useState(null),[gt,At]=t.useState({});let St;"BPA_LOW"===Ue.businessService?St="BPA.LOW_RISK_PERMIT_FEE":"BPA"===Ue.businessService&&(St="BPA.NC_APP_FEE");const{data:ht,address:bt,owners:yt,nocDocuments:Ct,documents:Tt,additionalDetails:Dt,subOccupancy:Nt,PrevStateDocuments:Pt,PrevStateNocDocuments:Lt,applicationNo:Bt}=Ue,Ot=window.location.href.includes("editApplication"),[Rt,wt]=t.useState(!1),xt=!!sessionStorage.getItem("ArchitectConsentdocFilestoreid"),Mt=null==tt||null===(r=tt.info)||void 0===r?void 0:r.mobileNumber,[Ft,Ut]=t.useState(!1),[Ht,Wt]=t.useState(!1),[jt,$t]=t.useState(Mt||""),[Yt,zt]=t.useState(!1),[Gt,Kt]=t.useState(""),[Vt,qt]=t.useState(!1),[Xt,Jt]=t.useState(""),[Zt,Qt]=t.useState(null),el={username:jt,password:Gt,tenantId:null==tt||null===(u=tt.info)||void 0===u?void 0:u.tenantId,userType:null==tt||null===(d=tt.info)||void 0===d?void 0:d.type},tl=10===jt.length&&/^[0-9]+$/.test(jt);t.useEffect(()=>{!function(){try{_t(null);const e=function(){if(ct&&null!=ct&&ct.type){const e=function(e,t,l){if(null!==(e=".pdf".split(","))&&void 0!==e&&e.includes("."+(null==ct||null===(t=ct.type)||void 0===t||null===(l=t.split("/"))||void 0===l?void 0:l.pop()))){const e=function(){if(ct.size>=2e6)_t(et("PT_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=c(function(){return Promise.resolve(Digit.UploadServices.Filestorage("property-upload",ct,Digit.ULBService.getStateId())).then(function(e){var t,l,n,i;(null==e||null===(t=e.data)||void 0===t||null===(l=t.files)||void 0===l?void 0:l.length)>0?st([...dt,{fileStoreId:null==e||null===(n=e.data)||void 0===n||null===(i=n.files[0])||void 0===i?void 0:i.fileStoreId,time:new Date}]):_t(et("PT_FILE_UPLOAD_ERROR"))})},function(){});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}else _t(et("PT_UPLOAD_FORMAT_NOT_SUPPORTED"))}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[ct]),t.useEffect(()=>{sessionStorage.setItem("uploadedFileLess",JSON.stringify(dt))},[dt]),t.useEffect(()=>{var e,t,l,n,i,o,a,r,u,d,s,c,v,p,m,E,f,_,g,A,S,h,b,y,C,T;if(null!=Ue&&null!==(e=Ue.additionalDetails)&&void 0!==e&&null!==(t=e.lessAdjustmentFeeFiles)&&void 0!==t&&t.length){var D;const e=null==Ue||null===(D=Ue.additionalDetails)||void 0===D?void 0:D.lessAdjustmentFeeFiles.map((e,t)=>{var l,n,i,o,a,r;return t===(null==Ue||null===(l=Ue.additionalDetails)||void 0===l||null===(n=l.lessAdjustmentFeeFiles)||void 0===n?void 0:n.length)-1?null==Ue||null===(i=Ue.additionalDetails)||void 0===i||null===(o=i.lessAdjustmentFeeFiles[(null==Ue||null===(a=Ue.additionalDetails)||void 0===a||null===(r=a.lessAdjustmentFeeFiles)||void 0===r?void 0:r.length)-1])||void 0===o?void 0:o.fileStoreId:null});Digit.UploadServices.Filefetch(e,lt).then(e=>At(null==e?void 0:e.data))}Ot&&(We(null==Ue||null===(c=Ue.additionalDetails)||void 0===c||null===(v=c.selfCertificationCharges)||void 0===v?void 0:v.BPA_DEVELOPMENT_CHARGES),sessionStorage.setItem("development",null==Ue||null===(p=Ue.additionalDetails)||void 0===p||null===(m=p.selfCertificationCharges)||void 0===m?void 0:m.BPA_DEVELOPMENT_CHARGES),$e(null==Ue||null===(E=Ue.additionalDetails)||void 0===E||null===(f=E.selfCertificationCharges)||void 0===f?void 0:f.BPA_OTHER_CHARGES),sessionStorage.setItem("otherCharges",null==Ue||null===(_=Ue.additionalDetails)||void 0===_||null===(g=_.selfCertificationCharges)||void 0===g?void 0:g.BPA_OTHER_CHARGES),ze(null==Ue||null===(A=Ue.additionalDetails)||void 0===A||null===(S=A.selfCertificationCharges)||void 0===S?void 0:S.BPA_LESS_ADJUSMENT_PLOT),sessionStorage.setItem("lessAdjusment",null==Ue||null===(h=Ue.additionalDetails)||void 0===h||null===(b=h.selfCertificationCharges)||void 0===b?void 0:b.BPA_LESS_ADJUSMENT_PLOT),at(null==Ue||null===(y=Ue.additionalDetails)||void 0===y?void 0:y.otherFeesDiscription),sessionStorage.setItem("otherChargesDisc",null==Ue||null===(C=Ue.additionalDetails)||void 0===C?void 0:C.otherFeesDiscription),st(null==Ue||null===(T=Ue.additionalDetails)||void 0===T?void 0:T.lessAdjustmentFeeFiles));let N=parseInt(sessionStorage.getItem("plotArea"))||(null==rl||null===(l=rl.planDetail)||void 0===l||null===(n=l.planInformation)||void 0===n?void 0:n.plotArea)||(null==Ue||null===(i=Ue.additionalDetails)||void 0===i?void 0:i.area);const P=Math.round(10.7639*N>909?(null==it||null===(o=it.BPA)||void 0===o?void 0:o.LabourCess[1].rate)*(10.7639*N):0),I=Math.round(null==it||null===(a=it.BPA)||void 0===a?void 0:a.GaushalaFees[0].rate),L=Math.round(10.7639*N<=500?null==it||null===(r=it.BPA)||void 0===r?void 0:r.MalbaCharges[0].rate:10.7639*N>500&&10.7639*N<=1e3?null==it||null===(u=it.BPA)||void 0===u||null===(d=u.MalbaCharges)||void 0===d?void 0:d[1].rate:(null==it||null===(s=it.BPA)||void 0===s?void 0:s.MalbaCharges[2].rate)||500);sessionStorage.setItem("Malbafees",L),sessionStorage.setItem("WaterCharges",L/2),sessionStorage.setItem("GaushalaFees",I),sessionStorage.setItem("LabourCess",P),qe(I),Ke(P),Je(L),Qe(L/2)},[it,null==Ue?void 0:Ue.additionalDetails]);let ll=[];null==Pt||Pt.map(e=>{ll.push({...e,module:"OBPS"})}),null==Tt||null===(s=Tt.documents)||void 0===s||s.map(e=>{ll.push({...e,module:"OBPS"})}),null==Lt||Lt.map(e=>{ll.push({...e,module:"NOC"})}),null==Ct||null===(v=Ct.nocDocuments)||void 0===v||v.map(e=>{ll.push({...e,module:"NOC"})});const{data:nl,isLoading:il}=Digit.Hooks.useDocumentSearch(ll,{enabled:(null==ll?void 0:ll.length)>0});let ol=[];var al;(null==nl||null===(p=nl.pdfFiles)||void 0===p?void 0:p.length)>0&&(null==nl||null===(al=nl.pdfFiles)||void 0===al||al.map(e=>{"OBPS"==(null==e?void 0:e.module)&&ol.push(e)}));const{data:rl,isLoading:ul}=Digit.Hooks.obps.useScrutinyDetails(nt,null==Ue||null===(m=Ue.data)||void 0===m?void 0:m.scrutinyNumber,{enabled:!(null==Ue||null===(E=Ue.data)||void 0===E||!E.scrutinyNumber)});let dl=null==Ue?void 0:Ue.applicationNo;const sl={consumerCode:dl},{data:cl}=Digit.Hooks.useFetchBillsForBuissnessService({businessService:St,...sl,tenantId:nt},{enabled:!!dl,retry:!1}),vl=window.location.href.includes("sendbacktocitizen");let pl=`/digit-ui/citizen/obps/bpa/${null==Dt?void 0:Dt.applicationType.toLowerCase()}/${null==Dt?void 0:Dt.serviceType.toLowerCase()}`;Ot&&(pl=`/digit-ui/citizen/obps/editApplication/bpa/${null==Ue?void 0:Ue.tenantId}/${null==Ue?void 0:Ue.applicationNo}`),vl&&(pl=`/digit-ui/citizen/obps/sendbacktocitizen/bpa/${null==Ue?void 0:Ue.tenantId}/${null==Ue?void 0:Ue.applicationNo}`);const ml=[{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"},{name:"BPA_TABLE_COL_CARPETAREA",id:"CarpetArea"}],El=e=>{const t=e;return(e,l,n)=>e[t]},fl=t.useMemo(()=>ml.map(e=>({Header:et(""+e.name),accessor:El(e.id),id:e.id})));function _l(e){var t;let l=[];return null==e||null===(t=e.building)||void 0===t||t.floors.map(e=>{var t,n,i,o,a,r,u,d;l.push({Floor:et("BPA_FLOOR_NAME_"+e.number),Level:e.number,Occupancy:et(""+(null===(t=e.occupancies)||void 0===t||null===(n=t[0])||void 0===n?void 0:n.type)),BuildupArea:null===(i=e.occupancies)||void 0===i||null===(o=i[0])||void 0===o?void 0:o.builtUpArea,FloorArea:(null===(a=e.occupancies)||void 0===a||null===(r=a[0])||void 0===r?void 0:r.floorArea)||0,CarpetArea:(null===(u=e.occupancies)||void 0===u||null===(d=u[0])||void 0===d?void 0:d.CarpetArea)||0,key:et("BPA_FLOOR_NAME_"+e.number)})}),l}function gl(e){location.href=e}function Al(e){let t=[];return Nt&&Nt["Block_"+(e+1)]&&Nt["Block_"+(e+1)].map(e=>{var l;t.push(""+et(ft(null==e||null===(l=e.i18nKey)||void 0===l?void 0:l.toUpperCase(),"-","_")))}),null!=t&&t.length?t.join(", "):"NA"}return il||ul?l.createElement(o.Loader,null):l.createElement(l.Fragment,null,l.createElement(Yl,{currentStep:4}),l.createElement(o.Header,{styles:{marginLeft:"10px"}},et("BPA_STEPPER_SUMMARY_HEADER")),l.createElement(o.Card,{style:{paddingRight:"16px"}},l.createElement(o.StatusTable,null,l.createElement(o.Row,{className:"border-none",label:et("BPA_APPLICATION_NUMBER_LABEL"),text:Bt||""}))),l.createElement(o.Card,{style:{paddingRight:"16px"}},l.createElement(o.CardHeader,null,et("BPA_BASIC_DETAILS_TITLE")),l.createElement(o.StatusTable,null,l.createElement(o.Row,{className:"border-none",label:et("BPA_BASIC_DETAILS_APP_DATE_LABEL"),text:It(Number(null==ht?void 0:ht.applicationDate))}),l.createElement(o.Row,{className:"border-none",label:et("BPA_BASIC_DETAILS_APPLICATION_TYPE_LABEL"),text:et("WF_BPA_"+(null==ht?void 0:ht.applicationType))}),l.createElement(o.Row,{className:"border-none",label:et("BPA_BASIC_DETAILS_SERVICE_TYPE_LABEL"),text:et(null==ht?void 0:ht.serviceType)}),l.createElement(o.Row,{className:"border-none",label:et("BPA_BASIC_DETAILS_OCCUPANCY_LABEL"),text:null==ht?void 0:ht.occupancyType}),l.createElement(o.Row,{className:"border-none",label:et("BPA_BASIC_DETAILS_RISK_TYPE_LABEL"),text:et("WF_BPA_"+(null==ht?void 0:ht.riskType))}))),l.createElement(o.Card,{style:{paddingRight:"16px"}},l.createElement(o.StatusTable,null,l.createElement(o.CardHeader,null,et("BPA_PLOT_DETAILS_TITLE")),l.createElement(o.LinkButton,{label:l.createElement(o.EditIcon,{style:{marginTop:"-10px",float:"right",position:"relative",bottom:"32px"}}),style:{width:"100px",display:"inline"},onClick:()=>gl(pl+"/plot-details")}),l.createElement(o.Row,{className:"border-none",textStyle:{paddingLeft:"12px"},label:et("BPA_BOUNDARY_PLOT_AREA_LABEL"),text:null!=rl&&null!==(f=rl.planDetail)&&void 0!==f&&null!==(_=f.planInformation)&&void 0!==_&&_.plotArea?`${null==rl||null===(g=rl.planDetail)||void 0===g||null===(A=g.planInformation)||void 0===A?void 0:A.plotArea} ${et("BPA_SQ_MTRS_LABEL")}`:et("CS_NA")}),l.createElement(o.Row,{className:"border-none",label:et("BPA_PLOT_NUMBER_LABEL"),text:(null==rl||null===(S=rl.planDetail)||void 0===S||null===(h=S.planInformation)||void 0===h?void 0:h.plotNo)||et("CS_NA")}),l.createElement(o.Row,{className:"border-none",label:et("BPA_KHATHA_NUMBER_LABEL"),text:(null==rl||null===(b=rl.planDetail)||void 0===b||null===(y=b.planInformation)||void 0===y?void 0:y.khataNo)||et("CS_NA")}),l.createElement(o.Row,{className:"border-none",label:et("BPA_BOUNDARY_LAND_REG_DETAIL_LABEL"),text:(null==ht?void 0:ht.registrationDetails)||et("CS_NA")}),l.createElement(o.Row,{className:"border-none",label:et("BPA_BOUNDARY_WALL_LENGTH_LABEL"),text:(null==ht?void 0:ht.boundaryWallLength)||et("CS_NA")}),l.createElement(o.Row,{className:"border-none",label:et("BPA_KHASRA_NUMBER_LABEL"),text:(null==ht?void 0:ht.khasraNumber)||(null==Ue||null===(C=Ue.additionalDetails)||void 0===C?void 0:C.khasraNumber)||et("CS_NA")}),l.createElement(o.Row,{className:"border-none",label:et("BPA_WARD_NUMBER_LABEL"),text:(null==ht?void 0:ht.wardnumber)||(null==Ue||null===(T=Ue.additionalDetails)||void 0===T?void 0:T.wardnumber)||et("CS_NA")}))),l.createElement(o.Card,{style:{paddingRight:"16px"}},l.createElement(o.CardHeader,null,et("BPA_STEPPER_SCRUTINY_DETAILS_HEADER")),l.createElement(o.CardSubHeader,{style:{fontSize:"20px"}},et("BPA_EDCR_DETAILS")),l.createElement(o.StatusTable,{style:{border:"none"}},l.createElement(o.Row,{className:"border-none",label:et("BPA_EDCR_NO_LABEL"),text:null==ht||null===(D=ht.scrutinyNumber)||void 0===D?void 0:D.edcrNumber}),l.createElement(o.CardSubHeader,null,et("BPA_UPLOADED_PLAN_DIAGRAM")),l.createElement(o.LinkButton,{label:l.createElement(o.PDFSvg,null),onClick:()=>gl(null==rl?void 0:rl.updatedDxfFile)}),l.createElement("p",{style:{marginTop:"8px",marginBottom:"20px",textAlign:"Left",fontSize:"16px",lineHeight:"19px",color:"#505A5F",fontWeight:"400"}},et("Uploaded Plan.pdf")),l.createElement(o.CardSubHeader,null,et("BPA_SCRUNTINY_REPORT_OUTPUT")),l.createElement(o.LinkButton,{label:l.createElement(o.PDFSvg,null),onClick:()=>gl(null==rl?void 0:rl.planReport)}),l.createElement("p",{style:{marginTop:"8px",marginBottom:"20px",textAlign:"Left",fontSize:"16px",lineHeight:"19px",color:"#505A5F",fontWeight:"400"}},et("BPA_SCRUTINY_REPORT_PDF"))),l.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",height:"2px",marginTop:"20px",marginBottom:"20px"}}),l.createElement(o.CardSubHeader,{style:{fontSize:"20px"}},et("BPA_BUILDING_EXTRACT_HEADER")),l.createElement(o.StatusTable,null,l.createElement(o.Row,{className:"border-none",label:et("BPA_TOTAL_BUILT_UP_AREA_HEADER"),text:`${null==rl||null===(N=rl.planDetail)||void 0===N||null===(P=N.blocks)||void 0===P||null===(I=P[0])||void 0===I||null===(L=I.building)||void 0===L?void 0:L.totalBuitUpArea} ${et("BPA_SQ_MTRS_LABEL")}`}),l.createElement(o.Row,{className:"border-none",label:et("BPA_SCRUTINY_DETAILS_NUMBER_OF_FLOORS_LABEL"),text:null==rl||null===(B=rl.planDetail)||void 0===B||null===(O=B.blocks)||void 0===O||null===(R=O[0])||void 0===R||null===(w=R.building)||void 0===w?void 0:w.totalFloors}),l.createElement(o.Row,{className:"border-none",label:et("BPA_HEIGHT_FROM_GROUND_LEVEL_FROM_MUMTY"),text:`${null==rl||null===(x=rl.planDetail)||void 0===x||null===(M=x.blocks)||void 0===M||null===(F=M[0])||void 0===F||null===(k=F.building)||void 0===k?void 0:k.declaredBuildingHeight} ${et("BPA_MTRS_LABEL")}`})),l.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",height:"2px",marginTop:"20px",marginBottom:"20px"}}),l.createElement(o.CardSubHeader,{style:{fontSize:"20px"}},et("BPA_OCC_SUBOCC_HEADER")),null==rl||null===(U=rl.planDetail)||void 0===U?void 0:U.blocks.map((e,t)=>{var n,i;return l.createElement("div",{key:t,style:(null==rl||null===(n=rl.planDetail)||void 0===n||null===(i=n.blocks)||void 0===i?void 0:i.length)>1?{marginTop:"19px",background:"#FAFAFA",border:"1px solid #D6D5D4",borderRadius:"4px",padding:"8px",lineHeight:"19px",maxWidth:"960px",minWidth:"280px"}:{}},l.createElement(o.CardSubHeader,{style:{marginTop:"15px",fontSize:"18px"}},et("BPA_BLOCK_SUBHEADER")," ",t+1),l.createElement(o.StatusTable,null,l.createElement(o.Row,{className:"border-none",textStyle:{wordBreak:"break-word"},label:et("BPA_SUB_OCCUPANCY_LABEL"),text:""===Al(t)?et("CS_NA"):Al(t)})),l.createElement("div",{style:{overflow:"scroll"}},l.createElement(o.Table,{className:"customTable table-fixed-first-column table-border-style",t:et,disableSort:!1,autoSort:!0,manualPagination:!1,isPaginationRequired:!1,initSortId:"S N ",data:_l(e),columns:fl,getCellProps:e=>({style:{}})})))}),l.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",height:"2px",marginTop:"20px",marginBottom:"20px"}}),l.createElement(o.CardSubHeader,{style:{fontSize:"20px"}},et("BPA_APP_DETAILS_DEMOLITION_DETAILS_LABEL")),l.createElement(o.StatusTable,{style:{border:"none"}},l.createElement(o.Row,{className:"border-none",label:et("BPA_APPLICATION_DEMOLITION_AREA_LABEL"),text:null!=rl&&null!==(H=rl.planDetail)&&void 0!==H&&null!==(W=H.planInformation)&&void 0!==W&&W.demolitionArea?`${null==rl||null===(j=rl.planDetail)||void 0===j||null===($=j.planInformation)||void 0===$?void 0:$.demolitionArea} ${et("BPA_SQ_MTRS_LABEL")}`:et("CS_NA")}))),l.createElement(o.Card,{style:{paddingRight:"16px"}},l.createElement(o.StatusTable,null,l.createElement(o.CardHeader,null,et("BPA_NEW_TRADE_DETAILS_HEADER_DETAILS")),l.createElement(o.LinkButton,{label:l.createElement(o.EditIcon,{style:{marginTop:"-10px",float:"right",position:"relative",bottom:"32px"}}),style:{width:"100px",display:"inline"},onClick:()=>gl(pl+"/location")}),l.createElement(o.Row,{className:"border-none",textStyle:{paddingLeft:"12px"},label:et("BPA_DETAILS_PIN_LABEL"),text:(null==bt?void 0:bt.pincode)||et("CS_NA")}),l.createElement(o.Row,{className:"border-none",label:et("BPA_CITY_LABEL"),text:(null==bt||null===(Y=bt.city)||void 0===Y?void 0:Y.name)||et("CS_NA")}),l.createElement(o.Row,{className:"border-none",label:et("BPA_LOC_MOHALLA_LABEL"),text:(null==bt||null===(z=bt.locality)||void 0===z?void 0:z.name)||et("CS_NA")}),l.createElement(o.Row,{className:"border-none",label:et("BPA_DETAILS_SRT_NAME_LABEL"),text:(null==bt?void 0:bt.street)||et("CS_NA")}),l.createElement(o.Row,{className:"border-none",label:et("ES_NEW_APPLICATION_LOCATION_LANDMARK"),text:(null==bt?void 0:bt.landmark)||et("CS_NA")}))),l.createElement(o.Card,{style:{paddingRight:"16px"}},l.createElement(o.StatusTable,null,l.createElement(o.CardHeader,null,et("BPA_APPLICANT_DETAILS_HEADER")),l.createElement(o.LinkButton,{label:l.createElement(o.EditIcon,{style:{marginTop:"-10px",float:"right",position:"relative",bottom:"32px"}}),style:{width:"100px",display:"inline"},onClick:()=>gl(pl+"/owner-details")}),(null==yt?void 0:yt.owners)&&(null==yt?void 0:yt.owners.map((e,t)=>{var n,i;return l.createElement("div",{key:t,style:(null==yt||null===(n=yt.owners)||void 0===n?void 0:n.length)>1?{marginTop:"19px",background:"#FAFAFA",border:"1px solid #D6D5D4",borderRadius:"4px",padding:"8px",lineHeight:"19px",maxWidth:"960px",minWidth:"280px"}:{}},yt.owners.length>1&&l.createElement(o.CardSubHeader,null,et("COMMON_OWNER")," ",t+1),l.createElement(o.StatusTable,null,l.createElement(o.Row,{className:"border-none",textStyle:0==t&&1==yt.owners.length?{paddingLeft:"12px"}:{},label:et("CORE_COMMON_NAME"),text:null==e?void 0:e.name}),l.createElement(o.Row,{className:"border-none",label:et("BPA_APPLICANT_GENDER_LABEL"),text:et(null==e||null===(i=e.gender)||void 0===i?void 0:i.i18nKey)}),l.createElement(o.Row,{className:"border-none",label:et("CORE_COMMON_MOBILE_NUMBER"),text:null==e?void 0:e.mobileNumber}),l.createElement(o.Row,{className:"border-none",label:et("CORE_COMMON_EMAIL_ID"),text:(null==e?void 0:e.emailId)||et("CS_NA")}),l.createElement(o.Row,{className:"border-none",label:et("BPA_IS_PRIMARY_OWNER_LABEL"),text:""+(null==e?void 0:e.isPrimaryOwner)})))})))),l.createElement(o.Card,{style:{paddingRight:"16px"}},l.createElement(o.StatusTable,null,l.createElement(o.CardHeader,null,et("BPA_ADDITIONAL_BUILDING_DETAILS")),l.createElement(o.Row,{className:"border-none",label:et("BPA_APPROVED_COLONY_LABEL"),text:(null==yt||null===(G=yt.approvedColony)||void 0===G?void 0:G.i18nKey)||(null==Ue||null===(K=Ue.additionalDetails)||void 0===K?void 0:K.approvedColony)||et("CS_NA")}),l.createElement(o.Row,{className:"border-none",label:et("BPA_ULB_TYPE_LABEL"),text:(null==yt||null===(V=yt.Ulblisttype)||void 0===V?void 0:V.value)||(null==Ue||null===(q=Ue.additionalDetails)||void 0===q?void 0:q.Ulblisttype)||et("CS_NA")}),l.createElement(o.Row,{className:"border-none",label:et("BPA_ULB_NAME_LABEL"),text:(null==yt||null===(X=yt.UlbName)||void 0===X?void 0:X.code)||(null==Ue||null===(J=Ue.additionalDetails)||void 0===J?void 0:J.UlbName)||et("CS_NA")}),l.createElement(o.Row,{className:"border-none",label:et("BPA_DISTRICT_LABEL"),text:(null==yt||null===(Z=yt.District)||void 0===Z?void 0:Z.code)||(null==Ue||null===(Q=Ue.additionalDetails)||void 0===Q?void 0:Q.District)||et("CS_NA")}),l.createElement(o.Row,{className:"border-none",label:et("BPA_BUILDING_STATUS_LABEL"),text:(null==yt||null===(ee=yt.buildingStatus)||void 0===ee?void 0:ee.code)||(null==Ue||null===(te=Ue.additionalDetails)||void 0===te?void 0:te.buildingStatus)||et("CS_NA")}),l.createElement(o.Row,{className:"border-none",label:et("BPA_CORE_AREA_LABEL"),text:(null==rl||null===(le=rl.planDetail)||void 0===le?void 0:le.coreArea)||(null==Ue||null===(ne=Ue.additionalDetails)||void 0===ne?void 0:ne.coreArea)||et("CS_NA")}),l.createElement(o.Row,{className:"border-none",label:et("BPA_PROPOSED_SITE_LABEL"),text:(null==yt||null===(ie=yt.proposedSite)||void 0===ie?void 0:ie.code)||(null==Ue||null===(oe=Ue.additionalDetails)||void 0===oe?void 0:oe.proposedSite)||et("CS_NA")}),"SCHEME"===(null==yt||null===(ae=yt.schemes)||void 0===ae?void 0:ae.code)&&l.createElement(l.Fragment,null,l.createElement(o.Row,{className:"border-none",label:et("BPA_SCHEME_TYPE_LABEL"),text:(null==yt||null===(re=yt.schemesselection)||void 0===re?void 0:re.value)||(null==Ue||null===(ue=Ue.additionalDetails)||void 0===ue?void 0:ue.schemesselection)||et("CS_NA")}),l.createElement(o.Row,{className:"border-none",label:et("BPA_SCHEME_NAME_LABEL"),text:(null==yt?void 0:yt.schemeName)||(null==Ue||null===(de=Ue.additionalDetails)||void 0===de?void 0:de.schemeName)||et("CS_NA")}),l.createElement(o.Row,{className:"border-none",label:et("BPA_TRANFERRED_SCHEME_LABEL"),text:(null==yt?void 0:yt.transferredscheme)||(null==Ue||null===(se=Ue.additionalDetails)||void 0===se?void 0:se.transferredscheme)||et("CS_NA")})),l.createElement(o.Row,{className:"border-none",label:et("BPA_PURCHASED_FAR_LABEL"),text:(null==yt||null===(ce=yt.purchasedFAR)||void 0===ce?void 0:ce.code)||(null==Ue||null===(ve=Ue.additionalDetails)||void 0===ve?void 0:ve.purchasedFAR)||et("CS_NA")}),l.createElement(o.Row,{className:"border-none",label:et("BPA_MASTER_PLAN_LABEL"),text:(null==yt||null===(pe=yt.masterPlan)||void 0===pe?void 0:pe.code)||(null==Ue||null===(me=Ue.additionalDetails)||void 0===me?void 0:me.masterPlan)||et("CS_NA")}),l.createElement(o.Row,{className:"border-none",label:et("BPA_GREEN_BUILDING_LABEL"),text:(null==yt||null===(Ee=yt.greenbuilding)||void 0===Ee?void 0:Ee.code)||(null==Ue||null===(fe=Ue.additionalDetails)||void 0===fe?void 0:fe.greenbuilding)||et("CS_NA")}))),l.createElement(o.Card,{style:{paddingRight:"16px"}},l.createElement(o.StatusTable,null,l.createElement(o.CardHeader,null,et("BPA_DOCUMENT_DETAILS_LABEL")),l.createElement(o.LinkButton,{label:l.createElement(o.EditIcon,{style:{marginTop:"-10px",float:"right",position:"relative",bottom:"32px"}}),style:{width:"100px",display:"inline"},onClick:()=>gl(pl+"/document-details")}),l.createElement(zl,{documents:kt(ol),svgStyles:{},isSendBackFlow:!1,isHrLine:!0,titleStyles:{fontSize:"18px",lineHeight:"24px",fontWeight:700,marginBottom:"10px"}}))),l.createElement(o.Card,{style:{paddingRight:"16px"}},l.createElement(o.CardSubHeader,null,et("BPA_SUMMARY_FEE_EST")),l.createElement(o.StatusTable,null,l.createElement(o.CardSubHeader,null,et("BPA_P1_SUMMARY_FEE_EST")),l.createElement(o.Row,{className:"border-none",label:et("BPA_APPL_FEES"),text:"₹ "+((null==Ue||null===(_e=Ue.additionalDetails)||void 0===_e?void 0:_e.P1charges)||(null==cl||null===(ge=cl.Bill[0])||void 0===ge||null===(Ae=ge.billDetails[0])||void 0===Ae?void 0:Ae.amount))}),l.createElement(o.Row,{className:"border-none",label:et("BUILDING_APPLICATION_FEES"),text:"₹ "+Math.round(10.7639*(null==rl||null===(Se=rl.planDetail)||void 0===Se||null===(he=Se.blocks)||void 0===he||null===(be=he[0])||void 0===be||null===(ye=be.building)||void 0===ye?void 0:ye.totalBuitUpArea)*2.5)}),l.createElement(o.Row,{className:"border-none",label:et("BOUNDARY_WALL_FEES"),text:"₹ "+2.5*(null==ht?void 0:ht.boundaryWallLength)}),l.createElement(o.CardSubHeader,null,et("BPA_P2_SUMMARY_FEE_EST")),l.createElement(o.Row,{className:"border-none",label:et("BPA_COMMON_MALBA_AMT"),text:"₹ "+Xe}),l.createElement(o.Row,{className:"border-none",label:et("BPA_COMMON_LABOUR_AMT"),text:"₹ "+Ge}),l.createElement(o.Row,{className:"border-none",label:et("BPA_COMMON_WATER_AMT"),text:"₹ "+Ze}),l.createElement(o.Row,{className:"border-none",label:et("BPA_COMMON_GAUSHALA_AMT"),text:"₹ "+Ve}),l.createElement(o.CardSubHeader,null,et("BPA_P2_SUMMARY_FEE_EST_MANUAL")),l.createElement(o.CardLabel,null,et("BPA_COMMON_DEVELOPMENT_AMT")),l.createElement(o.TextInput,{t:et,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"development",defaultValue:null==Ue||null===(Ce=Ue.additionalDetails)||void 0===Ce||null===(Te=Ce.selfCertificationCharges)||void 0===Te?void 0:Te.BPA_DEVELOPMENT_CHARGES,value:He,onChange:e=>{!function(e){/^\d{0,10}$/.test(e)?(We(e),sessionStorage.setItem("development",e)):alert(et("Please enter numbers"))}(e.target.value)},required:!0,pattern:"^[0-9]*$"}),l.createElement(o.CardLabel,null,et("BPA_COMMON_OTHER_AMT")),l.createElement(o.TextInput,{t:et,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"otherCharges",defaultValue:null==Ue||null===(De=Ue.additionalDetails)||void 0===De||null===(Ne=De.selfCertificationCharges)||void 0===Ne?void 0:Ne.BPA_OTHER_CHARGES,value:je,onChange:e=>{!function(e){/^[0-9]*$/.test(e)?($e(e),sessionStorage.setItem("otherCharges",e)):alert(et("Please enter numbers"))}(e.target.value)},required:!0,pattern:/^[0-9]*$/}),parseInt(je)>0?l.createElement("div",null,l.createElement(o.CardLabel,null,et("BPA_COMMON_OTHER_AMT_DISCRIPTION")),l.createElement(o.TextArea,{t:et,type:"text",name:"otherChargesDiscription",defaultValue:null==Ue||null===(Pe=Ue.additionalDetails)||void 0===Pe?void 0:Pe.otherFeesDiscription,value:ot,onChange:e=>{!function(e){at(e),sessionStorage.setItem("otherChargesDisc",e)}(e.target.value)},required:!0})):null,l.createElement(o.CardLabel,null,et("BPA_COMMON_LESS_AMT")),l.createElement(o.TextInput,{t:et,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"lessAdjusment",defaultValue:null==Ue||null===(Ie=Ue.additionalDetails)||void 0===Ie||null===(Le=Ie.selfCertificationCharges)||void 0===Le?void 0:Le.BPA_LESS_ADJUSMENT_PLOT,value:Ye,onChange:e=>{!function(e){/^[0-9]*$/.test(e)?parseInt(e)>(parseInt(He)?parseInt(He):0)+(parseInt(je)?parseInt(je):0)+parseInt(Xe)+parseInt(Ge)+parseInt(Ze)+parseInt(Ve)?alert(et("Less adjustment fees cannot be grater than Total of other P2 fees")):(ze(e),sessionStorage.setItem("lessAdjusment",e)):alert(et("Please enter numbers"))}(e.target.value)},required:!0,pattern:"^[0-9]*$"}),parseInt(Ye)>0?l.createElement("div",null,l.createElement(o.CardLabel,null,et("BPA_COMMON_LESS_AMT_FILE")),l.createElement(o.UploadFile,{id:"noc-doc",style:{marginBottom:"200px"},onUpload:function(e){ut(e.target.files[0]),vt(e.target.files[0])},onDelete:()=>{ut(null),vt("")},message:rt?"1 "+et("FILEUPLOADED"):et("ES_NO_FILE_SELECTED_LABEL"),error:Et,uploadMessage:pt})):null,(null==gt||null===(Be=gt.fileStoreIds)||void 0===Be?void 0:Be.length)&&parseInt(null==Ue||null===(Oe=Ue.additionalDetails)||void 0===Oe||null===(Re=Oe.selfCertificationCharges)||void 0===Re?void 0:Re.BPA_LESS_ADJUSMENT_PLOT)>0&&l.createElement(o.CardLabel,{style:{marginTop:"15px"}},et("BPA_COMMON_LESS_AMT_PREVIOUS_FILE")),(null==gt||null===(we=gt.fileStoreIds)||void 0===we?void 0:we.length)&&parseInt(null==Ue||null===(xe=Ue.additionalDetails)||void 0===xe||null===(Me=xe.selfCertificationCharges)||void 0===Me?void 0:Me.BPA_LESS_ADJUSMENT_PLOT)>0&&l.createElement("a",{target:"_blank",href:null==gt||null===(Fe=gt.fileStoreIds[0])||void 0===Fe?void 0:Fe.url},l.createElement(o.PDFSvg,null)),l.createElement(o.Row,{className:"border-none"}),l.createElement(o.Row,{className:"border-none",label:et("BPA_P2_TOTAL_FEE"),text:"₹ "+((parseInt(He)?parseInt(He):0)+(parseInt(je)?parseInt(je):0)+parseInt(Xe)+parseInt(Ge)+parseInt(Ze)+parseInt(Ve)-(parseInt(Ye)?parseInt(Ye):0))})),l.createElement("br",null),"INITIATED"===(null==Ue?void 0:Ue.status)&&l.createElement("div",null,l.createElement(o.CardLabel,null,et("ARCHITECT_SHOULD_VERIFY_HIMSELF_BY_CLICKING_BELOW_BUTTON")),l.createElement(o.LinkButton,{label:et("BPA_VERIFY"),onClick:()=>{Wt(!0)}}),l.createElement("br",null),Ht&&l.createElement(l.Fragment,null,l.createElement("br",null),l.createElement(o.CardLabel,null,et("BPA_MOBILE_NUMBER")),l.createElement(o.TextInput,{t:et,type:"tel",isMandatory:!0,optionKey:"i18nKey",name:"mobileNumber",value:jt,onChange:e=>{$t(e.target.value)},required:!0,pattern:"[0-9]{10}",type:"tel",title:et("CORE_COMMON_APPLICANT_MOBILE_NUMBER_INVALID")}),l.createElement(o.LinkButton,{label:et("BPA_GET_OTP"),onClick:function(){try{const e=c(function(){var e,t;return Promise.resolve(Digit.UserService.sendOtp({otp:{mobileNumber:jt,tenantId:null==tt||null===(e=tt.info)||void 0===e?void 0:e.tenantId,userType:null==tt||null===(t=tt.info)||void 0===t?void 0:t.type,type:"login"}})).then(function(e){e.isSuccessful?zt(!0):(console.error("Error sending OTP Response is false:",e.error),alert("Something Went Wrong"))})},function(e){console.error("Error sending OTP:",e),alert("Something went wrong")});return Promise.resolve(e&&e.then?e.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},disabled:!tl})),l.createElement("br",null),Yt&&l.createElement(l.Fragment,null,l.createElement("br",null),l.createElement(o.CardLabel,null,et("BPA_OTP")),l.createElement(o.TextInput,{t:et,type:"text",isMandatory:!0,optionKey:"i18nKey",name:"otp",value:Gt,onChange:e=>{Kt(e.target.value)},required:!0,pattern:"[0-9]{6}",type:"tel",title:et("BPA_INVALID_OTP")}),l.createElement(o.SubmitBar,{label:et("VERIFY_OTP"),onSubmit:function(){try{const e=c(function(){return Promise.resolve(Digit.UserService.authenticate(el)).then(function(e){if("Access Token generated successfully"===e.ResponseInfo.status){qt(!0),Jt(et("VERIFIED"));const e=new Date;Qt(e),sessionStorage.setItem("otpVerifiedTimestamp",e.toISOString())}else qt(!1),Jt(et("WRONG OTP"))})},function(e){console.error("Error verifying OTP:",e),alert("OTP Verification Error "),qt(!1),Jt(et("OTP Verification Error"))});return Promise.resolve(e&&e.then?e.then(function(){}):void 0)}catch(e){return Promise.reject(e)}}}),Xt&&l.createElement(o.CardLabel,{style:{color:"red"}},Xt))),l.createElement("br",null),l.createElement("div",null,l.createElement(o.CheckBox,{label:l.createElement("div",null,et("I_AGREE_TO_BELOW_UNDERTAKING"),l.createElement(o.LinkButton,{label:et("DECLARATION_UNDER_SELF_CERTIFICATION_SCHEME"),onClick:()=>{Vt?Ut(!0):alert("Please verify yourself")}})),onChange:()=>{wt(!Rt)},styles:{height:"auto"}}),Ft&&l.createElement(ko,{showTermsPopup:Ft,setShowTermsPopup:Ut,otpVerifiedTimestamp:Zt})),l.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",height:"2px",marginTop:"20px",marginBottom:"20px"}}),l.createElement(o.SubmitBar,{label:et("BPA_SEND_TO_CITIZEN_LABEL"),onSubmit:function(){He||sessionStorage.setItem("development",0),Ye||sessionStorage.setItem("lessAdjusment",0),je||sessionStorage.setItem("otherCharges",0),parseInt(Ye)>parseInt(He)+parseInt(je)+parseInt(Xe)+parseInt(Ge)+parseInt(Ze)+parseInt(Ve)?alert(et("Enterd Less Adjustment amount is invalid")):ke()},disabled:!Rt||!Vt||!xt,id:!0})))},OCBPACheckPage:e=>{var a,r,u,d,s,c,v,p,m,E,f,_,g,A,S,h,b,y,C,T,D,N,P,I,L,B,O,R,w,x,M,F,k,U,H,W,j,$,Y,z,G,K,V,q;let{onSubmit:X,value:J}=e;const{t:Z}=n.useTranslation();i.useHistory(),i.useRouteMatch();let Q,ee=Digit.UserService.getUser();"BPA_LOW"===J.businessService?Q="BPA.LOW_RISK_PERMIT_FEE":"BPA"===J.businessService?Q="BPA.NC_APP_FEE":"BPA_OC"===J.businessService&&(Q="BPA.NC_OC_APP_FEE");const{data:te,nocDocuments:le,documents:ne,additionalDetails:ie,PrevStateDocuments:oe,PrevStateNocDocuments:ae,applicationNo:re,uiFlow:ue}=J,de=(null==ee||null===(a=ee.info)||void 0===a?void 0:a.permanentCity)||(null==J?void 0:J.tenantId)||Digit.ULBService.getCurrentTenantId();let se=window.location.href.includes("editApplication"),ce=[];null==oe||oe.map(e=>{ce.push({...e,module:"OBPS"})}),null==ne||null===(r=ne.documents)||void 0===r||r.map(e=>{ce.push({...e,module:"OBPS"})}),null==ae||ae.map(e=>{ce.push({...e,module:"NOC"})}),null==le||null===(u=le.nocDocuments)||void 0===u||u.map(e=>{ce.push({...e,module:"NOC"})});const{data:ve,isLoading:pe}=Digit.Hooks.useDocumentSearch(ce,{enabled:(null==ce?void 0:ce.length)>0});let me=[],Ee=[];var fe;(null==ve||null===(d=ve.pdfFiles)||void 0===d?void 0:d.length)>0&&(null==ve||null===(fe=ve.pdfFiles)||void 0===fe||fe.map(e=>{"OBPS"==(null==e?void 0:e.module)&&me.push(e),"NOC"==(null==e?void 0:e.module)&&Ee.push(e)}));const{data:_e,isLoading:ge}=Digit.Hooks.obps.useScrutinyDetails(de,null==J||null===(s=J.data)||void 0===s?void 0:s.scrutinyNumber,{enabled:!(null==J||null===(c=J.data)||void 0===c||!c.scrutinyNumber)});let Ae=null==J?void 0:J.applicationNo;const Se={consumerCode:Ae},{data:he}=Digit.Hooks.useFetchBillsForBuissnessService({businessService:Q,...Se,tenantId:de||(null==J?void 0:J.tenantId)},{enabled:!!Ae,retry:!1});let be=se?`/digit-ui/citizen/obps/editApplication/ocbpa/${null==J?void 0:J.tenantId}/${null==J?void 0:J.applicationNo}`:`/digit-ui/citizen/obps/ocbpa/${null==ie?void 0:ie.applicationType.toLowerCase()}/${null==ie?void 0:ie.serviceType.toLowerCase()}`;const ye=[{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"},{name:"BPA_TABLE_COL_CARPETAREA",id:"CarpetArea"}],Ce=e=>{const t=e;return(e,l,n)=>e[t]},Te=t.useMemo(()=>ye.map(e=>({Header:Z(""+e.name),accessor:Ce(e.id),id:e.id})));function De(e){var t;let l=[];return null==e||null===(t=e.building)||void 0===t||t.floors.map(e=>{var t,n,i,o,a,r,u,d;l.push({Floor:Z("BPA_FLOOR_NAME_"+e.number),Level:e.number,Occupancy:Z(""+(null===(t=e.occupancies)||void 0===t||null===(n=t[0])||void 0===n?void 0:n.type)),BuildupArea:null===(i=e.occupancies)||void 0===i||null===(o=i[0])||void 0===o?void 0:o.builtUpArea,FloorArea:(null===(a=e.occupancies)||void 0===a||null===(r=a[0])||void 0===r?void 0:r.floorArea)||0,CarpetArea:(null===(u=e.occupancies)||void 0===u||null===(d=u[0])||void 0===d?void 0:d.CarpetArea)||0,key:Z("BPA_FLOOR_NAME_"+e.number)})}),l}function Ne(e){var t,l,n,i;let o=null==te||null===(t=te.bpaData)||void 0===t||null===(l=t.bpaApprovalResponse)||void 0===l||null===(n=l[0])||void 0===n||null===(i=n.landInfo)||void 0===i?void 0:i.unit,a="";if((null==o?void 0:o.length)>0){var r,u;let t=null===(r=o[e])||void 0===r||null===(u=r.usageCategory)||void 0===u?void 0:u.split(",");null!=t&&t.length&&(a=t.map(e=>e?""+Z("BPA_SUBOCCUPANCYTYPE_"+ft(null==e?void 0:e.toUpperCase(),"-","_")):"NA").join(", "))}return a||"NA"}function Pe(e){location.href=e}return pe||ge?l.createElement(o.Loader,null):l.createElement(l.Fragment,null,l.createElement(Yl,{currentStep:4,flow:"OCBPA"===(null==ue?void 0:ue.flow)?"OCBPA":""}),l.createElement(o.Header,{styles:{marginLeft:"10px"}},Z("BPA_STEPPER_SUMMARY_HEADER")),l.createElement(o.Card,{style:{paddingRight:"16px"}},l.createElement(o.StatusTable,null,l.createElement(o.Row,{className:"border-none",label:Z("BPA_APPLICATION_NUMBER_LABEL"),text:re||""}))),l.createElement(o.Card,{style:{paddingRight:"16px"}},l.createElement(o.CardHeader,null,Z("BPA_BASIC_DETAILS_TITLE")),l.createElement(o.StatusTable,null,l.createElement(o.Row,{className:"border-none",label:""+Z("BPA_BASIC_DETAILS_APP_DATE_LABEL"),text:It(Number(null==te?void 0:te.applicationDate))}),l.createElement(o.Row,{className:"border-none",label:""+Z("BPA_BASIC_DETAILS_APPLICATION_TYPE_LABEL"),text:Z("WF_BPA_"+(null==te?void 0:te.applicationType))}),l.createElement(o.Row,{className:"border-none",label:""+Z("BPA_BASIC_DETAILS_SERVICE_TYPE_LABEL"),text:Z(null==te?void 0:te.serviceType)}),l.createElement(o.Row,{className:"border-none",label:""+Z("BPA_BASIC_DETAILS_OCCUPANCY_LABEL"),text:null==te?void 0:te.occupancyType}),l.createElement(o.Row,{className:"border-none",label:""+Z("BPA_BASIC_DETAILS_RISK_TYPE_LABEL"),text:Z("WF_BPA_"+(null==te?void 0:te.riskType))}),l.createElement(o.Row,{className:"border-none",label:""+Z("BPA_BASIC_DETAILS_APPLICATION_NAME_LABEL"),text:null==te?void 0:te.applicantName}))),l.createElement(o.Card,{style:{paddingRight:"16px"}},l.createElement(o.StatusTable,null,l.createElement(o.CardHeader,null,Z("BPA_PLOT_DETAILS_TITLE")),l.createElement(o.LinkButton,{label:l.createElement(o.EditIcon,{style:{marginTop:"-10px",float:"right",position:"relative",bottom:"32px"}}),style:{width:"100px",display:"inline"},onClick:()=>Pe(be+"/plot-details")}),l.createElement(o.Row,{className:"border-none",label:""+Z("BPA_BOUNDARY_PLOT_AREA_LABEL"),text:null!=_e&&null!==(v=_e.planDetail)&&void 0!==v&&null!==(p=v.planInformation)&&void 0!==p&&p.plotArea?`${null==_e||null===(m=_e.planDetail)||void 0===m||null===(E=m.planInformation)||void 0===E?void 0:E.plotArea} ${Z("BPA_SQ_MTRS_LABEL")}`:Z("CS_NA"),textStyle:{paddingLeft:"12px"}}),l.createElement(o.Row,{className:"border-none",label:""+Z("BPA_PLOT_NUMBER_LABEL"),text:(null==_e||null===(f=_e.planDetail)||void 0===f||null===(_=f.planInformation)||void 0===_?void 0:_.plotNo)||Z("CS_NA")}),l.createElement(o.Row,{className:"border-none",label:""+Z("BPA_KHATHA_NUMBER_LABEL"),text:(null==_e||null===(g=_e.planDetail)||void 0===g||null===(A=g.planInformation)||void 0===A?void 0:A.khataNo)||Z("CS_NA")}),l.createElement(o.Row,{className:"border-none",label:""+Z("BPA_BOUNDARY_LAND_REG_DETAIL_LABEL"),text:(null==te?void 0:te.registrationDetails)||Z("CS_NA")}))),l.createElement(o.Card,{style:{paddingRight:"16px"}},l.createElement(o.CardHeader,null,""+Z("BPA_STEPPER_SCRUTINY_DETAILS_HEADER")),l.createElement(o.CardSubHeader,null,""+Z("BPA_EDCR_DETAILS")),l.createElement(o.StatusTable,{style:{border:"none"}},l.createElement(o.Row,{className:"border-none",label:""+Z("BPA_OC_EDCR_NO_LABEL"),text:null==te||null===(S=te.scrutinyNumber)||void 0===S?void 0:S.edcrNumber}),l.createElement(o.CardSubHeader,null,Z("BPA_UPLOADED_PLAN_DIAGRAM")),l.createElement(o.LinkButton,{label:l.createElement(o.PDFSvg,null),onClick:()=>Pe(null==_e?void 0:_e.updatedDxfFile)}),l.createElement("p",{style:{marginTop:"8px",marginBottom:"20px",textAlign:"Left",fontSize:"16px",lineHeight:"19px",color:"#505A5F",fontWeight:"400"}},Z("BPA_UPLOADED_PLAN_DXF")),l.createElement(o.CardSubHeader,null,Z("BPA_SCRUNTINY_REPORT_OUTPUT")),l.createElement(o.LinkButton,{label:l.createElement(o.PDFSvg,null),onClick:()=>Pe(null==_e?void 0:_e.planReport)}),l.createElement("p",{style:{marginTop:"8px",marginBottom:"20px",textAlign:"Left",fontSize:"16px",lineHeight:"19px",color:"#505A5F",fontWeight:"400"}},Z("BPA_SCRUTINY_REPORT_PDF"))),l.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",height:"2px",marginTop:"20px",marginBottom:"20px"}}),l.createElement(o.CardSubHeader,null,""+Z("BPA_ACTUAL_BUILDING_EXTRACT_HEADER")),l.createElement(o.StatusTable,null,l.createElement(o.Row,{className:"border-none",label:""+Z("BPA_TOTAL_BUILT_UP_AREA_HEADER"),text:null!=_e&&null!==(h=_e.planDetail)&&void 0!==h&&null!==(b=h.blocks)&&void 0!==b&&null!==(y=b[0])&&void 0!==y&&null!==(C=y.building)&&void 0!==C&&C.totalBuitUpArea?`${null==_e||null===(T=_e.planDetail)||void 0===T||null===(D=T.blocks)||void 0===D||null===(N=D[0])||void 0===N||null===(P=N.building)||void 0===P?void 0:P.totalBuitUpArea} ${Z("BPA_SQ_MTRS_LABEL")}`:Z("NA")}),l.createElement(o.Row,{className:"border-none",label:""+Z("BPA_SCRUTINY_DETAILS_NUMBER_OF_FLOORS_LABEL"),text:null==_e||null===(I=_e.planDetail)||void 0===I||null===(L=I.blocks)||void 0===L||null===(B=L[0])||void 0===B||null===(O=B.building)||void 0===O?void 0:O.totalFloors}),l.createElement(o.Row,{className:"border-none",label:""+Z("BPA_HEIGHT_FROM_GROUND_LEVEL_FROM_MUMTY"),text:`${null==_e||null===(R=_e.planDetail)||void 0===R||null===(w=R.blocks)||void 0===w||null===(x=w[0])||void 0===x||null===(M=x.building)||void 0===M?void 0:M.declaredBuildingHeight} ${Z("BPA_MTRS_LABEL")}`})),l.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",height:"2px",marginTop:"20px",marginBottom:"20px"}}),l.createElement(o.CardSubHeader,null,""+Z("BPA_OCC_SUBOCC_HEADER")),null==_e||null===(F=_e.planDetail)||void 0===F?void 0:F.blocks.map((e,t)=>{var n,i;return l.createElement("div",{key:t,style:(null==_e||null===(n=_e.planDetail)||void 0===n||null===(i=n.blocks)||void 0===i?void 0:i.length)>1?{marginTop:"19px",background:"#FAFAFA",border:"1px solid #D6D5D4",borderRadius:"4px",padding:"8px",lineHeight:"19px",maxWidth:"960px",minWidth:"280px"}:{}},l.createElement(o.CardSubHeader,{style:{marginTop:"15px"}},""+Z("BPA_BLOCK_SUBHEADER")," ",t+1),l.createElement(o.StatusTable,null,l.createElement(o.Row,{className:"border-none",textStyle:{wordBreak:"break-word"},label:""+Z("BPA_SUB_OCCUPANCY_LABEL"),text:Ne(t)})),l.createElement("div",{style:{overflowX:"scroll"}},l.createElement(o.Table,{className:"customTable table-fixed-first-column table-border-style",t:Z,disableSort:!1,autoSort:!0,manualPagination:!1,isPaginationRequired:!1,initSortId:"S N ",data:De(e),columns:Te,getCellProps:e=>({style:{}})})))}),l.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",height:"2px",marginTop:"20px",marginBottom:"20px"}}),l.createElement(o.CardSubHeader,null,""+Z("BPA_APP_DETAILS_DEMOLITION_DETAILS_LABEL")),l.createElement(o.StatusTable,{style:{border:"none"}},l.createElement(o.Row,{className:"border-none",label:""+Z("BPA_APPLICATION_DEMOLITION_AREA_LABEL"),text:null!=_e&&null!==(k=_e.planDetail)&&void 0!==k&&null!==(U=k.planInformation)&&void 0!==U&&U.demolitionArea?`${null==_e||null===(H=_e.planDetail)||void 0===H||null===(W=H.planInformation)||void 0===W?void 0:W.demolitionArea} ${Z("BPA_SQ_MTRS_LABEL")}`:Z("CS_NA")}))),l.createElement(o.Card,{style:{paddingRight:"16px"}},l.createElement(o.StatusTable,null,l.createElement(o.CardHeader,null,Z("BPA_DOCUMENT_DETAILS_LABEL")),l.createElement(o.LinkButton,{label:l.createElement(o.EditIcon,{style:{marginTop:"-10px",float:"right",position:"relative",bottom:"32px"}}),style:{width:"100px",display:"inline"},onClick:()=>Pe(be+"/document-details")}),l.createElement(zl,{documents:kt(me),svgStyles:{},isSendBackFlow:!1,isHrLine:!0,titleStyles:{fontSize:"18px",lineHeight:"24px",fontWeight:700,marginBottom:"10px"}}))),l.createElement(o.Card,{style:{paddingRight:"16px"}},l.createElement(o.StatusTable,null,l.createElement(o.CardHeader,null,Z("BPA_NOC_DETAILS_SUMMARY")),l.createElement(o.LinkButton,{label:l.createElement(o.EditIcon,{style:{marginTop:"-10px",float:"right",position:"relative",bottom:"32px"}}),style:{width:"100px",display:"inline"},onClick:()=>Pe(be+"/noc-details")}),le&&(null==le?void 0:le.NocDetails.map((e,t)=>{var n,i,a,r,u;return l.createElement("div",{key:t,style:(null==le||null===(n=le.NocDetails)||void 0===n?void 0:n.length)>1?{marginTop:"19px",background:"#FAFAFA",border:"1px solid #D6D5D4",borderRadius:"4px",padding:"8px",lineHeight:"19px",maxWidth:"960px",minWidth:"280px"}:{}},l.createElement(o.CardSectionHeader,{style:{marginBottom:"24px"}},""+Z(`BPA_${null==e?void 0:e.nocType}_HEADER`)),l.createElement(o.StatusTable,null,l.createElement(o.Row,{className:"border-none",label:Z(`BPA_${null==e?void 0:e.nocType}_LABEL`),text:null==e?void 0:e.applicationNo}),l.createElement(o.Row,{className:"border-none",label:Z("BPA_NOC_STATUS"),text:Z(""+(null==e?void 0:e.applicationStatus)),textStyle:"APPROVED"==(null==e?void 0:e.applicationStatus)||"AUTO_APPROVED"==(null==e?void 0:e.applicationStatus)?{color:"#00703C"}:{color:"#D4351C"}}),null!=e&&null!==(i=e.additionalDetails)&&void 0!==i&&i.SubmittedOn?l.createElement(o.Row,{className:"border-none",label:""+Z("BPA_NOC_SUBMISSION_DATE"),text:null!=e&&null!==(a=e.additionalDetails)&&void 0!==a&&a.SubmittedOn?It(Number(null==e||null===(r=e.additionalDetails)||void 0===r?void 0:r.SubmittedOn)):"NA"}):null,null!=e&&e.nocNo?l.createElement(o.Row,{className:"border-none",label:""+Z("BPA_APPROVAL_NUMBER_LABEL"),text:(null==e?void 0:e.nocNo)||"NA"}):null,"APPROVED"===(null==e?void 0:e.applicationStatus)||"REJECTED"===(null==e?void 0:e.applicationStatus)||"AUTO_APPROVED"===(null==e?void 0:e.applicationStatus)||"AUTO_REJECTED"===(null==e?void 0:e.applicationStatus)?l.createElement(o.Row,{className:"border-none",label:""+Z("BPA_APPROVED_REJECTED_ON_LABEL"),text:It(Number(null==e||null===(u=e.auditDetails)||void 0===u?void 0:u.lastModifiedTime))}):null,l.createElement(o.Row,{className:"border-none",label:Z("BPA_DOCUMENT_DETAILS_LABEL"),text:""}),l.createElement(zl,{documents:kt(null==Ee?void 0:Ee.filter(t=>{var l,n,i;return null==t||null===(l=t.documentType)||void 0===l?void 0:l.includes(null==e||null===(n=e.nocType)||void 0===n||null===(i=n.split("_"))||void 0===i?void 0:i[0])}),!0),svgStyles:{},isSendBackFlow:!1,isHrLine:!0,titleStyles:{fontSize:"18px",lineHeight:"24px",fontWeight:700,marginBottom:"10px"}})))})))),l.createElement(o.Card,{style:{paddingRight:"16px"}},l.createElement(o.CardSubHeader,null,""+Z("BPA_SUMMARY_FEE_EST")),l.createElement(o.StatusTable,null,null==he||null===(j=he.Bill[0])||void 0===j||null===($=j.billDetails[0])||void 0===$?void 0:$.billAccountDetails.map((e,t)=>l.createElement("div",{key:t},l.createElement(o.Row,{className:"border-none",label:""+Z(""+e.taxHeadCode),text:"₹ "+(null==e?void 0:e.amount)}))),l.createElement(o.Row,{className:"border-none",label:Z("BPA_COMMON_TOTAL_AMT"),text:"₹ "+((null==he||null===(Y=he.Bill)||void 0===Y||null===(z=Y[0])||void 0===z||null===(G=z.billDetails[0])||void 0===G?void 0:G.amount)||"0")})),l.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",height:"2px",marginTop:"20px",marginBottom:"20px"}}),l.createElement(o.CardHeader,null,Z("BPA_COMMON_TOTAL_AMT")),l.createElement(o.CardHeader,null,"₹ ",(null==he||null===(K=he.Bill)||void 0===K||null===(V=K[0])||void 0===V||null===(q=V.billDetails[0])||void 0===q?void 0:q.amount)||"0"),l.createElement(o.SubmitBar,{label:Z("BPA_SEND_TO_CITIZEN_LABEL"),onSubmit:X})))},OCBPASendBackCheckPage:e=>{var a,r,d,s,c,v,p,m,E,f,_,g,A,S,h,b,y,C,T,D,N,P,I,L,B,O,R,w,x,M,F,k,U,H,W,j,$,Y,z,G,K,V,q,X,J,Z,Q,ee,te,le,ne,ie,oe,ae,re,ue,de,se,ce,ve,pe,me,Ee,fe;let{value:_e}=e;const{t:ge}=n.useTranslation(),Ae=i.useHistory();i.useRouteMatch();let Se,he=Digit.UserService.getUser();const be=null==he||null===(a=he.info)||void 0===a?void 0:a.permanentCity,[ye,Ce]=t.useState(null),[Te,De]=t.useState(!1),[Ne,Pe]=t.useState(null),Ie=null==_e||null===(r=_e.data)||void 0===r?void 0:r.edcrDetails,Le=u.useQueryClient(),{data:Be,address:Oe,owners:Re,nocDocuments:we,documents:xe,subOccupancy:Me,PrevStateDocuments:Fe,PrevStateNocDocuments:ke,applicationNo:Ue}=_e;let He=`/digit-ui/citizen/obps/sendbacktocitizen/${"BPA_OC"==_e.businessService?"ocbpa":"bpa"}/${null==_e?void 0:_e.tenantId}/${null==_e?void 0:_e.applicationNo}`;"OCBPA"===(null==_e||null===(d=_e.uiFlow)||void 0===d?void 0:d.flow)&&(He=`/digit-ui/citizen/obps/sendbacktocitizen/ocbpa/${null==_e?void 0:_e.tenantId}/${null==_e?void 0:_e.applicationNo}`),Se="BPA_LOW"===_e.businessService?"BPA.LOW_RISK_PERMIT_FEE":"BPA"===_e.businessService?"BPA.NC_APP_FEE":"BPA.NC_OC_APP_FEE";let We=[];null==Fe||Fe.map(e=>{We.push({...e,module:"OBPS"})}),null==xe||null===(s=xe.documents)||void 0===s||s.map(e=>{We.push({...e,module:"OBPS"})}),null==ke||ke.map(e=>{We.push({...e,module:"NOC"})}),null==we||null===(c=we.nocDocuments)||void 0===c||c.map(e=>{We.push({...e,module:"NOC"})});const{data:je,isLoading:$e}=Digit.Hooks.useDocumentSearch(We,{enabled:(null==We?void 0:We.length)>0});let Ye=[],ze=[];var Ge;(null==je||null===(v=je.pdfFiles)||void 0===v?void 0:v.length)>0&&(null==je||null===(Ge=je.pdfFiles)||void 0===Ge||Ge.map(e=>{"OBPS"==(null==e?void 0:e.module)&&Ye.push(e),"NOC"==(null==e?void 0:e.module)&&ze.push(e)}));const{data:Ke,isLoading:Ve}=Digit.Hooks.useRecieptSearch({tenantId:null==_e?void 0:_e.tenantId,businessService:Se,consumerCodes:null==_e?void 0:_e.applicationNo},{enabled:!!(null!=_e&&_e.applicationNo&&Se&&null!=_e&&_e.tenantId)}),qe=Digit.Hooks.obps.useObpsAPI(null==_e?void 0:_e.tenantId,!1),Xe=Digit.Hooks.useWorkflowDetails({tenantId:null==_e?void 0:_e.tenantId,id:null==_e?void 0:_e.applicationNo,moduleCode:"OBPS",config:{enabled:!(null==_e||!_e.applicationNo||null==_e||!_e.tenantId)}}),Je=()=>{Pe(null)},Ze=[{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"},{name:"BPA_TABLE_COL_CARPETAREA",id:"CarpetArea"}],Qe=e=>{const t=e;return(e,l,n)=>e[t]},et=t.useMemo(()=>Ze.map(e=>({Header:ge(""+e.name),accessor:Qe(e.id),id:e.id})));function tt(e){var t;let l=[];return null==e||null===(t=e.building)||void 0===t||t.floors.map(e=>{var t,n,i,o,a,r,u,d;l.push({Floor:ge("BPA_FLOOR_NAME_"+e.number),Level:e.number,Occupancy:ge(""+(null===(t=e.occupancies)||void 0===t||null===(n=t[0])||void 0===n?void 0:n.type)),BuildupArea:null===(i=e.occupancies)||void 0===i||null===(o=i[0])||void 0===o?void 0:o.builtUpArea,FloorArea:(null===(a=e.occupancies)||void 0===a||null===(r=a[0])||void 0===r?void 0:r.floorArea)||0,CarpetArea:(null===(u=e.occupancies)||void 0===u||null===(d=u[0])||void 0===d?void 0:d.CarpetArea)||0,key:ge("BPA_FLOOR_NAME_"+e.number)})}),l}function lt(e){location.href=e}function nt(e){let t="";return Me["Block_"+(e+1)]&&Me["Block_"+(e+1)].map(e=>{var l;t+=ge(ft(null==e||null===(l=e.i18nKey)||void 0===l?void 0:l.toUpperCase(),"-","_"))+", "}),t}return t.useEffect(()=>{switch(ye){case"FORWARD":De(!0)}},[ye]),$e||Ve?l.createElement(o.Loader,null):l.createElement(l.Fragment,null,l.createElement(Yl,{currentStep:4,flow:"OCBPA"===(null==_e||null===(p=_e.uiFlow)||void 0===p?void 0:p.flow)?"OCBPA":""}),l.createElement(o.Header,{styles:{marginLeft:"10px"}},ge("BPA_STEPPER_SUMMARY_HEADER")),l.createElement(o.Card,{style:{paddingRight:"16px"}},l.createElement(o.StatusTable,null,l.createElement(o.Row,{className:"border-none",label:ge("BPA_APPLICATION_NUMBER_LABEL"),text:Ue||""}))),l.createElement(o.Card,{style:{paddingRight:"16px"}},l.createElement(o.CardHeader,null,ge("BPA_BASIC_DETAILS_TITLE")),l.createElement(o.StatusTable,null,l.createElement(o.Row,{className:"border-none",label:ge("BPA_BASIC_DETAILS_APP_DATE_LABEL"),text:It(Number(null==Be?void 0:Be.applicationDate))}),l.createElement(o.Row,{className:"border-none",label:ge("BPA_BASIC_DETAILS_APPLICATION_TYPE_LABEL"),text:ge("WF_BPA_"+(null==Be?void 0:Be.applicationType))}),l.createElement(o.Row,{className:"border-none",label:ge("BPA_BASIC_DETAILS_SERVICE_TYPE_LABEL"),text:ge(null==Be?void 0:Be.serviceType)}),l.createElement(o.Row,{className:"border-none",label:ge("BPA_BASIC_DETAILS_OCCUPANCY_LABEL"),text:null==Be?void 0:Be.occupancyType}),l.createElement(o.Row,{className:"border-none",label:ge("BPA_BASIC_DETAILS_RISK_TYPE_LABEL"),text:ge("WF_BPA_"+(null==Be?void 0:Be.riskType))}),l.createElement(o.Row,{className:"border-none",label:ge("BPA_BASIC_DETAILS_APPLICATION_NAME_LABEL"),text:null==Be?void 0:Be.applicantName}))),l.createElement(o.Card,{style:{paddingRight:"16px"}},l.createElement(o.CardHeader,null,ge("BPA_PLOT_DETAILS_TITLE")),l.createElement(o.StatusTable,null,l.createElement(o.Row,{className:"border-none",label:ge("BPA_BOUNDARY_PLOT_AREA_LABEL"),text:null!=Ie&&null!==(m=Ie.planDetail)&&void 0!==m&&null!==(E=m.planInformation)&&void 0!==E&&E.plotArea?`${null==Ie||null===(f=Ie.planDetail)||void 0===f||null===(_=f.planInformation)||void 0===_?void 0:_.plotArea} ${ge("BPA_SQ_MTRS_LABEL")}`:ge("CS_NA")}),l.createElement(o.Row,{className:"border-none",label:ge("BPA_PLOT_NUMBER_LABEL"),text:(null==Ie||null===(g=Ie.planDetail)||void 0===g||null===(A=g.planInformation)||void 0===A?void 0:A.plotNo)||ge("CS_NA")}),l.createElement(o.Row,{className:"border-none",label:ge("BPA_KHATHA_NUMBER_LABEL"),text:(null==Ie||null===(S=Ie.planDetail)||void 0===S||null===(h=S.planInformation)||void 0===h?void 0:h.khataNo)||ge("CS_NA")}),l.createElement(o.Row,{className:"border-none",label:ge("BPA_HOLDING_NUMBER_LABEL"),text:(null==Be?void 0:Be.holdingNumber)||ge("CS_NA")}),l.createElement(o.Row,{className:"border-none",label:ge("BPA_BOUNDARY_LAND_REG_DETAIL_LABEL"),text:(null==Be?void 0:Be.registrationDetails)||ge("CS_NA")}))),l.createElement(o.Card,{style:{paddingRight:"16px"}},l.createElement(o.CardHeader,null,ge("BPA_STEPPER_SCRUTINY_DETAILS_HEADER")),l.createElement(o.CardSubHeader,null,ge("OCBPA"===(null==_e||null===(b=_e.uiFlow)||void 0===b?void 0:b.flow)?"BPA_OC_EDCR_NO_LABEL":"BPA_EDCR_DETAILS")),l.createElement(o.StatusTable,{style:{border:"none"}},l.createElement(o.Row,{className:"border-none",label:ge("BPA_EDCR_NO_LABEL"),text:(null==Be||null===(y=Be.scrutinyNumber)||void 0===y?void 0:y.edcrNumber)||ge("CS_NA")}),l.createElement(o.CardSubHeader,null,ge("BPA_UPLOADED_PLAN_DIAGRAM")),l.createElement(o.LinkButton,{label:l.createElement(o.PDFSvg,null),onClick:()=>lt(null==Ie?void 0:Ie.updatedDxfFile)}),l.createElement("p",{style:{marginTop:"8px",marginBottom:"20px",textAlign:"Left",fontSize:"16px",lineHeight:"19px",color:"#505A5F",fontWeight:"400"}},ge("BPA_UPLOADED_PLAN_DXF")),l.createElement(o.CardSubHeader,null,ge("BPA_SCRUNTINY_REPORT_OUTPUT")),l.createElement(o.LinkButton,{label:l.createElement(o.PDFSvg,null),onClick:()=>lt(null==Ie?void 0:Ie.planReport)}),l.createElement("p",{style:{marginTop:"8px",marginBottom:"20px",textAlign:"Left",fontSize:"16px",lineHeight:"19px",color:"#505A5F",fontWeight:"400"}},ge("BPA_SCRUTINY_REPORT_PDF"))),l.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",height:"2px",marginTop:"20px",marginBottom:"20px"}}),l.createElement(o.CardSubHeader,null,"OCBPA"===(null==_e||null===(C=_e.uiFlow)||void 0===C?void 0:C.flow)?ge("BPA_ACTUAL_BUILDING_EXTRACT_HEADER"):ge("BPA_BUILDING_EXTRACT_HEADER")),l.createElement(o.StatusTable,null,l.createElement(o.Row,{className:"border-none",label:ge("BPA_TOTAL_BUILT_UP_AREA_HEADER"),text:null!=Ie&&null!==(T=Ie.planDetail)&&void 0!==T&&null!==(D=T.blocks)&&void 0!==D&&null!==(N=D[0])&&void 0!==N&&null!==(P=N.building)&&void 0!==P&&P.totalBuitUpArea?`${null==Ie||null===(I=Ie.planDetail)||void 0===I||null===(L=I.blocks)||void 0===L||null===(B=L[0])||void 0===B||null===(O=B.building)||void 0===O?void 0:O.totalBuitUpArea} ${ge("BPA_SQ_MTRS_LABEL")}`:ge("NA")}),l.createElement(o.Row,{className:"border-none",label:ge("BPA_SCRUTINY_DETAILS_NUMBER_OF_FLOORS_LABEL"),text:null==Ie||null===(R=Ie.planDetail)||void 0===R||null===(w=R.blocks)||void 0===w||null===(x=w[0])||void 0===x||null===(M=x.building)||void 0===M?void 0:M.totalFloors}),l.createElement(o.Row,{className:"border-none",label:ge("BPA_HEIGHT_FROM_GROUND_LEVEL_FROM_MUMTY"),text:`${null==Ie||null===(F=Ie.planDetail)||void 0===F||null===(k=F.blocks)||void 0===k||null===(U=k[0])||void 0===U||null===(H=U.building)||void 0===H?void 0:H.declaredBuildingHeight} ${ge("BPA_MTRS_LABEL")}`})),l.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",height:"2px",marginTop:"20px",marginBottom:"20px"}}),l.createElement(o.CardSubHeader,null,ge("BPA_OCC_SUBOCC_HEADER")),null==Ie||null===(W=Ie.planDetail)||void 0===W?void 0:W.blocks.map((e,t)=>l.createElement("div",{key:t},l.createElement(o.CardSubHeader,{style:{marginTop:"15px"}},ge("BPA_BLOCK_SUBHEADER")," ",t+1),l.createElement(o.StatusTable,null,l.createElement(o.Row,{className:"border-none",textStyle:{wordBreak:"break-word"},label:ge("BPA_SUB_OCCUPANCY_LABEL"),text:""===nt(t)?ge("CS_NA"):nt(t)})),l.createElement("div",{style:{overflow:"scroll"}},l.createElement(o.Table,{className:"customTable table-fixed-first-column table-border-style",t:ge,disableSort:!1,autoSort:!0,manualPagination:!1,isPaginationRequired:!1,initSortId:"S N ",data:tt(e),columns:et,getCellProps:e=>({style:{}})})))),l.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",height:"2px",marginTop:"20px",marginBottom:"20px"}}),l.createElement(o.CardSubHeader,null,ge("BPA_APP_DETAILS_DEMOLITION_DETAILS_LABEL")),l.createElement(o.StatusTable,{style:{border:"none"}},l.createElement(o.Row,{className:"border-none",label:ge("BPA_APPLICATION_DEMOLITION_AREA_LABEL"),text:null!=Ie&&null!==(j=Ie.planDetail)&&void 0!==j&&null!==($=j.planInformation)&&void 0!==$&&$.demolitionArea?`${null==Ie||null===(Y=Ie.planDetail)||void 0===Y||null===(z=Y.planInformation)||void 0===z?void 0:z.demolitionArea} ${ge("BPA_SQ_MTRS_LABEL")} `:ge("CS_NA")}))),"OCBPA"!==(null==_e||null===(G=_e.uiFlow)||void 0===G?void 0:G.flow)?l.createElement("div",null,l.createElement(o.Card,{style:{paddingRight:"16px"}},l.createElement(o.CardHeader,null,ge("BPA_NEW_TRADE_DETAILS_HEADER_DETAILS")),l.createElement(o.StatusTable,null,l.createElement(o.Row,{className:"border-none",label:ge("BPA_DETAILS_PIN_LABEL"),text:(null==Oe?void 0:Oe.pincode)||ge("CS_NA")}),l.createElement(o.Row,{className:"border-none",label:ge("BPA_CITY_LABEL"),text:(null==Oe||null===(K=Oe.city)||void 0===K?void 0:K.name)||ge("CS_NA")}),l.createElement(o.Row,{className:"border-none",label:ge("BPA_LOC_MOHALLA_LABEL"),text:(null==Oe||null===(V=Oe.locality)||void 0===V?void 0:V.name)||ge("CS_NA")}),l.createElement(o.Row,{className:"border-none",label:ge("BPA_DETAILS_SRT_NAME_LABEL"),text:(null==Oe?void 0:Oe.street)||ge("CS_NA")}),l.createElement(o.Row,{className:"border-none",label:ge("ES_NEW_APPLICATION_LOCATION_LANDMARK"),text:(null==Oe?void 0:Oe.landmark)||ge("CS_NA")}))),l.createElement(o.Card,{style:{paddingRight:"16px"}},l.createElement(o.CardHeader,null,ge("BPA_APPLICANT_DETAILS_HEADER")),(null==Re?void 0:Re.owners)&&(null==Re?void 0:Re.owners.map((e,t)=>{var n;return l.createElement("div",{key:t},Re.owners.length>1&&l.createElement(o.CardSubHeader,null,ge("COMMON_OWNER")," ",t+1),l.createElement(o.StatusTable,null,l.createElement(o.Row,{className:"border-none",label:ge("CORE_COMMON_NAME"),text:null==e?void 0:e.name}),l.createElement(o.Row,{className:"border-none",label:ge("BPA_APPLICANT_GENDER_LABEL"),text:ge(null==e||null===(n=e.gender)||void 0===n?void 0:n.i18nKey)}),l.createElement(o.Row,{className:"border-none",label:ge("CORE_COMMON_MOBILE_NUMBER"),text:null==e?void 0:e.mobileNumber}),l.createElement(o.Row,{className:"border-none",label:ge("BPA_IS_PRIMARY_OWNER_LABEL"),text:""+(null==e?void 0:e.isPrimaryOwner)})))})))):null,l.createElement(o.Card,{style:{paddingRight:"16px"}},l.createElement(o.StatusTable,null,l.createElement(o.CardHeader,null,ge("BPA_DOCUMENT_DETAILS_LABEL")),l.createElement(o.LinkButton,{label:l.createElement(o.EditIcon,{style:{marginTop:"-10px",float:"right",position:"relative",bottom:"32px"}}),style:{width:"100px",display:"inline"},onClick:()=>lt(He+"/document-details")}),l.createElement(zl,{documents:kt(Ye),svgStyles:{},isSendBackFlow:!1,isHrLine:!0,titleStyles:{fontSize:"18px",lineHeight:"24px",fontWeight:700,marginBottom:"10px"}}))),l.createElement(o.Card,{style:{paddingRight:"16px"}},l.createElement(o.CardHeader,null,ge("BPA_NOC_DETAILS_SUMMARY")),we&&(null==we?void 0:we.NocDetails.map((e,t)=>{var n;return l.createElement("div",{key:t,style:(null==we||null===(n=we.NocDetails)||void 0===n?void 0:n.length)>1?{marginTop:"19px",background:"#FAFAFA",border:"1px solid #D6D5D4",borderRadius:"4px",padding:"8px",lineHeight:"19px",maxWidth:"960px",minWidth:"280px"}:{}},l.createElement(o.CardSectionHeader,{style:{marginBottom:"24px"}},""+ge(`BPA_${null==e?void 0:e.nocType}_HEADER`)),l.createElement(o.StatusTable,null,l.createElement(o.Row,{className:"border-none",label:ge(`BPA_${null==e?void 0:e.nocType}_LABEL`),text:null==e?void 0:e.applicationNo}),l.createElement(o.Row,{className:"border-none",label:ge("BPA_NOC_STATUS"),text:ge(""+(null==e?void 0:e.applicationStatus)),textStyle:"APPROVED"==(null==e?void 0:e.applicationStatus)||"AUTO_APPROVED"==(null==e?void 0:e.applicationStatus)?{color:"#00703C"}:{color:"#D4351C"}}),l.createElement(o.Row,{className:"border-none",label:ge("BPA_DOCUMENT_DETAILS_LABEL"),text:""}),l.createElement(zl,{documents:kt(null==ze?void 0:ze.filter(t=>{var l,n,i;return null==t||null===(l=t.documentType)||void 0===l?void 0:l.includes(null==e||null===(n=e.nocType)||void 0===n||null===(i=n.split("_"))||void 0===i?void 0:i[0])}),!0),svgStyles:{},isSendBackFlow:!1,isHrLine:!0,titleStyles:{fontSize:"18px",lineHeight:"24px",fontWeight:700,marginBottom:"10px"}})))}))),l.createElement(o.Card,{style:{paddingRight:"16px"}},l.createElement(o.CardSubHeader,null,ge("BPA_SUMMARY_FEE_EST")),l.createElement(o.StatusTable,null,null==Ke||null===(q=Ke.Payments)||void 0===q||null===(X=q[0])||void 0===X||null===(J=X.paymentDetails)||void 0===J||null===(Z=J[0])||void 0===Z||null===(Q=Z.bill)||void 0===Q||null===(ee=Q.billDetails)||void 0===ee||null===(te=ee[0])||void 0===te?void 0:te.billAccountDetails.map((e,t)=>l.createElement("div",{key:t},l.createElement(o.Row,{className:"border-none",label:ge(""+e.taxHeadCode),text:"₹ "+(null==e?void 0:e.amount)}))),l.createElement(o.Row,{className:"border-none",label:ge("BPA_COMMON_TOTAL_AMT"),text:"₹ "+((null==Ke||null===(le=Ke.Payments)||void 0===le||null===(ne=le[0])||void 0===ne||null===(ie=ne.paymentDetails)||void 0===ie||null===(oe=ie[0])||void 0===oe||null===(ae=oe.bill)||void 0===ae||null===(re=ae.billDetails)||void 0===re||null===(ue=re[0])||void 0===ue?void 0:ue.amount)||"0")})),l.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",height:"2px",marginTop:"20px",marginBottom:"20px"}}),l.createElement(o.CardHeader,null,ge("BPA_COMMON_TOTAL_AMT")),l.createElement(o.CardHeader,null,"₹ ",(null==Ke||null===(de=Ke.Payments)||void 0===de||null===(se=de[0])||void 0===se||null===(ce=se.paymentDetails)||void 0===ce||null===(ve=ce[0])||void 0===ve||null===(pe=ve.bill)||void 0===pe||null===(me=pe.billDetails)||void 0===me||null===(Ee=me[0])||void 0===Ee?void 0:Ee.amount)||"0"),l.createElement(o.SubmitBar,{label:ge("BPA_COMMON_BUTTON_SUBMIT"),onSubmit:function(e){Ce("FORWARD"),De(!0)}})),Te?l.createElement(dn,{t:ge,action:ye,tenantId:be,id:null==_e?void 0:_e.applicationNo,closeModal:()=>{Ce(null),De(!1)},submitAction:e=>{var t;let l=mt(_e);l.assignee=[];const n="OCBPA"===(null==_e||null===(t=_e.uiFlow)||void 0===t?void 0:t.flow),i=Dt(l,n,!0);qe.mutate({BPA:{...null==i?void 0:i.BPA,workflow:e}},{onError:(e,t)=>{var l,n,i;De(!1),Pe({key:"error",action:(null==e||null===(l=e.response)||void 0===l||null===(n=l.data)||void 0===n||null===(i=n.Errors[0])||void 0===i?void 0:i.message)||e}),setTimeout(Je,5e3)},onSuccess:(e,t)=>{De(!1),Pe({key:"success",action:ye}),setTimeout(Je,5e3),Le.invalidateQueries("BPA_DETAILS_PAGE"),Le.invalidateQueries("workFlowDetails"),Ae.replace(`/digit-ui/citizen/obps/sendbacktocitizen/ocbpa/${null==_e?void 0:_e.tenantId}/${null==_e?void 0:_e.applicationNo}/acknowledgement`,{data:null==_e?void 0:_e.applicationNo})}})},actionData:null==Xe||null===(fe=Xe.data)||void 0===fe?void 0:fe.timeline}):null,Ne&&l.createElement(o.Toast,{error:"error"===Ne.key,label:ge("success"===Ne.key?`ES_OBPS_${Ne.action}_UPDATE_SUCCESS`:Ne.action),onClose:Je}))},EDCRAcknowledgement:e=>{var a,r,u,d,s,c,v;const{t:p}=n.useTranslation(),[m,E]=(i.useHistory(),t.useState(!1));var f;if(t.useEffect(()=>{var t;"ERROR"!=(null==e||null===(t=e.data)||void 0===t?void 0:t.type)||m||E(!0)},[null==e||null===(a=e.data)||void 0===a?void 0:a.data]),"ERROR"==(null==e||null===(r=e.data)||void 0===r?void 0:r.type))return l.createElement(o.Card,{style:{padding:"0px"}},l.createElement(o.Banner,{message:p("CS_BPA_APPLICATION_FAILED"),applicationNumber:"",info:"",successful:!1,infoStyles:{fontSize:"18px",lineHeight:"21px",fontWeight:"bold",textAlign:"center",padding:"0px 15px"},applicationNumberStyles:{fontSize:"24px",lineHeight:"28px",fontWeight:"bold",marginTop:"10px"},style:{width:"100%",padding:"10px"}}),l.createElement("div",{style:{padding:"10px",paddingBottom:"10px"}},l.createElement(i.Link,{to:"/digit-ui/citizen"},l.createElement(o.SubmitBar,{label:p("CORE_COMMON_GO_TO_HOME")}))),m?l.createElement(o.Toast,{error:"error",label:p(null==e||null===(f=e.data)||void 0===f?void 0:f.data),onClose:()=>E(null),isDleteBtn:!0}):null);sessionStorage.setItem("isPermitApplication",!0),sessionStorage.setItem("isEDCRDisable",JSON.stringify(!0));const _=null==e||null===(u=e.data)||void 0===u?void 0:u[0],[g,A]=t.useState({}),S=Digit.ULBService.getStateId(),{data:h,isLoading:b}=(window.Digit.Utils.browser.isMobile(),Digit.Hooks.obps.useMDMS(S,"BPA",["homePageUrlLinks"]));Digit.Hooks.obps.useMDMS(S,"BPA",["RiskTypeComputation"]),t.useEffect(()=>{var e,t,l,n;!b&&(null==h||null===(e=h.BPA)||void 0===e||null===(t=e.homePageUrlLinks)||void 0===t?void 0:t.length)>0&&(null==h||null===(l=h.BPA)||void 0===l||null===(n=l.homePageUrlLinks)||void 0===n||n.map(e=>{(null==e?void 0:e.applicationType)===(null==_?void 0:_.appliactionType)&&(null==e?void 0:e.serviceType)===(null==_?void 0:_.applicationSubType)&&A({linkData:e,edcrNumber:null==_?void 0:_.edcrNumber})}))},[!b]);const y=function(){try{var e=window.open(_.planReport,"_blank");return e&&e.focus(),Promise.resolve()}catch(e){return Promise.reject(e)}};return l.createElement("div",null,"Accepted"==_.status?l.createElement(o.Card,{style:{padding:"0px"}},l.createElement(o.Banner,{message:p("EDCR_ACKNOWLEDGEMENT_SUCCESS_MESSAGE_LABEL"),applicationNumber:null==_?void 0:_.edcrNumber,info:p("EDCR_SCRUTINY_NUMBER_LABEL"),successful:!0,infoStyles:{fontSize:"18px",lineHeight:"21px",fontWeight:"bold",textAlign:"center",padding:"0px 15px"},applicationNumberStyles:{fontSize:"24px",lineHeight:"28px",fontWeight:"bold",marginTop:"10px"},style:{width:"100%",padding:"10px"}}),l.createElement(o.CardText,{style:{padding:"0px 8px",marginBottom:"10px"}},`${p("PDF_STATIC_LABEL_CONSOLIDATED_BILL_CONSUMER_ID_TL")} - ${null==_?void 0:_.applicationNumber}`),l.createElement("div",{className:"primary-label-btn d-grid",style:{marginLeft:"unset",marginBottom:"10px",padding:"0px 8px"},onClick:y},l.createElement("svg",{width:"20",height:"23",viewBox:"0 0 20 23",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l.createElement("path",{d:"M19.3334 8H14V0H6.00002V8H0.666687L10 17.3333L19.3334 8ZM0.666687 20V22.6667H19.3334V20H0.666687Z",fill:"#a82227"})),p("EDCR_DOWNLOAD_SCRUTINY_REPORT_LABEL")),l.createElement("div",{style:{padding:"0px 10px"}},l.createElement(i.Link,{to:{pathname:`/digit-ui/citizen/obps/${null==g||null===(d=g.linkData)||void 0===d||null===(s=d.flow)||void 0===s?void 0:s.toLowerCase()}/${null==_||null===(c=_.appliactionType)||void 0===c?void 0:c.toLowerCase()}/${null==_||null===(v=_.applicationSubType)||void 0===v?void 0:v.toLowerCase()}/docs-required`,state:g},replace:!0},l.createElement(o.SubmitBar,{label:p("BPA_APPLY_FOR_BPA_LABEL"),onSubmit:()=>sessionStorage.setItem("clickOnBPAApplyAfterEDCR",!0)}),l.createElement(o.CardText,{className:"button-sub-text",style:{fontSize:"14px",lineHeight:"16px",textAlign:"center",margin:"0px",marginTop:"4px",fontWeight:"400",color:"#0B0C0C"}},p("BPA_FOR_NEW_CONSTRUCTION_LABEL"))),l.createElement("div",{style:{marginTop:"12px",paddingBottom:"10px"}},l.createElement(i.Link,{to:"/digit-ui/citizen"},l.createElement(o.LinkButton,{label:p("CORE_COMMON_GO_TO_HOME")}))))):l.createElement(o.Card,{style:{padding:"0px"}},l.createElement(o.Banner,{message:p("EDCR_ACKNOWLEDGEMENT_REJECTED_MESSAGE_LABEL"),applicationNumber:"",info:"",successful:!1,infoStyles:{fontSize:"18px",lineHeight:"21px",fontWeight:"bold",textAlign:"center",padding:"0px 15px"},applicationNumberStyles:{fontSize:"24px",lineHeight:"28px",fontWeight:"bold",marginTop:"10px"},style:{width:"100%",padding:"10px"}}),l.createElement(o.CardText,{style:{padding:"0px 8px",marginBottom:"10px"}},p("EDCR_ACKNOWLEDGEMENT_REJECTED_MESSAGE_TEXT_LABEL")),l.createElement(o.CardText,{style:{padding:"0px 8px",marginBottom:"10px"}},`${p("PDF_STATIC_LABEL_CONSOLIDATED_BILL_CONSUMER_ID_TL")} - ${null==_?void 0:_.applicationNumber}`),l.createElement("div",{className:"primary-label-btn d-grid",style:{marginLeft:"unset",marginBottom:"10px",padding:"0px 8px"},onClick:y},l.createElement("svg",{width:"20",height:"23",viewBox:"0 0 20 23",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l.createElement("path",{d:"M19.3334 8H14V0H6.00002V8H0.666687L10 17.3333L19.3334 8ZM0.666687 20V22.6667H19.3334V20H0.666687Z",fill:"#a82227"})),p("EDCR_DOWNLOAD_SCRUTINY_REPORT_LABEL")),l.createElement("div",{style:{padding:"10px",paddingBottom:"10px"}},l.createElement(i.Link,{to:"/digit-ui/citizen"},l.createElement(o.SubmitBar,{label:p("CORE_COMMON_GO_TO_HOME")})))))},OCEDCRAcknowledgement:e=>{var a,r,u,d,s,c,v;const{t:p}=n.useTranslation(),[m,E]=(i.useHistory(),t.useState(!1));var f;if(t.useEffect(()=>{var t;"ERROR"!=(null==e||null===(t=e.data)||void 0===t?void 0:t.type)||m||E(!0)},[null==e||null===(a=e.data)||void 0===a?void 0:a.data]),"ERROR"==(null==e||null===(r=e.data)||void 0===r?void 0:r.type))return l.createElement(o.Card,{style:{padding:"0px"}},l.createElement(o.Banner,{message:p("CS_BPA_APPLICATION_FAILED"),applicationNumber:"",info:"",successful:!1,infoStyles:{fontSize:"18px",lineHeight:"21px",fontWeight:"bold",textAlign:"center",padding:"0px 15px"},applicationNumberStyles:{fontSize:"24px",lineHeight:"28px",fontWeight:"bold",marginTop:"10px"},style:{width:"100%",padding:"10px"}}),l.createElement("div",{style:{padding:"10px",paddingBottom:"10px"}},l.createElement(i.Link,{to:"/digit-ui/citizen"},l.createElement(o.SubmitBar,{label:p("CORE_COMMON_GO_TO_HOME")}))),m?l.createElement(o.Toast,{error:"error",label:p(null==e||null===(f=e.data)||void 0===f?void 0:f.data),onClose:()=>E(null),isDleteBtn:!0}):null);sessionStorage.setItem("isEDCRDisable",JSON.stringify(!0)),sessionStorage.setItem("isPermitApplication",!0);const _=null==e||null===(u=e.data)||void 0===u?void 0:u[0],[g,A]=t.useState({}),S=Digit.ULBService.getStateId(),{data:h,isLoading:b}=Digit.Hooks.obps.useMDMS(S,"BPA",["homePageUrlLinks"]);Digit.Hooks.obps.useMDMS(S,"BPA",["RiskTypeComputation"]),t.useEffect(()=>{var e,t,l,n;!b&&(null==h||null===(e=h.BPA)||void 0===e||null===(t=e.homePageUrlLinks)||void 0===t?void 0:t.length)>0&&(null==h||null===(l=h.BPA)||void 0===l||null===(n=l.homePageUrlLinks)||void 0===n||n.map(e=>{(null==e?void 0:e.applicationType)===(null==_?void 0:_.appliactionType)&&(null==e?void 0:e.serviceType)===(null==_?void 0:_.applicationSubType)&&A({linkData:e,edcrNumber:null==_?void 0:_.edcrNumber})}))},[!b]);const y=function(){try{var e=window.open(_.planReport,"_blank");return e&&e.focus(),Promise.resolve()}catch(e){return Promise.reject(e)}};return l.createElement("div",null,"Accepted"==(null==_?void 0:_.status)?l.createElement(o.Card,{style:{padding:"0px"}},l.createElement(o.Banner,{message:p("BPA_OC_EDCR_ACKNOWLEDGEMENT_SUCCESS_MESSAGE_LABEL"),applicationNumber:null==_?void 0:_.edcrNumber,info:p("EDCR_SCRUTINY_NUMBER_LABEL"),successful:!0,infoStyles:{fontSize:"18px",lineHeight:"21px",fontWeight:"bold",textAlign:"center",padding:"0px 15px"},applicationNumberStyles:{fontSize:"24px",lineHeight:"28px",fontWeight:"bold",marginTop:"10px"},style:{width:"100%",padding:"10px"}}),l.createElement(o.CardText,{style:{padding:"0px 8px",marginBottom:"10px"}},`${p("PDF_STATIC_LABEL_CONSOLIDATED_BILL_CONSUMER_ID_TL")} - ${null==_?void 0:_.applicationNumber}`),l.createElement("div",{className:"primary-label-btn d-grid",style:{marginLeft:"unset",marginBottom:"10px",padding:"0px 8px"},onClick:y},l.createElement("svg",{width:"20",height:"23",viewBox:"0 0 20 23",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l.createElement("path",{d:"M19.3334 8H14V0H6.00002V8H0.666687L10 17.3333L19.3334 8ZM0.666687 20V22.6667H19.3334V20H0.666687Z",fill:"#a82227"})),p("EDCR_DOWNLOAD_SCRUTINY_REPORT_LABEL")),l.createElement("div",{style:{padding:"0px 10px"}},l.createElement(i.Link,{to:{pathname:`/digit-ui/citizen/obps/${null==g||null===(d=g.linkData)||void 0===d||null===(s=d.flow)||void 0===s?void 0:s.toLowerCase()}/${null==_||null===(c=_.appliactionType)||void 0===c?void 0:c.toLowerCase()}/${null==_||null===(v=_.applicationSubType)||void 0===v?void 0:v.toLowerCase()}/docs-required`,state:g},replace:!0},l.createElement(o.SubmitBar,{label:p("BPA_APPLY_OC_FOR_BPA_LABEL"),className:"oc-aknowledgement-screen",onSubmit:()=>sessionStorage.setItem("clickOnBPAApplyAfterEDCR",!0)}))),l.createElement("div",{style:{marginTop:"12px",paddingBottom:"10px",paddingLeft:"10px"}},l.createElement(i.Link,{to:"/digit-ui/citizen"},l.createElement(o.LinkButton,{label:p("CORE_COMMON_GO_TO_HOME")})))):l.createElement(o.Card,{style:{padding:"0px"}},l.createElement(o.Banner,{message:p("BPA_OC_EDCR_ACKNOWLEDGEMENT_REJECTED_MESSAGE_LABEL"),applicationNumber:"",info:"",successful:!1,infoStyles:{fontSize:"18px",lineHeight:"21px",fontWeight:"bold",textAlign:"center",padding:"0px 15px"},applicationNumberStyles:{fontSize:"24px",lineHeight:"28px",fontWeight:"bold",marginTop:"10px"},style:{width:"100%",padding:"10px"}}),l.createElement(o.CardText,{style:{padding:"0px 8px",marginBottom:"10px"}},p("EDCR_ACKNOWLEDGEMENT_REJECTED_MESSAGE_TEXT_LABEL")),l.createElement(o.CardText,{style:{padding:"0px 8px",marginBottom:"10px"}},`${p("PDF_STATIC_LABEL_CONSOLIDATED_BILL_CONSUMER_ID_TL")} - ${null==_?void 0:_.applicationNumber}`),l.createElement("div",{className:"primary-label-btn d-grid",style:{marginLeft:"unset",marginBottom:"10px",padding:"0px 8px"},onClick:y},l.createElement("svg",{width:"20",height:"23",viewBox:"0 0 20 23",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l.createElement("path",{d:"M19.3334 8H14V0H6.00002V8H0.666687L10 17.3333L19.3334 8ZM0.666687 20V22.6667H19.3334V20H0.666687Z",fill:"#a82227"})),p("EDCR_DOWNLOAD_SCRUTINY_REPORT_LABEL")),l.createElement("div",{style:{padding:"10px",paddingBottom:"10px",paddingLeft:"10px"}},l.createElement(i.Link,{to:"/digit-ui/citizen"},l.createElement(o.SubmitBar,{label:p("CORE_COMMON_GO_TO_HOME")})))))},BPAAcknowledgement:e=>{var a,r,u,d,s,c;let{data:v,onSuccess:p}=e;const{t:m}=n.useTranslation(),E=Digit.ULBService.getCurrentTenantId(),f=Digit.Hooks.obps.useObpsAPI(null!=v&&null!==(a=v.address)&&void 0!==a&&a.city?null===(r=v.address)||void 0===r||null===(u=r.city)||void 0===u?void 0:u.code:E,!0),_=Digit.Hooks.obps.useObpsAPI(null!=v&&null!==(d=v.address)&&void 0!==d&&d.city?null===(s=v.address)||void 0===s||null===(c=s.city)||void 0===c?void 0:c.code:E,!1),{data:g}=Digit.Hooks.useStore.getInitData(),{tenants:A}=g||{};return t.useEffect(()=>{try{var e,t,l,n;let i=null!=v&&null!==(e=v.address)&&void 0!==e&&e.city?null===(t=v.address)||void 0===t||null===(l=t.city)||void 0===l?void 0:l.code:E;v.tenantId=i;let o={};null==v||null===(n=v.nocDocuments)||void 0===n||n.NocDetails.map(e=>{o=At(e,v),f.mutate(o,{onSuccess:p})}),o=Dt(v),_.mutate(o,{onSuccess:p}),sessionStorage.removeItem("Malbafees"),sessionStorage.removeItem("WaterCharges"),sessionStorage.removeItem("GaushalaFees"),sessionStorage.removeItem("LabourCess"),sessionStorage.removeItem("otherCharges"),sessionStorage.removeItem("lessAdjusment"),sessionStorage.removeItem("development")}catch(e){}},[]),_.isLoading||_.isIdle?l.createElement(o.Loader,null):l.createElement(o.Card,null,l.createElement(Ta,{t:m,data:_.data,isSuccess:_.isSuccess,isLoading:_.isIdle||_.isLoading}),_.isSuccess&&l.createElement(o.CardText,null,((e,t)=>{var l,n,i,o,a,r,u,d,s,c,v;const p=null==t||null===(l=t.BPA)||void 0===l?void 0:l[0];let m=null!=t&&null!==(n=t.BPA)&&void 0!==n&&null!==(i=n[0])&&void 0!==i&&i.businessService?null==t||null===(o=t.BPA)||void 0===o||null===(a=o[0])||void 0===a?void 0:a.businessService:"BPA",E=null==p?void 0:p.status;return"BPA_LOW"==m&&(m="BPA"),e("BPA_SUBMIT_APP"==(sessionStorage.getItem("BPA_SUBMIT_APP")?JSON.parse(sessionStorage.getItem("BPA_SUBMIT_APP")):null)?`BPA_SUBMIT_SUB_HEADER_${m}_${null==p||null===(r=p.workflow)||void 0===r?void 0:r.action}_${null!=p&&null!==(u=p.additionalDetails)&&void 0!==u&&u.typeOfArchitect?null==p||null===(d=p.additionalDetails)||void 0===d?void 0:d.typeOfArchitect:"ARCHITECT"}_${ft(E," ","_").toUpperCase()}`:`BPA_SUB_HEADER_${m}_${null==p||null===(s=p.workflow)||void 0===s?void 0:s.action}_${null!=p&&null!==(c=p.additionalDetails)&&void 0!==c&&c.typeOfArchitect?null==p||null===(v=p.additionalDetails)||void 0===v?void 0:v.typeOfArchitect:"ARCHITECT"}_${ft(E," ","_").toUpperCase()}`)})(m,_.data)),!_.isSuccess&&l.createElement(o.CardText,null,m("CS_FILE_PROPERTY_FAILED_RESPONSE")),l.createElement(i.Link,{to:{pathname:"/digit-ui/citizen"}},l.createElement(o.SubmitBar,{label:m("CORE_COMMON_GO_TO_HOME")})),_.isSuccess&&l.createElement("div",{style:{marginTop:"10px"}},l.createElement(o.SubmitBar,{label:m("CS_COMMON_DOWNLOAD"),onSubmit:function(){try{const e=v,t=A.find(t=>t.code===e.tenantId);return Promise.resolve(function(e,t,l){try{var n,i,o,a,r,u,d,s,c,v,p,m,E,f,_,g,A,S,h,b,y,C,T,D,N,P,I,L,B,O,R,w,x,M,F,k,U,H,W,j,$,Y,z,G,K,V,q,X,J,Z,Q,ee,te,le,ne,ie,oe,ae,re,ue,de,se,ce,ve,pe,me,Ee,fe,_e;const Ae=Digit.UserService.getUser();return console.log("application",e),Promise.resolve({t:l,tenantId:null==t?void 0:t.code,name:`${l(null==t?void 0:t.i18nKey)} ${ge=l("ULBGRADE_"+(null==t||null===(n=t.city)||void 0===n?void 0:n.ulbGrade.toUpperCase().replace(" ","_").replace(".","_"))),ge.toLowerCase().split(" ").map(Uo).join(" ")}`,email:null==t?void 0:t.emailId,phoneNumber:null==t?void 0:t.contactNumber,heading:l("NEW_BUILD_PERMIT_APPLICATION"),applicationNumber:(null==e?void 0:e.applicationNo)||"NA",details:[{title:l("BPA_BASIC_DETAILS_TITLE"),values:[{title:(null==e?void 0:e.businessService)!==l("BPA_OC")?l("BPA_EDCR_NO_LABEL"):l("BPA_OC_EDCR_NO_LABEL"),value:(null==e?void 0:e.edcrNumber)||"NA"},{title:l("BPA_BASIC_DETAILS_APP_DATE_LABEL"),value:Digit.DateUtils.ConvertTimestampToDate(null==e||null===(i=e.auditDetails)||void 0===i?void 0:i.createdTime,"dd/MM/yyyy")||"NA"},{title:l("BPA_BASIC_DETAILS_APPLICATION_TYPE_LABEL"),value:l("WF_BPA_"+(null==e||null===(o=e.data)||void 0===o||null===(a=o.edcrDetails)||void 0===a?void 0:a.appliactionType))||"NA"},{title:l("BPA_BASIC_DETAILS_SERVICE_TYPE_LABEL"),value:l(""+(null==e||null===(r=e.data)||void 0===r||null===(u=r.edcrDetails)||void 0===u?void 0:u.applicationSubType))||"NA"},{title:l("BPA_BASIC_DETAILS_OCCUPANCY_LABEL"),value:null==e||null===(d=e.data)||void 0===d||null===(s=d.edcrDetails)||void 0===s||null===(c=s.planDetail)||void 0===c||null===(v=c.planInformation)||void 0===v?void 0:v.occupancy},{title:l("BPA_BASIC_DETAILS_RISK_TYPE_LABEL"),value:l("WF_BPA_"+(null==e?void 0:e.riskType))||"NA"}]},{title:l("BPA_PLOT_DETAILS_TITLE"),values:[{title:l("BPA_BOUNDARY_PLOT_AREA_LABEL"),value:(null==e||null===(p=e.data)||void 0===p||null===(m=p.edcrDetails)||void 0===m||null===(E=m.planDetail)||void 0===E||null===(f=E.planInformation)||void 0===f?void 0:f.plotArea)+" sq mtrs"||"NA"},{title:l("BPA_PLOT_NUMBER_LABEL"),value:(null==e||null===(_=e.data)||void 0===_||null===(g=_.edcrDetails)||void 0===g||null===(A=g.planDetail)||void 0===A||null===(S=A.planInformation)||void 0===S?void 0:S.plotNo)||"NA"},{title:l("BPA_KHATHA_NUMBER_LABEL"),value:(null==e||null===(h=e.data)||void 0===h||null===(b=h.edcrDetails)||void 0===b||null===(y=b.planDetail)||void 0===y||null===(C=y.planInformation)||void 0===C?void 0:C.khataNo)||"NA"},{title:l("BPA_HOLDING_NUMBER_LABEL"),value:(null==e||null===(T=e.additionalDetails)||void 0===T?void 0:T.holdingNo)||"NA"},{title:l("BPA_BOUNDARY_LAND_REG_DETAIL_LABEL"),value:(null==e||null===(D=e.additionalDetails)||void 0===D?void 0:D.registrationDetails)||"NA"},{title:l("BPA_APPLICATION_DEMOLITION_AREA_LABEL"),value:l((null==e||null===(N=e.data)||void 0===N||null===(P=N.edcrDetails)||void 0===P||null===(I=P.planDetail)||void 0===I||null===(L=I.planInformation)||void 0===L?void 0:L.demolitionArea)+" sq mtrs")||"NA"},{title:l("BPA_WARD_NUMBER_LABEL"),value:(null==e||null===(B=e.additionalDetails)||void 0===B?void 0:B.wardnumber)||"NA"},{title:l("BPA_KHASRA_NUMBER_LABEL"),value:(null==e||null===(O=e.additionalDetails)||void 0===O?void 0:O.khasraNumber)||"NA"}]},{title:l("BPA_APPLICANT_DETAILS_HEADER"),values:[{title:l("CORE_COMMON_NAME"),value:(null==e||null===(R=e.landInfo)||void 0===R||null===(w=R.owners[0])||void 0===w?void 0:w.name)||"NA"},{title:l("BPA_APPLICANT_GENDER_LABEL"),value:(null==e||null===(x=e.landInfo)||void 0===x||null===(M=x.owners[0])||void 0===M?void 0:M.gender)||"NA"},{title:l("CORE_COMMON_MOBILE_NUMBER"),value:(null==e||null===(F=e.landInfo)||void 0===F||null===(k=F.owners[0])||void 0===k?void 0:k.mobileNumber)||"NA"},{title:l("CORE_COMMON_EMAIL_ID"),value:(null==e||null===(U=e.landInfo)||void 0===U||null===(H=U.owners[0])||void 0===H?void 0:H.emailId)||"NA"},{title:l("BPA_IS_PRIMARY_OWNER_LABEL"),value:(null==e||null===(W=e.landInfo)||void 0===W||null===(j=W.owners[0])||void 0===j?void 0:j.isPrimaryOwner)||"NA"}]},{title:l("BPA_ARCHITECT_DETAILS"),values:[{title:l("BPA_ARCHITECT_NAME"),value:(null==Ae||null===($=Ae.info)||void 0===$?void 0:$.name)||"NA"},{title:l("BPA_ARCHITECT_MOBILE_NUMBER"),value:(null==Ae||null===(Y=Ae.info)||void 0===Y?void 0:Y.mobileNumber)||"NA"},{title:l("BPA_ARCHITECT_ID"),value:(null==e||null===(z=e.additionalDetails)||void 0===z?void 0:z.architectid)||"NA"},{title:l("BPA_ARCHITECT_EMAIL"),value:(null==Ae||null===(G=Ae.info)||void 0===G?void 0:G.emailId)||"NA"}]},{title:l("BPA_NEW_TRADE_DETAILS_HEADER_DETAILS"),values:[{title:l("BPA_DETAILS_PIN_LABEL"),value:(null==e||null===(K=e.landInfo)||void 0===K||null===(V=K.address)||void 0===V?void 0:V.pincode)||"NA"},{title:l("BPA_CITY_LABEL"),value:(null==e||null===(q=e.landInfo)||void 0===q||null===(X=q.address)||void 0===X?void 0:X.city)||"NA"},{title:l("BPA_LOC_MOHALLA_LABEL"),value:(null==e||null===(J=e.landInfo)||void 0===J||null===(Z=J.address)||void 0===Z||null===(Q=Z.locality)||void 0===Q?void 0:Q.name)||"NA"},{title:l("BPA_DETAILS_SRT_NAME_LABEL"),value:(null==e||null===(ee=e.landInfo)||void 0===ee||null===(te=ee.address)||void 0===te?void 0:te.street)||"NA"},{title:l("ES_NEW_APPLICATION_LOCATION_LANDMARK"),value:(null==e||null===(le=e.landInfo)||void 0===le||null===(ne=le.address)||void 0===ne?void 0:ne.landmark)||"NA"}]},{title:l("BPA_COLONY_DETAILS"),values:[{title:l("BPA_APPROVED_COLONY"),value:(null==e||null===(ie=e.additionalDetails)||void 0===ie?void 0:ie.approvedColony)||"NA"},{title:l("BPA_MASTER_PLAN"),value:(null==e||null===(oe=e.additionalDetails)||void 0===oe?void 0:oe.masterPlan)||"NA"},{title:l("BPA_DISTRICT"),value:(null==e||null===(ae=e.additionalDetails)||void 0===ae?void 0:ae.District)||"NA"},{title:l("BPA_ULB_NAME"),value:(null==e||null===(re=e.additionalDetails)||void 0===re?void 0:re.UlbName)||"NA"},{title:l("BPA_BUILDING_STATUS"),value:(null==e||null===(ue=e.additionalDetails)||void 0===ue?void 0:ue.buildingStatus)||"NA"},{title:l("BPA_SCHEMES"),value:(null==e||null===(de=e.additionalDetails)||void 0===de?void 0:de.schemes)||"NA"},{title:l("BPA_SCHEMES_TYPE"),value:(null==e||null===(se=e.additionalDetails)||void 0===se?void 0:se.schemesselection)||"NA"},{title:l("BPA_PURCHASED_FAR"),value:(null==e||null===(ce=e.additionalDetails)||void 0===ce?void 0:ce.purchasedFAR)||"NA"},{title:l("BPA_GREEN_BUIDINGS"),value:(null==e||null===(ve=e.additionalDetails)||void 0===ve?void 0:ve.greenbuilding)||"NA"},{title:l("BPA_RESTRICTED_AREA"),value:(null==e||null===(pe=e.additionalDetails)||void 0===pe?void 0:pe.restrictedArea)||"NA"},{title:l("BPA_PROPOSED_SITE_TYPE"),value:(null==e||null===(me=e.additionalDetails)||void 0===me?void 0:me.proposedSite)||"NA"},{title:l("BPA_CORE_AREA"),value:(null==e||null===(Ee=e.data)||void 0===Ee||null===(fe=Ee.edcrDetails)||void 0===fe||null===(_e=fe.planDetail)||void 0===_e?void 0:_e.coreArea)||"NA"}]}]})}catch(e){return Promise.reject(e)}var ge}(e,t,m)).then(function(e){Digit.Utils.pdf.generate(e)})}catch(e){return Promise.reject(e)}}})))},OCBPAAcknowledgement:e=>{let{data:a,onSuccess:r}=e;const{t:u}=n.useTranslation(),d=Digit.ULBService.getCurrentTenantId(),s=Digit.Hooks.obps.useObpsAPI(null!=a&&a.tenantId?null==a?void 0:a.tenantId:d,!0),c=Digit.Hooks.obps.useObpsAPI(null!=a&&a.tenantId?null==a?void 0:a.tenantId:d,!1);return Digit.Hooks.useStore.getInitData(),t.useEffect(()=>{try{var e;a.tenantId=null==a?void 0:a.tenantId;let t={};null==a||null===(e=a.nocDocuments)||void 0===e||e.NocDetails.map(e=>{t=At(e,a),s.mutate(t,{onSuccess:r})}),t=Dt(a,!0),c.mutate(t,{onSuccess:r})}catch(e){}},[]),c.isLoading||c.isIdle?l.createElement(o.Loader,null):l.createElement(o.Card,null,l.createElement(Pa,{t:u,data:c.data,isSuccess:c.isSuccess,isLoading:c.isIdle||c.isLoading}),c.isSuccess&&l.createElement(o.CardText,null,((e,t)=>{var l,n,i,o,a,r,u,d,s,c,v;const p=null==t||null===(l=t.BPA)||void 0===l?void 0:l[0];let m=null!=t&&null!==(n=t.BPA)&&void 0!==n&&null!==(i=n[0])&&void 0!==i&&i.businessService?null==t||null===(o=t.BPA)||void 0===o||null===(a=o[0])||void 0===a?void 0:a.businessService:"BPA",E=null==p?void 0:p.status;return"BPA_LOW"==m&&(m="BPA"),"BPA_SUBMIT_APP"==(sessionStorage.getItem("BPA_SUBMIT_APP")?JSON.parse(sessionStorage.getItem("BPA_SUBMIT_APP")):null)&&e(`BPA_SUBMIT_SUB_HEADER_${m}_${null==p||null===(r=p.workflow)||void 0===r?void 0:r.action}_${null!=p&&null!==(u=p.additionalDetails)&&void 0!==u&&u.typeOfArchitect?null==p||null===(d=p.additionalDetails)||void 0===d?void 0:d.typeOfArchitect:"ARCHITECT"}_${ft(E," ","_").toUpperCase()}`),e(`BPA_SUB_HEADER_${m}_${null==p||null===(s=p.workflow)||void 0===s?void 0:s.action}_${null!=p&&null!==(c=p.additionalDetails)&&void 0!==c&&c.typeOfArchitect?null==p||null===(v=p.additionalDetails)||void 0===v?void 0:v.typeOfArchitect:"ARCHITECT"}_${ft(E," ","_").toUpperCase()}`)})(u,c.data)),!c.isSuccess&&l.createElement(o.CardText,null,u(Digit.Utils.locale.getTransformedLocale(c.error.message))),l.createElement(i.Link,{to:{pathname:"/digit-ui/citizen"}},l.createElement(o.SubmitBar,{label:u("CORE_COMMON_GO_TO_HOME")})))},OCSendBackAcknowledgement:e=>{var t,a,r;const u=null==e?void 0:e.data,{t:d}=n.useTranslation();let s=sessionStorage.getItem("BPA_SUBMIT_APP")?JSON.parse(sessionStorage.getItem("BPA_SUBMIT_APP")):null,c=null!=u&&u.businessService?null==u?void 0:u.businessService:"BPA",v=null==u?void 0:u.status,p=null!=u&&null!==(t=u.workflow)&&void 0!==t&&t.action?null==u||null===(a=u.workflow)||void 0===a?void 0:a.action:"VERIFY_FORWARD",m=null==u||null===(r=u.additionalDetails)||void 0===r?void 0:r.typeOfArchitect;return"BPA_LOW"==c&&(c="BPA"),l.createElement("div",null,l.createElement(o.Card,null,l.createElement(o.Banner,{message:d("BPA_SUBMIT_APP"==s?`BPA_SUBMIT_HEADER_${c}_${p}_${ft(v," ","_").toUpperCase()}`:`BPA_HEADER_${c}_${p}_${ft(v," ","_").toUpperCase()}`),applicationNumber:null==u?void 0:u.applicationNo,info:d("BPA"==c?"BPA_PERMIT_APPLICATION_NUMBER_LABEL":"BPA_OCCUPANCY_CERTIFICATE_APPLICATION_NUMBER_LABEL"),successful:!0,style:{padding:"10px"},headerStyles:{fontSize:"32px"}}),l.createElement(o.CardText,null,d("BPA_SUBMIT_APP"==s?`BPA_SUBMIT_SUB_HEADER_${c}_${p}_${m||"ARCHITECT"}_${ft(v," ","_").toUpperCase()}`:`BPA_SUB_HEADER_${c}_${p}_${m||"ARCHITECT"}_${ft(v," ","_").toUpperCase()}`)),l.createElement("div",{style:{marginTop:"12px",padding:"10px"}},l.createElement(i.Link,{to:"/digit-ui/citizen"},l.createElement(o.SubmitBar,{label:d("CORE_COMMON_GO_TO_HOME")})))))},StakeholderAcknowledgement:e=>{var a,r,u,d,s,c,v,p,m,E;let{data:f,onSuccess:_}=e;const{t:g}=n.useTranslation(),{id:A}=i.useParams(),S=Digit.ULBService.getCurrentTenantId(),h=Digit.Hooks.obps.useStakeholderAPI(null!=f&&null!==(a=f.address)&&void 0!==a&&a.city?null===(r=f.address)||void 0===r||null===(u=r.city)||void 0===u?void 0:u.code:S,!0),{data:b}=Digit.Hooks.useStore.getInitData(),{tenants:y}=b||{};let C=window.location.href.includes("openlink");Digit.Utils.browser.isMobile();const T=(null==h||null===(d=h.data)||void 0===d||null===(s=d.Licenses)||void 0===s||null===(c=s[0])||void 0===c||null===(v=c.tradeLicenseDetail)||void 0===v||null===(p=v.tradeUnits)||void 0===p||null===(m=p[0])||void 0===m||null===(E=m.tradeType)||void 0===E?void 0:E.split(".")[0])||"ARCHITECT";t.useEffect(()=>{try{var e,t,l,n;let i=null!=f&&null!==(e=f.result)&&void 0!==e&&null!==(t=e.Licenses[0])&&void 0!==t&&t.tenantId?null==f||null===(l=f.result)||void 0===l||null===(n=l.Licenses[0])||void 0===n?void 0:n.tenantId:i;f.tenantId=i;let o={};o=(e=>{var t,l,n,i,o,a,r,u,d,s,c,v,p,m,E,f,_,g,A,S,h,b,y,C,T,D,N,P,I,L,B,O,R,w,x,M,F,k,U,H,W;return{Licenses:[{...null==e||null===(t=e.result)||void 0===t?void 0:t.Licenses[0],action:"APPLY",tradeLicenseDetail:{...null==e||null===(l=e.result)||void 0===l||null===(n=l.Licenses[0])||void 0===n?void 0:n.tradeLicenseDetail,additionalDetail:{counsilForArchNo:null==e||null===(i=e.formData)||void 0===i||null===(o=i.LicneseType)||void 0===o?void 0:o.ArchitectNo,isSelfCertificationRequired:null==e||null===(a=e.formData)||void 0===a||null===(r=a.LicneseType)||void 0===r?void 0:r.selfCertification},tradeUnits:[{...null==e||null===(u=e.result)||void 0===u||null===(d=u.Licenses[0])||void 0===d||null===(s=d.tradeLicenseDetail)||void 0===s||null===(c=s.tradeUnits)||void 0===c?void 0:c[0],tradeType:null==e||null===(v=e.formData)||void 0===v||null===(p=v.LicneseType)||void 0===p||null===(m=p.LicenseType)||void 0===m?void 0:m.tradeType,id:null==e||null===(E=e.result)||void 0===E||null===(f=E.Licenses[0])||void 0===f||null===(_=f.tradeLicenseDetail)||void 0===_||null===(g=_.tradeUnits)||void 0===g||null===(A=g[0])||void 0===A?void 0:A.id}],owners:[{...null==e||null===(S=e.result)||void 0===S||null===(h=S.Licenses[0])||void 0===h||null===(b=h.tradeLicenseDetail)||void 0===b||null===(y=b.owners)||void 0===y?void 0:y[0],gender:null==e||null===(C=e.formData)||void 0===C||null===(T=C.LicneseDetails)||void 0===T||null===(D=T.gender)||void 0===D?void 0:D.code,mobileNumber:null==e||null===(N=e.formData)||void 0===N||null===(P=N.LicneseDetails)||void 0===P?void 0:P.mobileNumber,name:null==e||null===(I=e.formData)||void 0===I||null===(L=I.LicneseDetails)||void 0===L?void 0:L.name,dob:null,emailId:null==e||null===(B=e.formData)||void 0===B||null===(O=B.LicneseDetails)||void 0===O?void 0:O.email,permanentAddress:null==e||null===(R=e.formData)||void 0===R||null===(w=R.LicneseDetails)||void 0===w?void 0:w.PermanentAddress,correspondenceAddress:null==e?void 0:e.Correspondenceaddress,pan:null==e||null===(x=e.formData)||void 0===x||null===(M=x.LicneseDetails)||void 0===M?void 0:M.PanNumber,uuid:null==e||null===(F=e.result)||void 0===F||null===(k=F.Licenses[0])||void 0===k||null===(U=k.tradeLicenseDetail)||void 0===U||null===(H=U.owners)||void 0===H||null===(W=H[0])||void 0===W?void 0:W.uuid}],applicationDocuments:Nt(e)}}]}})(f),h.mutate(o,{onSuccess:_})}catch(e){}},[]);const D=null==S?void 0:S.split(".")[0],{data:N}=(Digit.Hooks.useWorkflowDetails({tenantId:null==S?void 0:S.split(".")[0],id:A,moduleCode:"BPAREG"}),Digit.Hooks.obps.useLicenseDetails(D,{applicationNumber:A,tenantId:D},{}));return h.isLoading||h.isIdle?l.createElement(o.Loader,null):l.createElement("div",null,l.createElement("div",{className:C?"OpenlinkContainer":""},C&&l.createElement(o.BackButton,{style:{border:"none"}},g("CS_COMMON_BACK")),l.createElement(o.Card,null,l.createElement(Ba,{t:g,data:h.data,isSuccess:h.isSuccess,isLoading:h.isIdle||h.isLoading}),h.isSuccess&&l.createElement(o.CardText,null,`${g("TRADELICENSE_TRADETYPE_"+T)}${g("CS_FILE_STAKEHOLDER_RESPONSE")}`),!h.isSuccess&&l.createElement(o.CardText,null,g("CS_FILE_PROPERTY_FAILED_RESPONSE")),h.isSuccess&&!C&&l.createElement(i.Link,{to:{pathname:`/digit-ui/citizen/payment/collect/${h.data.Licenses[0].businessService}/${h.data.Licenses[0].applicationNumber}/${h.data.Licenses[0].tenantId}?tenantId=${h.data.Licenses[0].tenantId}`,state:{tenantId:h.data.Licenses[0].tenantId}}},l.createElement(o.SubmitBar,{label:g("COMMON_MAKE_PAYMENT")})),h.isSuccess&&l.createElement("div",{style:{marginTop:"10px"}},l.createElement(o.SubmitBar,{label:g("CS_COMMON_DOWNLOAD"),onSubmit:function(){try{const e=N;console.log("applicationDetails in StakeholderAck",N),console.log("tenants",y);const t=y.find(t=>t.code===e.tenantId);return Promise.resolve(function(e,t,l){try{var n,i,o,a,r,u,d,s,c,v,p,m,E,f,_,g,A,S,h,b,y,C,T,D,N,P,I,L,B,O,R,w,x;return console.log("application in getAcknowledgement",e),Promise.resolve({t:l,tenantId:null==t?void 0:t.code,name:`${l(null==t?void 0:t.i18nKey)} ${M=l("ULBGRADE_"+(null==t||null===(n=t.city)||void 0===n?void 0:n.ulbGrade.toUpperCase().replace(" ","_").replace(".","_"))),M.toLowerCase().split(" ").map(Ia).join(" ")}`,email:null==t?void 0:t.emailId,phoneNumber:null==t?void 0:t.contactNumber,heading:l("NEW_STAKEHOLDER_REGISTRATION"),applicationNumber:(null==e||null===(i=e.applicationData)||void 0===i?void 0:i.applicationNumber)||"NA",details:[{title:l("CS_APPLICATION_DETAILS"),values:[{title:l("REGISTRATION_FILED_DATE"),value:Digit.DateUtils.ConvertTimestampToDate(null==e||null===(o=e.applicationData)||void 0===o||null===(a=o.auditDetails)||void 0===a?void 0:a.createdTime,"dd/MM/yyyy")||"NA"}]},{title:l("BPA_LICENSE_DETAILS_LABEL"),values:[{title:l("BPA_LICENSE_TYPE"),value:l(""+(null==e||null===(r=e.applicationDetails)||void 0===r||null===(u=r[1])||void 0===u||null===(d=u.values[0])||void 0===d?void 0:d.value))||"NA"},{title:l("BPA_COUNCIL_NUMBER"),value:(null==e||null===(s=e.applicationDetails)||void 0===s||null===(c=s[1])||void 0===c||null===(v=c.values[1])||void 0===v?void 0:v.value)||"NA"},{title:l("BPA_LICENSE_TYPE"),value:(null==e||null===(p=e.applicationData)||void 0===p||null===(m=p.tradeLicenseDetail)||void 0===m||null===(E=m.tradeUnits)||void 0===E?void 0:E.tradeType)||"NA"},{}]},{title:l("BPA_LICENSEE_DETAILS_HEADER_OWNER_INFO"),values:[{title:l("BPA_APPLICANT_NAME_LABEL"),value:(null==e||null===(f=e.applicationData)||void 0===f||null===(_=f.tradeLicenseDetail)||void 0===_||null===(g=_.owners)||void 0===g||null===(A=g[0])||void 0===A?void 0:A.name)||"NA"},{title:l("BPA_OWNER_MOBILE_NO_LABEL"),value:(null==e||null===(S=e.applicationData)||void 0===S||null===(h=S.tradeLicenseDetail)||void 0===h||null===(b=h.owners)||void 0===b||null===(y=b[0])||void 0===y?void 0:y.mobileNumber)||"NA"},{title:l("BPA_APPLICANT_GENDER_LABEL"),value:(null==e||null===(C=e.applicationDetails)||void 0===C||null===(T=C[2])||void 0===T||null===(D=T.values[1])||void 0===D?void 0:D.value)||"NA"},{title:l("BPA_APPLICANT_EMAIL_LABEL"),value:(null==e||null===(N=e.applicationDetails)||void 0===N||null===(P=N[2])||void 0===P||null===(I=P.values[3])||void 0===I?void 0:I.value)||"NA"},{}]},{title:l("BPA_NEW_ADDRESS_HEADER_DETAILS"),values:[{title:l("BPA_PERMANANT_ADDRESS_LABEL"),value:(null==e||null===(L=e.applicationDetails)||void 0===L||null===(B=L[3])||void 0===B||null===(O=B.values[0])||void 0===O?void 0:O.value)||"NA"},{title:l("BPA_APPLICANT_CORRESPONDENCE_ADDRESS_LABEL"),value:(null==e||null===(R=e.applicationDetails)||void 0===R||null===(w=R[4])||void 0===w||null===(x=w.values[0])||void 0===x?void 0:x.value)||"NA"},{}]}]})}catch(e){return Promise.reject(e)}var M}(e,t,g)).then(function(e){Digit.Utils.pdf.generate(e)})}catch(e){return Promise.reject(e)}}})),!C&&l.createElement(i.Link,{to:"/digit-ui/citizen"},l.createElement(o.LinkButton,{label:g("CORE_COMMON_GO_TO_HOME")})),h.isSuccess&&C&&l.createElement(i.Link,{to:{pathname:"/digit-ui/citizen"}},l.createElement(o.SubmitBar,{label:g("BPA_COMMON_PROCEED_NEXT")})))))},ObpsCreateEDCR:e=>{var o,a,r,d;const s=u.useQueryClient(),c=i.useRouteMatch(),{t:v}=n.useTranslation(),p=(i.useLocation(),i.useHistory());let m=[];const[E,f,_]=Digit.Hooks.useSessionStorage("EDCR_CREATE",{}),[g,A]=t.useState(null),[S,h]=t.useState(!1);Digit.SessionStorage.set("EDCR_BACK","IS_EDCR_BACK");const b=Digit.ULBService.getStateId();let{data:y}=Digit.Hooks.obps.SearchMdmsTypes.getFormConfig(b,[]);function C(e,t,l,n){var i,o,a,r,u,d,s,c,v;h(!0);const m=Digit.UserService.getUser(),E={id:null==m||null===(i=m.info)||void 0===i?void 0:i.uuid,tenantId:null==m||null===(o=m.info)||void 0===o?void 0:o.tenantId};let _={transactionNumber:"",edcrNumber:"",planFile:null,tenantId:"",RequestInfo:{apiId:"",ver:"",ts:"",action:"",did:"",authToken:"",key:"",msgId:"",correlationId:"",userInfo:E}};console.log(E,m,"USER INFO");const g=null==t?void 0:t.applicantName,S="SCHEME_AREA"===(null==t||null===(a=t.areaType)||void 0===a?void 0:a.code)?"NO":null==t||null===(r=t.coreArea)||void 0===r?void 0:r.code,b=null==t?void 0:t.file,y=null==E?void 0:E.tenantId,C=null==t?void 0:t.ulb,T=null==t||null===(u=t.areaType)||void 0===u?void 0:u.code,D=null==t?void 0:t.schName,N="YES"===(null==t||null===(d=t.siteReserved)||void 0===d?void 0:d.code),P="YES"===(null==t||null===(s=t.approvedCS)||void 0===s?void 0:s.code),I="YES"===(null==t||null===(c=t.cluApprove)||void 0===c?void 0:c.code),L=null==t||null===(v=t.schemeArea)||void 0===v?void 0:v.code,B=gt();console.log("tenantIdInEDCR",y),console.log("tenantIdInEDCR-DATA",t),_={..._,tenantId:y},_={..._,transactionNumber:B},_={..._,applicantName:g},_={..._,coreArea:S},_={..._,appliactionType:"BUILDING_PLAN_SCRUTINY"},_={..._,applicationSubType:"NEW_CONSTRUCTION"},_={..._,applicationSubType:"NEW_CONSTRUCTION"},_={..._,ulb:C},_={..._,areaType:T},_={..._,schName:D},_={..._,siteReserved:N},_={..._,approvedCS:P},_={..._,schemeArea:L},_={..._,cluApprove:I},console.log("tenantIdInEDCR-Request",_);let O=new FormData;O.append("edcrRequest",JSON.stringify(_)),O.append("planFile",b),Digit.EDCRService.create({data:O},y).then((e,t)=>{var l,n,i,o,a,r;h(!1),null!=e&&null!==(l=e.data)&&void 0!==l&&l.edcrDetail&&(console.log("result?.data",null==e?void 0:e.data),sessionStorage.setItem("plotArea",(null==e||null===(n=e.data)||void 0===n||null===(i=n.edcrDetail[0].planDetail)||void 0===i||null===(o=i.plot)||void 0===o?void 0:o.area)||0),f(null==e||null===(a=e.data)||void 0===a?void 0:a.edcrDetail),p.replace("/digit-ui/citizen/obps/edcrscrutiny/apply/acknowledgement",{data:null==e||null===(r=e.data)||void 0===r?void 0:r.edcrDetail}))}).catch(e=>{var t,l,n,i,o,a,r,u;f({data:null!=e&&null!==(t=e.response)&&void 0!==t&&null!==(l=t.data)&&void 0!==l&&l.errorCode?null==e||null===(n=e.response)||void 0===n||null===(i=n.data)||void 0===i?void 0:i.errorCode:"BPA_INTERNAL_SERVER_ERROR",type:"ERROR"}),h(!1),A({key:!0,label:null!=e&&null!==(o=e.response)&&void 0!==o&&null!==(a=o.data)&&void 0!==a&&a.errorCode?null==e||null===(r=e.response)||void 0===r||null===(u=r.data)||void 0===u?void 0:u.errorCode:"BPA_INTERNAL_SERVER_ERROR"})})}const T=()=>{},D=()=>{};y=null!==(o=y)&&void 0!==o&&o.EdcrConfig?null===(a=y)||void 0===a?void 0:a.EdcrConfig:ql,y.forEach(e=>{m=m.concat(e.body.filter(e=>!e.hideInCitizen))}),m.indexRoute="home";const N=null===(r=Digit)||void 0===r||null===(d=r.ComponentRegistryService)||void 0===d?void 0:d.getComponent("EDCRAcknowledgement");return l.createElement(i.Switch,null,m.map((e,t)=>{const{component:n,texts:o,inputs:a,key:r}=e,u="string"==typeof n?Digit.ComponentRegistryService.getComponent(n):n;return l.createElement(i.Route,{path:`${c.path}/${e.route}`,key:t},l.createElement(u,{config:{texts:o,inputs:a,key:r},onSelect:C,onSkip:T,t:v,formData:E,onAdd:D,isShowToast:g,isSubmitBtnDisable:S,setIsShowToast:A}))}),l.createElement(i.Route,{path:c.path+"/acknowledgement"},l.createElement(N,{data:E,onSuccess:()=>{sessionStorage.removeItem("CurrentFinancialYear"),s.invalidateQueries("TL_CREATE_TRADE")}})),l.createElement(i.Route,null,l.createElement(i.Redirect,{to:`${c.path}/${m.indexRoute}`})))},ObpsCreateOCEDCR:e=>{var o,a,r,d;const s=u.useQueryClient(),c=i.useRouteMatch(),{t:v}=n.useTranslation(),{pathname:p}=i.useLocation(),{path:m}=i.useRouteMatch(),E=i.useHistory();let f=[];const[_,g,A]=Digit.Hooks.useSessionStorage("OC_EDCR_CREATE",{}),[S,h]=t.useState(null),[b,y]=t.useState(!1);Digit.SessionStorage.set("EDCR_BACK","IS_EDCR_BACK");const C=Digit.ULBService.getStateId();let{data:T}=Digit.Hooks.obps.SearchMdmsTypes.getFormConfig(C,[]);const D=(e,t,l,n)=>{n?function(e,t,l,n){var i,o,a,r,u,d,s,c;y(!0);const v=_,p=Digit.UserService.getUser();let m={transactionNumber:"",edcrNumber:"",planFile:null,tenantId:"",RequestInfo:{apiId:"",ver:"",ts:"",action:"",did:"",authToken:"",key:"",msgId:"",correlationId:"",userInfo:{id:null==p||null===(i=p.info)||void 0===i?void 0:i.uuid,tenantId:null==p||null===(o=p.info)||void 0===o?void 0:o.tenantId}}};const f=gt(),A=null==v||null===(a=v.ScrutinyDetails)||void 0===a?void 0:a.edcrNumber,S=null==v||null===(r=v.ScrutinyDetails)||void 0===r?void 0:r.tenantId,b=null==v||null===(u=v.ScrutinyDetails)||void 0===u?void 0:u.applicantName,C=Pt(null==v||null===(d=v.ScrutinyDetails)||void 0===d?void 0:d.ocPermitdate),T=null==v||null===(s=v.ScrutinyDetails)||void 0===s?void 0:s.ocPermitNumber,D=null==v||null===(c=v.ScrutinyDetails)||void 0===c?void 0:c.edcrNumber,N=null==t?void 0:t.file;m={...m,transactionNumber:f},m={...m,edcrNumber:A},m={...m,tenantId:S},m={...m,applicantName:b},m={...m,appliactionType:"BUILDING_OC_PLAN_SCRUTINY"},m={...m,applicationSubType:"NEW_CONSTRUCTION"},m={...m,permitDate:C},m={...m,permitNumber:T},m={...m,comparisonEdcrNumber:D};let P=new FormData;P.append("edcrRequest",JSON.stringify(m)),P.append("planFile",N),Digit.EDCRService.create({data:P},S).then((e,t)=>{var l,n,i;y(!1),null!=e&&null!==(l=e.data)&&void 0!==l&&l.edcrDetail&&(g(null==e||null===(n=e.data)||void 0===n?void 0:n.edcrDetail),E.replace("/digit-ui/citizen/obps/edcrscrutiny/oc-apply/acknowledgement",{data:null==e||null===(i=e.data)||void 0===i?void 0:i.edcrDetail}))}).catch(e=>{var t,l,n,i,o,a,r,u;g({data:null!=e&&null!==(t=e.response)&&void 0!==t&&null!==(l=t.data)&&void 0!==l&&l.errorCode?null==e||null===(n=e.response)||void 0===n||null===(i=n.data)||void 0===i?void 0:i.errorCode:"BPA_INTERNAL_SERVER_ERROR",type:"ERROR"}),y(!1),h({key:!0,label:null!=e&&null!==(o=e.response)&&void 0!==o&&null!==(a=o.data)&&void 0!==a&&a.errorCode?null==e||null===(r=e.response)||void 0===r||null===(u=r.data)||void 0===u?void 0:u.errorCode:"BPA_INTERNAL_SERVER_ERROR"})})}(0,t):g({..._,[e]:{..._[e],...t}}),l||(e=>{const t=p.split("/").pop(),{nextStep:l}=f.find(e=>e.route===t);let n=E.push;if(null===l)return n(m+"/check");n(`${m}/${l}`)})()},N=()=>{},P=()=>{};T=null!==(o=T)&&void 0!==o&&o.OCEdcrConfig?null===(a=T)||void 0===a?void 0:a.OCEdcrConfig:Xl,T.forEach(e=>{f=f.concat(e.body.filter(e=>!e.hideInCitizen))}),f.indexRoute="docs-required";const I=null===(r=Digit)||void 0===r||null===(d=r.ComponentRegistryService)||void 0===d?void 0:d.getComponent("OCEDCRAcknowledgement");return l.createElement(i.Switch,null,f.map((e,t)=>{const{component:n,texts:o,inputs:a,key:r}=e,u="string"==typeof n?Digit.ComponentRegistryService.getComponent(n):n;return l.createElement(i.Route,{path:`${c.path}/${e.route}`,key:t},l.createElement(u,{config:{texts:o,inputs:a,key:r},onSelect:D,onSkip:N,t:v,formData:_,onAdd:P,isShowToast:S,isSubmitBtnDisable:b,setIsShowToast:h}))}),l.createElement(i.Route,{path:c.path+"/acknowledgement"},l.createElement(I,{data:_,onSuccess:()=>{sessionStorage.removeItem("CurrentFinancialYear"),s.invalidateQueries("TL_CREATE_TRADE")}})),l.createElement(i.Route,null,l.createElement(i.Redirect,{to:`${c.path}/${f.indexRoute}`})))},ObpsNewBuildingPermit:()=>{var e,o,a,r,d,s;const c=u.useQueryClient(),{t:v}=n.useTranslation(),{pathname:p,state:m}=(i.useRouteMatch(),i.useLocation()),E=i.useRouteMatch(),f=i.useHistory();i.useLocation(),Digit.SessionStorage.set("OBPS_PT","true"),sessionStorage.removeItem("BPA_SUBMIT_APP"),Digit.ULBService.getCurrentTenantId();const[_,g,A]=Digit.Hooks.useSessionStorage("BUILDING_PERMIT",null!=m&&m.edcrNumber?{data:{scrutinyNumber:{edcrNumber:null==m?void 0:m.edcrNumber}}}:{}),S=Digit.ULBService.getStateId();let{data:h}=Digit.Hooks.obps.SearchMdmsTypes.getFormConfig(S,[]);const b=(e,t,l,n)=>{g(n?t:""===e?{...t}:{..._,[e]:{..._[e],...t}}),(e=>{const t=p.split("/").pop(),{nextStep:l}=Zl.find(e=>e.route===t);let n=f.push;if(null===l)return n(Ql(E.path,E.params)+"/check");n(`${Ql(E.path,E.params)}/${l}`)})()},y=()=>{};let C=[];h=null!==(e=h)&&void 0!==e&&e.BuildingPermitConfig?null===(o=h)||void 0===o?void 0:o.BuildingPermitConfig:Jl,h.forEach(e=>{C=C.concat(e.body.filter(e=>!e.hideInCitizen))}),C.indexRoute="docs-required",t.useEffect(()=>{sessionStorage.getItem("isPermitApplication")&&"true"==sessionStorage.getItem("isPermitApplication")&&(A(),sessionStorage.setItem("isPermitApplication",!1))},[]);const T=null===(a=Digit)||void 0===a||null===(r=a.ComponentRegistryService)||void 0===r?void 0:r.getComponent("BPACheckPage"),D=null===(d=Digit)||void 0===d||null===(s=d.ComponentRegistryService)||void 0===s?void 0:s.getComponent("BPAAcknowledgement");return l.createElement(i.Switch,null,Zl.map((e,t)=>{const{component:n,texts:o,inputs:a,key:r}=e,u="string"==typeof n?Digit.ComponentRegistryService.getComponent(n):n;return l.createElement(i.Route,{path:`${Ql(E.path,E.params)}/${e.route}`,key:t},l.createElement(u,{config:{texts:o,inputs:a,key:r},onSelect:b,onSkip:y,t:v,formData:_}))}),l.createElement(i.Route,{path:Ql(E.path,E.params)+"/check"},l.createElement(T,{onSubmit:function(){try{return f.push(Ql(E.path,E.params)+"/acknowledgement"),Promise.resolve()}catch(e){return Promise.reject(e)}},value:_})),l.createElement(i.Route,{path:Ql(E.path,E.params)+"/acknowledgement"},l.createElement(D,{data:_,onSuccess:()=>{c.invalidateQueries("PT_CREATE_PROPERTY")}})),l.createElement(i.Route,null,l.createElement(i.Redirect,{to:`${Ql(E.path,E.params)}/${C.indexRoute}`})))},ObpsOCBuildingPermit:()=>{var e,o,a,r,d,s;const c=u.useQueryClient(),{t:v}=n.useTranslation(),{pathname:p,state:m}=(i.useRouteMatch(),i.useLocation()),E=i.useHistory(),f=i.useRouteMatch();sessionStorage.removeItem("BPA_SUBMIT_APP"),Digit.ULBService.getCurrentTenantId();const[_,g,A]=Digit.Hooks.useSessionStorage("BUILDING_PERMIT",null!=m&&m.edcrNumber?{data:{scrutinyNumber:{edcrNumber:null==m?void 0:m.edcrNumber}}}:{}),S=Digit.ULBService.getStateId();let{data:h}=Digit.Hooks.obps.SearchMdmsTypes.getFormConfig(S,[]);const b=(e,t,l,n)=>{g(n?t:""===e?{...t}:{..._,[e]:{..._[e],...t}}),(e=>{const t=p.split("/").pop(),{nextStep:l}=C.find(e=>e.route===t);let n=E.push;if(null===l)return n(tn(f.path,f.params)+"/check");n(`${tn(f.path,f.params)}/${l}`)})()},y=()=>{};let C=[];h=null!==(e=h)&&void 0!==e&&e.OCBuildingPermitConfig?null===(o=h)||void 0===o?void 0:o.OCBuildingPermitConfig:en,h.forEach(e=>{C=C.concat(e.body.filter(e=>!e.hideInCitizen))}),C.indexRoute="docs-required",t.useEffect(()=>{sessionStorage.getItem("isPermitApplication")&&"true"==sessionStorage.getItem("isPermitApplication")&&(A(),sessionStorage.setItem("isPermitApplication",!1))},[]);const T=null===(a=Digit)||void 0===a||null===(r=a.ComponentRegistryService)||void 0===r?void 0:r.getComponent("OCBPACheckPage"),D=null===(d=Digit)||void 0===d||null===(s=d.ComponentRegistryService)||void 0===s?void 0:s.getComponent("OCBPAAcknowledgement");return l.createElement(i.Switch,null,C.map((e,t)=>{const{component:n,texts:o,inputs:a,key:r}=e,u="string"==typeof n?Digit.ComponentRegistryService.getComponent(n):n;return l.createElement(i.Route,{path:`${tn(f.path,f.params)}/${e.route}`,key:t},l.createElement(u,{config:{texts:o,inputs:a,key:r},onSelect:b,onSkip:y,t:v,formData:_}))}),l.createElement(i.Route,{path:tn(f.path,f.params)+"/check"},l.createElement(T,{onSubmit:function(){try{return E.push(tn(f.path,f.params)+"/acknowledgement"),Promise.resolve()}catch(e){return Promise.reject(e)}},value:_})),l.createElement(i.Route,{path:tn(f.path,f.params)+"/acknowledgement"},l.createElement(D,{data:_,onSuccess:()=>{c.invalidateQueries("PT_CREATE_PROPERTY")}})),l.createElement(i.Route,null,l.createElement(i.Redirect,{to:`${tn(f.path,f.params)}/${C.indexRoute}`})))},ObpsStakeholderRegistration:()=>{var e,o,a,r,d,s;const c=u.useQueryClient(),{t:v}=n.useTranslation(),{path:p}=i.useRouteMatch(),{pathname:m,state:E}=i.useLocation(),f=i.useHistory(),[_,g,A]=(Digit.ULBService.getCurrentTenantId(),Digit.Hooks.useSessionStorage("BUILDING_PERMIT",null!=E&&E.edcrNumber?{data:{scrutinyNumber:{edcrNumber:null==E?void 0:E.edcrNumber}}}:{})),S=Digit.ULBService.getStateId();let{data:h}=Digit.Hooks.obps.SearchMdmsTypes.getFormConfig(S,[]);const b=(e,t,l,n)=>{g(n?t:""===e?{...t}:{..._,[e]:{..._[e],...t}}),(e=>{const t=m.split("/").pop(),{nextStep:l}=C.find(e=>e.route===t);let n=f.push;if(null===l)return n(p+"/check");n(`${p}/${l}`)})()},y=()=>{};let C=[];h=null!==(e=h)&&void 0!==e&&e.StakeholderConfig?null===(o=h)||void 0===o?void 0:o.StakeholderConfig:ln,h.forEach(e=>{C=C.concat(e.body.filter(e=>!e.hideInCitizen))}),C.indexRoute="stakeholder-docs-required",t.useEffect(()=>{sessionStorage.getItem("isPermitApplication")&&"true"==sessionStorage.getItem("isPermitApplication")&&(A(),sessionStorage.setItem("isPermitApplication",!1))},[]);const T=null===(a=Digit)||void 0===a||null===(r=a.ComponentRegistryService)||void 0===r?void 0:r.getComponent("StakeholderCheckPage"),D=null===(d=Digit)||void 0===d||null===(s=d.ComponentRegistryService)||void 0===s?void 0:s.getComponent("StakeholderAcknowledgement");return console.log("formData in StakeholderRegistration",_),console.log("config in StakeholderRegistration",C),l.createElement(i.Switch,null,C.map((e,t)=>{const{component:n,texts:o,inputs:a,key:r}=e,u="string"==typeof n?Digit.ComponentRegistryService.getComponent(n):n;return l.createElement(i.Route,{path:`${p}/${e.route}`,key:t},l.createElement(u,{config:{texts:o,inputs:a,key:r},onSelect:b,onSkip:y,t:v,formData:_}))}),l.createElement(i.Route,{path:p+"/check"},l.createElement(T,{onSubmit:function(){try{return f.push(p+"/acknowledgement"),Promise.resolve()}catch(e){return Promise.reject(e)}},value:_})),l.createElement(i.Route,{path:p+"/acknowledgement"},l.createElement(D,{data:_,onSuccess:()=>{A(),c.invalidateQueries("PT_CREATE_PROPERTY")}})),l.createElement(i.Route,null,l.createElement(i.Redirect,{to:`${p}/${C.indexRoute}`})))},ObpsCitizenBpaApplicationDetail:()=>{var e,a,r,d,s,v,p,m,E,f,_,g,A,S,h,b,y,C,T,D,N,P,I,L,B,O,R,w,x;const M=function(e,t,l){let{tenantId:n}=e;void 0===l&&(l="download");try{var i,o;let e=new Date;_e.applicationData.additionalDetails.runDate=Pt(e.getFullYear()+"-"+(e.getMonth()+1)+"-"+e.getDate());let D={...null==_e?void 0:_e.applicationData,edcrDetail:[{...null==_e?void 0:_e.edcrDetails}]};const N=Digit.ULBService.getStateId();let P=0;for(let e=0;e<(null===(a=he)||void 0===a||null===(r=a.data)||void 0===r||null===(u=r.processInstances)||void 0===u?void 0:u.length);e++){var a,r,u,d,s,c,v,p,m,E,f,_,g,A,S,h,b,y;"POST_PAYMENT_APPLY"!==(null===(d=he)||void 0===d||null===(s=d.data)||void 0===s||null===(c=s.processInstances[e])||void 0===c?void 0:c.action)&&"PAY"!==(null===(v=he)||void 0===v||null===(p=v.data)||void 0===p||null===(m=p.processInstances[e])||void 0===m?void 0:m.action)||"APPROVAL_INPROGRESS"!==(null===(E=he)||void 0===E||null===(f=E.data)||void 0===f||null===(_=f.processInstances)||void 0===_||null===(g=_[e])||void 0===g||null===(A=g.state)||void 0===A?void 0:A.applicationStatus)||0!=P||(D.additionalDetails.submissionDate=null===(S=he)||void 0===S||null===(h=S.data)||void 0===h||null===(b=h.processInstances[e])||void 0===b||null===(y=b.auditDetails)||void 0===y?void 0:y.createdTime,P=1)}var C;if("NO"==(null==D||null===(i=D.additionalDetails)||void 0===i?void 0:i.approvedColony))D.additionalDetails.permitData="The plot has been officially regularized under No."+(null==D||null===(C=D.additionalDetails)||void 0===C?void 0:C.NocNumber)+" dated dd/mm/yyyy, registered in the name of <name as per the NOC>. This regularization falls within the jurisdiction of "+N+".Any form of misrepresentation of the NoC is strictly prohibited. Such misrepresentation renders the building plan null and void, and it will be regarded as an act of impersonation. Criminal proceedings will be initiated against the owner and concerned architect / engineer/ building designer / supervisor involved in such actions";else if("YES"==(null==D||null===(o=D.additionalDetails)||void 0===o?void 0:o.approvedColony)){var T;D.additionalDetails.permitData="The building plan falls under approved colony "+(null==D||null===(T=D.additionalDetails)||void 0===T?void 0:T.nameofApprovedcolony)}else D.additionalDetails.permitData="The building plan falls under Lal Lakir";return Promise.resolve(Digit.PaymentService.generatePdf(n,{Bpa:[D]},t)).then(function(e){return Promise.resolve(Digit.PaymentService.printReciept(n,{fileStoreIds:e.filestoreIds[0]})).then(function(t){var n,i;return window.open(t[null==e?void 0:e.filestoreIds[0]],"_blank"),D.applicationType=null==_e||null===(n=_e.applicationData)||void 0===n||null===(i=n.additionalDetails)||void 0===i?void 0:i.applicationType,Promise.resolve(Digit.OBPSService.edcr_report_download({BPA:{...D}})).then(function(e){const t=parseInt(e.status,10);201!==t&&200!==t||("print"==l?xt(new Blob([e.data],{type:"application/pdf"})):wt(new Blob([e.data],{type:"application/pdf"}),"edcrReport.pdf"))})})})}catch(e){return Promise.reject(e)}},F=function(e){let{payments:t,...l}=e;try{function n(){return Promise.resolve(Digit.PaymentService.printReciept(W,{fileStoreIds:e.filestoreIds[0]})).then(function(t){var l;window.open(t[null===(l=e)||void 0===l?void 0:l.filestoreIds[0]],"_blank")})}let e=null;const l=function(){if(null==t||!t.fileStoreId)return Promise.resolve(Digit.PaymentService.generatePdf(W,{Payments:[{...t}]},"bpa-receipt")).then(function(t){e=t});e={filestoreIds:[null==t?void 0:t.fileStoreId]}}();return Promise.resolve(l&&l.then?l.then(n):n())}catch(e){return Promise.reject(e)}},{id:k}=i.useParams(),{t:U}=n.useTranslation(),H=Digit.ULBService.getCurrentTenantId(),W=Digit.ULBService.getStateId(),j=window.Digit.Utils.browser.isMobile(),$=u.useQueryClient(),[Y,z]=t.useState(null),[G,K]=t.useState(!1),[V,q]=t.useState(!1),[X,J]=t.useState(!1),[Z,Q]=t.useState(!1),[ee,te]=t.useState(null),[le,ne]=t.useState(!1),[ie,oe]=t.useState(!1),[ae,re]=t.useState(!1),[ue,de]=t.useState(!1);sessionStorage.removeItem("BPA_SUBMIT_APP"),sessionStorage.setItem("isEDCRDisable",JSON.stringify(!0)),sessionStorage.setItem("BPA_IS_ALREADY_WENT_OFF_DETAILS",JSON.stringify(!1));const se=Digit.UserService.getUser(),ce=null==se||null===(e=se.info)||void 0===e?void 0:e.mobileNumber,ve=i.useHistory();sessionStorage.setItem("bpaApplicationDetails",!1);let pe=!1;const{data:me}=Digit.Hooks.obps.useMDMS(W,"StakeholderRegistraition","TradeTypetoRoleMapping"),{isLoading:Ee,data:fe}=Digit.Hooks.obps.useMDMS(W,"BPA",["DocTypeMapping"]),{data:_e,isLoading:ge}=Digit.Hooks.obps.useBPADetailsPage(H,{applicationNo:k});console.log("datata",_e);const{data:Ae}=Digit.Hooks.obps.useMDMS(H.split(".")[0],"BPA",["RiskTypeComputation"]),Se=Digit.Hooks.obps.useObpsAPI(null==_e||null===(a=_e.applicationData)||void 0===a?void 0:a.tenantId,!1);let he=Digit.Hooks.useWorkflowDetails({tenantId:null==_e||null===(r=_e.applicationData)||void 0===r?void 0:r.tenantId,id:k,moduleCode:"OBPS",config:{enabled:!!_e}});const[be,ye]=t.useState(!1),[Ce,Te]=t.useState(!1),[De,Ne]=t.useState(!1),[Pe,Ie]=t.useState(ce||""),[Le,Be]=t.useState(!1),[Oe,Re]=t.useState(""),[we,xe]=t.useState(!1),[Me,Fe]=t.useState(""),[ke,Ue]=t.useState(null),He={username:Pe,password:Oe,tenantId:null==se||null===(d=se.info)||void 0===d?void 0:d.tenantId,userType:null==se||null===(s=se.info)||void 0===s?void 0:s.type},We=10===Pe.length&&/^[0-9]+$/.test(Pe),je=!!sessionStorage.getItem("CitizenConsentdocFilestoreid");t.useEffect(()=>{if(!Ee&&!ge){var e;let v=[];if(null!=fe&&null!==(e=fe.BPA)&&void 0!==e&&e.DocTypeMapping){var t,l,n,i,o,a,r,u,d,s,c;v=null==fe||null===(t=fe.BPA)||void 0===t||null===(l=t.DocTypeMapping)||void 0===l?void 0:l.filter(e=>{var t,l,n,i,o;return"INPROGRESS"==e.WFState&&e.RiskType==(null==_e||null===(t=_e.applicationData)||void 0===t?void 0:t.riskType)&&e.ServiceType==(null==_e||null===(l=_e.applicationData)||void 0===l||null===(n=l.additionalDetails)||void 0===n?void 0:n.serviceType)&&e.applicationType==(null==_e||null===(i=_e.applicationData)||void 0===i||null===(o=i.additionalDetails)||void 0===o?void 0:o.applicationType)});let e=null==_e||null===(n=_e.applicationDetails)||void 0===n||null===(i=n.filter(e=>"BPA_DOCUMENT_DETAILS_LABEL"===e.title)[0])||void 0===i||null===(o=i.additionalDetails)||void 0===o||null===(a=o.obpsDocuments)||void 0===a||null===(r=a[0])||void 0===r?void 0:r.values,p=[];v&&(null===(u=v)||void 0===u||null===(d=u[0])||void 0===d?void 0:d.docTypes)&&(null===(s=v)||void 0===s||null===(c=s[0])||void 0===c||c.docTypes.map(t=>{e&&e.filter(e=>t.code===e.documentType.slice(0,e.documentType.lastIndexOf("."))).map(e=>{p.push(e)})}));const m=null==_e?void 0:_e.applicationDetails.map(e=>"BPA_DOCUMENT_DETAILS_LABEL"===e.title?{...e,additionalDetails:{obpsDocuments:[{title:"",values:p}]}}:e);_e.applicationDetails=[...m]}}},[fe,_e]),t.useEffect(()=>{var e,t;"CITIZEN_APPROVAL_INPROCESS"==(null==_e||null===(e=_e.applicationData)||void 0===e?void 0:e.status)||"INPROGRESS"==(null==_e||null===(t=_e.applicationData)||void 0===t?void 0:t.status)?oe(!0):oe(!1)},[_e]);const $e=(e,t)=>e?t?e:U(e):U("NA");t.useEffect(()=>{switch(ee){case"APPROVE":case"SEND_TO_ARCHITECT":case"APPLY":case"SKIP_PAYMENT":case"POST_PAYMENT_APPROVE":case"POST_PAYMENT_APPLY":J(!0)}},[ee]);const Ye=()=>{z(null)};function ze(e){var t;let l="BPA_OC"==(null==_e||null===(t=_e.applicationData)||void 0===t?void 0:t.businessService)?"ocbpa":"bpa";var n,i,o,a,r,u,d;"FORWARD"===e&&ve.replace(`/digit-ui/citizen/obps/sendbacktocitizen/ocbpa/${null==_e||null===(n=_e.applicationData)||void 0===n?void 0:n.tenantId}/${null==_e||null===(i=_e.applicationData)||void 0===i?void 0:i.applicationNo}/check`,{data:null==_e?void 0:_e.applicationData,edcrDetails:null==_e?void 0:_e.edcrDetails}),"PAY"===e&&window.location.assign(`${window.location.origin}/digit-ui/citizen/payment/collect/${Rt(null==_e?void 0:_e.businessService,null==_e?void 0:_e.applicationStatus)}/${k}/${null==_e?void 0:_e.tenantId}?tenantId=${null==_e?void 0:_e.tenantId}`),"SEND_TO_CITIZEN"===e&&((null===(o=he)||void 0===o||null===(a=o.data)||void 0===a||null===(r=a.processInstances)||void 0===r?void 0:r.length)>2?window.location.replace(`/digit-ui/citizen/obps/editApplication/${l}/${null==_e||null===(u=_e.applicationData)||void 0===u?void 0:u.tenantId}/${null==_e||null===(d=_e.applicationData)||void 0===d?void 0:d.applicationNo}`):St(null==_e?void 0:_e.applicationData,Ae,ve,U)),te(e),q(!1)}function Ge(){return!!ie&&(pe?!pe:!G)}const Ke=e=>{var t,l,n,i,o;re(!0);const a=null==_e||null===(t=_e.applicationData)||void 0===t||null===(l=t.documents)||void 0===l?void 0:l.some(e=>"CITIZEN.UNDERTAKING"===e.documentType),r=[...null==_e||null===(n=_e.applicationData)||void 0===n?void 0:n.documents.filter(e=>"CITIZEN.UNDERTAKING"!==e.documentType),...a?null==_e||null===(i=_e.applicationData)||void 0===i?void 0:i.documents.filter(e=>"CITIZEN.UNDERTAKING"===e.documentType):[{documentType:"CITIZEN.UNDERTAKING",fileStoreId:sessionStorage.getItem("CitizenConsentdocFilestoreid"),fileStore:sessionStorage.getItem("CitizenConsentdocFilestoreid")}]],u={...null==_e?void 0:_e.applicationData,documents:r,additionalDetails:{...null==_e||null===(o=_e.applicationData)||void 0===o?void 0:o.additionalDetails,otpVerifiedTimestampcitizen:sessionStorage.getItem("otpVerifiedTimestampcitizen")}};Se.mutate({BPA:{...u,workflow:e}},{onError:(e,t)=>{var l,n,i,o,a,r;re(!1),J(!1),z({key:"error",action:null!=e&&null!==(l=e.response)&&void 0!==l&&null!==(n=l.data)&&void 0!==n&&null!==(i=n.Errors[0])&&void 0!==i&&i.message?null==e||null===(o=e.response)||void 0===o||null===(a=o.data)||void 0===a||null===(r=a.Errors[0])||void 0===r?void 0:r.message:e}),setTimeout(Ye,5e3)},onSuccess:(e,t)=>{re(!1),ve.replace("/digit-ui/citizen/obps/response",{data:e}),J(!1),z({key:"success",action:ee}),setTimeout(Ye,5e3),$.invalidateQueries("BPA_DETAILS_PAGE"),$.invalidateQueries("workFlowDetails")}})};if((null===(v=he)||void 0===v||null===(p=v.data)||void 0===p||null===(m=p.nextActions)||void 0===m?void 0:m.length)>0&&"CITIZEN_APPROVAL_INPROCESS"==(null==_e||null===(E=_e.applicationData)||void 0===E?void 0:E.status)){var Ve,qe,Xe;const e=Digit.UserService.getUser(),t=null==e||null===(Ve=e.info)||void 0===Ve?void 0:Ve.roles;var Je,Ze,Qe;if("CITIZEN_APPROVAL_INPROCESS"==(null==_e||null===(qe=_e.applicationData)||void 0===qe?void 0:qe.status))he.data.nextActions=1==(null==t?void 0:t.length)&&"CITIZEN"==(null==t||null===(Je=t[0])||void 0===Je?void 0:Je.code)?null===(Ze=he)||void 0===Ze||null===(Qe=Ze.data)||void 0===Qe?void 0:Qe.nextActions:[];else if("INPROGRESS"==(null==_e||null===(Xe=_e.applicationData)||void 0===Xe?void 0:Xe.status)){var et,tt;let e=!1;null==me||null===(et=me.StakeholderRegistraition)||void 0===et||null===(tt=et.TradeTypetoRoleMapping)||void 0===tt||tt.map(e=>{var t;null==e||null===(t=e.role)||void 0===t||t.map(e=>{roles.push(e)})});const l=roles.filter((e,t,l)=>l.indexOf(e)===t);var lt,nt;(null==t?void 0:t.length)>1&&t.forEach(t=>{l.includes(t.code)&&(e=!0)}),he.data.nextActions=e?null===(lt=he)||void 0===lt||null===(nt=lt.data)||void 0===nt?void 0:nt.nextActions:[]}}if("SEND_BACK_TO_CITIZEN"===(null===(f=he)||void 0===f||null===(_=f.data)||void 0===_||null===(g=_.processInstances)||void 0===g||null===(A=g[0])||void 0===A?void 0:A.action)){var it;G&&K(!0),pe=!0;const e=Digit.UserService.getUser(),t=null==e||null===(it=e.info)||void 0===it?void 0:it.roles;var ot,at;1!==(null==t?void 0:t.length)&&(he={...he,data:{...null===(ot=he)||void 0===ot?void 0:ot.data,actionState:{nextActions:[]}},data:{...null===(at=he)||void 0===at?void 0:at.data,nextActions:[]}})}if(ge||ae)return l.createElement(o.Loader,null);let rt=[];var ut,dt,st,ct,vt,pt,Et,ft,_t,gt,At,ht,bt;if((null==_e||null===(S=_e.collectionBillDetails)||void 0===S?void 0:S.length)>0&&mt(null==_e?void 0:_e.collectionBillDetails).forEach(e=>{var t,l,n,i,o;"BPA.NC_OC_APP_FEE"===(null==e||null===(t=e.paymentDetails[0])||void 0===t?void 0:t.businessService)&&rt.push({order:1,label:U("BPA_APP_FEE_RECEIPT"),onClick:()=>{var t,l;return F({tenantId:null==_e||null===(t=_e.applicationData)||void 0===t?void 0:t.tenantId,payments:e,consumerCodes:null==_e||null===(l=_e.applicationData)||void 0===l?void 0:l.applicationNo})}}),"BPA.NC_OC_SAN_FEE"===(null==e||null===(l=e.paymentDetails[0])||void 0===l?void 0:l.businessService)&&rt.push({order:2,label:U("BPA_OC_DEV_PEN_RECEIPT"),onClick:()=>{var t,l;return F({tenantId:null==_e||null===(t=_e.applicationData)||void 0===t?void 0:t.tenantId,payments:e,consumerCodes:null==_e||null===(l=_e.applicationData)||void 0===l?void 0:l.applicationNo})}}),"BPA.LOW_RISK_PERMIT_FEE"===(null==e||null===(n=e.paymentDetails[0])||void 0===n?void 0:n.businessService)&&rt.push({order:1,label:U("BPA_FEE_RECEIPT"),onClick:()=>{var t,l;return F({tenantId:null==_e||null===(t=_e.applicationData)||void 0===t?void 0:t.tenantId,payments:e,consumerCodes:null==_e||null===(l=_e.applicationData)||void 0===l?void 0:l.applicationNo})}}),"BPA.NC_APP_FEE"===(null==e||null===(i=e.paymentDetails[0])||void 0===i?void 0:i.businessService)&&rt.push({order:1,label:U("BPA_APP_FEE_RECEIPT"),onClick:()=>{var t,l;return F({tenantId:null==_e||null===(t=_e.applicationData)||void 0===t?void 0:t.tenantId,payments:e,consumerCodes:null==_e||null===(l=_e.applicationData)||void 0===l?void 0:l.applicationNo})}}),"BPA.NC_SAN_FEE"===(null==e||null===(o=e.paymentDetails[0])||void 0===o?void 0:o.businessService)&&rt.push({order:2,label:U("BPA_SAN_FEE_RECEIPT"),onClick:()=>{var t,l;return F({tenantId:null==_e||null===(t=_e.applicationData)||void 0===t?void 0:t.tenantId,payments:e,consumerCodes:null==_e||null===(l=_e.applicationData)||void 0===l?void 0:l.applicationNo})}})}),_e&&"BPA_LOW"===(null==_e||null===(h=_e.applicationData)||void 0===h?void 0:h.businessService)&&(null==_e||null===(b=_e.collectionBillDetails)||void 0===b?void 0:b.length)>0)(null==_e||null===(ut=_e.applicationData)||void 0===ut||!ut.status.includes("REVOCATION"))&&rt.push({order:3,label:U("BPA_PERMIT_ORDER"),onClick:()=>{var e;return M({tenantId:null==_e||null===(e=_e.applicationData)||void 0===e?void 0:e.tenantId},"buildingpermit-low")}}),(null==_e||null===(dt=_e.applicationData)||void 0===dt?void 0:dt.status.includes("REVOCATION"))&&rt.push({order:3,label:U("BPA_REVOCATION_PDF_LABEL"),onClick:()=>{var e;return function(e){let{tenantId:t,...l}=e;try{let e={...null==_e?void 0:_e.applicationData};return Promise.resolve(Digit.PaymentService.generatePdf(t,{Bpa:[e]},"bpa-revocation")).then(function(e){return Promise.resolve(Digit.PaymentService.printReciept(t,{fileStoreIds:e.filestoreIds[0]})).then(function(t){window.open(t[null==e?void 0:e.filestoreIds[0]],"_blank")})})}catch(e){return Promise.reject(e)}}({tenantId:null==_e||null===(e=_e.applicationData)||void 0===e?void 0:e.tenantId})}});else if(_e&&"BPA"===(null==_e||null===(y=_e.applicationData)||void 0===y?void 0:y.businessService)&&(null==_e||null===(C=_e.collectionBillDetails)||void 0===C?void 0:C.length)>0){var yt;"APPROVED"===(null==_e||null===(yt=_e.applicationData)||void 0===yt?void 0:yt.status)&&rt.push({order:3,label:U("BPA_PERMIT_ORDER"),onClick:()=>{var e;return M({tenantId:null==_e||null===(e=_e.applicationData)||void 0===e?void 0:e.tenantId},"buildingpermit")}})}else{var Ct;"APPROVED"===(null==_e||null===(Ct=_e.applicationData)||void 0===Ct?void 0:Ct.status)&&rt.push({order:3,label:U("BPA_OC_CERTIFICATE"),onClick:()=>{var e;return M({tenantId:null==_e||null===(e=_e.applicationData)||void 0===e?void 0:e.tenantId},"occupancy-certificate")}})}null!=_e&&_e.comparisionReport&&rt.push({order:4,label:U("BPA_COMPARISON_REPORT_LABEL"),onClick:()=>{var e;return window.open(null==_e||null===(e=_e.comparisionReport)||void 0===e?void 0:e.comparisonReport,"_blank")}}),rt.sort(function(e,t){return e.order-t.order}),(null===(T=he)||void 0===T||null===(D=T.data)||void 0===D||null===(N=D.nextActions)||void 0===N?void 0:N.length)>0&&(he.data.nextActions=null===(st=he)||void 0===st||null===(ct=st.data)||void 0===ct||null===(vt=ct.nextActions)||void 0===vt?void 0:vt.filter(e=>"INITIATE"!==e.action),he.data.nextActions=null===(pt=he)||void 0===pt||null===(Et=pt.data)||void 0===Et||null===(ft=Et.nextActions)||void 0===ft?void 0:ft.filter(e=>"ADHOC"!==e.action),he.data.nextActions=null===(_t=he)||void 0===_t||null===(gt=_t.data)||void 0===gt||null===(At=gt.nextActions)||void 0===At?void 0:At.filter(e=>"SKIP_PAYMENT"!==e.action)),(null==_e||null===(P=_e.applicationDetails)||void 0===P?void 0:P.length)>0&&(_e.applicationDetails=(null==_e||null===(ht=_e.applicationDetails)||void 0===ht?void 0:ht.length)>0&&(null==_e||null===(bt=_e.applicationDetails)||void 0===bt?void 0:bt.filter(e=>0!==Object.keys(e).length)));const Tt=null==_e||null===(I=_e.applicationDetails)||void 0===I?void 0:I.filter(e=>0!==Object.keys(e).length);return(null==Tt?void 0:Tt.length)>0&&(_e.applicationDetails=Tt),l.createElement(t.Fragment,null,l.createElement("div",{className:"cardHeaderWithOptions",style:{marginRight:"auto",maxWidth:"960px"}},l.createElement(o.Header,{styles:{fontSize:"32px",marginLeft:"10px"}},U("CS_TITLE_APPLICATION_DETAILS")),l.createElement("div",null,rt&&rt.length>0&&l.createElement(o.MultiLink,{className:"multilinkWrapper",onHeadClick:()=>ne(!le),displayOptions:le,options:rt}),l.createElement(o.LinkButton,{label:U("VIEW_TIMELINE"),style:{color:"#A52A2A"},onClick:()=>{const e=document.getElementById("timeline");e&&e.scrollIntoView({behavior:"smooth"}),de(!0)}}))),null==_e||null===(L=_e.applicationDetails)||void 0===L?void 0:L.filter(e=>Object.keys(e).length>0).map((e,n,a)=>{var r,u,d,s,c,v,p,m,E,f,_,g,A,S,h,b,y,C,T,D,N,P,I,L,B,O,R,w,x,M,F,H,W,$,Y,z,X,J,ee,te,le,ne,oe,ae,re,ue,de,se,ce,ve,me,Ee,fe,ge,Ae,Se,ye,Ce,Te,De,Ne,Pe,Ie,Le,Be,Oe,Re,xe,Me,Fe,ke,Ue,He,We,Ye,Ke;return l.createElement("div",null,null!=e&&e.isNotAllowed?null:l.createElement(o.Card,{key:n,style:null!=e&&null!==(r=e.additionalDetails)&&void 0!==r&&r.fiReport||""!==(null==e?void 0:e.title)?{}:{marginTop:"-30px"}},null!=e&&e.isTitleVisible?null:l.createElement(o.CardSubHeader,{style:{fontSize:"24px"}},U(null==e?void 0:e.title)),l.createElement("div",{style:null!=e&&e.isBackGroundColor?{marginTop:"19px",background:"#FAFAFA",border:"1px solid #D6D5D4",borderRadius:"4px",padding:"8px",lineHeight:"19px",maxWidth:"950px",minWidth:"280px"}:{}},l.createElement(o.StatusTable,null,null!=e&&e.isCommon&&(null==e||null===(u=e.values)||void 0===u?void 0:u.length)>0?null==e||null===(d=e.values)||void 0===d?void 0:d.map(e=>l.createElement(o.Row,null!=e&&e.isUnit?{className:"border-none",label:U(null==e?void 0:e.title),text:null!=e&&e.value?`${$e(null==e?void 0:e.value,null==e?void 0:e.isNotTranslated)} ${U(null==e?void 0:e.isUnit)}`:U("CS_NA")}:null!=e&&e.isLink?{className:"border-none",label:U(null==e?void 0:e.title),text:l.createElement("div",null,l.createElement(i.Link,{to:null==e?void 0:e.to},l.createElement("span",{className:"link",style:{color:"#a82227"}},null==e?void 0:e.value)))}:{className:"border-none",label:U(null==e?void 0:e.title),text:$e(null==e?void 0:e.value,null==e?void 0:e.isNotTranslated)||U("CS_NA")})):null,(null==e||!e.isFeeDetails)&&(null==e||null===(s=e.additionalDetails)||void 0===s||null===(c=s.values)||void 0===c?void 0:c.length)>0?null==e||null===(v=e.additionalDetails)||void 0===v||null===(p=v.values)||void 0===p?void 0:p.map(t=>l.createElement("div",null,null!=e&&e.isTitleRepeat||null!=t&&t.isHeader||null!=t&&t.isUnit?null:l.createElement(o.Row,{className:"border-none",label:U(null==t?void 0:t.title),textStyle:"Paid"===(null==t?void 0:t.value)?{color:"darkgreen"}:"Unpaid"===(null==t?void 0:t.value)?{color:"red"}:{},text:null!=t&&t.value?$e(null==t?void 0:t.value,null==t?void 0:t.isNotTranslated):U("CS_NA")}),null!=e&&e.isTitleRepeat||null==t||!t.isUnit?null:l.createElement(o.Row,{className:"border-none",label:U(null==t?void 0:t.title),text:null!=t&&t.value?`${$e(null==t?void 0:t.value,null==t?void 0:t.isNotTranslated)} ${U(null==t?void 0:t.isUnit)}`:U("CS_NA")}),null!=e&&e.isTitleRepeat||null==t||!t.isHeader?null:l.createElement(o.CardSubHeader,{style:{fontSize:"20px"}},U(null==t?void 0:t.title)))):null,null!=e&&e.isSubOccupancyTable&&null!=e&&null!==(m=e.additionalDetails)&&void 0!==m&&m.subOccupancyTableDetails?l.createElement(cn,{edcrDetails:null==e?void 0:e.additionalDetails,applicationData:null==_e?void 0:_e.applicationData}):null,null!=e&&e.isScrutinyDetails&&(null==e||null===(E=e.additionalDetails)||void 0===E||null===(f=E.scruntinyDetails)||void 0===f?void 0:f.length)>0?null==e||null===(_=e.additionalDetails)||void 0===_?void 0:_.scruntinyDetails.map(e=>l.createElement(t.Fragment,null,l.createElement(o.Row,{className:"border-none",label:U(null==e?void 0:e.title)}),l.createElement(o.LinkButton,{onClick:()=>{location.href=null==e?void 0:e.value},label:l.createElement(o.PDFSvg,null)}),l.createElement("p",{style:{marginTop:"8px",marginBottom:"20px",fontWeight:"bold",fontSize:"16px",lineHeight:"19px",color:"#505A5F",fontWeight:"400"}},U(null==e?void 0:e.text)))):null,null!=e&&e.isOwnerDetails&&(null==e||null===(g=e.additionalDetails)||void 0===g||null===(A=g.owners)||void 0===A?void 0:A.length)>0?null==e||null===(S=e.additionalDetails)||void 0===S?void 0:S.owners.map((t,n)=>{var i,a,r,u;return l.createElement("div",{key:n,style:(null==e||null===(i=e.additionalDetails)||void 0===i||null===(a=i.owners)||void 0===a?void 0:a.length)>1?{marginTop:"19px",background:"#FAFAFA",border:"1px solid #D6D5D4",borderRadius:"4px",padding:"8px",lineHeight:"19px",maxWidth:"950px",minWidth:"280px"}:{}},(null==e||null===(r=e.additionalDetails)||void 0===r||null===(u=r.owners)||void 0===u?void 0:u.length)>1?l.createElement(o.Row,{className:"border-none",label:`${U("Owner")} - ${n+1}`}):null,null==t?void 0:t.values.map(e=>l.createElement(o.Row,{className:"border-none",label:U(null==e?void 0:e.title),text:$e(null==e?void 0:e.value,null==e?void 0:e.isNotTranslated)||U("CS_NA")})))}):null,(null==e?void 0:e.isDocumentDetails)&&(null==e||null===(h=e.additionalDetails)||void 0===h||null===(b=h.obpsDocuments)||void 0===b||null===(y=b[0])||void 0===y?void 0:y.values)&&l.createElement("div",{style:{marginTop:"-8px"}},l.createElement(zl,{documents:kt(null==e||null===(C=e.additionalDetails)||void 0===C||null===(T=C.obpsDocuments)||void 0===T||null===(D=T[0])||void 0===D?void 0:D.values),svgStyles:{},isSendBackFlow:!1,isHrLine:!0,titleStyles:{fontSize:"20px",lineHeight:"24px",fontWeight:700,marginBottom:"10px"}})),null!=e&&e.isFieldInspection&&(null==_e||null===(N=_e.applicationData)||void 0===N||null===(P=N.additionalDetails)||void 0===P||null===(I=P.fieldinspection_pending)||void 0===I?void 0:I.length)>0?l.createElement(vn,{isCitizen:!0,fiReport:null==_e||null===(L=_e.applicationData)||void 0===L||null===(B=L.additionalDetails)||void 0===B?void 0:B.fieldinspection_pending}):null,(null==e||null===(O=e.additionalDetails)||void 0===O||null===(R=O.noc)||void 0===R?void 0:R.length)>0?null==e||null===(w=e.additionalDetails)||void 0===w?void 0:w.noc.map((t,n)=>{var i,a,r,u,d,s,c,v,p,m,E,f,_,g,A,S,h,b,y,C,T,D,N,P,I,L,B,O,R,w,x,M,F,k,H,W,j,$,Y,z,G,K;return l.createElement("div",{key:n,style:{marginTop:"19px",background:"#FAFAFA",border:"1px solid #D6D5D4",borderRadius:"4px",padding:"8px",lineHeight:"19px",maxWidth:"960px",minWidth:"280px"}},l.createElement(o.StatusTable,null,l.createElement(o.Row,{className:"border-none",label:U(`BPA_${null==e||null===(i=e.additionalDetails)||void 0===i||null===(a=i.data)||void 0===a?void 0:a.nocType}_HEADER`),labelStyle:{fontSize:"20px"}}),l.createElement(o.Row,{className:"border-none",label:U(""+(null==e||null===(r=e.values)||void 0===r||null===(u=r[0])||void 0===u?void 0:u.title)),textStyle:{marginLeft:"10px"},text:$e(null==e||null===(d=e.values)||void 0===d||null===(s=d[0])||void 0===s?void 0:s.value,null==e||null===(c=e.values)||void 0===c||null===(v=c[0])||void 0===v?void 0:v.isNotTranslated)}),l.createElement(o.Row,{className:"border-none",label:U(""+(null==e||null===(p=e.values)||void 0===p||null===(m=p[1])||void 0===m?void 0:m.title)),textStyle:"APPROVED"==(null==e||null===(E=e.values)||void 0===E||null===(f=E[1])||void 0===f?void 0:f.value)||"AUTO_APPROVED"==(null==e||null===(_=e.values)||void 0===_||null===(g=_[1])||void 0===g?void 0:g.value)?{marginLeft:"10px",color:"#00703C"}:{marginLeft:"10px",color:"#D4351C"},text:$e(null==e||null===(A=e.values)||void 0===A||null===(S=A[1])||void 0===S?void 0:S.value,null==e||null===(h=e.values)||void 0===h||null===(b=h[1])||void 0===b?void 0:b.isNotTranslated)}),null!=e&&null!==(y=e.values)&&void 0!==y&&null!==(C=y[2])&&void 0!==C&&C.value?l.createElement(o.Row,{className:"border-none",label:U(""+(null==e||null===(T=e.values)||void 0===T||null===(D=T[2])||void 0===D?void 0:D.title)),textStyle:{marginLeft:"10px"},text:$e(null==e||null===(N=e.values)||void 0===N||null===(P=N[2])||void 0===P?void 0:P.value,null==e||null===(I=e.values)||void 0===I||null===(L=I[2])||void 0===L?void 0:L.isNotTranslated)}):null,null!=e&&null!==(B=e.values)&&void 0!==B&&null!==(O=B[3])&&void 0!==O&&O.value?l.createElement(o.Row,{className:"border-none",label:U(""+(null==e||null===(R=e.values)||void 0===R||null===(w=R[3])||void 0===w?void 0:w.title)),textStyle:{marginLeft:"10px"},text:$e(null==e||null===(x=e.values)||void 0===x||null===(M=x[3])||void 0===M?void 0:M.value,null==e||null===(F=e.values)||void 0===F||null===(k=F[3])||void 0===k?void 0:k.isNotTranslated)}):null,null!=e&&null!==(H=e.values)&&void 0!==H&&null!==(W=H[3])&&void 0!==W&&W.value?l.createElement(o.Row,{className:"border-none",label:U(""+(null==e||null===(j=e.values)||void 0===j||null===($=j[4])||void 0===$?void 0:$.title)),textStyle:{marginLeft:"10px"},text:$e(null==e||null===(Y=e.values)||void 0===Y||null===(z=Y[4])||void 0===z?void 0:z.value,null==e||null===(G=e.values)||void 0===G||null===(K=G[4])||void 0===K?void 0:K.isNotTranslated)}):null,l.createElement(o.Row,{className:"border-none",label:U(""+(null==t?void 0:t.title))})),l.createElement(o.StatusTable,null,null!=t&&t.values?l.createElement(zl,{documents:kt(null==t?void 0:t.values,!0),svgStyles:{},isSendBackFlow:!1,isHrLine:!0,titleStyles:{fontSize:"18px",lineHeight:"24px",fontWeight:700,marginBottom:"10px"}}):l.createElement("div",null,l.createElement(o.CardText,null,U("BPA_NO_DOCUMENTS_UPLOADED_LABEL")))))}):null,(null==e||!e.isTitleVisible)&&(null==e||null===(x=e.additionalDetails)||void 0===x||null===(M=x.permit)||void 0===M?void 0:M.length)>0?null==e||null===(F=e.additionalDetails)||void 0===F||null===(H=F.permit)||void 0===H?void 0:H.map(e=>l.createElement(o.CardText,null,null==e?void 0:e.title)):null,(null==e||null===(W=e.additionalDetails)||void 0===W?void 0:W.inspectionReport)&&(null==e?void 0:e.isFeeDetails)&&l.createElement(pn,{scrutinyDetails:null==e?void 0:e.additionalDetails,paymentsList:[]}),(null==e||null===($=e.additionalDetails)||void 0===$?void 0:$.inspectionReport)&&(null==e?void 0:e.isFeeDetails)&&("POST_PAYMENT_CITIZEN_APPROVAL_PENDING"==(null===(Y=he)||void 0===Y||null===(z=Y.data)||void 0===z||null===(X=z.actionState)||void 0===X||null===(J=X.nextActions)||void 0===J||null===(ee=J[0])||void 0===ee?void 0:ee.state)||"POST_PAYMENT_CITIZEN_APPROVAL_PENDING"==(null===(te=he)||void 0===te||null===(le=te.data)||void 0===le||null===(ne=le.actionState)||void 0===ne?void 0:ne.state)||"POST_PAYMENT_INPROGRESS"==(null===(oe=he)||void 0===oe||null===(ae=oe.data)||void 0===ae||null===(re=ae.actionState)||void 0===re?void 0:re.state))&&l.createElement("div",{style:{marginTop:"19px",background:"#FAFAFA",border:"1px solid #D6D5D4",borderRadius:"4px",padding:"8px",lineHeight:"19px",maxWidth:"950px",minWidth:"280px"}},l.createElement(o.Row,{className:"border-none",label:U("BLOCKING_REASON"),labelStyle:{fontSize:"15px"},text:(null==_e?void 0:_e.applicationData.additionalDetails.blockingReason)||"NA"}," "))))),n===a.length-1&&l.createElement(o.Card,null,l.createElement(t.Fragment,null,l.createElement("div",{id:"timeline"},l.createElement(nn,{application:null==_e?void 0:_e.applicationData,id:k}),!(null!==(ue=he)&&void 0!==ue&&ue.isLoading)&&(null===(de=he)||void 0===de||null===(se=de.data)||void 0===se||null===(ce=se.nextActions)||void 0===ce?void 0:ce.length)>0&&!pe&&ie&&l.createElement(o.CheckBox,{styles:{margin:"20px 0 40px",paddingTop:"10px"},checked:G,label:l.createElement("div",null,l.createElement("span",null,U("BPA_I_AGREE_THE_LABEL")+" "),l.createElement("span",{style:{color:"#a82227",cursor:"pointer"},onClick:()=>Q(!Z)},U("BPA_TERMS_AND_CONDITIONS_LABEL"))),onChange:()=>{K(!G),G&&q(!G)}})),!(null!==(ve=he)&&void 0!==ve&&ve.isLoading)&&(null===(me=he)||void 0===me||null===(Ee=me.data)||void 0===Ee||null===(fe=Ee.nextActions)||void 0===fe?void 0:fe.length)>1&&l.createElement(o.ActionBar,null,l.createElement("div",{style:{width:"100%"}},V&&null!==(ge=he)&&void 0!==ge&&null!==(Ae=ge.data)&&void 0!==Ae&&Ae.nextActions?l.createElement(o.Menu,{localeKeyPrefix:"WF_BPA",options:null===(Se=he)||void 0===Se||null===(ye=Se.data)||void 0===ye?void 0:ye.nextActions.map(e=>e.action),t:U,onSelect:ze}):null,l.createElement(o.SubmitBar,{disabled:Ge()||"CITIZEN_APPROVAL_PENDING"===(null===(Ce=he)||void 0===Ce||null===(Te=Ce.data)||void 0===Te||null===(De=Te.actionState)||void 0===De?void 0:De.state)&&(!be||!we||!je),label:U("ES_COMMON_TAKE_ACTION"),onSubmit:()=>q(!V)}))),!(null!==(Ne=he)&&void 0!==Ne&&Ne.isLoading)&&1==(null===(Pe=he)||void 0===Pe||null===(Ie=Pe.data)||void 0===Ie||null===(Le=Ie.nextActions)||void 0===Le?void 0:Le.length)&&l.createElement(o.ActionBar,null,l.createElement("div",{style:{width:"100%"}},l.createElement("button",{style:{color:"#FFFFFF",fontSize:j?"19px":"initial"},className:Ge()?"submit-bar-disabled":"submit-bar",disabled:Ge(),name:null===(Be=he)||void 0===Be||null===(Oe=Be.data)||void 0===Oe||null===(Re=Oe.nextActions)||void 0===Re||null===(xe=Re[0])||void 0===xe?void 0:xe.action,value:null===(Me=he)||void 0===Me||null===(Fe=Me.data)||void 0===Fe||null===(ke=Fe.nextActions)||void 0===ke||null===(Ue=ke[0])||void 0===Ue?void 0:Ue.action,onClick:e=>{ze(e.target.value)}},U("WF_BPA_"+(null===(He=he)||void 0===He||null===(We=He.data)||void 0===We||null===(Ye=We.nextActions)||void 0===Ye||null===(Ke=Ye[0])||void 0===Ke?void 0:Ke.action))))))))}),"CITIZEN_APPROVAL_PENDING"===(null===(B=he)||void 0===B||null===(O=B.data)||void 0===O||null===(R=O.actionState)||void 0===R?void 0:R.state)&&l.createElement("div",null,l.createElement(o.Card,null,l.createElement(l.Fragment,null,l.createElement("div",null,l.createElement(o.CardLabel,null,U("ARCHITECT_SHOULD_VERIFY_HIMSELF_BY_CLICKING_BELOW_BUTTON")),l.createElement(o.LinkButton,{label:U("BPA_VERIFY"),onClick:()=>{Ne(!0)}}),l.createElement("br",null),De&&l.createElement(l.Fragment,null,l.createElement("br",null),l.createElement(o.CardLabel,null,U("BPA_MOBILE_NUMBER")),l.createElement(o.TextInput,{t:U,type:"tel",isMandatory:!0,optionKey:"i18nKey",name:"mobileNumber",value:Pe,onChange:e=>{Ie(e.target.value)},required:!0,pattern:"[0-9]{10}",type:"tel",title:U("CORE_COMMON_APPLICANT_MOBILE_NUMBER_INVALID")}),l.createElement(o.LinkButton,{label:U("BPA_GET_OTP"),onClick:function(){try{const e=c(function(){var e,t;return Promise.resolve(Digit.UserService.sendOtp({otp:{mobileNumber:Pe,tenantId:null==se||null===(e=se.info)||void 0===e?void 0:e.tenantId,userType:null==se||null===(t=se.info)||void 0===t?void 0:t.type,type:"login"}})).then(function(e){e.isSuccessful?Be(!0):console.error("Error sending OTP Response is false:",e.error)})},function(e){console.error("Error sending OTP:",e)});return Promise.resolve(e&&e.then?e.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},disabled:!We})),Le&&l.createElement(l.Fragment,null,l.createElement("br",null),l.createElement(o.CardLabel,null,U("BPA_OTP")),l.createElement(o.TextInput,{t:U,type:"text",isMandatory:!0,optionKey:"i18nKey",name:"otp",value:Oe,onChange:e=>{Re(e.target.value)},required:!0,pattern:"[0-9]{6}",type:"tel",title:U("BPA_INVALID_OTP")}),l.createElement(o.SubmitBar,{label:U("VERIFY_OTP"),onSubmit:function(){try{const e=c(function(){return Promise.resolve(Digit.UserService.authenticate(He)).then(function(e){if("Access Token generated successfully"===e.ResponseInfo.status){xe(!0),Fe(U("VERIFIED"));const e=new Date;Ue(e),sessionStorage.setItem("otpVerifiedTimestampcitizen",e.toISOString())}else xe(!1),Fe(U("WRONG OTP"))})},function(e){console.error("Error verifying OTP:",e),xe(!1),Fe(U("Error verifying OTP"))});return Promise.resolve(e&&e.then?e.then(function(){}):void 0)}catch(e){return Promise.reject(e)}}}),Me&&l.createElement(o.CardLabel,{style:{color:"red"}},Me))),l.createElement("br",null),l.createElement("div",null,l.createElement(o.CheckBox,{label:l.createElement("div",null,U("I_AGREE_TO_BELOW_UNDERTAKING"),l.createElement(o.LinkButton,{label:U("DECLARATION_UNDER_SELF_CERTIFICATION_SCHEME"),onClick:()=>{we?Te(!0):alert("Please verify yourself")}})),onChange:()=>{ye(!be)},styles:{height:"auto"}}),Ce&&l.createElement(mn,{showTermsPopup:Ce,setShowTermsPopup:Te,otpVerifiedTimestamp:ke}))))),Z?l.createElement(dn,{t:U,action:"TERMS_AND_CONDITIONS",tenantId:H,id:k,closeModal:()=>{Q(!1)},submitAction:Ke,applicationData:(null==_e?void 0:_e.applicationData)||{}}):null,X?l.createElement(dn,{t:U,action:ee,tenantId:H,id:k,closeModal:()=>{te(null),J(!1)},submitAction:Ke,actionData:null===(w=he)||void 0===w||null===(x=w.data)||void 0===x?void 0:x.timeline}):null,Y&&l.createElement(o.Toast,{error:"error"===Y.key,label:U("success"===Y.key?`ES_OBPS_${Y.action}_UPDATE_SUCCESS`:Y.action),onClose:Ye,style:{zIndex:"1000"}}))},ObpsBPASendToArchitect:e=>{var a,r,d,s,c,v,p;sessionStorage.setItem("BPA_SUBMIT_APP",JSON.stringify("BPA_SUBMIT_APP"));const m=u.useQueryClient(),E=i.useRouteMatch(),{t:f}=n.useTranslation(),{applicationNo:_,tenantId:g}=i.useParams(),{pathname:A}=i.useLocation(),S=i.useHistory();let h=[],b={};const[y,C,T]=Digit.Hooks.useSessionStorage("BUILDING_PERMIT_EDITFLOW",{}),D=Digit.ULBService.getStateId();let{data:N}=Digit.Hooks.obps.SearchMdmsTypes.getFormConfig(D,[]);const{data:P}=Digit.Hooks.obps.useMDMS(Digit.ULBService.getStateId(),"BPA",["RiskTypeComputation"]),{data:I,isLoading:L}=Digit.Hooks.obps.useBPASearch(g,{applicationNo:_});let B={edcrNumber:null==I||null===(a=I[0])||void 0===a?void 0:a.edcrNumber};const{data:O,isLoading:R}=Digit.Hooks.obps.useScrutinyDetails(Digit.ULBService.getStateId(),B,{enabled:!!B.edcrNumber});let w=_;const{data:x,isLoading:M}=Digit.Hooks.obps.useNocDetails(g,{sourceRefId:w}),F=window.location.href.includes("editApplication");t.useEffect(function(){try{let e=sessionStorage.getItem("BPA_IS_ALREADY_WENT_OFF_DETAILS");e=!e||JSON.parse(e);const t=function(){if(!(e||M||L||R)){b=I?I[0]:{};const e=function(){if(O&&x)return b=I[0],F&&(b.isEditApplication=!0),sessionStorage.setItem("bpaInitialObject",JSON.stringify({...b})),Promise.resolve(function(e,t,l,n,i){try{var o,a,r,u,d,s,c,v,p,m,E,f,_,g,A,S,h,b,y,C,T,D,N,P,I,L,B,O,R,w,x,M,F,k,U,H,W;const j=e=>{let t=[],l=[],n={};return e&&e.map((e,o)=>{var a;t=null!=e&&e.usageCategory?null==e||null===(a=e.usageCategory)||void 0===a?void 0:a.split(","):[],l=[],t&&t.map((e,t)=>{l.push({code:e,i18nKey:"BPA_SUBOCCUPANCYTYPE_"+e.replaceAll(".","_"),name:i("BPA_SUBOCCUPANCYTYPE_"+e.replaceAll(".","_"))})}),l&&(n["Block_"+(o+1)]=l)}),n};e.BlockIds=(e=>{let t={};return e&&e.map((e,l)=>{t["Block_"+(l+1)]=e.id}),t})(null==e||null===(o=e.landInfo)||void 0===o?void 0:o.unit),e.address=null==e||null===(a=e.landInfo)||void 0===a?void 0:a.address,e.address.city={code:null==e||null===(r=e.landInfo)||void 0===r||null===(u=r.address)||void 0===u?void 0:u.city,name:null==e||null===(d=e.landInfo)||void 0===d||null===(s=d.address)||void 0===s||null===(c=s.city)||void 0===c?void 0:c.split(".")[1]},e.address.locality={...null==e||null===(v=e.landInfo)||void 0===v||null===(p=v.address)||void 0===p?void 0:p.locality,i18nkey:null==e||null===(m=e.landInfo)||void 0===m||null===(E=m.address)||void 0===E||null===(f=E.locality)||void 0===f?void 0:f.name},e.data={applicantName:null==t||null===(_=t.planDetail)||void 0===_||null===(g=_.planInformation)||void 0===g?void 0:g.applicantName,applicationDate:null==e||null===(A=e.auditDetails)||void 0===A?void 0:A.createdTime,applicationType:null==t?void 0:t.appliactionType,holdingNumber:null==e||null===(S=e.additionalDetails)||void 0===S?void 0:S.holdingNo,boundaryWallLength:null==e||null===(h=e.additionalDetails)||void 0===h?void 0:h.boundaryWallLength,occupancyType:null==t||null===(b=t.planDetail)||void 0===b||null===(y=b.planInformation)||void 0===y?void 0:y.occupancy,registrationDetails:null==e||null===(C=e.additionalDetails)||void 0===C?void 0:C.registrationDetails,riskType:Digit.Utils.obps.calculateRiskType(null==l||null===(T=l.BPA)||void 0===T?void 0:T.RiskTypeComputation,null==t||null===(D=t.planDetail)||void 0===D||null===(N=D.plot)||void 0===N?void 0:N.area,null==t||null===(P=t.planDetail)||void 0===P?void 0:P.blocks),serviceType:(null==e||null===(I=e.additionalDetails)||void 0===I?void 0:I.serviceType)||(null==t?void 0:t.applicationSubType),scrutinyNumber:{edcrNumber:null==e?void 0:e.edcrNumber}},e.PrevStateDocuments=null==e?void 0:e.documents,e.documents={documents:[]};let $=[];return n&&n.map((e,t)=>{e.documents&&e.documents.map((e,t)=>{$.push(e)})}),e.PrevStateNocDocuments=$,e.nocDocuments={NocDetails:n,nocDocuments:[]},null==e||e.landInfo.owners.map((e,t)=>{e.gender={active:!0,code:e.gender,i18nKey:"COMMON_GENDER_"+e.gender}}),e.owners={owners:null==e||null===(L=e.landInfo)||void 0===L?void 0:L.owners,ownershipCategory:{active:!0,code:null==e||null===(B=e.landInfo)||void 0===B?void 0:B.ownershipCategory,i18nKey:"COMMON_MASTERS_OWNERSHIPCATEGORY_"+(null==e||null===(O=e.landInfo)||void 0===O?void 0:O.ownershipCategory.replaceAll(".","_"))}},e.riskType=Digit.Utils.obps.calculateRiskType(null==l||null===(R=l.BPA)||void 0===R?void 0:R.RiskTypeComputation,null==t||null===(w=t.planDetail)||void 0===w||null===(x=w.plot)||void 0===x?void 0:x.area,null==t||null===(M=t.planDetail)||void 0===M?void 0:M.blocks),e.subOccupancy=j(null==e||null===(F=e.landInfo)||void 0===F?void 0:F.unit),e.uiFlow={flow:null==e||null===(k=e.businessService)||void 0===k||null===(U=k.split("."))||void 0===U?void 0:U[0],applicationType:(null==e||null===(H=e.additionalDetails)||void 0===H?void 0:H.applicationType)||(null==t?void 0:t.appliactionType),serviceType:(null==e||null===(W=e.additionalDetails)||void 0===W?void 0:W.serviceType)||(null==t?void 0:t.applicationSubType)},sessionStorage.setItem("BPA_IS_ALREADY_WENT_OFF_DETAILS",JSON.stringify(!0)),Promise.resolve(e)}catch(e){return Promise.reject(e)}}(b,O,P,x,f)).then(function(e){C({...y,...e})})}();if(e&&e.then)return e.then(function(){})}}();return Promise.resolve(t&&t.then?t.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},[I,O,P,x,y]);const k=(e,t,l,n)=>{C(n?t:{...y,[e]:{...y[e],...t}}),(e=>{var t;const l=null==A||null===(t=A.split("/"))||void 0===t?void 0:t.pop(),{nextStep:n}=h.find(e=>e.route===l);let i=S.push;if(null===n)return i(En(E.path,E.params)+"/check");i(`${En(E.path,E.params)}/${n}`)})()},U=()=>{};N=null!==(r=N)&&void 0!==r&&r.BuildingPermitConfig?null===(d=N)||void 0===d?void 0:d.BuildingPermitConfig:Jl,N.forEach(e=>{h=h.concat(e.body.filter(e=>!e.hideInCitizen))}),h.indexRoute="check",t.useEffect(()=>{sessionStorage.getItem("isPermitApplication")&&"true"==sessionStorage.getItem("isPermitApplication")&&(T(),sessionStorage.setItem("isPermitApplication",!1))},[]);const H=null===(s=Digit)||void 0===s||null===(c=s.ComponentRegistryService)||void 0===c?void 0:c.getComponent("BPACheckPage"),W=null===(v=Digit)||void 0===v||null===(p=v.ComponentRegistryService)||void 0===p?void 0:p.getComponent("BPAAcknowledgement");return M||L||R?l.createElement(o.Loader,null):l.createElement(i.Switch,null,h.map((e,t)=>{const{component:n,texts:o,inputs:a,key:r}=e,u="string"==typeof n?Digit.ComponentRegistryService.getComponent(n):n;return l.createElement(i.Route,{path:`${En(E.path,E.params)}/${e.route}`,key:t},l.createElement(u,{config:{texts:o,inputs:a,key:r},onSelect:k,onSkip:U,t:f,formData:y}))}),l.createElement(i.Route,{path:En(E.path,E.params)+"/check"},l.createElement(H,{onSubmit:function(){try{return S.push(En(E.path,E.params)+"/acknowledgement"),Promise.resolve()}catch(e){return Promise.reject(e)}},value:y})),l.createElement(i.Route,{path:En(E.path,E.params)+"/acknowledgement"},l.createElement(W,{data:y,onSuccess:()=>{m.invalidateQueries("PT_CREATE_PROPERTY")}})),l.createElement(i.Route,null,O&&l.createElement(i.Redirect,{to:`${En(E.path,E.params)}/${h.indexRoute}`})))},ObpsOCSendToArchitect:e=>{var a,r,d,s,c,v,p,m;sessionStorage.setItem("BPA_SUBMIT_APP",JSON.stringify("BPA_SUBMIT_APP"));const E=u.useQueryClient(),f=i.useRouteMatch(),{t:_}=n.useTranslation(),{applicationNo:g,tenantId:A}=i.useParams(),{pathname:S}=i.useLocation(),h=i.useHistory();let b=[],y={};const[C,T,D]=Digit.Hooks.useSessionStorage("OC_BUILDING_PERMIT_EDITFLOW",{}),N=Digit.ULBService.getStateId();let{data:P}=Digit.Hooks.obps.SearchMdmsTypes.getFormConfig(N,[]);const{data:I}=Digit.Hooks.obps.useMDMS(Digit.ULBService.getStateId(),"BPA",["RiskTypeComputation"]),{data:L,isLoading:B}=Digit.Hooks.obps.useBPASearch(A,{applicationNo:g});let O={edcrNumber:null==L||null===(a=L[0])||void 0===a?void 0:a.edcrNumber};const{data:R,isLoading:w}=Digit.Hooks.obps.useScrutinyDetails(Digit.ULBService.getStateId(),O,{enabled:!(null==L||null===(r=L[0])||void 0===r||!r.edcrNumber)});let x=null==R?void 0:R.permitNumber;const{data:M}=Digit.Hooks.obps.useOCEdcrSearch(A,{approvalNo:x},{enabled:!(!x||null==R||!R.permitNumber)},O);let F=g;const{data:k,isLoading:U}=Digit.Hooks.obps.useNocDetails(A,{sourceRefId:F}),H=window.location.href.includes("editApplication");JSON.parse(sessionStorage.getItem("tl-trade")),t.useEffect(function(){try{let e=sessionStorage.getItem("BPA_IS_ALREADY_WENT_OFF_DETAILS");e=!e||JSON.parse(e);const t=function(){if(!(e||U||B||w)){y=L?L[0]:{};const e=function(){if(R&&M)return y=L[0],H&&(y.isEditApplication=!0),sessionStorage.setItem("bpaInitialObject",JSON.stringify({...y})),Promise.resolve(function(e,t,l,n,i,o){try{var a,r,u,d,s,c,v,p,m,E,f,_,g,A,S,h,b,y,C,T,D,N,P;const I=e=>{let t=[],l=[],n={};return e&&e.map((e,o)=>{var a;t=null!=e&&e.usageCategory?null==e||null===(a=e.usageCategory)||void 0===a?void 0:a.split(","):[],l=[],t&&t.map((e,t)=>{l.push({code:e,i18nKey:"BPA_SUBOCCUPANCYTYPE_"+e.replaceAll(".","_"),name:i("BPA_SUBOCCUPANCYTYPE_"+e.replaceAll(".","_"))})}),l&&(n["Block_"+(o+1)]=l)}),n};e.address=null==e||null===(a=e.landInfo)||void 0===a?void 0:a.address,e.additionalDetails={...null==e?void 0:e.additionalDetails,applicationType:null==t?void 0:t.appliactionType,holdingNo:null==e||null===(r=e.additionalDetails)||void 0===r?void 0:r.holdingNo,landId:null==e||null===(u=e.landInfo)||void 0===u?void 0:u.id,serviceType:(null==e||null===(d=e.additionalDetails)||void 0===d?void 0:d.serviceType)||(null==t?void 0:t.applicationSubType)},e.data={applicantName:null==t||null===(s=t.planDetail)||void 0===s||null===(c=s.planInformation)||void 0===c?void 0:c.applicantName,applicationDate:null==e||null===(v=e.auditDetails)||void 0===v?void 0:v.createdTime,applicationType:null==t?void 0:t.appliactionType,holdingNumber:null==e||null===(p=e.additionalDetails)||void 0===p?void 0:p.holdingNo,bpaData:o,occupancyType:null==t||null===(m=t.planDetail)||void 0===m||null===(E=m.planInformation)||void 0===E?void 0:E.occupancy,registrationDetails:null==e||null===(f=e.additionalDetails)||void 0===f?void 0:f.registrationDetails,riskType:Digit.Utils.obps.calculateRiskType(null==l||null===(_=l.BPA)||void 0===_?void 0:_.RiskTypeComputation,null==t||null===(g=t.planDetail)||void 0===g||null===(A=g.plot)||void 0===A?void 0:A.area,null==t||null===(S=t.planDetail)||void 0===S?void 0:S.blocks),serviceType:(null==e||null===(h=e.additionalDetails)||void 0===h?void 0:h.serviceType)||(null==t?void 0:t.applicationSubType),edcrDetails:t,scrutinyNumber:{edcrNumber:null==t?void 0:t.edcrNumber}},e.PrevStateDocuments=null==e?void 0:e.documents,e.documents={documents:[]};let L=[];return n&&n.map((e,t)=>{e.documents&&e.documents.map((e,t)=>{L.push(e)})}),e.PrevStateNocDocuments=L,e.nocDocuments={NocDetails:n,nocDocuments:[]},e.riskType=Digit.Utils.obps.calculateRiskType(null==l||null===(b=l.BPA)||void 0===b?void 0:b.RiskTypeComputation,null==t||null===(y=t.planDetail)||void 0===y||null===(C=y.plot)||void 0===C?void 0:C.area,null==t||null===(T=t.planDetail)||void 0===T?void 0:T.blocks),e.subOccupancy=I(null==e||null===(D=e.landInfo)||void 0===D?void 0:D.unit),e.uiFlow={flow:"OCBPA",applicationType:(null==e||null===(N=e.additionalDetails)||void 0===N?void 0:N.applicationType)||(null==t?void 0:t.appliactionType),serviceType:(null==e||null===(P=e.additionalDetails)||void 0===P?void 0:P.serviceType)||(null==t?void 0:t.applicationSubType)},sessionStorage.setItem("BPA_IS_ALREADY_WENT_OFF_DETAILS",JSON.stringify(!0)),Promise.resolve(e)}catch(e){return Promise.reject(e)}}(y,R,I,k,_,M)).then(function(e){T({...C,...e})})}();if(e&&e.then)return e.then(function(){})}}();return Promise.resolve(t&&t.then?t.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},[L,R,I,k,M]);const W=(e,t,l,n)=>{T(n?t:{...C,[e]:{...C[e],...t}}),(e=>{var t;const l=null==S||null===(t=S.split("/"))||void 0===t?void 0:t.pop(),{nextStep:n}=b.find(e=>e.route===l);let i=h.push;if(null===n)return i(fn(f.path,f.params)+"/check");i(`${fn(f.path,f.params)}/${n}`)})()},j=()=>{};P=null!==(d=P)&&void 0!==d&&d.OCBuildingPermitConfig?null===(s=P)||void 0===s?void 0:s.OCBuildingPermitConfig:en,P.forEach(e=>{b=b.concat(e.body.filter(e=>!e.hideInCitizen))}),b.indexRoute="check",t.useEffect(()=>{sessionStorage.getItem("isPermitApplication")&&"true"==sessionStorage.getItem("isPermitApplication")&&(D(),sessionStorage.setItem("isPermitApplication",!1))},[]);const $=null===(c=Digit)||void 0===c||null===(v=c.ComponentRegistryService)||void 0===v?void 0:v.getComponent("OCBPACheckPage"),Y=null===(p=Digit)||void 0===p||null===(m=p.ComponentRegistryService)||void 0===m?void 0:m.getComponent("OCBPAAcknowledgement");return U||B||w?l.createElement(o.Loader,null):l.createElement(i.Switch,null,b.map((e,t)=>{const{component:n,texts:o,inputs:a,key:r}=e,u="string"==typeof n?Digit.ComponentRegistryService.getComponent(n):n;return l.createElement(i.Route,{path:`${fn(f.path,f.params)}/${e.route}`,key:t},l.createElement(u,{config:{texts:o,inputs:a,key:r},onSelect:W,onSkip:j,t:_,formData:C}))}),l.createElement(i.Route,{path:fn(f.path,f.params)+"/check"},l.createElement($,{onSubmit:function(){try{return h.push(fn(f.path,f.params)+"/acknowledgement"),Promise.resolve()}catch(e){return Promise.reject(e)}},value:C})),l.createElement(i.Route,{path:fn(f.path,f.params)+"/acknowledgement"},l.createElement(Y,{data:C,onSuccess:()=>{E.invalidateQueries("PT_CREATE_PROPERTY")}})),l.createElement(i.Route,null,R&&M&&l.createElement(i.Redirect,{to:`${fn(f.path,f.params)}/${b.indexRoute}`})))},ObpsBPASendBackToCitizen:e=>{var a,r,d,s,c,v,p,m;const{t:E}=n.useTranslation(),f=u.useQueryClient(),_=i.useRouteMatch(),{pathname:g}=i.useLocation(),A=i.useHistory(),S=Digit.ULBService.getStateId(),{applicationNo:h,tenantId:b}=i.useParams();sessionStorage.setItem("BPA_SUBMIT_APP",JSON.stringify("BPA_SUBMIT_APP"));let y=[],C={};const[T,D,N]=Digit.Hooks.useSessionStorage("BUILDING_PERMIT_EDITFLOW",{}),P=Digit.ULBService.getStateId();let{data:I}=Digit.Hooks.obps.SearchMdmsTypes.getFormConfig(P,[]);const{data:L}=Digit.Hooks.obps.useMDMS(S,"BPA",["RiskTypeComputation"]),{data:B,isLoading:O}=Digit.Hooks.obps.useBPASearch(b,{applicationNo:h});let R={edcrNumber:null==B||null===(a=B[0])||void 0===a?void 0:a.edcrNumber},w=h;const{data:x,isLoading:M}=Digit.Hooks.obps.useScrutinyDetails(S,R,{enabled:!(null==B||null===(r=B[0])||void 0===r||!r.edcrNumber)}),{data:F,isLoading:k}=Digit.Hooks.obps.useNocDetails(b,{sourceRefId:w}),U=window.location.href.includes("editApplication");t.useEffect(function(){try{let e=sessionStorage.getItem("BPA_IS_ALREADY_WENT_OFF_DETAILS");e=!e||JSON.parse(e);const t=function(){if(!(e||k||O||M)){C=B?B[0]:{};const e=function(){if(B&&C&&x&&L&&F)return C=B[0],U&&(C.isEditApplication=!0),sessionStorage.setItem("bpaInitialObject",JSON.stringify({...C})),Promise.resolve(Lt(C,x,L,F,E)).then(function(e){D({...T,...e})})}();if(e&&e.then)return e.then(function(){})}}();return Promise.resolve(t&&t.then?t.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},[B,x,L,F]);const H=(e,t,l,n)=>{D(n?t:{...T,[e]:{...T[e],...t}}),(e=>{const t=g.split("/").pop(),{nextStep:l}=y.find(e=>e.route===t);let n=A.push;if(null===l)return n(Bt(_.path,_.params)+"/check");n(`${Bt(_.path,_.params)}/${l}`)})()},W=()=>{};I=null!==(d=I)&&void 0!==d&&d.BuildingPermitConfig?null===(s=I)||void 0===s?void 0:s.BuildingPermitConfig:Jl,I.forEach(e=>{y=y.concat(e.body.filter(e=>!e.hideInCitizen))}),y.indexRoute="check",t.useEffect(()=>{sessionStorage.getItem("isPermitApplication")&&"true"==sessionStorage.getItem("isPermitApplication")&&(N(),sessionStorage.setItem("isPermitApplication",!1))},[]);const j=null===(c=Digit)||void 0===c||null===(v=c.ComponentRegistryService)||void 0===v?void 0:v.getComponent("OCBPASendBackCheckPage"),$=null===(p=Digit)||void 0===p||null===(m=p.ComponentRegistryService)||void 0===m?void 0:m.getComponent("OCSendBackAcknowledgement");return k||O||M?l.createElement(o.Loader,null):l.createElement(i.Switch,null,y.map((e,t)=>{const{component:n,texts:o,inputs:a,key:r}=e,u="string"==typeof n?Digit.ComponentRegistryService.getComponent(n):n;return l.createElement(i.Route,{path:`${Bt(_.path,_.params)}/${e.route}`,key:t},l.createElement(u,{config:{texts:o,inputs:a,key:r},onSelect:H,onSkip:W,t:E,formData:T}))}),l.createElement(i.Route,{path:Bt(_.path,_.params)+"/check"},l.createElement(j,{onSubmit:function(){try{return A.push(Bt(_.path,_.params)+"/acknowledgement"),Promise.resolve()}catch(e){return Promise.reject(e)}},value:T})),l.createElement(i.Route,{path:Bt(_.path,_.params)+"/acknowledgement"},l.createElement($,{data:T,onSuccess:()=>{f.invalidateQueries("PT_CREATE_PROPERTY")}})),l.createElement(i.Route,null,l.createElement(i.Redirect,{to:`${Bt(_.path,_.params)}/${y.indexRoute}`})))},ObpsOCSendBackToCitizen:e=>{var a,r,d,s,c,v,p,m;sessionStorage.setItem("BPA_SUBMIT_APP",JSON.stringify("BPA_SUBMIT_APP"));const{t:E}=n.useTranslation(),f=u.useQueryClient(),_=i.useRouteMatch(),{pathname:g}=i.useLocation(),A=i.useHistory(),S=Digit.ULBService.getStateId(),{applicationNo:h,tenantId:b}=i.useParams();let y=[],C={};const[T,D,N]=Digit.Hooks.useSessionStorage("BUILDING_PERMIT_EDITFLOW",{}),P=Digit.ULBService.getStateId();let{data:I}=Digit.Hooks.obps.SearchMdmsTypes.getFormConfig(P,[]);const{isMdmsLoading:L,data:B}=Digit.Hooks.obps.useMDMS(S,"BPA",["RiskTypeComputation","homePageUrlLinks"]),{data:O,isLoading:R}=Digit.Hooks.obps.useBPASearch(b,{applicationNo:h});let w={edcrNumber:null==O||null===(a=O[0])||void 0===a?void 0:a.edcrNumber},x=h;const{data:M,isLoading:F}=Digit.Hooks.obps.useScrutinyDetails(S,w,{enabled:!(null==O||null===(r=O[0])||void 0===r||!r.edcrNumber)}),{data:k,isLoading:U}=Digit.Hooks.obps.useNocDetails(b,{sourceRefId:x}),H=window.location.href.includes("editApplication");t.useEffect(function(){try{let e=sessionStorage.getItem("BPA_IS_ALREADY_WENT_OFF_DETAILS");e=!e||JSON.parse(e);const t=function(){if(!(e||U||R||F||L)){C=O?O[0]:{};const e=function(){if(O&&C&&M&&B&&k)return C=O[0],H&&(C.isEditApplication=!0),sessionStorage.setItem("bpaInitialObject",JSON.stringify({...C})),Promise.resolve(Lt(C,M,B,k,E)).then(function(e){D({...T,...e})})}();if(e&&e.then)return e.then(function(){})}}();return Promise.resolve(t&&t.then?t.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},[O,M,B,k]);const W=(e,t,l,n)=>{D(n?t:{...T,[e]:{...T[e],...t}}),(e=>{const t=g.split("/").pop(),{nextStep:l}=y.find(e=>e.route===t);let n=A.push;if(null===l)return n(Bt(_.path,_.params)+"/check");n(`${Bt(_.path,_.params)}/${l}`)})()},j=()=>{};I=null!==(d=I)&&void 0!==d&&d.OCBuildingPermitConfig?null===(s=I)||void 0===s?void 0:s.OCBuildingPermitConfig:en,I.forEach(e=>{y=y.concat(e.body.filter(e=>!e.hideInCitizen))}),y.indexRoute="check",t.useEffect(()=>{sessionStorage.getItem("isPermitApplication")&&"true"==sessionStorage.getItem("isPermitApplication")&&(N(),sessionStorage.setItem("isPermitApplication",!1))},[]);const $=null===(c=Digit)||void 0===c||null===(v=c.ComponentRegistryService)||void 0===v?void 0:v.getComponent("OCBPASendBackCheckPage"),Y=null===(p=Digit)||void 0===p||null===(m=p.ComponentRegistryService)||void 0===m?void 0:m.getComponent("OCSendBackAcknowledgement");return U||R||F?l.createElement(o.Loader,null):l.createElement(i.Switch,null,y.map((e,t)=>{const{component:n,texts:o,inputs:a,key:r}=e,u="string"==typeof n?Digit.ComponentRegistryService.getComponent(n):n;return l.createElement(i.Route,{path:`${Bt(_.path,_.params)}/${e.route}`,key:t},l.createElement(u,{config:{texts:o,inputs:a,key:r},onSelect:W,onSkip:j,t:E,formData:T}))}),l.createElement(i.Route,{path:Bt(_.path,_.params)+"/check"},l.createElement($,{onSubmit:function(){return Promise.resolve()},value:T})),l.createElement(i.Route,{path:Bt(_.path,_.params)+"/acknowledgement"},l.createElement(Y,{data:T,onSuccess:()=>{f.invalidateQueries("PT_CREATE_PROPERTY")}})),l.createElement(i.Route,null,l.createElement(i.Redirect,{to:`${Bt(_.path,_.params)}/${y.indexRoute}`})))},ObpsEdcrInbox:e=>{let{parentRoute:i}=e;window.scroll(0,0);const{t:r}=n.useTranslation(),u=Digit.ULBService.getCurrentTenantId(),d={},c={appliactionType:"",status:""},v={sortBy:"createdDate",limit:Digit.Utils.browser.isMobile()?50:10,offset:0,sortOrder:"DESC"},p=Digit.SessionStorage.get("EDCR.INBOX"),m=t.useMemo(()=>"IS_EDCR_BACK"===Digit.SessionStorage.get("EDCR_BACK")?{filterForm:c,searchForm:d,tableForm:v}:p||{filterForm:c,searchForm:d,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)||{})]),[E,f]=t.useReducer(function(e,t){switch(t.action){case"mutateSearchForm":return Digit.SessionStorage.set("EDCR.INBOX",{...e,searchForm:t.data}),{...e,searchForm:t.data};case"mutateFilterForm":return Digit.SessionStorage.set("EDCR.INBOX",{...e,filterForm:t.data}),{...e,filterForm:t.data};case"mutateTableForm":return Digit.SessionStorage.set("EDCR.INBOX",{...e,tableForm:t.data}),{...e,tableForm:t.data}}},m),{isLoading:_,data:{table:g,totalCount:A}={}}=Digit.Hooks.obps.useEDCRInbox({tenantId:u,filters:{...E}}),S={logoIcon:l.createElement(o.CaseIcon,null),headerText:"ACTION_TEST_EDCR_SCRUTINY",links:[{link:"/digit-ui/citizen/obps/edcrscrutiny/apply",text:r("BPA_PLAN_SCRUTINY_FOR_NEW_CONSTRUCTION_LABEL")},{link:"/digit-ui/citizen/obps/edcrscrutiny/oc-apply",text:r("BPA_OC_PLAN_SCRUTINY_FOR_NEW_CONSTRUCTION_LABEL")}]},h=t.useCallback(e=>{let{registerRef:t,searchFormState:n,searchFieldComponents:i}=e;return l.createElement(gn,{registerRef:t,searchFormState:n,searchFieldComponents:i})},[]),b=t.useCallback(e=>{let{registerRef:t,controlFilterForm:n,setFilterFormValue:i,getFilterFormValue:o}=e;return l.createElement(_n,{isInboxLoading:_,registerRef:t,controlFilterForm:n,setFilterFormValue:i,filterFormState:null==E?void 0:E.filterForm,getFilterFormValue:o})},[_]),y={SearchFormFields:h,onSearchFormSubmit:e=>{e.hasOwnProperty("")&&(null==e||delete e[""]),f({action:"mutateTableForm",data:{...v}}),f({action:"mutateSearchForm",data:e})},searchFormDefaultValues:null==E?void 0:E.searchForm,resetSearchFormDefaultValues:d,onSearchFormReset:e=>{e("edcrNumber",null),e("applicationNumber",null),f({action:"mutateSearchForm",data:d})}},C={FilterFormFields:b,onFilterFormSubmit:e=>{e.hasOwnProperty("")&&(null==e||delete e[""]),f({action:"mutateTableForm",data:{...v}}),f({action:"mutateFilterForm",data:e})},filterFormDefaultValues:null==E?void 0:E.filterForm,resetFilterFormDefaultValues:c,onFilterFormReset:e=>{e("status",""),e("appliactionType",""),f({action:"mutateFilterForm",data:c})}},T=(e=>{var i,o,a,r;let{onPageSizeChange:u,formState:d,totalCount:s,table:c,dispatch:v,onSortingByData:p}=e;const{t:m}=n.useTranslation(),E=t.useMemo(()=>[{Header:m("EDCR_COMMON_TABLE_APPL_NO"),disableSortBy:!0,Cell:e=>{let{row:t}=e;return l.createElement("div",null,l.createElement("span",{className:""},t.original.applicationId))}},{Header:m("CS_APPLICATION_DETAILS_APPLICATION_DATE"),accessor:"createdDate",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))(Fl(new Date(null===(n=i.original)||void 0===n?void 0:n.date),"dd/MM/yyyy")):""}},{Header:m("EDCR_COMMON_TABLE_CITY_LABEL"),accessor:e=>m(null==e?void 0:e.locality),disableSortBy:!0},{Header:m("EDCR_COMMON_TABLE_APPL_NAME"),accessor:e=>null==e?void 0:e.owner,disableSortBy:!0},{Header:m("EDCR_COMMON_TABLE_SCRUTINY_NO"),disableSortBy:!0,Cell:e=>{var t;let{row:n}=e;return l.createElement("div",null,"null"!==(null===(t=n.original)||void 0===t?void 0:t.edcrNumber)?l.createElement("span",{className:""},n.original.edcrNumber):"NA")}},{Header:m("EDCR_COMMON_TABLE_COL_STATUS"),accessor:e=>(e=>l.createElement("span","Accepted"===e?{className:"sla-cell-success ",style:{background:"none",padding:"unset"}}:{className:"sla-cell-error",style:{background:"none",padding:"unset"}},e))(null==e?void 0:e.status),disableSortBy:!0},{Header:m("PT_COMMON_TABLE_COL_ACTION_LABEL"),Cell:e=>{let{row:t}=e;return l.createElement(An,{dowloadOptions:[{label:m("BPA_UPLOADED_PLAN_DXF"),onClick:()=>window.open(""+t.original.dxfFileurl)},{label:m("EDCR_SCUTINY_REPORT"),onClick:()=>window.open(""+t.original.planReportUrl)}]})},disableSortBy:!0}]);return{getCellProps:e=>({style:{padding:"20px 18px",fontSize:"16px"}}),className:"table edcr-citizen-inbox",disableSort:!1,autoSort:!1,manualPagination:!0,initSortId:"createdDate",onPageSizeChange:u,currentPage:(null===(i=d.tableForm)||void 0===i?void 0:i.offset)/(null===(o=d.tableForm)||void 0===o?void 0:o.limit),onNextPage:()=>{var e,t;return v({action:"mutateTableForm",data:{...d.tableForm,offset:parseInt(null===(e=d.tableForm)||void 0===e?void 0:e.offset)+parseInt(null===(t=d.tableForm)||void 0===t?void 0:t.limit)}})},onPrevPage:()=>{var e,t;return v({action:"mutateTableForm",data:{...d.tableForm,offset:parseInt(null===(e=d.tableForm)||void 0===e?void 0:e.offset)-parseInt(null===(t=d.tableForm)||void 0===t?void 0:t.limit)}})},pageSizeLimit:null===(a=d.tableForm)||void 0===a?void 0:a.limit,onSort:p,totalRecords:s,onSearch:null==d||null===(r=d.searchForm)||void 0===r?void 0:r.message,onLastPage:()=>{var e;return v({action:"mutateTableForm",data:{...d.tableForm,offset:10*Math.ceil(s/10)-parseInt(null===(e=d.tableForm)||void 0===e?void 0:e.limit)}})},onFirstPage:()=>v({action:"mutateTableForm",data:{...d.tableForm,offset:0}}),data:c,columns:E}})({parentRoute:i,onPageSizeChange:e=>{f({action:"mutateTableForm",data:{...E.tableForm,limit:e.target.value}})},formState:E,totalCount:A,table:g,dispatch:f,onSortingByData:e=>{if(e.length>0){const[{id:t,desc:l}]=e,n=l?"DESC":"ASC";E.tableForm.sortBy===t&&E.tableForm.sortOrder===n||f({action:"mutateTableForm",data:{...E.tableForm,sortBy:t,sortOrder:l?"DESC":"ASC"}})}}}),D=(e=>{let{table:t}=e;const{t:i}=n.useTranslation();return{data:null==t?void 0:t.map(e=>{let{applicationId:t,edcrNumber:n,date:o,planReportUrl:a,dxfFileurl:r,locality:u,status:d,owner:s}=e;return{[i("EDCR_COMMON_TABLE_APPL_NO")]:t,[i("CS_APPLICATION_DETAILS_APPLICATION_DATE")]:o?Fl(new Date(o),"dd/MM/yyyy"):"NA",[i("EDCR_COMMON_TABLE_CITY_LABEL")]:i(u),[i("EDCR_COMMON_TABLE_APPL_NAME")]:s,[i("EDCR_COMMON_TABLE_SCRUTINY_NO")]:n,[i("EDCR_COMMON_TABLE_COL_STATUS")]:l.createElement("span","Accepted"===d?{className:"sla-cell-success ",style:{background:"none",padding:"0px"}}:{className:"sla-cell-error",style:{background:"none",padding:"0px"}},d),[i("BPA_UPLOADED_PLAN_DXF")]:l.createElement("a",{href:""+r},l.createElement("span",{className:"link"},i("BPA_DOWNLOAD"))),[i("EDCR_SCUTINY_REPORT")]:l.createElement("a",{href:""+a},l.createElement("span",{className:"link"},i("BPA_DOWNLOAD")))}}),isTwoDynamicPrefix:!0,getRedirectionLink:()=>{},handleClickEnabled:!1,serviceRequestIdKey:"applicationNo",MobileSortFormValues:()=>{const e=[{code:"DESC",i18nKey:"ES_INBOX_DATE_LATEST_FIRST"},{code:"ASC",i18nKey:"ES_INBOX_DATE_LATEST_LAST"}],{control:t}=a.useFormContext();return l.createElement(o.SearchField,null,l.createElement(a.Controller,{name:"sortOrder",control:t,render:t=>{let{onChange:n,value:i}=t;return l.createElement(o.RadioButtons,{onSelect:e=>{n(e.code)},selectedOption:e.filter(e=>e.code===i)[0],optionsKey:"i18nKey",name:"sortOrder",options:e})}}))}}})({table:g}),N={onMobileSortOrderData:e=>{const{sortOrder:t}=e;f({action:"mutateTableForm",data:{...E.tableForm,sortOrder:t}})},sortFormDefaultValues:null==E?void 0:E.tableForm,onSortFormReset:e=>{e("sortOrder","DESC"),f({action:"mutateTableForm",data:v})}};return l.createElement(t.Fragment,null,l.createElement(o.Header,null,r("ES_COMMON_INBOX"),A?l.createElement("p",{className:"inbox-count"},A):null),l.createElement(o.InboxComposer,s({isInboxLoading:_,PropsForInboxLinks:S},y,C,N,{propsForInboxTable:T,propsForInboxMobileCards:D,formState:E})))},ObpsEmpApplicationDetail:()=>{var e,a,r,u,d,s,c;const{id:v}=i.useParams(),{t:p}=n.useTranslation(),m=Digit.ULBService.getCurrentTenantId(),E=null==m?void 0:m.split(".")[0],[f,_]=t.useState(null),[g,A]=t.useState(!1),{isLoading:S,data:h}=Digit.Hooks.obps.useLicenseDetails(E,{applicationNumber:v,tenantId:E},{}),b=window.Digit.Utils.browser.isMobile(),[y,C]=t.useState(!1),{mutate:T}=Digit.Hooks.obps.useBPAREGApplicationActions(m),D=Digit.Hooks.useWorkflowDetails({tenantId:null==m?void 0:m.split(".")[0],id:v,moduleCode:"BPAREG"});let N=[];return console.log("applicationDetails",h),(null==h||null===(e=h.payments)||void 0===e?void 0:e.length)>0&&N.push({label:p("TL_RECEIPT"),onClick:()=>{var e,t;return Mt(0,null==h||null===(e=h.applicationData)||void 0===e?void 0:e.applicationNumber,null==h||null===(t=h.applicationData)||void 0===t?void 0:t.tenantId,null==h?void 0:h.payments)}}),l.createElement("div",{className:"employee-main-application-details"},l.createElement("div",{className:"employee-application-details"},l.createElement(o.Header,null,p("CS_TITLE_APPLICATION_DETAILS")),l.createElement("div",null,l.createElement("div",{style:{zIndex:"10",position:"relative"}},(null==h||null===(a=h.payments)||void 0===a?void 0:a.length)>0&&l.createElement(o.MultiLink,{className:"multilinkWrapper",onHeadClick:()=>A(!g),displayOptions:g,options:N,downloadBtnClassName:"employee-download-btn-className",optionsClassName:"employee-options-btn-className"})),(null==D||null===(r=D.data)||void 0===r||null===(u=r.timeline)||void 0===u?void 0:u.length)>0&&l.createElement(o.LinkButton,{label:p("VIEW_TIMELINE"),style:{color:"#A52A2A"},onClick:()=>{C(!0);const e=document.getElementById("timeline");e&&e.scrollIntoView({behavior:"smooth"})}}))),l.createElement(eo,{applicationDetails:h,isLoading:S,id:"timeline",isDataLoading:S,applicationData:null==h?void 0:h.applicationData,mutate:T,workflowDetails:D,businessService:null!=D&&null!==(d=D.data)&&void 0!==d&&d.applicationBusinessService?null==D||null===(s=D.data)||void 0===s?void 0:s.applicationBusinessService:null==h||null===(c=h.applicationData)||void 0===c?void 0:c.businessService,moduleCode:"BPAREG",showToast:f,setShowToast:_,ActionBarStyle:b?{}:{paddingRight:"50px"},MenuStyle:b?{}:{right:"50px"},closeToast:()=>{_(null)},timelineStatusPrefix:"WF_NEWTL_"}))},ObpsEmployeeBpaApplicationDetail:()=>{var e,a,r,u,d,s,c,v,p,m,E,f,_,g,A,S,h,b,y,C,T,D,N,P,I;const L=function(e,t,l){let{tenantId:n}=e;void 0===l&&(l="download");try{var i,o;let e=new Date;ie.applicationData.additionalDetails.runDate=Pt(e.getFullYear()+"-"+(e.getMonth()+1)+"-"+e.getDate());let h={...null==ie?void 0:ie.applicationData,edcrDetail:[{...null==ie?void 0:ie.edcrDetails}]};const b=Digit.ULBService.getStateId();let y=0;for(let e=0;e<(null==pe||null===(a=pe.data)||void 0===a||null===(r=a.processInstances)||void 0===r?void 0:r.length);e++){var a,r,u,d,s,c,v,p,m,E,f,_,g;"POST_PAYMENT_APPLY"!==(null==pe||null===(u=pe.data)||void 0===u||null===(d=u.processInstances[e])||void 0===d?void 0:d.action)&&"PAY"!==(null==pe||null===(s=pe.data)||void 0===s||null===(c=s.processInstances[e])||void 0===c?void 0:c.action)||"APPROVAL_INPROGRESS"!==(null==pe||null===(v=pe.data)||void 0===v||null===(p=v.processInstances)||void 0===p||null===(m=p[e])||void 0===m||null===(E=m.state)||void 0===E?void 0:E.applicationStatus)||0!=y||(h.additionalDetails.submissionDate=null==pe||null===(f=pe.data)||void 0===f||null===(_=f.processInstances[e])||void 0===_||null===(g=_.auditDetails)||void 0===g?void 0:g.createdTime,y=1)}var A;if("NO"==(null==h||null===(i=h.additionalDetails)||void 0===i?void 0:i.approvedColony))h.additionalDetails.permitData="The plot has been officially regularized under No."+(null==h||null===(A=h.additionalDetails)||void 0===A?void 0:A.NocNumber)+" dated dd/mm/yyyy, registered in the name of <name as per the NOC>. This regularization falls within the jurisdiction of "+b+".Any form of misrepresentation of the NoC is strictly prohibited. Such misrepresentation renders the building plan null and void, and it will be regarded as an act of impersonation. Criminal proceedings will be initiated against the owner and concerned architect / engineer/ building designer / supervisor involved in such actions";else if("YES"==(null==h||null===(o=h.additionalDetails)||void 0===o?void 0:o.approvedColony)){var S;h.additionalDetails.permitData="The building plan falls under approved colony "+(null==h||null===(S=h.additionalDetails)||void 0===S?void 0:S.nameofApprovedcolony)}else h.additionalDetails.permitData="The building plan falls under Lal Lakir";return Promise.resolve(Digit.PaymentService.generatePdf(n,{Bpa:[h]},t)).then(function(e){return Promise.resolve(Digit.PaymentService.printReciept(n,{fileStoreIds:e.filestoreIds[0]})).then(function(t){var n,i;return window.open(t[null==e?void 0:e.filestoreIds[0]],"_blank"),h.applicationType=null==ie||null===(n=ie.applicationData)||void 0===n||null===(i=n.additionalDetails)||void 0===i?void 0:i.applicationType,Promise.resolve(Digit.OBPSService.edcr_report_download({BPA:{...h}})).then(function(e){const t=parseInt(e.status,10);201!==t&&200!==t||("print"==l?xt(new Blob([e.data],{type:"application/pdf"})):wt(new Blob([e.data],{type:"application/pdf"}),"edcrReport.pdf"))})})})}catch(e){return Promise.reject(e)}},B=function(e){let{payments:t,...l}=e;try{function n(){return Promise.resolve(Digit.PaymentService.printReciept(X,{fileStoreIds:e.filestoreIds[0]})).then(function(t){var l;window.open(t[null===(l=e)||void 0===l?void 0:l.filestoreIds[0]],"_blank")})}let e=null;const l=function(){if(null==t||!t.fileStoreId)return Promise.resolve(Digit.PaymentService.generatePdf(X,{Payments:[{...t}]},"bpa-receipt")).then(function(t){e=t});e={filestoreIds:[null==t?void 0:t.fileStoreId]}}();return Promise.resolve(l&&l.then?l.then(n):n())}catch(e){return Promise.reject(e)}},{id:O}=i.useParams(),{t:R}=n.useTranslation(),w=Digit.ULBService.getCurrentTenantId(),[x,M]=t.useState(null),[F,k]=t.useState(!1),[U,H,W]=(i.useHistory(),Digit.Hooks.useSessionStorage("store-data",null)),[j,$,Y]=Digit.Hooks.useSessionStorage("EMPLOYEE_MUTATION_HAPPENED",!1),[z,G,K]=Digit.Hooks.useSessionStorage("EMPLOYEE_MUTATION_SUCCESS_DATA",{}),[V,q]=t.useState(null),X=Digit.ULBService.getStateId(),J=window.Digit.Utils.browser.isMobile(),{isLoading:Z,data:Q}=Digit.Hooks.obps.useMDMS(X,"BPA",["DocTypeMapping"]),[ee,te]=t.useState(!1);let{data:le}=Digit.Hooks.obps.SearchMdmsTypes.getFormConfig(X,[]);const{data:ne}=Digit.Hooks.obps.useMDMS(X,"BPA",["RiskTypeComputation"]),{data:ie={},isLoading:oe}=Digit.Hooks.obps.useBPADetailsPage(w,{applicationNo:O});t.useEffect(()=>{if(!Z&&!oe){var e;let v=[];if(null!=Q&&null!==(e=Q.BPA)&&void 0!==e&&e.DocTypeMapping){var t,l,n,i,o,a,r,u,d,s,c;v=null==Q||null===(t=Q.BPA)||void 0===t||null===(l=t.DocTypeMapping)||void 0===l?void 0:l.filter(e=>{var t,l,n,i,o;return"INPROGRESS"==e.WFState&&e.RiskType==(null==ie||null===(t=ie.applicationData)||void 0===t?void 0:t.riskType)&&e.ServiceType==(null==ie||null===(l=ie.applicationData)||void 0===l||null===(n=l.additionalDetails)||void 0===n?void 0:n.serviceType)&&e.applicationType==(null==ie||null===(i=ie.applicationData)||void 0===i||null===(o=i.additionalDetails)||void 0===o?void 0:o.applicationType)});let e=null==ie||null===(n=ie.applicationDetails)||void 0===n||null===(i=n.filter(e=>"BPA_DOCUMENT_DETAILS_LABEL"===e.title)[0])||void 0===i||null===(o=i.additionalDetails)||void 0===o||null===(a=o.obpsDocuments)||void 0===a||null===(r=a[0])||void 0===r?void 0:r.values,p=[];v&&(null===(u=v)||void 0===u||null===(d=u[0])||void 0===d?void 0:d.docTypes)&&(null===(s=v)||void 0===s||null===(c=s[0])||void 0===c||c.docTypes.map(t=>{e&&e.filter(e=>t.code===e.documentType.slice(0,e.documentType.lastIndexOf("."))).map(e=>{p.push(e)})}));const m=ie.applicationDetails&&ie.applicationDetails.map(e=>"BPA_DOCUMENT_DETAILS_LABEL"===e.title?{...e,additionalDetails:{obpsDocuments:[{title:"",values:p}]}}:e);ie.applicationDetails=m&&m.length>0?[...m]:null==ie?void 0:ie.applicationDetails}}},[Q,ie]);const[ae,re]=t.useState(!1),{mutate:ue}=Digit.Hooks.obps.useApplicationActions(w),de=Digit.Hooks.obps.useObpsAPI(w,!0);let ce="";sessionStorage.setItem("bpaApplicationDetails",!0),t.useEffect(()=>{$(!1),K()},[]);let ve=null!=le&&le.InspectionReportConfig?null==le?void 0:le.InspectionReportConfig:to,pe=Digit.Hooks.useWorkflowDetails({tenantId:w,id:O,moduleCode:"BPA"});var me,Ee,fe,ge,Ae,Se,he,be,ye;pe&&pe.data&&!pe.isLoading&&(pe.data.initialActionState=(null==pe||null===(me=pe.data)||void 0===me?void 0:me.initialActionState)||{...null==pe||null===(Ee=pe.data)||void 0===Ee?void 0:Ee.actionState}||{},pe.data.actionState={...pe.data}),null!=ne&&null!==(e=ne.BPA)&&void 0!==e&&e.RiskTypeComputation&&null!=ie&&ie.edcrDetails&&(ce=Digit.Utils.obps.calculateRiskType(null==ne||null===(fe=ne.BPA)||void 0===fe?void 0:fe.RiskTypeComputation,null==ie||null===(ge=ie.edcrDetails)||void 0===ge||null===(Ae=ge.planDetail)||void 0===Ae||null===(Se=Ae.plot)||void 0===Se?void 0:Se.area,null==ie||null===(he=ie.edcrDetails)||void 0===he||null===(be=he.planDetail)||void 0===be?void 0:be.blocks),null==ie||null===(ye=ie.applicationDetails)||void 0===ye||ye.map(e=>{var t;null!=e&&e.isInsert&&(null===(t=e.values)||void 0===t||t.forEach(e=>{null!=e&&e.isInsert&&(e.value="WF_BPA_"+ce)}))}));const Ce=Digit.UserService.getUser(),Te=null==Ce||null===(a=Ce.info)||void 0===a?void 0:a.roles.filter(e=>{if("CEMP"==e.code&&e.tenantId===w||"CITIZEN"==e.code)return!0});if((null==pe||null===(r=pe.data)||void 0===r||null===(u=r.processInstances)||void 0===u?void 0:u.length)>0){var De,Ne,Le;let e=[];e=null===(De=Ao(null==pe||null===(Ne=pe.data)||void 0===Ne?void 0:Ne.processInstances[0],"nextActions",[]))||void 0===De?void 0:De.filter(e=>"ADHOC"!=e.action);let t=(Oe=["action"],Re=["desc"],null==(Be=e)?[]:(se(Oe)||(Oe=null==Oe?[]:[Oe]),se(Re=Re)||(Re=null==Re?[]:[Re]),function(e,t,l){t=t.length?po(t,function(e){return se(e)?function(t){return go(t,1===e.length?e[0]:e)}:e}):[xo];var n=-1;return t=po(t,_e(Mo)),function(e,t){var n=e.length;for(e.sort(function(e,t){return function(e,t,l){for(var n=-1,i=e.criteria,o=t.criteria,a=i.length,r=l.length;++n<a;){var u=Fo(i[n],o[n]);if(u)return n>=r?u:u*("desc"==l[n]?-1:1)}return e.index-t.index}(e,t,l)});n--;)e[n]=e[n].value;return e}(function(e,t){var l=-1,n=Pe(e)?Array(e.length):[];return function(e,t){if(null==e)return e;if(!Pe(e))return function(e,t){return e&&function(e,t,l){for(var n=-1,i=Object(e),o=l(e),a=o.length;a--;){var r=o[++n];if(!1===t(i[r],r,i))break}return e}(e,t,Ie)}(e,t);for(var l=e.length,n=-1,i=Object(e);++n<l&&!1!==t(i[n]););}(e,function(e,i,o){n[++l]=t(e)}),n}(e,function(e,l,i){return{criteria:po(t,function(t){return t(e)}),index:++n,value:e}}))}(Be,Oe,Re)));t&&0!=(null==t?void 0:t.length)||null==pe||null===(Le=pe.data)||void 0===Le||!Le.actionState||(pe.data.actionState.nextActions=[])}var Be,Oe,Re,we,xe,Me,Fe,ke,Ue;(null==pe||null===(d=pe.data)||void 0===d||null===(s=d.nextActions)||void 0===s?void 0:s.length)>0&&(pe.data.nextActions=null==pe||null===(we=pe.data)||void 0===we||null===(xe=we.nextActions)||void 0===xe?void 0:xe.filter(e=>"INITIATE"!==e.action),pe.data.nextActions=null==pe||null===(Me=pe.data)||void 0===Me||null===(Fe=Me.nextActions)||void 0===Fe?void 0:Fe.filter(e=>"ADHOC"!==e.action)),Te&&(null==pe||null===(ke=pe.data)||void 0===ke||null===(Ue=ke.nextActions)||void 0===Ue||Ue.forEach(e=>{var t,l,n;"PAY"===(null==e?void 0:e.action)&&(e.redirectionUrll={pathname:`${Rt(null==ie||null===(t=ie.applicationData)||void 0===t?void 0:t.businessService,null==ie||null===(l=ie.applicationData)||void 0===l?void 0:l.status)}/${null==ie||null===(n=ie.applicationData)||void 0===n?void 0:n.applicationNo}/${w}?tenantId=${w}`,state:w})}));let He=[];var We,je,$e,Ye,ze,Ge;if((null==ie||null===(c=ie.collectionBillDetails)||void 0===c?void 0:c.length)>0&&mt(null==ie?void 0:ie.collectionBillDetails).forEach(e=>{var t,l,n,i,o;"BPA.NC_OC_APP_FEE"===(null==e||null===(t=e.paymentDetails[0])||void 0===t?void 0:t.businessService)&&He.push({order:1,label:R("BPA_APP_FEE_RECEIPT"),onClick:()=>{var t,l;return B({tenantId:null==ie||null===(t=ie.applicationData)||void 0===t?void 0:t.tenantId,payments:e,consumerCodes:null==ie||null===(l=ie.applicationData)||void 0===l?void 0:l.applicationNo})}}),"BPA.NC_OC_SAN_FEE"===(null==e||null===(l=e.paymentDetails[0])||void 0===l?void 0:l.businessService)&&He.push({order:2,label:R("BPA_OC_DEV_PEN_RECEIPT"),onClick:()=>{var t,l;return B({tenantId:null==ie||null===(t=ie.applicationData)||void 0===t?void 0:t.tenantId,payments:e,consumerCodes:null==ie||null===(l=ie.applicationData)||void 0===l?void 0:l.applicationNo})}}),"BPA.LOW_RISK_PERMIT_FEE"===(null==e||null===(n=e.paymentDetails[0])||void 0===n?void 0:n.businessService)&&He.push({order:1,label:R("BPA_FEE_RECEIPT"),onClick:()=>{var t,l;return B({tenantId:null==ie||null===(t=ie.applicationData)||void 0===t?void 0:t.tenantId,payments:e,consumerCodes:null==ie||null===(l=ie.applicationData)||void 0===l?void 0:l.applicationNo})}}),"BPA.NC_APP_FEE"===(null==e||null===(i=e.paymentDetails[0])||void 0===i?void 0:i.businessService)&&He.push({order:1,label:R("BPA_APP_FEE_RECEIPT"),onClick:()=>{var t,l;return B({tenantId:null==ie||null===(t=ie.applicationData)||void 0===t?void 0:t.tenantId,payments:e,consumerCodes:null==ie||null===(l=ie.applicationData)||void 0===l?void 0:l.applicationNo})}}),"BPA.NC_SAN_FEE"===(null==e||null===(o=e.paymentDetails[0])||void 0===o?void 0:o.businessService)&&He.push({order:2,label:R("BPA_SAN_FEE_RECEIPT"),onClick:()=>{var t,l;return B({tenantId:null==ie||null===(t=ie.applicationData)||void 0===t?void 0:t.tenantId,payments:e,consumerCodes:null==ie||null===(l=ie.applicationData)||void 0===l?void 0:l.applicationNo})}})}),ie&&"BPA_LOW"===(null==ie||null===(v=ie.applicationData)||void 0===v?void 0:v.businessService)&&(null==ie||null===(p=ie.collectionBillDetails)||void 0===p?void 0:p.length)>0)(null==ie||null===(We=ie.applicationData)||void 0===We||!We.status.includes("REVOCATION"))&&He.push({order:3,label:R("BPA_PERMIT_ORDER"),onClick:()=>{var e;return L({tenantId:null==ie||null===(e=ie.applicationData)||void 0===e?void 0:e.tenantId},"buildingpermit-low")}}),(null==ie||null===(je=ie.applicationData)||void 0===je?void 0:je.status.includes("REVOCATION"))&&He.push({order:3,label:R("BPA_REVOCATION_PDF_LABEL"),onClick:()=>{var e;return function(e){let{tenantId:t,...l}=e;try{let e={...null==ie?void 0:ie.applicationData};return Promise.resolve(Digit.PaymentService.generatePdf(t,{Bpa:[e]},"bpa-revocation")).then(function(e){return Promise.resolve(Digit.PaymentService.printReciept(t,{fileStoreIds:e.filestoreIds[0]})).then(function(t){window.open(t[null==e?void 0:e.filestoreIds[0]],"_blank")})})}catch(e){return Promise.reject(e)}}({tenantId:null==ie||null===(e=ie.applicationData)||void 0===e?void 0:e.tenantId})}});else if(ie&&"BPA"===(null==ie||null===(m=ie.applicationData)||void 0===m?void 0:m.businessService)&&(null==ie||null===(E=ie.collectionBillDetails)||void 0===E?void 0:E.length)>0){var Ke;"APPROVED"===(null==ie||null===(Ke=ie.applicationData)||void 0===Ke?void 0:Ke.status)&&He.push({order:3,label:R("BPA_PERMIT_ORDER"),onClick:()=>{var e;return L({tenantId:null==ie||null===(e=ie.applicationData)||void 0===e?void 0:e.tenantId},"buildingpermit")}})}else{var Ve;"APPROVED"===(null==ie||null===(Ve=ie.applicationData)||void 0===Ve?void 0:Ve.status)&&He.push({order:3,label:R("BPA_OC_CERTIFICATE"),onClick:()=>{var e;return L({tenantId:null==ie||null===(e=ie.applicationData)||void 0===e?void 0:e.tenantId},"occupancy-certificate")}})}null!=ie&&ie.comparisionReport&&ie&&"BPA_OC"===(null==ie||null===(f=ie.applicationData)||void 0===f?void 0:f.businessService)&&He.push({order:4,label:R("BPA_COMPARISON_REPORT_LABEL"),onClick:()=>{var e;return window.open(null==ie||null===(e=ie.comparisionReport)||void 0===e?void 0:e.comparisonReport,"_blank")}}),He.sort(function(e,t){return e.order-t.order}),(null==pe||null===(_=pe.data)||void 0===_||null===(g=_.nextActions)||void 0===g?void 0:g.length)>0&&(pe.data.nextActions=null==pe||null===($e=pe.data)||void 0===$e||null===(Ye=$e.nextActions)||void 0===Ye?void 0:Ye.filter(e=>"SKIP_PAYMENT"!==e.action)),(null==pe||null===(A=pe.data)||void 0===A||null===(S=A.nextActions)||void 0===S?void 0:S.length)>0&&(pe.data.nextActions=null==pe||null===(ze=pe.data)||void 0===ze||null===(Ge=ze.nextActions)||void 0===Ge?void 0:Ge.filter(e=>"SKIP_PAYMENT"!==e.action));const qe=null==ie||null===(h=ie.applicationDetails)||void 0===h?void 0:h.filter(e=>0!==Object.keys(e).length);return ie.applicationDetails=qe,l.createElement(t.Fragment,null,l.createElement("div",{className:"employee-main-application-details"},l.createElement("div",{className:"employee-application-details",style:{marginBottom:"15px"}},l.createElement(o.Header,{styles:{marginLeft:"0px",paddingTop:"10px",fontSize:"32px"}},R("CS_TITLE_APPLICATION_DETAILS")),l.createElement("div",null,l.createElement("div",{style:{zIndex:"10",position:"relative"}},He&&He.length>0&&l.createElement(o.MultiLink,{className:"multilinkWrapper",onHeadClick:()=>re(!ae),displayOptions:ae,options:He,downloadBtnClassName:"employee-download-btn-className",optionsClassName:"employee-options-btn-className"})),l.createElement(o.LinkButton,{label:R("VIEW_TIMELINE"),style:{color:"#A52A2A"},onClick:()=>{te(!0);const e=document.getElementById("timeline");e&&e.scrollIntoView({behavior:"smooth"})}}))),l.createElement(eo,{applicationDetails:ie,isLoading:oe,isDataLoading:oe,applicationData:null==ie?void 0:ie.applicationData,nocMutation:de,mutate:ue,id:"timeline",workflowDetails:pe,businessService:null!=pe&&null!==(b=pe.data)&&void 0!==b&&b.applicationBusinessService?null==pe||null===(y=pe.data)||void 0===y?void 0:y.applicationBusinessService:null==ie||null===(C=ie.applicationData)||void 0===C?void 0:C.businessService,moduleCode:"BPA",showToast:x,ActionBarStyle:J?{}:{paddingRight:"50px"},MenuStyle:J?{}:{right:"50px"},setShowToast:M,closeToast:()=>{M(null),q(null)},statusAttribute:"state",timelineStatusPrefix:`WF_${null!=pe&&null!==(T=pe.data)&&void 0!==T&&T.applicationBusinessService?null==pe||null===(D=pe.data)||void 0===D?void 0:D.applicationBusinessService:null==ie||null===(N=ie.applicationData)||void 0===N?void 0:N.businessService}_`}),"FIELDINSPECTION_INPROGRESS"===(null==ie||null===(P=ie.applicationData)||void 0===P?void 0:P.status)&&(null==Ce||null===(I=Ce.info)||void 0===I?void 0:I.roles.filter(e=>"BPA_FIELD_INSPECTOR"===e.code)).length>0&&l.createElement(o.FormComposer,{heading:R(""),isDisabled:!F,config:ve.map(e=>{return{...e,body:e.body.filter(e=>!e.hideInEmployee),head:(t=e.head,"ES_NEW_APPLICATION_LOCATION_DETAILS"===t?"TL_CHECK_ADDRESS":"ES_NEW_APPLICATION_OWNERSHIP_DETAILS"===t?"TL_OWNERSHIP_DETAILS_HEADER":t)};var t}),fieldStyle:{marginRight:0},submitInForm:!1,defaultValues:{},onFormValueChange:(e,t,l)=>{k(!Object.keys(l.errors).length)},breaklineStyle:{border:"0px"},className:"employeeCard-override",cardClassName:"employeeCard-override"})))},Architectconcent:ko,CitizenConsent:mn};exports.initOBPSComponents=()=>{Object.entries(Oa).forEach(e=>{let[t,l]=e;Digit.ComponentRegistryService.setComponent(t,l)})};
|
|
1
|
+
function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}var t=require("react"),l=e(t),n=require("react-i18next"),i=require("react-router-dom"),o=require("@mseva/digit-ui-react-components"),a=require("react-hook-form");require("react-dom");var r=e(require("exif-js")),u=require("react-query"),d=e(require("react-modal"));function s(){return(s=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var n in l)({}).hasOwnProperty.call(l,n)&&(e[n]=l[n])}return e}).apply(null,arguments)}const c=function(){function e(){}return e.prototype.then=function(t,l){const n=new e,i=this.s;if(i){const e=1&i?t:l;if(e){try{v(n,1,e(this.v))}catch(e){v(n,2,e)}return n}return this}return this.o=function(e){try{const i=e.v;1&e.s?v(n,1,t?t(i):i):l?v(n,1,l(i)):v(n,2,i)}catch(e){v(n,2,e)}},n},e}();function v(e,t,l){if(!e.s){if(l instanceof c){if(!l.s)return void(l.o=v.bind(null,e,t));1&t&&(t=l.s),l=l.v}if(l&&l.then)return void l.then(v.bind(null,e,t),v.bind(null,e,2));e.s=t,e.v=l;const n=e.o;n&&n(e)}}function p(e){return e instanceof c&&1&e.s}function m(e,t){try{var l=e()}catch(e){return t(e)}return l&&l.then?l.then(void 0,t):l}function E(e,t){try{var l=e()}catch(e){return t(!0,e)}return l&&l.then?l.then(t.bind(null,!1),t.bind(null,!0)):t(!1,l)}"undefined"!=typeof Symbol&&(Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator"))),"undefined"!=typeof Symbol&&(Symbol.asyncIterator||(Symbol.asyncIterator=Symbol("Symbol.asyncIterator")));var f=function(e,t){return e===t||e!=e&&t!=t},A=function(e,t){for(var l=e.length;l--;)if(f(e[l][0],t))return l;return-1},g=Array.prototype.splice;function S(e){var t=-1,l=null==e?0:e.length;for(this.clear();++t<l;){var n=e[t];this.set(n[0],n[1])}}S.prototype.clear=function(){this.__data__=[],this.size=0},S.prototype.delete=function(e){var t=this.__data__,l=A(t,e);return!(l<0||(l==t.length-1?t.pop():g.call(t,l,1),--this.size,0))},S.prototype.get=function(e){var t=this.__data__,l=A(t,e);return l<0?void 0:t[l][1]},S.prototype.has=function(e){return A(this.__data__,e)>-1},S.prototype.set=function(e,t){var l=this.__data__,n=A(l,e);return n<0?(++this.size,l.push([e,t])):l[n][1]=t,this};var h=S,y="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 T,b="object"==typeof y&&y&&y.Object===Object&&y,C="object"==typeof self&&self&&self.Object===Object&&self,P=b||C||Function("return this")(),N=P.Symbol,I=Object.prototype,L=I.hasOwnProperty,B=I.toString,O=N?N.toStringTag:void 0,R=Object.prototype.toString,w=N?N.toStringTag:void 0,x=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":w&&w in Object(e)?function(e){var t=L.call(e,O),l=e[O];try{e[O]=void 0;var n=!0}catch(e){}var i=B.call(e);return n&&(t?e[O]=l:delete e[O]),i}(e):function(e){return R.call(e)}(e)},M=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},F=function(e){if(!M(e))return!1;var t=x(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t},k=P["__core-js_shared__"],U=(T=/[^.]+$/.exec(k&&k.keys&&k.keys.IE_PROTO||""))?"Symbol(src)_1."+T:"",H=Function.prototype.toString,W=function(e){if(null!=e){try{return H.call(e)}catch(e){}try{return e+""}catch(e){}}return""},G=/^\[object .+?Constructor\]$/,j=RegExp("^"+Function.prototype.toString.call(Object.prototype.hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),K=function(e,t){var l=function(e,t){return null==e?void 0:e[t]}(e,t);return function(e){return!(!M(e)||(t=e,U&&U in t))&&(F(e)?j:G).test(W(e));var t}(l)?l:void 0},Y=K(P,"Map"),$=K(Object,"create"),z=Object.prototype.hasOwnProperty,V=Object.prototype.hasOwnProperty;function q(e){var t=-1,l=null==e?0:e.length;for(this.clear();++t<l;){var n=e[t];this.set(n[0],n[1])}}q.prototype.clear=function(){this.__data__=$?$(null):{},this.size=0},q.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},q.prototype.get=function(e){var t=this.__data__;if($){var l=t[e];return"__lodash_hash_undefined__"===l?void 0:l}return z.call(t,e)?t[e]:void 0},q.prototype.has=function(e){var t=this.__data__;return $?void 0!==t[e]:V.call(t,e)},q.prototype.set=function(e,t){var l=this.__data__;return this.size+=this.has(e)?0:1,l[e]=$&&void 0===t?"__lodash_hash_undefined__":t,this};var X=q,J=function(e,t){var l=e.__data__;return function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}(t)?l["string"==typeof t?"string":"hash"]:l.map};function Z(e){var t=-1,l=null==e?0:e.length;for(this.clear();++t<l;){var n=e[t];this.set(n[0],n[1])}}Z.prototype.clear=function(){this.size=0,this.__data__={hash:new X,map:new(Y||h),string:new X}},Z.prototype.delete=function(e){var t=J(this,e).delete(e);return this.size-=t?1:0,t},Z.prototype.get=function(e){return J(this,e).get(e)},Z.prototype.has=function(e){return J(this,e).has(e)},Z.prototype.set=function(e,t){var l=J(this,e),n=l.size;return l.set(e,t),this.size+=l.size==n?0:1,this};var Q=Z;function ee(e){var t=this.__data__=new h(e);this.size=t.size}ee.prototype.clear=function(){this.__data__=new h,this.size=0},ee.prototype.delete=function(e){var t=this.__data__,l=t.delete(e);return this.size=t.size,l},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 l=this.__data__;if(l instanceof h){var n=l.__data__;if(!Y||n.length<199)return n.push([e,t]),this.size=++l.size,this;l=this.__data__=new Q(n)}return l.set(e,t),this.size=l.size,this};var te=ee,le=function(){try{var e=K(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),ne=function(e,t,l){"__proto__"==t&&le?le(e,t,{configurable:!0,enumerable:!0,value:l,writable:!0}):e[t]=l},ie=Object.prototype.hasOwnProperty,oe=function(e,t,l){var n=e[t];ie.call(e,t)&&f(n,l)&&(void 0!==l||t in e)||ne(e,t,l)},ae=function(e,t,l,n){var i=!l;l||(l={});for(var o=-1,a=t.length;++o<a;){var r=t[o],u=n?n(l[r],e[r],r,l,e):void 0;void 0===u&&(u=e[r]),i?ne(l,r,u):oe(l,r,u)}return l},re=function(e){return null!=e&&"object"==typeof e},ue=function(e){return re(e)&&"[object Arguments]"==x(e)},de=Object.prototype,se=de.hasOwnProperty,ce=de.propertyIsEnumerable,ve=ue(function(){return arguments}())?ue:function(e){return re(e)&&se.call(e,"callee")&&!ce.call(e,"callee")},pe=Array.isArray,me=function(){return!1},Ee=D(function(e,t){var l=t&&!t.nodeType&&t,n=l&&e&&!e.nodeType&&e,i=n&&n.exports===l?P.Buffer:void 0;e.exports=(i?i.isBuffer:void 0)||me}),_e=/^(?:0|[1-9]\d*)$/,fe=function(e,t){var l=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==l||"symbol"!=l&&_e.test(e))&&e>-1&&e%1==0&&e<t},Ae=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991},ge={};ge["[object Float32Array]"]=ge["[object Float64Array]"]=ge["[object Int8Array]"]=ge["[object Int16Array]"]=ge["[object Int32Array]"]=ge["[object Uint8Array]"]=ge["[object Uint8ClampedArray]"]=ge["[object Uint16Array]"]=ge["[object Uint32Array]"]=!0,ge["[object Arguments]"]=ge["[object Array]"]=ge["[object ArrayBuffer]"]=ge["[object Boolean]"]=ge["[object DataView]"]=ge["[object Date]"]=ge["[object Error]"]=ge["[object Function]"]=ge["[object Map]"]=ge["[object Number]"]=ge["[object Object]"]=ge["[object RegExp]"]=ge["[object Set]"]=ge["[object String]"]=ge["[object WeakMap]"]=!1;var Se=function(e){return function(t){return e(t)}},he=D(function(e,t){var l=t&&!t.nodeType&&t,n=l&&e&&!e.nodeType&&e,i=n&&n.exports===l&&b.process,o=function(){try{return n&&n.require&&n.require("util").types||i&&i.binding&&i.binding("util")}catch(e){}}();e.exports=o}),ye=he&&he.isTypedArray,De=ye?Se(ye):function(e){return re(e)&&Ae(e.length)&&!!ge[x(e)]},Te=Object.prototype.hasOwnProperty,be=function(e,t){var l=pe(e),n=!l&&ve(e),i=!l&&!n&&Ee(e),o=!l&&!n&&!i&&De(e),a=l||n||i||o,r=a?function(e,t){for(var l=-1,n=Array(e);++l<e;)n[l]=t(l);return n}(e.length,String):[],u=r.length;for(var d in e)!t&&!Te.call(e,d)||a&&("length"==d||i&&("offset"==d||"parent"==d)||o&&("buffer"==d||"byteLength"==d||"byteOffset"==d)||fe(d,u))||r.push(d);return r},Ce=Object.prototype,Pe=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Ce)},Ne=function(e,t){return function(l){return e(t(l))}},Ie=Ne(Object.keys,Object),Le=Object.prototype.hasOwnProperty,Be=function(e){return null!=e&&Ae(e.length)&&!F(e)},Oe=function(e){return Be(e)?be(e):function(e){if(!Pe(e))return Ie(e);var t=[];for(var l in Object(e))Le.call(e,l)&&"constructor"!=l&&t.push(l);return t}(e)},Re=Object.prototype.hasOwnProperty,we=function(e){return Be(e)?be(e,!0):function(e){if(!M(e))return function(e){var t=[];if(null!=e)for(var l in Object(e))t.push(l);return t}(e);var t=Pe(e),l=[];for(var n in e)("constructor"!=n||!t&&Re.call(e,n))&&l.push(n);return l}(e)},xe=D(function(e,t){var l=t&&!t.nodeType&&t,n=l&&e&&!e.nodeType&&e,i=n&&n.exports===l?P.Buffer:void 0,o=i?i.allocUnsafe:void 0;e.exports=function(e,t){if(t)return e.slice();var l=e.length,n=o?o(l):new e.constructor(l);return e.copy(n),n}}),Me=function(){return[]},Fe=Object.prototype.propertyIsEnumerable,ke=Object.getOwnPropertySymbols,Ue=ke?function(e){return null==e?[]:(e=Object(e),function(t,l){for(var n=-1,i=null==t?0:t.length,o=0,a=[];++n<i;){var r=t[n];Fe.call(e,r)&&(a[o++]=r)}return a}(ke(e)))}:Me,He=function(e,t){for(var l=-1,n=t.length,i=e.length;++l<n;)e[i+l]=t[l];return e},We=Ne(Object.getPrototypeOf,Object),Ge=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)He(t,Ue(e)),e=We(e);return t}:Me,je=function(e,t,l){var n=t(e);return pe(e)?n:He(n,l(e))},Ke=function(e){return je(e,Oe,Ue)},Ye=function(e){return je(e,we,Ge)},$e=K(P,"DataView"),ze=K(P,"Promise"),Ve=K(P,"Set"),qe=K(P,"WeakMap"),Xe=W($e),Je=W(Y),Ze=W(ze),Qe=W(Ve),et=W(qe),tt=x;($e&&"[object DataView]"!=tt(new $e(new ArrayBuffer(1)))||Y&&"[object Map]"!=tt(new Y)||ze&&"[object Promise]"!=tt(ze.resolve())||Ve&&"[object Set]"!=tt(new Ve)||qe&&"[object WeakMap]"!=tt(new qe))&&(tt=function(e){var t=x(e),l="[object Object]"==t?e.constructor:void 0,n=l?W(l):"";if(n)switch(n){case Xe:return"[object DataView]";case Je:return"[object Map]";case Ze:return"[object Promise]";case Qe:return"[object Set]";case et:return"[object WeakMap]"}return t});var lt=tt,nt=Object.prototype.hasOwnProperty,it=P.Uint8Array,ot=function(e){var t=new e.constructor(e.byteLength);return new it(t).set(new it(e)),t},at=/\w*$/,rt=N?N.prototype:void 0,ut=rt?rt.valueOf:void 0,dt=Object.create,st=function(){function e(){}return function(t){if(!M(t))return{};if(dt)return dt(t);e.prototype=t;var l=new e;return e.prototype=void 0,l}}(),ct=he&&he.isMap,vt=ct?Se(ct):function(e){return re(e)&&"[object Map]"==lt(e)},pt=he&&he.isSet,mt=pt?Se(pt):function(e){return re(e)&&"[object Set]"==lt(e)},Et={};Et["[object Arguments]"]=Et["[object Array]"]=Et["[object ArrayBuffer]"]=Et["[object DataView]"]=Et["[object Boolean]"]=Et["[object Date]"]=Et["[object Float32Array]"]=Et["[object Float64Array]"]=Et["[object Int8Array]"]=Et["[object Int16Array]"]=Et["[object Int32Array]"]=Et["[object Map]"]=Et["[object Number]"]=Et["[object Object]"]=Et["[object RegExp]"]=Et["[object Set]"]=Et["[object String]"]=Et["[object Symbol]"]=Et["[object Uint8Array]"]=Et["[object Uint8ClampedArray]"]=Et["[object Uint16Array]"]=Et["[object Uint32Array]"]=!0,Et["[object Error]"]=Et["[object Function]"]=Et["[object WeakMap]"]=!1;var _t=function e(t,l,n,i,o,a){var r,u=1&l,d=2&l,s=4&l;if(n&&(r=o?n(t,i,o,a):n(t)),void 0!==r)return r;if(!M(t))return t;var c=pe(t);if(c){if(r=function(e){var t=e.length,l=new e.constructor(t);return t&&"string"==typeof e[0]&&nt.call(e,"index")&&(l.index=e.index,l.input=e.input),l}(t),!u)return function(e,t){var l=-1,n=e.length;for(t||(t=Array(n));++l<n;)t[l]=e[l];return t}(t,r)}else{var v=lt(t),p="[object Function]"==v||"[object GeneratorFunction]"==v;if(Ee(t))return xe(t,u);if("[object Object]"==v||"[object Arguments]"==v||p&&!o){if(r=d||p?{}:function(e){return"function"!=typeof e.constructor||Pe(e)?{}:st(We(e))}(t),!u)return d?function(e,t){return ae(e,Ge(e),t)}(t,function(e,t){return e&&ae(t,we(t),e)}(r,t)):function(e,t){return ae(e,Ue(e),t)}(t,function(e,t){return e&&ae(t,Oe(t),e)}(r,t))}else{if(!Et[v])return o?t:{};r=function(e,t,l){var n,i,o=e.constructor;switch(t){case"[object ArrayBuffer]":return ot(e);case"[object Boolean]":case"[object Date]":return new o(+e);case"[object DataView]":return function(e,t){var l=t?ot(e.buffer):e.buffer;return new e.constructor(l,e.byteOffset,e.byteLength)}(e,l);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 l=t?ot(e.buffer):e.buffer;return new e.constructor(l,e.byteOffset,e.length)}(e,l);case"[object Map]":return new o;case"[object Number]":case"[object String]":return new o(e);case"[object RegExp]":return(i=new(n=e).constructor(n.source,at.exec(n))).lastIndex=n.lastIndex,i;case"[object Set]":return new o;case"[object Symbol]":return ut?Object(ut.call(e)):{}}}(t,v,u)}}a||(a=new te);var m=a.get(t);if(m)return m;a.set(t,r),mt(t)?t.forEach(function(i){r.add(e(i,l,n,i,t,a))}):vt(t)&&t.forEach(function(i,o){r.set(o,e(i,l,n,o,t,a))});var E=c?void 0:(s?d?Ye:Ke:d?we:Oe)(t);return function(e,t){for(var l=-1,n=null==e?0:e.length;++l<n&&!1!==t(e[l],l););}(E||t,function(i,o){E&&(i=t[o=i]),oe(r,o,e(i,l,n,o,t,a))}),r},ft=function(e){return _t(e,5)};const At=e=>{switch(e){case"Name":return/^[^{0-9}^\$\"<>?\\\\~!@#$%^()+={}\[\]*,/_:;“”‘’]{1,50}$/i;case"MobileNo":return/^[6-9]{1}[0-9]{9}$/i}},gt=function(e,t,l){if(void 0===e&&(e=""),void 0===t&&(t=""),void 0===l&&(l=""),""==t)return e;for(;e.includes(t);)e=e.replace(t,l);return e},St=(e,t,l)=>e.sort((e,n)=>l(e[t]).localeCompare(l(n[t]))),ht=()=>require("uuid/v4")(),yt=(e,t)=>{var l,n;let i={Noc:e},o=(null==t||null===(l=t.nocDocuments)||void 0===l?void 0:l.nocDocuments.length)>0&&(null==t||null===(n=t.nocDocuments)||void 0===n?void 0:n.nocDocuments.filter(t=>{var l;return t.documentType.includes(null==e||null===(l=e.nocType)||void 0===l?void 0:l.split("_")[0])}).map(e=>({fileName:(null==e?void 0:e.fileName)||"",name:(null==e?void 0:e.name)||"",fileStoreId:null==e?void 0:e.fileStoreId,fileUrl:"",isClickable:!0,link:"",title:null==e?void 0:e.documentType,documentType:null==e?void 0:e.documentType,id:null==e?void 0:e.id,additionalDetails:{}})))||[];return o=[...o,...null!=t&&t.PrevStateNocDocuments?null==t?void 0:t.PrevStateNocDocuments.filter(t=>{var l;return t.documentType.includes(null==e||null===(l=e.nocType)||void 0===l?void 0:l.split("_")[0])}):[]],i.Noc.documents=o,i},Dt=function(e,t,l,n){try{return Promise.resolve(Digit.OBPSService.scrutinyDetails(null==e?void 0:e.tenantId,{edcrNumber:null==e?void 0:e.edcrNumber})).then(function(i){var o,a,r,u,d,s,c,v,p,m,E,_,f,A,g,S,h,y,D,T,b,C,P,N,I,L,B,O,R,w,x,M;const F=null==i?void 0:i.edcrDetail[0];var k,U,H,W;e.BlockIds=(e=>{let t={};return e&&e.map((e,l)=>{t["Block_"+(l+1)]=e.id}),t})(null==e||null===(o=e.landInfo)||void 0===o?void 0:o.unit),e.address=null==e||null===(a=e.landInfo)||void 0===a?void 0:a.address,e.address.locality.i18nkey=""+n(`${gt(null==e||null===(r=e.landInfo)||void 0===r||null===(u=r.address)||void 0===u?void 0:u.tenantId,".","_").toUpperCase()}_REVENUE_${null==e||null===(d=e.landInfo)||void 0===d||null===(s=d.address)||void 0===s||null===(c=s.locality)||void 0===c?void 0:c.code}`),e.placeName=(null==e||null===(v=e.additionalDetails)||void 0===v?void 0:v.GISPlaceName)||"",e.data={scrutinyNumber:{edcrNumber:null==F?void 0:F.edcrNumber},applicantName:null==F||null===(p=F.planDetail)||void 0===p||null===(m=p.planInformation)||void 0===m?void 0:m.applicantName,applicationDate:null==e||null===(E=e.auditDetails)||void 0===E?void 0:E.createdTime,applicationType:null==F?void 0:F.appliactionType,holdingNumber:null==e||null===(_=e.additionalDetails)||void 0===_?void 0:_.holdingNo,boundaryWallLength:null==e||null===(f=e.additionalDetails)||void 0===f?void 0:f.boundaryWallLength,occupancyType:null==F||null===(A=F.planDetail)||void 0===A||null===(g=A.planInformation)||void 0===g?void 0:g.occupancy,registrationDetails:null==e||null===(S=e.additionalDetails)||void 0===S?void 0:S.registrationDetails,riskType:Digit.Utils.obps.calculateRiskType(null==t||null===(h=t.BPA)||void 0===h?void 0:h.RiskTypeComputation,null==F||null===(y=F.planDetail)||void 0===y||null===(D=y.plot)||void 0===D?void 0:D.area,null==F||null===(T=F.planDetail)||void 0===T?void 0:T.blocks),serviceType:(null==e||null===(b=e.additionalDetails)||void 0===b?void 0:b.serviceType)||(null==F?void 0:F.applicationSubType)},null==e||e.landInfo.owners.map((e,t)=>{e.gender={active:!0,code:e.gender,i18nKey:"COMMON_GENDER_"+e.gender}}),e.owners={owners:null==e||null===(C=e.landInfo)||void 0===C?void 0:C.owners,ownershipCategory:{active:!0,code:null==e||null===(P=e.landInfo)||void 0===P?void 0:P.ownershipCategory,i18nKey:"COMMON_MASTERS_OWNERSHIPCATEGORY_"+(null==e||null===(N=e.landInfo)||void 0===N?void 0:N.ownershipCategory.replaceAll(".","_"))}},e.riskType=Digit.Utils.obps.calculateRiskType(null==t||null===(I=t.BPA)||void 0===I?void 0:I.RiskTypeComputation,null==F||null===(L=F.planDetail)||void 0===L||null===(B=L.plot)||void 0===B?void 0:B.area,null==F||null===(O=F.planDetail)||void 0===O?void 0:O.blocks),e.subOccupancy=(e=>{let t=[],l=[],i={};return e&&e.map((e,o)=>{var a,r;t=null==e||null===(a=e.usageCategory)||void 0===a?void 0:a.split(","),l=[],t&&(null===(r=t)||void 0===r?void 0:r.length)>0&&""!=t&&t.map((e,t)=>{l.push({code:e,i18nKey:"BPA_SUBOCCUPANCYTYPE_"+e.replaceAll(".","_"),name:n("BPA_SUBOCCUPANCYTYPE_"+e.replaceAll(".","_"))})}),i["Block_"+(o+1)]=l}),i})(null==e||null===(R=e.landInfo)||void 0===R?void 0:R.unit),e.uiFlow={flow:null!=e&&e.businessService.includes("OC")?"OCBPA":null==e||null===(w=e.businessService)||void 0===w?void 0:w.split(".")[0],applicationType:(null==e||null===(x=e.additionalDetails)||void 0===x?void 0:x.applicationType)||(null==F?void 0:F.appliactionType),serviceType:(null==e||null===(M=e.additionalDetails)||void 0===M?void 0:M.serviceType)||(null==F?void 0:F.applicationSubType)},null!=e&&e.businessService.includes("OC")?(sessionStorage.setItem("BPAintermediateValue",JSON.stringify({...e})),l.push(`/digit-ui/citizen/obps/ocbpa/${null==e||null===(k=e.additionalDetails)||void 0===k?void 0:k.applicationType.toLowerCase()}/${null==e||null===(U=e.additionalDetails)||void 0===U?void 0:U.serviceType.toLowerCase()}`)):(sessionStorage.setItem("BPAintermediateValue",JSON.stringify({...e})),l.push(`/digit-ui/citizen/obps/bpa/${null==e||null===(H=e.additionalDetails)||void 0===H?void 0:H.applicationType.toLowerCase()}/${null==e||null===(W=e.additionalDetails)||void 0===W?void 0:W.serviceType.toLowerCase()}`))})}catch(e){return Promise.reject(e)}},Tt=(e,t)=>{let l=[];const n={documentType:"ARCHITECT.UNDERTAKING",fileStoreId:sessionStorage.getItem("ArchitectConsentdocFilestoreid"),fileStore:sessionStorage.getItem("ArchitectConsentdocFilestoreid")};return e&&e.map(e=>{let t;var n,i,o,a;console.log("ob",e),e.id?(t={documentType:e.documentType,fileStoreId:e.fileStoreId,fileStore:e.fileStoreId,fileName:"",fileUrl:"",additionalDetails:{},id:e.id},"SITEPHOTOGRAPH.ONE"===e.documentType&&(t.additionalDetails={latitude:null==e||null===(n=e.additionalDetails)||void 0===n?void 0:n.latitude,longitude:null==e||null===(i=e.additionalDetails)||void 0===i?void 0:i.longitude})):(t={documentType:e.documentType,fileStoreId:e.fileStoreId,fileStore:e.fileStoreId,fileName:"",fileUrl:"",additionalDetails:{}},"SITEPHOTOGRAPH.ONE"===e.documentType&&(t.additionalDetails={latitude:null==e||null===(o=e.additionalDetails)||void 0===o?void 0:o.latitude,longitude:null==e||null===(a=e.additionalDetails)||void 0===a?void 0:a.longitude})),l.push(t)}),l.push(n),l=[...l,...t||[]],l};function bt(e){let t="";return e.map((e,l)=>{t=t+(0!==l?",":"")+e.code}),t}const Ct=e=>{var t;let l=[],n=null==e?void 0:e.subOccupancy;if(n){var i;let t=Object.entries(n);null==e||null===(i=e.landInfo)||void 0===i||i.unit.map((e,n)=>{t.map((t,n)=>{var i;e.id&&e.floorNo===(null===(i=t[0])||void 0===i?void 0:i.split("_")[1])&&l.push({...e,usageCategory:bt(t[1])})})}),t&&t.map((e,t)=>{var n;l.length>0&&(null==l?void 0:l.some(t=>{var l;return(null==t?void 0:t.floorNo)===(null===(l=e[0])||void 0===l?void 0:l.split("_")[1])}))||l.push({blockIndex:t,floorNo:null===(n=e[0])||void 0===n?void 0:n.split("_")[1],unitType:"Block",usageCategory:bt(e[1])})})}return l.length>0?l:null==e||null===(t=e.landInfo)||void 0===t?void 0:t.unit},Pt=(e,t)=>{var l,n,i;if(t)return e.landInfo.owners;let o=ft(null==e||null===(l=e.owners)||void 0===l?void 0:l.owners);return o&&(null==o||o.forEach(e=>{var t,l;null!=e&&null!==(t=e.gender)&&void 0!==t&&t.code&&(e.gender=null===(l=e.gender)||void 0===l?void 0:l.code),null!=e&&e.fatherOrHusbandName||(e.fatherOrHusbandName="NAME"),e.active=!0})),null==e||null===(n=e.landInfo)||void 0===n||null===(i=n.owners)||void 0===i||i.map(e=>{(null==o?void 0:o.length)>0&&(null==o?void 0:o.some(t=>t.id===e.id))||null==o||o.push({...e,active:!1})}),o},Nt=(e,t)=>{var l,n;return t?null==e||null===(l=e.landInfo)||void 0===l?void 0:l.ownershipCategory:e.owners.ownershipCategory||(null==e||null===(n=e.landInfo)||void 0===n?void 0:n.ownershipCategory)},It=function(e,t,l){var n,i,o,a,r,u,d,s,c,v,p,m,E,_,f,A,g,S,h,y,D,T,b,C,P,N,I;return void 0===t&&(t=!1),void 0===l&&(l=!1),t?(e.landInfo=e.landInfo,e.landInfo.owners.forEach((t,l)=>{var n,i;null!=t&&null!==(n=t.gender)&&void 0!==n&&n.code&&(e.landInfo.owners[l].gender=null==t||null===(i=t.gender)||void 0===i?void 0:i.code)})):(e.landInfo.owners.map((t,l)=>{var n;e.landInfo.owners[l].gender=null==t||null===(n=t.gender)||void 0===n?void 0:n.code}),e.landInfo.address.pincode=null==e||null===(E=e.address)||void 0===E?void 0:E.pincode,e.landInfo.address.city=null==e||null===(_=e.address)||void 0===_||null===(f=_.city)||void 0===f?void 0:f.code,e.landInfo.address.locality=null==e||null===(A=e.address)||void 0===A?void 0:A.locality,e.landInfo.address.landmark=null==e||null===(g=e.address)||void 0===g?void 0:g.landmark,e.landInfo.address.street=null!=e&&null!==(S=e.address)&&void 0!==S&&S.street?null==e||null===(h=e.address)||void 0===h?void 0:h.street:null,e.landInfo.address.city=(null==e||null===(y=e.landInfo)||void 0===y||null===(D=y.address)||void 0===D||null===(T=D.city)||void 0===T?void 0:T.code)||(null==e||null===(b=e.landInfo)||void 0===b||null===(C=b.address)||void 0===C?void 0:C.tenantId),e.landInfo.unit=null!=e&&null!==(P=e.landInfo)&&void 0!==P&&P.unit&&(null==e||null===(N=e.landInfo)||void 0===N?void 0:N.unit.length)>0?(e=>{let t=[];return e&&e.map((e,l)=>{t.push({blockIndex:l,usageCategory:e.usageCategory,occupancyType:e.occupancyType,floorNo:e.floorNo,unitType:e.unitType,id:e.id})}),t})(null==e||null===(I=e.landInfo)||void 0===I?void 0:I.unit):null!=e&&e.subOccupancy?(e=>{let t=[];return e&&Object.entries(e).map((e,l)=>{var n;t.push({blockIndex:l,floorNo:null===(n=e[0])||void 0===n?void 0:n.split("_")[1],unitType:"Block",usageCategory:bt(e[1])})}),t})(null==e?void 0:e.subOccupancy):[]),{BPA:{id:null==e?void 0:e.id,applicationNo:null==e?void 0:e.applicationNo,approvalNo:null==e?void 0:e.approvalNo,accountId:null==e?void 0:e.accountId,edcrNumber:null==e?void 0:e.edcrNumber,riskType:null==e?void 0:e.riskType,businessService:null==e?void 0:e.businessService,landId:null==e?void 0:e.landId,tenantId:(null==e?void 0:e.tenantId)||(null==e||null===(n=e.address)||void 0===n?void 0:n.tenantId),approvalDate:null==e?void 0:e.approvalDate,applicationDate:null==e?void 0:e.applicationDate,status:l||e.status?e.status:"INITIATED",documents:Tt(null==e||null===(i=e.documents)||void 0===i?void 0:i.documents,null==e?void 0:e.PrevStateDocuments),landInfo:t?null==e?void 0:e.landInfo:{...null==e?void 0:e.landInfo,ownershipCategory:Nt(e,t),owners:Pt(e,t),unit:Ct(e)},assignee:l?e.assignee:[],workflow:{action:"SEND_TO_CITIZEN",assignes:null,comments:null,varificationDocuments:null},auditDetails:null==e?void 0:e.auditDetails,additionalDetails:{...null==e?void 0:e.additionalDetails,OTPverfiedTimeSamp:sessionStorage.getItem("otpVerifiedTimestamp"),otherFeesDiscription:sessionStorage.getItem("otherChargesDisc"),lessAdjustmentFeeFiles:JSON.parse(sessionStorage.getItem("uploadedFileLess")),selfCertificationCharges:{BPA_MALBA_CHARGES:sessionStorage.getItem("Malbafees"),BPA_LABOUR_CESS:sessionStorage.getItem("LabourCess"),BPA_WATER_CHARGES:sessionStorage.getItem("WaterCharges"),BPA_GAUSHALA_CHARGES_CESS:sessionStorage.getItem("GaushalaFees"),BPA_LESS_ADJUSMENT_PLOT:sessionStorage.getItem("lessAdjusment"),BPA_DEVELOPMENT_CHARGES:sessionStorage.getItem("development"),BPA_OTHER_CHARGES:sessionStorage.getItem("otherCharges")},GISPlaceName:null==e||null===(o=e.address)||void 0===o?void 0:o.placeName,holdingNo:null!=e&&null!==(a=e.data)&&void 0!==a&&a.holdingNumber?null==e||null===(r=e.data)||void 0===r?void 0:r.holdingNumber:null==e||null===(u=e.additionalDetails)||void 0===u?void 0:u.holdingNo,boundaryWallLength:null!=e&&null!==(d=e.data)&&void 0!==d&&d.boundaryWallLength?null==e||null===(s=e.data)||void 0===s?void 0:s.boundaryWallLength:null==e||null===(c=e.additionalDetails)||void 0===c?void 0:c.boundaryWallLength,registrationDetails:null!=e&&null!==(v=e.data)&&void 0!==v&&v.registrationDetails?null==e||null===(p=e.data)||void 0===p?void 0:p.registrationDetails:null==e||null===(m=e.additionalDetails)||void 0===m?void 0:m.registrationDetails,architectconsentdocument:{documentType:"Architect Consent Form",fileStoreId:sessionStorage.getItem("ArchitectConsentform"),fileStore:sessionStorage.getItem("ArchitectConsentform")}},applicationType:"BUILDING_PLAN_SCRUTINY",serviceType:"NEW_CONSTRUCTION",occupancyType:"A"}}},Lt=e=>{var t;let l=[];return null===(t=e.documents)||void 0===t||t.documents.map(t=>{var n,i;l.push({fileStoreId:t.fileStoreId,fileStore:t.fileStoreId,fileName:t.fileName,fileUrl:"",documentType:t.documentType,tenantId:null==e||null===(n=e.result)||void 0===n||null===(i=n.Licenses[0])||void 0===i?void 0:i.tenantId})}),l},Bt=function(e,t){void 0===t&&(t="dayend");try{const l=e.match(/(\d{4})-(\d{1,2})-(\d{1,2})/),n=new Date(Date.UTC(l[1],l[2]-1,l[3]));return n.setMinutes(n.getMinutes()+n.getTimezoneOffset()),"dayend"===t&&(n.setHours(n.getHours()+24),n.setSeconds(n.getSeconds()-1)),n.getTime()}catch(t){return e}},Ot=e=>{if(null==e||null==e||""==e)return"NA";const t=new Date(e);let l=t.getMonth()+1,n=t.getDate();return l=(l>9?"":"0")+l,n=(n>9?"":"0")+n,`${n}/${l}/${t.getFullYear()}`},Rt=function(e,t,l,n,i){try{var o,a,r,u,d,s,c,v,p,m,E,_,f,A,g,S,h,y,D,T,b,C,P,N,I,L,B,O;const R=e=>{let t=[],l=[],n={};return e&&e.map((e,o)=>{var a;t=null==e||null===(a=e.usageCategory)||void 0===a?void 0:a.split(","),l=[],t&&t.map((e,t)=>{l.push({code:e,i18nKey:"BPA_SUBOCCUPANCYTYPE_"+e.replaceAll(".","_"),name:i("BPA_SUBOCCUPANCYTYPE_"+e.replaceAll(".","_"))})}),n["Block_"+(o+1)]=l}),n};e.BlockIds=(e=>{let t={};return e&&e.map((e,l)=>{t["Block_"+(l+1)]=e.id}),t})(null==e||null===(o=e.landInfo)||void 0===o?void 0:o.unit),e.address=null==e||null===(a=e.landInfo)||void 0===a?void 0:a.address,e.data={applicantName:null==t||null===(r=t.planDetail)||void 0===r||null===(u=r.planInformation)||void 0===u?void 0:u.applicantName,applicationDate:null==e||null===(d=e.auditDetails)||void 0===d?void 0:d.createdTime,applicationType:null==t?void 0:t.appliactionType,holdingNumber:null==e||null===(s=e.additionalDetails)||void 0===s?void 0:s.holdingNo,boundaryWallLength:null==e||null===(c=e.additionalDetails)||void 0===c?void 0:c.boundaryWallLength,occupancyType:null==t||null===(v=t.planDetail)||void 0===v||null===(p=v.planInformation)||void 0===p?void 0:p.occupancy,registrationDetails:null==e||null===(m=e.additionalDetails)||void 0===m?void 0:m.registrationDetails,riskType:Digit.Utils.obps.calculateRiskType(null==l||null===(E=l.BPA)||void 0===E?void 0:E.RiskTypeComputation,null==t||null===(_=t.planDetail)||void 0===_||null===(f=_.plot)||void 0===f?void 0:f.area,null==t||null===(A=t.planDetail)||void 0===A?void 0:A.blocks),serviceType:(null==e||null===(g=e.additionalDetails)||void 0===g?void 0:g.serviceType)||(null==t?void 0:t.applicationSubType),edcrDetails:t,scrutinyNumber:{edcrNumber:null==t?void 0:t.edcrNumber}};let w=[];null==e||e.documents.map(e=>w.push(e)),e.PrevStateDocuments=ft(w),e.documents={documents:[]};let x=[];n&&n.map((e,t)=>{e.documents&&e.documents.map((e,t)=>{x.push(e)})}),e.PrevStateNocDocuments=x,e.nocDocuments={NocDetails:n,nocDocuments:[]},null==e||e.landInfo.owners.map((e,t)=>{e.gender={active:!0,code:e.gender,i18nKey:"COMMON_GENDER_"+e.gender}}),e.owners={owners:null==e||null===(S=e.landInfo)||void 0===S?void 0:S.owners,ownershipCategory:{active:!0,code:null==e||null===(h=e.landInfo)||void 0===h?void 0:h.ownershipCategory,i18nKey:"COMMON_MASTERS_OWNERSHIPCATEGORY_"+(null==e||null===(y=e.landInfo)||void 0===y?void 0:y.ownershipCategory.replaceAll(".","_"))}},e.riskType=Digit.Utils.obps.calculateRiskType(null==l||null===(D=l.BPA)||void 0===D?void 0:D.RiskTypeComputation,null==t||null===(T=t.planDetail)||void 0===T||null===(b=T.plot)||void 0===b?void 0:b.area,null==t||null===(C=t.planDetail)||void 0===C?void 0:C.blocks),e.subOccupancy=R(null==e||null===(P=e.landInfo)||void 0===P?void 0:P.unit);let M="BPA";return null==l||null===(N=l.BPA)||void 0===N||null===(I=N.homePageUrlLinks)||void 0===I||I.map(e=>{(null==t?void 0:t.appliactionType)===(null==e?void 0:e.applicationType)&&(null==t?void 0:t.applicationSubType)===(null==e?void 0:e.serviceType)&&(M=null==e?void 0:e.flow)}),e.uiFlow={flow:null!=e&&e.businessService.includes("OC")?"OCBPA":null==e||null===(L=e.businessService)||void 0===L?void 0:L.split(".")[0],applicationType:(null==e||null===(B=e.additionalDetails)||void 0===B?void 0:B.applicationType)||(null==t?void 0:t.appliactionType),serviceType:(null==e||null===(O=e.additionalDetails)||void 0===O?void 0:O.serviceType)||(null==t?void 0:t.applicationSubType)},sessionStorage.setItem("BPA_IS_ALREADY_WENT_OFF_DETAILS",JSON.stringify(!0)),Promise.resolve(e)}catch(e){return Promise.reject(e)}},wt=(e,t)=>(t&&Object.keys(t).map(l=>{e=e.replace(":"+l,t[l])}),e),xt=e=>{try{const t=e.match(/(\d{2})-(\d{2})-(\d{4}) (\d{2}):(\d{2}):(\d{2})/);return Date.UTC(+t[3],t[2]-1,+t[1],+t[4],+t[5])}catch(t){return e}},Mt=(e,t)=>{let l="BPA.NC_APP_FEE";return"BPA_LOW"===e?l="BPA.LOW_RISK_PERMIT_FEE":"BPA"===e?l="PENDING_APPL_FEE"==t?"BPA.NC_APP_FEE":"BPA.NC_SAN_FEE":"BPA_OC"===e&&(l="PENDING_APPL_FEE"==t?"BPA.NC_OC_APP_FEE":"BPA.NC_OC_SAN_FEE"),l},Ft=(e,t)=>{if(window.mSewaApp&&window.mSewaApp.isMsewaApp()&&window.mSewaApp.downloadBase64File){var l=new FileReader;l.readAsDataURL(e),l.onloadend=function(){mSewaApp.downloadBase64File(l.result,t)}}else{const l=document.createElement("a");l.href=URL.createObjectURL(e),l.download=t,document.body.append(l),l.click(),l.remove(),setTimeout(()=>URL.revokeObjectURL(l.href),7e3)}},kt=e=>{const t=URL.createObjectURL(e);var l=window.open(t);null!=l&&l.addEventListener("load",e=>{l.focus(),l.print()})},Ut=function(e,t,l,n,i,o){void 0===i&&(i="download");try{function a(){return Promise.resolve(Digit.PaymentService.printReciept(l,{fileStoreIds:e.filestoreIds[0]})).then(function(l){var n;window.open(l[null===(n=e)||void 0===n?void 0:n.filestoreIds[0]],"_blank");const o=parseInt(e.status,10);201!==o&&200!==o||("print"==i?kt(new Blob([e.data],{type:"application/pdf"})):Ft(new Blob([e.data],{type:"application/pdf"}),`RECEIPT-${t}.pdf`))})}let e=null;console.log("payments",n);const o=function(t){if(null===(t=n[0])||void 0===t||!t.fileStoreId)return Promise.resolve(Digit.PaymentService.generatePdf(l,{Payments:n},"bpa-receipt")).then(function(t){e=t});var i;e={filestoreIds:[null===(i=n[0])||void 0===i?void 0:i.fileStoreId]}}();return Promise.resolve(o&&o.then?o.then(a):a())}catch(e){return Promise.reject(e)}},Ht=function(e,t){try{return Promise.resolve(Digit.OBPSService.scrutinyDetails(t,{edcrNumber:e})).then(function(l){return Promise.resolve(Digit.OBPSService.BPASearch(t,{edcrNumber:e})).then(function(e){var t,n,i,o,a,r,u,d,s,c,v,p;return 0==(null==e||null===(t=e.BPA)||void 0===t?void 0:t.length)?null!=l&&null!==(s=l.edcrDetail)&&void 0!==s&&s[0]?null==l||null===(c=l.edcrDetail)||void 0===c?void 0:c[0]:{type:"ERROR",message:"BPA_NO_RECORD_FOUND"}:(null==e||null===(n=e.BPA)||void 0===n?void 0:n.length)>0&&("INITIATED"==(null==e||null===(i=e.BPA)||void 0===i||null===(o=i[0])||void 0===o?void 0:o.status)||"REJECTED"==(null==e||null===(a=e.BPA)||void 0===a||null===(r=a[0])||void 0===r?void 0:r.status)||"PERMIT REVOCATION"==(null==e||null===(u=e.BPA)||void 0===u||null===(d=u[0])||void 0===d?void 0:d.status))?null!=l&&null!==(v=l.edcrDetail)&&void 0!==v&&v[0]?null==l||null===(p=l.edcrDetail)||void 0===p?void 0:p[0]:{type:"ERROR",message:"BPA_NO_RECORD_FOUND"}:{type:"ERROR",message:"APPLICATION_NUMBER_ALREADY_EXISTS"}})})}catch(e){return Promise.reject(e)}},Wt=function(e,t){void 0===t&&(t=!1);let l=[];if((null==e?void 0:e.length)>0){let n=e.filter((t,l)=>e.findIndex(e=>{var l,n,i,o,a,r;return(null==e||null===(l=e.documentType)||void 0===l||null===(n=l.split("."))||void 0===n||null===(i=n.slice(0,2))||void 0===i?void 0:i.join("_"))===(null==t||null===(o=t.documentType)||void 0===o||null===(a=o.split("."))||void 0===a||null===(r=a.slice(0,2))||void 0===r?void 0:r.join("_"))})===l);null==n||n.map(n=>{var i,o,a,r;const u=null==e?void 0:e.filter(e=>{var t,l,i,o,a,r;return(null==n||null===(t=n.documentType)||void 0===t||null===(l=t.split("."))||void 0===l||null===(i=l.slice(0,2))||void 0===i?void 0:i.join("_"))==(null==e||null===(o=e.documentType)||void 0===o||null===(a=o.split("."))||void 0===a||null===(r=a.slice(0,2))||void 0===r?void 0:r.join("_"))});null==u||u.forEach(e=>e.title=e.documentType),l.push({title:t?"":null==u||null===(i=u[0])||void 0===i||null===(o=i.documentType)||void 0===o||null===(a=o.split("."))||void 0===a||null===(r=a.slice(0,2))||void 0===r?void 0:r.join("_"),values:u})})}return l},Gt=e=>{var n,i,r,u,d,s,c;let{formState:v,Controller:p,register:m,control:E,t:_,reset:f,previousPage:A}=e;const g=Digit.ULBService.getStateId(),S=Digit.ULBService.getCurrentTenantId(),h=sessionStorage.getItem("Digit.citizen.userRequestObject"),y=h?JSON.parse(h):{},D=null==y||null===(n=y.value)||void 0===n?void 0:n.info,T=null==D?void 0:D.mobileNumber,b=a.useWatch({control:E,name:"applicationType"}),C=sessionStorage.getItem("search_application")||"";C&&"undefined"!=C&&(null===(i=JSON.parse(C))||void 0===i?void 0:i.code)!==(null==b?void 0:b.code)&&E.setValue("status",""),sessionStorage.setItem("search_application",JSON.stringify(b));const{applicationTypes:P,ServiceTypes:N}=Digit.Hooks.obps.useServiceTypeFromApplicationType({Applicationtype:(null==b?void 0:b.code)||((null==D||null===(r=D.roles)||void 0===r?void 0:r.filter(e=>e.code.includes("BPAREG_")).length)>0&&(null==D||null===(u=D.roles)||void 0===u?void 0:u.filter(e=>e.code.includes("BPA_")||e.code.includes("CITIZEN")).length)<=0?"BPA_STAKEHOLDER_REGISTRATION":"BUILDING_PLAN_SCRUTINY"),tenantId:g}),{data:I}=Digit.Hooks.obps.useBusinessServiceData(S,"BPA,BPA_LOW,BPA_OC,ARCHITECT,BUILDER,ENGINEER,STRUCTURALENGINEER",{});let L=[],B=[],O=[],R=[];null==I||null===(d=I.BusinessServices)||void 0===d||d.map(e=>{e.states.map(t=>{t.state&&t.applicationStatus&&("BPAREG"==e.business?O.push({code:t.applicationStatus,i18nKey:"WF_ARCHITECT_"+t.state,module:e.business}):"BPA_OC"==(null==e?void 0:e.businessService)?B.push({code:t.applicationStatus,i18nKey:"WF_BPA_"+t.state,module:e.business}):L.push({code:t.applicationStatus,i18nKey:"WF_BPA_"+t.state,module:e.business}))})});let w,x=[],M=[];for(w=0;w<L.length;w++)x[L[w].code]||(x[L[w].code]=!0,M.push(L[w].code));let F,k=[],U=[];for(F=0;F<B.length;F++)k[B[F].code]||(k[B[F].code]=!0,U.push(B[F].code));let H,W=[],G=[];for(H=0;H<O.length;H++)W[O[H].code]||(W[O[H].code]=!0,G.push(O[H].code));const j=[],K=[],Y=[];return M.forEach(e=>j.push({i18nKey:"WF_BPA_"+e,code:e})),U.forEach(e=>K.push({i18nKey:"WF_BPA_"+e,code:e})),G.forEach(e=>Y.push({i18nKey:"WF_BPA_"+e,code:e})),j.forEach(e=>{L.map(t=>{(null==e?void 0:e.code)==(null==t?void 0:t.code)&&(e.i18nKey=t.i18nKey)})}),K.forEach(e=>{B.map(t=>{(null==e?void 0:e.code)==(null==t?void 0:t.code)&&(e.i18nKey=t.i18nKey)})}),Y.forEach(e=>{O.map(t=>{(null==e?void 0:e.code)==(null==t?void 0:t.code)&&(e.i18nKey=t.i18nKey)})}),R="BPA_STAKEHOLDER_REGISTRATION"===(null==b?void 0:b.code)?Y:"BUILDING_PLAN_SCRUTINY"===(null==b?void 0:b.code)?j:"BUILDING_OC_PLAN_SCRUTINY"===(null==b?void 0:b.code)?K:[],l.createElement(t.Fragment,null,l.createElement(o.SearchField,null,l.createElement("label",null,_("BPA_SEARCH_APPLICATION_NO_LABEL")),l.createElement(o.TextInput,{name:"applicationNo",inputRef:m({})})),l.createElement(o.SearchField,null,l.createElement("label",null,_("BPA_SEARCH_OWNER_NAME")),l.createElement(o.TextInput,{name:"name",inputRef:m({})})),!window.location.href.includes("citizen/obps/search/application")&&l.createElement(o.SearchField,null,l.createElement("label",null,_("BPA_APP_MOBILE_NO_SEARCH_PARAM")),l.createElement(o.MobileNumber,{name:"mobileNumber",disable:!!window.location.href.includes("obps/search/obps-application"),inputRef:m({minLength:{value:10,message:_("CORE_COMMON_MOBILE_ERROR")},maxLength:{value:10,message:_("CORE_COMMON_MOBILE_ERROR")},pattern:{value:/[6789][0-9]{9}/,message:_("CORE_COMMON_MOBILE_ERROR")}}),type:"number",componentInFront:l.createElement("div",{className:"employee-card-input employee-card-input--front"},"+91")}),l.createElement(o.CardLabelError,null,null==v||null===(s=v.errors)||void 0===s||null===(c=s.mobileNumber)||void 0===c?void 0:c.message)),l.createElement(o.SearchField,null,l.createElement("label",null,_("BPA_SEARCH_APPLICATION_TYPE_LABEL")),l.createElement(p,{control:E,name:"applicationType",render:e=>l.createElement(o.Dropdown,{selected:e.value,select:e.onChange,onBlur:e.onBlur,option:P,optionKey:"i18nKey",t:_})})),l.createElement(o.SearchField,null,l.createElement("label",null,_("BPA_BASIC_DETAILS_SERVICE_TYPE_LABEL")),l.createElement(p,{control:E,name:"serviceType",render:e=>l.createElement(o.Dropdown,{selected:N&&(null==N?void 0:N.length)>0?e.value:N[0],select:e.onChange,onBlur:e.onBlur,option:N,optionKey:"i18nKey",t:_,isBPAREG:!!(N&&(null==N?void 0:N.length)>0)})})),l.createElement(o.SearchField,null,l.createElement("label",null,_("BPA_APP_FROM_DATE_SEARCH_PARAM")),l.createElement(p,{render:e=>l.createElement(o.DatePicker,{date:e.value,onChange:e.onChange}),name:"fromDate",control:E})),l.createElement(o.SearchField,null,l.createElement("label",null,_("BPA_APP_TO_DATE_SEARCH_PARAM")),l.createElement(p,{render:e=>l.createElement(o.DatePicker,{date:e.value,onChange:e.onChange}),name:"toDate",control:E})),l.createElement(o.SearchField,null,l.createElement("label",null,_("BPA_SEARCH_APPLICATION_STATUS_LABEL")),l.createElement(p,{control:E,name:"status",render:e=>l.createElement(o.Dropdown,{selected:e.value,select:e.onChange,onBlur:e.onBlur,option:R,optionKey:"i18nKey",t:_})})),window.location.href.includes("citizen/obps/search/application")&&l.createElement(o.SearchField,null),l.createElement(o.SearchField,{className:"submit"},l.createElement(o.SubmitBar,{label:_("ES_COMMON_SEARCH"),submit:!0}),l.createElement("p",{style:{marginTop:"24px"},onClick:()=>{var e,t,l,n,i,o,a,r,u,d,s,c;f({applicationNo:"",mobileNumber:window.location.href.includes("/search/obps-application")?T:"",name:"",fromDate:"",toDate:"",status:"",offset:0,limit:10,sortBy:"commencementDate",sortOrder:"DESC",applicationType:(null==D||null===(e=D.roles)||void 0===e||null===(t=e.filter(e=>e.code.includes("BPAREG_")))||void 0===t?void 0:t.length)<=0&&(null==D||null===(l=D.roles)||void 0===l?void 0:l.filter(e=>e.code.includes("BPA_")||e.code.includes("CITIZEN")).length)>0?{code:"BUILDING_PLAN_SCRUTINY",i18nKey:"WF_BPA_BUILDING_PLAN_SCRUTINY"}:(null==D||null===(n=D.roles)||void 0===n||null===(i=n.filter(e=>e.code.includes("BPAREG_")))||void 0===i?void 0:i.length)>0&&(null==D||null===(o=D.roles)||void 0===o?void 0:o.filter(e=>e.code.includes("BPA_")||e.code.includes("CITIZEN")).length)<=0?{code:"BPA_STAKEHOLDER_REGISTRATION",i18nKey:"WF_BPA_BPA_STAKEHOLDER_REGISTRATION"}:{code:"BUILDING_PLAN_SCRUTINY",i18nKey:"WF_BPA_BUILDING_PLAN_SCRUTINY"},serviceType:(null==D||null===(a=D.roles)||void 0===a||null===(r=a.filter(e=>e.code.includes("BPAREG_")))||void 0===r?void 0:r.length)<=0&&(null==D||null===(u=D.roles)||void 0===u?void 0:u.filter(e=>e.code.includes("BPA_")||e.code.includes("CITIZEN")).length)>0?{applicationType:["BUILDING_PLAN_SCRUTINY","BUILDING_OC_PLAN_SCRUTINY"],code:"NEW_CONSTRUCTION",i18nKey:"BPA_SERVICETYPE_NEW_CONSTRUCTION"}:(null==D||null===(d=D.roles)||void 0===d||null===(s=d.filter(e=>e.code.includes("BPAREG_")))||void 0===s?void 0:s.length)>0&&(null==D||null===(c=D.roles)||void 0===c?void 0:c.filter(e=>e.code.includes("BPA_")||e.code.includes("CITIZEN")).length)<=0?"":{applicationType:["BUILDING_PLAN_SCRUTINY","BUILDING_OC_PLAN_SCRUTINY"],code:"NEW_CONSTRUCTION",i18nKey:"BPA_SERVICETYPE_NEW_CONSTRUCTION"},isSubmitSuccessful:!1}),A()}},_("ES_COMMON_CLEAR_ALL"))))},jt=e=>{var o,a;const r=sessionStorage.getItem("Digit.citizen.userRequestObject"),u=r?JSON.parse(r):{},d=null==u||null===(o=u.value)||void 0===o?void 0:o.info,{t:s}=n.useTranslation(),c=Digit.ULBService.getCurrentTenantId(),v=i.useLocation(),[p,m]=t.useState((null==d||null===(E=d.roles)||void 0===E||null===(_=E.filter(e=>e.code.includes("BPAREG_")))||void 0===_?void 0:_.length)<=0&&(null==d||null===(f=d.roles)||void 0===f?void 0:f.filter(e=>e.code.includes("BPA_")||e.code.includes("CITIZEN")).length)>0?"BUILDING_PLAN_SCRUTINY":(null==d||null===(A=d.roles)||void 0===A||null===(g=A.filter(e=>e.code.includes("BPAREG_")))||void 0===g?void 0:g.length)>0&&(null==d||null===(S=d.roles)||void 0===S?void 0:S.filter(e=>e.code.includes("BPA_")||e.code.includes("CITIZEN")).length)<=0?"BPA_STAKEHOLDER_REGISTRATION":"BUILDING_PLAN_SCRUTINY");var E,_,f,A,g,S;const[h,y]=t.useState({}),[D,T]=t.useState({});t.useEffect(()=>{"/digit-ui/citizen/obps/search/application"!==v.pathname&&"/digit-ui/employee/obps/search/application"!==v.pathname||(Digit.SessionStorage.del("OBPS.INBOX"),Digit.SessionStorage.del("STAKEHOLDER.INBOX"))},[v.pathname]);const b=Digit.ComponentRegistryService.getComponent("OBPSSearchApplication"),[C,P]=t.useState("");let N={},I={};if(p&&p.includes("STAKEHOLDER")||Object.keys(h).length>0&&null!=h&&h.applicationType&&null!=h&&h.applicationType.includes("STAKEHOLDER"))Object.entries(h).length<=2&&0==Object.keys(h).filter(e=>"applicationType"===e).length||(h.applicationNo&&(h.applicationNumber=h.applicationNo,h.applicationNo=""),h&&h.applicationType&&delete h.applicationType,h&&h.serviceType&&(h.tradeType=h.serviceType,delete h.serviceType),N={...h,tenantId:Digit.ULBService.getStateId()});else{if(0===Object.keys(h).length){var L,B;let e={applicationType:"BUILDING_PLAN_SCRUTINY",serviceType:"NEW_CONSTRUCTION",...window.location.href.includes("/search/obps-application")&&{mobileNumber:null===(L=Digit.UserService.getUser())||void 0===L||null===(B=L.info)||void 0===B?void 0:B.mobileNumber}};y({...h,...e})}I=h}const{data:O=[],isLoading:R,isSuccess:w}=Digit.Hooks.obps.useOBPSSearch(p,h,c,I,N,{enabled:""===C});return l.createElement(b,{t:s,tenantId:c,onSubmit:function(e){var t,l,n;"BPA_STAKEHOLDER_REGISTRATION"===(null==e||null===(t=e.applicationType)||void 0===t?void 0:t.code)&&((e=>""!==(null==e?void 0:e.applicationNo)||""!==(null==e?void 0:e.fromDate)||""!==(null==e?void 0:e.mobileNumber)||""!==(null==e?void 0:e.serviceType)||""!==(null==e?void 0:e.status)||""!==(null==e?void 0:e.toDate))(e)||P("BPA_ADD_MORE_PARAM_STAKEHOLDER")),T(e);var i=new Date(null==e?void 0:e.fromDate);null==i||i.setSeconds((null==i?void 0:i.getSeconds())-19800);var o=new Date(null==e?void 0:e.toDate);m(null!=e&&null!==(l=e.applicationType)&&void 0!==l&&l.code?null==e||null===(n=e.applicationType)||void 0===n?void 0:n.code:p),null==o||o.setSeconds((null==o?void 0:o.getSeconds())+86399-19800);const a={...e,...e.toDate?{toDate:null==o?void 0:o.getTime()}:{},...e.fromDate?{fromDate:null==i?void 0:i.getTime()}:{}};y(Object.keys(a).filter(e=>a[e]).reduce((e,t)=>({...e,[t]:"object"==typeof a[t]?a[t].code:a[t]}),{}))},searchData:D,isLoading:R,Count:null==O||null===(a=O[0])||void 0===a?void 0:a.Count,error:C,data:!R&&w&&(null==O?void 0:O.length)>0?O:[{display:"ES_COMMON_NO_DATA"}],setparamerror:P})},Kt=()=>{var e,a,r,u;const{t:d}=n.useTranslation(),s=i.useHistory(),[c,v]=t.useState([]),[p,m]=t.useState(!1),E=Digit.ULBService.getCurrentTenantId(),_=sessionStorage.getItem("Digit.citizen.userRequestObject"),f=_?JSON.parse(_):{},A=null==f?void 0:f.value,g=null==A||null===(e=A.info)||void 0===e?void 0:e.mobileNumber,{data:S,isLoading:h,revalidate:y}=Digit.Hooks.obps.useBPAREGSearch(E,{},{mobileNumber:g},{cacheTime:0}),{data:D,isLoading:T,revalidate:b}=Digit.Hooks.obps.useBPASearch(E,{requestor:g,mobileNumber:g,limit:50-(null!=S&&null!==(a=S.Licenses)&&void 0!==a&&a.length?Number(null==S||null===(r=S.Licenses)||void 0===r?void 0:r.length):0),offset:0},{enabled:!h}),{data:C}=Digit.Hooks.obps.useMDMS(Digit.ULBService.getStateId(),"BPA",["RiskTypeComputation"]);return t.useEffect(()=>()=>{v([]),null==y||y(),null==b||b()},[]),t.useEffect(()=>{if(!h&&!T){var e,t,l,n,i,o,a,r;let d=[],s=[];var u;null!=S&&null!==(e=S.Licenses)&&void 0!==e&&e.length&&(null==S||null===(u=S.Licenses)||void 0===u||u.forEach(e=>{e.sortNumber=0,e.modifiedTime=e.auditDetails.lastModifiedTime,e.type="BPAREG",d.push(e)})),null!=D&&D.length&&(null==D||D.forEach(e=>{e.sortNumber=0,e.modifiedTime=e.auditDetails.lastModifiedTime,e.type="BPA",d.push(e)})),s=[].slice.call(d).sort(function(e,t){return new Date(t.modifiedTime)-new Date(e.modifiedTime)||e.sortNumber-t.sortNumber}),v(s);let c=sessionStorage.getItem("Digit.citizen.userRequestObject");const p=c?JSON.parse(c):{};1==(null==p||null===(t=p.value)||void 0===t||null===(l=t.info)||void 0===l||null===(n=l.roles)||void 0===n?void 0:n.length)&&"CITIZEN"==(null==p||null===(i=p.value)||void 0===i||null===(o=i.info)||void 0===o||null===(a=o.roles)||void 0===a||null===(r=a[0])||void 0===r?void 0:r.code)&&m(!0)}},[h,T,D,S]),h||T?l.createElement(o.Loader,null):l.createElement(t.Fragment,null,l.createElement(o.Header,{styles:{marginLeft:"10px"}},`${d("BPA_MY_APPLICATIONS")} ${((e,t)=>{let l=0;return"number"==typeof e&&(l+=e),"number"==typeof t&&(l+=t),l>0?`(${l})`:""})(null==S||null===(u=S.Licenses)||void 0===u?void 0:u.length,null==D?void 0:D.length)}`),null==c?void 0:c.map((e,t)=>{var n,a,r,u,c,v,m,E,_,f,A,g,S;return"BPAREG"===e.type?l.createElement(o.Card,{key:t},l.createElement(o.KeyNote,{keyValue:d("BPA_APPLICATION_NUMBER_LABEL"),note:null==e?void 0:e.applicationNumber}),l.createElement(o.KeyNote,{keyValue:d("BPA_LICENSE_TYPE"),note:d("TRADELICENSE_TRADETYPE_"+(null==e||null===(n=e.tradeLicenseDetail)||void 0===n||null===(a=n.tradeUnits)||void 0===a||null===(r=a[0])||void 0===r||null===(u=r.tradeType)||void 0===u?void 0:u.split(".")[0]))}),(null==e||null===(c=e.tradeLicenseDetail)||void 0===c||null===(v=c.tradeUnits)||void 0===v||null===(m=v[0])||void 0===m?void 0:m.tradeType.includes("ARCHITECT"))&&l.createElement(o.KeyNote,{keyValue:d("BPA_COUNCIL_OF_ARCH_NO_LABEL"),note:null==e||null===(E=e.tradeLicenseDetail)||void 0===E||null===(_=E.additionalDetail)||void 0===_?void 0:_.counsilForArchNo}),l.createElement(o.KeyNote,{keyValue:d("BPA_APPLICANT_NAME_LABEL"),note:null==e||null===(f=e.tradeLicenseDetail)||void 0===f||null===(A=f.owners)||void 0===A||null===(g=A[0])||void 0===g?void 0:g.name}),l.createElement(o.KeyNote,{keyValue:d("TL_COMMON_TABLE_COL_STATUS"),note:d("WF_ARCHITECT_"+(null==e?void 0:e.status)),noteStyle:"APPROVED"===(null==e?void 0:e.status)?{color:"#00703C"}:{color:"#D4351C"}}),"INITIATED"!==e.status?l.createElement(i.Link,{to:{pathname:"/digit-ui/citizen/obps/stakeholder/"+(null==e?void 0:e.applicationNumber),state:{tenantId:""}}},l.createElement(o.SubmitBar,{label:d("TL_VIEW_DETAILS")})):l.createElement(o.SubmitBar,{label:d("BPA_COMP_WORKFLOW"),onSubmit:()=>(e=>{var t,l,n,i,o,a,r,u,c,v,p,m,E,_,f,A,g,S,h,y,D,T,b,C,P,N,I,L,B,O,R,w,x,M,F,k,U,H,W,G,j,K,Y,$,z,V,q,X,J,Z,Q,ee,te,le,ne,ie,oe,ae,re,ue,de,se,ce,ve,pe,me;let Ee=e,_e={Correspondenceaddress:(null==Ee||null===(t=Ee.tradeLicenseDetail)||void 0===t||null===(l=t.owners)||void 0===l||null===(n=l[0])||void 0===n?void 0:n.correspondenceAddress)||`${null!=Ee&&null!==(i=Ee.tradeLicenseDetail)&&void 0!==i&&null!==(o=i.address)&&void 0!==o&&o.doorNo?(null==Ee||null===(a=Ee.tradeLicenseDetail)||void 0===a||null===(r=a.address)||void 0===r?void 0:r.doorNo)+", ":""} ${null!=Ee&&null!==(u=Ee.tradeLicenseDetail)&&void 0!==u&&null!==(c=u.address)&&void 0!==c&&c.street?(null==Ee||null===(v=Ee.tradeLicenseDetail)||void 0===v||null===(p=v.address)||void 0===p?void 0:p.street)+", ":""}${null!=Ee&&null!==(m=Ee.tradeLicenseDetail)&&void 0!==m&&null!==(E=m.address)&&void 0!==E&&E.landmark?(null==Ee||null===(_=Ee.tradeLicenseDetail)||void 0===_||null===(f=_.address)||void 0===f?void 0:f.landmark)+", ":""}${d(null==Ee||null===(A=Ee.tradeLicenseDetail)||void 0===A||null===(g=A.address)||void 0===g?void 0:g.locality.code)}, ${d(null!=Ee&&null!==(S=Ee.tradeLicenseDetail)&&void 0!==S&&null!==(h=S.address)&&void 0!==h&&h.city?null==Ee||null===(y=Ee.tradeLicenseDetail)||void 0===y||null===(D=y.address)||void 0===D?void 0:D.city.code:"")},${d(null==Ee||null===(T=Ee.tradeLicenseDetail)||void 0===T||null===(b=T.address)||void 0===b?void 0:b.pincode)?""+(null===(C=Ee.tradeLicenseDetail)||void 0===C||null===(P=C.address)||void 0===P?void 0:P.pincode):" "}`,formData:{LicneseDetails:{PanNumber:null==Ee||null===(N=Ee.tradeLicenseDetail)||void 0===N||null===(I=N.owners)||void 0===I||null===(L=I[0])||void 0===L?void 0:L.pan,PermanentAddress:null==Ee||null===(B=Ee.tradeLicenseDetail)||void 0===B||null===(O=B.owners)||void 0===O||null===(R=O[0])||void 0===R?void 0:R.permanentAddress,email:null==Ee||null===(w=Ee.tradeLicenseDetail)||void 0===w||null===(x=w.owners)||void 0===x||null===(M=x[0])||void 0===M?void 0:M.emailId,gender:{code:null==Ee||null===(F=Ee.tradeLicenseDetail)||void 0===F||null===(k=F.owners)||void 0===k||null===(U=k[0])||void 0===U?void 0:U.gender,i18nKey:"COMMON_GENDER_"+(null==Ee||null===(H=Ee.tradeLicenseDetail)||void 0===H||null===(W=H.owners)||void 0===W||null===(G=W[0])||void 0===G?void 0:G.gender),value:null==Ee||null===(j=Ee.tradeLicenseDetail)||void 0===j||null===(K=j.owners)||void 0===K||null===(Y=K[0])||void 0===Y?void 0:Y.gender},mobileNumber:null==Ee||null===($=Ee.tradeLicenseDetail)||void 0===$||null===(z=$.owners)||void 0===z||null===(V=z[0])||void 0===V?void 0:V.mobileNumber,name:null==Ee||null===(q=Ee.tradeLicenseDetail)||void 0===q||null===(X=q.owners)||void 0===X||null===(J=X[0])||void 0===J?void 0:J.name},LicneseType:{LicenseType:{i18nKey:"TRADELICENSE_TRADETYPE_"+(null==Ee||null===(Z=Ee.tradeLicenseDetail)||void 0===Z||null===(Q=Z.tradeUnits)||void 0===Q||null===(ee=Q[0])||void 0===ee?void 0:ee.tradeType.split(".")[0]),role:["BPA_"+(null==Ee||null===(te=Ee.tradeLicenseDetail)||void 0===te||null===(le=te.tradeUnits)||void 0===le||null===(ne=le[0])||void 0===ne?void 0:ne.tradeType.split(".")[0])],tradeType:null==Ee||null===(ie=Ee.tradeLicenseDetail)||void 0===ie||null===(oe=ie.tradeUnits)||void 0===oe||null===(ae=oe[0])||void 0===ae?void 0:ae.tradeType},ArchitectNo:(null==Ee||null===(re=Ee.tradeLicenseDetail)||void 0===re||null===(ue=re.additionalDetail)||void 0===ue?void 0:ue.counsilForArchNo)||null}},isAddressSame:(null==Ee||null===(de=Ee.tradeLicenseDetail)||void 0===de||null===(se=de.owners)||void 0===se||null===(ce=se[0])||void 0===ce?void 0:ce.correspondenceAddress)===(null==Ee||null===(ve=Ee.tradeLicenseDetail)||void 0===ve||null===(pe=ve.owners)||void 0===pe||null===(me=pe[0])||void 0===me?void 0:me.permanentAddress),result:{Licenses:[{...e}]},initiationFlow:!0};sessionStorage.setItem("BPAREGintermediateValue",JSON.stringify(_e)),s.push("/digit-ui/citizen/obps/stakeholder/apply/stakeholder-docs-required")})(e)}),"PENDINGPAYMENT"===e.status?l.createElement(i.Link,{to:{pathname:`/digit-ui/citizen/payment/collect/${null==e?void 0:e.businessService}/${null==e?void 0:e.applicationNumber}`}},l.createElement("div",{style:{marginTop:"10px"}},l.createElement(o.SubmitBar,{label:d("COMMON_MAKE_PAYMENT")}))):null):l.createElement(o.Card,{key:t},l.createElement(o.KeyNote,{keyValue:d("BPA_APPLICATION_NUMBER_LABEL"),note:null==e?void 0:e.applicationNo}),l.createElement(o.KeyNote,{keyValue:d("BPA_BASIC_DETAILS_APPLICATION_TYPE_LABEL"),note:d("BPA_OC"!==(null==e?void 0:e.businessService)?"WF_BPA_BUILDING_PLAN_SCRUTINY":"WF_BPA_BUILDING_OC_PLAN_SCRUTINY")}),l.createElement(o.KeyNote,{keyValue:d("BPA_COMMON_SERVICE"),note:d("BPA_SERVICETYPE_NEW_CONSTRUCTION")}),l.createElement(o.KeyNote,{keyValue:d("TL_COMMON_TABLE_COL_STATUS"),note:d("WF_BPA_"+(null==e?void 0:e.state)),noteStyle:"APPROVED"===(null==e?void 0:e.status)?{color:"#00703C"}:{color:"#D4351C"}}),l.createElement(o.KeyNote,{keyValue:d("BPA_COMMON_SLA"),note:"string"==typeof(null==e?void 0:e.sla)&&null!=e&&null!==(S=e.sla)&&void 0!==S&&S.includes("NA")?d("CS_NA"):null==e?void 0:e.sla}),"SEND_TO_ARCHITECT"===e.action||"INITIATED"!==e.status?l.createElement(i.Link,{to:{pathname:"/digit-ui/citizen/obps/bpa/"+(null==e?void 0:e.applicationNo),state:{tenantId:""}}},l.createElement(o.SubmitBar,{label:d("TL_VIEW_DETAILS")})):l.createElement("div",null,p?l.createElement(i.Link,{to:{pathname:"/digit-ui/citizen/obps/bpa/"+(null==e?void 0:e.applicationNo),state:{tenantId:""}}},l.createElement(o.SubmitBar,{label:d("TL_VIEW_DETAILS")})):l.createElement(o.SubmitBar,{label:d("BPA_COMP_WORKFLOW"),onSubmit:()=>Dt(e,C,s,d)})),"PENDINGPAYMENT"===e.status?l.createElement(i.Link,{to:{pathname:`/digit-ui/citizen/payment/collect/${null==e?void 0:e.businessService}/${null==e?void 0:e.applicationNumber}`}},l.createElement("div",{style:{marginTop:"10px"}},l.createElement(o.SubmitBar,{label:d("COMMON_MAKE_PAYMENT")}))):null)}),l.createElement("div",{style:{marginLeft:"16px",marginTop:"16px",marginBottom:"46px"}},l.createElement("span",null,d("BPA_NOT_ABLE_TO_FIND_APP_MSG")+" "," "),l.createElement("span",{className:"link"},l.createElement(i.Link,{to:"/digit-ui/citizen/obps/search/obps-application"},d("BPA_CLICK_HERE_TO_SEARCH_LINK")))))},Yt=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))},$t=e=>{var i,a,r;let{data:u,OpenImage:d}=e;const{t:s}=n.useTranslation(),[c,v]=t.useState(!1);return l.createElement("div",null,u.date&&l.createElement("p",null,u.date),l.createElement("p",null,u.name),u.mobileNumber&&l.createElement(o.TelePhone,{mobile:u.mobileNumber}),u.source&&l.createElement("p",null,s("ES_APPLICATION_DETAILS_APPLICATION_CHANNEL_"+u.source.toUpperCase())),u.comment&&l.createElement(Yt,{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,s("WF_COMMON_COMMENTS")),!c&&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"}},s("View More")):null),c&&l.createElement("div",null,l.createElement("p",{style:{overflow:"visible"}},e),l.createElement("button",{type:"button",onClick:()=>{v(!1)},style:{color:"#800000"}},s("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,s("CS_COMMON_ATTACHMENTS")),l.createElement(o.DisplayPhotos,{srcs:null==u?void 0:u.thumbnailsToShow.thumbs,onClick:(e,t)=>{d(e,t,null==u?void 0:u.thumbnailsToShow)}})):null)},zt=e=>{var a,r,u,d,s;let{id:c,tenantId:v}=e;const{t:p}=n.useTranslation(),[m,E]=t.useState(!1),{isLoading:_,data:f}=Digit.Hooks.useWorkflowDetails({tenantId:v,id:c,moduleCode:"OBPS"});if(_)return l.createElement(o.Loader,null);function A(e,t,l){var n;window.open(null==l||null===(n=l.fullImage)||void 0===n?void 0:n[0],"_blank")}const g=e=>{var t,n,i,o,a;const r={date:null==e||null===(t=e.auditDetails)||void 0===t?void 0:t.lastModified,name:null==e||null===(n=e.assignes)||void 0===n||null===(i=n[0])||void 0===i?void 0:i.name,mobileNumber:null==e||null===(o=e.assignes)||void 0===o||null===(a=o[0])||void 0===a?void 0:a.mobileNumber,comment:p(null==e?void 0:e.comment),wfComment:e.wfComment,thumbnailsToShow:null==e?void 0:e.thumbnailsToShow};return l.createElement($t,{data:r,OpenImage:A})};return l.createElement(l.Fragment,null,!_&&l.createElement(t.Fragment,null,(null==f||null===(a=f.timeline)||void 0===a?void 0:a.length)>0&&l.createElement(o.CardSectionHeader,{style:{marginBottom:"16px",marginTop:"32px"}},p("CS_APPLICATION_DETAILS_APPLICATION_TIMELINE")),null!=f&&f.timeline&&1===(null==f||null===(r=f.timeline)||void 0===r?void 0:r.length)?l.createElement(o.CheckPoint,{isCompleted:!0,label:p((null==f||null===(u=f.timeline[0])||void 0===u?void 0:u.state)&&"WF_ARCHITECT_"+f.timeline[0].state||"NA"),customChild:g(null==f?void 0:f.timeline[0])}):l.createElement(o.ConnectingCheckPoints,null,(null==f?void 0:f.timeline)&&(null==f?void 0:f.timeline.slice(0,m?f.timeline.length:2).map((e,t,n)=>{let i="";var a,r,u,d;return window.location.href.includes("/obps")&&(i=null!=f&&null!==(a=f.timeline[t-1])&&void 0!==a&&null!==(r=a.state)&&void 0!==r&&r.includes("BACK_FROM")||null!=f&&null!==(u=f.timeline[t-1])&&void 0!==u&&null!==(d=u.state)&&void 0!==d&&d.includes("SEND_TO_CITIZEN")?"_NOT_DONE":"SEND_TO_ARCHITECT"===(null==e?void 0:e.performedAction)?"_BY_ARCHITECT_DONE":0==t?"":"_DONE"),l.createElement(l.Fragment,{key:t},l.createElement(o.CheckPoint,{keyValue:t,isCompleted:0===t,label:e.state?p(`WF_ARCHITECT_${e.state}${i}`):"NA",customChild:g(e)}))}))),(null==f||null===(d=f.timeline)||void 0===d?void 0:d.length)>2&&l.createElement(o.LinkButton,{label:p(m?"COLLAPSE":"VIEW_TIMELINE"),onClick:()=>{E(e=>!e)}})),f&&(e=>{var t,n,a,r,u,d;switch(null==e?void 0:e.action){case"PAY":return l.createElement("div",{style:{marginTop:"24px"},className:"action-bar-wrap"},l.createElement(i.Link,{to:{pathname:`/digit-ui/citizen/payment/collect/${null==f||null===(t=f.processInstances)||void 0===t||null===(n=t[0])||void 0===n?void 0:n.moduleName}/${null==f||null===(a=f.processInstances)||void 0===a||null===(r=a[0])||void 0===r?void 0:r.businessId}`,state:{tenantId:null==f||null===(u=f.processInstances)||void 0===u||null===(d=u[0])||void 0===d?void 0:d.tenantId}}},l.createElement(o.SubmitBar,{label:p("TL_COMMON_BUTTON_CITIZEN_MAKE_PAYMENT")})));case"SUBMIT_FEEDBACK":return l.createElement("div",{style:{marginTop:"24px"}},l.createElement(i.Link,{to:"/digit-ui/citizen/fsm/rate/"+props.id},l.createElement(o.SubmitBar,{label:p("CS_APPLICATION_DETAILS_RATE")})))}})(null==f||null===(s=f.nextActions)||void 0===s?void 0:s[0]))},Vt=()=>{var e,a,r,u,d,s,c,v,p,m,E,_,f,A,g,S,h,y,D,T,b,C,P,N,I,L,B,O,R,w,x,M,F,k,U,H,W,G,j,K;const{id:Y}=i.useParams(),{t:$}=n.useTranslation(),[z,V]=t.useState({}),q=Digit.ULBService.getCurrentTenantId(),[X,J]=t.useState(!1),[Z,Q]=t.useState([]),{id:ee}=i.useParams(),te={applicationNumber:ee},le=Digit.ULBService.getStateId(),ne=window.Digit.Utils.browser.isMobile(),{data:ie,isLoading:oe}=Digit.Hooks.obps.useBPAREGSearch(le,{},te);let ae=null==ie||null===(e=ie.Licenses)||void 0===e?void 0:e[0];const{data:re}=Digit.Hooks.obps.useMDMS(le,"StakeholderRegistraition","TradeTypetoRoleMapping"),{data:ue}=Digit.Hooks.useRecieptSearch({tenantId:le,businessService:"BPAREG",consumerCodes:Y,isEmployee:!1},{}),[de,se]=t.useState(!1);var ce,ve;return t.useEffect(()=>{var e,t;if(null!=ae&&null!==(e=ae.tradeLicenseDetail)&&void 0!==e&&null!==(t=e.applicationDocuments)&&void 0!==t&&t.length){var l,n;const e=null==ae||null===(l=ae.tradeLicenseDetail)||void 0===l||null===(n=l.applicationDocuments)||void 0===n?void 0:n.map(e=>null==e?void 0:e.fileStoreId);Digit.UploadServices.Filefetch(e,q.split(".")[0]).then(e=>V(null==e?void 0:e.data))}},[ae]),t.useEffect(()=>{var e,t,l;ae&&((null==ue||null===(e=ue.Payments)||void 0===e?void 0:e.length)>0&&Q([{label:$("TL_RECEIPT"),onClick:()=>Ut(0,null==ae?void 0:ae.applicationNumber,null==ae?void 0:ae.tenantId,null==ue?void 0:ue.Payments)}]),null==ae||null===(t=ae.tradeLicenseDetail)||void 0===t||null===(l=t.applicationDocuments)||void 0===l||l.map(e=>null==e?void 0:e.fileStoreId))},[ae,ue]),null!=ae&&null!==(a=ae.tradeLicenseDetail)&&void 0!==a&&null!==(r=a.applicationDocuments)&&void 0!==r&&r.length&&(null==re||null===(u=re.StakeholderRegistraition)||void 0===u||null===(d=u.TradeTypetoRoleMapping)||void 0===d?void 0:d.length)>0&&(null==re||null===(ce=re.StakeholderRegistraition)||void 0===ce||null===(ve=ce.TradeTypetoRoleMapping)||void 0===ve||ve.map(e=>{var t,l,n,i,o;(null==e||null===(t=e.docTypes)||void 0===t?void 0:t.length)>0&&(null==e?void 0:e.tradeType)==(null==ae||null===(l=ae.tradeLicenseDetail)||void 0===l||null===(n=l.tradeUnits)||void 0===n||null===(i=n[0])||void 0===i?void 0:i.tradeType)&&(null==e||null===(o=e.docTypes)||void 0===o||o.map(e=>{var t,l;null==ae||null===(t=ae.tradeLicenseDetail)||void 0===t||null===(l=t.applicationDocuments)||void 0===l||l.forEach(t=>{(null==e?void 0:e.code)==(null==t?void 0:t.documentType)&&null!=e&&e.info&&(t.info=null==e?void 0:e.info)})}))})),oe?l.createElement(o.Loader,null):l.createElement(t.Fragment,null,l.createElement("div",{className:"cardHeaderWithOptions",style:ne?{}:{maxWidth:"980px"}},l.createElement(o.Header,{styles:{fontSize:"32px",marginLeft:ne?"0px":"10px"}},$("BPA_TASK_DETAILS_HEADER")),l.createElement("div",null,(null==ue||null===(s=ue.Payments)||void 0===s?void 0:s.length)>0&&l.createElement(o.MultiLink,{className:"multilinkWrapper",onHeadClick:()=>J(!X),displayOptions:X,options:Z,style:{top:"90px"}}),l.createElement(o.LinkButton,{label:$("VIEW_TIMELINE"),style:{color:"#A52A2A"},onClick:()=>{se(!0);const e=document.getElementById("timeline");e&&e.scrollIntoView({behavior:"smooth"})}}))),l.createElement("div",null,l.createElement(o.Card,null,l.createElement(o.StatusTable,null,l.createElement(o.Row,{className:"border-none",label:$("BPA_APPLICATION_NUMBER_LABEL"),text:(null==ae?void 0:ae.applicationNumber)||"NA"}))),l.createElement(o.Card,null,l.createElement(o.CardHeader,{styles:{fontSize:"24px"}},$("BPA_LICENSE_DETAILS_LABEL")),l.createElement(o.StatusTable,null,l.createElement(o.Row,{className:"border-none",label:$("BPA_LICENSE_TYPE"),text:$("TRADELICENSE_TRADETYPE_"+(null==ae||null===(c=ae.tradeLicenseDetail)||void 0===c||null===(v=c.tradeUnits)||void 0===v||null===(p=v[0])||void 0===p||null===(m=p.tradeType)||void 0===m?void 0:m.split(".")[0]))}),(null==ae||null===(E=ae.tradeLicenseDetail)||void 0===E||null===(_=E.tradeUnits)||void 0===_||null===(f=_[0])||void 0===f?void 0:f.tradeType.includes("ARCHITECT"))&&l.createElement(o.Row,{className:"border-none",label:$("BPA_COUNCIL_OF_ARCH_NO_LABEL"),text:null==ae||null===(A=ae.tradeLicenseDetail)||void 0===A||null===(g=A.additionalDetail)||void 0===g?void 0:g.counsilForArchNo}))),l.createElement(o.Card,null,l.createElement(o.CardHeader,{styles:{fontSize:"24px"}},$("BPA_LICENSE_DET_CAPTION")),l.createElement(o.StatusTable,null,l.createElement(o.Row,{className:"border-none",label:$("BPA_APPLICANT_NAME_LABEL"),text:$(null==ae||null===(S=ae.tradeLicenseDetail)||void 0===S||null===(h=S.owners)||void 0===h||null===(y=h[0])||void 0===y?void 0:y.name)}),l.createElement(o.Row,{className:"border-none",label:$("BPA_APPLICANT_GENDER_LABEL"),text:$(null==ae||null===(D=ae.tradeLicenseDetail)||void 0===D||null===(T=D.owners)||void 0===T||null===(b=T[0])||void 0===b?void 0:b.gender)}),l.createElement(o.Row,{className:"border-none",label:$("BPA_OWNER_MOBILE_NO_LABEL"),text:null==ae||null===(C=ae.tradeLicenseDetail)||void 0===C||null===(P=C.owners)||void 0===P||null===(N=P[0])||void 0===N?void 0:N.mobileNumber}),l.createElement(o.Row,{className:"border-none",label:$("BPA_APPLICANT_EMAIL_LABEL"),text:(null==ae||null===(I=ae.tradeLicenseDetail)||void 0===I||null===(L=I.owners)||void 0===L||null===(B=L[0])||void 0===B?void 0:B.emailId)||$("CS_NA")}),l.createElement(o.Row,{className:"border-none",label:$("BPA_APPLICANT_PAN_NO"),text:(null==ae||null===(O=ae.tradeLicenseDetail)||void 0===O||null===(R=O.owners)||void 0===R||null===(w=R[0])||void 0===w?void 0:w.pan)||$("CS_NA")}))),l.createElement(o.Card,null,l.createElement(o.CardHeader,{styles:{fontSize:"24px"}},$("BPA_LICENSEE_PERMANENT_LABEL")),l.createElement(o.Row,{className:"border-none",text:(null==ae||null===(x=ae.tradeLicenseDetail)||void 0===x||null===(M=x.owners)||void 0===M||null===(F=M[0])||void 0===F?void 0:F.permanentAddress)||$("CS_NA")})),l.createElement(o.Card,null,l.createElement(o.CardHeader,{styles:{fontSize:"24px"}},$("BPA_CORRESPONDANCE_ADDRESS_LABEL")),l.createElement(o.Row,{className:"border-none",text:(null==ae||null===(k=ae.tradeLicenseDetail)||void 0===k||null===(U=k.owners)||void 0===U||null===(H=U[0])||void 0===H?void 0:H.correspondenceAddress)||$("CS_NA")})),(null==ae||null===(W=ae.tradeLicenseDetail)||void 0===W||null===(G=W.applicationDocuments)||void 0===G?void 0:G.length)>0&&l.createElement(o.Card,null,l.createElement(o.CardHeader,{styles:{fontSize:"24px"}},$("BPA_DOC_DETAILS_SUMMARY")),null==ae||null===(j=ae.tradeLicenseDetail)||void 0===j||null===(K=j.applicationDocuments)||void 0===K?void 0:K.map((e,n)=>{var i,a,r,u,d;return l.createElement(t.Fragment,null,l.createElement("div",null,l.createElement(o.CardSectionHeader,{styles:{fontSize:"18px"}},$("BPAREG_HEADER_"+gt(null==e||null===(i=e.documentType)||void 0===i?void 0:i.toUpperCase(),".","_"))),null!=e&&e.info?l.createElement("div",{style:{fontSize:"12px",color:"#505A5F",fontWeight:400,lineHeight:"15px",margin:"10px 0px"}},""+$(null==e?void 0:e.info)):null,l.createElement("a",{target:"_blank",href:null===(a=z[e.fileStoreId])||void 0===a?void 0:a.split(",")[0]},l.createElement(o.PDFSvg,null)),l.createElement("p",{style:{marginTop:"8px",fontWeight:"bold",fontSize:"16px",lineHeight:"19px",color:"#505A5F",fontWeight:"400"}},$("BPAREG_HEADER_"+gt(null==e||null===(r=e.documentType)||void 0===r?void 0:r.toUpperCase(),".","_")))),(null==ae||null===(u=ae.tradeLicenseDetail)||void 0===u||null===(d=u.applicationDocuments)||void 0===d?void 0:d.length)!=n+1?l.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",height:"2px",marginTop:"20px",marginBottom:"20px"}}):null)})),l.createElement("div",{id:"timeline"},l.createElement(o.Card,null,l.createElement(zt,{id:Y,tenantId:null==ae?void 0:ae.tenantId})))))},qt=e=>{var a,r;const{state:u}=e.location,{t:d}=n.useTranslation(),s=Digit.ULBService.getCurrentTenantId(),c=null==u||null===(a=u.data)||void 0===a||null===(r=a.BPA)||void 0===r?void 0:r[0],[v,p]=t.useState({}),[m,E]=t.useState(!0),_=i.useHistory(),[f,A]=t.useState(""),[g,S]=t.useState(null);let h=null==v?void 0:v.businessService,y=null==v?void 0:v.status;"BPA_LOW"==h&&(h="BPA");let D=Digit.Hooks.useWorkflowDetails({tenantId:null==c?void 0:c.tenantId,id:null==c?void 0:c.applicationNo,moduleCode:"BPA"});t.useEffect(function(){try{return E(!0),Promise.resolve(Digit.OBPSService.BPASearch(s,{applicationNo:null==c?void 0:c.applicationNo})).then(function(e){var t,l,n,i;return Promise.resolve(Mt(null==e||null===(t=e.BPA)||void 0===t||null===(l=t[0])||void 0===l?void 0:l.businessService,null==e||null===(n=e.BPA)||void 0===n||null===(i=n[0])||void 0===i?void 0:i.status)).then(function(t){var l,n;return Promise.resolve(Digit.PaymentService.fetchBill(s,{consumerCode:null==e||null===(l=e.BPA)||void 0===l||null===(n=l[0])||void 0===n?void 0:n.applicationNo,businessService:t})).then(function(t){var l,n,i,o;"APPROVED"==(null==e||null===(l=e.BPA)||void 0===l||null===(n=l[0])||void 0===n?void 0:n.status)&&null!=t&&t.Bill[0]&&0!=(null==t||null===(i=t.Bill[0])||void 0===i?void 0:i.totalAmount)&&A("_SAN_FEE"),E(!1),p(null==e||null===(o=e.BPA)||void 0===o?void 0:o[0]),S(null==t?void 0:t.Bill)})})})}catch(e){return Promise.reject(e)}},[]);let T=!1;var b,C,P;return!D||null==D||!D.data||null!=D&&D.isLoading||null==D||null===(b=D.data)||void 0===b||null===(C=b.nextActions)||void 0===C||C.forEach(e=>{"PAY"!=e.action||T||(T=!0)}),l.createElement("div",null,m||null!=D&&D.isLoading?l.createElement(o.Loader,null):l.createElement(o.Card,null,l.createElement(o.Banner,{message:d(`BPA_HEADER_${h}_${null==c||null===(P=c.workflow)||void 0===P?void 0:P.action}_${gt(y," ","_").toUpperCase()}${f||""}`),applicationNumber:null==v?void 0:v.applicationNo,info:d("BPA"==h?"BPA_PERMIT_APPLICATION_NUMBER_LABEL":"BPA_OCCUPANCY_CERTIFICATE_APPLICATION_NUMBER_LABEL"),successful:"PERMIT REVOCATION"!=(null==v?void 0:v.status)&&"REJECTED"!=(null==v?void 0:v.status),style:{padding:"10px"},headerStyles:{fontSize:"32px",wordBreak:"break-word"}}),l.createElement(o.CardText,{style:{paddingBottom:"10px",marginBottom:"10px"}}),"PERMIT REVOCATION"==(null==v?void 0:v.status)?l.createElement("div",{className:"primary-label-btn d-grid",style:{marginLeft:"unset",marginBottom:"10px",padding:"0px 8px"},onClick:function(){try{return Promise.resolve(Digit.PaymentService.generatePdf(s,{Bpa:[v]},"bpa-revocation")).then(function(e){return Promise.resolve(Digit.PaymentService.printReciept(s,{fileStoreIds:e.filestoreIds[0]})).then(function(t){window.open(t[null==e?void 0:e.filestoreIds[0]],"_blank")})})}catch(e){return Promise.reject(e)}}},l.createElement("svg",{width:"20",height:"23",viewBox:"0 0 20 23",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l.createElement("path",{d:"M19.3334 8H14V0H6.00002V8H0.666687L10 17.3333L19.3334 8ZM0.666687 20V22.6667H19.3334V20H0.666687Z",fill:"#a82227"})),d("BPA_REVOCATION_PDF_LABEL")):null,window.location.href.includes("/citizen")?l.createElement("div",null,("PENDING_APPL_FEE"==(null==v?void 0:v.status)||"PENDING_FEE"==(null==v?void 0:v.status)||"PENDING_SANC_FEE_PAYMENT"==(null==v?void 0:v.status))&&(null==g?void 0:g.length)>0&&T?l.createElement("div",null,l.createElement(i.Link,{to:{pathname:`/digit-ui/citizen/payment/collect/${Mt(null==v?void 0:v.businessService,null==v?void 0:v.status)}/${null==v?void 0:v.applicationNo}/${null==v?void 0:v.tenantId}?tenantId=${null==v?void 0:v.tenantId}`}},l.createElement(o.SubmitBar,{label:d("WF_BPA_PAY"),style:{margin:"10px 0px 0px 0px"}})),l.createElement(i.Link,{to:"/digit-ui/citizen"},l.createElement(o.LinkButton,{label:d("CORE_COMMON_GO_TO_HOME")}))):l.createElement(i.Link,{to:{pathname:"/digit-ui/citizen"}},l.createElement(o.SubmitBar,{label:d("CORE_COMMON_GO_TO_HOME"),style:{margin:"10px 10px 0px 0px"}}))):l.createElement(o.ActionBar,{style:{display:"flex",justifyContent:"flex-end",alignItems:"baseline"}},l.createElement("div",null,("PENDING_APPL_FEE"==(null==v?void 0:v.status)||"PENDING_FEE"==(null==v?void 0:v.status)||"PENDING_SANC_FEE_PAYMENT"==(null==v?void 0:v.status))&&(null==g?void 0:g.length)>0&&T?l.createElement("div",null,l.createElement(o.SubmitBar,{label:d("WF_BPA_PAY"),onSubmit:()=>{_.push(`/digit-ui/employee/payment/collect/${Mt(null==v?void 0:v.businessService,null==v?void 0:v.status)}/${null==v?void 0:v.applicationNo}/${null==v?void 0:v.tenantId}?tenantId=${null==v?void 0:v.tenantId}`)},style:{margin:"10px 0px 0px 0px"}}),l.createElement(i.Link,{to:"/digit-ui/employee"},l.createElement("span",{style:{color:"#a82227",margin:"0px 10px"}},d("CORE_COMMON_GO_TO_HOME")))):l.createElement(o.SubmitBar,{label:d("CORE_COMMON_GO_TO_HOME"),onSubmit:()=>{_.push("/digit-ui/employee")},style:{margin:"10px 10px 0px 0px"}})))))},Xt=e=>{let{statuses:i,isInboxLoading:r,controlFilterForm:u,setFilterFormValue:d,filterFormState:s,localitiesForEmployeesCurrentTenant:c,loadingLocalitiesForEmployeesCurrentTenant:v}=e;const{t:p}=n.useTranslation(),m=Digit.ULBService.getCurrentTenantId(),{data:E,isLoading:_}=Digit.Hooks.obps.SearchMdmsTypes.useApplicationTypes(m),f=[{code:"ASSIGNED_TO_ME",name:""+p("ES_INBOX_ASSIGNED_TO_ME")},{code:"ASSIGNED_TO_ALL",name:""+p("ES_INBOX_ASSIGNED_TO_ALL")}],A=a.useWatch({control:u,name:"applicationType",defaultValue:(null==s?void 0:s.applicationType)||null}),g=Digit.Hooks.obps.useBusinessServiceBasedOnServiceType({applicationType:A}),S=a.useWatch({control:u,name:"businessService",defaultValue:(null==s?void 0:s.businessService)||null}),h=(e,t)=>{const l=e.map(e=>e[1]);return t.onChange(l)};return l.createElement(t.Fragment,null,window.location.href.includes("/citizen")?null:l.createElement(o.FilterFormField,null,l.createElement(a.Controller,{name:"assignee",control:u,render:e=>l.createElement(o.RadioButtons,{onSelect:t=>{e.onChange(t.code)},selectedOption:f.filter(t=>t.code===e.value)[0],optionsKey:"name",name:"assignee",options:f})})),window.location.href.includes("/citizen")?null:l.createElement(o.FilterFormField,null,l.createElement(a.Controller,{name:"locality",control:u,render:e=>{const n=t.useMemo(()=>{var t;return null==e||null===(t=e.value)||void 0===t?void 0:t.map((t,n)=>l.createElement(o.RemoveableTag,{key:n,text:t.i18nkey,onClick:()=>{var l;e.onChange(null==e||null===(l=e.value)||void 0===l?void 0:l.filter(e=>e.code!==t.code))}}))},[null==e?void 0:e.value]);return v?l.createElement(o.Loader,null):l.createElement(t.Fragment,null,l.createElement("div",{className:"filter-label sub-filter-label",style:{fontSize:"18px",fontWeight:"600"}},p("ES_INBOX_LOCALITY")),l.createElement(o.MultiSelectDropdown,{options:c||[],optionsKey:"i18nkey",props:e,isPropsNeeded:!0,onSelect:h,selected:null==e?void 0:e.value,defaultLabel:p("ES_BPA_ALL_SELECTED"),defaultUnit:p("BPA_SELECTED_TEXT")}),l.createElement("div",{className:"tag-container"},n))}})),l.createElement(o.FilterFormField,null,l.createElement(a.Controller,{name:"applicationType",control:u,render:e=>_?l.createElement(o.Loader,null):l.createElement(t.Fragment,null,l.createElement("div",{className:"filter-label sub-filter-label",style:{fontSize:"18px",fontWeight:"600"}},p("BPA_SEARCH_APPLICATION_TYPE_LABEL")),l.createElement(o.RadioButtons,{onSelect:t=>{e.onChange(t.code),d("applicationStatus",[]),d("businessService",[])},selectedOption:E.filter(t=>t.code===e.value)[0],optionsKey:"i18nKey",name:"applicationType",options:E}))})),(null==A?void 0:A.length)>0&&"BUILDING_OC_PLAN_SCRUTINY"!=A?l.createElement(o.FilterFormField,null,l.createElement(a.Controller,{name:"businessService",control:u,render:e=>l.createElement(t.Fragment,null,l.createElement("div",{className:"filter-label sub-filter-label",style:{fontSize:"18px",fontWeight:"600"}},p("ES_INBOX_RISK_TYPE")),l.createElement(o.RadioButtons,{onSelect:t=>{e.onChange(t.code),d("applicationStatus",[])},selectedOption:g.filter(t=>t.code===e.value)[0],optionsKey:"i18nKey",name:"businessService",options:g}))})):null,"BUILDING_OC_PLAN_SCRUTINY"==A||(null==A?void 0:A.length)>0&&(null==S?void 0:S.length)>0?l.createElement(o.FilterFormField,null,l.createElement("div",{className:"filter-label sub-filter-label",style:{fontSize:"18px",fontWeight:"600"}},p("ACTION_TEST_APPLICATION_STATUS")),l.createElement(a.Controller,{name:"applicationStatus",control:u,render:e=>{function n(t){e.onChange(t)}const a=t.useMemo(()=>{var t;return null==i||null===(t=i.filter(e=>{let t=ft(S);return"BUILDING_OC_PLAN_SCRUTINY"==A&&(t="BPA_OC"),e.businessservice===t}))||void 0===t?void 0:t.map((t,i)=>{var a;return l.createElement(o.CheckBox,{key:i,onChange:l=>{if(l.target.checked&&null!=e&&e.value)n([...null==e?void 0:e.value,null==t?void 0:t.statusid]);else if(l.target.checked)n([null==t?void 0:t.statusid]);else{var i;n(null==e||null===(i=e.value)||void 0===i?void 0:i.filter(e=>e!==(null==t?void 0:t.statusid)))}},checked:null==e||null===(a=e.value)||void 0===a?void 0:a.includes(null==t?void 0:t.statusid),label:`${p(`WF_STATE_${t.businessservice}_${t.applicationstatus}`)} (${t.count})`})})},[e.value,i,S,A]);return l.createElement(t.Fragment,null,r?l.createElement(o.Loader,null):l.createElement(t.Fragment,null,a))}})):null)},Jt=e=>{var i,a,r,u;let{registerRef:d,searchFormState:s,searchFieldComponents:c}=e;const{t:v}=n.useTranslation();var p,m,E,_;return window.Digit.Utils.browser.isMobile()?l.createElement(t.Fragment,null,l.createElement(o.SearchField,null,l.createElement("label",null,v("BPA_APPLICATION_NUMBER_LABEL")),l.createElement(o.TextInput,{name:"applicationNo",inputRef:d({})})),window.location.href.includes("/citizen")?null:l.createElement(o.SearchField,null,l.createElement("label",null,v("CORE_COMMON_MOBILE_NUMBER")),l.createElement(o.MobileNumber,{name:"mobileNumber",type:"number",inputRef:d({minLength:{value:10,message:v("CORE_COMMON_MOBILE_ERROR")},maxLength:{value:10,message:v("CORE_COMMON_MOBILE_ERROR")},pattern:{value:/[6789][0-9]{9}/,message:v("CORE_COMMON_MOBILE_ERROR")}})}),null!=s&&null!==(i=s.errors)&&void 0!==i&&null!==(a=i.mobileNumber)&&void 0!==a&&a.message?l.createElement(o.CardLabelError,null,null==s||null===(r=s.errors)||void 0===r||null===(u=r.mobileNumber)||void 0===u?void 0:u.message):null)):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:window.location.href.includes("/citizen")?{gridTemplateColumns:"33.33% 67.33%",textAlign:"start"}:{textAlign:"start"}},l.createElement(o.SearchField,null,l.createElement("label",null,v("BPA_APPLICATION_NUMBER_LABEL")),l.createElement(o.TextInput,{name:"applicationNo",inputRef:d({})})),window.location.href.includes("/citizen")?null:l.createElement(o.SearchField,null,l.createElement("label",null,v("CORE_COMMON_MOBILE_NUMBER")),l.createElement(o.MobileNumber,{name:"mobileNumber",type:"number",inputRef:d({minLength:{value:10,message:v("CORE_COMMON_MOBILE_ERROR")},maxLength:{value:10,message:v("CORE_COMMON_MOBILE_ERROR")},pattern:{value:/[6789][0-9]{9}/,message:v("CORE_COMMON_MOBILE_ERROR")}})}),null!=s&&null!==(p=s.errors)&&void 0!==p&&null!==(m=p.mobileNumber)&&void 0!==m&&m.message?l.createElement(o.CardLabelError,null,null==s||null===(E=s.errors)||void 0===E||null===(_=E.mobileNumber)||void 0===_?void 0:_.message):null),l.createElement("div",{className:"search-action-wrapper",style:{width:"100%"}},c)))))};function Zt(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 Qt(e,t){if(t.length<e)throw new TypeError(e+" argument"+(e>1?"s":"")+" required, but only "+t.length+" present")}function el(e){Qt(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 tl(e,t){Qt(2,arguments);var l=el(e).getTime(),n=Zt(t);return new Date(l+n)}function ll(e){var t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),e.getTime()-t.getTime()}function nl(e){return Qt(1,arguments),e instanceof Date||"object"==typeof e&&"[object Date]"===Object.prototype.toString.call(e)}function il(e){if(Qt(1,arguments),!nl(e)&&"number"!=typeof e)return!1;var t=el(e);return!isNaN(Number(t))}var ol={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 al(e){return function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},l=t.width?String(t.width):e.defaultWidth,n=e.formats[l]||e.formats[e.defaultWidth];return n}}var rl={date:al({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:al({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:al({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},ul={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function dl(e){return function(t,l){var n,i=l||{};if("formatting"===(i.context?String(i.context):"standalone")&&e.formattingValues){var o=e.defaultFormattingWidth||e.defaultWidth,a=i.width?String(i.width):o;n=e.formattingValues[a]||e.formattingValues[o]}else{var r=e.defaultWidth,u=i.width?String(i.width):e.defaultWidth;n=e.values[u]||e.values[r]}return n[e.argumentCallback?e.argumentCallback(t):t]}}function sl(e){return function(t){var l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=l.width,i=n&&e.matchPatterns[n]||e.matchPatterns[e.defaultMatchWidth],o=t.match(i);if(!o)return null;var a,r=o[0],u=n&&e.parsePatterns[n]||e.parsePatterns[e.defaultParseWidth],d=Array.isArray(u)?vl(u,function(e){return e.test(r)}):cl(u,function(e){return e.test(r)});a=e.valueCallback?e.valueCallback(d):d,a=l.valueCallback?l.valueCallback(a):a;var s=t.slice(r.length);return{value:a,rest:s}}}function cl(e,t){for(var l in e)if(e.hasOwnProperty(l)&&t(e[l]))return l}function vl(e,t){for(var l=0;l<e.length;l++)if(t(e[l]))return l}var pl,ml={code:"en-US",formatDistance:function(e,t,l){var n,i=ol[e];return n="string"==typeof i?i:1===t?i.one:i.other.replace("{{count}}",t.toString()),null!=l&&l.addSuffix?l.comparison&&l.comparison>0?"in "+n:n+" ago":n},formatLong:rl,formatRelative:function(e,t,l,n){return ul[e]},localize:{ordinalNumber:function(e,t){var l=Number(e),n=l%100;if(n>20||n<10)switch(n%10){case 1:return l+"st";case 2:return l+"nd";case 3:return l+"rd"}return l+"th"},era:dl({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:dl({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:dl({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:dl({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:dl({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:(pl={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]:{},l=e.match(pl.matchPattern);if(!l)return null;var n=l[0],i=e.match(pl.parsePattern);if(!i)return null;var o=pl.valueCallback?pl.valueCallback(i[0]):i[0];o=t.valueCallback?t.valueCallback(o):o;var a=e.slice(n.length);return{value:o,rest:a}}),era:sl({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:sl({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:sl({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:sl({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:sl({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 El(e,t){Qt(2,arguments);var l=Zt(t);return tl(e,-l)}function _l(e){Qt(1,arguments);var t=1,l=el(e),n=l.getUTCDay(),i=(n<t?7:0)+n-t;return l.setUTCDate(l.getUTCDate()-i),l.setUTCHours(0,0,0,0),l}function fl(e){Qt(1,arguments);var t=el(e),l=t.getUTCFullYear(),n=new Date(0);n.setUTCFullYear(l+1,0,4),n.setUTCHours(0,0,0,0);var i=_l(n),o=new Date(0);o.setUTCFullYear(l,0,4),o.setUTCHours(0,0,0,0);var a=_l(o);return t.getTime()>=i.getTime()?l+1:t.getTime()>=a.getTime()?l:l-1}function Al(e){Qt(1,arguments);var t=fl(e),l=new Date(0);l.setUTCFullYear(t,0,4),l.setUTCHours(0,0,0,0);var n=_l(l);return n}function gl(e,t){Qt(1,arguments);var l=t||{},n=l.locale,i=n&&n.options&&n.options.weekStartsOn,o=null==i?0:Zt(i),a=null==l.weekStartsOn?o:Zt(l.weekStartsOn);if(!(a>=0&&a<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var r=el(e),u=r.getUTCDay(),d=(u<a?7:0)+u-a;return r.setUTCDate(r.getUTCDate()-d),r.setUTCHours(0,0,0,0),r}function Sl(e,t){Qt(1,arguments);var l=el(e),n=l.getUTCFullYear(),i=t||{},o=i.locale,a=o&&o.options&&o.options.firstWeekContainsDate,r=null==a?1:Zt(a),u=null==i.firstWeekContainsDate?r:Zt(i.firstWeekContainsDate);if(!(u>=1&&u<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var d=new Date(0);d.setUTCFullYear(n+1,0,u),d.setUTCHours(0,0,0,0);var s=gl(d,t),c=new Date(0);c.setUTCFullYear(n,0,u),c.setUTCHours(0,0,0,0);var v=gl(c,t);return l.getTime()>=s.getTime()?n+1:l.getTime()>=v.getTime()?n:n-1}function hl(e,t){Qt(1,arguments);var l=t||{},n=l.locale,i=n&&n.options&&n.options.firstWeekContainsDate,o=null==i?1:Zt(i),a=null==l.firstWeekContainsDate?o:Zt(l.firstWeekContainsDate),r=Sl(e,t),u=new Date(0);u.setUTCFullYear(r,0,a),u.setUTCHours(0,0,0,0);var d=gl(u,t);return d}function yl(e,t){for(var l=e<0?"-":"",n=Math.abs(e).toString();n.length<t;)n="0"+n;return l+n}var Dl={G:function(e,t,l){var n=e.getUTCFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return l.era(n,{width:"abbreviated"});case"GGGGG":return l.era(n,{width:"narrow"});case"GGGG":default:return l.era(n,{width:"wide"})}},y:function(e,t,l){if("yo"===t){var n=e.getUTCFullYear();return l.ordinalNumber(n>0?n:1-n,{unit:"year"})}return function(e,t){var l=e.getUTCFullYear(),n=l>0?l:1-l;return yl("yy"===t?n%100:n,t.length)}(e,t)},Y:function(e,t,l,n){var i=Sl(e,n),o=i>0?i:1-i;return"YY"===t?yl(o%100,2):"Yo"===t?l.ordinalNumber(o,{unit:"year"}):yl(o,t.length)},R:function(e,t){return yl(fl(e),t.length)},u:function(e,t){return yl(e.getUTCFullYear(),t.length)},Q:function(e,t,l){var n=Math.ceil((e.getUTCMonth()+1)/3);switch(t){case"Q":return String(n);case"QQ":return yl(n,2);case"Qo":return l.ordinalNumber(n,{unit:"quarter"});case"QQQ":return l.quarter(n,{width:"abbreviated",context:"formatting"});case"QQQQQ":return l.quarter(n,{width:"narrow",context:"formatting"});case"QQQQ":default:return l.quarter(n,{width:"wide",context:"formatting"})}},q:function(e,t,l){var n=Math.ceil((e.getUTCMonth()+1)/3);switch(t){case"q":return String(n);case"qq":return yl(n,2);case"qo":return l.ordinalNumber(n,{unit:"quarter"});case"qqq":return l.quarter(n,{width:"abbreviated",context:"standalone"});case"qqqqq":return l.quarter(n,{width:"narrow",context:"standalone"});case"qqqq":default:return l.quarter(n,{width:"wide",context:"standalone"})}},M:function(e,t,l){var n=e.getUTCMonth();switch(t){case"M":case"MM":return function(e,t){var l=e.getUTCMonth();return"M"===t?String(l+1):yl(l+1,2)}(e,t);case"Mo":return l.ordinalNumber(n+1,{unit:"month"});case"MMM":return l.month(n,{width:"abbreviated",context:"formatting"});case"MMMMM":return l.month(n,{width:"narrow",context:"formatting"});case"MMMM":default:return l.month(n,{width:"wide",context:"formatting"})}},L:function(e,t,l){var n=e.getUTCMonth();switch(t){case"L":return String(n+1);case"LL":return yl(n+1,2);case"Lo":return l.ordinalNumber(n+1,{unit:"month"});case"LLL":return l.month(n,{width:"abbreviated",context:"standalone"});case"LLLLL":return l.month(n,{width:"narrow",context:"standalone"});case"LLLL":default:return l.month(n,{width:"wide",context:"standalone"})}},w:function(e,t,l,n){var i=function(e,t){Qt(1,arguments);var l=el(e),n=gl(l,t).getTime()-hl(l,t).getTime();return Math.round(n/6048e5)+1}(e,n);return"wo"===t?l.ordinalNumber(i,{unit:"week"}):yl(i,t.length)},I:function(e,t,l){var n=function(e){Qt(1,arguments);var t=el(e),l=_l(t).getTime()-Al(t).getTime();return Math.round(l/6048e5)+1}(e);return"Io"===t?l.ordinalNumber(n,{unit:"week"}):yl(n,t.length)},d:function(e,t,l){return"do"===t?l.ordinalNumber(e.getUTCDate(),{unit:"date"}):function(e,t){return yl(e.getUTCDate(),t.length)}(e,t)},D:function(e,t,l){var n=function(e){Qt(1,arguments);var t=el(e),l=t.getTime();t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0);var n=t.getTime(),i=l-n;return Math.floor(i/864e5)+1}(e);return"Do"===t?l.ordinalNumber(n,{unit:"dayOfYear"}):yl(n,t.length)},E:function(e,t,l){var n=e.getUTCDay();switch(t){case"E":case"EE":case"EEE":return l.day(n,{width:"abbreviated",context:"formatting"});case"EEEEE":return l.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return l.day(n,{width:"short",context:"formatting"});case"EEEE":default:return l.day(n,{width:"wide",context:"formatting"})}},e:function(e,t,l,n){var i=e.getUTCDay(),o=(i-n.weekStartsOn+8)%7||7;switch(t){case"e":return String(o);case"ee":return yl(o,2);case"eo":return l.ordinalNumber(o,{unit:"day"});case"eee":return l.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return l.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return l.day(i,{width:"short",context:"formatting"});case"eeee":default:return l.day(i,{width:"wide",context:"formatting"})}},c:function(e,t,l,n){var i=e.getUTCDay(),o=(i-n.weekStartsOn+8)%7||7;switch(t){case"c":return String(o);case"cc":return yl(o,t.length);case"co":return l.ordinalNumber(o,{unit:"day"});case"ccc":return l.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return l.day(i,{width:"narrow",context:"standalone"});case"cccccc":return l.day(i,{width:"short",context:"standalone"});case"cccc":default:return l.day(i,{width:"wide",context:"standalone"})}},i:function(e,t,l){var n=e.getUTCDay(),i=0===n?7:n;switch(t){case"i":return String(i);case"ii":return yl(i,t.length);case"io":return l.ordinalNumber(i,{unit:"day"});case"iii":return l.day(n,{width:"abbreviated",context:"formatting"});case"iiiii":return l.day(n,{width:"narrow",context:"formatting"});case"iiiiii":return l.day(n,{width:"short",context:"formatting"});case"iiii":default:return l.day(n,{width:"wide",context:"formatting"})}},a:function(e,t,l){var n=e.getUTCHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return l.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"aaa":return l.dayPeriod(n,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return l.dayPeriod(n,{width:"narrow",context:"formatting"});case"aaaa":default:return l.dayPeriod(n,{width:"wide",context:"formatting"})}},b:function(e,t,l){var n,i=e.getUTCHours();switch(n=12===i?"noon":0===i?"midnight":i/12>=1?"pm":"am",t){case"b":case"bb":return l.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"bbb":return l.dayPeriod(n,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return l.dayPeriod(n,{width:"narrow",context:"formatting"});case"bbbb":default:return l.dayPeriod(n,{width:"wide",context:"formatting"})}},B:function(e,t,l){var n,i=e.getUTCHours();switch(n=i>=17?"evening":i>=12?"afternoon":i>=4?"morning":"night",t){case"B":case"BB":case"BBB":return l.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"BBBBB":return l.dayPeriod(n,{width:"narrow",context:"formatting"});case"BBBB":default:return l.dayPeriod(n,{width:"wide",context:"formatting"})}},h:function(e,t,l){if("ho"===t){var n=e.getUTCHours()%12;return 0===n&&(n=12),l.ordinalNumber(n,{unit:"hour"})}return function(e,t){return yl(e.getUTCHours()%12||12,t.length)}(e,t)},H:function(e,t,l){return"Ho"===t?l.ordinalNumber(e.getUTCHours(),{unit:"hour"}):function(e,t){return yl(e.getUTCHours(),t.length)}(e,t)},K:function(e,t,l){var n=e.getUTCHours()%12;return"Ko"===t?l.ordinalNumber(n,{unit:"hour"}):yl(n,t.length)},k:function(e,t,l){var n=e.getUTCHours();return 0===n&&(n=24),"ko"===t?l.ordinalNumber(n,{unit:"hour"}):yl(n,t.length)},m:function(e,t,l){return"mo"===t?l.ordinalNumber(e.getUTCMinutes(),{unit:"minute"}):function(e,t){return yl(e.getUTCMinutes(),t.length)}(e,t)},s:function(e,t,l){return"so"===t?l.ordinalNumber(e.getUTCSeconds(),{unit:"second"}):function(e,t){return yl(e.getUTCSeconds(),t.length)}(e,t)},S:function(e,t){return function(e,t){var l=t.length,n=e.getUTCMilliseconds();return yl(Math.floor(n*Math.pow(10,l-3)),t.length)}(e,t)},X:function(e,t,l,n){var i=(n._originalDate||e).getTimezoneOffset();if(0===i)return"Z";switch(t){case"X":return bl(i);case"XXXX":case"XX":return Cl(i);case"XXXXX":case"XXX":default:return Cl(i,":")}},x:function(e,t,l,n){var i=(n._originalDate||e).getTimezoneOffset();switch(t){case"x":return bl(i);case"xxxx":case"xx":return Cl(i);case"xxxxx":case"xxx":default:return Cl(i,":")}},O:function(e,t,l,n){var i=(n._originalDate||e).getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Tl(i,":");case"OOOO":default:return"GMT"+Cl(i,":")}},z:function(e,t,l,n){var i=(n._originalDate||e).getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Tl(i,":");case"zzzz":default:return"GMT"+Cl(i,":")}},t:function(e,t,l,n){return yl(Math.floor((n._originalDate||e).getTime()/1e3),t.length)},T:function(e,t,l,n){return yl((n._originalDate||e).getTime(),t.length)}};function Tl(e,t){var l=e>0?"-":"+",n=Math.abs(e),i=Math.floor(n/60),o=n%60;if(0===o)return l+String(i);var a=t||"";return l+String(i)+a+yl(o,2)}function bl(e,t){return e%60==0?(e>0?"-":"+")+yl(Math.abs(e)/60,2):Cl(e,t)}function Cl(e,t){var l=t||"",n=e>0?"-":"+",i=Math.abs(e);return n+yl(Math.floor(i/60),2)+l+yl(i%60,2)}function Pl(e,t){switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}}function Nl(e,t){switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}}var Il={p:Nl,P:function(e,t){var l,n=e.match(/(P+)(p+)?/)||[],i=n[1],o=n[2];if(!o)return Pl(e,t);switch(i){case"P":l=t.dateTime({width:"short"});break;case"PP":l=t.dateTime({width:"medium"});break;case"PPP":l=t.dateTime({width:"long"});break;case"PPPP":default:l=t.dateTime({width:"full"})}return l.replace("{{date}}",Pl(i,t)).replace("{{time}}",Nl(o,t))}},Ll=["D","DD"],Bl=["YY","YYYY"];function Ol(e){return-1!==Ll.indexOf(e)}function Rl(e){return-1!==Bl.indexOf(e)}function wl(e,t,l){if("YYYY"===e)throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(t,"`) for formatting years to the input `").concat(l,"`; 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(l,"`; 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(l,"`; 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(l,"`; see: https://git.io/fxCyr"))}var xl=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Ml=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Fl=/^'([^]*?)'?$/,kl=/''/g,Ul=/[a-zA-Z]/;function Hl(e,t,l){Qt(2,arguments);var n=String(t),i=l||{},o=i.locale||ml,a=o.options&&o.options.firstWeekContainsDate,r=null==a?1:Zt(a),u=null==i.firstWeekContainsDate?r:Zt(i.firstWeekContainsDate);if(!(u>=1&&u<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var d=o.options&&o.options.weekStartsOn,s=null==d?0:Zt(d),c=null==i.weekStartsOn?s:Zt(i.weekStartsOn);if(!(c>=0&&c<=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=el(e);if(!il(v))throw new RangeError("Invalid time value");var p=ll(v),m=El(v,p),E={firstWeekContainsDate:u,weekStartsOn:c,locale:o,_originalDate:v},_=n.match(Ml).map(function(e){var t=e[0];return"p"===t||"P"===t?(0,Il[t])(e,o.formatLong,E):e}).join("").match(xl).map(function(l){if("''"===l)return"'";var n=l[0];if("'"===n)return Wl(l);var a=Dl[n];if(a)return!i.useAdditionalWeekYearTokens&&Rl(l)&&wl(l,t,e),!i.useAdditionalDayOfYearTokens&&Ol(l)&&wl(l,t,e),a(m,l,o.localize,E);if(n.match(Ul))throw new RangeError("Format string contains an unescaped latin alphabet character `"+n+"`");return l}).join("");return _}function Wl(e){return e.match(Fl)[1].replace(kl,"'")}const Gl=e=>{let{parentRoute:r}=e;window.scroll(0,0);const{t:u}=n.useTranslation(),d=Digit.ULBService.getCurrentTenantId(),c={},v={moduleName:"bpa-services",applicationStatus:[],locality:[],assignee:"ASSIGNED_TO_ALL",applicationType:[]},p={sortBy:"",limit:Digit.Utils.browser.isMobile()?50:10,offset:0,sortOrder:"DESC"},m=Digit.SessionStorage.get("OBPS.INBOX"),E=t.useMemo(()=>m||{filterForm:v,searchForm:c,tableForm:p},[Object.values((null==m?void 0:m.filterForm)||{}),Object.values((null==m?void 0:m.searchForm)||{}),Object.values((null==m?void 0:m.tableForm)||{})]),[_,f]=t.useReducer(function(e,t){switch(t.action){case"mutateSearchForm":return Digit.SessionStorage.set("OBPS.INBOX",{...e,searchForm:t.data}),{...e,searchForm:t.data};case"mutateFilterForm":return Digit.SessionStorage.set("OBPS.INBOX",{...e,filterForm:t.data}),{...e,filterForm:t.data};case"mutateTableForm":return Digit.SessionStorage.set("OBPS.INBOX",{...e,tableForm:t.data}),{...e,tableForm:t.data}}},E),{data:A,isLoading:g}=Digit.Hooks.useBoundaryLocalities(d,"revenue",{},u),{isLoading:S,data:{table:h,statuses:y,totalCount:D}={}}=Digit.Hooks.obps.useBPAInbox({tenantId:d,filters:{..._}}),T={logoIcon:l.createElement(o.CaseIcon,null),headerText:"CS_COMMON_OBPS",links:[{text:u("BPA_SEARCH_PAGE_TITLE"),link:window.location.href.includes("/citizen")?"/digit-ui/citizen/obps/search/application":"/digit-ui/employee/obps/search/application",businessService:"BPA",roles:["BPAREG_EMPLOYEE","BPAREG_APPROVER","BPAREG_DOC_VERIFIER","BPAREG_DOC_VERIFIER"]}]},b=t.useCallback(e=>{let{registerRef:t,searchFormState:n,searchFieldComponents:i}=e;return l.createElement(Jt,{registerRef:t,searchFormState:n,searchFieldComponents:i})},[]),C=t.useCallback(e=>{let{registerRef:t,controlFilterForm:n,setFilterFormValue:i,getFilterFormValue:o}=e;return l.createElement(Xt,{statuses:y,isInboxLoading:S,registerRef:t,controlFilterForm:n,setFilterFormValue:i,filterFormState:null==_?void 0:_.filterForm,getFilterFormValue:o,localitiesForEmployeesCurrentTenant:A,loadingLocalitiesForEmployeesCurrentTenant:g})},[y,S,A,g]),P={SearchFormFields:b,onSearchFormSubmit:e=>{e.hasOwnProperty("")&&(null==e||delete e[""]),f({action:"mutateTableForm",data:{...p}}),f({action:"mutateSearchForm",data:e})},searchFormDefaultValues:null==_?void 0:_.searchForm,resetSearchFormDefaultValues:c,onSearchFormReset:e=>{e("mobileNumber",null),e("applicationNo",null),f({action:"mutateSearchForm",data:c})}},N={FilterFormFields:C,onFilterFormSubmit:e=>{e.hasOwnProperty("")&&(null==e||delete e[""]),f({action:"mutateTableForm",data:{...p}}),f({action:"mutateFilterForm",data:e})},filterFormDefaultValues:null==_?void 0:_.filterForm,resetFilterFormDefaultValues:v,onFilterFormReset:e=>{e("moduleName","bpa-services"),e("applicationStatus",""),e("locality",[]),e("assignee","ASSIGNED_TO_ALL"),e("applicationType",[]),f({action:"mutateFilterForm",data:v})}},I=(e=>{var o,a,r,u;let{parentRoute:d,onPageSizeChange:s,formState:c,totalCount:v,table:p,dispatch:m,onSortingByData:E}=e;const _=e=>l.createElement("span",{className:"cell-text styled-cell"},e),{t:f}=n.useTranslation(),A=t.useMemo(()=>[{Header:f("BPA_APPLICATION_NUMBER_LABEL"),accessor:"applicationNo",disableSortBy:!0,Cell:e=>{let{row:t}=e;return l.createElement("div",null,l.createElement(i.Link,{to:window.location.href.includes("/citizen")?`${d}/bpa/${t.original.applicationId}`:`${d}/inbox/bpa/${t.original.applicationId}`},l.createElement("span",{className:"link"},t.original.applicationId)))}},{Header:f("CS_APPLICATION_DETAILS_APPLICATION_DATE"),accessor:"applicationDate",Cell:e=>{var t,l;let{row:n}=e;return null!==(t=n.original)&&void 0!==t&&t.date?_(Hl(new Date(null===(l=n.original)||void 0===l?void 0:l.date),"dd/MM/yyyy")):""}},{Header:f("CS_APPLICATION_DETAILS_SUBMISSION_DATE"),accessor:"submissionDate",Cell:e=>{var t,l;let{row:n}=e;return null!==(t=n.original)&&void 0!==t&&t.submissionDate?_(Hl(new Date(null===(l=n.original)||void 0===l?void 0:l.submissionDate),"dd/MM/yyyy")):"NA"}},{Header:f("ES_INBOX_LOCALITY"),accessor:e=>f(null==e?void 0:e.locality),disableSortBy:!0},{Header:f("EVENTS_STATUS_LABEL"),accessor:e=>f(null!=e&&e.state?`WF_${null==e?void 0:e.businessService}_${null==e?void 0:e.state}`:`WF_${null==e?void 0:e.businessService}_${null==e?void 0:e.status}`),disableSortBy:!0},{Header:f("WF_INBOX_HEADER_OWNER_NAME"),accessor:e=>f(null==e?void 0:e.owner),disableSortBy:!0},{Header:f("BPA_SEARCH_APPLICATION_TYPE_LABEL"),accessor:e=>f(null==e?void 0:e.applicationType),disableSortBy:!0},{Header:f("ES_INBOX_SLA_DAYS_REMAINING"),accessor:e=>(e=>"CS_NA"===e?f(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:s,currentPage:(null===(o=c.tableForm)||void 0===o?void 0:o.offset)/(null===(a=c.tableForm)||void 0===a?void 0:a.limit),onNextPage:()=>{var e,t;return m({action:"mutateTableForm",data:{...c.tableForm,offset:parseInt(null===(e=c.tableForm)||void 0===e?void 0:e.offset)+parseInt(null===(t=c.tableForm)||void 0===t?void 0:t.limit)}})},onPrevPage:()=>{var e,t;return m({action:"mutateTableForm",data:{...c.tableForm,offset:parseInt(null===(e=c.tableForm)||void 0===e?void 0:e.offset)-parseInt(null===(t=c.tableForm)||void 0===t?void 0:t.limit)}})},pageSizeLimit:null===(r=c.tableForm)||void 0===r?void 0:r.limit,onSort:E,totalRecords:v,onSearch:null==c||null===(u=c.searchForm)||void 0===u?void 0:u.message,onLastPage:()=>{var e;return m({action:"mutateTableForm",data:{...c.tableForm,offset:10*Math.ceil(v/10)-parseInt(null===(e=c.tableForm)||void 0===e?void 0:e.limit)}})},onFirstPage:()=>m({action:"mutateTableForm",data:{...c.tableForm,offset:0}}),data:p,columns:A}})({parentRoute:r,onPageSizeChange:e=>{f({action:"mutateTableForm",data:{..._.tableForm,limit:e.target.value}})},formState:_,totalCount:D,table:h,dispatch:f,onSortingByData:e=>{if(e.length>0){const[{id:t,desc:l}]=e,n=l?"DESC":"ASC";_.tableForm.sortBy===t&&_.tableForm.sortOrder===n||f({action:"mutateTableForm",data:{..._.tableForm,sortBy:t,sortOrder:l?"DESC":"ASC"}})}}}),L=(e=>{let{table:t,getRedirectionLink:i}=e;const{t:r}=n.useTranslation();return{data:null==t?void 0:t.map(e=>{let{applicationId:t,date:l,applicationType:n,businessService:i,locality:o,status:a,owner:u,sla:d,state:s}=e;return{[r("BPA_APPLICATION_NUMBER_LABEL")]:t,[r("CS_APPLICATION_DETAILS_APPLICATION_DATE")]:Hl(new Date(l),"dd/MM/yyyy"),[r("BPA_SEARCH_APPLICATION_TYPE_LABEL")]:r(n),[r("ES_INBOX_LOCALITY")]:r(o),[r("EVENTS_STATUS_LABEL")]:r(s?`WF_${i}_${s}`:`WF_${i}_${a}`),[r("WF_INBOX_HEADER_CURRENT_OWNER")]:u,[r("ES_INBOX_SLA_DAYS_REMAINING")]:d}}),isTwoDynamicPrefix:!0,linkPrefix:window.location.href.includes("/citizen")?"/digit-ui/citizen/obps/":"/digit-ui/employee/obps/",getRedirectionLink:i,serviceRequestIdKey:"applicationNo",MobileSortFormValues:()=>{const e=[{code:"DESC",i18nKey:"ES_COMMON_SORT_BY_DESC"},{code:"ASC",i18nKey:"ES_COMMON_SORT_BY_ASC"}],{control:t}=a.useFormContext();return l.createElement(o.SearchField,null,l.createElement(a.Controller,{name:"sortOrder",control:t,render:t=>{let{onChange:n,value:i}=t;return l.createElement(o.RadioButtons,{onSelect:e=>{n(e.code)},selectedOption:e.filter(e=>e.code===i)[0],optionsKey:"i18nKey",name:"sortOrder",options:e})}}))}}})({parentRoute:r,table:h,getRedirectionLink:e=>{let t="";return t="BPAREG"===e?"search/application/stakeholder":window.location.href.includes("/citizen")?"bpa":"search/application/bpa",t}}),B={onMobileSortOrderData:e=>{const{sortOrder:t}=e;f({action:"mutateTableForm",data:{..._.tableForm,sortOrder:t}})},sortFormDefaultValues:null==_?void 0:_.tableForm,onSortFormReset:e=>{e("sortOrder","DESC"),f({action:"mutateTableForm",data:p})}};return l.createElement(t.Fragment,null,l.createElement(o.Header,null,u("ES_COMMON_INBOX"),D?l.createElement("p",{className:"inbox-count"},D):null),Digit.Utils.browser.isMobile()&&l.createElement("div",{style:{marginLeft:"12px"}},l.createElement(i.Link,{to:window.location.href.includes("/citizen")?"/digit-ui/citizen/obps/search/application":"/digit-ui/employee/obps/search/application"},l.createElement("span",{className:"link"},u("BPA_SEARCH_PAGE_TITLE")))),l.createElement(o.InboxComposer,s({isInboxLoading:S,PropsForInboxLinks:T},P,N,B,{propsForInboxTable:I,propsForInboxMobileCards:L,formState:_})))},jl=e=>{var t,a,r,u,d,c,v,p,m,E,_,f,A,g,S,h,y,D,T,b,C,P,N,I;let{path:L}=e;const B=i.useLocation(),{t:O}=n.useTranslation();window.location.href.includes("/ws/create-application/property-details"),window.location.href.includes("/acknowledgement")||window.location.href.includes("/disconnect-acknowledge");const R=null===(t=Digit)||void 0===t||null===(a=t.ComponentRegistryService)||void 0===a?void 0:a.getComponent("BPACitizenHomeScreen"),w=null===(r=Digit)||void 0===r||null===(u=r.ComponentRegistryService)||void 0===u?void 0:u.getComponent("ObpsCreateEDCR"),x=null===(d=Digit)||void 0===d||null===(c=d.ComponentRegistryService)||void 0===c?void 0:c.getComponent("ObpsCreateOCEDCR"),M=null===(v=Digit)||void 0===v||null===(p=v.ComponentRegistryService)||void 0===p?void 0:p.getComponent("ObpsNewBuildingPermit"),F=null===(m=Digit)||void 0===m||null===(E=m.ComponentRegistryService)||void 0===E?void 0:E.getComponent("ObpsOCBuildingPermit"),k=null===(_=Digit)||void 0===_||null===(f=_.ComponentRegistryService)||void 0===f?void 0:f.getComponent("ObpsStakeholderRegistration"),U=null===(A=Digit)||void 0===A||null===(g=A.ComponentRegistryService)||void 0===g?void 0:g.getComponent("ObpsEdcrInbox"),H=null===(S=Digit)||void 0===S||null===(h=S.ComponentRegistryService)||void 0===h?void 0:h.getComponent("ObpsCitizenBpaApplicationDetail"),W=null===(y=Digit)||void 0===y||null===(D=y.ComponentRegistryService)||void 0===D?void 0:D.getComponent("ObpsBPASendToArchitect"),G=null===(T=Digit)||void 0===T||null===(b=T.ComponentRegistryService)||void 0===b?void 0:b.getComponent("ObpsOCSendToArchitect"),j=null===(C=Digit)||void 0===C||null===(P=C.ComponentRegistryService)||void 0===P?void 0:P.getComponent("ObpsBPASendBackToCitizen"),K=null===(N=Digit)||void 0===N||null===(I=N.ComponentRegistryService)||void 0===I?void 0:I.getComponent("ObpsOCSendBackToCitizen"),Y="true"===sessionStorage.getItem("clickOnBPAApplyAfterEDCR");return l.createElement(l.Fragment,null,l.createElement("div",{className:"ws-citizen-wrapper"},!B.pathname.includes("response")&&!B.pathname.includes("openlink/stakeholder")&&!B.pathname.includes("/acknowledgement")&&!Y&&l.createElement(o.BackButton,{style:{border:"none"}},O("CS_COMMON_BACK")),l.createElement(i.Switch,null,l.createElement(o.PrivateRoute,{path:L+"/home",component:R}),l.createElement(o.PrivateRoute,{path:L+"/search/application",component:e=>l.createElement(jt,s({},e,{parentRoute:L}))}),l.createElement(o.PrivateRoute,{path:L+"/search/obps-application",component:e=>l.createElement(jt,s({},e,{parentRoute:L}))}),l.createElement(o.PrivateRoute,{path:L+"/edcrscrutiny/apply",component:w}),l.createElement(o.PrivateRoute,{path:L+"/edcrscrutiny/oc-apply",component:x}),l.createElement(o.PrivateRoute,{path:L+"/bpa/:applicationType/:serviceType",component:M}),l.createElement(o.PrivateRoute,{path:L+"/ocbpa/:applicationType/:serviceType",component:F}),l.createElement(o.PrivateRoute,{path:L+"/stakeholder/apply",component:k}),l.createElement(i.Route,{path:L+"/openlink/stakeholder/apply",component:k}),l.createElement(o.PrivateRoute,{path:L+"/my-applications",component:Kt}),l.createElement(o.PrivateRoute,{path:L+"/bpa/inbox",component:e=>l.createElement(Gl,s({},e,{parentRoute:L}))}),l.createElement(o.PrivateRoute,{path:L+"/edcr/inbox",component:e=>l.createElement(U,s({},e,{parentRoute:L}))}),l.createElement(o.PrivateRoute,{path:L+"/stakeholder/:id",component:Vt}),l.createElement(o.PrivateRoute,{path:L+"/bpa/:id",component:H}),l.createElement(o.PrivateRoute,{path:L+"/editApplication/bpa/:tenantId/:applicationNo",component:W}),l.createElement(o.PrivateRoute,{path:L+"/editApplication/ocbpa/:tenantId/:applicationNo",component:G}),l.createElement(o.PrivateRoute,{path:L+"/sendbacktocitizen/bpa/:tenantId/:applicationNo",component:j}),l.createElement(o.PrivateRoute,{path:L+"/sendbacktocitizen/ocbpa/:tenantId/:applicationNo",component:K}),l.createElement(o.PrivateRoute,{path:L+"/response",component:qt}))))},Kl=e=>{let{statuses:i,isInboxLoading:r,controlFilterForm:u,setFilterFormValue:d}=e;const{t:s}=n.useTranslation(),c=[{code:"ASSIGNED_TO_ME",name:""+s("ES_INBOX_ASSIGNED_TO_ME")},{code:"ASSIGNED_TO_ALL",name:""+s("ES_INBOX_ASSIGNED_TO_ALL")}],v=Digit.ULBService.getStateId(),{data:p,isLoading:m}=Digit.Hooks.obps.useMDMS(v,"StakeholderRegistraition","TradeTypetoRoleMapping",{select:e=>{var t;return null==e||null===(t=e.StakeholderRegistraition)||void 0===t?void 0:t.TradeTypetoRoleMapping.reduce((e,t)=>{const l=t.tradeType.split(".")[0];return e.find(e=>e.i18nKey.includes(l))?e:[...e,{role:t.role[0],i18nKey:"TRADELICENSE_TRADETYPE_"+t.tradeType.split(".")[0],tradeType:t.tradeType,identifier:l}]},[])}}),E=a.useWatch({control:u,name:"businessService",defaultValue:null});return l.createElement(t.Fragment,null,l.createElement(o.FilterFormField,null,l.createElement(a.Controller,{name:"assignee",control:u,render:e=>l.createElement(o.RadioButtons,{onSelect:t=>{e.onChange(t.code)},selectedOption:c.filter(t=>t.code===e.value)[0],optionsKey:"name",name:"assignee",options:c})})),l.createElement(o.FilterFormField,null,l.createElement(a.Controller,{name:"businessService",control:u,render:e=>m?l.createElement(o.Loader,null):l.createElement(t.Fragment,null,l.createElement("div",{className:"filter-label sub-filter-label",style:{fontSize:"18px",fontWeight:"600"}},s("BPA_LICENSE_TYPE")),l.createElement(o.RadioButtons,{onSelect:t=>{d("applicationStatus",[]),e.onChange(t)},selectedOption:e.value,optionsKey:"i18nKey",options:p}))})),E?l.createElement(o.FilterFormField,null,l.createElement("div",{className:"filter-label",style:{fontSize:"18px",fontWeight:"600"}},s("ACTION_TEST_APPLICATION_STATUS")),l.createElement(a.Controller,{name:"applicationStatus",control:u,render:e=>{const n=t.useMemo(()=>{var t;return null==i||null===(t=i.filter(e=>e.businessservice===E.identifier))||void 0===t?void 0:t.map((t,n)=>{var i;return l.createElement(o.CheckBox,{key:n,onChange:l=>{var n;return function(t){e.onChange(t)}(l.target.checked?[...e.value,null==t?void 0:t.statusid]:null===(n=e.value)||void 0===n?void 0:n.filter(e=>e!==(null==t?void 0:t.statusid)))},checked:null===(i=e.value)||void 0===i?void 0:i.includes(null==t?void 0:t.statusid),label:`${s(`WF_${t.businessservice}_${t.applicationstatus}`)} (${t.count})`})})},[e.value,i,E]);return l.createElement(t.Fragment,null,r?l.createElement(o.Loader,null):l.createElement(t.Fragment,null,n))}})):null)},Yl=e=>{var i,a,r,u;let{registerRef:d,searchFormState:s,searchFieldComponents:c}=e;const{t:v}=n.useTranslation();var p,m,E,_;return window.Digit.Utils.browser.isMobile()?l.createElement(t.Fragment,null,l.createElement(o.SearchField,null,l.createElement("label",null,v("BPA_APPLICATION_NUMBER_LABEL")),l.createElement(o.TextInput,{name:"applicationNo",inputRef:d({})})),l.createElement(o.SearchField,null,l.createElement("label",null,v("CORE_COMMON_MOBILE_NUMBER")),l.createElement(o.MobileNumber,{name:"mobileNumber",type:"number",inputRef:d({minLength:{value:10,message:v("CORE_COMMON_MOBILE_ERROR")},maxLength:{value:10,message:v("CORE_COMMON_MOBILE_ERROR")},pattern:{value:/[6789][0-9]{9}/,message:v("CORE_COMMON_MOBILE_ERROR")}})}),null!=s&&null!==(i=s.errors)&&void 0!==i&&null!==(a=i.mobileNumber)&&void 0!==a&&a.message?l.createElement(o.CardLabelError,null,null==s||null===(r=s.errors)||void 0===r||null===(u=r.mobileNumber)||void 0===u?void 0:u.message):null)):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(o.SearchField,null,l.createElement("label",null,v("BPA_APPLICATION_NUMBER_LABEL")),l.createElement(o.TextInput,{name:"applicationNo",inputRef:d({})})),l.createElement(o.SearchField,null,l.createElement("label",null,v("CORE_COMMON_MOBILE_NUMBER")),l.createElement(o.MobileNumber,{name:"mobileNumber",type:"number",inputRef:d({minLength:{value:10,message:v("CORE_COMMON_MOBILE_ERROR")},maxLength:{value:10,message:v("CORE_COMMON_MOBILE_ERROR")},pattern:{value:/[6789][0-9]{9}/,message:v("CORE_COMMON_MOBILE_ERROR")}})}),null!=s&&null!==(p=s.errors)&&void 0!==p&&null!==(m=p.mobileNumber)&&void 0!==m&&m.message?l.createElement(o.CardLabelError,null,null==s||null===(E=s.errors)||void 0===E||null===(_=E.mobileNumber)||void 0===_?void 0:_.message):null),l.createElement("div",{className:"search-action-wrapper",style:{width:"100%"}},c)))))};let $l=[];const zl=e=>{let{currentStep:t=1,flow:i=""}=e;const{t:a}=n.useTranslation(),r=window.Digit.Utils.browser.isMobile();return(e=>{switch(e){case"STAKEHOLDER":$l=["BPA_LICENSE_DETAILS_LABEL","BPA_NEW_ADDRESS_HEADER_DETAILS","BPA_DOC_DETAILS_SUMMARY","BPA_STEPPER_SUMMARY_HEADER"];break;case"OCBPA":$l=["BPA_BASIC_AND_PLOT_DETAILS_LABEL","BPA_SCRUTINY_DETAILS","BPA_DOCUMENT_AND_NOC_DETAILS_LABEL","BPA_STEPPER_SUMMARY_HEADER"];break;default:$l=["BPA_STEPPER_SCRUTINY_DETAILS_HEADER","COLONY_DETAILS","BPA_OWNER_AND_DOCUMENT_DETAILS_LABEL","BPA_STEPPER_SUMMARY_HEADER"]}})(i),l.createElement("div",{className:"timeline-container",style:r?{}:{margin:"0 8px 15px"}},$l.map((e,n,i)=>l.createElement("div",{className:"timeline-checkpoint",key:n},l.createElement("div",{className:"timeline-content"},l.createElement("span",{className:"circle "+(n<=t-1&&"active")},n<t-1?l.createElement(o.TickMark,null):n+1),l.createElement("span",{className:"secondary-color"},a(e))),n<i.length-1&&l.createElement("span",{className:"line "+(n<t-1&&"active")}))))};function Vl(e){let{documents:t,svgStyles:i={},isSendBackFlow:a=!1,isHrLine:r=!1,titleStyles:u}=e;const{t:d}=n.useTranslation(),s=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"}},!s&&(null==t?void 0:t.map((e,n)=>{var i,s,c;return l.createElement(l.Fragment,{key:n},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((t,n)=>{var i;return l.createElement("div",{style:{width:"180px"}},l.createElement(o.CardSubHeader,{style:u||{marginTop:"32px",marginBottom:"8px",color:"#505A5F",fontSize:"24px"}},d(null==e?void 0:e.title)),l.createElement("a",{target:"_",href:null==t?void 0:t.url,style:{minWidth:"80px",marginRight:"10px",maxWidth:"100px",height:"auto",minWidth:"100px"},key:n},l.createElement("div",{style:{display:"flex",justifyContent:"flex-start"}},l.createElement(o.PDFSvg,null)),l.createElement("p",{style:{marginTop:"8px",fontWeight:"bold",textAlign:"start",color:"#505A5F"}},d(null==t?void 0:t.title)),a?null!=t&&null!==(i=t.documentType)&&void 0!==i&&i.includes("NOC")?l.createElement("p",{style:{textAlign:"center"}},d(null==t?void 0:t.documentType.split(".")[1])):l.createElement("p",{style:{textAlign:"center"}},d(null==t?void 0:t.documentType)):""))}):!window.location.href.includes("citizen")&&l.createElement("div",null,l.createElement("p",null,d("BPA_NO_DOCUMENTS_UPLOADED_LABEL")),l.createElement("div",{style:{width:"180px"}},l.createElement(o.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:n},l.createElement("div",{style:{display:"flex",justifyContent:"flex-start"}},l.createElement(o.PDFSvg,null)),l.createElement("p",{style:{marginTop:"8px",fontWeight:"bold",textAlign:"start",color:"#505A5F"}}),a?(null!==(s=value)&&void 0!==s&&null!==(c=s.documentType)&&void 0!==c&&c.includes("NOC"),l.createElement("p",{style:{textAlign:"center"}})):"")))),r&&(null==t?void 0:t.length)!=n+1?l.createElement("hr",{style:{color:"#D6D5D4",backgroundColor:"#D6D5D4",height:"2px",marginTop:"20px",marginBottom:"20px"}}):null))})),s&&(null==t?void 0:t.map((e,t)=>{var n;return l.createElement(l.Fragment,{key:t},null!=e&&e.title?l.createElement(o.CardSubHeader,{style:{marginTop:"32px",marginBottom:"8px",color:"#505A5F",fontSize:"24px"}},d(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===(n=e.values)||void 0===n?void 0:n.map((e,t)=>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:t},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"}},d(null==e?void 0:e.title)),null!=e&&e.docInfo?l.createElement("div",{style:{fontSize:"12px",color:"#505A5F",fontWeight:400,lineHeight:"15px",marginBottom:"10px"}},""+d(null==e?void 0:e.docInfo)):null,l.createElement(o.PDFSvg,null),l.createElement("p",{style:{marginTop:"8px",fontSize:"16px",lineHeight:"19px",color:"#505A5F",fontWeight:"400",textAlign:"center",color:"#505A5F"}},""+d(null==e?void 0:e.title))))):!window.location.href.includes("citizen")&&l.createElement("div",null,l.createElement("p",null,d("BPA_NO_DOCUMENTS_UPLOADED_LABEL")))))})))}const ql=l.memo(function(e){var n,i,a;let{t:u,document:d,setDocuments:s,documents:c,formData:v,beforeUploadDocuments:p,setIsNextButtonDisabled:m}=e;const E=(null==c?void 0:c.filter(e=>{var t;return null==e||null===(t=e.documentType)||void 0===t?void 0:t.includes(null==d?void 0:d.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==d?void 0:d.code)})[0]),_=Digit.ULBService.getStateId(),[f,A]=t.useState(E?{...E,active:!0,code:null==E?void 0:E.documentType,i18nKey:null==E?void 0:E.documentType}:(null==d||null===(n=d.dropdownData)||void 0===n?void 0:n.length)>0?null==d?void 0:d.dropdownData[0]:{}),[g,S]=t.useState(null),[h,y]=t.useState(()=>(null==c?void 0:c.filter(e=>{var t;return null==e||null===(t=e.documentType)||void 0===t?void 0:t.includes(null==d?void 0:d.code)}).map(e=>({fileStoreId:null==e?void 0:e.fileStoreId,fileName:(null==e?void 0:e.fileName)||""})))||null),[D,T]=t.useState([]),[b,C]=t.useState([]),[P,N]=t.useState([]||(null==v||null===(i=v.documents)||void 0===i?void 0:i.documents.filter(e=>e.documentType===f.code))),[I,L]=t.useState(null),[B,O]=t.useState(null);function R(e){return e[0]+e[1]/60+e[2]/3600}t.useEffect(()=>{b.length>0&&null!=f&&f.code&&(s(e=>{if(null===h||null==(null==h?void 0:h.fileStoreId))return e;const t=null==e?void 0:e.filter(e=>(null==e?void 0:e.fileStoreId)!==h.fileStoreId);let l=[];return b&&b.map((e,t)=>{var n,i;l.push({documentType:null==f?void 0:f.code,fileStoreId:e.fileStoreId,additionalDetails:{category:null==f?void 0:f.code.split(".").slice(0,2).join("_"),latitude:I,longitude:B},documentUid:e.fileStoreId,fileName:(null===(n=P[t])||void 0===n?void 0:n.name)||"",id:c?null===(i=c.find(e=>e.documentType===(null==f?void 0:f.code)))||void 0===i?void 0:i.id:void 0})}),[...t,...l]}),C([])),null!=f&&f.code&&s(e=>{var t;return null===h||null==(null==h?void 0:h.fileStoreId)?((null==e?void 0:e.length)>0&&(null==e||e.forEach(e=>{var t,l,n,i,o;`${null==e||null===(t=e.documentType)||void 0===t?void 0:t.split(".")[0]}.${null==e||null===(l=e.documentType)||void 0===l?void 0:l.split(".")[1]}`==`${null==f||null===(n=f.code)||void 0===n?void 0:n.split(".")[0]}.${null==f||null===(i=f.code)||void 0===i?void 0:i.split(".")[1]}`&&(null!=e&&e.documentType&&(e.documentType=null==f?void 0:f.code),null!=e&&null!==(o=e.file)&&void 0!==o&&o.documentType&&(e.file.documentType=null==f?void 0:f.code))})),e):[...null==e?void 0:e.filter(e=>(null==e?void 0:e.fileStoreId)!==h.fileStoreId),{documentType:null==f?void 0:f.code,fileStoreId:h.fileStoreId,documentUid:h.fileStoreId,fileName:(null==g?void 0:g.name)||h.fileName||"document",id:c?null===(t=c.find(e=>e.documentType===(null==f?void 0:f.code)))||void 0===t?void 0:t.id:void 0}]})},[h,f]),t.useEffect(()=>{f.code||null===h||C([...b,h])},[h]);const w=t.useMemo(()=>{var e,t;let l=[];return null==v||null===(e=v.documents)||void 0===e||null===(t=e.documents)||void 0===t||t.filter(e=>e.documentType===f.code).forEach(e=>l.push([e.fileName,{file:{name:e.fileName,type:e.documentType},fileStoreId:{fileStoreId:e.fileStoreId,tenantId:_}}])),l},[v]);return l.createElement("div",null,l.createElement(o.CardLabel,null,null!=d&&d.required?u(null==d?void 0:d.code)+" *":""+u(null==d?void 0:d.code)),l.createElement(o.Dropdown,{t:u,isMandatory:!1,option:Digit.Utils.locale.sortDropdownNames(null==d?void 0:d.dropdownData,"i18nKey",u),selected:f,optionKey:"i18nKey",select:e=>{if(null!=E&&E.documentType){E.documentType=null==e?void 0:e.code;let t=null==c?void 0:c.filter(e=>{var t;return null==e||null===(t=e.documentType)||void 0===t?void 0:t.includes(null==d?void 0:d.code)});t.map(t=>t.documentType=null==e?void 0:e.code);let l=[...null==c?void 0:c.filter(e=>{var t;return!(null!=e&&null!==(t=e.documentType)&&void 0!==t&&t.includes(null==d?void 0:d.code))}),...t];s(l)}A(e)}}),l.createElement(o.MultiUploadWrapper,{module:"BPA",tenantId:_,getFormState:function(e){let t,l,n=f.code;if((null==e?void 0:e.length)>0)(function(e){return new Promise(t=>{r.getData(e,function(){const e=r.getTag(this,"GPSLatitude"),l=r.getTag(this,"GPSLongitude");if(e&&l){const n=R(e),i=R(l);t({latitude:n,longitude:i})}else t({latitude:null,longitude:null}),"SITEPHOTOGRAPH.ONE"===(null==d?void 0:d.code)&&alert("Please Upload a Photo with Location Details")})})})(e[0][1].file).then(i=>{var o,a,r;console.log("Latitude:",i.latitude),console.log("Longitude:",i.longitude),L(i.latitude),O(i.longitude),"SITEPHOTOGRAPH.ONE"===(null==d?void 0:d.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),l=Object.values(t),l=null==v||null===(o=v.documents)||void 0===o||null===(a=o.documents)||void 0===a?void 0:a.filter(e=>e.documentType===f.code),T(l);let u=[];null==e||e.map((e,t)=>{var l,n,o,a;u.push({documentType:null==f?void 0:f.code,additionalDetails:{category:null==f?void 0:f.code.split(".").slice(0,2).join("_"),latitude:i.latitude,longitude:i.longitude},fileStoreId:null==e||null===(l=e[1])||void 0===l||null===(n=l.fileStoreId)||void 0===n?void 0:n.fileStoreId,documentUid:null==e||null===(o=e[1].fileStoreId)||void 0===o?void 0:o.fileStoreId,fileName:(null==e?void 0:e[0])||"",id:c?null===(a=c.find(e=>e.documentType===(null==f?void 0:f.code)))||void 0===a?void 0:a.id:void 0})});const p=[...c.filter(e=>e.documentType!==n),...u];s(p),null===(r=l)||void 0===r||r.map(e=>{null!=e&&e.file||(e.file={}),e.file.documentType=n,function(e,t){e&&S(e.file),e&&N([...P,e.file])}(e)})}).catch(e=>{console.error("Error extracting geo location:",e)});else if(0==(null==e?void 0:e.length)){const e=[...c.filter(e=>e.documentType!==n)];s(e)}},setuploadedstate:w,t:u,extraStyleName:"OBPS",allowedFileTypesRegex:/(.*?)(jpg|jpeg|png|image|pdf)$/i,allowedMaxSizeInMB:10,acceptFiles:"image/*, .pdf, .png, .jpeg, .jpg"}),(null==d||null===(a=d.uploadedDocuments)||void 0===a?void 0:a.length)&&l.createElement(Vl,{isSendBackFlow:!0,documents:null==d?void 0:d.uploadedDocuments}),"SITEPHOTOGRAPH.ONE"===(null==d?void 0:d.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")),m(!1)," "):l.createElement("div",null,l.createElement("p",{style:{color:"red"}},"Please upload a Photo with Location details."),m(!0)," ")))});function Xl(e){var n,i,a;let{t:r,document:u,setNocDocuments:d,nocDocuments:s,formData:c,beforeUploadNocDocuments:v,pdfLoading:p}=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==u?void 0:u.code)})[0])||null==v||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)});const m=Digit.ULBService.getStateId(),[E,_]=t.useState(null==u||null===(n=u.dropdownData)||void 0===n?void 0:n[0]),[f,A]=t.useState(null),[g,S]=t.useState(()=>{var e,t;return{fileStoreId:null==s||null===(e=s.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])||void 0===e?void 0:e.fileStoreId,fileName:null==s||null===(t=s.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])||void 0===t?void 0:t.fileName}||null}),[h,y]=t.useState([]);t.useEffect(()=>{null==E||!E.documentType||0!=s.filter(e=>e.documentType===(null==E?void 0:E.documentType)).length&&h.filter(e=>{var t;return(null==e||null===(t=e.file)||void 0===t?void 0:t.documentType)===(null==E?void 0:E.documentType)}).length===s.filter(e=>e.documentType===(null==E?void 0:E.documentType)).length||d(e=>{var t,l;return null===g||null==(null==g?void 0:g.fileStoreId)?e:[...null==e?void 0:e.filter(e=>(null==e?void 0:e.fileStoreId)!==g.fileStoreId),{documentType:null==u||null===(t=u.dropdownData)||void 0===t||null===(l=t[0])||void 0===l?void 0:l.code,fileStoreId:g.fileStoreId,documentUid:g.fileStoreId,fileName:(null==g?void 0:g.fileName)||""}]})},[g,E]);const D=t.useMemo(()=>{var e,t;let l=[];const n=E.code;return null==c||null===(e=c.nocDocuments)||void 0===e||null===(t=e.nocDocuments)||void 0===t||t.filter(e=>e.documentType===n).forEach(e=>l.push([e.fileName,{file:{name:e.fileName,type:e.documentType},fileStoreId:{fileStoreId:e.fileStoreId,tenantId:m}}])),l},[c]);return l.createElement("div",{style:{border:"1px solid #D6D5D4",padding:"16px 8px 16px 8px",background:"#FAFAFA",borderRadius:"5px",marginBottom:"24px",marginTop:"5px"}},l.createElement("div",null,l.createElement("h1",{style:{color:"#0B0C0C",lineHeight:"37px",fontWeight:"700",fontSize:"32px",fontFamily:"Roboto Condensed",paddingBottom:"24px"}},r(`BPA_${null==u?void 0:u.nocType}_HEADER`)),l.createElement("div",{style:{display:"flex",paddingBottom:"24px"}},l.createElement("h1",{style:{color:"#0B0C0C",lineHeight:"19px",fontWeight:"700",fontSize:"16px",fontFamily:"Roboto",marginRight:"10px"}},r(`BPA_${null==u?void 0:u.nocType}_LABEL`)),l.createElement("h1",null,null==u||null===(i=u.additionalDetails)||void 0===i?void 0:i.appNumberLink))),!window.location.href.includes("sendbacktocitizen")&&l.createElement(o.MultiUploadWrapper,{module:"BPA",tenantId:m,getFormState:e=>function(e,t){var l;let n,i;if((null==e?void 0:e.length)>0){var o;n=Object.fromEntries(e),i=Object.values(n),i=null==c||null===(o=c.nocDocuments)||void 0===o?void 0:o.nocDocuments.filter(e=>e.documentType===t),y(i);let l=[];null==e||e.map((e,n)=>{var i,o,a,r;l.push({documentType:t,fileStoreId:null==e||null===(i=e[1])||void 0===i||null===(o=i.fileStoreId)||void 0===o?void 0:o.fileStoreId,documentUid:null==e||null===(a=e[1].fileStoreId)||void 0===a?void 0:a.fileStoreId,fileName:(null==e?void 0:e[0])||"",id:s?null===(r=s.find(e=>e.documentType===t))||void 0===r?void 0:r.id:void 0})});const a=[...s.filter(e=>e.documentType!==t),...l];d(a)}null===(l=i)||void 0===l||l.map(e=>{null!=e&&e.file||(e.file={}),e.file.documentType=t,function(e,t){e&&_({documentType:t}),e&&A(e.file)}(e,t)})}(e,u.dropdownData[0].code),setuploadedstate:D,t:r,allowedFileTypesRegex:/(.*?)(jpg|jpeg|png|image|pdf)$/i,allowedMaxSizeInMB:5,acceptFiles:"image/*, .pdf, .png, .jpeg, .jpg"}),(null==u||null===(a=u.uploadedDocuments)||void 0===a?void 0:a.length)&&!p&&l.createElement(Vl,{documents:null==u?void 0:u.uploadedDocuments,svgStyles:{},isSendBackFlow:!1,isHrLine:!0,titleStyles:{fontSize:"18px",lineHeight:"24px",fontWeight:700,marginBottom:"10px"}}))}const Jl=e=>{var n,i;let{t:a,onSelect:r,formData:u={},handleRemove:d,onSave:s}=e;const[c,v]=t.useState((null==u||null===(n=u.address)||void 0===n?void 0:n.pincode)||""),[p,m]=t.useState((null==u||null===(i=u.address)||void 0===i?void 0:i.geoLocation)||{}),E=Digit.Hooks.obps.useTenants();console.log("Tenants Data:",E);const[_,f]=t.useState(null),[A,g]=t.useState(""),S=Digit.ULBService.getCurrentTenantId();console.log(S,"TENNN"),Digit.ULBService.getStateId();let h=!Digit.Utils.browser.isMobile();return l.createElement("div",{style:{position:"fixed",background:"#00000050",width:"100%",height:"100vh",top:"0",left:"0"}},l.createElement("div",{style:{position:"relative",marginTop:"60px"}},console.log("GIS component mounted"),l.createElement("div",{style:h?{marginLeft:"25%",marginRight:"25%"}:{}},l.createElement(o.LocationSearchCard,{style:{position:"relative",marginTop:"100px",marginBottom:"-100px"},header:a("BPA_GIS_LABEL"),cardText:a(""),nextText:a("BPA_PIN_LOCATION_LABEL"),skip:()=>r(),t:a,position:p,onSave:()=>s(p,c,A),onChange:(e,t,l)=>((e,t,l)=>{f(null),(null==E?void 0:E.find(t=>{var l;return null===(l=t.pincode)||void 0===l?void 0:l.find(t=>t==e)}))?(v(e),m(t),g(l)):(f("BPA_COMMON_PINCODE_NOT_SERVICABLE"),v(""),m({}),g(""))})(e,t,l),disabled:""===c,forcedError:a(_),isPlaceRequired:!0,handleRemove:d,Webview:h,isPopUp:!0}))))},Zl=[{head:"ES_NEW_APPLICATION_PROPERTY_ASSESSMENT",body:[{route:"home",component:"EDCRForm",nextStep:"",hideInEmployee:!0,key:"ScrutinyDetails",texts:{headerCaption:"",header:"EDCR_COMMON_APPL_NEW",cardText:"BPA_PROVIDE_REQ_FOR_NEW_BPA",submitBarLabel:"EDCR_SCRUTINY_SUBMIT_BUTTON",skipText:"EDCR_CLEAR_FORM"}}]}],Ql=[{head:"ES_NEW_APPLICATION_PROPERTY_ASSESSMENT",body:[{route:"docs-required",component:"OCEDCRDocsRequired",key:"data",nextStep:"home"},{route:"home",component:"OCeDCRScrutiny",nextStep:"upload-diagram",hideInEmployee:!0,key:"ScrutinyDetails"},{route:"upload-diagram",component:"OCUploadPlanDiagram",nextStep:null,hideInEmployee:!0,key:"uploadData",texts:{headerCaption:"BPA_OC_NEW_BUILDING_CONSTRUCTION_LABEL",header:"BPA_UPLOAD_OC_PLAN_DIAGRAM_LABEL",cardText:"",submitBarLabel:"BPA_COMMON_BUTTON_SUBMIT",skipText:""}}]}],en=[{head:"ES_NEW_APPLICATION_PROPERTY_ASSESSMENT",body:[{route:"docs-required",component:"DocsRequired",key:"data",nextStep:"noc-number"},{route:"noc-number",component:"NOCNumber",nextStep:"basic-details",key:"nocnumber",texts:{headerCaption:"BPA_NOC_NUMBER_DETAILS",header:"",submitBarLabel:"CS_COMMON_NEXT"}},{route:"basic-details",component:"BasicDetails",key:"data",nextStep:"plot-details"},{route:"plot-details",component:"PlotDetails",key:"data",nextStep:"scrutiny-details",texts:{headerCaption:"BPA_SCRUTINY_DETAILS",header:"BPA_PLOT_DETAILS_TITLE",cardText:"",submitBarLabel:"CS_COMMON_NEXT"},inputs:[{label:"BPA_HOLDING_NUMBER_LABEL",type:"text",validation:{},name:"holdingNumber"},{label:"BPA_BOUNDARY_LAND_REG_DETAIL_LABEL",type:"textarea",validation:{},name:"registrationDetails"},{label:"BPA_BOUNDARY_WALL_LENGTH_LABEL_INPUT",type:"text",validation:{pattern:/^[0-9]*$/,title:"Enter in Numbers[0-9]",required:!0},name:"boundaryWallLength"}]},{route:"scrutiny-details",component:"ScrutinyDetails",nextStep:"location",hideInEmployee:!0,key:"subOccupancy",texts:{headerCaption:"BPA_STEPPER_SCRUTINY_DETAILS_HEADER",header:"BPA_STEPPER_SCRUTINY_DETAILS_HEADER",cardText:"",submitBarLabel:"CS_COMMON_NEXT",skipText:"CORE_COMMON_SKIP_CONTINUE"}},{route:"location",component:"LocationDetails",nextStep:"owner-details",hideInEmployee:!0,key:"address",texts:{headerCaption:"BPA_STEPPER_SCRUTINY_DETAILS_HEADER",header:"BPA_NEW_TRADE_DETAILS_HEADER_DETAILS",cardText:"",submitBarLabel:"CS_COMMON_NEXT",skipAndContinueText:""}},{route:"owner-details",component:"OwnerDetails",nextStep:"document-details",key:"owners",texts:{headerCaption:"BPA_OWNER_AND_DOCUMENT_DETAILS_LABEL",header:"BPA_APPLICANT_DETAILS_HEADER",submitBarLabel:"CS_COMMON_NEXT"}},{route:"document-details",component:"DocumentDetails",nextStep:null,key:"documents",texts:{headerCaption:"BPA_OWNER_AND_DOCUMENT_DETAILS_LABEL",header:"BPA_DOCUMENT_DETAILS_LABEL",submitBarLabel:"CS_COMMON_NEXT"}}]}],tn=[{route:"docs-required",component:"DocsRequired",key:"data",nextStep:"basic-details"},{route:"basic-details",component:"BasicDetails",key:"data",nextStep:"plot-details"},{route:"plot-details",component:"PlotDetails",key:"data",nextStep:"scrutiny-details",texts:{headerCaption:"BPA_SCRUTINY_DETAILS",header:"BPA_PLOT_DETAILS_TITLE",cardText:"",submitBarLabel:"CS_COMMON_NEXT"},inputs:[{label:"BPA_BOUNDARY_LAND_REG_DETAIL_LABEL",type:"textarea",validation:{},name:"registrationDetails"},{label:"BPA_BOUNDARY_WALL_LENGTH_LABEL_INPUT",type:"text",validation:{pattern:"^[0-9]*$",title:"Enter in Numbers[0-9]",required:!0},name:"boundaryWallLength"},{label:"BPA_WARD_NUMBER_LABEL",type:"text",validation:{pattern:"^[a-zA-Z0-9 -]+$",required:!0},name:"wardnumber"},{label:"BPA_ZONE_NUMBER_LABEL",type:"text",validation:{},name:"zonenumber"},{label:"BPA_KHASRA_NUMBER_LABEL",type:"text",validation:{required:!0},name:"khasraNumber"},{label:"BPA_ARCHITECT_ID",type:"text",validation:{required:!0},name:"architectid"},{label:"BPA_PROPERTY_UID",type:"text",validation:{},name:"propertyuid"},{label:"BPA_NUMBER_OF_BATHS",type:"text",validation:{},name:"bathnumber"},{label:"BPA_NUMBER_OF_KITCHENS",type:"text",validation:{},name:"kitchenNumber"},{label:"BPA_APPROX_INHABITANTS_FOR_ACCOMODATION",type:"text",validation:{},name:"approxinhabitants"},{label:"BPA_DISTANCE_FROM_SEWER",type:"text",validation:{},name:"distancefromsewer"},{label:"BPA_SOURCE_OF_WATER",type:"text",validation:{},name:"sourceofwater"},{label:"BPA_NUMBER_OF_WATER_CLOSETS",type:"text",validation:{},name:"watercloset"},{label:"BPA_MATERIAL_TO-BE_USED_IN_WALLS",type:"text",validation:{},name:"materialused"},{label:"BPA_MATERIAL_TO-BE_USED_IN_FLOOR",type:"text",validation:{},name:"materialusedinfloor"},{label:"BPA_MATERIAL_TO-BE_USED_IN_ROOFS",type:"text",validation:{},name:"materialusedinroofs"}]},{route:"scrutiny-details",component:"ScrutinyDetails",nextStep:"location",hideInEmployee:!0,key:"subOccupancy",texts:{headerCaption:"BPA_STEPPER_SCRUTINY_DETAILS_HEADER",header:"BPA_STEPPER_SCRUTINY_DETAILS_HEADER",cardText:"",submitBarLabel:"CS_COMMON_NEXT",skipText:"CORE_COMMON_SKIP_CONTINUE"}},{type:"component",route:"search-property",isMandatory:!0,component:"CPTSearchProperty",key:"cptsearchproperty",withoutLabel:!0,nextStep:"search-results",hideInEmployee:!0},{type:"component",route:"search-results",isMandatory:!0,component:"CPTSearchResults",key:"cptsearchresults",withoutLabel:!0,nextStep:"location",hideInEmployee:!0},{type:"component",route:"create-property",isMandatory:!0,component:"CPTCreateProperty",key:"cptcreateproperty",withoutLabel:!0,nextStep:"acknowledge-create-property",hideInEmployee:!0},{type:"component",route:"acknowledge-create-property",isMandatory:!0,component:"CPTAcknowledgement",key:"cptacknowledgement",withoutLabel:!0,nextStep:"location",hideInEmployee:!0},{route:"location",component:"LocationDetails",nextStep:"additional-building-details",hideInEmployee:!0,key:"address",texts:{headerCaption:"BPA_STEPPER_SCRUTINY_DETAILS_HEADER",header:"BPA_NEW_TRADE_DETAILS_HEADER_DETAILS",cardText:"",submitBarLabel:"CS_COMMON_NEXT",skipAndContinueText:""}},{route:"additional-building-details",component:"BPANewBuildingdetails",nextStep:"owner-details",key:"owners",texts:{header:"BPA_ADDITIONAL_BUILDING_DETAILS",submitBarLabel:"CS_COMMON_NEXT"}},{route:"owner-details",component:"OwnerDetails",nextStep:"document-details",key:"owners",texts:{headerCaption:"BPA_OWNER_AND_DOCUMENT_DETAILS_LABEL",header:"BPA_APPLICANT_DETAILS_HEADER",submitBarLabel:"CS_COMMON_NEXT"}},{route:"document-details",component:"DocumentDetails",nextStep:null,key:"documents",texts:{headerCaption:"BPA_OWNER_AND_DOCUMENT_DETAILS_LABEL",header:"BPA_DOCUMENT_DETAILS_LABEL",submitBarLabel:"CS_COMMON_NEXT"}}],ln=(e,t)=>(t&&Object.keys(t).map(l=>{e=e.replace(":"+l,t[l])}),e),nn=[{head:"ES_NEW_APPLICATION_PROPERTY_ASSESSMENT",body:[{route:"docs-required",component:"DocsRequired",key:"data",nextStep:"basic-details"},{route:"basic-details",component:"OCBasicDetails",key:"data",nextStep:"plot-details"},{route:"plot-details",component:"PlotDetails",key:"data",nextStep:"scrutiny-details",texts:{headerCaption:"BPA_SCRUTINY_DETAILS",header:"BPA_PLOT_DETAILS_TITLE",cardText:"",submitBarLabel:"CS_COMMON_NEXT",skipText:"CORE_COMMON_SKIP_CONTINUE"},inputs:[{label:"BPA_HOLDING_NUMBER_LABEL",type:"text",validation:{},name:"holdingNumber"},{label:"BPA_BOUNDARY_LAND_REG_DETAIL_LABEL",type:"textarea",validation:{},name:"registrationDetails"}]},{route:"scrutiny-details",component:"ScrutinyDetails",nextStep:"document-details",hideInEmployee:!0,key:"subOccupancy",texts:{headerCaption:"BPA_STEPPER_SCRUTINY_DETAILS_HEADER",header:"BPA_STEPPER_SCRUTINY_DETAILS_HEADER",cardText:"",submitBarLabel:"CS_COMMON_NEXT",skipAndContinueText:""}},{route:"document-details",component:"DocumentDetails",nextStep:"noc-details",key:"documents",texts:{headerCaption:"BPA_OWNER_AND_DOCUMENT_DETAILS_LABEL",header:"BPA_DOCUMENT_DETAILS_LABEL",submitBarLabel:"CS_COMMON_NEXT"}},{route:"noc-details",component:"NOCDetails",nextStep:null,key:"nocDocuments",texts:{headerCaption:"BPA_NOC_DETAILS_SUMMARY",header:"",submitBarLabel:"CS_COMMON_NEXT",skipText:"CORE_COMMON_SKIP_CONTINUE"}}]}],on=(e,t)=>(t&&Object.keys(t).map(l=>{e=e.replace(":"+l,t[l])}),e),an=[{head:"ES_NEW_APPLICATION_PROPERTY_ASSESSMENT",body:[{route:"stakeholder-docs-required",component:"StakeholderDocsRequired",key:"data",nextStep:"provide-license-type"},{type:"component",route:"provide-license-type",isMandatory:!0,component:"LicenseType",texts:{headerCaption:"BPA_LICENSE_DET_CAPTION",header:"BPA_LICENSE_TYPE",cardText:"BPA_LICENSE_TYPE_TEXT",submitBarLabel:"CS_COMMON_NEXT"},nextStep:"license-details",key:"LicneseType",withoutLabel:!0,hideInEmployee:!0},{type:"component",route:"license-details",isMandatory:!0,component:"LicenseDetails",texts:{headerCaption:"BPA_LICENSE_DET_CAPTION",header:"BPA_LICENSE_DET_CAPTION",cardText:"BPA_LICENSE_DETAILS_TEXT",submitBarLabel:"CS_COMMON_NEXT"},nextStep:"Permanent-address",key:"LicneseDetails",withoutLabel:!0,hideInEmployee:!0},{type:"component",route:"Permanent-address",isMandatory:!0,component:"PermanentAddress",texts:{headerCaption:"BPA_NEW_ADDRESS_HEADER_DETAILS",header:"BPA_LICENSEE_PERM_ADDR_HEADER",cardText:"BPA_LICENSEE_PERMANENT_TEXT",submitBarLabel:"CS_COMMON_NEXT"},nextStep:"correspondence-address",key:"LicneseDetails",withoutLabel:!0,hideInEmployee:!0},{type:"component",route:"correspondence-address",isMandatory:!0,component:"CorrospondenceAddress",texts:{headerCaption:"BPA_NEW_ADDRESS_HEADER_DETAILS",header:"BPA_LICENSEE_CORRESPONDENCE_LABEL",cardText:"BPA_LICENSEE_CORRESPONDENCE_TEXT",submitBarLabel:"CS_COMMON_NEXT"},nextStep:"stakeholder-document-details",key:"LicneseDetails",withoutLabel:!0,hideInEmployee:!0},{route:"stakeholder-document-details",component:"StakeholderDocuments",nextStep:null,key:"documents",texts:{headerCaption:"BPA_DOCUMENT_DETAILS_LABEL",header:"BPA_LICENSEE_DOCUMENT_DETAILS_HEADER",submitBarLabel:"CS_COMMON_NEXT"}}]}],rn=e=>{var i,a,r,u,d,s;const{t:c}=n.useTranslation(),v=null===(i=e.application)||void 0===i?void 0:i.businessService,{isLoading:p,data:m}=Digit.Hooks.useWorkflowDetails({tenantId:null===(a=e.application)||void 0===a?void 0:a.tenantId,id:e.id,moduleCode:v}),[E,_]=t.useState(!1);function f(e,t,l){var n;window.open(null==l||null===(n=l.fullImage)||void 0===n?void 0:n[0],"_blank")}const A=e=>{var t,n,i,o,a;const r={date:null==e||null===(t=e.auditDetails)||void 0===t?void 0:t.lastModified,name:null==e||null===(n=e.assignes)||void 0===n||null===(i=n[0])||void 0===i?void 0:i.name,mobileNumber:null==e||null===(o=e.assignes)||void 0===o||null===(a=o[0])||void 0===a?void 0:a.mobileNumber,comment:c(null==e?void 0:e.comment),wfComment:e.wfComment,thumbnailsToShow:null==e?void 0:e.thumbnailsToShow};return l.createElement($t,{data:r,OpenImage:f})};return p?l.createElement(o.Loader,null):l.createElement(l.Fragment,null,!p&&l.createElement(t.Fragment,null,(null==m||null===(r=m.timeline)||void 0===r?void 0:r.length)>0&&l.createElement(o.CardSectionHeader,{style:{marginBottom:"16px",marginTop:"32px"}},c("CS_APPLICATION_DETAILS_APPLICATION_TIMELINE")),null!=m&&m.timeline&&1===(null==m||null===(u=m.timeline)||void 0===u?void 0:u.length)?l.createElement(o.CheckPoint,{isCompleted:!0,label:c((null==m||null===(d=m.timeline[0])||void 0===d?void 0:d.state)&&`WF_${v}_${m.timeline[0].state}`||"NA"),customChild:A(null==m?void 0:m.timeline[0])}):l.createElement(o.ConnectingCheckPoints,null,(null==m?void 0:m.timeline)&&(null==m?void 0:m.timeline.slice(0,E?m.timeline.length:2).map((e,t,n)=>{let i="";var a,r,u,d;return window.location.href.includes("/obps")&&(i=null!=m&&null!==(a=m.timeline[t-1])&&void 0!==a&&null!==(r=a.state)&&void 0!==r&&r.includes("BACK_FROM")||null!=m&&null!==(u=m.timeline[t-1])&&void 0!==u&&null!==(d=u.state)&&void 0!==d&&d.includes("SEND_TO_CITIZEN")?"_NOT_DONE":"SEND_TO_ARCHITECT"===(null==e?void 0:e.performedAction)?"_BY_ARCHITECT_DONE":0==t?"":"_DONE"),l.createElement(l.Fragment,{key:t},l.createElement(o.CheckPoint,{keyValue:t,isCompleted:0===t,label:e.state?c(`WF_${v}_${e.state}${i}`):"NA",customChild:A(e)}))}))),(null==m||null===(s=m.timeline)||void 0===s?void 0:s.length)>2&&l.createElement(o.LinkButton,{label:c(E?"COLLAPSE":"VIEW_TIMELINE"),onClick:()=>{_(e=>!e)}})))},un=e=>{let{t:t,action:n,selectFile:i,uploadedFile:a,error:r,isCommentRequired:u=!0,setUploadedFile:d}=e;return{label:{heading:"BPA_FORWARD_APPLICATION_HEADER",submit:`BPA_${n}_BUTTON`,cancel:"CS_COMMON_CANCEL"},form:[{body:[{label:t("ES_OBPS_ACTION_COMMENTS"),isMandatory:u,type:"textarea",populators:{name:"comments",validation:{required:u}}},{label:""+t("WF_APPROVAL_UPLOAD_HEAD"),populators:l.createElement(o.UploadFile,{id:"workflow-doc",onUpload:i,onDelete:()=>{d(null)},message:a?"1 "+t("ES_PT_ACTION_FILEUPLOADED"):t("CS_ACTION_NO_FILEUPLOADED"),accept:"image/*, .pdf, .png, .jpeg, .jpg",iserror:r})}]}]}},dn=e=>l.createElement("h1",{style:{marginLeft:"22px"},className:"heading-m BPAheading-m"},e.label),sn=()=>l.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"#FFFFFF",xmlns:"http://www.w3.org/2000/svg"},l.createElement("path",{d:"M19 6.41L17.59 5L12 10.59L6.41 5L5 6.41L10.59 12L5 17.59L6.41 19L12 13.41L17.59 19L19 17.59L13.41 12L19 6.41Z",fill:"#0B0C0C"})),cn=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick,style:{backgroundColor:"#FFFFFF"}},l.createElement(sn,null)),vn=e=>{var n,i,a,r,u;let{t:d,closeModal:s,submitAction:c,action:v,applicationData:p}=e;const[E,_]=t.useState({}),[f,A]=t.useState(null),[g,S]=t.useState(null),[h,y]=t.useState({}),[D,T]=t.useState(null),[b,C]=t.useState(!1),P=!!Digit.Utils.browser.isMobile(),N=e=>{A(e.target.files[0])};return t.useEffect(()=>{switch(v){case"APPROVE":_(un({t:d,action:v,selectFile:N,uploadedFile:g,error:D,isCommentRequired:!1,setUploadedFile:S,file:f,error:D}));break;case"SEND_TO_ARCHITECT":_(un({t:d,action:v,selectFile:N,uploadedFile:g,error:D,setUploadedFile:S,file:f,error:D}));break;case"TERMS_AND_CONDITIONS":C(!0),_((e=>{let{t:t,applicationData:l}=e;return{label:{heading:"",submit:null,cancel:null,hideSubmit:!0},data:[((e,t)=>"CITIZEN_APPROVAL_INPROCESS"==(null==t?void 0:t.status)?`${e("BPA_CITIZEN_1_DECLARAION_LABEL")}${e("BPA_CITIZEN_2_DECLARAION_LABEL")}`:"INPROGRESS"==(null==t?void 0:t.status)?`${e("BPA_STAKEHOLDER_1_DECLARAION_LABEL")}${e("BPA_STAKEHOLDER_2_DECLARAION_LABEL")}`:void 0)(t,l)]}})({t:d,applicationData:p}));break;default:_(un({t:d,action:v,selectFile:N,uploadedFile:g,error:D,isCommentRequired:!1,setUploadedFile:S,file:f,error:D}))}},[v,g,D]),t.useEffect(()=>{!function(){try{T(null);const e=function(){if(f){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(f.size>=5242880)T(d("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=f&&f.type&&!e.test(null==f?void 0:f.type))T(d("NOT_SUPPORTED_FILE_TYPE"));else{const e=m(function(){return S(null),Promise.resolve(Digit.UploadServices.Filestorage("BPA",f,Digit.ULBService.getStateId())).then(function(e){var t,l,n,i;(null==e||null===(t=e.data)||void 0===t||null===(l=t.files)||void 0===l?void 0:l.length)>0?S(null==e||null===(n=e.data)||void 0===n||null===(i=n.files[0])||void 0===i?void 0:i.fileStoreId):T(d("CS_FILE_UPLOAD_ERROR"))})},function(){T(d("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)}}()},[f]),l.createElement(o.Modal,{headerBarMain:l.createElement(dn,{label:d(null==E||null===(n=E.label)||void 0===n?void 0:n.heading)}),headerBarEnd:l.createElement(cn,{onClick:s}),actionCancelLabel:d(null==E||null===(i=E.label)||void 0===i?void 0:i.cancel),actionCancelOnSubmit:s,actionSaveLabel:d(null==E||null===(a=E.label)||void 0===a?void 0:a.submit),actionSaveOnSubmit:()=>{},formId:"modal-action",isDisabled:!1,isOBPSFlow:!0,popupStyles:P?{width:"720px"}:{},style:P?{minHeight:"45px",height:"auto",width:"160px"}:{minHeight:"45px",height:"auto",width:"107px",paddingLeft:"0px",paddingRight:"0px"},hideSubmit:!(null==E||null===(r=E.label)||void 0===r||!r.hideSubmit),popupModuleMianStyles:"TERMS_AND_CONDITIONS"==v?{height:"92%",boxSizing:"border-box"}:P?{paddingLeft:"0px"}:{},headerBarMainStyle:"TERMS_AND_CONDITIONS"==v?{margin:"0px",height:"35px"}:{}},null!=E&&E.form?l.createElement(o.FormComposer,{cardStyle:{minWidth:"unset",paddingRight:"unset",marginRight:"18px",paddingBottom:"64px"},config:null==E?void 0:E.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:e=>{let t={action:v};g&&(t.varificationDocuments=[{documentType:"Document - 1",fileName:(null==f?void 0:f.name)||"",fileStoreId:g}]),null!=e&&e.comments||delete e.comments,c({...e,...t})},defaultValues:h,formId:"modal-action"}):null,b?l.createElement("div",{style:{height:"100%"}},l.createElement("div",{style:{height:"95%"}},l.createElement("div",{style:{fontSize:"18px",paddingBottom:"16px",color:"#000000",fontWeight:"700"}},d("TERMS_AND_CONDITIONS")),(null==E?void 0:E.data)&&(null==E||null===(u=E.data)||void 0===u?void 0:u.map((e,t)=>l.createElement("div",{style:{height:"90%",overflow:"auto"}},""+e)))),l.createElement("div",{style:{display:"flex",justifyContent:"center",minHeight:"5%"}},l.createElement(o.ButtonSelector,{label:d("BPA_GO_BACK_LABEL"),onSubmit:s,style:{minWidth:"240px"}}))):null)};function pn(e){let{value:t={},Code:i,index:a,isNOC:r=!1,svgStyles:u={width:"100px",height:"100px",viewBox:"0 0 25 25",minWidth:"100px"},isStakeHolder:d=!1}=e;const{t:s}=n.useTranslation(),{isLoading:c,data:v}=Digit.Hooks.obps.useOBPSDocumentSearch({value:t},{value:t},i,a,r);let p=[];var m,E,_;return r?null!=t&&t.nocDocuments?(null==t||null===(m=t.nocDocuments)||void 0===m?void 0:m.nocDocuments.length)>0&&(null==t||null===(E=t.nocDocuments)||void 0===E||E.nocDocuments.filter(e=>{var t;return null==e||null===(t=e.documentType)||void 0===t?void 0:t.includes(i)}).map(e=>{p.push(e)})):(null==t?void 0:t.length)>0&&(null==t||t.filter(e=>{var t;return null==e||null===(t=e.documentType)||void 0===t?void 0:t.includes(i)}).map(e=>{p.push(e)})):null!=t&&t.documents?null==t||null===(_=t.documents)||void 0===_||_.documents.filter(e=>(null==e?void 0:e.documentType)===i).map(e=>{p.push(e)}):t.filter(e=>(null==e?void 0:e.documentType)===i).map(e=>{p.push(e)}),c?l.createElement(o.Loader,null):l.createElement("div",{style:{marginTop:"19px"}},l.createElement(l.Fragment,null,l.createElement("div",{style:{display:"flex",flexWrap:"wrap"}},p.length>0?l.createElement("div",{style:{display:"flex",justifyContent:"flex-start",flexWrap:"wrap"}},null==p?void 0:p.map((e,t)=>{let n=function(e,t,l){void 0===e&&(e={}),void 0===t&&(t="");let n=e[t]||"",i=(null==n?void 0:n.split(","))||[],o="";return i.length>0&&i.map(e=>{e.includes("large")||e.includes("medium")||e.includes("small")||(o=e)}),o}(v.pdfFiles,null==e?void 0:e.fileStoreId);return l.createElement("a",{target:"_blank",href:n,style:{minWidth:"80px",marginRight:"10px",maxWidth:"100px",height:"auto"},key:t},l.createElement("div",{style:{display:"flex",justifyContent:"center"}},l.createElement(o.PDFSvg,null)),d?l.createElement("p",{style:{marginTop:"8px",textAlign:"center",color:"#505A5F"}},s("BPAREG_HEADER_"+gt(null==i?void 0:i.toUpperCase(),".","_"))):null," ",d?null:l.createElement("p",{style:{marginTop:"8px",textAlign:"center",color:"#505A5F"}},""+s(i)))})):l.createElement(o.CardText,null,s("BPA_NO_DOCUMENTS_UPLOADED_LABEL")))))}const mn=e=>{var i,a,r,u,d;let{edcrDetails:s,applicationData:c}=e;const{t:v}=n.useTranslation(),p=window.Digit.Utils.browser.isMobile(),m=[{name:"BPA_TABLE_COL_FLOOR",id:"Floor"},{name:"BPA_TABLE_COL_LEVEL",id:"Level"},{name:"BPA_TABLE_COL_OCCUPANCY",id:"Occupancy"},{name:"BPA_TABLE_COL_BUILDUPAREA",id:"BuildupArea"},{name:"BPA_TABLE_COL_FLOORAREA",id:"FloorArea"}],E=e=>{const t=e;return(e,l,n)=>e[t]},_=t.useMemo(()=>m.map(e=>({Header:v(""+e.name),accessor:E(e.id),id:e.id})));function f(e){var t;let l=[];return null==e||null===(t=e.building)||void 0===t||t.floors.map(e=>{var t,n,i,o,a,r,u,d;l.push({Floor:v("BPA_FLOOR_NAME_"+e.number),Level:e.number,Occupancy:v(""+(null===(t=e.occupancies)||void 0===t||null===(n=t[0])||void 0===n?void 0:n.type)),BuildupArea:null===(i=e.occupancies)||void 0===i||null===(o=i[0])||void 0===o?void 0:o.builtUpArea,FloorArea:(null===(a=e.occupancies)||void 0===a||null===(r=a[0])||void 0===r?void 0:r.floorArea)||0,CarpetArea:(null===(u=e.occupancies)||void 0===u||null===(d=u[0])||void 0===d?void 0:d.CarpetArea)||0,key:v("BPA_FLOOR_NAME_"+e.number)})}),l}function A(e){var t;let l=null==c||null===(t=c.landInfo)||void 0===t?void 0:t.unit,n="";if((null==l?void 0:l.length)>0){var i,o;let t=null===(i=l[e])||void 0===i||null===(o=i.usageCategory)||void 0===o?void 0:o.split(",");null!=t&&t.length&&(n=t.map(e=>e?""+v("BPA_SUBOCCUPANCYTYPE_"+function(e,t,l){if(void 0===e&&(e=""),void 0===t&&(t=""),void 0===l&&(l=""),""==t)return e;for(;e.includes(t);)e=e.replace(t,l);return e}(null==e?void 0:e.toUpperCase(),"-","_")):"NA").join(", "))}return n||"NA"}return l.createElement(t.Fragment,null,l.createElement("div",{style:{background:"#FAFAFA",border:"1px solid #D6D5D4",padding:"8px",borderRadius:"4px",maxWidth:"950px",minWidth:"280px"}},l.createElement(o.StatusTable,null,null==s||null===(i=s.values)||void 0===i?void 0:i.map((e,t)=>null!=e&&e.isHeader?l.createElement(o.CardSubHeader,{style:{fontSize:"20px",paddingBottom:"10px"}},v(null==e?void 0:e.title)):l.createElement(o.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==s||null===(a=s.subOccupancyTableDetails)||void 0===a||null===(r=a[0])||void 0===r||null===(u=r.value)||void 0===u||null===(d=u.planDetail)||void 0===d?void 0:d.blocks.map((e,t)=>{var n,i,a,r,u;return l.createElement("div",{key:t,style:(null==s||null===(n=s.subOccupancyTableDetails)||void 0===n||null===(i=n[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(o.CardSubHeader,{style:{marginBottom:"8px",paddingBottom:"9px",color:"#0B0C0C",fontSize:"18px",lineHeight:"19px"}},v("BPA_BLOCK_SUBHEADER")," ",t+1),l.createElement(o.StatusTable,null,l.createElement(o.Row,{className:"border-none",textStyle:{wordBreak:"break-word"},label:""+v("BPA_SUB_OCCUPANCY_LABEL"),text:A(t)})),l.createElement("div",{style:window.location.href.includes("citizen")||p?{overflow:"scroll"}:{maxWidth:"950px",maxHeight:"280px"}},l.createElement(o.Table,{className:"customTable table-fixed-first-column table-border-style",t:v,disableSort:!1,autoSort:!0,manualPagination:!1,isPaginationRequired:!1,initSortId:"S N ",data:f(e),columns:_,getCellProps:e=>({style:{}})})))})))};function En(e){let{fiReport:t,isCitizen:i=!1}=e;const{t:a}=n.useTranslation();return l.createElement(l.Fragment,null,l.createElement("div",{style:{marginTop:"10px"}},l.createElement(i?o.CardHeader:o.CardSectionHeader,{style:{fontSize:"24px"}},""+a("BPA_FI_REPORT")),t.map((e,n)=>{var i,r,u,d,s,c;return l.createElement("div",{style:{background:"#FAFAFA",border:"1px solid #D6D5D4",padding:"8px",borderRadius:"4px",maxWidth:"950px",minWidth:"280px",marginBottom:"24px"}},l.createElement(o.StatusTable,null,l.createElement(o.CardSectionHeader,{style:{fontSize:"20px"}},1==(null==t?void 0:t.length)?""+a("BPA_FI_REPORT"):`${a("BPA_FI_REPORT")} - ${n+1}`),l.createElement(o.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(o.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===(d=e.questions)||void 0===d?void 0:d.length)&&(null==e||null===(s=e.questions)||void 0===s?void 0:s.map(e=>l.createElement("div",{style:{background:"white",border:"1px solid #D6D5D4",padding:"8px",borderRadius:"4px",marginTop:"10px"}},l.createElement(o.Row,{className:"border-none",label:""+a(""+e.question),text:null!=e&&e.value?null==e?void 0:e.value:"NA"}),l.createElement(o.Row,{className:"border-none",label:""+a("BPA_ENTER_REMARKS"),text:e.remarks?e.remarks:"NA"})))),l.createElement(Vl,{documents:(c=null==e?void 0:e.docs,[{title:"BPA_DOCUMENT_DETAILS_LABEL",values:null==c?void 0:c.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"}})))})))}const _n=e=>{var i,a,r,u,d,s,c,v,p,E,_,f,A,g,S,h,y,D,T,b,C,P,N;let{scrutinyDetails:I,paymentsList:L=[],additionalDetails:B,applicationData:O}=e;const R=(window.location.href.includes("editApplication")||"FIELDINSPECTION_INPROGRESS"==(null==O?void 0:O.status))&&window.location.href.includes("bpa"),[w,x]=t.useState(),[M,F]=t.useState(),[k,U]=t.useState(),H=Digit.ULBService.getStateId(),[W,G]=t.useState(),[j,K]=t.useState(),[Y,$]=t.useState([]),[z,V]=t.useState(),[q,X]=t.useState(""),[J,Z]=t.useState(null),[Q,ee]=t.useState({}),te={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))"}},[le,ne]=t.useState(!1),[ie,oe]=t.useState(!1);t.useEffect(()=>{!function(){try{Z(null);const e=function(){if(z&&null!=z&&z.type){const e=function(e,t,l){if(null!==(e=".pdf".split(","))&&void 0!==e&&e.includes("."+(null==z||null===(t=z.type)||void 0===t||null===(l=t.split("/"))||void 0===l?void 0:l.pop()))){const e=function(){if(z.size>=2e6)Z(ae("PT_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=m(function(){return Promise.resolve(Digit.UploadServices.Filestorage("property-upload",z,Digit.ULBService.getStateId())).then(function(e){var t,l,n,i;(null==e||null===(t=e.data)||void 0===t||null===(l=t.files)||void 0===l?void 0:l.length)>0?$([...Y,{fileStoreId:null==e||null===(n=e.data)||void 0===n||null===(i=n.files[0])||void 0===i?void 0:i.fileStoreId,time:new Date}]):Z(ae("PT_FILE_UPLOAD_ERROR"))})},function(){});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}else Z(ae("PT_UPLOAD_FORMAT_NOT_SUPPORTED"))}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[z]),t.useEffect(()=>{sessionStorage.setItem("uploadedFileLess",JSON.stringify(Y))},[Y]),t.useEffect(()=>{var e,t,l,n,i,o,a;if(null!=B&&null!==(e=B.lessAdjustmentFeeFiles)&&void 0!==e&&e.length){const e=null==B?void 0:B.lessAdjustmentFeeFiles.map((e,t)=>{var l,n,i;return t===(null==B||null===(l=B.lessAdjustmentFeeFiles)||void 0===l?void 0:l.length)-1?null==B||null===(n=B.lessAdjustmentFeeFiles[(null==B||null===(i=B.lessAdjustmentFeeFiles)||void 0===i?void 0:i.length)-1])||void 0===n?void 0:n.fileStoreId:null});Digit.UploadServices.Filefetch(e,H).then(e=>ee(null==e?void 0:e.data))}x(null==B||null===(t=B.selfCertificationCharges)||void 0===t?void 0:t.BPA_DEVELOPMENT_CHARGES),sessionStorage.setItem("development",null==B||null===(l=B.selfCertificationCharges)||void 0===l?void 0:l.BPA_DEVELOPMENT_CHARGES),F(null==B||null===(n=B.selfCertificationCharges)||void 0===n?void 0:n.BPA_OTHER_CHARGES),sessionStorage.setItem("otherCharges",null==B||null===(i=B.selfCertificationCharges)||void 0===i?void 0:i.BPA_OTHER_CHARGES),U(null==B||null===(o=B.selfCertificationCharges)||void 0===o?void 0:o.BPA_LESS_ADJUSMENT_PLOT),sessionStorage.setItem("lessAdjusment",null==B||null===(a=B.selfCertificationCharges)||void 0===a?void 0:a.BPA_LESS_ADJUSMENT_PLOT),G(null==B?void 0:B.otherFeesDiscription),sessionStorage.setItem("otherChargesDisc",null==B?void 0:B.otherFeesDiscription),$(null==B?void 0:B.lessAdjustmentFeeFiles)},[B]);const{t:ae}=n.useTranslation(),re=e=>null!=e&&e.value&&null!=e&&e.isTransLate?l.createElement("span",{style:{color:"#00703C"}},ae(null==e?void 0:e.value)):null!=e&&e.value&&null!=e&&e.isTransLate?ae(null==e?void 0:e.value):null!=e&&e.value?null==e?void 0:e.value:void ae("NA");return l.createElement(t.Fragment,null,!(null!=I&&I.isChecklist)&&l.createElement("div",{style:{background:"#FAFAFA",border:"1px solid #D6D5D4",padding:"8px",borderRadius:"4px",maxWidth:"950px"}},l.createElement(o.StatusTable,null,l.createElement("div",null,null==I||null===(i=I.values)||void 0===i?void 0:i.map((e,t)=>null!=e&&e.isUnit?l.createElement(o.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:""+ae(""+e.title),text:null!=e&&e.value?`${re(e)} ${ae(null==e?void 0:e.isUnit)}`:ae("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(o.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:""+ae(""+e.title),text:re(e),labelStyle:null!=e&&e.isHeader?{fontSize:"20px"}:{}}):l.createElement(o.CardSubHeader,{style:{fontSize:"20px",paddingBottom:"10px",margin:"0px"}},ae(null==e?void 0:e.title)):l.createElement(o.CardSubHeader,{style:{fontSize:"20px",paddingBottom:"10px"}},ae(null==e?void 0:e.title))),null==I||null===(a=I.permit)||void 0===a?void 0:a.map((e,t)=>l.createElement(o.CardLabel,{style:{fontWeight:"400"}},null==e?void 0:e.title))),window.location.href.includes("employee")&&"BPA_APPL_FEES_DETAILS"==(null==I||null===(r=I.values[0])||void 0===r?void 0:r.title)&&l.createElement("div",null,!ie&&l.createElement("div",{style:te.buttonStyle},l.createElement("button",{type:"button",onClick:()=>{oe(!0)}},ae("SHOW_P1_FEES_DETAILS"))),ie&&l.createElement("div",{style:te.buttonStyle},l.createElement("button",{type:"button",onClick:()=>{oe(!1)}},ae("HIDE_P1_FEES_DETAILS"))),ie&&l.createElement("div",null,l.createElement(o.CardSubHeader,null,ae("BPA_P1_SUMMARY_FEE_EST")),l.createElement(o.Row,{className:"border-none",label:ae("BUILDING_APPLICATION_FEES"),text:"₹ "+Math.round(10.7639*(null==B?void 0:B.builtUpArea)*2.5)}),l.createElement(o.Row,{className:"border-none",label:ae("BOUNDARY_WALL_FEES"),text:"₹ "+2.5*(null==B?void 0:B.boundaryWallLength)}),l.createElement(o.Row,{className:"border-none"}))),window.location.href.includes("employee")&&"BPA_APPL_FEES_DETAILS"==(null==I||null===(u=I.values[0])||void 0===u?void 0:u.title)&&l.createElement("div",null,!le&&l.createElement("div",{style:te.buttonStyle},l.createElement("button",{type:"button",onClick:()=>{ne(!0)}},ae("SHOW_P2_FEES_DETAILS"))),le&&l.createElement("div",{style:te.buttonStyle},l.createElement("button",{type:"button",onClick:()=>{ne(!1)}},ae("HIDE_P2_FEES_DETAILS"))),le&&l.createElement("div",null,l.createElement(o.CardSubHeader,null,ae("BPA_P2_SUMMARY_FEE_EST")),l.createElement(o.Row,{className:"border-none",label:ae("BPA_COMMON_MALBA_AMT"),text:"₹ "+(null==B||null===(d=B.selfCertificationCharges)||void 0===d?void 0:d.BPA_MALBA_CHARGES)}),l.createElement(o.Row,{className:"border-none",label:ae("BPA_COMMON_LABOUR_AMT"),text:"₹ "+(null==B||null===(s=B.selfCertificationCharges)||void 0===s?void 0:s.BPA_LABOUR_CESS)}),l.createElement(o.Row,{className:"border-none",label:ae("BPA_COMMON_WATER_AMT"),text:"₹ "+(null==B||null===(c=B.selfCertificationCharges)||void 0===c?void 0:c.BPA_WATER_CHARGES)}),l.createElement(o.Row,{className:"border-none",label:ae("BPA_COMMON_GAUSHALA_AMT"),text:"₹ "+(null==B||null===(v=B.selfCertificationCharges)||void 0===v?void 0:v.BPA_GAUSHALA_CHARGES_CESS)}),l.createElement(o.CardSubHeader,null,ae("BPA_P2_SUMMARY_FEE_EST_MANUAL")),l.createElement(o.CardLabel,null,ae("BPA_COMMON_DEVELOPMENT_AMT")),l.createElement(o.TextInput,{t:ae,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"development",defaultValue:(null==B||null===(p=B.selfCertificationCharges)||void 0===p?void 0:p.BPA_DEVELOPMENT_CHARGES)||0,value:w,disabled:!R,onChange:e=>{!function(e){/^\d{0,9}$/.test(e)&&(x(e),sessionStorage.setItem("development",e))}(e.target.value)},required:!0,pattern:"^[0-9]*$",type:"text"}),l.createElement(o.CardLabel,null,ae("BPA_COMMON_OTHER_AMT")),l.createElement(o.TextInput,{t:ae,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"otherCharges",defaultValue:(null==B||null===(E=B.selfCertificationCharges)||void 0===E?void 0:E.BPA_OTHER_CHARGES)||0,value:M,disabled:!R,onChange:e=>{!function(e){/^[0-9]*$/.test(e)&&(F(e),sessionStorage.setItem("otherCharges",e))}(e.target.value)},required:!0,pattern:"^[0-9]*$",type:"text"}),parseInt(M)>0?l.createElement("div",null,l.createElement(o.CardLabel,null,ae("BPA_COMMON_OTHER_AMT_DISCRIPTION")),l.createElement(o.TextArea,{t:ae,type:"text",name:"otherChargesDiscription",defaultValue:null==B||null===(_=B.selfCertificationCharges)||void 0===_?void 0:_.BPA_COMMON_OTHER_AMT_DISCRIPTION,value:W,disabled:!R,onChange:e=>{!function(e){G(e),sessionStorage.setItem("otherChargesDisc",e)}(e.target.value)},required:!0})):null,l.createElement(o.CardLabel,null,ae("BPA_COMMON_LESS_AMT")),l.createElement(o.TextInput,{t:ae,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"lessAdjusment",defaultValue:(null==B||null===(f=B.selfCertificationCharges)||void 0===f?void 0:f.BPA_LESS_ADJUSMENT_PLOT)||"",value:k,disabled:!R,onChange:e=>{!function(e){var t,l,n,i;/^[0-9]*$/.test(e)&&(parseFloat(e)>(parseFloat(w)?parseFloat(w):0)+parseFloat(M?parseFloat(M):0)+parseFloat(null==B||null===(t=B.selfCertificationCharges)||void 0===t?void 0:t.BPA_MALBA_CHARGES)+parseFloat(null==B||null===(l=B.selfCertificationCharges)||void 0===l?void 0:l.BPA_LABOUR_CESS)+parseFloat(null==B||null===(n=B.selfCertificationCharges)||void 0===n?void 0:n.BPA_WATER_CHARGES)+parseFloat(null==B||null===(i=B.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(k)>0&&R?l.createElement("div",null,l.createElement(o.CardLabel,null,ae("BPA_COMMON_LESS_AMT_FILE")),l.createElement(o.UploadFile,{id:"noc-doc",style:{marginBottom:"200px"},onUpload:function(e){K(e.target.files[0]),V(e.target.files[0])},disabled:!R,onDelete:()=>{K(null),V("")},message:j?"1 "+ae("FILEUPLOADED"):ae("ES_NO_FILE_SELECTED_LABEL"),error:J,uploadMessage:q})):null,(null==Q||null===(A=Q.fileStoreIds)||void 0===A?void 0:A.length)&&parseInt(null==B||null===(g=B.selfCertificationCharges)||void 0===g?void 0:g.BPA_LESS_ADJUSMENT_PLOT)>0&&l.createElement(o.CardLabel,{style:{marginTop:"15px"}},ae("BPA_COMMON_LESS_AMT_PREVIOUS_FILE")),(null==Q||null===(S=Q.fileStoreIds)||void 0===S?void 0:S.length)&&parseInt(null==B||null===(h=B.selfCertificationCharges)||void 0===h?void 0:h.BPA_LESS_ADJUSMENT_PLOT)>0&&l.createElement("a",{target:"_blank",href:null==Q||null===(y=Q.fileStoreIds[(null==Q||null===(D=Q.fileStoreIds)||void 0===D?void 0:D.length)-1])||void 0===y?void 0:y.url},l.createElement(o.PDFSvg,null)),l.createElement(o.Row,{className:"border-none"}),l.createElement(o.Row,{className:"border-none",label:ae("BPA_P2_TOTAL_FEE"),text:"₹ "+((parseFloat(w)?parseFloat(w):0)+parseFloat(M?parseFloat(M):0)+parseFloat(null==B||null===(T=B.selfCertificationCharges)||void 0===T?void 0:T.BPA_MALBA_CHARGES)+parseFloat(null==B||null===(b=B.selfCertificationCharges)||void 0===b?void 0:b.BPA_LABOUR_CESS)+parseFloat(null==B||null===(C=B.selfCertificationCharges)||void 0===C?void 0:C.BPA_WATER_CHARGES)+parseFloat(null==B||null===(P=B.selfCertificationCharges)||void 0===P?void 0:P.BPA_GAUSHALA_CHARGES_CESS)-(parseFloat(k)?parseFloat(k):0))}))),l.createElement("div",null,null==I||null===(N=I.scruntinyDetails)||void 0===N?void 0:N.map((e,n)=>l.createElement(t.Fragment,null,l.createElement(o.Row,{className:"border-none",label:""+ae(null==e?void 0:e.title),labelStyle:{width:"150%"}}),l.createElement("a",{href:null==e?void 0:e.value}," ",l.createElement(o.PDFSvg,null)," "),l.createElement("p",{style:{margin:"8px 0px",fontWeight:"bold",fontSize:"16px",lineHeight:"19px",color:"#505A5F"}},ae(null==e?void 0:e.text))))))))},fn=e=>{var a,r,u,s,c,v,p,_,f,A,g,S,h,y,D,T,b,C,P,N,I,L,B,O;let{showTermsPopupOwner:R,setShowTermsPopupOwner:w,otpVerifiedTimestamp:x}=e;const[M,F]=t.useState(!1),{t:k}=n.useTranslation(),U=Digit.UserService.getUser(),H=null==U||null===(a=U.info)||void 0===a?void 0:a.name,W=null==U?void 0:U.info.mobileNumber,G=null==U||null===(r=U.info)||void 0===r?void 0:r.emailId,{id:j}=i.useParams(),K=Digit.ULBService.getCurrentTenantId(),{data:Y}=Digit.Hooks.obps.useBPADetailsPage(K,{applicationNo:j});let $=Digit.Hooks.useWorkflowDetails({tenantId:null==Y||null===(u=Y.applicationData)||void 0===u?void 0:u.tenantId,id:j,moduleCode:"OBPS",config:{enabled:!!Y}});const[z,V]=t.useState(!1),[q,X]=t.useState(!1),J=null==$||null===(s=$.data)||void 0===s||null===(c=s.timeline)||void 0===c||null===(v=c[0])||void 0===v||null===(p=v.assigner)||void 0===p?void 0:p.name,Z=null==Y||null===(_=Y.applicationData)||void 0===_||null===(f=_.additionalDetails)||void 0===f?void 0:f.khasraNumber,Q=null==Y||null===(A=Y.applicationData)||void 0===A||null===(g=A.additionalDetails)||void 0===g?void 0:g.UlbName,ee=null==Y||null===(S=Y.applicationData)||void 0===S||null===(h=S.additionalDetails)||void 0===h?void 0:h.District,te=null==Y||null===(y=Y.applicationData)||void 0===y||null===(D=y.additionalDetails)||void 0===D?void 0:D.wardnumber,le=null==Y||null===(T=Y.applicationData)||void 0===T||null===(b=T.additionalDetails)||void 0===b?void 0:b.area,ne=null==Y||null===(C=Y.applicationData)||void 0===C||null===(P=C.additionalDetails)||void 0===P?void 0:P.architectid,ie=null==Y||null===(N=Y.applicationData)||void 0===N||null===(I=N.additionalDetails)||void 0===I?void 0:I.typeOfArchitect,oe=x,ae="Municipal Corporation"===(null==Y||null===(L=Y.applicationData)||void 0===L||null===(B=L.additionalDetails)||void 0===B?void 0:B.Ulblisttype)?"Commissioner":"Executive Officer",re={...null==Y||null===(O=Y.applicationData)||void 0===O?void 0:O.additionalDetails,TimeStamp:x},ue={...Y,applicationData:{...null==Y?void 0:Y.applicationData,additionalDetails:re}},de=`\n To,\n <b>${ae}</b>\n <b>${Q}</b> \n \n Dear Sir or Madam,\n\n I/We, Shri/Smt/Kum. <b>${H}</b> under signed owner of land bearing Kh. No. <b>${Z}</b> of ULB \n <b>${Q}</b> Area <b>${le}</b> (Sq.mts.), ward number <b>${te}</b>, City <b>${ee}</b>\n \n I/We hereby declare that the Architect name <b>${J}</b> (<b>${ie}</b>) Architect ID \n <b>${ne}</b> is appointed by me/us and is authorized to make representation/application \n with regard to aforesaid construction to any of the authorities.\n\n I/We further declare that I am/We are aware of all the action taken or representation made \n by the <b>${ie}</b> authorized by me/us.\n\n i) That I am/We are sole owner of the site.\n\n ii) There is no dispute regarding the site and if any dispute arises then I shall be solely resp\n -onsible for the same.\n\n iii) That construction of the building will be undertaken as per the approved building plans \n and strutural design given by the Structural Engineer.\n\n That above stated facts are true and the requisite documents have been uploaded with this E-\n Naksha plan.\n\n\n This Document is Verified By OTP at <b>${oe}\n\n\n Name of Owner - <b>${H}</b>\n Mobile Number - <b>${W}</b>\n Email Id - <b>${G}</b>\n \n `,se=e=>[`Name of Owner - <b>${H}</b>`,`Mobile Number - <b>${W}</b>`,`Email Id - <b>${G}</b>`].includes(e.trim()),ce=()=>{w(!1)},ve={modal:{width:"100%",height:"100%",top:"0",position:"relative",backgroundColor:"rgba(0, 0, 0, 0.7)",display:"flex",justifyContent:"center",alignItems:"center"},modalOverlay:{position:"fixed",top:"0",left:"0",width:"100%",height:"100%",backgroundColor:"rgba(0, 0, 0, 0.7)"},modalContent:{backgroundColor:"#FFFFFF",padding:"2rem",borderRadius:"0.5rem",maxWidth:"800px",margin:"auto",fontFamily:"Roboto, serif",overflowX:"hidden",textAlign:"justify",boxShadow:"0 4px 8px rgba(0, 0, 0, 0.2)",maxHeight:"80vh",overflowY:"auto",lineHeight:"2"},heading:{textAlign:"center",fontWeight:"bold",marginBottom:"10px"},subheading:{textAlign:"center",fontWeight:"bold",marginBottom:"20px"},rightAlignedText:{textAlign:"right",whiteSpace:"pre-wrap",wordWrap:"break-word",fontFamily:"Roboto, serif",lineHeight:"2"}};return l.createElement("div",null,l.createElement(d,{isOpen:R,onRequestClose:ce,contentLabel:"Self-Declaration",style:{modal:ve.modal,overlay:ve.modalOverlay,content:ve.modalContent}},l.createElement("div",null,l.createElement("h2",{style:ve.heading},"DECLARATION UNDER SELF-CERTIFICATION SCHEME"),l.createElement("h3",{style:ve.subheading},"(By OWNER)"),l.createElement("div",{style:{whiteSpace:"pre-wrap",wordWrap:"break-word",textAlign:"justify",fontFamily:"Roboto, serif"}},de.split("\n").map((e,t)=>l.createElement(l.Fragment,{key:t},l.createElement("div",{style:se(e)?ve.rightAlignedText:{},dangerouslySetInnerHTML:{__html:e}}),((e,t)=>{const l="This Document is Verified By OTP at "+oe;return"That above stated facts are true and the requisite documents have been uploaded with this E-Naksha plan."===e.trim()&&""===(null==t?void 0:t.trim())||e.trim()===l})(e,de.split("\n")[t+1])&&l.createElement("div",{style:{marginBottom:"2rem"}})))),l.createElement("div",{style:{display:"flex",justifyContent:"flex-end"}},l.createElement(o.SubmitBar,{label:k("BPA_CLOSE"),onSubmit:ce})),l.createElement("br",null),l.createElement("div",{style:{display:"flex",justifyContent:"flex-end"}},l.createElement("br",null),l.createElement(o.SubmitBar,{label:k("BPA_UPLOAD"),onSubmit:function(){try{const e=E(function(){return m(function(){return V(!0),Promise.resolve(Digit.PaymentService.generatePdf(Digit.ULBService.getStateId(),{Bpa:[ue]},"ownerconsent")).then(function(e){var t;(null==e||null===(t=e.filestoreIds[0])||void 0===t?void 0:t.length)>0?(alert("File Uploaded Successfully"),sessionStorage.setItem("CitizenConsentdocFilestoreid",null==e?void 0:e.filestoreIds[0]),X(!0)):alert("File Upload Failed")})},function(e){alert("Error Uploading PDF:",e)})},function(e,t){if(V(!1),e)throw t;return t});return Promise.resolve(e&&e.then?e.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},disabled:z||q})))))},An=(e,t)=>(t&&Object.keys(t).map(l=>{e=e.replace(":"+l,t[l])}),e),gn=(e,t)=>(t&&Object.keys(t).map(l=>{e=e.replace(":"+l,t[l])}),e),Sn=e=>{let{controlFilterForm:i}=e;const{t:r}=n.useTranslation(),u=Digit.ULBService.getCurrentTenantId(),{data:d,isLoading:s}=Digit.Hooks.obps.SearchMdmsTypes.useApplicationTypes(u),c=[{code:"Accepted",name:""+r("EDCR_ACCEPTED")},{code:"Not Accepted",name:""+r("EDCR_NOT_ACCEPTED")}];return l.createElement(t.Fragment,null,l.createElement(o.FilterFormField,null,l.createElement(a.Controller,{name:"status",control:i,render:e=>l.createElement(t.Fragment,null,l.createElement("div",{className:"filter-label sub-filter-label",style:{fontWeight:"400",fontSize:"16px"}},r("BPA_COMMON_TABLE_COL_APP_STATUS_LABEL")),l.createElement(o.RadioButtons,{onSelect:t=>{e.onChange(t.code),Digit.SessionStorage.set("EDCR_BACK","")},selectedOption:c.filter(t=>t.code===e.value)[0],optionsKey:"name",name:"status",options:c}))})),l.createElement(o.FilterFormField,null,l.createElement(a.Controller,{name:"appliactionType",control:i,render:e=>s?l.createElement(o.Loader,null):l.createElement(t.Fragment,null,l.createElement("div",{className:"filter-label sub-filter-label",style:{fontWeight:"400",fontSize:"16px"}},r("BPA_BASIC_DETAILS_SERVICE_TYPE_LABEL")),l.createElement(o.Dropdown,{t:r,option:d,selected:d.filter(t=>t.code===e.value)[0],optionKey:"i18nKey",select:t=>{e.onChange(t.code),Digit.SessionStorage.set("EDCR_BACK","")}}))})))},hn=e=>{let{registerRef:i,searchFieldComponents:a}=e;const{t:r}=n.useTranslation();return window.Digit.Utils.browser.isMobile()?l.createElement(t.Fragment,null,l.createElement(o.SearchField,null,l.createElement("label",null,r("BPA_APPLICATION_NUMBER_LABEL")),l.createElement(o.TextInput,{name:"applicationNumber",inputRef:i({})})),l.createElement(o.SearchField,null,l.createElement("label",null,r("BPA_EDCR_NO_LABEL")),l.createElement(o.TextInput,{name:"edcrNumber",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(o.SearchField,null,l.createElement("label",null,r("BPA_APPLICATION_NUMBER_LABEL")),l.createElement(o.TextInput,{name:"applicationNumber",inputRef:i({})})),l.createElement(o.SearchField,null,l.createElement("label",null,r("BPA_EDCR_NO_LABEL")),l.createElement(o.TextInput,{name:"edcrNumber",inputRef:i({})})),l.createElement("div",{className:"search-action-wrapper",style:{width:"100%"}},a)))))},yn=e=>{let{dowloadOptions:n}=e;const[i,a]=t.useState(!1);return l.createElement("div",null,l.createElement(o.MultiLink,{className:"multilinkWrapper",onHeadClick:()=>a(!i),displayOptions:i,options:n,style:{right:"0",position:"unset",top:"0px",margin:"0px"},optionsStyle:{right:"10px",top:"unset",margin:"0px",position:"absolute"}}))},Dn={ARCHITECT:"The registered architect shall be competent to carry out the work related to the building/development permit as given below:\na. Prepare and sign all plans, sub-division/layout plans and information connected with building permit.\nb. Layout Plans of plots measuring upto 1 Ha. in size.\nc. Issuing certificate of supervision and completion of all buildings.\nd. Issuing certificate of supervision for development permit of Layout Plans of plots measuring upto 1 Ha. in size.",ENGINEER:"The registered engineer shall be competent to carry out the work related to the building/development permit as given below:\na. Prepare and sign building plans of plots up to 500 sq.m.(for all types of Buildings), structural drawings and service plans and information connected with building permit;\nb. Preparation of structural drawings, details and calculations of buildings on plot up to 500 m2 and up to 5 storeys or 16 m in height, all service plans and related information.\nc. Issuing certificate of supervision and completion of plots upto 500 sq.m.(for all types of Buildings) pertaining including structure and building services.",STRUCTURALENGINEER:"The registered structural engineer shall be competent to prepare the structural design, calculations and details for all buildings and undertake their supervision.\nIn case of buildings having special structural features, as decided by the Authority, they shall be designed only by Structural engineers.",TOWNPLANNER:"The registered town planner shall be competent to carry out the work related to the development permit as given below:\na. Preparation of plans for land sub-division/ layout and related information connected development permit for all areas more than 1 Hectare.\nb. Issuing of certificate of supervision for development of land of all areas.\nc. Prepare and sign building plans of plots up to 500 sq.m.(for all types of Buildings), structural drawings and service plans and information connected with building permit;\nIssuing certificate of supervision and completion of plots upto 500 sq.m.(for all types of Buildings).\nNOTE — However, for land layouts for development permit above 5 hectare in area, landscape architect shall also be associated, and for land development infrastructural services for roads, water supplies, sewerage / drainage, electrification, etc, the registered engineers for utility services shall be associated.","LANDSCAPE ARCHITECT":"The registered landscape architect shall be competent to carry out the work related to landscape design for building/development permit for land areas 5 hectares and above. In case of metro-cities, this limit of land area shall be 2 hectares and above.\nNOTE — For smaller areas below the limits indicated above, association of landscape architect may also be considered from the point of view of desired landscape development.","URBAN DESIGNER":"The registered urban designer shall be competent to carry out the work related to urban design for city areas more than 5 hectares and campus area more than 2 hectares. He/She shall also be competent to carry out the work of urban renewal for all blighted/congested areas.\nNOTE — For smaller areas below the limits indicated above, association of urban designer may be considered from the point of view of desired urban design.",SUPERVISOR:"The Registered Building Designer and Supervisor shall be competent to carry out the work related to the building / development permit.\na. Prepare and (sign in case of plots upto 250 Sq.Mtr. Only) plans, sub division/layout plans and information connected with building permit.\nb. Issuing certificate of supervision and completion of (In case of plots upto 250 Sq.mtr. only) buildings."};function Tn(e){var n,i,a;let{t:r,document:u,setDocuments:d,error:s,setError:c,documents:v,setCheckRequiredFields:p}=e;const E=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],_=Digit.ULBService.getCurrentTenantId(),[f,A]=t.useState(E?{...E,active:!0,code:null==E?void 0:E.documentType,i18nKey:null==E?void 0:E.documentType}:1===(null==u||null===(n=u.dropdownData)||void 0===n?void 0:n.length)?null==u?void 0:u.dropdownData[0]:{}),[g,S]=t.useState(null),[h,y]=t.useState(()=>(null==E?void 0:E.fileStoreId)||null);function D(e){S(e.target.files[0])}return t.useEffect(()=>{d(e=>{const t=null==e?void 0:e.filter(e=>(null==e?void 0:e.documentType)!==(null==u?void 0:u.code));return 0===(null==h?void 0:h.length)||null===h?t:[...null==t?void 0:t.filter(e=>(null==e?void 0:e.fileStoreId)!==h),{documentType:null==u?void 0:u.code,fileStoreId:h,documentUid:h,fileName:(null==g?void 0:g.name)||"",info:(null==u?void 0:u.info)||""}]})},[h,g]),t.useEffect(()=>{!function(){try{c(null);const e=function(){if(g){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(g.size>=5242880)c(r("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=g&&g.type&&!e.test(null==g?void 0:g.type))c(r("NOT_SUPPORTED_FILE_TYPE"));else{const e=m(function(){return y(null),Promise.resolve(Digit.UploadServices.Filestorage("PT",g,null==_?void 0:_.split(".")[0])).then(function(e){var t,l,n,i;(null==e||null===(t=e.data)||void 0===t||null===(l=t.files)||void 0===l?void 0:l.length)>0?y(null==e||null===(n=e.data)||void 0===n||null===(i=n.files[0])||void 0===i?void 0:i.fileStoreId):c(r("CS_FILE_UPLOAD_ERROR"))})},function(){c(r("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)}}()},[g]),l.createElement("div",{style:{marginBottom:"24px"}},l.createElement(o.CardLabel,{style:{marginBottom:"10px"}},null!=u&&u.required?r("BPAREG_HEADER_"+(null==u||null===(i=u.code)||void 0===i?void 0:i.replace(".","_")))+" *":""+r("BPAREG_HEADER_"+(null==u||null===(a=u.code)||void 0===a?void 0:a.replace(".","_")))),null!=u&&u.info?l.createElement("div",{style:{fontSize:"12px",color:"#505A5F",fontWeight:400,lineHeight:"15px",marginBottom:"10px"}},""+r(null==u?void 0:u.info)):null,l.createElement(o.UploadFile,"APPL.BPAREG_PASS_PORT_SIZE_PHOTO"===(null==u?void 0:u.code)?{extraStyleName:"OBPS",accept:".png, .jpeg, .jpg",onUpload:D,onDelete:()=>{y(null),p(!0)},message:h?"1 "+r("CS_ACTION_FILEUPLOADED"):r("CS_ACTION_NO_FILEUPLOADED"),iserror:s}:{extraStyleName:"OBPS",accept:"image/*, .pdf, .png, .jpeg, .jpg",onUpload:D,onDelete:()=>{y(null),p(!0)},message:h?"1 "+r("CS_ACTION_FILEUPLOADED"):r("CS_ACTION_NO_FILEUPLOADED"),iserror:s}))}const bn=e=>{var t,a,r,u,d,s;const{state:c}=e.location,{t:v}=n.useTranslation(),p=i.useHistory(),m=null==c||null===(t=c.data)||void 0===t||null===(a=t.Licenses)||void 0===a?void 0:a[0];return null==m||null===(r=m.tradeLicenseDetail)||void 0===r||null===(u=r.tradeUnits)||void 0===u||null===(d=u[0])||void 0===d||null===(s=d.tradeType)||void 0===s||s.split("."),l.createElement("div",null,l.createElement(o.Card,null,l.createElement(o.Banner,{message:v(`BPA_ARCHITECT_${null==m?void 0:m.status}_MAIN_HEAD`),applicationNumber:null==m?void 0:m.applicationNumber,info:v("BPA_NEW_STAKEHOLDER_REGISTRATION_APP_LABEL"),successful:"REJECTED"!=(null==m?void 0:m.status),style:{padding:"10px"},headerStyles:{fontSize:"32px",wordBreak:"break-word"}}),l.createElement(o.CardText,{style:{paddingBottom:"10px",marginBottom:"10px"}},v(`BPA_ARCHITECT_${null==m?void 0:m.status}_SUB_MAIN_HEAD`)),l.createElement(o.ActionBar,{style:{display:"flex",justifyContent:"flex-end",alignItems:"baseline"}},l.createElement(o.SubmitBar,{label:v("CORE_COMMON_GO_TO_HOME"),onSubmit:()=>{p.push("/digit-ui/employee")}}))))},Cn=e=>{let{location:t}=e;const{t:i}=n.useTranslation(),a=[{path:"/digit-ui/employee",content:i("ES_COMMON_HOME"),show:!0},{path:"/digit-ui/employee/obps/inbox",content:i("ES_COMMON_OBPS_INBOX_LABEL"),show:!!t.pathname.includes("obps/inbox")},{path:"/digit-ui/employee/obps/stakeholder-inbox",content:i("ES_COMMON_STAKEHOLDER_INBOX_LABEL"),show:!!t.pathname.includes("obps/stakeholder-inbox")},{path:"/digit-ui/employee/obps/inbox/bpa/:id",content:i("ES_OBPS_SEARCH_BPA"),show:!!t.pathname.includes("obps/inbox/bpa")},{path:"/digit-ui/employee/obps/inbox/stakeholder/:id",content:i("ES_OBPS_SEARCH_BPA"),show:!!t.pathname.includes("obps/stakeholder-inbox/stakeholder")},{path:"/digit-ui/employee/obps/search/application",content:i("ES_OBPS_SEARCH"),show:!!t.pathname.includes("/obps/search/application")},{path:"/digit-ui/employee/obps/search/application/bpa/:id",content:i("ES_OBPS_SEARCH_BPA"),show:!!t.pathname.includes("/obps/search/application/bpa")},{path:"/digit-ui/employee/obps/search/application/stakeholder/:id",content:i("ES_OBPS_SEARCH_BPA"),show:!!t.pathname.includes("/obps/search/application/stakeholder/")}];return l.createElement(o.BreadCrumb,{crumbs:a})},Pn=e=>{let{path:a}=e;const r=i.useLocation(),{t:u}=n.useTranslation(),d=Digit.ComponentRegistryService.getComponent("BPAInbox"),c=Digit.ComponentRegistryService.getComponent("StakeholderInbox"),v=Digit.ComponentRegistryService.getComponent("ObpsEmpApplicationDetail"),p=Digit.ComponentRegistryService.getComponent("ObpsEmployeeBpaApplicationDetail"),m=window.location.href.includes("bpa")||window.location.href.includes("stakeholder-inbox/stakeholder")||window.location.href.includes("application"),E=window.location.href.includes("digit-ui/employee/obps/bpa/"),_=window.location.href.includes("obps/response")||window.location.href.includes("obps/stakeholder-response");return l.createElement(t.Fragment,null,E||_?null:l.createElement("div",{style:m?{marginLeft:"10px"}:{}},l.createElement(Cn,{location:r})),E?l.createElement(o.BackButton,{style:{border:"none",margin:"0",padding:"0"}},u("CS_COMMON_BACK")):null,l.createElement(i.Switch,null,l.createElement(o.PrivateRoute,{path:a+"/stakeholder-inbox/stakeholder/:id",component:v}),l.createElement(o.PrivateRoute,{path:a+"/search/application/stakeholder/:id",component:v}),l.createElement(o.PrivateRoute,{path:a+"/search/application/editApplication/bpa/:id",component:p}),l.createElement(o.PrivateRoute,{path:a+"/search/application/bpa/:id",component:p}),l.createElement(o.PrivateRoute,{path:a+"/search/application",component:e=>l.createElement(jt,s({},e,{parentRoute:a}))}),l.createElement(o.PrivateRoute,{path:a+"/inbox/editApplication/bpa/:id",component:p}),l.createElement(o.PrivateRoute,{path:a+"/inbox/bpa/:id",component:p}),l.createElement(o.PrivateRoute,{path:a+"/inbox",component:e=>l.createElement(d,s({},e,{parentRoute:a}))}),l.createElement(o.PrivateRoute,{path:a+"/stakeholder-inbox",component:e=>l.createElement(c,s({},e,{parentRoute:a}))}),l.createElement(o.PrivateRoute,{path:a+"/bpa/:id",component:p}),l.createElement(o.PrivateRoute,{path:a+"/response",component:qt}),l.createElement(o.PrivateRoute,{path:a+"/stakeholder-response",component:bn})))};var Nn=D(function(e,t){(function(){var l="Expected a function",n="__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]",d="[object Error]",s="[object Function]",c="[object GeneratorFunction]",v="[object Map]",p="[object Number]",m="[object Object]",E="[object RegExp]",_="[object Set]",f="[object String]",A="[object Symbol]",g="[object WeakMap]",S="[object ArrayBuffer]",h="[object DataView]",D="[object Float32Array]",T="[object Float64Array]",b="[object Int8Array]",C="[object Int16Array]",P="[object Int32Array]",N="[object Uint8Array]",I="[object Uint16Array]",L="[object Uint32Array]",B=/\b__p \+= '';/g,O=/\b(__p \+=) '' \+/g,R=/(__e\(.*?\)|\b__t\)) \+\n'';/g,w=/&(?:amp|lt|gt|quot|#39);/g,x=/[&<>"']/g,M=RegExp(w.source),F=RegExp(x.source),k=/<%-([\s\S]+?)%>/g,U=/<%([\s\S]+?)%>/g,H=/<%=([\s\S]+?)%>/g,W=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,G=/^\w*$/,j=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,K=/[\\^$.*+?()[\]{}|]/g,Y=RegExp(K.source),$=/^\s+/,z=/\s/,V=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,q=/\{\n\/\* \[wrapped with (.+)\] \*/,X=/,? & /,J=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Z=/[()=,{}\[\]\/\s]/,Q=/\\(\\)?/g,ee=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,te=/\w*$/,le=/^[-+]0x[0-9a-f]+$/i,ne=/^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=/($^)/,de=/['\n\r\u2028\u2029\\]/g,se="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",ce="\\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="["+ce+"]",pe="["+se+"]",me="\\d+",Ee="[a-z\\xdf-\\xf6\\xf8-\\xff]",_e="[^\\ud800-\\udfff"+ce+me+"\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",fe="\\ud83c[\\udffb-\\udfff]",Ae="[^\\ud800-\\udfff]",ge="(?:\\ud83c[\\udde6-\\uddff]){2}",Se="[\\ud800-\\udbff][\\udc00-\\udfff]",he="[A-Z\\xc0-\\xd6\\xd8-\\xde]",ye="(?:"+Ee+"|"+_e+")",De="(?:"+he+"|"+_e+")",Te="(?:"+pe+"|"+fe+")?",be="[\\ufe0e\\ufe0f]?"+Te+"(?:\\u200d(?:"+[Ae,ge,Se].join("|")+")[\\ufe0e\\ufe0f]?"+Te+")*",Ce="(?:"+["[\\u2700-\\u27bf]",ge,Se].join("|")+")"+be,Pe="(?:"+[Ae+pe+"?",pe,ge,Se,"[\\ud800-\\udfff]"].join("|")+")",Ne=RegExp("['’]","g"),Ie=RegExp(pe,"g"),Le=RegExp(fe+"(?="+fe+")|"+Pe+be,"g"),Be=RegExp([he+"?"+Ee+"+(?:['’](?:d|ll|m|re|s|t|ve))?(?="+[ve,he,"$"].join("|")+")",De+"+(?:['’](?:D|LL|M|RE|S|T|VE))?(?="+[ve,he+ye,"$"].join("|")+")",he+"?"+ye+"+(?:['’](?:d|ll|m|re|s|t|ve))?",he+"+(?:['’](?:D|LL|M|RE|S|T|VE))?","\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",me,Ce].join("|"),"g"),Oe=RegExp("[\\u200d\\ud800-\\udfff"+se+"\\ufe0e\\ufe0f]"),Re=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,we=["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"],xe=-1,Me={};Me[D]=Me[T]=Me[b]=Me[C]=Me[P]=Me[N]=Me["[object Uint8ClampedArray]"]=Me[I]=Me[L]=!0,Me[o]=Me[a]=Me[S]=Me[r]=Me[h]=Me[u]=Me[d]=Me[s]=Me[v]=Me[p]=Me[m]=Me[E]=Me[_]=Me[f]=Me[g]=!1;var Fe={};Fe[o]=Fe[a]=Fe[S]=Fe[h]=Fe[r]=Fe[u]=Fe[D]=Fe[T]=Fe[b]=Fe[C]=Fe[P]=Fe[v]=Fe[p]=Fe[m]=Fe[E]=Fe[_]=Fe[f]=Fe[A]=Fe[N]=Fe["[object Uint8ClampedArray]"]=Fe[I]=Fe[L]=!0,Fe[d]=Fe[s]=Fe[g]=!1;var ke={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Ue=parseFloat,He=parseInt,We="object"==typeof y&&y&&y.Object===Object&&y,Ge="object"==typeof self&&self&&self.Object===Object&&self,je=We||Ge||Function("return this")(),Ke=t&&!t.nodeType&&t,Ye=Ke&&e&&!e.nodeType&&e,$e=Ye&&Ye.exports===Ke,ze=$e&&We.process,Ve=function(){try{return Ye&&Ye.require&&Ye.require("util").types||ze&&ze.binding&&ze.binding("util")}catch(e){}}(),qe=Ve&&Ve.isArrayBuffer,Xe=Ve&&Ve.isDate,Je=Ve&&Ve.isMap,Ze=Ve&&Ve.isRegExp,Qe=Ve&&Ve.isSet,et=Ve&&Ve.isTypedArray;function tt(e,t,l){switch(l.length){case 0:return e.call(t);case 1:return e.call(t,l[0]);case 2:return e.call(t,l[0],l[1]);case 3:return e.call(t,l[0],l[1],l[2])}return e.apply(t,l)}function lt(e,t,l,n){for(var i=-1,o=null==e?0:e.length;++i<o;){var a=e[i];t(n,a,l(a),e)}return n}function nt(e,t){for(var l=-1,n=null==e?0:e.length;++l<n&&!1!==t(e[l],l,e););return e}function it(e,t){for(var l=null==e?0:e.length;l--&&!1!==t(e[l],l,e););return e}function ot(e,t){for(var l=-1,n=null==e?0:e.length;++l<n;)if(!t(e[l],l,e))return!1;return!0}function at(e,t){for(var l=-1,n=null==e?0:e.length,i=0,o=[];++l<n;){var a=e[l];t(a,l,e)&&(o[i++]=a)}return o}function rt(e,t){return!(null==e||!e.length)&&ft(e,t,0)>-1}function ut(e,t,l){for(var n=-1,i=null==e?0:e.length;++n<i;)if(l(t,e[n]))return!0;return!1}function dt(e,t){for(var l=-1,n=null==e?0:e.length,i=Array(n);++l<n;)i[l]=t(e[l],l,e);return i}function st(e,t){for(var l=-1,n=t.length,i=e.length;++l<n;)e[i+l]=t[l];return e}function ct(e,t,l,n){var i=-1,o=null==e?0:e.length;for(n&&o&&(l=e[++i]);++i<o;)l=t(l,e[i],i,e);return l}function vt(e,t,l,n){var i=null==e?0:e.length;for(n&&i&&(l=e[--i]);i--;)l=t(l,e[i],i,e);return l}function pt(e,t){for(var l=-1,n=null==e?0:e.length;++l<n;)if(t(e[l],l,e))return!0;return!1}var mt=ht("length");function Et(e,t,l){var n;return l(e,function(e,l,i){if(t(e,l,i))return n=l,!1}),n}function _t(e,t,l,n){for(var i=e.length,o=l+(n?1:-1);n?o--:++o<i;)if(t(e[o],o,e))return o;return-1}function ft(e,t,l){return t==t?function(e,t,l){for(var n=l-1,i=e.length;++n<i;)if(e[n]===t)return n;return-1}(e,t,l):_t(e,gt,l)}function At(e,t,l,n){for(var i=l-1,o=e.length;++i<o;)if(n(e[i],t))return i;return-1}function gt(e){return e!=e}function St(e,t){var l=null==e?0:e.length;return l?Tt(e,t)/l:NaN}function ht(e){return function(t){return null==t?void 0:t[e]}}function yt(e){return function(t){return null==e?void 0:e[t]}}function Dt(e,t,l,n,i){return i(e,function(e,i,o){l=n?(n=!1,e):t(l,e,i,o)}),l}function Tt(e,t){for(var l,n=-1,i=e.length;++n<i;){var o=t(e[n]);void 0!==o&&(l=void 0===l?o:l+o)}return l}function bt(e,t){for(var l=-1,n=Array(e);++l<e;)n[l]=t(l);return n}function Ct(e){return e?e.slice(0,Kt(e)+1).replace($,""):e}function Pt(e){return function(t){return e(t)}}function Nt(e,t){return dt(t,function(t){return e[t]})}function It(e,t){return e.has(t)}function Lt(e,t){for(var l=-1,n=e.length;++l<n&&ft(t,e[l],0)>-1;);return l}function Bt(e,t){for(var l=e.length;l--&&ft(t,e[l],0)>-1;);return l}function Ot(e,t){for(var l=e.length,n=0;l--;)e[l]===t&&++n;return n}var Rt=yt({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),wt=yt({"&":"&","<":"<",">":">",'"':""","'":"'"});function xt(e){return"\\"+ke[e]}function Mt(e){return Oe.test(e)}function Ft(e){var t=-1,l=Array(e.size);return e.forEach(function(e,n){l[++t]=[n,e]}),l}function kt(e,t){return function(l){return e(t(l))}}function Ut(e,t){for(var l=-1,i=e.length,o=0,a=[];++l<i;){var r=e[l];r!==t&&r!==n||(e[l]=n,a[o++]=l)}return a}function Ht(e){var t=-1,l=Array(e.size);return e.forEach(function(e){l[++t]=e}),l}function Wt(e){var t=-1,l=Array(e.size);return e.forEach(function(e){l[++t]=[e,e]}),l}function Gt(e){return Mt(e)?function(e){for(var t=Le.lastIndex=0;Le.test(e);)++t;return t}(e):mt(e)}function jt(e){return Mt(e)?function(e){return e.match(Le)||[]}(e):function(e){return e.split("")}(e)}function Kt(e){for(var t=e.length;t--&&z.test(e.charAt(t)););return t}var Yt=yt({"&":"&","<":"<",">":">",""":'"',"'":"'"}),$t=function e(t){var y=(t=null==t?je:$t.defaults(je.Object(),t,$t.pick(je,we))).Array,z=t.Date,se=t.Error,ce=t.Function,ve=t.Math,pe=t.Object,me=t.RegExp,Ee=t.String,_e=t.TypeError,fe=y.prototype,Ae=pe.prototype,ge=t["__core-js_shared__"],Se=ce.prototype.toString,he=Ae.hasOwnProperty,ye=0,De=function(){var e=/[^.]+$/.exec(ge&&ge.keys&&ge.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),Te=Ae.toString,be=Se.call(pe),Ce=je._,Pe=me("^"+Se.call(he).replace(K,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Le=$e?t.Buffer:void 0,Oe=t.Symbol,ke=t.Uint8Array,We=Le?Le.allocUnsafe:void 0,Ge=kt(pe.getPrototypeOf,pe),Ke=pe.create,Ye=Ae.propertyIsEnumerable,ze=fe.splice,Ve=Oe?Oe.isConcatSpreadable:void 0,mt=Oe?Oe.iterator:void 0,yt=Oe?Oe.toStringTag:void 0,zt=function(){try{var e=Ji(pe,"defineProperty");return e({},"",{}),e}catch(e){}}(),Vt=t.clearTimeout!==je.clearTimeout&&t.clearTimeout,qt=z&&z.now!==je.Date.now&&z.now,Xt=t.setTimeout!==je.setTimeout&&t.setTimeout,Jt=ve.ceil,Zt=ve.floor,Qt=pe.getOwnPropertySymbols,el=Le?Le.isBuffer:void 0,tl=t.isFinite,ll=fe.join,nl=kt(pe.keys,pe),il=ve.max,ol=ve.min,al=z.now,rl=t.parseInt,ul=ve.random,dl=fe.reverse,sl=Ji(t,"DataView"),cl=Ji(t,"Map"),vl=Ji(t,"Promise"),pl=Ji(t,"Set"),ml=Ji(t,"WeakMap"),El=Ji(pe,"create"),_l=ml&&new ml,fl={},Al=Po(sl),gl=Po(cl),Sl=Po(vl),hl=Po(pl),yl=Po(ml),Dl=Oe?Oe.prototype:void 0,Tl=Dl?Dl.valueOf:void 0,bl=Dl?Dl.toString:void 0;function Cl(e){if(Ka(e)&&!Ra(e)&&!(e instanceof Ll)){if(e instanceof Il)return e;if(he.call(e,"__wrapped__"))return No(e)}return new Il(e)}var Pl=function(){function e(){}return function(t){if(!ja(t))return{};if(Ke)return Ke(t);e.prototype=t;var l=new e;return e.prototype=void 0,l}}();function Nl(){}function Il(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=void 0}function Ll(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=4294967295,this.__views__=[]}function Bl(e){var t=-1,l=null==e?0:e.length;for(this.clear();++t<l;){var n=e[t];this.set(n[0],n[1])}}function Ol(e){var t=-1,l=null==e?0:e.length;for(this.clear();++t<l;){var n=e[t];this.set(n[0],n[1])}}function Rl(e){var t=-1,l=null==e?0:e.length;for(this.clear();++t<l;){var n=e[t];this.set(n[0],n[1])}}function wl(e){var t=-1,l=null==e?0:e.length;for(this.__data__=new Rl;++t<l;)this.add(e[t])}function xl(e){var t=this.__data__=new Ol(e);this.size=t.size}function Ml(e,t){var l=Ra(e),n=!l&&Oa(e),i=!l&&!n&&Fa(e),o=!l&&!n&&!i&&Za(e),a=l||n||i||o,r=a?bt(e.length,Ee):[],u=r.length;for(var d in e)!t&&!he.call(e,d)||a&&("length"==d||i&&("offset"==d||"parent"==d)||o&&("buffer"==d||"byteLength"==d||"byteOffset"==d)||io(d,u))||r.push(d);return r}function Fl(e){var t=e.length;return t?e[wn(0,t-1)]:void 0}function kl(e,t){return yo(Ei(e),zl(t,0,e.length))}function Ul(e){return yo(Ei(e))}function Hl(e,t,l){(void 0!==l&&!Ia(e[t],l)||void 0===l&&!(t in e))&&Yl(e,t,l)}function Wl(e,t,l){var n=e[t];he.call(e,t)&&Ia(n,l)&&(void 0!==l||t in e)||Yl(e,t,l)}function Gl(e,t){for(var l=e.length;l--;)if(Ia(e[l][0],t))return l;return-1}function jl(e,t,l,n){return Zl(e,function(e,i,o){t(n,e,l(e),o)}),n}function Kl(e,t){return e&&_i(t,Sr(t),e)}function Yl(e,t,l){"__proto__"==t&&zt?zt(e,t,{configurable:!0,enumerable:!0,value:l,writable:!0}):e[t]=l}function $l(e,t){for(var l=-1,n=t.length,i=y(n),o=null==e;++l<n;)i[l]=o?void 0:Er(e,t[l]);return i}function zl(e,t,l){return e==e&&(void 0!==l&&(e=e<=l?e:l),void 0!==t&&(e=e>=t?e:t)),e}function Vl(e,t,l,n,i,a){var d,g=1&t,y=2&t,B=4&t;if(l&&(d=i?l(e,n,i,a):l(e)),void 0!==d)return d;if(!ja(e))return e;var O=Ra(e);if(O){if(d=function(e){var t=e.length,l=new e.constructor(t);return t&&"string"==typeof e[0]&&he.call(e,"index")&&(l.index=e.index,l.input=e.input),l}(e),!g)return Ei(e,d)}else{var R=eo(e),w=R==s||R==c;if(Fa(e))return di(e,g);if(R==m||R==o||w&&!i){if(d=y||w?{}:lo(e),!g)return y?function(e,t){return _i(e,Qi(e),t)}(e,function(e,t){return e&&_i(t,hr(t),e)}(d,e)):function(e,t){return _i(e,Zi(e),t)}(e,Kl(d,e))}else{if(!Fe[R])return i?e:{};d=function(e,t,l){var n=e.constructor;switch(t){case S:return si(e);case r:case u:return new n(+e);case h:return function(e,t){var l=t?si(e.buffer):e.buffer;return new e.constructor(l,e.byteOffset,e.byteLength)}(e,l);case D:case T:case b:case C:case P:case N:case"[object Uint8ClampedArray]":case I:case L:return ci(e,l);case v:return new n;case p:case f:return new n(e);case E:return function(e){var t=new e.constructor(e.source,te.exec(e));return t.lastIndex=e.lastIndex,t}(e);case _:return new n;case A:return Tl?pe(Tl.call(e)):{}}}(e,R,g)}}a||(a=new xl);var x=a.get(e);if(x)return x;a.set(e,d),qa(e)?e.forEach(function(n){d.add(Vl(n,t,l,n,e,a))}):Ya(e)&&e.forEach(function(n,i){d.set(i,Vl(n,t,l,i,e,a))});var M=O?void 0:(B?y?Ki:ji:y?hr:Sr)(e);return nt(M||e,function(n,i){M&&(n=e[i=n]),Wl(d,i,Vl(n,t,l,i,e,a))}),d}function ql(e,t,l){var n=l.length;if(null==e)return!n;for(e=pe(e);n--;){var i=l[n],o=e[i];if(void 0===o&&!(i in e)||!(0,t[i])(o))return!1}return!0}function Xl(e,t,n){if("function"!=typeof e)throw new _e(l);return Ao(function(){e.apply(void 0,n)},t)}function Jl(e,t,l,n){var i=-1,o=rt,a=!0,r=e.length,u=[],d=t.length;if(!r)return u;l&&(t=dt(t,Pt(l))),n?(o=ut,a=!1):t.length>=200&&(o=It,a=!1,t=new wl(t));e:for(;++i<r;){var s=e[i],c=null==l?s:l(s);if(s=n||0!==s?s:0,a&&c==c){for(var v=d;v--;)if(t[v]===c)continue e;u.push(s)}else o(t,c,n)||u.push(s)}return u}Cl.templateSettings={escape:k,evaluate:U,interpolate:H,variable:"",imports:{_:Cl}},(Cl.prototype=Nl.prototype).constructor=Cl,(Il.prototype=Pl(Nl.prototype)).constructor=Il,(Ll.prototype=Pl(Nl.prototype)).constructor=Ll,Bl.prototype.clear=function(){this.__data__=El?El(null):{},this.size=0},Bl.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Bl.prototype.get=function(e){var t=this.__data__;if(El){var l=t[e];return"__lodash_hash_undefined__"===l?void 0:l}return he.call(t,e)?t[e]:void 0},Bl.prototype.has=function(e){var t=this.__data__;return El?void 0!==t[e]:he.call(t,e)},Bl.prototype.set=function(e,t){var l=this.__data__;return this.size+=this.has(e)?0:1,l[e]=El&&void 0===t?"__lodash_hash_undefined__":t,this},Ol.prototype.clear=function(){this.__data__=[],this.size=0},Ol.prototype.delete=function(e){var t=this.__data__,l=Gl(t,e);return!(l<0||(l==t.length-1?t.pop():ze.call(t,l,1),--this.size,0))},Ol.prototype.get=function(e){var t=this.__data__,l=Gl(t,e);return l<0?void 0:t[l][1]},Ol.prototype.has=function(e){return Gl(this.__data__,e)>-1},Ol.prototype.set=function(e,t){var l=this.__data__,n=Gl(l,e);return n<0?(++this.size,l.push([e,t])):l[n][1]=t,this},Rl.prototype.clear=function(){this.size=0,this.__data__={hash:new Bl,map:new(cl||Ol),string:new Bl}},Rl.prototype.delete=function(e){var t=qi(this,e).delete(e);return this.size-=t?1:0,t},Rl.prototype.get=function(e){return qi(this,e).get(e)},Rl.prototype.has=function(e){return qi(this,e).has(e)},Rl.prototype.set=function(e,t){var l=qi(this,e),n=l.size;return l.set(e,t),this.size+=l.size==n?0:1,this},wl.prototype.add=wl.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},wl.prototype.has=function(e){return this.__data__.has(e)},xl.prototype.clear=function(){this.__data__=new Ol,this.size=0},xl.prototype.delete=function(e){var t=this.__data__,l=t.delete(e);return this.size=t.size,l},xl.prototype.get=function(e){return this.__data__.get(e)},xl.prototype.has=function(e){return this.__data__.has(e)},xl.prototype.set=function(e,t){var l=this.__data__;if(l instanceof Ol){var n=l.__data__;if(!cl||n.length<199)return n.push([e,t]),this.size=++l.size,this;l=this.__data__=new Rl(n)}return l.set(e,t),this.size=l.size,this};var Zl=gi(rn),Ql=gi(un,!0);function en(e,t){var l=!0;return Zl(e,function(e,n,i){return l=!!t(e,n,i)}),l}function tn(e,t,l){for(var n=-1,i=e.length;++n<i;){var o=e[n],a=t(o);if(null!=a&&(void 0===r?a==a&&!Ja(a):l(a,r)))var r=a,u=o}return u}function ln(e,t){var l=[];return Zl(e,function(e,n,i){t(e,n,i)&&l.push(e)}),l}function nn(e,t,l,n,i){var o=-1,a=e.length;for(l||(l=no),i||(i=[]);++o<a;){var r=e[o];t>0&&l(r)?t>1?nn(r,t-1,l,n,i):st(i,r):n||(i[i.length]=r)}return i}var on=Si(),an=Si(!0);function rn(e,t){return e&&on(e,t,Sr)}function un(e,t){return e&&an(e,t,Sr)}function dn(e,t){return at(t,function(t){return Ha(e[t])})}function sn(e,t){for(var l=0,n=(t=oi(t,e)).length;null!=e&&l<n;)e=e[Co(t[l++])];return l&&l==n?e:void 0}function cn(e,t,l){var n=t(e);return Ra(e)?n:st(n,l(e))}function vn(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":yt&&yt in pe(e)?function(e){var t=he.call(e,yt),l=e[yt];try{e[yt]=void 0;var n=!0}catch(e){}var i=Te.call(e);return n&&(t?e[yt]=l:delete e[yt]),i}(e):function(e){return Te.call(e)}(e)}function pn(e,t){return e>t}function mn(e,t){return null!=e&&he.call(e,t)}function En(e,t){return null!=e&&t in pe(e)}function _n(e,t,l){for(var n=l?ut:rt,i=e[0].length,o=e.length,a=o,r=y(o),u=Infinity,d=[];a--;){var s=e[a];a&&t&&(s=dt(s,Pt(t))),u=ol(s.length,u),r[a]=!l&&(t||i>=120&&s.length>=120)?new wl(a&&s):void 0}s=e[0];var c=-1,v=r[0];e:for(;++c<i&&d.length<u;){var p=s[c],m=t?t(p):p;if(p=l||0!==p?p:0,!(v?It(v,m):n(d,m,l))){for(a=o;--a;){var E=r[a];if(!(E?It(E,m):n(e[a],m,l)))continue e}v&&v.push(m),d.push(p)}}return d}function fn(e,t,l){var n=null==(e=mo(e,t=oi(t,e)))?e:e[Co(Uo(t))];return null==n?void 0:tt(n,e,l)}function An(e){return Ka(e)&&vn(e)==o}function gn(e,t,l,n,i){return e===t||(null==e||null==t||!Ka(e)&&!Ka(t)?e!=e&&t!=t:function(e,t,l,n,i,s){var c=Ra(e),g=Ra(t),y=c?a:eo(e),D=g?a:eo(t),T=(y=y==o?m:y)==m,b=(D=D==o?m:D)==m,C=y==D;if(C&&Fa(e)){if(!Fa(t))return!1;c=!0,T=!1}if(C&&!T)return s||(s=new xl),c||Za(e)?Wi(e,t,l,n,i,s):function(e,t,l,n,i,o,a){switch(l){case h: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 ke(e),new ke(t)));case r:case u:case p:return Ia(+e,+t);case d:return e.name==t.name&&e.message==t.message;case E:case f:return e==t+"";case v:var s=Ft;case _:if(s||(s=Ht),e.size!=t.size&&!(1&n))return!1;var c=a.get(e);if(c)return c==t;n|=2,a.set(e,t);var m=Wi(s(e),s(t),n,i,o,a);return a.delete(e),m;case A:if(Tl)return Tl.call(e)==Tl.call(t)}return!1}(e,t,y,l,n,i,s);if(!(1&l)){var P=T&&he.call(e,"__wrapped__"),N=b&&he.call(t,"__wrapped__");if(P||N){var I=P?e.value():e,L=N?t.value():t;return s||(s=new xl),i(I,L,l,n,s)}}return!!C&&(s||(s=new xl),function(e,t,l,n,i,o){var a=1&l,r=ji(e),u=r.length;if(u!=ji(t).length&&!a)return!1;for(var d=u;d--;){var s=r[d];if(!(a?s in t:he.call(t,s)))return!1}var c=o.get(e),v=o.get(t);if(c&&v)return c==t&&v==e;var p=!0;o.set(e,t),o.set(t,e);for(var m=a;++d<u;){var E=e[s=r[d]],_=t[s];if(n)var f=a?n(_,E,s,t,e,o):n(E,_,s,e,t,o);if(!(void 0===f?E===_||i(E,_,l,n,o):f)){p=!1;break}m||(m="constructor"==s)}if(p&&!m){var A=e.constructor,g=t.constructor;A==g||!("constructor"in e)||!("constructor"in t)||"function"==typeof A&&A instanceof A&&"function"==typeof g&&g instanceof g||(p=!1)}return o.delete(e),o.delete(t),p}(e,t,l,n,i,s))}(e,t,l,n,gn,i))}function Sn(e,t,l,n){var i=l.length,o=i,a=!n;if(null==e)return!o;for(e=pe(e);i--;){var r=l[i];if(a&&r[2]?r[1]!==e[r[0]]:!(r[0]in e))return!1}for(;++i<o;){var u=(r=l[i])[0],d=e[u],s=r[1];if(a&&r[2]){if(void 0===d&&!(u in e))return!1}else{var c=new xl;if(n)var v=n(d,s,u,e,t,c);if(!(void 0===v?gn(s,d,3,n,c):v))return!1}}return!0}function hn(e){return!(!ja(e)||(t=e,De&&De in t))&&(Ha(e)?Pe:ie).test(Po(e));var t}function yn(e){return"function"==typeof e?e:null==e?$r:"object"==typeof e?Ra(e)?Pn(e[0],e[1]):Cn(e):tu(e)}function Dn(e){if(!so(e))return nl(e);var t=[];for(var l in pe(e))he.call(e,l)&&"constructor"!=l&&t.push(l);return t}function Tn(e,t){return e<t}function bn(e,t){var l=-1,n=xa(e)?y(e.length):[];return Zl(e,function(e,i,o){n[++l]=t(e,i,o)}),n}function Cn(e){var t=Xi(e);return 1==t.length&&t[0][2]?vo(t[0][0],t[0][1]):function(l){return l===e||Sn(l,e,t)}}function Pn(e,t){return ao(e)&&co(t)?vo(Co(e),t):function(l){var n=Er(l,e);return void 0===n&&n===t?_r(l,e):gn(t,n,3)}}function Nn(e,t,l,n,i){e!==t&&on(t,function(o,a){if(i||(i=new xl),ja(o))!function(e,t,l,n,i,o,a){var r=_o(e,l),u=_o(t,l),d=a.get(u);if(d)Hl(e,l,d);else{var s=o?o(r,u,l+"",e,t,a):void 0,c=void 0===s;if(c){var v=Ra(u),p=!v&&Fa(u),m=!v&&!p&&Za(u);s=u,v||p||m?Ra(r)?s=r:Ma(r)?s=Ei(r):p?(c=!1,s=di(u,!0)):m?(c=!1,s=ci(u,!0)):s=[]:za(u)||Oa(u)?(s=r,Oa(r)?s=ar(r):ja(r)&&!Ha(r)||(s=lo(u))):c=!1}c&&(a.set(u,s),i(s,u,n,o,a),a.delete(u)),Hl(e,l,s)}}(e,t,a,l,Nn,n,i);else{var r=n?n(_o(e,a),o,a+"",e,t,i):void 0;void 0===r&&(r=o),Hl(e,a,r)}},hr)}function In(e,t){var l=e.length;if(l)return io(t+=t<0?l:0,l)?e[t]:void 0}function Ln(e,t,l){t=t.length?dt(t,function(e){return Ra(e)?function(t){return sn(t,1===e.length?e[0]:e)}:e}):[$r];var n=-1;return t=dt(t,Pt(Vi())),function(e,t){var n=e.length;for(e.sort(function(e,t){return function(e,t,l){for(var n=-1,i=e.criteria,o=t.criteria,a=i.length,r=l.length;++n<a;){var u=vi(i[n],o[n]);if(u)return n>=r?u:u*("desc"==l[n]?-1:1)}return e.index-t.index}(e,t,l)});n--;)e[n]=e[n].value;return e}(bn(e,function(e,l,i){return{criteria:dt(t,function(t){return t(e)}),index:++n,value:e}}))}function Bn(e,t,l){for(var n=-1,i=t.length,o={};++n<i;){var a=t[n],r=sn(e,a);l(r,a)&&Un(o,oi(a,e),r)}return o}function On(e,t,l,n){var i=n?At:ft,o=-1,a=t.length,r=e;for(e===t&&(t=Ei(t)),l&&(r=dt(e,Pt(l)));++o<a;)for(var u=0,d=t[o],s=l?l(d):d;(u=i(r,s,u,n))>-1;)r!==e&&ze.call(r,u,1),ze.call(e,u,1);return e}function Rn(e,t){for(var l=e?t.length:0,n=l-1;l--;){var i=t[l];if(l==n||i!==o){var o=i;io(i)?ze.call(e,i,1):Jn(e,i)}}return e}function wn(e,t){return e+Zt(ul()*(t-e+1))}function xn(e,t){var l="";if(!e||t<1||t>9007199254740991)return l;do{t%2&&(l+=e),(t=Zt(t/2))&&(e+=e)}while(t);return l}function Mn(e,t){return go(po(e,t,$r),e+"")}function Fn(e){return Fl(Ir(e))}function kn(e,t){var l=Ir(e);return yo(l,zl(t,0,l.length))}function Un(e,t,l,n){if(!ja(e))return e;for(var i=-1,o=(t=oi(t,e)).length,a=o-1,r=e;null!=r&&++i<o;){var u=Co(t[i]),d=l;if("__proto__"===u||"constructor"===u||"prototype"===u)return e;if(i!=a){var s=r[u];void 0===(d=n?n(s,u,r):void 0)&&(d=ja(s)?s:io(t[i+1])?[]:{})}Wl(r,u,d),r=r[u]}return e}var Hn=_l?function(e,t){return _l.set(e,t),e}:$r,Wn=zt?function(e,t){return zt(e,"toString",{configurable:!0,enumerable:!1,value:jr(t),writable:!0})}:$r;function Gn(e){return yo(Ir(e))}function jn(e,t,l){var n=-1,i=e.length;t<0&&(t=-t>i?0:i+t),(l=l>i?i:l)<0&&(l+=i),i=t>l?0:l-t>>>0,t>>>=0;for(var o=y(i);++n<i;)o[n]=e[n+t];return o}function Kn(e,t){var l;return Zl(e,function(e,n,i){return!(l=t(e,n,i))}),!!l}function Yn(e,t,l){var n=0,i=null==e?n:e.length;if("number"==typeof t&&t==t&&i<=2147483647){for(;n<i;){var o=n+i>>>1,a=e[o];null!==a&&!Ja(a)&&(l?a<=t:a<t)?n=o+1:i=o}return i}return $n(e,t,$r,l)}function $n(e,t,l,n){var i=0,o=null==e?0:e.length;if(0===o)return 0;for(var a=(t=l(t))!=t,r=null===t,u=Ja(t),d=void 0===t;i<o;){var s=Zt((i+o)/2),c=l(e[s]),v=void 0!==c,p=null===c,m=c==c,E=Ja(c);if(a)var _=n||m;else _=d?m&&(n||v):r?m&&v&&(n||!p):u?m&&v&&!p&&(n||!E):!p&&!E&&(n?c<=t:c<t);_?i=s+1:o=s}return ol(o,4294967294)}function zn(e,t){for(var l=-1,n=e.length,i=0,o=[];++l<n;){var a=e[l],r=t?t(a):a;if(!l||!Ia(r,u)){var u=r;o[i++]=0===a?0:a}}return o}function Vn(e){return"number"==typeof e?e:Ja(e)?NaN:+e}function qn(e){if("string"==typeof e)return e;if(Ra(e))return dt(e,qn)+"";if(Ja(e))return bl?bl.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Xn(e,t,l){var n=-1,i=rt,o=e.length,a=!0,r=[],u=r;if(l)a=!1,i=ut;else if(o>=200){var d=t?null:xi(e);if(d)return Ht(d);a=!1,i=It,u=new wl}else u=t?[]:r;e:for(;++n<o;){var s=e[n],c=t?t(s):s;if(s=l||0!==s?s:0,a&&c==c){for(var v=u.length;v--;)if(u[v]===c)continue e;t&&u.push(c),r.push(s)}else i(u,c,l)||(u!==r&&u.push(c),r.push(s))}return r}function Jn(e,t){return null==(e=mo(e,t=oi(t,e)))||delete e[Co(Uo(t))]}function Zn(e,t,l,n){return Un(e,t,l(sn(e,t)),n)}function Qn(e,t,l,n){for(var i=e.length,o=n?i:-1;(n?o--:++o<i)&&t(e[o],o,e););return l?jn(e,n?0:o,n?o+1:i):jn(e,n?o+1:0,n?i:o)}function ei(e,t){var l=e;return l instanceof Ll&&(l=l.value()),ct(t,function(e,t){return t.func.apply(t.thisArg,st([e],t.args))},l)}function ti(e,t,l){var n=e.length;if(n<2)return n?Xn(e[0]):[];for(var i=-1,o=y(n);++i<n;)for(var a=e[i],r=-1;++r<n;)r!=i&&(o[i]=Jl(o[i]||a,e[r],t,l));return Xn(nn(o,1),t,l)}function li(e,t,l){for(var n=-1,i=e.length,o=t.length,a={};++n<i;)l(a,e[n],n<o?t[n]:void 0);return a}function ni(e){return Ma(e)?e:[]}function ii(e){return"function"==typeof e?e:$r}function oi(e,t){return Ra(e)?e:ao(e,t)?[e]:bo(rr(e))}var ai=Mn;function ri(e,t,l){var n=e.length;return l=void 0===l?n:l,!t&&l>=n?e:jn(e,t,l)}var ui=Vt||function(e){return je.clearTimeout(e)};function di(e,t){if(t)return e.slice();var l=e.length,n=We?We(l):new e.constructor(l);return e.copy(n),n}function si(e){var t=new e.constructor(e.byteLength);return new ke(t).set(new ke(e)),t}function ci(e,t){var l=t?si(e.buffer):e.buffer;return new e.constructor(l,e.byteOffset,e.length)}function vi(e,t){if(e!==t){var l=void 0!==e,n=null===e,i=e==e,o=Ja(e),a=void 0!==t,r=null===t,u=t==t,d=Ja(t);if(!r&&!d&&!o&&e>t||o&&a&&u&&!r&&!d||n&&a&&u||!l&&u||!i)return 1;if(!n&&!o&&!d&&e<t||d&&l&&i&&!n&&!o||r&&l&&i||!a&&i||!u)return-1}return 0}function pi(e,t,l,n){for(var i=-1,o=e.length,a=l.length,r=-1,u=t.length,d=il(o-a,0),s=y(u+d),c=!n;++r<u;)s[r]=t[r];for(;++i<a;)(c||i<o)&&(s[l[i]]=e[i]);for(;d--;)s[r++]=e[i++];return s}function mi(e,t,l,n){for(var i=-1,o=e.length,a=-1,r=l.length,u=-1,d=t.length,s=il(o-r,0),c=y(s+d),v=!n;++i<s;)c[i]=e[i];for(var p=i;++u<d;)c[p+u]=t[u];for(;++a<r;)(v||i<o)&&(c[p+l[a]]=e[i++]);return c}function Ei(e,t){var l=-1,n=e.length;for(t||(t=y(n));++l<n;)t[l]=e[l];return t}function _i(e,t,l,n){var i=!l;l||(l={});for(var o=-1,a=t.length;++o<a;){var r=t[o],u=n?n(l[r],e[r],r,l,e):void 0;void 0===u&&(u=e[r]),i?Yl(l,r,u):Wl(l,r,u)}return l}function fi(e,t){return function(l,n){var i=Ra(l)?lt:jl,o=t?t():{};return i(l,e,Vi(n,2),o)}}function Ai(e){return Mn(function(t,l){var n=-1,i=l.length,o=i>1?l[i-1]:void 0,a=i>2?l[2]:void 0;for(o=e.length>3&&"function"==typeof o?(i--,o):void 0,a&&oo(l[0],l[1],a)&&(o=i<3?void 0:o,i=1),t=pe(t);++n<i;){var r=l[n];r&&e(t,r,n,o)}return t})}function gi(e,t){return function(l,n){if(null==l)return l;if(!xa(l))return e(l,n);for(var i=l.length,o=t?i:-1,a=pe(l);(t?o--:++o<i)&&!1!==n(a[o],o,a););return l}}function Si(e){return function(t,l,n){for(var i=-1,o=pe(t),a=n(t),r=a.length;r--;){var u=a[e?r:++i];if(!1===l(o[u],u,o))break}return t}}function hi(e){return function(t){var l=Mt(t=rr(t))?jt(t):void 0,n=l?l[0]:t.charAt(0),i=l?ri(l,1).join(""):t.slice(1);return n[e]()+i}}function yi(e){return function(t){return ct(Hr(Or(t).replace(Ne,"")),e,"")}}function Di(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 l=Pl(e.prototype),n=e.apply(l,t);return ja(n)?n:l}}function Ti(e){return function(t,l,n){var i=pe(t);if(!xa(t)){var o=Vi(l,3);t=Sr(t),l=function(e){return o(i[e],e,i)}}var a=e(t,l,n);return a>-1?i[o?t[a]:a]:void 0}}function bi(e){return Gi(function(t){var n=t.length,i=n,o=Il.prototype.thru;for(e&&t.reverse();i--;){var a=t[i];if("function"!=typeof a)throw new _e(l);if(o&&!r&&"wrapper"==$i(a))var r=new Il([],!0)}for(i=r?i:n;++i<n;){var u=$i(a=t[i]),d="wrapper"==u?Yi(a):void 0;r=d&&ro(d[0])&&424==d[1]&&!d[4].length&&1==d[9]?r[$i(d[0])].apply(r,d[3]):1==a.length&&ro(a)?r[u]():r.thru(a)}return function(){var e=arguments,l=e[0];if(r&&1==e.length&&Ra(l))return r.plant(l).value();for(var i=0,o=n?t[i].apply(this,e):l;++i<n;)o=t[i].call(this,o);return o}})}function Ci(e,t,l,n,i,o,a,r,u,d){var s=128&t,c=1&t,v=2&t,p=24&t,m=512&t,E=v?void 0:Di(e);return function _(){for(var f=arguments.length,A=y(f),g=f;g--;)A[g]=arguments[g];if(p)var S=zi(_),h=Ot(A,S);if(n&&(A=pi(A,n,i,p)),o&&(A=mi(A,o,a,p)),f-=h,p&&f<d){var D=Ut(A,S);return Ri(e,t,Ci,_.placeholder,l,A,D,r,u,d-f)}var T=c?l:this,b=v?T[e]:e;return f=A.length,r?A=Eo(A,r):m&&f>1&&A.reverse(),s&&u<f&&(A.length=u),this&&this!==je&&this instanceof _&&(b=E||Di(b)),b.apply(T,A)}}function Pi(e,t){return function(l,n){return function(e,t,l,n){return rn(e,function(e,i,o){t(n,l(e),i,o)}),n}(l,e,t(n),{})}}function Ni(e,t){return function(l,n){var i;if(void 0===l&&void 0===n)return t;if(void 0!==l&&(i=l),void 0!==n){if(void 0===i)return n;"string"==typeof l||"string"==typeof n?(l=qn(l),n=qn(n)):(l=Vn(l),n=Vn(n)),i=e(l,n)}return i}}function Ii(e){return Gi(function(t){return t=dt(t,Pt(Vi())),Mn(function(l){var n=this;return e(t,function(e){return tt(e,n,l)})})})}function Li(e,t){var l=(t=void 0===t?" ":qn(t)).length;if(l<2)return l?xn(t,e):t;var n=xn(t,Jt(e/Gt(t)));return Mt(t)?ri(jt(n),0,e).join(""):n.slice(0,e)}function Bi(e){return function(t,l,n){return n&&"number"!=typeof n&&oo(t,l,n)&&(l=n=void 0),t=lr(t),void 0===l?(l=t,t=0):l=lr(l),function(e,t,l,n){for(var i=-1,o=il(Jt((t-e)/(l||1)),0),a=y(o);o--;)a[n?o:++i]=e,e+=l;return a}(t,l,n=void 0===n?t<l?1:-1:lr(n),e)}}function Oi(e){return function(t,l){return"string"==typeof t&&"string"==typeof l||(t=or(t),l=or(l)),e(t,l)}}function Ri(e,t,l,n,i,o,a,r,u,d){var s=8&t;t|=s?32:64,4&(t&=~(s?64:32))||(t&=-4);var c=[e,t,i,s?o:void 0,s?a:void 0,s?void 0:o,s?void 0:a,r,u,d],v=l.apply(void 0,c);return ro(e)&&fo(v,c),v.placeholder=n,So(v,e,t)}function wi(e){var t=ve[e];return function(e,l){if(e=or(e),(l=null==l?0:ol(nr(l),292))&&tl(e)){var n=(rr(e)+"e").split("e");return+((n=(rr(t(n[0]+"e"+(+n[1]+l)))+"e").split("e"))[0]+"e"+(+n[1]-l))}return t(e)}}var xi=pl&&1/Ht(new pl([,-0]))[1]==1/0?function(e){return new pl(e)}:Jr;function Mi(e){return function(t){var l=eo(t);return l==v?Ft(t):l==_?Wt(t):function(e,t){return dt(t,function(t){return[t,e[t]]})}(t,e(t))}}function Fi(e,t,i,o,a,r,u,d){var s=2&t;if(!s&&"function"!=typeof e)throw new _e(l);var c=o?o.length:0;if(c||(t&=-97,o=a=void 0),u=void 0===u?u:il(nr(u),0),d=void 0===d?d:nr(d),c-=a?a.length:0,64&t){var v=o,p=a;o=a=void 0}var m=s?void 0:Yi(e),E=[e,t,i,o,a,v,p,r,u,d];if(m&&function(e,t){var l=e[1],i=t[1],o=l|i;if(!(o<131||128==i&&8==l||128==i&&256==l&&e[7].length<=t[8]||384==i&&t[7].length<=t[8]&&8==l))return e;1&i&&(e[2]=t[2],o|=1&l?0:4);var a=t[3];if(a){var r=e[3];e[3]=r?pi(r,a,t[4]):a,e[4]=r?Ut(e[3],n):t[4]}(a=t[5])&&(e[5]=(r=e[5])?mi(r,a,t[6]):a,e[6]=r?Ut(e[5],n):t[6]),(a=t[7])&&(e[7]=a),128&i&&(e[8]=null==e[8]?t[8]:ol(e[8],t[8])),null==e[9]&&(e[9]=t[9]),e[0]=t[0],e[1]=o}(E,m),e=E[0],t=E[1],i=E[2],o=E[3],a=E[4],!(d=E[9]=void 0===E[9]?s?0:e.length:il(E[9]-c,0))&&24&t&&(t&=-25),t&&1!=t)_=8==t||16==t?function(e,t,l){var n=Di(e);return function i(){for(var o=arguments.length,a=y(o),r=o,u=zi(i);r--;)a[r]=arguments[r];var d=o<3&&a[0]!==u&&a[o-1]!==u?[]:Ut(a,u);if((o-=d.length)<l)return Ri(e,t,Ci,i.placeholder,void 0,a,d,void 0,void 0,l-o);var s=this&&this!==je&&this instanceof i?n:e;return tt(s,this,a)}}(e,t,d):32!=t&&33!=t||a.length?Ci.apply(void 0,E):function(e,t,l,n){var i=1&t,o=Di(e);return function t(){for(var a=-1,r=arguments.length,u=-1,d=n.length,s=y(d+r),c=this&&this!==je&&this instanceof t?o:e;++u<d;)s[u]=n[u];for(;r--;)s[u++]=arguments[++a];return tt(c,i?l:this,s)}}(e,t,i,o);else var _=function(e,t,l){var n=1&t,i=Di(e);return function t(){var o=this&&this!==je&&this instanceof t?i:e;return o.apply(n?l:this,arguments)}}(e,t,i);return So((m?Hn:fo)(_,E),e,t)}function ki(e,t,l,n){return void 0===e||Ia(e,Ae[l])&&!he.call(n,l)?t:e}function Ui(e,t,l,n,i,o){return ja(e)&&ja(t)&&(o.set(t,e),Nn(e,t,void 0,Ui,o),o.delete(t)),e}function Hi(e){return za(e)?void 0:e}function Wi(e,t,l,n,i,o){var a=1&l,r=e.length,u=t.length;if(r!=u&&!(a&&u>r))return!1;var d=o.get(e),s=o.get(t);if(d&&s)return d==t&&s==e;var c=-1,v=!0,p=2&l?new wl:void 0;for(o.set(e,t),o.set(t,e);++c<r;){var m=e[c],E=t[c];if(n)var _=a?n(E,m,c,t,e,o):n(m,E,c,e,t,o);if(void 0!==_){if(_)continue;v=!1;break}if(p){if(!pt(t,function(e,t){if(!It(p,t)&&(m===e||i(m,e,l,n,o)))return p.push(t)})){v=!1;break}}else if(m!==E&&!i(m,E,l,n,o)){v=!1;break}}return o.delete(e),o.delete(t),v}function Gi(e){return go(po(e,void 0,wo),e+"")}function ji(e){return cn(e,Sr,Zi)}function Ki(e){return cn(e,hr,Qi)}var Yi=_l?function(e){return _l.get(e)}:Jr;function $i(e){for(var t=e.name+"",l=fl[t],n=he.call(fl,t)?l.length:0;n--;){var i=l[n],o=i.func;if(null==o||o==e)return i.name}return t}function zi(e){return(he.call(Cl,"placeholder")?Cl:e).placeholder}function Vi(){var e=Cl.iteratee||zr;return e=e===zr?yn:e,arguments.length?e(arguments[0],arguments[1]):e}function qi(e,t){var l=e.__data__;return function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}(t)?l["string"==typeof t?"string":"hash"]:l.map}function Xi(e){for(var t=Sr(e),l=t.length;l--;){var n=t[l],i=e[n];t[l]=[n,i,co(i)]}return t}function Ji(e,t){var l=function(e,t){return null==e?void 0:e[t]}(e,t);return hn(l)?l:void 0}var Zi=Qt?function(e){return null==e?[]:(e=pe(e),at(Qt(e),function(t){return Ye.call(e,t)}))}:iu,Qi=Qt?function(e){for(var t=[];e;)st(t,Zi(e)),e=Ge(e);return t}:iu,eo=vn;function to(e,t,l){for(var n=-1,i=(t=oi(t,e)).length,o=!1;++n<i;){var a=Co(t[n]);if(!(o=null!=e&&l(e,a)))break;e=e[a]}return o||++n!=i?o:!!(i=null==e?0:e.length)&&Ga(i)&&io(a,i)&&(Ra(e)||Oa(e))}function lo(e){return"function"!=typeof e.constructor||so(e)?{}:Pl(Ge(e))}function no(e){return Ra(e)||Oa(e)||!!(Ve&&e&&e[Ve])}function io(e,t){var l=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==l||"symbol"!=l&&ae.test(e))&&e>-1&&e%1==0&&e<t}function oo(e,t,l){if(!ja(l))return!1;var n=typeof t;return!!("number"==n?xa(l)&&io(t,l.length):"string"==n&&t in l)&&Ia(l[t],e)}function ao(e,t){if(Ra(e))return!1;var l=typeof e;return!("number"!=l&&"symbol"!=l&&"boolean"!=l&&null!=e&&!Ja(e))||G.test(e)||!W.test(e)||null!=t&&e in pe(t)}function ro(e){var t=$i(e),l=Cl[t];if("function"!=typeof l||!(t in Ll.prototype))return!1;if(e===l)return!0;var n=Yi(l);return!!n&&e===n[0]}(sl&&eo(new sl(new ArrayBuffer(1)))!=h||cl&&eo(new cl)!=v||vl&&"[object Promise]"!=eo(vl.resolve())||pl&&eo(new pl)!=_||ml&&eo(new ml)!=g)&&(eo=function(e){var t=vn(e),l=t==m?e.constructor:void 0,n=l?Po(l):"";if(n)switch(n){case Al:return h;case gl:return v;case Sl:return"[object Promise]";case hl:return _;case yl:return g}return t});var uo=ge?Ha:ou;function so(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Ae)}function co(e){return e==e&&!ja(e)}function vo(e,t){return function(l){return null!=l&&l[e]===t&&(void 0!==t||e in pe(l))}}function po(e,t,l){return t=il(void 0===t?e.length-1:t,0),function(){for(var n=arguments,i=-1,o=il(n.length-t,0),a=y(o);++i<o;)a[i]=n[t+i];i=-1;for(var r=y(t+1);++i<t;)r[i]=n[i];return r[t]=l(a),tt(e,this,r)}}function mo(e,t){return t.length<2?e:sn(e,jn(t,0,-1))}function Eo(e,t){for(var l=e.length,n=ol(t.length,l),i=Ei(e);n--;){var o=t[n];e[n]=io(o,l)?i[o]:void 0}return e}function _o(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var fo=ho(Hn),Ao=Xt||function(e,t){return je.setTimeout(e,t)},go=ho(Wn);function So(e,t,l){var n=t+"";return go(e,function(e,t){var l=t.length;if(!l)return e;var n=l-1;return t[n]=(l>1?"& ":"")+t[n],t=t.join(l>2?", ":" "),e.replace(V,"{\n/* [wrapped with "+t+"] */\n")}(n,function(e,t){return nt(i,function(l){var n="_."+l[0];t&l[1]&&!rt(e,n)&&e.push(n)}),e.sort()}(function(e){var t=e.match(q);return t?t[1].split(X):[]}(n),l)))}function ho(e){var t=0,l=0;return function(){var n=al(),i=16-(n-l);if(l=n,i>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function yo(e,t){var l=-1,n=e.length,i=n-1;for(t=void 0===t?n:t;++l<t;){var o=wn(l,i),a=e[o];e[o]=e[l],e[l]=a}return e.length=t,e}var Do,To,bo=(Do=Da(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(j,function(e,l,n,i){t.push(n?i.replace(Q,"$1"):l||e)}),t},function(e){return 500===To.size&&To.clear(),e}),To=Do.cache,Do);function Co(e){if("string"==typeof e||Ja(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Po(e){if(null!=e){try{return Se.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function No(e){if(e instanceof Ll)return e.clone();var t=new Il(e.__wrapped__,e.__chain__);return t.__actions__=Ei(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var Io=Mn(function(e,t){return Ma(e)?Jl(e,nn(t,1,Ma,!0)):[]}),Lo=Mn(function(e,t){var l=Uo(t);return Ma(l)&&(l=void 0),Ma(e)?Jl(e,nn(t,1,Ma,!0),Vi(l,2)):[]}),Bo=Mn(function(e,t){var l=Uo(t);return Ma(l)&&(l=void 0),Ma(e)?Jl(e,nn(t,1,Ma,!0),void 0,l):[]});function Oo(e,t,l){var n=null==e?0:e.length;if(!n)return-1;var i=null==l?0:nr(l);return i<0&&(i=il(n+i,0)),_t(e,Vi(t,3),i)}function Ro(e,t,l){var n=null==e?0:e.length;if(!n)return-1;var i=n-1;return void 0!==l&&(i=nr(l),i=l<0?il(n+i,0):ol(i,n-1)),_t(e,Vi(t,3),i,!0)}function wo(e){return null!=e&&e.length?nn(e,1):[]}function xo(e){return e&&e.length?e[0]:void 0}var Mo=Mn(function(e){var t=dt(e,ni);return t.length&&t[0]===e[0]?_n(t):[]}),Fo=Mn(function(e){var t=Uo(e),l=dt(e,ni);return t===Uo(l)?t=void 0:l.pop(),l.length&&l[0]===e[0]?_n(l,Vi(t,2)):[]}),ko=Mn(function(e){var t=Uo(e),l=dt(e,ni);return(t="function"==typeof t?t:void 0)&&l.pop(),l.length&&l[0]===e[0]?_n(l,void 0,t):[]});function Uo(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}var Ho=Mn(Wo);function Wo(e,t){return e&&e.length&&t&&t.length?On(e,t):e}var Go=Gi(function(e,t){var l=null==e?0:e.length,n=$l(e,t);return Rn(e,dt(t,function(e){return io(e,l)?+e:e}).sort(vi)),n});function jo(e){return null==e?e:dl.call(e)}var Ko=Mn(function(e){return Xn(nn(e,1,Ma,!0))}),Yo=Mn(function(e){var t=Uo(e);return Ma(t)&&(t=void 0),Xn(nn(e,1,Ma,!0),Vi(t,2))}),$o=Mn(function(e){var t=Uo(e);return t="function"==typeof t?t:void 0,Xn(nn(e,1,Ma,!0),void 0,t)});function zo(e){if(!e||!e.length)return[];var t=0;return e=at(e,function(e){if(Ma(e))return t=il(e.length,t),!0}),bt(t,function(t){return dt(e,ht(t))})}function Vo(e,t){if(!e||!e.length)return[];var l=zo(e);return null==t?l:dt(l,function(e){return tt(t,void 0,e)})}var qo=Mn(function(e,t){return Ma(e)?Jl(e,t):[]}),Xo=Mn(function(e){return ti(at(e,Ma))}),Jo=Mn(function(e){var t=Uo(e);return Ma(t)&&(t=void 0),ti(at(e,Ma),Vi(t,2))}),Zo=Mn(function(e){var t=Uo(e);return t="function"==typeof t?t:void 0,ti(at(e,Ma),void 0,t)}),Qo=Mn(zo),ea=Mn(function(e){var t=e.length,l=t>1?e[t-1]:void 0;return l="function"==typeof l?(e.pop(),l):void 0,Vo(e,l)});function ta(e){var t=Cl(e);return t.__chain__=!0,t}function la(e,t){return t(e)}var na=Gi(function(e){var t=e.length,l=t?e[0]:0,n=this.__wrapped__,i=function(t){return $l(t,e)};return!(t>1||this.__actions__.length)&&n instanceof Ll&&io(l)?((n=n.slice(l,+l+(t?1:0))).__actions__.push({func:la,args:[i],thisArg:void 0}),new Il(n,this.__chain__).thru(function(e){return t&&!e.length&&e.push(void 0),e})):this.thru(i)}),ia=fi(function(e,t,l){he.call(e,l)?++e[l]:Yl(e,l,1)}),oa=Ti(Oo),aa=Ti(Ro);function ra(e,t){return(Ra(e)?nt:Zl)(e,Vi(t,3))}function ua(e,t){return(Ra(e)?it:Ql)(e,Vi(t,3))}var da=fi(function(e,t,l){he.call(e,l)?e[l].push(t):Yl(e,l,[t])}),sa=Mn(function(e,t,l){var n=-1,i="function"==typeof t,o=xa(e)?y(e.length):[];return Zl(e,function(e){o[++n]=i?tt(t,e,l):fn(e,t,l)}),o}),ca=fi(function(e,t,l){Yl(e,l,t)});function va(e,t){return(Ra(e)?dt:bn)(e,Vi(t,3))}var pa=fi(function(e,t,l){e[l?0:1].push(t)},function(){return[[],[]]}),ma=Mn(function(e,t){if(null==e)return[];var l=t.length;return l>1&&oo(e,t[0],t[1])?t=[]:l>2&&oo(t[0],t[1],t[2])&&(t=[t[0]]),Ln(e,nn(t,1),[])}),Ea=qt||function(){return je.Date.now()};function _a(e,t,l){return t=l?void 0:t,Fi(e,128,void 0,void 0,void 0,void 0,t=e&&null==t?e.length:t)}function fa(e,t){var n;if("function"!=typeof t)throw new _e(l);return e=nr(e),function(){return--e>0&&(n=t.apply(this,arguments)),e<=1&&(t=void 0),n}}var Aa=Mn(function(e,t,l){var n=1;if(l.length){var i=Ut(l,zi(Aa));n|=32}return Fi(e,n,t,l,i)}),ga=Mn(function(e,t,l){var n=3;if(l.length){var i=Ut(l,zi(ga));n|=32}return Fi(t,n,e,l,i)});function Sa(e,t,n){var i,o,a,r,u,d,s=0,c=!1,v=!1,p=!0;if("function"!=typeof e)throw new _e(l);function m(t){var l=i,n=o;return i=o=void 0,s=t,r=e.apply(n,l)}function E(e){return s=e,u=Ao(f,t),c?m(e):r}function _(e){var l=e-d;return void 0===d||l>=t||l<0||v&&e-s>=a}function f(){var e=Ea();if(_(e))return A(e);u=Ao(f,function(e){var l=t-(e-d);return v?ol(l,a-(e-s)):l}(e))}function A(e){return u=void 0,p&&i?m(e):(i=o=void 0,r)}function g(){var e=Ea(),l=_(e);if(i=arguments,o=this,d=e,l){if(void 0===u)return E(d);if(v)return ui(u),u=Ao(f,t),m(d)}return void 0===u&&(u=Ao(f,t)),r}return t=or(t)||0,ja(n)&&(c=!!n.leading,a=(v="maxWait"in n)?il(or(n.maxWait)||0,t):a,p="trailing"in n?!!n.trailing:p),g.cancel=function(){void 0!==u&&ui(u),s=0,i=d=o=u=void 0},g.flush=function(){return void 0===u?r:A(Ea())},g}var ha=Mn(function(e,t){return Xl(e,1,t)}),ya=Mn(function(e,t,l){return Xl(e,or(t)||0,l)});function Da(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new _e(l);var n=function(){var l=arguments,i=t?t.apply(this,l):l[0],o=n.cache;if(o.has(i))return o.get(i);var a=e.apply(this,l);return n.cache=o.set(i,a)||o,a};return n.cache=new(Da.Cache||Rl),n}function Ta(e){if("function"!=typeof e)throw new _e(l);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)}}Da.Cache=Rl;var ba=ai(function(e,t){var l=(t=1==t.length&&Ra(t[0])?dt(t[0],Pt(Vi())):dt(nn(t,1),Pt(Vi()))).length;return Mn(function(n){for(var i=-1,o=ol(n.length,l);++i<o;)n[i]=t[i].call(this,n[i]);return tt(e,this,n)})}),Ca=Mn(function(e,t){return Fi(e,32,void 0,t,Ut(t,zi(Ca)))}),Pa=Mn(function(e,t){return Fi(e,64,void 0,t,Ut(t,zi(Pa)))}),Na=Gi(function(e,t){return Fi(e,256,void 0,void 0,void 0,t)});function Ia(e,t){return e===t||e!=e&&t!=t}var La=Oi(pn),Ba=Oi(function(e,t){return e>=t}),Oa=An(function(){return arguments}())?An:function(e){return Ka(e)&&he.call(e,"callee")&&!Ye.call(e,"callee")},Ra=y.isArray,wa=qe?Pt(qe):function(e){return Ka(e)&&vn(e)==S};function xa(e){return null!=e&&Ga(e.length)&&!Ha(e)}function Ma(e){return Ka(e)&&xa(e)}var Fa=el||ou,ka=Xe?Pt(Xe):function(e){return Ka(e)&&vn(e)==u};function Ua(e){if(!Ka(e))return!1;var t=vn(e);return t==d||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!za(e)}function Ha(e){if(!ja(e))return!1;var t=vn(e);return t==s||t==c||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Wa(e){return"number"==typeof e&&e==nr(e)}function Ga(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}function ja(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function Ka(e){return null!=e&&"object"==typeof e}var Ya=Je?Pt(Je):function(e){return Ka(e)&&eo(e)==v};function $a(e){return"number"==typeof e||Ka(e)&&vn(e)==p}function za(e){if(!Ka(e)||vn(e)!=m)return!1;var t=Ge(e);if(null===t)return!0;var l=he.call(t,"constructor")&&t.constructor;return"function"==typeof l&&l instanceof l&&Se.call(l)==be}var Va=Ze?Pt(Ze):function(e){return Ka(e)&&vn(e)==E},qa=Qe?Pt(Qe):function(e){return Ka(e)&&eo(e)==_};function Xa(e){return"string"==typeof e||!Ra(e)&&Ka(e)&&vn(e)==f}function Ja(e){return"symbol"==typeof e||Ka(e)&&vn(e)==A}var Za=et?Pt(et):function(e){return Ka(e)&&Ga(e.length)&&!!Me[vn(e)]},Qa=Oi(Tn),er=Oi(function(e,t){return e<=t});function tr(e){if(!e)return[];if(xa(e))return Xa(e)?jt(e):Ei(e);if(mt&&e[mt])return function(e){for(var t,l=[];!(t=e.next()).done;)l.push(t.value);return l}(e[mt]());var t=eo(e);return(t==v?Ft:t==_?Ht:Ir)(e)}function lr(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 nr(e){var t=lr(e),l=t%1;return t==t?l?t-l:t:0}function ir(e){return e?zl(nr(e),0,4294967295):0}function or(e){if("number"==typeof e)return e;if(Ja(e))return NaN;if(ja(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=ja(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Ct(e);var l=ne.test(e);return l||oe.test(e)?He(e.slice(2),l?2:8):le.test(e)?NaN:+e}function ar(e){return _i(e,hr(e))}function rr(e){return null==e?"":qn(e)}var ur=Ai(function(e,t){if(so(t)||xa(t))_i(t,Sr(t),e);else for(var l in t)he.call(t,l)&&Wl(e,l,t[l])}),dr=Ai(function(e,t){_i(t,hr(t),e)}),sr=Ai(function(e,t,l,n){_i(t,hr(t),e,n)}),cr=Ai(function(e,t,l,n){_i(t,Sr(t),e,n)}),vr=Gi($l),pr=Mn(function(e,t){e=pe(e);var l=-1,n=t.length,i=n>2?t[2]:void 0;for(i&&oo(t[0],t[1],i)&&(n=1);++l<n;)for(var o=t[l],a=hr(o),r=-1,u=a.length;++r<u;){var d=a[r],s=e[d];(void 0===s||Ia(s,Ae[d])&&!he.call(e,d))&&(e[d]=o[d])}return e}),mr=Mn(function(e){return e.push(void 0,Ui),tt(Dr,void 0,e)});function Er(e,t,l){var n=null==e?void 0:sn(e,t);return void 0===n?l:n}function _r(e,t){return null!=e&&to(e,t,En)}var fr=Pi(function(e,t,l){null!=t&&"function"!=typeof t.toString&&(t=Te.call(t)),e[t]=l},jr($r)),Ar=Pi(function(e,t,l){null!=t&&"function"!=typeof t.toString&&(t=Te.call(t)),he.call(e,t)?e[t].push(l):e[t]=[l]},Vi),gr=Mn(fn);function Sr(e){return xa(e)?Ml(e):Dn(e)}function hr(e){return xa(e)?Ml(e,!0):function(e){if(!ja(e))return function(e){var t=[];if(null!=e)for(var l in pe(e))t.push(l);return t}(e);var t=so(e),l=[];for(var n in e)("constructor"!=n||!t&&he.call(e,n))&&l.push(n);return l}(e)}var yr=Ai(function(e,t,l){Nn(e,t,l)}),Dr=Ai(function(e,t,l,n){Nn(e,t,l,n)}),Tr=Gi(function(e,t){var l={};if(null==e)return l;var n=!1;t=dt(t,function(t){return t=oi(t,e),n||(n=t.length>1),t}),_i(e,Ki(e),l),n&&(l=Vl(l,7,Hi));for(var i=t.length;i--;)Jn(l,t[i]);return l}),br=Gi(function(e,t){return null==e?{}:function(e,t){return Bn(e,t,function(t,l){return _r(e,l)})}(e,t)});function Cr(e,t){if(null==e)return{};var l=dt(Ki(e),function(e){return[e]});return t=Vi(t),Bn(e,l,function(e,l){return t(e,l[0])})}var Pr=Mi(Sr),Nr=Mi(hr);function Ir(e){return null==e?[]:Nt(e,Sr(e))}var Lr=yi(function(e,t,l){return t=t.toLowerCase(),e+(l?Br(t):t)});function Br(e){return Ur(rr(e).toLowerCase())}function Or(e){return(e=rr(e))&&e.replace(re,Rt).replace(Ie,"")}var Rr=yi(function(e,t,l){return e+(l?"-":"")+t.toLowerCase()}),wr=yi(function(e,t,l){return e+(l?" ":"")+t.toLowerCase()}),xr=hi("toLowerCase"),Mr=yi(function(e,t,l){return e+(l?"_":"")+t.toLowerCase()}),Fr=yi(function(e,t,l){return e+(l?" ":"")+Ur(t)}),kr=yi(function(e,t,l){return e+(l?" ":"")+t.toUpperCase()}),Ur=hi("toUpperCase");function Hr(e,t,l){return e=rr(e),void 0===(t=l?void 0:t)?function(e){return Re.test(e)}(e)?function(e){return e.match(Be)||[]}(e):function(e){return e.match(J)||[]}(e):e.match(t)||[]}var Wr=Mn(function(e,t){try{return tt(e,void 0,t)}catch(e){return Ua(e)?e:new se(e)}}),Gr=Gi(function(e,t){return nt(t,function(t){t=Co(t),Yl(e,t,Aa(e[t],e))}),e});function jr(e){return function(){return e}}var Kr=bi(),Yr=bi(!0);function $r(e){return e}function zr(e){return yn("function"==typeof e?e:Vl(e,1))}var Vr=Mn(function(e,t){return function(l){return fn(l,e,t)}}),qr=Mn(function(e,t){return function(l){return fn(e,l,t)}});function Xr(e,t,l){var n=Sr(t),i=dn(t,n);null!=l||ja(t)&&(i.length||!n.length)||(l=t,t=e,e=this,i=dn(t,Sr(t)));var o=!(ja(l)&&"chain"in l&&!l.chain),a=Ha(e);return nt(i,function(l){var n=t[l];e[l]=n,a&&(e.prototype[l]=function(){var t=this.__chain__;if(o||t){var l=e(this.__wrapped__),i=l.__actions__=Ei(this.__actions__);return i.push({func:n,args:arguments,thisArg:e}),l.__chain__=t,l}return n.apply(e,st([this.value()],arguments))})}),e}function Jr(){}var Zr=Ii(dt),Qr=Ii(ot),eu=Ii(pt);function tu(e){return ao(e)?ht(Co(e)):function(e){return function(t){return sn(t,e)}}(e)}var lu=Bi(),nu=Bi(!0);function iu(){return[]}function ou(){return!1}var au,ru=Ni(function(e,t){return e+t},0),uu=wi("ceil"),du=Ni(function(e,t){return e/t},1),su=wi("floor"),cu=Ni(function(e,t){return e*t},1),vu=wi("round"),pu=Ni(function(e,t){return e-t},0);return Cl.after=function(e,t){if("function"!=typeof t)throw new _e(l);return e=nr(e),function(){if(--e<1)return t.apply(this,arguments)}},Cl.ary=_a,Cl.assign=ur,Cl.assignIn=dr,Cl.assignInWith=sr,Cl.assignWith=cr,Cl.at=vr,Cl.before=fa,Cl.bind=Aa,Cl.bindAll=Gr,Cl.bindKey=ga,Cl.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return Ra(e)?e:[e]},Cl.chain=ta,Cl.chunk=function(e,t,l){t=(l?oo(e,t,l):void 0===t)?1:il(nr(t),0);var n=null==e?0:e.length;if(!n||t<1)return[];for(var i=0,o=0,a=y(Jt(n/t));i<n;)a[o++]=jn(e,i,i+=t);return a},Cl.compact=function(e){for(var t=-1,l=null==e?0:e.length,n=0,i=[];++t<l;){var o=e[t];o&&(i[n++]=o)}return i},Cl.concat=function(){var e=arguments.length;if(!e)return[];for(var t=y(e-1),l=arguments[0],n=e;n--;)t[n-1]=arguments[n];return st(Ra(l)?Ei(l):[l],nn(t,1))},Cl.cond=function(e){var t=null==e?0:e.length,n=Vi();return e=t?dt(e,function(e){if("function"!=typeof e[1])throw new _e(l);return[n(e[0]),e[1]]}):[],Mn(function(l){for(var n=-1;++n<t;){var i=e[n];if(tt(i[0],this,l))return tt(i[1],this,l)}})},Cl.conforms=function(e){return function(e){var t=Sr(e);return function(l){return ql(l,e,t)}}(Vl(e,1))},Cl.constant=jr,Cl.countBy=ia,Cl.create=function(e,t){var l=Pl(e);return null==t?l:Kl(l,t)},Cl.curry=function e(t,l,n){var i=Fi(t,8,void 0,void 0,void 0,void 0,void 0,l=n?void 0:l);return i.placeholder=e.placeholder,i},Cl.curryRight=function e(t,l,n){var i=Fi(t,16,void 0,void 0,void 0,void 0,void 0,l=n?void 0:l);return i.placeholder=e.placeholder,i},Cl.debounce=Sa,Cl.defaults=pr,Cl.defaultsDeep=mr,Cl.defer=ha,Cl.delay=ya,Cl.difference=Io,Cl.differenceBy=Lo,Cl.differenceWith=Bo,Cl.drop=function(e,t,l){var n=null==e?0:e.length;return n?jn(e,(t=l||void 0===t?1:nr(t))<0?0:t,n):[]},Cl.dropRight=function(e,t,l){var n=null==e?0:e.length;return n?jn(e,0,(t=n-(t=l||void 0===t?1:nr(t)))<0?0:t):[]},Cl.dropRightWhile=function(e,t){return e&&e.length?Qn(e,Vi(t,3),!0,!0):[]},Cl.dropWhile=function(e,t){return e&&e.length?Qn(e,Vi(t,3),!0):[]},Cl.fill=function(e,t,l,n){var i=null==e?0:e.length;return i?(l&&"number"!=typeof l&&oo(e,t,l)&&(l=0,n=i),function(e,t,l,n){var i=e.length;for((l=nr(l))<0&&(l=-l>i?0:i+l),(n=void 0===n||n>i?i:nr(n))<0&&(n+=i),n=l>n?0:ir(n);l<n;)e[l++]=t;return e}(e,t,l,n)):[]},Cl.filter=function(e,t){return(Ra(e)?at:ln)(e,Vi(t,3))},Cl.flatMap=function(e,t){return nn(va(e,t),1)},Cl.flatMapDeep=function(e,t){return nn(va(e,t),1/0)},Cl.flatMapDepth=function(e,t,l){return l=void 0===l?1:nr(l),nn(va(e,t),l)},Cl.flatten=wo,Cl.flattenDeep=function(e){return null!=e&&e.length?nn(e,1/0):[]},Cl.flattenDepth=function(e,t){return null!=e&&e.length?nn(e,t=void 0===t?1:nr(t)):[]},Cl.flip=function(e){return Fi(e,512)},Cl.flow=Kr,Cl.flowRight=Yr,Cl.fromPairs=function(e){for(var t=-1,l=null==e?0:e.length,n={};++t<l;){var i=e[t];n[i[0]]=i[1]}return n},Cl.functions=function(e){return null==e?[]:dn(e,Sr(e))},Cl.functionsIn=function(e){return null==e?[]:dn(e,hr(e))},Cl.groupBy=da,Cl.initial=function(e){return null!=e&&e.length?jn(e,0,-1):[]},Cl.intersection=Mo,Cl.intersectionBy=Fo,Cl.intersectionWith=ko,Cl.invert=fr,Cl.invertBy=Ar,Cl.invokeMap=sa,Cl.iteratee=zr,Cl.keyBy=ca,Cl.keys=Sr,Cl.keysIn=hr,Cl.map=va,Cl.mapKeys=function(e,t){var l={};return t=Vi(t,3),rn(e,function(e,n,i){Yl(l,t(e,n,i),e)}),l},Cl.mapValues=function(e,t){var l={};return t=Vi(t,3),rn(e,function(e,n,i){Yl(l,n,t(e,n,i))}),l},Cl.matches=function(e){return Cn(Vl(e,1))},Cl.matchesProperty=function(e,t){return Pn(e,Vl(t,1))},Cl.memoize=Da,Cl.merge=yr,Cl.mergeWith=Dr,Cl.method=Vr,Cl.methodOf=qr,Cl.mixin=Xr,Cl.negate=Ta,Cl.nthArg=function(e){return e=nr(e),Mn(function(t){return In(t,e)})},Cl.omit=Tr,Cl.omitBy=function(e,t){return Cr(e,Ta(Vi(t)))},Cl.once=function(e){return fa(2,e)},Cl.orderBy=function(e,t,l,n){return null==e?[]:(Ra(t)||(t=null==t?[]:[t]),Ra(l=n?void 0:l)||(l=null==l?[]:[l]),Ln(e,t,l))},Cl.over=Zr,Cl.overArgs=ba,Cl.overEvery=Qr,Cl.overSome=eu,Cl.partial=Ca,Cl.partialRight=Pa,Cl.partition=pa,Cl.pick=br,Cl.pickBy=Cr,Cl.property=tu,Cl.propertyOf=function(e){return function(t){return null==e?void 0:sn(e,t)}},Cl.pull=Ho,Cl.pullAll=Wo,Cl.pullAllBy=function(e,t,l){return e&&e.length&&t&&t.length?On(e,t,Vi(l,2)):e},Cl.pullAllWith=function(e,t,l){return e&&e.length&&t&&t.length?On(e,t,void 0,l):e},Cl.pullAt=Go,Cl.range=lu,Cl.rangeRight=nu,Cl.rearg=Na,Cl.reject=function(e,t){return(Ra(e)?at:ln)(e,Ta(Vi(t,3)))},Cl.remove=function(e,t){var l=[];if(!e||!e.length)return l;var n=-1,i=[],o=e.length;for(t=Vi(t,3);++n<o;){var a=e[n];t(a,n,e)&&(l.push(a),i.push(n))}return Rn(e,i),l},Cl.rest=function(e,t){if("function"!=typeof e)throw new _e(l);return Mn(e,t=void 0===t?t:nr(t))},Cl.reverse=jo,Cl.sampleSize=function(e,t,l){return t=(l?oo(e,t,l):void 0===t)?1:nr(t),(Ra(e)?kl:kn)(e,t)},Cl.set=function(e,t,l){return null==e?e:Un(e,t,l)},Cl.setWith=function(e,t,l,n){return n="function"==typeof n?n:void 0,null==e?e:Un(e,t,l,n)},Cl.shuffle=function(e){return(Ra(e)?Ul:Gn)(e)},Cl.slice=function(e,t,l){var n=null==e?0:e.length;return n?(l&&"number"!=typeof l&&oo(e,t,l)?(t=0,l=n):(t=null==t?0:nr(t),l=void 0===l?n:nr(l)),jn(e,t,l)):[]},Cl.sortBy=ma,Cl.sortedUniq=function(e){return e&&e.length?zn(e):[]},Cl.sortedUniqBy=function(e,t){return e&&e.length?zn(e,Vi(t,2)):[]},Cl.split=function(e,t,l){return l&&"number"!=typeof l&&oo(e,t,l)&&(t=l=void 0),(l=void 0===l?4294967295:l>>>0)?(e=rr(e))&&("string"==typeof t||null!=t&&!Va(t))&&!(t=qn(t))&&Mt(e)?ri(jt(e),0,l):e.split(t,l):[]},Cl.spread=function(e,t){if("function"!=typeof e)throw new _e(l);return t=null==t?0:il(nr(t),0),Mn(function(l){var n=l[t],i=ri(l,0,t);return n&&st(i,n),tt(e,this,i)})},Cl.tail=function(e){var t=null==e?0:e.length;return t?jn(e,1,t):[]},Cl.take=function(e,t,l){return e&&e.length?jn(e,0,(t=l||void 0===t?1:nr(t))<0?0:t):[]},Cl.takeRight=function(e,t,l){var n=null==e?0:e.length;return n?jn(e,(t=n-(t=l||void 0===t?1:nr(t)))<0?0:t,n):[]},Cl.takeRightWhile=function(e,t){return e&&e.length?Qn(e,Vi(t,3),!1,!0):[]},Cl.takeWhile=function(e,t){return e&&e.length?Qn(e,Vi(t,3)):[]},Cl.tap=function(e,t){return t(e),e},Cl.throttle=function(e,t,n){var i=!0,o=!0;if("function"!=typeof e)throw new _e(l);return ja(n)&&(i="leading"in n?!!n.leading:i,o="trailing"in n?!!n.trailing:o),Sa(e,t,{leading:i,maxWait:t,trailing:o})},Cl.thru=la,Cl.toArray=tr,Cl.toPairs=Pr,Cl.toPairsIn=Nr,Cl.toPath=function(e){return Ra(e)?dt(e,Co):Ja(e)?[e]:Ei(bo(rr(e)))},Cl.toPlainObject=ar,Cl.transform=function(e,t,l){var n=Ra(e),i=n||Fa(e)||Za(e);if(t=Vi(t,4),null==l){var o=e&&e.constructor;l=i?n?new o:[]:ja(e)&&Ha(o)?Pl(Ge(e)):{}}return(i?nt:rn)(e,function(e,n,i){return t(l,e,n,i)}),l},Cl.unary=function(e){return _a(e,1)},Cl.union=Ko,Cl.unionBy=Yo,Cl.unionWith=$o,Cl.uniq=function(e){return e&&e.length?Xn(e):[]},Cl.uniqBy=function(e,t){return e&&e.length?Xn(e,Vi(t,2)):[]},Cl.uniqWith=function(e,t){return t="function"==typeof t?t:void 0,e&&e.length?Xn(e,void 0,t):[]},Cl.unset=function(e,t){return null==e||Jn(e,t)},Cl.unzip=zo,Cl.unzipWith=Vo,Cl.update=function(e,t,l){return null==e?e:Zn(e,t,ii(l))},Cl.updateWith=function(e,t,l,n){return n="function"==typeof n?n:void 0,null==e?e:Zn(e,t,ii(l),n)},Cl.values=Ir,Cl.valuesIn=function(e){return null==e?[]:Nt(e,hr(e))},Cl.without=qo,Cl.words=Hr,Cl.wrap=function(e,t){return Ca(ii(t),e)},Cl.xor=Xo,Cl.xorBy=Jo,Cl.xorWith=Zo,Cl.zip=Qo,Cl.zipObject=function(e,t){return li(e||[],t||[],Wl)},Cl.zipObjectDeep=function(e,t){return li(e||[],t||[],Un)},Cl.zipWith=ea,Cl.entries=Pr,Cl.entriesIn=Nr,Cl.extend=dr,Cl.extendWith=sr,Xr(Cl,Cl),Cl.add=ru,Cl.attempt=Wr,Cl.camelCase=Lr,Cl.capitalize=Br,Cl.ceil=uu,Cl.clamp=function(e,t,l){return void 0===l&&(l=t,t=void 0),void 0!==l&&(l=(l=or(l))==l?l:0),void 0!==t&&(t=(t=or(t))==t?t:0),zl(or(e),t,l)},Cl.clone=function(e){return Vl(e,4)},Cl.cloneDeep=function(e){return Vl(e,5)},Cl.cloneDeepWith=function(e,t){return Vl(e,5,t="function"==typeof t?t:void 0)},Cl.cloneWith=function(e,t){return Vl(e,4,t="function"==typeof t?t:void 0)},Cl.conformsTo=function(e,t){return null==t||ql(e,t,Sr(t))},Cl.deburr=Or,Cl.defaultTo=function(e,t){return null==e||e!=e?t:e},Cl.divide=du,Cl.endsWith=function(e,t,l){e=rr(e),t=qn(t);var n=e.length,i=l=void 0===l?n:zl(nr(l),0,n);return(l-=t.length)>=0&&e.slice(l,i)==t},Cl.eq=Ia,Cl.escape=function(e){return(e=rr(e))&&F.test(e)?e.replace(x,wt):e},Cl.escapeRegExp=function(e){return(e=rr(e))&&Y.test(e)?e.replace(K,"\\$&"):e},Cl.every=function(e,t,l){var n=Ra(e)?ot:en;return l&&oo(e,t,l)&&(t=void 0),n(e,Vi(t,3))},Cl.find=oa,Cl.findIndex=Oo,Cl.findKey=function(e,t){return Et(e,Vi(t,3),rn)},Cl.findLast=aa,Cl.findLastIndex=Ro,Cl.findLastKey=function(e,t){return Et(e,Vi(t,3),un)},Cl.floor=su,Cl.forEach=ra,Cl.forEachRight=ua,Cl.forIn=function(e,t){return null==e?e:on(e,Vi(t,3),hr)},Cl.forInRight=function(e,t){return null==e?e:an(e,Vi(t,3),hr)},Cl.forOwn=function(e,t){return e&&rn(e,Vi(t,3))},Cl.forOwnRight=function(e,t){return e&&un(e,Vi(t,3))},Cl.get=Er,Cl.gt=La,Cl.gte=Ba,Cl.has=function(e,t){return null!=e&&to(e,t,mn)},Cl.hasIn=_r,Cl.head=xo,Cl.identity=$r,Cl.includes=function(e,t,l,n){e=xa(e)?e:Ir(e),l=l&&!n?nr(l):0;var i=e.length;return l<0&&(l=il(i+l,0)),Xa(e)?l<=i&&e.indexOf(t,l)>-1:!!i&&ft(e,t,l)>-1},Cl.indexOf=function(e,t,l){var n=null==e?0:e.length;if(!n)return-1;var i=null==l?0:nr(l);return i<0&&(i=il(n+i,0)),ft(e,t,i)},Cl.inRange=function(e,t,l){return t=lr(t),void 0===l?(l=t,t=0):l=lr(l),function(e,t,l){return e>=ol(t,l)&&e<il(t,l)}(e=or(e),t,l)},Cl.invoke=gr,Cl.isArguments=Oa,Cl.isArray=Ra,Cl.isArrayBuffer=wa,Cl.isArrayLike=xa,Cl.isArrayLikeObject=Ma,Cl.isBoolean=function(e){return!0===e||!1===e||Ka(e)&&vn(e)==r},Cl.isBuffer=Fa,Cl.isDate=ka,Cl.isElement=function(e){return Ka(e)&&1===e.nodeType&&!za(e)},Cl.isEmpty=function(e){if(null==e)return!0;if(xa(e)&&(Ra(e)||"string"==typeof e||"function"==typeof e.splice||Fa(e)||Za(e)||Oa(e)))return!e.length;var t=eo(e);if(t==v||t==_)return!e.size;if(so(e))return!Dn(e).length;for(var l in e)if(he.call(e,l))return!1;return!0},Cl.isEqual=function(e,t){return gn(e,t)},Cl.isEqualWith=function(e,t,l){var n=(l="function"==typeof l?l:void 0)?l(e,t):void 0;return void 0===n?gn(e,t,void 0,l):!!n},Cl.isError=Ua,Cl.isFinite=function(e){return"number"==typeof e&&tl(e)},Cl.isFunction=Ha,Cl.isInteger=Wa,Cl.isLength=Ga,Cl.isMap=Ya,Cl.isMatch=function(e,t){return e===t||Sn(e,t,Xi(t))},Cl.isMatchWith=function(e,t,l){return l="function"==typeof l?l:void 0,Sn(e,t,Xi(t),l)},Cl.isNaN=function(e){return $a(e)&&e!=+e},Cl.isNative=function(e){if(uo(e))throw new se("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return hn(e)},Cl.isNil=function(e){return null==e},Cl.isNull=function(e){return null===e},Cl.isNumber=$a,Cl.isObject=ja,Cl.isObjectLike=Ka,Cl.isPlainObject=za,Cl.isRegExp=Va,Cl.isSafeInteger=function(e){return Wa(e)&&e>=-9007199254740991&&e<=9007199254740991},Cl.isSet=qa,Cl.isString=Xa,Cl.isSymbol=Ja,Cl.isTypedArray=Za,Cl.isUndefined=function(e){return void 0===e},Cl.isWeakMap=function(e){return Ka(e)&&eo(e)==g},Cl.isWeakSet=function(e){return Ka(e)&&"[object WeakSet]"==vn(e)},Cl.join=function(e,t){return null==e?"":ll.call(e,t)},Cl.kebabCase=Rr,Cl.last=Uo,Cl.lastIndexOf=function(e,t,l){var n=null==e?0:e.length;if(!n)return-1;var i=n;return void 0!==l&&(i=(i=nr(l))<0?il(n+i,0):ol(i,n-1)),t==t?function(e,t,l){for(var n=l+1;n--;)if(e[n]===t)return n;return n}(e,t,i):_t(e,gt,i,!0)},Cl.lowerCase=wr,Cl.lowerFirst=xr,Cl.lt=Qa,Cl.lte=er,Cl.max=function(e){return e&&e.length?tn(e,$r,pn):void 0},Cl.maxBy=function(e,t){return e&&e.length?tn(e,Vi(t,2),pn):void 0},Cl.mean=function(e){return St(e,$r)},Cl.meanBy=function(e,t){return St(e,Vi(t,2))},Cl.min=function(e){return e&&e.length?tn(e,$r,Tn):void 0},Cl.minBy=function(e,t){return e&&e.length?tn(e,Vi(t,2),Tn):void 0},Cl.stubArray=iu,Cl.stubFalse=ou,Cl.stubObject=function(){return{}},Cl.stubString=function(){return""},Cl.stubTrue=function(){return!0},Cl.multiply=cu,Cl.nth=function(e,t){return e&&e.length?In(e,nr(t)):void 0},Cl.noConflict=function(){return je._===this&&(je._=Ce),this},Cl.noop=Jr,Cl.now=Ea,Cl.pad=function(e,t,l){e=rr(e);var n=(t=nr(t))?Gt(e):0;if(!t||n>=t)return e;var i=(t-n)/2;return Li(Zt(i),l)+e+Li(Jt(i),l)},Cl.padEnd=function(e,t,l){e=rr(e);var n=(t=nr(t))?Gt(e):0;return t&&n<t?e+Li(t-n,l):e},Cl.padStart=function(e,t,l){e=rr(e);var n=(t=nr(t))?Gt(e):0;return t&&n<t?Li(t-n,l)+e:e},Cl.parseInt=function(e,t,l){return l||null==t?t=0:t&&(t=+t),rl(rr(e).replace($,""),t||0)},Cl.random=function(e,t,l){if(l&&"boolean"!=typeof l&&oo(e,t,l)&&(t=l=void 0),void 0===l&&("boolean"==typeof t?(l=t,t=void 0):"boolean"==typeof e&&(l=e,e=void 0)),void 0===e&&void 0===t?(e=0,t=1):(e=lr(e),void 0===t?(t=e,e=0):t=lr(t)),e>t){var n=e;e=t,t=n}if(l||e%1||t%1){var i=ul();return ol(e+i*(t-e+Ue("1e-"+((i+"").length-1))),t)}return wn(e,t)},Cl.reduce=function(e,t,l){var n=Ra(e)?ct:Dt,i=arguments.length<3;return n(e,Vi(t,4),l,i,Zl)},Cl.reduceRight=function(e,t,l){var n=Ra(e)?vt:Dt,i=arguments.length<3;return n(e,Vi(t,4),l,i,Ql)},Cl.repeat=function(e,t,l){return t=(l?oo(e,t,l):void 0===t)?1:nr(t),xn(rr(e),t)},Cl.replace=function(){var e=arguments,t=rr(e[0]);return e.length<3?t:t.replace(e[1],e[2])},Cl.result=function(e,t,l){var n=-1,i=(t=oi(t,e)).length;for(i||(i=1,e=void 0);++n<i;){var o=null==e?void 0:e[Co(t[n])];void 0===o&&(n=i,o=l),e=Ha(o)?o.call(e):o}return e},Cl.round=vu,Cl.runInContext=e,Cl.sample=function(e){return(Ra(e)?Fl:Fn)(e)},Cl.size=function(e){if(null==e)return 0;if(xa(e))return Xa(e)?Gt(e):e.length;var t=eo(e);return t==v||t==_?e.size:Dn(e).length},Cl.snakeCase=Mr,Cl.some=function(e,t,l){var n=Ra(e)?pt:Kn;return l&&oo(e,t,l)&&(t=void 0),n(e,Vi(t,3))},Cl.sortedIndex=function(e,t){return Yn(e,t)},Cl.sortedIndexBy=function(e,t,l){return $n(e,t,Vi(l,2))},Cl.sortedIndexOf=function(e,t){var l=null==e?0:e.length;if(l){var n=Yn(e,t);if(n<l&&Ia(e[n],t))return n}return-1},Cl.sortedLastIndex=function(e,t){return Yn(e,t,!0)},Cl.sortedLastIndexBy=function(e,t,l){return $n(e,t,Vi(l,2),!0)},Cl.sortedLastIndexOf=function(e,t){if(null!=e&&e.length){var l=Yn(e,t,!0)-1;if(Ia(e[l],t))return l}return-1},Cl.startCase=Fr,Cl.startsWith=function(e,t,l){return e=rr(e),l=null==l?0:zl(nr(l),0,e.length),t=qn(t),e.slice(l,l+t.length)==t},Cl.subtract=pu,Cl.sum=function(e){return e&&e.length?Tt(e,$r):0},Cl.sumBy=function(e,t){return e&&e.length?Tt(e,Vi(t,2)):0},Cl.template=function(e,t,l){var n=Cl.templateSettings;l&&oo(e,t,l)&&(t=void 0),e=rr(e),t=sr({},t,n,ki);var i,o,a=sr({},t.imports,n.imports,ki),r=Sr(a),u=Nt(a,r),d=0,s=t.interpolate||ue,c="__p += '",v=me((t.escape||ue).source+"|"+s.source+"|"+(s===H?ee:ue).source+"|"+(t.evaluate||ue).source+"|$","g"),p="//# sourceURL="+(he.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++xe+"]")+"\n";e.replace(v,function(t,l,n,a,r,u){return n||(n=a),c+=e.slice(d,u).replace(de,xt),l&&(i=!0,c+="' +\n__e("+l+") +\n'"),r&&(o=!0,c+="';\n"+r+";\n__p += '"),n&&(c+="' +\n((__t = ("+n+")) == null ? '' : __t) +\n'"),d=u+t.length,t}),c+="';\n";var m=he.call(t,"variable")&&t.variable;if(m){if(Z.test(m))throw new se("Invalid `variable` option passed into `_.template`")}else c="with (obj) {\n"+c+"\n}\n";c=(o?c.replace(B,""):c).replace(O,"$1").replace(R,"$1;"),c="function("+(m||"obj")+") {\n"+(m?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(i?", __e = _.escape":"")+(o?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+c+"return __p\n}";var E=Wr(function(){return ce(r,p+"return "+c).apply(void 0,u)});if(E.source=c,Ua(E))throw E;return E},Cl.times=function(e,t){if((e=nr(e))<1||e>9007199254740991)return[];var l=4294967295,n=ol(e,4294967295);e-=4294967295;for(var i=bt(n,t=Vi(t));++l<e;)t(l);return i},Cl.toFinite=lr,Cl.toInteger=nr,Cl.toLength=ir,Cl.toLower=function(e){return rr(e).toLowerCase()},Cl.toNumber=or,Cl.toSafeInteger=function(e){return e?zl(nr(e),-9007199254740991,9007199254740991):0===e?e:0},Cl.toString=rr,Cl.toUpper=function(e){return rr(e).toUpperCase()},Cl.trim=function(e,t,l){if((e=rr(e))&&(l||void 0===t))return Ct(e);if(!e||!(t=qn(t)))return e;var n=jt(e),i=jt(t);return ri(n,Lt(n,i),Bt(n,i)+1).join("")},Cl.trimEnd=function(e,t,l){if((e=rr(e))&&(l||void 0===t))return e.slice(0,Kt(e)+1);if(!e||!(t=qn(t)))return e;var n=jt(e);return ri(n,0,Bt(n,jt(t))+1).join("")},Cl.trimStart=function(e,t,l){if((e=rr(e))&&(l||void 0===t))return e.replace($,"");if(!e||!(t=qn(t)))return e;var n=jt(e);return ri(n,Lt(n,jt(t))).join("")},Cl.truncate=function(e,t){var l=30,n="...";if(ja(t)){var i="separator"in t?t.separator:i;l="length"in t?nr(t.length):l,n="omission"in t?qn(t.omission):n}var o=(e=rr(e)).length;if(Mt(e)){var a=jt(e);o=a.length}if(l>=o)return e;var r=l-Gt(n);if(r<1)return n;var u=a?ri(a,0,r).join(""):e.slice(0,r);if(void 0===i)return u+n;if(a&&(r+=u.length-r),Va(i)){if(e.slice(r).search(i)){var d,s=u;for(i.global||(i=me(i.source,rr(te.exec(i))+"g")),i.lastIndex=0;d=i.exec(s);)var c=d.index;u=u.slice(0,void 0===c?r:c)}}else if(e.indexOf(qn(i),r)!=r){var v=u.lastIndexOf(i);v>-1&&(u=u.slice(0,v))}return u+n},Cl.unescape=function(e){return(e=rr(e))&&M.test(e)?e.replace(w,Yt):e},Cl.uniqueId=function(e){var t=++ye;return rr(e)+t},Cl.upperCase=kr,Cl.upperFirst=Ur,Cl.each=ra,Cl.eachRight=ua,Cl.first=xo,Xr(Cl,(au={},rn(Cl,function(e,t){he.call(Cl.prototype,t)||(au[t]=e)}),au),{chain:!1}),Cl.VERSION="4.17.21",nt(["bind","bindKey","curry","curryRight","partial","partialRight"],function(e){Cl[e].placeholder=Cl}),nt(["drop","take"],function(e,t){Ll.prototype[e]=function(l){l=void 0===l?1:il(nr(l),0);var n=this.__filtered__&&!t?new Ll(this):this.clone();return n.__filtered__?n.__takeCount__=ol(l,n.__takeCount__):n.__views__.push({size:ol(l,4294967295),type:e+(n.__dir__<0?"Right":"")}),n},Ll.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}}),nt(["filter","map","takeWhile"],function(e,t){var l=t+1,n=1==l||3==l;Ll.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:Vi(e,3),type:l}),t.__filtered__=t.__filtered__||n,t}}),nt(["head","last"],function(e,t){var l="take"+(t?"Right":"");Ll.prototype[e]=function(){return this[l](1).value()[0]}}),nt(["initial","tail"],function(e,t){var l="drop"+(t?"":"Right");Ll.prototype[e]=function(){return this.__filtered__?new Ll(this):this[l](1)}}),Ll.prototype.compact=function(){return this.filter($r)},Ll.prototype.find=function(e){return this.filter(e).head()},Ll.prototype.findLast=function(e){return this.reverse().find(e)},Ll.prototype.invokeMap=Mn(function(e,t){return"function"==typeof e?new Ll(this):this.map(function(l){return fn(l,e,t)})}),Ll.prototype.reject=function(e){return this.filter(Ta(Vi(e)))},Ll.prototype.slice=function(e,t){e=nr(e);var l=this;return l.__filtered__&&(e>0||t<0)?new Ll(l):(e<0?l=l.takeRight(-e):e&&(l=l.drop(e)),void 0!==t&&(l=(t=nr(t))<0?l.dropRight(-t):l.take(t-e)),l)},Ll.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},Ll.prototype.toArray=function(){return this.take(4294967295)},rn(Ll.prototype,function(e,t){var l=/^(?:filter|find|map|reject)|While$/.test(t),n=/^(?:head|last)$/.test(t),i=Cl[n?"take"+("last"==t?"Right":""):t],o=n||/^find/.test(t);i&&(Cl.prototype[t]=function(){var t=this.__wrapped__,a=n?[1]:arguments,r=t instanceof Ll,u=a[0],d=r||Ra(t),s=function(e){var t=i.apply(Cl,st([e],a));return n&&c?t[0]:t};d&&l&&"function"==typeof u&&1!=u.length&&(r=d=!1);var c=this.__chain__,v=!!this.__actions__.length,p=o&&!c,m=r&&!v;if(!o&&d){t=m?t:new Ll(this);var E=e.apply(t,a);return E.__actions__.push({func:la,args:[s],thisArg:void 0}),new Il(E,c)}return p&&m?e.apply(this,a):(E=this.thru(s),p?n?E.value()[0]:E.value():E)})}),nt(["pop","push","shift","sort","splice","unshift"],function(e){var t=fe[e],l=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",n=/^(?:pop|shift)$/.test(e);Cl.prototype[e]=function(){var e=arguments;if(n&&!this.__chain__){var i=this.value();return t.apply(Ra(i)?i:[],e)}return this[l](function(l){return t.apply(Ra(l)?l:[],e)})}}),rn(Ll.prototype,function(e,t){var l=Cl[t];if(l){var n=l.name+"";he.call(fl,n)||(fl[n]=[]),fl[n].push({name:t,func:l})}}),fl[Ci(void 0,2).name]=[{name:"wrapper",func:void 0}],Ll.prototype.clone=function(){var e=new Ll(this.__wrapped__);return e.__actions__=Ei(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=Ei(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=Ei(this.__views__),e},Ll.prototype.reverse=function(){if(this.__filtered__){var e=new Ll(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},Ll.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,l=Ra(e),n=t<0,i=l?e.length:0,o=function(e,t,l){for(var n=-1,i=l.length;++n<i;){var o=l[n],a=o.size;switch(o.type){case"drop":e+=a;break;case"dropRight":t-=a;break;case"take":t=ol(t,e+a);break;case"takeRight":e=il(e,t-a)}}return{start:e,end:t}}(0,i,this.__views__),a=o.start,r=o.end,u=r-a,d=n?r:a-1,s=this.__iteratees__,c=s.length,v=0,p=ol(u,this.__takeCount__);if(!l||!n&&i==u&&p==u)return ei(e,this.__actions__);var m=[];e:for(;u--&&v<p;){for(var E=-1,_=e[d+=t];++E<c;){var f=s[E],A=f.type,g=(0,f.iteratee)(_);if(2==A)_=g;else if(!g){if(1==A)continue e;break e}}m[v++]=_}return m},Cl.prototype.at=na,Cl.prototype.chain=function(){return ta(this)},Cl.prototype.commit=function(){return new Il(this.value(),this.__chain__)},Cl.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__++]}},Cl.prototype.plant=function(e){for(var t,l=this;l instanceof Nl;){var n=No(l);n.__index__=0,n.__values__=void 0,t?i.__wrapped__=n:t=n;var i=n;l=l.__wrapped__}return i.__wrapped__=e,t},Cl.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof Ll){var t=e;return this.__actions__.length&&(t=new Ll(this)),(t=t.reverse()).__actions__.push({func:la,args:[jo],thisArg:void 0}),new Il(t,this.__chain__)}return this.thru(jo)},Cl.prototype.toJSON=Cl.prototype.valueOf=Cl.prototype.value=function(){return ei(this.__wrapped__,this.__actions__)},Cl.prototype.first=Cl.prototype.head,mt&&(Cl.prototype[mt]=function(){return this}),Cl}();Ye?((Ye.exports=$t)._=$t,Ke._=$t):je._=$t}).call(y)});const In=e=>{var n,a;let{t:r,config:u,formData:d,setError:s,clearErrors:c,formState:v,index:p,setFieldReports:m,documentList:E}=e;Digit.ULBService.getCurrentTenantId();const _=Digit.ULBService.getStateId(),[f,A]=t.useState((null==d||null===(n=d.FeildReports)||void 0===n||null===(a=n[p])||void 0===a?void 0:a.Documents)||[]),[g,S]=t.useState(null),[h,y]=t.useState((null==d?void 0:d.tradedetils1)||[]);let D="create";const{pathname:T}=i.useLocation();T.includes("/modify-application/")&&(D="update");const{isLoading:b}=Digit.Hooks.pt.usePropertyMDMS(_,"TradeLicense",["documentObj"]);window.location.href.includes("renew-application-details");let C=[];return E&&E.map(e=>{C.push({documentType:e.code,code:e.code})}),t.useEffect(()=>{(()=>{let e=d;e&&null!=e&&e.FieldReports&&(null==e?void 0:e.FieldReports.length)>0&&(null==f?void 0:f.length)>0&&(e.FieldReports[p]={...e.FieldReports[p],Documents:f}),e&&null!=e&&e.FieldReports&&(null==e?void 0:e.FieldReports.length)>0&&f.length>0&&m(e.FieldReports)})()},[f]),b?l.createElement(o.Loader,null):l.createElement("div",null,null==C?void 0:C.map((e,t)=>l.createElement("div",null,l.createElement(Ln,{key:t,document:e,action:D,t:r,id:"obps-doc-"+t,error:g,setError:S,setDocuments:A,documents:f,formData:d,setFormError:s,clearFormErrors:c,config:u,formState:v,stateId:_}))),g&&l.createElement(o.Toast,{label:g,onClose:()=>S(null),error:!0}))};function Ln(e){let{t:n,document:i,setDocuments:a,documents:r,formData:u,setFormError:d,clearFormErrors:s,config:c,formState:v,stateId:p={stateId:p}}=e;const m=null==r?void 0:r.filter(e=>null==e?void 0:e.documentType),E=Digit.ULBService.getCurrentTenantId(),[_,f]=t.useState(""),[A,g]=t.useState(null),[S,h]=t.useState(()=>(null==m?void 0:m.fileStoreId)||null),[y,D]=t.useState(!1),[T,b]=t.useState([]),C=()=>{var e,t;let l=null===(e=v.errors)||void 0===e||null===(t=e[c.key])||void 0===t?void 0:t.type;Array.isArray(l)||(l=[]),l.includes(null==i?void 0:i.documentType)&&(l=l.filter(e=>e!=(null==i?void 0:i.documentType)),l.length?d(c.key,{type:l}):s(c.key))};return t.useEffect(()=>{null==_||!_.documentType||0!=r.filter(e=>e.documentType===(null==_?void 0:_.documentType)).length&&T.filter(e=>{var t;return(null==e||null===(t=e.file)||void 0===t?void 0:t.documentType)===(null==_?void 0:_.documentType)}).length===r.filter(e=>e.documentType===(null==_?void 0:_.documentType)).length||a(e=>{if(0===(null==S?void 0:S.length)||null===S)return e;const t=null==e?void 0:e.filter(e=>(null==e?void 0:e.fileStoreId)!==S),l=null==e?void 0:e.filter(e=>(null==e?void 0:e.documentType)!==(null==_?void 0:_.documentType));if(null!=_&&_.id)return[...t,{documentType:null==_?void 0:_.documentType,fileStoreId:S,tenantId:E,id:null==_?void 0:_.id}];{let e=[];return T.map(t=>{var l,n;e.push({documentType:null==_?void 0:_.documentType,fileStoreId:null==t||null===(l=t.fileStoreId)||void 0===l?void 0:l.fileStoreId,tenantId:null==t||null===(n=t.fileStoreId)||void 0===n?void 0:n.tenantId})}),[...l,...e]}}),y?y&&C():window.location.href.includes("renew-application-details")||(S&&null!=_&&_.documentType?S&&null!=_&&_.documentType&&C():(()=>{var e,t;let l=null===(e=v.errors)||void 0===e||null===(t=e[c.key])||void 0===t?void 0:t.type;Array.isArray(l)||(l=[]),l.includes(i.documentType)||(l.push(i.documentType),d(c.key,{type:l}))})())},[S,_,y]),t.useEffect(()=>{var e,t;if(i&&(null==u||null===(e=u.documents)||void 0===e||null===(t=e.documents)||void 0===t?void 0:t.length)>0)for(let e=0;e<(null==u||null===(l=u.documents)||void 0===l||null===(n=l.documents)||void 0===n?void 0:n.length);e++){var l,n,o,a,r,d,s,c,v,p,m,E,_,A;(null==i?void 0:i.documentType)===(null==u||null===(o=u.documents)||void 0===o||null===(a=o.documents)||void 0===a||null===(r=a[e])||void 0===r?void 0:r.documentType)&&(f({documentType:null==u||null===(d=u.documents)||void 0===d||null===(s=d.documents)||void 0===s||null===(c=s[e])||void 0===c?void 0:c.documentType,id:null==u||null===(v=u.documents)||void 0===v||null===(p=v.documents)||void 0===p||null===(m=p[e])||void 0===m?void 0:m.id}),h(null==u||null===(E=u.documents)||void 0===E||null===(_=E.documents)||void 0===_||null===(A=_[e])||void 0===A?void 0:A.fileStoreId))}},[i]),l.createElement("div",{style:{marginBottom:"24px"}},l.createElement(o.LabelFieldPair,{style:{width:"100%"}},l.createElement(o.CardLabel,{className:"card-label-smaller",style:{width:"100%"}},""+n(""+(null==i?void 0:i.documentType.replaceAll(".","_")))),l.createElement("div",{className:"field",style:{width:"100%"}},l.createElement(o.MultiUploadWrapper,{module:"BPA",tenantId:p,getFormState:e=>function(e,t){let l=Object.fromEntries(e),n=Object.values(l);b(n),r&&n&&r.filter(e=>e.documentType===t).length>n.length&&a(r.filter(e=>e.documentType!==t)),n&&n.map(e=>{e.file.documentType=t,function(e,t){var l;e&&f({documentType:t}),e&&g(e.file),e&&h(null==e||null===(l=e.fileStoreId)||void 0===l?void 0:l.fileStoreId)}(e,t)})}(e,null==i?void 0:i.documentType.replaceAll(".","_")),t:n,allowedFileTypesRegex:/(.*?)(jpg|jpeg|png|image|pdf)$/i,allowedMaxSizeInMB:5,acceptFiles:"image/*, .pdf, .png, .jpeg, .jpg"}))))}const Bn=()=>({InspectionDate:"",InspectionTime:"",Checklist:[],Documents:[],key:Date.now()}),On=e=>{var n;const{unit:i,index:r,allFieldReport:u,removeUnit:d,setFieldReports:s,t:c,formData:v,config:p,onSelect:m,userType:E,setError:_,clearErrors:f,formState:A,isErrors:g,setIsErrors:S,questionList:h,documentList:y}=e,{control:D,formState:T,watch:b,trigger:C,getValues:P}=a.useForm(),N=b(),{errors:I}=T,L=t.useMemo(()=>{var e;return null==v||null===(e=v.ownershipCategory)||void 0===e?void 0:e.code.includes("INDIVIDUAL")},[null==v||null===(n=v.ownershipCategory)||void 0===n?void 0:n.code]);t.useEffect(()=>{C()},[]),t.useEffect(()=>{const e=Object.keys(N),t={};e.forEach(e=>t[e]=i[e]);let l=L?{}:{ownerType:{code:"NONE"}},n=h?{questionLength:h.length}:{questionLength:0},o=h?{questionList:h}:{questionList:[]};Nn.isEqual(N,t)||(Object.keys(N).map(e=>{"key"==e||null==N[e]||""==N[e]||null==N[e]||g||S(!0)}),s(e=>e.map(e=>e.key&&e.key===i.key?{...e,...N,...l,...n,...o}:{...e})),C())},[N]),t.useEffect(()=>{var e;Object.keys(I).length&&!Nn.isEqual((null===(e=A.errors[p.key])||void 0===e?void 0:e.type)||{},I)?_(p.key,{type:I}):!Object.keys(I).length&&A.errors[p.key]&&g&&f(p.key)},[I]);let B=window.location.href.includes("renew-application-details");window.location.href.includes("edit-application-details")&&(B=!0);const O=e=>{let t=[];return e.split("/").map(e=>{t.push({i18nKey:"SCORE_"+e,code:e})}),t};return l.createElement(l.Fragment,null,l.createElement("div",{style:{marginBottom:"16px",maxWidth:"950px"}},l.createElement("div",{className:"fieldInspectionWrapper"},(null==u?void 0:u.length)>1?l.createElement(o.LinkButton,{label:l.createElement(o.DeleteIcon,{style:{float:"right",position:"relative",bottom:"-6px"},fill:1!=u.length?"#494848":"#FAFAFA"}),style:{width:"100px",display:"inline",background:"black"},onClick:e=>d(i)}):null,l.createElement(o.CardSectionHeader,null,(null==u?void 0:u.length)>1?`${c("BPA_FI_REPORT")}-${r+1}`:""+c("BPA_FI_REPORT")),l.createElement(o.LabelFieldPair,{style:{width:"100%"}},l.createElement(o.CardLabel,{style:{marginTop:"0px",width:"100%"},className:"card-label-smaller"},c("BPA_FI_DATE_LABEL")+" * "),l.createElement("div",{className:"field",style:{width:"100%"}},l.createElement(a.Controller,{name:"InspectionDate",rules:{required:c("REQUIRED_FIELD")},control:D,render:e=>l.createElement(o.DatePicker,{date:e.value,name:"InspectionDate",onChange:e.onChange})}))),l.createElement(o.LabelFieldPair,{style:{width:"100%"}},l.createElement(o.CardLabel,{style:{marginTop:"0px",width:"100%"},className:"card-label-smaller"},c("ES_COMMON_TIME")+" * "),l.createElement("div",{className:"field",style:{width:"100%"}},l.createElement(a.Controller,{name:"InspectionTime",rules:{required:c("REQUIRED_FIELD")},control:D,render:e=>l.createElement(o.TextInput,{name:"InspectionTime",type:"time",value:e.value,onChange:e.onChange})}))),l.createElement(o.CardSectionHeader,null,c("BPA_CHECK_LIST_DETAILS")),h&&h.map((e,t)=>l.createElement("div",{key:t,className:"fieldInsepctionInsideWrapper",style:{maxWidth:"100%"}},l.createElement(o.LabelFieldPair,{style:{width:"100%"}},l.createElement(o.CardLabel,{style:{marginRight:"30px",width:"100%"},className:"card-label-smaller"},""+c(e.question)),l.createElement("div",{className:"field",style:{width:"100%"}},l.createElement(a.Controller,{control:D,name:"question_"+t,render:n=>l.createElement(o.Dropdown,{className:"form-field",style:{width:"100%",maxWidth:"100%"},selected:P("question"+t),disable:!1,option:O(e.fieldType),select:e=>{var t;if((null==n||null===(t=n.value)||void 0===t?void 0:t.code)==(null==e?void 0:e.code))return!0;n.onChange(e)},optionKey:"i18nKey",onBlur:n.onBlur,t:c})}))),l.createElement(o.LabelFieldPair,{style:{width:"100%"}},l.createElement(o.CardLabel,{style:{marginRight:"30px",width:"100%"},className:"card-label-smaller"},c("BPA_ENTER_REMARKS")),l.createElement("div",{className:"field",style:{width:"100%"}},l.createElement(a.Controller,{control:D,name:"Remarks_"+t,defaultValue:null==i?void 0:i.uomValue,render:e=>l.createElement(o.TextInput,{value:P("Remarks"+t),onChange:t=>{e.onChange(t)},onBlur:e.onBlur})}))))),l.createElement(o.CardSectionHeader,{style:{marginTop:"20px"}},c("BPA_FIELD_INSPECTION_DOCUMENTS")),l.createElement(In,{t:c,config:p,onSelect:m,userType:E,formData:v,setError:_,clearErrors:f,formState:A,index:r,setFieldReports:s,documentList:y}))))},Rn=e=>l.createElement("h1",{className:"heading-m"},e.label),wn=()=>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(wn,null)),Mn=e=>{var n,i;let{t:a,action:r,tenantId:u,closeModal:d,submitAction:s,applicationData:c,businessService:v,moduleCode:p}=e;const{data:E,isLoading:_}=Digit.Hooks.useEmployeeSearch(u,{roles:null==r||null===(n=r.assigneeRoles)||void 0===n||null===(i=n.map)||void 0===i?void 0:i.call(n,e=>({code:e})),isActive:!0},{enabled:!(null!=r&&r.isTerminateState)}),{isLoading:f,data:A}=Digit.Hooks.pt.useMDMS(u,v,"FINANCIAL_YEARLS",{},{details:{tenantId:Digit.ULBService.getStateId(),moduleDetails:[{moduleName:"egf-master",masterDetails:[{name:"FinancialYear",filter:"[?(@.module == 'PT')]"}]}]}}),[g,S]=t.useState({}),[h,y]=t.useState({}),[D,T]=t.useState([]),[b,C]=t.useState(null),[P,N]=t.useState(null),[I,L]=t.useState(null),[B,O]=t.useState(null),[R,w]=t.useState([]),[x,M]=t.useState(null),[F,k]=t.useState(!1);function U(e){N(e.target.files[0])}return t.useEffect(()=>{var e;A&&A["egf-master"]&&w(null===(e=A["egf-master"])||void 0===e?void 0:e.FinancialYear)},[A]),t.useEffect(()=>{var e;T(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]),t.useEffect(()=>{!function(){try{O(null);const e=function(){if(P){const e=function(){if(P.size>=5242880)O(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=m(function(){return Promise.resolve(Digit.UploadServices.Filestorage("PT",P,Digit.ULBService.getStateId())).then(function(e){var t,l,n,i;(null==e||null===(t=e.data)||void 0===t||null===(l=t.files)||void 0===l?void 0:l.length)>0?L(null==e||null===(n=e.data)||void 0===n||null===(i=n.files[0])||void 0===i?void 0:i.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)}}()},[P]),t.useEffect(()=>{r&&S(null!=r&&r.showFinancialYearsModal?(e=>{let{t:t,action:n,financialYears:i,selectedFinancialYear:a,setSelectedFinancialYear:r}=e;return{label:{heading:`WF_${n.action}_APPLICATION`,submit:"WF_PT.CREATE_"+n.action,cancel:"ES_PT_COMMON_CANCEL"},form:[{body:[{label:t("ES_PT_FINANCIAL_YEARS"),isMandatory:!0,type:"radio",populators:l.createElement(o.RadioButtons,{options:i,optionsKey:"name",onSelect:r,selectedOption:a})}]}]}})({t:a,action:r,financialYears:R,selectedFinancialYear:x,setSelectedFinancialYear:M}):(e=>{var t;let{t:n,action:i,approvers:a,selectedApprover:r,setSelectedApprover:u,selectFile:d,uploadedFile:s,setUploadedFile:c,assigneeLabel:v,businessService:p}=e;return{label:{heading:`WF_${null==i?void 0:i.action}_APPLICATION`,submit:`WF_${p}_${null==i?void 0:i.action}`,cancel:"ES_PT_COMMON_CANCEL"},form:[{body:[{label:i.isTerminateState||"SENDBACKTOCITIZEN"===(null==i?void 0:i.action)?null:n(v||"WF_ROLE_"+(null===(t=i.assigneeRoles)||void 0===t?void 0:t[0])),type:"dropdown",populators:i.isTerminateState||"SENDBACKTOCITIZEN"===(null==i?void 0:i.action)?null:l.createElement(o.Dropdown,{option:a,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:u,selected:r})},{label:n("ES_PT_ACTION_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:`${n("ES_PT_ATTACH_FILE")}${i.docUploadRequired?" *":""}`,populators:l.createElement(o.UploadFile,{id:"workflow-doc",onUpload:d,onDelete:()=>{c(null)},showHint:!0,hintText:n("PT_ATTACH_RESTRICTIONS_SIZE"),message:s?"1 "+n("ES_PT_ACTION_FILEUPLOADED"):n("ES_PT_ACTION_NO_FILEUPLOADED")})}]}]}})({t:a,action:r,approvers:D,selectedApprover:b,setSelectedApprover:C,selectFile:U,uploadedFile:I,setUploadedFile:L,businessService:v}))},[r,D,R,x,I]),r&&g.form?l.createElement(o.Modal,{headerBarMain:l.createElement(Rn,{label:a(g.label.heading)}),headerBarEnd:l.createElement(xn,{onClick:d}),actionCancelLabel:a(g.label.cancel),actionCancelOnSubmit:d,actionSaveLabel:a(g.label.submit),actionSaveOnSubmit:()=>{},isDisabled:r.showFinancialYearsModal?!x:_||(null==r?void 0:r.docUploadRequired)&&!I,formId:"modal-action"},f?l.createElement(o.Loader,null):l.createElement(o.FormComposer,{config:g.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"};c.creationReason="STATUS",s({customFunctionToExecute:null==r?void 0:r.customFunctionToExecute,Property:{...c,workflow:t}})}else if(null!=r&&r.showFinancialYearsModal)s({customFunctionToExecute:null==r?void 0:r.customFunctionToExecute,Assessment:{financialYear:null==x?void 0:x.name,propertyId:null==c?void 0:c.propertyId,tenantId:u,source:null==c?void 0:c.source,channel:null==c?void 0:c.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||!b?[]:[b],I&&(t.documents=[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==P?void 0:P.name,fileStoreId:I}]),s({Property:{...c,workflow:t}})}},defaultValues:h,formId:"modal-action"})):l.createElement(o.Loader,null)},Fn=e=>l.createElement("h1",{className:"heading-m"},e.label),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"})),Un=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(kn,null)),Hn=e=>{var n,i;let{t:a,action:r,tenantId:u,closeModal:d,submitAction:s,applicationData:c,businessService:v}=e;const{data:p}=Digit.Hooks.useEmployeeSearch(u,{roles:null==r||null===(n=r.assigneeRoles)||void 0===n||null===(i=n.map)||void 0===i?void 0:i.call(n,e=>({code:e})),isActive:!0},{enabled:!(null!=r&&r.isTerminateState)}),{isLoading:E,data:_}=Digit.Hooks.pt.useMDMS(u,v,"FINANCIAL_YEARLS",{},{details:{tenantId:Digit.ULBService.getStateId(),moduleDetails:[{moduleName:"egf-master",masterDetails:[{name:"FinancialYear",filter:"[?(@.module == 'TL')]"}]}]}}),[f,A]=t.useState({}),[g,S]=t.useState({}),[h,y]=t.useState([]),[D,T]=t.useState({}),[b,C]=t.useState(null),[P,N]=t.useState(null),[I,L]=t.useState(null),[B,O]=t.useState([]),[R,w]=t.useState(null);t.useEffect(()=>{var e;_&&_["egf-master"]&&O(null===(e=_["egf-master"])||void 0===e?void 0:e.FinancialYear)},[_]);const{data:x}=Digit.Hooks.useCustomMDMS(u,"common-masters",[{name:"Department"}]);function M(e){C(e.target.files[0])}return t.useEffect(()=>{if(p&&x){var e;const t=x["common-masters"].Department;y(null==p||null===(e=p.Employees)||void 0===e?void 0:e.map(e=>{var l,n,i;const o=null==e||null===(l=e.assignments)||void 0===l||null===(n=l[0])||void 0===n?void 0:n.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]),t.useEffect(()=>{!function(){try{L(null);const e=function(){if(b){const e=function(){if(b.size>=5242880)L(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=m(function(){return Promise.resolve(Digit.UploadServices.Filestorage("PT",b,Digit.ULBService.getStateId())).then(function(e){var t,l,n,i;(null==e||null===(t=e.data)||void 0===t||null===(l=t.files)||void 0===l?void 0:l.length)>0?N(null==e||null===(n=e.data)||void 0===n||null===(i=n.files[0])||void 0===i?void 0:i.fileStoreId):L(a("CS_FILE_UPLOAD_ERROR"))})},function(){L(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)}}()},[b]),t.useEffect(()=>{r&&A((e=>{let{t:t,action:n,approvers:i,selectedApprover:a,setSelectedApprover:r,selectFile:u,uploadedFile:d,setUploadedFile:s,businessService:c}=e,v=!0;return"SENDBACKTOCITIZEN"!=(null==n?void 0:n.action)&&"APPROVE"!=(null==n?void 0:n.action)||(v=!1),n.isTerminateState&&(v=!1),{label:{heading:`WF_${null==n?void 0:n.action}_APPLICATION`,submit:`WF_${null==c?void 0:c.toUpperCase()}_${null==n?void 0:n.action}`,cancel:"WF_EMPLOYEE_NEWTL_CANCEL"},form:[{body:[{label:v?t("WF_ASSIGNEE_NAME_LABEL"):null,placeholder:v?t("WF_ASSIGNEE_NAME_PLACEHOLDER"):null,type:"dropdown",populators:v?l.createElement(o.Dropdown,{option:i,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:r,selected:a}):null},{label:t("WF_COMMON_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:t("TL_APPROVAL_CHECKLIST_BUTTON_UP_FILE"),populators:l.createElement(o.UploadFile,{id:"workflow-doc",onUpload:u,onDelete:()=>{s(null)},message:d?"1 "+t("ES_PT_ACTION_FILEUPLOADED"):t("CS_ACTION_NO_FILEUPLOADED")})}]}]}})({t:a,action:r,approvers:h,selectedApprover:D,setSelectedApprover:T,selectFile:M,uploadedFile:P,setUploadedFile:N,businessService:v}))},[r,h,B,R,P]),r&&f.form?l.createElement(o.Modal,{headerBarMain:l.createElement(Fn,{label:a(f.label.heading)}),headerBarEnd:l.createElement(Un,{onClick:d}),actionCancelLabel:a(f.label.cancel),actionCancelOnSubmit:d,actionSaveLabel:a(f.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},E?l.createElement(o.Loader,null):l.createElement(o.FormComposer,{config:f.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){c={...c,action:null==r?void 0:r.action,comment:null==e?void 0:e.comments,assignee:null!=D&&D.uuid?[null==D?void 0:D.uuid]:null,wfDocuments:P?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==b?void 0:b.name,fileStoreId:P}]:null},s({Licenses:[c]})},defaultValues:g,formId:"modal-action"})):l.createElement(o.Loader,null)},Wn=e=>l.createElement("h1",{style:{marginLeft:"22px"},className:"heading-m BPAheading-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"})),jn=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(Gn,null)),Kn=e=>{var n,i;let{t:a,action:r,tenantId:u,closeModal:d,submitAction:s,applicationData:c,businessService:v}=e;const{data:p,isLoading:E}=Digit.Hooks.useEmployeeSearch(u,{roles:null==r||null===(n=r.assigneeRoles)||void 0===n||null===(i=n.map)||void 0===i?void 0:i.call(n,e=>({code:e})),isActive:!0},{enabled:!(null!=r&&r.isTerminateState)}),[_,f]=t.useState({}),[A,g]=t.useState({}),[S,h]=t.useState([]),[y,D]=t.useState({}),[T,b]=t.useState(null),[C,P]=t.useState(null),[N,I]=t.useState(null),L=!!Digit.Utils.browser.isMobile();function B(e){b(e.target.files[0])}return t.useEffect(()=>{var e;h(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]),t.useEffect(()=>{!function(){try{I(null);const e=function(){if(T){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(T.size>=5242880)I(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=T&&T.type&&!e.test(null==T?void 0:T.type))I(a("NOT_SUPPORTED_FILE_TYPE"));else{const e=m(function(){return Promise.resolve(Digit.UploadServices.Filestorage("OBPS",T,Digit.ULBService.getStateId()||(null==u?void 0:u.split(".")[0]))).then(function(e){var t,l,n,i;(null==e||null===(t=e.data)||void 0===t||null===(l=t.files)||void 0===l?void 0:l.length)>0?P(null==e||null===(n=e.data)||void 0===n||null===(i=n.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(t&&t.then)return t.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[T]),t.useEffect(()=>{r&&f((e=>{let{t:t,action:n,approvers:i,selectedApprover:a,setSelectedApprover:r,selectFile:u,uploadedFile:d,setUploadedFile:s,businessService:c,error:v}=e,p=!0;return"SENDBACKTOCITIZEN"==(null==n?void 0:n.action)&&(p=!1),n.isTerminateState&&(p=!1),{label:{heading:`WF_${null==n?void 0:n.action}_APPLICATION`,submit:`WF_${null==c?void 0:c.toUpperCase()}_${null==n?void 0:n.action}`,cancel:"WF_EMPLOYEE_BPAREG_CANCEL"},form:[{body:[{label:p?t("WF_ASSIGNEE_NAME_LABEL"):null,placeholder:p?t("WF_ASSIGNEE_NAME_PLACEHOLDER"):null,type:"dropdown",populators:p?l.createElement(o.Dropdown,{option:i,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:r,selected:a}):null},{label:t("WF_COMMON_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:t("BPA_APPROVAL_CHECKLIST_BUTTON_UP_FILE"),populators:l.createElement(o.UploadFile,{id:"workflow-doc",onUpload:u,onDelete:()=>{s(null)},message:d?"1 "+t("ES_PT_ACTION_FILEUPLOADED"):t("CS_ACTION_NO_FILEUPLOADED"),accept:"image/*, .pdf, .png, .jpeg, .jpg",iserror:v})}]}]}})({t:a,action:r,approvers:S,selectedApprover:y,setSelectedApprover:D,selectFile:B,uploadedFile:C,setUploadedFile:P,businessService:v,error:N}))},[r,S,C,N]),r&&_.form?l.createElement(o.Modal,{headerBarMain:l.createElement(Wn,{label:a(_.label.heading)}),headerBarEnd:l.createElement(jn,{onClick:d}),actionCancelLabel:a(_.label.cancel),actionCancelOnSubmit:d,actionSaveLabel:a(_.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action",isOBPSFlow:!0,popupStyles:L?{width:"720px"}:{},style:L?{height:"45px",width:"44%"}:{height:"45px",width:"107px",paddingLeft:"0px",paddingRight:"0px"},popupModuleMianStyles:L?{paddingLeft:"5px"}:{}},E?l.createElement(o.Loader,null):l.createElement(o.FormComposer,{config:_.form,cardStyle:{marginLeft:"0px",marginRight:"0px",marginTop:"-25px"},className:"BPAemployeeCard",noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){c={...c,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:C?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==T?void 0:T.name,fileStoreId:C}]:null},s({Licenses:[c]},!1,{isStakeholder:!0,bpa:!1})},defaultValues:A,formId:"modal-action"})):l.createElement(o.Loader,null)},Yn=e=>l.createElement("h1",{style:{marginLeft:"22px"},className:"heading-m BPAheading-m"},e.label),$n=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),zn=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement($n,null)),Vn=e=>{var n,i,a,r,d,s,c,v,p,E,_,f;let{t:A,action:g,tenantId:S,closeModal:h,submitAction:y,applicationDetails:D,applicationData:T,businessService:b,workflowDetails:C,blockReason:P}=e;console.log("applicationData",T),console.log("workflowDetails",C),Digit.Hooks.obps.useObpsAPI(null!==(n=T)&&void 0!==n&&null!==(i=n.landInfo)&&void 0!==i&&null!==(a=i.address)&&void 0!==a&&a.city?null===(r=T)||void 0===r||null===(d=r.landInfo)||void 0===d||null===(s=d.address)||void 0===s?void 0:s.city:S,!1);const{data:N,isLoading:I}=Digit.Hooks.useEmployeeSearch(S,{roles:null==C||null===(c=C.data)||void 0===c||null===(v=c.initialActionState)||void 0===v||null===(p=v.nextActions)||void 0===p||null===(E=p.filter(e=>(null==e?void 0:e.action)==(null==g?void 0:g.action)))||void 0===E||null===(_=E[0])||void 0===_||null===(f=_.assigneeRoles)||void 0===f?void 0:f.map(e=>({code:e})),isActive:!0},{enabled:!(null!=g&&g.isTerminateState)}),[L,B]=(u.useQueryClient(),t.useState({})),[O,R]=t.useState({}),[w,x]=t.useState([]),[M,F]=t.useState([]),[k,U]=t.useState({}),[H,W]=t.useState({}),[G,j]=t.useState(null),[K,Y]=t.useState(null),[$,z]=t.useState(null),[V,q]=t.useState(null),X=!!Digit.Utils.browser.isMobile();function J(e){j(e.target.files[0])}t.useEffect(()=>{var e;x(null==N||null===(e=N.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}}))},[N]),t.useEffect(()=>{!function(){try{z(null);const e=function(){if(G){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(G.size>=5242880)z(A("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=G&&G.type&&!e.test(null==G?void 0:G.type))z(A("NOT_SUPPORTED_FILE_TYPE"));else{const e=m(function(){return Promise.resolve(Digit.UploadServices.Filestorage("OBPS",G,Digit.ULBService.getStateId()||(null==S?void 0:S.split(".")[0]))).then(function(e){var t,l,n,i;(null==e||null===(t=e.data)||void 0===t||null===(l=t.files)||void 0===l?void 0:l.length)>0?Y(null==e||null===(n=e.data)||void 0===n||null===(i=n.files[0])||void 0===i?void 0:i.fileStoreId):z(A("CS_FILE_UPLOAD_ERROR"))})},function(){z(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)}}()},[G]);const Z=e=>{let t=[];return e&&e.map((e,l)=>{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 l;for(l=0;l<(null==e?void 0:e.questionLength);l++){var n;t.push({remarks:e["Remarks_"+l],question:null==e?void 0:e.questionList[l].question,value:null==e||null===(n=e["question_"+l])||void 0===n?void 0:n.code})}return t},ee=e=>{var t,l;let n=[],i=[];var o,a;return(null==e||null===(t=e.additionalDetails)||void 0===t||null===(l=t.fieldinspection_pending)||void 0===l?void 0:l.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?(n=JSON.parse(sessionStorage.getItem("INSPECTION_DATA")),(null===(a=n)||void 0===a?void 0:a.length)>0&&n.map((e,t)=>{i.push({docs:Z(e.Documents),date:e.InspectionDate,questions:Q(e),time:null==e?void 0:e.InspectionTime})}),console.log("FIELDINSPECTION_INPROGRESS",i),i=i.filter(e=>e.date&&e.time),console.log("inspectionObinspectionOb",i)):sessionStorage.removeItem("INSPECTION_DATA"),[...i]},te=e=>{let t=JSON.parse(sessionStorage.getItem("BPA_DOCUMENTS")),l=[];return t.map(e=>{var t,n,i,o,a,r;(null==e||null===(t=e.uploadedDocuments)||void 0===t||null===(n=t[0])||void 0===n||null===(i=n.values)||void 0===i?void 0:i.length)>0&&(l=[...l,...null==e||null===(o=e.uploadedDocuments)||void 0===o||null===(a=o[0])||void 0===a?void 0:a.values]),(null==e||null===(r=e.newUploadedDocs)||void 0===r?void 0:r.length)>0&&(l=[...l,...null==e?void 0:e.newUploadedDocs])}),l},le=()=>{var e;const t=Digit.SessionStorage.get("OBPS_APPROVAL_CHECKS"),l=Digit.SessionStorage.get("OBPS_NEW_APPROVALS");let n=null==t?void 0:t.reduce((e,t)=>null!=t&&t.checked?e.push(null==t?void 0:t.label)&&e:e,[]);return n=null===(e=n)||void 0===e?void 0:e.concat(null!==l?l.filter(e=>""!==e.label).map(e=>null==e?void 0:e.label):[]),n};return t.useEffect(()=>{F(null==P?void 0:P.map(e=>({code:null==e?void 0:e.code,name:null==e?void 0:e.value}))),g&&B((e=>{var t,n,i,a,r,u,d;let{t:s,action:c,approvers:v,selectedApprover:p,setSelectedApprover:m,selectedBlockReason:E,setBlockReason:_,selectFile:f,uploadedFile:A,setUploadedFile:g,assigneeLabel:S,businessService:h,error:y,blockReasonFiltered:D}=e,T=!1;return"REVOCATE"!=(null==c?void 0:c.action)&&"REJECT"!=(null==c?void 0:c.action)&&"SKIP_PAYMENT"!=c.action&&"SEND_BACK_TO_CITIZEN"!=(null==c?void 0:c.action)&&"APPROVE"!=(null==c?void 0:c.action)||(T=!0),{label:{heading:`WF_${null==c?void 0:c.action}_APPLICATION`,submit:`WF_${h}_${null==c?void 0:c.action}`,cancel:"BPA_CITIZEN_CANCEL_BUTTON"},form:[{body:[{label:c.isTerminateState||T||"BLOCK"==(null==c?void 0:c.action)&&"PENDINGAPPROVAL"==(null==c||null===(t=c.state)||void 0===t?void 0:t.state)||"FORWARD"==(null==c?void 0:c.action)&&"FIELDINSPECTION_PENDING"==(null==c||null===(n=c.state)||void 0===n?void 0:n.state)?null:s(S||"WF_ROLE_"+(null===(i=c.assigneeRoles)||void 0===i?void 0:i[0])),type:"dropdown",populators:c.isTerminateState||T||"BLOCK"==(null==c?void 0:c.action)&&"PENDINGAPPROVAL"==(null==c||null===(a=c.state)||void 0===a?void 0:a.state)||"FORWARD"==(null==c?void 0:c.action)&&"FIELDINSPECTION_PENDING"==(null==c||null===(r=c.state)||void 0===r?void 0:r.state)?null:l.createElement(o.Dropdown,{option:v,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:m,selected:p})},{label:"BLOCK"==(null==c?void 0:c.action)&&"PENDINGAPPROVAL"==(null==c||null===(u=c.state)||void 0===u?void 0:u.state)?s("BLOCK_REASON"):null,type:"dropdown",populators:"BLOCK"==(null==c?void 0:c.action)&&"PENDINGAPPROVAL"==(null==c||null===(d=c.state)||void 0===d?void 0:d.state)?l.createElement(o.Dropdown,{option:D,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:_,selected:E,isMandatory:!0}):null},{label:s("WF_COMMON_COMMENTS"),type:"textarea",isMandatory:!0,populators:{name:"comments"}},{label:""+s("WF_APPROVAL_UPLOAD_HEAD"),populators:l.createElement(o.UploadFile,{id:"workflow-doc",onUpload:f,onDelete:()=>{g(null)},message:A?"1 "+s("ES_PT_ACTION_FILEUPLOADED"):s("CS_ACTION_NO_FILEUPLOADED"),accept:"image/*, .pdf, .png, .jpeg, .jpg",iserror:y})}]}]}})({t:A,action:g,approvers:w,selectedApprover:k,setSelectedApprover:U,selectedBlockReason:H,setBlockReason:W,selectFile:J,uploadedFile:K,setUploadedFile:Y,businessService:b,assigneeLabel:"WF_ASSIGNEE_NAME_LABEL_BPA",error:$,blockReasonFiltered:M}))},[g,w,V,K,$]),g&&L.form?l.createElement(o.Modal,{headerBarMain:l.createElement(Yn,{label:A(L.label.heading)}),headerBarEnd:l.createElement(zn,{onClick:h}),actionCancelLabel:A(L.label.cancel),actionCancelOnSubmit:h,actionSaveLabel:A(L.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action",isOBPSFlow:!0,popupStyles:X?{width:"720px"}:{},style:X?{minHeight:"45px",height:"auto",width:"44%"}:{minHeight:"45px",height:"auto",width:"107px",paddingLeft:"0px",paddingRight:"0px"},popupModuleMianStyles:X?{paddingLeft:"5px"}:{}},I?l.createElement(o.Loader,null):l.createElement(o.FormComposer,{config:L.form,cardStyle:{marginLeft:"0px",marginRight:"0px",marginTop:"-25px"},className:"BPAemployeeCard",noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){try{var t,l,n,i,o,a,r,u,d,s,c,v,p,m,E,_,f,b,P,N,I,L,B,O,R,w,x;T={...T,documents:te(),additionalDetails:{...null===(t=T)||void 0===t?void 0:t.additionalDetails,fieldinspection_pending:ee(T),pendingapproval:le(),blockingReason:null==H?void 0:H.name},workflow:{action:null==g?void 0:g.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===(n=e.comments)||void 0===n?void 0:n.length)>0?null==e?void 0:e.comments:null,assignee:"FIELDINSPECTION_INPROGRESS"===(null==C||null===(i=C.data)||void 0===i||null===(o=i.processInstances)||void 0===o||null===(a=o[0])||void 0===a||null===(r=a.state)||void 0===r?void 0:r.applicationStatus)?[null==C||null===(u=C.data)||void 0===u||null===(d=u.processInstances)||void 0===d||null===(s=d[0])||void 0===s||null===(c=s.assigner)||void 0===c?void 0:c.uuid]:null!=k&&k.uuid?[null==k?void 0:k.uuid]:null,assignes:"FIELDINSPECTION_INPROGRESS"===(null==C||null===(v=C.data)||void 0===v||null===(p=v.processInstances)||void 0===p||null===(m=p[0])||void 0===m||null===(E=m.state)||void 0===E?void 0:E.applicationStatus)?[null==C||null===(_=C.data)||void 0===_||null===(f=_.processInstances)||void 0===f||null===(b=f[0])||void 0===b||null===(P=b.assigner)||void 0===P?void 0:P.uuid]:null!=k&&k.uuid?[null==k?void 0:k.uuid]:null,varificationDocuments:K?[{documentType:(null==g?void 0:g.action)+" DOC",fileName:null==G?void 0:G.name,fileStoreId:K}]:null},action:null==g?void 0:g.action,comment:null==e?void 0:e.comments,assignee:"FIELDINSPECTION_INPROGRESS"===(null==C||null===(N=C.data)||void 0===N||null===(I=N.processInstances)||void 0===I||null===(L=I[0])||void 0===L||null===(B=L.state)||void 0===B?void 0:B.applicationStatus)?[null==C||null===(O=C.data)||void 0===O||null===(R=O.processInstances)||void 0===R||null===(w=R[0])||void 0===w||null===(x=w.assigner)||void 0===x?void 0:x.uuid]:null!=k&&k.uuid?[null==k?void 0:k.uuid]:null,wfDocuments:K?[{documentType:(null==g?void 0:g.action)+" DOC",fileName:null==G?void 0:G.name,fileStoreId:K}]:null};const M=function(e,t,l,n,i,o,a,r,u,d,s,c){if(!(parseInt(sessionStorage.getItem("lessAdjusment"))>parseInt(sessionStorage.getItem("development"))+parseInt(sessionStorage.getItem("otherCharges"))+parseInt(null===(e=T)||void 0===e||null===(t=e.additionalDetails)||void 0===t||null===(l=t.selfCertificationCharges)||void 0===l?void 0:l.BPA_MALBA_CHARGES)+parseInt(null===(n=T)||void 0===n||null===(i=n.additionalDetails)||void 0===i||null===(o=i.selfCertificationCharges)||void 0===o?void 0:o.BPA_LABOUR_CESS)+parseInt(null===(a=T)||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===(d=T)||void 0===d||null===(s=d.additionalDetails)||void 0===s||null===(c=s.selfCertificationCharges)||void 0===c?void 0:c.BPA_GAUSHALA_CHARGES_CESS))){var v,p,m;T.additionalDetails.selfCertificationCharges.BPA_DEVELOPMENT_CHARGES=sessionStorage.getItem("development")||"0",T.additionalDetails.selfCertificationCharges.BPA_OTHER_CHARGES=sessionStorage.getItem("otherCharges")||"0",T.additionalDetails.selfCertificationCharges.BPA_LESS_ADJUSMENT_PLOT=sessionStorage.getItem("lessAdjusment")||"0",T.additionalDetails.otherFeesDiscription=sessionStorage.getItem("otherChargesDisc"),T.additionalDetails.lessAdjustmentFeeFiles=JSON.parse(sessionStorage.getItem("uploadedFileLess"));const e=null==D||null===(v=D.nocData)||void 0===v?void 0:v.map(e=>{const t=Digit.SessionStorage.get(null==e?void 0:e.nocType)||[];return{Noc:{...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===(m=p.Noc)||void 0===m?void 0:m.sourceRefId};return Promise.resolve(Digit.NOCSearch.all(S,t)).then(function(t){var l;let n=!0,i=!0;null==t||null===(l=t.Noc)||void 0===l||l.map(e=>{var t,l,o,a,r;"APPROVED"!==(null==e||null===(t=e.applicationStatus)||void 0===t?void 0:t.toUpperCase())&&"AUTO_APPROVED"!==(null==e||null===(l=e.applicationStatus)||void 0===l?void 0:l.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!=i||("AIRPORT_AUTHORITY"===(null==e?void 0:e.nocType)?n=!1:"FIRE_NOC"===(null==e?void 0:e.nocType)&&(i=!1))});let o=[];if(e&&e.map(e=>{var t,l,a,r,u,d,s,c,v,p,m,E;("APPROVED"!=(null==e||null===(t=e.Noc)||void 0===t||null===(l=t.applicationStatus)||void 0===l?void 0:l.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===(d=u.applicationStatus)||void 0===d?void 0:d.toUpperCase())&&"AUTO_REJECTED"!=(null==e||null===(s=e.Noc)||void 0===s||null===(c=s.applicationStatus)||void 0===c?void 0:c.toUpperCase())&&"VOIDED"!=(null==e||null===(v=e.Noc)||void 0===v||null===(p=v.applicationStatus)||void 0===p?void 0:p.toUpperCase())&&"AIRPORT_AUTHORITY"===(null==e||null===(m=e.Noc)||void 0===m?void 0:m.nocType)&&n||"FIRE_NOC"===(null==e||null===(E=e.Noc)||void 0===E?void 0:E.nocType)&&i)&&o.push(e)}),"FIELDINSPECTION_INPROGRESS"==T.status){let e=JSON.parse(sessionStorage.getItem("INSPECTION_DATA"));(null==e?void 0:e.length)>0&&e.map((e,t)=>{e.InspectionDate&&e.InspectionTime?y({BPA:T},(null==o?void 0:o.length)>0&&o,{isStakeholder:!1,bpa:!0}):(h(),alert(A("Please fill Inspection Date and Time"))),console.log(" ob.InspectionDate && ob.InspectionTime",e.InspectionDate,e.InspectionTime)})}else y({BPA:T},(null==o?void 0:o.length)>0&&o,{isStakeholder:!1,bpa:!0})})}h(),alert(A("Enterd Less Adjustment amount is invalid"))}();return Promise.resolve(M&&M.then?M.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},defaultValues:O,formId:"modal-action"})):l.createElement(o.Loader,null)},qn=e=>l.createElement("h1",{style:{marginLeft:"22px"},className:"heading-m BPAheading-m"},e.label),Xn=()=>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"})),Jn=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(Xn,null)),Zn=e=>{var n,a;let{t:r,action:d,tenantId:s,closeModal:c,submitAction:v,applicationData:p,businessService:E}=e;const{data:_,isLoading:f}=Digit.Hooks.useEmployeeSearch(s,{roles:null==d||null===(n=d.assigneeRoles)||void 0===n||null===(a=n.map)||void 0===a?void 0:a.call(n,e=>({code:e})),isActive:!0},{enabled:!(null!=d&&d.isTerminateState)}),[A,g]=(u.useQueryClient(),t.useState({})),[S,h]=t.useState({}),[y,D]=t.useState([]),[T,b]=t.useState({}),[C,P]=t.useState(null),[N,I]=t.useState(null),[L,B]=t.useState(null),O=!!Digit.Utils.browser.isMobile();function R(e){P(e.target.files[0])}return i.useHistory(),t.useEffect(()=>{var e;D(null==_||null===(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}}))},[_]),t.useEffect(()=>{!function(){try{B(null);const e=function(){if(C){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(C.size>=5242880)B(r("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=C&&C.type&&!e.test(null==C?void 0:C.type))B(r("NOT_SUPPORTED_FILE_TYPE"));else{const e=m(function(){return Promise.resolve(Digit.UploadServices.Filestorage("NOC",C,Digit.ULBService.getStateId()||(null==s?void 0:s.split(".")[0]))).then(function(e){var t,l,n,i;(null==e||null===(t=e.data)||void 0===t||null===(l=t.files)||void 0===l?void 0:l.length)>0?I(null==e||null===(n=e.data)||void 0===n||null===(i=n.files[0])||void 0===i?void 0:i.fileStoreId):B(r("CS_FILE_UPLOAD_ERROR"))})},function(){B(r("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]),t.useEffect(()=>{d&&g((e=>{var t;let{t:n,action:i,approvers:a,selectedApprover:r,setSelectedApprover:u,selectFile:d,uploadedFile:s,setUploadedFile:c,assigneeLabel:v,businessService:p,error:m}=e,E=!1;"REVOCATE"!=(null==i?void 0:i.action)&&"REJECT"!=(null==i?void 0:i.action)||(E=!0);let _=!1;return"APPROVE"!=(null==i?void 0:i.action)&&"REJECT"!=(null==i?void 0:i.action)&&"AUTO_APPROVE"!=i.action&&"AUTO_REJECT"!=i.action||(_=!0),{label:{heading:`WF_${null==i?void 0:i.action}_APPLICATION`,submit:`WF_${p}_${null==i?void 0:i.action}`,cancel:"CORE_LOGOUTPOPUP_CANCEL"},form:[{body:[{label:i.isTerminateState||_?null:n(v||"WF_ROLE_"+(null===(t=i.assigneeRoles)||void 0===t?void 0:t[0])),type:"dropdown",populators:i.isTerminateState||_?null:l.createElement(o.Dropdown,{option:a,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:u,selected:r})},{label:n("WF_COMMON_COMMENTS"),type:"textarea",isMandatory:E,populators:{name:"comments"}},{label:""+n("WF_APPROVAL_UPLOAD_HEAD"),populators:l.createElement(o.UploadFile,{id:"workflow-doc",onUpload:d,onDelete:()=>{c(null)},showHint:!0,message:s?"1 "+n("ES_PT_ACTION_FILEUPLOADED"):n("CS_ACTION_NO_FILEUPLOADED"),accept:"image/*, .pdf, .png, .jpeg, .jpg",iserror:m})}]}]}})({t:r,action:d,approvers:y,selectedApprover:T,setSelectedApprover:b,selectFile:R,uploadedFile:N,setUploadedFile:I,businessService:E,assigneeLabel:"WF_ASSIGNEE_NAME_LABEL",error:L}))},[d,y,N,L]),d&&A.form?l.createElement(o.Modal,{headerBarMain:l.createElement(qn,{label:r(A.label.heading)}),headerBarEnd:l.createElement(Jn,{onClick:c}),actionCancelLabel:r(A.label.cancel),actionCancelOnSubmit:c,actionSaveLabel:r(A.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action",isOBPSFlow:!0,popupStyles:O?{width:"720px"}:{},style:O?{height:"45px",width:"44%"}:{height:"45px",width:"107px",paddingLeft:"0px",paddingRight:"0px"},popupModuleMianStyles:O?{paddingLeft:"5px"}:{}},f?l.createElement(o.Loader,null):l.createElement(o.FormComposer,{config:A.form,cardStyle:{marginLeft:"0px",marginRight:"0px",marginTop:"-25px"},className:"BPAemployeeCard",noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){var t,l,n;let i=JSON.parse(sessionStorage.getItem("NewNOCDocs")),o=(null===(t=p)||void 0===t||null===(l=t.documents)||void 0===l?void 0:l.length)>0?[...null===(n=p)||void 0===n?void 0:n.documents]:[];i.map((e,t)=>{o.push(e)}),p={...p,workflow:{action:null==d?void 0:d.action,comment:null!=e&&e.comments?null==e?void 0:e.comments:null,assignee:null!=T&&T.uuid?[null==T?void 0:T.uuid]:null,documents:N?[{documentType:(null==d?void 0:d.action)+" DOC",fileName:null==C?void 0:C.name,fileStoreId:N}]:null},documents:o},v({Noc:p},!1,{isNoc:!0})},defaultValues:S,formId:"modal-action"})):l.createElement(o.Loader,null)},Qn=e=>l.createElement("h1",{className:"heading-m"},e.label),ei=()=>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"})),ti=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(ei,null)),li=function(e,t){void 0===t&&(t="dayend");try{const l=e.match(/(\d{4})-(\d{1,2})-(\d{1,2})/),n=new Date(Date.UTC(l[1],l[2]-1,l[3]));return n.setMinutes(n.getMinutes()+n.getTimezoneOffset()),"dayend"===t&&(n.setHours(n.getHours()+24),n.setSeconds(n.getSeconds()-1)),n.getTime()}catch(t){return e}},ni=e=>{var n,i;let{t:a,action:r,tenantId:u,closeModal:d,submitAction:c,applicationData:v,businessService:p}=e;const{data:E,isLoading:_}=Digit.Hooks.useEmployeeSearch(u,{roles:null==r||null===(n=r.assigneeRoles)||void 0===n||null===(i=n.map)||void 0===i?void 0:i.call(n,e=>({code:e})),isActive:!0},{enabled:!(null!=r&&r.isTerminateState)}),[f,A]=t.useState({}),[g,S]=t.useState({}),[h,y]=t.useState([]),[D,T]=t.useState({}),[b,C]=t.useState(null),[P,N]=t.useState(null),[I,L]=t.useState(null),B=window.Digit.Utils.browser.isMobile(),O=window.location.href.includes("/employee");function R(e){C(e.target.files[0])}return t.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]),t.useEffect(()=>{!function(){try{L(null);const e=function(){if(b){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(b.size>=5242880)L(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=b&&b.type&&!e.test(null==b?void 0:b.type))L(a("NOT_SUPPORTED_FILE_TYPE"));else{const e=m(function(){return Promise.resolve(Digit.UploadServices.Filestorage("WS",b,Digit.ULBService.getCurrentTenantId())).then(function(e){var t,l,n,i;(null==e||null===(t=e.data)||void 0===t||null===(l=t.files)||void 0===l?void 0:l.length)>0?N(null==e||null===(n=e.data)||void 0===n||null===(i=n.files[0])||void 0===i?void 0:i.fileStoreId):L(a("CS_FILE_UPLOAD_ERROR"))})},function(e){console.error("Modal -> err ",e),L(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)}}()},[b]),t.useEffect(()=>{var e,t,n,i;"DisconnectWSConnection"==(null===(e=v)||void 0===e||null===(t=e.processInstance)||void 0===t?void 0:t.businessService)||"DisconnectSWConnection"==(null===(n=v)||void 0===n||null===(i=n.processInstance)||void 0===i?void 0:i.businessService)?r&&A((e=>{var t;let{t:n,action:i,approvers:a,selectedApprover:r,setSelectedApprover:u,selectFile:d,uploadedFile:c,setUploadedFile:v,businessService:p,error:m}=e,E=!0,_=!1;return(null!=i&&null!==(t=i.action)&&void 0!==t&&t.includes("SEND_BACK")||"APPROVE_FOR_DISCONNECTION"==(null==i?void 0:i.action)||"RESUBMIT_APPLICATION"==(null==i?void 0:i.action))&&(E=!1),i.isTerminateState&&(E=!1),"EXECUTE_DISCONNECTION"!=(null==i?void 0:i.action)&&"DISCONNECTION_EXECUTED"!=(null==i?void 0:i.action)||(_=!0),{label:{heading:`WF_${null==i?void 0:i.action}_APPLICATION`,submit:`WF_${null==p?void 0:p.toUpperCase()}_${null==i?void 0:i.action}`,cancel:"CS_COMMON_CANCEL"},form:[{body:[{label:E?n("WF_ASSIGNEE_NAME_LABEL"):null,placeholder:E?n("WF_ASSIGNEE_NAME_PLACEHOLDER"):null,type:"dropdown",populators:E?l.createElement(o.Dropdown,{option:a,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:u,selected:r}):null},_&&{label:n("ES_FSM_ACTION_SERVICE_DATE"),isMandatory:!!_,type:"custom",populators:_?{name:"date",validation:{required:!0},defaultValue:Digit.Utils.date.getDate(),component:(e,t)=>l.createElement(o.DatePicker,s({onChange:e.onChange,date:e.value},t))}:null},{label:n("WF_COMMON_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:n("WS_APPROVAL_CHECKLIST_BUTTON_UP_FILE"),populators:l.createElement(o.UploadFile,{id:"workflow-doc",accept:".jpg,.pdf,.png,.jpeg",onUpload:d,onDelete:()=>{v(null)},message:c?"1 "+n("ES_PT_ACTION_FILEUPLOADED"):n("CS_ACTION_NO_FILEUPLOADED"),error:m,iserror:m,showHintBelow:!0,hintText:"WS_HINT_TEXT_LABEL"})}]}]}})({t:a,action:r,approvers:h,selectedApprover:D,setSelectedApprover:T,selectFile:R,uploadedFile:P,setUploadedFile:N,businessService:p,error:I})):r&&A((e=>{var t;let{t:n,action:i,approvers:a,selectedApprover:r,setSelectedApprover:u,selectFile:d,uploadedFile:s,setUploadedFile:c,businessService:v,error:p}=e,m=!0;return(null!=i&&null!==(t=i.action)&&void 0!==t&&t.includes("SEND_BACK")||"APPROVE_FOR_CONNECTION"==(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==v?void 0:v.toUpperCase()}_${null==i?void 0:i.action}`,cancel:"CS_COMMON_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(o.Dropdown,{option:a,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:u,selected:r}):null},{label:n("WF_COMMON_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:n("WS_APPROVAL_CHECKLIST_BUTTON_UP_FILE"),populators:l.createElement(o.UploadFile,{id:"workflow-doc",accept:".jpg,.pdf,.png,.jpeg",onUpload:d,onDelete:()=>{c(null)},message:s?"1 "+n("ES_PT_ACTION_FILEUPLOADED"):n("CS_ACTION_NO_FILEUPLOADED"),error:p,iserror:p,showHintBelow:!0,hintText:"WS_HINT_TEXT_LABEL"})}]}]}})({t:a,action:r,approvers:h,selectedApprover:D,setSelectedApprover:T,selectFile:R,uploadedFile:P,setUploadedFile:N,businessService:p,error:I}))},[r,h,P,I]),r&&f.form?l.createElement(o.Modal,{headerBarMain:l.createElement(Qn,{label:a(f.label.heading)}),headerBarEnd:l.createElement(ti,{onClick:d}),actionCancelLabel:a(f.label.cancel),actionCancelOnSubmit:d,actionSaveLabel:a(f.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action",style:B&&O?{width:"100%",height:"auto"}:{}},_?l.createElement(o.Loader,null):l.createElement(o.FormComposer,{config:f.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){var t,l,n,i,o,a,d,s,p,m;if(null!==(t=v)&&void 0!==t&&t.isBillAmend){var E,_,f,A,g,S,h,y,T;const t={...null===(E=v)||void 0===E||null===(_=E.billAmendmentDetails)||void 0===_?void 0:_.additionalDetails,comments:null!=e&&e.comments?e.comments:null},l={...null===(f=v)||void 0===f?void 0:f.billAmendmentDetails,workflow:{businessId:null===(A=v)||void 0===A||null===(g=A.billAmendmentDetails)||void 0===g?void 0:g.amendmentId,action:null==r?void 0:r.action,tenantId:u,businessService:null!==(S=v)&&void 0!==S&&null!==(h=S.applicationType)&&void 0!==h&&h.includes("WATER")?"WS.AMENDMENT":"SW.AMENDMENT",moduleName:null!==(y=v)&&void 0!==y&&null!==(T=y.applicationType)&&void 0!==T&&T.includes("WATER")?"WS":"SW",assignes:null!=D&&D.uuid?[{uuid:null==D?void 0:D.uuid}]:[],comment:(null==e?void 0:e.comments)||"",documents:P?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==b?void 0:b.name,fileStoreId:P}]:[]},additionalDetails:t,comment:(null==e?void 0:e.comments)||"",wfDocuments:P?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==b?void 0:b.name,fileStoreId:P}]:null,processInstance:{action:null==r?void 0:r.action,assignes:null!=D&&D.uuid?[{uuid:null==D?void 0:D.uuid}]:[],comment:(null==e?void 0:e.comments)||"",documents:P?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==b?void 0:b.name,fileStoreId:P}]:[]}};c({AmendmentUpdate:l})}else{if(v={...v,action:null==r?void 0:r.action,comment:(null==e?void 0:e.comments)||"",assignee:null!=D&&D.uuid?[null==D?void 0:D.uuid]:[],assignes:null!=D&&D.uuid?[{uuid:null==D?void 0:D.uuid}]:[],wfDocuments:P?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==b?void 0:b.name,fileStoreId:P}]:null,processInstance:{...null===(l=v)||void 0===l?void 0:l.processInstance,action:null==r?void 0:r.action,assignes:null!=D&&D.uuid?[{uuid:null==D?void 0:D.uuid}]:[],comment:(null==e?void 0:e.comments)||"",documents:P?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==b?void 0:b.name,fileStoreId:P}]:[]}},null!=e&&e.date&&null!==(n=v)&&void 0!==n&&null!==(i=n.applicationType)&&void 0!==i&&i.includes("DISCONNECT")){const t=ft(null==e?void 0:e.date);v.disconnectionExecutionDate=li(t)}else if(null!=e&&e.date){const t=ft(null==e?void 0:e.date);v.connectionExecutionDate=li(t)}var C;if("DisconnectWSConnection"==(null===(o=v)||void 0===o||null===(a=o.processInstance)||void 0===a?void 0:a.businessService)||"DisconnectSWConnection"==(null===(d=v)||void 0===d||null===(s=d.processInstance)||void 0===s?void 0:s.businessService)||window.location.href.includes("disconnection"))"WATER"==(null===(C=v)||void 0===C?void 0:C.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===(m=v)||void 0===m?void 0:m.applicationType))c({WaterConnection:v,disconnectRequest:!1,reconnectRequest:!0});else{var N,I,L,B,O,R,w,x,M,F,k,U,H;const e=sessionStorage.getItem("Digit.ADHOC_ADD_REBATE_DATA"),t=e?JSON.parse(e):"";null!=t&&null!==(N=t.value)&&void 0!==N&&N.adhocPenalty&&(v.additionalDetails.adhocPenalty=parseInt(null==t||null===(I=t.value)||void 0===I?void 0:I.adhocPenalty)||""),null!=t&&null!==(L=t.value)&&void 0!==L&&L.adhocPenaltyComment&&(v.additionalDetails.adhocPenaltyComment=(null==t||null===(B=t.value)||void 0===B?void 0:B.adhocPenaltyComment)||""),null!=t&&null!==(O=t.value)&&void 0!==O&&O.adhocPenaltyReason&&(v.additionalDetails.adhocPenaltyReason=(null==t||null===(R=t.value)||void 0===R?void 0:R.adhocPenaltyReason)||""),null!=t&&null!==(w=t.value)&&void 0!==w&&w.adhocRebate&&(v.additionalDetails.adhocRebate=parseInt(null==t||null===(x=t.value)||void 0===x?void 0:x.adhocRebate)||""),null!=t&&null!==(M=t.value)&&void 0!==M&&M.adhocRebateComment&&(v.additionalDetails.adhocRebateComment=(null==t||null===(F=t.value)||void 0===F?void 0:F.adhocRebateComment)||""),null!=t&&null!==(k=t.value)&&void 0!==k&&k.adhocRebateReason&&(v.additionalDetails.adhocRebateReason=(null==t||null===(U=t.value)||void 0===U?void 0:U.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:g,formId:"modal-action"})):l.createElement(o.Loader,null)},ii=e=>l.createElement("h1",{className:"heading-m"},e.label),oi=()=>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"})),ai=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(oi,null)),ri=e=>{var n,i;let{t:a,action:r,tenantId:u,closeModal:d,submitAction:s,applicationData:c,businessService:v,moduleCode:p}=e;console.log("applicationData",c);const{data:E}=Digit.Hooks.useEmployeeSearch(u,{roles:null==r||null===(n=r.assigneeRoles)||void 0===n||null===(i=n.map)||void 0===i?void 0:i.call(n,e=>({code:e})),isActive:!0},{enabled:!(null!=r&&r.isTerminateState)}),[_,f]=t.useState({}),[A,g]=t.useState({}),[S,h]=t.useState([]),[y,D]=t.useState(null),[T,b]=t.useState(null),[C,P]=t.useState(null),[N,I]=t.useState(null),[L,B]=t.useState(!1);function O(e){b(e.target.files[0])}return t.useEffect(()=>{var e;h(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]),t.useEffect(()=>{!function(){try{I(null);const e=function(){if(T){const e=function(){if(T.size>=5242880)I(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=m(function(){return Promise.resolve(Digit.UploadServices.Filestorage("PTR",T,Digit.ULBService.getStateId())).then(function(e){var t,l,n,i;(null==e||null===(t=e.data)||void 0===t||null===(l=t.files)||void 0===l?void 0:l.length)>0?P(null==e||null===(n=e.data)||void 0===n||null===(i=n.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)}}()},[T]),t.useEffect(()=>{r&&f((e=>{let{t:t,action:l,businessService:n}=e;return{label:{heading:`WF_${null==l?void 0:l.action}_APPLICATION`,submit:`WF_${n}_${null==l?void 0:l.action}`,cancel:"ES_PTR_COMMON_CANCEL"},form:[{body:[{label:t("ES_PTR_ACTION_COMMENTS"),type:"textarea",populators:{name:"comments"}}]}]}})({t:a,action:r,approvers:S,selectedApprover:y,setSelectedApprover:D,selectFile:O,uploadedFile:C,setUploadedFile:P,businessService:v}))},[r,S,C]),r&&_.form?l.createElement(o.Modal,{headerBarMain:l.createElement(ii,{label:a(_.label.heading)}),headerBarEnd:l.createElement(ai,{onClick:d}),actionCancelLabel:a(_.label.cancel),actionCancelOnSubmit:d,actionSaveLabel:a(_.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},l.createElement(o.FormComposer,{config:_.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"};c.creationReason="CREATE",s({PetRegistrationApplications:[{...c,workflow:t}]})}let t={action:null==r?void 0:r.action,comments:null==e?void 0:e.comments,businessService:v,moduleName:p};t.assignes=null!=r&&r.isTerminateState||!y?[]:[y],C&&(t.documents=[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==T?void 0:T.name,fileStoreId:C}]),s({PetRegistrationApplications:[{...c,workflow:t}]})},defaultValues:A,formId:"modal-action"})):l.createElement(o.Loader,null)},ui=e=>l.createElement("h1",{className:"heading-m"},e.label),di=()=>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"})),si=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(di,null)),ci=e=>{var n,i,a;let{t:r,action:u,closeModal:d,submitAction:s,applicationData:c,businessService:v}=e;const p=Digit.ULBService.getStateId(),{data:m,isLoading:E}=Digit.Hooks.tl.useTradeLicenseMDMS(p,"TradeLicense","TradeUnits","[?(@.type=='TL')]");console.log("tradeMdmsData",null==m||null===(n=m.TradeLicense)||void 0===n?void 0:n.TradeType),console.log("applicationData",c);const[_,f]=t.useState({}),[A,g]=t.useState({}),[S,h]=t.useState([]),[y,D]=t.useState(""),[T,b]=t.useState([]),[C,P]=t.useState(null),N=null===(i=c)||void 0===i||null===(a=i.tradeLicenseDetail)||void 0===a?void 0:a.tradeUnits;console.log("tradeUnits",N);const I=t.useMemo(()=>{var e;if(E||!m||!N.length)return[];const t=new Set(N.map(e=>e.tradeType)),l=(null===(e=m.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",l),l?["1"]:["1","2","3"]},[E,m,N]);return console.log("years",I),t.useEffect(()=>{u&&f((e=>{let{t:t,action:n,years:i,selectedApprover:a,setSelectedApprover:r,businessService:u}=e;return{label:{heading:`WF_${null==n?void 0:n.action}_APPLICATION`,submit:`WF_${null==u?void 0:u.toUpperCase()}_${null==n?void 0:n.action}`,cancel:"WF_EMPLOYEE_NEWTL_CANCEL"},form:[{body:[{label:t("TL_VALID_FOR_NO_OF_YEARS"),type:"dropdown",populators:l.createElement(o.Dropdown,{option:i,autoComplete:"off",select:r,selected:a})}]}]}})({t:r,action:u,years:I,selectedApprover:y,setSelectedApprover:D,businessService:v}))},[u,I,T,C]),u&&_.form?l.createElement(o.Modal,{headerBarMain:l.createElement(ui,{label:r(_.label.heading)}),headerBarEnd:l.createElement(si,{onClick:d}),actionCancelLabel:r(_.label.cancel),actionCancelOnSubmit:d,actionSaveLabel:r(_.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},E?l.createElement(o.Loader,null):l.createElement(o.FormComposer,{config:_.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){var t;let l=null===(t=c)||void 0===t?void 0:t.financialYear;const n=null==l?void 0:l.split("-")[1],i=`20${Number(n)}-${Number(n)+1}`;c={...c,financialYear:i,action:"INITIATE",additionalDetail:{...c.additionalDetail,validityYears:y.length>0?parseInt(y):""}},s({Licenses:[c]})},defaultValues:A,formId:"modal-action"})):l.createElement(o.Loader,null)},vi=e=>l.createElement("h1",{className:"heading-m"},e.label),pi=()=>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"})),mi=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(pi,null)),Ei=e=>{var n,i;let{t:a,action:r,tenantId:u,closeModal:d,submitAction:s,applicationData:c,businessService:v,moduleCode:p}=e;const{data:_}=Digit.Hooks.useEmployeeSearch(u,{roles:null==r||null===(n=r.assigneeRoles)||void 0===n||null===(i=n.map)||void 0===i?void 0:i.call(n,e=>({code:e})),isActive:!0},{enabled:null==r?void 0:r.isTerminateState}),[f,A]=t.useState({}),[g,S]=t.useState({}),[h,y]=t.useState([]),[D,T]=t.useState(null),[b,C]=t.useState(null),[P,N]=t.useState(null),[I,L]=t.useState(null),[B,O]=t.useState(!1);function R(e){O(!0),C(e.target.files[0])}return t.useEffect(()=>{var e;y(null==_||null===(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}}))},[_]),t.useEffect(()=>{!function(){try{L(null);const e=function(){if(b){const e=function(){if(b.size>=5242880)L(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=E(function(){return m(function(){return Promise.resolve(Digit.UploadServices.Filestorage("StreetVending",b,u)).then(function(e){var t,l,n,i;(null==e||null===(t=e.data)||void 0===t||null===(l=t.files)||void 0===l?void 0:l.length)>0?N(null==e||null===(n=e.data)||void 0===n||null===(i=n.files[0])||void 0===i?void 0:i.fileStoreId):L(a("CS_FILE_UPLOAD_ERROR"))})},function(){L(a("CS_FILE_UPLOAD_ERROR"))})},function(e,t){if(O(!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)}}()},[b]),console.log("actyhdesh,jhfsefsef",r,c),t.useEffect(()=>{A((e=>{let{t:t,action:n,selectFile:i,uploadedFile:a,setUploadedFile:r,approvers:u,selectedApprover:d,setSelectedApprover:s,isUploading:c}=e;const v=()=>l.createElement("div",{className:"loading-spinner"});return console.log("isuploading ",c),{label:{heading:`WF_${null==n?void 0:n.action}_APPLICATION`,submit:"SV_"+(null==n?void 0:n.action),cancel:"SV_COMMON_CANCEL"},form:[{body:["APPROVE"===(null==n?void 0:n.action)||"REJECT"===(null==n?void 0:n.action)||"SENDBACKTOCITIZEN"===(null==n?void 0:n.action)?"":{label:t("SV_ASSIGNEE"),type:"dropdown",populators:l.createElement(o.Dropdown,{option:u,t:t,optionKey:"name",select:s,selected:d})},{label:t("SV_ACTION_COMMENTS"),isMandatory:!0,type:"textarea",populators:{name:"comments",validation:{required:!0}}},{label:`${t("SV_ATTATCH_FILE")}${n.docUploadRequired?" *":""}`,populators:l.createElement(o.UploadFile,{id:"workflow-doc-sv",onUpload:i,onDelete:()=>{r(null)},message:c?l.createElement("div",{style:{display:"flex",alignItems:"center",gap:"8px"}},l.createElement(v,null),l.createElement("span",null,"Uploading...")):a?"1 "+t("SV_FILE_UPLOADED"):t("SV_NO_FILE")})}]}]}})({t:a,action:r,approvers:h,selectedApprover:D,setSelectedApprover:T,selectFile:R,uploadedFile:P,setUploadedFile:N,businessService:v,isUploading:B}))},[r,h,P]),r&&f.form?l.createElement(o.Modal,{headerBarMain:l.createElement(vi,{label:a(f.label.heading)}),headerBarEnd:l.createElement(mi,{onClick:d}),actionCancelLabel:a(f.label.cancel),actionCancelOnSubmit:d,actionSaveLabel:a(f.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},l.createElement(o.FormComposer,{config:f.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){var t;let l={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==c||null===(t=c.auditDetails)||void 0===t?void 0:t.createdBy]:null!=D&&D.uuid?[null==D?void 0:D.uuid]:null};P&&(l.documents=[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==b?void 0:b.name,fileStoreId:P}]),s({streetVendingDetail:{...c,workflow:l}})},defaultValues:g,formId:"modal-action"})):l.createElement(o.Loader,null)},_i=e=>l.createElement("h1",{className:"heading-m"},e.label),fi=()=>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"})),Ai=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(fi,null)),gi=e=>{var n,i;let{t:a,action:r,tenantId:u,closeModal:d,submitAction:s,applicationData:c,businessService:v,moduleCode:p}=e;console.log("applicationData",c);const{data:E}=Digit.Hooks.useEmployeeSearch(u,{roles:null==r||null===(n=r.assigneeRoles)||void 0===n||null===(i=n.map)||void 0===i?void 0:i.call(n,e=>({code:e})),isActive:!0},{enabled:!(null!=r&&r.isTerminateState)}),[_,f]=t.useState({}),[A,g]=t.useState({}),[S,h]=t.useState([]),[y,D]=t.useState(null),[T,b]=t.useState(null),[C,P]=t.useState(null),[N,I]=t.useState(null),[L,B]=t.useState(!1);function O(e){b(e.target.files[0])}return t.useEffect(()=>{var e;h(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]),t.useEffect(()=>{!function(){try{I(null);const e=function(){if(T){const e=function(){if(T.size>=5242880)I(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=m(function(){return Promise.resolve(Digit.UploadServices.Filestorage("CHB",T,Digit.ULBService.getStateId())).then(function(e){var t,l,n,i;(null==e||null===(t=e.data)||void 0===t||null===(l=t.files)||void 0===l?void 0:l.length)>0?P(null==e||null===(n=e.data)||void 0===n||null===(i=n.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)}}()},[T]),t.useEffect(()=>{r&&f((e=>{let{t:t,action:n,selectFile:i,uploadedFile:a,setUploadedFile:r,businessService:u}=e;return{label:{heading:`WF_${null==n?void 0:n.action}_APPLICATION`,submit:`WF_${u}_${null==n?void 0:n.action}`,cancel:"ES_CHB_COMMON_CANCEL"},form:[{body:[{label:t("ES_CHB_ACTION_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:`${t("ES_CHB_ATTACH_FILE")}${n.docUploadRequired?" *":""}`,populators:l.createElement(o.UploadFile,{id:"workflow-doc",onUpload:i,onDelete:()=>{r(null)},showHint:!0,hintText:t("CHB_ATTACH_RESTRICTIONS_SIZE"),message:a?"1 "+t("ES_CHB_ACTION_FILEUPLOADED"):t("ES_CHB_ACTION_NO_FILEUPLOADED")})}]}]}})({t:a,action:r,approvers:S,selectedApprover:y,setSelectedApprover:D,selectFile:O,uploadedFile:C,setUploadedFile:P,businessService:v}))},[r,S,C]),r&&_.form?l.createElement(o.Modal,{headerBarMain:l.createElement(_i,{label:a(_.label.heading)}),headerBarEnd:l.createElement(Ai,{onClick:d}),actionCancelLabel:a(_.label.cancel),actionCancelOnSubmit:d,actionSaveLabel:a(_.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},l.createElement(o.FormComposer,{config:_.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};C&&(t.documents=[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==T?void 0:T.name,filestoreId:C}]),s({hallsBookingApplication:[{...c,workflow:t}]})},defaultValues:A,formId:"modal-action"})):l.createElement(o.Loader,null)},Si=e=>l.createElement("h1",{className:"heading-m"},e.label),hi=()=>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"})),yi=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(hi,null)),Di=e=>{var n,a,r;let{t:u,action:d,tenantId:s,closeModal:c,submitAction:v,applicationData:p,businessService:m,moduleCode:E}=e;const{data:_}=Digit.Hooks.useEmployeeSearch(s,{roles:null==d||null===(n=d.roles)||void 0===n||null===(a=n[0])||void 0===a||null===(r=a.map)||void 0===r?void 0:r.call(a,e=>({code:e})),isActive:!0},{enabled:!(null!=d&&d.isTerminateState)}),f=i.useHistory(),[A,g]=t.useState({}),[S,h]=t.useState({}),[y,D]=t.useState([]),[T,b]=t.useState(null),[C,P]=t.useState(null);return t.useEffect(()=>{var e;D(null==_||null===(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}}))},[_]),t.useEffect(()=>{"INITIATED"===(null==d?void 0:d.state)?f.push("/digit-ui/employee/asset/assetservice/edit/"+(null==p?void 0:p.applicationNo)):g((e=>{let{t:t,action:l,businessService:n}=e;return{label:{heading:`WF_${null==l?void 0:l.action}_APPLICATION`,submit:`WF_${n}_${null==l?void 0:l.action}`,cancel:"ES_AST_COMMON_CANCEL"},form:[{body:[{label:t("AST_ACTION_COMMENTS"),type:"textarea",populators:{name:"comments"}}]}]}})({t:u,action:d,approvers:y,selectedApprover:T,setSelectedApprover:b,uploadedFile:C,setUploadedFile:P,businessService:m}))},[d,y,C]),d&&A.form?l.createElement(o.Modal,{headerBarMain:l.createElement(Si,{label:u(A.label.heading)}),headerBarEnd:l.createElement(yi,{onClick:c}),actionCancelLabel:u(A.label.cancel),actionCancelOnSubmit:c,actionSaveLabel:u(A.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},l.createElement(o.FormComposer,{config:A.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){let t={action:null==d?void 0:d.action,comment:null==e?void 0:e.comments,businessService:m,moduleName:E};C&&(t.documents=[]),v({Asset:{...p,workflow:t}})},defaultValues:S,formId:"modal-action"})):l.createElement(o.Loader,null)},Ti=e=>null!=e&&e.businessService.includes("PT")?l.createElement(Mn,e):null!=e&&e.businessService.includes("ptr")?l.createElement(ri,e):null!=e&&e.businessService.includes("NewTL")||null!=e&&e.businessService.includes("TL")||null!=e&&e.businessService.includes("EDITRENEWAL")?l.createElement(Hn,e):null!=e&&e.businessService.includes("DIRECTRENEWAL")?l.createElement(ci,e):null!=e&&e.moduleCode.includes("BPAREG")?l.createElement(Kn,e):null!=e&&e.moduleCode.includes("BPA")?l.createElement(Vn,e):null!=e&&e.moduleCode.includes("NOC")?l.createElement(Zn,e):null!=e&&e.moduleCode.includes("WS")?l.createElement(ni,e):null!=e&&e.businessService.includes("street-vending")?l.createElement(Ei,e):null!=e&&e.businessService.includes("chb")?l.createElement(gi,e):null!=e&&e.businessService.includes("asset-create")?l.createElement(Di,e):void 0,bi=e=>{var n,i;let{t:o,formData:a,applicationData:r,docs:u,bpaActionsDetails:d}=e;const s=(null==r?void 0:r.status)||"",c=(null==d||null===(n=d.data)||void 0===n?void 0:n.nextActions)||[],v=Digit.ULBService.getStateId(),[p,m]=t.useState((null==a||null===(i=a.documents)||void 0===i?void 0:i.documents)||[]),[E,_]=t.useState(null),[f,A]=t.useState([]),[g,S]=t.useState(!0),[h,y]=t.useState(!1),[D,T]=t.useState(!1),{isLoading:b,data:C}=Digit.Hooks.obps.useMDMS(v,"BPA",["DocTypeMapping"]),{isLoading:P,data:N}=Digit.Hooks.obps.useMDMS(v,"common-masters",["DocumentType"]);return t.useEffect(()=>{var e,t,l,n;let i=[];var o,a;null!=C&&null!==(e=C.BPA)&&void 0!==e&&e.DocTypeMapping&&(i=null==C||null===(o=C.BPA)||void 0===o||null===(a=o.DocTypeMapping)||void 0===a?void 0:a.filter(e=>{var t,l;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===(l=r.additionalDetails)||void 0===l?void 0:l.applicationType)}));let d=[];null===(t=i)||void 0===t||null===(l=t[0])||void 0===l||null===(n=l.docTypes)||void 0===n||n.forEach(e=>{var t,l,n,i;let o=e.code;e.dropdownData=[],e.uploadedDocuments=[],null==N||null===(t=N["common-masters"])||void 0===t||null===(l=t.DocumentType)||void 0===l||l.forEach(t=>{let l=t.code.slice(0,o.length);o===l&&(e.hasDropdown=!0,t.i18nKey=t.code,e.dropdownData.push(t))}),e.uploadedDocuments[0]={},e.uploadedDocuments[0].values=[],null==u||null===(n=u[0])||void 0===n||null===(i=n.values)||void 0===i||i.map(t=>{var l,n;o===`${null==t||null===(l=t.documentType)||void 0===l?void 0:l.split(".")[0]}.${null==t||null===(n=t.documentType)||void 0===n?void 0:n.split(".")[1]}`&&e.uploadedDocuments[0].values.push(t)}),d.push(e)}),sessionStorage.setItem("BPA_DOCUMENTS",JSON.stringify(d)),A(d)},[!b,!P]),t.useEffect(()=>{let e=0;f.map(t=>{let l=!1;p.map(e=>{t.required&&t.code==`${e.documentType.split(".")[0]}.${e.documentType.split(".")[1]}`&&(l=!0)}),!l&&t.required&&(e+=1)}),S("0"!=e&&0!=e||!(p.length>0))},[p,h]),t.useEffect(()=>{T("DOC_VERIFICATION_INPROGRESS"===s&&(null==c?void 0:c.length)>0)},[r,d]),l.createElement("div",{style:{display:"flex",flexWrap:"wrap"}},null==f?void 0:f.map((e,t)=>l.createElement("div",{style:{padding:"20px"}},l.createElement(Ci,{key:t,index:t,document:e,t:o,error:E,setError:_,setDocuments:m,documents:p,setCheckRequiredFields:y,applicationStatus:s,actions:c,bpaTaxDocuments:f,checkEnablingDocs:D}))))};function Ci(e){var n,i;let{t:a,document:r,setDocuments:u,documents:d,index:s,bpaTaxDocuments:c,checkEnablingDocs:v}=e;const p=null==d?void 0:d.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],m=Digit.ULBService.getStateId(),[E,_]=t.useState(p?{...p,active:!0,code:null==p?void 0:p.documentType,i18nKey:null==p?void 0:p.documentType}:1===(null==r||null===(n=r.dropdownData)||void 0===n?void 0:n.length)?null==r?void 0:r.dropdownData[0]:{}),[f,A]=t.useState(null),[g,S]=t.useState(()=>(null==p?void 0:p.fileStoreId)||null),[h,y]=t.useState([]);return t.useEffect(()=>{null!=E&&E.code&&u(e=>{var t;const l=null==e?void 0:e.filter(e=>(null==e?void 0:e.documentType)!==(null==E?void 0:E.code));return 0===(null==g?void 0:g.length)||null===g?l:[...null==l?void 0:l.filter(e=>(null==e?void 0:e.fileStoreId)!==g),{documentType:null==E?void 0:E.code,fileStoreId:g,documentUid:g,fileName:(null==f?void 0:f.name)||"",id:d?null===(t=d.find(e=>e.documentType===(null==E?void 0:E.code)))||void 0===t?void 0:t.id:void 0}]})},[g,E]),t.useEffect(()=>{try{h.length>0&&(sessionStorage.removeItem("BPA_DOCUMENTS"),r.newUploadedDocs=[],h.map(e=>{var t,l,n;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===(l=e.fileStoreId)||void 0===l?void 0:l.fileStoreId,tenantId:null==e||null===(n=e.fileStoreId)||void 0===n?void 0:n.tenantId})}),c[s]=r,sessionStorage.setItem("BPA_DOCUMENTS",JSON.stringify(c)))}catch(e){Promise.reject(e)}},[h,E]),t.useEffect(()=>{},[f]),l.createElement("div",{style:{marginBottom:"24px",maxWidth:"950px",minWidth:"280px",background:"#FAFAFA",borderRadius:"4px",border:"1px solid #D6D5D4",padding:"8px"}},l.createElement(o.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(Vl,{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(o.LabelFieldPair,{style:{width:"100%"}},l.createElement(o.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(o.Dropdown,{className:"form-field",t:a,isMandatory:!1,option:null==r?void 0:r.dropdownData,selected:E,optionKey:"i18nKey",select:e=>_(e),style:{width:"100%"}})),l.createElement(o.LabelFieldPair,{style:{width:"100%"}},l.createElement(o.CardLabel,{className:"card-label-smaller",style:{width:"100%"}}),l.createElement("div",{className:"field",style:{width:"100%"}},l.createElement(o.MultiUploadWrapper,{module:"BPA",tenantId:m,getFormState:e=>((e,t)=>{let l=Object.fromEntries(t),n=Object.values(l);var i;0!==Object.keys(l).length&&y(n),(i=n[n.length-1])&&A(i.file)})(0,e),t:a,allowedFileTypesRegex:/(.*?)(jpg|jpeg|png|image|pdf)$/i,allowedMaxSizeInMB:5,acceptFiles:"image/*, .pdf, .png, .jpeg, .jpg"})))):null)}function Pi(e){let{t:n,document:i,setNocDocuments:a,setError:r,nocDocuments:u}=e;const d=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],s=Digit.ULBService.getStateId(),[c,v]=t.useState(),[p,E]=t.useState(null),[_,f]=t.useState(()=>(null==d?void 0:d.fileStoreId)||null);return t.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 l=null==e?void 0:e.filter(e=>{var t,l;return(null==e?void 0:e.documentType)!==(null==i||null===(t=i.dropdownData)||void 0===t||null===(l=t[0])||void 0===l?void 0:l.code)});return 0===(null==_?void 0:_.length)||null===_?l:[...null==l?void 0:l.filter(e=>(null==e?void 0:e.fileStoreId)!==_),{documentType:null==i||null===(t=i.dropdownData)||void 0===t?void 0:t[0].code,fileStoreId:_,documentUid:_,fileName:(null==p?void 0:p.name)||""}]})},[_]),t.useEffect(()=>{!function(){try{r(null);const e=function(){if(p){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(p.size>=5242880)r(n("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=p&&p.type&&!e.test(null==p?void 0:p.type))r(n("NOT_SUPPORTED_FILE_TYPE"));else{const e=m(function(){return f(null),Promise.resolve(Digit.UploadServices.Filestorage("PT",p,Digit.ULBService.getStateId())).then(function(e){var t,l,i,o;(null==e||null===(t=e.data)||void 0===t||null===(l=t.files)||void 0===l?void 0:l.length)>0?f(null==e||null===(i=e.data)||void 0===i||null===(o=i.files[0])||void 0===o?void 0:o.fileStoreId):r(n("CS_FILE_UPLOAD_ERROR"))})},function(){r(n("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[p]),l.createElement("div",{style:{}},l.createElement(o.LabelFieldPair,{style:{width:"98%",marginRight:"10px"}},l.createElement(o.CardLabel,{style:{width:"100%"}},null!=i&&i.required?n("TL_BUTTON_UPLOAD FILE")+"*":""+n("TL_BUTTON_UPLOAD FILE")),l.createElement("div",{className:"field",style:{width:"100%"}},l.createElement(o.MultiUploadWrapper,{module:"NOC",tenantId:s,getFormState:e=>(e=>{let t=Object.fromEntries(e),l=Object.values(t);var n;(n=l[l.length-1])&&E(n.file)})(e),t:n,allowedFileTypesRegex:/(.*?)(jpg|jpeg|png|image|pdf)$/i,allowedMaxSizeInMB:5,acceptFiles:"image/*, .pdf, .png, .jpeg, .jpg"}))))}const Ni=e=>{var n;let{t:i,noc:a,docs:r,isNoc:u,applicationData:d,NOCdata:s,bpaActionsDetails:c}=e;Digit.ULBService.getStateId();const v=Digit.ULBService.getStateId(),p=(null==d?void 0:d.status)||"",m=(null==c||null===(n=c.data)||void 0===n?void 0:n.nextActions)||[],{data:E}=Digit.Hooks.obps.useMDMS(v,"NOC",["DocumentTypeMapping"],{enabled:u}),{data:_}=Digit.Hooks.obps.useMDMS(v,"BPA",["DocTypeMapping"],{enabled:!u}),{data:f}=Digit.Hooks.obps.useMDMS(v,"common-masters",["DocumentType"]),[A,g]=t.useState([]),[S,h]=t.useState([]),[y,D]=t.useState(!1),[T,b]=Digit.Hooks.useSessionStorage(null==a?void 0:a.nocType,[]),[C,P]=t.useState(null),N=window.location.href.includes("/employee/");return t.useEffect(()=>{var e;g(null==f||null===(e=f["common-masters"])||void 0===e?void 0:e.DocumentType)},[f]),t.useEffect(()=>{var e,t,l;let n,i=[];var o,r,s,c;n=u?null==E||null===(o=E.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==_||null===(s=_.BPA)||void 0===s||null===(c=s.DocTypeMapping)||void 0===c?void 0:c.filter(e=>{var t,l;return e.WFState==(null==d?void 0:d.status)&&e.RiskType==(null==d?void 0:d.riskType)&&e.ServiceType==(null==d||null===(t=d.additionalDetails)||void 0===t?void 0:t.serviceType)&&e.applicationType==(null==d||null===(l=d.additionalDetails)||void 0===l?void 0:l.applicationType)}),null!==(e=n)&&void 0!==e&&null!==(t=e[0])&&void 0!==t&&null!==(l=t.docTypes)&&void 0!==l&&l[0]&&(n[0].docTypes[0].nocType=n[0].nocType,n[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(n[0].docTypes[0]));let v=[];i&&i.length>0&&(i.map(e=>{let t=e.documentType;e.dropdownData=[],null==A||A.forEach(l=>{let n=l.code.slice(0,null==t?void 0:t.length);t===n&&(e.hasDropdown=!0,e.dropdownData.push(l))}),v.push(e)}),h(v))},[E,A]),t.useEffect(()=>{D("NOC_VERIFICATION_INPROGRESS"===p&&(null==m?void 0:m.length)>0)},[d,c]),l.createElement("div",{style:{border:"1px solid #D6D5D4",padding:"16px 0px 16px 8px",background:"#FAFAFA",borderRadius:"5px",marginBottom:"24px",maxWidth:"950px"}},l.createElement(o.StatusTable,null,l.createElement(o.Row,{label:N?""+i(`BPA_${null==a?void 0:a.nocType}_HEADER`):i(`BPA_${null==a?void 0:a.nocType}_HEADER`),labelStyle:{fontSize:"20px",width:"150%"}}),s&&s.map((e,t)=>{if(null!=e&&e.value)return l.createElement(o.Row,"STATUS"==(null==e?void 0:e.field)?{className:"border-none",label:N?""+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:N?""+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(Vl,{documents:r,svgStyles:{width:"80px",height:"100px",viewBox:"0 0 25 25",minWidth:"80px"}}),y&&(null==S?void 0:S.map((e,t)=>l.createElement(Pi,{key:t,document:e,t:i,error:C,setError:P,setNocDocuments:b,nocDocuments:T,checkEnablingDocs:y}))))},Ii=e=>{let{permissions:n,t:i}=e;const[a,r,u]=Digit.Hooks.useSessionStorage("OBPS_APPROVAL_CHECKS",null==n?void 0:n.map(e=>({label:e,checked:!1}))),[d,s,c]=Digit.Hooks.useSessionStorage("OBPS_NEW_APPROVALS",[]);t.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(o.CardSubHeader,{style:{marginBottom:"16px",fontSize:"24px"}},i("BPA_PERMIT_CONDITIONS")),null==a?void 0:a.map((e,t)=>l.createElement(o.CheckBox,{key:t,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,l)=>{const n=e.target.checked;r(()=>null==a?void 0:a.map((e,t)=>l===t?{...e,checked:n}:e))})(e,0,t),isLabelFirst:!0,index:t})),null==d?void 0:d.map((e,t)=>l.createElement("div",null,l.createElement(o.TextInput,{key:t,value:null==e?void 0:e.label,onChange:e=>((e,t)=>{s(()=>null==d?void 0:d.map((l,n)=>{var i;return t===n?{label:null==e||null===(i=e.target)||void 0===i?void 0:i.value}:l}))})(e,t),textInputStyle:{maxWidth:v?"96%":"830px",width:v?"96%":"830px"},style:v?{paddingRight:"10%"}:{},placeholder:i("BPA_ENTER_PERMIT_CONDITIONS_LABEL")}),l.createElement(o.LinkButton,{label:l.createElement("div",null,l.createElement("span",null,l.createElement(o.Close,{style:{float:"right",position:"relative",bottom:"32px",marginTop:"-22px",marginRight:v?"5%":"35%"}}))),style:{},onClick:e=>(e=>{const t=[...d];t.splice(e,1),s([...t])})(t)}))),l.createElement(o.LinkButton,{style:{color:"#a82227",maxWidth:v?"fit-content":"10%",marginRight:"3%"},label:i("BPA_ADD_MORE"),onClick:()=>{s([...d,{label:""}])}}))};function Li(e){let{taxHeadEstimatesCalculation:t}=e;const{taxHeadEstimates:i}=t,{t:a}=n.useTranslation();return l.createElement("div",{style:{marginTop:"40px"}},l.createElement(o.StatusTable,null,l.createElement(o.Row,{label:a("ES_PT_TITLE_TAX_HEADS"),text:a("ES_PT_TITLE_AMOUNT"),className:"border-none",textStyle:{fontWeight:"bold"}}),l.createElement(o.BreakLine,{style:{margin:"16px 0",width:"40%"}}),null==i?void 0:i.map((e,t)=>l.createElement(o.Row,{key:a(e.taxHeadCode),label:a(e.taxHeadCode),text:"₹ "+e.estimateAmount||"N/A",last:t===(null==i?void 0:i.length)-1,className:"border-none",textStyle:{color:"#505A5F"},labelStyle:{color:"#505A5F"}})),l.createElement(o.BreakLine,{style:{margin:"16px 0",width:"40%"}}),l.createElement(o.Row,{label:a("ES_PT_TITLE_TOTAL_DUE_AMOUNT"),text:"₹ "+(null==t?void 0:t.totalAmount)||"N/A",className:"border-none",textStyle:{fontSize:"24px",fontWeight:"bold"}})))}function Bi(e){let{floors:t}=e;const{t:i}=n.useTranslation();return l.createElement(l.Fragment,null,t.map(e=>{var t;return l.createElement("div",{key:i(null==e?void 0:e.title),style:{marginTop:"19px"}},l.createElement(o.CardSubHeader,{style:{marginBottom:"8px",color:"#505A5F",fontSize:"24px"}},i(null==e?void 0:e.title)),null==e||null===(t=e.values)||void 0===t?void 0:t.map((e,t)=>{var n;return l.createElement(l.Fragment,{key:t},l.createElement(o.CardSectionHeader,{style:{marginBottom:"16px",color:"#505A5F",fontSize:"16px",marginTop:0!==t?"16px":"revert"}},i(e.title)),l.createElement(o.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===(n=e.values)||void 0===n?void 0:n.map((e,t)=>{var n;return l.createElement(o.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:t===(null==e||null===(n=e.values)||void 0===n?void 0:n.length)-1,caption:e.caption,className:"border-none"})}))))}))}))}function Oi(e){let{owners:t}=e,i={};i=window.location.href.includes("/employee/pt/")?t.slice().reverse():t;const{t:a}=n.useTranslation(),r=(null==t?void 0:t.length)||1;let u={marginTop:"19px"},d={position:"relative",padding:"8px"},s={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"},d={position:"relative",marginTop:"19px"}),window.location.href.includes("obps")&&(u={...u,maxWidth:"950px"},u={...u,maxWidth:"950px"},s={}),t.sort((e,t)=>{var l,n;return(null==e||null===(l=e.additionalDetails)||void 0===l?void 0:l.ownerSequence)-(null==t||null===(n=t.additionalDetails)||void 0===n?void 0:n.ownerSequence)}),l.createElement(l.Fragment,null,l.createElement("div",{className:"owner-details"},i.map((e,t)=>{var n;return l.createElement("div",{key:a(null==e?void 0:e.title),style:u,className:"owner-details-child"},l.createElement(o.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)} ${t+1}`:a(null==e?void 0:e.title)),l.createElement(l.Fragment,{key:t},l.createElement(o.StatusTable,{style:d},l.createElement("div",{style:{maxWidth:"640px",top:0,left:0,bottom:0,right:0,width:"auto"}}),null==e||null===(n=e.values)||void 0===n?void 0:n.map((e,t)=>{var n;return!0===e.map&&"N/A"!==e.value?l.createElement(o.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(o.Row,{key:a(e.title),label:""+a(e.title),text:a(e.value)||"N/A",last:t===(null==e||null===(n=e.values)||void 0===n?void 0:n.length)-1,caption:e.caption,className:"border-none",textStyle:e.textStyle,privacy:null==e?void 0:e.privacy,rowContainerStyle:s}))}))))})))}const Ri=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))},wi=e=>{var i,a,r;let{data:u,OpenImage:d,privacy:s={}}=e;const[c,v]=t.useState(!1),{t:p}=n.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(o.TelePhone,{mobile:u.mobileNumber,privacy:s}),l.createElement("p",null," ")),u.source&&l.createElement("p",null,p("ES_APPLICATION_DETAILS_APPLICATION_CHANNEL_"+u.source.toUpperCase())),u.comment&&l.createElement(Ri,{otherComment:null==u?void 0:u.otherComment,headComment:null==u?void 0:u.comment}),null!=u&&u.wfComment?l.createElement("div",null,null==u||null===(i=u.wfComment)||void 0===i?void 0:i.map(e=>l.createElement("div",{className:"TLComments"},l.createElement("h3",null,p("WF_COMMON_COMMENTS")),!c&&l.createElement("div",null,l.createElement("p",{style:{overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitLineClamp:1,WebkitBoxOrient:"vertical"}},e),e.length>36?l.createElement("button",{type:"button",onClick:()=>{v(!0)},style:{color:"#800000"}},p("View More")):null),c&&l.createElement("div",null,l.createElement("p",{style:{overflow:"visible"}},e),l.createElement("button",{type:"button",onClick:()=>{v(!1)},style:{color:"#800000"}},p("View Less")))))):null,(null==u||null===(a=u.thumbnailsToShow)||void 0===a||null===(r=a.thumbs)||void 0===r?void 0:r.length)>0?l.createElement("div",{className:"TLComments"},l.createElement("h3",null,p("CS_COMMON_ATTACHMENTS")),l.createElement(o.DisplayPhotos,{srcs:null==u?void 0:u.thumbnailsToShow.thumbs,onClick:(e,t)=>{d(e,t,null==u?void 0:u.thumbnailsToShow)}})):null)};function xi(e){let{units:t}=e;const{t:i}=n.useTranslation();return l.createElement(l.Fragment,null,t.map((e,t)=>{var n;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(o.CardSubHeader,{style:{marginBottom:"8px",paddingBottom:"9px",color:"#0B0C0C",fontSize:"16px",lineHeight:"19px"}},`${i(null==e?void 0:e.title)} ${t+1}`),l.createElement(l.Fragment,{key:t},l.createElement(o.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===(n=e.values)||void 0===n?void 0:n.map((e,t)=>{var n;return l.createElement(o.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:t===(null==e||null===(n=e.values)||void 0===n?void 0:n.length)-1,caption:e.caption,className:"border-none",rowContainerStyle:{justifyContent:"space-between",fontSize:"16px",lineHeight:"19px",color:"#0B0C0C"}})}))))}))}function Mi(e){let{units:t}=e;const{t:i}=n.useTranslation();return l.createElement(l.Fragment,null,t.map((e,t)=>{var n;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(o.CardSubHeader,{style:{marginBottom:"9px",paddingBottom:"9px",color:"#0B0C0C",fontSize:"16px",lineHeight:"19px"}},`${i(null==e?void 0:e.title)} ${t+1}`),l.createElement(l.Fragment,{key:t},l.createElement(o.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===(n=e.values)||void 0===n?void 0:n.map((e,t)=>{var n;return l.createElement(o.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:t===(null==e||null===(n=e.values)||void 0===n?void 0:n.length)-1,caption:e.caption,className:"border-none",rowContainerStyle:{justifyContent:"space-between",fontSize:"16px",lineHeight:"19px",color:"#0B0C0C"}})}))))}))}const Fi=e=>{var i,a,r,u,d;let{wsAdditionalDetails:s}=e;const{t:c}=n.useTranslation();let v=(p=location.search)?(/^[?#]/.test(p)?p.slice(1):p).split("&").reduce((e,t)=>{let[l,n]=t.split("=");return e[l]=n?decodeURIComponent(n.replace(/\+/g," ")):"",e},{}):{};var p;const m=null==v?void 0:v.mode;var{connectionDetails:E,plumberDetails:_,roadCuttingDetails:f,roadCuttingAddlDetails:A,activationDetails:g}=(null==s?void 0:s.additionalDetails)||{connectionDetails:[],plumberDetails:[],roadCuttingAddlDetails:[]};return l.createElement(t.Fragment,null,l.createElement("div",{style:{lineHeight:"19px",maxWidth:"950px",minWidth:"280px"}},(null==s||null===(i=s.additionalDetails)||void 0===i?void 0:i.connectionDetails)&&l.createElement(o.StatusTable,null,l.createElement(o.CardSubHeader,{style:{fontSize:"24px",marginBottom:"16px",marginTop:"32px"}},c("WS_COMMON_CONNECTION_DETAIL")),l.createElement("div",null,l.createElement("div",{className:"connection-details-new-value-wrapper"},null==E?void 0:E.map((e,t)=>l.createElement("div",null,l.createElement(o.Row,{className:"border-none",key:""+e.title,label:""+c(""+e.title),text:null!=e&&e.oldValue?null==e?void 0:e.oldValue:null!=e&&e.value?null==e?void 0:e.value:""})))))),(null==s||null===(a=s.additionalDetails)||void 0===a?void 0:a.plumberDetails)&&"MODIFY"!=m&&l.createElement(o.StatusTable,null,l.createElement(o.CardSubHeader,{style:{fontSize:"24px",marginBottom:"16px",marginTop:"32px"}},c("WS_COMMON_PLUMBER_DETAILS")),l.createElement("div",null,l.createElement("div",{className:"plumber-details-new-value-wrapper"},null==_?void 0:_.map((e,t)=>l.createElement(o.Row,{className:"border-none",key:""+e.title,label:""+c(""+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==s||null===(r=s.additionalDetails)||void 0===r?void 0:r.roadCuttingDetails)&&"MODIFY"!=m&&l.createElement(o.StatusTable,null,l.createElement(o.CardSubHeader,{style:{fontSize:"24px",marginBottom:"16px",marginTop:"32px"}},c("WS_COMMON_ROAD_CUTTING_DETAILS")),l.createElement("div",null,l.createElement("div",{className:"road-cutting-details-new-value-wrapper"},null==f?void 0:f.map(e=>{var t;return l.createElement("div",{style:(null==f?void 0:f.length)>1?{border:"1px solid #D6D5D4",background:"#FAFAFA",borderRadius:"4px",padding:"10px 10px 0px 10px",margin:"5px 0px"}:{}},null==e||null===(t=e.values)||void 0===t?void 0:t.map(e=>l.createElement(o.Row,{className:"border-none",key:""+e.title,label:""+c(""+e.title),text:null!=e&&e.oldValue?null==e?void 0:e.oldValue:null!=e&&e.value?null==e?void 0:e.value:""})))}))),(null==s||null===(u=s.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==A?void 0:A.map((e,t)=>l.createElement("div",null,l.createElement(o.Row,{className:"border-none",key:""+e.title,label:""+c(""+e.title),text:null!=e&&e.oldValue?null==e?void 0:e.oldValue:null!=e&&e.value?null==e?void 0:e.value:""})))))),(null==s||null===(d=s.additionalDetails)||void 0===d?void 0:d.activationDetails)&&l.createElement(o.StatusTable,null,l.createElement(o.CardSubHeader,{style:{fontSize:"24px",marginBottom:"16px",marginTop:"32px"}},c("WS_ACTIVATION_DETAILS")),l.createElement("div",null,l.createElement("div",{className:"plumber-details-new-value-wrapper"},null==g?void 0:g.map((e,t)=>l.createElement(o.Row,{className:"border-none",key:""+e.title,label:""+c(""+e.title),text:null!=e&&e.oldValue?null==e?void 0:e.oldValue:null!=e&&e.value?null==e?void 0:e.value:""})))))))},ki=[{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"}],Ui=[{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"}],Hi=e=>{var i,a,r,u;let{wsAdditionalDetails:d}=e;const{t:c}=n.useTranslation(),[v,p,m]=Digit.Hooks.useSessionStorage("ADHOC_ADD_REBATE_DATA",{}),[E,f,A]=Digit.Hooks.useSessionStorage("ADHOC_BILL_ADD_REBATE_DATA",{}),g=!(null==d||null===(i=d.additionalDetails)||void 0===i||!i.isPaid),[S,h]=t.useState(!1),[y,D]=t.useState(v||{}),[T,b]=t.useState(null),[C,P]=t.useState(d.additionalDetails.data?d.additionalDetails.data:{}),[N,I]=t.useState(d.additionalDetails.values?d.additionalDetails.values:[]),L=Digit.ULBService.getStateId();Digit.Hooks.ws.useMDMS(L,"BillingService",["TaxHeadMaster"]),t.useEffect(()=>{var e,t,n;const i={...null==d||null===(e=d.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,s,c,m;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===(s=v.billDetails)||void 0===s||null===(c=s[0])||void 0===c?void 0:c.taxAmount)}];I(e),P(null==v||null===(m=v.billDetails)||void 0===m?void 0:m[0])}else p(i),D(i)},[]);let B={};const O=e=>l.createElement("h1",{className:"heading-m"},e.label),R=()=>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"})),w=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(R,null)),x=function(e,t,l){void 0===t&&(t=!1);let n={...y};if("adhocPenalty"!=e&&"adhocRebate"!=e||!l.target.value)t?(n[e+"_data"]=l,n[e]=l.title,"PT_OTHERS"==l.title&&"adhocPenaltyReason"==e&&(n.adhocPenaltyComment=""),"PT_OTHERS"==l.title&&"adhocRebateReason"==e&&(n.adhocRebateComment="")):n[e]=l.target.value;else{var i,o;const t=0==(null==l||null===(i=l.target)||void 0===i?void 0:i.value)?1:Math.sign(null==l||null===(o=l.target)||void 0===o?void 0:o.value)||-1;n[e]=1==t?l.target.value:""}D(n)};return l.createElement(t.Fragment,null,l.createElement("div",{style:{lineHeight:"19px",maxWidth:"950px",minWidth:"280px"}},N&&l.createElement(o.StatusTable,null,l.createElement("div",null,null==N?void 0:N.map((e,t)=>l.createElement(o.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(o.Row,{className:"border-none",key:"WS_COMMON_TOTAL_AMT",label:""+c("WS_COMMON_TOTAL_AMT"),text:l.createElement("span",null,"₹",(null==C?void 0:C.totalAmount)||0),textStyle:{fontSize:"24px",fontWeight:"700"}}),l.createElement(o.Row,{className:"border-none",key:"CS_INBOX_STATUS_FILTER",label:""+c("CS_INBOX_STATUS_FILTER"),text:c(g?"WS_COMMON_PAID_LABEL":"WS_COMMON_NOT_PAID"),textStyle:g?{color:"#00703C"}:{color:"#D4351C"}}))),null!=d&&null!==(a=d.additionalDetails)&&void 0!==a&&a.isAdhocRebate?l.createElement("div",{onClick:e=>{h(!0)}},l.createElement("span",{style:{cursor:"pointer",color:"#a82227"}},c("WS_PAYMENT_ADD_REBATE_PENALTY"))):null,S&&l.createElement(o.Modal,{headerBarMain:l.createElement(O,{label:c("PT_ADD_REBATE_PENALITY")}),headerBarEnd:l.createElement(w,{onClick:()=>{D(v),h(!1)}}),actionCancelLabel:c("PT_CANCEL"),actionCancelOnSubmit:()=>{D(v),h(!1)},actionSaveLabel:c("PT_ADD"),actionSaveOnSubmit:e=>(e=>{const t=null!=y&&y.adhocPenalty?Number(null==y?void 0:y.adhocPenalty):0,l=null!=y&&y.adhocRebate?Number(null==y?void 0:y.adhocRebate):0;var n,i;if(t||l)if(l>(null==d||null===(n=d.additionalDetails)||void 0===n||null===(i=n.data)||void 0===i?void 0:i.totalAmount))b({isError:!1,isWarning:!0,key:"error",message:c("ERR_WS_REBATE_GREATER_THAN_AMOUNT")});else{var o,a,r,u,s,v,m,E,A,g;const e=null==d||null===(o=d.additionalDetails)||void 0===o||null===(a=o.appDetails)||void 0===a?void 0:a.applicationNo,t=null==d||null===(r=d.additionalDetails)||void 0===r||null===(u=r.appDetails)||void 0===u?void 0:u.tenantId,l={...null==d||null===(s=d.additionalDetails)||void 0===s||null===(v=s.appDetails)||void 0===v?void 0:v.additionalDetails,...y};d.additionalDetails.appDetails.additionalDetails=l;const n={CalculationCriteria:"WATER"==(null==d||null===(m=d.additionalDetails)||void 0===m||null===(E=m.appDetails)||void 0===E?void 0:E.service)?[{applicationNo:e,tenantId:t,waterConnection:d.additionalDetails.appDetails}]:[{applicationNo:e,tenantId:t,sewerageConnection:d.additionalDetails.appDetails}],isconnectionCalculation:!1};let i="WATER"==(null==d||null===(A=d.additionalDetails)||void 0===A||null===(g=A.appDetails)||void 0===g?void 0:g.service)?"WS":"SW";Digit.WSService.wsCalculationEstimate(n,i).then((e,t)=>{var l,n,i,o,a,r,u,d,s,c,v,m,E,A,g;(null==e||null===(l=e.Calculation)||void 0===l||null===(n=l[0])||void 0===n||null===(i=n.taxHeadEstimates)||void 0===i?void 0:i.length)>0&&(null==e||null===(E=e.Calculation)||void 0===E||null===(A=E[0])||void 0===A||null===(g=A.taxHeadEstimates)||void 0===g||g.forEach(e=>e.amount=e.estimateAmount)),e.Calculation[0].billSlabData=_.groupBy(null==e||null===(o=e.Calculation)||void 0===o||null===(a=o[0])||void 0===a?void 0:a.taxHeadEstimates,"category");const S=[{title:"WS_APPLICATION_FEE_HEADER",value:null===(r=e.Calculation)||void 0===r||null===(u=r[0])||void 0===u?void 0:u.fee},{title:"WS_SERVICE_FEE_HEADER",value:null===(d=e.Calculation)||void 0===d||null===(s=d[0])||void 0===s?void 0:s.charge},{title:"WS_TAX_HEADER",value:null===(c=e.Calculation)||void 0===c||null===(v=c[0])||void 0===v?void 0:v.taxAmount}];f(ft(e.Calculation[0])),P(null==e||null===(m=e.Calculation)||void 0===m?void 0:m[0]),I(S),y.billDetails=null==e?void 0:e.Calculation,p(y),h(!1)}).catch(e=>{var t,l,n,i,o,a;b({isError:!0,isWarning:!1,key:"error",message:null!=e&&null!==(t=e.response)&&void 0!==t&&null!==(l=t.data)&&void 0!==l&&null!==(n=l.Errors[0])&&void 0!==n&&n.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 b({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(o.Card,{style:{padding:"10px 10px 1px 10px",margin:"0px 0px 15px 0px"}},l.createElement(o.CardSectionHeader,{style:{fontSize:"16px",fontWeight:"700",lineHeight:"18px",padding:"0px",margin:"0px 0px 10px 0px"}},c("PT_AD_PENALTY")),l.createElement(o.CardLabel,null,c("PT_TX_HEADS")),l.createElement("div",{className:"field"},l.createElement(o.Dropdown,{isMandatory:!0,option:ki,optionKey:"title",select:e=>x("adhocPenaltyReason",!0,e),selected:(null==y?void 0:y.adhocPenaltyReason_data)||"",isPropertyAssess:!0,name:"adhocPenaltyReason_data",t:c})),"PT_OTHERS"===(null==y||null===(r=y.adhocPenaltyReason_data)||void 0===r?void 0:r.title)&&l.createElement("div",{className:"field"},l.createElement(o.CardLabel,null,c("PT_REASON")),l.createElement("div",{className:"field"},l.createElement(o.TextInput,s({style:{background:"#FAFAFA"},t:c,type:"text",isMandatory:!1,name:"adhocPenaltyComment",value:(null==y?void 0:y.adhocPenaltyComment)||"",onChange:e=>x("adhocPenaltyComment",!1,e)},B={isRequired:!0,pattern:"^[a-zA-Z ]*$",type:"text",title:c("TL_NAME_ERROR_MESSAGE")})))),l.createElement(o.CardLabel,null,c("PT_HEAD_AMT")),l.createElement("div",{className:"field"},l.createElement(o.TextInput,s({style:{background:"#FAFAFA"},t:c,type:"number",isMandatory:!1,name:"adhocPenalty",value:(null==y?void 0:y.adhocPenalty)||"",onChange:e=>x("adhocPenalty",!1,e)},B={isRequired:!0,pattern:"^[1-9]+[0-9]*$",title:c("ERR_DEFAULT_INPUT_FIELD_MSG")})))),l.createElement(o.Card,{style:{padding:"10px 10px 1px 10px",margin:"0px 0px 15px 0px"}},l.createElement(o.CardSectionHeader,{style:{fontSize:"16px",fontWeight:"700",lineHeight:"18px",padding:"0px",margin:"0px 0px 10px 0px"}},c("PT_AD_REBATE")),l.createElement(o.CardLabel,null,c("PT_TX_HEADS")),l.createElement("div",{className:"field"},l.createElement(o.Dropdown,{isMandatory:!0,option:Ui,optionKey:"title",select:e=>x("adhocRebateReason",!0,e),selected:(null==y?void 0:y.adhocRebateReason_data)||"",name:"adhocRebateReason_data",isPropertyAssess:!0,t:c})),"PT_OTHERS"===(null==y||null===(u=y.adhocRebateReason_data)||void 0===u?void 0:u.title)&&l.createElement("div",{className:"field"},l.createElement(o.CardLabel,null,c("PT_REASON")),l.createElement(o.TextInput,s({style:{background:"#FAFAFA"},t:c,type:"text",isMandatory:!1,name:"adhocRebateComment",value:(null==y?void 0:y.adhocRebateComment)||"",onChange:e=>x("adhocRebateComment",!1,e)},B={isRequired:!0,pattern:"^[a-zA-Z ]*$",type:"text",title:c("TL_NAME_ERROR_MESSAGE")}))),l.createElement(o.CardLabel,null,c("PT_HEAD_AMT")),l.createElement("div",{className:"field"},l.createElement(o.TextInput,s({style:{background:"#FAFAFA"},t:c,type:"number",isMandatory:!1,name:"adhocRebate",value:(null==y?void 0:y.adhocRebate)||"",onChange:e=>x("adhocRebate",!1,e)},B={isRequired:!0,pattern:"^[1-9]+[0-9]*$",title:c("ERR_DEFAULT_INPUT_FIELD_MSG")})))))," "),T&&l.createElement(o.Toast,{style:{zIndex:"10000"},warning:null==T?void 0:T.isWarning,error:null==T||!T.isWarning,label:c(null==T?void 0:T.message),onClose:()=>{b(!1)},isDleteBtn:!0})))},Wi=e=>{let{style:t}=e;return l.createElement("span",null,l.createElement("svg",{style:{...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"})))},Gi=e=>{let{t:t,userType:n=!1,infoBannerLabel:i="",infoClickLable:a="",infoClickInfoLabel:r="",infoClickInfoLabel1:u=""}=e;n=n||Digit.SessionStorage.get("userType");const d=window.Digit.Utils.browser.isMobile();return l.createElement(l.Fragment,null,l.createElement("div",{style:d?{}:{width:"80%"}},l.createElement("div",{className:"info-banner-wrap",style:{color:"#3498DB",margin:"0px"}},l.createElement("div",null,l.createElement(o.InfoBannerIcon,null),l.createElement("h2",{style:{color:"#3498DB"}},t(i))),t(a)+" ",l.createElement(Wi,{style:{display:"inline",marginBottom:"5px"}})," "+t(r),l.createElement("div",null," "+t(u)))))},ji=e=>{var i,a,r,u,d,s,c;let{wsAdditionalDetails:v}=e;const{t:p}=n.useTranslation(),[m,E]=t.useState(!1),[_,f]=t.useState({}),A=e=>l.createElement("h1",{className:"heading-m"},e.label),g=()=>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(g,null));return l.createElement(t.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 l=sessionStorage.getItem("Digit.ADHOC_BILL_ADD_REBATE_DATA"),n=l?JSON.parse(l):{};null!=n&&null!==(e=n.value)&&void 0!==e&&e.totalAmount&&(t=null==n?void 0:n.value),f(t),E(!0)})(),style:{marginTop:"12px"}},l.createElement("span",{style:{cursor:"pointer",color:"#a82227"}},p("WS_PAYMENT_VIEW_BREAKUP"))):null,m&&l.createElement(o.Modal,{headerBarMain:l.createElement(A,{label:p("WS_CALCULATION_BREAKUP")}),headerBarEnd:l.createElement(S,{onClick:()=>{E(!1)}}),hideSubmit:!0,popupStyles:{overflowY:"auto"},headerBarMainStyle:{marginBottom:"0px"},popupModuleMianStyles:{paddingTop:"0px"}},l.createElement(o.StatusTable,{style:{padding:"10px",paddingTop:"0px"}},l.createElement(o.CardSectionHeader,{style:{margin:"10px 0px"}},p("WS_APPLICATION_FEE_HEADER")),null==_||null===(a=_.billSlabData)||void 0===a||null===(r=a.FEE)||void 0===r?void 0:r.map(e=>l.createElement(o.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:""+(null==e?void 0:e.taxHeadCode),label:""+p(""+(null==e?void 0:e.taxHeadCode)),text:l.createElement("span",null,"₹",Number(null==e?void 0:e.amount)||0),textStyle:{textAlign:"right"}})),l.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",marginBottom:"10px"}}),l.createElement(o.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:"PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT1",label:""+p("PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT"),text:l.createElement("span",null,"₹",Number(null==_?void 0:_.fee)||0),textStyle:{textAlign:"right",fontWeight:"700",fontSize:"24px"}}),l.createElement(o.CardSectionHeader,{style:{margin:"10px 0px"}},p("WS_SERVICE_FEE_HEADER")),null==_||null===(u=_.billSlabData)||void 0===u||null===(d=u.CHARGES)||void 0===d?void 0:d.map(e=>l.createElement(o.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:""+(null==e?void 0:e.taxHeadCode),label:""+p(""+(null==e?void 0:e.taxHeadCode)),text:l.createElement("span",null,"₹",Number(null==e?void 0:e.amount)||0),textStyle:{textAlign:"right"}})),l.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",marginBottom:"10px"}}),l.createElement(o.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:"PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT2",label:""+p("PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT"),text:l.createElement("span",null,"₹",Number(null==_?void 0:_.charge)||0),textStyle:{textAlign:"right",fontWeight:"700",fontSize:"24px"}}),null==_||null===(s=_.billSlabData)||void 0===s||null===(c=s.TAX)||void 0===c?void 0:c.map(e=>l.createElement(o.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:""+(null==e?void 0:e.taxHeadCode),label:""+p(""+(null==e?void 0:e.taxHeadCode)),text:l.createElement("span",null,"₹",Number(null==e?void 0:e.amount)||0),textStyle:{textAlign:"right"}})),l.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",marginBottom:"10px"}}),l.createElement(o.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:"PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT3",label:""+p("PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT"),text:l.createElement("span",null,"₹",Number(null==_?void 0:_.totalAmount)||0),textStyle:{textAlign:"right",fontWeight:"700",fontSize:"24px"}})))))},Ki={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:{}},Yi=e=>{let{className:t="table",headers:i=[],values:o=[],arrears:a=0}=e;const{t:r}=n.useTranslation();return l.createElement(l.Fragment,null,l.createElement("div",{style:Ki.root},l.createElement("table",{className:"table-fixed-column-common-pay",style:Ki.table},l.createElement("thead",null,l.createElement("tr",null,l.createElement("th",{style:{...Ki.cell,...Ki.cellLeft,...Ki.cellHeader}},r("CS_BILL_PERIOD")),i.map((e,t)=>l.createElement("th",{style:{...Ki.cell,...i.length==t+1?Ki.cellRight:{},...Ki.cellHeader},key:t},r(e))))),l.createElement("tbody",null,Object.values(o).map((e,t)=>l.createElement("tr",{key:t},l.createElement("td",{style:{...Ki.cell,...Ki.cellLeft},component:"th",scope:"row"},Object.keys(o)[t]),i.map((t,n)=>l.createElement("td",{style:{...Ki.cell,textAlign:"left",...i.length==n+1?Ki.cellRight:{},whiteSpace:"pre"},key:n,numeric:!0},n>1&&"₹",e[t]&&e[t].value||"0")))),l.createElement("tr",null,l.createElement("td",{style:{...Ki.cell,...Ki.cellLeft}}),i.map((e,t)=>t==i.length-1?l.createElement("td",{style:{...Ki.cell,...Ki.cellRight,textAlign:"left",fontWeight:"700",whiteSpace:"pre"},key:t,numeric:!0},a):t==i.length-2?l.createElement("td",{style:{...Ki.cell,textAlign:"left"},key:t,numeric:!0},r("COMMON_ARREARS_TOTAL")):l.createElement("td",{style:Ki.cell,key:t,numeric:!0})))))))},$i={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))"}},zi=e=>{var i,o,a;let{bill:r={}}=e;const{t:u}=n.useTranslation();let d={},s=(null==r||null===(i=r.billDetails)||void 0===i?void 0:i.sort((e,t)=>t.fromPeriod-e.fromPeriod))||[];s=[...s];const c=(null===(o=s)||void 0===o?void 0:o.reduce((e,t,l)=>e+t.amount,0))||0;let v="₹ "+((null==c||null===(a=c.toFixed)||void 0===a?void 0:a.call(c,0))||Number(0).toFixed(0));s.map(e=>{let t=function(e){var t,l,n;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===(l=e)||void 0===l?void 0:l.expiryDate)&&new Date(null===(n=e)||void 0===n?void 0:n.expiryDate).toLocaleDateString()||"NA",order:-1},i.TL_COMMON_TOTAL_AMT={value:e.amount,order:10},i}(e);d[((e,t)=>{const l=new Date(e),n=new Date(t);return n.getYear()-l.getYear()!=0?`FY${l.getYear()+1900}-${n.getYear()-100}`:`${l.toLocaleDateString()}-${n.toLocaleDateString()}`})(e.fromPeriod,e.toPeriod)]=t});let p={};!d||Object.keys(d).map((e,t)=>{Object.keys(d[e]).map(t=>{p[t]=d[e]&&d[e][t]&&d[e][t].order||0})});let m=[];m=Object.keys(p),m.sort((e,t)=>p[e]-p[t]);const[E,_]=t.useState(!1);return 0==c||c<0?l.createElement("span",null):l.createElement(l.Fragment,null,l.createElement("div",{style:$i.headerStyle},u("CS_ARREARS_DETAILS")),E&&l.createElement(Yi,{headers:[...m],values:d,arrears:v}),!E&&l.createElement("div",{style:$i.buttonStyle},l.createElement("button",{type:"button",onClick:()=>{_(!0)}},u("CS_SHOW_CARD"))),E&&l.createElement("div",{style:$i.buttonStyle},l.createElement("button",{type:"button",onClick:()=>{_(!1)}},u("CS_HIDE_CARD"))))},Vi=e=>{let{assessmentData:n}=e;const[i,o]=t.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"}},n.map((e,t)=>l.createElement("div",{key:t,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")," ")),t!==n.length-1&&l.createElement("hr",null)))))},qi=e=>{var n;let{applicationData:o}=e;const[a,r]=t.useState(!1);return i.useHistory(),l.createElement("div",{className:"accordion",style:{width:"100%",margin:"auto",fontFamily:"Roboto, sans-serif",border:"1px solid #ccc",borderRadius:"4px",marginBottom:"10px"}},l.createElement("div",{className:"accordion-header",style:{backgroundColor:"#f0f0f0",padding:"15px",cursor:"pointer"},onClick:()=>{r(!a)}},l.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"}},l.createElement("h3",{style:{color:"#0d43a7",fontFamily:"Noto Sans,sans-serif",fontSize:"24px",fontWeight:"500"}},"Application History"),l.createElement("span",{style:{fontSize:"1.2em"}},a?"<":">"))),a&&l.createElement("div",{className:"accordion-body",style:{padding:" 15px",backgroundColor:"#fff"}},l.createElement("div",{className:"assessment-item",style:{marginBottom:"15px"}},l.createElement("div",{className:"assessment-row",style:{display:"flex",gap:"100px",marginBottom:"8px"}},l.createElement("span",{style:{fontWeight:"bold",minWidth:"60px",color:"black"}},"Application Number"),l.createElement("span",{style:{flex:"1",color:"black"}},o.acknowldgementNumber)),l.createElement("div",{className:"assessment-row",style:{display:"flex",gap:"132px",marginBottom:"8px",color:"black"}},l.createElement("span",{className:"label",style:{fontWeight:"bold",minWidth:"60px",color:"black"}},"Property ID No."),l.createElement("span",{className:"value",style:{flex:"1",color:"black"}},o.propertyId)),l.createElement("div",{className:"assessment-row",style:{display:"flex",gap:"120px",marginBottom:"8px",color:"black"}},l.createElement("span",{className:"label",style:{fontWeight:"bold",minWidth:"60px",color:"black"}},"Application Type"),l.createElement("span",{className:"value",style:{flex:"1",color:"black"}},"NEW PROPERTY")),l.createElement("div",{className:"assessment-row",style:{display:"flex",gap:"140px",marginBottom:"8px",color:"black"}},l.createElement("span",{className:"label",style:{fontWeight:"bold",minWidth:"60px",color:"black"}},"Creation Date"),l.createElement("span",{className:"value",style:{flex:"1",color:"black"}},(u=null===(n=o.auditDetails)||void 0===n?void 0:n.createdTime,new Date(u).toLocaleDateString("en-GB",{day:"2-digit",month:"short",year:"numeric"}).replace(/ /g,"-")))),l.createElement("div",{className:"assessment-row",style:{display:"flex",gap:"180px",marginBottom:"8px",color:"black"}},l.createElement("span",{className:"label",style:{fontWeight:"bold",minWidth:"60px",color:"black"}},"Status"),l.createElement("span",{className:"value",style:{flex:"1",color:"black"}},o.status)),l.createElement("div",null,l.createElement(i.Link,{to:{pathname:"/digit-ui/citizen/pt/property/application-preview/"+o.acknowldgementNumber,state:{propertyId:o.propertyId}},style:{color:"#2947a3",display:"inline",border:"1px solid",padding:"8px",borderRadius:"8px"}},"View History")))));var u},Xi=e=>{let{payments:n}=e;const[i,o]=t.useState(!1);return l.createElement("div",{className:"accordion",style:{width:"100%",margin:"auto",fontFamily:"Roboto, sans-serif",border:"1px solid #ccc",borderRadius:"4px",marginBottom:"10px"}},l.createElement("div",{className:"accordion-header",style:{backgroundColor:"#f0f0f0",padding:"15px",cursor:"pointer"},onClick:()=>{o(!i)}},l.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"}},l.createElement("h3",{style:{color:"#0d43a7",fontFamily:"Noto Sans,sans-serif",fontSize:"24px",fontWeight:"500"}},"Payment History"),l.createElement("span",{style:{fontSize:"1.2em"}},i?"<":">"))),i&&l.createElement("div",{className:"accordion-body",style:{padding:" 15px",backgroundColor:"#fff"}},0===(null==n?void 0:n.length)&&l.createElement("div",{style:{color:"red",fontSize:"16px"}},"No Payemnts found")))};function Ji(e){var a,r,u,d,s,c,v,p,m,E,f,A,g,S,h,y;let{applicationDetails:D,demandData:T,workflowDetails:b,isDataLoading:C,applicationData:P,timelineStatusPrefix:N,showTimeLine:I=!0,statusAttribute:L="status",paymentsList:B,oldValue:O,isInfoLabel:R=!1,propertyId:w}=e;const{t:x}=n.useTranslation(),M=i.useHistory(),F=Digit.ULBService.getCurrentTenantId(),[k,U]=t.useState(null),[H,W]=t.useState([]);let G=window.location.href.includes("editApplication")&&window.location.href.includes("bpa");function j(e,t,l){var n;window.open(null==l||null===(n=l.fullImage)||void 0===n?void 0:n[0],"_blank")}console.log("appl",D);const[K,Y]=t.useState({}),[$,z]=t.useState(),[V,q]=t.useState([]),[X,J]=t.useState({loading:!1,loaded:!1,canLoad:!1});"ACTIVE"!=(null==P?void 0:P.status)||X.loading||X.loaded||X.canLoad||J({loading:!1,loaded:!1,canLoad:!0}),null==X||!X.canLoad||X.loading||X.loaded||(J({loading:!0,loaded:!1,canLoad:!0}),function(e,t,l,n){try{Promise.resolve(Digit.PTService.assessmentSearch({tenantId:e,filters:{propertyIds:t}})).then(function(i){function o(){l(a),n({loading:!1,loaded:!0,canLoad:!0})}let a={};const r=function(l){if((null==i||null===(l=i.Assessments)||void 0===l?void 0:l.length)>0){const l=i.Assessments.filter(e=>"ACTIVE"===e.status),n=new Map;l.forEach(e=>{const t=`${function(e){const t=new Date(e);return t.setHours(0,0,0,0),t.getTime()}(e.assessmentDate)}_${e.financialYear}`,l=n.get(t);(!l||e.createdDate>l.createdDate)&&n.set(t,e)}),console.log("grouped",n);const o=Array.from(n.values());return q(o),console.log(o),z(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==P?void 0:P.tenantId)||F,null==P?void 0:P.propertyId,Y,J));const Z=e=>{if(null==e||null==e||""==e)return"NA";const t=new Date(e);let l=t.getMonth()+1,n=t.getDate();return l=(l>9?"":"0")+l,n=(n>9?"":"0")+n,`${n}/${l}/${t.getFullYear()}`},Q=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:Z(null==P||null===(i=P.auditDetails)||void 0===i?void 0:i.createdTime),source:(null==P?void 0:P.channel)||""};return l.createElement(wi,{data:e})}if(window.location.href.includes("/obps/")||window.location.href.includes("/noc/")||window.location.href.includes("/ws/")){var o,a,r,u,d,s,c,v,p,m,E,f,A,g,S,h,y,T;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==D?void 0:D.tenantId,businessIds:null==D?void 0:D.applicationNo,history:!0},jsonPath:"ProcessInstances[0].assignes[0].mobileNumber",isArray:!1,d:e=>{let l="";return l="+91 "+_.get(e,`ProcessInstances[${t}].assignes[0].mobileNumber`),l}}},b=n[t-1],C={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===(d=u[0])||void 0===d?void 0:d.name,mobileNumber:(null==P||null===(s=P.processInstance)||void 0===s||null===(c=s.assignes)||void 0===c||null===(v=c[0])||void 0===v?void 0:v.uuid)===(null==e||null===(p=e.assignes)||void 0===p||null===(m=p[0])||void 0===m?void 0:m.uuid)&&null!=P&&null!==(E=P.processInstance)&&void 0!==E&&null!==(f=E.assignes)&&void 0!==f&&null!==(A=f[0])&&void 0!==A&&A.mobileNumber?null==P||null===(g=P.processInstance)||void 0===g||null===(S=g.assignes)||void 0===S||null===(h=S[0])||void 0===h?void 0:h.mobileNumber:null==e||null===(y=e.assignes)||void 0===y||null===(T=y[0])||void 0===T?void 0:T.mobileNumber,comment:x(null==e?void 0:e.comment),wfComment:b?b.wfComment:[],thumbnailsToShow:null==e?void 0:e.thumbnailsToShow};return l.createElement(wi,{data:C,OpenImage:j,privacy:i})}{var b,C,N,I,L;const t={date:Z(null==P||null===(b=P.auditDetails)||void 0===b?void 0:b.lastModifiedTime),name:null==e||null===(C=e.assignes)||void 0===C||null===(N=C[0])||void 0===N?void 0:N.name,wfComment:null==e?void 0:e.wfComment,mobileNumber:null==e||null===(I=e.assignes)||void 0===I||null===(L=I[0])||void 0===L?void 0:L.mobileNumber};return l.createElement(wi,{data:t})}},ee=(e,t)=>e?t?e:x(e):x("NA"),te=window.location.href.includes("employee/tl")||window.location.href.includes("employee/obps")||window.location.href.includes("employee/noc"),le=window.location.href.includes("employee/noc"),ne=window.location.href.includes("employee/obps"),ie=(window.location.href.includes("employee/ws"),()=>window.location.href.includes("employee/obps")||window.location.href.includes("employee/noc")||te?{justifyContent:"space-between",fontSize:"16px",lineHeight:"19px",color:"#0B0C0C"}:{}),oe=e=>null!=e&&e.skip?e.value:null!=e&&e.isUnit?null!=e&&e.value?`${ee(null==e?void 0:e.value,null==e?void 0:e.isNotTranslated)} ${x(null==e?void 0:e.isUnit)}`:x("N/A"):null!=e&&e.value?ee(null==e?void 0:e.value,null==e?void 0:e.isNotTranslated):x("N/A"),[ae,re]=t.useState(!1);console.log("demand Data arr",T),null==T||T.reduce((e,t)=>e+t.demandInterest,0),null==T||T.reduce((e,t)=>e+t.demandPenality,0),null==T||T.reduce((e,t)=>e+t.collectionTax,0),null==T||T.reduce((e,t)=>e+t.collectionInterest,0),null==T||T.reduce((e,t)=>e+t.collectionPenality,0),null==T||T.reduce((e,t)=>e+t.balanceTax,0),null==T||T.reduce((e,t)=>e+t.balanceInterest,0),null==T||T.reduce((e,t)=>e+t.balancePenality,0);const ue=function(e,t,l){try{if(!window.confirm(`Are you sure you want to make this property ${t}?`))return Promise.resolve();const n={...e,status:t,isactive:"ACTIVE"===t,isinactive:"INACTIVE"===t,creationReason:"STATUS",additionalDetails:{...e.additionalDetails,propertytobestatus:t},workflow:{...e.workflow,businessService:"PT.CREATE",action:"OPEN",moduleName:"PT"}};return Promise.resolve(Digit.PTService.updatePT({Property:{...n}},F,l)).then(function(e){console.log("response from inactive/active",e)})}catch(e){return Promise.reject(e)}},de=null==D?void 0:D.applicationData,se=(null==D||null===(a=D.applicationData)||void 0===a?void 0:a.propertyId)||"",ce=null==D||null===(r=D.additionalDetails)||void 0===r?void 0:r.propertytobestatus;return console.log("applicationDetails?.applicationDetails",D),console.log("infolabel",R),console.log("assessment details",$),t.useEffect(()=>{try{Digit.PTService.paymentsearch({tenantId:F,filters:{consumerCodes:w},auth:!0}).then(e=>{W(null==e?void 0:e.Payments),console.log(e)})}catch(e){console.log(e)}},[]),l.createElement(o.Card,{style:{position:"relative"},className:"employeeCard-override"},R?l.createElement(Gi,{t:x,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==D||null===(u=D.applicationDetails)||void 0===u?void 0:u.map((e,n)=>{var a,r,u,d,s,c,v,p,m,E,_,f,A,g,S,h,y,T,C,P,N,I,L,R,w,M,F,k,U,H,W,j,Y,$,z,V,q,X;return l.createElement(l.Fragment,{key:n},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"}:te?{lineHeight:"19px",maxWidth:"600px",minWidth:"280px"}:{}},0!==n||e.asSectionHeader?l.createElement(l.Fragment,null,l.createElement(o.CardSectionHeader,{style:0==n&&te?{marginBottom:"16px",fontSize:"24px"}:{marginBottom:"16px",marginTop:"32px",fontSize:"24px"}},le?""+x(e.title):x(e.title),null!=e&&e.Component?l.createElement(e.Component,null):null)):l.createElement(o.CardSubHeader,{style:{marginBottom:"16px",fontSize:"24px"}},x(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"}},x(e)))),null==e?void 0:e.tableRows.map((n,i)=>i===(null==e?void 0:e.tableRows.length)-1?l.createElement(t.Fragment,null,l.createElement("hr",{style:{width:"370%",marginTop:"15px"},className:"underline"}),l.createElement("tr",null,n.map(e=>l.createElement("td",{style:{textAlign:"left"}},x(e))))):l.createElement("tr",null,n.map(e=>l.createElement("td",{style:{paddingTop:"20px",textAlign:"left"}},x(e)))))),l.createElement(o.StatusTable,{style:window.location.href.includes("employee/obps")||window.location.href.includes("employee/noc")||te?{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((t,n)=>{var a,r,u;return!0===t.map&&"N/A"!==t.value?l.createElement(o.Row,{labelStyle:{wordBreak:"break-all"},textStyle:{wordBreak:"break-all"},key:x(t.title),label:x(t.title),text:l.createElement("img",{src:x(t.value),alt:"",privacy:null==t?void 0:t.privacy})}):1==(null==t?void 0:t.isLink)?l.createElement(o.Row,{key:x(t.title),label:window.location.href.includes("tl")||window.location.href.includes("ws")?l.createElement("div",{style:{width:"200%"}},l.createElement(i.Link,{to:null==t?void 0:t.to},l.createElement("span",{className:"link",style:{color:"#a82227"}},x(null==t?void 0:t.title)))):le||ne?""+x(t.title):x(t.title),text:l.createElement("div",null,l.createElement(i.Link,{to:null==t?void 0:t.to},l.createElement("span",{className:"link",style:{color:"#a82227"}},null==t?void 0:t.value))),last:n===(null==e||null===(u=e.values)||void 0===u?void 0:u.length)-1,caption:t.caption,className:"border-none",rowContainerStyle:ie(),labelStyle:{wordBreak:"break-all"},textStyle:{wordBreak:"break-all"}}):l.createElement("div",null,window.location.href.includes("modify")?l.createElement(o.Row,{className:"border-none",key:""+t.title,label:""+x(""+t.title),privacy:null==t?void 0:t.privacy,text:null!=t&&t.oldValue?null==t?void 0:t.oldValue:null!=t&&t.value?null==t?void 0:t.value:"",labelStyle:{wordBreak:"break-all"},textStyle:{wordBreak:"break-all"}}):l.createElement(o.Row,{key:x(t.title),label:x(t.title),text:oe(t),last:n===(null==e||null===(a=e.values)||void 0===a?void 0:a.length)-1,caption:t.caption,className:"border-none",privacy:null==t?void 0:t.privacy,rowContainerStyle:ie(),labelStyle:{wordBreak:"break-all"},textStyle:{wordBreak:"break-all"}}),"PT_TOTAL_DUES"===t.title?l.createElement(zi,{bill:null===(r=K.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(_n,{scrutinyDetails:null==e?void 0:e.additionalDetails,paymentsList:B,additionalDetails:null==D||null===(u=D.applicationData)||void 0===u?void 0:u.additionalDetails,applicationData:null==D?void 0:D.applicationData}),(null==D||null===(d=D.applicationData)||void 0===d||null===(s=d.additionalDetails)||void 0===s||null===(c=s.fieldinspection_pending)||void 0===c?void 0:c.length)>0&&(null==e||null===(v=e.additionalDetails)||void 0===v?void 0:v.fiReport)&&l.createElement(En,{fiReport:null==D||null===(p=D.applicationData)||void 0===p||null===(m=p.additionalDetails)||void 0===m?void 0:m.fieldinspection_pending}),(null==e||null===(E=e.additionalDetails)||void 0===E?void 0:E.floors)&&l.createElement(Bi,{floors:null==e||null===(_=e.additionalDetails)||void 0===_?void 0:_.floors}),(null==e||null===(f=e.additionalDetails)||void 0===f?void 0:f.owners)&&l.createElement(Oi,{owners:null==e||null===(A=e.additionalDetails)||void 0===A?void 0:A.owners}),(null==e||null===(g=e.additionalDetails)||void 0===g?void 0:g.units)&&l.createElement(Mi,{units:null==e||null===(S=e.additionalDetails)||void 0===S?void 0:S.units}),(null==e||null===(h=e.additionalDetails)||void 0===h?void 0:h.accessories)&&l.createElement(xi,{units:null==e||null===(y=e.additionalDetails)||void 0===y?void 0:y.accessories}),!G&&(null==e||null===(T=e.additionalDetails)||void 0===T?void 0:T.permissions)&&(null==b||null===(C=b.data)||void 0===C||null===(P=C.nextActions)||void 0===P?void 0:P.length)>0&&l.createElement(Ii,{applicationData:null==D?void 0:D.applicationData,t:x,permissions:null==e||null===(N=e.additionalDetails)||void 0===N?void 0:N.permissions}),(null==e||null===(I=e.additionalDetails)||void 0===I?void 0:I.obpsDocuments)&&l.createElement("div",{style:{display:"flex"}},l.createElement(bi,{t:x,applicationData:null==D?void 0:D.applicationData,docs:e.additionalDetails.obpsDocuments,bpaActionsDetails:b})),(null==e||null===(L=e.additionalDetails)||void 0===L?void 0:L.noc)&&l.createElement(Ni,{t:x,isNoc:!0,NOCdata:e.values,applicationData:null==D?void 0:D.applicationData,docs:e.additionalDetails.noc,noc:null===(R=e.additionalDetails)||void 0===R?void 0:R.data,bpaActionsDetails:b}),(null==e||null===(w=e.additionalDetails)||void 0===w?void 0:w.scruntinyDetails)&&l.createElement(_n,{scrutinyDetails:null==e?void 0:e.additionalDetails}),(null==e||null===(M=e.additionalDetails)||void 0===M?void 0:M.buildingExtractionDetails)&&l.createElement(_n,{scrutinyDetails:null==e?void 0:e.additionalDetails}),(null==e||null===(F=e.additionalDetails)||void 0===F?void 0:F.subOccupancyTableDetails)&&l.createElement(mn,{edcrDetails:null==e?void 0:e.additionalDetails,applicationData:null==D?void 0:D.applicationData}),(null==e||null===(k=e.additionalDetails)||void 0===k?void 0:k.documentsWithUrl)&&l.createElement(Vl,{documents:null==e||null===(U=e.additionalDetails)||void 0===U?void 0:U.documentsWithUrl}),(null==e||null===(H=e.additionalDetails)||void 0===H?void 0:H.taxHeadEstimatesCalculation)&&l.createElement(Li,{taxHeadEstimatesCalculation:null==e||null===(W=e.additionalDetails)||void 0===W?void 0:W.taxHeadEstimatesCalculation}),(null==e?void 0:e.isWaterConnectionDetails)&&l.createElement(Fi,{wsAdditionalDetails:e,oldValue:O}),(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===(Y=e.additionalDetails)||void 0===Y||null===($=Y.redirectUrl)||void 0===$?void 0:$.url},l.createElement("span",{className:"link",style:{color:"#a82227"}},null==e||null===(z=e.additionalDetails)||void 0===z||null===(V=z.redirectUrl)||void 0===V?void 0:V.title))),(null==e||null===(q=e.additionalDetails)||void 0===q?void 0:q.estimationDetails)&&l.createElement(Hi,{wsAdditionalDetails:e,workflowDetails:b}),(null==e||null===(X=e.additionalDetails)||void 0===X?void 0:X.estimationDetails)&&l.createElement(ji,{wsAdditionalDetails:e,workflowDetails:b}))}),(null==$?void 0:$.length)>0&&l.createElement(Vi,{assessmentData:V}),l.createElement(Xi,{payments:H}),l.createElement(qi,{applicationData:null==D?void 0:D.applicationData}),I&&(null==b||null===(d=b.data)||void 0===d||null===(s=d.timeline)||void 0===s?void 0:s.length)>0&&l.createElement(l.Fragment,null,l.createElement(o.BreakLine,null),((null==b?void 0:b.isLoading)||C)&&l.createElement(o.Loader,null),!(null!=b&&b.isLoading)&&!C&&l.createElement(t.Fragment,null,l.createElement("div",{id:"timeline"},l.createElement(o.CardSectionHeader,{style:{marginBottom:"16px",marginTop:"32px"}},x("ES_APPLICATION_DETAILS_APPLICATION_TIMELINE")),null!=b&&null!==(c=b.data)&&void 0!==c&&c.timeline&&1===(null==b||null===(v=b.data)||void 0===v||null===(p=v.timeline)||void 0===p?void 0:p.length)?l.createElement(o.CheckPoint,{isCompleted:!0,label:x(`${N}${null==b||null===(m=b.data)||void 0===m||null===(E=m.timeline[0])||void 0===E?void 0:E.state}`),customChild:Q(null==b||null===(f=b.data)||void 0===f?void 0:f.timeline[0],null==b||null===(A=b.data)||void 0===A?void 0:A.timeline)}):l.createElement(o.ConnectingCheckPoints,null,(null==b||null===(g=b.data)||void 0===g?void 0:g.timeline)&&(null==b||null===(S=b.data)||void 0===S?void 0:S.timeline.slice(0,ae?null==b?void 0:b.data.timeline.length:2).map((e,t,n)=>{var i;let a="";var r,u,d,s,c,v;return window.location.href.includes("/obps/")&&(a=null!=b&&null!==(r=b.data)&&void 0!==r&&null!==(u=r.timeline[t-1])&&void 0!==u&&null!==(d=u.state)&&void 0!==d&&d.includes("BACK_FROM")||null!=b&&null!==(s=b.data)&&void 0!==s&&null!==(c=s.timeline[t-1])&&void 0!==c&&null!==(v=c.state)&&void 0!==v&&v.includes("SEND_TO_CITIZEN")?"_NOT_DONE":"SEND_TO_ARCHITECT"===(null==e?void 0:e.performedAction)?"_BY_ARCHITECT_DONE":0==t?"":"_DONE"),l.createElement(l.Fragment,{key:t},l.createElement(o.CheckPoint,{keyValue:t,isCompleted:0===t,info:e.comment,label:x(`${N}${"REOPEN"===(null==e?void 0:e.performedAction)?null==e?void 0:e.performedAction:null==e?void 0:e[L]}${a}`),customChild:Q(e,t,null==b||null===(i=b.data)||void 0===i?void 0:i.timeline)}))}))),(null==b||null===(h=b.data)||void 0===h||null===(y=h.timeline)||void 0===y?void 0:y.length)>2&&l.createElement(o.LinkButton,{label:x(ae?"COLLAPSE":"VIEW_TIMELINE"),onClick:()=>{re(e=>!e)}})))),window.location.href.includes("/pt/")?l.createElement(o.ActionBar,{className:"clear-search-container",style:{display:"block"}},l.createElement(o.SubmitBar,{label:"Make Property Active",style:{flex:1},onSubmit:()=>{window.location.href.includes("employee")?"INACTIVE"==ce?ue(de,"ACTIVE",se):alert("Property is already active."):alert("You are not authorized to change the property status.")}}),l.createElement(o.SubmitBar,{label:"Make Property Inactive",style:{marginLeft:"20px"},onSubmit:()=>{window.location.href.includes("employee")?"ACTIVE"==ce?ue(de,"INACTIVE",se):alert("Property is already inactive."):alert("You are not authorized to change the property status.")}}),l.createElement(o.SubmitBar,{label:"Edit Property",style:{marginLeft:"20px"},onSubmit:()=>{var e;const t=null==D||null===(e=D.applicationData)||void 0===e?void 0:e.propertyId;if(t)if(window.location.href.includes("employee")){var l,n,i;if("INACTIVE"===(null==D||null===(l=D.applicationData)||void 0===l?void 0:l.status))return void alert("Property is inactive, cannot edit.");if("INWORKFLOW"===(null==D||null===(n=D.applicationData)||void 0===n?void 0:n.status))return void alert("Property is in workflow, cannot edit.");"ACTIVE"===(null==D||null===(i=D.applicationData)||void 0===i?void 0:i.status)&&M.push({pathname:"/digit-ui/employee/pt/edit-application/"+t})}else{var o,a,r;if("INACTIVE"===(null==D||null===(o=D.applicationData)||void 0===o?void 0:o.status))return void alert("Property is inactive, cannot edit.");if("INWORKFLOW"===(null==D||null===(a=D.applicationData)||void 0===a?void 0:a.status))return void alert("Property is in workflow, cannot edit.");"ACTIVE"===(null==D||null===(r=D.applicationData)||void 0===r?void 0:r.status)&&M.push({pathname:"/digit-ui/citizen/pt/property/edit-application/"+t})}}}),l.createElement(o.SubmitBar,{label:"Access Property",style:{marginLeft:"20px"},onSubmit:()=>{alert("access property")}})):l.createElement("div",null),k&&l.createElement(o.Toast,{error:k.isError,label:x(k.label),onClose:()=>{U(null)},isDleteBtn:"false"}))}function Zi(e){var t,n,i,a,r,u,d,s,c,v,p,m,E,_,f,A,g,S;let{t:h,showToast:y,closeToast:D,businessService:T}=e;if(null!=T&&T.includes("NewTL")||null!=T&&T.includes("TL")||null!=T&&T.includes("EDITRENEWAL")){var b;let e="";switch(null==y||null===(b=y.action)||void 0===b?void 0:b.action){case"SENDBACK":e="error"===(null==y?void 0:y.key)?null==y||null===(t=y.error)||void 0===t?void 0:t.message:h("TL_SENDBACK_CHECKLIST_MESSAGE_HEAD");break;case"FORWARD":e="error"===(null==y?void 0:y.key)?null==y||null===(n=y.error)||void 0===n?void 0:n.message:h("TL_FORWARD_SUCCESS_MESSAGE_MAIN");break;case"APPROVE":e="error"===(null==y?void 0:y.key)?null==y||null===(i=y.error)||void 0===i?void 0:i.message:h("TL_APPROVAL_CHECKLIST_MESSAGE_HEAD");break;case"SENDBACKTOCITIZEN":e="error"===(null==y?void 0:y.key)?null==y||null===(a=y.error)||void 0===a?void 0:a.message:h("TL_SENDBACK_TOCITIZEN_CHECKLIST_MESSAGE_HEAD");break;case"REJECT":e="error"===(null==y?void 0:y.key)?null==y||null===(r=y.error)||void 0===r?void 0:r.message:h("TL_APPROVAL_REJ_MESSAGE_HEAD");break;case"RESUBMIT":e="error"===(null==y?void 0:y.key)?null==y||null===(u=y.error)||void 0===u?void 0:u.message:h("TL_APPLICATION_RESUBMIT_SUCCESS_MESSAGE_MAIN");break;case"CANCEL":e="error"===(null==y?void 0:y.key)?null==y||null===(d=y.error)||void 0===d?void 0:d.message:h("TL_TL_CANCELLED_MESSAGE_HEAD");break;default:e="error"===(null==y?void 0:y.key)?null==y||null===(s=y.error)||void 0===s?void 0:s.message:h(`ES_${T}_${null==y||null===(c=y.action)||void 0===c?void 0:c.action}_UPDATE_SUCCESS`)}return l.createElement(l.Fragment,null,y&&l.createElement(o.Toast,{error:"error"===y.key,label:e,onClose:D}))}if(null!=T&&T.includes("BPA")||null!=T&&T.includes("BPA_LOW")||null!=T&&T.includes("BPA_OC")){var C;const e=function(e){var t;void 0===e&&(e=[]);let l=e[0];return l=2==(null===(t=e)||void 0===t?void 0:t.length)&&null!=T&&T.includes("BPA_OC")?h(e[1]):h(e[0]),l};let t="";switch(null==y||null===(C=y.action)||void 0===C?void 0:C.action){case"REVOCATE":t="error"===(null==y?void 0:y.key)?null==y||null===(v=y.error)||void 0===v?void 0:v.message:e(["BPA_APPROVAL_REVOCATED_MESSAGE_HEAD","BPA_APPROVAL_OC_REVOCATED_MESSAGE_HEAD"]);break;case"VERIFY_AND_FORWARD":t="error"===(null==y?void 0:y.key)?null==y||null===(p=y.error)||void 0===p?void 0:p.message:e(["BPA_FORWARD_SUCCESS_MESSAGE_MAIN"]);break;case"SEND_BACK_TO_CITIZEN":t="error"===(null==y?void 0:y.key)?null==y||null===(m=y.error)||void 0===m?void 0:m.message:e(["BPA_SENDBACK_SUCCESS_MESSAGE_MAIN"]);break;case"APPROVE":t="error"===(null==y?void 0:y.key)?null==y||null===(E=y.error)||void 0===E?void 0:E.message:e(["BPA_APPROVAL_CHECKLIST_MESSAGE_HEAD"]);break;case"REJECT":t="error"===(null==y?void 0:y.key)?null==y||null===(_=y.error)||void 0===_?void 0:_.message:e(["BPA_APPROVAL_REJECTED_MESSAGE_HEAD","BPA_OC_APPROVAL_REJECTED_MESSAGE_HEAD"]);break;case"FORWARD":t="error"===(null==y?void 0:y.key)?null==y||null===(f=y.error)||void 0===f?void 0:f.message:e(["BPA_FORWARD_SUCCESS_MESSAGE_MAIN"]);break;case"SEND_BACK_FOR_DOCUMENT_VERIFICATION":case"SEND_BACK_FOR_FIELD_INSPECTION":t="error"===(null==y?void 0:y.key)?null==y||null===(A=y.error)||void 0===A?void 0:A.message:e(["BPA_SENDBACK_SUCCESS_MESSAGE_MAIN"]);break;default:t="error"===(null==y?void 0:y.key)?null==y||null===(g=y.error)||void 0===g?void 0:g.message:h(`ES_${T}_${null==y||null===(S=y.action)||void 0===S?void 0:S.action}_UPDATE_SUCCESS`)}return l.createElement(l.Fragment,null,y&&l.createElement(o.Toast,{error:"error"===y.key,label:t,onClose:D}))}{var P,N;const e="error"===(null==y?void 0:y.key)?null==y||null===(P=y.error)||void 0===P?void 0:P.message:`ES_${T}_${null==y||null===(N=y.action)||void 0===N?void 0:N.action}_UPDATE_SUCCESS`;return l.createElement(l.Fragment,null,y&&l.createElement(o.Toast,{error:"error"===y.key,label:h(e),onClose:D}))}}function Qi(e){var i,a,r,u,d,s,c,v,p,m,E,_,f,A,g,S;let{workflowDetails:h,displayMenu:y,onActionSelect:D,setDisplayMenu:T,businessService:b,forcedActionPrefix:C,ActionBarStyle:P={},MenuStyle:N={}}=e;const{t:I}=n.useTranslation();let L=Digit.UserService.getUser();const B=t.useRef();if(window.location.href.includes("/obps")||window.location.href.includes("/noc")){const e=sessionStorage.getItem("Digit.citizen.userRequestObject"),t=e?JSON.parse(e):{};L=null==t?void 0:t.value}const O=null===(i=L)||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,w=!1,x=(null==h||null===(u=h.data)||void 0===u||null===(d=u.actionState)||void 0===d||null===(s=d.nextActions)||void 0===s?void 0:s.filter(e=>(null==O?void 0:O.some(t=>{var l;return null===(l=e.roles)||void 0===l?void 0:l.includes(t)}))||!e.roles))||(null==h||null===(c=h.data)||void 0===c||null===(v=c.nextActions)||void 0===v?void 0:v.filter(e=>(null==O?void 0:O.some(t=>{var l;return null===(l=e.roles)||void 0===l?void 0:l.includes(t)}))||!e.roles));return Digit.Hooks.useClickOutside(B,()=>{T(!1)},y),(window.location.href.includes("/obps")||window.location.href.includes("/noc"))&&1==(null==x?void 0:x.length)||null!=x&&null!==(p=x[0])&&void 0!==p&&null!==(m=p.redirectionUrl)&&void 0!==m&&m.pathname.includes("/pt/property-details/")&&1==(null==x?void 0:x.length)?(w=!1,R=!0):(null==x?void 0:x.length)>0&&(w=!0,R=!1),l.createElement(l.Fragment,null,!(null!=h&&h.isLoading)&&w&&!R&&l.createElement(o.ActionBar,{style:{...P}},y&&(null!=h&&null!==(E=h.data)&&void 0!==E&&null!==(_=E.actionState)&&void 0!==_&&_.nextActions||null!=h&&null!==(f=h.data)&&void 0!==f&&f.nextActions)?l.createElement(o.Menu,{localeKeyPrefix:C||"WF_EMPLOYEE_"+(null==b?void 0:b.toUpperCase()),options:x,optionKey:"action",t:I,onSelect:D,style:N}):null,l.createElement(o.SubmitBar,{ref:B,label:I("WF_TAKE_ACTION"),onSubmit:()=>T(!y)})),!(null!=h&&h.isLoading)&&!w&&R&&l.createElement(o.ActionBar,{style:{...P}},l.createElement("button",{style:{color:"#FFFFFF",fontSize:"18px"},className:"submit-bar",name:null==x||null===(A=x[0])||void 0===A?void 0:A.action,value:null==x||null===(g=x[0])||void 0===g?void 0:g.action,onClick:e=>{D((null==x?void 0:x[0])||{})}},I(`${C||"WF_EMPLOYEE_"+(null==b?void 0:b.toUpperCase())}_${null==x||null===(S=x[0])||void 0===S?void 0:S.action}`))))}const eo=()=>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"})),to=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(eo,null));function lo(e){let{action:t,closeWarningPopup:i}=e;const{t:a}=n.useTranslation(),r=window.Digit.Utils.browser.isMobile();return l.createElement(l.Fragment,null,l.createElement(o.Modal,{headerBarMain:l.createElement("h1",{className:"heading-m"},a("PT_DUES_ARE_PENDING")),headerBarEnd:l.createElement(to,{onClick:()=>{i()}}),hideSubmit:!0,isDisabled:!1,popupStyles:r?{}:{width:"29%",marginTop:"auto"}},l.createElement(o.Card,null,l.createElement("div",{style:{marginBottom:"30px"}},l.createElement("h1",null,a("PT_YOU_HAVE")," ₹",null==t?void 0:t.AmountDueForPay," ",a("PT_DUE_WARNING_MSG2"))),l.createElement(o.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==t?void 0:t.AmountDueForPay)}),l.createElement("div",{style:{width:"100%",display:"flex",justifyContent:"flex-end"}},l.createElement(o.ButtonSelector,{theme:"border",label:a("ES_PT_COMMON_CANCEL"),onSubmit:i,style:{marginLeft:"10px"}}),l.createElement(o.ButtonSelector,{label:a("PT_COLLECT"),onSubmit:()=>{var e;return window.location.assign(`${window.location.origin}${null==t||null===(e=t.redirectionUrl)||void 0===e?void 0:e.pathname}`)},style:{marginLeft:"10px"}})))),")")}const no=e=>{var a,r;console.log("props",e);let d=window.location.href.includes("editApplication")&&window.location.href.includes("bpa");const s=Digit.ULBService.getCurrentTenantId(),c=Digit.ULBService.getStateId(),{data:v}=Digit.Hooks.obps.useMDMS(c,"BPA",["BlockReason"]),{t:p}=n.useTranslation(),E=i.useHistory();let{id:_}=i.useParams();const[f,A]=t.useState(!1),[g,S]=t.useState(null),[h,y]=t.useState(!1),[D,T]=t.useState(!1),[b,C]=t.useState(!1),{data:P}=Digit.Hooks.obps.useMDMS(c,"BPA",["RiskTypeComputation"]),{applicationDetails:N,demandData:I,totalDemandTax:L,totalBalanceTax:B,showToast:O,setShowToast:R,isLoading:w,isDataLoading:x,applicationData:M,mutate:F,nocMutation:k,workflowDetails:U,id:H,businessService:W,closeToast:G,moduleCode:j,timelineStatusPrefix:K,forcedActionPrefix:Y,statusAttribute:$,ActionBarStyle:z,MenuStyle:V,paymentsList:q,showTimeLine:X=!0,oldValue:J,isInfoLabel:Z=!1,clearDataDetails:Q,propertyId:ee}=e;t.useEffect(()=>{O&&U.revalidate()},[O]);const te=u.useQueryClient(),le=()=>{S(null),y(!1)};return w||D?l.createElement(o.Loader,null):l.createElement(l.Fragment,null,w?l.createElement(o.Loader,null):l.createElement(l.Fragment,null,l.createElement(Ji,{applicationDetails:N,demandData:I,id:H,workflowDetails:U,isDataLoading:x,applicationData:M,totalDemandTax:L,totalBalanceTax:B,businessService:W,timelineStatusPrefix:K,statusAttribute:$,paymentsList:q,showTimeLine:X,oldValue:J,isInfoLabel:Z,propertyId:ee}),h?l.createElement(Ti,{t:p,action:g,tenantId:s,state:c,id:_,applicationDetails:N,applicationData:null==N?void 0:N.applicationData,closeModal:le,submitAction:function(e,t,l){void 0===t&&(t=!1),void 0===l&&(l={});try{let n=!1;const i=function(i,o,a,r,u,d,s,c,v,_,f,A,S,h,y,D,b,C){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===(d=e.Licenses)||void 0===d||null===(s=d[0])||void 0===s||null===(c=s.additionalDetail)||void 0===c||null===(v=c.validityYears)||void 0===v?void 0:v.length):0==(null==e||null===(_=e.Licenses)||void 0===_||null===(f=_[0])||void 0===f||null===(A=f.comment)||void 0===A?void 0:A.length))||0==(null==e||null===(S=e.WaterConnection)||void 0===S||null===(h=S.comment)||void 0===h?void 0:h.length)||0==(null==e||null===(y=e.SewerageConnection)||void 0===y||null===(D=y.comment)||void 0===D?void 0:D.length)||0==(null==e||null===(b=e.BPA)||void 0===b||null===(C=b.comment)||void 0===C?void 0:C.length)){var P,N;"INITIATE"===(null==e||null===(P=e.Licenses)||void 0===P||null===(N=P[0])||void 0===N?void 0:N.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 d(t){if(n)return t;F&&(T(!0),F(e,{onError:(e,t)=>{T(!1),R({key:"error",error:e}),setTimeout(G,5e3)},onSuccess:(e,t)=>{var n,i,o,a,r,u;if(sessionStorage.removeItem("WS_SESSION_APPLICATION_DETAILS"),T(!1),null!==(n=l)&&void 0!==n&&n.bpa&&(e.selectedAction=g,E.replace("/digit-ui/employee/obps/response",{data:e})),null!==(i=l)&&void 0!==i&&i.isStakeholder&&(e.selectedAction=g,E.push("/digit-ui/employee/obps/stakeholder-response",{data:e})),null!==(o=l)&&void 0!==o&&o.isNoc&&E.push("/digit-ui/employee/noc/response",{data:e}),(null==e||null===(a=e.Amendments)||void 0===a?void 0:a.length)>0){var d,s,c,v,m,_,f,A;null!=t&&null!==(d=t.AmendmentUpdate)&&void 0!==d&&null!==(s=d.workflow)&&void 0!==s&&s.action.includes("SEND_BACK")?R({key:"success",label:p("ES_MODIFYSWCONNECTION_SEND_BACK_UPDATE_SUCCESS")}):null!=t&&null!==(c=t.AmendmentUpdate)&&void 0!==c&&null!==(v=c.workflow)&&void 0!==v&&v.action.includes("RE-SUBMIT")?R({key:"success",label:p("ES_MODIFYSWCONNECTION_RE_SUBMIT_UPDATE_SUCCESS")}):null!=t&&null!==(m=t.AmendmentUpdate)&&void 0!==m&&null!==(_=m.workflow)&&void 0!==_&&_.action.includes("APPROVE")?R({key:"success",label:p("ES_MODIFYSWCONNECTION_APPROVE_UPDATE_SUCCESS")}):null!=t&&null!==(f=t.AmendmentUpdate)&&void 0!==f&&null!==(A=f.workflow)&&void 0!==A&&A.action.includes("REJECT")&&R({key:"success",label:p("ES_MODIFYWSCONNECTION_REJECT_UPDATE_SUCCESS")})}else{var S;if((null==e||null===(r=e.Licenses)||void 0===r?void 0:r.length)>0&&null!=e&&null!==(u=e.Licenses[0])&&void 0!==u&&u.applicationNumber)return R({key:"success",action:g}),void E.replace("/digit-ui/employee/tl/application-details/"+(null==e||null===(S=e.Licenses[0])||void 0===S?void 0:S.applicationNumber));R({key:"success",action:g}),Q&&setTimeout(Q,3e3),setTimeout(G,5e3),te.clear(),te.refetchQueries("APPLICATION_SEARCH")}}})),le()}T(!0),"function"==typeof(null==e?void 0:e.customFunctionToExecute)&&(null==e||e.customFunctionToExecute({...e}));const i=function(){if(!1!==t&&k){var e;const l=null===(e=t)||void 0===e?void 0:e.map(e=>null==k?void 0:k.mutateAsync(e)),i=m(function(){return T(!0),Promise.resolve(Promise.all(l)).then(function(e){e&&e.map(e=>{var t,l;Digit.SessionStorage.del(null==e||null===(t=e.Noc)||void 0===t||null===(l=t[0])||void 0===l?void 0:l.nocType)})})},function(e){var t,l,i,o,a,r,u,d,s,c,v,m;T(!1);let E=null!=e&&null!==(t=e.response)&&void 0!==t&&null!==(l=t.data)&&void 0!==l&&null!==(i=l.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===(d=u[0])||void 0===d?void 0:d.code):(null==e||null===(s=e.response)||void 0===s||null===(c=s.data)||void 0===c||null===(v=c.Errors)||void 0===v||null===(m=v[0])||void 0===m?void 0:m.message)||e;le(),R({key:"error",error:{message:E}}),setTimeout(G,5e3),n=!0});if(i&&i.then)return i.then(function(){})}}();return i&&i.then?i.then(d):d(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==U||null===(a=U.data)||void 0===a?void 0:a.timeline,businessService:W,workflowDetails:U,moduleCode:j,blockReason:null==v||null===(r=v.BPA)||void 0===r?void 0:r.BlockReason}):null,b?l.createElement(lo,{action:g,workflowDetails:U,businessService:W,isWarningPop:b,closeWarningPopup:()=>{C(!1)}}):null,l.createElement(Zi,{t:p,showToast:O,closeToast:G,businessService:W}),l.createElement("div",null,d?l.createElement(o.SubmitBar,{style:{marginRight:20},label:p("BPA_EDIT_UPDATE"),onSubmit:function(e){try{return Promise.resolve(Digit.OBPSService.BPASearch(s,{applicationNo:null==M?void 0:M.applicationNo})).then(function(e){var t,l,n,i,o,a;const r=Digit.Utils.obps.calculateRiskType(null==P||null===(t=P.BPA)||void 0===t?void 0:t.RiskTypeComputation,null==N||null===(l=N.edcrDetails)||void 0===l||null===(n=l.planDetail)||void 0===n||null===(i=n.plot)||void 0===i?void 0:i.area,null==N||null===(o=N.edcrDetails)||void 0===o||null===(a=o.planDetail)||void 0===a?void 0:a.blocks),u={BPA:e.BPA[0]};u.BPA.riskType=r,u.BPA.workflow={action:"EDIT PAY 2",assignes:[],comments:null,varificationDocuments:null},u.BPA.additionalDetails.selfCertificationCharges.BPA_DEVELOPMENT_CHARGES=sessionStorage.getItem("development")||"0",u.BPA.additionalDetails.selfCertificationCharges.BPA_OTHER_CHARGES=sessionStorage.getItem("otherCharges")||"0",u.BPA.additionalDetails.selfCertificationCharges.BPA_LESS_ADJUSMENT_PLOT=sessionStorage.getItem("lessAdjusment")||"0",u.BPA.additionalDetails.otherFeesDiscription=sessionStorage.getItem("otherChargesDisc"),u.BPA.additionalDetails.lessAdjustmentFeeFiles=JSON.parse(sessionStorage.getItem("uploadedFileLess"));const d=function(e,t,l,n,i,o,a,r,d,c,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===(l=t.selfCertificationCharges)||void 0===l?void 0:l.BPA_MALBA_CHARGES)+parseInt(null==u||null===(n=u.BPA)||void 0===n||null===(i=n.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===(d=r.selfCertificationCharges)||void 0===d?void 0:d.BPA_WATER_CHARGES)+parseInt(null==u||null===(c=u.BPA)||void 0===c||null===(v=c.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,s)).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(d&&d.then)return d.then(function(){})})}catch(e){return Promise.reject(e)}},id:!0}):!(window.location.href.includes("citizen")&&window.location.href.includes("/pt/"))&&l.createElement(Qi,{workflowDetails:U,displayMenu:f,onActionSelect:function(e){var t,l,n;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)C(!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))E.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 d,s;E.push(""+(null==e||null===(d=e.redirectionUrll)||void 0===d?void 0:d.pathname),{data:null==e||null===(s=e.redirectionUrll)||void 0===s?void 0:s.state})}else{var c;window.location.assign(`${window.location.origin}/digit-ui/employee/payment/collect/${null==e||null===(c=e.redirectionUrll)||void 0===c?void 0:c.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===(l=t.state)||void 0===l||null===(n=l.applicationData)||void 0===n?void 0:n.workflowCode))console.log("Got Inside Direct"),y(!0);else{var v,p;E.push({pathname:null===(v=e.redirectionUrl)||void 0===v?void 0:v.pathname,state:{...null===(p=e.redirectionUrl)||void 0===p?void 0:p.state}})}else y(!0);S(e),A(!1)},setDisplayMenu:A,businessService:W,forcedActionPrefix:Y,ActionBarStyle:z,MenuStyle:V}))))},io=[{head:"",body:[{type:"component",component:"InspectionReport",key:"FieldReports",withoutLabel:!0,hideInCitizen:!0}]}];var oo=function(e){return"symbol"==typeof e||re(e)&&"[object Symbol]"==x(e)},ao=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ro=/^\w*$/,uo=function(e,t){if(pe(e))return!1;var l=typeof e;return!("number"!=l&&"symbol"!=l&&"boolean"!=l&&null!=e&&!oo(e))||ro.test(e)||!ao.test(e)||null!=t&&e in Object(t)};function so(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");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(so.Cache||Q),l}so.Cache=Q;var co,vo,po=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,mo=/\\(\\)?/g,Eo=(co=so(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(po,function(e,l,n,i){t.push(n?i.replace(mo,"$1"):l||e)}),t},function(e){return 500===vo.size&&vo.clear(),e}),vo=co.cache,co),_o=function(e,t){for(var l=-1,n=null==e?0:e.length,i=Array(n);++l<n;)i[l]=t(e[l],l,e);return i},fo=N?N.prototype:void 0,Ao=fo?fo.toString:void 0,go=function(e,t){return pe(e)?e:uo(e,t)?[e]:Eo(function(e){return null==e?"":function e(t){if("string"==typeof t)return t;if(pe(t))return _o(t,e)+"";if(oo(t))return Ao?Ao.call(t):"";var l=t+"";return"0"==l&&1/t==-1/0?"-0":l}(e)}(e))},So=function(e){if("string"==typeof e||oo(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t},ho=function(e,t){for(var l=0,n=(t=go(t,e)).length;null!=e&&l<n;)e=e[So(t[l++])];return l&&l==n?e:void 0},yo=function(e,t,l){var n=null==e?void 0:ho(e,t);return void 0===n?l:n};function Do(e){var t=-1,l=null==e?0:e.length;for(this.__data__=new Q;++t<l;)this.add(e[t])}Do.prototype.add=Do.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},Do.prototype.has=function(e){return this.__data__.has(e)};var To=Do,bo=function(e,t){for(var l=-1,n=null==e?0:e.length;++l<n;)if(t(e[l],l,e))return!0;return!1},Co=function(e,t){return e.has(t)},Po=function(e,t,l,n,i,o){var a=1&l,r=e.length,u=t.length;if(r!=u&&!(a&&u>r))return!1;var d=o.get(e),s=o.get(t);if(d&&s)return d==t&&s==e;var c=-1,v=!0,p=2&l?new To:void 0;for(o.set(e,t),o.set(t,e);++c<r;){var m=e[c],E=t[c];if(n)var _=a?n(E,m,c,t,e,o):n(m,E,c,e,t,o);if(void 0!==_){if(_)continue;v=!1;break}if(p){if(!bo(t,function(e,t){if(!Co(p,t)&&(m===e||i(m,e,l,n,o)))return p.push(t)})){v=!1;break}}else if(m!==E&&!i(m,E,l,n,o)){v=!1;break}}return o.delete(e),o.delete(t),v},No=function(e){var t=-1,l=Array(e.size);return e.forEach(function(e,n){l[++t]=[n,e]}),l},Io=function(e){var t=-1,l=Array(e.size);return e.forEach(function(e){l[++t]=e}),l},Lo=N?N.prototype:void 0,Bo=Lo?Lo.valueOf:void 0,Oo=Object.prototype.hasOwnProperty,Ro=Object.prototype.hasOwnProperty,wo=function e(t,l,n,i,o){return t===l||(null==t||null==l||!re(t)&&!re(l)?t!=t&&l!=l:function(e,t,l,n,i,o){var a=pe(e),r=pe(t),u=a?"[object Array]":lt(e),d=r?"[object Array]":lt(t),s="[object Object]"==(u="[object Arguments]"==u?"[object Object]":u),c="[object Object]"==(d="[object Arguments]"==d?"[object Object]":d),v=u==d;if(v&&Ee(e)){if(!Ee(t))return!1;a=!0,s=!1}if(v&&!s)return o||(o=new te),a||De(e)?Po(e,t,l,n,i,o):function(e,t,l,n,i,o,a){switch(l){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!o(new it(e),new it(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return f(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var r=No;case"[object Set]":if(r||(r=Io),e.size!=t.size&&!(1&n))return!1;var u=a.get(e);if(u)return u==t;n|=2,a.set(e,t);var d=Po(r(e),r(t),n,i,o,a);return a.delete(e),d;case"[object Symbol]":if(Bo)return Bo.call(e)==Bo.call(t)}return!1}(e,t,u,l,n,i,o);if(!(1&l)){var p=s&&Ro.call(e,"__wrapped__"),m=c&&Ro.call(t,"__wrapped__");if(p||m){var E=p?e.value():e,_=m?t.value():t;return o||(o=new te),i(E,_,l,n,o)}}return!!v&&(o||(o=new te),function(e,t,l,n,i,o){var a=1&l,r=Ke(e),u=r.length;if(u!=Ke(t).length&&!a)return!1;for(var d=u;d--;){var s=r[d];if(!(a?s in t:Oo.call(t,s)))return!1}var c=o.get(e),v=o.get(t);if(c&&v)return c==t&&v==e;var p=!0;o.set(e,t),o.set(t,e);for(var m=a;++d<u;){var E=e[s=r[d]],_=t[s];if(n)var f=a?n(_,E,s,t,e,o):n(E,_,s,e,t,o);if(!(void 0===f?E===_||i(E,_,l,n,o):f)){p=!1;break}m||(m="constructor"==s)}if(p&&!m){var A=e.constructor,g=t.constructor;A==g||!("constructor"in e)||!("constructor"in t)||"function"==typeof A&&A instanceof A&&"function"==typeof g&&g instanceof g||(p=!1)}return o.delete(e),o.delete(t),p}(e,t,l,n,i,o))}(t,l,n,i,e,o))},xo=function(e){return e==e&&!M(e)},Mo=function(e,t){return function(l){return null!=l&&l[e]===t&&(void 0!==t||e in Object(l))}},Fo=function(e,t){return null!=e&&t in Object(e)},ko=function(e){return e},Uo=function(e){return"function"==typeof e?e:null==e?ko:"object"==typeof e?pe(e)?(i=e[1],uo(n=e[0])&&xo(i)?Mo(So(n),i):function(e){var t=yo(e,n);return void 0===t&&t===i?function(e,t){return null!=e&&function(e,t,l){for(var n=-1,i=(t=go(t,e)).length,o=!1;++n<i;){var a=So(t[n]);if(!(o=null!=e&&l(e,a)))break;e=e[a]}return o||++n!=i?o:!!(i=null==e?0:e.length)&&Ae(i)&&fe(a,i)&&(pe(e)||ve(e))}(e,t,Fo)}(e,n):wo(i,t,3)}):1==(l=function(e){for(var t=Oe(e),l=t.length;l--;){var n=t[l],i=e[n];t[l]=[n,i,xo(i)]}return t}(t=e)).length&&l[0][2]?Mo(l[0][0],l[0][1]):function(e){return e===t||function(e,t,l,n){var i=l.length,o=i;if(null==e)return!o;for(e=Object(e);i--;){var a=l[i];if(a[2]?a[1]!==e[a[0]]:!(a[0]in e))return!1}for(;++i<o;){var r=(a=l[i])[0],u=e[r],d=a[1];if(a[2]){if(void 0===u&&!(r in e))return!1}else{var s=new te;if(!wo(d,u,3,void 0,s))return!1}}return!0}(e,0,l)}:function(e){return uo(e)?(t=So(e),function(e){return null==e?void 0:e[t]}):function(e){return function(t){return ho(t,e)}}(e);var t}(e);var t,l,n,i},Ho=function(e,t){if(e!==t){var l=void 0!==e,n=null===e,i=e==e,o=oo(e),a=void 0!==t,r=null===t,u=t==t,d=oo(t);if(!r&&!d&&!o&&e>t||o&&a&&u&&!r&&!d||n&&a&&u||!l&&u||!i)return 1;if(!n&&!o&&!d&&e<t||d&&l&&i&&!n&&!o||r&&l&&i||!a&&i||!u)return-1}return 0};const Wo=e=>{var a,r,u,s,c,v,p,_,f,A,g,S,h,y,D,T,b,C,P,N,I;let{showTermsPopup:L,setShowTermsPopup:B,otpVerifiedTimestamp:O}=e;const{state:R}=i.useLocation(),{t:w}=n.useTranslation(),x=Digit.UserService.getUser(),M=(null==x||null===(a=x.info)||void 0===a?void 0:a.name)||"",F=(null==x||null===(r=x.info)||void 0===r?void 0:r.mobileNumber)||"",[k,U]=Digit.Hooks.useSessionStorage("BUILDING_PERMIT",null!=R&&R.edcrNumber?{data:{scrutinyNumber:{edcrNumber:null==R?void 0:R.edcrNumber}}}:{}),[H,W]=t.useState(!1),[G,j]=t.useState(!1),K=(null==k||null===(u=k.additionalDetails)||void 0===u?void 0:u.architectid)||(null==x||null===(s=x.info)||void 0===s?void 0:s.id)||"",Y=(null==k||null===(c=k.owners)||void 0===c||null===(v=c.owners)||void 0===v||null===(p=v[0])||void 0===p?void 0:p.name)||"",$=(null==k||null===(_=k.owners)||void 0===_||null===(f=_.owners)||void 0===f||null===(A=f[0])||void 0===A?void 0:A.mobileNumber)||"",z=(null==k||null===(g=k.additionalDetails)||void 0===g?void 0:g.typeOfArchitect)||(null==x||null===(S=x.info)||void 0===S||null===(h=S.roles)||void 0===h||null===(y=h.find(e=>"BPA_ARCHITECT"===e.code))||void 0===y?void 0:y.name)||"",V=(null==k||null===(D=k.additionalDetails)||void 0===D?void 0:D.khasraNumber)||"",q=(null==k||null===(T=k.additionalDetails)||void 0===T?void 0:T.UlbName)||"",X=(null==k||null===(b=k.additionalDetails)||void 0===b?void 0:b.wardnumber)||"",J=(null==k||null===(C=k.additionalDetails)||void 0===C?void 0:C.area)||"",Z=(null==k||null===(P=k.additionalDetails)||void 0===P?void 0:P.zonenumber)||"",Q=(null==k||null===(N=k.additionalDetails)||void 0===N?void 0:N.Ulblisttype)||"",ee=O||(null==k||null===(I=k.additionalDetails)||void 0===I?void 0:I.TimeStamp)||"";t.useEffect(()=>{if("function"==typeof U&&null!=k&&k.additionalDetails&&!k.additionalDetails.TimeStamp&&ee)try{U(e=>({...e,additionalDetails:{...e.additionalDetails,TimeStamp:ee}}))}catch(e){console.warn("Failed to set session BUILDING_PERMIT TimeStamp",e)}},[k,U,ee]);const te=`\n To,\n <b>${Q}</b>\n <b>${q}</b>\n \n \n Dear Sir or Madam,\n\n I, under signed Shri/Smt/Kum <b>${M}</b> (<b>${z}</b>) having Registration No. \n <b>${K}</b> is appointed by the <b>${Y}</b> Mobile number <b>${$}</b> for the development on\n land bearing Kh. No <b>${V}</b> Area <b>${J}</b> (Sq.mts).\n \n This site falls in ward number <b>${X}</b> zone number <b>${Z}</b> in the Master plan of \n <b>${q}</b> and the proposed Residential/Commercial/Industrial construction is permi\n -ssible in this area.\n \n I am currently registered as <b>${z}</b> with the Competent Authority and empane\n -lled under Self-Certification Scheme.\n \n I hereby certify that I/we have appointed by the owner to prepare the plans, sections and \n details, structural details as required under the Punjab Municipal Building Byelaws for the \n above mentioned project. \n \n That the drawings prepared and uploaded along with other necessary documents on this \n E-Naksha Platform are as per the provisions of Punjab Municipal Building Byelaws and th\n -is building plan has been applied under Self-Certification Scheme. \n \n I certify that:\n That I am fully conversant with the provisions of the Punjab Municipal Building Byelaws and \n other applicable instructions/ regulations, which are in force and I undertake to fulfill the \n same.\n \n That plans have been prepared within the framework of provisions of the Master Plan and app\n -licable Building Bye Laws / Regulations. \n \n That site does not falls in any prohibited area/ government land/ encroachment or any other \n land restricted for building construction or in any unauthorized colony. \n \n That plan is in conformity to structural safety norms. \n \n That I have seen the originals of all the documents uploaded and Nothing is concealed \n thereof. \n \n That all the requisite documents/NOC required to be uploaded have been uploaded on \n E-Naksha portal along with plan. \n \n That above stated facts are true and all the requisite documents uploaded with this E-Naksha plan.\n \n\n\n This Document is Verified By OTP at <b>${ee}</b>\n\n\n Name of Professional - <b>${M}</b> \n Designation - <b>${z}</b>\n Architect Id - <b>${K}</b> \n Mobile Number - <b>${F}</b>\n \n \n `,le=e=>{const t=e.trim();return[`Name of Professional - <b>${M}</b>`,`Designation - <b>${z}</b>`,`Architect Id - <b>${K}</b>`,`Mobile Number - <b>${F}</b>`].includes(t)},ne=()=>B(!1),ie={overlay:{position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.7)",display:"flex",justifyContent:"center",alignItems:"center",zIndex:1e3},content:{backgroundColor:"#FFFFFF",padding:"2rem",borderRadius:"0.5rem",maxWidth:"800px",margin:"auto",fontFamily:"Roboto, serif",overflowX:"hidden",textAlign:"justify",boxShadow:"0 4px 8px rgba(0, 0, 0, 0.2)",maxHeight:"80vh",overflowY:"auto"},heading:{textAlign:"center",fontWeight:"bold",marginBottom:"10px"},subheading:{textAlign:"center",fontWeight:"bold",marginBottom:"20px"},rightAlignedText:{textAlign:"right",whiteSpace:"pre-wrap",wordWrap:"break-word",fontFamily:"Roboto, serif"}};return l.createElement("div",null,l.createElement(d,{isOpen:L,onRequestClose:ne,contentLabel:"Self-Declaration",style:ie},l.createElement("div",null,l.createElement("h2",{style:ie.heading},"DECLARATION UNDER SELF-CERTIFICATION SCHEME"),l.createElement("h3",{style:ie.subheading},"(For proposed Construction)"),l.createElement("h3",{style:ie.subheading},"(By Architect/ Civil Engineer/ Building Designer and Supervisor)"),l.createElement("div",{style:{whiteSpace:"pre-wrap",wordWrap:"break-word",textAlign:"justify",fontFamily:"Roboto, serif"}},te.split("\n").map((e,t,n)=>{return l.createElement(l.Fragment,{key:t},l.createElement("div",{style:le(e)?ie.rightAlignedText:{},dangerouslySetInnerHTML:{__html:e||" "}}),(o=n[t+1],("That above stated facts are true and all the requisite documents uploaded with this E-Naksha plan."===(null==(i=e)?void 0:i.trim())&&(null==o||""===(null==o?void 0:o.trim()))||(null==i?void 0:i.trim().startsWith("This Document is Verified By OTP at")))&&l.createElement("div",{style:{marginBottom:"2rem"}})));var i,o})),l.createElement("div",{style:{display:"flex",justifyContent:"flex-end",gap:"1rem",marginTop:"1rem"}},l.createElement(o.SubmitBar,{label:w("BPA_CLOSE"),onSubmit:ne}),l.createElement(o.SubmitBar,{label:w("BPA_UPLOAD"),onSubmit:function(){try{const e=E(function(){return m(function(){W(!0);const e={...k,additionalDetails:{...null==k?void 0:k.additionalDetails,TimeStamp:ee}};return Promise.resolve(Digit.PaymentService.generatePdf(Digit.ULBService.getStateId(),{Bpa:[e]},"architectconsent")).then(function(e){var t;null!=e&&null!==(t=e.filestoreIds)&&void 0!==t&&t[0]?(alert("File Uploaded Successfully"),sessionStorage.setItem("ArchitectConsentdocFilestoreid",e.filestoreIds[0]),j(!0)):alert("File Upload Failed")})},function(e){console.error("Error uploading PDF:",e),alert("Error Uploading PDF: "+((null==e?void 0:e.message)||e))})},function(e,t){if(W(!1),e)throw t;return t});return Promise.resolve(e&&e.then?e.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},disabled:H||G})))))};var Go=function(e,t){return function(){for(var l=new Array(arguments.length),n=0;n<l.length;n++)l[n]=arguments[n];return e.apply(t,l)}},jo=Object.prototype.toString;function Ko(e){return"[object Array]"===jo.call(e)}function Yo(e){return void 0===e}function $o(e){return null!==e&&"object"==typeof e}function zo(e){if("[object Object]"!==jo.call(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function Vo(e){return"[object Function]"===jo.call(e)}function qo(e,t){if(null!=e)if("object"!=typeof e&&(e=[e]),Ko(e))for(var l=0,n=e.length;l<n;l++)t.call(null,e[l],l,e);else for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.call(null,e[i],i,e)}var Xo={isArray:Ko,isArrayBuffer:function(e){return"[object ArrayBuffer]"===jo.call(e)},isBuffer:function(e){return null!==e&&!Yo(e)&&null!==e.constructor&&!Yo(e.constructor)&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)},isFormData:function(e){return"undefined"!=typeof FormData&&e instanceof FormData},isArrayBufferView:function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&e.buffer instanceof ArrayBuffer},isString:function(e){return"string"==typeof e},isNumber:function(e){return"number"==typeof e},isObject:$o,isPlainObject:zo,isUndefined:Yo,isDate:function(e){return"[object Date]"===jo.call(e)},isFile:function(e){return"[object File]"===jo.call(e)},isBlob:function(e){return"[object Blob]"===jo.call(e)},isFunction:Vo,isStream:function(e){return $o(e)&&Vo(e.pipe)},isURLSearchParams:function(e){return"undefined"!=typeof URLSearchParams&&e instanceof URLSearchParams},isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&"undefined"!=typeof window&&"undefined"!=typeof document},forEach:qo,merge:function e(){var t={};function l(l,n){t[n]=zo(t[n])&&zo(l)?e(t[n],l):zo(l)?e({},l):Ko(l)?l.slice():l}for(var n=0,i=arguments.length;n<i;n++)qo(arguments[n],l);return t},extend:function(e,t,l){return qo(t,function(t,n){e[n]=l&&"function"==typeof t?Go(t,l):t}),e},trim:function(e){return e.replace(/^\s*/,"").replace(/\s*$/,"")},stripBOM:function(e){return 65279===e.charCodeAt(0)&&(e=e.slice(1)),e}};function Jo(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}var Zo=function(e,t,l){if(!t)return e;var n;if(l)n=l(t);else if(Xo.isURLSearchParams(t))n=t.toString();else{var i=[];Xo.forEach(t,function(e,t){null!=e&&(Xo.isArray(e)?t+="[]":e=[e],Xo.forEach(e,function(e){Xo.isDate(e)?e=e.toISOString():Xo.isObject(e)&&(e=JSON.stringify(e)),i.push(Jo(t)+"="+Jo(e))}))}),n=i.join("&")}if(n){var o=e.indexOf("#");-1!==o&&(e=e.slice(0,o)),e+=(-1===e.indexOf("?")?"?":"&")+n}return e};function Qo(){this.handlers=[]}Qo.prototype.use=function(e,t){return this.handlers.push({fulfilled:e,rejected:t}),this.handlers.length-1},Qo.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},Qo.prototype.forEach=function(e){Xo.forEach(this.handlers,function(t){null!==t&&e(t)})};var ea=Qo,ta=function(e,t,l){return Xo.forEach(l,function(l){e=l(e,t)}),e},la=function(e){return!(!e||!e.__CANCEL__)},na=function(e,t){Xo.forEach(e,function(l,n){n!==t&&n.toUpperCase()===t.toUpperCase()&&(e[t]=l,delete e[n])})},ia=function(e,t,l,n,i){return function(e,t,l,n,i){return e.config=t,l&&(e.code=l),e.request=n,e.response=i,e.isAxiosError=!0,e.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code}},e}(new Error(e),t,l,n,i)},oa=Xo.isStandardBrowserEnv()?{write:function(e,t,l,n,i,o){var a=[];a.push(e+"="+encodeURIComponent(t)),Xo.isNumber(l)&&a.push("expires="+new Date(l).toGMTString()),Xo.isString(n)&&a.push("path="+n),Xo.isString(i)&&a.push("domain="+i),!0===o&&a.push("secure"),document.cookie=a.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}},aa=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"],ra=Xo.isStandardBrowserEnv()?function(){var e,t=/(msie|trident)/i.test(navigator.userAgent),l=document.createElement("a");function n(e){var n=e;return t&&(l.setAttribute("href",n),n=l.href),l.setAttribute("href",n),{href:l.href,protocol:l.protocol?l.protocol.replace(/:$/,""):"",host:l.host,search:l.search?l.search.replace(/^\?/,""):"",hash:l.hash?l.hash.replace(/^#/,""):"",hostname:l.hostname,port:l.port,pathname:"/"===l.pathname.charAt(0)?l.pathname:"/"+l.pathname}}return e=n(window.location.href),function(t){var l=Xo.isString(t)?n(t):t;return l.protocol===e.protocol&&l.host===e.host}}():function(){return!0},ua={"Content-Type":"application/x-www-form-urlencoded"};function da(e,t){!Xo.isUndefined(e)&&Xo.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var sa,ca={adapter:(("undefined"!=typeof XMLHttpRequest||"undefined"!=typeof process&&"[object process]"===Object.prototype.toString.call(process))&&(sa=function(e){return new Promise(function(t,l){var n=e.data,i=e.headers;Xo.isFormData(n)&&delete i["Content-Type"];var o=new XMLHttpRequest;if(e.auth){var a=e.auth.username||"",r=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";i.Authorization="Basic "+btoa(a+":"+r)}var u,d,s=(d=e.url,(u=e.baseURL)&&!/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(d)?function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}(u,d):d);if(o.open(e.method.toUpperCase(),Zo(s,e.params,e.paramsSerializer),!0),o.timeout=e.timeout,o.onreadystatechange=function(){if(o&&4===o.readyState&&(0!==o.status||o.responseURL&&0===o.responseURL.indexOf("file:"))){var n,i,a,r,u,d="getAllResponseHeaders"in o?(n=o.getAllResponseHeaders(),u={},n?(Xo.forEach(n.split("\n"),function(e){if(r=e.indexOf(":"),i=Xo.trim(e.substr(0,r)).toLowerCase(),a=Xo.trim(e.substr(r+1)),i){if(u[i]&&aa.indexOf(i)>=0)return;u[i]="set-cookie"===i?(u[i]?u[i]:[]).concat([a]):u[i]?u[i]+", "+a:a}}),u):u):null;!function(e,t,l){var n=l.config.validateStatus;l.status&&n&&!n(l.status)?t(ia("Request failed with status code "+l.status,l.config,null,l.request,l)):e(l)}(t,l,{data:e.responseType&&"text"!==e.responseType?o.response:o.responseText,status:o.status,statusText:o.statusText,headers:d,config:e,request:o}),o=null}},o.onabort=function(){o&&(l(ia("Request aborted",e,"ECONNABORTED",o)),o=null)},o.onerror=function(){l(ia("Network Error",e,null,o)),o=null},o.ontimeout=function(){var t="timeout of "+e.timeout+"ms exceeded";e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),l(ia(t,e,"ECONNABORTED",o)),o=null},Xo.isStandardBrowserEnv()){var c=(e.withCredentials||ra(s))&&e.xsrfCookieName?oa.read(e.xsrfCookieName):void 0;c&&(i[e.xsrfHeaderName]=c)}if("setRequestHeader"in o&&Xo.forEach(i,function(e,t){void 0===n&&"content-type"===t.toLowerCase()?delete i[t]:o.setRequestHeader(t,e)}),Xo.isUndefined(e.withCredentials)||(o.withCredentials=!!e.withCredentials),e.responseType)try{o.responseType=e.responseType}catch(t){if("json"!==e.responseType)throw t}"function"==typeof e.onDownloadProgress&&o.addEventListener("progress",e.onDownloadProgress),"function"==typeof e.onUploadProgress&&o.upload&&o.upload.addEventListener("progress",e.onUploadProgress),e.cancelToken&&e.cancelToken.promise.then(function(e){o&&(o.abort(),l(e),o=null)}),n||(n=null),o.send(n)})}),sa),transformRequest:[function(e,t){return na(t,"Accept"),na(t,"Content-Type"),Xo.isFormData(e)||Xo.isArrayBuffer(e)||Xo.isBuffer(e)||Xo.isStream(e)||Xo.isFile(e)||Xo.isBlob(e)?e:Xo.isArrayBufferView(e)?e.buffer:Xo.isURLSearchParams(e)?(da(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):Xo.isObject(e)?(da(t,"application/json;charset=utf-8"),JSON.stringify(e)):e}],transformResponse:[function(e){if("string"==typeof e)try{e=JSON.parse(e)}catch(e){}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};Xo.forEach(["delete","get","head"],function(e){ca.headers[e]={}}),Xo.forEach(["post","put","patch"],function(e){ca.headers[e]=Xo.merge(ua)});var va=ca;function pa(e){e.cancelToken&&e.cancelToken.throwIfRequested()}var ma=function(e){return pa(e),e.headers=e.headers||{},e.data=ta(e.data,e.headers,e.transformRequest),e.headers=Xo.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),Xo.forEach(["delete","get","head","post","put","patch","common"],function(t){delete e.headers[t]}),(e.adapter||va.adapter)(e).then(function(t){return pa(e),t.data=ta(t.data,t.headers,e.transformResponse),t},function(t){return la(t)||(pa(e),t&&t.response&&(t.response.data=ta(t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)})},Ea=function(e,t){t=t||{};var l={},n=["url","method","data"],i=["headers","auth","proxy","params"],o=["baseURL","transformRequest","transformResponse","paramsSerializer","timeout","timeoutMessage","withCredentials","adapter","responseType","xsrfCookieName","xsrfHeaderName","onUploadProgress","onDownloadProgress","decompress","maxContentLength","maxBodyLength","maxRedirects","transport","httpAgent","httpsAgent","cancelToken","socketPath","responseEncoding"],a=["validateStatus"];function r(e,t){return Xo.isPlainObject(e)&&Xo.isPlainObject(t)?Xo.merge(e,t):Xo.isPlainObject(t)?Xo.merge({},t):Xo.isArray(t)?t.slice():t}function u(n){Xo.isUndefined(t[n])?Xo.isUndefined(e[n])||(l[n]=r(void 0,e[n])):l[n]=r(e[n],t[n])}Xo.forEach(n,function(e){Xo.isUndefined(t[e])||(l[e]=r(void 0,t[e]))}),Xo.forEach(i,u),Xo.forEach(o,function(n){Xo.isUndefined(t[n])?Xo.isUndefined(e[n])||(l[n]=r(void 0,e[n])):l[n]=r(void 0,t[n])}),Xo.forEach(a,function(n){n in t?l[n]=r(e[n],t[n]):n in e&&(l[n]=r(void 0,e[n]))});var d=n.concat(i).concat(o).concat(a),s=Object.keys(e).concat(Object.keys(t)).filter(function(e){return-1===d.indexOf(e)});return Xo.forEach(s,u),l};function _a(e){this.defaults=e,this.interceptors={request:new ea,response:new ea}}_a.prototype.request=function(e){"string"==typeof e?(e=arguments[1]||{}).url=arguments[0]:e=e||{},(e=Ea(this.defaults,e)).method=e.method?e.method.toLowerCase():this.defaults.method?this.defaults.method.toLowerCase():"get";var t=[ma,void 0],l=Promise.resolve(e);for(this.interceptors.request.forEach(function(e){t.unshift(e.fulfilled,e.rejected)}),this.interceptors.response.forEach(function(e){t.push(e.fulfilled,e.rejected)});t.length;)l=l.then(t.shift(),t.shift());return l},_a.prototype.getUri=function(e){return e=Ea(this.defaults,e),Zo(e.url,e.params,e.paramsSerializer).replace(/^\?/,"")},Xo.forEach(["delete","get","head","options"],function(e){_a.prototype[e]=function(t,l){return this.request(Ea(l||{},{method:e,url:t,data:(l||{}).data}))}}),Xo.forEach(["post","put","patch"],function(e){_a.prototype[e]=function(t,l,n){return this.request(Ea(n||{},{method:e,url:t,data:l}))}});var fa=_a;function Aa(e){this.message=e}Aa.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},Aa.prototype.__CANCEL__=!0;var ga=Aa;function Sa(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise(function(e){t=e});var l=this;e(function(e){l.reason||(l.reason=new ga(e),t(l.reason))})}Sa.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},Sa.source=function(){var e;return{token:new Sa(function(t){e=t}),cancel:e}};var ha=Sa;function ya(e){var t=new fa(e),l=Go(fa.prototype.request,t);return Xo.extend(l,fa.prototype,t),Xo.extend(l,t),l}var Da=ya(va);Da.Axios=fa,Da.create=function(e){return ya(Ea(Da.defaults,e))},Da.Cancel=ga,Da.CancelToken=ha,Da.isCancel=la,Da.all=function(e){return Promise.all(e)},Da.spread=function(e){return function(t){return e.apply(null,t)}},Da.isAxiosError=function(e){return"object"==typeof e&&!0===e.isAxiosError};var Ta=Da;Ta.default=Da;var ba=Ta;ba.interceptors.response.use(e=>e,e=>{var t,l;const n=window.location.pathname.split("/").includes("employee");if(null!=e&&null!==(t=e.response)&&void 0!==t&&null!==(l=t.data)&&void 0!==l&&l.Errors)for(const t of e.response.data.Errors){var i,o,a,r;t.message.includes("InvalidAccessTokenException")?(localStorage.clear(),sessionStorage.clear(),window.location.href=(n?"/digit-ui/employee/user/login":"/digit-ui/citizen/login")+"?from="+encodeURIComponent(window.location.pathname+window.location.search)):null!=t&&null!==(i=t.message)&&void 0!==i&&null!==(o=i.toLowerCase())&&void 0!==o&&o.includes("internal server error")||null!=t&&null!==(a=t.message)&&void 0!==a&&null!==(r=a.toLowerCase())&&void 0!==r&&r.includes("some error occured")?window.location.href=(n?"/digit-ui/employee/user/error":"/digit-ui/citizen/error")+"?type=maintenance&from="+encodeURIComponent(window.location.pathname+window.location.search):t.message.includes("ZuulRuntimeException")&&(window.location.href=(n?"/digit-ui/employee/user/error":"/digit-ui/citizen/error")+"?type=notfound&from="+encodeURIComponent(window.location.pathname+window.location.search))}throw e}),window.Digit=window.Digit||{},window.Digit={...window.Digit,RequestCache:window.Digit.RequestCache||{}};const Ca=function(e){let{method:t="POST",url:l,data:n={},headers:i={},useCache:o=!1,params:a={},auth:r,urlParams:u={},userService:d,locale:s=!0,authHeader:c=!1,setTimeParam:v=!0,userDownload:p=!1,noRequestInfo:m=!1,multipartFormData:E=!1,multipartData:_={},reqTimestamp:f=!1,plainAccessRequest:A=null}=e;try{var g,S;let e=!1;function h(l){var r,u;if(e)return l;const d="citizen"===Digit.SessionStorage.get("userType")?Digit.ULBService.getStateId():Digit.ULBService.getCurrentTenantId()||Digit.ULBService.getStateId();return!a.tenantId&&null!==(r=window)&&void 0!==r&&null!==(u=r.globalConfigs)&&void 0!==u&&u.getConfig("ENABLE_SINGLEINSTANCE")&&(a.tenantId=d),Promise.resolve(ba(p?{method:t,url:N,data:n,params:a,headers:i,responseType:"arraybuffer"}:{method:t,url:N,data:n,params:a,headers:i})).then(function(e){var t;if(p)return e;const l=(null==e?void 0:e.data)||(null==e||null===(t=e.response)||void 0===t?void 0:t.data)||{};return o&&null!=e&&e.data&&0!==Object.keys(l).length&&(window.Digit.RequestCache[P]=l),l})}if("POST"===t.toUpperCase()||"PUT"===t.toUpperCase()){var y;const e=(new Date).getTime();n.RequestInfo={apiId:"Rainmaker"},(r||null!==(y=Digit.UserService.getUser())&&void 0!==y&&y.access_token)&&(n.RequestInfo={...n.RequestInfo,authToken:(null===(b=Digit.UserService.getUser())||void 0===b?void 0:b.access_token)||null}),d&&(n.RequestInfo={...n.RequestInfo,userInfo:null===(T=Digit.UserService.getUser())||void 0===T?void 0:T.info}),s&&(n.RequestInfo={...n.RequestInfo,msgId:`${e}|${Digit.StoreData.getCurrentLanguage()}`}),m&&delete n.RequestInfo,f&&(n.RequestInfo={...n.RequestInfo,ts:Number(e)});const t=Digit.Utils.getPrivacyObject();!t||l.includes("/edcr/rest/dcr/")||m||(n.RequestInfo={...n.RequestInfo,plainAccessRequest:{...t}}),A&&(n.RequestInfo={...n.RequestInfo,plainAccessRequest:A})}const C={"Content-Type":"application/json",Accept:null!==(g=window)&&void 0!==g&&null!==(S=g.globalConfigs)&&void 0!==S&&S.getConfig("ENABLE_SINGLEINSTANCE")?"application/pdf,application/json":"application/pdf"};c&&(i={...i,"auth-token":(null===(D=Digit.UserService.getUser())||void 0===D?void 0:D.access_token)||null}),p&&(i={...i,...C});let P="";if(o){P=`${t.toUpperCase()}.${l}.${btoa(escape(JSON.stringify(a,null,0)))}.${btoa(escape(JSON.stringify(n,null,0)))}`;const e=window.Digit.RequestCache[P];if(e)return Promise.resolve(e)}else v&&(a._=Date.now());let N=l.split("/").map(e=>{var t;let l=null===(t=e.split(":"))||void 0===t?void 0:t[1];return u[l]?u[l]:e}).join("/");const I=function(){var l;if(E)return Promise.resolve(ba({method:t,url:N,data:_.data,params:a,headers:{"Content-Type":"multipart/form-data","auth-token":(null===(l=Digit.UserService.getUser())||void 0===l?void 0:l.access_token)||null}})).then(function(t){return e=!0,t})}();return Promise.resolve(I&&I.then?I.then(h):h(I))}catch(e){return Promise.reject(e)}var D,T,b},Pa=function(e){let{serviceName:t,method:l="POST",url:n,data:i={},headers:o={},useCache:a=!1,params:r={},auth:u,userService:d}=e;try{function s(){return Promise.resolve(Ca({method:l,url:n,data:p,headers:o,useCache:a,params:v,auth:u,userService:d})).then(function(e){let t=!1;const l=function(){if(window[c]&&"function"==typeof window[c])return Promise.resolve(window[c](e)).then(function(e){return t=!0,e})}();return l&&l.then?l.then(function(l){return t?l:e}):t?l:e})}const e=t+"Pre",c=t+"Post";let v=r,p=i;const m=function(){if(window[e]&&"function"==typeof window[e])return Promise.resolve(window[e]({params:r,data:i})).then(function(e){v=e.params,p=e.data})}();return Promise.resolve(m&&m.then?m.then(s):s())}catch(e){return Promise.reject(e)}},Na="/egov-mdms-service/v1/_search",Ia=()=>{try{return"sessionStorage"in window&&null!==window.sessionStorage}catch(e){return!1}},La=e=>"Digit."+e,Ba=(Oa=window.localStorage,{get:e=>{if(Ia()&&e){let t=Oa.getItem(La(e));if(!t||"undefined"===t)return null;const l=JSON.parse(t);return Date.now()>l.expiry?(Oa.removeItem(La(e)),null):l.value}var t,l;return"undefined"!=typeof window?(null===(t=window)||void 0===t||null===(l=t.eGov)||void 0===l?void 0:l.Storage)&&window.eGov.Storage[La(e)].value:null},set:function(e,t,l){void 0===l&&(l=86400);const n={value:t,ttl:l,expiry:Date.now()+1e3*l};Ia()?Oa.setItem(La(e),JSON.stringify(n)):"undefined"!=typeof window&&(window.eGov=window.eGov||{},window.eGov.Storage=window.eGov.Storage||{},window.eGov.Storage[La(e)]=n)},del:e=>{Ia()?Oa.removeItem(La(e)):"undefined"!=typeof window&&(window.eGov=window.eGov||{},window.eGov.Storage=window.eGov.Storage||{},delete window.eGov.Storage[La(e)])}});var Oa;const Ra=[{serviceName:"localization",cacheTimeInSecs:86400},{serviceName:"egov-mdms-service",cacheTimeInSecs:3600,debounceTimeInMS:100,moduleSettings:[{moduleName:"FSM",cacheTimeInSecs:7200}]}],wa=function(e,t,l){if(void 0===e&&(e=""),void 0===t&&(t=""),void 0===l&&(l=""),""==t)return e;for(;e.includes(t);)e=e.replace(t,l);return e},xa=(e,t)=>({MdmsCriteria:{tenantId:e,...t}}),Ma=(e,t,l)=>({details:{moduleDetails:[{moduleName:t,masterDetails:[{name:l}]}]}}),Fa=(e,t,l)=>({type:l,details:{tenantId:e,moduleDetails:[{moduleName:t,masterDetails:[{name:"PetType"}]}]}}),ka=(e,t,l)=>({type:l,details:{tenantId:e,moduleDetails:[{moduleName:t,masterDetails:[{name:"BreedType"}]}]}}),Ua=(e,t,l)=>({type:l,details:{tenantId:e,moduleDetails:[{moduleName:t,masterDetails:[{name:"Districts"}]}]}}),Ha=(e,t,l)=>({type:l,details:{tenantId:e,moduleDetails:[{moduleName:t,masterDetails:[{name:"Ulb"}]}]}}),Wa=(e,t,l)=>({type:l,details:{tenantId:e,moduleDetails:[{moduleName:t,masterDetails:[{name:"UlbType"}]}]}}),Ga=(e,t,l)=>({type:l,details:{tenantId:e,moduleDetails:[{moduleName:t,masterDetails:[{name:"PropertyType",filter:null}]}]}}),ja=(e,t)=>({details:{tenantId:e,moduleDetails:[{moduleName:t,masterDetails:[{name:"Documents"}]}]}}),Ka=(e,t,l)=>({type:l,details:{tenantId:e,moduleDetails:[{moduleName:t,masterDetails:[{name:"GenderType"}]}]}}),Ya=(e,t,l)=>({type:l,details:{tenantId:e,moduleDetails:[{moduleName:t,masterDetails:[{name:"assetClassification"}]}]}}),$a=e=>((e,t)=>((e,t)=>{var l;const n=(()=>{if(Digit.ApiCacheSetting)return Digit.ApiCacheSetting;const e=Ba.get("cachingService")||Ra;return Digit.ApiCacheSetting=e,e})().find(t=>t.serviceName===e),i={cacheTimeInSecs:n.cacheTimeInSecs,debounceTimeInMS:n.debounceTimeInMS||100};if(!t)return i;const o=null==n||null===(l=n.moduleSettings)||void 0===l?void 0:l.find(e=>e.moduleName===t);return o?{cacheTimeInSecs:o.cacheTimeInSecs||i.cacheTimeInSecs,debounceTimeInMS:o.debounceTimeInMS||i.debounceTimeInMS}:i})(Na.split("/")[1],t))(0,e),za={},Va={},qa=function(e,t,l){void 0===t&&(t=[]),t.forEach(t=>{e?t.resolve(l):t.reject(l)})},Xa={init:e=>{return Pa({serviceName:"mdmsInit",url:Na,data:(t=e,{MdmsCriteria:{tenantId:t,moduleDetails:[{moduleName:"common-masters",masterDetails:[{name:"Department"},{name:"Designation"},{name:"StateInfo"},{name:"wfSlaConfig"},{name:"uiHomePage"}]},{moduleName:"tenant",masterDetails:[{name:"tenants"},{name:"citymodule"}]},{moduleName:"DIGIT-UI",masterDetails:[{name:"ApiCachingSettings"}]}]}}),useCache:!0,params:{tenantId:e}});var t},call:(e,t)=>new Promise((l,n)=>((e,t,l)=>{let{serviceName:n,url:i,data:o,useCache:a,params:r}=e;if(!Va[r.tenantId]||0===Va[r.tenantId].length){const e=$a();setTimeout(()=>{let e=JSON.parse(JSON.stringify(za[r.tenantId]));za[r.tenantId]={};let t=[...Va[r.tenantId]];Va[r.tenantId]=[],Pa({serviceName:n,url:i,data:e,useCache:a,params:r}).then(e=>{qa(!0,t,e)}).catch(e=>{qa(!1,t,e)})},e.debounceTimeInMS||500)}((e,t)=>{za[t]&&0!==Object.keys(za[t]).length?e.MdmsCriteria.moduleDetails.forEach(e=>{const l=e.moduleName,n=e.masterDetails;let i=!1;za[t].MdmsCriteria.moduleDetails.forEach(e=>{e.moduleName===l&&(i=!0,e.masterDetails=[...e.masterDetails,...n])}),i||za[t].MdmsCriteria.moduleDetails.push(e)}):za[t]=e})(o,r.tenantId),Va[r.tenantId]||(Va[r.tenantId]=[]),Va[r.tenantId].push({resolve:t,reject:l})})({serviceName:"mdmsCall",url:Na,data:xa(e,t),useCache:!0,params:{tenantId:e}},l,n)),getDataByCriteria:function(e,t,l){try{const n=`MDMS.${e}.${l}.${t.type}.${JSON.stringify(t.details)}`,i=Ba.get(n);return i?Promise.resolve(i):Promise.resolve(Xa.call(e,t.details)).then(function(i){let{MdmsRes:o}=i;const a=((e,t,l,n)=>{switch(e){case"citymodule":return((e,t)=>{const l=(e.tenant.citymodule&&e.tenant.citymodule.find(e=>e.code===t).tenants||[]).map(e=>e.code);return e.tenant.tenants.filter(e=>l.includes(e.code)).map(e=>{let{code:t,name:l,logoId:n,emailId:i,address:o,contactNumber:a}=e;return{code:t,name:l,logoId:n,emailId:i,address:o,contactNumber:a,i18nKey:"TENANT_TENANTS_"+t.replace(".","_").toUpperCase()}}).sort((e,t)=>{return(l=e.name.toLowerCase())<(n=t.name.toLowerCase())?-1:l>n?1:0;var l,n})})(t,l);case"egovLocation":return(e=>e["egov-location"].TenantBoundary[0].boundary.children.map(e=>({name:e.localname,i18nKey:e.localname})))(t);case"serviceDefs":return((e,t)=>e["RAINMAKER-"+t].ServiceDefs.filter(e=>e.active))(t,l);case"swachBharatCategory":return((e,t)=>e.SwachReform.SwachBharatCategory.filter(e=>e.active))(t);case"ApplicationChannel":return(e=>e.FSM.ApplicationChannel.filter(e=>e.active).map(e=>({...e,i18nKey:"ES_APPLICATION_DETAILS_APPLICATION_CHANNEL_"+e.code})))(t);case"SanitationType":return(e=>e.FSM.SanitationType.filter(e=>e.active))(t);case"PropertyType":return(e=>e.FSM.PropertyType.filter(e=>e.active&&!e.propertyType).map(e=>({...e,i18nKey:"PROPERTYTYPE_MASTERS_"+e.code,code:e.code})))(t);case"PropertySubtype":return(e=>e.FSM.PropertyType.filter(e=>e.active&&e.propertyType).map(e=>({...e,i18nKey:"PROPERTYTYPE_MASTERS_"+e.code,code:e.code})))(t);case"PitType":return(e=>e.FSM.PitType.filter(e=>e.active).map(e=>({...e,i18nKey:"PITTYPE_MASTERS_"+e.code})))(t);case"VehicleType":return(e=>e.Vehicle.VehicleMakeModel.filter(e=>e.active).filter(e=>e.make).map(e=>({...e,i18nKey:"COMMON_MASTER_VEHICLE_"+e.code})))(t);case"VehicleMakeModel":return(e=>e.Vehicle.VehicleMakeModel.filter(e=>e.active).map(e=>({...e,i18nKey:"COMMON_MASTER_VEHICLE_"+e.code})))(t);case"Slum":return((e,t)=>e.FSM.Slum.filter(e=>e.active).reduce((e,l)=>e[l.locality]?{...e,[l.locality]:[...e[l.locality],{...l,i18nKey:`${t.toUpperCase().replace(".","_")}_${l.locality}_${l.code}`}]}:{...e,[l.locality]:[{...l,i18nKey:`${t.toUpperCase().replace(".","_")}_${l.locality}_${l.code}`}]},{}))(t,n);case"OwnerShipCategory":return(e=>e.PropertyTax.OwnerShipCategory.filter(e=>e.active).map(e=>({...e,i18nKey:"COMMON_MASTER_OWNER_TYPE_"+e.code})))(t);case"TLOwnerShipCategory":return(e=>e["common-masters"].OwnerShipCategory.filter(e=>e.active).map(e=>({...e,i18nKey:"COMMON_MASTER_OWNER_TYPE_"+e.code})))(t);case"OwnerType":return(e=>e.PropertyTax.OwnerType.filter(e=>e.active).map(e=>({...e,i18nKey:"PROPERTYTAX_OWNERTYPE_"+e.code})))(t);case"SubOwnerShipCategory":return(e=>{e.PropertyTax.SubOwnerShipCategory.filter(e=>e.active).map(e=>({...e,i18nKey:"PROPERTYTAX_BILLING_SLAB_"+e.code})),sessionStorage.setItem("getSubPropertyOwnerShipCategory",JSON.stringify(e))})(t);case"Documents":return(e=>{e.PropertyTax.Documents.filter(e=>e.active).map(e=>({...Documents,i18nKey:""+e.code}))})(t);case"TLDocuments":return(e=>{e.TradeLicense.Documents.filter(e=>e.active).map(e=>({...Documents,i18nKey:""+e.code}))})(t);case"MapConfig":return(e=>{e.PropertyTax.MapConfig.filter(e=>e).map(e=>({...MapConfig,defaultconfig:e.defaultConfig}))})(t);case"UsageCategory":return(e=>e.PropertyTax.UsageCategory.filter(e=>e.active).map(e=>({...e,i18nKey:"PROPERTYTAX_BILLING_SLAB_"+e.code})))(t);case"PTPropertyType":return(e=>e.PropertyTax.UsageCategory.filter(e=>e.active).map(e=>({...UsageCategorylist,i18nKey:"COMMON_PROPTYPE_"+wa(e.code,".","_")})))(t);case"StructureType":return(e=>e["common-masters"].StructureType.filter(e=>e.active).map(e=>({...e,i18nKey:"COMMON_MASTERS_STRUCTURETYPE_"+wa(e.code,".","_")})))(t);case"AccessoryCategory":return(e=>e.TradeLicense.AccessoriesCategory.filter(e=>e.active).map(e=>({...e,i18nKey:"TRADELICENSE_ACCESSORIESCATEGORY_"+wa(e.code,".","_")})))(t);case"FinancialYear":return(e=>e["egf-master"].FinancialYear.filter(e=>e.active&&"TL"===e.module).map(e=>({...e})))(t);case"Floor":return(e=>e.PropertyTax.Floor.filter(e=>e.active).map(e=>({...e,i18nKey:"PROPERTYTAX_FLOOR_"+e.code})))(t);case"Reason":return((e,t,l)=>Object.assign({},...Object.keys(e[l]).map(t=>({[t]:e[l][t].filter(e=>e.active).map(e=>({...e,i18nKey:"ES_ACTION_REASON_"+e.code}))}))))(t,0,l);case"RoleStatusMapping":return(e=>e["DIGIT-UI"].RoleStatusMapping)(t);case"CommonFieldsConfig":return((e,t)=>"PROPERTYTAX"===t.toUpperCase()?e.PropertyTax.CommonFieldsConfig:e.FSM.CommonFieldsConfig)(t,l);case"PreFieldsConfig":return(e=>e.FSM.PreFieldsConfig)(t);case"PostFieldsConfig":return(e=>e.FSM.PostFieldsConfig)(t);case"RentalDeatils":return(e=>{e.PropertyTax.RentalDetails.filter(e=>e.active).map(e=>({...e,i18nKey:"PROPERTYTAX_BILLING_SLAB_"+e.code}))})(t);case"ChargeSlabs":return(e=>{e.PropertyTax.ChargeSlabs.filter(e=>e.active).map(e=>({...e}))})(t);case"DssDashboard":return(e=>e["dss-dashboard"]["dashboard-config"])(t);case"BusinessService":return(e=>e.BillingService.BusinessService.map(e=>({...e,i18nKey:"BILLINGSERVICE_BUSINESSSERVICE_"+e.code})))(t);case"applcatonStatus":return(e=>e.mCollect.applcationStatus.map(e=>({...e,i18nKey:"BILLINGSERVICE_BUSINESSSERVICE_"+e.code})))(t);case"FSTPPlantInfo":return(e=>e.FSM.FSTPPlantInfo)(t);case"GenderType":return(e=>e["common-masters"].GenderType.filter(e=>e.active).map(e=>({...e,i18nKey:"PT_COMMON_GENDER_"+e.code})))(t);case"TLGendertype":return(e=>{e["common-masters"].GenderType.filter(e=>e.active).map(e=>({...e,i18nKey:"TL_GENDER_"+e.code}))})(t);case"PTGenderType":return(e=>{e["common-masters"].GenderType.filter(e=>e.active).map(e=>({...e,i18nKey:"PT_FORM3_"+e.code}))})(t);case"HRGenderType":return(e=>{e["common-masters"].GenderType.filter(e=>e.active).map(e=>({...e,i18nKey:"COMMON_GENDER_"+e.code}))})(t);case"DocumentTypes":return(e=>e.BPA.DocTypeMapping)(t);case"CheckList":return(e=>e.BPA.CheckList)(t);case"FSMGenderType":return(e=>e["common-masters"].GenderType.map(e=>({...e,i18nKey:"COMMON_GENDER_"+e.code})))(t);case"FSTPORejectionReason":return(e=>e.Vehicle.FSTPORejectionReason.filter(e=>e.active).map(e=>({...e,i18nKey:"ES_ACTION_REASON_"+e.code})))(t);case"PaymentType":return(e=>e.FSM.PaymentType.filter(e=>e.active).map(e=>({...e,i18nKey:"ES_ACTION_"+e.code})))(t);case"TripNumber":return(e=>e.FSM.TripNumber.filter(e=>e.active).map(e=>({...e,i18nKey:"ES_ACTION_TRIP_"+e.code})))(t);case"ReceivedPaymentType":return(e=>e.FSM.ReceivedPaymentType.filter(e=>e.active).map(e=>({...e,i18nKey:"ES_ACTION_"+e.code})))(t);case"Documents":return(e=>{e.PetService.Documents.filter(e=>e.active).map(e=>({...Documents,i18nKey:""+e.code}))})(t);case"PetType":return(e=>e.PetService.PetType.filter(e=>e.active).map(e=>({...e,i18nKey:"PTR_PET_TYPE_"+e.code})))(t);case"BreedType":return(e=>e.PetService.BreedType.filter(e=>e.active).map(e=>({...e,i18nKey:"PTR_BREED_TYPE_"+e.code})))(t);case"PTRGendertype":return(e=>{e["common-masters"].GenderType.filter(e=>e.active).map(e=>({...e,i18nKey:"PTR_GENDER_"+e.code}))})(t);case"Documents":return(e=>{e.StreetVending.Documents.filter(e=>e.active).map(e=>({...Documents,i18nKey:""+e.code}))})(t);case"Documents":return(e=>{e.Advertisement.Documents.filter(e=>e.active).map(e=>({...Documents,i18nKey:""+e.code}))})(t);case"PTRPetType":return(e=>{e.PetService.PetType.filter(e=>e.active).map(e=>({...e,i18nKey:"PTR_PET_"+e.code}))})(t);case"PTRBreedType":return(e=>{e.PetService.BreedType.filter(e=>e.active).map(e=>({...e,i18nKey:"PTR_PET_TYPE_"+e.code}))})(t);case"Districts":return(e=>e.BPA.Districts.filter(e=>e.active).map(e=>({...e,i18nKey:"BPA_DISTRICT_"+e.code})))(t);case"Ulb":return(e=>e.BPA.Ulb.filter(e=>e.active).map(e=>({...e,i18nKey:"BPA_DISTRICT_"+e.code})))(t);case"UlbType":return(e=>e.BPA.UlbType.filter(e=>e.active).map(e=>({...e,i18nKey:"BPA_ULB_LIST_"+e.code})))(t);case"BPADistrict":return(e=>{e.BPA.Districts.filter(e=>e.active).map(e=>({...e,i18nKey:"BPA_DISTRICTS_"+e.code}))})(t);case"BPAUlb":return(e=>{e.BPA.Ulb.filter(e=>e.active).map(e=>({...e,i18nKey:"BPA_ULB_"+e.code}))})(t);case"BPAUlbType":return(e=>{e.BPA.UlbType.filter(e=>e.active).map(e=>({...e,i18nKey:"BPA_ULB_"+e.code}))})(t);case"Documents":return(e=>{e.ASSET.Documents.filter(e=>e.active).map(e=>({...Documents,i18nKey:""+e.code}))})(t);case"assetCategory":return(e=>e.ASSET.assetCategory.filter(e=>e.active).map(e=>({...e,i18nKey:"ASSET_SUB_CLASSIFIED_"+e.code})))(t);case"assetClassification":return(e=>e.ASSET.assetClassification.filter(e=>e.active).map(e=>({...e,i18nKey:"ASSET_CLASSIFIED_"+e.code})))(t);case"Asset_Classification":return(e=>{e.ASSET.assetClassification.filter(e=>e.active).map(e=>({...e,i18nKey:"ASSET_CLASS_"+e.code}))})(t);case"Assetcommondetail":return(e=>{e.ASSET.AssetCommonDetail.filter(e=>e.active).map(e=>({...e,i18nKey:"ASSET_SUB_PARENT_CATEGORY_"+e.code}))})(t);case"AssetSubTypeParent":return(e=>{e.ASSET.assetCategory.filter(e=>e.active).map(e=>({...e,i18nKey:"ASSET_SUB_PARENT_CATEGORY_"+e.code}))})(t);default:return t}})(t.type,o,l.toUpperCase(),e),r=$a(t.details.moduleDetails[0].moduleName);return Ba.set(n,a,r.cacheTimeInSecs),a})}catch(e){return Promise.reject(e)}},getServiceDefs:(e,t)=>Xa.getDataByCriteria(e,((e,t)=>({type:"serviceDefs",details:{tenantId:e,moduleDetails:[{moduleName:"RAINMAKER-"+t,masterDetails:[{name:"ServiceDefs"}]}]}}))(e,t),t),getSwachBharatCategory:(e,t)=>Xa.getDataByCriteria(e,((e,t)=>({type:"swachBharatCategory",details:{tenantId:e,moduleDetails:[{moduleName:"SwachReform",masterDetails:[{name:"SwachBharatCategory"}]}]}}))(e),t),getSanitationType:(e,t)=>Xa.getDataByCriteria(e,((e,t)=>({type:"SanitationType",details:{tenantId:e,moduleDetails:[{moduleName:t,masterDetails:[{name:"SanitationType",filter:null}]}]}}))(e,t),t),getApplicationChannel:(e,t)=>Xa.getDataByCriteria(e,((e,t)=>({type:"ApplicationChannel",details:{tenantId:e,moduleDetails:[{moduleName:t,masterDetails:[{name:"ApplicationChannel",filter:null}]}]}}))(e,t),t),getPropertyType:(e,t,l)=>Xa.getDataByCriteria(e,Ga(e,t,l),t),getPropertyUsage:(e,t,l)=>Xa.getDataByCriteria(e,((e,t,l)=>({type:l,details:{tenantId:e,moduleDetails:[{moduleName:t,masterDetails:[{name:"PropertyType",filter:null}]}]}}))(e,t,l),t),getPropertySubtype:(e,t,l)=>Xa.getDataByCriteria(e,Ga(e,t,l),t),getPitType:(e,t)=>Xa.getDataByCriteria(e,((e,t)=>({type:"PitType",details:{tenantId:e,moduleDetails:[{moduleName:t,masterDetails:[{name:"PitType",filter:null}]}]}}))(e,t),t),getVehicleType:(e,t,l)=>Xa.getDataByCriteria(e,((e,t,l)=>({type:l,details:{tenantId:e,moduleDetails:[{moduleName:t,masterDetails:[{name:"VehicleMakeModel",filter:null}]}]}}))(e,t,l),t),getChecklist:(e,t)=>Xa.getDataByCriteria(e,((e,t)=>({details:{tenantId:e,moduleDetails:[{moduleName:t,masterDetails:[{name:"CheckList",filter:null}]}]}}))(e,t),t),getPaymentRules:(e,t)=>Xa.call(e,(e=>({moduleDetails:[{moduleName:"BillingService",masterDetails:[{name:"BusinessService",filter:e},{name:"TaxHeadMaster"},{name:"TaxPeriod"}]}]}))(t)),getPetDocumentsRequiredScreen:(e,t)=>Xa.getDataByCriteria(e,((e,t)=>({details:{tenantId:e,moduleDetails:[{moduleName:t,masterDetails:[{name:"Documents"}]}]}}))(e,t),t),getSVDocuments:(e,t)=>Xa.getDataByCriteria(e,((e,t)=>({details:{tenantId:e,moduleDetails:[{moduleName:t,masterDetails:[{name:"Documents"}]}]}}))(e,t),t),getADSDocuments:(e,t)=>Xa.getDataByCriteria(e,((e,t)=>({details:{tenantId:e,moduleDetails:[{moduleName:t,masterDetails:[{name:"Documents"}]}]}}))(e,t),t),getdistrict:(e,t,l)=>Xa.getDataByCriteria(e,Ua(e,t,l),t),getulb:(e,t,l)=>Xa.getDataByCriteria(e,Ha(e,t,l),t),getulbls:(e,t,l)=>Xa.getDataByCriteria(e,Wa(e,t,l),t),getPetType:(e,t,l)=>Xa.getDataByCriteria(e,Fa(e,t,l),t),getBreedType:(e,t,l)=>Xa.getDataByCriteria(e,ka(e,t,l),t),BPADistrict:(e,t,l)=>Xa.getDataByCriteria(e,Ua(e,t,l),t),BPAUlb:(e,t,l)=>Xa.getDataByCriteria(e,Ha(e,t,l),t),BPAUlbType:(e,t,l)=>Xa.getDataByCriteria(e,Wa(e,t,l),t),PTRGenderType:(e,t,l)=>Xa.getDataByCriteria(e,Ka(e,t,l),t),PTRPetType:(e,t,l)=>Xa.getDataByCriteria(e,Fa(e,t,l),t),PTRBreedType:(e,t,l)=>Xa.getDataByCriteria(e,ka(e,t,l),t),getCustomizationConfig:(e,t)=>Xa.getDataByCriteria(e,((e,t)=>({type:"Config",details:{tenantId:e,moduleDetails:[{moduleName:t,masterDetails:[{name:"Config"}]}]}}))(e,t),t),getSlumLocalityMapping:(e,t,l)=>Xa.getDataByCriteria(e,((e,t,l)=>({type:l,details:{tenantId:e,moduleDetails:[{moduleName:t,masterDetails:[{name:"Slum"}]}]}}))(e,t,l),t),getReason:(e,t,l,n)=>Xa.getDataByCriteria(e,((e,t,l,n)=>({type:l,details:{tenantId:e,moduleDetails:[{moduleName:t,masterDetails:n.map(e=>({name:e}))}]}}))(e,t,l,n),t),getRoleStatus:(e,t,l)=>Xa.getDataByCriteria(e,((e,t,l)=>({type:l,details:{tenantId:e,moduleDetails:[{moduleName:t,masterDetails:[{name:"RoleStatusMapping",filter:null}]}]}}))(e,t,l),t),getCommonFieldsConfig:(e,t,l,n)=>Xa.getDataByCriteria(e,((e,t,l)=>({type:l,details:{tenantId:e,moduleDetails:[{moduleName:t,masterDetails:[{name:"CommonFieldsConfig",filter:null}]}]}}))(e,t,l),t),getPreFieldsConfig:(e,t,l,n)=>Xa.getDataByCriteria(e,((e,t,l)=>({type:l,details:{tenantId:e,moduleDetails:[{moduleName:t,masterDetails:[{name:"PreFieldsConfig",filter:null}]}]}}))(e,t,l),t),getPostFieldsConfig:(e,t,l,n)=>Xa.getDataByCriteria(e,((e,t,l)=>({type:l,details:{tenantId:e,moduleDetails:[{moduleName:t,masterDetails:[{name:"PostFieldsConfig",filter:null}]}]}}))(e,t,l),t),getPropertyOwnerShipCategory:(e,t,l)=>Xa.getDataByCriteria(e,((e,t,l)=>({type:l,details:{tenantId:e,moduleDetails:[{moduleName:t,masterDetails:[{name:"OwnerShipCategory"}]}]}}))(e,t,l),t),GetTradeOwnerShipCategory:(e,t,l)=>Xa.getDataByCriteria(e,((e,t,l)=>({type:l,details:{tenantId:e,moduleDetails:[{moduleName:t,masterDetails:[{name:"OwnerShipCategory"}]}]}}))(e,t,l),t),getPropertyOwnerType:(e,t,l)=>Xa.getDataByCriteria(e,((e,t,l)=>({type:l,details:{tenantId:e,moduleDetails:[{moduleName:t,masterDetails:[{name:"OwnerType"}]}]}}))(e,t,l),t),getPropertySubOwnerShipCategory:(e,t,l)=>Xa.getDataByCriteria(e,((e,t,l)=>({type:l,details:{tenantId:e,moduleDetails:[{moduleName:t,masterDetails:[{name:"SubOwnerShipCategory"}]}]}}))(e,t,l),t),getDocumentRequiredScreen:(e,t)=>Xa.getDataByCriteria(e,ja(e,t),t),getTLDocumentRequiredScreen:(e,t)=>Xa.getDataByCriteria(e,ja(e,t),t),getTradeUnitsData:(e,t,l,n)=>Xa.getDataByCriteria(e,((e,t,l,n)=>({type:l,details:{tenantId:e,moduleDetails:[{moduleName:t,masterDetails:[{name:"TradeType",filter:n}]}]}}))(e,t,l,n),t),getMapConfig:(e,t)=>Xa.getDataByCriteria(e,((e,t)=>({details:{tenantId:e,moduleDetails:[{moduleName:t,masterDetails:[{name:"MapConfig"}]}]}}))(e,t),t),getUsageCategory:(e,t,l)=>Xa.getDataByCriteria(e,((e,t,l)=>({type:void 0,details:{tenantId:e,moduleDetails:[{moduleName:t,masterDetails:[{name:"UsageCategory"}]}]}}))(e,t),t),getPTPropertyType:(e,t,l)=>Xa.getDataByCriteria(e,((e,t,l)=>({type:void 0,details:{tenantId:e,moduleDetails:[{moduleName:t,masterDetails:[{name:"PropertyType"}]}]}}))(e,t),t),getTLStructureType:(e,t,l)=>Xa.getDataByCriteria(e,((e,t,l)=>({type:void 0,details:{tenantId:e,moduleDetails:[{moduleName:t,masterDetails:[{name:"StructureType"}]}]}}))(e,t),t),getTLAccessoriesType:(e,t,l)=>Xa.getDataByCriteria(e,((e,t,l)=>({type:void 0,details:{tenantId:e,moduleDetails:[{moduleName:t,masterDetails:[{name:"AccessoriesCategory"}]}]}}))(e,t),t),getTLFinancialYear:(e,t,l)=>Xa.getDataByCriteria(e,((e,t,l)=>({type:void 0,details:{tenantId:e,moduleDetails:[{moduleName:t,masterDetails:[{name:"FinancialYear",filter:'[?(@.module == "TL")]'}]}]}}))(e,t),t),getFloorList:(e,t,l)=>Xa.getDataByCriteria(e,((e,t,l)=>({type:l,details:{tenantId:e,moduleDetails:[{moduleName:t,masterDetails:[{name:"Floor"}]}]}}))(e,t,l),t),getRentalDetails:(e,t)=>Xa.getDataByCriteria(e,((e,t)=>({details:{tenantId:e,moduleDetails:[{moduleName:t,masterDetails:[{name:"RentalDetails"}]}]}}))(e,t),t),getChargeSlabs:(e,t)=>Xa.getDataByCriteria(e,((e,t)=>({details:{tenantId:e,moduleDetails:[{moduleName:t,masterDetails:[{name:"ChargeSlabs"}]}]}}))(e,t),t),getDssDashboard:(e,t)=>Xa.getDataByCriteria(e,((e,t)=>({details:{tenantId:e,moduleDetails:[{moduleName:t,masterDetails:[{name:"dashboard-config"}]}]}}))(e,t),t),getPaymentGateway:(e,t,l)=>Xa.getDataByCriteria(e,Ma(0,t,l),t),getReceiptKey:(e,t)=>Xa.getDataByCriteria(e,((e,t)=>({details:{tenantId:e,moduleDetails:[{moduleName:t,masterDetails:[{name:"uiCommonPay"}]}]}}))(e,t),t),getHelpText:(e,t,l)=>Xa.getDataByCriteria(e,Ma(0,t,l),t),getMCollectBillingService:(e,t,l,n)=>Xa.getDataByCriteria(e,((e,t,l,n)=>({type:l,details:{tenantId:e,moduleDetails:[{moduleName:t,masterDetails:[{name:"BusinessService",filter:n}]}]}}))(e,t,l,n),t),getMCollectApplcationStatus:(e,t,l,n)=>Xa.getDataByCriteria(e,((e,t,l)=>({type:l,details:{tenantId:e,moduleDetails:[{moduleName:t,masterDetails:[{name:"applicationStatus"}]}]}}))(e,t,l),t),getChallanGenerationBillingService:(e,t,l,n)=>Xa.getDataByCriteria(e,((e,t,l,n)=>({type:l,details:{tenantId:e,moduleDetails:[{moduleName:t,masterDetails:[{name:"BusinessService",filter:n}]}]}}))(e,t,l,n),t),getChallanGenerationApplcationStatus:(e,t,l,n)=>Xa.getDataByCriteria(e,((e,t,l)=>({type:l,details:{tenantId:e,moduleDetails:[{moduleName:t,masterDetails:[{name:"applicationStatus"}]}]}}))(e,t,l),t),getRentAndLeaseBillingService:(e,t,l,n)=>Xa.getDataByCriteria(e,((e,t,l,n)=>({type:l,details:{tenantId:e,moduleDetails:[{moduleName:t,masterDetails:[{name:"BusinessService",filter:n}]}]}}))(e,t,l,n),t),getRentAndLeaseApplcationStatus:(e,t,l,n)=>Xa.getDataByCriteria(e,((e,t,l)=>({type:l,details:{tenantId:e,moduleDetails:[{moduleName:t,masterDetails:[{name:"applicationStatus"}]}]}}))(e,t,l),t),getHrmsEmployeeRolesandDesignation:e=>Xa.call(e,{moduleDetails:[{moduleName:"common-masters",masterDetails:[{name:"Department",filter:"[?(@.active == true)]"},{name:"Designation",filter:"[?(@.active == true)]"}]},{moduleName:"tenant",masterDetails:[{name:"tenants"}]},{moduleName:"ACCESSCONTROL-ROLES",masterDetails:[{name:"roles",filter:"$.[?(@.code!='CITIZEN')]"}]},{moduleName:"egov-location",masterDetails:[{name:"TenantBoundary"}]}]}),getHrmsEmployeeTypes:(e,t,l,n)=>Xa.getDataByCriteria(e,Ma(0,t,l),t),getSurveyAnswerTypes:(e,t,l,n)=>Xa.getDataByCriteria(e,Ma(0,t,l),t),getHrmsEmployeeReason:(e,t,l)=>Xa.getDataByCriteria(e,Ma(0,t,l),t),getMultipleTypes:(e,t,l)=>Xa.getDataByCriteria(e,((e,t,l)=>({details:{moduleDetails:[{moduleName:t,masterDetails:l.map(e=>({name:e}))}]}}))(0,t,l),t),getMultipleTypesWithFilter:(e,t,l)=>Xa.getDataByCriteria(e,((e,t)=>({details:{moduleDetails:[{moduleName:e,masterDetails:t}]}}))(t,l),t),getFSTPPlantInfo:(e,t,l)=>Xa.getDataByCriteria(e,((e,t,l)=>({type:l,details:{tenantId:e,moduleDetails:[{moduleName:t,masterDetails:[{name:"FSTPPlantInfo"}]}]}}))(e,t,l),t),getCancelReceiptReason:(e,t)=>Xa.getDataByCriteria(e,((e,t,l)=>({type:void 0,details:{tenantId:e,moduleDetails:[{moduleName:t,masterDetails:[{name:"CancelReceiptReason"}]}]}}))(e,t),t),getReceiptStatus:(e,t)=>Xa.getDataByCriteria(e,((e,t,l)=>({type:void 0,details:{tenantId:e,moduleDetails:[{moduleName:t,masterDetails:[{name:"ReceiptStatus"}]}]}}))(e,t),t),getCancelReceiptReasonAndStatus:(e,t)=>Xa.getDataByCriteria(e,((e,t,l)=>({type:void 0,details:{tenantId:e,moduleDetails:[{moduleName:t,masterDetails:[{name:"ReceiptStatus"},{name:"uiCommonPay"}]}]}}))(e,t),t),getGenderType:(e,t,l)=>Xa.getDataByCriteria(e,Ka(e,t,l),t),TLGenderType:(e,t,l)=>Xa.getDataByCriteria(e,Ka(e,t,l),t),PTGenderType:(e,t,l)=>Xa.getDataByCriteria(e,Ka(e,t,l),t),HRGenderType:(e,t,l)=>Xa.getDataByCriteria(e,Ka(e,t,l),t),getDocumentTypes:(e,t,l)=>Xa.getDataByCriteria(e,((e,t,l)=>({type:l,details:{tenantId:e,moduleDetails:[{moduleName:t,masterDetails:[{name:"DocTypeMapping"}]}]}}))(e,t,l),t),getTradeTypeRoleTypes:(e,t,l)=>Xa.getDataByCriteria(e,((e,t,l)=>({type:l,details:{tenantId:e,moduleDetails:[{moduleName:t,masterDetails:[{name:"TradeTypetoRoleMapping"}]}]}}))(e,t,l),t),getFSMGenderType:(e,t,l)=>Xa.getDataByCriteria(e,Ka(e,t,l),t),getFSTPORejectionReason:(e,t,l)=>Xa.getDataByCriteria(e,((e,t,l)=>({type:l,details:{tenantId:e,moduleDetails:[{moduleName:t,masterDetails:[{name:"FSTPORejectionReason",filter:null}]}]}}))(e,t,l),t),getFSMPaymentType:(e,t,l)=>Xa.getDataByCriteria(e,((e,t,l)=>({type:l,details:{tenantId:e,moduleDetails:[{moduleName:t,masterDetails:[{name:"PaymentType",filter:null}]}]}}))(e,t,l),t),getBillsGenieKey:(e,t)=>Xa.getDataByCriteria(e,((e,t)=>({details:{tenantId:e,moduleDetails:[{moduleName:t,masterDetails:[{name:"BusinessService"}]},{moduleName:"tenant",masterDetails:[{name:"tenants"},{name:"citymodule"}]},{moduleName:"common-masters",masterDetails:[{name:"uiCommonPay"}]}]}}))(e,t),t),getFSMTripNumber:(e,t,l)=>Xa.getDataByCriteria(e,((e,t,l)=>({type:l,details:{tenantId:e,moduleDetails:[{moduleName:t,masterDetails:[{name:"TripNumber",filter:null}]}]}}))(e,t,l),t),getFSMReceivedPaymentType:(e,t,l)=>Xa.getDataByCriteria(e,((e,t,l)=>({type:l,details:{tenantId:e,moduleDetails:[{moduleName:t,masterDetails:[{name:"ReceivedPaymentType",filter:null}]}]}}))(e,t,l),t),getWSTaxHeadMaster:(e,t,l)=>Xa.getDataByCriteria(e,((e,t,l)=>({type:l,details:{tenantId:e,moduleDetails:[{moduleName:"BillingService",masterDetails:[{name:"TaxHeadMaster",filter:null}]}]}}))(e,0,l),t),getMeterStatusType:e=>Xa.call(e,{moduleDetails:[{moduleName:"ws-services-calculation",masterDetails:[{name:"MeterStatus",filter:"$.*.name"}]}]}),getBillingPeriod:e=>Xa.call(e,{moduleDetails:[{moduleName:"ws-services-masters",masterDetails:[{name:"billingPeriod",filter:"*"}]}]}),getHowItWorksJSONData:e=>Xa.call(e,{moduleDetails:[{moduleName:"common-masters",masterDetails:[{name:"howItWorks"}]}]}),getFAQsJSONData:e=>Xa.call(e,{moduleDetails:[{moduleName:"common-masters",masterDetails:[{name:"faqs"}]}]}),getDSSFAQsJSONData:e=>Xa.call(e,{moduleDetails:[{moduleName:"dss-dashboard",masterDetails:[{name:"FAQs"}]}]}),getDSSAboutJSONData:e=>Xa.call(e,{moduleDetails:[{moduleName:"dss-dashboard",masterDetails:[{name:"About"}]}]}),getStaticDataJSON:e=>Xa.call(e,{moduleDetails:[{moduleName:"common-masters",masterDetails:[{name:"StaticData"}]}]}),getAssetDocuments:(e,t)=>Xa.getDataByCriteria(e,((e,t)=>({details:{tenantId:e,moduleDetails:[{moduleName:t,masterDetails:[{name:"Documents"}]}]}}))(e,t),t),AssetSubTypeParent:(e,t,l)=>Xa.getDataByCriteria(e,((e,t,l)=>({type:l,details:{tenantId:e,moduleDetails:[{moduleName:t,masterDetails:[{name:"assetCategory"}]}]}}))(e,t,l),t),getAssetClassification:(e,t,l)=>Xa.getDataByCriteria(e,Ya(e,t,l),t),Asset_Classification:(e,t,l)=>Xa.getDataByCriteria(e,Ya(e,t,l),t),Assetcommondetail:(e,t,l)=>Xa.getDataByCriteria(e,((e,t,l)=>({type:l,details:{tenantId:e,moduleDetails:[{moduleName:t,masterDetails:[{name:"AssetCommonDetail"}]}]}}))(e,t,l),t)},Ja=function(e,t){try{var l,n,i={method:"get",url:"/filestore/v1/files/url"+(null!==(l=window)&&void 0!==l&&null!==(n=l.globalConfigs)&&void 0!==n&&n.getConfig("ENABLE_SINGLEINSTANCE")?"?tenantId="+t:""),params:{tenantId:t,fileStoreIds:null==e?void 0:e.join(",")}};return Promise.resolve(ba(i))}catch(e){return Promise.reject(e)}},Za={scrutinyDetails:(e,t)=>Ca({url:"/edcr/rest/dcr/scrutinydetails",params:{tenantId:e,...t},auth:!0,userService:!0,method:"POST"}),comparisionReport:(e,t)=>Ca({url:"/edcr/rest/dcr/occomparison",params:{tenantId:e,...t},auth:!0,userService:!0,method:"POST"}),create:(e,t)=>Ca({url:"/bpa-services/v1/bpa/_create",data:e,useCache:!1,setTimeParam:!1,userService:!0,method:"POST",params:{},auth:!0}),NOCSearch:(e,t)=>Ca({url:"/noc-services/v1/noc/_search",params:{tenantId:e,...t},auth:!0,userService:!0,method:"POST"}),update:(e,t)=>Ca({url:"/bpa-services/v1/bpa/_update",data:e,useCache:!1,setTimeParam:!1,userService:!0,method:"POST",params:{},auth:!0}),updateNOC:(e,t)=>Ca({url:"/noc-services/v1/noc/_update",data:e,useCache:!1,setTimeParam:!1,userService:!0,method:"POST",params:{},auth:!0}),BPASearch:(e,t)=>Ca({url:"/bpa-services/v1/bpa/_search",params:{tenantId:e,...t},auth:!0,userService:!0,method:"POST"}),BPAREGSearch:(e,t,l)=>Ca({url:"/tl-services/v1/BPAREG/_search",params:{tenantId:e,...l},auth:!0,userService:!0,method:"POST",data:t}),BPAREGCreate:(e,t)=>Ca({url:"/tl-services/v1/BPAREG/_create",data:e,useCache:!1,setTimeParam:!1,userService:!window.location.href.includes("openlink"),method:"POST",params:{},auth:!window.location.href.includes("openlink")}),BPAREGGetBill:function(e,t){return void 0===t&&(t={}),Ca({url:"/tl-calculator/v1/BPAREG/_getbill",useCache:!1,method:"POST",auth:!1,userService:!1,params:{tenantId:e,...t}}).then(e=>e).catch(e=>{var t,l,n,i;if("EG_BS_BILL_NO_DEMANDS_FOUND"===(null==e||null===(t=e.response)||void 0===t||null===(l=t.data)||void 0===l||null===(n=l.Errors)||void 0===n||null===(i=n[0])||void 0===i?void 0:i.code))return{Bill:[]};throw e})},BPAREGupdate:(e,t)=>Ca({url:"/tl-services/v1/BPAREG/_update",data:e,useCache:!1,setTimeParam:!1,userService:!window.location.href.includes("openlink"),method:"POST",params:{},auth:!window.location.href.includes("openlink")}),receipt_download:function(e,t,l,n){return void 0===n&&(n={}),Ca({url:"/egov-pdf/download/PAYMENT/consolidatedreceipt",data:{},useCache:!0,method:"POST",params:{bussinessService:e,consumerCode:t,tenantId:l,...n},auth:!0,locale:!0,userService:!0,userDownload:!0})},edcr_report_download:(e,t)=>Ca({url:"/bpa-services/v1/bpa/_permitorderedcr",data:e,useCache:!0,method:"POST",auth:!0,locale:!0,userService:!1,userDownload:!0}),BPAOpensearch:e=>Ca({url:"/inbox/v1/dss/_search",useCache:!1,method:"POST",auth:!1,noRequestInfo:!0,userService:!1,data:e}),LicenseDetails:function(e,t){try{return Promise.resolve(Za.BPAREGSearch(e,{},t)).then(function(e){var t;if(null==e||null===(t=e.Licenses)||void 0===t||!t.length)return;const[n]=null==e?void 0:e.Licenses;return Promise.resolve(Digit.PaymentService.recieptSearch(null==n?void 0:n.tenantId,"BPAREG",{consumerCodes:null==n?void 0:n.applicationNumber,isEmployee:!0})).then(function(e){return Promise.resolve(Xa.getMultipleTypes(null==n?void 0:n.tenantId,"StakeholderRegistraition",["TradeTypetoRoleMapping"])).then(function(t){var i,o,a,r,u,d,s,c;function v(){var t,i,o,a,r,u,d,s,c,v,p,E,_,f,A,g,S,h,y,D,T,b,C,P,N,I,L,B,O,R,w,x,M,F,k,U,H,W,G,j,K;const Y=[{title:" ",values:[{title:"BPA_APPLICATION_NUMBER_LABEL",value:(null==n?void 0:n.applicationNumber)||"NA"}]},null!=n&&null!==(t=n.tradeLicenseDetail)&&void 0!==t&&null!==(i=t.tradeUnits)&&void 0!==i&&null!==(o=i[0])&&void 0!==o&&o.tradeType.includes("ARCHITECT")?{title:"BPA_LICENSE_DETAILS_LABEL",asSectionHeader:!0,values:[{title:"BPA_LICENSE_TYPE",value:"TRADELICENSE_TRADETYPE_"+(null==n||null===(a=n.tradeLicenseDetail)||void 0===a||null===(r=a.tradeUnits)||void 0===r||null===(u=r[0])||void 0===u||null===(d=u.tradeType)||void 0===d?void 0:d.split(".")[0])||"NA"},{title:"BPA_COUNCIL_OF_ARCH_NO_LABEL",value:(null==n||null===(s=n.tradeLicenseDetail)||void 0===s||null===(c=s.additionalDetail)||void 0===c?void 0:c.counsilForArchNo)||"NA"}]}:{title:"BPA_LICENSE_DETAILS_LABEL",asSectionHeader:!0,values:[{title:"BPA_LICENSE_TYPE",value:"TRADELICENSE_TRADETYPE_"+(null==n||null===(v=n.tradeLicenseDetail)||void 0===v||null===(p=v.tradeUnits)||void 0===p||null===(E=p[0])||void 0===E||null===(_=E.tradeType)||void 0===_?void 0:_.split(".")[0])||"NA"}]},{title:"BPA_LICENSEE_DETAILS_HEADER_OWNER_INFO",asSectionHeader:!0,values:[{title:"BPA_APPLICANT_NAME_LABEL",value:(null==n||null===(f=n.tradeLicenseDetail)||void 0===f||null===(A=f.owners)||void 0===A||null===(g=A[0])||void 0===g?void 0:g.name)||"NA"},{title:"BPA_APPLICANT_GENDER_LABEL",value:(null==n||null===(S=n.tradeLicenseDetail)||void 0===S||null===(h=S.owners)||void 0===h||null===(y=h[0])||void 0===y?void 0:y.gender)||"NA"},{title:"BPA_OWNER_MOBILE_NO_LABEL",value:(null==n||null===(D=n.tradeLicenseDetail)||void 0===D||null===(T=D.owners)||void 0===T||null===(b=T[0])||void 0===b?void 0:b.mobileNumber)||"NA"},{title:"BPA_APPLICANT_EMAIL_LABEL",value:(null==n||null===(C=n.tradeLicenseDetail)||void 0===C||null===(P=C.owners)||void 0===P||null===(N=P[0])||void 0===N?void 0:N.emailId)||"NA"},{title:"BPA_APPLICANT_PAN_NO",value:(null==n||null===(I=n.tradeLicenseDetail)||void 0===I||null===(L=I.owners)||void 0===L||null===(B=L[0])||void 0===B?void 0:B.pan)||"NA"}]},{title:"BPA_PERMANANT_ADDRESS_LABEL",asSectionHeader:!0,values:[{title:"BPA_PERMANANT_ADDRESS_LABEL",value:(null==n||null===(O=n.tradeLicenseDetail)||void 0===O||null===(R=O.owners)||void 0===R||null===(w=R[0])||void 0===w?void 0:w.permanentAddress)||"NA"}]},{title:"BPA_APPLICANT_CORRESPONDENCE_ADDRESS_LABEL",asSectionHeader:!0,values:[{title:"BPA_APPLICANT_CORRESPONDENCE_ADDRESS_LABEL",value:(null==n||null===(x=n.tradeLicenseDetail)||void 0===x||null===(M=x.owners)||void 0===M||null===(F=M[0])||void 0===F?void 0:F.correspondenceAddress)||"NA"}]},{title:"BPA_DOCUMENT_DETAILS_LABEL",asSectionHeader:!0,additionalDetails:{documentsWithUrl:[{title:"",values:null==n||null===(k=n.tradeLicenseDetail)||void 0===k||null===(U=k.applicationDocuments)||void 0===U?void 0:U.map(e=>{var t,l,n,i;return{title:"BPAREG_HEADER_"+(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,docInfo:null==e?void 0:e.info,url:null!==(l=m)&&void 0!==l&&l.data[null==e?void 0:e.fileStoreId]?null===(n=m)||void 0===n||null===(i=n.data[null==e?void 0:e.fileStoreId])||void 0===i?void 0:i.split(",")[0]:""}})}]}},(null==e||null===(H=e.Payments)||void 0===H?void 0:H.length)>0&&{title:"BPA_FEE_DETAILS_LABEL",additionalDetails:{inspectionReport:[],values:[{title:"BPAREG_FEES",value:l.createElement("span",null,"₹",null==e||null===(W=e.Payments)||void 0===W||null===(G=W[0])||void 0===G?void 0:G.totalAmountPaid)},{title:"BPA_STATUS_LABEL",isTransLate:!0,isStatus:!0,value:null!=e&&null!==(j=e.Payments)&&void 0!==j&&null!==(K=j[0])&&void 0!==K&&K.totalAmountPaid?"WF_BPA_PAID":"NA",isTransLate:!0}]}}];return{applicationData:n,applicationDetails:Y,tenantId:null==n?void 0:n.tenantId,payments:(null==e?void 0:e.Payments)||[]}}null!=n&&null!==(i=n.tradeLicenseDetail)&&void 0!==i&&null!==(o=i.applicationDocuments)&&void 0!==o&&o.length&&(null==t||null===(a=t.StakeholderRegistraition)||void 0===a||null===(r=a.TradeTypetoRoleMapping)||void 0===r?void 0:r.length)>0&&(null==t||null===(s=t.StakeholderRegistraition)||void 0===s||null===(c=s.TradeTypetoRoleMapping)||void 0===c||c.map(e=>{var t,l,i,o,a;(null==e||null===(t=e.docTypes)||void 0===t?void 0:t.length)>0&&(null==e?void 0:e.tradeType)==(null==n||null===(l=n.tradeLicenseDetail)||void 0===l||null===(i=l.tradeUnits)||void 0===i||null===(o=i[0])||void 0===o?void 0:o.tradeType)&&(null==e||null===(a=e.docTypes)||void 0===a||a.map(e=>{var t,l;null==n||null===(t=n.tradeLicenseDetail)||void 0===t||null===(l=t.applicationDocuments)||void 0===l||l.forEach(t=>{(null==e?void 0:e.code)==(null==t?void 0:t.documentType)&&null!=e&&e.info&&(t.info=null==e?void 0:e.info)})}))}));const p=null==n||null===(u=n.tradeLicenseDetail)||void 0===u||null===(d=u.applicationDocuments)||void 0===d?void 0:d.map(e=>null==e?void 0:e.fileStoreId);let m={};const E=function(){if((null==p?void 0:p.length)>0)return Promise.resolve(Ja(p,Digit.ULBService.getStateId())).then(function(e){m=e})}();return E&&E.then?E.then(v):v()})})})}catch(e){return Promise.reject(e)}},BPADetailsPage:function(e,t){try{return Promise.resolve(Za.BPASearch(e,t)).then(function(t){var l,n,i,o,a,r,u,d,s,m,E,_,f,A;let g=null==t||null===(l=t.BPA)||void 0===l||null===(n=l[0])||void 0===n||null===(i=n.documents)||void 0===i?void 0:i.map(e=>e.fileStoreId);if(g||(g=[]),null==t||null===(o=t.BPA)||void 0===o||null===(a=o[0])||void 0===a||null===(r=a.additionalDetails)||void 0===r||null===(u=r.fieldinspection_pending)||void 0===u||u.map(e=>{var t;null==e||null===(t=e.docs)||void 0===t||t.map(e=>{null!=e&&e.fileStoreId&&g.push(null==e?void 0:e.fileStoreId)})}),null==t||null===(d=t.BPA)||void 0===d||!d.length)return;sessionStorage.setItem("BPA_ARCHITECT_NAME",JSON.stringify(null!=t&&null!==(s=t.BPA)&&void 0!==s&&null!==(m=s[0])&&void 0!==m&&null!==(E=m.additionalDetails)&&void 0!==E&&E.typeOfArchitect?null==t||null===(_=t.BPA)||void 0===_||null===(f=_[0])||void 0===f||null===(A=f.additionalDetails)||void 0===A?void 0:A.typeOfArchitect:"ARCHITECT"));const[S]=null==t?void 0:t.BPA;return Promise.resolve(Za.scrutinyDetails(null==S?void 0:S.tenantId,{edcrNumber:null==S?void 0:S.edcrNumber})).then(function(t){const[l]=null==t?void 0:t.edcrDetail;return Promise.resolve(Xa.getMultipleTypes(e,"BPA",["RiskTypeComputation","CheckList"])).then(function(t){var n,i,o,a;const r=Digit.Utils.obps.calculateRiskType(null==t||null===(n=t.BPA)||void 0===n?void 0:n.RiskTypeComputation,null==l||null===(i=l.planDetail)||void 0===i||null===(o=i.plot)||void 0===o?void 0:o.area,null==l||null===(a=l.planDetail)||void 0===a?void 0:a.blocks);return S.riskType=r,Promise.resolve(Za.NOCSearch(null==S?void 0:S.tenantId,{sourceRefId:null==S?void 0:S.applicationNo})).then(function(n){const i=null==n?void 0:n.Noc;return Promise.resolve(Za.BPASearch(e,{approvalNo:null==l?void 0:l.permitNumber})).then(function(e){var n,o,a,u,d,s;const m={ocdcrNumber:null!=S&&S.edcrNumber.includes("OCDCR")?null==S?void 0:S.edcrNumber:null==e||null===(n=e.BPA)||void 0===n||null===(o=n[0])||void 0===o?void 0:o.edcrNumber,edcrNumber:null!=e&&null!==(a=e.BPA)&&void 0!==a&&null!==(u=a[0])&&void 0!==u&&u.edcrNumber.includes("OCDCR")?null==S?void 0:S.edcrNumber:null==e||null===(d=e.BPA)||void 0===d||null===(s=d[0])||void 0===s?void 0:s.edcrNumber};return Promise.resolve(Za.comparisionReport(null==S?void 0:S.tenantId,{...m})).then(function(n){function o(){function o(){function o(){var o,u,c,v,p,f,A,g,h,y,D,T,b,C,P,N,I,L,B,O,R,w,x,M,F,k,U,H,W,G,j,K,Y,$,z,V,q,X,J,Z,Q,ee,te,le,ne,ie,oe,ae,re,ue,de,se,ce,ve,pe,me,Ee,_e,fe,Ae,ge,Se,he,ye,De,Te,be,Ce,Pe,Ne,Ie,Le,Be,Oe,Re,we,xe,Me,Fe,ke,Ue;(null==E?void 0:E.length)>0&&(null==E||E.map(e=>{var t,l,n,i,o;null==e||null===(t=e.paymentDetails)||void 0===t||null===(l=t[0])||void 0===l||null===(n=l.bill)||void 0===n||null===(i=n.billDetails)||void 0===i||null===(o=i[0])||void 0===o||o.billAccountDetails.map((e,t)=>{s.push({title:(null==e?void 0:e.taxHeadCode)+"_DETAILS",value:"",isSubTitle:!0},{title:null==e?void 0:e.taxHeadCode,value:"₹"+(null==e?void 0:e.amount)},{title:"BPA_STATUS_LABEL",value:"Paid"}),m+=parseInt(null==e?void 0:e.amount)})})),(null===(o=_)||void 0===o||null===(u=o.Bill)||void 0===u?void 0:u.length)>0&&s.push({title:(null===(Pe=_)||void 0===Pe||null===(Ne=Pe.Bill)||void 0===Ne||null===(Ie=Ne[0])||void 0===Ie||null===(Le=Ie.billDetails)||void 0===Le||null===(Be=Le[0])||void 0===Be||null===(Oe=Be.billAccountDetails)||void 0===Oe||null===(Re=Oe[0])||void 0===Re?void 0:Re.taxHeadCode)+"_DETAILS"||"BPA_SANC_FEE_DETAILS",value:"",isSubTitle:!0},{title:"BPA_SANC_FEE_LABEL",value:"₹"+(null===(we=_)||void 0===we||null===(xe=we.Bill)||void 0===xe||null===(Me=xe[0])||void 0===Me?void 0:Me.totalAmount)},{title:"BPA_STATUS_LABEL",value:0==(null===(Fe=_)||void 0===Fe||null===(ke=Fe.Bill)||void 0===ke||null===(Ue=ke[0])||void 0===Ue?void 0:Ue.totalAmount)?"Paid":"Unpaid"}),m>0&&s.push({title:"BPA_TOT_AMT_PAID",value:"₹"+m});const He={title:"BPA_FEE_DETAILS_LABEL",isFeeDetails:!0,additionalDetails:{inspectionReport:[],values:[...s]}};function We(e){if(null==e||null==e||""==e)return"NA";const t=new Date(e);let l=t.getMonth()+1,n=t.getDate();return l=(l>9?"":"0")+l,n=(n>9?"":"0")+n,`${n}/${l}/${t.getFullYear()-3}`}null==S||null===(c=S.additionalDetails)||void 0===c||null===(v=c.fieldinspection_pending)||void 0===v||v.forEach(e=>{var t;null==e||null===(t=e.docs)||void 0===t||t.forEach(e=>{var t,l,n;null!==(t=a)&&void 0!==t&&t.data[null==e?void 0:e.fileStoreId]&&(e.url=null===(l=a)||void 0===l||null===(n=l.data[null==e?void 0:e.fileStoreId])||void 0===n?void 0:n.split(",")[0])})});const Ge=null==i?void 0:i.map((e,t)=>{var l,n,i,o,r;return{title:0===t?"BPA_NOC_DETAILS_SUMMARY":"",values:[{title:`BPA_${null==e?void 0:e.nocType}_LABEL`,value:null==e?void 0:e.applicationNo,isNotTranslated:!0},{title:"BPA_NOC_STATUS",value:null==e?void 0:e.applicationStatus,field:"STATUS"},(null==e||null===(l=e.additionalDetails)||void 0===l?void 0:l.SubmittedOn)&&{title:"BPA_SUDMITTED_ON_LABEL",value:null!=e&&null!==(n=e.additionalDetails)&&void 0!==n&&n.SubmittedOn?Hl(new Date(Number(null==e||null===(i=e.additionalDetails)||void 0===i?void 0:i.SubmittedOn)),"dd/MM/yyyy"):"NA",isNotTranslated:!0},(null==e?void 0:e.nocNo)&&{title:"BPA_APPROVAL_NUMBER_LABEL",value:(null==e?void 0:e.nocNo)||"NA",isNotTranslated:!0},(null==e?void 0:e.nocNo)&&{title:"BPA_APPROVED_REJECTED_ON_LABEL",value:"APPROVED"===(null==e?void 0:e.applicationStatus)||"REJECTED"===(null==e?void 0:e.applicationStatus)||"AUTO_APPROVED"===(null==e?void 0:e.applicationStatus)||"AUTO_REJECTED"===(null==e?void 0:e.applicationStatus)?Hl(new Date(Number(null==e||null===(o=e.auditDetails)||void 0===o?void 0:o.lastModifiedTime)),"dd/MM/yyyy"):"NA",isNotTranslated:!0}],additionalDetails:{data:e,noc:[{title:"BPA_DOCUMENT_DETAILS_LABEL",values:null==e||null===(r=e.documents)||void 0===r?void 0:r.map(e=>{var t,l,n,i,o,r;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!==(l=a)&&void 0!==l&&null!==(n=l.data)&&void 0!==n&&n[null==e?void 0:e.fileStoreId]?null===(i=a)||void 0===i||null===(o=i.data)||void 0===o||null===(r=o[null==e?void 0:e.fileStoreId])||void 0===r?void 0:r.split(",")[0]:""}})}]}}});let je=[],Ke=[];null==S||null===(p=S.additionalDetails)||void 0===p||null===(f=p.fieldinspection_pending)||void 0===f||f.filter(e=>e.docs&&e.docs.length>0).map((e,t)=>{var l,n,i,o,r;Ke=[],je.push({title:"BPA_FI_REPORT",asSectionHeader:!0,values:[{title:"BPA_FI_DATE_LABEL",value:e.date.includes("-")?`${null===(l=e.date)||void 0===l?void 0:l.split("-")[2]}/${null===(n=e.date)||void 0===n?void 0:n.split("-")[1]}/${null===(i=e.date)||void 0===i?void 0:i.split("-")[0]}`:e.date},{title:"BPA_FI_TIME_LABEL",value:e.time}]}),null==e||null===(o=e.questions)||void 0===o||o.map((e,t)=>{Ke.push({title:e.question,value:e.value}),Ke.push({title:"BPA_ENTER_REMARKS",value:e.remarks})}),je.push({title:"BPA_CHECK_LIST_DETAILS",asSectionHeader:!0,values:Ke}),je.push({title:"BPA_DOCUMENT_DETAILS_LABEL",asSectionHeader:!0,additionalDetails:{obpsDocuments:[{title:"",values:null==e||null===(r=e.docs)||void 0===r?void 0:r.map(e=>{var t,l,n,i,o,r;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.fileStore,fileStoreId:null==e?void 0:e.fileStoreId,id:null==e?void 0:e.id,url:null!==(l=a)&&void 0!==l&&null!==(n=l.data)&&void 0!==n&&n[null==e?void 0:e.fileStoreId]?null===(i=a)||void 0===i||null===(o=i.data)||void 0===o||null===(r=o[null==e?void 0:e.fileStoreId])||void 0===r?void 0:r.split(",")[0]:""}})}]}})});let Ye=[],$e={title:" ",isCommon:!0,values:[{title:"BPA_APPLICATION_NUMBER_LABEL",value:(null==S?void 0:S.applicationNo)||"NA"}]},ze=window.location.href.includes("/employee")?"employee":"citizen";var Ve,qe,Xe,Je,Ze,Qe,et,tt,lt,nt,it,ot,at;null!=S&&S.businessService.includes("BPA_OC")&&($e.values=[...null==$e?void 0:$e.values,{title:"BPA_PERMIT_APP_NUMBER",to:`/digit-ui/${ze}/obps/bpa/${null==e||null===(Ve=e.BPA)||void 0===Ve||null===(qe=Ve[0])||void 0===qe?void 0:qe.applicationNo}`,value:null==e||null===(Xe=e.BPA)||void 0===Xe||null===(Je=Xe[0])||void 0===Je?void 0:Je.approvalNo,isLink:!0}],$e.values=[...null==$e?void 0:$e.values,{title:"BPA_PERMIT_VALIDITY",value:null!=e&&null!==(Ze=e.BPA)&&void 0!==Ze&&null!==(Qe=Ze[0])&&void 0!==Qe&&null!==(et=Qe.additionalDetails)&&void 0!==et&&et.validityDate?`${We(null==e||null===(tt=e.BPA)||void 0===tt||null===(lt=tt[0])||void 0===lt||null===(nt=lt.additionalDetails)||void 0===nt?void 0:nt.validityDate)} - ${Hl(new Date(null==e||null===(it=e.BPA)||void 0===it||null===(ot=it[0])||void 0===ot||null===(at=ot.additionalDetails)||void 0===at?void 0:at.validityDate),"dd/MM/yyyy")}`:"NA"}]);let rt=[];(null==S||null===(A=S.additionalDetails)||void 0===A?void 0:A.pendingapproval)&&(null==S||null===(g=S.additionalDetails)||void 0===g?void 0:g.pendingapproval.length)>0&&(null==S||null===(h=S.additionalDetails)||void 0===h||h.pendingapproval.map((e,t)=>{rt.push({title:`${t+1}. ${e}`,value:""})}));let ut={title:"BPA_PERMIT_CONDITIONS",isTitleVisible:!((null===(y=rt)||void 0===y?void 0:y.length)>0),isNotAllowed:!((null===(D=rt)||void 0===D?void 0:D.length)>0),additionalDetails:{inspectionReport:[],permit:[...rt]}};var dt,st,ct,vt,pt;0==rt.length&&(ut={}),"LOW"==r&&rt.length>0&&(rt=[],ut={}),null!=S&&S.approvalNo&&(null==$e||null===(dt=$e.values)||void 0===dt||dt.push({title:"BPA_OC"!==(null==S?void 0:S.businessService)?"BPA_PERMIT_NUMBER_LABEL":"BPA_OC_PERMIT_NUMBER_LABEL",value:(null==S?void 0:S.approvalNo)||"NA"}),null==$e||null===(st=$e.values)||void 0===st||st.push({title:"BPA_OC"!==(null==S?void 0:S.businessService)?"BPA_PERMIT_VALIDITY":"BPA_OC_PERMIT_VALIDITY",value:null!=S&&null!==(ct=S.additionalDetails)&&void 0!==ct&&ct.validityDate?`${We(null==S||null===(vt=S.additionalDetails)||void 0===vt?void 0:vt.validityDate)} - ${Hl(new Date(null==S||null===(pt=S.additionalDetails)||void 0===pt?void 0:pt.validityDate),"dd/MM/yyyy")}`:"NA"}));const mt={title:"BPA_BASIC_DETAILS_TITLE",asSectionHeader:!0,isInsert:!0,isCommon:!0,values:[{title:"BPA_BASIC_DETAILS_APP_DATE_LABEL",value:null!=S&&null!==(T=S.auditDetails)&&void 0!==T&&T.createdTime?Hl(new Date(null==S||null===(b=S.auditDetails)||void 0===b?void 0:b.createdTime),"dd/MM/yyyy"):""},{title:"BPA_BASIC_DETAILS_APPLICATION_TYPE_LABEL",value:"WF_BPA_"+(null==l?void 0:l.appliactionType)},{title:"BPA_BASIC_DETAILS_SERVICE_TYPE_LABEL",value:null==l?void 0:l.applicationSubType},{title:"BPA_BASIC_DETAILS_OCCUPANCY_LABEL",value:null==l||null===(C=l.planDetail)||void 0===C||null===(P=C.planInformation)||void 0===P?void 0:P.occupancy},{title:"BPA_BASIC_DETAILS_RISK_TYPE_LABEL",value:"WF_BPA_"+r,isInsert:!0},{title:"BPA_BASIC_DETAILS_APPLICATION_NAME_LABEL",value:null==l||null===(N=l.planDetail)||void 0===N||null===(I=N.planInformation)||void 0===I?void 0:I.applicantName}]},Et={title:"BPA_PLOT_DETAILS_TITLE",asSectionHeader:!0,isCommon:!0,values:[{title:"BPA_BOUNDARY_PLOT_AREA_LABEL",value:""+(null==l||null===(L=l.planDetail)||void 0===L||null===(B=L.planInformation)||void 0===B?void 0:B.plotArea),isNotTranslated:!0,isUnit:"BPA_SQ_FT_LABEL"},{title:"BPA_PLOT_NUMBER_LABEL",value:(null==l||null===(O=l.planDetail)||void 0===O||null===(R=O.planInformation)||void 0===R?void 0:R.plotNo)||"NA",isNotTranslated:!0},{title:"BPA_KHATHA_NUMBER_LABEL",value:(null==l||null===(w=l.planDetail)||void 0===w||null===(x=w.planInformation)||void 0===x?void 0:x.khataNo)||"NA",isNotTranslated:!0},{title:"BPA_HOLDING_NUMBER_LABEL",value:(null==S||null===(M=S.additionalDetails)||void 0===M?void 0:M.holdingNo)||"NA",isNotTranslated:!0},{title:"BPA_BOUNDARY_LAND_REG_DETAIL_LABEL",value:(null==S||null===(F=S.additionalDetails)||void 0===F?void 0:F.registrationDetails)||"NA",isNotTranslated:!0},{title:"BPA_BOUNDARY_WALL_LENGTH_LABEL",value:(null==S||null===(k=S.additionalDetails)||void 0===k?void 0:k.boundaryWallLength)||"NA",isNotTranslated:!0}]},_t={title:"BPA_STEPPER_SCRUTINY_DETAILS_HEADER",isScrutinyDetails:!0,isBackGroundColor:!0,additionalDetails:{values:[{title:"BPA_EDCR_DETAILS",value:" ",isHeader:!0},{title:"BPA_OC"!==(null==S?void 0:S.businessService)?"BPA_EDCR_NO_LABEL":"BPA_OC_EDCR_NO_LABEL",value:(null==S?void 0:S.edcrNumber)||"NA"}],scruntinyDetails:[{title:"BPA_UPLOADED_PLAN_DIAGRAM",value:null==l?void 0:l.updatedDxfFile,text:"BPA_UPLOADED_PLAN_DXF"},{title:"BPA_SCRUNTINY_REPORT_OUTPUT",value:null==l?void 0:l.planReport,text:"BPA_SCRUTINY_REPORT_PDF"}]}},ft={title:"",isScrutinyDetails:!0,isBackGroundColor:!0,additionalDetails:{values:[{title:"BPA_OC"!==(null==S?void 0:S.businessService)?"BPA_BUILDING_EXTRACT_HEADER":"BPA_ACTUAL_BUILDING_EXTRACT_HEADER",value:" ",isHeader:!0},{title:"BPA_TOTAL_BUILT_UP_AREA_HEADER",value:null==l||null===(U=l.planDetail)||void 0===U||null===(H=U.blocks)||void 0===H||null===(W=H[0])||void 0===W||null===(G=W.building)||void 0===G?void 0:G.totalBuitUpArea,isUnit:"BPA_SQ_MTRS_LABEL"},{title:"BPA_SCRUTINY_DETAILS_NUMBER_OF_FLOORS_LABEL",value:(null==l||null===(j=l.planDetail)||void 0===j||null===(K=j.blocks)||void 0===K||null===(Y=K[0])||void 0===Y||null===($=Y.building)||void 0===$?void 0:$.totalFloors)||"NA"},{title:"BPA_HEIGHT_FROM_GROUND_LEVEL",value:null==l||null===(z=l.planDetail)||void 0===z||null===(V=z.blocks)||void 0===V||null===(q=V[0])||void 0===q||null===(X=q.building)||void 0===X?void 0:X.declaredBuildingHeigh,isUnit:"BPA_MTRS_LABEL"}],scruntinyDetails:[]}},At={title:"",isScrutinyDetails:!0,isBackGroundColor:!0,additionalDetails:{values:[{title:"BPA_APP_DETAILS_DEMOLITION_DETAILS_LABEL",value:" ",isHeader:!0},{title:"BPA_APPLICATION_DEMOLITION_AREA_LABEL",value:null==l||null===(J=l.planDetail)||void 0===J||null===(Z=J.planInformation)||void 0===Z?void 0:Z.demolitionArea,isUnit:"BPA_SQ_MTRS_LABEL"}],scruntinyDetails:[]}},gt={title:"",isSubOccupancyTable:!0,isTitleRepeat:!0,additionalDetails:{values:[{title:"BPA_OCC_SUBOCC_HEADER",value:" ",isHeader:!0}],subOccupancyTableDetails:[{title:"BPA_APPLICATION_DEMOLITION_AREA_LABEL",value:l},{title:"NO_REPEAT",value:""}]}},St={title:"BPA_NEW_TRADE_DETAILS_HEADER_DETAILS",asSectionHeader:!0,isCommon:!0,values:[{title:"BPA_DETAILS_PIN_LABEL",value:null==S||null===(Q=S.landInfo)||void 0===Q||null===(ee=Q.address)||void 0===ee?void 0:ee.pincode},{title:"BPA_CITY_LABEL",value:null==S||null===(te=S.landInfo)||void 0===te||null===(le=te.address)||void 0===le?void 0:le.city},{title:"BPA_LOC_MOHALLA_LABEL",value:null==S||null===(ne=S.landInfo)||void 0===ne||null===(ie=ne.address)||void 0===ie||null===(oe=ie.locality)||void 0===oe?void 0:oe.name},{title:"BPA_DETAILS_SRT_NAME_LABEL",value:null==S||null===(ae=S.landInfo)||void 0===ae||null===(re=ae.address)||void 0===re?void 0:re.street},{title:"ES_NEW_APPLICATION_LOCATION_LANDMARK",value:null==S||null===(ue=S.landInfo)||void 0===ue||null===(de=ue.address)||void 0===de?void 0:de.landmark}]},ht=(null==S||null===(se=S.landInfo)||void 0===se||null===(ce=se.owners)||void 0===ce?void 0:ce.length)||1;var yt,Dt;(null==S||null===(ve=S.landInfo)||void 0===ve||null===(pe=ve.owners)||void 0===pe?void 0:pe.length)>0&&(null==S||null===(yt=S.landInfo)||void 0===yt||null===(Dt=yt.owners)||void 0===Dt||Dt.forEach(e=>{e.isPrimaryOwner||(e.isPrimaryOwner="false")}));const Tt={title:"BPA_APPLICANT_DETAILS_HEADER",isOwnerDetails:!0,additionalDetails:{owners:null==S||null===(me=S.landInfo)||void 0===me||null===(Ee=me.owners)||void 0===Ee?void 0:Ee.map((e,t)=>({title:Number(ht)>1?"COMMON_OWNER":"",values:[{title:"CORE_COMMON_NAME",value:null==e?void 0:e.name},{title:"BPA_APPLICANT_GENDER_LABEL",value:null==e?void 0:e.gender},{title:"CORE_COMMON_MOBILE_NUMBER",value:null==e?void 0:e.mobileNumber},{title:"CORE_COMMON_EMAIL_ID",value:null==e?void 0:e.emailId},{title:"BPA_IS_PRIMARY_OWNER_LABEL",value:null==e?void 0:e.isPrimaryOwner,isNotTranslated:!1}]}))}},bt={title:"BPA_DOCUMENT_DETAILS_LABEL",asSectionHeader:!0,isDocumentDetails:!0,additionalDetails:{obpsDocuments:[{title:"",values:null==S||null===(_e=S.documents)||void 0===_e?void 0:_e.map(e=>{var t,l,n,i,o,r;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!==(l=a)&&void 0!==l&&null!==(n=l.data)&&void 0!==n&&n[null==e?void 0:e.fileStoreId]?null===(i=a)||void 0===i||null===(o=i.data)||void 0===o||null===(r=o[null==e?void 0:e.fileStoreId])||void 0===r?void 0:r.split(",")[0]:""}})}]}};let Ct=[],Pt={};var Nt;let It;var Lt;"APPROVAL_INPROGRESS"===(null==S?void 0:S.status)&&(null==t||null===(Nt=t.BPA)||void 0===Nt||Nt.CheckList.forEach(e=>{var t;(null==e?void 0:e.RiskType)===r&&(null==e?void 0:e.applicationType)===(null==l?void 0:l.appliactionType)&&(null==e?void 0:e.ServiceType)===(null==l?void 0:l.applicationSubType)&&"PENDINGAPPROVAL"===(null==e?void 0:e.WFState)&&(null==e||null===(t=e.conditions)||void 0===t?void 0:t.length)>0&&Ct.push(...null==e?void 0:e.conditions)}),Pt={title:"",isTitleVisible:!((null==Ct?void 0:Ct.length)>0),asSectionHeader:!0,isPermissions:!0,additionalDetails:{permissions:Ct}}),"LOW"==r&&Ct.length>0&&(Pt={});let Bt=[];je&&(null==S||null===(fe=S.additionalDetails)||void 0===fe||null===(Ae=fe.fieldinspection_pending)||void 0===Ae||null===(ge=Ae[0])||void 0===ge?void 0:ge.questions.length)>0&&je.map((e,t)=>{if(e.title.includes("FI_REPORT"))Bt=[...Bt,{title:e.title,additionalDetails:{inspectionReport:[],values:e.values}}];else if(e.title.includes("CHECK_LIST"))Bt=[...Bt,{title:e.title,additionalDetails:{isChecklist:!0,inspectionReport:[],values:e.values}}];else{var l,n;let t=[...null===(l=e.additionalDetails.obpsDocuments)||void 0===l||null===(n=l[0])||void 0===n?void 0:n.values];t.map(e=>{e.isNotDuplicate=!0}),t.map((e,l)=>{if(It=e.documentType,1==e.isNotDuplicate)for(Lt=l+1;Lt<t.length;Lt++)It===t[Lt].documentType&&(t[Lt].isNotDuplicate=!1)}),Bt=[...Bt,{title:e.title,additionalDetails:{FIdocuments:[],documents:[{values:t}]}}]}});const Ot={title:"",isFieldInspection:!0,isNotAllowed:!((null==S||null===(Se=S.additionalDetails)||void 0===Se||null===(he=Se.fieldinspection_pending)||void 0===he?void 0:he.length)>0),additionalDetails:{values:[],fiReport:(null==S||null===(ye=S.additionalDetails)||void 0===ye||null===(De=ye.fieldinspection_pending)||void 0===De?void 0:De.length)>0}};Ye="BPA_OC"!==(null==S?void 0:S.businessService)?[...Ye,$e,mt,Et,_t,ft,gt,At,St,Tt,bt,Ot,...Ge,Pt,ut]:[...Ye,$e,mt,Et,_t,ft,gt,At,bt,Ot,...Ge,ut],null!=He&&null!==(Te=He.additionalDetails)&&void 0!==Te&&null!==(be=Te.values)&&void 0!==be&&be.length&&Ye.push(He);let Rt=null===(Ce=Ye)||void 0===Ce?void 0:Ce.filter(e=>e);return{applicationData:S,applicationDetails:Rt,tenantId:null==S?void 0:S.tenantId,edcrDetails:l,nocData:i,comparisionReport:null==n?void 0:n.comparisonDetail,businessService:null==S?void 0:S.businessService,applicationNo:null==S?void 0:S.applicationNo,applicationStatus:null==S?void 0:S.status,collectionBillDetails:d}}let f=0;const A=function(e,t,l){for(var n;;){var i=e();if(p(i)&&(i=i.v),!i)return o;if(i.then){n=0;break}var o=l();if(o&&o.then){if(!p(o)){n=1;break}o=o.s}if(t){var a=t();if(a&&a.then&&!p(a)){n=2;break}}}var r=new c,u=v.bind(null,r,2);return(0===n?i.then(s):1===n?o.then(d):a.then(m)).then(void 0,u),r;function d(n){o=n;do{if(t&&(a=t())&&a.then&&!p(a))return void a.then(m).then(void 0,u);if(!(i=e())||p(i)&&!i.v)return void v(r,1,o);if(i.then)return void i.then(s).then(void 0,u);p(o=l())&&(o=o.v)}while(!o||!o.then);o.then(d).then(void 0,u)}function s(e){e?(o=l())&&o.then?o.then(d).then(void 0,u):d(o):v(r,1,o)}function m(){(i=e())?i.then?i.then(s).then(void 0,u):s(i):v(r,1,o)}}(function(){var e;return f<(null===(e=u)||void 0===e?void 0:e.length)},function(){return f++},function(){return Promise.resolve(Digit.PaymentService.recieptSearch(null==S?void 0:S.tenantId,u[f],{consumerCodes:null==S?void 0:S.applicationNo,isEmployee:!0})).then(function(e){var t,l,n;(null==e||null===(t=e.Payments)||void 0===t?void 0:t.length)>0&&(null==e||null===(n=e.Payments)||void 0===n||n.map(e=>{var t;null==e||null===(t=e.paymentDetails)||void 0===t||t.map(t=>{(null==t?void 0:t.businessService)==u[f]&&E.push(e)})})),(null==e||null===(l=e.Payments)||void 0===l?void 0:l.length)>0&&d.push(...null==e?void 0:e.Payments)})});return A&&A.then?A.then(o):o()}let u=[],d=[],s=[],m=0,E=[];"BPA_LOW"===(null==S?void 0:S.businessService)?u=["BPA.LOW_RISK_PERMIT_FEE"]:"BPA"===(null==S?void 0:S.businessService)?u=["BPA.NC_APP_FEE","BPA.NC_SAN_FEE"]:"BPA_OC"===(null==S?void 0:S.businessService)&&(u=["BPA.NC_OC_APP_FEE","BPA.NC_OC_SAN_FEE"]);let _={};const f=function(e){if(null!==(e=u)&&void 0!==e&&e[1])return Promise.resolve(Digit.PaymentService.fetchBill(null==S?void 0:S.tenantId,{consumerCode:null==S?void 0:S.applicationNo,businessService:u[1]})).then(function(e){_=e})}();return f&&f.then?f.then(o):o()}null==i||i.map(e=>{var t;null==e||null===(t=e.documents)||void 0===t||t.map(e=>{null!=e&&e.fileStoreId&&g.push(null==e?void 0:e.fileStoreId)})});let a={};const u=function(e){if((null===(e=g)||void 0===e?void 0:e.length)>0)return Promise.resolve(Ja(g,Digit.ULBService.getStateId())).then(function(e){a=e})}();return u&&u.then?u.then(o):o()})})})})})})}catch(e){return Promise.reject(e)}}},Qa=function(e,t,l,n){try{return Promise.resolve(Za.scrutinyDetails(e,t,l)).then(function(e){return window.location.href.includes("bpa/inbox")?null==e?void 0:e.edcrDetail:"No Record Found"==e&&(window.location.href.includes("/basic-details")||window.location.href.includes("/basic-details"))?"BPA_NO_RECORD_FOUND":null==e||null===(t=e.edcrDetail)||void 0===t?void 0:t[0];var t})}catch(e){return Promise.reject(e)}},er=e=>e.substr(0,1).toUpperCase()+e.substr(1),tr=e=>{var t,l,n,i,o,a,r,u;console.log(e,"PROPS");const d=null==e||null===(t=e.data)||void 0===t||null===(l=t.BPA)||void 0===l?void 0:l[0];console.log(d,"bpaData");let s=null!=e&&null!==(n=e.data)&&void 0!==n&&null!==(i=n.BPA)&&void 0!==i&&null!==(o=i[0])&&void 0!==o&&o.businessService?null==e||null===(a=e.data)||void 0===a||null===(r=a.BPA)||void 0===r||null===(u=r[0])||void 0===u?void 0:u.businessService:"BPA";const c=null==d?void 0:d.status;"BPA_LOW"==s&&(s="BPA");const v=sessionStorage.getItem("BPA_SUBMIT_APP")?JSON.parse(sessionStorage.getItem("BPA_SUBMIT_APP")):null;var p,m,E,_;return e.isSuccess?"BPA_SUBMIT_APP"==v?window.location.href.includes("editApplication")?null==e?void 0:e.t(`BPA_SUBMIT_HEADER_${s}_${null==d||null===(m=d.workflow)||void 0===m?void 0:m.action}_${gt(c," ","_").toUpperCase()}`):null==e?void 0:e.t(`BPA_SUBMIT_HEADER_${s}_${null==d||null===(p=d.workflow)||void 0===p?void 0:p.action}_${gt(c," ","_").toUpperCase()}`):window.location.href.includes("editApplication")?null==e?void 0:e.t(`BPA_HEADER_${s}_${null==d||null===(_=d.workflow)||void 0===_?void 0:_.action}_${gt(c," ","_").toUpperCase()}`):null==e?void 0:e.t(`BPA_HEADER_${s}_${null==d||null===(E=d.workflow)||void 0===E?void 0:E.action}_${gt(c," ","_").toUpperCase()}`):e.isLoading?(window.location.href.includes("editApplication"),null==e?void 0:e.t("CS_BPA_APPLICATION_PENDING")):e.isSuccess?void 0:(window.location.href.includes("editApplication"),null==e?void 0:e.t("CS_BPA_APPLICATION_FAILED"))},lr=e=>{var t,l,n,i;let o=null!=e&&null!==(t=e.BPA)&&void 0!==t&&null!==(l=t[0])&&void 0!==l&&l.businessService?null==e||null===(n=e.BPA)||void 0===n||null===(i=n[0])||void 0===i?void 0:i.businessService:"BPA";return"BPA_LOW"==o&&(o="BPA"),"BPA"==o?null==e?void 0:e.t("BPA_PERMIT_APPLICATION_NUMBER_LABEL"):null==e?void 0:e.t("BPA_OCCUPANCY_CERTIFICATE_APPLICATION_NUMBER_LABEL")},nr=e=>{var t;return l.createElement(o.Banner,{message:tr(e),applicationNumber:null===(t=e.data)||void 0===t?void 0:t.BPA[0].applicationNo,info:e.isSuccess?lr(e):"",successful:e.isSuccess,headerStyles:{fontSize:"32px"}})},ir=e=>{var t,l,n,i,o,a,r,u;const d=null==e||null===(t=e.data)||void 0===t||null===(l=t.BPA)||void 0===l?void 0:l[0];let s=null!=e&&null!==(n=e.data)&&void 0!==n&&null!==(i=n.BPA)&&void 0!==i&&null!==(o=i[0])&&void 0!==o&&o.businessService?null==e||null===(a=e.data)||void 0===a||null===(r=a.BPA)||void 0===r||null===(u=r[0])||void 0===u?void 0:u.businessService:"BPA",c=null==d?void 0:d.status;"BPA_LOW"==s&&(s="BPA");let v=sessionStorage.getItem("BPA_SUBMIT_APP")?JSON.parse(sessionStorage.getItem("BPA_SUBMIT_APP")):null;var p,m,E,_;return e.isSuccess?"BPA_SUBMIT_APP"==v?window.location.href.includes("editApplication")?null==e?void 0:e.t(`BPA_SUBMIT_HEADER_${s}_${null==d||null===(m=d.workflow)||void 0===m?void 0:m.action}_${gt(c," ","_").toUpperCase()}`):null==e?void 0:e.t(`BPA_SUBMIT_HEADER_${s}_${null==d||null===(p=d.workflow)||void 0===p?void 0:p.action}_${gt(c," ","_").toUpperCase()}`):window.location.href.includes("editApplication")?null==e?void 0:e.t(`BPA_HEADER_${s}_${null==d||null===(_=d.workflow)||void 0===_?void 0:_.action}_${gt(c," ","_").toUpperCase()}`):null==e?void 0:e.t(`BPA_HEADER_${s}_${null==d||null===(E=d.workflow)||void 0===E?void 0:E.action}_${gt(c," ","_").toUpperCase()}`):e.isLoading?(window.location.href.includes("editApplication"),null==e?void 0:e.t("CS_BPA_APPLICATION_PENDING")):e.isSuccess?void 0:(window.location.href.includes("editApplication"),null==e?void 0:e.t("CS_BPA_APPLICATION_FAILED"))},or=e=>{var t,l,n,i;let o=null!=e&&null!==(t=e.BPA)&&void 0!==t&&null!==(l=t[0])&&void 0!==l&&l.businessService?null==e||null===(n=e.BPA)||void 0===n||null===(i=n[0])||void 0===i?void 0:i.businessService:"BPA";return"BPA_LOW"==o&&(o="BPA"),"BPA"==o?null==e?void 0:e.t("BPA_PERMIT_APPLICATION_NUMBER_LABEL"):null==e?void 0:e.t("BPA_OCCUPANCY_CERTIFICATE_APPLICATION_NUMBER_LABEL")},ar=e=>{var t;return l.createElement(o.Banner,{message:ir(e),applicationNumber:null===(t=e.data)||void 0===t?void 0:t.BPA[0].applicationNo,info:e.isSuccess?or(e):"",successful:e.isSuccess,headerStyles:{fontSize:"32px"}})},rr=e=>e.substr(0,1).toUpperCase()+e.substr(1),ur=e=>{var t,l,i,o,a,r,u;const d=(null==e||null===(t=e.data)||void 0===t||null===(l=t.Licenses)||void 0===l||null===(i=l[0])||void 0===i||null===(o=i.tradeLicenseDetail)||void 0===o||null===(a=o.tradeUnits)||void 0===a||null===(r=a[0])||void 0===r||null===(u=r.tradeType)||void 0===u?void 0:u.split(".")[0])||"ARCHITECT",{t:s}=n.useTranslation();return e.isSuccess?window.location.href.includes("edit-application")?s("CS_PROPERTY_UPDATE_APPLICATION_SUCCESS"):`${s("TRADELICENSE_TRADETYPE_"+d)}${s("CS_STAKEHOLDER_APPLICATION_SUCCESS")}`:e.isLoading?window.location.href.includes("edit-application")?s("CS_PROPERTY_UPDATE_APPLICATION_PENDING"):s("CS_STAKEHOLDER_APPLICATION_PENDING"):e.isSuccess?void 0:window.location.href.includes("edit-application")?s("CS_PROPERTY_UPDATE_APPLICATION_FAILED"):s("CS_STAKEHOLDER_APPLICATION_FAILED")},dr=e=>{var t,n,i,a,r,u,d,s;const c=(null==e||null===(t=e.data)||void 0===t||null===(n=t.Licenses)||void 0===n||null===(i=n[0])||void 0===i||null===(a=i.tradeLicenseDetail)||void 0===a||null===(r=a.tradeUnits)||void 0===r||null===(u=r[0])||void 0===u||null===(d=u.tradeType)||void 0===d?void 0:d.split(".")[0])||"ARCHITECT";return l.createElement(o.Banner,{message:ur(e),applicationNumber:null===(s=e.data)||void 0===s?void 0:s.Licenses[0].applicationNumber,info:e.isSuccess?`${e.t("TRADELICENSE_TRADETYPE_"+c)} ${e.t("BPA_NEW_STAKEHOLDER_REGISTRATION_APP_LABEL")}`:"",successful:e.isSuccess,style:{padding:"10px"},headerStyles:{fontSize:"32px"}})},sr={OBPSModule:e=>{let{stateCode:t,userType:n,tenants:a}=e;const{path:r}=i.useRouteMatch(),u=Digit.StoreData.getCurrentLanguage(),{isLoading:d}=Digit.Services.useStore({stateCode:t,moduleCode:["bpa","bpareg","common"],language:u});return Digit.SessionStorage.set("OBPS_TENANTS",a),d?l.createElement(o.Loader,null):l.createElement("citizen"===n?jl:Pn,{path:r,stateCode:t})},OBPSLinks:e=>{let{matchPath:t}=e;const{t:i}=n.useTranslation(),a=[{link:t+"/my-applications",i18nKey:i("BPA_CITIZEN_HOME_VIEW_APP_BY_CITIZEN_LABEL")},{link:t+"/stakeholder/apply/stakeholder-docs-required",i18nKey:i("BPA_CITIZEN_HOME_STAKEHOLDER_LOGIN_LABEL")},{link:t+"/home",i18nKey:i("BPA_CITIZEN_HOME_ARCHITECT_LOGIN_LABEL")}];return l.createElement(o.CitizenHomeCard,{header:i("ACTION_TEST_BUILDING_PLAN_APPROVAL"),links:a,Icon:()=>l.createElement(o.OBPSIcon,null),Info:()=>l.createElement(o.CitizenInfoLabel,{style:{margin:"0px",padding:"10px"},info:i("CS_FILE_APPLICATION_INFO_LABEL"),text:i("BPA_CITIZEN_HOME_STAKEHOLDER_INCLUDES_INFO_LABEL")}),isInfo:!0})},OBPSCard:()=>{const[e,a]=t.useState(0),[r,u]=t.useState(0),{t:d}=n.useTranslation(),s=i.useLocation(),c=Digit.ULBService.getCurrentTenantId(),v=Digit.ULBService.getStateId(),p=function(e){var t;void 0===e&&(e=[]);let l=sessionStorage.getItem("Digit.citizen.userRequestObject");const n=l?JSON.parse(l):{};let i=[];return null===(t=e)||void 0===t||t.map(e=>{var t,l,o;null==n||null===(t=n.value)||void 0===t||null===(l=t.info)||void 0===l||null===(o=l.roles)||void 0===o||o.map(t=>{t.code===e.code&&t.tenantId===e.tenantId&&i.push(t)})}),null==i?void 0:i.length}([{code:"BPAREG_DOC_VERIFIER",tenantId:v},{code:"BPAREG_APPROVER",tenantId:v}]),m=function(e){var t;void 0===e&&(e=[]);const l=Digit.UserService.getUser(),n=Digit.ULBService.getCurrentTenantId();let i=[];return null===(t=e)||void 0===t||t.map(e=>{var t,o;null==l||null===(t=l.info)||void 0===t||null===(o=t.roles)||void 0===o||o.map(t=>{t.code==e&&t.tenantId===n&&i.push(t)})}),null==i?void 0:i.length}(["BPA_FIELD_INSPECTOR","BPA_NOC_VERIFIER","BPA_APPROVER","BPA_VERIFIER","CEMP"]),{isLoading:E,data:_}=Digit.Hooks.obps.useBPAInbox({tenantId:c,filters:{filterForm:{moduleName:"BPAREG",applicationStatus:"",locality:[],assignee:"ASSIGNED_TO_ALL"},searchForm:{},tableForm:{sortBy:"",limit:10,offset:0,sortOrder:"DESC"}},config:{enabled:!!p}}),{isLoading:f,data:A}=Digit.Hooks.obps.useBPAInbox({tenantId:c,filters:{filterForm:{moduleName:"bpa-services",applicationStatus:"",locality:[],assignee:"ASSIGNED_TO_ALL",applicationType:[]},searchForm:{},tableForm:{sortBy:"",limit:10,offset:0,sortOrder:"DESC"}},config:{enabled:!!m}});t.useEffect(()=>{f||E||(a((null!=A&&A.totalCount?null==A?void 0:A.totalCount:0)+(null!=_&&_.totalCount?null==_?void 0:_.totalCount:0)),u((null==A?void 0:A.nearingSlaCount)||0+(null==_?void 0:_.nearingSlaCount)||0))},[A,_]),t.useEffect(()=>{"/digit-ui/employee"===s.pathname&&(Digit.SessionStorage.del("OBPS.INBOX"),Digit.SessionStorage.del("STAKEHOLDER.INBOX"))},[s.pathname]);const g=t.useMemo(()=>({Icon:l.createElement(o.OBPSIconSolidBg,null),moduleName:d("MODULE_OBPS"),kpis:[{count:f||E?"":e,label:d("TOTAL_FSM"),link:"/digit-ui/employee/obps/inbox"},{count:f||E?"":r,label:d("TOTAL_NEARING_SLA"),link:"/digit-ui/employee/obps/inbox"}],links:[{count:E?"":null==_?void 0:_.totalCount,label:d("ES_COMMON_STAKEHOLDER_INBOX_LABEL"),link:"/digit-ui/employee/obps/stakeholder-inbox",field:"STAKEHOLDER"},{count:f?"":null==A?void 0:A.totalCount,label:d("ES_COMMON_OBPS_INBOX_LABEL"),link:"/digit-ui/employee/obps/inbox",field:"BPA"},{label:d("ES_COMMON_SEARCH_APPLICATION"),link:"/digit-ui/employee/obps/search/application"}]}),[f,E,_,A,e,r]);return p||(g.links=g.links.filter(e=>"STAKEHOLDER"!==e.field)),m||(g.links=g.links.filter(e=>"BPA"!==e.field)),m||p?l.createElement(o.EmployeeModuleCard,g):null},BPACitizenHomeScreen:e=>{var a,r,u,d;const s=Digit.UserService.getUser(),c=null==s||null===(a=s.info)||void 0===a||null===(r=a.roles)||void 0===r?void 0:r.map(e=>e.code),v=Digit.ULBService.getStateId(),[p,m]=t.useState(!1),{data:E,isLoading:_}=Digit.Hooks.obps.useMDMS(v,"StakeholderRegistraition","TradeTypetoRoleMapping"),[f,A]=t.useState([]),g=Digit.ULBService.getStateId(),{t:S}=n.useTranslation(),h=i.useLocation(),[y,D,T]=Digit.Hooks.useSessionStorage("BPA_HOME_CREATE",{}),{data:b,isLoading:C}=Digit.Hooks.obps.useMDMS(g,"BPA",["homePageUrlLinks"]),[P,N]=t.useState(null),[I,L]=t.useState("-"),[B,O]=t.useState({applicationStatus:[]});window.Digit.Utils.browser.isMobile();const[R,w]=t.useState(0),[x,M]=t.useState(window.Digit.Utils.browser.isMobile()?50:10),[F,k]=t.useState([{id:"createdTime",sortOrder:"DESC"}]),{isLoading:U,data:H}=Digit.Hooks.obps.useArchitectInbox({tenantId:v,moduleName:"bpa-services",businessService:["BPA_LOW","BPA","BPA_OC"],filters:{searchForm:{...B},tableForm:{sortBy:null==F||null===(u=F[0])||void 0===u?void 0:u.id,limit:x,offset:R,sortOrder:null==F||null===(d=F[0])||void 0===d?void 0:d.sortOrder},filterForm:{moduleName:"bpa-services",businessService:[],applicationStatus:null==B?void 0:B.applicationStatus,locality:[],assignee:"ASSIGNED_TO_ALL"}},config:{},withEDCRData:!1}),{isLoading:W,data:{totalCount:G}={}}=Digit.Hooks.obps.useEDCRInbox({tenantId:v,filters:{filterForm:{},searchForm:{},tableForm:{limit:10,offset:0}}});if(t.useEffect(()=>{"/digit-ui/citizen/obps/home"===h.pathname&&(Digit.SessionStorage.del("OBPS.INBOX"),Digit.SessionStorage.del("STAKEHOLDER.INBOX"))},[h.pathname]),t.useEffect(()=>{U||L((null==H?void 0:H.totalCount)||0)},[H]),t.useEffect(()=>{if(!_){var e,t;let l=[];null==E||null===(e=E.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=>{l.push(e)})});const n=null==l?void 0:l.filter((e,t,l)=>l.indexOf(e)===t);let i=!1;null==n||n.map(e=>{null!=c&&c.includes(e)&&!i&&(i=!0)}),i?m(!0):(m(!1),N({key:"true",message:S("BPA_LOGIN_HOME_VALIDATION_MESSAGE_LABEL")}))}},[_]),t.useEffect(()=>{var e,t;if(!C&&(null==b||null===(e=b.BPA)||void 0===e||null===(t=e.homePageUrlLinks)||void 0===t?void 0:t.length)>0){var l,n;let e=[];null==b||null===(l=b.BPA)||void 0===l||null===(n=l.homePageUrlLinks)||void 0===n||n.map(t=>{var l,n,i;e.push({link:`${null==t||null===(l=t.flow)||void 0===l?void 0:l.toLowerCase()}/${null==t||null===(n=t.applicationType)||void 0===n?void 0:n.toLowerCase()}/${null==t||null===(i=t.serviceType)||void 0===i?void 0:i.toLowerCase()}/docs-required`,i18nKey:S(`BPA_HOME_${null==t?void 0:t.applicationType}_${null==t?void 0:t.serviceType}_LABEL`),state:{linkData:t},linkState:!0})}),A(e)}},[!C]),t.useEffect(()=>{T()},[]),Digit.SessionStorage.set("EDCR_BACK","IS_EDCR_BACK"),P)return l.createElement(o.Toast,{error:!0,label:S(null==P?void 0:P.message),isDleteBtn:!0,onClose:()=>{window.location.replace("/digit-ui/citizen/all-services"),N(null)}});if(_||!p||U)return l.createElement(o.Loader,null);const j=[{Icon:l.createElement(o.BPAHomeIcon,null),moduleName:S("ACTION_TEST_BPA_STAKE_HOLDER_HOME"),name:"employeeCard",isCitizen:!0,kpis:[{count:!U&&!W&&I&&G?I+G:"-",label:S("BPA_PDF_TOTAL"),link:"/digit-ui/citizen/obps/bpa/inbox"}],links:[{count:U?"-":I,label:S("ES_COMMON_OBPS_INBOX_LABEL"),link:"/digit-ui/citizen/obps/bpa/inbox"},{count:W?"-":G,label:S("ES_COMMON_EDCR_INBOX_LABEL"),link:"/digit-ui/citizen/obps/edcr/inbox"}],className:"CitizenHomeCard",styles:{padding:"0px",minWidth:"90%",minHeight:"90%"}},{title:S("ACTION_TEST_EDCR_SCRUTINY"),Icon:l.createElement(o.EDCRIcon,{className:"fill-path-primary-main"}),links:[{link:"edcrscrutiny/apply",i18nKey:S("BPA_PLAN_SCRUTINY_FOR_NEW_CONSTRUCTION_LABEL")},{link:"edcrscrutiny/oc-apply",i18nKey:S("BPA_OC_PLAN_SCRUTINY_FOR_NEW_CONSTRUCTION_LABEL")}],styles:{minWidth:"90%",minHeight:"90%"}},{title:S("ACTION_TEST_BPA_STAKE_HOLDER_HOME"),Icon:l.createElement(o.BPAIcon,{className:"fill-path-primary-main"}),links:f,styles:{minWidth:"90%",minHeight:"90%"}}],K=l.createElement("div",{className:"mainContent"},j.map(e=>l.createElement("div",null,"employeeCard"===e.name?l.createElement(o.EmployeeModuleCard,e):l.createElement(o.CitizenHomeCard,{header:e.title,links:e.links,Icon:()=>e.Icon,styles:null==e?void 0:e.styles}))));return sessionStorage.setItem("isPermitApplication",!0),sessionStorage.setItem("isEDCRDisable",JSON.stringify(!1)),K},EDCRForm:e=>{var a;let{t:r,config:u,onSelect:d,formData:s,ownerIndex:c=0,isShowToast:v,isSubmitBtnDisable:p}=e;i.useLocation();const m=i.useHistory(),{approvedCS:E,approvedControlSheetOptions:_,areaType:f,areaTypeOptions:A,cityOptions:g,cluApprove:S,cluApproveOptions:h,coreArea:y,coreAreaOptions:D,error:T,file:b,handleAreaTypeChange:C,handleDXFUpload:P,handleLayoutUpload:N,isFormValid:I,layoutFile:L,layoutMessage:B,name:O,schName:R,schemeArea:w,schemeAreaOptions:x,selectedCity:M,setApprovedCS:F,setCitymoduleList:k,setCluApproved:U,setFile:H,setLayoutFile:W,setName:G,setSchName:j,setSchemeArea:K,setSelectedCity:Y,setSiteReserved:$,setUlb:z,setUploadMessage:V,setUploadedFile:q,setcoreArea:X,siteReserved:J,siteReservedOptions:Z,tenantIdData:Q,ulb:ee,uploadMessage:te,uploadedFile:le}=(e=>{var l,o,a,r,u,d,s,c,v,p,m,E,_,f,A,g,S,h,y,D,T,b,C,P,N,I,L,B,O,R,w;let{formData:x}=e;const M=Digit.ULBService.getStateId(),[F,k]=t.useState([]),[U,H]=t.useState((null==x||null===(l=x.Scrutiny)||void 0===l||null===(o=l[0])||void 0===o?void 0:o.applicantName)||""),[W,G]=t.useState((null==x||null===(a=x.Scrutiny)||void 0===a||null===(r=a[0])||void 0===r?void 0:r.ulbName)||"pb.amritsar"),[j,K]=t.useState((null==x||null===(u=x.Scrutiny)||void 0===u||null===(d=u[0])||void 0===d?void 0:d.areaType)||null),[Y,$]=t.useState((null==x||null===(s=x.Scrutiny)||void 0===s||null===(c=s[0])||void 0===c?void 0:c.schemeName)||""),[z,V]=t.useState((null==x||null===(v=x.Scrutiny)||void 0===v||null===(p=v[0])||void 0===p?void 0:p.schemeType)||null),[q,X]=t.useState((null==x||null===(m=x.Scrutiny)||void 0===m||null===(E=m[0])||void 0===E?void 0:E.isCluApproved)||null),[J,Z]=t.useState(null==x||null===(_=x.Scrutiny)||void 0===_||null===(f=_[0])||void 0===f?void 0:f.coreArea),[Q,ee]=t.useState((null==x||null===(A=x.Scrutiny)||void 0===A||null===(g=A[0])||void 0===g?void 0:g.siteReserved)||null),[te,le]=t.useState((null==x||null===(S=x.Scrutiny)||void 0===S||null===(h=S[0])||void 0===h?void 0:h.approvedControlSheet)||null),[ne,ie]=t.useState((null==x||null===(y=x.Scrutiny)||void 0===y||null===(D=y[0])||void 0===D?void 0:D.tenantIdData)||"pb.amritsar"),[oe,ae]=t.useState(()=>{var e,t,l;return(null==x||null===(e=x.Scrutiny)||void 0===e||null===(t=e[0])||void 0===t||null===(l=t.proofIdentity)||void 0===l?void 0:l.fileStoreId)||null}),[re,ue]=t.useState((null==x||null===(T=x.Scrutiny)||void 0===T||null===(b=T[0])||void 0===b||null===(C=b.proofIdentity)||void 0===C?void 0:C.fileStoreId)||null),[de,se]=t.useState((null==x||null===(P=x.owners)||void 0===P||null===(N=P.documents)||void 0===N?void 0:N.proofIdentity)||null),[ce,ve]=t.useState(null),[pe,me]=t.useState(""),[Ee,_e]=t.useState(""),[fe,Ae]=t.useState(null),[ge,Se]=t.useState(null),[he,ye]=t.useState(()=>({code:"pb.amritsar",displayName:"Amritsar",i18nKey:"TENANT_TENANTS_PB_AMRITSAR",name:"Amritsar"})),De=t.useMemo(()=>(null==he?void 0:he.code)||"pb.amritsar",[he]),{t:Te}=n.useTranslation(),{data:be,isLoading:Ce}=Digit.Hooks.obps.useMDMS(M,"tenant",["citymodule"]),{data:Pe}=Digit.Hooks.useCustomMDMS(M,"BPA",[{name:"EDCRNewBuildingPlanScrutiny"}]),{data:Ne}=Digit.Hooks.useTenants(),Ie=(i.useLocation(),(null==Pe||null===(I=Pe.BPA)||void 0===I||null===(L=I.EDCRNewBuildingPlanScrutiny)||void 0===L?void 0:L[0])||{}),Le=(null==Ie||null===(B=Ie.areaType)||void 0===B?void 0:B.filter(e=>e.active))||[],Be=(null==Ie||null===(O=Ie.schemeArea)||void 0===O?void 0:O.filter(e=>e.active))||[],Oe=(null==Ie||null===(R=Ie.cluApprove)||void 0===R?void 0:R.filter(e=>e.active))||[],Re=(null==Ie||null===(w=Ie.coreArea)||void 0===w?void 0:w.filter(e=>e.active))||[];function we(e){ye(e),console.log("selected city",e)}console.log("FORM DATA -",JSON.stringify(x,null,2)),t.useEffect(()=>{var e,t;if((null==be||null===(e=be.tenant)||void 0===e||null===(t=e.citymodule)||void 0===t?void 0:t.length)>0){var l,n,i,o,a,r,u;const e=null==be||null===(l=be.tenant)||void 0===l||null===(n=l.citymodule)||void 0===n?void 0:n.filter(e=>"BPAAPPLY"===e.code);null==e||null===(i=e[0])||void 0===i||null===(o=i.tenants)||void 0===o||o.forEach(e=>{var t;e.i18nKey="TENANT_TENANTS_"+gt(null==e||null===(t=e.code)||void 0===t?void 0:t.toUpperCase(),".","_")}),Array.isArray(null==e||null===(a=e[0])||void 0===a?void 0:a.tenants)&&(null==e||null===(r=e[0])||void 0===r||r.tenants.reverse());const t=St(null==e||null===(u=e[0])||void 0===u?void 0:u.tenants,"code",Te);k(t)}},[be]),t.useEffect(()=>{if(Ne&&Ne.length>0){const e=Ne.find(e=>"pb.amritsar"===e.code);if(e&&(null==he||!he.displayName)){const t={...e,displayName:Te(e.i18nKey)};ye(t),G(e.code),ie(e.code),console.log("Set default city to:",t)}}},[Ne,Te]),t.useEffect(()=>{var e,t;if(null!=x&&null!==(e=x.Scrutiny)&&void 0!==e&&null!==(t=e[0])&&void 0!==t&&t.ulbName){var l,n;const e=null==x||null===(l=x.Scrutiny)||void 0===l||null===(n=l[0])||void 0===n?void 0:n.ulbName,t=null==Ne?void 0:Ne.find(t=>t.code===e);if(t){const l={...t,displayName:Te(t.i18nKey)};ye(l),G(e),ie(e)}}},[x,Ne,Te]),t.useEffect(()=>{null!=he&&he.code&&(ie(he.code),W&&"pb"!==W||G(he.code))},[he]),t.useMemo(()=>({header:Te("CS_COMMON_CHOOSE_LOCATION"),submitBarLabel:Te("CORE_COMMON_CONTINUE")}),[Te]),t.useMemo(()=>({options:Ne,optionsKey:"i18nKey",additionalWrapperClass:"reverse-radio-selection-wrapper",onSelect:we,selectedOption:he}),[Ne,Te,he]);const xe=null==Ne?void 0:Ne.map(e=>({...e,displayName:Te(e.i18nKey)}));return console.log("Hook state:",{selectedCity:he,ulb:W,tenantIdData:ne,computedTenantId:De}),{approvedCS:te,approvedControlSheetOptions:[{code:"YES",value:"Yes"},{code:"NO",value:"No"}],areaType:j,areaTypeOptions:Le,cityOptions:xe,citymoduleList:F,cluApprove:q,cluApproveOptions:Oe,coreArea:J,coreAreaOptions:Re,dxfFile:ge,error:ce,file:de,getFormData:()=>{const e={applicantName:U,ulbName:W,areaType:j,file:de,tenantId:De};return"SCHEME_AREA"===(null==j?void 0:j.code)?(e.schemeType=z,e.schemeName=Y,e.siteReserved=Q,"YES"===(null==Q?void 0:Q.code)&&(e.approvedControlSheet=te)):(e.isCluApproved=q,e.coreType=J),e},handleAreaTypeChange:e=>{K(e),$(""),V(null),X(null),Z(null)},handleDXFUpload:e=>{ae(e.target.files[0]),se(e.target.files[0]),Se(e.target.files[0])},handleLayoutUpload:e=>{ue(e.target.files[0]),se(e.target.files[0]),Ae(e.target.files[0])},isFormValid:()=>{if(!U||null==he||!he.code||!j)return!1;if("SCHEME_AREA"===(null==j?void 0:j.code)){if(!z||!Y||!Q)return!1;if("YES"===(null==Q?void 0:Q.code)){if(!te)return!1;if("YES"===(null==te?void 0:te.code))return!!fe}return!!ge}return"NON_SCHEME_AREA"!==(null==j?void 0:j.code)||!!q&&!("NO"!==(null==q?void 0:q.code)&&!J)&&!!ge},isLoading:Ce,layoutFile:fe,layoutMessage:Ee,name:U,schName:Y,schemeArea:z,schemeAreaOptions:Be,selectedCity:he,setApprovedCS:le,setCitymoduleList:k,setCluApproved:X,setcoreArea:Z,setError:ve,setFile:se,setLayoutFile:Ae,setLayoutMessage:_e,setName:H,setSchName:$,setSchemeArea:V,setSelectedCity:ye,setSiteReserved:ee,setTenantIdData:ie,setUlb:G,setUploadMessage:me,setUploadedFile:ae,setcoreArea:Z,setSelectLayout:ue,siteReserved:Q,siteReservedOptions:[{code:"YES",value:"Yes"},{code:"NO",value:"No"}],stateId:M,tenantId:De,tenantIdData:ne,ulb:W,uploadMessage:pe,uploadedFile:oe,cities:Ne}})({formData:s});let ne=(null===(a=Digit.SessionStorage.get("CITIZEN.COMMON.HOME.CITY"))||void 0===a?void 0:a.code)||Digit.ULBService.getCurrentTenantId()||"pb.amritsar";const ie=Digit.ULBService.getStateId();console.log(ie,ne,r,"TEN STATE");const{isLoading:oe,data:ae}=Digit.Hooks.obps.useMDMS(ie,"tenant",["citymodule"]);return t.useEffect(()=>{var e,t;if((null==ae||null===(e=ae.tenant)||void 0===e||null===(t=e.citymodule)||void 0===t?void 0:t.length)>0){var l,n,i,o,a,u,d;const e=null==ae||null===(l=ae.tenant)||void 0===l||null===(n=l.citymodule)||void 0===n?void 0:n.filter(e=>"BPAAPPLY"==e.code);null==e||null===(i=e[0])||void 0===i||null===(o=i.tenants)||void 0===o||o.forEach(e=>{var t;e.i18nKey="TENANT_TENANTS_"+gt(null==e||null===(t=e.code)||void 0===t?void 0:t.toUpperCase(),".","_")}),Array.isArray(null==e||null===(a=e[0])||void 0===a?void 0:a.tenants)&&(null==e||null===(u=e[0])||void 0===u||u.tenants.reverse());let t=St(null==e||null===(d=e[0])||void 0===d?void 0:d.tenants,"code",r);k(t)}},[ae]),t.useEffect(()=>{(te||v)&&(G(""),X(""),q(null),H(""),V("")),v&&m.replace("/digit-ui/citizen/obps/edcrscrutiny/apply/acknowledgement",{data:null!=v&&v.label?null==v?void 0:v.label:"BPA_INTERNAL_SERVER_ERROR",type:"ERROR"})},[te,v,p]),oe||p?l.createElement(o.Loader,null):l.createElement(l.Fragment,null,l.createElement(o.FormStep,{config:u,onSelect:()=>{const e={};e.tenantId=Q,e.applicantName=O,e.file=b,e.coreArea=y,e.ulb=ee,e.areaType=f,e.schemeArea=w,e.schName=R,e.siteReserved=J,e.approvedCS=E,e.cluApprove=S,e.layoutFile=L,"SCHEME_AREA"===(null==f?void 0:f.code)?e.coreArea="NO":"NON_SCHEME_AREA"===(null==f?void 0:f.code)&&(e.coreArea=y),d(u.key,e)},onSkip:()=>{V("NEED TO DELETE")},isDisabled:!I(),t:r},l.createElement(o.CardLabel,null,r("EDCR_APPLICANT_NAME")),l.createElement(o.TextInput,{t:r,isMandatory:!0,type:"text",name:"applicantName",value:O,onChange:e=>G(e.target.value)}),l.createElement(o.CardLabel,null,r("EDCR_ULB_NAME")),l.createElement(o.Dropdown,{t:r,isMandatory:!0,option:g,optionKey:"displayName",selected:M,select:e=>{Y(e),z(null==e?void 0:e.code)},placeholder:r("COMMON_TABLE_SEARCH")}),l.createElement(o.CardLabel,null,r("EDCR_SCRUTINY_AREA_TYPE")),l.createElement(o.Dropdown,{t:r,isMandatory:!0,option:A,selected:f,optionKey:"value",select:C}),"SCHEME_AREA"===(null==f?void 0:f.code)&&l.createElement(l.Fragment,null,l.createElement(o.CardLabel,null,r("EDCR_SCRUTINY_SCHEME_AREA_TYPES")),l.createElement(o.Dropdown,{t:r,isMandatory:!0,option:x,selected:w,optionKey:"value",select:K}),l.createElement(o.CardLabel,null,r("EDCR_SCHEME_NAME")),l.createElement(o.TextInput,{t:r,isMandatory:!0,type:"text",name:"schemeName",value:R,onChange:e=>j(e.target.value)}),l.createElement(o.CardLabel,null,r("EDCR_IS_SITE_RESERVED")),l.createElement(o.Dropdown,{t:r,isMandatory:!0,option:Z,selected:J,optionKey:"value",select:$}),"YES"===(null==J?void 0:J.code)&&l.createElement(l.Fragment,null,l.createElement(o.CardLabel,null,r("EDCR_IS_APPROVED_CONTROL_SHEET")),l.createElement(o.Dropdown,{t:r,isMandatory:!0,option:_,selected:E,optionKey:"value",select:F})),"YES"===(null==E?void 0:E.code)&&l.createElement(l.Fragment,null,l.createElement(o.CardLabel,null,r("EDCR_SCRUTINY_SCHEME_UPLOAD_LAYOUT")),l.createElement(o.UploadFile,{id:"edcr-layout",extraStyleName:"propertyCreate",onUpload:N,onDelete:()=>{W(null),H("")},message:L?"1 "+r("PT_ACTION_FILEUPLOADED"):r("ES_NO_FILE_SELECTED_LABEL"),error:T,uploadMessage:B}))),"NON_SCHEME_AREA"===(null==f?void 0:f.code)&&l.createElement(l.Fragment,null,l.createElement(o.CardLabel,null,r("EDCR_SCRUTINY_CLU_APPROVED")),l.createElement(o.Dropdown,{t:r,isMandatory:!0,option:h,selected:S,optionKey:"value",select:U}),"NO"!==(null==S?void 0:S.code)&&l.createElement(l.Fragment,null,l.createElement(o.CardLabel,null,r("EDCR_IS_CORE_AREA")),l.createElement(o.Dropdown,{t:r,isMandatory:!0,option:D,selected:y,optionKey:"value",select:X}))),"YES"!==(null==E?void 0:E.code)&&l.createElement(l.Fragment,null,l.createElement(o.CardLabel,null,r("EDCR_UPLOAD_DXF_FILE")),l.createElement(o.UploadFile,{id:"edcr-doc",extraStyleName:"propertyCreate",onUpload:P,onDelete:()=>{q(null),H("")},message:le?"1 "+r("PT_ACTION_FILEUPLOADED"):r("ES_NO_FILE_SELECTED_LABEL"),error:T,uploadMessage:te}))))},BasicDetails:e=>{var i,a,r,u,d,s,c,v,p,m,E,_;let{formData:f,onSelect:A,config:g}=e;const[S,h]=t.useState(null),[y,D]=t.useState((null==f||null===(i=f.data)||void 0===i?void 0:i.edcrDetails)||null),[T,b]=t.useState(null==f||null===(a=f.data)||void 0===a?void 0:a.scrutinyNumber),[C,P]=t.useState(!(null==f||null===(r=f.data)||void 0===r||!r.scrutinyNumber)),{t:N}=n.useTranslation(),I=Digit.ULBService.getStateId(),L=window.Digit.Utils.browser.isMobile(),{data:B}=Digit.Hooks.obps.useMDMS(I,"BPA",["RiskTypeComputation"]),O=Digit.Utils.obps.calculateRiskType(null==B||null===(u=B.BPA)||void 0===u?void 0:u.RiskTypeComputation,null==y||null===(d=y.planDetail)||void 0===d||null===(s=d.plot)||void 0===s?void 0:s.area,null==y||null===(c=y.planDetail)||void 0===c?void 0:c.blocks);let R=sessionStorage.getItem("isEDCRDisable");if(R=JSON.parse(R),R){let e=sessionStorage.getItem("isEDCRAPIType");e=!!e&&JSON.parse(e),e&&y||(sessionStorage.setItem("isEDCRAPIType",JSON.stringify(!0)),function(){try{Promise.resolve(Ht(null==T?void 0:T.edcrNumber,I)).then(function(e){"ERROR"==(null==e?void 0:e.type)&&(h({message:null==e?void 0:e.message}),D(null)),null!=e&&e.edcrNumber&&(D(e),h(null))})}catch(e){return Promise.reject(e)}}())}return l.createElement("div",null,S&&l.createElement(o.Toast,{error:!0,label:N(""+(null==S?void 0:S.message)),onClose:()=>{h(null)},isDleteBtn:!0}),l.createElement(zl,null),l.createElement("div",{className:L?"obps-search":"",style:L?{}:{margin:"8px"}},l.createElement(o.Label,null,N("OBPS_SEARCH_EDCR_NUMBER")),l.createElement(o.TextInput,{className:"searchInput",onKeyPress:function(e){try{return Promise.resolve(function(){if("Enter"===e.key){if(null==T||!T.edcrNumber)return;return Promise.resolve(Ht(null==T?void 0:T.edcrNumber,I)).then(function(e){"ERROR"==(null==e?void 0:e.type)&&(h({message:null==e?void 0:e.message}),D(null)),null!=e&&e.edcrNumber&&(D(e),h(null))})}}())}catch(e){return Promise.reject(e)}},onChange:e=>b({edcrNumber:e.target.value}),value:null==T?void 0:T.edcrNumber,signature:!0,signatureImg:!R&&l.createElement(o.SearchIconSvg,{className:"signature-img",onClick:!R&&null!=T&&T.edcrNumber?()=>function(e){try{return Promise.resolve(Ht(null==T?void 0:T.edcrNumber,I)).then(function(e){"ERROR"==(null==e?void 0:e.type)&&(h({message:null==e?void 0:e.message}),D(null)),null!=e&&e.edcrNumber&&(D(e),h(null))})}catch(e){return Promise.reject(e)}}():null}),disable:R,style:{marginBottom:"10px"}})),y&&l.createElement(o.Card,null,l.createElement(o.CardCaption,null,N("BPA_SCRUTINY_DETAILS")),l.createElement(o.CardHeader,null,N("BPA_BASIC_DETAILS_TITLE")),l.createElement(o.StatusTable,null,l.createElement(o.Row,{className:"border-none",label:N("BPA_BASIC_DETAILS_APP_DATE_LABEL"),text:null!=y&&y.applicationDate?Hl(new Date(null==y?void 0:y.applicationDate),"dd/MM/yyyy"):null==y?void 0:y.applicationDate}),l.createElement(o.Row,{className:"border-none",label:N("BPA_BASIC_DETAILS_APPLICATION_TYPE_LABEL"),text:N("WF_BPA_"+(null==y?void 0:y.appliactionType))}),l.createElement(o.Row,{className:"border-none",label:N("BPA_BASIC_DETAILS_SERVICE_TYPE_LABEL"),text:N(null==y?void 0:y.applicationSubType)}),l.createElement(o.Row,{className:"border-none",label:N("BPA_BASIC_DETAILS_OCCUPANCY_LABEL"),text:null==y||null===(v=y.planDetail)||void 0===v||null===(p=v.planInformation)||void 0===p?void 0:p.occupancy}),l.createElement(o.Row,{className:"border-none",label:N("BPA_BASIC_DETAILS_RISK_TYPE_LABEL"),text:N("WF_BPA_"+O)}),l.createElement(o.Row,{className:"border-none",label:N("BPA_BASIC_DETAILS_APPLICATION_NAME_LABEL"),text:null==y||null===(m=y.planDetail)||void 0===m||null===(E=m.planInformation)||void 0===E?void 0:E.applicantName})),O?l.createElement(o.SubmitBar,{label:N("CS_COMMON_NEXT"),onSubmit:e=>{var t,l,n,i,o,a,r,u;A(null==g?void 0:g.key,{scrutinyNumber:T,applicantName:null==y||null===(t=y.planDetail)||void 0===t||null===(l=t.planInformation)||void 0===l?void 0:l.applicantName,occupancyType:null==y||null===(n=y.planDetail)||void 0===n||null===(i=n.planInformation)||void 0===i?void 0:i.occupancy,applicationType:null==y?void 0:y.appliactionType,serviceType:null==y?void 0:y.applicationSubType,applicationDate:null==y?void 0:y.applicationDate,riskType:Digit.Utils.obps.calculateRiskType(null==B||null===(o=B.BPA)||void 0===o?void 0:o.RiskTypeComputation,null==y||null===(a=y.planDetail)||void 0===a||null===(r=a.plot)||void 0===r?void 0:r.area,null==y||null===(u=y.planDetail)||void 0===u?void 0:u.blocks),edcrDetails:y})},disabled:!(null!=T&&null!==(_=T.edcrNumber)&&void 0!==_&&_.length)}):l.createElement(o.Loader,null)))},DocsRequired:e=>{var a,r;let{onSelect:u}=e;const{t:d}=n.useTranslation(),s=Digit.ULBService.getCurrentTenantId(),c=Digit.ULBService.getStateId(),[v,p]=(i.useHistory(),i.useParams(),t.useState([])),[m,E]=t.useState([]),{data:_,isLoading:f}=Digit.Hooks.obps.useMDMS(c,"BPA","DocumentTypes"),{data:A}=Digit.Hooks.obps.useMDMS(c,"common-masters",["DocumentType"]),g=(Digit.Hooks.obps.useMDMS(c,"BPA",["RiskTypeComputation"]),Digit.UserService.getUser()),S={0:{tenantId:c},1:{id:null==g||null===(a=g.info)||void 0===a?void 0:a.id}},{data:h}=Digit.Hooks.obps.useBPAREGSearch(s,S),y=window.location.href.includes("ocbpa");sessionStorage.removeItem("clickOnBPAApplyAfterEDCR");const{data:D,isLoading:T}=Digit.Hooks.obps.useMDMS(c,"BPA",["homePageUrlLinks"]);return t.useEffect(()=>{let e,t="",l="",n="",i="",o=!0;for(let N=0;N<(null==h||null===(a=h.Licenses)||void 0===a?void 0:a.length);N++){var a,r,u,d,s,c,v,p,m,E,_,f,A,g,S,y,D,T,b,C,P;"APPROVED"===(null==h||null===(r=h.Licenses)||void 0===r||null===(u=r[N])||void 0===u?void 0:u.status)&&o&&(o=!1,t=(null==h||null===(d=h.Licenses)||void 0===d||null===(s=d[N])||void 0===s||null===(c=s.tradeLicenseDetail)||void 0===c||null===(v=c.tradeUnits)||void 0===v||null===(p=v[0])||void 0===p||null===(m=p.tradeType)||void 0===m?void 0:m.split(".")[0])||"ARCHITECT",l=null==h||null===(E=h.Licenses)||void 0===E||null===(_=E[N])||void 0===_?void 0:_.applicationNumber,n=null==h||null===(f=h.Licenses)||void 0===f||null===(A=f[N])||void 0===A||null===(g=A.tradeLicenseDetail)||void 0===g||null===(S=g.owners[0])||void 0===S?void 0:S.name,i=null==h||null===(y=h.Licenses)||void 0===y||null===(D=y[N])||void 0===D||null===(T=D.tradeLicenseDetail)||void 0===T||null===(b=T.owners[0])||void 0===b?void 0:b.permanentAddress,sessionStorage.setItem("BPA_ARCHITECT_NAME",JSON.stringify(t)),sessionStorage.setItem("BPA_STAKEHOLDER_REGISTRATION_NUMBER",JSON.stringify(l)),sessionStorage.setItem("BPA_STAKEHOLDER_NAME",JSON.stringify(n)),sessionStorage.setItem("BPA_STAKEHOLDER_ADDRESS",JSON.stringify(i)),e=null==h||null===(C=h.Licenses)||void 0===C||null===(P=C[N])||void 0===P?void 0:P.tradeLicenseDetail.additionalDetail.isSelfCertificationRequired,sessionStorage.setItem("isSelfCertificationRequired",JSON.stringify(e)))}},[h]),t.useEffect(()=>{if(!T){var e,t;const l=window.location.href.split("/"),n=l[l.length-2],i=l[l.length-3];null==D||null===(e=D.BPA)||void 0===e||null===(t=e.homePageUrlLinks)||void 0===t||t.map(e=>{(null==i?void 0:i.toUpperCase())===(null==e?void 0:e.applicationType)&&(null==n?void 0:n.toUpperCase())===(null==e?void 0:e.serviceType)&&E({flow:null==e?void 0:e.flow,applicationType:null==e?void 0:e.applicationType,serviceType:null==e?void 0:e.serviceType})})}},[!T]),t.useEffect(()=>{if(!f){let e=[],t=[];const l=window.location.href.split("/"),n=l[l.length-2],i=l[l.length-3];for(let t=0;t<_.length;t++)e[_[t].applicationType]||e[_[t].ServiceType]||(e[_[t].applicationType]=_[t]);Object.values(e).map(e=>{var l;(null==e?void 0:e.applicationType)==(null==i?void 0:i.toUpperCase())&&(null==e?void 0:e.ServiceType)==(null==n?void 0:n.toUpperCase())&&t.push(null==e?void 0:e.docTypes),null==t||null===(l=t[0])||void 0===l||l.forEach(e=>{var t,l;let n=e.code;e.dropdownData=[],null==A||null===(t=A["common-masters"])||void 0===t||null===(l=t.DocumentType)||void 0===l||l.forEach(t=>{let l=t.code.slice(0,n.length);n===l&&(e.hasDropdown=!0,t.i18nKey=t.code,e.dropdownData.push(t))})}),p(t)})}},[!f]),f?l.createElement(o.Loader,null):l.createElement(t.Fragment,null,l.createElement(o.Card,null,l.createElement(o.CardHeader,null,d(y?"BPA_OOCUPANCY_CERTIFICATE_APP_LABEL":"OBPS_NEW_BUILDING_PERMIT")),l.createElement(o.CardText,{style:{color:"#0B0C0C",marginTop:"12px",fontSize:"16px",fontWeight:"400",lineHeight:"24px"}},d("OBPS_NEW_BUILDING_PERMIT_DESCRIPTION")),f?l.createElement(o.Loader,null):l.createElement(t.Fragment,null,null==v||null===(r=v[0])||void 0===r?void 0:r.map((e,t)=>{var n;return l.createElement("div",null,l.createElement("div",{style:{fontWeight:700,marginBottom:"8px"},key:t},l.createElement("div",{style:{display:"flex"}},l.createElement("div",null,t+1+"."," "),l.createElement("div",null," "+d(null==e?void 0:e.code.replace(".","_"))))),l.createElement("div",{style:{marginBottom:"16px"}},null==e||null===(n=e.dropdownData)||void 0===n?void 0:n.map((t,n)=>{var i;return(null==e||null===(i=e.dropdownData)||void 0===i?void 0:i.length)!==n+1?l.createElement("span",null,d(null==t?void 0:t.i18nKey)+", "):l.createElement("span",null,""+d(null==t?void 0:t.i18nKey))})))})),l.createElement(o.SubmitBar,{label:d("CS_COMMON_NEXT"),onSubmit:()=>{if(null!==JSON.parse(sessionStorage.getItem("BPAintermediateValue"))){let e=JSON.parse(sessionStorage.getItem("BPAintermediateValue"));sessionStorage.setItem("BPAintermediateValue",null),u("",e)}else u("uiFlow",m)}})),l.createElement(o.CitizenInfoLabel,{info:d("CS_FILE_APPLICATION_INFO_LABEL"),text:d("OBPS_DOCS_FILE_SIZE"),className:"info-banner-wrap-citizen-override"}))},PlotDetails:e=>{var i,a,r,u,d,s,c,v,p,m,E,_;let{formData:f,onSelect:A,config:g}=e;const S=window.location.href.includes("editApplication"),[h,y]=t.useState(g),{t:D}=n.useTranslation(),[T,b]=t.useState(""),[C,P]=t.useState(""),[N,I]=t.useState(""),[L,B]=t.useState(""),[O,R]=t.useState(""),[w,x]=t.useState(""),[M,F]=t.useState(""),[k,U]=t.useState(""),[H,W]=t.useState(""),[G,j]=t.useState(""),[K,Y]=t.useState(""),[$,z]=t.useState(""),[V,q]=t.useState(""),[X,J]=t.useState(""),[Z,Q]=t.useState(""),[ee,te]=t.useState(""),le=(Digit.ULBService.getCurrentTenantId(),null==f||null===(i=f.uiFlow)||void 0===i?void 0:i.flow),ne=Digit.ULBService.getStateId();t.useEffect(()=>{if(S){const e={...g,inputs:g.inputs.map(e=>"boundaryWallLength"===e.name?{...e,disable:!0}:e)};y(e)}},[le,S]),t.useEffect(()=>{const e=window.localStorage.getItem("user-info");if(e)try{const t=JSON.parse(e);null!=t&&t.id&&x(t.id)}catch(e){console.error("Error parsing user-info from local storage",e)}},[]);const{data:ie,isLoading:oe}=Digit.Hooks.obps.useScrutinyDetails(ne,null==f||null===(a=f.data)||void 0===a?void 0:a.scrutinyNumber);if(oe)return l.createElement(o.Loader,null);const ae={khasraNumber:null==ie||null===(r=ie.planDetail)||void 0===r||null===(u=r.planInfoProperties)||void 0===u?void 0:u.KHASRA_NO,architectid:w,...null==f?void 0:f.data};return l.createElement("div",null,l.createElement(zl,{flow:"OCBPA"===le?"OCBPA":""}),l.createElement(o.FormStep,{config:h,onSelect:e=>{A(null==h?void 0:h.key,{...e})},childrenAtTheBottom:!1,t:D,_defaultValues:ae,onSkip:()=>A()},l.createElement(o.StatusTable,null,l.createElement(o.Row,{className:"border-none",label:D("BPA_BOUNDARY_PLOT_AREA_LABEL"),text:null!=ie&&null!==(d=ie.planDetail)&&void 0!==d&&null!==(s=d.planInformation)&&void 0!==s&&s.plotArea?`${null==ie||null===(c=ie.planDetail)||void 0===c||null===(v=c.planInformation)||void 0===v?void 0:v.plotArea} ${D("BPA_SQ_MTRS_LABEL")}`:"NA"}),l.createElement(o.Row,{className:"border-none",label:D("BPA_PLOT_NUMBER_LABEL"),text:null==ie||null===(p=ie.planDetail)||void 0===p||null===(m=p.planInformation)||void 0===m?void 0:m.plotNo}),l.createElement(o.Row,{className:"border-none",label:D("BPA_KHATHA_NUMBER_LABEL"),text:null==ie||null===(E=ie.planDetail)||void 0===E||null===(_=E.planInfoProperties)||void 0===_?void 0:_.KHATA_NO}))))},ScrutinyDetails:e=>{var a,r,u,d,s,c,v,p,m,E,_,f,A,g,S,h,y,D,T,b,C,P,N,I,L,B,O,R,w,x,M;let{onSelect:F,formData:k,config:U}=e;const{t:H}=n.useTranslation(),[W,G]=(i.useHistory(),t.useState([])),[j,K]=t.useState((null==k?void 0:k.subOccupancy)||(null==k||null===(a=k.landInfo)||void 0===a?void 0:a.unit)||{}),[Y,$]=t.useState([]),[z,V]=t.useState([]);let q=Digit.UserService.getUser();const X=(null==q||null===(r=q.info)||void 0===r?void 0:r.permanentCity)||Digit.ULBService.getCurrentTenantId(),J=null==k||null===(u=k.uiFlow)||void 0===u?void 0:u.flow,[Z,Q]=t.useState(null),ee=Digit.ULBService.getStateId(),{isMdmsLoading:te,data:le}=Digit.Hooks.obps.useMDMS(ee,"BPA",["SubOccupancyType"]),{data:ne}=Digit.Hooks.obps.useScrutinyDetails(X,null==k||null===(d=k.data)||void 0===d?void 0:d.scrutinyNumber,{enabled:!0});function ie(e){var t,l;let n=[];return null==e||null===(t=e.building)||void 0===t||null===(l=t.floors)||void 0===l||l.map(e=>{var t,l,i,o,a,r,u,d;n.push({Floor:H("BPA_FLOOR_NAME_"+e.number),Level:e.number,Occupancy:H(""+(null===(t=e.occupancies)||void 0===t||null===(l=t[0])||void 0===l?void 0:l.type)),BuildupArea:null===(i=e.occupancies)||void 0===i||null===(o=i[0])||void 0===o?void 0:o.builtUpArea,FloorArea:(null===(a=e.occupancies)||void 0===a||null===(r=a[0])||void 0===r?void 0:r.floorArea)||0,CarpetArea:(null===(u=e.occupancies)||void 0===u||null===(d=u[0])||void 0===d?void 0:d.CarpetArea)||0,key:H("BPA_FLOOR_NAME_"+e.number)})}),n}function oe(){var e,t;let l=[];return null==le||null===(e=le.BPA)||void 0===e||null===(t=e.SubOccupancyType)||void 0===t||t.map(e=>{var t;l.push({code:e.code,name:e.name,i18nKey:"BPA_SUBOCCUPANCYTYPE_"+gt(null==e||null===(t=e.code)||void 0===t?void 0:t.toUpperCase(),"-","_")})}),Digit.Utils.locale.sortDropdownNames(l,"i18nKey",H)}t.useEffect(()=>{var e;if(!te&&null!=k&&null!==(e=k.data)&&void 0!==e&&e.occupancyType){var t;const e=((null==le||null===(t=le.BPA)||void 0===t?void 0:t.SubOccupancyType)||[]).find(e=>{var t;return(null===(t=e.name)||void 0===t?void 0:t.toLowerCase())===k.data.occupancyType.toLowerCase()});if(e){const t={code:e.code,name:e.name,i18nKey:"BPA_SUBOCCUPANCYTYPE_"+gt(e.code.toUpperCase(),"-","_")};K({Block_1:[t]})}}},[null==k||null===(s=k.data)||void 0===s?void 0:s.occupancyType,le,te]);const ae=e=>{let{label:t,jumpTo:a}=e;const{t:r}=n.useTranslation();return i.useHistory(),l.createElement(o.LinkButton,{label:r(t),onClick:function(){location.href=a}})},re=[{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"}],ue=e=>{const t=e;return(e,l,n)=>e[t]},de=t.useMemo(()=>null==re?void 0:re.map(e=>({Header:H(""+e.name),accessor:ue(e.id),id:e.id})));function se(e){var t,l,n,i,o;let a=null==k||null===(t=k.data)||void 0===t||null===(l=t.bpaData)||void 0===l||null===(n=l.bpaApprovalResponse)||void 0===n||null===(i=n[0])||void 0===i||null===(o=i.landInfo)||void 0===o?void 0:o.unit,r="";if((null==a?void 0:a.length)>0){var u,d;let t=null===(u=a[e])||void 0===u||null===(d=u.usageCategory)||void 0===d?void 0:d.split(",");null!=t&&t.length&&(r=(null==t?void 0:t.map(e=>e?""+H("BPA_SUBOCCUPANCYTYPE_"+gt(null==e?void 0:e.toUpperCase(),"-","_")):"NA")).join(", "))}return r||"NA"}return console.log(k,"F++++++"),te?l.createElement(o.Loader,null):l.createElement(l.Fragment,null,l.createElement(zl,{currentStep:"OCBPA"===J?2:1,flow:"OCBPA"===J?"OCBPA":""}),l.createElement(o.FormStep,{t:H,config:U,onSelect:()=>{if("OCBPA"===J)if(null!=k&&k.id)F("",k,"",!0);else{var e,t,l,n,i,o,a,r,u,d,s,c,v,p,m,E,_,f,A,g,S,h,y,D,T;let b={};b.edcrNumber=null!=k&&null!==(e=k.edcrNumber)&&void 0!==e&&e.edcrNumber?null==k||null===(t=k.edcrNumber)||void 0===t?void 0:t.edcrNumber:null==k||null===(l=k.data)||void 0===l||null===(n=l.scrutinyNumber)||void 0===n?void 0:n.edcrNumber,b.riskType=null==k||null===(i=k.data)||void 0===i?void 0:i.riskType,b.applicationType=null==k||null===(o=k.data)||void 0===o?void 0:o.applicationType,b.serviceType=null==k||null===(a=k.data)||void 0===a?void 0:a.serviceType;const C=Digit.UserService.getUser(),P=null==C||null===(r=C.info)||void 0===r?void 0:r.uuid;b.tenantId=null==k||null===(u=k.data)||void 0===u||null===(d=u.bpaData)||void 0===d||null===(s=d.bpaApprovalResponse)||void 0===s||null===(c=s[0])||void 0===c||null===(v=c.landInfo)||void 0===v?void 0:v.tenantId,b.workflow={action:"INITIATE",assignes:[null==C||null===(p=C.info)||void 0===p?void 0:p.uuid]},b.accountId=P,b.documents=null,b.additionalDetails={},null!=k&&null!==(m=k.data)&&void 0!==m&&m.holdingNumber&&(b.additionalDetails.holdingNo=null==k||null===(E=k.data)||void 0===E?void 0:E.holdingNumber),null!=k&&null!==(_=k.data)&&void 0!==_&&_.registrationDetails&&(b.additionalDetails.registrationDetails=null==k||null===(f=k.data)||void 0===f?void 0:f.registrationDetails),null!=k&&null!==(A=k.data)&&void 0!==A&&A.applicationType&&(b.additionalDetails.applicationType=null==k||null===(g=k.data)||void 0===g?void 0:g.applicationType),null!=k&&null!==(S=k.data)&&void 0!==S&&S.serviceType&&(b.additionalDetails.serviceType=null==k||null===(h=k.data)||void 0===h?void 0:h.serviceType),b.landInfo=(null==k||null===(y=k.data)||void 0===y||null===(D=y.bpaData)||void 0===D||null===(T=D.bpaApprovalResponse)||void 0===T?void 0:T[0].landInfo)||{};let N=sessionStorage.getItem("BPA_ARCHITECT_NAME"),I=N?JSON.parse(N):"ARCHITECT";b.additionalDetails.typeOfArchitect=I,Digit.OBPSService.create({BPA:b},X).then((e,t)=>{var l;(null==e||null===(l=e.BPA)||void 0===l?void 0:l.length)>0&&(e.BPA[0].data=k.data,e.BPA[0].uiFlow=null==k?void 0:k.uiFlow,F("",e.BPA[0],"",!0))}).catch(e=>{var t,l,n;Q({key:"true",message:(null==e||null===(t=e.response)||void 0===t||null===(l=t.data)||void 0===l||null===(n=l.Errors[0])||void 0===n?void 0:n.message)||null})})}else F(U.key,j)},onSkip:()=>F()},l.createElement(o.CardSubHeader,{style:{fontSize:"20px"}},H("BPA_EDCR_DETAILS")),l.createElement(o.StatusTable,{style:{border:"none"}},l.createElement(o.Row,{className:"border-none",style:{border:"none"},label:H("OCBPA"===J?"BPA_OC_EDCR_NO_LABEL":"BPA_EDCR_NO_LABEL"),text:null==ne?void 0:ne.edcrNumber,labelStyle:{wordBreak:"break-all"},textStyle:{wordBreak:"break-all"}}),l.createElement(o.Row,{className:"border-none",label:H("BPA_UPLOADED_PLAN_DIAGRAM"),text:l.createElement(ae,{label:H("Uploaded Plan.pdf"),jumpTo:null==ne?void 0:ne.updatedDxfFile,onClick:()=>{console.log("")}})}),l.createElement(o.Row,{className:"border-none",label:H("BPA_SCRUNTINY_REPORT_OUTPUT"),text:l.createElement(ae,{label:H("BPA_SCRUTINY_REPORT_PDF"),jumpTo:null==ne?void 0:ne.planReport,onClick:()=>{console.log("")}})})),l.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",height:"2px",marginTop:"20px",marginBottom:"20px"}}),l.createElement(o.CardSubHeader,{style:{fontSize:"20px"}},H("OCBPA"===J?"BPA_ACTUAL_BUILDING_EXTRACT_HEADER":"BPA_BUILDING_EXTRACT_HEADER")),l.createElement(o.StatusTable,{style:{border:"none"}},l.createElement(o.Row,{className:"border-none",label:H("BPA_TOTAL_BUILT_UP_AREA_HEADER"),text:null!=ne&&null!==(c=ne.planDetail)&&void 0!==c&&null!==(v=c.blocks)&&void 0!==v&&null!==(p=v[0])&&void 0!==p&&null!==(m=p.building)&&void 0!==m&&m.totalBuitUpArea?`${null==ne||null===(E=ne.planDetail)||void 0===E||null===(_=E.blocks)||void 0===_||null===(f=_[0])||void 0===f||null===(A=f.building)||void 0===A?void 0:A.totalBuitUpArea} ${H("BPA_SQ_MTRS_LABEL")}`:H("NA")}),l.createElement(o.Row,{className:"border-none",label:H("BPA_SCRUTINY_DETAILS_NUMBER_OF_FLOORS_LABEL"),text:null==ne||null===(g=ne.planDetail)||void 0===g||null===(S=g.blocks)||void 0===S||null===(h=S[0])||void 0===h||null===(y=h.building)||void 0===y?void 0:y.totalFloors}),l.createElement(o.Row,{className:"border-none",label:H("BPA_HEIGHT_FROM_GROUND_LEVEL_FROM_MUMTY"),text:null!=ne&&null!==(D=ne.planDetail)&&void 0!==D&&null!==(T=D.blocks)&&void 0!==T&&null!==(b=T[0])&&void 0!==b&&null!==(C=b.building)&&void 0!==C&&C.declaredBuildingHeight?`${null==ne||null===(P=ne.planDetail)||void 0===P||null===(N=P.blocks)||void 0===N||null===(I=N[0])||void 0===I||null===(L=I.building)||void 0===L?void 0:L.declaredBuildingHeight} ${H("BPA_MTRS_LABEL")}`:H("NA")})),l.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",height:"2px",marginTop:"20px",marginBottom:"20px"}}),l.createElement(o.CardSubHeader,{style:{fontSize:"20px"}},H("BPA_OCC_SUBOCC_HEADER")),null==ne||null===(B=ne.planDetail)||void 0===B||null===(O=B.blocks)||void 0===O?void 0:O.map((e,t)=>{var n;return l.createElement("div",{key:t,style:{marginTop:"20px"}},l.createElement(o.CardSubHeader,{style:{fontSize:"18px"}},H("BPA_BLOCK_SUBHEADER")," ",t+1),"OCBPA"!==J?l.createElement(o.CardSectionHeader,{style:{fontWeight:"normal"},className:"card-label-smaller"},H("BPA_SUB_OCCUPANCY_LABEL")):null,"OCBPA"!==J?l.createElement(o.MultiSelectDropdown,{BlockNumber:e.number,className:"form-field",isMandatory:!0,defaultUnit:"Selected",selected:j["Block_"+e.number],options:oe(),onSelect:t=>((e,t,l)=>{let n=j,i=[];e&&(null==e||e.map(e=>{i.push(null==e?void 0:e[1])})),n["Block_"+l]=i,G(i),K(n)})(t,0,e.number),isOBPSMultiple:!0,optionsKey:"i18nKey",ServerStyle:{width:"100%",overflowX:"hidden"},t:H}):null,"OCBPA"!==J?l.createElement("div",{className:"tag-container"},j["Block_"+e.number]&&j["Block_"+e.number].length>0&&(null===(n=j["Block_"+e.number])||void 0===n?void 0:n.map((t,n)=>l.createElement(o.RemoveableTag,{key:n,text:""+H(t.i18nKey),onClick:()=>((e,t,l)=>{let n=j["Block_"+l].filter((t,l)=>l!==e);G(n);let i=j;i["Block_"+l]=n,K(i)})(n,0,e.number)})))):null,"OCBPA"!==J?j["Block_"+e.number]&&j["Block_"+e.number].length>0&&l.createElement(o.LinkButton,{style:{textAlign:"left"},label:"Clear All",onClick:()=>(e=>{let t=[],l=j;l["Block_"+e]=t,G(t),K(l)})(e.number)}):null,l.createElement("div",{style:{marginTop:"20px"}},"OCBPA"===J?l.createElement(o.StatusTable,null,l.createElement(o.Row,{className:"border-none",label:""+H("BPA_SUB_OCCUPANCY_LABEL"),text:se(t)})):null,l.createElement("div",{style:{overflowX:"scroll"}},l.createElement(o.Table,{className:"customTable table-fixed-first-column table-border-style",t:H,disableSort:!1,autoSort:!0,manualPagination:!1,isPaginationRequired:!1,initSortId:"S N ",data:ie(e),columns:de,getCellProps:e=>({style:{}})}))))}),l.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",height:"2px",marginTop:"20px",marginBottom:"20px"}}),l.createElement(o.CardSubHeader,{style:{fontSize:"20px"}},H("BPA_APP_DETAILS_DEMOLITION_DETAILS_LABEL")),l.createElement(o.StatusTable,{style:{border:"none"}},l.createElement(o.Row,{label:H("BPA_APPLICATION_DEMOLITION_AREA_LABEL"),text:null!=ne&&null!==(R=ne.planDetail)&&void 0!==R&&null!==(w=R.planInformation)&&void 0!==w&&w.demolitionArea?`${null==ne||null===(x=ne.planDetail)||void 0===x||null===(M=x.planInformation)||void 0===M?void 0:M.demolitionArea} ${H("BPA_SQ_MTRS_LABEL")}`:H("CS_NA")}))),Z&&l.createElement(o.Toast,{error:!0,label:H(null==Z?void 0:Z.message),isDleteBtn:!0,onClose:()=>{Q(null)}}))},BPANewBuildingdetails:e=>{var n,r,u,d,c,v,p,E,_,f,A,g,S,h,y,D,T,b,C;let{t:P,config:N,onSelect:I,formData:L}=e;i.useLocation();let B=window.location.href.charAt(window.location.href.length-1),O={};const[R,w]=t.useState((null==L||null===(n=L.owners)||void 0===n?void 0:n.approvedColony)||""),[x,M]=t.useState((null==L||null===(r=L.owners)||void 0===r?void 0:r.masterPlan)||""),[F,k]=t.useState((null==L||null===(u=L.owners)||void 0===u?void 0:u.UlbName)||""),[U,H]=t.useState((null==L||null===(d=L.owners)||void 0===d?void 0:d.buildingStatus)||""),[W,G]=t.useState((null==L||null===(c=L.owners)||void 0===c?void 0:c.schemes)||""),[j,K]=t.useState((null==L||null===(v=L.owners)||void 0===v?void 0:v.purchasedFAR)||""),[Y,$]=t.useState((null==L||null===(p=L.owners)||void 0===p?void 0:p.greenbuilding)||""),[z,V]=t.useState((null==L||null===(E=L.owners)||void 0===E?void 0:E.restrictedArea)||""),[q,X]=t.useState((null==L||null===(_=L.owners)||void 0===_?void 0:_.District)||""),[J,Z]=t.useState((null==L||null===(f=L.owners)||void 0===f?void 0:f.proposedSite)||""),[Q,ee]=t.useState((null==L||null===(A=L.owners)||void 0===A?void 0:A.nameofApprovedcolony)||""),[te,le]=t.useState((null==L||null===(g=L.owners)||void 0===g?void 0:g.NocNumber)||""),[ne,ie]=t.useState((null==L||null===(S=L.owners)||void 0===S?void 0:S.schemesselection)||""),[oe,ae]=t.useState((null==L||null===(h=L.owners)||void 0===h?void 0:h.schemeName)||""),[re,ue]=t.useState("Pre-Approved Standard Designs"),[de,se]=t.useState((null==L||null===(y=L.owners)||void 0===y?void 0:y.rating)||""),[ce,ve]=t.useState((null==L||null===(D=L.owners)||void 0===D?void 0:D.use)||""),[pe,me]=t.useState((null==L||null===(T=L.owners)||void 0===T?void 0:T.Ulblisttype)||""),[Ee,_e]=t.useState(null==L||null===(b=L.owners)||void 0===b?void 0:b.uploadedFile),[fe,Ae]=t.useState(null==L||null===(C=L.owners)||void 0===C?void 0:C.greenuploadedFile),[ge,Se]=t.useState(),[he,ye]=t.useState(),[De,Te]=t.useState(null),[be,Ce]=t.useState("");Digit.Utils.browser.isMobile(),t.useEffect(()=>{!function(){try{Te(null);const e=function(){if(he&&null!=he&&he.type){const e=function(e,t,l){if(null!==(e=".pdf".split(","))&&void 0!==e&&e.includes("."+(null==he||null===(t=he.type)||void 0===t||null===(l=t.split("/"))||void 0===l?void 0:l.pop()))){const e=function(){if(he.size>=2e6)Te(P("PT_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=m(function(){return Promise.resolve(Digit.UploadServices.Filestorage("property-upload",he,Digit.ULBService.getStateId())).then(function(e){var t,l,n,i;(null==e||null===(t=e.data)||void 0===t||null===(l=t.files)||void 0===l?void 0:l.length)>0?_e(null==e||null===(n=e.data)||void 0===n||null===(i=n.files[0])||void 0===i?void 0:i.fileStoreId):Te(P("PT_FILE_UPLOAD_ERROR"))})},function(){});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}else Te(P("PT_UPLOAD_FORMAT_NOT_SUPPORTED"))}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[he]),t.useEffect(()=>{!function(){try{Te(null);const e=function(){if(ge&&null!=ge&&ge.type){const e=function(e,t,l){if(null!==(e=".pdf".split(","))&&void 0!==e&&e.includes("."+(null==ge||null===(t=ge.type)||void 0===t||null===(l=t.split("/"))||void 0===l?void 0:l.pop()))){const e=function(){if(ge.size>=2e6)Te(P("PT_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=m(function(){return Promise.resolve(Digit.UploadServices.Filestorage("property-upload",ge,Digit.ULBService.getStateId())).then(function(e){var t,l,n,i;(null==e||null===(t=e.data)||void 0===t||null===(l=t.files)||void 0===l?void 0:l.length)>0?Ae(null==e||null===(n=e.data)||void 0===n||null===(i=n.files[0])||void 0===i?void 0:i.fileStoreId):Te(P("PT_FILE_UPLOAD_ERROR"))})},function(){});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}else Te(P("PT_UPLOAD_FORMAT_NOT_SUPPORTED"))}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[ge]);const Pe=[{code:"YES",i18nKey:"YES"},{code:"NO",i18nKey:"NO"},{code:"LAL_LAKEER",i18nKey:"LAL LAKEER"}],Ne=[{code:"YES",i18nKey:"YES"},{code:"NO",i18nKey:"NO"}],Ie=[{code:"PROPOSED",i18nKey:"Proposed"}],Le=Digit.ULBService.getStateId(),{data:Be}=Digit.Hooks.obps.useUlbType(Le,"BPA","UlbType"),{data:Oe}=Digit.Hooks.obps.useDistricts(Le,"BPA","Districts"),{data:Re}=Digit.Hooks.obps.useULBList(Le,"BPA","Ulb");let we=[],xe=[],Me=[];Be&&Be.map(e=>{(null==e?void 0:e.Districts)===(null==F?void 0:F.code)&&we.push({i18nKey:""+e.name,code:""+e.code,value:""+e.name})}),Oe&&Oe.map(e=>{xe.push({i18nKey:""+e.name,code:""+e.code,value:""+e.name})}),Re&&Re.map(e=>{e.Districts==(null==F?void 0:F.code)&&Me.push({i18nKey:""+e.name,code:""+e.code,value:""+e.name})});const{data:Fe}=Digit.Hooks.useCustomMDMS(Digit.ULBService.getStateId(),"BPA",[{name:"BuildingStatus"}],{select:e=>{var t;return null==e||null===(t=e.BPA)||void 0===t?void 0:t.BuildingStatus}});let ke=[];Fe&&Fe.map(e=>{ke.push({i18nKey:"BPA_"+e.code,code:""+e.code,value:""+e.name})});const{data:Ue}=Digit.Hooks.useCustomMDMS(Digit.ULBService.getStateId(),"BPA",[{name:"RatingValue"}],{select:e=>{var t;return null==e||null===(t=e.BPA)||void 0===t?void 0:t.RatingValue}});let He=[];Ue&&Ue.map(e=>{He.push({i18nKey:"BPA_"+e.code,code:""+e.code,value:""+e.name})});const{data:We}=Digit.Hooks.useCustomMDMS(Digit.ULBService.getStateId(),"BPA",[{name:"MasterFields"}],{select:e=>{var t;return null==e||null===(t=e.BPA)||void 0===t?void 0:t.MasterFields}});let Ge=[];We&&We.map(e=>{Ge.push({i18nKey:"BPA_"+e.code,code:""+e.code,value:""+e.name})});const{data:je}=Digit.Hooks.useCustomMDMS(Digit.ULBService.getStateId(),"BPA",[{name:"Scheme"}],{select:e=>{var t;return null==e||null===(t=e.BPA)||void 0===t?void 0:t.Scheme}});let Ke=[];je&&je.map(e=>{Ke.push({i18nKey:"BPA_"+e.code,code:""+e.code,value:""+e.name})});const{data:Ye}=Digit.Hooks.useCustomMDMS(Digit.ULBService.getStateId(),"BPA",[{name:"SchemeType"}],{select:e=>{var t;return null==e||null===(t=e.BPA)||void 0===t?void 0:t.SchemeType}});let $e=[];Ye&&Ye.map(e=>{$e.push({i18nKey:"BPA_"+e.code,code:""+e.code,value:""+e.name})});const{control:ze}=a.useForm();function Ve(e){ee(e.target.value)}function qe(e){le(e.target.value)}function Xe(e){ae(e.target.value)}function Je(e){ue(e.target.value)}function Ze(e){_e(e.target.files[0]),ye(e.target.files[0])}function Qe(e){Ae(e.target.files[0]),Se(e.target.files[0])}return l.createElement(l.Fragment,null,l.createElement(zl,{currentStep:2}),l.createElement(o.FormStep,{config:N,onSelect:()=>{let e={...L.owners&&L.owners[B],approvedColony:R,use:ce,UlbName:F,Ulblisttype:pe,District:q,rating:de,masterPlan:x,buildingStatus:U,schemes:W,schemesselection:ne,purchasedFAR:j,greenbuilding:Y,restrictedArea:z,proposedSite:J,nameofApprovedcolony:Q,schemeName:oe,transferredscheme:re,NocNumber:te,uploadedFile:Ee,greenuploadedFile:fe},t={...L};var l,n,i;t.owners||(t.owners=[]),"NO"==(null==R?void 0:R.code)?te||Ee||null!=L&&null!==(l=L.owners)&&void 0!==l&&l.uploadedFile?"YES"===(null==Y?void 0:Y.code)?fe||null!=L&&null!==(n=L.owners)&&void 0!==n&&n.greenuploadedFile?I(N.key,{...L[N.key],...e},t,!1,B):alert("Please Upload Document"):I(N.key,{...L[N.key],...e},t,!1,B):alert("Please fill NOC number or Upload NOC Document"):"YES"===(null==Y?void 0:Y.code)?fe||null!=L&&null!==(i=L.owners)&&void 0!==i&&i.greenuploadedFile?I(N.key,{...L[N.key],...e},t,!1,B):alert("Please Upload Document"):I(N.key,{...L[N.key],...e},t,!1,B)},onSkip:()=>I(),t:P,isDisabled:!(R&&x&&pe&&F&&U&&W&&j&&Y&&z&&J)},l.createElement("div",null,l.createElement(o.CardLabel,null,""+P("BPA_APPROVED_COLONY")),l.createElement(a.Controller,{control:ze,name:"approvedColony",defaultValue:R,rules:{required:P("CORE_COMMON_REQUIRED_ERRMSG")},render:e=>l.createElement(o.Dropdown,{className:"form-field",selected:R,select:w,option:Pe,optionKey:"i18nKey",t:P})}),(()=>{var e;switch(null==R?void 0:R.code){case"YES":return l.createElement(t.Fragment,null,l.createElement(o.CardLabel,null,""+P("BPA_APPROVED_COLONY_NAME")),l.createElement(o.TextInput,s({t:P,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"nameofApprovedcolony",value:Q,onChange:Ve,style:{width:"86%"},ValidationRequired:!1},O={isRequired:!0,pattern:"^[a-zA-Z ]*$",type:"text",title:P("TL_NAME_ERROR_MESSAGE")})));case"NO":return l.createElement(t.Fragment,null,l.createElement(o.CardLabel,null,""+P("BPA_NOC_NUMBER")),l.createElement("div",{className:"field-container"},l.createElement(o.TextInput,s({t:P,type:"text",isMandatory:!1,optionKey:"i18nKey",defaultValue:null==L||null===(e=L.owners)||void 0===e?void 0:e.NocNumber,name:"NocNumber",value:te,onChange:qe,style:{width:"86%"},ValidationRequired:!1},O={pattern:"^[a-zA-Z0-9]*$",type:"text",title:P("TL_NAME_ERROR_MESSAGE")})),l.createElement("div",{style:{position:"relative",zIndex:"100",right:"95px",marginTop:"-24px",marginRight:"-20px"},onClick:e=>{console.log("inside_NOC_search")}}," ",l.createElement(o.SearchIcon,null)," ")),l.createElement("div",{style:{position:"relative",fontWeight:"bold",left:"20px"}},"OR"),l.createElement(o.UploadFile,{id:"noc-doc",style:{width:"86%"},onUpload:Ze,onDelete:()=>{_e(null),ye("")},message:Ee?"1 "+P("FILEUPLOADED"):P("ES_NO_FILE_SELECTED_LABEL"),error:De,uploadMessage:be}));default:return null}})(),l.createElement(o.CardLabel,{style:{marginTop:"15px"}},""+P("BPA_MASTER_PLAN")),l.createElement(a.Controller,{control:ze,name:"masterPlan",defaultValue:x,rules:{required:P("CORE_COMMON_REQUIRED_ERRMSG")},render:e=>l.createElement(o.Dropdown,{className:"form-field",selected:x,select:M,option:Ne,optionKey:"i18nKey",t:P})}),(()=>{switch(null==x?void 0:x.code){case"YES":return l.createElement(t.Fragment,null,l.createElement(o.CardLabel,null,""+P("BPA_USE")),l.createElement(a.Controller,{control:ze,name:"use",defaultValue:ce,rules:{required:P("CORE_COMMON_REQUIRED_ERRMSG")},render:e=>l.createElement(o.Dropdown,{className:"form-field",selected:ce,select:ve,option:Ge,optionKey:"i18nKey",t:P})}));case"NO":default:return null}})(),l.createElement(o.CardLabel,null,""+P("BPA_ULB_NAME")),l.createElement(a.Controller,{control:ze,name:"UlbName",defaultValue:F,rules:{required:P("CORE_COMMON_REQUIRED_ERRMSG")},render:e=>l.createElement(o.Dropdown,{className:"form-field",selected:F,select:k,option:xe,optionKey:"i18nKey",t:P})}),l.createElement(o.CardLabel,null,""+P("BPA_DISTRICT")),l.createElement(a.Controller,{control:ze,name:"District",defaultValue:q,rules:{required:P("CORE_COMMON_REQUIRED_ERRMSG")},render:e=>l.createElement(o.Dropdown,{className:"form-field",selected:q,select:X,option:Me,optionKey:"i18nKey",t:P})}),l.createElement(o.CardLabel,null,""+P("BPA_ULB_TYPE")),l.createElement(a.Controller,{control:ze,name:"Ulblisttype",defaultValue:pe,rules:{required:P("CORE_COMMON_REQUIRED_ERRMSG")},render:e=>l.createElement(o.Dropdown,{className:"form-field",selected:pe,select:me,option:we,optionKey:"i18nKey",t:P})}),l.createElement(o.CardLabel,null,""+P("BPA_BUILDING_STATUS")),l.createElement(a.Controller,{control:ze,name:"buildingStatus",defaultValue:U,rules:{required:P("CORE_COMMON_REQUIRED_ERRMSG")},render:e=>l.createElement(o.Dropdown,{className:"form-field",selected:U,select:H,option:ke,optionKey:"i18nKey",t:P})}),l.createElement(o.CardLabel,null,""+P("BPA_SCHEMES")),l.createElement(a.Controller,{control:ze,name:"schemes",defaultValue:W,rules:{required:P("CORE_COMMON_REQUIRED_ERRMSG")},render:e=>l.createElement(o.Dropdown,{className:"form-field",selected:W,select:G,option:Ke,optionKey:"i18nKey",t:P})}),(()=>{switch(null==W?void 0:W.code){case"SCHEME":return l.createElement(t.Fragment,null,l.createElement(o.CardLabel,null,""+P("BPA_SCHEME_TYPE_LABEL")),l.createElement(a.Controller,{control:ze,name:"schemesselection",defaultValue:ne,rules:{required:P("CORE_COMMON_REQUIRED_ERRMSG")},render:e=>l.createElement(o.Dropdown,{className:"form-field",selected:ne,select:ie,option:$e,optionKey:"i18nKey",t:P})}),l.createElement(o.CardLabel,null,""+P("BPA_SCHEME_NAME")),l.createElement(o.TextInput,s({t:P,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"schemeName",value:oe,onChange:Xe,style:{width:"86%"},ValidationRequired:!1},O={isRequired:!0,pattern:"^[a-zA-Z-.`' ]*$",type:"text",title:P("PT_NAME_ERROR_MESSAGE")})),l.createElement(o.CardLabel,null,""+P("BPA_TRANFERRED_SCHEME_LABEL")),l.createElement(o.TextInput,s({t:P,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"transferredscheme",value:re,onChange:Je,style:{width:"86%"},ValidationRequired:!1},O={isRequired:!0,pattern:"^[a-zA-Z-.`' ]*$",type:"text",title:P("PT_NAME_ERROR_MESSAGE")})));case"NON_SCHEME":default:return null}})(),l.createElement(o.CardLabel,null,""+P("BPA_PURCHASED_FAR")),l.createElement(a.Controller,{control:ze,name:"purchasedFAR",defaultValue:j,rules:{required:P("CORE_COMMON_REQUIRED_ERRMSG")},render:e=>l.createElement(o.Dropdown,{className:"form-field",selected:j,select:K,option:Ne,optionKey:"i18nKey",t:P})}),l.createElement(o.CardLabel,null,""+P("BPA_GREEN_BUIDINGS")),l.createElement(a.Controller,{control:ze,name:"greenbuilding",defaultValue:Y,rules:{required:P("CORE_COMMON_REQUIRED_ERRMSG")},render:e=>l.createElement(o.Dropdown,{className:"form-field",selected:Y,select:$,option:Ne,optionKey:"i18nKey",t:P})}),(()=>{switch(null==Y?void 0:Y.code){case"YES":return l.createElement(t.Fragment,null,l.createElement(o.UploadFile,{id:"green-building-doc",onUpload:Qe,onDelete:()=>{Ae(null),Se("")},message:fe?"1 "+P("FILEUPLOADED"):P("ES_NO_FILE_SELECTED_LABEL"),error:De,uploadMessage:be}),l.createElement("br",null),l.createElement(o.CardLabel,null,""+P("BPA_SELECT_RATINGS")),l.createElement(a.Controller,{control:ze,name:"rating",defaultValue:de,rules:{required:P("CORE_COMMON_REQUIRED_ERRMSG")},render:e=>l.createElement(o.Dropdown,{className:"form-field",selected:de,select:se,option:He,optionKey:"i18nKey",t:P})}));case"NO":default:return null}})(),l.createElement(o.CardLabel,null,""+P("BPA_RESTRICTED_AREA")),l.createElement(a.Controller,{control:ze,name:"restrictedArea",defaultValue:z,rules:{required:P("CORE_COMMON_REQUIRED_ERRMSG")},render:e=>l.createElement(o.Dropdown,{className:"form-field",selected:z,select:V,option:Ne,optionKey:"i18nKey",t:P})}),l.createElement(o.CardLabel,null,""+P("BPA_PROPOSED_SITE_TYPE")),l.createElement(a.Controller,{control:ze,name:"proposedSite",defaultValue:J,rules:{required:P("CORE_COMMON_REQUIRED_ERRMSG")},render:e=>l.createElement(o.Dropdown,{className:"form-field",selected:J,select:Z,option:Ie,optionKey:"i18nKey",t:P})}))))},OwnerDetails:e=>{var n,i,a;let{t:r,config:u,onSelect:d,formData:c}=e;console.log("formdatatstd",c);let v={};sessionStorage.removeItem("currentPincode");let p=window.location.href.includes("edit-application"),m=window.location.href.includes("renew-trade");const E=Digit.ULBService.getCurrentTenantId();console.log(E,"OWNER TENET ID");const _=Digit.ULBService.getStateId(),[f,A]=t.useState(!p&&!m),[g,S]=t.useState([]),[h,y]=t.useState([]),[D,T]=t.useState(()=>{var e;const t=sessionStorage.getItem("ownershipCategory");return t?JSON.parse(t):null==c||null===(e=c.owners)||void 0===e?void 0:e.ownershipCategory}),[b,C]=t.useState(()=>{var e;return sessionStorage.getItem("ownerName")||(null==c||null===(e=c.owners)||void 0===e?void 0:e.name)||""}),[P,N]=t.useState(()=>{var e;return sessionStorage.getItem("ownerEmail")||(null==c||null===(e=c.owners)||void 0===e?void 0:e.emailId)||""}),[I,L]=t.useState(()=>{var e;return sessionStorage.getItem("ownerAadhar")||(null==c||null===(e=c.owners)||void 0===e?void 0:e.aadharNumber)||""}),[B,O]=t.useState(!1),[R,w]=t.useState(()=>{var e;const t=sessionStorage.getItem("ownerGender");return t?JSON.parse(t):null==c||null===(e=c.owners)||void 0===e?void 0:e.gender}),[x,M]=t.useState(()=>{var e;return sessionStorage.getItem("ownerMobileNumber")||(null==c||null===(e=c.owners)||void 0===e?void 0:e.mobileNumber)||""}),[F,k]=t.useState(null),[U,H]=t.useState(!1);Digit.Utils.browser.isMobile();const W=!(null==D||null===(n=D.code)||void 0===n||!n.includes("MULTIPLEOWNERS"));null==c||null===(i=c.owners)||void 0===i||null===(a=i.owners)||void 0===a||a.forEach(e=>{"false"==e.isPrimaryOwner&&(e.isPrimaryOwner=!1)});const[G,j]=t.useState(()=>{var e;const t=sessionStorage.getItem("ownerFields");return t?JSON.parse(t):(null==c?void 0:c.owners)&&(null==c||null===(e=c.owners)||void 0===e?void 0:e.owners)||[{name:"",gender:"",mobileNumber:null,isPrimaryOwner:!0}]}),K=Digit.UserService.getUser();console.log("userrrr",K),t.useEffect(()=>{D&&sessionStorage.setItem("ownershipCategory",JSON.stringify(D))},[D]),t.useEffect(()=>{sessionStorage.setItem("ownerName",b)},[b]),t.useEffect(()=>{sessionStorage.setItem("ownerEmail",P)},[P]),t.useEffect(()=>{sessionStorage.setItem("ownerAadhar",I)},[I]),t.useEffect(()=>{R&&sessionStorage.setItem("ownerGender",JSON.stringify(R))},[R]),t.useEffect(()=>{sessionStorage.setItem("ownerMobileNumber",x)},[x]),t.useEffect(()=>{sessionStorage.setItem("ownerFields",JSON.stringify(G))},[G]),t.useEffect(()=>{var e=0;G.map(t=>{null!=t&&t.isPrimaryOwner&&(e=1),A(!(null!=t&&t.name&&null!=t&&t.mobileNumber&&null!=t&&t.gender))}),f||!D||null!=D&&D.code.includes("SINGLEOWNER")||A(1!=e)},[G]),t.useEffect(()=>{const e=ft(G);D&&!W&&(null==e?void 0:e.length)>1&&j([{...e[0],isPrimaryOwner:!0}])},[D]);const{isLoading:Y,data:$}=Digit.Hooks.obps.useMDMS(_,"common-masters",["OwnerShipCategory"]),{data:z}=Digit.Hooks.obps.useMDMS(_,"common-masters",["GenderType"]);t.useEffect(()=>{var e;const t=null==$||null===(e=$["common-masters"])||void 0===e?void 0:e.OwnerShipCategory;if(t&&(null==t?void 0:t.length)>0){const e=t.filter(e=>{var t;return null==e||null===(t=e.code)||void 0===t?void 0:t.includes("INDIVIDUAL")});e.forEach(e=>{e.i18nKey="COMMON_MASTERS_OWNERSHIPCATEGORY_"+gt(null==e?void 0:e.code,".","_")}),S(e)}},[$]),t.useEffect(()=>{var e;const t=(null==z||null===(e=z["common-masters"])||void 0===e?void 0:e.GenderType)||[];if(t&&(null==t?void 0:t.length)>0){const e=t.filter(e=>e.active);e.forEach(e=>{e.i18nKey="COMMON_GENDER_"+e.code}),y(e)}},[z]);const[V,q]=t.useState(null);function X(e){let t="";return e.map((e,l)=>{t=t+(0!==l?",":"")+e.code}),t}return console.log(c,"DATA++++++"),l.createElement("div",null,l.createElement(zl,{currentStep:3}),l.createElement(o.FormStep,{config:u,onSelect:function(){try{return q(null),Promise.resolve(function(e,t){try{let e=!1,t=[];return t=null==G?void 0:G.map((e,t)=>{var l;return Digit.UserService.userSearch(Digit.ULBService.getStateId(),{userName:null==G||null===(l=G[t])||void 0===l?void 0:l.mobileNumber},{}).then(e=>e)}),Promise.resolve(Promise.all(t)).then(function(l){var n;t=l;let i=[],o=!1;return t&&(null===(n=t)||void 0===n?void 0:n.length)>0&&t.map(t=>{var l,n,a,r,u,d;o=null==t||null===(l=t.user)||void 0===l||null===(n=l[0])||void 0===n||null===(a=n.roles)||void 0===a||null===(r=a.filter(e=>"BPA_ARCHITECT"===e.code||"BPA_SUPERVISOR"===e.code))||void 0===r?void 0:r[0],G.find(e=>{var l,n,i,a,r,u;return!(null!=e&&e.uuid&&!o)&&((null==e?void 0:e.name)===(null==t||null===(l=t.user)||void 0===l||null===(n=l[0])||void 0===n?void 0:n.name)&&(null==e?void 0:e.mobileNumber)===(null==t||null===(i=t.user)||void 0===i||null===(a=i[0])||void 0===a?void 0:a.mobileNumber)||(null==e?void 0:e.mobileNumber)===(null==t||null===(r=t.user)||void 0===r||null===(u=r[0])||void 0===u?void 0:u.mobileNumber)&&o)})&&(e=!0,i.push(null==t||null===(u=t.user)||void 0===u||null===(d=u[0])||void 0===d?void 0:d.mobileNumber))}),(null==i?void 0:i.length)>0&&k({key:"true",error:!0,message:`${r("BPA_OWNER_VALIDATION_1")} ${null==i?void 0:i.join(", ")} ${r("BPA_OWNER_VALIDATION_2")}`}),1!=e})}catch(e){return Promise.reject(e)}}()).then(function(e){if(e)if(1==W&&1==G.length)window.scrollTo(0,0),q("BPA_ERROR_MULTIPLE_OWNER");else{let e;if(e={...c.owners,owners:G,ownershipCategory:D},sessionStorage.setItem("currentOwnerData",JSON.stringify(e)),null!=c&&c.id)d(u.key,e);else{var t,l,n,i,o,a,r,s,v,p,m,E,_,f,A,g,S,h,y,T,b,C,P,N,I,L,B,O,R,w,x,M,F,k,U,j,Y,$,z,V,J,Z,Q,ee,te,le,ne,ie,oe,ae,re,ue,de,se,ce,ve,pe,me,Ee,_e,fe,Ae,ge,Se,he,ye,De,Te,be,Ce,Pe,Ne,Ie,Le,Be,Oe,Re,we,xe,Me,Fe,ke,Ue,He,We,Ge,je,Ke,Ye,$e,ze,Ve,qe,Xe,Je,Ze,Qe,et,tt,lt,nt,it,ot,at,rt,ut,dt,st,ct,vt,pt,mt,Et,_t,ft,At,gt,St,ht,yt,Dt,Tt,bt,Ct,Pt,Nt,It,Lt,Bt,Ot,Rt,wt,xt,Mt,Ft,kt,Ut,Ht,Wt,Gt,jt,Kt,Yt,$t,zt,Vt,qt;H(!0);let u=[];null===(t=e)||void 0===t||null===(l=t.owners)||void 0===l||l.map(e=>{u.push({...e,active:!0,name:e.name,emailId:e.emailId,aadharNumber:e.aadharNumber,mobileNumber:e.mobileNumber,isPrimaryOwner:e.isPrimaryOwner,gender:e.gender.code,fatherOrHusbandName:"NAME"})});let W={};W.edcrNumber=null!=c&&null!==(n=c.edcrNumber)&&void 0!==n&&n.edcrNumber?null==c||null===(i=c.edcrNumber)||void 0===i?void 0:i.edcrNumber:null==c||null===(o=c.data)||void 0===o||null===(a=o.scrutinyNumber)||void 0===a?void 0:a.edcrNumber,W.riskType=null==c||null===(r=c.data)||void 0===r?void 0:r.riskType,W.applicationType=null==c||null===(s=c.data)||void 0===s?void 0:s.applicationType,W.serviceType=null==c||null===(v=c.data)||void 0===v?void 0:v.serviceType;const G=Digit.UserService.getUser(),q=null==G||null===(p=G.info)||void 0===p?void 0:p.uuid;W.tenantId=null==c||null===(m=c.address)||void 0===m||null===(E=m.city)||void 0===E?void 0:E.code,W.workflow={action:"INITIATE",assignes:[null==G||null===(_=G.info)||void 0===_?void 0:_.uuid]},W.accountId=q,W.documents=null,W.additionalDetails={GISPlaceName:null==c||null===(f=c.address)||void 0===f?void 0:f.placeName},W.additionalDetails.boundaryWallLength=(null==c||null===(A=c.data)||void 0===A?void 0:A.boundaryWallLength)||"NA",W.additionalDetails.area=(null==c?void 0:c.data.edcrDetails.planDetail.planInformation.plotArea).toString()||"NA",W.additionalDetails.height=(null==c?void 0:c.data.edcrDetails.planDetail.blocks[0].building.buildingHeight).toString()||"NA",W.additionalDetails.usage=(null==c?void 0:c.data.occupancyType)||"NA",W.additionalDetails.builtUpArea=(null==c?void 0:c.data.edcrDetails.planDetail.blocks[0].building.totalBuitUpArea).toString(),W.additionalDetails.ownerName=u.map(e=>e.name).join(","),null!=c&&null!==(g=c.data)&&void 0!==g&&g.registrationDetails&&(W.additionalDetails.registrationDetails=null==c||null===(S=c.data)||void 0===S?void 0:S.registrationDetails),null!=c&&null!==(h=c.data)&&void 0!==h&&h.applicationType&&(W.additionalDetails.applicationType=null==c||null===(y=c.data)||void 0===y?void 0:y.applicationType),null!=c&&null!==(T=c.data)&&void 0!==T&&T.serviceType&&(W.additionalDetails.serviceType=null==c||null===(b=c.data)||void 0===b?void 0:b.serviceType),null!=c&&null!==(C=c.data)&&void 0!==C&&C.wardnumber&&(W.additionalDetails.wardnumber=null==c||null===(P=c.data)||void 0===P?void 0:P.wardnumber),null!=c&&null!==(N=c.data)&&void 0!==N&&N.zonenumber&&(W.additionalDetails.zonenumber=null==c||null===(I=c.data)||void 0===I?void 0:I.zonenumber),null!=c&&null!==(L=c.data)&&void 0!==L&&L.khasraNumber&&(W.additionalDetails.khasraNumber=null==c||null===(B=c.data)||void 0===B?void 0:B.khasraNumber),null!=c&&null!==(O=c.data)&&void 0!==O&&O.applicationType&&(W.additionalDetails.applicationType=null==c||null===(R=c.data)||void 0===R?void 0:R.applicationType),null!=c&&null!==(w=c.data)&&void 0!==w&&w.serviceType&&(W.additionalDetails.serviceType=null==c||null===(x=c.data)||void 0===x?void 0:x.serviceType),null!=c&&null!==(M=c.data)&&void 0!==M&&M.architectid&&(W.additionalDetails.architectid=null==c||null===(F=c.data)||void 0===F?void 0:F.architectid),null!=c&&null!==(k=c.data)&&void 0!==k&&k.propertyuid&&(W.additionalDetails.propertyuid=null==c||null===(U=c.data)||void 0===U?void 0:U.propertyuid),null!=c&&null!==(j=c.data)&&void 0!==j&&j.bathnumber&&(W.additionalDetails.bathnumber=null==c||null===(Y=c.data)||void 0===Y?void 0:Y.bathnumber),null!=c&&null!==($=c.data)&&void 0!==$&&$.kitchenNumber&&(W.additionalDetails.kitchenNumber=null==c||null===(z=c.data)||void 0===z?void 0:z.kitchenNumber),null!=c&&null!==(V=c.data)&&void 0!==V&&V.approxinhabitants&&(W.additionalDetails.approxinhabitants=null==c||null===(J=c.data)||void 0===J?void 0:J.approxinhabitants),null!=c&&null!==(Z=c.data)&&void 0!==Z&&Z.materialusedinfloor&&(W.additionalDetails.materialusedinfloor=null==c||null===(Q=c.data)||void 0===Q?void 0:Q.materialusedinfloor),null!=c&&null!==(ee=c.data)&&void 0!==ee&&ee.distancefromsewer&&(W.additionalDetails.distancefromsewer=null==c||null===(te=c.data)||void 0===te?void 0:te.distancefromsewer),null!=c&&null!==(le=c.data)&&void 0!==le&&le.sourceofwater&&(W.additionalDetails.sourceofwater=null==c||null===(ne=c.data)||void 0===ne?void 0:ne.sourceofwater),null!=c&&null!==(ie=c.data)&&void 0!==ie&&ie.watercloset&&(W.additionalDetails.watercloset=null==c||null===(oe=c.data)||void 0===oe?void 0:oe.watercloset),null!=c&&null!==(ae=c.data)&&void 0!==ae&&ae.materialused&&(W.additionalDetails.materialused=null==c||null===(re=c.data)||void 0===re?void 0:re.materialused),null!=c&&null!==(ue=c.data)&&void 0!==ue&&ue.materialusedinroofs&&(W.additionalDetails.materialusedinroofs=null==c||null===(de=c.data)||void 0===de?void 0:de.materialusedinroofs),null!=c&&null!==(se=c.owners)&&void 0!==se&&null!==(ce=se.approvedColony)&&void 0!==ce&&ce.code&&(W.additionalDetails.approvedColony=null==c||null===(ve=c.owners)||void 0===ve||null===(pe=ve.approvedColony)||void 0===pe?void 0:pe.code),null!=c&&null!==(me=c.owners)&&void 0!==me&&null!==(Ee=me.buildingStatus)&&void 0!==Ee&&Ee.code&&(W.additionalDetails.buildingStatus=null==c||null===(_e=c.owners)||void 0===_e||null===(fe=_e.buildingStatus)||void 0===fe?void 0:fe.code),null!=c&&null!==(Ae=c.owners)&&void 0!==Ae&&null!==(ge=Ae.greenbuilding)&&void 0!==ge&&ge.code&&(W.additionalDetails.greenbuilding=null==c||null===(Se=c.owners)||void 0===Se||null===(he=Se.greenbuilding)||void 0===he?void 0:he.code),null!=c&&null!==(ye=c.owners)&&void 0!==ye&&null!==(De=ye.masterPlan)&&void 0!==De&&De.code&&(W.additionalDetails.masterPlan=null==c||null===(Te=c.owners)||void 0===Te||null===(be=Te.masterPlan)||void 0===be?void 0:be.code),null!=c&&null!==(Ce=c.owners)&&void 0!==Ce&&null!==(Pe=Ce.proposedSite)&&void 0!==Pe&&Pe.code&&(W.additionalDetails.proposedSite=null==c||null===(Ne=c.owners)||void 0===Ne||null===(Ie=Ne.proposedSite)||void 0===Ie?void 0:Ie.code),null!=c&&null!==(Le=c.owners)&&void 0!==Le&&null!==(Be=Le.purchasedFAR)&&void 0!==Be&&Be.code&&(W.additionalDetails.purchasedFAR=null==c||null===(Oe=c.owners)||void 0===Oe||null===(Re=Oe.purchasedFAR)||void 0===Re?void 0:Re.code),null!=c&&null!==(we=c.owners)&&void 0!==we&&null!==(xe=we.restrictedArea)&&void 0!==xe&&xe.code&&(W.additionalDetails.restrictedArea=null==c||null===(Me=c.owners)||void 0===Me||null===(Fe=Me.restrictedArea)||void 0===Fe?void 0:Fe.code),null!=c&&null!==(ke=c.owners)&&void 0!==ke&&null!==(Ue=ke.schemes)&&void 0!==Ue&&Ue.i18nKey&&(W.additionalDetails.schemes=null==c||null===(He=c.owners)||void 0===He||null===(We=He.schemes)||void 0===We?void 0:We.i18nKey),null!=c&&null!==(Ge=c.owners)&&void 0!==Ge&&null!==(je=Ge.UlbName)&&void 0!==je&&je.code&&(W.additionalDetails.UlbName=null==c||null===(Ke=c.owners)||void 0===Ke||null===(Ye=Ke.UlbName)||void 0===Ye?void 0:Ye.code.toLowerCase().replace(/^\w/,e=>e.toUpperCase())),null!=c&&null!==($e=c.owners)&&void 0!==$e&&null!==(ze=$e.District)&&void 0!==ze&&ze.code&&(W.additionalDetails.District=null==c||null===(Ve=c.owners)||void 0===Ve||null===(qe=Ve.District)||void 0===qe?void 0:qe.code),null!=c&&null!==(Xe=c.owners)&&void 0!==Xe&&Xe.nameofApprovedcolony&&(W.additionalDetails.nameofApprovedcolony=null==c||null===(Je=c.owners)||void 0===Je?void 0:Je.nameofApprovedcolony),null!=c&&null!==(Ze=c.owners)&&void 0!==Ze&&Ze.NocNumber&&(W.additionalDetails.NocNumber=null==c||null===(Qe=c.owners)||void 0===Qe?void 0:Qe.NocNumber),null!=c&&null!==(et=c.owners)&&void 0!==et&&null!==(tt=et.coreArea)&&void 0!==tt&&tt.code&&(W.additionalDetails.coreArea=null==c||null===(lt=c.owners)||void 0===lt||null===(nt=lt.coreArea)||void 0===nt?void 0:nt.code),null!=c&&null!==(it=c.owners)&&void 0!==it&&null!==(ot=it.schemesselection)&&void 0!==ot&&ot.i18nKey&&(W.additionalDetails.schemesselection=null==c||null===(at=c.owners)||void 0===at||null===(rt=at.schemesselection)||void 0===rt?void 0:rt.i18nKey),null!=c&&null!==(ut=c.owners)&&void 0!==ut&&ut.schemeName&&(W.additionalDetails.schemeName=null==c||null===(dt=c.owners)||void 0===dt?void 0:dt.schemeName),null!=c&&null!==(st=c.owners)&&void 0!==st&&st.transferredscheme&&(W.additionalDetails.transferredscheme=null==c||null===(ct=c.owners)||void 0===ct?void 0:ct.transferredscheme),null!=c&&null!==(vt=c.owners)&&void 0!==vt&&null!==(pt=vt.Ulblisttype)&&void 0!==pt&&pt.value&&(W.additionalDetails.Ulblisttype=null==c||null===(mt=c.owners)||void 0===mt||null===(Et=mt.Ulblisttype)||void 0===Et?void 0:Et.value),null!=c&&null!==(_t=c.owners)&&void 0!==_t&&_t.uploadedFile&&(W.additionalDetails.uploadedFileNoc=null==c||null===(ft=c.owners)||void 0===ft?void 0:ft.uploadedFile),null!=c&&null!==(At=c.owners)&&void 0!==At&&null!==(gt=At.rating)&&void 0!==gt&>.code&&(W.additionalDetails.rating=null==c||null===(St=c.owners)||void 0===St||null===(ht=St.rating)||void 0===ht?void 0:ht.code),null!=c&&null!==(yt=c.owners)&&void 0!==yt&&yt.greenuploadedFile&&(W.additionalDetails.uploadedFileGreenBuilding=null==c||null===(Dt=c.owners)||void 0===Dt?void 0:Dt.greenuploadedFile),null!=c&&null!==(Tt=c.owners)&&void 0!==Tt&&null!==(bt=Tt.use)&&void 0!==bt&&bt.code&&(W.additionalDetails.use=null==c||null===(Ct=c.owners)||void 0===Ct||null===(Pt=Ct.use)||void 0===Pt?void 0:Pt.code),null!=K&&null!==(Nt=K.info)&&void 0!==Nt&&Nt.name&&(W.additionalDetails.architectName=null==K||null===(It=K.info)||void 0===It?void 0:It.name),null!=K&&null!==(Lt=K.info)&&void 0!==Lt&&Lt.mobileNumber&&(W.additionalDetails.architectMobileNumber=null==K||null===(Bt=K.info)||void 0===Bt?void 0:Bt.mobileNumber),W.landInfo={},W.landInfo.address={},null!=c&&null!==(Ot=c.address)&&void 0!==Ot&&null!==(Rt=Ot.city)&&void 0!==Rt&&Rt.code&&(W.landInfo.address.city=null==c||null===(wt=c.address)||void 0===wt||null===(xt=wt.city)||void 0===xt?void 0:xt.code),null!=c&&null!==(Mt=c.address)&&void 0!==Mt&&null!==(Ft=Mt.locality)&&void 0!==Ft&&Ft.code&&(W.landInfo.address.locality={code:null==c||null===(kt=c.address)||void 0===kt||null===(Ut=kt.locality)||void 0===Ut?void 0:Ut.code}),null!=c&&null!==(Ht=c.address)&&void 0!==Ht&&Ht.pincode&&(W.landInfo.address.pincode=null==c||null===(Wt=c.address)||void 0===Wt?void 0:Wt.pincode),null!=c&&null!==(Gt=c.address)&&void 0!==Gt&&Gt.landmark&&(W.landInfo.address.landmark=null==c||null===(jt=c.address)||void 0===jt?void 0:jt.landmark),null!=c&&null!==(Kt=c.address)&&void 0!==Kt&&Kt.street&&(W.landInfo.address.street=null==c||null===(Yt=c.address)||void 0===Yt?void 0:Yt.street),null!=c&&null!==($t=c.address)&&void 0!==$t&&$t.geoLocation&&(W.landInfo.address.geoLocation=null==c||null===(zt=c.address)||void 0===zt?void 0:zt.geoLocation),W.landInfo.owners=u,W.landInfo.ownershipCategory=D.code,W.landInfo.tenantId=null==c||null===(Vt=c.address)||void 0===Vt||null===(qt=Vt.city)||void 0===qt?void 0:qt.code,W.landInfo.unit=function(e){var t,l,n;const i=null==e?void 0:e.subOccupancy,o=(null==e||null===(t=e.data)||void 0===t||null===(l=t.edcrDetails)||void 0===l||null===(n=l.planDetail)||void 0===n?void 0:n.blocks)||[];let a=[];return i&&Object.entries(i).map((e,t)=>{var l,n,i,r,u,d;a.push({blockIndex:t,floorNo:e[0].split("_")[1],unitType:"Block",occupancyType:(null==o||null===(l=o[t])||void 0===l||null===(n=l.building)||void 0===n||null===(i=n.occupancies)||void 0===i||null===(r=i[0])||void 0===r||null===(u=r.typeHelper)||void 0===u||null===(d=u.type)||void 0===d?void 0:d.code)||"A",usageCategory:X(e[1])})}),a}(c);let Xt=sessionStorage.getItem("BPA_ARCHITECT_NAME"),Jt=Xt?JSON.parse(Xt):"ARCHITECT";W.additionalDetails.typeOfArchitect=Jt,W.additionalDetails.stakeholderName=JSON.parse(sessionStorage.getItem("BPA_STAKEHOLDER_NAME")),W.additionalDetails.stakeholderRegistrationNumber=JSON.parse(sessionStorage.getItem("BPA_STAKEHOLDER_REGISTRATION_NUMBER")),W.additionalDetails.stakeholderAddress=JSON.parse(sessionStorage.getItem("BPA_STAKEHOLDER_ADDRESS"));let Zt=sessionStorage.getItem("isSelfCertificationRequired");"undefined"!==Zt&&null!==Zt||(Zt="false"),W.additionalDetails.isSelfCertificationRequired=Zt.toString(),H(!1),d("",c,"",!0)}}})}catch(e){return Promise.reject(e)}},onSkip:()=>d(),t:r,isDisabled:f||function(){let e=0;return G&&(null==G||G.map(t=>{var l;1===e||null!=t&&t.name&&null!=t&&t.mobileNumber&&null!=t&&null!==(l=t.gender)&&void 0!==l&&l.code||(e=1)})),0!=e}()||!D||U,forcedError:r(V)},Y?l.createElement(o.Loader,null):l.createElement("div",{style:{marginBottom:"10px"}},l.createElement("div",null,l.createElement(o.CardLabel,null,r("BPA_TYPE_OF_OWNER_LABEL")+" *"),l.createElement(o.RadioButtons,{isMandatory:u.isMandatory,options:g,selectedOption:D,optionsKey:"i18nKey",onSelect:function(e){T(e)},value:D,labelKey:"PT_OWNERSHIP",isDependent:!0})),G.map((e,t)=>l.createElement("div",{key:`${e}-${t}`},l.createElement("div",{style:{border:"solid",borderRadius:"5px",padding:"10px",paddingTop:"20px",marginTop:"10px",borderColor:"#f3f3f3",background:"#FAFAFA"}},l.createElement(o.CardLabel,{style:{marginBottom:"-15px"}},r("CORE_COMMON_MOBILE_NUMBER")+" *"),W&&l.createElement(o.LinkButton,{label:l.createElement(o.DeleteIcon,{style:{float:"right",position:"relative",bottom:"5px"},fill:1!=G.length?"#494848":"#FAFAFA"}),style:{width:"100px",display:"inline",background:"black"},onClick:e=>function(e){const t=[...G];1!=t.length&&(t.splice(e,1),1==t.length&&(t[0]={...t[0],isPrimaryOwner:!0}),j(t))}(t)}),l.createElement("div",{style:{marginTop:"30px"}},l.createElement("div",{className:"field-container"},l.createElement("div",{style:{position:"relative",zIndex:"100",left:"35px",marginTop:"-24.5px",marginLeft:"-25px"}},"+91"),l.createElement(o.TextInput,s({style:{background:"#FAFAFA",padding:"0px 35px"},type:"text",t:r,isMandatory:!1,optionKey:"i18nKey",name:"mobileNumber",value:e.mobileNumber,onChange:e=>function(e,t){let l=[...G];l[e].mobileNumber=t.target.value,M(t.target.value),j(l),l[e].gender&&l[e].mobileNumber&&l[e].name&&A(!1)}(t,e)},v={isRequired:!0,pattern:"[6-9]{1}[0-9]{9}",type:"tel",title:r("CORE_COMMON_APPLICANT_MOBILE_NUMBER_INVALID")})),l.createElement("div",{style:{position:"relative",zIndex:"100",right:"35px",marginTop:"-24px",marginRight:"-20px"},onClick:e=>function(e,t){try{var l,n,i,o;const t=ft(G),a=(null==t||null===(l=t[e])||void 0===l?void 0:l.mobileNumber)||"";if(k(null),!a.match(At("MobileNo")))return k({key:"true",error:!0,message:"ERR_MOBILE_NUMBER_INCORRECT"}),Promise.resolve();if(a===(null==t||null===(n=t[e])||void 0===n?void 0:n.userName)&&"BPA_ARCHITECT"!==(null===(i=ownerRoleCheck)||void 0===i?void 0:i.code)&&"BPA_SUPERVISOR"!==(null===(o=ownerRoleCheck)||void 0===o?void 0:o.code))return k({key:"true",error:!0,message:"ERR_OWNER_ALREADY_ADDED_TOGGLE_MSG"}),Promise.resolve();const r=t.findIndex(e=>e.userName===a);return Promise.resolve(function(l,n){var i;if(!(r>-1&&"BPA_ARCHITECT"!==(null===(l=ownerRoleCheck)||void 0===l?void 0:l.code)&&"BPA_SUPERVISOR"!==(null===(n=ownerRoleCheck)||void 0===n?void 0:n.code)))return Promise.resolve(Digit.UserService.userSearch(Digit.ULBService.getStateId(),{userName:null==G||null===(i=G[e])||void 0===i?void 0:i.mobileNumber},{})).then(function(l){var n,i,o,a,r;let u=null==l||null===(n=l.user)||void 0===n||null===(i=n[0])||void 0===i||null===(o=i.roles)||void 0===o||null===(a=o.filter(e=>"BPA_ARCHITECT"===e.code||"BPA_SUPERVISOR"===e.code))||void 0===a?void 0:a[0];if(0===(null==l||null===(r=l.user)||void 0===r?void 0:r.length))k({key:"true",warning:!0,message:"ERR_MOBILE_NUMBER_NOT_REGISTERED"});else{var d,s,c,v,p;const n=null==l||null===(d=l.user)||void 0===d?void 0:d[0];n.gender=n.gender?{code:n.gender,active:!0,i18nKey:"COMMON_GENDER_"+n.gender}:"",null!=n&&n.dob&&(n.dob=Bt(null==n?void 0:n.dob)),null!=n&&n.createdDate&&(n.createdDate=xt(null==n?void 0:n.createdDate),n.lastModifiedDate=xt(null==n?void 0:n.lastModifiedDate),n.pwdExpiryDate=xt(null==n?void 0:n.pwdExpiryDate));let i=[...t];var m;i[e]&&(i[e]=n,i[e].isPrimaryOwner=(null===(m=G[e])||void 0===m?void 0:m.isPrimaryOwner)||!1),j(i),null!==(s=i[e])&&void 0!==s&&s.mobileNumber&&null!==(c=i[e])&&void 0!==c&&c.name&&null!==(v=i[e])&&void 0!==v&&null!==(p=v.gender)&&void 0!==p&&p.code?A(!0):A(!1),u&&(A(!1),k({key:"true",error:!0,message:"BPA_OWNER_VALIDATION_"+(null==u?void 0:u.code)}))}});k({key:"true",error:!0,message:"ERR_OWNER_ALREADY_ADDED"})}())}catch(e){return Promise.reject(e)}}(t)}," ",l.createElement(o.SearchIcon,null)," "))),l.createElement(o.CardLabel,null,r("CORE_COMMON_NAME")+" *"),l.createElement(o.TextInput,s({style:{background:"#FAFAFA"},t:r,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"name",value:e.name,onChange:e=>function(e,t){let l=[...G];l[e].name=t.target.value,C(t.target.value),j(l),l[e].gender&&l[e].mobileNumber&&l[e].name&&A(!1)}(t,e)},v={isRequired:!0,pattern:"^[a-zA-Z ]*$",type:"text",title:r("TL_NAME_ERROR_MESSAGE")})),l.createElement(o.CardLabel,null,r("BPA_APPLICANT_GENDER_LABEL")+" *"),l.createElement(o.RadioOrSelect,{name:"gender",options:h,selectedOption:e.gender,optionKey:"i18nKey",onSelect:e=>function(e,t){let l=[...G];l[e].gender=t,w(t),j(l),l[e].gender&&l[e].mobileNumber&&l[e].name&&A(!1)}(t,e),t:r}),l.createElement(o.CardLabel,null,""+r("BPA_AADHAAR_NUMBER_LABEL")),l.createElement(o.TextInput,s({style:{background:"#FAFAFA"},t:r,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"aadharNumber",value:e.aadharNumber,onChange:e=>function(e,t){let l=[...G];l[e].aadharNumber=t.target.value,L(t.target.value),j(l),l[e].gender&&l[e].mobileNumber&&l[e].name&&A(!1)}(t,e)},v={pattern:"^[2-9]{1}[0-9]{3}[0-9]{4}[0-9]{4}$",type:"tel",title:r("INVALID_AADHAAR_NUMBER")})),l.createElement(o.CardLabel,null,""+r("CORE_EMAIL_ID")),l.createElement(o.TextInput,s({style:{background:"#FAFAFA"},t:r,type:"emailId",isMandatory:!1,optionKey:"i18nKey",name:"emailId",value:e.emailId,onChange:e=>function(e,t){let l=[...G];l[e].emailId=t.target.value,N(t.target.value),j(l),l[e].gender&&l[e].mobileNumber&&l[e].name&&A(!1)}(t,e)},v={pattern:"[A-Za-z0-9._%+-]+@[a-z0-9.-]+.[a-z]{2,4}$",type:"emailId",title:r("TL_EMAIL_ID_ERROR_MESSAGE")},{disabled:!1})),W&&l.createElement(o.CheckBox,{label:r("BPA_IS_PRIMARY_OWNER_LABEL"),onChange:e=>function(e,t){let l=[...G];l.map(e=>{e.isPrimaryOwner=!1}),l[e].isPrimaryOwner=!W||t.target.checked,O(t.target.checked),j(l)}(t,e),value:e.isPrimaryOwner,checked:e.isPrimaryOwner,style:{paddingTop:"10px"}})))),W?l.createElement("div",null,l.createElement("div",{style:{display:"flex",paddingBottom:"15px",color:"#FF8C00"}},l.createElement("button",{type:"button",style:{paddingTop:"10px"},onClick:()=>function(){const e=[...G];e.push({name:"",gender:"",mobileNumber:null,isPrimaryOwner:!1}),j(e),A(!0)}()},r("BPA_ADD_OWNER")))):null)),F&&l.createElement(o.Toast,{error:null==F?void 0:F.error,warning:null==F?void 0:F.warning,label:r(null==F?void 0:F.message),isDleteBtn:!0,onClose:()=>{k(null)}}))},DocumentDetails:e=>{var n,i;let{t:a,config:r,onSelect:u,formData:d}=e;const s=Digit.ULBService.getStateId(),[c,v]=t.useState((null==d||null===(n=d.documents)||void 0===n?void 0:n.documents)||[]),[p,m]=t.useState(null),[E,_]=t.useState(!0),[f,A]=t.useState(!1),g=null==d||null===(i=d.uiFlow)||void 0===i?void 0:i.flow,[S,h]=t.useState(!1),y=ft((null==d?void 0:d.PrevStateDocuments)||[]),{data:D,isLoading:T}=Digit.Hooks.obps.useBPATaxDocuments(s,{status:"INPROGRESS",RiskType:"LOW",ServiceType:"NEW_CONSTRUCTION",applicationType:"BUILDING_PLAN_SCRUTINY"},y||[]);return t.useEffect(()=>{const e=D.filter(e=>e.required).map(e=>e.code),t=e.filter(e=>c.reduce((t,l)=>{var n,i,o,a;return e==`${null==l||null===(n=l.documentType)||void 0===n||null===(i=n.split("."))||void 0===i?void 0:i[0]}.${null==l||null===(o=l.documentType)||void 0===o||null===(a=o.split("."))||void 0===a?void 0:a[1]}`||t},!1));_(!(t.length==e.length&&c.length>0))},[c,f]),l.createElement("div",null,l.createElement(zl,{currentStep:3,flow:"OCBPA"===g?"OCBPA":""}),T?l.createElement(o.Loader,null):l.createElement(o.FormStep,{t:a,config:r,onSelect:()=>{let e,t=d.documents,l=[];D&&D.map(e=>{c&&c.filter(t=>e.code===gt(null==t?void 0:t.additionalDetails.category,"_",".")).map(e=>{l.push(e)})}),e={...t,documents:l},u(r.key,e)},onSkip:()=>u(),onAdd:function(){}},null==D?void 0:D.filter(e=>"ARCHITECT.UNDERTAKING"!==e.code&&"CITIZEN.UNDERTAKING"!==e.code).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(ql,{key:t,document:e,t:a,error:p,setError:m,setDocuments:v,documents:c,setCheckRequiredFields:A,formData:d,beforeUploadDocuments:y||[],isNextButtonDisabled:S,setIsNextButtonDisabled:h}))),p&&l.createElement(o.Toast,{label:p,onClose:()=>m(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!=d&&d.applicationNo?l.createElement(o.CitizenInfoLabel,{info:a("CS_FILE_APPLICATION_INFO_LABEL"),text:`${a("BPA_APPLICATION_NUMBER_LABEL")} ${null==d?void 0:d.applicationNo} ${a("BPA_DOCS_INFORMATION")}`,className:"info-banner-wrap-citizen-override"}):"")},NOCDetails:e=>{var n,i;let{t:a,config:r,onSelect:u,formData:d}=e;Digit.ULBService.getCurrentTenantId();const s=Digit.ULBService.getStateId(),[c,v]=t.useState((null==d||null===(n=d.nocDocuments)||void 0===n?void 0:n.nocDocuments)||[]),[p,m]=t.useState(null),[E,_]=t.useState([]),[f,A]=t.useState(!0),[g,S]=t.useState(!1);let[h,y]=t.useState(null!=d&&d.PrevStateNocDocuments?ft(null==d?void 0:d.PrevStateNocDocuments):[]);const D=null==d||null===(i=d.uiFlow)||void 0===i?void 0:i.flow,[T,b]=t.useState(null==d?void 0:d.applicationNo),[C,P]=t.useState([]),[N,I]=t.useState([]),[L,B]=t.useState([]),{data:O}=Digit.Hooks.obps.useNocDetails(null==d?void 0:d.tenantId,{sourceRefId:T}),{isLoading:R,data:w}=Digit.Hooks.obps.useMDMS(s,"NOC",["DocumentTypeMapping"]),{data:x}=Digit.Hooks.obps.useMDMS(s,"common-masters",["DocumentType"]),{data:M,isLoading:F}=Digit.Hooks.useDocumentSearch(h,{enabled:(null==h?void 0:h.length)>0});return t.useEffect(()=>{var e,t;(null==M||null===(e=M.pdfFiles)||void 0===e?void 0:e.length)>0&&(null==M||null===(t=M.pdfFiles)||void 0===t||t.forEach(e=>e.title=null==e?void 0:e.documentType),y(null==M?void 0:M.pdfFiles))},[null==M?void 0:M.pdfFiles]),t.useEffect(()=>{P(O)},[O]),t.useEffect(()=>{var e;I(null==w||null===(e=w.NOC)||void 0===e?void 0:e.DocumentTypeMapping)},[w]),t.useEffect(()=>{var e;B(null==x||null===(e=x["common-masters"])||void 0===e?void 0:e.DocumentType)},[x]),t.useEffect(()=>{if(null!=C&&C.length&&null!=N&&N.length){let e=[];C.map(t=>{var l,n;const i=N.filter(e=>e.applicationType===t.applicationType&&e.nocType===t.nocType);null!=i&&null!==(l=i[0])&&void 0!==l&&null!==(n=l.docTypes)&&void 0!==n&&n[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 l=e.documentType;e.dropdownData=[],e.uploadedDocuments=[],L&&L.forEach(t=>{let n=t.code.slice(0,l.length);l===n&&(e.hasDropdown=!0,e.dropdownData.push(t))}),e.uploadedDocuments[0]={},e.uploadedDocuments[0].values=[],h.map(t=>{var n,i;l===`${null==t||null===(n=t.documentType)||void 0===n?void 0:n.split(".")[0]}.${null==t||null===(i=t.documentType)||void 0===i?void 0:i.split(".")[1]}`&&e.uploadedDocuments[0].values.push(t)}),t.push(e)}),t.forEach(e=>{e.code=e.documentType,e.dropdownData.forEach(e=>{e.i18nKey=e.code})}),_(t)}},[C,N,L,h]),l.createElement("div",null,l.createElement(zl,{currentStep:3,flow:"OCBPA"===D?"OCBPA":""}),R?l.createElement(o.Loader,null):l.createElement(o.FormStep,{t:a,config:r,onSelect:()=>{let e;e={...d.nocDocuments,nocDocuments:c,NocDetails:C,nocTaxDocuments:E},u(r.key,e)},onSkip:()=>{let e;e={...d.nocDocuments,nocDocuments:c,NocDetails:C,nocTaxDocuments:E},u(r.key,e)},onAdd:function(){}},null==E?void 0:E.map((e,t)=>l.createElement(Xl,{key:t,document:e,t:a,error:p,setError:m,setNocDocuments:v,nocDocuments:c,setCheckRequiredFields:S,formData:d,beforeUploadNocDocuments:h,pdfLoading:F})),p&&l.createElement(o.Toast,{label:p,onClose:()=>m(null),error:!0})))},NOCNumber:e=>{var n,i,a,r;let{t:u,config:d,onSelect:s,formData:c}=e;const[v,p]=t.useState((null==c||null===(n=c.additionalDetails)||void 0===n?void 0:n.nocNumber)||(null==c||null===(i=c.nocnumber)||void 0===i?void 0:i.nocNumber)||"");return Digit.ULBService.getCurrentTenantId(),Digit.Utils.browser.isMobile(),l.createElement("div",null,l.createElement(zl,{currentStep:0}),l.createElement(o.FormStep,{t:u,config:d,onSelect:()=>{s(null==d?void 0:d.key,{nocNumber:v})},isDisabled:!v},l.createElement("div",{className:"field-container"},l.createElement(o.TextInput,{class:"card-input",type:"text",t:u,isMandatory:!1,optionKey:"i18nKey",name:"nocNumber",value:v,onChange:e=>{p(e.target.value)},defaultValue:(null==c||null===(a=c.nocnumber)||void 0===a?void 0:a.nocNumber)||(null==c||null===(r=c.additionalDetails)||void 0===r?void 0:r.nocNumber)}),l.createElement("div",{style:{position:"relative",zIndex:"100",right:"20px",marginTop:"-24px",marginRight:"-20px"},onClick:e=>{console.log("inside_search")}}," ",l.createElement(o.SearchIcon,null)," "))))},LocationDetails:e=>{var n,a,r,u,d,s,c,v,p,m,E,_,f,A,g,S,h,y,D,T,b,C,P,N,I,L,B,O,R,w;let{t:x,config:M,onSelect:F,userType:k,formData:U,ownerIndex:H=0}=e,W=JSON.parse(sessionStorage.getItem("Digit_OBPS_PT")),G=JSON.parse(sessionStorage.getItem("currentCity"))||{},j=sessionStorage.getItem("currentPincode");JSON.parse(sessionStorage.getItem("currentLocality"));const K=Digit.Hooks.obps.useTenants(),Y=(i.useLocation(),Digit.ULBService.getCurrentTenantId()),[$,z]=(Digit.ULBService.getStateId(),t.useState(null)),[V,q]=t.useState(!1),[X,J]=t.useState(j||(null===(n=U)||void 0===n||null===(a=n.address)||void 0===a?void 0:a.pincode)||(null==W||null===(r=W.address)||void 0===r?void 0:r.pincode)||""),[Z,Q]=t.useState((null===(u=U)||void 0===u||null===(d=u.address)||void 0===d?void 0:d.geoLocation)||""),[ee,te]=t.useState(null===(s=U)||void 0===s||null===(c=s.Scrutiny)||void 0===c||null===(v=c[0])||void 0===v?void 0:v.tenantIdData),[le,ne]=t.useState(()=>{var e,t,l;return(null===(e=U)||void 0===e||null===(t=e.address)||void 0===t?void 0:t.city)||G||(null==W||null===(l=W.address)||void 0===l?void 0:l.pincode)||null}),[ie,oe]=t.useState((null===(p=U)||void 0===p||null===(m=p.address)||void 0===m?void 0:m.street)||(null==W||null===(E=W.address)||void 0===E?void 0:E.street)||""),[ae,re]=t.useState((null===(_=U)||void 0===_||null===(f=_.address)||void 0===f?void 0:f.landmark)||(null===(A=U)||void 0===A||null===(g=A.address)||void 0===g?void 0:g.Landmark)||(null==W||null===(S=W.address)||void 0===S?void 0:S.landmark)||""),[ue,de]=t.useState((null===(h=U)||void 0===h||null===(y=h.address)||void 0===y?void 0:y.placeName)||(null===(D=U)||void 0===D?void 0:D.placeName)||""),[se,ce]=t.useState(),[ve,pe]=t.useState((null==W||null===(T=W.address)||void 0===T?void 0:T.locality)||(null===(b=U)||void 0===b||null===(C=b.address)||void 0===C?void 0:C.locality)||null);let[me,Ee]=t.useState(K),_e=null===(P=U)||void 0===P||null===(N=P.data)||void 0===N||null===(I=N.edcrDetails)||void 0===I?void 0:I.tenantId;U={address:{...null===(L=U)||void 0===L?void 0:L.address}};const fe=window.Digit.Utils.browser.isMobile();t.useEffect(()=>{if(!le||!se){const e="employee"===k?K.filter(e=>e.code===Y):X&&/^[1-9][0-9]{6}$/.test(X)?K.filter(e=>{var t;return null==e||null===(t=e.pincode)||void 0===t?void 0:t.some(e=>e==Number(X))}):K;Ee(e),/^[1-9][0-9]{6}$/.test(X)?(0===(null==e?void 0:e.length)||1===e.length&&(null==e?void 0:e[0].code)!==((null==le?void 0:le.code)||le||""))&&z("BPA_PIN_NOT_VALID_ERROR"):z(null)}},[X]),t.useEffect(()=>{me.map((e,t)=>{e.code===_e&&(ne(e),sessionStorage.setItem("currentCity",JSON.stringify(e)))})},[me,null===(B=U)||void 0===B?void 0:B.data]),t.useEffect(()=>{me&&1===me.length&&(null==me?void 0:me[0].code)===(null==le?void 0:le.code)&&(ne(me[0]),sessionStorage.setItem("currentCity",JSON.stringify(me[0])))},[me]);const{data:Ae}=Digit.Hooks.useBoundaryLocalities(null==le?void 0:le.code,"revenue",{enabled:!!le},x);let ge=window.location.href.includes("editApplication"),Se=window.location.href.includes("sendbacktocitizen");function he(e){const t="object"==typeof e&&null!==e?e.target.value:e;z(null),""===t||/^[1-9][0-9]{5}$/.test(t)||z("BPA_PIN_NOT_VALID_ERROR"),U.address.pincode=t,J(t),sessionStorage.setItem("currentPincode",t),sessionStorage.setItem("currentCity",JSON.stringify({})),sessionStorage.setItem("currLocality",JSON.stringify({})),pe(null),ce(null)}return t.useEffect(()=>{var e,t;if(null!=W&&null!==(e=W.address)&&void 0!==e&&e.locality)pe(null==W||null===(t=W.address)||void 0===t?void 0:t.locality);else if(le&&Ae&&!$){var l,n,i,o,a,r,u,d;let e=Ae,t=[];var s,c;console.log("fetchedLocalities",Ae),null!==(l=U)&&void 0!==l&&null!==(n=l.address)&&void 0!==n&&n.locality&&(null===(i=U)||void 0===i||null===(o=i.address)||void 0===o||null===(a=o.locality)||void 0===a?void 0:a.code)===(null==ve?void 0:ve.code)&&pe(U.address.locality),(null!==(r=U)&&void 0!==r&&null!==(u=r.address)&&void 0!==u&&u.pincode||X)&&!$&&(t=e.filter(e=>{var t;return null===(t=e.pincode)||void 0===t?void 0:t.find(e=>e==X)}),(null===(s=U)||void 0===s||null===(c=s.address)||void 0===c||!c.locality)&&t.length<=0&&pe()),(!se||t.length>0&&se.length!==t.length||t.length<=0&&se&&se.length!==e.length)&&(console.log("filteredLocalityList",t),ce(()=>t.length>0?t:e)),1===t.length&&(null==ve||ve&&(null===(d=t[0])||void 0===d?void 0:d.code)!==(null==ve?void 0:ve.code))&&(pe(t[0]),sessionStorage.setItem("currLocality",JSON.stringify(t[0])))}},[le,null===(O=U)||void 0===O?void 0:O.pincode,Ae,X,Z]),l.createElement("div",null,!V&&l.createElement(zl,null),V&&l.createElement(Jl,{t:x,onSelect:F,formData:U,handleRemove:()=>{q(!V)},onSave:function(e,t,l){he(t),sessionStorage.setItem("currentPincode",t),Q(e),de(l),q(!1),z(null)}}),!V&&l.createElement(o.FormStep,{t:x,config:M,onSelect:()=>{const e={};e.pincode=X,e.city=le,e.locality=ve,e.street=ie,e.landmark=ae,e.geoLocation=Z,e.placeName=ue,F(M.key,e)},isDisabled:!le||!ve||$,isMultipleAllow:!0,forcedError:x($)},l.createElement(o.CardLabel,null,""+x("BPA_GIS_LABEL")),l.createElement("div",{style:{}},l.createElement(o.TextInput,{style:{},isMandatory:!1,optionKey:"i18nKey",t:x,name:"gis",value:ge||Se?null!==Z.latitude?`${Z.latitude}, ${Z.longitude}`:"":ue,onChange:function(e){U.address.geoLocation="object"==typeof e&&null!==e?e.target.value:e,Q("object"==typeof e&&null!==e?e.target.value:e),de("object"==typeof e&&null!==e?e.target.value:e),sessionStorage.setItem("currentPincode",""),sessionStorage.setItem("currentCity",JSON.stringify({})),sessionStorage.setItem("currLocality",JSON.stringify({})),J(""),pe(null)}}),l.createElement(o.LinkButton,{label:l.createElement("div",null,l.createElement("span",null,l.createElement("svg",{style:fe?{float:"right",position:"relative",bottom:"25px",marginTop:"-20px",marginRight:"5px"}:{position:"relative",left:"515px",bottom:"25px",marginTop:"-20px"},width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l.createElement("path",{d:"M11 7C8.79 7 7 8.79 7 11C7 13.21 8.79 15 11 15C13.21 15 15 13.21 15 11C15 8.79 13.21 7 11 7ZM19.94 10C19.48 5.83 16.17 2.52 12 2.06V0H10V2.06C5.83 2.52 2.52 5.83 2.06 10H0V12H2.06C2.52 16.17 5.83 19.48 10 19.94V22H12V19.94C16.17 19.48 19.48 16.17 19.94 12H22V10H19.94ZM11 18C7.13 18 4 14.87 4 11C4 7.13 7.13 4 11 4C14.87 4 18 7.13 18 11C18 14.87 14.87 18 11 18Z",fill:"#505A5F"})))),style:{},onClick:e=>{q(!V)}})),l.createElement(o.CardLabel,null,""+x("BPA_DETAILS_PIN_LABEL")),!V&&l.createElement(o.TextInput,{isMandatory:!1,optionKey:"i18nKey",type:"text",t:x,name:"pincode",onChange:he,value:X,disabled:!(null==W||!W.address)}),l.createElement(o.CardLabel,null,x("BPA_CITY_LABEL")+"*"),!V&&l.createElement(o.RadioOrSelect,{options:me.sort((e,t)=>e.name.localeCompare(t.name)),selectedOption:le,optionKey:"code",onSelect:function(e){pe(null),ce(null),ne(e),sessionStorage.setItem("currentCity",JSON.stringify(e)),U.address.city=e},t:x,isDependent:!0,disabled:!(null==W||!W.address)}),l.createElement("span",{className:"form-pt-dropdown-only"},l.createElement(o.CardLabel,null,x("BPA_LOC_MOHALLA_LABEL")+"*"),V||!le||!se||null!=W&&W.address?l.createElement(o.TextInput,{optionCardStyles:{maxHeight:"20vmax",overflow:"scroll"},isMandatory:M.isMandatory,value:null==W||null===(R=W.address)||void 0===R||null===(w=R.locality)||void 0===w?void 0:w.name,optionKey:"i18nkey",t:x,isDependent:!0,labelKey:gt(null==le?void 0:le.code,".","_").toUpperCase()+"_REVENUE",disabled:!(null==W||!W.address)}):l.createElement(o.RadioOrSelect,{optionCardStyles:{maxHeight:"20vmax",overflow:"scroll"},isMandatory:M.isMandatory,options:se.sort((e,t)=>e.name.localeCompare(t.name)),selectedOption:ve,optionKey:"i18nkey",onSelect:function(e){var t,l;null!==(t=U)&&void 0!==t&&null!==(l=t.address)&&void 0!==l&&l.locality&&(U.address.locality=e),pe(e),sessionStorage.setItem("currLocality",JSON.stringify(e))},t:x,isDependent:!0,labelKey:gt(null==le?void 0:le.code,".","_").toUpperCase()+"_REVENUE"})),l.createElement(o.CardLabel,null,""+x("BPA_DETAILS_SRT_NAME_LABEL")),!V&&l.createElement(o.TextInput,{style:{},isMandatory:!1,optionKey:"i18nKey",t:x,name:"street",onChange:function(e){oe(e.target.value)},value:ie,disabled:!(null==W||!W.address)}),l.createElement(o.CardLabel,null,""+x("ES_NEW_APPLICATION_LOCATION_LANDMARK")),!V&&l.createElement(o.TextInput,{style:{},isMandatory:!1,optionKey:"i18nKey",t:x,name:"landmark",onChange:function(e){re(e.target.value)},value:ae,disabled:!(null==W||!W.address)})))},GIS:Jl,OCEDCRDocsRequired:e=>{let{onSelect:i}=e;const{t:a}=n.useTranslation(),r=[{code:"BPA_PERMIT_NUMBER_OC_SCRUTINY_LABEL"},{code:"BPA_PERMIT_DATE_LABEL"},{code:"BPA_OC_PLAN_DXF_FILE"}];return l.createElement(t.Fragment,null,l.createElement(o.Card,null,l.createElement(o.CardHeader,null,a("BPA_OC_NEW_BUILDING_CONSTRUCTION_LABEL")),l.createElement(o.CardText,{style:{color:"#0B0C0C",marginTop:"12px",fontSize:"16px",fontWeight:"400",lineHeight:"24px"}},a("OBPS_OCEDCR_BUILDING_PERMIT_DESCRIPTION")),l.createElement(t.Fragment,null,null==r?void 0:r.map((e,t)=>l.createElement(o.CardLabel,{style:{fontWeight:700},key:t},l.createElement("div",{style:{display:"flex"}},l.createElement("div",null,t+1+"."," "),l.createElement("div",null," "+a(null==e?void 0:e.code.replace(".","_"))))))),l.createElement(o.SubmitBar,{label:a("CS_COMMON_NEXT"),onSubmit:()=>{i()}})),l.createElement(o.CitizenInfoLabel,{info:a("CS_FILE_APPLICATION_INFO_LABEL"),text:a("OBPS_OC_DOCS_FILE_SIZE"),className:"info-banner-wrap-citizen-override"}))},OCeDCRScrutiny:e=>{var n,i,a,r,u,d,c;let{t:v,config:p,onSelect:m,formData:E,ownerIndex:_=0}=e;const f=Digit.ULBService.getCurrentTenantId(),[A,g]=(Digit.ULBService.getStateId(),t.useState(null==E||null===(n=E.ScrutinyDetails)||void 0===n?void 0:n.ocPermitNumber)),[S,h]=t.useState(null==E||null===(i=E.ScrutinyDetails)||void 0===i?void 0:i.ocPermitdate),[y,D]=t.useState(null==E?void 0:E.ScrutinyDetails),[T,b]=t.useState(null);let C={};function P(){}const N=()=>{},I=()=>{const e={};e.file=file,m(p.key,e)};return l.createElement("div",null,l.createElement(o.FormStep,{t:v,config:p,onSelect:I,onSkip:N,isDisabled:!A,onAdd:P,isMultipleAllow:!0},l.createElement(o.CardCaption,null,""+v("BPA_OC_NEW_BUILDING_CONSTRUCTION_LABEL")),l.createElement(o.CardHeader,null,""+v("BPA_OC_EDCR_SCRUTINY_LABEL")),l.createElement(o.CardText,null,""+v("BPA_PROVIDE_BPN_AND_BPD_APP_LABEL")),l.createElement(o.CardLabel,null,v("EDCR_BUILDING_PERMIT_NUM_LABEL")+" *"),l.createElement(o.TextInput,s({isMandatory:!1,optionKey:"i18nKey",t:v,name:"permitNumber",onChange:function(e){g(e.target.value)},value:A},C={isRequired:!0,pattern:At("Name"),title:v("BPA_INVALID_NAME")})),l.createElement(o.CardLabel,null,v("EDCR_BUILDING_PERMIT_DATE_LABEL")+" *"),l.createElement(o.DatePicker,{date:S,name:"permitDate",onChange:function(e){h(e)}}),l.createElement("div",{onClick:function(){try{D({}),b(null);let e={permitDate:Bt(S),approvalNo:A};return Digit.OBPSService.BPASearch(f,e).then((e,t)=>{var l,n;if((null==e||null===(l=e.BPA)||void 0===l?void 0:l.length)>0){var i,o,a,r,u,d;const t=null==e||null===(i=e.BPA)||void 0===i||null===(o=i[0])||void 0===o?void 0:o.edcrNumber,l=null==e||null===(a=e.BPA)||void 0===a||null===(r=a[0])||void 0===r?void 0:r.tenantId;S===(e=>{if(e){const t=new Date(e);let l=t.getMonth()+1,n=t.getDate(),i=t.getFullYear();return l=(l>9?"":"0")+l,n=(n>9?"":"0")+n,`${i}-${l}-${n}`}return null})(null==e||null===(u=e.BPA)||void 0===u||null===(d=u[0])||void 0===d?void 0:d.approvalDate)?Digit.OBPSService.scrutinyDetails(l,{edcrNumber:t}).then(t=>{var n,i;Digit.WorkflowService.getAllApplication(l,{businessIds:null==e||null===(n=e.BPA)||void 0===n||null===(i=n[0])||void 0===i?void 0:i.applicationNo,history:!0}).then((l,n)=>{var i,o,a,r,u;const d=null==l||null===(i=l.ProcessInstances)||void 0===i?void 0:i[(null==l||null===(o=l.ProcessInstances)||void 0===o?void 0:o.length)-1],s=(null==d||null===(a=d.assignes)||void 0===a||null===(r=a[0])||void 0===r?void 0:r.name)||"";if((null==t||null===(u=t.edcrDetail)||void 0===u?void 0:u.length)>0){var c,v,p,m,E,_;const l=null==e||null===(c=e.BPA)||void 0===c||null===(v=c[0])||void 0===v||null===(p=v.landInfo)||void 0===p||null===(m=p.owners)||void 0===m?void 0:m.filter(e=>e.isPrimaryOwner&&"false"!=e.isPrimaryOwner);t.edcrDetail[0].applicantName=null==l||null===(E=l[0])||void 0===E?void 0:E.name,t.edcrDetail[0].ocPermitNumber=A,t.edcrDetail[0].ocPermitdate=S,t.edcrDetail[0].appliedBy=s,D(null==t||null===(_=t.edcrDetail)||void 0===_?void 0:_[0])}}).catch(e=>{var t,l,n;b({key:"error",error:!0,message:(null==e||null===(t=e.response)||void 0===t||null===(l=t.data)||void 0===l||null===(n=l.Errors[0])||void 0===n?void 0:n.message)||null})})}).catch(e=>{var t,l,n;b({key:"error",error:!0,message:(null==e||null===(t=e.response)||void 0===t||null===(l=t.data)||void 0===l||null===(n=l.Errors[0])||void 0===n?void 0:n.message)||null})}):b({key:"error",warning:!0,message:v("ERR_FILL_EDCR_PERMIT_INCORRECT_DATE")})}else 0==(null==e||null===(n=e.BPA)||void 0===n?void 0:n.length)&&b({key:"error",error:!0,message:v("BPA_NO_REC_FOUND_LABEL")})}).catch(e=>{var t,l,n;b({key:"error",error:!0,message:(null==e||null===(t=e.response)||void 0===t||null===(l=t.data)||void 0===l||null===(n=l.Errors[0])||void 0===n?void 0:n.message)||null})}),Promise.resolve()}catch(e){return Promise.reject(e)}}},l.createElement(o.SubmitBar,{label:v("ACTION_TEST_BPA_STAKE_HOLDER_SEARCH"),disabled:!A||!S})),T&&l.createElement(o.Toast,{error:null==T?void 0:T.error,warning:null==T?void 0:T.warning,label:v(null==T?void 0:T.message),isDleteBtn:!0,onClose:()=>{b(null)}})),null!=y&&y.edcrNumber?l.createElement(o.FormStep,{t:v,config:p,onSelect:I,onSkip:N,isDisabled:!A,onAdd:P,isMultipleAllow:!0},l.createElement(o.StatusTable,null,l.createElement(o.Row,{label:""+v("REPORT_FSM_RESULT_APPLICANTNAME"),text:v(null==y?void 0:y.applicantName),className:"border-none"}),l.createElement(o.Row,{label:""+v("BPA_BASIC_DETAILS_SERVICE_TYPE_LABEL"),text:v(null==y?void 0:y.applicationSubType),className:"border-none"}),l.createElement(o.Row,{label:""+v("EDCR_TOTAL_BUILD_UP_AREA_LABEL"),text:v(null==y||null===(a=y.planDetail)||void 0===a||null===(r=a.virtualBuilding)||void 0===r?void 0:r.totalBuitUpArea),className:"border-none"}),l.createElement(o.Row,{label:""+v("EDCR_BUILDING_HEIGHT_LABEL"),text:v(null==y||null===(u=y.planDetail)||void 0===u||null===(d=u.blocks[0])||void 0===d||null===(c=d.building)||void 0===c?void 0:c.buildingHeight),className:"border-none"}),l.createElement(o.Row,{label:""+v("BPA_ARCHITECT_NAME_LABEL"),text:v(null==y?void 0:y.appliedBy),className:"border-none"})),l.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",height:"2px",marginTop:"20px",marginBottom:"20px"}}),l.createElement("h1",{style:{fontSize:"18px",lineHeight:"21px",fontWeight:"700",padding:"0px 0px 16px 0px"}},""+v("BPA_PERMIT_EDCR_DETAILS_LABEL")),l.createElement(o.StatusTable,null,l.createElement(o.Row,{label:""+v("BPA_EDCR_NO_LABEL"),text:v(null==y?void 0:y.edcrNumber),className:"border-none"})),l.createElement("h1",{style:{fontSize:"18px",lineHeight:"21px",fontWeight:"700",padding:"0px 0px 16px 0px"}},""+v("BPA_UPLOADED_PLAN_DIAGRAM_LABEL")),l.createElement("a",{target:"_",href:null==y?void 0:y.updatedDxfFile,style:{minWidth:"160px",marginRight:"20px"},key:null==y?void 0:y.updatedDxfFile},l.createElement(o.PDFSvg,null),l.createElement("p",{style:{marginTop:"8px",fontWeight:"bold",fontSize:"14px",lineHeight:"19px",color:"#505A5F",fontWeight:"400"}},v("BPA_UPLOADED_PLAN_DXF"))),l.createElement("h1",{style:{fontSize:"18px",lineHeight:"21px",fontWeight:"700",padding:"0px 0px 16px 0px"}},""+v("BPA_SCRUTINY_REPORT_OUTPUT_LABEL")),l.createElement("a",{target:"_",href:null==y?void 0:y.planReport,style:{minWidth:"160px",marginRight:"20px"},key:null==y?void 0:y.planReport},l.createElement(o.PDFSvg,null),l.createElement("p",{style:{marginTop:"8px",fontWeight:"bold",fontSize:"14px",lineHeight:"19px",color:"#505A5F",fontWeight:"400"}},v("BPA_SCRUTINY_REPORT_PDF"))),l.createElement("div",{onClick:()=>{m(p.key,y)}},l.createElement(o.SubmitBar,{label:v("BPA_PROCEED_OC_SCRUTINY_LABEL")}))):null)},OCUploadPlanDiagram:e=>{var n;let{t:a,config:r,onSelect:u,formData:d,ownerIndex:s=0,isShowToast:c,isSubmitBtnDisable:v,setIsShowToast:p}=e;Digit.ULBService.getCurrentTenantId(),Digit.ULBService.getStateId();const[m,E]=t.useState(()=>{var e;return(null==d||null===(e=d.uploadData)||void 0===e?void 0:e.file)||null}),[_,f]=t.useState(null==d||null===(n=d.uploadData)||void 0===n?void 0:n.file),[A,g]=t.useState(""),S=i.useHistory();return t.useEffect(()=>{(A||c)&&(E(null),f(""),g("")),c&&S.push("/digit-ui/citizen/obps/edcrscrutiny/oc-apply/acknowledgement",{data:null!=c&&c.label?null==c?void 0:c.label:"BPA_INTERNAL_SERVER_ERROR",type:"ERROR"})},[A,c,v]),v?l.createElement(o.Loader,null):l.createElement(o.FormStep,{t:a,config:r,onSelect:()=>{const e={};e.file=_,u(r.key,e,!0,!0)},onSkip:()=>{},isDisabled:!_||v,onAdd:function(){},isMultipleAllow:!0},l.createElement(o.CardLabel,null,a("BPA_OC_PLAN_DIAGRAM_DXF")+" *"),l.createElement(o.UploadFile,{id:"oc-doc",extraStyleName:"propertyCreate",onUpload:function(e){E(e.target.files[0]),f(e.target.files[0])},onDelete:()=>{E(null),f("")},message:m?"1 "+a("PT_ACTION_FILEUPLOADED"):a("ES_NO_FILE_SELECTED_LABEL"),uploadMessage:A}),l.createElement("div",{style:{disabled:"true",height:"30px",width:"100%",fontSize:"14px"}}),c&&l.createElement(o.Toast,{error:c.key,label:a(c.label),onClose:()=>p(null),isDleteBtn:!0}))},StakeholderDocsRequired:e=>{var a,r,u,d;let{onSelect:s}=e;const{t:c}=n.useTranslation(),v=Digit.ULBService.getCurrentTenantId(),p=Digit.ULBService.getStateId(),{data:m,isLoading:E}=(i.useHistory(),Digit.Hooks.obps.useMDMS(p,"StakeholderRegistraition","TradeTypetoRoleMapping"));let _=window.location.href.includes("/openlink/");return Digit.Utils.browser.isMobile(),t.useEffect(()=>{v&&Digit.LocalizationService.getLocale({modules:["rainmaker-bpareg"],locale:Digit.StoreData.getCurrentLanguage(),tenantId:""+v})},[v]),E?l.createElement(o.Loader,null):l.createElement(t.Fragment,null,l.createElement("div",{className:_?"OpenlinkContainer":""},l.createElement(o.Card,null,l.createElement(o.CardHeader,null,c("BPA_NEW_BUILDING_HEADER")),l.createElement(o.CardText,{style:{color:"#0B0C0C",marginTop:"12px",fontSize:"16px",fontWeight:"400",lineHeight:"24px"}},c("BPA_NEW_BUILDING_PERMIT_DESCRIPTION")),E?l.createElement(o.Loader,null):l.createElement(t.Fragment,null,null==m||null===(a=m.StakeholderRegistraition)||void 0===a||null===(r=a.TradeTypetoRoleMapping)||void 0===r||null===(u=r[0])||void 0===u||null===(d=u.docTypes)||void 0===d?void 0:d.map((e,t)=>l.createElement("div",null,l.createElement("div",{style:{fontWeight:700,marginBottom:"8px"},key:t},l.createElement("div",{style:{display:"flex"}},l.createElement("div",{style:{minWidth:"20px"}},t+1+"."," "),l.createElement("div",null," "+c("BPAREG_HEADER_"+(null==e?void 0:e.code.replace(".","_")))))),l.createElement("div",{style:{marginBottom:"16px"}},l.createElement("div",{style:{display:"flex"}},l.createElement("div",{style:{minWidth:"20px"}}),null!=e&&e.info?l.createElement("div",{style:{color:"#505A5F",fontSize:"16px"}},""+c(null==e?void 0:e.info.replace(".","_"))):null))))),l.createElement(o.SubmitBar,{label:c("CS_COMMON_NEXT"),onSubmit:s})),l.createElement(o.CitizenInfoLabel,{info:c("CS_FILE_APPLICATION_INFO_LABEL"),text:c("OBPS_DOCS_FILE_SIZE"),className:"info-banner-wrap-citizen-override"})))},LicenseType:e=>{var n,i,a,r,u,d,s,c,v,p,m,E,_,f,A,g,S,h,y,D;let{t:T,config:b,onSelect:C,formData:P}=e;null!==JSON.parse(sessionStorage.getItem("BPAREGintermediateValue"))?(P=JSON.parse(sessionStorage.getItem("BPAREGintermediateValue")),sessionStorage.setItem("BPAREGintermediateValue",null)):P=P,null===(n=window.location.href)||void 0===n||n.split("/").pop(),Digit.ULBService.getCurrentTenantId();const N=Digit.ULBService.getStateId(),[I,L]=t.useState((null===(i=P)||void 0===i||null===(a=i.LicneseType)||void 0===a?void 0:a.qualificationType)||null),[B,O]=t.useState((null===(r=P)||void 0===r||null===(u=r.LicneseType)||void 0===u?void 0:u.LicenseType)||(null===(d=P)||void 0===d||null===(s=d.formData)||void 0===s||null===(c=s.LicneseType)||void 0===c?void 0:c.LicenseType)||null),[R,w]=t.useState((null===(v=P)||void 0===v||null===(p=v.LicneseType)||void 0===p?void 0:p.ArchitectNo)||(null===(m=P)||void 0===m||null===(E=m.formData)||void 0===E||null===(_=E.LicneseType)||void 0===_?void 0:_.ArchitectNo)||null),{data:x}=Digit.Hooks.obps.useQualificationTypes(N),{data:M}=Digit.Hooks.obps.useMDMS(N,"StakeholderRegistraition","TradeTypetoRoleMapping"),{data:F}=Digit.Hooks.useCustomMDMS(N,"StakeholderRegistraition",[{name:"TradeTypetoRoleMapping"}]),k=null==F||null===(f=F.StakeholderRegistraition)||void 0===f?void 0:f.TradeTypetoRoleMapping;let U=window.location.href.includes("/openlink/");Digit.Utils.browser.isMobile();const[H,W]=t.useState((null===(A=P)||void 0===A?void 0:A.selfCertification)||(null===(g=P)||void 0===g||null===(S=g.formData)||void 0===S?void 0:S.selfCertification)||null);console.log("OBPS_Formdata",P);const[G,j]=t.useState("");function K(){let e=[];return null==k||k.forEach(t=>{if("true"===(null==t?void 0:t.isActive)){var l;console.log("item=====",t);const n="TRADELICENSE_TRADETYPE_"+(null==t||null===(l=t.tradeType)||void 0===l?void 0:l.split(".")[0]);e.some(e=>e.i18nKey===n)||e.push({role:t.role,i18nKey:n,tradeType:t.tradeType,code:null==t?void 0:t.code})}}),console.log("list",e),e}function Y(e){let t=null;"B-Arch"==e.name?t=K().find(e=>e.i18nKey.includes("ARCHITECT")):"BE/B-Tech"==e.name?t=K().find(e=>e.i18nKey.includes("ENGINEER")):"Diploma in Civil Engineering/Architect"==e.name?t=K().find(e=>e.i18nKey.includes("SUPERVISOR")):"Town and Country Planning"==e.name&&(t=K().find(e=>e.i18nKey.includes("TOWNPLANNER"))),t&&O(t)}return U&&(window.onunload=function(){sessionStorage.removeItem("Digit.BUILDING_PERMIT")}),t.useEffect(()=>{I&&Y(I)},[I]),console.log("qualificationTypeFinfing",I),t.useEffect(()=>{var e,t,l,n;if(console.log("selectedQualificationType 1",x,null===(e=P)||void 0===e||null===(t=e.LicneseType)||void 0===t?void 0:t.qualificationType,x),null!==(l=P)&&void 0!==l&&null!==(n=l.LicneseType)&&void 0!==n&&n.qualificationType&&x&&!I){var i,o;const e=x.find(e=>{var t,l;return e.name===(null===(t=P)||void 0===t||null===(l=t.LicneseType)||void 0===l?void 0:l.qualificationType)});L(e),console.log("selectedQualificationType",e,null===(i=P)||void 0===i||null===(o=i.LicneseType)||void 0===o?void 0:o.qualificationType,x)}},[]),console.log("License Type List",K()),console.log("formData in LicenseType",P),l.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-start"}},l.createElement("div",{style:{flex:1,marginRight:"20px"}},l.createElement("div",{className:U?"OpenlinkContainer":""},U&&l.createElement(o.BackButton,{style:{border:"none"}},T("CS_COMMON_BACK")),l.createElement(zl,{currentStep:1,flow:"STAKEHOLDER"}),l.createElement(o.FormStep,{t:T,config:b,onSelect:function(){var e,t,l,n;if(""===G)if(null!=B&&B.i18nKey.includes("ARCHITECT")&&null===R)j(T("BPA_INVALID_MESSAGE_FOR_COA"));else if(null!=B&&B.i18nKey.includes("TOWNPLANNER")&&null===R)j(T("BPA_INVALID_MESSAGE_FOR_AITP_OR_FITP"));else if(null!==I)if(null!==(e=P)&&void 0!==e&&e.result&&null!==(t=P)&&void 0!==t&&null!==(l=t.result)&&void 0!==l&&null!==(n=l.Licenses[0])&&void 0!==n&&n.id){var i;let e=null===(i=P)||void 0===i?void 0:i.formData;e.LicneseType.LicenseType=B,e.LicneseType.ArchitectNo=R,e.LicneseType.selfCertification=H||!1,e.qualificationType=I,C("",P)}else C(b.key,{LicenseType:B,ArchitectNo:R,selfCertification:H,qualificationType:I});else j(T("BPA_SELECT_QUALIFICATION_TYPE"))},onSkip:()=>C(),isDisabled:(null==B?void 0:B.i18nKey.includes("ARCHITECT"))&&!R||(null==B?void 0:B.i18nKey.includes("TOWNPLANNER"))&&!R||!I},l.createElement(o.CardLabel,null,T("BPA_QUALIFICATION_TYPE"),"*"),l.createElement("div",{className:"form-pt-dropdown-only"},l.createElement(o.Dropdown,{t:T,optionKey:"name",isMandatory:b.isMandatory,option:x||[],selected:I,select:e=>{!function(e){L(e),Y(e),O(null),w(null),j("")}(e)}})),l.createElement(o.CardLabel,null,T("BPA_LICENSE_TYPE"),"*"),l.createElement("div",{className:"form-pt-dropdown-only"},M&&l.createElement(o.Dropdown,{t:T,optionKey:"code",isMandatory:b.isMandatory,option:K()||{},selected:B,select:function(e){O(e)},disable:!0})),B&&(null==B?void 0:B.i18nKey.includes("ARCHITECT"))&&l.createElement("div",null,l.createElement(o.CardLabel,null,T("BPA_COUNCIL_NUMBER")+"*"),l.createElement(o.TextInput,{t:T,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"ArchitectNo",value:R,onChange:function(e){const t=e.target.value.trim();w(t),function(e){const t=e.match(/^CA\/(\d{4})\/\d{5}$/);if(!t)return!1;const l=parseInt(t[1],10),n=(new Date).getFullYear();return l>=1972&&l<=n}(t)||""===t?j(""):j(T("BPA_INVALID_MESSAGE_FOR_COA"))},onKeyPress:e=>{"Enter"===e.key&&e.preventDefault()}}),G&&l.createElement("div",{style:{color:"#d32f2f",fontSize:"12px",marginTop:"4px",marginBottom:"12px"}},G)),B&&(null==B?void 0:B.i18nKey.includes("TOWNPLANNER"))&&l.createElement("div",null,l.createElement(o.CardLabel,null,T("BPA_ASSOCIATE_OR_FELLOW_NUMBER"),"*"),l.createElement(o.TextInput,{t:T,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"ArchitectNo",value:R,onChange:function(e){const t=e.target.value.trim();w(t),function(e){const t=e.match(/^(AITP|FITP)\/(\d{4})\/\d{4}$/);if(!t)return!1;const l=parseInt(t[2],10);return l>=1972&&l<=(new Date).getFullYear()}(t)||""===t?j(""):j(T("BPA_INVALID_MESSAGE_FOR_AITP_OR_FITP"))},onKeyPress:e=>{"Enter"===e.key&&e.preventDefault()}}),G&&l.createElement("div",{style:{color:"#d32f2f",fontSize:"12px",marginTop:"4px",marginBottom:"12px"}},G)),B&&((null==B?void 0:B.i18nKey.includes("ARCHITECT"))||(null==B?void 0:B.i18nKey.includes("_ENGINEER"))||(null==B?void 0:B.i18nKey.includes("SUPERVISOR")))&&l.createElement("div",null,l.createElement(o.CheckBox,{label:null!=B&&B.i18nKey.includes("ARCHITECT")?T("DECLARATION_SELF_CERTIFICATION_RESIDENTIAL_ARCHITECT"):null!=B&&B.i18nKey.includes("_ENGINEER")?T("DECLARATION_SELF_CERTIFICATION_RESIDENTIAL_ENGINEER"):null!=B&&B.i18nKey.includes("SUPERVISOR")?T("DECLARATION_SELF_CERTIFICATION_RESIDENTIAL_SUPERVISOR"):T("DECLARATION_SELF_CERTIFICATION_RESIDENTIAL_DESIGNER"),onChange:function(e){W(e.target.checked)},value:H,checked:H||!1,style:{marginBottom:"40px"}}))),l.createElement("div",{style:{flex:"0 0 30%",border:"1px solid #dcdcdc",backgroundColor:"#f9f9f9",borderRadius:"8px",padding:"20px",boxShadow:"0 4px 8px rgba(0, 0, 0, 0.1)",marginTop:"20px"}},l.createElement("h1",{style:{fontSize:"22px",fontWeight:"600",color:"#333",marginBottom:"10px",textAlign:"center",textTransform:"uppercase",letterSpacing:"1px"}},T("BPA_COMPETENCIES")),l.createElement("ul",{style:{fontSize:"16px",color:"#555",lineHeight:"1.6",textAlign:"justify",margin:"0",paddingLeft:"20px"}},B&&(null===(h=Dn[null==B||null===(D=B.i18nKey)||void 0===D?void 0:D.split("_").pop()])||void 0===h||null===(y=h.split("\n"))||void 0===y?void 0:y.map((e,t)=>l.createElement("li",{key:t,style:{marginBottom:"8px"}},e.trim()))))))))},LicenseDetails:e=>{var n,a,r,u,d,c,v,p,m,E,_,f,A,g,S,h,y,D,T,b,C,P,N;let{t:I,config:L,onSelect:B,formData:O}=e;i.useLocation();const R=Digit.UserService.getUser();let w={};const x=Digit.ULBService.getCurrentTenantId();let M=window.location.href.includes("openlink");const F=null==R||null===(n=R.info)||void 0===n?void 0:n.uuid,{data:k,isLoading:U}=Digit.Hooks.useUserSearch(x,{uuid:[F]},{},{enabled:!!F}),[H,W]=t.useState(()=>{var e,t;const l=((null==O||null===(e=O.LicneseDetails)||void 0===e?void 0:e.name)||(M?"":null==R||null===(t=R.info)||void 0===t?void 0:t.name)||"").trim().split(" ");return l.length?l[0]:""}),[G,j]=t.useState(()=>{var e,t;const l=((null==O||null===(e=O.LicneseDetails)||void 0===e?void 0:e.name)||(M?"":null==R||null===(t=R.info)||void 0===t?void 0:t.name)||"").trim().split(" ");return l.length>1?l[l.length-1]:""}),[K,Y]=t.useState(()=>{var e,t;const l=((null==O||null===(e=O.LicneseDetails)||void 0===e?void 0:e.name)||(M?"":null==R||null===(t=R.info)||void 0===t?void 0:t.name)||"").trim().split(" ");return l.length>2?l.slice(1,-1).join(" "):""}),[$,z]=t.useState(""),[V,q]=t.useState(""),[X,J]=t.useState(!0),[Z,Q]=t.useState((null==O||null===(a=O.LicneseDetails)||void 0===a?void 0:a.dateOfBirth)||""),[ee,te]=t.useState((M?"":null==R||null===(r=R.info)||void 0===r?void 0:r.emailId)||(null==O||null===(u=O.LicneseDetails)||void 0===u?void 0:u.email)||(null==O||null===(d=O.formData)||void 0===d||null===(c=d.LicneseDetails)||void 0===c?void 0:c.email)||""),[le,ne]=t.useState((null==O||null===(v=O.LicneseDetails)||void 0===v?void 0:v.gender)||(!M&&k?{i18nKey:"COMMON_GENDER_"+(null==k||null===(p=k.user)||void 0===p||null===(m=p[0])||void 0===m?void 0:m.gender),code:null==k||null===(E=k.user)||void 0===E||null===(_=E[0])||void 0===_?void 0:_.gender,value:null==k||null===(f=k.user)||void 0===f||null===(A=f[0])||void 0===A?void 0:A.gender}:"")||(null==O||null===(g=O.formData)||void 0===g||null===(S=g.LicneseDetails)||void 0===S?void 0:S.gender)),[ie,oe]=t.useState((M?"":null==R||null===(h=R.info)||void 0===h?void 0:h.mobileNumber)||(null==O||null===(y=O.LicneseDetails)||void 0===y?void 0:y.mobileNumber)||(null==O||null===(D=O.formData)||void 0===D||null===(T=D.LicneseDetails)||void 0===T?void 0:T.mobileNumber)||""),[ae,re]=t.useState((null==O||null===(b=O.LicneseDetails)||void 0===b?void 0:b.PanNumber)||(null==O||null===(C=O.formData)||void 0===C||null===(P=C.LicneseDetails)||void 0===P?void 0:P.PanNumber)||""),[ue,de]=t.useState("");t.useEffect(()=>{var e,t,l,n,i,o,a,r;null!=le&&le.code||null==k||null===(e=k.user)||void 0===e||null===(t=e[0])||void 0===t||!t.gender||M||ne({i18nKey:"COMMON_GENDER_"+(null==k||null===(l=k.user)||void 0===l||null===(n=l[0])||void 0===n?void 0:n.gender),code:null==k||null===(i=k.user)||void 0===i||null===(o=i[0])||void 0===o?void 0:o.gender,value:null==k||null===(a=k.user)||void 0===a||null===(r=a[0])||void 0===r?void 0:r.gender})},[k]);const se=Digit.ULBService.getStateId();Digit.Utils.browser.isMobile(),M&&(window.onunload=function(){sessionStorage.removeItem("Digit.BUILDING_PERMIT")});const{isLoading:ce,data:ve}=Digit.Hooks.obps.useMDMS(se,"common-masters",["GenderType"]);let pe=[];return ve&&ve["common-masters"].GenderType.filter(e=>e.active).map(e=>{pe.push({i18nKey:"COMMON_GENDER_"+e.code,code:""+e.code,value:""+e.code})}),U?l.createElement(o.Loader,null):l.createElement("div",null,l.createElement("div",{className:M?"OpenlinkContainer":""},M&&l.createElement(o.BackButton,{style:{border:"none"}},I("CS_COMMON_BACK")),l.createElement(zl,{currentStep:1,flow:"STAKEHOLDER"}),ce&&U?l.createElement(o.Loader,null):l.createElement(o.FormStep,{config:L,onSelect:()=>{var e,t;const l=new Date,n=new Date(Z);let i=l.getFullYear()-n.getFullYear();const o=l.getMonth()-n.getMonth();if((o<0||0===o&&l.getDate()<n.getDate())&&i--,null!==(null==le?void 0:le.code)){if(null!=O&&O.result&&null!=O&&null!==(e=O.result)&&void 0!==e&&null!==(t=e.Licenses[0])&&void 0!==t&&t.id){let e=null==O?void 0:O.formData;e.LicneseDetails.name=H,e.LicneseDetails.mobileNumber=ie,e.LicneseDetails.gender=le,e.LicneseDetails.email=ee,e.LicneseDetails.PanNumber=ae,B("",O)}else B(L.key,{name:`${H} ${K} ${G}`,mobileNumber:ie,gender:le,email:ee,PanNumber:ae,dateOfBirth:Z});i<18&&alert(I("BPA_DOB_VALIDATION_MESSAGE"))}else de(I("BPA_APPLICANT_GENDER_PLACEHOLDER"))},onSkip:()=>B(),t:I,isDisabled:!(H&&ie&&le&&Z)},l.createElement("div",null,l.createElement(o.CardLabel,null,I("BPA_FIRST_NAME"),"*"),l.createElement(o.TextInput,s({t:I,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"name",value:H,onChange:function(e){W(e.target.value)},disable:!(!H||M)},w={isRequired:!0,pattern:"^[a-zA-Z ]*$",type:"text",title:I("PT_NAME_ERROR_MESSAGE")})),l.createElement(o.CardLabel,null,I("BPA_MIDDLE_NAME")),l.createElement(o.TextInput,s({t:I,type:"text",isMandatory:!1,name:"Mname",value:K,onChange:function(e){Y(e.target.value)}},w={isRequired:!1,pattern:"^[a-zA-Z ]*$",type:"text",title:I("PT_NAME_ERROR_MESSAGE")})),l.createElement(o.CardLabel,null,I("BPA_LAST_NAME"),"*"),l.createElement(o.TextInput,s({t:I,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"Lname",value:G,onChange:function(e){j(e.target.value)}},w={isRequired:!0,pattern:"^[a-zA-Z ]*$",type:"text",title:I("PT_NAME_ERROR_MESSAGE")})),l.createElement(o.CardLabel,null,I("BPA_APPLICANT_DOB_LABEL"),"*"),l.createElement(o.DatePicker,{date:Z,onChange:function(e){const t=new Date,l=new Date(e);let n=t.getFullYear()-l.getFullYear();const i=t.getMonth()-l.getMonth();(i<0||0===i&&t.getDate()<l.getDate())&&n--,n<18?alert(I("BPA_DOB_VALIDATION_MESSAGE")):Q(e)},min:"1900-01-01",max:(new Date).toISOString().split("T")[0],isRequired:!0}),l.createElement("div",null,l.createElement(o.CardLabel,null,I("BPA_APPLICANT_GENDER_LABEL")+"*"),l.createElement(o.RadioButtons,{t:I,options:pe,optionsKey:"code",name:"gender",value:le,selectedOption:le,onSelect:function(e){ne(e)},isDependent:!0,labelKey:"COMMON_GENDER",disable:!(!le||M)}),ue&&l.createElement("div",{style:{color:"#d32f2f",fontSize:"12px",marginTop:"4px",marginBottom:"12px"}},ue)),l.createElement(o.CardLabel,null,I("BPA_APPLICANT_MOBILE_NO_LABEL")+"*"),l.createElement(o.MobileNumber,{value:ie,name:"mobileNumber",onChange:e=>{oe({value:e}.value)},disable:!(!ie||M),required:!0,pattern:"[6-9]{1}[0-9]{9}",type:"tel",title:I("CORE_COMMON_APPLICANT_MOBILE_NUMBER_INVALID")}),l.createElement(o.CardLabel,null,I("BPA_APPLICANT_EMAIL_LABEL")),l.createElement(o.TextInput,{t:I,type:"email",isMandatory:!1,optionKey:"i18nKey",name:"email",value:ee,onChange:function(e){te(e.target.value)},disable:!(null==R||null===(N=R.info)||void 0===N||!N.emailId||M),required:!0,pattern:"[A-Za-z0-9._%+-]+@[a-z0-9.-]+.[a-z]{2,4}$",type:"email",title:I("CORE_COMMON_APPLICANT_MOBILE_NUMBER_INVALID")})))))},CorrospondenceAddress:e=>{var n,i;let{t:a,config:r,onSelect:u,formData:d}=e;const[s,c]=t.useState((null==d?void 0:d.Correspondenceaddress)||(null==d||null===(n=d.formData)||void 0===n?void 0:n.Correspondenceaddress)||""),[v,p]=t.useState((null==d?void 0:d.isAddressSame)||(null==d||null===(i=d.formData)||void 0===i?void 0:i.isAddressSame)||!1),[m,E]=t.useState(null),[_,f]=t.useState(null),[A,g]=t.useState(!1),S=Digit.ULBService.getCurrentTenantId(),h=Digit.ULBService.getStateId();let y=window.location.href.includes("/openlink/");return Digit.Utils.browser.isMobile(),y&&(window.onunload=function(){sessionStorage.removeItem("Digit.BUILDING_PERMIT")}),l.createElement(l.Fragment,null,l.createElement("div",{className:y?"OpenlinkContainer":""},y&&l.createElement(o.BackButton,{style:{border:"none"}},a("CS_COMMON_BACK")),l.createElement(zl,{currentStep:2,flow:"STAKEHOLDER"}),l.createElement(o.FormStep,{config:r,onSelect:()=>{var e,t;if(null!=d&&d.result&&null!=d&&null!==(e=d.result)&&void 0!==e&&null!==(t=e.Licenses[0])&&void 0!==t&&t.id)d.Correspondenceaddress=s,d.isAddressSame=v,u("",d,"",!0);else{var l,n,i,o,a,r,c,p,m,_,A,y,D,T,b,C,P,N,I,L;g(!0),console.log("dob here in payload",null!=d&&null!==(l=d.LicneseDetails)&&void 0!==l&&l.dateOfBirth?Bt(null==d||null===(n=d.LicenseDetails)||void 0===n?void 0:n.dateOfBirth):null);let e={Licenses:[{tradeLicenseDetail:{owners:[{gender:null==d||null===(i=d.LicneseDetails)||void 0===i||null===(o=i.gender)||void 0===o?void 0:o.code,mobileNumber:null==d||null===(a=d.LicneseDetails)||void 0===a?void 0:a.mobileNumber,name:null==d||null===(r=d.LicneseDetails)||void 0===r?void 0:r.name,dob:null!=d&&null!==(c=d.LicneseDetails)&&void 0!==c&&c.dateOfBirth?Bt(null==d||null===(p=d.LicenseDetails)||void 0===p?void 0:p.dateOfBirth):null,emailId:null==d||null===(m=d.LicneseDetails)||void 0===m?void 0:m.email,permanentAddress:null==d||null===(_=d.LicneseDetails)||void 0===_?void 0:_.PermanentAddress,correspondenceAddress:s,pan:null==d||null===(A=d.LicneseDetails)||void 0===A?void 0:A.PanNumber}],subOwnerShipCategory:"INDIVIDUAL",tradeUnits:[{tradeType:null==d||null===(y=d.LicneseType)||void 0===y||null===(D=y.LicenseType)||void 0===D?void 0:D.tradeType}],additionalDetail:{qualificationType:null==d||null===(T=d.LicneseType)||void 0===T||null===(b=T.qualificationType)||void 0===b?void 0:b.name,counsilForArchNo:null==d||null===(C=d.LicneseType)||void 0===C?void 0:C.ArchitectNo,isSelfCertificationRequired:null!=d&&null!==(P=d.LicneseType)&&void 0!==P&&P.selfCertification?null==d||null===(N=d.LicneseType)||void 0===N?void 0:N.selfCertification:null,Ulb:null==d||null===(I=d.LicneseDetails)||void 0===I?void 0:I.Ulb},address:{city:"",landmark:"",pincode:null==d||null===(L=d.LicneseDetails)||void 0===L?void 0:L.Pincode},institution:null,applicationDocuments:null},licenseType:"PERMANENT",businessService:"BPAREG",tenantId:h,action:"NOWORKFLOW"}]};Digit.OBPSService.BPAREGCreate(e,S).then((e,t)=>{g(!1),u("",{result:e,formData:d,Correspondenceaddress:s,isAddressSame:v},"",!0)}).catch(e=>{var t,l,n,i,o,a;g(!1),f({key:"error"}),console.log("error message here",null==e||null===(t=e.response)||void 0===t||null===(l=t.data)||void 0===l||null===(n=l.Errors[0])||void 0===n?void 0:n.message),E((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.message)||null)})}},onSkip:()=>u(),t:a,isDisabled:A},l.createElement(o.CheckBox,{label:a("BPA_SAME_AS_PERMANENT_ADDRESS"),onChange:e=>{var t,l,n,i;0==v?(p(!0),c(null!=d&&null!==(t=d.LicneseDetails)&&void 0!==t&&t.PermanentAddress?null==d||null===(l=d.LicneseDetails)||void 0===l?void 0:l.PermanentAddress:null==d||null===(n=d.formData)||void 0===n||null===(i=n.LicneseDetails)||void 0===i?void 0:i.PermanentAddress)):(Array.from(document.querySelectorAll("input")).forEach(e=>e.value=""),p(!1),c(""))},checked:v,style:{paddingBottom:"10px",paddingTop:"10px"}}),l.createElement(o.CardLabel,null,""+a("BPA_APPLICANT_CORRESPONDENCE_ADDRESS_LABEL")),l.createElement(o.TextArea,{t:a,isMandatory:!1,type:"text",optionKey:"i18nKey",name:"Correspondenceaddress",onChange:function(e){c(e.target.value)},value:s,disable:v}))),l.createElement("div",{style:{disabled:"true",height:"30px",width:"100%",fontSize:"14px"}}),_&&l.createElement(o.Toast,{error:"error"===(null==_?void 0:_.key),label:m,isDleteBtn:!0,onClose:()=>{f(null),E(null)}}))},PermanentAddress:e=>{var n,i,a,r,u,d,c,v,p,m,E;let{t:_,config:f,onSelect:A,formData:g}=e,S={};const[h,y]=t.useState((null==g||null===(n=g.LicneseDetails)||void 0===n?void 0:n.PermanentAddress)||(null==g||null===(i=g.formData)||void 0===i||null===(a=i.LicneseDetails)||void 0===a?void 0:a.PermanentAddress)),D=Digit.ULBService.getCurrentTenantId();console.log("tenantId",D),Digit.ULBService.getStateId();let T=window.location.href.includes("/openlink/");Digit.Utils.browser.isMobile();const[b,C]=t.useState((null==g||null===(r=g.LicneseDetails)||void 0===r?void 0:r.Pincode)||(null==g||null===(u=g.formData)||void 0===u||null===(d=u.LicneseDetails)||void 0===d?void 0:d.Pincode)||""),[P,N]=t.useState(""),[I,L]=t.useState((null==g||null===(c=g.LicneseDetails)||void 0===c?void 0:c.Ulb)||(null==g||null===(v=g.formData)||void 0===v||null===(p=v.LicneseDetails)||void 0===p?void 0:p.Ulb)||[]),[B,O]=t.useState("");console.log("formData",g);const R=Digit.SessionStorage.get("OBPS_TENANTS").map(e=>e.name);return t.useEffect(()=>{var e,t;if("BPA_ARCHITECT"==(null==g||null===(e=g.LicneseType)||void 0===e||null===(t=e.LicenseType)||void 0===t?void 0:t.role)){const e=R.map(e=>({ulbname:e}));L(e),console.log("Initial ULBs for BPA_ARCHITECT:",e)}},[null==g||null===(m=g.LicneseType)||void 0===m||null===(E=m.LicenseType)||void 0===E?void 0:E.role]),T&&(window.onunload=function(){sessionStorage.removeItem("Digit.BUILDING_PERMIT")}),t.useEffect(()=>{},[I]),l.createElement(l.Fragment,null,l.createElement("div",{className:T?"OpenlinkContainer":""},T&&l.createElement(o.BackButton,{style:{border:"none"}},_("CS_COMMON_BACK")),l.createElement(zl,{currentStep:2,flow:"STAKEHOLDER"}),l.createElement(o.FormStep,{config:f,onSelect:()=>{var e,t;if(""===b||b.length<6)O(_("BPA_PINCODE_ERROR_MESSAGE"));else if(null!=g&&g.result&&null!=g&&null!==(e=g.result)&&void 0!==e&&null!==(t=e.Licenses[0])&&void 0!==t&&t.id){let e=null==g?void 0:g.formData;console.log("data",e),e.LicneseDetails.PermanentAddress=h,e.LicneseDetails.Ulb=I,e.LicneseDetails.Pincode=b,A("",g)}else A(f.key,{PermanentAddress:h,Pincode:b,Ulb:I})},onSkip:()=>A(),t:_,isDisabled:!h||0===I.length||""===b},l.createElement(o.CardLabel,null,_("BPA_PERMANANT_ADDRESS_LABEL")+"*"),l.createElement(o.TextArea,{t:_,isMandatory:!1,type:"text",optionKey:"i18nKey",name:"PermanentAddress",onChange:function(e){y(e.target.value)},value:h}),l.createElement("div",null,l.createElement(o.CardLabel,null,_("BPA_DETAILS_PIN_LABEL"),"*"),l.createElement(o.TextInput,s({t:_,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"Pcode",minLength:"6",value:b,onChange:function(e){const t=e.target.value;/^[0-9]*$/.test(t)&&t.length<=6&&C(t)}},S={isRequired:!0,pattern:"^[0-9]{6}$",type:"number",title:_("BPA_PINCODE_ERROR_MESSAGE")})),B&&l.createElement("div",{style:{color:"#d32f2f",fontSize:"12px",marginTop:"4px",marginBottom:"12px"}},B)),l.createElement(o.CardLabel,null,"BPA_SELECT_ULB","*"),l.createElement(o.MultiSelectDropdown,{options:R.map(e=>({ulbname:e})),optionsKey:"ulbname",onSelect:e=>function(e){var t,l;const n=e.map(e=>e[1]);if("BPA_ARCHITECT"==(null==g||null===(t=g.LicneseType)||void 0===t||null===(l=t.LicenseType)||void 0===l?void 0:l.role)){const e=R.map(e=>({ulbname:e}));n.length<e.length?(L(n),console.log("Updated ULBs for BPA_ARCHITECT after deselection:",n)):(L(e),console.log("All ULBs selected for BPA_ARCHITECT:",e))}else L(n),console.log("Selected ULB Types:",n)}(e),defaultLabel:_("Select ULBs"),defaultUnit:_("ULBs"),selected:I}))))},StakeholderDocuments:e=>{var n,i,a,r;let{t:u,config:d,onSelect:s,formData:c}=e;Digit.ULBService.getCurrentTenantId();const v=Digit.ULBService.getStateId(),[p,m]=t.useState((null==c||null===(n=c.documents)||void 0===n?void 0:n.documents)||[]),[E,_]=t.useState(null),[f,A]=t.useState([]),[g,S]=t.useState(!0),[h,y]=t.useState(!1),D=!!Digit.Utils.browser.isMobile();let T=window.location.href.includes("/openlink/");T&&(window.onunload=function(){sessionStorage.removeItem("Digit.BUILDING_PERMIT")});const{data:b,isLoading:C}=Digit.Hooks.obps.useMDMS(v,"StakeholderRegistraition","TradeTypetoRoleMapping");return t.useEffect(()=>{var e,t,l,n;let i=[];var o,a;null!=b&&null!==(e=b.StakeholderRegistraition)&&void 0!==e&&e.TradeTypetoRoleMapping&&(i=null==b||null===(o=b.StakeholderRegistraition)||void 0===o||null===(a=o.TradeTypetoRoleMapping)||void 0===a?void 0:a.filter(e=>{var t,l,n;return e.tradeType===(null==c||null===(t=c.formData)||void 0===t||null===(l=t.LicneseType)||void 0===l||null===(n=l.LicenseType)||void 0===n?void 0:n.tradeType)}));let r=[];null===(t=i)||void 0===t||null===(l=t[0])||void 0===l||null===(n=l.docTypes)||void 0===n||n.forEach(e=>{r.push(e)}),A(r)},[!C]),t.useEffect(()=>{let e=0;f.map(t=>{let l=!1;p.map(e=>{t.required&&null!==e&&e&&t.code==`${e.documentType.split(".")[0]}.${e.documentType.split(".")[1]}`&&(l=!0)}),!l&&t.required&&(e+=1)}),S("0"!=e&&0!=e||!(p.length>0))},[p,h]),l.createElement("div",null,l.createElement("div",{className:T?"OpenlinkContainer":""},T&&l.createElement(o.BackButton,{style:{border:"none"}},u("CS_COMMON_BACK")),l.createElement(zl,{currentStep:3,flow:"STAKEHOLDER"}),C?l.createElement(o.Loader,null):l.createElement(o.FormStep,{t:u,config:d,onSelect:()=>{let e,t=c.documents,l=[];f&&p&&null!==p&&f.map((e,t)=>{let n=p.find(t=>t&&null!==t&&t.documentType===e.code);n&&l.push(n)}),e={...t,documents:l},s(d.key,e)},onSkip:()=>s(),isDisabled:g,onAdd:function(){},cardStyle:{paddingRight:"16px"}},null==f?void 0:f.map((e,t)=>l.createElement(Tn,{key:t,document:e,t:u,error:E,setError:_,setDocuments:m,documents:p,setCheckRequiredFields:y,isCitizenUrl:D})),E&&l.createElement(o.Toast,{label:E,isDleteBtn:!0,onClose:()=>_(null),error:!0})),!(null!=c&&c.initiationFlow)&&l.createElement(o.CitizenInfoLabel,{info:u("CS_FILE_APPLICATION_INFO_LABEL"),text:`${u("BPA_APPLICATION_NUMBER_LABEL")} ${null==c||null===(i=c.result)||void 0===i||null===(a=i.Licenses)||void 0===a||null===(r=a[0])||void 0===r?void 0:r.applicationNumber} ${u("BPA_DOCS_INFORMATION")}`,className:"info-banner-wrap-citizen-override"})))},OCBasicDetails:e=>{var i,a,r,u,d,s,c,v,p,E,_,f,A,g,S,h;let{formData:y,onSelect:D,config:T}=e;const[b,C]=t.useState(null),[P,N]=t.useState(null==y||null===(i=y.data)||void 0===i?void 0:i.scrutinyNumber),I=window.Digit.Utils.browser.isMobile(),[L,B]=t.useState(!(null==y||null===(a=y.data)||void 0===a||!a.scrutinyNumber)),{t:O}=n.useTranslation(),R=(Digit.ULBService.getCurrentTenantId(),Digit.ULBService.getStateId()),[w,x]=t.useState((null==y||null===(r=y.data)||void 0===r?void 0:r.bpaData)||{}),[M,F]=t.useState((null==y||null===(u=y.data)||void 0===u?void 0:u.edcrDetails)||null),[k,U]=t.useState(!1),{isMdmsLoading:H,data:W}=Digit.Hooks.obps.useMDMS(R,"BPA",["RiskTypeComputation"]);Digit.Utils.obps.calculateRiskType(null==W||null===(d=W.BPA)||void 0===d?void 0:d.RiskTypeComputation,null==M||null===(s=M.planDetail)||void 0===s||null===(c=s.plot)||void 0===c?void 0:c.area,null==M||null===(v=M.planDetail)||void 0===v?void 0:v.blocks),t.useEffect(()=>{},b);const G=function(){try{return F(null),x(null),U(!0),Promise.resolve((e=null==P?void 0:P.edcrNumber,t=R,Promise.resolve(function(e,t){try{return Promise.resolve(m(function(){return Promise.resolve(Digit.OBPSService.scrutinyDetails(t,{edcrNumber:e}))},function(e){var t,l;return null!=e&&null!==(t=e.response)&&void 0!==t&&t.statusText?null==e||null===(l=e.response)||void 0===l?void 0:l.statusText:"BPA_INTERNAL_SERVER_ERROR"}))}catch(e){return Promise.reject(e)}}(e,t)).then(function(l){var n,i,o,a;return null!=l&&null!==(n=l.edcrDetail)&&void 0!==n&&null!==(i=n[0])&&void 0!==i&&i.edcrNumber?Promise.resolve(Digit.OBPSService.BPASearch(t,{approvalNo:null==l||null===(o=l.edcrDetail)||void 0===o||null===(a=o[0])||void 0===a?void 0:a.permitNumber})).then(function(n){var i,o,a,r;const u=null==n||null===(i=n.BPA)||void 0===i||null===(o=i[0])||void 0===o?void 0:o.edcrNumber;return t=null==n||null===(a=n.BPA)||void 0===a||null===(r=a[0])||void 0===r?void 0:r.tenantId,Promise.resolve(Digit.OBPSService.scrutinyDetails(t,{edcrNumber:u})).then(function(i){return Promise.resolve(Digit.OBPSService.BPASearch(t,{edcrNumber:e})).then(function(e){var t,o,a,r,u;return null!=l&&null!==(t=l.edcrDetail)&&void 0!==t&&null!==(o=t[0])&&void 0!==o&&o.edcrNumber?null!=l&&null!==(a=l.edcrDetail)&&void 0!==a&&null!==(r=a[0])&&void 0!==r&&r.edcrNumber?{ocEdcrDetails:null==l||null===(u=l.edcrDetail)||void 0===u?void 0:u[0],otherDetails:{bpaApprovalResponse:null==n?void 0:n.BPA,edcrDetails:null==i?void 0:i.edcrDetail,bpaResponse:null==e?void 0:e.BPA}}:{type:"ERROR",message:"BPA_NO_RECORD_FOUND"}:{type:"ERROR",message:l||"BPA_NO_RECORD_FOUND"}})})}):{type:"ERROR",message:l||"BPA_NO_RECORD_FOUND"}}))).then(function(e){var t,l,n;U(!1),"ERROR"==(null==e?void 0:e.type)&&(C({key:"true",message:null==e?void 0:e.message}),F(null),x(null));let i=null==e?void 0:e.otherDetails,o=null==e?void 0:e.ocEdcrDetails;if(i&&o&&null!=o&&o.tenantId&&null!=i&&null!==(t=i.edcrDetails)&&void 0!==t&&null!==(l=t[0])&&void 0!==l&&l.tenantId){var a,r,u,d,s,c,v,p,m,E;if((null==i||null===(a=i.edcrDetails)||void 0===a||null===(r=a[0])||void 0===r?void 0:r.tenantId)!=(null==o?void 0:o.tenantId))return void C({key:"true",message:"BPA_INVALID_PERMIT_CITY"});if((null==i||null===(u=i.bpaApprovalResponse)||void 0===u||null===(d=u[0])||void 0===d?void 0:d.edcrNumber)===(null==o?void 0:o.edcrNumber)&&("REJECTED"!=(null==i||null===(s=i.bpaResponse)||void 0===s||null===(c=s[0])||void 0===c?void 0:c.status)&&"PERMIT REVOCATION"!=(null==i||null===(v=i.bpaResponse)||void 0===v||null===(p=v[0])||void 0===p?void 0:p.status)||"INITIATED"!=(null==i||null===(m=i.bpaResponse)||void 0===m||null===(E=m[0])||void 0===E?void 0:E.status)))return void C({key:"true",message:"APPLICATION_NUMBER_ALREADY_EXISTS"});sessionStorage.setItem("checkForProcced",JSON.stringify(!1)),C(null),F(M)}null!=e&&null!==(n=e.ocEdcrDetails)&&void 0!==n&&n.edcrNumber&&(F(null==e?void 0:e.ocEdcrDetails),x(null==e?void 0:e.otherDetails),C(null))})}catch(e){return Promise.reject(e)}var e,t};let j=sessionStorage.getItem("isEDCRDisable");j=JSON.parse(j),t.useEffect(()=>{if(j){let e=sessionStorage.getItem("isEDCRAPIType");e=!!e&&JSON.parse(e),e&&M||(sessionStorage.setItem("isEDCRAPIType",JSON.stringify(!0)),Promise.resolve(G()).then(function(){}))}},[]);const K=e=>{let t=!1;if(w&&M){var l,n,i,o,a,r,u,d,s,c,v,p,m,E,_,f,A;const e=(null==w||null===(l=w.edcrDetails)||void 0===l?void 0:l[0])||{},g=M||{},S=null==g||null===(n=g.planDetail)||void 0===n||null===(i=n.planInformation)||void 0===i?void 0:i.khataNo,h=null==e||null===(o=e.planDetail)||void 0===o||null===(a=o.planInformation)||void 0===a?void 0:a.khataNo,y=null==g||null===(r=g.planDetail)||void 0===r||null===(u=r.planInformation)||void 0===u?void 0:u.plotNo,D=null==e||null===(d=e.planDetail)||void 0===d||null===(s=d.planInformation)||void 0===s?void 0:s.plotNo,T={LOW:0,MEDIUM:1,HIGH:2},b=Digit.Utils.obps.calculateRiskType(null==W||null===(c=W.BPA)||void 0===c?void 0:c.RiskTypeComputation,null==g||null===(v=g.planDetail)||void 0===v||null===(p=v.plot)||void 0===p?void 0:p.area,null==M||null===(m=M.planDetail)||void 0===m?void 0:m.blocks),P=Digit.Utils.obps.calculateRiskType(null==W||null===(E=W.BPA)||void 0===E?void 0:E.RiskTypeComputation,null==e||null===(_=e.planDetail)||void 0===_||null===(f=_.plot)||void 0===f?void 0:f.area,null==M||null===(A=M.planDetail)||void 0===A?void 0:A.blocks);if(S&&h&&y&&D){if(y!=D||S!=h)return S!=h&&y==D?(t=!1,C({key:"true",message:"Khata number from permit order XXXX(permit order number) is not matching with the khata number from occupancy certificate. You cannot proceed with the application"})):y!=D&&S==h?(t=!1,C({key:"true",message:"Plot number from permit order XXXX(permit order number) is not matching with the Plot number from occupancy certificate. You cannot proceed with the application"})):y!=D&&S!=h&&(t=!1,C({key:"true",message:"Khata No and plot No from permit order XXXX(permit order number) is not matching with the Khata No and plot No from occupancy certificate. You cannot proceed with the application"})),!1;t=!0}T[P]<T[b]?(t=!1,C({key:"true",message:O("BPA_RISK_TYPE_VALIDATION_ERROR"),labelName:"The Risk type from permit order XXXX(permit order number) to occupancy certificate application is changed from Low to high .You cannot proceed with the application."})):T[P]>T[b]?(t=JSON.parse(sessionStorage.getItem("checkForProcced")),C({warning:"true",message:O("BPA_RISK_TYPE_VALIDATION_WARNING"),labelName:"The Risk type in permit order XXXX is high where as the risk type in occupancy is Low , do you want to continue"})):t=!0}var g,S,h,y,b,N,I,L;t&&D(null==T?void 0:T.key,{scrutinyNumber:P,applicantName:null==M||null===(g=M.planDetail)||void 0===g||null===(S=g.planInformation)||void 0===S?void 0:S.applicantName,occupancyType:null==M||null===(h=M.planDetail)||void 0===h||null===(y=h.planInformation)||void 0===y?void 0:y.occupancy,applicationType:null==M?void 0:M.appliactionType,serviceType:null==M?void 0:M.applicationSubType,applicationDate:null==M?void 0:M.applicationDate,riskType:Digit.Utils.obps.calculateRiskType(null==W||null===(b=W.BPA)||void 0===b?void 0:b.RiskTypeComputation,null==M||null===(N=M.planDetail)||void 0===N||null===(I=N.plot)||void 0===I?void 0:I.area,null==M||null===(L=M.planDetail)||void 0===L?void 0:L.blocks),bpaData:w,edcrDetails:M})};return H?l.createElement(o.Loader,null):l.createElement("div",null,l.createElement(zl,{currentStep:1,flow:"OCBPA"}),l.createElement("div",{className:I?"obps-search":"",style:I?{}:{maxWidth:"960px",minWidth:"640px",marginRight:"auto"}},l.createElement(o.Label,null,O("OBPS_SEARCH_EDCR_NUMBER")),l.createElement(o.TextInput,{className:"searchInput",onKeyPress:function(e){try{const t=function(t){if(null!=P&&null!==(t=P.edcrNumber)&&void 0!==t&&t.startsWith("OC")){const t=function(){if("Enter"===e.key)return Promise.resolve(G()).then(function(){})}();if(t&&t.then)return t.then(function(){})}else C({key:"true",message:O("BPA_INVALID_OCEDCR_NO"),labelName:"Please enter the valid OCeDCR Number."})}();return Promise.resolve(t&&t.then?t.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},onChange:e=>N({edcrNumber:e.target.value}),value:null==P?void 0:P.edcrNumber,signature:!0,signatureImg:!j&&l.createElement(o.SearchIconSvg,{className:"signature-img",onClick:!j&&null!=P&&P.edcrNumber?()=>function(e){try{const e=function(e){if(null!=P&&null!==(e=P.edcrNumber)&&void 0!==e&&e.startsWith("OC"))return Promise.resolve(G()).then(function(){});C({key:"true",message:O("BPA_INVALID_OCEDCR_NO"),labelName:"Please enter the valid OCeDCR Number."})}();return Promise.resolve(e&&e.then?e.then(function(){}):void 0)}catch(e){return Promise.reject(e)}}():null}),disable:L,style:{marginBottom:"10px"}})),k?l.createElement(o.Loader,null):null,M&&l.createElement(o.Card,null,l.createElement(o.CardCaption,null,O("BPA_SCRUTINY_DETAILS")),l.createElement(o.CardHeader,null,O("BPA_BASIC_DETAILS_TITLE")),l.createElement(o.StatusTable,null,l.createElement(o.Row,{className:"border-none",label:O("BPA_BASIC_DETAILS_APP_DATE_LABEL"),text:null!=M&&M.applicationDate?Hl(new Date(null==M?void 0:M.applicationDate),"dd/MM/yyyy"):null==M?void 0:M.applicationDate}),l.createElement(o.Row,{className:"border-none",label:O("BPA_BASIC_DETAILS_APPLICATION_TYPE_LABEL"),text:O("WF_BPA_"+(null==M?void 0:M.appliactionType))}),l.createElement(o.Row,{className:"border-none",label:O("BPA_BASIC_DETAILS_SERVICE_TYPE_LABEL"),text:O(null==M?void 0:M.applicationSubType)}),l.createElement(o.Row,{className:"border-none",label:O("BPA_BASIC_DETAILS_OCCUPANCY_LABEL"),text:null==M||null===(p=M.planDetail)||void 0===p||null===(E=p.planInformation)||void 0===E?void 0:E.occupancy}),l.createElement(o.Row,{className:"border-none",label:O("BPA_BASIC_DETAILS_RISK_TYPE_LABEL"),text:O("WF_BPA_"+Digit.Utils.obps.calculateRiskType(null==W||null===(_=W.BPA)||void 0===_?void 0:_.RiskTypeComputation,null==M||null===(f=M.planDetail)||void 0===f||null===(A=f.plot)||void 0===A?void 0:A.area,null==M||null===(g=M.planDetail)||void 0===g?void 0:g.blocks))}),l.createElement(o.Row,{className:"border-none",label:O("BPA_BASIC_DETAILS_APPLICATION_NAME_LABEL"),text:null==M||null===(S=M.planDetail)||void 0===S||null===(h=S.planInformation)||void 0===h?void 0:h.applicantName})),l.createElement(o.SubmitBar,{label:O("CS_COMMON_NEXT"),onSubmit:K})),b&&l.createElement(o.Toast,{error:!(null==b||!b.key),warning:!(null==b||!b.warning),label:O(null==b?void 0:b.message),isDleteBtn:!0,onClose:()=>{C(null)},onNo:()=>{C(null)},onYes:()=>{sessionStorage.setItem("checkForProcced",JSON.stringify(!0)),K()},isWarningButtons:!0}))},OBPSSearchApplication:e=>{var n,r,u,d,c,v,p,m,E,_,f,A,g,S,h,y,D;let{t:T,onSubmit:b,data:C,error:P,searchData:N,isLoading:I,Count:L,setparamerror:B}=e;const[O,R]=t.useState(null),w=sessionStorage.getItem("Digit.citizen.userRequestObject"),x=w?JSON.parse(w):{},M=null==x||null===(n=x.value)||void 0===n?void 0:n.info,F=null==x||null===(r=x.value)||void 0===r||null===(u=r.info)||void 0===u?void 0:u.mobileNumber,{register:k,control:U,handleSubmit:H,setValue:W,getValues:G,reset:j,formState:K}=a.useForm({defaultValues:{applicationNo:"",mobileNumber:window.location.href.includes("/search/obps-application")?F:"",name:"",fromDate:"",toDate:"",status:"",offset:0,limit:10,sortBy:"commencementDate",sortOrder:"DESC",applicationType:(null==M||null===(d=M.roles)||void 0===d||null===(c=d.filter(e=>e.code.includes("BPAREG_")))||void 0===c?void 0:c.length)<=0&&(null==M||null===(v=M.roles)||void 0===v?void 0:v.filter(e=>e.code.includes("BPA_")||e.code.includes("CITIZEN")).length)>0?{code:"BUILDING_PLAN_SCRUTINY",i18nKey:"WF_BPA_BUILDING_PLAN_SCRUTINY"}:(null==M||null===(p=M.roles)||void 0===p||null===(m=p.filter(e=>e.code.includes("BPAREG_")))||void 0===m?void 0:m.length)>0&&(null==M||null===(E=M.roles)||void 0===E?void 0:E.filter(e=>e.code.includes("BPA_")||e.code.includes("CITIZEN")).length)<=0?{code:"BPA_STAKEHOLDER_REGISTRATION",i18nKey:"WF_BPA_BPA_STAKEHOLDER_REGISTRATION"}:{code:"BUILDING_PLAN_SCRUTINY",i18nKey:"WF_BPA_BUILDING_PLAN_SCRUTINY"},serviceType:(null==M||null===(_=M.roles)||void 0===_||null===(f=_.filter(e=>e.code.includes("BPAREG_")))||void 0===f?void 0:f.length)<=0&&(null==M||null===(A=M.roles)||void 0===A?void 0:A.filter(e=>e.code.includes("BPA_")||e.code.includes("CITIZEN")).length)>0?{applicationType:["BUILDING_PLAN_SCRUTINY","BUILDING_OC_PLAN_SCRUTINY"],code:"NEW_CONSTRUCTION",i18nKey:"BPA_SERVICETYPE_NEW_CONSTRUCTION"}:(null==M||null===(g=M.roles)||void 0===g||null===(S=g.filter(e=>e.code.includes("BPAREG_")))||void 0===S?void 0:S.length)>0&&(null==M||null===(h=M.roles)||void 0===h?void 0:h.filter(e=>e.code.includes("BPA_")||e.code.includes("CITIZEN")).length)<=0?"":{applicationType:["BUILDING_PLAN_SCRUTINY","BUILDING_OC_PLAN_SCRUTINY"],code:"NEW_CONSTRUCTION",i18nKey:"BPA_SERVICETYPE_NEW_CONSTRUCTION"},...N}});t.useEffect(()=>{k("offset",0),k("limit",10),k("sortBy","commencementDate"),k("sortOrder","DESC")},[k]),l.useEffect(()=>{var e,t,l,n,i,o,a,r,u,d,s,c,v,p;K.isSubmitSuccessful&&j({applicationNo:"",mobileNumber:window.location.href.includes("/search/obps-application")?null===(e=Digit.UserService.getUser())||void 0===e||null===(t=e.info)||void 0===t?void 0:t.mobileNumber:"",name:"",fromDate:"",toDate:"",status:"",offset:0,limit:10,sortBy:"commencementDate",sortOrder:"DESC",applicationType:(null==M||null===(l=M.roles)||void 0===l||null===(n=l.filter(e=>e.code.includes("BPAREG_")))||void 0===n?void 0:n.length)<=0&&(null==M||null===(i=M.roles)||void 0===i?void 0:i.filter(e=>e.code.includes("BPA_")||e.code.includes("citizen")).length)>0?{code:"BUILDING_PLAN_SCRUTINY",i18nKey:"WF_BPA_BUILDING_PLAN_SCRUTINY"}:(null==M||null===(o=M.roles)||void 0===o||null===(a=o.filter(e=>e.code.includes("BPAREG_")))||void 0===a?void 0:a.length)>0&&(null==M||null===(r=M.roles)||void 0===r?void 0:r.filter(e=>e.code.includes("BPA_")||e.code.includes("citizen")).length)<=0?{code:"BPA_STAKEHOLDER_REGISTRATION",i18nKey:"WF_BPA_BPA_STAKEHOLDER_REGISTRATION"}:{code:"BUILDING_PLAN_SCRUTINY",i18nKey:"WF_BPA_BUILDING_PLAN_SCRUTINY"},serviceType:(null==M||null===(u=M.roles)||void 0===u||null===(d=u.filter(e=>e.code.includes("BPAREG_")))||void 0===d?void 0:d.length)<=0&&(null==M||null===(s=M.roles)||void 0===s?void 0:s.filter(e=>e.code.includes("BPA_")||e.code.includes("citizen")).length)>0?{applicationType:["BUILDING_PLAN_SCRUTINY","BUILDING_OC_PLAN_SCRUTINY"],code:"NEW_CONSTRUCTION",i18nKey:"BPA_SERVICETYPE_NEW_CONSTRUCTION"}:(null==M||null===(c=M.roles)||void 0===c||null===(v=c.filter(e=>e.code.includes("BPAREG_")))||void 0===v?void 0:v.length)>0&&(null==M||null===(p=M.roles)||void 0===p?void 0:p.filter(e=>e.code.includes("BPA_")||e.code.includes("citizen")).length)<=0?"":{applicationType:["BUILDING_PLAN_SCRUTINY","BUILDING_OC_PLAN_SCRUTINY"],code:"NEW_CONSTRUCTION",i18nKey:"BPA_SERVICETYPE_NEW_CONSTRUCTION"},...N,isSubmitSuccessful:!1})},[K]);const Y=(e=>{let{t:n}=e;const o=e=>{let t="BPAREG"===e?"search/application/stakeholder":"search/application/bpa";return window.location.href.includes("/citizen")&&(t="BPAREG"===e?"stakeholder":"bpa"),t},a=e=>l.createElement("span",{className:"cell-text"},e);return t.useMemo(()=>[{Header:n("BPA_APPLICATION_NUMBER_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:window.location.href.includes("/citizen")?`/digit-ui/citizen/obps/${o(t.original.businessService)||"--"}/${t.original.applicationNo||t.original.applicationNumber}`:`/digit-ui/employee/obps/${o(t.original.businessService)||"--"}/${t.original.applicationNo||t.original.applicationNumber}`},t.original.applicationNo||t.original.applicationNumber)))}},{Header:n("BPA_COMMON_TABLE_COL_APP_DATE_LABEL"),disableSortBy:!0,accessor:e=>{var t,l;return a(null!=e&&null!==(t=e.auditDetails)&&void 0!==t&&t.createdTime?Ot(null==e||null===(l=e.auditDetails)||void 0===l?void 0:l.createdTime):"")}},{Header:n("BPA_SEARCH_APPLICATION_TYPE_LABEL"),disableSortBy:!0,accessor:"applicationType",Cell:e=>{var t,i,o,a,r,u;let{row:d}=e;return l.createElement("div",null,l.createElement("span",{className:"cell-text"},null!==(t=d.original)&&void 0!==t&&null!==(i=t.additionalDetails)&&void 0!==i&&i.applicationType?n("WF_BPA_"+(null===(o=d.original)||void 0===o||null===(a=o.additionalDetails)||void 0===a?void 0:a.applicationType)):null!==(r=d.original)&&void 0!==r&&r.businessService?n("BPA_APPLICATIONTYPE_"+(null==d||null===(u=d.original)||void 0===u?void 0:u.businessService)):"-"))}},{Header:n("BPA_BASIC_DETAILS_SERVICE_TYPE_LABEL"),disableSortBy:!0,accessor:e=>{var t,l,i,o,r;return a(n((null===(t=e.additionalDetails)||void 0===t?void 0:t.serviceType)||n("TRADELICENSE_TRADETYPE_"+(null==e||null===(l=e.tradeLicenseDetail)||void 0===l||null===(i=l.tradeUnits)||void 0===i||null===(o=i[0])||void 0===o||null===(r=o.tradeType)||void 0===r?void 0:r.split(".")[0]))||"-"))}},{Header:n("BPA_OWNER_HEAD"),accessor:e=>{var t;return a((null==e||null===(t=e.additionalDetails)||void 0===t?void 0:t.ownerName)||"NA")},disableSortBy:!0},{Header:n("BPA_STATUS_LABEL"),accessor:e=>a(n((null==e?void 0:e.state)&&"WF_BPA_"+e.state||(null==e?void 0:e.state)&&"WF_BPA_"+e.status||"NA")),disableSortBy:!0}],[])})({t:T}),[$,z]=t.useState(G("offset")/G("limit"));t.useEffect(()=>{""!==P&&(B(""),R({key:!0,label:P}))},[P]);const V=t.useCallback(e=>{0!==e.length&&(W("sortBy",e.id),W("sortOrder",e.desc?"DESC":"ASC"))},[]);function q(){W("offset",G("offset")-G("limit")),H(b)()}t.useEffect(()=>{null!=G("offset")&&null!=G("limit")&&z(G("offset")/G("limit"))},[G("offset"),G("limit")]);const X=window.Digit.Utils.browser.isMobile(),J={formState:K,Controller:a.Controller,register:k,control:U,t:T,reset:j,previousPage:q},Z=e=>{var t;const l="BPAREG"==(null==C||null===(t=C[0])||void 0===t?void 0:t.businessService)?"BPAREG":e;let n="BPAREG"===l?"search/application/stakeholder":"search/application/bpa";return window.location.href.includes("/citizen")&&(n="BPAREG"===l?"stakeholder":"bpa"),n},Q=t.useMemo(()=>null==C?void 0:C.map(e=>{var t,l,n,i,o,a,r,u;return{[T("BPA_APPLICATION_NUMBER_LABEL")]:e.applicationNo||e.applicationNumber,[T("BPA_COMMON_TABLE_COL_APP_DATE_LABEL")]:Ot(null===(t=e.auditDetails)||void 0===t?void 0:t.createdTime)||"",[T("BPA_SEARCH_APPLICATION_TYPE_LABEL")]:null!=e&&null!==(l=e.additionalDetails)&&void 0!==l&&l.applicationType?T("WF_BPA_"+(null==e||null===(n=e.additionalDetails)||void 0===n?void 0:n.applicationType)):T(null!=e&&e.businessService?"BPA_APPLICATIONTYPE_"+(null==e?void 0:e.businessService):"CS_NA"),[T("BPA_BASIC_DETAILS_SERVICE_TYPE_LABEL")]:T((null===(i=e.additionalDetails)||void 0===i?void 0:i.serviceType)||T("TRADELICENSE_TRADETYPE_"+(null==e||null===(o=e.tradeLicenseDetail)||void 0===o||null===(a=o.tradeUnits)||void 0===a||null===(r=a[0])||void 0===r||null===(u=r.tradeType)||void 0===u?void 0:u.split(".")[0]))||T("CS_NA")),[T("BPA_CURRENT_OWNER_HEAD")]:(null==e?void 0:e.assignee)||T("CS_NA"),[T("BPA_STATUS_LABEL")]:T((null==e?void 0:e.state)&&"WF_BPA_"+e.state||(null==e?void 0:e.state)&&"WF_BPA_"+e.status||T("CS_NA"))}}),[C]);if(X){var ee,te;const[e,n]=t.useReducer(function(e,t){switch(t.type){case"set":return t.payload;case"remove":return!1}},!1),i=()=>{n({type:"remove"})},a=()=>l.createElement("div",{className:"InboxMobilePopupCloseButtonWrapper",onClick:i},l.createElement(o.CloseSvg,null)),r=e=>{let{currentlyActiveMobileModal:n,searchFormFieldsComponentProps:i,...r}=e;const{closeMobilePopupModal:u}=r;switch(n){case"SearchFormComponent":return l.createElement(t.Fragment,null,l.createElement(o.SearchForm,r,l.createElement(a,null),l.createElement("div",{className:"MobilePopupHeadingWrapper"},l.createElement("h2",null,T("ES_COMMON_SEARCH_APPLICATION"),":")),window.location.href.includes("citizen/obps/search/application")&&l.createElement("div",{style:{background:"#ffffff",padding:"20px 0px",color:"#00000099"}},l.createElement("label",null,T("BPA_SEARCH_CREATED_BY_STAKEHOLDER_LABEL"))),l.createElement(Gt,s({},i,{closeMobilePopupModal:u}))));default:return l.createElement("span",null)}},u=t.useCallback(e=>{let{currentlyActiveMobileModal:t,searchFormFieldsComponentProps:l,...n}=e;return r({currentlyActiveMobileModal:t,searchFormFieldsComponentProps:l,...n})},[e]);return I?l.createElement(o.Loader,null):l.createElement(l.Fragment,null,l.createElement("div",{className:"searchBox"},l.createElement(o.SearchAction,{text:T("ES_COMMON_SEARCH_APPLICATION"),handleActionClick:()=>n({type:"set",payload:"SearchFormComponent"})})),e?l.createElement(o.PopUp,null,l.createElement(u,{onSubmit:e=>{n({type:"remove"}),b(e)},handleSubmit:H,id:"search-form",className:"rm-mb form-field-flex-one inboxPopupMobileWrapper",searchFormFieldsComponentProps:J,currentlyActiveMobileModal:e,closeMobilePopupModal:i})):null,null!=C&&null!==(ee=C[0])&&void 0!==ee&&ee.display?l.createElement(o.Card,{style:{marginTop:20}},T(null==C||null===(te=C[0])||void 0===te?void 0:te.display).split("\\n").map((e,t)=>l.createElement("p",{key:t,style:{textAlign:"center"}},e))):l.createElement(o.DetailsCard,{data:Q,isTwoDynamicPrefix:!0,linkPrefix:window.location.href.includes("/citizen")?"/digit-ui/citizen/obps/":"/digit-ui/employee/obps/",getRedirectionLink:Z,serviceRequestIdKey:"applicationNo"}))}return l.createElement(l.Fragment,null,l.createElement(o.Header,null,T("ES_COMMON_SEARCH_APPLICATION")),window.location.href.includes("citizen/obps/search/application")&&l.createElement("div",{style:{background:"#ffffff",paddingLeft:"25px",paddingTop:"10px",color:"#00000099"}},l.createElement("label",null,T("BPA_SEARCH_CREATED_BY_STAKEHOLDER_LABEL"))),l.createElement(o.SearchForm,{onSubmit:b,handleSubmit:H},l.createElement(Gt,J)),!I&&null!=C&&null!==(y=C[0])&&void 0!==y&&y.display?l.createElement(o.Card,{style:{marginTop:20}},T(null==C||null===(D=C[0])||void 0===D?void 0:D.display).split("\\n").map((e,t)=>l.createElement("p",{key:t,style:{textAlign:"center"}},e))):O?"":I?l.createElement(o.Loader,null):l.createElement(o.Table,{t:T,data:C,columns:Y,getCellProps:e=>({style:{minWidth:e.column.Header===T("ES_INBOX_APPLICATION_NO")?"240px":"",padding:"20px 18px",fontSize:"16px"}}),onPageSizeChange:function(e){W("limit",Number(e.target.value)),H(b)()},currentPage:$,onNextPage:function(){W("offset",G("offset")+G("limit")),H(b)()},onPrevPage:q,pageSizeLimit:G("limit"),onSort:V,totalRecords:L,disableSort:!1,onLastPage:()=>{W("offset",L&&10*Math.ceil(L/10)-G("limit")),H(b)()},onFirstPage:()=>{W("offset",0),H(b)()},sortParams:[{id:G("sortBy"),desc:"DESC"===G("sortOrder")}]}),O&&l.createElement(o.Toast,{warning:"BPA_ADD_MORE_PARAM_STAKEHOLDER"==O.label,error:"BPA_ADD_MORE_PARAM_STAKEHOLDER"!=O.label&&O.key,label:T(O.label),isDleteBtn:!0,onClose:()=>{R(null)}}))},InspectionReport:e=>{let{config:a,onSelect:r,userType:u,formData:d,setError:c,formState:v,clearErrors:p}=e;const{t:m}=n.useTranslation(),{pathname:E}=i.useLocation(),_=E.includes("/modify-application/"),[f,A]=t.useState((null==d?void 0:d.FieldReports)||[Bn()]),[g,S]=t.useState({index:-1,type:""}),h=(Digit.ULBService.getCurrentTenantId(),Digit.ULBService.getStateId()),[y,D]=t.useState([]),[T,b]=t.useState([]),[C,P]=t.useState([]),[N,I]=t.useState([]),[L,B]=t.useState([]),[O,R]=t.useState([]),[w,x]=t.useState(!1),[M,F]=t.useState((null==d?void 0:d.tradedetils1)||[]);let k=window.location.href.includes("tl/renew-application-details");window.location.href.includes("tl/renew-application-details")&&(k=!0);const{data:U,isLoading:H}=Digit.Hooks.tl.useTradeLicenseMDMS(h,"TradeLicense","TradeUnits","[?(@.type=='TL')]"),{data:W}=Digit.Hooks.obps.useMDMS(h,"BPA",["CheckList"]);t.useEffect(()=>{const e=f.map(e=>e);r(null==a?void 0:a.key,e),sessionStorage.setItem("INSPECTION_DATA",JSON.stringify(e))},[f]),t.useEffect(()=>{r("tradedetils1",M)},[M]),t.useEffect(()=>{let e=[],t=[];W&&W.BPA.CheckList.map(l=>{"LOW"===(null==l?void 0:l.RiskType)&&"FIELDINSPECTION_PENDING"===(null==l?void 0:l.WFState)&&(e=[...l.questions],t=[...l.docTypes])}),B(t),I(e)},[W]);const G={focusIndex:g,allFieldReport:f,setFocusIndex:S,removeUnit:e=>{A(t=>t.filter(t=>t.key!=e.key))},formData:d,formState:v,setFieldReports:A,t:m,setError:c,clearErrors:p,config:a,onSelect:r,userType:u,tradeCategoryValues:T,tradeTypeOptionsList:C,setTradeTypeOptionsList:P,tradeTypeMdmsData:y,tradeSubTypeOptionsList:O,setTradeSubTypeOptionsList:R,setTradeTypeMdmsData:D,setTradeCategoryValues:b,tradeMdmsData:U,isErrors:w,setIsErrors:x,previousLicenseDetails:M,setPreviousLicenseDetails:F,isLoading:H,bpaDocs:W,type:"LOW",questionList:N,setquestionList:I,documentList:L};return _?l.createElement(l.Fragment,null):l.createElement("div",null,l.createElement(l.Fragment,null,f&&f.map((e,t)=>l.createElement(On,s({key:e.key,index:t,unit:e},G)))),l.createElement(o.LinkButton,{label:m("BPA_ADD_FIELD_INSPECTION"),onClick:()=>{const e=Bn();A(t=>[...t,e])},style:{color:"#a82227",width:"fit-content"}}))},BPAInbox:Gl,StakeholderInbox:e=>{let{parentRoute:r}=e;const{t:u}=n.useTranslation(),d=Digit.ULBService.getStateId(),c={},v={moduleName:"BPAREG",applicationStatus:[],businessService:null,locality:[],assignee:"ASSIGNED_TO_ALL"},p={sortBy:"",limit:window.Digit.Utils.browser.isMobile()?50:10,offset:0,sortOrder:"DESC"},m=Digit.SessionStorage.get("STAKEHOLDER.INBOX"),E=t.useMemo(()=>m||{filterForm:v,searchForm:c,tableForm:p},[Object.values((null==m?void 0:m.filterForm)||{}),Object.values((null==m?void 0:m.searchForm)||{}),Object.values((null==m?void 0:m.tableForm)||{})]),[_,f]=t.useReducer(function(e,t){switch(t.action){case"mutateSearchForm":return Digit.SessionStorage.set("STAKEHOLDER.INBOX",{...e,searchForm:t.data}),{...e,searchForm:t.data};case"mutateFilterForm":return Digit.SessionStorage.set("STAKEHOLDER.INBOX",{...e,filterForm:t.data}),{...e,filterForm:t.data};case"mutateTableForm":return Digit.SessionStorage.set("STAKEHOLDER.INBOX",{...e,tableForm:t.data}),{...e,tableForm:t.data}}},E),{data:A,isLoading:g}=Digit.Hooks.useBoundaryLocalities(d,"revenue",{},u),{isLoading:S,data:{table:h,statuses:y,totalCount:D}={}}=Digit.Hooks.obps.useBPAInbox({tenantId:d,filters:{..._}}),T={logoIcon:l.createElement(o.CaseIcon,null),headerText:"CS_COMMON_OBPS",links:[{text:u("BPA_SEARCH_PAGE_TITLE"),link:"/digit-ui/employee/obps/search/application",businessService:"BPA",roles:["BPAREG_EMPLOYEE","BPAREG_APPROVER","BPAREG_DOC_VERIFIER","BPAREG_DOC_VERIFIER"]}]},b=t.useCallback(e=>{let{registerRef:t,searchFormState:n,searchFieldComponents:i}=e;return l.createElement(Yl,{registerRef:t,searchFormState:n,searchFieldComponents:i})},[]),C=t.useCallback(e=>{let{registerRef:t,controlFilterForm:n,setFilterFormValue:i,getFilterFormValue:o}=e;return l.createElement(Kl,{statuses:y,isInboxLoading:S,registerRef:t,controlFilterForm:n,setFilterFormValue:i,filterFormState:null==_?void 0:_.filterForm,getFilterFormValue:o,localitiesForEmployeesCurrentTenant:A,loadingLocalitiesForEmployeesCurrentTenant:g})},[y,S,A,g]),P={SearchFormFields:b,onSearchFormSubmit:e=>{e.hasOwnProperty("")&&(null==e||delete e[""]),f({action:"mutateTableForm",data:{...p}}),f({action:"mutateSearchForm",data:e})},searchFormDefaultValues:null==_?void 0:_.searchForm,resetSearchFormDefaultValues:c,onSearchFormReset:e=>{e("mobileNumber",null),e("applicationNo",null),f({action:"mutateSearchForm",data:c})}},N={FilterFormFields:C,onFilterFormSubmit:e=>{e.hasOwnProperty("")&&(null==e||delete e[""]),f({action:"mutateTableForm",data:{...p}}),f({action:"mutateFilterForm",data:e})},filterFormDefaultValues:null==_?void 0:_.filterForm,resetFilterFormDefaultValues:v,onFilterFormReset:e=>{e("moduleName","BPAREG"),e("applicationStatus",""),e("locality",[]),e("assignee","ASSIGNED_TO_ALL"),f({action:"mutateFilterForm",data:v})}},I=(e=>{var o,a,r,u;let{parentRoute:d,onPageSizeChange:s,formState:c,totalCount:v,table:p,dispatch:m,onSortingByData:E}=e;const{t:_}=n.useTranslation(),f=t.useMemo(()=>[{Header:_("BPA_APPLICATION_NUMBER_LABEL"),accessor:"applicationNo",Cell:e=>{let{row:t}=e;return l.createElement("div",null,l.createElement(i.Link,{to:`${d}/stakeholder-inbox/stakeholder/${t.original.applicationId}`},l.createElement("span",{className:"link"},t.original.applicationId)))}},{Header:_("CS_APPLICATION_DETAILS_APPLICATION_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))(Hl(new Date(null===(n=i.original)||void 0===n?void 0:n.date),"dd/MM/yyyy")):""}},{Header:_("EVENTS_STATUS_LABEL"),accessor:e=>_(`WF_${null==e?void 0:e.businessService}_${null==e?void 0:e.status}`)},{Header:_("WF_INBOX_HEADER_CURRENT_OWNER"),accessor:e=>null==e?void 0:e.owner},{Header:_("ES_INBOX_SLA_DAYS_REMAINING"),accessor:e=>(e=>l.createElement("span","Active"===e||e>0?{className:"sla-cell-success"}:{className:"sla-cell-error"},e))(null==e?void 0:e.sla)}]);return{getCellProps:e=>({style:{padding:"20px 18px",fontSize:"16px"}}),disableSort:!1,autoSort:!1,manualPagination:!0,initSortI:"applicationDate",onPageSizeChange:s,currentPage:(null===(o=c.tableForm)||void 0===o?void 0:o.offset)/(null===(a=c.tableForm)||void 0===a?void 0:a.limit),onNextPage:()=>{var e,t;return m({action:"mutateTableForm",data:{...c.tableForm,offset:parseInt(null===(e=c.tableForm)||void 0===e?void 0:e.offset)+parseInt(null===(t=c.tableForm)||void 0===t?void 0:t.limit)}})},onPrevPage:()=>{var e,t;return m({action:"mutateTableForm",data:{...c.tableForm,offset:parseInt(null===(e=c.tableForm)||void 0===e?void 0:e.offset)-parseInt(null===(t=c.tableForm)||void 0===t?void 0:t.limit)}})},pageSizeLimit:null===(r=c.tableForm)||void 0===r?void 0:r.limit,onSort:E,totalRecords:v,onSearch:null==c||null===(u=c.searchForm)||void 0===u?void 0:u.message,onLastPage:()=>{var e;return m({action:"mutateTableForm",data:{...c.tableForm,offset:10*Math.ceil(v/10)-parseInt(null===(e=c.tableForm)||void 0===e?void 0:e.limit)}})},onFirstPage:()=>m({action:"mutateTableForm",data:{...c.tableForm,offset:0}}),data:p,columns:f}})({parentRoute:r,onPageSizeChange:e=>{f({action:"mutateTableForm",data:{..._.tableForm,limit:e.target.value}})},formState:_,totalCount:D,table:h,dispatch:f,onSortingByData:e=>{if(e.length>0){const[{id:t,desc:l}]=e,n=l?"DESC":"ASC";_.tableForm.sortBy===t&&_.tableForm.sortOrder===n||f({action:"mutateTableForm",data:{..._.tableForm,sortBy:t,sortOrder:l?"DESC":"ASC"}})}}}),L=(e=>{let{parentRoute:t,table:i}=e;const{t:r}=n.useTranslation();return{data:null==i?void 0:i.map(e=>{let{applicationId:t,date:l,businessService:n,status:i,owner:o,sla:a}=e;return{[r("BPA_APPLICATION_NUMBER_LABEL")]:t,[r("CS_APPLICATION_DETAILS_APPLICATION_DATE")]:Hl(new Date(l),"dd/MM/yyyy"),[r("EVENTS_STATUS_LABEL")]:r(`WF_${n}_${i}`),[r("WF_INBOX_HEADER_CURRENT_OWNER")]:o,[r("ES_INBOX_SLA_DAYS_REMAINING")]:a}}),linkPrefix:t+"/stakeholder-inbox/stakeholder/",serviceRequestIdKey:r("BPA_APPLICATION_NUMBER_LABEL"),MobileSortFormValues:()=>{const e=[{code:"DESC",i18nKey:"ES_COMMON_SORT_BY_DESC"},{code:"ASC",i18nKey:"ES_COMMON_SORT_BY_ASC"}],{control:t}=a.useFormContext();return l.createElement(o.SearchField,null,l.createElement(a.Controller,{name:"sortOrder",control:t,render:t=>{let{onChange:n,value:i}=t;return l.createElement(o.RadioButtons,{onSelect:e=>{n(e.code)},selectedOption:e.filter(e=>e.code===i)[0],optionsKey:"i18nKey",name:"sortOrder",options:e})}}))}}})({parentRoute:r,table:h}),B={onMobileSortOrderData:e=>{const{sortOrder:t}=e;f({action:"mutateTableForm",data:{..._.tableForm,sortOrder:t}})},sortFormDefaultValues:null==_?void 0:_.tableForm,onSortFormReset:e=>{e("sortOrder","DESC"),f({action:"mutateTableForm",data:p})}};return l.createElement(t.Fragment,null,l.createElement(o.Header,null,u("ES_COMMON_INBOX"),D?l.createElement("p",{className:"inbox-count"},D):null),Digit.Utils.browser.isMobile()&&l.createElement("div",{style:{marginLeft:"12px"}},l.createElement(i.Link,{to:window.location.href.includes("/citizen")?"/digit-ui/citizen/obps/search/application":"/digit-ui/employee/obps/search/application"},l.createElement("span",{className:"link"},u("BPA_SEARCH_PAGE_TITLE")))),l.createElement(o.InboxComposer,s({isInboxLoading:S,PropsForInboxLinks:T},P,N,B,{propsForInboxTable:I,propsForInboxMobileCards:L,formState:_})))},StakeholderCheckPage:e=>{var t,a,r,u,d,s,c,v,p,m,E,_,f,A,g,S,h,y,D,T,b,C,P,N,I,L,B,O,R,w,x,M,F,k,U,H,W,G,j,K,Y,$,z,V,q,X,J;let{onSubmit:Z,value:Q}=e;const{t:ee}=n.useTranslation();i.useHistory(),i.useRouteMatch();let te=Digit.UserService.getUser();const le=te&&null!=te&&te.info&&null!=te&&null!==(t=te.info)&&void 0!==t&&t.permanentCity?null==te||null===(a=te.info)||void 0===a?void 0:a.permanentCity:Digit.ULBService.getCurrentTenantId(),ne=Digit.ULBService.getStateId();let ie=window.location.href.includes("/openlink/");const oe=window.Digit.Utils.browser.isMobile();Digit.Utils.browser.isMobile(),ie&&(window.onunload=function(){sessionStorage.removeItem("Digit.BUILDING_PERMIT")});const{result:ae,formData:re,documents:ue}=Q;let de=null==Q||null===(r=Q.result)||void 0===r?void 0:r.Licenses[0].applicationNumber;const se={consumerCode:de},{data:ce}=Digit.Hooks.obps.useBPAREGgetbill({businessService:"BPAREG",...se,tenantId:ne||le.split(".")[0]},{enabled:!!de,retry:!1});return l.createElement(l.Fragment,null,l.createElement("div",{className:ie?"OpenlinkContainer":""},l.createElement("div",null,ie&&l.createElement(o.BackButton,{style:{border:"none"}},ee("CS_COMMON_BACK")),l.createElement(zl,{currentStep:4,flow:"STAKEHOLDER"}),l.createElement(o.Header,{styles:{fontSize:"32px",marginLeft:"10px"}},ee("BPA_STEPPER_SUMMARY_HEADER")),l.createElement(o.Card,{style:{paddingRight:"16px"}},l.createElement(o.StatusTable,null,l.createElement(o.Row,{className:"border-none",label:ee("BPA_APPLICATION_NUMBER_LABEL"),text:null!=ae&&null!==(u=ae.Licenses)&&void 0!==u&&null!==(d=u[0])&&void 0!==d&&d.applicationNumber?null==ae||null===(s=ae.Licenses)||void 0===s||null===(c=s[0])||void 0===c?void 0:c.applicationNumber:""}))),l.createElement(o.Card,{style:{paddingRight:"16px"}},l.createElement(o.StatusTable,null,l.createElement(o.CardHeader,{styles:{fontSize:"24px"}},ee("BPA_LICENSE_TYPE")),l.createElement(o.Row,{className:"border-none",label:ee("BPA_QUALIFICATION_TYPE"),text:ee(null==re||null===(v=re.LicneseType)||void 0===v||null===(p=v.qualificationType)||void 0===p?void 0:p.name)}),l.createElement(o.Row,{className:"border-none",label:ee("BPA_LICENSE_TYPE"),text:ee(null==re||null===(m=re.LicneseType)||void 0===m||null===(E=m.LicenseType)||void 0===E?void 0:E.i18nKey)}),(null==re||null===(_=re.LicneseType)||void 0===_||null===(f=_.LicenseType)||void 0===f?void 0:f.i18nKey.includes("ARCHITECT"))&&l.createElement(o.Row,{className:"border-none",label:ee("BPA_COUNCIL_NUMBER"),text:null==re||null===(A=re.LicneseType)||void 0===A?void 0:A.ArchitectNo}),(null==re||null===(g=re.LicneseType)||void 0===g||null===(S=g.LicenseType)||void 0===S?void 0:S.i18nKey.includes("TOWNPLANNER"))&&l.createElement(o.Row,{className:"border-none",label:ee("BPA_ASSOCIATE_OR_FELLOW_NUMBER"),text:null==re||null===(h=re.LicneseType)||void 0===h?void 0:h.ArchitectNo}))),l.createElement(o.Card,{style:{paddingRight:"16px"}},l.createElement(o.StatusTable,null,l.createElement(o.CardHeader,{styles:{fontSize:"24px"}},ee("BPA_LICENSE_DET_CAPTION")),l.createElement(o.Row,{className:"border-none",label:ee("BPA_APPLICANT_NAME_LABEL"),text:ee(null==re||null===(y=re.LicneseDetails)||void 0===y?void 0:y.name)}),l.createElement(o.Row,{className:"border-none",label:ee("BPA_APPLICANT_GENDER_LABEL"),text:ee(null==re||null===(D=re.LicneseDetails)||void 0===D?void 0:D.gender.i18nKey)}),l.createElement(o.Row,{className:"border-none",label:ee("BPA_OWNER_MOBILE_NO_LABEL"),text:null==re||null===(T=re.LicneseDetails)||void 0===T?void 0:T.mobileNumber}),l.createElement(o.Row,{className:"border-none",label:ee("BPA_APPLICANT_EMAIL_LABEL"),text:(null==re||null===(b=re.LicneseDetails)||void 0===b?void 0:b.email)||ee("CS_NA")}),l.createElement(o.Row,{className:"border-none",label:ee("BPA_APPLICANT_DOB_LABEL"),text:(null==re||null===(C=re.LicneseDetails)||void 0===C?void 0:C.dateOfBirth)||ee("CS_NA")}),l.createElement(o.Row,{className:"border-none",label:ee("BPA_DETAILS_PIN_LABEL"),text:(null==re||null===(P=re.LicneseDetails)||void 0===P?void 0:P.Pincode)||ee("CS_NA")}))),l.createElement(o.Card,{style:{paddingRight:"16px"}},l.createElement(o.StatusTable,null,l.createElement("div",{style:{marginRight:"24px"}},l.createElement(o.CardHeader,{styles:{fontSize:"24px"}},ee("BPA_PERMANANT_ADDRESS_LABEL"))),l.createElement(o.CardText,{style:oe?{color:"black"}:{color:"black",fontSize:"16px"}},ee(null==re||null===(N=re.LicneseDetails)||void 0===N?void 0:N.PermanentAddress)),null!=re&&null!==(I=re.LicneseType)&&void 0!==I&&null!==(L=I.LicenseType)&&void 0!==L&&L.i18nKey.includes("ARCHITECT")?l.createElement(o.Row,{className:"border-none",label:ee("BPA_SELECTED_ULB"),text:ee("BPA_ULB_SELECTED_MESSAGE ")}):l.createElement(o.Row,{className:"border-none",label:ee("BPA_SELECTED_ULB"),text:null==re||null===(B=re.LicneseDetails)||void 0===B||null===(O=B.Ulb)||void 0===O?void 0:O.map(e=>e.ulbname).join(", ")}))),l.createElement(o.Card,{style:{paddingRight:"16px"}},l.createElement(o.StatusTable,null,l.createElement("div",{style:{marginRight:"24px"}},l.createElement(o.CardHeader,{styles:{fontSize:"24px"}},ee("BPA_COMMUNICATION_ADDRESS_HEADER_DETAILS"))),l.createElement(o.CardText,{style:oe?{color:"black"}:{color:"black",fontSize:"16px"}},ee(null==Q?void 0:Q.Correspondenceaddress)))),l.createElement(o.Card,{style:{paddingRight:"16px"}},l.createElement(o.StatusTable,null,l.createElement(o.CardHeader,{styles:{fontSize:"24px"}},ee("BPA_DOC_DETAILS_SUMMARY")),null==ue?void 0:ue.documents.map((e,t)=>{var n,i;return l.createElement("div",{key:t},l.createElement(o.CardSectionHeader,{styles:{fontSize:"18px"}},ee("BPAREG_HEADER_"+(null==e||null===(n=e.documentType)||void 0===n?void 0:n.replace(".","_")))),null!=e&&e.info?l.createElement("div",{style:{fontSize:"12px",color:"#505A5F",fontWeight:400,lineHeight:"15px"}},""+ee(null==e?void 0:e.info)):null,l.createElement(o.StatusTable,null,l.createElement(pn,{value:Q,Code:null==e?void 0:e.documentType,index:t,isNOC:!1,svgStyles:{},isStakeHolder:!0}),(null==ue||null===(i=ue.documents)||void 0===i?void 0:i.length)!=t+1?l.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",height:"2px",marginTop:"20px",marginBottom:"20px"}}):null))}))),l.createElement("h2",null,"Hello"),l.createElement(o.Card,{style:{paddingRight:"16px"}},l.createElement(o.CardHeader,{styles:{fontSize:"24px"}},ee("BPA_SUMMARY_FEE_EST")),l.createElement(o.StatusTable,null,null==ce||null===(R=ce.billResponse)||void 0===R||null===(w=R.Bill[0])||void 0===w||null===(x=w.billDetails[0])||void 0===x?void 0:x.billAccountDetails.map((e,t)=>l.createElement("div",{key:t},l.createElement(o.Row,{className:"border-none",label:ee(""+e.taxHeadCode),text:"₹ "+(null==e?void 0:e.amount)||ee("CS_NA")}))),l.createElement(o.Row,{className:"border-none",label:ee("BPA_COMMON_TOTAL_AMT"),text:"₹ "+(null==ce||null===(M=ce.billResponse)||void 0===M||null===(F=M.Bill)||void 0===F||null===(k=F[0])||void 0===k||null===(U=k.billDetails[0])||void 0===U?void 0:U.amount)||ee("CS_NA")})),l.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",height:"2px",marginTop:"20px",marginBottom:"20px"}}),l.createElement(o.CardHeader,{styles:{fontSize:"24px"}},ee("BPA_COMMON_TOTAL_AMT")),l.createElement(o.CardHeader,null,"₹ ",null==ce||null===(H=ce.billResponse)||void 0===H||null===(W=H.Bill)||void 0===W||null===(G=W[0])||void 0===G||null===(j=G.billDetails[0])||void 0===j?void 0:j.amount),l.createElement(o.SubmitBar,{label:ee("CS_COMMON_SUBMIT"),onSubmit:Z,disabled:"number"!=typeof(null==ce||null===(K=ce.billResponse)||void 0===K||null===(Y=K.Bill)||void 0===Y||null===($=Y[0])||void 0===$||null===(z=$.billDetails[0])||void 0===z?void 0:z.amount)||(null==ce||null===(V=ce.billResponse)||void 0===V||null===(q=V.Bill)||void 0===q||null===(X=q[0])||void 0===X||null===(J=X.billDetails[0])||void 0===J?void 0:J.amount)<0})))))},BPACheckPage:e=>{var a,r,d,s,c,v,p,_,f,A,g,S,h,y,D,T,b,C,P,N,I,L,B,O,R,w,x,M,F,k,U,H,W,G,j,K,Y,$,z,V,q,X,J,Z,Q,ee,te,le,ne,ie,oe,ae,re,ue,de,se,ce,ve,pe,me,Ee,_e,fe,Ae,ge,Se,he,ye,De,Te,be,Ce,Pe,Ne,Ie,Le,Be,Oe,Re,we,xe,Me,Fe,ke,Ue,He,We,Ge,je,Ke,Ye,$e,ze,Ve,qe,Xe,Je,Ze,Qe,et,tt,lt,nt,it,ot,at,rt,ut,dt,st,ct,vt,pt,mt,Et,_t,ft,At,St,ht,yt,Dt,Tt,bt,Ct,Pt,Nt,It,Lt,Bt,Rt,wt,xt,Mt,Ft,kt,Ut,Ht,Gt,jt,Kt,Yt,$t,zt;let{onSubmit:Vt,value:qt}=e;const[Xt,Jt]=t.useState(()=>{var e,t;return sessionStorage.getItem("development")||(null==qt||null===(e=qt.additionalDetails)||void 0===e||null===(t=e.selfCertificationCharges)||void 0===t?void 0:t.BPA_DEVELOPMENT_CHARGES)||""}),[Zt,Qt]=t.useState(()=>{var e,t;return sessionStorage.getItem("otherCharges")||(null==qt||null===(e=qt.additionalDetails)||void 0===e||null===(t=e.selfCertificationCharges)||void 0===t?void 0:t.BPA_OTHER_CHARGES)||""}),[el,tl]=t.useState(()=>{var e,t;return sessionStorage.getItem("lessAdjusment")||(null==qt||null===(e=qt.additionalDetails)||void 0===e||null===(t=e.selfCertificationCharges)||void 0===t?void 0:t.BPA_LESS_ADJUSMENT_PLOT)||""}),[ll,nl]=t.useState(()=>{var e;return sessionStorage.getItem("otherChargesDisc")||(null==qt||null===(e=qt.additionalDetails)||void 0===e?void 0:e.otherFeesDiscription)||""}),[il,ol]=t.useState(()=>sessionStorage.getItem("LabourCess")||""),[al,rl]=t.useState(()=>sessionStorage.getItem("GaushalaFees")||""),[ul,dl]=t.useState(()=>sessionStorage.getItem("Malbafees")||""),[sl,cl]=t.useState(()=>sessionStorage.getItem("WaterCharges")||""),[vl,pl]=t.useState(()=>{const e=sessionStorage.getItem("currentOwnerData"),t=sessionStorage.getItem("ownerFields");if(e){const t=JSON.parse(e);return(null==t?void 0:t.owners)||[]}return t?JSON.parse(t)||[]:(null==Hl?void 0:Hl.owners)||[]}),ml=Digit.Hooks.obps.useObpsAPI(null==qt?void 0:qt.tenantId,!1);console.log(ml,"CHECK MUTATION"),t.useEffect(()=>{const e=sessionStorage.getItem("currentOwnerData"),t=sessionStorage.getItem("ownerFields");if(e){const t=JSON.parse(e);null!=t&&t.owners&&pl(t.owners)}else if(t){const e=JSON.parse(t);e&&pl(e)}},[]);const El=(()=>{try{const i=sessionStorage.getItem("Digit.BUILDING_PERMIT");if(i){var e,t,l,n;const o=JSON.parse(i);return console.log(null==o||null===(e=o.value)||void 0===e||null===(t=e.data)||void 0===t?void 0:t.edcrDetails,"))))))))"),(null==o||null===(l=o.value)||void 0===l||null===(n=l.data)||void 0===n?void 0:n.edcrDetails)||null}}catch(e){console.error("Error parsing planInfoProperties:",e)}return null})(),_l=(()=>{try{const l=sessionStorage.getItem("Digit.BUILDING_PERMIT");if(l){var e,t;const n=JSON.parse(l);return(null==n||null===(e=n.value)||void 0===e||null===(t=e.data)||void 0===t?void 0:t.edcrDetails)||null}}catch(e){console.error("Error parsing sessionStorage data:",e)}return null})(),{t:fl}=n.useTranslation(),Al=(i.useHistory(),i.useRouteMatch(),Digit.UserService.getUser()),gl=Digit.ULBService.getStateId(),Sl=t.useMemo(()=>{var e,t,l;return(null==qt||null===(e=qt.address)||void 0===e||null===(t=e.city)||void 0===t?void 0:t.code)||(null==qt?void 0:qt.tenantId)||(null==Al||null===(l=Al.info)||void 0===l?void 0:l.permanentCity)||Digit.ULBService.getCurrentTenantId()},[null==qt||null===(a=qt.address)||void 0===a||null===(r=a.city)||void 0===r?void 0:r.code,null==qt?void 0:qt.tenantId,null==Al||null===(d=Al.info)||void 0===d?void 0:d.permanentCity]),hl=null==Al||null===(s=Al.info)||void 0===s?void 0:s.mobileNumber,{data:yl}=Digit.Hooks.obps.useMDMS(gl,"BPA",["GaushalaFees","MalbaCharges","LabourCess"]),[Dl,Tl]=t.useState(),[bl,Cl]=t.useState(()=>{const e=sessionStorage.getItem("uploadedFileLess");return e?JSON.parse(e):[]}),[Pl,Nl]=t.useState(),[Il,Ll]=t.useState(""),[Bl,Ol]=t.useState(null),[Rl,wl]=t.useState({}),[xl,Ml]=t.useState(!1);let Fl;"BPA_LOW"===qt.businessService?Fl="BPA.LOW_RISK_PERMIT_FEE":"BPA"===qt.businessService&&(Fl="BPA.NC_APP_FEE");const{data:kl,address:Ul,owners:Hl,nocDocuments:Wl,documents:Gl,additionalDetails:jl,subOccupancy:Kl,PrevStateDocuments:Yl,PrevStateNocDocuments:$l}=qt,ql=window.location.href.includes("editApplication"),[Xl,Jl]=t.useState(()=>"true"===sessionStorage.getItem("professionalAgree")),[Zl,Ql]=t.useState(!1),[en,tn]=t.useState(!1),[ln,nn]=t.useState(()=>"true"===sessionStorage.getItem("showMobileInput")),[on,an]=t.useState(()=>sessionStorage.getItem("mobileNumber")||hl||""),[rn,un]=t.useState(()=>"true"===sessionStorage.getItem("showOTPInput")),[dn,sn]=t.useState(""),[cn,vn]=t.useState(()=>{const e=sessionStorage.getItem("isOTPVerified"),t=sessionStorage.getItem("otpVerifiedTimestamp");return"true"===e&&t}),[pn,mn]=t.useState(""),[En,_n]=t.useState(()=>{const e=sessionStorage.getItem("otpVerifiedTimestamp");return e?new Date(e):null}),[An,gn]=t.useState(()=>"true"===sessionStorage.getItem("ownerAgree")),[Sn,hn]=t.useState(()=>"true"===sessionStorage.getItem("showOwnerMobileInput")),[yn,Dn]=t.useState(()=>{var e,t;const l=sessionStorage.getItem("currentOwnerData"),n=sessionStorage.getItem("ownerMobileNumber"),i=sessionStorage.getItem("ownerFields");if(n)return n;if(l){var o,a;const e=JSON.parse(l);return(null==e||null===(o=e.owners)||void 0===o||null===(a=o[0])||void 0===a?void 0:a.mobileNumber)||""}if(i){var r;const e=JSON.parse(i);return(null==e||null===(r=e[0])||void 0===r?void 0:r.mobileNumber)||""}return(null==Hl||null===(e=Hl.owners)||void 0===e||null===(t=e[0])||void 0===t?void 0:t.mobileNumber)||""}),[Tn,bn]=t.useState(()=>"true"===sessionStorage.getItem("showOwnerOTPInput")),[Cn,Pn]=t.useState(""),[Nn,In]=t.useState(()=>"true"===sessionStorage.getItem("isOwnerOTPVerified")),[Ln,Bn]=t.useState("");sessionStorage.getItem("ArchitectConsentdocFilestoreid"),t.useEffect(()=>{sessionStorage.setItem("professionalAgree",Xl.toString())},[Xl]),t.useEffect(()=>{sessionStorage.setItem("ownerAgree",An.toString())},[An]),t.useEffect(()=>{sessionStorage.setItem("showMobileInput",ln.toString())},[ln]),t.useEffect(()=>{sessionStorage.setItem("showOTPInput",rn.toString())},[rn]),t.useEffect(()=>{sessionStorage.setItem("showOwnerMobileInput",Sn.toString())},[Sn]),t.useEffect(()=>{sessionStorage.setItem("showOwnerOTPInput",Tn.toString())},[Tn]),t.useEffect(()=>{sessionStorage.setItem("isOTPVerified",cn.toString())},[cn]),t.useEffect(()=>{sessionStorage.setItem("isOwnerOTPVerified",Nn.toString())},[Nn]),t.useEffect(()=>{sessionStorage.setItem("mobileNumber",on)},[on]),t.useEffect(()=>{sessionStorage.setItem("ownerMobileNumber",yn)},[yn]),t.useEffect(()=>{sessionStorage.setItem("development",Xt)},[Xt]),t.useEffect(()=>{sessionStorage.setItem("otherCharges",Zt)},[Zt]),t.useEffect(()=>{sessionStorage.setItem("lessAdjusment",el)},[el]),t.useEffect(()=>{sessionStorage.setItem("otherChargesDisc",ll)},[ll]),t.useEffect(()=>{En&&sessionStorage.setItem("otpVerifiedTimestamp",En.toISOString())},[En]);const On=e=>{e.preventDefault(),cn?Ql(!0):alert("Please verify yourself")},Rn=()=>l.createElement("div",null,fl("I_AGREE_TO_BELOW_UNDERTAKING"),l.createElement(o.LinkButton,{label:fl("DECLARATION_UNDER_SELF_CERTIFICATION_SCHEME"),onClick:On})),wn=e=>{an(e.target.value)},xn=function(e){try{e.preventDefault();const t=m(function(){var e,t;return Promise.resolve(Digit.UserService.sendOtp({otp:{mobileNumber:on,tenantId:null==Al||null===(e=Al.info)||void 0===e?void 0:e.tenantId,userType:null==Al||null===(t=Al.info)||void 0===t?void 0:t.type,type:"login"}})).then(function(e){e.isSuccessful?un(!0):(console.error("Error sending OTP Response is false:",e.error),alert("Something Went Wrong"))})},function(e){console.error("Error sending OTP:",e),alert("Something went wrong")});return Promise.resolve(t&&t.then?t.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},Mn={username:on,password:dn,tenantId:null==Al||null===(c=Al.info)||void 0===c?void 0:c.tenantId,userType:null==Al||null===(v=Al.info)||void 0===v?void 0:v.type},Fn=function(e){try{e.preventDefault(),console.log("OTP++++++++>");const t=m(function(){return Promise.resolve(Digit.UserService.authenticate(Mn)).then(function(e){if("Access Token generated successfully"===e.ResponseInfo.status){vn(!0),mn(fl("VERIFIED"));const e=new Date;_n(e),sessionStorage.setItem("otpVerifiedTimestamp",e.toISOString())}else vn(!1),mn(fl("WRONG OTP"))})},function(e){console.error("Error verifying OTP:",e),alert("OTP Verification Error "),vn(!1),mn(fl("OTP Verification Error"))});return Promise.resolve(t&&t.then?t.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},kn=e=>{e.preventDefault(),cn?Jl(!Xl):nn(!0)},Un={username:yn,password:Cn,tenantId:null==Al||null===(p=Al.info)||void 0===p?void 0:p.tenantId,userType:"CITIZEN"},Hn=10===on.length&&/^[0-9]+$/.test(on),Wn=10===yn.length&&/^[0-9]+$/.test(yn);t.useEffect(()=>{!function(){try{Ol(null);const e=function(){if(Pl&&null!=Pl&&Pl.type){const e=function(e,t,l){if(null!==(e=".pdf".split(","))&&void 0!==e&&e.includes("."+(null==Pl||null===(t=Pl.type)||void 0===t||null===(l=t.split("/"))||void 0===l?void 0:l.pop()))){const e=function(){if(Pl.size>=2e6)Ol(fl("PT_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=m(function(){return Promise.resolve(Digit.UploadServices.Filestorage("property-upload",Pl,Digit.ULBService.getStateId())).then(function(e){var t,l,n,i;(null==e||null===(t=e.data)||void 0===t||null===(l=t.files)||void 0===l?void 0:l.length)>0?Cl([...bl,{fileStoreId:null==e||null===(n=e.data)||void 0===n||null===(i=n.files[0])||void 0===i?void 0:i.fileStoreId,time:new Date}]):Ol(fl("PT_FILE_UPLOAD_ERROR"))})},function(){});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}else Ol(fl("PT_UPLOAD_FORMAT_NOT_SUPPORTED"))}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[Pl]),t.useEffect(()=>{sessionStorage.setItem("uploadedFileLess",JSON.stringify(bl))},[bl]),t.useEffect(()=>{var e,t,l,n,i,o,a,r,u,d,s,c,v,p,m,E,_,f,A,g,S,h,y,D,T,b;if(null!=qt&&null!==(e=qt.additionalDetails)&&void 0!==e&&null!==(t=e.lessAdjustmentFeeFiles)&&void 0!==t&&t.length){var C;const e=null==qt||null===(C=qt.additionalDetails)||void 0===C?void 0:C.lessAdjustmentFeeFiles.map((e,t)=>{var l,n,i,o,a,r;return t===(null==qt||null===(l=qt.additionalDetails)||void 0===l||null===(n=l.lessAdjustmentFeeFiles)||void 0===n?void 0:n.length)-1?null==qt||null===(i=qt.additionalDetails)||void 0===i||null===(o=i.lessAdjustmentFeeFiles[(null==qt||null===(a=qt.additionalDetails)||void 0===a||null===(r=a.lessAdjustmentFeeFiles)||void 0===r?void 0:r.length)-1])||void 0===o?void 0:o.fileStoreId:null});Digit.UploadServices.Filefetch(e,gl).then(e=>wl(null==e?void 0:e.data))}ql&&(Jt(null==qt||null===(c=qt.additionalDetails)||void 0===c||null===(v=c.selfCertificationCharges)||void 0===v?void 0:v.BPA_DEVELOPMENT_CHARGES),sessionStorage.setItem("development",null==qt||null===(p=qt.additionalDetails)||void 0===p||null===(m=p.selfCertificationCharges)||void 0===m?void 0:m.BPA_DEVELOPMENT_CHARGES),Qt(null==qt||null===(E=qt.additionalDetails)||void 0===E||null===(_=E.selfCertificationCharges)||void 0===_?void 0:_.BPA_OTHER_CHARGES),sessionStorage.setItem("otherCharges",null==qt||null===(f=qt.additionalDetails)||void 0===f||null===(A=f.selfCertificationCharges)||void 0===A?void 0:A.BPA_OTHER_CHARGES),tl(null==qt||null===(g=qt.additionalDetails)||void 0===g||null===(S=g.selfCertificationCharges)||void 0===S?void 0:S.BPA_LESS_ADJUSMENT_PLOT),sessionStorage.setItem("lessAdjusment",null==qt||null===(h=qt.additionalDetails)||void 0===h||null===(y=h.selfCertificationCharges)||void 0===y?void 0:y.BPA_LESS_ADJUSMENT_PLOT),nl(null==qt||null===(D=qt.additionalDetails)||void 0===D?void 0:D.otherFeesDiscription),sessionStorage.setItem("otherChargesDisc",null==qt||null===(T=qt.additionalDetails)||void 0===T?void 0:T.otherFeesDiscription),Cl(null==qt||null===(b=qt.additionalDetails)||void 0===b?void 0:b.lessAdjustmentFeeFiles));let P=parseInt(sessionStorage.getItem("plotArea"))||(null==zn||null===(l=zn.planDetail)||void 0===l||null===(n=l.planInformation)||void 0===n?void 0:n.plotArea)||(null==qt||null===(i=qt.additionalDetails)||void 0===i?void 0:i.area);const N=Math.round(10.7639*P>909?(null==yl||null===(o=yl.BPA)||void 0===o?void 0:o.LabourCess[1].rate)*(10.7639*P):0),I=Math.round(null==yl||null===(a=yl.BPA)||void 0===a?void 0:a.GaushalaFees[0].rate),L=Math.round(10.7639*P<=500?null==yl||null===(r=yl.BPA)||void 0===r?void 0:r.MalbaCharges[0].rate:10.7639*P>500&&10.7639*P<=1e3?null==yl||null===(u=yl.BPA)||void 0===u||null===(d=u.MalbaCharges)||void 0===d?void 0:d[1].rate:(null==yl||null===(s=yl.BPA)||void 0===s?void 0:s.MalbaCharges[2].rate)||500);sessionStorage.setItem("Malbafees",L),sessionStorage.setItem("WaterCharges",L/2),sessionStorage.setItem("GaushalaFees",I),sessionStorage.setItem("LabourCess",N),rl(I),ol(N),dl(L),cl(L/2)},[yl,null==qt?void 0:qt.additionalDetails]);let Gn=[];null==Yl||Yl.map(e=>{Gn.push({...e,module:"OBPS"})}),null==Gl||null===(_=Gl.documents)||void 0===_||_.map(e=>{Gn.push({...e,module:"OBPS"})}),null==$l||$l.map(e=>{Gn.push({...e,module:"NOC"})}),null==Wl||null===(f=Wl.nocDocuments)||void 0===f||f.map(e=>{Gn.push({...e,module:"NOC"})});const{data:jn,isLoading:Kn}=Digit.Hooks.useDocumentSearch(Gn,{enabled:(null==Gn?void 0:Gn.length)>0});let Yn=[];var $n;(null==jn||null===(A=jn.pdfFiles)||void 0===A?void 0:A.length)>0&&(null==jn||null===($n=jn.pdfFiles)||void 0===$n||$n.map(e=>{"OBPS"==(null==e?void 0:e.module)&&Yn.push(e)}));const{data:zn,isLoading:Vn}=function(e,t,l,n){return void 0===n&&(n="OBPS_SCRUTINYDETAILS"),console.log("HERE HOOK "),console.log("useScrutinyDetails Hook Called"),console.log("TenantId:",e),console.log("Filters:",t),console.log("+++++"),u.useQuery([n,t],function(){try{return Promise.resolve(Qa(e,t,void 0)).then(function(l){return console.log(l,"+++"),Qa(e,t,void 0)})}catch(e){return Promise.reject(e)}},l)}(Sl,null==qt||null===(g=qt.data)||void 0===g?void 0:g.scrutinyNumber,{enabled:!(null==qt||null===(S=qt.data)||void 0===S||!S.scrutinyNumber||!Sl)});let qn=null==qt?void 0:qt.applicationNo;const Xn={consumerCode:qn},{data:Jn}=Digit.Hooks.useFetchBillsForBuissnessService({businessService:Fl,...Xn,tenantId:Sl},{enabled:!!qn,retry:!1}),Zn=window.location.href.includes("sendbacktocitizen");let Qn=`/digit-ui/citizen/obps/bpa/${null==jl?void 0:jl.applicationType.toLowerCase()}/${null==jl?void 0:jl.serviceType.toLowerCase()}`;ql&&(Qn=`/digit-ui/citizen/obps/editApplication/bpa/${null==qt?void 0:qt.tenantId}/${null==qt?void 0:qt.applicationNo}`),Zn&&(Qn=`/digit-ui/citizen/obps/sendbacktocitizen/bpa/${null==qt?void 0:qt.tenantId}/${null==qt?void 0:qt.applicationNo}`);const ei=[{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"},{name:"BPA_TABLE_COL_CARPETAREA",id:"CarpetArea"}],ti=e=>{const t=e;return(e,l,n)=>e[t]},li=t.useMemo(()=>ei.map(e=>({Header:fl(""+e.name),accessor:ti(e.id),id:e.id})));function ni(e){var t;let l=[];return null==e||null===(t=e.building)||void 0===t||t.floors.map(e=>{var t,n,i,o,a,r,u,d;l.push({Floor:fl("BPA_FLOOR_NAME_"+e.number),Level:e.number,Occupancy:fl(""+(null===(t=e.occupancies)||void 0===t||null===(n=t[0])||void 0===n?void 0:n.type)),BuildupArea:null===(i=e.occupancies)||void 0===i||null===(o=i[0])||void 0===o?void 0:o.builtUpArea,FloorArea:(null===(a=e.occupancies)||void 0===a||null===(r=a[0])||void 0===r?void 0:r.floorArea)||0,CarpetArea:(null===(u=e.occupancies)||void 0===u||null===(d=u[0])||void 0===d?void 0:d.CarpetArea)||0,key:fl("BPA_FLOOR_NAME_"+e.number)})}),l}function ii(e){location.href=e}function oi(e){let t=[];return Kl&&Kl["Block_"+(e+1)]&&Kl["Block_"+(e+1)].map(e=>{var l;t.push(""+fl(gt(null==e||null===(l=e.i18nKey)||void 0===l?void 0:l.toUpperCase(),"-","_")))}),null!=t&&t.length?t.join(", "):"NA"}if(Kn||Vn)return l.createElement(o.Loader,null);const ai=(null==qt||null===(h=qt.address)||void 0===h||null===(y=h.city)||void 0===y?void 0:y.code)||(null==Ul||null===(D=Ul.city)||void 0===D?void 0:D.code)||Sl;return l.createElement(l.Fragment,null,l.createElement(zl,{currentStep:4}),l.createElement(o.Header,{styles:{marginLeft:"10px"}},fl("BPA_STEPPER_SUMMARY_HEADER")),l.createElement(o.Card,{style:{paddingRight:"16px"}},l.createElement(o.StatusTable,null,l.createElement(o.Row,{className:"border-none",label:fl("BPA_APPLICATION_NUMBER_LABEL"),text:null==_l?void 0:_l.applicationNumber}))),l.createElement(o.Card,{style:{paddingRight:"16px"}},l.createElement(o.CardHeader,null,fl("BPA_BASIC_DETAILS_TITLE")),l.createElement(o.StatusTable,null,l.createElement(o.Row,{className:"border-none",label:fl("BPA_BASIC_DETAILS_APP_DATE_LABEL"),text:Ot(Number(null==kl?void 0:kl.applicationDate))}),l.createElement(o.Row,{className:"border-none",label:fl("BPA_BASIC_DETAILS_APPLICATION_TYPE_LABEL"),text:fl("WF_BPA_"+(null==kl?void 0:kl.applicationType))}),l.createElement(o.Row,{className:"border-none",label:fl("BPA_BASIC_DETAILS_SERVICE_TYPE_LABEL"),text:fl(null==kl?void 0:kl.serviceType)}),l.createElement(o.Row,{className:"border-none",label:fl("BPA_BASIC_DETAILS_OCCUPANCY_LABEL"),text:null==kl?void 0:kl.occupancyType}),l.createElement(o.Row,{className:"border-none",label:fl("BPA_BASIC_DETAILS_RISK_TYPE_LABEL"),text:fl("WF_BPA_"+(null==kl?void 0:kl.riskType))}))),l.createElement(o.Card,{style:{paddingRight:"16px"}},l.createElement(o.StatusTable,null,l.createElement(o.CardHeader,null,fl("BPA_PLOT_DETAILS_TITLE")),l.createElement(o.LinkButton,{label:l.createElement(o.EditIcon,{style:{marginTop:"-10px",float:"right",position:"relative",bottom:"32px"}}),style:{width:"100px",display:"inline"},onClick:()=>ii(Qn+"/plot-details")}),l.createElement(o.Row,{className:"border-none",textStyle:{paddingLeft:"12px"},label:fl("BPA_BOUNDARY_PLOT_AREA_LABEL"),text:null!=_l&&null!==(T=_l.planDetail)&&void 0!==T&&null!==(b=T.planInformation)&&void 0!==b&&b.plotArea||null!=zn&&null!==(C=zn.planDetail)&&void 0!==C&&null!==(P=C.planInformation)&&void 0!==P&&P.plotArea||null!=qt&&null!==(N=qt.data)&&void 0!==N&&null!==(I=N.edcrDetails)&&void 0!==I&&null!==(L=I.planDetail)&&void 0!==L&&null!==(B=L.planInformation)&&void 0!==B&&B.plotArea?`${(null==_l||null===(O=_l.planDetail)||void 0===O||null===(R=O.planInformation)||void 0===R?void 0:R.plotArea)||(null==zn||null===(w=zn.planDetail)||void 0===w||null===(x=w.planInformation)||void 0===x?void 0:x.plotArea)||(null==qt||null===(M=qt.data)||void 0===M||null===(F=M.edcrDetails)||void 0===F||null===(k=F.planDetail)||void 0===k||null===(U=k.planInformation)||void 0===U?void 0:U.plotArea)} ${fl("BPA_SQ_MTRS_LABEL")}`:fl("CS_NA")}),l.createElement(o.Row,{className:"border-none",label:fl("BPA_PLOT_NUMBER_LABEL"),text:(null==_l||null===(H=_l.planDetail)||void 0===H||null===(W=H.planInfoProperties)||void 0===W?void 0:W.PLOT_NO)||fl("CS_NA")}),l.createElement(o.Row,{className:"border-none",label:fl("BPA_KHATHA_NUMBER_LABEL"),text:(null==_l||null===(G=_l.planDetail)||void 0===G||null===(j=G.planInfoProperties)||void 0===j?void 0:j.KHATA_NO)||fl("CS_NA")}),console.log(_l,"P+++++"),l.createElement(o.Row,{className:"border-none",label:fl("BPA_BOUNDARY_LAND_REG_DETAIL_LABEL"),text:(null==kl?void 0:kl.registrationDetails)||(null==qt||null===(K=qt.data)||void 0===K?void 0:K.registrationDetails)||fl("CS_NA")}),l.createElement(o.Row,{className:"border-none",label:fl("BPA_BOUNDARY_WALL_LENGTH_LABEL"),text:(null==kl?void 0:kl.boundaryWallLength)||(null==qt||null===(Y=qt.data)||void 0===Y?void 0:Y.boundaryWallLength)||fl("CS_NA")}),l.createElement(o.Row,{className:"border-none",label:fl("BPA_KHASRA_NUMBER_LABEL"),text:(null==_l||null===($=_l.planInfoProperties)||void 0===$?void 0:$.KHASRA_NO)||(null==kl?void 0:kl.khasraNumber)||(null==qt||null===(z=qt.additionalDetails)||void 0===z?void 0:z.khasraNumber)||(null==qt||null===(V=qt.data)||void 0===V?void 0:V.khasraNumber)||fl("CS_NA")}),l.createElement(o.Row,{className:"border-none",label:fl("BPA_WARD_NUMBER_LABEL"),text:(null==kl?void 0:kl.wardnumber)||(null==qt||null===(q=qt.additionalDetails)||void 0===q?void 0:q.wardnumber)||(null==qt||null===(X=qt.data)||void 0===X?void 0:X.wardnumber)||fl("CS_NA")}))),l.createElement(o.Card,{style:{paddingRight:"16px"}},l.createElement(o.CardHeader,null,fl("BPA_STEPPER_SCRUTINY_DETAILS_HEADER")),l.createElement(o.CardSubHeader,{style:{fontSize:"20px"}},fl("BPA_EDCR_DETAILS")),l.createElement(o.StatusTable,{style:{border:"none"}},l.createElement(o.Row,{className:"border-none",label:fl("BPA_EDCR_NO_LABEL"),text:null==kl||null===(J=kl.scrutinyNumber)||void 0===J?void 0:J.edcrNumber}),l.createElement(o.CardSubHeader,null,fl("BPA_UPLOADED_PLAN_DIAGRAM")),l.createElement(o.LinkButton,{label:l.createElement(o.PDFSvg,null),onClick:()=>ii(null==zn?void 0:zn.updatedDxfFile)}),l.createElement("p",{style:{marginTop:"8px",marginBottom:"20px",textAlign:"Left",fontSize:"16px",lineHeight:"19px",color:"#505A5F",fontWeight:"400"}},fl("Uploaded Plan.pdf")),l.createElement(o.CardSubHeader,null,fl("BPA_SCRUNTINY_REPORT_OUTPUT")),l.createElement(o.LinkButton,{label:l.createElement(o.PDFSvg,null),onClick:()=>ii(null==zn?void 0:zn.planReport)}),l.createElement("p",{style:{marginTop:"8px",marginBottom:"20px",textAlign:"Left",fontSize:"16px",lineHeight:"19px",color:"#505A5F",fontWeight:"400"}},fl("BPA_SCRUTINY_REPORT_PDF"))),l.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",height:"2px",marginTop:"20px",marginBottom:"20px"}}),l.createElement(o.CardSubHeader,{style:{fontSize:"20px"}},fl("BPA_BUILDING_EXTRACT_HEADER")),l.createElement(o.Card,{style:{paddingRight:"16px"}},l.createElement(o.CardSubHeader,{style:{fontSize:"20px"}},fl("BPA_PLAN_INFORMATION_PROPERTIES")),l.createElement(o.StatusTable,null,l.createElement(o.Row,{className:"border-none",label:fl("BPA_PLOT_AREA_M2"),text:`${(null==El?void 0:El.PLOT_AREA_M2)||fl("CS_NA")} ${null!=El&&El.PLOT_AREA_M2?fl("BPA_SQ_MTRS_LABEL"):""}`}),console.log(El,"PLAN"),l.createElement(o.Row,{className:"border-none",label:fl("BPA_PLOT_NUMBER"),text:(null==_l||null===(Z=_l.planDetail)||void 0===Z||null===(Q=Z.planInfoProperties)||void 0===Q?void 0:Q.PLOT_NO)||fl("CS_NA")}),l.createElement(o.Row,{className:"border-none",label:fl("BPA_KHASRA_NUMBER"),text:(null==_l||null===(ee=_l.planDetail)||void 0===ee||null===(te=ee.planInfoProperties)||void 0===te?void 0:te.KHASRA_NO)||fl("CS_NA")}),l.createElement(o.Row,{className:"border-none",label:fl("BPA_KHATA_NUMBER"),text:(null==_l||null===(le=_l.planDetail)||void 0===le||null===(ne=le.planInfoProperties)||void 0===ne?void 0:ne.KHATA_NO)||fl("CS_NA")}),l.createElement(o.Row,{className:"border-none",label:fl("BPA_KHATUNI_NUMBER"),text:(null==_l||null===(ie=_l.planDetail)||void 0===ie||null===(oe=ie.planInfoProperties)||void 0===oe?void 0:oe.KHATUNI_NO)||fl("CS_NA")}),l.createElement(o.Row,{className:"border-none",label:fl("BPA_DISTRICT"),text:(null==_l||null===(ae=_l.planDetail)||void 0===ae||null===(re=ae.planInfoProperties)||void 0===re?void 0:re.DISTRICT)||fl("CS_NA")}),l.createElement(o.Row,{className:"border-none",label:fl("BPA_MAUZA"),text:(null==_l||null===(ue=_l.planDetail)||void 0===ue||null===(de=ue.planInfoProperties)||void 0===de?void 0:de.MAUZA)||fl("CS_NA")}),l.createElement(o.Row,{className:"border-none",label:fl("BPA_AREA_TYPE"),text:(null==_l||null===(se=_l.planDetail)||void 0===se||null===(ce=se.planInfoProperties)||void 0===ce?void 0:ce.AREA_TYPE)||fl("CS_NA")}),l.createElement(o.Row,{className:"border-none",label:fl("BPA_LAND_USE_ZONE"),text:(null==_l||null===(ve=_l.planDetail)||void 0===ve||null===(pe=ve.planInfoProperties)||void 0===pe?void 0:pe.LAND_USE_ZONE)||fl("CS_NA")}),l.createElement(o.Row,{className:"border-none",label:fl("BPA_NUMBER_OF_FLOORS"),text:(null==_l||null===(me=_l.planDetail)||void 0===me||null===(Ee=me.planInfoProperties)||void 0===Ee?void 0:Ee.NUMBER_OF_FLOORS)||fl("CS_NA")}),l.createElement(o.Row,{className:"border-none",label:fl("BPA_ULB_TYPE"),text:(null==_l||null===(_e=_l.planDetail)||void 0===_e||null===(fe=_e.planInfoProperties)||void 0===fe?void 0:fe.ULB_TYPE)||fl("CS_NA")}),l.createElement(o.CardSubHeader,{style:{fontSize:"18px",marginTop:"20px"}},fl("BPA_PLOT_DIMENSIONS")),l.createElement(o.Row,{className:"border-none",label:fl("BPA_AVG_PLOT_DEPTH"),text:null==_l||null===(Ae=_l.planDetail)||void 0===Ae||null===(ge=Ae.planInfoProperties)||void 0===ge?void 0:ge.AVG_PLOT_DEPTH}),l.createElement(o.Row,{className:"border-none",label:fl("BPA_AVG_PLOT_WIDTH"),text:null==_l||null===(Se=_l.planDetail)||void 0===Se||null===(he=Se.planInfoProperties)||void 0===he?void 0:he.AVG_PLOT_WIDTH}),l.createElement(o.CardSubHeader,{style:{fontSize:"18px",marginTop:"20px"}},fl("BPA_ROAD_DETAILS")),l.createElement(o.Row,{className:"border-none",label:fl("BPA_ROAD_TYPE"),text:(null==El?void 0:El.ROAD_TYPE)||fl("CS_NA")}),l.createElement(o.Row,{className:"border-none",label:fl("BPA_ROAD_WIDTH"),text:null==_l||null===(ye=_l.planDetail)||void 0===ye||null===(De=ye.planInfoProperties)||void 0===De?void 0:De.ROAD_WIDTH}),l.createElement(o.CardSubHeader,{style:{fontSize:"18px",marginTop:"20px"}},fl("BPA_SUSTAINABILITY_FEATURES")),l.createElement(o.Row,{className:"border-none",label:fl("BPA_GREEN_BUILDINGS_SUSTAINABILITY"),text:(null==_l||null===(Te=_l.planDetail)||void 0===Te||null===(be=Te.planInfoProperties)||void 0===be?void 0:be.PROVISION_FOR_GREEN_BUILDINGS_AND_SUSTAINABILITY)||fl("CS_NA")}),l.createElement(o.Row,{className:"border-none",label:fl("BPA_RWH_DECLARED"),text:(null==El?void 0:El.RWH_DECLARED)||fl("CS_NA")}),l.createElement(o.Row,{className:"border-none",label:fl("BPA_SOLAR_WATER_HEATER"),text:(null==El?void 0:El.SOLAR_WATER_HEATER)||fl("CS_NA")}),l.createElement(o.CardSubHeader,{style:{fontSize:"18px",marginTop:"20px"}},fl("BPA_NOC_REQUIREMENTS")),l.createElement(o.Row,{className:"border-none",label:fl("BPA_NOC_FIRE_DEPT"),text:(null==_l||null===(Ce=_l.planDetail)||void 0===Ce||null===(Pe=Ce.planInfoProperties)||void 0===Pe?void 0:Pe.NOC_FIRE_DEPT)||fl("CS_NA")}),l.createElement(o.Row,{className:"border-none",label:fl("BPA_NOC_COLLECTOR_GVT_LAND"),text:(null==_l||null===(Ne=_l.planDetail)||void 0===Ne||null===(Ie=Ne.planInfoProperties)||void 0===Ie?void 0:Ie.NOC_COLLECTOR_GVT_LAND)||fl("CS_NA")}),l.createElement(o.Row,{className:"border-none",label:fl("BPA_NOC_IRRIGATION_DEPT"),text:(null==_l||null===(Le=_l.planDetail)||void 0===Le||null===(Be=Le.planInfoProperties)||void 0===Be?void 0:Be.NOC_IRRIGATION_DEPT)||fl("CS_NA")}),l.createElement(o.Row,{className:"border-none",label:fl("BPA_NOC_CONSTRUCTION_NEAR_MONUMENT"),text:(null==_l||null===(Oe=_l.planDetail)||void 0===Oe||null===(Re=Oe.planInfoProperties)||void 0===Re?void 0:Re.NOC_FOR_CONSTRUCTION_NEAR_MONUMENT)||fl("CS_NA")}),l.createElement(o.Row,{className:"border-none",label:fl("BPA_NOC_NH_ECR"),text:(null==_l||null===(we=_l.planDetail)||void 0===we||null===(xe=we.planInfoProperties)||void 0===xe?void 0:xe.NOC_NH_ECR)||fl("CS_NA")}),l.createElement(o.Row,{className:"border-none",label:fl("BPA_NOC_STATE_CRZ"),text:(null==_l||null===(Me=_l.planDetail)||void 0===Me||null===(Fe=Me.planInfoProperties)||void 0===Fe?void 0:Fe.NOC_STATE_CRZ)||fl("CS_NA")}),l.createElement(o.CardSubHeader,{style:{fontSize:"18px",marginTop:"20px"}},fl("BPA_PROXIMITY_LIMITS")),l.createElement(o.Row,{className:"border-none",label:fl("BPA_ABUTTING_NH_ECR"),text:(null==_l||null===(ke=_l.planDetail)||void 0===ke||null===(Ue=ke.planInfoProperties)||void 0===Ue?void 0:Ue.ABUTTING_NH_ECR)||fl("CS_NA")}),l.createElement(o.Row,{className:"border-none",label:fl("BPA_AIRPORT_LIMIT"),text:(null==_l||null===(He=_l.planDetail)||void 0===He||null===(We=He.planInfoProperties)||void 0===We?void 0:We.AIRPORT_LIMIT)||fl("CS_NA")}),l.createElement(o.Row,{className:"border-none",label:fl("BPA_RAILWAY_LIMIT"),text:(null==_l||null===(Ge=_l.planDetail)||void 0===Ge||null===(je=Ge.planInfoProperties)||void 0===je?void 0:je.RAILWAY_LIMIT)||fl("CS_NA")}),l.createElement(o.CardSubHeader,{style:{fontSize:"18px",marginTop:"20px"}},fl("BPA_DEMOLITION_DETAILS")),l.createElement(o.Row,{className:"border-none",label:fl("BPA_EXISTING_FLOOR_AREA_DEMOLISHED"),text:null==_l||null===(Ke=_l.planDetail)||void 0===Ke||null===(Ye=Ke.planInfoProperties)||void 0===Ye?void 0:Ye.EXISTING_FLOOR_AREA_TO_BE_DEMOLISHED_M2}))),l.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",height:"2px",marginTop:"20px",marginBottom:"20px"}}),l.createElement(o.CardSubHeader,{style:{fontSize:"20px"}},fl("BPA_OCC_SUBOCC_HEADER")),null==zn||null===($e=zn.planDetail)||void 0===$e?void 0:$e.blocks.map((e,t)=>{var n,i;return l.createElement("div",{key:t,style:(null==zn||null===(n=zn.planDetail)||void 0===n||null===(i=n.blocks)||void 0===i?void 0:i.length)>1?{marginTop:"19px",background:"#FAFAFA",border:"1px solid #D6D5D4",borderRadius:"4px",padding:"8px",lineHeight:"19px",maxWidth:"960px",minWidth:"280px"}:{}},l.createElement(o.CardSubHeader,{style:{marginTop:"15px",fontSize:"18px"}},fl("BPA_BLOCK_SUBHEADER")," ",t+1),l.createElement(o.StatusTable,null,l.createElement(o.Row,{className:"border-none",textStyle:{wordBreak:"break-word"},label:fl("BPA_SUB_OCCUPANCY_LABEL"),text:""===oi(t)?fl("CS_NA"):oi(t)})),l.createElement("div",{style:{overflow:"scroll"}},l.createElement(o.Table,{className:"customTable table-fixed-first-column table-border-style",t:fl,disableSort:!1,autoSort:!0,manualPagination:!1,isPaginationRequired:!1,initSortId:"S N ",data:ni(e),columns:li,getCellProps:e=>({style:{}})})))}),l.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",height:"2px",marginTop:"20px",marginBottom:"20px"}}),l.createElement(o.CardSubHeader,{style:{fontSize:"20px"}},fl("BPA_APP_DETAILS_DEMOLITION_DETAILS_LABEL")),l.createElement(o.StatusTable,{style:{border:"none"}},l.createElement(o.Row,{className:"border-none",label:fl("BPA_APPLICATION_DEMOLITION_AREA_LABEL"),text:null!=zn&&null!==(ze=zn.planDetail)&&void 0!==ze&&null!==(Ve=ze.planInformation)&&void 0!==Ve&&Ve.demolitionArea?`${null==zn||null===(qe=zn.planDetail)||void 0===qe||null===(Xe=qe.planInformation)||void 0===Xe?void 0:Xe.demolitionArea} ${fl("BPA_SQ_MTRS_LABEL")}`:fl("CS_NA")}))),l.createElement(o.Card,{style:{paddingRight:"16px"}},l.createElement(o.StatusTable,null,l.createElement(o.CardHeader,null,fl("BPA_NEW_TRADE_DETAILS_HEADER_DETAILS")),l.createElement(o.LinkButton,{label:l.createElement(o.EditIcon,{style:{marginTop:"-10px",float:"right",position:"relative",bottom:"32px"}}),style:{width:"100px",display:"inline"},onClick:()=>ii(Qn+"/location")}),l.createElement(o.Row,{className:"border-none",textStyle:{paddingLeft:"12px"},label:fl("BPA_DETAILS_PIN_LABEL"),text:(null==Ul?void 0:Ul.pincode)||fl("CS_NA")}),l.createElement(o.Row,{className:"border-none",label:fl("BPA_CITY_LABEL"),text:(null==Ul||null===(Je=Ul.city)||void 0===Je?void 0:Je.name)||fl("CS_NA")}),l.createElement(o.Row,{className:"border-none",label:fl("BPA_LOC_MOHALLA_LABEL"),text:(null==Ul||null===(Ze=Ul.locality)||void 0===Ze?void 0:Ze.name)||fl("CS_NA")}),l.createElement(o.Row,{className:"border-none",label:fl("BPA_DETAILS_SRT_NAME_LABEL"),text:(null==Ul?void 0:Ul.street)||fl("CS_NA")}),l.createElement(o.Row,{className:"border-none",label:fl("ES_NEW_APPLICATION_LOCATION_LANDMARK"),text:(null==Ul?void 0:Ul.landmark)||fl("CS_NA")}))),l.createElement(o.Card,{style:{paddingRight:"16px"}},l.createElement(o.StatusTable,null,l.createElement(o.CardHeader,null,fl("BPA_APPLICANT_DETAILS_HEADER")),l.createElement(o.LinkButton,{label:l.createElement(o.EditIcon,{style:{marginTop:"-10px",float:"right",position:"relative",bottom:"32px"}}),style:{width:"100px",display:"inline"},onClick:()=>ii(Qn+"/owner-details")}),vl&&vl.length>0&&vl.map((e,t)=>{var n,i;return l.createElement("div",{key:t,style:vl.length>1?{marginTop:"19px",background:"#FAFAFA",border:"1px solid #D6D5D4",borderRadius:"4px",padding:"8px",lineHeight:"19px",maxWidth:"960px",minWidth:"280px"}:{}},vl.length>1&&l.createElement(o.CardSubHeader,null,fl("COMMON_OWNER")," ",t+1),l.createElement(o.StatusTable,null,l.createElement(o.Row,{className:"border-none",textStyle:0==t&&1==vl.length?{paddingLeft:"12px"}:{},label:fl("CORE_COMMON_NAME"),text:(null==e?void 0:e.name)||"N/A"}),l.createElement(o.Row,{className:"border-none",label:fl("BPA_APPLICANT_GENDER_LABEL"),text:null!=e&&null!==(n=e.gender)&&void 0!==n&&n.i18nKey?fl(e.gender.i18nKey):(null==e||null===(i=e.gender)||void 0===i?void 0:i.code)||"N/A"}),l.createElement(o.Row,{className:"border-none",label:fl("CORE_COMMON_MOBILE_NUMBER"),text:(null==e?void 0:e.mobileNumber)||"N/A"}),l.createElement(o.Row,{className:"border-none",label:fl("CORE_COMMON_EMAIL_ID"),text:(null==e?void 0:e.emailId)||fl("CS_NA")}),l.createElement(o.Row,{className:"border-none",label:fl("BPA_IS_PRIMARY_OWNER_LABEL"),text:""+((null==e?void 0:e.isPrimaryOwner)||!1)})))}))),l.createElement(o.Card,{style:{paddingRight:"16px"}},l.createElement(o.StatusTable,null,l.createElement(o.CardHeader,null,fl("BPA_ADDITIONAL_BUILDING_DETAILS")),l.createElement(o.Row,{className:"border-none",label:fl("BPA_APPROVED_COLONY_LABEL"),text:(null==Hl||null===(Qe=Hl.approvedColony)||void 0===Qe?void 0:Qe.i18nKey)||(null==qt||null===(et=qt.additionalDetails)||void 0===et?void 0:et.approvedColony)||fl("CS_NA")}),l.createElement(o.Row,{className:"border-none",label:fl("BPA_ULB_TYPE_LABEL"),text:(null==Hl||null===(tt=Hl.Ulblisttype)||void 0===tt?void 0:tt.value)||(null==qt||null===(lt=qt.additionalDetails)||void 0===lt?void 0:lt.Ulblisttype)||fl("CS_NA")}),l.createElement(o.Row,{className:"border-none",label:fl("BPA_ULB_NAME_LABEL"),text:(null==Hl||null===(nt=Hl.UlbName)||void 0===nt?void 0:nt.code)||(null==qt||null===(it=qt.additionalDetails)||void 0===it?void 0:it.UlbName)||fl("CS_NA")}),l.createElement(o.Row,{className:"border-none",label:fl("BPA_DISTRICT_LABEL"),text:(null==Hl||null===(ot=Hl.District)||void 0===ot?void 0:ot.code)||(null==qt||null===(at=qt.additionalDetails)||void 0===at?void 0:at.District)||fl("CS_NA")}),l.createElement(o.Row,{className:"border-none",label:fl("BPA_BUILDING_STATUS_LABEL"),text:(null==Hl||null===(rt=Hl.buildingStatus)||void 0===rt?void 0:rt.code)||(null==qt||null===(ut=qt.additionalDetails)||void 0===ut?void 0:ut.buildingStatus)||fl("CS_NA")}),l.createElement(o.Row,{className:"border-none",label:fl("BPA_CORE_AREA_LABEL"),text:(null==zn||null===(dt=zn.planDetail)||void 0===dt?void 0:dt.coreArea)||(null==qt||null===(st=qt.additionalDetails)||void 0===st?void 0:st.coreArea)||fl("CS_NA")}),l.createElement(o.Row,{className:"border-none",label:fl("BPA_PROPOSED_SITE_LABEL"),text:(null==Hl||null===(ct=Hl.proposedSite)||void 0===ct?void 0:ct.code)||(null==qt||null===(vt=qt.additionalDetails)||void 0===vt?void 0:vt.proposedSite)||fl("CS_NA")}),"SCHEME"===(null==Hl||null===(pt=Hl.schemes)||void 0===pt?void 0:pt.code)&&l.createElement(l.Fragment,null,l.createElement(o.Row,{className:"border-none",label:fl("BPA_SCHEME_TYPE_LABEL"),text:(null==Hl||null===(mt=Hl.schemesselection)||void 0===mt?void 0:mt.value)||(null==qt||null===(Et=qt.additionalDetails)||void 0===Et?void 0:Et.schemesselection)||fl("CS_NA")}),l.createElement(o.Row,{className:"border-none",label:fl("BPA_SCHEME_NAME_LABEL"),text:(null==Hl?void 0:Hl.schemeName)||(null==qt||null===(_t=qt.additionalDetails)||void 0===_t?void 0:_t.schemeName)||fl("CS_NA")}),l.createElement(o.Row,{className:"border-none",label:fl("BPA_TRANFERRED_SCHEME_LABEL"),text:(null==Hl?void 0:Hl.transferredscheme)||(null==qt||null===(ft=qt.additionalDetails)||void 0===ft?void 0:ft.transferredscheme)||fl("CS_NA")})),l.createElement(o.Row,{className:"border-none",label:fl("BPA_PURCHASED_FAR_LABEL"),text:(null==Hl||null===(At=Hl.purchasedFAR)||void 0===At?void 0:At.code)||(null==qt||null===(St=qt.additionalDetails)||void 0===St?void 0:St.purchasedFAR)||fl("CS_NA")}),l.createElement(o.Row,{className:"border-none",label:fl("BPA_MASTER_PLAN_LABEL"),text:(null==Hl||null===(ht=Hl.masterPlan)||void 0===ht?void 0:ht.code)||(null==qt||null===(yt=qt.additionalDetails)||void 0===yt?void 0:yt.masterPlan)||fl("CS_NA")}),l.createElement(o.Row,{className:"border-none",label:fl("BPA_GREEN_BUILDING_LABEL"),text:(null==Hl||null===(Dt=Hl.greenbuilding)||void 0===Dt?void 0:Dt.code)||(null==qt||null===(Tt=qt.additionalDetails)||void 0===Tt?void 0:Tt.greenbuilding)||fl("CS_NA")}))),l.createElement(o.Card,{style:{paddingRight:"16px"}},l.createElement(o.StatusTable,null,l.createElement(o.CardHeader,null,fl("BPA_DOCUMENT_DETAILS_LABEL")),l.createElement(o.LinkButton,{label:l.createElement(o.EditIcon,{style:{marginTop:"-10px",float:"right",position:"relative",bottom:"32px"}}),style:{width:"100px",display:"inline"},onClick:()=>ii(Qn+"/document-details")}),l.createElement(Vl,{documents:Wt(Yn),svgStyles:{},isSendBackFlow:!1,isHrLine:!0,titleStyles:{fontSize:"18px",lineHeight:"24px",fontWeight:700,marginBottom:"10px"}}))),l.createElement(o.Card,{style:{paddingRight:"16px"}},l.createElement(o.CardSubHeader,null,fl("BPA_SUMMARY_FEE_EST")),l.createElement(o.StatusTable,null,l.createElement(o.CardSubHeader,null,fl("BPA_P1_SUMMARY_FEE_EST")),l.createElement(o.Row,{className:"border-none",label:fl("BPA_APPL_FEES"),text:"₹ "+((null==qt||null===(bt=qt.additionalDetails)||void 0===bt?void 0:bt.P1charges)||(null==Jn||null===(Ct=Jn.Bill[0])||void 0===Ct||null===(Pt=Ct.billDetails[0])||void 0===Pt?void 0:Pt.amount))}),l.createElement(o.Row,{className:"border-none",label:fl("BUILDING_APPLICATION_FEES"),text:"₹ "+Math.round(10.7639*(null==zn||null===(Nt=zn.planDetail)||void 0===Nt||null===(It=Nt.blocks)||void 0===It||null===(Lt=It[0])||void 0===Lt||null===(Bt=Lt.building)||void 0===Bt?void 0:Bt.totalBuitUpArea)*2.5)}),l.createElement(o.Row,{className:"border-none",label:fl("BOUNDARY_WALL_FEES"),text:"₹ "+2.5*(null==kl?void 0:kl.boundaryWallLength)}),l.createElement(o.CardSubHeader,null,fl("BPA_P2_SUMMARY_FEE_EST")),l.createElement(o.Row,{className:"border-none",label:fl("BPA_COMMON_MALBA_AMT"),text:"₹ "+ul}),l.createElement(o.Row,{className:"border-none",label:fl("BPA_COMMON_LABOUR_AMT"),text:"₹ "+il}),l.createElement(o.Row,{className:"border-none",label:fl("BPA_COMMON_WATER_AMT"),text:"₹ "+sl}),l.createElement(o.Row,{className:"border-none",label:fl("BPA_COMMON_GAUSHALA_AMT"),text:"₹ "+al}),l.createElement(o.CardSubHeader,null,fl("BPA_P2_SUMMARY_FEE_EST_MANUAL")),l.createElement(o.CardLabel,null,fl("BPA_COMMON_DEVELOPMENT_AMT")),l.createElement(o.TextInput,{t:fl,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"development",defaultValue:null==qt||null===(Rt=qt.additionalDetails)||void 0===Rt||null===(wt=Rt.selfCertificationCharges)||void 0===wt?void 0:wt.BPA_DEVELOPMENT_CHARGES,value:Xt,onChange:e=>{!function(e){/^\d{0,10}$/.test(e)?(Jt(e),sessionStorage.setItem("development",e)):alert(fl("Please enter numbers"))}(e.target.value)},required:!0,pattern:"^[0-9]*$"}),l.createElement(o.CardLabel,null,fl("BPA_COMMON_OTHER_AMT")),l.createElement(o.TextInput,{t:fl,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"otherCharges",defaultValue:null==qt||null===(xt=qt.additionalDetails)||void 0===xt||null===(Mt=xt.selfCertificationCharges)||void 0===Mt?void 0:Mt.BPA_OTHER_CHARGES,value:Zt,onChange:e=>{!function(e){/^[0-9]*$/.test(e)?(Qt(e),sessionStorage.setItem("otherCharges",e)):alert(fl("Please enter numbers"))}(e.target.value)},required:!0,pattern:/^[0-9]*$/}),parseInt(Zt)>0?l.createElement("div",null,l.createElement(o.CardLabel,null,fl("BPA_COMMON_OTHER_AMT_DISCRIPTION")),l.createElement(o.TextArea,{t:fl,type:"text",name:"otherChargesDiscription",defaultValue:null==qt||null===(Ft=qt.additionalDetails)||void 0===Ft?void 0:Ft.otherFeesDiscription,value:ll,onChange:e=>{!function(e){nl(e),sessionStorage.setItem("otherChargesDisc",e)}(e.target.value)},required:!0})):null,l.createElement(o.CardLabel,null,fl("BPA_COMMON_LESS_AMT")),l.createElement(o.TextInput,{t:fl,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"lessAdjusment",defaultValue:null==qt||null===(kt=qt.additionalDetails)||void 0===kt||null===(Ut=kt.selfCertificationCharges)||void 0===Ut?void 0:Ut.BPA_LESS_ADJUSMENT_PLOT,value:el,onChange:e=>{!function(e){/^[0-9]*$/.test(e)?parseInt(e)>(parseInt(Xt)?parseInt(Xt):0)+(parseInt(Zt)?parseInt(Zt):0)+parseInt(ul)+parseInt(il)+parseInt(sl)+parseInt(al)?alert(fl("Less adjustment fees cannot be grater than Total of other P2 fees")):(tl(e),sessionStorage.setItem("lessAdjusment",e)):alert(fl("Please enter numbers"))}(e.target.value)},required:!0,pattern:"^[0-9]*$"}),parseInt(el)>0?l.createElement("div",null,l.createElement(o.CardLabel,null,fl("BPA_COMMON_LESS_AMT_FILE")),l.createElement(o.UploadFile,{id:"noc-doc",style:{marginBottom:"200px"},onUpload:function(e){Tl(e.target.files[0]),Nl(e.target.files[0])},onDelete:()=>{Tl(null),Nl("")},message:Dl?"1 "+fl("FILEUPLOADED"):fl("ES_NO_FILE_SELECTED_LABEL"),error:Bl,uploadMessage:Il})):null,(null==Rl||null===(Ht=Rl.fileStoreIds)||void 0===Ht?void 0:Ht.length)&&parseInt(null==qt||null===(Gt=qt.additionalDetails)||void 0===Gt||null===(jt=Gt.selfCertificationCharges)||void 0===jt?void 0:jt.BPA_LESS_ADJUSMENT_PLOT)>0&&l.createElement(o.CardLabel,{style:{marginTop:"15px"}},fl("BPA_COMMON_LESS_AMT_PREVIOUS_FILE")),(null==Rl||null===(Kt=Rl.fileStoreIds)||void 0===Kt?void 0:Kt.length)&&parseInt(null==qt||null===(Yt=qt.additionalDetails)||void 0===Yt||null===($t=Yt.selfCertificationCharges)||void 0===$t?void 0:$t.BPA_LESS_ADJUSMENT_PLOT)>0&&l.createElement("a",{target:"_blank",href:null==Rl||null===(zt=Rl.fileStoreIds[0])||void 0===zt?void 0:zt.url},l.createElement(o.PDFSvg,null)),l.createElement(o.Row,{className:"border-none"}),l.createElement(o.Row,{className:"border-none",label:fl("BPA_P2_TOTAL_FEE"),text:"₹ "+((parseInt(Xt)?parseInt(Xt):0)+(parseInt(Zt)?parseInt(Zt):0)+parseInt(ul)+parseInt(il)+parseInt(sl)+parseInt(al)-(parseInt(el)?parseInt(el):0))}),"INITIATED"===(null==qt?void 0:qt.status)&&l.createElement("div",null,l.createElement(o.CardLabel,null,fl("ARCHITECT_SHOULD_VERIFY_HIMSELF_BY_CLICKING_BELOW_BUTTON")),l.createElement(o.LinkButton,{label:fl("BPA_VERIFY"),onClick:e=>{e.preventDefault(),nn(!0)}}),l.createElement("br",null),ln&&l.createElement(l.Fragment,null,l.createElement("br",null),l.createElement(o.CardLabel,null,fl("BPA_MOBILE_NUMBER")),l.createElement(o.TextInput,{t:fl,type:"tel",isMandatory:!0,optionKey:"i18nKey",name:"mobileNumber",value:on,onChange:wn,required:!0,pattern:"[0-9]{10}",type:"tel",title:fl("CORE_COMMON_APPLICANT_MOBILE_NUMBER_INVALID")}),l.createElement(o.LinkButton,{label:fl("BPA_GET_OTP"),onClick:xn,disabled:!Hn})),l.createElement("br",null),rn&&l.createElement(l.Fragment,null,l.createElement("br",null),l.createElement(o.CardLabel,null,fl("BPA_OTP")),l.createElement(o.OTPInput,{length:6,onChange:e=>sn(e),value:dn}),l.createElement(o.SubmitBar,{label:fl("VERIFY_OTP"),onSubmit:Fn}),pn&&l.createElement(o.CardLabel,{style:{color:"red"}},pn)))),l.createElement("br",null),l.createElement("br",null),l.createElement("div",null,l.createElement(o.CheckBox,{label:Rn(),onChange:kn,styles:{height:"auto"}}),Zl&&l.createElement(Wo,{showTermsPopup:Zl,setShowTermsPopup:Ql,otpVerifiedTimestamp:En})),l.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",height:"2px",marginTop:"20px",marginBottom:"20px"}})),l.createElement(o.Card,null,l.createElement("div",{style:{marginBottom:"30px"}},cn&&Nn&&l.createElement("div",null,l.createElement(o.CheckBox,{label:Rn(),onChange:kn,styles:{height:"auto"},checked:Xl})),cn&&l.createElement(o.CardLabel,{style:{color:"green",marginTop:"10px"}},"✓ ",fl("PROFESSIONAL_VERIFICATION_COMPLETED"))),ln&&!cn&&l.createElement(l.Fragment,null,l.createElement(o.CardLabel,null,fl("BPA_MOBILE_NUMBER")),l.createElement(o.TextInput,{t:fl,type:"tel",isMandatory:!0,optionKey:"i18nKey",name:"mobileNumber",value:on,onChange:wn,required:!0,pattern:"[0-9]{10}",type:"tel",title:fl("CORE_COMMON_APPLICANT_MOBILE_NUMBER_INVALID")}),l.createElement(o.LinkButton,{label:fl("BPA_GET_OTP"),onClick:xn,disabled:!Hn})),rn&&!cn&&l.createElement(l.Fragment,null,l.createElement("br",null),l.createElement(o.CardLabel,null,fl("BPA_OTP")),l.createElement(o.OTPInput,{length:6,onChange:e=>sn(e),value:dn}),l.createElement(o.SubmitBar,{label:fl("VERIFY_OTP"),onSubmit:Fn}),pn&&l.createElement(o.CardLabel,{style:{color:pn===fl("VERIFIED")?"green":"red"}},pn)),l.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",height:"1px",marginTop:"20px",marginBottom:"20px"}}),l.createElement("div",{style:{marginBottom:"30px"}},l.createElement(o.CheckBox,{label:l.createElement("div",null,fl("OWNER_AGREES_TO_BELOW_UNDERTAKING"),l.createElement(o.LinkButton,{label:fl("OWNER_DECLARATION_UNDER_SELF_CERTIFICATION_SCHEME"),onClick:e=>{e.preventDefault(),e.stopPropagation(),Nn?(tn(!0),console.log("OPEN")):alert("Please verify owner first")},disabled:!Nn})),onChange:e=>{e.preventDefault(),Nn?gn(!An):hn(!0)},styles:{height:"auto"},checked:An,disabled:!cn}),Nn&&l.createElement(o.CardLabel,{style:{color:"green",marginTop:"10px"}},"✓ ",fl("OWNER_VERIFICATION_COMPLETED"))),Sn&&!Nn&&l.createElement(l.Fragment,null,l.createElement(o.CardLabel,null,fl("OWNER_MOBILE_NUMBER")),l.createElement(o.TextInput,{t:fl,type:"tel",isMandatory:!0,optionKey:"i18nKey",name:"ownerMobileNumber",value:yn,onChange:e=>{Dn(e.target.value)},required:!0,pattern:"[0-9]{10}",type:"tel",title:fl("CORE_COMMON_APPLICANT_MOBILE_NUMBER_INVALID")}),l.createElement(o.LinkButton,{label:fl("BPA_GET_OTP"),onClick:function(e){try{e.preventDefault();const t=m(function(){var e;return Promise.resolve(Digit.UserService.sendOtp({otp:{mobileNumber:yn,tenantId:null==Al||null===(e=Al.info)||void 0===e?void 0:e.tenantId,userType:"CITIZEN",type:"login"}})).then(function(e){e.isSuccessful?bn(!0):(console.error("Error sending Owner OTP Response is false:",e.error),alert("Something Went Wrong"))})},function(e){console.error("Error sending Owner OTP:",e),alert("Something went wrong")});return Promise.resolve(t&&t.then?t.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},disabled:!Wn})),Tn&&!Nn&&l.createElement(l.Fragment,null,l.createElement("br",null),l.createElement(o.CardLabel,null,fl("ENTER_OTP_SENT_ON_OWNER_MOBILE")),l.createElement(o.OTPInput,{length:6,onChange:e=>Pn(e),value:Cn}),l.createElement(o.SubmitBar,{label:fl("VERIFY_OWNER_OTP"),onSubmit:function(e){try{e.preventDefault(),console.log("Owner OTP++++++++>");const t=m(function(){return Promise.resolve(Digit.UserService.authenticate(Un)).then(function(e){"Access Token generated successfully"===e.ResponseInfo.status?(In(!0),Bn(fl("VERIFIED")),gn(!0)):(In(!1),Bn(fl("WRONG OTP")))})},function(e){console.error("Error verifying Owner OTP:",e),alert("Owner OTP Verification Error "),In(!1),Bn(fl("OTP Verification Error"))});return Promise.resolve(t&&t.then?t.then(function(){}):void 0)}catch(e){return Promise.reject(e)}}}),Ln&&l.createElement(o.CardLabel,{style:{color:Ln===fl("VERIFIED")?"green":"red"}},Ln)),en&&l.createElement(fn,{showTermsPopupOwner:en,setShowTermsPopupOwner:tn,otpVerifiedTimestamp:En}),l.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",height:"2px",marginTop:"20px",marginBottom:"20px"}}),l.createElement(o.SubmitBar,{label:fl(xl?"SUBMITTING...":"BPA_SEND_TO_CITIZEN_LABEL"),onSubmit:function(){try{Ml(!0);const e=E(function(){return m(function(){return Promise.resolve(function(){if(Xt||sessionStorage.setItem("development",0),el||sessionStorage.setItem("lessAdjusment",0),Zt||sessionStorage.setItem("otherCharges",0),parseInt(el)>parseInt(Xt)+parseInt(Zt)+parseInt(ul)+parseInt(il)+parseInt(sl)+parseInt(al))alert(fl("Enterd Less Adjustment amount is invalid"));else{var e,t,l,n;const i=(null==qt||null===(e=qt.data)||void 0===e||null===(t=e.scrutinyNumber)||void 0===t?void 0:t.edcrNumber)||(null==qt||null===(l=qt.data)||void 0===l?void 0:l.scrutinyNumber)||(null==kl||null===(n=kl.scrutinyNumber)||void 0===n?void 0:n.edcrNumber)||(null==_l?void 0:_l.edcrNumber);Vt({tenantId:ai,edcrNumber:i})}}()).then(function(){})},function(e){console.error("Submission error:",e),alert("Submission failed. Please try again.")})},function(e,t){if(Ml(!1),e)throw t;return t});return Promise.resolve(e&&e.then?e.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},disabled:!Xl||!cn||!Nn||xl})))},OCBPACheckPage:e=>{var a,r,u,d,s,c,v,p,m,E,_,f,A,g,S,h,y,D,T,b,C,P,N,I,L,B,O,R,w,x,M,F,k,U,H,W,G,j,K,Y,$,z,V,q;let{onSubmit:X,value:J}=e;const{t:Z}=n.useTranslation();i.useHistory(),i.useRouteMatch();let Q,ee=Digit.UserService.getUser();"BPA_LOW"===J.businessService?Q="BPA.LOW_RISK_PERMIT_FEE":"BPA"===J.businessService?Q="BPA.NC_APP_FEE":"BPA_OC"===J.businessService&&(Q="BPA.NC_OC_APP_FEE");const{data:te,nocDocuments:le,documents:ne,additionalDetails:ie,PrevStateDocuments:oe,PrevStateNocDocuments:ae,applicationNo:re,uiFlow:ue}=J,de=(null==ee||null===(a=ee.info)||void 0===a?void 0:a.permanentCity)||(null==J?void 0:J.tenantId)||Digit.ULBService.getCurrentTenantId();let se=window.location.href.includes("editApplication"),ce=[];null==oe||oe.map(e=>{ce.push({...e,module:"OBPS"})}),null==ne||null===(r=ne.documents)||void 0===r||r.map(e=>{ce.push({...e,module:"OBPS"})}),null==ae||ae.map(e=>{ce.push({...e,module:"NOC"})}),null==le||null===(u=le.nocDocuments)||void 0===u||u.map(e=>{ce.push({...e,module:"NOC"})});const{data:ve,isLoading:pe}=Digit.Hooks.useDocumentSearch(ce,{enabled:(null==ce?void 0:ce.length)>0});let me=[],Ee=[];var _e;(null==ve||null===(d=ve.pdfFiles)||void 0===d?void 0:d.length)>0&&(null==ve||null===(_e=ve.pdfFiles)||void 0===_e||_e.map(e=>{"OBPS"==(null==e?void 0:e.module)&&me.push(e),"NOC"==(null==e?void 0:e.module)&&Ee.push(e)}));const{data:fe,isLoading:Ae}=Digit.Hooks.obps.useScrutinyDetails(de,null==J||null===(s=J.data)||void 0===s?void 0:s.scrutinyNumber,{enabled:!(null==J||null===(c=J.data)||void 0===c||!c.scrutinyNumber)});let ge=null==J?void 0:J.applicationNo;const Se={consumerCode:ge},{data:he}=Digit.Hooks.useFetchBillsForBuissnessService({businessService:Q,...Se,tenantId:de||(null==J?void 0:J.tenantId)},{enabled:!!ge,retry:!1});let ye=se?`/digit-ui/citizen/obps/editApplication/ocbpa/${null==J?void 0:J.tenantId}/${null==J?void 0:J.applicationNo}`:`/digit-ui/citizen/obps/ocbpa/${null==ie?void 0:ie.applicationType.toLowerCase()}/${null==ie?void 0:ie.serviceType.toLowerCase()}`;const De=[{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"},{name:"BPA_TABLE_COL_CARPETAREA",id:"CarpetArea"}],Te=e=>{const t=e;return(e,l,n)=>e[t]},be=t.useMemo(()=>De.map(e=>({Header:Z(""+e.name),accessor:Te(e.id),id:e.id})));function Ce(e){var t;let l=[];return null==e||null===(t=e.building)||void 0===t||t.floors.map(e=>{var t,n,i,o,a,r,u,d;l.push({Floor:Z("BPA_FLOOR_NAME_"+e.number),Level:e.number,Occupancy:Z(""+(null===(t=e.occupancies)||void 0===t||null===(n=t[0])||void 0===n?void 0:n.type)),BuildupArea:null===(i=e.occupancies)||void 0===i||null===(o=i[0])||void 0===o?void 0:o.builtUpArea,FloorArea:(null===(a=e.occupancies)||void 0===a||null===(r=a[0])||void 0===r?void 0:r.floorArea)||0,CarpetArea:(null===(u=e.occupancies)||void 0===u||null===(d=u[0])||void 0===d?void 0:d.CarpetArea)||0,key:Z("BPA_FLOOR_NAME_"+e.number)})}),l}function Pe(e){var t,l,n,i;let o=null==te||null===(t=te.bpaData)||void 0===t||null===(l=t.bpaApprovalResponse)||void 0===l||null===(n=l[0])||void 0===n||null===(i=n.landInfo)||void 0===i?void 0:i.unit,a="";if((null==o?void 0:o.length)>0){var r,u;let t=null===(r=o[e])||void 0===r||null===(u=r.usageCategory)||void 0===u?void 0:u.split(",");null!=t&&t.length&&(a=t.map(e=>e?""+Z("BPA_SUBOCCUPANCYTYPE_"+gt(null==e?void 0:e.toUpperCase(),"-","_")):"NA").join(", "))}return a||"NA"}function Ne(e){location.href=e}return pe||Ae?l.createElement(o.Loader,null):l.createElement(l.Fragment,null,l.createElement(zl,{currentStep:4,flow:"OCBPA"===(null==ue?void 0:ue.flow)?"OCBPA":""}),l.createElement(o.Header,{styles:{marginLeft:"10px"}},Z("BPA_STEPPER_SUMMARY_HEADER")),l.createElement(o.Card,{style:{paddingRight:"16px"}},l.createElement(o.StatusTable,null,l.createElement(o.Row,{className:"border-none",label:Z("BPA_APPLICATION_NUMBER_LABEL"),text:re||""}))),l.createElement(o.Card,{style:{paddingRight:"16px"}},l.createElement(o.CardHeader,null,Z("BPA_BASIC_DETAILS_TITLE")),l.createElement(o.StatusTable,null,l.createElement(o.Row,{className:"border-none",label:""+Z("BPA_BASIC_DETAILS_APP_DATE_LABEL"),text:Ot(Number(null==te?void 0:te.applicationDate))}),l.createElement(o.Row,{className:"border-none",label:""+Z("BPA_BASIC_DETAILS_APPLICATION_TYPE_LABEL"),text:Z("WF_BPA_"+(null==te?void 0:te.applicationType))}),l.createElement(o.Row,{className:"border-none",label:""+Z("BPA_BASIC_DETAILS_SERVICE_TYPE_LABEL"),text:Z(null==te?void 0:te.serviceType)}),l.createElement(o.Row,{className:"border-none",label:""+Z("BPA_BASIC_DETAILS_OCCUPANCY_LABEL"),text:null==te?void 0:te.occupancyType}),l.createElement(o.Row,{className:"border-none",label:""+Z("BPA_BASIC_DETAILS_RISK_TYPE_LABEL"),text:Z("WF_BPA_"+(null==te?void 0:te.riskType))}),l.createElement(o.Row,{className:"border-none",label:""+Z("BPA_BASIC_DETAILS_APPLICATION_NAME_LABEL"),text:null==te?void 0:te.applicantName}))),l.createElement(o.Card,{style:{paddingRight:"16px"}},l.createElement(o.StatusTable,null,l.createElement(o.CardHeader,null,Z("BPA_PLOT_DETAILS_TITLE")),l.createElement(o.LinkButton,{label:l.createElement(o.EditIcon,{style:{marginTop:"-10px",float:"right",position:"relative",bottom:"32px"}}),style:{width:"100px",display:"inline"},onClick:()=>Ne(ye+"/plot-details")}),l.createElement(o.Row,{className:"border-none",label:""+Z("BPA_BOUNDARY_PLOT_AREA_LABEL"),text:null!=fe&&null!==(v=fe.planDetail)&&void 0!==v&&null!==(p=v.planInformation)&&void 0!==p&&p.plotArea?`${null==fe||null===(m=fe.planDetail)||void 0===m||null===(E=m.planInformation)||void 0===E?void 0:E.plotArea} ${Z("BPA_SQ_MTRS_LABEL")}`:Z("CS_NA"),textStyle:{paddingLeft:"12px"}}),l.createElement(o.Row,{className:"border-none",label:""+Z("BPA_PLOT_NUMBER_LABEL"),text:(null==fe||null===(_=fe.planDetail)||void 0===_||null===(f=_.planInformation)||void 0===f?void 0:f.plotNo)||Z("CS_NA")}),l.createElement(o.Row,{className:"border-none",label:""+Z("BPA_KHATHA_NUMBER_LABEL"),text:(null==fe||null===(A=fe.planDetail)||void 0===A||null===(g=A.planInformation)||void 0===g?void 0:g.khataNo)||Z("CS_NA")}),l.createElement(o.Row,{className:"border-none",label:""+Z("BPA_BOUNDARY_LAND_REG_DETAIL_LABEL"),text:(null==te?void 0:te.registrationDetails)||Z("CS_NA")}))),l.createElement(o.Card,{style:{paddingRight:"16px"}},l.createElement(o.CardHeader,null,""+Z("BPA_STEPPER_SCRUTINY_DETAILS_HEADER")),l.createElement(o.CardSubHeader,null,""+Z("BPA_EDCR_DETAILS")),l.createElement(o.StatusTable,{style:{border:"none"}},l.createElement(o.Row,{className:"border-none",label:""+Z("BPA_OC_EDCR_NO_LABEL"),text:null==te||null===(S=te.scrutinyNumber)||void 0===S?void 0:S.edcrNumber}),l.createElement(o.CardSubHeader,null,Z("BPA_UPLOADED_PLAN_DIAGRAM")),l.createElement(o.LinkButton,{label:l.createElement(o.PDFSvg,null),onClick:()=>Ne(null==fe?void 0:fe.updatedDxfFile)}),l.createElement("p",{style:{marginTop:"8px",marginBottom:"20px",textAlign:"Left",fontSize:"16px",lineHeight:"19px",color:"#505A5F",fontWeight:"400"}},Z("BPA_UPLOADED_PLAN_DXF")),l.createElement(o.CardSubHeader,null,Z("BPA_SCRUNTINY_REPORT_OUTPUT")),l.createElement(o.LinkButton,{label:l.createElement(o.PDFSvg,null),onClick:()=>Ne(null==fe?void 0:fe.planReport)}),l.createElement("p",{style:{marginTop:"8px",marginBottom:"20px",textAlign:"Left",fontSize:"16px",lineHeight:"19px",color:"#505A5F",fontWeight:"400"}},Z("BPA_SCRUTINY_REPORT_PDF"))),l.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",height:"2px",marginTop:"20px",marginBottom:"20px"}}),l.createElement(o.CardSubHeader,null,""+Z("BPA_ACTUAL_BUILDING_EXTRACT_HEADER")),l.createElement(o.StatusTable,null,l.createElement(o.Row,{className:"border-none",label:""+Z("BPA_TOTAL_BUILT_UP_AREA_HEADER"),text:null!=fe&&null!==(h=fe.planDetail)&&void 0!==h&&null!==(y=h.blocks)&&void 0!==y&&null!==(D=y[0])&&void 0!==D&&null!==(T=D.building)&&void 0!==T&&T.totalBuitUpArea?`${null==fe||null===(b=fe.planDetail)||void 0===b||null===(C=b.blocks)||void 0===C||null===(P=C[0])||void 0===P||null===(N=P.building)||void 0===N?void 0:N.totalBuitUpArea} ${Z("BPA_SQ_MTRS_LABEL")}`:Z("NA")}),l.createElement(o.Row,{className:"border-none",label:""+Z("BPA_SCRUTINY_DETAILS_NUMBER_OF_FLOORS_LABEL"),text:null==fe||null===(I=fe.planDetail)||void 0===I||null===(L=I.blocks)||void 0===L||null===(B=L[0])||void 0===B||null===(O=B.building)||void 0===O?void 0:O.totalFloors}),l.createElement(o.Row,{className:"border-none",label:""+Z("BPA_HEIGHT_FROM_GROUND_LEVEL_FROM_MUMTY"),text:`${null==fe||null===(R=fe.planDetail)||void 0===R||null===(w=R.blocks)||void 0===w||null===(x=w[0])||void 0===x||null===(M=x.building)||void 0===M?void 0:M.declaredBuildingHeight} ${Z("BPA_MTRS_LABEL")}`})),l.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",height:"2px",marginTop:"20px",marginBottom:"20px"}}),l.createElement(o.CardSubHeader,null,""+Z("BPA_OCC_SUBOCC_HEADER")),null==fe||null===(F=fe.planDetail)||void 0===F?void 0:F.blocks.map((e,t)=>{var n,i;return l.createElement("div",{key:t,style:(null==fe||null===(n=fe.planDetail)||void 0===n||null===(i=n.blocks)||void 0===i?void 0:i.length)>1?{marginTop:"19px",background:"#FAFAFA",border:"1px solid #D6D5D4",borderRadius:"4px",padding:"8px",lineHeight:"19px",maxWidth:"960px",minWidth:"280px"}:{}},l.createElement(o.CardSubHeader,{style:{marginTop:"15px"}},""+Z("BPA_BLOCK_SUBHEADER")," ",t+1),l.createElement(o.StatusTable,null,l.createElement(o.Row,{className:"border-none",textStyle:{wordBreak:"break-word"},label:""+Z("BPA_SUB_OCCUPANCY_LABEL"),text:Pe(t)})),l.createElement("div",{style:{overflowX:"scroll"}},l.createElement(o.Table,{className:"customTable table-fixed-first-column table-border-style",t:Z,disableSort:!1,autoSort:!0,manualPagination:!1,isPaginationRequired:!1,initSortId:"S N ",data:Ce(e),columns:be,getCellProps:e=>({style:{}})})))}),l.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",height:"2px",marginTop:"20px",marginBottom:"20px"}}),l.createElement(o.CardSubHeader,null,""+Z("BPA_APP_DETAILS_DEMOLITION_DETAILS_LABEL")),l.createElement(o.StatusTable,{style:{border:"none"}},l.createElement(o.Row,{className:"border-none",label:""+Z("BPA_APPLICATION_DEMOLITION_AREA_LABEL"),text:null!=fe&&null!==(k=fe.planDetail)&&void 0!==k&&null!==(U=k.planInformation)&&void 0!==U&&U.demolitionArea?`${null==fe||null===(H=fe.planDetail)||void 0===H||null===(W=H.planInformation)||void 0===W?void 0:W.demolitionArea} ${Z("BPA_SQ_MTRS_LABEL")}`:Z("CS_NA")}))),l.createElement(o.Card,{style:{paddingRight:"16px"}},l.createElement(o.StatusTable,null,l.createElement(o.CardHeader,null,Z("BPA_DOCUMENT_DETAILS_LABEL")),l.createElement(o.LinkButton,{label:l.createElement(o.EditIcon,{style:{marginTop:"-10px",float:"right",position:"relative",bottom:"32px"}}),style:{width:"100px",display:"inline"},onClick:()=>Ne(ye+"/document-details")}),l.createElement(Vl,{documents:Wt(me),svgStyles:{},isSendBackFlow:!1,isHrLine:!0,titleStyles:{fontSize:"18px",lineHeight:"24px",fontWeight:700,marginBottom:"10px"}}))),l.createElement(o.Card,{style:{paddingRight:"16px"}},l.createElement(o.StatusTable,null,l.createElement(o.CardHeader,null,Z("BPA_NOC_DETAILS_SUMMARY")),l.createElement(o.LinkButton,{label:l.createElement(o.EditIcon,{style:{marginTop:"-10px",float:"right",position:"relative",bottom:"32px"}}),style:{width:"100px",display:"inline"},onClick:()=>Ne(ye+"/noc-details")}),le&&(null==le?void 0:le.NocDetails.map((e,t)=>{var n,i,a,r,u;return l.createElement("div",{key:t,style:(null==le||null===(n=le.NocDetails)||void 0===n?void 0:n.length)>1?{marginTop:"19px",background:"#FAFAFA",border:"1px solid #D6D5D4",borderRadius:"4px",padding:"8px",lineHeight:"19px",maxWidth:"960px",minWidth:"280px"}:{}},l.createElement(o.CardSectionHeader,{style:{marginBottom:"24px"}},""+Z(`BPA_${null==e?void 0:e.nocType}_HEADER`)),l.createElement(o.StatusTable,null,l.createElement(o.Row,{className:"border-none",label:Z(`BPA_${null==e?void 0:e.nocType}_LABEL`),text:null==e?void 0:e.applicationNo}),l.createElement(o.Row,{className:"border-none",label:Z("BPA_NOC_STATUS"),text:Z(""+(null==e?void 0:e.applicationStatus)),textStyle:"APPROVED"==(null==e?void 0:e.applicationStatus)||"AUTO_APPROVED"==(null==e?void 0:e.applicationStatus)?{color:"#00703C"}:{color:"#D4351C"}}),null!=e&&null!==(i=e.additionalDetails)&&void 0!==i&&i.SubmittedOn?l.createElement(o.Row,{className:"border-none",label:""+Z("BPA_NOC_SUBMISSION_DATE"),text:null!=e&&null!==(a=e.additionalDetails)&&void 0!==a&&a.SubmittedOn?Ot(Number(null==e||null===(r=e.additionalDetails)||void 0===r?void 0:r.SubmittedOn)):"NA"}):null,null!=e&&e.nocNo?l.createElement(o.Row,{className:"border-none",label:""+Z("BPA_APPROVAL_NUMBER_LABEL"),text:(null==e?void 0:e.nocNo)||"NA"}):null,"APPROVED"===(null==e?void 0:e.applicationStatus)||"REJECTED"===(null==e?void 0:e.applicationStatus)||"AUTO_APPROVED"===(null==e?void 0:e.applicationStatus)||"AUTO_REJECTED"===(null==e?void 0:e.applicationStatus)?l.createElement(o.Row,{className:"border-none",label:""+Z("BPA_APPROVED_REJECTED_ON_LABEL"),text:Ot(Number(null==e||null===(u=e.auditDetails)||void 0===u?void 0:u.lastModifiedTime))}):null,l.createElement(o.Row,{className:"border-none",label:Z("BPA_DOCUMENT_DETAILS_LABEL"),text:""}),l.createElement(Vl,{documents:Wt(null==Ee?void 0:Ee.filter(t=>{var l,n,i;return null==t||null===(l=t.documentType)||void 0===l?void 0:l.includes(null==e||null===(n=e.nocType)||void 0===n||null===(i=n.split("_"))||void 0===i?void 0:i[0])}),!0),svgStyles:{},isSendBackFlow:!1,isHrLine:!0,titleStyles:{fontSize:"18px",lineHeight:"24px",fontWeight:700,marginBottom:"10px"}})))})))),l.createElement(o.Card,{style:{paddingRight:"16px"}},l.createElement(o.CardSubHeader,null,""+Z("BPA_SUMMARY_FEE_EST")),l.createElement(o.StatusTable,null,null==he||null===(G=he.Bill[0])||void 0===G||null===(j=G.billDetails[0])||void 0===j?void 0:j.billAccountDetails.map((e,t)=>l.createElement("div",{key:t},l.createElement(o.Row,{className:"border-none",label:""+Z(""+e.taxHeadCode),text:"₹ "+(null==e?void 0:e.amount)}))),l.createElement(o.Row,{className:"border-none",label:Z("BPA_COMMON_TOTAL_AMT"),text:"₹ "+((null==he||null===(K=he.Bill)||void 0===K||null===(Y=K[0])||void 0===Y||null===($=Y.billDetails[0])||void 0===$?void 0:$.amount)||"0")})),l.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",height:"2px",marginTop:"20px",marginBottom:"20px"}}),l.createElement(o.CardHeader,null,Z("BPA_COMMON_TOTAL_AMT")),l.createElement(o.CardHeader,null,"₹ ",(null==he||null===(z=he.Bill)||void 0===z||null===(V=z[0])||void 0===V||null===(q=V.billDetails[0])||void 0===q?void 0:q.amount)||"0"),l.createElement(o.SubmitBar,{label:Z("BPA_SEND_TO_CITIZEN_LABEL"),onSubmit:X})))},OCBPASendBackCheckPage:e=>{var a,r,d,s,c,v,p,m,E,_,f,A,g,S,h,y,D,T,b,C,P,N,I,L,B,O,R,w,x,M,F,k,U,H,W,G,j,K,Y,$,z,V,q,X,J,Z,Q,ee,te,le,ne,ie,oe,ae,re,ue,de,se,ce,ve,pe,me,Ee,_e;let{value:fe}=e;const{t:Ae}=n.useTranslation(),ge=i.useHistory();i.useRouteMatch();let Se,he=Digit.UserService.getUser();const ye=null==he||null===(a=he.info)||void 0===a?void 0:a.permanentCity,[De,Te]=t.useState(null),[be,Ce]=t.useState(!1),[Pe,Ne]=t.useState(null),Ie=null==fe||null===(r=fe.data)||void 0===r?void 0:r.edcrDetails,Le=u.useQueryClient(),{data:Be,address:Oe,owners:Re,nocDocuments:we,documents:xe,subOccupancy:Me,PrevStateDocuments:Fe,PrevStateNocDocuments:ke,applicationNo:Ue}=fe;let He=`/digit-ui/citizen/obps/sendbacktocitizen/${"BPA_OC"==fe.businessService?"ocbpa":"bpa"}/${null==fe?void 0:fe.tenantId}/${null==fe?void 0:fe.applicationNo}`;"OCBPA"===(null==fe||null===(d=fe.uiFlow)||void 0===d?void 0:d.flow)&&(He=`/digit-ui/citizen/obps/sendbacktocitizen/ocbpa/${null==fe?void 0:fe.tenantId}/${null==fe?void 0:fe.applicationNo}`),Se="BPA_LOW"===fe.businessService?"BPA.LOW_RISK_PERMIT_FEE":"BPA"===fe.businessService?"BPA.NC_APP_FEE":"BPA.NC_OC_APP_FEE";let We=[];null==Fe||Fe.map(e=>{We.push({...e,module:"OBPS"})}),null==xe||null===(s=xe.documents)||void 0===s||s.map(e=>{We.push({...e,module:"OBPS"})}),null==ke||ke.map(e=>{We.push({...e,module:"NOC"})}),null==we||null===(c=we.nocDocuments)||void 0===c||c.map(e=>{We.push({...e,module:"NOC"})});const{data:Ge,isLoading:je}=Digit.Hooks.useDocumentSearch(We,{enabled:(null==We?void 0:We.length)>0});let Ke=[],Ye=[];var $e;(null==Ge||null===(v=Ge.pdfFiles)||void 0===v?void 0:v.length)>0&&(null==Ge||null===($e=Ge.pdfFiles)||void 0===$e||$e.map(e=>{"OBPS"==(null==e?void 0:e.module)&&Ke.push(e),"NOC"==(null==e?void 0:e.module)&&Ye.push(e)}));const{data:ze,isLoading:Ve}=Digit.Hooks.useRecieptSearch({tenantId:null==fe?void 0:fe.tenantId,businessService:Se,consumerCodes:null==fe?void 0:fe.applicationNo},{enabled:!!(null!=fe&&fe.applicationNo&&Se&&null!=fe&&fe.tenantId)}),qe=Digit.Hooks.obps.useObpsAPI(null==fe?void 0:fe.tenantId,!1),Xe=Digit.Hooks.useWorkflowDetails({tenantId:null==fe?void 0:fe.tenantId,id:null==fe?void 0:fe.applicationNo,moduleCode:"OBPS",config:{enabled:!(null==fe||!fe.applicationNo||null==fe||!fe.tenantId)}}),Je=()=>{Ne(null)},Ze=[{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"},{name:"BPA_TABLE_COL_CARPETAREA",id:"CarpetArea"}],Qe=e=>{const t=e;return(e,l,n)=>e[t]},et=t.useMemo(()=>Ze.map(e=>({Header:Ae(""+e.name),accessor:Qe(e.id),id:e.id})));function tt(e){var t;let l=[];return null==e||null===(t=e.building)||void 0===t||t.floors.map(e=>{var t,n,i,o,a,r,u,d;l.push({Floor:Ae("BPA_FLOOR_NAME_"+e.number),Level:e.number,Occupancy:Ae(""+(null===(t=e.occupancies)||void 0===t||null===(n=t[0])||void 0===n?void 0:n.type)),BuildupArea:null===(i=e.occupancies)||void 0===i||null===(o=i[0])||void 0===o?void 0:o.builtUpArea,FloorArea:(null===(a=e.occupancies)||void 0===a||null===(r=a[0])||void 0===r?void 0:r.floorArea)||0,CarpetArea:(null===(u=e.occupancies)||void 0===u||null===(d=u[0])||void 0===d?void 0:d.CarpetArea)||0,key:Ae("BPA_FLOOR_NAME_"+e.number)})}),l}function lt(e){location.href=e}function nt(e){let t="";return Me["Block_"+(e+1)]&&Me["Block_"+(e+1)].map(e=>{var l;t+=Ae(gt(null==e||null===(l=e.i18nKey)||void 0===l?void 0:l.toUpperCase(),"-","_"))+", "}),t}return t.useEffect(()=>{switch(De){case"FORWARD":Ce(!0)}},[De]),je||Ve?l.createElement(o.Loader,null):l.createElement(l.Fragment,null,l.createElement(zl,{currentStep:4,flow:"OCBPA"===(null==fe||null===(p=fe.uiFlow)||void 0===p?void 0:p.flow)?"OCBPA":""}),l.createElement(o.Header,{styles:{marginLeft:"10px"}},Ae("BPA_STEPPER_SUMMARY_HEADER")),l.createElement(o.Card,{style:{paddingRight:"16px"}},l.createElement(o.StatusTable,null,l.createElement(o.Row,{className:"border-none",label:Ae("BPA_APPLICATION_NUMBER_LABEL"),text:Ue||""}))),l.createElement(o.Card,{style:{paddingRight:"16px"}},l.createElement(o.CardHeader,null,Ae("BPA_BASIC_DETAILS_TITLE")),l.createElement(o.StatusTable,null,l.createElement(o.Row,{className:"border-none",label:Ae("BPA_BASIC_DETAILS_APP_DATE_LABEL"),text:Ot(Number(null==Be?void 0:Be.applicationDate))}),l.createElement(o.Row,{className:"border-none",label:Ae("BPA_BASIC_DETAILS_APPLICATION_TYPE_LABEL"),text:Ae("WF_BPA_"+(null==Be?void 0:Be.applicationType))}),l.createElement(o.Row,{className:"border-none",label:Ae("BPA_BASIC_DETAILS_SERVICE_TYPE_LABEL"),text:Ae(null==Be?void 0:Be.serviceType)}),l.createElement(o.Row,{className:"border-none",label:Ae("BPA_BASIC_DETAILS_OCCUPANCY_LABEL"),text:null==Be?void 0:Be.occupancyType}),l.createElement(o.Row,{className:"border-none",label:Ae("BPA_BASIC_DETAILS_RISK_TYPE_LABEL"),text:Ae("WF_BPA_"+(null==Be?void 0:Be.riskType))}),l.createElement(o.Row,{className:"border-none",label:Ae("BPA_BASIC_DETAILS_APPLICATION_NAME_LABEL"),text:null==Be?void 0:Be.applicantName}))),l.createElement(o.Card,{style:{paddingRight:"16px"}},l.createElement(o.CardHeader,null,Ae("BPA_PLOT_DETAILS_TITLE")),l.createElement(o.StatusTable,null,l.createElement(o.Row,{className:"border-none",label:Ae("BPA_BOUNDARY_PLOT_AREA_LABEL"),text:null!=Ie&&null!==(m=Ie.planDetail)&&void 0!==m&&null!==(E=m.planInformation)&&void 0!==E&&E.plotArea?`${null==Ie||null===(_=Ie.planDetail)||void 0===_||null===(f=_.planInformation)||void 0===f?void 0:f.plotArea} ${Ae("BPA_SQ_MTRS_LABEL")}`:Ae("CS_NA")}),l.createElement(o.Row,{className:"border-none",label:Ae("BPA_PLOT_NUMBER_LABEL"),text:(null==Ie||null===(A=Ie.planDetail)||void 0===A||null===(g=A.planInformation)||void 0===g?void 0:g.plotNo)||Ae("CS_NA")}),l.createElement(o.Row,{className:"border-none",label:Ae("BPA_KHATHA_NUMBER_LABEL"),text:(null==Ie||null===(S=Ie.planDetail)||void 0===S||null===(h=S.planInformation)||void 0===h?void 0:h.khataNo)||Ae("CS_NA")}),l.createElement(o.Row,{className:"border-none",label:Ae("BPA_HOLDING_NUMBER_LABEL"),text:(null==Be?void 0:Be.holdingNumber)||Ae("CS_NA")}),l.createElement(o.Row,{className:"border-none",label:Ae("BPA_BOUNDARY_LAND_REG_DETAIL_LABEL"),text:(null==Be?void 0:Be.registrationDetails)||Ae("CS_NA")}))),l.createElement(o.Card,{style:{paddingRight:"16px"}},l.createElement(o.CardHeader,null,Ae("BPA_STEPPER_SCRUTINY_DETAILS_HEADER")),l.createElement(o.CardSubHeader,null,Ae("OCBPA"===(null==fe||null===(y=fe.uiFlow)||void 0===y?void 0:y.flow)?"BPA_OC_EDCR_NO_LABEL":"BPA_EDCR_DETAILS")),l.createElement(o.StatusTable,{style:{border:"none"}},l.createElement(o.Row,{className:"border-none",label:Ae("BPA_EDCR_NO_LABEL"),text:(null==Be||null===(D=Be.scrutinyNumber)||void 0===D?void 0:D.edcrNumber)||Ae("CS_NA")}),l.createElement(o.CardSubHeader,null,Ae("BPA_UPLOADED_PLAN_DIAGRAM")),l.createElement(o.LinkButton,{label:l.createElement(o.PDFSvg,null),onClick:()=>lt(null==Ie?void 0:Ie.updatedDxfFile)}),l.createElement("p",{style:{marginTop:"8px",marginBottom:"20px",textAlign:"Left",fontSize:"16px",lineHeight:"19px",color:"#505A5F",fontWeight:"400"}},Ae("BPA_UPLOADED_PLAN_DXF")),l.createElement(o.CardSubHeader,null,Ae("BPA_SCRUNTINY_REPORT_OUTPUT")),l.createElement(o.LinkButton,{label:l.createElement(o.PDFSvg,null),onClick:()=>lt(null==Ie?void 0:Ie.planReport)}),l.createElement("p",{style:{marginTop:"8px",marginBottom:"20px",textAlign:"Left",fontSize:"16px",lineHeight:"19px",color:"#505A5F",fontWeight:"400"}},Ae("BPA_SCRUTINY_REPORT_PDF"))),l.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",height:"2px",marginTop:"20px",marginBottom:"20px"}}),l.createElement(o.CardSubHeader,null,"OCBPA"===(null==fe||null===(T=fe.uiFlow)||void 0===T?void 0:T.flow)?Ae("BPA_ACTUAL_BUILDING_EXTRACT_HEADER"):Ae("BPA_BUILDING_EXTRACT_HEADER")),l.createElement(o.StatusTable,null,l.createElement(o.Row,{className:"border-none",label:Ae("BPA_TOTAL_BUILT_UP_AREA_HEADER"),text:null!=Ie&&null!==(b=Ie.planDetail)&&void 0!==b&&null!==(C=b.blocks)&&void 0!==C&&null!==(P=C[0])&&void 0!==P&&null!==(N=P.building)&&void 0!==N&&N.totalBuitUpArea?`${null==Ie||null===(I=Ie.planDetail)||void 0===I||null===(L=I.blocks)||void 0===L||null===(B=L[0])||void 0===B||null===(O=B.building)||void 0===O?void 0:O.totalBuitUpArea} ${Ae("BPA_SQ_MTRS_LABEL")}`:Ae("NA")}),l.createElement(o.Row,{className:"border-none",label:Ae("BPA_SCRUTINY_DETAILS_NUMBER_OF_FLOORS_LABEL"),text:null==Ie||null===(R=Ie.planDetail)||void 0===R||null===(w=R.blocks)||void 0===w||null===(x=w[0])||void 0===x||null===(M=x.building)||void 0===M?void 0:M.totalFloors}),l.createElement(o.Row,{className:"border-none",label:Ae("BPA_HEIGHT_FROM_GROUND_LEVEL_FROM_MUMTY"),text:`${null==Ie||null===(F=Ie.planDetail)||void 0===F||null===(k=F.blocks)||void 0===k||null===(U=k[0])||void 0===U||null===(H=U.building)||void 0===H?void 0:H.declaredBuildingHeight} ${Ae("BPA_MTRS_LABEL")}`})),l.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",height:"2px",marginTop:"20px",marginBottom:"20px"}}),l.createElement(o.CardSubHeader,null,Ae("BPA_OCC_SUBOCC_HEADER")),null==Ie||null===(W=Ie.planDetail)||void 0===W?void 0:W.blocks.map((e,t)=>l.createElement("div",{key:t},l.createElement(o.CardSubHeader,{style:{marginTop:"15px"}},Ae("BPA_BLOCK_SUBHEADER")," ",t+1),l.createElement(o.StatusTable,null,l.createElement(o.Row,{className:"border-none",textStyle:{wordBreak:"break-word"},label:Ae("BPA_SUB_OCCUPANCY_LABEL"),text:""===nt(t)?Ae("CS_NA"):nt(t)})),l.createElement("div",{style:{overflow:"scroll"}},l.createElement(o.Table,{className:"customTable table-fixed-first-column table-border-style",t:Ae,disableSort:!1,autoSort:!0,manualPagination:!1,isPaginationRequired:!1,initSortId:"S N ",data:tt(e),columns:et,getCellProps:e=>({style:{}})})))),l.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",height:"2px",marginTop:"20px",marginBottom:"20px"}}),l.createElement(o.CardSubHeader,null,Ae("BPA_APP_DETAILS_DEMOLITION_DETAILS_LABEL")),l.createElement(o.StatusTable,{style:{border:"none"}},l.createElement(o.Row,{className:"border-none",label:Ae("BPA_APPLICATION_DEMOLITION_AREA_LABEL"),text:null!=Ie&&null!==(G=Ie.planDetail)&&void 0!==G&&null!==(j=G.planInformation)&&void 0!==j&&j.demolitionArea?`${null==Ie||null===(K=Ie.planDetail)||void 0===K||null===(Y=K.planInformation)||void 0===Y?void 0:Y.demolitionArea} ${Ae("BPA_SQ_MTRS_LABEL")} `:Ae("CS_NA")}))),"OCBPA"!==(null==fe||null===($=fe.uiFlow)||void 0===$?void 0:$.flow)?l.createElement("div",null,l.createElement(o.Card,{style:{paddingRight:"16px"}},l.createElement(o.CardHeader,null,Ae("BPA_NEW_TRADE_DETAILS_HEADER_DETAILS")),l.createElement(o.StatusTable,null,l.createElement(o.Row,{className:"border-none",label:Ae("BPA_DETAILS_PIN_LABEL"),text:(null==Oe?void 0:Oe.pincode)||Ae("CS_NA")}),l.createElement(o.Row,{className:"border-none",label:Ae("BPA_CITY_LABEL"),text:(null==Oe||null===(z=Oe.city)||void 0===z?void 0:z.name)||Ae("CS_NA")}),l.createElement(o.Row,{className:"border-none",label:Ae("BPA_LOC_MOHALLA_LABEL"),text:(null==Oe||null===(V=Oe.locality)||void 0===V?void 0:V.name)||Ae("CS_NA")}),l.createElement(o.Row,{className:"border-none",label:Ae("BPA_DETAILS_SRT_NAME_LABEL"),text:(null==Oe?void 0:Oe.street)||Ae("CS_NA")}),l.createElement(o.Row,{className:"border-none",label:Ae("ES_NEW_APPLICATION_LOCATION_LANDMARK"),text:(null==Oe?void 0:Oe.landmark)||Ae("CS_NA")}))),l.createElement(o.Card,{style:{paddingRight:"16px"}},l.createElement(o.CardHeader,null,Ae("BPA_APPLICANT_DETAILS_HEADER")),(null==Re?void 0:Re.owners)&&(null==Re?void 0:Re.owners.map((e,t)=>{var n;return l.createElement("div",{key:t},Re.owners.length>1&&l.createElement(o.CardSubHeader,null,Ae("COMMON_OWNER")," ",t+1),l.createElement(o.StatusTable,null,l.createElement(o.Row,{className:"border-none",label:Ae("CORE_COMMON_NAME"),text:null==e?void 0:e.name}),l.createElement(o.Row,{className:"border-none",label:Ae("BPA_APPLICANT_GENDER_LABEL"),text:Ae(null==e||null===(n=e.gender)||void 0===n?void 0:n.i18nKey)}),l.createElement(o.Row,{className:"border-none",label:Ae("CORE_COMMON_MOBILE_NUMBER"),text:null==e?void 0:e.mobileNumber}),l.createElement(o.Row,{className:"border-none",label:Ae("BPA_IS_PRIMARY_OWNER_LABEL"),text:""+(null==e?void 0:e.isPrimaryOwner)})))})))):null,l.createElement(o.Card,{style:{paddingRight:"16px"}},l.createElement(o.StatusTable,null,l.createElement(o.CardHeader,null,Ae("BPA_DOCUMENT_DETAILS_LABEL")),l.createElement(o.LinkButton,{label:l.createElement(o.EditIcon,{style:{marginTop:"-10px",float:"right",position:"relative",bottom:"32px"}}),style:{width:"100px",display:"inline"},onClick:()=>lt(He+"/document-details")}),l.createElement(Vl,{documents:Wt(Ke),svgStyles:{},isSendBackFlow:!1,isHrLine:!0,titleStyles:{fontSize:"18px",lineHeight:"24px",fontWeight:700,marginBottom:"10px"}}))),l.createElement(o.Card,{style:{paddingRight:"16px"}},l.createElement(o.CardHeader,null,Ae("BPA_NOC_DETAILS_SUMMARY")),we&&(null==we?void 0:we.NocDetails.map((e,t)=>{var n;return l.createElement("div",{key:t,style:(null==we||null===(n=we.NocDetails)||void 0===n?void 0:n.length)>1?{marginTop:"19px",background:"#FAFAFA",border:"1px solid #D6D5D4",borderRadius:"4px",padding:"8px",lineHeight:"19px",maxWidth:"960px",minWidth:"280px"}:{}},l.createElement(o.CardSectionHeader,{style:{marginBottom:"24px"}},""+Ae(`BPA_${null==e?void 0:e.nocType}_HEADER`)),l.createElement(o.StatusTable,null,l.createElement(o.Row,{className:"border-none",label:Ae(`BPA_${null==e?void 0:e.nocType}_LABEL`),text:null==e?void 0:e.applicationNo}),l.createElement(o.Row,{className:"border-none",label:Ae("BPA_NOC_STATUS"),text:Ae(""+(null==e?void 0:e.applicationStatus)),textStyle:"APPROVED"==(null==e?void 0:e.applicationStatus)||"AUTO_APPROVED"==(null==e?void 0:e.applicationStatus)?{color:"#00703C"}:{color:"#D4351C"}}),l.createElement(o.Row,{className:"border-none",label:Ae("BPA_DOCUMENT_DETAILS_LABEL"),text:""}),l.createElement(Vl,{documents:Wt(null==Ye?void 0:Ye.filter(t=>{var l,n,i;return null==t||null===(l=t.documentType)||void 0===l?void 0:l.includes(null==e||null===(n=e.nocType)||void 0===n||null===(i=n.split("_"))||void 0===i?void 0:i[0])}),!0),svgStyles:{},isSendBackFlow:!1,isHrLine:!0,titleStyles:{fontSize:"18px",lineHeight:"24px",fontWeight:700,marginBottom:"10px"}})))}))),l.createElement(o.Card,{style:{paddingRight:"16px"}},l.createElement(o.CardSubHeader,null,Ae("BPA_SUMMARY_FEE_EST")),l.createElement(o.StatusTable,null,null==ze||null===(q=ze.Payments)||void 0===q||null===(X=q[0])||void 0===X||null===(J=X.paymentDetails)||void 0===J||null===(Z=J[0])||void 0===Z||null===(Q=Z.bill)||void 0===Q||null===(ee=Q.billDetails)||void 0===ee||null===(te=ee[0])||void 0===te?void 0:te.billAccountDetails.map((e,t)=>l.createElement("div",{key:t},l.createElement(o.Row,{className:"border-none",label:Ae(""+e.taxHeadCode),text:"₹ "+(null==e?void 0:e.amount)}))),l.createElement(o.Row,{className:"border-none",label:Ae("BPA_COMMON_TOTAL_AMT"),text:"₹ "+((null==ze||null===(le=ze.Payments)||void 0===le||null===(ne=le[0])||void 0===ne||null===(ie=ne.paymentDetails)||void 0===ie||null===(oe=ie[0])||void 0===oe||null===(ae=oe.bill)||void 0===ae||null===(re=ae.billDetails)||void 0===re||null===(ue=re[0])||void 0===ue?void 0:ue.amount)||"0")})),l.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",height:"2px",marginTop:"20px",marginBottom:"20px"}}),l.createElement(o.CardHeader,null,Ae("BPA_COMMON_TOTAL_AMT")),l.createElement(o.CardHeader,null,"₹ ",(null==ze||null===(de=ze.Payments)||void 0===de||null===(se=de[0])||void 0===se||null===(ce=se.paymentDetails)||void 0===ce||null===(ve=ce[0])||void 0===ve||null===(pe=ve.bill)||void 0===pe||null===(me=pe.billDetails)||void 0===me||null===(Ee=me[0])||void 0===Ee?void 0:Ee.amount)||"0"),l.createElement(o.SubmitBar,{label:Ae("BPA_COMMON_BUTTON_SUBMIT"),onSubmit:function(e){Te("FORWARD"),Ce(!0)}})),be?l.createElement(vn,{t:Ae,action:De,tenantId:ye,id:null==fe?void 0:fe.applicationNo,closeModal:()=>{Te(null),Ce(!1)},submitAction:e=>{var t;let l=ft(fe);l.assignee=[];const n="OCBPA"===(null==fe||null===(t=fe.uiFlow)||void 0===t?void 0:t.flow),i=It(l,n,!0);qe.mutate({BPA:{...null==i?void 0:i.BPA,workflow:e}},{onError:(e,t)=>{var l,n,i;Ce(!1),Ne({key:"error",action:(null==e||null===(l=e.response)||void 0===l||null===(n=l.data)||void 0===n||null===(i=n.Errors[0])||void 0===i?void 0:i.message)||e}),setTimeout(Je,5e3)},onSuccess:(e,t)=>{Ce(!1),Ne({key:"success",action:De}),setTimeout(Je,5e3),Le.invalidateQueries("BPA_DETAILS_PAGE"),Le.invalidateQueries("workFlowDetails"),ge.replace(`/digit-ui/citizen/obps/sendbacktocitizen/ocbpa/${null==fe?void 0:fe.tenantId}/${null==fe?void 0:fe.applicationNo}/acknowledgement`,{data:null==fe?void 0:fe.applicationNo})}})},actionData:null==Xe||null===(_e=Xe.data)||void 0===_e?void 0:_e.timeline}):null,Pe&&l.createElement(o.Toast,{error:"error"===Pe.key,label:Ae("success"===Pe.key?`ES_OBPS_${Pe.action}_UPDATE_SUCCESS`:Pe.action),onClose:Je}))},EDCRAcknowledgement:e=>{var a,r,u,d,s,c,v;const{t:p}=n.useTranslation(),[m,E]=(i.useHistory(),t.useState(!1));var _;if(console.log("D++++++++"),t.useEffect(()=>{var t;console.log("props.data.type =>",null==e||null===(t=e.data)||void 0===t?void 0:t.type),console.log("Before setting: isPermitApplication =",sessionStorage.getItem("isPermitApplication"))},[null==e?void 0:e.data]),t.useEffect(()=>{var t;"ERROR"!=(null==e||null===(t=e.data)||void 0===t?void 0:t.type)||m||E(!0)},[null==e||null===(a=e.data)||void 0===a?void 0:a.data]),"ERROR"==(null==e||null===(r=e.data)||void 0===r?void 0:r.type))return l.createElement(o.Card,{style:{padding:"0px"}},l.createElement(o.Banner,{message:p("CS_BPA_APPLICATION_FAILED"),applicationNumber:"",info:"",successful:!1,infoStyles:{fontSize:"18px",lineHeight:"21px",fontWeight:"bold",textAlign:"center",padding:"0px 15px"},applicationNumberStyles:{fontSize:"24px",lineHeight:"28px",fontWeight:"bold",marginTop:"10px"},style:{width:"100%",padding:"10px"}}),l.createElement("div",{style:{padding:"10px",paddingBottom:"10px"}},l.createElement(i.Link,{to:"/digit-ui/citizen"},l.createElement(o.SubmitBar,{label:p("CORE_COMMON_GO_TO_HOME")}))),m?l.createElement(o.Toast,{error:"error",label:p(null==e||null===(_=e.data)||void 0===_?void 0:_.data),onClose:()=>E(null),isDleteBtn:!0}):null);sessionStorage.setItem("isPermitApplication",!0),sessionStorage.setItem("isEDCRDisable",JSON.stringify(!0));const f=null==e||null===(u=e.data)||void 0===u?void 0:u[0],[A,g]=t.useState({}),S=Digit.ULBService.getStateId(),{data:h,isLoading:y}=(window.Digit.Utils.browser.isMobile(),Digit.Hooks.obps.useMDMS(S,"BPA",["homePageUrlLinks"]));Digit.Hooks.obps.useMDMS(S,"BPA",["RiskTypeComputation"]),t.useEffect(()=>{var e,t,l,n;!y&&(null==h||null===(e=h.BPA)||void 0===e||null===(t=e.homePageUrlLinks)||void 0===t?void 0:t.length)>0&&(null==h||null===(l=h.BPA)||void 0===l||null===(n=l.homePageUrlLinks)||void 0===n||n.map(e=>{(null==e?void 0:e.applicationType)===(null==f?void 0:f.appliactionType)&&(null==e?void 0:e.serviceType)===(null==f?void 0:f.applicationSubType)&&g({linkData:e,edcrNumber:null==f?void 0:f.edcrNumber})}))},[!y]);const D=function(){try{var e=window.open(f.planReport,"_blank");return e&&e.focus(),Promise.resolve()}catch(e){return Promise.reject(e)}};return l.createElement("div",null,"Accepted"==f.status?l.createElement(o.Card,{style:{padding:"0px"}},l.createElement(o.Banner,{message:p("EDCR_ACKNOWLEDGEMENT_SUCCESS_MESSAGE_LABEL"),applicationNumber:null==f?void 0:f.edcrNumber,info:p("EDCR_SCRUTINY_NUMBER_LABEL"),successful:!0,infoStyles:{fontSize:"18px",lineHeight:"21px",fontWeight:"bold",textAlign:"center",padding:"0px 15px"},applicationNumberStyles:{fontSize:"24px",lineHeight:"28px",fontWeight:"bold",marginTop:"10px"},style:{width:"100%",padding:"10px"}}),l.createElement(o.CardText,{style:{padding:"0px 8px",marginBottom:"10px"}},`${p("PDF_STATIC_LABEL_CONSOLIDATED_BILL_CONSUMER_ID_TL")} - ${null==f?void 0:f.applicationNumber}`),l.createElement("div",{className:"primary-label-btn d-grid",style:{marginLeft:"unset",marginBottom:"10px",padding:"0px 8px"},onClick:D},l.createElement("svg",{width:"20",height:"23",viewBox:"0 0 20 23",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l.createElement("path",{d:"M19.3334 8H14V0H6.00002V8H0.666687L10 17.3333L19.3334 8ZM0.666687 20V22.6667H19.3334V20H0.666687Z",fill:"#a82227"})),p("EDCR_DOWNLOAD_SCRUTINY_REPORT_LABEL")),l.createElement("div",{style:{padding:"0px 10px"}},l.createElement(i.Link,{to:{pathname:`/digit-ui/citizen/obps/${null==A||null===(d=A.linkData)||void 0===d||null===(s=d.flow)||void 0===s?void 0:s.toLowerCase()}/${null==f||null===(c=f.appliactionType)||void 0===c?void 0:c.toLowerCase()}/${null==f||null===(v=f.applicationSubType)||void 0===v?void 0:v.toLowerCase()}/docs-required`,state:A},replace:!0},l.createElement(o.SubmitBar,{label:p("BPA_APPLY_FOR_BPA_LABEL"),onSubmit:()=>sessionStorage.setItem("clickOnBPAApplyAfterEDCR",!0)}),l.createElement(o.CardText,{className:"button-sub-text",style:{fontSize:"14px",lineHeight:"16px",textAlign:"center",margin:"0px",marginTop:"4px",fontWeight:"400",color:"#0B0C0C"}},p("BPA_FOR_NEW_CONSTRUCTION_LABEL"))),l.createElement("div",{style:{marginTop:"12px",paddingBottom:"10px"}},l.createElement(i.Link,{to:"/digit-ui/citizen"},l.createElement(o.LinkButton,{label:p("CORE_COMMON_GO_TO_HOME")}))))):l.createElement(o.Card,{style:{padding:"0px"}},l.createElement(o.Banner,{message:p("EDCR_ACKNOWLEDGEMENT_REJECTED_MESSAGE_LABEL"),applicationNumber:"",info:"",successful:!1,infoStyles:{fontSize:"18px",lineHeight:"21px",fontWeight:"bold",textAlign:"center",padding:"0px 15px"},applicationNumberStyles:{fontSize:"24px",lineHeight:"28px",fontWeight:"bold",marginTop:"10px"},style:{width:"100%",padding:"10px"}}),l.createElement(o.CardText,{style:{padding:"0px 8px",marginBottom:"10px"}},p("EDCR_ACKNOWLEDGEMENT_REJECTED_MESSAGE_TEXT_LABEL")),l.createElement(o.CardText,{style:{padding:"0px 8px",marginBottom:"10px"}},`${p("PDF_STATIC_LABEL_CONSOLIDATED_BILL_CONSUMER_ID_TL")} - ${null==f?void 0:f.applicationNumber}`),l.createElement("div",{className:"primary-label-btn d-grid",style:{marginLeft:"unset",marginBottom:"10px",padding:"0px 8px"},onClick:D},l.createElement("svg",{width:"20",height:"23",viewBox:"0 0 20 23",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l.createElement("path",{d:"M19.3334 8H14V0H6.00002V8H0.666687L10 17.3333L19.3334 8ZM0.666687 20V22.6667H19.3334V20H0.666687Z",fill:"#a82227"})),p("EDCR_DOWNLOAD_SCRUTINY_REPORT_LABEL")),l.createElement("div",{style:{padding:"10px",paddingBottom:"10px"}},l.createElement(i.Link,{to:"/digit-ui/citizen"},l.createElement(o.SubmitBar,{label:p("CORE_COMMON_GO_TO_HOME")})))))},OCEDCRAcknowledgement:e=>{var a,r,u,d,s,c,v;const{t:p}=n.useTranslation(),[m,E]=(i.useHistory(),t.useState(!1));var _;if(t.useEffect(()=>{var t;"ERROR"!=(null==e||null===(t=e.data)||void 0===t?void 0:t.type)||m||E(!0)},[null==e||null===(a=e.data)||void 0===a?void 0:a.data]),"ERROR"==(null==e||null===(r=e.data)||void 0===r?void 0:r.type))return l.createElement(o.Card,{style:{padding:"0px"}},l.createElement(o.Banner,{message:p("CS_BPA_APPLICATION_FAILED"),applicationNumber:"",info:"",successful:!1,infoStyles:{fontSize:"18px",lineHeight:"21px",fontWeight:"bold",textAlign:"center",padding:"0px 15px"},applicationNumberStyles:{fontSize:"24px",lineHeight:"28px",fontWeight:"bold",marginTop:"10px"},style:{width:"100%",padding:"10px"}}),l.createElement("div",{style:{padding:"10px",paddingBottom:"10px"}},l.createElement(i.Link,{to:"/digit-ui/citizen"},l.createElement(o.SubmitBar,{label:p("CORE_COMMON_GO_TO_HOME")}))),m?l.createElement(o.Toast,{error:"error",label:p(null==e||null===(_=e.data)||void 0===_?void 0:_.data),onClose:()=>E(null),isDleteBtn:!0}):null);sessionStorage.setItem("isEDCRDisable",JSON.stringify(!0)),sessionStorage.setItem("isPermitApplication",!0);const f=null==e||null===(u=e.data)||void 0===u?void 0:u[0],[A,g]=t.useState({}),S=Digit.ULBService.getStateId(),{data:h,isLoading:y}=Digit.Hooks.obps.useMDMS(S,"BPA",["homePageUrlLinks"]);Digit.Hooks.obps.useMDMS(S,"BPA",["RiskTypeComputation"]),t.useEffect(()=>{var e,t,l,n;!y&&(null==h||null===(e=h.BPA)||void 0===e||null===(t=e.homePageUrlLinks)||void 0===t?void 0:t.length)>0&&(null==h||null===(l=h.BPA)||void 0===l||null===(n=l.homePageUrlLinks)||void 0===n||n.map(e=>{(null==e?void 0:e.applicationType)===(null==f?void 0:f.appliactionType)&&(null==e?void 0:e.serviceType)===(null==f?void 0:f.applicationSubType)&&g({linkData:e,edcrNumber:null==f?void 0:f.edcrNumber})}))},[!y]);const D=function(){try{var e=window.open(f.planReport,"_blank");return e&&e.focus(),Promise.resolve()}catch(e){return Promise.reject(e)}};return l.createElement("div",null,"Accepted"==(null==f?void 0:f.status)?l.createElement(o.Card,{style:{padding:"0px"}},l.createElement(o.Banner,{message:p("BPA_OC_EDCR_ACKNOWLEDGEMENT_SUCCESS_MESSAGE_LABEL"),applicationNumber:null==f?void 0:f.edcrNumber,info:p("EDCR_SCRUTINY_NUMBER_LABEL"),successful:!0,infoStyles:{fontSize:"18px",lineHeight:"21px",fontWeight:"bold",textAlign:"center",padding:"0px 15px"},applicationNumberStyles:{fontSize:"24px",lineHeight:"28px",fontWeight:"bold",marginTop:"10px"},style:{width:"100%",padding:"10px"}}),l.createElement(o.CardText,{style:{padding:"0px 8px",marginBottom:"10px"}},`${p("PDF_STATIC_LABEL_CONSOLIDATED_BILL_CONSUMER_ID_TL")} - ${null==f?void 0:f.applicationNumber}`),l.createElement("div",{className:"primary-label-btn d-grid",style:{marginLeft:"unset",marginBottom:"10px",padding:"0px 8px"},onClick:D},l.createElement("svg",{width:"20",height:"23",viewBox:"0 0 20 23",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l.createElement("path",{d:"M19.3334 8H14V0H6.00002V8H0.666687L10 17.3333L19.3334 8ZM0.666687 20V22.6667H19.3334V20H0.666687Z",fill:"#a82227"})),p("EDCR_DOWNLOAD_SCRUTINY_REPORT_LABEL")),l.createElement("div",{style:{padding:"0px 10px"}},l.createElement(i.Link,{to:{pathname:`/digit-ui/citizen/obps/${null==A||null===(d=A.linkData)||void 0===d||null===(s=d.flow)||void 0===s?void 0:s.toLowerCase()}/${null==f||null===(c=f.appliactionType)||void 0===c?void 0:c.toLowerCase()}/${null==f||null===(v=f.applicationSubType)||void 0===v?void 0:v.toLowerCase()}/docs-required`,state:A},replace:!0},l.createElement(o.SubmitBar,{label:p("BPA_APPLY_OC_FOR_BPA_LABEL"),className:"oc-aknowledgement-screen",onSubmit:()=>sessionStorage.setItem("clickOnBPAApplyAfterEDCR",!0)}))),l.createElement("div",{style:{marginTop:"12px",paddingBottom:"10px",paddingLeft:"10px"}},l.createElement(i.Link,{to:"/digit-ui/citizen"},l.createElement(o.LinkButton,{label:p("CORE_COMMON_GO_TO_HOME")})))):l.createElement(o.Card,{style:{padding:"0px"}},l.createElement(o.Banner,{message:p("BPA_OC_EDCR_ACKNOWLEDGEMENT_REJECTED_MESSAGE_LABEL"),applicationNumber:"",info:"",successful:!1,infoStyles:{fontSize:"18px",lineHeight:"21px",fontWeight:"bold",textAlign:"center",padding:"0px 15px"},applicationNumberStyles:{fontSize:"24px",lineHeight:"28px",fontWeight:"bold",marginTop:"10px"},style:{width:"100%",padding:"10px"}}),l.createElement(o.CardText,{style:{padding:"0px 8px",marginBottom:"10px"}},p("EDCR_ACKNOWLEDGEMENT_REJECTED_MESSAGE_TEXT_LABEL")),l.createElement(o.CardText,{style:{padding:"0px 8px",marginBottom:"10px"}},`${p("PDF_STATIC_LABEL_CONSOLIDATED_BILL_CONSUMER_ID_TL")} - ${null==f?void 0:f.applicationNumber}`),l.createElement("div",{className:"primary-label-btn d-grid",style:{marginLeft:"unset",marginBottom:"10px",padding:"0px 8px"},onClick:D},l.createElement("svg",{width:"20",height:"23",viewBox:"0 0 20 23",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l.createElement("path",{d:"M19.3334 8H14V0H6.00002V8H0.666687L10 17.3333L19.3334 8ZM0.666687 20V22.6667H19.3334V20H0.666687Z",fill:"#a82227"})),p("EDCR_DOWNLOAD_SCRUTINY_REPORT_LABEL")),l.createElement("div",{style:{padding:"10px",paddingBottom:"10px",paddingLeft:"10px"}},l.createElement(i.Link,{to:"/digit-ui/citizen"},l.createElement(o.SubmitBar,{label:p("CORE_COMMON_GO_TO_HOME")})))))},BPAAcknowledgement:e=>{var a,r,u,d,s,c,v,p,m,E,_,f,A,g,S,h;let{data:y,onSuccess:D}=e;const{t:T}=n.useTranslation(),b="undefined"!=typeof window&&null!==(a=window.Digit)&&void 0!==a&&null!==(r=a.UserService)&&void 0!==r&&r.getUser?window.Digit.UserService.getUser():null,C="undefined"!=typeof window&&null!==(u=window.Digit)&&void 0!==u&&null!==(d=u.ULBService)&&void 0!==d&&d.getCurrentTenantId?window.Digit.ULBService.getCurrentTenantId():null,{data:P}="undefined"!=typeof window&&null!==(s=window.Digit)&&void 0!==s&&null!==(c=s.Hooks)&&void 0!==c&&null!==(v=c.useStore)&&void 0!==v&&v.getInitData?window.Digit.Hooks.useStore.getInitData():{data:null},{tenants:N}=P||{},I=(null==y?void 0:y.tenantId)||C,L=(t.useMemo(()=>{var e,t,l,n,i;return(null==y||null===(e=y.address)||void 0===e||null===(t=e.city)||void 0===t?void 0:t.code)||(null==y?void 0:y.tenantId)||(null==b||null===(l=b.info)||void 0===l?void 0:l.permanentCity)||("undefined"!=typeof window&&null!==(n=window.Digit)&&void 0!==n&&null!==(i=n.ULBService)&&void 0!==i&&i.getCurrentTenantId?window.Digit.ULBService.getCurrentTenantId():null)},[null==y||null===(p=y.address)||void 0===p||null===(m=p.city)||void 0===m?void 0:m.code,null==y?void 0:y.tenantId,null==b||null===(E=b.info)||void 0===E?void 0:E.permanentCity]),null===(_=window.Digit)||void 0===_||null===(f=_.Hooks)||void 0===f||null===(A=f.obps)||void 0===A?void 0:A.useObpsAPI(y.tenantId||C,!0)),B=null===(g=window.Digit)||void 0===g||null===(S=g.Hooks)||void 0===S||null===(h=S.obps)||void 0===h?void 0:h.useObpsAPI(I,!1);return console.log("MUTATION"),t.useRef(!1),t.useEffect(()=>{try{var e,t,l,n;let i=null!=y&&null!==(e=y.address)&&void 0!==e&&e.city?null===(t=y.address)||void 0===t||null===(l=t.city)||void 0===l?void 0:l.code:C;y.tenantId=i;let o={};null==y||null===(n=y.nocDocuments)||void 0===n||n.NocDetails.map(e=>{o=yt(e,y),L.mutate(o,{onSuccess:D})}),o=It(y),B.mutate(o,{onSuccess:D}),sessionStorage.removeItem("Malbafees"),sessionStorage.removeItem("WaterCharges"),sessionStorage.removeItem("GaushalaFees"),sessionStorage.removeItem("LabourCess"),sessionStorage.removeItem("otherCharges"),sessionStorage.removeItem("lessAdjusment"),sessionStorage.removeItem("development")}catch(e){}},[]),t.useEffect(()=>{try{console.log("Input data:",y),console.log("Using tenantId:",y.tenantId||C);const e={...y,landInfo:{owners:Array.isArray(y.owners)?y.owners:[y.owners],address:y.address||{}}};let t=It(e);console.log("convertToBPAObject result:",t),t&&B.mutate(t,{onSuccess:e=>{console.log("Mutation success:",e),D(e)},onError:e=>{console.error("Mutation error:",e)}})}catch(e){console.error("Error in useEffect:",e)}},[y]),console.log(N,"CD"),B?B.isLoading||B.isIdle?l.createElement(o.Loader,null):l.createElement(o.Card,null,l.createElement(nr,{t:T,data:B.data,isSuccess:B.isSuccess,isLoading:B.isIdle||B.isLoading}),B.isSuccess&&l.createElement(o.CardText,null,((e,t)=>{var l,n,i,o,a,r,u,d,s,c,v;const p=null==t||null===(l=t.BPA)||void 0===l?void 0:l[0];console.log(t,"PROPS 2"),console.log(p,"BPA DATA 2");let m=null!=t&&null!==(n=t.BPA)&&void 0!==n&&null!==(i=n[0])&&void 0!==i&&i.businessService?null==t||null===(o=t.BPA)||void 0===o||null===(a=o[0])||void 0===a?void 0:a.businessService:"BPA";const E=null==p?void 0:p.status;return"BPA_LOW"==m&&(m="BPA"),e("BPA_SUBMIT_APP"==(sessionStorage.getItem("BPA_SUBMIT_APP")?JSON.parse(sessionStorage.getItem("BPA_SUBMIT_APP")):null)?`BPA_SUBMIT_SUB_HEADER_${m}_${null==p||null===(r=p.workflow)||void 0===r?void 0:r.action}_${null!=p&&null!==(u=p.additionalDetails)&&void 0!==u&&u.typeOfArchitect?null==p||null===(d=p.additionalDetails)||void 0===d?void 0:d.typeOfArchitect:"ARCHITECT"}_${gt(E," ","_").toUpperCase()}`:`BPA_SUB_HEADER_${m}_${null==p||null===(s=p.workflow)||void 0===s?void 0:s.action}_${null!=p&&null!==(c=p.additionalDetails)&&void 0!==c&&c.typeOfArchitect?null==p||null===(v=p.additionalDetails)||void 0===v?void 0:v.typeOfArchitect:"ARCHITECT"}_${gt(E," ","_").toUpperCase()}`)})(T,B.data)),!B.isSuccess&&l.createElement(o.CardText,null,T("CS_FILE_PROPERTY_FAILED_RESPONSE")),l.createElement(i.Link,{to:{pathname:"/digit-ui/citizen"}},l.createElement(o.SubmitBar,{label:T("CORE_COMMON_GO_TO_HOME")})),B.isSuccess&&l.createElement("div",{style:{marginTop:"10px"}},l.createElement(o.SubmitBar,{label:T("CS_COMMON_DOWNLOAD"),onSubmit:function(){try{const e=y,t=N.find(t=>t.code===e.tenantId);return Promise.resolve(function(e,t,l){try{var n,i,o,a,r,u,d,s,c,v,p,m,E,_,f,A,g,S,h,y,D,T,b,C,P,N,I,L,B,O,R,w,x,M,F,k,U,H,W,G,j,K,Y,$,z,V,q,X,J,Z,Q,ee,te,le,ne,ie,oe,ae,re,ue,de,se,ce,ve,pe,me,Ee,_e,fe;const ge=Digit.UserService.getUser();return console.log("application",e),Promise.resolve({t:l,tenantId:null==t?void 0:t.code,name:`${l(null==t?void 0:t.i18nKey)} ${Ae=l("ULBGRADE_"+(null==t||null===(n=t.city)||void 0===n?void 0:n.ulbGrade.toUpperCase().replace(" ","_").replace(".","_"))),Ae.toLowerCase().split(" ").map(er).join(" ")}`,email:null==t?void 0:t.emailId,phoneNumber:null==t?void 0:t.contactNumber,heading:l("NEW_BUILD_PERMIT_APPLICATION"),applicationNumber:(null==e?void 0:e.applicationNo)||"NA",details:[{title:l("BPA_BASIC_DETAILS_TITLE"),values:[{title:(null==e?void 0:e.businessService)!==l("BPA_OC")?l("BPA_EDCR_NO_LABEL"):l("BPA_OC_EDCR_NO_LABEL"),value:(null==e?void 0:e.edcrNumber)||"NA"},{title:l("BPA_BASIC_DETAILS_APP_DATE_LABEL"),value:Digit.DateUtils.ConvertTimestampToDate(null==e||null===(i=e.auditDetails)||void 0===i?void 0:i.createdTime,"dd/MM/yyyy")||"NA"},{title:l("BPA_BASIC_DETAILS_APPLICATION_TYPE_LABEL"),value:l("WF_BPA_"+(null==e||null===(o=e.data)||void 0===o||null===(a=o.edcrDetails)||void 0===a?void 0:a.appliactionType))||"NA"},{title:l("BPA_BASIC_DETAILS_SERVICE_TYPE_LABEL"),value:l(""+(null==e||null===(r=e.data)||void 0===r||null===(u=r.edcrDetails)||void 0===u?void 0:u.applicationSubType))||"NA"},{title:l("BPA_BASIC_DETAILS_OCCUPANCY_LABEL"),value:null==e||null===(d=e.data)||void 0===d||null===(s=d.edcrDetails)||void 0===s||null===(c=s.planDetail)||void 0===c||null===(v=c.planInformation)||void 0===v?void 0:v.occupancy},{title:l("BPA_BASIC_DETAILS_RISK_TYPE_LABEL"),value:l("WF_BPA_"+(null==e?void 0:e.riskType))||"NA"}]},{title:l("BPA_PLOT_DETAILS_TITLE"),values:[{title:l("BPA_BOUNDARY_PLOT_AREA_LABEL"),value:(null==e||null===(p=e.data)||void 0===p||null===(m=p.edcrDetails)||void 0===m||null===(E=m.planDetail)||void 0===E||null===(_=E.planInformation)||void 0===_?void 0:_.plotArea)+" sq mtrs"||"NA"},{title:l("BPA_PLOT_NUMBER_LABEL"),value:(null==e||null===(f=e.data)||void 0===f||null===(A=f.edcrDetails)||void 0===A||null===(g=A.planDetail)||void 0===g||null===(S=g.planInformation)||void 0===S?void 0:S.plotNo)||"NA"},{title:l("BPA_KHATHA_NUMBER_LABEL"),value:(null==e||null===(h=e.data)||void 0===h||null===(y=h.edcrDetails)||void 0===y||null===(D=y.planDetail)||void 0===D||null===(T=D.planInformation)||void 0===T?void 0:T.khataNo)||"NA"},{title:l("BPA_HOLDING_NUMBER_LABEL"),value:(null==e||null===(b=e.additionalDetails)||void 0===b?void 0:b.holdingNo)||"NA"},{title:l("BPA_BOUNDARY_LAND_REG_DETAIL_LABEL"),value:(null==e||null===(C=e.additionalDetails)||void 0===C?void 0:C.registrationDetails)||"NA"},{title:l("BPA_APPLICATION_DEMOLITION_AREA_LABEL"),value:l((null==e||null===(P=e.data)||void 0===P||null===(N=P.edcrDetails)||void 0===N||null===(I=N.planDetail)||void 0===I||null===(L=I.planInformation)||void 0===L?void 0:L.demolitionArea)+" sq mtrs")||"NA"},{title:l("BPA_WARD_NUMBER_LABEL"),value:(null==e||null===(B=e.additionalDetails)||void 0===B?void 0:B.wardnumber)||"NA"},{title:l("BPA_KHASRA_NUMBER_LABEL"),value:(null==e||null===(O=e.additionalDetails)||void 0===O?void 0:O.khasraNumber)||"NA"}]},{title:l("BPA_APPLICANT_DETAILS_HEADER"),values:[{title:l("CORE_COMMON_NAME"),value:(null==e||null===(R=e.landInfo)||void 0===R||null===(w=R.owners[0])||void 0===w?void 0:w.name)||"NA"},{title:l("BPA_APPLICANT_GENDER_LABEL"),value:(null==e||null===(x=e.landInfo)||void 0===x||null===(M=x.owners[0])||void 0===M?void 0:M.gender)||"NA"},{title:l("CORE_COMMON_MOBILE_NUMBER"),value:(null==e||null===(F=e.landInfo)||void 0===F||null===(k=F.owners[0])||void 0===k?void 0:k.mobileNumber)||"NA"},{title:l("CORE_COMMON_EMAIL_ID"),value:(null==e||null===(U=e.landInfo)||void 0===U||null===(H=U.owners[0])||void 0===H?void 0:H.emailId)||"NA"},{title:l("BPA_IS_PRIMARY_OWNER_LABEL"),value:(null==e||null===(W=e.landInfo)||void 0===W||null===(G=W.owners[0])||void 0===G?void 0:G.isPrimaryOwner)||"NA"}]},{title:l("BPA_ARCHITECT_DETAILS"),values:[{title:l("BPA_ARCHITECT_NAME"),value:(null==ge||null===(j=ge.info)||void 0===j?void 0:j.name)||"NA"},{title:l("BPA_ARCHITECT_MOBILE_NUMBER"),value:(null==ge||null===(K=ge.info)||void 0===K?void 0:K.mobileNumber)||"NA"},{title:l("BPA_ARCHITECT_ID"),value:(null==e||null===(Y=e.additionalDetails)||void 0===Y?void 0:Y.architectid)||"NA"},{title:l("BPA_ARCHITECT_EMAIL"),value:(null==ge||null===($=ge.info)||void 0===$?void 0:$.emailId)||"NA"}]},{title:l("BPA_NEW_TRADE_DETAILS_HEADER_DETAILS"),values:[{title:l("BPA_DETAILS_PIN_LABEL"),value:(null==e||null===(z=e.landInfo)||void 0===z||null===(V=z.address)||void 0===V?void 0:V.pincode)||"NA"},{title:l("BPA_CITY_LABEL"),value:(null==e||null===(q=e.landInfo)||void 0===q||null===(X=q.address)||void 0===X?void 0:X.city)||"NA"},{title:l("BPA_LOC_MOHALLA_LABEL"),value:(null==e||null===(J=e.landInfo)||void 0===J||null===(Z=J.address)||void 0===Z||null===(Q=Z.locality)||void 0===Q?void 0:Q.name)||"NA"},{title:l("BPA_DETAILS_SRT_NAME_LABEL"),value:(null==e||null===(ee=e.landInfo)||void 0===ee||null===(te=ee.address)||void 0===te?void 0:te.street)||"NA"},{title:l("ES_NEW_APPLICATION_LOCATION_LANDMARK"),value:(null==e||null===(le=e.landInfo)||void 0===le||null===(ne=le.address)||void 0===ne?void 0:ne.landmark)||"NA"}]},{title:l("BPA_COLONY_DETAILS"),values:[{title:l("BPA_APPROVED_COLONY"),value:(null==e||null===(ie=e.additionalDetails)||void 0===ie?void 0:ie.approvedColony)||"NA"},{title:l("BPA_MASTER_PLAN"),value:(null==e||null===(oe=e.additionalDetails)||void 0===oe?void 0:oe.masterPlan)||"NA"},{title:l("BPA_DISTRICT"),value:(null==e||null===(ae=e.additionalDetails)||void 0===ae?void 0:ae.District)||"NA"},{title:l("BPA_ULB_NAME"),value:(null==e||null===(re=e.additionalDetails)||void 0===re?void 0:re.UlbName)||"NA"},{title:l("BPA_BUILDING_STATUS"),value:(null==e||null===(ue=e.additionalDetails)||void 0===ue?void 0:ue.buildingStatus)||"NA"},{title:l("BPA_SCHEMES"),value:(null==e||null===(de=e.additionalDetails)||void 0===de?void 0:de.schemes)||"NA"},{title:l("BPA_SCHEMES_TYPE"),value:(null==e||null===(se=e.additionalDetails)||void 0===se?void 0:se.schemesselection)||"NA"},{title:l("BPA_PURCHASED_FAR"),value:(null==e||null===(ce=e.additionalDetails)||void 0===ce?void 0:ce.purchasedFAR)||"NA"},{title:l("BPA_GREEN_BUIDINGS"),value:(null==e||null===(ve=e.additionalDetails)||void 0===ve?void 0:ve.greenbuilding)||"NA"},{title:l("BPA_RESTRICTED_AREA"),value:(null==e||null===(pe=e.additionalDetails)||void 0===pe?void 0:pe.restrictedArea)||"NA"},{title:l("BPA_PROPOSED_SITE_TYPE"),value:(null==e||null===(me=e.additionalDetails)||void 0===me?void 0:me.proposedSite)||"NA"},{title:l("BPA_CORE_AREA"),value:(null==e||null===(Ee=e.data)||void 0===Ee||null===(_e=Ee.edcrDetails)||void 0===_e||null===(fe=_e.planDetail)||void 0===fe?void 0:fe.coreArea)||"NA"}]}]})}catch(e){return Promise.reject(e)}var Ae}(e,t,T)).then(function(e){Digit.Utils.pdf.generate(e)})}catch(e){return Promise.reject(e)}}}))):l.createElement(o.Loader,null)},OCBPAAcknowledgement:e=>{let{data:a,onSuccess:r}=e;const{t:u}=n.useTranslation(),d=Digit.ULBService.getCurrentTenantId(),s=Digit.Hooks.obps.useObpsAPI(null!=a&&a.tenantId?null==a?void 0:a.tenantId:d,!0),c=Digit.Hooks.obps.useObpsAPI(null!=a&&a.tenantId?null==a?void 0:a.tenantId:d,!1);return Digit.Hooks.useStore.getInitData(),t.useEffect(()=>{try{var e;a.tenantId=null==a?void 0:a.tenantId;let t={};null==a||null===(e=a.nocDocuments)||void 0===e||e.NocDetails.map(e=>{t=yt(e,a),s.mutate(t,{onSuccess:r})}),t=It(a,!0),c.mutate(t,{onSuccess:r})}catch(e){}},[]),c.isLoading||c.isIdle?l.createElement(o.Loader,null):l.createElement(o.Card,null,l.createElement(ar,{t:u,data:c.data,isSuccess:c.isSuccess,isLoading:c.isIdle||c.isLoading}),c.isSuccess&&l.createElement(o.CardText,null,((e,t)=>{var l,n,i,o,a,r,u,d,s,c,v;const p=null==t||null===(l=t.BPA)||void 0===l?void 0:l[0];let m=null!=t&&null!==(n=t.BPA)&&void 0!==n&&null!==(i=n[0])&&void 0!==i&&i.businessService?null==t||null===(o=t.BPA)||void 0===o||null===(a=o[0])||void 0===a?void 0:a.businessService:"BPA",E=null==p?void 0:p.status;return"BPA_LOW"==m&&(m="BPA"),"BPA_SUBMIT_APP"==(sessionStorage.getItem("BPA_SUBMIT_APP")?JSON.parse(sessionStorage.getItem("BPA_SUBMIT_APP")):null)&&e(`BPA_SUBMIT_SUB_HEADER_${m}_${null==p||null===(r=p.workflow)||void 0===r?void 0:r.action}_${null!=p&&null!==(u=p.additionalDetails)&&void 0!==u&&u.typeOfArchitect?null==p||null===(d=p.additionalDetails)||void 0===d?void 0:d.typeOfArchitect:"ARCHITECT"}_${gt(E," ","_").toUpperCase()}`),e(`BPA_SUB_HEADER_${m}_${null==p||null===(s=p.workflow)||void 0===s?void 0:s.action}_${null!=p&&null!==(c=p.additionalDetails)&&void 0!==c&&c.typeOfArchitect?null==p||null===(v=p.additionalDetails)||void 0===v?void 0:v.typeOfArchitect:"ARCHITECT"}_${gt(E," ","_").toUpperCase()}`)})(u,c.data)),!c.isSuccess&&l.createElement(o.CardText,null,u(Digit.Utils.locale.getTransformedLocale(c.error.message))),l.createElement(i.Link,{to:{pathname:"/digit-ui/citizen"}},l.createElement(o.SubmitBar,{label:u("CORE_COMMON_GO_TO_HOME")})))},OCSendBackAcknowledgement:e=>{var t,a,r;const u=null==e?void 0:e.data,{t:d}=n.useTranslation();let s=sessionStorage.getItem("BPA_SUBMIT_APP")?JSON.parse(sessionStorage.getItem("BPA_SUBMIT_APP")):null,c=null!=u&&u.businessService?null==u?void 0:u.businessService:"BPA",v=null==u?void 0:u.status,p=null!=u&&null!==(t=u.workflow)&&void 0!==t&&t.action?null==u||null===(a=u.workflow)||void 0===a?void 0:a.action:"VERIFY_FORWARD",m=null==u||null===(r=u.additionalDetails)||void 0===r?void 0:r.typeOfArchitect;return"BPA_LOW"==c&&(c="BPA"),console.log("HELLO",u),l.createElement("div",null,l.createElement(o.Card,null,l.createElement(o.Banner,{message:d("BPA_SUBMIT_APP"==s?`BPA_SUBMIT_HEADER_${c}_${p}_${gt(v," ","_").toUpperCase()}`:`BPA_HEADER_${c}_${p}_${gt(v," ","_").toUpperCase()}`),applicationNumber:null==u?void 0:u.applicationNo,info:d("BPA"==c?"BPA_PERMIT_APPLICATION_NUMBER_LABEL":"BPA_OCCUPANCY_CERTIFICATE_APPLICATION_NUMBER_LABEL"),successful:!0,style:{padding:"10px"},headerStyles:{fontSize:"32px"}}),l.createElement(o.CardText,null,d("BPA_SUBMIT_APP"==s?`BPA_SUBMIT_SUB_HEADER_${c}_${p}_${m||"ARCHITECT"}_${gt(v," ","_").toUpperCase()}`:`BPA_SUB_HEADER_${c}_${p}_${m||"ARCHITECT"}_${gt(v," ","_").toUpperCase()}`)),l.createElement("div",{style:{marginTop:"12px",padding:"10px"}},l.createElement(i.Link,{to:"/digit-ui/citizen"},l.createElement(o.SubmitBar,{label:d("CORE_COMMON_GO_TO_HOME")})))))},StakeholderAcknowledgement:e=>{var a,r,u,d,s,c,v,p,m,E;let{data:_,onSuccess:f}=e;const{t:A}=n.useTranslation(),{id:g}=i.useParams(),S=Digit.ULBService.getCurrentTenantId(),h=Digit.Hooks.obps.useStakeholderAPI(null!=_&&null!==(a=_.address)&&void 0!==a&&a.city?null===(r=_.address)||void 0===r||null===(u=r.city)||void 0===u?void 0:u.code:S,!0),{data:y}=Digit.Hooks.useStore.getInitData(),{tenants:D}=y||{};let T=window.location.href.includes("openlink");Digit.Utils.browser.isMobile();const b=(null==h||null===(d=h.data)||void 0===d||null===(s=d.Licenses)||void 0===s||null===(c=s[0])||void 0===c||null===(v=c.tradeLicenseDetail)||void 0===v||null===(p=v.tradeUnits)||void 0===p||null===(m=p[0])||void 0===m||null===(E=m.tradeType)||void 0===E?void 0:E.split(".")[0])||"ARCHITECT";t.useEffect(()=>{try{var e,t,l,n;let i=null!=_&&null!==(e=_.result)&&void 0!==e&&null!==(t=e.Licenses[0])&&void 0!==t&&t.tenantId?null==_||null===(l=_.result)||void 0===l||null===(n=l.Licenses[0])||void 0===n?void 0:n.tenantId:i;_.tenantId=i;let o={};o=(e=>{var t,l,n,i,o,a,r,u,d,s,c,v,p,m,E,_,f,A,g,S,h,y,D,T,b,C,P,N,I,L,B,O,R,w,x,M,F,k,U,H,W;return{Licenses:[{...null==e||null===(t=e.result)||void 0===t?void 0:t.Licenses[0],action:"APPLY",tradeLicenseDetail:{...null==e||null===(l=e.result)||void 0===l||null===(n=l.Licenses[0])||void 0===n?void 0:n.tradeLicenseDetail,additionalDetail:{counsilForArchNo:null==e||null===(i=e.formData)||void 0===i||null===(o=i.LicneseType)||void 0===o?void 0:o.ArchitectNo,isSelfCertificationRequired:null==e||null===(a=e.formData)||void 0===a||null===(r=a.LicneseType)||void 0===r?void 0:r.selfCertification},tradeUnits:[{...null==e||null===(u=e.result)||void 0===u||null===(d=u.Licenses[0])||void 0===d||null===(s=d.tradeLicenseDetail)||void 0===s||null===(c=s.tradeUnits)||void 0===c?void 0:c[0],tradeType:null==e||null===(v=e.formData)||void 0===v||null===(p=v.LicneseType)||void 0===p||null===(m=p.LicenseType)||void 0===m?void 0:m.tradeType,id:null==e||null===(E=e.result)||void 0===E||null===(_=E.Licenses[0])||void 0===_||null===(f=_.tradeLicenseDetail)||void 0===f||null===(A=f.tradeUnits)||void 0===A||null===(g=A[0])||void 0===g?void 0:g.id}],owners:[{...null==e||null===(S=e.result)||void 0===S||null===(h=S.Licenses[0])||void 0===h||null===(y=h.tradeLicenseDetail)||void 0===y||null===(D=y.owners)||void 0===D?void 0:D[0],gender:null==e||null===(T=e.formData)||void 0===T||null===(b=T.LicneseDetails)||void 0===b||null===(C=b.gender)||void 0===C?void 0:C.code,mobileNumber:null==e||null===(P=e.formData)||void 0===P||null===(N=P.LicneseDetails)||void 0===N?void 0:N.mobileNumber,name:null==e||null===(I=e.formData)||void 0===I||null===(L=I.LicneseDetails)||void 0===L?void 0:L.name,dob:null,emailId:null==e||null===(B=e.formData)||void 0===B||null===(O=B.LicneseDetails)||void 0===O?void 0:O.email,permanentAddress:null==e||null===(R=e.formData)||void 0===R||null===(w=R.LicneseDetails)||void 0===w?void 0:w.PermanentAddress,correspondenceAddress:null==e?void 0:e.Correspondenceaddress,pan:null==e||null===(x=e.formData)||void 0===x||null===(M=x.LicneseDetails)||void 0===M?void 0:M.PanNumber,uuid:null==e||null===(F=e.result)||void 0===F||null===(k=F.Licenses[0])||void 0===k||null===(U=k.tradeLicenseDetail)||void 0===U||null===(H=U.owners)||void 0===H||null===(W=H[0])||void 0===W?void 0:W.uuid}],applicationDocuments:Lt(e)}}]}})(_),h.mutate(o,{onSuccess:f})}catch(e){}},[]);const C=null==S?void 0:S.split(".")[0],{data:P}=(Digit.Hooks.useWorkflowDetails({tenantId:null==S?void 0:S.split(".")[0],id:g,moduleCode:"BPAREG"}),Digit.Hooks.obps.useLicenseDetails(C,{applicationNumber:g,tenantId:C},{}));return h.isLoading||h.isIdle?l.createElement(o.Loader,null):l.createElement("div",null,l.createElement("div",{className:T?"OpenlinkContainer":""},T&&l.createElement(o.BackButton,{style:{border:"none"}},A("CS_COMMON_BACK")),l.createElement(o.Card,null,l.createElement(dr,{t:A,data:h.data,isSuccess:h.isSuccess,isLoading:h.isIdle||h.isLoading}),h.isSuccess&&l.createElement(o.CardText,null,`${A("TRADELICENSE_TRADETYPE_"+b)}${A("CS_FILE_STAKEHOLDER_RESPONSE")}`),!h.isSuccess&&l.createElement(o.CardText,null,A("CS_FILE_PROPERTY_FAILED_RESPONSE")),h.isSuccess&&!T&&l.createElement(i.Link,{to:{pathname:`/digit-ui/citizen/payment/collect/${h.data.Licenses[0].businessService}/${h.data.Licenses[0].applicationNumber}/${h.data.Licenses[0].tenantId}?tenantId=${h.data.Licenses[0].tenantId}`,state:{tenantId:h.data.Licenses[0].tenantId}}},l.createElement(o.SubmitBar,{label:A("COMMON_MAKE_PAYMENT")})),h.isSuccess&&l.createElement("div",{style:{marginTop:"10px"}},l.createElement(o.SubmitBar,{label:A("CS_COMMON_DOWNLOAD"),onSubmit:function(){try{const e=P;console.log("applicationDetails in StakeholderAck",P),console.log("tenants",D);const t=D.find(t=>t.code===e.tenantId);return Promise.resolve(function(e,t,l){try{var n,i,o,a,r,u,d,s,c,v,p,m,E,_,f,A,g,S,h,y,D,T,b,C,P,N,I,L,B,O,R,w,x;return console.log("application in getAcknowledgement",e),Promise.resolve({t:l,tenantId:null==t?void 0:t.code,name:`${l(null==t?void 0:t.i18nKey)} ${M=l("ULBGRADE_"+(null==t||null===(n=t.city)||void 0===n?void 0:n.ulbGrade.toUpperCase().replace(" ","_").replace(".","_"))),M.toLowerCase().split(" ").map(rr).join(" ")}`,email:null==t?void 0:t.emailId,phoneNumber:null==t?void 0:t.contactNumber,heading:l("NEW_STAKEHOLDER_REGISTRATION"),applicationNumber:(null==e||null===(i=e.applicationData)||void 0===i?void 0:i.applicationNumber)||"NA",details:[{title:l("CS_APPLICATION_DETAILS"),values:[{title:l("REGISTRATION_FILED_DATE"),value:Digit.DateUtils.ConvertTimestampToDate(null==e||null===(o=e.applicationData)||void 0===o||null===(a=o.auditDetails)||void 0===a?void 0:a.createdTime,"dd/MM/yyyy")||"NA"}]},{title:l("BPA_LICENSE_DETAILS_LABEL"),values:[{title:l("BPA_LICENSE_TYPE"),value:l(""+(null==e||null===(r=e.applicationDetails)||void 0===r||null===(u=r[1])||void 0===u||null===(d=u.values[0])||void 0===d?void 0:d.value))||"NA"},{title:l("BPA_COUNCIL_NUMBER"),value:(null==e||null===(s=e.applicationDetails)||void 0===s||null===(c=s[1])||void 0===c||null===(v=c.values[1])||void 0===v?void 0:v.value)||"NA"},{title:l("BPA_LICENSE_TYPE"),value:(null==e||null===(p=e.applicationData)||void 0===p||null===(m=p.tradeLicenseDetail)||void 0===m||null===(E=m.tradeUnits)||void 0===E?void 0:E.tradeType)||"NA"},{}]},{title:l("BPA_LICENSEE_DETAILS_HEADER_OWNER_INFO"),values:[{title:l("BPA_APPLICANT_NAME_LABEL"),value:(null==e||null===(_=e.applicationData)||void 0===_||null===(f=_.tradeLicenseDetail)||void 0===f||null===(A=f.owners)||void 0===A||null===(g=A[0])||void 0===g?void 0:g.name)||"NA"},{title:l("BPA_OWNER_MOBILE_NO_LABEL"),value:(null==e||null===(S=e.applicationData)||void 0===S||null===(h=S.tradeLicenseDetail)||void 0===h||null===(y=h.owners)||void 0===y||null===(D=y[0])||void 0===D?void 0:D.mobileNumber)||"NA"},{title:l("BPA_APPLICANT_GENDER_LABEL"),value:(null==e||null===(T=e.applicationDetails)||void 0===T||null===(b=T[2])||void 0===b||null===(C=b.values[1])||void 0===C?void 0:C.value)||"NA"},{title:l("BPA_APPLICANT_EMAIL_LABEL"),value:(null==e||null===(P=e.applicationDetails)||void 0===P||null===(N=P[2])||void 0===N||null===(I=N.values[3])||void 0===I?void 0:I.value)||"NA"},{}]},{title:l("BPA_NEW_ADDRESS_HEADER_DETAILS"),values:[{title:l("BPA_PERMANANT_ADDRESS_LABEL"),value:(null==e||null===(L=e.applicationDetails)||void 0===L||null===(B=L[3])||void 0===B||null===(O=B.values[0])||void 0===O?void 0:O.value)||"NA"},{title:l("BPA_APPLICANT_CORRESPONDENCE_ADDRESS_LABEL"),value:(null==e||null===(R=e.applicationDetails)||void 0===R||null===(w=R[4])||void 0===w||null===(x=w.values[0])||void 0===x?void 0:x.value)||"NA"},{}]}]})}catch(e){return Promise.reject(e)}var M}(e,t,A)).then(function(e){Digit.Utils.pdf.generate(e)})}catch(e){return Promise.reject(e)}}})),!T&&l.createElement(i.Link,{to:"/digit-ui/citizen"},l.createElement(o.LinkButton,{label:A("CORE_COMMON_GO_TO_HOME")})),h.isSuccess&&T&&l.createElement(i.Link,{to:{pathname:"/digit-ui/citizen"}},l.createElement(o.SubmitBar,{label:A("BPA_COMMON_PROCEED_NEXT")})))))},ObpsCreateEDCR:e=>{var o,a,r,d;const s=u.useQueryClient(),c=i.useRouteMatch(),{t:v}=n.useTranslation(),p=(i.useLocation(),i.useHistory());let m=[];const[E,_,f]=Digit.Hooks.useSessionStorage("EDCR_CREATE",{}),[A,g]=t.useState(null),[S,h]=t.useState(!1);Digit.SessionStorage.set("EDCR_BACK","IS_EDCR_BACK");const y=Digit.ULBService.getStateId();let{data:D}=Digit.Hooks.obps.SearchMdmsTypes.getFormConfig(y,[]);function T(e,t,l,n){var i,o,a,r,u,d,s,c,v,m,E;h(!0);const f=Digit.UserService.getUser(),A=(null==t?void 0:t.tenantId)||(null==t?void 0:t.ulb);console.log(A,"I(((((((((");const S={id:null==f||null===(i=f.info)||void 0===i?void 0:i.uuid,tenantId:null==f||null===(o=f.info)||void 0===o?void 0:o.tenantId};let y={transactionNumber:"",edcrNumber:"",planFile:null,tenantId:"",RequestInfo:{apiId:"",ver:"",ts:"",action:"",did:"",authToken:"",key:"",msgId:"",correlationId:"",userInfo:S}};console.log(S,f,"USER INFO");const D=null==t?void 0:t.applicantName,T="SCHEME_AREA"===(null==t||null===(a=t.areaType)||void 0===a?void 0:a.code)?"NO":null==t||null===(r=t.coreArea)||void 0===r?void 0:r.code;console.log("A=====",T,null==t||null===(u=t.areaType)||void 0===u?void 0:u.code,"SCHEME_AREA"===(null==t||null===(d=t.areaType)||void 0===d?void 0:d.code));const b=null==t?void 0:t.file,C=A,P=null==t?void 0:t.ulb,N=null==t||null===(s=t.areaType)||void 0===s?void 0:s.code,I=null==t?void 0:t.schName,L="YES"===(null==t||null===(c=t.siteReserved)||void 0===c?void 0:c.code),B="YES"===(null==t||null===(v=t.approvedCS)||void 0===v?void 0:v.code),O="YES"===(null==t||null===(m=t.cluApprove)||void 0===m?void 0:m.code),R=null==t||null===(E=t.schemeArea)||void 0===E?void 0:E.code,w=ht();console.log("tenantIdInEDCR",C),console.log("tenantIdInEDCR-DATA",t),y={...y,tenantId:C},y={...y,transactionNumber:w},y={...y,applicantName:D},y={...y,coreArea:T},y={...y,appliactionType:"BUILDING_PLAN_SCRUTINY"},y={...y,applicationSubType:"NEW_CONSTRUCTION"},y={...y,applicationSubType:"NEW_CONSTRUCTION"},y={...y,ulb:P},y={...y,areaType:N},y={...y,schName:I},y={...y,siteReserved:L},y={...y,approvedCS:B},y={...y,schemeArea:R},y={...y,cluApprove:O},console.log("tenantIdInEDCR-Request",y);let x=new FormData;x.append("edcrRequest",JSON.stringify(y)),x.append("planFile",b),Digit.EDCRService.create({data:x},C).then((e,t)=>{var l,n,i,o,a,r;h(!1),null!=e&&null!==(l=e.data)&&void 0!==l&&l.edcrDetail&&(console.log("result?.data",null==e?void 0:e.data),sessionStorage.setItem("plotArea",(null==e||null===(n=e.data)||void 0===n||null===(i=n.edcrDetail[0].planDetail)||void 0===i||null===(o=i.plot)||void 0===o?void 0:o.area)||0),_(null==e||null===(a=e.data)||void 0===a?void 0:a.edcrDetail),p.replace("/digit-ui/citizen/obps/edcrscrutiny/apply/acknowledgement",{data:null==e||null===(r=e.data)||void 0===r?void 0:r.edcrDetail}))}).catch(e=>{var t,l,n,i,o,a,r,u;_({data:null!=e&&null!==(t=e.response)&&void 0!==t&&null!==(l=t.data)&&void 0!==l&&l.errorCode?null==e||null===(n=e.response)||void 0===n||null===(i=n.data)||void 0===i?void 0:i.errorCode:"BPA_INTERNAL_SERVER_ERROR",type:"ERROR"}),h(!1),g({key:!0,label:null!=e&&null!==(o=e.response)&&void 0!==o&&null!==(a=o.data)&&void 0!==a&&a.errorCode?null==e||null===(r=e.response)||void 0===r||null===(u=r.data)||void 0===u?void 0:u.errorCode:"BPA_INTERNAL_SERVER_ERROR"})})}const b=()=>{},C=()=>{};D=null!==(o=D)&&void 0!==o&&o.EdcrConfig?null===(a=D)||void 0===a?void 0:a.EdcrConfig:Zl,D.forEach(e=>{m=m.concat(e.body.filter(e=>!e.hideInCitizen))}),m.indexRoute="home";const P=null===(r=Digit)||void 0===r||null===(d=r.ComponentRegistryService)||void 0===d?void 0:d.getComponent("EDCRAcknowledgement");return l.createElement(i.Switch,null,m.map((e,t)=>{const{component:n,texts:o,inputs:a,key:r}=e,u="string"==typeof n?Digit.ComponentRegistryService.getComponent(n):n;return l.createElement(i.Route,{path:`${c.path}/${e.route}`,key:t},l.createElement(u,{config:{texts:o,inputs:a,key:r},onSelect:T,onSkip:b,t:v,formData:E,onAdd:C,isShowToast:A,isSubmitBtnDisable:S,setIsShowToast:g}))}),l.createElement(i.Route,{path:c.path+"/acknowledgement"},l.createElement(P,{data:E,onSuccess:()=>{sessionStorage.removeItem("CurrentFinancialYear"),s.invalidateQueries("TL_CREATE_TRADE")}})),l.createElement(i.Route,null,l.createElement(i.Redirect,{to:`${c.path}/${m.indexRoute}`})))},ObpsCreateOCEDCR:e=>{var o,a,r,d;const s=u.useQueryClient(),c=i.useRouteMatch(),{t:v}=n.useTranslation(),{pathname:p}=i.useLocation(),{path:m}=i.useRouteMatch(),E=i.useHistory();let _=[];const[f,A,g]=Digit.Hooks.useSessionStorage("OC_EDCR_CREATE",{}),[S,h]=t.useState(null),[y,D]=t.useState(!1);Digit.SessionStorage.set("EDCR_BACK","IS_EDCR_BACK");const T=Digit.ULBService.getStateId();let{data:b}=Digit.Hooks.obps.SearchMdmsTypes.getFormConfig(T,[]);const C=(e,t,l,n)=>{n?function(e,t,l,n){var i,o,a,r,u,d,s,c;D(!0);const v=f,p=Digit.UserService.getUser();let m={transactionNumber:"",edcrNumber:"",planFile:null,tenantId:"",RequestInfo:{apiId:"",ver:"",ts:"",action:"",did:"",authToken:"",key:"",msgId:"",correlationId:"",userInfo:{id:null==p||null===(i=p.info)||void 0===i?void 0:i.uuid,tenantId:null==p||null===(o=p.info)||void 0===o?void 0:o.tenantId}}};const _=ht(),g=null==v||null===(a=v.ScrutinyDetails)||void 0===a?void 0:a.edcrNumber,S=null==v||null===(r=v.ScrutinyDetails)||void 0===r?void 0:r.tenantId,y=null==v||null===(u=v.ScrutinyDetails)||void 0===u?void 0:u.applicantName,T=Bt(null==v||null===(d=v.ScrutinyDetails)||void 0===d?void 0:d.ocPermitdate),b=null==v||null===(s=v.ScrutinyDetails)||void 0===s?void 0:s.ocPermitNumber,C=null==v||null===(c=v.ScrutinyDetails)||void 0===c?void 0:c.edcrNumber,P=null==t?void 0:t.file;m={...m,transactionNumber:_},m={...m,edcrNumber:g},m={...m,tenantId:S},m={...m,applicantName:y},m={...m,appliactionType:"BUILDING_OC_PLAN_SCRUTINY"},m={...m,applicationSubType:"NEW_CONSTRUCTION"},m={...m,permitDate:T},m={...m,permitNumber:b},m={...m,comparisonEdcrNumber:C};let N=new FormData;N.append("edcrRequest",JSON.stringify(m)),N.append("planFile",P),Digit.EDCRService.create({data:N},S).then((e,t)=>{var l,n,i;D(!1),null!=e&&null!==(l=e.data)&&void 0!==l&&l.edcrDetail&&(A(null==e||null===(n=e.data)||void 0===n?void 0:n.edcrDetail),E.replace("/digit-ui/citizen/obps/edcrscrutiny/oc-apply/acknowledgement",{data:null==e||null===(i=e.data)||void 0===i?void 0:i.edcrDetail}))}).catch(e=>{var t,l,n,i,o,a,r,u;A({data:null!=e&&null!==(t=e.response)&&void 0!==t&&null!==(l=t.data)&&void 0!==l&&l.errorCode?null==e||null===(n=e.response)||void 0===n||null===(i=n.data)||void 0===i?void 0:i.errorCode:"BPA_INTERNAL_SERVER_ERROR",type:"ERROR"}),D(!1),h({key:!0,label:null!=e&&null!==(o=e.response)&&void 0!==o&&null!==(a=o.data)&&void 0!==a&&a.errorCode?null==e||null===(r=e.response)||void 0===r||null===(u=r.data)||void 0===u?void 0:u.errorCode:"BPA_INTERNAL_SERVER_ERROR"})})}(0,t):A({...f,[e]:{...f[e],...t}}),l||(e=>{const t=p.split("/").pop(),{nextStep:l}=_.find(e=>e.route===t);let n=E.push;if(null===l)return n(m+"/check");n(`${m}/${l}`)})()},P=()=>{},N=()=>{};b=null!==(o=b)&&void 0!==o&&o.OCEdcrConfig?null===(a=b)||void 0===a?void 0:a.OCEdcrConfig:Ql,b.forEach(e=>{_=_.concat(e.body.filter(e=>!e.hideInCitizen))}),_.indexRoute="docs-required";const I=null===(r=Digit)||void 0===r||null===(d=r.ComponentRegistryService)||void 0===d?void 0:d.getComponent("OCEDCRAcknowledgement");return l.createElement(i.Switch,null,_.map((e,t)=>{const{component:n,texts:o,inputs:a,key:r}=e,u="string"==typeof n?Digit.ComponentRegistryService.getComponent(n):n;return l.createElement(i.Route,{path:`${c.path}/${e.route}`,key:t},l.createElement(u,{config:{texts:o,inputs:a,key:r},onSelect:C,onSkip:P,t:v,formData:f,onAdd:N,isShowToast:S,isSubmitBtnDisable:y,setIsShowToast:h}))}),l.createElement(i.Route,{path:c.path+"/acknowledgement"},l.createElement(I,{data:f,onSuccess:()=>{sessionStorage.removeItem("CurrentFinancialYear"),s.invalidateQueries("TL_CREATE_TRADE")}})),l.createElement(i.Route,null,l.createElement(i.Redirect,{to:`${c.path}/${_.indexRoute}`})))},ObpsNewBuildingPermit:()=>{var e,o,a,r,d,s;const c=u.useQueryClient(),{t:v}=n.useTranslation(),{pathname:p,state:m}=(i.useRouteMatch(),i.useLocation()),E=i.useRouteMatch(),_=i.useHistory();i.useLocation(),Digit.SessionStorage.set("OBPS_PT","true"),sessionStorage.removeItem("BPA_SUBMIT_APP"),Digit.ULBService.getCurrentTenantId();const[f,A,g]=Digit.Hooks.useSessionStorage("BUILDING_PERMIT",null!=m&&m.edcrNumber?{data:{scrutinyNumber:{edcrNumber:null==m?void 0:m.edcrNumber}}}:{}),S=Digit.ULBService.getStateId();let{data:h}=Digit.Hooks.obps.SearchMdmsTypes.getFormConfig(S,[]);const y=(e,t,l,n)=>{A(n?t:""===e?{...t}:{...f,[e]:{...f[e],...t}}),(e=>{const t=p.split("/").pop(),{nextStep:l}=tn.find(e=>e.route===t);let n=_.push;if(null===l)return n(ln(E.path,E.params)+"/check");n(`${ln(E.path,E.params)}/${l}`)})()},D=()=>{};let T=[];h=null!==(e=h)&&void 0!==e&&e.BuildingPermitConfig?null===(o=h)||void 0===o?void 0:o.BuildingPermitConfig:en,h.forEach(e=>{T=T.concat(e.body.filter(e=>!e.hideInCitizen))}),T.indexRoute="docs-required",t.useEffect(()=>{sessionStorage.getItem("isPermitApplication")&&"true"==sessionStorage.getItem("isPermitApplication")&&(g(),sessionStorage.setItem("isPermitApplication",!1))},[]);const b=null===(a=Digit)||void 0===a||null===(r=a.ComponentRegistryService)||void 0===r?void 0:r.getComponent("BPACheckPage"),C=null===(d=Digit)||void 0===d||null===(s=d.ComponentRegistryService)||void 0===s?void 0:s.getComponent("BPAAcknowledgement");return l.createElement(i.Switch,null,tn.map((e,t)=>{const{component:n,texts:o,inputs:a,key:r}=e,u="string"==typeof n?Digit.ComponentRegistryService.getComponent(n):n;return l.createElement(i.Route,{path:`${ln(E.path,E.params)}/${e.route}`,key:t},l.createElement(u,{config:{texts:o,inputs:a,key:r},onSelect:y,onSkip:D,t:v,formData:f}))}),l.createElement(i.Route,{path:ln(E.path,E.params)+"/check"},l.createElement(b,{onSubmit:function(e){try{return Promise.resolve(Digit.OBPSService.scrutinyDetails(null==e?void 0:e.tenantId,{edcrNumber:null==e?void 0:e.edcrNumber})).then(function(e){console.log(e,"RESPO"),_.push(ln(E.path,E.params)+"/acknowledgement")})}catch(e){return Promise.reject(e)}},value:f})),l.createElement(i.Route,{path:ln(E.path,E.params)+"/acknowledgement"},l.createElement(C,{data:f,onSuccess:()=>{c.invalidateQueries("PT_CREATE_PROPERTY")}})),l.createElement(i.Route,null,l.createElement(i.Redirect,{to:`${ln(E.path,E.params)}/${T.indexRoute}`})))},ObpsOCBuildingPermit:()=>{var e,o,a,r,d,s;const c=u.useQueryClient(),{t:v}=n.useTranslation(),{pathname:p,state:m}=(i.useRouteMatch(),i.useLocation()),E=i.useHistory(),_=i.useRouteMatch();sessionStorage.removeItem("BPA_SUBMIT_APP"),Digit.ULBService.getCurrentTenantId();const[f,A,g]=Digit.Hooks.useSessionStorage("BUILDING_PERMIT",null!=m&&m.edcrNumber?{data:{scrutinyNumber:{edcrNumber:null==m?void 0:m.edcrNumber}}}:{}),S=Digit.ULBService.getStateId();let{data:h}=Digit.Hooks.obps.SearchMdmsTypes.getFormConfig(S,[]);const y=(e,t,l,n)=>{A(n?t:""===e?{...t}:{...f,[e]:{...f[e],...t}}),(e=>{const t=p.split("/").pop(),{nextStep:l}=T.find(e=>e.route===t);let n=E.push;if(null===l)return n(on(_.path,_.params)+"/check");n(`${on(_.path,_.params)}/${l}`)})()},D=()=>{};let T=[];h=null!==(e=h)&&void 0!==e&&e.OCBuildingPermitConfig?null===(o=h)||void 0===o?void 0:o.OCBuildingPermitConfig:nn,h.forEach(e=>{T=T.concat(e.body.filter(e=>!e.hideInCitizen))}),T.indexRoute="docs-required",t.useEffect(()=>{sessionStorage.getItem("isPermitApplication")&&"true"==sessionStorage.getItem("isPermitApplication")&&(g(),sessionStorage.setItem("isPermitApplication",!1))},[]);const b=null===(a=Digit)||void 0===a||null===(r=a.ComponentRegistryService)||void 0===r?void 0:r.getComponent("OCBPACheckPage"),C=null===(d=Digit)||void 0===d||null===(s=d.ComponentRegistryService)||void 0===s?void 0:s.getComponent("OCBPAAcknowledgement");return l.createElement(i.Switch,null,T.map((e,t)=>{const{component:n,texts:o,inputs:a,key:r}=e,u="string"==typeof n?Digit.ComponentRegistryService.getComponent(n):n;return l.createElement(i.Route,{path:`${on(_.path,_.params)}/${e.route}`,key:t},l.createElement(u,{config:{texts:o,inputs:a,key:r},onSelect:y,onSkip:D,t:v,formData:f}))}),l.createElement(i.Route,{path:on(_.path,_.params)+"/check"},l.createElement(b,{onSubmit:function(){try{return E.push(on(_.path,_.params)+"/acknowledgement"),Promise.resolve()}catch(e){return Promise.reject(e)}},value:f})),l.createElement(i.Route,{path:on(_.path,_.params)+"/acknowledgement"},l.createElement(C,{data:f,onSuccess:()=>{c.invalidateQueries("PT_CREATE_PROPERTY")}})),l.createElement(i.Route,null,l.createElement(i.Redirect,{to:`${on(_.path,_.params)}/${T.indexRoute}`})))},ObpsStakeholderRegistration:()=>{var e,o,a,r,d,s;const c=u.useQueryClient(),{t:v}=n.useTranslation(),{path:p}=i.useRouteMatch(),{pathname:m,state:E}=i.useLocation(),_=i.useHistory(),[f,A,g]=(Digit.ULBService.getCurrentTenantId(),Digit.Hooks.useSessionStorage("BUILDING_PERMIT",null!=E&&E.edcrNumber?{data:{scrutinyNumber:{edcrNumber:null==E?void 0:E.edcrNumber}}}:{})),S=Digit.ULBService.getStateId();let{data:h}=Digit.Hooks.obps.SearchMdmsTypes.getFormConfig(S,[]);const y=(e,t,l,n)=>{A(n?t:""===e?{...t}:{...f,[e]:{...f[e],...t}}),(e=>{const t=m.split("/").pop(),{nextStep:l}=T.find(e=>e.route===t);let n=_.push;if(null===l)return n(p+"/check");n(`${p}/${l}`)})()},D=()=>{};let T=[];h=null!==(e=h)&&void 0!==e&&e.StakeholderConfig?null===(o=h)||void 0===o?void 0:o.StakeholderConfig:an,h.forEach(e=>{T=T.concat(e.body.filter(e=>!e.hideInCitizen))}),T.indexRoute="stakeholder-docs-required",t.useEffect(()=>{sessionStorage.getItem("isPermitApplication")&&"true"==sessionStorage.getItem("isPermitApplication")&&(g(),sessionStorage.setItem("isPermitApplication",!1))},[]);const b=null===(a=Digit)||void 0===a||null===(r=a.ComponentRegistryService)||void 0===r?void 0:r.getComponent("StakeholderCheckPage"),C=null===(d=Digit)||void 0===d||null===(s=d.ComponentRegistryService)||void 0===s?void 0:s.getComponent("StakeholderAcknowledgement");return console.log("formData in StakeholderRegistration",f),console.log("config in StakeholderRegistration",T),l.createElement(i.Switch,null,T.map((e,t)=>{const{component:n,texts:o,inputs:a,key:r}=e,u="string"==typeof n?Digit.ComponentRegistryService.getComponent(n):n;return l.createElement(i.Route,{path:`${p}/${e.route}`,key:t},l.createElement(u,{config:{texts:o,inputs:a,key:r},onSelect:y,onSkip:D,t:v,formData:f}))}),l.createElement(i.Route,{path:p+"/check"},l.createElement(b,{onSubmit:function(){try{return _.push(p+"/acknowledgement"),Promise.resolve()}catch(e){return Promise.reject(e)}},value:f})),l.createElement(i.Route,{path:p+"/acknowledgement"},l.createElement(C,{data:f,onSuccess:()=>{g(),c.invalidateQueries("PT_CREATE_PROPERTY")}})),l.createElement(i.Route,null,l.createElement(i.Redirect,{to:`${p}/${T.indexRoute}`})))},ObpsCitizenBpaApplicationDetail:()=>{var e,a,r,d,s,c,v,p,E,_,f,A,g,S,h,y,D,T,b,C,P,N,I,L,B,O,R,w,x;const M=function(e,t,l){let{tenantId:n}=e;void 0===l&&(l="download");try{var i,o;let e=new Date;fe.applicationData.additionalDetails.runDate=Bt(e.getFullYear()+"-"+(e.getMonth()+1)+"-"+e.getDate());let C={...null==fe?void 0:fe.applicationData,edcrDetail:[{...null==fe?void 0:fe.edcrDetails}]};const P=Digit.ULBService.getStateId();let N=0;for(let e=0;e<(null===(a=he)||void 0===a||null===(r=a.data)||void 0===r||null===(u=r.processInstances)||void 0===u?void 0:u.length);e++){var a,r,u,d,s,c,v,p,m,E,_,f,A,g,S,h,y,D;"POST_PAYMENT_APPLY"!==(null===(d=he)||void 0===d||null===(s=d.data)||void 0===s||null===(c=s.processInstances[e])||void 0===c?void 0:c.action)&&"PAY"!==(null===(v=he)||void 0===v||null===(p=v.data)||void 0===p||null===(m=p.processInstances[e])||void 0===m?void 0:m.action)||"APPROVAL_INPROGRESS"!==(null===(E=he)||void 0===E||null===(_=E.data)||void 0===_||null===(f=_.processInstances)||void 0===f||null===(A=f[e])||void 0===A||null===(g=A.state)||void 0===g?void 0:g.applicationStatus)||0!=N||(C.additionalDetails.submissionDate=null===(S=he)||void 0===S||null===(h=S.data)||void 0===h||null===(y=h.processInstances[e])||void 0===y||null===(D=y.auditDetails)||void 0===D?void 0:D.createdTime,N=1)}var T;if("NO"==(null==C||null===(i=C.additionalDetails)||void 0===i?void 0:i.approvedColony))C.additionalDetails.permitData="The plot has been officially regularized under No."+(null==C||null===(T=C.additionalDetails)||void 0===T?void 0:T.NocNumber)+" dated dd/mm/yyyy, registered in the name of <name as per the NOC>. This regularization falls within the jurisdiction of "+P+".Any form of misrepresentation of the NoC is strictly prohibited. Such misrepresentation renders the building plan null and void, and it will be regarded as an act of impersonation. Criminal proceedings will be initiated against the owner and concerned architect / engineer/ building designer / supervisor involved in such actions";else if("YES"==(null==C||null===(o=C.additionalDetails)||void 0===o?void 0:o.approvedColony)){var b;C.additionalDetails.permitData="The building plan falls under approved colony "+(null==C||null===(b=C.additionalDetails)||void 0===b?void 0:b.nameofApprovedcolony)}else C.additionalDetails.permitData="The building plan falls under Lal Lakir";return Promise.resolve(Digit.PaymentService.generatePdf(n,{Bpa:[C]},t)).then(function(e){return Promise.resolve(Digit.PaymentService.printReciept(n,{fileStoreIds:e.filestoreIds[0]})).then(function(t){var n,i;return window.open(t[null==e?void 0:e.filestoreIds[0]],"_blank"),C.applicationType=null==fe||null===(n=fe.applicationData)||void 0===n||null===(i=n.additionalDetails)||void 0===i?void 0:i.applicationType,Promise.resolve(Digit.OBPSService.edcr_report_download({BPA:{...C}})).then(function(e){const t=parseInt(e.status,10);201!==t&&200!==t||("print"==l?kt(new Blob([e.data],{type:"application/pdf"})):Ft(new Blob([e.data],{type:"application/pdf"}),"edcrReport.pdf"))})})})}catch(e){return Promise.reject(e)}},F=function(e){let{payments:t,...l}=e;try{function n(){return Promise.resolve(Digit.PaymentService.printReciept(W,{fileStoreIds:e.filestoreIds[0]})).then(function(t){var l;window.open(t[null===(l=e)||void 0===l?void 0:l.filestoreIds[0]],"_blank")})}let e=null;const l=function(){if(null==t||!t.fileStoreId)return Promise.resolve(Digit.PaymentService.generatePdf(W,{Payments:[{...t}]},"bpa-receipt")).then(function(t){e=t});e={filestoreIds:[null==t?void 0:t.fileStoreId]}}();return Promise.resolve(l&&l.then?l.then(n):n())}catch(e){return Promise.reject(e)}},{id:k}=i.useParams(),{t:U}=n.useTranslation(),H=Digit.ULBService.getCurrentTenantId(),W=Digit.ULBService.getStateId(),G=window.Digit.Utils.browser.isMobile(),j=u.useQueryClient(),[K,Y]=t.useState(null),[$,z]=t.useState(!1),[V,q]=t.useState(!1),[X,J]=t.useState(!1),[Z,Q]=t.useState(!1),[ee,te]=t.useState(null),[le,ne]=t.useState(!1),[ie,oe]=t.useState(!1),[ae,re]=t.useState(!1),[ue,de]=t.useState(!1);sessionStorage.removeItem("BPA_SUBMIT_APP"),sessionStorage.setItem("isEDCRDisable",JSON.stringify(!0)),sessionStorage.setItem("BPA_IS_ALREADY_WENT_OFF_DETAILS",JSON.stringify(!1));const se=Digit.UserService.getUser(),ce=null==se||null===(e=se.info)||void 0===e?void 0:e.mobileNumber,ve=i.useHistory();sessionStorage.setItem("bpaApplicationDetails",!1);let pe=!1;const{data:me}=Digit.Hooks.obps.useMDMS(W,"StakeholderRegistraition","TradeTypetoRoleMapping"),{isLoading:Ee,data:_e}=Digit.Hooks.obps.useMDMS(W,"BPA",["DocTypeMapping"]),{data:fe,isLoading:Ae}=Digit.Hooks.obps.useBPADetailsPage(H,{applicationNo:k});console.log("datata",fe);const{data:ge}=Digit.Hooks.obps.useMDMS(H.split(".")[0],"BPA",["RiskTypeComputation"]),Se=Digit.Hooks.obps.useObpsAPI(null==fe||null===(a=fe.applicationData)||void 0===a?void 0:a.tenantId,!1);let he=Digit.Hooks.useWorkflowDetails({tenantId:null==fe||null===(r=fe.applicationData)||void 0===r?void 0:r.tenantId,id:k,moduleCode:"OBPS",config:{enabled:!!fe}});const[ye,De]=t.useState(!1),[Te,be]=t.useState(!1),[Ce,Pe]=t.useState(!1),[Ne,Ie]=t.useState(ce||""),[Le,Be]=t.useState(!1),[Oe,Re]=t.useState(""),[we,xe]=t.useState(!1),[Me,Fe]=t.useState(""),[ke,Ue]=t.useState(null),He={username:Ne,password:Oe,tenantId:null==se||null===(d=se.info)||void 0===d?void 0:d.tenantId,userType:null==se||null===(s=se.info)||void 0===s?void 0:s.type},We=10===Ne.length&&/^[0-9]+$/.test(Ne),Ge=!!sessionStorage.getItem("CitizenConsentdocFilestoreid");t.useEffect(()=>{if(!Ee&&!Ae){var e;let v=[];if(null!=_e&&null!==(e=_e.BPA)&&void 0!==e&&e.DocTypeMapping){var t,l,n,i,o,a,r,u,d,s,c;v=null==_e||null===(t=_e.BPA)||void 0===t||null===(l=t.DocTypeMapping)||void 0===l?void 0:l.filter(e=>{var t,l,n,i,o;return"INPROGRESS"==e.WFState&&e.RiskType==(null==fe||null===(t=fe.applicationData)||void 0===t?void 0:t.riskType)&&e.ServiceType==(null==fe||null===(l=fe.applicationData)||void 0===l||null===(n=l.additionalDetails)||void 0===n?void 0:n.serviceType)&&e.applicationType==(null==fe||null===(i=fe.applicationData)||void 0===i||null===(o=i.additionalDetails)||void 0===o?void 0:o.applicationType)});let e=null==fe||null===(n=fe.applicationDetails)||void 0===n||null===(i=n.filter(e=>"BPA_DOCUMENT_DETAILS_LABEL"===e.title)[0])||void 0===i||null===(o=i.additionalDetails)||void 0===o||null===(a=o.obpsDocuments)||void 0===a||null===(r=a[0])||void 0===r?void 0:r.values,p=[];v&&(null===(u=v)||void 0===u||null===(d=u[0])||void 0===d?void 0:d.docTypes)&&(null===(s=v)||void 0===s||null===(c=s[0])||void 0===c||c.docTypes.map(t=>{e&&e.filter(e=>t.code===e.documentType.slice(0,e.documentType.lastIndexOf("."))).map(e=>{p.push(e)})}));const m=null==fe?void 0:fe.applicationDetails.map(e=>"BPA_DOCUMENT_DETAILS_LABEL"===e.title?{...e,additionalDetails:{obpsDocuments:[{title:"",values:p}]}}:e);fe.applicationDetails=[...m]}}},[_e,fe]),t.useEffect(()=>{var e,t;"CITIZEN_APPROVAL_INPROCESS"==(null==fe||null===(e=fe.applicationData)||void 0===e?void 0:e.status)||"INPROGRESS"==(null==fe||null===(t=fe.applicationData)||void 0===t?void 0:t.status)?oe(!0):oe(!1)},[fe]);const je=(e,t)=>e?t?e:U(e):U("NA");t.useEffect(()=>{switch(ee){case"APPROVE":case"SEND_TO_ARCHITECT":case"APPLY":case"SKIP_PAYMENT":case"POST_PAYMENT_APPROVE":case"POST_PAYMENT_APPLY":J(!0)}},[ee]);const Ke=()=>{Y(null)};function Ye(e){var t;let l="BPA_OC"==(null==fe||null===(t=fe.applicationData)||void 0===t?void 0:t.businessService)?"ocbpa":"bpa";var n,i,o,a,r,u,d;"FORWARD"===e&&ve.replace(`/digit-ui/citizen/obps/sendbacktocitizen/ocbpa/${null==fe||null===(n=fe.applicationData)||void 0===n?void 0:n.tenantId}/${null==fe||null===(i=fe.applicationData)||void 0===i?void 0:i.applicationNo}/check`,{data:null==fe?void 0:fe.applicationData,edcrDetails:null==fe?void 0:fe.edcrDetails}),"PAY"===e&&window.location.assign(`${window.location.origin}/digit-ui/citizen/payment/collect/${Mt(null==fe?void 0:fe.businessService,null==fe?void 0:fe.applicationStatus)}/${k}/${null==fe?void 0:fe.tenantId}?tenantId=${null==fe?void 0:fe.tenantId}`),"SEND_TO_CITIZEN"===e&&((null===(o=he)||void 0===o||null===(a=o.data)||void 0===a||null===(r=a.processInstances)||void 0===r?void 0:r.length)>2?window.location.replace(`/digit-ui/citizen/obps/editApplication/${l}/${null==fe||null===(u=fe.applicationData)||void 0===u?void 0:u.tenantId}/${null==fe||null===(d=fe.applicationData)||void 0===d?void 0:d.applicationNo}`):Dt(null==fe?void 0:fe.applicationData,ge,ve,U)),te(e),q(!1)}function $e(){return!!ie&&(pe?!pe:!$)}const ze=e=>{var t,l,n,i,o;re(!0);const a=null==fe||null===(t=fe.applicationData)||void 0===t||null===(l=t.documents)||void 0===l?void 0:l.some(e=>"CITIZEN.UNDERTAKING"===e.documentType),r=[...null==fe||null===(n=fe.applicationData)||void 0===n?void 0:n.documents.filter(e=>"CITIZEN.UNDERTAKING"!==e.documentType),...a?null==fe||null===(i=fe.applicationData)||void 0===i?void 0:i.documents.filter(e=>"CITIZEN.UNDERTAKING"===e.documentType):[{documentType:"CITIZEN.UNDERTAKING",fileStoreId:sessionStorage.getItem("CitizenConsentdocFilestoreid"),fileStore:sessionStorage.getItem("CitizenConsentdocFilestoreid")}]],u={...null==fe?void 0:fe.applicationData,documents:r,additionalDetails:{...null==fe||null===(o=fe.applicationData)||void 0===o?void 0:o.additionalDetails,otpVerifiedTimestampcitizen:sessionStorage.getItem("otpVerifiedTimestampcitizen")}};Se.mutate({BPA:{...u,workflow:e}},{onError:(e,t)=>{var l,n,i,o,a,r;re(!1),J(!1),Y({key:"error",action:null!=e&&null!==(l=e.response)&&void 0!==l&&null!==(n=l.data)&&void 0!==n&&null!==(i=n.Errors[0])&&void 0!==i&&i.message?null==e||null===(o=e.response)||void 0===o||null===(a=o.data)||void 0===a||null===(r=a.Errors[0])||void 0===r?void 0:r.message:e}),setTimeout(Ke,5e3)},onSuccess:(e,t)=>{re(!1),ve.replace("/digit-ui/citizen/obps/response",{data:e}),J(!1),Y({key:"success",action:ee}),setTimeout(Ke,5e3),j.invalidateQueries("BPA_DETAILS_PAGE"),j.invalidateQueries("workFlowDetails")}})};if((null===(c=he)||void 0===c||null===(v=c.data)||void 0===v||null===(p=v.nextActions)||void 0===p?void 0:p.length)>0&&"CITIZEN_APPROVAL_INPROCESS"==(null==fe||null===(E=fe.applicationData)||void 0===E?void 0:E.status)){var Ve,qe,Xe;const e=Digit.UserService.getUser(),t=null==e||null===(Ve=e.info)||void 0===Ve?void 0:Ve.roles;var Je,Ze,Qe;if("CITIZEN_APPROVAL_INPROCESS"==(null==fe||null===(qe=fe.applicationData)||void 0===qe?void 0:qe.status))he.data.nextActions=1==(null==t?void 0:t.length)&&"CITIZEN"==(null==t||null===(Je=t[0])||void 0===Je?void 0:Je.code)?null===(Ze=he)||void 0===Ze||null===(Qe=Ze.data)||void 0===Qe?void 0:Qe.nextActions:[];else if("INPROGRESS"==(null==fe||null===(Xe=fe.applicationData)||void 0===Xe?void 0:Xe.status)){var et,tt;let e=!1;null==me||null===(et=me.StakeholderRegistraition)||void 0===et||null===(tt=et.TradeTypetoRoleMapping)||void 0===tt||tt.map(e=>{var t;null==e||null===(t=e.role)||void 0===t||t.map(e=>{roles.push(e)})});const l=roles.filter((e,t,l)=>l.indexOf(e)===t);var lt,nt;(null==t?void 0:t.length)>1&&t.forEach(t=>{l.includes(t.code)&&(e=!0)}),he.data.nextActions=e?null===(lt=he)||void 0===lt||null===(nt=lt.data)||void 0===nt?void 0:nt.nextActions:[]}}if("SEND_BACK_TO_CITIZEN"===(null===(_=he)||void 0===_||null===(f=_.data)||void 0===f||null===(A=f.processInstances)||void 0===A||null===(g=A[0])||void 0===g?void 0:g.action)){var it;$&&z(!0),pe=!0;const e=Digit.UserService.getUser(),t=null==e||null===(it=e.info)||void 0===it?void 0:it.roles;var ot,at;1!==(null==t?void 0:t.length)&&(he={...he,data:{...null===(ot=he)||void 0===ot?void 0:ot.data,actionState:{nextActions:[]}},data:{...null===(at=he)||void 0===at?void 0:at.data,nextActions:[]}})}if(Ae||ae)return l.createElement(o.Loader,null);let rt=[];var ut,dt,st,ct,vt,pt,mt,Et,_t,At,gt,St,ht;if((null==fe||null===(S=fe.collectionBillDetails)||void 0===S?void 0:S.length)>0&&ft(null==fe?void 0:fe.collectionBillDetails).forEach(e=>{var t,l,n,i,o;"BPA.NC_OC_APP_FEE"===(null==e||null===(t=e.paymentDetails[0])||void 0===t?void 0:t.businessService)&&rt.push({order:1,label:U("BPA_APP_FEE_RECEIPT"),onClick:()=>{var t,l;return F({tenantId:null==fe||null===(t=fe.applicationData)||void 0===t?void 0:t.tenantId,payments:e,consumerCodes:null==fe||null===(l=fe.applicationData)||void 0===l?void 0:l.applicationNo})}}),"BPA.NC_OC_SAN_FEE"===(null==e||null===(l=e.paymentDetails[0])||void 0===l?void 0:l.businessService)&&rt.push({order:2,label:U("BPA_OC_DEV_PEN_RECEIPT"),onClick:()=>{var t,l;return F({tenantId:null==fe||null===(t=fe.applicationData)||void 0===t?void 0:t.tenantId,payments:e,consumerCodes:null==fe||null===(l=fe.applicationData)||void 0===l?void 0:l.applicationNo})}}),"BPA.LOW_RISK_PERMIT_FEE"===(null==e||null===(n=e.paymentDetails[0])||void 0===n?void 0:n.businessService)&&rt.push({order:1,label:U("BPA_FEE_RECEIPT"),onClick:()=>{var t,l;return F({tenantId:null==fe||null===(t=fe.applicationData)||void 0===t?void 0:t.tenantId,payments:e,consumerCodes:null==fe||null===(l=fe.applicationData)||void 0===l?void 0:l.applicationNo})}}),"BPA.NC_APP_FEE"===(null==e||null===(i=e.paymentDetails[0])||void 0===i?void 0:i.businessService)&&rt.push({order:1,label:U("BPA_APP_FEE_RECEIPT"),onClick:()=>{var t,l;return F({tenantId:null==fe||null===(t=fe.applicationData)||void 0===t?void 0:t.tenantId,payments:e,consumerCodes:null==fe||null===(l=fe.applicationData)||void 0===l?void 0:l.applicationNo})}}),"BPA.NC_SAN_FEE"===(null==e||null===(o=e.paymentDetails[0])||void 0===o?void 0:o.businessService)&&rt.push({order:2,label:U("BPA_SAN_FEE_RECEIPT"),onClick:()=>{var t,l;return F({tenantId:null==fe||null===(t=fe.applicationData)||void 0===t?void 0:t.tenantId,payments:e,consumerCodes:null==fe||null===(l=fe.applicationData)||void 0===l?void 0:l.applicationNo})}})}),fe&&"BPA_LOW"===(null==fe||null===(h=fe.applicationData)||void 0===h?void 0:h.businessService)&&(null==fe||null===(y=fe.collectionBillDetails)||void 0===y?void 0:y.length)>0)(null==fe||null===(ut=fe.applicationData)||void 0===ut||!ut.status.includes("REVOCATION"))&&rt.push({order:3,label:U("BPA_PERMIT_ORDER"),onClick:()=>{var e;return M({tenantId:null==fe||null===(e=fe.applicationData)||void 0===e?void 0:e.tenantId},"buildingpermit-low")}}),(null==fe||null===(dt=fe.applicationData)||void 0===dt?void 0:dt.status.includes("REVOCATION"))&&rt.push({order:3,label:U("BPA_REVOCATION_PDF_LABEL"),onClick:()=>{var e;return function(e){let{tenantId:t,...l}=e;try{let e={...null==fe?void 0:fe.applicationData};return Promise.resolve(Digit.PaymentService.generatePdf(t,{Bpa:[e]},"bpa-revocation")).then(function(e){return Promise.resolve(Digit.PaymentService.printReciept(t,{fileStoreIds:e.filestoreIds[0]})).then(function(t){window.open(t[null==e?void 0:e.filestoreIds[0]],"_blank")})})}catch(e){return Promise.reject(e)}}({tenantId:null==fe||null===(e=fe.applicationData)||void 0===e?void 0:e.tenantId})}});else if(fe&&"BPA"===(null==fe||null===(D=fe.applicationData)||void 0===D?void 0:D.businessService)&&(null==fe||null===(T=fe.collectionBillDetails)||void 0===T?void 0:T.length)>0){var yt;"APPROVED"===(null==fe||null===(yt=fe.applicationData)||void 0===yt?void 0:yt.status)&&rt.push({order:3,label:U("BPA_PERMIT_ORDER"),onClick:()=>{var e;return M({tenantId:null==fe||null===(e=fe.applicationData)||void 0===e?void 0:e.tenantId},"buildingpermit")}})}else{var Tt;"APPROVED"===(null==fe||null===(Tt=fe.applicationData)||void 0===Tt?void 0:Tt.status)&&rt.push({order:3,label:U("BPA_OC_CERTIFICATE"),onClick:()=>{var e;return M({tenantId:null==fe||null===(e=fe.applicationData)||void 0===e?void 0:e.tenantId},"occupancy-certificate")}})}null!=fe&&fe.comparisionReport&&rt.push({order:4,label:U("BPA_COMPARISON_REPORT_LABEL"),onClick:()=>{var e;return window.open(null==fe||null===(e=fe.comparisionReport)||void 0===e?void 0:e.comparisonReport,"_blank")}}),rt.sort(function(e,t){return e.order-t.order}),(null===(b=he)||void 0===b||null===(C=b.data)||void 0===C||null===(P=C.nextActions)||void 0===P?void 0:P.length)>0&&(he.data.nextActions=null===(st=he)||void 0===st||null===(ct=st.data)||void 0===ct||null===(vt=ct.nextActions)||void 0===vt?void 0:vt.filter(e=>"INITIATE"!==e.action),he.data.nextActions=null===(pt=he)||void 0===pt||null===(mt=pt.data)||void 0===mt||null===(Et=mt.nextActions)||void 0===Et?void 0:Et.filter(e=>"ADHOC"!==e.action),he.data.nextActions=null===(_t=he)||void 0===_t||null===(At=_t.data)||void 0===At||null===(gt=At.nextActions)||void 0===gt?void 0:gt.filter(e=>"SKIP_PAYMENT"!==e.action)),(null==fe||null===(N=fe.applicationDetails)||void 0===N?void 0:N.length)>0&&(fe.applicationDetails=(null==fe||null===(St=fe.applicationDetails)||void 0===St?void 0:St.length)>0&&(null==fe||null===(ht=fe.applicationDetails)||void 0===ht?void 0:ht.filter(e=>0!==Object.keys(e).length)));const bt=null==fe||null===(I=fe.applicationDetails)||void 0===I?void 0:I.filter(e=>0!==Object.keys(e).length);return(null==bt?void 0:bt.length)>0&&(fe.applicationDetails=bt),l.createElement(t.Fragment,null,l.createElement("div",{className:"cardHeaderWithOptions",style:{marginRight:"auto",maxWidth:"960px"}},l.createElement(o.Header,{styles:{fontSize:"32px",marginLeft:"10px"}},U("CS_TITLE_APPLICATION_DETAILS")),l.createElement("div",null,rt&&rt.length>0&&l.createElement(o.MultiLink,{className:"multilinkWrapper",onHeadClick:()=>ne(!le),displayOptions:le,options:rt}),l.createElement(o.LinkButton,{label:U("VIEW_TIMELINE"),style:{color:"#A52A2A"},onClick:()=>{const e=document.getElementById("timeline");e&&e.scrollIntoView({behavior:"smooth"}),de(!0)}}))),null==fe||null===(L=fe.applicationDetails)||void 0===L?void 0:L.filter(e=>Object.keys(e).length>0).map((e,n,a)=>{var r,u,d,s,c,v,p,m,E,_,f,A,g,S,h,y,D,T,b,C,P,N,I,L,B,O,R,w,x,M,F,H,W,j,K,Y,X,J,ee,te,le,ne,oe,ae,re,ue,de,se,ce,ve,me,Ee,_e,Ae,ge,Se,De,Te,be,Ce,Pe,Ne,Ie,Le,Be,Oe,Re,xe,Me,Fe,ke,Ue,He,We,Ke,ze;return l.createElement("div",null,null!=e&&e.isNotAllowed?null:l.createElement(o.Card,{key:n,style:null!=e&&null!==(r=e.additionalDetails)&&void 0!==r&&r.fiReport||""!==(null==e?void 0:e.title)?{}:{marginTop:"-30px"}},null!=e&&e.isTitleVisible?null:l.createElement(o.CardSubHeader,{style:{fontSize:"24px"}},U(null==e?void 0:e.title)),l.createElement("div",{style:null!=e&&e.isBackGroundColor?{marginTop:"19px",background:"#FAFAFA",border:"1px solid #D6D5D4",borderRadius:"4px",padding:"8px",lineHeight:"19px",maxWidth:"950px",minWidth:"280px"}:{}},l.createElement(o.StatusTable,null,null!=e&&e.isCommon&&(null==e||null===(u=e.values)||void 0===u?void 0:u.length)>0?null==e||null===(d=e.values)||void 0===d?void 0:d.map(e=>l.createElement(o.Row,null!=e&&e.isUnit?{className:"border-none",label:U(null==e?void 0:e.title),text:null!=e&&e.value?`${je(null==e?void 0:e.value,null==e?void 0:e.isNotTranslated)} ${U(null==e?void 0:e.isUnit)}`:U("CS_NA")}:null!=e&&e.isLink?{className:"border-none",label:U(null==e?void 0:e.title),text:l.createElement("div",null,l.createElement(i.Link,{to:null==e?void 0:e.to},l.createElement("span",{className:"link",style:{color:"#a82227"}},null==e?void 0:e.value)))}:{className:"border-none",label:U(null==e?void 0:e.title),text:je(null==e?void 0:e.value,null==e?void 0:e.isNotTranslated)||U("CS_NA")})):null,(null==e||!e.isFeeDetails)&&(null==e||null===(s=e.additionalDetails)||void 0===s||null===(c=s.values)||void 0===c?void 0:c.length)>0?null==e||null===(v=e.additionalDetails)||void 0===v||null===(p=v.values)||void 0===p?void 0:p.map(t=>l.createElement("div",null,null!=e&&e.isTitleRepeat||null!=t&&t.isHeader||null!=t&&t.isUnit?null:l.createElement(o.Row,{className:"border-none",label:U(null==t?void 0:t.title),textStyle:"Paid"===(null==t?void 0:t.value)?{color:"darkgreen"}:"Unpaid"===(null==t?void 0:t.value)?{color:"red"}:{},text:null!=t&&t.value?je(null==t?void 0:t.value,null==t?void 0:t.isNotTranslated):U("CS_NA")}),null!=e&&e.isTitleRepeat||null==t||!t.isUnit?null:l.createElement(o.Row,{className:"border-none",label:U(null==t?void 0:t.title),text:null!=t&&t.value?`${je(null==t?void 0:t.value,null==t?void 0:t.isNotTranslated)} ${U(null==t?void 0:t.isUnit)}`:U("CS_NA")}),null!=e&&e.isTitleRepeat||null==t||!t.isHeader?null:l.createElement(o.CardSubHeader,{style:{fontSize:"20px"}},U(null==t?void 0:t.title)))):null,null!=e&&e.isSubOccupancyTable&&null!=e&&null!==(m=e.additionalDetails)&&void 0!==m&&m.subOccupancyTableDetails?l.createElement(mn,{edcrDetails:null==e?void 0:e.additionalDetails,applicationData:null==fe?void 0:fe.applicationData}):null,null!=e&&e.isScrutinyDetails&&(null==e||null===(E=e.additionalDetails)||void 0===E||null===(_=E.scruntinyDetails)||void 0===_?void 0:_.length)>0?null==e||null===(f=e.additionalDetails)||void 0===f?void 0:f.scruntinyDetails.map(e=>l.createElement(t.Fragment,null,l.createElement(o.Row,{className:"border-none",label:U(null==e?void 0:e.title)}),l.createElement(o.LinkButton,{onClick:()=>{location.href=null==e?void 0:e.value},label:l.createElement(o.PDFSvg,null)}),l.createElement("p",{style:{marginTop:"8px",marginBottom:"20px",fontWeight:"bold",fontSize:"16px",lineHeight:"19px",color:"#505A5F",fontWeight:"400"}},U(null==e?void 0:e.text)))):null,null!=e&&e.isOwnerDetails&&(null==e||null===(A=e.additionalDetails)||void 0===A||null===(g=A.owners)||void 0===g?void 0:g.length)>0?null==e||null===(S=e.additionalDetails)||void 0===S?void 0:S.owners.map((t,n)=>{var i,a,r,u;return l.createElement("div",{key:n,style:(null==e||null===(i=e.additionalDetails)||void 0===i||null===(a=i.owners)||void 0===a?void 0:a.length)>1?{marginTop:"19px",background:"#FAFAFA",border:"1px solid #D6D5D4",borderRadius:"4px",padding:"8px",lineHeight:"19px",maxWidth:"950px",minWidth:"280px"}:{}},(null==e||null===(r=e.additionalDetails)||void 0===r||null===(u=r.owners)||void 0===u?void 0:u.length)>1?l.createElement(o.Row,{className:"border-none",label:`${U("Owner")} - ${n+1}`}):null,null==t?void 0:t.values.map(e=>l.createElement(o.Row,{className:"border-none",label:U(null==e?void 0:e.title),text:je(null==e?void 0:e.value,null==e?void 0:e.isNotTranslated)||U("CS_NA")})))}):null,(null==e?void 0:e.isDocumentDetails)&&(null==e||null===(h=e.additionalDetails)||void 0===h||null===(y=h.obpsDocuments)||void 0===y||null===(D=y[0])||void 0===D?void 0:D.values)&&l.createElement("div",{style:{marginTop:"-8px"}},l.createElement(Vl,{documents:Wt(null==e||null===(T=e.additionalDetails)||void 0===T||null===(b=T.obpsDocuments)||void 0===b||null===(C=b[0])||void 0===C?void 0:C.values),svgStyles:{},isSendBackFlow:!1,isHrLine:!0,titleStyles:{fontSize:"20px",lineHeight:"24px",fontWeight:700,marginBottom:"10px"}})),null!=e&&e.isFieldInspection&&(null==fe||null===(P=fe.applicationData)||void 0===P||null===(N=P.additionalDetails)||void 0===N||null===(I=N.fieldinspection_pending)||void 0===I?void 0:I.length)>0?l.createElement(En,{isCitizen:!0,fiReport:null==fe||null===(L=fe.applicationData)||void 0===L||null===(B=L.additionalDetails)||void 0===B?void 0:B.fieldinspection_pending}):null,(null==e||null===(O=e.additionalDetails)||void 0===O||null===(R=O.noc)||void 0===R?void 0:R.length)>0?null==e||null===(w=e.additionalDetails)||void 0===w?void 0:w.noc.map((t,n)=>{var i,a,r,u,d,s,c,v,p,m,E,_,f,A,g,S,h,y,D,T,b,C,P,N,I,L,B,O,R,w,x,M,F,k,H,W,G,j,K,Y,$,z;return l.createElement("div",{key:n,style:{marginTop:"19px",background:"#FAFAFA",border:"1px solid #D6D5D4",borderRadius:"4px",padding:"8px",lineHeight:"19px",maxWidth:"960px",minWidth:"280px"}},l.createElement(o.StatusTable,null,l.createElement(o.Row,{className:"border-none",label:U(`BPA_${null==e||null===(i=e.additionalDetails)||void 0===i||null===(a=i.data)||void 0===a?void 0:a.nocType}_HEADER`),labelStyle:{fontSize:"20px"}}),l.createElement(o.Row,{className:"border-none",label:U(""+(null==e||null===(r=e.values)||void 0===r||null===(u=r[0])||void 0===u?void 0:u.title)),textStyle:{marginLeft:"10px"},text:je(null==e||null===(d=e.values)||void 0===d||null===(s=d[0])||void 0===s?void 0:s.value,null==e||null===(c=e.values)||void 0===c||null===(v=c[0])||void 0===v?void 0:v.isNotTranslated)}),l.createElement(o.Row,{className:"border-none",label:U(""+(null==e||null===(p=e.values)||void 0===p||null===(m=p[1])||void 0===m?void 0:m.title)),textStyle:"APPROVED"==(null==e||null===(E=e.values)||void 0===E||null===(_=E[1])||void 0===_?void 0:_.value)||"AUTO_APPROVED"==(null==e||null===(f=e.values)||void 0===f||null===(A=f[1])||void 0===A?void 0:A.value)?{marginLeft:"10px",color:"#00703C"}:{marginLeft:"10px",color:"#D4351C"},text:je(null==e||null===(g=e.values)||void 0===g||null===(S=g[1])||void 0===S?void 0:S.value,null==e||null===(h=e.values)||void 0===h||null===(y=h[1])||void 0===y?void 0:y.isNotTranslated)}),null!=e&&null!==(D=e.values)&&void 0!==D&&null!==(T=D[2])&&void 0!==T&&T.value?l.createElement(o.Row,{className:"border-none",label:U(""+(null==e||null===(b=e.values)||void 0===b||null===(C=b[2])||void 0===C?void 0:C.title)),textStyle:{marginLeft:"10px"},text:je(null==e||null===(P=e.values)||void 0===P||null===(N=P[2])||void 0===N?void 0:N.value,null==e||null===(I=e.values)||void 0===I||null===(L=I[2])||void 0===L?void 0:L.isNotTranslated)}):null,null!=e&&null!==(B=e.values)&&void 0!==B&&null!==(O=B[3])&&void 0!==O&&O.value?l.createElement(o.Row,{className:"border-none",label:U(""+(null==e||null===(R=e.values)||void 0===R||null===(w=R[3])||void 0===w?void 0:w.title)),textStyle:{marginLeft:"10px"},text:je(null==e||null===(x=e.values)||void 0===x||null===(M=x[3])||void 0===M?void 0:M.value,null==e||null===(F=e.values)||void 0===F||null===(k=F[3])||void 0===k?void 0:k.isNotTranslated)}):null,null!=e&&null!==(H=e.values)&&void 0!==H&&null!==(W=H[3])&&void 0!==W&&W.value?l.createElement(o.Row,{className:"border-none",label:U(""+(null==e||null===(G=e.values)||void 0===G||null===(j=G[4])||void 0===j?void 0:j.title)),textStyle:{marginLeft:"10px"},text:je(null==e||null===(K=e.values)||void 0===K||null===(Y=K[4])||void 0===Y?void 0:Y.value,null==e||null===($=e.values)||void 0===$||null===(z=$[4])||void 0===z?void 0:z.isNotTranslated)}):null,l.createElement(o.Row,{className:"border-none",label:U(""+(null==t?void 0:t.title))})),l.createElement(o.StatusTable,null,null!=t&&t.values?l.createElement(Vl,{documents:Wt(null==t?void 0:t.values,!0),svgStyles:{},isSendBackFlow:!1,isHrLine:!0,titleStyles:{fontSize:"18px",lineHeight:"24px",fontWeight:700,marginBottom:"10px"}}):l.createElement("div",null,l.createElement(o.CardText,null,U("BPA_NO_DOCUMENTS_UPLOADED_LABEL")))))}):null,(null==e||!e.isTitleVisible)&&(null==e||null===(x=e.additionalDetails)||void 0===x||null===(M=x.permit)||void 0===M?void 0:M.length)>0?null==e||null===(F=e.additionalDetails)||void 0===F||null===(H=F.permit)||void 0===H?void 0:H.map(e=>l.createElement(o.CardText,null,null==e?void 0:e.title)):null,(null==e||null===(W=e.additionalDetails)||void 0===W?void 0:W.inspectionReport)&&(null==e?void 0:e.isFeeDetails)&&l.createElement(_n,{scrutinyDetails:null==e?void 0:e.additionalDetails,paymentsList:[]}),(null==e||null===(j=e.additionalDetails)||void 0===j?void 0:j.inspectionReport)&&(null==e?void 0:e.isFeeDetails)&&("POST_PAYMENT_CITIZEN_APPROVAL_PENDING"==(null===(K=he)||void 0===K||null===(Y=K.data)||void 0===Y||null===(X=Y.actionState)||void 0===X||null===(J=X.nextActions)||void 0===J||null===(ee=J[0])||void 0===ee?void 0:ee.state)||"POST_PAYMENT_CITIZEN_APPROVAL_PENDING"==(null===(te=he)||void 0===te||null===(le=te.data)||void 0===le||null===(ne=le.actionState)||void 0===ne?void 0:ne.state)||"POST_PAYMENT_INPROGRESS"==(null===(oe=he)||void 0===oe||null===(ae=oe.data)||void 0===ae||null===(re=ae.actionState)||void 0===re?void 0:re.state))&&l.createElement("div",{style:{marginTop:"19px",background:"#FAFAFA",border:"1px solid #D6D5D4",borderRadius:"4px",padding:"8px",lineHeight:"19px",maxWidth:"950px",minWidth:"280px"}},l.createElement(o.Row,{className:"border-none",label:U("BLOCKING_REASON"),labelStyle:{fontSize:"15px"},text:(null==fe?void 0:fe.applicationData.additionalDetails.blockingReason)||"NA"}," "))))),n===a.length-1&&l.createElement(o.Card,null,l.createElement(t.Fragment,null,l.createElement("div",{id:"timeline"},l.createElement(rn,{application:null==fe?void 0:fe.applicationData,id:k}),!(null!==(ue=he)&&void 0!==ue&&ue.isLoading)&&(null===(de=he)||void 0===de||null===(se=de.data)||void 0===se||null===(ce=se.nextActions)||void 0===ce?void 0:ce.length)>0&&!pe&&ie&&l.createElement(o.CheckBox,{styles:{margin:"20px 0 40px",paddingTop:"10px"},checked:$,label:l.createElement("div",null,l.createElement("span",null,U("BPA_I_AGREE_THE_LABEL")+" "),l.createElement("span",{style:{color:"#a82227",cursor:"pointer"},onClick:()=>Q(!Z)},U("BPA_TERMS_AND_CONDITIONS_LABEL"))),onChange:()=>{z(!$),$&&q(!$)}})),!(null!==(ve=he)&&void 0!==ve&&ve.isLoading)&&(null===(me=he)||void 0===me||null===(Ee=me.data)||void 0===Ee||null===(_e=Ee.nextActions)||void 0===_e?void 0:_e.length)>1&&l.createElement(o.ActionBar,null,l.createElement("div",{style:{width:"100%"}},V&&null!==(Ae=he)&&void 0!==Ae&&null!==(ge=Ae.data)&&void 0!==ge&&ge.nextActions?l.createElement(o.Menu,{localeKeyPrefix:"WF_BPA",options:null===(Se=he)||void 0===Se||null===(De=Se.data)||void 0===De?void 0:De.nextActions.map(e=>e.action),t:U,onSelect:Ye}):null,l.createElement(o.SubmitBar,{disabled:$e()||"CITIZEN_APPROVAL_PENDING"===(null===(Te=he)||void 0===Te||null===(be=Te.data)||void 0===be||null===(Ce=be.actionState)||void 0===Ce?void 0:Ce.state)&&(!ye||!we||!Ge),label:U("ES_COMMON_TAKE_ACTION"),onSubmit:()=>q(!V)}))),!(null!==(Pe=he)&&void 0!==Pe&&Pe.isLoading)&&1==(null===(Ne=he)||void 0===Ne||null===(Ie=Ne.data)||void 0===Ie||null===(Le=Ie.nextActions)||void 0===Le?void 0:Le.length)&&l.createElement(o.ActionBar,null,l.createElement("div",{style:{width:"100%"}},l.createElement("button",{style:{color:"#FFFFFF",fontSize:G?"19px":"initial"},className:$e()?"submit-bar-disabled":"submit-bar",disabled:$e(),name:null===(Be=he)||void 0===Be||null===(Oe=Be.data)||void 0===Oe||null===(Re=Oe.nextActions)||void 0===Re||null===(xe=Re[0])||void 0===xe?void 0:xe.action,value:null===(Me=he)||void 0===Me||null===(Fe=Me.data)||void 0===Fe||null===(ke=Fe.nextActions)||void 0===ke||null===(Ue=ke[0])||void 0===Ue?void 0:Ue.action,onClick:e=>{Ye(e.target.value)}},U("WF_BPA_"+(null===(He=he)||void 0===He||null===(We=He.data)||void 0===We||null===(Ke=We.nextActions)||void 0===Ke||null===(ze=Ke[0])||void 0===ze?void 0:ze.action))))))))}),"CITIZEN_APPROVAL_PENDING"===(null===(B=he)||void 0===B||null===(O=B.data)||void 0===O||null===(R=O.actionState)||void 0===R?void 0:R.state)&&l.createElement("div",null,l.createElement(o.Card,null,l.createElement(l.Fragment,null,l.createElement("div",null,l.createElement(o.CardLabel,null,U("ARCHITECT_SHOULD_VERIFY_HIMSELF_BY_CLICKING_BELOW_BUTTON")),l.createElement(o.LinkButton,{label:U("BPA_VERIFY"),onClick:()=>{Pe(!0)}}),l.createElement("br",null),Ce&&l.createElement(l.Fragment,null,l.createElement("br",null),l.createElement(o.CardLabel,null,U("BPA_MOBILE_NUMBER")),l.createElement(o.TextInput,{t:U,type:"tel",isMandatory:!0,optionKey:"i18nKey",name:"mobileNumber",value:Ne,onChange:e=>{Ie(e.target.value)},required:!0,pattern:"[0-9]{10}",type:"tel",title:U("CORE_COMMON_APPLICANT_MOBILE_NUMBER_INVALID")}),l.createElement(o.LinkButton,{label:U("BPA_GET_OTP"),onClick:function(){try{const e=m(function(){var e,t;return Promise.resolve(Digit.UserService.sendOtp({otp:{mobileNumber:Ne,tenantId:null==se||null===(e=se.info)||void 0===e?void 0:e.tenantId,userType:null==se||null===(t=se.info)||void 0===t?void 0:t.type,type:"login"}})).then(function(e){e.isSuccessful?Be(!0):console.error("Error sending OTP Response is false:",e.error)})},function(e){console.error("Error sending OTP:",e)});return Promise.resolve(e&&e.then?e.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},disabled:!We})),Le&&l.createElement(l.Fragment,null,l.createElement("br",null),l.createElement(o.CardLabel,null,U("BPA_OTP")),l.createElement(o.TextInput,{t:U,type:"text",isMandatory:!0,optionKey:"i18nKey",name:"otp",value:Oe,onChange:e=>{Re(e.target.value)},required:!0,pattern:"[0-9]{6}",type:"tel",title:U("BPA_INVALID_OTP")}),l.createElement(o.SubmitBar,{label:U("VERIFY_OTP"),onSubmit:function(){try{const e=m(function(){return Promise.resolve(Digit.UserService.authenticate(He)).then(function(e){if("Access Token generated successfully"===e.ResponseInfo.status){xe(!0),Fe(U("VERIFIED"));const e=new Date;Ue(e),sessionStorage.setItem("otpVerifiedTimestampcitizen",e.toISOString())}else xe(!1),Fe(U("WRONG OTP"))})},function(e){console.error("Error verifying OTP:",e),xe(!1),Fe(U("Error verifying OTP"))});return Promise.resolve(e&&e.then?e.then(function(){}):void 0)}catch(e){return Promise.reject(e)}}}),Me&&l.createElement(o.CardLabel,{style:{color:"red"}},Me))),l.createElement("br",null),l.createElement("div",null,l.createElement(o.CheckBox,{label:l.createElement("div",null,U("I_AGREE_TO_BELOW_UNDERTAKING"),l.createElement(o.LinkButton,{label:U("DECLARATION_UNDER_SELF_CERTIFICATION_SCHEME"),onClick:()=>{we?be(!0):alert("Please verify yourself")}})),onChange:()=>{De(!ye)},styles:{height:"auto"}}),Te&&l.createElement(fn,{showTermsPopup:Te,setShowTermsPopup:be,otpVerifiedTimestamp:ke}))))),Z?l.createElement(vn,{t:U,action:"TERMS_AND_CONDITIONS",tenantId:H,id:k,closeModal:()=>{Q(!1)},submitAction:ze,applicationData:(null==fe?void 0:fe.applicationData)||{}}):null,X?l.createElement(vn,{t:U,action:ee,tenantId:H,id:k,closeModal:()=>{te(null),J(!1)},submitAction:ze,actionData:null===(w=he)||void 0===w||null===(x=w.data)||void 0===x?void 0:x.timeline}):null,K&&l.createElement(o.Toast,{error:"error"===K.key,label:U("success"===K.key?`ES_OBPS_${K.action}_UPDATE_SUCCESS`:K.action),onClose:Ke,style:{zIndex:"1000"}}))},ObpsBPASendToArchitect:e=>{var a,r,d,s,c,v,p;sessionStorage.setItem("BPA_SUBMIT_APP",JSON.stringify("BPA_SUBMIT_APP"));const m=u.useQueryClient(),E=i.useRouteMatch(),{t:_}=n.useTranslation(),{applicationNo:f,tenantId:A}=i.useParams(),{pathname:g}=i.useLocation(),S=i.useHistory();let h=[],y={};const[D,T,b]=Digit.Hooks.useSessionStorage("BUILDING_PERMIT_EDITFLOW",{}),C=Digit.ULBService.getStateId();let{data:P}=Digit.Hooks.obps.SearchMdmsTypes.getFormConfig(C,[]);const{data:N}=Digit.Hooks.obps.useMDMS(Digit.ULBService.getStateId(),"BPA",["RiskTypeComputation"]),{data:I,isLoading:L}=Digit.Hooks.obps.useBPASearch(A,{applicationNo:f});let B={edcrNumber:null==I||null===(a=I[0])||void 0===a?void 0:a.edcrNumber};const{data:O,isLoading:R}=Digit.Hooks.obps.useScrutinyDetails(Digit.ULBService.getStateId(),B,{enabled:!!B.edcrNumber});let w=f;const{data:x,isLoading:M}=Digit.Hooks.obps.useNocDetails(A,{sourceRefId:w}),F=window.location.href.includes("editApplication");t.useEffect(function(){try{let e=sessionStorage.getItem("BPA_IS_ALREADY_WENT_OFF_DETAILS");e=!e||JSON.parse(e);const t=function(){if(!(e||M||L||R)){y=I?I[0]:{};const e=function(){if(O&&x)return y=I[0],F&&(y.isEditApplication=!0),sessionStorage.setItem("bpaInitialObject",JSON.stringify({...y})),Promise.resolve(function(e,t,l,n,i){try{var o,a,r,u,d,s,c,v,p,m,E,_,f,A,g,S,h,y,D,T,b,C,P,N,I,L,B,O,R,w,x,M,F,k,U,H,W;const G=e=>{let t=[],l=[],n={};return e&&e.map((e,o)=>{var a;t=null!=e&&e.usageCategory?null==e||null===(a=e.usageCategory)||void 0===a?void 0:a.split(","):[],l=[],t&&t.map((e,t)=>{l.push({code:e,i18nKey:"BPA_SUBOCCUPANCYTYPE_"+e.replaceAll(".","_"),name:i("BPA_SUBOCCUPANCYTYPE_"+e.replaceAll(".","_"))})}),l&&(n["Block_"+(o+1)]=l)}),n};e.BlockIds=(e=>{let t={};return e&&e.map((e,l)=>{t["Block_"+(l+1)]=e.id}),t})(null==e||null===(o=e.landInfo)||void 0===o?void 0:o.unit),e.address=null==e||null===(a=e.landInfo)||void 0===a?void 0:a.address,e.address.city={code:null==e||null===(r=e.landInfo)||void 0===r||null===(u=r.address)||void 0===u?void 0:u.city,name:null==e||null===(d=e.landInfo)||void 0===d||null===(s=d.address)||void 0===s||null===(c=s.city)||void 0===c?void 0:c.split(".")[1]},e.address.locality={...null==e||null===(v=e.landInfo)||void 0===v||null===(p=v.address)||void 0===p?void 0:p.locality,i18nkey:null==e||null===(m=e.landInfo)||void 0===m||null===(E=m.address)||void 0===E||null===(_=E.locality)||void 0===_?void 0:_.name},e.data={applicantName:null==t||null===(f=t.planDetail)||void 0===f||null===(A=f.planInformation)||void 0===A?void 0:A.applicantName,applicationDate:null==e||null===(g=e.auditDetails)||void 0===g?void 0:g.createdTime,applicationType:null==t?void 0:t.appliactionType,holdingNumber:null==e||null===(S=e.additionalDetails)||void 0===S?void 0:S.holdingNo,boundaryWallLength:null==e||null===(h=e.additionalDetails)||void 0===h?void 0:h.boundaryWallLength,occupancyType:null==t||null===(y=t.planDetail)||void 0===y||null===(D=y.planInformation)||void 0===D?void 0:D.occupancy,registrationDetails:null==e||null===(T=e.additionalDetails)||void 0===T?void 0:T.registrationDetails,riskType:Digit.Utils.obps.calculateRiskType(null==l||null===(b=l.BPA)||void 0===b?void 0:b.RiskTypeComputation,null==t||null===(C=t.planDetail)||void 0===C||null===(P=C.plot)||void 0===P?void 0:P.area,null==t||null===(N=t.planDetail)||void 0===N?void 0:N.blocks),serviceType:(null==e||null===(I=e.additionalDetails)||void 0===I?void 0:I.serviceType)||(null==t?void 0:t.applicationSubType),scrutinyNumber:{edcrNumber:null==e?void 0:e.edcrNumber}},e.PrevStateDocuments=null==e?void 0:e.documents,e.documents={documents:[]};let j=[];return n&&n.map((e,t)=>{e.documents&&e.documents.map((e,t)=>{j.push(e)})}),e.PrevStateNocDocuments=j,e.nocDocuments={NocDetails:n,nocDocuments:[]},null==e||e.landInfo.owners.map((e,t)=>{e.gender={active:!0,code:e.gender,i18nKey:"COMMON_GENDER_"+e.gender}}),e.owners={owners:null==e||null===(L=e.landInfo)||void 0===L?void 0:L.owners,ownershipCategory:{active:!0,code:null==e||null===(B=e.landInfo)||void 0===B?void 0:B.ownershipCategory,i18nKey:"COMMON_MASTERS_OWNERSHIPCATEGORY_"+(null==e||null===(O=e.landInfo)||void 0===O?void 0:O.ownershipCategory.replaceAll(".","_"))}},e.riskType=Digit.Utils.obps.calculateRiskType(null==l||null===(R=l.BPA)||void 0===R?void 0:R.RiskTypeComputation,null==t||null===(w=t.planDetail)||void 0===w||null===(x=w.plot)||void 0===x?void 0:x.area,null==t||null===(M=t.planDetail)||void 0===M?void 0:M.blocks),e.subOccupancy=G(null==e||null===(F=e.landInfo)||void 0===F?void 0:F.unit),e.uiFlow={flow:null==e||null===(k=e.businessService)||void 0===k||null===(U=k.split("."))||void 0===U?void 0:U[0],applicationType:(null==e||null===(H=e.additionalDetails)||void 0===H?void 0:H.applicationType)||(null==t?void 0:t.appliactionType),serviceType:(null==e||null===(W=e.additionalDetails)||void 0===W?void 0:W.serviceType)||(null==t?void 0:t.applicationSubType)},sessionStorage.setItem("BPA_IS_ALREADY_WENT_OFF_DETAILS",JSON.stringify(!0)),Promise.resolve(e)}catch(e){return Promise.reject(e)}}(y,O,N,x,_)).then(function(e){T({...D,...e})})}();if(e&&e.then)return e.then(function(){})}}();return Promise.resolve(t&&t.then?t.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},[I,O,N,x,D]);const k=(e,t,l,n)=>{T(n?t:{...D,[e]:{...D[e],...t}}),(e=>{var t;const l=null==g||null===(t=g.split("/"))||void 0===t?void 0:t.pop(),{nextStep:n}=h.find(e=>e.route===l);let i=S.push;if(null===n)return i(An(E.path,E.params)+"/check");i(`${An(E.path,E.params)}/${n}`)})()},U=()=>{};P=null!==(r=P)&&void 0!==r&&r.BuildingPermitConfig?null===(d=P)||void 0===d?void 0:d.BuildingPermitConfig:en,P.forEach(e=>{h=h.concat(e.body.filter(e=>!e.hideInCitizen))}),h.indexRoute="check",t.useEffect(()=>{sessionStorage.getItem("isPermitApplication")&&"true"==sessionStorage.getItem("isPermitApplication")&&(b(),sessionStorage.setItem("isPermitApplication",!1))},[]);const H=null===(s=Digit)||void 0===s||null===(c=s.ComponentRegistryService)||void 0===c?void 0:c.getComponent("BPACheckPage"),W=null===(v=Digit)||void 0===v||null===(p=v.ComponentRegistryService)||void 0===p?void 0:p.getComponent("BPAAcknowledgement");return M||L||R?l.createElement(o.Loader,null):l.createElement(i.Switch,null,h.map((e,t)=>{const{component:n,texts:o,inputs:a,key:r}=e,u="string"==typeof n?Digit.ComponentRegistryService.getComponent(n):n;return l.createElement(i.Route,{path:`${An(E.path,E.params)}/${e.route}`,key:t},l.createElement(u,{config:{texts:o,inputs:a,key:r},onSelect:k,onSkip:U,t:_,formData:D}))}),l.createElement(i.Route,{path:An(E.path,E.params)+"/check"},l.createElement(H,{onSubmit:function(){try{return S.push(An(E.path,E.params)+"/acknowledgement"),Promise.resolve()}catch(e){return Promise.reject(e)}},value:D})),l.createElement(i.Route,{path:An(E.path,E.params)+"/acknowledgement"},l.createElement(W,{data:D,onSuccess:()=>{m.invalidateQueries("PT_CREATE_PROPERTY")}})),l.createElement(i.Route,null,O&&l.createElement(i.Redirect,{to:`${An(E.path,E.params)}/${h.indexRoute}`})))},ObpsOCSendToArchitect:e=>{var a,r,d,s,c,v,p,m;sessionStorage.setItem("BPA_SUBMIT_APP",JSON.stringify("BPA_SUBMIT_APP"));const E=u.useQueryClient(),_=i.useRouteMatch(),{t:f}=n.useTranslation(),{applicationNo:A,tenantId:g}=i.useParams(),{pathname:S}=i.useLocation(),h=i.useHistory();let y=[],D={};const[T,b,C]=Digit.Hooks.useSessionStorage("OC_BUILDING_PERMIT_EDITFLOW",{}),P=Digit.ULBService.getStateId();let{data:N}=Digit.Hooks.obps.SearchMdmsTypes.getFormConfig(P,[]);const{data:I}=Digit.Hooks.obps.useMDMS(Digit.ULBService.getStateId(),"BPA",["RiskTypeComputation"]),{data:L,isLoading:B}=Digit.Hooks.obps.useBPASearch(g,{applicationNo:A});let O={edcrNumber:null==L||null===(a=L[0])||void 0===a?void 0:a.edcrNumber};const{data:R,isLoading:w}=Digit.Hooks.obps.useScrutinyDetails(Digit.ULBService.getStateId(),O,{enabled:!(null==L||null===(r=L[0])||void 0===r||!r.edcrNumber)});let x=null==R?void 0:R.permitNumber;const{data:M}=Digit.Hooks.obps.useOCEdcrSearch(g,{approvalNo:x},{enabled:!(!x||null==R||!R.permitNumber)},O);let F=A;const{data:k,isLoading:U}=Digit.Hooks.obps.useNocDetails(g,{sourceRefId:F}),H=window.location.href.includes("editApplication");JSON.parse(sessionStorage.getItem("tl-trade")),t.useEffect(function(){try{let e=sessionStorage.getItem("BPA_IS_ALREADY_WENT_OFF_DETAILS");e=!e||JSON.parse(e);const t=function(){if(!(e||U||B||w)){D=L?L[0]:{};const e=function(){if(R&&M)return D=L[0],H&&(D.isEditApplication=!0),sessionStorage.setItem("bpaInitialObject",JSON.stringify({...D})),Promise.resolve(function(e,t,l,n,i,o){try{var a,r,u,d,s,c,v,p,m,E,_,f,A,g,S,h,y,D,T,b,C,P,N;const I=e=>{let t=[],l=[],n={};return e&&e.map((e,o)=>{var a;t=null!=e&&e.usageCategory?null==e||null===(a=e.usageCategory)||void 0===a?void 0:a.split(","):[],l=[],t&&t.map((e,t)=>{l.push({code:e,i18nKey:"BPA_SUBOCCUPANCYTYPE_"+e.replaceAll(".","_"),name:i("BPA_SUBOCCUPANCYTYPE_"+e.replaceAll(".","_"))})}),l&&(n["Block_"+(o+1)]=l)}),n};e.address=null==e||null===(a=e.landInfo)||void 0===a?void 0:a.address,e.additionalDetails={...null==e?void 0:e.additionalDetails,applicationType:null==t?void 0:t.appliactionType,holdingNo:null==e||null===(r=e.additionalDetails)||void 0===r?void 0:r.holdingNo,landId:null==e||null===(u=e.landInfo)||void 0===u?void 0:u.id,serviceType:(null==e||null===(d=e.additionalDetails)||void 0===d?void 0:d.serviceType)||(null==t?void 0:t.applicationSubType)},e.data={applicantName:null==t||null===(s=t.planDetail)||void 0===s||null===(c=s.planInformation)||void 0===c?void 0:c.applicantName,applicationDate:null==e||null===(v=e.auditDetails)||void 0===v?void 0:v.createdTime,applicationType:null==t?void 0:t.appliactionType,holdingNumber:null==e||null===(p=e.additionalDetails)||void 0===p?void 0:p.holdingNo,bpaData:o,occupancyType:null==t||null===(m=t.planDetail)||void 0===m||null===(E=m.planInformation)||void 0===E?void 0:E.occupancy,registrationDetails:null==e||null===(_=e.additionalDetails)||void 0===_?void 0:_.registrationDetails,riskType:Digit.Utils.obps.calculateRiskType(null==l||null===(f=l.BPA)||void 0===f?void 0:f.RiskTypeComputation,null==t||null===(A=t.planDetail)||void 0===A||null===(g=A.plot)||void 0===g?void 0:g.area,null==t||null===(S=t.planDetail)||void 0===S?void 0:S.blocks),serviceType:(null==e||null===(h=e.additionalDetails)||void 0===h?void 0:h.serviceType)||(null==t?void 0:t.applicationSubType),edcrDetails:t,scrutinyNumber:{edcrNumber:null==t?void 0:t.edcrNumber}},e.PrevStateDocuments=null==e?void 0:e.documents,e.documents={documents:[]};let L=[];return n&&n.map((e,t)=>{e.documents&&e.documents.map((e,t)=>{L.push(e)})}),e.PrevStateNocDocuments=L,e.nocDocuments={NocDetails:n,nocDocuments:[]},e.riskType=Digit.Utils.obps.calculateRiskType(null==l||null===(y=l.BPA)||void 0===y?void 0:y.RiskTypeComputation,null==t||null===(D=t.planDetail)||void 0===D||null===(T=D.plot)||void 0===T?void 0:T.area,null==t||null===(b=t.planDetail)||void 0===b?void 0:b.blocks),e.subOccupancy=I(null==e||null===(C=e.landInfo)||void 0===C?void 0:C.unit),e.uiFlow={flow:"OCBPA",applicationType:(null==e||null===(P=e.additionalDetails)||void 0===P?void 0:P.applicationType)||(null==t?void 0:t.appliactionType),serviceType:(null==e||null===(N=e.additionalDetails)||void 0===N?void 0:N.serviceType)||(null==t?void 0:t.applicationSubType)},sessionStorage.setItem("BPA_IS_ALREADY_WENT_OFF_DETAILS",JSON.stringify(!0)),Promise.resolve(e)}catch(e){return Promise.reject(e)}}(D,R,I,k,f,M)).then(function(e){b({...T,...e})})}();if(e&&e.then)return e.then(function(){})}}();return Promise.resolve(t&&t.then?t.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},[L,R,I,k,M]);const W=(e,t,l,n)=>{b(n?t:{...T,[e]:{...T[e],...t}}),(e=>{var t;const l=null==S||null===(t=S.split("/"))||void 0===t?void 0:t.pop(),{nextStep:n}=y.find(e=>e.route===l);let i=h.push;if(null===n)return i(gn(_.path,_.params)+"/check");i(`${gn(_.path,_.params)}/${n}`)})()},G=()=>{};N=null!==(d=N)&&void 0!==d&&d.OCBuildingPermitConfig?null===(s=N)||void 0===s?void 0:s.OCBuildingPermitConfig:nn,N.forEach(e=>{y=y.concat(e.body.filter(e=>!e.hideInCitizen))}),y.indexRoute="check",t.useEffect(()=>{sessionStorage.getItem("isPermitApplication")&&"true"==sessionStorage.getItem("isPermitApplication")&&(C(),sessionStorage.setItem("isPermitApplication",!1))},[]);const j=null===(c=Digit)||void 0===c||null===(v=c.ComponentRegistryService)||void 0===v?void 0:v.getComponent("OCBPACheckPage"),K=null===(p=Digit)||void 0===p||null===(m=p.ComponentRegistryService)||void 0===m?void 0:m.getComponent("OCBPAAcknowledgement");return U||B||w?l.createElement(o.Loader,null):l.createElement(i.Switch,null,y.map((e,t)=>{const{component:n,texts:o,inputs:a,key:r}=e,u="string"==typeof n?Digit.ComponentRegistryService.getComponent(n):n;return l.createElement(i.Route,{path:`${gn(_.path,_.params)}/${e.route}`,key:t},l.createElement(u,{config:{texts:o,inputs:a,key:r},onSelect:W,onSkip:G,t:f,formData:T}))}),l.createElement(i.Route,{path:gn(_.path,_.params)+"/check"},l.createElement(j,{onSubmit:function(){try{return h.push(gn(_.path,_.params)+"/acknowledgement"),Promise.resolve()}catch(e){return Promise.reject(e)}},value:T})),l.createElement(i.Route,{path:gn(_.path,_.params)+"/acknowledgement"},l.createElement(K,{data:T,onSuccess:()=>{E.invalidateQueries("PT_CREATE_PROPERTY")}})),l.createElement(i.Route,null,R&&M&&l.createElement(i.Redirect,{to:`${gn(_.path,_.params)}/${y.indexRoute}`})))},ObpsBPASendBackToCitizen:e=>{var o,a,r,d,s,c,v,p;const{t:m}=n.useTranslation(),E=u.useQueryClient(),_=i.useRouteMatch(),{pathname:f}=i.useLocation(),A=i.useHistory(),g=Digit.ULBService.getStateId(),{applicationNo:S,tenantId:h}=i.useParams();sessionStorage.setItem("BPA_SUBMIT_APP",JSON.stringify("BPA_SUBMIT_APP"));let y=[],D={};const[T,b,C]=Digit.Hooks.useSessionStorage("BUILDING_PERMIT_EDITFLOW",{}),P=Digit.ULBService.getStateId();let{data:N}=Digit.Hooks.obps.SearchMdmsTypes.getFormConfig(P,[]);const{data:I}=Digit.Hooks.obps.useMDMS(g,"BPA",["RiskTypeComputation"]),{data:L,isLoading:B}=Digit.Hooks.obps.useBPASearch(h,{applicationNo:S});let O={edcrNumber:null==L||null===(o=L[0])||void 0===o?void 0:o.edcrNumber},R=S;const{data:w,isLoading:x}=Digit.Hooks.obps.useScrutinyDetails(g,O,{enabled:!(null==L||null===(a=L[0])||void 0===a||!a.edcrNumber)}),{data:M,isLoading:F}=Digit.Hooks.obps.useNocDetails(h,{sourceRefId:R}),k=window.location.href.includes("editApplication");t.useEffect(function(){try{let e=sessionStorage.getItem("BPA_IS_ALREADY_WENT_OFF_DETAILS");e=!e||JSON.parse(e);const t=function(){if(!(e||F||B||x)){D=L?L[0]:{};const e=function(){if(L&&D&&w&&I&&M)return D=L[0],k&&(D.isEditApplication=!0),sessionStorage.setItem("bpaInitialObject",JSON.stringify({...D})),Promise.resolve(Rt(D,w,I,M,m)).then(function(e){b({...T,...e})})}();if(e&&e.then)return e.then(function(){})}}();return Promise.resolve(t&&t.then?t.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},[L,w,I,M]);const U=(e,t,l,n)=>{b(n?t:{...T,[e]:{...T[e],...t}}),(e=>{const t=f.split("/").pop(),{nextStep:l}=y.find(e=>e.route===t);let n=A.push;if(null===l)return n(wt(_.path,_.params)+"/check");n(`${wt(_.path,_.params)}/${l}`)})()},H=()=>{};N=null!==(r=N)&&void 0!==r&&r.BuildingPermitConfig?null===(d=N)||void 0===d?void 0:d.BuildingPermitConfig:en,N.forEach(e=>{y=y.concat(e.body.filter(e=>!e.hideInCitizen))}),y.indexRoute="check",t.useEffect(()=>{sessionStorage.getItem("isPermitApplication")&&"true"==sessionStorage.getItem("isPermitApplication")&&(C(),sessionStorage.setItem("isPermitApplication",!1))},[]);const W=null===(s=Digit)||void 0===s||null===(c=s.ComponentRegistryService)||void 0===c?void 0:c.getComponent("OCBPASendBackCheckPage"),G=null===(v=Digit)||void 0===v||null===(p=v.ComponentRegistryService)||void 0===p?void 0:p.getComponent("OCSendBackAcknowledgement");return console.log("+"),l.createElement(i.Switch,null,y.map((e,t)=>{const{component:n,texts:o,inputs:a,key:r}=e,u="string"==typeof n?Digit.ComponentRegistryService.getComponent(n):n;return l.createElement(i.Route,{path:`${wt(_.path,_.params)}/${e.route}`,key:t},l.createElement(u,{config:{texts:o,inputs:a,key:r},onSelect:U,onSkip:H,t:m,formData:T}))}),l.createElement(i.Route,{path:wt(_.path,_.params)+"/check"},l.createElement(W,{onSubmit:function(){try{return A.push(wt(_.path,_.params)+"/acknowledgement"),Promise.resolve()}catch(e){return Promise.reject(e)}},value:T})),l.createElement(i.Route,{path:wt(_.path,_.params)+"/acknowledgement"},l.createElement(G,{data:T,onSuccess:()=>{E.invalidateQueries("PT_CREATE_PROPERTY")}})),l.createElement(i.Route,null,l.createElement(i.Redirect,{to:`${wt(_.path,_.params)}/${y.indexRoute}`})))},ObpsOCSendBackToCitizen:e=>{var a,r,d,s,c,v,p,m;sessionStorage.setItem("BPA_SUBMIT_APP",JSON.stringify("BPA_SUBMIT_APP"));const{t:E}=n.useTranslation(),_=u.useQueryClient(),f=i.useRouteMatch(),{pathname:A}=i.useLocation(),g=i.useHistory(),S=Digit.ULBService.getStateId(),{applicationNo:h,tenantId:y}=i.useParams();let D=[],T={};const[b,C,P]=Digit.Hooks.useSessionStorage("BUILDING_PERMIT_EDITFLOW",{}),N=Digit.ULBService.getStateId();let{data:I}=Digit.Hooks.obps.SearchMdmsTypes.getFormConfig(N,[]);const{isMdmsLoading:L,data:B}=Digit.Hooks.obps.useMDMS(S,"BPA",["RiskTypeComputation","homePageUrlLinks"]),{data:O,isLoading:R}=Digit.Hooks.obps.useBPASearch(y,{applicationNo:h});let w={edcrNumber:null==O||null===(a=O[0])||void 0===a?void 0:a.edcrNumber},x=h;const{data:M,isLoading:F}=Digit.Hooks.obps.useScrutinyDetails(S,w,{enabled:!(null==O||null===(r=O[0])||void 0===r||!r.edcrNumber)}),{data:k,isLoading:U}=Digit.Hooks.obps.useNocDetails(y,{sourceRefId:x}),H=window.location.href.includes("editApplication");t.useEffect(function(){try{let e=sessionStorage.getItem("BPA_IS_ALREADY_WENT_OFF_DETAILS");e=!e||JSON.parse(e);const t=function(){if(!(e||U||R||F||L)){T=O?O[0]:{};const e=function(){if(O&&T&&M&&B&&k)return T=O[0],H&&(T.isEditApplication=!0),sessionStorage.setItem("bpaInitialObject",JSON.stringify({...T})),Promise.resolve(Rt(T,M,B,k,E)).then(function(e){C({...b,...e})})}();if(e&&e.then)return e.then(function(){})}}();return Promise.resolve(t&&t.then?t.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},[O,M,B,k]);const W=(e,t,l,n)=>{C(n?t:{...b,[e]:{...b[e],...t}}),(e=>{const t=A.split("/").pop(),{nextStep:l}=D.find(e=>e.route===t);let n=g.push;if(null===l)return n(wt(f.path,f.params)+"/check");n(`${wt(f.path,f.params)}/${l}`)})()},G=()=>{};I=null!==(d=I)&&void 0!==d&&d.OCBuildingPermitConfig?null===(s=I)||void 0===s?void 0:s.OCBuildingPermitConfig:nn,I.forEach(e=>{D=D.concat(e.body.filter(e=>!e.hideInCitizen))}),D.indexRoute="check",t.useEffect(()=>{sessionStorage.getItem("isPermitApplication")&&"true"==sessionStorage.getItem("isPermitApplication")&&(P(),sessionStorage.setItem("isPermitApplication",!1))},[]);const j=null===(c=Digit)||void 0===c||null===(v=c.ComponentRegistryService)||void 0===v?void 0:v.getComponent("OCBPASendBackCheckPage"),K=null===(p=Digit)||void 0===p||null===(m=p.ComponentRegistryService)||void 0===m?void 0:m.getComponent("OCSendBackAcknowledgement");return U||R||F?l.createElement(o.Loader,null):l.createElement(i.Switch,null,D.map((e,t)=>{const{component:n,texts:o,inputs:a,key:r}=e,u="string"==typeof n?Digit.ComponentRegistryService.getComponent(n):n;return l.createElement(i.Route,{path:`${wt(f.path,f.params)}/${e.route}`,key:t},l.createElement(u,{config:{texts:o,inputs:a,key:r},onSelect:W,onSkip:G,t:E,formData:b}))}),l.createElement(i.Route,{path:wt(f.path,f.params)+"/check"},l.createElement(j,{onSubmit:function(){return Promise.resolve()},value:b})),l.createElement(i.Route,{path:wt(f.path,f.params)+"/acknowledgement"},l.createElement(K,{data:b,onSuccess:()=>{_.invalidateQueries("PT_CREATE_PROPERTY")}})),l.createElement(i.Route,null,l.createElement(i.Redirect,{to:`${wt(f.path,f.params)}/${D.indexRoute}`})))},ObpsEdcrInbox:e=>{let{parentRoute:i}=e;window.scroll(0,0);const{t:r}=n.useTranslation(),u=Digit.ULBService.getCurrentTenantId(),d={},c={appliactionType:"",status:""},v={sortBy:"createdDate",limit:Digit.Utils.browser.isMobile()?50:10,offset:0,sortOrder:"DESC"},p=Digit.SessionStorage.get("EDCR.INBOX"),m=t.useMemo(()=>"IS_EDCR_BACK"===Digit.SessionStorage.get("EDCR_BACK")?{filterForm:c,searchForm:d,tableForm:v}:p||{filterForm:c,searchForm:d,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)||{})]),[E,_]=t.useReducer(function(e,t){switch(t.action){case"mutateSearchForm":return Digit.SessionStorage.set("EDCR.INBOX",{...e,searchForm:t.data}),{...e,searchForm:t.data};case"mutateFilterForm":return Digit.SessionStorage.set("EDCR.INBOX",{...e,filterForm:t.data}),{...e,filterForm:t.data};case"mutateTableForm":return Digit.SessionStorage.set("EDCR.INBOX",{...e,tableForm:t.data}),{...e,tableForm:t.data}}},m),{isLoading:f,data:{table:A,totalCount:g}={}}=Digit.Hooks.obps.useEDCRInbox({tenantId:u,filters:{...E}}),S={logoIcon:l.createElement(o.CaseIcon,null),headerText:"ACTION_TEST_EDCR_SCRUTINY",links:[{link:"/digit-ui/citizen/obps/edcrscrutiny/apply",text:r("BPA_PLAN_SCRUTINY_FOR_NEW_CONSTRUCTION_LABEL")},{link:"/digit-ui/citizen/obps/edcrscrutiny/oc-apply",text:r("BPA_OC_PLAN_SCRUTINY_FOR_NEW_CONSTRUCTION_LABEL")}]},h=t.useCallback(e=>{let{registerRef:t,searchFormState:n,searchFieldComponents:i}=e;return l.createElement(hn,{registerRef:t,searchFormState:n,searchFieldComponents:i})},[]),y=t.useCallback(e=>{let{registerRef:t,controlFilterForm:n,setFilterFormValue:i,getFilterFormValue:o}=e;return l.createElement(Sn,{isInboxLoading:f,registerRef:t,controlFilterForm:n,setFilterFormValue:i,filterFormState:null==E?void 0:E.filterForm,getFilterFormValue:o})},[f]),D={SearchFormFields:h,onSearchFormSubmit:e=>{e.hasOwnProperty("")&&(null==e||delete e[""]),_({action:"mutateTableForm",data:{...v}}),_({action:"mutateSearchForm",data:e})},searchFormDefaultValues:null==E?void 0:E.searchForm,resetSearchFormDefaultValues:d,onSearchFormReset:e=>{e("edcrNumber",null),e("applicationNumber",null),_({action:"mutateSearchForm",data:d})}},T={FilterFormFields:y,onFilterFormSubmit:e=>{e.hasOwnProperty("")&&(null==e||delete e[""]),_({action:"mutateTableForm",data:{...v}}),_({action:"mutateFilterForm",data:e})},filterFormDefaultValues:null==E?void 0:E.filterForm,resetFilterFormDefaultValues:c,onFilterFormReset:e=>{e("status",""),e("appliactionType",""),_({action:"mutateFilterForm",data:c})}},b=(e=>{var i,o,a,r;let{onPageSizeChange:u,formState:d,totalCount:s,table:c,dispatch:v,onSortingByData:p}=e;const{t:m}=n.useTranslation(),E=t.useMemo(()=>[{Header:m("EDCR_COMMON_TABLE_APPL_NO"),disableSortBy:!0,Cell:e=>{let{row:t}=e;return l.createElement("div",null,l.createElement("span",{className:""},t.original.applicationId))}},{Header:m("CS_APPLICATION_DETAILS_APPLICATION_DATE"),accessor:"createdDate",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))(Hl(new Date(null===(n=i.original)||void 0===n?void 0:n.date),"dd/MM/yyyy")):""}},{Header:m("EDCR_COMMON_TABLE_CITY_LABEL"),accessor:e=>m(null==e?void 0:e.locality),disableSortBy:!0},{Header:m("EDCR_COMMON_TABLE_APPL_NAME"),accessor:e=>null==e?void 0:e.owner,disableSortBy:!0},{Header:m("EDCR_COMMON_TABLE_SCRUTINY_NO"),disableSortBy:!0,Cell:e=>{var t;let{row:n}=e;return l.createElement("div",null,"null"!==(null===(t=n.original)||void 0===t?void 0:t.edcrNumber)?l.createElement("span",{className:""},n.original.edcrNumber):"NA")}},{Header:m("EDCR_COMMON_TABLE_COL_STATUS"),accessor:e=>(e=>l.createElement("span","Accepted"===e?{className:"sla-cell-success ",style:{background:"none",padding:"unset"}}:{className:"sla-cell-error",style:{background:"none",padding:"unset"}},e))(null==e?void 0:e.status),disableSortBy:!0},{Header:m("PT_COMMON_TABLE_COL_ACTION_LABEL"),Cell:e=>{let{row:t}=e;return l.createElement(yn,{dowloadOptions:[{label:m("BPA_UPLOADED_PLAN_DXF"),onClick:()=>window.open(""+t.original.dxfFileurl)},{label:m("EDCR_SCUTINY_REPORT"),onClick:()=>window.open(""+t.original.planReportUrl)}]})},disableSortBy:!0}]);return{getCellProps:e=>({style:{padding:"20px 18px",fontSize:"16px"}}),className:"table edcr-citizen-inbox",disableSort:!1,autoSort:!1,manualPagination:!0,initSortId:"createdDate",onPageSizeChange:u,currentPage:(null===(i=d.tableForm)||void 0===i?void 0:i.offset)/(null===(o=d.tableForm)||void 0===o?void 0:o.limit),onNextPage:()=>{var e,t;return v({action:"mutateTableForm",data:{...d.tableForm,offset:parseInt(null===(e=d.tableForm)||void 0===e?void 0:e.offset)+parseInt(null===(t=d.tableForm)||void 0===t?void 0:t.limit)}})},onPrevPage:()=>{var e,t;return v({action:"mutateTableForm",data:{...d.tableForm,offset:parseInt(null===(e=d.tableForm)||void 0===e?void 0:e.offset)-parseInt(null===(t=d.tableForm)||void 0===t?void 0:t.limit)}})},pageSizeLimit:null===(a=d.tableForm)||void 0===a?void 0:a.limit,onSort:p,totalRecords:s,onSearch:null==d||null===(r=d.searchForm)||void 0===r?void 0:r.message,onLastPage:()=>{var e;return v({action:"mutateTableForm",data:{...d.tableForm,offset:10*Math.ceil(s/10)-parseInt(null===(e=d.tableForm)||void 0===e?void 0:e.limit)}})},onFirstPage:()=>v({action:"mutateTableForm",data:{...d.tableForm,offset:0}}),data:c,columns:E}})({parentRoute:i,onPageSizeChange:e=>{_({action:"mutateTableForm",data:{...E.tableForm,limit:e.target.value}})},formState:E,totalCount:g,table:A,dispatch:_,onSortingByData:e=>{if(e.length>0){const[{id:t,desc:l}]=e,n=l?"DESC":"ASC";E.tableForm.sortBy===t&&E.tableForm.sortOrder===n||_({action:"mutateTableForm",data:{...E.tableForm,sortBy:t,sortOrder:l?"DESC":"ASC"}})}}}),C=(e=>{let{table:t}=e;const{t:i}=n.useTranslation();return{data:null==t?void 0:t.map(e=>{let{applicationId:t,edcrNumber:n,date:o,planReportUrl:a,dxfFileurl:r,locality:u,status:d,owner:s}=e;return{[i("EDCR_COMMON_TABLE_APPL_NO")]:t,[i("CS_APPLICATION_DETAILS_APPLICATION_DATE")]:o?Hl(new Date(o),"dd/MM/yyyy"):"NA",[i("EDCR_COMMON_TABLE_CITY_LABEL")]:i(u),[i("EDCR_COMMON_TABLE_APPL_NAME")]:s,[i("EDCR_COMMON_TABLE_SCRUTINY_NO")]:n,[i("EDCR_COMMON_TABLE_COL_STATUS")]:l.createElement("span","Accepted"===d?{className:"sla-cell-success ",style:{background:"none",padding:"0px"}}:{className:"sla-cell-error",style:{background:"none",padding:"0px"}},d),[i("BPA_UPLOADED_PLAN_DXF")]:l.createElement("a",{href:""+r},l.createElement("span",{className:"link"},i("BPA_DOWNLOAD"))),[i("EDCR_SCUTINY_REPORT")]:l.createElement("a",{href:""+a},l.createElement("span",{className:"link"},i("BPA_DOWNLOAD")))}}),isTwoDynamicPrefix:!0,getRedirectionLink:()=>{},handleClickEnabled:!1,serviceRequestIdKey:"applicationNo",MobileSortFormValues:()=>{const e=[{code:"DESC",i18nKey:"ES_INBOX_DATE_LATEST_FIRST"},{code:"ASC",i18nKey:"ES_INBOX_DATE_LATEST_LAST"}],{control:t}=a.useFormContext();return l.createElement(o.SearchField,null,l.createElement(a.Controller,{name:"sortOrder",control:t,render:t=>{let{onChange:n,value:i}=t;return l.createElement(o.RadioButtons,{onSelect:e=>{n(e.code)},selectedOption:e.filter(e=>e.code===i)[0],optionsKey:"i18nKey",name:"sortOrder",options:e})}}))}}})({table:A}),P={onMobileSortOrderData:e=>{const{sortOrder:t}=e;_({action:"mutateTableForm",data:{...E.tableForm,sortOrder:t}})},sortFormDefaultValues:null==E?void 0:E.tableForm,onSortFormReset:e=>{e("sortOrder","DESC"),_({action:"mutateTableForm",data:v})}};return l.createElement(t.Fragment,null,l.createElement(o.Header,null,r("ES_COMMON_INBOX"),g?l.createElement("p",{className:"inbox-count"},g):null),l.createElement(o.InboxComposer,s({isInboxLoading:f,PropsForInboxLinks:S},D,T,P,{propsForInboxTable:b,propsForInboxMobileCards:C,formState:E})))},ObpsEmpApplicationDetail:()=>{var e,a,r,u,d,s,c;const{id:v}=i.useParams(),{t:p}=n.useTranslation(),m=Digit.ULBService.getCurrentTenantId(),E=null==m?void 0:m.split(".")[0],[_,f]=t.useState(null),[A,g]=t.useState(!1),{isLoading:S,data:h}=Digit.Hooks.obps.useLicenseDetails(E,{applicationNumber:v,tenantId:E},{}),y=window.Digit.Utils.browser.isMobile(),[D,T]=t.useState(!1),{mutate:b}=Digit.Hooks.obps.useBPAREGApplicationActions(m),C=Digit.Hooks.useWorkflowDetails({tenantId:null==m?void 0:m.split(".")[0],id:v,moduleCode:"BPAREG"});let P=[];return console.log("applicationDetails",h),(null==h||null===(e=h.payments)||void 0===e?void 0:e.length)>0&&P.push({label:p("TL_RECEIPT"),onClick:()=>{var e,t;return Ut(0,null==h||null===(e=h.applicationData)||void 0===e?void 0:e.applicationNumber,null==h||null===(t=h.applicationData)||void 0===t?void 0:t.tenantId,null==h?void 0:h.payments)}}),l.createElement("div",{className:"employee-main-application-details"},l.createElement("div",{className:"employee-application-details"},l.createElement(o.Header,null,p("CS_TITLE_APPLICATION_DETAILS")),l.createElement("div",null,l.createElement("div",{style:{zIndex:"10",position:"relative"}},(null==h||null===(a=h.payments)||void 0===a?void 0:a.length)>0&&l.createElement(o.MultiLink,{className:"multilinkWrapper",onHeadClick:()=>g(!A),displayOptions:A,options:P,downloadBtnClassName:"employee-download-btn-className",optionsClassName:"employee-options-btn-className"})),(null==C||null===(r=C.data)||void 0===r||null===(u=r.timeline)||void 0===u?void 0:u.length)>0&&l.createElement(o.LinkButton,{label:p("VIEW_TIMELINE"),style:{color:"#A52A2A"},onClick:()=>{T(!0);const e=document.getElementById("timeline");e&&e.scrollIntoView({behavior:"smooth"})}}))),l.createElement(no,{applicationDetails:h,isLoading:S,id:"timeline",isDataLoading:S,applicationData:null==h?void 0:h.applicationData,mutate:b,workflowDetails:C,businessService:null!=C&&null!==(d=C.data)&&void 0!==d&&d.applicationBusinessService?null==C||null===(s=C.data)||void 0===s?void 0:s.applicationBusinessService:null==h||null===(c=h.applicationData)||void 0===c?void 0:c.businessService,moduleCode:"BPAREG",showToast:_,setShowToast:f,ActionBarStyle:y?{}:{paddingRight:"50px"},MenuStyle:y?{}:{right:"50px"},closeToast:()=>{f(null)},timelineStatusPrefix:"WF_NEWTL_"}))},ObpsEmployeeBpaApplicationDetail:()=>{var e,a,r,u,d,s,c,v,p,m,E,_,f,A,g,S,h,y,D,T,b,C,P,N,I;const L=function(e,t,l){let{tenantId:n}=e;void 0===l&&(l="download");try{var i,o;let e=new Date;ie.applicationData.additionalDetails.runDate=Bt(e.getFullYear()+"-"+(e.getMonth()+1)+"-"+e.getDate());let h={...null==ie?void 0:ie.applicationData,edcrDetail:[{...null==ie?void 0:ie.edcrDetails}]};const y=Digit.ULBService.getStateId();let D=0;for(let e=0;e<(null==ve||null===(a=ve.data)||void 0===a||null===(r=a.processInstances)||void 0===r?void 0:r.length);e++){var a,r,u,d,s,c,v,p,m,E,_,f,A;"POST_PAYMENT_APPLY"!==(null==ve||null===(u=ve.data)||void 0===u||null===(d=u.processInstances[e])||void 0===d?void 0:d.action)&&"PAY"!==(null==ve||null===(s=ve.data)||void 0===s||null===(c=s.processInstances[e])||void 0===c?void 0:c.action)||"APPROVAL_INPROGRESS"!==(null==ve||null===(v=ve.data)||void 0===v||null===(p=v.processInstances)||void 0===p||null===(m=p[e])||void 0===m||null===(E=m.state)||void 0===E?void 0:E.applicationStatus)||0!=D||(h.additionalDetails.submissionDate=null==ve||null===(_=ve.data)||void 0===_||null===(f=_.processInstances[e])||void 0===f||null===(A=f.auditDetails)||void 0===A?void 0:A.createdTime,D=1)}var g;if("NO"==(null==h||null===(i=h.additionalDetails)||void 0===i?void 0:i.approvedColony))h.additionalDetails.permitData="The plot has been officially regularized under No."+(null==h||null===(g=h.additionalDetails)||void 0===g?void 0:g.NocNumber)+" dated dd/mm/yyyy, registered in the name of <name as per the NOC>. This regularization falls within the jurisdiction of "+y+".Any form of misrepresentation of the NoC is strictly prohibited. Such misrepresentation renders the building plan null and void, and it will be regarded as an act of impersonation. Criminal proceedings will be initiated against the owner and concerned architect / engineer/ building designer / supervisor involved in such actions";else if("YES"==(null==h||null===(o=h.additionalDetails)||void 0===o?void 0:o.approvedColony)){var S;h.additionalDetails.permitData="The building plan falls under approved colony "+(null==h||null===(S=h.additionalDetails)||void 0===S?void 0:S.nameofApprovedcolony)}else h.additionalDetails.permitData="The building plan falls under Lal Lakir";return Promise.resolve(Digit.PaymentService.generatePdf(n,{Bpa:[h]},t)).then(function(e){return Promise.resolve(Digit.PaymentService.printReciept(n,{fileStoreIds:e.filestoreIds[0]})).then(function(t){var n,i;return window.open(t[null==e?void 0:e.filestoreIds[0]],"_blank"),h.applicationType=null==ie||null===(n=ie.applicationData)||void 0===n||null===(i=n.additionalDetails)||void 0===i?void 0:i.applicationType,Promise.resolve(Digit.OBPSService.edcr_report_download({BPA:{...h}})).then(function(e){const t=parseInt(e.status,10);201!==t&&200!==t||("print"==l?kt(new Blob([e.data],{type:"application/pdf"})):Ft(new Blob([e.data],{type:"application/pdf"}),"edcrReport.pdf"))})})})}catch(e){return Promise.reject(e)}},B=function(e){let{payments:t,...l}=e;try{function n(){return Promise.resolve(Digit.PaymentService.printReciept(X,{fileStoreIds:e.filestoreIds[0]})).then(function(t){var l;window.open(t[null===(l=e)||void 0===l?void 0:l.filestoreIds[0]],"_blank")})}let e=null;const l=function(){if(null==t||!t.fileStoreId)return Promise.resolve(Digit.PaymentService.generatePdf(X,{Payments:[{...t}]},"bpa-receipt")).then(function(t){e=t});e={filestoreIds:[null==t?void 0:t.fileStoreId]}}();return Promise.resolve(l&&l.then?l.then(n):n())}catch(e){return Promise.reject(e)}},{id:O}=i.useParams(),{t:R}=n.useTranslation(),w=Digit.ULBService.getCurrentTenantId(),[x,M]=t.useState(null),[F,k]=t.useState(!1),[U,H,W]=(i.useHistory(),Digit.Hooks.useSessionStorage("store-data",null)),[G,j,K]=Digit.Hooks.useSessionStorage("EMPLOYEE_MUTATION_HAPPENED",!1),[Y,$,z]=Digit.Hooks.useSessionStorage("EMPLOYEE_MUTATION_SUCCESS_DATA",{}),[V,q]=t.useState(null),X=Digit.ULBService.getStateId(),J=window.Digit.Utils.browser.isMobile(),{isLoading:Z,data:Q}=Digit.Hooks.obps.useMDMS(X,"BPA",["DocTypeMapping"]),[ee,te]=t.useState(!1);let{data:le}=Digit.Hooks.obps.SearchMdmsTypes.getFormConfig(X,[]);const{data:ne}=Digit.Hooks.obps.useMDMS(X,"BPA",["RiskTypeComputation"]),{data:ie={},isLoading:oe}=Digit.Hooks.obps.useBPADetailsPage(w,{applicationNo:O});t.useEffect(()=>{if(!Z&&!oe){var e;let v=[];if(null!=Q&&null!==(e=Q.BPA)&&void 0!==e&&e.DocTypeMapping){var t,l,n,i,o,a,r,u,d,s,c;v=null==Q||null===(t=Q.BPA)||void 0===t||null===(l=t.DocTypeMapping)||void 0===l?void 0:l.filter(e=>{var t,l,n,i,o;return"INPROGRESS"==e.WFState&&e.RiskType==(null==ie||null===(t=ie.applicationData)||void 0===t?void 0:t.riskType)&&e.ServiceType==(null==ie||null===(l=ie.applicationData)||void 0===l||null===(n=l.additionalDetails)||void 0===n?void 0:n.serviceType)&&e.applicationType==(null==ie||null===(i=ie.applicationData)||void 0===i||null===(o=i.additionalDetails)||void 0===o?void 0:o.applicationType)});let e=null==ie||null===(n=ie.applicationDetails)||void 0===n||null===(i=n.filter(e=>"BPA_DOCUMENT_DETAILS_LABEL"===e.title)[0])||void 0===i||null===(o=i.additionalDetails)||void 0===o||null===(a=o.obpsDocuments)||void 0===a||null===(r=a[0])||void 0===r?void 0:r.values,p=[];v&&(null===(u=v)||void 0===u||null===(d=u[0])||void 0===d?void 0:d.docTypes)&&(null===(s=v)||void 0===s||null===(c=s[0])||void 0===c||c.docTypes.map(t=>{e&&e.filter(e=>t.code===e.documentType.slice(0,e.documentType.lastIndexOf("."))).map(e=>{p.push(e)})}));const m=ie.applicationDetails&&ie.applicationDetails.map(e=>"BPA_DOCUMENT_DETAILS_LABEL"===e.title?{...e,additionalDetails:{obpsDocuments:[{title:"",values:p}]}}:e);ie.applicationDetails=m&&m.length>0?[...m]:null==ie?void 0:ie.applicationDetails}}},[Q,ie]);const[ae,re]=t.useState(!1),{mutate:ue}=Digit.Hooks.obps.useApplicationActions(w),de=Digit.Hooks.obps.useObpsAPI(w,!0);let se="";sessionStorage.setItem("bpaApplicationDetails",!0),t.useEffect(()=>{j(!1),z()},[]);let ce=null!=le&&le.InspectionReportConfig?null==le?void 0:le.InspectionReportConfig:io,ve=Digit.Hooks.useWorkflowDetails({tenantId:w,id:O,moduleCode:"BPA"});var me,Ee,_e,fe,Ae,ge,he,ye,De;ve&&ve.data&&!ve.isLoading&&(ve.data.initialActionState=(null==ve||null===(me=ve.data)||void 0===me?void 0:me.initialActionState)||{...null==ve||null===(Ee=ve.data)||void 0===Ee?void 0:Ee.actionState}||{},ve.data.actionState={...ve.data}),null!=ne&&null!==(e=ne.BPA)&&void 0!==e&&e.RiskTypeComputation&&null!=ie&&ie.edcrDetails&&(se=Digit.Utils.obps.calculateRiskType(null==ne||null===(_e=ne.BPA)||void 0===_e?void 0:_e.RiskTypeComputation,null==ie||null===(fe=ie.edcrDetails)||void 0===fe||null===(Ae=fe.planDetail)||void 0===Ae||null===(ge=Ae.plot)||void 0===ge?void 0:ge.area,null==ie||null===(he=ie.edcrDetails)||void 0===he||null===(ye=he.planDetail)||void 0===ye?void 0:ye.blocks),null==ie||null===(De=ie.applicationDetails)||void 0===De||De.map(e=>{var t;null!=e&&e.isInsert&&(null===(t=e.values)||void 0===t||t.forEach(e=>{null!=e&&e.isInsert&&(e.value="WF_BPA_"+se)}))}));const Te=Digit.UserService.getUser(),be=null==Te||null===(a=Te.info)||void 0===a?void 0:a.roles.filter(e=>{if("CEMP"==e.code&&e.tenantId===w||"CITIZEN"==e.code)return!0});if((null==ve||null===(r=ve.data)||void 0===r||null===(u=r.processInstances)||void 0===u?void 0:u.length)>0){var Ce,Pe,Ne;let e=[];e=null===(Ce=yo(null==ve||null===(Pe=ve.data)||void 0===Pe?void 0:Pe.processInstances[0],"nextActions",[]))||void 0===Ce?void 0:Ce.filter(e=>"ADHOC"!=e.action);let t=(Le=["action"],Re=["desc"],null==(Ie=e)?[]:(pe(Le)||(Le=null==Le?[]:[Le]),pe(Re=Re)||(Re=null==Re?[]:[Re]),function(e,t,l){t=t.length?_o(t,function(e){return pe(e)?function(t){return ho(t,1===e.length?e[0]:e)}:e}):[ko];var n=-1;return t=_o(t,Se(Uo)),function(e,t){var n=e.length;for(e.sort(function(e,t){return function(e,t,l){for(var n=-1,i=e.criteria,o=t.criteria,a=i.length,r=l.length;++n<a;){var u=Ho(i[n],o[n]);if(u)return n>=r?u:u*("desc"==l[n]?-1:1)}return e.index-t.index}(e,t,l)});n--;)e[n]=e[n].value;return e}(function(e,t){var l=-1,n=Be(e)?Array(e.length):[];return function(e,t){if(null==e)return e;if(!Be(e))return function(e,t){return e&&function(e,t,l){for(var n=-1,i=Object(e),o=l(e),a=o.length;a--;){var r=o[++n];if(!1===t(i[r],r,i))break}return e}(e,t,Oe)}(e,t);for(var l=e.length,n=-1,i=Object(e);++n<l&&!1!==t(i[n]););}(e,function(e,i,o){n[++l]=t(e)}),n}(e,function(e,l,i){return{criteria:_o(t,function(t){return t(e)}),index:++n,value:e}}))}(Ie,Le,Re)));t&&0!=(null==t?void 0:t.length)||null==ve||null===(Ne=ve.data)||void 0===Ne||!Ne.actionState||(ve.data.actionState.nextActions=[])}var Ie,Le,Re,we,xe,Me,Fe,ke,Ue;(null==ve||null===(d=ve.data)||void 0===d||null===(s=d.nextActions)||void 0===s?void 0:s.length)>0&&(ve.data.nextActions=null==ve||null===(we=ve.data)||void 0===we||null===(xe=we.nextActions)||void 0===xe?void 0:xe.filter(e=>"INITIATE"!==e.action),ve.data.nextActions=null==ve||null===(Me=ve.data)||void 0===Me||null===(Fe=Me.nextActions)||void 0===Fe?void 0:Fe.filter(e=>"ADHOC"!==e.action)),be&&(null==ve||null===(ke=ve.data)||void 0===ke||null===(Ue=ke.nextActions)||void 0===Ue||Ue.forEach(e=>{var t,l,n;"PAY"===(null==e?void 0:e.action)&&(e.redirectionUrll={pathname:`${Mt(null==ie||null===(t=ie.applicationData)||void 0===t?void 0:t.businessService,null==ie||null===(l=ie.applicationData)||void 0===l?void 0:l.status)}/${null==ie||null===(n=ie.applicationData)||void 0===n?void 0:n.applicationNo}/${w}?tenantId=${w}`,state:w})}));let He=[];var We,Ge,je,Ke,Ye,$e;if((null==ie||null===(c=ie.collectionBillDetails)||void 0===c?void 0:c.length)>0&&ft(null==ie?void 0:ie.collectionBillDetails).forEach(e=>{var t,l,n,i,o;"BPA.NC_OC_APP_FEE"===(null==e||null===(t=e.paymentDetails[0])||void 0===t?void 0:t.businessService)&&He.push({order:1,label:R("BPA_APP_FEE_RECEIPT"),onClick:()=>{var t,l;return B({tenantId:null==ie||null===(t=ie.applicationData)||void 0===t?void 0:t.tenantId,payments:e,consumerCodes:null==ie||null===(l=ie.applicationData)||void 0===l?void 0:l.applicationNo})}}),"BPA.NC_OC_SAN_FEE"===(null==e||null===(l=e.paymentDetails[0])||void 0===l?void 0:l.businessService)&&He.push({order:2,label:R("BPA_OC_DEV_PEN_RECEIPT"),onClick:()=>{var t,l;return B({tenantId:null==ie||null===(t=ie.applicationData)||void 0===t?void 0:t.tenantId,payments:e,consumerCodes:null==ie||null===(l=ie.applicationData)||void 0===l?void 0:l.applicationNo})}}),"BPA.LOW_RISK_PERMIT_FEE"===(null==e||null===(n=e.paymentDetails[0])||void 0===n?void 0:n.businessService)&&He.push({order:1,label:R("BPA_FEE_RECEIPT"),onClick:()=>{var t,l;return B({tenantId:null==ie||null===(t=ie.applicationData)||void 0===t?void 0:t.tenantId,payments:e,consumerCodes:null==ie||null===(l=ie.applicationData)||void 0===l?void 0:l.applicationNo})}}),"BPA.NC_APP_FEE"===(null==e||null===(i=e.paymentDetails[0])||void 0===i?void 0:i.businessService)&&He.push({order:1,label:R("BPA_APP_FEE_RECEIPT"),onClick:()=>{var t,l;return B({tenantId:null==ie||null===(t=ie.applicationData)||void 0===t?void 0:t.tenantId,payments:e,consumerCodes:null==ie||null===(l=ie.applicationData)||void 0===l?void 0:l.applicationNo})}}),"BPA.NC_SAN_FEE"===(null==e||null===(o=e.paymentDetails[0])||void 0===o?void 0:o.businessService)&&He.push({order:2,label:R("BPA_SAN_FEE_RECEIPT"),onClick:()=>{var t,l;return B({tenantId:null==ie||null===(t=ie.applicationData)||void 0===t?void 0:t.tenantId,payments:e,consumerCodes:null==ie||null===(l=ie.applicationData)||void 0===l?void 0:l.applicationNo})}})}),ie&&"BPA_LOW"===(null==ie||null===(v=ie.applicationData)||void 0===v?void 0:v.businessService)&&(null==ie||null===(p=ie.collectionBillDetails)||void 0===p?void 0:p.length)>0)(null==ie||null===(We=ie.applicationData)||void 0===We||!We.status.includes("REVOCATION"))&&He.push({order:3,label:R("BPA_PERMIT_ORDER"),onClick:()=>{var e;return L({tenantId:null==ie||null===(e=ie.applicationData)||void 0===e?void 0:e.tenantId},"buildingpermit-low")}}),(null==ie||null===(Ge=ie.applicationData)||void 0===Ge?void 0:Ge.status.includes("REVOCATION"))&&He.push({order:3,label:R("BPA_REVOCATION_PDF_LABEL"),onClick:()=>{var e;return function(e){let{tenantId:t,...l}=e;try{let e={...null==ie?void 0:ie.applicationData};return Promise.resolve(Digit.PaymentService.generatePdf(t,{Bpa:[e]},"bpa-revocation")).then(function(e){return Promise.resolve(Digit.PaymentService.printReciept(t,{fileStoreIds:e.filestoreIds[0]})).then(function(t){window.open(t[null==e?void 0:e.filestoreIds[0]],"_blank")})})}catch(e){return Promise.reject(e)}}({tenantId:null==ie||null===(e=ie.applicationData)||void 0===e?void 0:e.tenantId})}});else if(ie&&"BPA"===(null==ie||null===(m=ie.applicationData)||void 0===m?void 0:m.businessService)&&(null==ie||null===(E=ie.collectionBillDetails)||void 0===E?void 0:E.length)>0){var ze;"APPROVED"===(null==ie||null===(ze=ie.applicationData)||void 0===ze?void 0:ze.status)&&He.push({order:3,label:R("BPA_PERMIT_ORDER"),onClick:()=>{var e;return L({tenantId:null==ie||null===(e=ie.applicationData)||void 0===e?void 0:e.tenantId},"buildingpermit")}})}else{var Ve;"APPROVED"===(null==ie||null===(Ve=ie.applicationData)||void 0===Ve?void 0:Ve.status)&&He.push({order:3,label:R("BPA_OC_CERTIFICATE"),onClick:()=>{var e;return L({tenantId:null==ie||null===(e=ie.applicationData)||void 0===e?void 0:e.tenantId},"occupancy-certificate")}})}null!=ie&&ie.comparisionReport&&ie&&"BPA_OC"===(null==ie||null===(_=ie.applicationData)||void 0===_?void 0:_.businessService)&&He.push({order:4,label:R("BPA_COMPARISON_REPORT_LABEL"),onClick:()=>{var e;return window.open(null==ie||null===(e=ie.comparisionReport)||void 0===e?void 0:e.comparisonReport,"_blank")}}),He.sort(function(e,t){return e.order-t.order}),(null==ve||null===(f=ve.data)||void 0===f||null===(A=f.nextActions)||void 0===A?void 0:A.length)>0&&(ve.data.nextActions=null==ve||null===(je=ve.data)||void 0===je||null===(Ke=je.nextActions)||void 0===Ke?void 0:Ke.filter(e=>"SKIP_PAYMENT"!==e.action)),(null==ve||null===(g=ve.data)||void 0===g||null===(S=g.nextActions)||void 0===S?void 0:S.length)>0&&(ve.data.nextActions=null==ve||null===(Ye=ve.data)||void 0===Ye||null===($e=Ye.nextActions)||void 0===$e?void 0:$e.filter(e=>"SKIP_PAYMENT"!==e.action));const qe=null==ie||null===(h=ie.applicationDetails)||void 0===h?void 0:h.filter(e=>0!==Object.keys(e).length);return ie.applicationDetails=qe,l.createElement(t.Fragment,null,l.createElement("div",{className:"employee-main-application-details"},l.createElement("div",{className:"employee-application-details",style:{marginBottom:"15px"}},l.createElement(o.Header,{styles:{marginLeft:"0px",paddingTop:"10px",fontSize:"32px"}},R("CS_TITLE_APPLICATION_DETAILS")),l.createElement("div",null,l.createElement("div",{style:{zIndex:"10",position:"relative"}},He&&He.length>0&&l.createElement(o.MultiLink,{className:"multilinkWrapper",onHeadClick:()=>re(!ae),displayOptions:ae,options:He,downloadBtnClassName:"employee-download-btn-className",optionsClassName:"employee-options-btn-className"})),l.createElement(o.LinkButton,{label:R("VIEW_TIMELINE"),style:{color:"#A52A2A"},onClick:()=>{te(!0);const e=document.getElementById("timeline");e&&e.scrollIntoView({behavior:"smooth"})}}))),l.createElement(no,{applicationDetails:ie,isLoading:oe,isDataLoading:oe,applicationData:null==ie?void 0:ie.applicationData,nocMutation:de,mutate:ue,id:"timeline",workflowDetails:ve,businessService:null!=ve&&null!==(y=ve.data)&&void 0!==y&&y.applicationBusinessService?null==ve||null===(D=ve.data)||void 0===D?void 0:D.applicationBusinessService:null==ie||null===(T=ie.applicationData)||void 0===T?void 0:T.businessService,moduleCode:"BPA",showToast:x,ActionBarStyle:J?{}:{paddingRight:"50px"},MenuStyle:J?{}:{right:"50px"},setShowToast:M,closeToast:()=>{M(null),q(null)},statusAttribute:"state",timelineStatusPrefix:`WF_${null!=ve&&null!==(b=ve.data)&&void 0!==b&&b.applicationBusinessService?null==ve||null===(C=ve.data)||void 0===C?void 0:C.applicationBusinessService:null==ie||null===(P=ie.applicationData)||void 0===P?void 0:P.businessService}_`}),"FIELDINSPECTION_INPROGRESS"===(null==ie||null===(N=ie.applicationData)||void 0===N?void 0:N.status)&&(null==Te||null===(I=Te.info)||void 0===I?void 0:I.roles.filter(e=>"BPA_FIELD_INSPECTOR"===e.code)).length>0&&l.createElement(o.FormComposer,{heading:R(""),isDisabled:!F,config:ce.map(e=>{return{...e,body:e.body.filter(e=>!e.hideInEmployee),head:(t=e.head,"ES_NEW_APPLICATION_LOCATION_DETAILS"===t?"TL_CHECK_ADDRESS":"ES_NEW_APPLICATION_OWNERSHIP_DETAILS"===t?"TL_OWNERSHIP_DETAILS_HEADER":t)};var t}),fieldStyle:{marginRight:0},submitInForm:!1,defaultValues:{},onFormValueChange:(e,t,l)=>{k(!Object.keys(l.errors).length)},breaklineStyle:{border:"0px"},className:"employeeCard-override",cardClassName:"employeeCard-override"})))},Architectconcent:Wo,CitizenConsent:fn};exports.initOBPSComponents=()=>{Object.entries(sr).forEach(e=>{let[t,l]=e;Digit.ComponentRegistryService.setComponent(t,l)})};
|