@mseva/digit-ui-module-noc 1.0.26 → 1.0.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}var t=require("@mseva/digit-ui-react-components"),n=require("react"),l=e(n),i=require("react-router-dom"),o=require("react-i18next"),a=require("react-hook-form"),r=require("react-query"),u=require("redux"),d=require("react-redux"),s=e(require("exif-js"));function c(){return(c=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var l in n)({}).hasOwnProperty.call(n,l)&&(e[l]=n[l])}return e}).apply(null,arguments)}function v(e,t){if(null==e)return{};var n={};for(var l in e)if({}.hasOwnProperty.call(e,l)){if(-1!==t.indexOf(l))continue;n[l]=e[l]}return n}const m=e=>{if(e){const t=new Date(e);let n=t.getMonth()+1,l=t.getDate(),i=t.getFullYear();return n=(n>9?"":"0")+n,l=(l>9?"":"0")+l,l+"/"+n+"/"+i}return null},p=function(e,t,n){if(void 0===e&&(e=""),void 0===t&&(t=""),void 0===n&&(n=""),""==t)return e;for(;e.includes(t);)e=e.replace(t,n);return e},f=function(e){void 0===e&&(e=!1);let t=window.location.href.includes("/search");const n=[{code:t?"FIRE_NOC":"FIRE_NOC_SRV",active:!0,roles:["FIRE_NOC_APPROVER"],i18nKey:"WF_FIRE_NOC_FIRE_NOC_SRV"},{code:t?"AIRPORT_AUTHORITY":"AIRPORT_NOC_SRV",active:!0,roles:["AIRPORT_AUTHORITY_APPROVER"],i18nKey:"WF_FIRE_NOC_AIRPORT_NOC_SRV"}],l=[],i=Digit.UserService.getUser().info.roles;return n.map((t,o)=>{let{roles:a}=t;a.map(t=>{i.map(i=>{var a;i.code===t&&l.push(e?null==n||null===(a=n[o])||void 0===a?void 0:a.code:null==n?void 0:n[o])})})}),l},E=function(e,t){return void 0===e&&(e=""),void 0===t&&(t=0),decodeURIComponent(e.split("?")[0].split("/").pop().slice(13))||"Document - "+(t+1)},g=function(e,t,n){void 0===e&&(e={}),void 0===t&&(t="");let l=e[t]||"",i=(null==l?void 0:l.split(","))||[],o="";return i.length>0&&i.map(e=>{e.includes("large")||e.includes("medium")||e.includes("small")||(o=e)}),o};var h=function(e,t){return e===t||e!=e&&t!=t},A=function(e,t){for(var n=e.length;n--;)if(h(e[n][0],t))return n;return-1},S=Array.prototype.splice;function N(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var l=e[t];this.set(l[0],l[1])}}N.prototype.clear=function(){this.__data__=[],this.size=0},N.prototype.delete=function(e){var t=this.__data__,n=A(t,e);return!(n<0||(n==t.length-1?t.pop():S.call(t,n,1),--this.size,0))},N.prototype.get=function(e){var t=this.__data__,n=A(t,e);return n<0?void 0:t[n][1]},N.prototype.has=function(e){return A(this.__data__,e)>-1},N.prototype.set=function(e,t){var n=this.__data__,l=A(n,e);return l<0?(++this.size,n.push([e,t])):n[l][1]=t,this};var b=N,C="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function y(e,t){return e(t={exports:{}},t.exports),t.exports}var D,L="object"==typeof C&&C&&C.Object===Object&&C,O="object"==typeof self&&self&&self.Object===Object&&self,T=L||O||Function("return this")(),I=T.Symbol,w=Object.prototype,R=w.hasOwnProperty,P=w.toString,x=I?I.toStringTag:void 0,B=Object.prototype.toString,F=I?I.toStringTag:void 0,M=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":F&&F in Object(e)?function(e){var t=R.call(e,x),n=e[x];try{e[x]=void 0;var l=!0}catch(e){}var i=P.call(e);return l&&(t?e[x]=n:delete e[x]),i}(e):function(e){return B.call(e)}(e)},U=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},k=function(e){if(!U(e))return!1;var t=M(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t},W=T["__core-js_shared__"],H=(D=/[^.]+$/.exec(W&&W.keys&&W.keys.IE_PROTO||""))?"Symbol(src)_1."+D:"",j=Function.prototype.toString,z=function(e){if(null!=e){try{return j.call(e)}catch(e){}try{return e+""}catch(e){}}return""},V=/^\[object .+?Constructor\]$/,G=RegExp("^"+Function.prototype.toString.call(Object.prototype.hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Y=function(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return function(e){return!(!U(e)||(t=e,H&&H in t))&&(k(e)?G:V).test(z(e));var t}(n)?n:void 0},K=Y(T,"Map"),q=Y(Object,"create"),X=Object.prototype.hasOwnProperty,J=Object.prototype.hasOwnProperty;function Q(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var l=e[t];this.set(l[0],l[1])}}Q.prototype.clear=function(){this.__data__=q?q(null):{},this.size=0},Q.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Q.prototype.get=function(e){var t=this.__data__;if(q){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return X.call(t,e)?t[e]:void 0},Q.prototype.has=function(e){var t=this.__data__;return q?void 0!==t[e]:J.call(t,e)},Q.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=q&&void 0===t?"__lodash_hash_undefined__":t,this};var Z=Q,$=function(e,t){var n=e.__data__;return function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}(t)?n["string"==typeof t?"string":"hash"]:n.map};function ee(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var l=e[t];this.set(l[0],l[1])}}ee.prototype.clear=function(){this.size=0,this.__data__={hash:new Z,map:new(K||b),string:new Z}},ee.prototype.delete=function(e){var t=$(this,e).delete(e);return this.size-=t?1:0,t},ee.prototype.get=function(e){return $(this,e).get(e)},ee.prototype.has=function(e){return $(this,e).has(e)},ee.prototype.set=function(e,t){var n=$(this,e),l=n.size;return n.set(e,t),this.size+=n.size==l?0:1,this};var te=ee;function ne(e){var t=this.__data__=new b(e);this.size=t.size}ne.prototype.clear=function(){this.__data__=new b,this.size=0},ne.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},ne.prototype.get=function(e){return this.__data__.get(e)},ne.prototype.has=function(e){return this.__data__.has(e)},ne.prototype.set=function(e,t){var n=this.__data__;if(n instanceof b){var l=n.__data__;if(!K||l.length<199)return l.push([e,t]),this.size=++n.size,this;n=this.__data__=new te(l)}return n.set(e,t),this.size=n.size,this};var le=ne,ie=function(){try{var e=Y(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),oe=function(e,t,n){"__proto__"==t&&ie?ie(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n},ae=Object.prototype.hasOwnProperty,re=function(e,t,n){var l=e[t];ae.call(e,t)&&h(l,n)&&(void 0!==n||t in e)||oe(e,t,n)},ue=function(e,t,n,l){var i=!n;n||(n={});for(var o=-1,a=t.length;++o<a;){var r=t[o],u=l?l(n[r],e[r],r,n,e):void 0;void 0===u&&(u=e[r]),i?oe(n,r,u):re(n,r,u)}return n},de=function(e){return null!=e&&"object"==typeof e},se=function(e){return de(e)&&"[object Arguments]"==M(e)},ce=Object.prototype,ve=ce.hasOwnProperty,me=ce.propertyIsEnumerable,pe=se(function(){return arguments}())?se:function(e){return de(e)&&ve.call(e,"callee")&&!me.call(e,"callee")},fe=Array.isArray,Ee=function(){return!1},ge=y(function(e,t){var n=t&&!t.nodeType&&t,l=n&&e&&!e.nodeType&&e,i=l&&l.exports===n?T.Buffer:void 0;e.exports=(i?i.isBuffer:void 0)||Ee}),_e=/^(?:0|[1-9]\d*)$/,he=function(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&_e.test(e))&&e>-1&&e%1==0&&e<t},Ae=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991},Se={};Se["[object Float32Array]"]=Se["[object Float64Array]"]=Se["[object Int8Array]"]=Se["[object Int16Array]"]=Se["[object Int32Array]"]=Se["[object Uint8Array]"]=Se["[object Uint8ClampedArray]"]=Se["[object Uint16Array]"]=Se["[object Uint32Array]"]=!0,Se["[object Arguments]"]=Se["[object Array]"]=Se["[object ArrayBuffer]"]=Se["[object Boolean]"]=Se["[object DataView]"]=Se["[object Date]"]=Se["[object Error]"]=Se["[object Function]"]=Se["[object Map]"]=Se["[object Number]"]=Se["[object Object]"]=Se["[object RegExp]"]=Se["[object Set]"]=Se["[object String]"]=Se["[object WeakMap]"]=!1;var Ne=function(e){return function(t){return e(t)}},be=y(function(e,t){var n=t&&!t.nodeType&&t,l=n&&e&&!e.nodeType&&e,i=l&&l.exports===n&&L.process,o=function(){try{return l&&l.require&&l.require("util").types||i&&i.binding&&i.binding("util")}catch(e){}}();e.exports=o}),Ce=be&&be.isTypedArray,ye=Ce?Ne(Ce):function(e){return de(e)&&Ae(e.length)&&!!Se[M(e)]},De=Object.prototype.hasOwnProperty,Le=function(e,t){var n=fe(e),l=!n&&pe(e),i=!n&&!l&&ge(e),o=!n&&!l&&!i&&ye(e),a=n||l||i||o,r=a?function(e,t){for(var n=-1,l=Array(e);++n<e;)l[n]=t(n);return l}(e.length,String):[],u=r.length;for(var d in e)!t&&!De.call(e,d)||a&&("length"==d||i&&("offset"==d||"parent"==d)||o&&("buffer"==d||"byteLength"==d||"byteOffset"==d)||he(d,u))||r.push(d);return r},Oe=Object.prototype,Te=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Oe)},Ie=function(e,t){return function(n){return e(t(n))}},we=Ie(Object.keys,Object),Re=Object.prototype.hasOwnProperty,Pe=function(e){return null!=e&&Ae(e.length)&&!k(e)},xe=function(e){return Pe(e)?Le(e):function(e){if(!Te(e))return we(e);var t=[];for(var n in Object(e))Re.call(e,n)&&"constructor"!=n&&t.push(n);return t}(e)},Be=Object.prototype.hasOwnProperty,Fe=function(e){return Pe(e)?Le(e,!0):function(e){if(!U(e))return function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}(e);var t=Te(e),n=[];for(var l in e)("constructor"!=l||!t&&Be.call(e,l))&&n.push(l);return n}(e)},Me=y(function(e,t){var n=t&&!t.nodeType&&t,l=n&&e&&!e.nodeType&&e,i=l&&l.exports===n?T.Buffer:void 0,o=i?i.allocUnsafe:void 0;e.exports=function(e,t){if(t)return e.slice();var n=e.length,l=o?o(n):new e.constructor(n);return e.copy(l),l}}),Ue=function(){return[]},ke=Object.prototype.propertyIsEnumerable,We=Object.getOwnPropertySymbols,He=We?function(e){return null==e?[]:(e=Object(e),function(t,n){for(var l=-1,i=null==t?0:t.length,o=0,a=[];++l<i;){var r=t[l];ke.call(e,r)&&(a[o++]=r)}return a}(We(e)))}:Ue,je=function(e,t){for(var n=-1,l=t.length,i=e.length;++n<l;)e[i+n]=t[n];return e},ze=Ie(Object.getPrototypeOf,Object),Ve=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)je(t,He(e)),e=ze(e);return t}:Ue,Ge=function(e,t,n){var l=t(e);return fe(e)?l:je(l,n(e))},Ye=function(e){return Ge(e,xe,He)},Ke=function(e){return Ge(e,Fe,Ve)},qe=Y(T,"DataView"),Xe=Y(T,"Promise"),Je=Y(T,"Set"),Qe=Y(T,"WeakMap"),Ze=z(qe),$e=z(K),et=z(Xe),tt=z(Je),nt=z(Qe),lt=M;(qe&&"[object DataView]"!=lt(new qe(new ArrayBuffer(1)))||K&&"[object Map]"!=lt(new K)||Xe&&"[object Promise]"!=lt(Xe.resolve())||Je&&"[object Set]"!=lt(new Je)||Qe&&"[object WeakMap]"!=lt(new Qe))&&(lt=function(e){var t=M(e),n="[object Object]"==t?e.constructor:void 0,l=n?z(n):"";if(l)switch(l){case Ze:return"[object DataView]";case $e:return"[object Map]";case et:return"[object Promise]";case tt:return"[object Set]";case nt:return"[object WeakMap]"}return t});var it=lt,ot=Object.prototype.hasOwnProperty,at=T.Uint8Array,rt=function(e){var t=new e.constructor(e.byteLength);return new at(t).set(new at(e)),t},ut=/\w*$/,dt=I?I.prototype:void 0,st=dt?dt.valueOf:void 0,ct=Object.create,vt=function(){function e(){}return function(t){if(!U(t))return{};if(ct)return ct(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}(),mt=be&&be.isMap,pt=mt?Ne(mt):function(e){return de(e)&&"[object Map]"==it(e)},ft=be&&be.isSet,Et=ft?Ne(ft):function(e){return de(e)&&"[object Set]"==it(e)},gt={};gt["[object Arguments]"]=gt["[object Array]"]=gt["[object ArrayBuffer]"]=gt["[object DataView]"]=gt["[object Boolean]"]=gt["[object Date]"]=gt["[object Float32Array]"]=gt["[object Float64Array]"]=gt["[object Int8Array]"]=gt["[object Int16Array]"]=gt["[object Int32Array]"]=gt["[object Map]"]=gt["[object Number]"]=gt["[object Object]"]=gt["[object RegExp]"]=gt["[object Set]"]=gt["[object String]"]=gt["[object Symbol]"]=gt["[object Uint8Array]"]=gt["[object Uint8ClampedArray]"]=gt["[object Uint16Array]"]=gt["[object Uint32Array]"]=!0,gt["[object Error]"]=gt["[object Function]"]=gt["[object WeakMap]"]=!1;var _t=function e(t,n,l,i,o,a){var r,u=1&n,d=2&n,s=4&n;if(l&&(r=o?l(t,i,o,a):l(t)),void 0!==r)return r;if(!U(t))return t;var c=fe(t);if(c){if(r=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&ot.call(e,"index")&&(n.index=e.index,n.input=e.input),n}(t),!u)return function(e,t){var n=-1,l=e.length;for(t||(t=Array(l));++n<l;)t[n]=e[n];return t}(t,r)}else{var v=it(t),m="[object Function]"==v||"[object GeneratorFunction]"==v;if(ge(t))return Me(t,u);if("[object Object]"==v||"[object Arguments]"==v||m&&!o){if(r=d||m?{}:function(e){return"function"!=typeof e.constructor||Te(e)?{}:vt(ze(e))}(t),!u)return d?function(e,t){return ue(e,Ve(e),t)}(t,function(e,t){return e&&ue(t,Fe(t),e)}(r,t)):function(e,t){return ue(e,He(e),t)}(t,function(e,t){return e&&ue(t,xe(t),e)}(r,t))}else{if(!gt[v])return o?t:{};r=function(e,t,n){var l,i,o=e.constructor;switch(t){case"[object ArrayBuffer]":return rt(e);case"[object Boolean]":case"[object Date]":return new o(+e);case"[object DataView]":return function(e,t){var n=t?rt(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,n);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return function(e,t){var n=t?rt(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}(e,n);case"[object Map]":return new o;case"[object Number]":case"[object String]":return new o(e);case"[object RegExp]":return(i=new(l=e).constructor(l.source,ut.exec(l))).lastIndex=l.lastIndex,i;case"[object Set]":return new o;case"[object Symbol]":return st?Object(st.call(e)):{}}}(t,v,u)}}a||(a=new le);var p=a.get(t);if(p)return p;a.set(t,r),Et(t)?t.forEach(function(i){r.add(e(i,n,l,i,t,a))}):pt(t)&&t.forEach(function(i,o){r.set(o,e(i,n,l,o,t,a))});var f=c?void 0:(s?d?Ke:Ye:d?Fe:xe)(t);return function(e,t){for(var n=-1,l=null==e?0:e.length;++n<l&&!1!==t(e[n],n););}(f||t,function(i,o){f&&(i=t[o=i]),re(r,o,e(i,n,l,o,t,a))}),r},ht=function(e){return _t(e,5)},At=y(function(e,t){(function(){var n="Expected a function",l="__lodash_placeholder__",i=[["ary",128],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",32],["partialRight",64],["rearg",256]],o="[object Arguments]",a="[object Array]",r="[object Boolean]",u="[object Date]",d="[object Error]",s="[object Function]",c="[object GeneratorFunction]",v="[object Map]",m="[object Number]",p="[object Object]",f="[object RegExp]",E="[object Set]",g="[object String]",_="[object Symbol]",h="[object WeakMap]",A="[object ArrayBuffer]",S="[object DataView]",N="[object Float32Array]",b="[object Float64Array]",y="[object Int8Array]",D="[object Int16Array]",L="[object Int32Array]",O="[object Uint8Array]",T="[object Uint16Array]",I="[object Uint32Array]",w=/\b__p \+= '';/g,R=/\b(__p \+=) '' \+/g,P=/(__e\(.*?\)|\b__t\)) \+\n'';/g,x=/&(?:amp|lt|gt|quot|#39);/g,B=/[&<>"']/g,F=RegExp(x.source),M=RegExp(B.source),U=/<%-([\s\S]+?)%>/g,k=/<%([\s\S]+?)%>/g,W=/<%=([\s\S]+?)%>/g,H=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,j=/^\w*$/,z=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,V=/[\\^$.*+?()[\]{}|]/g,G=RegExp(V.source),Y=/^\s+/,K=/\s/,q=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,X=/\{\n\/\* \[wrapped with (.+)\] \*/,J=/,? & /,Q=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Z=/[()=,{}\[\]\/\s]/,$=/\\(\\)?/g,ee=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,te=/\w*$/,ne=/^[-+]0x[0-9a-f]+$/i,le=/^0b[01]+$/i,ie=/^\[object .+?Constructor\]$/,oe=/^0o[0-7]+$/i,ae=/^(?:0|[1-9]\d*)$/,re=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ue=/($^)/,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+"]",me="["+se+"]",pe="\\d+",fe="[a-z\\xdf-\\xf6\\xf8-\\xff]",Ee="[^\\ud800-\\udfff"+ce+pe+"\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",ge="\\ud83c[\\udffb-\\udfff]",_e="[^\\ud800-\\udfff]",he="(?:\\ud83c[\\udde6-\\uddff]){2}",Ae="[\\ud800-\\udbff][\\udc00-\\udfff]",Se="[A-Z\\xc0-\\xd6\\xd8-\\xde]",Ne="(?:"+fe+"|"+Ee+")",be="(?:"+Se+"|"+Ee+")",Ce="(?:"+me+"|"+ge+")?",ye="[\\ufe0e\\ufe0f]?"+Ce+"(?:\\u200d(?:"+[_e,he,Ae].join("|")+")[\\ufe0e\\ufe0f]?"+Ce+")*",De="(?:"+["[\\u2700-\\u27bf]",he,Ae].join("|")+")"+ye,Le="(?:"+[_e+me+"?",me,he,Ae,"[\\ud800-\\udfff]"].join("|")+")",Oe=RegExp("['’]","g"),Te=RegExp(me,"g"),Ie=RegExp(ge+"(?="+ge+")|"+Le+ye,"g"),we=RegExp([Se+"?"+fe+"+(?:['’](?:d|ll|m|re|s|t|ve))?(?="+[ve,Se,"$"].join("|")+")",be+"+(?:['’](?:D|LL|M|RE|S|T|VE))?(?="+[ve,Se+Ne,"$"].join("|")+")",Se+"?"+Ne+"+(?:['’](?:d|ll|m|re|s|t|ve))?",Se+"+(?:['’](?:D|LL|M|RE|S|T|VE))?","\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",pe,De].join("|"),"g"),Re=RegExp("[\\u200d\\ud800-\\udfff"+se+"\\ufe0e\\ufe0f]"),Pe=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,xe=["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"],Be=-1,Fe={};Fe[N]=Fe[b]=Fe[y]=Fe[D]=Fe[L]=Fe[O]=Fe["[object Uint8ClampedArray]"]=Fe[T]=Fe[I]=!0,Fe[o]=Fe[a]=Fe[A]=Fe[r]=Fe[S]=Fe[u]=Fe[d]=Fe[s]=Fe[v]=Fe[m]=Fe[p]=Fe[f]=Fe[E]=Fe[g]=Fe[h]=!1;var Me={};Me[o]=Me[a]=Me[A]=Me[S]=Me[r]=Me[u]=Me[N]=Me[b]=Me[y]=Me[D]=Me[L]=Me[v]=Me[m]=Me[p]=Me[f]=Me[E]=Me[g]=Me[_]=Me[O]=Me["[object Uint8ClampedArray]"]=Me[T]=Me[I]=!0,Me[d]=Me[s]=Me[h]=!1;var Ue={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},ke=parseFloat,We=parseInt,He="object"==typeof C&&C&&C.Object===Object&&C,je="object"==typeof self&&self&&self.Object===Object&&self,ze=He||je||Function("return this")(),Ve=t&&!t.nodeType&&t,Ge=Ve&&e&&!e.nodeType&&e,Ye=Ge&&Ge.exports===Ve,Ke=Ye&&He.process,qe=function(){try{return Ge&&Ge.require&&Ge.require("util").types||Ke&&Ke.binding&&Ke.binding("util")}catch(e){}}(),Xe=qe&&qe.isArrayBuffer,Je=qe&&qe.isDate,Qe=qe&&qe.isMap,Ze=qe&&qe.isRegExp,$e=qe&&qe.isSet,et=qe&&qe.isTypedArray;function tt(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function nt(e,t,n,l){for(var i=-1,o=null==e?0:e.length;++i<o;){var a=e[i];t(l,a,n(a),e)}return l}function lt(e,t){for(var n=-1,l=null==e?0:e.length;++n<l&&!1!==t(e[n],n,e););return e}function it(e,t){for(var n=null==e?0:e.length;n--&&!1!==t(e[n],n,e););return e}function ot(e,t){for(var n=-1,l=null==e?0:e.length;++n<l;)if(!t(e[n],n,e))return!1;return!0}function at(e,t){for(var n=-1,l=null==e?0:e.length,i=0,o=[];++n<l;){var a=e[n];t(a,n,e)&&(o[i++]=a)}return o}function rt(e,t){return!(null==e||!e.length)&>(e,t,0)>-1}function ut(e,t,n){for(var l=-1,i=null==e?0:e.length;++l<i;)if(n(t,e[l]))return!0;return!1}function dt(e,t){for(var n=-1,l=null==e?0:e.length,i=Array(l);++n<l;)i[n]=t(e[n],n,e);return i}function st(e,t){for(var n=-1,l=t.length,i=e.length;++n<l;)e[i+n]=t[n];return e}function ct(e,t,n,l){var i=-1,o=null==e?0:e.length;for(l&&o&&(n=e[++i]);++i<o;)n=t(n,e[i],i,e);return n}function vt(e,t,n,l){var i=null==e?0:e.length;for(l&&i&&(n=e[--i]);i--;)n=t(n,e[i],i,e);return n}function mt(e,t){for(var n=-1,l=null==e?0:e.length;++n<l;)if(t(e[n],n,e))return!0;return!1}var pt=St("length");function ft(e,t,n){var l;return n(e,function(e,n,i){if(t(e,n,i))return l=n,!1}),l}function Et(e,t,n,l){for(var i=e.length,o=n+(l?1:-1);l?o--:++o<i;)if(t(e[o],o,e))return o;return-1}function gt(e,t,n){return t==t?function(e,t,n){for(var l=n-1,i=e.length;++l<i;)if(e[l]===t)return l;return-1}(e,t,n):Et(e,ht,n)}function _t(e,t,n,l){for(var i=n-1,o=e.length;++i<o;)if(l(e[i],t))return i;return-1}function ht(e){return e!=e}function At(e,t){var n=null==e?0:e.length;return n?Ct(e,t)/n:NaN}function St(e){return function(t){return null==t?void 0:t[e]}}function Nt(e){return function(t){return null==e?void 0:e[t]}}function bt(e,t,n,l,i){return i(e,function(e,i,o){n=l?(l=!1,e):t(n,e,i,o)}),n}function Ct(e,t){for(var n,l=-1,i=e.length;++l<i;){var o=t(e[l]);void 0!==o&&(n=void 0===n?o:n+o)}return n}function yt(e,t){for(var n=-1,l=Array(e);++n<e;)l[n]=t(n);return l}function Dt(e){return e?e.slice(0,Vt(e)+1).replace(Y,""):e}function Lt(e){return function(t){return e(t)}}function Ot(e,t){return dt(t,function(t){return e[t]})}function Tt(e,t){return e.has(t)}function It(e,t){for(var n=-1,l=e.length;++n<l&>(t,e[n],0)>-1;);return n}function wt(e,t){for(var n=e.length;n--&>(t,e[n],0)>-1;);return n}function Rt(e,t){for(var n=e.length,l=0;n--;)e[n]===t&&++l;return l}var Pt=Nt({"À":"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"}),xt=Nt({"&":"&","<":"<",">":">",'"':""","'":"'"});function Bt(e){return"\\"+Ue[e]}function Ft(e){return Re.test(e)}function Mt(e){var t=-1,n=Array(e.size);return e.forEach(function(e,l){n[++t]=[l,e]}),n}function Ut(e,t){return function(n){return e(t(n))}}function kt(e,t){for(var n=-1,i=e.length,o=0,a=[];++n<i;){var r=e[n];r!==t&&r!==l||(e[n]=l,a[o++]=n)}return a}function Wt(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}function Ht(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=[e,e]}),n}function jt(e){return Ft(e)?function(e){for(var t=Ie.lastIndex=0;Ie.test(e);)++t;return t}(e):pt(e)}function zt(e){return Ft(e)?function(e){return e.match(Ie)||[]}(e):function(e){return e.split("")}(e)}function Vt(e){for(var t=e.length;t--&&K.test(e.charAt(t)););return t}var Gt=Nt({"&":"&","<":"<",">":">",""":'"',"'":"'"}),Yt=function e(t){var C=(t=null==t?ze:Yt.defaults(ze.Object(),t,Yt.pick(ze,xe))).Array,K=t.Date,se=t.Error,ce=t.Function,ve=t.Math,me=t.Object,pe=t.RegExp,fe=t.String,Ee=t.TypeError,ge=C.prototype,_e=me.prototype,he=t["__core-js_shared__"],Ae=ce.prototype.toString,Se=_e.hasOwnProperty,Ne=0,be=function(){var e=/[^.]+$/.exec(he&&he.keys&&he.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),Ce=_e.toString,ye=Ae.call(me),De=ze._,Le=pe("^"+Ae.call(Se).replace(V,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ie=Ye?t.Buffer:void 0,Re=t.Symbol,Ue=t.Uint8Array,He=Ie?Ie.allocUnsafe:void 0,je=Ut(me.getPrototypeOf,me),Ve=me.create,Ge=_e.propertyIsEnumerable,Ke=ge.splice,qe=Re?Re.isConcatSpreadable:void 0,pt=Re?Re.iterator:void 0,Nt=Re?Re.toStringTag:void 0,Kt=function(){try{var e=Qi(me,"defineProperty");return e({},"",{}),e}catch(e){}}(),qt=t.clearTimeout!==ze.clearTimeout&&t.clearTimeout,Xt=K&&K.now!==ze.Date.now&&K.now,Jt=t.setTimeout!==ze.setTimeout&&t.setTimeout,Qt=ve.ceil,Zt=ve.floor,$t=me.getOwnPropertySymbols,en=Ie?Ie.isBuffer:void 0,tn=t.isFinite,nn=ge.join,ln=Ut(me.keys,me),on=ve.max,an=ve.min,rn=K.now,un=t.parseInt,dn=ve.random,sn=ge.reverse,cn=Qi(t,"DataView"),vn=Qi(t,"Map"),mn=Qi(t,"Promise"),pn=Qi(t,"Set"),fn=Qi(t,"WeakMap"),En=Qi(me,"create"),gn=fn&&new fn,_n={},hn=Lo(cn),An=Lo(vn),Sn=Lo(mn),Nn=Lo(pn),bn=Lo(fn),Cn=Re?Re.prototype:void 0,yn=Cn?Cn.valueOf:void 0,Dn=Cn?Cn.toString:void 0;function Ln(e){if(Va(e)&&!Pa(e)&&!(e instanceof wn)){if(e instanceof In)return e;if(Se.call(e,"__wrapped__"))return Oo(e)}return new In(e)}var On=function(){function e(){}return function(t){if(!za(t))return{};if(Ve)return Ve(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function Tn(){}function In(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=void 0}function wn(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=4294967295,this.__views__=[]}function Rn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var l=e[t];this.set(l[0],l[1])}}function Pn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var l=e[t];this.set(l[0],l[1])}}function xn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var l=e[t];this.set(l[0],l[1])}}function Bn(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new xn;++t<n;)this.add(e[t])}function Fn(e){var t=this.__data__=new Pn(e);this.size=t.size}function Mn(e,t){var n=Pa(e),l=!n&&Ra(e),i=!n&&!l&&Ma(e),o=!n&&!l&&!i&&Za(e),a=n||l||i||o,r=a?yt(e.length,fe):[],u=r.length;for(var d in e)!t&&!Se.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 Un(e){var t=e.length;return t?e[xl(0,t-1)]:void 0}function kn(e,t){return No(fi(e),qn(t,0,e.length))}function Wn(e){return No(fi(e))}function Hn(e,t,n){(void 0!==n&&!Ta(e[t],n)||void 0===n&&!(t in e))&&Yn(e,t,n)}function jn(e,t,n){var l=e[t];Se.call(e,t)&&Ta(l,n)&&(void 0!==n||t in e)||Yn(e,t,n)}function zn(e,t){for(var n=e.length;n--;)if(Ta(e[n][0],t))return n;return-1}function Vn(e,t,n,l){return $n(e,function(e,i,o){t(l,e,n(e),o)}),l}function Gn(e,t){return e&&Ei(t,Ar(t),e)}function Yn(e,t,n){"__proto__"==t&&Kt?Kt(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function Kn(e,t){for(var n=-1,l=t.length,i=C(l),o=null==e;++n<l;)i[n]=o?void 0:fr(e,t[n]);return i}function qn(e,t,n){return e==e&&(void 0!==n&&(e=e<=n?e:n),void 0!==t&&(e=e>=t?e:t)),e}function Xn(e,t,n,l,i,a){var d,h=1&t,C=2&t,w=4&t;if(n&&(d=i?n(e,l,i,a):n(e)),void 0!==d)return d;if(!za(e))return e;var R=Pa(e);if(R){if(d=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&Se.call(e,"index")&&(n.index=e.index,n.input=e.input),n}(e),!h)return fi(e,d)}else{var P=eo(e),x=P==s||P==c;if(Ma(e))return di(e,h);if(P==p||P==o||x&&!i){if(d=C||x?{}:no(e),!h)return C?function(e,t){return Ei(e,$i(e),t)}(e,function(e,t){return e&&Ei(t,Sr(t),e)}(d,e)):function(e,t){return Ei(e,Zi(e),t)}(e,Gn(d,e))}else{if(!Me[P])return i?e:{};d=function(e,t,n){var l=e.constructor;switch(t){case A:return si(e);case r:case u:return new l(+e);case S:return function(e,t){var n=t?si(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,n);case N:case b:case y:case D:case L:case O:case"[object Uint8ClampedArray]":case T:case I:return ci(e,n);case v:return new l;case m:case g:return new l(e);case f:return function(e){var t=new e.constructor(e.source,te.exec(e));return t.lastIndex=e.lastIndex,t}(e);case E:return new l;case _:return yn?me(yn.call(e)):{}}}(e,P,h)}}a||(a=new Fn);var B=a.get(e);if(B)return B;a.set(e,d),Xa(e)?e.forEach(function(l){d.add(Xn(l,t,n,l,e,a))}):Ga(e)&&e.forEach(function(l,i){d.set(i,Xn(l,t,n,i,e,a))});var F=R?void 0:(w?C?Vi:zi:C?Sr:Ar)(e);return lt(F||e,function(l,i){F&&(l=e[i=l]),jn(d,i,Xn(l,t,n,i,e,a))}),d}function Jn(e,t,n){var l=n.length;if(null==e)return!l;for(e=me(e);l--;){var i=n[l],o=e[i];if(void 0===o&&!(i in e)||!(0,t[i])(o))return!1}return!0}function Qn(e,t,l){if("function"!=typeof e)throw new Ee(n);return _o(function(){e.apply(void 0,l)},t)}function Zn(e,t,n,l){var i=-1,o=rt,a=!0,r=e.length,u=[],d=t.length;if(!r)return u;n&&(t=dt(t,Lt(n))),l?(o=ut,a=!1):t.length>=200&&(o=Tt,a=!1,t=new Bn(t));e:for(;++i<r;){var s=e[i],c=null==n?s:n(s);if(s=l||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,l)||u.push(s)}return u}Ln.templateSettings={escape:U,evaluate:k,interpolate:W,variable:"",imports:{_:Ln}},(Ln.prototype=Tn.prototype).constructor=Ln,(In.prototype=On(Tn.prototype)).constructor=In,(wn.prototype=On(Tn.prototype)).constructor=wn,Rn.prototype.clear=function(){this.__data__=En?En(null):{},this.size=0},Rn.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Rn.prototype.get=function(e){var t=this.__data__;if(En){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return Se.call(t,e)?t[e]:void 0},Rn.prototype.has=function(e){var t=this.__data__;return En?void 0!==t[e]:Se.call(t,e)},Rn.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=En&&void 0===t?"__lodash_hash_undefined__":t,this},Pn.prototype.clear=function(){this.__data__=[],this.size=0},Pn.prototype.delete=function(e){var t=this.__data__,n=zn(t,e);return!(n<0||(n==t.length-1?t.pop():Ke.call(t,n,1),--this.size,0))},Pn.prototype.get=function(e){var t=this.__data__,n=zn(t,e);return n<0?void 0:t[n][1]},Pn.prototype.has=function(e){return zn(this.__data__,e)>-1},Pn.prototype.set=function(e,t){var n=this.__data__,l=zn(n,e);return l<0?(++this.size,n.push([e,t])):n[l][1]=t,this},xn.prototype.clear=function(){this.size=0,this.__data__={hash:new Rn,map:new(vn||Pn),string:new Rn}},xn.prototype.delete=function(e){var t=Xi(this,e).delete(e);return this.size-=t?1:0,t},xn.prototype.get=function(e){return Xi(this,e).get(e)},xn.prototype.has=function(e){return Xi(this,e).has(e)},xn.prototype.set=function(e,t){var n=Xi(this,e),l=n.size;return n.set(e,t),this.size+=n.size==l?0:1,this},Bn.prototype.add=Bn.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},Bn.prototype.has=function(e){return this.__data__.has(e)},Fn.prototype.clear=function(){this.__data__=new Pn,this.size=0},Fn.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},Fn.prototype.get=function(e){return this.__data__.get(e)},Fn.prototype.has=function(e){return this.__data__.has(e)},Fn.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Pn){var l=n.__data__;if(!vn||l.length<199)return l.push([e,t]),this.size=++n.size,this;n=this.__data__=new xn(l)}return n.set(e,t),this.size=n.size,this};var $n=hi(rl),el=hi(ul,!0);function tl(e,t){var n=!0;return $n(e,function(e,l,i){return n=!!t(e,l,i)}),n}function nl(e,t,n){for(var l=-1,i=e.length;++l<i;){var o=e[l],a=t(o);if(null!=a&&(void 0===r?a==a&&!Qa(a):n(a,r)))var r=a,u=o}return u}function ll(e,t){var n=[];return $n(e,function(e,l,i){t(e,l,i)&&n.push(e)}),n}function il(e,t,n,l,i){var o=-1,a=e.length;for(n||(n=lo),i||(i=[]);++o<a;){var r=e[o];t>0&&n(r)?t>1?il(r,t-1,n,l,i):st(i,r):l||(i[i.length]=r)}return i}var ol=Ai(),al=Ai(!0);function rl(e,t){return e&&ol(e,t,Ar)}function ul(e,t){return e&&al(e,t,Ar)}function dl(e,t){return at(t,function(t){return Wa(e[t])})}function sl(e,t){for(var n=0,l=(t=oi(t,e)).length;null!=e&&n<l;)e=e[Do(t[n++])];return n&&n==l?e:void 0}function cl(e,t,n){var l=t(e);return Pa(e)?l:st(l,n(e))}function vl(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Nt&&Nt in me(e)?function(e){var t=Se.call(e,Nt),n=e[Nt];try{e[Nt]=void 0;var l=!0}catch(e){}var i=Ce.call(e);return l&&(t?e[Nt]=n:delete e[Nt]),i}(e):function(e){return Ce.call(e)}(e)}function ml(e,t){return e>t}function pl(e,t){return null!=e&&Se.call(e,t)}function fl(e,t){return null!=e&&t in me(e)}function El(e,t,n){for(var l=n?ut:rt,i=e[0].length,o=e.length,a=o,r=C(o),u=Infinity,d=[];a--;){var s=e[a];a&&t&&(s=dt(s,Lt(t))),u=an(s.length,u),r[a]=!n&&(t||i>=120&&s.length>=120)?new Bn(a&&s):void 0}s=e[0];var c=-1,v=r[0];e:for(;++c<i&&d.length<u;){var m=s[c],p=t?t(m):m;if(m=n||0!==m?m:0,!(v?Tt(v,p):l(d,p,n))){for(a=o;--a;){var f=r[a];if(!(f?Tt(f,p):l(e[a],p,n)))continue e}v&&v.push(p),d.push(m)}}return d}function gl(e,t,n){var l=null==(e=po(e,t=oi(t,e)))?e:e[Do(ko(t))];return null==l?void 0:tt(l,e,n)}function _l(e){return Va(e)&&vl(e)==o}function hl(e,t,n,l,i){return e===t||(null==e||null==t||!Va(e)&&!Va(t)?e!=e&&t!=t:function(e,t,n,l,i,s){var c=Pa(e),h=Pa(t),N=c?a:eo(e),b=h?a:eo(t),C=(N=N==o?p:N)==p,y=(b=b==o?p:b)==p,D=N==b;if(D&&Ma(e)){if(!Ma(t))return!1;c=!0,C=!1}if(D&&!C)return s||(s=new Fn),c||Za(e)?Hi(e,t,n,l,i,s):function(e,t,n,l,i,o,a){switch(n){case S:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case A:return!(e.byteLength!=t.byteLength||!o(new Ue(e),new Ue(t)));case r:case u:case m:return Ta(+e,+t);case d:return e.name==t.name&&e.message==t.message;case f:case g:return e==t+"";case v:var s=Mt;case E:if(s||(s=Wt),e.size!=t.size&&!(1&l))return!1;var c=a.get(e);if(c)return c==t;l|=2,a.set(e,t);var p=Hi(s(e),s(t),l,i,o,a);return a.delete(e),p;case _:if(yn)return yn.call(e)==yn.call(t)}return!1}(e,t,N,n,l,i,s);if(!(1&n)){var L=C&&Se.call(e,"__wrapped__"),O=y&&Se.call(t,"__wrapped__");if(L||O){var T=L?e.value():e,I=O?t.value():t;return s||(s=new Fn),i(T,I,n,l,s)}}return!!D&&(s||(s=new Fn),function(e,t,n,l,i,o){var a=1&n,r=zi(e),u=r.length;if(u!=zi(t).length&&!a)return!1;for(var d=u;d--;){var s=r[d];if(!(a?s in t:Se.call(t,s)))return!1}var c=o.get(e),v=o.get(t);if(c&&v)return c==t&&v==e;var m=!0;o.set(e,t),o.set(t,e);for(var p=a;++d<u;){var f=e[s=r[d]],E=t[s];if(l)var g=a?l(E,f,s,t,e,o):l(f,E,s,e,t,o);if(!(void 0===g?f===E||i(f,E,n,l,o):g)){m=!1;break}p||(p="constructor"==s)}if(m&&!p){var _=e.constructor,h=t.constructor;_==h||!("constructor"in e)||!("constructor"in t)||"function"==typeof _&&_ instanceof _&&"function"==typeof h&&h instanceof h||(m=!1)}return o.delete(e),o.delete(t),m}(e,t,n,l,i,s))}(e,t,n,l,hl,i))}function Al(e,t,n,l){var i=n.length,o=i,a=!l;if(null==e)return!o;for(e=me(e);i--;){var r=n[i];if(a&&r[2]?r[1]!==e[r[0]]:!(r[0]in e))return!1}for(;++i<o;){var u=(r=n[i])[0],d=e[u],s=r[1];if(a&&r[2]){if(void 0===d&&!(u in e))return!1}else{var c=new Fn;if(l)var v=l(d,s,u,e,t,c);if(!(void 0===v?hl(s,d,3,l,c):v))return!1}}return!0}function Sl(e){return!(!za(e)||(t=e,be&&be in t))&&(Wa(e)?Le:ie).test(Lo(e));var t}function Nl(e){return"function"==typeof e?e:null==e?Yr:"object"==typeof e?Pa(e)?Ll(e[0],e[1]):Dl(e):tu(e)}function bl(e){if(!so(e))return ln(e);var t=[];for(var n in me(e))Se.call(e,n)&&"constructor"!=n&&t.push(n);return t}function Cl(e,t){return e<t}function yl(e,t){var n=-1,l=Ba(e)?C(e.length):[];return $n(e,function(e,i,o){l[++n]=t(e,i,o)}),l}function Dl(e){var t=Ji(e);return 1==t.length&&t[0][2]?vo(t[0][0],t[0][1]):function(n){return n===e||Al(n,e,t)}}function Ll(e,t){return ao(e)&&co(t)?vo(Do(e),t):function(n){var l=fr(n,e);return void 0===l&&l===t?Er(n,e):hl(t,l,3)}}function Ol(e,t,n,l,i){e!==t&&ol(t,function(o,a){if(i||(i=new Fn),za(o))!function(e,t,n,l,i,o,a){var r=Eo(e,n),u=Eo(t,n),d=a.get(u);if(d)Hn(e,n,d);else{var s=o?o(r,u,n+"",e,t,a):void 0,c=void 0===s;if(c){var v=Pa(u),m=!v&&Ma(u),p=!v&&!m&&Za(u);s=u,v||m||p?Pa(r)?s=r:Fa(r)?s=fi(r):m?(c=!1,s=di(u,!0)):p?(c=!1,s=ci(u,!0)):s=[]:Ka(u)||Ra(u)?(s=r,Ra(r)?s=ar(r):za(r)&&!Wa(r)||(s=no(u))):c=!1}c&&(a.set(u,s),i(s,u,l,o,a),a.delete(u)),Hn(e,n,s)}}(e,t,a,n,Ol,l,i);else{var r=l?l(Eo(e,a),o,a+"",e,t,i):void 0;void 0===r&&(r=o),Hn(e,a,r)}},Sr)}function Tl(e,t){var n=e.length;if(n)return io(t+=t<0?n:0,n)?e[t]:void 0}function Il(e,t,n){t=t.length?dt(t,function(e){return Pa(e)?function(t){return sl(t,1===e.length?e[0]:e)}:e}):[Yr];var l=-1;return t=dt(t,Lt(qi())),function(e,t){var l=e.length;for(e.sort(function(e,t){return function(e,t,n){for(var l=-1,i=e.criteria,o=t.criteria,a=i.length,r=n.length;++l<a;){var u=vi(i[l],o[l]);if(u)return l>=r?u:u*("desc"==n[l]?-1:1)}return e.index-t.index}(e,t,n)});l--;)e[l]=e[l].value;return e}(yl(e,function(e,n,i){return{criteria:dt(t,function(t){return t(e)}),index:++l,value:e}}))}function wl(e,t,n){for(var l=-1,i=t.length,o={};++l<i;){var a=t[l],r=sl(e,a);n(r,a)&&kl(o,oi(a,e),r)}return o}function Rl(e,t,n,l){var i=l?_t:gt,o=-1,a=t.length,r=e;for(e===t&&(t=fi(t)),n&&(r=dt(e,Lt(n)));++o<a;)for(var u=0,d=t[o],s=n?n(d):d;(u=i(r,s,u,l))>-1;)r!==e&&Ke.call(r,u,1),Ke.call(e,u,1);return e}function Pl(e,t){for(var n=e?t.length:0,l=n-1;n--;){var i=t[n];if(n==l||i!==o){var o=i;io(i)?Ke.call(e,i,1):Ql(e,i)}}return e}function xl(e,t){return e+Zt(dn()*(t-e+1))}function Bl(e,t){var n="";if(!e||t<1||t>9007199254740991)return n;do{t%2&&(n+=e),(t=Zt(t/2))&&(e+=e)}while(t);return n}function Fl(e,t){return ho(mo(e,t,Yr),e+"")}function Ml(e){return Un(Tr(e))}function Ul(e,t){var n=Tr(e);return No(n,qn(t,0,n.length))}function kl(e,t,n,l){if(!za(e))return e;for(var i=-1,o=(t=oi(t,e)).length,a=o-1,r=e;null!=r&&++i<o;){var u=Do(t[i]),d=n;if("__proto__"===u||"constructor"===u||"prototype"===u)return e;if(i!=a){var s=r[u];void 0===(d=l?l(s,u,r):void 0)&&(d=za(s)?s:io(t[i+1])?[]:{})}jn(r,u,d),r=r[u]}return e}var Wl=gn?function(e,t){return gn.set(e,t),e}:Yr,Hl=Kt?function(e,t){return Kt(e,"toString",{configurable:!0,enumerable:!1,value:zr(t),writable:!0})}:Yr;function jl(e){return No(Tr(e))}function zl(e,t,n){var l=-1,i=e.length;t<0&&(t=-t>i?0:i+t),(n=n>i?i:n)<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var o=C(i);++l<i;)o[l]=e[l+t];return o}function Vl(e,t){var n;return $n(e,function(e,l,i){return!(n=t(e,l,i))}),!!n}function Gl(e,t,n){var l=0,i=null==e?l:e.length;if("number"==typeof t&&t==t&&i<=2147483647){for(;l<i;){var o=l+i>>>1,a=e[o];null!==a&&!Qa(a)&&(n?a<=t:a<t)?l=o+1:i=o}return i}return Yl(e,t,Yr,n)}function Yl(e,t,n,l){var i=0,o=null==e?0:e.length;if(0===o)return 0;for(var a=(t=n(t))!=t,r=null===t,u=Qa(t),d=void 0===t;i<o;){var s=Zt((i+o)/2),c=n(e[s]),v=void 0!==c,m=null===c,p=c==c,f=Qa(c);if(a)var E=l||p;else E=d?p&&(l||v):r?p&&v&&(l||!m):u?p&&v&&!m&&(l||!f):!m&&!f&&(l?c<=t:c<t);E?i=s+1:o=s}return an(o,4294967294)}function Kl(e,t){for(var n=-1,l=e.length,i=0,o=[];++n<l;){var a=e[n],r=t?t(a):a;if(!n||!Ta(r,u)){var u=r;o[i++]=0===a?0:a}}return o}function ql(e){return"number"==typeof e?e:Qa(e)?NaN:+e}function Xl(e){if("string"==typeof e)return e;if(Pa(e))return dt(e,Xl)+"";if(Qa(e))return Dn?Dn.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Jl(e,t,n){var l=-1,i=rt,o=e.length,a=!0,r=[],u=r;if(n)a=!1,i=ut;else if(o>=200){var d=t?null:Bi(e);if(d)return Wt(d);a=!1,i=Tt,u=new Bn}else u=t?[]:r;e:for(;++l<o;){var s=e[l],c=t?t(s):s;if(s=n||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,n)||(u!==r&&u.push(c),r.push(s))}return r}function Ql(e,t){return null==(e=po(e,t=oi(t,e)))||delete e[Do(ko(t))]}function Zl(e,t,n,l){return kl(e,t,n(sl(e,t)),l)}function $l(e,t,n,l){for(var i=e.length,o=l?i:-1;(l?o--:++o<i)&&t(e[o],o,e););return n?zl(e,l?0:o,l?o+1:i):zl(e,l?o+1:0,l?i:o)}function ei(e,t){var n=e;return n instanceof wn&&(n=n.value()),ct(t,function(e,t){return t.func.apply(t.thisArg,st([e],t.args))},n)}function ti(e,t,n){var l=e.length;if(l<2)return l?Jl(e[0]):[];for(var i=-1,o=C(l);++i<l;)for(var a=e[i],r=-1;++r<l;)r!=i&&(o[i]=Zn(o[i]||a,e[r],t,n));return Jl(il(o,1),t,n)}function ni(e,t,n){for(var l=-1,i=e.length,o=t.length,a={};++l<i;)n(a,e[l],l<o?t[l]:void 0);return a}function li(e){return Fa(e)?e:[]}function ii(e){return"function"==typeof e?e:Yr}function oi(e,t){return Pa(e)?e:ao(e,t)?[e]:yo(rr(e))}var ai=Fl;function ri(e,t,n){var l=e.length;return n=void 0===n?l:n,!t&&n>=l?e:zl(e,t,n)}var ui=qt||function(e){return ze.clearTimeout(e)};function di(e,t){if(t)return e.slice();var n=e.length,l=He?He(n):new e.constructor(n);return e.copy(l),l}function si(e){var t=new e.constructor(e.byteLength);return new Ue(t).set(new Ue(e)),t}function ci(e,t){var n=t?si(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function vi(e,t){if(e!==t){var n=void 0!==e,l=null===e,i=e==e,o=Qa(e),a=void 0!==t,r=null===t,u=t==t,d=Qa(t);if(!r&&!d&&!o&&e>t||o&&a&&u&&!r&&!d||l&&a&&u||!n&&u||!i)return 1;if(!l&&!o&&!d&&e<t||d&&n&&i&&!l&&!o||r&&n&&i||!a&&i||!u)return-1}return 0}function mi(e,t,n,l){for(var i=-1,o=e.length,a=n.length,r=-1,u=t.length,d=on(o-a,0),s=C(u+d),c=!l;++r<u;)s[r]=t[r];for(;++i<a;)(c||i<o)&&(s[n[i]]=e[i]);for(;d--;)s[r++]=e[i++];return s}function pi(e,t,n,l){for(var i=-1,o=e.length,a=-1,r=n.length,u=-1,d=t.length,s=on(o-r,0),c=C(s+d),v=!l;++i<s;)c[i]=e[i];for(var m=i;++u<d;)c[m+u]=t[u];for(;++a<r;)(v||i<o)&&(c[m+n[a]]=e[i++]);return c}function fi(e,t){var n=-1,l=e.length;for(t||(t=C(l));++n<l;)t[n]=e[n];return t}function Ei(e,t,n,l){var i=!n;n||(n={});for(var o=-1,a=t.length;++o<a;){var r=t[o],u=l?l(n[r],e[r],r,n,e):void 0;void 0===u&&(u=e[r]),i?Yn(n,r,u):jn(n,r,u)}return n}function gi(e,t){return function(n,l){var i=Pa(n)?nt:Vn,o=t?t():{};return i(n,e,qi(l,2),o)}}function _i(e){return Fl(function(t,n){var l=-1,i=n.length,o=i>1?n[i-1]:void 0,a=i>2?n[2]:void 0;for(o=e.length>3&&"function"==typeof o?(i--,o):void 0,a&&oo(n[0],n[1],a)&&(o=i<3?void 0:o,i=1),t=me(t);++l<i;){var r=n[l];r&&e(t,r,l,o)}return t})}function hi(e,t){return function(n,l){if(null==n)return n;if(!Ba(n))return e(n,l);for(var i=n.length,o=t?i:-1,a=me(n);(t?o--:++o<i)&&!1!==l(a[o],o,a););return n}}function Ai(e){return function(t,n,l){for(var i=-1,o=me(t),a=l(t),r=a.length;r--;){var u=a[e?r:++i];if(!1===n(o[u],u,o))break}return t}}function Si(e){return function(t){var n=Ft(t=rr(t))?zt(t):void 0,l=n?n[0]:t.charAt(0),i=n?ri(n,1).join(""):t.slice(1);return l[e]()+i}}function Ni(e){return function(t){return ct(Wr(Rr(t).replace(Oe,"")),e,"")}}function bi(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var n=On(e.prototype),l=e.apply(n,t);return za(l)?l:n}}function Ci(e){return function(t,n,l){var i=me(t);if(!Ba(t)){var o=qi(n,3);t=Ar(t),n=function(e){return o(i[e],e,i)}}var a=e(t,n,l);return a>-1?i[o?t[a]:a]:void 0}}function yi(e){return ji(function(t){var l=t.length,i=l,o=In.prototype.thru;for(e&&t.reverse();i--;){var a=t[i];if("function"!=typeof a)throw new Ee(n);if(o&&!r&&"wrapper"==Yi(a))var r=new In([],!0)}for(i=r?i:l;++i<l;){var u=Yi(a=t[i]),d="wrapper"==u?Gi(a):void 0;r=d&&ro(d[0])&&424==d[1]&&!d[4].length&&1==d[9]?r[Yi(d[0])].apply(r,d[3]):1==a.length&&ro(a)?r[u]():r.thru(a)}return function(){var e=arguments,n=e[0];if(r&&1==e.length&&Pa(n))return r.plant(n).value();for(var i=0,o=l?t[i].apply(this,e):n;++i<l;)o=t[i].call(this,o);return o}})}function Di(e,t,n,l,i,o,a,r,u,d){var s=128&t,c=1&t,v=2&t,m=24&t,p=512&t,f=v?void 0:bi(e);return function E(){for(var g=arguments.length,_=C(g),h=g;h--;)_[h]=arguments[h];if(m)var A=Ki(E),S=Rt(_,A);if(l&&(_=mi(_,l,i,m)),o&&(_=pi(_,o,a,m)),g-=S,m&&g<d){var N=kt(_,A);return Pi(e,t,Di,E.placeholder,n,_,N,r,u,d-g)}var b=c?n:this,y=v?b[e]:e;return g=_.length,r?_=fo(_,r):p&&g>1&&_.reverse(),s&&u<g&&(_.length=u),this&&this!==ze&&this instanceof E&&(y=f||bi(y)),y.apply(b,_)}}function Li(e,t){return function(n,l){return function(e,t,n,l){return rl(e,function(e,i,o){t(l,n(e),i,o)}),l}(n,e,t(l),{})}}function Oi(e,t){return function(n,l){var i;if(void 0===n&&void 0===l)return t;if(void 0!==n&&(i=n),void 0!==l){if(void 0===i)return l;"string"==typeof n||"string"==typeof l?(n=Xl(n),l=Xl(l)):(n=ql(n),l=ql(l)),i=e(n,l)}return i}}function Ti(e){return ji(function(t){return t=dt(t,Lt(qi())),Fl(function(n){var l=this;return e(t,function(e){return tt(e,l,n)})})})}function Ii(e,t){var n=(t=void 0===t?" ":Xl(t)).length;if(n<2)return n?Bl(t,e):t;var l=Bl(t,Qt(e/jt(t)));return Ft(t)?ri(zt(l),0,e).join(""):l.slice(0,e)}function wi(e){return function(t,n,l){return l&&"number"!=typeof l&&oo(t,n,l)&&(n=l=void 0),t=nr(t),void 0===n?(n=t,t=0):n=nr(n),function(e,t,n,l){for(var i=-1,o=on(Qt((t-e)/(n||1)),0),a=C(o);o--;)a[l?o:++i]=e,e+=n;return a}(t,n,l=void 0===l?t<n?1:-1:nr(l),e)}}function Ri(e){return function(t,n){return"string"==typeof t&&"string"==typeof n||(t=or(t),n=or(n)),e(t,n)}}function Pi(e,t,n,l,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=n.apply(void 0,c);return ro(e)&&go(v,c),v.placeholder=l,Ao(v,e,t)}function xi(e){var t=ve[e];return function(e,n){if(e=or(e),(n=null==n?0:an(lr(n),292))&&tn(e)){var l=(rr(e)+"e").split("e");return+((l=(rr(t(l[0]+"e"+(+l[1]+n)))+"e").split("e"))[0]+"e"+(+l[1]-n))}return t(e)}}var Bi=pn&&1/Wt(new pn([,-0]))[1]==1/0?function(e){return new pn(e)}:Qr;function Fi(e){return function(t){var n=eo(t);return n==v?Mt(t):n==E?Ht(t):function(e,t){return dt(t,function(t){return[t,e[t]]})}(t,e(t))}}function Mi(e,t,i,o,a,r,u,d){var s=2&t;if(!s&&"function"!=typeof e)throw new Ee(n);var c=o?o.length:0;if(c||(t&=-97,o=a=void 0),u=void 0===u?u:on(lr(u),0),d=void 0===d?d:lr(d),c-=a?a.length:0,64&t){var v=o,m=a;o=a=void 0}var p=s?void 0:Gi(e),f=[e,t,i,o,a,v,m,r,u,d];if(p&&function(e,t){var n=e[1],i=t[1],o=n|i;if(!(o<131||128==i&&8==n||128==i&&256==n&&e[7].length<=t[8]||384==i&&t[7].length<=t[8]&&8==n))return e;1&i&&(e[2]=t[2],o|=1&n?0:4);var a=t[3];if(a){var r=e[3];e[3]=r?mi(r,a,t[4]):a,e[4]=r?kt(e[3],l):t[4]}(a=t[5])&&(e[5]=(r=e[5])?pi(r,a,t[6]):a,e[6]=r?kt(e[5],l):t[6]),(a=t[7])&&(e[7]=a),128&i&&(e[8]=null==e[8]?t[8]:an(e[8],t[8])),null==e[9]&&(e[9]=t[9]),e[0]=t[0],e[1]=o}(f,p),e=f[0],t=f[1],i=f[2],o=f[3],a=f[4],!(d=f[9]=void 0===f[9]?s?0:e.length:on(f[9]-c,0))&&24&t&&(t&=-25),t&&1!=t)E=8==t||16==t?function(e,t,n){var l=bi(e);return function i(){for(var o=arguments.length,a=C(o),r=o,u=Ki(i);r--;)a[r]=arguments[r];var d=o<3&&a[0]!==u&&a[o-1]!==u?[]:kt(a,u);if((o-=d.length)<n)return Pi(e,t,Di,i.placeholder,void 0,a,d,void 0,void 0,n-o);var s=this&&this!==ze&&this instanceof i?l:e;return tt(s,this,a)}}(e,t,d):32!=t&&33!=t||a.length?Di.apply(void 0,f):function(e,t,n,l){var i=1&t,o=bi(e);return function t(){for(var a=-1,r=arguments.length,u=-1,d=l.length,s=C(d+r),c=this&&this!==ze&&this instanceof t?o:e;++u<d;)s[u]=l[u];for(;r--;)s[u++]=arguments[++a];return tt(c,i?n:this,s)}}(e,t,i,o);else var E=function(e,t,n){var l=1&t,i=bi(e);return function t(){var o=this&&this!==ze&&this instanceof t?i:e;return o.apply(l?n:this,arguments)}}(e,t,i);return Ao((p?Wl:go)(E,f),e,t)}function Ui(e,t,n,l){return void 0===e||Ta(e,_e[n])&&!Se.call(l,n)?t:e}function ki(e,t,n,l,i,o){return za(e)&&za(t)&&(o.set(t,e),Ol(e,t,void 0,ki,o),o.delete(t)),e}function Wi(e){return Ka(e)?void 0:e}function Hi(e,t,n,l,i,o){var a=1&n,r=e.length,u=t.length;if(r!=u&&!(a&&u>r))return!1;var d=o.get(e),s=o.get(t);if(d&&s)return d==t&&s==e;var c=-1,v=!0,m=2&n?new Bn:void 0;for(o.set(e,t),o.set(t,e);++c<r;){var p=e[c],f=t[c];if(l)var E=a?l(f,p,c,t,e,o):l(p,f,c,e,t,o);if(void 0!==E){if(E)continue;v=!1;break}if(m){if(!mt(t,function(e,t){if(!Tt(m,t)&&(p===e||i(p,e,n,l,o)))return m.push(t)})){v=!1;break}}else if(p!==f&&!i(p,f,n,l,o)){v=!1;break}}return o.delete(e),o.delete(t),v}function ji(e){return ho(mo(e,void 0,xo),e+"")}function zi(e){return cl(e,Ar,Zi)}function Vi(e){return cl(e,Sr,$i)}var Gi=gn?function(e){return gn.get(e)}:Qr;function Yi(e){for(var t=e.name+"",n=_n[t],l=Se.call(_n,t)?n.length:0;l--;){var i=n[l],o=i.func;if(null==o||o==e)return i.name}return t}function Ki(e){return(Se.call(Ln,"placeholder")?Ln:e).placeholder}function qi(){var e=Ln.iteratee||Kr;return e=e===Kr?Nl:e,arguments.length?e(arguments[0],arguments[1]):e}function Xi(e,t){var n=e.__data__;return function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}(t)?n["string"==typeof t?"string":"hash"]:n.map}function Ji(e){for(var t=Ar(e),n=t.length;n--;){var l=t[n],i=e[l];t[n]=[l,i,co(i)]}return t}function Qi(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return Sl(n)?n:void 0}var Zi=$t?function(e){return null==e?[]:(e=me(e),at($t(e),function(t){return Ge.call(e,t)}))}:iu,$i=$t?function(e){for(var t=[];e;)st(t,Zi(e)),e=je(e);return t}:iu,eo=vl;function to(e,t,n){for(var l=-1,i=(t=oi(t,e)).length,o=!1;++l<i;){var a=Do(t[l]);if(!(o=null!=e&&n(e,a)))break;e=e[a]}return o||++l!=i?o:!!(i=null==e?0:e.length)&&ja(i)&&io(a,i)&&(Pa(e)||Ra(e))}function no(e){return"function"!=typeof e.constructor||so(e)?{}:On(je(e))}function lo(e){return Pa(e)||Ra(e)||!!(qe&&e&&e[qe])}function io(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&ae.test(e))&&e>-1&&e%1==0&&e<t}function oo(e,t,n){if(!za(n))return!1;var l=typeof t;return!!("number"==l?Ba(n)&&io(t,n.length):"string"==l&&t in n)&&Ta(n[t],e)}function ao(e,t){if(Pa(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!Qa(e))||j.test(e)||!H.test(e)||null!=t&&e in me(t)}function ro(e){var t=Yi(e),n=Ln[t];if("function"!=typeof n||!(t in wn.prototype))return!1;if(e===n)return!0;var l=Gi(n);return!!l&&e===l[0]}(cn&&eo(new cn(new ArrayBuffer(1)))!=S||vn&&eo(new vn)!=v||mn&&"[object Promise]"!=eo(mn.resolve())||pn&&eo(new pn)!=E||fn&&eo(new fn)!=h)&&(eo=function(e){var t=vl(e),n=t==p?e.constructor:void 0,l=n?Lo(n):"";if(l)switch(l){case hn:return S;case An:return v;case Sn:return"[object Promise]";case Nn:return E;case bn:return h}return t});var uo=he?Wa:ou;function so(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||_e)}function co(e){return e==e&&!za(e)}function vo(e,t){return function(n){return null!=n&&n[e]===t&&(void 0!==t||e in me(n))}}function mo(e,t,n){return t=on(void 0===t?e.length-1:t,0),function(){for(var l=arguments,i=-1,o=on(l.length-t,0),a=C(o);++i<o;)a[i]=l[t+i];i=-1;for(var r=C(t+1);++i<t;)r[i]=l[i];return r[t]=n(a),tt(e,this,r)}}function po(e,t){return t.length<2?e:sl(e,zl(t,0,-1))}function fo(e,t){for(var n=e.length,l=an(t.length,n),i=fi(e);l--;){var o=t[l];e[l]=io(o,n)?i[o]:void 0}return e}function Eo(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var go=So(Wl),_o=Jt||function(e,t){return ze.setTimeout(e,t)},ho=So(Hl);function Ao(e,t,n){var l=t+"";return ho(e,function(e,t){var n=t.length;if(!n)return e;var l=n-1;return t[l]=(n>1?"& ":"")+t[l],t=t.join(n>2?", ":" "),e.replace(q,"{\n/* [wrapped with "+t+"] */\n")}(l,function(e,t){return lt(i,function(n){var l="_."+n[0];t&n[1]&&!rt(e,l)&&e.push(l)}),e.sort()}(function(e){var t=e.match(X);return t?t[1].split(J):[]}(l),n)))}function So(e){var t=0,n=0;return function(){var l=rn(),i=16-(l-n);if(n=l,i>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function No(e,t){var n=-1,l=e.length,i=l-1;for(t=void 0===t?l:t;++n<t;){var o=xl(n,i),a=e[o];e[o]=e[n],e[n]=a}return e.length=t,e}var bo,Co,yo=(bo=ba(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(z,function(e,n,l,i){t.push(l?i.replace($,"$1"):n||e)}),t},function(e){return 500===Co.size&&Co.clear(),e}),Co=bo.cache,bo);function Do(e){if("string"==typeof e||Qa(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Lo(e){if(null!=e){try{return Ae.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function Oo(e){if(e instanceof wn)return e.clone();var t=new In(e.__wrapped__,e.__chain__);return t.__actions__=fi(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var To=Fl(function(e,t){return Fa(e)?Zn(e,il(t,1,Fa,!0)):[]}),Io=Fl(function(e,t){var n=ko(t);return Fa(n)&&(n=void 0),Fa(e)?Zn(e,il(t,1,Fa,!0),qi(n,2)):[]}),wo=Fl(function(e,t){var n=ko(t);return Fa(n)&&(n=void 0),Fa(e)?Zn(e,il(t,1,Fa,!0),void 0,n):[]});function Ro(e,t,n){var l=null==e?0:e.length;if(!l)return-1;var i=null==n?0:lr(n);return i<0&&(i=on(l+i,0)),Et(e,qi(t,3),i)}function Po(e,t,n){var l=null==e?0:e.length;if(!l)return-1;var i=l-1;return void 0!==n&&(i=lr(n),i=n<0?on(l+i,0):an(i,l-1)),Et(e,qi(t,3),i,!0)}function xo(e){return null!=e&&e.length?il(e,1):[]}function Bo(e){return e&&e.length?e[0]:void 0}var Fo=Fl(function(e){var t=dt(e,li);return t.length&&t[0]===e[0]?El(t):[]}),Mo=Fl(function(e){var t=ko(e),n=dt(e,li);return t===ko(n)?t=void 0:n.pop(),n.length&&n[0]===e[0]?El(n,qi(t,2)):[]}),Uo=Fl(function(e){var t=ko(e),n=dt(e,li);return(t="function"==typeof t?t:void 0)&&n.pop(),n.length&&n[0]===e[0]?El(n,void 0,t):[]});function ko(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}var Wo=Fl(Ho);function Ho(e,t){return e&&e.length&&t&&t.length?Rl(e,t):e}var jo=ji(function(e,t){var n=null==e?0:e.length,l=Kn(e,t);return Pl(e,dt(t,function(e){return io(e,n)?+e:e}).sort(vi)),l});function zo(e){return null==e?e:sn.call(e)}var Vo=Fl(function(e){return Jl(il(e,1,Fa,!0))}),Go=Fl(function(e){var t=ko(e);return Fa(t)&&(t=void 0),Jl(il(e,1,Fa,!0),qi(t,2))}),Yo=Fl(function(e){var t=ko(e);return t="function"==typeof t?t:void 0,Jl(il(e,1,Fa,!0),void 0,t)});function Ko(e){if(!e||!e.length)return[];var t=0;return e=at(e,function(e){if(Fa(e))return t=on(e.length,t),!0}),yt(t,function(t){return dt(e,St(t))})}function qo(e,t){if(!e||!e.length)return[];var n=Ko(e);return null==t?n:dt(n,function(e){return tt(t,void 0,e)})}var Xo=Fl(function(e,t){return Fa(e)?Zn(e,t):[]}),Jo=Fl(function(e){return ti(at(e,Fa))}),Qo=Fl(function(e){var t=ko(e);return Fa(t)&&(t=void 0),ti(at(e,Fa),qi(t,2))}),Zo=Fl(function(e){var t=ko(e);return t="function"==typeof t?t:void 0,ti(at(e,Fa),void 0,t)}),$o=Fl(Ko),ea=Fl(function(e){var t=e.length,n=t>1?e[t-1]:void 0;return n="function"==typeof n?(e.pop(),n):void 0,qo(e,n)});function ta(e){var t=Ln(e);return t.__chain__=!0,t}function na(e,t){return t(e)}var la=ji(function(e){var t=e.length,n=t?e[0]:0,l=this.__wrapped__,i=function(t){return Kn(t,e)};return!(t>1||this.__actions__.length)&&l instanceof wn&&io(n)?((l=l.slice(n,+n+(t?1:0))).__actions__.push({func:na,args:[i],thisArg:void 0}),new In(l,this.__chain__).thru(function(e){return t&&!e.length&&e.push(void 0),e})):this.thru(i)}),ia=gi(function(e,t,n){Se.call(e,n)?++e[n]:Yn(e,n,1)}),oa=Ci(Ro),aa=Ci(Po);function ra(e,t){return(Pa(e)?lt:$n)(e,qi(t,3))}function ua(e,t){return(Pa(e)?it:el)(e,qi(t,3))}var da=gi(function(e,t,n){Se.call(e,n)?e[n].push(t):Yn(e,n,[t])}),sa=Fl(function(e,t,n){var l=-1,i="function"==typeof t,o=Ba(e)?C(e.length):[];return $n(e,function(e){o[++l]=i?tt(t,e,n):gl(e,t,n)}),o}),ca=gi(function(e,t,n){Yn(e,n,t)});function va(e,t){return(Pa(e)?dt:yl)(e,qi(t,3))}var ma=gi(function(e,t,n){e[n?0:1].push(t)},function(){return[[],[]]}),pa=Fl(function(e,t){if(null==e)return[];var n=t.length;return n>1&&oo(e,t[0],t[1])?t=[]:n>2&&oo(t[0],t[1],t[2])&&(t=[t[0]]),Il(e,il(t,1),[])}),fa=Xt||function(){return ze.Date.now()};function Ea(e,t,n){return t=n?void 0:t,Mi(e,128,void 0,void 0,void 0,void 0,t=e&&null==t?e.length:t)}function ga(e,t){var l;if("function"!=typeof t)throw new Ee(n);return e=lr(e),function(){return--e>0&&(l=t.apply(this,arguments)),e<=1&&(t=void 0),l}}var _a=Fl(function(e,t,n){var l=1;if(n.length){var i=kt(n,Ki(_a));l|=32}return Mi(e,l,t,n,i)}),ha=Fl(function(e,t,n){var l=3;if(n.length){var i=kt(n,Ki(ha));l|=32}return Mi(t,l,e,n,i)});function Aa(e,t,l){var i,o,a,r,u,d,s=0,c=!1,v=!1,m=!0;if("function"!=typeof e)throw new Ee(n);function p(t){var n=i,l=o;return i=o=void 0,s=t,r=e.apply(l,n)}function f(e){return s=e,u=_o(g,t),c?p(e):r}function E(e){var n=e-d;return void 0===d||n>=t||n<0||v&&e-s>=a}function g(){var e=fa();if(E(e))return _(e);u=_o(g,function(e){var n=t-(e-d);return v?an(n,a-(e-s)):n}(e))}function _(e){return u=void 0,m&&i?p(e):(i=o=void 0,r)}function h(){var e=fa(),n=E(e);if(i=arguments,o=this,d=e,n){if(void 0===u)return f(d);if(v)return ui(u),u=_o(g,t),p(d)}return void 0===u&&(u=_o(g,t)),r}return t=or(t)||0,za(l)&&(c=!!l.leading,a=(v="maxWait"in l)?on(or(l.maxWait)||0,t):a,m="trailing"in l?!!l.trailing:m),h.cancel=function(){void 0!==u&&ui(u),s=0,i=d=o=u=void 0},h.flush=function(){return void 0===u?r:_(fa())},h}var Sa=Fl(function(e,t){return Qn(e,1,t)}),Na=Fl(function(e,t,n){return Qn(e,or(t)||0,n)});function ba(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new Ee(n);var l=function(){var n=arguments,i=t?t.apply(this,n):n[0],o=l.cache;if(o.has(i))return o.get(i);var a=e.apply(this,n);return l.cache=o.set(i,a)||o,a};return l.cache=new(ba.Cache||xn),l}function Ca(e){if("function"!=typeof e)throw new Ee(n);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}ba.Cache=xn;var ya=ai(function(e,t){var n=(t=1==t.length&&Pa(t[0])?dt(t[0],Lt(qi())):dt(il(t,1),Lt(qi()))).length;return Fl(function(l){for(var i=-1,o=an(l.length,n);++i<o;)l[i]=t[i].call(this,l[i]);return tt(e,this,l)})}),Da=Fl(function(e,t){return Mi(e,32,void 0,t,kt(t,Ki(Da)))}),La=Fl(function(e,t){return Mi(e,64,void 0,t,kt(t,Ki(La)))}),Oa=ji(function(e,t){return Mi(e,256,void 0,void 0,void 0,t)});function Ta(e,t){return e===t||e!=e&&t!=t}var Ia=Ri(ml),wa=Ri(function(e,t){return e>=t}),Ra=_l(function(){return arguments}())?_l:function(e){return Va(e)&&Se.call(e,"callee")&&!Ge.call(e,"callee")},Pa=C.isArray,xa=Xe?Lt(Xe):function(e){return Va(e)&&vl(e)==A};function Ba(e){return null!=e&&ja(e.length)&&!Wa(e)}function Fa(e){return Va(e)&&Ba(e)}var Ma=en||ou,Ua=Je?Lt(Je):function(e){return Va(e)&&vl(e)==u};function ka(e){if(!Va(e))return!1;var t=vl(e);return t==d||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!Ka(e)}function Wa(e){if(!za(e))return!1;var t=vl(e);return t==s||t==c||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Ha(e){return"number"==typeof e&&e==lr(e)}function ja(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}function za(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function Va(e){return null!=e&&"object"==typeof e}var Ga=Qe?Lt(Qe):function(e){return Va(e)&&eo(e)==v};function Ya(e){return"number"==typeof e||Va(e)&&vl(e)==m}function Ka(e){if(!Va(e)||vl(e)!=p)return!1;var t=je(e);if(null===t)return!0;var n=Se.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&Ae.call(n)==ye}var qa=Ze?Lt(Ze):function(e){return Va(e)&&vl(e)==f},Xa=$e?Lt($e):function(e){return Va(e)&&eo(e)==E};function Ja(e){return"string"==typeof e||!Pa(e)&&Va(e)&&vl(e)==g}function Qa(e){return"symbol"==typeof e||Va(e)&&vl(e)==_}var Za=et?Lt(et):function(e){return Va(e)&&ja(e.length)&&!!Fe[vl(e)]},$a=Ri(Cl),er=Ri(function(e,t){return e<=t});function tr(e){if(!e)return[];if(Ba(e))return Ja(e)?zt(e):fi(e);if(pt&&e[pt])return function(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}(e[pt]());var t=eo(e);return(t==v?Mt:t==E?Wt:Tr)(e)}function nr(e){return e?(e=or(e))===1/0||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function lr(e){var t=nr(e),n=t%1;return t==t?n?t-n:t:0}function ir(e){return e?qn(lr(e),0,4294967295):0}function or(e){if("number"==typeof e)return e;if(Qa(e))return NaN;if(za(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=za(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Dt(e);var n=le.test(e);return n||oe.test(e)?We(e.slice(2),n?2:8):ne.test(e)?NaN:+e}function ar(e){return Ei(e,Sr(e))}function rr(e){return null==e?"":Xl(e)}var ur=_i(function(e,t){if(so(t)||Ba(t))Ei(t,Ar(t),e);else for(var n in t)Se.call(t,n)&&jn(e,n,t[n])}),dr=_i(function(e,t){Ei(t,Sr(t),e)}),sr=_i(function(e,t,n,l){Ei(t,Sr(t),e,l)}),cr=_i(function(e,t,n,l){Ei(t,Ar(t),e,l)}),vr=ji(Kn),mr=Fl(function(e,t){e=me(e);var n=-1,l=t.length,i=l>2?t[2]:void 0;for(i&&oo(t[0],t[1],i)&&(l=1);++n<l;)for(var o=t[n],a=Sr(o),r=-1,u=a.length;++r<u;){var d=a[r],s=e[d];(void 0===s||Ta(s,_e[d])&&!Se.call(e,d))&&(e[d]=o[d])}return e}),pr=Fl(function(e){return e.push(void 0,ki),tt(br,void 0,e)});function fr(e,t,n){var l=null==e?void 0:sl(e,t);return void 0===l?n:l}function Er(e,t){return null!=e&&to(e,t,fl)}var gr=Li(function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=Ce.call(t)),e[t]=n},zr(Yr)),_r=Li(function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=Ce.call(t)),Se.call(e,t)?e[t].push(n):e[t]=[n]},qi),hr=Fl(gl);function Ar(e){return Ba(e)?Mn(e):bl(e)}function Sr(e){return Ba(e)?Mn(e,!0):function(e){if(!za(e))return function(e){var t=[];if(null!=e)for(var n in me(e))t.push(n);return t}(e);var t=so(e),n=[];for(var l in e)("constructor"!=l||!t&&Se.call(e,l))&&n.push(l);return n}(e)}var Nr=_i(function(e,t,n){Ol(e,t,n)}),br=_i(function(e,t,n,l){Ol(e,t,n,l)}),Cr=ji(function(e,t){var n={};if(null==e)return n;var l=!1;t=dt(t,function(t){return t=oi(t,e),l||(l=t.length>1),t}),Ei(e,Vi(e),n),l&&(n=Xn(n,7,Wi));for(var i=t.length;i--;)Ql(n,t[i]);return n}),yr=ji(function(e,t){return null==e?{}:function(e,t){return wl(e,t,function(t,n){return Er(e,n)})}(e,t)});function Dr(e,t){if(null==e)return{};var n=dt(Vi(e),function(e){return[e]});return t=qi(t),wl(e,n,function(e,n){return t(e,n[0])})}var Lr=Fi(Ar),Or=Fi(Sr);function Tr(e){return null==e?[]:Ot(e,Ar(e))}var Ir=Ni(function(e,t,n){return t=t.toLowerCase(),e+(n?wr(t):t)});function wr(e){return kr(rr(e).toLowerCase())}function Rr(e){return(e=rr(e))&&e.replace(re,Pt).replace(Te,"")}var Pr=Ni(function(e,t,n){return e+(n?"-":"")+t.toLowerCase()}),xr=Ni(function(e,t,n){return e+(n?" ":"")+t.toLowerCase()}),Br=Si("toLowerCase"),Fr=Ni(function(e,t,n){return e+(n?"_":"")+t.toLowerCase()}),Mr=Ni(function(e,t,n){return e+(n?" ":"")+kr(t)}),Ur=Ni(function(e,t,n){return e+(n?" ":"")+t.toUpperCase()}),kr=Si("toUpperCase");function Wr(e,t,n){return e=rr(e),void 0===(t=n?void 0:t)?function(e){return Pe.test(e)}(e)?function(e){return e.match(we)||[]}(e):function(e){return e.match(Q)||[]}(e):e.match(t)||[]}var Hr=Fl(function(e,t){try{return tt(e,void 0,t)}catch(e){return ka(e)?e:new se(e)}}),jr=ji(function(e,t){return lt(t,function(t){t=Do(t),Yn(e,t,_a(e[t],e))}),e});function zr(e){return function(){return e}}var Vr=yi(),Gr=yi(!0);function Yr(e){return e}function Kr(e){return Nl("function"==typeof e?e:Xn(e,1))}var qr=Fl(function(e,t){return function(n){return gl(n,e,t)}}),Xr=Fl(function(e,t){return function(n){return gl(e,n,t)}});function Jr(e,t,n){var l=Ar(t),i=dl(t,l);null!=n||za(t)&&(i.length||!l.length)||(n=t,t=e,e=this,i=dl(t,Ar(t)));var o=!(za(n)&&"chain"in n&&!n.chain),a=Wa(e);return lt(i,function(n){var l=t[n];e[n]=l,a&&(e.prototype[n]=function(){var t=this.__chain__;if(o||t){var n=e(this.__wrapped__),i=n.__actions__=fi(this.__actions__);return i.push({func:l,args:arguments,thisArg:e}),n.__chain__=t,n}return l.apply(e,st([this.value()],arguments))})}),e}function Qr(){}var Zr=Ti(dt),$r=Ti(ot),eu=Ti(mt);function tu(e){return ao(e)?St(Do(e)):function(e){return function(t){return sl(t,e)}}(e)}var nu=wi(),lu=wi(!0);function iu(){return[]}function ou(){return!1}var au,ru=Oi(function(e,t){return e+t},0),uu=xi("ceil"),du=Oi(function(e,t){return e/t},1),su=xi("floor"),cu=Oi(function(e,t){return e*t},1),vu=xi("round"),mu=Oi(function(e,t){return e-t},0);return Ln.after=function(e,t){if("function"!=typeof t)throw new Ee(n);return e=lr(e),function(){if(--e<1)return t.apply(this,arguments)}},Ln.ary=Ea,Ln.assign=ur,Ln.assignIn=dr,Ln.assignInWith=sr,Ln.assignWith=cr,Ln.at=vr,Ln.before=ga,Ln.bind=_a,Ln.bindAll=jr,Ln.bindKey=ha,Ln.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return Pa(e)?e:[e]},Ln.chain=ta,Ln.chunk=function(e,t,n){t=(n?oo(e,t,n):void 0===t)?1:on(lr(t),0);var l=null==e?0:e.length;if(!l||t<1)return[];for(var i=0,o=0,a=C(Qt(l/t));i<l;)a[o++]=zl(e,i,i+=t);return a},Ln.compact=function(e){for(var t=-1,n=null==e?0:e.length,l=0,i=[];++t<n;){var o=e[t];o&&(i[l++]=o)}return i},Ln.concat=function(){var e=arguments.length;if(!e)return[];for(var t=C(e-1),n=arguments[0],l=e;l--;)t[l-1]=arguments[l];return st(Pa(n)?fi(n):[n],il(t,1))},Ln.cond=function(e){var t=null==e?0:e.length,l=qi();return e=t?dt(e,function(e){if("function"!=typeof e[1])throw new Ee(n);return[l(e[0]),e[1]]}):[],Fl(function(n){for(var l=-1;++l<t;){var i=e[l];if(tt(i[0],this,n))return tt(i[1],this,n)}})},Ln.conforms=function(e){return function(e){var t=Ar(e);return function(n){return Jn(n,e,t)}}(Xn(e,1))},Ln.constant=zr,Ln.countBy=ia,Ln.create=function(e,t){var n=On(e);return null==t?n:Gn(n,t)},Ln.curry=function e(t,n,l){var i=Mi(t,8,void 0,void 0,void 0,void 0,void 0,n=l?void 0:n);return i.placeholder=e.placeholder,i},Ln.curryRight=function e(t,n,l){var i=Mi(t,16,void 0,void 0,void 0,void 0,void 0,n=l?void 0:n);return i.placeholder=e.placeholder,i},Ln.debounce=Aa,Ln.defaults=mr,Ln.defaultsDeep=pr,Ln.defer=Sa,Ln.delay=Na,Ln.difference=To,Ln.differenceBy=Io,Ln.differenceWith=wo,Ln.drop=function(e,t,n){var l=null==e?0:e.length;return l?zl(e,(t=n||void 0===t?1:lr(t))<0?0:t,l):[]},Ln.dropRight=function(e,t,n){var l=null==e?0:e.length;return l?zl(e,0,(t=l-(t=n||void 0===t?1:lr(t)))<0?0:t):[]},Ln.dropRightWhile=function(e,t){return e&&e.length?$l(e,qi(t,3),!0,!0):[]},Ln.dropWhile=function(e,t){return e&&e.length?$l(e,qi(t,3),!0):[]},Ln.fill=function(e,t,n,l){var i=null==e?0:e.length;return i?(n&&"number"!=typeof n&&oo(e,t,n)&&(n=0,l=i),function(e,t,n,l){var i=e.length;for((n=lr(n))<0&&(n=-n>i?0:i+n),(l=void 0===l||l>i?i:lr(l))<0&&(l+=i),l=n>l?0:ir(l);n<l;)e[n++]=t;return e}(e,t,n,l)):[]},Ln.filter=function(e,t){return(Pa(e)?at:ll)(e,qi(t,3))},Ln.flatMap=function(e,t){return il(va(e,t),1)},Ln.flatMapDeep=function(e,t){return il(va(e,t),1/0)},Ln.flatMapDepth=function(e,t,n){return n=void 0===n?1:lr(n),il(va(e,t),n)},Ln.flatten=xo,Ln.flattenDeep=function(e){return null!=e&&e.length?il(e,1/0):[]},Ln.flattenDepth=function(e,t){return null!=e&&e.length?il(e,t=void 0===t?1:lr(t)):[]},Ln.flip=function(e){return Mi(e,512)},Ln.flow=Vr,Ln.flowRight=Gr,Ln.fromPairs=function(e){for(var t=-1,n=null==e?0:e.length,l={};++t<n;){var i=e[t];l[i[0]]=i[1]}return l},Ln.functions=function(e){return null==e?[]:dl(e,Ar(e))},Ln.functionsIn=function(e){return null==e?[]:dl(e,Sr(e))},Ln.groupBy=da,Ln.initial=function(e){return null!=e&&e.length?zl(e,0,-1):[]},Ln.intersection=Fo,Ln.intersectionBy=Mo,Ln.intersectionWith=Uo,Ln.invert=gr,Ln.invertBy=_r,Ln.invokeMap=sa,Ln.iteratee=Kr,Ln.keyBy=ca,Ln.keys=Ar,Ln.keysIn=Sr,Ln.map=va,Ln.mapKeys=function(e,t){var n={};return t=qi(t,3),rl(e,function(e,l,i){Yn(n,t(e,l,i),e)}),n},Ln.mapValues=function(e,t){var n={};return t=qi(t,3),rl(e,function(e,l,i){Yn(n,l,t(e,l,i))}),n},Ln.matches=function(e){return Dl(Xn(e,1))},Ln.matchesProperty=function(e,t){return Ll(e,Xn(t,1))},Ln.memoize=ba,Ln.merge=Nr,Ln.mergeWith=br,Ln.method=qr,Ln.methodOf=Xr,Ln.mixin=Jr,Ln.negate=Ca,Ln.nthArg=function(e){return e=lr(e),Fl(function(t){return Tl(t,e)})},Ln.omit=Cr,Ln.omitBy=function(e,t){return Dr(e,Ca(qi(t)))},Ln.once=function(e){return ga(2,e)},Ln.orderBy=function(e,t,n,l){return null==e?[]:(Pa(t)||(t=null==t?[]:[t]),Pa(n=l?void 0:n)||(n=null==n?[]:[n]),Il(e,t,n))},Ln.over=Zr,Ln.overArgs=ya,Ln.overEvery=$r,Ln.overSome=eu,Ln.partial=Da,Ln.partialRight=La,Ln.partition=ma,Ln.pick=yr,Ln.pickBy=Dr,Ln.property=tu,Ln.propertyOf=function(e){return function(t){return null==e?void 0:sl(e,t)}},Ln.pull=Wo,Ln.pullAll=Ho,Ln.pullAllBy=function(e,t,n){return e&&e.length&&t&&t.length?Rl(e,t,qi(n,2)):e},Ln.pullAllWith=function(e,t,n){return e&&e.length&&t&&t.length?Rl(e,t,void 0,n):e},Ln.pullAt=jo,Ln.range=nu,Ln.rangeRight=lu,Ln.rearg=Oa,Ln.reject=function(e,t){return(Pa(e)?at:ll)(e,Ca(qi(t,3)))},Ln.remove=function(e,t){var n=[];if(!e||!e.length)return n;var l=-1,i=[],o=e.length;for(t=qi(t,3);++l<o;){var a=e[l];t(a,l,e)&&(n.push(a),i.push(l))}return Pl(e,i),n},Ln.rest=function(e,t){if("function"!=typeof e)throw new Ee(n);return Fl(e,t=void 0===t?t:lr(t))},Ln.reverse=zo,Ln.sampleSize=function(e,t,n){return t=(n?oo(e,t,n):void 0===t)?1:lr(t),(Pa(e)?kn:Ul)(e,t)},Ln.set=function(e,t,n){return null==e?e:kl(e,t,n)},Ln.setWith=function(e,t,n,l){return l="function"==typeof l?l:void 0,null==e?e:kl(e,t,n,l)},Ln.shuffle=function(e){return(Pa(e)?Wn:jl)(e)},Ln.slice=function(e,t,n){var l=null==e?0:e.length;return l?(n&&"number"!=typeof n&&oo(e,t,n)?(t=0,n=l):(t=null==t?0:lr(t),n=void 0===n?l:lr(n)),zl(e,t,n)):[]},Ln.sortBy=pa,Ln.sortedUniq=function(e){return e&&e.length?Kl(e):[]},Ln.sortedUniqBy=function(e,t){return e&&e.length?Kl(e,qi(t,2)):[]},Ln.split=function(e,t,n){return n&&"number"!=typeof n&&oo(e,t,n)&&(t=n=void 0),(n=void 0===n?4294967295:n>>>0)?(e=rr(e))&&("string"==typeof t||null!=t&&!qa(t))&&!(t=Xl(t))&&Ft(e)?ri(zt(e),0,n):e.split(t,n):[]},Ln.spread=function(e,t){if("function"!=typeof e)throw new Ee(n);return t=null==t?0:on(lr(t),0),Fl(function(n){var l=n[t],i=ri(n,0,t);return l&&st(i,l),tt(e,this,i)})},Ln.tail=function(e){var t=null==e?0:e.length;return t?zl(e,1,t):[]},Ln.take=function(e,t,n){return e&&e.length?zl(e,0,(t=n||void 0===t?1:lr(t))<0?0:t):[]},Ln.takeRight=function(e,t,n){var l=null==e?0:e.length;return l?zl(e,(t=l-(t=n||void 0===t?1:lr(t)))<0?0:t,l):[]},Ln.takeRightWhile=function(e,t){return e&&e.length?$l(e,qi(t,3),!1,!0):[]},Ln.takeWhile=function(e,t){return e&&e.length?$l(e,qi(t,3)):[]},Ln.tap=function(e,t){return t(e),e},Ln.throttle=function(e,t,l){var i=!0,o=!0;if("function"!=typeof e)throw new Ee(n);return za(l)&&(i="leading"in l?!!l.leading:i,o="trailing"in l?!!l.trailing:o),Aa(e,t,{leading:i,maxWait:t,trailing:o})},Ln.thru=na,Ln.toArray=tr,Ln.toPairs=Lr,Ln.toPairsIn=Or,Ln.toPath=function(e){return Pa(e)?dt(e,Do):Qa(e)?[e]:fi(yo(rr(e)))},Ln.toPlainObject=ar,Ln.transform=function(e,t,n){var l=Pa(e),i=l||Ma(e)||Za(e);if(t=qi(t,4),null==n){var o=e&&e.constructor;n=i?l?new o:[]:za(e)&&Wa(o)?On(je(e)):{}}return(i?lt:rl)(e,function(e,l,i){return t(n,e,l,i)}),n},Ln.unary=function(e){return Ea(e,1)},Ln.union=Vo,Ln.unionBy=Go,Ln.unionWith=Yo,Ln.uniq=function(e){return e&&e.length?Jl(e):[]},Ln.uniqBy=function(e,t){return e&&e.length?Jl(e,qi(t,2)):[]},Ln.uniqWith=function(e,t){return t="function"==typeof t?t:void 0,e&&e.length?Jl(e,void 0,t):[]},Ln.unset=function(e,t){return null==e||Ql(e,t)},Ln.unzip=Ko,Ln.unzipWith=qo,Ln.update=function(e,t,n){return null==e?e:Zl(e,t,ii(n))},Ln.updateWith=function(e,t,n,l){return l="function"==typeof l?l:void 0,null==e?e:Zl(e,t,ii(n),l)},Ln.values=Tr,Ln.valuesIn=function(e){return null==e?[]:Ot(e,Sr(e))},Ln.without=Xo,Ln.words=Wr,Ln.wrap=function(e,t){return Da(ii(t),e)},Ln.xor=Jo,Ln.xorBy=Qo,Ln.xorWith=Zo,Ln.zip=$o,Ln.zipObject=function(e,t){return ni(e||[],t||[],jn)},Ln.zipObjectDeep=function(e,t){return ni(e||[],t||[],kl)},Ln.zipWith=ea,Ln.entries=Lr,Ln.entriesIn=Or,Ln.extend=dr,Ln.extendWith=sr,Jr(Ln,Ln),Ln.add=ru,Ln.attempt=Hr,Ln.camelCase=Ir,Ln.capitalize=wr,Ln.ceil=uu,Ln.clamp=function(e,t,n){return void 0===n&&(n=t,t=void 0),void 0!==n&&(n=(n=or(n))==n?n:0),void 0!==t&&(t=(t=or(t))==t?t:0),qn(or(e),t,n)},Ln.clone=function(e){return Xn(e,4)},Ln.cloneDeep=function(e){return Xn(e,5)},Ln.cloneDeepWith=function(e,t){return Xn(e,5,t="function"==typeof t?t:void 0)},Ln.cloneWith=function(e,t){return Xn(e,4,t="function"==typeof t?t:void 0)},Ln.conformsTo=function(e,t){return null==t||Jn(e,t,Ar(t))},Ln.deburr=Rr,Ln.defaultTo=function(e,t){return null==e||e!=e?t:e},Ln.divide=du,Ln.endsWith=function(e,t,n){e=rr(e),t=Xl(t);var l=e.length,i=n=void 0===n?l:qn(lr(n),0,l);return(n-=t.length)>=0&&e.slice(n,i)==t},Ln.eq=Ta,Ln.escape=function(e){return(e=rr(e))&&M.test(e)?e.replace(B,xt):e},Ln.escapeRegExp=function(e){return(e=rr(e))&&G.test(e)?e.replace(V,"\\$&"):e},Ln.every=function(e,t,n){var l=Pa(e)?ot:tl;return n&&oo(e,t,n)&&(t=void 0),l(e,qi(t,3))},Ln.find=oa,Ln.findIndex=Ro,Ln.findKey=function(e,t){return ft(e,qi(t,3),rl)},Ln.findLast=aa,Ln.findLastIndex=Po,Ln.findLastKey=function(e,t){return ft(e,qi(t,3),ul)},Ln.floor=su,Ln.forEach=ra,Ln.forEachRight=ua,Ln.forIn=function(e,t){return null==e?e:ol(e,qi(t,3),Sr)},Ln.forInRight=function(e,t){return null==e?e:al(e,qi(t,3),Sr)},Ln.forOwn=function(e,t){return e&&rl(e,qi(t,3))},Ln.forOwnRight=function(e,t){return e&&ul(e,qi(t,3))},Ln.get=fr,Ln.gt=Ia,Ln.gte=wa,Ln.has=function(e,t){return null!=e&&to(e,t,pl)},Ln.hasIn=Er,Ln.head=Bo,Ln.identity=Yr,Ln.includes=function(e,t,n,l){e=Ba(e)?e:Tr(e),n=n&&!l?lr(n):0;var i=e.length;return n<0&&(n=on(i+n,0)),Ja(e)?n<=i&&e.indexOf(t,n)>-1:!!i&>(e,t,n)>-1},Ln.indexOf=function(e,t,n){var l=null==e?0:e.length;if(!l)return-1;var i=null==n?0:lr(n);return i<0&&(i=on(l+i,0)),gt(e,t,i)},Ln.inRange=function(e,t,n){return t=nr(t),void 0===n?(n=t,t=0):n=nr(n),function(e,t,n){return e>=an(t,n)&&e<on(t,n)}(e=or(e),t,n)},Ln.invoke=hr,Ln.isArguments=Ra,Ln.isArray=Pa,Ln.isArrayBuffer=xa,Ln.isArrayLike=Ba,Ln.isArrayLikeObject=Fa,Ln.isBoolean=function(e){return!0===e||!1===e||Va(e)&&vl(e)==r},Ln.isBuffer=Ma,Ln.isDate=Ua,Ln.isElement=function(e){return Va(e)&&1===e.nodeType&&!Ka(e)},Ln.isEmpty=function(e){if(null==e)return!0;if(Ba(e)&&(Pa(e)||"string"==typeof e||"function"==typeof e.splice||Ma(e)||Za(e)||Ra(e)))return!e.length;var t=eo(e);if(t==v||t==E)return!e.size;if(so(e))return!bl(e).length;for(var n in e)if(Se.call(e,n))return!1;return!0},Ln.isEqual=function(e,t){return hl(e,t)},Ln.isEqualWith=function(e,t,n){var l=(n="function"==typeof n?n:void 0)?n(e,t):void 0;return void 0===l?hl(e,t,void 0,n):!!l},Ln.isError=ka,Ln.isFinite=function(e){return"number"==typeof e&&tn(e)},Ln.isFunction=Wa,Ln.isInteger=Ha,Ln.isLength=ja,Ln.isMap=Ga,Ln.isMatch=function(e,t){return e===t||Al(e,t,Ji(t))},Ln.isMatchWith=function(e,t,n){return n="function"==typeof n?n:void 0,Al(e,t,Ji(t),n)},Ln.isNaN=function(e){return Ya(e)&&e!=+e},Ln.isNative=function(e){if(uo(e))throw new se("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return Sl(e)},Ln.isNil=function(e){return null==e},Ln.isNull=function(e){return null===e},Ln.isNumber=Ya,Ln.isObject=za,Ln.isObjectLike=Va,Ln.isPlainObject=Ka,Ln.isRegExp=qa,Ln.isSafeInteger=function(e){return Ha(e)&&e>=-9007199254740991&&e<=9007199254740991},Ln.isSet=Xa,Ln.isString=Ja,Ln.isSymbol=Qa,Ln.isTypedArray=Za,Ln.isUndefined=function(e){return void 0===e},Ln.isWeakMap=function(e){return Va(e)&&eo(e)==h},Ln.isWeakSet=function(e){return Va(e)&&"[object WeakSet]"==vl(e)},Ln.join=function(e,t){return null==e?"":nn.call(e,t)},Ln.kebabCase=Pr,Ln.last=ko,Ln.lastIndexOf=function(e,t,n){var l=null==e?0:e.length;if(!l)return-1;var i=l;return void 0!==n&&(i=(i=lr(n))<0?on(l+i,0):an(i,l-1)),t==t?function(e,t,n){for(var l=n+1;l--;)if(e[l]===t)return l;return l}(e,t,i):Et(e,ht,i,!0)},Ln.lowerCase=xr,Ln.lowerFirst=Br,Ln.lt=$a,Ln.lte=er,Ln.max=function(e){return e&&e.length?nl(e,Yr,ml):void 0},Ln.maxBy=function(e,t){return e&&e.length?nl(e,qi(t,2),ml):void 0},Ln.mean=function(e){return At(e,Yr)},Ln.meanBy=function(e,t){return At(e,qi(t,2))},Ln.min=function(e){return e&&e.length?nl(e,Yr,Cl):void 0},Ln.minBy=function(e,t){return e&&e.length?nl(e,qi(t,2),Cl):void 0},Ln.stubArray=iu,Ln.stubFalse=ou,Ln.stubObject=function(){return{}},Ln.stubString=function(){return""},Ln.stubTrue=function(){return!0},Ln.multiply=cu,Ln.nth=function(e,t){return e&&e.length?Tl(e,lr(t)):void 0},Ln.noConflict=function(){return ze._===this&&(ze._=De),this},Ln.noop=Qr,Ln.now=fa,Ln.pad=function(e,t,n){e=rr(e);var l=(t=lr(t))?jt(e):0;if(!t||l>=t)return e;var i=(t-l)/2;return Ii(Zt(i),n)+e+Ii(Qt(i),n)},Ln.padEnd=function(e,t,n){e=rr(e);var l=(t=lr(t))?jt(e):0;return t&&l<t?e+Ii(t-l,n):e},Ln.padStart=function(e,t,n){e=rr(e);var l=(t=lr(t))?jt(e):0;return t&&l<t?Ii(t-l,n)+e:e},Ln.parseInt=function(e,t,n){return n||null==t?t=0:t&&(t=+t),un(rr(e).replace(Y,""),t||0)},Ln.random=function(e,t,n){if(n&&"boolean"!=typeof n&&oo(e,t,n)&&(t=n=void 0),void 0===n&&("boolean"==typeof t?(n=t,t=void 0):"boolean"==typeof e&&(n=e,e=void 0)),void 0===e&&void 0===t?(e=0,t=1):(e=nr(e),void 0===t?(t=e,e=0):t=nr(t)),e>t){var l=e;e=t,t=l}if(n||e%1||t%1){var i=dn();return an(e+i*(t-e+ke("1e-"+((i+"").length-1))),t)}return xl(e,t)},Ln.reduce=function(e,t,n){var l=Pa(e)?ct:bt,i=arguments.length<3;return l(e,qi(t,4),n,i,$n)},Ln.reduceRight=function(e,t,n){var l=Pa(e)?vt:bt,i=arguments.length<3;return l(e,qi(t,4),n,i,el)},Ln.repeat=function(e,t,n){return t=(n?oo(e,t,n):void 0===t)?1:lr(t),Bl(rr(e),t)},Ln.replace=function(){var e=arguments,t=rr(e[0]);return e.length<3?t:t.replace(e[1],e[2])},Ln.result=function(e,t,n){var l=-1,i=(t=oi(t,e)).length;for(i||(i=1,e=void 0);++l<i;){var o=null==e?void 0:e[Do(t[l])];void 0===o&&(l=i,o=n),e=Wa(o)?o.call(e):o}return e},Ln.round=vu,Ln.runInContext=e,Ln.sample=function(e){return(Pa(e)?Un:Ml)(e)},Ln.size=function(e){if(null==e)return 0;if(Ba(e))return Ja(e)?jt(e):e.length;var t=eo(e);return t==v||t==E?e.size:bl(e).length},Ln.snakeCase=Fr,Ln.some=function(e,t,n){var l=Pa(e)?mt:Vl;return n&&oo(e,t,n)&&(t=void 0),l(e,qi(t,3))},Ln.sortedIndex=function(e,t){return Gl(e,t)},Ln.sortedIndexBy=function(e,t,n){return Yl(e,t,qi(n,2))},Ln.sortedIndexOf=function(e,t){var n=null==e?0:e.length;if(n){var l=Gl(e,t);if(l<n&&Ta(e[l],t))return l}return-1},Ln.sortedLastIndex=function(e,t){return Gl(e,t,!0)},Ln.sortedLastIndexBy=function(e,t,n){return Yl(e,t,qi(n,2),!0)},Ln.sortedLastIndexOf=function(e,t){if(null!=e&&e.length){var n=Gl(e,t,!0)-1;if(Ta(e[n],t))return n}return-1},Ln.startCase=Mr,Ln.startsWith=function(e,t,n){return e=rr(e),n=null==n?0:qn(lr(n),0,e.length),t=Xl(t),e.slice(n,n+t.length)==t},Ln.subtract=mu,Ln.sum=function(e){return e&&e.length?Ct(e,Yr):0},Ln.sumBy=function(e,t){return e&&e.length?Ct(e,qi(t,2)):0},Ln.template=function(e,t,n){var l=Ln.templateSettings;n&&oo(e,t,n)&&(t=void 0),e=rr(e),t=sr({},t,l,Ui);var i,o,a=sr({},t.imports,l.imports,Ui),r=Ar(a),u=Ot(a,r),d=0,s=t.interpolate||ue,c="__p += '",v=pe((t.escape||ue).source+"|"+s.source+"|"+(s===W?ee:ue).source+"|"+(t.evaluate||ue).source+"|$","g"),m="//# sourceURL="+(Se.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Be+"]")+"\n";e.replace(v,function(t,n,l,a,r,u){return l||(l=a),c+=e.slice(d,u).replace(de,Bt),n&&(i=!0,c+="' +\n__e("+n+") +\n'"),r&&(o=!0,c+="';\n"+r+";\n__p += '"),l&&(c+="' +\n((__t = ("+l+")) == null ? '' : __t) +\n'"),d=u+t.length,t}),c+="';\n";var p=Se.call(t,"variable")&&t.variable;if(p){if(Z.test(p))throw new se("Invalid `variable` option passed into `_.template`")}else c="with (obj) {\n"+c+"\n}\n";c=(o?c.replace(w,""):c).replace(R,"$1").replace(P,"$1;"),c="function("+(p||"obj")+") {\n"+(p?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(i?", __e = _.escape":"")+(o?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+c+"return __p\n}";var f=Hr(function(){return ce(r,m+"return "+c).apply(void 0,u)});if(f.source=c,ka(f))throw f;return f},Ln.times=function(e,t){if((e=lr(e))<1||e>9007199254740991)return[];var n=4294967295,l=an(e,4294967295);e-=4294967295;for(var i=yt(l,t=qi(t));++n<e;)t(n);return i},Ln.toFinite=nr,Ln.toInteger=lr,Ln.toLength=ir,Ln.toLower=function(e){return rr(e).toLowerCase()},Ln.toNumber=or,Ln.toSafeInteger=function(e){return e?qn(lr(e),-9007199254740991,9007199254740991):0===e?e:0},Ln.toString=rr,Ln.toUpper=function(e){return rr(e).toUpperCase()},Ln.trim=function(e,t,n){if((e=rr(e))&&(n||void 0===t))return Dt(e);if(!e||!(t=Xl(t)))return e;var l=zt(e),i=zt(t);return ri(l,It(l,i),wt(l,i)+1).join("")},Ln.trimEnd=function(e,t,n){if((e=rr(e))&&(n||void 0===t))return e.slice(0,Vt(e)+1);if(!e||!(t=Xl(t)))return e;var l=zt(e);return ri(l,0,wt(l,zt(t))+1).join("")},Ln.trimStart=function(e,t,n){if((e=rr(e))&&(n||void 0===t))return e.replace(Y,"");if(!e||!(t=Xl(t)))return e;var l=zt(e);return ri(l,It(l,zt(t))).join("")},Ln.truncate=function(e,t){var n=30,l="...";if(za(t)){var i="separator"in t?t.separator:i;n="length"in t?lr(t.length):n,l="omission"in t?Xl(t.omission):l}var o=(e=rr(e)).length;if(Ft(e)){var a=zt(e);o=a.length}if(n>=o)return e;var r=n-jt(l);if(r<1)return l;var u=a?ri(a,0,r).join(""):e.slice(0,r);if(void 0===i)return u+l;if(a&&(r+=u.length-r),qa(i)){if(e.slice(r).search(i)){var d,s=u;for(i.global||(i=pe(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(Xl(i),r)!=r){var v=u.lastIndexOf(i);v>-1&&(u=u.slice(0,v))}return u+l},Ln.unescape=function(e){return(e=rr(e))&&F.test(e)?e.replace(x,Gt):e},Ln.uniqueId=function(e){var t=++Ne;return rr(e)+t},Ln.upperCase=Ur,Ln.upperFirst=kr,Ln.each=ra,Ln.eachRight=ua,Ln.first=Bo,Jr(Ln,(au={},rl(Ln,function(e,t){Se.call(Ln.prototype,t)||(au[t]=e)}),au),{chain:!1}),Ln.VERSION="4.17.21",lt(["bind","bindKey","curry","curryRight","partial","partialRight"],function(e){Ln[e].placeholder=Ln}),lt(["drop","take"],function(e,t){wn.prototype[e]=function(n){n=void 0===n?1:on(lr(n),0);var l=this.__filtered__&&!t?new wn(this):this.clone();return l.__filtered__?l.__takeCount__=an(n,l.__takeCount__):l.__views__.push({size:an(n,4294967295),type:e+(l.__dir__<0?"Right":"")}),l},wn.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}}),lt(["filter","map","takeWhile"],function(e,t){var n=t+1,l=1==n||3==n;wn.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:qi(e,3),type:n}),t.__filtered__=t.__filtered__||l,t}}),lt(["head","last"],function(e,t){var n="take"+(t?"Right":"");wn.prototype[e]=function(){return this[n](1).value()[0]}}),lt(["initial","tail"],function(e,t){var n="drop"+(t?"":"Right");wn.prototype[e]=function(){return this.__filtered__?new wn(this):this[n](1)}}),wn.prototype.compact=function(){return this.filter(Yr)},wn.prototype.find=function(e){return this.filter(e).head()},wn.prototype.findLast=function(e){return this.reverse().find(e)},wn.prototype.invokeMap=Fl(function(e,t){return"function"==typeof e?new wn(this):this.map(function(n){return gl(n,e,t)})}),wn.prototype.reject=function(e){return this.filter(Ca(qi(e)))},wn.prototype.slice=function(e,t){e=lr(e);var n=this;return n.__filtered__&&(e>0||t<0)?new wn(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),void 0!==t&&(n=(t=lr(t))<0?n.dropRight(-t):n.take(t-e)),n)},wn.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},wn.prototype.toArray=function(){return this.take(4294967295)},rl(wn.prototype,function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),l=/^(?:head|last)$/.test(t),i=Ln[l?"take"+("last"==t?"Right":""):t],o=l||/^find/.test(t);i&&(Ln.prototype[t]=function(){var t=this.__wrapped__,a=l?[1]:arguments,r=t instanceof wn,u=a[0],d=r||Pa(t),s=function(e){var t=i.apply(Ln,st([e],a));return l&&c?t[0]:t};d&&n&&"function"==typeof u&&1!=u.length&&(r=d=!1);var c=this.__chain__,v=!!this.__actions__.length,m=o&&!c,p=r&&!v;if(!o&&d){t=p?t:new wn(this);var f=e.apply(t,a);return f.__actions__.push({func:na,args:[s],thisArg:void 0}),new In(f,c)}return m&&p?e.apply(this,a):(f=this.thru(s),m?l?f.value()[0]:f.value():f)})}),lt(["pop","push","shift","sort","splice","unshift"],function(e){var t=ge[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",l=/^(?:pop|shift)$/.test(e);Ln.prototype[e]=function(){var e=arguments;if(l&&!this.__chain__){var i=this.value();return t.apply(Pa(i)?i:[],e)}return this[n](function(n){return t.apply(Pa(n)?n:[],e)})}}),rl(wn.prototype,function(e,t){var n=Ln[t];if(n){var l=n.name+"";Se.call(_n,l)||(_n[l]=[]),_n[l].push({name:t,func:n})}}),_n[Di(void 0,2).name]=[{name:"wrapper",func:void 0}],wn.prototype.clone=function(){var e=new wn(this.__wrapped__);return e.__actions__=fi(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=fi(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=fi(this.__views__),e},wn.prototype.reverse=function(){if(this.__filtered__){var e=new wn(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},wn.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,n=Pa(e),l=t<0,i=n?e.length:0,o=function(e,t,n){for(var l=-1,i=n.length;++l<i;){var o=n[l],a=o.size;switch(o.type){case"drop":e+=a;break;case"dropRight":t-=a;break;case"take":t=an(t,e+a);break;case"takeRight":e=on(e,t-a)}}return{start:e,end:t}}(0,i,this.__views__),a=o.start,r=o.end,u=r-a,d=l?r:a-1,s=this.__iteratees__,c=s.length,v=0,m=an(u,this.__takeCount__);if(!n||!l&&i==u&&m==u)return ei(e,this.__actions__);var p=[];e:for(;u--&&v<m;){for(var f=-1,E=e[d+=t];++f<c;){var g=s[f],_=g.type,h=(0,g.iteratee)(E);if(2==_)E=h;else if(!h){if(1==_)continue e;break e}}p[v++]=E}return p},Ln.prototype.at=la,Ln.prototype.chain=function(){return ta(this)},Ln.prototype.commit=function(){return new In(this.value(),this.__chain__)},Ln.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__++]}},Ln.prototype.plant=function(e){for(var t,n=this;n instanceof Tn;){var l=Oo(n);l.__index__=0,l.__values__=void 0,t?i.__wrapped__=l:t=l;var i=l;n=n.__wrapped__}return i.__wrapped__=e,t},Ln.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof wn){var t=e;return this.__actions__.length&&(t=new wn(this)),(t=t.reverse()).__actions__.push({func:na,args:[zo],thisArg:void 0}),new In(t,this.__chain__)}return this.thru(zo)},Ln.prototype.toJSON=Ln.prototype.valueOf=Ln.prototype.value=function(){return ei(this.__wrapped__,this.__actions__)},Ln.prototype.first=Ln.prototype.head,pt&&(Ln.prototype[pt]=function(){return this}),Ln}();Ge?((Ge.exports=Yt)._=Yt,Ve._=Yt):ze._=Yt}).call(C)});const St=e=>{var i,r;const{register:u,setValue:d,getValues:s,reset:c,formState:v}=a.useFormContext(),{t:m}=o.useTranslation(),p=Digit.UserService.getUser().info;return l.createElement(n.Fragment,null,l.createElement(t.SearchField,null,l.createElement("label",null,m("NOC_APPLICATION_NUMBER")),l.createElement(t.TextInput,{name:"applicationNo",inputRef:u({})})),l.createElement(t.SearchField,null,l.createElement("label",null,m("NOC_APPLICANT_MOBILE_NO_LABEL")),l.createElement(t.MobileNumber,{name:"mobileNumber",inputRef:u({minLength:{value:10,message:m("CORE_COMMON_MOBILE_ERROR")},maxLength:{value:10,message:m("CORE_COMMON_MOBILE_ERROR")},pattern:{value:/[6789][0-9]{9}/,message:m("CORE_COMMON_MOBILE_ERROR")}}),type:"number",componentInFront:l.createElement("div",{className:"employee-card-input employee-card-input--front"},"+91")}),l.createElement(t.CardLabelError,null,null==v||null===(i=v.errors)||void 0===i||null===(r=i.mobileNumber)||void 0===r?void 0:r.message)),l.createElement(t.SearchField,{className:"submit"},l.createElement(t.SubmitBar,{label:m("ES_COMMON_SEARCH"),submit:!0}),l.createElement("p",{style:{marginTop:"24px"},onClick:()=>{c({applicationNo:"",mobileNumber:"",offset:0,limit:10,sortBy:"createdTime",sortOrder:"DESC",isSubmitSuccessful:"false"}),d("offset",s("offset")-s("limit")),null==e||e.onSubmit({offset:0,limit:10,sortBy:"createdTime",sortOrder:"DESC",mobileNumber:null==p?void 0:p.mobileNumber},!0),null!=e&&e.isMobileView&&e.closeMobilePopupModal()}},m("ES_COMMON_CLEAR_ALL"))))},Nt=["currentlyActiveMobileModal"],bt=["currentlyActiveMobileModal"],Ct=e=>{var i,r;let{SearchFormFieldsComponent:u,propsMobileInboxCards:d,isLoading:s,data:m,onSubmit:p}=e;const{t:f}=o.useTranslation(),{handleSubmit:E}=a.useFormContext(),[g,_]=n.useReducer(function(e,t){switch(t.type){case"set":return t.payload;case"remove":return!1}},!1),h=()=>{_({type:"remove"})},A=()=>l.createElement("div",{className:"InboxMobilePopupCloseButtonWrapper",onClick:h},l.createElement(t.CloseSvg,null)),S=n.useCallback(e=>{let{currentlyActiveMobileModal:n}=e;return(e=>{let{currentlyActiveMobileModal:n}=e,i=v(e,Nt);const{closeMobilePopupModal:o}=i;switch(n){case"SearchFormComponent":return l.createElement(t.SearchForm,i,l.createElement(A,null),l.createElement("div",{className:"MobilePopupHeadingWrapper"},l.createElement("h2",null,f("ACTION_TEST_SEARCH_NOC_APPLICATION"),":")),l.createElement(u,{onSubmit:p,handleSubmit:E,isMobileView:!0,closeMobilePopupModal:o}));default:return l.createElement("span",null)}})(c({currentlyActiveMobileModal:n},v(e,bt)))},[g]);return s?l.createElement(t.Loader,null):l.createElement(l.Fragment,null,l.createElement("div",{className:"searchBox"},l.createElement(t.SearchAction,{text:f("ES_COMMON_SEARCH"),handleActionClick:()=>_({type:"set",payload:"SearchFormComponent"})})),g?l.createElement(t.PopUp,null,l.createElement(S,{onSubmit:e=>{_({type:"remove"}),p(e)},handleSubmit:E,id:"search-form",className:"rm-mb form-field-flex-one inboxPopupMobileWrapper",currentlyActiveMobileModal:g,closeMobilePopupModal:h})):null,null!=m&&null!==(i=m[0])&&void 0!==i&&i.display?l.createElement(t.Card,{style:{marginTop:20}},f(null==m||null===(r=m[0])||void 0===r?void 0:r.display).split("\\n").map((e,t)=>l.createElement("p",{key:t,style:{textAlign:"center"}},e))):l.createElement(t.DetailsCard,{data:d,isTwoDynamicPrefix:!1,linkPrefix:"/digit-ui/employee/noc/inbox/application-overview/",serviceRequestIdKey:f("NOC_APPLICATION_NUMBER")}))},yt=e=>{let{columns:i,SearchFormFieldsComponent:r,onSubmit:u,data:d,isLoading:s,Count:c}=e;const{handleSubmit:v,setValue:m,getValues:p}=a.useFormContext();null==p("offset")&&m("offset",0),null==p("limit")&&m("limit",10);const[f,E]=n.useState(Number(p("offset"))/Number(p("limit"))),{t:g}=o.useTranslation(),_=()=>{m("offset",c&&10*Math.ceil(c/10)-p("limit")),v(u)()},h=()=>{m("offset",0),v(u)()},A=n.useCallback(e=>{0!==e.length&&(m("sortBy",e.id),m("sortOrder",e.desc?"DESC":"ASC"))},[]);function S(e){m("limit",Number(e.target.value)),v(u)()}function N(){m("offset",Number(p("offset"))+Number(p("limit"))),v(u)()}function b(){m("offset",Number(p("offset"))-Number(p("limit"))),v(u)()}n.useEffect(()=>{null!=p("offset")&&null!=p("limit")&&E(Number(p("offset"))/Number(p("limit")))},[p("offset"),p("limit")]);const C=()=>{return s?l.createElement(t.Loader,null):null!=d&&null!==(e=d[0])&&void 0!==e&&e.display?l.createElement(t.Card,{style:{marginTop:20}},g(null==d||null===(n=d[0])||void 0===n?void 0:n.display).split("\\n").map((e,t)=>l.createElement("p",{key:t,style:{textAlign:"center"}},e))):l.createElement(t.Table,{t:g,data:d,columns:i,getCellProps:e=>({style:{minWidth:e.column.Header===g("ES_INBOX_APPLICATION_NO")?"240px":"",padding:"20px 18px",fontSize:"16px"}}),onPageSizeChange:S,currentPage:f,onNextPage:N,onPrevPage:b,pageSizeLimit:Number(p("limit")),onSort:A,totalRecords:c,disableSort:!1,onLastPage:_,onFirstPage:h,sortParams:[{id:p("sortBy"),desc:"DESC"===p("sortOrder")}]});var e,n};return l.createElement(l.Fragment,null,l.createElement(t.SearchForm,{onSubmit:u,handleSubmit:v},l.createElement(r,{onSubmit:u,handleSubmit:v,isMobileView:!1})),l.createElement(C,null))},Dt=e=>{let{t:t,onSubmit:r,data:u,error:d,isLoading:s,Count:c}=e;const[v,m]=n.useState(null),p=a.useForm();n.useEffect(()=>{p.register("offset",0),p.register("limit",10),p.register("sortBy","createdTime"),p.register("sortOrder","DESC")},[p.register]);const f=(()=>{const{t:e}=o.useTranslation();return n.useMemo(()=>[{Header:e("NOC_APPLICATION_NUMBER"),accessor:"applicationNo",disableSortBy:!0,Cell:e=>{let{row:t}=e;return l.createElement("div",null,l.createElement("span",{className:"link"},l.createElement(i.Link,{to:"/digit-ui/employee/noc/inbox/application-overview/"+t.original.applicationNo},t.original.applicationNo)))}},{Header:e("TL_COMMON_TABLE_COL_APP_DATE"),disableSortBy:!0,accessor:t=>e((null==t?void 0:t.date)||"-")},{Header:e("PT_COMMON_TABLE_COL_STATUS_LABEL"),accessor:t=>e((null==t?void 0:t.applicationStatus)||"-"),disableSortBy:!0}],[])})(),E=window.Digit.Utils.browser.isMobile(),g=n.useMemo(()=>null==u?void 0:u.map(e=>({[t("NOC_APPLICATION_NUMBER")]:(null==e?void 0:e.applicationNo)||"-",[t("TL_COMMON_TABLE_COL_APP_DATE")]:(null==e?void 0:e.date)||"-",[t("PT_COMMON_TABLE_COL_STATUS_LABEL")]:null!=e&&e.applicationStatus?t(""+e.applicationStatus):"-"})),[u]);return l.createElement(a.FormProvider,p,E?l.createElement(Ct,{SearchFormFieldsComponent:St,propsMobileInboxCards:g,isLoading:s,data:u,getRedirectionLink:()=>"noc/inbox/application-overview",onSubmit:r}):l.createElement(yt,{columns:f,SearchFormFieldsComponent:St,onSubmit:r,data:u,error:d,isLoading:s,Count:c}))},Lt=e=>{const{t:i}=o.useTranslation(),a=Digit.UserService.getUser().info;let r;r=window.location.pathname.includes("employee")?window.localStorage.getItem("Employee.tenant-id"):window.localStorage.getItem("CITIZEN.CITY");const u={offset:0,limit:10,tenantId:r,mobileNumber:null==a?void 0:a.mobileNumber},[d,s]=n.useState(u),c=window.Digit.Utils.browser.isMobile(),[v,m]=n.useState([{display:"ES_COMMON_NO_DATA"}]),[p,f]=n.useState(0),{data:E,isLoading:g,error:_}=Digit.Hooks.noc.useNOCSearchApplicationByIdOrMobile(d,r,{});return n.useEffect(()=>{var e;null==E?m([{display:"ES_COMMON_NO_DATA"}]):(null==E||null===(e=E.data)||void 0===e?void 0:e.length)>0&&(m(null==E?void 0:E.data),f(null==E?void 0:E.totalCount))},[E]),l.createElement("div",null,l.createElement(t.CardHeader,{styles:c?{fontSize:"32px",fontWeight:"700",paddingLeft:"10px"}:{fontSize:"32px",fontWeight:"700"}},i("ACTION_TEST_SEARCH_NOC_APPLICATION")),l.createElement(Dt,{t:i,tenantId:r,onSubmit:function(e,t){console.log("_data==>",e);let n=ht(e);!!n.applicationNo&&!n.mobileNumber&&(console.log("we are deleteing mobileNumber here"),delete n.mobileNumber),s(n)},isLoading:g,Count:p,error:_,data:v}))},Ot=(e,t)=>{if(0===e)return t("NOC_GROUND_FLOOR_AREA_LABEL");const n=e%10,l=e%100;let i="th";return(l<11||l>13)&&(1===n?i="st":2===n?i="nd":3===n&&(i="rd")),""+e+i+" "+t("NOC_FLOOR_AREA_LABEL")},Tt=(e,t)=>{var n;let l=[{title:t("CS_APPLICATION_NUMBER"),value:(null==e?void 0:e.applicationNo)||"N/A"},{title:t("REGISTRATION_FILED_DATE"),value:Digit.DateUtils.ConvertTimestampToDate(null==e||null===(n=e.auditDetails)||void 0===n?void 0:n.createdTime,"dd/MM/yyyy")||"NA"}];return{title:t("CS_APPLICATION_DETAILS"),values:l}},It=(e,t)=>{var n,l,i,o,a,r,u,d,s,c,v,m,p,f,E,g,_,h,A,S,N,b,C,y,D,L,O,T;let I=[{title:t("NOC_FIRM_OWNER_NAME_LABEL"),value:(null==e||null===(n=e.nocDetails)||void 0===n||null===(l=n.additionalDetails)||void 0===l||null===(i=l.applicationDetails)||void 0===i?void 0:i.applicantOwnerOrFirmName)||"N/A"},{title:t("NOC_APPLICANT_EMAIL_LABEL"),value:(null==e||null===(o=e.nocDetails)||void 0===o||null===(a=o.additionalDetails)||void 0===a||null===(r=a.applicationDetails)||void 0===r?void 0:r.applicantEmailId)||"N/A"},{title:t("NOC_APPLICANT_FATHER_HUSBAND_NAME_LABEL"),value:(null==e||null===(u=e.nocDetails)||void 0===u||null===(d=u.additionalDetails)||void 0===d||null===(s=d.applicationDetails)||void 0===s?void 0:s.applicantFatherHusbandName)||"N/A"},{title:t("NOC_APPLICANT_MOBILE_NO_LABEL"),value:(null==e||null===(c=e.nocDetails)||void 0===c||null===(v=c.additionalDetails)||void 0===v||null===(m=v.applicationDetails)||void 0===m?void 0:m.applicantMobileNumber)||"N/A"},{title:t("NOC_APPLICANT_DOB_LABEL"),value:(null==e||null===(p=e.nocDetails)||void 0===p||null===(f=p.additionalDetails)||void 0===f||null===(E=f.applicationDetails)||void 0===E?void 0:E.applicantDateOfBirth)||"N/A"},{title:t("NOC_APPLICANT_GENDER_LABEL"),value:(null==e||null===(g=e.nocDetails)||void 0===g||null===(_=g.additionalDetails)||void 0===_||null===(h=_.applicationDetails)||void 0===h||null===(A=h.applicantGender)||void 0===A?void 0:A.code)||(null==e||null===(S=e.nocDetails)||void 0===S||null===(N=S.additionalDetails)||void 0===N||null===(b=N.applicationDetails)||void 0===b?void 0:b.applicantGender)||"N/A"},{title:t("NOC_APPLICANT_ADDRESS_LABEL"),value:(null==e||null===(C=e.nocDetails)||void 0===C||null===(y=C.additionalDetails)||void 0===y||null===(D=y.applicationDetails)||void 0===D?void 0:D.applicantAddress)||"N/A"},{title:t("NOC_APPLICANT_PROPERTY_ID_LABEL"),value:(null==e||null===(L=e.nocDetails)||void 0===L||null===(O=L.additionalDetails)||void 0===O||null===(T=O.applicationDetails)||void 0===T?void 0:T.applicantPropertyId)||"N/A"}];return{title:t("NOC_APPLICANT_DETAILS"),values:I}},wt=(e,t)=>{var n,l,i,o,a,r,u,d,s,c,v,m,p,f,E,g,_,h,A,S,N,b,C,y,D,L,O,T,I,w,R,P,x,B,F,M,U,k,W,H,j,z,V,G,Y,K,q,X,J,Q,Z,$,ee,te,ne,le,ie,oe,ae,re,ue,de,se,ce,ve,me,pe,fe,Ee,ge,_e,he,Ae,Se,Ne,be,Ce,ye,De,Le,Oe,Te,Ie,we,Re,Pe,xe,Be,Fe,Me,Ue,ke,We;let He=[{title:t("NOC_PLOT_NO_LABEL"),value:(null==e||null===(n=e.nocDetails)||void 0===n||null===(l=n.additionalDetails)||void 0===l||null===(i=l.siteDetails)||void 0===i?void 0:i.plotNo)||"N/A"},{title:t("NOC_PROPOSED_SITE_ADDRESS"),value:(null==e||null===(o=e.nocDetails)||void 0===o||null===(a=o.additionalDetails)||void 0===a||null===(r=a.siteDetails)||void 0===r?void 0:r.proposedSiteAddress)||"N/A"},{title:t("NOC_ULB_NAME_LABEL"),value:(null==e||null===(u=e.nocDetails)||void 0===u||null===(d=u.additionalDetails)||void 0===d||null===(s=d.siteDetails)||void 0===s||null===(c=s.ulbName)||void 0===c?void 0:c.name)||(null==e||null===(v=e.nocDetails)||void 0===v||null===(m=v.additionalDetails)||void 0===m||null===(p=m.siteDetails)||void 0===p?void 0:p.ulbName)||"N/A"},{title:t("NOC_ULB_TYPE_LABEL"),value:(null==e||null===(f=e.nocDetails)||void 0===f||null===(E=f.additionalDetails)||void 0===E||null===(g=E.siteDetails)||void 0===g?void 0:g.ulbType)||"N/A"},{title:t("NOC_KHASRA_NO_LABEL"),value:(null==e||null===(_=e.nocDetails)||void 0===_||null===(h=_.additionalDetails)||void 0===h||null===(A=h.siteDetails)||void 0===A?void 0:A.khasraNo)||"N/A"},{title:t("NOC_HADBAST_NO_LABEL"),value:(null==e||null===(S=e.nocDetails)||void 0===S||null===(N=S.additionalDetails)||void 0===N||null===(b=N.siteDetails)||void 0===b?void 0:b.hadbastNo)||"N/A"},{title:t("NOC_ROAD_TYPE_LABEL"),value:(null==e||null===(C=e.nocDetails)||void 0===C||null===(y=C.additionalDetails)||void 0===y||null===(D=y.siteDetails)||void 0===D||null===(L=D.roadType)||void 0===L?void 0:L.name)||(null==e||null===(O=e.nocDetails)||void 0===O||null===(T=O.additionalDetails)||void 0===T||null===(I=T.siteDetails)||void 0===I?void 0:I.roadType)||"N/A"},{title:t("NOC_AREA_LEFT_FOR_ROAD_WIDENING_LABEL"),value:(null==e||null===(w=e.nocDetails)||void 0===w||null===(R=w.additionalDetails)||void 0===R||null===(P=R.siteDetails)||void 0===P?void 0:P.areaLeftForRoadWidening)||"N/A"},{title:t("NOC_NET_PLOT_AREA_AFTER_WIDENING_LABEL"),value:(null==e||null===(x=e.nocDetails)||void 0===x||null===(B=x.additionalDetails)||void 0===B||null===(F=B.siteDetails)||void 0===F?void 0:F.netPlotAreaAfterWidening)||"N/A"},{title:t("NOC_NET_TOTAL_AREA_LABEL"),value:(null==e||null===(M=e.nocDetails)||void 0===M||null===(U=M.additionalDetails)||void 0===U||null===(k=U.siteDetails)||void 0===k?void 0:k.netTotalArea)||"N/A"},{title:t("NOC_ROAD_WIDTH_AT_SITE_LABEL"),value:(null==e||null===(W=e.nocDetails)||void 0===W||null===(H=W.additionalDetails)||void 0===H||null===(j=H.siteDetails)||void 0===j?void 0:j.roadWidthAtSite)||"N/A"},{title:t("NOC_DISTRICT_LABEL"),value:(null==e||null===(z=e.nocDetails)||void 0===z||null===(V=z.additionalDetails)||void 0===V||null===(G=V.siteDetails)||void 0===G||null===(Y=G.district)||void 0===Y?void 0:Y.name)||(null==e||null===(K=e.nocDetails)||void 0===K||null===(q=K.additionalDetails)||void 0===q||null===(X=q.siteDetails)||void 0===X?void 0:X.district)||"N/A"},{title:t("NOC_ZONE_LABEL"),value:(null==e||null===(J=e.nocDetails)||void 0===J||null===(Q=J.additionalDetails)||void 0===Q||null===(Z=Q.siteDetails)||void 0===Z||null===($=Z.zone)||void 0===$?void 0:$.name)||(null==e||null===(ee=e.nocDetails)||void 0===ee||null===(te=ee.additionalDetails)||void 0===te||null===(ne=te.siteDetails)||void 0===ne?void 0:ne.zone)||"N/A"},{title:t("NOC_SITE_WARD_NO_LABEL"),value:(null==e||null===(le=e.nocDetails)||void 0===le||null===(ie=le.additionalDetails)||void 0===ie||null===(oe=ie.siteDetails)||void 0===oe?void 0:oe.wardNo)||"N/A"},{title:t("NOC_SITE_VILLAGE_NAME_LABEL"),value:(null==e||null===(ae=e.nocDetails)||void 0===ae||null===(re=ae.additionalDetails)||void 0===re||null===(ue=re.siteDetails)||void 0===ue?void 0:ue.villageName)||"N/A"},{title:t("NOC_SITE_COLONY_NAME_LABEL"),value:(null==e||null===(de=e.nocDetails)||void 0===de||null===(se=de.additionalDetails)||void 0===se||null===(ce=se.siteDetails)||void 0===ce?void 0:ce.colonyName)||"N/A"},{title:t("NOC_SITE_VASIKA_NO_LABEL"),value:(null==e||null===(ve=e.nocDetails)||void 0===ve||null===(me=ve.additionalDetails)||void 0===me||null===(pe=me.siteDetails)||void 0===pe?void 0:pe.vasikaNumber)||"N/A"},{title:t("NOC_SITE_KHEWAT_AND_KHATUNI_NO_LABEL"),value:(null==e||null===(fe=e.nocDetails)||void 0===fe||null===(Ee=fe.additionalDetails)||void 0===Ee||null===(ge=Ee.siteDetails)||void 0===ge?void 0:ge.khewatAndKhatuniNo)||"N/A"},{title:t("NOC_BUILDING_STATUS_LABEL"),value:(null==e||null===(_e=e.nocDetails)||void 0===_e||null===(he=_e.additionalDetails)||void 0===he||null===(Ae=he.siteDetails)||void 0===Ae||null===(Se=Ae.buildingStatus)||void 0===Se?void 0:Se.name)||(null==e||null===(Ne=e.nocDetails)||void 0===Ne||null===(be=Ne.additionalDetails)||void 0===be||null===(Ce=be.siteDetails)||void 0===Ce?void 0:Ce.buildingStatus)||"N/A"},{title:t("NOC_IS_BASEMENT_AREA_PRESENT_LABEL"),value:(null==e||null===(ye=e.nocDetails)||void 0===ye||null===(De=ye.additionalDetails)||void 0===De||null===(Le=De.siteDetails)||void 0===Le||null===(Oe=Le.isBasementAreaAvailable)||void 0===Oe?void 0:Oe.code)||(null==e||null===(Te=e.nocDetails)||void 0===Te||null===(Ie=Te.additionalDetails)||void 0===Ie||null===(we=Ie.siteDetails)||void 0===we?void 0:we.isBasementAreaAvailable)||"N/A"}];var je,ze,Ve,Ge,Ye,Ke,qe,Xe,Je,Qe;return"Built Up"==(null==e||null===(Re=e.nocDetails)||void 0===Re||null===(Pe=Re.additionalDetails)||void 0===Pe||null===(xe=Pe.siteDetails)||void 0===xe?void 0:xe.buildingStatus)&&He.push({title:t("NOC_BASEMENT_AREA_LABEL"),value:(null==e||null===(je=e.nocDetails)||void 0===je||null===(ze=je.additionalDetails)||void 0===ze||null===(Ve=ze.siteDetails)||void 0===Ve?void 0:Ve.basementArea)||"N/A"}),"Built UP"==(null==e||null===(Be=e.nocDetails)||void 0===Be||null===(Fe=Be.additionalDetails)||void 0===Fe||null===(Me=Fe.siteDetails)||void 0===Me?void 0:Me.buildingStatus)&&(null==e||null===(Ge=e.nocDetails)||void 0===Ge||null===(Ye=Ge.additionalDetails)||void 0===Ye||null===(Ke=Ye.siteDetails)||void 0===Ke||null===(qe=Ke.floorArea)||void 0===qe||qe.map((e,n)=>He.push({title:Ot(n,t),value:null==e?void 0:e.value}))),"Built Up"==(null==e||null===(Ue=e.nocDetails)||void 0===Ue||null===(ke=Ue.additionalDetails)||void 0===ke||null===(We=ke.siteDetails)||void 0===We?void 0:We.buildingStatus)&&He.push({title:t("NOC_TOTAL_FLOOR_BUILT_UP_AREA_LABEL"),value:(null==e||null===(Xe=e.nocDetails)||void 0===Xe||null===(Je=Xe.additionalDetails)||void 0===Je||null===(Qe=Je.siteDetails)||void 0===Qe?void 0:Qe.totalFloorArea)||"N/A"}),{title:t("NOC_SITE_DETAILS"),values:He}},Rt=(e,t)=>{var n,l,i,o,a,r,u,d,s,c,v,m,p,f,E,g,_,h,A,S,N,b,C,y,D,L,O,T,I,w,R;let P=[{title:t("NOC_PLOT_AREA_JAMA_BANDI_LABEL"),value:(null==e||null===(n=e.nocDetails)||void 0===n||null===(l=n.additionalDetails)||void 0===l||null===(i=l.siteDetails)||void 0===i?void 0:i.specificationPlotArea)||"N/A"},{title:t("NOC_BUILDING_CATEGORY_LABEL"),value:(null==e||null===(o=e.nocDetails)||void 0===o||null===(a=o.additionalDetails)||void 0===a||null===(r=a.siteDetails)||void 0===r||null===(u=r.specificationBuildingCategory)||void 0===u?void 0:u.name)||(null==e||null===(d=e.nocDetails)||void 0===d||null===(s=d.additionalDetails)||void 0===s||null===(c=s.siteDetails)||void 0===c?void 0:c.specificationBuildingCategory)||"N/A"},{title:t("NOC_NOC_TYPE_LABEL"),value:(null==e||null===(v=e.nocDetails)||void 0===v||null===(m=v.additionalDetails)||void 0===m||null===(p=m.siteDetails)||void 0===p||null===(f=p.specificationNocType)||void 0===f?void 0:f.name)||(null==e||null===(E=e.nocDetails)||void 0===E||null===(g=E.additionalDetails)||void 0===g||null===(_=g.siteDetails)||void 0===_?void 0:_.specificationNocType)||"N/A"},{title:t("NOC_RESTRICTED_AREA_LABEL"),value:(null==e||null===(h=e.nocDetails)||void 0===h||null===(A=h.additionalDetails)||void 0===A||null===(S=A.siteDetails)||void 0===S||null===(N=S.specificationRestrictedArea)||void 0===N?void 0:N.code)||(null==e||null===(b=e.nocDetails)||void 0===b||null===(C=b.additionalDetails)||void 0===C||null===(y=C.siteDetails)||void 0===y?void 0:y.specificationRestrictedArea)||"N/A"},{title:t("NOC_IS_SITE_UNDER_MASTER_PLAN_LABEL"),value:(null==e||null===(D=e.nocDetails)||void 0===D||null===(L=D.additionalDetails)||void 0===L||null===(O=L.siteDetails)||void 0===O||null===(T=O.specificationIsSiteUnderMasterPlan)||void 0===T?void 0:T.code)||(null==e||null===(I=e.nocDetails)||void 0===I||null===(w=I.additionalDetails)||void 0===w||null===(R=w.siteDetails)||void 0===R?void 0:R.specificationIsSiteUnderMasterPlan)||"N/A"}];return{title:t("NOC_SPECIFICATION_DETAILS"),values:P}},Pt=(e,t)=>{var n,l,i,o,a,r,u,d,s,c,v,m;let p=[{title:t("COMMON_LATITUDE1_LABEL"),value:(null==e||null===(n=e.nocDetails)||void 0===n||null===(l=n.additionalDetails)||void 0===l||null===(i=l.coordinates)||void 0===i?void 0:i.Latitude1)||"N/A"},{title:t("COMMON_LONGITUDE1_LABEL"),value:(null==e||null===(o=e.nocDetails)||void 0===o||null===(a=o.additionalDetails)||void 0===a||null===(r=a.coordinates)||void 0===r?void 0:r.Longitude1)||"N/A"},{title:t("COMMON_LATITUDE2_LABEL"),value:(null==e||null===(u=e.nocDetails)||void 0===u||null===(d=u.additionalDetails)||void 0===d||null===(s=d.coordinates)||void 0===s?void 0:s.Latitude2)||"N/A"},{title:t("COMMON_LONGITUDE2_LABEL"),value:(null==e||null===(c=e.nocDetails)||void 0===c||null===(v=c.additionalDetails)||void 0===v||null===(m=v.coordinates)||void 0===m?void 0:m.Longitude2)||"N/A"}];return{title:t("NOC_SITE_COORDINATES_LABEL"),values:p}},xt=function(e,t){try{var n;function l(n){var l;return{title:t("NOC_TITILE_DOCUMENT_UPLOADED"),values:(null==e||null===(l=e.documents)||void 0===l?void 0:l.length)>0?e.documents.map((e,l)=>{let i=g(null==n?void 0:n.data,null==e?void 0:e.uuid);return{title:t((null==e?void 0:e.documentType)||t("CS_NA")),value:E(i,l)||t("CS_NA")}}):{title:t("PT_NO_DOCUMENTS"),value:" "}}}const i=null==e||null===(n=e.documents)||void 0===n?void 0:n.map(e=>null==e?void 0:e.uuid),o=(null==i?void 0:i.length)>0;return Promise.resolve(o?Promise.resolve(Digit.UploadServices.Filefetch(i,Digit.ULBService.getStateId())).then(l):l(o))}catch(e){return Promise.reject(e)}},Bt=function(e,t,n){try{var l;const i=Digit.ULBService.getStateId(),o=e||{};let a=[],r="";const u=(null==o||null===(l=o.documents)||void 0===l?void 0:l.find(e=>"OWNER.OWNERPHOTO"===(null==e?void 0:e.documentType)))||null;return Promise.resolve(Digit.UploadServices.Filefetch([(null==u?void 0:u.documentAttachment)||""],i)).then(function(e){var l,i,u,d,s;const c=null==e||null===(l=e.data)||void 0===l||null===(i=l.fileStoreIds)||void 0===i?void 0:i[0];return r=(null==c?void 0:c.url)||"",null!=o&&null!==(u=o.nocDetails)&&void 0!==u&&null!==(d=u.additionalDetails)&&void 0!==d&&null!==(s=d.applicationDetails)&&void 0!==s&&s.professionalName&&a.push(((e,t)=>{var n,l,i,o,a,r,u,d,s,c,v,m,p,f,E;let g=[{title:t("NOC_PROFESSIONAL_NAME_LABEL"),value:(null==e||null===(n=e.nocDetails)||void 0===n||null===(l=n.additionalDetails)||void 0===l||null===(i=l.applicationDetails)||void 0===i?void 0:i.professionalName)||"N/A"},{title:t("NOC_PROFESSIONAL_EMAIL_LABEL"),value:(null==e||null===(o=e.nocDetails)||void 0===o||null===(a=o.additionalDetails)||void 0===a||null===(r=a.applicationDetails)||void 0===r?void 0:r.professionalEmailId)||"N/A"},{title:t("NOC_PROFESSIONAL_REGISTRATION_ID_LABEL"),value:(null==e||null===(u=e.nocDetails)||void 0===u||null===(d=u.additionalDetails)||void 0===d||null===(s=d.applicationDetails)||void 0===s?void 0:s.professionalRegId)||"N/A"},{title:t("NOC_PROFESSIONAL_MOBILE_NO_LABEL"),value:(null==e||null===(c=e.nocDetails)||void 0===c||null===(v=c.additionalDetails)||void 0===v||null===(m=v.applicationDetails)||void 0===m?void 0:m.professionalMobileNumber)||"N/A"},{title:t("NOC_PROFESSIONAL_ADDRESS_LABEL"),value:(null==e||null===(p=e.nocDetails)||void 0===p||null===(f=p.additionalDetails)||void 0===f||null===(E=f.applicationDetails)||void 0===E?void 0:E.professionalAddress)||"N/A"}];return{title:t("NOC_PROFESSIONAL_DETAILS"),values:g}})(o,n)),{t:n,tenantId:null==t?void 0:t.code,name:n("NOC_ACKNOWLEDGEMENT_TITLE"),email:null==t?void 0:t.emailId,phoneNumber:null==t?void 0:t.contactNumber,heading:n("LOCAL_GOVERNMENT_PUNJAB"),applicationNumber:(null==o?void 0:o.applicationNo)||"NA",details:[Tt(o,n),...a,It(o,n),wt(o,n),Rt(o,n),Pt(o,n),xt(o,n)],imageURL:r}})}catch(e){return Promise.reject(e)}},Ft=e=>{var n,a,r;const u=i.useLocation(),{pathname:d,state:s}=u,{t:c}=o.useTranslation(),v=i.useHistory(),m=null==s||null===(n=s.data)||void 0===n||null===(a=n.Noc)||void 0===a?void 0:a[0];window.localStorage.getItem("Employee.tenant-id"),console.log("nocData in Response",m);const{data:f}=Digit.Hooks.useStore.getInitData(),{tenants:E}=f||{},g=d.split("/").pop();return l.createElement("div",null,l.createElement(t.Card,null,l.createElement(t.Banner,{message:c("NOC_APPLICATION_"+(null==m||null===(r=m.workflow)||void 0===r?void 0:r.action)+"_SUCCESS_HEADER"),applicationNumber:g,info:"REJECTED"==(null==m?void 0:m.applicationStatus)?"":c(p(null==m?void 0:m.nocType,".","_")+"_APPLICATION_NUMBER"),successful:"REJECTED"!=(null==m?void 0:m.applicationStatus),style:{padding:"10px"},headerStyles:{fontSize:"32px",wordBreak:"break-word"}}),"REJECTED"!==(null==m?void 0:m.applicationStatus)?l.createElement("div",null,l.createElement(t.SubmitBar,{style:{overflow:"hidden"},label:c("COMMON_DOWNLOAD"),onSubmit:function(){try{const e=m,t=E.find(t=>t.code===e.tenantId);return Promise.resolve(Bt(e,t,c)).then(function(e){Digit.Utils.pdf.generateBPAREG(e)})}catch(e){return Promise.reject(e)}}})):null,l.createElement(t.ActionBar,{style:{display:"flex",justifyContent:"flex-end",alignItems:"baseline"}},l.createElement(t.SubmitBar,{label:c("CORE_COMMON_GO_TO_HOME"),onSubmit:()=>{v.push("/digit-ui/employee")}}),l.createElement(t.SubmitBar,{label:c("CORE_COMMON_GO_TO_NOC"),onSubmit:()=>{v.push("/digit-ui/employee/noc/inbox")}}))))},Mt=e=>{let{location:n}=e;const{t:i}=o.useTranslation(),a=[{path:"/digit-ui/employee",content:i("ES_COMMON_HOME"),show:!0},{path:"/digit-ui/employee/noc/inbox",content:i("ES_COMMON_INBOX"),show:!!n.pathname.includes("noc/inbox")},{path:"/digit-ui/employee/noc/inbox/application-overview/:id",content:i("NOC_APPLICATION_OVERVIEW_HEADER"),show:!!n.pathname.includes("noc/inbox/application-overview")},{path:"/digit-ui/employee/noc/search",content:i("ES_COMMON_APPLICATION_SEARCH"),show:!!n.pathname.includes("/digit-ui/employee/noc/search")},{path:"/digit-ui/employee/noc/search/application-overview/:id",content:i("NOC_APP_OVER_VIEW_HEADER"),show:!!n.pathname.includes("/digit-ui/employee/noc/search/application-overview")}];return l.createElement(t.BreadCrumb,{crumbs:a})},Ut=e=>{var a,r,u,d,s,v,m,p,f,E;let{path:g}=e;const _=i.useLocation(),h=(o.useTranslation(),null===(a=Digit)||void 0===a||null===(r=a.ComponentRegistryService)||void 0===r?void 0:r.getComponent("NOCApplicationOverview")),A=null===(u=Digit)||void 0===u||null===(d=u.ComponentRegistryService)||void 0===d?void 0:d.getComponent("NOCInbox"),S=null===(s=Digit)||void 0===s||null===(v=s.ComponentRegistryService)||void 0===v?void 0:v.getComponent("NewNOCStepperForm"),N=null===(m=Digit)||void 0===m||null===(p=m.ComponentRegistryService)||void 0===p?void 0:p.getComponent("NOCEmployeeApplicationOverview"),b=null===(f=Digit)||void 0===f||null===(E=f.ComponentRegistryService)||void 0===E?void 0:E.getComponent("NewNOCEditApplication"),C=window.location.href.includes("/response"),y=window.Digit.Utils.browser.isMobile();return l.createElement(n.Fragment,null,C?null:l.createElement("div",{style:window.location.href.includes("application-overview")||y?{marginLeft:"10px"}:{}},l.createElement(Mt,{location:_})),l.createElement(i.Switch,null,l.createElement(t.PrivateRoute,{path:g+"/inbox/application-overview/:id",component:N}),l.createElement(t.PrivateRoute,{path:g+"/search/application-overview/:id",component:h}),l.createElement(t.PrivateRoute,{path:g+"/new-application",component:S}),l.createElement(t.PrivateRoute,{path:g+"/edit-application/:id",component:b}),l.createElement(t.PrivateRoute,{path:g+"/inbox",component:e=>l.createElement(A,c({},e,{parentRoute:g}))}),l.createElement(t.PrivateRoute,{path:g+"/search",component:e=>l.createElement(Lt,c({},e,{parentRoute:g}))}),l.createElement(t.PrivateRoute,{path:g+"/response/:id",component:Ft})))};function kt(e,t){try{var n=e()}catch(e){return t(e)}return n&&n.then?n.then(void 0,t):n}"undefined"!=typeof Symbol&&(Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator"))),"undefined"!=typeof Symbol&&(Symbol.asyncIterator||(Symbol.asyncIterator=Symbol("Symbol.asyncIterator")));const Wt=e=>{const[t,i]=n.useState(e.selectedVal?e.selectedVal:"");return n.useEffect(()=>{e.keepNull?i(""):e.selectedVal?i(e.selectedVal):(i(""),e.setFilter(""))},[e.selectedVal,e.forceSet]),l.createElement("input",{ref:e.inputRef,className:"employee-select-wrap--elipses "+(e.disable&&"disabled"),type:"text",value:t,onChange:function(t){e.freeze||(i(t.target.value),e.setFilter(t.target.value))},onClick:e.onClick,onFocus:function(){e.disable||e.dropdownDisplay(!0)},onBlur:t=>{var n;e.dropdownDisplay(!1),null==e||null===(n=e.onBlur)||void 0===n||n.call(e,t),e.selectedVal!==e.filterVal&&setTimeout(()=>{e.setforceSet(e=>e+1)},1e3)},onKeyDown:t=>{var n,l,i,o,a,r,u,d,s,c,v,m,p;if("ArrowDown"==t.key)e.setOptionIndex(t=>t+1==e.addProps.length?0:t+1),e.addProps.currentIndex+1==e.addProps.length?null==t||null===(n=t.target)||void 0===n||null===(l=n.parentElement)||void 0===l||null===(i=l.parentElement)||void 0===i||null===(o=i.children)||void 0===o||null===(a=o.namedItem("jk-dropdown-unique"))||void 0===a||null===(r=a.scrollTo)||void 0===r||r.call(a,0,0):(null==e||null===(u=e.addProps)||void 0===u?void 0:u.currentIndex)>2&&(null==t||null===(d=t.target)||void 0===d||null===(s=d.parentElement)||void 0===s||null===(c=s.parentElement)||void 0===c||null===(v=c.children)||void 0===v||null===(m=v.namedItem("jk-dropdown-unique"))||void 0===m||null===(p=m.scrollBy)||void 0===p||p.call(m,0,45)),t.preventDefault();else if("ArrowUp"==t.key){var f,E,g,_,h,A,S,N,b,C,y,D,L;e.setOptionIndex(t=>0!==t?t-1:e.addProps.length-1),0==e.addProps.currentIndex?null==t||null===(f=t.target)||void 0===f||null===(E=f.parentElement)||void 0===E||null===(g=E.parentElement)||void 0===g||null===(_=g.children)||void 0===_||null===(h=_.namedItem("jk-dropdown-unique"))||void 0===h||null===(A=h.scrollTo)||void 0===A||A.call(h,1e5,1e5):(null==e||null===(S=e.addProps)||void 0===S?void 0:S.currentIndex)>2&&(null==t||null===(N=t.target)||void 0===N||null===(b=N.parentElement)||void 0===b||null===(C=b.parentElement)||void 0===C||null===(y=C.children)||void 0===y||null===(D=y.namedItem("jk-dropdown-unique"))||void 0===D||null===(L=D.scrollBy)||void 0===L||L.call(D,0,-45)),t.preventDefault()}else"Enter"==t.key&&e.addProps.selectOption(e.addProps.currentIndex)},readOnly:e.disable,autoFocus:e.autoFocus,placeholder:e.placeholder,autoComplete:"off",style:c({},e.style,{zIndex:"auto"})})},Ht=e=>e,jt=e=>{var i,o,a;const r=Digit.SessionStorage.get("userType"),[u,d]=n.useState(!1),[s,v]=n.useState(e.selected?e.selected:null),[m,p]=n.useState(""),[f,E]=n.useState(0),[g,_]=n.useState(-1),h=n.useRef(null),A=!!e.customSelector,S=e.t||Ht;function N(){if(!e.disable){var t,n=u;n||document.addEventListener("mousedown",b,!1),d(!n),null==e||null===(t=e.onBlur)||void 0===t||t.call(e)}}function b(e){h.current&&h.current.contains(e.target)||(document.removeEventListener("mousedown",b,!1),d(!1))}function C(t){t!==s||e.allowMultiselect?(e.select(t),v(t),d(!1)):(v(t),E(f+1))}n.useEffect(()=>{v(e.selected)},[e.selected]),console.log("option",e.option);let y=e.option&&(null===(i=e.option)||void 0===i?void 0:i.filter(t=>{var n,l;return(null===(n=S(t[e.optionKey]))||void 0===n||null===(l=n.toUpperCase())||void 0===l?void 0:l.indexOf(null==m?void 0:m.toUpperCase()))>-1}))||[];var D,L;return"PropertyType"==(null==e||null===(o=e.option)||void 0===o||null===(a=o[0])||void 0===a?void 0:a.label)&&(y=e.option),e.isBPAREG&&s&&((null===(D=e.option)||void 0===D||null===(L=D.filter(e=>(null==e?void 0:e.code)===(null==s?void 0:s.code)))||void 0===L?void 0:L.length)>0||v(null)),l.createElement("div",{className:("employee"===r?"employee-select-wrap":"select-wrap")+" "+(null!=e&&e.className?null==e?void 0:e.className:""),style:c({},e.style)},A&&l.createElement("div",{className:e.showArrow?"cp flex-right column-gap-5":"cp",onClick:N},e.customSelector,e.showArrow&&l.createElement(t.ArrowDown,{onClick:N,className:e.disable&&"disabled"})),!A&&l.createElement("div",{className:(u?"select-active":"select")+" "+(e.disable&&"disabled"),style:e.errorStyle?{border:"1px solid red"}:{}},l.createElement(Wt,{autoComplete:e.autoComplete,setFilter:function(e){p(e)},forceSet:f,setforceSet:E,setOptionIndex:_,keepNull:e.keepNull,selectedVal:s?e.t?e.isMultiSelectEmp?s+" "+S("BPA_SELECTED_TEXT"):e.t(e.optionKey?s[e.optionKey]:s):e.optionKey?s[e.optionKey]:s:null,filterVal:m,addProps:{length:y.length,currentIndex:g,selectOption:function(e){C(y[e])}},dropdownDisplay:function(e){const t=setTimeout(()=>d(e),500);return()=>{clearTimeout(t)}},handleClick:b,disable:e.disable,freeze:!!e.freeze,autoFocus:e.autoFocus,placeholder:e.placeholder,onBlur:null==e?void 0:e.onBlur,inputRef:e.ref}),l.createElement(t.ArrowDown,{onClick:N,className:"cp",disable:e.disable})),u?e.optionKey?l.createElement("div",{id:"jk-dropdown-unique",className:(A?"margin-top-10 display: table":"")+" options-card",style:c({},e.optionCardStyles),ref:h},y&&y.map((t,n)=>(console.log("option",t),l.createElement("div",{className:"cp profile-dropdown--item display: flex ",style:n===g?{opacity:1,backgroundColor:"rgba(238, 238, 238, var(--bg-opacity))"}:{},key:n,onClick:()=>C(t)},t.icon&&l.createElement("span",{className:"icon"}," ",t.icon," "),e.isPropertyAssess?l.createElement("div",null,e.t?e.t(t[e.optionKey]):t[e.optionKey]):l.createElement("span",null," ",e.t?e.t(t[e.optionKey]):t[e.optionKey]),l.createElement("div",null,"(",e.t("COMMON_MASTERS_DESIGNATION_"+t.designation),")")))),y&&0===y.length&&l.createElement("div",{className:"cp profile-dropdown--item display: flex ",key:"-1",onClick:()=>{}},l.createElement("span",null," ",e.t?e.t("CMN_NOOPTION"):"CMN_NOOPTION"))):l.createElement("div",{className:"options-card",style:c({},e.optionCardStyles,{overflow:"scroll",maxHeight:"350px"}),id:"jk-dropdown-unique",ref:h},e.option.filter(e=>(null==e?void 0:e.toUpperCase().indexOf(null==m?void 0:m.toUpperCase()))>-1).map((e,t)=>l.createElement("p",{key:t,style:t===g?{opacity:1,backgroundColor:"rgba(238, 238, 238, var(--bg-opacity))"}:{},onClick:()=>C(e)},e))):null)},zt=e=>l.createElement("h1",{className:"heading-m"},e.label),Vt=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),Gt=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(Vt,null)),Yt=e=>{var i,o;let{t:a,action:r,tenantId:u,closeModal:d,submitAction:s,applicationData:v,businessService:m,moduleCode:p}=e;const{data:f,isLoading:E}=Digit.Hooks.useEmployeeSearch(u,{roles:null==r||null===(i=r.assigneeRoles)||void 0===i||null===(o=i.map)||void 0===o?void 0:o.call(i,e=>({code:e})),isActive:!0},{enabled:!(null!=r&&r.isTerminateState)}),{isLoading:g,data:_}=Digit.Hooks.pt.useMDMS(u,m,"FINANCIAL_YEARLS",{},{details:{tenantId:Digit.ULBService.getStateId(),moduleDetails:[{moduleName:"egf-master",masterDetails:[{name:"FinancialYear",filter:"[?(@.module == 'PT')]"}]}]}}),[h,A]=n.useState({}),[S,N]=n.useState({}),[b,C]=n.useState([]),[y,D]=n.useState(null),[L,O]=n.useState(null),[T,I]=n.useState(null),[w,R]=n.useState(null),[P,x]=n.useState([]),[B,F]=n.useState(null),[M,U]=n.useState(!1);function k(e){O(e.target.files[0])}return n.useEffect(()=>{var e;_&&_["egf-master"]&&x(null===(e=_["egf-master"])||void 0===e?void 0:e.FinancialYear)},[_]),n.useEffect(()=>{var e;C(null==f||null===(e=f.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[f]),n.useEffect(()=>{!function(){try{R(null);const e=function(){if(L){const e=function(){if(L.size>=5242880)R(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=kt(function(){return Promise.resolve(Digit.UploadServices.Filestorage("PT",L,Digit.ULBService.getStateId())).then(function(e){var t,n,l,i;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?I(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):R(a("CS_FILE_UPLOAD_ERROR"))})},function(){R(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)}}()},[L]),n.useEffect(()=>{r&&A(null!=r&&r.showFinancialYearsModal?(e=>{let{t:n,action:i,financialYears:o,selectedFinancialYear:a,setSelectedFinancialYear:r}=e;return{label:{heading:"WF_"+i.action+"_APPLICATION",submit:"WF_PT.CREATE_"+i.action,cancel:"ES_PT_COMMON_CANCEL"},form:[{body:[{label:n("ES_PT_FINANCIAL_YEARS"),isMandatory:!0,type:"radio",populators:l.createElement(t.RadioButtons,{options:o,optionsKey:"name",onSelect:r,selectedOption:a})}]}]}})({t:a,action:r,financialYears:P,selectedFinancialYear:B,setSelectedFinancialYear:F}):(e=>{var n;let{t:i,action:o,approvers:a,selectedApprover:r,setSelectedApprover:u,selectFile:d,uploadedFile:s,setUploadedFile:c,assigneeLabel:v,businessService:m}=e;return{label:{heading:"WF_"+(null==o?void 0:o.action)+"_APPLICATION",submit:"WF_"+m+"_"+(null==o?void 0:o.action),cancel:"ES_PT_COMMON_CANCEL"},form:[{body:[{label:o.isTerminateState||"SENDBACKTOCITIZEN"===(null==o?void 0:o.action)?null:i(v||"WF_ROLE_"+(null===(n=o.assigneeRoles)||void 0===n?void 0:n[0])),type:"dropdown",populators:o.isTerminateState||"SENDBACKTOCITIZEN"===(null==o?void 0:o.action)?null:l.createElement(t.Dropdown,{option:a,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:u,selected:r})},{label:i("ES_PT_ACTION_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:i("ES_PT_ATTACH_FILE")+(o.docUploadRequired?" *":""),populators:l.createElement(t.UploadFile,{id:"workflow-doc",onUpload:d,onDelete:()=>{c(null)},showHint:!0,hintText:i("PT_ATTACH_RESTRICTIONS_SIZE"),message:s?"1 "+i("ES_PT_ACTION_FILEUPLOADED"):i("ES_PT_ACTION_NO_FILEUPLOADED")})}]}]}})({t:a,action:r,approvers:b,selectedApprover:y,setSelectedApprover:D,selectFile:k,uploadedFile:T,setUploadedFile:I,businessService:m}))},[r,b,P,B,T]),r&&h.form?l.createElement(t.Modal,{headerBarMain:l.createElement(zt,{label:a(h.label.heading)}),headerBarEnd:l.createElement(Gt,{onClick:d}),actionCancelLabel:a(h.label.cancel),actionCancelOnSubmit:d,actionSaveLabel:a(h.label.submit),actionSaveOnSubmit:()=>{},isDisabled:r.showFinancialYearsModal?!B:E||(null==r?void 0:r.docUploadRequired)&&!T,formId:"modal-action"},g?l.createElement(t.Loader,null):l.createElement(t.FormComposer,{config:h.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){if("INACTIVE_PROPERTY"==(null==r?void 0:r.action)){let t={action:"OPEN",comment:null==e?void 0:e.comments,businessService:"PT.CREATE",moduleName:"PT"};v.creationReason="STATUS",s({customFunctionToExecute:null==r?void 0:r.customFunctionToExecute,Property:c({},v,{workflow:t})})}else if(null!=r&&r.showFinancialYearsModal)s({customFunctionToExecute:null==r?void 0:r.customFunctionToExecute,Assessment:{financialYear:null==B?void 0:B.name,propertyId:null==v?void 0:v.propertyId,tenantId:u,source:null==v?void 0:v.source,channel:null==v?void 0:v.channel,assessmentDate:Date.now()}});else{let t={action:null==r?void 0:r.action,comment:null==e?void 0:e.comments,businessService:m,moduleName:p};t.assignes=null!=r&&r.isTerminateState||!y?[]:[y],T&&(t.documents=[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==L?void 0:L.name,fileStoreId:T}]),s({Property:c({},v,{workflow:t})})}},defaultValues:S,formId:"modal-action"})):l.createElement(t.Loader,null)},Kt=e=>l.createElement("h1",{className:"heading-m"},e.label),qt=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),Xt=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(qt,null)),Jt=e=>{var i,o;let{t:a,action:r,tenantId:u,closeModal:d,submitAction:s,applicationData:v,businessService:m}=e;console.log("ActionModalActions: ",r);const{data:p}=Digit.Hooks.useEmployeeSearch(u,{roles:null==r||null===(i=r.assigneeRoles)||void 0===i||null===(o=i.map)||void 0===o?void 0:o.call(i,e=>({code:e})),isActive:!0},{enabled:!(null!=r&&r.isTerminateState)}),{isLoading:f,data:E}=Digit.Hooks.pt.useMDMS(u,m,"FINANCIAL_YEARLS",{},{details:{tenantId:Digit.ULBService.getStateId(),moduleDetails:[{moduleName:"egf-master",masterDetails:[{name:"FinancialYear",filter:"[?(@.module == 'TL')]"}]}]}}),[g,_]=n.useState({}),[h,A]=n.useState({}),[S,N]=n.useState([]),[b,C]=n.useState({}),[y,D]=n.useState(null),[L,O]=n.useState(null),[T,I]=n.useState(null),[w,R]=n.useState([]),[P,x]=n.useState(null);n.useEffect(()=>{var e;E&&E["egf-master"]&&R(null===(e=E["egf-master"])||void 0===e?void 0:e.FinancialYear)},[E]);const{data:B}=Digit.Hooks.useCustomMDMS(u,"common-masters",[{name:"Department"}]);function F(e){D(e.target.files[0])}return n.useEffect(()=>{if(p&&B){var e;const t=B["common-masters"].Department;N(null==p||null===(e=p.Employees)||void 0===e?void 0:e.map(e=>{var n,l,i;const o=null==e||null===(n=e.assignments)||void 0===n||null===(l=n[0])||void 0===l?void 0:l.department,a=null==t?void 0:t.find(e=>(null==e?void 0:e.code)===o);return console.log("matchedDept===",a),{uuid:null==e?void 0:e.uuid,name:(null==e||null===(i=e.user)||void 0===i?void 0:i.name)+" - "+(null==a?void 0:a.name)}}))}},[p]),n.useEffect(()=>{!function(){try{I(null);const e=function(){if(y){const e=function(){if(y.size>=5242880)I(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=kt(function(){return Promise.resolve(Digit.UploadServices.Filestorage("PT",y,Digit.ULBService.getStateId())).then(function(e){var t,n,l,i;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?O(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):I(a("CS_FILE_UPLOAD_ERROR"))})},function(){I(a("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[y]),n.useEffect(()=>{r&&_((e=>{let{t:n,action:i,approvers:o,selectedApprover:a,setSelectedApprover:r,selectFile:u,uploadedFile:d,setUploadedFile:s,businessService:c}=e,v=!0;return"SENDBACKTOCITIZEN"!=(null==i?void 0:i.action)&&"APPROVE"!=(null==i?void 0:i.action)||(v=!1),i.isTerminateState&&(v=!1),{label:{heading:"WF_"+(null==i?void 0:i.action)+"_APPLICATION",submit:"WF_"+(null==c?void 0:c.toUpperCase())+"_"+(null==i?void 0:i.action),cancel:"WF_EMPLOYEE_NEWTL_CANCEL"},form:[{body:[{label:v?n("WF_ASSIGNEE_NAME_LABEL"):null,placeholder:v?n("WF_ASSIGNEE_NAME_PLACEHOLDER"):null,type:"dropdown",populators:v?l.createElement(t.Dropdown,{option:o,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:r,selected:a}):null},{label:n("WF_COMMON_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:n("TL_APPROVAL_CHECKLIST_BUTTON_UP_FILE"),populators:l.createElement(t.UploadFile,{id:"workflow-doc",onUpload:u,onDelete:()=>{s(null)},message:d?"1 "+n("ES_PT_ACTION_FILEUPLOADED"):n("CS_ACTION_NO_FILEUPLOADED")})}]}]}})({t:a,action:r,approvers:S,selectedApprover:b,setSelectedApprover:C,selectFile:F,uploadedFile:L,setUploadedFile:O,businessService:m}))},[r,S,w,P,L]),r&&g.form?l.createElement(t.Modal,{headerBarMain:l.createElement(Kt,{label:a(g.label.heading)}),headerBarEnd:l.createElement(Xt,{onClick:d}),actionCancelLabel:a(g.label.cancel),actionCancelOnSubmit:d,actionSaveLabel:a(g.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},f?l.createElement(t.Loader,null):l.createElement(t.FormComposer,{config:g.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){v=c({},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:L?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==y?void 0:y.name,fileStoreId:L}]:null}),s({Licenses:[v]})},defaultValues:h,formId:"modal-action"})):l.createElement(t.Loader,null)},Qt=e=>l.createElement("h1",{style:{marginLeft:"22px"},className:"heading-m BPAheading-m"},e.label),Zt=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),$t=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(Zt,null)),en=e=>{var i,o;let{t:a,action:r,tenantId:u,closeModal:d,submitAction:s,applicationData:v,businessService:m}=e;const{data:p,isLoading:f}=Digit.Hooks.useEmployeeSearch(u,{roles:null==r||null===(i=r.assigneeRoles)||void 0===i||null===(o=i.map)||void 0===o?void 0:o.call(i,e=>({code:e})),isActive:!0},{enabled:!(null!=r&&r.isTerminateState)});console.log(p,"DEKHO");const[E,g]=n.useState({}),[_,h]=n.useState({}),[A,S]=n.useState([]),[N,b]=n.useState({}),[C,y]=n.useState(null),[D,L]=n.useState(null),[O,T]=n.useState(null),I=!!Digit.Utils.browser.isMobile();function w(e){y(e.target.files[0])}return n.useEffect(()=>{var e;S(null==p||null===(e=p.Employees)||void 0===e?void 0:e.map(e=>{var t,n,l,i,o,r;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name,designation:(null==e||null===(n=e.assignments)||void 0===n||null===(l=n[0])||void 0===l?void 0:l.designation)||"N/A",displayName:(null==e||null===(i=e.user)||void 0===i?void 0:i.name)+" ("+(a(null==e||null===(o=e.assignments)||void 0===o||null===(r=o[0])||void 0===r?void 0:r.designation)||"N/A")+")"}}))},[p]),n.useEffect(()=>{!function(){try{T(null);const e=function(){if(C){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(C.size>=5242880)T(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=C&&C.type&&!e.test(null==C?void 0:C.type))T(a("NOT_SUPPORTED_FILE_TYPE"));else{const e=kt(function(){return Promise.resolve(Digit.UploadServices.Filestorage("OBPS",C,Digit.ULBService.getStateId()||(null==u?void 0:u.split(".")[0]))).then(function(e){var t,n,l,i;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?L(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):T(a("CS_FILE_UPLOAD_ERROR"))})},function(){T(a("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[C]),n.useEffect(()=>{r&&g((e=>{let{t:n,action:i,approvers:o,selectedApprover:a,setSelectedApprover:r,selectFile:u,uploadedFile:d,setUploadedFile:s,businessService:c,error:v}=e,m=!0;return"SENDBACKTOCITIZEN"==(null==i?void 0:i.action)&&(m=!1),i.isTerminateState&&(m=!1),{label:{heading:"WF_"+(null==i?void 0:i.action)+"_APPLICATION",submit:"WF_"+(null==c?void 0:c.toUpperCase())+"_"+(null==i?void 0:i.action),cancel:"WF_EMPLOYEE_BPAREG_CANCEL"},form:[{body:[{label:m?n("WF_ASSIGNEE_NAME_LABEL"):null,placeholder:m?n("WF_ASSIGNEE_NAME_PLACEHOLDER"):null,type:"dropdown",populators:m?l.createElement(t.Dropdown,{option:o,autoComplete:"off",optionKey:"displayName",id:"fieldInspector",select:r,selected:a}):null},{label:n("WF_COMMON_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:n("BPA_APPROVAL_CHECKLIST_BUTTON_UP_FILE"),populators:l.createElement(t.UploadFile,{id:"workflow-doc",onUpload:u,onDelete:()=>{s(null)},message:d?"1 "+n("ES_PT_ACTION_FILEUPLOADED"):n("CS_ACTION_NO_FILEUPLOADED"),accept:"image/*, .pdf, .png, .jpeg, .jpg",iserror:v})}]}]}})({t:a,action:r,approvers:A,selectedApprover:N,setSelectedApprover:b,selectFile:w,uploadedFile:D,setUploadedFile:L,businessService:m,error:O}))},[r,A,D,O]),r&&E.form?l.createElement(t.Modal,{headerBarMain:l.createElement(Qt,{label:a(E.label.heading)}),headerBarEnd:l.createElement($t,{onClick:d}),actionCancelLabel:a(E.label.cancel),actionCancelOnSubmit:d,actionSaveLabel:a(E.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action",isOBPSFlow:!0,popupStyles:I?{width:"720px"}:{},style:I?{height:"45px",width:"44%"}:{height:"45px",width:"107px",paddingLeft:"0px",paddingRight:"0px"},popupModuleMianStyles:I?{paddingLeft:"5px"}:{}},f?l.createElement(t.Loader,null):l.createElement(t.FormComposer,{config:E.form,cardStyle:{marginLeft:"0px",marginRight:"0px",marginTop:"-25px"},className:"BPAemployeeCard",noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){v=c({},v,{action:null==r?void 0:r.action,comment:null==e?void 0:e.comments,assignee:null!=N&&N.uuid?[null==N?void 0:N.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:_,formId:"modal-action"})):l.createElement(t.Loader,null)},tn=e=>l.createElement("h1",{style:{marginLeft:"22px"},className:"heading-m BPAheading-m"},e.label),nn=()=>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"})),ln=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(nn,null)),on=e=>{var i,o,a,u,d,s,v,m,p,f,E;let{t:g,action:_,tenantId:h,closeModal:A,submitAction:S,applicationDetails:N,applicationData:b,businessService:C,workflowDetails:y,blockReason:D}=e;console.log("applicationData_BPAACTIONMODAL",b);const L=[...new Set(null==y||null===(i=y.data)||void 0===i||null===(o=i.initialActionState)||void 0===o||null===(a=o.nextActions)||void 0===a||null===(u=a.find(e=>(null==e?void 0:e.action)===(null==_?void 0:_.action)))||void 0===u||null===(d=u.actions)||void 0===d?void 0:d.flatMap(e=>e.roles||[]))];console.log("workflowDetails_BPAACTIONMODAL",y,L,_),Digit.Hooks.obps.useObpsAPI(null!==(s=b)&&void 0!==s&&null!==(v=s.landInfo)&&void 0!==v&&null!==(m=v.address)&&void 0!==m&&m.city?null===(p=b)||void 0===p||null===(f=p.landInfo)||void 0===f||null===(E=f.address)||void 0===E?void 0:E.city:h,!1);const{data:O,isLoading:T}=Digit.Hooks.useEmployeeSearch(h,{roles:null==L?void 0:L.map(e=>({code:e})),isActive:!0},{enabled:!(null!=_&&_.isTerminateState)});console.log("approverData",O),r.useQueryClient();const[I,w]=n.useState({}),[R,P]=n.useState({}),[x,B]=n.useState([]),[F,M]=n.useState([]),[U,k]=n.useState({}),[W,H]=n.useState({}),[j,z]=n.useState(null),[V,G]=n.useState(null),[Y,K]=n.useState(null),[q,X]=n.useState(null),J=!!Digit.Utils.browser.isMobile();function Q(e){z(e.target.files[0])}n.useEffect(()=>{var e;B(null==O||null===(e=O.Employees)||void 0===e?void 0:e.map(e=>{var t,n,l;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name,designation:null==e||null===(n=e.assignments)||void 0===n||null===(l=n[0])||void 0===l?void 0:l.designation}}))},[O]),n.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=kt(function(){return Promise.resolve(Digit.UploadServices.Filestorage("OBPS",j,Digit.ULBService.getStateId()||(null==h?void 0:h.split(".")[0]))).then(function(e){var t,n,l,i;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?G(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):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,n)=>{t.push({documentType:(e.documentType+"_"+e.documentType.split("_")[1]).replaceAll("_","."),fileStoreId:e.fileStoreId,fileStore:e.fileStoreId,fileName:"",dropDownValues:{value:(e.documentType+"_"+e.documentType.split("_")[1]).replaceAll("_",".")}})}),t},$=e=>{let t=[];var n;for(n=0;n<(null==e?void 0:e.questionLength);n++){var l;t.push({remarks:e["Remarks_"+n],question:null==e?void 0:e.questionList[n].question,value:null==e||null===(l=e["question_"+n])||void 0===l?void 0:l.code})}return t},ee=e=>{var t,n;let l=[],i=[];var o,a;return(null==e||null===(t=e.additionalDetails)||void 0===t||null===(n=t.fieldinspection_pending)||void 0===n?void 0:n.length)>0&&(i=null==e||null===(o=e.additionalDetails)||void 0===o?void 0:o.fieldinspection_pending),i=i.filter(e=>{if(!e.date)return!1;const t=new Date;return new Date(e.date)<=t}),"FIELDINSPECTION_INPROGRESS"==e.status?(l=JSON.parse(sessionStorage.getItem("INSPECTION_DATA")),(null===(a=l)||void 0===a?void 0:a.length)>0&&l.map((e,t)=>{i.push({docs:Z(e.Documents),date:e.InspectionDate,questions:$(e),time:null==e?void 0:e.InspectionTime})}),console.log("FIELDINSPECTION_INPROGRESS",i),i=i.filter(e=>e.date&&e.time),console.log("inspectionObinspectionOb",i)):sessionStorage.removeItem("INSPECTION_DATA"),[...i]},te=()=>{var e;const t=Digit.SessionStorage.get("OBPS_APPROVAL_CHECKS"),n=Digit.SessionStorage.get("OBPS_NEW_APPROVALS");let l=null==t?void 0:t.reduce((e,t)=>null!=t&&t.checked?e.push(null==t?void 0:t.label)&&e:e,[]);return l=null===(e=l)||void 0===e?void 0:e.concat(null!==n?n.filter(e=>""!==e.label).map(e=>null==e?void 0:e.label):[]),l};return n.useEffect(()=>{M(null==D?void 0:D.map(e=>({code:null==e?void 0:e.code,name:null==e?void 0:e.value}))),_&&w((e=>{var n,i,o;let{t:a,action:r,approvers:u,selectedApprover:d,setSelectedApprover:s,selectedBlockReason:c,setBlockReason:v,selectFile:m,uploadedFile:p,setUploadedFile:f,assigneeLabel:E,businessService:g,error:_,blockReasonFiltered:h}=e,A=!1;return"REVOCATE"!=(null==r?void 0:r.action)&&"REJECT"!=(null==r?void 0:r.action)&&"SKIP_PAYMENT"!=r.action&&"SEND_BACK_TO_CITIZEN"!=(null==r?void 0:r.action)&&"APPROVE"!=(null==r?void 0:r.action)||(A=!0),{label:{heading:"WF_"+(null==r?void 0:r.action)+"_APPLICATION",submit:"WF_"+g+"_"+(null==r?void 0:r.action),cancel:"BPA_CITIZEN_CANCEL_BUTTON"},form:[{body:[{label:r.isTerminateState||A||"BLOCK"==(null==r?void 0:r.action)||"VERIFY"==(null==r?void 0:r.action)||"FORWARD"==(null==r?void 0:r.action)&&"FIELDINSPECTION_PENDING"==(null==r||null===(n=r.state)||void 0===n?void 0:n.state)?null:a(E||"WF_ROLE_"+(null===(i=r.assigneeRoles)||void 0===i?void 0:i[0])),type:"dropdown",populators:r.isTerminateState||A||"BLOCK"==(null==r?void 0:r.action)||"VERIFY"==(null==r?void 0:r.action)||"FORWARD"==(null==r?void 0:r.action)&&"FIELDINSPECTION_PENDING"==(null==r||null===(o=r.state)||void 0===o?void 0:o.state)?null:l.createElement(jt,{option:u,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:s,selected:d,t:a})},{label:"BLOCK"==(null==r?void 0:r.action)?a("BLOCK_REASON"):null,type:"dropdown",populators:"BLOCK"==(null==r?void 0:r.action)?l.createElement(t.Dropdown,{option:h,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:v,selected:c,isMandatory:!0}):null},{label:a("WF_COMMON_COMMENTS"),type:"textarea",isMandatory:!0,populators:{name:"comments"}},{label:""+a("WF_APPROVAL_UPLOAD_HEAD"),populators:l.createElement(t.UploadFile,{id:"workflow-doc",onUpload:m,onDelete:()=>{f(null)},message:p?"1 "+a("ES_PT_ACTION_FILEUPLOADED"):a("CS_ACTION_NO_FILEUPLOADED"),accept:"image/*, .pdf, .png, .jpeg, .jpg",iserror:_})}]}]}})({t:g,action:_,approvers:x,selectedApprover:U,setSelectedApprover:k,selectedBlockReason:W,setBlockReason:H,selectFile:Q,uploadedFile:V,setUploadedFile:G,businessService:C,assigneeLabel:"WF_ASSIGNEE_NAME_LABEL_BPA",error:Y,blockReasonFiltered:F}))},[_,x,q,V,Y]),_&&I.form?l.createElement(t.Modal,{headerBarMain:l.createElement(tn,{label:g(I.label.heading)}),headerBarEnd:l.createElement(ln,{onClick:A}),actionCancelLabel:g(I.label.cancel),actionCancelOnSubmit:A,actionSaveLabel:g(I.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action",isOBPSFlow:!0,popupStyles:J?{width:"720px"}:{},style:J?{minHeight:"45px",height:"auto",width:"44%"}:{minHeight:"45px",height:"auto",width:"107px",paddingLeft:"0px",paddingRight:"0px"},popupModuleMianStyles:J?{paddingLeft:"5px"}:{}},T?l.createElement(t.Loader,null):l.createElement(t.FormComposer,{config:I.form,cardStyle:{marginLeft:"0px",marginRight:"0px",marginTop:"-25px"},className:"BPAemployeeCard",noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){try{var t,n,l,i,o,a,r,u,d,s,v,m,p,f,E,h,C,D,L,O,T,I,w,R,P,x,B,F,M,k,H,z,G,Y,K,q,X,J,Q,Z,$,ne;if(b=c({},b,{documents:null===(t=b)||void 0===t?void 0:t.documents,additionalDetails:c({},null===(n=b)||void 0===n?void 0:n.additionalDetails,{fieldinspection_pending:ee(b),pendingapproval:te(),blockingReason:null==W?void 0:W.name}),workflow:{action:null==_?void 0:_.action,comment:(null==e||null===(l=e.comments)||void 0===l?void 0:l.length)>0?null!=W&&W.name?(null==W?void 0:W.name)+" - "+(null==e?void 0:e.comments):null==e?void 0:e.comments:null,comments:(null==e||null===(i=e.comments)||void 0===i?void 0:i.length)>0?null!=W&&W.name?(null==W?void 0:W.name)+" - "+(null==e?void 0:e.comments):null==e?void 0:e.comments:null,assignee:"FIELDINSPECTION_INPROGRESS"===(null==y||null===(o=y.data)||void 0===o||null===(a=o.processInstances)||void 0===a||null===(r=a[0])||void 0===r||null===(u=r.state)||void 0===u?void 0:u.applicationStatus)?[null==y||null===(d=y.data)||void 0===d||null===(s=d.processInstances)||void 0===s||null===(v=s[0])||void 0===v||null===(m=v.assigner)||void 0===m?void 0:m.uuid]:null!=U&&U.uuid?[null==U?void 0:U.uuid]:null,assignes:"FIELDINSPECTION_INPROGRESS"===(null==y||null===(p=y.data)||void 0===p||null===(f=p.processInstances)||void 0===f||null===(E=f[0])||void 0===E||null===(h=E.state)||void 0===h?void 0:h.applicationStatus)?[null==y||null===(C=y.data)||void 0===C||null===(D=C.processInstances)||void 0===D||null===(L=D[0])||void 0===L||null===(O=L.assigner)||void 0===O?void 0:O.uuid]:null!=U&&U.uuid?[null==U?void 0:U.uuid]:null,varificationDocuments:V?[{documentType:(null==_?void 0:_.action)+" DOC",fileName:null==j?void 0:j.name,fileStoreId:V}]:null},action:null==_?void 0:_.action,riskType:null===(T=b)||void 0===T||null===(I=T.additionalDetails)||void 0===I?void 0:I.riskType,comment:null==e?void 0:e.comments,assignee:"FIELDINSPECTION_INPROGRESS"===(null==y||null===(w=y.data)||void 0===w||null===(R=w.processInstances)||void 0===R||null===(P=R[0])||void 0===P||null===(x=P.state)||void 0===x?void 0:x.applicationStatus)?[null==y||null===(B=y.data)||void 0===B||null===(F=B.processInstances)||void 0===F||null===(M=F[0])||void 0===M||null===(k=M.assigner)||void 0===k?void 0:k.uuid]:null!=U&&U.uuid?[null==U?void 0:U.uuid]:null,wfDocuments:V?[{documentType:(null==_?void 0:_.action)+" DOC",fileName:null==j?void 0:j.name,fileStoreId:V}]:null}),parseInt(sessionStorage.getItem("lessAdjusment"))>parseInt(sessionStorage.getItem("development"))+parseInt(sessionStorage.getItem("otherCharges"))+parseInt(null===(H=b)||void 0===H||null===(z=H.additionalDetails)||void 0===z||null===(G=z.selfCertificationCharges)||void 0===G?void 0:G.BPA_MALBA_CHARGES)+parseInt(null===(Y=b)||void 0===Y||null===(K=Y.additionalDetails)||void 0===K||null===(q=K.selfCertificationCharges)||void 0===q?void 0:q.BPA_LABOUR_CESS)+parseInt(null===(X=b)||void 0===X||null===(J=X.additionalDetails)||void 0===J||null===(Q=J.selfCertificationCharges)||void 0===Q?void 0:Q.BPA_WATER_CHARGES)+parseInt(null===(Z=b)||void 0===Z||null===($=Z.additionalDetails)||void 0===$||null===(ne=$.selfCertificationCharges)||void 0===ne?void 0:ne.BPA_GAUSHALA_CHARGES_CESS))A(),alert(g("Enterd Less Adjustment amount is invalid"));else{var le,ie;const e=null==N||null===(le=N.nocData)||void 0===le?void 0:le.map(e=>{const t=Digit.SessionStorage.get(null==e?void 0:e.nocType)||[];return{Noc:c({},e,{documents:[...null!=e&&e.documents?null==e?void 0:e.documents:[],...t||[]]})}}),t={};let n=!0,l=!0;null==t||null===(ie=t.Noc)||void 0===ie||ie.map(e=>{var t,i,o,a,r;"APPROVED"!==(null==e||null===(t=e.applicationStatus)||void 0===t?void 0:t.toUpperCase())&&"AUTO_APPROVED"!==(null==e||null===(i=e.applicationStatus)||void 0===i?void 0:i.toUpperCase())&&"REJECTED"!==(null==e||null===(o=e.applicationStatus)||void 0===o?void 0:o.toUpperCase())&&"AUTO_REJECTED"!==(null==e||null===(a=e.applicationStatus)||void 0===a?void 0:a.toUpperCase())&&"VOIDED"!==(null==e||null===(r=e.applicationStatus)||void 0===r?void 0:r.toUpperCase())||1!=n&&1!=l||("AIRPORT_AUTHORITY"===(null==e?void 0:e.nocType)?n=!1:"FIRE_NOC"===(null==e?void 0:e.nocType)&&(l=!1))});let i=[];if(e&&e.map(e=>{var t,o,a,r,u,d,s,c,v,m,p,f;("APPROVED"!=(null==e||null===(t=e.Noc)||void 0===t||null===(o=t.applicationStatus)||void 0===o?void 0:o.toUpperCase())&&"AUTO_APPROVED"!=(null==e||null===(a=e.Noc)||void 0===a||null===(r=a.applicationStatus)||void 0===r?void 0:r.toUpperCase())&&"REJECTED"!=(null==e||null===(u=e.Noc)||void 0===u||null===(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===(m=v.applicationStatus)||void 0===m?void 0:m.toUpperCase())&&"AIRPORT_AUTHORITY"===(null==e||null===(p=e.Noc)||void 0===p?void 0:p.nocType)&&n||"FIRE_NOC"===(null==e||null===(f=e.Noc)||void 0===f?void 0:f.nocType)&&l)&&i.push(e)}),"FIELDINSPECTION_INPROGRESS"==b.status){let e=JSON.parse(sessionStorage.getItem("INSPECTION_DATA"));(null==e?void 0:e.length)>0&&e.map((e,t)=>{e.InspectionDate&&e.InspectionTime?S({BPA:b},(null==i?void 0:i.length)>0&&i,{isStakeholder:!1,bpa:!0}):(A(),alert(g("Please fill Inspection Date and Time"))),console.log(" ob.InspectionDate && ob.InspectionTime",e.InspectionDate,e.InspectionTime)})}else S({BPA:b},(null==i?void 0:i.length)>0&&i,{isStakeholder:!1,bpa:!0})}return Promise.resolve()}catch(e){return Promise.reject(e)}},defaultValues:R,formId:"modal-action"})):l.createElement(t.Loader,null)},an=e=>l.createElement("h1",{style:{marginLeft:"22px"},className:"heading-m BPAheading-m"},e.label),rn=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),un=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(rn,null)),dn=e=>{var o,a,u,d,s,v,m;let{t:p,action:f,tenantId:E,closeModal:g,submitAction:_,applicationData:h,businessService:A}=e;const{data:S,isLoading:N}=Digit.Hooks.useEmployeeSearch(E,{roles:null===(o=workflowDetails)||void 0===o||null===(a=o.data)||void 0===a||null===(u=a.initialActionState)||void 0===u||null===(d=u.nextActions)||void 0===d||null===(s=d.filter(e=>(null==e?void 0:e.action)==(null==f?void 0:f.action)))||void 0===s||null===(v=s[0])||void 0===v||null===(m=v.assigneeRoles)||void 0===m?void 0:m.map(e=>({code:e})),isActive:!0},{enabled:!(null!=f&&f.isTerminateState)}),[b,C]=(r.useQueryClient(),n.useState({})),[y,D]=n.useState({}),[L,O]=n.useState([]),[T,I]=n.useState({}),[w,R]=n.useState(null),[P,x]=n.useState(null),[B,F]=n.useState(null),M=!!Digit.Utils.browser.isMobile();function U(e){R(e.target.files[0])}return i.useHistory(),n.useEffect(()=>{var e;O(null==S||null===(e=S.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}}))},[S]),n.useEffect(()=>{!function(){try{F(null);const e=function(){if(w){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(w.size>=5242880)F(p("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=w&&w.type&&!e.test(null==w?void 0:w.type))F(p("NOT_SUPPORTED_FILE_TYPE"));else{const e=kt(function(){return Promise.resolve(Digit.UploadServices.Filestorage("NOC",w,Digit.ULBService.getStateId()||(null==E?void 0:E.split(".")[0]))).then(function(e){var t,n,l,i;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?x(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):F(p("CS_FILE_UPLOAD_ERROR"))})},function(){F(p("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)}}()},[w]),n.useEffect(()=>{f&&C((e=>{var n;let{t:i,action:o,approvers:a,selectedApprover:r,setSelectedApprover:u,selectFile:d,uploadedFile:s,setUploadedFile:c,assigneeLabel:v,businessService:m,error:p}=e,f=!1;"REVOCATE"!=(null==o?void 0:o.action)&&"REJECT"!=(null==o?void 0:o.action)||(f=!0);let E=!1;return"APPROVE"!=(null==o?void 0:o.action)&&"REJECT"!=(null==o?void 0:o.action)&&"AUTO_APPROVE"!=o.action&&"AUTO_REJECT"!=o.action||(E=!0),{label:{heading:"WF_"+(null==o?void 0:o.action)+"_APPLICATION",submit:"WF_"+m+"_"+(null==o?void 0:o.action),cancel:"CORE_LOGOUTPOPUP_CANCEL"},form:[{body:[{label:o.isTerminateState||E?null:i(v||"WF_ROLE_"+(null===(n=o.assigneeRoles)||void 0===n?void 0:n[0])),type:"dropdown",populators:o.isTerminateState||E?null:l.createElement(t.Dropdown,{option:a,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:u,selected:r})},{label:i("WF_COMMON_COMMENTS"),type:"textarea",isMandatory:f,populators:{name:"comments"}},{label:""+i("WF_APPROVAL_UPLOAD_HEAD"),populators:l.createElement(t.UploadFile,{id:"workflow-doc",onUpload:d,onDelete:()=>{c(null)},showHint:!0,message:s?"1 "+i("ES_PT_ACTION_FILEUPLOADED"):i("CS_ACTION_NO_FILEUPLOADED"),accept:"image/*, .pdf, .png, .jpeg, .jpg",iserror:p})}]}]}})({t:p,action:f,approvers:L,selectedApprover:T,setSelectedApprover:I,selectFile:U,uploadedFile:P,setUploadedFile:x,businessService:A,assigneeLabel:"WF_ASSIGNEE_NAME_LABEL",error:B}))},[f,L,P,B]),f&&b.form?l.createElement(t.Modal,{headerBarMain:l.createElement(an,{label:p(b.label.heading)}),headerBarEnd:l.createElement(un,{onClick:g}),actionCancelLabel:p(b.label.cancel),actionCancelOnSubmit:g,actionSaveLabel:p(b.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action",isOBPSFlow:!0,popupStyles:M?{width:"720px"}:{},style:M?{height:"45px",width:"44%"}:{height:"45px",width:"107px",paddingLeft:"0px",paddingRight:"0px"},popupModuleMianStyles:M?{paddingLeft:"5px"}:{}},N?l.createElement(t.Loader,null):l.createElement(t.FormComposer,{config:b.form,cardStyle:{marginLeft:"0px",marginRight:"0px",marginTop:"-25px"},className:"BPAemployeeCard",noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){var t,n,l;let i=JSON.parse(sessionStorage.getItem("NewNOCDocs")),o=(null===(t=h)||void 0===t||null===(n=t.documents)||void 0===n?void 0:n.length)>0?[...null===(l=h)||void 0===l?void 0:l.documents]:[];i.map((e,t)=>{o.push(e)}),h=c({},h,{workflow:{action:null==f?void 0:f.action,comment:null!=e&&e.comments?null==e?void 0:e.comments:null,assignee:null!=T&&T.uuid?[null==T?void 0:T.uuid]:null,documents:P?[{documentType:(null==f?void 0:f.action)+" DOC",fileName:null==w?void 0:w.name,fileStoreId:P}]:null},documents:o}),_({Noc:h},!1,{isNoc:!0})},defaultValues:y,formId:"modal-action"})):l.createElement(t.Loader,null)},sn=e=>l.createElement("h1",{className:"heading-m"},e.label),cn=()=>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(cn,null)),mn=function(e,t){void 0===t&&(t="dayend");try{const n=e.match(/(\d{4})-(\d{1,2})-(\d{1,2})/),l=new Date(Date.UTC(n[1],n[2]-1,n[3]));return l.setMinutes(l.getMinutes()+l.getTimezoneOffset()),"dayend"===t&&(l.setHours(l.getHours()+24),l.setSeconds(l.getSeconds()-1)),l.getTime()}catch(t){return e}},pn=e=>{var i,o;let{t:a,action:r,tenantId:u,closeModal:d,submitAction:s,applicationData:v,businessService:m}=e;const{data:p,isLoading:f}=Digit.Hooks.useEmployeeSearch(u,{roles:null==r||null===(i=r.assigneeRoles)||void 0===i||null===(o=i.map)||void 0===o?void 0:o.call(i,e=>({code:e})),isActive:!0},{enabled:!(null!=r&&r.isTerminateState)}),[E,g]=n.useState({}),[_,h]=n.useState({}),[A,S]=n.useState([]),[N,b]=n.useState({}),[C,y]=n.useState(null),[D,L]=n.useState(null),[O,T]=n.useState(null),I=window.Digit.Utils.browser.isMobile(),w=window.location.href.includes("/employee");function R(e){y(e.target.files[0])}return n.useEffect(()=>{var e;S(null==p||null===(e=p.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[p]),n.useEffect(()=>{!function(){try{T(null);const e=function(){if(C){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(C.size>=5242880)T(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=C&&C.type&&!e.test(null==C?void 0:C.type))T(a("NOT_SUPPORTED_FILE_TYPE"));else{const e=kt(function(){return Promise.resolve(Digit.UploadServices.Filestorage("WS",C,Digit.ULBService.getCurrentTenantId())).then(function(e){var t,n,l,i;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?L(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):T(a("CS_FILE_UPLOAD_ERROR"))})},function(e){console.error("Modal -> err ",e),T(a("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[C]),n.useEffect(()=>{var e,n,i,o;"DisconnectWSConnection"==(null===(e=v)||void 0===e||null===(n=e.processInstance)||void 0===n?void 0:n.businessService)||"DisconnectSWConnection"==(null===(i=v)||void 0===i||null===(o=i.processInstance)||void 0===o?void 0:o.businessService)?r&&g((e=>{var n;let{t:i,action:o,approvers:a,selectedApprover:r,setSelectedApprover:u,selectFile:d,uploadedFile:s,setUploadedFile:v,businessService:m,error:p}=e,f=!0,E=!1;return(null!=o&&null!==(n=o.action)&&void 0!==n&&n.includes("SEND_BACK")||"APPROVE_FOR_DISCONNECTION"==(null==o?void 0:o.action)||"RESUBMIT_APPLICATION"==(null==o?void 0:o.action))&&(f=!1),o.isTerminateState&&(f=!1),"EXECUTE_DISCONNECTION"!=(null==o?void 0:o.action)&&"DISCONNECTION_EXECUTED"!=(null==o?void 0:o.action)||(E=!0),{label:{heading:"WF_"+(null==o?void 0:o.action)+"_APPLICATION",submit:"WF_"+(null==m?void 0:m.toUpperCase())+"_"+(null==o?void 0:o.action),cancel:"CS_COMMON_CANCEL"},form:[{body:[{label:f?i("WF_ASSIGNEE_NAME_LABEL"):null,placeholder:f?i("WF_ASSIGNEE_NAME_PLACEHOLDER"):null,type:"dropdown",populators:f?l.createElement(t.Dropdown,{option:a,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:u,selected:r}):null},E&&{label:i("ES_FSM_ACTION_SERVICE_DATE"),isMandatory:!!E,type:"custom",populators:E?{name:"date",validation:{required:!0},defaultValue:Digit.Utils.date.getDate(),component:(e,n)=>l.createElement(t.DatePicker,c({onChange:e.onChange,date:e.value},n))}:null},{label:i("WF_COMMON_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:i("WS_APPROVAL_CHECKLIST_BUTTON_UP_FILE"),populators:l.createElement(t.UploadFile,{id:"workflow-doc",accept:".jpg,.pdf,.png,.jpeg",onUpload:d,onDelete:()=>{v(null)},message:s?"1 "+i("ES_PT_ACTION_FILEUPLOADED"):i("CS_ACTION_NO_FILEUPLOADED"),error:p,iserror:p,showHintBelow:!0,hintText:"WS_HINT_TEXT_LABEL"})}]}]}})({t:a,action:r,approvers:A,selectedApprover:N,setSelectedApprover:b,selectFile:R,uploadedFile:D,setUploadedFile:L,businessService:m,error:O})):r&&g((e=>{var n;let{t:i,action:o,approvers:a,selectedApprover:r,setSelectedApprover:u,selectFile:d,uploadedFile:s,setUploadedFile:c,businessService:v,error:m}=e,p=!0;return(null!=o&&null!==(n=o.action)&&void 0!==n&&n.includes("SEND_BACK")||"APPROVE_FOR_CONNECTION"==(null==o?void 0:o.action))&&(p=!1),o.isTerminateState&&(p=!1),{label:{heading:"WF_"+(null==o?void 0:o.action)+"_APPLICATION",submit:"WF_"+(null==v?void 0:v.toUpperCase())+"_"+(null==o?void 0:o.action),cancel:"CS_COMMON_CANCEL"},form:[{body:[{label:p?i("WF_ASSIGNEE_NAME_LABEL"):null,placeholder:p?i("WF_ASSIGNEE_NAME_PLACEHOLDER"):null,type:"dropdown",populators:p?l.createElement(t.Dropdown,{option:a,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:u,selected:r}):null},{label:i("WF_COMMON_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:i("WS_APPROVAL_CHECKLIST_BUTTON_UP_FILE"),populators:l.createElement(t.UploadFile,{id:"workflow-doc",accept:".jpg,.pdf,.png,.jpeg",onUpload:d,onDelete:()=>{c(null)},message:s?"1 "+i("ES_PT_ACTION_FILEUPLOADED"):i("CS_ACTION_NO_FILEUPLOADED"),error:m,iserror:m,showHintBelow:!0,hintText:"WS_HINT_TEXT_LABEL"})}]}]}})({t:a,action:r,approvers:A,selectedApprover:N,setSelectedApprover:b,selectFile:R,uploadedFile:D,setUploadedFile:L,businessService:m,error:O}))},[r,A,D,O]),r&&E.form?l.createElement(t.Modal,{headerBarMain:l.createElement(sn,{label:a(E.label.heading)}),headerBarEnd:l.createElement(vn,{onClick:d}),actionCancelLabel:a(E.label.cancel),actionCancelOnSubmit:d,actionSaveLabel:a(E.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action",style:I&&w?{width:"100%",height:"auto"}:{}},f?l.createElement(t.Loader,null):l.createElement(t.FormComposer,{config:E.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){var t,n,l,i,o,a,d,m,p,f;if(null!==(t=v)&&void 0!==t&&t.isBillAmend){var E,g,_,h,A,S,b,y,L;const t=c({},null===(E=v)||void 0===E||null===(g=E.billAmendmentDetails)||void 0===g?void 0:g.additionalDetails,{comments:null!=e&&e.comments?e.comments:null}),n=c({},null===(_=v)||void 0===_?void 0:_.billAmendmentDetails,{workflow:{businessId:null===(h=v)||void 0===h||null===(A=h.billAmendmentDetails)||void 0===A?void 0:A.amendmentId,action:null==r?void 0:r.action,tenantId:u,businessService:null!==(S=v)&&void 0!==S&&null!==(b=S.applicationType)&&void 0!==b&&b.includes("WATER")?"WS.AMENDMENT":"SW.AMENDMENT",moduleName:null!==(y=v)&&void 0!==y&&null!==(L=y.applicationType)&&void 0!==L&&L.includes("WATER")?"WS":"SW",assignes:null!=N&&N.uuid?[{uuid:null==N?void 0:N.uuid}]:[],comment:(null==e?void 0:e.comments)||"",documents:D?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==C?void 0:C.name,fileStoreId:D}]:[]},additionalDetails:t,comment:(null==e?void 0:e.comments)||"",wfDocuments:D?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==C?void 0:C.name,fileStoreId:D}]:null,processInstance:{action:null==r?void 0:r.action,assignes:null!=N&&N.uuid?[{uuid:null==N?void 0:N.uuid}]:[],comment:(null==e?void 0:e.comments)||"",documents:D?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==C?void 0:C.name,fileStoreId:D}]:[]}});s({AmendmentUpdate:n})}else{if(v=c({},v,{action:null==r?void 0:r.action,comment:(null==e?void 0:e.comments)||"",assignee:null!=N&&N.uuid?[null==N?void 0:N.uuid]:[],assignes:null!=N&&N.uuid?[{uuid:null==N?void 0:N.uuid}]:[],wfDocuments:D?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==C?void 0:C.name,fileStoreId:D}]:null,processInstance:c({},null===(n=v)||void 0===n?void 0:n.processInstance,{action:null==r?void 0:r.action,assignes:null!=N&&N.uuid?[{uuid:null==N?void 0:N.uuid}]:[],comment:(null==e?void 0:e.comments)||"",documents:D?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==C?void 0:C.name,fileStoreId:D}]:[]})}),null!=e&&e.date&&null!==(l=v)&&void 0!==l&&null!==(i=l.applicationType)&&void 0!==i&&i.includes("DISCONNECT")){const t=ht(null==e?void 0:e.date);v.disconnectionExecutionDate=mn(t)}else if(null!=e&&e.date){const t=ht(null==e?void 0:e.date);v.connectionExecutionDate=mn(t)}var O;if("DisconnectWSConnection"==(null===(o=v)||void 0===o||null===(a=o.processInstance)||void 0===a?void 0:a.businessService)||"DisconnectSWConnection"==(null===(d=v)||void 0===d||null===(m=d.processInstance)||void 0===m?void 0:m.businessService)||window.location.href.includes("disconnection"))"WATER"==(null===(O=v)||void 0===O?void 0:O.serviceType)?s({WaterConnection:v,disconnectRequest:!0}):s({SewerageConnection:v,disconnectRequest:!0});else if("SEWERAGE_RECONNECTION"==(null===(p=v)||void 0===p?void 0:p.applicationType))s({SewerageConnection:v,disconnectRequest:!1,reconnectRequest:!0});else if("WATER_RECONNECTION"==(null===(f=v)||void 0===f?void 0:f.applicationType))s({WaterConnection:v,disconnectRequest:!1,reconnectRequest:!0});else{var T,I,w,R,P,x,B,F,M,U,k,W,H;const e=sessionStorage.getItem("Digit.ADHOC_ADD_REBATE_DATA"),t=e?JSON.parse(e):"";null!=t&&null!==(T=t.value)&&void 0!==T&&T.adhocPenalty&&(v.additionalDetails.adhocPenalty=parseInt(null==t||null===(I=t.value)||void 0===I?void 0:I.adhocPenalty)||""),null!=t&&null!==(w=t.value)&&void 0!==w&&w.adhocPenaltyComment&&(v.additionalDetails.adhocPenaltyComment=(null==t||null===(R=t.value)||void 0===R?void 0:R.adhocPenaltyComment)||""),null!=t&&null!==(P=t.value)&&void 0!==P&&P.adhocPenaltyReason&&(v.additionalDetails.adhocPenaltyReason=(null==t||null===(x=t.value)||void 0===x?void 0:x.adhocPenaltyReason)||""),null!=t&&null!==(B=t.value)&&void 0!==B&&B.adhocRebate&&(v.additionalDetails.adhocRebate=parseInt(null==t||null===(F=t.value)||void 0===F?void 0:F.adhocRebate)||""),null!=t&&null!==(M=t.value)&&void 0!==M&&M.adhocRebateComment&&(v.additionalDetails.adhocRebateComment=(null==t||null===(U=t.value)||void 0===U?void 0:U.adhocRebateComment)||""),null!=t&&null!==(k=t.value)&&void 0!==k&&k.adhocRebateReason&&(v.additionalDetails.adhocRebateReason=(null==t||null===(W=t.value)||void 0===W?void 0:W.adhocRebateReason)||""),"WATER"==(null===(H=v)||void 0===H?void 0:H.serviceType)?s({WaterConnection:v,disconnectRequest:!1,reconnectRequest:!1}):s({SewerageConnection:v,disconnectRequest:!1,reconnectRequest:!1})}}},defaultValues:_,formId:"modal-action"})):l.createElement(t.Loader,null)},fn=e=>l.createElement("h1",{className:"heading-m"},e.label),En=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),gn=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(En,null)),_n=e=>{var i,o;let{t:a,action:r,tenantId:u,closeModal:d,submitAction:s,applicationData:v,businessService:m,moduleCode:p}=e;console.log("applicationData",v);const{data:f}=Digit.Hooks.useEmployeeSearch(u,{roles:null==r||null===(i=r.assigneeRoles)||void 0===i||null===(o=i.map)||void 0===o?void 0:o.call(i,e=>({code:e})),isActive:!0},{enabled:!(null!=r&&r.isTerminateState)}),[E,g]=n.useState({}),[_,h]=n.useState({}),[A,S]=n.useState([]),[N,b]=n.useState(null),[C,y]=n.useState(null),[D,L]=n.useState(null),[O,T]=n.useState(null),[I,w]=n.useState(!1);function R(e){y(e.target.files[0])}return n.useEffect(()=>{var e;S(null==f||null===(e=f.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[f]),n.useEffect(()=>{!function(){try{T(null);const e=function(){if(C){const e=function(){if(C.size>=5242880)T(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=kt(function(){return Promise.resolve(Digit.UploadServices.Filestorage("PTR",C,Digit.ULBService.getStateId())).then(function(e){var t,n,l,i;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?L(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):T(a("CS_FILE_UPLOAD_ERROR"))})},function(){T(a("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[C]),n.useEffect(()=>{r&&g((e=>{let{t:t,action:n,businessService:l}=e;return{label:{heading:"WF_"+(null==n?void 0:n.action)+"_APPLICATION",submit:"WF_"+l+"_"+(null==n?void 0:n.action),cancel:"ES_PTR_COMMON_CANCEL"},form:[{body:[{label:t("ES_PTR_ACTION_COMMENTS"),type:"textarea",populators:{name:"comments"}}]}]}})({t:a,action:r,approvers:A,selectedApprover:N,setSelectedApprover:b,selectFile:R,uploadedFile:D,setUploadedFile:L,businessService:m}))},[r,A,D]),r&&E.form?l.createElement(t.Modal,{headerBarMain:l.createElement(fn,{label:a(E.label.heading)}),headerBarEnd:l.createElement(gn,{onClick:d}),actionCancelLabel:a(E.label.cancel),actionCancelOnSubmit:d,actionSaveLabel:a(E.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},l.createElement(t.FormComposer,{config:E.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){if("COMMON_APPROVED"==(null==r?void 0:r.action)){let t={action:"OPEN",comments:null==e?void 0:e.comments,businessService:"ptr",moduleName:"pet-services"};v.creationReason="CREATE",s({PetRegistrationApplications:[c({},v,{workflow:t})]})}let t={action:null==r?void 0:r.action,comments:null==e?void 0:e.comments,businessService:m,moduleName:p};t.assignes=null!=r&&r.isTerminateState||!N?[]:[N],D&&(t.documents=[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==C?void 0:C.name,fileStoreId:D}]),s({PetRegistrationApplications:[c({},v,{workflow:t})]})},defaultValues:_,formId:"modal-action"})):l.createElement(t.Loader,null)},hn=e=>l.createElement("h1",{className:"heading-m"},e.label),An=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),Sn=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(An,null)),Nn=e=>{var i,o,a;let{t:r,action:u,closeModal:d,submitAction:s,applicationData:v,businessService:m}=e;const p=Digit.ULBService.getStateId(),{data:f,isLoading:E}=Digit.Hooks.tl.useTradeLicenseMDMS(p,"TradeLicense","TradeUnits","[?(@.type=='TL')]");console.log("tradeMdmsData",null==f||null===(i=f.TradeLicense)||void 0===i?void 0:i.TradeType),console.log("applicationData",v);const[g,_]=n.useState({}),[h,A]=n.useState({}),[S,N]=n.useState([]),[b,C]=n.useState(""),[y,D]=n.useState([]),[L,O]=n.useState(null),T=null===(o=v)||void 0===o||null===(a=o.tradeLicenseDetail)||void 0===a?void 0:a.tradeUnits;console.log("tradeUnits",T);const I=n.useMemo(()=>{var e;if(E||!f||!T.length)return[];const t=new Set(T.map(e=>e.tradeType)),n=(null===(e=f.TradeLicense)||void 0===e?void 0:e.TradeType.filter(e=>t.has(e.code))).some(e=>null==e?void 0:e.ishazardous);return console.log("hasHazardous",n),n?["1"]:["1","2","3"]},[E,f,T]);return console.log("years",I),n.useEffect(()=>{u&&_((e=>{let{t:n,action:i,years:o,selectedApprover:a,setSelectedApprover:r,businessService:u}=e;return{label:{heading:"WF_"+(null==i?void 0:i.action)+"_APPLICATION",submit:"WF_"+(null==u?void 0:u.toUpperCase())+"_"+(null==i?void 0:i.action),cancel:"WF_EMPLOYEE_NEWTL_CANCEL"},form:[{body:[{label:n("TL_VALID_FOR_NO_OF_YEARS"),type:"dropdown",populators:l.createElement(t.Dropdown,{option:o,autoComplete:"off",select:r,selected:a})}]}]}})({t:r,action:u,years:I,selectedApprover:b,setSelectedApprover:C,businessService:m}))},[u,I,y,L]),u&&g.form?l.createElement(t.Modal,{headerBarMain:l.createElement(hn,{label:r(g.label.heading)}),headerBarEnd:l.createElement(Sn,{onClick:d}),actionCancelLabel:r(g.label.cancel),actionCancelOnSubmit:d,actionSaveLabel:r(g.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},E?l.createElement(t.Loader,null):l.createElement(t.FormComposer,{config:g.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){var t;let n=null===(t=v)||void 0===t?void 0:t.financialYear;const l=null==n?void 0:n.split("-")[1],i="20"+Number(l)+"-"+(Number(l)+1);v=c({},v,{financialYear:i,action:"INITIATE",additionalDetail:c({},v.additionalDetail,{validityYears:b.length>0?parseInt(b):""})}),s({Licenses:[v]})},defaultValues:h,formId:"modal-action"})):l.createElement(t.Loader,null)},bn=e=>l.createElement("h1",{className:"heading-m"},e.label),Cn=()=>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(Cn,null)),Dn=e=>{var i,o;let{t:a,action:r,tenantId:u,closeModal:d,submitAction:s,applicationData:v,businessService:m,moduleCode:p}=e;const{data:f}=Digit.Hooks.useEmployeeSearch(u,{roles:null==r||null===(i=r.assigneeRoles)||void 0===i||null===(o=i.map)||void 0===o?void 0:o.call(i,e=>({code:e})),isActive:!0},{enabled:null==r?void 0:r.isTerminateState}),[E,g]=n.useState({}),[_,h]=n.useState({}),[A,S]=n.useState([]),[N,b]=n.useState(null),[C,y]=n.useState(null),[D,L]=n.useState(null),[O,T]=n.useState(null),[I,w]=n.useState(!1);function R(e){w(!0),y(e.target.files[0])}return n.useEffect(()=>{var e;S(null==f||null===(e=f.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[f]),n.useEffect(()=>{!function(){try{T(null);const e=function(){if(C){const e=function(){if(C.size>=5242880)T(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=function(e,t){try{var n=kt(function(){return Promise.resolve(Digit.UploadServices.Filestorage("StreetVending",C,u)).then(function(e){var t,n,l,i;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?L(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):T(a("CS_FILE_UPLOAD_ERROR"))})},function(){T(a("CS_FILE_UPLOAD_ERROR"))})}catch(e){return t(!0,e)}return n&&n.then?n.then(t.bind(null,!1),t.bind(null,!0)):t(!1,n)}(0,function(e,t){if(w(!1),e)throw t;return t});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[C]),console.log("actyhdesh,jhfsefsef",r,v),n.useEffect(()=>{g((e=>{let{t:n,action:i,selectFile:o,uploadedFile:a,setUploadedFile:r,approvers:u,selectedApprover:d,setSelectedApprover:s,isUploading:c}=e;const v=()=>l.createElement("div",{className:"loading-spinner"});return console.log("isuploading ",c),{label:{heading:"WF_"+(null==i?void 0:i.action)+"_APPLICATION",submit:"SV_"+(null==i?void 0:i.action),cancel:"SV_COMMON_CANCEL"},form:[{body:["APPROVE"===(null==i?void 0:i.action)||"REJECT"===(null==i?void 0:i.action)||"SENDBACKTOCITIZEN"===(null==i?void 0:i.action)?"":{label:n("SV_ASSIGNEE"),type:"dropdown",populators:l.createElement(t.Dropdown,{option:u,t:n,optionKey:"name",select:s,selected:d})},{label:n("SV_ACTION_COMMENTS"),isMandatory:!0,type:"textarea",populators:{name:"comments",validation:{required:!0}}},{label:n("SV_ATTATCH_FILE")+(i.docUploadRequired?" *":""),populators:l.createElement(t.UploadFile,{id:"workflow-doc-sv",onUpload:o,onDelete:()=>{r(null)},message:c?l.createElement("div",{style:{display:"flex",alignItems:"center",gap:"8px"}},l.createElement(v,null),l.createElement("span",null,"Uploading...")):a?"1 "+n("SV_FILE_UPLOADED"):n("SV_NO_FILE")})}]}]}})({t:a,action:r,approvers:A,selectedApprover:N,setSelectedApprover:b,selectFile:R,uploadedFile:D,setUploadedFile:L,businessService:m,isUploading:I}))},[r,A,D]),r&&E.form?l.createElement(t.Modal,{headerBarMain:l.createElement(bn,{label:a(E.label.heading)}),headerBarEnd:l.createElement(yn,{onClick:d}),actionCancelLabel:a(E.label.cancel),actionCancelOnSubmit:d,actionSaveLabel:a(E.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},l.createElement(t.FormComposer,{config:E.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){var t;let n={action:null==r?void 0:r.action,comments:null==e?void 0:e.comments,businessService:m,moduleName:p,assignes:"SENDBACKTOCITIZEN"===(null==r?void 0:r.action)?[null==v||null===(t=v.auditDetails)||void 0===t?void 0:t.createdBy]:null!=N&&N.uuid?[null==N?void 0:N.uuid]:null};D&&(n.documents=[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==C?void 0:C.name,fileStoreId:D}]),s({streetVendingDetail:c({},v,{workflow:n})})},defaultValues:_,formId:"modal-action"})):l.createElement(t.Loader,null)},Ln=e=>l.createElement("h1",{className:"heading-m"},e.label),On=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),Tn=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(On,null)),In=e=>{var i,o;let{t:a,action:r,tenantId:u,closeModal:d,submitAction:s,applicationData:v,businessService:m,moduleCode:p}=e;console.log("applicationData",v);const{data:f}=Digit.Hooks.useEmployeeSearch(u,{roles:null==r||null===(i=r.assigneeRoles)||void 0===i||null===(o=i.map)||void 0===o?void 0:o.call(i,e=>({code:e})),isActive:!0},{enabled:!(null!=r&&r.isTerminateState)}),[E,g]=n.useState({}),[_,h]=n.useState({}),[A,S]=n.useState([]),[N,b]=n.useState(null),[C,y]=n.useState(null),[D,L]=n.useState(null),[O,T]=n.useState(null),[I,w]=n.useState(!1);function R(e){y(e.target.files[0])}return n.useEffect(()=>{var e;S(null==f||null===(e=f.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[f]),n.useEffect(()=>{!function(){try{T(null);const e=function(){if(C){const e=function(){if(C.size>=5242880)T(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=kt(function(){return Promise.resolve(Digit.UploadServices.Filestorage("CHB",C,Digit.ULBService.getStateId())).then(function(e){var t,n,l,i;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?L(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):T(a("CS_FILE_UPLOAD_ERROR"))})},function(){T(a("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[C]),n.useEffect(()=>{r&&g((e=>{let{t:n,action:i,selectFile:o,uploadedFile:a,setUploadedFile:r,businessService:u}=e;return{label:{heading:"WF_"+(null==i?void 0:i.action)+"_APPLICATION",submit:"WF_"+u+"_"+(null==i?void 0:i.action),cancel:"ES_CHB_COMMON_CANCEL"},form:[{body:[{label:n("ES_CHB_ACTION_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:n("ES_CHB_ATTACH_FILE")+(i.docUploadRequired?" *":""),populators:l.createElement(t.UploadFile,{id:"workflow-doc",onUpload:o,onDelete:()=>{r(null)},showHint:!0,hintText:n("CHB_ATTACH_RESTRICTIONS_SIZE"),message:a?"1 "+n("ES_CHB_ACTION_FILEUPLOADED"):n("ES_CHB_ACTION_NO_FILEUPLOADED")})}]}]}})({t:a,action:r,approvers:A,selectedApprover:N,setSelectedApprover:b,selectFile:R,uploadedFile:D,setUploadedFile:L,businessService:m}))},[r,A,D]),r&&E.form?l.createElement(t.Modal,{headerBarMain:l.createElement(Ln,{label:a(E.label.heading)}),headerBarEnd:l.createElement(Tn,{onClick:d}),actionCancelLabel:a(E.label.cancel),actionCancelOnSubmit:d,actionSaveLabel:a(E.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},l.createElement(t.FormComposer,{config:E.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){let t={action:null==r?void 0:r.action,comments:null==e?void 0:e.comments,businessService:m,moduleName:p};D&&(t.documents=[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==C?void 0:C.name,filestoreId:D}]),s({hallsBookingApplication:[c({},v,{workflow:t})]})},defaultValues:_,formId:"modal-action"})):l.createElement(t.Loader,null)},wn=e=>l.createElement("h1",{className:"heading-m"},e.label),Rn=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),Pn=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(Rn,null)),xn=e=>{var o,a,r;let{t:u,action:d,tenantId:s,closeModal:v,submitAction:m,applicationData:p,businessService:f,moduleCode:E}=e;const{data:g}=Digit.Hooks.useEmployeeSearch(s,{roles:null==d||null===(o=d.roles)||void 0===o||null===(a=o[0])||void 0===a||null===(r=a.map)||void 0===r?void 0:r.call(a,e=>({code:e})),isActive:!0},{enabled:!(null!=d&&d.isTerminateState)}),_=i.useHistory(),[h,A]=n.useState({}),[S,N]=n.useState({}),[b,C]=n.useState([]),[y,D]=n.useState(null),[L,O]=n.useState(null);return n.useEffect(()=>{var e;C(null==g||null===(e=g.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[g]),n.useEffect(()=>{"INITIATED"===(null==d?void 0:d.state)?_.push("/digit-ui/employee/asset/assetservice/edit/"+(null==p?void 0:p.applicationNo)):A((e=>{let{t:t,action:n,businessService:l}=e;return{label:{heading:"WF_"+(null==n?void 0:n.action)+"_APPLICATION",submit:"WF_"+l+"_"+(null==n?void 0:n.action),cancel:"ES_AST_COMMON_CANCEL"},form:[{body:[{label:t("AST_ACTION_COMMENTS"),type:"textarea",populators:{name:"comments"}}]}]}})({t:u,action:d,approvers:b,selectedApprover:y,setSelectedApprover:D,uploadedFile:L,setUploadedFile:O,businessService:f}))},[d,b,L]),d&&h.form?l.createElement(t.Modal,{headerBarMain:l.createElement(wn,{label:u(h.label.heading)}),headerBarEnd:l.createElement(Pn,{onClick:v}),actionCancelLabel:u(h.label.cancel),actionCancelOnSubmit:v,actionSaveLabel:u(h.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},l.createElement(t.FormComposer,{config:h.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){let t={action:null==d?void 0:d.action,comment:null==e?void 0:e.comments,businessService:f,moduleName:E};L&&(t.documents=[]),m({Asset:c({},p,{workflow:t})})},defaultValues:S,formId:"modal-action"})):l.createElement(t.Loader,null)},Bn=e=>null!=e&&e.businessService.includes("PT")?l.createElement(Yt,e):null!=e&&e.businessService.includes("ptr")?l.createElement(_n,e):null!=e&&e.businessService.includes("NewTL")||null!=e&&e.businessService.includes("TL")||null!=e&&e.businessService.includes("EDITRENEWAL")?l.createElement(Jt,e):null!=e&&e.businessService.includes("DIRECTRENEWAL")?l.createElement(Nn,e):null!=e&&e.moduleCode.includes("BPAREG")?l.createElement(en,e):null!=e&&e.moduleCode.includes("BPA")?l.createElement(on,e):null!=e&&e.moduleCode.includes("NOC")?l.createElement(dn,e):null!=e&&e.moduleCode.includes("WS")?l.createElement(pn,e):null!=e&&e.businessService.includes("street-vending")?l.createElement(Dn,e):null!=e&&e.businessService.includes("chb")?l.createElement(In,e):null!=e&&e.businessService.includes("asset-create")?l.createElement(xn,e):void 0;function Fn(e){let{documents:n,svgStyles:i={},isSendBackFlow:a=!1,isHrLine:r=!1,titleStyles:u}=e;const{t:d}=o.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==n?void 0:n.map((e,i)=>{var o,s,c;return l.createElement(l.Fragment,{key:i},l.createElement("div",{style:{display:"flex",flexWrap:"wrap",justifyContent:"flex-start"}},l.createElement("div",{style:{display:"flex",flexWrap:"wrap",justifyContent:"flex-start"}},null!=e&&e.values&&(null==e?void 0:e.values.length)>0?null==e||null===(o=e.values)||void 0===o?void 0:o.map((n,i)=>{var o;return l.createElement("div",{style:{width:"180px"}},l.createElement(t.CardSubHeader,{style:u||{marginTop:"32px",marginBottom:"8px",color:"#505A5F",fontSize:"24px"}},d(null==e?void 0:e.title)),l.createElement("a",{target:"_",href:null==n?void 0:n.url,style:{minWidth:"80px",marginRight:"10px",maxWidth:"100px",height:"auto",minWidth:"100px"},key:i},l.createElement("div",{style:{display:"flex",justifyContent:"flex-start"}},l.createElement(t.PDFSvg,null)),l.createElement("p",{style:{marginTop:"8px",fontWeight:"bold",textAlign:"start",color:"#505A5F"}},d(null==n?void 0:n.title)),a?null!=n&&null!==(o=n.documentType)&&void 0!==o&&o.includes("NOC")?l.createElement("p",{style:{textAlign:"center"}},d(null==n?void 0:n.documentType.split(".")[1])):l.createElement("p",{style:{textAlign:"center"}},d(null==n?void 0:n.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(t.CardSubHeader,{style:u||{marginTop:"32px",marginBottom:"8px",color:"#505A5F",fontSize:"24px"}}),l.createElement("div",{style:{minWidth:"80px",marginRight:"10px",maxWidth:"100px",height:"auto",minWidth:"100px"},key:i},l.createElement("div",{style:{display:"flex",justifyContent:"flex-start"}},l.createElement(t.PDFSvg,null)),l.createElement("p",{style:{marginTop:"8px",fontWeight:"bold",textAlign:"start",color:"#505A5F"}}),a?(null!==(s=value)&&void 0!==s&&null!==(c=s.documentType)&&void 0!==c&&c.includes("NOC"),l.createElement("p",{style:{textAlign:"center"}})):"")))),r&&(null==n?void 0:n.length)!=i+1?l.createElement("hr",{style:{color:"#D6D5D4",backgroundColor:"#D6D5D4",height:"2px",marginTop:"20px",marginBottom:"20px"}}):null))})),s&&(null==n?void 0:n.map((e,n)=>{var o;return l.createElement(l.Fragment,{key:n},null!=e&&e.title?l.createElement(t.CardSubHeader,{style:{marginTop:"32px",marginBottom:"8px",color:"#505A5F",fontSize:"24px"}},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===(o=e.values)||void 0===o?void 0:o.map((e,n)=>l.createElement("a",{target:"_",href:null==e?void 0:e.url,style:{minWidth:null!=i&&i.minWidth?null==i?void 0:i.minWidth:"160px",marginRight:"20px"},key:n},l.createElement("div",{style:{maxWidth:"940px",padding:"8px",borderRadius:"4px",border:"1px solid #D6D5D4",background:"#FAFAFA"}},l.createElement("p",{style:{marginTop:"8px",fontWeight:"bold",marginBottom:"10px"}},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(t.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 Mn=e=>{var t,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===(t=d.data)||void 0===t?void 0:t.nextActions)||[],v=Digit.ULBService.getStateId(),[m,p]=n.useState((null==a||null===(i=a.documents)||void 0===i?void 0:i.documents)||[]),[f,E]=n.useState(null),[g,_]=n.useState([]),[h,A]=n.useState(!0),[S,N]=n.useState(!1),[b,C]=n.useState(!1),{isLoading:y,data:D}=Digit.Hooks.obps.useMDMS(v,"BPA",["DocTypeMapping"]),{isLoading:L,data:O}=Digit.Hooks.obps.useMDMS(v,"common-masters",["DocumentType"]);return n.useEffect(()=>{var e,t,n,l;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,n;return e.WFState==(null==r?void 0:r.status)?null==r?void 0:r.status:e.RiskType==(null==r?void 0:r.riskType)&&e.ServiceType==(null==r||null===(t=r.additionalDetails)||void 0===t?void 0:t.serviceType)&&e.applicationType==(null==r||null===(n=r.additionalDetails)||void 0===n?void 0:n.applicationType)}));let d=[];null===(t=i)||void 0===t||null===(n=t[0])||void 0===n||null===(l=n.docTypes)||void 0===l||l.forEach(e=>{var t,n,l,i;let o=e.code;e.dropdownData=[],e.uploadedDocuments=[],null==O||null===(t=O["common-masters"])||void 0===t||null===(n=t.DocumentType)||void 0===n||n.forEach(t=>{let n=t.code.slice(0,o.length);o===n&&(e.hasDropdown=!0,t.i18nKey=t.code,e.dropdownData.push(t))}),e.uploadedDocuments[0]={},e.uploadedDocuments[0].values=[],null==u||null===(l=u[0])||void 0===l||null===(i=l.values)||void 0===i||i.map(t=>{var n,l;o===(null==t||null===(n=t.documentType)||void 0===n?void 0:n.split(".")[0])+"."+(null==t||null===(l=t.documentType)||void 0===l?void 0:l.split(".")[1])&&e.uploadedDocuments[0].values.push(t)}),d.push(e)}),sessionStorage.setItem("BPA_DOCUMENTS",JSON.stringify(d)),_(d)},[!y,!L]),n.useEffect(()=>{let e=0;g.map(t=>{let n=!1;m.map(e=>{t.required&&t.code==e.documentType.split(".")[0]+"."+e.documentType.split(".")[1]&&(n=!0)}),!n&&t.required&&(e+=1)}),A("0"!=e&&0!=e||!(m.length>0))},[m,S]),n.useEffect(()=>{C("DOC_VERIFICATION_INPROGRESS"===s&&(null==c?void 0:c.length)>0)},[r,d]),l.createElement("div",{style:{display:"flex",flexWrap:"wrap"}},null==g?void 0:g.map((e,t)=>l.createElement("div",{style:{padding:"20px"}},l.createElement(Un,{key:t,index:t,document:e,t:o,error:f,setError:E,setDocuments:p,documents:m,setCheckRequiredFields:N,applicationStatus:s,actions:c,bpaTaxDocuments:g,checkEnablingDocs:b}))))};function Un(e){var i,o;let{t:a,document:r,setDocuments:u,documents:d,index:s,bpaTaxDocuments:v,checkEnablingDocs:m}=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],f=Digit.ULBService.getStateId(),[E,g]=n.useState(p?c({},p,{active:!0,code:null==p?void 0:p.documentType,i18nKey:null==p?void 0:p.documentType}):1===(null==r||null===(i=r.dropdownData)||void 0===i?void 0:i.length)?null==r?void 0:r.dropdownData[0]:{}),[_,h]=n.useState(null),[A,S]=n.useState(()=>(null==p?void 0:p.fileStoreId)||null),[N,b]=n.useState([]);return n.useEffect(()=>{null!=E&&E.code&&u(e=>{var t;const n=null==e?void 0:e.filter(e=>(null==e?void 0:e.documentType)!==(null==E?void 0:E.code));return 0===(null==A?void 0:A.length)||null===A?n:[...null==n?void 0:n.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]),n.useEffect(()=>{try{N.length>0&&(sessionStorage.removeItem("BPA_DOCUMENTS"),r.newUploadedDocs=[],N.map(e=>{var t,n,l;null!=E&&E.code&&r.newUploadedDocs.push({documentType:null==E?void 0:E.code,fileStoreId:null==e||null===(t=e.fileStoreId)||void 0===t?void 0:t.fileStoreId,documentUid:null==e||null===(n=e.fileStoreId)||void 0===n?void 0:n.fileStoreId,tenantId:null==e||null===(l=e.fileStoreId)||void 0===l?void 0:l.tenantId})}),v[s]=r,sessionStorage.setItem("BPA_DOCUMENTS",JSON.stringify(v)))}catch(e){Promise.reject(e)}},[N,E]),n.useEffect(()=>{},[_]),l.createElement("div",{style:{marginBottom:"24px",maxWidth:"950px",minWidth:"280px",background:"#FAFAFA",borderRadius:"4px",border:"1px solid #D6D5D4",padding:"8px"}},l.createElement(t.CardSubHeader,{style:{marginBottom:"8px",paddingBottom:"9px",color:"#0B0C0C",fontSize:"16px",lineHeight:"19px"}},""+a(null==r?void 0:r.code)),(null==r||null===(o=r.uploadedDocuments)||void 0===o?void 0:o.length)&&l.createElement(Fn,{documents:null==r?void 0:r.uploadedDocuments,svgStyles:{width:"100px",height:"100px",viewBox:"0 0 25 25",minWidth:"100px"}}),m?l.createElement("div",{style:{marginTop:"20px"}},l.createElement(t.LabelFieldPair,{style:{width:"100%"}},l.createElement(t.CardLabel,{style:{marginTop:"-10px",width:"100%"}},null!=r&&r.required?a(null==r?void 0:r.code)+"* ":""+a(null==r?void 0:r.code)),l.createElement(t.Dropdown,{className:"form-field",t:a,isMandatory:!1,option:null==r?void 0:r.dropdownData,selected:E,optionKey:"i18nKey",select:e=>g(e),style:{width:"100%"}})),l.createElement(t.LabelFieldPair,{style:{width:"100%"}},l.createElement(t.CardLabel,{className:"card-label-smaller",style:{width:"100%"}}),l.createElement("div",{className:"field",style:{width:"100%"}},l.createElement(t.MultiUploadWrapper,{module:"BPA",tenantId:f,getFormState:e=>((e,t)=>{let n=Object.fromEntries(t),l=Object.values(n);var i;0!==Object.keys(n).length&&b(l),(i=l[l.length-1])&&h(i.file)})(0,e),t:a,allowedFileTypesRegex:/(.*?)(jpg|jpeg|png|image|pdf)$/i,allowedMaxSizeInMB:5,acceptFiles:"image/*, .pdf, .png, .jpeg, .jpg"})))):null)}function kn(e){let{fiReport:n,isCitizen:i=!1}=e;const{t:a}=o.useTranslation();return l.createElement(l.Fragment,null,l.createElement("div",{style:{marginTop:"10px"}},l.createElement(i?t.CardHeader:t.CardSectionHeader,{style:{fontSize:"24px"}},""+a("BPA_FI_REPORT")),n.map((e,i)=>{var o,r,u,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(t.StatusTable,null,l.createElement(t.CardSectionHeader,{style:{fontSize:"20px"}},1==(null==n?void 0:n.length)?""+a("BPA_FI_REPORT"):a("BPA_FI_REPORT")+" - "+(i+1)),l.createElement(t.Row,{className:"border-none",label:""+a("BPA_FI_DATE_LABEL"),text:null!=e&&e.date?e.date.includes("-")?(null===(o=e.date)||void 0===o?void 0:o.split("-")[2])+"/"+(null===(r=e.date)||void 0===r?void 0:r.split("-")[1])+"/"+(null===(u=e.date)||void 0===u?void 0:u.split("-")[0]):null==e?void 0:e.date:"NA"}),l.createElement(t.Row,{className:"border-none",label:""+a("BPA_FI_TIME_LABEL"),text:null!=e&&e.time?null==e?void 0:e.time:"NA"}),(null==e||null===(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(t.Row,{className:"border-none",label:""+a(""+e.question),text:null!=e&&e.value?null==e?void 0:e.value:"NA"}),l.createElement(t.Row,{className:"border-none",label:""+a("BPA_ENTER_REMARKS"),text:e.remarks?e.remarks:"NA"})))),l.createElement(Fn,{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"}})))})))}function Wn(e){let{t:i,document:o,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==o?void 0:o.code)})[0],s=Digit.ULBService.getStateId(),[c,v]=n.useState(),[m,p]=n.useState(null),[f,E]=n.useState(()=>(null==d?void 0:d.fileStoreId)||null);return n.useEffect(()=>{var e,t;null!=o&&null!==(e=o.dropdownData)&&void 0!==e&&null!==(t=e[0])&&void 0!==t&&t.code&&a(e=>{var t;const n=null==e?void 0:e.filter(e=>{var t,n;return(null==e?void 0:e.documentType)!==(null==o||null===(t=o.dropdownData)||void 0===t||null===(n=t[0])||void 0===n?void 0:n.code)});return 0===(null==f?void 0:f.length)||null===f?n:[...null==n?void 0:n.filter(e=>(null==e?void 0:e.fileStoreId)!==f),{documentType:null==o||null===(t=o.dropdownData)||void 0===t?void 0:t[0].code,fileStoreId:f,documentUid:f,fileName:(null==m?void 0:m.name)||""}]})},[f]),n.useEffect(()=>{!function(){try{r(null);const e=function(){if(m){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(m.size>=5242880)r(i("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=m&&m.type&&!e.test(null==m?void 0:m.type))r(i("NOT_SUPPORTED_FILE_TYPE"));else{const e=kt(function(){return E(null),Promise.resolve(Digit.UploadServices.Filestorage("PT",m,Digit.ULBService.getStateId())).then(function(e){var t,n,l,o;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?E(null==e||null===(l=e.data)||void 0===l||null===(o=l.files[0])||void 0===o?void 0:o.fileStoreId):r(i("CS_FILE_UPLOAD_ERROR"))})},function(){r(i("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[m]),l.createElement("div",{style:{}},l.createElement(t.LabelFieldPair,{style:{width:"98%",marginRight:"10px"}},l.createElement(t.CardLabel,{style:{width:"100%"}},null!=o&&o.required?i("TL_BUTTON_UPLOAD FILE")+"*":""+i("TL_BUTTON_UPLOAD FILE")),l.createElement("div",{className:"field",style:{width:"100%"}},l.createElement(t.MultiUploadWrapper,{module:"NOC",tenantId:s,getFormState:e=>(e=>{let t=Object.fromEntries(e),n=Object.values(t);var l;(l=n[n.length-1])&&p(l.file)})(e),t:i,allowedFileTypesRegex:/(.*?)(jpg|jpeg|png|image|pdf)$/i,allowedMaxSizeInMB:5,acceptFiles:"image/*, .pdf, .png, .jpeg, .jpg"}))))}const Hn=e=>{var i;let{t:o,noc:a,docs:r,isNoc:u,applicationData:d,NOCdata:s,bpaActionsDetails:c}=e;Digit.ULBService.getStateId();const v=Digit.ULBService.getStateId(),m=(null==d?void 0:d.status)||"",p=(null==c||null===(i=c.data)||void 0===i?void 0:i.nextActions)||[],{data:f}=Digit.Hooks.obps.useMDMS(v,"NOC",["DocumentTypeMapping"],{enabled:u}),{data:E}=Digit.Hooks.obps.useMDMS(v,"BPA",["DocTypeMapping"],{enabled:!u}),{data:g}=Digit.Hooks.obps.useMDMS(v,"common-masters",["DocumentType"]),[_,h]=n.useState([]),[A,S]=n.useState([]),[N,b]=n.useState(!1),[C,y]=Digit.Hooks.useSessionStorage(null==a?void 0:a.nocType,[]),[D,L]=n.useState(null),O=window.location.href.includes("/employee/");return n.useEffect(()=>{var e;h(null==g||null===(e=g["common-masters"])||void 0===e?void 0:e.DocumentType)},[g]),n.useEffect(()=>{var e,t,n;let l,i=[];var o,r,s,c;l=u?null==f||null===(o=f.NOC)||void 0===o||null===(r=o.DocumentTypeMapping)||void 0===r?void 0:r.filter(e=>(null==e?void 0:e.applicationType)===(null==a?void 0:a.applicationType)&&(null==e?void 0:e.nocType)===(null==a?void 0:a.nocType)):null==E||null===(s=E.BPA)||void 0===s||null===(c=s.DocTypeMapping)||void 0===c?void 0:c.filter(e=>{var t,n;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===(n=d.additionalDetails)||void 0===n?void 0:n.applicationType)}),null!==(e=l)&&void 0!==e&&null!==(t=e[0])&&void 0!==t&&null!==(n=t.docTypes)&&void 0!==n&&n[0]&&(l[0].docTypes[0].nocType=l[0].nocType,l[0].docTypes[0].additionalDetails={submissionDetails:null==a?void 0:a.additionalDetails,applicationStatus:null==a?void 0:a.applicationStatus,appNumberLink:null==a?void 0:a.applicationNo,nocNo:null==a?void 0:a.nocNo},i.push(l[0].docTypes[0]));let v=[];i&&i.length>0&&(i.map(e=>{let t=e.documentType;e.dropdownData=[],null==_||_.forEach(n=>{let l=n.code.slice(0,null==t?void 0:t.length);t===l&&(e.hasDropdown=!0,e.dropdownData.push(n))}),v.push(e)}),S(v))},[f,_]),n.useEffect(()=>{b("NOC_VERIFICATION_INPROGRESS"===m&&(null==p?void 0:p.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(t.StatusTable,null,l.createElement(t.Row,{label:O?""+o("BPA_"+(null==a?void 0:a.nocType)+"_HEADER"):o("BPA_"+(null==a?void 0:a.nocType)+"_HEADER"),labelStyle:{fontSize:"20px",width:"150%"}}),s&&s.map((e,n)=>{if(null!=e&&e.value)return l.createElement(t.Row,"STATUS"==(null==e?void 0:e.field)?{className:"border-none",label:O?""+o(null==e?void 0:e.title):o(null==e?void 0:e.title),text:o(null!=e&&e.value?null==e?void 0:e.value:"CS_NA"),textStyle:"APPROVED"==(null==e?void 0:e.value)||"AUTO_APPROVED"==(null==e?void 0:e.value)?{color:"#00703C"}:{color:"#D4351C"}}:{className:"border-none",label:O?""+o(null==e?void 0:e.title):o(null==e?void 0:e.title),text:o(null!=e&&e.value?null==e?void 0:e.value:"CS_NA")})})),l.createElement(Fn,{documents:r,svgStyles:{width:"80px",height:"100px",viewBox:"0 0 25 25",minWidth:"80px"}}),N&&(null==A?void 0:A.map((e,t)=>l.createElement(Wn,{key:t,document:e,t:o,error:D,setError:L,setNocDocuments:y,nocDocuments:C,checkEnablingDocs:N}))))},jn=e=>{let{permissions:i,t:o}=e;const[a,r,u]=Digit.Hooks.useSessionStorage("OBPS_APPROVAL_CHECKS",null==i?void 0:i.map(e=>({label:e,checked:!1}))),[d,s,v]=Digit.Hooks.useSessionStorage("OBPS_NEW_APPROVALS",[]);n.useEffect(()=>()=>{Digit.SessionStorage.del("OBPS_NEW_APPROVALS"),Digit.SessionStorage.del("OBPS_APPROVAL_CHECKS")},[]);const m=window.Digit.Utils.browser.isMobile();return l.createElement("div",null,l.createElement(t.CardSubHeader,{style:{marginBottom:"16px",fontSize:"24px"}},o("BPA_PERMIT_CONDITIONS")),null==a?void 0:a.map((e,n)=>l.createElement(t.CheckBox,{key:n,styles:{margin:"20px 0 40px",maxWidth:m?"100%":"70%"},label:null==e?void 0:e.label,checked:null==e?void 0:e.checked,onChange:e=>((e,t,n)=>{const l=e.target.checked;r(()=>null==a?void 0:a.map((e,t)=>n===t?c({},e,{checked:l}):e))})(e,0,n),isLabelFirst:!0,index:n})),null==d?void 0:d.map((e,n)=>l.createElement("div",null,l.createElement(t.TextInput,{key:n,value:null==e?void 0:e.label,onChange:e=>((e,t)=>{s(()=>null==d?void 0:d.map((n,l)=>{var i;return t===l?{label:null==e||null===(i=e.target)||void 0===i?void 0:i.value}:n}))})(e,n),textInputStyle:{maxWidth:m?"96%":"830px",width:m?"96%":"830px"},style:m?{paddingRight:"10%"}:{},placeholder:o("BPA_ENTER_PERMIT_CONDITIONS_LABEL")}),l.createElement(t.LinkButton,{label:l.createElement("div",null,l.createElement("span",null,l.createElement(t.Close,{style:{float:"right",position:"relative",bottom:"32px",marginTop:"-22px",marginRight:m?"5%":"35%"}}))),style:{},onClick:e=>(e=>{const t=[...d];t.splice(e,1),s([...t])})(n)}))),l.createElement(t.LinkButton,{style:{color:"#a82227",maxWidth:m?"fit-content":"10%",marginRight:"3%"},label:o("BPA_ADD_MORE"),onClick:()=>{s([...d,{label:""}])}}))};function zn(e){let{taxHeadEstimatesCalculation:n}=e;const{taxHeadEstimates:i}=n,{t:a}=o.useTranslation();return l.createElement("div",{style:{marginTop:"40px"}},l.createElement(t.StatusTable,null,l.createElement(t.Row,{label:a("ES_PT_TITLE_TAX_HEADS"),text:a("ES_PT_TITLE_AMOUNT"),className:"border-none",textStyle:{fontWeight:"bold"}}),l.createElement(t.BreakLine,{style:{margin:"16px 0",width:"40%"}}),null==i?void 0:i.map((e,n)=>l.createElement(t.Row,{key:a(e.taxHeadCode),label:a(e.taxHeadCode),text:"₹ "+e.estimateAmount||"N/A",last:n===(null==i?void 0:i.length)-1,className:"border-none",textStyle:{color:"#505A5F"},labelStyle:{color:"#505A5F"}})),l.createElement(t.BreakLine,{style:{margin:"16px 0",width:"40%"}}),l.createElement(t.Row,{label:a("ES_PT_TITLE_TOTAL_DUE_AMOUNT"),text:"₹ "+(null==n?void 0:n.totalAmount)||"N/A",className:"border-none",textStyle:{fontSize:"24px",fontWeight:"bold"}})))}function Vn(e){let{floors:n}=e;const{t:i}=o.useTranslation();return l.createElement(l.Fragment,null,n.map(e=>{var n;return l.createElement("div",{key:i(null==e?void 0:e.title),style:{marginTop:"19px"}},l.createElement(t.CardSubHeader,{style:{marginBottom:"8px",color:"#505A5F",fontSize:"24px"}},i(null==e?void 0:e.title)),null==e||null===(n=e.values)||void 0===n?void 0:n.map((e,n)=>{var o;return l.createElement(l.Fragment,{key:n},l.createElement(t.CardSectionHeader,{style:{marginBottom:"16px",color:"#505A5F",fontSize:"16px",marginTop:0!==n?"16px":"revert"}},i(e.title)),l.createElement(t.StatusTable,{style:{position:"relative",padding:"8px"}},l.createElement("div",{style:{border:"1px solid #D6D5D4",padding:"16px",marginTop:"8px",borderRadius:"4px",background:"#FAFAFA",maxWidth:"100%"}},null==e||null===(o=e.values)||void 0===o?void 0:o.map((e,n)=>{var o;return l.createElement(t.Row,!0===e.map&&"N/A"!==e.value?{key:i(e.title),label:i(e.title),text:l.createElement("img",{src:i(e.value),alt:""})}:{key:i(e.title),label:i(e.title),text:i(e.value)||"N/A",last:n===(null==e||null===(o=e.values)||void 0===o?void 0:o.length)-1,caption:e.caption,className:"border-none"})}))))}))}))}function Gn(e){let{owners:n}=e,i={};i=window.location.href.includes("/employee/pt/")?n.slice().reverse():n;const{t:a}=o.useTranslation(),r=(null==n?void 0:n.length)||1;let u={marginTop:"19px"},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=c({},u,{maxWidth:"950px"}),u=c({},u,{maxWidth:"950px"}),s={}),n.sort((e,t)=>{var n,l;return(null==e||null===(n=e.additionalDetails)||void 0===n?void 0:n.ownerSequence)-(null==t||null===(l=t.additionalDetails)||void 0===l?void 0:l.ownerSequence)}),l.createElement(l.Fragment,null,l.createElement("div",{className:"owner-details"},i.map((e,n)=>{var i;return l.createElement("div",{key:a(null==e?void 0:e.title),style:u,className:"owner-details-child"},l.createElement(t.CardSubHeader,{style:Number(r)>1?{marginBottom:"8px",paddingBottom:"9px",color:"#0B0C0C",fontSize:"16px",lineHeight:"19px"}:{marginBottom:"8px",color:"#505A5F",fontSize:"24px"}},Number(r)>1?a(null==e?void 0:e.title)+" "+(n+1):a(null==e?void 0:e.title)),l.createElement(l.Fragment,{key:n},l.createElement(t.StatusTable,{style:d},l.createElement("div",{style:{maxWidth:"640px",top:0,left:0,bottom:0,right:0,width:"auto"}}),null==e||null===(i=e.values)||void 0===i?void 0:i.map((e,n)=>{var i;return!0===e.map&&"N/A"!==e.value?l.createElement(t.Row,{key:a(e.title),label:a(e.title),text:l.createElement("img",{src:a(e.value),alt:"",privacy:null==e?void 0:e.privacy})}):l.createElement("span",null,l.createElement(t.Row,{key:a(e.title),label:""+a(e.title),text:a(e.value)||"N/A",last:n===(null==e||null===(i=e.values)||void 0===i?void 0:i.length)-1,caption:e.caption,className:"border-none",textStyle:e.textStyle,privacy:null==e?void 0:e.privacy,rowContainerStyle:s}))}))))})))}const Yn=e=>{var i,a;let{scrutinyDetails:r,paymentsList:u=[],additionalDetails:d,applicationData:s}=e;(window.location.href.includes("editApplication")||"FIELDINSPECTION_INPROGRESS"==(null==s?void 0:s.status))&&window.location.href.includes("bpa");const[c,v]=n.useState(),[m,p]=n.useState(),[f,E]=n.useState(),g=Digit.ULBService.getStateId(),[_,h]=n.useState(),[A,S]=n.useState(),[N,b]=n.useState([]),[C,y]=n.useState(),[D,L]=n.useState(""),[O,T]=n.useState(null),[I,w]=n.useState({}),[R,P]=n.useState(!1),[x,B]=n.useState(!1);n.useEffect(()=>{!function(){try{T(null);const e=function(){if(C&&null!=C&&C.type){const e=function(e,t,n){if(null!==(e=".pdf".split(","))&&void 0!==e&&e.includes("."+(null==C||null===(t=C.type)||void 0===t||null===(n=t.split("/"))||void 0===n?void 0:n.pop()))){const e=function(){if(C.size>=2e6)T(F("PT_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=kt(function(){return Promise.resolve(Digit.UploadServices.Filestorage("property-upload",C,Digit.ULBService.getStateId())).then(function(e){var t,n,l,i;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?b([...N,{fileStoreId:null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId,time:new Date}]):T(F("PT_FILE_UPLOAD_ERROR"))})},function(){});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}else T(F("PT_UPLOAD_FORMAT_NOT_SUPPORTED"))}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[C]),n.useEffect(()=>{sessionStorage.setItem("uploadedFileLess",JSON.stringify(N))},[N]),n.useEffect(()=>{var e,t,n,l,i,o,a;if(null!=d&&null!==(e=d.lessAdjustmentFeeFiles)&&void 0!==e&&e.length){const e=null==d?void 0:d.lessAdjustmentFeeFiles.map((e,t)=>{var n,l,i;return t===(null==d||null===(n=d.lessAdjustmentFeeFiles)||void 0===n?void 0:n.length)-1?null==d||null===(l=d.lessAdjustmentFeeFiles[(null==d||null===(i=d.lessAdjustmentFeeFiles)||void 0===i?void 0:i.length)-1])||void 0===l?void 0:l.fileStoreId:null});Digit.UploadServices.Filefetch(e,g).then(e=>w(null==e?void 0:e.data))}v(null==d||null===(t=d.selfCertificationCharges)||void 0===t?void 0:t.BPA_DEVELOPMENT_CHARGES),sessionStorage.setItem("development",null==d||null===(n=d.selfCertificationCharges)||void 0===n?void 0:n.BPA_DEVELOPMENT_CHARGES),p(null==d||null===(l=d.selfCertificationCharges)||void 0===l?void 0:l.BPA_OTHER_CHARGES),sessionStorage.setItem("otherCharges",null==d||null===(i=d.selfCertificationCharges)||void 0===i?void 0:i.BPA_OTHER_CHARGES),E(null==d||null===(o=d.selfCertificationCharges)||void 0===o?void 0:o.BPA_LESS_ADJUSMENT_PLOT),sessionStorage.setItem("lessAdjusment",null==d||null===(a=d.selfCertificationCharges)||void 0===a?void 0:a.BPA_LESS_ADJUSMENT_PLOT),h(null==d?void 0:d.otherFeesDiscription),sessionStorage.setItem("otherChargesDisc",null==d?void 0:d.otherFeesDiscription),b(null==d?void 0:d.lessAdjustmentFeeFiles)},[d]);const{t:F}=o.useTranslation(),M=e=>null!=e&&e.value&&null!=e&&e.isTransLate?l.createElement("span",{style:{color:"#00703C"}},F(null==e?void 0:e.value)):null!=e&&e.value&&null!=e&&e.isTransLate?F(null==e?void 0:e.value):null!=e&&e.value?null==e?void 0:e.value:void F("NA");return l.createElement(n.Fragment,null,!(null!=r&&r.isChecklist)&&l.createElement("div",{style:{background:"#FAFAFA",border:"1px solid #D6D5D4",padding:"8px",borderRadius:"4px",maxWidth:"950px"}},l.createElement(t.StatusTable,null,l.createElement("div",null,null==r||null===(i=r.values)||void 0===i?void 0:i.map((e,n)=>null!=e&&e.isUnit?l.createElement(t.Row,{className:"border-none",textStyle:"Paid"===(null==e?void 0:e.value)?{color:"darkgreen"}:"Unpaid"===(null==e?void 0:e.value)?{color:"red"}:{},key:""+e.title,label:""+F(""+e.title),text:null!=e&&e.value?M(e)+" "+F(null==e?void 0:e.isUnit):F("NA"),labelStyle:null!=e&&e.isHeader?{fontSize:"20px"}:{}}):null==e||!e.isHeader||null!=e&&e.isUnit?null==e||!e.isSubTitle||null!=e&&e.isUnit?l.createElement(t.Row,{className:"border-none",textStyle:"Paid"===(null==e?void 0:e.value)?{color:"darkgreen",wordBreak:"break-all"}:"Unpaid"===(null==e?void 0:e.value)?{color:"red",wordBreak:"break-all"}:{wordBreak:"break-all"},key:""+e.title,label:""+F(""+e.title),text:M(e),labelStyle:null!=e&&e.isHeader?{fontSize:"20px"}:{}}):l.createElement(t.CardSubHeader,{style:{fontSize:"20px",paddingBottom:"10px",margin:"0px"}},F(null==e?void 0:e.title)):l.createElement(t.CardSubHeader,{style:{fontSize:"20px",paddingBottom:"10px"}},F(null==e?void 0:e.title))),null==r||null===(a=r.permit)||void 0===a?void 0:a.map((e,n)=>l.createElement(t.CardLabel,{style:{fontWeight:"400"}},null==e?void 0:e.title))))))},Kn=e=>{var i,a,r,u,d;let{edcrDetails:s,applicationData:c}=e;const{t:v}=o.useTranslation(),m=window.Digit.Utils.browser.isMobile(),p=[{name:"BPA_TABLE_COL_FLOOR",id:"Floor"},{name:"BPA_TABLE_COL_LEVEL",id:"Level"},{name:"BPA_TABLE_COL_OCCUPANCY",id:"Occupancy"},{name:"BPA_TABLE_COL_BUILDUPAREA",id:"BuildupArea"},{name:"BPA_TABLE_COL_DEDUCTION",id:"Deduction"},{name:"BPA_TABLE_COL_FLOORAREA",id:"FloorArea"}],f=e=>{const t=e;return(e,n,l)=>e[t]},E=n.useMemo(()=>p.map(e=>({Header:v(""+e.name),accessor:f(e.id),id:e.id})));function g(e){var t;let n=[],l=0,i=0,o=0;return null==e||null===(t=e.building)||void 0===t||t.floors.map(e=>{var t,a,r,u,d,s,c,m,p,f,E,g,_,h;const A=Number(null===(t=e.occupancies)||void 0===t||null===(a=t[0])||void 0===a?void 0:a.builtUpArea)||0,S=Number(null===(r=e.occupancies)||void 0===r||null===(u=r[0])||void 0===u?void 0:u.floorArea)||0,N=Number(null===(d=e.occupancies)||void 0===d||null===(s=d[0])||void 0===s?void 0:s.deduction)||0;l+=A,i+=S,o+=N,n.push({Floor:v("BPA_FLOOR_NAME_"+e.number),Level:e.number,Occupancy:v(""+(null===(c=e.occupancies)||void 0===c||null===(m=c[0])||void 0===m?void 0:m.type)),BuildupArea:Number(null===(p=e.occupancies)||void 0===p||null===(f=p[0])||void 0===f?void 0:f.builtUpArea).toFixed(2),Deduction:Number(null===(E=e.occupancies)||void 0===E||null===(g=E[0])||void 0===g?void 0:g.deduction).toFixed(2),FloorArea:Number(null===(_=e.occupancies)||void 0===_||null===(h=_[0])||void 0===h?void 0:h.floorArea).toFixed(2)||0,key:v("BPA_FLOOR_NAME_"+e.number)})}),n.push({Floor:v("BPA_TOTAL"),Level:"",Occupancy:"",BuildupArea:Number(l).toFixed(2)+" "+v("BPA_SQ_MTRS_LABEL"),Deduction:Number(o).toFixed(2)+" "+v("BPA_SQ_MTRS_LABEL"),FloorArea:Number(i).toFixed(2)+" "+v("BPA_SQ_MTRS_LABEL")}),n}function _(e){var t;let n=null==c||null===(t=c.landInfo)||void 0===t?void 0:t.unit,l="";if((null==n?void 0:n.length)>0){var i,o;let t=null===(i=n[e])||void 0===i||null===(o=i.usageCategory)||void 0===o?void 0:o.split(",");null!=t&&t.length&&(l=t.map(e=>e?""+v("BPA_SUBOCCUPANCYTYPE_"+function(e,t,n){if(void 0===e&&(e=""),void 0===t&&(t=""),void 0===n&&(n=""),""==t)return e;for(;e.includes(t);)e=e.replace(t,n);return e}(null==e?void 0:e.toUpperCase(),"-","_")):"NA").join(", "))}return l||"NA"}return l.createElement(n.Fragment,null,l.createElement("div",{style:{background:"#FAFAFA",border:"1px solid #D6D5D4",padding:"8px",borderRadius:"4px",maxWidth:"950px",minWidth:"280px"}},null==s||null===(i=s.values)||void 0===i?void 0:i.map((e,n)=>null!=e&&e.isHeader?l.createElement(t.CardSubHeader,{style:{fontSize:"20px",paddingBottom:"10px"}},v(null==e?void 0:e.title)):l.createElement(t.Row,{className:"border-none",labelStyle:{width:"100%",fontSize:"20px"},key:""+e.title,label:""+v(""+e.title),text:null!=e&&e.value?null==e?void 0:e.value:""})),null==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,n)=>{var i,o,a,r,u;return l.createElement("div",{key:n,style:(null==s||null===(i=s.subOccupancyTableDetails)||void 0===i||null===(o=i[0])||void 0===o||null===(a=o.value)||void 0===a||null===(r=a.planDetail)||void 0===r||null===(u=r.blocks)||void 0===u?void 0:u.length)>0?{marginBottom:"30px",background:"#FAFAFA",border:"1px solid #D6D5D4",padding:"8px",borderRadius:"4px",maxWidth:"950px",minWidth:"280px"}:{marginBottom:"30px"}},l.createElement(t.CardSubHeader,{style:{marginBottom:"8px",paddingBottom:"9px",color:"#0B0C0C",fontSize:"18px",lineHeight:"19px"}},v("BPA_BLOCK_SUBHEADER")," ",n+1),l.createElement(t.StatusTable,null,l.createElement(t.Row,{className:"border-none",textStyle:{wordBreak:"break-word"},label:""+v("BPA_SUB_OCCUPANCY_LABEL"),text:_(n)})),l.createElement("div",{style:window.location.href.includes("citizen")||m?{overflow:"scroll"}:{maxWidth:"950px",maxHeight:"280px"}},l.createElement(t.Table,{className:"customTable table-fixed-first-column table-border-style",t:v,disableSort:!0,autoSort:!1,manualPagination:!1,isPaginationRequired:!1,initSortId:"S N ",data:g(e),columns:E,getCellProps:e=>({style:{}})})))})))},qn=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))},Xn=e=>{var i,a,r;let{data:u,OpenImage:d,privacy:s={}}=e;const[c,v]=n.useState(!1),{t:m}=o.useTranslation();return l.createElement("div",null,u.date&&l.createElement("p",null,u.date),l.createElement("p",null,u.name),u.mobileNumber&&l.createElement("span",{style:{display:"inline-flex",width:"fit-content",marginLeft:"10px"}},l.createElement(t.TelePhone,{mobile:u.mobileNumber,privacy:s}),l.createElement("p",null," ")),u.source&&l.createElement("p",null,m("ES_APPLICATION_DETAILS_APPLICATION_CHANNEL_"+u.source.toUpperCase())),u.comment&&l.createElement(qn,{otherComment:null==u?void 0:u.otherComment,headComment:null==u?void 0:u.comment}),null!=u&&u.wfComment?l.createElement("div",null,null==u||null===(i=u.wfComment)||void 0===i?void 0:i.map(e=>l.createElement("div",{className:"TLComments"},l.createElement("h3",null,m("WF_COMMON_COMMENTS")),!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"}},m("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"}},m("View Less")))))):null,(null==u||null===(a=u.thumbnailsToShow)||void 0===a||null===(r=a.thumbs)||void 0===r?void 0:r.length)>0?l.createElement("div",{className:"TLComments"},l.createElement("h3",null,m("CS_COMMON_ATTACHMENTS")),l.createElement(t.DisplayPhotos,{srcs:null==u?void 0:u.thumbnailsToShow.thumbs,onClick:(e,t)=>{d(e,t,null==u?void 0:u.thumbnailsToShow)}})):null)};function Jn(e){let{units:n}=e;const{t:i}=o.useTranslation();return l.createElement(l.Fragment,null,n.map((e,n)=>{var o;return l.createElement("div",{key:i(null==e?void 0:e.title),style:{marginTop:"19px",background:"#FAFAFA",border:"1px solid #D6D5D4",borderRadius:"4px",padding:"8px",lineHeight:"19px",maxWidth:"600px",minWidth:"280px"}},l.createElement(t.CardSubHeader,{style:{marginBottom:"8px",paddingBottom:"9px",color:"#0B0C0C",fontSize:"16px",lineHeight:"19px"}},i(null==e?void 0:e.title)+" "+(n+1)),l.createElement(l.Fragment,{key:n},l.createElement(t.StatusTable,{style:{position:"relative",marginTop:"19px"}},l.createElement("div",{style:{position:"absolute",maxWidth:"640px",top:0,left:0,bottom:0,right:0,width:"auto"}}),null==e||null===(o=e.values)||void 0===o?void 0:o.map((e,n)=>{var o;return l.createElement(t.Row,!0===e.map&&"N/A"!==e.value?{key:i(e.title),label:i(e.title),text:l.createElement("img",{src:i(e.value),alt:""})}:{key:i(e.title),label:i(e.title)+":",text:i(e.value)||"N/A",last:n===(null==e||null===(o=e.values)||void 0===o?void 0:o.length)-1,caption:e.caption,className:"border-none",rowContainerStyle:{justifyContent:"space-between",fontSize:"16px",lineHeight:"19px",color:"#0B0C0C"}})}))))}))}function Qn(e){let{units:n}=e;const{t:i}=o.useTranslation();return l.createElement(l.Fragment,null,n.map((e,n)=>{var o;return l.createElement("div",{key:i(null==e?void 0:e.title),style:{marginTop:"19px",background:"#FAFAFA",border:"1px solid #D6D5D4",borderRadius:"4px",padding:"8px",lineHeight:"19px",maxWidth:"600px",minWidth:"280px"}},l.createElement(t.CardSubHeader,{style:{marginBottom:"9px",paddingBottom:"9px",color:"#0B0C0C",fontSize:"16px",lineHeight:"19px"}},i(null==e?void 0:e.title)+" "+(n+1)),l.createElement(l.Fragment,{key:n},l.createElement(t.StatusTable,{style:{position:"relative",marginTop:"19px"}},l.createElement("div",{style:{position:"absolute",maxWidth:"640px",top:0,left:0,bottom:0,right:0,width:"auto"}}),null==e||null===(o=e.values)||void 0===o?void 0:o.map((e,n)=>{var o;return l.createElement(t.Row,!0===e.map&&"N/A"!==e.value?{key:i(e.title),label:i(e.title),text:l.createElement("img",{src:i(e.value),alt:""})}:{key:i(e.title),label:i(e.title)+":",text:i(e.value)||"NA",last:n===(null==e||null===(o=e.values)||void 0===o?void 0:o.length)-1,caption:e.caption,className:"border-none",rowContainerStyle:{justifyContent:"space-between",fontSize:"16px",lineHeight:"19px",color:"#0B0C0C"}})}))))}))}const Zn=e=>{var i,a,r,u,d;let{wsAdditionalDetails:s}=e;const{t:c}=o.useTranslation();let v=(m=location.search)?(/^[?#]/.test(m)?m.slice(1):m).split("&").reduce((e,t)=>{let[n,l]=t.split("=");return e[n]=l?decodeURIComponent(l.replace(/\+/g," ")):"",e},{}):{};var m;const p=null==v?void 0:v.mode;var{connectionDetails:f,plumberDetails:E,roadCuttingDetails:g,roadCuttingAddlDetails:_,activationDetails:h}=(null==s?void 0:s.additionalDetails)||{connectionDetails:[],plumberDetails:[],roadCuttingAddlDetails:[]};return l.createElement(n.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(t.StatusTable,null,l.createElement(t.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==f?void 0:f.map((e,n)=>l.createElement("div",null,l.createElement(t.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"!=p&&l.createElement(t.StatusTable,null,l.createElement(t.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==E?void 0:E.map((e,n)=>l.createElement(t.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"!=p&&l.createElement(t.StatusTable,null,l.createElement(t.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==g?void 0:g.map(e=>{var n;return l.createElement("div",{style:(null==g?void 0:g.length)>1?{border:"1px solid #D6D5D4",background:"#FAFAFA",borderRadius:"4px",padding:"10px 10px 0px 10px",margin:"5px 0px"}:{}},null==e||null===(n=e.values)||void 0===n?void 0:n.map(e=>l.createElement(t.Row,{className:"border-none",key:""+e.title,label:""+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==_?void 0:_.map((e,n)=>l.createElement("div",null,l.createElement(t.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(t.StatusTable,null,l.createElement(t.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==h?void 0:h.map((e,n)=>l.createElement(t.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:""})))))))},$n=[{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"}],el=[{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"}],tl=e=>{var i,a,r,u;let{wsAdditionalDetails:d}=e;const{t:s}=o.useTranslation(),[v,m,p]=Digit.Hooks.useSessionStorage("ADHOC_ADD_REBATE_DATA",{}),[f,E,g]=Digit.Hooks.useSessionStorage("ADHOC_BILL_ADD_REBATE_DATA",{}),h=!(null==d||null===(i=d.additionalDetails)||void 0===i||!i.isPaid),[A,S]=n.useState(!1),[N,b]=n.useState(v||{}),[C,y]=n.useState(null),[D,L]=n.useState(d.additionalDetails.data?d.additionalDetails.data:{}),[O,T]=n.useState(d.additionalDetails.values?d.additionalDetails.values:[]),I=Digit.ULBService.getStateId();Digit.Hooks.ws.useMDMS(I,"BillingService",["TaxHeadMaster"]),n.useEffect(()=>{var e,t,n;const i=c({},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,p,f;const e=[{title:"WS_APPLICATION_FEE_HEADER",value:l.createElement("span",null,"₹",null==v||null===(o=v.billDetails)||void 0===o||null===(a=o[0])||void 0===a?void 0:a.fee)},{title:"WS_SERVICE_FEE_HEADER",value:l.createElement("span",null,"₹",null==v||null===(r=v.billDetails)||void 0===r||null===(u=r[0])||void 0===u?void 0:u.charge)},{title:"WS_TAX_HEADER",value:l.createElement("span",null,"₹",null==v||null===(s=v.billDetails)||void 0===s||null===(p=s[0])||void 0===p?void 0:p.taxAmount)}];T(e),L(null==v||null===(f=v.billDetails)||void 0===f?void 0:f[0])}else m(i),b(i)},[]);let w={};const R=e=>l.createElement("h1",{className:"heading-m"},e.label),P=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),x=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(P,null)),B=function(e,t,n){void 0===t&&(t=!1);let l=c({},N);if("adhocPenalty"!=e&&"adhocRebate"!=e||!n.target.value)t?(l[e+"_data"]=n,l[e]=n.title,"PT_OTHERS"==n.title&&"adhocPenaltyReason"==e&&(l.adhocPenaltyComment=""),"PT_OTHERS"==n.title&&"adhocRebateReason"==e&&(l.adhocRebateComment="")):l[e]=n.target.value;else{var i,o;const t=0==(null==n||null===(i=n.target)||void 0===i?void 0:i.value)?1:Math.sign(null==n||null===(o=n.target)||void 0===o?void 0:o.value)||-1;l[e]=1==t?n.target.value:""}b(l)};return l.createElement(n.Fragment,null,l.createElement("div",{style:{lineHeight:"19px",maxWidth:"950px",minWidth:"280px"}},O&&l.createElement(t.StatusTable,null,l.createElement("div",null,null==O?void 0:O.map((e,n)=>l.createElement(t.Row,{className:"border-none",key:""+e.title,label:""+s(""+e.title),text:null!=e&&e.value?null==e?void 0:e.value:""}))),l.createElement("hr",{style:{border:"1px solid #D6D5D4",color:"#D6D5D4",margin:"16px 0px"}}),l.createElement("div",null,l.createElement(t.Row,{className:"border-none",key:"WS_COMMON_TOTAL_AMT",label:""+s("WS_COMMON_TOTAL_AMT"),text:l.createElement("span",null,"₹",(null==D?void 0:D.totalAmount)||0),textStyle:{fontSize:"24px",fontWeight:"700"}}),l.createElement(t.Row,{className:"border-none",key:"CS_INBOX_STATUS_FILTER",label:""+s("CS_INBOX_STATUS_FILTER"),text:s(h?"WS_COMMON_PAID_LABEL":"WS_COMMON_NOT_PAID"),textStyle:h?{color:"#00703C"}:{color:"#D4351C"}}))),null!=d&&null!==(a=d.additionalDetails)&&void 0!==a&&a.isAdhocRebate?l.createElement("div",{onClick:e=>{S(!0)}},l.createElement("span",{style:{cursor:"pointer",color:"#a82227"}},s("WS_PAYMENT_ADD_REBATE_PENALTY"))):null,A&&l.createElement(t.Modal,{headerBarMain:l.createElement(R,{label:s("PT_ADD_REBATE_PENALITY")}),headerBarEnd:l.createElement(x,{onClick:()=>{b(v),S(!1)}}),actionCancelLabel:s("PT_CANCEL"),actionCancelOnSubmit:()=>{b(v),S(!1)},actionSaveLabel:s("PT_ADD"),actionSaveOnSubmit:e=>(e=>{const t=null!=N&&N.adhocPenalty?Number(null==N?void 0:N.adhocPenalty):0,n=null!=N&&N.adhocRebate?Number(null==N?void 0:N.adhocRebate):0;var l,i;if(t||n)if(n>(null==d||null===(l=d.additionalDetails)||void 0===l||null===(i=l.data)||void 0===i?void 0:i.totalAmount))y({isError:!1,isWarning:!0,key:"error",message:s("ERR_WS_REBATE_GREATER_THAN_AMOUNT")});else{var o,a,r,u,v,p,f,g,h,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,n=c({},null==d||null===(v=d.additionalDetails)||void 0===v||null===(p=v.appDetails)||void 0===p?void 0:p.additionalDetails,N);d.additionalDetails.appDetails.additionalDetails=n;const l={CalculationCriteria:"WATER"==(null==d||null===(f=d.additionalDetails)||void 0===f||null===(g=f.appDetails)||void 0===g?void 0:g.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===(h=d.additionalDetails)||void 0===h||null===(A=h.appDetails)||void 0===A?void 0:A.service)?"WS":"SW";Digit.WSService.wsCalculationEstimate(l,i).then((e,t)=>{var n,l,i,o,a,r,u,d,s,c,v,p,f,g,h;(null==e||null===(n=e.Calculation)||void 0===n||null===(l=n[0])||void 0===l||null===(i=l.taxHeadEstimates)||void 0===i?void 0:i.length)>0&&(null==e||null===(f=e.Calculation)||void 0===f||null===(g=f[0])||void 0===g||null===(h=g.taxHeadEstimates)||void 0===h||h.forEach(e=>e.amount=e.estimateAmount)),e.Calculation[0].billSlabData=_.groupBy(null==e||null===(o=e.Calculation)||void 0===o||null===(a=o[0])||void 0===a?void 0:a.taxHeadEstimates,"category");const A=[{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}];E(ht(e.Calculation[0])),L(null==e||null===(p=e.Calculation)||void 0===p?void 0:p[0]),T(A),N.billDetails=null==e?void 0:e.Calculation,m(N),S(!1)}).catch(e=>{var t,n,l,i,o,a;y({isError:!0,isWarning:!1,key:"error",message:null!=e&&null!==(t=e.response)&&void 0!==t&&null!==(n=t.data)&&void 0!==n&&null!==(l=n.Errors[0])&&void 0!==l&&l.message?s(""+(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)):s("PT_COMMON_ADD_REBATE_PENALITY")})})}else y({isError:!1,isWarning:!0,key:"warning",message:s("ERR_WS_ENTER_ATLEAST_ONE_FIELD")})})(),hideSubmit:!1,popupStyles:{overflowY:"auto"}},l.createElement("div",null,l.createElement(t.Card,{style:{padding:"10px 10px 1px 10px",margin:"0px 0px 15px 0px"}},l.createElement(t.CardSectionHeader,{style:{fontSize:"16px",fontWeight:"700",lineHeight:"18px",padding:"0px",margin:"0px 0px 10px 0px"}},s("PT_AD_PENALTY")),l.createElement(t.CardLabel,null,s("PT_TX_HEADS")),l.createElement("div",{className:"field"},l.createElement(t.Dropdown,{isMandatory:!0,option:$n,optionKey:"title",select:e=>B("adhocPenaltyReason",!0,e),selected:(null==N?void 0:N.adhocPenaltyReason_data)||"",isPropertyAssess:!0,name:"adhocPenaltyReason_data",t:s})),"PT_OTHERS"===(null==N||null===(r=N.adhocPenaltyReason_data)||void 0===r?void 0:r.title)&&l.createElement("div",{className:"field"},l.createElement(t.CardLabel,null,s("PT_REASON")),l.createElement("div",{className:"field"},l.createElement(t.TextInput,c({style:{background:"#FAFAFA"},t:s,type:"text",isMandatory:!1,name:"adhocPenaltyComment",value:(null==N?void 0:N.adhocPenaltyComment)||"",onChange:e=>B("adhocPenaltyComment",!1,e)},w={isRequired:!0,pattern:"^[a-zA-Z ]*$",type:"text",title:s("TL_NAME_ERROR_MESSAGE")})))),l.createElement(t.CardLabel,null,s("PT_HEAD_AMT")),l.createElement("div",{className:"field"},l.createElement(t.TextInput,c({style:{background:"#FAFAFA"},t:s,type:"number",isMandatory:!1,name:"adhocPenalty",value:(null==N?void 0:N.adhocPenalty)||"",onChange:e=>B("adhocPenalty",!1,e)},w={isRequired:!0,pattern:"^[1-9]+[0-9]*$",title:s("ERR_DEFAULT_INPUT_FIELD_MSG")})))),l.createElement(t.Card,{style:{padding:"10px 10px 1px 10px",margin:"0px 0px 15px 0px"}},l.createElement(t.CardSectionHeader,{style:{fontSize:"16px",fontWeight:"700",lineHeight:"18px",padding:"0px",margin:"0px 0px 10px 0px"}},s("PT_AD_REBATE")),l.createElement(t.CardLabel,null,s("PT_TX_HEADS")),l.createElement("div",{className:"field"},l.createElement(t.Dropdown,{isMandatory:!0,option:el,optionKey:"title",select:e=>B("adhocRebateReason",!0,e),selected:(null==N?void 0:N.adhocRebateReason_data)||"",name:"adhocRebateReason_data",isPropertyAssess:!0,t:s})),"PT_OTHERS"===(null==N||null===(u=N.adhocRebateReason_data)||void 0===u?void 0:u.title)&&l.createElement("div",{className:"field"},l.createElement(t.CardLabel,null,s("PT_REASON")),l.createElement(t.TextInput,c({style:{background:"#FAFAFA"},t:s,type:"text",isMandatory:!1,name:"adhocRebateComment",value:(null==N?void 0:N.adhocRebateComment)||"",onChange:e=>B("adhocRebateComment",!1,e)},w={isRequired:!0,pattern:"^[a-zA-Z ]*$",type:"text",title:s("TL_NAME_ERROR_MESSAGE")}))),l.createElement(t.CardLabel,null,s("PT_HEAD_AMT")),l.createElement("div",{className:"field"},l.createElement(t.TextInput,c({style:{background:"#FAFAFA"},t:s,type:"number",isMandatory:!1,name:"adhocRebate",value:(null==N?void 0:N.adhocRebate)||"",onChange:e=>B("adhocRebate",!1,e)},w={isRequired:!0,pattern:"^[1-9]+[0-9]*$",title:s("ERR_DEFAULT_INPUT_FIELD_MSG")})))))," "),C&&l.createElement(t.Toast,{style:{zIndex:"10000"},warning:null==C?void 0:C.isWarning,error:null==C||!C.isWarning,label:s(null==C?void 0:C.message),onClose:()=>{y(!1)},isDleteBtn:!0})))},nl=e=>{var i,a,r,u,d,s,c;let{wsAdditionalDetails:v}=e;const{t:m}=o.useTranslation(),[p,f]=n.useState(!1),[E,g]=n.useState({}),_=e=>l.createElement("h1",{className:"heading-m"},e.label),h=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),A=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(h,null));return l.createElement(n.Fragment,null,l.createElement("div",{style:{lineHeight:"19px",maxWidth:"950px",minWidth:"280px"}},null!=v&&null!==(i=v.additionalDetails)&&void 0!==i&&i.isViewBreakup?l.createElement("div",{onClick:e=>(()=>{var e;let t=v.additionalDetails.data||{};const n=sessionStorage.getItem("Digit.ADHOC_BILL_ADD_REBATE_DATA"),l=n?JSON.parse(n):{};null!=l&&null!==(e=l.value)&&void 0!==e&&e.totalAmount&&(t=null==l?void 0:l.value),g(t),f(!0)})(),style:{marginTop:"12px"}},l.createElement("span",{style:{cursor:"pointer",color:"#a82227"}},m("WS_PAYMENT_VIEW_BREAKUP"))):null,p&&l.createElement(t.Modal,{headerBarMain:l.createElement(_,{label:m("WS_CALCULATION_BREAKUP")}),headerBarEnd:l.createElement(A,{onClick:()=>{f(!1)}}),hideSubmit:!0,popupStyles:{overflowY:"auto"},headerBarMainStyle:{marginBottom:"0px"},popupModuleMianStyles:{paddingTop:"0px"}},l.createElement(t.StatusTable,{style:{padding:"10px",paddingTop:"0px"}},l.createElement(t.CardSectionHeader,{style:{margin:"10px 0px"}},m("WS_APPLICATION_FEE_HEADER")),null==E||null===(a=E.billSlabData)||void 0===a||null===(r=a.FEE)||void 0===r?void 0:r.map(e=>l.createElement(t.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:""+(null==e?void 0:e.taxHeadCode),label:""+m(""+(null==e?void 0:e.taxHeadCode)),text:l.createElement("span",null,"₹",Number(null==e?void 0:e.amount)||0),textStyle:{textAlign:"right"}})),l.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",marginBottom:"10px"}}),l.createElement(t.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:"PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT1",label:""+m("PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT"),text:l.createElement("span",null,"₹",Number(null==E?void 0:E.fee)||0),textStyle:{textAlign:"right",fontWeight:"700",fontSize:"24px"}}),l.createElement(t.CardSectionHeader,{style:{margin:"10px 0px"}},m("WS_SERVICE_FEE_HEADER")),null==E||null===(u=E.billSlabData)||void 0===u||null===(d=u.CHARGES)||void 0===d?void 0:d.map(e=>l.createElement(t.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:""+(null==e?void 0:e.taxHeadCode),label:""+m(""+(null==e?void 0:e.taxHeadCode)),text:l.createElement("span",null,"₹",Number(null==e?void 0:e.amount)||0),textStyle:{textAlign:"right"}})),l.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",marginBottom:"10px"}}),l.createElement(t.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:"PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT2",label:""+m("PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT"),text:l.createElement("span",null,"₹",Number(null==E?void 0:E.charge)||0),textStyle:{textAlign:"right",fontWeight:"700",fontSize:"24px"}}),null==E||null===(s=E.billSlabData)||void 0===s||null===(c=s.TAX)||void 0===c?void 0:c.map(e=>l.createElement(t.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:""+(null==e?void 0:e.taxHeadCode),label:""+m(""+(null==e?void 0:e.taxHeadCode)),text:l.createElement("span",null,"₹",Number(null==e?void 0:e.amount)||0),textStyle:{textAlign:"right"}})),l.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",marginBottom:"10px"}}),l.createElement(t.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:"PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT3",label:""+m("PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT"),text:l.createElement("span",null,"₹",Number(null==E?void 0:E.totalAmount)||0),textStyle:{textAlign:"right",fontWeight:"700",fontSize:"24px"}})))))},ll={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:{}},il=e=>{let{className:t="table",headers:n=[],values:i=[],arrears:a=0}=e;const{t:r}=o.useTranslation();return l.createElement(l.Fragment,null,l.createElement("div",{style:ll.root},l.createElement("table",{className:"table-fixed-column-common-pay",style:ll.table},l.createElement("thead",null,l.createElement("tr",null,l.createElement("th",{style:c({},ll.cell,ll.cellLeft,ll.cellHeader)},r("CS_BILL_PERIOD")),n.map((e,t)=>l.createElement("th",{style:c({},ll.cell,n.length==t+1?ll.cellRight:{},ll.cellHeader),key:t},r(e))))),l.createElement("tbody",null,Object.values(i).map((e,t)=>l.createElement("tr",{key:t},l.createElement("td",{style:c({},ll.cell,ll.cellLeft),component:"th",scope:"row"},Object.keys(i)[t]),n.map((t,i)=>l.createElement("td",{style:c({},ll.cell,{textAlign:"left"},n.length==i+1?ll.cellRight:{},{whiteSpace:"pre"}),key:i,numeric:!0},i>1&&"₹",e[t]&&e[t].value||"0")))),l.createElement("tr",null,l.createElement("td",{style:c({},ll.cell,ll.cellLeft)}),n.map((e,t)=>t==n.length-1?l.createElement("td",{style:c({},ll.cell,ll.cellRight,{textAlign:"left",fontWeight:"700",whiteSpace:"pre"}),key:t,numeric:!0},a):t==n.length-2?l.createElement("td",{style:c({},ll.cell,{textAlign:"left"}),key:t,numeric:!0},r("COMMON_ARREARS_TOTAL")):l.createElement("td",{style:ll.cell,key:t,numeric:!0})))))))},ol={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))"}},al=e=>{var t,i,a;let{bill:r={}}=e;const{t:u}=o.useTranslation();let d={},s=(null==r||null===(t=r.billDetails)||void 0===t?void 0:t.sort((e,t)=>t.fromPeriod-e.fromPeriod))||[];s=[...s];const c=(null===(i=s)||void 0===i?void 0:i.reduce((e,t,n)=>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,n,l;void 0===e&&(e={});let i={};const{billAccountDetails:o=[]}=e;return o.map(e=>{i[e.taxHeadCode]={value:e.amount,order:e.order}}),i.CS_BILL_NO={value:(null===(t=e)||void 0===t?void 0:t.billNumber)||"NA",order:-2},i.CS_BILL_DUEDATE={value:(null===(n=e)||void 0===n?void 0:n.expiryDate)&&new Date(null===(l=e)||void 0===l?void 0:l.expiryDate).toLocaleDateString()||"NA",order:-1},i.TL_COMMON_TOTAL_AMT={value:e.amount,order:10},i}(e);d[((e,t)=>{const n=new Date(e),l=new Date(t);return l.getYear()-n.getYear()!=0?"FY"+(n.getYear()+1900)+"-"+(l.getYear()-100):n.toLocaleDateString()+"-"+l.toLocaleDateString()})(e.fromPeriod,e.toPeriod)]=t});let m={};!d||Object.keys(d).map((e,t)=>{Object.keys(d[e]).map(t=>{m[t]=d[e]&&d[e][t]&&d[e][t].order||0})});let p=[];p=Object.keys(m),p.sort((e,t)=>m[e]-m[t]);const[f,E]=n.useState(!1);return 0==c||c<0?l.createElement("span",null):l.createElement(l.Fragment,null,l.createElement("div",{style:ol.headerStyle},u("CS_ARREARS_DETAILS")),f&&l.createElement(il,{headers:[...p],values:d,arrears:v}),!f&&l.createElement("div",{style:ol.buttonStyle},l.createElement("button",{type:"button",onClick:()=>{E(!0)}},u("CS_SHOW_CARD"))),f&&l.createElement("div",{style:ol.buttonStyle},l.createElement("button",{type:"button",onClick:()=>{E(!1)}},u("CS_HIDE_CARD"))))},rl=e=>{let{assessmentData:t}=e;const[i,o]=n.useState(!1);return l.createElement("div",{className:"accordion",style:{width:"100%",margin:"auto",fontFamily:"Roboto, sans-serif",border:"1px solid #ccc",borderRadius:"4px",marginBottom:"10px"}},l.createElement("div",{className:"accordion-header",style:{backgroundColor:"#f0f0f0",padding:"15px",cursor:"pointer"},onClick:()=>{o(!i)}},l.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"}},l.createElement("h3",{style:{color:"#0d43a7",fontFamily:"Noto Sans,sans-serif",fontSize:"24px",fontWeight:"500"}},"Assessment History"),l.createElement("span",{style:{fontSize:"1.2em"}},i?"<":">"))),i&&l.createElement("div",{className:"accordion-body",style:{padding:" 15px",backgroundColor:"#fff"}},t.map((e,n)=>l.createElement("div",{key:n,className:"assessment-item",style:{marginBottom:"15px"}},l.createElement("div",{className:"assessment-row",style:{display:"flex",gap:"100px",marginBottom:"8px"}},l.createElement("span",{style:{fontWeight:"bold",minWidth:"60px",color:"black"}},"Assessment Date"),l.createElement("span",{style:{flex:"1",color:"black"}},new Date(e.assessmentDate).toLocaleDateString("en-GB",{day:"2-digit",month:"short",year:"numeric"}).replace(/ /g,"-"))),l.createElement("div",{className:"assessment-row",style:{display:"flex",gap:"100px",marginBottom:"8px",color:"black"}},l.createElement("span",{className:"label",style:{fontWeight:"bold",minWidth:"60px",color:"black"}},"Assessment Year"),l.createElement("span",{className:"value",style:{flex:"1",color:"black"}},e.financialYear)),l.createElement("div",{className:"assessment-row with-buttons",style:{display:"flex",marginBottom:"8px",justifyContent:"space-between",alignItems:"center"}},l.createElement("div",{style:{display:"flex",gap:"75px"}},l.createElement("span",{className:"label",style:{fontWeight:"bold",minWidth:"60px",color:"black"}},"Assessment Number"),l.createElement("span",{className:"value",style:{flex:"1",color:"black"}},e.assessmentNumber)),l.createElement("div",{className:"button-group",style:{display:"flex",gap:"10px"}}," ",l.createElement("button",{style:{display:"flex",borderRadius:"8px",backgroundColor:"#2947a3",padding:"10px",color:"white"},onClick:()=>alert("Re-assessing "+e.number)},"Re-assess")," ",l.createElement("button",{style:{display:"flex",borderRadius:"8px",border:"1px solid red",padding:"10px"},onClick:()=>alert("Cancelled "+e.number)},"Cancel")," ")),n!==t.length-1&&l.createElement("hr",null)))))},ul=e=>{var t;let{applicationData:o}=e;const[a,r]=n.useState(!1);return i.useHistory(),l.createElement("div",{className:"accordion",style:{width:"100%",margin:"auto",fontFamily:"Roboto, sans-serif",border:"1px solid #ccc",borderRadius:"4px",marginBottom:"10px"}},l.createElement("div",{className:"accordion-header",style:{backgroundColor:"#f0f0f0",padding:"15px",cursor:"pointer"},onClick:()=>{r(!a)}},l.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"}},l.createElement("h3",{style:{color:"#0d43a7",fontFamily:"Noto Sans,sans-serif",fontSize:"24px",fontWeight:"500"}},"Application History"),l.createElement("span",{style:{fontSize:"1.2em"}},a?"<":">"))),a&&l.createElement("div",{className:"accordion-body",style:{padding:" 15px",backgroundColor:"#fff"}},l.createElement("div",{className:"assessment-item",style:{marginBottom:"15px"}},l.createElement("div",{className:"assessment-row",style:{display:"flex",gap:"100px",marginBottom:"8px"}},l.createElement("span",{style:{fontWeight:"bold",minWidth:"60px",color:"black"}},"Application Number"),l.createElement("span",{style:{flex:"1",color:"black"}},o.acknowldgementNumber)),l.createElement("div",{className:"assessment-row",style:{display:"flex",gap:"132px",marginBottom:"8px",color:"black"}},l.createElement("span",{className:"label",style:{fontWeight:"bold",minWidth:"60px",color:"black"}},"Property ID No."),l.createElement("span",{className:"value",style:{flex:"1",color:"black"}},o.propertyId)),l.createElement("div",{className:"assessment-row",style:{display:"flex",gap:"120px",marginBottom:"8px",color:"black"}},l.createElement("span",{className:"label",style:{fontWeight:"bold",minWidth:"60px",color:"black"}},"Application Type"),l.createElement("span",{className:"value",style:{flex:"1",color:"black"}},"NEW PROPERTY")),l.createElement("div",{className:"assessment-row",style:{display:"flex",gap:"140px",marginBottom:"8px",color:"black"}},l.createElement("span",{className:"label",style:{fontWeight:"bold",minWidth:"60px",color:"black"}},"Creation Date"),l.createElement("span",{className:"value",style:{flex:"1",color:"black"}},(u=null===(t=o.auditDetails)||void 0===t?void 0:t.createdTime,new Date(u).toLocaleDateString("en-GB",{day:"2-digit",month:"short",year:"numeric"}).replace(/ /g,"-")))),l.createElement("div",{className:"assessment-row",style:{display:"flex",gap:"180px",marginBottom:"8px",color:"black"}},l.createElement("span",{className:"label",style:{fontWeight:"bold",minWidth:"60px",color:"black"}},"Status"),l.createElement("span",{className:"value",style:{flex:"1",color:"black"}},o.status)),l.createElement("div",null,l.createElement(i.Link,{to:{pathname:"/digit-ui/citizen/pt/property/application-preview/"+o.acknowldgementNumber,state:{propertyId:o.propertyId}},style:{color:"#2947a3",display:"inline",border:"1px solid",padding:"8px",borderRadius:"8px"}},"View History")))));var u},dl=e=>{let{payments:t}=e;const[i,o]=n.useState(!1);return l.createElement("div",{className:"accordion",style:{width:"100%",margin:"auto",fontFamily:"Roboto, sans-serif",border:"1px solid #ccc",borderRadius:"4px",marginBottom:"10px"}},l.createElement("div",{className:"accordion-header",style:{backgroundColor:"#f0f0f0",padding:"15px",cursor:"pointer"},onClick:()=>{o(!i)}},l.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"}},l.createElement("h3",{style:{color:"#0d43a7",fontFamily:"Noto Sans,sans-serif",fontSize:"24px",fontWeight:"500"}},"Payment History"),l.createElement("span",{style:{fontSize:"1.2em"}},i?"<":">"))),i&&l.createElement("div",{className:"accordion-body",style:{padding:" 15px",backgroundColor:"#fff"}},0===(null==t?void 0:t.length)&&l.createElement("div",{style:{color:"red",fontSize:"16px"}},"No Payments found"),(null==t?void 0:t.length)>0&&l.createElement("div",null,l.createElement("table",{style:{width:"100%",borderCollapse:"collapse",marginTop:"10px"}},l.createElement("thead",null,l.createElement("tr",{style:{backgroundColor:"#f5f5f5"}},l.createElement("th",{style:{border:"1px solid #ddd",padding:"8px",textAlign:"left"}},"Receipt Number"),l.createElement("th",{style:{border:"1px solid #ddd",padding:"8px",textAlign:"left"}},"Transaction Date"),l.createElement("th",{style:{border:"1px solid #ddd",padding:"8px",textAlign:"left"}},"Amount Paid"),l.createElement("th",{style:{border:"1px solid #ddd",padding:"8px",textAlign:"left"}},"Payment Mode"),l.createElement("th",{style:{border:"1px solid #ddd",padding:"8px",textAlign:"left"}},"Transaction ID"),l.createElement("th",{style:{border:"1px solid #ddd",padding:"8px",textAlign:"left"}},"Status"))),l.createElement("tbody",null,t.map((e,t)=>{var n,i;return l.createElement("tr",{key:e.id||t},l.createElement("td",{style:{border:"1px solid #ddd",padding:"8px"}},(null===(n=e.paymentDetails)||void 0===n||null===(i=n[0])||void 0===i?void 0:i.receiptNumber)||e.receiptNumber||"N/A"),l.createElement("td",{style:{border:"1px solid #ddd",padding:"8px"}},e.transactionDate?new Date(e.transactionDate).toLocaleDateString():"N/A"),l.createElement("td",{style:{border:"1px solid #ddd",padding:"8px"}},"₹",e.totalAmountPaid||e.amount||"0"),l.createElement("td",{style:{border:"1px solid #ddd",padding:"8px"}},e.paymentMode||e.instrumentType||"N/A"),l.createElement("td",{style:{border:"1px solid #ddd",padding:"8px"}},e.transactionNumber||e.instrumentNumber||"N/A"),l.createElement("td",{style:{border:"1px solid #ddd",padding:"8px"}},l.createElement("span",{style:{color:"NEW"===e.paymentStatus||"SUCCESSFUL"===e.paymentStatus?"green":"FAILED"===e.paymentStatus?"red":"orange",fontWeight:"bold"}},e.paymentStatus||"N/A")))}))),l.createElement("div",{style:{marginTop:"10px",fontSize:"14px",color:"#666"}},"Total Payments: ",t.length))))};function sl(e){var a,r,u,d,s,v,m,p,f,E,g,h,A,S,N,b;let{applicationDetails:C,demandData:y,workflowDetails:D,isDataLoading:L,applicationData:O,timelineStatusPrefix:T,showTimeLine:I=!0,statusAttribute:w="status",paymentsList:R,oldValue:P,isInfoLabel:x=!1,propertyId:B,moduleCode:F}=e;const{t:M}=o.useTranslation(),U=i.useHistory(),k=Digit.ULBService.getCurrentTenantId(),[W,H]=n.useState(null),[j,z]=n.useState([]);let V=window.location.href.includes("editApplication")&&window.location.href.includes("bpa");function G(e,t,n){var l;window.open(null==n||null===(l=n.fullImage)||void 0===l?void 0:l[0],"_blank")}console.log(D,"TIMELINE"),n.useEffect(()=>{},[null==O?void 0:O.connectionNo,null==C?void 0:C.colletionOfData]);const[Y,K]=n.useState({}),[q,X]=n.useState(),[J,Q]=n.useState([]),[Z,$]=n.useState({loading:!1,loaded:!1,canLoad:!1});"ACTIVE"!=(null==O?void 0:O.status)||Z.loading||Z.loaded||Z.canLoad||$({loading:!1,loaded:!1,canLoad:!0}),null==Z||!Z.canLoad||Z.loading||Z.loaded||($({loading:!0,loaded:!1,canLoad:!0}),function(e,t,n,l){try{Promise.resolve(Digit.PTService.assessmentSearch({tenantId:e,filters:{propertyIds:t}})).then(function(i){function o(){n(a),l({loading:!1,loaded:!0,canLoad:!0})}let a={};const r=function(n){if((null==i||null===(n=i.Assessments)||void 0===n?void 0:n.length)>0){const n=i.Assessments.filter(e=>"ACTIVE"===e.status),l=new Map;n.forEach(e=>{const t=function(e){const t=new Date(e);return t.setHours(0,0,0,0),t.getTime()}(e.assessmentDate)+"_"+e.financialYear,n=l.get(t);(!n||e.createdDate>n.createdDate)&&l.set(t,e)});const o=Array.from(l.values());return Q(o),X(null==i?void 0:i.Assessments),Promise.resolve(Digit.PaymentService.fetchBill(e,{businessService:"PT",consumerCode:t})).then(function(e){a=e})}}();return r&&r.then?r.then(o):o()})}catch(e){return Promise.reject(e)}}((null==O?void 0:O.tenantId)||k,null==O?void 0:O.propertyId,K,$));const ee=e=>{if(null==e||null==e||""==e)return"NA";const t=new Date(e);let n=t.getMonth()+1,l=t.getDate();return n=(n>9?"":"0")+n,l=(l>9?"":"0")+l,l+"/"+n+"/"+t.getFullYear()},te=function(e,t,n){if(void 0===t&&(t=0),!e)return null;if("OPEN"===e.state||"INITIATED"===e.status&&!window.location.href.includes("/obps/")){var i;const e={date:ee(null==O||null===(i=O.auditDetails)||void 0===i?void 0:i.createdTime),source:(null==O?void 0:O.channel)||""};return l.createElement(Xn,{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,m,p,f,E,g,h,A,S,N,b,y,D;const i={uuid:(null==e||null===(o=e.assigner)||void 0===o?void 0:o.uuid)||(null==e||null===(a=e.assignes)||void 0===a||null===(r=a[0])||void 0===r?void 0:r.uuid),fieldName:"mobileNumber",model:"User",showValue:!1,loadData:{serviceName:"/egov-workflow-v2/egov-wf/process/_search",requestBody:{},requestParam:{tenantId:null==C?void 0:C.tenantId,businessIds:null==C?void 0:C.applicationNo,history:!0},jsonPath:"ProcessInstances[0].assignes[0].mobileNumber",isArray:!1,d:e=>{let n="";return n="+91 "+(_.get(e,"ProcessInstances["+t+"].assigner.mobileNumber")||_.get(e,"ProcessInstances["+t+"].assignes[0].mobileNumber")),n}}},L=n&&Array.isArray(n)&&t>0&&t-1<n.length?n[t-1]:null,T={date:null==e||null===(u=e.auditDetails)||void 0===u?void 0:u.lastModified,name:(null==e||null===(d=e.assigner)||void 0===d?void 0:d.name)||(null==e||null===(s=e.assignes)||void 0===s||null===(c=s[0])||void 0===c?void 0:c.name)||"N/A",mobileNumber:(null==O||null===(v=O.processInstance)||void 0===v||null===(m=v.assignes)||void 0===m||null===(p=m[0])||void 0===p?void 0:p.uuid)===(null==e||null===(f=e.assigner)||void 0===f?void 0:f.uuid)&&null!=O&&null!==(E=O.processInstance)&&void 0!==E&&null!==(g=E.assignes)&&void 0!==g&&null!==(h=g[0])&&void 0!==h&&h.mobileNumber?null==O||null===(A=O.processInstance)||void 0===A||null===(S=A.assignes)||void 0===S||null===(N=S[0])||void 0===N?void 0:N.mobileNumber:(null==e||null===(b=e.assigner)||void 0===b?void 0:b.mobileNumber)||(null==e||null===(y=e.assignes)||void 0===y||null===(D=y[0])||void 0===D?void 0:D.mobileNumber)||"N/A",comment:null!=e&&e.comment?M(e.comment):"",wfComment:L&&L.wfComment||[],thumbnailsToShow:(null==e?void 0:e.thumbnailsToShow)||[]};return l.createElement(Xn,{data:T,OpenImage:G,privacy:i})}{var L,T,I,w,R;const t={date:ee(null==O||null===(L=O.auditDetails)||void 0===L?void 0:L.lastModifiedTime),name:(null==e||null===(T=e.assignes)||void 0===T||null===(I=T[0])||void 0===I?void 0:I.name)||"N/A",wfComment:(null==e?void 0:e.wfComment)||[],mobileNumber:(null==e||null===(w=e.assignes)||void 0===w||null===(R=w[0])||void 0===R?void 0:R.mobileNumber)||"N/A"};return l.createElement(Xn,{data:t})}},ne=(e,t)=>e?t?e:M(e):M("NA"),le=window.location.href.includes("employee/tl")||window.location.href.includes("employee/obps")||window.location.href.includes("employee/noc"),ie=window.location.href.includes("employee/noc"),oe=window.location.href.includes("employee/obps"),ae=(window.location.href.includes("employee/ws"),()=>window.location.href.includes("employee/obps")||window.location.href.includes("employee/noc")||le?{justifyContent:"space-between",fontSize:"16px",lineHeight:"19px",color:"#0B0C0C"}:{}),re=e=>null!=e&&e.skip?e.value:null!=e&&e.isUnit?null!=e&&e.value?ne(null==e?void 0:e.value,null==e?void 0:e.isNotTranslated)+" "+M(null==e?void 0:e.isUnit):M("N/A"):null!=e&&e.value?ne(null==e?void 0:e.value,null==e?void 0:e.isNotTranslated):M("N/A"),[ue,de]=n.useState(!1),se=(null==y||y.reduce((e,t)=>e+t.demandInterest,0),null==y||y.reduce((e,t)=>e+t.demandPenality,0),null==y||y.reduce((e,t)=>e+t.collectionTax,0),null==y||y.reduce((e,t)=>e+t.collectionInterest,0),null==y||y.reduce((e,t)=>e+t.collectionPenality,0),null==y||y.reduce((e,t)=>e+t.balanceTax,0),null==y||y.reduce((e,t)=>e+t.balanceInterest,0),null==y||y.reduce((e,t)=>e+t.balancePenality,0),function(e,t,n){try{if(!window.confirm("Are you sure you want to make this property "+t+"?"))return Promise.resolve();const l=c({},e,{status:t,isactive:"ACTIVE"===t,isinactive:"INACTIVE"===t,creationReason:"STATUS",additionalDetails:c({},e.additionalDetails,{propertytobestatus:t}),workflow:c({},e.workflow,{businessService:"PT.CREATE",action:"OPEN",moduleName:"PT"})});return Promise.resolve(Digit.PTService.updatePT({Property:c({},l)},k,n)).then(function(){})}catch(e){return Promise.reject(e)}}),ce=null==C?void 0:C.applicationData,ve=(null==C||null===(a=C.applicationData)||void 0===a?void 0:a.propertyId)||"",me=null==C||null===(r=C.additionalDetails)||void 0===r?void 0:r.propertytobestatus;return n.useEffect(()=>{try{if("WS"===F)return;let e={consumerCodes:B};const t=!0;"BPREG"===F?Digit.OBPSService.paymentsearch({tenantId:k,filters:e,auth:t}).then(e=>{z(null==e?void 0:e.Payments)}):Digit.PTService.paymentsearch({tenantId:k,filters:e,auth:t}).then(e=>{z(null==e?void 0:e.Payments)})}catch(e){}},[]),l.createElement(t.Card,{style:{position:"relative"},className:"employeeCard-override"},null==C||null===(u=C.applicationDetails)||void 0===u?void 0:u.map((e,o)=>{var a,r,u,d,s,c,v,m,p,f,E,g,_,h,A,S,N,b,y,L,O,T,I,w,x,B,F,U,k,W,H,j,z,G,K,q,X,J;return l.createElement(l.Fragment,{key:o},l.createElement("div",{style:window.location.href.includes("employee/obps")||window.location.href.includes("employee/noc")||window.location.href.includes("employee/ws")?{lineHeight:"19px",maxWidth:"950px",minWidth:"280px"}:le?{lineHeight:"19px",maxWidth:"600px",minWidth:"280px"}:{}},0!==o||e.asSectionHeader?l.createElement(l.Fragment,null,l.createElement(t.CardSectionHeader,{style:0==o&&le?{marginBottom:"16px",fontSize:"24px"}:{marginBottom:"16px",marginTop:"32px",fontSize:"24px"}},ie?""+M(e.title):M(e.title),null!=e&&e.Component?l.createElement(e.Component,null):null)):l.createElement(t.CardSubHeader,{style:{marginBottom:"16px",fontSize:"24px"}},M(e.title)),(null==e?void 0:e.isTable)&&l.createElement("table",{style:{tableLayout:"fixed",width:"100%",borderCollapse:"collapse"}},l.createElement("tr",{style:{textAlign:"left"}},null==e?void 0:e.headers.map(e=>l.createElement("th",{style:{padding:"10px",paddingLeft:"0px"}},M(e)))),null==e?void 0:e.tableRows.map((t,i)=>i===(null==e?void 0:e.tableRows.length)-1?l.createElement(n.Fragment,null,l.createElement("hr",{style:{width:"370%",marginTop:"15px"},className:"underline"}),l.createElement("tr",null,t.map(e=>l.createElement("td",{style:{textAlign:"left"}},M(e))))):l.createElement("tr",null,t.map(e=>l.createElement("td",{style:{paddingTop:"20px",textAlign:"left"}},M(e)))))),l.createElement(t.StatusTable,{style:window.location.href.includes("employee/obps")||window.location.href.includes("employee/noc")||le?{position:"relative",marginTop:"19px"}:{}},(null==e?void 0:e.title)&&!(null!=e&&e.title.includes("NOC"))&&(null==e||null===(a=e.values)||void 0===a?void 0:a.map((n,o)=>{var a,r,u;return!0===n.map&&"N/A"!==n.value?l.createElement(t.Row,{labelStyle:{wordBreak:"break-all"},textStyle:{wordBreak:"break-all"},key:M(n.title),label:M(n.title),text:l.createElement("img",{src:M(n.value),alt:"",privacy:null==n?void 0:n.privacy})}):1==(null==n?void 0:n.isLink)?l.createElement(t.Row,{key:M(n.title),label:window.location.href.includes("tl")||window.location.href.includes("ws")?l.createElement("div",{style:{width:"200%"}},l.createElement(i.Link,{to:null==n?void 0:n.to},l.createElement("span",{className:"link",style:{color:"#a82227"}},M(null==n?void 0:n.title)))):ie||oe?""+M(n.title):M(n.title),text:l.createElement("div",null,l.createElement(i.Link,{to:null==n?void 0:n.to},l.createElement("span",{className:"link",style:{color:"#a82227"}},null==n?void 0:n.value))),last:o===(null==e||null===(u=e.values)||void 0===u?void 0:u.length)-1,caption:n.caption,className:"border-none",rowContainerStyle:ae(),labelStyle:{wordBreak:"break-all"},textStyle:{wordBreak:"break-all"}}):l.createElement("div",null,window.location.href.includes("modify")?l.createElement(t.Row,{className:"border-none",key:""+n.title,label:""+M(""+n.title),privacy:null==n?void 0:n.privacy,text:null!=n&&n.oldValue?null==n?void 0:n.oldValue:null!=n&&n.value?null==n?void 0:n.value:"",labelStyle:{wordBreak:"break-all"},textStyle:{wordBreak:"break-all"}}):l.createElement(t.Row,{key:M(n.title),label:M(n.title),text:re(n),last:o===(null==e||null===(a=e.values)||void 0===a?void 0:a.length)-1,caption:n.caption,className:"border-none",privacy:null==n?void 0:n.privacy,rowContainerStyle:ae(),labelStyle:{wordBreak:"break-all"},textStyle:{wordBreak:"break-all"}}),"PT_TOTAL_DUES"===n.title?l.createElement(al,{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(Yn,{scrutinyDetails:null==e?void 0:e.additionalDetails,paymentsList:R,additionalDetails:null==C||null===(u=C.applicationData)||void 0===u?void 0:u.additionalDetails,applicationData:null==C?void 0:C.applicationData}),(null==C||null===(d=C.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(kn,{fiReport:null==C||null===(m=C.applicationData)||void 0===m||null===(p=m.additionalDetails)||void 0===p?void 0:p.fieldinspection_pending}),(null==e||null===(f=e.additionalDetails)||void 0===f?void 0:f.floors)&&l.createElement(Vn,{floors:null==e||null===(E=e.additionalDetails)||void 0===E?void 0:E.floors}),(null==e||null===(g=e.additionalDetails)||void 0===g?void 0:g.owners)&&l.createElement(Gn,{owners:null==e||null===(_=e.additionalDetails)||void 0===_?void 0:_.owners}),(null==e||null===(h=e.additionalDetails)||void 0===h?void 0:h.units)&&l.createElement(Qn,{units:null==e||null===(A=e.additionalDetails)||void 0===A?void 0:A.units}),(null==e||null===(S=e.additionalDetails)||void 0===S?void 0:S.accessories)&&l.createElement(Jn,{units:null==e||null===(N=e.additionalDetails)||void 0===N?void 0:N.accessories}),!V&&(null==e||null===(b=e.additionalDetails)||void 0===b?void 0:b.permissions)&&(null==D||null===(y=D.data)||void 0===y||null===(L=y.nextActions)||void 0===L?void 0:L.length)>0&&l.createElement(jn,{applicationData:null==C?void 0:C.applicationData,t:M,permissions:null==e||null===(O=e.additionalDetails)||void 0===O?void 0:O.permissions}),(null==e||null===(T=e.additionalDetails)||void 0===T?void 0:T.obpsDocuments)&&l.createElement("div",{style:{display:"flex"}},l.createElement(Mn,{t:M,applicationData:null==C?void 0:C.applicationData,docs:e.additionalDetails.obpsDocuments,bpaActionsDetails:D})),(null==e||null===(I=e.additionalDetails)||void 0===I?void 0:I.noc)&&l.createElement(Hn,{t:M,isNoc:!0,NOCdata:e.values,applicationData:null==C?void 0:C.applicationData,docs:e.additionalDetails.noc,noc:null===(w=e.additionalDetails)||void 0===w?void 0:w.data,bpaActionsDetails:D}),(null==e||null===(x=e.additionalDetails)||void 0===x?void 0:x.scruntinyDetails)&&l.createElement(Yn,{scrutinyDetails:null==e?void 0:e.additionalDetails}),(null==e||null===(B=e.additionalDetails)||void 0===B?void 0:B.buildingExtractionDetails)&&l.createElement(Yn,{scrutinyDetails:null==e?void 0:e.additionalDetails}),(null==e||null===(F=e.additionalDetails)||void 0===F?void 0:F.subOccupancyTableDetails)&&l.createElement(Kn,{edcrDetails:null==e?void 0:e.additionalDetails,applicationData:null==C?void 0:C.applicationData}),(null==e||null===(U=e.additionalDetails)||void 0===U?void 0:U.documentsWithUrl)&&l.createElement(Fn,{documents:null==e||null===(k=e.additionalDetails)||void 0===k?void 0:k.documentsWithUrl}),(null==e||null===(W=e.additionalDetails)||void 0===W?void 0:W.taxHeadEstimatesCalculation)&&l.createElement(zn,{taxHeadEstimatesCalculation:null==e||null===(H=e.additionalDetails)||void 0===H?void 0:H.taxHeadEstimatesCalculation}),(null==e?void 0:e.isWaterConnectionDetails)&&l.createElement(Zn,{wsAdditionalDetails:e,oldValue:P}),(null==e||null===(j=e.additionalDetails)||void 0===j?void 0:j.redirectUrl)&&l.createElement("div",{style:{fontSize:"16px",lineHeight:"24px",fontWeight:"400",padding:"10px 0px"}},l.createElement(i.Link,{to:null==e||null===(z=e.additionalDetails)||void 0===z||null===(G=z.redirectUrl)||void 0===G?void 0:G.url},l.createElement("span",{className:"link",style:{color:"#a82227"}},null==e||null===(K=e.additionalDetails)||void 0===K||null===(q=K.redirectUrl)||void 0===q?void 0:q.title))),(null==e||null===(X=e.additionalDetails)||void 0===X?void 0:X.estimationDetails)&&l.createElement(tl,{wsAdditionalDetails:e,workflowDetails:D}),(null==e||null===(J=e.additionalDetails)||void 0===J?void 0:J.estimationDetails)&&l.createElement(nl,{wsAdditionalDetails:e,workflowDetails:D}))}),(null==q?void 0:q.length)>0&&l.createElement(rl,{assessmentData:J}),l.createElement(dl,{payments:j}),"WS"!==F&&l.createElement(ul,{applicationData:null==C?void 0:C.applicationData}),I&&(null==D||null===(d=D.data)||void 0===d||null===(s=d.timeline)||void 0===s?void 0:s.length)>0&&l.createElement(l.Fragment,null,l.createElement(t.BreakLine,null),((null==D?void 0:D.isLoading)||L)&&l.createElement(t.Loader,null),!(null!=D&&D.isLoading)&&!L&&l.createElement(n.Fragment,null,l.createElement("div",{id:"timeline"},l.createElement(t.CardSectionHeader,{style:{marginBottom:"16px",marginTop:"32px"}},M("ES_APPLICATION_DETAILS_APPLICATION_TIMELINE")),null!=D&&null!==(v=D.data)&&void 0!==v&&v.timeline&&1===(null==D||null===(m=D.data)||void 0===m||null===(p=m.timeline)||void 0===p?void 0:p.length)?l.createElement(t.CheckPoint,{isCompleted:!0,label:M(""+T+(null==D||null===(f=D.data)||void 0===f||null===(E=f.timeline[0])||void 0===E?void 0:E.state)),customChild:te(null==D||null===(g=D.data)||void 0===g?void 0:g.timeline[0],null==D||null===(h=D.data)||void 0===h?void 0:h.timeline)}):l.createElement(t.ConnectingCheckPoints,null,(null==D||null===(A=D.data)||void 0===A?void 0:A.timeline)&&(null==D||null===(S=D.data)||void 0===S?void 0:S.timeline.slice(0,ue?null==D?void 0:D.data.timeline.length:2).map((e,n,i)=>{var o;let a="";var r,u,d,s,c,v;return window.location.href.includes("/obps/")&&(a=null!=D&&null!==(r=D.data)&&void 0!==r&&null!==(u=r.timeline[n-1])&&void 0!==u&&null!==(d=u.state)&&void 0!==d&&d.includes("BACK_FROM")||null!=D&&null!==(s=D.data)&&void 0!==s&&null!==(c=s.timeline[n-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==n?"":"_DONE"),l.createElement(l.Fragment,{key:n},l.createElement(t.CheckPoint,{keyValue:n,isCompleted:0===n,info:e.comment,label:M(""+T+("REOPEN"===(null==e?void 0:e.performedAction)?null==e?void 0:e.performedAction:null==e?void 0:e[w])+a),customChild:te(e,n,null==D||null===(o=D.data)||void 0===o?void 0:o.timeline)}))}))),(null==D||null===(N=D.data)||void 0===N||null===(b=N.timeline)||void 0===b?void 0:b.length)>2&&l.createElement(t.LinkButton,{label:M(ue?"COLLAPSE":"VIEW_TIMELINE"),onClick:()=>{de(e=>!e)}})))),window.location.href.includes("/pt/")?l.createElement(t.ActionBar,{className:"clear-search-container",style:{display:"block"}},l.createElement(t.SubmitBar,{label:"Make Property Active",style:{flex:1},onSubmit:()=>{window.location.href.includes("employee")?"INACTIVE"==me?se(ce,"ACTIVE",ve):alert("Property is already active."):alert("You are not authorized to change the property status.")}}),l.createElement(t.SubmitBar,{label:"Make Property Inactive",style:{marginLeft:"20px"},onSubmit:()=>{window.location.href.includes("employee")?"ACTIVE"==me?se(ce,"INACTIVE",ve):alert("Property is already inactive."):alert("You are not authorized to change the property status.")}}),l.createElement(t.SubmitBar,{label:"Edit Property",style:{marginLeft:"20px"},onSubmit:()=>{var e;const t=null==C||null===(e=C.applicationData)||void 0===e?void 0:e.propertyId;if(t)if(window.location.href.includes("employee")){var n,l,i;if("INACTIVE"===(null==C||null===(n=C.applicationData)||void 0===n?void 0:n.status))return void alert("Property is inactive, cannot edit.");if("INWORKFLOW"===(null==C||null===(l=C.applicationData)||void 0===l?void 0:l.status))return void alert("Property is in workflow, cannot edit.");"ACTIVE"===(null==C||null===(i=C.applicationData)||void 0===i?void 0:i.status)&&U.push({pathname:"/digit-ui/employee/pt/edit-application/"+t})}else{var o,a,r;if("INACTIVE"===(null==C||null===(o=C.applicationData)||void 0===o?void 0:o.status))return void alert("Property is inactive, cannot edit.");if("INWORKFLOW"===(null==C||null===(a=C.applicationData)||void 0===a?void 0:a.status))return void alert("Property is in workflow, cannot edit.");"ACTIVE"===(null==C||null===(r=C.applicationData)||void 0===r?void 0:r.status)&&U.push({pathname:"/digit-ui/citizen/pt/property/edit-application/"+t})}}}),l.createElement(t.SubmitBar,{label:"Access Property",style:{marginLeft:"20px"},onSubmit:()=>{alert("access property")}})):l.createElement("div",null),W&&l.createElement(t.Toast,{error:W.isError,label:M(W.label),onClose:()=>{H(null)},isDleteBtn:"false"}))}function cl(e){var n,i,o,a,r,u,d,s,c,v,m,p,f,E,g,_,h,A;let{t:S,showToast:N,closeToast:b,businessService:C}=e;if(null!=C&&C.includes("NewTL")||null!=C&&C.includes("TL")||null!=C&&C.includes("EDITRENEWAL")){var y;let e="";switch(null==N||null===(y=N.action)||void 0===y?void 0:y.action){case"SENDBACK":e="error"===(null==N?void 0:N.key)?null==N||null===(n=N.error)||void 0===n?void 0:n.message:S("TL_SENDBACK_CHECKLIST_MESSAGE_HEAD");break;case"FORWARD":e="error"===(null==N?void 0:N.key)?null==N||null===(i=N.error)||void 0===i?void 0:i.message:S("TL_FORWARD_SUCCESS_MESSAGE_MAIN");break;case"APPROVE":e="error"===(null==N?void 0:N.key)?null==N||null===(o=N.error)||void 0===o?void 0:o.message:S("TL_APPROVAL_CHECKLIST_MESSAGE_HEAD");break;case"SENDBACKTOCITIZEN":e="error"===(null==N?void 0:N.key)?null==N||null===(a=N.error)||void 0===a?void 0:a.message:S("TL_SENDBACK_TOCITIZEN_CHECKLIST_MESSAGE_HEAD");break;case"REJECT":e="error"===(null==N?void 0:N.key)?null==N||null===(r=N.error)||void 0===r?void 0:r.message:S("TL_APPROVAL_REJ_MESSAGE_HEAD");break;case"RESUBMIT":e="error"===(null==N?void 0:N.key)?null==N||null===(u=N.error)||void 0===u?void 0:u.message:S("TL_APPLICATION_RESUBMIT_SUCCESS_MESSAGE_MAIN");break;case"CANCEL":e="error"===(null==N?void 0:N.key)?null==N||null===(d=N.error)||void 0===d?void 0:d.message:S("TL_TL_CANCELLED_MESSAGE_HEAD");break;default:e="error"===(null==N?void 0:N.key)?null==N||null===(s=N.error)||void 0===s?void 0:s.message:S("ES_"+C+"_"+(null==N||null===(c=N.action)||void 0===c?void 0:c.action)+"_UPDATE_SUCCESS")}return l.createElement(l.Fragment,null,N&&l.createElement(t.Toast,{error:"error"===N.key,label:e,onClose:b}))}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 n=e[0];return n=2==(null===(t=e)||void 0===t?void 0:t.length)&&null!=C&&C.includes("BPA_OC")?S(e[1]):S(e[0]),n};let n="";switch(null==N||null===(D=N.action)||void 0===D?void 0:D.action){case"REVOCATE":n="error"===(null==N?void 0:N.key)?null==N||null===(v=N.error)||void 0===v?void 0:v.message:e(["BPA_APPROVAL_REVOCATED_MESSAGE_HEAD","BPA_APPROVAL_OC_REVOCATED_MESSAGE_HEAD"]);break;case"VERIFY_AND_FORWARD":n="error"===(null==N?void 0:N.key)?null==N||null===(m=N.error)||void 0===m?void 0:m.message:e(["BPA_FORWARD_SUCCESS_MESSAGE_MAIN"]);break;case"SEND_BACK_TO_CITIZEN":n="error"===(null==N?void 0:N.key)?null==N||null===(p=N.error)||void 0===p?void 0:p.message:e(["BPA_SENDBACK_SUCCESS_MESSAGE_MAIN"]);break;case"APPROVE":n="error"===(null==N?void 0:N.key)?null==N||null===(f=N.error)||void 0===f?void 0:f.message:e(["BPA_APPROVAL_CHECKLIST_MESSAGE_HEAD"]);break;case"REJECT":n="error"===(null==N?void 0:N.key)?null==N||null===(E=N.error)||void 0===E?void 0:E.message:e(["BPA_APPROVAL_REJECTED_MESSAGE_HEAD","BPA_OC_APPROVAL_REJECTED_MESSAGE_HEAD"]);break;case"FORWARD":n="error"===(null==N?void 0:N.key)?null==N||null===(g=N.error)||void 0===g?void 0:g.message:e(["BPA_FORWARD_SUCCESS_MESSAGE_MAIN"]);break;case"SEND_BACK_FOR_DOCUMENT_VERIFICATION":case"SEND_BACK_FOR_FIELD_INSPECTION":n="error"===(null==N?void 0:N.key)?null==N||null===(_=N.error)||void 0===_?void 0:_.message:e(["BPA_SENDBACK_SUCCESS_MESSAGE_MAIN"]);break;default:n="error"===(null==N?void 0:N.key)?null==N||null===(h=N.error)||void 0===h?void 0:h.message:S("ES_"+C+"_"+(null==N||null===(A=N.action)||void 0===A?void 0:A.action)+"_UPDATE_SUCCESS")}return l.createElement(l.Fragment,null,N&&l.createElement(t.Toast,{error:"error"===N.key,label:n,onClose:b}))}{var L,O;const e="error"===(null==N?void 0:N.key)?null==N||null===(L=N.error)||void 0===L?void 0:L.message:"ES_"+C+"_"+(null==N||null===(O=N.action)||void 0===O?void 0:O.action)+"_UPDATE_SUCCESS";return l.createElement(l.Fragment,null,N&&l.createElement(t.Toast,{error:"error"===N.key,label:S(e),onClose:b}))}}function vl(e){var i,a,r,u,d,s,v,m,p,f,E,g,_,h,A,S;let{workflowDetails:N,displayMenu:b,onActionSelect:C,setDisplayMenu:y,businessService:D,forcedActionPrefix:L,ActionBarStyle:O={},MenuStyle:T={}}=e;const{t:I}=o.useTranslation();let w=Digit.UserService.getUser();const R=n.useRef();if(window.location.href.includes("/obps")||window.location.href.includes("/noc")){const e=sessionStorage.getItem("Digit.citizen.userRequestObject"),t=e?JSON.parse(e):{};w=null==t?void 0:t.value}const P=null===(i=w)||void 0===i||null===(a=i.info)||void 0===a||null===(r=a.roles)||void 0===r?void 0:r.map(e=>e.code);let x=!1,B=!1,F=(null==N||null===(u=N.data)||void 0===u||null===(d=u.actionState)||void 0===d||null===(s=d.nextActions)||void 0===s?void 0:s.filter(e=>(null==P?void 0:P.some(t=>{var n;return null===(n=e.roles)||void 0===n?void 0:n.includes(t)}))||!e.roles))||(null==N||null===(v=N.data)||void 0===v||null===(m=v.nextActions)||void 0===m?void 0:m.filter(e=>(null==P?void 0:P.some(t=>{var n;return null===(n=e.roles)||void 0===n?void 0:n.includes(t)}))||!e.roles));return console.log("ActionsInPayment",N),Digit.Hooks.useClickOutside(R,()=>{y(!1)},b),(window.location.href.includes("/obps")||window.location.href.includes("/noc"))&&1==(null==F?void 0:F.length)||null!=F&&null!==(p=F[0])&&void 0!==p&&null!==(f=p.redirectionUrl)&&void 0!==f&&f.pathname.includes("/pt/property-details/")&&1==(null==F?void 0:F.length)?(B=!1,x=!0):(null==F?void 0:F.length)>0&&(B=!0,x=!1),l.createElement(l.Fragment,null,!(null!=N&&N.isLoading)&&B&&!x&&l.createElement(t.ActionBar,{style:c({},O)},b&&(null!=N&&null!==(E=N.data)&&void 0!==E&&null!==(g=E.actionState)&&void 0!==g&&g.nextActions||null!=N&&null!==(_=N.data)&&void 0!==_&&_.nextActions)?l.createElement(t.Menu,{localeKeyPrefix:L||"WF_EMPLOYEE_"+(null==D?void 0:D.toUpperCase()),options:F,optionKey:"action",t:I,onSelect:C,style:T}):null,l.createElement(t.SubmitBar,{ref:R,label:I("WF_TAKE_ACTION"),onSubmit:()=>y(!b)})),!(null!=N&&N.isLoading)&&!B&&x&&l.createElement(t.ActionBar,{style:c({},O)},l.createElement("button",{style:{color:"#FFFFFF",fontSize:"18px"},className:"submit-bar",name:null==F||null===(h=F[0])||void 0===h?void 0:h.action,value:null==F||null===(A=F[0])||void 0===A?void 0:A.action,onClick:e=>{C((null==F?void 0:F[0])||{})}},I((L||"WF_EMPLOYEE_"+(null==D?void 0:D.toUpperCase()))+"_"+(null==F||null===(S=F[0])||void 0===S?void 0:S.action)))))}const ml=()=>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"})),pl=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(ml,null));function fl(e){let{action:n,closeWarningPopup:i}=e;const{t:a}=o.useTranslation(),r=window.Digit.Utils.browser.isMobile();return l.createElement(l.Fragment,null,l.createElement(t.Modal,{headerBarMain:l.createElement("h1",{className:"heading-m"},a("PT_DUES_ARE_PENDING")),headerBarEnd:l.createElement(pl,{onClick:()=>{i()}}),hideSubmit:!0,isDisabled:!1,popupStyles:r?{}:{width:"29%",marginTop:"auto"}},l.createElement(t.Card,null,l.createElement("div",{style:{marginBottom:"30px"}},l.createElement("h1",null,a("PT_YOU_HAVE")," ₹",null==n?void 0:n.AmountDueForPay," ",a("PT_DUE_WARNING_MSG2"))),l.createElement(t.Row,{rowContainerStyle:{display:"flex"},labelStyle:{fontSize:"24px",fontWeight:"700",marginRight:"10%"},textStyle:{fontSize:"24px",fontWeight:"700",marginBottom:"20px"},label:""+a("PT_AMOUNT_DUE"),text:"₹"+a(null==n?void 0:n.AmountDueForPay)}),l.createElement("div",{style:{width:"100%",display:"flex",justifyContent:"flex-end"}},l.createElement(t.ButtonSelector,{theme:"border",label:a("ES_PT_COMMON_CANCEL"),onSubmit:i,style:{marginLeft:"10px"}}),l.createElement(t.ButtonSelector,{label:a("PT_COLLECT"),onSubmit:()=>{var e;return window.location.assign(""+window.location.origin+(null==n||null===(e=n.redirectionUrl)||void 0===e?void 0:e.pathname))},style:{marginLeft:"10px"}})))),")")}const El=e=>{var a,u;let d=window.location.href.includes("editApplication")&&window.location.href.includes("bpa");const s=Digit.ULBService.getCurrentTenantId(),v=Digit.ULBService.getStateId(),{data:m}=Digit.Hooks.obps.useMDMS(v,"BPA",["BlockReason"]),{t:p}=o.useTranslation(),f=i.useHistory();let{id:E}=i.useParams();const[g,_]=n.useState(!1),[h,A]=n.useState(null),[S,N]=n.useState(!1),[b,C]=n.useState(!1),[y,D]=n.useState(!1),{data:L}=Digit.Hooks.obps.useMDMS(v,"BPA",["RiskTypeComputation"]),{applicationDetails:O,demandData:T,totalDemandTax:I,totalBalanceTax:w,showToast:R,setShowToast:P,isLoading:x,isDataLoading:B,applicationData:F,mutate:M,nocMutation:U,workflowDetails:k,id:W,businessService:H,closeToast:j,moduleCode:z,timelineStatusPrefix:V,forcedActionPrefix:G,statusAttribute:Y,ActionBarStyle:K,MenuStyle:q,paymentsList:X,showTimeLine:J=!0,oldValue:Q,isInfoLabel:Z=!1,clearDataDetails:$,propertyId:ee}=e;n.useEffect(()=>{R&&k&&k.revalidate&&k.revalidate()},[R]);const te=r.useQueryClient(),ne=()=>{A(null),N(!1)};return console.log("ActionsInPayment2",k),x||b?l.createElement(t.Loader,null):l.createElement(l.Fragment,null,x?l.createElement(t.Loader,null):l.createElement(l.Fragment,null,l.createElement(sl,{applicationDetails:O,demandData:T,id:W,workflowDetails:k,isDataLoading:B,applicationData:F,totalDemandTax:I,totalBalanceTax:w,businessService:H,timelineStatusPrefix:V,statusAttribute:Y,paymentsList:X,showTimeLine:J,oldValue:Q,isInfoLabel:Z,propertyId:ee,moduleCode:z}),S?l.createElement(Bn,{t:p,action:h,tenantId:s,state:v,id:E,applicationDetails:O,applicationData:null==O?void 0:O.applicationData,closeModal:ne,submitAction:function(e,t,n){void 0===t&&(t=!1),void 0===n&&(n={});try{let l=!1;const i=function(i,o,a,r,u,d,s,v,m,E,g,_,A,S,N,b,y,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===(m=v.validityYears)||void 0===m?void 0:m.length):0==(null==e||null===(E=e.Licenses)||void 0===E||null===(g=E[0])||void 0===g||null===(_=g.comment)||void 0===_?void 0:_.length))||0==(null==e||null===(A=e.WaterConnection)||void 0===A||null===(S=A.comment)||void 0===S?void 0:S.length)||0==(null==e||null===(N=e.SewerageConnection)||void 0===N||null===(b=N.comment)||void 0===b?void 0:b.length)||0==(null==e||null===(y=e.BPA)||void 0===y||null===(D=y.comment)||void 0===D?void 0:D.length)){var L,O;"INITIATE"===(null==e||null===(L=e.Licenses)||void 0===L||null===(O=L[0])||void 0===O?void 0:O.action)?alert(p("Please fill in the validity before submitting")):alert(p("Please fill in the comments before submitting"))}else{const i=function(i,o,a,r,u){if("BPA"!=(null==e||null===(i=e.BPA)||void 0===i?void 0:i.businessService)||null!=e&&null!==(o=e.BPA)&&void 0!==o&&null!==(a=o.additionalDetails)&&void 0!==a&&a.blockingReason||"BLOCK"!=(null==e||null===(r=e.BPA)||void 0===r||null===(u=r.workflow)||void 0===u?void 0:u.action)){function d(t){if(l)return t;M&&(C(!0),M(e,{onError:(e,t)=>{C(!1),P({key:"error",error:e}),setTimeout(j,5e3)},onSuccess:(e,t)=>{var l,i,o,a,r,u;if(sessionStorage.removeItem("WS_SESSION_APPLICATION_DETAILS"),C(!1),null!==(l=n)&&void 0!==l&&l.bpa&&(e.selectedAction=h,f.replace("/digit-ui/employee/obps/response",{data:e})),null!==(i=n)&&void 0!==i&&i.isStakeholder&&(e.selectedAction=h,f.push("/digit-ui/employee/obps/stakeholder-response",{data:e})),null!==(o=n)&&void 0!==o&&o.isNoc&&f.push("/digit-ui/employee/noc/response",{data:e}),(null==e||null===(a=e.Amendments)||void 0===a?void 0:a.length)>0){var d,s,c,v,m,E,g,_;null!=t&&null!==(d=t.AmendmentUpdate)&&void 0!==d&&null!==(s=d.workflow)&&void 0!==s&&s.action.includes("SEND_BACK")?P({key:"success",label:p("ES_MODIFYSWCONNECTION_SEND_BACK_UPDATE_SUCCESS")}):null!=t&&null!==(c=t.AmendmentUpdate)&&void 0!==c&&null!==(v=c.workflow)&&void 0!==v&&v.action.includes("RE-SUBMIT")?P({key:"success",label:p("ES_MODIFYSWCONNECTION_RE_SUBMIT_UPDATE_SUCCESS")}):null!=t&&null!==(m=t.AmendmentUpdate)&&void 0!==m&&null!==(E=m.workflow)&&void 0!==E&&E.action.includes("APPROVE")?P({key:"success",label:p("ES_MODIFYSWCONNECTION_APPROVE_UPDATE_SUCCESS")}):null!=t&&null!==(g=t.AmendmentUpdate)&&void 0!==g&&null!==(_=g.workflow)&&void 0!==_&&_.action.includes("REJECT")&&P({key:"success",label:p("ES_MODIFYWSCONNECTION_REJECT_UPDATE_SUCCESS")})}else{var A,S,N;if((null==e||null===(r=e.Licenses)||void 0===r?void 0:r.length)>0&&null!=e&&null!==(u=e.Licenses[0])&&void 0!==u&&u.applicationNumber)return null!=e&&null!==(A=e.Licenses[0])&&void 0!==A&&null!==(S=A.businessService)&&void 0!==S&&S.includes("BPAREG")?(P({key:"success",action:h}),e.selectedAction=h,void f.push("/digit-ui/employee/obps/stakeholder-response",{data:e})):(P({key:"success",action:h}),void f.replace("/digit-ui/employee/tl/application-details/"+(null==e||null===(N=e.Licenses[0])||void 0===N?void 0:N.applicationNumber)));P({key:"success",action:h}),$&&setTimeout($,3e3),setTimeout(j,5e3);try{const e=(H||"").toUpperCase(),t=((null==h?void 0:h.action)||"").toUpperCase();e.includes("DISCONNECT")&&(t.includes("APPROVE")||t.includes("EXECUTE")||t.includes("APPROVE_CONNECTION"))&&setTimeout(()=>{var e;null!==(e=window)&&void 0!==e&&e.location&&(window.location.href="https://mseva.lgpunjab.gov.in/employee/inbox")},3e3)}catch(e){}te.clear(),te.refetchQueries("APPLICATION_SEARCH")}}})),ne()}C(!0),"function"==typeof(null==e?void 0:e.customFunctionToExecute)&&(null==e||e.customFunctionToExecute(c({},e)));const i=function(){if(!1!==t&&U){var e;const n=null===(e=t)||void 0===e?void 0:e.map(e=>null==U?void 0:U.mutateAsync(e)),i=kt(function(){return C(!0),Promise.resolve(Promise.all(n)).then(function(e){e&&e.map(e=>{var t,n;Digit.SessionStorage.del(null==e||null===(t=e.Noc)||void 0===t||null===(n=t[0])||void 0===n?void 0:n.nocType)})})},function(e){var t,n,i,o,a,r,u,d,s,c,v,m;C(!1);let f=null!=e&&null!==(t=e.response)&&void 0!==t&&null!==(n=t.data)&&void 0!==n&&null!==(i=n.Errors)&&void 0!==i&&null!==(o=i[0])&&void 0!==o&&o.code?p(null==e||null===(a=e.response)||void 0===a||null===(r=a.data)||void 0===r||null===(u=r.Errors)||void 0===u||null===(d=u[0])||void 0===d?void 0:d.code):(null==e||null===(s=e.response)||void 0===s||null===(c=s.data)||void 0===c||null===(v=c.Errors)||void 0===v||null===(m=v[0])||void 0===m?void 0:m.message)||e;ne(),P({key:"error",error:{message:f}}),setTimeout(j,5e3),l=!0});if(i&&i.then)return i.then(function(){})}}();return i&&i.then?i.then(d):d(i)}alert(p("Please select Blocking reason"))}();if(i&&i.then)return i.then(function(){})}}();return Promise.resolve(i&&i.then?i.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},actionData:null==k||null===(a=k.data)||void 0===a?void 0:a.timeline,businessService:H,workflowDetails:k,moduleCode:z,blockReason:null==m||null===(u=m.BPA)||void 0===u?void 0:u.BlockReason}):null,y?l.createElement(fl,{action:h,workflowDetails:k,businessService:H,isWarningPop:y,closeWarningPopup:()=>{D(!1)}}):null,l.createElement(cl,{t:p,showToast:R,closeToast:j,businessService:H}),l.createElement("div",null,d?l.createElement(t.SubmitBar,{style:{marginRight:20},label:p("BPA_EDIT_UPDATE"),onSubmit:function(e){try{return console.log("JJJJJJ",e),Promise.resolve(Digit.OBPSService.BPASearch(s,{applicationNo:null==F?void 0:F.applicationNo})).then(function(e){var t,n,l,i,o,a;const r=Digit.Utils.obps.calculateRiskType(null==L||null===(t=L.BPA)||void 0===t?void 0:t.RiskTypeComputation,null==O||null===(n=O.edcrDetails)||void 0===n||null===(l=n.planDetail)||void 0===l||null===(i=l.plot)||void 0===i?void 0:i.area,null==O||null===(o=O.edcrDetails)||void 0===o||null===(a=o.planDetail)||void 0===a?void 0:a.blocks),u={BPA:e.BPA[0]};u.BPA.riskType=r,u.BPA.workflow={action:"EDIT PAY 2",assignes:[],comments:null,varificationDocuments:null};const d=function(e,t,n,l,i,o,a,r,d,c,v,m){if(!(parseInt(sessionStorage.getItem("lessAdjusment"))>parseInt(sessionStorage.getItem("development"))+parseInt(sessionStorage.getItem("otherCharges"))+parseInt(null==u||null===(e=u.BPA)||void 0===e||null===(t=e.additionalDetails)||void 0===t||null===(n=t.selfCertificationCharges)||void 0===n?void 0:n.BPA_MALBA_CHARGES)+parseInt(null==u||null===(l=u.BPA)||void 0===l||null===(i=l.additionalDetails)||void 0===i||null===(o=i.selfCertificationCharges)||void 0===o?void 0:o.BPA_LABOUR_CESS)+parseInt(null==u||null===(a=u.BPA)||void 0===a||null===(r=a.additionalDetails)||void 0===r||null===(d=r.selfCertificationCharges)||void 0===d?void 0:d.BPA_WATER_CHARGES)+parseInt(null==u||null===(c=u.BPA)||void 0===c||null===(v=c.additionalDetails)||void 0===v||null===(m=v.selfCertificationCharges)||void 0===m?void 0:m.BPA_GAUSHALA_CHARGES_CESS)))return Promise.resolve(Digit.OBPSService.update(u,s)).then(function(e){window.location.assign(window.location.href.split("/editApplication")[0]+window.location.href.split("editApplication")[1])});alert(p("Enterd Less Adjustment amount is invalid"))}();if(d&&d.then)return d.then(function(){})})}catch(e){return Promise.reject(e)}},id:!0}):!(window.location.href.includes("citizen")&&window.location.href.includes("/pt/"))&&l.createElement(vl,{workflowDetails:k,displayMenu:g,onActionSelect:function(e){var t,n,l;if(e)if("EDIT PAY 2"==(null==e?void 0:e.action)&&window.location.href.includes("bpa"))window.location.assign(window.location.href.split("bpa")[0]+"editApplication/bpa"+window.location.href.split("bpa")[1]);else if(null!=e&&e.isWarningPopUp)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))f.push(""+(null==e||null===(a=e.redirectionUrll)||void 0===a?void 0:a.pathname),JSON.stringify({data:null==e||null===(r=e.redirectionUrll)||void 0===r?void 0:r.state,url:""+(null===(u=location)||void 0===u?void 0:u.pathname)+location.search}));else if("RE-SUBMIT-APPLICATION"===(null==e||null===(o=e.redirectionUrll)||void 0===o?void 0:o.action)){var d,s;f.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 v;window.location.assign(window.location.origin+"/digit-ui/employee/payment/collect/"+(null==e||null===(v=e.redirectionUrll)||void 0===v?void 0:v.pathname))}}else if(null!=e&&e.redirectionUrl||"EDIT PAY 2"==(null==e?void 0:e.action))if("DIRECTRENEWAL"===(null==e||null===(t=e.redirectionUrl)||void 0===t||null===(n=t.state)||void 0===n||null===(l=n.applicationData)||void 0===l?void 0:l.workflowCode))N(!0);else{var m,p;f.push({pathname:null===(m=e.redirectionUrl)||void 0===m?void 0:m.pathname,state:c({},null===(p=e.redirectionUrl)||void 0===p?void 0:p.state)})}else N(!0);A(e),_(!1)},setDisplayMenu:_,businessService:H,forcedActionPrefix:G,ActionBarStyle:K,MenuStyle:q}))))};function gl(e){var i;let{t:o,document:a,setNocDocuments: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==a?void 0:a.code)})[0],s=Digit.ULBService.getStateId(),[c,v]=n.useState(null==a||null===(i=a.dropdownData)||void 0===i?void 0:i[0]),[m,p]=n.useState(null),[f,E]=n.useState(()=>(null==d?void 0:d.fileStoreId)||null);return n.useEffect(()=>{null!=c&&c.code&&r(e=>0===(null==f?void 0:f.length)||null===f?e:[...null==e?void 0:e.filter(e=>(null==e?void 0:e.fileStoreId)!==f),{documentType:null==c?void 0:c.code,fileStoreId:f,documentUid:f,fileName:(null==m?void 0:m.name)||""}])},[f,c]),l.createElement("div",null,l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller",style:{fontWeight:"700",width:"50%"}},""+o("NOC_UPLOAD_FILE_LABEL")),l.createElement("div",{className:"field"},l.createElement(t.MultiUploadWrapper,{module:"NOC",tenantId:s,getFormState:e=>(e=>{let t=Object.fromEntries(e),n=Object.values(t),l=n&&(null==n?void 0:n.map(e=>{var t,n,l;return{documentType:null==c?void 0:c.code,fileStoreId:null==e||null===(t=e.fileStoreId)||void 0===t?void 0:t.fileStoreId,documentUid:null==e||null===(n=e.fileStoreId)||void 0===n?void 0:n.fileStoreId,fileName:(null==e||null===(l=e.file)||void 0===l?void 0:l.name)||""}}));var i;sessionStorage.setItem("NewNOCDocs",JSON.stringify(l)),(i=n[n.length-1])&&p(i.file)})(e),t:o,allowedFileTypesRegex:/(.*?)(jpg|jpeg|png|image|pdf)$/i,allowedMaxSizeInMB:5,acceptFiles:"image/*, .pdf, .png, .jpeg, .jpg"}))))}const _l=e=>{let{width:t=20,height:n=20,style:i}=e;return l.createElement("svg",{style:i,xmlns:"http://www.w3.org/2000/svg",width:t,height:n,viewBox:"0 0 20 20",fill:"gray"},l.createElement("path",{d:"M20 2H8c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-8.5 7.5c0 .83-.67 1.5-1.5 1.5H9v2H7.5V7H10c.83 0 1.5.67 1.5 1.5v1zm5 2c0 .83-.67 1.5-1.5 1.5h-2.5V7H15c.83 0 1.5.67 1.5 1.5v3zm4-3H19v1h1.5V11H19v2h-1.5V7h3v1.5zM9 9.5h1v-1H9v1zM4 6H2v14c0 1.1.9 2 2 2h14v-2H4V6zm10 5.5h1v-3h-1v3z"}))};function hl(e){var t;let{value:n={}}=e;const{t:i}=o.useTranslation(),{data:a}=Digit.Hooks.noc.useNOCDocumentSearch({value:n},{value:n});let r=[];return null!=n&&n.workflowDocs&&(r=null==n?void 0:n.workflowDocs),a.pdfFiles&&0!==Object.keys(a.pdfFiles).length?l.createElement("div",{style:{marginTop:"19px"}},l.createElement(l.Fragment,null,l.createElement("div",{style:{display:"flex",flexWrap:"wrap",gap:"16px"}},null===(t=r)||void 0===t?void 0:t.map((e,t)=>{var n,o;let r=g(null==a?void 0:a.pdfFiles,(null==e?void 0:e.documentAttachment)||(null==e?void 0:e.documentUid));return l.createElement("a",{target:"_",href:r,style:{width:"120px",textAlign:"center",display:"flex",flexDirection:"column",alignItems:"center",textDecoration:"none",color:"inherit"},key:t},l.createElement(_l,{width:85,height:100,style:{background:"#f6f6f6",padding:"8px"}}),l.createElement("p",{style:{marginTop:"8px",fontSize:"12px",wordWrap:"break-word",overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical"}},i(null==e||null===(n=e.documentType)||void 0===n||null===(o=n.replace(".","_"))||void 0===o?void 0:o.toUpperCase())))})))):l.createElement("div",null,i("NOC_NO_DOCUMENTS_MSG"))}const Al=e=>l.createElement("h1",{className:"heading-m"},e.label),Sl=()=>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"})),Nl=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(Sl,null)),bl=e=>{var i;let{t:o,action:a,tenantId:r,getEmployees:u,closeModal:d,submitAction:s,applicationDetails:v,applicationData:m,businessService:p,showToast:f,setShowToast:E,closeToast:g,showErrorToast:_,errorOne:h,closeToastOne:A}=e;const[S,N]=n.useState({}),[b,C]=n.useState({}),[y,D]=n.useState([]),[L,O]=n.useState({}),[T,I]=n.useState(null),[w,R]=n.useState(null),[P,x]=n.useState(null),[B,F]=n.useState([]),[M,U]=n.useState(null),k=null==a||null===(i=a.state)||void 0===i?void 0:i.actions,W=(new Set(null==k?void 0:k.flatMap(e=>e.roles)),[...new Set(null==u?void 0:u.flatMap(e=>e.roles))]),{data:H}=Digit.Hooks.useEmployeeSearch(r,{roles:null==W?void 0:W.map(e=>({code:e})),isActive:!0},{enabled:!(null!=a&&a.isTerminateState)}),{data:j}=Digit.Hooks.pt.useMDMS(r,p,"FINANCIAL_YEARLS",{},{details:{tenantId:Digit.ULBService.getStateId(),moduleDetails:[{moduleName:"egf-master",masterDetails:[{name:"FinancialYear",filter:"[?(@.module == 'TL')]"}]}]}});n.useEffect(()=>{var e;j&&j["egf-master"]&&F(null===(e=j["egf-master"])||void 0===e?void 0:e.FinancialYear)},[j]);const{data:z}=Digit.Hooks.useCustomMDMS(r,"common-masters",[{name:"Department"}]);function V(e){I(e.target.files[0])}return n.useEffect(()=>{if(H&&z){var e;const t=z["common-masters"].Department;D(null==H||null===(e=H.Employees)||void 0===e?void 0:e.map(e=>{var n,l,i;const o=null==e||null===(n=e.assignments)||void 0===n||null===(l=n[0])||void 0===l?void 0:l.department,a=null==t?void 0:t.find(e=>(null==e?void 0:e.code)===o);return{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)}}))}},[H]),n.useEffect(()=>{!function(){try{x(null);const e=function(){if(T){const e=function(){if(T.size>=5242880)x(o("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=kt(function(){return Promise.resolve(Digit.UploadServices.Filestorage("NOC",T,Digit.ULBService.getStateId())).then(function(e){var t,n,l,i;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?R(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):x(o("CS_FILE_UPLOAD_ERROR"))})},function(){x(o("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[T]),n.useEffect(()=>{if("SENDBACKTOCITIZEN"===(null==a?void 0:a.action)){var e,t,n;const l=(null==v||null===(e=v.Noc)||void 0===e||null===(t=e[0])||void 0===t||null===(n=t.auditDetails)||void 0===n?void 0:n.createdBy)||null;O({uuid:l})}},[a]),n.useEffect(()=>{a&&N((e=>{let{t:n,action:i,approvers:o,selectedApprover:a,setSelectedApprover:r,selectFile:u,uploadedFile:d,setUploadedFile:s}=e,c=!0;return"SENDBACKTOCITIZEN"!=(null==i?void 0:i.action)&&"APPROVE"!=(null==i?void 0:i.action)&&"REJECT"!=(null==i?void 0:i.action)&&"SENDBACK"!=(null==i?void 0:i.action)||(c=!1),i.isTerminateState&&(c=!1),{label:{heading:"WF_"+(null==i?void 0:i.action)+"_APPLICATION",submit:"WF_EMPLOYEE_NOC_"+(null==i?void 0:i.action),cancel:"WF_EMPLOYEE_NOC_CANCEL"},form:[{body:[{label:c?n("WF_ASSIGNEE_NAME_LABEL")+"*":null,placeholder:c?n("WF_ASSIGNEE_NAME_PLACEHOLDER"):null,type:"dropdown",populators:c?l.createElement(t.Dropdown,{option:o,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:r,selected:a}):null},{label:n("WF_COMMON_COMMENTS_LABEL")+"*",type:"textarea",populators:{name:"comments"}},{label:n("TL_APPROVAL_CHECKLIST_BUTTON_UP_FILE"),populators:l.createElement(t.UploadFile,{id:"workflow-doc",onUpload:u,onDelete:()=>{s(null)},message:d?"1 "+n("ES_PT_ACTION_FILEUPLOADED"):n("CS_ACTION_NO_FILEUPLOADED")})}]}]}})({t:o,action:a,approvers:y,selectedApprover:L,setSelectedApprover:O,selectFile:V,uploadedFile:w,setUploadedFile:R,businessService:p}))},[a,y,B,M,w]),a&&S.form?l.createElement(t.Modal,{headerBarMain:l.createElement(Al,{label:o(S.label.heading)}),headerBarEnd:l.createElement(Nl,{onClick:d}),actionCancelLabel:o(S.label.cancel),actionCancelOnSubmit:d,actionSaveLabel:o(S.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},l.createElement(t.FormComposer,{config:S.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){var t;let n=["APPROVE","VERIFY","REJECT","SENDBACKTOCITIZEN","SENDBACKTOVERIFIER","FORWARD"].includes(null==a?void 0:a.action);null!=a&&a.isTerminateState&&(n=!0);const l=null==e||null===(t=e.comments)||void 0===t?void 0:t.toString().trim();"APPROVE"===(null==a?void 0:a.action)||null!=L&&L.uuid?!n||l?(m=c({},m,{action:null==a?void 0:a.action,comment:null==e?void 0:e.comments,assignee:null!=L&&L.uuid?[null==L?void 0:L.uuid]:null,wfDocuments:w?[{documentType:null==T?void 0:T.type,fileName:null==T?void 0:T.name,documentUid:w,filestoreId:w,documentAttachment:w}]:null}),s({Licenses:[m]})):E({key:"true",warning:!0,message:o("COMMON_COMMENTS_REQUIRED_LABEL")}):E({key:"true",warning:!0,message:o("COMMON_ASSIGNEE_NAME_REQUIRED_LABEL")})},defaultValues:b,formId:"modal-action"}),f&&l.createElement(t.Toast,{error:null==f?void 0:f.error,warning:null==f?void 0:f.warning,label:null==f?void 0:f.message,onClose:g,isDleteBtn:!0}),_&&l.createElement(t.Toast,{error:!0,label:h,isDleteBtn:!0,onClose:A})):l.createElement(t.Loader,null)},Cl=e=>{let{documents:i}=e;const{t:a}=o.useTranslation(),r=[{Header:a("BPA_DOCUMENT_NAME"),accessor:"title",Cell:e=>{let{value:t}=e;return a(t)||a("CS_NA")}},{Header:a("BPA_DOCUMENT_FILE"),accessor:"fileUrl",Cell:e=>{let{value:n}=e;return n?l.createElement(t.LinkButton,{style:{float:"right",display:"inline",background:"#fff"},label:a("View"),onClick:()=>{window.open(n,"_blank")}}):a("CS_NA")}}],u={value:{workflowDocs:null==i?void 0:i.map(e=>({documentType:(null==e?void 0:e.documentType)||"",filestoreId:(null==e?void 0:e.filestoreId)||"",documentUid:(null==e?void 0:e.documentUid)||"",documentAttachment:(null==e?void 0:e.documentAttachment)||""}))}},{data:d}=Digit.Hooks.noc.useNOCDocumentSearch(u,{enabled:(null==i?void 0:i.length)>0}),s=null==i?void 0:i.map(e=>{var t;const{documentUid:n,documentType:l}=e;return{documentUid:n,documentType:l,url:null==d||null===(t=d.pdfFiles)||void 0===t?void 0:t[n]}}),c=n.useMemo(()=>null==s?void 0:s.map((e,t)=>{var n;return{id:t,title:a(null==e||null===(n=e.documentType)||void 0===n?void 0:n.replaceAll(".","_"))||a("CS_NA"),fileUrl:e.url}}),[s]);return l.createElement("div",null,c&&l.createElement(t.Table,{className:"customTable table-border-style",t:a,data:c,columns:r,getCellProps:()=>({style:{}}),disableSort:!1,autoSort:!0,manualPagination:!1,isPaginationRequired:!1}))},yl=e=>{let{formData:i}=e;const{t:a}=o.useTranslation(),r=n.useMemo(()=>{var e,t,n,l,o,a,r,u,d,s,v,m,p,f,E,g,_,h,A,S,N,b,C,y,D,L,O,T,I,w,R,P,x,B,F,M,U,k,W,H,j,z,V,G,Y,K,q,X;return{CalculationCriteria:[{applicationNumber:null==i||null===(e=i.apiData)||void 0===e||null===(t=e.Noc)||void 0===t||null===(n=t[0])||void 0===n?void 0:n.applicationNo,tenantId:null==i||null===(l=i.apiData)||void 0===l||null===(o=l.Noc)||void 0===o||null===(a=o[0])||void 0===a?void 0:a.tenantId,NOC:c({},null==i||null===(r=i.apiData)||void 0===r||null===(u=r.Noc)||void 0===u?void 0:u[0],{nocDetails:c({},null===(d=i.apiData)||void 0===d||null===(s=d.Noc)||void 0===s||null===(v=s[0])||void 0===v?void 0:v.nocDetails,{additionalDetails:c({},null==i||null===(m=i.apiData)||void 0===m||null===(p=m.Noc)||void 0===p||null===(f=p[0])||void 0===f||null===(E=f.nocDetails)||void 0===E?void 0:E.additionalDetails,{applicationDetails:c({},null==i?void 0:i.applicationDetails,{applicantGender:(null==i||null===(g=i.applicationDetails)||void 0===g||null===(_=g.applicantGender)||void 0===_?void 0:_.code)||(null==i||null===(h=i.applicationDetails)||void 0===h?void 0:h.applicantGender)||""}),siteDetails:c({},null==i?void 0:i.siteDetails,{ulbName:(null==i||null===(A=i.siteDetails)||void 0===A||null===(S=A.ulbName)||void 0===S?void 0:S.name)||(null==i||null===(N=i.siteDetails)||void 0===N?void 0:N.ulbName)||"",roadType:(null==i||null===(b=i.siteDetails)||void 0===b||null===(C=b.roadType)||void 0===C?void 0:C.name)||(null==i||null===(y=i.siteDetails)||void 0===y?void 0:y.roadType)||"",buildingStatus:(null==i||null===(D=i.siteDetails)||void 0===D||null===(L=D.buildingStatus)||void 0===L?void 0:L.name)||(null==i||null===(O=i.siteDetails)||void 0===O?void 0:O.buildingStatus)||"",isBasementAreaAvailable:(null==i||null===(T=i.siteDetails)||void 0===T||null===(I=T.isBasementAreaAvailable)||void 0===I?void 0:I.code)||(null==i||null===(w=i.siteDetails)||void 0===w?void 0:w.isBasementAreaAvailable)||"",district:(null==i||null===(R=i.siteDetails)||void 0===R||null===(P=R.district)||void 0===P?void 0:P.name)||(null==i||null===(x=i.siteDetails)||void 0===x?void 0:x.district)||"",zone:(null==i||null===(B=i.siteDetails)||void 0===B||null===(F=B.zone)||void 0===F?void 0:F.name)||(null==i||null===(M=i.siteDetails)||void 0===M?void 0:M.zone)||"",specificationBuildingCategory:(null==i||null===(U=i.siteDetails)||void 0===U||null===(k=U.specificationBuildingCategory)||void 0===k?void 0:k.name)||(null==i||null===(W=i.siteDetails)||void 0===W?void 0:W.specificationBuildingCategory)||"",specificationNocType:(null==i||null===(H=i.siteDetails)||void 0===H||null===(j=H.specificationNocType)||void 0===j?void 0:j.name)||(null==i||null===(z=i.siteDetails)||void 0===z?void 0:z.specificationNocType)||"",specificationRestrictedArea:(null==i||null===(V=i.siteDetails)||void 0===V||null===(G=V.specificationRestrictedArea)||void 0===G?void 0:G.code)||(null==i||null===(Y=i.siteDetails)||void 0===Y?void 0:Y.specificationRestrictedArea)||"",specificationIsSiteUnderMasterPlan:(null==i||null===(K=i.siteDetails)||void 0===K||null===(q=K.specificationIsSiteUnderMasterPlan)||void 0===q?void 0:q.code)||(null==i||null===(X=i.siteDetails)||void 0===X?void 0:X.specificationIsSiteUnderMasterPlan)||""})})})})}]}},[i]),{isLoading:u,data:d,revalidate:s}=Digit.Hooks.noc.useNOCFeeCalculator({payload:r},{enabled:!!r}),[v,m]=n.useState(null);n.useEffect(()=>{At.isEqual(v,null==i?void 0:i.siteDetails)||(s(),m(null==i?void 0:i.siteDetails))},[null==i?void 0:i.siteDetails]);const p=n.useMemo(()=>{var e,t,n,l,i;if(null==d||null===(e=d.Calculation)||void 0===e||null===(t=e[0])||void 0===t||!t.totalAmount)return[];const o=(null==d||null===(n=d.Calculation)||void 0===n||null===(l=n[0])||void 0===l||null===(i=l.taxHeadEstimates)||void 0===i?void 0:i.reduce((e,t)=>e+((null==t?void 0:t.estimateAmount)||0),0))||"N/A";return[{id:"1",title:a("NOC_FEE_LABEL"),amount:o}]},[d,a]),f=[{Header:a("NOC_FEE_TYPE_LABEL"),accessor:"title",Cell:e=>{let{value:t}=e;return t||a("CS_NA")}},{Header:a("NOC_AMOUNT_LABEL"),accessor:"amount",Cell:e=>{let{value:t}=e;return null!=t?"₹ "+t.toLocaleString():a("CS_NA")}}];return u?l.createElement(t.Loader,null):l.createElement("div",null,u?l.createElement(t.Loader,null):l.createElement(t.Table,{className:"customTable table-border-style",t:a,data:p,columns:f,getCellProps:()=>({style:{}}),disableSort:!0,manualPagination:!1,isPaginationRequired:!1}))},Dl=(e,n,i,o)=>{var a,r,u,d,s,c;console.log("checkpoint here",e);const{wfComment:v,thumbnailsToShow:m,wfDocuments:p}=e;console.log("wfDocuments",p);const f={date:null==e||null===(a=e.auditDetails)||void 0===a?void 0:a.lastModified,time:null==e||null===(r=e.auditDetails)||void 0===r?void 0:r.timing,name:null==e||null===(u=e.assigner)||void 0===u?void 0:u.name,mobileNumber:null==e||null===(d=e.assigner)||void 0===d?void 0:d.mobileNumber,source:null==e||null===(s=e.assigner)||void 0===s?void 0:s.source};return l.createElement("div",null,(null==v?void 0:v.length)>0&&l.createElement("div",{className:"TLComments"},l.createElement("h3",null,o("WF_COMMON_COMMENTS")),l.createElement("p",{style:{overflowX:"scroll"}},v)),(null==m||null===(c=m.thumbs)||void 0===c?void 0:c.length)>0&&l.createElement(t.DisplayPhotos,{srcs:m.thumbs,onClick:(e,t)=>{var n;let l=(null===(n=m.fullImage)||void 0===n?void 0:n[t])||e;Digit.Utils.zoomImage(l)}}),(null==p?void 0:p.length)>0&&l.createElement("div",null,l.createElement("div",null,l.createElement(hl,{value:{workflowDocs:p},index:n}))),l.createElement("div",{style:{marginTop:"8px"}},f.time&&l.createElement("p",null,f.time),f.date&&l.createElement("p",null,f.date),f.name&&l.createElement("p",null,f.name),f.mobileNumber&&l.createElement("p",null,f.mobileNumber),f.source&&l.createElement("p",null,o("ES_COMMON_FILED_VIA_"+f.source.toUpperCase()))))},Ll=e=>{let{registerRef:i,searchFieldComponents:a}=e;const{t:r}=o.useTranslation();return window.Digit.Utils.browser.isMobile()?l.createElement(n.Fragment,null,l.createElement(t.SearchField,null,l.createElement("label",null,r("NOC_APPLICATION_NUMBER")),l.createElement(t.TextInput,{name:"applicationNo",inputRef:i({})})),l.createElement(t.SearchField,null,l.createElement("label",null,r("NOC_APPLICANT_MOBILE_NO_LABEL")),l.createElement(t.TextInput,{name:"mobileNumber",inputRef:i({})}))):l.createElement(l.Fragment,null,l.createElement("div",{className:"search-container",style:{width:"auto",marginLeft:"24px"}},l.createElement("div",{className:"search-complaint-container"},l.createElement("div",{className:"complaint-input-container",style:{textAlign:"start"}},l.createElement(t.SearchField,null,l.createElement("label",null,r("NOC_APPLICATION_NUMBER")),l.createElement(t.TextInput,{name:"applicationNo",inputRef:i({})})),l.createElement(t.SearchField,null,l.createElement("label",null,r("NOC_APPLICANT_MOBILE_NO_LABEL")),l.createElement(t.TextInput,{name:"mobileNumber",inputRef:i({})})),l.createElement("div",{className:"search-action-wrapper",style:{width:"100%"}},a)))))},Ol=e=>{let{statuses:i,controlFilterForm:r,applicationTypesOfBPA:u}=e;const{t:d}=o.useTranslation(),s=(Digit.ULBService.getStateId(),[{code:"ASSIGNED_TO_ME",name:""+d("ES_INBOX_ASSIGNED_TO_ME")},{code:"ASSIGNED_TO_ALL",name:""+d("ES_INBOX_ASSIGNED_TO_ALL")}]);return null==u||u.forEach(e=>{e.name=d("WF_BPA_"+e.code),e.i18nKey=d("WF_BPA_"+e.code)}),console.log("status heres===>",i),l.createElement(n.Fragment,null,l.createElement(t.FilterFormField,null,l.createElement(a.Controller,{name:"assignee",control:r,render:e=>l.createElement(t.RadioButtons,{onSelect:t=>{e.onChange(t.code)},selectedOption:s.filter(t=>t.code===e.value)[0],optionsKey:"name",options:s})})),l.createElement(t.FilterFormField,null,l.createElement(a.Controller,{name:"applicationStatus",control:r,defaultValue:[],render:e=>l.createElement(n.Fragment,null,null==i?void 0:i.map((n,i)=>l.createElement(t.CheckBox,{key:n.applicationstatus,label:d(n.applicationstatus)+" - "+n.count,value:n.applicationstatus,checked:e.value.includes(n.applicationstatus),onChange:()=>{var t;e.value.includes(t=n.applicationstatus)?e.onChange(e.value.filter(e=>e!==t)):e.onChange([...e.value,t])},index:i})))})))};function Tl(e){if(null===e||!0===e||!1===e)return NaN;var t=Number(e);return isNaN(t)?t:t<0?Math.ceil(t):Math.floor(t)}function Il(e,t){if(t.length<e)throw new TypeError(e+" argument"+(e>1?"s":"")+" required, but only "+t.length+" present")}function wl(e){Il(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 Rl(e,t){Il(2,arguments);var n=wl(e).getTime(),l=Tl(t);return new Date(n+l)}function Pl(e){var t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),e.getTime()-t.getTime()}function xl(e){return Il(1,arguments),e instanceof Date||"object"==typeof e&&"[object Date]"===Object.prototype.toString.call(e)}function Bl(e){if(Il(1,arguments),!xl(e)&&"number"!=typeof e)return!1;var t=wl(e);return!isNaN(Number(t))}var Fl={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 Ml(e){return function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.width?String(t.width):e.defaultWidth,l=e.formats[n]||e.formats[e.defaultWidth];return l}}var Ul={date:Ml({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:Ml({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:Ml({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},kl={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function Wl(e){return function(t,n){var l,i=n||{};if("formatting"===(i.context?String(i.context):"standalone")&&e.formattingValues){var o=e.defaultFormattingWidth||e.defaultWidth,a=i.width?String(i.width):o;l=e.formattingValues[a]||e.formattingValues[o]}else{var r=e.defaultWidth,u=i.width?String(i.width):e.defaultWidth;l=e.values[u]||e.values[r]}return l[e.argumentCallback?e.argumentCallback(t):t]}}function Hl(e){return function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},l=n.width,i=l&&e.matchPatterns[l]||e.matchPatterns[e.defaultMatchWidth],o=t.match(i);if(!o)return null;var a,r=o[0],u=l&&e.parsePatterns[l]||e.parsePatterns[e.defaultParseWidth],d=Array.isArray(u)?zl(u,function(e){return e.test(r)}):jl(u,function(e){return e.test(r)});a=e.valueCallback?e.valueCallback(d):d,a=n.valueCallback?n.valueCallback(a):a;var s=t.slice(r.length);return{value:a,rest:s}}}function jl(e,t){for(var n in e)if(e.hasOwnProperty(n)&&t(e[n]))return n}function zl(e,t){for(var n=0;n<e.length;n++)if(t(e[n]))return n}var Vl,Gl={code:"en-US",formatDistance:function(e,t,n){var l,i=Fl[e];return l="string"==typeof i?i:1===t?i.one:i.other.replace("{{count}}",t.toString()),null!=n&&n.addSuffix?n.comparison&&n.comparison>0?"in "+l:l+" ago":l},formatLong:Ul,formatRelative:function(e,t,n,l){return kl[e]},localize:{ordinalNumber:function(e,t){var n=Number(e),l=n%100;if(l>20||l<10)switch(l%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:Wl({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:Wl({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:Wl({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:Wl({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:Wl({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:(Vl={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:function(e){return parseInt(e,10)}},function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.match(Vl.matchPattern);if(!n)return null;var l=n[0],i=e.match(Vl.parsePattern);if(!i)return null;var o=Vl.valueCallback?Vl.valueCallback(i[0]):i[0];o=t.valueCallback?t.valueCallback(o):o;var a=e.slice(l.length);return{value:o,rest:a}}),era:Hl({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:Hl({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:Hl({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:Hl({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:Hl({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 Yl(e,t){Il(2,arguments);var n=Tl(t);return Rl(e,-n)}function Kl(e){Il(1,arguments);var t=1,n=wl(e),l=n.getUTCDay(),i=(l<t?7:0)+l-t;return n.setUTCDate(n.getUTCDate()-i),n.setUTCHours(0,0,0,0),n}function ql(e){Il(1,arguments);var t=wl(e),n=t.getUTCFullYear(),l=new Date(0);l.setUTCFullYear(n+1,0,4),l.setUTCHours(0,0,0,0);var i=Kl(l),o=new Date(0);o.setUTCFullYear(n,0,4),o.setUTCHours(0,0,0,0);var a=Kl(o);return t.getTime()>=i.getTime()?n+1:t.getTime()>=a.getTime()?n:n-1}function Xl(e){Il(1,arguments);var t=ql(e),n=new Date(0);n.setUTCFullYear(t,0,4),n.setUTCHours(0,0,0,0);var l=Kl(n);return l}function Jl(e,t){Il(1,arguments);var n=t||{},l=n.locale,i=l&&l.options&&l.options.weekStartsOn,o=null==i?0:Tl(i),a=null==n.weekStartsOn?o:Tl(n.weekStartsOn);if(!(a>=0&&a<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var r=wl(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 Ql(e,t){Il(1,arguments);var n=wl(e),l=n.getUTCFullYear(),i=t||{},o=i.locale,a=o&&o.options&&o.options.firstWeekContainsDate,r=null==a?1:Tl(a),u=null==i.firstWeekContainsDate?r:Tl(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(l+1,0,u),d.setUTCHours(0,0,0,0);var s=Jl(d,t),c=new Date(0);c.setUTCFullYear(l,0,u),c.setUTCHours(0,0,0,0);var v=Jl(c,t);return n.getTime()>=s.getTime()?l+1:n.getTime()>=v.getTime()?l:l-1}function Zl(e,t){Il(1,arguments);var n=t||{},l=n.locale,i=l&&l.options&&l.options.firstWeekContainsDate,o=null==i?1:Tl(i),a=null==n.firstWeekContainsDate?o:Tl(n.firstWeekContainsDate),r=Ql(e,t),u=new Date(0);u.setUTCFullYear(r,0,a),u.setUTCHours(0,0,0,0);var d=Jl(u,t);return d}function $l(e,t){for(var n=e<0?"-":"",l=Math.abs(e).toString();l.length<t;)l="0"+l;return n+l}var ei={G:function(e,t,n){var l=e.getUTCFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(l,{width:"abbreviated"});case"GGGGG":return n.era(l,{width:"narrow"});case"GGGG":default:return n.era(l,{width:"wide"})}},y:function(e,t,n){if("yo"===t){var l=e.getUTCFullYear();return n.ordinalNumber(l>0?l:1-l,{unit:"year"})}return function(e,t){var n=e.getUTCFullYear(),l=n>0?n:1-n;return $l("yy"===t?l%100:l,t.length)}(e,t)},Y:function(e,t,n,l){var i=Ql(e,l),o=i>0?i:1-i;return"YY"===t?$l(o%100,2):"Yo"===t?n.ordinalNumber(o,{unit:"year"}):$l(o,t.length)},R:function(e,t){return $l(ql(e),t.length)},u:function(e,t){return $l(e.getUTCFullYear(),t.length)},Q:function(e,t,n){var l=Math.ceil((e.getUTCMonth()+1)/3);switch(t){case"Q":return String(l);case"QQ":return $l(l,2);case"Qo":return n.ordinalNumber(l,{unit:"quarter"});case"QQQ":return n.quarter(l,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(l,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(l,{width:"wide",context:"formatting"})}},q:function(e,t,n){var l=Math.ceil((e.getUTCMonth()+1)/3);switch(t){case"q":return String(l);case"qq":return $l(l,2);case"qo":return n.ordinalNumber(l,{unit:"quarter"});case"qqq":return n.quarter(l,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(l,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(l,{width:"wide",context:"standalone"})}},M:function(e,t,n){var l=e.getUTCMonth();switch(t){case"M":case"MM":return function(e,t){var n=e.getUTCMonth();return"M"===t?String(n+1):$l(n+1,2)}(e,t);case"Mo":return n.ordinalNumber(l+1,{unit:"month"});case"MMM":return n.month(l,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(l,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(l,{width:"wide",context:"formatting"})}},L:function(e,t,n){var l=e.getUTCMonth();switch(t){case"L":return String(l+1);case"LL":return $l(l+1,2);case"Lo":return n.ordinalNumber(l+1,{unit:"month"});case"LLL":return n.month(l,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(l,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(l,{width:"wide",context:"standalone"})}},w:function(e,t,n,l){var i=function(e,t){Il(1,arguments);var n=wl(e),l=Jl(n,t).getTime()-Zl(n,t).getTime();return Math.round(l/6048e5)+1}(e,l);return"wo"===t?n.ordinalNumber(i,{unit:"week"}):$l(i,t.length)},I:function(e,t,n){var l=function(e){Il(1,arguments);var t=wl(e),n=Kl(t).getTime()-Xl(t).getTime();return Math.round(n/6048e5)+1}(e);return"Io"===t?n.ordinalNumber(l,{unit:"week"}):$l(l,t.length)},d:function(e,t,n){return"do"===t?n.ordinalNumber(e.getUTCDate(),{unit:"date"}):function(e,t){return $l(e.getUTCDate(),t.length)}(e,t)},D:function(e,t,n){var l=function(e){Il(1,arguments);var t=wl(e),n=t.getTime();t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0);var l=t.getTime(),i=n-l;return Math.floor(i/864e5)+1}(e);return"Do"===t?n.ordinalNumber(l,{unit:"dayOfYear"}):$l(l,t.length)},E:function(e,t,n){var l=e.getUTCDay();switch(t){case"E":case"EE":case"EEE":return n.day(l,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(l,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(l,{width:"short",context:"formatting"});case"EEEE":default:return n.day(l,{width:"wide",context:"formatting"})}},e:function(e,t,n,l){var i=e.getUTCDay(),o=(i-l.weekStartsOn+8)%7||7;switch(t){case"e":return String(o);case"ee":return $l(o,2);case"eo":return n.ordinalNumber(o,{unit:"day"});case"eee":return n.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(i,{width:"short",context:"formatting"});case"eeee":default:return n.day(i,{width:"wide",context:"formatting"})}},c:function(e,t,n,l){var i=e.getUTCDay(),o=(i-l.weekStartsOn+8)%7||7;switch(t){case"c":return String(o);case"cc":return $l(o,t.length);case"co":return n.ordinalNumber(o,{unit:"day"});case"ccc":return n.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(i,{width:"narrow",context:"standalone"});case"cccccc":return n.day(i,{width:"short",context:"standalone"});case"cccc":default:return n.day(i,{width:"wide",context:"standalone"})}},i:function(e,t,n){var l=e.getUTCDay(),i=0===l?7:l;switch(t){case"i":return String(i);case"ii":return $l(i,t.length);case"io":return n.ordinalNumber(i,{unit:"day"});case"iii":return n.day(l,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(l,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(l,{width:"short",context:"formatting"});case"iiii":default:return n.day(l,{width:"wide",context:"formatting"})}},a:function(e,t,n){var l=e.getUTCHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(l,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(l,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(l,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(l,{width:"wide",context:"formatting"})}},b:function(e,t,n){var l,i=e.getUTCHours();switch(l=12===i?"noon":0===i?"midnight":i/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(l,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(l,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(l,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(l,{width:"wide",context:"formatting"})}},B:function(e,t,n){var l,i=e.getUTCHours();switch(l=i>=17?"evening":i>=12?"afternoon":i>=4?"morning":"night",t){case"B":case"BB":case"BBB":return n.dayPeriod(l,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(l,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(l,{width:"wide",context:"formatting"})}},h:function(e,t,n){if("ho"===t){var l=e.getUTCHours()%12;return 0===l&&(l=12),n.ordinalNumber(l,{unit:"hour"})}return function(e,t){return $l(e.getUTCHours()%12||12,t.length)}(e,t)},H:function(e,t,n){return"Ho"===t?n.ordinalNumber(e.getUTCHours(),{unit:"hour"}):function(e,t){return $l(e.getUTCHours(),t.length)}(e,t)},K:function(e,t,n){var l=e.getUTCHours()%12;return"Ko"===t?n.ordinalNumber(l,{unit:"hour"}):$l(l,t.length)},k:function(e,t,n){var l=e.getUTCHours();return 0===l&&(l=24),"ko"===t?n.ordinalNumber(l,{unit:"hour"}):$l(l,t.length)},m:function(e,t,n){return"mo"===t?n.ordinalNumber(e.getUTCMinutes(),{unit:"minute"}):function(e,t){return $l(e.getUTCMinutes(),t.length)}(e,t)},s:function(e,t,n){return"so"===t?n.ordinalNumber(e.getUTCSeconds(),{unit:"second"}):function(e,t){return $l(e.getUTCSeconds(),t.length)}(e,t)},S:function(e,t){return function(e,t){var n=t.length,l=e.getUTCMilliseconds();return $l(Math.floor(l*Math.pow(10,n-3)),t.length)}(e,t)},X:function(e,t,n,l){var i=(l._originalDate||e).getTimezoneOffset();if(0===i)return"Z";switch(t){case"X":return ni(i);case"XXXX":case"XX":return li(i);case"XXXXX":case"XXX":default:return li(i,":")}},x:function(e,t,n,l){var i=(l._originalDate||e).getTimezoneOffset();switch(t){case"x":return ni(i);case"xxxx":case"xx":return li(i);case"xxxxx":case"xxx":default:return li(i,":")}},O:function(e,t,n,l){var i=(l._originalDate||e).getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+ti(i,":");case"OOOO":default:return"GMT"+li(i,":")}},z:function(e,t,n,l){var i=(l._originalDate||e).getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+ti(i,":");case"zzzz":default:return"GMT"+li(i,":")}},t:function(e,t,n,l){return $l(Math.floor((l._originalDate||e).getTime()/1e3),t.length)},T:function(e,t,n,l){return $l((l._originalDate||e).getTime(),t.length)}};function ti(e,t){var n=e>0?"-":"+",l=Math.abs(e),i=Math.floor(l/60),o=l%60;if(0===o)return n+String(i);var a=t||"";return n+String(i)+a+$l(o,2)}function ni(e,t){return e%60==0?(e>0?"-":"+")+$l(Math.abs(e)/60,2):li(e,t)}function li(e,t){var n=t||"",l=e>0?"-":"+",i=Math.abs(e);return l+$l(Math.floor(i/60),2)+n+$l(i%60,2)}function ii(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 oi(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 ai={p:oi,P:function(e,t){var n,l=e.match(/(P+)(p+)?/)||[],i=l[1],o=l[2];if(!o)return ii(e,t);switch(i){case"P":n=t.dateTime({width:"short"});break;case"PP":n=t.dateTime({width:"medium"});break;case"PPP":n=t.dateTime({width:"long"});break;case"PPPP":default:n=t.dateTime({width:"full"})}return n.replace("{{date}}",ii(i,t)).replace("{{time}}",oi(o,t))}},ri=["D","DD"],ui=["YY","YYYY"];function di(e){return-1!==ri.indexOf(e)}function si(e){return-1!==ui.indexOf(e)}function ci(e,t,n){if("YYYY"===e)throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(t,"`) for formatting years to the input `").concat(n,"`; see: https://git.io/fxCyr"));if("YY"===e)throw new RangeError("Use `yy` instead of `YY` (in `".concat(t,"`) for formatting years to the input `").concat(n,"`; see: https://git.io/fxCyr"));if("D"===e)throw new RangeError("Use `d` instead of `D` (in `".concat(t,"`) for formatting days of the month to the input `").concat(n,"`; see: https://git.io/fxCyr"));if("DD"===e)throw new RangeError("Use `dd` instead of `DD` (in `".concat(t,"`) for formatting days of the month to the input `").concat(n,"`; see: https://git.io/fxCyr"))}var vi=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,mi=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,pi=/^'([^]*?)'?$/,fi=/''/g,Ei=/[a-zA-Z]/;function gi(e,t,n){Il(2,arguments);var l=String(t),i=n||{},o=i.locale||Gl,a=o.options&&o.options.firstWeekContainsDate,r=null==a?1:Tl(a),u=null==i.firstWeekContainsDate?r:Tl(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:Tl(d),c=null==i.weekStartsOn?s:Tl(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=wl(e);if(!Bl(v))throw new RangeError("Invalid time value");var m=Pl(v),p=Yl(v,m),f={firstWeekContainsDate:u,weekStartsOn:c,locale:o,_originalDate:v},E=l.match(mi).map(function(e){var t=e[0];return"p"===t||"P"===t?(0,ai[t])(e,o.formatLong,f):e}).join("").match(vi).map(function(n){if("''"===n)return"'";var l=n[0];if("'"===l)return _i(n);var a=ei[l];if(a)return!i.useAdditionalWeekYearTokens&&si(n)&&ci(n,t,e),!i.useAdditionalDayOfYearTokens&&di(n)&&ci(n,t,e),a(p,n,o.localize,f);if(l.match(Ei))throw new RangeError("Format string contains an unescaped latin alphabet character `"+l+"`");return n}).join("");return E}function _i(e){return e.match(pi)[1].replace(fi,"'")}const hi={step:1,isValid:!1,formData:{},coordinates:{}},Ai=function(e,t){switch(void 0===e&&(e=hi),t.type){case"UPDATE_NOCNewApplication_FORM":return c({},e,{formData:c({},e.formData,{[t.payload.key]:t.payload.value})});case"SET_NOCNewApplication_STEP":return c({},e,{step:t.payload});case"RESET_NOC_NEW_APPLICATION_FORM":return hi;case"UPDATE_NOCNewApplication_CoOrdinates":return c({},e,{coordinates:c({},e.coordinates,{[t.payload.key]:t.payload.value})});default:return e}},Si=["path","url"],Ni=[],bi=()=>{var e,n,a,r,u,d,s,c;const m=i.useRouteMatch(),{path:p}=m,f=(v(m,Si),o.useTranslation(),null===(e=Digit)||void 0===e||null===(n=e.ComponentRegistryService)||void 0===n?void 0:n.getComponent("NewNOCStepperForm")),E=Digit.ComponentRegistryService.getComponent("NOCResponseCitizen"),g=Digit.ComponentRegistryService.getComponent("NOCCitizenMyApplications"),_=null===(a=Digit)||void 0===a||null===(r=a.ComponentRegistryService)||void 0===r?void 0:r.getComponent("NOCCitizenApplicationOverview"),h=null===(u=Digit)||void 0===u||null===(d=u.ComponentRegistryService)||void 0===d?void 0:d.getComponent("NewNOCEditApplication"),A=null===(s=Digit)||void 0===s||null===(c=s.ComponentRegistryService)||void 0===c?void 0:c.getComponent("NOCCitizenSearchApplication");return l.createElement("span",{className:"pgr-citizen-wrapper",style:{width:"100%"}},l.createElement(i.Switch,null,l.createElement(t.AppContainer,null,(void 0===(S=Ni)&&(S=[]),S.filter(e=>window.location.href.includes(e.screenPath)).length>0?"":l.createElement(t.BackButton,null,"Back")),l.createElement(t.PrivateRoute,{path:p+"/new-application",component:f}),l.createElement(t.PrivateRoute,{path:p+"/response/:id",component:E}),l.createElement(t.PrivateRoute,{path:p+"/my-application",component:g}),l.createElement(t.PrivateRoute,{path:p+"/edit-application/:id",component:h}),l.createElement(t.PrivateRoute,{path:p+"/search/application-overview/:id",component:_}),l.createElement(t.PrivateRoute,{path:p+"/search-application",component:A}))));var S},Ci=e=>{let{children:t,currentStep:n=1,stepsList:i=[]}=e;const{t:a}=o.useTranslation(),r=e=>{let t;return t=e<=n?"#0D43A7":"#FFFFFF",{width:"60px",height:"60px",borderRadius:"50%",backgroundColor:t,color:e<=n?"white":"black",display:"flex",alignItems:"center",justifyContent:"center",marginBottom:"10px",fontWeight:"normal",fontSize:"18px",border:e>n?"1px solid black":"",position:"relative"}},u={fontSize:"18px",color:"#1E1E1E",fontWeight:"500",fontFamily:"Noto Sans,sans-serif",marginRight:"6px"},d={fontSize:"18px",color:"#263238",fontWeight:"400",fontFamily:"Noto Sans,sans-serif",margin:"0px 6px 0px 0px"},s={position:"absolute",width:"2px",height:"50px",backgroundColor:"grey",left:"50%",top:"100%",transform:"translateX(-50%)"},c=(window.Digit.Utils.browser.isMobile(),i.length);return l.createElement("div",{className:"stepper",style:{width:"100%",display:"flex",flexDirection:"row",alignItems:"top",justifyContent:"flex-start"}},l.createElement("div",{className:"stepper-navigation-bar",style:{display:"flex",flexDirection:"column",justifyContent:"space-between",height:"50%",marginBottom:"20px"}},[...Array(c)].map((e,t)=>{return l.createElement("div",{className:"step-content",key:t,style:(o=t+1<=n,{display:"flex",alignItems:"center",justifyContent:"flex-end",flex:1,color:o?"#3f51b5":"#ccc",padding:"10px 10px",width:"260px"})},l.createElement("div",{className:"step-sub-content",style:{display:"flex",flexDirection:"column",alignItems:"flex-end",margin:"10px"}},t+1===c?null:l.createElement("div",{className:"step-number",style:d}),l.createElement("div",{className:"step-label",style:u},a(i[t].stepLabel))),l.createElement("div",{className:"step-circle",style:r(t+1)},t+1,t<c-1&&l.createElement("div",{style:s})));var o})),l.createElement("div",{className:"stepper-body",style:{width:"100%",marginBottom:"20px"}},t))},yi=e=>{let{stepsList:t=[],onSubmit:n,step:i,setStep:a}=e;const r=t.filter(e=>e.isStepEnabled),{t:u}=o.useTranslation();function d(){i<r.length?c():i===r.length&&n()}function s(){i>1&&v()}const c=()=>a(i+1),v=()=>a(i-1);return l.createElement(Ci,{currentStep:i,nextStep:c,prevStep:v,stepsList:r},(()=>{var e,t;const n=r[i-1],{component:o,key:a,texts:c,currStepConfig:v}=n,m=null===(e=Digit)||void 0===e||null===(t=e.ComponentRegistryService)||void 0===t?void 0:t.getComponent(o);return l.createElement(l.Fragment,null,l.createElement(m,{config:{key:a,texts:c,component:o,currStepNumber:i,currStepConfig:v},onGoNext:d,onBackClick:s,t:u}))})())},Di=[{head:"NOC_APPLICATION_REGISTRATION",stepNumber:1,body:[{component:"NOCApplicantDetails",withoutLabel:!0,key:"applicantDetails",type:"component"},{component:"NOCProfessionalDetails",withoutLabel:!0,key:"professionalDetails",type:"component"}]},{head:"ES_SITE_DETAILS",stepNumber:2,body:[{component:"NOCSiteDetails",withoutLabel:!0,key:"siteDetails",type:"component"},{component:"NOCSpecificationDetails",withoutLabel:!0,key:"siteDetails",type:"component"}]},{head:"ES_TITILE_DOCUMENT_DETAILS",stepNumber:3,body:[{component:"NOCDocumentsRequired",withoutLabel:!0,key:"documents",type:"component"}]},{head:"ES_TITILE_SUMMARY_DETAILS",stepNumber:4,body:[{component:"NOCSummary",withoutLabel:!0,key:"summary",type:"component"}]}],Li=(e,t)=>({type:"UPDATE_NOCNewApplication_FORM",payload:{key:e,value:t}}),Oi=e=>({type:"SET_NOCNewApplication_STEP",payload:e}),Ti=(e,t)=>({type:"UPDATE_NOCNewApplication_CoOrdinates",payload:{key:e,value:t}}),Ii=[{head:"APPLICATION DETAILS",stepLabel:"NOC_APPLICATION_DETAILS",stepNumber:1,isStepEnabled:!0,type:"component",component:"NewNOCStepFormOne",key:"applicationDetails",withoutLabel:!0,texts:{submitBarLabel:"CS_COMMON_NEXT"}},{head:"SITE DETAILS",stepLabel:"NOC_SITE_DETAILS",stepNumber:2,isStepEnabled:!0,type:"component",component:"NewNOCStepFormTwo",key:"siteDetails",withoutLabel:!0,texts:{submitBarLabel:"CS_COMMON_NEXT"}},{head:"DOCUMENT DETAILS",stepLabel:"ES_TITILE_DOCUMENT_DETAILS",stepNumber:3,isStepEnabled:!0,type:"component",component:"NewNOCStepFormThree",key:"documents",withoutLabel:!0,texts:{submitBarLabel:"CS_COMMON_NEXT"}},{head:"SUMMARY DETAILS",stepLabel:"ES_TITILE_SUMMARY_DETAILS",stepNumber:4,isStepEnabled:!0,type:"component",component:"NewNOCStepFormFour",key:"summary",withoutLabel:!0,texts:{submitBarLabel:"CS_COMMON_SUBMIT"}}].map(e=>c({},e,{currStepConfig:Di.filter(t=>t.stepNumber===e.stepNumber)})),wi=e=>{var i,o,a,r,u,d;const{t:s,currentStepData:c,Controller:v,control:m,setValue:p,errors:f,errorStyle:E}=e,g=(Digit.ULBService.getCurrentTenantId(),Digit.ULBService.getStateId()),{data:_}=Digit.Hooks.obps.useMDMS(g,"common-masters",["GenderType"]);let h=[];_&&_["common-masters"].GenderType.filter(e=>e.active).map(e=>{h.push({i18nKey:"COMMON_GENDER_"+e.code,code:""+e.code,value:""+e.code})}),n.useEffect(()=>{console.log("currentStepData1",c);const e=null==c?void 0:c.applicationDetails;e&&Object.entries(e).forEach(e=>{let[t,n]=e;p(t,n)})},[c,p]);const[A,S]=n.useState(""),[N,b]=n.useState(null),[C,y]=n.useState(null);n.useEffect(()=>{C&&Object.entries(C).forEach(e=>{let[t,n]=e;if("name"===t)p("applicantOwnerOrFirmName",n,{shouldValidate:!0,shouldDirty:!0});else if("emailId"===t)p("applicantEmailId",n,{shouldValidate:!0,shouldDirty:!0});else if("gender"===t){const e=h.find(e=>e.code===n);p("applicantGender",e,{shouldValidate:!0,shouldDirty:!0})}else"dob"===t?p("applicantDateOfBirth",n,{shouldValidate:!0,shouldDirty:!0}):"fatherOrHusbandName"===t?p("applicantFatherHusbandName",n):"permanentAddress"===t&&p("applicantAddress",n,{shouldValidate:!0,shouldDirty:!0})})},[C]);const D=window.location.pathname.includes("edit");return l.createElement(l.Fragment,null,l.createElement(t.CardSectionHeader,{className:"card-section-header"},s("NOC_APPLICANT_DETAILS")),l.createElement("div",null,D&&l.createElement(t.CardSectionSubText,{style:{color:"red",margin:"10px 0px"}}," To update your Mobile No, Name, Email, Date of Birth, or Gender, please go the Citizen's Edit Profile section"),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+s("NOC_APPLICANT_MOBILE_NO_LABEL"),"*"),l.createElement("div",{className:"field"},l.createElement(v,{control:m,name:"applicantMobileNumber",rules:{required:s("REQUIRED_FIELD"),pattern:{value:/^[6-9]\d{9}$/,message:s("INVALID_MOBILE_NUMBER")}},render:e=>l.createElement(t.TextInput,{value:e.value,onChange:t=>{e.onChange(t.target.value),S(t.target.value)},onBlur:t=>{e.onBlur(t)},t:s,disabled:D})})),l.createElement("div",{className:"search-icon",onClick:D?null:function(){try{return""===A||10!==A.length?(b({key:"true",error:!0,message:"INVALID_MOBILE_NUMBER"}),Promise.resolve()):Promise.resolve(Digit.UserService.userSearch(Digit.ULBService.getStateId(),{userName:A},{})).then(function(e){var t,n;0===(null==e||null===(t=e.user)||void 0===t?void 0:t.length)?b({key:"true",warning:!0,message:"ERR_MOBILE_NUMBER_NOT_REGISTERED"}):y(null==e||null===(n=e.user)||void 0===n?void 0:n[0])})}catch(e){return Promise.reject(e)}}}," ",l.createElement(t.SearchIcon,null)," ")),l.createElement(t.CardLabelError,{style:E},(null==f||null===(i=f.applicantMobileNumber)||void 0===i?void 0:i.message)||""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+s("NOC_FIRM_OWNER_NAME_LABEL"),"*"),l.createElement("div",{className:"field"},l.createElement(v,{control:m,name:"applicantOwnerOrFirmName",rules:{required:s("REQUIRED_FIELD"),maxLength:{value:100,message:s("MAX_100_CHARACTERS_ALLOWED")}},render:e=>l.createElement(t.TextInput,{value:e.value||(null==C?void 0:C.name),onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)},t:s,disabled:D})}))),l.createElement(t.CardLabelError,{style:E},null!=f&&f.applicantOwnerOrFirmName?f.applicantOwnerOrFirmName.message:""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+s("NOC_APPLICANT_EMAIL_LABEL"),"*"),l.createElement("div",{className:"field"},l.createElement(v,{control:m,name:"applicantEmailId",rules:{required:s("REQUIRED_FIELD"),pattern:{value:/^[^\s@]+@[^\s@]+\.[^\s@]+$/,message:s("INVALID_EMAIL_FORMAT")}},render:e=>l.createElement(t.TextInput,{value:e.value||(null==C?void 0:C.emailId),onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)},t:s,disabled:D})}))),l.createElement(t.CardLabelError,{style:E},(null==f||null===(o=f.applicantEmailId)||void 0===o?void 0:o.message)||""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+s("NOC_APPLICANT_FATHER_HUSBAND_NAME_LABEL")),l.createElement("div",{className:"field"},l.createElement(v,{control:m,name:"applicantFatherHusbandName",render:e=>l.createElement(t.TextInput,{value:e.value||(null==C?void 0:C.fatherOrHusbandName),onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)},t:s})}))),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+s("NOC_APPLICANT_PROPERTY_ID_LABEL"),"*"),l.createElement("div",{className:"field"},l.createElement(v,{control:m,name:"applicantPropertyId",rules:{required:s("REQUIRED_FIELD")},render:e=>l.createElement(t.TextInput,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)},t:s})}))),l.createElement(t.CardLabelError,{style:E},(null==f||null===(a=f.applicantPropertyId)||void 0===a?void 0:a.message)||""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+s("NOC_APPLICANT_ADDRESS_LABEL"),"*"),l.createElement("div",{className:"field"},l.createElement(v,{control:m,name:"applicantAddress",rules:{required:s("REQUIRED_FIELD"),maxLength:{value:100,message:s("MAX_100_CHARACTERS_ALLOWED")}},render:e=>l.createElement(t.TextArea,{value:e.value||(null==C?void 0:C.permanentAddress),onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)},t:s})}))),l.createElement(t.CardLabelError,{style:E},(null==f||null===(r=f.applicantAddress)||void 0===r?void 0:r.message)||""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+s("NOC_APPLICANT_DOB_LABEL"),"*"),l.createElement("div",{className:"field"},l.createElement(v,{control:m,name:"applicantDateOfBirth",rules:{required:s("REQUIRED_FIELD"),validate:e=>{const t=new Date,n=new Date(e),l=t.getFullYear()-n.getFullYear(),i=t.getMonth()-n.getMonth(),o=t.getDate()-n.getDate();return l>=18||18===l&&(i>0||0===i&&o>=0)||s("DOB_MUST_BE_18_YEARS_OLD")}},render:e=>l.createElement(t.TextInput,{type:"date",value:e.value||(null==C?void 0:C.dob),onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)},min:"1900-01-01",max:(new Date).toISOString().split("T")[0],disabled:D})}))),l.createElement(t.CardLabelError,{style:E},(null==f||null===(u=f.applicantDateOfBirth)||void 0===u?void 0:u.message)||""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+s("NOC_APPLICANT_GENDER_LABEL"),"*"),l.createElement("div",{className:"field"},l.createElement(v,{control:m,name:"applicantGender",rules:{required:s("REQUIRED_FIELD")},render:e=>l.createElement(t.RadioButtons,{t:s,options:h,optionsKey:"code",value:e.value,selectedOption:e.value,onSelect:t=>{e.onChange(t)},isDependent:!0,disabled:D})}))),l.createElement(t.CardLabelError,{style:E},(null==f||null===(d=f.applicantGender)||void 0===d?void 0:d.message)||"")),N&&l.createElement(t.Toast,{error:null==N?void 0:N.error,warning:null==N?void 0:N.warning,label:s(null==N?void 0:N.message),isDleteBtn:!0,onClose:()=>{b(null)}}))},Ri=e=>{var i,o,a,r,u,d,s;const{t:c,currentStepData:v,Controller:m,control:p,setValue:f,errors:E,errorStyle:g}=e,_=(Digit.ULBService.getCurrentTenantId(),Digit.ULBService.getStateId(),Digit.UserService.getUser());n.useEffect(()=>{console.log("currentStepData2",v);const e=null==v?void 0:v.applicationDetails;e&&Object.entries(e).forEach(e=>{let[t,n]=e;f(t,n)})},[v,f]);const{data:h}=Digit.Hooks.noc.useTenants(),[A,S]=n.useState(h);return l.createElement(l.Fragment,null,l.createElement(t.CardSectionHeader,{className:"card-section-header"},c("NOC_PROFESSIONAL_DETAILS")),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,""+c("NOC_PROFESSIONAL_NAME_LABEL"),"*"),l.createElement("div",{className:"field"},l.createElement(m,{control:p,name:"professionalName",defaultValue:null==_||null===(i=_.info)||void 0===i?void 0:i.name,rules:{required:c("REQUIRED_FIELD"),maxLength:{value:100,message:c("MAX_100_CHARACTERS_ALLOWED")}},render:e=>l.createElement(t.TextInput,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)},t:c,disabled:"true"})}))),l.createElement(t.CardLabelError,{style:g},null!=E&&E.professionalName?E.professionalName.message:""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+c("NOC_PROFESSIONAL_EMAIL_LABEL"),"*"),l.createElement("div",{className:"field"},l.createElement(m,{control:p,name:"professionalEmailId",defaultValue:null==_||null===(o=_.info)||void 0===o?void 0:o.emailId,rules:{required:c("REQUIRED_FIELD"),pattern:{value:/^[^\s@]+@[^\s@]+\.[^\s@]+$/,message:c("INVALID_EMAIL_FORMAT")}},render:e=>l.createElement(t.TextInput,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)},t:c,disabled:"true"})}))),l.createElement(t.CardLabelError,{style:g},(null==E||null===(a=E.professionalEmailId)||void 0===a?void 0:a.message)||""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+c("NOC_PROFESSIONAL_REGISTRATION_ID_LABEL"),"*"),l.createElement("div",{className:"field"},l.createElement(m,{control:p,name:"professionalRegId",rules:{required:c("REQUIRED_FIELD")},render:e=>l.createElement(t.TextInput,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)},t:c})}))),l.createElement(t.CardLabelError,{style:g},(null==E||null===(r=E.professionalRegId)||void 0===r?void 0:r.message)||""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+c("NOC_PROFESSIONAL_MOBILE_NO_LABEL"),"*"),l.createElement("div",{className:"field"},l.createElement(m,{control:p,name:"professionalMobileNumber",defaultValue:null==_||null===(u=_.info)||void 0===u?void 0:u.mobileNumber,rules:{required:c("REQUIRED_FIELD"),pattern:{value:/^[6-9]\d{9}$/,message:c("INVALID_MOBILE_NUMBER")}},render:e=>l.createElement(t.MobileNumber,{value:e.value,onChange:e.onChange,onBlur:e.onBlur,t:c,disable:"true"})}))),l.createElement(t.CardLabelError,{style:g},(null==E||null===(d=E.professionalMobileNumber)||void 0===d?void 0:d.message)||""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+c("NOC_PROFESSIONAL_ADDRESS_LABEL"),"*"),l.createElement("div",{className:"field"},l.createElement(m,{control:p,name:"professionalAddress",rules:{required:c("REQUIRED_FIELD"),maxLength:{value:100,message:c("MAX_100_CHARACTERS_ALLOWED")}},render:e=>l.createElement(t.TextArea,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)},t:c})}))),l.createElement(t.CardLabelError,{style:g},(null==E||null===(s=E.professionalAddress)||void 0===s?void 0:s.message)||""))},Pi=e=>{var i,o,a,r,u,d,s,v,m,p,f,E,g,_,h,A,S,N,b,C;let y;y=window.location.pathname.includes("employee")?window.localStorage.getItem("Employee.tenant-id"):window.localStorage.getItem("CITIZEN.CITY");const D=Digit.ULBService.getStateId(),{t:L,currentStepData:O,Controller:T,control:I,setValue:w,errors:R,errorStyle:P,useFieldArray:x,watch:B}=e,[F,M]=n.useState("0.00"),U=B("netPlotAreaAfterWidening"),k=B("areaLeftForRoadWidening");n.useEffect(()=>{const e=parseFloat(U),t=parseFloat(k),n=((isNaN(e)?0:e)+(isNaN(t)?0:t)).toFixed(2);M(n),w("netTotalArea",n)},[U,k]);const[W,H]=n.useState("0.00"),{fields:j,append:z,remove:V}=x({control:I,name:"floorArea"}),G=B("floorArea"),Y=B("basementArea");n.useEffect(()=>{const e=null==G?void 0:G.reduce((e,t)=>{const n=parseFloat(null==t?void 0:t.value);return e+(isNaN(n)?0:n)},0),t=isNaN(Y)?0:Y,n=(e+parseFloat(t)).toFixed(2);H(n),w("totalFloorArea",n)},[G,Y]);const[K,q]=n.useState((null==O||null===(i=O.siteDetails)||void 0===i?void 0:i.ulbName)||null),[X,J]=n.useState((null==O||null===(o=O.siteDetails)||void 0===o?void 0:o.ulbType)||""),[Q,Z]=n.useState((null==O||null===(a=O.siteDetails)||void 0===a?void 0:a.buildingStatus)||null),{data:$,isLoading:ee}=Digit.Hooks.noc.useBuildingType(D),{data:te,isLoading:ne}=Digit.Hooks.noc.useRoadType(D),{data:le,isLoading:ie}=Digit.Hooks.useTenants(),oe=null==le?void 0:le.map(e=>c({},e,{displayName:L(e.i18nKey)}));n.useEffect(()=>{if(K){var e;const t=null==K||null===(e=K.city)||void 0===e?void 0:e.ulbType;J(t),w("ulbType",t)}},[K,w]);const[ae,re]=n.useState((null==O||null===(r=O.siteDetails)||void 0===r?void 0:r.isBasementAreaAvailable)||null),ue=[{code:"YES",i18nKey:"YES"},{code:"NO",i18nKey:"NO"}],de=Digit.Hooks.noc.useTenants(),[se,ce]=n.useState(de),[ve,me]=n.useState((null==O||null===(u=O.siteDetails)||void 0===u?void 0:u.district)||null),[pe,fe]=n.useState([]),{data:Ee}=Digit.Hooks.useBoundaryLocalities(null==ve?void 0:ve.code,"revenue",{enabled:!!ve},L);return n.useEffect(()=>{(null==Ee?void 0:Ee.length)>0&&fe(Ee)},[Ee]),n.useEffect(()=>{if(y&&(null==de?void 0:de.length)>0){const e=de.find(e=>e.code===y);e&&(me(e),w("district",e))}},[y,de]),n.useEffect(()=>{const e=null==O?void 0:O.siteDetails;if(e&&(Object.entries(e).forEach(e=>{let[t,n]=e;"floorArea"!==t&&w(t,n)}),Array.isArray(e.floorArea))){for(let e=j.length-1;e>=0;e--)V(e);e.floorArea.forEach(e=>{z({value:e.value||""})})}},[O,w,z,V]),l.createElement(l.Fragment,null,l.createElement("div",{style:{marginBottom:"16px"}},l.createElement(t.CardSectionHeader,{className:"card-section-header"},L("NOC_SITE_DETAILS")),l.createElement("div",null,l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+L("NOC_PLOT_NO_LABEL"),"*"),l.createElement("div",{className:"field"},l.createElement(T,{control:I,name:"plotNo",rules:{required:L("REQUIRED_FIELD"),maxLength:{value:100,message:L("MAX_100_CHARACTERS_ALLOWED")}},render:e=>l.createElement(t.TextInput,{className:"form-field",value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)}})}))),l.createElement(t.CardLabelError,{style:P},null!=R&&R.plotNo?R.plotNo.message:""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},L("NOC_PROPOSED_SITE_ADDRESS"),"*"),l.createElement("div",{className:"field"},l.createElement(T,{control:I,name:"proposedSiteAddress",rules:{required:L("REQUIRED_FIELD"),maxLength:{value:200,message:L("MAX_200_CHARACTERS_ALLOWED")}},render:e=>l.createElement(t.TextArea,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)}})}))),l.createElement(t.CardLabelError,{style:P},null!=R&&R.proposedSiteAddress?R.proposedSiteAddress.message:""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+L("NOC_ULB_NAME_LABEL"),"*"),!ie&&l.createElement(T,{control:I,name:"ulbName",rules:{required:L("REQUIRED_FIELD")},render:e=>l.createElement(t.Dropdown,{className:"form-field",select:t=>{q(t),e.onChange(t)},selected:e.value,option:oe,optionKey:"displayName",t:L})})),l.createElement(t.CardLabelError,{style:P},null!=R&&R.ulbName?R.ulbName.message:""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+L("NOC_ULB_TYPE_LABEL"),"*"),l.createElement("div",{className:"field"},l.createElement(T,{control:I,name:"ulbType",render:e=>l.createElement(t.TextInput,{value:X||e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)},disable:"true"})}))),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+L("NOC_KHASRA_NO_LABEL"),"*"),l.createElement("div",{className:"field"},l.createElement(T,{control:I,name:"khasraNo",rules:{required:L("REQUIRED_FIELD"),maxLength:{value:100,message:L("MAX_100_CHARACTERS_ALLOWED")}},render:e=>l.createElement(t.TextArea,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)}})}))),l.createElement(t.CardLabelError,{style:P},(null==R||null===(d=R.khasraNo)||void 0===d?void 0:d.message)||""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+L("NOC_HADBAST_NO_LABEL"),"*"),l.createElement("div",{className:"field"},l.createElement(T,{control:I,name:"hadbastNo",rules:{required:L("REQUIRED_FIELD"),maxLength:{value:100,message:L("MAX_100_CHARACTERS_ALLOWED")}},render:e=>l.createElement(t.TextInput,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)}})}))),l.createElement(t.CardLabelError,{style:P},(null==R||null===(s=R.hadbastNo)||void 0===s?void 0:s.message)||""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+L("NOC_ROAD_TYPE_LABEL"),"*"),!ne&&l.createElement(T,{control:I,name:"roadType",rules:{required:L("REQUIRED_FIELD")},render:e=>l.createElement(t.Dropdown,{className:"form-field",select:e.onChange,selected:e.value,option:te,optionKey:"name",t:L})})),l.createElement(t.CardLabelError,{style:P},(null==R||null===(v=R.roadType)||void 0===v?void 0:v.message)||""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+L("NOC_AREA_LEFT_FOR_ROAD_WIDENING_LABEL"),"*"),l.createElement("div",{className:"field"},l.createElement(T,{control:I,name:"areaLeftForRoadWidening",rules:{required:L("REQUIRED_FIELD"),pattern:{value:/^[0-9]*\.?[0-9]+$/,message:L("ONLY_NUMERIC_VALUES_ALLOWED_MSG")},maxLength:{value:100,message:L("MAX_100_CHARACTERS_ALLOWED")}},render:e=>l.createElement(t.TextInput,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)}})}))),l.createElement(t.CardLabelError,{style:P},(null==R||null===(m=R.areaLeftForRoadWidening)||void 0===m?void 0:m.message)||""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+L("NOC_NET_PLOT_AREA_AFTER_WIDENING_LABEL"),"*"),l.createElement("div",{className:"field"},l.createElement(T,{control:I,name:"netPlotAreaAfterWidening",rules:{required:L("REQUIRED_FIELD"),pattern:{value:/^[0-9]*\.?[0-9]+$/,message:L("ONLY_NUMERIC_VALUES_ALLOWED_MSG")},maxLength:{value:100,message:L("MAX_100_CHARACTERS_ALLOWED")}},render:e=>l.createElement(t.TextInput,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)}})}))),l.createElement(t.CardLabelError,{style:P},(null==R||null===(p=R.netPlotAreaAfterWidening)||void 0===p?void 0:p.message)||""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+L("NOC_NET_TOTAL_AREA_LABEL"),"*"),l.createElement("div",{className:"field"},l.createElement(T,{control:I,name:"netTotalArea",rules:{required:L("REQUIRED_FIELD"),pattern:{value:/^[0-9]*\.?[0-9]+$/,message:L("ONLY_NUMERIC_VALUES_ALLOWED_MSG")},maxLength:{value:100,message:L("MAX_100_CHARACTERS_ALLOWED")}},defaultValue:F,render:e=>l.createElement(t.TextInput,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)},disabled:"true"})}))),l.createElement(t.CardLabelError,{style:P},(null==R||null===(f=R.netTotalArea)||void 0===f?void 0:f.message)||""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+L("NOC_ROAD_WIDTH_AT_SITE_LABEL"),"*"),l.createElement("div",{className:"field"},l.createElement(T,{control:I,name:"roadWidthAtSite",rules:{required:L("REQUIRED_FIELD"),pattern:{value:/^[0-9]*\.?[0-9]+$/,message:L("ONLY_NUMERIC_VALUES_ALLOWED_MSG")},maxLength:{value:100,message:L("MAX_100_CHARACTERS_ALLOWED")}},render:e=>l.createElement(t.TextInput,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)}})}))),l.createElement(t.CardLabelError,{style:P},null!=R&&R.roadWidthAtSite?R.roadWidthAtSite.message:""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+L("NOC_BUILDING_STATUS_LABEL"),"*"),!ee&&l.createElement(T,{control:I,name:"buildingStatus",rules:{required:L("REQUIRED_FIELD")},render:e=>l.createElement(t.Dropdown,{className:"form-field",select:t=>{Z(t),e.onChange(t)},selected:e.value,option:$,optionKey:"name",t:L})})),l.createElement(t.CardLabelError,{style:P},(null==R||null===(E=R.buildingStatus)||void 0===E?void 0:E.message)||""),"BUILTUP"===(null==Q?void 0:Q.code)&&l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+L("NOC_IS_BASEMENT_AREA_PRESENT_LABEL")," *"),l.createElement(T,{control:I,name:"isBasementAreaAvailable",rules:{required:L("REQUIRED_FIELD")},render:e=>l.createElement(t.Dropdown,{className:"form-field",select:t=>{re(t),e.onChange(t)},selected:e.value,option:ue,optionKey:"i18nKey",t:L})})),l.createElement(t.CardLabelError,{style:P},(null==R||null===(g=R.isBasementAreaAvailable)||void 0===g?void 0:g.message)||""),"BUILTUP"===(null==Q?void 0:Q.code)&&"YES"===(null==ae?void 0:ae.code)&&l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+L("NOC_BASEMENT_AREA_LABEL"),"*"),l.createElement("div",{className:"field"},l.createElement(T,{control:I,name:"basementArea",rules:{required:L("REQUIRED_FIELD"),pattern:{value:/^[0-9]*\.?[0-9]+$/,message:L("ONLY_NUMERIC_VALUES_ALLOWED_MSG")},maxLength:{value:100,message:L("MAX_100_CHARACTERS_ALLOWED")}},render:e=>l.createElement(t.TextInput,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)}})}))),l.createElement(t.CardLabelError,{style:P},null!=R&&R.basementArea?R.basementArea.message:""),"BUILTUP"===(null==Q?void 0:Q.code)&&j.map((e,n)=>l.createElement("div",{style:{display:"flex",gap:"10px",flexDirection:"column"}},l.createElement(t.CardLabel,{className:"card-label-smaller"},0===n?"Ground":""+n," Floor Area(sq mt)*"),l.createElement("div",{key:e.id,className:"field",style:{display:"flex",gap:"10px"}},l.createElement(T,{control:I,name:"floorArea."+n+".value",defaultValue:e.value,rules:{required:L("REQUIRED_FIELD"),pattern:{value:/^[0-9]*\.?[0-9]+$/,message:L("ONLY_NUMERIC_VALUES_ALLOWED_MSG")},maxLength:{value:100,message:L("MAX_100_CHARACTERS_ALLOWED")}},render:e=>{var i,o;return l.createElement(l.Fragment,null,l.createElement(t.TextInput,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)}}),(null==R||null===(i=R.floorArea)||void 0===i||null===(o=i[n])||void 0===o?void 0:o.value)&&l.createElement(t.CardLabelError,{className:P},R.floorArea[n].value.message))}}),l.createElement("button",{type:"button",onClick:()=>V(n)},"❌")))),"BUILTUP"===(null==Q?void 0:Q.code)&&l.createElement("button",{type:"button",onClick:()=>z({value:""})},"➕ Add Floor"),"BUILTUP"===(null==Q?void 0:Q.code)&&l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+L("NOC_TOTAL_FLOOR_BUILT_UP_AREA_LABEL")),l.createElement("div",{className:"field"},l.createElement(T,{control:I,name:"totalFloorArea",defaultValue:W,render:e=>l.createElement(t.TextInput,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)},disable:"true"})}))),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+L("NOC_SITE_WARD_NO_LABEL"),"*"),l.createElement("div",{className:"field"},l.createElement(T,{control:I,name:"wardNo",rules:{required:L("REQUIRED_FIELD"),maxLength:{value:100,message:L("MAX_100_CHARACTERS_ALLOWED")}},render:e=>l.createElement(t.TextInput,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)}})}))),l.createElement(t.CardLabelError,{style:P},(null==R||null===(_=R.wardNo)||void 0===_?void 0:_.message)||""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+L("NOC_DISTRICT_LABEL"),"*"),l.createElement(T,{control:I,name:"district",rules:{required:L("REQUIRED_FIELD")},render:e=>l.createElement(t.Dropdown,{className:"form-field",select:t=>{me(t),e.onChange(t)},selected:e.value,option:se.sort((e,t)=>e.name.localeCompare(t.name)),optionKey:"name",disable:"true",t:L})})),l.createElement(t.CardLabelError,{style:P},(null==R||null===(h=R.district)||void 0===h?void 0:h.message)||""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+L("NOC_ZONE_LABEL"),"*"),l.createElement(T,{control:I,name:"zone",rules:{required:L("REQUIRED_FIELD")},render:e=>l.createElement(t.Dropdown,{className:"form-field",select:e.onChange,selected:e.value,option:pe,optionKey:"i18nkey",t:L})})),l.createElement(t.CardLabelError,{style:P},(null==R||null===(A=R.zone)||void 0===A?void 0:A.message)||""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+L("NOC_SITE_VILLAGE_NAME_LABEL"),"*"),l.createElement("div",{className:"field"},l.createElement(T,{control:I,name:"villageName",rules:{required:L("REQUIRED_FIELD"),maxLength:{value:100,message:L("MAX_100_CHARACTERS_ALLOWED")}},render:e=>l.createElement(t.TextInput,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)}})}))),l.createElement(t.CardLabelError,{style:P},(null==R||null===(S=R.villageName)||void 0===S?void 0:S.message)||""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+L("NOC_SITE_COLONY_NAME_LABEL"),"*"),l.createElement("div",{className:"field"},l.createElement(T,{control:I,name:"colonyName",rules:{required:L("REQUIRED_FIELD"),maxLength:{value:100,message:L("MAX_100_CHARACTERS_ALLOWED")}},render:e=>l.createElement(t.TextInput,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)}})}))),l.createElement(t.CardLabelError,{style:P},(null==R||null===(N=R.colonyName)||void 0===N?void 0:N.message)||""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+L("NOC_SITE_VASIKA_NO_LABEL"),"*"),l.createElement("div",{className:"field"},l.createElement(T,{control:I,name:"vasikaNumber",rules:{required:L("REQUIRED_FIELD"),maxLength:{value:100,message:L("MAX_100_CHARACTERS_ALLOWED")}},render:e=>l.createElement(t.TextInput,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)}})}))),l.createElement(t.CardLabelError,{style:P},(null==R||null===(b=R.vasikaNumber)||void 0===b?void 0:b.message)||""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+L("NOC_SITE_KHEWAT_AND_KHATUNI_NO_LABEL"),"*"),l.createElement("div",{className:"field"},l.createElement(T,{control:I,name:"khewatAndKhatuniNo",rules:{required:L("REQUIRED_FIELD"),maxLength:{value:100,message:L("MAX_100_CHARACTERS_ALLOWED")}},render:e=>l.createElement(t.TextInput,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)}})}))),l.createElement(t.CardLabelError,{style:P},(null==R||null===(C=R.khewatAndKhatuniNo)||void 0===C?void 0:C.message)||"")),l.createElement(t.BreakLine,null)))},xi=e=>{var i,o,a,r;const{t:u,currentStepData:d,Controller:s,control:c,setValue:v,errors:m,errorStyle:p}=e,f=(Digit.ULBService.getCurrentTenantId(),Digit.ULBService.getStateId()),[E,g]=n.useState((null==d||null===(i=d.siteDetails)||void 0===i?void 0:i.specificationBuildingCategory)||null),{data:_,isLoading:h}=Digit.Hooks.noc.useBuildingCategory(f),{data:A,isLoading:S}=Digit.Hooks.noc.useNocType(f),N=[{code:"YES",i18nKey:"YES"},{code:"NO",i18nKey:"NO"}];return n.useEffect(()=>{console.log("currentStepData4",d);const e=null==d?void 0:d.siteDetails;e&&Object.entries(e).forEach(e=>{let[t,n]=e;v(t,n)})},[d,v]),l.createElement(l.Fragment,null,l.createElement(t.CardSectionHeader,null,u("NOC_SPECIFICATION_DETAILS")),l.createElement("div",null,l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+u("NOC_PLOT_AREA_JAMA_BANDI_LABEL"),"*"),l.createElement("div",{className:"field"},l.createElement(s,{control:c,name:"specificationPlotArea",rules:{required:u("REQUIRED_FIELD"),pattern:{value:/^[0-9]*\.?[0-9]+$/,message:u("ONLY_NUMERIC_VALUES_ALLOWED_MSG")},maxLength:{value:100,message:u("MAX_100_CHARACTERS_ALLOWED")}},render:e=>l.createElement(t.TextInput,{className:"form-field",value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)},t:u})}))),l.createElement(t.CardLabelError,{style:p},null!=m&&m.specificationPlotArea?m.specificationPlotArea.message:""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+u("NOC_BUILDING_CATEGORY_LABEL"),"*"),!h&&_.length>0&&l.createElement(s,{control:c,name:"specificationBuildingCategory",rules:{required:u("REQUIRED_FIELD")},render:e=>l.createElement(t.Dropdown,{className:"form-field",select:t=>{g(t),e.onChange(t)},selected:e.value,option:_,optionKey:"name",t:u})})),l.createElement(t.CardLabelError,{style:p},null!=m&&m.specificationBuildingCategory?m.specificationBuildingCategory.message:""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+u("NOC_NOC_TYPE_LABEL"),"*"),!S&&l.createElement(s,{control:c,name:"specificationNocType",rules:{required:u("REQUIRED_FIELD")},render:e=>l.createElement(t.Dropdown,{className:"form-field",select:e.onChange,selected:e.value,option:A,optionKey:"name",t:u})})),l.createElement(t.CardLabelError,{style:p},(null==m||null===(o=m.specificationNocType)||void 0===o?void 0:o.message)||""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+u("NOC_RESTRICTED_AREA_LABEL")," *"),l.createElement(s,{control:c,name:"specificationRestrictedArea",rules:{required:u("REQUIRED_FIELD")},render:e=>l.createElement(t.Dropdown,{className:"form-field",select:e.onChange,selected:e.value,option:N,optionKey:"i18nKey",t:u})})),l.createElement(t.CardLabelError,{style:p},(null==m||null===(a=m.specificationRestrictedArea)||void 0===a?void 0:a.message)||""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+u("NOC_IS_SITE_UNDER_MASTER_PLAN_LABEL")," *"),l.createElement(s,{control:c,name:"specificationIsSiteUnderMasterPlan",rules:{required:u("REQUIRED_FIELD")},render:e=>l.createElement(t.Dropdown,{className:"form-field",select:e.onChange,selected:e.value,option:N,optionKey:"i18nKey",t:u})})),l.createElement(t.CardLabelError,{style:p},(null==m||null===(r=m.specificationIsSiteUnderMasterPlan)||void 0===r?void 0:r.message)||"")))},Bi=e=>{let{documents:i}=e;const a=Digit.ULBService.getStateId(),{t:r}=o.useTranslation(),[u,d]=n.useState(null),[s,c]=n.useState(null);return n.useEffect(function(){try{const e=function(){if(i){var e;const t=(null==i||null===(e=i.find(e=>"OWNER.OWNERPHOTO"===e.documentType))||void 0===e?void 0:e.documentUid)||"",n=function(){if(t)return Promise.resolve(Digit.UploadServices.Filefetch([t],a)).then(function(e){var t,n,l;null!=e&&null!==(t=e.data)&&void 0!==t&&t.fileStoreIds&&d(null==e||null===(n=e.data)||void 0===n||null===(l=n.fileStoreIds[0])||void 0===l?void 0:l.url)})}();if(n&&n.then)return n.then(function(){})}}();return Promise.resolve(e&&e.then?e.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},[i]),l.createElement(t.Card,null,l.createElement("div",{style:{display:"flex",justifyContent:"flex-end",marginTop:"10px",padding:"0px 20px"}},l.createElement("div",{style:{textAlign:"center"}},l.createElement("img",{src:u,alt:"Owner Photo",style:{width:"100px",height:"100px",objectFit:"cover",borderRadius:"10%",cursor:u?"pointer":"default"},onClick:()=>u&&c(u)}),l.createElement("div",null,r("OWNER_OWNERPHOTO")))),s&&l.createElement(t.ImageViewer,{imageSrc:s,onClose:()=>{c(null)}}))};function Fi(e){var n,o,a,r,u,s,c,v,m,p,f,E,g,_,h,A,S,N,b,C,y,D,L,O,T,I,w,R,P,x,B,F,M,U,k,W,H,j,z,V,G,Y,K,q,X,J,Q,Z,$,ee,te,ne,le,ie,oe,ae,re,ue,de,se,ce,ve,me,pe,fe,Ee,ge,_e,he;let{currentStepData:Ae,t:Se}=e;i.useLocation(),i.useHistory(),d.useDispatch(),console.log("formData in Summary Page",Ae);const Ne=d.useSelector(function(e){var t,n;return(null==e||null===(t=e.noc)||void 0===t||null===(n=t.NOCNewApplicationFormReducer)||void 0===n?void 0:n.coordinates)||{}});console.log("coordinates in summary page",Ne);const be={backgroundColor:"#ffffff",padding:"1rem 1.5rem",borderRadius:"8px",marginBottom:"2rem",boxShadow:"0 2px 4px rgba(0, 0, 0, 0.05)"},Ce={display:"flex",justifyContent:"space-between",borderBottom:"1px dashed #e0e0e0",padding:"0.5rem 0",color:"#333"},ye={fontSize:"1.5rem",borderBottom:"2px solid #ccc",paddingBottom:"0.3rem",color:"#2e4a66",marginTop:"2rem",marginBottom:"1rem"},De={fontWeight:"bold",color:"#555"},Le=(e,n)=>l.createElement("div",{style:Ce},l.createElement(t.CardLabel,{style:De},e),l.createElement("div",null,n||"NA"));Digit.UserService.getUser();let Oe=null==Ae||null===(n=Ae.documents)||void 0===n||null===(o=n.documents)||void 0===o?void 0:o.documents;return console.log("documents here in summary",Oe),l.createElement("div",{style:{padding:"2rem",backgroundColor:"#f9f9f9",fontFamily:"'Segoe UI', Tahoma, Geneva, Verdana, sans-serif",color:"#333"}},l.createElement("h2",{style:ye},Se("OWNER_OWNERPHOTO")),l.createElement("div",{style:be},l.createElement(Bi,{documents:null==Ae||null===(a=Ae.documents)||void 0===a||null===(r=a.documents)||void 0===r?void 0:r.documents})),l.createElement("h2",{style:ye},Se("NOC_APPLICANT_DETAILS")),l.createElement("div",{style:be},Le(Se("NOC_FIRM_OWNER_NAME_LABEL"),null==Ae||null===(u=Ae.applicationDetails)||void 0===u?void 0:u.applicantOwnerOrFirmName),Le(Se("NOC_APPLICANT_EMAIL_LABEL"),null==Ae||null===(s=Ae.applicationDetails)||void 0===s?void 0:s.applicantEmailId),Le(Se("NOC_APPLICANT_FATHER_HUSBAND_NAME_LABEL"),null==Ae||null===(c=Ae.applicationDetails)||void 0===c?void 0:c.applicantFatherHusbandName),Le(Se("NOC_APPLICANT_PROPERTY_ID_LABEL"),null==Ae||null===(v=Ae.applicationDetails)||void 0===v?void 0:v.applicantPropertyId),Le(Se("NOC_APPLICANT_MOBILE_NO_LABEL"),null==Ae||null===(m=Ae.applicationDetails)||void 0===m?void 0:m.applicantMobileNumber),Le(Se("NOC_APPLICANT_DOB_LABEL"),null==Ae||null===(p=Ae.applicationDetails)||void 0===p?void 0:p.applicantDateOfBirth),Le(Se("NOC_APPLICANT_GENDER_LABEL"),null==Ae||null===(f=Ae.applicationDetails)||void 0===f||null===(E=f.applicantGender)||void 0===E?void 0:E.code),Le(Se("NOC_APPLICANT_ADDRESS_LABEL"),null==Ae||null===(g=Ae.applicationDetails)||void 0===g?void 0:g.applicantAddress)),(null==Ae||null===(_=Ae.applicationDetails)||void 0===_?void 0:_.professionalName)&&l.createElement(l.Fragment,null,l.createElement("h2",{style:ye},Se("NOC_PROFESSIONAL_DETAILS")),l.createElement("div",{style:be},Le(Se("NOC_PROFESSIONAL_NAME_LABEL"),null==Ae||null===(h=Ae.applicationDetails)||void 0===h?void 0:h.professionalName),Le(Se("NOC_PROFESSIONAL_EMAIL_LABEL"),null==Ae||null===(A=Ae.applicationDetails)||void 0===A?void 0:A.professionalEmailId),Le(Se("NOC_PROFESSIONAL_REGISTRATION_ID_LABEL"),null==Ae||null===(S=Ae.applicationDetails)||void 0===S?void 0:S.professionalRegId),Le(Se("NOC_PROFESSIONAL_MOBILE_NO_LABEL"),null==Ae||null===(N=Ae.applicationDetails)||void 0===N?void 0:N.professionalMobileNumber),Le(Se("NOC_PROFESSIONAL_ADDRESS_LABEL"),null==Ae||null===(b=Ae.applicationDetails)||void 0===b?void 0:b.professionalAddress))),l.createElement("h2",{style:ye},Se("NOC_SITE_DETAILS")),l.createElement("div",{style:be},Le(Se("NOC_PLOT_NO_LABEL"),null==Ae||null===(C=Ae.siteDetails)||void 0===C?void 0:C.plotNo),Le(Se("NOC_PROPOSED_SITE_ADDRESS"),null==Ae||null===(y=Ae.siteDetails)||void 0===y?void 0:y.proposedSiteAddress),Le(Se("NOC_ULB_NAME_LABEL"),null==Ae||null===(D=Ae.siteDetails)||void 0===D||null===(L=D.ulbName)||void 0===L?void 0:L.name),Le(Se("NOC_ULB_TYPE_LABEL"),null==Ae||null===(O=Ae.siteDetails)||void 0===O?void 0:O.ulbType),Le(Se("NOC_KHASRA_NO_LABEL"),null==Ae||null===(T=Ae.siteDetails)||void 0===T?void 0:T.khasraNo),Le(Se("NOC_HADBAST_NO_LABEL"),null==Ae||null===(I=Ae.siteDetails)||void 0===I?void 0:I.hadbastNo),Le(Se("NOC_ROAD_TYPE_LABEL"),null==Ae||null===(w=Ae.siteDetails)||void 0===w||null===(R=w.roadType)||void 0===R?void 0:R.name),Le(Se("NOC_AREA_LEFT_FOR_ROAD_WIDENING_LABEL"),null==Ae||null===(P=Ae.siteDetails)||void 0===P?void 0:P.areaLeftForRoadWidening),Le(Se("NOC_NET_PLOT_AREA_AFTER_WIDENING_LABEL"),null==Ae||null===(x=Ae.siteDetails)||void 0===x?void 0:x.netPlotAreaAfterWidening),Le(Se("NOC_NET_TOTAL_AREA_LABEL"),null==Ae||null===(B=Ae.siteDetails)||void 0===B?void 0:B.netTotalArea),Le(Se("NOC_ROAD_WIDTH_AT_SITE_LABEL"),null==Ae||null===(F=Ae.siteDetails)||void 0===F?void 0:F.roadWidthAtSite),Le(Se("NOC_BUILDING_STATUS_LABEL"),null==Ae||null===(M=Ae.siteDetails)||void 0===M||null===(U=M.buildingStatus)||void 0===U?void 0:U.name),Le(Se("NOC_IS_BASEMENT_AREA_PRESENT_LABEL"),null==Ae||null===(k=Ae.siteDetails)||void 0===k||null===(W=k.isBasementAreaAvailable)||void 0===W?void 0:W.code),"BUILTUP"===(null==Ae||null===(H=Ae.siteDetails)||void 0===H||null===(j=H.buildingStatus)||void 0===j?void 0:j.code)&&Le(Se("NOC_BASEMENT_AREA_LABEL"),null==Ae||null===(z=Ae.siteDetails)||void 0===z?void 0:z.basementArea),"BUILTUP"===(null==Ae||null===(V=Ae.siteDetails)||void 0===V||null===(G=V.buildingStatus)||void 0===G?void 0:G.code)&&(null==Ae||null===(Y=Ae.siteDetails)||void 0===Y||null===(K=Y.floorArea)||void 0===K?void 0:K.map((e,t)=>Le((e=>{if(0===e)return Se("NOC_GROUND_FLOOR_AREA_LABEL");const t=e%10,n=e%100;let l="th";return(n<11||n>13)&&(1===t?l="st":2===t?l="nd":3===t&&(l="rd")),""+e+l+" "+Se("NOC_FLOOR_AREA_LABEL")})(t),null==e?void 0:e.value))),"BUILTUP"===(null==Ae||null===(q=Ae.siteDetails)||void 0===q||null===(X=q.buildingStatus)||void 0===X?void 0:X.code)&&Le(Se("NOC_TOTAL_FLOOR_BUILT_UP_AREA_LABEL"),null==Ae||null===(J=Ae.siteDetails)||void 0===J?void 0:J.totalFloorArea),Le(Se("NOC_DISTRICT_LABEL"),null==Ae||null===(Q=Ae.siteDetails)||void 0===Q||null===(Z=Q.district)||void 0===Z?void 0:Z.name),Le(Se("NOC_ZONE_LABEL"),null==Ae||null===($=Ae.siteDetails)||void 0===$||null===(ee=$.zone)||void 0===ee?void 0:ee.name),Le(Se("NOC_SITE_WARD_NO_LABEL"),null==Ae||null===(te=Ae.siteDetails)||void 0===te?void 0:te.wardNo),Le(Se("NOC_SITE_VILLAGE_NAME_LABEL"),null==Ae||null===(ne=Ae.siteDetails)||void 0===ne?void 0:ne.villageName),Le(Se("NOC_SITE_COLONY_NAME_LABEL"),null==Ae||null===(le=Ae.siteDetails)||void 0===le?void 0:le.colonyName),Le(Se("NOC_SITE_VASIKA_NO_LABEL"),null==Ae||null===(ie=Ae.siteDetails)||void 0===ie?void 0:ie.vasikaNumber),Le(Se("NOC_SITE_KHEWAT_AND_KHATUNI_NO_LABEL"),null==Ae||null===(oe=Ae.siteDetails)||void 0===oe?void 0:oe.khewatAndKhatuniNo)),l.createElement("h2",{style:ye},Se("NOC_SPECIFICATION_DETAILS")),l.createElement("div",{style:be},Le(Se("NOC_PLOT_AREA_JAMA_BANDI_LABEL"),null==Ae||null===(ae=Ae.siteDetails)||void 0===ae?void 0:ae.specificationPlotArea),Le(Se("NOC_BUILDING_CATEGORY_LABEL"),null==Ae||null===(re=Ae.siteDetails)||void 0===re||null===(ue=re.specificationBuildingCategory)||void 0===ue?void 0:ue.name),Le(Se("NOC_NOC_TYPE_LABEL"),null==Ae||null===(de=Ae.siteDetails)||void 0===de||null===(se=de.specificationNocType)||void 0===se?void 0:se.name),Le(Se("NOC_RESTRICTED_AREA_LABEL"),null==Ae||null===(ce=Ae.siteDetails)||void 0===ce||null===(ve=ce.specificationRestrictedArea)||void 0===ve?void 0:ve.code),Le(Se("NOC_IS_SITE_UNDER_MASTER_PLAN_LABEL"),null==Ae||null===(me=Ae.siteDetails)||void 0===me||null===(pe=me.specificationIsSiteUnderMasterPlan)||void 0===pe?void 0:pe.code)),l.createElement("h2",{style:ye},Se("NOC_SITE_COORDINATES_LABEL")),l.createElement("div",{style:be},Le(Se("COMMON_LATITUDE1_LABEL"),null==Ne?void 0:Ne.Latitude1),Le(Se("COMMON_LONGITUDE1_LABEL"),null==Ne?void 0:Ne.Longitude1),Le(Se("COMMON_LATITUDE2_LABEL"),null==Ne?void 0:Ne.Latitude2),Le(Se("COMMON_LONGITUDE2_LABEL"),null==Ne?void 0:Ne.Longitude2)),l.createElement("h2",{style:ye},Se("NOC_TITILE_DOCUMENT_UPLOADED")),l.createElement("div",{style:be},(null==Ae||null===(fe=Ae.documents)||void 0===fe||null===(Ee=fe.documents)||void 0===Ee||null===(ge=Ee.documents)||void 0===ge?void 0:ge.length)>0&&l.createElement(Cl,{documents:null==Ae||null===(_e=Ae.documents)||void 0===_e||null===(he=_e.documents)||void 0===he?void 0:he.documents})),l.createElement("h2",{style:ye},Se("NOC_FEE_DETAILS_LABEL")),l.createElement("div",{style:be},Ae&&l.createElement(yl,{formData:Ae})))}function Mi(e){var i;let{t:o,document:a,setDocuments:r,setError:u,documents:d,action:v,formData:m,handleSubmit:p,id:f,geocoordinates:E,setGeoCoordinates:g,dispatch:_,previewLink:h}=e;const A=null==d?void 0:d.filter(e=>{var t;return null==e||null===(t=e.documentType)||void 0===t?void 0:t.includes(null==a?void 0:a.code)})[0],[S,N]=(Digit.ULBService.getCurrentTenantId(),n.useState(A?c({},A,{active:!0===(null==a?void 0:a.active),code:null==A?void 0:A.documentType}):1===(null==a||null===(i=a.dropdownData)||void 0===i?void 0:i.length)?null==a?void 0:a.dropdownData[0]:{})),[b,C]=n.useState(null),[y,D]=n.useState(()=>(null==A?void 0:A.filestoreId)||null);function L(e){const t=e.target.files[0];C(t),console.log("selectedFile here",t),t&&"image/jpeg"===t.type&&function(e){return new Promise(t=>{try{s.getData(e,function(){const e=s.getTag(this,"GPSLatitude"),n=s.getTag(this,"GPSLongitude");if(console.log("lat====",e),e&&n){const l=x(e).toFixed(6),i=x(n).toFixed(6);t({latitude:l,longitude:i})}else t({latitude:null,longitude:null}),"OWNER.SITEPHOTOGRAPHONE"===(null==a?void 0:a.code)&&alert("Please Upload a Photo with Location Details")})}catch(e){console.log("EXIF parsing failed:",e),t({latitude:null,longitude:null})}})}(t).then(e=>{console.log("Latitude:",e.latitude),console.log("Longitude:",e.longitude),"OWNER.SITEPHOTOGRAPHONE"===(null==a?void 0:a.code)&&(null!==e.latitude&&null!==e.longitude?(_(Ti("Latitude1",e.latitude)),_(Ti("Longitude1",e.longitude)),g(t=>c({},t,{Latitude1:e.latitude,Longitude1:e.longitude}))):(window.location.pathname.includes("edit")&&(_(Ti("Latitude1","")),_(Ti("Longitude1",""))),alert("Please upload a photo with location details."))),"OWNER.SITEPHOTOGRAPHTWO"===(null==a?void 0:a.code)&&(null!==e.latitude&&null!==e.longitude?(_(Ti("Latitude2",e.latitude)),_(Ti("Longitude2",e.longitude)),g(t=>c({},t,{Latitude2:e.latitude,Longitude2:e.longitude}))):(window.location.pathname.includes("edit")&&(_(Ti("Latitude2","")),_(Ti("Longitude2",""))),alert("Please upload a photo with location details.")))})}const{dropdownData:O}=a;var T=O;const[I,w]=n.useState(!1),[R,P]=n.useState(!1);function x(e){return e[0]+e[1]/60+e[2]/3600}return n.useEffect(()=>{null!=S&&S.code&&r(e=>{const t=null==e?void 0:e.filter(e=>(null==e?void 0:e.documentType)!==(null==S?void 0:S.code));return 0===(null==y?void 0:y.length)||null===y?t:[...(null==t?void 0:t.filter(e=>(null==e?void 0:e.fileStoreId)!==y))||[],{documentType:null==S?void 0:S.code,filestoreId:y,documentUid:y,documentAttachment:y}]})},[y,S]),n.useEffect(()=>{(null==d?void 0:d.length)>0&&(console.log("documents here",d),p())},[d]),n.useEffect(()=>{if("update"===v){var e,t;const n=null==m||null===(e=m.originalData)||void 0===e||null===(t=e.documents)||void 0===t?void 0:t.filter(e=>e.documentType.includes(null==a?void 0:a.code))[0],l=T.filter(e=>e.code===(null==n?void 0:n.documentType)).map(e=>{var t;return c({},e,{i18nKey:null==e||null===(t=e.code)||void 0===t?void 0:t.replaceAll(".","_")})})[0];l?(N(l),D(null==n?void 0:n.fileStoreId)):w(!0)}},[]),n.useEffect(()=>{var e;null!=a&&a.hasDropdown||N({code:null==a?void 0:a.code,i18nKey:null==a||null===(e=a.code)||void 0===e?void 0:e.replaceAll(".","_")})},[]),n.useEffect(()=>{!function(){try{u(null);const e=function(){if(b){P(!0);const e=function(){if(b.size>=5242880)P(!1),u(o("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=kt(function(){return D(null),Promise.resolve(Digit.UploadServices.Filestorage("NOC",b,Digit.ULBService.getStateId())).then(function(e){var t,n,l,i;P(!1),(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?D(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):u(o("CS_FILE_UPLOAD_ERROR"))})},function(){P(!1),u(o("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[b]),n.useEffect(()=>{I&&D(null)},[I]),l.createElement("div",{style:{marginBottom:"24px"}},R&&l.createElement(t.Loader,null),null!=a&&a.hasDropdown?l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},o(null==a?void 0:a.code.replaceAll(".","_"))),l.createElement(t.Dropdown,{className:"form-field",selected:S,style:{width:"100%"},option:T.map(e=>{var t;return c({},e,{i18nKey:null===(t=e.code)||void 0===t?void 0:t.replaceAll(".","_")})}),select:e=>N(e),optionKey:"i18nKey",t:o})):null,null!=a&&a.hasDropdown?null:l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},o(null==a?void 0:a.code.replaceAll(".","_")),l.createElement("span",null,null!=a&&a.required?" *":""))),l.createElement(t.LabelFieldPair,null,l.createElement(t.UploadFile,"OWNER.OWNERPHOTO"===(null==a?void 0:a.code)||"OWNER.SITEPHOTOGRAPHONE"===(null==a?void 0:a.code)||"OWNER.SITEPHOTOGRAPHTWO"===(null==a?void 0:a.code)?{onUpload:L,onDelete:()=>{D(null)},id:f,message:y?"1 "+o("CS_ACTION_FILEUPLOADED"):o("CS_ACTION_NO_FILEUPLOADED"),textStyles:{width:"100%"},inputStyles:{width:"280px"},accept:".jpg, .jpeg, .png",buttonType:"button",error:!y}:{onUpload:L,onDelete:()=>{D(null)},id:f,message:y?"1 "+o("CS_ACTION_FILEUPLOADED"):o("CS_ACTION_NO_FILEUPLOADED"),textStyles:{width:"100%"},inputStyles:{width:"280px"},accept:".pdf, .jpeg, .jpg, .png",buttonType:"button",error:!y}),h&&l.createElement("div",{style:{cursor:"pointer",padding:"10px",marginLeft:"25px"},onClick:e=>{e.preventDefault(),window.open(h,"_blank")}},l.createElement(t.ViewsIcon,null)),"OWNER.SITEPHOTOGRAPHONE"===(null==a?void 0:a.code)&&(null==E?void 0:E.Latitude1)&&(null==E?void 0:E.Longitude1)&&l.createElement(t.CardLabel,null,l.createElement("div",{style:{paddingLeft:"30px"}},l.createElement("p",null,"Latitude: ",E.Latitude1),l.createElement("p",null,"Longitude: ",E.Longitude1))),"OWNER.SITEPHOTOGRAPHTWO"===(null==a?void 0:a.code)&&(null==E?void 0:E.Latitude2)&&(null==E?void 0:E.Longitude2)&&l.createElement(t.CardLabel,null,l.createElement("div",{style:{paddingLeft:"30px"}},l.createElement("p",null,"Latitude: ",E.Latitude2),l.createElement("p",null,"Longitude: ",E.Longitude2)))))}const Ui=l.memo(function(e){var i,o,a;let{t:r,document:u,setDocuments:d,documents:v,formData:m,beforeUploadDocuments:p,setIsNextButtonDisabled:f,handleSubmit:E}=e;console.log("documents here",v);const g=(null==v?void 0:v.filter(e=>{var t;return null==e||null===(t=e.documentType)||void 0===t?void 0:t.includes(null==u?void 0:u.code)})[0])||(null==p?void 0:p.filter(e=>{var t;return null==e||null===(t=e.documentType)||void 0===t?void 0:t.includes(null==u?void 0:u.code)})[0]);console.log("filteredDocument here",g);const _=Digit.ULBService.getStateId(),[h,A]=n.useState(g?c({},g,{active:!0,code:null==g?void 0:g.documentType,i18nKey:null==g?void 0:g.documentType}):(null==u||null===(i=u.dropdownData)||void 0===i?void 0:i.length)>0?null==u?void 0:u.dropdownData[0]:{}),[S,N]=n.useState(null),[b,C]=n.useState(()=>(null==v?void 0:v.filter(e=>{var t;return null==e||null===(t=e.documentType)||void 0===t?void 0:t.includes(null==u?void 0:u.code)}).map(e=>({fileStoreId:null==e?void 0:e.fileStoreId,fileName:(null==e?void 0:e.fileName)||""})))||null),[y,D]=n.useState([]),[L,O]=n.useState([]),[T,I]=n.useState([]||(null==m||null===(o=m.documents)||void 0===o?void 0:o.documents.filter(e=>e.documentType===h.code))),[w,R]=n.useState(null),[P,x]=n.useState(null);function B(e){return e[0]+e[1]/60+e[2]/3600}n.useEffect(()=>{(null==v?void 0:v.length)>0&&E()},[v]),n.useEffect(()=>{L.length>0&&null!=h&&h.code&&(d(e=>{if(null===b||null==(null==b?void 0:b.fileStoreId))return e;const t=null==e?void 0:e.filter(e=>(null==e?void 0:e.fileStoreId)!==b.fileStoreId);let n=[];return L&&L.map((e,t)=>{var l,i;n.push({documentType:null==h?void 0:h.code,fileStoreId:e.fileStoreId,additionalDetails:{category:null==h?void 0:h.code.split(".").slice(0,2).join("_"),latitude:w,longitude:P},documentUid:e.fileStoreId,fileName:(null===(l=T[t])||void 0===l?void 0:l.name)||"",id:v?null===(i=v.find(e=>e.documentType===(null==h?void 0:h.code)))||void 0===i?void 0:i.id:void 0})}),console.log("newfiles here",n),[...t,...n]}),O([])),null!=h&&h.code&&d(e=>{var t;return null===b||null==(null==b?void 0:b.fileStoreId)?((null==e?void 0:e.length)>0&&(null==e||e.forEach(e=>{var t,n,l,i,o;(null==e||null===(t=e.documentType)||void 0===t?void 0:t.split(".")[0])+"."+(null==e||null===(n=e.documentType)||void 0===n?void 0:n.split(".")[1])==(null==h||null===(l=h.code)||void 0===l?void 0:l.split(".")[0])+"."+(null==h||null===(i=h.code)||void 0===i?void 0:i.split(".")[1])&&(null!=e&&e.documentType&&(e.documentType=null==h?void 0:h.code),null!=e&&null!==(o=e.file)&&void 0!==o&&o.documentType&&(e.file.documentType=null==h?void 0:h.code))})),e):[...null==e?void 0:e.filter(e=>(null==e?void 0:e.fileStoreId)!==b.fileStoreId),{documentType:null==h?void 0:h.code,fileStoreId:b.fileStoreId,documentUid:b.fileStoreId,fileName:(null==S?void 0:S.name)||b.fileName||"document",id:v?null===(t=v.find(e=>e.documentType===(null==h?void 0:h.code)))||void 0===t?void 0:t.id:void 0}]})},[b,h]),n.useEffect(()=>{h.code||null===b||O([...L,b])},[b]);const F=n.useMemo(()=>{var e,t;console.log("uploadFiles here from formData",m);let n=[];return null==m||null===(e=m.documents)||void 0===e||null===(t=e.documents)||void 0===t||t.filter(e=>e.documentType===h.code).forEach(e=>n.push([e.fileName,{file:{name:e.fileName,type:e.documentType},fileStoreId:{fileStoreId:e.fileStoreId,tenantId:_}}])),console.log("selectedUplDocs here",n),n},[m]);return l.createElement("div",null,l.createElement(t.CardLabel,null,null!=u&&u.required?r(null==u?void 0:u.code)+" *":""+r(null==u?void 0:u.code)),l.createElement(t.MultiUploadWrapper,{module:"NOC",tenantId:_,getFormState:function(e){let t,n,l=h.code;if((null==e?void 0:e.length)>0)(function(e){return new Promise(t=>{try{s.getData(e,function(){const e=s.getTag(this,"GPSLatitude"),n=s.getTag(this,"GPSLongitude");if(e&&n){const l=B(e),i=B(n);t({latitude:l,longitude:i})}else t({latitude:null,longitude:null}),"OWNER.SITEPHOTOGRAPHONE"===(null==u?void 0:u.code)&&alert("Please Upload a Photo with Location Details")})}catch(e){t({latitude:null,longitude:null})}})})(e[0][1].file).then(i=>{var o,a,r;console.log("Latitude:",i.latitude),console.log("Longitude:",i.longitude),R(i.latitude),x(i.longitude),"OWNER.SITEPHOTOGRAPHONE"===(null==u?void 0:u.code)&&(null!==i.latitude&&null!==i.longitude?(sessionStorage.setItem("Latitude",i.latitude),sessionStorage.setItem("Longitude",i.longitude)):(sessionStorage.removeItem("Latitude"),sessionStorage.removeItem("Longitude"))),t=Object.fromEntries(e),n=Object.values(t),n=null==m||null===(o=m.documents)||void 0===o||null===(a=o.documents)||void 0===a?void 0:a.filter(e=>e.documentType===h.code),D(n);let s=[];null==e||e.map((e,t)=>{var n,l,o,a;s.push({documentType:null==h?void 0:h.code,additionalDetails:{category:null==h?void 0:h.code.split(".").slice(0,2).join("_"),latitude:i.latitude,longitude:i.longitude},fileStoreId:null==e||null===(n=e[1])||void 0===n||null===(l=n.fileStoreId)||void 0===l?void 0:l.fileStoreId,documentUid:null==e||null===(o=e[1].fileStoreId)||void 0===o?void 0:o.fileStoreId,fileName:(null==e?void 0:e[0])||"",id:v?null===(a=v.find(e=>e.documentType===(null==h?void 0:h.code)))||void 0===a?void 0:a.id:void 0})});const c=[...v.filter(e=>e.documentType!==l),...s];d(c),null===(r=n)||void 0===r||r.map(e=>{null!=e&&e.file||(e.file={}),e.file.documentType=l,function(e,t){e&&N(e.file),e&&I([...T,e.file])}(e)})}).catch(e=>{console.error("Error extracting geo location:",e)});else if(0==(null==e?void 0:e.length)){const e=[...v.filter(e=>e.documentType!==l)];d(e)}},setuploadedstate:F,t:r,extraStyleName:"NOC",allowedFileTypesRegex:/(.*?)(jpg|jpeg|png|image|pdf)$/i,allowedMaxSizeInMB:10,acceptFiles:"image/*, .pdf, .png, .jpeg, .jpg"}),(null==u||null===(a=u.uploadedDocuments)||void 0===a?void 0:a.length)&&l.createElement(Fn,{isSendBackFlow:!0,documents:null==u?void 0:u.uploadedDocuments}),"OWNER.SITEPHOTOGRAPHONE"===(null==u?void 0:u.code)&&(sessionStorage.getItem("Latitude")&&sessionStorage.getItem("Longitude")?l.createElement("div",null,l.createElement("p",null,"Latitude: ",sessionStorage.getItem("Latitude")),l.createElement("p",null,"Longitude: ",sessionStorage.getItem("Longitude")),f(!1)," "):l.createElement("div",null,l.createElement("p",{style:{color:"red"}},"Please upload a Photo with Location details."),f(!0)," ")))}),ki=[{head:"APPLICATION DETAILS",stepLabel:"NOC_APPLICATION_DETAILS",stepNumber:1,isStepEnabled:!0,type:"component",component:"NewNOCStepFormOne",key:"applicationDetails",withoutLabel:!0,texts:{submitBarLabel:"CS_COMMON_NEXT"}},{head:"SITE DETAILS",stepLabel:"NOC_SITE_DETAILS",stepNumber:2,isStepEnabled:!0,type:"component",component:"NewNOCStepFormTwo",key:"siteDetails",withoutLabel:!0,texts:{submitBarLabel:"CS_COMMON_NEXT"}},{head:"DOCUMENT DETAILS",stepLabel:"ES_TITILE_DOCUMENT_DETAILS",stepNumber:3,isStepEnabled:!0,type:"component",component:"NewNOCStepFormThree",key:"documents",withoutLabel:!0,texts:{submitBarLabel:"CS_COMMON_NEXT"}},{head:"SUMMARY DETAILS",stepLabel:"ES_TITILE_SUMMARY_DETAILS",stepNumber:4,isStepEnabled:!0,type:"component",component:"NewNOCStepFormFour",key:"summary",withoutLabel:!0,texts:{submitBarLabel:"CS_COMMON_SUBMIT"}}].map(e=>c({},e,{currStepConfig:Di.filter(t=>t.stepNumber===e.stepNumber)}));var Wi=function(){return"function"==typeof Promise&&Promise.prototype&&Promise.prototype.then};let Hi;const ji=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];var zi=function(e){if(!e)throw new Error('"version" cannot be null or undefined');if(e<1||e>40)throw new Error('"version" should be in range from 1 to 40');return 4*e+17},Vi=function(e){return ji[e]},Gi=function(e){let t=0;for(;0!==e;)t++,e>>>=1;return t},Yi=function(){return void 0!==Hi},Ki=function(e){return Hi(e)},qi=y(function(e,t){t.L={bit:1},t.M={bit:0},t.Q={bit:3},t.H={bit:2},t.isValid=function(e){return e&&void 0!==e.bit&&e.bit>=0&&e.bit<4},t.from=function(e,n){if(t.isValid(e))return e;try{return function(e){if("string"!=typeof e)throw new Error("Param is not a string");switch(e.toLowerCase()){case"l":case"low":return t.L;case"m":case"medium":return t.M;case"q":case"quartile":return t.Q;case"h":case"high":return t.H;default:throw new Error("Unknown EC Level: "+e)}}(e)}catch(e){return n}}});function Xi(){this.buffer=[],this.length=0}Xi.prototype={get:function(e){const t=Math.floor(e/8);return 1==(this.buffer[t]>>>7-e%8&1)},put:function(e,t){for(let n=0;n<t;n++)this.putBit(1==(e>>>t-n-1&1))},getLengthInBits:function(){return this.length},putBit:function(e){const t=Math.floor(this.length/8);this.buffer.length<=t&&this.buffer.push(0),e&&(this.buffer[t]|=128>>>this.length%8),this.length++}};var Ji=Xi;function Qi(e){if(!e||e<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=e,this.data=new Uint8Array(e*e),this.reservedBit=new Uint8Array(e*e)}Qi.prototype.set=function(e,t,n,l){const i=e*this.size+t;this.data[i]=n,l&&(this.reservedBit[i]=!0)},Qi.prototype.get=function(e,t){return this.data[e*this.size+t]},Qi.prototype.xor=function(e,t,n){this.data[e*this.size+t]^=n},Qi.prototype.isReserved=function(e,t){return this.reservedBit[e*this.size+t]};var Zi=Qi,$i=y(function(e,t){const n=zi;t.getRowColCoords=function(e){if(1===e)return[];const t=Math.floor(e/7)+2,l=n(e),i=145===l?26:2*Math.ceil((l-13)/(2*t-2)),o=[l-7];for(let e=1;e<t-1;e++)o[e]=o[e-1]-i;return o.push(6),o.reverse()},t.getPositions=function(e){const n=[],l=t.getRowColCoords(e),i=l.length;for(let e=0;e<i;e++)for(let t=0;t<i;t++)0===e&&0===t||0===e&&t===i-1||e===i-1&&0===t||n.push([l[e],l[t]]);return n}});const eo=zi;var to=y(function(e,t){function n(e,n,l){switch(e){case t.Patterns.PATTERN000:return(n+l)%2==0;case t.Patterns.PATTERN001:return n%2==0;case t.Patterns.PATTERN010:return l%3==0;case t.Patterns.PATTERN011:return(n+l)%3==0;case t.Patterns.PATTERN100:return(Math.floor(n/2)+Math.floor(l/3))%2==0;case t.Patterns.PATTERN101:return n*l%2+n*l%3==0;case t.Patterns.PATTERN110:return(n*l%2+n*l%3)%2==0;case t.Patterns.PATTERN111:return(n*l%3+(n+l)%2)%2==0;default:throw new Error("bad maskPattern:"+e)}}t.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},t.isValid=function(e){return null!=e&&""!==e&&!isNaN(e)&&e>=0&&e<=7},t.from=function(e){return t.isValid(e)?parseInt(e,10):void 0},t.getPenaltyN1=function(e){const t=e.size;let n=0,l=0,i=0,o=null,a=null;for(let r=0;r<t;r++){l=i=0,o=a=null;for(let u=0;u<t;u++){let t=e.get(r,u);t===o?l++:(l>=5&&(n+=l-5+3),o=t,l=1),t=e.get(u,r),t===a?i++:(i>=5&&(n+=i-5+3),a=t,i=1)}l>=5&&(n+=l-5+3),i>=5&&(n+=i-5+3)}return n},t.getPenaltyN2=function(e){const t=e.size;let n=0;for(let l=0;l<t-1;l++)for(let i=0;i<t-1;i++){const t=e.get(l,i)+e.get(l,i+1)+e.get(l+1,i)+e.get(l+1,i+1);4!==t&&0!==t||n++}return 3*n},t.getPenaltyN3=function(e){const t=e.size;let n=0,l=0,i=0;for(let o=0;o<t;o++){l=i=0;for(let a=0;a<t;a++)l=l<<1&2047|e.get(o,a),a>=10&&(1488===l||93===l)&&n++,i=i<<1&2047|e.get(a,o),a>=10&&(1488===i||93===i)&&n++}return 40*n},t.getPenaltyN4=function(e){let t=0;const n=e.data.length;for(let l=0;l<n;l++)t+=e.data[l];return 10*Math.abs(Math.ceil(100*t/n/5)-10)},t.applyMask=function(e,t){const l=t.size;for(let i=0;i<l;i++)for(let o=0;o<l;o++)t.isReserved(o,i)||t.xor(o,i,n(e,o,i))},t.getBestMask=function(e,n){const l=Object.keys(t.Patterns).length;let i=0,o=Infinity;for(let a=0;a<l;a++){n(a),t.applyMask(a,e);const l=t.getPenaltyN1(e)+t.getPenaltyN2(e)+t.getPenaltyN3(e)+t.getPenaltyN4(e);t.applyMask(a,e),l<o&&(o=l,i=a)}return i}});const no=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],lo=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];var io=function(e,t){switch(t){case qi.L:return no[4*(e-1)+0];case qi.M:return no[4*(e-1)+1];case qi.Q:return no[4*(e-1)+2];case qi.H:return no[4*(e-1)+3];default:return}},oo=function(e,t){switch(t){case qi.L:return lo[4*(e-1)+0];case qi.M:return lo[4*(e-1)+1];case qi.Q:return lo[4*(e-1)+2];case qi.H:return lo[4*(e-1)+3];default:return}};const ao=new Uint8Array(512),ro=new Uint8Array(256);!function(){let e=1;for(let t=0;t<255;t++)ao[t]=e,ro[e]=t,e<<=1,256&e&&(e^=285);for(let e=255;e<512;e++)ao[e]=ao[e-255]}();var uo=function(e,t){return 0===e||0===t?0:ao[ro[e]+ro[t]]},so=y(function(e,t){t.mul=function(e,t){const n=new Uint8Array(e.length+t.length-1);for(let l=0;l<e.length;l++)for(let i=0;i<t.length;i++)n[l+i]^=uo(e[l],t[i]);return n},t.mod=function(e,t){let n=new Uint8Array(e);for(;n.length-t.length>=0;){const e=n[0];for(let l=0;l<t.length;l++)n[l]^=uo(t[l],e);let l=0;for(;l<n.length&&0===n[l];)l++;n=n.slice(l)}return n},t.generateECPolynomial=function(e){let n=new Uint8Array([1]);for(let i=0;i<e;i++)n=t.mul(n,new Uint8Array([1,(l=i,ao[l])]));var l;return n}});function co(e){this.genPoly=void 0,this.degree=e,this.degree&&this.initialize(this.degree)}co.prototype.initialize=function(e){this.degree=e,this.genPoly=so.generateECPolynomial(this.degree)},co.prototype.encode=function(e){if(!this.genPoly)throw new Error("Encoder not initialized");const t=new Uint8Array(e.length+this.degree);t.set(e);const n=so.mod(t,this.genPoly),l=this.degree-n.length;if(l>0){const e=new Uint8Array(this.degree);return e.set(n,l),e}return n};var vo=co,mo=function(e){return!isNaN(e)&&e>=1&&e<=40};let po="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";po=po.replace(/u/g,"\\u");const fo="(?:(?![A-Z0-9 $%*+\\-./:]|"+po+")(?:.|[\r\n]))+";var Eo=new RegExp(po,"g"),go=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),_o=new RegExp(fo,"g"),ho=new RegExp("[0-9]+","g"),Ao=new RegExp("[A-Z $%*+\\-./:]+","g");const So=new RegExp("^"+po+"$"),No=new RegExp("^[0-9]+$"),bo=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");var Co={KANJI:Eo,BYTE_KANJI:go,BYTE:_o,NUMERIC:ho,ALPHANUMERIC:Ao,testKanji:function(e){return So.test(e)},testNumeric:function(e){return No.test(e)},testAlphanumeric:function(e){return bo.test(e)}},yo=y(function(e,t){t.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},t.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},t.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},t.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},t.MIXED={bit:-1},t.getCharCountIndicator=function(e,t){if(!e.ccBits)throw new Error("Invalid mode: "+e);if(!mo(t))throw new Error("Invalid version: "+t);return t>=1&&t<10?e.ccBits[0]:t<27?e.ccBits[1]:e.ccBits[2]},t.getBestModeForData=function(e){return Co.testNumeric(e)?t.NUMERIC:Co.testAlphanumeric(e)?t.ALPHANUMERIC:Co.testKanji(e)?t.KANJI:t.BYTE},t.toString=function(e){if(e&&e.id)return e.id;throw new Error("Invalid mode")},t.isValid=function(e){return e&&e.bit&&e.ccBits},t.from=function(e,n){if(t.isValid(e))return e;try{return function(e){if("string"!=typeof e)throw new Error("Param is not a string");switch(e.toLowerCase()){case"numeric":return t.NUMERIC;case"alphanumeric":return t.ALPHANUMERIC;case"kanji":return t.KANJI;case"byte":return t.BYTE;default:throw new Error("Unknown mode: "+e)}}(e)}catch(e){return n}}}),Do=y(function(e,t){const n=Gi(7973);function l(e,t){return yo.getCharCountIndicator(e,t)+4}function i(e,t){let n=0;return e.forEach(function(e){const i=l(e.mode,t);n+=i+e.getBitsLength()}),n}t.from=function(e,t){return mo(e)?parseInt(e,10):t},t.getCapacity=function(e,t,n){if(!mo(e))throw new Error("Invalid QR Code version");void 0===n&&(n=yo.BYTE);const i=8*(Vi(e)-oo(e,t));if(n===yo.MIXED)return i;const o=i-l(n,e);switch(n){case yo.NUMERIC:return Math.floor(o/10*3);case yo.ALPHANUMERIC:return Math.floor(o/11*2);case yo.KANJI:return Math.floor(o/13);case yo.BYTE:default:return Math.floor(o/8)}},t.getBestVersionForData=function(e,n){let l;const o=qi.from(n,qi.M);if(Array.isArray(e)){if(e.length>1)return function(e,n){for(let l=1;l<=40;l++)if(i(e,l)<=t.getCapacity(l,n,yo.MIXED))return l}(e,o);if(0===e.length)return 1;l=e[0]}else l=e;return function(e,n,l){for(let i=1;i<=40;i++)if(n<=t.getCapacity(i,l,e))return i}(l.mode,l.getLength(),o)},t.getEncodedBits=function(e){if(!mo(e)||e<7)throw new Error("Invalid QR Code version");let t=e<<12;for(;Gi(t)-n>=0;)t^=7973<<Gi(t)-n;return e<<12|t}});const Lo=Gi(1335);function Oo(e){this.mode=yo.NUMERIC,this.data=e.toString()}Oo.getBitsLength=function(e){return 10*Math.floor(e/3)+(e%3?e%3*3+1:0)},Oo.prototype.getLength=function(){return this.data.length},Oo.prototype.getBitsLength=function(){return Oo.getBitsLength(this.data.length)},Oo.prototype.write=function(e){let t,n,l;for(t=0;t+3<=this.data.length;t+=3)n=this.data.substr(t,3),l=parseInt(n,10),e.put(l,10);const i=this.data.length-t;i>0&&(n=this.data.substr(t),l=parseInt(n,10),e.put(l,3*i+1))};var To=Oo;const Io=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function wo(e){this.mode=yo.ALPHANUMERIC,this.data=e}wo.getBitsLength=function(e){return 11*Math.floor(e/2)+e%2*6},wo.prototype.getLength=function(){return this.data.length},wo.prototype.getBitsLength=function(){return wo.getBitsLength(this.data.length)},wo.prototype.write=function(e){let t;for(t=0;t+2<=this.data.length;t+=2){let n=45*Io.indexOf(this.data[t]);n+=Io.indexOf(this.data[t+1]),e.put(n,11)}this.data.length%2&&e.put(Io.indexOf(this.data[t]),6)};var Ro=wo;function Po(e){this.mode=yo.BYTE,this.data="string"==typeof e?(new TextEncoder).encode(e):new Uint8Array(e)}Po.getBitsLength=function(e){return 8*e},Po.prototype.getLength=function(){return this.data.length},Po.prototype.getBitsLength=function(){return Po.getBitsLength(this.data.length)},Po.prototype.write=function(e){for(let t=0,n=this.data.length;t<n;t++)e.put(this.data[t],8)};var xo=Po;function Bo(e){this.mode=yo.KANJI,this.data=e}Bo.getBitsLength=function(e){return 13*e},Bo.prototype.getLength=function(){return this.data.length},Bo.prototype.getBitsLength=function(){return Bo.getBitsLength(this.data.length)},Bo.prototype.write=function(e){let t;for(t=0;t<this.data.length;t++){let n=Ki(this.data[t]);if(n>=33088&&n<=40956)n-=33088;else{if(!(n>=57408&&n<=60351))throw new Error("Invalid SJIS character: "+this.data[t]+"\nMake sure your charset is UTF-8");n-=49472}n=192*(n>>>8&255)+(255&n),e.put(n,13)}};var Fo=Bo,Mo=y(function(e){var t={single_source_shortest_paths:function(e,n,l){var i={},o={};o[n]=0;var a,r,u,d,s,c,v=t.PriorityQueue.make();for(v.push(n,0);!v.empty();)for(u in d=(a=v.pop()).cost,s=e[r=a.value]||{})s.hasOwnProperty(u)&&(c=d+s[u],(void 0===o[u]||o[u]>c)&&(o[u]=c,v.push(u,c),i[u]=r));if(void 0!==l&&void 0===o[l]){var m=["Could not find a path from ",n," to ",l,"."].join("");throw new Error(m)}return i},extract_shortest_path_from_predecessor_list:function(e,t){for(var n=[],l=t;l;)n.push(l),l=e[l];return n.reverse(),n},find_path:function(e,n,l){var i=t.single_source_shortest_paths(e,n,l);return t.extract_shortest_path_from_predecessor_list(i,l)},PriorityQueue:{make:function(e){var n,l=t.PriorityQueue,i={};for(n in e=e||{},l)l.hasOwnProperty(n)&&(i[n]=l[n]);return i.queue=[],i.sorter=e.sorter||l.default_sorter,i},default_sorter:function(e,t){return e.cost-t.cost},push:function(e,t){this.queue.push({value:e,cost:t}),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return 0===this.queue.length}}};e.exports=t}),Uo=y(function(e,t){function n(e){return unescape(encodeURIComponent(e)).length}function l(e,t,n){const l=[];let i;for(;null!==(i=e.exec(n));)l.push({data:i[0],index:i.index,mode:t,length:i[0].length});return l}function i(e){const t=l(Co.NUMERIC,yo.NUMERIC,e),n=l(Co.ALPHANUMERIC,yo.ALPHANUMERIC,e);let i,o;return Yi()?(i=l(Co.BYTE,yo.BYTE,e),o=l(Co.KANJI,yo.KANJI,e)):(i=l(Co.BYTE_KANJI,yo.BYTE,e),o=[]),t.concat(n,i,o).sort(function(e,t){return e.index-t.index}).map(function(e){return{data:e.data,mode:e.mode,length:e.length}})}function o(e,t){switch(t){case yo.NUMERIC:return To.getBitsLength(e);case yo.ALPHANUMERIC:return Ro.getBitsLength(e);case yo.KANJI:return Fo.getBitsLength(e);case yo.BYTE:return xo.getBitsLength(e)}}function a(e,t){let n;const l=yo.getBestModeForData(e);if(n=yo.from(t,l),n!==yo.BYTE&&n.bit<l.bit)throw new Error('"'+e+'" cannot be encoded with mode '+yo.toString(n)+".\n Suggested mode is: "+yo.toString(l));switch(n!==yo.KANJI||Yi()||(n=yo.BYTE),n){case yo.NUMERIC:return new To(e);case yo.ALPHANUMERIC:return new Ro(e);case yo.KANJI:return new Fo(e);case yo.BYTE:return new xo(e)}}t.fromArray=function(e){return e.reduce(function(e,t){return"string"==typeof t?e.push(a(t,null)):t.data&&e.push(a(t.data,t.mode)),e},[])},t.fromString=function(e,l){const a=function(e,t){const n={},l={start:{}};let i=["start"];for(let a=0;a<e.length;a++){const r=e[a],u=[];for(let e=0;e<r.length;e++){const d=r[e],s=""+a+e;u.push(s),n[s]={node:d,lastCount:0},l[s]={};for(let e=0;e<i.length;e++){const a=i[e];n[a]&&n[a].node.mode===d.mode?(l[a][s]=o(n[a].lastCount+d.length,d.mode)-o(n[a].lastCount,d.mode),n[a].lastCount+=d.length):(n[a]&&(n[a].lastCount=d.length),l[a][s]=o(d.length,d.mode)+4+yo.getCharCountIndicator(d.mode,t))}}i=u}for(let e=0;e<i.length;e++)l[i[e]].end=0;return{map:l,table:n}}(function(e){const t=[];for(let l=0;l<e.length;l++){const i=e[l];switch(i.mode){case yo.NUMERIC:t.push([i,{data:i.data,mode:yo.ALPHANUMERIC,length:i.length},{data:i.data,mode:yo.BYTE,length:i.length}]);break;case yo.ALPHANUMERIC:t.push([i,{data:i.data,mode:yo.BYTE,length:i.length}]);break;case yo.KANJI:t.push([i,{data:i.data,mode:yo.BYTE,length:n(i.data)}]);break;case yo.BYTE:t.push([{data:i.data,mode:yo.BYTE,length:n(i.data)}])}}return t}(i(e,Yi())),l),r=Mo.find_path(a.map,"start","end"),u=[];for(let e=1;e<r.length-1;e++)u.push(a.table[r[e]].node);return t.fromArray(u.reduce(function(e,t){const n=e.length-1>=0?e[e.length-1]:null;return n&&n.mode===t.mode?(e[e.length-1].data+=t.data,e):(e.push(t),e)},[]))},t.rawSplit=function(e){return t.fromArray(i(e,Yi()))}});function ko(e,t,n){const l=e.size,i=function(e,t){const n=e.bit<<3|t;let l=n<<10;for(;Gi(l)-Lo>=0;)l^=1335<<Gi(l)-Lo;return 21522^(n<<10|l)}(t,n);let o,a;for(o=0;o<15;o++)a=1==(i>>o&1),e.set(o<6?o:o<8?o+1:l-15+o,8,a,!0),e.set(8,o<8?l-o-1:o<9?15-o-1+1:15-o-1,a,!0);e.set(l-8,8,1,!0)}var Wo=function(e,t){if(void 0===e||""===e)throw new Error("No input text");let n,l,i=qi.M;return void 0!==t&&(i=qi.from(t.errorCorrectionLevel,qi.M),n=Do.from(t.version),l=to.from(t.maskPattern),t.toSJISFunc&&function(e){if("function"!=typeof e)throw new Error('"toSJISFunc" is not a valid function.');Hi=e}(t.toSJISFunc)),function(e,t,n,l){let i;if(Array.isArray(e))i=Uo.fromArray(e);else{if("string"!=typeof e)throw new Error("Invalid data");{let l=t;if(!l){const t=Uo.rawSplit(e);l=Do.getBestVersionForData(t,n)}i=Uo.fromString(e,l||40)}}const o=Do.getBestVersionForData(i,n);if(!o)throw new Error("The amount of data is too big to be stored in a QR Code");if(t){if(t<o)throw new Error("\nThe chosen QR Code version cannot contain this amount of data.\nMinimum version required to store current data is: "+o+".\n")}else t=o;const a=function(e,t,n){const l=new Ji;n.forEach(function(t){l.put(t.mode.bit,4),l.put(t.getLength(),yo.getCharCountIndicator(t.mode,e)),t.write(l)});const i=8*(Vi(e)-oo(e,t));for(l.getLengthInBits()+4<=i&&l.put(0,4);l.getLengthInBits()%8!=0;)l.putBit(0);const o=(i-l.getLengthInBits())/8;for(let e=0;e<o;e++)l.put(e%2?17:236,8);return function(e,t,n){const l=Vi(t),i=l-oo(t,n),o=io(t,n),a=o-l%o,r=Math.floor(l/o),u=Math.floor(i/o),d=u+1,s=r-u,c=new vo(s);let v=0;const m=new Array(o),p=new Array(o);let f=0;const E=new Uint8Array(e.buffer);for(let e=0;e<o;e++){const t=e<a?u:d;m[e]=E.slice(v,v+t),p[e]=c.encode(m[e]),v+=t,f=Math.max(f,t)}const g=new Uint8Array(l);let _,h,A=0;for(_=0;_<f;_++)for(h=0;h<o;h++)_<m[h].length&&(g[A++]=m[h][_]);for(_=0;_<s;_++)for(h=0;h<o;h++)g[A++]=p[h][_];return g}(l,e,t)}(t,n,i),r=zi(t),u=new Zi(r);return function(e,t){const n=e.size,l=function(e){const t=eo(e);return[[0,0],[t-7,0],[0,t-7]]}(t);for(let t=0;t<l.length;t++){const i=l[t][0],o=l[t][1];for(let t=-1;t<=7;t++)if(!(i+t<=-1||n<=i+t))for(let l=-1;l<=7;l++)o+l<=-1||n<=o+l||e.set(i+t,o+l,t>=0&&t<=6&&(0===l||6===l)||l>=0&&l<=6&&(0===t||6===t)||t>=2&&t<=4&&l>=2&&l<=4,!0)}}(u,t),function(e){const t=e.size;for(let n=8;n<t-8;n++){const t=n%2==0;e.set(n,6,t,!0),e.set(6,n,t,!0)}}(u),function(e,t){const n=$i.getPositions(t);for(let t=0;t<n.length;t++){const l=n[t][0],i=n[t][1];for(let t=-2;t<=2;t++)for(let n=-2;n<=2;n++)e.set(l+t,i+n,-2===t||2===t||-2===n||2===n||0===t&&0===n,!0)}}(u,t),ko(u,n,0),t>=7&&function(e,t){const n=e.size,l=Do.getEncodedBits(t);let i,o,a;for(let t=0;t<18;t++)i=Math.floor(t/3),o=t%3+n-8-3,a=1==(l>>t&1),e.set(i,o,a,!0),e.set(o,i,a,!0)}(u,t),function(e,t){const n=e.size;let l=-1,i=n-1,o=7,a=0;for(let r=n-1;r>0;r-=2)for(6===r&&r--;;){for(let n=0;n<2;n++)if(!e.isReserved(i,r-n)){let l=!1;a<t.length&&(l=1==(t[a]>>>o&1)),e.set(i,r-n,l),o--,-1===o&&(a++,o=7)}if(i+=l,i<0||n<=i){i-=l,l=-l;break}}}(u,a),isNaN(l)&&(l=to.getBestMask(u,ko.bind(null,u,n))),to.applyMask(l,u),ko(u,n,l),{modules:u,version:t,errorCorrectionLevel:n,maskPattern:l,segments:i}}(e,n,i,l)},Ho=y(function(e,t){function n(e){if("number"==typeof e&&(e=e.toString()),"string"!=typeof e)throw new Error("Color should be defined as hex string");let t=e.slice().replace("#","").split("");if(t.length<3||5===t.length||t.length>8)throw new Error("Invalid hex color: "+e);3!==t.length&&4!==t.length||(t=Array.prototype.concat.apply([],t.map(function(e){return[e,e]}))),6===t.length&&t.push("F","F");const n=parseInt(t.join(""),16);return{r:n>>24&255,g:n>>16&255,b:n>>8&255,a:255&n,hex:"#"+t.slice(0,6).join("")}}t.getOptions=function(e){e||(e={}),e.color||(e.color={});const t=e.width&&e.width>=21?e.width:void 0;return{width:t,scale:t?4:e.scale||4,margin:null==e.margin||e.margin<0?4:e.margin,color:{dark:n(e.color.dark||"#000000ff"),light:n(e.color.light||"#ffffffff")},type:e.type,rendererOpts:e.rendererOpts||{}}},t.getScale=function(e,t){return t.width&&t.width>=e+2*t.margin?t.width/(e+2*t.margin):t.scale},t.getImageWidth=function(e,n){const l=t.getScale(e,n);return Math.floor((e+2*n.margin)*l)},t.qrToImageData=function(e,n,l){const i=n.modules.size,o=n.modules.data,a=t.getScale(i,l),r=Math.floor((i+2*l.margin)*a),u=l.margin*a,d=[l.color.light,l.color.dark];for(let t=0;t<r;t++)for(let n=0;n<r;n++){let s=4*(t*r+n),c=l.color.light;t>=u&&n>=u&&t<r-u&&n<r-u&&(c=d[o[Math.floor((t-u)/a)*i+Math.floor((n-u)/a)]?1:0]),e[s++]=c.r,e[s++]=c.g,e[s++]=c.b,e[s]=c.a}}}),jo=y(function(e,t){t.render=function(e,t,n){let l=n,i=t;void 0!==l||t&&t.getContext||(l=t,t=void 0),t||(i=function(){try{return document.createElement("canvas")}catch(e){throw new Error("You need to specify a canvas element")}}()),l=Ho.getOptions(l);const o=Ho.getImageWidth(e.modules.size,l),a=i.getContext("2d"),r=a.createImageData(o,o);return Ho.qrToImageData(r.data,e,l),function(e,t,n){e.clearRect(0,0,t.width,t.height),t.style||(t.style={}),t.height=n,t.width=n,t.style.height=n+"px",t.style.width=n+"px"}(a,i,o),a.putImageData(r,0,0),i},t.renderToDataURL=function(e,n,l){let i=l;return void 0!==i||n&&n.getContext||(i=n,n=void 0),i||(i={}),t.render(e,n,i).toDataURL(i.type||"image/png",(i.rendererOpts||{}).quality)}});function zo(e,t){const n=e.a/255,l=t+'="'+e.hex+'"';return n<1?l+" "+t+'-opacity="'+n.toFixed(2).slice(1)+'"':l}function Vo(e,t,n){let l=e+t;return void 0!==n&&(l+=" "+n),l}function Go(e,t,n,l,i){const o=[].slice.call(arguments,1),a=o.length,r="function"==typeof o[a-1];if(!r&&!Wi())throw new Error("Callback required as last argument");if(!r){if(a<1)throw new Error("Too few arguments provided");return 1===a?(n=t,t=l=void 0):2!==a||t.getContext||(l=n,n=t,t=void 0),new Promise(function(i,o){try{const o=Wo(n,l);i(e(o,t,l))}catch(e){o(e)}})}if(a<2)throw new Error("Too few arguments provided");2===a?(i=n,n=t,t=l=void 0):3===a&&(t.getContext&&void 0===i?(i=l,l=void 0):(i=l,l=n,n=t,t=void 0));try{const o=Wo(n,l);i(null,e(o,t,l))}catch(e){i(e)}}var Yo={create:Wo,toCanvas:Go.bind(null,jo.render),toDataURL:Go.bind(null,jo.renderToDataURL),toString:Go.bind(null,function(e,t,n){return function(e,t,n){const l=Ho.getOptions(t),i=e.modules.size,o=e.modules.data,a=i+2*l.margin,r=l.color.light.a?"<path "+zo(l.color.light,"fill")+' d="M0 0h'+a+"v"+a+'H0z"/>':"",u="<path "+zo(l.color.dark,"stroke")+' d="'+function(e,t,n){let l="",i=0,o=!1,a=0;for(let r=0;r<e.length;r++){const u=Math.floor(r%t),d=Math.floor(r/t);u||o||(o=!0),e[r]?(a++,r>0&&u>0&&e[r-1]||(l+=o?Vo("M",u+n,.5+d+n):Vo("m",i,0),i=0,o=!1),u+1<t&&e[r+1]||(l+=Vo("h",a),a=0)):i++}return l}(o,i,l.margin)+'"/>';return'<svg xmlns="http://www.w3.org/2000/svg" '+(l.width?'width="'+l.width+'" height="'+l.width+'" ':"")+'viewBox="0 0 '+a+" "+a+'" shape-rendering="crispEdges">'+r+u+"</svg>\n"}(e,n)})};"undefined"!=typeof window&&void 0===window.process&&(window.process={env:{}});const Ko=["tenantId","payments"],qo=(e,t,n,i)=>{var o,a,r,u,d,s;const{wfComment:c,thumbnailsToShow:v,wfDocuments:m}=e,p={date:null==e||null===(o=e.auditDetails)||void 0===o?void 0:o.lastModified,time:null==e||null===(a=e.auditDetails)||void 0===a?void 0:a.timing,name:null==e||null===(r=e.assigner)||void 0===r?void 0:r.name,mobileNumber:null==e||null===(u=e.assigner)||void 0===u?void 0:u.mobileNumber,source:null==e||null===(d=e.assigner)||void 0===d?void 0:d.source};return l.createElement("div",null,(null==c?void 0:c.length)>0&&l.createElement("div",{className:"TLComments"},l.createElement("h3",null,i("WF_COMMON_COMMENTS")),l.createElement("p",{style:{overflowX:"scroll"}},c)),(null==v||null===(s=v.thumbs)||void 0===s?void 0:s.length)>0&&l.createElement(DisplayPhotos,{srcs:v.thumbs,onClick:(e,t)=>{var n;let l=(null===(n=v.fullImage)||void 0===n?void 0:n[t])||e;Digit.Utils.zoomImage(l)}}),(null==m?void 0:m.length)>0&&l.createElement("div",null,l.createElement("div",null,l.createElement(hl,{value:{workflowDocs:m},index:t}))),l.createElement("div",{style:{marginTop:"8px"}},p.time&&l.createElement("p",null,p.time),p.date&&l.createElement("p",null,p.date),p.name&&l.createElement("p",null,p.name),p.mobileNumber&&l.createElement("p",null,p.mobileNumber),p.source&&l.createElement("p",null,i("ES_COMMON_FILED_VIA_"+p.source.toUpperCase()))))},Xo=e=>{var i,r;const{register:u,setValue:d,getValues:s,reset:c,formState:v}=a.useFormContext(),{t:m}=o.useTranslation(),p=Digit.UserService.getUser().info;return l.createElement(n.Fragment,null,l.createElement(t.SearchField,null,l.createElement("label",null,m("NOC_APPLICATION_NUMBER")),l.createElement(t.TextInput,{name:"applicationNo",inputRef:u({})})),l.createElement(t.SearchField,null,l.createElement("label",null,m("NOC_APPLICANT_MOBILE_NO_LABEL")),l.createElement(t.MobileNumber,{name:"mobileNumber",inputRef:u({minLength:{value:10,message:m("CORE_COMMON_MOBILE_ERROR")},maxLength:{value:10,message:m("CORE_COMMON_MOBILE_ERROR")},pattern:{value:/[6789][0-9]{9}/,message:m("CORE_COMMON_MOBILE_ERROR")}}),type:"number",componentInFront:l.createElement("div",{className:"employee-card-input employee-card-input--front"},"+91")}),l.createElement(t.CardLabelError,null,null==v||null===(i=v.errors)||void 0===i||null===(r=i.mobileNumber)||void 0===r?void 0:r.message)),l.createElement(t.SearchField,{className:"submit"},l.createElement(t.SubmitBar,{label:m("ES_COMMON_SEARCH"),submit:!0}),l.createElement("p",{style:{marginTop:"24px"},onClick:()=>{c({applicationNo:"",mobileNumber:"",offset:0,limit:10,sortBy:"createdTime",sortOrder:"DESC",isSubmitSuccessful:"false"}),d("offset",s("offset")-s("limit")),null==e||e.onSubmit({offset:0,limit:10,sortBy:"createdTime",sortOrder:"DESC",mobileNumber:null==p?void 0:p.mobileNumber},!0),null!=e&&e.isMobileView&&e.closeMobilePopupModal()}},m("ES_COMMON_CLEAR_ALL"))))},Jo=["currentlyActiveMobileModal"],Qo=["currentlyActiveMobileModal"],Zo=e=>{var i,r;let{SearchFormFieldsComponent:u,propsMobileInboxCards:d,isLoading:s,data:m,onSubmit:p}=e;const{t:f}=o.useTranslation(),{handleSubmit:E}=a.useFormContext(),[g,_]=n.useReducer(function(e,t){switch(t.type){case"set":return t.payload;case"remove":return!1}},!1),h=()=>{_({type:"remove"})},A=()=>l.createElement("div",{className:"InboxMobilePopupCloseButtonWrapper",onClick:h},l.createElement(t.CloseSvg,null)),S=n.useCallback(e=>{let{currentlyActiveMobileModal:n}=e;return(e=>{let{currentlyActiveMobileModal:n}=e,i=v(e,Jo);const{closeMobilePopupModal:o}=i;switch(n){case"SearchFormComponent":return l.createElement(t.SearchForm,i,l.createElement(A,null),l.createElement("div",{className:"MobilePopupHeadingWrapper"},l.createElement("h2",null,f("ACTION_TEST_SEARCH_NOC_APPLICATION"),":")),l.createElement(u,{onSubmit:p,handleSubmit:E,isMobileView:!0,closeMobilePopupModal:o}));default:return l.createElement("span",null)}})(c({currentlyActiveMobileModal:n},v(e,Qo)))},[g]);return s?l.createElement(t.Loader,null):l.createElement(l.Fragment,null,l.createElement("div",{className:"searchBox"},l.createElement(t.SearchAction,{text:f("ES_COMMON_SEARCH"),handleActionClick:()=>_({type:"set",payload:"SearchFormComponent"})})),g?l.createElement(t.PopUp,null,l.createElement(S,{onSubmit:e=>{_({type:"remove"}),p(e)},handleSubmit:E,id:"search-form",className:"rm-mb form-field-flex-one inboxPopupMobileWrapper",currentlyActiveMobileModal:g,closeMobilePopupModal:h})):null,null!=m&&null!==(i=m[0])&&void 0!==i&&i.display?l.createElement(t.Card,{style:{marginTop:20}},f(null==m||null===(r=m[0])||void 0===r?void 0:r.display).split("\\n").map((e,t)=>l.createElement("p",{key:t,style:{textAlign:"center"}},e))):l.createElement(t.DetailsCard,{data:d,isTwoDynamicPrefix:!1,linkPrefix:"/digit-ui/citizen/noc/search/application-overview/",serviceRequestIdKey:f("NOC_APPLICATION_NUMBER")}))},$o=e=>{let{columns:i,SearchFormFieldsComponent:r,onSubmit:u,data:d,isLoading:s,Count:c}=e;const{handleSubmit:v,setValue:m,getValues:p}=a.useFormContext();null==p("offset")&&m("offset",0),null==p("limit")&&m("limit",10);const[f,E]=n.useState(Number(p("offset"))/Number(p("limit"))),{t:g}=o.useTranslation(),_=()=>{m("offset",c&&10*Math.ceil(c/10)-p("limit")),v(u)()},h=()=>{m("offset",0),v(u)()},A=n.useCallback(e=>{0!==e.length&&(m("sortBy",e.id),m("sortOrder",e.desc?"DESC":"ASC"))},[]);function S(e){m("limit",Number(e.target.value)),v(u)()}function N(){m("offset",Number(p("offset"))+Number(p("limit"))),v(u)()}function b(){m("offset",Number(p("offset"))-Number(p("limit"))),v(u)()}n.useEffect(()=>{null!=p("offset")&&null!=p("limit")&&E(Number(p("offset"))/Number(p("limit")))},[p("offset"),p("limit")]);const C=()=>{return s?l.createElement(t.Loader,null):null!=d&&null!==(e=d[0])&&void 0!==e&&e.display?l.createElement(t.Card,{style:{marginTop:20}},g(null==d||null===(n=d[0])||void 0===n?void 0:n.display).split("\\n").map((e,t)=>l.createElement("p",{key:t,style:{textAlign:"center"}},e))):l.createElement(t.Table,{t:g,data:d,columns:i,getCellProps:e=>({style:{minWidth:e.column.Header===g("ES_INBOX_APPLICATION_NO")?"240px":"",padding:"20px 18px",fontSize:"16px"}}),onPageSizeChange:S,currentPage:f,onNextPage:N,onPrevPage:b,pageSizeLimit:Number(p("limit")),onSort:A,totalRecords:c,disableSort:!1,onLastPage:_,onFirstPage:h,sortParams:[{id:p("sortBy"),desc:"DESC"===p("sortOrder")}]});var e,n};return l.createElement(l.Fragment,null,l.createElement(t.SearchForm,{onSubmit:u,handleSubmit:v},l.createElement(r,{onSubmit:u,handleSubmit:v,isMobileView:!1})),l.createElement(C,null))},ea=e=>{let{t:t,onSubmit:r,data:u,error:d,isLoading:s,Count:c}=e;const[v,m]=n.useState(null),p=a.useForm();n.useEffect(()=>{p.register("offset",0),p.register("limit",10),p.register("sortBy","createdTime"),p.register("sortOrder","DESC")},[p.register]);const f=(()=>{const{t:e}=o.useTranslation();return n.useMemo(()=>[{Header:e("NOC_APPLICATION_NUMBER"),accessor:"applicationNo",disableSortBy:!0,Cell:e=>{let{row:t}=e;return l.createElement("div",null,l.createElement("span",{className:"link"},l.createElement(i.Link,{to:"/digit-ui/citizen/noc/search/application-overview/"+t.original.applicationNo},t.original.applicationNo)))}},{Header:e("TL_COMMON_TABLE_COL_APP_DATE"),disableSortBy:!0,accessor:t=>e((null==t?void 0:t.date)||"-")},{Header:e("PT_COMMON_TABLE_COL_STATUS_LABEL"),accessor:t=>e((null==t?void 0:t.applicationStatus)||"-"),disableSortBy:!0}],[])})(),E=window.Digit.Utils.browser.isMobile(),g=n.useMemo(()=>null==u?void 0:u.map(e=>({[t("NOC_APPLICATION_NUMBER")]:(null==e?void 0:e.applicationNo)||"-",[t("TL_COMMON_TABLE_COL_APP_DATE")]:(null==e?void 0:e.date)||"-",[t("PT_COMMON_TABLE_COL_STATUS_LABEL")]:null!=e&&e.applicationStatus?t(""+e.applicationStatus):"-"})),[u]);return l.createElement(a.FormProvider,p,E?l.createElement(Zo,{SearchFormFieldsComponent:Xo,propsMobileInboxCards:g,isLoading:s,data:u,getRedirectionLink:()=>"noc/inbox/application-overview",onSubmit:r}):l.createElement($o,{columns:f,SearchFormFieldsComponent:Xo,onSubmit:r,data:u,error:d,isLoading:s,Count:c}))},ta=e=>{let{matchPath:n}=e;const{t:i}=o.useTranslation(),[a,r,u]=Digit.Hooks.useSessionStorage("NOC_MODULE",{});useEffect(()=>{u()},[]);const d=[{link:n+"/noc/new-application",i18nKey:i("NOC_NEW_APPLICATION")},{link:n+"/noc/my-application",i18nKey:i("NOC_MY_APPLICATION")},{link:n+"/noc/search-application",i18nKey:i("NOC_SEARCH_APPLICATION")}];return l.createElement(t.CitizenHomeCard,{header:i("ACTION_TEST_NOC"),links:d,Icon:()=>l.createElement(t.CaseIcon,{className:"fill-path-primary-main"})})},na=e=>{let{stateCode:n,userType:o,tenants:a}=e;const{path:r}=i.useRouteMatch(),u=Digit.StoreData.getCurrentLanguage(),{isLoading:d}=Digit.Services.useStore({stateCode:n,moduleCode:"NOC",language:u});return Digit.SessionStorage.set("NOC_TENANTS",a),d?l.createElement(t.Loader,null):"citizen"===o?l.createElement(bi,null):l.createElement(Ut,{path:r,stateCode:n})},la={NOCModule:na,NOCCard:()=>{var e,a;const{t:r}=o.useTranslation(),u=i.useLocation(),d=Digit.ULBService.getCurrentTenantId();if(!Digit.Utils.NOCAccess())return null;const s={filterForm:{moduleName:"noc-services",applicationStatus:"",locality:[],assignee:"ASSIGNED_TO_ALL",businessServiceArray:f(!0)||[]},searchForm:{},tableForm:{limit:10,offset:0}},{isLoading:v,data:{totalCount:m,nearingSlaCount:p}={}}=Digit.Hooks.noc.useInbox({tenantId:d,filters:c({},s),config:{enabled:(null==s||null===(e=s.filterForm)||void 0===e||null===(a=e.businessServiceArray)||void 0===a?void 0:a.length)>0}}),E=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",height:"24",viewBox:"0 0 24 24",width:"24"},l.createElement("path",{d:"M0 0h24v24H0z",fill:"none"}),l.createElement("path",{d:"M20 2H4c-1.1 0-1.99.9-1.99 2L2 22l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-7 9h-2V5h2v6zm0 4h-2v-2h2v2z",fill:"white"}));n.useEffect(()=>{"/digit-ui/employee"===u.pathname&&Digit.SessionStorage.del("NOC.INBOX")},[u.pathname]);const g=n.useMemo(()=>({Icon:l.createElement(E,null),moduleName:r("ACTION_TEST_NOC"),kpis:[{count:v?"":m,label:r("TOTAL_FSM"),link:"/digit-ui/employee/obps/inbox"},{count:v?"-":p,label:r("TOTAL_NEARING_SLA"),link:"/digit-ui/employee/obps/inbox"}],links:[{count:m,label:r("ES_COMMON_INBOX"),link:"/digit-ui/employee/noc/inbox"},{label:r("ES_COMMON_APPLICATION_SEARCH"),link:"/digit-ui/employee/noc/search"}]}),[v,m]);return Digit.Utils.NOCAccess()?l.createElement(t.EmployeeModuleCard,g):null},NOCLinks:ta,NOCApplicationOverview:()=>{var e,a,r,u,d,s,v,f,E;const{id:g}=i.useParams(),{t:_}=o.useTranslation(),h=Digit.ULBService.getCurrentTenantId(),A=null==h?void 0:h.split(".")[0],[S,N]=n.useState({}),[b,C]=n.useState(null),y={},[D]=n.useState(()=>(null==y?void 0:y.fileStoreId)||null),[L,O]=n.useState(null),[T,I]=n.useState([]),[w,R]=n.useState([]),[P,x]=n.useState([]),[B,F]=n.useState([]),[M,U]=n.useState([]),[k,W]=n.useState({}),[H,j]=n.useState(()=>[]),[z,V]=n.useState(!1),G=window.Digit.Utils.browser.isMobile(),{data:Y}=Digit.Hooks.obps.useMDMS(A,"NOC",["DocumentTypeMapping"]),{data:K}=Digit.Hooks.obps.useMDMS(A,"common-masters",["DocumentType"]),{isLoading:q,data:X}=Digit.Hooks.noc.useNOCDetails(_,h,{applicationNo:g}),{mutate:J}=Digit.Hooks.noc.useNOCApplicationActions(h),Q=Digit.Hooks.useWorkflowDetails({tenantId:h,id:g,moduleCode:"NOC"});var Z,$;null!=Q&&null!==(e=Q.data)&&void 0!==e&&null!==(a=e.actionState)&&void 0!==a&&a.nextActions&&!Q.isLoading&&(Q.data.actionState.nextActions=[...null==Q||null===(r=Q.data)||void 0===r?void 0:r.nextActions]),Q&&Q.data&&!Q.isLoading&&(Q.data.initialActionState=(null==Q||null===(Z=Q.data)||void 0===Z?void 0:Z.initialActionState)||c({},null==Q||null===($=Q.data)||void 0===$?void 0:$.actionState)||{},Q.data.actionState=c({},Q.data)),n.useEffect(()=>{R([null==X?void 0:X.applicationData])},[null==X?void 0:X.applicationData]),n.useEffect(()=>{var e;x(null==Y||null===(e=Y.NOC)||void 0===e?void 0:e.DocumentTypeMapping)},[Y]),n.useEffect(()=>{var e;F(null==K||null===(e=K["common-masters"])||void 0===e?void 0:e.DocumentType)},[K]),n.useEffect(()=>{sessionStorage.setItem("NewNOCDocs",JSON.stringify(M))},[M]),n.useEffect(()=>{if(null!=w&&w.length&&null!=P&&P.length){let e=[];w.map(t=>{var n,l;const i=P.filter(e=>(null==e?void 0:e.applicationType)===(null==t?void 0:t.applicationType)&&(null==e?void 0:e.nocType)===(null==t?void 0:t.nocType));null!=i&&null!==(n=i[0])&&void 0!==n&&null!==(l=n.docTypes)&&void 0!==l&&l[0]&&(i[0].docTypes[0].nocType=i[0].nocType,i[0].docTypes[0].additionalDetails={submissionDetails:t.additionalDetails,applicationStatus:t.applicationStatus,appNumberLink:t.applicationNo,nocNo:t.nocNo},e.push(i[0].docTypes[0]))});let t=[];e&&e.length>0&&e.map(e=>{let n=e.documentType;e.dropdownData=[],B.forEach(t=>{let l=t.code.slice(0,n.length);n===l&&(e.hasDropdown=!0,e.dropdownData.push(t))}),t.push(e)}),t.forEach(e=>{e.code=e.documentType,e.dropdownData.forEach(e=>{e.i18nKey=e.code})}),I(t)}},[w,P,B]),n.useEffect(()=>{var e,t;let n=[];null==w||null===(e=w[0])||void 0===e||null===(t=e.documents)||void 0===t||t.forEach((e,t,l)=>{n.push(null==e?void 0:e.fileStoreId)}),j(null==n?void 0:n.map(e=>e))},[null==w||null===(u=w[0])||void 0===u?void 0:u.documents]),n.useEffect(()=>{null!=H&&H.length&&Digit.UploadServices.Filefetch(H,Digit.ULBService.getStateId()).then(e=>{W(null==e?void 0:e.data)})},[H]);const ee=e=>{let{t:i,nocDataDetails:o,nocDocumentsList:a}=e;if(null!=o&&o.length&&null!=a&&a.length&&null!=(null==o?void 0:o[0])){var r,u,d,s,c,v,f,E,g,_,h,A,S,N,b,C,y,D,I,w;const e="WF_"+(null==o||null===(r=o[0])||void 0===r?void 0:r.additionalDetails.workflowCode)+"_"+(null==o||null===(u=o[0])||void 0===u?void 0:u.applicationStatus);return l.createElement(n.Fragment,null,l.createElement("div",{style:{border:"1px solid #D6D5D4",background:"#FAFAFA",boxSizing:"border-box",borderRadius:"4px",padding:"8px",maxWidth:"950px",minWidth:"280px"}},l.createElement(t.CardSectionHeader,{style:{marginBottom:"16px",fontSize:"20px"}},""+i("NOC_MAIN_"+p(null==a||null===(d=a[0])||void 0===d?void 0:d.code,".","_")+"_LABEL")),l.createElement(t.StatusTable,{style:{position:"relative",marginTop:"19px"}},l.createElement(t.Row,{className:"border-none",label:""+i("NOC_"+(null==o||null===(s=o[0])||void 0===s?void 0:s.nocType)+"_APPLICATION_LABEL"),text:i(null==o||null===(c=o[0])||void 0===c?void 0:c.applicationNo)||"NA"}),l.createElement(t.Row,{className:"border-none",label:""+i("NOC_STATUS_LABEL"),text:i(e)||"NA",textStyle:"APPROVED"==(null==o||null===(v=o[0])||void 0===v?void 0:v.applicationStatus)||"AUTO_APPROVED"==(null==o||null===(f=o[0])||void 0===f?void 0:f.applicationStatus)?{color:"#00703C"}:{color:"#D4351C"}}),l.createElement(t.Row,{className:"border-none",label:""+i("NOC_SUBMITED_ON_LABEL"),text:null!=o&&null!==(E=o[0])&&void 0!==E&&null!==(g=E.additionalDetails)&&void 0!==g&&g.SubmittedOn?m(Number(null==o||null===(_=o[0])||void 0===_||null===(h=_.additionalDetails)||void 0===h?void 0:h.SubmittedOn)):"NA"}),l.createElement(t.Row,{className:"border-none",label:""+i("NOC_APPROVAL_NO_LABEL"),text:(null==o||null===(A=o[0])||void 0===A?void 0:A.nocNo)||"NA"}),l.createElement(t.Row,{className:"border-none",label:""+i("NOC_APPROVED_ON_LABEL"),text:"APPROVED"===e||"REJECTED"===e||"AUTO_APPROVED"===e||"AUTO_REJECTED"===e?m(Number(null==o||null===(S=o[0])||void 0===S||null===(N=S.auditDetails)||void 0===N?void 0:N.lastModifiedTime)):"NA"}),l.createElement(t.Row,{className:"border-none",label:""+i("Documents"),text:""})),null!=o&&null!==(b=o[0])&&void 0!==b&&b.documents&&(null==o||null===(C=o[0])||void 0===C?void 0:C.documents.length)>0?l.createElement("div",{style:{display:"flex",flexWrap:"wrap",justifyContent:"flex-start"}},null==o||null===(y=o[0])||void 0===y||null===(D=y.documents)||void 0===D?void 0:D.map((e,n)=>{var o,r;return l.createElement("a",{target:"_",href:null===(o=k[e.fileStoreId])||void 0===o?void 0:o.split(",")[0],style:{minWidth:"80px",marginRight:"10px",maxWidth:"100px",height:"auto"},key:n},l.createElement("div",{style:{display:"flex",justifyContent:"center"}},l.createElement(t.PDFSvg,null)),l.createElement("p",{style:{marginTop:"8px",fontWeight:"bold",textAlign:"center",width:"100px",color:"#505A5F"}},i("NOC_MAIN_"+p(null==a||null===(r=a[0])||void 0===r?void 0:r.code,".","_")+"_LABEL")))})):l.createElement("div",null,l.createElement("p",null,i("BPA_NO_DOCUMENTS_UPLOADED_LABEL"))),l.createElement("div",null,(null==Q||null===(I=Q.data)||void 0===I||null===(w=I.nextActions)||void 0===w?void 0:w.length)>0?null==T?void 0:T.map((e,t)=>l.createElement(gl,{key:t,document:e,t:i,error:L,setError:O,setNocDocuments:U,nocDocuments:M})):null)))}return l.createElement(t.Loader,null)},te=function(e){return void 0===e&&(e=[]),e.map(e=>({title:e.title,belowComponent:()=>l.createElement(n.Fragment,null,l.createElement("div",{style:{maxWidth:"950px"}},l.createElement(t.StatusTable,{style:{position:"relative",marginTop:"19px"}},e.values.map(e=>l.createElement(t.Row,{className:"border-none",label:""+_(null==e?void 0:e.title),text:(null==e?void 0:e.value)||"NA"})))))}))};return n.useEffect(()=>{if(X){var e;V(!0);const{applicationDetails:t}=X;N(c({},X,{applicationDetails:[null===(e=te(t))||void 0===e?void 0:e[0],{title:"NOC_DETAILS_SUMMARY_LABEL",belowComponent:()=>l.createElement(ee,{t:_,data:X,nocDataDetails:w,nocDocumentsList:T})}]})),V(!1)}},[X,T,w,D,H,k]),l.createElement("div",{className:"employee-main-application-details"},l.createElement("div",null,l.createElement(t.Header,{styles:{fontSize:"32px"}},_("NOC_APP_OVER_VIEW_HEADER"))),l.createElement(El,{applicationDetails:S,isLoading:q||z,isDataLoading:q,applicationData:null==X?void 0:X.applicationData,mutate:J,workflowDetails:Q,businessService:null!=Q&&null!==(d=Q.data)&&void 0!==d&&d.applicationBusinessService?null==Q||null===(s=Q.data)||void 0===s?void 0:s.applicationBusinessService:null==X||null===(v=X.applicationData)||void 0===v?void 0:v.businessService,moduleCode:"NOC",ActionBarStyle:G?{}:{paddingRight:"50px"},MenuStyle:G?{}:{right:"50px"},showToast:b,setShowToast:C,closeToast:()=>{C(null)},timelineStatusPrefix:"WF_"+(null==X||null===(f=X.applicationData)||void 0===f||null===(E=f.additionalDetails)||void 0===E?void 0:E.workflowCode)+"_"}))},NOCInbox:e=>{let{parentRoute:r}=e;const{t:u}=o.useTranslation(),d=window.localStorage.getItem("Employee.tenant-id"),s={mobileNumber:"",applicationNo:""},v={moduleName:"noc-service",applicationStatus:[],businessService:"obpas_noc",locality:[],assignee:"ASSIGNED_TO_ALL",businessServiceArray:f(!0)||[]},m={sortBy:"",limit:window.Digit.Utils.browser.isMobile()?50:10,offset:0,sortOrder:"DESC"},p=Digit.SessionStorage.get("NOC.INBOX"),E=n.useMemo(()=>p||{filterForm:v,searchForm:s,tableForm:m},[Object.values((null==p?void 0:p.filterForm)||{}),Object.values((null==p?void 0:p.searchForm)||{}),Object.values((null==p?void 0:p.tableForm)||{})]),[g,_]=n.useReducer(function(e,t){switch(t.action){case"mutateSearchForm":return Digit.SessionStorage.set("NOC.INBOX",c({},e,{searchForm:t.data})),c({},e,{searchForm:t.data});case"mutateFilterForm":return Digit.SessionStorage.set("NOC.INBOX",c({},e,{filterForm:t.data})),c({},e,{filterForm:t.data});case"mutateTableForm":return Digit.SessionStorage.set("NOC.INBOX",c({},e,{tableForm:t.data})),c({},e,{tableForm:t.data})}},E),{data:h,isLoading:A}=Digit.Hooks.useBoundaryLocalities(d,"revenue",{},u),{isLoading:S,data:N}=Digit.Hooks.noc.useInbox({tenantId:d,filters:c({},g)});n.useEffect(()=>{N&&N.revalidate()},[]);const[b,C]=n.useState([]),[y,D]=n.useState([]),[L,O]=n.useState(0);n.useEffect(()=>{N&&(D((null==N?void 0:N.statuses)||[]),C((null==N?void 0:N.table)||[]),O((null==N?void 0:N.totalCount)||0))},[N]);const T={logoIcon:l.createElement(t.ComplaintIcon,null),headerText:"ACTION_TEST_NOC",links:[{text:u("NOC_NEW_APPLICATION"),link:"/digit-ui/employee/noc/new-application"}]},I=n.useCallback(e=>{let{registerRef:t,searchFormState:n,searchFieldComponents:i}=e;return l.createElement(Ll,{registerRef:t,searchFormState:n,searchFieldComponents:i})},[]),w=n.useCallback(e=>{let{registerRef:t,controlFilterForm:n,setFilterFormValue:i,getFilterFormValue:o}=e;return l.createElement(Ol,{statuses:y,isInboxLoading:S,registerRef:t,controlFilterForm:n,setFilterFormValue:i,filterFormState:null==g?void 0:g.filterForm,getFilterFormValue:o,localitiesForEmployeesCurrentTenant:h,loadingLocalitiesForEmployeesCurrentTenant:A})},[y,S,h,A]),R={SearchFormFields:I,onSearchFormSubmit:e=>{console.log("data in OnSearchFormSubmit",e),e.hasOwnProperty("")&&(null==e||delete e[""]),_({action:"mutateTableForm",data:c({},m)}),_({action:"mutateSearchForm",data:e})},searchFormDefaultValues:null==g?void 0:g.searchForm,resetSearchFormDefaultValues:s,onSearchFormReset:e=>{e("mobileNumber",null),e("applicationNo",null),_({action:"mutateSearchForm",data:s})}},P={FilterFormFields:w,onFilterFormSubmit:e=>{console.log("data in OnFilterFormSubmit",e),e.hasOwnProperty("")&&(null==e||delete e[""]),_({action:"mutateTableForm",data:c({},m)}),_({action:"mutateFilterForm",data:e})},filterFormDefaultValues:null==g?void 0:g.filterForm,resetFilterFormDefaultValues:v,onFilterFormReset:e=>{e("moduleName","noc-service"),e("applicationStatus",""),e("locality",[]),e("assignee","ASSIGNED_TO_ALL"),e("applicationType",[]),_({action:"mutateFilterForm",data:v})}},x=(e=>{var t,a,r,u;let{parentRoute:d,onPageSizeChange:s,formState:v,totalCount:m,table:p,dispatch:f,onSortingByData:E}=e;const{t:g}=o.useTranslation(),_=n.useMemo(()=>[{Header:g("NOC_APPLICATION_NUMBER"),accessor:"applicationNo",disableSortBy:!0,Cell:e=>{let{row:t}=e;return l.createElement("div",null,l.createElement(i.Link,{to:d+"/inbox/application-overview/"+t.original.applicationId},l.createElement("span",{className:"link"},t.original.applicationId)))}},{Header:g("TL_COMMON_TABLE_COL_APP_DATE"),accessor:"applicationDate",Cell:e=>{var t,n;let{row:i}=e;return null!==(t=i.original)&&void 0!==t&&t.date?(e=>l.createElement("span",{className:"cell-text styled-cell"},e))(gi(new Date(null===(n=i.original)||void 0===n?void 0:n.date),"dd/MM/yyyy")):""}},{Header:g("PT_COMMON_TABLE_COL_STATUS_LABEL"),accessor:e=>g(null==e?void 0:e.status),disableSortBy:!0}]);return{getCellProps:e=>({style:{padding:"20px 18px",fontSize:"16px"}}),disableSort:!1,autoSort:!1,manualPagination:!0,initSortId:"applicationDate",onPageSizeChange:s,currentPage:(null===(t=v.tableForm)||void 0===t?void 0:t.offset)/(null===(a=v.tableForm)||void 0===a?void 0:a.limit),onNextPage:()=>{var e,t;return f({action:"mutateTableForm",data:c({},v.tableForm,{offset:parseInt(null===(e=v.tableForm)||void 0===e?void 0:e.offset)+parseInt(null===(t=v.tableForm)||void 0===t?void 0:t.limit)})})},onPrevPage:()=>{var e,t;return f({action:"mutateTableForm",data:c({},v.tableForm,{offset:parseInt(null===(e=v.tableForm)||void 0===e?void 0:e.offset)-parseInt(null===(t=v.tableForm)||void 0===t?void 0:t.limit)})})},pageSizeLimit:null===(r=v.tableForm)||void 0===r?void 0:r.limit,onSort:E,totalRecords:m,onSearch:null==v||null===(u=v.searchForm)||void 0===u?void 0:u.message,onLastPage:()=>{var e;return f({action:"mutateTableForm",data:c({},v.tableForm,{offset:10*Math.ceil(m/10)-parseInt(null===(e=v.tableForm)||void 0===e?void 0:e.limit)})})},onFirstPage:()=>f({action:"mutateTableForm",data:c({},v.tableForm,{offset:0})}),data:p,columns:_}})(c({},{parentRoute:r,onPageSizeChange:e=>{_({action:"mutateTableForm",data:c({},g.tableForm,{limit:e.target.value})})},formState:g,totalCount:L,table:b,dispatch:_,onSortingByData:e=>{if(e.length>0){const[{id:t,desc:n}]=e,l=n?"DESC":"ASC";g.tableForm.sortBy===t&&g.tableForm.sortOrder===l||_({action:"mutateTableForm",data:c({},g.tableForm,{sortBy:t,sortOrder:n?"DESC":"ASC"})})}}})),B=(e=>{let{parentRoute:n,table:i}=e;const{t:r}=o.useTranslation();return{data:null==i?void 0:i.map(e=>{let{applicationId:t,date:n,status:l}=e;return{[r("NOC_APPLICATION_NUMBER")]:t,[r("TL_COMMON_TABLE_COL_APP_DATE")]:gi(new Date(n),"dd/MM/yyyy"),[r("PT_COMMON_TABLE_COL_STATUS_LABEL")]:r(l)}}),linkPrefix:n+"/inbox/application-overview/",serviceRequestIdKey:r("NOC_APPLICATION_NUMBER"),MobileSortFormValues:()=>{const e=[{code:"DESC",i18nKey:"ES_COMMON_SORT_BY_DESC"},{code:"ASC",i18nKey:"ES_COMMON_SORT_BY_ASC"}],{control:n}=a.useFormContext();return l.createElement(t.SearchField,null,l.createElement(a.Controller,{name:"sortOrder",control:n,render:n=>{let{onChange:i,value:o}=n;return l.createElement(t.RadioButtons,{onSelect:e=>{i(e.code)},selectedOption:e.filter(e=>e.code===o)[0],optionsKey:"i18nKey",name:"sortOrder",options:e})}}))}}})({parentRoute:r,table:b}),F={onMobileSortOrderData:e=>{const{sortOrder:t}=e;_({action:"mutateTableForm",data:c({},g.tableForm,{sortOrder:t})})},sortFormDefaultValues:null==g?void 0:g.tableForm,onSortFormReset:e=>{e("sortOrder","DESC"),_({action:"mutateTableForm",data:m})}};return l.createElement(n.Fragment,null,l.createElement(t.Header,null,u("ES_COMMON_INBOX"),L?l.createElement("p",{className:"inbox-count"},L):null),l.createElement(t.InboxComposer,c({isInboxLoading:S,PropsForInboxLinks:T},R,P,F,{propsForInboxTable:x,propsForInboxMobileCards:B,formState:g})))},NOCSearchApplication:Dt,NewNOCStepperForm:()=>{i.useHistory();const{t:e}=o.useTranslation(),a=d.useDispatch(),[r,u]=n.useState(null),s=d.useSelector(e=>e.noc.NOCNewApplicationFormReducer).step;return Digit.ULBService.getCurrentTenantId(),n.useEffect(()=>{a({type:"RESET_NOC_NEW_APPLICATION_FORM"})},[]),l.createElement("div",{className:"pageCard"},l.createElement(t.CardHeader,{styles:{fontSize:"28px",fontWeight:"400",color:"#1C1D1F"},divider:!0},e("NOC_REGISTRATION_APPLICATION")),l.createElement(yi,{stepsList:Ii,onSubmit:e=>{console.log("dataGet===",e)},step:s,setStep:e=>{a(Oi(e))}}),r&&l.createElement(t.Toast,{error:r.key,label:e(r.label),onClose:()=>{u(null)},isDleteBtn:"true"}))},NewNOCStepFormOne:e=>{var i,r,u;let{config:s,onGoNext:v,onBackClick:m}=e;const p=d.useDispatch(),{t:f}=o.useTranslation(),[E,g]=n.useState(null),[_,h]=n.useState(""),A=d.useSelector(function(e){return e.noc.NOCNewApplicationFormReducer.formData}),S=Digit.UserService.getUser(),{control:N,handleSubmit:b,setValue:C,formState:{errors:y},trigger:D,reset:L}=a.useForm(),O={Controller:a.Controller,control:N,setValue:C,errors:y,trigger:D,errorStyle:{width:"70%",marginLeft:"30%",fontSize:"12px",marginTop:"-21px"},reset:L};function T(e){p(Li(s.key,e)),v()}function I(e){m(s.key,e)}const[w,R]=n.useState((null==A||null===(i=A.applicationDetails)||void 0===i?void 0:i.isRegisteredStakeHolder)||!1),P=Digit.ULBService.getStateId(),[x,B]=n.useState(!1),F=null==S||null===(r=S.info)||void 0===r||null===(u=r.roles)||void 0===u?void 0:u.map(e=>e.code),{data:M,isLoading:U}=Digit.Hooks.obps.useMDMS(P,"StakeholderRegistraition","TradeTypetoRoleMapping");return n.useEffect(()=>{if(!U){var e,t;let n=[];null==M||null===(e=M.StakeholderRegistraition)||void 0===e||null===(t=e.TradeTypetoRoleMapping)||void 0===t||t.map(e=>{var t;null==e||null===(t=e.role)||void 0===t||t.map(e=>{n.push(e)})});const l=null==n?void 0:n.filter((e,t,n)=>n.indexOf(e)===t);null==l||l.map(e=>{null!=F&&F.includes(e)&&R(!0)})}},[U]),n.useEffect(()=>{var e;null!=A&&null!==(e=A.applicationDetails)&&void 0!==e&&e.isRegisteredStakeHolder&&C("isRegisteredStakeHolder","true")},[]),l.createElement(l.Fragment,null,l.createElement("form",{onSubmit:b(e=>{D(),y.length>0?console.log("Plz fill mandatory fields in Step1"):T(e)})},l.createElement("div",{className:"employeeCard"},w?l.createElement(l.Fragment,null,l.createElement(Ri,c({onGoBack:I,goNext:T,currentStepData:A,t:f},O)),l.createElement(wi,c({onGoBack:I,goNext:T,currentStepData:A,t:f},O))):l.createElement(l.Fragment,null,l.createElement(wi,c({onGoBack:I,goNext:T,currentStepData:A,t:f},O)))),l.createElement(t.ActionBar,null,l.createElement(t.SubmitBar,{label:"Next",submit:"submit"}))),E&&l.createElement(t.Toast,{isDleteBtn:!0,error:!0,label:_,onClose:()=>{g(null),h("")}}))},NewNOCStepFormTwo:e=>{let{config:i,onBackClick:r,onGoNext:u}=e;const{t:s}=o.useTranslation(),v=d.useDispatch(),[m,p]=n.useState(null),[f,E]=n.useState(""),{control:g,handleSubmit:_,setValue:h,formState:{errors:A},trigger:S,watch:N}=(Digit.UserService.getUser(),a.useForm({defaultValues:{floorArea:[{value:""}]}})),b=d.useSelector(function(e){return e.noc.NOCNewApplicationFormReducer.formData}),C={Controller:a.Controller,control:g,setValue:h,errors:A,errorStyle:{width:"70%",marginLeft:"30%",fontSize:"12px",marginTop:"-21px"},useFieldArray:a.useFieldArray,watch:N};let y;function D(e){v(Li(i.key,e)),u()}function L(e){r(i.key,e)}return y=window.location.href.includes("citizen")?window.localStorage.getItem("CITIZEN.CITY"):window.localStorage.getItem("Employee.tenant-id"),l.createElement(l.Fragment,null,l.createElement("form",{onSubmit:_(e=>{var t,n,l;S(),(null==e?void 0:e.netTotalArea)!==(null==e?void 0:e.specificationPlotArea)?p({key:"true",error:!0,message:"NOC_PLOT_AREA_SUM_VALIDATION_MESG_LABEL"}):(v(Li(i.key,e)),null!=b&&null!==(t=b.apiData)&&void 0!==t&&null!==(n=t.Noc)&&void 0!==n&&null!==(l=n[0])&&void 0!==l&&l.applicationNo?u():function(e){try{var t,n,l,i,o,a,r,d,s,m,f,E,g,_,h,A,S,N,b,C,D,L,O,T,I,w;const R={applicationDetails:c({},null==e?void 0:e.applicationDetails,{applicantGender:(null==e||null===(t=e.applicationDetails)||void 0===t||null===(n=t.applicantGender)||void 0===n?void 0:n.code)||""}),siteDetails:c({},null==e?void 0:e.siteDetails,{ulbName:(null==e||null===(l=e.siteDetails)||void 0===l||null===(i=l.ulbName)||void 0===i?void 0:i.name)||"",roadType:(null==e||null===(o=e.siteDetails)||void 0===o||null===(a=o.roadType)||void 0===a?void 0:a.name)||"",buildingStatus:(null==e||null===(r=e.siteDetails)||void 0===r||null===(d=r.buildingStatus)||void 0===d?void 0:d.name)||"",isBasementAreaAvailable:(null==e||null===(s=e.siteDetails)||void 0===s||null===(m=s.isBasementAreaAvailable)||void 0===m?void 0:m.code)||"",district:(null==e||null===(f=e.siteDetails)||void 0===f||null===(E=f.district)||void 0===E?void 0:E.name)||"",zone:(null==e||null===(g=e.siteDetails)||void 0===g||null===(_=g.zone)||void 0===_?void 0:_.name)||"",specificationBuildingCategory:(null==e||null===(h=e.siteDetails)||void 0===h||null===(A=h.specificationBuildingCategory)||void 0===A?void 0:A.name)||"",specificationNocType:(null==e||null===(S=e.siteDetails)||void 0===S||null===(N=S.specificationNocType)||void 0===N?void 0:N.name)||"",specificationRestrictedArea:(null==e||null===(b=e.siteDetails)||void 0===b||null===(C=b.specificationRestrictedArea)||void 0===C?void 0:C.code)||"",specificationIsSiteUnderMasterPlan:(null==e||null===(D=e.siteDetails)||void 0===D||null===(L=D.specificationIsSiteUnderMasterPlan)||void 0===L?void 0:L.code)||""})},P={mobileNumber:(null==R||null===(O=R.applicationDetails)||void 0===O?void 0:O.applicantMobileNumber)||"",name:(null==R||null===(T=R.applicationDetails)||void 0===T?void 0:T.applicantOwnerOrFirmName)||"",emailId:(null==R||null===(I=R.applicationDetails)||void 0===I?void 0:I.applicantEmailId)||"",userName:(null==R||null===(w=R.applicationDetails)||void 0===w?void 0:w.applicantMobileNumber)||""},x={Noc:{applicationType:"NEW",documents:[],nocType:"NOC",status:"ACTIVE",tenantId:y,owners:[P],workflow:{action:"INITIATE"},nocDetails:{additionalDetails:R,tenantId:y}}};console.log("final Payload here==>",x);const B=kt(function(){return Promise.resolve(Digit.NOCService.NOCcreate({tenantId:y,details:x})).then(function(e){var t;"successful"===(null==e||null===(t=e.ResponseInfo)||void 0===t?void 0:t.status)?(console.log("success :create api executed successfully !!!"),v(Li("apiData",e)),u()):(console.error("error : create api not executed properly !!!"),p({key:"true",error:!0,message:"COMMON_SOMETHING_WENT_WRONG_LABEL"}))})},function(e){console.log("errors here in goNext - catch block",e),p({key:"true",error:!0,message:"COMMON_SOME_ERROR_OCCURRED_LABEL"})});Promise.resolve(B&&B.then?B.then(function(){}):void 0)}catch(e){return Promise.reject(e)}}(c({},b,{siteDetails:c({},e)})))})},l.createElement("div",{className:"employeeCard"},l.createElement(Pi,c({onGoBack:L,goNext:D,currentStepData:b,t:s},C)),l.createElement(xi,c({onGoBack:L,goNext:D,currentStepData:b,t:s},C))),l.createElement(t.ActionBar,null,l.createElement(t.SubmitBar,{style:{background:" white",color:"black",border:"1px solid",marginRight:"10px"},label:"Back",onSubmit:L}),l.createElement(t.SubmitBar,{label:"Next",submit:"submit"}))),m&&l.createElement(t.Toast,{isDleteBtn:!0,error:null==m?void 0:m.error,warning:null==m?void 0:m.warning,label:s(null==m?void 0:m.message),onClose:()=>{p(null)}}))},NewNOCStepFormThree:e=>{let{config:i,onGoNext:o,onBackClick:a,t:r}=e;const u=d.useDispatch(),[s,c]=n.useState(!1),[v,m]=n.useState(""),p=Digit.ULBService.getStateId(),{isLoading:f,data:E}=Digit.Hooks.pt.usePropertyMDMS(p,"NOC",["Documents"]),g=d.useSelector(function(e){return e.noc.NOCNewApplicationFormReducer.formData&&e.noc.NOCNewApplicationFormReducer.formData[null==i?void 0:i.key]?e.noc.NOCNewApplicationFormReducer.formData[null==i?void 0:i.key]:{}}),_=d.useSelector(function(e){var t,n;return(null==e||null===(t=e.noc)||void 0===t||null===(n=t.NOCNewApplicationFormReducer)||void 0===n?void 0:n.coordinates)||{}});console.log("coordinates from redux",_);const h=d.useSelector(e=>{var t,n;return null==e||null===(t=e.noc)||void 0===t||null===(n=t.NOCNewApplicationFormReducer)||void 0===n?void 0:n.formData})||{};return l.createElement(l.Fragment,null,l.createElement(t.FormComposer,{defaultValues:g,config:i.currStepConfig,onSubmit:function(e){var t,n,l,i;const a=function(e){if(!f){var t,n,l,i,o;const a="VACANT"===(null==h||null===(t=h.siteDetails)||void 0===t||null===(n=t.buildingStatus)||void 0===n?void 0:n.code)?null==E||null===(l=E.NOC)||void 0===l?void 0:l.Documents.filter(e=>"OWNER.BUILDINGDRAWING"!==e.code):null==E||null===(i=E.NOC)||void 0===i?void 0:i.Documents,r=(null==e||null===(o=e.documents)||void 0===o?void 0:o.documents)||[],u=a.filter(e=>e.required).map(e=>e.code),d=r.map(e=>e.documentType);return u.filter(e=>!d.includes(e))}}(e);return a.length>0?(m(r("NOC_PLEASE_ATTACH_LABEL")+" "+r(a[0].replace(".","_").toUpperCase())),void c(!0)):null!=_&&null!==(t=_.Latitude1)&&void 0!==t&&t.trim()&&null!=_&&null!==(n=_.Latitude2)&&void 0!==n&&n.trim()&&null!=_&&null!==(l=_.Longitude1)&&void 0!==l&&l.trim()&&null!=_&&null!==(i=_.Longitude2)&&void 0!==i&&i.trim()?void o():(m(""+r("NOC_PLEASE_ATTACH_GEO_TAGGED_PHOTOS_LABEL")),void c(!0))},onFormValueChange:function(e,t){At.isEqual(t,g)||u(Li(i.key,t))},label:r(""+i.texts.submitBarLabel),currentStep:i.currStepNumber,onBackClick:function(e){a(i.key,e)}}),s&&l.createElement(t.Toast,{isDleteBtn:!0,error:!0,label:v,onClose:()=>{c(!1),m("")}}))},NewNOCStepFormFour:e=>{var o,a,r,u,s,v,m,p,f,E,g,_,h,A;let{config:S,onBackClick:N,t:b}=e;d.useDispatch();const[C,y]=n.useState(null),[D,L]=n.useState(""),[O,T]=n.useState(!1);console.log("selectedCheckBox",O);const I=d.useSelector(function(e){var t,n;return(null==e||null===(t=e.noc)||void 0===t||null===(n=t.NOCNewApplicationFormReducer)||void 0===n?void 0:n.formData)||{}}),w=d.useSelector(function(e){var t,n;return(null==e||null===(t=e.noc)||void 0===t||null===(n=t.NOCNewApplicationFormReducer)||void 0===n?void 0:n.coordinates)||{}}),R=n.useRef();let P=Digit.UserService.getUser();const x=null==P||null===(o=P.info)||void 0===o||null===(a=o.roles)||void 0===a?void 0:a.map(e=>e.code),[B,F]=n.useState(!1);Digit.Hooks.useClickOutside(R,()=>{F(!1)},B);const M=i.useHistory();let U;U=window.location.href.includes("citizen")?window.localStorage.getItem("CITIZEN.CITY"):window.localStorage.getItem("Employee.tenant-id");const k=e=>{console.log("formData in parent SummaryPage",I),W(I,e)},W=function(e,t){try{if(console.log("formData inside onSubmit",e),window.location.pathname.includes("edit")&&"EDIT"===t.action)return y({key:"true",warning:!0,message:"COMMON_SAVE_OR_RESUBMIT_LABEL"}),Promise.resolve();const n=function(e,t){var n,l,i,o,a,r,u,d,s,v,m,p,f,E,g,_,h,A,S,N,b,C,y,D,L,O,T,I,R,P,x,B;console.log("nocFormData",e);const F=c({},null==e||null===(n=e.apiData)||void 0===n||null===(l=n.Noc)||void 0===l?void 0:l[0],{workflow:{action:(null==t?void 0:t.action)||""},nocDetails:c({},null==e||null===(i=e.apiData)||void 0===i||null===(o=i.Noc)||void 0===o||null===(a=o[0])||void 0===a?void 0:a.nocDetails,{additionalDetails:c({},null==e||null===(r=e.apiData)||void 0===r||null===(u=r.Noc)||void 0===u||null===(d=u[0])||void 0===d?void 0:d.nocDetails.additionalDetails,{applicationDetails:c({},null==e?void 0:e.applicationDetails,{applicantGender:(null==e||null===(s=e.applicationDetails)||void 0===s||null===(v=s.applicantGender)||void 0===v?void 0:v.code)||""}),siteDetails:c({},null==e?void 0:e.siteDetails,{ulbName:(null==e||null===(m=e.siteDetails)||void 0===m||null===(p=m.ulbName)||void 0===p?void 0:p.name)||"",roadType:(null==e||null===(f=e.siteDetails)||void 0===f||null===(E=f.roadType)||void 0===E?void 0:E.name)||"",buildingStatus:(null==e||null===(g=e.siteDetails)||void 0===g||null===(_=g.buildingStatus)||void 0===_?void 0:_.name)||"",isBasementAreaAvailable:(null==e||null===(h=e.siteDetails)||void 0===h||null===(A=h.isBasementAreaAvailable)||void 0===A?void 0:A.code)||"",district:(null==e||null===(S=e.siteDetails)||void 0===S||null===(N=S.district)||void 0===N?void 0:N.name)||"",zone:(null==e||null===(b=e.siteDetails)||void 0===b||null===(C=b.zone)||void 0===C?void 0:C.name)||"",specificationBuildingCategory:(null==e||null===(y=e.siteDetails)||void 0===y||null===(D=y.specificationBuildingCategory)||void 0===D?void 0:D.name)||"",specificationNocType:(null==e||null===(L=e.siteDetails)||void 0===L||null===(O=L.specificationNocType)||void 0===O?void 0:O.name)||"",specificationRestrictedArea:(null==e||null===(T=e.siteDetails)||void 0===T||null===(I=T.specificationRestrictedArea)||void 0===I?void 0:I.code)||"",specificationIsSiteUnderMasterPlan:(null==e||null===(R=e.siteDetails)||void 0===R||null===(P=R.specificationIsSiteUnderMasterPlan)||void 0===P?void 0:P.code)||""}),coordinates:c({},w)})}),documents:[]});return((null==e||null===(x=e.documents)||void 0===x||null===(B=x.documents)||void 0===B?void 0:B.documents)||[]).forEach(e=>{F.documents.push({uuid:null==e?void 0:e.documentUid,documentType:null==e?void 0:e.documentType,documentAttachment:null==e?void 0:e.filestoreId})}),{Noc:c({},F)}}(e,t);console.log("finalPayload here==>",n);const l=kt(function(){return Promise.resolve(Digit.NOCService.NOCUpdate({tenantId:U,details:n})).then(function(e){var n,l,i,o,a,r;"successful"===(null==e||null===(n=e.ResponseInfo)||void 0===n?void 0:n.status)?(console.log("success: Update API "),window.location.href.includes("citizen")?"CANCEL"==t.action?(y({key:"true",success:!0,message:"COMMON_APPLICATION_CANCELLED_LABEL"}),setTimeout(()=>{M.push("/digit-ui/citizen/noc/my-application")},3e3)):(console.log("We are calling citizen response page"),M.replace({pathname:"/digit-ui/citizen/noc/response/"+(null==e||null===(l=e.Noc)||void 0===l||null===(i=l[0])||void 0===i?void 0:i.applicationNo),state:{data:e}})):(console.log("we are calling employee response page"),"CANCEL"===t.action?(y({key:"true",success:!0,message:"COMMON_APPLICATION_CANCELLED_LABEL"}),setTimeout(()=>{M.push("/digit-ui/employee/noc/inbox")},3e3)):M.replace({pathname:"/digit-ui/employee/noc/response/"+(null==e||null===(o=e.Noc)||void 0===o||null===(a=o[0])||void 0===a?void 0:a.applicationNo),state:{data:e}}))):(console.error("Submission failed, not moving to next step.",null===(r=res)||void 0===r?void 0:r.response),y({key:"true",error:!0,message:"COMMON_SOMETHING_WENT_WRONG_LABEL"}))})},function(e){console.log("errors here in goNext - catch block",e),y({key:"true",error:!0,message:"COMMON_SOME_ERROR_OCCURRED_LABEL"})});return Promise.resolve(l&&l.then?l.then(function(){}):void 0)}catch(e){return Promise.reject(e)}};function H(e){N(S.key,e)}console.log("currentStepData in StepFour",I);const j=(null==I||null===(r=I.apiData)||void 0===r||null===(u=r.Noc)||void 0===u||null===(s=u[0])||void 0===s?void 0:s.applicationNo)||"";console.log("applicationNo here==>",j);const z=Digit.Hooks.useWorkflowDetails({tenantId:U,id:j,moduleCode:"obpas_noc"});console.log("workflow Details here==>",z);let V=(null==z||null===(v=z.data)||void 0===v||null===(m=v.actionState)||void 0===m||null===(p=m.nextActions)||void 0===p?void 0:p.filter(e=>(null==x?void 0:x.some(t=>{var n;return null===(n=e.roles)||void 0===n?void 0:n.includes(t)}))||!e.roles))||(null==z||null===(f=z.data)||void 0===f||null===(E=f.nextActions)||void 0===E?void 0:E.filter(e=>(null==x?void 0:x.some(t=>{var n;return null===(n=e.roles)||void 0===n?void 0:n.includes(t)}))||!e.roles));return console.log("actions here",V),l.createElement(l.Fragment,null,l.createElement(Fi,{onGoBack:H,goNext:k,currentStepData:I,t:b}),l.createElement(t.CheckBox,{label:"I hereby solemnly affirm and declare that I am submitting this application on behalf of the applicant ("+((null==I||null===(g=I.applicationDetails)||void 0===g?void 0:g.applicantOwnerOrFirmName)||"NA")+"). I along with with the applicant have read the Policy and understand all the terms and conditions of the Policy. We are committed to fulfill/abide by all the terms and conditions of the Policy. The information/documents submitted are true and correct as per record and no part of it is false and nothing has been concealed/misrepresented therein.",onChange:e=>function(e){T(e.target.checked)}(e),value:O,checked:O}),V&&l.createElement(t.ActionBar,null,l.createElement(t.SubmitBar,{style:{background:" white",color:"black",border:"1px solid",marginRight:"10px"},label:"Back",onSubmit:H}),B&&(null!=z&&null!==(_=z.data)&&void 0!==_&&null!==(h=_.actionState)&&void 0!==h&&h.nextActions||null!=z&&null!==(A=z.data)&&void 0!==A&&A.nextActions)?l.createElement(t.Menu,{localeKeyPrefix:"WF_EMPLOYEE_NOC",options:V,optionKey:"action",t:b,onSelect:function(e){k(e)}}):null,O&&l.createElement(t.SubmitBar,{ref:R,label:b("WF_TAKE_ACTION"),onSubmit:()=>F(!B)})),C&&l.createElement(t.Toast,{isDleteBtn:!0,error:null==C?void 0:C.error,warning:null==C?void 0:C.warning,label:b(null==C?void 0:C.message),onClose:()=>{y(null)}}))},NOCApplicantDetails:wi,NOCProfessionalDetails:Ri,NOCSiteDetails:Pi,NOCSpecificationDetails:xi,NOCDocumentsRequired:e=>{var i,o,a,r,u,s,v,m;let{t:p,config:f,onSelect:E,formData:_}=e;Digit.ULBService.getStateId();const[h,A]=n.useState(null==_||null===(i=_.documents)||void 0===i?void 0:i.documents);console.log("documents in childStep three",h);const[S,N]=n.useState(null),[b,C]=n.useState(!0),[y,D]=n.useState(!1),[L,O]=n.useState(null),T=Digit.ULBService.getStateId(),I=d.useDispatch(),{isLoading:w,data:R}=Digit.Hooks.pt.usePropertyMDMS(T,"NOC",["Documents"]),P=d.useSelector(function(e){var t,n;return(null==e||null===(t=e.noc)||void 0===t||null===(n=t.NOCNewApplicationFormReducer)||void 0===n?void 0:n.coordinates)||{}});n.useEffect(()=>{Object.keys(P).length>0&&O(P)},[P]),console.log("coordinates (from redux)",P),console.log("geocoordinates",L);const x=d.useSelector(e=>{var t,n;return null==e||null===(t=e.noc)||void 0===t||null===(n=t.NOCNewApplicationFormReducer)||void 0===n?void 0:n.formData})||{},B="VACANT"===(null==x||null===(o=x.siteDetails)||void 0===o||null===(a=o.buildingStatus)||void 0===a?void 0:a.code)?null==R||null===(r=R.NOC)||void 0===r||null===(u=r.Documents)||void 0===u?void 0:u.filter(e=>"OWNER.BUILDINGDRAWING"!==e.code):null==R||null===(s=R.NOC)||void 0===s?void 0:s.Documents,F=()=>{let e;e=c({},_.documents,{documents:h}),E(f.key,e)};n.useEffect(()=>{var e,t;let n=0;null==R||null===(e=R.PetService)||void 0===e||null===(t=e.Documents)||void 0===t||t.map(e=>{e.hasDropdown=!0;let t=!1;null==h||h.map(n=>{e.required&&null!=n&&n.documentType.includes(e.code)&&(t=!0)}),!t&&e.required&&(n+=1)}),C("0"!=n&&0!=n||!((null==h?void 0:h.length)>0))},[h,y]),n.useEffect(()=>{var e,t;"VACANT"===(null==x||null===(e=x.siteDetails)||void 0===e||null===(t=e.buildingStatus)||void 0===t?void 0:t.code)&&A(e=>null==e?void 0:e.filter(e=>"OWNER.BUILDINGDRAWING"!==e.documentType))},[null==x||null===(v=x.siteDetails)||void 0===v||null===(m=v.buildingStatus)||void 0===m?void 0:m.code]);const M={value:{workflowDocs:null==h?void 0:h.map(e=>({documentType:e.documentType,filestoreId:e.filestoreId,documentUid:e.documentUid,documentAttachment:e.documentAttachment}))}},{data:U}=Digit.Hooks.noc.useNOCDocumentSearch(M),k=null==h?void 0:h.map(e=>({code:e.documentType,link:g(null==U?void 0:U.pdfFiles,e.filestoreId)}));return l.createElement("div",null,w?l.createElement(t.Loader,null):l.createElement(t.FormStep,{t:p,config:f,onSelect:F,onSkip:()=>E(),isDisabled:b,onAdd:function(){}},null==B?void 0:B.map((e,t)=>{var n;return l.createElement(Mi,{key:t,document:e,t:p,error:S,setError:N,setDocuments:A,documents:h,setCheckRequiredFields:D,handleSubmit:F,geocoordinates:L,setGeoCoordinates:O,dispatch:I,previewLink:null==k||null===(n=k.find(t=>t.code===e.code))||void 0===n?void 0:n.link})}),S&&l.createElement(t.Toast,{label:S,isDleteBtn:!0,onClose:()=>N(null),error:!0})))},NOCSummary:Fi,NOCDocumentWithLatLong:e=>{var i,o,a;let{t:r,config:u,onSelect:d,formData:s}=e;const v=Digit.ULBService.getStateId(),[m,p]=n.useState((null==s||null===(i=s.documents)||void 0===i?void 0:i.documents)||[]),[f,E]=n.useState(null),[g,_]=n.useState(!0),[h,A]=n.useState(!1),[S,N]=n.useState(!1),b=ht((null==s?void 0:s.PrevStateDocuments)||[]),{isLoading:C,data:y}=Digit.Hooks.pt.usePropertyMDMS(v,"NOC",["Documents"]),D=()=>{let e;e=c({},s.documents,{documents:m}),d(u.key,e)};return n.useEffect(()=>{var e,t;const n=null==y||null===(e=y.NOC)||void 0===e||null===(t=e.Documents)||void 0===t?void 0:t.filter(e=>e.required).map(e=>e.code),l=null==n?void 0:n.filter(e=>m.reduce((t,n)=>{var l,i,o,a;return e==(null==n||null===(l=n.documentType)||void 0===l||null===(i=l.split("."))||void 0===i?void 0:i[0])+"."+(null==n||null===(o=n.documentType)||void 0===o||null===(a=o.split("."))||void 0===a?void 0:a[1])||t},!1));_(!((null==l?void 0:l.length)==(null==n?void 0:n.length)&&(null==m?void 0:m.length)>0))},[m,h]),l.createElement("div",null,C?l.createElement(t.Loader,null):l.createElement(t.FormStep,{t:r,config:u,onSelect:D,onSkip:()=>d(),onAdd:function(){}},null==y||null===(o=y.NOC)||void 0===o||null===(a=o.Documents)||void 0===a?void 0:a.map((e,t)=>l.createElement("div",{style:{background:"#FAFAFA",border:"1px solid #D6D5D4",padding:"8px",borderRadius:"4px",maxWidth:"600px",minWidth:"280px",marginBottom:"15px",paddingTop:"15px"}},l.createElement(Ui,{key:t,document:e,t:r,error:f,setError:E,setDocuments:p,documents:m,setCheckRequiredFields:A,formData:s,beforeUploadDocuments:b||[],isNextButtonDisabled:S,setIsNextButtonDisabled:N,handleSubmit:D}))),f&&l.createElement(t.Toast,{label:f,onClose:()=>E(null),error:!0})),(window.location.href.includes("/bpa/building_plan_scrutiny/new_construction")||window.location.href.includes("/ocbpa/building_oc_plan_scrutiny/new_construction"))&&null!=s&&s.applicationNo?l.createElement(t.CitizenInfoLabel,{info:r("CS_FILE_APPLICATION_INFO_LABEL"),text:r("BPA_APPLICATION_NUMBER_LABEL")+" "+(null==s?void 0:s.applicationNo)+" "+r("BPA_DOCS_INFORMATION"),className:"info-banner-wrap-citizen-override"}):"")},NOCResponseCitizen:e=>{var n,a,r;const u=i.useLocation(),{pathname:d,state:s}=u,{t:c}=o.useTranslation(),v=i.useHistory(),m=null==s||null===(n=s.data)||void 0===n||null===(a=n.Noc)||void 0===a?void 0:a[0];console.log("nocData here",m),window.localStorage.getItem("CITIZEN.CITY");const{data:f}=Digit.Hooks.useStore.getInitData(),{tenants:E}=f||{},g=d.split("/").pop();return l.createElement("div",null,l.createElement(t.Card,null,l.createElement(t.Banner,{message:c("NOC_APPLICATION_"+(null==m||null===(r=m.workflow)||void 0===r?void 0:r.action)+"_SUCCESS_HEADER"),applicationNumber:g,info:"REJECTED"==(null==m?void 0:m.applicationStatus)?"":c(p(null==m?void 0:m.nocType,".","_")+"_APPLICATION_NUMBER"),successful:"REJECTED"!=(null==m?void 0:m.applicationStatus),style:{padding:"10px"},headerStyles:{fontSize:"32px",wordBreak:"break-word"}}),"REJECTED"!==(null==m?void 0:m.applicationStatus)?l.createElement("div",null,l.createElement(t.SubmitBar,{style:{overflow:"hidden"},label:c("COMMON_DOWNLOAD"),onSubmit:function(){try{const e=m,t=E.find(t=>t.code===e.tenantId);return Promise.resolve(Bt(e,t,c)).then(function(e){Digit.Utils.pdf.generateBPAREG(e)})}catch(e){return Promise.reject(e)}}})):null,l.createElement(t.ActionBar,{style:{display:"flex",justifyContent:"flex-end",alignItems:"baseline"}},l.createElement(t.SubmitBar,{label:c("CORE_COMMON_GO_TO_HOME"),onSubmit:()=>{v.push("/digit-ui/citizen")}}),l.createElement(t.SubmitBar,{label:c("CORE_COMMON_GO_TO_NOC"),onSubmit:()=>{v.push("/digit-ui/citizen/noc-home")}}))))},NOCCitizenMyApplications:e=>{var a,r,u;const{t:d}=o.useTranslation(),s=(i.useHistory(),(null===(a=Digit.UserService.getUser())||void 0===a?void 0:a.info)||{}),v=window.localStorage.getItem("CITIZEN.CITY"),m={sortBy:"createdTime",limit:window.Digit.Utils.browser.isMobile()?50:10,offset:0,sortOrder:"DESC",mobileNumber:""},{isLoading:p,data:f}=Digit.Hooks.noc.useNOCCitizenSearchApplication(c({},m,{mobileNumber:(null==s?void 0:s.mobileNumber)||""}),v);console.log("data herein NOC==>",f);const E=["CS_CF_VIEW","CS_CF_TRACK","TL_VIEW_DETAILS"];return n.useEffect(()=>{f&&f.revalidate()},[]),p?l.createElement(t.Loader,null):l.createElement(l.Fragment,null,l.createElement("div",{className:"applications-list-container"},l.createElement(t.Header,null,""+d("NOC_MY_APPLICATION")),0===(null==f||null===(r=f.data)||void 0===r?void 0:r.length)&&l.createElement(t.Card,{style:{textAlign:"center"}},d("NO_APPLICATIONS_MSG")),null==f||null===(u=f.data)||void 0===u?void 0:u.map((e,n)=>{var o;const a=Object.fromEntries(Object.entries(e).filter(e=>{let[t]=e;return"Applications"!==t}));return l.createElement("div",{key:"card-"+n},l.createElement(t.Card,null,Object.keys(a).filter(e=>null!==a[e]).map(e=>l.createElement(t.KeyNote,{keyValue:d(e),note:d(a[e])})),l.createElement(i.Link,{to:"/digit-ui/citizen/noc/search/application-overview/"+(null==e||null===(o=e.Applications)||void 0===o?void 0:o.applicationNo)},l.createElement(t.SubmitBar,{label:d(E[2])}))))})))},NOCCitizenApplicationOverview:()=>{var e,a,r,u,d,s,m,p,f,E,g,_,h,A,S,N,b,C,y,D,L,O,T,I,w,R,P,x,B,F,M,U,k,W,H,j,z,V,G,Y;const{id:K}=i.useParams(),{t:q}=o.useTranslation(),X=i.useHistory(),J=window.localStorage.getItem("CITIZEN.CITY"),[Q,Z]=n.useState({}),{isLoading:$,data:ee}=Digit.Hooks.noc.useNOCSearchApplication({applicationNo:K},J),te=null==ee?void 0:ee.resData,{data:ne}=Digit.Hooks.useStore.getInitData(),{tenants:le}=ne||{};let ie=Digit.UserService.getUser();if(window.location.href.includes("/obps")||window.location.href.includes("/noc")){const e=sessionStorage.getItem("Digit.citizen.userRequestObject"),t=e?JSON.parse(e):{};ie=null==t?void 0:t.value}const oe=null===(e=ie)||void 0===e||null===(a=e.info)||void 0===a||null===(r=a.roles)||void 0===r?void 0:r.map(e=>e.code);n.useEffect(()=>{var e;const t=null==te||null===(e=te.Noc)||void 0===e?void 0:e[0];if(t){var n,l,i,o,a,r;const e=null==t||null===(n=t.nocDetails)||void 0===n||null===(l=n.additionalDetails)||void 0===l?void 0:l.applicationDetails,u=null==t||null===(i=t.nocDetails)||void 0===i||null===(o=i.additionalDetails)||void 0===o?void 0:o.siteDetails,d=null==t||null===(a=t.nocDetails)||void 0===a||null===(r=a.additionalDetails)||void 0===r?void 0:r.coordinates,s=(null==t?void 0:t.documents)||[];Z({applicantDetails:e?[e]:[],siteDetails:u?[u]:[],coordinates:d?[d]:[],Documents:s.length>0?s:[]})}},[null==te?void 0:te.Noc]);const{data:ae,isLoading:re}=Digit.Hooks.useRecieptSearch({tenantId:J,businessService:"obpas_noc",consumerCodes:K,isEmployee:!1},{enabled:!!K}),ue=null==ae||null===(u=ae.Payments)||void 0===u||null===(d=u[0])||void 0===d?void 0:d.totalAmountPaid,de=[];"APPROVED"===(null==te||null===(s=te.Noc)||void 0===s||null===(m=s[0])||void 0===m?void 0:m.applicationStatus)&&(de.push({label:q("PDF_STATIC_LABEL_WS_CONSOLIDATED_SANCTION_LETTER"),onClick:function(){try{var e;const t=null==te||null===(e=te.Noc)||void 0===e?void 0:e[0];return Promise.resolve(kt(function(){if(!t)throw new Error("Noc Application data is missing");return Promise.resolve(function(e,t,n){try{const l=(new Date).toLocaleDateString("en-IN",{day:"2-digit",month:"long",year:"numeric"});return Promise.resolve(Yo.toDataURL(window.location.href)).then(function(i){var o,a,r,u,d,s;const c=null===(o=e.nocDetails)||void 0===o||null===(a=o.additionalDetails)||void 0===a?void 0:a.applicationDetails,v=null===(r=e.nocDetails)||void 0===r||null===(u=r.additionalDetails)||void 0===u?void 0:u.siteDetails,m=e.nocDetails,p='\n<html>\n <head>\n <title>NOC Sanction Letter</title>\n <style>\n @page { margin: 0.5in; }\n body {\n font-family: \'Arial\', sans-serif;\n margin: 0;\n padding: 20px;\n font-size: 14px;\n line-height: 1.6;\n }\n .noc-container {\n max-width: 800px;\n margin: 0 auto;\n border: 2px solid #333;\n padding: 30px;\n background: white;\n }\n .line-between {\n display: flex;\n justify-content: space-between;\n }\n .header {\n display: flex;\n justify-content: space-between;\n align-items: center;\n margin-bottom: 30px;\n border-bottom: 2px solid #333;\n padding-bottom: 20px;\n }\n .header-left, .header-right { flex: 0 0 auto; }\n .header-center { text-align: center; flex: 1; }\n .title { font-size: 20px; font-weight: bold; margin: 10px 0; color: #333; }\n .subtitle { font-size: 16px; margin: 5px 0; color: #666; }\n table { width: 100%; border-collapse: collapse; margin: 20px 0; }\n th, td { border: 1px solid #ddd; padding: 10px; text-align: left; }\n th { background: #f5f5f5; }\n .footer { margin-top: 30px; text-align: right; font-size: 12px; color: #666; }\n @media print { body { background: white !important; } }\n </style>\n </head>\n <body>\n <div class="noc-container">\n <div class="header">\n <div class="header-left">\n <img src="https://s3.ap-south-1.amazonaws.com/pb-egov-assets/pb.amritsar/logo.png"\n style="width: 100px; height: auto;" />\n </div>\n <div class="header-center">\n <div class="title">Local Government, Punjab</div>\n <div class="subtitle">'+((null==v?void 0:v.ulbType)||"ULB Type")+" "+((null==v?void 0:v.ulbName)||"ULB Name")+' </div>\n <div class="subtitle">('+e.nocType+' Regularization Certificate)</div>\n </div>\n <div class="header-right">\n <img src="'+i+'" style="width: 100px; height: auto;" />\n </div>\n </div>\n\n <div class="line-between"> \n <span>No. '+e.applicationNo+"</span>\n <td>\n Dated "+(null!=m&&null!==(d=m.additionalDetails)&&void 0!==d&&d.SubmittedOn?new Date(Number(m.additionalDetails.SubmittedOn)).toLocaleDateString("en-GB"):"N/A")+"\n </td>\n </div>\n\n <p>\n 1. Whereas Mr/Miss/Mrs "+((null==c?void 0:c.applicantOwnerOrFirmName)||"N/A")+"\n has applied to "+((null==v?void 0:v.ulbName)||"N/A")+" for getting No Objection Certificate\n regarding the regularization of Plot/Building under Policy No: 12/01/2017-5HG2/1806 dated 18th October 2018. The detail of his/ her / their plot / building is given below: -.\n </p>\n\n <table>\n <tr>\n <th>"+t("APPLICATIONNO")+" & "+t("AUDIT_DATE_LABEL")+"</th>\n <th>"+t("REPORT_FSM_RESULT_APPLICANTNAME")+"</th>\n </tr>\n <tr>\n <td>\n "+e.applicationNo+" Dated "+(null!=m&&null!==(s=m.additionalDetails)&&void 0!==s&&s.SubmittedOn?new Date(Number(m.additionalDetails.SubmittedOn)).toLocaleDateString("en-GB"):"N/A")+"\n </td>\n <td>"+((null==c?void 0:c.applicantOwnerOrFirmName)||"N/A")+"</td>\n </tr>\n </table>\n\n <h3>"+t("PROPERTY_DESC")+"</h3>\n <table>\n <tr>\n <th>"+t("REVENUE_ESTATE")+"</th>\n <th>"+t("NOC_SITE_VASIKA_NO_LABEL")+"</th>\n <th>"+t("NOC_NET_TOTAL_AREA_LABEL")+"</th>\n <th>"+t("BPA_HADBAST_NO_LABEL")+"</th>\n <th>"+t("NOC_SITE_KHEWAT_AND_KHATUNI_NO_LABEL")+"</th>\n </tr>\n <tr>\n <td>"+((null==v?void 0:v.villageName)||"N/A")+"</td>\n <td>"+((null==v?void 0:v.vasikaNumber)||"N/A")+"</td>\n <td>"+((null==v?void 0:v.specificationPlotArea)||"N/A")+"</td>\n <td>"+((null==v?void 0:v.hadbastNo)||"N/A")+"</td>\n <td>"+((null==v?void 0:v.khewatAndKhatuniNo)||"N/A")+"</td>\n </tr>\n <tr>\n <th>"+t("BPA_KHASRA_NO_LABEL")+'</th>\n <td colspan="4">'+((null==v?void 0:v.khasraNo)||"N/A")+"</td>\n </tr>\n </table>\n\n <p>2. Whereas, the area falls under the following categories: -</p>\n <table>\n <tr>\n <th>Sr. No.</th>\n <th>Details</th>\n <th>"+t("BPA_HADBAST_NO_LABEL")+"</th>\n </tr>\n <tr>\n <td>1</td>\n <td>"+t("PROPERTY_ADDRESS")+"</td>\n <td>"+((null==v?void 0:v.plotNo)||"")+", "+((null==c?void 0:c.applicantAddress)||"")+"</td>\n </tr>\n <tr>\n <td>2</td>\n <td>"+t("NOC_COMPOUNDING")+"</td>\n <td>"+((null==v?void 0:v.specificationBuildingCategory)||"N/A")+" Plot measuring "+((null==v?void 0:v.specificationPlotArea)||"N/A")+" Sq. mts.</td>\n </tr>\n "+("Built Up"===v.buildingStatus?"\n <tr>\n <td>3</td>\n <td>"+t("REGULARIZATION_UNAUTHORIZED")+"</td>\n <td>\n "+(v.floorArea||[]).map((e,t)=>"Floor "+(t+1)+": "+(e.value||"0")+" sqft").join("<br/>")+"\n "+(v.basementArea?"<br/>Basement: "+v.basementArea+" sqft":"")+"\n <br/><strong>"+t("BPA_APPLICATION_TOTAL_BUILDUP_AREA")+"</strong> "+(null==v?void 0:v.totalFloorArea)+" sqft.\n </td>\n </tr>\n ":"")+"\n <tr>\n <td>4</td>\n <td>"+t("NOC_REGUALRIZATION_PAID")+"</td>\n <td>"+t("VIDE_NO")+": "+e.applicationNo+" Rs. : "+(n||"N/A")+"</td>\n </tr>\n </table>\n\n "+("Provisional"===v.specificationNocType?"<p>3. "+t("NOC_SANCTION_THREE")+"</p>":"")+"\n\n <p>4. "+t("NOC_SANCTION_FOUR")+"</p>\n <p>5. "+t("NOC_SANCTION_FIVE")+"</p>\n <p>6. "+t("NOC_SANCTION_SIX")+"</p>\n <p>7. "+t("NOC_SANCTION_SEVEN")+"</p>\n <p>8. "+t("NOC_SANCTION_EIGHT")+'</p>\n\n <div style="text-align: right; margin-top: 40px;">\n <p>Competent Authority</p>\n <div> ........................</div>\n Officer Name\n <div>.......................</div>\n Designation\n <p>'+l+"</p>\n </div>\n </div>\n </body>\n</html>\n",f=window.open("","_blank");f.document.write(p),f.document.close(),f.onload=()=>{setTimeout(()=>{f.print(),f.onafterprint=()=>{f.close()}},500)}})}catch(e){return Promise.reject(e)}}(t,q,ue)).then(function(){})},function(e){console.error("Sanction Letter download error:",e)}))}catch(e){return Promise.reject(e)}}}),de.push({label:q("DOWNLOAD_CERTIFICATE"),onClick:function(){try{var e;const t=null==te||null===(e=te.Noc)||void 0===e?void 0:e[0],n=le.find(e=>e.code===t.tenantId);return Promise.resolve(Bt(t,n,q)).then(function(e){Digit.Utils.pdf.generate(e)})}catch(e){return Promise.reject(e)}}}),ae&&(null==ae?void 0:ae.Payments.length)>0&&!re&&de.push({label:q("CHB_FEE_RECEIPT"),onClick:()=>{var e;return function(e){let{tenantId:t,payments:n}=e;v(e,Ko);try{let e={filestoreIds:[null==n?void 0:n.fileStoreId]};return Promise.resolve(Digit.PaymentService.generatePdf(t,{Payments:[c({},n)]},"noc-receipt")).then(function(n){return e=n,Promise.resolve(Digit.PaymentService.printReciept(t,{fileStoreIds:e.filestoreIds[0]})).then(function(t){var n;window.open(t[null===(n=e)||void 0===n?void 0:n.filestoreIds[0]],"_blank")})})}catch(e){return Promise.reject(e)}}({tenantId:null==ae||null===(e=ae.Payments[0])||void 0===e?void 0:e.tenantId,payments:null==ae?void 0:ae.Payments[0]})}}));const se=e=>{if(0===e)return q("NOC_GROUND_FLOOR_AREA_LABEL");const t=e%10,n=e%100;let l="th";return(n<11||n>13)&&(1===t?l="st":2===t?l="nd":3===t&&(l="rd")),""+e+l+" "+q("NOC_FLOOR_AREA_LABEL")},[ce,ve]=n.useState(null),[me,pe]=n.useState(!1),[fe,Ee]=n.useState(null),[ge,_e]=n.useState(!1),he=n.useRef();Digit.Hooks.useClickOutside(he,()=>{pe(!1)},me);const Ae=Digit.Hooks.useWorkflowDetails({tenantId:J,id:K,moduleCode:"obpas_noc"});var Se,Ne;null!=Ae&&null!==(p=Ae.data)&&void 0!==p&&null!==(f=p.actionState)&&void 0!==f&&f.nextActions&&!Ae.isLoading&&(Ae.data.actionState.nextActions=[...null==Ae||null===(E=Ae.data)||void 0===E?void 0:E.nextActions]),Ae&&Ae.data&&!Ae.isLoading&&(Ae.data.initialActionState=(null==Ae||null===(Se=Ae.data)||void 0===Se?void 0:Se.initialActionState)||c({},null==Ae||null===(Ne=Ae.data)||void 0===Ne?void 0:Ne.actionState)||{},Ae.data.actionState=c({},Ae.data)),n.useEffect(()=>{Ae&&Ae.revalidate(),ee&&ee.revalidate()},[]);let be=(null==Ae||null===(g=Ae.data)||void 0===g||null===(_=g.actionState)||void 0===_||null===(h=_.nextActions)||void 0===h?void 0:h.filter(e=>(null==oe?void 0:oe.some(t=>{var n;return null===(n=e.roles)||void 0===n?void 0:n.includes(t)}))||!e.roles))||(null==Ae||null===(A=Ae.data)||void 0===A||null===(S=A.nextActions)||void 0===S?void 0:S.filter(e=>(null==oe?void 0:oe.some(t=>{var n;return null===(n=e.roles)||void 0===n?void 0:n.includes(t)}))||!e.roles));return console.log("actions here",be),$?l.createElement(t.Loader,null):l.createElement("div",{className:"employee-main-application-details"},l.createElement("div",{className:"cardHeaderWithOptions",style:{marginRight:"auto",maxWidth:"960px"}},l.createElement(t.Header,{styles:{fontSize:"32px"}},q("NDC_APP_OVER_VIEW_HEADER")),de&&de.length>0&&l.createElement(t.MultiLink,{className:"multilinkWrapper",onHeadClick:()=>_e(!ge),displayOptions:ge,options:de})),l.createElement(t.Card,null,l.createElement(t.CardSubHeader,null,q("NOC_APPLICANT_DETAILS")),null==Q||null===(N=Q.applicantDetails)||void 0===N?void 0:N.map((e,n)=>{var i;return l.createElement("div",{key:n,style:{marginBottom:"30px",background:"#FAFAFA",padding:"16px",borderRadius:"4px"}},l.createElement(t.StatusTable,null,l.createElement(t.Row,{label:q("NOC_FIRM_OWNER_NAME_LABEL"),text:(null==e?void 0:e.applicantOwnerOrFirmName)||"N/A"}),l.createElement(t.Row,{label:q("NOC_APPLICANT_EMAIL_LABEL"),text:(null==e?void 0:e.applicantEmailId)||"N/A"}),l.createElement(t.Row,{label:q("NOC_APPLICANT_FATHER_HUSBAND_NAME_LABEL"),text:(null==e?void 0:e.applicantFatherHusbandName)||"N/A"}),l.createElement(t.Row,{label:q("NOC_APPLICANT_MOBILE_NO_LABEL"),text:(null==e?void 0:e.applicantMobileNumber)||"N/A"}),l.createElement(t.Row,{label:q("NOC_APPLICANT_DOB_LABEL"),text:(null==e?void 0:e.applicantDateOfBirth)||"N/A"}),l.createElement(t.Row,{label:q("NOC_APPLICANT_GENDER_LABEL"),text:(null==e||null===(i=e.applicantGender)||void 0===i?void 0:i.code)||(null==e?void 0:e.applicantGender)||"N/A"}),l.createElement(t.Row,{label:q("NOC_APPLICANT_ADDRESS_LABEL"),text:(null==e?void 0:e.applicantAddress)||"N/A"}),l.createElement(t.Row,{label:q("NOC_APPLICANT_PROPERTY_ID_LABEL"),text:(null==e?void 0:e.applicantPropertyId)||"N/A"})))})),(null==Q||null===(b=Q.applicantDetails)||void 0===b?void 0:b.professionalName)&&(null==Q||null===(C=Q.applicantDetails)||void 0===C?void 0:C.map((e,n)=>l.createElement(l.Fragment,null,l.createElement(t.Card,null,l.createElement(t.CardSubHeader,null,q("NOC_PROFESSIONAL_DETAILS")),l.createElement("div",{key:n,style:{marginBottom:"30px",background:"#FAFAFA",padding:"16px",borderRadius:"4px"}},l.createElement(t.StatusTable,null,l.createElement(t.Row,{label:q("NOC_PROFESSIONAL_NAME_LABEL"),text:(null==e?void 0:e.professionalName)||"N/A"}),l.createElement(t.Row,{label:q("NOC_PROFESSIONAL_EMAIL_LABEL"),text:(null==e?void 0:e.professionalEmailId)||"N/A"}),l.createElement(t.Row,{label:q("NOC_PROFESSIONAL_REGISTRATION_ID_LABEL"),text:(null==e?void 0:e.professionalRegId)||"N/A"}),l.createElement(t.Row,{label:q("NOC_PROFESSIONAL_MOBILE_NO_LABEL"),text:(null==e?void 0:e.professionalMobileNumber)||"N/A"}),l.createElement(t.Row,{label:q("NOC_PROFESSIONAL_ADDRESS_LABEL"),text:(null==e?void 0:e.professionalAddress)||"N/A"}))))))),l.createElement(t.Card,null,l.createElement(t.CardSubHeader,null,q("NOC_SITE_DETAILS")),null==Q||null===(y=Q.siteDetails)||void 0===y?void 0:y.map((e,n)=>{var i,o,a,r,u,d,s;return l.createElement("div",{key:n,style:{marginBottom:"30px",background:"#FAFAFA",padding:"16px",borderRadius:"4px"}},l.createElement(t.StatusTable,null,l.createElement(t.Row,{label:q("NOC_PLOT_NO_LABEL"),text:(null==e?void 0:e.plotNo)||"N/A"}),l.createElement(t.Row,{label:q("NOC_PROPOSED_SITE_ADDRESS"),text:(null==e?void 0:e.proposedSiteAddress)||"N/A"}),l.createElement(t.Row,{label:q("NOC_ULB_NAME_LABEL"),text:(null==e||null===(i=e.ulbName)||void 0===i?void 0:i.name)||(null==e?void 0:e.ulbName)||"N/A"}),l.createElement(t.Row,{label:q("NOC_ULB_TYPE_LABEL"),text:(null==e?void 0:e.ulbType)||"N/A"}),l.createElement(t.Row,{label:q("NOC_KHASRA_NO_LABEL"),text:(null==e?void 0:e.khasraNo)||"N/A"}),l.createElement(t.Row,{label:q("NOC_HADBAST_NO_LABEL"),text:(null==e?void 0:e.hadbastNo)||"N/A"}),l.createElement(t.Row,{label:q("NOC_ROAD_TYPE_LABEL"),text:(null==e||null===(o=e.roadType)||void 0===o?void 0:o.name)||(null==e?void 0:e.roadType)||"N/A"}),l.createElement(t.Row,{label:q("NOC_AREA_LEFT_FOR_ROAD_WIDENING_LABEL"),text:(null==e?void 0:e.areaLeftForRoadWidening)||"N/A"}),l.createElement(t.Row,{label:q("NOC_NET_PLOT_AREA_AFTER_WIDENING_LABEL"),text:(null==e?void 0:e.netPlotAreaAfterWidening)||"N/A"}),l.createElement(t.Row,{label:q("NOC_NET_TOTAL_AREA_LABEL"),text:(null==e?void 0:e.netTotalArea)||"N/A"}),l.createElement(t.Row,{label:q("NOC_ROAD_WIDTH_AT_SITE_LABEL"),text:(null==e?void 0:e.roadWidthAtSite)||"N/A"}),l.createElement(t.Row,{label:q("NOC_BUILDING_STATUS_LABEL"),text:(null==e||null===(a=e.buildingStatus)||void 0===a?void 0:a.name)||(null==e?void 0:e.buildingStatus)||"N/A"}),l.createElement(t.Row,{label:q("NOC_IS_BASEMENT_AREA_PRESENT_LABEL"),text:(null==e||null===(r=e.isBasementAreaAvailable)||void 0===r?void 0:r.code)||(null==e?void 0:e.isBasementAreaAvailable)||"N/A"}),"Built Up"==(null==e?void 0:e.buildingStatus)&&l.createElement(t.Row,{label:q("NOC_BASEMENT_AREA_LABEL"),text:e.basementArea||"N/A"}),"Built Up"==(null==e?void 0:e.buildingStatus)&&(null==e||null===(u=e.floorArea)||void 0===u?void 0:u.map((e,n)=>l.createElement(t.Row,{label:se(n),text:e.value||"N/A"}))),"Built Up"==(null==e?void 0:e.buildingStatus)&&l.createElement(t.Row,{label:q("NOC_TOTAL_FLOOR_BUILT_UP_AREA_LABEL"),text:e.totalFloorArea||"N/A"}),l.createElement(t.Row,{label:q("NOC_DISTRICT_LABEL"),text:(null==e||null===(d=e.district)||void 0===d?void 0:d.name)||(null==e?void 0:e.district)||"N/A"}),l.createElement(t.Row,{label:q("NOC_ZONE_LABEL"),text:(null==e||null===(s=e.zone)||void 0===s?void 0:s.name)||(null==e?void 0:e.zone)||"N/A"}),l.createElement(t.Row,{label:q("NOC_SITE_WARD_NO_LABEL"),text:(null==e?void 0:e.wardNo)||"N/A"}),l.createElement(t.Row,{label:q("NOC_SITE_VILLAGE_NAME_LABEL"),text:(null==e?void 0:e.villageName)||"N/A"}),l.createElement(t.Row,{label:q("NOC_SITE_COLONY_NAME_LABEL"),text:(null==e?void 0:e.colonyName)||"N/A"}),l.createElement(t.Row,{label:q("NOC_SITE_VASIKA_NO_LABEL"),text:(null==e?void 0:e.vasikaNumber)||"N/A"}),l.createElement(t.Row,{label:q("NOC_SITE_KHEWAT_AND_KHATUNI_NO_LABEL"),text:(null==e?void 0:e.khewatAndKhatuniNo)||"N/A"})))})),l.createElement(t.Card,null,l.createElement(t.CardSubHeader,null,q("NOC_SPECIFICATION_DETAILS")),null==Q||null===(D=Q.siteDetails)||void 0===D?void 0:D.map((e,n)=>{var i,o,a,r;return l.createElement("div",{key:n,style:{marginBottom:"30px",background:"#FAFAFA",padding:"16px",borderRadius:"4px"}},l.createElement(t.StatusTable,null,l.createElement(t.Row,{label:q("NOC_PLOT_AREA_JAMA_BANDI_LABEL"),text:(null==e?void 0:e.specificationPlotArea)||"N/A"}),l.createElement(t.Row,{label:q("NOC_BUILDING_CATEGORY_LABEL"),text:(null==e||null===(i=e.specificationBuildingCategory)||void 0===i?void 0:i.name)||(null==e?void 0:e.specificationBuildingCategory)||"N/A"}),l.createElement(t.Row,{label:q("NOC_NOC_TYPE_LABEL"),text:(null==e||null===(o=e.specificationNocType)||void 0===o?void 0:o.name)||(null==e?void 0:e.specificationNocType)||"N/A"}),l.createElement(t.Row,{label:q("NOC_RESTRICTED_AREA_LABEL"),text:(null==e||null===(a=e.specificationRestrictedArea)||void 0===a?void 0:a.code)||(null==e?void 0:e.specificationRestrictedArea)||"N/A"}),l.createElement(t.Row,{label:q("NOC_IS_SITE_UNDER_MASTER_PLAN_LABEL"),text:(null==e||null===(r=e.specificationIsSiteUnderMasterPlan)||void 0===r?void 0:r.code)||(null==e?void 0:e.specificationIsSiteUnderMasterPlan)||"N/A"})))})),l.createElement(t.Card,null,l.createElement(t.CardSubHeader,null,q("NOC_SITE_COORDINATES_LABEL")),null==Q||null===(L=Q.coordinates)||void 0===L?void 0:L.map((e,n)=>l.createElement("div",{key:n,style:{marginBottom:"30px",background:"#FAFAFA",padding:"16px",borderRadius:"4px"}},l.createElement(t.StatusTable,null,l.createElement(t.Row,{label:q("COMMON_LATITUDE1_LABEL"),text:(null==e?void 0:e.Latitude1)||"N/A"}),l.createElement(t.Row,{label:q("COMMON_LONGITUDE1_LABEL"),text:(null==e?void 0:e.Longitude1)||"N/A"}),l.createElement(t.Row,{label:q("COMMON_LATITUDE2_LABEL"),text:(null==e?void 0:e.Latitude2)||"N/A"}),l.createElement(t.Row,{label:q("COMMON_LONGITUDE2_LABEL"),text:(null==e?void 0:e.Longitude2)||"N/A"}))))),l.createElement(t.Card,null,l.createElement(t.CardSubHeader,null,q("NOC_TITILE_DOCUMENT_UPLOADED")),l.createElement(t.StatusTable,null,(null==Q||null===(O=Q.Documents)||void 0===O?void 0:O.length)>0&&l.createElement(Cl,{documents:Q.Documents}))),l.createElement(t.Card,null,l.createElement(t.CardSubHeader,null,q("NOC_FEE_DETAILS_LABEL")),(null==te||null===(T=te.Noc)||void 0===T||null===(I=T[0])||void 0===I?void 0:I.nocDetails)&&l.createElement(yl,{formData:{apiData:c({},te),applicationDetails:c({},null==te||null===(w=te.Noc)||void 0===w||null===(R=w[0])||void 0===R||null===(P=R.nocDetails)||void 0===P||null===(x=P.additionalDetails)||void 0===x?void 0:x.applicationDetails),siteDetails:c({},null==te||null===(B=te.Noc)||void 0===B||null===(F=B[0])||void 0===F||null===(M=F.nocDetails)||void 0===M||null===(U=M.additionalDetails)||void 0===U?void 0:U.siteDetails)}})),(null==Ae||null===(k=Ae.data)||void 0===k?void 0:k.timeline)&&l.createElement(t.Card,null,l.createElement(t.CardSubHeader,null,q("CS_APPLICATION_DETAILS_APPLICATION_TIMELINE")),1===(null==Ae||null===(W=Ae.data)||void 0===W?void 0:W.timeline.length)?l.createElement(t.CheckPoint,{isCompleted:!0,label:q(null==Ae||null===(H=Ae.data)||void 0===H||null===(j=H.timeline[0])||void 0===j?void 0:j.status)}):l.createElement(t.ConnectingCheckPoints,null,null==Ae||null===(z=Ae.data)||void 0===z?void 0:z.timeline.map((e,n,i)=>l.createElement(t.CheckPoint,{keyValue:n,isCompleted:0===n,label:q("NOC_STATUS_"+e.status),customChild:qo(e,n,0,q)})))),be&&be.length>0&&l.createElement(t.ActionBar,null,me&&(null!=Ae&&null!==(V=Ae.data)&&void 0!==V&&null!==(G=V.actionState)&&void 0!==G&&G.nextActions||null!=Ae&&null!==(Y=Ae.data)&&void 0!==Y&&Y.nextActions)?l.createElement(t.Menu,{localeKeyPrefix:"WF_EMPLOYEE_NOC",options:be,optionKey:"action",t:q,onSelect:function(e){var t,n;console.log("selected action",e);const l=null==te||null===(t=te.Noc)||void 0===t||null===(n=t[0])||void 0===n?void 0:n.applicationNo,i={Licenses:[e]};"EDIT"==(null==e?void 0:e.action)?X.push("/digit-ui/citizen/noc/edit-application/"+l):"DRAFT"==(null==e?void 0:e.action)?ve({key:"true",warning:!0,message:"COMMON_EDIT_APPLICATION_BEFORE_SAVE_OR_SUBMIT_LABEL"}):"APPLY"==(null==e?void 0:e.action)||"RESUBMIT"==(null==e?void 0:e.action)||"CANCEL"==(null==e?void 0:e.action)?function(e){try{var t,n;const l=c({},(null==te||null===(t=te.Noc)||void 0===t?void 0:t[0])||{},{workflow:{}}),i=null==e||null===(n=e.Licenses)||void 0===n?void 0:n[0];l.workflow={action:i.action,assignes:null==i?void 0:i.assignee,comment:null==i?void 0:i.comment,documents:null==i?void 0:i.wfDocuments};const o={Noc:c({},l)},a=kt(function(){return Promise.resolve(Digit.NOCService.NOCUpdate({tenantId:J,details:o})).then(function(e){var t,n,l;"successful"===(null==e||null===(t=e.ResponseInfo)||void 0===t?void 0:t.status)?"CANCEL"===(null==i?void 0:i.action)?(ve({key:"true",success:!0,message:"COMMON_APPLICATION_CANCELLED_LABEL"}),Ae.revalidate(),Ee(null)):(console.log("We are calling citizen response page"),X.replace({pathname:"/digit-ui/citizen/noc/response/"+(null==e||null===(n=e.Noc)||void 0===n||null===(l=n[0])||void 0===l?void 0:l.applicationNo),state:{data:e}})):(ve({key:"true",warning:!0,message:"COMMON_SOMETHING_WENT_WRONG_LABEL"}),Ee(null))})},function(){ve({key:"true",error:!0,message:"COMMON_SOME_ERROR_OCCURRED_LABEL"})});Promise.resolve(a&&a.then?a.then(function(){}):void 0)}catch(e){return Promise.reject(e)}}(i):"PAY"==(null==e?void 0:e.action)?X.push("/digit-ui/citizen/payment/collect/obpas_noc/"+l+"/"+J+"?tenantId="+J):Ee(e)}}):null,l.createElement(t.SubmitBar,{ref:he,label:q("WF_TAKE_ACTION"),onSubmit:()=>pe(!me)})),ce&&l.createElement(t.Toast,{error:null==ce?void 0:ce.error,warning:null==ce?void 0:ce.warning,label:q(null==ce?void 0:ce.message),isDleteBtn:!0,onClose:()=>{ve(null)}}))},NOCEmployeeApplicationOverview:()=>{var e,a,r,u,d,s,v,m,p,f,E,g,_,h,A,S,N,b,C,y,D,L,O,T,I,w,R,P,x,B,F,M,U,k,W,H,j;const{id:z}=i.useParams(),{t:V}=o.useTranslation(),G=window.localStorage.getItem("Employee.tenant-id"),Y=i.useHistory(),K=null==G?void 0:G.split(".")[0],[q,X]=n.useState(null),[J,Q]=n.useState(null),[Z,$]=n.useState(null),[ee,te]=n.useState(null),[ne,le]=n.useState({}),[ie,oe]=n.useState(!1),[ae,re]=n.useState([]),[ue,de]=n.useState(!1),[se,ce]=n.useState([]),{isLoading:ve,data:me}=Digit.Hooks.noc.useNOCSearchApplication({applicationNo:z},G),pe=null==me?void 0:me.resData;console.log("applicationDetails here==>",pe);const fe=Digit.Hooks.useWorkflowDetails({tenantId:G,id:z,moduleCode:"obpas_noc"});var Ee,ge;console.log("workflowDetails here=>",fe),null!=fe&&null!==(e=fe.data)&&void 0!==e&&null!==(a=e.actionState)&&void 0!==a&&a.nextActions&&!fe.isLoading&&(fe.data.actionState.nextActions=[...null==fe||null===(r=fe.data)||void 0===r?void 0:r.nextActions]),fe&&fe.data&&!fe.isLoading&&(fe.data.initialActionState=(null==fe||null===(Ee=fe.data)||void 0===Ee?void 0:Ee.initialActionState)||c({},null==fe||null===(ge=fe.data)||void 0===ge?void 0:ge.actionState)||{},fe.data.actionState=c({},fe.data)),n.useEffect(()=>{let e=null;try{return de(!0),Promise.resolve(Digit.WorkflowService.init(G,"obpas_noc")).then(function(t){var n,l,i;e=t,de(!1),ce(null===(n=e)||void 0===n||null===(l=n.BusinessServices)||void 0===l||null===(i=l[0])||void 0===i?void 0:i.states)})}catch(e){Promise.reject(e)}},[G]);const[_e,he]=n.useState(!1),[Ae,Se]=n.useState(null),[Ne,be]=n.useState(!1),Ce=()=>{X(null)};let ye=Digit.UserService.getUser();const De=n.useRef();if(Digit.Hooks.useClickOutside(De,()=>{he(!1)},_e),window.location.href.includes("/obps")||window.location.href.includes("/noc")){const e=sessionStorage.getItem("Digit.citizen.userRequestObject"),t=e?JSON.parse(e):{};ye=null==t?void 0:t.value}const Le=null===(u=ye)||void 0===u||null===(d=u.info)||void 0===d||null===(s=d.roles)||void 0===s?void 0:s.map(e=>e.code);n.useEffect(()=>{fe&&fe.revalidate(),me&&me.revalidate()},[]);let Oe=(null==fe||null===(v=fe.data)||void 0===v||null===(m=v.actionState)||void 0===m||null===(p=m.nextActions)||void 0===p?void 0:p.filter(e=>(null==Le?void 0:Le.some(t=>{var n;return null===(n=e.roles)||void 0===n?void 0:n.includes(t)}))||!e.roles))||(null==fe||null===(f=fe.data)||void 0===f||null===(E=f.nextActions)||void 0===E?void 0:E.filter(e=>(null==Le?void 0:Le.some(t=>{var n;return null===(n=e.roles)||void 0===n?void 0:n.includes(t)}))||!e.roles));console.log("actions here",Oe),n.useEffect(()=>{var e;const t=null==pe||null===(e=pe.Noc)||void 0===e?void 0:e[0];if(t){var n,l,i,o,a,r;const e=null==t||null===(n=t.nocDetails)||void 0===n||null===(l=n.additionalDetails)||void 0===l?void 0:l.applicationDetails,u=null==t||null===(i=t.nocDetails)||void 0===i||null===(o=i.additionalDetails)||void 0===o?void 0:o.siteDetails,d=null==t||null===(a=t.nocDetails)||void 0===a||null===(r=a.additionalDetails)||void 0===r?void 0:r.coordinates,s=(null==t?void 0:t.documents)||[];le({applicantDetails:e?[e]:[],siteDetails:u?[u]:[],coordinates:d?[d]:[],Documents:s.length>0?s:[]})}},[null==pe?void 0:pe.Noc]);const Te=function(e){try{var t,n;const l=c({},(null==pe||null===(t=pe.Noc)||void 0===t?void 0:t[0])||{},{workflow:{}}),i=null==e||null===(n=e.Licenses)||void 0===n?void 0:n[0];l.workflow={action:i.action,assignes:null==i?void 0:i.assignee,comment:null==i?void 0:i.comment,documents:null==i?void 0:i.wfDocuments};const o={Noc:c({},l)};console.log("final Payload ",o);const a=kt(function(){return Promise.resolve(Digit.NOCService.NOCUpdate({tenantId:G,details:o})).then(function(e){var t;if("successful"===(null==e||null===(t=e.ResponseInfo)||void 0===t?void 0:t.status))if("CANCEL"===(null==i?void 0:i.action))X({key:"true",success:!0,message:"COMMON_APPLICATION_CANCELLED_LABEL"}),fe.revalidate(),Se(null);else if("APPLY"===(null==i?void 0:i.action)||"RESUBMIT"===(null==i?void 0:i.action)||"DRAFT"===(null==i?void 0:i.action)){var n,l;console.log("We are calling employee response page"),Y.replace({pathname:"/digit-ui/employee/noc/response/"+(null==e||null===(n=e.Noc)||void 0===n||null===(l=n[0])||void 0===l?void 0:l.applicationNo),state:{data:e}})}else X({key:"true",success:!0,message:"COMMON_SUCCESSFULLY_UPDATED_APPLICATION_STATUS_LABEL"}),fe.revalidate(),Se(null);else X({key:"true",warning:!0,message:"COMMON_SOMETHING_WENT_WRONG_LABEL"}),Se(null)})},function(){X({key:"true",error:!0,message:"COMMON_SOME_ERROR_OCCURRED_LABEL"})});return Promise.resolve(a&&a.then?a.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},Ie=e=>{if(0===e)return V("NOC_GROUND_FLOOR_AREA_LABEL");const t=e%10,n=e%100;let l="th";return(n<11||n>13)&&(1===t?l="st":2===t?l="nd":3===t&&(l="rd")),""+e+l+" "+V("NOC_FLOOR_AREA_LABEL")};return console.log("displayData here",ne),l.createElement("div",{className:"employee-main-application-details"},l.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:"16px"}},l.createElement(t.Header,{styles:{fontSize:"32px"}},V("NDC_APP_OVER_VIEW_HEADER"))),l.createElement(t.Card,null,l.createElement(t.CardSubHeader,null,V("NOC_APPLICANT_DETAILS")),null==ne||null===(g=ne.applicantDetails)||void 0===g?void 0:g.map((e,n)=>{var i;return l.createElement("div",{key:n,style:{marginBottom:"30px",background:"#FAFAFA",padding:"16px",borderRadius:"4px"}},l.createElement(t.StatusTable,null,l.createElement(t.Row,{label:V("NOC_FIRM_OWNER_NAME_LABEL"),text:(null==e?void 0:e.applicantOwnerOrFirmName)||"N/A"}),l.createElement(t.Row,{label:V("NOC_APPLICANT_EMAIL_LABEL"),text:(null==e?void 0:e.applicantEmailId)||"N/A"}),l.createElement(t.Row,{label:V("NOC_APPLICANT_FATHER_HUSBAND_NAME_LABEL"),text:(null==e?void 0:e.applicantFatherHusbandName)||"N/A"}),l.createElement(t.Row,{label:V("NOC_APPLICANT_MOBILE_NO_LABEL"),text:(null==e?void 0:e.applicantMobileNumber)||"N/A"}),l.createElement(t.Row,{label:V("NOC_APPLICANT_DOB_LABEL"),text:(null==e?void 0:e.applicantDateOfBirth)||"N/A"}),l.createElement(t.Row,{label:V("NOC_APPLICANT_GENDER_LABEL"),text:(null==e||null===(i=e.applicantGender)||void 0===i?void 0:i.code)||(null==e?void 0:e.applicantGender)||"N/A"}),l.createElement(t.Row,{label:V("NOC_APPLICANT_ADDRESS_LABEL"),text:(null==e?void 0:e.applicantAddress)||"N/A"}),l.createElement(t.Row,{label:V("NOC_APPLICANT_PROPERTY_ID_LABEL"),text:(null==e?void 0:e.applicantPropertyId)||"N/A"})))})),(null==ne||null===(_=ne.applicantDetails)||void 0===_?void 0:_.professionalName)&&(null==ne||null===(h=ne.applicantDetails)||void 0===h?void 0:h.map((e,n)=>l.createElement(l.Fragment,null,l.createElement(t.Card,null,l.createElement(t.CardSubHeader,null,V("NOC_PROFESSIONAL_DETAILS")),l.createElement("div",{key:n,style:{marginBottom:"30px",background:"#FAFAFA",padding:"16px",borderRadius:"4px"}},l.createElement(t.StatusTable,null,l.createElement(t.Row,{label:V("NOC_PROFESSIONAL_NAME_LABEL"),text:(null==e?void 0:e.professionalName)||"N/A"}),l.createElement(t.Row,{label:V("NOC_PROFESSIONAL_EMAIL_LABEL"),text:(null==e?void 0:e.professionalEmailId)||"N/A"}),l.createElement(t.Row,{label:V("NOC_PROFESSIONAL_REGISTRATION_ID_LABEL"),text:(null==e?void 0:e.professionalRegId)||"N/A"}),l.createElement(t.Row,{label:V("NOC_PROFESSIONAL_MOBILE_NO_LABEL"),text:(null==e?void 0:e.professionalMobileNumber)||"N/A"}),l.createElement(t.Row,{label:V("NOC_PROFESSIONAL_ADDRESS_LABEL"),text:(null==e?void 0:e.professionalAddress)||"N/A"}))))))),l.createElement(t.Card,null,l.createElement(t.CardSubHeader,null,V("NOC_SITE_DETAILS")),null==ne||null===(A=ne.siteDetails)||void 0===A?void 0:A.map((e,n)=>{var i,o,a,r,u,d,s;return l.createElement("div",{key:n,style:{marginBottom:"30px",background:"#FAFAFA",padding:"16px",borderRadius:"4px"}},l.createElement(t.StatusTable,null,l.createElement(t.Row,{label:V("NOC_PLOT_NO_LABEL"),text:(null==e?void 0:e.plotNo)||"N/A"}),l.createElement(t.Row,{label:V("NOC_PROPOSED_SITE_ADDRESS"),text:(null==e?void 0:e.proposedSiteAddress)||"N/A"}),l.createElement(t.Row,{label:V("NOC_ULB_NAME_LABEL"),text:(null==e||null===(i=e.ulbName)||void 0===i?void 0:i.name)||(null==e?void 0:e.ulbName)||"N/A"}),l.createElement(t.Row,{label:V("NOC_ULB_TYPE_LABEL"),text:(null==e?void 0:e.ulbType)||"N/A"}),l.createElement(t.Row,{label:V("NOC_KHASRA_NO_LABEL"),text:(null==e?void 0:e.khasraNo)||"N/A"}),l.createElement(t.Row,{label:V("NOC_HADBAST_NO_LABEL"),text:(null==e?void 0:e.hadbastNo)||"N/A"}),l.createElement(t.Row,{label:V("NOC_ROAD_TYPE_LABEL"),text:(null==e||null===(o=e.roadType)||void 0===o?void 0:o.name)||(null==e?void 0:e.roadType)||"N/A"}),l.createElement(t.Row,{label:V("NOC_AREA_LEFT_FOR_ROAD_WIDENING_LABEL"),text:(null==e?void 0:e.areaLeftForRoadWidening)||"N/A"}),l.createElement(t.Row,{label:V("NOC_NET_PLOT_AREA_AFTER_WIDENING_LABEL"),text:(null==e?void 0:e.netPlotAreaAfterWidening)||"N/A"}),l.createElement(t.Row,{label:V("NOC_NET_TOTAL_AREA_LABEL"),text:(null==e?void 0:e.netTotalArea)||"N/A"}),l.createElement(t.Row,{label:V("NOC_ROAD_WIDTH_AT_SITE_LABEL"),text:(null==e?void 0:e.roadWidthAtSite)||"N/A"}),l.createElement(t.Row,{label:V("NOC_BUILDING_STATUS_LABEL"),text:(null==e||null===(a=e.buildingStatus)||void 0===a?void 0:a.name)||(null==e?void 0:e.buildingStatus)||"N/A"}),l.createElement(t.Row,{label:V("NOC_IS_BASEMENT_AREA_PRESENT_LABEL"),text:(null==e||null===(r=e.isBasementAreaAvailable)||void 0===r?void 0:r.code)||(null==e?void 0:e.isBasementAreaAvailable)||"N/A"}),"Built Up"==(null==e?void 0:e.buildingStatus)&&l.createElement(t.Row,{label:V("NOC_BASEMENT_AREA_LABEL"),text:(null==e?void 0:e.basementArea)||"N/A"}),"Built Up"==(null==e?void 0:e.buildingStatus)&&(null==e||null===(u=e.floorArea)||void 0===u?void 0:u.map((e,n)=>l.createElement(t.Row,{label:Ie(n),text:e.value||"N/A"}))),"Built Up"==(null==e?void 0:e.buildingStatus)&&l.createElement(t.Row,{label:V("NOC_TOTAL_FLOOR_BUILT_UP_AREA_LABEL"),text:(null==e?void 0:e.totalFloorArea)||"N/A"}),l.createElement(t.Row,{label:V("NOC_DISTRICT_LABEL"),text:(null==e||null===(d=e.district)||void 0===d?void 0:d.name)||(null==e?void 0:e.district)||"N/A"}),l.createElement(t.Row,{label:V("NOC_ZONE_LABEL"),text:(null==e||null===(s=e.zone)||void 0===s?void 0:s.name)||(null==e?void 0:e.zone)||"N/A"}),l.createElement(t.Row,{label:V("NOC_SITE_WARD_NO_LABEL"),text:(null==e?void 0:e.wardNo)||"N/A"}),l.createElement(t.Row,{label:V("NOC_SITE_VILLAGE_NAME_LABEL"),text:(null==e?void 0:e.villageName)||"N/A"}),l.createElement(t.Row,{label:V("NOC_SITE_COLONY_NAME_LABEL"),text:(null==e?void 0:e.colonyName)||"N/A"}),l.createElement(t.Row,{label:V("NOC_SITE_VASIKA_NO_LABEL"),text:(null==e?void 0:e.vasikaNumber)||"N/A"}),l.createElement(t.Row,{label:V("NOC_SITE_KHEWAT_AND_KHATUNI_NO_LABEL"),text:(null==e?void 0:e.khewatAndKhatuniNo)||"N/A"})))})),l.createElement(t.Card,null,l.createElement(t.CardSubHeader,null,V("NOC_SPECIFICATION_DETAILS")),null==ne||null===(S=ne.siteDetails)||void 0===S?void 0:S.map((e,n)=>{var i,o,a,r;return l.createElement("div",{key:n,style:{marginBottom:"30px",background:"#FAFAFA",padding:"16px",borderRadius:"4px"}},l.createElement(t.StatusTable,null,l.createElement(t.Row,{label:V("NOC_PLOT_AREA_JAMA_BANDI_LABEL"),text:(null==e?void 0:e.specificationPlotArea)||"N/A"}),l.createElement(t.Row,{label:V("NOC_BUILDING_CATEGORY_LABEL"),text:(null==e||null===(i=e.specificationBuildingCategory)||void 0===i?void 0:i.name)||(null==e?void 0:e.specificationBuildingCategory)||"N/A"}),l.createElement(t.Row,{label:V("NOC_NOC_TYPE_LABEL"),text:(null==e||null===(o=e.specificationNocType)||void 0===o?void 0:o.name)||(null==e?void 0:e.specificationNocType)||"N/A"}),l.createElement(t.Row,{label:V("NOC_RESTRICTED_AREA_LABEL"),text:(null==e||null===(a=e.specificationRestrictedArea)||void 0===a?void 0:a.code)||(null==e?void 0:e.specificationRestrictedArea)||"N/A"}),l.createElement(t.Row,{label:V("NOC_IS_SITE_UNDER_MASTER_PLAN_LABEL"),text:(null==e||null===(r=e.specificationIsSiteUnderMasterPlan)||void 0===r?void 0:r.code)||(null==e?void 0:e.specificationIsSiteUnderMasterPlan)||"N/A"})))})),l.createElement(t.Card,null,l.createElement(t.CardSubHeader,null,V("NOC_SITE_COORDINATES_LABEL")),null==ne||null===(N=ne.coordinates)||void 0===N?void 0:N.map((e,n)=>l.createElement("div",{key:n,style:{marginBottom:"30px",background:"#FAFAFA",padding:"16px",borderRadius:"4px"}},l.createElement(t.StatusTable,null,l.createElement(t.Row,{label:V("COMMON_LATITUDE1_LABEL"),text:(null==e?void 0:e.Latitude1)||"N/A"}),l.createElement(t.Row,{label:V("COMMON_LONGITUDE1_LABEL"),text:(null==e?void 0:e.Longitude1)||"N/A"}),l.createElement(t.Row,{label:V("COMMON_LATITUDE2_LABEL"),text:(null==e?void 0:e.Latitude2)||"N/A"}),l.createElement(t.Row,{label:V("COMMON_LONGITUDE2_LABEL"),text:(null==e?void 0:e.Longitude2)||"N/A"}))))),l.createElement(t.Card,null,l.createElement(t.CardSubHeader,null,V("NOC_TITILE_DOCUMENT_UPLOADED")),l.createElement(t.StatusTable,null,(null==ne||null===(b=ne.Documents)||void 0===b?void 0:b.length)>0&&l.createElement(Cl,{documents:ne.Documents}))),l.createElement(t.Card,null,l.createElement(t.CardSubHeader,null,V("NOC_FEE_DETAILS_LABEL")),(null==pe||null===(C=pe.Noc)||void 0===C||null===(y=C[0])||void 0===y?void 0:y.nocDetails)&&l.createElement(yl,{formData:{apiData:c({},pe),applicationDetails:c({},null==pe||null===(D=pe.Noc)||void 0===D||null===(L=D[0])||void 0===L||null===(O=L.nocDetails)||void 0===O||null===(T=O.additionalDetails)||void 0===T?void 0:T.applicationDetails),siteDetails:c({},null==pe||null===(I=pe.Noc)||void 0===I||null===(w=I[0])||void 0===w||null===(R=w.nocDetails)||void 0===R||null===(P=R.additionalDetails)||void 0===P?void 0:P.siteDetails)}})),(null==fe||null===(x=fe.data)||void 0===x?void 0:x.timeline)&&l.createElement(t.Card,null,l.createElement(t.CardSubHeader,null,V("CS_APPLICATION_DETAILS_APPLICATION_TIMELINE")),1===(null==fe||null===(B=fe.data)||void 0===B?void 0:B.timeline.length)?l.createElement(t.CheckPoint,{isCompleted:!0,label:V(null==fe||null===(F=fe.data)||void 0===F||null===(M=F.timeline[0])||void 0===M?void 0:M.status)}):l.createElement(t.ConnectingCheckPoints,null,null==fe||null===(U=fe.data)||void 0===U?void 0:U.timeline.map((e,n,i)=>l.createElement(t.CheckPoint,{keyValue:n,isCompleted:0===n,label:V("NOC_STATUS_"+e.status),customChild:Dl(e,n,0,V)})))),(null==Oe?void 0:Oe.length)>0&&l.createElement(t.ActionBar,null,_e&&(null!=fe&&null!==(k=fe.data)&&void 0!==k&&null!==(W=k.actionState)&&void 0!==W&&W.nextActions||null!=fe&&null!==(H=fe.data)&&void 0!==H&&H.nextActions)?l.createElement(t.Menu,{localeKeyPrefix:"WF_EMPLOYEE_NOC",options:Oe,optionKey:"action",t:V,onSelect:function(e){var t,n,l,i,o;console.log("selected action",e);const a=null==pe||null===(t=pe.Noc)||void 0===t||null===(n=t[0])||void 0===n?void 0:n.applicationNo,r=null==e||null===(l=e.state)||void 0===l||null===(i=l.actions)||void 0===i?void 0:i.filter(t=>t.action==(null==e?void 0:e.action)),u=null==se?void 0:se.filter(e=>{var t;return(null==e?void 0:e.uuid)==(null===(t=r[0])||void 0===t?void 0:t.nextState)});re(null==u||null===(o=u[0])||void 0===o?void 0:o.actions);const d={Licenses:[e]};"EDIT"==(null==e?void 0:e.action)?Y.push("/digit-ui/employee/noc/edit-application/"+a):"DRAFT"==(null==e?void 0:e.action)?X({key:"true",warning:!0,message:"COMMON_EDIT_APPLICATION_BEFORE_SAVE_OR_SUBMIT_LABEL"}):"APPLY"==(null==e?void 0:e.action)||"RESUBMIT"==(null==e?void 0:e.action)||"CANCEL"==(null==e?void 0:e.action)?Te(d):"PAY"==(null==e?void 0:e.action)?Y.push("/digit-ui/employee/payment/collect/obpas_noc/"+a+"/"+G+"?tenantId="+G):(be(!0),Se(e))}}):null,l.createElement(t.SubmitBar,{ref:De,label:V("WF_TAKE_ACTION"),onSubmit:()=>he(!_e)})),Ne?l.createElement(bl,{t:V,action:Ae,tenantId:G,state:K,getEmployees:ae,id:z,applicationDetails:pe,applicationData:null==pe?void 0:pe.Noc,closeModal:()=>{Se(null),be(!1)},submitAction:Te,actionData:null==fe||null===(j=fe.data)||void 0===j?void 0:j.timeline,workflowDetails:fe,showToast:q,setShowToast:X,closeToast:Ce,errors:J,showErrorToast:Z,errorOne:ee,closeToastOne:()=>{$(null)}}):null,q&&l.createElement(t.Toast,{error:null==q?void 0:q.error,warning:null==q?void 0:q.warning,label:V(null==q?void 0:q.message),isDleteBtn:!0,onClose:Ce}),(ve||ue)&&l.createElement(t.Loader,{page:!0}))},NewNOCEditApplication:()=>{var e,a,r,u,s,v,m,p;const{id:f}=i.useParams(),{t:E}=(i.useHistory(),o.useTranslation()),g=d.useDispatch(),[_,h]=n.useState(null),A=d.useSelector(e=>e.noc.NOCNewApplicationFormReducer),S=A.formData,N=A.step;let b;b=window.location.pathname.includes("employee")?window.localStorage.getItem("Employee.tenant-id"):window.localStorage.getItem("CITIZEN.CITY"),console.log("tenantId here",b);const{isLoading:C,data:y}=Digit.Hooks.noc.useNOCSearchApplication({applicationNo:f},b),D=null==y?void 0:y.resData;console.log("applicationDetails here==>",D);const L=(null==D||null===(e=D.Noc)||void 0===e?void 0:e[0])||{},O=(null==L||null===(a=L.nocDetails)||void 0===a||null===(r=a.additionalDetails)||void 0===r?void 0:r.applicationDetails)||{},T=(null==L||null===(u=L.nocDetails)||void 0===u||null===(s=u.additionalDetails)||void 0===s?void 0:s.siteDetails)||{},I=(null==L||null===(v=L.documents)||void 0===v?void 0:v.filter(e=>(null==e?void 0:e.documentUid)||(null==e?void 0:e.documentType)))||[],w=(null==L||null===(m=L.nocDetails)||void 0===m||null===(p=m.additionalDetails)||void 0===p?void 0:p.coordinates)||{},R=Digit.ULBService.getStateId(),{data:P,isLoading:x}=Digit.Hooks.noc.useBuildingType(R),{data:B}=Digit.Hooks.noc.useRoadType(R),{data:F}=Digit.Hooks.noc.useBuildingCategory(R),{data:M}=Digit.Hooks.noc.useNocType(R),{data:U,isLoading:k}=Digit.Hooks.useTenants(),[W,H]=n.useState(Digit.Hooks.noc.useTenants()),j=[{code:"YES",i18nKey:"YES"},{code:"NO",i18nKey:"NO"}],z=null==U?void 0:U.map(e=>c({},e,{displayName:E(e.i18nKey)})),{data:V}=Digit.Hooks.obps.useMDMS(R,"common-masters",["GenderType"]);let G=[];V&&V["common-masters"].GenderType.filter(e=>e.active).map(e=>{G.push({i18nKey:"COMMON_GENDER_"+e.code,code:""+e.code,value:""+e.code})});const[Y,K]=n.useState(null),{data:q}=Digit.Hooks.useBoundaryLocalities(null==Y?void 0:Y.code,"revenue",{enabled:!!Y},E);return n.useEffect(()=>{if((null==q?void 0:q.length)>0&&null!=T&&T.zone){var e;const t=(null==T||null===(e=T.zone)||void 0===e?void 0:e.name)||(null==T?void 0:T.zone),n=q.find(e=>e.name===t);n&&g(Li("siteDetails",c({},S.siteDetails,{zone:n})))}},[q,null==T?void 0:T.zone]),n.useEffect(()=>{if(g({type:"RESET_NOC_NEW_APPLICATION_FORM"}),!C&&!x&&null!=L&&L.nocDetails&&!k){const e={documents:{documents:null==I?void 0:I.map(e=>({documentType:(null==e?void 0:e.documentType)||"",uuid:(null==e?void 0:e.uuid)||"",documentUid:(null==e?void 0:e.documentUid)||"",documentAttachment:(null==e?void 0:e.documentAttachment)||"",filestoreId:(null==e?void 0:e.uuid)||""}))}};Object.entries(w).forEach(e=>{let[t,n]=e;g(Ti(t,n))});const t=c({},O,{applicantGender:G.find(e=>{var t;return e.code===(null==O||null===(t=O.applicantGender)||void 0===t?void 0:t.code)||e.code===(null==O?void 0:O.applicantGender)})}),n=W.find(e=>{var t;return e.name===(null==T||null===(t=T.district)||void 0===t?void 0:t.name)||e.name===(null==T?void 0:T.district)});K(n);const l=c({},T,{ulbName:z.find(e=>{var t;return e.name===(null==T||null===(t=T.ulbName)||void 0===t?void 0:t.name)||e.name===(null==T?void 0:T.ulbName)}),roadType:B.find(e=>{var t;return e.name===(null==T||null===(t=T.roadType)||void 0===t?void 0:t.name)||e.name===(null==T?void 0:T.roadType)}),buildingStatus:P.find(e=>{var t;return e.name===(null==T||null===(t=T.buildingStatus)||void 0===t?void 0:t.name)||e.name===(null==T?void 0:T.buildingStatus)}),isBasementAreaAvailable:j.find(e=>{var t;return e.code===(null==T||null===(t=T.isBasementAreaAvailable)||void 0===t?void 0:t.code)||e.code===(null==T?void 0:T.isBasementAreaAvailable)}),district:n,specificationBuildingCategory:F.find(e=>{var t;return e.name===(null==T||null===(t=T.specificationBuildingCategory)||void 0===t?void 0:t.name)||e.name===(null==T?void 0:T.specificationBuildingCategory)}),specificationNocType:M.find(e=>{var t;return e.name===(null==T||null===(t=T.specificationNocType)||void 0===t?void 0:t.name)||e.name===(null==T?void 0:T.specificationNocType)}),specificationRestrictedArea:j.find(e=>{var t;return e.code===(null==T||null===(t=T.specificationRestrictedArea)||void 0===t?void 0:t.code)||e.code===(null==T?void 0:T.specificationRestrictedArea)}),specificationIsSiteUnderMasterPlan:j.find(e=>{var t;return e.code===(null==T||null===(t=T.specificationIsSiteUnderMasterPlan)||void 0===t?void 0:t.code)||e.code===(null==T?void 0:T.specificationIsSiteUnderMasterPlan)})});g(Li("applicationDetails",t)),g(Li("siteDetails",l)),g(Li("documents",e)),g(Li("apiData",D))}},[C,D,x]),C||!S.applicationDetails?l.createElement("div",null,l.createElement(t.Loader,null)):l.createElement("div",{className:"pageCard"},l.createElement(t.CardHeader,{styles:{fontSize:"28px",fontWeight:"400",color:"#1C1D1F"},divider:!0},E("NOC_REGISTRATION_APPLICATION")),l.createElement(yi,{stepsList:ki,onSubmit:e=>{},step:N,setStep:e=>{g(Oi(e))}}),_&&l.createElement(t.Toast,{error:_.key,label:E(_.label),onClose:()=>{h(null)},isDleteBtn:"true"}))},NOCCitizenSearchApplication:()=>{const{t:e}=o.useTranslation(),i=Digit.UserService.getUser().info;let a;a=window.location.pathname.includes("employee")?window.localStorage.getItem("Employee.tenant-id"):window.localStorage.getItem("CITIZEN.CITY");const r={offset:0,limit:10,tenantId:a,mobileNumber:null==i?void 0:i.mobileNumber},[u,d]=n.useState(r),s=window.Digit.Utils.browser.isMobile(),[c,v]=n.useState([{display:"ES_COMMON_NO_DATA"}]),[m,p]=n.useState(0),{data:f,isLoading:E,error:g}=Digit.Hooks.noc.useNOCSearchApplicationByIdOrMobile(u,a,{});return n.useEffect(()=>{var e;null==f?v([{display:"ES_COMMON_NO_DATA"}]):(null==f||null===(e=f.data)||void 0===e?void 0:e.length)>0&&(v(null==f?void 0:f.data),p(null==f?void 0:f.totalCount))},[f]),l.createElement("div",null,l.createElement(t.CardHeader,{styles:s?{fontSize:"32px",fontWeight:"700",paddingLeft:"10px"}:{fontSize:"32px",fontWeight:"700"}},e("ACTION_TEST_SEARCH_NOC_APPLICATION")),l.createElement(ea,{t:e,tenantId:a,onSubmit:function(e,t){console.log("_data==>",e);let n=ht(e);!!n.applicationNo&&!n.mobileNumber&&(console.log("we are deleteing mobileNumber here"),delete n.mobileNumber),d(n)},isLoading:E,Count:m,error:g,data:c}))}};exports.NOCLinks=ta,exports.NOCModule=na,exports.NOCReducers=()=>u.combineReducers({NOCNewApplicationFormReducer:Ai}),exports.initNOCComponents=()=>{Object.entries(la).forEach(e=>{let[t,n]=e;Digit.ComponentRegistryService.setComponent(t,n)})};
|
|
1
|
+
function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}var t=require("@mseva/digit-ui-react-components"),n=require("react"),l=e(n),i=require("react-router-dom"),o=require("react-i18next"),a=require("react-hook-form"),r=require("react-query"),u=require("redux"),s=require("react-redux"),d=e(require("exif-js"));function c(){return(c=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var l in n)({}).hasOwnProperty.call(n,l)&&(e[l]=n[l])}return e}).apply(null,arguments)}function v(e,t){if(null==e)return{};var n={};for(var l in e)if({}.hasOwnProperty.call(e,l)){if(-1!==t.indexOf(l))continue;n[l]=e[l]}return n}const m=e=>{if(e){const t=new Date(e);let n=t.getMonth()+1,l=t.getDate(),i=t.getFullYear();return n=(n>9?"":"0")+n,l=(l>9?"":"0")+l,l+"/"+n+"/"+i}return null},p=function(e,t,n){if(void 0===e&&(e=""),void 0===t&&(t=""),void 0===n&&(n=""),""==t)return e;for(;e.includes(t);)e=e.replace(t,n);return e},f=function(e){void 0===e&&(e=!1);let t=window.location.href.includes("/search");const n=[{code:t?"FIRE_NOC":"FIRE_NOC_SRV",active:!0,roles:["FIRE_NOC_APPROVER"],i18nKey:"WF_FIRE_NOC_FIRE_NOC_SRV"},{code:t?"AIRPORT_AUTHORITY":"AIRPORT_NOC_SRV",active:!0,roles:["AIRPORT_AUTHORITY_APPROVER"],i18nKey:"WF_FIRE_NOC_AIRPORT_NOC_SRV"}],l=[],i=Digit.UserService.getUser().info.roles;return n.map((t,o)=>{let{roles:a}=t;a.map(t=>{i.map(i=>{var a;i.code===t&&l.push(e?null==n||null===(a=n[o])||void 0===a?void 0:a.code:null==n?void 0:n[o])})})}),l},E=function(e,t){return void 0===e&&(e=""),void 0===t&&(t=0),decodeURIComponent(e.split("?")[0].split("/").pop().slice(13))||"Document - "+(t+1)},g=function(e,t,n){void 0===e&&(e={}),void 0===t&&(t="");let l=e[t]||"",i=(null==l?void 0:l.split(","))||[],o="";return i.length>0&&i.map(e=>{e.includes("large")||e.includes("medium")||e.includes("small")||(o=e)}),o};var h=function(e,t){return e===t||e!=e&&t!=t},A=function(e,t){for(var n=e.length;n--;)if(h(e[n][0],t))return n;return-1},S=Array.prototype.splice;function N(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var l=e[t];this.set(l[0],l[1])}}N.prototype.clear=function(){this.__data__=[],this.size=0},N.prototype.delete=function(e){var t=this.__data__,n=A(t,e);return!(n<0||(n==t.length-1?t.pop():S.call(t,n,1),--this.size,0))},N.prototype.get=function(e){var t=this.__data__,n=A(t,e);return n<0?void 0:t[n][1]},N.prototype.has=function(e){return A(this.__data__,e)>-1},N.prototype.set=function(e,t){var n=this.__data__,l=A(n,e);return l<0?(++this.size,n.push([e,t])):n[l][1]=t,this};var b=N,C="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function y(e,t){return e(t={exports:{}},t.exports),t.exports}var D,L="object"==typeof C&&C&&C.Object===Object&&C,O="object"==typeof self&&self&&self.Object===Object&&self,T=L||O||Function("return this")(),I=T.Symbol,w=Object.prototype,P=w.hasOwnProperty,R=w.toString,x=I?I.toStringTag:void 0,B=Object.prototype.toString,F=I?I.toStringTag:void 0,M=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":F&&F in Object(e)?function(e){var t=P.call(e,x),n=e[x];try{e[x]=void 0;var l=!0}catch(e){}var i=R.call(e);return l&&(t?e[x]=n:delete e[x]),i}(e):function(e){return B.call(e)}(e)},U=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},k=function(e){if(!U(e))return!1;var t=M(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t},W=T["__core-js_shared__"],H=(D=/[^.]+$/.exec(W&&W.keys&&W.keys.IE_PROTO||""))?"Symbol(src)_1."+D:"",j=Function.prototype.toString,z=function(e){if(null!=e){try{return j.call(e)}catch(e){}try{return e+""}catch(e){}}return""},V=/^\[object .+?Constructor\]$/,G=RegExp("^"+Function.prototype.toString.call(Object.prototype.hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Y=function(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return function(e){return!(!U(e)||(t=e,H&&H in t))&&(k(e)?G:V).test(z(e));var t}(n)?n:void 0},K=Y(T,"Map"),q=Y(Object,"create"),X=Object.prototype.hasOwnProperty,J=Object.prototype.hasOwnProperty;function Q(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var l=e[t];this.set(l[0],l[1])}}Q.prototype.clear=function(){this.__data__=q?q(null):{},this.size=0},Q.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Q.prototype.get=function(e){var t=this.__data__;if(q){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return X.call(t,e)?t[e]:void 0},Q.prototype.has=function(e){var t=this.__data__;return q?void 0!==t[e]:J.call(t,e)},Q.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=q&&void 0===t?"__lodash_hash_undefined__":t,this};var Z=Q,$=function(e,t){var n=e.__data__;return function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}(t)?n["string"==typeof t?"string":"hash"]:n.map};function ee(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var l=e[t];this.set(l[0],l[1])}}ee.prototype.clear=function(){this.size=0,this.__data__={hash:new Z,map:new(K||b),string:new Z}},ee.prototype.delete=function(e){var t=$(this,e).delete(e);return this.size-=t?1:0,t},ee.prototype.get=function(e){return $(this,e).get(e)},ee.prototype.has=function(e){return $(this,e).has(e)},ee.prototype.set=function(e,t){var n=$(this,e),l=n.size;return n.set(e,t),this.size+=n.size==l?0:1,this};var te=ee;function ne(e){var t=this.__data__=new b(e);this.size=t.size}ne.prototype.clear=function(){this.__data__=new b,this.size=0},ne.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},ne.prototype.get=function(e){return this.__data__.get(e)},ne.prototype.has=function(e){return this.__data__.has(e)},ne.prototype.set=function(e,t){var n=this.__data__;if(n instanceof b){var l=n.__data__;if(!K||l.length<199)return l.push([e,t]),this.size=++n.size,this;n=this.__data__=new te(l)}return n.set(e,t),this.size=n.size,this};var le=ne,ie=function(){try{var e=Y(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),oe=function(e,t,n){"__proto__"==t&&ie?ie(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n},ae=Object.prototype.hasOwnProperty,re=function(e,t,n){var l=e[t];ae.call(e,t)&&h(l,n)&&(void 0!==n||t in e)||oe(e,t,n)},ue=function(e,t,n,l){var i=!n;n||(n={});for(var o=-1,a=t.length;++o<a;){var r=t[o],u=l?l(n[r],e[r],r,n,e):void 0;void 0===u&&(u=e[r]),i?oe(n,r,u):re(n,r,u)}return n},se=function(e){return null!=e&&"object"==typeof e},de=function(e){return se(e)&&"[object Arguments]"==M(e)},ce=Object.prototype,ve=ce.hasOwnProperty,me=ce.propertyIsEnumerable,pe=de(function(){return arguments}())?de:function(e){return se(e)&&ve.call(e,"callee")&&!me.call(e,"callee")},fe=Array.isArray,Ee=function(){return!1},ge=y(function(e,t){var n=t&&!t.nodeType&&t,l=n&&e&&!e.nodeType&&e,i=l&&l.exports===n?T.Buffer:void 0;e.exports=(i?i.isBuffer:void 0)||Ee}),_e=/^(?:0|[1-9]\d*)$/,he=function(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&_e.test(e))&&e>-1&&e%1==0&&e<t},Ae=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991},Se={};Se["[object Float32Array]"]=Se["[object Float64Array]"]=Se["[object Int8Array]"]=Se["[object Int16Array]"]=Se["[object Int32Array]"]=Se["[object Uint8Array]"]=Se["[object Uint8ClampedArray]"]=Se["[object Uint16Array]"]=Se["[object Uint32Array]"]=!0,Se["[object Arguments]"]=Se["[object Array]"]=Se["[object ArrayBuffer]"]=Se["[object Boolean]"]=Se["[object DataView]"]=Se["[object Date]"]=Se["[object Error]"]=Se["[object Function]"]=Se["[object Map]"]=Se["[object Number]"]=Se["[object Object]"]=Se["[object RegExp]"]=Se["[object Set]"]=Se["[object String]"]=Se["[object WeakMap]"]=!1;var Ne=function(e){return function(t){return e(t)}},be=y(function(e,t){var n=t&&!t.nodeType&&t,l=n&&e&&!e.nodeType&&e,i=l&&l.exports===n&&L.process,o=function(){try{return l&&l.require&&l.require("util").types||i&&i.binding&&i.binding("util")}catch(e){}}();e.exports=o}),Ce=be&&be.isTypedArray,ye=Ce?Ne(Ce):function(e){return se(e)&&Ae(e.length)&&!!Se[M(e)]},De=Object.prototype.hasOwnProperty,Le=function(e,t){var n=fe(e),l=!n&&pe(e),i=!n&&!l&&ge(e),o=!n&&!l&&!i&&ye(e),a=n||l||i||o,r=a?function(e,t){for(var n=-1,l=Array(e);++n<e;)l[n]=t(n);return l}(e.length,String):[],u=r.length;for(var s in e)!t&&!De.call(e,s)||a&&("length"==s||i&&("offset"==s||"parent"==s)||o&&("buffer"==s||"byteLength"==s||"byteOffset"==s)||he(s,u))||r.push(s);return r},Oe=Object.prototype,Te=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Oe)},Ie=function(e,t){return function(n){return e(t(n))}},we=Ie(Object.keys,Object),Pe=Object.prototype.hasOwnProperty,Re=function(e){return null!=e&&Ae(e.length)&&!k(e)},xe=function(e){return Re(e)?Le(e):function(e){if(!Te(e))return we(e);var t=[];for(var n in Object(e))Pe.call(e,n)&&"constructor"!=n&&t.push(n);return t}(e)},Be=Object.prototype.hasOwnProperty,Fe=function(e){return Re(e)?Le(e,!0):function(e){if(!U(e))return function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}(e);var t=Te(e),n=[];for(var l in e)("constructor"!=l||!t&&Be.call(e,l))&&n.push(l);return n}(e)},Me=y(function(e,t){var n=t&&!t.nodeType&&t,l=n&&e&&!e.nodeType&&e,i=l&&l.exports===n?T.Buffer:void 0,o=i?i.allocUnsafe:void 0;e.exports=function(e,t){if(t)return e.slice();var n=e.length,l=o?o(n):new e.constructor(n);return e.copy(l),l}}),Ue=function(){return[]},ke=Object.prototype.propertyIsEnumerable,We=Object.getOwnPropertySymbols,He=We?function(e){return null==e?[]:(e=Object(e),function(t,n){for(var l=-1,i=null==t?0:t.length,o=0,a=[];++l<i;){var r=t[l];ke.call(e,r)&&(a[o++]=r)}return a}(We(e)))}:Ue,je=function(e,t){for(var n=-1,l=t.length,i=e.length;++n<l;)e[i+n]=t[n];return e},ze=Ie(Object.getPrototypeOf,Object),Ve=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)je(t,He(e)),e=ze(e);return t}:Ue,Ge=function(e,t,n){var l=t(e);return fe(e)?l:je(l,n(e))},Ye=function(e){return Ge(e,xe,He)},Ke=function(e){return Ge(e,Fe,Ve)},qe=Y(T,"DataView"),Xe=Y(T,"Promise"),Je=Y(T,"Set"),Qe=Y(T,"WeakMap"),Ze=z(qe),$e=z(K),et=z(Xe),tt=z(Je),nt=z(Qe),lt=M;(qe&&"[object DataView]"!=lt(new qe(new ArrayBuffer(1)))||K&&"[object Map]"!=lt(new K)||Xe&&"[object Promise]"!=lt(Xe.resolve())||Je&&"[object Set]"!=lt(new Je)||Qe&&"[object WeakMap]"!=lt(new Qe))&&(lt=function(e){var t=M(e),n="[object Object]"==t?e.constructor:void 0,l=n?z(n):"";if(l)switch(l){case Ze:return"[object DataView]";case $e:return"[object Map]";case et:return"[object Promise]";case tt:return"[object Set]";case nt:return"[object WeakMap]"}return t});var it=lt,ot=Object.prototype.hasOwnProperty,at=T.Uint8Array,rt=function(e){var t=new e.constructor(e.byteLength);return new at(t).set(new at(e)),t},ut=/\w*$/,st=I?I.prototype:void 0,dt=st?st.valueOf:void 0,ct=Object.create,vt=function(){function e(){}return function(t){if(!U(t))return{};if(ct)return ct(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}(),mt=be&&be.isMap,pt=mt?Ne(mt):function(e){return se(e)&&"[object Map]"==it(e)},ft=be&&be.isSet,Et=ft?Ne(ft):function(e){return se(e)&&"[object Set]"==it(e)},gt={};gt["[object Arguments]"]=gt["[object Array]"]=gt["[object ArrayBuffer]"]=gt["[object DataView]"]=gt["[object Boolean]"]=gt["[object Date]"]=gt["[object Float32Array]"]=gt["[object Float64Array]"]=gt["[object Int8Array]"]=gt["[object Int16Array]"]=gt["[object Int32Array]"]=gt["[object Map]"]=gt["[object Number]"]=gt["[object Object]"]=gt["[object RegExp]"]=gt["[object Set]"]=gt["[object String]"]=gt["[object Symbol]"]=gt["[object Uint8Array]"]=gt["[object Uint8ClampedArray]"]=gt["[object Uint16Array]"]=gt["[object Uint32Array]"]=!0,gt["[object Error]"]=gt["[object Function]"]=gt["[object WeakMap]"]=!1;var _t=function e(t,n,l,i,o,a){var r,u=1&n,s=2&n,d=4&n;if(l&&(r=o?l(t,i,o,a):l(t)),void 0!==r)return r;if(!U(t))return t;var c=fe(t);if(c){if(r=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&ot.call(e,"index")&&(n.index=e.index,n.input=e.input),n}(t),!u)return function(e,t){var n=-1,l=e.length;for(t||(t=Array(l));++n<l;)t[n]=e[n];return t}(t,r)}else{var v=it(t),m="[object Function]"==v||"[object GeneratorFunction]"==v;if(ge(t))return Me(t,u);if("[object Object]"==v||"[object Arguments]"==v||m&&!o){if(r=s||m?{}:function(e){return"function"!=typeof e.constructor||Te(e)?{}:vt(ze(e))}(t),!u)return s?function(e,t){return ue(e,Ve(e),t)}(t,function(e,t){return e&&ue(t,Fe(t),e)}(r,t)):function(e,t){return ue(e,He(e),t)}(t,function(e,t){return e&&ue(t,xe(t),e)}(r,t))}else{if(!gt[v])return o?t:{};r=function(e,t,n){var l,i,o=e.constructor;switch(t){case"[object ArrayBuffer]":return rt(e);case"[object Boolean]":case"[object Date]":return new o(+e);case"[object DataView]":return function(e,t){var n=t?rt(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,n);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return function(e,t){var n=t?rt(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}(e,n);case"[object Map]":return new o;case"[object Number]":case"[object String]":return new o(e);case"[object RegExp]":return(i=new(l=e).constructor(l.source,ut.exec(l))).lastIndex=l.lastIndex,i;case"[object Set]":return new o;case"[object Symbol]":return dt?Object(dt.call(e)):{}}}(t,v,u)}}a||(a=new le);var p=a.get(t);if(p)return p;a.set(t,r),Et(t)?t.forEach(function(i){r.add(e(i,n,l,i,t,a))}):pt(t)&&t.forEach(function(i,o){r.set(o,e(i,n,l,o,t,a))});var f=c?void 0:(d?s?Ke:Ye:s?Fe:xe)(t);return function(e,t){for(var n=-1,l=null==e?0:e.length;++n<l&&!1!==t(e[n],n););}(f||t,function(i,o){f&&(i=t[o=i]),re(r,o,e(i,n,l,o,t,a))}),r},ht=function(e){return _t(e,5)},At=y(function(e,t){(function(){var n="Expected a function",l="__lodash_placeholder__",i=[["ary",128],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",32],["partialRight",64],["rearg",256]],o="[object Arguments]",a="[object Array]",r="[object Boolean]",u="[object Date]",s="[object Error]",d="[object Function]",c="[object GeneratorFunction]",v="[object Map]",m="[object Number]",p="[object Object]",f="[object RegExp]",E="[object Set]",g="[object String]",_="[object Symbol]",h="[object WeakMap]",A="[object ArrayBuffer]",S="[object DataView]",N="[object Float32Array]",b="[object Float64Array]",y="[object Int8Array]",D="[object Int16Array]",L="[object Int32Array]",O="[object Uint8Array]",T="[object Uint16Array]",I="[object Uint32Array]",w=/\b__p \+= '';/g,P=/\b(__p \+=) '' \+/g,R=/(__e\(.*?\)|\b__t\)) \+\n'';/g,x=/&(?:amp|lt|gt|quot|#39);/g,B=/[&<>"']/g,F=RegExp(x.source),M=RegExp(B.source),U=/<%-([\s\S]+?)%>/g,k=/<%([\s\S]+?)%>/g,W=/<%=([\s\S]+?)%>/g,H=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,j=/^\w*$/,z=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,V=/[\\^$.*+?()[\]{}|]/g,G=RegExp(V.source),Y=/^\s+/,K=/\s/,q=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,X=/\{\n\/\* \[wrapped with (.+)\] \*/,J=/,? & /,Q=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Z=/[()=,{}\[\]\/\s]/,$=/\\(\\)?/g,ee=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,te=/\w*$/,ne=/^[-+]0x[0-9a-f]+$/i,le=/^0b[01]+$/i,ie=/^\[object .+?Constructor\]$/,oe=/^0o[0-7]+$/i,ae=/^(?:0|[1-9]\d*)$/,re=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ue=/($^)/,se=/['\n\r\u2028\u2029\\]/g,de="\\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+"]",me="["+de+"]",pe="\\d+",fe="[a-z\\xdf-\\xf6\\xf8-\\xff]",Ee="[^\\ud800-\\udfff"+ce+pe+"\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",ge="\\ud83c[\\udffb-\\udfff]",_e="[^\\ud800-\\udfff]",he="(?:\\ud83c[\\udde6-\\uddff]){2}",Ae="[\\ud800-\\udbff][\\udc00-\\udfff]",Se="[A-Z\\xc0-\\xd6\\xd8-\\xde]",Ne="(?:"+fe+"|"+Ee+")",be="(?:"+Se+"|"+Ee+")",Ce="(?:"+me+"|"+ge+")?",ye="[\\ufe0e\\ufe0f]?"+Ce+"(?:\\u200d(?:"+[_e,he,Ae].join("|")+")[\\ufe0e\\ufe0f]?"+Ce+")*",De="(?:"+["[\\u2700-\\u27bf]",he,Ae].join("|")+")"+ye,Le="(?:"+[_e+me+"?",me,he,Ae,"[\\ud800-\\udfff]"].join("|")+")",Oe=RegExp("['’]","g"),Te=RegExp(me,"g"),Ie=RegExp(ge+"(?="+ge+")|"+Le+ye,"g"),we=RegExp([Se+"?"+fe+"+(?:['’](?:d|ll|m|re|s|t|ve))?(?="+[ve,Se,"$"].join("|")+")",be+"+(?:['’](?:D|LL|M|RE|S|T|VE))?(?="+[ve,Se+Ne,"$"].join("|")+")",Se+"?"+Ne+"+(?:['’](?:d|ll|m|re|s|t|ve))?",Se+"+(?:['’](?:D|LL|M|RE|S|T|VE))?","\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",pe,De].join("|"),"g"),Pe=RegExp("[\\u200d\\ud800-\\udfff"+de+"\\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 ]/,xe=["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"],Be=-1,Fe={};Fe[N]=Fe[b]=Fe[y]=Fe[D]=Fe[L]=Fe[O]=Fe["[object Uint8ClampedArray]"]=Fe[T]=Fe[I]=!0,Fe[o]=Fe[a]=Fe[A]=Fe[r]=Fe[S]=Fe[u]=Fe[s]=Fe[d]=Fe[v]=Fe[m]=Fe[p]=Fe[f]=Fe[E]=Fe[g]=Fe[h]=!1;var Me={};Me[o]=Me[a]=Me[A]=Me[S]=Me[r]=Me[u]=Me[N]=Me[b]=Me[y]=Me[D]=Me[L]=Me[v]=Me[m]=Me[p]=Me[f]=Me[E]=Me[g]=Me[_]=Me[O]=Me["[object Uint8ClampedArray]"]=Me[T]=Me[I]=!0,Me[s]=Me[d]=Me[h]=!1;var Ue={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},ke=parseFloat,We=parseInt,He="object"==typeof C&&C&&C.Object===Object&&C,je="object"==typeof self&&self&&self.Object===Object&&self,ze=He||je||Function("return this")(),Ve=t&&!t.nodeType&&t,Ge=Ve&&e&&!e.nodeType&&e,Ye=Ge&&Ge.exports===Ve,Ke=Ye&&He.process,qe=function(){try{return Ge&&Ge.require&&Ge.require("util").types||Ke&&Ke.binding&&Ke.binding("util")}catch(e){}}(),Xe=qe&&qe.isArrayBuffer,Je=qe&&qe.isDate,Qe=qe&&qe.isMap,Ze=qe&&qe.isRegExp,$e=qe&&qe.isSet,et=qe&&qe.isTypedArray;function tt(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function nt(e,t,n,l){for(var i=-1,o=null==e?0:e.length;++i<o;){var a=e[i];t(l,a,n(a),e)}return l}function lt(e,t){for(var n=-1,l=null==e?0:e.length;++n<l&&!1!==t(e[n],n,e););return e}function it(e,t){for(var n=null==e?0:e.length;n--&&!1!==t(e[n],n,e););return e}function ot(e,t){for(var n=-1,l=null==e?0:e.length;++n<l;)if(!t(e[n],n,e))return!1;return!0}function at(e,t){for(var n=-1,l=null==e?0:e.length,i=0,o=[];++n<l;){var a=e[n];t(a,n,e)&&(o[i++]=a)}return o}function rt(e,t){return!(null==e||!e.length)&>(e,t,0)>-1}function ut(e,t,n){for(var l=-1,i=null==e?0:e.length;++l<i;)if(n(t,e[l]))return!0;return!1}function st(e,t){for(var n=-1,l=null==e?0:e.length,i=Array(l);++n<l;)i[n]=t(e[n],n,e);return i}function dt(e,t){for(var n=-1,l=t.length,i=e.length;++n<l;)e[i+n]=t[n];return e}function ct(e,t,n,l){var i=-1,o=null==e?0:e.length;for(l&&o&&(n=e[++i]);++i<o;)n=t(n,e[i],i,e);return n}function vt(e,t,n,l){var i=null==e?0:e.length;for(l&&i&&(n=e[--i]);i--;)n=t(n,e[i],i,e);return n}function mt(e,t){for(var n=-1,l=null==e?0:e.length;++n<l;)if(t(e[n],n,e))return!0;return!1}var pt=St("length");function ft(e,t,n){var l;return n(e,function(e,n,i){if(t(e,n,i))return l=n,!1}),l}function Et(e,t,n,l){for(var i=e.length,o=n+(l?1:-1);l?o--:++o<i;)if(t(e[o],o,e))return o;return-1}function gt(e,t,n){return t==t?function(e,t,n){for(var l=n-1,i=e.length;++l<i;)if(e[l]===t)return l;return-1}(e,t,n):Et(e,ht,n)}function _t(e,t,n,l){for(var i=n-1,o=e.length;++i<o;)if(l(e[i],t))return i;return-1}function ht(e){return e!=e}function At(e,t){var n=null==e?0:e.length;return n?Ct(e,t)/n:NaN}function St(e){return function(t){return null==t?void 0:t[e]}}function Nt(e){return function(t){return null==e?void 0:e[t]}}function bt(e,t,n,l,i){return i(e,function(e,i,o){n=l?(l=!1,e):t(n,e,i,o)}),n}function Ct(e,t){for(var n,l=-1,i=e.length;++l<i;){var o=t(e[l]);void 0!==o&&(n=void 0===n?o:n+o)}return n}function yt(e,t){for(var n=-1,l=Array(e);++n<e;)l[n]=t(n);return l}function Dt(e){return e?e.slice(0,Vt(e)+1).replace(Y,""):e}function Lt(e){return function(t){return e(t)}}function Ot(e,t){return st(t,function(t){return e[t]})}function Tt(e,t){return e.has(t)}function It(e,t){for(var n=-1,l=e.length;++n<l&>(t,e[n],0)>-1;);return n}function wt(e,t){for(var n=e.length;n--&>(t,e[n],0)>-1;);return n}function Pt(e,t){for(var n=e.length,l=0;n--;)e[n]===t&&++l;return l}var Rt=Nt({"À":"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"}),xt=Nt({"&":"&","<":"<",">":">",'"':""","'":"'"});function Bt(e){return"\\"+Ue[e]}function Ft(e){return Pe.test(e)}function Mt(e){var t=-1,n=Array(e.size);return e.forEach(function(e,l){n[++t]=[l,e]}),n}function Ut(e,t){return function(n){return e(t(n))}}function kt(e,t){for(var n=-1,i=e.length,o=0,a=[];++n<i;){var r=e[n];r!==t&&r!==l||(e[n]=l,a[o++]=n)}return a}function Wt(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}function Ht(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=[e,e]}),n}function jt(e){return Ft(e)?function(e){for(var t=Ie.lastIndex=0;Ie.test(e);)++t;return t}(e):pt(e)}function zt(e){return Ft(e)?function(e){return e.match(Ie)||[]}(e):function(e){return e.split("")}(e)}function Vt(e){for(var t=e.length;t--&&K.test(e.charAt(t)););return t}var Gt=Nt({"&":"&","<":"<",">":">",""":'"',"'":"'"}),Yt=function e(t){var C=(t=null==t?ze:Yt.defaults(ze.Object(),t,Yt.pick(ze,xe))).Array,K=t.Date,de=t.Error,ce=t.Function,ve=t.Math,me=t.Object,pe=t.RegExp,fe=t.String,Ee=t.TypeError,ge=C.prototype,_e=me.prototype,he=t["__core-js_shared__"],Ae=ce.prototype.toString,Se=_e.hasOwnProperty,Ne=0,be=function(){var e=/[^.]+$/.exec(he&&he.keys&&he.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),Ce=_e.toString,ye=Ae.call(me),De=ze._,Le=pe("^"+Ae.call(Se).replace(V,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ie=Ye?t.Buffer:void 0,Pe=t.Symbol,Ue=t.Uint8Array,He=Ie?Ie.allocUnsafe:void 0,je=Ut(me.getPrototypeOf,me),Ve=me.create,Ge=_e.propertyIsEnumerable,Ke=ge.splice,qe=Pe?Pe.isConcatSpreadable:void 0,pt=Pe?Pe.iterator:void 0,Nt=Pe?Pe.toStringTag:void 0,Kt=function(){try{var e=Qi(me,"defineProperty");return e({},"",{}),e}catch(e){}}(),qt=t.clearTimeout!==ze.clearTimeout&&t.clearTimeout,Xt=K&&K.now!==ze.Date.now&&K.now,Jt=t.setTimeout!==ze.setTimeout&&t.setTimeout,Qt=ve.ceil,Zt=ve.floor,$t=me.getOwnPropertySymbols,en=Ie?Ie.isBuffer:void 0,tn=t.isFinite,nn=ge.join,ln=Ut(me.keys,me),on=ve.max,an=ve.min,rn=K.now,un=t.parseInt,sn=ve.random,dn=ge.reverse,cn=Qi(t,"DataView"),vn=Qi(t,"Map"),mn=Qi(t,"Promise"),pn=Qi(t,"Set"),fn=Qi(t,"WeakMap"),En=Qi(me,"create"),gn=fn&&new fn,_n={},hn=Lo(cn),An=Lo(vn),Sn=Lo(mn),Nn=Lo(pn),bn=Lo(fn),Cn=Pe?Pe.prototype:void 0,yn=Cn?Cn.valueOf:void 0,Dn=Cn?Cn.toString:void 0;function Ln(e){if(Va(e)&&!Ra(e)&&!(e instanceof wn)){if(e instanceof In)return e;if(Se.call(e,"__wrapped__"))return Oo(e)}return new In(e)}var On=function(){function e(){}return function(t){if(!za(t))return{};if(Ve)return Ve(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function Tn(){}function In(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=void 0}function wn(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=4294967295,this.__views__=[]}function Pn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var l=e[t];this.set(l[0],l[1])}}function Rn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var l=e[t];this.set(l[0],l[1])}}function xn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var l=e[t];this.set(l[0],l[1])}}function Bn(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new xn;++t<n;)this.add(e[t])}function Fn(e){var t=this.__data__=new Rn(e);this.size=t.size}function Mn(e,t){var n=Ra(e),l=!n&&Pa(e),i=!n&&!l&&Ma(e),o=!n&&!l&&!i&&Za(e),a=n||l||i||o,r=a?yt(e.length,fe):[],u=r.length;for(var s in e)!t&&!Se.call(e,s)||a&&("length"==s||i&&("offset"==s||"parent"==s)||o&&("buffer"==s||"byteLength"==s||"byteOffset"==s)||io(s,u))||r.push(s);return r}function Un(e){var t=e.length;return t?e[xl(0,t-1)]:void 0}function kn(e,t){return No(fi(e),qn(t,0,e.length))}function Wn(e){return No(fi(e))}function Hn(e,t,n){(void 0!==n&&!Ta(e[t],n)||void 0===n&&!(t in e))&&Yn(e,t,n)}function jn(e,t,n){var l=e[t];Se.call(e,t)&&Ta(l,n)&&(void 0!==n||t in e)||Yn(e,t,n)}function zn(e,t){for(var n=e.length;n--;)if(Ta(e[n][0],t))return n;return-1}function Vn(e,t,n,l){return $n(e,function(e,i,o){t(l,e,n(e),o)}),l}function Gn(e,t){return e&&Ei(t,Ar(t),e)}function Yn(e,t,n){"__proto__"==t&&Kt?Kt(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function Kn(e,t){for(var n=-1,l=t.length,i=C(l),o=null==e;++n<l;)i[n]=o?void 0:fr(e,t[n]);return i}function qn(e,t,n){return e==e&&(void 0!==n&&(e=e<=n?e:n),void 0!==t&&(e=e>=t?e:t)),e}function Xn(e,t,n,l,i,a){var s,h=1&t,C=2&t,w=4&t;if(n&&(s=i?n(e,l,i,a):n(e)),void 0!==s)return s;if(!za(e))return e;var P=Ra(e);if(P){if(s=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&Se.call(e,"index")&&(n.index=e.index,n.input=e.input),n}(e),!h)return fi(e,s)}else{var R=eo(e),x=R==d||R==c;if(Ma(e))return si(e,h);if(R==p||R==o||x&&!i){if(s=C||x?{}:no(e),!h)return C?function(e,t){return Ei(e,$i(e),t)}(e,function(e,t){return e&&Ei(t,Sr(t),e)}(s,e)):function(e,t){return Ei(e,Zi(e),t)}(e,Gn(s,e))}else{if(!Me[R])return i?e:{};s=function(e,t,n){var l=e.constructor;switch(t){case A:return di(e);case r:case u:return new l(+e);case S:return function(e,t){var n=t?di(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,n);case N:case b:case y:case D:case L:case O:case"[object Uint8ClampedArray]":case T:case I:return ci(e,n);case v:return new l;case m:case g:return new l(e);case f:return function(e){var t=new e.constructor(e.source,te.exec(e));return t.lastIndex=e.lastIndex,t}(e);case E:return new l;case _:return yn?me(yn.call(e)):{}}}(e,R,h)}}a||(a=new Fn);var B=a.get(e);if(B)return B;a.set(e,s),Xa(e)?e.forEach(function(l){s.add(Xn(l,t,n,l,e,a))}):Ga(e)&&e.forEach(function(l,i){s.set(i,Xn(l,t,n,i,e,a))});var F=P?void 0:(w?C?Vi:zi:C?Sr:Ar)(e);return lt(F||e,function(l,i){F&&(l=e[i=l]),jn(s,i,Xn(l,t,n,i,e,a))}),s}function Jn(e,t,n){var l=n.length;if(null==e)return!l;for(e=me(e);l--;){var i=n[l],o=e[i];if(void 0===o&&!(i in e)||!(0,t[i])(o))return!1}return!0}function Qn(e,t,l){if("function"!=typeof e)throw new Ee(n);return _o(function(){e.apply(void 0,l)},t)}function Zn(e,t,n,l){var i=-1,o=rt,a=!0,r=e.length,u=[],s=t.length;if(!r)return u;n&&(t=st(t,Lt(n))),l?(o=ut,a=!1):t.length>=200&&(o=Tt,a=!1,t=new Bn(t));e:for(;++i<r;){var d=e[i],c=null==n?d:n(d);if(d=l||0!==d?d:0,a&&c==c){for(var v=s;v--;)if(t[v]===c)continue e;u.push(d)}else o(t,c,l)||u.push(d)}return u}Ln.templateSettings={escape:U,evaluate:k,interpolate:W,variable:"",imports:{_:Ln}},(Ln.prototype=Tn.prototype).constructor=Ln,(In.prototype=On(Tn.prototype)).constructor=In,(wn.prototype=On(Tn.prototype)).constructor=wn,Pn.prototype.clear=function(){this.__data__=En?En(null):{},this.size=0},Pn.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Pn.prototype.get=function(e){var t=this.__data__;if(En){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return Se.call(t,e)?t[e]:void 0},Pn.prototype.has=function(e){var t=this.__data__;return En?void 0!==t[e]:Se.call(t,e)},Pn.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=En&&void 0===t?"__lodash_hash_undefined__":t,this},Rn.prototype.clear=function(){this.__data__=[],this.size=0},Rn.prototype.delete=function(e){var t=this.__data__,n=zn(t,e);return!(n<0||(n==t.length-1?t.pop():Ke.call(t,n,1),--this.size,0))},Rn.prototype.get=function(e){var t=this.__data__,n=zn(t,e);return n<0?void 0:t[n][1]},Rn.prototype.has=function(e){return zn(this.__data__,e)>-1},Rn.prototype.set=function(e,t){var n=this.__data__,l=zn(n,e);return l<0?(++this.size,n.push([e,t])):n[l][1]=t,this},xn.prototype.clear=function(){this.size=0,this.__data__={hash:new Pn,map:new(vn||Rn),string:new Pn}},xn.prototype.delete=function(e){var t=Xi(this,e).delete(e);return this.size-=t?1:0,t},xn.prototype.get=function(e){return Xi(this,e).get(e)},xn.prototype.has=function(e){return Xi(this,e).has(e)},xn.prototype.set=function(e,t){var n=Xi(this,e),l=n.size;return n.set(e,t),this.size+=n.size==l?0:1,this},Bn.prototype.add=Bn.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},Bn.prototype.has=function(e){return this.__data__.has(e)},Fn.prototype.clear=function(){this.__data__=new Rn,this.size=0},Fn.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},Fn.prototype.get=function(e){return this.__data__.get(e)},Fn.prototype.has=function(e){return this.__data__.has(e)},Fn.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Rn){var l=n.__data__;if(!vn||l.length<199)return l.push([e,t]),this.size=++n.size,this;n=this.__data__=new xn(l)}return n.set(e,t),this.size=n.size,this};var $n=hi(rl),el=hi(ul,!0);function tl(e,t){var n=!0;return $n(e,function(e,l,i){return n=!!t(e,l,i)}),n}function nl(e,t,n){for(var l=-1,i=e.length;++l<i;){var o=e[l],a=t(o);if(null!=a&&(void 0===r?a==a&&!Qa(a):n(a,r)))var r=a,u=o}return u}function ll(e,t){var n=[];return $n(e,function(e,l,i){t(e,l,i)&&n.push(e)}),n}function il(e,t,n,l,i){var o=-1,a=e.length;for(n||(n=lo),i||(i=[]);++o<a;){var r=e[o];t>0&&n(r)?t>1?il(r,t-1,n,l,i):dt(i,r):l||(i[i.length]=r)}return i}var ol=Ai(),al=Ai(!0);function rl(e,t){return e&&ol(e,t,Ar)}function ul(e,t){return e&&al(e,t,Ar)}function sl(e,t){return at(t,function(t){return Wa(e[t])})}function dl(e,t){for(var n=0,l=(t=oi(t,e)).length;null!=e&&n<l;)e=e[Do(t[n++])];return n&&n==l?e:void 0}function cl(e,t,n){var l=t(e);return Ra(e)?l:dt(l,n(e))}function vl(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Nt&&Nt in me(e)?function(e){var t=Se.call(e,Nt),n=e[Nt];try{e[Nt]=void 0;var l=!0}catch(e){}var i=Ce.call(e);return l&&(t?e[Nt]=n:delete e[Nt]),i}(e):function(e){return Ce.call(e)}(e)}function ml(e,t){return e>t}function pl(e,t){return null!=e&&Se.call(e,t)}function fl(e,t){return null!=e&&t in me(e)}function El(e,t,n){for(var l=n?ut:rt,i=e[0].length,o=e.length,a=o,r=C(o),u=Infinity,s=[];a--;){var d=e[a];a&&t&&(d=st(d,Lt(t))),u=an(d.length,u),r[a]=!n&&(t||i>=120&&d.length>=120)?new Bn(a&&d):void 0}d=e[0];var c=-1,v=r[0];e:for(;++c<i&&s.length<u;){var m=d[c],p=t?t(m):m;if(m=n||0!==m?m:0,!(v?Tt(v,p):l(s,p,n))){for(a=o;--a;){var f=r[a];if(!(f?Tt(f,p):l(e[a],p,n)))continue e}v&&v.push(p),s.push(m)}}return s}function gl(e,t,n){var l=null==(e=po(e,t=oi(t,e)))?e:e[Do(ko(t))];return null==l?void 0:tt(l,e,n)}function _l(e){return Va(e)&&vl(e)==o}function hl(e,t,n,l,i){return e===t||(null==e||null==t||!Va(e)&&!Va(t)?e!=e&&t!=t:function(e,t,n,l,i,d){var c=Ra(e),h=Ra(t),N=c?a:eo(e),b=h?a:eo(t),C=(N=N==o?p:N)==p,y=(b=b==o?p:b)==p,D=N==b;if(D&&Ma(e)){if(!Ma(t))return!1;c=!0,C=!1}if(D&&!C)return d||(d=new Fn),c||Za(e)?Hi(e,t,n,l,i,d):function(e,t,n,l,i,o,a){switch(n){case S:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case A:return!(e.byteLength!=t.byteLength||!o(new Ue(e),new Ue(t)));case r:case u:case m:return Ta(+e,+t);case s:return e.name==t.name&&e.message==t.message;case f:case g:return e==t+"";case v:var d=Mt;case E:if(d||(d=Wt),e.size!=t.size&&!(1&l))return!1;var c=a.get(e);if(c)return c==t;l|=2,a.set(e,t);var p=Hi(d(e),d(t),l,i,o,a);return a.delete(e),p;case _:if(yn)return yn.call(e)==yn.call(t)}return!1}(e,t,N,n,l,i,d);if(!(1&n)){var L=C&&Se.call(e,"__wrapped__"),O=y&&Se.call(t,"__wrapped__");if(L||O){var T=L?e.value():e,I=O?t.value():t;return d||(d=new Fn),i(T,I,n,l,d)}}return!!D&&(d||(d=new Fn),function(e,t,n,l,i,o){var a=1&n,r=zi(e),u=r.length;if(u!=zi(t).length&&!a)return!1;for(var s=u;s--;){var d=r[s];if(!(a?d in t:Se.call(t,d)))return!1}var c=o.get(e),v=o.get(t);if(c&&v)return c==t&&v==e;var m=!0;o.set(e,t),o.set(t,e);for(var p=a;++s<u;){var f=e[d=r[s]],E=t[d];if(l)var g=a?l(E,f,d,t,e,o):l(f,E,d,e,t,o);if(!(void 0===g?f===E||i(f,E,n,l,o):g)){m=!1;break}p||(p="constructor"==d)}if(m&&!p){var _=e.constructor,h=t.constructor;_==h||!("constructor"in e)||!("constructor"in t)||"function"==typeof _&&_ instanceof _&&"function"==typeof h&&h instanceof h||(m=!1)}return o.delete(e),o.delete(t),m}(e,t,n,l,i,d))}(e,t,n,l,hl,i))}function Al(e,t,n,l){var i=n.length,o=i,a=!l;if(null==e)return!o;for(e=me(e);i--;){var r=n[i];if(a&&r[2]?r[1]!==e[r[0]]:!(r[0]in e))return!1}for(;++i<o;){var u=(r=n[i])[0],s=e[u],d=r[1];if(a&&r[2]){if(void 0===s&&!(u in e))return!1}else{var c=new Fn;if(l)var v=l(s,d,u,e,t,c);if(!(void 0===v?hl(d,s,3,l,c):v))return!1}}return!0}function Sl(e){return!(!za(e)||(t=e,be&&be in t))&&(Wa(e)?Le:ie).test(Lo(e));var t}function Nl(e){return"function"==typeof e?e:null==e?Yr:"object"==typeof e?Ra(e)?Ll(e[0],e[1]):Dl(e):tu(e)}function bl(e){if(!so(e))return ln(e);var t=[];for(var n in me(e))Se.call(e,n)&&"constructor"!=n&&t.push(n);return t}function Cl(e,t){return e<t}function yl(e,t){var n=-1,l=Ba(e)?C(e.length):[];return $n(e,function(e,i,o){l[++n]=t(e,i,o)}),l}function Dl(e){var t=Ji(e);return 1==t.length&&t[0][2]?vo(t[0][0],t[0][1]):function(n){return n===e||Al(n,e,t)}}function Ll(e,t){return ao(e)&&co(t)?vo(Do(e),t):function(n){var l=fr(n,e);return void 0===l&&l===t?Er(n,e):hl(t,l,3)}}function Ol(e,t,n,l,i){e!==t&&ol(t,function(o,a){if(i||(i=new Fn),za(o))!function(e,t,n,l,i,o,a){var r=Eo(e,n),u=Eo(t,n),s=a.get(u);if(s)Hn(e,n,s);else{var d=o?o(r,u,n+"",e,t,a):void 0,c=void 0===d;if(c){var v=Ra(u),m=!v&&Ma(u),p=!v&&!m&&Za(u);d=u,v||m||p?Ra(r)?d=r:Fa(r)?d=fi(r):m?(c=!1,d=si(u,!0)):p?(c=!1,d=ci(u,!0)):d=[]:Ka(u)||Pa(u)?(d=r,Pa(r)?d=ar(r):za(r)&&!Wa(r)||(d=no(u))):c=!1}c&&(a.set(u,d),i(d,u,l,o,a),a.delete(u)),Hn(e,n,d)}}(e,t,a,n,Ol,l,i);else{var r=l?l(Eo(e,a),o,a+"",e,t,i):void 0;void 0===r&&(r=o),Hn(e,a,r)}},Sr)}function Tl(e,t){var n=e.length;if(n)return io(t+=t<0?n:0,n)?e[t]:void 0}function Il(e,t,n){t=t.length?st(t,function(e){return Ra(e)?function(t){return dl(t,1===e.length?e[0]:e)}:e}):[Yr];var l=-1;return t=st(t,Lt(qi())),function(e,t){var l=e.length;for(e.sort(function(e,t){return function(e,t,n){for(var l=-1,i=e.criteria,o=t.criteria,a=i.length,r=n.length;++l<a;){var u=vi(i[l],o[l]);if(u)return l>=r?u:u*("desc"==n[l]?-1:1)}return e.index-t.index}(e,t,n)});l--;)e[l]=e[l].value;return e}(yl(e,function(e,n,i){return{criteria:st(t,function(t){return t(e)}),index:++l,value:e}}))}function wl(e,t,n){for(var l=-1,i=t.length,o={};++l<i;){var a=t[l],r=dl(e,a);n(r,a)&&kl(o,oi(a,e),r)}return o}function Pl(e,t,n,l){var i=l?_t:gt,o=-1,a=t.length,r=e;for(e===t&&(t=fi(t)),n&&(r=st(e,Lt(n)));++o<a;)for(var u=0,s=t[o],d=n?n(s):s;(u=i(r,d,u,l))>-1;)r!==e&&Ke.call(r,u,1),Ke.call(e,u,1);return e}function Rl(e,t){for(var n=e?t.length:0,l=n-1;n--;){var i=t[n];if(n==l||i!==o){var o=i;io(i)?Ke.call(e,i,1):Ql(e,i)}}return e}function xl(e,t){return e+Zt(sn()*(t-e+1))}function Bl(e,t){var n="";if(!e||t<1||t>9007199254740991)return n;do{t%2&&(n+=e),(t=Zt(t/2))&&(e+=e)}while(t);return n}function Fl(e,t){return ho(mo(e,t,Yr),e+"")}function Ml(e){return Un(Tr(e))}function Ul(e,t){var n=Tr(e);return No(n,qn(t,0,n.length))}function kl(e,t,n,l){if(!za(e))return e;for(var i=-1,o=(t=oi(t,e)).length,a=o-1,r=e;null!=r&&++i<o;){var u=Do(t[i]),s=n;if("__proto__"===u||"constructor"===u||"prototype"===u)return e;if(i!=a){var d=r[u];void 0===(s=l?l(d,u,r):void 0)&&(s=za(d)?d:io(t[i+1])?[]:{})}jn(r,u,s),r=r[u]}return e}var Wl=gn?function(e,t){return gn.set(e,t),e}:Yr,Hl=Kt?function(e,t){return Kt(e,"toString",{configurable:!0,enumerable:!1,value:zr(t),writable:!0})}:Yr;function jl(e){return No(Tr(e))}function zl(e,t,n){var l=-1,i=e.length;t<0&&(t=-t>i?0:i+t),(n=n>i?i:n)<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var o=C(i);++l<i;)o[l]=e[l+t];return o}function Vl(e,t){var n;return $n(e,function(e,l,i){return!(n=t(e,l,i))}),!!n}function Gl(e,t,n){var l=0,i=null==e?l:e.length;if("number"==typeof t&&t==t&&i<=2147483647){for(;l<i;){var o=l+i>>>1,a=e[o];null!==a&&!Qa(a)&&(n?a<=t:a<t)?l=o+1:i=o}return i}return Yl(e,t,Yr,n)}function Yl(e,t,n,l){var i=0,o=null==e?0:e.length;if(0===o)return 0;for(var a=(t=n(t))!=t,r=null===t,u=Qa(t),s=void 0===t;i<o;){var d=Zt((i+o)/2),c=n(e[d]),v=void 0!==c,m=null===c,p=c==c,f=Qa(c);if(a)var E=l||p;else E=s?p&&(l||v):r?p&&v&&(l||!m):u?p&&v&&!m&&(l||!f):!m&&!f&&(l?c<=t:c<t);E?i=d+1:o=d}return an(o,4294967294)}function Kl(e,t){for(var n=-1,l=e.length,i=0,o=[];++n<l;){var a=e[n],r=t?t(a):a;if(!n||!Ta(r,u)){var u=r;o[i++]=0===a?0:a}}return o}function ql(e){return"number"==typeof e?e:Qa(e)?NaN:+e}function Xl(e){if("string"==typeof e)return e;if(Ra(e))return st(e,Xl)+"";if(Qa(e))return Dn?Dn.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Jl(e,t,n){var l=-1,i=rt,o=e.length,a=!0,r=[],u=r;if(n)a=!1,i=ut;else if(o>=200){var s=t?null:Bi(e);if(s)return Wt(s);a=!1,i=Tt,u=new Bn}else u=t?[]:r;e:for(;++l<o;){var d=e[l],c=t?t(d):d;if(d=n||0!==d?d:0,a&&c==c){for(var v=u.length;v--;)if(u[v]===c)continue e;t&&u.push(c),r.push(d)}else i(u,c,n)||(u!==r&&u.push(c),r.push(d))}return r}function Ql(e,t){return null==(e=po(e,t=oi(t,e)))||delete e[Do(ko(t))]}function Zl(e,t,n,l){return kl(e,t,n(dl(e,t)),l)}function $l(e,t,n,l){for(var i=e.length,o=l?i:-1;(l?o--:++o<i)&&t(e[o],o,e););return n?zl(e,l?0:o,l?o+1:i):zl(e,l?o+1:0,l?i:o)}function ei(e,t){var n=e;return n instanceof wn&&(n=n.value()),ct(t,function(e,t){return t.func.apply(t.thisArg,dt([e],t.args))},n)}function ti(e,t,n){var l=e.length;if(l<2)return l?Jl(e[0]):[];for(var i=-1,o=C(l);++i<l;)for(var a=e[i],r=-1;++r<l;)r!=i&&(o[i]=Zn(o[i]||a,e[r],t,n));return Jl(il(o,1),t,n)}function ni(e,t,n){for(var l=-1,i=e.length,o=t.length,a={};++l<i;)n(a,e[l],l<o?t[l]:void 0);return a}function li(e){return Fa(e)?e:[]}function ii(e){return"function"==typeof e?e:Yr}function oi(e,t){return Ra(e)?e:ao(e,t)?[e]:yo(rr(e))}var ai=Fl;function ri(e,t,n){var l=e.length;return n=void 0===n?l:n,!t&&n>=l?e:zl(e,t,n)}var ui=qt||function(e){return ze.clearTimeout(e)};function si(e,t){if(t)return e.slice();var n=e.length,l=He?He(n):new e.constructor(n);return e.copy(l),l}function di(e){var t=new e.constructor(e.byteLength);return new Ue(t).set(new Ue(e)),t}function ci(e,t){var n=t?di(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function vi(e,t){if(e!==t){var n=void 0!==e,l=null===e,i=e==e,o=Qa(e),a=void 0!==t,r=null===t,u=t==t,s=Qa(t);if(!r&&!s&&!o&&e>t||o&&a&&u&&!r&&!s||l&&a&&u||!n&&u||!i)return 1;if(!l&&!o&&!s&&e<t||s&&n&&i&&!l&&!o||r&&n&&i||!a&&i||!u)return-1}return 0}function mi(e,t,n,l){for(var i=-1,o=e.length,a=n.length,r=-1,u=t.length,s=on(o-a,0),d=C(u+s),c=!l;++r<u;)d[r]=t[r];for(;++i<a;)(c||i<o)&&(d[n[i]]=e[i]);for(;s--;)d[r++]=e[i++];return d}function pi(e,t,n,l){for(var i=-1,o=e.length,a=-1,r=n.length,u=-1,s=t.length,d=on(o-r,0),c=C(d+s),v=!l;++i<d;)c[i]=e[i];for(var m=i;++u<s;)c[m+u]=t[u];for(;++a<r;)(v||i<o)&&(c[m+n[a]]=e[i++]);return c}function fi(e,t){var n=-1,l=e.length;for(t||(t=C(l));++n<l;)t[n]=e[n];return t}function Ei(e,t,n,l){var i=!n;n||(n={});for(var o=-1,a=t.length;++o<a;){var r=t[o],u=l?l(n[r],e[r],r,n,e):void 0;void 0===u&&(u=e[r]),i?Yn(n,r,u):jn(n,r,u)}return n}function gi(e,t){return function(n,l){var i=Ra(n)?nt:Vn,o=t?t():{};return i(n,e,qi(l,2),o)}}function _i(e){return Fl(function(t,n){var l=-1,i=n.length,o=i>1?n[i-1]:void 0,a=i>2?n[2]:void 0;for(o=e.length>3&&"function"==typeof o?(i--,o):void 0,a&&oo(n[0],n[1],a)&&(o=i<3?void 0:o,i=1),t=me(t);++l<i;){var r=n[l];r&&e(t,r,l,o)}return t})}function hi(e,t){return function(n,l){if(null==n)return n;if(!Ba(n))return e(n,l);for(var i=n.length,o=t?i:-1,a=me(n);(t?o--:++o<i)&&!1!==l(a[o],o,a););return n}}function Ai(e){return function(t,n,l){for(var i=-1,o=me(t),a=l(t),r=a.length;r--;){var u=a[e?r:++i];if(!1===n(o[u],u,o))break}return t}}function Si(e){return function(t){var n=Ft(t=rr(t))?zt(t):void 0,l=n?n[0]:t.charAt(0),i=n?ri(n,1).join(""):t.slice(1);return l[e]()+i}}function Ni(e){return function(t){return ct(Wr(Pr(t).replace(Oe,"")),e,"")}}function bi(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var n=On(e.prototype),l=e.apply(n,t);return za(l)?l:n}}function Ci(e){return function(t,n,l){var i=me(t);if(!Ba(t)){var o=qi(n,3);t=Ar(t),n=function(e){return o(i[e],e,i)}}var a=e(t,n,l);return a>-1?i[o?t[a]:a]:void 0}}function yi(e){return ji(function(t){var l=t.length,i=l,o=In.prototype.thru;for(e&&t.reverse();i--;){var a=t[i];if("function"!=typeof a)throw new Ee(n);if(o&&!r&&"wrapper"==Yi(a))var r=new In([],!0)}for(i=r?i:l;++i<l;){var u=Yi(a=t[i]),s="wrapper"==u?Gi(a):void 0;r=s&&ro(s[0])&&424==s[1]&&!s[4].length&&1==s[9]?r[Yi(s[0])].apply(r,s[3]):1==a.length&&ro(a)?r[u]():r.thru(a)}return function(){var e=arguments,n=e[0];if(r&&1==e.length&&Ra(n))return r.plant(n).value();for(var i=0,o=l?t[i].apply(this,e):n;++i<l;)o=t[i].call(this,o);return o}})}function Di(e,t,n,l,i,o,a,r,u,s){var d=128&t,c=1&t,v=2&t,m=24&t,p=512&t,f=v?void 0:bi(e);return function E(){for(var g=arguments.length,_=C(g),h=g;h--;)_[h]=arguments[h];if(m)var A=Ki(E),S=Pt(_,A);if(l&&(_=mi(_,l,i,m)),o&&(_=pi(_,o,a,m)),g-=S,m&&g<s){var N=kt(_,A);return Ri(e,t,Di,E.placeholder,n,_,N,r,u,s-g)}var b=c?n:this,y=v?b[e]:e;return g=_.length,r?_=fo(_,r):p&&g>1&&_.reverse(),d&&u<g&&(_.length=u),this&&this!==ze&&this instanceof E&&(y=f||bi(y)),y.apply(b,_)}}function Li(e,t){return function(n,l){return function(e,t,n,l){return rl(e,function(e,i,o){t(l,n(e),i,o)}),l}(n,e,t(l),{})}}function Oi(e,t){return function(n,l){var i;if(void 0===n&&void 0===l)return t;if(void 0!==n&&(i=n),void 0!==l){if(void 0===i)return l;"string"==typeof n||"string"==typeof l?(n=Xl(n),l=Xl(l)):(n=ql(n),l=ql(l)),i=e(n,l)}return i}}function Ti(e){return ji(function(t){return t=st(t,Lt(qi())),Fl(function(n){var l=this;return e(t,function(e){return tt(e,l,n)})})})}function Ii(e,t){var n=(t=void 0===t?" ":Xl(t)).length;if(n<2)return n?Bl(t,e):t;var l=Bl(t,Qt(e/jt(t)));return Ft(t)?ri(zt(l),0,e).join(""):l.slice(0,e)}function wi(e){return function(t,n,l){return l&&"number"!=typeof l&&oo(t,n,l)&&(n=l=void 0),t=nr(t),void 0===n?(n=t,t=0):n=nr(n),function(e,t,n,l){for(var i=-1,o=on(Qt((t-e)/(n||1)),0),a=C(o);o--;)a[l?o:++i]=e,e+=n;return a}(t,n,l=void 0===l?t<n?1:-1:nr(l),e)}}function Pi(e){return function(t,n){return"string"==typeof t&&"string"==typeof n||(t=or(t),n=or(n)),e(t,n)}}function Ri(e,t,n,l,i,o,a,r,u,s){var d=8&t;t|=d?32:64,4&(t&=~(d?64:32))||(t&=-4);var c=[e,t,i,d?o:void 0,d?a:void 0,d?void 0:o,d?void 0:a,r,u,s],v=n.apply(void 0,c);return ro(e)&&go(v,c),v.placeholder=l,Ao(v,e,t)}function xi(e){var t=ve[e];return function(e,n){if(e=or(e),(n=null==n?0:an(lr(n),292))&&tn(e)){var l=(rr(e)+"e").split("e");return+((l=(rr(t(l[0]+"e"+(+l[1]+n)))+"e").split("e"))[0]+"e"+(+l[1]-n))}return t(e)}}var Bi=pn&&1/Wt(new pn([,-0]))[1]==1/0?function(e){return new pn(e)}:Qr;function Fi(e){return function(t){var n=eo(t);return n==v?Mt(t):n==E?Ht(t):function(e,t){return st(t,function(t){return[t,e[t]]})}(t,e(t))}}function Mi(e,t,i,o,a,r,u,s){var d=2&t;if(!d&&"function"!=typeof e)throw new Ee(n);var c=o?o.length:0;if(c||(t&=-97,o=a=void 0),u=void 0===u?u:on(lr(u),0),s=void 0===s?s:lr(s),c-=a?a.length:0,64&t){var v=o,m=a;o=a=void 0}var p=d?void 0:Gi(e),f=[e,t,i,o,a,v,m,r,u,s];if(p&&function(e,t){var n=e[1],i=t[1],o=n|i;if(!(o<131||128==i&&8==n||128==i&&256==n&&e[7].length<=t[8]||384==i&&t[7].length<=t[8]&&8==n))return e;1&i&&(e[2]=t[2],o|=1&n?0:4);var a=t[3];if(a){var r=e[3];e[3]=r?mi(r,a,t[4]):a,e[4]=r?kt(e[3],l):t[4]}(a=t[5])&&(e[5]=(r=e[5])?pi(r,a,t[6]):a,e[6]=r?kt(e[5],l):t[6]),(a=t[7])&&(e[7]=a),128&i&&(e[8]=null==e[8]?t[8]:an(e[8],t[8])),null==e[9]&&(e[9]=t[9]),e[0]=t[0],e[1]=o}(f,p),e=f[0],t=f[1],i=f[2],o=f[3],a=f[4],!(s=f[9]=void 0===f[9]?d?0:e.length:on(f[9]-c,0))&&24&t&&(t&=-25),t&&1!=t)E=8==t||16==t?function(e,t,n){var l=bi(e);return function i(){for(var o=arguments.length,a=C(o),r=o,u=Ki(i);r--;)a[r]=arguments[r];var s=o<3&&a[0]!==u&&a[o-1]!==u?[]:kt(a,u);if((o-=s.length)<n)return Ri(e,t,Di,i.placeholder,void 0,a,s,void 0,void 0,n-o);var d=this&&this!==ze&&this instanceof i?l:e;return tt(d,this,a)}}(e,t,s):32!=t&&33!=t||a.length?Di.apply(void 0,f):function(e,t,n,l){var i=1&t,o=bi(e);return function t(){for(var a=-1,r=arguments.length,u=-1,s=l.length,d=C(s+r),c=this&&this!==ze&&this instanceof t?o:e;++u<s;)d[u]=l[u];for(;r--;)d[u++]=arguments[++a];return tt(c,i?n:this,d)}}(e,t,i,o);else var E=function(e,t,n){var l=1&t,i=bi(e);return function t(){var o=this&&this!==ze&&this instanceof t?i:e;return o.apply(l?n:this,arguments)}}(e,t,i);return Ao((p?Wl:go)(E,f),e,t)}function Ui(e,t,n,l){return void 0===e||Ta(e,_e[n])&&!Se.call(l,n)?t:e}function ki(e,t,n,l,i,o){return za(e)&&za(t)&&(o.set(t,e),Ol(e,t,void 0,ki,o),o.delete(t)),e}function Wi(e){return Ka(e)?void 0:e}function Hi(e,t,n,l,i,o){var a=1&n,r=e.length,u=t.length;if(r!=u&&!(a&&u>r))return!1;var s=o.get(e),d=o.get(t);if(s&&d)return s==t&&d==e;var c=-1,v=!0,m=2&n?new Bn:void 0;for(o.set(e,t),o.set(t,e);++c<r;){var p=e[c],f=t[c];if(l)var E=a?l(f,p,c,t,e,o):l(p,f,c,e,t,o);if(void 0!==E){if(E)continue;v=!1;break}if(m){if(!mt(t,function(e,t){if(!Tt(m,t)&&(p===e||i(p,e,n,l,o)))return m.push(t)})){v=!1;break}}else if(p!==f&&!i(p,f,n,l,o)){v=!1;break}}return o.delete(e),o.delete(t),v}function ji(e){return ho(mo(e,void 0,xo),e+"")}function zi(e){return cl(e,Ar,Zi)}function Vi(e){return cl(e,Sr,$i)}var Gi=gn?function(e){return gn.get(e)}:Qr;function Yi(e){for(var t=e.name+"",n=_n[t],l=Se.call(_n,t)?n.length:0;l--;){var i=n[l],o=i.func;if(null==o||o==e)return i.name}return t}function Ki(e){return(Se.call(Ln,"placeholder")?Ln:e).placeholder}function qi(){var e=Ln.iteratee||Kr;return e=e===Kr?Nl:e,arguments.length?e(arguments[0],arguments[1]):e}function Xi(e,t){var n=e.__data__;return function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}(t)?n["string"==typeof t?"string":"hash"]:n.map}function Ji(e){for(var t=Ar(e),n=t.length;n--;){var l=t[n],i=e[l];t[n]=[l,i,co(i)]}return t}function Qi(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return Sl(n)?n:void 0}var Zi=$t?function(e){return null==e?[]:(e=me(e),at($t(e),function(t){return Ge.call(e,t)}))}:iu,$i=$t?function(e){for(var t=[];e;)dt(t,Zi(e)),e=je(e);return t}:iu,eo=vl;function to(e,t,n){for(var l=-1,i=(t=oi(t,e)).length,o=!1;++l<i;){var a=Do(t[l]);if(!(o=null!=e&&n(e,a)))break;e=e[a]}return o||++l!=i?o:!!(i=null==e?0:e.length)&&ja(i)&&io(a,i)&&(Ra(e)||Pa(e))}function no(e){return"function"!=typeof e.constructor||so(e)?{}:On(je(e))}function lo(e){return Ra(e)||Pa(e)||!!(qe&&e&&e[qe])}function io(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&ae.test(e))&&e>-1&&e%1==0&&e<t}function oo(e,t,n){if(!za(n))return!1;var l=typeof t;return!!("number"==l?Ba(n)&&io(t,n.length):"string"==l&&t in n)&&Ta(n[t],e)}function ao(e,t){if(Ra(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!Qa(e))||j.test(e)||!H.test(e)||null!=t&&e in me(t)}function ro(e){var t=Yi(e),n=Ln[t];if("function"!=typeof n||!(t in wn.prototype))return!1;if(e===n)return!0;var l=Gi(n);return!!l&&e===l[0]}(cn&&eo(new cn(new ArrayBuffer(1)))!=S||vn&&eo(new vn)!=v||mn&&"[object Promise]"!=eo(mn.resolve())||pn&&eo(new pn)!=E||fn&&eo(new fn)!=h)&&(eo=function(e){var t=vl(e),n=t==p?e.constructor:void 0,l=n?Lo(n):"";if(l)switch(l){case hn:return S;case An:return v;case Sn:return"[object Promise]";case Nn:return E;case bn:return h}return t});var uo=he?Wa:ou;function so(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||_e)}function co(e){return e==e&&!za(e)}function vo(e,t){return function(n){return null!=n&&n[e]===t&&(void 0!==t||e in me(n))}}function mo(e,t,n){return t=on(void 0===t?e.length-1:t,0),function(){for(var l=arguments,i=-1,o=on(l.length-t,0),a=C(o);++i<o;)a[i]=l[t+i];i=-1;for(var r=C(t+1);++i<t;)r[i]=l[i];return r[t]=n(a),tt(e,this,r)}}function po(e,t){return t.length<2?e:dl(e,zl(t,0,-1))}function fo(e,t){for(var n=e.length,l=an(t.length,n),i=fi(e);l--;){var o=t[l];e[l]=io(o,n)?i[o]:void 0}return e}function Eo(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var go=So(Wl),_o=Jt||function(e,t){return ze.setTimeout(e,t)},ho=So(Hl);function Ao(e,t,n){var l=t+"";return ho(e,function(e,t){var n=t.length;if(!n)return e;var l=n-1;return t[l]=(n>1?"& ":"")+t[l],t=t.join(n>2?", ":" "),e.replace(q,"{\n/* [wrapped with "+t+"] */\n")}(l,function(e,t){return lt(i,function(n){var l="_."+n[0];t&n[1]&&!rt(e,l)&&e.push(l)}),e.sort()}(function(e){var t=e.match(X);return t?t[1].split(J):[]}(l),n)))}function So(e){var t=0,n=0;return function(){var l=rn(),i=16-(l-n);if(n=l,i>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function No(e,t){var n=-1,l=e.length,i=l-1;for(t=void 0===t?l:t;++n<t;){var o=xl(n,i),a=e[o];e[o]=e[n],e[n]=a}return e.length=t,e}var bo,Co,yo=(bo=ba(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(z,function(e,n,l,i){t.push(l?i.replace($,"$1"):n||e)}),t},function(e){return 500===Co.size&&Co.clear(),e}),Co=bo.cache,bo);function Do(e){if("string"==typeof e||Qa(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Lo(e){if(null!=e){try{return Ae.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function Oo(e){if(e instanceof wn)return e.clone();var t=new In(e.__wrapped__,e.__chain__);return t.__actions__=fi(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var To=Fl(function(e,t){return Fa(e)?Zn(e,il(t,1,Fa,!0)):[]}),Io=Fl(function(e,t){var n=ko(t);return Fa(n)&&(n=void 0),Fa(e)?Zn(e,il(t,1,Fa,!0),qi(n,2)):[]}),wo=Fl(function(e,t){var n=ko(t);return Fa(n)&&(n=void 0),Fa(e)?Zn(e,il(t,1,Fa,!0),void 0,n):[]});function Po(e,t,n){var l=null==e?0:e.length;if(!l)return-1;var i=null==n?0:lr(n);return i<0&&(i=on(l+i,0)),Et(e,qi(t,3),i)}function Ro(e,t,n){var l=null==e?0:e.length;if(!l)return-1;var i=l-1;return void 0!==n&&(i=lr(n),i=n<0?on(l+i,0):an(i,l-1)),Et(e,qi(t,3),i,!0)}function xo(e){return null!=e&&e.length?il(e,1):[]}function Bo(e){return e&&e.length?e[0]:void 0}var Fo=Fl(function(e){var t=st(e,li);return t.length&&t[0]===e[0]?El(t):[]}),Mo=Fl(function(e){var t=ko(e),n=st(e,li);return t===ko(n)?t=void 0:n.pop(),n.length&&n[0]===e[0]?El(n,qi(t,2)):[]}),Uo=Fl(function(e){var t=ko(e),n=st(e,li);return(t="function"==typeof t?t:void 0)&&n.pop(),n.length&&n[0]===e[0]?El(n,void 0,t):[]});function ko(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}var Wo=Fl(Ho);function Ho(e,t){return e&&e.length&&t&&t.length?Pl(e,t):e}var jo=ji(function(e,t){var n=null==e?0:e.length,l=Kn(e,t);return Rl(e,st(t,function(e){return io(e,n)?+e:e}).sort(vi)),l});function zo(e){return null==e?e:dn.call(e)}var Vo=Fl(function(e){return Jl(il(e,1,Fa,!0))}),Go=Fl(function(e){var t=ko(e);return Fa(t)&&(t=void 0),Jl(il(e,1,Fa,!0),qi(t,2))}),Yo=Fl(function(e){var t=ko(e);return t="function"==typeof t?t:void 0,Jl(il(e,1,Fa,!0),void 0,t)});function Ko(e){if(!e||!e.length)return[];var t=0;return e=at(e,function(e){if(Fa(e))return t=on(e.length,t),!0}),yt(t,function(t){return st(e,St(t))})}function qo(e,t){if(!e||!e.length)return[];var n=Ko(e);return null==t?n:st(n,function(e){return tt(t,void 0,e)})}var Xo=Fl(function(e,t){return Fa(e)?Zn(e,t):[]}),Jo=Fl(function(e){return ti(at(e,Fa))}),Qo=Fl(function(e){var t=ko(e);return Fa(t)&&(t=void 0),ti(at(e,Fa),qi(t,2))}),Zo=Fl(function(e){var t=ko(e);return t="function"==typeof t?t:void 0,ti(at(e,Fa),void 0,t)}),$o=Fl(Ko),ea=Fl(function(e){var t=e.length,n=t>1?e[t-1]:void 0;return n="function"==typeof n?(e.pop(),n):void 0,qo(e,n)});function ta(e){var t=Ln(e);return t.__chain__=!0,t}function na(e,t){return t(e)}var la=ji(function(e){var t=e.length,n=t?e[0]:0,l=this.__wrapped__,i=function(t){return Kn(t,e)};return!(t>1||this.__actions__.length)&&l instanceof wn&&io(n)?((l=l.slice(n,+n+(t?1:0))).__actions__.push({func:na,args:[i],thisArg:void 0}),new In(l,this.__chain__).thru(function(e){return t&&!e.length&&e.push(void 0),e})):this.thru(i)}),ia=gi(function(e,t,n){Se.call(e,n)?++e[n]:Yn(e,n,1)}),oa=Ci(Po),aa=Ci(Ro);function ra(e,t){return(Ra(e)?lt:$n)(e,qi(t,3))}function ua(e,t){return(Ra(e)?it:el)(e,qi(t,3))}var sa=gi(function(e,t,n){Se.call(e,n)?e[n].push(t):Yn(e,n,[t])}),da=Fl(function(e,t,n){var l=-1,i="function"==typeof t,o=Ba(e)?C(e.length):[];return $n(e,function(e){o[++l]=i?tt(t,e,n):gl(e,t,n)}),o}),ca=gi(function(e,t,n){Yn(e,n,t)});function va(e,t){return(Ra(e)?st:yl)(e,qi(t,3))}var ma=gi(function(e,t,n){e[n?0:1].push(t)},function(){return[[],[]]}),pa=Fl(function(e,t){if(null==e)return[];var n=t.length;return n>1&&oo(e,t[0],t[1])?t=[]:n>2&&oo(t[0],t[1],t[2])&&(t=[t[0]]),Il(e,il(t,1),[])}),fa=Xt||function(){return ze.Date.now()};function Ea(e,t,n){return t=n?void 0:t,Mi(e,128,void 0,void 0,void 0,void 0,t=e&&null==t?e.length:t)}function ga(e,t){var l;if("function"!=typeof t)throw new Ee(n);return e=lr(e),function(){return--e>0&&(l=t.apply(this,arguments)),e<=1&&(t=void 0),l}}var _a=Fl(function(e,t,n){var l=1;if(n.length){var i=kt(n,Ki(_a));l|=32}return Mi(e,l,t,n,i)}),ha=Fl(function(e,t,n){var l=3;if(n.length){var i=kt(n,Ki(ha));l|=32}return Mi(t,l,e,n,i)});function Aa(e,t,l){var i,o,a,r,u,s,d=0,c=!1,v=!1,m=!0;if("function"!=typeof e)throw new Ee(n);function p(t){var n=i,l=o;return i=o=void 0,d=t,r=e.apply(l,n)}function f(e){return d=e,u=_o(g,t),c?p(e):r}function E(e){var n=e-s;return void 0===s||n>=t||n<0||v&&e-d>=a}function g(){var e=fa();if(E(e))return _(e);u=_o(g,function(e){var n=t-(e-s);return v?an(n,a-(e-d)):n}(e))}function _(e){return u=void 0,m&&i?p(e):(i=o=void 0,r)}function h(){var e=fa(),n=E(e);if(i=arguments,o=this,s=e,n){if(void 0===u)return f(s);if(v)return ui(u),u=_o(g,t),p(s)}return void 0===u&&(u=_o(g,t)),r}return t=or(t)||0,za(l)&&(c=!!l.leading,a=(v="maxWait"in l)?on(or(l.maxWait)||0,t):a,m="trailing"in l?!!l.trailing:m),h.cancel=function(){void 0!==u&&ui(u),d=0,i=s=o=u=void 0},h.flush=function(){return void 0===u?r:_(fa())},h}var Sa=Fl(function(e,t){return Qn(e,1,t)}),Na=Fl(function(e,t,n){return Qn(e,or(t)||0,n)});function ba(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new Ee(n);var l=function(){var n=arguments,i=t?t.apply(this,n):n[0],o=l.cache;if(o.has(i))return o.get(i);var a=e.apply(this,n);return l.cache=o.set(i,a)||o,a};return l.cache=new(ba.Cache||xn),l}function Ca(e){if("function"!=typeof e)throw new Ee(n);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}ba.Cache=xn;var ya=ai(function(e,t){var n=(t=1==t.length&&Ra(t[0])?st(t[0],Lt(qi())):st(il(t,1),Lt(qi()))).length;return Fl(function(l){for(var i=-1,o=an(l.length,n);++i<o;)l[i]=t[i].call(this,l[i]);return tt(e,this,l)})}),Da=Fl(function(e,t){return Mi(e,32,void 0,t,kt(t,Ki(Da)))}),La=Fl(function(e,t){return Mi(e,64,void 0,t,kt(t,Ki(La)))}),Oa=ji(function(e,t){return Mi(e,256,void 0,void 0,void 0,t)});function Ta(e,t){return e===t||e!=e&&t!=t}var Ia=Pi(ml),wa=Pi(function(e,t){return e>=t}),Pa=_l(function(){return arguments}())?_l:function(e){return Va(e)&&Se.call(e,"callee")&&!Ge.call(e,"callee")},Ra=C.isArray,xa=Xe?Lt(Xe):function(e){return Va(e)&&vl(e)==A};function Ba(e){return null!=e&&ja(e.length)&&!Wa(e)}function Fa(e){return Va(e)&&Ba(e)}var Ma=en||ou,Ua=Je?Lt(Je):function(e){return Va(e)&&vl(e)==u};function ka(e){if(!Va(e))return!1;var t=vl(e);return t==s||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!Ka(e)}function Wa(e){if(!za(e))return!1;var t=vl(e);return t==d||t==c||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Ha(e){return"number"==typeof e&&e==lr(e)}function ja(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}function za(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function Va(e){return null!=e&&"object"==typeof e}var Ga=Qe?Lt(Qe):function(e){return Va(e)&&eo(e)==v};function Ya(e){return"number"==typeof e||Va(e)&&vl(e)==m}function Ka(e){if(!Va(e)||vl(e)!=p)return!1;var t=je(e);if(null===t)return!0;var n=Se.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&Ae.call(n)==ye}var qa=Ze?Lt(Ze):function(e){return Va(e)&&vl(e)==f},Xa=$e?Lt($e):function(e){return Va(e)&&eo(e)==E};function Ja(e){return"string"==typeof e||!Ra(e)&&Va(e)&&vl(e)==g}function Qa(e){return"symbol"==typeof e||Va(e)&&vl(e)==_}var Za=et?Lt(et):function(e){return Va(e)&&ja(e.length)&&!!Fe[vl(e)]},$a=Pi(Cl),er=Pi(function(e,t){return e<=t});function tr(e){if(!e)return[];if(Ba(e))return Ja(e)?zt(e):fi(e);if(pt&&e[pt])return function(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}(e[pt]());var t=eo(e);return(t==v?Mt:t==E?Wt:Tr)(e)}function nr(e){return e?(e=or(e))===1/0||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function lr(e){var t=nr(e),n=t%1;return t==t?n?t-n:t:0}function ir(e){return e?qn(lr(e),0,4294967295):0}function or(e){if("number"==typeof e)return e;if(Qa(e))return NaN;if(za(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=za(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Dt(e);var n=le.test(e);return n||oe.test(e)?We(e.slice(2),n?2:8):ne.test(e)?NaN:+e}function ar(e){return Ei(e,Sr(e))}function rr(e){return null==e?"":Xl(e)}var ur=_i(function(e,t){if(so(t)||Ba(t))Ei(t,Ar(t),e);else for(var n in t)Se.call(t,n)&&jn(e,n,t[n])}),sr=_i(function(e,t){Ei(t,Sr(t),e)}),dr=_i(function(e,t,n,l){Ei(t,Sr(t),e,l)}),cr=_i(function(e,t,n,l){Ei(t,Ar(t),e,l)}),vr=ji(Kn),mr=Fl(function(e,t){e=me(e);var n=-1,l=t.length,i=l>2?t[2]:void 0;for(i&&oo(t[0],t[1],i)&&(l=1);++n<l;)for(var o=t[n],a=Sr(o),r=-1,u=a.length;++r<u;){var s=a[r],d=e[s];(void 0===d||Ta(d,_e[s])&&!Se.call(e,s))&&(e[s]=o[s])}return e}),pr=Fl(function(e){return e.push(void 0,ki),tt(br,void 0,e)});function fr(e,t,n){var l=null==e?void 0:dl(e,t);return void 0===l?n:l}function Er(e,t){return null!=e&&to(e,t,fl)}var gr=Li(function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=Ce.call(t)),e[t]=n},zr(Yr)),_r=Li(function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=Ce.call(t)),Se.call(e,t)?e[t].push(n):e[t]=[n]},qi),hr=Fl(gl);function Ar(e){return Ba(e)?Mn(e):bl(e)}function Sr(e){return Ba(e)?Mn(e,!0):function(e){if(!za(e))return function(e){var t=[];if(null!=e)for(var n in me(e))t.push(n);return t}(e);var t=so(e),n=[];for(var l in e)("constructor"!=l||!t&&Se.call(e,l))&&n.push(l);return n}(e)}var Nr=_i(function(e,t,n){Ol(e,t,n)}),br=_i(function(e,t,n,l){Ol(e,t,n,l)}),Cr=ji(function(e,t){var n={};if(null==e)return n;var l=!1;t=st(t,function(t){return t=oi(t,e),l||(l=t.length>1),t}),Ei(e,Vi(e),n),l&&(n=Xn(n,7,Wi));for(var i=t.length;i--;)Ql(n,t[i]);return n}),yr=ji(function(e,t){return null==e?{}:function(e,t){return wl(e,t,function(t,n){return Er(e,n)})}(e,t)});function Dr(e,t){if(null==e)return{};var n=st(Vi(e),function(e){return[e]});return t=qi(t),wl(e,n,function(e,n){return t(e,n[0])})}var Lr=Fi(Ar),Or=Fi(Sr);function Tr(e){return null==e?[]:Ot(e,Ar(e))}var Ir=Ni(function(e,t,n){return t=t.toLowerCase(),e+(n?wr(t):t)});function wr(e){return kr(rr(e).toLowerCase())}function Pr(e){return(e=rr(e))&&e.replace(re,Rt).replace(Te,"")}var Rr=Ni(function(e,t,n){return e+(n?"-":"")+t.toLowerCase()}),xr=Ni(function(e,t,n){return e+(n?" ":"")+t.toLowerCase()}),Br=Si("toLowerCase"),Fr=Ni(function(e,t,n){return e+(n?"_":"")+t.toLowerCase()}),Mr=Ni(function(e,t,n){return e+(n?" ":"")+kr(t)}),Ur=Ni(function(e,t,n){return e+(n?" ":"")+t.toUpperCase()}),kr=Si("toUpperCase");function Wr(e,t,n){return e=rr(e),void 0===(t=n?void 0:t)?function(e){return Re.test(e)}(e)?function(e){return e.match(we)||[]}(e):function(e){return e.match(Q)||[]}(e):e.match(t)||[]}var Hr=Fl(function(e,t){try{return tt(e,void 0,t)}catch(e){return ka(e)?e:new de(e)}}),jr=ji(function(e,t){return lt(t,function(t){t=Do(t),Yn(e,t,_a(e[t],e))}),e});function zr(e){return function(){return e}}var Vr=yi(),Gr=yi(!0);function Yr(e){return e}function Kr(e){return Nl("function"==typeof e?e:Xn(e,1))}var qr=Fl(function(e,t){return function(n){return gl(n,e,t)}}),Xr=Fl(function(e,t){return function(n){return gl(e,n,t)}});function Jr(e,t,n){var l=Ar(t),i=sl(t,l);null!=n||za(t)&&(i.length||!l.length)||(n=t,t=e,e=this,i=sl(t,Ar(t)));var o=!(za(n)&&"chain"in n&&!n.chain),a=Wa(e);return lt(i,function(n){var l=t[n];e[n]=l,a&&(e.prototype[n]=function(){var t=this.__chain__;if(o||t){var n=e(this.__wrapped__),i=n.__actions__=fi(this.__actions__);return i.push({func:l,args:arguments,thisArg:e}),n.__chain__=t,n}return l.apply(e,dt([this.value()],arguments))})}),e}function Qr(){}var Zr=Ti(st),$r=Ti(ot),eu=Ti(mt);function tu(e){return ao(e)?St(Do(e)):function(e){return function(t){return dl(t,e)}}(e)}var nu=wi(),lu=wi(!0);function iu(){return[]}function ou(){return!1}var au,ru=Oi(function(e,t){return e+t},0),uu=xi("ceil"),su=Oi(function(e,t){return e/t},1),du=xi("floor"),cu=Oi(function(e,t){return e*t},1),vu=xi("round"),mu=Oi(function(e,t){return e-t},0);return Ln.after=function(e,t){if("function"!=typeof t)throw new Ee(n);return e=lr(e),function(){if(--e<1)return t.apply(this,arguments)}},Ln.ary=Ea,Ln.assign=ur,Ln.assignIn=sr,Ln.assignInWith=dr,Ln.assignWith=cr,Ln.at=vr,Ln.before=ga,Ln.bind=_a,Ln.bindAll=jr,Ln.bindKey=ha,Ln.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return Ra(e)?e:[e]},Ln.chain=ta,Ln.chunk=function(e,t,n){t=(n?oo(e,t,n):void 0===t)?1:on(lr(t),0);var l=null==e?0:e.length;if(!l||t<1)return[];for(var i=0,o=0,a=C(Qt(l/t));i<l;)a[o++]=zl(e,i,i+=t);return a},Ln.compact=function(e){for(var t=-1,n=null==e?0:e.length,l=0,i=[];++t<n;){var o=e[t];o&&(i[l++]=o)}return i},Ln.concat=function(){var e=arguments.length;if(!e)return[];for(var t=C(e-1),n=arguments[0],l=e;l--;)t[l-1]=arguments[l];return dt(Ra(n)?fi(n):[n],il(t,1))},Ln.cond=function(e){var t=null==e?0:e.length,l=qi();return e=t?st(e,function(e){if("function"!=typeof e[1])throw new Ee(n);return[l(e[0]),e[1]]}):[],Fl(function(n){for(var l=-1;++l<t;){var i=e[l];if(tt(i[0],this,n))return tt(i[1],this,n)}})},Ln.conforms=function(e){return function(e){var t=Ar(e);return function(n){return Jn(n,e,t)}}(Xn(e,1))},Ln.constant=zr,Ln.countBy=ia,Ln.create=function(e,t){var n=On(e);return null==t?n:Gn(n,t)},Ln.curry=function e(t,n,l){var i=Mi(t,8,void 0,void 0,void 0,void 0,void 0,n=l?void 0:n);return i.placeholder=e.placeholder,i},Ln.curryRight=function e(t,n,l){var i=Mi(t,16,void 0,void 0,void 0,void 0,void 0,n=l?void 0:n);return i.placeholder=e.placeholder,i},Ln.debounce=Aa,Ln.defaults=mr,Ln.defaultsDeep=pr,Ln.defer=Sa,Ln.delay=Na,Ln.difference=To,Ln.differenceBy=Io,Ln.differenceWith=wo,Ln.drop=function(e,t,n){var l=null==e?0:e.length;return l?zl(e,(t=n||void 0===t?1:lr(t))<0?0:t,l):[]},Ln.dropRight=function(e,t,n){var l=null==e?0:e.length;return l?zl(e,0,(t=l-(t=n||void 0===t?1:lr(t)))<0?0:t):[]},Ln.dropRightWhile=function(e,t){return e&&e.length?$l(e,qi(t,3),!0,!0):[]},Ln.dropWhile=function(e,t){return e&&e.length?$l(e,qi(t,3),!0):[]},Ln.fill=function(e,t,n,l){var i=null==e?0:e.length;return i?(n&&"number"!=typeof n&&oo(e,t,n)&&(n=0,l=i),function(e,t,n,l){var i=e.length;for((n=lr(n))<0&&(n=-n>i?0:i+n),(l=void 0===l||l>i?i:lr(l))<0&&(l+=i),l=n>l?0:ir(l);n<l;)e[n++]=t;return e}(e,t,n,l)):[]},Ln.filter=function(e,t){return(Ra(e)?at:ll)(e,qi(t,3))},Ln.flatMap=function(e,t){return il(va(e,t),1)},Ln.flatMapDeep=function(e,t){return il(va(e,t),1/0)},Ln.flatMapDepth=function(e,t,n){return n=void 0===n?1:lr(n),il(va(e,t),n)},Ln.flatten=xo,Ln.flattenDeep=function(e){return null!=e&&e.length?il(e,1/0):[]},Ln.flattenDepth=function(e,t){return null!=e&&e.length?il(e,t=void 0===t?1:lr(t)):[]},Ln.flip=function(e){return Mi(e,512)},Ln.flow=Vr,Ln.flowRight=Gr,Ln.fromPairs=function(e){for(var t=-1,n=null==e?0:e.length,l={};++t<n;){var i=e[t];l[i[0]]=i[1]}return l},Ln.functions=function(e){return null==e?[]:sl(e,Ar(e))},Ln.functionsIn=function(e){return null==e?[]:sl(e,Sr(e))},Ln.groupBy=sa,Ln.initial=function(e){return null!=e&&e.length?zl(e,0,-1):[]},Ln.intersection=Fo,Ln.intersectionBy=Mo,Ln.intersectionWith=Uo,Ln.invert=gr,Ln.invertBy=_r,Ln.invokeMap=da,Ln.iteratee=Kr,Ln.keyBy=ca,Ln.keys=Ar,Ln.keysIn=Sr,Ln.map=va,Ln.mapKeys=function(e,t){var n={};return t=qi(t,3),rl(e,function(e,l,i){Yn(n,t(e,l,i),e)}),n},Ln.mapValues=function(e,t){var n={};return t=qi(t,3),rl(e,function(e,l,i){Yn(n,l,t(e,l,i))}),n},Ln.matches=function(e){return Dl(Xn(e,1))},Ln.matchesProperty=function(e,t){return Ll(e,Xn(t,1))},Ln.memoize=ba,Ln.merge=Nr,Ln.mergeWith=br,Ln.method=qr,Ln.methodOf=Xr,Ln.mixin=Jr,Ln.negate=Ca,Ln.nthArg=function(e){return e=lr(e),Fl(function(t){return Tl(t,e)})},Ln.omit=Cr,Ln.omitBy=function(e,t){return Dr(e,Ca(qi(t)))},Ln.once=function(e){return ga(2,e)},Ln.orderBy=function(e,t,n,l){return null==e?[]:(Ra(t)||(t=null==t?[]:[t]),Ra(n=l?void 0:n)||(n=null==n?[]:[n]),Il(e,t,n))},Ln.over=Zr,Ln.overArgs=ya,Ln.overEvery=$r,Ln.overSome=eu,Ln.partial=Da,Ln.partialRight=La,Ln.partition=ma,Ln.pick=yr,Ln.pickBy=Dr,Ln.property=tu,Ln.propertyOf=function(e){return function(t){return null==e?void 0:dl(e,t)}},Ln.pull=Wo,Ln.pullAll=Ho,Ln.pullAllBy=function(e,t,n){return e&&e.length&&t&&t.length?Pl(e,t,qi(n,2)):e},Ln.pullAllWith=function(e,t,n){return e&&e.length&&t&&t.length?Pl(e,t,void 0,n):e},Ln.pullAt=jo,Ln.range=nu,Ln.rangeRight=lu,Ln.rearg=Oa,Ln.reject=function(e,t){return(Ra(e)?at:ll)(e,Ca(qi(t,3)))},Ln.remove=function(e,t){var n=[];if(!e||!e.length)return n;var l=-1,i=[],o=e.length;for(t=qi(t,3);++l<o;){var a=e[l];t(a,l,e)&&(n.push(a),i.push(l))}return Rl(e,i),n},Ln.rest=function(e,t){if("function"!=typeof e)throw new Ee(n);return Fl(e,t=void 0===t?t:lr(t))},Ln.reverse=zo,Ln.sampleSize=function(e,t,n){return t=(n?oo(e,t,n):void 0===t)?1:lr(t),(Ra(e)?kn:Ul)(e,t)},Ln.set=function(e,t,n){return null==e?e:kl(e,t,n)},Ln.setWith=function(e,t,n,l){return l="function"==typeof l?l:void 0,null==e?e:kl(e,t,n,l)},Ln.shuffle=function(e){return(Ra(e)?Wn:jl)(e)},Ln.slice=function(e,t,n){var l=null==e?0:e.length;return l?(n&&"number"!=typeof n&&oo(e,t,n)?(t=0,n=l):(t=null==t?0:lr(t),n=void 0===n?l:lr(n)),zl(e,t,n)):[]},Ln.sortBy=pa,Ln.sortedUniq=function(e){return e&&e.length?Kl(e):[]},Ln.sortedUniqBy=function(e,t){return e&&e.length?Kl(e,qi(t,2)):[]},Ln.split=function(e,t,n){return n&&"number"!=typeof n&&oo(e,t,n)&&(t=n=void 0),(n=void 0===n?4294967295:n>>>0)?(e=rr(e))&&("string"==typeof t||null!=t&&!qa(t))&&!(t=Xl(t))&&Ft(e)?ri(zt(e),0,n):e.split(t,n):[]},Ln.spread=function(e,t){if("function"!=typeof e)throw new Ee(n);return t=null==t?0:on(lr(t),0),Fl(function(n){var l=n[t],i=ri(n,0,t);return l&&dt(i,l),tt(e,this,i)})},Ln.tail=function(e){var t=null==e?0:e.length;return t?zl(e,1,t):[]},Ln.take=function(e,t,n){return e&&e.length?zl(e,0,(t=n||void 0===t?1:lr(t))<0?0:t):[]},Ln.takeRight=function(e,t,n){var l=null==e?0:e.length;return l?zl(e,(t=l-(t=n||void 0===t?1:lr(t)))<0?0:t,l):[]},Ln.takeRightWhile=function(e,t){return e&&e.length?$l(e,qi(t,3),!1,!0):[]},Ln.takeWhile=function(e,t){return e&&e.length?$l(e,qi(t,3)):[]},Ln.tap=function(e,t){return t(e),e},Ln.throttle=function(e,t,l){var i=!0,o=!0;if("function"!=typeof e)throw new Ee(n);return za(l)&&(i="leading"in l?!!l.leading:i,o="trailing"in l?!!l.trailing:o),Aa(e,t,{leading:i,maxWait:t,trailing:o})},Ln.thru=na,Ln.toArray=tr,Ln.toPairs=Lr,Ln.toPairsIn=Or,Ln.toPath=function(e){return Ra(e)?st(e,Do):Qa(e)?[e]:fi(yo(rr(e)))},Ln.toPlainObject=ar,Ln.transform=function(e,t,n){var l=Ra(e),i=l||Ma(e)||Za(e);if(t=qi(t,4),null==n){var o=e&&e.constructor;n=i?l?new o:[]:za(e)&&Wa(o)?On(je(e)):{}}return(i?lt:rl)(e,function(e,l,i){return t(n,e,l,i)}),n},Ln.unary=function(e){return Ea(e,1)},Ln.union=Vo,Ln.unionBy=Go,Ln.unionWith=Yo,Ln.uniq=function(e){return e&&e.length?Jl(e):[]},Ln.uniqBy=function(e,t){return e&&e.length?Jl(e,qi(t,2)):[]},Ln.uniqWith=function(e,t){return t="function"==typeof t?t:void 0,e&&e.length?Jl(e,void 0,t):[]},Ln.unset=function(e,t){return null==e||Ql(e,t)},Ln.unzip=Ko,Ln.unzipWith=qo,Ln.update=function(e,t,n){return null==e?e:Zl(e,t,ii(n))},Ln.updateWith=function(e,t,n,l){return l="function"==typeof l?l:void 0,null==e?e:Zl(e,t,ii(n),l)},Ln.values=Tr,Ln.valuesIn=function(e){return null==e?[]:Ot(e,Sr(e))},Ln.without=Xo,Ln.words=Wr,Ln.wrap=function(e,t){return Da(ii(t),e)},Ln.xor=Jo,Ln.xorBy=Qo,Ln.xorWith=Zo,Ln.zip=$o,Ln.zipObject=function(e,t){return ni(e||[],t||[],jn)},Ln.zipObjectDeep=function(e,t){return ni(e||[],t||[],kl)},Ln.zipWith=ea,Ln.entries=Lr,Ln.entriesIn=Or,Ln.extend=sr,Ln.extendWith=dr,Jr(Ln,Ln),Ln.add=ru,Ln.attempt=Hr,Ln.camelCase=Ir,Ln.capitalize=wr,Ln.ceil=uu,Ln.clamp=function(e,t,n){return void 0===n&&(n=t,t=void 0),void 0!==n&&(n=(n=or(n))==n?n:0),void 0!==t&&(t=(t=or(t))==t?t:0),qn(or(e),t,n)},Ln.clone=function(e){return Xn(e,4)},Ln.cloneDeep=function(e){return Xn(e,5)},Ln.cloneDeepWith=function(e,t){return Xn(e,5,t="function"==typeof t?t:void 0)},Ln.cloneWith=function(e,t){return Xn(e,4,t="function"==typeof t?t:void 0)},Ln.conformsTo=function(e,t){return null==t||Jn(e,t,Ar(t))},Ln.deburr=Pr,Ln.defaultTo=function(e,t){return null==e||e!=e?t:e},Ln.divide=su,Ln.endsWith=function(e,t,n){e=rr(e),t=Xl(t);var l=e.length,i=n=void 0===n?l:qn(lr(n),0,l);return(n-=t.length)>=0&&e.slice(n,i)==t},Ln.eq=Ta,Ln.escape=function(e){return(e=rr(e))&&M.test(e)?e.replace(B,xt):e},Ln.escapeRegExp=function(e){return(e=rr(e))&&G.test(e)?e.replace(V,"\\$&"):e},Ln.every=function(e,t,n){var l=Ra(e)?ot:tl;return n&&oo(e,t,n)&&(t=void 0),l(e,qi(t,3))},Ln.find=oa,Ln.findIndex=Po,Ln.findKey=function(e,t){return ft(e,qi(t,3),rl)},Ln.findLast=aa,Ln.findLastIndex=Ro,Ln.findLastKey=function(e,t){return ft(e,qi(t,3),ul)},Ln.floor=du,Ln.forEach=ra,Ln.forEachRight=ua,Ln.forIn=function(e,t){return null==e?e:ol(e,qi(t,3),Sr)},Ln.forInRight=function(e,t){return null==e?e:al(e,qi(t,3),Sr)},Ln.forOwn=function(e,t){return e&&rl(e,qi(t,3))},Ln.forOwnRight=function(e,t){return e&&ul(e,qi(t,3))},Ln.get=fr,Ln.gt=Ia,Ln.gte=wa,Ln.has=function(e,t){return null!=e&&to(e,t,pl)},Ln.hasIn=Er,Ln.head=Bo,Ln.identity=Yr,Ln.includes=function(e,t,n,l){e=Ba(e)?e:Tr(e),n=n&&!l?lr(n):0;var i=e.length;return n<0&&(n=on(i+n,0)),Ja(e)?n<=i&&e.indexOf(t,n)>-1:!!i&>(e,t,n)>-1},Ln.indexOf=function(e,t,n){var l=null==e?0:e.length;if(!l)return-1;var i=null==n?0:lr(n);return i<0&&(i=on(l+i,0)),gt(e,t,i)},Ln.inRange=function(e,t,n){return t=nr(t),void 0===n?(n=t,t=0):n=nr(n),function(e,t,n){return e>=an(t,n)&&e<on(t,n)}(e=or(e),t,n)},Ln.invoke=hr,Ln.isArguments=Pa,Ln.isArray=Ra,Ln.isArrayBuffer=xa,Ln.isArrayLike=Ba,Ln.isArrayLikeObject=Fa,Ln.isBoolean=function(e){return!0===e||!1===e||Va(e)&&vl(e)==r},Ln.isBuffer=Ma,Ln.isDate=Ua,Ln.isElement=function(e){return Va(e)&&1===e.nodeType&&!Ka(e)},Ln.isEmpty=function(e){if(null==e)return!0;if(Ba(e)&&(Ra(e)||"string"==typeof e||"function"==typeof e.splice||Ma(e)||Za(e)||Pa(e)))return!e.length;var t=eo(e);if(t==v||t==E)return!e.size;if(so(e))return!bl(e).length;for(var n in e)if(Se.call(e,n))return!1;return!0},Ln.isEqual=function(e,t){return hl(e,t)},Ln.isEqualWith=function(e,t,n){var l=(n="function"==typeof n?n:void 0)?n(e,t):void 0;return void 0===l?hl(e,t,void 0,n):!!l},Ln.isError=ka,Ln.isFinite=function(e){return"number"==typeof e&&tn(e)},Ln.isFunction=Wa,Ln.isInteger=Ha,Ln.isLength=ja,Ln.isMap=Ga,Ln.isMatch=function(e,t){return e===t||Al(e,t,Ji(t))},Ln.isMatchWith=function(e,t,n){return n="function"==typeof n?n:void 0,Al(e,t,Ji(t),n)},Ln.isNaN=function(e){return Ya(e)&&e!=+e},Ln.isNative=function(e){if(uo(e))throw new de("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return Sl(e)},Ln.isNil=function(e){return null==e},Ln.isNull=function(e){return null===e},Ln.isNumber=Ya,Ln.isObject=za,Ln.isObjectLike=Va,Ln.isPlainObject=Ka,Ln.isRegExp=qa,Ln.isSafeInteger=function(e){return Ha(e)&&e>=-9007199254740991&&e<=9007199254740991},Ln.isSet=Xa,Ln.isString=Ja,Ln.isSymbol=Qa,Ln.isTypedArray=Za,Ln.isUndefined=function(e){return void 0===e},Ln.isWeakMap=function(e){return Va(e)&&eo(e)==h},Ln.isWeakSet=function(e){return Va(e)&&"[object WeakSet]"==vl(e)},Ln.join=function(e,t){return null==e?"":nn.call(e,t)},Ln.kebabCase=Rr,Ln.last=ko,Ln.lastIndexOf=function(e,t,n){var l=null==e?0:e.length;if(!l)return-1;var i=l;return void 0!==n&&(i=(i=lr(n))<0?on(l+i,0):an(i,l-1)),t==t?function(e,t,n){for(var l=n+1;l--;)if(e[l]===t)return l;return l}(e,t,i):Et(e,ht,i,!0)},Ln.lowerCase=xr,Ln.lowerFirst=Br,Ln.lt=$a,Ln.lte=er,Ln.max=function(e){return e&&e.length?nl(e,Yr,ml):void 0},Ln.maxBy=function(e,t){return e&&e.length?nl(e,qi(t,2),ml):void 0},Ln.mean=function(e){return At(e,Yr)},Ln.meanBy=function(e,t){return At(e,qi(t,2))},Ln.min=function(e){return e&&e.length?nl(e,Yr,Cl):void 0},Ln.minBy=function(e,t){return e&&e.length?nl(e,qi(t,2),Cl):void 0},Ln.stubArray=iu,Ln.stubFalse=ou,Ln.stubObject=function(){return{}},Ln.stubString=function(){return""},Ln.stubTrue=function(){return!0},Ln.multiply=cu,Ln.nth=function(e,t){return e&&e.length?Tl(e,lr(t)):void 0},Ln.noConflict=function(){return ze._===this&&(ze._=De),this},Ln.noop=Qr,Ln.now=fa,Ln.pad=function(e,t,n){e=rr(e);var l=(t=lr(t))?jt(e):0;if(!t||l>=t)return e;var i=(t-l)/2;return Ii(Zt(i),n)+e+Ii(Qt(i),n)},Ln.padEnd=function(e,t,n){e=rr(e);var l=(t=lr(t))?jt(e):0;return t&&l<t?e+Ii(t-l,n):e},Ln.padStart=function(e,t,n){e=rr(e);var l=(t=lr(t))?jt(e):0;return t&&l<t?Ii(t-l,n)+e:e},Ln.parseInt=function(e,t,n){return n||null==t?t=0:t&&(t=+t),un(rr(e).replace(Y,""),t||0)},Ln.random=function(e,t,n){if(n&&"boolean"!=typeof n&&oo(e,t,n)&&(t=n=void 0),void 0===n&&("boolean"==typeof t?(n=t,t=void 0):"boolean"==typeof e&&(n=e,e=void 0)),void 0===e&&void 0===t?(e=0,t=1):(e=nr(e),void 0===t?(t=e,e=0):t=nr(t)),e>t){var l=e;e=t,t=l}if(n||e%1||t%1){var i=sn();return an(e+i*(t-e+ke("1e-"+((i+"").length-1))),t)}return xl(e,t)},Ln.reduce=function(e,t,n){var l=Ra(e)?ct:bt,i=arguments.length<3;return l(e,qi(t,4),n,i,$n)},Ln.reduceRight=function(e,t,n){var l=Ra(e)?vt:bt,i=arguments.length<3;return l(e,qi(t,4),n,i,el)},Ln.repeat=function(e,t,n){return t=(n?oo(e,t,n):void 0===t)?1:lr(t),Bl(rr(e),t)},Ln.replace=function(){var e=arguments,t=rr(e[0]);return e.length<3?t:t.replace(e[1],e[2])},Ln.result=function(e,t,n){var l=-1,i=(t=oi(t,e)).length;for(i||(i=1,e=void 0);++l<i;){var o=null==e?void 0:e[Do(t[l])];void 0===o&&(l=i,o=n),e=Wa(o)?o.call(e):o}return e},Ln.round=vu,Ln.runInContext=e,Ln.sample=function(e){return(Ra(e)?Un:Ml)(e)},Ln.size=function(e){if(null==e)return 0;if(Ba(e))return Ja(e)?jt(e):e.length;var t=eo(e);return t==v||t==E?e.size:bl(e).length},Ln.snakeCase=Fr,Ln.some=function(e,t,n){var l=Ra(e)?mt:Vl;return n&&oo(e,t,n)&&(t=void 0),l(e,qi(t,3))},Ln.sortedIndex=function(e,t){return Gl(e,t)},Ln.sortedIndexBy=function(e,t,n){return Yl(e,t,qi(n,2))},Ln.sortedIndexOf=function(e,t){var n=null==e?0:e.length;if(n){var l=Gl(e,t);if(l<n&&Ta(e[l],t))return l}return-1},Ln.sortedLastIndex=function(e,t){return Gl(e,t,!0)},Ln.sortedLastIndexBy=function(e,t,n){return Yl(e,t,qi(n,2),!0)},Ln.sortedLastIndexOf=function(e,t){if(null!=e&&e.length){var n=Gl(e,t,!0)-1;if(Ta(e[n],t))return n}return-1},Ln.startCase=Mr,Ln.startsWith=function(e,t,n){return e=rr(e),n=null==n?0:qn(lr(n),0,e.length),t=Xl(t),e.slice(n,n+t.length)==t},Ln.subtract=mu,Ln.sum=function(e){return e&&e.length?Ct(e,Yr):0},Ln.sumBy=function(e,t){return e&&e.length?Ct(e,qi(t,2)):0},Ln.template=function(e,t,n){var l=Ln.templateSettings;n&&oo(e,t,n)&&(t=void 0),e=rr(e),t=dr({},t,l,Ui);var i,o,a=dr({},t.imports,l.imports,Ui),r=Ar(a),u=Ot(a,r),s=0,d=t.interpolate||ue,c="__p += '",v=pe((t.escape||ue).source+"|"+d.source+"|"+(d===W?ee:ue).source+"|"+(t.evaluate||ue).source+"|$","g"),m="//# sourceURL="+(Se.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Be+"]")+"\n";e.replace(v,function(t,n,l,a,r,u){return l||(l=a),c+=e.slice(s,u).replace(se,Bt),n&&(i=!0,c+="' +\n__e("+n+") +\n'"),r&&(o=!0,c+="';\n"+r+";\n__p += '"),l&&(c+="' +\n((__t = ("+l+")) == null ? '' : __t) +\n'"),s=u+t.length,t}),c+="';\n";var p=Se.call(t,"variable")&&t.variable;if(p){if(Z.test(p))throw new de("Invalid `variable` option passed into `_.template`")}else c="with (obj) {\n"+c+"\n}\n";c=(o?c.replace(w,""):c).replace(P,"$1").replace(R,"$1;"),c="function("+(p||"obj")+") {\n"+(p?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(i?", __e = _.escape":"")+(o?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+c+"return __p\n}";var f=Hr(function(){return ce(r,m+"return "+c).apply(void 0,u)});if(f.source=c,ka(f))throw f;return f},Ln.times=function(e,t){if((e=lr(e))<1||e>9007199254740991)return[];var n=4294967295,l=an(e,4294967295);e-=4294967295;for(var i=yt(l,t=qi(t));++n<e;)t(n);return i},Ln.toFinite=nr,Ln.toInteger=lr,Ln.toLength=ir,Ln.toLower=function(e){return rr(e).toLowerCase()},Ln.toNumber=or,Ln.toSafeInteger=function(e){return e?qn(lr(e),-9007199254740991,9007199254740991):0===e?e:0},Ln.toString=rr,Ln.toUpper=function(e){return rr(e).toUpperCase()},Ln.trim=function(e,t,n){if((e=rr(e))&&(n||void 0===t))return Dt(e);if(!e||!(t=Xl(t)))return e;var l=zt(e),i=zt(t);return ri(l,It(l,i),wt(l,i)+1).join("")},Ln.trimEnd=function(e,t,n){if((e=rr(e))&&(n||void 0===t))return e.slice(0,Vt(e)+1);if(!e||!(t=Xl(t)))return e;var l=zt(e);return ri(l,0,wt(l,zt(t))+1).join("")},Ln.trimStart=function(e,t,n){if((e=rr(e))&&(n||void 0===t))return e.replace(Y,"");if(!e||!(t=Xl(t)))return e;var l=zt(e);return ri(l,It(l,zt(t))).join("")},Ln.truncate=function(e,t){var n=30,l="...";if(za(t)){var i="separator"in t?t.separator:i;n="length"in t?lr(t.length):n,l="omission"in t?Xl(t.omission):l}var o=(e=rr(e)).length;if(Ft(e)){var a=zt(e);o=a.length}if(n>=o)return e;var r=n-jt(l);if(r<1)return l;var u=a?ri(a,0,r).join(""):e.slice(0,r);if(void 0===i)return u+l;if(a&&(r+=u.length-r),qa(i)){if(e.slice(r).search(i)){var s,d=u;for(i.global||(i=pe(i.source,rr(te.exec(i))+"g")),i.lastIndex=0;s=i.exec(d);)var c=s.index;u=u.slice(0,void 0===c?r:c)}}else if(e.indexOf(Xl(i),r)!=r){var v=u.lastIndexOf(i);v>-1&&(u=u.slice(0,v))}return u+l},Ln.unescape=function(e){return(e=rr(e))&&F.test(e)?e.replace(x,Gt):e},Ln.uniqueId=function(e){var t=++Ne;return rr(e)+t},Ln.upperCase=Ur,Ln.upperFirst=kr,Ln.each=ra,Ln.eachRight=ua,Ln.first=Bo,Jr(Ln,(au={},rl(Ln,function(e,t){Se.call(Ln.prototype,t)||(au[t]=e)}),au),{chain:!1}),Ln.VERSION="4.17.21",lt(["bind","bindKey","curry","curryRight","partial","partialRight"],function(e){Ln[e].placeholder=Ln}),lt(["drop","take"],function(e,t){wn.prototype[e]=function(n){n=void 0===n?1:on(lr(n),0);var l=this.__filtered__&&!t?new wn(this):this.clone();return l.__filtered__?l.__takeCount__=an(n,l.__takeCount__):l.__views__.push({size:an(n,4294967295),type:e+(l.__dir__<0?"Right":"")}),l},wn.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}}),lt(["filter","map","takeWhile"],function(e,t){var n=t+1,l=1==n||3==n;wn.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:qi(e,3),type:n}),t.__filtered__=t.__filtered__||l,t}}),lt(["head","last"],function(e,t){var n="take"+(t?"Right":"");wn.prototype[e]=function(){return this[n](1).value()[0]}}),lt(["initial","tail"],function(e,t){var n="drop"+(t?"":"Right");wn.prototype[e]=function(){return this.__filtered__?new wn(this):this[n](1)}}),wn.prototype.compact=function(){return this.filter(Yr)},wn.prototype.find=function(e){return this.filter(e).head()},wn.prototype.findLast=function(e){return this.reverse().find(e)},wn.prototype.invokeMap=Fl(function(e,t){return"function"==typeof e?new wn(this):this.map(function(n){return gl(n,e,t)})}),wn.prototype.reject=function(e){return this.filter(Ca(qi(e)))},wn.prototype.slice=function(e,t){e=lr(e);var n=this;return n.__filtered__&&(e>0||t<0)?new wn(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),void 0!==t&&(n=(t=lr(t))<0?n.dropRight(-t):n.take(t-e)),n)},wn.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},wn.prototype.toArray=function(){return this.take(4294967295)},rl(wn.prototype,function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),l=/^(?:head|last)$/.test(t),i=Ln[l?"take"+("last"==t?"Right":""):t],o=l||/^find/.test(t);i&&(Ln.prototype[t]=function(){var t=this.__wrapped__,a=l?[1]:arguments,r=t instanceof wn,u=a[0],s=r||Ra(t),d=function(e){var t=i.apply(Ln,dt([e],a));return l&&c?t[0]:t};s&&n&&"function"==typeof u&&1!=u.length&&(r=s=!1);var c=this.__chain__,v=!!this.__actions__.length,m=o&&!c,p=r&&!v;if(!o&&s){t=p?t:new wn(this);var f=e.apply(t,a);return f.__actions__.push({func:na,args:[d],thisArg:void 0}),new In(f,c)}return m&&p?e.apply(this,a):(f=this.thru(d),m?l?f.value()[0]:f.value():f)})}),lt(["pop","push","shift","sort","splice","unshift"],function(e){var t=ge[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",l=/^(?:pop|shift)$/.test(e);Ln.prototype[e]=function(){var e=arguments;if(l&&!this.__chain__){var i=this.value();return t.apply(Ra(i)?i:[],e)}return this[n](function(n){return t.apply(Ra(n)?n:[],e)})}}),rl(wn.prototype,function(e,t){var n=Ln[t];if(n){var l=n.name+"";Se.call(_n,l)||(_n[l]=[]),_n[l].push({name:t,func:n})}}),_n[Di(void 0,2).name]=[{name:"wrapper",func:void 0}],wn.prototype.clone=function(){var e=new wn(this.__wrapped__);return e.__actions__=fi(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=fi(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=fi(this.__views__),e},wn.prototype.reverse=function(){if(this.__filtered__){var e=new wn(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},wn.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,n=Ra(e),l=t<0,i=n?e.length:0,o=function(e,t,n){for(var l=-1,i=n.length;++l<i;){var o=n[l],a=o.size;switch(o.type){case"drop":e+=a;break;case"dropRight":t-=a;break;case"take":t=an(t,e+a);break;case"takeRight":e=on(e,t-a)}}return{start:e,end:t}}(0,i,this.__views__),a=o.start,r=o.end,u=r-a,s=l?r:a-1,d=this.__iteratees__,c=d.length,v=0,m=an(u,this.__takeCount__);if(!n||!l&&i==u&&m==u)return ei(e,this.__actions__);var p=[];e:for(;u--&&v<m;){for(var f=-1,E=e[s+=t];++f<c;){var g=d[f],_=g.type,h=(0,g.iteratee)(E);if(2==_)E=h;else if(!h){if(1==_)continue e;break e}}p[v++]=E}return p},Ln.prototype.at=la,Ln.prototype.chain=function(){return ta(this)},Ln.prototype.commit=function(){return new In(this.value(),this.__chain__)},Ln.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__++]}},Ln.prototype.plant=function(e){for(var t,n=this;n instanceof Tn;){var l=Oo(n);l.__index__=0,l.__values__=void 0,t?i.__wrapped__=l:t=l;var i=l;n=n.__wrapped__}return i.__wrapped__=e,t},Ln.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof wn){var t=e;return this.__actions__.length&&(t=new wn(this)),(t=t.reverse()).__actions__.push({func:na,args:[zo],thisArg:void 0}),new In(t,this.__chain__)}return this.thru(zo)},Ln.prototype.toJSON=Ln.prototype.valueOf=Ln.prototype.value=function(){return ei(this.__wrapped__,this.__actions__)},Ln.prototype.first=Ln.prototype.head,pt&&(Ln.prototype[pt]=function(){return this}),Ln}();Ge?((Ge.exports=Yt)._=Yt,Ve._=Yt):ze._=Yt}).call(C)});const St=e=>{var i,r;const{register:u,setValue:s,getValues:d,reset:c,formState:v}=a.useFormContext(),{t:m}=o.useTranslation(),p=Digit.UserService.getUser().info;return l.createElement(n.Fragment,null,l.createElement(t.SearchField,null,l.createElement("label",null,m("NOC_APPLICATION_NUMBER")),l.createElement(t.TextInput,{name:"applicationNo",inputRef:u({})})),l.createElement(t.SearchField,null,l.createElement("label",null,m("NOC_APPLICANT_MOBILE_NO_LABEL")),l.createElement(t.MobileNumber,{name:"mobileNumber",inputRef:u({minLength:{value:10,message:m("CORE_COMMON_MOBILE_ERROR")},maxLength:{value:10,message:m("CORE_COMMON_MOBILE_ERROR")},pattern:{value:/[6789][0-9]{9}/,message:m("CORE_COMMON_MOBILE_ERROR")}}),type:"number",componentInFront:l.createElement("div",{className:"employee-card-input employee-card-input--front"},"+91")}),l.createElement(t.CardLabelError,null,null==v||null===(i=v.errors)||void 0===i||null===(r=i.mobileNumber)||void 0===r?void 0:r.message)),l.createElement(t.SearchField,{className:"submit"},l.createElement(t.SubmitBar,{label:m("ES_COMMON_SEARCH"),submit:!0}),l.createElement("p",{style:{marginTop:"24px"},onClick:()=>{c({applicationNo:"",mobileNumber:"",offset:0,limit:10,sortBy:"createdTime",sortOrder:"DESC",isSubmitSuccessful:"false"}),s("offset",d("offset")-d("limit")),null==e||e.onSubmit({offset:0,limit:10,sortBy:"createdTime",sortOrder:"DESC",mobileNumber:null==p?void 0:p.mobileNumber},!0),null!=e&&e.isMobileView&&e.closeMobilePopupModal()}},m("ES_COMMON_CLEAR_ALL"))))},Nt=["currentlyActiveMobileModal"],bt=["currentlyActiveMobileModal"],Ct=e=>{var i,r;let{SearchFormFieldsComponent:u,propsMobileInboxCards:s,isLoading:d,data:m,onSubmit:p}=e;const{t:f}=o.useTranslation(),{handleSubmit:E}=a.useFormContext(),[g,_]=n.useReducer(function(e,t){switch(t.type){case"set":return t.payload;case"remove":return!1}},!1),h=()=>{_({type:"remove"})},A=()=>l.createElement("div",{className:"InboxMobilePopupCloseButtonWrapper",onClick:h},l.createElement(t.CloseSvg,null)),S=n.useCallback(e=>{let{currentlyActiveMobileModal:n}=e;return(e=>{let{currentlyActiveMobileModal:n}=e,i=v(e,Nt);const{closeMobilePopupModal:o}=i;switch(n){case"SearchFormComponent":return l.createElement(t.SearchForm,i,l.createElement(A,null),l.createElement("div",{className:"MobilePopupHeadingWrapper"},l.createElement("h2",null,f("ACTION_TEST_SEARCH_NOC_APPLICATION"),":")),l.createElement(u,{onSubmit:p,handleSubmit:E,isMobileView:!0,closeMobilePopupModal:o}));default:return l.createElement("span",null)}})(c({currentlyActiveMobileModal:n},v(e,bt)))},[g]);return d?l.createElement(t.Loader,null):l.createElement(l.Fragment,null,l.createElement("div",{className:"searchBox"},l.createElement(t.SearchAction,{text:f("ES_COMMON_SEARCH"),handleActionClick:()=>_({type:"set",payload:"SearchFormComponent"})})),g?l.createElement(t.PopUp,null,l.createElement(S,{onSubmit:e=>{_({type:"remove"}),p(e)},handleSubmit:E,id:"search-form",className:"rm-mb form-field-flex-one inboxPopupMobileWrapper",currentlyActiveMobileModal:g,closeMobilePopupModal:h})):null,null!=m&&null!==(i=m[0])&&void 0!==i&&i.display?l.createElement(t.Card,{style:{marginTop:20}},f(null==m||null===(r=m[0])||void 0===r?void 0:r.display).split("\\n").map((e,t)=>l.createElement("p",{key:t,style:{textAlign:"center"}},e))):l.createElement(t.DetailsCard,{data:s,isTwoDynamicPrefix:!1,linkPrefix:"/digit-ui/employee/noc/inbox/application-overview/",serviceRequestIdKey:f("NOC_APPLICATION_NUMBER")}))},yt=e=>{let{columns:i,SearchFormFieldsComponent:r,onSubmit:u,data:s,isLoading:d,Count:c}=e;const{handleSubmit:v,setValue:m,getValues:p}=a.useFormContext();null==p("offset")&&m("offset",0),null==p("limit")&&m("limit",10);const[f,E]=n.useState(Number(p("offset"))/Number(p("limit"))),{t:g}=o.useTranslation(),_=()=>{m("offset",c&&10*Math.ceil(c/10)-p("limit")),v(u)()},h=()=>{m("offset",0),v(u)()},A=n.useCallback(e=>{0!==e.length&&(m("sortBy",e.id),m("sortOrder",e.desc?"DESC":"ASC"))},[]);function S(e){m("limit",Number(e.target.value)),v(u)()}function N(){m("offset",Number(p("offset"))+Number(p("limit"))),v(u)()}function b(){m("offset",Number(p("offset"))-Number(p("limit"))),v(u)()}n.useEffect(()=>{null!=p("offset")&&null!=p("limit")&&E(Number(p("offset"))/Number(p("limit")))},[p("offset"),p("limit")]);const C=()=>{return d?l.createElement(t.Loader,null):null!=s&&null!==(e=s[0])&&void 0!==e&&e.display?l.createElement(t.Card,{style:{marginTop:20}},g(null==s||null===(n=s[0])||void 0===n?void 0:n.display).split("\\n").map((e,t)=>l.createElement("p",{key:t,style:{textAlign:"center"}},e))):l.createElement(t.Table,{t:g,data:s,columns:i,getCellProps:e=>({style:{minWidth:e.column.Header===g("ES_INBOX_APPLICATION_NO")?"240px":"",padding:"20px 18px",fontSize:"16px"}}),onPageSizeChange:S,currentPage:f,onNextPage:N,onPrevPage:b,pageSizeLimit:Number(p("limit")),onSort:A,totalRecords:c,disableSort:!1,onLastPage:_,onFirstPage:h,sortParams:[{id:p("sortBy"),desc:"DESC"===p("sortOrder")}]});var e,n};return l.createElement(l.Fragment,null,l.createElement(t.SearchForm,{onSubmit:u,handleSubmit:v},l.createElement(r,{onSubmit:u,handleSubmit:v,isMobileView:!1})),l.createElement(C,null))},Dt=e=>{let{t:t,onSubmit:r,data:u,error:s,isLoading:d,Count:c}=e;const[v,m]=n.useState(null),p=a.useForm();n.useEffect(()=>{p.register("offset",0),p.register("limit",10),p.register("sortBy","createdTime"),p.register("sortOrder","DESC")},[p.register]);const f=(()=>{const{t:e}=o.useTranslation();return n.useMemo(()=>[{Header:e("NOC_APPLICATION_NUMBER"),accessor:"applicationNo",disableSortBy:!0,Cell:e=>{let{row:t}=e;return l.createElement("div",null,l.createElement("span",{className:"link"},l.createElement(i.Link,{to:"/digit-ui/employee/noc/inbox/application-overview/"+t.original.applicationNo},t.original.applicationNo)))}},{Header:e("TL_COMMON_TABLE_COL_APP_DATE"),disableSortBy:!0,accessor:t=>e((null==t?void 0:t.date)||"-")},{Header:e("PT_COMMON_TABLE_COL_STATUS_LABEL"),accessor:t=>e((null==t?void 0:t.applicationStatus)||"-"),disableSortBy:!0}],[])})(),E=window.Digit.Utils.browser.isMobile(),g=n.useMemo(()=>null==u?void 0:u.map(e=>({[t("NOC_APPLICATION_NUMBER")]:(null==e?void 0:e.applicationNo)||"-",[t("TL_COMMON_TABLE_COL_APP_DATE")]:(null==e?void 0:e.date)||"-",[t("PT_COMMON_TABLE_COL_STATUS_LABEL")]:null!=e&&e.applicationStatus?t(""+e.applicationStatus):"-"})),[u]);return l.createElement(a.FormProvider,p,E?l.createElement(Ct,{SearchFormFieldsComponent:St,propsMobileInboxCards:g,isLoading:d,data:u,getRedirectionLink:()=>"noc/inbox/application-overview",onSubmit:r}):l.createElement(yt,{columns:f,SearchFormFieldsComponent:St,onSubmit:r,data:u,error:s,isLoading:d,Count:c}))},Lt=e=>{const{t:i}=o.useTranslation(),a=Digit.UserService.getUser().info;let r;r=window.location.pathname.includes("employee")?window.localStorage.getItem("Employee.tenant-id"):window.localStorage.getItem("CITIZEN.CITY");const u={offset:0,limit:10,tenantId:r,mobileNumber:null==a?void 0:a.mobileNumber},[s,d]=n.useState(u),c=window.Digit.Utils.browser.isMobile(),[v,m]=n.useState([{display:"ES_COMMON_NO_DATA"}]),[p,f]=n.useState(0),{data:E,isLoading:g,error:_}=Digit.Hooks.noc.useNOCSearchApplicationByIdOrMobile(s,r,{});return n.useEffect(()=>{var e;null==E?m([{display:"ES_COMMON_NO_DATA"}]):(null==E||null===(e=E.data)||void 0===e?void 0:e.length)>0&&(m(null==E?void 0:E.data),f(null==E?void 0:E.totalCount))},[E]),l.createElement("div",null,l.createElement(t.CardHeader,{styles:c?{fontSize:"32px",fontWeight:"700",paddingLeft:"10px"}:{fontSize:"32px",fontWeight:"700"}},i("ACTION_TEST_SEARCH_NOC_APPLICATION")),l.createElement(Dt,{t:i,tenantId:r,onSubmit:function(e,t){console.log("_data==>",e);let n=ht(e);!!n.applicationNo&&!n.mobileNumber&&(console.log("we are deleteing mobileNumber here"),delete n.mobileNumber),d(n)},isLoading:g,Count:p,error:_,data:v}))},Ot=(e,t)=>{if(0===e)return t("NOC_GROUND_FLOOR_AREA_LABEL");const n=e%10,l=e%100;let i="th";return(l<11||l>13)&&(1===n?i="st":2===n?i="nd":3===n&&(i="rd")),""+e+i+" "+t("NOC_FLOOR_AREA_LABEL")},Tt=(e,t)=>{var n;let l=[{title:t("CS_APPLICATION_NUMBER"),value:(null==e?void 0:e.applicationNo)||"N/A"},{title:t("REGISTRATION_FILED_DATE"),value:Digit.DateUtils.ConvertTimestampToDate(null==e||null===(n=e.auditDetails)||void 0===n?void 0:n.createdTime,"dd/MM/yyyy")||"NA"}];return{title:t("CS_APPLICATION_DETAILS"),values:l}},It=(e,t)=>{var n,l,i,o,a,r,u,s,d,c,v,m,p,f,E,g,_,h,A,S,N,b,C,y,D,L,O,T;let I=[{title:t("NOC_FIRM_OWNER_NAME_LABEL"),value:(null==e||null===(n=e.nocDetails)||void 0===n||null===(l=n.additionalDetails)||void 0===l||null===(i=l.applicationDetails)||void 0===i?void 0:i.applicantOwnerOrFirmName)||"N/A"},{title:t("NOC_APPLICANT_EMAIL_LABEL"),value:(null==e||null===(o=e.nocDetails)||void 0===o||null===(a=o.additionalDetails)||void 0===a||null===(r=a.applicationDetails)||void 0===r?void 0:r.applicantEmailId)||"N/A"},{title:t("NOC_APPLICANT_FATHER_HUSBAND_NAME_LABEL"),value:(null==e||null===(u=e.nocDetails)||void 0===u||null===(s=u.additionalDetails)||void 0===s||null===(d=s.applicationDetails)||void 0===d?void 0:d.applicantFatherHusbandName)||"N/A"},{title:t("NOC_APPLICANT_MOBILE_NO_LABEL"),value:(null==e||null===(c=e.nocDetails)||void 0===c||null===(v=c.additionalDetails)||void 0===v||null===(m=v.applicationDetails)||void 0===m?void 0:m.applicantMobileNumber)||"N/A"},{title:t("NOC_APPLICANT_DOB_LABEL"),value:(null==e||null===(p=e.nocDetails)||void 0===p||null===(f=p.additionalDetails)||void 0===f||null===(E=f.applicationDetails)||void 0===E?void 0:E.applicantDateOfBirth)||"N/A"},{title:t("NOC_APPLICANT_GENDER_LABEL"),value:(null==e||null===(g=e.nocDetails)||void 0===g||null===(_=g.additionalDetails)||void 0===_||null===(h=_.applicationDetails)||void 0===h||null===(A=h.applicantGender)||void 0===A?void 0:A.code)||(null==e||null===(S=e.nocDetails)||void 0===S||null===(N=S.additionalDetails)||void 0===N||null===(b=N.applicationDetails)||void 0===b?void 0:b.applicantGender)||"N/A"},{title:t("NOC_APPLICANT_ADDRESS_LABEL"),value:(null==e||null===(C=e.nocDetails)||void 0===C||null===(y=C.additionalDetails)||void 0===y||null===(D=y.applicationDetails)||void 0===D?void 0:D.applicantAddress)||"N/A"},{title:t("NOC_APPLICANT_PROPERTY_ID_LABEL"),value:(null==e||null===(L=e.nocDetails)||void 0===L||null===(O=L.additionalDetails)||void 0===O||null===(T=O.applicationDetails)||void 0===T?void 0:T.applicantPropertyId)||"N/A"}];return{title:t("NOC_APPLICANT_DETAILS"),values:I}},wt=(e,t)=>{var n,l,i,o,a,r,u,s,d,c,v,m,p,f,E,g,_,h,A,S,N,b,C,y,D,L,O,T,I,w,P,R,x,B,F,M,U,k,W,H,j,z,V,G,Y,K,q,X,J,Q,Z,$,ee,te,ne,le,ie,oe,ae,re,ue,se,de,ce,ve,me,pe,fe,Ee,ge,_e,he,Ae,Se,Ne,be,Ce,ye,De,Le,Oe,Te,Ie,we,Pe,Re,xe,Be,Fe,Me,Ue,ke,We;let He=[{title:t("NOC_PLOT_NO_LABEL"),value:(null==e||null===(n=e.nocDetails)||void 0===n||null===(l=n.additionalDetails)||void 0===l||null===(i=l.siteDetails)||void 0===i?void 0:i.plotNo)||"N/A"},{title:t("NOC_PROPOSED_SITE_ADDRESS"),value:(null==e||null===(o=e.nocDetails)||void 0===o||null===(a=o.additionalDetails)||void 0===a||null===(r=a.siteDetails)||void 0===r?void 0:r.proposedSiteAddress)||"N/A"},{title:t("NOC_ULB_NAME_LABEL"),value:(null==e||null===(u=e.nocDetails)||void 0===u||null===(s=u.additionalDetails)||void 0===s||null===(d=s.siteDetails)||void 0===d||null===(c=d.ulbName)||void 0===c?void 0:c.name)||(null==e||null===(v=e.nocDetails)||void 0===v||null===(m=v.additionalDetails)||void 0===m||null===(p=m.siteDetails)||void 0===p?void 0:p.ulbName)||"N/A"},{title:t("NOC_ULB_TYPE_LABEL"),value:(null==e||null===(f=e.nocDetails)||void 0===f||null===(E=f.additionalDetails)||void 0===E||null===(g=E.siteDetails)||void 0===g?void 0:g.ulbType)||"N/A"},{title:t("NOC_KHASRA_NO_LABEL"),value:(null==e||null===(_=e.nocDetails)||void 0===_||null===(h=_.additionalDetails)||void 0===h||null===(A=h.siteDetails)||void 0===A?void 0:A.khasraNo)||"N/A"},{title:t("NOC_HADBAST_NO_LABEL"),value:(null==e||null===(S=e.nocDetails)||void 0===S||null===(N=S.additionalDetails)||void 0===N||null===(b=N.siteDetails)||void 0===b?void 0:b.hadbastNo)||"N/A"},{title:t("NOC_ROAD_TYPE_LABEL"),value:(null==e||null===(C=e.nocDetails)||void 0===C||null===(y=C.additionalDetails)||void 0===y||null===(D=y.siteDetails)||void 0===D||null===(L=D.roadType)||void 0===L?void 0:L.name)||(null==e||null===(O=e.nocDetails)||void 0===O||null===(T=O.additionalDetails)||void 0===T||null===(I=T.siteDetails)||void 0===I?void 0:I.roadType)||"N/A"},{title:t("NOC_AREA_LEFT_FOR_ROAD_WIDENING_LABEL"),value:(null==e||null===(w=e.nocDetails)||void 0===w||null===(P=w.additionalDetails)||void 0===P||null===(R=P.siteDetails)||void 0===R?void 0:R.areaLeftForRoadWidening)||"N/A"},{title:t("NOC_NET_PLOT_AREA_AFTER_WIDENING_LABEL"),value:(null==e||null===(x=e.nocDetails)||void 0===x||null===(B=x.additionalDetails)||void 0===B||null===(F=B.siteDetails)||void 0===F?void 0:F.netPlotAreaAfterWidening)||"N/A"},{title:t("NOC_NET_TOTAL_AREA_LABEL"),value:(null==e||null===(M=e.nocDetails)||void 0===M||null===(U=M.additionalDetails)||void 0===U||null===(k=U.siteDetails)||void 0===k?void 0:k.netTotalArea)||"N/A"},{title:t("NOC_ROAD_WIDTH_AT_SITE_LABEL"),value:(null==e||null===(W=e.nocDetails)||void 0===W||null===(H=W.additionalDetails)||void 0===H||null===(j=H.siteDetails)||void 0===j?void 0:j.roadWidthAtSite)||"N/A"},{title:t("NOC_DISTRICT_LABEL"),value:(null==e||null===(z=e.nocDetails)||void 0===z||null===(V=z.additionalDetails)||void 0===V||null===(G=V.siteDetails)||void 0===G||null===(Y=G.district)||void 0===Y?void 0:Y.name)||(null==e||null===(K=e.nocDetails)||void 0===K||null===(q=K.additionalDetails)||void 0===q||null===(X=q.siteDetails)||void 0===X?void 0:X.district)||"N/A"},{title:t("NOC_ZONE_LABEL"),value:(null==e||null===(J=e.nocDetails)||void 0===J||null===(Q=J.additionalDetails)||void 0===Q||null===(Z=Q.siteDetails)||void 0===Z||null===($=Z.zone)||void 0===$?void 0:$.name)||(null==e||null===(ee=e.nocDetails)||void 0===ee||null===(te=ee.additionalDetails)||void 0===te||null===(ne=te.siteDetails)||void 0===ne?void 0:ne.zone)||"N/A"},{title:t("NOC_SITE_WARD_NO_LABEL"),value:(null==e||null===(le=e.nocDetails)||void 0===le||null===(ie=le.additionalDetails)||void 0===ie||null===(oe=ie.siteDetails)||void 0===oe?void 0:oe.wardNo)||"N/A"},{title:t("NOC_SITE_VILLAGE_NAME_LABEL"),value:(null==e||null===(ae=e.nocDetails)||void 0===ae||null===(re=ae.additionalDetails)||void 0===re||null===(ue=re.siteDetails)||void 0===ue?void 0:ue.villageName)||"N/A"},{title:t("NOC_SITE_COLONY_NAME_LABEL"),value:(null==e||null===(se=e.nocDetails)||void 0===se||null===(de=se.additionalDetails)||void 0===de||null===(ce=de.siteDetails)||void 0===ce?void 0:ce.colonyName)||"N/A"},{title:t("NOC_SITE_VASIKA_NO_LABEL"),value:(null==e||null===(ve=e.nocDetails)||void 0===ve||null===(me=ve.additionalDetails)||void 0===me||null===(pe=me.siteDetails)||void 0===pe?void 0:pe.vasikaNumber)||"N/A"},{title:t("NOC_SITE_KHEWAT_AND_KHATUNI_NO_LABEL"),value:(null==e||null===(fe=e.nocDetails)||void 0===fe||null===(Ee=fe.additionalDetails)||void 0===Ee||null===(ge=Ee.siteDetails)||void 0===ge?void 0:ge.khewatAndKhatuniNo)||"N/A"},{title:t("NOC_BUILDING_STATUS_LABEL"),value:(null==e||null===(_e=e.nocDetails)||void 0===_e||null===(he=_e.additionalDetails)||void 0===he||null===(Ae=he.siteDetails)||void 0===Ae||null===(Se=Ae.buildingStatus)||void 0===Se?void 0:Se.name)||(null==e||null===(Ne=e.nocDetails)||void 0===Ne||null===(be=Ne.additionalDetails)||void 0===be||null===(Ce=be.siteDetails)||void 0===Ce?void 0:Ce.buildingStatus)||"N/A"},{title:t("NOC_IS_BASEMENT_AREA_PRESENT_LABEL"),value:(null==e||null===(ye=e.nocDetails)||void 0===ye||null===(De=ye.additionalDetails)||void 0===De||null===(Le=De.siteDetails)||void 0===Le||null===(Oe=Le.isBasementAreaAvailable)||void 0===Oe?void 0:Oe.code)||(null==e||null===(Te=e.nocDetails)||void 0===Te||null===(Ie=Te.additionalDetails)||void 0===Ie||null===(we=Ie.siteDetails)||void 0===we?void 0:we.isBasementAreaAvailable)||"N/A"}];var je,ze,Ve,Ge,Ye,Ke,qe,Xe,Je,Qe;return"Built Up"==(null==e||null===(Pe=e.nocDetails)||void 0===Pe||null===(Re=Pe.additionalDetails)||void 0===Re||null===(xe=Re.siteDetails)||void 0===xe?void 0:xe.buildingStatus)&&He.push({title:t("NOC_BASEMENT_AREA_LABEL"),value:(null==e||null===(je=e.nocDetails)||void 0===je||null===(ze=je.additionalDetails)||void 0===ze||null===(Ve=ze.siteDetails)||void 0===Ve?void 0:Ve.basementArea)||"N/A"}),"Built UP"==(null==e||null===(Be=e.nocDetails)||void 0===Be||null===(Fe=Be.additionalDetails)||void 0===Fe||null===(Me=Fe.siteDetails)||void 0===Me?void 0:Me.buildingStatus)&&(null==e||null===(Ge=e.nocDetails)||void 0===Ge||null===(Ye=Ge.additionalDetails)||void 0===Ye||null===(Ke=Ye.siteDetails)||void 0===Ke||null===(qe=Ke.floorArea)||void 0===qe||qe.map((e,n)=>He.push({title:Ot(n,t),value:null==e?void 0:e.value}))),"Built Up"==(null==e||null===(Ue=e.nocDetails)||void 0===Ue||null===(ke=Ue.additionalDetails)||void 0===ke||null===(We=ke.siteDetails)||void 0===We?void 0:We.buildingStatus)&&He.push({title:t("NOC_TOTAL_FLOOR_BUILT_UP_AREA_LABEL"),value:(null==e||null===(Xe=e.nocDetails)||void 0===Xe||null===(Je=Xe.additionalDetails)||void 0===Je||null===(Qe=Je.siteDetails)||void 0===Qe?void 0:Qe.totalFloorArea)||"N/A"}),{title:t("NOC_SITE_DETAILS"),values:He}},Pt=(e,t)=>{var n,l,i,o,a,r,u,s,d,c,v,m,p,f,E,g,_,h,A,S,N,b,C,y,D,L,O,T,I,w,P;let R=[{title:t("NOC_PLOT_AREA_JAMA_BANDI_LABEL"),value:(null==e||null===(n=e.nocDetails)||void 0===n||null===(l=n.additionalDetails)||void 0===l||null===(i=l.siteDetails)||void 0===i?void 0:i.specificationPlotArea)||"N/A"},{title:t("NOC_BUILDING_CATEGORY_LABEL"),value:(null==e||null===(o=e.nocDetails)||void 0===o||null===(a=o.additionalDetails)||void 0===a||null===(r=a.siteDetails)||void 0===r||null===(u=r.specificationBuildingCategory)||void 0===u?void 0:u.name)||(null==e||null===(s=e.nocDetails)||void 0===s||null===(d=s.additionalDetails)||void 0===d||null===(c=d.siteDetails)||void 0===c?void 0:c.specificationBuildingCategory)||"N/A"},{title:t("NOC_NOC_TYPE_LABEL"),value:(null==e||null===(v=e.nocDetails)||void 0===v||null===(m=v.additionalDetails)||void 0===m||null===(p=m.siteDetails)||void 0===p||null===(f=p.specificationNocType)||void 0===f?void 0:f.name)||(null==e||null===(E=e.nocDetails)||void 0===E||null===(g=E.additionalDetails)||void 0===g||null===(_=g.siteDetails)||void 0===_?void 0:_.specificationNocType)||"N/A"},{title:t("NOC_RESTRICTED_AREA_LABEL"),value:(null==e||null===(h=e.nocDetails)||void 0===h||null===(A=h.additionalDetails)||void 0===A||null===(S=A.siteDetails)||void 0===S||null===(N=S.specificationRestrictedArea)||void 0===N?void 0:N.code)||(null==e||null===(b=e.nocDetails)||void 0===b||null===(C=b.additionalDetails)||void 0===C||null===(y=C.siteDetails)||void 0===y?void 0:y.specificationRestrictedArea)||"N/A"},{title:t("NOC_IS_SITE_UNDER_MASTER_PLAN_LABEL"),value:(null==e||null===(D=e.nocDetails)||void 0===D||null===(L=D.additionalDetails)||void 0===L||null===(O=L.siteDetails)||void 0===O||null===(T=O.specificationIsSiteUnderMasterPlan)||void 0===T?void 0:T.code)||(null==e||null===(I=e.nocDetails)||void 0===I||null===(w=I.additionalDetails)||void 0===w||null===(P=w.siteDetails)||void 0===P?void 0:P.specificationIsSiteUnderMasterPlan)||"N/A"}];return{title:t("NOC_SPECIFICATION_DETAILS"),values:R}},Rt=(e,t)=>{var n,l,i,o,a,r,u,s,d,c,v,m;let p=[{title:t("COMMON_LATITUDE1_LABEL"),value:(null==e||null===(n=e.nocDetails)||void 0===n||null===(l=n.additionalDetails)||void 0===l||null===(i=l.coordinates)||void 0===i?void 0:i.Latitude1)||"N/A"},{title:t("COMMON_LONGITUDE1_LABEL"),value:(null==e||null===(o=e.nocDetails)||void 0===o||null===(a=o.additionalDetails)||void 0===a||null===(r=a.coordinates)||void 0===r?void 0:r.Longitude1)||"N/A"},{title:t("COMMON_LATITUDE2_LABEL"),value:(null==e||null===(u=e.nocDetails)||void 0===u||null===(s=u.additionalDetails)||void 0===s||null===(d=s.coordinates)||void 0===d?void 0:d.Latitude2)||"N/A"},{title:t("COMMON_LONGITUDE2_LABEL"),value:(null==e||null===(c=e.nocDetails)||void 0===c||null===(v=c.additionalDetails)||void 0===v||null===(m=v.coordinates)||void 0===m?void 0:m.Longitude2)||"N/A"}];return{title:t("NOC_SITE_COORDINATES_LABEL"),values:p}},xt=function(e,t){try{var n;function l(n){var l;return{title:t("NOC_TITILE_DOCUMENT_UPLOADED"),values:(null==e||null===(l=e.documents)||void 0===l?void 0:l.length)>0?e.documents.map((e,l)=>{let i=g(null==n?void 0:n.data,null==e?void 0:e.uuid);return{title:t((null==e?void 0:e.documentType)||t("CS_NA")),value:E(i,l)||t("CS_NA")}}):{title:t("PT_NO_DOCUMENTS"),value:" "}}}const i=null==e||null===(n=e.documents)||void 0===n?void 0:n.map(e=>null==e?void 0:e.uuid),o=(null==i?void 0:i.length)>0;return Promise.resolve(o?Promise.resolve(Digit.UploadServices.Filefetch(i,Digit.ULBService.getStateId())).then(l):l(o))}catch(e){return Promise.reject(e)}},Bt=function(e,t,n){try{var l;const i=Digit.ULBService.getStateId(),o=e||{};let a=[],r="";const u=(null==o||null===(l=o.documents)||void 0===l?void 0:l.find(e=>"OWNER.OWNERPHOTO"===(null==e?void 0:e.documentType)))||null;return Promise.resolve(Digit.UploadServices.Filefetch([(null==u?void 0:u.documentAttachment)||""],i)).then(function(e){var l,i,u,s,d;const c=null==e||null===(l=e.data)||void 0===l||null===(i=l.fileStoreIds)||void 0===i?void 0:i[0];return r=(null==c?void 0:c.url)||"",null!=o&&null!==(u=o.nocDetails)&&void 0!==u&&null!==(s=u.additionalDetails)&&void 0!==s&&null!==(d=s.applicationDetails)&&void 0!==d&&d.professionalName&&a.push(((e,t)=>{var n,l,i,o,a,r,u,s,d,c,v,m,p,f,E;let g=[{title:t("NOC_PROFESSIONAL_NAME_LABEL"),value:(null==e||null===(n=e.nocDetails)||void 0===n||null===(l=n.additionalDetails)||void 0===l||null===(i=l.applicationDetails)||void 0===i?void 0:i.professionalName)||"N/A"},{title:t("NOC_PROFESSIONAL_EMAIL_LABEL"),value:(null==e||null===(o=e.nocDetails)||void 0===o||null===(a=o.additionalDetails)||void 0===a||null===(r=a.applicationDetails)||void 0===r?void 0:r.professionalEmailId)||"N/A"},{title:t("NOC_PROFESSIONAL_REGISTRATION_ID_LABEL"),value:(null==e||null===(u=e.nocDetails)||void 0===u||null===(s=u.additionalDetails)||void 0===s||null===(d=s.applicationDetails)||void 0===d?void 0:d.professionalRegId)||"N/A"},{title:t("NOC_PROFESSIONAL_MOBILE_NO_LABEL"),value:(null==e||null===(c=e.nocDetails)||void 0===c||null===(v=c.additionalDetails)||void 0===v||null===(m=v.applicationDetails)||void 0===m?void 0:m.professionalMobileNumber)||"N/A"},{title:t("NOC_PROFESSIONAL_ADDRESS_LABEL"),value:(null==e||null===(p=e.nocDetails)||void 0===p||null===(f=p.additionalDetails)||void 0===f||null===(E=f.applicationDetails)||void 0===E?void 0:E.professionalAddress)||"N/A"}];return{title:t("NOC_PROFESSIONAL_DETAILS"),values:g}})(o,n)),{t:n,tenantId:null==t?void 0:t.code,name:n("NOC_ACKNOWLEDGEMENT_TITLE"),email:null==t?void 0:t.emailId,phoneNumber:null==t?void 0:t.contactNumber,heading:n("LOCAL_GOVERNMENT_PUNJAB"),applicationNumber:(null==o?void 0:o.applicationNo)||"NA",details:[Tt(o,n),...a,It(o,n),wt(o,n),Pt(o,n),Rt(o,n),xt(o,n)],imageURL:r}})}catch(e){return Promise.reject(e)}},Ft=e=>{var n,a,r;const u=i.useLocation(),{pathname:s,state:d}=u,{t:c}=o.useTranslation(),v=i.useHistory(),m=null==d||null===(n=d.data)||void 0===n||null===(a=n.Noc)||void 0===a?void 0:a[0];window.localStorage.getItem("Employee.tenant-id"),console.log("nocData in Response",m);const{data:f}=Digit.Hooks.useStore.getInitData(),{tenants:E}=f||{},g=s.split("/").pop();return l.createElement("div",null,l.createElement(t.Card,null,l.createElement(t.Banner,{message:c("NOC_APPLICATION_"+(null==m||null===(r=m.workflow)||void 0===r?void 0:r.action)+"_SUCCESS_HEADER"),applicationNumber:g,info:"REJECTED"==(null==m?void 0:m.applicationStatus)?"":c(p(null==m?void 0:m.nocType,".","_")+"_APPLICATION_NUMBER"),successful:"REJECTED"!=(null==m?void 0:m.applicationStatus),style:{padding:"10px"},headerStyles:{fontSize:"32px",wordBreak:"break-word"}}),"REJECTED"!==(null==m?void 0:m.applicationStatus)?l.createElement("div",null,l.createElement(t.SubmitBar,{style:{overflow:"hidden"},label:c("COMMON_DOWNLOAD"),onSubmit:function(){try{const e=m,t=E.find(t=>t.code===e.tenantId);return Promise.resolve(Bt(e,t,c)).then(function(e){Digit.Utils.pdf.generateBPAREG(e)})}catch(e){return Promise.reject(e)}}})):null,l.createElement(t.ActionBar,{style:{display:"flex",justifyContent:"flex-end",alignItems:"baseline"}},l.createElement(t.SubmitBar,{label:c("CORE_COMMON_GO_TO_HOME"),onSubmit:()=>{v.push("/digit-ui/employee")}}),l.createElement(t.SubmitBar,{label:c("CORE_COMMON_GO_TO_NOC"),onSubmit:()=>{v.push("/digit-ui/employee/noc/inbox")}}))))},Mt=e=>{let{location:n}=e;const{t:i}=o.useTranslation(),a=[{path:"/digit-ui/employee",content:i("ES_COMMON_HOME"),show:!0},{path:"/digit-ui/employee/noc/inbox",content:i("ES_COMMON_INBOX"),show:!!n.pathname.includes("noc/inbox")},{path:"/digit-ui/employee/noc/inbox/application-overview/:id",content:i("NOC_APPLICATION_OVERVIEW_HEADER"),show:!!n.pathname.includes("noc/inbox/application-overview")},{path:"/digit-ui/employee/noc/search",content:i("ES_COMMON_APPLICATION_SEARCH"),show:!!n.pathname.includes("/digit-ui/employee/noc/search")},{path:"/digit-ui/employee/noc/search/application-overview/:id",content:i("NOC_APP_OVER_VIEW_HEADER"),show:!!n.pathname.includes("/digit-ui/employee/noc/search/application-overview")}];return l.createElement(t.BreadCrumb,{crumbs:a})},Ut=e=>{var a,r,u,s,d,v,m,p,f,E;let{path:g}=e;const _=i.useLocation(),h=(o.useTranslation(),null===(a=Digit)||void 0===a||null===(r=a.ComponentRegistryService)||void 0===r?void 0:r.getComponent("NOCApplicationOverview")),A=null===(u=Digit)||void 0===u||null===(s=u.ComponentRegistryService)||void 0===s?void 0:s.getComponent("NOCInbox"),S=null===(d=Digit)||void 0===d||null===(v=d.ComponentRegistryService)||void 0===v?void 0:v.getComponent("NewNOCStepperForm"),N=null===(m=Digit)||void 0===m||null===(p=m.ComponentRegistryService)||void 0===p?void 0:p.getComponent("NOCEmployeeApplicationOverview"),b=null===(f=Digit)||void 0===f||null===(E=f.ComponentRegistryService)||void 0===E?void 0:E.getComponent("NewNOCEditApplication"),C=window.location.href.includes("/response"),y=window.Digit.Utils.browser.isMobile();return l.createElement(n.Fragment,null,C?null:l.createElement("div",{style:window.location.href.includes("application-overview")||y?{marginLeft:"10px"}:{}},l.createElement(Mt,{location:_})),l.createElement(i.Switch,null,l.createElement(t.PrivateRoute,{path:g+"/inbox/application-overview/:id",component:N}),l.createElement(t.PrivateRoute,{path:g+"/search/application-overview/:id",component:h}),l.createElement(t.PrivateRoute,{path:g+"/new-application",component:S}),l.createElement(t.PrivateRoute,{path:g+"/edit-application/:id",component:b}),l.createElement(t.PrivateRoute,{path:g+"/inbox",component:e=>l.createElement(A,c({},e,{parentRoute:g}))}),l.createElement(t.PrivateRoute,{path:g+"/search",component:e=>l.createElement(Lt,c({},e,{parentRoute:g}))}),l.createElement(t.PrivateRoute,{path:g+"/response/:id",component:Ft})))};function kt(e,t){try{var n=e()}catch(e){return t(e)}return n&&n.then?n.then(void 0,t):n}"undefined"!=typeof Symbol&&(Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator"))),"undefined"!=typeof Symbol&&(Symbol.asyncIterator||(Symbol.asyncIterator=Symbol("Symbol.asyncIterator")));const Wt=e=>{const[t,i]=n.useState(e.selectedVal?e.selectedVal:"");return n.useEffect(()=>{e.keepNull?i(""):e.selectedVal?i(e.selectedVal):(i(""),e.setFilter(""))},[e.selectedVal,e.forceSet]),l.createElement("input",{ref:e.inputRef,className:"employee-select-wrap--elipses "+(e.disable&&"disabled"),type:"text",value:t,onChange:function(t){e.freeze||(i(t.target.value),e.setFilter(t.target.value))},onClick:e.onClick,onFocus:function(){e.disable||e.dropdownDisplay(!0)},onBlur:t=>{var n;e.dropdownDisplay(!1),null==e||null===(n=e.onBlur)||void 0===n||n.call(e,t),e.selectedVal!==e.filterVal&&setTimeout(()=>{e.setforceSet(e=>e+1)},1e3)},onKeyDown:t=>{var n,l,i,o,a,r,u,s,d,c,v,m,p;if("ArrowDown"==t.key)e.setOptionIndex(t=>t+1==e.addProps.length?0:t+1),e.addProps.currentIndex+1==e.addProps.length?null==t||null===(n=t.target)||void 0===n||null===(l=n.parentElement)||void 0===l||null===(i=l.parentElement)||void 0===i||null===(o=i.children)||void 0===o||null===(a=o.namedItem("jk-dropdown-unique"))||void 0===a||null===(r=a.scrollTo)||void 0===r||r.call(a,0,0):(null==e||null===(u=e.addProps)||void 0===u?void 0:u.currentIndex)>2&&(null==t||null===(s=t.target)||void 0===s||null===(d=s.parentElement)||void 0===d||null===(c=d.parentElement)||void 0===c||null===(v=c.children)||void 0===v||null===(m=v.namedItem("jk-dropdown-unique"))||void 0===m||null===(p=m.scrollBy)||void 0===p||p.call(m,0,45)),t.preventDefault();else if("ArrowUp"==t.key){var f,E,g,_,h,A,S,N,b,C,y,D,L;e.setOptionIndex(t=>0!==t?t-1:e.addProps.length-1),0==e.addProps.currentIndex?null==t||null===(f=t.target)||void 0===f||null===(E=f.parentElement)||void 0===E||null===(g=E.parentElement)||void 0===g||null===(_=g.children)||void 0===_||null===(h=_.namedItem("jk-dropdown-unique"))||void 0===h||null===(A=h.scrollTo)||void 0===A||A.call(h,1e5,1e5):(null==e||null===(S=e.addProps)||void 0===S?void 0:S.currentIndex)>2&&(null==t||null===(N=t.target)||void 0===N||null===(b=N.parentElement)||void 0===b||null===(C=b.parentElement)||void 0===C||null===(y=C.children)||void 0===y||null===(D=y.namedItem("jk-dropdown-unique"))||void 0===D||null===(L=D.scrollBy)||void 0===L||L.call(D,0,-45)),t.preventDefault()}else"Enter"==t.key&&e.addProps.selectOption(e.addProps.currentIndex)},readOnly:e.disable,autoFocus:e.autoFocus,placeholder:e.placeholder,autoComplete:"off",style:c({},e.style,{zIndex:"auto"})})},Ht=e=>e,jt=e=>{var i,o,a;const r=Digit.SessionStorage.get("userType"),[u,s]=n.useState(!1),[d,v]=n.useState(e.selected?e.selected:null),[m,p]=n.useState(""),[f,E]=n.useState(0),[g,_]=n.useState(-1),h=n.useRef(null),A=!!e.customSelector,S=e.t||Ht;function N(){if(!e.disable){var t,n=u;n||document.addEventListener("mousedown",b,!1),s(!n),null==e||null===(t=e.onBlur)||void 0===t||t.call(e)}}function b(e){h.current&&h.current.contains(e.target)||(document.removeEventListener("mousedown",b,!1),s(!1))}function C(t){t!==d||e.allowMultiselect?(e.select(t),v(t),s(!1)):(v(t),E(f+1))}n.useEffect(()=>{v(e.selected)},[e.selected]),console.log("option",e.option);let y=e.option&&(null===(i=e.option)||void 0===i?void 0:i.filter(t=>{var n,l;return(null===(n=S(t[e.optionKey]))||void 0===n||null===(l=n.toUpperCase())||void 0===l?void 0:l.indexOf(null==m?void 0:m.toUpperCase()))>-1}))||[];var D,L;return"PropertyType"==(null==e||null===(o=e.option)||void 0===o||null===(a=o[0])||void 0===a?void 0:a.label)&&(y=e.option),e.isBPAREG&&d&&((null===(D=e.option)||void 0===D||null===(L=D.filter(e=>(null==e?void 0:e.code)===(null==d?void 0:d.code)))||void 0===L?void 0:L.length)>0||v(null)),l.createElement("div",{className:("employee"===r?"employee-select-wrap":"select-wrap")+" "+(null!=e&&e.className?null==e?void 0:e.className:""),style:c({},e.style)},A&&l.createElement("div",{className:e.showArrow?"cp flex-right column-gap-5":"cp",onClick:N},e.customSelector,e.showArrow&&l.createElement(t.ArrowDown,{onClick:N,className:e.disable&&"disabled"})),!A&&l.createElement("div",{className:(u?"select-active":"select")+" "+(e.disable&&"disabled"),style:e.errorStyle?{border:"1px solid red"}:{}},l.createElement(Wt,{autoComplete:e.autoComplete,setFilter:function(e){p(e)},forceSet:f,setforceSet:E,setOptionIndex:_,keepNull:e.keepNull,selectedVal:d?e.t?e.isMultiSelectEmp?d+" "+S("BPA_SELECTED_TEXT"):e.t(e.optionKey?d[e.optionKey]:d):e.optionKey?d[e.optionKey]:d:null,filterVal:m,addProps:{length:y.length,currentIndex:g,selectOption:function(e){C(y[e])}},dropdownDisplay:function(e){const t=setTimeout(()=>s(e),500);return()=>{clearTimeout(t)}},handleClick:b,disable:e.disable,freeze:!!e.freeze,autoFocus:e.autoFocus,placeholder:e.placeholder,onBlur:null==e?void 0:e.onBlur,inputRef:e.ref}),l.createElement(t.ArrowDown,{onClick:N,className:"cp",disable:e.disable})),u?e.optionKey?l.createElement("div",{id:"jk-dropdown-unique",className:(A?"margin-top-10 display: table":"")+" options-card",style:c({},e.optionCardStyles),ref:h},y&&y.map((t,n)=>(console.log("option",t),l.createElement("div",{className:"cp profile-dropdown--item display: flex ",style:n===g?{opacity:1,backgroundColor:"rgba(238, 238, 238, var(--bg-opacity))"}:{},key:n,onClick:()=>C(t)},t.icon&&l.createElement("span",{className:"icon"}," ",t.icon," "),e.isPropertyAssess?l.createElement("div",null,e.t?e.t(t[e.optionKey]):t[e.optionKey]):l.createElement("span",null," ",e.t?e.t(t[e.optionKey]):t[e.optionKey]),l.createElement("div",null,"(",e.t("COMMON_MASTERS_DESIGNATION_"+t.designation),")")))),y&&0===y.length&&l.createElement("div",{className:"cp profile-dropdown--item display: flex ",key:"-1",onClick:()=>{}},l.createElement("span",null," ",e.t?e.t("CMN_NOOPTION"):"CMN_NOOPTION"))):l.createElement("div",{className:"options-card",style:c({},e.optionCardStyles,{overflow:"scroll",maxHeight:"350px"}),id:"jk-dropdown-unique",ref:h},e.option.filter(e=>(null==e?void 0:e.toUpperCase().indexOf(null==m?void 0:m.toUpperCase()))>-1).map((e,t)=>l.createElement("p",{key:t,style:t===g?{opacity:1,backgroundColor:"rgba(238, 238, 238, var(--bg-opacity))"}:{},onClick:()=>C(e)},e))):null)},zt=e=>l.createElement("h1",{className:"heading-m"},e.label),Vt=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),Gt=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(Vt,null)),Yt=e=>{var i,o;let{t:a,action:r,tenantId:u,closeModal:s,submitAction:d,applicationData:v,businessService:m,moduleCode:p}=e;const{data:f,isLoading:E}=Digit.Hooks.useEmployeeSearch(u,{roles:null==r||null===(i=r.assigneeRoles)||void 0===i||null===(o=i.map)||void 0===o?void 0:o.call(i,e=>({code:e})),isActive:!0},{enabled:!(null!=r&&r.isTerminateState)}),{isLoading:g,data:_}=Digit.Hooks.pt.useMDMS(u,m,"FINANCIAL_YEARLS",{},{details:{tenantId:Digit.ULBService.getStateId(),moduleDetails:[{moduleName:"egf-master",masterDetails:[{name:"FinancialYear",filter:"[?(@.module == 'PT')]"}]}]}}),[h,A]=n.useState({}),[S,N]=n.useState({}),[b,C]=n.useState([]),[y,D]=n.useState(null),[L,O]=n.useState(null),[T,I]=n.useState(null),[w,P]=n.useState(null),[R,x]=n.useState([]),[B,F]=n.useState(null),[M,U]=n.useState(!1);function k(e){O(e.target.files[0])}return n.useEffect(()=>{var e;_&&_["egf-master"]&&x(null===(e=_["egf-master"])||void 0===e?void 0:e.FinancialYear)},[_]),n.useEffect(()=>{var e;C(null==f||null===(e=f.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[f]),n.useEffect(()=>{!function(){try{P(null);const e=function(){if(L){const e=function(){if(L.size>=5242880)P(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=kt(function(){return Promise.resolve(Digit.UploadServices.Filestorage("PT",L,Digit.ULBService.getStateId())).then(function(e){var t,n,l,i;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?I(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):P(a("CS_FILE_UPLOAD_ERROR"))})},function(){P(a("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[L]),n.useEffect(()=>{r&&A(null!=r&&r.showFinancialYearsModal?(e=>{let{t:n,action:i,financialYears:o,selectedFinancialYear:a,setSelectedFinancialYear:r}=e;return{label:{heading:"WF_"+i.action+"_APPLICATION",submit:"WF_PT.CREATE_"+i.action,cancel:"ES_PT_COMMON_CANCEL"},form:[{body:[{label:n("ES_PT_FINANCIAL_YEARS"),isMandatory:!0,type:"radio",populators:l.createElement(t.RadioButtons,{options:o,optionsKey:"name",onSelect:r,selectedOption:a})}]}]}})({t:a,action:r,financialYears:R,selectedFinancialYear:B,setSelectedFinancialYear:F}):(e=>{var n;let{t:i,action:o,approvers:a,selectedApprover:r,setSelectedApprover:u,selectFile:s,uploadedFile:d,setUploadedFile:c,assigneeLabel:v,businessService:m}=e;return{label:{heading:"WF_"+(null==o?void 0:o.action)+"_APPLICATION",submit:"WF_"+m+"_"+(null==o?void 0:o.action),cancel:"ES_PT_COMMON_CANCEL"},form:[{body:[{label:o.isTerminateState||"SENDBACKTOCITIZEN"===(null==o?void 0:o.action)?null:i(v||"WF_ROLE_"+(null===(n=o.assigneeRoles)||void 0===n?void 0:n[0])),type:"dropdown",populators:o.isTerminateState||"SENDBACKTOCITIZEN"===(null==o?void 0:o.action)?null:l.createElement(t.Dropdown,{option:a,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:u,selected:r})},{label:i("ES_PT_ACTION_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:i("ES_PT_ATTACH_FILE")+(o.docUploadRequired?" *":""),populators:l.createElement(t.UploadFile,{id:"workflow-doc",onUpload:s,onDelete:()=>{c(null)},showHint:!0,hintText:i("PT_ATTACH_RESTRICTIONS_SIZE"),message:d?"1 "+i("ES_PT_ACTION_FILEUPLOADED"):i("ES_PT_ACTION_NO_FILEUPLOADED")})}]}]}})({t:a,action:r,approvers:b,selectedApprover:y,setSelectedApprover:D,selectFile:k,uploadedFile:T,setUploadedFile:I,businessService:m}))},[r,b,R,B,T]),r&&h.form?l.createElement(t.Modal,{headerBarMain:l.createElement(zt,{label:a(h.label.heading)}),headerBarEnd:l.createElement(Gt,{onClick:s}),actionCancelLabel:a(h.label.cancel),actionCancelOnSubmit:s,actionSaveLabel:a(h.label.submit),actionSaveOnSubmit:()=>{},isDisabled:r.showFinancialYearsModal?!B:E||(null==r?void 0:r.docUploadRequired)&&!T,formId:"modal-action"},g?l.createElement(t.Loader,null):l.createElement(t.FormComposer,{config:h.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){if("INACTIVE_PROPERTY"==(null==r?void 0:r.action)){let t={action:"OPEN",comment:null==e?void 0:e.comments,businessService:"PT.CREATE",moduleName:"PT"};v.creationReason="STATUS",d({customFunctionToExecute:null==r?void 0:r.customFunctionToExecute,Property:c({},v,{workflow:t})})}else if(null!=r&&r.showFinancialYearsModal)d({customFunctionToExecute:null==r?void 0:r.customFunctionToExecute,Assessment:{financialYear:null==B?void 0:B.name,propertyId:null==v?void 0:v.propertyId,tenantId:u,source:null==v?void 0:v.source,channel:null==v?void 0:v.channel,assessmentDate:Date.now()}});else{let t={action:null==r?void 0:r.action,comment:null==e?void 0:e.comments,businessService:m,moduleName:p};t.assignes=null!=r&&r.isTerminateState||!y?[]:[y],T&&(t.documents=[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==L?void 0:L.name,fileStoreId:T}]),d({Property:c({},v,{workflow:t})})}},defaultValues:S,formId:"modal-action"})):l.createElement(t.Loader,null)},Kt=e=>l.createElement("h1",{className:"heading-m"},e.label),qt=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),Xt=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(qt,null)),Jt=e=>{var i,o;let{t:a,action:r,tenantId:u,closeModal:s,submitAction:d,applicationData:v,businessService:m}=e;console.log("ActionModalActions: ",r);const{data:p}=Digit.Hooks.useEmployeeSearch(u,{roles:null==r||null===(i=r.assigneeRoles)||void 0===i||null===(o=i.map)||void 0===o?void 0:o.call(i,e=>({code:e})),isActive:!0},{enabled:!(null!=r&&r.isTerminateState)}),{isLoading:f,data:E}=Digit.Hooks.pt.useMDMS(u,m,"FINANCIAL_YEARLS",{},{details:{tenantId:Digit.ULBService.getStateId(),moduleDetails:[{moduleName:"egf-master",masterDetails:[{name:"FinancialYear",filter:"[?(@.module == 'TL')]"}]}]}}),[g,_]=n.useState({}),[h,A]=n.useState({}),[S,N]=n.useState([]),[b,C]=n.useState({}),[y,D]=n.useState(null),[L,O]=n.useState(null),[T,I]=n.useState(null),[w,P]=n.useState([]),[R,x]=n.useState(null);n.useEffect(()=>{var e;E&&E["egf-master"]&&P(null===(e=E["egf-master"])||void 0===e?void 0:e.FinancialYear)},[E]);const{data:B}=Digit.Hooks.useCustomMDMS(u,"common-masters",[{name:"Department"}]);function F(e){D(e.target.files[0])}return n.useEffect(()=>{if(p&&B){var e;const t=B["common-masters"].Department;N(null==p||null===(e=p.Employees)||void 0===e?void 0:e.map(e=>{var n,l,i;const o=null==e||null===(n=e.assignments)||void 0===n||null===(l=n[0])||void 0===l?void 0:l.department,a=null==t?void 0:t.find(e=>(null==e?void 0:e.code)===o);return console.log("matchedDept===",a),{uuid:null==e?void 0:e.uuid,name:(null==e||null===(i=e.user)||void 0===i?void 0:i.name)+" - "+(null==a?void 0:a.name)}}))}},[p]),n.useEffect(()=>{!function(){try{I(null);const e=function(){if(y){const e=function(){if(y.size>=5242880)I(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=kt(function(){return Promise.resolve(Digit.UploadServices.Filestorage("PT",y,Digit.ULBService.getStateId())).then(function(e){var t,n,l,i;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?O(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):I(a("CS_FILE_UPLOAD_ERROR"))})},function(){I(a("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[y]),n.useEffect(()=>{r&&_((e=>{let{t:n,action:i,approvers:o,selectedApprover:a,setSelectedApprover:r,selectFile:u,uploadedFile:s,setUploadedFile:d,businessService:c}=e,v=!0;return"SENDBACKTOCITIZEN"!=(null==i?void 0:i.action)&&"APPROVE"!=(null==i?void 0:i.action)||(v=!1),i.isTerminateState&&(v=!1),{label:{heading:"WF_"+(null==i?void 0:i.action)+"_APPLICATION",submit:"WF_"+(null==c?void 0:c.toUpperCase())+"_"+(null==i?void 0:i.action),cancel:"WF_EMPLOYEE_NEWTL_CANCEL"},form:[{body:[{label:v?n("WF_ASSIGNEE_NAME_LABEL"):null,placeholder:v?n("WF_ASSIGNEE_NAME_PLACEHOLDER"):null,type:"dropdown",populators:v?l.createElement(t.Dropdown,{option:o,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:r,selected:a}):null},{label:n("WF_COMMON_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:n("TL_APPROVAL_CHECKLIST_BUTTON_UP_FILE"),populators:l.createElement(t.UploadFile,{id:"workflow-doc",onUpload:u,onDelete:()=>{d(null)},message:s?"1 "+n("ES_PT_ACTION_FILEUPLOADED"):n("CS_ACTION_NO_FILEUPLOADED")})}]}]}})({t:a,action:r,approvers:S,selectedApprover:b,setSelectedApprover:C,selectFile:F,uploadedFile:L,setUploadedFile:O,businessService:m}))},[r,S,w,R,L]),r&&g.form?l.createElement(t.Modal,{headerBarMain:l.createElement(Kt,{label:a(g.label.heading)}),headerBarEnd:l.createElement(Xt,{onClick:s}),actionCancelLabel:a(g.label.cancel),actionCancelOnSubmit:s,actionSaveLabel:a(g.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},f?l.createElement(t.Loader,null):l.createElement(t.FormComposer,{config:g.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){v=c({},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:L?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==y?void 0:y.name,fileStoreId:L}]:null}),d({Licenses:[v]})},defaultValues:h,formId:"modal-action"})):l.createElement(t.Loader,null)},Qt=e=>l.createElement("h1",{style:{marginLeft:"22px"},className:"heading-m BPAheading-m"},e.label),Zt=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),$t=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(Zt,null)),en=e=>{var i,o;let{t:a,action:r,tenantId:u,closeModal:s,submitAction:d,applicationData:v,businessService:m}=e;const{data:p,isLoading:f}=Digit.Hooks.useEmployeeSearch(u,{roles:null==r||null===(i=r.assigneeRoles)||void 0===i||null===(o=i.map)||void 0===o?void 0:o.call(i,e=>({code:e})),isActive:!0},{enabled:!(null!=r&&r.isTerminateState)});console.log(p,"DEKHO");const[E,g]=n.useState({}),[_,h]=n.useState({}),[A,S]=n.useState([]),[N,b]=n.useState({}),[C,y]=n.useState(null),[D,L]=n.useState(null),[O,T]=n.useState(null),I=!!Digit.Utils.browser.isMobile();function w(e){y(e.target.files[0])}return n.useEffect(()=>{var e;S(null==p||null===(e=p.Employees)||void 0===e?void 0:e.map(e=>{var t,n,l,i,o,r;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name,designation:(null==e||null===(n=e.assignments)||void 0===n||null===(l=n[0])||void 0===l?void 0:l.designation)||"N/A",displayName:(null==e||null===(i=e.user)||void 0===i?void 0:i.name)+" ("+(a(null==e||null===(o=e.assignments)||void 0===o||null===(r=o[0])||void 0===r?void 0:r.designation)||"N/A")+")"}}))},[p]),n.useEffect(()=>{!function(){try{T(null);const e=function(){if(C){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(C.size>=5242880)T(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=C&&C.type&&!e.test(null==C?void 0:C.type))T(a("NOT_SUPPORTED_FILE_TYPE"));else{const e=kt(function(){return Promise.resolve(Digit.UploadServices.Filestorage("OBPS",C,Digit.ULBService.getStateId()||(null==u?void 0:u.split(".")[0]))).then(function(e){var t,n,l,i;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?L(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):T(a("CS_FILE_UPLOAD_ERROR"))})},function(){T(a("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[C]),n.useEffect(()=>{r&&g((e=>{let{t:n,action:i,approvers:o,selectedApprover:a,setSelectedApprover:r,selectFile:u,uploadedFile:s,setUploadedFile:d,businessService:c,error:v}=e,m=!0;return"SENDBACKTOCITIZEN"!=(null==i?void 0:i.action)&&"SEND_BACK_TO_CITIZEN"!=(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==c?void 0:c.toUpperCase())+"_"+(null==i?void 0:i.action),cancel:"WF_EMPLOYEE_BPAREG_CANCEL"},form:[{body:[{label:m?n("WF_ASSIGNEE_NAME_LABEL")+"*":null,placeholder:m?n("WF_ASSIGNEE_NAME_PLACEHOLDER"):null,type:"dropdown",populators:m?l.createElement(jt,{option:o,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:r,selected:a,t:n}):null},{label:n("WF_COMMON_COMMENTS")+"*",type:"textarea",populators:{name:"comments"}},{label:n("BPA_APPROVAL_CHECKLIST_BUTTON_UP_FILE"),populators:l.createElement(t.UploadFile,{id:"workflow-doc",onUpload:u,onDelete:()=>{d(null)},message:s?"1 "+n("ES_PT_ACTION_FILEUPLOADED"):n("CS_ACTION_NO_FILEUPLOADED"),accept:"image/*, .pdf, .png, .jpeg, .jpg",iserror:v})}]}]}})({t:a,action:r,approvers:A,selectedApprover:N,setSelectedApprover:b,selectFile:w,uploadedFile:D,setUploadedFile:L,businessService:m,error:O}))},[r,A,D,O]),r&&E.form?l.createElement(t.Modal,{headerBarMain:l.createElement(Qt,{label:a(E.label.heading)}),headerBarEnd:l.createElement($t,{onClick:s}),actionCancelLabel:a(E.label.cancel),actionCancelOnSubmit:s,actionSaveLabel:a(E.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action",isOBPSFlow:!0,popupStyles:I?{width:"720px"}:{},style:I?{height:"45px",width:"44%"}:{height:"45px",width:"107px",paddingLeft:"0px",paddingRight:"0px"},popupModuleMianStyles:I?{paddingLeft:"5px"}:{}},f?l.createElement(t.Loader,null):l.createElement(t.FormComposer,{config:E.form,cardStyle:{marginLeft:"0px",marginRight:"0px",marginTop:"-25px"},className:"BPAemployeeCard",noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){v=c({},v,{action:null==r?void 0:r.action,comment:null==e?void 0:e.comments,assignee:null!=N&&N.uuid?[null==N?void 0:N.uuid]:null,wfDocuments:D?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==C?void 0:C.name,fileStoreId:D}]:null}),console.log("action",r),console.log("applicationData",v),d({Licenses:[v]},!1,{isStakeholder:!0,bpa:!1})},defaultValues:_,formId:"modal-action"})):l.createElement(t.Loader,null)},tn=e=>l.createElement("h1",{style:{marginLeft:"22px"},className:"heading-m BPAheading-m"},e.label),nn=()=>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"})),ln=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(nn,null)),on=e=>{var i,o,a,u,s,d,v,m,p,f,E;let{t:g,action:_,tenantId:h,closeModal:A,submitAction:S,applicationDetails:N,applicationData:b,businessService:C,workflowDetails:y,blockReason:D}=e;console.log("applicationData_BPAACTIONMODAL",b);const L=[...new Set(null==y||null===(i=y.data)||void 0===i||null===(o=i.initialActionState)||void 0===o||null===(a=o.nextActions)||void 0===a||null===(u=a.find(e=>(null==e?void 0:e.action)===(null==_?void 0:_.action)))||void 0===u||null===(s=u.actions)||void 0===s?void 0:s.flatMap(e=>e.roles||[]))];console.log("workflowDetails_BPAACTIONMODAL",y,L,_),Digit.Hooks.obps.useObpsAPI(null!==(d=b)&&void 0!==d&&null!==(v=d.landInfo)&&void 0!==v&&null!==(m=v.address)&&void 0!==m&&m.city?null===(p=b)||void 0===p||null===(f=p.landInfo)||void 0===f||null===(E=f.address)||void 0===E?void 0:E.city:h,!1);const{data:O,isLoading:T}=Digit.Hooks.useEmployeeSearch(h,{roles:null==L?void 0:L.map(e=>({code:e})),isActive:!0},{enabled:!(null!=_&&_.isTerminateState)});console.log("approverData",O),r.useQueryClient();const[I,w]=n.useState({}),[P,R]=n.useState({}),[x,B]=n.useState([]),[F,M]=n.useState([]),[U,k]=n.useState({}),[W,H]=n.useState({}),[j,z]=n.useState(null),[V,G]=n.useState(null),[Y,K]=n.useState(null),[q,X]=n.useState(null),J=!!Digit.Utils.browser.isMobile();function Q(e){z(e.target.files[0])}n.useEffect(()=>{var e;B(null==O||null===(e=O.Employees)||void 0===e?void 0:e.map(e=>{var t,n,l;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name,designation:null==e||null===(n=e.assignments)||void 0===n||null===(l=n[0])||void 0===l?void 0:l.designation}}))},[O]),n.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=kt(function(){return Promise.resolve(Digit.UploadServices.Filestorage("OBPS",j,Digit.ULBService.getStateId()||(null==h?void 0:h.split(".")[0]))).then(function(e){var t,n,l,i;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?G(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):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,n)=>{t.push({documentType:(e.documentType+"_"+e.documentType.split("_")[1]).replaceAll("_","."),fileStoreId:e.fileStoreId,fileStore:e.fileStoreId,fileName:"",dropDownValues:{value:(e.documentType+"_"+e.documentType.split("_")[1]).replaceAll("_",".")}})}),t},$=e=>{let t=[];var n;for(n=0;n<(null==e?void 0:e.questionLength);n++){var l;t.push({remarks:e["Remarks_"+n],question:null==e?void 0:e.questionList[n].question,value:null==e||null===(l=e["question_"+n])||void 0===l?void 0:l.code})}return t},ee=e=>{var t,n;let l=[],i=[];var o,a;return(null==e||null===(t=e.additionalDetails)||void 0===t||null===(n=t.fieldinspection_pending)||void 0===n?void 0:n.length)>0&&(i=null==e||null===(o=e.additionalDetails)||void 0===o?void 0:o.fieldinspection_pending),i=i.filter(e=>{if(!e.date)return!1;const t=new Date;return new Date(e.date)<=t}),"FIELDINSPECTION_INPROGRESS"==e.status?(l=JSON.parse(sessionStorage.getItem("INSPECTION_DATA")),(null===(a=l)||void 0===a?void 0:a.length)>0&&l.map((e,t)=>{i.push({docs:Z(e.Documents),date:e.InspectionDate,questions:$(e),time:null==e?void 0:e.InspectionTime})}),console.log("FIELDINSPECTION_INPROGRESS",i),i=i.filter(e=>e.date&&e.time),console.log("inspectionObinspectionOb",i)):sessionStorage.removeItem("INSPECTION_DATA"),[...i]},te=()=>{var e;const t=Digit.SessionStorage.get("OBPS_APPROVAL_CHECKS"),n=Digit.SessionStorage.get("OBPS_NEW_APPROVALS");let l=null==t?void 0:t.reduce((e,t)=>null!=t&&t.checked?e.push(null==t?void 0:t.label)&&e:e,[]);return l=null===(e=l)||void 0===e?void 0:e.concat(null!==n?n.filter(e=>""!==e.label).map(e=>null==e?void 0:e.label):[]),l};return n.useEffect(()=>{M(null==D?void 0:D.map(e=>({code:null==e?void 0:e.code,name:null==e?void 0:e.value}))),_&&w((e=>{var n;let{t:i,action:o,approvers:a,selectedApprover:r,setSelectedApprover:u,selectedBlockReason:s,setBlockReason:d,selectFile:c,uploadedFile:v,setUploadedFile:m,assigneeLabel:p,businessService:f,error:E,blockReasonFiltered:g}=e,_=!1;return"REVOCATE"!=(null==o?void 0:o.action)&&"REJECT"!=(null==o?void 0:o.action)&&"SKIP_PAYMENT"!=o.action&&"SEND_BACK_TO_CITIZEN"!=(null==o?void 0:o.action)&&"APPROVE"!=(null==o?void 0:o.action)||(_=!0),console.log("actionInModal",o),{label:{heading:"WF_"+(null==o?void 0:o.action)+"_APPLICATION",submit:"WF_"+f+"_"+(null==o?void 0:o.action),cancel:"BPA_CITIZEN_CANCEL_BUTTON"},form:[{body:[{label:o.isTerminateState||_||"BLOCK"==(null==o?void 0:o.action)||"VERIFY"==(null==o?void 0:o.action)||"SEND_FOR_INSPECTION_REPORT"==(null==o?void 0:o.action)?null:i(p||"WF_ROLE_"+(null===(n=o.assigneeRoles)||void 0===n?void 0:n[0])),type:"dropdown",populators:o.isTerminateState||_||"BLOCK"==(null==o?void 0:o.action)||"VERIFY"==(null==o?void 0:o.action)||"SEND_FOR_INSPECTION_REPORT"==(null==o?void 0:o.action)?null:l.createElement(jt,{option:a,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:u,selected:r,t:i})},{label:"BLOCK"==(null==o?void 0:o.action)?i("BLOCK_REASON"):null,type:"dropdown",populators:"BLOCK"==(null==o?void 0:o.action)?l.createElement(t.Dropdown,{option:g,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:d,selected:s,isMandatory:!0}):null},{label:i("WF_COMMON_COMMENTS"),type:"textarea",isMandatory:!0,populators:{name:"comments"}},{label:""+i("WF_APPROVAL_UPLOAD_HEAD"),populators:l.createElement(t.UploadFile,{id:"workflow-doc",onUpload:c,onDelete:()=>{m(null)},message:v?"1 "+i("ES_PT_ACTION_FILEUPLOADED"):i("CS_ACTION_NO_FILEUPLOADED"),accept:"image/*, .pdf, .png, .jpeg, .jpg",iserror:E})}]}]}})({t:g,action:_,approvers:x,selectedApprover:U,setSelectedApprover:k,selectedBlockReason:W,setBlockReason:H,selectFile:Q,uploadedFile:V,setUploadedFile:G,businessService:C,assigneeLabel:"WF_ASSIGNEE_NAME_LABEL_BPA",error:Y,blockReasonFiltered:F}))},[_,x,q,V,Y]),_&&I.form?l.createElement(t.Modal,{headerBarMain:l.createElement(tn,{label:g(I.label.heading)}),headerBarEnd:l.createElement(ln,{onClick:A}),actionCancelLabel:g(I.label.cancel),actionCancelOnSubmit:A,actionSaveLabel:g(I.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action",isOBPSFlow:!0,popupStyles:J?{width:"720px"}:{},style:J?{minHeight:"45px",height:"auto",width:"44%"}:{minHeight:"45px",height:"auto",width:"107px",paddingLeft:"0px",paddingRight:"0px"},popupModuleMianStyles:J?{paddingLeft:"5px"}:{}},T?l.createElement(t.Loader,null):l.createElement(t.FormComposer,{config:I.form,cardStyle:{marginLeft:"0px",marginRight:"0px",marginTop:"-25px"},className:"BPAemployeeCard",noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){try{var t,n,l,i,o,a,r,u,s,d,v,m,p,f,E,h,C,D,L,O,T,I,w,P,R,x,B,F,M,k,H,z,G,Y,K,q,X,J,Q,Z,$,ne;if(b=c({},b,{documents:null===(t=b)||void 0===t?void 0:t.documents,additionalDetails:c({},null===(n=b)||void 0===n?void 0:n.additionalDetails,{fieldinspection_pending:ee(b),pendingapproval:te(),blockingReason:null==W?void 0:W.name}),workflow:{action:null==_?void 0:_.action,comment:(null==e||null===(l=e.comments)||void 0===l?void 0:l.length)>0?null!=W&&W.name?(null==W?void 0:W.name)+" - "+(null==e?void 0:e.comments):null==e?void 0:e.comments:null,comments:(null==e||null===(i=e.comments)||void 0===i?void 0:i.length)>0?null!=W&&W.name?(null==W?void 0:W.name)+" - "+(null==e?void 0:e.comments):null==e?void 0:e.comments:null,assignee:"FIELDINSPECTION_INPROGRESS"===(null==y||null===(o=y.data)||void 0===o||null===(a=o.processInstances)||void 0===a||null===(r=a[0])||void 0===r||null===(u=r.state)||void 0===u?void 0:u.applicationStatus)?[null==y||null===(s=y.data)||void 0===s||null===(d=s.processInstances)||void 0===d||null===(v=d[0])||void 0===v||null===(m=v.assigner)||void 0===m?void 0:m.uuid]:null!=U&&U.uuid?[null==U?void 0:U.uuid]:null,assignes:"FIELDINSPECTION_INPROGRESS"===(null==y||null===(p=y.data)||void 0===p||null===(f=p.processInstances)||void 0===f||null===(E=f[0])||void 0===E||null===(h=E.state)||void 0===h?void 0:h.applicationStatus)?[null==y||null===(C=y.data)||void 0===C||null===(D=C.processInstances)||void 0===D||null===(L=D[0])||void 0===L||null===(O=L.assigner)||void 0===O?void 0:O.uuid]:null!=U&&U.uuid?[null==U?void 0:U.uuid]:null,varificationDocuments:V?[{documentType:(null==_?void 0:_.action)+" DOC",fileName:null==j?void 0:j.name,fileStoreId:V}]:null},action:null==_?void 0:_.action,riskType:null===(T=b)||void 0===T||null===(I=T.additionalDetails)||void 0===I?void 0:I.riskType,comment:null==e?void 0:e.comments,assignee:"FIELDINSPECTION_INPROGRESS"===(null==y||null===(w=y.data)||void 0===w||null===(P=w.processInstances)||void 0===P||null===(R=P[0])||void 0===R||null===(x=R.state)||void 0===x?void 0:x.applicationStatus)?[null==y||null===(B=y.data)||void 0===B||null===(F=B.processInstances)||void 0===F||null===(M=F[0])||void 0===M||null===(k=M.assigner)||void 0===k?void 0:k.uuid]:null!=U&&U.uuid?[null==U?void 0:U.uuid]:null,wfDocuments:V?[{documentType:(null==_?void 0:_.action)+" DOC",fileName:null==j?void 0:j.name,fileStoreId:V}]:null}),parseInt(sessionStorage.getItem("lessAdjusment"))>parseInt(sessionStorage.getItem("development"))+parseInt(sessionStorage.getItem("otherCharges"))+parseInt(null===(H=b)||void 0===H||null===(z=H.additionalDetails)||void 0===z||null===(G=z.selfCertificationCharges)||void 0===G?void 0:G.BPA_MALBA_CHARGES)+parseInt(null===(Y=b)||void 0===Y||null===(K=Y.additionalDetails)||void 0===K||null===(q=K.selfCertificationCharges)||void 0===q?void 0:q.BPA_LABOUR_CESS)+parseInt(null===(X=b)||void 0===X||null===(J=X.additionalDetails)||void 0===J||null===(Q=J.selfCertificationCharges)||void 0===Q?void 0:Q.BPA_WATER_CHARGES)+parseInt(null===(Z=b)||void 0===Z||null===($=Z.additionalDetails)||void 0===$||null===(ne=$.selfCertificationCharges)||void 0===ne?void 0:ne.BPA_GAUSHALA_CHARGES_CESS))A(),alert(g("Enterd Less Adjustment amount is invalid"));else{var le,ie;const e=null==N||null===(le=N.nocData)||void 0===le?void 0:le.map(e=>{const t=Digit.SessionStorage.get(null==e?void 0:e.nocType)||[];return{Noc:c({},e,{documents:[...null!=e&&e.documents?null==e?void 0:e.documents:[],...t||[]]})}}),t={};let n=!0,l=!0;null==t||null===(ie=t.Noc)||void 0===ie||ie.map(e=>{var t,i,o,a,r;"APPROVED"!==(null==e||null===(t=e.applicationStatus)||void 0===t?void 0:t.toUpperCase())&&"AUTO_APPROVED"!==(null==e||null===(i=e.applicationStatus)||void 0===i?void 0:i.toUpperCase())&&"REJECTED"!==(null==e||null===(o=e.applicationStatus)||void 0===o?void 0:o.toUpperCase())&&"AUTO_REJECTED"!==(null==e||null===(a=e.applicationStatus)||void 0===a?void 0:a.toUpperCase())&&"VOIDED"!==(null==e||null===(r=e.applicationStatus)||void 0===r?void 0:r.toUpperCase())||1!=n&&1!=l||("AIRPORT_AUTHORITY"===(null==e?void 0:e.nocType)?n=!1:"FIRE_NOC"===(null==e?void 0:e.nocType)&&(l=!1))});let i=[];e&&e.map(e=>{var t,o,a,r,u,s,d,c,v,m,p,f;("APPROVED"!=(null==e||null===(t=e.Noc)||void 0===t||null===(o=t.applicationStatus)||void 0===o?void 0:o.toUpperCase())&&"AUTO_APPROVED"!=(null==e||null===(a=e.Noc)||void 0===a||null===(r=a.applicationStatus)||void 0===r?void 0:r.toUpperCase())&&"REJECTED"!=(null==e||null===(u=e.Noc)||void 0===u||null===(s=u.applicationStatus)||void 0===s?void 0:s.toUpperCase())&&"AUTO_REJECTED"!=(null==e||null===(d=e.Noc)||void 0===d||null===(c=d.applicationStatus)||void 0===c?void 0:c.toUpperCase())&&"VOIDED"!=(null==e||null===(v=e.Noc)||void 0===v||null===(m=v.applicationStatus)||void 0===m?void 0:m.toUpperCase())&&"AIRPORT_AUTHORITY"===(null==e||null===(p=e.Noc)||void 0===p?void 0:p.nocType)&&n||"FIRE_NOC"===(null==e||null===(f=e.Noc)||void 0===f?void 0:f.nocType)&&l)&&i.push(e)}),S({BPA:b},(null==i?void 0:i.length)>0&&i,{isStakeholder:!1,bpa:!0})}return Promise.resolve()}catch(e){return Promise.reject(e)}},defaultValues:P,formId:"modal-action"})):l.createElement(t.Loader,null)},an=e=>l.createElement("h1",{style:{marginLeft:"22px"},className:"heading-m BPAheading-m"},e.label),rn=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),un=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(rn,null)),sn=e=>{var o,a,u,s,d,v,m;let{t:p,action:f,tenantId:E,closeModal:g,submitAction:_,applicationData:h,businessService:A}=e;const{data:S,isLoading:N}=Digit.Hooks.useEmployeeSearch(E,{roles:null===(o=workflowDetails)||void 0===o||null===(a=o.data)||void 0===a||null===(u=a.initialActionState)||void 0===u||null===(s=u.nextActions)||void 0===s||null===(d=s.filter(e=>(null==e?void 0:e.action)==(null==f?void 0:f.action)))||void 0===d||null===(v=d[0])||void 0===v||null===(m=v.assigneeRoles)||void 0===m?void 0:m.map(e=>({code:e})),isActive:!0},{enabled:!(null!=f&&f.isTerminateState)}),[b,C]=(r.useQueryClient(),n.useState({})),[y,D]=n.useState({}),[L,O]=n.useState([]),[T,I]=n.useState({}),[w,P]=n.useState(null),[R,x]=n.useState(null),[B,F]=n.useState(null),M=!!Digit.Utils.browser.isMobile();function U(e){P(e.target.files[0])}return i.useHistory(),n.useEffect(()=>{var e;O(null==S||null===(e=S.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}}))},[S]),n.useEffect(()=>{!function(){try{F(null);const e=function(){if(w){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(w.size>=5242880)F(p("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=w&&w.type&&!e.test(null==w?void 0:w.type))F(p("NOT_SUPPORTED_FILE_TYPE"));else{const e=kt(function(){return Promise.resolve(Digit.UploadServices.Filestorage("NOC",w,Digit.ULBService.getStateId()||(null==E?void 0:E.split(".")[0]))).then(function(e){var t,n,l,i;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?x(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):F(p("CS_FILE_UPLOAD_ERROR"))})},function(){F(p("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)}}()},[w]),n.useEffect(()=>{f&&C((e=>{var n;let{t:i,action:o,approvers:a,selectedApprover:r,setSelectedApprover:u,selectFile:s,uploadedFile:d,setUploadedFile:c,assigneeLabel:v,businessService:m,error:p}=e,f=!1;"REVOCATE"!=(null==o?void 0:o.action)&&"REJECT"!=(null==o?void 0:o.action)||(f=!0);let E=!1;return"APPROVE"!=(null==o?void 0:o.action)&&"REJECT"!=(null==o?void 0:o.action)&&"AUTO_APPROVE"!=o.action&&"AUTO_REJECT"!=o.action||(E=!0),{label:{heading:"WF_"+(null==o?void 0:o.action)+"_APPLICATION",submit:"WF_"+m+"_"+(null==o?void 0:o.action),cancel:"CORE_LOGOUTPOPUP_CANCEL"},form:[{body:[{label:o.isTerminateState||E?null:i(v||"WF_ROLE_"+(null===(n=o.assigneeRoles)||void 0===n?void 0:n[0])),type:"dropdown",populators:o.isTerminateState||E?null:l.createElement(t.Dropdown,{option:a,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:u,selected:r})},{label:i("WF_COMMON_COMMENTS"),type:"textarea",isMandatory:f,populators:{name:"comments"}},{label:""+i("WF_APPROVAL_UPLOAD_HEAD"),populators:l.createElement(t.UploadFile,{id:"workflow-doc",onUpload:s,onDelete:()=>{c(null)},showHint:!0,message:d?"1 "+i("ES_PT_ACTION_FILEUPLOADED"):i("CS_ACTION_NO_FILEUPLOADED"),accept:"image/*, .pdf, .png, .jpeg, .jpg",iserror:p})}]}]}})({t:p,action:f,approvers:L,selectedApprover:T,setSelectedApprover:I,selectFile:U,uploadedFile:R,setUploadedFile:x,businessService:A,assigneeLabel:"WF_ASSIGNEE_NAME_LABEL",error:B}))},[f,L,R,B]),f&&b.form?l.createElement(t.Modal,{headerBarMain:l.createElement(an,{label:p(b.label.heading)}),headerBarEnd:l.createElement(un,{onClick:g}),actionCancelLabel:p(b.label.cancel),actionCancelOnSubmit:g,actionSaveLabel:p(b.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action",isOBPSFlow:!0,popupStyles:M?{width:"720px"}:{},style:M?{height:"45px",width:"44%"}:{height:"45px",width:"107px",paddingLeft:"0px",paddingRight:"0px"},popupModuleMianStyles:M?{paddingLeft:"5px"}:{}},N?l.createElement(t.Loader,null):l.createElement(t.FormComposer,{config:b.form,cardStyle:{marginLeft:"0px",marginRight:"0px",marginTop:"-25px"},className:"BPAemployeeCard",noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){var t,n,l;let i=JSON.parse(sessionStorage.getItem("NewNOCDocs")),o=(null===(t=h)||void 0===t||null===(n=t.documents)||void 0===n?void 0:n.length)>0?[...null===(l=h)||void 0===l?void 0:l.documents]:[];i.map((e,t)=>{o.push(e)}),h=c({},h,{workflow:{action:null==f?void 0:f.action,comment:null!=e&&e.comments?null==e?void 0:e.comments:null,assignee:null!=T&&T.uuid?[null==T?void 0:T.uuid]:null,documents:R?[{documentType:(null==f?void 0:f.action)+" DOC",fileName:null==w?void 0:w.name,fileStoreId:R}]:null},documents:o}),_({Noc:h},!1,{isNoc:!0})},defaultValues:y,formId:"modal-action"})):l.createElement(t.Loader,null)},dn=e=>l.createElement("h1",{className:"heading-m"},e.label),cn=()=>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(cn,null)),mn=function(e,t){void 0===t&&(t="dayend");try{const n=e.match(/(\d{4})-(\d{1,2})-(\d{1,2})/),l=new Date(Date.UTC(n[1],n[2]-1,n[3]));return l.setMinutes(l.getMinutes()+l.getTimezoneOffset()),"dayend"===t&&(l.setHours(l.getHours()+24),l.setSeconds(l.getSeconds()-1)),l.getTime()}catch(t){return e}},pn=e=>{var i,o;let{t:a,action:r,tenantId:u,closeModal:s,submitAction:d,applicationData:v,businessService:m}=e;const{data:p,isLoading:f}=Digit.Hooks.useEmployeeSearch(u,{roles:null==r||null===(i=r.assigneeRoles)||void 0===i||null===(o=i.map)||void 0===o?void 0:o.call(i,e=>({code:e})),isActive:!0},{enabled:!(null!=r&&r.isTerminateState)}),[E,g]=n.useState({}),[_,h]=n.useState({}),[A,S]=n.useState([]),[N,b]=n.useState({}),[C,y]=n.useState(null),[D,L]=n.useState(null),[O,T]=n.useState(null),I=window.Digit.Utils.browser.isMobile(),w=window.location.href.includes("/employee");function P(e){y(e.target.files[0])}return n.useEffect(()=>{var e;S(null==p||null===(e=p.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[p]),n.useEffect(()=>{!function(){try{T(null);const e=function(){if(C){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(C.size>=5242880)T(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=C&&C.type&&!e.test(null==C?void 0:C.type))T(a("NOT_SUPPORTED_FILE_TYPE"));else{const e=kt(function(){return Promise.resolve(Digit.UploadServices.Filestorage("WS",C,Digit.ULBService.getCurrentTenantId())).then(function(e){var t,n,l,i;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?L(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):T(a("CS_FILE_UPLOAD_ERROR"))})},function(e){console.error("Modal -> err ",e),T(a("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[C]),n.useEffect(()=>{var e,n,i,o;"DisconnectWSConnection"==(null===(e=v)||void 0===e||null===(n=e.processInstance)||void 0===n?void 0:n.businessService)||"DisconnectSWConnection"==(null===(i=v)||void 0===i||null===(o=i.processInstance)||void 0===o?void 0:o.businessService)?r&&g((e=>{var n;let{t:i,action:o,approvers:a,selectedApprover:r,setSelectedApprover:u,selectFile:s,uploadedFile:d,setUploadedFile:v,businessService:m,error:p}=e,f=!0,E=!1;return(null!=o&&null!==(n=o.action)&&void 0!==n&&n.includes("SEND_BACK")||"APPROVE_FOR_DISCONNECTION"==(null==o?void 0:o.action)||"RESUBMIT_APPLICATION"==(null==o?void 0:o.action))&&(f=!1),o.isTerminateState&&(f=!1),"EXECUTE_DISCONNECTION"!=(null==o?void 0:o.action)&&"DISCONNECTION_EXECUTED"!=(null==o?void 0:o.action)||(E=!0),{label:{heading:"WF_"+(null==o?void 0:o.action)+"_APPLICATION",submit:"WF_"+(null==m?void 0:m.toUpperCase())+"_"+(null==o?void 0:o.action),cancel:"CS_COMMON_CANCEL"},form:[{body:[{label:f?i("WF_ASSIGNEE_NAME_LABEL"):null,placeholder:f?i("WF_ASSIGNEE_NAME_PLACEHOLDER"):null,type:"dropdown",populators:f?l.createElement(t.Dropdown,{option:a,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:u,selected:r}):null},E&&{label:i("ES_FSM_ACTION_SERVICE_DATE"),isMandatory:!!E,type:"custom",populators:E?{name:"date",validation:{required:!0},defaultValue:Digit.Utils.date.getDate(),component:(e,n)=>l.createElement(t.DatePicker,c({onChange:e.onChange,date:e.value},n))}:null},{label:i("WF_COMMON_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:i("WS_APPROVAL_CHECKLIST_BUTTON_UP_FILE"),populators:l.createElement(t.UploadFile,{id:"workflow-doc",accept:".jpg,.pdf,.png,.jpeg",onUpload:s,onDelete:()=>{v(null)},message:d?"1 "+i("ES_PT_ACTION_FILEUPLOADED"):i("CS_ACTION_NO_FILEUPLOADED"),error:p,iserror:p,showHintBelow:!0,hintText:"WS_HINT_TEXT_LABEL"})}]}]}})({t:a,action:r,approvers:A,selectedApprover:N,setSelectedApprover:b,selectFile:P,uploadedFile:D,setUploadedFile:L,businessService:m,error:O})):r&&g((e=>{var n;let{t:i,action:o,approvers:a,selectedApprover:r,setSelectedApprover:u,selectFile:s,uploadedFile:d,setUploadedFile:c,businessService:v,error:m}=e,p=!0;return(null!=o&&null!==(n=o.action)&&void 0!==n&&n.includes("SEND_BACK")||"APPROVE_FOR_CONNECTION"==(null==o?void 0:o.action))&&(p=!1),o.isTerminateState&&(p=!1),{label:{heading:"WF_"+(null==o?void 0:o.action)+"_APPLICATION",submit:"WF_"+(null==v?void 0:v.toUpperCase())+"_"+(null==o?void 0:o.action),cancel:"CS_COMMON_CANCEL"},form:[{body:[{label:p?i("WF_ASSIGNEE_NAME_LABEL"):null,placeholder:p?i("WF_ASSIGNEE_NAME_PLACEHOLDER"):null,type:"dropdown",populators:p?l.createElement(t.Dropdown,{option:a,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:u,selected:r}):null},{label:i("WF_COMMON_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:i("WS_APPROVAL_CHECKLIST_BUTTON_UP_FILE"),populators:l.createElement(t.UploadFile,{id:"workflow-doc",accept:".jpg,.pdf,.png,.jpeg",onUpload:s,onDelete:()=>{c(null)},message:d?"1 "+i("ES_PT_ACTION_FILEUPLOADED"):i("CS_ACTION_NO_FILEUPLOADED"),error:m,iserror:m,showHintBelow:!0,hintText:"WS_HINT_TEXT_LABEL"})}]}]}})({t:a,action:r,approvers:A,selectedApprover:N,setSelectedApprover:b,selectFile:P,uploadedFile:D,setUploadedFile:L,businessService:m,error:O}))},[r,A,D,O]),r&&E.form?l.createElement(t.Modal,{headerBarMain:l.createElement(dn,{label:a(E.label.heading)}),headerBarEnd:l.createElement(vn,{onClick:s}),actionCancelLabel:a(E.label.cancel),actionCancelOnSubmit:s,actionSaveLabel:a(E.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action",style:I&&w?{width:"100%",height:"auto"}:{}},f?l.createElement(t.Loader,null):l.createElement(t.FormComposer,{config:E.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){var t,n,l,i,o,a,s,m,p,f;if(null!==(t=v)&&void 0!==t&&t.isBillAmend){var E,g,_,h,A,S,b,y,L;const t=c({},null===(E=v)||void 0===E||null===(g=E.billAmendmentDetails)||void 0===g?void 0:g.additionalDetails,{comments:null!=e&&e.comments?e.comments:null}),n=c({},null===(_=v)||void 0===_?void 0:_.billAmendmentDetails,{workflow:{businessId:null===(h=v)||void 0===h||null===(A=h.billAmendmentDetails)||void 0===A?void 0:A.amendmentId,action:null==r?void 0:r.action,tenantId:u,businessService:null!==(S=v)&&void 0!==S&&null!==(b=S.applicationType)&&void 0!==b&&b.includes("WATER")?"WS.AMENDMENT":"SW.AMENDMENT",moduleName:null!==(y=v)&&void 0!==y&&null!==(L=y.applicationType)&&void 0!==L&&L.includes("WATER")?"WS":"SW",assignes:null!=N&&N.uuid?[{uuid:null==N?void 0:N.uuid}]:[],comment:(null==e?void 0:e.comments)||"",documents:D?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==C?void 0:C.name,fileStoreId:D}]:[]},additionalDetails:t,comment:(null==e?void 0:e.comments)||"",wfDocuments:D?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==C?void 0:C.name,fileStoreId:D}]:null,processInstance:{action:null==r?void 0:r.action,assignes:null!=N&&N.uuid?[{uuid:null==N?void 0:N.uuid}]:[],comment:(null==e?void 0:e.comments)||"",documents:D?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==C?void 0:C.name,fileStoreId:D}]:[]}});d({AmendmentUpdate:n})}else{if(v=c({},v,{action:null==r?void 0:r.action,comment:(null==e?void 0:e.comments)||"",assignee:null!=N&&N.uuid?[null==N?void 0:N.uuid]:[],assignes:null!=N&&N.uuid?[{uuid:null==N?void 0:N.uuid}]:[],wfDocuments:D?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==C?void 0:C.name,fileStoreId:D}]:null,processInstance:c({},null===(n=v)||void 0===n?void 0:n.processInstance,{action:null==r?void 0:r.action,assignes:null!=N&&N.uuid?[{uuid:null==N?void 0:N.uuid}]:[],comment:(null==e?void 0:e.comments)||"",documents:D?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==C?void 0:C.name,fileStoreId:D}]:[]})}),null!=e&&e.date&&null!==(l=v)&&void 0!==l&&null!==(i=l.applicationType)&&void 0!==i&&i.includes("DISCONNECT")){const t=ht(null==e?void 0:e.date);v.disconnectionExecutionDate=mn(t)}else if(null!=e&&e.date){const t=ht(null==e?void 0:e.date);v.connectionExecutionDate=mn(t)}var O;if("DisconnectWSConnection"==(null===(o=v)||void 0===o||null===(a=o.processInstance)||void 0===a?void 0:a.businessService)||"DisconnectSWConnection"==(null===(s=v)||void 0===s||null===(m=s.processInstance)||void 0===m?void 0:m.businessService)||window.location.href.includes("disconnection"))"WATER"==(null===(O=v)||void 0===O?void 0:O.serviceType)?d({WaterConnection:v,disconnectRequest:!0}):d({SewerageConnection:v,disconnectRequest:!0});else if("SEWERAGE_RECONNECTION"==(null===(p=v)||void 0===p?void 0:p.applicationType))d({SewerageConnection:v,disconnectRequest:!1,reconnectRequest:!0});else if("WATER_RECONNECTION"==(null===(f=v)||void 0===f?void 0:f.applicationType))d({WaterConnection:v,disconnectRequest:!1,reconnectRequest:!0});else{var T,I,w,P,R,x,B,F,M,U,k,W,H;const e=sessionStorage.getItem("Digit.ADHOC_ADD_REBATE_DATA"),t=e?JSON.parse(e):"";null!=t&&null!==(T=t.value)&&void 0!==T&&T.adhocPenalty&&(v.additionalDetails.adhocPenalty=parseInt(null==t||null===(I=t.value)||void 0===I?void 0:I.adhocPenalty)||""),null!=t&&null!==(w=t.value)&&void 0!==w&&w.adhocPenaltyComment&&(v.additionalDetails.adhocPenaltyComment=(null==t||null===(P=t.value)||void 0===P?void 0:P.adhocPenaltyComment)||""),null!=t&&null!==(R=t.value)&&void 0!==R&&R.adhocPenaltyReason&&(v.additionalDetails.adhocPenaltyReason=(null==t||null===(x=t.value)||void 0===x?void 0:x.adhocPenaltyReason)||""),null!=t&&null!==(B=t.value)&&void 0!==B&&B.adhocRebate&&(v.additionalDetails.adhocRebate=parseInt(null==t||null===(F=t.value)||void 0===F?void 0:F.adhocRebate)||""),null!=t&&null!==(M=t.value)&&void 0!==M&&M.adhocRebateComment&&(v.additionalDetails.adhocRebateComment=(null==t||null===(U=t.value)||void 0===U?void 0:U.adhocRebateComment)||""),null!=t&&null!==(k=t.value)&&void 0!==k&&k.adhocRebateReason&&(v.additionalDetails.adhocRebateReason=(null==t||null===(W=t.value)||void 0===W?void 0:W.adhocRebateReason)||""),"WATER"==(null===(H=v)||void 0===H?void 0:H.serviceType)?d({WaterConnection:v,disconnectRequest:!1,reconnectRequest:!1}):d({SewerageConnection:v,disconnectRequest:!1,reconnectRequest:!1})}}},defaultValues:_,formId:"modal-action"})):l.createElement(t.Loader,null)},fn=e=>l.createElement("h1",{className:"heading-m"},e.label),En=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),gn=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(En,null)),_n=e=>{var i,o;let{t:a,action:r,tenantId:u,closeModal:s,submitAction:d,applicationData:v,businessService:m,moduleCode:p}=e;console.log("applicationData",v);const{data:f}=Digit.Hooks.useEmployeeSearch(u,{roles:null==r||null===(i=r.assigneeRoles)||void 0===i||null===(o=i.map)||void 0===o?void 0:o.call(i,e=>({code:e})),isActive:!0},{enabled:!(null!=r&&r.isTerminateState)}),[E,g]=n.useState({}),[_,h]=n.useState({}),[A,S]=n.useState([]),[N,b]=n.useState(null),[C,y]=n.useState(null),[D,L]=n.useState(null),[O,T]=n.useState(null),[I,w]=n.useState(!1);function P(e){y(e.target.files[0])}return n.useEffect(()=>{var e;S(null==f||null===(e=f.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[f]),n.useEffect(()=>{!function(){try{T(null);const e=function(){if(C){const e=function(){if(C.size>=5242880)T(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=kt(function(){return Promise.resolve(Digit.UploadServices.Filestorage("PTR",C,Digit.ULBService.getStateId())).then(function(e){var t,n,l,i;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?L(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):T(a("CS_FILE_UPLOAD_ERROR"))})},function(){T(a("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[C]),n.useEffect(()=>{r&&g((e=>{let{t:t,action:n,businessService:l}=e;return{label:{heading:"WF_"+(null==n?void 0:n.action)+"_APPLICATION",submit:"WF_"+l+"_"+(null==n?void 0:n.action),cancel:"ES_PTR_COMMON_CANCEL"},form:[{body:[{label:t("ES_PTR_ACTION_COMMENTS"),type:"textarea",populators:{name:"comments"}}]}]}})({t:a,action:r,approvers:A,selectedApprover:N,setSelectedApprover:b,selectFile:P,uploadedFile:D,setUploadedFile:L,businessService:m}))},[r,A,D]),r&&E.form?l.createElement(t.Modal,{headerBarMain:l.createElement(fn,{label:a(E.label.heading)}),headerBarEnd:l.createElement(gn,{onClick:s}),actionCancelLabel:a(E.label.cancel),actionCancelOnSubmit:s,actionSaveLabel:a(E.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},l.createElement(t.FormComposer,{config:E.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){if("COMMON_APPROVED"==(null==r?void 0:r.action)){let t={action:"OPEN",comments:null==e?void 0:e.comments,businessService:"ptr",moduleName:"pet-services"};v.creationReason="CREATE",d({PetRegistrationApplications:[c({},v,{workflow:t})]})}let t={action:null==r?void 0:r.action,comments:null==e?void 0:e.comments,businessService:m,moduleName:p};t.assignes=null!=r&&r.isTerminateState||!N?[]:[N],D&&(t.documents=[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==C?void 0:C.name,fileStoreId:D}]),d({PetRegistrationApplications:[c({},v,{workflow:t})]})},defaultValues:_,formId:"modal-action"})):l.createElement(t.Loader,null)},hn=e=>l.createElement("h1",{className:"heading-m"},e.label),An=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),Sn=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(An,null)),Nn=e=>{var i,o,a;let{t:r,action:u,closeModal:s,submitAction:d,applicationData:v,businessService:m}=e;const p=Digit.ULBService.getStateId(),{data:f,isLoading:E}=Digit.Hooks.tl.useTradeLicenseMDMS(p,"TradeLicense","TradeUnits","[?(@.type=='TL')]");console.log("tradeMdmsData",null==f||null===(i=f.TradeLicense)||void 0===i?void 0:i.TradeType),console.log("applicationData",v);const[g,_]=n.useState({}),[h,A]=n.useState({}),[S,N]=n.useState([]),[b,C]=n.useState(""),[y,D]=n.useState([]),[L,O]=n.useState(null),T=null===(o=v)||void 0===o||null===(a=o.tradeLicenseDetail)||void 0===a?void 0:a.tradeUnits;console.log("tradeUnits",T);const I=n.useMemo(()=>{var e;if(E||!f||!T.length)return[];const t=new Set(T.map(e=>e.tradeType)),n=(null===(e=f.TradeLicense)||void 0===e?void 0:e.TradeType.filter(e=>t.has(e.code))).some(e=>null==e?void 0:e.ishazardous);return console.log("hasHazardous",n),n?["1"]:["1","2","3"]},[E,f,T]);return console.log("years",I),n.useEffect(()=>{u&&_((e=>{let{t:n,action:i,years:o,selectedApprover:a,setSelectedApprover:r,businessService:u}=e;return{label:{heading:"WF_"+(null==i?void 0:i.action)+"_APPLICATION",submit:"WF_"+(null==u?void 0:u.toUpperCase())+"_"+(null==i?void 0:i.action),cancel:"WF_EMPLOYEE_NEWTL_CANCEL"},form:[{body:[{label:n("TL_VALID_FOR_NO_OF_YEARS"),type:"dropdown",populators:l.createElement(t.Dropdown,{option:o,autoComplete:"off",select:r,selected:a})}]}]}})({t:r,action:u,years:I,selectedApprover:b,setSelectedApprover:C,businessService:m}))},[u,I,y,L]),u&&g.form?l.createElement(t.Modal,{headerBarMain:l.createElement(hn,{label:r(g.label.heading)}),headerBarEnd:l.createElement(Sn,{onClick:s}),actionCancelLabel:r(g.label.cancel),actionCancelOnSubmit:s,actionSaveLabel:r(g.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},E?l.createElement(t.Loader,null):l.createElement(t.FormComposer,{config:g.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){var t;let n=null===(t=v)||void 0===t?void 0:t.financialYear;const l=null==n?void 0:n.split("-")[1],i="20"+Number(l)+"-"+(Number(l)+1);v=c({},v,{financialYear:i,action:"INITIATE",additionalDetail:c({},v.additionalDetail,{validityYears:b.length>0?parseInt(b):""})}),d({Licenses:[v]})},defaultValues:h,formId:"modal-action"})):l.createElement(t.Loader,null)},bn=e=>l.createElement("h1",{className:"heading-m"},e.label),Cn=()=>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(Cn,null)),Dn=e=>{var i,o;let{t:a,action:r,tenantId:u,closeModal:s,submitAction:d,applicationData:v,businessService:m,moduleCode:p}=e;const{data:f}=Digit.Hooks.useEmployeeSearch(u,{roles:null==r||null===(i=r.assigneeRoles)||void 0===i||null===(o=i.map)||void 0===o?void 0:o.call(i,e=>({code:e})),isActive:!0},{enabled:null==r?void 0:r.isTerminateState}),[E,g]=n.useState({}),[_,h]=n.useState({}),[A,S]=n.useState([]),[N,b]=n.useState(null),[C,y]=n.useState(null),[D,L]=n.useState(null),[O,T]=n.useState(null),[I,w]=n.useState(!1);function P(e){w(!0),y(e.target.files[0])}return n.useEffect(()=>{var e;S(null==f||null===(e=f.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[f]),n.useEffect(()=>{!function(){try{T(null);const e=function(){if(C){const e=function(){if(C.size>=5242880)T(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=function(e,t){try{var n=kt(function(){return Promise.resolve(Digit.UploadServices.Filestorage("StreetVending",C,u)).then(function(e){var t,n,l,i;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?L(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):T(a("CS_FILE_UPLOAD_ERROR"))})},function(){T(a("CS_FILE_UPLOAD_ERROR"))})}catch(e){return t(!0,e)}return n&&n.then?n.then(t.bind(null,!1),t.bind(null,!0)):t(!1,n)}(0,function(e,t){if(w(!1),e)throw t;return t});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[C]),console.log("actyhdesh,jhfsefsef",r,v),n.useEffect(()=>{g((e=>{let{t:n,action:i,selectFile:o,uploadedFile:a,setUploadedFile:r,approvers:u,selectedApprover:s,setSelectedApprover:d,isUploading:c}=e;const v=()=>l.createElement("div",{className:"loading-spinner"});return console.log("isuploading ",c),{label:{heading:"WF_"+(null==i?void 0:i.action)+"_APPLICATION",submit:"SV_"+(null==i?void 0:i.action),cancel:"SV_COMMON_CANCEL"},form:[{body:["APPROVE"===(null==i?void 0:i.action)||"REJECT"===(null==i?void 0:i.action)||"SENDBACKTOCITIZEN"===(null==i?void 0:i.action)?"":{label:n("SV_ASSIGNEE"),type:"dropdown",populators:l.createElement(t.Dropdown,{option:u,t:n,optionKey:"name",select:d,selected:s})},{label:n("SV_ACTION_COMMENTS"),isMandatory:!0,type:"textarea",populators:{name:"comments",validation:{required:!0}}},{label:n("SV_ATTATCH_FILE")+(i.docUploadRequired?" *":""),populators:l.createElement(t.UploadFile,{id:"workflow-doc-sv",onUpload:o,onDelete:()=>{r(null)},message:c?l.createElement("div",{style:{display:"flex",alignItems:"center",gap:"8px"}},l.createElement(v,null),l.createElement("span",null,"Uploading...")):a?"1 "+n("SV_FILE_UPLOADED"):n("SV_NO_FILE")})}]}]}})({t:a,action:r,approvers:A,selectedApprover:N,setSelectedApprover:b,selectFile:P,uploadedFile:D,setUploadedFile:L,businessService:m,isUploading:I}))},[r,A,D]),r&&E.form?l.createElement(t.Modal,{headerBarMain:l.createElement(bn,{label:a(E.label.heading)}),headerBarEnd:l.createElement(yn,{onClick:s}),actionCancelLabel:a(E.label.cancel),actionCancelOnSubmit:s,actionSaveLabel:a(E.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},l.createElement(t.FormComposer,{config:E.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){var t;let n={action:null==r?void 0:r.action,comments:null==e?void 0:e.comments,businessService:m,moduleName:p,assignes:"SENDBACKTOCITIZEN"===(null==r?void 0:r.action)?[null==v||null===(t=v.auditDetails)||void 0===t?void 0:t.createdBy]:null!=N&&N.uuid?[null==N?void 0:N.uuid]:null};D&&(n.documents=[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==C?void 0:C.name,fileStoreId:D}]),d({streetVendingDetail:c({},v,{workflow:n})})},defaultValues:_,formId:"modal-action"})):l.createElement(t.Loader,null)},Ln=e=>l.createElement("h1",{className:"heading-m"},e.label),On=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),Tn=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(On,null)),In=e=>{var i,o;let{t:a,action:r,tenantId:u,closeModal:s,submitAction:d,applicationData:v,businessService:m,moduleCode:p}=e;console.log("applicationData",v);const{data:f}=Digit.Hooks.useEmployeeSearch(u,{roles:null==r||null===(i=r.assigneeRoles)||void 0===i||null===(o=i.map)||void 0===o?void 0:o.call(i,e=>({code:e})),isActive:!0},{enabled:!(null!=r&&r.isTerminateState)}),[E,g]=n.useState({}),[_,h]=n.useState({}),[A,S]=n.useState([]),[N,b]=n.useState(null),[C,y]=n.useState(null),[D,L]=n.useState(null),[O,T]=n.useState(null),[I,w]=n.useState(!1);function P(e){y(e.target.files[0])}return n.useEffect(()=>{var e;S(null==f||null===(e=f.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[f]),n.useEffect(()=>{!function(){try{T(null);const e=function(){if(C){const e=function(){if(C.size>=5242880)T(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=kt(function(){return Promise.resolve(Digit.UploadServices.Filestorage("CHB",C,Digit.ULBService.getStateId())).then(function(e){var t,n,l,i;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?L(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):T(a("CS_FILE_UPLOAD_ERROR"))})},function(){T(a("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[C]),n.useEffect(()=>{r&&g((e=>{let{t:n,action:i,selectFile:o,uploadedFile:a,setUploadedFile:r,businessService:u}=e;return{label:{heading:"WF_"+(null==i?void 0:i.action)+"_APPLICATION",submit:"WF_"+u+"_"+(null==i?void 0:i.action),cancel:"ES_CHB_COMMON_CANCEL"},form:[{body:[{label:n("ES_CHB_ACTION_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:n("ES_CHB_ATTACH_FILE")+(i.docUploadRequired?" *":""),populators:l.createElement(t.UploadFile,{id:"workflow-doc",onUpload:o,onDelete:()=>{r(null)},showHint:!0,hintText:n("CHB_ATTACH_RESTRICTIONS_SIZE"),message:a?"1 "+n("ES_CHB_ACTION_FILEUPLOADED"):n("ES_CHB_ACTION_NO_FILEUPLOADED")})}]}]}})({t:a,action:r,approvers:A,selectedApprover:N,setSelectedApprover:b,selectFile:P,uploadedFile:D,setUploadedFile:L,businessService:m}))},[r,A,D]),r&&E.form?l.createElement(t.Modal,{headerBarMain:l.createElement(Ln,{label:a(E.label.heading)}),headerBarEnd:l.createElement(Tn,{onClick:s}),actionCancelLabel:a(E.label.cancel),actionCancelOnSubmit:s,actionSaveLabel:a(E.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},l.createElement(t.FormComposer,{config:E.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){let t={action:null==r?void 0:r.action,comments:null==e?void 0:e.comments,businessService:m,moduleName:p};D&&(t.documents=[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==C?void 0:C.name,filestoreId:D}]),d({hallsBookingApplication:[c({},v,{workflow:t})]})},defaultValues:_,formId:"modal-action"})):l.createElement(t.Loader,null)},wn=e=>l.createElement("h1",{className:"heading-m"},e.label),Pn=()=>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"})),Rn=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(Pn,null)),xn=e=>{var o,a,r;let{t:u,action:s,tenantId:d,closeModal:v,submitAction:m,applicationData:p,businessService:f,moduleCode:E}=e;const{data:g}=Digit.Hooks.useEmployeeSearch(d,{roles:null==s||null===(o=s.roles)||void 0===o||null===(a=o[0])||void 0===a||null===(r=a.map)||void 0===r?void 0:r.call(a,e=>({code:e})),isActive:!0},{enabled:!(null!=s&&s.isTerminateState)}),_=i.useHistory(),[h,A]=n.useState({}),[S,N]=n.useState({}),[b,C]=n.useState([]),[y,D]=n.useState(null),[L,O]=n.useState(null);return n.useEffect(()=>{var e;C(null==g||null===(e=g.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[g]),n.useEffect(()=>{"INITIATED"===(null==s?void 0:s.state)?_.push("/digit-ui/employee/asset/assetservice/edit/"+(null==p?void 0:p.applicationNo)):A((e=>{let{t:t,action:n,businessService:l}=e;return{label:{heading:"WF_"+(null==n?void 0:n.action)+"_APPLICATION",submit:"WF_"+l+"_"+(null==n?void 0:n.action),cancel:"ES_AST_COMMON_CANCEL"},form:[{body:[{label:t("AST_ACTION_COMMENTS"),type:"textarea",populators:{name:"comments"}}]}]}})({t:u,action:s,approvers:b,selectedApprover:y,setSelectedApprover:D,uploadedFile:L,setUploadedFile:O,businessService:f}))},[s,b,L]),s&&h.form?l.createElement(t.Modal,{headerBarMain:l.createElement(wn,{label:u(h.label.heading)}),headerBarEnd:l.createElement(Rn,{onClick:v}),actionCancelLabel:u(h.label.cancel),actionCancelOnSubmit:v,actionSaveLabel:u(h.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},l.createElement(t.FormComposer,{config:h.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){let t={action:null==s?void 0:s.action,comment:null==e?void 0:e.comments,businessService:f,moduleName:E};L&&(t.documents=[]),m({Asset:c({},p,{workflow:t})})},defaultValues:S,formId:"modal-action"})):l.createElement(t.Loader,null)},Bn=e=>null!=e&&e.businessService.includes("PT")?l.createElement(Yt,e):null!=e&&e.businessService.includes("ptr")?l.createElement(_n,e):null!=e&&e.businessService.includes("NewTL")||null!=e&&e.businessService.includes("TL")||null!=e&&e.businessService.includes("EDITRENEWAL")?l.createElement(Jt,e):null!=e&&e.businessService.includes("DIRECTRENEWAL")?l.createElement(Nn,e):null!=e&&e.moduleCode.includes("BPAREG")?l.createElement(en,e):null!=e&&e.moduleCode.includes("BPA")?l.createElement(on,e):null!=e&&e.moduleCode.includes("NOC")?l.createElement(sn,e):null!=e&&e.moduleCode.includes("WS")?l.createElement(pn,e):null!=e&&e.businessService.includes("street-vending")?l.createElement(Dn,e):null!=e&&e.businessService.includes("chb")?l.createElement(In,e):null!=e&&e.businessService.includes("asset-create")?l.createElement(xn,e):void 0;function Fn(e){let{documents:n,svgStyles:i={},isSendBackFlow:a=!1,isHrLine:r=!1,titleStyles:u}=e;const{t:s}=o.useTranslation(),d=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"}},!d&&(null==n?void 0:n.map((e,i)=>{var o,d,c;return l.createElement(l.Fragment,{key:i},l.createElement("div",{style:{display:"flex",flexWrap:"wrap",justifyContent:"flex-start"}},l.createElement("div",{style:{display:"flex",flexWrap:"wrap",justifyContent:"flex-start"}},null!=e&&e.values&&(null==e?void 0:e.values.length)>0?null==e||null===(o=e.values)||void 0===o?void 0:o.map((n,i)=>{var o;return l.createElement("div",{style:{width:"180px"}},l.createElement(t.CardSubHeader,{style:u||{marginTop:"32px",marginBottom:"8px",color:"#505A5F",fontSize:"24px"}},s(null==e?void 0:e.title)),l.createElement("a",{target:"_",href:null==n?void 0:n.url,style:{minWidth:"80px",marginRight:"10px",maxWidth:"100px",height:"auto",minWidth:"100px"},key:i},l.createElement("div",{style:{display:"flex",justifyContent:"flex-start"}},l.createElement(t.PDFSvg,null)),l.createElement("p",{style:{marginTop:"8px",fontWeight:"bold",textAlign:"start",color:"#505A5F"}},s(null==n?void 0:n.title)),a?null!=n&&null!==(o=n.documentType)&&void 0!==o&&o.includes("NOC")?l.createElement("p",{style:{textAlign:"center"}},s(null==n?void 0:n.documentType.split(".")[1])):l.createElement("p",{style:{textAlign:"center"}},s(null==n?void 0:n.documentType)):""))}):!window.location.href.includes("citizen")&&l.createElement("div",null,l.createElement("p",null,s("BPA_NO_DOCUMENTS_UPLOADED_LABEL")),l.createElement("div",{style:{width:"180px"}},l.createElement(t.CardSubHeader,{style:u||{marginTop:"32px",marginBottom:"8px",color:"#505A5F",fontSize:"24px"}}),l.createElement("div",{style:{minWidth:"80px",marginRight:"10px",maxWidth:"100px",height:"auto",minWidth:"100px"},key:i},l.createElement("div",{style:{display:"flex",justifyContent:"flex-start"}},l.createElement(t.PDFSvg,null)),l.createElement("p",{style:{marginTop:"8px",fontWeight:"bold",textAlign:"start",color:"#505A5F"}}),a?(null!==(d=value)&&void 0!==d&&null!==(c=d.documentType)&&void 0!==c&&c.includes("NOC"),l.createElement("p",{style:{textAlign:"center"}})):"")))),r&&(null==n?void 0:n.length)!=i+1?l.createElement("hr",{style:{color:"#D6D5D4",backgroundColor:"#D6D5D4",height:"2px",marginTop:"20px",marginBottom:"20px"}}):null))})),d&&(null==n?void 0:n.map((e,n)=>{var o;return l.createElement(l.Fragment,{key:n},null!=e&&e.title?l.createElement(t.CardSubHeader,{style:{marginTop:"32px",marginBottom:"8px",color:"#505A5F",fontSize:"24px"}},s(null==e?void 0:e.title)):null,l.createElement("div",null,null!=e&&e.values&&(null==e?void 0:e.values.length)>0?null==e||null===(o=e.values)||void 0===o?void 0:o.map((e,n)=>l.createElement("a",{target:"_",href:null==e?void 0:e.url,style:{minWidth:null!=i&&i.minWidth?null==i?void 0:i.minWidth:"160px",marginRight:"20px"},key:n},l.createElement("div",{style:{maxWidth:"940px",padding:"8px",borderRadius:"4px",border:"1px solid #D6D5D4",background:"#FAFAFA"}},l.createElement("p",{style:{marginTop:"8px",fontWeight:"bold",marginBottom:"10px"}},s(null==e?void 0:e.title)),null!=e&&e.docInfo?l.createElement("div",{style:{fontSize:"12px",color:"#505A5F",fontWeight:400,lineHeight:"15px",marginBottom:"10px"}},""+s(null==e?void 0:e.docInfo)):null,l.createElement(t.PDFSvg,null),l.createElement("p",{style:{marginTop:"8px",fontSize:"16px",lineHeight:"19px",color:"#505A5F",fontWeight:"400",textAlign:"center",color:"#505A5F"}},""+s(null==e?void 0:e.title))))):!window.location.href.includes("citizen")&&l.createElement("div",null,l.createElement("p",null,s("BPA_NO_DOCUMENTS_UPLOADED_LABEL")))))})))}const Mn=e=>{var t,i;let{t:o,formData:a,applicationData:r,docs:u,bpaActionsDetails:s}=e;const d=(null==r?void 0:r.status)||"",c=(null==s||null===(t=s.data)||void 0===t?void 0:t.nextActions)||[],v=Digit.ULBService.getStateId(),[m,p]=n.useState((null==a||null===(i=a.documents)||void 0===i?void 0:i.documents)||[]),[f,E]=n.useState(null),[g,_]=n.useState([]),[h,A]=n.useState(!0),[S,N]=n.useState(!1),[b,C]=n.useState(!1),{isLoading:y,data:D}=Digit.Hooks.obps.useMDMS(v,"BPA",["DocTypeMapping"]),{isLoading:L,data:O}=Digit.Hooks.obps.useMDMS(v,"common-masters",["DocumentType"]);return n.useEffect(()=>{var e,t,n,l;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,n;return e.WFState==(null==r?void 0:r.status)?null==r?void 0:r.status:e.RiskType==(null==r?void 0:r.riskType)&&e.ServiceType==(null==r||null===(t=r.additionalDetails)||void 0===t?void 0:t.serviceType)&&e.applicationType==(null==r||null===(n=r.additionalDetails)||void 0===n?void 0:n.applicationType)}));let s=[];null===(t=i)||void 0===t||null===(n=t[0])||void 0===n||null===(l=n.docTypes)||void 0===l||l.forEach(e=>{var t,n,l,i;let o=e.code;e.dropdownData=[],e.uploadedDocuments=[],null==O||null===(t=O["common-masters"])||void 0===t||null===(n=t.DocumentType)||void 0===n||n.forEach(t=>{let n=t.code.slice(0,o.length);o===n&&(e.hasDropdown=!0,t.i18nKey=t.code,e.dropdownData.push(t))}),e.uploadedDocuments[0]={},e.uploadedDocuments[0].values=[],null==u||null===(l=u[0])||void 0===l||null===(i=l.values)||void 0===i||i.map(t=>{var n,l;o===(null==t||null===(n=t.documentType)||void 0===n?void 0:n.split(".")[0])+"."+(null==t||null===(l=t.documentType)||void 0===l?void 0:l.split(".")[1])&&e.uploadedDocuments[0].values.push(t)}),s.push(e)}),sessionStorage.setItem("BPA_DOCUMENTS",JSON.stringify(s)),_(s)},[!y,!L]),n.useEffect(()=>{let e=0;g.map(t=>{let n=!1;m.map(e=>{t.required&&t.code==e.documentType.split(".")[0]+"."+e.documentType.split(".")[1]&&(n=!0)}),!n&&t.required&&(e+=1)}),A("0"!=e&&0!=e||!(m.length>0))},[m,S]),n.useEffect(()=>{C("DOC_VERIFICATION_INPROGRESS"===d&&(null==c?void 0:c.length)>0)},[r,s]),l.createElement("div",{style:{display:"flex",flexWrap:"wrap"}},null==g?void 0:g.map((e,t)=>l.createElement("div",{style:{padding:"20px"}},l.createElement(Un,{key:t,index:t,document:e,t:o,error:f,setError:E,setDocuments:p,documents:m,setCheckRequiredFields:N,applicationStatus:d,actions:c,bpaTaxDocuments:g,checkEnablingDocs:b}))))};function Un(e){var i,o;let{t:a,document:r,setDocuments:u,documents:s,index:d,bpaTaxDocuments:v,checkEnablingDocs:m}=e;const p=null==s?void 0:s.filter(e=>{var t;return null==e||null===(t=e.documentType)||void 0===t?void 0:t.includes(null==r?void 0:r.code)})[0],f=Digit.ULBService.getStateId(),[E,g]=n.useState(p?c({},p,{active:!0,code:null==p?void 0:p.documentType,i18nKey:null==p?void 0:p.documentType}):1===(null==r||null===(i=r.dropdownData)||void 0===i?void 0:i.length)?null==r?void 0:r.dropdownData[0]:{}),[_,h]=n.useState(null),[A,S]=n.useState(()=>(null==p?void 0:p.fileStoreId)||null),[N,b]=n.useState([]);return n.useEffect(()=>{null!=E&&E.code&&u(e=>{var t;const n=null==e?void 0:e.filter(e=>(null==e?void 0:e.documentType)!==(null==E?void 0:E.code));return 0===(null==A?void 0:A.length)||null===A?n:[...null==n?void 0:n.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:s?null===(t=s.find(e=>e.documentType===(null==E?void 0:E.code)))||void 0===t?void 0:t.id:void 0}]})},[A,E]),n.useEffect(()=>{try{N.length>0&&(sessionStorage.removeItem("BPA_DOCUMENTS"),r.newUploadedDocs=[],N.map(e=>{var t,n,l;null!=E&&E.code&&r.newUploadedDocs.push({documentType:null==E?void 0:E.code,fileStoreId:null==e||null===(t=e.fileStoreId)||void 0===t?void 0:t.fileStoreId,documentUid:null==e||null===(n=e.fileStoreId)||void 0===n?void 0:n.fileStoreId,tenantId:null==e||null===(l=e.fileStoreId)||void 0===l?void 0:l.tenantId})}),v[d]=r,sessionStorage.setItem("BPA_DOCUMENTS",JSON.stringify(v)))}catch(e){Promise.reject(e)}},[N,E]),n.useEffect(()=>{},[_]),l.createElement("div",{style:{marginBottom:"24px",maxWidth:"950px",minWidth:"280px",background:"#FAFAFA",borderRadius:"4px",border:"1px solid #D6D5D4",padding:"8px"}},l.createElement(t.CardSubHeader,{style:{marginBottom:"8px",paddingBottom:"9px",color:"#0B0C0C",fontSize:"16px",lineHeight:"19px"}},""+a(null==r?void 0:r.code)),(null==r||null===(o=r.uploadedDocuments)||void 0===o?void 0:o.length)&&l.createElement(Fn,{documents:null==r?void 0:r.uploadedDocuments,svgStyles:{width:"100px",height:"100px",viewBox:"0 0 25 25",minWidth:"100px"}}),m?l.createElement("div",{style:{marginTop:"20px"}},l.createElement(t.LabelFieldPair,{style:{width:"100%"}},l.createElement(t.CardLabel,{style:{marginTop:"-10px",width:"100%"}},null!=r&&r.required?a(null==r?void 0:r.code)+"* ":""+a(null==r?void 0:r.code)),l.createElement(t.Dropdown,{className:"form-field",t:a,isMandatory:!1,option:null==r?void 0:r.dropdownData,selected:E,optionKey:"i18nKey",select:e=>g(e),style:{width:"100%"}})),l.createElement(t.LabelFieldPair,{style:{width:"100%"}},l.createElement(t.CardLabel,{className:"card-label-smaller",style:{width:"100%"}}),l.createElement("div",{className:"field",style:{width:"100%"}},l.createElement(t.MultiUploadWrapper,{module:"BPA",tenantId:f,getFormState:e=>((e,t)=>{let n=Object.fromEntries(t),l=Object.values(n);var i;0!==Object.keys(n).length&&b(l),(i=l[l.length-1])&&h(i.file)})(0,e),t:a,allowedFileTypesRegex:/(.*?)(jpg|jpeg|png|image|pdf)$/i,allowedMaxSizeInMB:5,acceptFiles:"image/*, .pdf, .png, .jpeg, .jpg"})))):null)}function kn(e){let{fiReport:n,isCitizen:i=!1}=e;const{t:a}=o.useTranslation();return l.createElement(l.Fragment,null,l.createElement("div",{style:{marginTop:"10px"}},l.createElement(i?t.CardHeader:t.CardSectionHeader,{style:{fontSize:"24px"}},""+a("BPA_FI_REPORT")),n.map((e,i)=>{var o,r,u,s,d,c;return l.createElement("div",{style:{background:"#FAFAFA",border:"1px solid #D6D5D4",padding:"8px",borderRadius:"4px",maxWidth:"950px",minWidth:"280px",marginBottom:"24px"}},l.createElement(t.StatusTable,null,l.createElement(t.CardSectionHeader,{style:{fontSize:"20px"}},1==(null==n?void 0:n.length)?""+a("BPA_FI_REPORT"):a("BPA_FI_REPORT")+" - "+(i+1)),l.createElement(t.Row,{className:"border-none",label:""+a("BPA_FI_DATE_LABEL"),text:null!=e&&e.date?e.date.includes("-")?(null===(o=e.date)||void 0===o?void 0:o.split("-")[2])+"/"+(null===(r=e.date)||void 0===r?void 0:r.split("-")[1])+"/"+(null===(u=e.date)||void 0===u?void 0:u.split("-")[0]):null==e?void 0:e.date:"NA"}),l.createElement(t.Row,{className:"border-none",label:""+a("BPA_FI_TIME_LABEL"),text:null!=e&&e.time?null==e?void 0:e.time:"NA"}),(null==e||null===(s=e.questions)||void 0===s?void 0:s.length)&&(null==e||null===(d=e.questions)||void 0===d?void 0:d.map(e=>l.createElement("div",{style:{background:"white",border:"1px solid #D6D5D4",padding:"8px",borderRadius:"4px",marginTop:"10px"}},l.createElement(t.Row,{className:"border-none",label:""+a(""+e.question),text:null!=e&&e.value?null==e?void 0:e.value:"NA"}),l.createElement(t.Row,{className:"border-none",label:""+a("BPA_ENTER_REMARKS"),text:e.remarks?e.remarks:"NA"})))),l.createElement(Fn,{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"}})))})))}function Wn(e){let{t:i,document:o,setNocDocuments:a,setError:r,nocDocuments:u}=e;const s=null==u?void 0:u.filter(e=>{var t;return null==e||null===(t=e.documentType)||void 0===t?void 0:t.includes(null==o?void 0:o.code)})[0],d=Digit.ULBService.getStateId(),[c,v]=n.useState(),[m,p]=n.useState(null),[f,E]=n.useState(()=>(null==s?void 0:s.fileStoreId)||null);return n.useEffect(()=>{var e,t;null!=o&&null!==(e=o.dropdownData)&&void 0!==e&&null!==(t=e[0])&&void 0!==t&&t.code&&a(e=>{var t;const n=null==e?void 0:e.filter(e=>{var t,n;return(null==e?void 0:e.documentType)!==(null==o||null===(t=o.dropdownData)||void 0===t||null===(n=t[0])||void 0===n?void 0:n.code)});return 0===(null==f?void 0:f.length)||null===f?n:[...null==n?void 0:n.filter(e=>(null==e?void 0:e.fileStoreId)!==f),{documentType:null==o||null===(t=o.dropdownData)||void 0===t?void 0:t[0].code,fileStoreId:f,documentUid:f,fileName:(null==m?void 0:m.name)||""}]})},[f]),n.useEffect(()=>{!function(){try{r(null);const e=function(){if(m){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(m.size>=5242880)r(i("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=m&&m.type&&!e.test(null==m?void 0:m.type))r(i("NOT_SUPPORTED_FILE_TYPE"));else{const e=kt(function(){return E(null),Promise.resolve(Digit.UploadServices.Filestorage("PT",m,Digit.ULBService.getStateId())).then(function(e){var t,n,l,o;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?E(null==e||null===(l=e.data)||void 0===l||null===(o=l.files[0])||void 0===o?void 0:o.fileStoreId):r(i("CS_FILE_UPLOAD_ERROR"))})},function(){r(i("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[m]),l.createElement("div",{style:{}},l.createElement(t.LabelFieldPair,{style:{width:"98%",marginRight:"10px"}},l.createElement(t.CardLabel,{style:{width:"100%"}},null!=o&&o.required?i("TL_BUTTON_UPLOAD FILE")+"*":""+i("TL_BUTTON_UPLOAD FILE")),l.createElement("div",{className:"field",style:{width:"100%"}},l.createElement(t.MultiUploadWrapper,{module:"NOC",tenantId:d,getFormState:e=>(e=>{let t=Object.fromEntries(e),n=Object.values(t);var l;(l=n[n.length-1])&&p(l.file)})(e),t:i,allowedFileTypesRegex:/(.*?)(jpg|jpeg|png|image|pdf)$/i,allowedMaxSizeInMB:5,acceptFiles:"image/*, .pdf, .png, .jpeg, .jpg"}))))}const Hn=e=>{var i;let{t:o,noc:a,docs:r,isNoc:u,applicationData:s,NOCdata:d,bpaActionsDetails:c}=e;Digit.ULBService.getStateId();const v=Digit.ULBService.getStateId(),m=(null==s?void 0:s.status)||"",p=(null==c||null===(i=c.data)||void 0===i?void 0:i.nextActions)||[],{data:f}=Digit.Hooks.obps.useMDMS(v,"NOC",["DocumentTypeMapping"],{enabled:u}),{data:E}=Digit.Hooks.obps.useMDMS(v,"BPA",["DocTypeMapping"],{enabled:!u}),{data:g}=Digit.Hooks.obps.useMDMS(v,"common-masters",["DocumentType"]),[_,h]=n.useState([]),[A,S]=n.useState([]),[N,b]=n.useState(!1),[C,y]=Digit.Hooks.useSessionStorage(null==a?void 0:a.nocType,[]),[D,L]=n.useState(null),O=window.location.href.includes("/employee/");return n.useEffect(()=>{var e;h(null==g||null===(e=g["common-masters"])||void 0===e?void 0:e.DocumentType)},[g]),n.useEffect(()=>{var e,t,n;let l,i=[];var o,r,d,c;l=u?null==f||null===(o=f.NOC)||void 0===o||null===(r=o.DocumentTypeMapping)||void 0===r?void 0:r.filter(e=>(null==e?void 0:e.applicationType)===(null==a?void 0:a.applicationType)&&(null==e?void 0:e.nocType)===(null==a?void 0:a.nocType)):null==E||null===(d=E.BPA)||void 0===d||null===(c=d.DocTypeMapping)||void 0===c?void 0:c.filter(e=>{var t,n;return e.WFState==(null==s?void 0:s.status)&&e.RiskType==(null==s?void 0:s.riskType)&&e.ServiceType==(null==s||null===(t=s.additionalDetails)||void 0===t?void 0:t.serviceType)&&e.applicationType==(null==s||null===(n=s.additionalDetails)||void 0===n?void 0:n.applicationType)}),null!==(e=l)&&void 0!==e&&null!==(t=e[0])&&void 0!==t&&null!==(n=t.docTypes)&&void 0!==n&&n[0]&&(l[0].docTypes[0].nocType=l[0].nocType,l[0].docTypes[0].additionalDetails={submissionDetails:null==a?void 0:a.additionalDetails,applicationStatus:null==a?void 0:a.applicationStatus,appNumberLink:null==a?void 0:a.applicationNo,nocNo:null==a?void 0:a.nocNo},i.push(l[0].docTypes[0]));let v=[];i&&i.length>0&&(i.map(e=>{let t=e.documentType;e.dropdownData=[],null==_||_.forEach(n=>{let l=n.code.slice(0,null==t?void 0:t.length);t===l&&(e.hasDropdown=!0,e.dropdownData.push(n))}),v.push(e)}),S(v))},[f,_]),n.useEffect(()=>{b("NOC_VERIFICATION_INPROGRESS"===m&&(null==p?void 0:p.length)>0)},[s,c]),l.createElement("div",{style:{border:"1px solid #D6D5D4",padding:"16px 0px 16px 8px",background:"#FAFAFA",borderRadius:"5px",marginBottom:"24px",maxWidth:"950px"}},l.createElement(t.StatusTable,null,l.createElement(t.Row,{label:O?""+o("BPA_"+(null==a?void 0:a.nocType)+"_HEADER"):o("BPA_"+(null==a?void 0:a.nocType)+"_HEADER"),labelStyle:{fontSize:"20px",width:"150%"}}),d&&d.map((e,n)=>{if(null!=e&&e.value)return l.createElement(t.Row,"STATUS"==(null==e?void 0:e.field)?{className:"border-none",label:O?""+o(null==e?void 0:e.title):o(null==e?void 0:e.title),text:o(null!=e&&e.value?null==e?void 0:e.value:"CS_NA"),textStyle:"APPROVED"==(null==e?void 0:e.value)||"AUTO_APPROVED"==(null==e?void 0:e.value)?{color:"#00703C"}:{color:"#D4351C"}}:{className:"border-none",label:O?""+o(null==e?void 0:e.title):o(null==e?void 0:e.title),text:o(null!=e&&e.value?null==e?void 0:e.value:"CS_NA")})})),l.createElement(Fn,{documents:r,svgStyles:{width:"80px",height:"100px",viewBox:"0 0 25 25",minWidth:"80px"}}),N&&(null==A?void 0:A.map((e,t)=>l.createElement(Wn,{key:t,document:e,t:o,error:D,setError:L,setNocDocuments:y,nocDocuments:C,checkEnablingDocs:N}))))},jn=e=>{let{permissions:i,t:o}=e;const[a,r,u]=Digit.Hooks.useSessionStorage("OBPS_APPROVAL_CHECKS",null==i?void 0:i.map(e=>({label:e,checked:!1}))),[s,d,v]=Digit.Hooks.useSessionStorage("OBPS_NEW_APPROVALS",[]);n.useEffect(()=>()=>{Digit.SessionStorage.del("OBPS_NEW_APPROVALS"),Digit.SessionStorage.del("OBPS_APPROVAL_CHECKS")},[]);const m=window.Digit.Utils.browser.isMobile();return l.createElement("div",null,l.createElement(t.CardSubHeader,{style:{marginBottom:"16px",fontSize:"24px"}},o("BPA_PERMIT_CONDITIONS")),null==a?void 0:a.map((e,n)=>l.createElement(t.CheckBox,{key:n,styles:{margin:"20px 0 40px",maxWidth:m?"100%":"70%"},label:null==e?void 0:e.label,checked:null==e?void 0:e.checked,onChange:e=>((e,t,n)=>{const l=e.target.checked;r(()=>null==a?void 0:a.map((e,t)=>n===t?c({},e,{checked:l}):e))})(e,0,n),isLabelFirst:!0,index:n})),null==s?void 0:s.map((e,n)=>l.createElement("div",null,l.createElement(t.TextInput,{key:n,value:null==e?void 0:e.label,onChange:e=>((e,t)=>{d(()=>null==s?void 0:s.map((n,l)=>{var i;return t===l?{label:null==e||null===(i=e.target)||void 0===i?void 0:i.value}:n}))})(e,n),textInputStyle:{maxWidth:m?"96%":"830px",width:m?"96%":"830px"},style:m?{paddingRight:"10%"}:{},placeholder:o("BPA_ENTER_PERMIT_CONDITIONS_LABEL")}),l.createElement(t.LinkButton,{label:l.createElement("div",null,l.createElement("span",null,l.createElement(t.Close,{style:{float:"right",position:"relative",bottom:"32px",marginTop:"-22px",marginRight:m?"5%":"35%"}}))),style:{},onClick:e=>(e=>{const t=[...s];t.splice(e,1),d([...t])})(n)}))),l.createElement(t.LinkButton,{style:{color:"#a82227",maxWidth:m?"fit-content":"10%",marginRight:"3%"},label:o("BPA_ADD_MORE"),onClick:()=>{d([...s,{label:""}])}}))};function zn(e){let{taxHeadEstimatesCalculation:n}=e;const{taxHeadEstimates:i}=n,{t:a}=o.useTranslation();return l.createElement("div",{style:{marginTop:"40px"}},l.createElement(t.StatusTable,null,l.createElement(t.Row,{label:a("ES_PT_TITLE_TAX_HEADS"),text:a("ES_PT_TITLE_AMOUNT"),className:"border-none",textStyle:{fontWeight:"bold"}}),l.createElement(t.BreakLine,{style:{margin:"16px 0",width:"40%"}}),null==i?void 0:i.map((e,n)=>l.createElement(t.Row,{key:a(e.taxHeadCode),label:a(e.taxHeadCode),text:"₹ "+e.estimateAmount||"N/A",last:n===(null==i?void 0:i.length)-1,className:"border-none",textStyle:{color:"#505A5F"},labelStyle:{color:"#505A5F"}})),l.createElement(t.BreakLine,{style:{margin:"16px 0",width:"40%"}}),l.createElement(t.Row,{label:a("ES_PT_TITLE_TOTAL_DUE_AMOUNT"),text:"₹ "+(null==n?void 0:n.totalAmount)||"N/A",className:"border-none",textStyle:{fontSize:"24px",fontWeight:"bold"}})))}function Vn(e){let{floors:n}=e;const{t:i}=o.useTranslation();return l.createElement(l.Fragment,null,n.map(e=>{var n;return l.createElement("div",{key:i(null==e?void 0:e.title),style:{marginTop:"19px"}},l.createElement(t.CardSubHeader,{style:{marginBottom:"8px",color:"#505A5F",fontSize:"24px"}},i(null==e?void 0:e.title)),null==e||null===(n=e.values)||void 0===n?void 0:n.map((e,n)=>{var o;return l.createElement(l.Fragment,{key:n},l.createElement(t.CardSectionHeader,{style:{marginBottom:"16px",color:"#505A5F",fontSize:"16px",marginTop:0!==n?"16px":"revert"}},i(e.title)),l.createElement(t.StatusTable,{style:{position:"relative",padding:"8px"}},l.createElement("div",{style:{border:"1px solid #D6D5D4",padding:"16px",marginTop:"8px",borderRadius:"4px",background:"#FAFAFA",maxWidth:"100%"}},null==e||null===(o=e.values)||void 0===o?void 0:o.map((e,n)=>{var o;return l.createElement(t.Row,!0===e.map&&"N/A"!==e.value?{key:i(e.title),label:i(e.title),text:l.createElement("img",{src:i(e.value),alt:""})}:{key:i(e.title),label:i(e.title),text:i(e.value)||"N/A",last:n===(null==e||null===(o=e.values)||void 0===o?void 0:o.length)-1,caption:e.caption,className:"border-none"})}))))}))}))}function Gn(e){let{owners:n}=e,i={};i=window.location.href.includes("/employee/pt/")?n.slice().reverse():n;const{t:a}=o.useTranslation(),r=(null==n?void 0:n.length)||1;let u={marginTop:"19px"},s={position:"relative",padding:"8px"},d={justifyContent:"space-between",fontSize:"16px",lineHeight:"19px",color:"#0B0C0C"};return Number(r)>1?u={marginTop:"19px",background:"#FAFAFA",border:"1px solid #D6D5D4",borderRadius:"4px",padding:"8px",lineHeight:"19px",maxWidth:"600px",minWidth:"280px"}:Number(r)>1||(u={marginTop:"19px",lineHeight:"19px",maxWidth:"600px",minWidth:"280px"},s={position:"relative",marginTop:"19px"}),window.location.href.includes("obps")&&(u=c({},u,{maxWidth:"950px"}),u=c({},u,{maxWidth:"950px"}),d={}),n.sort((e,t)=>{var n,l;return(null==e||null===(n=e.additionalDetails)||void 0===n?void 0:n.ownerSequence)-(null==t||null===(l=t.additionalDetails)||void 0===l?void 0:l.ownerSequence)}),l.createElement(l.Fragment,null,l.createElement("div",{className:"owner-details"},i.map((e,n)=>{var i;return l.createElement("div",{key:a(null==e?void 0:e.title),style:u,className:"owner-details-child"},l.createElement(t.CardSubHeader,{style:Number(r)>1?{marginBottom:"8px",paddingBottom:"9px",color:"#0B0C0C",fontSize:"16px",lineHeight:"19px"}:{marginBottom:"8px",color:"#505A5F",fontSize:"24px"}},Number(r)>1?a(null==e?void 0:e.title)+" "+(n+1):a(null==e?void 0:e.title)),l.createElement(l.Fragment,{key:n},l.createElement(t.StatusTable,{style:s},l.createElement("div",{style:{maxWidth:"640px",top:0,left:0,bottom:0,right:0,width:"auto"}}),null==e||null===(i=e.values)||void 0===i?void 0:i.map((e,n)=>{var i;return!0===e.map&&"N/A"!==e.value?l.createElement(t.Row,{key:a(e.title),label:a(e.title),text:l.createElement("img",{src:a(e.value),alt:"",privacy:null==e?void 0:e.privacy})}):l.createElement("span",null,l.createElement(t.Row,{key:a(e.title),label:""+a(e.title),text:a(e.value)||"N/A",last:n===(null==e||null===(i=e.values)||void 0===i?void 0:i.length)-1,caption:e.caption,className:"border-none",textStyle:e.textStyle,privacy:null==e?void 0:e.privacy,rowContainerStyle:d}))}))))})))}const Yn=e=>{var i,a;let{scrutinyDetails:r,paymentsList:u=[],additionalDetails:s,applicationData:d}=e;(window.location.href.includes("editApplication")||"FIELDINSPECTION_INPROGRESS"==(null==d?void 0:d.status))&&window.location.href.includes("bpa");const[c,v]=n.useState(),[m,p]=n.useState(),[f,E]=n.useState(),g=Digit.ULBService.getStateId(),[_,h]=n.useState(),[A,S]=n.useState(),[N,b]=n.useState([]),[C,y]=n.useState(),[D,L]=n.useState(""),[O,T]=n.useState(null),[I,w]=n.useState({}),[P,R]=n.useState(!1),[x,B]=n.useState(!1);n.useEffect(()=>{!function(){try{T(null);const e=function(){if(C&&null!=C&&C.type){const e=function(e,t,n){if(null!==(e=".pdf".split(","))&&void 0!==e&&e.includes("."+(null==C||null===(t=C.type)||void 0===t||null===(n=t.split("/"))||void 0===n?void 0:n.pop()))){const e=function(){if(C.size>=2e6)T(F("PT_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=kt(function(){return Promise.resolve(Digit.UploadServices.Filestorage("property-upload",C,Digit.ULBService.getStateId())).then(function(e){var t,n,l,i;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?b([...N,{fileStoreId:null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId,time:new Date}]):T(F("PT_FILE_UPLOAD_ERROR"))})},function(){});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}else T(F("PT_UPLOAD_FORMAT_NOT_SUPPORTED"))}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[C]),n.useEffect(()=>{sessionStorage.setItem("uploadedFileLess",JSON.stringify(N))},[N]),n.useEffect(()=>{var e,t,n,l,i,o,a;if(null!=s&&null!==(e=s.lessAdjustmentFeeFiles)&&void 0!==e&&e.length){const e=null==s?void 0:s.lessAdjustmentFeeFiles.map((e,t)=>{var n,l,i;return t===(null==s||null===(n=s.lessAdjustmentFeeFiles)||void 0===n?void 0:n.length)-1?null==s||null===(l=s.lessAdjustmentFeeFiles[(null==s||null===(i=s.lessAdjustmentFeeFiles)||void 0===i?void 0:i.length)-1])||void 0===l?void 0:l.fileStoreId:null});Digit.UploadServices.Filefetch(e,g).then(e=>w(null==e?void 0:e.data))}v(null==s||null===(t=s.selfCertificationCharges)||void 0===t?void 0:t.BPA_DEVELOPMENT_CHARGES),sessionStorage.setItem("development",null==s||null===(n=s.selfCertificationCharges)||void 0===n?void 0:n.BPA_DEVELOPMENT_CHARGES),p(null==s||null===(l=s.selfCertificationCharges)||void 0===l?void 0:l.BPA_OTHER_CHARGES),sessionStorage.setItem("otherCharges",null==s||null===(i=s.selfCertificationCharges)||void 0===i?void 0:i.BPA_OTHER_CHARGES),E(null==s||null===(o=s.selfCertificationCharges)||void 0===o?void 0:o.BPA_LESS_ADJUSMENT_PLOT),sessionStorage.setItem("lessAdjusment",null==s||null===(a=s.selfCertificationCharges)||void 0===a?void 0:a.BPA_LESS_ADJUSMENT_PLOT),h(null==s?void 0:s.otherFeesDiscription),sessionStorage.setItem("otherChargesDisc",null==s?void 0:s.otherFeesDiscription),b(null==s?void 0:s.lessAdjustmentFeeFiles)},[s]);const{t:F}=o.useTranslation(),M=e=>null!=e&&e.value&&null!=e&&e.isTransLate?l.createElement("span",{style:{color:"#00703C"}},F(null==e?void 0:e.value)):null!=e&&e.value&&null!=e&&e.isTransLate?F(null==e?void 0:e.value):null!=e&&e.value?null==e?void 0:e.value:void F("NA");return l.createElement(n.Fragment,null,!(null!=r&&r.isChecklist)&&l.createElement("div",{style:{background:"#FAFAFA",border:"1px solid #D6D5D4",padding:"8px",borderRadius:"4px",maxWidth:"950px"}},l.createElement(t.StatusTable,null,l.createElement("div",null,null==r||null===(i=r.values)||void 0===i?void 0:i.map((e,n)=>null!=e&&e.isUnit?l.createElement(t.Row,{className:"border-none",textStyle:"Paid"===(null==e?void 0:e.value)?{color:"darkgreen"}:"Unpaid"===(null==e?void 0:e.value)?{color:"red"}:{},key:""+e.title,label:""+F(""+e.title),text:null!=e&&e.value?M(e)+" "+F(null==e?void 0:e.isUnit):F("NA"),labelStyle:null!=e&&e.isHeader?{fontSize:"20px"}:{}}):null==e||!e.isHeader||null!=e&&e.isUnit?null==e||!e.isSubTitle||null!=e&&e.isUnit?l.createElement(t.Row,{className:"border-none",textStyle:"Paid"===(null==e?void 0:e.value)?{color:"darkgreen",wordBreak:"break-all"}:"Unpaid"===(null==e?void 0:e.value)?{color:"red",wordBreak:"break-all"}:{wordBreak:"break-all"},key:""+e.title,label:""+F(""+e.title),text:M(e),labelStyle:null!=e&&e.isHeader?{fontSize:"20px"}:{}}):l.createElement(t.CardSubHeader,{style:{fontSize:"20px",paddingBottom:"10px",margin:"0px"}},F(null==e?void 0:e.title)):l.createElement(t.CardSubHeader,{style:{fontSize:"20px",paddingBottom:"10px"}},F(null==e?void 0:e.title))),null==r||null===(a=r.permit)||void 0===a?void 0:a.map((e,n)=>l.createElement(t.CardLabel,{style:{fontWeight:"400"}},null==e?void 0:e.title))))))},Kn=e=>{var i,a,r,u,s;let{edcrDetails:d,applicationData:c}=e;const{t:v}=o.useTranslation(),m=window.Digit.Utils.browser.isMobile(),p=[{name:"BPA_TABLE_COL_FLOOR",id:"Floor"},{name:"BPA_TABLE_COL_LEVEL",id:"Level"},{name:"BPA_TABLE_COL_OCCUPANCY",id:"Occupancy"},{name:"BPA_TABLE_COL_BUILDUPAREA",id:"BuildupArea"},{name:"BPA_TABLE_COL_DEDUCTION",id:"Deduction"},{name:"BPA_TABLE_COL_FLOORAREA",id:"FloorArea"}],f=e=>{const t=e;return(e,n,l)=>e[t]},E=n.useMemo(()=>p.map(e=>({Header:v(""+e.name),accessor:f(e.id),id:e.id})));function g(e){var t;let n=[],l=0,i=0,o=0;return null==e||null===(t=e.building)||void 0===t||t.floors.map(e=>{var t,a,r,u,s,d,c,m,p,f,E,g,_,h;const A=Number(null===(t=e.occupancies)||void 0===t||null===(a=t[0])||void 0===a?void 0:a.builtUpArea)||0,S=Number(null===(r=e.occupancies)||void 0===r||null===(u=r[0])||void 0===u?void 0:u.floorArea)||0,N=Number(null===(s=e.occupancies)||void 0===s||null===(d=s[0])||void 0===d?void 0:d.deduction)||0;l+=A,i+=S,o+=N,n.push({Floor:v("BPA_FLOOR_NAME_"+e.number),Level:e.number,Occupancy:v(""+(null===(c=e.occupancies)||void 0===c||null===(m=c[0])||void 0===m?void 0:m.type)),BuildupArea:Number(null===(p=e.occupancies)||void 0===p||null===(f=p[0])||void 0===f?void 0:f.builtUpArea).toFixed(2),Deduction:Number(null===(E=e.occupancies)||void 0===E||null===(g=E[0])||void 0===g?void 0:g.deduction).toFixed(2),FloorArea:Number(null===(_=e.occupancies)||void 0===_||null===(h=_[0])||void 0===h?void 0:h.floorArea).toFixed(2)||0,key:v("BPA_FLOOR_NAME_"+e.number)})}),n.push({Floor:v("BPA_TOTAL"),Level:"",Occupancy:"",BuildupArea:Number(l).toFixed(2)+" "+v("BPA_SQ_MTRS_LABEL"),Deduction:Number(o).toFixed(2)+" "+v("BPA_SQ_MTRS_LABEL"),FloorArea:Number(i).toFixed(2)+" "+v("BPA_SQ_MTRS_LABEL")}),n}function _(e){var t;let n=null==c||null===(t=c.landInfo)||void 0===t?void 0:t.unit,l="";if((null==n?void 0:n.length)>0){var i,o;let t=null===(i=n[e])||void 0===i||null===(o=i.usageCategory)||void 0===o?void 0:o.split(",");null!=t&&t.length&&(l=t.map(e=>e?""+v("BPA_SUBOCCUPANCYTYPE_"+function(e,t,n){if(void 0===e&&(e=""),void 0===t&&(t=""),void 0===n&&(n=""),""==t)return e;for(;e.includes(t);)e=e.replace(t,n);return e}(null==e?void 0:e.toUpperCase(),"-","_")):"NA").join(", "))}return l||"NA"}return l.createElement(n.Fragment,null,l.createElement("div",{style:{background:"#FAFAFA",border:"1px solid #D6D5D4",padding:"8px",borderRadius:"4px",maxWidth:"950px",minWidth:"280px"}},null==d||null===(i=d.values)||void 0===i?void 0:i.map((e,n)=>null!=e&&e.isHeader?l.createElement(t.CardSubHeader,{style:{fontSize:"20px",paddingBottom:"10px"}},v(null==e?void 0:e.title)):l.createElement(t.Row,{className:"border-none",labelStyle:{width:"100%",fontSize:"20px"},key:""+e.title,label:""+v(""+e.title),text:null!=e&&e.value?null==e?void 0:e.value:""})),null==d||null===(a=d.subOccupancyTableDetails)||void 0===a||null===(r=a[0])||void 0===r||null===(u=r.value)||void 0===u||null===(s=u.planDetail)||void 0===s?void 0:s.blocks.map((e,n)=>{var i,o,a,r,u;return l.createElement("div",{key:n,style:(null==d||null===(i=d.subOccupancyTableDetails)||void 0===i||null===(o=i[0])||void 0===o||null===(a=o.value)||void 0===a||null===(r=a.planDetail)||void 0===r||null===(u=r.blocks)||void 0===u?void 0:u.length)>0?{marginBottom:"30px",background:"#FAFAFA",border:"1px solid #D6D5D4",padding:"8px",borderRadius:"4px",maxWidth:"950px",minWidth:"280px"}:{marginBottom:"30px"}},l.createElement(t.CardSubHeader,{style:{marginBottom:"8px",paddingBottom:"9px",color:"#0B0C0C",fontSize:"18px",lineHeight:"19px"}},v("BPA_BLOCK_SUBHEADER")," ",n+1),l.createElement(t.StatusTable,null,l.createElement(t.Row,{className:"border-none",textStyle:{wordBreak:"break-word"},label:""+v("BPA_SUB_OCCUPANCY_LABEL"),text:_(n)})),l.createElement("div",{style:window.location.href.includes("citizen")||m?{overflow:"scroll"}:{maxWidth:"950px",maxHeight:"280px"}},l.createElement(t.Table,{className:"customTable table-fixed-first-column table-border-style",t:v,disableSort:!0,autoSort:!1,manualPagination:!1,isPaginationRequired:!1,initSortId:"S N ",data:g(e),columns:E,getCellProps:e=>({style:{}})})))})))},qn=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))},Xn=e=>{var i,a,r;let{data:u,OpenImage:s,privacy:d={}}=e;const[c,v]=n.useState(!1),{t:m}=o.useTranslation();return l.createElement("div",null,u.date&&l.createElement("p",null,u.date),l.createElement("p",null,u.name),u.mobileNumber&&l.createElement("span",{style:{display:"inline-flex",width:"fit-content",marginLeft:"10px"}},l.createElement(t.TelePhone,{mobile:u.mobileNumber,privacy:d}),l.createElement("p",null," ")),u.source&&l.createElement("p",null,m("ES_APPLICATION_DETAILS_APPLICATION_CHANNEL_"+u.source.toUpperCase())),u.comment&&l.createElement(qn,{otherComment:null==u?void 0:u.otherComment,headComment:null==u?void 0:u.comment}),null!=u&&u.wfComment?l.createElement("div",null,null==u||null===(i=u.wfComment)||void 0===i?void 0:i.map(e=>l.createElement("div",{className:"TLComments"},l.createElement("h3",null,m("WF_COMMON_COMMENTS")),!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"}},m("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"}},m("View Less")))))):null,(null==u||null===(a=u.thumbnailsToShow)||void 0===a||null===(r=a.thumbs)||void 0===r?void 0:r.length)>0?l.createElement("div",{className:"TLComments"},l.createElement("h3",null,m("CS_COMMON_ATTACHMENTS")),l.createElement(t.DisplayPhotos,{srcs:null==u?void 0:u.thumbnailsToShow.thumbs,onClick:(e,t)=>{s(e,t,null==u?void 0:u.thumbnailsToShow)}})):null)};function Jn(e){let{units:n}=e;const{t:i}=o.useTranslation();return l.createElement(l.Fragment,null,n.map((e,n)=>{var o;return l.createElement("div",{key:i(null==e?void 0:e.title),style:{marginTop:"19px",background:"#FAFAFA",border:"1px solid #D6D5D4",borderRadius:"4px",padding:"8px",lineHeight:"19px",maxWidth:"600px",minWidth:"280px"}},l.createElement(t.CardSubHeader,{style:{marginBottom:"8px",paddingBottom:"9px",color:"#0B0C0C",fontSize:"16px",lineHeight:"19px"}},i(null==e?void 0:e.title)+" "+(n+1)),l.createElement(l.Fragment,{key:n},l.createElement(t.StatusTable,{style:{position:"relative",marginTop:"19px"}},l.createElement("div",{style:{position:"absolute",maxWidth:"640px",top:0,left:0,bottom:0,right:0,width:"auto"}}),null==e||null===(o=e.values)||void 0===o?void 0:o.map((e,n)=>{var o;return l.createElement(t.Row,!0===e.map&&"N/A"!==e.value?{key:i(e.title),label:i(e.title),text:l.createElement("img",{src:i(e.value),alt:""})}:{key:i(e.title),label:i(e.title)+":",text:i(e.value)||"N/A",last:n===(null==e||null===(o=e.values)||void 0===o?void 0:o.length)-1,caption:e.caption,className:"border-none",rowContainerStyle:{justifyContent:"space-between",fontSize:"16px",lineHeight:"19px",color:"#0B0C0C"}})}))))}))}function Qn(e){let{units:n}=e;const{t:i}=o.useTranslation();return l.createElement(l.Fragment,null,n.map((e,n)=>{var o;return l.createElement("div",{key:i(null==e?void 0:e.title),style:{marginTop:"19px",background:"#FAFAFA",border:"1px solid #D6D5D4",borderRadius:"4px",padding:"8px",lineHeight:"19px",maxWidth:"600px",minWidth:"280px"}},l.createElement(t.CardSubHeader,{style:{marginBottom:"9px",paddingBottom:"9px",color:"#0B0C0C",fontSize:"16px",lineHeight:"19px"}},i(null==e?void 0:e.title)+" "+(n+1)),l.createElement(l.Fragment,{key:n},l.createElement(t.StatusTable,{style:{position:"relative",marginTop:"19px"}},l.createElement("div",{style:{position:"absolute",maxWidth:"640px",top:0,left:0,bottom:0,right:0,width:"auto"}}),null==e||null===(o=e.values)||void 0===o?void 0:o.map((e,n)=>{var o;return l.createElement(t.Row,!0===e.map&&"N/A"!==e.value?{key:i(e.title),label:i(e.title),text:l.createElement("img",{src:i(e.value),alt:""})}:{key:i(e.title),label:i(e.title)+":",text:i(e.value)||"NA",last:n===(null==e||null===(o=e.values)||void 0===o?void 0:o.length)-1,caption:e.caption,className:"border-none",rowContainerStyle:{justifyContent:"space-between",fontSize:"16px",lineHeight:"19px",color:"#0B0C0C"}})}))))}))}const Zn=e=>{var i,a,r,u,s;let{wsAdditionalDetails:d}=e;const{t:c}=o.useTranslation();let v=(m=location.search)?(/^[?#]/.test(m)?m.slice(1):m).split("&").reduce((e,t)=>{let[n,l]=t.split("=");return e[n]=l?decodeURIComponent(l.replace(/\+/g," ")):"",e},{}):{};var m;const p=null==v?void 0:v.mode;var{connectionDetails:f,plumberDetails:E,roadCuttingDetails:g,roadCuttingAddlDetails:_,activationDetails:h}=(null==d?void 0:d.additionalDetails)||{connectionDetails:[],plumberDetails:[],roadCuttingAddlDetails:[]};return l.createElement(n.Fragment,null,l.createElement("div",{style:{lineHeight:"19px",maxWidth:"950px",minWidth:"280px"}},(null==d||null===(i=d.additionalDetails)||void 0===i?void 0:i.connectionDetails)&&l.createElement(t.StatusTable,null,l.createElement(t.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==f?void 0:f.map((e,n)=>l.createElement("div",null,l.createElement(t.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==d||null===(a=d.additionalDetails)||void 0===a?void 0:a.plumberDetails)&&"MODIFY"!=p&&l.createElement(t.StatusTable,null,l.createElement(t.CardSubHeader,{style:{fontSize:"24px",marginBottom:"16px",marginTop:"32px"}},c("WS_COMMON_PLUMBER_DETAILS")),l.createElement("div",null,l.createElement("div",{className:"plumber-details-new-value-wrapper"},null==E?void 0:E.map((e,n)=>l.createElement(t.Row,{className:"border-none",key:""+e.title,label:""+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==d||null===(r=d.additionalDetails)||void 0===r?void 0:r.roadCuttingDetails)&&"MODIFY"!=p&&l.createElement(t.StatusTable,null,l.createElement(t.CardSubHeader,{style:{fontSize:"24px",marginBottom:"16px",marginTop:"32px"}},c("WS_COMMON_ROAD_CUTTING_DETAILS")),l.createElement("div",null,l.createElement("div",{className:"road-cutting-details-new-value-wrapper"},null==g?void 0:g.map(e=>{var n;return l.createElement("div",{style:(null==g?void 0:g.length)>1?{border:"1px solid #D6D5D4",background:"#FAFAFA",borderRadius:"4px",padding:"10px 10px 0px 10px",margin:"5px 0px"}:{}},null==e||null===(n=e.values)||void 0===n?void 0:n.map(e=>l.createElement(t.Row,{className:"border-none",key:""+e.title,label:""+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==d||null===(u=d.additionalDetails)||void 0===u?void 0:u.roadCuttingAddlDetails)&&l.createElement("div",null,l.createElement("br",null),l.createElement("div",{className:"road-cutting-addl-details-new-value-wrapper"},null==_?void 0:_.map((e,n)=>l.createElement("div",null,l.createElement(t.Row,{className:"border-none",key:""+e.title,label:""+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==d||null===(s=d.additionalDetails)||void 0===s?void 0:s.activationDetails)&&l.createElement(t.StatusTable,null,l.createElement(t.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==h?void 0:h.map((e,n)=>l.createElement(t.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:""})))))))},$n=[{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"}],el=[{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"}],tl=e=>{var i,a,r,u;let{wsAdditionalDetails:s}=e;const{t:d}=o.useTranslation(),[v,m,p]=Digit.Hooks.useSessionStorage("ADHOC_ADD_REBATE_DATA",{}),[f,E,g]=Digit.Hooks.useSessionStorage("ADHOC_BILL_ADD_REBATE_DATA",{}),h=!(null==s||null===(i=s.additionalDetails)||void 0===i||!i.isPaid),[A,S]=n.useState(!1),[N,b]=n.useState(v||{}),[C,y]=n.useState(null),[D,L]=n.useState(s.additionalDetails.data?s.additionalDetails.data:{}),[O,T]=n.useState(s.additionalDetails.values?s.additionalDetails.values:[]),I=Digit.ULBService.getStateId();Digit.Hooks.ws.useMDMS(I,"BillingService",["TaxHeadMaster"]),n.useEffect(()=>{var e,t,n;const i=c({},null==s||null===(e=s.additionalDetails)||void 0===e||null===(t=e.appDetails)||void 0===t?void 0:t.additionalDetails);if((null==v||null===(n=v.billDetails)||void 0===n?void 0:n.length)>0){var o,a,r,u,d,p,f;const e=[{title:"WS_APPLICATION_FEE_HEADER",value:l.createElement("span",null,"₹",null==v||null===(o=v.billDetails)||void 0===o||null===(a=o[0])||void 0===a?void 0:a.fee)},{title:"WS_SERVICE_FEE_HEADER",value:l.createElement("span",null,"₹",null==v||null===(r=v.billDetails)||void 0===r||null===(u=r[0])||void 0===u?void 0:u.charge)},{title:"WS_TAX_HEADER",value:l.createElement("span",null,"₹",null==v||null===(d=v.billDetails)||void 0===d||null===(p=d[0])||void 0===p?void 0:p.taxAmount)}];T(e),L(null==v||null===(f=v.billDetails)||void 0===f?void 0:f[0])}else m(i),b(i)},[]);let w={};const P=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"})),x=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(R,null)),B=function(e,t,n){void 0===t&&(t=!1);let l=c({},N);if("adhocPenalty"!=e&&"adhocRebate"!=e||!n.target.value)t?(l[e+"_data"]=n,l[e]=n.title,"PT_OTHERS"==n.title&&"adhocPenaltyReason"==e&&(l.adhocPenaltyComment=""),"PT_OTHERS"==n.title&&"adhocRebateReason"==e&&(l.adhocRebateComment="")):l[e]=n.target.value;else{var i,o;const t=0==(null==n||null===(i=n.target)||void 0===i?void 0:i.value)?1:Math.sign(null==n||null===(o=n.target)||void 0===o?void 0:o.value)||-1;l[e]=1==t?n.target.value:""}b(l)};return l.createElement(n.Fragment,null,l.createElement("div",{style:{lineHeight:"19px",maxWidth:"950px",minWidth:"280px"}},O&&l.createElement(t.StatusTable,null,l.createElement("div",null,null==O?void 0:O.map((e,n)=>l.createElement(t.Row,{className:"border-none",key:""+e.title,label:""+d(""+e.title),text:null!=e&&e.value?null==e?void 0:e.value:""}))),l.createElement("hr",{style:{border:"1px solid #D6D5D4",color:"#D6D5D4",margin:"16px 0px"}}),l.createElement("div",null,l.createElement(t.Row,{className:"border-none",key:"WS_COMMON_TOTAL_AMT",label:""+d("WS_COMMON_TOTAL_AMT"),text:l.createElement("span",null,"₹",(null==D?void 0:D.totalAmount)||0),textStyle:{fontSize:"24px",fontWeight:"700"}}),l.createElement(t.Row,{className:"border-none",key:"CS_INBOX_STATUS_FILTER",label:""+d("CS_INBOX_STATUS_FILTER"),text:d(h?"WS_COMMON_PAID_LABEL":"WS_COMMON_NOT_PAID"),textStyle:h?{color:"#00703C"}:{color:"#D4351C"}}))),null!=s&&null!==(a=s.additionalDetails)&&void 0!==a&&a.isAdhocRebate?l.createElement("div",{onClick:e=>{S(!0)}},l.createElement("span",{style:{cursor:"pointer",color:"#a82227"}},d("WS_PAYMENT_ADD_REBATE_PENALTY"))):null,A&&l.createElement(t.Modal,{headerBarMain:l.createElement(P,{label:d("PT_ADD_REBATE_PENALITY")}),headerBarEnd:l.createElement(x,{onClick:()=>{b(v),S(!1)}}),actionCancelLabel:d("PT_CANCEL"),actionCancelOnSubmit:()=>{b(v),S(!1)},actionSaveLabel:d("PT_ADD"),actionSaveOnSubmit:e=>(e=>{const t=null!=N&&N.adhocPenalty?Number(null==N?void 0:N.adhocPenalty):0,n=null!=N&&N.adhocRebate?Number(null==N?void 0:N.adhocRebate):0;var l,i;if(t||n)if(n>(null==s||null===(l=s.additionalDetails)||void 0===l||null===(i=l.data)||void 0===i?void 0:i.totalAmount))y({isError:!1,isWarning:!0,key:"error",message:d("ERR_WS_REBATE_GREATER_THAN_AMOUNT")});else{var o,a,r,u,v,p,f,g,h,A;const e=null==s||null===(o=s.additionalDetails)||void 0===o||null===(a=o.appDetails)||void 0===a?void 0:a.applicationNo,t=null==s||null===(r=s.additionalDetails)||void 0===r||null===(u=r.appDetails)||void 0===u?void 0:u.tenantId,n=c({},null==s||null===(v=s.additionalDetails)||void 0===v||null===(p=v.appDetails)||void 0===p?void 0:p.additionalDetails,N);s.additionalDetails.appDetails.additionalDetails=n;const l={CalculationCriteria:"WATER"==(null==s||null===(f=s.additionalDetails)||void 0===f||null===(g=f.appDetails)||void 0===g?void 0:g.service)?[{applicationNo:e,tenantId:t,waterConnection:s.additionalDetails.appDetails}]:[{applicationNo:e,tenantId:t,sewerageConnection:s.additionalDetails.appDetails}],isconnectionCalculation:!1};let i="WATER"==(null==s||null===(h=s.additionalDetails)||void 0===h||null===(A=h.appDetails)||void 0===A?void 0:A.service)?"WS":"SW";Digit.WSService.wsCalculationEstimate(l,i).then((e,t)=>{var n,l,i,o,a,r,u,s,d,c,v,p,f,g,h;(null==e||null===(n=e.Calculation)||void 0===n||null===(l=n[0])||void 0===l||null===(i=l.taxHeadEstimates)||void 0===i?void 0:i.length)>0&&(null==e||null===(f=e.Calculation)||void 0===f||null===(g=f[0])||void 0===g||null===(h=g.taxHeadEstimates)||void 0===h||h.forEach(e=>e.amount=e.estimateAmount)),e.Calculation[0].billSlabData=_.groupBy(null==e||null===(o=e.Calculation)||void 0===o||null===(a=o[0])||void 0===a?void 0:a.taxHeadEstimates,"category");const A=[{title:"WS_APPLICATION_FEE_HEADER",value:null===(r=e.Calculation)||void 0===r||null===(u=r[0])||void 0===u?void 0:u.fee},{title:"WS_SERVICE_FEE_HEADER",value:null===(s=e.Calculation)||void 0===s||null===(d=s[0])||void 0===d?void 0:d.charge},{title:"WS_TAX_HEADER",value:null===(c=e.Calculation)||void 0===c||null===(v=c[0])||void 0===v?void 0:v.taxAmount}];E(ht(e.Calculation[0])),L(null==e||null===(p=e.Calculation)||void 0===p?void 0:p[0]),T(A),N.billDetails=null==e?void 0:e.Calculation,m(N),S(!1)}).catch(e=>{var t,n,l,i,o,a;y({isError:!0,isWarning:!1,key:"error",message:null!=e&&null!==(t=e.response)&&void 0!==t&&null!==(n=t.data)&&void 0!==n&&null!==(l=n.Errors[0])&&void 0!==l&&l.message?d(""+(null==e||null===(i=e.response)||void 0===i||null===(o=i.data)||void 0===o||null===(a=o.Errors[0])||void 0===a?void 0:a.code)):d("PT_COMMON_ADD_REBATE_PENALITY")})})}else y({isError:!1,isWarning:!0,key:"warning",message:d("ERR_WS_ENTER_ATLEAST_ONE_FIELD")})})(),hideSubmit:!1,popupStyles:{overflowY:"auto"}},l.createElement("div",null,l.createElement(t.Card,{style:{padding:"10px 10px 1px 10px",margin:"0px 0px 15px 0px"}},l.createElement(t.CardSectionHeader,{style:{fontSize:"16px",fontWeight:"700",lineHeight:"18px",padding:"0px",margin:"0px 0px 10px 0px"}},d("PT_AD_PENALTY")),l.createElement(t.CardLabel,null,d("PT_TX_HEADS")),l.createElement("div",{className:"field"},l.createElement(t.Dropdown,{isMandatory:!0,option:$n,optionKey:"title",select:e=>B("adhocPenaltyReason",!0,e),selected:(null==N?void 0:N.adhocPenaltyReason_data)||"",isPropertyAssess:!0,name:"adhocPenaltyReason_data",t:d})),"PT_OTHERS"===(null==N||null===(r=N.adhocPenaltyReason_data)||void 0===r?void 0:r.title)&&l.createElement("div",{className:"field"},l.createElement(t.CardLabel,null,d("PT_REASON")),l.createElement("div",{className:"field"},l.createElement(t.TextInput,c({style:{background:"#FAFAFA"},t:d,type:"text",isMandatory:!1,name:"adhocPenaltyComment",value:(null==N?void 0:N.adhocPenaltyComment)||"",onChange:e=>B("adhocPenaltyComment",!1,e)},w={isRequired:!0,pattern:"^[a-zA-Z ]*$",type:"text",title:d("TL_NAME_ERROR_MESSAGE")})))),l.createElement(t.CardLabel,null,d("PT_HEAD_AMT")),l.createElement("div",{className:"field"},l.createElement(t.TextInput,c({style:{background:"#FAFAFA"},t:d,type:"number",isMandatory:!1,name:"adhocPenalty",value:(null==N?void 0:N.adhocPenalty)||"",onChange:e=>B("adhocPenalty",!1,e)},w={isRequired:!0,pattern:"^[1-9]+[0-9]*$",title:d("ERR_DEFAULT_INPUT_FIELD_MSG")})))),l.createElement(t.Card,{style:{padding:"10px 10px 1px 10px",margin:"0px 0px 15px 0px"}},l.createElement(t.CardSectionHeader,{style:{fontSize:"16px",fontWeight:"700",lineHeight:"18px",padding:"0px",margin:"0px 0px 10px 0px"}},d("PT_AD_REBATE")),l.createElement(t.CardLabel,null,d("PT_TX_HEADS")),l.createElement("div",{className:"field"},l.createElement(t.Dropdown,{isMandatory:!0,option:el,optionKey:"title",select:e=>B("adhocRebateReason",!0,e),selected:(null==N?void 0:N.adhocRebateReason_data)||"",name:"adhocRebateReason_data",isPropertyAssess:!0,t:d})),"PT_OTHERS"===(null==N||null===(u=N.adhocRebateReason_data)||void 0===u?void 0:u.title)&&l.createElement("div",{className:"field"},l.createElement(t.CardLabel,null,d("PT_REASON")),l.createElement(t.TextInput,c({style:{background:"#FAFAFA"},t:d,type:"text",isMandatory:!1,name:"adhocRebateComment",value:(null==N?void 0:N.adhocRebateComment)||"",onChange:e=>B("adhocRebateComment",!1,e)},w={isRequired:!0,pattern:"^[a-zA-Z ]*$",type:"text",title:d("TL_NAME_ERROR_MESSAGE")}))),l.createElement(t.CardLabel,null,d("PT_HEAD_AMT")),l.createElement("div",{className:"field"},l.createElement(t.TextInput,c({style:{background:"#FAFAFA"},t:d,type:"number",isMandatory:!1,name:"adhocRebate",value:(null==N?void 0:N.adhocRebate)||"",onChange:e=>B("adhocRebate",!1,e)},w={isRequired:!0,pattern:"^[1-9]+[0-9]*$",title:d("ERR_DEFAULT_INPUT_FIELD_MSG")})))))," "),C&&l.createElement(t.Toast,{style:{zIndex:"10000"},warning:null==C?void 0:C.isWarning,error:null==C||!C.isWarning,label:d(null==C?void 0:C.message),onClose:()=>{y(!1)},isDleteBtn:!0})))},nl=e=>{var i,a,r,u,s,d,c;let{wsAdditionalDetails:v}=e;const{t:m}=o.useTranslation(),[p,f]=n.useState(!1),[E,g]=n.useState({}),_=e=>l.createElement("h1",{className:"heading-m"},e.label),h=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),A=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(h,null));return l.createElement(n.Fragment,null,l.createElement("div",{style:{lineHeight:"19px",maxWidth:"950px",minWidth:"280px"}},null!=v&&null!==(i=v.additionalDetails)&&void 0!==i&&i.isViewBreakup?l.createElement("div",{onClick:e=>(()=>{var e;let t=v.additionalDetails.data||{};const n=sessionStorage.getItem("Digit.ADHOC_BILL_ADD_REBATE_DATA"),l=n?JSON.parse(n):{};null!=l&&null!==(e=l.value)&&void 0!==e&&e.totalAmount&&(t=null==l?void 0:l.value),g(t),f(!0)})(),style:{marginTop:"12px"}},l.createElement("span",{style:{cursor:"pointer",color:"#a82227"}},m("WS_PAYMENT_VIEW_BREAKUP"))):null,p&&l.createElement(t.Modal,{headerBarMain:l.createElement(_,{label:m("WS_CALCULATION_BREAKUP")}),headerBarEnd:l.createElement(A,{onClick:()=>{f(!1)}}),hideSubmit:!0,popupStyles:{overflowY:"auto"},headerBarMainStyle:{marginBottom:"0px"},popupModuleMianStyles:{paddingTop:"0px"}},l.createElement(t.StatusTable,{style:{padding:"10px",paddingTop:"0px"}},l.createElement(t.CardSectionHeader,{style:{margin:"10px 0px"}},m("WS_APPLICATION_FEE_HEADER")),null==E||null===(a=E.billSlabData)||void 0===a||null===(r=a.FEE)||void 0===r?void 0:r.map(e=>l.createElement(t.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:""+(null==e?void 0:e.taxHeadCode),label:""+m(""+(null==e?void 0:e.taxHeadCode)),text:l.createElement("span",null,"₹",Number(null==e?void 0:e.amount)||0),textStyle:{textAlign:"right"}})),l.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",marginBottom:"10px"}}),l.createElement(t.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:"PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT1",label:""+m("PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT"),text:l.createElement("span",null,"₹",Number(null==E?void 0:E.fee)||0),textStyle:{textAlign:"right",fontWeight:"700",fontSize:"24px"}}),l.createElement(t.CardSectionHeader,{style:{margin:"10px 0px"}},m("WS_SERVICE_FEE_HEADER")),null==E||null===(u=E.billSlabData)||void 0===u||null===(s=u.CHARGES)||void 0===s?void 0:s.map(e=>l.createElement(t.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:""+(null==e?void 0:e.taxHeadCode),label:""+m(""+(null==e?void 0:e.taxHeadCode)),text:l.createElement("span",null,"₹",Number(null==e?void 0:e.amount)||0),textStyle:{textAlign:"right"}})),l.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",marginBottom:"10px"}}),l.createElement(t.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:"PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT2",label:""+m("PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT"),text:l.createElement("span",null,"₹",Number(null==E?void 0:E.charge)||0),textStyle:{textAlign:"right",fontWeight:"700",fontSize:"24px"}}),null==E||null===(d=E.billSlabData)||void 0===d||null===(c=d.TAX)||void 0===c?void 0:c.map(e=>l.createElement(t.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:""+(null==e?void 0:e.taxHeadCode),label:""+m(""+(null==e?void 0:e.taxHeadCode)),text:l.createElement("span",null,"₹",Number(null==e?void 0:e.amount)||0),textStyle:{textAlign:"right"}})),l.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",marginBottom:"10px"}}),l.createElement(t.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:"PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT3",label:""+m("PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT"),text:l.createElement("span",null,"₹",Number(null==E?void 0:E.totalAmount)||0),textStyle:{textAlign:"right",fontWeight:"700",fontSize:"24px"}})))))},ll=e=>{let{assessmentData:t}=e;const[i,o]=n.useState(!1);return l.createElement("div",{className:"accordion",style:{width:"100%",margin:"auto",fontFamily:"Roboto, sans-serif",border:"1px solid #ccc",borderRadius:"4px",marginBottom:"10px"}},l.createElement("div",{className:"accordion-header",style:{backgroundColor:"#f0f0f0",padding:"15px",cursor:"pointer"},onClick:()=>{o(!i)}},l.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"}},l.createElement("h3",{style:{color:"#0d43a7",fontFamily:"Noto Sans,sans-serif",fontSize:"24px",fontWeight:"500"}},"Assessment History"),l.createElement("span",{style:{fontSize:"1.2em"}},i?"<":">"))),i&&l.createElement("div",{className:"accordion-body",style:{padding:" 15px",backgroundColor:"#fff"}},t.map((e,n)=>l.createElement("div",{key:n,className:"assessment-item",style:{marginBottom:"15px"}},l.createElement("div",{className:"assessment-row",style:{display:"flex",gap:"100px",marginBottom:"8px"}},l.createElement("span",{style:{fontWeight:"bold",minWidth:"60px",color:"black"}},"Assessment Date"),l.createElement("span",{style:{flex:"1",color:"black"}},new Date(e.assessmentDate).toLocaleDateString("en-GB",{day:"2-digit",month:"short",year:"numeric"}).replace(/ /g,"-"))),l.createElement("div",{className:"assessment-row",style:{display:"flex",gap:"100px",marginBottom:"8px",color:"black"}},l.createElement("span",{className:"label",style:{fontWeight:"bold",minWidth:"60px",color:"black"}},"Assessment Year"),l.createElement("span",{className:"value",style:{flex:"1",color:"black"}},e.financialYear)),l.createElement("div",{className:"assessment-row with-buttons",style:{display:"flex",marginBottom:"8px",justifyContent:"space-between",alignItems:"center"}},l.createElement("div",{style:{display:"flex",gap:"75px"}},l.createElement("span",{className:"label",style:{fontWeight:"bold",minWidth:"60px",color:"black"}},"Assessment Number"),l.createElement("span",{className:"value",style:{flex:"1",color:"black"}},e.assessmentNumber)),l.createElement("div",{className:"button-group",style:{display:"flex",gap:"10px"}}," ",l.createElement("button",{style:{display:"flex",borderRadius:"8px",backgroundColor:"#2947a3",padding:"10px",color:"white"},onClick:()=>alert("Re-assessing "+e.number)},"Re-assess")," ",l.createElement("button",{style:{display:"flex",borderRadius:"8px",border:"1px solid red",padding:"10px"},onClick:()=>alert("Cancelled "+e.number)},"Cancel")," ")),n!==t.length-1&&l.createElement("hr",null)))))},il=e=>{var t;let{applicationData:o}=e;const[a,r]=n.useState(!1);return i.useHistory(),l.createElement("div",{className:"accordion",style:{width:"100%",margin:"auto",fontFamily:"Roboto, sans-serif",border:"1px solid #ccc",borderRadius:"4px",marginBottom:"10px"}},l.createElement("div",{className:"accordion-header",style:{backgroundColor:"#f0f0f0",padding:"15px",cursor:"pointer"},onClick:()=>{r(!a)}},l.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"}},l.createElement("h3",{style:{color:"#0d43a7",fontFamily:"Noto Sans,sans-serif",fontSize:"24px",fontWeight:"500"}},"Application History"),l.createElement("span",{style:{fontSize:"1.2em"}},a?"<":">"))),a&&l.createElement("div",{className:"accordion-body",style:{padding:" 15px",backgroundColor:"#fff"}},l.createElement("div",{className:"assessment-item",style:{marginBottom:"15px"}},l.createElement("div",{className:"assessment-row",style:{display:"flex",gap:"100px",marginBottom:"8px"}},l.createElement("span",{style:{fontWeight:"bold",minWidth:"60px",color:"black"}},"Application Number"),l.createElement("span",{style:{flex:"1",color:"black"}},o.acknowldgementNumber)),l.createElement("div",{className:"assessment-row",style:{display:"flex",gap:"132px",marginBottom:"8px",color:"black"}},l.createElement("span",{className:"label",style:{fontWeight:"bold",minWidth:"60px",color:"black"}},"Property ID No."),l.createElement("span",{className:"value",style:{flex:"1",color:"black"}},o.propertyId)),l.createElement("div",{className:"assessment-row",style:{display:"flex",gap:"120px",marginBottom:"8px",color:"black"}},l.createElement("span",{className:"label",style:{fontWeight:"bold",minWidth:"60px",color:"black"}},"Application Type"),l.createElement("span",{className:"value",style:{flex:"1",color:"black"}},"NEW PROPERTY")),l.createElement("div",{className:"assessment-row",style:{display:"flex",gap:"140px",marginBottom:"8px",color:"black"}},l.createElement("span",{className:"label",style:{fontWeight:"bold",minWidth:"60px",color:"black"}},"Creation Date"),l.createElement("span",{className:"value",style:{flex:"1",color:"black"}},(u=null===(t=o.auditDetails)||void 0===t?void 0:t.createdTime,new Date(u).toLocaleDateString("en-GB",{day:"2-digit",month:"short",year:"numeric"}).replace(/ /g,"-")))),l.createElement("div",{className:"assessment-row",style:{display:"flex",gap:"180px",marginBottom:"8px",color:"black"}},l.createElement("span",{className:"label",style:{fontWeight:"bold",minWidth:"60px",color:"black"}},"Status"),l.createElement("span",{className:"value",style:{flex:"1",color:"black"}},o.status)),l.createElement("div",null,l.createElement(i.Link,{to:{pathname:"/digit-ui/citizen/pt/property/application-preview/"+o.acknowldgementNumber,state:{propertyId:o.propertyId}},style:{color:"#2947a3",display:"inline",border:"1px solid",padding:"8px",borderRadius:"8px"}},"View History")))));var u},ol=e=>{let{payments:t}=e;const[i,o]=n.useState(!1);return l.createElement("div",{className:"accordion",style:{width:"100%",margin:"auto",fontFamily:"Roboto, sans-serif",border:"1px solid #ccc",borderRadius:"4px",marginBottom:"10px"}},l.createElement("div",{className:"accordion-header",style:{backgroundColor:"#f0f0f0",padding:"15px",cursor:"pointer"},onClick:()=>{o(!i)}},l.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"}},l.createElement("h3",{style:{color:"#0d43a7",fontFamily:"Noto Sans,sans-serif",fontSize:"24px",fontWeight:"500"}},"Payment History"),l.createElement("span",{style:{fontSize:"1.2em"}},i?"<":">"))),i&&l.createElement("div",{className:"accordion-body",style:{padding:" 15px",backgroundColor:"#fff"}},0===(null==t?void 0:t.length)&&l.createElement("div",{style:{color:"red",fontSize:"16px"}},"No Payments found"),(null==t?void 0:t.length)>0&&l.createElement("div",null,l.createElement("table",{style:{width:"100%",borderCollapse:"collapse",marginTop:"10px"}},l.createElement("thead",null,l.createElement("tr",{style:{backgroundColor:"#f5f5f5"}},l.createElement("th",{style:{border:"1px solid #ddd",padding:"8px",textAlign:"left"}},"Receipt Number"),l.createElement("th",{style:{border:"1px solid #ddd",padding:"8px",textAlign:"left"}},"Transaction Date"),l.createElement("th",{style:{border:"1px solid #ddd",padding:"8px",textAlign:"left"}},"Amount Paid"),l.createElement("th",{style:{border:"1px solid #ddd",padding:"8px",textAlign:"left"}},"Payment Mode"),l.createElement("th",{style:{border:"1px solid #ddd",padding:"8px",textAlign:"left"}},"Transaction ID"),l.createElement("th",{style:{border:"1px solid #ddd",padding:"8px",textAlign:"left"}},"Status"))),l.createElement("tbody",null,t.map((e,t)=>{var n,i;return l.createElement("tr",{key:e.id||t},l.createElement("td",{style:{border:"1px solid #ddd",padding:"8px"}},(null===(n=e.paymentDetails)||void 0===n||null===(i=n[0])||void 0===i?void 0:i.receiptNumber)||e.receiptNumber||"N/A"),l.createElement("td",{style:{border:"1px solid #ddd",padding:"8px"}},e.transactionDate?new Date(e.transactionDate).toLocaleDateString():"N/A"),l.createElement("td",{style:{border:"1px solid #ddd",padding:"8px"}},"₹",e.totalAmountPaid||e.amount||"0"),l.createElement("td",{style:{border:"1px solid #ddd",padding:"8px"}},e.paymentMode||e.instrumentType||"N/A"),l.createElement("td",{style:{border:"1px solid #ddd",padding:"8px"}},e.transactionNumber||e.instrumentNumber||"N/A"),l.createElement("td",{style:{border:"1px solid #ddd",padding:"8px"}},l.createElement("span",{style:{color:"NEW"===e.paymentStatus||"SUCCESSFUL"===e.paymentStatus||"DEPOSITED"===e.paymentStatus?"green":"FAILED"===e.paymentStatus?"red":"orange",fontWeight:"bold"}},"DEPOSITED"===e.paymentStatus?l.createElement("p",null,"Deposited"):e.paymentStatus||"N/A")))}))),l.createElement("div",{style:{marginTop:"10px",fontSize:"14px",color:"#666"}},"Total Payments: ",t.length))))};function al(e){var a,r,u,s,d,v,m,p,f,E,g,h,A,S,N,b;let{applicationDetails:C,demandData:y,workflowDetails:D,isDataLoading:L,applicationData:O,timelineStatusPrefix:T,showTimeLine:I=!0,statusAttribute:w="status",paymentsList:P,oldValue:R,isInfoLabel:x=!1,propertyId:B,moduleCode:F}=e;const{t:M}=o.useTranslation(),U=i.useHistory(),k=Digit.ULBService.getCurrentTenantId(),[W,H]=n.useState(null),[j,z]=n.useState([]);let V=window.location.href.includes("editApplication")&&window.location.href.includes("bpa");const G=[{Header:M("BPA_DOCUMENT_DETAILS_LABEL"),accessor:"title",Cell:e=>{let{value:t}=e;return M(t)||M("CS_NA")}},{Header:M(" "),accessor:"url",Cell:e=>{let{value:n}=e;return n?l.createElement(t.LinkButton,{style:{float:"right",display:"inline",background:"#fff"},label:M("View"),onClick:()=>{window.open(n,"_blank")}}):M("CS_NA")}}];function Y(e,t,n){var l;window.open(null==n||null===(l=n.fullImage)||void 0===l?void 0:l[0],"_blank")}console.log("TIMELINE",C),n.useEffect(()=>{!function(){try{const e=function(){if(window.location.href.includes("employee/ws")&&null!=O&&O.connectionNo){const e=kt(function(){return Promise.resolve(Digit.WSService.paymentsearch({tenantId:(null==O?void 0:O.tenantId)||k,filters:{consumerCodes:null==O?void 0:O.connectionNo,consumerCode:null==O?void 0:O.connectionNo},BusinessService:"SEWERAGE"===(null==O?void 0:O.serviceType)||"SEWARAGE"===(null==O?void 0:O.serviceType)?"SW":"WS"})).then(function(e){Array.isArray(e)&&e.length>0?z(e):null!=e&&e.Payments&&e.Payments.length>0&&z(e.Payments)})},function(e){console.error("❌ Payment fetch error:",e)});if(e&&e.then)return e.then(function(){})}}();Promise.resolve(e&&e.then?e.then(function(){}):void 0)}catch(e){return Promise.reject(e)}}()},[null==O?void 0:O.connectionNo,null==O?void 0:O.serviceType,k]);const[K,q]=n.useState({}),[X,J]=n.useState(),[Q,Z]=n.useState([]),[$,ee]=n.useState({loading:!1,loaded:!1,canLoad:!1});"ACTIVE"!=(null==O?void 0:O.status)||$.loading||$.loaded||$.canLoad||ee({loading:!1,loaded:!1,canLoad:!0}),null==$||!$.canLoad||$.loading||$.loaded||(ee({loading:!0,loaded:!1,canLoad:!0}),function(e,t,n,l){try{Promise.resolve(Digit.PTService.assessmentSearch({tenantId:e,filters:{propertyIds:t}})).then(function(i){function o(){n(a),l({loading:!1,loaded:!0,canLoad:!0})}let a={};const r=function(n){if((null==i||null===(n=i.Assessments)||void 0===n?void 0:n.length)>0){const n=i.Assessments.filter(e=>"ACTIVE"===e.status),l=new Map;n.forEach(e=>{const t=function(e){const t=new Date(e);return t.setHours(0,0,0,0),t.getTime()}(e.assessmentDate)+"_"+e.financialYear,n=l.get(t);(!n||e.createdDate>n.createdDate)&&l.set(t,e)});const o=Array.from(l.values());return Z(o),J(null==i?void 0:i.Assessments),Promise.resolve(Digit.PaymentService.fetchBill(e,{businessService:"PT",consumerCode:t})).then(function(e){a=e})}}();return r&&r.then?r.then(o):o()})}catch(e){return Promise.reject(e)}}((null==O?void 0:O.tenantId)||k,null==O?void 0:O.propertyId,q,ee));const te=e=>{if(null==e||null==e||""==e)return"NA";const t=new Date(e);let n=t.getMonth()+1,l=t.getDate();return n=(n>9?"":"0")+n,l=(l>9?"":"0")+l,l+"/"+n+"/"+t.getFullYear()},ne=function(e,t,n){if(void 0===t&&(t=0),!e)return null;if("OPEN"===e.state||"INITIATED"===e.status&&!window.location.href.includes("/obps/")){var i;const e={date:te(null==O||null===(i=O.auditDetails)||void 0===i?void 0:i.createdTime),source:(null==O?void 0:O.channel)||""};return l.createElement(Xn,{data:e})}if(window.location.href.includes("/obps/")||window.location.href.includes("/noc/")||window.location.href.includes("/ws/")){var o,a,r,u,s,d,c,v,m,p,f,E,g,h,A,S,N,b,y,D;const i={uuid:(null==e||null===(o=e.assigner)||void 0===o?void 0:o.uuid)||(null==e||null===(a=e.assignes)||void 0===a||null===(r=a[0])||void 0===r?void 0:r.uuid),fieldName:"mobileNumber",model:"User",showValue:!1,loadData:{serviceName:"/egov-workflow-v2/egov-wf/process/_search",requestBody:{},requestParam:{tenantId:null==C?void 0:C.tenantId,businessIds:null==C?void 0:C.applicationNo,history:!0},jsonPath:"ProcessInstances[0].assignes[0].mobileNumber",isArray:!1,d:e=>{let n="";return n="+91 "+(_.get(e,"ProcessInstances["+t+"].assigner.mobileNumber")||_.get(e,"ProcessInstances["+t+"].assignes[0].mobileNumber")),n}}},L=n&&Array.isArray(n)&&t>0&&t-1<n.length?n[t-1]:null,T={date:null==e||null===(u=e.auditDetails)||void 0===u?void 0:u.lastModified,name:(null==e||null===(s=e.assigner)||void 0===s?void 0:s.name)||(null==e||null===(d=e.assignes)||void 0===d||null===(c=d[0])||void 0===c?void 0:c.name)||"N/A",mobileNumber:(null==O||null===(v=O.processInstance)||void 0===v||null===(m=v.assignes)||void 0===m||null===(p=m[0])||void 0===p?void 0:p.uuid)===(null==e||null===(f=e.assigner)||void 0===f?void 0:f.uuid)&&null!=O&&null!==(E=O.processInstance)&&void 0!==E&&null!==(g=E.assignes)&&void 0!==g&&null!==(h=g[0])&&void 0!==h&&h.mobileNumber?null==O||null===(A=O.processInstance)||void 0===A||null===(S=A.assignes)||void 0===S||null===(N=S[0])||void 0===N?void 0:N.mobileNumber:(null==e||null===(b=e.assigner)||void 0===b?void 0:b.mobileNumber)||(null==e||null===(y=e.assignes)||void 0===y||null===(D=y[0])||void 0===D?void 0:D.mobileNumber)||"N/A",comment:null!=e&&e.comment?M(e.comment):"",wfComment:L&&L.wfComment||[],thumbnailsToShow:(null==e?void 0:e.thumbnailsToShow)||[]};return l.createElement(Xn,{data:T,OpenImage:Y,privacy:i})}{var L,T,I,w,P;const t={date:te(null==O||null===(L=O.auditDetails)||void 0===L?void 0:L.lastModifiedTime),name:(null==e||null===(T=e.assignes)||void 0===T||null===(I=T[0])||void 0===I?void 0:I.name)||"N/A",wfComment:(null==e?void 0:e.wfComment)||[],mobileNumber:(null==e||null===(w=e.assignes)||void 0===w||null===(P=w[0])||void 0===P?void 0:P.mobileNumber)||"N/A"};return l.createElement(Xn,{data:t})}},le=(e,t)=>e?t?e:M(e):M("NA"),ie=window.location.href.includes("employee/tl")||window.location.href.includes("employee/obps")||window.location.href.includes("employee/noc"),oe=window.location.href.includes("employee/noc"),ae=window.location.href.includes("employee/obps"),re=(window.location.href.includes("employee/ws"),()=>window.location.href.includes("employee/obps")||window.location.href.includes("employee/noc")||ie?{justifyContent:"space-between",fontSize:"16px",lineHeight:"19px",color:"#0B0C0C"}:{}),ue=e=>null!=e&&e.skip?e.value:null!=e&&e.isUnit?null!=e&&e.value?le(null==e?void 0:e.value,null==e?void 0:e.isNotTranslated)+" "+M(null==e?void 0:e.isUnit):M("N/A"):null!=e&&e.value?le(null==e?void 0:e.value,null==e?void 0:e.isNotTranslated):M("N/A"),[se,de]=n.useState(!1),ce=(null==y||y.reduce((e,t)=>e+t.demandInterest,0),null==y||y.reduce((e,t)=>e+t.demandPenality,0),null==y||y.reduce((e,t)=>e+t.collectionTax,0),null==y||y.reduce((e,t)=>e+t.collectionInterest,0),null==y||y.reduce((e,t)=>e+t.collectionPenality,0),null==y||y.reduce((e,t)=>e+t.balanceTax,0),null==y||y.reduce((e,t)=>e+t.balanceInterest,0),null==y||y.reduce((e,t)=>e+t.balancePenality,0),function(e,t,n){try{if(!window.confirm("Are you sure you want to make this property "+t+"?"))return Promise.resolve();const l=c({},e,{status:t,isactive:"ACTIVE"===t,isinactive:"INACTIVE"===t,creationReason:"STATUS",additionalDetails:c({},e.additionalDetails,{propertytobestatus:t}),workflow:c({},e.workflow,{businessService:"PT.CREATE",action:"OPEN",moduleName:"PT"})});return Promise.resolve(Digit.PTService.updatePT({Property:c({},l)},k,n)).then(function(){})}catch(e){return Promise.reject(e)}}),ve=null==C?void 0:C.applicationData,me=(null==C||null===(a=C.applicationData)||void 0===a?void 0:a.propertyId)||"",pe=null==C||null===(r=C.additionalDetails)||void 0===r?void 0:r.propertytobestatus;return n.useEffect(()=>{if("WS"!==F&&"SW"!==F&&!window.location.href.includes("employee/ws")&&!window.location.href.includes("/ws/")&&B)try{let e={consumerCodes:B};const t=!0;"BPAREG"===F?Digit.OBPSService.paymentsearch({tenantId:k,filters:e,auth:t}).then(e=>{z(null==e?void 0:e.Payments)}):"PT"===F&&Digit.PTService.paymentsearch({tenantId:k,filters:e,auth:t}).then(e=>{z(null==e?void 0:e.Payments)})}catch(e){console.error("❌ Payment search error for PT/BPREG:",e)}},[F,B,k]),l.createElement(t.Card,{style:{position:"relative"},className:"employeeCard-override"},null==C||null===(u=C.applicationDetails)||void 0===u?void 0:u.map((e,o)=>{var a,r,u,s,d,c,v,m,p,f,E,g,_,h,A,S,N,b,y,L,O,T,I,w,x,B,F,U,k,W,H,j,z,Y,K,q,X,J,Q;return l.createElement(l.Fragment,{key:o},l.createElement("div",{style:window.location.href.includes("employee/obps")||window.location.href.includes("employee/noc")||window.location.href.includes("employee/ws")?{lineHeight:"19px",maxWidth:"950px",minWidth:"280px"}:ie?{lineHeight:"19px",maxWidth:"600px",minWidth:"280px"}:{}},0!==o||e.asSectionHeader?l.createElement(l.Fragment,null,l.createElement(t.CardSectionHeader,{style:0==o&&ie?{marginBottom:"16px",fontSize:"24px"}:{marginBottom:"16px",marginTop:"32px",fontSize:"24px"}},oe?""+M(e.title):M(e.title),null!=e&&e.Component?l.createElement(e.Component,null):null)):l.createElement(t.CardSubHeader,{style:{marginBottom:"16px",fontSize:"24px"}},M(e.title)),(null==e?void 0:e.isTable)&&l.createElement("table",{style:{tableLayout:"fixed",width:"100%",borderCollapse:"collapse"}},l.createElement("tr",{style:{textAlign:"left"}},null==e?void 0:e.headers.map(e=>l.createElement("th",{style:{padding:"10px",paddingLeft:"0px"}},M(e)))),null==e?void 0:e.tableRows.map((t,i)=>i===(null==e?void 0:e.tableRows.length)-1?l.createElement(n.Fragment,null,l.createElement("hr",{style:{width:"370%",marginTop:"15px"},className:"underline"}),l.createElement("tr",null,t.map(e=>l.createElement("td",{style:{textAlign:"left"}},M(e))))):l.createElement("tr",null,t.map(e=>l.createElement("td",{style:{paddingTop:"20px",textAlign:"left"}},M(e)))))),l.createElement(t.StatusTable,{style:window.location.href.includes("employee/obps")||window.location.href.includes("employee/noc")||ie?{position:"relative",marginTop:"19px"}:{}},(null==e?void 0:e.title)&&!(null!=e&&e.title.includes("NOC"))&&(null==e||null===(a=e.values)||void 0===a?void 0:a.map((n,o)=>{var a,r;return!0===n.map&&"N/A"!==n.value?l.createElement(t.Row,{labelStyle:{wordBreak:"break-all"},textStyle:{wordBreak:"break-all"},key:M(n.title),label:M(n.title),text:l.createElement("img",{src:M(n.value),alt:"",privacy:null==n?void 0:n.privacy})}):1==(null==n?void 0:n.isLink)?l.createElement(t.Row,{key:M(n.title),label:window.location.href.includes("tl")||window.location.href.includes("ws")?l.createElement("div",{style:{width:"200%"}},l.createElement(i.Link,{to:null==n?void 0:n.to},l.createElement("span",{className:"link",style:{color:"#a82227"}},M(null==n?void 0:n.title)))):oe||ae?""+M(n.title):M(n.title),text:l.createElement("div",null,l.createElement(i.Link,{to:null==n?void 0:n.to},l.createElement("span",{className:"link",style:{color:"#a82227"}},null==n?void 0:n.value))),last:o===(null==e||null===(r=e.values)||void 0===r?void 0:r.length)-1,caption:n.caption,className:"border-none",rowContainerStyle:re(),labelStyle:{wordBreak:"break-all"},textStyle:{wordBreak:"break-all"}}):window.location.href.includes("modify")?l.createElement(t.Row,{className:"border-none",key:""+n.title,label:""+M(""+n.title),privacy:null==n?void 0:n.privacy,text:null!=n&&n.oldValue?null==n?void 0:n.oldValue:null!=n&&n.value?null==n?void 0:n.value:"",labelStyle:{wordBreak:"break-all"},textStyle:{wordBreak:"break-all"}}):l.createElement(t.Row,{key:M(n.title),label:M(n.title),text:ue(n),last:o===(null==e||null===(a=e.values)||void 0===a?void 0:a.length)-1,caption:n.caption,className:"border-none",privacy:null==n?void 0:n.privacy,rowContainerStyle:re(),labelStyle:{wordBreak:"break-all"},textStyle:{wordBreak:"break-all"}})})))),(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(Yn,{scrutinyDetails:null==e?void 0:e.additionalDetails,paymentsList:P,additionalDetails:null==C||null===(u=C.applicationData)||void 0===u?void 0:u.additionalDetails,applicationData:null==C?void 0:C.applicationData}),(null==C||null===(s=C.applicationData)||void 0===s||null===(d=s.additionalDetails)||void 0===d||null===(c=d.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(kn,{fiReport:null==C||null===(m=C.applicationData)||void 0===m||null===(p=m.additionalDetails)||void 0===p?void 0:p.fieldinspection_pending}),(null==e||null===(f=e.additionalDetails)||void 0===f?void 0:f.floors)&&l.createElement(Vn,{floors:null==e||null===(E=e.additionalDetails)||void 0===E?void 0:E.floors}),(null==e||null===(g=e.additionalDetails)||void 0===g?void 0:g.owners)&&l.createElement(Gn,{owners:null==e||null===(_=e.additionalDetails)||void 0===_?void 0:_.owners}),(null==e||null===(h=e.additionalDetails)||void 0===h?void 0:h.units)&&l.createElement(Qn,{units:null==e||null===(A=e.additionalDetails)||void 0===A?void 0:A.units}),(null==e||null===(S=e.additionalDetails)||void 0===S?void 0:S.accessories)&&l.createElement(Jn,{units:null==e||null===(N=e.additionalDetails)||void 0===N?void 0:N.accessories}),!V&&(null==e||null===(b=e.additionalDetails)||void 0===b?void 0:b.permissions)&&(null==D||null===(y=D.data)||void 0===y||null===(L=y.nextActions)||void 0===L?void 0:L.length)>0&&l.createElement(jn,{applicationData:null==C?void 0:C.applicationData,t:M,permissions:null==e||null===(O=e.additionalDetails)||void 0===O?void 0:O.permissions}),(null==e||null===(T=e.additionalDetails)||void 0===T?void 0:T.obpsDocuments)&&l.createElement("div",{style:{display:"flex"}},l.createElement(Mn,{t:M,applicationData:null==C?void 0:C.applicationData,docs:e.additionalDetails.obpsDocuments,bpaActionsDetails:D})),(null==e||null===(I=e.additionalDetails)||void 0===I?void 0:I.noc)&&l.createElement(Hn,{t:M,isNoc:!0,NOCdata:e.values,applicationData:null==C?void 0:C.applicationData,docs:e.additionalDetails.noc,noc:null===(w=e.additionalDetails)||void 0===w?void 0:w.data,bpaActionsDetails:D}),(null==e||null===(x=e.additionalDetails)||void 0===x?void 0:x.scruntinyDetails)&&l.createElement(Yn,{scrutinyDetails:null==e?void 0:e.additionalDetails}),(null==e||null===(B=e.additionalDetails)||void 0===B?void 0:B.buildingExtractionDetails)&&l.createElement(Yn,{scrutinyDetails:null==e?void 0:e.additionalDetails}),(null==e||null===(F=e.additionalDetails)||void 0===F?void 0:F.subOccupancyTableDetails)&&l.createElement(Kn,{edcrDetails:null==e?void 0:e.additionalDetails,applicationData:null==C?void 0:C.applicationData}),(null==e||null===(U=e.additionalDetails)||void 0===U?void 0:U.documentsWithUrl)&&l.createElement(t.Table,{className:"customTable table-border-style",t:M,data:(null==e||null===(k=e.additionalDetails)||void 0===k||null===(W=k.documentsWithUrl[0])||void 0===W?void 0:W.values)||[],columns:G,getCellProps:()=>({style:{}}),disableSort:!1,autoSort:!0,manualPagination:!1,isPaginationRequired:!1}),(null==e||null===(H=e.additionalDetails)||void 0===H?void 0:H.taxHeadEstimatesCalculation)&&l.createElement(zn,{taxHeadEstimatesCalculation:null==e||null===(j=e.additionalDetails)||void 0===j?void 0:j.taxHeadEstimatesCalculation}),(null==e?void 0:e.isWaterConnectionDetails)&&l.createElement(Zn,{wsAdditionalDetails:e,oldValue:R}),(null==e||null===(z=e.additionalDetails)||void 0===z?void 0:z.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===(K=Y.redirectUrl)||void 0===K?void 0:K.url},l.createElement("span",{className:"link",style:{color:"#a82227"}},null==e||null===(q=e.additionalDetails)||void 0===q||null===(X=q.redirectUrl)||void 0===X?void 0:X.title))),(null==e||null===(J=e.additionalDetails)||void 0===J?void 0:J.estimationDetails)&&l.createElement(tl,{wsAdditionalDetails:e,workflowDetails:D}),(null==e||null===(Q=e.additionalDetails)||void 0===Q?void 0:Q.estimationDetails)&&l.createElement(nl,{wsAdditionalDetails:e,workflowDetails:D}))}),(null==X?void 0:X.length)>0&&l.createElement(ll,{assessmentData:Q}),l.createElement(ol,{payments:j}),"WS"!==F&&"SW"!==F&&"OBPS"!==F&&"BPAStakeholder"!==F&&"BPAREG"!==F&&l.createElement(il,{applicationData:null==C?void 0:C.applicationData}),I&&(null==D||null===(s=D.data)||void 0===s||null===(d=s.timeline)||void 0===d?void 0:d.length)>0&&l.createElement(l.Fragment,null,l.createElement(t.BreakLine,null),((null==D?void 0:D.isLoading)||L)&&l.createElement(t.Loader,null),!(null!=D&&D.isLoading)&&!L&&l.createElement(n.Fragment,null,l.createElement("div",{id:"timeline"},l.createElement(t.CardSectionHeader,{style:{marginBottom:"16px",marginTop:"32px"}},M("ES_APPLICATION_DETAILS_APPLICATION_TIMELINE")),null!=D&&null!==(v=D.data)&&void 0!==v&&v.timeline&&1===(null==D||null===(m=D.data)||void 0===m||null===(p=m.timeline)||void 0===p?void 0:p.length)?l.createElement(t.CheckPoint,{isCompleted:!0,label:M(""+T+(null==D||null===(f=D.data)||void 0===f||null===(E=f.timeline[0])||void 0===E?void 0:E.state)),customChild:ne(null==D||null===(g=D.data)||void 0===g?void 0:g.timeline[0],null==D||null===(h=D.data)||void 0===h?void 0:h.timeline)}):l.createElement(t.ConnectingCheckPoints,null,(null==D||null===(A=D.data)||void 0===A?void 0:A.timeline)&&(null==D||null===(S=D.data)||void 0===S?void 0:S.timeline.slice(0,se?null==D?void 0:D.data.timeline.length:2).map((e,n,i)=>{var o;let a="";var r,u,s,d,c,v;return window.location.href.includes("/obps/")&&(a=null!=D&&null!==(r=D.data)&&void 0!==r&&null!==(u=r.timeline[n-1])&&void 0!==u&&null!==(s=u.state)&&void 0!==s&&s.includes("BACK_FROM")||null!=D&&null!==(d=D.data)&&void 0!==d&&null!==(c=d.timeline[n-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==n?"":"_DONE"),l.createElement(l.Fragment,{key:n},l.createElement(t.CheckPoint,{keyValue:n,isCompleted:0===n,info:e.comment,label:M(""+T+("REOPEN"===(null==e?void 0:e.performedAction)?null==e?void 0:e.performedAction:null==e?void 0:e[w])+a),customChild:ne(e,n,null==D||null===(o=D.data)||void 0===o?void 0:o.timeline)}))}))),(null==D||null===(N=D.data)||void 0===N||null===(b=N.timeline)||void 0===b?void 0:b.length)>2&&l.createElement(t.LinkButton,{label:M(se?"COLLAPSE":"VIEW_TIMELINE"),onClick:()=>{de(e=>!e)}})))),window.location.href.includes("/pt/")?l.createElement(t.ActionBar,{className:"clear-search-container",style:{display:"block"}},l.createElement(t.SubmitBar,{label:"Make Property Active",style:{flex:1},onSubmit:()=>{window.location.href.includes("employee")?"INACTIVE"==pe?ce(ve,"ACTIVE",me):alert("Property is already active."):alert("You are not authorized to change the property status.")}}),l.createElement(t.SubmitBar,{label:"Make Property Inactive",style:{marginLeft:"20px"},onSubmit:()=>{window.location.href.includes("employee")?"ACTIVE"==pe?ce(ve,"INACTIVE",me):alert("Property is already inactive."):alert("You are not authorized to change the property status.")}}),l.createElement(t.SubmitBar,{label:"Edit Property",style:{marginLeft:"20px"},onSubmit:()=>{var e;const t=null==C||null===(e=C.applicationData)||void 0===e?void 0:e.propertyId;if(t)if(window.location.href.includes("employee")){var n,l,i;if("INACTIVE"===(null==C||null===(n=C.applicationData)||void 0===n?void 0:n.status))return void alert("Property is inactive, cannot edit.");if("INWORKFLOW"===(null==C||null===(l=C.applicationData)||void 0===l?void 0:l.status))return void alert("Property is in workflow, cannot edit.");"ACTIVE"===(null==C||null===(i=C.applicationData)||void 0===i?void 0:i.status)&&U.push({pathname:"/digit-ui/employee/pt/edit-application/"+t})}else{var o,a,r;if("INACTIVE"===(null==C||null===(o=C.applicationData)||void 0===o?void 0:o.status))return void alert("Property is inactive, cannot edit.");if("INWORKFLOW"===(null==C||null===(a=C.applicationData)||void 0===a?void 0:a.status))return void alert("Property is in workflow, cannot edit.");"ACTIVE"===(null==C||null===(r=C.applicationData)||void 0===r?void 0:r.status)&&U.push({pathname:"/digit-ui/citizen/pt/property/edit-application/"+t})}}}),l.createElement(t.SubmitBar,{label:"Access Property",style:{marginLeft:"20px"},onSubmit:()=>{alert("access property")}})):l.createElement("div",null),W&&l.createElement(t.Toast,{error:W.isError,label:M(W.label),onClose:()=>{H(null)},isDleteBtn:"false"}))}function rl(e){var n,i,o,a,r,u,s,d,c,v,m,p,f,E,g,_,h,A;let{t:S,showToast:N,closeToast:b,businessService:C}=e;if(null!=C&&C.includes("NewTL")||null!=C&&C.includes("TL")||null!=C&&C.includes("EDITRENEWAL")){var y;let e="";switch(null==N||null===(y=N.action)||void 0===y?void 0:y.action){case"SENDBACK":e="error"===(null==N?void 0:N.key)?null==N||null===(n=N.error)||void 0===n?void 0:n.message:S("TL_SENDBACK_CHECKLIST_MESSAGE_HEAD");break;case"FORWARD":e="error"===(null==N?void 0:N.key)?null==N||null===(i=N.error)||void 0===i?void 0:i.message:S("TL_FORWARD_SUCCESS_MESSAGE_MAIN");break;case"APPROVE":e="error"===(null==N?void 0:N.key)?null==N||null===(o=N.error)||void 0===o?void 0:o.message:S("TL_APPROVAL_CHECKLIST_MESSAGE_HEAD");break;case"SENDBACKTOCITIZEN":e="error"===(null==N?void 0:N.key)?null==N||null===(a=N.error)||void 0===a?void 0:a.message:S("TL_SENDBACK_TOCITIZEN_CHECKLIST_MESSAGE_HEAD");break;case"REJECT":e="error"===(null==N?void 0:N.key)?null==N||null===(r=N.error)||void 0===r?void 0:r.message:S("TL_APPROVAL_REJ_MESSAGE_HEAD");break;case"RESUBMIT":e="error"===(null==N?void 0:N.key)?null==N||null===(u=N.error)||void 0===u?void 0:u.message:S("TL_APPLICATION_RESUBMIT_SUCCESS_MESSAGE_MAIN");break;case"CANCEL":e="error"===(null==N?void 0:N.key)?null==N||null===(s=N.error)||void 0===s?void 0:s.message:S("TL_TL_CANCELLED_MESSAGE_HEAD");break;default:e="error"===(null==N?void 0:N.key)?null==N||null===(d=N.error)||void 0===d?void 0:d.message:S("ES_"+C+"_"+(null==N||null===(c=N.action)||void 0===c?void 0:c.action)+"_UPDATE_SUCCESS")}return l.createElement(l.Fragment,null,N&&l.createElement(t.Toast,{error:"error"===N.key,label:e,onClose:b}))}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 n=e[0];return n=2==(null===(t=e)||void 0===t?void 0:t.length)&&null!=C&&C.includes("BPA_OC")?S(e[1]):S(e[0]),n};let n="";switch(null==N||null===(D=N.action)||void 0===D?void 0:D.action){case"REVOCATE":n="error"===(null==N?void 0:N.key)?null==N||null===(v=N.error)||void 0===v?void 0:v.message:e(["BPA_APPROVAL_REVOCATED_MESSAGE_HEAD","BPA_APPROVAL_OC_REVOCATED_MESSAGE_HEAD"]);break;case"VERIFY_AND_FORWARD":n="error"===(null==N?void 0:N.key)?null==N||null===(m=N.error)||void 0===m?void 0:m.message:e(["BPA_FORWARD_SUCCESS_MESSAGE_MAIN"]);break;case"SEND_BACK_TO_CITIZEN":n="error"===(null==N?void 0:N.key)?null==N||null===(p=N.error)||void 0===p?void 0:p.message:e(["BPA_SENDBACK_SUCCESS_MESSAGE_MAIN"]);break;case"APPROVE":n="error"===(null==N?void 0:N.key)?null==N||null===(f=N.error)||void 0===f?void 0:f.message:e(["BPA_APPROVAL_CHECKLIST_MESSAGE_HEAD"]);break;case"REJECT":n="error"===(null==N?void 0:N.key)?null==N||null===(E=N.error)||void 0===E?void 0:E.message:e(["BPA_APPROVAL_REJECTED_MESSAGE_HEAD","BPA_OC_APPROVAL_REJECTED_MESSAGE_HEAD"]);break;case"FORWARD":n="error"===(null==N?void 0:N.key)?null==N||null===(g=N.error)||void 0===g?void 0:g.message:e(["BPA_FORWARD_SUCCESS_MESSAGE_MAIN"]);break;case"SEND_BACK_FOR_DOCUMENT_VERIFICATION":case"SEND_BACK_FOR_FIELD_INSPECTION":n="error"===(null==N?void 0:N.key)?null==N||null===(_=N.error)||void 0===_?void 0:_.message:e(["BPA_SENDBACK_SUCCESS_MESSAGE_MAIN"]);break;default:n="error"===(null==N?void 0:N.key)?null==N||null===(h=N.error)||void 0===h?void 0:h.message:S("ES_"+C+"_"+(null==N||null===(A=N.action)||void 0===A?void 0:A.action)+"_UPDATE_SUCCESS")}return l.createElement(l.Fragment,null,N&&l.createElement(t.Toast,{error:"error"===N.key,label:n,onClose:b}))}{var L,O;const e="error"===(null==N?void 0:N.key)?null==N||null===(L=N.error)||void 0===L?void 0:L.message:"ES_"+C+"_"+(null==N||null===(O=N.action)||void 0===O?void 0:O.action)+"_UPDATE_SUCCESS";return l.createElement(l.Fragment,null,N&&l.createElement(t.Toast,{error:"error"===N.key,label:S(e),onClose:b}))}}function ul(e){var i,a,r,u,s,d,v,m,p,f,E,g,_,h,A,S;let{workflowDetails:N,displayMenu:b,onActionSelect:C,setDisplayMenu:y,businessService:D,forcedActionPrefix:L,ActionBarStyle:O={},MenuStyle:T={}}=e;const{t:I}=o.useTranslation();let w=Digit.UserService.getUser();const P=n.useRef();if(window.location.href.includes("/obps")||window.location.href.includes("/noc")){const e=sessionStorage.getItem("Digit.citizen.userRequestObject"),t=e?JSON.parse(e):{};w=null==t?void 0:t.value}const R=null===(i=w)||void 0===i||null===(a=i.info)||void 0===a||null===(r=a.roles)||void 0===r?void 0:r.map(e=>e.code);let x=!1,B=!1,F=(null==N||null===(u=N.data)||void 0===u||null===(s=u.actionState)||void 0===s||null===(d=s.nextActions)||void 0===d?void 0:d.filter(e=>(null==R?void 0:R.some(t=>{var n;return null===(n=e.roles)||void 0===n?void 0:n.includes(t)}))||!e.roles))||(null==N||null===(v=N.data)||void 0===v||null===(m=v.nextActions)||void 0===m?void 0:m.filter(e=>(null==R?void 0:R.some(t=>{var n;return null===(n=e.roles)||void 0===n?void 0:n.includes(t)}))||!e.roles));return console.log("ActionsInPayment",N),Digit.Hooks.useClickOutside(P,()=>{y(!1)},b),(window.location.href.includes("/obps")||window.location.href.includes("/noc"))&&1==(null==F?void 0:F.length)||null!=F&&null!==(p=F[0])&&void 0!==p&&null!==(f=p.redirectionUrl)&&void 0!==f&&f.pathname.includes("/pt/property-details/")&&1==(null==F?void 0:F.length)?(B=!1,x=!0):(null==F?void 0:F.length)>0&&(B=!0,x=!1),l.createElement(l.Fragment,null,!(null!=N&&N.isLoading)&&B&&!x&&l.createElement(t.ActionBar,{style:c({},O)},b&&(null!=N&&null!==(E=N.data)&&void 0!==E&&null!==(g=E.actionState)&&void 0!==g&&g.nextActions||null!=N&&null!==(_=N.data)&&void 0!==_&&_.nextActions)?l.createElement(t.Menu,{localeKeyPrefix:L||"WF_EMPLOYEE_"+(null==D?void 0:D.toUpperCase()),options:F,optionKey:"action",t:I,onSelect:C,style:T}):null,l.createElement(t.SubmitBar,{ref:P,label:I("WF_TAKE_ACTION"),onSubmit:()=>y(!b)})),!(null!=N&&N.isLoading)&&!B&&x&&l.createElement(t.ActionBar,{style:c({},O)},l.createElement("button",{style:{color:"#FFFFFF",fontSize:"18px"},className:"submit-bar",name:null==F||null===(h=F[0])||void 0===h?void 0:h.action,value:null==F||null===(A=F[0])||void 0===A?void 0:A.action,onClick:e=>{C((null==F?void 0:F[0])||{})}},I((L||"WF_EMPLOYEE_"+(null==D?void 0:D.toUpperCase()))+"_"+(null==F||null===(S=F[0])||void 0===S?void 0:S.action)))))}const sl=()=>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"})),dl=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(sl,null));function cl(e){let{action:n,closeWarningPopup:i}=e;const{t:a}=o.useTranslation(),r=window.Digit.Utils.browser.isMobile();return l.createElement(l.Fragment,null,l.createElement(t.Modal,{headerBarMain:l.createElement("h1",{className:"heading-m"},a("PT_DUES_ARE_PENDING")),headerBarEnd:l.createElement(dl,{onClick:()=>{i()}}),hideSubmit:!0,isDisabled:!1,popupStyles:r?{}:{width:"29%",marginTop:"auto"}},l.createElement(t.Card,null,l.createElement("div",{style:{marginBottom:"30px"}},l.createElement("h1",null,a("PT_YOU_HAVE")," ₹",null==n?void 0:n.AmountDueForPay," ",a("PT_DUE_WARNING_MSG2"))),l.createElement(t.Row,{rowContainerStyle:{display:"flex"},labelStyle:{fontSize:"24px",fontWeight:"700",marginRight:"10%"},textStyle:{fontSize:"24px",fontWeight:"700",marginBottom:"20px"},label:""+a("PT_AMOUNT_DUE"),text:"₹"+a(null==n?void 0:n.AmountDueForPay)}),l.createElement("div",{style:{width:"100%",display:"flex",justifyContent:"flex-end"}},l.createElement(t.ButtonSelector,{theme:"border",label:a("ES_PT_COMMON_CANCEL"),onSubmit:i,style:{marginLeft:"10px"}}),l.createElement(t.ButtonSelector,{label:a("PT_COLLECT"),onSubmit:()=>{var e;return window.location.assign(""+window.location.origin+(null==n||null===(e=n.redirectionUrl)||void 0===e?void 0:e.pathname))},style:{marginLeft:"10px"}})))),")")}const vl=e=>{var a,u;let s=window.location.href.includes("editApplication")&&window.location.href.includes("bpa");const d=Digit.ULBService.getCurrentTenantId(),v=Digit.ULBService.getStateId(),{data:m}=Digit.Hooks.obps.useMDMS(v,"BPA",["BlockReason"]),{t:p}=o.useTranslation(),f=i.useHistory();let{id:E}=i.useParams();const[g,_]=n.useState(!1),[h,A]=n.useState(null),[S,N]=n.useState(!1),[b,C]=n.useState(!1),[y,D]=n.useState(!1),{data:L}=Digit.Hooks.obps.useMDMS(v,"BPA",["RiskTypeComputation"]),{applicationDetails:O,demandData:T,totalDemandTax:I,totalBalanceTax:w,showToast:P,setShowToast:R,isLoading:x,isDataLoading:B,applicationData:F,mutate:M,nocMutation:U,workflowDetails:k,id:W,businessService:H,closeToast:j,moduleCode:z,timelineStatusPrefix:V,forcedActionPrefix:G,statusAttribute:Y,ActionBarStyle:K,MenuStyle:q,paymentsList:X,showTimeLine:J=!0,oldValue:Q,isInfoLabel:Z=!1,clearDataDetails:$,propertyId:ee}=e;n.useEffect(()=>{P&&k&&k.revalidate&&k.revalidate()},[P]);const te=r.useQueryClient(),ne=()=>{A(null),N(!1)};return console.log("ActionsInPayment2",k),x||b?l.createElement(t.Loader,null):l.createElement(l.Fragment,null,x?l.createElement(t.Loader,null):l.createElement(l.Fragment,null,l.createElement(al,{applicationDetails:O,demandData:T,id:W,workflowDetails:k,isDataLoading:B,applicationData:F,totalDemandTax:I,totalBalanceTax:w,businessService:H,timelineStatusPrefix:V,statusAttribute:Y,paymentsList:X,showTimeLine:J,oldValue:Q,isInfoLabel:Z,propertyId:ee,moduleCode:z}),S?l.createElement(Bn,{t:p,action:h,tenantId:d,state:v,id:E,applicationDetails:O,applicationData:null==O?void 0:O.applicationData,closeModal:ne,submitAction:function(e,t,n){void 0===t&&(t=!1),void 0===n&&(n={});try{let l=!1;const i=function(i,o,a,r,u,s,d,v,m,E,g,_,A,S,N,b,y,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===(s=e.Licenses)||void 0===s||null===(d=s[0])||void 0===d||null===(v=d.additionalDetail)||void 0===v||null===(m=v.validityYears)||void 0===m?void 0:m.length):0==(null==e||null===(E=e.Licenses)||void 0===E||null===(g=E[0])||void 0===g||null===(_=g.comment)||void 0===_?void 0:_.length))||0==(null==e||null===(A=e.WaterConnection)||void 0===A||null===(S=A.comment)||void 0===S?void 0:S.length)||0==(null==e||null===(N=e.SewerageConnection)||void 0===N||null===(b=N.comment)||void 0===b?void 0:b.length)||0==(null==e||null===(y=e.BPA)||void 0===y||null===(D=y.comment)||void 0===D?void 0:D.length)){var L,O;"INITIATE"===(null==e||null===(L=e.Licenses)||void 0===L||null===(O=L[0])||void 0===O?void 0:O.action)?alert(p("Please fill in the validity before submitting")):alert(p("Please fill in the comments before submitting"))}else{const i=function(i,o,a,r,u){if("BPA"!=(null==e||null===(i=e.BPA)||void 0===i?void 0:i.businessService)||null!=e&&null!==(o=e.BPA)&&void 0!==o&&null!==(a=o.additionalDetails)&&void 0!==a&&a.blockingReason||"BLOCK"!=(null==e||null===(r=e.BPA)||void 0===r||null===(u=r.workflow)||void 0===u?void 0:u.action)){function s(t){if(l)return t;M&&(C(!0),M(e,{onError:(e,t)=>{C(!1),R({key:"error",error:e}),setTimeout(j,5e3)},onSuccess:(e,t)=>{var l,i,o,a,r,u;if(sessionStorage.removeItem("WS_SESSION_APPLICATION_DETAILS"),C(!1),null!==(l=n)&&void 0!==l&&l.bpa&&(e.selectedAction=h,f.replace("/digit-ui/employee/obps/response",{data:e})),null!==(i=n)&&void 0!==i&&i.isStakeholder&&(e.selectedAction=h,f.push("/digit-ui/employee/obps/stakeholder-response",{data:e})),null!==(o=n)&&void 0!==o&&o.isNoc&&f.push("/digit-ui/employee/noc/response",{data:e}),(null==e||null===(a=e.Amendments)||void 0===a?void 0:a.length)>0){var s,d,c,v,m,E,g,_;null!=t&&null!==(s=t.AmendmentUpdate)&&void 0!==s&&null!==(d=s.workflow)&&void 0!==d&&d.action.includes("SEND_BACK")?R({key:"success",label:p("ES_MODIFYSWCONNECTION_SEND_BACK_UPDATE_SUCCESS")}):null!=t&&null!==(c=t.AmendmentUpdate)&&void 0!==c&&null!==(v=c.workflow)&&void 0!==v&&v.action.includes("RE-SUBMIT")?R({key:"success",label:p("ES_MODIFYSWCONNECTION_RE_SUBMIT_UPDATE_SUCCESS")}):null!=t&&null!==(m=t.AmendmentUpdate)&&void 0!==m&&null!==(E=m.workflow)&&void 0!==E&&E.action.includes("APPROVE")?R({key:"success",label:p("ES_MODIFYSWCONNECTION_APPROVE_UPDATE_SUCCESS")}):null!=t&&null!==(g=t.AmendmentUpdate)&&void 0!==g&&null!==(_=g.workflow)&&void 0!==_&&_.action.includes("REJECT")&&R({key:"success",label:p("ES_MODIFYWSCONNECTION_REJECT_UPDATE_SUCCESS")})}else{var A,S,N;if((null==e||null===(r=e.Licenses)||void 0===r?void 0:r.length)>0&&null!=e&&null!==(u=e.Licenses[0])&&void 0!==u&&u.applicationNumber)return null!=e&&null!==(A=e.Licenses[0])&&void 0!==A&&null!==(S=A.businessService)&&void 0!==S&&S.includes("BPAREG")?(R({key:"success",action:h}),e.selectedAction=h,void f.push("/digit-ui/employee/obps/stakeholder-response",{data:e})):(R({key:"success",action:h}),void f.replace("/digit-ui/employee/tl/application-details/"+(null==e||null===(N=e.Licenses[0])||void 0===N?void 0:N.applicationNumber)));R({key:"success",action:h}),$&&setTimeout($,3e3),setTimeout(j,5e3);try{const e=(H||"").toUpperCase(),t=((null==h?void 0:h.action)||"").toUpperCase();e.includes("DISCONNECT")&&(t.includes("APPROVE")||t.includes("EXECUTE")||t.includes("APPROVE_CONNECTION"))&&setTimeout(()=>{var e;null!==(e=window)&&void 0!==e&&e.location&&(window.location.href="https://mseva.lgpunjab.gov.in/employee/inbox")},3e3)}catch(e){}te.clear(),te.refetchQueries("APPLICATION_SEARCH")}}})),ne()}C(!0),"function"==typeof(null==e?void 0:e.customFunctionToExecute)&&(null==e||e.customFunctionToExecute(c({},e)));const i=function(){if(!1!==t&&U){var e;const n=null===(e=t)||void 0===e?void 0:e.map(e=>null==U?void 0:U.mutateAsync(e)),i=kt(function(){return C(!0),Promise.resolve(Promise.all(n)).then(function(e){e&&e.map(e=>{var t,n;Digit.SessionStorage.del(null==e||null===(t=e.Noc)||void 0===t||null===(n=t[0])||void 0===n?void 0:n.nocType)})})},function(e){var t,n,i,o,a,r,u,s,d,c,v,m;C(!1);let f=null!=e&&null!==(t=e.response)&&void 0!==t&&null!==(n=t.data)&&void 0!==n&&null!==(i=n.Errors)&&void 0!==i&&null!==(o=i[0])&&void 0!==o&&o.code?p(null==e||null===(a=e.response)||void 0===a||null===(r=a.data)||void 0===r||null===(u=r.Errors)||void 0===u||null===(s=u[0])||void 0===s?void 0:s.code):(null==e||null===(d=e.response)||void 0===d||null===(c=d.data)||void 0===c||null===(v=c.Errors)||void 0===v||null===(m=v[0])||void 0===m?void 0:m.message)||e;ne(),R({key:"error",error:{message:f}}),setTimeout(j,5e3),l=!0});if(i&&i.then)return i.then(function(){})}}();return i&&i.then?i.then(s):s(i)}alert(p("Please select Blocking reason"))}();if(i&&i.then)return i.then(function(){})}}();return Promise.resolve(i&&i.then?i.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},actionData:null==k||null===(a=k.data)||void 0===a?void 0:a.timeline,businessService:H,workflowDetails:k,moduleCode:z,blockReason:null==m||null===(u=m.BPA)||void 0===u?void 0:u.BlockReason}):null,y?l.createElement(cl,{action:h,workflowDetails:k,businessService:H,isWarningPop:y,closeWarningPopup:()=>{D(!1)}}):null,l.createElement(rl,{t:p,showToast:P,closeToast:j,businessService:H}),l.createElement("div",null,s?l.createElement(t.SubmitBar,{style:{marginRight:20},label:p("BPA_EDIT_UPDATE"),onSubmit:function(e){try{return console.log("JJJJJJ",e),Promise.resolve(Digit.OBPSService.BPASearch(d,{applicationNo:null==F?void 0:F.applicationNo})).then(function(e){var t,n,l,i,o,a;const r=Digit.Utils.obps.calculateRiskType(null==L||null===(t=L.BPA)||void 0===t?void 0:t.RiskTypeComputation,null==O||null===(n=O.edcrDetails)||void 0===n||null===(l=n.planDetail)||void 0===l||null===(i=l.plot)||void 0===i?void 0:i.area,null==O||null===(o=O.edcrDetails)||void 0===o||null===(a=o.planDetail)||void 0===a?void 0:a.blocks),u={BPA:e.BPA[0]};u.BPA.riskType=r,u.BPA.workflow={action:"EDIT PAY 2",assignes:[],comments:null,varificationDocuments:null};const s=function(e,t,n,l,i,o,a,r,s,c,v,m){if(!(parseInt(sessionStorage.getItem("lessAdjusment"))>parseInt(sessionStorage.getItem("development"))+parseInt(sessionStorage.getItem("otherCharges"))+parseInt(null==u||null===(e=u.BPA)||void 0===e||null===(t=e.additionalDetails)||void 0===t||null===(n=t.selfCertificationCharges)||void 0===n?void 0:n.BPA_MALBA_CHARGES)+parseInt(null==u||null===(l=u.BPA)||void 0===l||null===(i=l.additionalDetails)||void 0===i||null===(o=i.selfCertificationCharges)||void 0===o?void 0:o.BPA_LABOUR_CESS)+parseInt(null==u||null===(a=u.BPA)||void 0===a||null===(r=a.additionalDetails)||void 0===r||null===(s=r.selfCertificationCharges)||void 0===s?void 0:s.BPA_WATER_CHARGES)+parseInt(null==u||null===(c=u.BPA)||void 0===c||null===(v=c.additionalDetails)||void 0===v||null===(m=v.selfCertificationCharges)||void 0===m?void 0:m.BPA_GAUSHALA_CHARGES_CESS)))return Promise.resolve(Digit.OBPSService.update(u,d)).then(function(e){window.location.assign(window.location.href.split("/editApplication")[0]+window.location.href.split("editApplication")[1])});alert(p("Enterd Less Adjustment amount is invalid"))}();if(s&&s.then)return s.then(function(){})})}catch(e){return Promise.reject(e)}},id:!0}):!(window.location.href.includes("citizen")&&window.location.href.includes("/pt/"))&&l.createElement(ul,{workflowDetails:k,displayMenu:g,onActionSelect:function(e){var t,n,l;if(e)if("EDIT PAY 2"==(null==e?void 0:e.action)&&window.location.href.includes("bpa"))window.location.assign(window.location.href.split("bpa")[0]+"editApplication/bpa"+window.location.href.split("bpa")[1]);else if(null!=e&&e.isWarningPopUp)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))f.push(""+(null==e||null===(a=e.redirectionUrll)||void 0===a?void 0:a.pathname),JSON.stringify({data:null==e||null===(r=e.redirectionUrll)||void 0===r?void 0:r.state,url:""+(null===(u=location)||void 0===u?void 0:u.pathname)+location.search}));else if("RE-SUBMIT-APPLICATION"===(null==e||null===(o=e.redirectionUrll)||void 0===o?void 0:o.action)){var s,d;f.push(""+(null==e||null===(s=e.redirectionUrll)||void 0===s?void 0:s.pathname),{data:null==e||null===(d=e.redirectionUrll)||void 0===d?void 0:d.state})}else{var v;window.location.assign(window.location.origin+"/digit-ui/employee/payment/collect/"+(null==e||null===(v=e.redirectionUrll)||void 0===v?void 0:v.pathname))}}else if(null!=e&&e.redirectionUrl||"EDIT PAY 2"==(null==e?void 0:e.action))if("DIRECTRENEWAL"===(null==e||null===(t=e.redirectionUrl)||void 0===t||null===(n=t.state)||void 0===n||null===(l=n.applicationData)||void 0===l?void 0:l.workflowCode))N(!0);else{var m,p;f.push({pathname:null===(m=e.redirectionUrl)||void 0===m?void 0:m.pathname,state:c({},null===(p=e.redirectionUrl)||void 0===p?void 0:p.state)})}else N(!0);A(e),_(!1)},setDisplayMenu:_,businessService:H,forcedActionPrefix:G,ActionBarStyle:K,MenuStyle:q}))))};function ml(e){var i;let{t:o,document:a,setNocDocuments:r,nocDocuments:u}=e;const s=null==u?void 0:u.filter(e=>{var t;return null==e||null===(t=e.documentType)||void 0===t?void 0:t.includes(null==a?void 0:a.code)})[0],d=Digit.ULBService.getStateId(),[c,v]=n.useState(null==a||null===(i=a.dropdownData)||void 0===i?void 0:i[0]),[m,p]=n.useState(null),[f,E]=n.useState(()=>(null==s?void 0:s.fileStoreId)||null);return n.useEffect(()=>{null!=c&&c.code&&r(e=>0===(null==f?void 0:f.length)||null===f?e:[...null==e?void 0:e.filter(e=>(null==e?void 0:e.fileStoreId)!==f),{documentType:null==c?void 0:c.code,fileStoreId:f,documentUid:f,fileName:(null==m?void 0:m.name)||""}])},[f,c]),l.createElement("div",null,l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller",style:{fontWeight:"700",width:"50%"}},""+o("NOC_UPLOAD_FILE_LABEL")),l.createElement("div",{className:"field"},l.createElement(t.MultiUploadWrapper,{module:"NOC",tenantId:d,getFormState:e=>(e=>{let t=Object.fromEntries(e),n=Object.values(t),l=n&&(null==n?void 0:n.map(e=>{var t,n,l;return{documentType:null==c?void 0:c.code,fileStoreId:null==e||null===(t=e.fileStoreId)||void 0===t?void 0:t.fileStoreId,documentUid:null==e||null===(n=e.fileStoreId)||void 0===n?void 0:n.fileStoreId,fileName:(null==e||null===(l=e.file)||void 0===l?void 0:l.name)||""}}));var i;sessionStorage.setItem("NewNOCDocs",JSON.stringify(l)),(i=n[n.length-1])&&p(i.file)})(e),t:o,allowedFileTypesRegex:/(.*?)(jpg|jpeg|png|image|pdf)$/i,allowedMaxSizeInMB:5,acceptFiles:"image/*, .pdf, .png, .jpeg, .jpg"}))))}const pl=e=>{let{width:t=20,height:n=20,style:i}=e;return l.createElement("svg",{style:i,xmlns:"http://www.w3.org/2000/svg",width:t,height:n,viewBox:"0 0 20 20",fill:"gray"},l.createElement("path",{d:"M20 2H8c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-8.5 7.5c0 .83-.67 1.5-1.5 1.5H9v2H7.5V7H10c.83 0 1.5.67 1.5 1.5v1zm5 2c0 .83-.67 1.5-1.5 1.5h-2.5V7H15c.83 0 1.5.67 1.5 1.5v3zm4-3H19v1h1.5V11H19v2h-1.5V7h3v1.5zM9 9.5h1v-1H9v1zM4 6H2v14c0 1.1.9 2 2 2h14v-2H4V6zm10 5.5h1v-3h-1v3z"}))};function fl(e){var t;let{value:n={}}=e;const{t:i}=o.useTranslation(),{data:a}=Digit.Hooks.noc.useNOCDocumentSearch({value:n},{value:n});let r=[];return null!=n&&n.workflowDocs&&(r=null==n?void 0:n.workflowDocs),a.pdfFiles&&0!==Object.keys(a.pdfFiles).length?l.createElement("div",{style:{marginTop:"19px"}},l.createElement(l.Fragment,null,l.createElement("div",{style:{display:"flex",flexWrap:"wrap",gap:"16px"}},null===(t=r)||void 0===t?void 0:t.map((e,t)=>{var n,o;let r=g(null==a?void 0:a.pdfFiles,(null==e?void 0:e.documentAttachment)||(null==e?void 0:e.documentUid));return l.createElement("a",{target:"_",href:r,style:{width:"120px",textAlign:"center",display:"flex",flexDirection:"column",alignItems:"center",textDecoration:"none",color:"inherit"},key:t},l.createElement(pl,{width:85,height:100,style:{background:"#f6f6f6",padding:"8px"}}),l.createElement("p",{style:{marginTop:"8px",fontSize:"12px",wordWrap:"break-word",overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical"}},i(null==e||null===(n=e.documentType)||void 0===n||null===(o=n.replace(".","_"))||void 0===o?void 0:o.toUpperCase())))})))):l.createElement("div",null,i("NOC_NO_DOCUMENTS_MSG"))}const El=e=>l.createElement("h1",{className:"heading-m"},e.label),gl=()=>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"})),_l=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(gl,null)),hl=e=>{var i;let{t:o,action:a,tenantId:r,getEmployees:u,closeModal:s,submitAction:d,applicationDetails:v,applicationData:m,businessService:p,showToast:f,setShowToast:E,closeToast:g,showErrorToast:_,errorOne:h,closeToastOne:A}=e;const[S,N]=n.useState({}),[b,C]=n.useState({}),[y,D]=n.useState([]),[L,O]=n.useState({}),[T,I]=n.useState(null),[w,P]=n.useState(null),[R,x]=n.useState(null),[B,F]=n.useState([]),[M,U]=n.useState(null),k=null==a||null===(i=a.state)||void 0===i?void 0:i.actions,W=(new Set(null==k?void 0:k.flatMap(e=>e.roles)),[...new Set(null==u?void 0:u.flatMap(e=>e.roles))]),{data:H}=Digit.Hooks.useEmployeeSearch(r,{roles:null==W?void 0:W.map(e=>({code:e})),isActive:!0},{enabled:!(null!=a&&a.isTerminateState)}),{data:j}=Digit.Hooks.pt.useMDMS(r,p,"FINANCIAL_YEARLS",{},{details:{tenantId:Digit.ULBService.getStateId(),moduleDetails:[{moduleName:"egf-master",masterDetails:[{name:"FinancialYear",filter:"[?(@.module == 'TL')]"}]}]}});n.useEffect(()=>{var e;j&&j["egf-master"]&&F(null===(e=j["egf-master"])||void 0===e?void 0:e.FinancialYear)},[j]);const{data:z}=Digit.Hooks.useCustomMDMS(r,"common-masters",[{name:"Department"}]);function V(e){I(e.target.files[0])}return n.useEffect(()=>{if(H&&z){var e;const t=z["common-masters"].Department;D(null==H||null===(e=H.Employees)||void 0===e?void 0:e.map(e=>{var n,l,i;const o=null==e||null===(n=e.assignments)||void 0===n||null===(l=n[0])||void 0===l?void 0:l.department,a=null==t?void 0:t.find(e=>(null==e?void 0:e.code)===o);return{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)}}))}},[H]),n.useEffect(()=>{!function(){try{x(null);const e=function(){if(T){const e=function(){if(T.size>=5242880)x(o("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=kt(function(){return Promise.resolve(Digit.UploadServices.Filestorage("NOC",T,Digit.ULBService.getStateId())).then(function(e){var t,n,l,i;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?P(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):x(o("CS_FILE_UPLOAD_ERROR"))})},function(){x(o("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[T]),n.useEffect(()=>{if("SENDBACKTOCITIZEN"===(null==a?void 0:a.action)){var e,t,n;const l=(null==v||null===(e=v.Noc)||void 0===e||null===(t=e[0])||void 0===t||null===(n=t.auditDetails)||void 0===n?void 0:n.createdBy)||null;O({uuid:l})}},[a]),n.useEffect(()=>{a&&N((e=>{let{t:n,action:i,approvers:o,selectedApprover:a,setSelectedApprover:r,selectFile:u,uploadedFile:s,setUploadedFile:d}=e,c=!0;return"SENDBACKTOCITIZEN"!=(null==i?void 0:i.action)&&"APPROVE"!=(null==i?void 0:i.action)&&"REJECT"!=(null==i?void 0:i.action)&&"SENDBACK"!=(null==i?void 0:i.action)||(c=!1),i.isTerminateState&&(c=!1),{label:{heading:"WF_"+(null==i?void 0:i.action)+"_APPLICATION",submit:"WF_EMPLOYEE_NOC_"+(null==i?void 0:i.action),cancel:"WF_EMPLOYEE_NOC_CANCEL"},form:[{body:[{label:c?n("WF_ASSIGNEE_NAME_LABEL")+"*":null,placeholder:c?n("WF_ASSIGNEE_NAME_PLACEHOLDER"):null,type:"dropdown",populators:c?l.createElement(t.Dropdown,{option:o,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:r,selected:a}):null},{label:n("WF_COMMON_COMMENTS_LABEL")+"*",type:"textarea",populators:{name:"comments"}},{label:n("TL_APPROVAL_CHECKLIST_BUTTON_UP_FILE"),populators:l.createElement(t.UploadFile,{id:"workflow-doc",onUpload:u,onDelete:()=>{d(null)},message:s?"1 "+n("ES_PT_ACTION_FILEUPLOADED"):n("CS_ACTION_NO_FILEUPLOADED")})}]}]}})({t:o,action:a,approvers:y,selectedApprover:L,setSelectedApprover:O,selectFile:V,uploadedFile:w,setUploadedFile:P,businessService:p}))},[a,y,B,M,w]),a&&S.form?l.createElement(t.Modal,{headerBarMain:l.createElement(El,{label:o(S.label.heading)}),headerBarEnd:l.createElement(_l,{onClick:s}),actionCancelLabel:o(S.label.cancel),actionCancelOnSubmit:s,actionSaveLabel:o(S.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},l.createElement(t.FormComposer,{config:S.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){var t;let n=["APPROVE","VERIFY","REJECT","SENDBACKTOCITIZEN","SENDBACKTOVERIFIER","FORWARD"].includes(null==a?void 0:a.action);null!=a&&a.isTerminateState&&(n=!0);const l=null==e||null===(t=e.comments)||void 0===t?void 0:t.toString().trim();"APPROVE"===(null==a?void 0:a.action)||null!=L&&L.uuid?!n||l?(m=c({},m,{action:null==a?void 0:a.action,comment:null==e?void 0:e.comments,assignee:null!=L&&L.uuid?[null==L?void 0:L.uuid]:null,wfDocuments:w?[{documentType:null==T?void 0:T.type,fileName:null==T?void 0:T.name,documentUid:w,filestoreId:w,documentAttachment:w}]:null}),d({Licenses:[m]})):E({key:"true",warning:!0,message:o("COMMON_COMMENTS_REQUIRED_LABEL")}):E({key:"true",warning:!0,message:o("COMMON_ASSIGNEE_NAME_REQUIRED_LABEL")})},defaultValues:b,formId:"modal-action"}),f&&l.createElement(t.Toast,{error:null==f?void 0:f.error,warning:null==f?void 0:f.warning,label:null==f?void 0:f.message,onClose:g,isDleteBtn:!0}),_&&l.createElement(t.Toast,{error:!0,label:h,isDleteBtn:!0,onClose:A})):l.createElement(t.Loader,null)},Al=e=>{let{documents:i}=e;const{t:a}=o.useTranslation(),r=[{Header:a("BPA_DOCUMENT_NAME"),accessor:"title",Cell:e=>{let{value:t}=e;return a(t)||a("CS_NA")}},{Header:a("BPA_DOCUMENT_FILE"),accessor:"fileUrl",Cell:e=>{let{value:n}=e;return n?l.createElement(t.LinkButton,{style:{float:"right",display:"inline",background:"#fff"},label:a("View"),onClick:()=>{window.open(n,"_blank")}}):a("CS_NA")}}],u={value:{workflowDocs:null==i?void 0:i.map(e=>({documentType:(null==e?void 0:e.documentType)||"",filestoreId:(null==e?void 0:e.filestoreId)||"",documentUid:(null==e?void 0:e.documentUid)||"",documentAttachment:(null==e?void 0:e.documentAttachment)||""}))}},{data:s}=Digit.Hooks.noc.useNOCDocumentSearch(u,{enabled:(null==i?void 0:i.length)>0}),d=null==i?void 0:i.map(e=>{var t;const{documentUid:n,documentType:l}=e;return{documentUid:n,documentType:l,url:null==s||null===(t=s.pdfFiles)||void 0===t?void 0:t[n]}}),c=n.useMemo(()=>null==d?void 0:d.map((e,t)=>{var n;return{id:t,title:a(null==e||null===(n=e.documentType)||void 0===n?void 0:n.replaceAll(".","_"))||a("CS_NA"),fileUrl:e.url}}),[d]);return l.createElement("div",null,c&&l.createElement(t.Table,{className:"customTable table-border-style",t:a,data:c,columns:r,getCellProps:()=>({style:{}}),disableSort:!1,autoSort:!0,manualPagination:!1,isPaginationRequired:!1}))},Sl=e=>{let{formData:i}=e;const{t:a}=o.useTranslation(),r=n.useMemo(()=>{var e,t,n,l,o,a,r,u,s,d,v,m,p,f,E,g,_,h,A,S,N,b,C,y,D,L,O,T,I,w,P,R,x,B,F,M,U,k,W,H,j,z,V,G,Y,K,q,X;return{CalculationCriteria:[{applicationNumber:null==i||null===(e=i.apiData)||void 0===e||null===(t=e.Noc)||void 0===t||null===(n=t[0])||void 0===n?void 0:n.applicationNo,tenantId:null==i||null===(l=i.apiData)||void 0===l||null===(o=l.Noc)||void 0===o||null===(a=o[0])||void 0===a?void 0:a.tenantId,NOC:c({},null==i||null===(r=i.apiData)||void 0===r||null===(u=r.Noc)||void 0===u?void 0:u[0],{nocDetails:c({},null===(s=i.apiData)||void 0===s||null===(d=s.Noc)||void 0===d||null===(v=d[0])||void 0===v?void 0:v.nocDetails,{additionalDetails:c({},null==i||null===(m=i.apiData)||void 0===m||null===(p=m.Noc)||void 0===p||null===(f=p[0])||void 0===f||null===(E=f.nocDetails)||void 0===E?void 0:E.additionalDetails,{applicationDetails:c({},null==i?void 0:i.applicationDetails,{applicantGender:(null==i||null===(g=i.applicationDetails)||void 0===g||null===(_=g.applicantGender)||void 0===_?void 0:_.code)||(null==i||null===(h=i.applicationDetails)||void 0===h?void 0:h.applicantGender)||""}),siteDetails:c({},null==i?void 0:i.siteDetails,{ulbName:(null==i||null===(A=i.siteDetails)||void 0===A||null===(S=A.ulbName)||void 0===S?void 0:S.name)||(null==i||null===(N=i.siteDetails)||void 0===N?void 0:N.ulbName)||"",roadType:(null==i||null===(b=i.siteDetails)||void 0===b||null===(C=b.roadType)||void 0===C?void 0:C.name)||(null==i||null===(y=i.siteDetails)||void 0===y?void 0:y.roadType)||"",buildingStatus:(null==i||null===(D=i.siteDetails)||void 0===D||null===(L=D.buildingStatus)||void 0===L?void 0:L.name)||(null==i||null===(O=i.siteDetails)||void 0===O?void 0:O.buildingStatus)||"",isBasementAreaAvailable:(null==i||null===(T=i.siteDetails)||void 0===T||null===(I=T.isBasementAreaAvailable)||void 0===I?void 0:I.code)||(null==i||null===(w=i.siteDetails)||void 0===w?void 0:w.isBasementAreaAvailable)||"",district:(null==i||null===(P=i.siteDetails)||void 0===P||null===(R=P.district)||void 0===R?void 0:R.name)||(null==i||null===(x=i.siteDetails)||void 0===x?void 0:x.district)||"",zone:(null==i||null===(B=i.siteDetails)||void 0===B||null===(F=B.zone)||void 0===F?void 0:F.name)||(null==i||null===(M=i.siteDetails)||void 0===M?void 0:M.zone)||"",specificationBuildingCategory:(null==i||null===(U=i.siteDetails)||void 0===U||null===(k=U.specificationBuildingCategory)||void 0===k?void 0:k.name)||(null==i||null===(W=i.siteDetails)||void 0===W?void 0:W.specificationBuildingCategory)||"",specificationNocType:(null==i||null===(H=i.siteDetails)||void 0===H||null===(j=H.specificationNocType)||void 0===j?void 0:j.name)||(null==i||null===(z=i.siteDetails)||void 0===z?void 0:z.specificationNocType)||"",specificationRestrictedArea:(null==i||null===(V=i.siteDetails)||void 0===V||null===(G=V.specificationRestrictedArea)||void 0===G?void 0:G.code)||(null==i||null===(Y=i.siteDetails)||void 0===Y?void 0:Y.specificationRestrictedArea)||"",specificationIsSiteUnderMasterPlan:(null==i||null===(K=i.siteDetails)||void 0===K||null===(q=K.specificationIsSiteUnderMasterPlan)||void 0===q?void 0:q.code)||(null==i||null===(X=i.siteDetails)||void 0===X?void 0:X.specificationIsSiteUnderMasterPlan)||""})})})})}]}},[i]),{isLoading:u,data:s,revalidate:d}=Digit.Hooks.noc.useNOCFeeCalculator({payload:r},{enabled:!!r}),[v,m]=n.useState(null);n.useEffect(()=>{At.isEqual(v,null==i?void 0:i.siteDetails)||(d(),m(null==i?void 0:i.siteDetails))},[null==i?void 0:i.siteDetails]);const p=n.useMemo(()=>{var e,t,n,l,i;if(null==s||null===(e=s.Calculation)||void 0===e||null===(t=e[0])||void 0===t||!t.totalAmount)return[];const o=(null==s||null===(n=s.Calculation)||void 0===n||null===(l=n[0])||void 0===l||null===(i=l.taxHeadEstimates)||void 0===i?void 0:i.reduce((e,t)=>e+((null==t?void 0:t.estimateAmount)||0),0))||"N/A";return[{id:"1",title:a("NOC_FEE_LABEL"),amount:o}]},[s,a]),f=[{Header:a("NOC_FEE_TYPE_LABEL"),accessor:"title",Cell:e=>{let{value:t}=e;return t||a("CS_NA")}},{Header:a("NOC_AMOUNT_LABEL"),accessor:"amount",Cell:e=>{let{value:t}=e;return null!=t?"₹ "+t.toLocaleString():a("CS_NA")}}];return u?l.createElement(t.Loader,null):l.createElement("div",null,u?l.createElement(t.Loader,null):l.createElement(t.Table,{className:"customTable table-border-style",t:a,data:p,columns:f,getCellProps:()=>({style:{}}),disableSort:!0,manualPagination:!1,isPaginationRequired:!1}))},Nl=(e,n,i,o)=>{var a,r,u,s,d,c;console.log("checkpoint here",e);const{wfComment:v,thumbnailsToShow:m,wfDocuments:p}=e;console.log("wfDocuments",p);const f={date:null==e||null===(a=e.auditDetails)||void 0===a?void 0:a.lastModified,time:null==e||null===(r=e.auditDetails)||void 0===r?void 0:r.timing,name:null==e||null===(u=e.assigner)||void 0===u?void 0:u.name,mobileNumber:null==e||null===(s=e.assigner)||void 0===s?void 0:s.mobileNumber,source:null==e||null===(d=e.assigner)||void 0===d?void 0:d.source};return l.createElement("div",null,(null==v?void 0:v.length)>0&&l.createElement("div",{className:"TLComments"},l.createElement("h3",null,o("WF_COMMON_COMMENTS")),l.createElement("p",{style:{overflowX:"scroll"}},v)),(null==m||null===(c=m.thumbs)||void 0===c?void 0:c.length)>0&&l.createElement(t.DisplayPhotos,{srcs:m.thumbs,onClick:(e,t)=>{var n;let l=(null===(n=m.fullImage)||void 0===n?void 0:n[t])||e;Digit.Utils.zoomImage(l)}}),(null==p?void 0:p.length)>0&&l.createElement("div",null,l.createElement("div",null,l.createElement(fl,{value:{workflowDocs:p},index:n}))),l.createElement("div",{style:{marginTop:"8px"}},f.time&&l.createElement("p",null,f.time),f.date&&l.createElement("p",null,f.date),f.name&&l.createElement("p",null,f.name),f.mobileNumber&&l.createElement("p",null,f.mobileNumber),f.source&&l.createElement("p",null,o("ES_COMMON_FILED_VIA_"+f.source.toUpperCase()))))},bl=e=>{let{registerRef:i,searchFieldComponents:a}=e;const{t:r}=o.useTranslation();return window.Digit.Utils.browser.isMobile()?l.createElement(n.Fragment,null,l.createElement(t.SearchField,null,l.createElement("label",null,r("NOC_APPLICATION_NUMBER")),l.createElement(t.TextInput,{name:"applicationNo",inputRef:i({})})),l.createElement(t.SearchField,null,l.createElement("label",null,r("NOC_APPLICANT_MOBILE_NO_LABEL")),l.createElement(t.TextInput,{name:"mobileNumber",inputRef:i({})}))):l.createElement(l.Fragment,null,l.createElement("div",{className:"search-container",style:{width:"auto",marginLeft:"24px"}},l.createElement("div",{className:"search-complaint-container"},l.createElement("div",{className:"complaint-input-container",style:{textAlign:"start"}},l.createElement(t.SearchField,null,l.createElement("label",null,r("NOC_APPLICATION_NUMBER")),l.createElement(t.TextInput,{name:"applicationNo",inputRef:i({})})),l.createElement(t.SearchField,null,l.createElement("label",null,r("NOC_APPLICANT_MOBILE_NO_LABEL")),l.createElement(t.TextInput,{name:"mobileNumber",inputRef:i({})})),l.createElement("div",{className:"search-action-wrapper",style:{width:"100%"}},a)))))},Cl=e=>{let{statuses:i,controlFilterForm:r,applicationTypesOfBPA:u}=e;const{t:s}=o.useTranslation(),d=(Digit.ULBService.getStateId(),[{code:"ASSIGNED_TO_ME",name:""+s("ES_INBOX_ASSIGNED_TO_ME")},{code:"ASSIGNED_TO_ALL",name:""+s("ES_INBOX_ASSIGNED_TO_ALL")}]);return null==u||u.forEach(e=>{e.name=s("WF_BPA_"+e.code),e.i18nKey=s("WF_BPA_"+e.code)}),console.log("status heres===>",i),l.createElement(n.Fragment,null,l.createElement(t.FilterFormField,null,l.createElement(a.Controller,{name:"assignee",control:r,render:e=>l.createElement(t.RadioButtons,{onSelect:t=>{e.onChange(t.code)},selectedOption:d.filter(t=>t.code===e.value)[0],optionsKey:"name",options:d})})),l.createElement(t.FilterFormField,null,l.createElement(a.Controller,{name:"applicationStatus",control:r,defaultValue:[],render:e=>l.createElement(n.Fragment,null,null==i?void 0:i.map((n,i)=>l.createElement(t.CheckBox,{key:n.applicationstatus,label:s(n.applicationstatus)+" - "+n.count,value:n.applicationstatus,checked:e.value.includes(n.applicationstatus),onChange:()=>{var t;e.value.includes(t=n.applicationstatus)?e.onChange(e.value.filter(e=>e!==t)):e.onChange([...e.value,t])},index:i})))})))};function yl(e){if(null===e||!0===e||!1===e)return NaN;var t=Number(e);return isNaN(t)?t:t<0?Math.ceil(t):Math.floor(t)}function Dl(e,t){if(t.length<e)throw new TypeError(e+" argument"+(e>1?"s":"")+" required, but only "+t.length+" present")}function Ll(e){Dl(1,arguments);var t=Object.prototype.toString.call(e);return e instanceof Date||"object"==typeof e&&"[object Date]"===t?new Date(e.getTime()):"number"==typeof e||"[object Number]"===t?new Date(e):("string"!=typeof e&&"[object String]"!==t||"undefined"==typeof console||(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://git.io/fjule"),console.warn((new Error).stack)),new Date(NaN))}function Ol(e,t){Dl(2,arguments);var n=Ll(e).getTime(),l=yl(t);return new Date(n+l)}function Tl(e){var t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),e.getTime()-t.getTime()}function Il(e){return Dl(1,arguments),e instanceof Date||"object"==typeof e&&"[object Date]"===Object.prototype.toString.call(e)}function wl(e){if(Dl(1,arguments),!Il(e)&&"number"!=typeof e)return!1;var t=Ll(e);return!isNaN(Number(t))}var Pl={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};function Rl(e){return function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.width?String(t.width):e.defaultWidth,l=e.formats[n]||e.formats[e.defaultWidth];return l}}var xl={date:Rl({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:Rl({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:Rl({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},Bl={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function Fl(e){return function(t,n){var l,i=n||{};if("formatting"===(i.context?String(i.context):"standalone")&&e.formattingValues){var o=e.defaultFormattingWidth||e.defaultWidth,a=i.width?String(i.width):o;l=e.formattingValues[a]||e.formattingValues[o]}else{var r=e.defaultWidth,u=i.width?String(i.width):e.defaultWidth;l=e.values[u]||e.values[r]}return l[e.argumentCallback?e.argumentCallback(t):t]}}function Ml(e){return function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},l=n.width,i=l&&e.matchPatterns[l]||e.matchPatterns[e.defaultMatchWidth],o=t.match(i);if(!o)return null;var a,r=o[0],u=l&&e.parsePatterns[l]||e.parsePatterns[e.defaultParseWidth],s=Array.isArray(u)?kl(u,function(e){return e.test(r)}):Ul(u,function(e){return e.test(r)});a=e.valueCallback?e.valueCallback(s):s,a=n.valueCallback?n.valueCallback(a):a;var d=t.slice(r.length);return{value:a,rest:d}}}function Ul(e,t){for(var n in e)if(e.hasOwnProperty(n)&&t(e[n]))return n}function kl(e,t){for(var n=0;n<e.length;n++)if(t(e[n]))return n}var Wl,Hl={code:"en-US",formatDistance:function(e,t,n){var l,i=Pl[e];return l="string"==typeof i?i:1===t?i.one:i.other.replace("{{count}}",t.toString()),null!=n&&n.addSuffix?n.comparison&&n.comparison>0?"in "+l:l+" ago":l},formatLong:xl,formatRelative:function(e,t,n,l){return Bl[e]},localize:{ordinalNumber:function(e,t){var n=Number(e),l=n%100;if(l>20||l<10)switch(l%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:Fl({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:Fl({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:Fl({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:Fl({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:Fl({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:(Wl={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:function(e){return parseInt(e,10)}},function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.match(Wl.matchPattern);if(!n)return null;var l=n[0],i=e.match(Wl.parsePattern);if(!i)return null;var o=Wl.valueCallback?Wl.valueCallback(i[0]):i[0];o=t.valueCallback?t.valueCallback(o):o;var a=e.slice(l.length);return{value:o,rest:a}}),era:Ml({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:Ml({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:Ml({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:Ml({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:Ml({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 jl(e,t){Dl(2,arguments);var n=yl(t);return Ol(e,-n)}function zl(e){Dl(1,arguments);var t=1,n=Ll(e),l=n.getUTCDay(),i=(l<t?7:0)+l-t;return n.setUTCDate(n.getUTCDate()-i),n.setUTCHours(0,0,0,0),n}function Vl(e){Dl(1,arguments);var t=Ll(e),n=t.getUTCFullYear(),l=new Date(0);l.setUTCFullYear(n+1,0,4),l.setUTCHours(0,0,0,0);var i=zl(l),o=new Date(0);o.setUTCFullYear(n,0,4),o.setUTCHours(0,0,0,0);var a=zl(o);return t.getTime()>=i.getTime()?n+1:t.getTime()>=a.getTime()?n:n-1}function Gl(e){Dl(1,arguments);var t=Vl(e),n=new Date(0);n.setUTCFullYear(t,0,4),n.setUTCHours(0,0,0,0);var l=zl(n);return l}function Yl(e,t){Dl(1,arguments);var n=t||{},l=n.locale,i=l&&l.options&&l.options.weekStartsOn,o=null==i?0:yl(i),a=null==n.weekStartsOn?o:yl(n.weekStartsOn);if(!(a>=0&&a<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var r=Ll(e),u=r.getUTCDay(),s=(u<a?7:0)+u-a;return r.setUTCDate(r.getUTCDate()-s),r.setUTCHours(0,0,0,0),r}function Kl(e,t){Dl(1,arguments);var n=Ll(e),l=n.getUTCFullYear(),i=t||{},o=i.locale,a=o&&o.options&&o.options.firstWeekContainsDate,r=null==a?1:yl(a),u=null==i.firstWeekContainsDate?r:yl(i.firstWeekContainsDate);if(!(u>=1&&u<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var s=new Date(0);s.setUTCFullYear(l+1,0,u),s.setUTCHours(0,0,0,0);var d=Yl(s,t),c=new Date(0);c.setUTCFullYear(l,0,u),c.setUTCHours(0,0,0,0);var v=Yl(c,t);return n.getTime()>=d.getTime()?l+1:n.getTime()>=v.getTime()?l:l-1}function ql(e,t){Dl(1,arguments);var n=t||{},l=n.locale,i=l&&l.options&&l.options.firstWeekContainsDate,o=null==i?1:yl(i),a=null==n.firstWeekContainsDate?o:yl(n.firstWeekContainsDate),r=Kl(e,t),u=new Date(0);u.setUTCFullYear(r,0,a),u.setUTCHours(0,0,0,0);var s=Yl(u,t);return s}function Xl(e,t){for(var n=e<0?"-":"",l=Math.abs(e).toString();l.length<t;)l="0"+l;return n+l}var Jl={G:function(e,t,n){var l=e.getUTCFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(l,{width:"abbreviated"});case"GGGGG":return n.era(l,{width:"narrow"});case"GGGG":default:return n.era(l,{width:"wide"})}},y:function(e,t,n){if("yo"===t){var l=e.getUTCFullYear();return n.ordinalNumber(l>0?l:1-l,{unit:"year"})}return function(e,t){var n=e.getUTCFullYear(),l=n>0?n:1-n;return Xl("yy"===t?l%100:l,t.length)}(e,t)},Y:function(e,t,n,l){var i=Kl(e,l),o=i>0?i:1-i;return"YY"===t?Xl(o%100,2):"Yo"===t?n.ordinalNumber(o,{unit:"year"}):Xl(o,t.length)},R:function(e,t){return Xl(Vl(e),t.length)},u:function(e,t){return Xl(e.getUTCFullYear(),t.length)},Q:function(e,t,n){var l=Math.ceil((e.getUTCMonth()+1)/3);switch(t){case"Q":return String(l);case"QQ":return Xl(l,2);case"Qo":return n.ordinalNumber(l,{unit:"quarter"});case"QQQ":return n.quarter(l,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(l,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(l,{width:"wide",context:"formatting"})}},q:function(e,t,n){var l=Math.ceil((e.getUTCMonth()+1)/3);switch(t){case"q":return String(l);case"qq":return Xl(l,2);case"qo":return n.ordinalNumber(l,{unit:"quarter"});case"qqq":return n.quarter(l,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(l,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(l,{width:"wide",context:"standalone"})}},M:function(e,t,n){var l=e.getUTCMonth();switch(t){case"M":case"MM":return function(e,t){var n=e.getUTCMonth();return"M"===t?String(n+1):Xl(n+1,2)}(e,t);case"Mo":return n.ordinalNumber(l+1,{unit:"month"});case"MMM":return n.month(l,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(l,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(l,{width:"wide",context:"formatting"})}},L:function(e,t,n){var l=e.getUTCMonth();switch(t){case"L":return String(l+1);case"LL":return Xl(l+1,2);case"Lo":return n.ordinalNumber(l+1,{unit:"month"});case"LLL":return n.month(l,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(l,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(l,{width:"wide",context:"standalone"})}},w:function(e,t,n,l){var i=function(e,t){Dl(1,arguments);var n=Ll(e),l=Yl(n,t).getTime()-ql(n,t).getTime();return Math.round(l/6048e5)+1}(e,l);return"wo"===t?n.ordinalNumber(i,{unit:"week"}):Xl(i,t.length)},I:function(e,t,n){var l=function(e){Dl(1,arguments);var t=Ll(e),n=zl(t).getTime()-Gl(t).getTime();return Math.round(n/6048e5)+1}(e);return"Io"===t?n.ordinalNumber(l,{unit:"week"}):Xl(l,t.length)},d:function(e,t,n){return"do"===t?n.ordinalNumber(e.getUTCDate(),{unit:"date"}):function(e,t){return Xl(e.getUTCDate(),t.length)}(e,t)},D:function(e,t,n){var l=function(e){Dl(1,arguments);var t=Ll(e),n=t.getTime();t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0);var l=t.getTime(),i=n-l;return Math.floor(i/864e5)+1}(e);return"Do"===t?n.ordinalNumber(l,{unit:"dayOfYear"}):Xl(l,t.length)},E:function(e,t,n){var l=e.getUTCDay();switch(t){case"E":case"EE":case"EEE":return n.day(l,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(l,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(l,{width:"short",context:"formatting"});case"EEEE":default:return n.day(l,{width:"wide",context:"formatting"})}},e:function(e,t,n,l){var i=e.getUTCDay(),o=(i-l.weekStartsOn+8)%7||7;switch(t){case"e":return String(o);case"ee":return Xl(o,2);case"eo":return n.ordinalNumber(o,{unit:"day"});case"eee":return n.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(i,{width:"short",context:"formatting"});case"eeee":default:return n.day(i,{width:"wide",context:"formatting"})}},c:function(e,t,n,l){var i=e.getUTCDay(),o=(i-l.weekStartsOn+8)%7||7;switch(t){case"c":return String(o);case"cc":return Xl(o,t.length);case"co":return n.ordinalNumber(o,{unit:"day"});case"ccc":return n.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(i,{width:"narrow",context:"standalone"});case"cccccc":return n.day(i,{width:"short",context:"standalone"});case"cccc":default:return n.day(i,{width:"wide",context:"standalone"})}},i:function(e,t,n){var l=e.getUTCDay(),i=0===l?7:l;switch(t){case"i":return String(i);case"ii":return Xl(i,t.length);case"io":return n.ordinalNumber(i,{unit:"day"});case"iii":return n.day(l,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(l,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(l,{width:"short",context:"formatting"});case"iiii":default:return n.day(l,{width:"wide",context:"formatting"})}},a:function(e,t,n){var l=e.getUTCHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(l,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(l,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(l,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(l,{width:"wide",context:"formatting"})}},b:function(e,t,n){var l,i=e.getUTCHours();switch(l=12===i?"noon":0===i?"midnight":i/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(l,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(l,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(l,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(l,{width:"wide",context:"formatting"})}},B:function(e,t,n){var l,i=e.getUTCHours();switch(l=i>=17?"evening":i>=12?"afternoon":i>=4?"morning":"night",t){case"B":case"BB":case"BBB":return n.dayPeriod(l,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(l,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(l,{width:"wide",context:"formatting"})}},h:function(e,t,n){if("ho"===t){var l=e.getUTCHours()%12;return 0===l&&(l=12),n.ordinalNumber(l,{unit:"hour"})}return function(e,t){return Xl(e.getUTCHours()%12||12,t.length)}(e,t)},H:function(e,t,n){return"Ho"===t?n.ordinalNumber(e.getUTCHours(),{unit:"hour"}):function(e,t){return Xl(e.getUTCHours(),t.length)}(e,t)},K:function(e,t,n){var l=e.getUTCHours()%12;return"Ko"===t?n.ordinalNumber(l,{unit:"hour"}):Xl(l,t.length)},k:function(e,t,n){var l=e.getUTCHours();return 0===l&&(l=24),"ko"===t?n.ordinalNumber(l,{unit:"hour"}):Xl(l,t.length)},m:function(e,t,n){return"mo"===t?n.ordinalNumber(e.getUTCMinutes(),{unit:"minute"}):function(e,t){return Xl(e.getUTCMinutes(),t.length)}(e,t)},s:function(e,t,n){return"so"===t?n.ordinalNumber(e.getUTCSeconds(),{unit:"second"}):function(e,t){return Xl(e.getUTCSeconds(),t.length)}(e,t)},S:function(e,t){return function(e,t){var n=t.length,l=e.getUTCMilliseconds();return Xl(Math.floor(l*Math.pow(10,n-3)),t.length)}(e,t)},X:function(e,t,n,l){var i=(l._originalDate||e).getTimezoneOffset();if(0===i)return"Z";switch(t){case"X":return Zl(i);case"XXXX":case"XX":return $l(i);case"XXXXX":case"XXX":default:return $l(i,":")}},x:function(e,t,n,l){var i=(l._originalDate||e).getTimezoneOffset();switch(t){case"x":return Zl(i);case"xxxx":case"xx":return $l(i);case"xxxxx":case"xxx":default:return $l(i,":")}},O:function(e,t,n,l){var i=(l._originalDate||e).getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Ql(i,":");case"OOOO":default:return"GMT"+$l(i,":")}},z:function(e,t,n,l){var i=(l._originalDate||e).getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Ql(i,":");case"zzzz":default:return"GMT"+$l(i,":")}},t:function(e,t,n,l){return Xl(Math.floor((l._originalDate||e).getTime()/1e3),t.length)},T:function(e,t,n,l){return Xl((l._originalDate||e).getTime(),t.length)}};function Ql(e,t){var n=e>0?"-":"+",l=Math.abs(e),i=Math.floor(l/60),o=l%60;if(0===o)return n+String(i);var a=t||"";return n+String(i)+a+Xl(o,2)}function Zl(e,t){return e%60==0?(e>0?"-":"+")+Xl(Math.abs(e)/60,2):$l(e,t)}function $l(e,t){var n=t||"",l=e>0?"-":"+",i=Math.abs(e);return l+Xl(Math.floor(i/60),2)+n+Xl(i%60,2)}function ei(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 ti(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 ni={p:ti,P:function(e,t){var n,l=e.match(/(P+)(p+)?/)||[],i=l[1],o=l[2];if(!o)return ei(e,t);switch(i){case"P":n=t.dateTime({width:"short"});break;case"PP":n=t.dateTime({width:"medium"});break;case"PPP":n=t.dateTime({width:"long"});break;case"PPPP":default:n=t.dateTime({width:"full"})}return n.replace("{{date}}",ei(i,t)).replace("{{time}}",ti(o,t))}},li=["D","DD"],ii=["YY","YYYY"];function oi(e){return-1!==li.indexOf(e)}function ai(e){return-1!==ii.indexOf(e)}function ri(e,t,n){if("YYYY"===e)throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(t,"`) for formatting years to the input `").concat(n,"`; see: https://git.io/fxCyr"));if("YY"===e)throw new RangeError("Use `yy` instead of `YY` (in `".concat(t,"`) for formatting years to the input `").concat(n,"`; see: https://git.io/fxCyr"));if("D"===e)throw new RangeError("Use `d` instead of `D` (in `".concat(t,"`) for formatting days of the month to the input `").concat(n,"`; see: https://git.io/fxCyr"));if("DD"===e)throw new RangeError("Use `dd` instead of `DD` (in `".concat(t,"`) for formatting days of the month to the input `").concat(n,"`; see: https://git.io/fxCyr"))}var ui=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,si=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,di=/^'([^]*?)'?$/,ci=/''/g,vi=/[a-zA-Z]/;function mi(e,t,n){Dl(2,arguments);var l=String(t),i=n||{},o=i.locale||Hl,a=o.options&&o.options.firstWeekContainsDate,r=null==a?1:yl(a),u=null==i.firstWeekContainsDate?r:yl(i.firstWeekContainsDate);if(!(u>=1&&u<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var s=o.options&&o.options.weekStartsOn,d=null==s?0:yl(s),c=null==i.weekStartsOn?d:yl(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=Ll(e);if(!wl(v))throw new RangeError("Invalid time value");var m=Tl(v),p=jl(v,m),f={firstWeekContainsDate:u,weekStartsOn:c,locale:o,_originalDate:v},E=l.match(si).map(function(e){var t=e[0];return"p"===t||"P"===t?(0,ni[t])(e,o.formatLong,f):e}).join("").match(ui).map(function(n){if("''"===n)return"'";var l=n[0];if("'"===l)return pi(n);var a=Jl[l];if(a)return!i.useAdditionalWeekYearTokens&&ai(n)&&ri(n,t,e),!i.useAdditionalDayOfYearTokens&&oi(n)&&ri(n,t,e),a(p,n,o.localize,f);if(l.match(vi))throw new RangeError("Format string contains an unescaped latin alphabet character `"+l+"`");return n}).join("");return E}function pi(e){return e.match(di)[1].replace(ci,"'")}const fi={step:1,isValid:!1,formData:{},coordinates:{}},Ei=function(e,t){switch(void 0===e&&(e=fi),t.type){case"UPDATE_NOCNewApplication_FORM":return c({},e,{formData:c({},e.formData,{[t.payload.key]:t.payload.value})});case"SET_NOCNewApplication_STEP":return c({},e,{step:t.payload});case"RESET_NOC_NEW_APPLICATION_FORM":return fi;case"UPDATE_NOCNewApplication_CoOrdinates":return c({},e,{coordinates:c({},e.coordinates,{[t.payload.key]:t.payload.value})});default:return e}},gi=["path","url"],_i=[],hi=()=>{var e,n,a,r,u,s,d,c;const m=i.useRouteMatch(),{path:p}=m,f=(v(m,gi),o.useTranslation(),null===(e=Digit)||void 0===e||null===(n=e.ComponentRegistryService)||void 0===n?void 0:n.getComponent("NewNOCStepperForm")),E=Digit.ComponentRegistryService.getComponent("NOCResponseCitizen"),g=Digit.ComponentRegistryService.getComponent("NOCCitizenMyApplications"),_=null===(a=Digit)||void 0===a||null===(r=a.ComponentRegistryService)||void 0===r?void 0:r.getComponent("NOCCitizenApplicationOverview"),h=null===(u=Digit)||void 0===u||null===(s=u.ComponentRegistryService)||void 0===s?void 0:s.getComponent("NewNOCEditApplication"),A=null===(d=Digit)||void 0===d||null===(c=d.ComponentRegistryService)||void 0===c?void 0:c.getComponent("NOCCitizenSearchApplication");return l.createElement("span",{className:"pgr-citizen-wrapper",style:{width:"100%"}},l.createElement(i.Switch,null,l.createElement(t.AppContainer,null,(void 0===(S=_i)&&(S=[]),S.filter(e=>window.location.href.includes(e.screenPath)).length>0?"":l.createElement(t.BackButton,null,"Back")),l.createElement(t.PrivateRoute,{path:p+"/new-application",component:f}),l.createElement(t.PrivateRoute,{path:p+"/response/:id",component:E}),l.createElement(t.PrivateRoute,{path:p+"/my-application",component:g}),l.createElement(t.PrivateRoute,{path:p+"/edit-application/:id",component:h}),l.createElement(t.PrivateRoute,{path:p+"/search/application-overview/:id",component:_}),l.createElement(t.PrivateRoute,{path:p+"/search-application",component:A}))));var S},Ai=e=>{let{children:t,currentStep:n=1,stepsList:i=[]}=e;const{t:a}=o.useTranslation(),r=e=>{let t;return t=e<=n?"#0D43A7":"#FFFFFF",{width:"60px",height:"60px",borderRadius:"50%",backgroundColor:t,color:e<=n?"white":"black",display:"flex",alignItems:"center",justifyContent:"center",marginBottom:"10px",fontWeight:"normal",fontSize:"18px",border:e>n?"1px solid black":"",position:"relative"}},u={fontSize:"18px",color:"#1E1E1E",fontWeight:"500",fontFamily:"Noto Sans,sans-serif",marginRight:"6px"},s={fontSize:"18px",color:"#263238",fontWeight:"400",fontFamily:"Noto Sans,sans-serif",margin:"0px 6px 0px 0px"},d={position:"absolute",width:"2px",height:"50px",backgroundColor:"grey",left:"50%",top:"100%",transform:"translateX(-50%)"},c=(window.Digit.Utils.browser.isMobile(),i.length);return l.createElement("div",{className:"stepper",style:{width:"100%",display:"flex",flexDirection:"row",alignItems:"top",justifyContent:"flex-start"}},l.createElement("div",{className:"stepper-navigation-bar",style:{display:"flex",flexDirection:"column",justifyContent:"space-between",height:"50%",marginBottom:"20px"}},[...Array(c)].map((e,t)=>{return l.createElement("div",{className:"step-content",key:t,style:(o=t+1<=n,{display:"flex",alignItems:"center",justifyContent:"flex-end",flex:1,color:o?"#3f51b5":"#ccc",padding:"10px 10px",width:"260px"})},l.createElement("div",{className:"step-sub-content",style:{display:"flex",flexDirection:"column",alignItems:"flex-end",margin:"10px"}},t+1===c?null:l.createElement("div",{className:"step-number",style:s}),l.createElement("div",{className:"step-label",style:u},a(i[t].stepLabel))),l.createElement("div",{className:"step-circle",style:r(t+1)},t+1,t<c-1&&l.createElement("div",{style:d})));var o})),l.createElement("div",{className:"stepper-body",style:{width:"100%",marginBottom:"20px"}},t))},Si=e=>{let{stepsList:t=[],onSubmit:n,step:i,setStep:a}=e;const r=t.filter(e=>e.isStepEnabled),{t:u}=o.useTranslation();function s(){i<r.length?c():i===r.length&&n()}function d(){i>1&&v()}const c=()=>a(i+1),v=()=>a(i-1);return l.createElement(Ai,{currentStep:i,nextStep:c,prevStep:v,stepsList:r},(()=>{var e,t;const n=r[i-1],{component:o,key:a,texts:c,currStepConfig:v}=n,m=null===(e=Digit)||void 0===e||null===(t=e.ComponentRegistryService)||void 0===t?void 0:t.getComponent(o);return l.createElement(l.Fragment,null,l.createElement(m,{config:{key:a,texts:c,component:o,currStepNumber:i,currStepConfig:v},onGoNext:s,onBackClick:d,t:u}))})())},Ni=[{head:"NOC_APPLICATION_REGISTRATION",stepNumber:1,body:[{component:"NOCApplicantDetails",withoutLabel:!0,key:"applicantDetails",type:"component"},{component:"NOCProfessionalDetails",withoutLabel:!0,key:"professionalDetails",type:"component"}]},{head:"ES_SITE_DETAILS",stepNumber:2,body:[{component:"NOCSiteDetails",withoutLabel:!0,key:"siteDetails",type:"component"},{component:"NOCSpecificationDetails",withoutLabel:!0,key:"siteDetails",type:"component"}]},{head:"ES_TITILE_DOCUMENT_DETAILS",stepNumber:3,body:[{component:"NOCDocumentsRequired",withoutLabel:!0,key:"documents",type:"component"}]},{head:"ES_TITILE_SUMMARY_DETAILS",stepNumber:4,body:[{component:"NOCSummary",withoutLabel:!0,key:"summary",type:"component"}]}],bi=(e,t)=>({type:"UPDATE_NOCNewApplication_FORM",payload:{key:e,value:t}}),Ci=e=>({type:"SET_NOCNewApplication_STEP",payload:e}),yi=(e,t)=>({type:"UPDATE_NOCNewApplication_CoOrdinates",payload:{key:e,value:t}}),Di=[{head:"APPLICATION DETAILS",stepLabel:"NOC_APPLICATION_DETAILS",stepNumber:1,isStepEnabled:!0,type:"component",component:"NewNOCStepFormOne",key:"applicationDetails",withoutLabel:!0,texts:{submitBarLabel:"CS_COMMON_NEXT"}},{head:"SITE DETAILS",stepLabel:"NOC_SITE_DETAILS",stepNumber:2,isStepEnabled:!0,type:"component",component:"NewNOCStepFormTwo",key:"siteDetails",withoutLabel:!0,texts:{submitBarLabel:"CS_COMMON_NEXT"}},{head:"DOCUMENT DETAILS",stepLabel:"ES_TITILE_DOCUMENT_DETAILS",stepNumber:3,isStepEnabled:!0,type:"component",component:"NewNOCStepFormThree",key:"documents",withoutLabel:!0,texts:{submitBarLabel:"CS_COMMON_NEXT"}},{head:"SUMMARY DETAILS",stepLabel:"ES_TITILE_SUMMARY_DETAILS",stepNumber:4,isStepEnabled:!0,type:"component",component:"NewNOCStepFormFour",key:"summary",withoutLabel:!0,texts:{submitBarLabel:"CS_COMMON_SUBMIT"}}].map(e=>c({},e,{currStepConfig:Ni.filter(t=>t.stepNumber===e.stepNumber)})),Li=e=>{var i,o,a,r,u,s;const{t:d,currentStepData:c,Controller:v,control:m,setValue:p,errors:f,errorStyle:E}=e,g=(Digit.ULBService.getCurrentTenantId(),Digit.ULBService.getStateId()),{data:_}=Digit.Hooks.obps.useMDMS(g,"common-masters",["GenderType"]);let h=[];_&&_["common-masters"].GenderType.filter(e=>e.active).map(e=>{h.push({i18nKey:"COMMON_GENDER_"+e.code,code:""+e.code,value:""+e.code})}),n.useEffect(()=>{console.log("currentStepData1",c);const e=null==c?void 0:c.applicationDetails;e&&Object.entries(e).forEach(e=>{let[t,n]=e;p(t,n)})},[c,p]);const[A,S]=n.useState(""),[N,b]=n.useState(null),[C,y]=n.useState(null);n.useEffect(()=>{C&&Object.entries(C).forEach(e=>{let[t,n]=e;if("name"===t)p("applicantOwnerOrFirmName",n,{shouldValidate:!0,shouldDirty:!0});else if("emailId"===t)p("applicantEmailId",n,{shouldValidate:!0,shouldDirty:!0});else if("gender"===t){const e=h.find(e=>e.code===n);p("applicantGender",e,{shouldValidate:!0,shouldDirty:!0})}else"dob"===t?p("applicantDateOfBirth",n,{shouldValidate:!0,shouldDirty:!0}):"fatherOrHusbandName"===t?p("applicantFatherHusbandName",n):"permanentAddress"===t&&p("applicantAddress",n,{shouldValidate:!0,shouldDirty:!0})})},[C]);const D=window.location.pathname.includes("edit");return l.createElement(l.Fragment,null,l.createElement(t.CardSectionHeader,{className:"card-section-header"},d("NOC_APPLICANT_DETAILS")),l.createElement("div",null,D&&l.createElement(t.CardSectionSubText,{style:{color:"red",margin:"10px 0px"}}," To update your Mobile No, Name, Email, Date of Birth, or Gender, please go the Citizen's Edit Profile section"),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+d("NOC_APPLICANT_MOBILE_NO_LABEL"),"*"),l.createElement("div",{className:"field"},l.createElement(v,{control:m,name:"applicantMobileNumber",rules:{required:d("REQUIRED_FIELD"),pattern:{value:/^[6-9]\d{9}$/,message:d("INVALID_MOBILE_NUMBER")}},render:e=>l.createElement(t.TextInput,{value:e.value,onChange:t=>{e.onChange(t.target.value),S(t.target.value)},onBlur:t=>{e.onBlur(t)},t:d,disabled:D})})),l.createElement("div",{className:"search-icon",onClick:D?null:function(){try{return""===A||10!==A.length?(b({key:"true",error:!0,message:"INVALID_MOBILE_NUMBER"}),Promise.resolve()):Promise.resolve(Digit.UserService.userSearch(Digit.ULBService.getStateId(),{userName:A},{})).then(function(e){var t,n;0===(null==e||null===(t=e.user)||void 0===t?void 0:t.length)?b({key:"true",warning:!0,message:"ERR_MOBILE_NUMBER_NOT_REGISTERED"}):y(null==e||null===(n=e.user)||void 0===n?void 0:n[0])})}catch(e){return Promise.reject(e)}}}," ",l.createElement(t.SearchIcon,null)," ")),l.createElement(t.CardLabelError,{style:E},(null==f||null===(i=f.applicantMobileNumber)||void 0===i?void 0:i.message)||""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+d("NOC_FIRM_OWNER_NAME_LABEL"),"*"),l.createElement("div",{className:"field"},l.createElement(v,{control:m,name:"applicantOwnerOrFirmName",rules:{required:d("REQUIRED_FIELD"),maxLength:{value:100,message:d("MAX_100_CHARACTERS_ALLOWED")}},render:e=>l.createElement(t.TextInput,{value:e.value||(null==C?void 0:C.name),onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)},t:d,disabled:D})}))),l.createElement(t.CardLabelError,{style:E},null!=f&&f.applicantOwnerOrFirmName?f.applicantOwnerOrFirmName.message:""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+d("NOC_APPLICANT_EMAIL_LABEL"),"*"),l.createElement("div",{className:"field"},l.createElement(v,{control:m,name:"applicantEmailId",rules:{required:d("REQUIRED_FIELD"),pattern:{value:/^[^\s@]+@[^\s@]+\.[^\s@]+$/,message:d("INVALID_EMAIL_FORMAT")}},render:e=>l.createElement(t.TextInput,{value:e.value||(null==C?void 0:C.emailId),onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)},t:d,disabled:D})}))),l.createElement(t.CardLabelError,{style:E},(null==f||null===(o=f.applicantEmailId)||void 0===o?void 0:o.message)||""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+d("NOC_APPLICANT_FATHER_HUSBAND_NAME_LABEL")),l.createElement("div",{className:"field"},l.createElement(v,{control:m,name:"applicantFatherHusbandName",render:e=>l.createElement(t.TextInput,{value:e.value||(null==C?void 0:C.fatherOrHusbandName),onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)},t:d})}))),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+d("NOC_APPLICANT_PROPERTY_ID_LABEL"),"*"),l.createElement("div",{className:"field"},l.createElement(v,{control:m,name:"applicantPropertyId",rules:{required:d("REQUIRED_FIELD")},render:e=>l.createElement(t.TextInput,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)},t:d})}))),l.createElement(t.CardLabelError,{style:E},(null==f||null===(a=f.applicantPropertyId)||void 0===a?void 0:a.message)||""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+d("NOC_APPLICANT_ADDRESS_LABEL"),"*"),l.createElement("div",{className:"field"},l.createElement(v,{control:m,name:"applicantAddress",rules:{required:d("REQUIRED_FIELD"),maxLength:{value:100,message:d("MAX_100_CHARACTERS_ALLOWED")}},render:e=>l.createElement(t.TextArea,{value:e.value||(null==C?void 0:C.permanentAddress),onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)},t:d})}))),l.createElement(t.CardLabelError,{style:E},(null==f||null===(r=f.applicantAddress)||void 0===r?void 0:r.message)||""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+d("NOC_APPLICANT_DOB_LABEL"),"*"),l.createElement("div",{className:"field"},l.createElement(v,{control:m,name:"applicantDateOfBirth",rules:{required:d("REQUIRED_FIELD"),validate:e=>{const t=new Date,n=new Date(e),l=t.getFullYear()-n.getFullYear(),i=t.getMonth()-n.getMonth(),o=t.getDate()-n.getDate();return l>=18||18===l&&(i>0||0===i&&o>=0)||d("DOB_MUST_BE_18_YEARS_OLD")}},render:e=>l.createElement(t.TextInput,{type:"date",value:e.value||(null==C?void 0:C.dob),onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)},min:"1900-01-01",max:(new Date).toISOString().split("T")[0],disabled:D})}))),l.createElement(t.CardLabelError,{style:E},(null==f||null===(u=f.applicantDateOfBirth)||void 0===u?void 0:u.message)||""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+d("NOC_APPLICANT_GENDER_LABEL"),"*"),l.createElement("div",{className:"field"},l.createElement(v,{control:m,name:"applicantGender",rules:{required:d("REQUIRED_FIELD")},render:e=>l.createElement(t.RadioButtons,{t:d,options:h,optionsKey:"code",value:e.value,selectedOption:e.value,onSelect:t=>{e.onChange(t)},isDependent:!0,disabled:D})}))),l.createElement(t.CardLabelError,{style:E},(null==f||null===(s=f.applicantGender)||void 0===s?void 0:s.message)||"")),N&&l.createElement(t.Toast,{error:null==N?void 0:N.error,warning:null==N?void 0:N.warning,label:d(null==N?void 0:N.message),isDleteBtn:!0,onClose:()=>{b(null)}}))},Oi=e=>{var i,o,a,r,u,s,d;const{t:c,currentStepData:v,Controller:m,control:p,setValue:f,errors:E,errorStyle:g}=e,_=(Digit.ULBService.getCurrentTenantId(),Digit.ULBService.getStateId(),Digit.UserService.getUser());n.useEffect(()=>{console.log("currentStepData2",v);const e=null==v?void 0:v.applicationDetails;e&&Object.entries(e).forEach(e=>{let[t,n]=e;f(t,n)})},[v,f]);const{data:h}=Digit.Hooks.noc.useTenants(),[A,S]=n.useState(h);return l.createElement(l.Fragment,null,l.createElement(t.CardSectionHeader,{className:"card-section-header"},c("NOC_PROFESSIONAL_DETAILS")),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,""+c("NOC_PROFESSIONAL_NAME_LABEL"),"*"),l.createElement("div",{className:"field"},l.createElement(m,{control:p,name:"professionalName",defaultValue:null==_||null===(i=_.info)||void 0===i?void 0:i.name,rules:{required:c("REQUIRED_FIELD"),maxLength:{value:100,message:c("MAX_100_CHARACTERS_ALLOWED")}},render:e=>l.createElement(t.TextInput,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)},t:c,disabled:"true"})}))),l.createElement(t.CardLabelError,{style:g},null!=E&&E.professionalName?E.professionalName.message:""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+c("NOC_PROFESSIONAL_EMAIL_LABEL"),"*"),l.createElement("div",{className:"field"},l.createElement(m,{control:p,name:"professionalEmailId",defaultValue:null==_||null===(o=_.info)||void 0===o?void 0:o.emailId,rules:{required:c("REQUIRED_FIELD"),pattern:{value:/^[^\s@]+@[^\s@]+\.[^\s@]+$/,message:c("INVALID_EMAIL_FORMAT")}},render:e=>l.createElement(t.TextInput,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)},t:c,disabled:"true"})}))),l.createElement(t.CardLabelError,{style:g},(null==E||null===(a=E.professionalEmailId)||void 0===a?void 0:a.message)||""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+c("NOC_PROFESSIONAL_REGISTRATION_ID_LABEL"),"*"),l.createElement("div",{className:"field"},l.createElement(m,{control:p,name:"professionalRegId",rules:{required:c("REQUIRED_FIELD")},render:e=>l.createElement(t.TextInput,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)},t:c})}))),l.createElement(t.CardLabelError,{style:g},(null==E||null===(r=E.professionalRegId)||void 0===r?void 0:r.message)||""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+c("NOC_PROFESSIONAL_MOBILE_NO_LABEL"),"*"),l.createElement("div",{className:"field"},l.createElement(m,{control:p,name:"professionalMobileNumber",defaultValue:null==_||null===(u=_.info)||void 0===u?void 0:u.mobileNumber,rules:{required:c("REQUIRED_FIELD"),pattern:{value:/^[6-9]\d{9}$/,message:c("INVALID_MOBILE_NUMBER")}},render:e=>l.createElement(t.MobileNumber,{value:e.value,onChange:e.onChange,onBlur:e.onBlur,t:c,disable:"true"})}))),l.createElement(t.CardLabelError,{style:g},(null==E||null===(s=E.professionalMobileNumber)||void 0===s?void 0:s.message)||""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+c("NOC_PROFESSIONAL_ADDRESS_LABEL"),"*"),l.createElement("div",{className:"field"},l.createElement(m,{control:p,name:"professionalAddress",rules:{required:c("REQUIRED_FIELD"),maxLength:{value:100,message:c("MAX_100_CHARACTERS_ALLOWED")}},render:e=>l.createElement(t.TextArea,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)},t:c})}))),l.createElement(t.CardLabelError,{style:g},(null==E||null===(d=E.professionalAddress)||void 0===d?void 0:d.message)||""))},Ti=e=>{var i,o,a,r,u,s,d,v,m,p,f,E,g,_,h,A,S,N,b,C;let y;y=window.location.pathname.includes("employee")?window.localStorage.getItem("Employee.tenant-id"):window.localStorage.getItem("CITIZEN.CITY");const D=Digit.ULBService.getStateId(),{t:L,currentStepData:O,Controller:T,control:I,setValue:w,errors:P,errorStyle:R,useFieldArray:x,watch:B}=e,[F,M]=n.useState("0.00"),U=B("netPlotAreaAfterWidening"),k=B("areaLeftForRoadWidening");n.useEffect(()=>{const e=parseFloat(U),t=parseFloat(k),n=((isNaN(e)?0:e)+(isNaN(t)?0:t)).toFixed(2);M(n),w("netTotalArea",n)},[U,k]);const[W,H]=n.useState("0.00"),{fields:j,append:z,remove:V}=x({control:I,name:"floorArea"}),G=B("floorArea"),Y=B("basementArea");n.useEffect(()=>{const e=null==G?void 0:G.reduce((e,t)=>{const n=parseFloat(null==t?void 0:t.value);return e+(isNaN(n)?0:n)},0),t=isNaN(Y)?0:Y,n=(e+parseFloat(t)).toFixed(2);H(n),w("totalFloorArea",n)},[G,Y]);const[K,q]=n.useState((null==O||null===(i=O.siteDetails)||void 0===i?void 0:i.ulbName)||null),[X,J]=n.useState((null==O||null===(o=O.siteDetails)||void 0===o?void 0:o.ulbType)||""),[Q,Z]=n.useState((null==O||null===(a=O.siteDetails)||void 0===a?void 0:a.buildingStatus)||null),{data:$,isLoading:ee}=Digit.Hooks.noc.useBuildingType(D),{data:te,isLoading:ne}=Digit.Hooks.noc.useRoadType(D),{data:le,isLoading:ie}=Digit.Hooks.useTenants(),oe=null==le?void 0:le.map(e=>c({},e,{displayName:L(e.i18nKey)}));n.useEffect(()=>{if(K){var e;const t=null==K||null===(e=K.city)||void 0===e?void 0:e.ulbType;J(t),w("ulbType",t)}},[K,w]);const[ae,re]=n.useState((null==O||null===(r=O.siteDetails)||void 0===r?void 0:r.isBasementAreaAvailable)||null),ue=[{code:"YES",i18nKey:"YES"},{code:"NO",i18nKey:"NO"}],se=Digit.Hooks.noc.useTenants(),[de,ce]=n.useState(se),[ve,me]=n.useState((null==O||null===(u=O.siteDetails)||void 0===u?void 0:u.district)||null),[pe,fe]=n.useState([]),{data:Ee}=Digit.Hooks.useBoundaryLocalities(null==ve?void 0:ve.code,"revenue",{enabled:!!ve},L);return n.useEffect(()=>{(null==Ee?void 0:Ee.length)>0&&fe(Ee)},[Ee]),n.useEffect(()=>{if(y&&(null==se?void 0:se.length)>0){const e=se.find(e=>e.code===y);e&&(me(e),w("district",e))}},[y,se]),n.useEffect(()=>{const e=null==O?void 0:O.siteDetails;if(e&&(Object.entries(e).forEach(e=>{let[t,n]=e;"floorArea"!==t&&w(t,n)}),Array.isArray(e.floorArea))){for(let e=j.length-1;e>=0;e--)V(e);e.floorArea.forEach(e=>{z({value:e.value||""})})}},[O,w,z,V]),l.createElement(l.Fragment,null,l.createElement("div",{style:{marginBottom:"16px"}},l.createElement(t.CardSectionHeader,{className:"card-section-header"},L("NOC_SITE_DETAILS")),l.createElement("div",null,l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+L("NOC_PLOT_NO_LABEL"),"*"),l.createElement("div",{className:"field"},l.createElement(T,{control:I,name:"plotNo",rules:{required:L("REQUIRED_FIELD"),maxLength:{value:100,message:L("MAX_100_CHARACTERS_ALLOWED")}},render:e=>l.createElement(t.TextInput,{className:"form-field",value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)}})}))),l.createElement(t.CardLabelError,{style:R},null!=P&&P.plotNo?P.plotNo.message:""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},L("NOC_PROPOSED_SITE_ADDRESS"),"*"),l.createElement("div",{className:"field"},l.createElement(T,{control:I,name:"proposedSiteAddress",rules:{required:L("REQUIRED_FIELD"),maxLength:{value:200,message:L("MAX_200_CHARACTERS_ALLOWED")}},render:e=>l.createElement(t.TextArea,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)}})}))),l.createElement(t.CardLabelError,{style:R},null!=P&&P.proposedSiteAddress?P.proposedSiteAddress.message:""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+L("NOC_ULB_NAME_LABEL"),"*"),!ie&&l.createElement(T,{control:I,name:"ulbName",rules:{required:L("REQUIRED_FIELD")},render:e=>l.createElement(t.Dropdown,{className:"form-field",select:t=>{q(t),e.onChange(t)},selected:e.value,option:oe,optionKey:"displayName",t:L})})),l.createElement(t.CardLabelError,{style:R},null!=P&&P.ulbName?P.ulbName.message:""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+L("NOC_ULB_TYPE_LABEL"),"*"),l.createElement("div",{className:"field"},l.createElement(T,{control:I,name:"ulbType",render:e=>l.createElement(t.TextInput,{value:X||e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)},disable:"true"})}))),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+L("NOC_KHASRA_NO_LABEL"),"*"),l.createElement("div",{className:"field"},l.createElement(T,{control:I,name:"khasraNo",rules:{required:L("REQUIRED_FIELD"),maxLength:{value:100,message:L("MAX_100_CHARACTERS_ALLOWED")}},render:e=>l.createElement(t.TextArea,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)}})}))),l.createElement(t.CardLabelError,{style:R},(null==P||null===(s=P.khasraNo)||void 0===s?void 0:s.message)||""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+L("NOC_HADBAST_NO_LABEL"),"*"),l.createElement("div",{className:"field"},l.createElement(T,{control:I,name:"hadbastNo",rules:{required:L("REQUIRED_FIELD"),maxLength:{value:100,message:L("MAX_100_CHARACTERS_ALLOWED")}},render:e=>l.createElement(t.TextInput,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)}})}))),l.createElement(t.CardLabelError,{style:R},(null==P||null===(d=P.hadbastNo)||void 0===d?void 0:d.message)||""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+L("NOC_ROAD_TYPE_LABEL"),"*"),!ne&&l.createElement(T,{control:I,name:"roadType",rules:{required:L("REQUIRED_FIELD")},render:e=>l.createElement(t.Dropdown,{className:"form-field",select:e.onChange,selected:e.value,option:te,optionKey:"name",t:L})})),l.createElement(t.CardLabelError,{style:R},(null==P||null===(v=P.roadType)||void 0===v?void 0:v.message)||""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+L("NOC_AREA_LEFT_FOR_ROAD_WIDENING_LABEL"),"*"),l.createElement("div",{className:"field"},l.createElement(T,{control:I,name:"areaLeftForRoadWidening",rules:{required:L("REQUIRED_FIELD"),pattern:{value:/^[0-9]*\.?[0-9]+$/,message:L("ONLY_NUMERIC_VALUES_ALLOWED_MSG")},maxLength:{value:100,message:L("MAX_100_CHARACTERS_ALLOWED")}},render:e=>l.createElement(t.TextInput,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)}})}))),l.createElement(t.CardLabelError,{style:R},(null==P||null===(m=P.areaLeftForRoadWidening)||void 0===m?void 0:m.message)||""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+L("NOC_NET_PLOT_AREA_AFTER_WIDENING_LABEL"),"*"),l.createElement("div",{className:"field"},l.createElement(T,{control:I,name:"netPlotAreaAfterWidening",rules:{required:L("REQUIRED_FIELD"),pattern:{value:/^[0-9]*\.?[0-9]+$/,message:L("ONLY_NUMERIC_VALUES_ALLOWED_MSG")},maxLength:{value:100,message:L("MAX_100_CHARACTERS_ALLOWED")}},render:e=>l.createElement(t.TextInput,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)}})}))),l.createElement(t.CardLabelError,{style:R},(null==P||null===(p=P.netPlotAreaAfterWidening)||void 0===p?void 0:p.message)||""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+L("NOC_NET_TOTAL_AREA_LABEL"),"*"),l.createElement("div",{className:"field"},l.createElement(T,{control:I,name:"netTotalArea",rules:{required:L("REQUIRED_FIELD"),pattern:{value:/^[0-9]*\.?[0-9]+$/,message:L("ONLY_NUMERIC_VALUES_ALLOWED_MSG")},maxLength:{value:100,message:L("MAX_100_CHARACTERS_ALLOWED")}},defaultValue:F,render:e=>l.createElement(t.TextInput,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)},disabled:"true"})}))),l.createElement(t.CardLabelError,{style:R},(null==P||null===(f=P.netTotalArea)||void 0===f?void 0:f.message)||""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+L("NOC_ROAD_WIDTH_AT_SITE_LABEL"),"*"),l.createElement("div",{className:"field"},l.createElement(T,{control:I,name:"roadWidthAtSite",rules:{required:L("REQUIRED_FIELD"),pattern:{value:/^[0-9]*\.?[0-9]+$/,message:L("ONLY_NUMERIC_VALUES_ALLOWED_MSG")},maxLength:{value:100,message:L("MAX_100_CHARACTERS_ALLOWED")}},render:e=>l.createElement(t.TextInput,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)}})}))),l.createElement(t.CardLabelError,{style:R},null!=P&&P.roadWidthAtSite?P.roadWidthAtSite.message:""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+L("NOC_BUILDING_STATUS_LABEL"),"*"),!ee&&l.createElement(T,{control:I,name:"buildingStatus",rules:{required:L("REQUIRED_FIELD")},render:e=>l.createElement(t.Dropdown,{className:"form-field",select:t=>{Z(t),e.onChange(t)},selected:e.value,option:$,optionKey:"name",t:L})})),l.createElement(t.CardLabelError,{style:R},(null==P||null===(E=P.buildingStatus)||void 0===E?void 0:E.message)||""),"BUILTUP"===(null==Q?void 0:Q.code)&&l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+L("NOC_IS_BASEMENT_AREA_PRESENT_LABEL")," *"),l.createElement(T,{control:I,name:"isBasementAreaAvailable",rules:{required:L("REQUIRED_FIELD")},render:e=>l.createElement(t.Dropdown,{className:"form-field",select:t=>{re(t),e.onChange(t)},selected:e.value,option:ue,optionKey:"i18nKey",t:L})})),l.createElement(t.CardLabelError,{style:R},(null==P||null===(g=P.isBasementAreaAvailable)||void 0===g?void 0:g.message)||""),"BUILTUP"===(null==Q?void 0:Q.code)&&"YES"===(null==ae?void 0:ae.code)&&l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+L("NOC_BASEMENT_AREA_LABEL"),"*"),l.createElement("div",{className:"field"},l.createElement(T,{control:I,name:"basementArea",rules:{required:L("REQUIRED_FIELD"),pattern:{value:/^[0-9]*\.?[0-9]+$/,message:L("ONLY_NUMERIC_VALUES_ALLOWED_MSG")},maxLength:{value:100,message:L("MAX_100_CHARACTERS_ALLOWED")}},render:e=>l.createElement(t.TextInput,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)}})}))),l.createElement(t.CardLabelError,{style:R},null!=P&&P.basementArea?P.basementArea.message:""),"BUILTUP"===(null==Q?void 0:Q.code)&&j.map((e,n)=>l.createElement("div",{style:{display:"flex",gap:"10px",flexDirection:"column"}},l.createElement(t.CardLabel,{className:"card-label-smaller"},0===n?"Ground":""+n," Floor Area(sq mt)*"),l.createElement("div",{key:e.id,className:"field",style:{display:"flex",gap:"10px"}},l.createElement(T,{control:I,name:"floorArea."+n+".value",defaultValue:e.value,rules:{required:L("REQUIRED_FIELD"),pattern:{value:/^[0-9]*\.?[0-9]+$/,message:L("ONLY_NUMERIC_VALUES_ALLOWED_MSG")},maxLength:{value:100,message:L("MAX_100_CHARACTERS_ALLOWED")}},render:e=>{var i,o;return l.createElement(l.Fragment,null,l.createElement(t.TextInput,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)}}),(null==P||null===(i=P.floorArea)||void 0===i||null===(o=i[n])||void 0===o?void 0:o.value)&&l.createElement(t.CardLabelError,{className:R},P.floorArea[n].value.message))}}),l.createElement("button",{type:"button",onClick:()=>V(n)},"❌")))),"BUILTUP"===(null==Q?void 0:Q.code)&&l.createElement("button",{type:"button",onClick:()=>z({value:""})},"➕ Add Floor"),"BUILTUP"===(null==Q?void 0:Q.code)&&l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+L("NOC_TOTAL_FLOOR_BUILT_UP_AREA_LABEL")),l.createElement("div",{className:"field"},l.createElement(T,{control:I,name:"totalFloorArea",defaultValue:W,render:e=>l.createElement(t.TextInput,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)},disable:"true"})}))),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+L("NOC_SITE_WARD_NO_LABEL"),"*"),l.createElement("div",{className:"field"},l.createElement(T,{control:I,name:"wardNo",rules:{required:L("REQUIRED_FIELD"),maxLength:{value:100,message:L("MAX_100_CHARACTERS_ALLOWED")}},render:e=>l.createElement(t.TextInput,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)}})}))),l.createElement(t.CardLabelError,{style:R},(null==P||null===(_=P.wardNo)||void 0===_?void 0:_.message)||""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+L("NOC_DISTRICT_LABEL"),"*"),l.createElement(T,{control:I,name:"district",rules:{required:L("REQUIRED_FIELD")},render:e=>l.createElement(t.Dropdown,{className:"form-field",select:t=>{me(t),e.onChange(t)},selected:e.value,option:de.sort((e,t)=>e.name.localeCompare(t.name)),optionKey:"name",disable:"true",t:L})})),l.createElement(t.CardLabelError,{style:R},(null==P||null===(h=P.district)||void 0===h?void 0:h.message)||""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+L("NOC_ZONE_LABEL"),"*"),l.createElement(T,{control:I,name:"zone",rules:{required:L("REQUIRED_FIELD")},render:e=>l.createElement(t.Dropdown,{className:"form-field",select:e.onChange,selected:e.value,option:pe,optionKey:"i18nkey",t:L})})),l.createElement(t.CardLabelError,{style:R},(null==P||null===(A=P.zone)||void 0===A?void 0:A.message)||""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+L("NOC_SITE_VILLAGE_NAME_LABEL"),"*"),l.createElement("div",{className:"field"},l.createElement(T,{control:I,name:"villageName",rules:{required:L("REQUIRED_FIELD"),maxLength:{value:100,message:L("MAX_100_CHARACTERS_ALLOWED")}},render:e=>l.createElement(t.TextInput,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)}})}))),l.createElement(t.CardLabelError,{style:R},(null==P||null===(S=P.villageName)||void 0===S?void 0:S.message)||""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+L("NOC_SITE_COLONY_NAME_LABEL"),"*"),l.createElement("div",{className:"field"},l.createElement(T,{control:I,name:"colonyName",rules:{required:L("REQUIRED_FIELD"),maxLength:{value:100,message:L("MAX_100_CHARACTERS_ALLOWED")}},render:e=>l.createElement(t.TextInput,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)}})}))),l.createElement(t.CardLabelError,{style:R},(null==P||null===(N=P.colonyName)||void 0===N?void 0:N.message)||""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+L("NOC_SITE_VASIKA_NO_LABEL"),"*"),l.createElement("div",{className:"field"},l.createElement(T,{control:I,name:"vasikaNumber",rules:{required:L("REQUIRED_FIELD"),maxLength:{value:100,message:L("MAX_100_CHARACTERS_ALLOWED")}},render:e=>l.createElement(t.TextInput,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)}})}))),l.createElement(t.CardLabelError,{style:R},(null==P||null===(b=P.vasikaNumber)||void 0===b?void 0:b.message)||""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+L("NOC_SITE_KHEWAT_AND_KHATUNI_NO_LABEL"),"*"),l.createElement("div",{className:"field"},l.createElement(T,{control:I,name:"khewatAndKhatuniNo",rules:{required:L("REQUIRED_FIELD"),maxLength:{value:100,message:L("MAX_100_CHARACTERS_ALLOWED")}},render:e=>l.createElement(t.TextInput,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)}})}))),l.createElement(t.CardLabelError,{style:R},(null==P||null===(C=P.khewatAndKhatuniNo)||void 0===C?void 0:C.message)||"")),l.createElement(t.BreakLine,null)))},Ii=e=>{var i,o,a,r;const{t:u,currentStepData:s,Controller:d,control:c,setValue:v,errors:m,errorStyle:p}=e,f=(Digit.ULBService.getCurrentTenantId(),Digit.ULBService.getStateId()),[E,g]=n.useState((null==s||null===(i=s.siteDetails)||void 0===i?void 0:i.specificationBuildingCategory)||null),{data:_,isLoading:h}=Digit.Hooks.noc.useBuildingCategory(f),{data:A,isLoading:S}=Digit.Hooks.noc.useNocType(f),N=[{code:"YES",i18nKey:"YES"},{code:"NO",i18nKey:"NO"}];return n.useEffect(()=>{console.log("currentStepData4",s);const e=null==s?void 0:s.siteDetails;e&&Object.entries(e).forEach(e=>{let[t,n]=e;v(t,n)})},[s,v]),l.createElement(l.Fragment,null,l.createElement(t.CardSectionHeader,null,u("NOC_SPECIFICATION_DETAILS")),l.createElement("div",null,l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+u("NOC_PLOT_AREA_JAMA_BANDI_LABEL"),"*"),l.createElement("div",{className:"field"},l.createElement(d,{control:c,name:"specificationPlotArea",rules:{required:u("REQUIRED_FIELD"),pattern:{value:/^[0-9]*\.?[0-9]+$/,message:u("ONLY_NUMERIC_VALUES_ALLOWED_MSG")},maxLength:{value:100,message:u("MAX_100_CHARACTERS_ALLOWED")}},render:e=>l.createElement(t.TextInput,{className:"form-field",value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)},t:u})}))),l.createElement(t.CardLabelError,{style:p},null!=m&&m.specificationPlotArea?m.specificationPlotArea.message:""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+u("NOC_BUILDING_CATEGORY_LABEL"),"*"),!h&&_.length>0&&l.createElement(d,{control:c,name:"specificationBuildingCategory",rules:{required:u("REQUIRED_FIELD")},render:e=>l.createElement(t.Dropdown,{className:"form-field",select:t=>{g(t),e.onChange(t)},selected:e.value,option:_,optionKey:"name",t:u})})),l.createElement(t.CardLabelError,{style:p},null!=m&&m.specificationBuildingCategory?m.specificationBuildingCategory.message:""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+u("NOC_NOC_TYPE_LABEL"),"*"),!S&&l.createElement(d,{control:c,name:"specificationNocType",rules:{required:u("REQUIRED_FIELD")},render:e=>l.createElement(t.Dropdown,{className:"form-field",select:e.onChange,selected:e.value,option:A,optionKey:"name",t:u})})),l.createElement(t.CardLabelError,{style:p},(null==m||null===(o=m.specificationNocType)||void 0===o?void 0:o.message)||""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+u("NOC_RESTRICTED_AREA_LABEL")," *"),l.createElement(d,{control:c,name:"specificationRestrictedArea",rules:{required:u("REQUIRED_FIELD")},render:e=>l.createElement(t.Dropdown,{className:"form-field",select:e.onChange,selected:e.value,option:N,optionKey:"i18nKey",t:u})})),l.createElement(t.CardLabelError,{style:p},(null==m||null===(a=m.specificationRestrictedArea)||void 0===a?void 0:a.message)||""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+u("NOC_IS_SITE_UNDER_MASTER_PLAN_LABEL")," *"),l.createElement(d,{control:c,name:"specificationIsSiteUnderMasterPlan",rules:{required:u("REQUIRED_FIELD")},render:e=>l.createElement(t.Dropdown,{className:"form-field",select:e.onChange,selected:e.value,option:N,optionKey:"i18nKey",t:u})})),l.createElement(t.CardLabelError,{style:p},(null==m||null===(r=m.specificationIsSiteUnderMasterPlan)||void 0===r?void 0:r.message)||"")))},wi=e=>{let{documents:i}=e;const a=Digit.ULBService.getStateId(),{t:r}=o.useTranslation(),[u,s]=n.useState(null),[d,c]=n.useState(null);return n.useEffect(function(){try{const e=function(){if(i){var e;const t=(null==i||null===(e=i.find(e=>"OWNER.OWNERPHOTO"===e.documentType))||void 0===e?void 0:e.documentUid)||"",n=function(){if(t)return Promise.resolve(Digit.UploadServices.Filefetch([t],a)).then(function(e){var t,n,l;null!=e&&null!==(t=e.data)&&void 0!==t&&t.fileStoreIds&&s(null==e||null===(n=e.data)||void 0===n||null===(l=n.fileStoreIds[0])||void 0===l?void 0:l.url)})}();if(n&&n.then)return n.then(function(){})}}();return Promise.resolve(e&&e.then?e.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},[i]),l.createElement(t.Card,null,l.createElement("div",{style:{display:"flex",justifyContent:"flex-end",marginTop:"10px",padding:"0px 20px"}},l.createElement("div",{style:{textAlign:"center"}},l.createElement("img",{src:u,alt:"Owner Photo",style:{width:"100px",height:"100px",objectFit:"cover",borderRadius:"10%",cursor:u?"pointer":"default"},onClick:()=>u&&c(u)}),l.createElement("div",null,r("OWNER_OWNERPHOTO")))),d&&l.createElement(t.ImageViewer,{imageSrc:d,onClose:()=>{c(null)}}))};function Pi(e){var n,o,a,r,u,d,c,v,m,p,f,E,g,_,h,A,S,N,b,C,y,D,L,O,T,I,w,P,R,x,B,F,M,U,k,W,H,j,z,V,G,Y,K,q,X,J,Q,Z,$,ee,te,ne,le,ie,oe,ae,re,ue,se,de,ce,ve,me,pe,fe,Ee,ge,_e,he;let{currentStepData:Ae,t:Se}=e;i.useLocation(),i.useHistory(),s.useDispatch(),console.log("formData in Summary Page",Ae);const Ne=s.useSelector(function(e){var t,n;return(null==e||null===(t=e.noc)||void 0===t||null===(n=t.NOCNewApplicationFormReducer)||void 0===n?void 0:n.coordinates)||{}});console.log("coordinates in summary page",Ne);const be={backgroundColor:"#ffffff",padding:"1rem 1.5rem",borderRadius:"8px",marginBottom:"2rem",boxShadow:"0 2px 4px rgba(0, 0, 0, 0.05)"},Ce={display:"flex",justifyContent:"space-between",borderBottom:"1px dashed #e0e0e0",padding:"0.5rem 0",color:"#333"},ye={fontSize:"1.5rem",borderBottom:"2px solid #ccc",paddingBottom:"0.3rem",color:"#2e4a66",marginTop:"2rem",marginBottom:"1rem"},De={fontWeight:"bold",color:"#555"},Le=(e,n)=>l.createElement("div",{style:Ce},l.createElement(t.CardLabel,{style:De},e),l.createElement("div",null,n||"NA"));Digit.UserService.getUser();let Oe=null==Ae||null===(n=Ae.documents)||void 0===n||null===(o=n.documents)||void 0===o?void 0:o.documents;return console.log("documents here in summary",Oe),l.createElement("div",{style:{padding:"2rem",backgroundColor:"#f9f9f9",fontFamily:"'Segoe UI', Tahoma, Geneva, Verdana, sans-serif",color:"#333"}},l.createElement("h2",{style:ye},Se("OWNER_OWNERPHOTO")),l.createElement("div",{style:be},l.createElement(wi,{documents:null==Ae||null===(a=Ae.documents)||void 0===a||null===(r=a.documents)||void 0===r?void 0:r.documents})),l.createElement("h2",{style:ye},Se("NOC_APPLICANT_DETAILS")),l.createElement("div",{style:be},Le(Se("NOC_FIRM_OWNER_NAME_LABEL"),null==Ae||null===(u=Ae.applicationDetails)||void 0===u?void 0:u.applicantOwnerOrFirmName),Le(Se("NOC_APPLICANT_EMAIL_LABEL"),null==Ae||null===(d=Ae.applicationDetails)||void 0===d?void 0:d.applicantEmailId),Le(Se("NOC_APPLICANT_FATHER_HUSBAND_NAME_LABEL"),null==Ae||null===(c=Ae.applicationDetails)||void 0===c?void 0:c.applicantFatherHusbandName),Le(Se("NOC_APPLICANT_PROPERTY_ID_LABEL"),null==Ae||null===(v=Ae.applicationDetails)||void 0===v?void 0:v.applicantPropertyId),Le(Se("NOC_APPLICANT_MOBILE_NO_LABEL"),null==Ae||null===(m=Ae.applicationDetails)||void 0===m?void 0:m.applicantMobileNumber),Le(Se("NOC_APPLICANT_DOB_LABEL"),null==Ae||null===(p=Ae.applicationDetails)||void 0===p?void 0:p.applicantDateOfBirth),Le(Se("NOC_APPLICANT_GENDER_LABEL"),null==Ae||null===(f=Ae.applicationDetails)||void 0===f||null===(E=f.applicantGender)||void 0===E?void 0:E.code),Le(Se("NOC_APPLICANT_ADDRESS_LABEL"),null==Ae||null===(g=Ae.applicationDetails)||void 0===g?void 0:g.applicantAddress)),(null==Ae||null===(_=Ae.applicationDetails)||void 0===_?void 0:_.professionalName)&&l.createElement(l.Fragment,null,l.createElement("h2",{style:ye},Se("NOC_PROFESSIONAL_DETAILS")),l.createElement("div",{style:be},Le(Se("NOC_PROFESSIONAL_NAME_LABEL"),null==Ae||null===(h=Ae.applicationDetails)||void 0===h?void 0:h.professionalName),Le(Se("NOC_PROFESSIONAL_EMAIL_LABEL"),null==Ae||null===(A=Ae.applicationDetails)||void 0===A?void 0:A.professionalEmailId),Le(Se("NOC_PROFESSIONAL_REGISTRATION_ID_LABEL"),null==Ae||null===(S=Ae.applicationDetails)||void 0===S?void 0:S.professionalRegId),Le(Se("NOC_PROFESSIONAL_MOBILE_NO_LABEL"),null==Ae||null===(N=Ae.applicationDetails)||void 0===N?void 0:N.professionalMobileNumber),Le(Se("NOC_PROFESSIONAL_ADDRESS_LABEL"),null==Ae||null===(b=Ae.applicationDetails)||void 0===b?void 0:b.professionalAddress))),l.createElement("h2",{style:ye},Se("NOC_SITE_DETAILS")),l.createElement("div",{style:be},Le(Se("NOC_PLOT_NO_LABEL"),null==Ae||null===(C=Ae.siteDetails)||void 0===C?void 0:C.plotNo),Le(Se("NOC_PROPOSED_SITE_ADDRESS"),null==Ae||null===(y=Ae.siteDetails)||void 0===y?void 0:y.proposedSiteAddress),Le(Se("NOC_ULB_NAME_LABEL"),null==Ae||null===(D=Ae.siteDetails)||void 0===D||null===(L=D.ulbName)||void 0===L?void 0:L.name),Le(Se("NOC_ULB_TYPE_LABEL"),null==Ae||null===(O=Ae.siteDetails)||void 0===O?void 0:O.ulbType),Le(Se("NOC_KHASRA_NO_LABEL"),null==Ae||null===(T=Ae.siteDetails)||void 0===T?void 0:T.khasraNo),Le(Se("NOC_HADBAST_NO_LABEL"),null==Ae||null===(I=Ae.siteDetails)||void 0===I?void 0:I.hadbastNo),Le(Se("NOC_ROAD_TYPE_LABEL"),null==Ae||null===(w=Ae.siteDetails)||void 0===w||null===(P=w.roadType)||void 0===P?void 0:P.name),Le(Se("NOC_AREA_LEFT_FOR_ROAD_WIDENING_LABEL"),null==Ae||null===(R=Ae.siteDetails)||void 0===R?void 0:R.areaLeftForRoadWidening),Le(Se("NOC_NET_PLOT_AREA_AFTER_WIDENING_LABEL"),null==Ae||null===(x=Ae.siteDetails)||void 0===x?void 0:x.netPlotAreaAfterWidening),Le(Se("NOC_NET_TOTAL_AREA_LABEL"),null==Ae||null===(B=Ae.siteDetails)||void 0===B?void 0:B.netTotalArea),Le(Se("NOC_ROAD_WIDTH_AT_SITE_LABEL"),null==Ae||null===(F=Ae.siteDetails)||void 0===F?void 0:F.roadWidthAtSite),Le(Se("NOC_BUILDING_STATUS_LABEL"),null==Ae||null===(M=Ae.siteDetails)||void 0===M||null===(U=M.buildingStatus)||void 0===U?void 0:U.name),Le(Se("NOC_IS_BASEMENT_AREA_PRESENT_LABEL"),null==Ae||null===(k=Ae.siteDetails)||void 0===k||null===(W=k.isBasementAreaAvailable)||void 0===W?void 0:W.code),"BUILTUP"===(null==Ae||null===(H=Ae.siteDetails)||void 0===H||null===(j=H.buildingStatus)||void 0===j?void 0:j.code)&&Le(Se("NOC_BASEMENT_AREA_LABEL"),null==Ae||null===(z=Ae.siteDetails)||void 0===z?void 0:z.basementArea),"BUILTUP"===(null==Ae||null===(V=Ae.siteDetails)||void 0===V||null===(G=V.buildingStatus)||void 0===G?void 0:G.code)&&(null==Ae||null===(Y=Ae.siteDetails)||void 0===Y||null===(K=Y.floorArea)||void 0===K?void 0:K.map((e,t)=>Le((e=>{if(0===e)return Se("NOC_GROUND_FLOOR_AREA_LABEL");const t=e%10,n=e%100;let l="th";return(n<11||n>13)&&(1===t?l="st":2===t?l="nd":3===t&&(l="rd")),""+e+l+" "+Se("NOC_FLOOR_AREA_LABEL")})(t),null==e?void 0:e.value))),"BUILTUP"===(null==Ae||null===(q=Ae.siteDetails)||void 0===q||null===(X=q.buildingStatus)||void 0===X?void 0:X.code)&&Le(Se("NOC_TOTAL_FLOOR_BUILT_UP_AREA_LABEL"),null==Ae||null===(J=Ae.siteDetails)||void 0===J?void 0:J.totalFloorArea),Le(Se("NOC_DISTRICT_LABEL"),null==Ae||null===(Q=Ae.siteDetails)||void 0===Q||null===(Z=Q.district)||void 0===Z?void 0:Z.name),Le(Se("NOC_ZONE_LABEL"),null==Ae||null===($=Ae.siteDetails)||void 0===$||null===(ee=$.zone)||void 0===ee?void 0:ee.name),Le(Se("NOC_SITE_WARD_NO_LABEL"),null==Ae||null===(te=Ae.siteDetails)||void 0===te?void 0:te.wardNo),Le(Se("NOC_SITE_VILLAGE_NAME_LABEL"),null==Ae||null===(ne=Ae.siteDetails)||void 0===ne?void 0:ne.villageName),Le(Se("NOC_SITE_COLONY_NAME_LABEL"),null==Ae||null===(le=Ae.siteDetails)||void 0===le?void 0:le.colonyName),Le(Se("NOC_SITE_VASIKA_NO_LABEL"),null==Ae||null===(ie=Ae.siteDetails)||void 0===ie?void 0:ie.vasikaNumber),Le(Se("NOC_SITE_KHEWAT_AND_KHATUNI_NO_LABEL"),null==Ae||null===(oe=Ae.siteDetails)||void 0===oe?void 0:oe.khewatAndKhatuniNo)),l.createElement("h2",{style:ye},Se("NOC_SPECIFICATION_DETAILS")),l.createElement("div",{style:be},Le(Se("NOC_PLOT_AREA_JAMA_BANDI_LABEL"),null==Ae||null===(ae=Ae.siteDetails)||void 0===ae?void 0:ae.specificationPlotArea),Le(Se("NOC_BUILDING_CATEGORY_LABEL"),null==Ae||null===(re=Ae.siteDetails)||void 0===re||null===(ue=re.specificationBuildingCategory)||void 0===ue?void 0:ue.name),Le(Se("NOC_NOC_TYPE_LABEL"),null==Ae||null===(se=Ae.siteDetails)||void 0===se||null===(de=se.specificationNocType)||void 0===de?void 0:de.name),Le(Se("NOC_RESTRICTED_AREA_LABEL"),null==Ae||null===(ce=Ae.siteDetails)||void 0===ce||null===(ve=ce.specificationRestrictedArea)||void 0===ve?void 0:ve.code),Le(Se("NOC_IS_SITE_UNDER_MASTER_PLAN_LABEL"),null==Ae||null===(me=Ae.siteDetails)||void 0===me||null===(pe=me.specificationIsSiteUnderMasterPlan)||void 0===pe?void 0:pe.code)),l.createElement("h2",{style:ye},Se("NOC_SITE_COORDINATES_LABEL")),l.createElement("div",{style:be},Le(Se("COMMON_LATITUDE1_LABEL"),null==Ne?void 0:Ne.Latitude1),Le(Se("COMMON_LONGITUDE1_LABEL"),null==Ne?void 0:Ne.Longitude1),Le(Se("COMMON_LATITUDE2_LABEL"),null==Ne?void 0:Ne.Latitude2),Le(Se("COMMON_LONGITUDE2_LABEL"),null==Ne?void 0:Ne.Longitude2)),l.createElement("h2",{style:ye},Se("NOC_TITILE_DOCUMENT_UPLOADED")),l.createElement("div",{style:be},(null==Ae||null===(fe=Ae.documents)||void 0===fe||null===(Ee=fe.documents)||void 0===Ee||null===(ge=Ee.documents)||void 0===ge?void 0:ge.length)>0&&l.createElement(Al,{documents:null==Ae||null===(_e=Ae.documents)||void 0===_e||null===(he=_e.documents)||void 0===he?void 0:he.documents})),l.createElement("h2",{style:ye},Se("NOC_FEE_DETAILS_LABEL")),l.createElement("div",{style:be},Ae&&l.createElement(Sl,{formData:Ae})))}function Ri(e){var i;let{t:o,document:a,setDocuments:r,setError:u,documents:s,action:v,formData:m,handleSubmit:p,id:f,geocoordinates:E,setGeoCoordinates:g,dispatch:_,previewLink:h}=e;const A=null==s?void 0:s.filter(e=>{var t;return null==e||null===(t=e.documentType)||void 0===t?void 0:t.includes(null==a?void 0:a.code)})[0],[S,N]=(Digit.ULBService.getCurrentTenantId(),n.useState(A?c({},A,{active:!0===(null==a?void 0:a.active),code:null==A?void 0:A.documentType}):1===(null==a||null===(i=a.dropdownData)||void 0===i?void 0:i.length)?null==a?void 0:a.dropdownData[0]:{})),[b,C]=n.useState(null),[y,D]=n.useState(()=>(null==A?void 0:A.filestoreId)||null);function L(e){const t=e.target.files[0];C(t),console.log("selectedFile here",t),t&&"image/jpeg"===t.type&&function(e){return new Promise(t=>{try{d.getData(e,function(){const e=d.getTag(this,"GPSLatitude"),n=d.getTag(this,"GPSLongitude");if(console.log("lat====",e),e&&n){const l=x(e).toFixed(6),i=x(n).toFixed(6);t({latitude:l,longitude:i})}else t({latitude:null,longitude:null}),"OWNER.SITEPHOTOGRAPHONE"===(null==a?void 0:a.code)&&alert("Please Upload a Photo with Location Details")})}catch(e){console.log("EXIF parsing failed:",e),t({latitude:null,longitude:null})}})}(t).then(e=>{console.log("Latitude:",e.latitude),console.log("Longitude:",e.longitude),"OWNER.SITEPHOTOGRAPHONE"===(null==a?void 0:a.code)&&(null!==e.latitude&&null!==e.longitude?(_(yi("Latitude1",e.latitude)),_(yi("Longitude1",e.longitude)),g(t=>c({},t,{Latitude1:e.latitude,Longitude1:e.longitude}))):(window.location.pathname.includes("edit")&&(_(yi("Latitude1","")),_(yi("Longitude1",""))),alert("Please upload a photo with location details."))),"OWNER.SITEPHOTOGRAPHTWO"===(null==a?void 0:a.code)&&(null!==e.latitude&&null!==e.longitude?(_(yi("Latitude2",e.latitude)),_(yi("Longitude2",e.longitude)),g(t=>c({},t,{Latitude2:e.latitude,Longitude2:e.longitude}))):(window.location.pathname.includes("edit")&&(_(yi("Latitude2","")),_(yi("Longitude2",""))),alert("Please upload a photo with location details.")))})}const{dropdownData:O}=a;var T=O;const[I,w]=n.useState(!1),[P,R]=n.useState(!1);function x(e){return e[0]+e[1]/60+e[2]/3600}return n.useEffect(()=>{null!=S&&S.code&&r(e=>{const t=null==e?void 0:e.filter(e=>(null==e?void 0:e.documentType)!==(null==S?void 0:S.code));return 0===(null==y?void 0:y.length)||null===y?t:[...(null==t?void 0:t.filter(e=>(null==e?void 0:e.fileStoreId)!==y))||[],{documentType:null==S?void 0:S.code,filestoreId:y,documentUid:y,documentAttachment:y}]})},[y,S]),n.useEffect(()=>{(null==s?void 0:s.length)>0&&(console.log("documents here",s),p())},[s]),n.useEffect(()=>{if("update"===v){var e,t;const n=null==m||null===(e=m.originalData)||void 0===e||null===(t=e.documents)||void 0===t?void 0:t.filter(e=>e.documentType.includes(null==a?void 0:a.code))[0],l=T.filter(e=>e.code===(null==n?void 0:n.documentType)).map(e=>{var t;return c({},e,{i18nKey:null==e||null===(t=e.code)||void 0===t?void 0:t.replaceAll(".","_")})})[0];l?(N(l),D(null==n?void 0:n.fileStoreId)):w(!0)}},[]),n.useEffect(()=>{var e;null!=a&&a.hasDropdown||N({code:null==a?void 0:a.code,i18nKey:null==a||null===(e=a.code)||void 0===e?void 0:e.replaceAll(".","_")})},[]),n.useEffect(()=>{!function(){try{u(null);const e=function(){if(b){R(!0);const e=function(){if(b.size>=5242880)R(!1),u(o("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=kt(function(){return D(null),Promise.resolve(Digit.UploadServices.Filestorage("NOC",b,Digit.ULBService.getStateId())).then(function(e){var t,n,l,i;R(!1),(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?D(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):u(o("CS_FILE_UPLOAD_ERROR"))})},function(){R(!1),u(o("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[b]),n.useEffect(()=>{I&&D(null)},[I]),l.createElement("div",{style:{marginBottom:"24px"}},P&&l.createElement(t.Loader,null),null!=a&&a.hasDropdown?l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},o(null==a?void 0:a.code.replaceAll(".","_"))),l.createElement(t.Dropdown,{className:"form-field",selected:S,style:{width:"100%"},option:T.map(e=>{var t;return c({},e,{i18nKey:null===(t=e.code)||void 0===t?void 0:t.replaceAll(".","_")})}),select:e=>N(e),optionKey:"i18nKey",t:o})):null,null!=a&&a.hasDropdown?null:l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},o(null==a?void 0:a.code.replaceAll(".","_")),l.createElement("span",null,null!=a&&a.required?" *":""))),l.createElement(t.LabelFieldPair,null,l.createElement(t.UploadFile,"OWNER.OWNERPHOTO"===(null==a?void 0:a.code)||"OWNER.SITEPHOTOGRAPHONE"===(null==a?void 0:a.code)||"OWNER.SITEPHOTOGRAPHTWO"===(null==a?void 0:a.code)?{onUpload:L,onDelete:()=>{D(null)},id:f,message:y?"1 "+o("CS_ACTION_FILEUPLOADED"):o("CS_ACTION_NO_FILEUPLOADED"),textStyles:{width:"100%"},inputStyles:{width:"280px"},accept:".jpg, .jpeg, .png",buttonType:"button",error:!y}:{onUpload:L,onDelete:()=>{D(null)},id:f,message:y?"1 "+o("CS_ACTION_FILEUPLOADED"):o("CS_ACTION_NO_FILEUPLOADED"),textStyles:{width:"100%"},inputStyles:{width:"280px"},accept:".pdf, .jpeg, .jpg, .png",buttonType:"button",error:!y}),h&&l.createElement("div",{style:{cursor:"pointer",padding:"10px",marginLeft:"25px"},onClick:e=>{e.preventDefault(),window.open(h,"_blank")}},l.createElement(t.ViewsIcon,null)),"OWNER.SITEPHOTOGRAPHONE"===(null==a?void 0:a.code)&&(null==E?void 0:E.Latitude1)&&(null==E?void 0:E.Longitude1)&&l.createElement(t.CardLabel,null,l.createElement("div",{style:{paddingLeft:"30px"}},l.createElement("p",null,"Latitude: ",E.Latitude1),l.createElement("p",null,"Longitude: ",E.Longitude1))),"OWNER.SITEPHOTOGRAPHTWO"===(null==a?void 0:a.code)&&(null==E?void 0:E.Latitude2)&&(null==E?void 0:E.Longitude2)&&l.createElement(t.CardLabel,null,l.createElement("div",{style:{paddingLeft:"30px"}},l.createElement("p",null,"Latitude: ",E.Latitude2),l.createElement("p",null,"Longitude: ",E.Longitude2)))))}const xi=l.memo(function(e){var i,o,a;let{t:r,document:u,setDocuments:s,documents:v,formData:m,beforeUploadDocuments:p,setIsNextButtonDisabled:f,handleSubmit:E}=e;console.log("documents here",v);const g=(null==v?void 0:v.filter(e=>{var t;return null==e||null===(t=e.documentType)||void 0===t?void 0:t.includes(null==u?void 0:u.code)})[0])||(null==p?void 0:p.filter(e=>{var t;return null==e||null===(t=e.documentType)||void 0===t?void 0:t.includes(null==u?void 0:u.code)})[0]);console.log("filteredDocument here",g);const _=Digit.ULBService.getStateId(),[h,A]=n.useState(g?c({},g,{active:!0,code:null==g?void 0:g.documentType,i18nKey:null==g?void 0:g.documentType}):(null==u||null===(i=u.dropdownData)||void 0===i?void 0:i.length)>0?null==u?void 0:u.dropdownData[0]:{}),[S,N]=n.useState(null),[b,C]=n.useState(()=>(null==v?void 0:v.filter(e=>{var t;return null==e||null===(t=e.documentType)||void 0===t?void 0:t.includes(null==u?void 0:u.code)}).map(e=>({fileStoreId:null==e?void 0:e.fileStoreId,fileName:(null==e?void 0:e.fileName)||""})))||null),[y,D]=n.useState([]),[L,O]=n.useState([]),[T,I]=n.useState([]||(null==m||null===(o=m.documents)||void 0===o?void 0:o.documents.filter(e=>e.documentType===h.code))),[w,P]=n.useState(null),[R,x]=n.useState(null);function B(e){return e[0]+e[1]/60+e[2]/3600}n.useEffect(()=>{(null==v?void 0:v.length)>0&&E()},[v]),n.useEffect(()=>{L.length>0&&null!=h&&h.code&&(s(e=>{if(null===b||null==(null==b?void 0:b.fileStoreId))return e;const t=null==e?void 0:e.filter(e=>(null==e?void 0:e.fileStoreId)!==b.fileStoreId);let n=[];return L&&L.map((e,t)=>{var l,i;n.push({documentType:null==h?void 0:h.code,fileStoreId:e.fileStoreId,additionalDetails:{category:null==h?void 0:h.code.split(".").slice(0,2).join("_"),latitude:w,longitude:R},documentUid:e.fileStoreId,fileName:(null===(l=T[t])||void 0===l?void 0:l.name)||"",id:v?null===(i=v.find(e=>e.documentType===(null==h?void 0:h.code)))||void 0===i?void 0:i.id:void 0})}),console.log("newfiles here",n),[...t,...n]}),O([])),null!=h&&h.code&&s(e=>{var t;return null===b||null==(null==b?void 0:b.fileStoreId)?((null==e?void 0:e.length)>0&&(null==e||e.forEach(e=>{var t,n,l,i,o;(null==e||null===(t=e.documentType)||void 0===t?void 0:t.split(".")[0])+"."+(null==e||null===(n=e.documentType)||void 0===n?void 0:n.split(".")[1])==(null==h||null===(l=h.code)||void 0===l?void 0:l.split(".")[0])+"."+(null==h||null===(i=h.code)||void 0===i?void 0:i.split(".")[1])&&(null!=e&&e.documentType&&(e.documentType=null==h?void 0:h.code),null!=e&&null!==(o=e.file)&&void 0!==o&&o.documentType&&(e.file.documentType=null==h?void 0:h.code))})),e):[...null==e?void 0:e.filter(e=>(null==e?void 0:e.fileStoreId)!==b.fileStoreId),{documentType:null==h?void 0:h.code,fileStoreId:b.fileStoreId,documentUid:b.fileStoreId,fileName:(null==S?void 0:S.name)||b.fileName||"document",id:v?null===(t=v.find(e=>e.documentType===(null==h?void 0:h.code)))||void 0===t?void 0:t.id:void 0}]})},[b,h]),n.useEffect(()=>{h.code||null===b||O([...L,b])},[b]);const F=n.useMemo(()=>{var e,t;console.log("uploadFiles here from formData",m);let n=[];return null==m||null===(e=m.documents)||void 0===e||null===(t=e.documents)||void 0===t||t.filter(e=>e.documentType===h.code).forEach(e=>n.push([e.fileName,{file:{name:e.fileName,type:e.documentType},fileStoreId:{fileStoreId:e.fileStoreId,tenantId:_}}])),console.log("selectedUplDocs here",n),n},[m]);return l.createElement("div",null,l.createElement(t.CardLabel,null,null!=u&&u.required?r(null==u?void 0:u.code)+" *":""+r(null==u?void 0:u.code)),l.createElement(t.MultiUploadWrapper,{module:"NOC",tenantId:_,getFormState:function(e){let t,n,l=h.code;if((null==e?void 0:e.length)>0)(function(e){return new Promise(t=>{try{d.getData(e,function(){const e=d.getTag(this,"GPSLatitude"),n=d.getTag(this,"GPSLongitude");if(e&&n){const l=B(e),i=B(n);t({latitude:l,longitude:i})}else t({latitude:null,longitude:null}),"OWNER.SITEPHOTOGRAPHONE"===(null==u?void 0:u.code)&&alert("Please Upload a Photo with Location Details")})}catch(e){t({latitude:null,longitude:null})}})})(e[0][1].file).then(i=>{var o,a,r;console.log("Latitude:",i.latitude),console.log("Longitude:",i.longitude),P(i.latitude),x(i.longitude),"OWNER.SITEPHOTOGRAPHONE"===(null==u?void 0:u.code)&&(null!==i.latitude&&null!==i.longitude?(sessionStorage.setItem("Latitude",i.latitude),sessionStorage.setItem("Longitude",i.longitude)):(sessionStorage.removeItem("Latitude"),sessionStorage.removeItem("Longitude"))),t=Object.fromEntries(e),n=Object.values(t),n=null==m||null===(o=m.documents)||void 0===o||null===(a=o.documents)||void 0===a?void 0:a.filter(e=>e.documentType===h.code),D(n);let d=[];null==e||e.map((e,t)=>{var n,l,o,a;d.push({documentType:null==h?void 0:h.code,additionalDetails:{category:null==h?void 0:h.code.split(".").slice(0,2).join("_"),latitude:i.latitude,longitude:i.longitude},fileStoreId:null==e||null===(n=e[1])||void 0===n||null===(l=n.fileStoreId)||void 0===l?void 0:l.fileStoreId,documentUid:null==e||null===(o=e[1].fileStoreId)||void 0===o?void 0:o.fileStoreId,fileName:(null==e?void 0:e[0])||"",id:v?null===(a=v.find(e=>e.documentType===(null==h?void 0:h.code)))||void 0===a?void 0:a.id:void 0})});const c=[...v.filter(e=>e.documentType!==l),...d];s(c),null===(r=n)||void 0===r||r.map(e=>{null!=e&&e.file||(e.file={}),e.file.documentType=l,function(e,t){e&&N(e.file),e&&I([...T,e.file])}(e)})}).catch(e=>{console.error("Error extracting geo location:",e)});else if(0==(null==e?void 0:e.length)){const e=[...v.filter(e=>e.documentType!==l)];s(e)}},setuploadedstate:F,t:r,extraStyleName:"NOC",allowedFileTypesRegex:/(.*?)(jpg|jpeg|png|image|pdf)$/i,allowedMaxSizeInMB:10,acceptFiles:"image/*, .pdf, .png, .jpeg, .jpg"}),(null==u||null===(a=u.uploadedDocuments)||void 0===a?void 0:a.length)&&l.createElement(Fn,{isSendBackFlow:!0,documents:null==u?void 0:u.uploadedDocuments}),"OWNER.SITEPHOTOGRAPHONE"===(null==u?void 0:u.code)&&(sessionStorage.getItem("Latitude")&&sessionStorage.getItem("Longitude")?l.createElement("div",null,l.createElement("p",null,"Latitude: ",sessionStorage.getItem("Latitude")),l.createElement("p",null,"Longitude: ",sessionStorage.getItem("Longitude")),f(!1)," "):l.createElement("div",null,l.createElement("p",{style:{color:"red"}},"Please upload a Photo with Location details."),f(!0)," ")))}),Bi=[{head:"APPLICATION DETAILS",stepLabel:"NOC_APPLICATION_DETAILS",stepNumber:1,isStepEnabled:!0,type:"component",component:"NewNOCStepFormOne",key:"applicationDetails",withoutLabel:!0,texts:{submitBarLabel:"CS_COMMON_NEXT"}},{head:"SITE DETAILS",stepLabel:"NOC_SITE_DETAILS",stepNumber:2,isStepEnabled:!0,type:"component",component:"NewNOCStepFormTwo",key:"siteDetails",withoutLabel:!0,texts:{submitBarLabel:"CS_COMMON_NEXT"}},{head:"DOCUMENT DETAILS",stepLabel:"ES_TITILE_DOCUMENT_DETAILS",stepNumber:3,isStepEnabled:!0,type:"component",component:"NewNOCStepFormThree",key:"documents",withoutLabel:!0,texts:{submitBarLabel:"CS_COMMON_NEXT"}},{head:"SUMMARY DETAILS",stepLabel:"ES_TITILE_SUMMARY_DETAILS",stepNumber:4,isStepEnabled:!0,type:"component",component:"NewNOCStepFormFour",key:"summary",withoutLabel:!0,texts:{submitBarLabel:"CS_COMMON_SUBMIT"}}].map(e=>c({},e,{currStepConfig:Ni.filter(t=>t.stepNumber===e.stepNumber)}));var Fi=function(){return"function"==typeof Promise&&Promise.prototype&&Promise.prototype.then};let Mi;const Ui=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];var ki=function(e){if(!e)throw new Error('"version" cannot be null or undefined');if(e<1||e>40)throw new Error('"version" should be in range from 1 to 40');return 4*e+17},Wi=function(e){return Ui[e]},Hi=function(e){let t=0;for(;0!==e;)t++,e>>>=1;return t},ji=function(){return void 0!==Mi},zi=function(e){return Mi(e)},Vi=y(function(e,t){t.L={bit:1},t.M={bit:0},t.Q={bit:3},t.H={bit:2},t.isValid=function(e){return e&&void 0!==e.bit&&e.bit>=0&&e.bit<4},t.from=function(e,n){if(t.isValid(e))return e;try{return function(e){if("string"!=typeof e)throw new Error("Param is not a string");switch(e.toLowerCase()){case"l":case"low":return t.L;case"m":case"medium":return t.M;case"q":case"quartile":return t.Q;case"h":case"high":return t.H;default:throw new Error("Unknown EC Level: "+e)}}(e)}catch(e){return n}}});function Gi(){this.buffer=[],this.length=0}Gi.prototype={get:function(e){const t=Math.floor(e/8);return 1==(this.buffer[t]>>>7-e%8&1)},put:function(e,t){for(let n=0;n<t;n++)this.putBit(1==(e>>>t-n-1&1))},getLengthInBits:function(){return this.length},putBit:function(e){const t=Math.floor(this.length/8);this.buffer.length<=t&&this.buffer.push(0),e&&(this.buffer[t]|=128>>>this.length%8),this.length++}};var Yi=Gi;function Ki(e){if(!e||e<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=e,this.data=new Uint8Array(e*e),this.reservedBit=new Uint8Array(e*e)}Ki.prototype.set=function(e,t,n,l){const i=e*this.size+t;this.data[i]=n,l&&(this.reservedBit[i]=!0)},Ki.prototype.get=function(e,t){return this.data[e*this.size+t]},Ki.prototype.xor=function(e,t,n){this.data[e*this.size+t]^=n},Ki.prototype.isReserved=function(e,t){return this.reservedBit[e*this.size+t]};var qi=Ki,Xi=y(function(e,t){const n=ki;t.getRowColCoords=function(e){if(1===e)return[];const t=Math.floor(e/7)+2,l=n(e),i=145===l?26:2*Math.ceil((l-13)/(2*t-2)),o=[l-7];for(let e=1;e<t-1;e++)o[e]=o[e-1]-i;return o.push(6),o.reverse()},t.getPositions=function(e){const n=[],l=t.getRowColCoords(e),i=l.length;for(let e=0;e<i;e++)for(let t=0;t<i;t++)0===e&&0===t||0===e&&t===i-1||e===i-1&&0===t||n.push([l[e],l[t]]);return n}});const Ji=ki;var Qi=y(function(e,t){function n(e,n,l){switch(e){case t.Patterns.PATTERN000:return(n+l)%2==0;case t.Patterns.PATTERN001:return n%2==0;case t.Patterns.PATTERN010:return l%3==0;case t.Patterns.PATTERN011:return(n+l)%3==0;case t.Patterns.PATTERN100:return(Math.floor(n/2)+Math.floor(l/3))%2==0;case t.Patterns.PATTERN101:return n*l%2+n*l%3==0;case t.Patterns.PATTERN110:return(n*l%2+n*l%3)%2==0;case t.Patterns.PATTERN111:return(n*l%3+(n+l)%2)%2==0;default:throw new Error("bad maskPattern:"+e)}}t.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},t.isValid=function(e){return null!=e&&""!==e&&!isNaN(e)&&e>=0&&e<=7},t.from=function(e){return t.isValid(e)?parseInt(e,10):void 0},t.getPenaltyN1=function(e){const t=e.size;let n=0,l=0,i=0,o=null,a=null;for(let r=0;r<t;r++){l=i=0,o=a=null;for(let u=0;u<t;u++){let t=e.get(r,u);t===o?l++:(l>=5&&(n+=l-5+3),o=t,l=1),t=e.get(u,r),t===a?i++:(i>=5&&(n+=i-5+3),a=t,i=1)}l>=5&&(n+=l-5+3),i>=5&&(n+=i-5+3)}return n},t.getPenaltyN2=function(e){const t=e.size;let n=0;for(let l=0;l<t-1;l++)for(let i=0;i<t-1;i++){const t=e.get(l,i)+e.get(l,i+1)+e.get(l+1,i)+e.get(l+1,i+1);4!==t&&0!==t||n++}return 3*n},t.getPenaltyN3=function(e){const t=e.size;let n=0,l=0,i=0;for(let o=0;o<t;o++){l=i=0;for(let a=0;a<t;a++)l=l<<1&2047|e.get(o,a),a>=10&&(1488===l||93===l)&&n++,i=i<<1&2047|e.get(a,o),a>=10&&(1488===i||93===i)&&n++}return 40*n},t.getPenaltyN4=function(e){let t=0;const n=e.data.length;for(let l=0;l<n;l++)t+=e.data[l];return 10*Math.abs(Math.ceil(100*t/n/5)-10)},t.applyMask=function(e,t){const l=t.size;for(let i=0;i<l;i++)for(let o=0;o<l;o++)t.isReserved(o,i)||t.xor(o,i,n(e,o,i))},t.getBestMask=function(e,n){const l=Object.keys(t.Patterns).length;let i=0,o=Infinity;for(let a=0;a<l;a++){n(a),t.applyMask(a,e);const l=t.getPenaltyN1(e)+t.getPenaltyN2(e)+t.getPenaltyN3(e)+t.getPenaltyN4(e);t.applyMask(a,e),l<o&&(o=l,i=a)}return i}});const Zi=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],$i=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];var eo=function(e,t){switch(t){case Vi.L:return Zi[4*(e-1)+0];case Vi.M:return Zi[4*(e-1)+1];case Vi.Q:return Zi[4*(e-1)+2];case Vi.H:return Zi[4*(e-1)+3];default:return}},to=function(e,t){switch(t){case Vi.L:return $i[4*(e-1)+0];case Vi.M:return $i[4*(e-1)+1];case Vi.Q:return $i[4*(e-1)+2];case Vi.H:return $i[4*(e-1)+3];default:return}};const no=new Uint8Array(512),lo=new Uint8Array(256);!function(){let e=1;for(let t=0;t<255;t++)no[t]=e,lo[e]=t,e<<=1,256&e&&(e^=285);for(let e=255;e<512;e++)no[e]=no[e-255]}();var io=function(e,t){return 0===e||0===t?0:no[lo[e]+lo[t]]},oo=y(function(e,t){t.mul=function(e,t){const n=new Uint8Array(e.length+t.length-1);for(let l=0;l<e.length;l++)for(let i=0;i<t.length;i++)n[l+i]^=io(e[l],t[i]);return n},t.mod=function(e,t){let n=new Uint8Array(e);for(;n.length-t.length>=0;){const e=n[0];for(let l=0;l<t.length;l++)n[l]^=io(t[l],e);let l=0;for(;l<n.length&&0===n[l];)l++;n=n.slice(l)}return n},t.generateECPolynomial=function(e){let n=new Uint8Array([1]);for(let i=0;i<e;i++)n=t.mul(n,new Uint8Array([1,(l=i,no[l])]));var l;return n}});function ao(e){this.genPoly=void 0,this.degree=e,this.degree&&this.initialize(this.degree)}ao.prototype.initialize=function(e){this.degree=e,this.genPoly=oo.generateECPolynomial(this.degree)},ao.prototype.encode=function(e){if(!this.genPoly)throw new Error("Encoder not initialized");const t=new Uint8Array(e.length+this.degree);t.set(e);const n=oo.mod(t,this.genPoly),l=this.degree-n.length;if(l>0){const e=new Uint8Array(this.degree);return e.set(n,l),e}return n};var ro=ao,uo=function(e){return!isNaN(e)&&e>=1&&e<=40};let so="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";so=so.replace(/u/g,"\\u");const co="(?:(?![A-Z0-9 $%*+\\-./:]|"+so+")(?:.|[\r\n]))+";var vo=new RegExp(so,"g"),mo=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),po=new RegExp(co,"g"),fo=new RegExp("[0-9]+","g"),Eo=new RegExp("[A-Z $%*+\\-./:]+","g");const go=new RegExp("^"+so+"$"),_o=new RegExp("^[0-9]+$"),ho=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");var Ao={KANJI:vo,BYTE_KANJI:mo,BYTE:po,NUMERIC:fo,ALPHANUMERIC:Eo,testKanji:function(e){return go.test(e)},testNumeric:function(e){return _o.test(e)},testAlphanumeric:function(e){return ho.test(e)}},So=y(function(e,t){t.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},t.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},t.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},t.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},t.MIXED={bit:-1},t.getCharCountIndicator=function(e,t){if(!e.ccBits)throw new Error("Invalid mode: "+e);if(!uo(t))throw new Error("Invalid version: "+t);return t>=1&&t<10?e.ccBits[0]:t<27?e.ccBits[1]:e.ccBits[2]},t.getBestModeForData=function(e){return Ao.testNumeric(e)?t.NUMERIC:Ao.testAlphanumeric(e)?t.ALPHANUMERIC:Ao.testKanji(e)?t.KANJI:t.BYTE},t.toString=function(e){if(e&&e.id)return e.id;throw new Error("Invalid mode")},t.isValid=function(e){return e&&e.bit&&e.ccBits},t.from=function(e,n){if(t.isValid(e))return e;try{return function(e){if("string"!=typeof e)throw new Error("Param is not a string");switch(e.toLowerCase()){case"numeric":return t.NUMERIC;case"alphanumeric":return t.ALPHANUMERIC;case"kanji":return t.KANJI;case"byte":return t.BYTE;default:throw new Error("Unknown mode: "+e)}}(e)}catch(e){return n}}}),No=y(function(e,t){const n=Hi(7973);function l(e,t){return So.getCharCountIndicator(e,t)+4}function i(e,t){let n=0;return e.forEach(function(e){const i=l(e.mode,t);n+=i+e.getBitsLength()}),n}t.from=function(e,t){return uo(e)?parseInt(e,10):t},t.getCapacity=function(e,t,n){if(!uo(e))throw new Error("Invalid QR Code version");void 0===n&&(n=So.BYTE);const i=8*(Wi(e)-to(e,t));if(n===So.MIXED)return i;const o=i-l(n,e);switch(n){case So.NUMERIC:return Math.floor(o/10*3);case So.ALPHANUMERIC:return Math.floor(o/11*2);case So.KANJI:return Math.floor(o/13);case So.BYTE:default:return Math.floor(o/8)}},t.getBestVersionForData=function(e,n){let l;const o=Vi.from(n,Vi.M);if(Array.isArray(e)){if(e.length>1)return function(e,n){for(let l=1;l<=40;l++)if(i(e,l)<=t.getCapacity(l,n,So.MIXED))return l}(e,o);if(0===e.length)return 1;l=e[0]}else l=e;return function(e,n,l){for(let i=1;i<=40;i++)if(n<=t.getCapacity(i,l,e))return i}(l.mode,l.getLength(),o)},t.getEncodedBits=function(e){if(!uo(e)||e<7)throw new Error("Invalid QR Code version");let t=e<<12;for(;Hi(t)-n>=0;)t^=7973<<Hi(t)-n;return e<<12|t}});const bo=Hi(1335);function Co(e){this.mode=So.NUMERIC,this.data=e.toString()}Co.getBitsLength=function(e){return 10*Math.floor(e/3)+(e%3?e%3*3+1:0)},Co.prototype.getLength=function(){return this.data.length},Co.prototype.getBitsLength=function(){return Co.getBitsLength(this.data.length)},Co.prototype.write=function(e){let t,n,l;for(t=0;t+3<=this.data.length;t+=3)n=this.data.substr(t,3),l=parseInt(n,10),e.put(l,10);const i=this.data.length-t;i>0&&(n=this.data.substr(t),l=parseInt(n,10),e.put(l,3*i+1))};var yo=Co;const Do=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function Lo(e){this.mode=So.ALPHANUMERIC,this.data=e}Lo.getBitsLength=function(e){return 11*Math.floor(e/2)+e%2*6},Lo.prototype.getLength=function(){return this.data.length},Lo.prototype.getBitsLength=function(){return Lo.getBitsLength(this.data.length)},Lo.prototype.write=function(e){let t;for(t=0;t+2<=this.data.length;t+=2){let n=45*Do.indexOf(this.data[t]);n+=Do.indexOf(this.data[t+1]),e.put(n,11)}this.data.length%2&&e.put(Do.indexOf(this.data[t]),6)};var Oo=Lo;function To(e){this.mode=So.BYTE,this.data="string"==typeof e?(new TextEncoder).encode(e):new Uint8Array(e)}To.getBitsLength=function(e){return 8*e},To.prototype.getLength=function(){return this.data.length},To.prototype.getBitsLength=function(){return To.getBitsLength(this.data.length)},To.prototype.write=function(e){for(let t=0,n=this.data.length;t<n;t++)e.put(this.data[t],8)};var Io=To;function wo(e){this.mode=So.KANJI,this.data=e}wo.getBitsLength=function(e){return 13*e},wo.prototype.getLength=function(){return this.data.length},wo.prototype.getBitsLength=function(){return wo.getBitsLength(this.data.length)},wo.prototype.write=function(e){let t;for(t=0;t<this.data.length;t++){let n=zi(this.data[t]);if(n>=33088&&n<=40956)n-=33088;else{if(!(n>=57408&&n<=60351))throw new Error("Invalid SJIS character: "+this.data[t]+"\nMake sure your charset is UTF-8");n-=49472}n=192*(n>>>8&255)+(255&n),e.put(n,13)}};var Po=wo,Ro=y(function(e){var t={single_source_shortest_paths:function(e,n,l){var i={},o={};o[n]=0;var a,r,u,s,d,c,v=t.PriorityQueue.make();for(v.push(n,0);!v.empty();)for(u in s=(a=v.pop()).cost,d=e[r=a.value]||{})d.hasOwnProperty(u)&&(c=s+d[u],(void 0===o[u]||o[u]>c)&&(o[u]=c,v.push(u,c),i[u]=r));if(void 0!==l&&void 0===o[l]){var m=["Could not find a path from ",n," to ",l,"."].join("");throw new Error(m)}return i},extract_shortest_path_from_predecessor_list:function(e,t){for(var n=[],l=t;l;)n.push(l),l=e[l];return n.reverse(),n},find_path:function(e,n,l){var i=t.single_source_shortest_paths(e,n,l);return t.extract_shortest_path_from_predecessor_list(i,l)},PriorityQueue:{make:function(e){var n,l=t.PriorityQueue,i={};for(n in e=e||{},l)l.hasOwnProperty(n)&&(i[n]=l[n]);return i.queue=[],i.sorter=e.sorter||l.default_sorter,i},default_sorter:function(e,t){return e.cost-t.cost},push:function(e,t){this.queue.push({value:e,cost:t}),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return 0===this.queue.length}}};e.exports=t}),xo=y(function(e,t){function n(e){return unescape(encodeURIComponent(e)).length}function l(e,t,n){const l=[];let i;for(;null!==(i=e.exec(n));)l.push({data:i[0],index:i.index,mode:t,length:i[0].length});return l}function i(e){const t=l(Ao.NUMERIC,So.NUMERIC,e),n=l(Ao.ALPHANUMERIC,So.ALPHANUMERIC,e);let i,o;return ji()?(i=l(Ao.BYTE,So.BYTE,e),o=l(Ao.KANJI,So.KANJI,e)):(i=l(Ao.BYTE_KANJI,So.BYTE,e),o=[]),t.concat(n,i,o).sort(function(e,t){return e.index-t.index}).map(function(e){return{data:e.data,mode:e.mode,length:e.length}})}function o(e,t){switch(t){case So.NUMERIC:return yo.getBitsLength(e);case So.ALPHANUMERIC:return Oo.getBitsLength(e);case So.KANJI:return Po.getBitsLength(e);case So.BYTE:return Io.getBitsLength(e)}}function a(e,t){let n;const l=So.getBestModeForData(e);if(n=So.from(t,l),n!==So.BYTE&&n.bit<l.bit)throw new Error('"'+e+'" cannot be encoded with mode '+So.toString(n)+".\n Suggested mode is: "+So.toString(l));switch(n!==So.KANJI||ji()||(n=So.BYTE),n){case So.NUMERIC:return new yo(e);case So.ALPHANUMERIC:return new Oo(e);case So.KANJI:return new Po(e);case So.BYTE:return new Io(e)}}t.fromArray=function(e){return e.reduce(function(e,t){return"string"==typeof t?e.push(a(t,null)):t.data&&e.push(a(t.data,t.mode)),e},[])},t.fromString=function(e,l){const a=function(e,t){const n={},l={start:{}};let i=["start"];for(let a=0;a<e.length;a++){const r=e[a],u=[];for(let e=0;e<r.length;e++){const s=r[e],d=""+a+e;u.push(d),n[d]={node:s,lastCount:0},l[d]={};for(let e=0;e<i.length;e++){const a=i[e];n[a]&&n[a].node.mode===s.mode?(l[a][d]=o(n[a].lastCount+s.length,s.mode)-o(n[a].lastCount,s.mode),n[a].lastCount+=s.length):(n[a]&&(n[a].lastCount=s.length),l[a][d]=o(s.length,s.mode)+4+So.getCharCountIndicator(s.mode,t))}}i=u}for(let e=0;e<i.length;e++)l[i[e]].end=0;return{map:l,table:n}}(function(e){const t=[];for(let l=0;l<e.length;l++){const i=e[l];switch(i.mode){case So.NUMERIC:t.push([i,{data:i.data,mode:So.ALPHANUMERIC,length:i.length},{data:i.data,mode:So.BYTE,length:i.length}]);break;case So.ALPHANUMERIC:t.push([i,{data:i.data,mode:So.BYTE,length:i.length}]);break;case So.KANJI:t.push([i,{data:i.data,mode:So.BYTE,length:n(i.data)}]);break;case So.BYTE:t.push([{data:i.data,mode:So.BYTE,length:n(i.data)}])}}return t}(i(e,ji())),l),r=Ro.find_path(a.map,"start","end"),u=[];for(let e=1;e<r.length-1;e++)u.push(a.table[r[e]].node);return t.fromArray(u.reduce(function(e,t){const n=e.length-1>=0?e[e.length-1]:null;return n&&n.mode===t.mode?(e[e.length-1].data+=t.data,e):(e.push(t),e)},[]))},t.rawSplit=function(e){return t.fromArray(i(e,ji()))}});function Bo(e,t,n){const l=e.size,i=function(e,t){const n=e.bit<<3|t;let l=n<<10;for(;Hi(l)-bo>=0;)l^=1335<<Hi(l)-bo;return 21522^(n<<10|l)}(t,n);let o,a;for(o=0;o<15;o++)a=1==(i>>o&1),e.set(o<6?o:o<8?o+1:l-15+o,8,a,!0),e.set(8,o<8?l-o-1:o<9?15-o-1+1:15-o-1,a,!0);e.set(l-8,8,1,!0)}var Fo=function(e,t){if(void 0===e||""===e)throw new Error("No input text");let n,l,i=Vi.M;return void 0!==t&&(i=Vi.from(t.errorCorrectionLevel,Vi.M),n=No.from(t.version),l=Qi.from(t.maskPattern),t.toSJISFunc&&function(e){if("function"!=typeof e)throw new Error('"toSJISFunc" is not a valid function.');Mi=e}(t.toSJISFunc)),function(e,t,n,l){let i;if(Array.isArray(e))i=xo.fromArray(e);else{if("string"!=typeof e)throw new Error("Invalid data");{let l=t;if(!l){const t=xo.rawSplit(e);l=No.getBestVersionForData(t,n)}i=xo.fromString(e,l||40)}}const o=No.getBestVersionForData(i,n);if(!o)throw new Error("The amount of data is too big to be stored in a QR Code");if(t){if(t<o)throw new Error("\nThe chosen QR Code version cannot contain this amount of data.\nMinimum version required to store current data is: "+o+".\n")}else t=o;const a=function(e,t,n){const l=new Yi;n.forEach(function(t){l.put(t.mode.bit,4),l.put(t.getLength(),So.getCharCountIndicator(t.mode,e)),t.write(l)});const i=8*(Wi(e)-to(e,t));for(l.getLengthInBits()+4<=i&&l.put(0,4);l.getLengthInBits()%8!=0;)l.putBit(0);const o=(i-l.getLengthInBits())/8;for(let e=0;e<o;e++)l.put(e%2?17:236,8);return function(e,t,n){const l=Wi(t),i=l-to(t,n),o=eo(t,n),a=o-l%o,r=Math.floor(l/o),u=Math.floor(i/o),s=u+1,d=r-u,c=new ro(d);let v=0;const m=new Array(o),p=new Array(o);let f=0;const E=new Uint8Array(e.buffer);for(let e=0;e<o;e++){const t=e<a?u:s;m[e]=E.slice(v,v+t),p[e]=c.encode(m[e]),v+=t,f=Math.max(f,t)}const g=new Uint8Array(l);let _,h,A=0;for(_=0;_<f;_++)for(h=0;h<o;h++)_<m[h].length&&(g[A++]=m[h][_]);for(_=0;_<d;_++)for(h=0;h<o;h++)g[A++]=p[h][_];return g}(l,e,t)}(t,n,i),r=ki(t),u=new qi(r);return function(e,t){const n=e.size,l=function(e){const t=Ji(e);return[[0,0],[t-7,0],[0,t-7]]}(t);for(let t=0;t<l.length;t++){const i=l[t][0],o=l[t][1];for(let t=-1;t<=7;t++)if(!(i+t<=-1||n<=i+t))for(let l=-1;l<=7;l++)o+l<=-1||n<=o+l||e.set(i+t,o+l,t>=0&&t<=6&&(0===l||6===l)||l>=0&&l<=6&&(0===t||6===t)||t>=2&&t<=4&&l>=2&&l<=4,!0)}}(u,t),function(e){const t=e.size;for(let n=8;n<t-8;n++){const t=n%2==0;e.set(n,6,t,!0),e.set(6,n,t,!0)}}(u),function(e,t){const n=Xi.getPositions(t);for(let t=0;t<n.length;t++){const l=n[t][0],i=n[t][1];for(let t=-2;t<=2;t++)for(let n=-2;n<=2;n++)e.set(l+t,i+n,-2===t||2===t||-2===n||2===n||0===t&&0===n,!0)}}(u,t),Bo(u,n,0),t>=7&&function(e,t){const n=e.size,l=No.getEncodedBits(t);let i,o,a;for(let t=0;t<18;t++)i=Math.floor(t/3),o=t%3+n-8-3,a=1==(l>>t&1),e.set(i,o,a,!0),e.set(o,i,a,!0)}(u,t),function(e,t){const n=e.size;let l=-1,i=n-1,o=7,a=0;for(let r=n-1;r>0;r-=2)for(6===r&&r--;;){for(let n=0;n<2;n++)if(!e.isReserved(i,r-n)){let l=!1;a<t.length&&(l=1==(t[a]>>>o&1)),e.set(i,r-n,l),o--,-1===o&&(a++,o=7)}if(i+=l,i<0||n<=i){i-=l,l=-l;break}}}(u,a),isNaN(l)&&(l=Qi.getBestMask(u,Bo.bind(null,u,n))),Qi.applyMask(l,u),Bo(u,n,l),{modules:u,version:t,errorCorrectionLevel:n,maskPattern:l,segments:i}}(e,n,i,l)},Mo=y(function(e,t){function n(e){if("number"==typeof e&&(e=e.toString()),"string"!=typeof e)throw new Error("Color should be defined as hex string");let t=e.slice().replace("#","").split("");if(t.length<3||5===t.length||t.length>8)throw new Error("Invalid hex color: "+e);3!==t.length&&4!==t.length||(t=Array.prototype.concat.apply([],t.map(function(e){return[e,e]}))),6===t.length&&t.push("F","F");const n=parseInt(t.join(""),16);return{r:n>>24&255,g:n>>16&255,b:n>>8&255,a:255&n,hex:"#"+t.slice(0,6).join("")}}t.getOptions=function(e){e||(e={}),e.color||(e.color={});const t=e.width&&e.width>=21?e.width:void 0;return{width:t,scale:t?4:e.scale||4,margin:null==e.margin||e.margin<0?4:e.margin,color:{dark:n(e.color.dark||"#000000ff"),light:n(e.color.light||"#ffffffff")},type:e.type,rendererOpts:e.rendererOpts||{}}},t.getScale=function(e,t){return t.width&&t.width>=e+2*t.margin?t.width/(e+2*t.margin):t.scale},t.getImageWidth=function(e,n){const l=t.getScale(e,n);return Math.floor((e+2*n.margin)*l)},t.qrToImageData=function(e,n,l){const i=n.modules.size,o=n.modules.data,a=t.getScale(i,l),r=Math.floor((i+2*l.margin)*a),u=l.margin*a,s=[l.color.light,l.color.dark];for(let t=0;t<r;t++)for(let n=0;n<r;n++){let d=4*(t*r+n),c=l.color.light;t>=u&&n>=u&&t<r-u&&n<r-u&&(c=s[o[Math.floor((t-u)/a)*i+Math.floor((n-u)/a)]?1:0]),e[d++]=c.r,e[d++]=c.g,e[d++]=c.b,e[d]=c.a}}}),Uo=y(function(e,t){t.render=function(e,t,n){let l=n,i=t;void 0!==l||t&&t.getContext||(l=t,t=void 0),t||(i=function(){try{return document.createElement("canvas")}catch(e){throw new Error("You need to specify a canvas element")}}()),l=Mo.getOptions(l);const o=Mo.getImageWidth(e.modules.size,l),a=i.getContext("2d"),r=a.createImageData(o,o);return Mo.qrToImageData(r.data,e,l),function(e,t,n){e.clearRect(0,0,t.width,t.height),t.style||(t.style={}),t.height=n,t.width=n,t.style.height=n+"px",t.style.width=n+"px"}(a,i,o),a.putImageData(r,0,0),i},t.renderToDataURL=function(e,n,l){let i=l;return void 0!==i||n&&n.getContext||(i=n,n=void 0),i||(i={}),t.render(e,n,i).toDataURL(i.type||"image/png",(i.rendererOpts||{}).quality)}});function ko(e,t){const n=e.a/255,l=t+'="'+e.hex+'"';return n<1?l+" "+t+'-opacity="'+n.toFixed(2).slice(1)+'"':l}function Wo(e,t,n){let l=e+t;return void 0!==n&&(l+=" "+n),l}function Ho(e,t,n,l,i){const o=[].slice.call(arguments,1),a=o.length,r="function"==typeof o[a-1];if(!r&&!Fi())throw new Error("Callback required as last argument");if(!r){if(a<1)throw new Error("Too few arguments provided");return 1===a?(n=t,t=l=void 0):2!==a||t.getContext||(l=n,n=t,t=void 0),new Promise(function(i,o){try{const o=Fo(n,l);i(e(o,t,l))}catch(e){o(e)}})}if(a<2)throw new Error("Too few arguments provided");2===a?(i=n,n=t,t=l=void 0):3===a&&(t.getContext&&void 0===i?(i=l,l=void 0):(i=l,l=n,n=t,t=void 0));try{const o=Fo(n,l);i(null,e(o,t,l))}catch(e){i(e)}}var jo={create:Fo,toCanvas:Ho.bind(null,Uo.render),toDataURL:Ho.bind(null,Uo.renderToDataURL),toString:Ho.bind(null,function(e,t,n){return function(e,t,n){const l=Mo.getOptions(t),i=e.modules.size,o=e.modules.data,a=i+2*l.margin,r=l.color.light.a?"<path "+ko(l.color.light,"fill")+' d="M0 0h'+a+"v"+a+'H0z"/>':"",u="<path "+ko(l.color.dark,"stroke")+' d="'+function(e,t,n){let l="",i=0,o=!1,a=0;for(let r=0;r<e.length;r++){const u=Math.floor(r%t),s=Math.floor(r/t);u||o||(o=!0),e[r]?(a++,r>0&&u>0&&e[r-1]||(l+=o?Wo("M",u+n,.5+s+n):Wo("m",i,0),i=0,o=!1),u+1<t&&e[r+1]||(l+=Wo("h",a),a=0)):i++}return l}(o,i,l.margin)+'"/>';return'<svg xmlns="http://www.w3.org/2000/svg" '+(l.width?'width="'+l.width+'" height="'+l.width+'" ':"")+'viewBox="0 0 '+a+" "+a+'" shape-rendering="crispEdges">'+r+u+"</svg>\n"}(e,n)})};"undefined"!=typeof window&&void 0===window.process&&(window.process={env:{}});const zo=["tenantId","payments"],Vo=(e,t,n,i)=>{var o,a,r,u,s,d;const{wfComment:c,thumbnailsToShow:v,wfDocuments:m}=e,p={date:null==e||null===(o=e.auditDetails)||void 0===o?void 0:o.lastModified,time:null==e||null===(a=e.auditDetails)||void 0===a?void 0:a.timing,name:null==e||null===(r=e.assigner)||void 0===r?void 0:r.name,mobileNumber:null==e||null===(u=e.assigner)||void 0===u?void 0:u.mobileNumber,source:null==e||null===(s=e.assigner)||void 0===s?void 0:s.source};return l.createElement("div",null,(null==c?void 0:c.length)>0&&l.createElement("div",{className:"TLComments"},l.createElement("h3",null,i("WF_COMMON_COMMENTS")),l.createElement("p",{style:{overflowX:"scroll"}},c)),(null==v||null===(d=v.thumbs)||void 0===d?void 0:d.length)>0&&l.createElement(DisplayPhotos,{srcs:v.thumbs,onClick:(e,t)=>{var n;let l=(null===(n=v.fullImage)||void 0===n?void 0:n[t])||e;Digit.Utils.zoomImage(l)}}),(null==m?void 0:m.length)>0&&l.createElement("div",null,l.createElement("div",null,l.createElement(fl,{value:{workflowDocs:m},index:t}))),l.createElement("div",{style:{marginTop:"8px"}},p.time&&l.createElement("p",null,p.time),p.date&&l.createElement("p",null,p.date),p.name&&l.createElement("p",null,p.name),p.mobileNumber&&l.createElement("p",null,p.mobileNumber),p.source&&l.createElement("p",null,i("ES_COMMON_FILED_VIA_"+p.source.toUpperCase()))))},Go=e=>{var i,r;const{register:u,setValue:s,getValues:d,reset:c,formState:v}=a.useFormContext(),{t:m}=o.useTranslation(),p=Digit.UserService.getUser().info;return l.createElement(n.Fragment,null,l.createElement(t.SearchField,null,l.createElement("label",null,m("NOC_APPLICATION_NUMBER")),l.createElement(t.TextInput,{name:"applicationNo",inputRef:u({})})),l.createElement(t.SearchField,null,l.createElement("label",null,m("NOC_APPLICANT_MOBILE_NO_LABEL")),l.createElement(t.MobileNumber,{name:"mobileNumber",inputRef:u({minLength:{value:10,message:m("CORE_COMMON_MOBILE_ERROR")},maxLength:{value:10,message:m("CORE_COMMON_MOBILE_ERROR")},pattern:{value:/[6789][0-9]{9}/,message:m("CORE_COMMON_MOBILE_ERROR")}}),type:"number",componentInFront:l.createElement("div",{className:"employee-card-input employee-card-input--front"},"+91")}),l.createElement(t.CardLabelError,null,null==v||null===(i=v.errors)||void 0===i||null===(r=i.mobileNumber)||void 0===r?void 0:r.message)),l.createElement(t.SearchField,{className:"submit"},l.createElement(t.SubmitBar,{label:m("ES_COMMON_SEARCH"),submit:!0}),l.createElement("p",{style:{marginTop:"24px"},onClick:()=>{c({applicationNo:"",mobileNumber:"",offset:0,limit:10,sortBy:"createdTime",sortOrder:"DESC",isSubmitSuccessful:"false"}),s("offset",d("offset")-d("limit")),null==e||e.onSubmit({offset:0,limit:10,sortBy:"createdTime",sortOrder:"DESC",mobileNumber:null==p?void 0:p.mobileNumber},!0),null!=e&&e.isMobileView&&e.closeMobilePopupModal()}},m("ES_COMMON_CLEAR_ALL"))))},Yo=["currentlyActiveMobileModal"],Ko=["currentlyActiveMobileModal"],qo=e=>{var i,r;let{SearchFormFieldsComponent:u,propsMobileInboxCards:s,isLoading:d,data:m,onSubmit:p}=e;const{t:f}=o.useTranslation(),{handleSubmit:E}=a.useFormContext(),[g,_]=n.useReducer(function(e,t){switch(t.type){case"set":return t.payload;case"remove":return!1}},!1),h=()=>{_({type:"remove"})},A=()=>l.createElement("div",{className:"InboxMobilePopupCloseButtonWrapper",onClick:h},l.createElement(t.CloseSvg,null)),S=n.useCallback(e=>{let{currentlyActiveMobileModal:n}=e;return(e=>{let{currentlyActiveMobileModal:n}=e,i=v(e,Yo);const{closeMobilePopupModal:o}=i;switch(n){case"SearchFormComponent":return l.createElement(t.SearchForm,i,l.createElement(A,null),l.createElement("div",{className:"MobilePopupHeadingWrapper"},l.createElement("h2",null,f("ACTION_TEST_SEARCH_NOC_APPLICATION"),":")),l.createElement(u,{onSubmit:p,handleSubmit:E,isMobileView:!0,closeMobilePopupModal:o}));default:return l.createElement("span",null)}})(c({currentlyActiveMobileModal:n},v(e,Ko)))},[g]);return d?l.createElement(t.Loader,null):l.createElement(l.Fragment,null,l.createElement("div",{className:"searchBox"},l.createElement(t.SearchAction,{text:f("ES_COMMON_SEARCH"),handleActionClick:()=>_({type:"set",payload:"SearchFormComponent"})})),g?l.createElement(t.PopUp,null,l.createElement(S,{onSubmit:e=>{_({type:"remove"}),p(e)},handleSubmit:E,id:"search-form",className:"rm-mb form-field-flex-one inboxPopupMobileWrapper",currentlyActiveMobileModal:g,closeMobilePopupModal:h})):null,null!=m&&null!==(i=m[0])&&void 0!==i&&i.display?l.createElement(t.Card,{style:{marginTop:20}},f(null==m||null===(r=m[0])||void 0===r?void 0:r.display).split("\\n").map((e,t)=>l.createElement("p",{key:t,style:{textAlign:"center"}},e))):l.createElement(t.DetailsCard,{data:s,isTwoDynamicPrefix:!1,linkPrefix:"/digit-ui/citizen/noc/search/application-overview/",serviceRequestIdKey:f("NOC_APPLICATION_NUMBER")}))},Xo=e=>{let{columns:i,SearchFormFieldsComponent:r,onSubmit:u,data:s,isLoading:d,Count:c}=e;const{handleSubmit:v,setValue:m,getValues:p}=a.useFormContext();null==p("offset")&&m("offset",0),null==p("limit")&&m("limit",10);const[f,E]=n.useState(Number(p("offset"))/Number(p("limit"))),{t:g}=o.useTranslation(),_=()=>{m("offset",c&&10*Math.ceil(c/10)-p("limit")),v(u)()},h=()=>{m("offset",0),v(u)()},A=n.useCallback(e=>{0!==e.length&&(m("sortBy",e.id),m("sortOrder",e.desc?"DESC":"ASC"))},[]);function S(e){m("limit",Number(e.target.value)),v(u)()}function N(){m("offset",Number(p("offset"))+Number(p("limit"))),v(u)()}function b(){m("offset",Number(p("offset"))-Number(p("limit"))),v(u)()}n.useEffect(()=>{null!=p("offset")&&null!=p("limit")&&E(Number(p("offset"))/Number(p("limit")))},[p("offset"),p("limit")]);const C=()=>{return d?l.createElement(t.Loader,null):null!=s&&null!==(e=s[0])&&void 0!==e&&e.display?l.createElement(t.Card,{style:{marginTop:20}},g(null==s||null===(n=s[0])||void 0===n?void 0:n.display).split("\\n").map((e,t)=>l.createElement("p",{key:t,style:{textAlign:"center"}},e))):l.createElement(t.Table,{t:g,data:s,columns:i,getCellProps:e=>({style:{minWidth:e.column.Header===g("ES_INBOX_APPLICATION_NO")?"240px":"",padding:"20px 18px",fontSize:"16px"}}),onPageSizeChange:S,currentPage:f,onNextPage:N,onPrevPage:b,pageSizeLimit:Number(p("limit")),onSort:A,totalRecords:c,disableSort:!1,onLastPage:_,onFirstPage:h,sortParams:[{id:p("sortBy"),desc:"DESC"===p("sortOrder")}]});var e,n};return l.createElement(l.Fragment,null,l.createElement(t.SearchForm,{onSubmit:u,handleSubmit:v},l.createElement(r,{onSubmit:u,handleSubmit:v,isMobileView:!1})),l.createElement(C,null))},Jo=e=>{let{t:t,onSubmit:r,data:u,error:s,isLoading:d,Count:c}=e;const[v,m]=n.useState(null),p=a.useForm();n.useEffect(()=>{p.register("offset",0),p.register("limit",10),p.register("sortBy","createdTime"),p.register("sortOrder","DESC")},[p.register]);const f=(()=>{const{t:e}=o.useTranslation();return n.useMemo(()=>[{Header:e("NOC_APPLICATION_NUMBER"),accessor:"applicationNo",disableSortBy:!0,Cell:e=>{let{row:t}=e;return l.createElement("div",null,l.createElement("span",{className:"link"},l.createElement(i.Link,{to:"/digit-ui/citizen/noc/search/application-overview/"+t.original.applicationNo},t.original.applicationNo)))}},{Header:e("TL_COMMON_TABLE_COL_APP_DATE"),disableSortBy:!0,accessor:t=>e((null==t?void 0:t.date)||"-")},{Header:e("PT_COMMON_TABLE_COL_STATUS_LABEL"),accessor:t=>e((null==t?void 0:t.applicationStatus)||"-"),disableSortBy:!0}],[])})(),E=window.Digit.Utils.browser.isMobile(),g=n.useMemo(()=>null==u?void 0:u.map(e=>({[t("NOC_APPLICATION_NUMBER")]:(null==e?void 0:e.applicationNo)||"-",[t("TL_COMMON_TABLE_COL_APP_DATE")]:(null==e?void 0:e.date)||"-",[t("PT_COMMON_TABLE_COL_STATUS_LABEL")]:null!=e&&e.applicationStatus?t(""+e.applicationStatus):"-"})),[u]);return l.createElement(a.FormProvider,p,E?l.createElement(qo,{SearchFormFieldsComponent:Go,propsMobileInboxCards:g,isLoading:d,data:u,getRedirectionLink:()=>"noc/inbox/application-overview",onSubmit:r}):l.createElement(Xo,{columns:f,SearchFormFieldsComponent:Go,onSubmit:r,data:u,error:s,isLoading:d,Count:c}))},Qo=e=>{let{matchPath:n}=e;const{t:i}=o.useTranslation(),[a,r,u]=Digit.Hooks.useSessionStorage("NOC_MODULE",{});useEffect(()=>{u()},[]);const s=[{link:n+"/noc/new-application",i18nKey:i("NOC_NEW_APPLICATION")},{link:n+"/noc/my-application",i18nKey:i("NOC_MY_APPLICATION")},{link:n+"/noc/search-application",i18nKey:i("NOC_SEARCH_APPLICATION")}];return l.createElement(t.CitizenHomeCard,{header:i("ACTION_TEST_NOC"),links:s,Icon:()=>l.createElement(t.CaseIcon,{className:"fill-path-primary-main"})})},Zo=e=>{let{stateCode:n,userType:o,tenants:a}=e;const{path:r}=i.useRouteMatch(),u=Digit.StoreData.getCurrentLanguage(),{isLoading:s}=Digit.Services.useStore({stateCode:n,moduleCode:"NOC",language:u});return Digit.SessionStorage.set("NOC_TENANTS",a),s?l.createElement(t.Loader,null):"citizen"===o?l.createElement(hi,null):l.createElement(Ut,{path:r,stateCode:n})},$o={NOCModule:Zo,NOCCard:()=>{var e,a;const{t:r}=o.useTranslation(),u=i.useLocation(),s=Digit.ULBService.getCurrentTenantId();if(!Digit.Utils.NOCAccess())return null;const d={filterForm:{moduleName:"noc-services",applicationStatus:"",locality:[],assignee:"ASSIGNED_TO_ALL",businessServiceArray:f(!0)||[]},searchForm:{},tableForm:{limit:10,offset:0}},{isLoading:v,data:{totalCount:m,nearingSlaCount:p}={}}=Digit.Hooks.noc.useInbox({tenantId:s,filters:c({},d),config:{enabled:(null==d||null===(e=d.filterForm)||void 0===e||null===(a=e.businessServiceArray)||void 0===a?void 0:a.length)>0}}),E=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",height:"24",viewBox:"0 0 24 24",width:"24"},l.createElement("path",{d:"M0 0h24v24H0z",fill:"none"}),l.createElement("path",{d:"M20 2H4c-1.1 0-1.99.9-1.99 2L2 22l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-7 9h-2V5h2v6zm0 4h-2v-2h2v2z",fill:"white"}));n.useEffect(()=>{"/digit-ui/employee"===u.pathname&&Digit.SessionStorage.del("NOC.INBOX")},[u.pathname]);const g=n.useMemo(()=>({Icon:l.createElement(E,null),moduleName:r("ACTION_TEST_NOC"),kpis:[{count:v?"":m,label:r("TOTAL_FSM"),link:"/digit-ui/employee/obps/inbox"},{count:v?"-":p,label:r("TOTAL_NEARING_SLA"),link:"/digit-ui/employee/obps/inbox"}],links:[{count:m,label:r("ES_COMMON_INBOX"),link:"/digit-ui/employee/noc/inbox"},{label:r("ES_COMMON_APPLICATION_SEARCH"),link:"/digit-ui/employee/noc/search"}]}),[v,m]);return Digit.Utils.NOCAccess()?l.createElement(t.EmployeeModuleCard,g):null},NOCLinks:Qo,NOCApplicationOverview:()=>{var e,a,r,u,s,d,v,f,E;const{id:g}=i.useParams(),{t:_}=o.useTranslation(),h=Digit.ULBService.getCurrentTenantId(),A=null==h?void 0:h.split(".")[0],[S,N]=n.useState({}),[b,C]=n.useState(null),y={},[D]=n.useState(()=>(null==y?void 0:y.fileStoreId)||null),[L,O]=n.useState(null),[T,I]=n.useState([]),[w,P]=n.useState([]),[R,x]=n.useState([]),[B,F]=n.useState([]),[M,U]=n.useState([]),[k,W]=n.useState({}),[H,j]=n.useState(()=>[]),[z,V]=n.useState(!1),G=window.Digit.Utils.browser.isMobile(),{data:Y}=Digit.Hooks.obps.useMDMS(A,"NOC",["DocumentTypeMapping"]),{data:K}=Digit.Hooks.obps.useMDMS(A,"common-masters",["DocumentType"]),{isLoading:q,data:X}=Digit.Hooks.noc.useNOCDetails(_,h,{applicationNo:g}),{mutate:J}=Digit.Hooks.noc.useNOCApplicationActions(h),Q=Digit.Hooks.useWorkflowDetails({tenantId:h,id:g,moduleCode:"NOC"});var Z,$;null!=Q&&null!==(e=Q.data)&&void 0!==e&&null!==(a=e.actionState)&&void 0!==a&&a.nextActions&&!Q.isLoading&&(Q.data.actionState.nextActions=[...null==Q||null===(r=Q.data)||void 0===r?void 0:r.nextActions]),Q&&Q.data&&!Q.isLoading&&(Q.data.initialActionState=(null==Q||null===(Z=Q.data)||void 0===Z?void 0:Z.initialActionState)||c({},null==Q||null===($=Q.data)||void 0===$?void 0:$.actionState)||{},Q.data.actionState=c({},Q.data)),n.useEffect(()=>{P([null==X?void 0:X.applicationData])},[null==X?void 0:X.applicationData]),n.useEffect(()=>{var e;x(null==Y||null===(e=Y.NOC)||void 0===e?void 0:e.DocumentTypeMapping)},[Y]),n.useEffect(()=>{var e;F(null==K||null===(e=K["common-masters"])||void 0===e?void 0:e.DocumentType)},[K]),n.useEffect(()=>{sessionStorage.setItem("NewNOCDocs",JSON.stringify(M))},[M]),n.useEffect(()=>{if(null!=w&&w.length&&null!=R&&R.length){let e=[];w.map(t=>{var n,l;const i=R.filter(e=>(null==e?void 0:e.applicationType)===(null==t?void 0:t.applicationType)&&(null==e?void 0:e.nocType)===(null==t?void 0:t.nocType));null!=i&&null!==(n=i[0])&&void 0!==n&&null!==(l=n.docTypes)&&void 0!==l&&l[0]&&(i[0].docTypes[0].nocType=i[0].nocType,i[0].docTypes[0].additionalDetails={submissionDetails:t.additionalDetails,applicationStatus:t.applicationStatus,appNumberLink:t.applicationNo,nocNo:t.nocNo},e.push(i[0].docTypes[0]))});let t=[];e&&e.length>0&&e.map(e=>{let n=e.documentType;e.dropdownData=[],B.forEach(t=>{let l=t.code.slice(0,n.length);n===l&&(e.hasDropdown=!0,e.dropdownData.push(t))}),t.push(e)}),t.forEach(e=>{e.code=e.documentType,e.dropdownData.forEach(e=>{e.i18nKey=e.code})}),I(t)}},[w,R,B]),n.useEffect(()=>{var e,t;let n=[];null==w||null===(e=w[0])||void 0===e||null===(t=e.documents)||void 0===t||t.forEach((e,t,l)=>{n.push(null==e?void 0:e.fileStoreId)}),j(null==n?void 0:n.map(e=>e))},[null==w||null===(u=w[0])||void 0===u?void 0:u.documents]),n.useEffect(()=>{null!=H&&H.length&&Digit.UploadServices.Filefetch(H,Digit.ULBService.getStateId()).then(e=>{W(null==e?void 0:e.data)})},[H]);const ee=e=>{let{t:i,nocDataDetails:o,nocDocumentsList:a}=e;if(null!=o&&o.length&&null!=a&&a.length&&null!=(null==o?void 0:o[0])){var r,u,s,d,c,v,f,E,g,_,h,A,S,N,b,C,y,D,I,w;const e="WF_"+(null==o||null===(r=o[0])||void 0===r?void 0:r.additionalDetails.workflowCode)+"_"+(null==o||null===(u=o[0])||void 0===u?void 0:u.applicationStatus);return l.createElement(n.Fragment,null,l.createElement("div",{style:{border:"1px solid #D6D5D4",background:"#FAFAFA",boxSizing:"border-box",borderRadius:"4px",padding:"8px",maxWidth:"950px",minWidth:"280px"}},l.createElement(t.CardSectionHeader,{style:{marginBottom:"16px",fontSize:"20px"}},""+i("NOC_MAIN_"+p(null==a||null===(s=a[0])||void 0===s?void 0:s.code,".","_")+"_LABEL")),l.createElement(t.StatusTable,{style:{position:"relative",marginTop:"19px"}},l.createElement(t.Row,{className:"border-none",label:""+i("NOC_"+(null==o||null===(d=o[0])||void 0===d?void 0:d.nocType)+"_APPLICATION_LABEL"),text:i(null==o||null===(c=o[0])||void 0===c?void 0:c.applicationNo)||"NA"}),l.createElement(t.Row,{className:"border-none",label:""+i("NOC_STATUS_LABEL"),text:i(e)||"NA",textStyle:"APPROVED"==(null==o||null===(v=o[0])||void 0===v?void 0:v.applicationStatus)||"AUTO_APPROVED"==(null==o||null===(f=o[0])||void 0===f?void 0:f.applicationStatus)?{color:"#00703C"}:{color:"#D4351C"}}),l.createElement(t.Row,{className:"border-none",label:""+i("NOC_SUBMITED_ON_LABEL"),text:null!=o&&null!==(E=o[0])&&void 0!==E&&null!==(g=E.additionalDetails)&&void 0!==g&&g.SubmittedOn?m(Number(null==o||null===(_=o[0])||void 0===_||null===(h=_.additionalDetails)||void 0===h?void 0:h.SubmittedOn)):"NA"}),l.createElement(t.Row,{className:"border-none",label:""+i("NOC_APPROVAL_NO_LABEL"),text:(null==o||null===(A=o[0])||void 0===A?void 0:A.nocNo)||"NA"}),l.createElement(t.Row,{className:"border-none",label:""+i("NOC_APPROVED_ON_LABEL"),text:"APPROVED"===e||"REJECTED"===e||"AUTO_APPROVED"===e||"AUTO_REJECTED"===e?m(Number(null==o||null===(S=o[0])||void 0===S||null===(N=S.auditDetails)||void 0===N?void 0:N.lastModifiedTime)):"NA"}),l.createElement(t.Row,{className:"border-none",label:""+i("Documents"),text:""})),null!=o&&null!==(b=o[0])&&void 0!==b&&b.documents&&(null==o||null===(C=o[0])||void 0===C?void 0:C.documents.length)>0?l.createElement("div",{style:{display:"flex",flexWrap:"wrap",justifyContent:"flex-start"}},null==o||null===(y=o[0])||void 0===y||null===(D=y.documents)||void 0===D?void 0:D.map((e,n)=>{var o,r;return l.createElement("a",{target:"_",href:null===(o=k[e.fileStoreId])||void 0===o?void 0:o.split(",")[0],style:{minWidth:"80px",marginRight:"10px",maxWidth:"100px",height:"auto"},key:n},l.createElement("div",{style:{display:"flex",justifyContent:"center"}},l.createElement(t.PDFSvg,null)),l.createElement("p",{style:{marginTop:"8px",fontWeight:"bold",textAlign:"center",width:"100px",color:"#505A5F"}},i("NOC_MAIN_"+p(null==a||null===(r=a[0])||void 0===r?void 0:r.code,".","_")+"_LABEL")))})):l.createElement("div",null,l.createElement("p",null,i("BPA_NO_DOCUMENTS_UPLOADED_LABEL"))),l.createElement("div",null,(null==Q||null===(I=Q.data)||void 0===I||null===(w=I.nextActions)||void 0===w?void 0:w.length)>0?null==T?void 0:T.map((e,t)=>l.createElement(ml,{key:t,document:e,t:i,error:L,setError:O,setNocDocuments:U,nocDocuments:M})):null)))}return l.createElement(t.Loader,null)},te=function(e){return void 0===e&&(e=[]),e.map(e=>({title:e.title,belowComponent:()=>l.createElement(n.Fragment,null,l.createElement("div",{style:{maxWidth:"950px"}},l.createElement(t.StatusTable,{style:{position:"relative",marginTop:"19px"}},e.values.map(e=>l.createElement(t.Row,{className:"border-none",label:""+_(null==e?void 0:e.title),text:(null==e?void 0:e.value)||"NA"})))))}))};return n.useEffect(()=>{if(X){var e;V(!0);const{applicationDetails:t}=X;N(c({},X,{applicationDetails:[null===(e=te(t))||void 0===e?void 0:e[0],{title:"NOC_DETAILS_SUMMARY_LABEL",belowComponent:()=>l.createElement(ee,{t:_,data:X,nocDataDetails:w,nocDocumentsList:T})}]})),V(!1)}},[X,T,w,D,H,k]),l.createElement("div",{className:"employee-main-application-details"},l.createElement("div",null,l.createElement(t.Header,{styles:{fontSize:"32px"}},_("NOC_APP_OVER_VIEW_HEADER"))),l.createElement(vl,{applicationDetails:S,isLoading:q||z,isDataLoading:q,applicationData:null==X?void 0:X.applicationData,mutate:J,workflowDetails:Q,businessService:null!=Q&&null!==(s=Q.data)&&void 0!==s&&s.applicationBusinessService?null==Q||null===(d=Q.data)||void 0===d?void 0:d.applicationBusinessService:null==X||null===(v=X.applicationData)||void 0===v?void 0:v.businessService,moduleCode:"NOC",ActionBarStyle:G?{}:{paddingRight:"50px"},MenuStyle:G?{}:{right:"50px"},showToast:b,setShowToast:C,closeToast:()=>{C(null)},timelineStatusPrefix:"WF_"+(null==X||null===(f=X.applicationData)||void 0===f||null===(E=f.additionalDetails)||void 0===E?void 0:E.workflowCode)+"_"}))},NOCInbox:e=>{let{parentRoute:r}=e;const{t:u}=o.useTranslation(),s=window.localStorage.getItem("Employee.tenant-id"),d={mobileNumber:"",applicationNo:""},v={moduleName:"noc-service",applicationStatus:[],businessService:"obpas_noc",locality:[],assignee:"ASSIGNED_TO_ALL",businessServiceArray:f(!0)||[]},m={sortBy:"",limit:window.Digit.Utils.browser.isMobile()?50:10,offset:0,sortOrder:"DESC"},p=Digit.SessionStorage.get("NOC.INBOX"),E=n.useMemo(()=>p||{filterForm:v,searchForm:d,tableForm:m},[Object.values((null==p?void 0:p.filterForm)||{}),Object.values((null==p?void 0:p.searchForm)||{}),Object.values((null==p?void 0:p.tableForm)||{})]),[g,_]=n.useReducer(function(e,t){switch(t.action){case"mutateSearchForm":return Digit.SessionStorage.set("NOC.INBOX",c({},e,{searchForm:t.data})),c({},e,{searchForm:t.data});case"mutateFilterForm":return Digit.SessionStorage.set("NOC.INBOX",c({},e,{filterForm:t.data})),c({},e,{filterForm:t.data});case"mutateTableForm":return Digit.SessionStorage.set("NOC.INBOX",c({},e,{tableForm:t.data})),c({},e,{tableForm:t.data})}},E),{data:h,isLoading:A}=Digit.Hooks.useBoundaryLocalities(s,"revenue",{},u),{isLoading:S,data:N}=Digit.Hooks.noc.useInbox({tenantId:s,filters:c({},g)});n.useEffect(()=>{N&&N.revalidate()},[]);const[b,C]=n.useState([]),[y,D]=n.useState([]),[L,O]=n.useState(0);n.useEffect(()=>{N&&(D((null==N?void 0:N.statuses)||[]),C((null==N?void 0:N.table)||[]),O((null==N?void 0:N.totalCount)||0))},[N]);const T={logoIcon:l.createElement(t.ComplaintIcon,null),headerText:"ACTION_TEST_NOC",links:[{text:u("NOC_NEW_APPLICATION"),link:"/digit-ui/employee/noc/new-application"}]},I=n.useCallback(e=>{let{registerRef:t,searchFormState:n,searchFieldComponents:i}=e;return l.createElement(bl,{registerRef:t,searchFormState:n,searchFieldComponents:i})},[]),w=n.useCallback(e=>{let{registerRef:t,controlFilterForm:n,setFilterFormValue:i,getFilterFormValue:o}=e;return l.createElement(Cl,{statuses:y,isInboxLoading:S,registerRef:t,controlFilterForm:n,setFilterFormValue:i,filterFormState:null==g?void 0:g.filterForm,getFilterFormValue:o,localitiesForEmployeesCurrentTenant:h,loadingLocalitiesForEmployeesCurrentTenant:A})},[y,S,h,A]),P={SearchFormFields:I,onSearchFormSubmit:e=>{console.log("data in OnSearchFormSubmit",e),e.hasOwnProperty("")&&(null==e||delete e[""]),_({action:"mutateTableForm",data:c({},m)}),_({action:"mutateSearchForm",data:e})},searchFormDefaultValues:null==g?void 0:g.searchForm,resetSearchFormDefaultValues:d,onSearchFormReset:e=>{e("mobileNumber",null),e("applicationNo",null),_({action:"mutateSearchForm",data:d})}},R={FilterFormFields:w,onFilterFormSubmit:e=>{console.log("data in OnFilterFormSubmit",e),e.hasOwnProperty("")&&(null==e||delete e[""]),_({action:"mutateTableForm",data:c({},m)}),_({action:"mutateFilterForm",data:e})},filterFormDefaultValues:null==g?void 0:g.filterForm,resetFilterFormDefaultValues:v,onFilterFormReset:e=>{e("moduleName","noc-service"),e("applicationStatus",""),e("locality",[]),e("assignee","ASSIGNED_TO_ALL"),e("applicationType",[]),_({action:"mutateFilterForm",data:v})}},x=(e=>{var t,a,r,u;let{parentRoute:s,onPageSizeChange:d,formState:v,totalCount:m,table:p,dispatch:f,onSortingByData:E}=e;const{t:g}=o.useTranslation(),_=n.useMemo(()=>[{Header:g("NOC_APPLICATION_NUMBER"),accessor:"applicationNo",disableSortBy:!0,Cell:e=>{let{row:t}=e;return l.createElement("div",null,l.createElement(i.Link,{to:s+"/inbox/application-overview/"+t.original.applicationId},l.createElement("span",{className:"link"},t.original.applicationId)))}},{Header:g("TL_COMMON_TABLE_COL_APP_DATE"),accessor:"applicationDate",Cell:e=>{var t,n;let{row:i}=e;return null!==(t=i.original)&&void 0!==t&&t.date?(e=>l.createElement("span",{className:"cell-text styled-cell"},e))(mi(new Date(null===(n=i.original)||void 0===n?void 0:n.date),"dd/MM/yyyy")):""}},{Header:g("PT_COMMON_TABLE_COL_STATUS_LABEL"),accessor:e=>g(null==e?void 0:e.status),disableSortBy:!0}]);return{getCellProps:e=>({style:{padding:"20px 18px",fontSize:"16px"}}),disableSort:!1,autoSort:!1,manualPagination:!0,initSortId:"applicationDate",onPageSizeChange:d,currentPage:(null===(t=v.tableForm)||void 0===t?void 0:t.offset)/(null===(a=v.tableForm)||void 0===a?void 0:a.limit),onNextPage:()=>{var e,t;return f({action:"mutateTableForm",data:c({},v.tableForm,{offset:parseInt(null===(e=v.tableForm)||void 0===e?void 0:e.offset)+parseInt(null===(t=v.tableForm)||void 0===t?void 0:t.limit)})})},onPrevPage:()=>{var e,t;return f({action:"mutateTableForm",data:c({},v.tableForm,{offset:parseInt(null===(e=v.tableForm)||void 0===e?void 0:e.offset)-parseInt(null===(t=v.tableForm)||void 0===t?void 0:t.limit)})})},pageSizeLimit:null===(r=v.tableForm)||void 0===r?void 0:r.limit,onSort:E,totalRecords:m,onSearch:null==v||null===(u=v.searchForm)||void 0===u?void 0:u.message,onLastPage:()=>{var e;return f({action:"mutateTableForm",data:c({},v.tableForm,{offset:10*Math.ceil(m/10)-parseInt(null===(e=v.tableForm)||void 0===e?void 0:e.limit)})})},onFirstPage:()=>f({action:"mutateTableForm",data:c({},v.tableForm,{offset:0})}),data:p,columns:_}})(c({},{parentRoute:r,onPageSizeChange:e=>{_({action:"mutateTableForm",data:c({},g.tableForm,{limit:e.target.value})})},formState:g,totalCount:L,table:b,dispatch:_,onSortingByData:e=>{if(e.length>0){const[{id:t,desc:n}]=e,l=n?"DESC":"ASC";g.tableForm.sortBy===t&&g.tableForm.sortOrder===l||_({action:"mutateTableForm",data:c({},g.tableForm,{sortBy:t,sortOrder:n?"DESC":"ASC"})})}}})),B=(e=>{let{parentRoute:n,table:i}=e;const{t:r}=o.useTranslation();return{data:null==i?void 0:i.map(e=>{let{applicationId:t,date:n,status:l}=e;return{[r("NOC_APPLICATION_NUMBER")]:t,[r("TL_COMMON_TABLE_COL_APP_DATE")]:mi(new Date(n),"dd/MM/yyyy"),[r("PT_COMMON_TABLE_COL_STATUS_LABEL")]:r(l)}}),linkPrefix:n+"/inbox/application-overview/",serviceRequestIdKey:r("NOC_APPLICATION_NUMBER"),MobileSortFormValues:()=>{const e=[{code:"DESC",i18nKey:"ES_COMMON_SORT_BY_DESC"},{code:"ASC",i18nKey:"ES_COMMON_SORT_BY_ASC"}],{control:n}=a.useFormContext();return l.createElement(t.SearchField,null,l.createElement(a.Controller,{name:"sortOrder",control:n,render:n=>{let{onChange:i,value:o}=n;return l.createElement(t.RadioButtons,{onSelect:e=>{i(e.code)},selectedOption:e.filter(e=>e.code===o)[0],optionsKey:"i18nKey",name:"sortOrder",options:e})}}))}}})({parentRoute:r,table:b}),F={onMobileSortOrderData:e=>{const{sortOrder:t}=e;_({action:"mutateTableForm",data:c({},g.tableForm,{sortOrder:t})})},sortFormDefaultValues:null==g?void 0:g.tableForm,onSortFormReset:e=>{e("sortOrder","DESC"),_({action:"mutateTableForm",data:m})}};return l.createElement(n.Fragment,null,l.createElement(t.Header,null,u("ES_COMMON_INBOX"),L?l.createElement("p",{className:"inbox-count"},L):null),l.createElement(t.InboxComposer,c({isInboxLoading:S,PropsForInboxLinks:T},P,R,F,{propsForInboxTable:x,propsForInboxMobileCards:B,formState:g})))},NOCSearchApplication:Dt,NewNOCStepperForm:()=>{i.useHistory();const{t:e}=o.useTranslation(),a=s.useDispatch(),[r,u]=n.useState(null),d=s.useSelector(e=>e.noc.NOCNewApplicationFormReducer).step;return Digit.ULBService.getCurrentTenantId(),n.useEffect(()=>{a({type:"RESET_NOC_NEW_APPLICATION_FORM"})},[]),l.createElement("div",{className:"pageCard"},l.createElement(t.CardHeader,{styles:{fontSize:"28px",fontWeight:"400",color:"#1C1D1F"},divider:!0},e("NOC_REGISTRATION_APPLICATION")),l.createElement(Si,{stepsList:Di,onSubmit:e=>{console.log("dataGet===",e)},step:d,setStep:e=>{a(Ci(e))}}),r&&l.createElement(t.Toast,{error:r.key,label:e(r.label),onClose:()=>{u(null)},isDleteBtn:"true"}))},NewNOCStepFormOne:e=>{var i,r,u;let{config:d,onGoNext:v,onBackClick:m}=e;const p=s.useDispatch(),{t:f}=o.useTranslation(),[E,g]=n.useState(null),[_,h]=n.useState(""),A=s.useSelector(function(e){return e.noc.NOCNewApplicationFormReducer.formData}),S=Digit.UserService.getUser(),{control:N,handleSubmit:b,setValue:C,formState:{errors:y},trigger:D,reset:L}=a.useForm(),O={Controller:a.Controller,control:N,setValue:C,errors:y,trigger:D,errorStyle:{width:"70%",marginLeft:"30%",fontSize:"12px",marginTop:"-21px"},reset:L};function T(e){p(bi(d.key,e)),v()}function I(e){m(d.key,e)}const[w,P]=n.useState((null==A||null===(i=A.applicationDetails)||void 0===i?void 0:i.isRegisteredStakeHolder)||!1),R=Digit.ULBService.getStateId(),[x,B]=n.useState(!1),F=null==S||null===(r=S.info)||void 0===r||null===(u=r.roles)||void 0===u?void 0:u.map(e=>e.code),{data:M,isLoading:U}=Digit.Hooks.obps.useMDMS(R,"StakeholderRegistraition","TradeTypetoRoleMapping");return n.useEffect(()=>{if(!U){var e,t;let n=[];null==M||null===(e=M.StakeholderRegistraition)||void 0===e||null===(t=e.TradeTypetoRoleMapping)||void 0===t||t.map(e=>{var t;null==e||null===(t=e.role)||void 0===t||t.map(e=>{n.push(e)})});const l=null==n?void 0:n.filter((e,t,n)=>n.indexOf(e)===t);null==l||l.map(e=>{null!=F&&F.includes(e)&&P(!0)})}},[U]),n.useEffect(()=>{var e;null!=A&&null!==(e=A.applicationDetails)&&void 0!==e&&e.isRegisteredStakeHolder&&C("isRegisteredStakeHolder","true")},[]),l.createElement(l.Fragment,null,l.createElement("form",{onSubmit:b(e=>{D(),y.length>0?console.log("Plz fill mandatory fields in Step1"):T(e)})},l.createElement("div",{className:"employeeCard"},w?l.createElement(l.Fragment,null,l.createElement(Oi,c({onGoBack:I,goNext:T,currentStepData:A,t:f},O)),l.createElement(Li,c({onGoBack:I,goNext:T,currentStepData:A,t:f},O))):l.createElement(l.Fragment,null,l.createElement(Li,c({onGoBack:I,goNext:T,currentStepData:A,t:f},O)))),l.createElement(t.ActionBar,null,l.createElement(t.SubmitBar,{label:"Next",submit:"submit"}))),E&&l.createElement(t.Toast,{isDleteBtn:!0,error:!0,label:_,onClose:()=>{g(null),h("")}}))},NewNOCStepFormTwo:e=>{let{config:i,onBackClick:r,onGoNext:u}=e;const{t:d}=o.useTranslation(),v=s.useDispatch(),[m,p]=n.useState(null),[f,E]=n.useState(""),{control:g,handleSubmit:_,setValue:h,formState:{errors:A},trigger:S,watch:N}=(Digit.UserService.getUser(),a.useForm({defaultValues:{floorArea:[{value:""}]}})),b=s.useSelector(function(e){return e.noc.NOCNewApplicationFormReducer.formData}),C={Controller:a.Controller,control:g,setValue:h,errors:A,errorStyle:{width:"70%",marginLeft:"30%",fontSize:"12px",marginTop:"-21px"},useFieldArray:a.useFieldArray,watch:N};let y;function D(e){v(bi(i.key,e)),u()}function L(e){r(i.key,e)}return y=window.location.href.includes("citizen")?window.localStorage.getItem("CITIZEN.CITY"):window.localStorage.getItem("Employee.tenant-id"),l.createElement(l.Fragment,null,l.createElement("form",{onSubmit:_(e=>{var t,n,l;S(),(null==e?void 0:e.netTotalArea)!==(null==e?void 0:e.specificationPlotArea)?p({key:"true",error:!0,message:"NOC_PLOT_AREA_SUM_VALIDATION_MESG_LABEL"}):(v(bi(i.key,e)),null!=b&&null!==(t=b.apiData)&&void 0!==t&&null!==(n=t.Noc)&&void 0!==n&&null!==(l=n[0])&&void 0!==l&&l.applicationNo?u():function(e){try{var t,n,l,i,o,a,r,s,d,m,f,E,g,_,h,A,S,N,b,C,D,L,O,T,I,w;const P={applicationDetails:c({},null==e?void 0:e.applicationDetails,{applicantGender:(null==e||null===(t=e.applicationDetails)||void 0===t||null===(n=t.applicantGender)||void 0===n?void 0:n.code)||""}),siteDetails:c({},null==e?void 0:e.siteDetails,{ulbName:(null==e||null===(l=e.siteDetails)||void 0===l||null===(i=l.ulbName)||void 0===i?void 0:i.name)||"",roadType:(null==e||null===(o=e.siteDetails)||void 0===o||null===(a=o.roadType)||void 0===a?void 0:a.name)||"",buildingStatus:(null==e||null===(r=e.siteDetails)||void 0===r||null===(s=r.buildingStatus)||void 0===s?void 0:s.name)||"",isBasementAreaAvailable:(null==e||null===(d=e.siteDetails)||void 0===d||null===(m=d.isBasementAreaAvailable)||void 0===m?void 0:m.code)||"",district:(null==e||null===(f=e.siteDetails)||void 0===f||null===(E=f.district)||void 0===E?void 0:E.name)||"",zone:(null==e||null===(g=e.siteDetails)||void 0===g||null===(_=g.zone)||void 0===_?void 0:_.name)||"",specificationBuildingCategory:(null==e||null===(h=e.siteDetails)||void 0===h||null===(A=h.specificationBuildingCategory)||void 0===A?void 0:A.name)||"",specificationNocType:(null==e||null===(S=e.siteDetails)||void 0===S||null===(N=S.specificationNocType)||void 0===N?void 0:N.name)||"",specificationRestrictedArea:(null==e||null===(b=e.siteDetails)||void 0===b||null===(C=b.specificationRestrictedArea)||void 0===C?void 0:C.code)||"",specificationIsSiteUnderMasterPlan:(null==e||null===(D=e.siteDetails)||void 0===D||null===(L=D.specificationIsSiteUnderMasterPlan)||void 0===L?void 0:L.code)||""})},R={mobileNumber:(null==P||null===(O=P.applicationDetails)||void 0===O?void 0:O.applicantMobileNumber)||"",name:(null==P||null===(T=P.applicationDetails)||void 0===T?void 0:T.applicantOwnerOrFirmName)||"",emailId:(null==P||null===(I=P.applicationDetails)||void 0===I?void 0:I.applicantEmailId)||"",userName:(null==P||null===(w=P.applicationDetails)||void 0===w?void 0:w.applicantMobileNumber)||""},x={Noc:{applicationType:"NEW",documents:[],nocType:"NOC",status:"ACTIVE",tenantId:y,owners:[R],workflow:{action:"INITIATE"},nocDetails:{additionalDetails:P,tenantId:y}}};console.log("final Payload here==>",x);const B=kt(function(){return Promise.resolve(Digit.NOCService.NOCcreate({tenantId:y,details:x})).then(function(e){var t;"successful"===(null==e||null===(t=e.ResponseInfo)||void 0===t?void 0:t.status)?(console.log("success :create api executed successfully !!!"),v(bi("apiData",e)),u()):(console.error("error : create api not executed properly !!!"),p({key:"true",error:!0,message:"COMMON_SOMETHING_WENT_WRONG_LABEL"}))})},function(e){console.log("errors here in goNext - catch block",e),p({key:"true",error:!0,message:"COMMON_SOME_ERROR_OCCURRED_LABEL"})});Promise.resolve(B&&B.then?B.then(function(){}):void 0)}catch(e){return Promise.reject(e)}}(c({},b,{siteDetails:c({},e)})))})},l.createElement("div",{className:"employeeCard"},l.createElement(Ti,c({onGoBack:L,goNext:D,currentStepData:b,t:d},C)),l.createElement(Ii,c({onGoBack:L,goNext:D,currentStepData:b,t:d},C))),l.createElement(t.ActionBar,null,l.createElement(t.SubmitBar,{style:{background:" white",color:"black",border:"1px solid",marginRight:"10px"},label:"Back",onSubmit:L}),l.createElement(t.SubmitBar,{label:"Next",submit:"submit"}))),m&&l.createElement(t.Toast,{isDleteBtn:!0,error:null==m?void 0:m.error,warning:null==m?void 0:m.warning,label:d(null==m?void 0:m.message),onClose:()=>{p(null)}}))},NewNOCStepFormThree:e=>{let{config:i,onGoNext:o,onBackClick:a,t:r}=e;const u=s.useDispatch(),[d,c]=n.useState(!1),[v,m]=n.useState(""),p=Digit.ULBService.getStateId(),{isLoading:f,data:E}=Digit.Hooks.pt.usePropertyMDMS(p,"NOC",["Documents"]),g=s.useSelector(function(e){return e.noc.NOCNewApplicationFormReducer.formData&&e.noc.NOCNewApplicationFormReducer.formData[null==i?void 0:i.key]?e.noc.NOCNewApplicationFormReducer.formData[null==i?void 0:i.key]:{}}),_=s.useSelector(function(e){var t,n;return(null==e||null===(t=e.noc)||void 0===t||null===(n=t.NOCNewApplicationFormReducer)||void 0===n?void 0:n.coordinates)||{}});console.log("coordinates from redux",_);const h=s.useSelector(e=>{var t,n;return null==e||null===(t=e.noc)||void 0===t||null===(n=t.NOCNewApplicationFormReducer)||void 0===n?void 0:n.formData})||{};return l.createElement(l.Fragment,null,l.createElement(t.FormComposer,{defaultValues:g,config:i.currStepConfig,onSubmit:function(e){var t,n,l,i;const a=function(e){if(!f){var t,n,l,i,o;const a="VACANT"===(null==h||null===(t=h.siteDetails)||void 0===t||null===(n=t.buildingStatus)||void 0===n?void 0:n.code)?null==E||null===(l=E.NOC)||void 0===l?void 0:l.Documents.filter(e=>"OWNER.BUILDINGDRAWING"!==e.code):null==E||null===(i=E.NOC)||void 0===i?void 0:i.Documents,r=(null==e||null===(o=e.documents)||void 0===o?void 0:o.documents)||[],u=a.filter(e=>e.required).map(e=>e.code),s=r.map(e=>e.documentType);return u.filter(e=>!s.includes(e))}}(e);return a.length>0?(m(r("NOC_PLEASE_ATTACH_LABEL")+" "+r(a[0].replace(".","_").toUpperCase())),void c(!0)):null!=_&&null!==(t=_.Latitude1)&&void 0!==t&&t.trim()&&null!=_&&null!==(n=_.Latitude2)&&void 0!==n&&n.trim()&&null!=_&&null!==(l=_.Longitude1)&&void 0!==l&&l.trim()&&null!=_&&null!==(i=_.Longitude2)&&void 0!==i&&i.trim()?void o():(m(""+r("NOC_PLEASE_ATTACH_GEO_TAGGED_PHOTOS_LABEL")),void c(!0))},onFormValueChange:function(e,t){At.isEqual(t,g)||u(bi(i.key,t))},label:r(""+i.texts.submitBarLabel),currentStep:i.currStepNumber,onBackClick:function(e){a(i.key,e)}}),d&&l.createElement(t.Toast,{isDleteBtn:!0,error:!0,label:v,onClose:()=>{c(!1),m("")}}))},NewNOCStepFormFour:e=>{var o,a,r,u,d,v,m,p,f,E,g,_,h,A;let{config:S,onBackClick:N,t:b}=e;s.useDispatch();const[C,y]=n.useState(null),[D,L]=n.useState(""),[O,T]=n.useState(!1);console.log("selectedCheckBox",O);const I=s.useSelector(function(e){var t,n;return(null==e||null===(t=e.noc)||void 0===t||null===(n=t.NOCNewApplicationFormReducer)||void 0===n?void 0:n.formData)||{}}),w=s.useSelector(function(e){var t,n;return(null==e||null===(t=e.noc)||void 0===t||null===(n=t.NOCNewApplicationFormReducer)||void 0===n?void 0:n.coordinates)||{}}),P=n.useRef();let R=Digit.UserService.getUser();const x=null==R||null===(o=R.info)||void 0===o||null===(a=o.roles)||void 0===a?void 0:a.map(e=>e.code),[B,F]=n.useState(!1);Digit.Hooks.useClickOutside(P,()=>{F(!1)},B);const M=i.useHistory();let U;U=window.location.href.includes("citizen")?window.localStorage.getItem("CITIZEN.CITY"):window.localStorage.getItem("Employee.tenant-id");const k=e=>{console.log("formData in parent SummaryPage",I),W(I,e)},W=function(e,t){try{if(console.log("formData inside onSubmit",e),window.location.pathname.includes("edit")&&"EDIT"===t.action)return y({key:"true",warning:!0,message:"COMMON_SAVE_OR_RESUBMIT_LABEL"}),Promise.resolve();const n=function(e,t){var n,l,i,o,a,r,u,s,d,v,m,p,f,E,g,_,h,A,S,N,b,C,y,D,L,O,T,I,P,R,x,B;console.log("nocFormData",e);const F=c({},null==e||null===(n=e.apiData)||void 0===n||null===(l=n.Noc)||void 0===l?void 0:l[0],{workflow:{action:(null==t?void 0:t.action)||""},nocDetails:c({},null==e||null===(i=e.apiData)||void 0===i||null===(o=i.Noc)||void 0===o||null===(a=o[0])||void 0===a?void 0:a.nocDetails,{additionalDetails:c({},null==e||null===(r=e.apiData)||void 0===r||null===(u=r.Noc)||void 0===u||null===(s=u[0])||void 0===s?void 0:s.nocDetails.additionalDetails,{applicationDetails:c({},null==e?void 0:e.applicationDetails,{applicantGender:(null==e||null===(d=e.applicationDetails)||void 0===d||null===(v=d.applicantGender)||void 0===v?void 0:v.code)||""}),siteDetails:c({},null==e?void 0:e.siteDetails,{ulbName:(null==e||null===(m=e.siteDetails)||void 0===m||null===(p=m.ulbName)||void 0===p?void 0:p.name)||"",roadType:(null==e||null===(f=e.siteDetails)||void 0===f||null===(E=f.roadType)||void 0===E?void 0:E.name)||"",buildingStatus:(null==e||null===(g=e.siteDetails)||void 0===g||null===(_=g.buildingStatus)||void 0===_?void 0:_.name)||"",isBasementAreaAvailable:(null==e||null===(h=e.siteDetails)||void 0===h||null===(A=h.isBasementAreaAvailable)||void 0===A?void 0:A.code)||"",district:(null==e||null===(S=e.siteDetails)||void 0===S||null===(N=S.district)||void 0===N?void 0:N.name)||"",zone:(null==e||null===(b=e.siteDetails)||void 0===b||null===(C=b.zone)||void 0===C?void 0:C.name)||"",specificationBuildingCategory:(null==e||null===(y=e.siteDetails)||void 0===y||null===(D=y.specificationBuildingCategory)||void 0===D?void 0:D.name)||"",specificationNocType:(null==e||null===(L=e.siteDetails)||void 0===L||null===(O=L.specificationNocType)||void 0===O?void 0:O.name)||"",specificationRestrictedArea:(null==e||null===(T=e.siteDetails)||void 0===T||null===(I=T.specificationRestrictedArea)||void 0===I?void 0:I.code)||"",specificationIsSiteUnderMasterPlan:(null==e||null===(P=e.siteDetails)||void 0===P||null===(R=P.specificationIsSiteUnderMasterPlan)||void 0===R?void 0:R.code)||""}),coordinates:c({},w)})}),documents:[]});return((null==e||null===(x=e.documents)||void 0===x||null===(B=x.documents)||void 0===B?void 0:B.documents)||[]).forEach(e=>{F.documents.push({uuid:null==e?void 0:e.documentUid,documentType:null==e?void 0:e.documentType,documentAttachment:null==e?void 0:e.filestoreId})}),{Noc:c({},F)}}(e,t);console.log("finalPayload here==>",n);const l=kt(function(){return Promise.resolve(Digit.NOCService.NOCUpdate({tenantId:U,details:n})).then(function(e){var n,l,i,o,a,r;"successful"===(null==e||null===(n=e.ResponseInfo)||void 0===n?void 0:n.status)?(console.log("success: Update API "),window.location.href.includes("citizen")?"CANCEL"==t.action?(y({key:"true",success:!0,message:"COMMON_APPLICATION_CANCELLED_LABEL"}),setTimeout(()=>{M.push("/digit-ui/citizen/noc/my-application")},3e3)):(console.log("We are calling citizen response page"),M.replace({pathname:"/digit-ui/citizen/noc/response/"+(null==e||null===(l=e.Noc)||void 0===l||null===(i=l[0])||void 0===i?void 0:i.applicationNo),state:{data:e}})):(console.log("we are calling employee response page"),"CANCEL"===t.action?(y({key:"true",success:!0,message:"COMMON_APPLICATION_CANCELLED_LABEL"}),setTimeout(()=>{M.push("/digit-ui/employee/noc/inbox")},3e3)):M.replace({pathname:"/digit-ui/employee/noc/response/"+(null==e||null===(o=e.Noc)||void 0===o||null===(a=o[0])||void 0===a?void 0:a.applicationNo),state:{data:e}}))):(console.error("Submission failed, not moving to next step.",null===(r=res)||void 0===r?void 0:r.response),y({key:"true",error:!0,message:"COMMON_SOMETHING_WENT_WRONG_LABEL"}))})},function(e){console.log("errors here in goNext - catch block",e),y({key:"true",error:!0,message:"COMMON_SOME_ERROR_OCCURRED_LABEL"})});return Promise.resolve(l&&l.then?l.then(function(){}):void 0)}catch(e){return Promise.reject(e)}};function H(e){N(S.key,e)}console.log("currentStepData in StepFour",I);const j=(null==I||null===(r=I.apiData)||void 0===r||null===(u=r.Noc)||void 0===u||null===(d=u[0])||void 0===d?void 0:d.applicationNo)||"";console.log("applicationNo here==>",j);const z=Digit.Hooks.useWorkflowDetails({tenantId:U,id:j,moduleCode:"obpas_noc"});console.log("workflow Details here==>",z);let V=(null==z||null===(v=z.data)||void 0===v||null===(m=v.actionState)||void 0===m||null===(p=m.nextActions)||void 0===p?void 0:p.filter(e=>(null==x?void 0:x.some(t=>{var n;return null===(n=e.roles)||void 0===n?void 0:n.includes(t)}))||!e.roles))||(null==z||null===(f=z.data)||void 0===f||null===(E=f.nextActions)||void 0===E?void 0:E.filter(e=>(null==x?void 0:x.some(t=>{var n;return null===(n=e.roles)||void 0===n?void 0:n.includes(t)}))||!e.roles));return console.log("actions here",V),l.createElement(l.Fragment,null,l.createElement(Pi,{onGoBack:H,goNext:k,currentStepData:I,t:b}),l.createElement(t.CheckBox,{label:"I hereby solemnly affirm and declare that I am submitting this application on behalf of the applicant ("+((null==I||null===(g=I.applicationDetails)||void 0===g?void 0:g.applicantOwnerOrFirmName)||"NA")+"). I along with with the applicant have read the Policy and understand all the terms and conditions of the Policy. We are committed to fulfill/abide by all the terms and conditions of the Policy. The information/documents submitted are true and correct as per record and no part of it is false and nothing has been concealed/misrepresented therein.",onChange:e=>function(e){T(e.target.checked)}(e),value:O,checked:O}),V&&l.createElement(t.ActionBar,null,l.createElement(t.SubmitBar,{style:{background:" white",color:"black",border:"1px solid",marginRight:"10px"},label:"Back",onSubmit:H}),B&&(null!=z&&null!==(_=z.data)&&void 0!==_&&null!==(h=_.actionState)&&void 0!==h&&h.nextActions||null!=z&&null!==(A=z.data)&&void 0!==A&&A.nextActions)?l.createElement(t.Menu,{localeKeyPrefix:"WF_EMPLOYEE_NOC",options:V,optionKey:"action",t:b,onSelect:function(e){k(e)}}):null,O&&l.createElement(t.SubmitBar,{ref:P,label:b("WF_TAKE_ACTION"),onSubmit:()=>F(!B)})),C&&l.createElement(t.Toast,{isDleteBtn:!0,error:null==C?void 0:C.error,warning:null==C?void 0:C.warning,label:b(null==C?void 0:C.message),onClose:()=>{y(null)}}))},NOCApplicantDetails:Li,NOCProfessionalDetails:Oi,NOCSiteDetails:Ti,NOCSpecificationDetails:Ii,NOCDocumentsRequired:e=>{var i,o,a,r,u,d,v,m;let{t:p,config:f,onSelect:E,formData:_}=e;Digit.ULBService.getStateId();const[h,A]=n.useState(null==_||null===(i=_.documents)||void 0===i?void 0:i.documents);console.log("documents in childStep three",h);const[S,N]=n.useState(null),[b,C]=n.useState(!0),[y,D]=n.useState(!1),[L,O]=n.useState(null),T=Digit.ULBService.getStateId(),I=s.useDispatch(),{isLoading:w,data:P}=Digit.Hooks.pt.usePropertyMDMS(T,"NOC",["Documents"]),R=s.useSelector(function(e){var t,n;return(null==e||null===(t=e.noc)||void 0===t||null===(n=t.NOCNewApplicationFormReducer)||void 0===n?void 0:n.coordinates)||{}});n.useEffect(()=>{Object.keys(R).length>0&&O(R)},[R]),console.log("coordinates (from redux)",R),console.log("geocoordinates",L);const x=s.useSelector(e=>{var t,n;return null==e||null===(t=e.noc)||void 0===t||null===(n=t.NOCNewApplicationFormReducer)||void 0===n?void 0:n.formData})||{},B="VACANT"===(null==x||null===(o=x.siteDetails)||void 0===o||null===(a=o.buildingStatus)||void 0===a?void 0:a.code)?null==P||null===(r=P.NOC)||void 0===r||null===(u=r.Documents)||void 0===u?void 0:u.filter(e=>"OWNER.BUILDINGDRAWING"!==e.code):null==P||null===(d=P.NOC)||void 0===d?void 0:d.Documents,F=()=>{let e;e=c({},_.documents,{documents:h}),E(f.key,e)};n.useEffect(()=>{var e,t;let n=0;null==P||null===(e=P.PetService)||void 0===e||null===(t=e.Documents)||void 0===t||t.map(e=>{e.hasDropdown=!0;let t=!1;null==h||h.map(n=>{e.required&&null!=n&&n.documentType.includes(e.code)&&(t=!0)}),!t&&e.required&&(n+=1)}),C("0"!=n&&0!=n||!((null==h?void 0:h.length)>0))},[h,y]),n.useEffect(()=>{var e,t;"VACANT"===(null==x||null===(e=x.siteDetails)||void 0===e||null===(t=e.buildingStatus)||void 0===t?void 0:t.code)&&A(e=>null==e?void 0:e.filter(e=>"OWNER.BUILDINGDRAWING"!==e.documentType))},[null==x||null===(v=x.siteDetails)||void 0===v||null===(m=v.buildingStatus)||void 0===m?void 0:m.code]);const M={value:{workflowDocs:null==h?void 0:h.map(e=>({documentType:e.documentType,filestoreId:e.filestoreId,documentUid:e.documentUid,documentAttachment:e.documentAttachment}))}},{data:U}=Digit.Hooks.noc.useNOCDocumentSearch(M),k=null==h?void 0:h.map(e=>({code:e.documentType,link:g(null==U?void 0:U.pdfFiles,e.filestoreId)}));return l.createElement("div",null,w?l.createElement(t.Loader,null):l.createElement(t.FormStep,{t:p,config:f,onSelect:F,onSkip:()=>E(),isDisabled:b,onAdd:function(){}},null==B?void 0:B.map((e,t)=>{var n;return l.createElement(Ri,{key:t,document:e,t:p,error:S,setError:N,setDocuments:A,documents:h,setCheckRequiredFields:D,handleSubmit:F,geocoordinates:L,setGeoCoordinates:O,dispatch:I,previewLink:null==k||null===(n=k.find(t=>t.code===e.code))||void 0===n?void 0:n.link})}),S&&l.createElement(t.Toast,{label:S,isDleteBtn:!0,onClose:()=>N(null),error:!0})))},NOCSummary:Pi,NOCDocumentWithLatLong:e=>{var i,o,a;let{t:r,config:u,onSelect:s,formData:d}=e;const v=Digit.ULBService.getStateId(),[m,p]=n.useState((null==d||null===(i=d.documents)||void 0===i?void 0:i.documents)||[]),[f,E]=n.useState(null),[g,_]=n.useState(!0),[h,A]=n.useState(!1),[S,N]=n.useState(!1),b=ht((null==d?void 0:d.PrevStateDocuments)||[]),{isLoading:C,data:y}=Digit.Hooks.pt.usePropertyMDMS(v,"NOC",["Documents"]),D=()=>{let e;e=c({},d.documents,{documents:m}),s(u.key,e)};return n.useEffect(()=>{var e,t;const n=null==y||null===(e=y.NOC)||void 0===e||null===(t=e.Documents)||void 0===t?void 0:t.filter(e=>e.required).map(e=>e.code),l=null==n?void 0:n.filter(e=>m.reduce((t,n)=>{var l,i,o,a;return e==(null==n||null===(l=n.documentType)||void 0===l||null===(i=l.split("."))||void 0===i?void 0:i[0])+"."+(null==n||null===(o=n.documentType)||void 0===o||null===(a=o.split("."))||void 0===a?void 0:a[1])||t},!1));_(!((null==l?void 0:l.length)==(null==n?void 0:n.length)&&(null==m?void 0:m.length)>0))},[m,h]),l.createElement("div",null,C?l.createElement(t.Loader,null):l.createElement(t.FormStep,{t:r,config:u,onSelect:D,onSkip:()=>s(),onAdd:function(){}},null==y||null===(o=y.NOC)||void 0===o||null===(a=o.Documents)||void 0===a?void 0:a.map((e,t)=>l.createElement("div",{style:{background:"#FAFAFA",border:"1px solid #D6D5D4",padding:"8px",borderRadius:"4px",maxWidth:"600px",minWidth:"280px",marginBottom:"15px",paddingTop:"15px"}},l.createElement(xi,{key:t,document:e,t:r,error:f,setError:E,setDocuments:p,documents:m,setCheckRequiredFields:A,formData:d,beforeUploadDocuments:b||[],isNextButtonDisabled:S,setIsNextButtonDisabled:N,handleSubmit:D}))),f&&l.createElement(t.Toast,{label:f,onClose:()=>E(null),error:!0})),(window.location.href.includes("/bpa/building_plan_scrutiny/new_construction")||window.location.href.includes("/ocbpa/building_oc_plan_scrutiny/new_construction"))&&null!=d&&d.applicationNo?l.createElement(t.CitizenInfoLabel,{info:r("CS_FILE_APPLICATION_INFO_LABEL"),text:r("BPA_APPLICATION_NUMBER_LABEL")+" "+(null==d?void 0:d.applicationNo)+" "+r("BPA_DOCS_INFORMATION"),className:"info-banner-wrap-citizen-override"}):"")},NOCResponseCitizen:e=>{var n,a,r;const u=i.useLocation(),{pathname:s,state:d}=u,{t:c}=o.useTranslation(),v=i.useHistory(),m=null==d||null===(n=d.data)||void 0===n||null===(a=n.Noc)||void 0===a?void 0:a[0];console.log("nocData here",m),window.localStorage.getItem("CITIZEN.CITY");const{data:f}=Digit.Hooks.useStore.getInitData(),{tenants:E}=f||{},g=s.split("/").pop();return l.createElement("div",null,l.createElement(t.Card,null,l.createElement(t.Banner,{message:c("NOC_APPLICATION_"+(null==m||null===(r=m.workflow)||void 0===r?void 0:r.action)+"_SUCCESS_HEADER"),applicationNumber:g,info:"REJECTED"==(null==m?void 0:m.applicationStatus)?"":c(p(null==m?void 0:m.nocType,".","_")+"_APPLICATION_NUMBER"),successful:"REJECTED"!=(null==m?void 0:m.applicationStatus),style:{padding:"10px"},headerStyles:{fontSize:"32px",wordBreak:"break-word"}}),"REJECTED"!==(null==m?void 0:m.applicationStatus)?l.createElement("div",null,l.createElement(t.SubmitBar,{style:{overflow:"hidden"},label:c("COMMON_DOWNLOAD"),onSubmit:function(){try{const e=m,t=E.find(t=>t.code===e.tenantId);return Promise.resolve(Bt(e,t,c)).then(function(e){Digit.Utils.pdf.generateBPAREG(e)})}catch(e){return Promise.reject(e)}}})):null,l.createElement(t.ActionBar,{style:{display:"flex",justifyContent:"flex-end",alignItems:"baseline"}},l.createElement(t.SubmitBar,{label:c("CORE_COMMON_GO_TO_HOME"),onSubmit:()=>{v.push("/digit-ui/citizen")}}),l.createElement(t.SubmitBar,{label:c("CORE_COMMON_GO_TO_NOC"),onSubmit:()=>{v.push("/digit-ui/citizen/noc-home")}}))))},NOCCitizenMyApplications:e=>{var a,r,u;const{t:s}=o.useTranslation(),d=(i.useHistory(),(null===(a=Digit.UserService.getUser())||void 0===a?void 0:a.info)||{}),v=window.localStorage.getItem("CITIZEN.CITY"),m={sortBy:"createdTime",limit:window.Digit.Utils.browser.isMobile()?50:10,offset:0,sortOrder:"DESC",mobileNumber:""},{isLoading:p,data:f}=Digit.Hooks.noc.useNOCCitizenSearchApplication(c({},m,{mobileNumber:(null==d?void 0:d.mobileNumber)||""}),v);console.log("data herein NOC==>",f);const E=["CS_CF_VIEW","CS_CF_TRACK","TL_VIEW_DETAILS"];return n.useEffect(()=>{f&&f.revalidate()},[]),p?l.createElement(t.Loader,null):l.createElement(l.Fragment,null,l.createElement("div",{className:"applications-list-container"},l.createElement(t.Header,null,""+s("NOC_MY_APPLICATION")),0===(null==f||null===(r=f.data)||void 0===r?void 0:r.length)&&l.createElement(t.Card,{style:{textAlign:"center"}},s("NO_APPLICATIONS_MSG")),null==f||null===(u=f.data)||void 0===u?void 0:u.map((e,n)=>{var o;const a=Object.fromEntries(Object.entries(e).filter(e=>{let[t]=e;return"Applications"!==t}));return l.createElement("div",{key:"card-"+n},l.createElement(t.Card,null,Object.keys(a).filter(e=>null!==a[e]).map(e=>l.createElement(t.KeyNote,{keyValue:s(e),note:s(a[e])})),l.createElement(i.Link,{to:"/digit-ui/citizen/noc/search/application-overview/"+(null==e||null===(o=e.Applications)||void 0===o?void 0:o.applicationNo)},l.createElement(t.SubmitBar,{label:s(E[2])}))))})))},NOCCitizenApplicationOverview:()=>{var e,a,r,u,s,d,m,p,f,E,g,_,h,A,S,N,b,C,y,D,L,O,T,I,w,P,R,x,B,F,M,U,k,W,H,j,z,V,G,Y;const{id:K}=i.useParams(),{t:q}=o.useTranslation(),X=i.useHistory(),J=window.localStorage.getItem("CITIZEN.CITY"),[Q,Z]=n.useState({}),{isLoading:$,data:ee}=Digit.Hooks.noc.useNOCSearchApplication({applicationNo:K},J),te=null==ee?void 0:ee.resData,{data:ne}=Digit.Hooks.useStore.getInitData(),{tenants:le}=ne||{};let ie=Digit.UserService.getUser();if(window.location.href.includes("/obps")||window.location.href.includes("/noc")){const e=sessionStorage.getItem("Digit.citizen.userRequestObject"),t=e?JSON.parse(e):{};ie=null==t?void 0:t.value}const oe=null===(e=ie)||void 0===e||null===(a=e.info)||void 0===a||null===(r=a.roles)||void 0===r?void 0:r.map(e=>e.code);n.useEffect(()=>{var e;const t=null==te||null===(e=te.Noc)||void 0===e?void 0:e[0];if(t){var n,l,i,o,a,r;const e=null==t||null===(n=t.nocDetails)||void 0===n||null===(l=n.additionalDetails)||void 0===l?void 0:l.applicationDetails,u=null==t||null===(i=t.nocDetails)||void 0===i||null===(o=i.additionalDetails)||void 0===o?void 0:o.siteDetails,s=null==t||null===(a=t.nocDetails)||void 0===a||null===(r=a.additionalDetails)||void 0===r?void 0:r.coordinates,d=(null==t?void 0:t.documents)||[];Z({applicantDetails:e?[e]:[],siteDetails:u?[u]:[],coordinates:s?[s]:[],Documents:d.length>0?d:[]})}},[null==te?void 0:te.Noc]);const{data:ae,isLoading:re}=Digit.Hooks.useRecieptSearch({tenantId:J,businessService:"obpas_noc",consumerCodes:K,isEmployee:!1},{enabled:!!K}),ue=null==ae||null===(u=ae.Payments)||void 0===u||null===(s=u[0])||void 0===s?void 0:s.totalAmountPaid,se=[];"APPROVED"===(null==te||null===(d=te.Noc)||void 0===d||null===(m=d[0])||void 0===m?void 0:m.applicationStatus)&&(se.push({label:q("PDF_STATIC_LABEL_WS_CONSOLIDATED_SANCTION_LETTER"),onClick:function(){try{var e;const t=null==te||null===(e=te.Noc)||void 0===e?void 0:e[0];return Promise.resolve(kt(function(){if(!t)throw new Error("Noc Application data is missing");return Promise.resolve(function(e,t,n){try{const l=(new Date).toLocaleDateString("en-IN",{day:"2-digit",month:"long",year:"numeric"});return Promise.resolve(jo.toDataURL(window.location.href)).then(function(i){var o,a,r,u,s,d;const c=null===(o=e.nocDetails)||void 0===o||null===(a=o.additionalDetails)||void 0===a?void 0:a.applicationDetails,v=null===(r=e.nocDetails)||void 0===r||null===(u=r.additionalDetails)||void 0===u?void 0:u.siteDetails,m=e.nocDetails,p='\n<html>\n <head>\n <title>NOC Sanction Letter</title>\n <style>\n @page { margin: 0.5in; }\n body {\n font-family: \'Arial\', sans-serif;\n margin: 0;\n padding: 20px;\n font-size: 14px;\n line-height: 1.6;\n }\n .noc-container {\n max-width: 800px;\n margin: 0 auto;\n border: 2px solid #333;\n padding: 30px;\n background: white;\n }\n .line-between {\n display: flex;\n justify-content: space-between;\n }\n .header {\n display: flex;\n justify-content: space-between;\n align-items: center;\n margin-bottom: 30px;\n border-bottom: 2px solid #333;\n padding-bottom: 20px;\n }\n .header-left, .header-right { flex: 0 0 auto; }\n .header-center { text-align: center; flex: 1; }\n .title { font-size: 20px; font-weight: bold; margin: 10px 0; color: #333; }\n .subtitle { font-size: 16px; margin: 5px 0; color: #666; }\n table { width: 100%; border-collapse: collapse; margin: 20px 0; }\n th, td { border: 1px solid #ddd; padding: 10px; text-align: left; }\n th { background: #f5f5f5; }\n .footer { margin-top: 30px; text-align: right; font-size: 12px; color: #666; }\n @media print { body { background: white !important; } }\n </style>\n </head>\n <body>\n <div class="noc-container">\n <div class="header">\n <div class="header-left">\n <img src="https://s3.ap-south-1.amazonaws.com/pb-egov-assets/pb.amritsar/logo.png"\n style="width: 100px; height: auto;" />\n </div>\n <div class="header-center">\n <div class="title">Local Government, Punjab</div>\n <div class="subtitle">'+((null==v?void 0:v.ulbType)||"ULB Type")+" "+((null==v?void 0:v.ulbName)||"ULB Name")+' </div>\n <div class="subtitle">('+e.nocType+' Regularization Certificate)</div>\n </div>\n <div class="header-right">\n <img src="'+i+'" style="width: 100px; height: auto;" />\n </div>\n </div>\n\n <div class="line-between"> \n <span>No. '+e.applicationNo+"</span>\n <td>\n Dated "+(null!=m&&null!==(s=m.additionalDetails)&&void 0!==s&&s.SubmittedOn?new Date(Number(m.additionalDetails.SubmittedOn)).toLocaleDateString("en-GB"):"N/A")+"\n </td>\n </div>\n\n <p>\n 1. Whereas Mr/Miss/Mrs "+((null==c?void 0:c.applicantOwnerOrFirmName)||"N/A")+"\n has applied to "+((null==v?void 0:v.ulbName)||"N/A")+" for getting No Objection Certificate\n regarding the regularization of Plot/Building under Policy No: 12/01/2017-5HG2/1806 dated 18th October 2018. The detail of his/ her / their plot / building is given below: -.\n </p>\n\n <table>\n <tr>\n <th>"+t("APPLICATIONNO")+" & "+t("AUDIT_DATE_LABEL")+"</th>\n <th>"+t("REPORT_FSM_RESULT_APPLICANTNAME")+"</th>\n </tr>\n <tr>\n <td>\n "+e.applicationNo+" Dated "+(null!=m&&null!==(d=m.additionalDetails)&&void 0!==d&&d.SubmittedOn?new Date(Number(m.additionalDetails.SubmittedOn)).toLocaleDateString("en-GB"):"N/A")+"\n </td>\n <td>"+((null==c?void 0:c.applicantOwnerOrFirmName)||"N/A")+"</td>\n </tr>\n </table>\n\n <h3>"+t("PROPERTY_DESC")+"</h3>\n <table>\n <tr>\n <th>"+t("REVENUE_ESTATE")+"</th>\n <th>"+t("NOC_SITE_VASIKA_NO_LABEL")+"</th>\n <th>"+t("NOC_NET_TOTAL_AREA_LABEL")+"</th>\n <th>"+t("BPA_HADBAST_NO_LABEL")+"</th>\n <th>"+t("NOC_SITE_KHEWAT_AND_KHATUNI_NO_LABEL")+"</th>\n </tr>\n <tr>\n <td>"+((null==v?void 0:v.villageName)||"N/A")+"</td>\n <td>"+((null==v?void 0:v.vasikaNumber)||"N/A")+"</td>\n <td>"+((null==v?void 0:v.specificationPlotArea)||"N/A")+"</td>\n <td>"+((null==v?void 0:v.hadbastNo)||"N/A")+"</td>\n <td>"+((null==v?void 0:v.khewatAndKhatuniNo)||"N/A")+"</td>\n </tr>\n <tr>\n <th>"+t("BPA_KHASRA_NO_LABEL")+'</th>\n <td colspan="4">'+((null==v?void 0:v.khasraNo)||"N/A")+"</td>\n </tr>\n </table>\n\n <p>2. Whereas, the area falls under the following categories: -</p>\n <table>\n <tr>\n <th>Sr. No.</th>\n <th>Details</th>\n <th>"+t("BPA_HADBAST_NO_LABEL")+"</th>\n </tr>\n <tr>\n <td>1</td>\n <td>"+t("PROPERTY_ADDRESS")+"</td>\n <td>"+((null==v?void 0:v.plotNo)||"")+", "+((null==c?void 0:c.applicantAddress)||"")+"</td>\n </tr>\n <tr>\n <td>2</td>\n <td>"+t("NOC_COMPOUNDING")+"</td>\n <td>"+((null==v?void 0:v.specificationBuildingCategory)||"N/A")+" Plot measuring "+((null==v?void 0:v.specificationPlotArea)||"N/A")+" Sq. mts.</td>\n </tr>\n "+("Built Up"===v.buildingStatus?"\n <tr>\n <td>3</td>\n <td>"+t("REGULARIZATION_UNAUTHORIZED")+"</td>\n <td>\n "+(v.floorArea||[]).map((e,t)=>"Floor "+(t+1)+": "+(e.value||"0")+" sqft").join("<br/>")+"\n "+(v.basementArea?"<br/>Basement: "+v.basementArea+" sqft":"")+"\n <br/><strong>"+t("BPA_APPLICATION_TOTAL_BUILDUP_AREA")+"</strong> "+(null==v?void 0:v.totalFloorArea)+" sqft.\n </td>\n </tr>\n ":"")+"\n <tr>\n <td>4</td>\n <td>"+t("NOC_REGUALRIZATION_PAID")+"</td>\n <td>"+t("VIDE_NO")+": "+e.applicationNo+" Rs. : "+(n||"N/A")+"</td>\n </tr>\n </table>\n\n "+("Provisional"===v.specificationNocType?"<p>3. "+t("NOC_SANCTION_THREE")+"</p>":"")+"\n\n <p>4. "+t("NOC_SANCTION_FOUR")+"</p>\n <p>5. "+t("NOC_SANCTION_FIVE")+"</p>\n <p>6. "+t("NOC_SANCTION_SIX")+"</p>\n <p>7. "+t("NOC_SANCTION_SEVEN")+"</p>\n <p>8. "+t("NOC_SANCTION_EIGHT")+'</p>\n\n <div style="text-align: right; margin-top: 40px;">\n <p>Competent Authority</p>\n <div> ........................</div>\n Officer Name\n <div>.......................</div>\n Designation\n <p>'+l+"</p>\n </div>\n </div>\n </body>\n</html>\n",f=window.open("","_blank");f.document.write(p),f.document.close(),f.onload=()=>{setTimeout(()=>{f.print(),f.onafterprint=()=>{f.close()}},500)}})}catch(e){return Promise.reject(e)}}(t,q,ue)).then(function(){})},function(e){console.error("Sanction Letter download error:",e)}))}catch(e){return Promise.reject(e)}}}),se.push({label:q("DOWNLOAD_CERTIFICATE"),onClick:function(){try{var e;const t=null==te||null===(e=te.Noc)||void 0===e?void 0:e[0],n=le.find(e=>e.code===t.tenantId);return Promise.resolve(Bt(t,n,q)).then(function(e){Digit.Utils.pdf.generate(e)})}catch(e){return Promise.reject(e)}}}),ae&&(null==ae?void 0:ae.Payments.length)>0&&!re&&se.push({label:q("CHB_FEE_RECEIPT"),onClick:()=>{var e;return function(e){let{tenantId:t,payments:n}=e;v(e,zo);try{let e={filestoreIds:[null==n?void 0:n.fileStoreId]};return Promise.resolve(Digit.PaymentService.generatePdf(t,{Payments:[c({},n)]},"noc-receipt")).then(function(n){return e=n,Promise.resolve(Digit.PaymentService.printReciept(t,{fileStoreIds:e.filestoreIds[0]})).then(function(t){var n;window.open(t[null===(n=e)||void 0===n?void 0:n.filestoreIds[0]],"_blank")})})}catch(e){return Promise.reject(e)}}({tenantId:null==ae||null===(e=ae.Payments[0])||void 0===e?void 0:e.tenantId,payments:null==ae?void 0:ae.Payments[0]})}}));const de=e=>{if(0===e)return q("NOC_GROUND_FLOOR_AREA_LABEL");const t=e%10,n=e%100;let l="th";return(n<11||n>13)&&(1===t?l="st":2===t?l="nd":3===t&&(l="rd")),""+e+l+" "+q("NOC_FLOOR_AREA_LABEL")},[ce,ve]=n.useState(null),[me,pe]=n.useState(!1),[fe,Ee]=n.useState(null),[ge,_e]=n.useState(!1),he=n.useRef();Digit.Hooks.useClickOutside(he,()=>{pe(!1)},me);const Ae=Digit.Hooks.useWorkflowDetails({tenantId:J,id:K,moduleCode:"obpas_noc"});var Se,Ne;null!=Ae&&null!==(p=Ae.data)&&void 0!==p&&null!==(f=p.actionState)&&void 0!==f&&f.nextActions&&!Ae.isLoading&&(Ae.data.actionState.nextActions=[...null==Ae||null===(E=Ae.data)||void 0===E?void 0:E.nextActions]),Ae&&Ae.data&&!Ae.isLoading&&(Ae.data.initialActionState=(null==Ae||null===(Se=Ae.data)||void 0===Se?void 0:Se.initialActionState)||c({},null==Ae||null===(Ne=Ae.data)||void 0===Ne?void 0:Ne.actionState)||{},Ae.data.actionState=c({},Ae.data)),n.useEffect(()=>{Ae&&Ae.revalidate(),ee&&ee.revalidate()},[]);let be=(null==Ae||null===(g=Ae.data)||void 0===g||null===(_=g.actionState)||void 0===_||null===(h=_.nextActions)||void 0===h?void 0:h.filter(e=>(null==oe?void 0:oe.some(t=>{var n;return null===(n=e.roles)||void 0===n?void 0:n.includes(t)}))||!e.roles))||(null==Ae||null===(A=Ae.data)||void 0===A||null===(S=A.nextActions)||void 0===S?void 0:S.filter(e=>(null==oe?void 0:oe.some(t=>{var n;return null===(n=e.roles)||void 0===n?void 0:n.includes(t)}))||!e.roles));return console.log("actions here",be),$?l.createElement(t.Loader,null):l.createElement("div",{className:"employee-main-application-details"},l.createElement("div",{className:"cardHeaderWithOptions",style:{marginRight:"auto",maxWidth:"960px"}},l.createElement(t.Header,{styles:{fontSize:"32px"}},q("NDC_APP_OVER_VIEW_HEADER")),se&&se.length>0&&l.createElement(t.MultiLink,{className:"multilinkWrapper",onHeadClick:()=>_e(!ge),displayOptions:ge,options:se})),l.createElement(t.Card,null,l.createElement(t.CardSubHeader,null,q("NOC_APPLICANT_DETAILS")),null==Q||null===(N=Q.applicantDetails)||void 0===N?void 0:N.map((e,n)=>{var i;return l.createElement("div",{key:n,style:{marginBottom:"30px",background:"#FAFAFA",padding:"16px",borderRadius:"4px"}},l.createElement(t.StatusTable,null,l.createElement(t.Row,{label:q("NOC_FIRM_OWNER_NAME_LABEL"),text:(null==e?void 0:e.applicantOwnerOrFirmName)||"N/A"}),l.createElement(t.Row,{label:q("NOC_APPLICANT_EMAIL_LABEL"),text:(null==e?void 0:e.applicantEmailId)||"N/A"}),l.createElement(t.Row,{label:q("NOC_APPLICANT_FATHER_HUSBAND_NAME_LABEL"),text:(null==e?void 0:e.applicantFatherHusbandName)||"N/A"}),l.createElement(t.Row,{label:q("NOC_APPLICANT_MOBILE_NO_LABEL"),text:(null==e?void 0:e.applicantMobileNumber)||"N/A"}),l.createElement(t.Row,{label:q("NOC_APPLICANT_DOB_LABEL"),text:(null==e?void 0:e.applicantDateOfBirth)||"N/A"}),l.createElement(t.Row,{label:q("NOC_APPLICANT_GENDER_LABEL"),text:(null==e||null===(i=e.applicantGender)||void 0===i?void 0:i.code)||(null==e?void 0:e.applicantGender)||"N/A"}),l.createElement(t.Row,{label:q("NOC_APPLICANT_ADDRESS_LABEL"),text:(null==e?void 0:e.applicantAddress)||"N/A"}),l.createElement(t.Row,{label:q("NOC_APPLICANT_PROPERTY_ID_LABEL"),text:(null==e?void 0:e.applicantPropertyId)||"N/A"})))})),(null==Q||null===(b=Q.applicantDetails)||void 0===b?void 0:b.some(e=>{var t,n;return(null==e||null===(t=e.professionalName)||void 0===t||null===(n=t.trim())||void 0===n?void 0:n.length)>0}))&&(null==Q||null===(C=Q.applicantDetails)||void 0===C?void 0:C.map((e,n)=>l.createElement(l.Fragment,null,l.createElement(t.Card,null,l.createElement(t.CardSubHeader,null,q("NOC_PROFESSIONAL_DETAILS")),l.createElement("div",{key:n,style:{marginBottom:"30px",background:"#FAFAFA",padding:"16px",borderRadius:"4px"}},l.createElement(t.StatusTable,null,l.createElement(t.Row,{label:q("NOC_PROFESSIONAL_NAME_LABEL"),text:(null==e?void 0:e.professionalName)||"N/A"}),l.createElement(t.Row,{label:q("NOC_PROFESSIONAL_EMAIL_LABEL"),text:(null==e?void 0:e.professionalEmailId)||"N/A"}),l.createElement(t.Row,{label:q("NOC_PROFESSIONAL_REGISTRATION_ID_LABEL"),text:(null==e?void 0:e.professionalRegId)||"N/A"}),l.createElement(t.Row,{label:q("NOC_PROFESSIONAL_MOBILE_NO_LABEL"),text:(null==e?void 0:e.professionalMobileNumber)||"N/A"}),l.createElement(t.Row,{label:q("NOC_PROFESSIONAL_ADDRESS_LABEL"),text:(null==e?void 0:e.professionalAddress)||"N/A"}))))))),l.createElement(t.Card,null,l.createElement(t.CardSubHeader,null,q("NOC_SITE_DETAILS")),null==Q||null===(y=Q.siteDetails)||void 0===y?void 0:y.map((e,n)=>{var i,o,a,r,u,s,d;return l.createElement("div",{key:n,style:{marginBottom:"30px",background:"#FAFAFA",padding:"16px",borderRadius:"4px"}},l.createElement(t.StatusTable,null,l.createElement(t.Row,{label:q("NOC_PLOT_NO_LABEL"),text:(null==e?void 0:e.plotNo)||"N/A"}),l.createElement(t.Row,{label:q("NOC_PROPOSED_SITE_ADDRESS"),text:(null==e?void 0:e.proposedSiteAddress)||"N/A"}),l.createElement(t.Row,{label:q("NOC_ULB_NAME_LABEL"),text:(null==e||null===(i=e.ulbName)||void 0===i?void 0:i.name)||(null==e?void 0:e.ulbName)||"N/A"}),l.createElement(t.Row,{label:q("NOC_ULB_TYPE_LABEL"),text:(null==e?void 0:e.ulbType)||"N/A"}),l.createElement(t.Row,{label:q("NOC_KHASRA_NO_LABEL"),text:(null==e?void 0:e.khasraNo)||"N/A"}),l.createElement(t.Row,{label:q("NOC_HADBAST_NO_LABEL"),text:(null==e?void 0:e.hadbastNo)||"N/A"}),l.createElement(t.Row,{label:q("NOC_ROAD_TYPE_LABEL"),text:(null==e||null===(o=e.roadType)||void 0===o?void 0:o.name)||(null==e?void 0:e.roadType)||"N/A"}),l.createElement(t.Row,{label:q("NOC_AREA_LEFT_FOR_ROAD_WIDENING_LABEL"),text:(null==e?void 0:e.areaLeftForRoadWidening)||"N/A"}),l.createElement(t.Row,{label:q("NOC_NET_PLOT_AREA_AFTER_WIDENING_LABEL"),text:(null==e?void 0:e.netPlotAreaAfterWidening)||"N/A"}),l.createElement(t.Row,{label:q("NOC_NET_TOTAL_AREA_LABEL"),text:(null==e?void 0:e.netTotalArea)||"N/A"}),l.createElement(t.Row,{label:q("NOC_ROAD_WIDTH_AT_SITE_LABEL"),text:(null==e?void 0:e.roadWidthAtSite)||"N/A"}),l.createElement(t.Row,{label:q("NOC_BUILDING_STATUS_LABEL"),text:(null==e||null===(a=e.buildingStatus)||void 0===a?void 0:a.name)||(null==e?void 0:e.buildingStatus)||"N/A"}),l.createElement(t.Row,{label:q("NOC_IS_BASEMENT_AREA_PRESENT_LABEL"),text:(null==e||null===(r=e.isBasementAreaAvailable)||void 0===r?void 0:r.code)||(null==e?void 0:e.isBasementAreaAvailable)||"N/A"}),"Built Up"==(null==e?void 0:e.buildingStatus)&&l.createElement(t.Row,{label:q("NOC_BASEMENT_AREA_LABEL"),text:e.basementArea||"N/A"}),"Built Up"==(null==e?void 0:e.buildingStatus)&&(null==e||null===(u=e.floorArea)||void 0===u?void 0:u.map((e,n)=>l.createElement(t.Row,{label:de(n),text:e.value||"N/A"}))),"Built Up"==(null==e?void 0:e.buildingStatus)&&l.createElement(t.Row,{label:q("NOC_TOTAL_FLOOR_BUILT_UP_AREA_LABEL"),text:e.totalFloorArea||"N/A"}),l.createElement(t.Row,{label:q("NOC_DISTRICT_LABEL"),text:(null==e||null===(s=e.district)||void 0===s?void 0:s.name)||(null==e?void 0:e.district)||"N/A"}),l.createElement(t.Row,{label:q("NOC_ZONE_LABEL"),text:(null==e||null===(d=e.zone)||void 0===d?void 0:d.name)||(null==e?void 0:e.zone)||"N/A"}),l.createElement(t.Row,{label:q("NOC_SITE_WARD_NO_LABEL"),text:(null==e?void 0:e.wardNo)||"N/A"}),l.createElement(t.Row,{label:q("NOC_SITE_VILLAGE_NAME_LABEL"),text:(null==e?void 0:e.villageName)||"N/A"}),l.createElement(t.Row,{label:q("NOC_SITE_COLONY_NAME_LABEL"),text:(null==e?void 0:e.colonyName)||"N/A"}),l.createElement(t.Row,{label:q("NOC_SITE_VASIKA_NO_LABEL"),text:(null==e?void 0:e.vasikaNumber)||"N/A"}),l.createElement(t.Row,{label:q("NOC_SITE_KHEWAT_AND_KHATUNI_NO_LABEL"),text:(null==e?void 0:e.khewatAndKhatuniNo)||"N/A"})))})),l.createElement(t.Card,null,l.createElement(t.CardSubHeader,null,q("NOC_SPECIFICATION_DETAILS")),null==Q||null===(D=Q.siteDetails)||void 0===D?void 0:D.map((e,n)=>{var i,o,a,r;return l.createElement("div",{key:n,style:{marginBottom:"30px",background:"#FAFAFA",padding:"16px",borderRadius:"4px"}},l.createElement(t.StatusTable,null,l.createElement(t.Row,{label:q("NOC_PLOT_AREA_JAMA_BANDI_LABEL"),text:(null==e?void 0:e.specificationPlotArea)||"N/A"}),l.createElement(t.Row,{label:q("NOC_BUILDING_CATEGORY_LABEL"),text:(null==e||null===(i=e.specificationBuildingCategory)||void 0===i?void 0:i.name)||(null==e?void 0:e.specificationBuildingCategory)||"N/A"}),l.createElement(t.Row,{label:q("NOC_NOC_TYPE_LABEL"),text:(null==e||null===(o=e.specificationNocType)||void 0===o?void 0:o.name)||(null==e?void 0:e.specificationNocType)||"N/A"}),l.createElement(t.Row,{label:q("NOC_RESTRICTED_AREA_LABEL"),text:(null==e||null===(a=e.specificationRestrictedArea)||void 0===a?void 0:a.code)||(null==e?void 0:e.specificationRestrictedArea)||"N/A"}),l.createElement(t.Row,{label:q("NOC_IS_SITE_UNDER_MASTER_PLAN_LABEL"),text:(null==e||null===(r=e.specificationIsSiteUnderMasterPlan)||void 0===r?void 0:r.code)||(null==e?void 0:e.specificationIsSiteUnderMasterPlan)||"N/A"})))})),l.createElement(t.Card,null,l.createElement(t.CardSubHeader,null,q("NOC_SITE_COORDINATES_LABEL")),null==Q||null===(L=Q.coordinates)||void 0===L?void 0:L.map((e,n)=>l.createElement("div",{key:n,style:{marginBottom:"30px",background:"#FAFAFA",padding:"16px",borderRadius:"4px"}},l.createElement(t.StatusTable,null,l.createElement(t.Row,{label:q("COMMON_LATITUDE1_LABEL"),text:(null==e?void 0:e.Latitude1)||"N/A"}),l.createElement(t.Row,{label:q("COMMON_LONGITUDE1_LABEL"),text:(null==e?void 0:e.Longitude1)||"N/A"}),l.createElement(t.Row,{label:q("COMMON_LATITUDE2_LABEL"),text:(null==e?void 0:e.Latitude2)||"N/A"}),l.createElement(t.Row,{label:q("COMMON_LONGITUDE2_LABEL"),text:(null==e?void 0:e.Longitude2)||"N/A"}))))),l.createElement(t.Card,null,l.createElement(t.CardSubHeader,null,q("NOC_TITILE_DOCUMENT_UPLOADED")),l.createElement(t.StatusTable,null,(null==Q||null===(O=Q.Documents)||void 0===O?void 0:O.length)>0&&l.createElement(Al,{documents:Q.Documents}))),l.createElement(t.Card,null,l.createElement(t.CardSubHeader,null,q("NOC_FEE_DETAILS_LABEL")),(null==te||null===(T=te.Noc)||void 0===T||null===(I=T[0])||void 0===I?void 0:I.nocDetails)&&l.createElement(Sl,{formData:{apiData:c({},te),applicationDetails:c({},null==te||null===(w=te.Noc)||void 0===w||null===(P=w[0])||void 0===P||null===(R=P.nocDetails)||void 0===R||null===(x=R.additionalDetails)||void 0===x?void 0:x.applicationDetails),siteDetails:c({},null==te||null===(B=te.Noc)||void 0===B||null===(F=B[0])||void 0===F||null===(M=F.nocDetails)||void 0===M||null===(U=M.additionalDetails)||void 0===U?void 0:U.siteDetails)}})),(null==Ae||null===(k=Ae.data)||void 0===k?void 0:k.timeline)&&l.createElement(t.Card,null,l.createElement(t.CardSubHeader,null,q("CS_APPLICATION_DETAILS_APPLICATION_TIMELINE")),1===(null==Ae||null===(W=Ae.data)||void 0===W?void 0:W.timeline.length)?l.createElement(t.CheckPoint,{isCompleted:!0,label:q(null==Ae||null===(H=Ae.data)||void 0===H||null===(j=H.timeline[0])||void 0===j?void 0:j.status)}):l.createElement(t.ConnectingCheckPoints,null,null==Ae||null===(z=Ae.data)||void 0===z?void 0:z.timeline.map((e,n,i)=>l.createElement(t.CheckPoint,{keyValue:n,isCompleted:0===n,label:q("NOC_STATUS_"+e.status),customChild:Vo(e,n,0,q)})))),be&&be.length>0&&l.createElement(t.ActionBar,null,me&&(null!=Ae&&null!==(V=Ae.data)&&void 0!==V&&null!==(G=V.actionState)&&void 0!==G&&G.nextActions||null!=Ae&&null!==(Y=Ae.data)&&void 0!==Y&&Y.nextActions)?l.createElement(t.Menu,{localeKeyPrefix:"WF_EMPLOYEE_NOC",options:be,optionKey:"action",t:q,onSelect:function(e){var t,n;console.log("selected action",e);const l=null==te||null===(t=te.Noc)||void 0===t||null===(n=t[0])||void 0===n?void 0:n.applicationNo,i={Licenses:[e]};"EDIT"==(null==e?void 0:e.action)?X.push("/digit-ui/citizen/noc/edit-application/"+l):"DRAFT"==(null==e?void 0:e.action)?ve({key:"true",warning:!0,message:"COMMON_EDIT_APPLICATION_BEFORE_SAVE_OR_SUBMIT_LABEL"}):"APPLY"==(null==e?void 0:e.action)||"RESUBMIT"==(null==e?void 0:e.action)||"CANCEL"==(null==e?void 0:e.action)?function(e){try{var t,n;const l=c({},(null==te||null===(t=te.Noc)||void 0===t?void 0:t[0])||{},{workflow:{}}),i=null==e||null===(n=e.Licenses)||void 0===n?void 0:n[0];l.workflow={action:i.action,assignes:null==i?void 0:i.assignee,comment:null==i?void 0:i.comment,documents:null==i?void 0:i.wfDocuments};const o={Noc:c({},l)},a=kt(function(){return Promise.resolve(Digit.NOCService.NOCUpdate({tenantId:J,details:o})).then(function(e){var t,n,l;"successful"===(null==e||null===(t=e.ResponseInfo)||void 0===t?void 0:t.status)?"CANCEL"===(null==i?void 0:i.action)?(ve({key:"true",success:!0,message:"COMMON_APPLICATION_CANCELLED_LABEL"}),Ae.revalidate(),Ee(null)):(console.log("We are calling citizen response page"),X.replace({pathname:"/digit-ui/citizen/noc/response/"+(null==e||null===(n=e.Noc)||void 0===n||null===(l=n[0])||void 0===l?void 0:l.applicationNo),state:{data:e}})):(ve({key:"true",warning:!0,message:"COMMON_SOMETHING_WENT_WRONG_LABEL"}),Ee(null))})},function(){ve({key:"true",error:!0,message:"COMMON_SOME_ERROR_OCCURRED_LABEL"})});Promise.resolve(a&&a.then?a.then(function(){}):void 0)}catch(e){return Promise.reject(e)}}(i):"PAY"==(null==e?void 0:e.action)?X.push("/digit-ui/citizen/payment/collect/obpas_noc/"+l+"/"+J+"?tenantId="+J):Ee(e)}}):null,l.createElement(t.SubmitBar,{ref:he,label:q("WF_TAKE_ACTION"),onSubmit:()=>pe(!me)})),ce&&l.createElement(t.Toast,{error:null==ce?void 0:ce.error,warning:null==ce?void 0:ce.warning,label:q(null==ce?void 0:ce.message),isDleteBtn:!0,onClose:()=>{ve(null)}}))},NOCEmployeeApplicationOverview:()=>{var e,a,r,u,s,d,v,m,p,f,E,g,_,h,A,S,N,b,C,y,D,L,O,T,I,w,P,R,x,B,F,M,U,k,W,H,j;const{id:z}=i.useParams(),{t:V}=o.useTranslation(),G=window.localStorage.getItem("Employee.tenant-id"),Y=i.useHistory(),K=null==G?void 0:G.split(".")[0],[q,X]=n.useState(null),[J,Q]=n.useState(null),[Z,$]=n.useState(null),[ee,te]=n.useState(null),[ne,le]=n.useState({}),[ie,oe]=n.useState(!1),[ae,re]=n.useState([]),[ue,se]=n.useState(!1),[de,ce]=n.useState([]),{isLoading:ve,data:me}=Digit.Hooks.noc.useNOCSearchApplication({applicationNo:z},G),pe=null==me?void 0:me.resData;console.log("applicationDetails here==>",pe);const fe=Digit.Hooks.useWorkflowDetails({tenantId:G,id:z,moduleCode:"obpas_noc"});var Ee,ge;console.log("workflowDetails here=>",fe),null!=fe&&null!==(e=fe.data)&&void 0!==e&&null!==(a=e.actionState)&&void 0!==a&&a.nextActions&&!fe.isLoading&&(fe.data.actionState.nextActions=[...null==fe||null===(r=fe.data)||void 0===r?void 0:r.nextActions]),fe&&fe.data&&!fe.isLoading&&(fe.data.initialActionState=(null==fe||null===(Ee=fe.data)||void 0===Ee?void 0:Ee.initialActionState)||c({},null==fe||null===(ge=fe.data)||void 0===ge?void 0:ge.actionState)||{},fe.data.actionState=c({},fe.data)),n.useEffect(()=>{let e=null;try{return se(!0),Promise.resolve(Digit.WorkflowService.init(G,"obpas_noc")).then(function(t){var n,l,i;e=t,se(!1),ce(null===(n=e)||void 0===n||null===(l=n.BusinessServices)||void 0===l||null===(i=l[0])||void 0===i?void 0:i.states)})}catch(e){Promise.reject(e)}},[G]);const[_e,he]=n.useState(!1),[Ae,Se]=n.useState(null),[Ne,be]=n.useState(!1),Ce=()=>{X(null)};let ye=Digit.UserService.getUser();const De=n.useRef();if(Digit.Hooks.useClickOutside(De,()=>{he(!1)},_e),window.location.href.includes("/obps")||window.location.href.includes("/noc")){const e=sessionStorage.getItem("Digit.citizen.userRequestObject"),t=e?JSON.parse(e):{};ye=null==t?void 0:t.value}const Le=null===(u=ye)||void 0===u||null===(s=u.info)||void 0===s||null===(d=s.roles)||void 0===d?void 0:d.map(e=>e.code);n.useEffect(()=>{fe&&fe.revalidate(),me&&me.revalidate()},[]);let Oe=(null==fe||null===(v=fe.data)||void 0===v||null===(m=v.actionState)||void 0===m||null===(p=m.nextActions)||void 0===p?void 0:p.filter(e=>(null==Le?void 0:Le.some(t=>{var n;return null===(n=e.roles)||void 0===n?void 0:n.includes(t)}))||!e.roles))||(null==fe||null===(f=fe.data)||void 0===f||null===(E=f.nextActions)||void 0===E?void 0:E.filter(e=>(null==Le?void 0:Le.some(t=>{var n;return null===(n=e.roles)||void 0===n?void 0:n.includes(t)}))||!e.roles));console.log("actions here",Oe),n.useEffect(()=>{var e;const t=null==pe||null===(e=pe.Noc)||void 0===e?void 0:e[0];if(t){var n,l,i,o,a,r;const e=null==t||null===(n=t.nocDetails)||void 0===n||null===(l=n.additionalDetails)||void 0===l?void 0:l.applicationDetails,u=null==t||null===(i=t.nocDetails)||void 0===i||null===(o=i.additionalDetails)||void 0===o?void 0:o.siteDetails,s=null==t||null===(a=t.nocDetails)||void 0===a||null===(r=a.additionalDetails)||void 0===r?void 0:r.coordinates,d=(null==t?void 0:t.documents)||[];le({applicantDetails:e?[e]:[],siteDetails:u?[u]:[],coordinates:s?[s]:[],Documents:d.length>0?d:[]})}},[null==pe?void 0:pe.Noc]);const Te=function(e){try{var t,n;const l=c({},(null==pe||null===(t=pe.Noc)||void 0===t?void 0:t[0])||{},{workflow:{}}),i=null==e||null===(n=e.Licenses)||void 0===n?void 0:n[0];l.workflow={action:i.action,assignes:null==i?void 0:i.assignee,comment:null==i?void 0:i.comment,documents:null==i?void 0:i.wfDocuments};const o={Noc:c({},l)};console.log("final Payload ",o);const a=kt(function(){return Promise.resolve(Digit.NOCService.NOCUpdate({tenantId:G,details:o})).then(function(e){var t;if("successful"===(null==e||null===(t=e.ResponseInfo)||void 0===t?void 0:t.status))if("CANCEL"===(null==i?void 0:i.action))X({key:"true",success:!0,message:"COMMON_APPLICATION_CANCELLED_LABEL"}),fe.revalidate(),Se(null);else if("APPLY"===(null==i?void 0:i.action)||"RESUBMIT"===(null==i?void 0:i.action)||"DRAFT"===(null==i?void 0:i.action)){var n,l;console.log("We are calling employee response page"),Y.replace({pathname:"/digit-ui/employee/noc/response/"+(null==e||null===(n=e.Noc)||void 0===n||null===(l=n[0])||void 0===l?void 0:l.applicationNo),state:{data:e}})}else X({key:"true",success:!0,message:"COMMON_SUCCESSFULLY_UPDATED_APPLICATION_STATUS_LABEL"}),fe.revalidate(),Se(null);else X({key:"true",warning:!0,message:"COMMON_SOMETHING_WENT_WRONG_LABEL"}),Se(null)})},function(){X({key:"true",error:!0,message:"COMMON_SOME_ERROR_OCCURRED_LABEL"})});return Promise.resolve(a&&a.then?a.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},Ie=e=>{if(0===e)return V("NOC_GROUND_FLOOR_AREA_LABEL");const t=e%10,n=e%100;let l="th";return(n<11||n>13)&&(1===t?l="st":2===t?l="nd":3===t&&(l="rd")),""+e+l+" "+V("NOC_FLOOR_AREA_LABEL")};return console.log("displayData here",ne),l.createElement("div",{className:"employee-main-application-details"},l.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:"16px"}},l.createElement(t.Header,{styles:{fontSize:"32px"}},V("NDC_APP_OVER_VIEW_HEADER"))),l.createElement(t.Card,null,l.createElement(t.CardSubHeader,null,V("NOC_APPLICANT_DETAILS")),null==ne||null===(g=ne.applicantDetails)||void 0===g?void 0:g.map((e,n)=>{var i;return l.createElement("div",{key:n,style:{marginBottom:"30px",background:"#FAFAFA",padding:"16px",borderRadius:"4px"}},l.createElement(t.StatusTable,null,l.createElement(t.Row,{label:V("NOC_FIRM_OWNER_NAME_LABEL"),text:(null==e?void 0:e.applicantOwnerOrFirmName)||"N/A"}),l.createElement(t.Row,{label:V("NOC_APPLICANT_EMAIL_LABEL"),text:(null==e?void 0:e.applicantEmailId)||"N/A"}),l.createElement(t.Row,{label:V("NOC_APPLICANT_FATHER_HUSBAND_NAME_LABEL"),text:(null==e?void 0:e.applicantFatherHusbandName)||"N/A"}),l.createElement(t.Row,{label:V("NOC_APPLICANT_MOBILE_NO_LABEL"),text:(null==e?void 0:e.applicantMobileNumber)||"N/A"}),l.createElement(t.Row,{label:V("NOC_APPLICANT_DOB_LABEL"),text:(null==e?void 0:e.applicantDateOfBirth)||"N/A"}),l.createElement(t.Row,{label:V("NOC_APPLICANT_GENDER_LABEL"),text:(null==e||null===(i=e.applicantGender)||void 0===i?void 0:i.code)||(null==e?void 0:e.applicantGender)||"N/A"}),l.createElement(t.Row,{label:V("NOC_APPLICANT_ADDRESS_LABEL"),text:(null==e?void 0:e.applicantAddress)||"N/A"}),l.createElement(t.Row,{label:V("NOC_APPLICANT_PROPERTY_ID_LABEL"),text:(null==e?void 0:e.applicantPropertyId)||"N/A"})))})),(null==ne||null===(_=ne.applicantDetails)||void 0===_?void 0:_.some(e=>{var t,n;return(null==e||null===(t=e.professionalName)||void 0===t||null===(n=t.trim())||void 0===n?void 0:n.length)>0}))&&(null==ne||null===(h=ne.applicantDetails)||void 0===h?void 0:h.map((e,n)=>l.createElement(l.Fragment,null,l.createElement(t.Card,null,l.createElement(t.CardSubHeader,null,V("NOC_PROFESSIONAL_DETAILS")),l.createElement("div",{key:n,style:{marginBottom:"30px",background:"#FAFAFA",padding:"16px",borderRadius:"4px"}},l.createElement(t.StatusTable,null,l.createElement(t.Row,{label:V("NOC_PROFESSIONAL_NAME_LABEL"),text:(null==e?void 0:e.professionalName)||"N/A"}),l.createElement(t.Row,{label:V("NOC_PROFESSIONAL_EMAIL_LABEL"),text:(null==e?void 0:e.professionalEmailId)||"N/A"}),l.createElement(t.Row,{label:V("NOC_PROFESSIONAL_REGISTRATION_ID_LABEL"),text:(null==e?void 0:e.professionalRegId)||"N/A"}),l.createElement(t.Row,{label:V("NOC_PROFESSIONAL_MOBILE_NO_LABEL"),text:(null==e?void 0:e.professionalMobileNumber)||"N/A"}),l.createElement(t.Row,{label:V("NOC_PROFESSIONAL_ADDRESS_LABEL"),text:(null==e?void 0:e.professionalAddress)||"N/A"}))))))),l.createElement(t.Card,null,l.createElement(t.CardSubHeader,null,V("NOC_SITE_DETAILS")),null==ne||null===(A=ne.siteDetails)||void 0===A?void 0:A.map((e,n)=>{var i,o,a,r,u,s,d;return l.createElement("div",{key:n,style:{marginBottom:"30px",background:"#FAFAFA",padding:"16px",borderRadius:"4px"}},l.createElement(t.StatusTable,null,l.createElement(t.Row,{label:V("NOC_PLOT_NO_LABEL"),text:(null==e?void 0:e.plotNo)||"N/A"}),l.createElement(t.Row,{label:V("NOC_PROPOSED_SITE_ADDRESS"),text:(null==e?void 0:e.proposedSiteAddress)||"N/A"}),l.createElement(t.Row,{label:V("NOC_ULB_NAME_LABEL"),text:(null==e||null===(i=e.ulbName)||void 0===i?void 0:i.name)||(null==e?void 0:e.ulbName)||"N/A"}),l.createElement(t.Row,{label:V("NOC_ULB_TYPE_LABEL"),text:(null==e?void 0:e.ulbType)||"N/A"}),l.createElement(t.Row,{label:V("NOC_KHASRA_NO_LABEL"),text:(null==e?void 0:e.khasraNo)||"N/A"}),l.createElement(t.Row,{label:V("NOC_HADBAST_NO_LABEL"),text:(null==e?void 0:e.hadbastNo)||"N/A"}),l.createElement(t.Row,{label:V("NOC_ROAD_TYPE_LABEL"),text:(null==e||null===(o=e.roadType)||void 0===o?void 0:o.name)||(null==e?void 0:e.roadType)||"N/A"}),l.createElement(t.Row,{label:V("NOC_AREA_LEFT_FOR_ROAD_WIDENING_LABEL"),text:(null==e?void 0:e.areaLeftForRoadWidening)||"N/A"}),l.createElement(t.Row,{label:V("NOC_NET_PLOT_AREA_AFTER_WIDENING_LABEL"),text:(null==e?void 0:e.netPlotAreaAfterWidening)||"N/A"}),l.createElement(t.Row,{label:V("NOC_NET_TOTAL_AREA_LABEL"),text:(null==e?void 0:e.netTotalArea)||"N/A"}),l.createElement(t.Row,{label:V("NOC_ROAD_WIDTH_AT_SITE_LABEL"),text:(null==e?void 0:e.roadWidthAtSite)||"N/A"}),l.createElement(t.Row,{label:V("NOC_BUILDING_STATUS_LABEL"),text:(null==e||null===(a=e.buildingStatus)||void 0===a?void 0:a.name)||(null==e?void 0:e.buildingStatus)||"N/A"}),l.createElement(t.Row,{label:V("NOC_IS_BASEMENT_AREA_PRESENT_LABEL"),text:(null==e||null===(r=e.isBasementAreaAvailable)||void 0===r?void 0:r.code)||(null==e?void 0:e.isBasementAreaAvailable)||"N/A"}),"Built Up"==(null==e?void 0:e.buildingStatus)&&l.createElement(t.Row,{label:V("NOC_BASEMENT_AREA_LABEL"),text:(null==e?void 0:e.basementArea)||"N/A"}),"Built Up"==(null==e?void 0:e.buildingStatus)&&(null==e||null===(u=e.floorArea)||void 0===u?void 0:u.map((e,n)=>l.createElement(t.Row,{label:Ie(n),text:e.value||"N/A"}))),"Built Up"==(null==e?void 0:e.buildingStatus)&&l.createElement(t.Row,{label:V("NOC_TOTAL_FLOOR_BUILT_UP_AREA_LABEL"),text:(null==e?void 0:e.totalFloorArea)||"N/A"}),l.createElement(t.Row,{label:V("NOC_DISTRICT_LABEL"),text:(null==e||null===(s=e.district)||void 0===s?void 0:s.name)||(null==e?void 0:e.district)||"N/A"}),l.createElement(t.Row,{label:V("NOC_ZONE_LABEL"),text:(null==e||null===(d=e.zone)||void 0===d?void 0:d.name)||(null==e?void 0:e.zone)||"N/A"}),l.createElement(t.Row,{label:V("NOC_SITE_WARD_NO_LABEL"),text:(null==e?void 0:e.wardNo)||"N/A"}),l.createElement(t.Row,{label:V("NOC_SITE_VILLAGE_NAME_LABEL"),text:(null==e?void 0:e.villageName)||"N/A"}),l.createElement(t.Row,{label:V("NOC_SITE_COLONY_NAME_LABEL"),text:(null==e?void 0:e.colonyName)||"N/A"}),l.createElement(t.Row,{label:V("NOC_SITE_VASIKA_NO_LABEL"),text:(null==e?void 0:e.vasikaNumber)||"N/A"}),l.createElement(t.Row,{label:V("NOC_SITE_KHEWAT_AND_KHATUNI_NO_LABEL"),text:(null==e?void 0:e.khewatAndKhatuniNo)||"N/A"})))})),l.createElement(t.Card,null,l.createElement(t.CardSubHeader,null,V("NOC_SPECIFICATION_DETAILS")),null==ne||null===(S=ne.siteDetails)||void 0===S?void 0:S.map((e,n)=>{var i,o,a,r;return l.createElement("div",{key:n,style:{marginBottom:"30px",background:"#FAFAFA",padding:"16px",borderRadius:"4px"}},l.createElement(t.StatusTable,null,l.createElement(t.Row,{label:V("NOC_PLOT_AREA_JAMA_BANDI_LABEL"),text:(null==e?void 0:e.specificationPlotArea)||"N/A"}),l.createElement(t.Row,{label:V("NOC_BUILDING_CATEGORY_LABEL"),text:(null==e||null===(i=e.specificationBuildingCategory)||void 0===i?void 0:i.name)||(null==e?void 0:e.specificationBuildingCategory)||"N/A"}),l.createElement(t.Row,{label:V("NOC_NOC_TYPE_LABEL"),text:(null==e||null===(o=e.specificationNocType)||void 0===o?void 0:o.name)||(null==e?void 0:e.specificationNocType)||"N/A"}),l.createElement(t.Row,{label:V("NOC_RESTRICTED_AREA_LABEL"),text:(null==e||null===(a=e.specificationRestrictedArea)||void 0===a?void 0:a.code)||(null==e?void 0:e.specificationRestrictedArea)||"N/A"}),l.createElement(t.Row,{label:V("NOC_IS_SITE_UNDER_MASTER_PLAN_LABEL"),text:(null==e||null===(r=e.specificationIsSiteUnderMasterPlan)||void 0===r?void 0:r.code)||(null==e?void 0:e.specificationIsSiteUnderMasterPlan)||"N/A"})))})),l.createElement(t.Card,null,l.createElement(t.CardSubHeader,null,V("NOC_SITE_COORDINATES_LABEL")),null==ne||null===(N=ne.coordinates)||void 0===N?void 0:N.map((e,n)=>l.createElement("div",{key:n,style:{marginBottom:"30px",background:"#FAFAFA",padding:"16px",borderRadius:"4px"}},l.createElement(t.StatusTable,null,l.createElement(t.Row,{label:V("COMMON_LATITUDE1_LABEL"),text:(null==e?void 0:e.Latitude1)||"N/A"}),l.createElement(t.Row,{label:V("COMMON_LONGITUDE1_LABEL"),text:(null==e?void 0:e.Longitude1)||"N/A"}),l.createElement(t.Row,{label:V("COMMON_LATITUDE2_LABEL"),text:(null==e?void 0:e.Latitude2)||"N/A"}),l.createElement(t.Row,{label:V("COMMON_LONGITUDE2_LABEL"),text:(null==e?void 0:e.Longitude2)||"N/A"}))))),l.createElement(t.Card,null,l.createElement(t.CardSubHeader,null,V("NOC_TITILE_DOCUMENT_UPLOADED")),l.createElement(t.StatusTable,null,(null==ne||null===(b=ne.Documents)||void 0===b?void 0:b.length)>0&&l.createElement(Al,{documents:ne.Documents}))),l.createElement(t.Card,null,l.createElement(t.CardSubHeader,null,V("NOC_FEE_DETAILS_LABEL")),(null==pe||null===(C=pe.Noc)||void 0===C||null===(y=C[0])||void 0===y?void 0:y.nocDetails)&&l.createElement(Sl,{formData:{apiData:c({},pe),applicationDetails:c({},null==pe||null===(D=pe.Noc)||void 0===D||null===(L=D[0])||void 0===L||null===(O=L.nocDetails)||void 0===O||null===(T=O.additionalDetails)||void 0===T?void 0:T.applicationDetails),siteDetails:c({},null==pe||null===(I=pe.Noc)||void 0===I||null===(w=I[0])||void 0===w||null===(P=w.nocDetails)||void 0===P||null===(R=P.additionalDetails)||void 0===R?void 0:R.siteDetails)}})),(null==fe||null===(x=fe.data)||void 0===x?void 0:x.timeline)&&l.createElement(t.Card,null,l.createElement(t.CardSubHeader,null,V("CS_APPLICATION_DETAILS_APPLICATION_TIMELINE")),1===(null==fe||null===(B=fe.data)||void 0===B?void 0:B.timeline.length)?l.createElement(t.CheckPoint,{isCompleted:!0,label:V(null==fe||null===(F=fe.data)||void 0===F||null===(M=F.timeline[0])||void 0===M?void 0:M.status)}):l.createElement(t.ConnectingCheckPoints,null,null==fe||null===(U=fe.data)||void 0===U?void 0:U.timeline.map((e,n,i)=>l.createElement(t.CheckPoint,{keyValue:n,isCompleted:0===n,label:V("NOC_STATUS_"+e.status),customChild:Nl(e,n,0,V)})))),(null==Oe?void 0:Oe.length)>0&&l.createElement(t.ActionBar,null,_e&&(null!=fe&&null!==(k=fe.data)&&void 0!==k&&null!==(W=k.actionState)&&void 0!==W&&W.nextActions||null!=fe&&null!==(H=fe.data)&&void 0!==H&&H.nextActions)?l.createElement(t.Menu,{localeKeyPrefix:"WF_EMPLOYEE_NOC",options:Oe,optionKey:"action",t:V,onSelect:function(e){var t,n,l,i,o;console.log("selected action",e);const a=null==pe||null===(t=pe.Noc)||void 0===t||null===(n=t[0])||void 0===n?void 0:n.applicationNo,r=null==e||null===(l=e.state)||void 0===l||null===(i=l.actions)||void 0===i?void 0:i.filter(t=>t.action==(null==e?void 0:e.action)),u=null==de?void 0:de.filter(e=>{var t;return(null==e?void 0:e.uuid)==(null===(t=r[0])||void 0===t?void 0:t.nextState)});re(null==u||null===(o=u[0])||void 0===o?void 0:o.actions);const s={Licenses:[e]};"EDIT"==(null==e?void 0:e.action)?Y.push("/digit-ui/employee/noc/edit-application/"+a):"DRAFT"==(null==e?void 0:e.action)?X({key:"true",warning:!0,message:"COMMON_EDIT_APPLICATION_BEFORE_SAVE_OR_SUBMIT_LABEL"}):"APPLY"==(null==e?void 0:e.action)||"RESUBMIT"==(null==e?void 0:e.action)||"CANCEL"==(null==e?void 0:e.action)?Te(s):"PAY"==(null==e?void 0:e.action)?Y.push("/digit-ui/employee/payment/collect/obpas_noc/"+a+"/"+G+"?tenantId="+G):(be(!0),Se(e))}}):null,l.createElement(t.SubmitBar,{ref:De,label:V("WF_TAKE_ACTION"),onSubmit:()=>he(!_e)})),Ne?l.createElement(hl,{t:V,action:Ae,tenantId:G,state:K,getEmployees:ae,id:z,applicationDetails:pe,applicationData:null==pe?void 0:pe.Noc,closeModal:()=>{Se(null),be(!1)},submitAction:Te,actionData:null==fe||null===(j=fe.data)||void 0===j?void 0:j.timeline,workflowDetails:fe,showToast:q,setShowToast:X,closeToast:Ce,errors:J,showErrorToast:Z,errorOne:ee,closeToastOne:()=>{$(null)}}):null,q&&l.createElement(t.Toast,{error:null==q?void 0:q.error,warning:null==q?void 0:q.warning,label:V(null==q?void 0:q.message),isDleteBtn:!0,onClose:Ce}),(ve||ue)&&l.createElement(t.Loader,{page:!0}))},NewNOCEditApplication:()=>{var e,a,r,u,d,v,m,p;const{id:f}=i.useParams(),{t:E}=(i.useHistory(),o.useTranslation()),g=s.useDispatch(),[_,h]=n.useState(null),A=s.useSelector(e=>e.noc.NOCNewApplicationFormReducer),S=A.formData,N=A.step;let b;b=window.location.pathname.includes("employee")?window.localStorage.getItem("Employee.tenant-id"):window.localStorage.getItem("CITIZEN.CITY"),console.log("tenantId here",b);const{isLoading:C,data:y}=Digit.Hooks.noc.useNOCSearchApplication({applicationNo:f},b),D=null==y?void 0:y.resData;console.log("applicationDetails here==>",D);const L=(null==D||null===(e=D.Noc)||void 0===e?void 0:e[0])||{},O=(null==L||null===(a=L.nocDetails)||void 0===a||null===(r=a.additionalDetails)||void 0===r?void 0:r.applicationDetails)||{},T=(null==L||null===(u=L.nocDetails)||void 0===u||null===(d=u.additionalDetails)||void 0===d?void 0:d.siteDetails)||{},I=(null==L||null===(v=L.documents)||void 0===v?void 0:v.filter(e=>(null==e?void 0:e.documentUid)||(null==e?void 0:e.documentType)))||[],w=(null==L||null===(m=L.nocDetails)||void 0===m||null===(p=m.additionalDetails)||void 0===p?void 0:p.coordinates)||{},P=Digit.ULBService.getStateId(),{data:R,isLoading:x}=Digit.Hooks.noc.useBuildingType(P),{data:B}=Digit.Hooks.noc.useRoadType(P),{data:F}=Digit.Hooks.noc.useBuildingCategory(P),{data:M}=Digit.Hooks.noc.useNocType(P),{data:U,isLoading:k}=Digit.Hooks.useTenants(),[W,H]=n.useState(Digit.Hooks.noc.useTenants()),j=[{code:"YES",i18nKey:"YES"},{code:"NO",i18nKey:"NO"}],z=null==U?void 0:U.map(e=>c({},e,{displayName:E(e.i18nKey)})),{data:V}=Digit.Hooks.obps.useMDMS(P,"common-masters",["GenderType"]);let G=[];V&&V["common-masters"].GenderType.filter(e=>e.active).map(e=>{G.push({i18nKey:"COMMON_GENDER_"+e.code,code:""+e.code,value:""+e.code})});const[Y,K]=n.useState(null),{data:q}=Digit.Hooks.useBoundaryLocalities(null==Y?void 0:Y.code,"revenue",{enabled:!!Y},E);return n.useEffect(()=>{if((null==q?void 0:q.length)>0&&null!=T&&T.zone){var e;const t=(null==T||null===(e=T.zone)||void 0===e?void 0:e.name)||(null==T?void 0:T.zone),n=q.find(e=>e.name===t);n&&g(bi("siteDetails",c({},S.siteDetails,{zone:n})))}},[q,null==T?void 0:T.zone]),n.useEffect(()=>{if(g({type:"RESET_NOC_NEW_APPLICATION_FORM"}),!C&&!x&&null!=L&&L.nocDetails&&!k){const e={documents:{documents:null==I?void 0:I.map(e=>({documentType:(null==e?void 0:e.documentType)||"",uuid:(null==e?void 0:e.uuid)||"",documentUid:(null==e?void 0:e.documentUid)||"",documentAttachment:(null==e?void 0:e.documentAttachment)||"",filestoreId:(null==e?void 0:e.uuid)||""}))}};Object.entries(w).forEach(e=>{let[t,n]=e;g(yi(t,n))});const t=c({},O,{applicantGender:G.find(e=>{var t;return e.code===(null==O||null===(t=O.applicantGender)||void 0===t?void 0:t.code)||e.code===(null==O?void 0:O.applicantGender)})}),n=W.find(e=>{var t;return e.name===(null==T||null===(t=T.district)||void 0===t?void 0:t.name)||e.name===(null==T?void 0:T.district)});K(n);const l=c({},T,{ulbName:z.find(e=>{var t;return e.name===(null==T||null===(t=T.ulbName)||void 0===t?void 0:t.name)||e.name===(null==T?void 0:T.ulbName)}),roadType:B.find(e=>{var t;return e.name===(null==T||null===(t=T.roadType)||void 0===t?void 0:t.name)||e.name===(null==T?void 0:T.roadType)}),buildingStatus:R.find(e=>{var t;return e.name===(null==T||null===(t=T.buildingStatus)||void 0===t?void 0:t.name)||e.name===(null==T?void 0:T.buildingStatus)}),isBasementAreaAvailable:j.find(e=>{var t;return e.code===(null==T||null===(t=T.isBasementAreaAvailable)||void 0===t?void 0:t.code)||e.code===(null==T?void 0:T.isBasementAreaAvailable)}),district:n,specificationBuildingCategory:F.find(e=>{var t;return e.name===(null==T||null===(t=T.specificationBuildingCategory)||void 0===t?void 0:t.name)||e.name===(null==T?void 0:T.specificationBuildingCategory)}),specificationNocType:M.find(e=>{var t;return e.name===(null==T||null===(t=T.specificationNocType)||void 0===t?void 0:t.name)||e.name===(null==T?void 0:T.specificationNocType)}),specificationRestrictedArea:j.find(e=>{var t;return e.code===(null==T||null===(t=T.specificationRestrictedArea)||void 0===t?void 0:t.code)||e.code===(null==T?void 0:T.specificationRestrictedArea)}),specificationIsSiteUnderMasterPlan:j.find(e=>{var t;return e.code===(null==T||null===(t=T.specificationIsSiteUnderMasterPlan)||void 0===t?void 0:t.code)||e.code===(null==T?void 0:T.specificationIsSiteUnderMasterPlan)})});g(bi("applicationDetails",t)),g(bi("siteDetails",l)),g(bi("documents",e)),g(bi("apiData",D))}},[C,D,x]),C||!S.applicationDetails?l.createElement("div",null,l.createElement(t.Loader,null)):l.createElement("div",{className:"pageCard"},l.createElement(t.CardHeader,{styles:{fontSize:"28px",fontWeight:"400",color:"#1C1D1F"},divider:!0},E("NOC_REGISTRATION_APPLICATION")),l.createElement(Si,{stepsList:Bi,onSubmit:e=>{},step:N,setStep:e=>{g(Ci(e))}}),_&&l.createElement(t.Toast,{error:_.key,label:E(_.label),onClose:()=>{h(null)},isDleteBtn:"true"}))},NOCCitizenSearchApplication:()=>{const{t:e}=o.useTranslation(),i=Digit.UserService.getUser().info;let a;a=window.location.pathname.includes("employee")?window.localStorage.getItem("Employee.tenant-id"):window.localStorage.getItem("CITIZEN.CITY");const r={offset:0,limit:10,tenantId:a,mobileNumber:null==i?void 0:i.mobileNumber},[u,s]=n.useState(r),d=window.Digit.Utils.browser.isMobile(),[c,v]=n.useState([{display:"ES_COMMON_NO_DATA"}]),[m,p]=n.useState(0),{data:f,isLoading:E,error:g}=Digit.Hooks.noc.useNOCSearchApplicationByIdOrMobile(u,a,{});return n.useEffect(()=>{var e;null==f?v([{display:"ES_COMMON_NO_DATA"}]):(null==f||null===(e=f.data)||void 0===e?void 0:e.length)>0&&(v(null==f?void 0:f.data),p(null==f?void 0:f.totalCount))},[f]),l.createElement("div",null,l.createElement(t.CardHeader,{styles:d?{fontSize:"32px",fontWeight:"700",paddingLeft:"10px"}:{fontSize:"32px",fontWeight:"700"}},e("ACTION_TEST_SEARCH_NOC_APPLICATION")),l.createElement(Jo,{t:e,tenantId:a,onSubmit:function(e,t){console.log("_data==>",e);let n=ht(e);!!n.applicationNo&&!n.mobileNumber&&(console.log("we are deleteing mobileNumber here"),delete n.mobileNumber),s(n)},isLoading:E,Count:m,error:g,data:c}))}};exports.NOCLinks=Qo,exports.NOCModule=Zo,exports.NOCReducers=()=>u.combineReducers({NOCNewApplicationFormReducer:Ei}),exports.initNOCComponents=()=>{Object.entries($o).forEach(e=>{let[t,n]=e;Digit.ComponentRegistryService.setComponent(t,n)})};
|