@mseva/digit-ui-module-obps 1.0.13 → 1.0.14

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.
Files changed (2) hide show
  1. package/dist/index.js +1 -1
  2. 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 K(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])}}K.prototype.clear=function(){this.__data__=$?$(null):{},this.size=0},K.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},K.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},K.prototype.has=function(e){var t=this.__data__;return $?void 0!==t[e]:z.call(t,e)},K.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 G=K,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 G,map:new(j||g),string:new G}},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"),Ke=W(C,"WeakMap"),Ge=k($e),Ve=k(j),qe=k(Ye),Xe=k(ze),Je=k(Ke),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)||Ke&&"[object WeakMap]"!=Ze(new Ke))&&(Ze=function(e){var t=O(e),l="[object Object]"==t?e.constructor:void 0,n=l?k(l):"";if(n)switch(n){case Ge: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,K,G,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===(K=Ee.tradeLicenseDetail)||void 0===K||null===(G=K.owners)||void 0===G||null===(V=G[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:K}=n.useTranslation(),[G,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:K("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"}},K("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:K("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:K("BPA_APPLICATION_NUMBER_LABEL"),text:(null==ae?void 0:ae.applicationNumber)||"NA"}))),l.createElement(o.Card,null,l.createElement(o.CardHeader,{styles:{fontSize:"24px"}},K("BPA_LICENSE_DETAILS_LABEL")),l.createElement(o.StatusTable,null,l.createElement(o.Row,{className:"border-none",label:K("BPA_LICENSE_TYPE"),text:K("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:K("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"}},K("BPA_LICENSE_DET_CAPTION")),l.createElement(o.StatusTable,null,l.createElement(o.Row,{className:"border-none",label:K("BPA_APPLICANT_NAME_LABEL"),text:K(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:K("BPA_APPLICANT_GENDER_LABEL"),text:K(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:K("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:K("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)||K("CS_NA")}),l.createElement(o.Row,{className:"border-none",label:K("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)||K("CS_NA")}))),l.createElement(o.Card,null,l.createElement(o.CardHeader,{styles:{fontSize:"24px"}},K("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)||K("CS_NA")})),l.createElement(o.Card,null,l.createElement(o.CardHeader,{styles:{fontSize:"24px"}},K("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)||K("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"}},K("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"}},K("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"}},""+K(null==e?void 0:e.info)):null,l.createElement("a",{target:"_blank",href:null===(a=G[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"}},K("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})))))},Kt=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"}})))))},Gt=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(Gt,{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:Kt}))))},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 Kl=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 Gl(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,K]=t.useState([]),[G,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(G&&null!=G&&G.type){const e=function(e,t,l){if(null!==(e=".pdf".split(","))&&void 0!==e&&e.includes("."+(null==G||null===(t=G.type)||void 0===t||null===(l=t.split("/"))||void 0===l?void 0:l.pop()))){const e=function(){if(G.size>=2e6)Z(ae("PT_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=c(function(){return Promise.resolve(Digit.UploadServices.Filestorage("property-upload",G,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?K([...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)}}()},[G]),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),K(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 K=Digit.Hooks.useWorkflowDetails({tenantId:null==z||null===(u=z.applicationData)||void 0===u?void 0:u.tenantId,id:$,moduleCode:"OBPS",config:{enabled:!!z}});const[G,V]=t.useState(!1),[q,X]=t.useState(!1),J=null==K||null===(s=K.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:G||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:Kt}),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),K=/^\s+/,G=/\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,Ke=ze&&ze.exports===Ye,Ge=Ke&&We.process,Ve=function(){try{return ze&&ze.require&&ze.require("util").types||Ge&&Ge.binding&&Ge.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(K,""):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({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"});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--&&G.test(e.charAt(t)););return t}var zt=bt({"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"}),Kt=function e(t){var A=(t=null==t?$e:Kt.defaults($e.Object(),t,Kt.pick($e,we))).Array,G=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=Ke?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,Ge=_e.splice,Ve=Oe?Oe.isConcatSpreadable:void 0,mt=Oe?Oe.iterator:void 0,bt=Oe?Oe.toStringTag:void 0,Gt=function(){try{var e=Ji(pe,"defineProperty");return e({},"",{}),e}catch(e){}}(),Vt=t.clearTimeout!==$e.clearTimeout&&t.clearTimeout,qt=G&&G.now!==$e.Date.now&&G.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=G.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),Gl(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&&Gt?Gt(e,t,{configurable:!0,enumerable:!0,value:l,writable:!0}):e[t]=l}function Kl(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 Gl(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():Ge.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?Kr:"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=[]:Ga(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}):[Kr];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&&Ge.call(r,u,1),Ge.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)?Ge.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,Kr),e+"")}function Fn(e){return Fl(Ir(e))}function kn(e,t){var l=Ir(e);return bo(l,Gl(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}:Kr,Wn=Gt?function(e,t){return Gt(e,"toString",{configurable:!0,enumerable:!1,value:$r(t),writable:!0})}:Kr;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 Kn(e,t,Kr,l)}function Kn(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 Gn(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:Kr}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"==Ki(a))var r=new Il([],!0)}for(i=r?i:n;++i<n;){var u=Ki(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[Ki(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=Gi(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=Gi(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 Ga(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 Ki(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 Gi(e){return(he.call(Dl,"placeholder")?Dl:e).placeholder}function Vi(){var e=Dl.iteratee||Gr;return e=e===Gr?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=Ki(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=Kl(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))}),Ko=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 Go(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=Go(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(Go),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 Kl(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,Gi(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,Gi(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,Gi(Da)))}),Na=Mn(function(e,t){return Fi(e,64,void 0,t,Ut(t,Gi(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&&!Ga(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 Ka(e){return"number"==typeof e||Ya(e)&&vn(e)==p}function Ga(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?Gl(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(Kl),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(Kr)),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 Kr(e){return e}function Gr(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=Gr,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?Gn(e):[]},Dl.sortedUniqBy=function(e,t){return e&&e.length?Gn(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=Ko,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=Go,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),Gl(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:Gl(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=Kr,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&&!Ga(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 Ka(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=Ka,Dl.isObject=$a,Dl.isObjectLike=Ya,Dl.isPlainObject=Ga,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,Kr,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,Kr)},Dl.meanBy=function(e,t){return St(e,Vi(t,2))},Dl.min=function(e){return e&&e.length?tn(e,Kr,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(K,""),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 Kn(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 Kn(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:Gl(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,Kr):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?Gl(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(K,"");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(Kr)},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=Kt)._=Kt,Ye._=Kt):$e._=Kt}).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),[K,G]=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{G(null);const e=function(){if(j){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(j.size>=5242880)G(g("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=j&&j.type&&!e.test(null==j?void 0:j.type))G(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):G(g("CS_FILE_UPLOAD_ERROR"))})},function(){G(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:K,blockReasonFiltered:M}))},[A,w,V,Y,K]),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)},Kn=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"})),Vn=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(Gn,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(Kn,{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)))))},Ki=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},Gi=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({}),[K,G]=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),G(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",K),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,K,G,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===(K=z.redirectUrl)||void 0===K?void 0:K.url},l.createElement("span",{className:"link",style:{color:"#a82227"}},null==e||null===(G=e.additionalDetails)||void 0===G||null===(V=G.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==K?void 0:K.length)>0&&l.createElement(zi,{assessmentData:V}),l.createElement(Gi,{payments:H}),l.createElement(Ki,{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:K,ActionBarStyle:G,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:K,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:G,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,K=null==w||null===(S=w.additionalDetails)||void 0===S?void 0:S.wardnumber,G=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>${G}</b> (Sq.mts).\n \n This site falls in ward number <b>${K}</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 Ko(e){return"[object Function]"===Wo.call(e)}function Go(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:Ko,isStream:function(e){return Yo(e)&&Ko(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:Go,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++)Go(arguments[n],l);return t},extend:function(e,t,l){return Go(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:K,setUlb:G,setUploadMessage:V,setUploadedFile:q,setcoreArea:X,siteReserved:J,siteReservedOptions:Z,tenantIdData:Q,uploadMessage:ee,uploadedFile:te}=(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),[K,G]=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||!K||!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:K,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=K,e.siteReserved=ee,"YES"===(null==ee?void 0:ee.code)&&(e.approvedControlSheet=le)):(e.isCluApproved=X,e.coreType=Z),e},handleAreaTypeChange:e=>{z(e),G(""),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:K,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:G,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 le=(null===(a=Digit.SessionStorage.get("CITIZEN.COMMON.HOME.CITY"))||void 0===a?void 0:a.code)||Digit.ULBService.getCurrentTenantId()||"pb.amritsar";const ne=Digit.ULBService.getStateId();console.log(ne,le,r,"TEN STATE");const{isLoading:ie,data:oe}=Digit.Hooks.obps.useMDMS(ne,"tenant",["citymodule"]);return t.useEffect(()=>{var e,t;if((null==oe||null===(e=oe.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==oe||null===(l=oe.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)}},[oe]),t.useEffect(()=>{(ee||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"})},[ee,v,p]),ie||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,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),G(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:K}),"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:te?"1 "+r("PT_ACTION_FILEUPLOADED"):r("ES_NO_FILE_SELECTED_LABEL"),error:C,uploadMessage:ee}))))},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;let{formData:E,onSelect:f,config:_}=e;const g=window.location.href.includes("editApplication"),[A,S]=t.useState(_),{t:h}=n.useTranslation(),[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(""),[M,F]=t.useState(""),[k,U]=t.useState(""),[H,W]=t.useState(""),[j,$]=t.useState(""),[Y,z]=t.useState(""),[K,G]=t.useState(""),[V,q]=t.useState(""),[X,J]=t.useState(""),Z=(Digit.ULBService.getCurrentTenantId(),null==E||null===(i=E.uiFlow)||void 0===i?void 0:i.flow),Q=Digit.ULBService.getStateId();t.useEffect(()=>{if(g){const e={..._,inputs:_.inputs.map(e=>"boundaryWallLength"===e.name?{...e,disable:!0}:e)};S(e)}},[Z,g]);const{data:ee,isLoading:te}=Digit.Hooks.obps.useScrutinyDetails(Q,null==E||null===(a=E.data)||void 0===a?void 0:a.scrutinyNumber);return te?l.createElement(o.Loader,null):l.createElement("div",null,l.createElement(Yl,{flow:"OCBPA"===Z?"OCBPA":""}),l.createElement(o.FormStep,{config:A,onSelect:e=>{f(null==A?void 0:A.key,{...e})},childrenAtTheBottom:!1,t:h,_defaultValues:null==E?void 0:E.data,onSkip:()=>f()},l.createElement(o.StatusTable,null,l.createElement(o.Row,{className:"border-none",label:h("BPA_BOUNDARY_PLOT_AREA_LABEL"),text:null!=ee&&null!==(r=ee.planDetail)&&void 0!==r&&null!==(u=r.planInformation)&&void 0!==u&&u.plotArea?`${null==ee||null===(d=ee.planDetail)||void 0===d||null===(s=d.planInformation)||void 0===s?void 0:s.plotArea} ${h("BPA_SQ_MTRS_LABEL")}`:"NA"}),l.createElement(o.Row,{className:"border-none",label:h("BPA_PLOT_NUMBER_LABEL"),text:null==ee||null===(c=ee.planDetail)||void 0===c||null===(v=c.planInformation)||void 0===v?void 0:v.plotNo}),l.createElement(o.Row,{className:"border-none",label:h("BPA_KHATHA_NUMBER_LABEL"),text:null==ee||null===(p=ee.planDetail)||void 0===p||null===(m=p.planInformation)||void 0===m?void 0:m.khataNo}))))},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([]),[K,G]=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})}),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})})),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,K]=t.useState((null==L||null===(m=L.owners)||void 0===m?void 0:m.greenbuilding)||""),[G,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 Ke=[];ze&&ze.map(e=>{Ke.push({i18nKey:"BPA_"+e.code,code:""+e.code,value:""+e.name})});const{control:Ge}=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:G,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&&G&&J)},l.createElement("div",null,l.createElement(o.CardLabel,null,""+N("BPA_APPROVED_COLONY")),l.createElement(a.Controller,{control:Ge,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:Ge,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:Ge,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:Ge,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:Ge,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:Ge,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:Ge,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:Ge,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:Ge,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:Ke,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:Ge,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:Ge,name:"greenbuilding",defaultValue:z,rules:{required:N("CORE_COMMON_REQUIRED_ERRMSG")},render:e=>l.createElement(o.Dropdown,{className:"form-field",selected:z,select:K,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:Ge,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:Ge,name:"restrictedArea",defaultValue:G,rules:{required:N("CORE_COMMON_REQUIRED_ERRMSG")},render:e=>l.createElement(o.Dropdown,{className:"form-field",selected:G,select:V,option:Pe,optionKey:"i18nKey",t:N})}),l.createElement(o.CardLabel,null,""+N("BPA_PROPOSED_SITE_TYPE")),l.createElement(a.Controller,{control:Ge,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");const h=Digit.ULBService.getCurrentTenantId(),b=Digit.ULBService.getStateId(),[y,C]=t.useState(!A&&!S),[T,D]=t.useState([]),[N,P]=t.useState([]),[I,L]=t.useState(null==_||null===(n=_.owners)||void 0===n?void 0:n.ownershipCategory),[B,O]=t.useState((null==_||null===(i=_.owners)||void 0===i?void 0:i.name)||""),[R,w]=t.useState((null==_||null===(a=_.owners)||void 0===a?void 0:a.emailId)||""),[x,M]=t.useState((null==_||null===(r=_.owners)||void 0===r?void 0:r.aadharNumber)||""),[F,k]=t.useState(!1),[U,H]=t.useState(null==_||null===(u=_.owners)||void 0===u?void 0:u.gender),[W,j]=t.useState((null==_||null===(d=_.owners)||void 0===d?void 0:d.mobileNumber)||""),[$,Y]=t.useState(null),[z,K]=t.useState(!1);Digit.Utils.browser.isMobile();const G=!(null==I||!I.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[V,q]=t.useState((null==_?void 0:_.owners)&&(null==_||null===(p=_.owners)||void 0===p?void 0:p.owners)||[{name:"",gender:"",mobileNumber:null,isPrimaryOwner:!0}]),X=Digit.UserService.getUser();console.log("userrrr",X),t.useEffect(()=>{var e=0;V.map(t=>{null!=t&&t.isPrimaryOwner&&(e=1),C(!(null!=t&&t.name&&null!=t&&t.mobileNumber&&null!=t&&t.gender))}),y||!I||null!=I&&I.code.includes("SINGLEOWNER")||C(1!=e)},[V]),t.useEffect(()=>{const e=mt(V);I&&!G&&(null==e?void 0:e.length)>1&&q([{...e[0],isPrimaryOwner:!0}])},[I]);const{isLoading:J,data:Z}=Digit.Hooks.obps.useMDMS(b,"common-masters",["OwnerShipCategory"]),{data:Q}=Digit.Hooks.obps.useMDMS(b,"common-masters",["GenderType"]);t.useEffect(()=>{var e;const t=null==Z||null===(e=Z["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,".","_")}),D(e)}},[Z]),t.useEffect(()=>{var e;const t=(null==Q||null===(e=Q["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}),P(e)}},[Q]);const[ee,te]=t.useState(null);function le(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 te(null),Promise.resolve(function(e,t){try{let e=!1,t=[];return t=null==V?void 0:V.map((e,t)=>{var l;return Digit.UserService.userSearch(Digit.ULBService.getStateId(),{userName:null==V||null===(l=V[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],V.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&&Y({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==V.length)window.scrollTo(0,0),te("BPA_ERROR_MULTIPLE_OWNER");else{let e,G=_.owners;if(e={...G,owners:V,ownershipCategory:I},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,b,y,C,T,D,N,P,L,B,O,R,w,x,M,F,k,U,H,W,j,$,z,q,J,Z,Q,ee,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,Ke,Ge,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,Kt,Gt,Vt,qt,Xt,Jt;K(!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 V={};V.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,V.riskType=null==_||null===(r=_.data)||void 0===r?void 0:r.riskType,V.applicationType=null==_||null===(u=_.data)||void 0===u?void 0:u.applicationType,V.serviceType=null==_||null===(d=_.data)||void 0===d?void 0:d.serviceType;const te=Digit.UserService.getUser(),Zt=null==te||null===(s=te.info)||void 0===s?void 0:s.uuid;V.tenantId=null==_||null===(c=_.address)||void 0===c||null===(v=c.city)||void 0===v?void 0:v.code,V.workflow={action:"INITIATE",assignes:[null==te||null===(p=te.info)||void 0===p?void 0:p.uuid]},V.accountId=Zt,V.documents=null,V.additionalDetails={GISPlaceName:null==_||null===(m=_.address)||void 0===m?void 0:m.placeName},V.additionalDetails.boundaryWallLength=(null==_||null===(g=_.data)||void 0===g?void 0:g.boundaryWallLength)||"NA",V.additionalDetails.area=(null==_?void 0:_.data.edcrDetails.planDetail.planInformation.plotArea).toString()||"NA",V.additionalDetails.height=(null==_?void 0:_.data.edcrDetails.planDetail.blocks[0].building.buildingHeight).toString()||"NA",V.additionalDetails.usage=(null==_?void 0:_.data.occupancyType)||"NA",V.additionalDetails.builtUpArea=(null==_?void 0:_.data.edcrDetails.planDetail.blocks[0].building.totalBuitUpArea).toString(),V.additionalDetails.ownerName=E.map(e=>e.name).join(","),null!=_&&null!==(A=_.data)&&void 0!==A&&A.registrationDetails&&(V.additionalDetails.registrationDetails=null==_||null===(S=_.data)||void 0===S?void 0:S.registrationDetails),null!=_&&null!==(b=_.data)&&void 0!==b&&b.applicationType&&(V.additionalDetails.applicationType=null==_||null===(y=_.data)||void 0===y?void 0:y.applicationType),null!=_&&null!==(C=_.data)&&void 0!==C&&C.serviceType&&(V.additionalDetails.serviceType=null==_||null===(T=_.data)||void 0===T?void 0:T.serviceType),null!=_&&null!==(D=_.data)&&void 0!==D&&D.wardnumber&&(V.additionalDetails.wardnumber=null==_||null===(N=_.data)||void 0===N?void 0:N.wardnumber),null!=_&&null!==(P=_.data)&&void 0!==P&&P.zonenumber&&(V.additionalDetails.zonenumber=null==_||null===(L=_.data)||void 0===L?void 0:L.zonenumber),null!=_&&null!==(B=_.data)&&void 0!==B&&B.khasraNumber&&(V.additionalDetails.khasraNumber=null==_||null===(O=_.data)||void 0===O?void 0:O.khasraNumber),null!=_&&null!==(R=_.data)&&void 0!==R&&R.applicationType&&(V.additionalDetails.applicationType=null==_||null===(w=_.data)||void 0===w?void 0:w.applicationType),null!=_&&null!==(x=_.data)&&void 0!==x&&x.serviceType&&(V.additionalDetails.serviceType=null==_||null===(M=_.data)||void 0===M?void 0:M.serviceType),null!=_&&null!==(F=_.data)&&void 0!==F&&F.architectid&&(V.additionalDetails.architectid=null==_||null===(k=_.data)||void 0===k?void 0:k.architectid),null!=_&&null!==(U=_.data)&&void 0!==U&&U.propertyuid&&(V.additionalDetails.propertyuid=null==_||null===(H=_.data)||void 0===H?void 0:H.propertyuid),null!=_&&null!==(W=_.data)&&void 0!==W&&W.bathnumber&&(V.additionalDetails.bathnumber=null==_||null===(j=_.data)||void 0===j?void 0:j.bathnumber),null!=_&&null!==($=_.data)&&void 0!==$&&$.kitchenNumber&&(V.additionalDetails.kitchenNumber=null==_||null===(z=_.data)||void 0===z?void 0:z.kitchenNumber),null!=_&&null!==(q=_.data)&&void 0!==q&&q.approxinhabitants&&(V.additionalDetails.approxinhabitants=null==_||null===(J=_.data)||void 0===J?void 0:J.approxinhabitants),null!=_&&null!==(Z=_.data)&&void 0!==Z&&Z.materialusedinfloor&&(V.additionalDetails.materialusedinfloor=null==_||null===(Q=_.data)||void 0===Q?void 0:Q.materialusedinfloor),null!=_&&null!==(ee=_.data)&&void 0!==ee&&ee.distancefromsewer&&(V.additionalDetails.distancefromsewer=null==_||null===(ne=_.data)||void 0===ne?void 0:ne.distancefromsewer),null!=_&&null!==(ie=_.data)&&void 0!==ie&&ie.sourceofwater&&(V.additionalDetails.sourceofwater=null==_||null===(oe=_.data)||void 0===oe?void 0:oe.sourceofwater),null!=_&&null!==(ae=_.data)&&void 0!==ae&&ae.watercloset&&(V.additionalDetails.watercloset=null==_||null===(re=_.data)||void 0===re?void 0:re.watercloset),null!=_&&null!==(ue=_.data)&&void 0!==ue&&ue.materialused&&(V.additionalDetails.materialused=null==_||null===(de=_.data)||void 0===de?void 0:de.materialused),null!=_&&null!==(se=_.data)&&void 0!==se&&se.materialusedinroofs&&(V.additionalDetails.materialusedinroofs=null==_||null===(ce=_.data)||void 0===ce?void 0:ce.materialusedinroofs),null!=_&&null!==(ve=_.owners)&&void 0!==ve&&null!==(pe=ve.approvedColony)&&void 0!==pe&&pe.code&&(V.additionalDetails.approvedColony=null==_||null===(me=_.owners)||void 0===me||null===(Ee=me.approvedColony)||void 0===Ee?void 0:Ee.code),null!=_&&null!==(fe=_.owners)&&void 0!==fe&&null!==(_e=fe.buildingStatus)&&void 0!==_e&&_e.code&&(V.additionalDetails.buildingStatus=null==_||null===(ge=_.owners)||void 0===ge||null===(Ae=ge.buildingStatus)||void 0===Ae?void 0:Ae.code),null!=_&&null!==(Se=_.owners)&&void 0!==Se&&null!==(he=Se.greenbuilding)&&void 0!==he&&he.code&&(V.additionalDetails.greenbuilding=null==_||null===(be=_.owners)||void 0===be||null===(ye=be.greenbuilding)||void 0===ye?void 0:ye.code),null!=_&&null!==(Ce=_.owners)&&void 0!==Ce&&null!==(Te=Ce.masterPlan)&&void 0!==Te&&Te.code&&(V.additionalDetails.masterPlan=null==_||null===(De=_.owners)||void 0===De||null===(Ne=De.masterPlan)||void 0===Ne?void 0:Ne.code),null!=_&&null!==(Pe=_.owners)&&void 0!==Pe&&null!==(Ie=Pe.proposedSite)&&void 0!==Ie&&Ie.code&&(V.additionalDetails.proposedSite=null==_||null===(Le=_.owners)||void 0===Le||null===(Be=Le.proposedSite)||void 0===Be?void 0:Be.code),null!=_&&null!==(Oe=_.owners)&&void 0!==Oe&&null!==(Re=Oe.purchasedFAR)&&void 0!==Re&&Re.code&&(V.additionalDetails.purchasedFAR=null==_||null===(we=_.owners)||void 0===we||null===(xe=we.purchasedFAR)||void 0===xe?void 0:xe.code),null!=_&&null!==(Me=_.owners)&&void 0!==Me&&null!==(Fe=Me.restrictedArea)&&void 0!==Fe&&Fe.code&&(V.additionalDetails.restrictedArea=null==_||null===(ke=_.owners)||void 0===ke||null===(Ue=ke.restrictedArea)||void 0===Ue?void 0:Ue.code),null!=_&&null!==(He=_.owners)&&void 0!==He&&null!==(We=He.schemes)&&void 0!==We&&We.i18nKey&&(V.additionalDetails.schemes=null==_||null===(je=_.owners)||void 0===je||null===($e=je.schemes)||void 0===$e?void 0:$e.i18nKey),null!=_&&null!==(Ye=_.owners)&&void 0!==Ye&&null!==(ze=Ye.UlbName)&&void 0!==ze&&ze.code&&(V.additionalDetails.UlbName=null==_||null===(Ke=_.owners)||void 0===Ke||null===(Ge=Ke.UlbName)||void 0===Ge?void 0:Ge.code.toLowerCase().replace(/^\w/,e=>e.toUpperCase())),null!=_&&null!==(Ve=_.owners)&&void 0!==Ve&&null!==(qe=Ve.District)&&void 0!==qe&&qe.code&&(V.additionalDetails.District=null==_||null===(Xe=_.owners)||void 0===Xe||null===(Je=Xe.District)||void 0===Je?void 0:Je.code),null!=_&&null!==(Ze=_.owners)&&void 0!==Ze&&Ze.nameofApprovedcolony&&(V.additionalDetails.nameofApprovedcolony=null==_||null===(Qe=_.owners)||void 0===Qe?void 0:Qe.nameofApprovedcolony),null!=_&&null!==(et=_.owners)&&void 0!==et&&et.NocNumber&&(V.additionalDetails.NocNumber=null==_||null===(tt=_.owners)||void 0===tt?void 0:tt.NocNumber),null!=_&&null!==(lt=_.owners)&&void 0!==lt&&null!==(nt=lt.coreArea)&&void 0!==nt&&nt.code&&(V.additionalDetails.coreArea=null==_||null===(it=_.owners)||void 0===it||null===(ot=it.coreArea)||void 0===ot?void 0:ot.code),null!=_&&null!==(at=_.owners)&&void 0!==at&&null!==(rt=at.schemesselection)&&void 0!==rt&&rt.i18nKey&&(V.additionalDetails.schemesselection=null==_||null===(ut=_.owners)||void 0===ut||null===(dt=ut.schemesselection)||void 0===dt?void 0:dt.i18nKey),null!=_&&null!==(st=_.owners)&&void 0!==st&&st.schemeName&&(V.additionalDetails.schemeName=null==_||null===(ct=_.owners)||void 0===ct?void 0:ct.schemeName),null!=_&&null!==(vt=_.owners)&&void 0!==vt&&vt.transferredscheme&&(V.additionalDetails.transferredscheme=null==_||null===(pt=_.owners)||void 0===pt?void 0:pt.transferredscheme),null!=_&&null!==(mt=_.owners)&&void 0!==mt&&null!==(Et=mt.Ulblisttype)&&void 0!==Et&&Et.value&&(V.additionalDetails.Ulblisttype=null==_||null===(ft=_.owners)||void 0===ft||null===(_t=ft.Ulblisttype)||void 0===_t?void 0:_t.value),null!=_&&null!==(gt=_.owners)&&void 0!==gt&&gt.uploadedFile&&(V.additionalDetails.uploadedFileNoc=null==_||null===(At=_.owners)||void 0===At?void 0:At.uploadedFile),null!=_&&null!==(St=_.owners)&&void 0!==St&&null!==(ht=St.rating)&&void 0!==ht&&ht.code&&(V.additionalDetails.rating=null==_||null===(bt=_.owners)||void 0===bt||null===(yt=bt.rating)||void 0===yt?void 0:yt.code),null!=_&&null!==(Ct=_.owners)&&void 0!==Ct&&Ct.greenuploadedFile&&(V.additionalDetails.uploadedFileGreenBuilding=null==_||null===(Tt=_.owners)||void 0===Tt?void 0:Tt.greenuploadedFile),null!=_&&null!==(Dt=_.owners)&&void 0!==Dt&&null!==(Nt=Dt.use)&&void 0!==Nt&&Nt.code&&(V.additionalDetails.use=null==_||null===(Pt=_.owners)||void 0===Pt||null===(It=Pt.use)||void 0===It?void 0:It.code),null!=X&&null!==(Lt=X.info)&&void 0!==Lt&&Lt.name&&(V.additionalDetails.architectName=null==X||null===(Bt=X.info)||void 0===Bt?void 0:Bt.name),null!=X&&null!==(Ot=X.info)&&void 0!==Ot&&Ot.mobileNumber&&(V.additionalDetails.architectMobileNumber=null==X||null===(Rt=X.info)||void 0===Rt?void 0:Rt.mobileNumber),V.landInfo={},V.landInfo.address={},null!=_&&null!==(wt=_.address)&&void 0!==wt&&null!==(xt=wt.city)&&void 0!==xt&&xt.code&&(V.landInfo.address.city=null==_||null===(Mt=_.address)||void 0===Mt||null===(Ft=Mt.city)||void 0===Ft?void 0:Ft.code),null!=_&&null!==(kt=_.address)&&void 0!==kt&&null!==(Ut=kt.locality)&&void 0!==Ut&&Ut.code&&(V.landInfo.address.locality={code:null==_||null===(Ht=_.address)||void 0===Ht||null===(Wt=Ht.locality)||void 0===Wt?void 0:Wt.code}),null!=_&&null!==(jt=_.address)&&void 0!==jt&&jt.pincode&&(V.landInfo.address.pincode=null==_||null===($t=_.address)||void 0===$t?void 0:$t.pincode),null!=_&&null!==(Yt=_.address)&&void 0!==Yt&&Yt.landmark&&(V.landInfo.address.landmark=null==_||null===(zt=_.address)||void 0===zt?void 0:zt.landmark),null!=_&&null!==(Kt=_.address)&&void 0!==Kt&&Kt.street&&(V.landInfo.address.street=null==_||null===(Gt=_.address)||void 0===Gt?void 0:Gt.street),null!=_&&null!==(Vt=_.address)&&void 0!==Vt&&Vt.geoLocation&&(V.landInfo.address.geoLocation=null==_||null===(qt=_.address)||void 0===qt?void 0:qt.geoLocation),V.landInfo.owners=E,V.landInfo.ownershipCategory=I.code,V.landInfo.tenantId=null==_||null===(Xt=_.address)||void 0===Xt||null===(Jt=Xt.city)||void 0===Jt?void 0:Jt.code,V.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:le(e[1])})}),a}(_);let Qt=sessionStorage.getItem("BPA_ARCHITECT_NAME"),el=Qt?JSON.parse(Qt):"ARCHITECT";V.additionalDetails.typeOfArchitect=el,V.additionalDetails.stakeholderName=JSON.parse(sessionStorage.getItem("BPA_STAKEHOLDER_NAME")),V.additionalDetails.stakeholderRegistrationNumber=JSON.parse(sessionStorage.getItem("BPA_STAKEHOLDER_REGISTRATION_NUMBER")),V.additionalDetails.stakeholderAddress=JSON.parse(sessionStorage.getItem("BPA_STAKEHOLDER_ADDRESS"));let tl=sessionStorage.getItem("isSelfCertificationRequired");"undefined"===tl&&(tl="false"),V.additionalDetails.isSelfCertificationRequired=tl.toString(),Digit.OBPSService.create({BPA:V},h).then((e,t)=>{var l,n,i,o,a,r,u,d,s,c,v,p;(null==e||null===(l=e.BPA)||void 0===l?void 0:l.length)>0&&(null==e||null===(n=e.BPA)||void 0===n||null===(i=n[0])||void 0===i||null===(o=i.landInfo)||void 0===o||null===(a=o.owners)||void 0===a||a.forEach(e=>{e.gender={code:e.gender,active:!0,i18nKey:"COMMON_GENDER_"+e.gender}}),e.BPA[0].owners={...G,owners:null==e||null===(r=e.BPA)||void 0===r||null===(u=r[0])||void 0===u||null===(d=u.landInfo)||void 0===d?void 0:d.owners,ownershipCategory:I},e.BPA[0].address=null==e||null===(s=e.BPA)||void 0===s||null===(c=s[0])||void 0===c||null===(v=c.landInfo)||void 0===v?void 0:v.address,e.BPA[0].address.city=_.address.city,e.BPA[0].address.locality=_.address.locality,e.BPA[0].placeName=null==_||null===(p=_.address)||void 0===p?void 0:p.placeName,e.BPA[0].data=_.data,e.BPA[0].BlockIds=function(e){let t={};return e.map((e,l)=>{t["Block_"+e.floorNo]=e.id}),t}(e.BPA[0].landInfo.unit),e.BPA[0].subOccupancy=null==_?void 0:_.subOccupancy,e.BPA[0].uiFlow=null==_?void 0:_.uiFlow,K(!1),f("",e.BPA[0],"",!0))}).catch(e=>{var t,l,n;K(!1),Y({key:"true",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})})}}})}catch(e){return Promise.reject(e)}},onSkip:()=>f(),t:m,isDisabled:y||function(){let e=0;return V&&(null==V||V.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}()||!I||z,forcedError:m(ee)},J?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:T,selectedOption:I,optionsKey:"i18nKey",onSelect:function(e){L(e)},value:I,labelKey:"PT_OWNERSHIP",isDependent:!0})),V.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!=V.length?"#494848":"#FAFAFA"}),style:{width:"100px",display:"inline",background:"black"},onClick:e=>function(e){const t=[...V];1!=t.length&&(t.splice(e,1),1==t.length&&(t[0]={...t[0],isPrimaryOwner:!0}),q(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=[...V];l[e].mobileNumber=t.target.value,j(t.target.value),q(l),l[e].gender&&l[e].mobileNumber&&l[e].name&&C(!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(V),a=(null==t||null===(l=t[e])||void 0===l?void 0:l.mobileNumber)||"";if(Y(null),!a.match(Et("MobileNo")))return Y({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 Y({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==V||null===(i=V[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))Y({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=V[e])||void 0===m?void 0:m.isPrimaryOwner)||!1),q(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?C(!0):C(!1),u&&(C(!1),Y({key:"true",error:!0,message:"BPA_OWNER_VALIDATION_"+(null==u?void 0:u.code)}))}});Y({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=[...V];l[e].name=t.target.value,O(t.target.value),q(l),l[e].gender&&l[e].mobileNumber&&l[e].name&&C(!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:N,selectedOption:e.gender,optionKey:"i18nKey",onSelect:e=>function(e,t){let l=[...V];l[e].gender=t,H(t),q(l),l[e].gender&&l[e].mobileNumber&&l[e].name&&C(!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=[...V];l[e].aadharNumber=t.target.value,M(t.target.value),q(l),l[e].gender&&l[e].mobileNumber&&l[e].name&&C(!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=[...V];l[e].emailId=t.target.value,w(t.target.value),q(l),l[e].gender&&l[e].mobileNumber&&l[e].name&&C(!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=[...V];l.map(e=>{e.isPrimaryOwner=!1}),l[e].isPrimaryOwner=!G||t.target.checked,k(t.target.checked),q(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=[...V];e.push({name:"",gender:"",mobileNumber:null,isPrimaryOwner:!1}),q(e),C(!0)}()},m("BPA_ADD_OWNER")))):null)),$&&l.createElement(o.Toast,{error:null==$?void 0:$.error,warning:null==$?void 0:$.warning,label:m(null==$?void 0:$.message),isDleteBtn:!0,onClose:()=>{Y(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,d,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(),isDisabled:!window.location.href.includes("editApplication")&&!window.location.href.includes("sendbacktocitizen")&&E||S,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(Kl,{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(Gl,{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()),[K,G]=(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))G("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||"")&&G("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){G(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}$/)||G("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&&!K){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)&&!K&&(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),G(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||K,isMultipleAllow:!0,forcedError:x(K)},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)$("Invalid Council Number format! Format should be: CA<YEAR><5 DIGITS> (Year between 1972-2025) Example: CA/2023/12345");else if(null!=B&&B.i18nKey.includes("TOWNPLANNER")&&null===R)$("Invalid AITP/FITP Number format! Format should be: AITP<YEAR><4 DIGITS> (Year between 1972-2025) Example: FITP/2023/1234 or AITP/2023/1234");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 $("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,"Qualification*"),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?$(""):$("Invalid Council Number format! Format should be: CA<YEAR><5 DIGITS> (Year between 1972-2025) Example: CA/2023/12345")},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("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?$(""):$("Invalid AITP/FITP Number format! Format should be: AITP<YEAR><4 DIGITS> (Year between 1972-2025) Example: FITP/2023/1234 or AITP/2023/1234")},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")?"[DECLARATION UNDER SELF-CERTIFICATION SCHEME ('Residential') (BY ARCHITECT)]":null!=B&&B.i18nKey.includes("_ENGINEER")?"[DECLARATION UNDER SELF-CERTIFICATION SCHEME ('Residential') (BY ENGINEER)]":null!=B&&B.i18nKey.includes("SUPERVISOR")?"[DECLARATION UNDER SELF-CERTIFICATION SCHEME ('Residential') (BY DESIGNER)]":"[DECLARATION UNDER SELF-CERTIFICATION SCHEME ('Residential') (BY SUPERVISOR)]",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"}},"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(" "):""}),[K,G]=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("You must be at least 18 years old to proceed"))}else de("Please select gender")},onSkip:()=>B(),t:I,isDisabled:!(H&&ie&&le&&Z)},l.createElement("div",null,l.createElement(o.CardLabel,null,"Firstname*"),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,"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,"Lastname*"),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,"Date of Birth*"),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("You must be at least 18 years old. Please enter a valid date of birth.")):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_OWNER_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;A(!0);let e={Licenses:[{tradeLicenseDetail:{owners:[{gender:null==d||null===(l=d.LicneseDetails)||void 0===l||null===(n=l.gender)||void 0===n?void 0:n.code,mobileNumber:null==d||null===(i=d.LicneseDetails)||void 0===i?void 0:i.mobileNumber,name:null==d||null===(o=d.LicneseDetails)||void 0===o?void 0:o.name,dob:null!=d&&null!==(a=d.LicenseDetails)&&void 0!==a&&a.dateOfBirth?Pt(null==d||null===(r=d.LicenseDetails)||void 0===r?void 0:r.dateOfBirth):null,emailId:null==d||null===(c=d.LicneseDetails)||void 0===c?void 0:c.email,permanentAddress:null==d||null===(p=d.LicneseDetails)||void 0===p?void 0:p.PermanentAddress,correspondenceAddress:s,pan:null==d||null===(m=d.LicneseDetails)||void 0===m?void 0:m.PanNumber}],subOwnerShipCategory:"INDIVIDUAL",tradeUnits:[{tradeType:null==d||null===(f=d.LicneseType)||void 0===f||null===(g=f.LicenseType)||void 0===g?void 0:g.tradeType}],additionalDetail:{qualificationType:null==d||null===(b=d.LicenseType)||void 0===b||null===(y=b.qualificationType)||void 0===y?void 0:y.name,counsilForArchNo:null==d||null===(C=d.LicneseType)||void 0===C?void 0:C.ArchitectNo,isSelfCertificationRequired:null!=d&&null!==(T=d.LicneseType)&&void 0!==T&&T.selfCertification?null==d||null===(D=d.LicneseType)||void 0===D?void 0:D.selfCertification:null,Ulb:null==d||null===(N=d.LicneseDetails)||void 0===N?void 0:N.Ulb},address:{city:"",landmark:"",pincode:null==d||null===(P=d.LicneseDetails)||void 0===P?void 0:P.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("Enter valid 6 digit Pincode");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,"Pincode*"),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("Please enter a valid 6-digit pincode.")})),B&&l.createElement("div",{style:{color:"#d32f2f",fontSize:"12px",marginTop:"4px",marginBottom:"12px"}},B)),l.createElement(o.CardLabel,null,"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}),[K,G]=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")&&G(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:K,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,K,G,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("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("AITP/FITP 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("Selected ULBs"),text:"All ULBs have been selected"}):l.createElement(o.Row,{className:"border-none",label:ee("Selected ULBs"),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===(K=z[0])||void 0===K||null===(G=K.billDetails[0])||void 0===G?void 0:G.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,K,G,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(),[Ke,Ge]=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),[Kt,Gt]=t.useState(""),[Vt,qt]=t.useState(!1),[Xt,Jt]=t.useState(""),[Zt,Qt]=t.useState(null),el={username:jt,password:Kt,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),Ge(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});var vl,pl;Ot||(Ue.additionalDetails.P1charges=null==cl||null===(vl=cl.Bill[0])||void 0===vl||null===(pl=vl.billDetails[0])||void 0===pl?void 0:pl.amount);const ml=window.location.href.includes("sendbacktocitizen");let El=`/digit-ui/citizen/obps/bpa/${null==Dt?void 0:Dt.applicationType.toLowerCase()}/${null==Dt?void 0:Dt.serviceType.toLowerCase()}`;Ot&&(El=`/digit-ui/citizen/obps/editApplication/bpa/${null==Ue?void 0:Ue.tenantId}/${null==Ue?void 0:Ue.applicationNo}`),ml&&(El=`/digit-ui/citizen/obps/sendbacktocitizen/bpa/${null==Ue?void 0:Ue.tenantId}/${null==Ue?void 0:Ue.applicationNo}`);const fl=[{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"}],_l=e=>{const t=e;return(e,l,n)=>e[t]},gl=t.useMemo(()=>fl.map(e=>({Header:et(""+e.name),accessor:_l(e.id),id:e.id})));function Al(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 Sl(e){location.href=e}function hl(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:()=>Sl(El+"/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:()=>Sl(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:()=>Sl(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:""===hl(t)?et("CS_NA"):hl(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:Al(e),columns:gl,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:()=>Sl(El+"/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:()=>Sl(El+"/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===(K=yt.approvedColony)||void 0===K?void 0:K.i18nKey)||(null==Ue||null===(G=Ue.additionalDetails)||void 0===G?void 0:G.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:()=>Sl(El+"/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:"₹ "+Ke}),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(Ke)+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(Ke)+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:Kt,onChange:e=>{Gt(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(Ke)+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,K,G,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===(K=z.billDetails[0])||void 0===K?void 0:K.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===(G=he.Bill)||void 0===G||null===(V=G[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,K,G,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 Ke;(null==je||null===(v=je.pdfFiles)||void 0===v?void 0:v.length)>0&&(null==je||null===(Ke=je.pdfFiles)||void 0===Ke||Ke.map(e=>{"OBPS"==(null==e?void 0:e.module)&&Ye.push(e),"NOC"==(null==e?void 0:e.module)&&ze.push(e)}));const{data:Ge,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===(K=_e.uiFlow)||void 0===K?void 0:K.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===(G=Oe.city)||void 0===G?void 0:G.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==Ge||null===(q=Ge.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==Ge||null===(le=Ge.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==Ge||null===(de=Ge.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,K,G,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===(K=Ae.info)||void 0===K?void 0:K.emailId)||"NA"}]},{title:l("BPA_NEW_TRADE_DETAILS_HEADER_DETAILS"),values:[{title:l("BPA_DETAILS_PIN_LABEL"),value:(null==e||null===(G=e.landInfo)||void 0===G||null===(V=G.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,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;return Promise.resolve({t:l,tenantId:null==t?void 0:t.code,name:`${l(null==t?void 0:t.i18nKey)} ${w=l("ULBGRADE_"+(null==t||null===(n=t.city)||void 0===n?void 0:n.ulbGrade.toUpperCase().replace(" ","_").replace(".","_"))),w.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:(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_OF_ARCH_NO_LABEL"),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("LICENSE_TYPE"),value:(null==e||null===(p=e.applicationData)||void 0===p?void 0:p.licenseType)||"NA"}]},{title:l("BPA_LICENSEE_DETAILS_HEADER_OWNER_INFO"),values:[{title:l("BPA_APPLICANT_NAME_LABEL"),value:(null==e||null===(m=e.applicationData)||void 0===m||null===(E=m.tradeLicenseDetail)||void 0===E||null===(f=E.owners)||void 0===f||null===(_=f[0])||void 0===_?void 0:_.name)||"NA"},{title:l("BPA_OWNER_MOBILE_NO_LABEL"),value:(null==e||null===(g=e.applicationData)||void 0===g||null===(A=g.tradeLicenseDetail)||void 0===A||null===(S=A.owners)||void 0===S||null===(h=S[0])||void 0===h?void 0:h.mobileNumber)||"NA"},{title:l("BPA_APPLICANT_GENDER_LABEL"),value:(null==e||null===(b=e.applicationDetails)||void 0===b||null===(y=b[2])||void 0===y||null===(C=y.values[1])||void 0===C?void 0:C.value)||"NA"},{title:l("BPA_APPLICANT_EMAIL_LABEL"),value:(null==e||null===(T=e.applicationDetails)||void 0===T||null===(D=T[2])||void 0===D||null===(N=D.values[3])||void 0===N?void 0:N.value)||"NA"}]},{title:l("BPA_ADDRESS_LABEL"),values:[{title:l("BPA_PERMANANT_ADDRESS_LABEL"),value:(null==e||null===(P=e.applicationDetails)||void 0===P||null===(I=P[3])||void 0===I||null===(L=I.values[0])||void 0===L?void 0:L.value)||"NA"},{title:l("BPA_APPLICANT_CORRESPONDENCE_ADDRESS_LABEL"),value:(null==e||null===(B=e.applicationDetails)||void 0===B||null===(O=B[4])||void 0===O||null===(R=O.values[0])||void 0===R?void 0:R.value)||"NA"}]}]})}catch(e){return Promise.reject(e)}var w}(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;h(!0);const r=Digit.UserService.getUser(),u={id:null==r||null===(i=r.info)||void 0===i?void 0:i.uuid,tenantId:null==r||null===(o=r.info)||void 0===o?void 0:o.tenantId};let d={transactionNumber:"",edcrNumber:"",planFile:null,tenantId:"",RequestInfo:{apiId:"",ver:"",ts:"",action:"",did:"",authToken:"",key:"",msgId:"",correlationId:"",userInfo:u}};console.log(u,r,"USER INFO");const s=null==t?void 0:t.applicantName,c=null==t||null===(a=t.coreArea)||void 0===a?void 0:a.code,v=null==t?void 0:t.file,m=null==u?void 0:u.tenantId,E=gt();console.log("tenantIdInEDCR",m),console.log("tenantIdInEDCR-DATA",t),d={...d,tenantId:m},d={...d,transactionNumber:E},d={...d,applicantName:s},d={...d,coreArea:c},d={...d,appliactionType:"BUILDING_PLAN_SCRUTINY"},d={...d,applicationSubType:"NEW_CONSTRUCTION"};let _=new FormData;_.append("edcrRequest",JSON.stringify(d)),_.append("planFile",v),Digit.EDCRService.create({data:_},m).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),[K,G]=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 Ke(){return!!ie&&(pe?!pe:!K)}const Ge=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;K&&G(!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,Ge;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,K,G;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===(K=e.values)||void 0===K||null===(G=K[4])||void 0===G?void 0:G.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:K,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:()=>{G(!K),K&&q(!K)}})),!(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:Ke()||"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:Ke()?"submit-bar-disabled":"submit-bar",disabled:Ke(),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===(Ge=Ye[0])||void 0===Ge?void 0:Ge.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:Ge,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:Ge,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,K,G]=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),G()},[]);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,Ke;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 Ge;"APPROVED"===(null==ie||null===(Ge=ie.applicationData)||void 0===Ge?void 0:Ge.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===(Ke=ze.nextActions)||void 0===Ke?void 0:Ke.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)}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,P=D.hasOwnProperty,N=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=P.call(e,I),l=e[I];try{e[I]=void 0;var n=!0}catch(e){}var i=N.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"),z=Object.prototype.hasOwnProperty,Y=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 z.call(t,e)?t[e]:void 0},G.prototype.has=function(e){var t=this.__data__;return $?void 0!==t[e]:Y.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),Pe=Object.prototype.hasOwnProperty,Ne=function(e){return null!=e&&Ee(e.length)&&!w(e)},Ie=function(e){return Ne(e)?be(e):function(e){if(!Ce(e))return De(e);var t=[];for(var l in Object(e))Pe.call(e,l)&&"constructor"!=l&&t.push(l);return t}(e)},Le=Object.prototype.hasOwnProperty,Be=function(e){return Ne(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"),ze=W(C,"Promise"),Ye=W(C,"Set"),Ge=W(C,"WeakMap"),Ke=k($e),Ve=k(j),qe=k(ze),Xe=k(Ye),Je=k(Ge),Ze=O;($e&&"[object DataView]"!=Ze(new $e(new ArrayBuffer(1)))||j&&"[object Map]"!=Ze(new j)||ze&&"[object Promise]"!=Ze(ze.resolve())||Ye&&"[object Set]"!=Ze(new Ye)||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,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(`${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===(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)}},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,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===(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!==(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: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"}}},Pt=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},Nt=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,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===(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===(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)}},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:P,ServiceTypes:N}=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 $=[],z=[],Y=[];return M.forEach(e=>$.push({i18nKey:"WF_BPA_"+e,code:e})),U.forEach(e=>z.push({i18nKey:"WF_BPA_"+e,code:e})),j.forEach(e=>Y.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)})}),z.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==T?void 0:T.code)?Y:"BUILDING_PLAN_SCRUTINY"===(null==T?void 0:T.code)?$:"BUILDING_OC_PLAN_SCRUTINY"===(null==T?void 0:T.code)?z:[],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:P,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:N&&(null==N?void 0:N.length)>0?e.value:N[0],select:e.onChange,onBlur:e.onBlur,option:N,optionKey:"i18nKey",t:f,isBPAREG:!!(N&&(null==N?void 0:N.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,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}};b({...h,...e})}I=h}const{data:O=[],isLoading:R,isSuccess:w}=Digit.Hooks.obps.useOBPSSearch(p,h,c,I,N,{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)||P("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:P})},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,P,N,I,L,B,O,R,w,x,M,F,k,U,H,W,j,$,z,Y,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===(P=D.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===(j=W[0])||void 0===j?void 0:j.gender),value:null==Ee||null===($=Ee.tradeLicenseDetail)||void 0===$||null===(z=$.owners)||void 0===z||null===(Y=z[0])||void 0===Y?void 0:Y.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)},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: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]))},Yt=()=>{var e,a,r,u,d,s,c,v,p,m,E,f,_,g,A,S,h,b,y,C,T,D,P,N,I,L,B,O,R,w,x,M,F,k,U,H,W,j,$,z;const{id:Y}=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: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: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===(P=D.owners)||void 0===P||null===(N=P[0])||void 0===N?void 0:N.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===(z=$.applicationDocuments)||void 0===z?void 0:z.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(zt,{id:Y,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,P;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===(P=c.workflow)||void 0===P?void 0:P.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))}},Pl=["D","DD"],Nl=["YY","YYYY"];function Il(e){return-1!==Pl.indexOf(e)}function Ll(e){return-1!==Nl.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]),P={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})}},N={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},P,N,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,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===(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===(P=D.ComponentRegistryService)||void 0===P?void 0:P.getComponent("ObpsBPASendBackToCitizen"),z=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(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:Yt}),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:z}),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 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 Yl(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([]),[P,N]=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=P[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&&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(Yl,{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(Yl,{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),P=!!Digit.Utils.browser.isMobile(),N=e=>{g(e.target.files[0])};return t.useEffect(()=>{switch(p){case"APPROVE":f(on({t:d,action:p,selectFile:N,uploadedFile:A,error:y,isCommentRequired:!1,setUploadedFile:S,file:_,error:y}));break;case"SEND_TO_ARCHITECT":f(on({t:d,action:p,selectFile:N,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:N,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: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"==p?{height:"92%",boxSizing:"border-box"}:P?{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(Yl,{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,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,j]=t.useState(),[$,z]=t.useState(),[Y,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([...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)}}()},[K]),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),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){z(e.target.files[0]),V(e.target.files[0])},disabled:!R,onDelete:()=>{z(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===(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))))))))},mn=e=>{var a,r,u,s,p,m,E,f,_,g,A,S,h,b,y,C,T,D,P,N,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(),z=Digit.ULBService.getCurrentTenantId(),{data:Y}=Digit.Hooks.obps.useBPADetailsPage(z,{applicationNo:$});let G=Digit.Hooks.useWorkflowDetails({tenantId:null==Y||null===(u=Y.applicationData)||void 0===u?void 0:u.tenantId,id:$,moduleCode:"OBPS",config:{enabled:!!Y}});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==Y||null===(f=Y.applicationData)||void 0===f||null===(_=f.additionalDetails)||void 0===_?void 0:_.khasraNumber,Q=null==Y||null===(g=Y.applicationData)||void 0===g||null===(A=g.additionalDetails)||void 0===A?void 0:A.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===(b=Y.applicationData)||void 0===b||null===(y=b.additionalDetails)||void 0===y?void 0:y.wardnumber,le=null==Y||null===(C=Y.applicationData)||void 0===C||null===(T=C.additionalDetails)||void 0===T?void 0:T.area,ne=null==Y||null===(D=Y.applicationData)||void 0===D||null===(P=D.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>${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]",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)\]/,j=/^\w*$/,$=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,z=/[\\^$.*+?()[\]{}|]/g,Y=RegExp(z.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,Pe="(?:"+[ge+pe+"?",pe,Ae,Se,"[\\ud800-\\udfff]"].join("|")+")",Ne=RegExp("['’]","g"),Ie=RegExp(pe,"g"),Le=RegExp(_e+"(?="+_e+")|"+Pe+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[P]=Me[N]=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[P]=Fe[v]=Fe[p]=Fe[m]=Fe[E]=Fe[f]=Fe[_]=Fe[g]=Fe[N]=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")(),ze=t&&!t.nodeType&&t,Ye=ze&&e&&!e.nodeType&&e,Ge=Ye&&Ye.exports===ze,Ke=Ge&&We.process,Ve=function(){try{return Ye&&Ye.require&&Ye.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,zt(e)+1).replace(G,""):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&&_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({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"});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 zt(e){for(var t=e.length;t--&&K.test(e.charAt(t)););return t}var Yt=bt({"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"}),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._,Pe=me("^"+Se.call(he).replace(z,"\\$&").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),ze=pe.create,Ye=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=Po(sl),Al=Po(cl),Sl=Po(vl),hl=Po(pl),bl=Po(ml),yl=Oe?Oe.prototype:void 0,Cl=yl?yl.valueOf:void 0,Tl=yl?yl.toString:void 0;function Dl(e){if(za(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(!$a(t))return{};if(ze)return ze(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?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))&&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 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 zl(e,t){return e&&fi(t,Sr(t),e)}function Yl(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,zl(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 P:case N: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))}):Ya(e)&&e.forEach(function(n,i){d.set(i,Vl(n,t,l,i,e,a))});var M=O?void 0:(B?S?zi:$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,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}Dl.templateSettings={escape:k,evaluate:U,interpolate:H,variable:"",imports:{_:Dl}},(Dl.prototype=Nl.prototype).constructor=Dl,(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=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,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 _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 za(e)&&vn(e)==o}function An(e,t,l,n,i){return e===t||(null==e||null==t||!za(e)&&!za(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 P=C&&he.call(e,"__wrapped__"),N=T&&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!!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)?Pe:ie).test(Po(e));var t}function bn(e){return"function"==typeof e?e:null==e?Gr:"object"==typeof e?Ra(e)?Pn(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 Pn(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 Nn(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,Nn,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,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}(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,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&&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 zn(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 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?Yl(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(Ne,"")),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=Pl(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?Yi(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 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 ji(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/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: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)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),Nn(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 zi(e){return cn(e,hr,Qi)}var Yi=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 Ye.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)?{}:Pl(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=Yi(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?Po(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 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)),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 zo=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))}),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]:Yl(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):Yl(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){Yl(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],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)})}),Da=Mn(function(e,t){return Fi(e,32,void 0,t,Ut(t,Ki(Da)))}),Pa=Mn(function(e,t){return Fi(e,64,void 0,t,Ut(t,Ki(Pa)))}),Na=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 za(e)&&he.call(e,"callee")&&!Ye.call(e,"callee")},Ra=A.isArray,wa=qe?Pt(qe):function(e){return za(e)&&vn(e)==h};function xa(e){return null!=e&&ja(e.length)&&!Ha(e)}function Ma(e){return za(e)&&xa(e)}var Fa=el||ou,ka=Xe?Pt(Xe):function(e){return za(e)&&vn(e)==u};function Ua(e){if(!za(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 za(e){return null!=e&&"object"==typeof e}var Ya=Je?Pt(Je):function(e){return za(e)&&eo(e)==v};function Ga(e){return"number"==typeof e||za(e)&&vn(e)==p}function Ka(e){if(!za(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?Pt(Ze):function(e){return za(e)&&vn(e)==E},qa=Qe?Pt(Qe):function(e){return za(e)&&eo(e)==f};function Xa(e){return"string"==typeof e||!Ra(e)&&za(e)&&vn(e)==_}function Ja(e){return"symbol"==typeof e||za(e)&&vn(e)==g}var Za=et?Pt(et):function(e){return za(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=Pi(function(e,t,l){null!=t&&"function"!=typeof t.toString&&(t=Ce.call(t)),e[t]=l},$r(Gr)),gr=Pi(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){Nn(e,t,l)}),yr=gi(function(e,t,l,n){Nn(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,zi(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(zi(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=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),Yl(e,t,ga(e[t],e))}),e});function $r(e){return function(){return e}}var zr=Ti(),Yr=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=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 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=Pl(e);return null==t?l:zl(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=zr,Dl.flowRight=Yr,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){Yl(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){Yl(l,n,t(e,n,i))}),l},Dl.matches=function(e){return Dn(Vl(e,1))},Dl.matchesProperty=function(e,t){return Pn(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=Pa,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=Na,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=Pr,Dl.toPairsIn=Nr,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)?Pl(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=zo,Dl.unionBy=Yo,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?[]:Nt(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=Pr,Dl.entriesIn=Nr,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))&&Y.test(e)?e.replace(z,"\\$&"):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||za(e)&&vn(e)==r},Dl.isBuffer=Fa,Dl.isDate=ka,Dl.isElement=function(e){return za(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=Ya,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=za,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 za(e)&&eo(e)==S},Dl.isWeakSet=function(e){return za(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:zn;return l&&oo(e,t,l)&&(t=void 0),n(e,Vi(t,3))},Dl.sortedIndex=function(e,t){return Yn(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=Yn(e,t);if(n<l&&Ia(e[n],t))return n}return-1},Dl.sortedLastIndex=function(e,t){return Yn(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=Yn(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=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},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,zt(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,Yt):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 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},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}();Ye?((Ye.exports=Gt)._=Gt,ze._=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(Pn,{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 Pn(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 Nn=()=>({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:P}=a.useForm(),N=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(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:[]};Tn.isEqual(N,t)||(Object.keys(N).map(e=>{"key"==e||null==N[e]||""==N[e]||null==N[e]||A||S(!0)}),s(e=>e.map(e=>e.key&&e.key===i.key?{...e,...N,...l,...n,...o}:{...e})),D())},[N]),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: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:y,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(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),[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;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(P){const e=function(){if(P.size>=5242880)O(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=c(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: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==P?void 0:P.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),[P,N]=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?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)}}()},[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:P,setUploadedFile:N,businessService:p}))},[r,h,B,R,P]),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:P?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==T?void 0:T.name,fileStoreId:P}]: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,P]=t.useState(null),[N,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?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)}}()},[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:P,businessService:p,error:N}))},[r,S,D,N]),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"})),zn=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement($n,null)),Yn=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:P}=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:N,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),[z,Y]=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==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{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?Y(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==P?void 0:P.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:z,setUploadedFile:Y,businessService:T,assigneeLabel:"WF_ASSIGNEE_NAME_LABEL_BPA",error:G,blockReasonFiltered:M}))},[A,w,V,z,G]),A&&L.form?l.createElement(o.Modal,{headerBarMain:l.createElement(jn,{label:g(L.label.heading)}),headerBarEnd:l.createElement(zn,{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,P,N,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===(P=T.assigner)||void 0===P?void 0:P.uuid]:null!=k&&k.uuid?[null==k?void 0:k.uuid]:null,varificationDocuments:z?[{documentType:(null==A?void 0:A.action)+" DOC",fileName:null==j?void 0:j.name,fileStoreId:z}]:null},action:null==A?void 0:A.action,comment:null==e?void 0:e.comments,assignee:"FIELDINSPECTION_INPROGRESS"===(null==D||null===(N=D.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==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:z?[{documentType:(null==A?void 0:A.action)+" DOC",fileName:null==j?void 0:j.name,fileStoreId:z}]: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,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;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:N,setUploadedFile:I,businessService:E,assigneeLabel:"WF_ASSIGNEE_NAME_LABEL",error:L}))},[d,b,N,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:N?[{documentType:(null==d?void 0:d.action)+" DOC",fileName:null==D?void 0:D.name,fileStoreId:N}]: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),[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){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?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)}}()},[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:P,setUploadedFile:N,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:P,setUploadedFile:N,businessService:m,error:I}))},[r,h,P,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:P?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==T?void 0:T.name,fileStoreId:P}]:[]},additionalDetails:t,comment:(null==e?void 0:e.comments)||"",wfDocuments:P?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==T?void 0:T.name,fileStoreId:P}]: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:P?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==T?void 0:T.name,fileStoreId:P}]:[]}};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:P?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==T?void 0:T.name,fileStoreId:P}]: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:P?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==T?void 0:T.name,fileStoreId:P}]:[]}},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 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&&(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,P]=t.useState(null),[N,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?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)}}()},[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:P,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,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&&_((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),[P,N]=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?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)}}()},[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:P,setUploadedFile:N,businessService:m,isUploading:B}))},[r,h,P]),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};P&&(l.documents=[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==T?void 0:T.name,fileStoreId:P}]),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,P]=t.useState(null),[N,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?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)}}()},[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:P,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,P]=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:P,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(Yn,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: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!=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==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)),g(d)},[!T,!P]),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(Yl,{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,P]=t.useState(null),N=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: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(Yl,{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:P,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 Pi(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 Ni(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,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),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"}},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==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])),P(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))"}},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,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"))))},Yi=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: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 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[z,Y]=t.useState({}),[G,K]=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),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==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(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==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!==(g=f[0])&&void 0!==g&&g.mobileNumber?null==P||null===(A=P.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,N,I,L;const t={date:Z(null==P||null===(T=P.auditDetails)||void 0===T?void 0:T.lastModifiedTime),name:null==e||null===(D=e.assignes)||void 0===D||null===(N=D[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(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,P,N,I,L,R,w,M,F,k,U,H,W,$,Y,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(zi,{bill:null===(r=z.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(Ni,{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===(P=D.nextActions)||void 0===P?void 0:P.length)>0&&l.createElement(Di,{applicationData:null==y?void 0:y.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==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(Yl,{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(Pi,{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===(Y=e.additionalDetails)||void 0===Y||null===(G=Y.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(Yi,{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(`${N}${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(`${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==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 P,N;const e="error"===(null==b?void 0:b.key)?null==b||null===(P=b.error)||void 0===P?void 0:P.message:`ES_${C}_${null==b||null===(N=b.action)||void 0===N?void 0:N.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: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,()=>{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:{...P}},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:N}):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:{...P}},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:P}=Digit.Hooks.obps.useMDMS(v,"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:j,moduleCode:$,timelineStatusPrefix:z,forcedActionPrefix:Y,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:N,demandData:I,id:H,workflowDetails:U,isDataLoading:x,applicationData:M,totalDemandTax:L,totalBalanceTax:B,businessService:W,timelineStatusPrefix:z,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: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,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 P,N;"INITIATE"===(null==e||null===(P=e.Licenses)||void 0===P||null===(N=P[0])||void 0===N?void 0:N.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==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,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:Y,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},Po=T?T.prototype:void 0,No=Po?Po.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(No)return No.call(e)==No.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[P,N]=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,z=null==w||null===(g=w.additionalDetails)||void 0===g?void 0:g.khasraNumber,Y=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>${Y}</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>${z}</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>${Y}</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 zo(e){return null!==e&&"object"==typeof e}function Yo(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:zo,isPlainObject:Yo,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 zo(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]=Yo(t[n])&&Yo(l)?e(t[n],l):Yo(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"))},Pa=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")},Na=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?Pa(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"]),[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: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),N({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"),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(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%"}}],z=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)),z},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: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:j,setSchName:$,setSchemeArea:z,setSelectedCity:Y,setSiteReserved:G,setUlb:K,setUploadMessage:V,setUploadedFile:q,setcoreArea:X,siteReserved:J,siteReservedOptions:Z,tenantIdData:Q,uploadMessage:ee,uploadedFile:te}=(e=>{var l,o,a,r,u,d,s,c,v,p,m,E,f,_,g,A,S,h,b,y,C,T,D,P,N,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)||""),[z,Y]=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===(P=x.owners)||void 0===P||null===(N=P.documents)||void 0===N?void 0:N.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: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),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:Ne,optionsKey:"i18nKey",additionalWrapperClass:"reverse-radio-selection-wrapper",onSelect:we,selectedOption:be}),[Ne,Ce,be]);const xe=null==Ne?void 0:Ne.map(e=>({...e,displayName:Ce(e.i18nKey)})),Me=()=>{if(!H||null==be||!be.code||!z)return!1;if("SCHEME_AREA"===(null==z?void 0:z.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==z?void 0:z.code)||!!X&&!("NO"!==(null==X?void 0:X.code)&&!Z)&&!!Se};return console.log({areaType:z,layoutFile:ge,name:H,siteReserved:ee,ulb:j,dxfFile:Se,areaType:z,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:z,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:z,file:se};return"SCHEME_AREA"===(null==z?void 0:z.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=>{Y(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 le=(null===(a=Digit.SessionStorage.get("CITIZEN.COMMON.HOME.CITY"))||void 0===a?void 0:a.code)||Digit.ULBService.getCurrentTenantId()||"pb.amritsar";const ne=Digit.ULBService.getStateId();console.log(ne,le,r,"TEN STATE");const{isLoading:ie,data:oe}=Digit.Hooks.obps.useMDMS(ne,"tenant",["citymodule"]);return t.useEffect(()=>{var e,t;if((null==oe||null===(e=oe.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==oe||null===(l=oe.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)}},[oe]),t.useEffect(()=>{(ee||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"})},[ee,v,p]),ie||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,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=>{Y(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:z}),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:N,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:P,onDelete:()=>{q(null),H("")},message:te?"1 "+r("PT_ACTION_FILEUPLOADED"):r("ES_NO_FILE_SELECTED_LABEL"),error:C,uploadMessage:ee}))))},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,P]=t.useState(!(null==_||null===(r=_.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==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: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==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,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!=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:N("BPA_BASIC_DETAILS_APPLICATION_TYPE_LABEL"),text:N("WF_BPA_"+(null==b?void 0:b.appliactionType))}),l.createElement(o.Row,{className:"border-none",label:N("BPA_BASIC_DETAILS_SERVICE_TYPE_LABEL"),text:N(null==b?void 0:b.applicationSubType)}),l.createElement(o.Row,{className:"border-none",label:N("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: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==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:N("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 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,_,g,A,S,b,y,C,T,D,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===(f=E[N])||void 0===f?void 0:f.applicationNumber,n=null==h||null===(_=h.Licenses)||void 0===_||null===(g=_[N])||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[N])||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===(P=D[N])||void 0===P?void 0:P.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;let{formData:E,onSelect:f,config:_}=e;const g=window.location.href.includes("editApplication"),[A,S]=t.useState(_),{t:h}=n.useTranslation(),[b,y]=t.useState(""),[C,T]=t.useState(""),[D,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(""),[j,$]=t.useState(""),[z,Y]=t.useState(""),[G,K]=t.useState(""),[V,q]=t.useState(""),[X,J]=t.useState(""),Z=(Digit.ULBService.getCurrentTenantId(),null==E||null===(i=E.uiFlow)||void 0===i?void 0:i.flow),Q=Digit.ULBService.getStateId();t.useEffect(()=>{if(g){const e={..._,inputs:_.inputs.map(e=>"boundaryWallLength"===e.name?{...e,disable:!0}:e)};S(e)}},[Z,g]);const{data:ee,isLoading:te}=Digit.Hooks.obps.useScrutinyDetails(Q,null==E||null===(a=E.data)||void 0===a?void 0:a.scrutinyNumber);return te?l.createElement(o.Loader,null):l.createElement("div",null,l.createElement(zl,{flow:"OCBPA"===Z?"OCBPA":""}),l.createElement(o.FormStep,{config:A,onSelect:e=>{f(null==A?void 0:A.key,{...e})},childrenAtTheBottom:!1,t:h,_defaultValues:null==E?void 0:E.data,onSkip:()=>f()},l.createElement(o.StatusTable,null,l.createElement(o.Row,{className:"border-none",label:h("BPA_BOUNDARY_PLOT_AREA_LABEL"),text:null!=ee&&null!==(r=ee.planDetail)&&void 0!==r&&null!==(u=r.planInformation)&&void 0!==u&&u.plotArea?`${null==ee||null===(d=ee.planDetail)||void 0===d||null===(s=d.planInformation)||void 0===s?void 0:s.plotArea} ${h("BPA_SQ_MTRS_LABEL")}`:"NA"}),l.createElement(o.Row,{className:"border-none",label:h("BPA_PLOT_NUMBER_LABEL"),text:null==ee||null===(c=ee.planDetail)||void 0===c||null===(v=c.planInformation)||void 0===v?void 0:v.plotNo}),l.createElement(o.Row,{className:"border-none",label:h("BPA_KHATHA_NUMBER_LABEL"),text:null==ee||null===(p=ee.planDetail)||void 0===p||null===(m=p.planInformation)||void 0===m?void 0:m.khataNo}))))},ScrutinyDetails:e=>{var a,r,u,d,s,c,v,p,m,E,f,_,g,A,S,h,b,y,C,T,D,P,N,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)||{}),[z,Y]=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(zl,{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(),P=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=P,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 N=sessionStorage.getItem("BPA_ARCHITECT_NAME"),I=N?JSON.parse(N):"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})}),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})})),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===(P=D.blocks)||void 0===P||null===(N=P[0])||void 0===N||null===(I=N.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: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,j]=t.useState((null==L||null===(v=L.owners)||void 0===v?void 0:v.schemes)||""),[$,z]=t.useState((null==L||null===(p=L.owners)||void 0===p?void 0:p.purchasedFAR)||""),[Y,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(P("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(P("PT_FILE_UPLOAD_ERROR"))})},function(){});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}else Ce(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{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(P("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(P("PT_FILE_UPLOAD_ERROR"))})},function(){});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}else Ce(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)}}()},[Ae]);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 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 ze=[];$e&&$e.map(e=>{ze.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 Ge=[];Ye&&Ye.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(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:$,greenbuilding:Y,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==Y?void 0:Y.code)?_e||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)?_e||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&&$&&Y&&K&&J)},l.createElement("div",null,l.createElement(o.CardLabel,null,""+P("BPA_APPROVED_COLONY")),l.createElement(a.Controller,{control:Ke,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:()=>{fe(null),be("")},message:Ee?"1 "+P("FILEUPLOADED"):P("ES_NO_FILE_SELECTED_LABEL"),error:ye,uploadMessage:Te}));default:return null}})(),l.createElement(o.CardLabel,{style:{marginTop:"15px"}},""+P("BPA_MASTER_PLAN")),l.createElement(a.Controller,{control:Ke,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:Ke,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:je,optionKey:"i18nKey",t:P})}));case"NO":default:return null}})(),l.createElement(o.CardLabel,null,""+P("BPA_ULB_NAME")),l.createElement(a.Controller,{control:Ke,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:Ke,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:Ke,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:Ke,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:Ke,name:"schemes",defaultValue:W,rules:{required:P("CORE_COMMON_REQUIRED_ERRMSG")},render:e=>l.createElement(o.Dropdown,{className:"form-field",selected:W,select:j,option:ze,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:Ke,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:Ge,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:Ke,name:"purchasedFAR",defaultValue:$,rules:{required:P("CORE_COMMON_REQUIRED_ERRMSG")},render:e=>l.createElement(o.Dropdown,{className:"form-field",selected:$,select:z,option:Ne,optionKey:"i18nKey",t:P})}),l.createElement(o.CardLabel,null,""+P("BPA_GREEN_BUIDINGS")),l.createElement(a.Controller,{control:Ke,name:"greenbuilding",defaultValue:Y,rules:{required:P("CORE_COMMON_REQUIRED_ERRMSG")},render:e=>l.createElement(o.Dropdown,{className:"form-field",selected:Y,select:G,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:()=>{ge(null),Se("")},message:_e?"1 "+P("FILEUPLOADED"):P("ES_NO_FILE_SELECTED_LABEL"),error:ye,uploadMessage:Te}),l.createElement("br",null),l.createElement(o.CardLabel,null,""+P("BPA_SELECT_RATINGS")),l.createElement(a.Controller,{control:Ke,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:Ke,name:"restrictedArea",defaultValue:K,rules:{required:P("CORE_COMMON_REQUIRED_ERRMSG")},render:e=>l.createElement(o.Dropdown,{className:"form-field",selected:K,select:V,option:Ne,optionKey:"i18nKey",t:P})}),l.createElement(o.CardLabel,null,""+P("BPA_PROPOSED_SITE_TYPE")),l.createElement(a.Controller,{control:Ke,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,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");const h=Digit.ULBService.getCurrentTenantId(),b=Digit.ULBService.getStateId(),[y,C]=t.useState(!A&&!S),[T,D]=t.useState([]),[P,N]=t.useState([]),[I,L]=t.useState(null==_||null===(n=_.owners)||void 0===n?void 0:n.ownershipCategory),[B,O]=t.useState((null==_||null===(i=_.owners)||void 0===i?void 0:i.name)||""),[R,w]=t.useState((null==_||null===(a=_.owners)||void 0===a?void 0:a.emailId)||""),[x,M]=t.useState((null==_||null===(r=_.owners)||void 0===r?void 0:r.aadharNumber)||""),[F,k]=t.useState(!1),[U,H]=t.useState(null==_||null===(u=_.owners)||void 0===u?void 0:u.gender),[W,j]=t.useState((null==_||null===(d=_.owners)||void 0===d?void 0:d.mobileNumber)||""),[$,z]=t.useState(null),[Y,G]=t.useState(!1);Digit.Utils.browser.isMobile();const K=!(null==I||!I.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[V,q]=t.useState((null==_?void 0:_.owners)&&(null==_||null===(p=_.owners)||void 0===p?void 0:p.owners)||[{name:"",gender:"",mobileNumber:null,isPrimaryOwner:!0}]),X=Digit.UserService.getUser();console.log("userrrr",X),t.useEffect(()=>{var e=0;V.map(t=>{null!=t&&t.isPrimaryOwner&&(e=1),C(!(null!=t&&t.name&&null!=t&&t.mobileNumber&&null!=t&&t.gender))}),y||!I||null!=I&&I.code.includes("SINGLEOWNER")||C(1!=e)},[V]),t.useEffect(()=>{const e=mt(V);I&&!K&&(null==e?void 0:e.length)>1&&q([{...e[0],isPrimaryOwner:!0}])},[I]);const{isLoading:J,data:Z}=Digit.Hooks.obps.useMDMS(b,"common-masters",["OwnerShipCategory"]),{data:Q}=Digit.Hooks.obps.useMDMS(b,"common-masters",["GenderType"]);t.useEffect(()=>{var e;const t=null==Z||null===(e=Z["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,".","_")}),D(e)}},[Z]),t.useEffect(()=>{var e;const t=(null==Q||null===(e=Q["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)}},[Q]);const[ee,te]=t.useState(null);function le(e){let t="";return e.map((e,l)=>{t=t+(0!==l?",":"")+e.code}),t}return l.createElement("div",null,l.createElement(zl,{currentStep:3}),l.createElement(o.FormStep,{config:E,onSelect:function(){try{return te(null),Promise.resolve(function(e,t){try{let e=!1,t=[];return t=null==V?void 0:V.map((e,t)=>{var l;return Digit.UserService.userSearch(Digit.ULBService.getStateId(),{userName:null==V||null===(l=V[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],V.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&&z({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==K&&1==V.length)window.scrollTo(0,0),te("BPA_ERROR_MULTIPLE_OWNER");else{let e,K=_.owners;if(e={...K,owners:V,ownershipCategory:I},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,b,y,C,T,D,P,N,L,B,O,R,w,x,M,F,k,U,H,W,j,$,Y,q,J,Z,Q,ee,ne,ie,oe,ae,re,ue,de,se,ce,ve,pe,me,Ee,fe,_e,ge,Ae,Se,he,be,ye,Ce,Te,De,Pe,Ne,Ie,Le,Be,Oe,Re,we,xe,Me,Fe,ke,Ue,He,We,je,$e,ze,Ye,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,Pt,Nt,It,Lt,Bt,Ot,Rt,wt,xt,Mt,Ft,kt,Ut,Ht,Wt,jt,$t,zt,Yt,Gt,Kt,Vt,qt,Xt,Jt;G(!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 V={};V.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,V.riskType=null==_||null===(r=_.data)||void 0===r?void 0:r.riskType,V.applicationType=null==_||null===(u=_.data)||void 0===u?void 0:u.applicationType,V.serviceType=null==_||null===(d=_.data)||void 0===d?void 0:d.serviceType;const te=Digit.UserService.getUser(),Zt=null==te||null===(s=te.info)||void 0===s?void 0:s.uuid;V.tenantId=null==_||null===(c=_.address)||void 0===c||null===(v=c.city)||void 0===v?void 0:v.code,V.workflow={action:"INITIATE",assignes:[null==te||null===(p=te.info)||void 0===p?void 0:p.uuid]},V.accountId=Zt,V.documents=null,V.additionalDetails={GISPlaceName:null==_||null===(m=_.address)||void 0===m?void 0:m.placeName},V.additionalDetails.boundaryWallLength=(null==_||null===(g=_.data)||void 0===g?void 0:g.boundaryWallLength)||"NA",V.additionalDetails.area=(null==_?void 0:_.data.edcrDetails.planDetail.planInformation.plotArea).toString()||"NA",V.additionalDetails.height=(null==_?void 0:_.data.edcrDetails.planDetail.blocks[0].building.buildingHeight).toString()||"NA",V.additionalDetails.usage=(null==_?void 0:_.data.occupancyType)||"NA",V.additionalDetails.builtUpArea=(null==_?void 0:_.data.edcrDetails.planDetail.blocks[0].building.totalBuitUpArea).toString(),V.additionalDetails.ownerName=E.map(e=>e.name).join(","),null!=_&&null!==(A=_.data)&&void 0!==A&&A.registrationDetails&&(V.additionalDetails.registrationDetails=null==_||null===(S=_.data)||void 0===S?void 0:S.registrationDetails),null!=_&&null!==(b=_.data)&&void 0!==b&&b.applicationType&&(V.additionalDetails.applicationType=null==_||null===(y=_.data)||void 0===y?void 0:y.applicationType),null!=_&&null!==(C=_.data)&&void 0!==C&&C.serviceType&&(V.additionalDetails.serviceType=null==_||null===(T=_.data)||void 0===T?void 0:T.serviceType),null!=_&&null!==(D=_.data)&&void 0!==D&&D.wardnumber&&(V.additionalDetails.wardnumber=null==_||null===(P=_.data)||void 0===P?void 0:P.wardnumber),null!=_&&null!==(N=_.data)&&void 0!==N&&N.zonenumber&&(V.additionalDetails.zonenumber=null==_||null===(L=_.data)||void 0===L?void 0:L.zonenumber),null!=_&&null!==(B=_.data)&&void 0!==B&&B.khasraNumber&&(V.additionalDetails.khasraNumber=null==_||null===(O=_.data)||void 0===O?void 0:O.khasraNumber),null!=_&&null!==(R=_.data)&&void 0!==R&&R.applicationType&&(V.additionalDetails.applicationType=null==_||null===(w=_.data)||void 0===w?void 0:w.applicationType),null!=_&&null!==(x=_.data)&&void 0!==x&&x.serviceType&&(V.additionalDetails.serviceType=null==_||null===(M=_.data)||void 0===M?void 0:M.serviceType),null!=_&&null!==(F=_.data)&&void 0!==F&&F.architectid&&(V.additionalDetails.architectid=null==_||null===(k=_.data)||void 0===k?void 0:k.architectid),null!=_&&null!==(U=_.data)&&void 0!==U&&U.propertyuid&&(V.additionalDetails.propertyuid=null==_||null===(H=_.data)||void 0===H?void 0:H.propertyuid),null!=_&&null!==(W=_.data)&&void 0!==W&&W.bathnumber&&(V.additionalDetails.bathnumber=null==_||null===(j=_.data)||void 0===j?void 0:j.bathnumber),null!=_&&null!==($=_.data)&&void 0!==$&&$.kitchenNumber&&(V.additionalDetails.kitchenNumber=null==_||null===(Y=_.data)||void 0===Y?void 0:Y.kitchenNumber),null!=_&&null!==(q=_.data)&&void 0!==q&&q.approxinhabitants&&(V.additionalDetails.approxinhabitants=null==_||null===(J=_.data)||void 0===J?void 0:J.approxinhabitants),null!=_&&null!==(Z=_.data)&&void 0!==Z&&Z.materialusedinfloor&&(V.additionalDetails.materialusedinfloor=null==_||null===(Q=_.data)||void 0===Q?void 0:Q.materialusedinfloor),null!=_&&null!==(ee=_.data)&&void 0!==ee&&ee.distancefromsewer&&(V.additionalDetails.distancefromsewer=null==_||null===(ne=_.data)||void 0===ne?void 0:ne.distancefromsewer),null!=_&&null!==(ie=_.data)&&void 0!==ie&&ie.sourceofwater&&(V.additionalDetails.sourceofwater=null==_||null===(oe=_.data)||void 0===oe?void 0:oe.sourceofwater),null!=_&&null!==(ae=_.data)&&void 0!==ae&&ae.watercloset&&(V.additionalDetails.watercloset=null==_||null===(re=_.data)||void 0===re?void 0:re.watercloset),null!=_&&null!==(ue=_.data)&&void 0!==ue&&ue.materialused&&(V.additionalDetails.materialused=null==_||null===(de=_.data)||void 0===de?void 0:de.materialused),null!=_&&null!==(se=_.data)&&void 0!==se&&se.materialusedinroofs&&(V.additionalDetails.materialusedinroofs=null==_||null===(ce=_.data)||void 0===ce?void 0:ce.materialusedinroofs),null!=_&&null!==(ve=_.owners)&&void 0!==ve&&null!==(pe=ve.approvedColony)&&void 0!==pe&&pe.code&&(V.additionalDetails.approvedColony=null==_||null===(me=_.owners)||void 0===me||null===(Ee=me.approvedColony)||void 0===Ee?void 0:Ee.code),null!=_&&null!==(fe=_.owners)&&void 0!==fe&&null!==(_e=fe.buildingStatus)&&void 0!==_e&&_e.code&&(V.additionalDetails.buildingStatus=null==_||null===(ge=_.owners)||void 0===ge||null===(Ae=ge.buildingStatus)||void 0===Ae?void 0:Ae.code),null!=_&&null!==(Se=_.owners)&&void 0!==Se&&null!==(he=Se.greenbuilding)&&void 0!==he&&he.code&&(V.additionalDetails.greenbuilding=null==_||null===(be=_.owners)||void 0===be||null===(ye=be.greenbuilding)||void 0===ye?void 0:ye.code),null!=_&&null!==(Ce=_.owners)&&void 0!==Ce&&null!==(Te=Ce.masterPlan)&&void 0!==Te&&Te.code&&(V.additionalDetails.masterPlan=null==_||null===(De=_.owners)||void 0===De||null===(Pe=De.masterPlan)||void 0===Pe?void 0:Pe.code),null!=_&&null!==(Ne=_.owners)&&void 0!==Ne&&null!==(Ie=Ne.proposedSite)&&void 0!==Ie&&Ie.code&&(V.additionalDetails.proposedSite=null==_||null===(Le=_.owners)||void 0===Le||null===(Be=Le.proposedSite)||void 0===Be?void 0:Be.code),null!=_&&null!==(Oe=_.owners)&&void 0!==Oe&&null!==(Re=Oe.purchasedFAR)&&void 0!==Re&&Re.code&&(V.additionalDetails.purchasedFAR=null==_||null===(we=_.owners)||void 0===we||null===(xe=we.purchasedFAR)||void 0===xe?void 0:xe.code),null!=_&&null!==(Me=_.owners)&&void 0!==Me&&null!==(Fe=Me.restrictedArea)&&void 0!==Fe&&Fe.code&&(V.additionalDetails.restrictedArea=null==_||null===(ke=_.owners)||void 0===ke||null===(Ue=ke.restrictedArea)||void 0===Ue?void 0:Ue.code),null!=_&&null!==(He=_.owners)&&void 0!==He&&null!==(We=He.schemes)&&void 0!==We&&We.i18nKey&&(V.additionalDetails.schemes=null==_||null===(je=_.owners)||void 0===je||null===($e=je.schemes)||void 0===$e?void 0:$e.i18nKey),null!=_&&null!==(ze=_.owners)&&void 0!==ze&&null!==(Ye=ze.UlbName)&&void 0!==Ye&&Ye.code&&(V.additionalDetails.UlbName=null==_||null===(Ge=_.owners)||void 0===Ge||null===(Ke=Ge.UlbName)||void 0===Ke?void 0:Ke.code.toLowerCase().replace(/^\w/,e=>e.toUpperCase())),null!=_&&null!==(Ve=_.owners)&&void 0!==Ve&&null!==(qe=Ve.District)&&void 0!==qe&&qe.code&&(V.additionalDetails.District=null==_||null===(Xe=_.owners)||void 0===Xe||null===(Je=Xe.District)||void 0===Je?void 0:Je.code),null!=_&&null!==(Ze=_.owners)&&void 0!==Ze&&Ze.nameofApprovedcolony&&(V.additionalDetails.nameofApprovedcolony=null==_||null===(Qe=_.owners)||void 0===Qe?void 0:Qe.nameofApprovedcolony),null!=_&&null!==(et=_.owners)&&void 0!==et&&et.NocNumber&&(V.additionalDetails.NocNumber=null==_||null===(tt=_.owners)||void 0===tt?void 0:tt.NocNumber),null!=_&&null!==(lt=_.owners)&&void 0!==lt&&null!==(nt=lt.coreArea)&&void 0!==nt&&nt.code&&(V.additionalDetails.coreArea=null==_||null===(it=_.owners)||void 0===it||null===(ot=it.coreArea)||void 0===ot?void 0:ot.code),null!=_&&null!==(at=_.owners)&&void 0!==at&&null!==(rt=at.schemesselection)&&void 0!==rt&&rt.i18nKey&&(V.additionalDetails.schemesselection=null==_||null===(ut=_.owners)||void 0===ut||null===(dt=ut.schemesselection)||void 0===dt?void 0:dt.i18nKey),null!=_&&null!==(st=_.owners)&&void 0!==st&&st.schemeName&&(V.additionalDetails.schemeName=null==_||null===(ct=_.owners)||void 0===ct?void 0:ct.schemeName),null!=_&&null!==(vt=_.owners)&&void 0!==vt&&vt.transferredscheme&&(V.additionalDetails.transferredscheme=null==_||null===(pt=_.owners)||void 0===pt?void 0:pt.transferredscheme),null!=_&&null!==(mt=_.owners)&&void 0!==mt&&null!==(Et=mt.Ulblisttype)&&void 0!==Et&&Et.value&&(V.additionalDetails.Ulblisttype=null==_||null===(ft=_.owners)||void 0===ft||null===(_t=ft.Ulblisttype)||void 0===_t?void 0:_t.value),null!=_&&null!==(gt=_.owners)&&void 0!==gt&&gt.uploadedFile&&(V.additionalDetails.uploadedFileNoc=null==_||null===(At=_.owners)||void 0===At?void 0:At.uploadedFile),null!=_&&null!==(St=_.owners)&&void 0!==St&&null!==(ht=St.rating)&&void 0!==ht&&ht.code&&(V.additionalDetails.rating=null==_||null===(bt=_.owners)||void 0===bt||null===(yt=bt.rating)||void 0===yt?void 0:yt.code),null!=_&&null!==(Ct=_.owners)&&void 0!==Ct&&Ct.greenuploadedFile&&(V.additionalDetails.uploadedFileGreenBuilding=null==_||null===(Tt=_.owners)||void 0===Tt?void 0:Tt.greenuploadedFile),null!=_&&null!==(Dt=_.owners)&&void 0!==Dt&&null!==(Pt=Dt.use)&&void 0!==Pt&&Pt.code&&(V.additionalDetails.use=null==_||null===(Nt=_.owners)||void 0===Nt||null===(It=Nt.use)||void 0===It?void 0:It.code),null!=X&&null!==(Lt=X.info)&&void 0!==Lt&&Lt.name&&(V.additionalDetails.architectName=null==X||null===(Bt=X.info)||void 0===Bt?void 0:Bt.name),null!=X&&null!==(Ot=X.info)&&void 0!==Ot&&Ot.mobileNumber&&(V.additionalDetails.architectMobileNumber=null==X||null===(Rt=X.info)||void 0===Rt?void 0:Rt.mobileNumber),V.landInfo={},V.landInfo.address={},null!=_&&null!==(wt=_.address)&&void 0!==wt&&null!==(xt=wt.city)&&void 0!==xt&&xt.code&&(V.landInfo.address.city=null==_||null===(Mt=_.address)||void 0===Mt||null===(Ft=Mt.city)||void 0===Ft?void 0:Ft.code),null!=_&&null!==(kt=_.address)&&void 0!==kt&&null!==(Ut=kt.locality)&&void 0!==Ut&&Ut.code&&(V.landInfo.address.locality={code:null==_||null===(Ht=_.address)||void 0===Ht||null===(Wt=Ht.locality)||void 0===Wt?void 0:Wt.code}),null!=_&&null!==(jt=_.address)&&void 0!==jt&&jt.pincode&&(V.landInfo.address.pincode=null==_||null===($t=_.address)||void 0===$t?void 0:$t.pincode),null!=_&&null!==(zt=_.address)&&void 0!==zt&&zt.landmark&&(V.landInfo.address.landmark=null==_||null===(Yt=_.address)||void 0===Yt?void 0:Yt.landmark),null!=_&&null!==(Gt=_.address)&&void 0!==Gt&&Gt.street&&(V.landInfo.address.street=null==_||null===(Kt=_.address)||void 0===Kt?void 0:Kt.street),null!=_&&null!==(Vt=_.address)&&void 0!==Vt&&Vt.geoLocation&&(V.landInfo.address.geoLocation=null==_||null===(qt=_.address)||void 0===qt?void 0:qt.geoLocation),V.landInfo.owners=E,V.landInfo.ownershipCategory=I.code,V.landInfo.tenantId=null==_||null===(Xt=_.address)||void 0===Xt||null===(Jt=Xt.city)||void 0===Jt?void 0:Jt.code,V.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:le(e[1])})}),a}(_);let Qt=sessionStorage.getItem("BPA_ARCHITECT_NAME"),el=Qt?JSON.parse(Qt):"ARCHITECT";V.additionalDetails.typeOfArchitect=el,V.additionalDetails.stakeholderName=JSON.parse(sessionStorage.getItem("BPA_STAKEHOLDER_NAME")),V.additionalDetails.stakeholderRegistrationNumber=JSON.parse(sessionStorage.getItem("BPA_STAKEHOLDER_REGISTRATION_NUMBER")),V.additionalDetails.stakeholderAddress=JSON.parse(sessionStorage.getItem("BPA_STAKEHOLDER_ADDRESS"));let tl=sessionStorage.getItem("isSelfCertificationRequired");"undefined"===tl&&(tl="false"),V.additionalDetails.isSelfCertificationRequired=tl.toString(),Digit.OBPSService.create({BPA:V},h).then((e,t)=>{var l,n,i,o,a,r,u,d,s,c,v,p;(null==e||null===(l=e.BPA)||void 0===l?void 0:l.length)>0&&(null==e||null===(n=e.BPA)||void 0===n||null===(i=n[0])||void 0===i||null===(o=i.landInfo)||void 0===o||null===(a=o.owners)||void 0===a||a.forEach(e=>{e.gender={code:e.gender,active:!0,i18nKey:"COMMON_GENDER_"+e.gender}}),e.BPA[0].owners={...K,owners:null==e||null===(r=e.BPA)||void 0===r||null===(u=r[0])||void 0===u||null===(d=u.landInfo)||void 0===d?void 0:d.owners,ownershipCategory:I},e.BPA[0].address=null==e||null===(s=e.BPA)||void 0===s||null===(c=s[0])||void 0===c||null===(v=c.landInfo)||void 0===v?void 0:v.address,e.BPA[0].address.city=_.address.city,e.BPA[0].address.locality=_.address.locality,e.BPA[0].placeName=null==_||null===(p=_.address)||void 0===p?void 0:p.placeName,e.BPA[0].data=_.data,e.BPA[0].BlockIds=function(e){let t={};return e.map((e,l)=>{t["Block_"+e.floorNo]=e.id}),t}(e.BPA[0].landInfo.unit),e.BPA[0].subOccupancy=null==_?void 0:_.subOccupancy,e.BPA[0].uiFlow=null==_?void 0:_.uiFlow,G(!1),f("",e.BPA[0],"",!0))}).catch(e=>{var t,l,n;G(!1),z({key:"true",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})})}}})}catch(e){return Promise.reject(e)}},onSkip:()=>f(),t:m,isDisabled:y||function(){let e=0;return V&&(null==V||V.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}()||!I||Y,forcedError:m(ee)},J?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:T,selectedOption:I,optionsKey:"i18nKey",onSelect:function(e){L(e)},value:I,labelKey:"PT_OWNERSHIP",isDependent:!0})),V.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")+" *"),K&&l.createElement(o.LinkButton,{label:l.createElement(o.DeleteIcon,{style:{float:"right",position:"relative",bottom:"5px"},fill:1!=V.length?"#494848":"#FAFAFA"}),style:{width:"100px",display:"inline",background:"black"},onClick:e=>function(e){const t=[...V];1!=t.length&&(t.splice(e,1),1==t.length&&(t[0]={...t[0],isPrimaryOwner:!0}),q(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=[...V];l[e].mobileNumber=t.target.value,j(t.target.value),q(l),l[e].gender&&l[e].mobileNumber&&l[e].name&&C(!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(V),a=(null==t||null===(l=t[e])||void 0===l?void 0:l.mobileNumber)||"";if(z(null),!a.match(Et("MobileNo")))return z({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 z({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==V||null===(i=V[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))z({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=Nt(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=V[e])||void 0===m?void 0:m.isPrimaryOwner)||!1),q(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?C(!0):C(!1),u&&(C(!1),z({key:"true",error:!0,message:"BPA_OWNER_VALIDATION_"+(null==u?void 0:u.code)}))}});z({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=[...V];l[e].name=t.target.value,O(t.target.value),q(l),l[e].gender&&l[e].mobileNumber&&l[e].name&&C(!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:P,selectedOption:e.gender,optionKey:"i18nKey",onSelect:e=>function(e,t){let l=[...V];l[e].gender=t,H(t),q(l),l[e].gender&&l[e].mobileNumber&&l[e].name&&C(!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=[...V];l[e].aadharNumber=t.target.value,M(t.target.value),q(l),l[e].gender&&l[e].mobileNumber&&l[e].name&&C(!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=[...V];l[e].emailId=t.target.value,w(t.target.value),q(l),l[e].gender&&l[e].mobileNumber&&l[e].name&&C(!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})),K&&l.createElement(o.CheckBox,{label:m("BPA_IS_PRIMARY_OWNER_LABEL"),onChange:e=>function(e,t){let l=[...V];l.map(e=>{e.isPrimaryOwner=!1}),l[e].isPrimaryOwner=!K||t.target.checked,k(t.target.checked),q(l)}(t,e),value:e.isPrimaryOwner,checked:e.isPrimaryOwner,style:{paddingTop:"10px"}})))),K?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=[...V];e.push({name:"",gender:"",mobileNumber:null,isPrimaryOwner:!1}),q(e),C(!0)}()},m("BPA_ADD_OWNER")))):null)),$&&l.createElement(o.Toast,{error:null==$?void 0:$.error,warning:null==$?void 0:$.warning,label:m(null==$?void 0:$.message),isDleteBtn:!0,onClose:()=>{z(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,d,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(zl,{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(),isDisabled:!window.location.href.includes("editApplication")&&!window.location.href.includes("sendbacktocitizen")&&E||S,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,P]=t.useState([]),[N,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(()=>{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!=D&&D.length&&null!=N&&N.length){let e=[];D.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})}),f(t)}},[D,N,L,h]),l.createElement("div",null,l.createElement(zl,{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(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,_,g,A,S,h,b,y,C,T,D,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")),j=JSON.parse(sessionStorage.getItem("currentCity"))||{},$=sessionStorage.getItem("currentPincode");JSON.parse(sessionStorage.getItem("currentLocality"));const z=Digit.Hooks.obps.useTenants(),Y=(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(z),fe=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 _e=window.Digit.Utils.browser.isMobile();t.useEffect(()=>{var e;if(!le||!se)if(me=k&&"employee"===k?z.filter(e=>e.code===Y):X?z.filter(e=>{var t;return null==e||null===(t=e.pincode)||void 0===t?void 0:t.some(e=>e==Number(X))}):z,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(zl,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 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:!g,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){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:Nt(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:N,isDisabled:!g,onAdd:P,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: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===(f=E.LicneseType)||void 0===f?void 0:f.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.StakeholderRegistraition)||void 0===_?void 0:_.TradeTypetoRoleMapping;let U=window.location.href.includes("/openlink/");Digit.Utils.browser.isMobile();const[H,W]=t.useState((null===(g=P)||void 0===g?void 0:g.selfCertification)||(null===(A=P)||void 0===A||null===(S=A.formData)||void 0===S?void 0:S.selfCertification)||null);console.log("OBPS_Formdata",P);const[j,$]=t.useState("");function z(){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=z().find(e=>e.i18nKey.includes("ARCHITECT")):"BE/B-Tech"==e.name?t=z().find(e=>e.i18nKey.includes("ENGINEER")):"Diploma in Civil Engineering/Architect"==e.name?t=z().find(e=>e.i18nKey.includes("SUPERVISOR")):"Town and Country Planning"==e.name&&(t=z().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",z()),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"}},C("CS_COMMON_BACK")),l.createElement(zl,{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=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,D("",P)}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),Y(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:z()||{},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,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]:""}),[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]:""}),[z,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(" "):""}),[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===(P=D.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} ${z} ${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:z,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: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===(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),[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(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,f,g,b,y,C,T,D,P,N,I,L;A(!0),console.log("dob here in payload",null!=d&&null!==(l=d.LicneseDetails)&&void 0!==l&&l.dateOfBirth?Nt(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?Nt(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!==(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)=>{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)||""),[P,N]=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(zl,{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(zl,{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),[P,N]=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==P?void 0:P.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 z=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),P=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[P]<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[P]>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,N,I,L;t&&y(null==C?void 0:C.key,{scrutinyNumber:P,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===(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(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=>N({edcrNumber:e.target.value}),value:null==P?void 0:P.edcrNumber,signature:!0,signatureImg:!$&&l.createElement(o.SearchIconSvg,{className:"signature-img",onClick:!$&&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(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:z})),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)),z()},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: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:j,reset:$,formState:z}=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"},...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;z.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"},...N,isSubmitSuccessful:!1})},[z]);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?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(()=>{""!==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",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:z,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:Y,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)||[Nn()]),[A,S]=t.useState({index:-1,type:""}),h=(Digit.ULBService.getCurrentTenantId(),Digit.ULBService.getStateId()),[b,y]=t.useState([]),[C,T]=t.useState([]),[D,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=_.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:P,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:N,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=Nn();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]),P={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})}},N={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},P,N,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,P,N,I,L,B,O,R,w,x,M,F,k,U,H,W,j,$,z,Y,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(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===(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===(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(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===(z=ce.billResponse)||void 0===z||null===(Y=z.Bill)||void 0===Y||null===(G=Y[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,P,N,I,L,B,O,R,w,x,M,F,k,U,H,W,j,$,z,Y,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,Pe,Ne,Ie,Le,Be,Oe,Re,we,xe,Me,Fe;let{onSubmit:ke,value:Ue}=e;const[He,We]=t.useState(),[je,$e]=t.useState(),[ze,Ye]=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:Pt,PrevStateDocuments:Nt,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||""),[zt,Yt]=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),Ye(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 P=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 N=Math.round(10.7639*P>909?(null==it||null===(o=it.BPA)||void 0===o?void 0:o.LabourCess[1].rate)*(10.7639*P):0),I=Math.round(null==it||null===(a=it.BPA)||void 0===a?void 0:a.GaushalaFees[0].rate),L=Math.round(10.7639*P<=500?null==it||null===(r=it.BPA)||void 0===r?void 0:r.MalbaCharges[0].rate:10.7639*P>500&&10.7639*P<=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",N),qe(I),Ke(N),Je(L),Qe(L/2)},[it,null==Ue?void 0:Ue.additionalDetails]);let ll=[];null==Nt||Nt.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});var vl,pl;Ot||(Ue.additionalDetails.P1charges=null==cl||null===(vl=cl.Bill[0])||void 0===vl||null===(pl=vl.billDetails[0])||void 0===pl?void 0:pl.amount);const ml=window.location.href.includes("sendbacktocitizen");let El=`/digit-ui/citizen/obps/bpa/${null==Dt?void 0:Dt.applicationType.toLowerCase()}/${null==Dt?void 0:Dt.serviceType.toLowerCase()}`;Ot&&(El=`/digit-ui/citizen/obps/editApplication/bpa/${null==Ue?void 0:Ue.tenantId}/${null==Ue?void 0:Ue.applicationNo}`),ml&&(El=`/digit-ui/citizen/obps/sendbacktocitizen/bpa/${null==Ue?void 0:Ue.tenantId}/${null==Ue?void 0:Ue.applicationNo}`);const fl=[{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"}],_l=e=>{const t=e;return(e,l,n)=>e[t]},gl=t.useMemo(()=>fl.map(e=>({Header:et(""+e.name),accessor:_l(e.id),id:e.id})));function Al(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 Sl(e){location.href=e}function hl(e){let t=[];return Pt&&Pt["Block_"+(e+1)]&&Pt["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(zl,{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:()=>Sl(El+"/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:()=>Sl(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:()=>Sl(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===(P=rl.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.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:""===hl(t)?et("CS_NA"):hl(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:Al(e),columns:gl,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:()=>Sl(El+"/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===(z=bt.city)||void 0===z?void 0:z.name)||et("CS_NA")}),l.createElement(o.Row,{className:"border-none",label:et("BPA_LOC_MOHALLA_LABEL"),text:(null==bt||null===(Y=bt.locality)||void 0===Y?void 0:Y.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:()=>Sl(El+"/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:()=>Sl(El+"/document-details")}),l.createElement(Yl,{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===(Pe=De.selfCertificationCharges)||void 0===Pe?void 0:Pe.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===(Ne=Ue.additionalDetails)||void 0===Ne?void 0:Ne.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:ze,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")):(Ye(e),sessionStorage.setItem("lessAdjusment",e)):alert(et("Please enter numbers"))}(e.target.value)},required:!0,pattern:"^[0-9]*$"}),parseInt(ze)>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(ze)?parseInt(ze):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?Yt(!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),zt&&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),ze||sessionStorage.setItem("lessAdjusment",0),je||sessionStorage.setItem("otherCharges",0),parseInt(ze)>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,P,N,I,L,B,O,R,w,x,M,F,k,U,H,W,j,$,z,Y,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 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_"+ft(null==e?void 0:e.toUpperCase(),"-","_")):"NA").join(", "))}return a||"NA"}function Ne(e){location.href=e}return pe||ge?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: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:()=>Ne(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:()=>Ne(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:()=>Ne(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===(P=D[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==_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: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: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:()=>Ne(be+"/document-details")}),l.createElement(Yl,{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:()=>Ne(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(Yl,{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===(z=he.Bill)||void 0===z||null===(Y=z[0])||void 0===Y||null===(G=Y.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,P,N,I,L,B,O,R,w,x,M,F,k,U,H,W,j,$,z,Y,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),[Pe,Ne]=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 ze=[],Ye=[];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)&&ze.push(e),"NOC"==(null==e?void 0:e.module)&&Ye.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=()=>{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: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(zl,{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!==(P=D[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} ${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===(z=Ie.planDetail)||void 0===z||null===(Y=z.planInformation)||void 0===Y?void 0:Y.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(Yl,{documents:kt(ze),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(Yl,{documents:kt(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,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),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)=>{De(!1),Ne({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,Pe&&l.createElement(o.Toast,{error:"error"===Pe.key,label:ge("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 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,P,N,I,L,B,O,R,w,x,M,F,k,U,H,W,j,$,z,Y,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===(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===(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===(z=Ae.info)||void 0===z?void 0:z.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==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(Na,{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,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===(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===(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:Pt(e)}}]}})(f),h.mutate(o,{onSuccess:_})}catch(e){}},[]);const D=null==S?void 0:S.split(".")[0],{data:P}=(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=P;console.log("applicationDetails in StakeholderAck",P),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,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(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===(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,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;h(!0);const r=Digit.UserService.getUser(),u={id:null==r||null===(i=r.info)||void 0===i?void 0:i.uuid,tenantId:null==r||null===(o=r.info)||void 0===o?void 0:o.tenantId};let d={transactionNumber:"",edcrNumber:"",planFile:null,tenantId:"",RequestInfo:{apiId:"",ver:"",ts:"",action:"",did:"",authToken:"",key:"",msgId:"",correlationId:"",userInfo:u}};console.log(u,r,"USER INFO");const s=null==t?void 0:t.applicantName,c=null==t||null===(a=t.coreArea)||void 0===a?void 0:a.code,v=null==t?void 0:t.file,m=null==u?void 0:u.tenantId,E=gt();console.log("tenantIdInEDCR",m),console.log("tenantIdInEDCR-DATA",t),d={...d,tenantId:m},d={...d,transactionNumber:E},d={...d,applicantName:s},d={...d,coreArea:c},d={...d,appliactionType:"BUILDING_PLAN_SCRUTINY"},d={...d,applicationSubType:"NEW_CONSTRUCTION"};let _=new FormData;_.append("edcrRequest",JSON.stringify(d)),_.append("planFile",v),Digit.EDCRService.create({data:_},m).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 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: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(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 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=Nt(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,P=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 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;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}`)})()},P=()=>{},N=()=>{};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:P,t:v,formData:_,onAdd:N,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,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;_e.applicationData.additionalDetails.runDate=Nt(e.getFullYear()+"-"+(e.getMonth()+1)+"-"+e.getDate());let D={...null==_e?void 0:_e.applicationData,edcrDetail:[{...null==_e?void 0:_e.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,_,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!=N||(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,N=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 "+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==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(),[z,Y]=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,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),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 ze=()=>{Y(null)};function Ye(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),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(ze,5e3)},onSuccess:(e,t)=>{re(!1),ve.replace("/digit-ui/citizen/obps/response",{data:e}),J(!1),Y({key:"success",action:ee}),setTimeout(ze,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===(P=D.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===(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===(N=_e.applicationDetails)||void 0===N?void 0:N.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,P,N,I,L,B,O,R,w,x,M,F,H,W,$,z,Y,X,J,ee,te,le,ne,oe,ae,re,ue,de,se,ce,ve,me,Ee,fe,ge,Ae,Se,ye,Ce,Te,De,Pe,Ne,Ie,Le,Be,Oe,Re,xe,Me,Fe,ke,Ue,He,We,ze,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(Yl,{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===(P=_e.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(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,P,N,I,L,B,O,R,w,x,M,F,k,H,W,j,$,z,Y,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===(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:$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===(z=e.values)||void 0===z||null===(Y=z[4])||void 0===Y?void 0:Y.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(Yl,{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===(z=he)||void 0===z||null===(Y=z.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==_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:Ye}):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!==(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: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=>{Ye(e.target.value)}},U("WF_BPA_"+(null===(He=he)||void 0===He||null===(We=He.data)||void 0===We||null===(ze=We.nextActions)||void 0===ze||null===(Ke=ze[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:()=>{Pe(!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: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=c(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=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,z&&l.createElement(o.Toast,{error:"error"===z.key,label:U("success"===z.key?`ES_OBPS_${z.action}_UPDATE_SUCCESS`:z.action),onClose:ze,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:P}=Digit.Hooks.obps.SearchMdmsTypes.getFormConfig(D,[]);const{data:N}=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,P,N,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===(P=D.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 $=[];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,N,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,N,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=()=>{};P=null!==(r=P)&&void 0!==r&&r.BuildingPermitConfig?null===(d=P)||void 0===d?void 0:d.BuildingPermitConfig:Jl,P.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",{}),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(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,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===(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===(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)}}(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=()=>{};N=null!==(d=N)&&void 0!==d&&d.OCBuildingPermitConfig?null===(s=N)||void 0===s?void 0:s.OCBuildingPermitConfig:en,N.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"),z=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(z,{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,P]=Digit.Hooks.useSessionStorage("BUILDING_PERMIT_EDITFLOW",{}),N=Digit.ULBService.getStateId();let{data:I}=Digit.Hooks.obps.SearchMdmsTypes.getFormConfig(N,[]);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")&&(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"),$=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,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(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")&&(P(),sessionStorage.setItem("isPermitApplication",!1))},[]);const $=null===(c=Digit)||void 0===c||null===(v=c.ComponentRegistryService)||void 0===v?void 0:v.getComponent("OCBPASendBackCheckPage"),z=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(z,{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}),P={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,P,{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 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 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:P,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,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=Nt(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,$,z]=Digit.Hooks.useSessionStorage("EMPLOYEE_MUTATION_HAPPENED",!1),[Y,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,Pe,Le;let e=[];e=null===(De=Ao(null==pe||null===(Pe=pe.data)||void 0===Pe?void 0:Pe.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=Ne(e)?Array(e.length):[];return function(e,t){if(null==e)return e;if(!Ne(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,ze,Ye,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===(ze=$e.nextActions)||void 0===ze?void 0:ze.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===(Ye=pe.data)||void 0===Ye||null===(Ge=Ye.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===(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==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)})};