@djb25/digit-ui-module-commonpt 1.0.2 → 1.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,9 +1 @@
1
- var e,t=require("@djb25/digit-ui-react-components"),n=require("react"),l=(e=n)&&"object"==typeof e&&"default"in e?e.default:e,o=require("react-i18next"),r=require("react-router-dom"),a=require("react-query"),u=require("react-hook-form");const d=[{head:"PT_ASSEMBLY_DET",body:[{type:"component",route:"property-type",isMandatory:!0,component:"CPTPropertyAssemblyDetails",texts:{headerCaption:"",header:"PT_ASSEMBLY_DET",cardText:"",submitBarLabel:"PT_COMMONS_NEXT"},nextStep:{COMMON_PROPTYPE_BUILTUP_INDEPENDENTPROPERTY:"landarea",COMMON_PROPTYPE_BUILTUP_SHAREDPROPERTY:"PtUnits",COMMON_PROPTYPE_VACANT:"area"},key:"assemblyDet",withoutLabel:!0}]},{head:"PT_LOCATION_DETAILS",body:[{type:"component",route:"property-type",isMandatory:!0,component:"CPTPropertyLocationDetails",texts:{headerCaption:"",header:"PT_LOCATION_DETAILS",cardText:"",submitBarLabel:"PT_COMMONS_NEXT"},nextStep:{COMMON_PROPTYPE_BUILTUP_INDEPENDENTPROPERTY:"landarea",COMMON_PROPTYPE_BUILTUP_SHAREDPROPERTY:"PtUnits",COMMON_PROPTYPE_VACANT:"area"},key:"locationDet",withoutLabel:!0}]},{head:"PT_OWNERSHIP_DETAILS",body:[{type:"component",route:"institutional-owner-address",isMandatory:!0,component:"CPTPropertyOwnerDetails",texts:{headerCaption:"PT_OWNERS_DETAILS",header:"PT_OWNERS_ADDRESS",cardText:"",submitBarLabel:"PT_COMMON_NEXT"},key:"owners",withoutLabel:!0,nextStep:"institutional-proof-of-identity",hideInEmployee:!0}]}];var s="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function c(e,t){return e(t={exports:{}},t.exports),t.exports}var p=c(function(e,t){(function(){var n="Expected a function",l="__lodash_placeholder__",o=[["ary",128],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",32],["partialRight",64],["rearg",256]],i="[object Arguments]",r="[object Array]",a="[object Boolean]",u="[object Date]",d="[object Error]",c="[object Function]",p="[object GeneratorFunction]",v="[object Map]",m="[object Number]",f="[object Object]",E="[object RegExp]",y="[object Set]",_="[object String]",g="[object Symbol]",h="[object WeakMap]",S="[object ArrayBuffer]",b="[object DataView]",T="[object Float32Array]",C="[object Float64Array]",A="[object Int8Array]",N="[object Int16Array]",I="[object Int32Array]",P="[object Uint8Array]",O="[object Uint16Array]",D="[object Uint32Array]",w=/\b__p \+= '';/g,R=/\b(__p \+=) '' \+/g,L=/(__e\(.*?\)|\b__t\)) \+\n'';/g,x=/&(?:amp|lt|gt|quot|#39);/g,M=/[&<>"']/g,F=RegExp(x.source),k=RegExp(M.source),B=/<%-([\s\S]+?)%>/g,U=/<%([\s\S]+?)%>/g,j=/<%=([\s\S]+?)%>/g,H=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,W=/^\w*$/,V=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,$=/[\\^$.*+?()[\]{}|]/g,z=RegExp($.source),Y=/^\s+/,K=/\s/,q=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,G=/\{\n\/\* \[wrapped with (.+)\] \*/,Z=/,? & /,X=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,J=/[()=,{}\[\]\/\s]/,Q=/\\(\\)?/g,ee=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,te=/\w*$/,ne=/^[-+]0x[0-9a-f]+$/i,le=/^0b[01]+$/i,oe=/^\[object .+?Constructor\]$/,ie=/^0o[0-7]+$/i,re=/^(?:0|[1-9]\d*)$/,ae=/[\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",pe="["+ce+"]",ve="["+se+"]",me="\\d+",fe="[a-z\\xdf-\\xf6\\xf8-\\xff]",Ee="[^\\ud800-\\udfff"+ce+me+"\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",ye="\\ud83c[\\udffb-\\udfff]",_e="[^\\ud800-\\udfff]",ge="(?:\\ud83c[\\udde6-\\uddff]){2}",he="[\\ud800-\\udbff][\\udc00-\\udfff]",Se="[A-Z\\xc0-\\xd6\\xd8-\\xde]",be="(?:"+fe+"|"+Ee+")",Te="(?:"+Se+"|"+Ee+")",Ce="(?:"+ve+"|"+ye+")?",Ae="[\\ufe0e\\ufe0f]?"+Ce+"(?:\\u200d(?:"+[_e,ge,he].join("|")+")[\\ufe0e\\ufe0f]?"+Ce+")*",Ne="(?:"+["[\\u2700-\\u27bf]",ge,he].join("|")+")"+Ae,Ie="(?:"+[_e+ve+"?",ve,ge,he,"[\\ud800-\\udfff]"].join("|")+")",Pe=RegExp("['’]","g"),Oe=RegExp(ve,"g"),De=RegExp(ye+"(?="+ye+")|"+Ie+Ae,"g"),we=RegExp([Se+"?"+fe+"+(?:['’](?:d|ll|m|re|s|t|ve))?(?="+[pe,Se,"$"].join("|")+")",Te+"+(?:['’](?:D|LL|M|RE|S|T|VE))?(?="+[pe,Se+be,"$"].join("|")+")",Se+"?"+be+"+(?:['’](?: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_])",me,Ne].join("|"),"g"),Re=RegExp("[\\u200d\\ud800-\\udfff"+se+"\\ufe0e\\ufe0f]"),Le=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,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"],Me=-1,Fe={};Fe[T]=Fe[C]=Fe[A]=Fe[N]=Fe[I]=Fe[P]=Fe["[object Uint8ClampedArray]"]=Fe[O]=Fe[D]=!0,Fe[i]=Fe[r]=Fe[S]=Fe[a]=Fe[b]=Fe[u]=Fe[d]=Fe[c]=Fe[v]=Fe[m]=Fe[f]=Fe[E]=Fe[y]=Fe[_]=Fe[h]=!1;var ke={};ke[i]=ke[r]=ke[S]=ke[b]=ke[a]=ke[u]=ke[T]=ke[C]=ke[A]=ke[N]=ke[I]=ke[v]=ke[m]=ke[f]=ke[E]=ke[y]=ke[_]=ke[g]=ke[P]=ke["[object Uint8ClampedArray]"]=ke[O]=ke[D]=!0,ke[d]=ke[c]=ke[h]=!1;var Be={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Ue=parseFloat,je=parseInt,He="object"==typeof s&&s&&s.Object===Object&&s,We="object"==typeof self&&self&&self.Object===Object&&self,Ve=He||We||Function("return this")(),$e=t&&!t.nodeType&&t,ze=$e&&e&&!e.nodeType&&e,Ye=ze&&ze.exports===$e,Ke=Ye&&He.process,qe=function(){try{return ze&&ze.require&&ze.require("util").types||Ke&&Ke.binding&&Ke.binding("util")}catch(e){}}(),Ge=qe&&qe.isArrayBuffer,Ze=qe&&qe.isDate,Xe=qe&&qe.isMap,Je=qe&&qe.isRegExp,Qe=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 o=-1,i=null==e?0:e.length;++o<i;){var r=e[o];t(l,r,n(r),e)}return l}function lt(e,t){for(var n=-1,l=null==e?0:e.length;++n<l&&!1!==t(e[n],n,e););return e}function ot(e,t){for(var n=null==e?0:e.length;n--&&!1!==t(e[n],n,e););return e}function it(e,t){for(var n=-1,l=null==e?0:e.length;++n<l;)if(!t(e[n],n,e))return!1;return!0}function rt(e,t){for(var n=-1,l=null==e?0:e.length,o=0,i=[];++n<l;){var r=e[n];t(r,n,e)&&(i[o++]=r)}return i}function at(e,t){return!(null==e||!e.length)&&yt(e,t,0)>-1}function ut(e,t,n){for(var l=-1,o=null==e?0:e.length;++l<o;)if(n(t,e[l]))return!0;return!1}function dt(e,t){for(var n=-1,l=null==e?0:e.length,o=Array(l);++n<l;)o[n]=t(e[n],n,e);return o}function st(e,t){for(var n=-1,l=t.length,o=e.length;++n<l;)e[o+n]=t[n];return e}function ct(e,t,n,l){var o=-1,i=null==e?0:e.length;for(l&&i&&(n=e[++o]);++o<i;)n=t(n,e[o],o,e);return n}function pt(e,t,n,l){var o=null==e?0:e.length;for(l&&o&&(n=e[--o]);o--;)n=t(n,e[o],o,e);return n}function vt(e,t){for(var n=-1,l=null==e?0:e.length;++n<l;)if(t(e[n],n,e))return!0;return!1}var mt=St("length");function ft(e,t,n){var l;return n(e,function(e,n,o){if(t(e,n,o))return l=n,!1}),l}function Et(e,t,n,l){for(var o=e.length,i=n+(l?1:-1);l?i--:++i<o;)if(t(e[i],i,e))return i;return-1}function yt(e,t,n){return t==t?function(e,t,n){for(var l=n-1,o=e.length;++l<o;)if(e[l]===t)return l;return-1}(e,t,n):Et(e,gt,n)}function _t(e,t,n,l){for(var o=n-1,i=e.length;++o<i;)if(l(e[o],t))return o;return-1}function gt(e){return e!=e}function ht(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 bt(e){return function(t){return null==e?void 0:e[t]}}function Tt(e,t,n,l,o){return o(e,function(e,o,i){n=l?(l=!1,e):t(n,e,o,i)}),n}function Ct(e,t){for(var n,l=-1,o=e.length;++l<o;){var i=t(e[l]);void 0!==i&&(n=void 0===n?i:n+i)}return n}function At(e,t){for(var n=-1,l=Array(e);++n<e;)l[n]=t(n);return l}function Nt(e){return e?e.slice(0,$t(e)+1).replace(Y,""):e}function It(e){return function(t){return e(t)}}function Pt(e,t){return dt(t,function(t){return e[t]})}function Ot(e,t){return e.has(t)}function Dt(e,t){for(var n=-1,l=e.length;++n<l&&yt(t,e[n],0)>-1;);return n}function wt(e,t){for(var n=e.length;n--&&yt(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 Lt=bt({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),xt=bt({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"});function Mt(e){return"\\"+Be[e]}function Ft(e){return Re.test(e)}function kt(e){var t=-1,n=Array(e.size);return e.forEach(function(e,l){n[++t]=[l,e]}),n}function Bt(e,t){return function(n){return e(t(n))}}function Ut(e,t){for(var n=-1,o=e.length,i=0,r=[];++n<o;){var a=e[n];a!==t&&a!==l||(e[n]=l,r[i++]=n)}return r}function jt(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 Wt(e){return Ft(e)?function(e){for(var t=De.lastIndex=0;De.test(e);)++t;return t}(e):mt(e)}function Vt(e){return Ft(e)?function(e){return e.match(De)||[]}(e):function(e){return e.split("")}(e)}function $t(e){for(var t=e.length;t--&&K.test(e.charAt(t)););return t}var zt=bt({"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"}),Yt=function e(t){var s,K=(t=null==t?Ve:Yt.defaults(Ve.Object(),t,Yt.pick(Ve,xe))).Array,se=t.Date,ce=t.Error,pe=t.Function,ve=t.Math,me=t.Object,fe=t.RegExp,Ee=t.String,ye=t.TypeError,_e=K.prototype,ge=me.prototype,he=t["__core-js_shared__"],Se=pe.prototype.toString,be=ge.hasOwnProperty,Te=0,Ce=(s=/[^.]+$/.exec(he&&he.keys&&he.keys.IE_PROTO||""))?"Symbol(src)_1."+s:"",Ae=ge.toString,Ne=Se.call(me),Ie=Ve._,De=fe("^"+Se.call(be).replace($,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Re=Ye?t.Buffer:void 0,Be=t.Symbol,He=t.Uint8Array,We=Re?Re.allocUnsafe:void 0,$e=Bt(me.getPrototypeOf,me),ze=me.create,Ke=ge.propertyIsEnumerable,qe=_e.splice,mt=Be?Be.isConcatSpreadable:void 0,bt=Be?Be.iterator:void 0,Kt=Be?Be.toStringTag:void 0,qt=function(){try{var e=Qo(me,"defineProperty");return e({},"",{}),e}catch(e){}}(),Gt=t.clearTimeout!==Ve.clearTimeout&&t.clearTimeout,Zt=se&&se.now!==Ve.Date.now&&se.now,Xt=t.setTimeout!==Ve.setTimeout&&t.setTimeout,Jt=ve.ceil,Qt=ve.floor,en=me.getOwnPropertySymbols,tn=Re?Re.isBuffer:void 0,nn=t.isFinite,ln=_e.join,on=Bt(me.keys,me),rn=ve.max,an=ve.min,un=se.now,dn=t.parseInt,sn=ve.random,cn=_e.reverse,pn=Qo(t,"DataView"),vn=Qo(t,"Map"),mn=Qo(t,"Promise"),fn=Qo(t,"Set"),En=Qo(t,"WeakMap"),yn=Qo(me,"create"),_n=En&&new En,gn={},hn=Pi(pn),Sn=Pi(vn),bn=Pi(mn),Tn=Pi(fn),Cn=Pi(En),An=Be?Be.prototype:void 0,Nn=An?An.valueOf:void 0,In=An?An.toString:void 0;function Pn(e){if(zr(e)&&!xr(e)&&!(e instanceof Rn)){if(e instanceof wn)return e;if(be.call(e,"__wrapped__"))return Oi(e)}return new wn(e)}var On=function(){function e(){}return function(t){if(!$r(t))return{};if(ze)return ze(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function Dn(){}function wn(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=void 0}function Rn(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=4294967295,this.__views__=[]}function Ln(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var l=e[t];this.set(l[0],l[1])}}function 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 Mn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var l=e[t];this.set(l[0],l[1])}}function Fn(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new Mn;++t<n;)this.add(e[t])}function kn(e){var t=this.__data__=new xn(e);this.size=t.size}function Bn(e,t){var n=xr(e),l=!n&&Lr(e),o=!n&&!l&&Br(e),i=!n&&!l&&!o&&Qr(e),r=n||l||o||i,a=r?At(e.length,Ee):[],u=a.length;for(var d in e)!t&&!be.call(e,d)||r&&("length"==d||o&&("offset"==d||"parent"==d)||i&&("buffer"==d||"byteLength"==d||"byteOffset"==d)||ri(d,u))||a.push(d);return a}function Un(e){var t=e.length;return t?e[Ml(0,t-1)]:void 0}function jn(e,t){return Ti(yo(e),Gn(t,0,e.length))}function Hn(e){return Ti(yo(e))}function Wn(e,t,n){(void 0!==n&&!Dr(e[t],n)||void 0===n&&!(t in e))&&Kn(e,t,n)}function Vn(e,t,n){var l=e[t];be.call(e,t)&&Dr(l,n)&&(void 0!==n||t in e)||Kn(e,t,n)}function $n(e,t){for(var n=e.length;n--;)if(Dr(e[n][0],t))return n;return-1}function zn(e,t,n,l){return el(e,function(e,o,i){t(l,e,n(e),i)}),l}function Yn(e,t){return e&&_o(t,Sa(t),e)}function Kn(e,t,n){"__proto__"==t&&qt?qt(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function qn(e,t){for(var n=-1,l=t.length,o=K(l),i=null==e;++n<l;)o[n]=i?void 0:Ea(e,t[n]);return o}function Gn(e,t,n){return e==e&&(void 0!==n&&(e=e<=n?e:n),void 0!==t&&(e=e>=t?e:t)),e}function Zn(e,t,n,l,o,r){var d,s=1&t,h=2&t,w=4&t;if(n&&(d=o?n(e,l,o,r):n(e)),void 0!==d)return d;if(!$r(e))return e;var R=xr(e);if(R){if(d=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&be.call(e,"index")&&(n.index=e.index,n.input=e.input),n}(e),!s)return yo(e,d)}else{var L=ni(e),x=L==c||L==p;if(Br(e))return co(e,s);if(L==f||L==i||x&&!o){if(d=h||x?{}:oi(e),!s)return h?function(e,t){return _o(e,ti(e),t)}(e,function(e,t){return e&&_o(t,ba(t),e)}(d,e)):function(e,t){return _o(e,ei(e),t)}(e,Yn(d,e))}else{if(!ke[L])return o?e:{};d=function(e,t,n){var l=e.constructor;switch(t){case S:return po(e);case a:case u:return new l(+e);case b:return function(e,t){var n=t?po(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,n);case T:case C:case A:case N:case I:case P:case"[object Uint8ClampedArray]":case O:case D:return vo(e,n);case v:return new l;case m:case _:return new l(e);case E:return function(e){var t=new e.constructor(e.source,te.exec(e));return t.lastIndex=e.lastIndex,t}(e);case y:return new l;case g:return Nn?me(Nn.call(e)):{}}}(e,L,s)}}r||(r=new kn);var M=r.get(e);if(M)return M;r.set(e,d),Zr(e)?e.forEach(function(l){d.add(Zn(l,t,n,l,e,r))}):Yr(e)&&e.forEach(function(l,o){d.set(o,Zn(l,t,n,o,e,r))});var F=R?void 0:(w?h?Yo:zo:h?ba:Sa)(e);return lt(F||e,function(l,o){F&&(l=e[o=l]),Vn(d,o,Zn(l,t,n,o,e,r))}),d}function Xn(e,t,n){var l=n.length;if(null==e)return!l;for(e=me(e);l--;){var o=n[l],i=e[o];if(void 0===i&&!(o in e)||!(0,t[o])(i))return!1}return!0}function Jn(e,t,l){if("function"!=typeof e)throw new ye(n);return gi(function(){e.apply(void 0,l)},t)}function Qn(e,t,n,l){var o=-1,i=at,r=!0,a=e.length,u=[],d=t.length;if(!a)return u;n&&(t=dt(t,It(n))),l?(i=ut,r=!1):t.length>=200&&(i=Ot,r=!1,t=new Fn(t));e:for(;++o<a;){var s=e[o],c=null==n?s:n(s);if(s=l||0!==s?s:0,r&&c==c){for(var p=d;p--;)if(t[p]===c)continue e;u.push(s)}else i(t,c,l)||u.push(s)}return u}Pn.templateSettings={escape:B,evaluate:U,interpolate:j,variable:"",imports:{_:Pn}},(Pn.prototype=Dn.prototype).constructor=Pn,(wn.prototype=On(Dn.prototype)).constructor=wn,(Rn.prototype=On(Dn.prototype)).constructor=Rn,Ln.prototype.clear=function(){this.__data__=yn?yn(null):{},this.size=0},Ln.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Ln.prototype.get=function(e){var t=this.__data__;if(yn){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return be.call(t,e)?t[e]:void 0},Ln.prototype.has=function(e){var t=this.__data__;return yn?void 0!==t[e]:be.call(t,e)},Ln.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=yn&&void 0===t?"__lodash_hash_undefined__":t,this},xn.prototype.clear=function(){this.__data__=[],this.size=0},xn.prototype.delete=function(e){var t=this.__data__,n=$n(t,e);return!(n<0||(n==t.length-1?t.pop():qe.call(t,n,1),--this.size,0))},xn.prototype.get=function(e){var t=this.__data__,n=$n(t,e);return n<0?void 0:t[n][1]},xn.prototype.has=function(e){return $n(this.__data__,e)>-1},xn.prototype.set=function(e,t){var n=this.__data__,l=$n(n,e);return l<0?(++this.size,n.push([e,t])):n[l][1]=t,this},Mn.prototype.clear=function(){this.size=0,this.__data__={hash:new Ln,map:new(vn||xn),string:new Ln}},Mn.prototype.delete=function(e){var t=Xo(this,e).delete(e);return this.size-=t?1:0,t},Mn.prototype.get=function(e){return Xo(this,e).get(e)},Mn.prototype.has=function(e){return Xo(this,e).has(e)},Mn.prototype.set=function(e,t){var n=Xo(this,e),l=n.size;return n.set(e,t),this.size+=n.size==l?0:1,this},Fn.prototype.add=Fn.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},Fn.prototype.has=function(e){return this.__data__.has(e)},kn.prototype.clear=function(){this.__data__=new xn,this.size=0},kn.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},kn.prototype.get=function(e){return this.__data__.get(e)},kn.prototype.has=function(e){return this.__data__.has(e)},kn.prototype.set=function(e,t){var n=this.__data__;if(n instanceof xn){var l=n.__data__;if(!vn||l.length<199)return l.push([e,t]),this.size=++n.size,this;n=this.__data__=new Mn(l)}return n.set(e,t),this.size=n.size,this};var el=So(ul),tl=So(dl,!0);function nl(e,t){var n=!0;return el(e,function(e,l,o){return n=!!t(e,l,o)}),n}function ll(e,t,n){for(var l=-1,o=e.length;++l<o;){var i=e[l],r=t(i);if(null!=r&&(void 0===a?r==r&&!Jr(r):n(r,a)))var a=r,u=i}return u}function ol(e,t){var n=[];return el(e,function(e,l,o){t(e,l,o)&&n.push(e)}),n}function il(e,t,n,l,o){var i=-1,r=e.length;for(n||(n=ii),o||(o=[]);++i<r;){var a=e[i];t>0&&n(a)?t>1?il(a,t-1,n,l,o):st(o,a):l||(o[o.length]=a)}return o}var rl=bo(),al=bo(!0);function ul(e,t){return e&&rl(e,t,Sa)}function dl(e,t){return e&&al(e,t,Sa)}function sl(e,t){return rt(t,function(t){return Hr(e[t])})}function cl(e,t){for(var n=0,l=(t=ro(t,e)).length;null!=e&&n<l;)e=e[Ii(t[n++])];return n&&n==l?e:void 0}function pl(e,t,n){var l=t(e);return xr(e)?l:st(l,n(e))}function vl(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Kt&&Kt in me(e)?function(e){var t=be.call(e,Kt),n=e[Kt];try{e[Kt]=void 0;var l=!0}catch(e){}var o=Ae.call(e);return l&&(t?e[Kt]=n:delete e[Kt]),o}(e):function(e){return Ae.call(e)}(e)}function ml(e,t){return e>t}function fl(e,t){return null!=e&&be.call(e,t)}function El(e,t){return null!=e&&t in me(e)}function yl(e,t,n){for(var l=n?ut:at,o=e[0].length,i=e.length,r=i,a=K(i),u=Infinity,d=[];r--;){var s=e[r];r&&t&&(s=dt(s,It(t))),u=an(s.length,u),a[r]=!n&&(t||o>=120&&s.length>=120)?new Fn(r&&s):void 0}s=e[0];var c=-1,p=a[0];e:for(;++c<o&&d.length<u;){var v=s[c],m=t?t(v):v;if(v=n||0!==v?v:0,!(p?Ot(p,m):l(d,m,n))){for(r=i;--r;){var f=a[r];if(!(f?Ot(f,m):l(e[r],m,n)))continue e}p&&p.push(m),d.push(v)}}return d}function _l(e,t,n){var l=null==(e=fi(e,t=ro(t,e)))?e:e[Ii(ji(t))];return null==l?void 0:tt(l,e,n)}function gl(e){return zr(e)&&vl(e)==i}function hl(e,t,n,l,o){return e===t||(null==e||null==t||!zr(e)&&!zr(t)?e!=e&&t!=t:function(e,t,n,l,o,s){var c=xr(e),p=xr(t),h=c?r:ni(e),T=p?r:ni(t),C=(h=h==i?f:h)==f,A=(T=T==i?f:T)==f,N=h==T;if(N&&Br(e)){if(!Br(t))return!1;c=!0,C=!1}if(N&&!C)return s||(s=new kn),c||Qr(e)?Vo(e,t,n,l,o,s):function(e,t,n,l,o,i,r){switch(n){case b:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case S:return!(e.byteLength!=t.byteLength||!i(new He(e),new He(t)));case a:case u:case m:return Dr(+e,+t);case d:return e.name==t.name&&e.message==t.message;case E:case _:return e==t+"";case v:var s=kt;case y:if(s||(s=jt),e.size!=t.size&&!(1&l))return!1;var c=r.get(e);if(c)return c==t;l|=2,r.set(e,t);var p=Vo(s(e),s(t),l,o,i,r);return r.delete(e),p;case g:if(Nn)return Nn.call(e)==Nn.call(t)}return!1}(e,t,h,n,l,o,s);if(!(1&n)){var I=C&&be.call(e,"__wrapped__"),P=A&&be.call(t,"__wrapped__");if(I||P){var O=I?e.value():e,D=P?t.value():t;return s||(s=new kn),o(O,D,n,l,s)}}return!!N&&(s||(s=new kn),function(e,t,n,l,o,i){var r=1&n,a=zo(e),u=a.length;if(u!=zo(t).length&&!r)return!1;for(var d=u;d--;){var s=a[d];if(!(r?s in t:be.call(t,s)))return!1}var c=i.get(e),p=i.get(t);if(c&&p)return c==t&&p==e;var v=!0;i.set(e,t),i.set(t,e);for(var m=r;++d<u;){var f=e[s=a[d]],E=t[s];if(l)var y=r?l(E,f,s,t,e,i):l(f,E,s,e,t,i);if(!(void 0===y?f===E||o(f,E,n,l,i):y)){v=!1;break}m||(m="constructor"==s)}if(v&&!m){var _=e.constructor,g=t.constructor;_==g||!("constructor"in e)||!("constructor"in t)||"function"==typeof _&&_ instanceof _&&"function"==typeof g&&g instanceof g||(v=!1)}return i.delete(e),i.delete(t),v}(e,t,n,l,o,s))}(e,t,n,l,hl,o))}function Sl(e,t,n,l){var o=n.length,i=o,r=!l;if(null==e)return!i;for(e=me(e);o--;){var a=n[o];if(r&&a[2]?a[1]!==e[a[0]]:!(a[0]in e))return!1}for(;++o<i;){var u=(a=n[o])[0],d=e[u],s=a[1];if(r&&a[2]){if(void 0===d&&!(u in e))return!1}else{var c=new kn;if(l)var p=l(d,s,u,e,t,c);if(!(void 0===p?hl(s,d,3,l,c):p))return!1}}return!0}function bl(e){return!(!$r(e)||(t=e,Ce&&Ce in t))&&(Hr(e)?De:oe).test(Pi(e));var t}function Tl(e){return"function"==typeof e?e:null==e?Ka:"object"==typeof e?xr(e)?Pl(e[0],e[1]):Il(e):nu(e)}function Cl(e){if(!ci(e))return on(e);var t=[];for(var n in me(e))be.call(e,n)&&"constructor"!=n&&t.push(n);return t}function Al(e,t){return e<t}function Nl(e,t){var n=-1,l=Fr(e)?K(e.length):[];return el(e,function(e,o,i){l[++n]=t(e,o,i)}),l}function Il(e){var t=Jo(e);return 1==t.length&&t[0][2]?vi(t[0][0],t[0][1]):function(n){return n===e||Sl(n,e,t)}}function Pl(e,t){return ui(e)&&pi(t)?vi(Ii(e),t):function(n){var l=Ea(n,e);return void 0===l&&l===t?ya(n,e):hl(t,l,3)}}function Ol(e,t,n,l,o){e!==t&&rl(t,function(i,r){if(o||(o=new kn),$r(i))!function(e,t,n,l,o,i,r){var a=yi(e,n),u=yi(t,n),d=r.get(u);if(d)Wn(e,n,d);else{var s=i?i(a,u,n+"",e,t,r):void 0,c=void 0===s;if(c){var p=xr(u),v=!p&&Br(u),m=!p&&!v&&Qr(u);s=u,p||v||m?xr(a)?s=a:kr(a)?s=yo(a):v?(c=!1,s=co(u,!0)):m?(c=!1,s=vo(u,!0)):s=[]:qr(u)||Lr(u)?(s=a,Lr(a)?s=aa(a):$r(a)&&!Hr(a)||(s=oi(u))):c=!1}c&&(r.set(u,s),o(s,u,l,i,r),r.delete(u)),Wn(e,n,s)}}(e,t,r,n,Ol,l,o);else{var a=l?l(yi(e,r),i,r+"",e,t,o):void 0;void 0===a&&(a=i),Wn(e,r,a)}},ba)}function Dl(e,t){var n=e.length;if(n)return ri(t+=t<0?n:0,n)?e[t]:void 0}function wl(e,t,n){t=t.length?dt(t,function(e){return xr(e)?function(t){return cl(t,1===e.length?e[0]:e)}:e}):[Ka];var l=-1;return t=dt(t,It(Zo())),function(e,t){var l=e.length;for(e.sort(function(e,t){return function(e,t,n){for(var l=-1,o=e.criteria,i=t.criteria,r=o.length,a=n.length;++l<r;){var u=mo(o[l],i[l]);if(u)return l>=a?u:u*("desc"==n[l]?-1:1)}return e.index-t.index}(e,t,n)});l--;)e[l]=e[l].value;return e}(Nl(e,function(e,n,o){return{criteria:dt(t,function(t){return t(e)}),index:++l,value:e}}))}function Rl(e,t,n){for(var l=-1,o=t.length,i={};++l<o;){var r=t[l],a=cl(e,r);n(a,r)&&jl(i,ro(r,e),a)}return i}function Ll(e,t,n,l){var o=l?_t:yt,i=-1,r=t.length,a=e;for(e===t&&(t=yo(t)),n&&(a=dt(e,It(n)));++i<r;)for(var u=0,d=t[i],s=n?n(d):d;(u=o(a,s,u,l))>-1;)a!==e&&qe.call(a,u,1),qe.call(e,u,1);return e}function xl(e,t){for(var n=e?t.length:0,l=n-1;n--;){var o=t[n];if(n==l||o!==i){var i=o;ri(o)?qe.call(e,o,1):Jl(e,o)}}return e}function Ml(e,t){return e+Qt(sn()*(t-e+1))}function Fl(e,t){var n="";if(!e||t<1||t>9007199254740991)return n;do{t%2&&(n+=e),(t=Qt(t/2))&&(e+=e)}while(t);return n}function kl(e,t){return hi(mi(e,t,Ka),e+"")}function Bl(e){return Un(Da(e))}function Ul(e,t){var n=Da(e);return Ti(n,Gn(t,0,n.length))}function jl(e,t,n,l){if(!$r(e))return e;for(var o=-1,i=(t=ro(t,e)).length,r=i-1,a=e;null!=a&&++o<i;){var u=Ii(t[o]),d=n;if("__proto__"===u||"constructor"===u||"prototype"===u)return e;if(o!=r){var s=a[u];void 0===(d=l?l(s,u,a):void 0)&&(d=$r(s)?s:ri(t[o+1])?[]:{})}Vn(a,u,d),a=a[u]}return e}var Hl=_n?function(e,t){return _n.set(e,t),e}:Ka,Wl=qt?function(e,t){return qt(e,"toString",{configurable:!0,enumerable:!1,value:$a(t),writable:!0})}:Ka;function Vl(e){return Ti(Da(e))}function $l(e,t,n){var l=-1,o=e.length;t<0&&(t=-t>o?0:o+t),(n=n>o?o:n)<0&&(n+=o),o=t>n?0:n-t>>>0,t>>>=0;for(var i=K(o);++l<o;)i[l]=e[l+t];return i}function zl(e,t){var n;return el(e,function(e,l,o){return!(n=t(e,l,o))}),!!n}function Yl(e,t,n){var l=0,o=null==e?l:e.length;if("number"==typeof t&&t==t&&o<=2147483647){for(;l<o;){var i=l+o>>>1,r=e[i];null!==r&&!Jr(r)&&(n?r<=t:r<t)?l=i+1:o=i}return o}return Kl(e,t,Ka,n)}function Kl(e,t,n,l){var o=0,i=null==e?0:e.length;if(0===i)return 0;for(var r=(t=n(t))!=t,a=null===t,u=Jr(t),d=void 0===t;o<i;){var s=Qt((o+i)/2),c=n(e[s]),p=void 0!==c,v=null===c,m=c==c,f=Jr(c);if(r)var E=l||m;else E=d?m&&(l||p):a?m&&p&&(l||!v):u?m&&p&&!v&&(l||!f):!v&&!f&&(l?c<=t:c<t);E?o=s+1:i=s}return an(i,4294967294)}function ql(e,t){for(var n=-1,l=e.length,o=0,i=[];++n<l;){var r=e[n],a=t?t(r):r;if(!n||!Dr(a,u)){var u=a;i[o++]=0===r?0:r}}return i}function Gl(e){return"number"==typeof e?e:Jr(e)?NaN:+e}function Zl(e){if("string"==typeof e)return e;if(xr(e))return dt(e,Zl)+"";if(Jr(e))return In?In.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Xl(e,t,n){var l=-1,o=at,i=e.length,r=!0,a=[],u=a;if(n)r=!1,o=ut;else if(i>=200){var d=t?null:ko(e);if(d)return jt(d);r=!1,o=Ot,u=new Fn}else u=t?[]:a;e:for(;++l<i;){var s=e[l],c=t?t(s):s;if(s=n||0!==s?s:0,r&&c==c){for(var p=u.length;p--;)if(u[p]===c)continue e;t&&u.push(c),a.push(s)}else o(u,c,n)||(u!==a&&u.push(c),a.push(s))}return a}function Jl(e,t){return null==(e=fi(e,t=ro(t,e)))||delete e[Ii(ji(t))]}function Ql(e,t,n,l){return jl(e,t,n(cl(e,t)),l)}function eo(e,t,n,l){for(var o=e.length,i=l?o:-1;(l?i--:++i<o)&&t(e[i],i,e););return n?$l(e,l?0:i,l?i+1:o):$l(e,l?i+1:0,l?o:i)}function to(e,t){var n=e;return n instanceof Rn&&(n=n.value()),ct(t,function(e,t){return t.func.apply(t.thisArg,st([e],t.args))},n)}function no(e,t,n){var l=e.length;if(l<2)return l?Xl(e[0]):[];for(var o=-1,i=K(l);++o<l;)for(var r=e[o],a=-1;++a<l;)a!=o&&(i[o]=Qn(i[o]||r,e[a],t,n));return Xl(il(i,1),t,n)}function lo(e,t,n){for(var l=-1,o=e.length,i=t.length,r={};++l<o;)n(r,e[l],l<i?t[l]:void 0);return r}function oo(e){return kr(e)?e:[]}function io(e){return"function"==typeof e?e:Ka}function ro(e,t){return xr(e)?e:ui(e,t)?[e]:Ni(ua(e))}var ao=kl;function uo(e,t,n){var l=e.length;return n=void 0===n?l:n,!t&&n>=l?e:$l(e,t,n)}var so=Gt||function(e){return Ve.clearTimeout(e)};function co(e,t){if(t)return e.slice();var n=e.length,l=We?We(n):new e.constructor(n);return e.copy(l),l}function po(e){var t=new e.constructor(e.byteLength);return new He(t).set(new He(e)),t}function vo(e,t){var n=t?po(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function mo(e,t){if(e!==t){var n=void 0!==e,l=null===e,o=e==e,i=Jr(e),r=void 0!==t,a=null===t,u=t==t,d=Jr(t);if(!a&&!d&&!i&&e>t||i&&r&&u&&!a&&!d||l&&r&&u||!n&&u||!o)return 1;if(!l&&!i&&!d&&e<t||d&&n&&o&&!l&&!i||a&&n&&o||!r&&o||!u)return-1}return 0}function fo(e,t,n,l){for(var o=-1,i=e.length,r=n.length,a=-1,u=t.length,d=rn(i-r,0),s=K(u+d),c=!l;++a<u;)s[a]=t[a];for(;++o<r;)(c||o<i)&&(s[n[o]]=e[o]);for(;d--;)s[a++]=e[o++];return s}function Eo(e,t,n,l){for(var o=-1,i=e.length,r=-1,a=n.length,u=-1,d=t.length,s=rn(i-a,0),c=K(s+d),p=!l;++o<s;)c[o]=e[o];for(var v=o;++u<d;)c[v+u]=t[u];for(;++r<a;)(p||o<i)&&(c[v+n[r]]=e[o++]);return c}function yo(e,t){var n=-1,l=e.length;for(t||(t=K(l));++n<l;)t[n]=e[n];return t}function _o(e,t,n,l){var o=!n;n||(n={});for(var i=-1,r=t.length;++i<r;){var a=t[i],u=l?l(n[a],e[a],a,n,e):void 0;void 0===u&&(u=e[a]),o?Kn(n,a,u):Vn(n,a,u)}return n}function go(e,t){return function(n,l){var o=xr(n)?nt:zn,i=t?t():{};return o(n,e,Zo(l,2),i)}}function ho(e){return kl(function(t,n){var l=-1,o=n.length,i=o>1?n[o-1]:void 0,r=o>2?n[2]:void 0;for(i=e.length>3&&"function"==typeof i?(o--,i):void 0,r&&ai(n[0],n[1],r)&&(i=o<3?void 0:i,o=1),t=me(t);++l<o;){var a=n[l];a&&e(t,a,l,i)}return t})}function So(e,t){return function(n,l){if(null==n)return n;if(!Fr(n))return e(n,l);for(var o=n.length,i=t?o:-1,r=me(n);(t?i--:++i<o)&&!1!==l(r[i],i,r););return n}}function bo(e){return function(t,n,l){for(var o=-1,i=me(t),r=l(t),a=r.length;a--;){var u=r[e?a:++o];if(!1===n(i[u],u,i))break}return t}}function To(e){return function(t){var n=Ft(t=ua(t))?Vt(t):void 0,l=n?n[0]:t.charAt(0),o=n?uo(n,1).join(""):t.slice(1);return l[e]()+o}}function Co(e){return function(t){return ct(Ha(La(t).replace(Pe,"")),e,"")}}function Ao(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 $r(l)?l:n}}function No(e){return function(t,n,l){var o=me(t);if(!Fr(t)){var i=Zo(n,3);t=Sa(t),n=function(e){return i(o[e],e,o)}}var r=e(t,n,l);return r>-1?o[i?t[r]:r]:void 0}}function Io(e){return $o(function(t){var l=t.length,o=l,i=wn.prototype.thru;for(e&&t.reverse();o--;){var r=t[o];if("function"!=typeof r)throw new ye(n);if(i&&!a&&"wrapper"==qo(r))var a=new wn([],!0)}for(o=a?o:l;++o<l;){var u=qo(r=t[o]),d="wrapper"==u?Ko(r):void 0;a=d&&di(d[0])&&424==d[1]&&!d[4].length&&1==d[9]?a[qo(d[0])].apply(a,d[3]):1==r.length&&di(r)?a[u]():a.thru(r)}return function(){var e=arguments,n=e[0];if(a&&1==e.length&&xr(n))return a.plant(n).value();for(var o=0,i=l?t[o].apply(this,e):n;++o<l;)i=t[o].call(this,i);return i}})}function Po(e,t,n,l,o,i,r,a,u,d){var s=128&t,c=1&t,p=2&t,v=24&t,m=512&t,f=p?void 0:Ao(e);return function E(){for(var y=arguments.length,_=K(y),g=y;g--;)_[g]=arguments[g];if(v)var h=Go(E),S=Rt(_,h);if(l&&(_=fo(_,l,o,v)),i&&(_=Eo(_,i,r,v)),y-=S,v&&y<d){var b=Ut(_,h);return Mo(e,t,Po,E.placeholder,n,_,b,a,u,d-y)}var T=c?n:this,C=p?T[e]:e;return y=_.length,a?_=Ei(_,a):m&&y>1&&_.reverse(),s&&u<y&&(_.length=u),this&&this!==Ve&&this instanceof E&&(C=f||Ao(C)),C.apply(T,_)}}function Oo(e,t){return function(n,l){return function(e,t,n,l){return ul(e,function(e,o,i){t(l,n(e),o,i)}),l}(n,e,t(l),{})}}function Do(e,t){return function(n,l){var o;if(void 0===n&&void 0===l)return t;if(void 0!==n&&(o=n),void 0!==l){if(void 0===o)return l;"string"==typeof n||"string"==typeof l?(n=Zl(n),l=Zl(l)):(n=Gl(n),l=Gl(l)),o=e(n,l)}return o}}function wo(e){return $o(function(t){return t=dt(t,It(Zo())),kl(function(n){var l=this;return e(t,function(e){return tt(e,l,n)})})})}function Ro(e,t){var n=(t=void 0===t?" ":Zl(t)).length;if(n<2)return n?Fl(t,e):t;var l=Fl(t,Jt(e/Wt(t)));return Ft(t)?uo(Vt(l),0,e).join(""):l.slice(0,e)}function Lo(e){return function(t,n,l){return l&&"number"!=typeof l&&ai(t,n,l)&&(n=l=void 0),t=la(t),void 0===n?(n=t,t=0):n=la(n),function(e,t,n,l){for(var o=-1,i=rn(Jt((t-e)/(n||1)),0),r=K(i);i--;)r[l?i:++o]=e,e+=n;return r}(t,n,l=void 0===l?t<n?1:-1:la(l),e)}}function xo(e){return function(t,n){return"string"==typeof t&&"string"==typeof n||(t=ra(t),n=ra(n)),e(t,n)}}function Mo(e,t,n,l,o,i,r,a,u,d){var s=8&t;t|=s?32:64,4&(t&=~(s?64:32))||(t&=-4);var c=[e,t,o,s?i:void 0,s?r:void 0,s?void 0:i,s?void 0:r,a,u,d],p=n.apply(void 0,c);return di(e)&&_i(p,c),p.placeholder=l,Si(p,e,t)}function Fo(e){var t=ve[e];return function(e,n){if(e=ra(e),(n=null==n?0:an(oa(n),292))&&nn(e)){var l=(ua(e)+"e").split("e");return+((l=(ua(t(l[0]+"e"+(+l[1]+n)))+"e").split("e"))[0]+"e"+(+l[1]-n))}return t(e)}}var ko=fn&&1/jt(new fn([,-0]))[1]==1/0?function(e){return new fn(e)}:Ja;function Bo(e){return function(t){var n=ni(t);return n==v?kt(t):n==y?Ht(t):function(e,t){return dt(t,function(t){return[t,e[t]]})}(t,e(t))}}function Uo(e,t,o,i,r,a,u,d){var s=2&t;if(!s&&"function"!=typeof e)throw new ye(n);var c=i?i.length:0;if(c||(t&=-97,i=r=void 0),u=void 0===u?u:rn(oa(u),0),d=void 0===d?d:oa(d),c-=r?r.length:0,64&t){var p=i,v=r;i=r=void 0}var m=s?void 0:Ko(e),f=[e,t,o,i,r,p,v,a,u,d];if(m&&function(e,t){var n=e[1],o=t[1],i=n|o;if(!(i<131||128==o&&8==n||128==o&&256==n&&e[7].length<=t[8]||384==o&&t[7].length<=t[8]&&8==n))return e;1&o&&(e[2]=t[2],i|=1&n?0:4);var r=t[3];if(r){var a=e[3];e[3]=a?fo(a,r,t[4]):r,e[4]=a?Ut(e[3],l):t[4]}(r=t[5])&&(e[5]=(a=e[5])?Eo(a,r,t[6]):r,e[6]=a?Ut(e[5],l):t[6]),(r=t[7])&&(e[7]=r),128&o&&(e[8]=null==e[8]?t[8]:an(e[8],t[8])),null==e[9]&&(e[9]=t[9]),e[0]=t[0],e[1]=i}(f,m),e=f[0],t=f[1],o=f[2],i=f[3],r=f[4],!(d=f[9]=void 0===f[9]?s?0:e.length:rn(f[9]-c,0))&&24&t&&(t&=-25),t&&1!=t)E=8==t||16==t?function(e,t,n){var l=Ao(e);return function o(){for(var i=arguments.length,r=K(i),a=i,u=Go(o);a--;)r[a]=arguments[a];var d=i<3&&r[0]!==u&&r[i-1]!==u?[]:Ut(r,u);if((i-=d.length)<n)return Mo(e,t,Po,o.placeholder,void 0,r,d,void 0,void 0,n-i);var s=this&&this!==Ve&&this instanceof o?l:e;return tt(s,this,r)}}(e,t,d):32!=t&&33!=t||r.length?Po.apply(void 0,f):function(e,t,n,l){var o=1&t,i=Ao(e);return function t(){for(var r=-1,a=arguments.length,u=-1,d=l.length,s=K(d+a),c=this&&this!==Ve&&this instanceof t?i:e;++u<d;)s[u]=l[u];for(;a--;)s[u++]=arguments[++r];return tt(c,o?n:this,s)}}(e,t,o,i);else var E=function(e,t,n){var l=1&t,o=Ao(e);return function t(){var i=this&&this!==Ve&&this instanceof t?o:e;return i.apply(l?n:this,arguments)}}(e,t,o);return Si((m?Hl:_i)(E,f),e,t)}function jo(e,t,n,l){return void 0===e||Dr(e,ge[n])&&!be.call(l,n)?t:e}function Ho(e,t,n,l,o,i){return $r(e)&&$r(t)&&(i.set(t,e),Ol(e,t,void 0,Ho,i),i.delete(t)),e}function Wo(e){return qr(e)?void 0:e}function Vo(e,t,n,l,o,i){var r=1&n,a=e.length,u=t.length;if(a!=u&&!(r&&u>a))return!1;var d=i.get(e),s=i.get(t);if(d&&s)return d==t&&s==e;var c=-1,p=!0,v=2&n?new Fn:void 0;for(i.set(e,t),i.set(t,e);++c<a;){var m=e[c],f=t[c];if(l)var E=r?l(f,m,c,t,e,i):l(m,f,c,e,t,i);if(void 0!==E){if(E)continue;p=!1;break}if(v){if(!vt(t,function(e,t){if(!Ot(v,t)&&(m===e||o(m,e,n,l,i)))return v.push(t)})){p=!1;break}}else if(m!==f&&!o(m,f,n,l,i)){p=!1;break}}return i.delete(e),i.delete(t),p}function $o(e){return hi(mi(e,void 0,Mi),e+"")}function zo(e){return pl(e,Sa,ei)}function Yo(e){return pl(e,ba,ti)}var Ko=_n?function(e){return _n.get(e)}:Ja;function qo(e){for(var t=e.name+"",n=gn[t],l=be.call(gn,t)?n.length:0;l--;){var o=n[l],i=o.func;if(null==i||i==e)return o.name}return t}function Go(e){return(be.call(Pn,"placeholder")?Pn:e).placeholder}function Zo(){var e=Pn.iteratee||qa;return e=e===qa?Tl:e,arguments.length?e(arguments[0],arguments[1]):e}function Xo(e,t){var n,l,o=e.__data__;return("string"==(l=typeof(n=t))||"number"==l||"symbol"==l||"boolean"==l?"__proto__"!==n:null===n)?o["string"==typeof t?"string":"hash"]:o.map}function Jo(e){for(var t=Sa(e),n=t.length;n--;){var l=t[n],o=e[l];t[n]=[l,o,pi(o)]}return t}function Qo(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return bl(n)?n:void 0}var ei=en?function(e){return null==e?[]:(e=me(e),rt(en(e),function(t){return Ke.call(e,t)}))}:iu,ti=en?function(e){for(var t=[];e;)st(t,ei(e)),e=$e(e);return t}:iu,ni=vl;function li(e,t,n){for(var l=-1,o=(t=ro(t,e)).length,i=!1;++l<o;){var r=Ii(t[l]);if(!(i=null!=e&&n(e,r)))break;e=e[r]}return i||++l!=o?i:!!(o=null==e?0:e.length)&&Vr(o)&&ri(r,o)&&(xr(e)||Lr(e))}function oi(e){return"function"!=typeof e.constructor||ci(e)?{}:On($e(e))}function ii(e){return xr(e)||Lr(e)||!!(mt&&e&&e[mt])}function ri(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&re.test(e))&&e>-1&&e%1==0&&e<t}function ai(e,t,n){if(!$r(n))return!1;var l=typeof t;return!!("number"==l?Fr(n)&&ri(t,n.length):"string"==l&&t in n)&&Dr(n[t],e)}function ui(e,t){if(xr(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!Jr(e))||W.test(e)||!H.test(e)||null!=t&&e in me(t)}function di(e){var t=qo(e),n=Pn[t];if("function"!=typeof n||!(t in Rn.prototype))return!1;if(e===n)return!0;var l=Ko(n);return!!l&&e===l[0]}(pn&&ni(new pn(new ArrayBuffer(1)))!=b||vn&&ni(new vn)!=v||mn&&"[object Promise]"!=ni(mn.resolve())||fn&&ni(new fn)!=y||En&&ni(new En)!=h)&&(ni=function(e){var t=vl(e),n=t==f?e.constructor:void 0,l=n?Pi(n):"";if(l)switch(l){case hn:return b;case Sn:return v;case bn:return"[object Promise]";case Tn:return y;case Cn:return h}return t});var si=he?Hr:ru;function ci(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||ge)}function pi(e){return e==e&&!$r(e)}function vi(e,t){return function(n){return null!=n&&n[e]===t&&(void 0!==t||e in me(n))}}function mi(e,t,n){return t=rn(void 0===t?e.length-1:t,0),function(){for(var l=arguments,o=-1,i=rn(l.length-t,0),r=K(i);++o<i;)r[o]=l[t+o];o=-1;for(var a=K(t+1);++o<t;)a[o]=l[o];return a[t]=n(r),tt(e,this,a)}}function fi(e,t){return t.length<2?e:cl(e,$l(t,0,-1))}function Ei(e,t){for(var n=e.length,l=an(t.length,n),o=yo(e);l--;){var i=t[l];e[l]=ri(i,n)?o[i]:void 0}return e}function yi(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var _i=bi(Hl),gi=Xt||function(e,t){return Ve.setTimeout(e,t)},hi=bi(Wl);function Si(e,t,n){var l=t+"";return hi(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(o,function(n){var l="_."+n[0];t&n[1]&&!at(e,l)&&e.push(l)}),e.sort()}(function(e){var t=e.match(G);return t?t[1].split(Z):[]}(l),n)))}function bi(e){var t=0,n=0;return function(){var l=un(),o=16-(l-n);if(n=l,o>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function Ti(e,t){var n=-1,l=e.length,o=l-1;for(t=void 0===t?l:t;++n<t;){var i=Ml(n,o),r=e[i];e[i]=e[n],e[n]=r}return e.length=t,e}var Ci,Ai,Ni=(Ci=Cr(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(V,function(e,n,l,o){t.push(l?o.replace(Q,"$1"):n||e)}),t},function(e){return 500===Ai.size&&Ai.clear(),e}),Ai=Ci.cache,Ci);function Ii(e){if("string"==typeof e||Jr(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Pi(e){if(null!=e){try{return Se.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function Oi(e){if(e instanceof Rn)return e.clone();var t=new wn(e.__wrapped__,e.__chain__);return t.__actions__=yo(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var Di=kl(function(e,t){return kr(e)?Qn(e,il(t,1,kr,!0)):[]}),wi=kl(function(e,t){var n=ji(t);return kr(n)&&(n=void 0),kr(e)?Qn(e,il(t,1,kr,!0),Zo(n,2)):[]}),Ri=kl(function(e,t){var n=ji(t);return kr(n)&&(n=void 0),kr(e)?Qn(e,il(t,1,kr,!0),void 0,n):[]});function Li(e,t,n){var l=null==e?0:e.length;if(!l)return-1;var o=null==n?0:oa(n);return o<0&&(o=rn(l+o,0)),Et(e,Zo(t,3),o)}function xi(e,t,n){var l=null==e?0:e.length;if(!l)return-1;var o=l-1;return void 0!==n&&(o=oa(n),o=n<0?rn(l+o,0):an(o,l-1)),Et(e,Zo(t,3),o,!0)}function Mi(e){return null!=e&&e.length?il(e,1):[]}function Fi(e){return e&&e.length?e[0]:void 0}var ki=kl(function(e){var t=dt(e,oo);return t.length&&t[0]===e[0]?yl(t):[]}),Bi=kl(function(e){var t=ji(e),n=dt(e,oo);return t===ji(n)?t=void 0:n.pop(),n.length&&n[0]===e[0]?yl(n,Zo(t,2)):[]}),Ui=kl(function(e){var t=ji(e),n=dt(e,oo);return(t="function"==typeof t?t:void 0)&&n.pop(),n.length&&n[0]===e[0]?yl(n,void 0,t):[]});function ji(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}var Hi=kl(Wi);function Wi(e,t){return e&&e.length&&t&&t.length?Ll(e,t):e}var Vi=$o(function(e,t){var n=null==e?0:e.length,l=qn(e,t);return xl(e,dt(t,function(e){return ri(e,n)?+e:e}).sort(mo)),l});function $i(e){return null==e?e:cn.call(e)}var zi=kl(function(e){return Xl(il(e,1,kr,!0))}),Yi=kl(function(e){var t=ji(e);return kr(t)&&(t=void 0),Xl(il(e,1,kr,!0),Zo(t,2))}),Ki=kl(function(e){var t=ji(e);return t="function"==typeof t?t:void 0,Xl(il(e,1,kr,!0),void 0,t)});function qi(e){if(!e||!e.length)return[];var t=0;return e=rt(e,function(e){if(kr(e))return t=rn(e.length,t),!0}),At(t,function(t){return dt(e,St(t))})}function Gi(e,t){if(!e||!e.length)return[];var n=qi(e);return null==t?n:dt(n,function(e){return tt(t,void 0,e)})}var Zi=kl(function(e,t){return kr(e)?Qn(e,t):[]}),Xi=kl(function(e){return no(rt(e,kr))}),Ji=kl(function(e){var t=ji(e);return kr(t)&&(t=void 0),no(rt(e,kr),Zo(t,2))}),Qi=kl(function(e){var t=ji(e);return t="function"==typeof t?t:void 0,no(rt(e,kr),void 0,t)}),er=kl(qi),tr=kl(function(e){var t=e.length,n=t>1?e[t-1]:void 0;return n="function"==typeof n?(e.pop(),n):void 0,Gi(e,n)});function nr(e){var t=Pn(e);return t.__chain__=!0,t}function lr(e,t){return t(e)}var or=$o(function(e){var t=e.length,n=t?e[0]:0,l=this.__wrapped__,o=function(t){return qn(t,e)};return!(t>1||this.__actions__.length)&&l instanceof Rn&&ri(n)?((l=l.slice(n,+n+(t?1:0))).__actions__.push({func:lr,args:[o],thisArg:void 0}),new wn(l,this.__chain__).thru(function(e){return t&&!e.length&&e.push(void 0),e})):this.thru(o)}),ir=go(function(e,t,n){be.call(e,n)?++e[n]:Kn(e,n,1)}),rr=No(Li),ar=No(xi);function ur(e,t){return(xr(e)?lt:el)(e,Zo(t,3))}function dr(e,t){return(xr(e)?ot:tl)(e,Zo(t,3))}var sr=go(function(e,t,n){be.call(e,n)?e[n].push(t):Kn(e,n,[t])}),cr=kl(function(e,t,n){var l=-1,o="function"==typeof t,i=Fr(e)?K(e.length):[];return el(e,function(e){i[++l]=o?tt(t,e,n):_l(e,t,n)}),i}),pr=go(function(e,t,n){Kn(e,n,t)});function vr(e,t){return(xr(e)?dt:Nl)(e,Zo(t,3))}var mr=go(function(e,t,n){e[n?0:1].push(t)},function(){return[[],[]]}),fr=kl(function(e,t){if(null==e)return[];var n=t.length;return n>1&&ai(e,t[0],t[1])?t=[]:n>2&&ai(t[0],t[1],t[2])&&(t=[t[0]]),wl(e,il(t,1),[])}),Er=Zt||function(){return Ve.Date.now()};function yr(e,t,n){return t=n?void 0:t,Uo(e,128,void 0,void 0,void 0,void 0,t=e&&null==t?e.length:t)}function _r(e,t){var l;if("function"!=typeof t)throw new ye(n);return e=oa(e),function(){return--e>0&&(l=t.apply(this,arguments)),e<=1&&(t=void 0),l}}var gr=kl(function(e,t,n){var l=1;if(n.length){var o=Ut(n,Go(gr));l|=32}return Uo(e,l,t,n,o)}),hr=kl(function(e,t,n){var l=3;if(n.length){var o=Ut(n,Go(hr));l|=32}return Uo(t,l,e,n,o)});function Sr(e,t,l){var o,i,r,a,u,d,s=0,c=!1,p=!1,v=!0;if("function"!=typeof e)throw new ye(n);function m(t){var n=o,l=i;return o=i=void 0,s=t,a=e.apply(l,n)}function f(e){return s=e,u=gi(y,t),c?m(e):a}function E(e){var n=e-d;return void 0===d||n>=t||n<0||p&&e-s>=r}function y(){var e=Er();if(E(e))return _(e);u=gi(y,function(e){var n=t-(e-d);return p?an(n,r-(e-s)):n}(e))}function _(e){return u=void 0,v&&o?m(e):(o=i=void 0,a)}function g(){var e=Er(),n=E(e);if(o=arguments,i=this,d=e,n){if(void 0===u)return f(d);if(p)return so(u),u=gi(y,t),m(d)}return void 0===u&&(u=gi(y,t)),a}return t=ra(t)||0,$r(l)&&(c=!!l.leading,r=(p="maxWait"in l)?rn(ra(l.maxWait)||0,t):r,v="trailing"in l?!!l.trailing:v),g.cancel=function(){void 0!==u&&so(u),s=0,o=d=i=u=void 0},g.flush=function(){return void 0===u?a:_(Er())},g}var br=kl(function(e,t){return Jn(e,1,t)}),Tr=kl(function(e,t,n){return Jn(e,ra(t)||0,n)});function Cr(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new ye(n);var l=function(){var n=arguments,o=t?t.apply(this,n):n[0],i=l.cache;if(i.has(o))return i.get(o);var r=e.apply(this,n);return l.cache=i.set(o,r)||i,r};return l.cache=new(Cr.Cache||Mn),l}function Ar(e){if("function"!=typeof e)throw new ye(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)}}Cr.Cache=Mn;var Nr=ao(function(e,t){var n=(t=1==t.length&&xr(t[0])?dt(t[0],It(Zo())):dt(il(t,1),It(Zo()))).length;return kl(function(l){for(var o=-1,i=an(l.length,n);++o<i;)l[o]=t[o].call(this,l[o]);return tt(e,this,l)})}),Ir=kl(function(e,t){return Uo(e,32,void 0,t,Ut(t,Go(Ir)))}),Pr=kl(function(e,t){return Uo(e,64,void 0,t,Ut(t,Go(Pr)))}),Or=$o(function(e,t){return Uo(e,256,void 0,void 0,void 0,t)});function Dr(e,t){return e===t||e!=e&&t!=t}var wr=xo(ml),Rr=xo(function(e,t){return e>=t}),Lr=gl(function(){return arguments}())?gl:function(e){return zr(e)&&be.call(e,"callee")&&!Ke.call(e,"callee")},xr=K.isArray,Mr=Ge?It(Ge):function(e){return zr(e)&&vl(e)==S};function Fr(e){return null!=e&&Vr(e.length)&&!Hr(e)}function kr(e){return zr(e)&&Fr(e)}var Br=tn||ru,Ur=Ze?It(Ze):function(e){return zr(e)&&vl(e)==u};function jr(e){if(!zr(e))return!1;var t=vl(e);return t==d||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!qr(e)}function Hr(e){if(!$r(e))return!1;var t=vl(e);return t==c||t==p||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Wr(e){return"number"==typeof e&&e==oa(e)}function Vr(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}function $r(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function zr(e){return null!=e&&"object"==typeof e}var Yr=Xe?It(Xe):function(e){return zr(e)&&ni(e)==v};function Kr(e){return"number"==typeof e||zr(e)&&vl(e)==m}function qr(e){if(!zr(e)||vl(e)!=f)return!1;var t=$e(e);if(null===t)return!0;var n=be.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&Se.call(n)==Ne}var Gr=Je?It(Je):function(e){return zr(e)&&vl(e)==E},Zr=Qe?It(Qe):function(e){return zr(e)&&ni(e)==y};function Xr(e){return"string"==typeof e||!xr(e)&&zr(e)&&vl(e)==_}function Jr(e){return"symbol"==typeof e||zr(e)&&vl(e)==g}var Qr=et?It(et):function(e){return zr(e)&&Vr(e.length)&&!!Fe[vl(e)]},ea=xo(Al),ta=xo(function(e,t){return e<=t});function na(e){if(!e)return[];if(Fr(e))return Xr(e)?Vt(e):yo(e);if(bt&&e[bt])return function(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}(e[bt]());var t=ni(e);return(t==v?kt:t==y?jt:Da)(e)}function la(e){return e?(e=ra(e))===1/0||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function oa(e){var t=la(e),n=t%1;return t==t?n?t-n:t:0}function ia(e){return e?Gn(oa(e),0,4294967295):0}function ra(e){if("number"==typeof e)return e;if(Jr(e))return NaN;if($r(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=$r(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Nt(e);var n=le.test(e);return n||ie.test(e)?je(e.slice(2),n?2:8):ne.test(e)?NaN:+e}function aa(e){return _o(e,ba(e))}function ua(e){return null==e?"":Zl(e)}var da=ho(function(e,t){if(ci(t)||Fr(t))_o(t,Sa(t),e);else for(var n in t)be.call(t,n)&&Vn(e,n,t[n])}),sa=ho(function(e,t){_o(t,ba(t),e)}),ca=ho(function(e,t,n,l){_o(t,ba(t),e,l)}),pa=ho(function(e,t,n,l){_o(t,Sa(t),e,l)}),va=$o(qn),ma=kl(function(e,t){e=me(e);var n=-1,l=t.length,o=l>2?t[2]:void 0;for(o&&ai(t[0],t[1],o)&&(l=1);++n<l;)for(var i=t[n],r=ba(i),a=-1,u=r.length;++a<u;){var d=r[a],s=e[d];(void 0===s||Dr(s,ge[d])&&!be.call(e,d))&&(e[d]=i[d])}return e}),fa=kl(function(e){return e.push(void 0,Ho),tt(Ca,void 0,e)});function Ea(e,t,n){var l=null==e?void 0:cl(e,t);return void 0===l?n:l}function ya(e,t){return null!=e&&li(e,t,El)}var _a=Oo(function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=Ae.call(t)),e[t]=n},$a(Ka)),ga=Oo(function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=Ae.call(t)),be.call(e,t)?e[t].push(n):e[t]=[n]},Zo),ha=kl(_l);function Sa(e){return Fr(e)?Bn(e):Cl(e)}function ba(e){return Fr(e)?Bn(e,!0):function(e){if(!$r(e))return function(e){var t=[];if(null!=e)for(var n in me(e))t.push(n);return t}(e);var t=ci(e),n=[];for(var l in e)("constructor"!=l||!t&&be.call(e,l))&&n.push(l);return n}(e)}var Ta=ho(function(e,t,n){Ol(e,t,n)}),Ca=ho(function(e,t,n,l){Ol(e,t,n,l)}),Aa=$o(function(e,t){var n={};if(null==e)return n;var l=!1;t=dt(t,function(t){return t=ro(t,e),l||(l=t.length>1),t}),_o(e,Yo(e),n),l&&(n=Zn(n,7,Wo));for(var o=t.length;o--;)Jl(n,t[o]);return n}),Na=$o(function(e,t){return null==e?{}:function(e,t){return Rl(e,t,function(t,n){return ya(e,n)})}(e,t)});function Ia(e,t){if(null==e)return{};var n=dt(Yo(e),function(e){return[e]});return t=Zo(t),Rl(e,n,function(e,n){return t(e,n[0])})}var Pa=Bo(Sa),Oa=Bo(ba);function Da(e){return null==e?[]:Pt(e,Sa(e))}var wa=Co(function(e,t,n){return t=t.toLowerCase(),e+(n?Ra(t):t)});function Ra(e){return ja(ua(e).toLowerCase())}function La(e){return(e=ua(e))&&e.replace(ae,Lt).replace(Oe,"")}var xa=Co(function(e,t,n){return e+(n?"-":"")+t.toLowerCase()}),Ma=Co(function(e,t,n){return e+(n?" ":"")+t.toLowerCase()}),Fa=To("toLowerCase"),ka=Co(function(e,t,n){return e+(n?"_":"")+t.toLowerCase()}),Ba=Co(function(e,t,n){return e+(n?" ":"")+ja(t)}),Ua=Co(function(e,t,n){return e+(n?" ":"")+t.toUpperCase()}),ja=To("toUpperCase");function Ha(e,t,n){return e=ua(e),void 0===(t=n?void 0:t)?function(e){return Le.test(e)}(e)?function(e){return e.match(we)||[]}(e):function(e){return e.match(X)||[]}(e):e.match(t)||[]}var Wa=kl(function(e,t){try{return tt(e,void 0,t)}catch(e){return jr(e)?e:new ce(e)}}),Va=$o(function(e,t){return lt(t,function(t){t=Ii(t),Kn(e,t,gr(e[t],e))}),e});function $a(e){return function(){return e}}var za=Io(),Ya=Io(!0);function Ka(e){return e}function qa(e){return Tl("function"==typeof e?e:Zn(e,1))}var Ga=kl(function(e,t){return function(n){return _l(n,e,t)}}),Za=kl(function(e,t){return function(n){return _l(e,n,t)}});function Xa(e,t,n){var l=Sa(t),o=sl(t,l);null!=n||$r(t)&&(o.length||!l.length)||(n=t,t=e,e=this,o=sl(t,Sa(t)));var i=!($r(n)&&"chain"in n&&!n.chain),r=Hr(e);return lt(o,function(n){var l=t[n];e[n]=l,r&&(e.prototype[n]=function(){var t=this.__chain__;if(i||t){var n=e(this.__wrapped__),o=n.__actions__=yo(this.__actions__);return o.push({func:l,args:arguments,thisArg:e}),n.__chain__=t,n}return l.apply(e,st([this.value()],arguments))})}),e}function Ja(){}var Qa=wo(dt),eu=wo(it),tu=wo(vt);function nu(e){return ui(e)?St(Ii(e)):function(e){return function(t){return cl(t,e)}}(e)}var lu=Lo(),ou=Lo(!0);function iu(){return[]}function ru(){return!1}var au,uu=Do(function(e,t){return e+t},0),du=Fo("ceil"),su=Do(function(e,t){return e/t},1),cu=Fo("floor"),pu=Do(function(e,t){return e*t},1),vu=Fo("round"),mu=Do(function(e,t){return e-t},0);return Pn.after=function(e,t){if("function"!=typeof t)throw new ye(n);return e=oa(e),function(){if(--e<1)return t.apply(this,arguments)}},Pn.ary=yr,Pn.assign=da,Pn.assignIn=sa,Pn.assignInWith=ca,Pn.assignWith=pa,Pn.at=va,Pn.before=_r,Pn.bind=gr,Pn.bindAll=Va,Pn.bindKey=hr,Pn.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return xr(e)?e:[e]},Pn.chain=nr,Pn.chunk=function(e,t,n){t=(n?ai(e,t,n):void 0===t)?1:rn(oa(t),0);var l=null==e?0:e.length;if(!l||t<1)return[];for(var o=0,i=0,r=K(Jt(l/t));o<l;)r[i++]=$l(e,o,o+=t);return r},Pn.compact=function(e){for(var t=-1,n=null==e?0:e.length,l=0,o=[];++t<n;){var i=e[t];i&&(o[l++]=i)}return o},Pn.concat=function(){var e=arguments.length;if(!e)return[];for(var t=K(e-1),n=arguments[0],l=e;l--;)t[l-1]=arguments[l];return st(xr(n)?yo(n):[n],il(t,1))},Pn.cond=function(e){var t=null==e?0:e.length,l=Zo();return e=t?dt(e,function(e){if("function"!=typeof e[1])throw new ye(n);return[l(e[0]),e[1]]}):[],kl(function(n){for(var l=-1;++l<t;){var o=e[l];if(tt(o[0],this,n))return tt(o[1],this,n)}})},Pn.conforms=function(e){return function(e){var t=Sa(e);return function(n){return Xn(n,e,t)}}(Zn(e,1))},Pn.constant=$a,Pn.countBy=ir,Pn.create=function(e,t){var n=On(e);return null==t?n:Yn(n,t)},Pn.curry=function e(t,n,l){var o=Uo(t,8,void 0,void 0,void 0,void 0,void 0,n=l?void 0:n);return o.placeholder=e.placeholder,o},Pn.curryRight=function e(t,n,l){var o=Uo(t,16,void 0,void 0,void 0,void 0,void 0,n=l?void 0:n);return o.placeholder=e.placeholder,o},Pn.debounce=Sr,Pn.defaults=ma,Pn.defaultsDeep=fa,Pn.defer=br,Pn.delay=Tr,Pn.difference=Di,Pn.differenceBy=wi,Pn.differenceWith=Ri,Pn.drop=function(e,t,n){var l=null==e?0:e.length;return l?$l(e,(t=n||void 0===t?1:oa(t))<0?0:t,l):[]},Pn.dropRight=function(e,t,n){var l=null==e?0:e.length;return l?$l(e,0,(t=l-(t=n||void 0===t?1:oa(t)))<0?0:t):[]},Pn.dropRightWhile=function(e,t){return e&&e.length?eo(e,Zo(t,3),!0,!0):[]},Pn.dropWhile=function(e,t){return e&&e.length?eo(e,Zo(t,3),!0):[]},Pn.fill=function(e,t,n,l){var o=null==e?0:e.length;return o?(n&&"number"!=typeof n&&ai(e,t,n)&&(n=0,l=o),function(e,t,n,l){var o=e.length;for((n=oa(n))<0&&(n=-n>o?0:o+n),(l=void 0===l||l>o?o:oa(l))<0&&(l+=o),l=n>l?0:ia(l);n<l;)e[n++]=t;return e}(e,t,n,l)):[]},Pn.filter=function(e,t){return(xr(e)?rt:ol)(e,Zo(t,3))},Pn.flatMap=function(e,t){return il(vr(e,t),1)},Pn.flatMapDeep=function(e,t){return il(vr(e,t),1/0)},Pn.flatMapDepth=function(e,t,n){return n=void 0===n?1:oa(n),il(vr(e,t),n)},Pn.flatten=Mi,Pn.flattenDeep=function(e){return null!=e&&e.length?il(e,1/0):[]},Pn.flattenDepth=function(e,t){return null!=e&&e.length?il(e,t=void 0===t?1:oa(t)):[]},Pn.flip=function(e){return Uo(e,512)},Pn.flow=za,Pn.flowRight=Ya,Pn.fromPairs=function(e){for(var t=-1,n=null==e?0:e.length,l={};++t<n;){var o=e[t];l[o[0]]=o[1]}return l},Pn.functions=function(e){return null==e?[]:sl(e,Sa(e))},Pn.functionsIn=function(e){return null==e?[]:sl(e,ba(e))},Pn.groupBy=sr,Pn.initial=function(e){return null!=e&&e.length?$l(e,0,-1):[]},Pn.intersection=ki,Pn.intersectionBy=Bi,Pn.intersectionWith=Ui,Pn.invert=_a,Pn.invertBy=ga,Pn.invokeMap=cr,Pn.iteratee=qa,Pn.keyBy=pr,Pn.keys=Sa,Pn.keysIn=ba,Pn.map=vr,Pn.mapKeys=function(e,t){var n={};return t=Zo(t,3),ul(e,function(e,l,o){Kn(n,t(e,l,o),e)}),n},Pn.mapValues=function(e,t){var n={};return t=Zo(t,3),ul(e,function(e,l,o){Kn(n,l,t(e,l,o))}),n},Pn.matches=function(e){return Il(Zn(e,1))},Pn.matchesProperty=function(e,t){return Pl(e,Zn(t,1))},Pn.memoize=Cr,Pn.merge=Ta,Pn.mergeWith=Ca,Pn.method=Ga,Pn.methodOf=Za,Pn.mixin=Xa,Pn.negate=Ar,Pn.nthArg=function(e){return e=oa(e),kl(function(t){return Dl(t,e)})},Pn.omit=Aa,Pn.omitBy=function(e,t){return Ia(e,Ar(Zo(t)))},Pn.once=function(e){return _r(2,e)},Pn.orderBy=function(e,t,n,l){return null==e?[]:(xr(t)||(t=null==t?[]:[t]),xr(n=l?void 0:n)||(n=null==n?[]:[n]),wl(e,t,n))},Pn.over=Qa,Pn.overArgs=Nr,Pn.overEvery=eu,Pn.overSome=tu,Pn.partial=Ir,Pn.partialRight=Pr,Pn.partition=mr,Pn.pick=Na,Pn.pickBy=Ia,Pn.property=nu,Pn.propertyOf=function(e){return function(t){return null==e?void 0:cl(e,t)}},Pn.pull=Hi,Pn.pullAll=Wi,Pn.pullAllBy=function(e,t,n){return e&&e.length&&t&&t.length?Ll(e,t,Zo(n,2)):e},Pn.pullAllWith=function(e,t,n){return e&&e.length&&t&&t.length?Ll(e,t,void 0,n):e},Pn.pullAt=Vi,Pn.range=lu,Pn.rangeRight=ou,Pn.rearg=Or,Pn.reject=function(e,t){return(xr(e)?rt:ol)(e,Ar(Zo(t,3)))},Pn.remove=function(e,t){var n=[];if(!e||!e.length)return n;var l=-1,o=[],i=e.length;for(t=Zo(t,3);++l<i;){var r=e[l];t(r,l,e)&&(n.push(r),o.push(l))}return xl(e,o),n},Pn.rest=function(e,t){if("function"!=typeof e)throw new ye(n);return kl(e,t=void 0===t?t:oa(t))},Pn.reverse=$i,Pn.sampleSize=function(e,t,n){return t=(n?ai(e,t,n):void 0===t)?1:oa(t),(xr(e)?jn:Ul)(e,t)},Pn.set=function(e,t,n){return null==e?e:jl(e,t,n)},Pn.setWith=function(e,t,n,l){return l="function"==typeof l?l:void 0,null==e?e:jl(e,t,n,l)},Pn.shuffle=function(e){return(xr(e)?Hn:Vl)(e)},Pn.slice=function(e,t,n){var l=null==e?0:e.length;return l?(n&&"number"!=typeof n&&ai(e,t,n)?(t=0,n=l):(t=null==t?0:oa(t),n=void 0===n?l:oa(n)),$l(e,t,n)):[]},Pn.sortBy=fr,Pn.sortedUniq=function(e){return e&&e.length?ql(e):[]},Pn.sortedUniqBy=function(e,t){return e&&e.length?ql(e,Zo(t,2)):[]},Pn.split=function(e,t,n){return n&&"number"!=typeof n&&ai(e,t,n)&&(t=n=void 0),(n=void 0===n?4294967295:n>>>0)?(e=ua(e))&&("string"==typeof t||null!=t&&!Gr(t))&&!(t=Zl(t))&&Ft(e)?uo(Vt(e),0,n):e.split(t,n):[]},Pn.spread=function(e,t){if("function"!=typeof e)throw new ye(n);return t=null==t?0:rn(oa(t),0),kl(function(n){var l=n[t],o=uo(n,0,t);return l&&st(o,l),tt(e,this,o)})},Pn.tail=function(e){var t=null==e?0:e.length;return t?$l(e,1,t):[]},Pn.take=function(e,t,n){return e&&e.length?$l(e,0,(t=n||void 0===t?1:oa(t))<0?0:t):[]},Pn.takeRight=function(e,t,n){var l=null==e?0:e.length;return l?$l(e,(t=l-(t=n||void 0===t?1:oa(t)))<0?0:t,l):[]},Pn.takeRightWhile=function(e,t){return e&&e.length?eo(e,Zo(t,3),!1,!0):[]},Pn.takeWhile=function(e,t){return e&&e.length?eo(e,Zo(t,3)):[]},Pn.tap=function(e,t){return t(e),e},Pn.throttle=function(e,t,l){var o=!0,i=!0;if("function"!=typeof e)throw new ye(n);return $r(l)&&(o="leading"in l?!!l.leading:o,i="trailing"in l?!!l.trailing:i),Sr(e,t,{leading:o,maxWait:t,trailing:i})},Pn.thru=lr,Pn.toArray=na,Pn.toPairs=Pa,Pn.toPairsIn=Oa,Pn.toPath=function(e){return xr(e)?dt(e,Ii):Jr(e)?[e]:yo(Ni(ua(e)))},Pn.toPlainObject=aa,Pn.transform=function(e,t,n){var l=xr(e),o=l||Br(e)||Qr(e);if(t=Zo(t,4),null==n){var i=e&&e.constructor;n=o?l?new i:[]:$r(e)&&Hr(i)?On($e(e)):{}}return(o?lt:ul)(e,function(e,l,o){return t(n,e,l,o)}),n},Pn.unary=function(e){return yr(e,1)},Pn.union=zi,Pn.unionBy=Yi,Pn.unionWith=Ki,Pn.uniq=function(e){return e&&e.length?Xl(e):[]},Pn.uniqBy=function(e,t){return e&&e.length?Xl(e,Zo(t,2)):[]},Pn.uniqWith=function(e,t){return t="function"==typeof t?t:void 0,e&&e.length?Xl(e,void 0,t):[]},Pn.unset=function(e,t){return null==e||Jl(e,t)},Pn.unzip=qi,Pn.unzipWith=Gi,Pn.update=function(e,t,n){return null==e?e:Ql(e,t,io(n))},Pn.updateWith=function(e,t,n,l){return l="function"==typeof l?l:void 0,null==e?e:Ql(e,t,io(n),l)},Pn.values=Da,Pn.valuesIn=function(e){return null==e?[]:Pt(e,ba(e))},Pn.without=Zi,Pn.words=Ha,Pn.wrap=function(e,t){return Ir(io(t),e)},Pn.xor=Xi,Pn.xorBy=Ji,Pn.xorWith=Qi,Pn.zip=er,Pn.zipObject=function(e,t){return lo(e||[],t||[],Vn)},Pn.zipObjectDeep=function(e,t){return lo(e||[],t||[],jl)},Pn.zipWith=tr,Pn.entries=Pa,Pn.entriesIn=Oa,Pn.extend=sa,Pn.extendWith=ca,Xa(Pn,Pn),Pn.add=uu,Pn.attempt=Wa,Pn.camelCase=wa,Pn.capitalize=Ra,Pn.ceil=du,Pn.clamp=function(e,t,n){return void 0===n&&(n=t,t=void 0),void 0!==n&&(n=(n=ra(n))==n?n:0),void 0!==t&&(t=(t=ra(t))==t?t:0),Gn(ra(e),t,n)},Pn.clone=function(e){return Zn(e,4)},Pn.cloneDeep=function(e){return Zn(e,5)},Pn.cloneDeepWith=function(e,t){return Zn(e,5,t="function"==typeof t?t:void 0)},Pn.cloneWith=function(e,t){return Zn(e,4,t="function"==typeof t?t:void 0)},Pn.conformsTo=function(e,t){return null==t||Xn(e,t,Sa(t))},Pn.deburr=La,Pn.defaultTo=function(e,t){return null==e||e!=e?t:e},Pn.divide=su,Pn.endsWith=function(e,t,n){e=ua(e),t=Zl(t);var l=e.length,o=n=void 0===n?l:Gn(oa(n),0,l);return(n-=t.length)>=0&&e.slice(n,o)==t},Pn.eq=Dr,Pn.escape=function(e){return(e=ua(e))&&k.test(e)?e.replace(M,xt):e},Pn.escapeRegExp=function(e){return(e=ua(e))&&z.test(e)?e.replace($,"\\$&"):e},Pn.every=function(e,t,n){var l=xr(e)?it:nl;return n&&ai(e,t,n)&&(t=void 0),l(e,Zo(t,3))},Pn.find=rr,Pn.findIndex=Li,Pn.findKey=function(e,t){return ft(e,Zo(t,3),ul)},Pn.findLast=ar,Pn.findLastIndex=xi,Pn.findLastKey=function(e,t){return ft(e,Zo(t,3),dl)},Pn.floor=cu,Pn.forEach=ur,Pn.forEachRight=dr,Pn.forIn=function(e,t){return null==e?e:rl(e,Zo(t,3),ba)},Pn.forInRight=function(e,t){return null==e?e:al(e,Zo(t,3),ba)},Pn.forOwn=function(e,t){return e&&ul(e,Zo(t,3))},Pn.forOwnRight=function(e,t){return e&&dl(e,Zo(t,3))},Pn.get=Ea,Pn.gt=wr,Pn.gte=Rr,Pn.has=function(e,t){return null!=e&&li(e,t,fl)},Pn.hasIn=ya,Pn.head=Fi,Pn.identity=Ka,Pn.includes=function(e,t,n,l){e=Fr(e)?e:Da(e),n=n&&!l?oa(n):0;var o=e.length;return n<0&&(n=rn(o+n,0)),Xr(e)?n<=o&&e.indexOf(t,n)>-1:!!o&&yt(e,t,n)>-1},Pn.indexOf=function(e,t,n){var l=null==e?0:e.length;if(!l)return-1;var o=null==n?0:oa(n);return o<0&&(o=rn(l+o,0)),yt(e,t,o)},Pn.inRange=function(e,t,n){return t=la(t),void 0===n?(n=t,t=0):n=la(n),function(e,t,n){return e>=an(t,n)&&e<rn(t,n)}(e=ra(e),t,n)},Pn.invoke=ha,Pn.isArguments=Lr,Pn.isArray=xr,Pn.isArrayBuffer=Mr,Pn.isArrayLike=Fr,Pn.isArrayLikeObject=kr,Pn.isBoolean=function(e){return!0===e||!1===e||zr(e)&&vl(e)==a},Pn.isBuffer=Br,Pn.isDate=Ur,Pn.isElement=function(e){return zr(e)&&1===e.nodeType&&!qr(e)},Pn.isEmpty=function(e){if(null==e)return!0;if(Fr(e)&&(xr(e)||"string"==typeof e||"function"==typeof e.splice||Br(e)||Qr(e)||Lr(e)))return!e.length;var t=ni(e);if(t==v||t==y)return!e.size;if(ci(e))return!Cl(e).length;for(var n in e)if(be.call(e,n))return!1;return!0},Pn.isEqual=function(e,t){return hl(e,t)},Pn.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},Pn.isError=jr,Pn.isFinite=function(e){return"number"==typeof e&&nn(e)},Pn.isFunction=Hr,Pn.isInteger=Wr,Pn.isLength=Vr,Pn.isMap=Yr,Pn.isMatch=function(e,t){return e===t||Sl(e,t,Jo(t))},Pn.isMatchWith=function(e,t,n){return n="function"==typeof n?n:void 0,Sl(e,t,Jo(t),n)},Pn.isNaN=function(e){return Kr(e)&&e!=+e},Pn.isNative=function(e){if(si(e))throw new ce("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return bl(e)},Pn.isNil=function(e){return null==e},Pn.isNull=function(e){return null===e},Pn.isNumber=Kr,Pn.isObject=$r,Pn.isObjectLike=zr,Pn.isPlainObject=qr,Pn.isRegExp=Gr,Pn.isSafeInteger=function(e){return Wr(e)&&e>=-9007199254740991&&e<=9007199254740991},Pn.isSet=Zr,Pn.isString=Xr,Pn.isSymbol=Jr,Pn.isTypedArray=Qr,Pn.isUndefined=function(e){return void 0===e},Pn.isWeakMap=function(e){return zr(e)&&ni(e)==h},Pn.isWeakSet=function(e){return zr(e)&&"[object WeakSet]"==vl(e)},Pn.join=function(e,t){return null==e?"":ln.call(e,t)},Pn.kebabCase=xa,Pn.last=ji,Pn.lastIndexOf=function(e,t,n){var l=null==e?0:e.length;if(!l)return-1;var o=l;return void 0!==n&&(o=(o=oa(n))<0?rn(l+o,0):an(o,l-1)),t==t?function(e,t,n){for(var l=n+1;l--;)if(e[l]===t)return l;return l}(e,t,o):Et(e,gt,o,!0)},Pn.lowerCase=Ma,Pn.lowerFirst=Fa,Pn.lt=ea,Pn.lte=ta,Pn.max=function(e){return e&&e.length?ll(e,Ka,ml):void 0},Pn.maxBy=function(e,t){return e&&e.length?ll(e,Zo(t,2),ml):void 0},Pn.mean=function(e){return ht(e,Ka)},Pn.meanBy=function(e,t){return ht(e,Zo(t,2))},Pn.min=function(e){return e&&e.length?ll(e,Ka,Al):void 0},Pn.minBy=function(e,t){return e&&e.length?ll(e,Zo(t,2),Al):void 0},Pn.stubArray=iu,Pn.stubFalse=ru,Pn.stubObject=function(){return{}},Pn.stubString=function(){return""},Pn.stubTrue=function(){return!0},Pn.multiply=pu,Pn.nth=function(e,t){return e&&e.length?Dl(e,oa(t)):void 0},Pn.noConflict=function(){return Ve._===this&&(Ve._=Ie),this},Pn.noop=Ja,Pn.now=Er,Pn.pad=function(e,t,n){e=ua(e);var l=(t=oa(t))?Wt(e):0;if(!t||l>=t)return e;var o=(t-l)/2;return Ro(Qt(o),n)+e+Ro(Jt(o),n)},Pn.padEnd=function(e,t,n){e=ua(e);var l=(t=oa(t))?Wt(e):0;return t&&l<t?e+Ro(t-l,n):e},Pn.padStart=function(e,t,n){e=ua(e);var l=(t=oa(t))?Wt(e):0;return t&&l<t?Ro(t-l,n)+e:e},Pn.parseInt=function(e,t,n){return n||null==t?t=0:t&&(t=+t),dn(ua(e).replace(Y,""),t||0)},Pn.random=function(e,t,n){if(n&&"boolean"!=typeof n&&ai(e,t,n)&&(t=n=void 0),void 0===n&&("boolean"==typeof t?(n=t,t=void 0):"boolean"==typeof e&&(n=e,e=void 0)),void 0===e&&void 0===t?(e=0,t=1):(e=la(e),void 0===t?(t=e,e=0):t=la(t)),e>t){var l=e;e=t,t=l}if(n||e%1||t%1){var o=sn();return an(e+o*(t-e+Ue("1e-"+((o+"").length-1))),t)}return Ml(e,t)},Pn.reduce=function(e,t,n){var l=xr(e)?ct:Tt,o=arguments.length<3;return l(e,Zo(t,4),n,o,el)},Pn.reduceRight=function(e,t,n){var l=xr(e)?pt:Tt,o=arguments.length<3;return l(e,Zo(t,4),n,o,tl)},Pn.repeat=function(e,t,n){return t=(n?ai(e,t,n):void 0===t)?1:oa(t),Fl(ua(e),t)},Pn.replace=function(){var e=arguments,t=ua(e[0]);return e.length<3?t:t.replace(e[1],e[2])},Pn.result=function(e,t,n){var l=-1,o=(t=ro(t,e)).length;for(o||(o=1,e=void 0);++l<o;){var i=null==e?void 0:e[Ii(t[l])];void 0===i&&(l=o,i=n),e=Hr(i)?i.call(e):i}return e},Pn.round=vu,Pn.runInContext=e,Pn.sample=function(e){return(xr(e)?Un:Bl)(e)},Pn.size=function(e){if(null==e)return 0;if(Fr(e))return Xr(e)?Wt(e):e.length;var t=ni(e);return t==v||t==y?e.size:Cl(e).length},Pn.snakeCase=ka,Pn.some=function(e,t,n){var l=xr(e)?vt:zl;return n&&ai(e,t,n)&&(t=void 0),l(e,Zo(t,3))},Pn.sortedIndex=function(e,t){return Yl(e,t)},Pn.sortedIndexBy=function(e,t,n){return Kl(e,t,Zo(n,2))},Pn.sortedIndexOf=function(e,t){var n=null==e?0:e.length;if(n){var l=Yl(e,t);if(l<n&&Dr(e[l],t))return l}return-1},Pn.sortedLastIndex=function(e,t){return Yl(e,t,!0)},Pn.sortedLastIndexBy=function(e,t,n){return Kl(e,t,Zo(n,2),!0)},Pn.sortedLastIndexOf=function(e,t){if(null!=e&&e.length){var n=Yl(e,t,!0)-1;if(Dr(e[n],t))return n}return-1},Pn.startCase=Ba,Pn.startsWith=function(e,t,n){return e=ua(e),n=null==n?0:Gn(oa(n),0,e.length),t=Zl(t),e.slice(n,n+t.length)==t},Pn.subtract=mu,Pn.sum=function(e){return e&&e.length?Ct(e,Ka):0},Pn.sumBy=function(e,t){return e&&e.length?Ct(e,Zo(t,2)):0},Pn.template=function(e,t,n){var l=Pn.templateSettings;n&&ai(e,t,n)&&(t=void 0),e=ua(e),t=ca({},t,l,jo);var o,i,r=ca({},t.imports,l.imports,jo),a=Sa(r),u=Pt(r,a),d=0,s=t.interpolate||ue,c="__p += '",p=fe((t.escape||ue).source+"|"+s.source+"|"+(s===j?ee:ue).source+"|"+(t.evaluate||ue).source+"|$","g"),v="//# sourceURL="+(be.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Me+"]")+"\n";e.replace(p,function(t,n,l,r,a,u){return l||(l=r),c+=e.slice(d,u).replace(de,Mt),n&&(o=!0,c+="' +\n__e("+n+") +\n'"),a&&(i=!0,c+="';\n"+a+";\n__p += '"),l&&(c+="' +\n((__t = ("+l+")) == null ? '' : __t) +\n'"),d=u+t.length,t}),c+="';\n";var m=be.call(t,"variable")&&t.variable;if(m){if(J.test(m))throw new ce("Invalid `variable` option passed into `_.template`")}else c="with (obj) {\n"+c+"\n}\n";c=(i?c.replace(w,""):c).replace(R,"$1").replace(L,"$1;"),c="function("+(m||"obj")+") {\n"+(m?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(o?", __e = _.escape":"")+(i?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+c+"return __p\n}";var f=Wa(function(){return pe(a,v+"return "+c).apply(void 0,u)});if(f.source=c,jr(f))throw f;return f},Pn.times=function(e,t){if((e=oa(e))<1||e>9007199254740991)return[];var n=4294967295,l=an(e,4294967295);e-=4294967295;for(var o=At(l,t=Zo(t));++n<e;)t(n);return o},Pn.toFinite=la,Pn.toInteger=oa,Pn.toLength=ia,Pn.toLower=function(e){return ua(e).toLowerCase()},Pn.toNumber=ra,Pn.toSafeInteger=function(e){return e?Gn(oa(e),-9007199254740991,9007199254740991):0===e?e:0},Pn.toString=ua,Pn.toUpper=function(e){return ua(e).toUpperCase()},Pn.trim=function(e,t,n){if((e=ua(e))&&(n||void 0===t))return Nt(e);if(!e||!(t=Zl(t)))return e;var l=Vt(e),o=Vt(t);return uo(l,Dt(l,o),wt(l,o)+1).join("")},Pn.trimEnd=function(e,t,n){if((e=ua(e))&&(n||void 0===t))return e.slice(0,$t(e)+1);if(!e||!(t=Zl(t)))return e;var l=Vt(e);return uo(l,0,wt(l,Vt(t))+1).join("")},Pn.trimStart=function(e,t,n){if((e=ua(e))&&(n||void 0===t))return e.replace(Y,"");if(!e||!(t=Zl(t)))return e;var l=Vt(e);return uo(l,Dt(l,Vt(t))).join("")},Pn.truncate=function(e,t){var n=30,l="...";if($r(t)){var o="separator"in t?t.separator:o;n="length"in t?oa(t.length):n,l="omission"in t?Zl(t.omission):l}var i=(e=ua(e)).length;if(Ft(e)){var r=Vt(e);i=r.length}if(n>=i)return e;var a=n-Wt(l);if(a<1)return l;var u=r?uo(r,0,a).join(""):e.slice(0,a);if(void 0===o)return u+l;if(r&&(a+=u.length-a),Gr(o)){if(e.slice(a).search(o)){var d,s=u;for(o.global||(o=fe(o.source,ua(te.exec(o))+"g")),o.lastIndex=0;d=o.exec(s);)var c=d.index;u=u.slice(0,void 0===c?a:c)}}else if(e.indexOf(Zl(o),a)!=a){var p=u.lastIndexOf(o);p>-1&&(u=u.slice(0,p))}return u+l},Pn.unescape=function(e){return(e=ua(e))&&F.test(e)?e.replace(x,zt):e},Pn.uniqueId=function(e){var t=++Te;return ua(e)+t},Pn.upperCase=Ua,Pn.upperFirst=ja,Pn.each=ur,Pn.eachRight=dr,Pn.first=Fi,Xa(Pn,(au={},ul(Pn,function(e,t){be.call(Pn.prototype,t)||(au[t]=e)}),au),{chain:!1}),Pn.VERSION="4.17.21",lt(["bind","bindKey","curry","curryRight","partial","partialRight"],function(e){Pn[e].placeholder=Pn}),lt(["drop","take"],function(e,t){Rn.prototype[e]=function(n){n=void 0===n?1:rn(oa(n),0);var l=this.__filtered__&&!t?new Rn(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},Rn.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;Rn.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:Zo(e,3),type:n}),t.__filtered__=t.__filtered__||l,t}}),lt(["head","last"],function(e,t){var n="take"+(t?"Right":"");Rn.prototype[e]=function(){return this[n](1).value()[0]}}),lt(["initial","tail"],function(e,t){var n="drop"+(t?"":"Right");Rn.prototype[e]=function(){return this.__filtered__?new Rn(this):this[n](1)}}),Rn.prototype.compact=function(){return this.filter(Ka)},Rn.prototype.find=function(e){return this.filter(e).head()},Rn.prototype.findLast=function(e){return this.reverse().find(e)},Rn.prototype.invokeMap=kl(function(e,t){return"function"==typeof e?new Rn(this):this.map(function(n){return _l(n,e,t)})}),Rn.prototype.reject=function(e){return this.filter(Ar(Zo(e)))},Rn.prototype.slice=function(e,t){e=oa(e);var n=this;return n.__filtered__&&(e>0||t<0)?new Rn(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),void 0!==t&&(n=(t=oa(t))<0?n.dropRight(-t):n.take(t-e)),n)},Rn.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},Rn.prototype.toArray=function(){return this.take(4294967295)},ul(Rn.prototype,function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),l=/^(?:head|last)$/.test(t),o=Pn[l?"take"+("last"==t?"Right":""):t],i=l||/^find/.test(t);o&&(Pn.prototype[t]=function(){var t=this.__wrapped__,r=l?[1]:arguments,a=t instanceof Rn,u=r[0],d=a||xr(t),s=function(e){var t=o.apply(Pn,st([e],r));return l&&c?t[0]:t};d&&n&&"function"==typeof u&&1!=u.length&&(a=d=!1);var c=this.__chain__,p=!!this.__actions__.length,v=i&&!c,m=a&&!p;if(!i&&d){t=m?t:new Rn(this);var f=e.apply(t,r);return f.__actions__.push({func:lr,args:[s],thisArg:void 0}),new wn(f,c)}return v&&m?e.apply(this,r):(f=this.thru(s),v?l?f.value()[0]:f.value():f)})}),lt(["pop","push","shift","sort","splice","unshift"],function(e){var t=_e[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",l=/^(?:pop|shift)$/.test(e);Pn.prototype[e]=function(){var e=arguments;if(l&&!this.__chain__){var o=this.value();return t.apply(xr(o)?o:[],e)}return this[n](function(n){return t.apply(xr(n)?n:[],e)})}}),ul(Rn.prototype,function(e,t){var n=Pn[t];if(n){var l=n.name+"";be.call(gn,l)||(gn[l]=[]),gn[l].push({name:t,func:n})}}),gn[Po(void 0,2).name]=[{name:"wrapper",func:void 0}],Rn.prototype.clone=function(){var e=new Rn(this.__wrapped__);return e.__actions__=yo(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=yo(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=yo(this.__views__),e},Rn.prototype.reverse=function(){if(this.__filtered__){var e=new Rn(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},Rn.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,n=xr(e),l=t<0,o=n?e.length:0,i=function(e,t,n){for(var l=-1,o=n.length;++l<o;){var i=n[l],r=i.size;switch(i.type){case"drop":e+=r;break;case"dropRight":t-=r;break;case"take":t=an(t,e+r);break;case"takeRight":e=rn(e,t-r)}}return{start:e,end:t}}(0,o,this.__views__),r=i.start,a=i.end,u=a-r,d=l?a:r-1,s=this.__iteratees__,c=s.length,p=0,v=an(u,this.__takeCount__);if(!n||!l&&o==u&&v==u)return to(e,this.__actions__);var m=[];e:for(;u--&&p<v;){for(var f=-1,E=e[d+=t];++f<c;){var y=s[f],_=y.type,g=(0,y.iteratee)(E);if(2==_)E=g;else if(!g){if(1==_)continue e;break e}}m[p++]=E}return m},Pn.prototype.at=or,Pn.prototype.chain=function(){return nr(this)},Pn.prototype.commit=function(){return new wn(this.value(),this.__chain__)},Pn.prototype.next=function(){void 0===this.__values__&&(this.__values__=na(this.value()));var e=this.__index__>=this.__values__.length;return{done:e,value:e?void 0:this.__values__[this.__index__++]}},Pn.prototype.plant=function(e){for(var t,n=this;n instanceof Dn;){var l=Oi(n);l.__index__=0,l.__values__=void 0,t?o.__wrapped__=l:t=l;var o=l;n=n.__wrapped__}return o.__wrapped__=e,t},Pn.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof Rn){var t=e;return this.__actions__.length&&(t=new Rn(this)),(t=t.reverse()).__actions__.push({func:lr,args:[$i],thisArg:void 0}),new wn(t,this.__chain__)}return this.thru($i)},Pn.prototype.toJSON=Pn.prototype.valueOf=Pn.prototype.value=function(){return to(this.__wrapped__,this.__actions__)},Pn.prototype.first=Pn.prototype.head,bt&&(Pn.prototype[bt]=function(){return this}),Pn}();ze?((ze.exports=Yt)._=Yt,$e._=Yt):Ve._=Yt}).call(s)});const v=e=>{var i;let{config:a,onSelect:u,value:s,userType:c,redirectUrl:v}=e;const[m,f]=n.useState(null),{t:E}=(Digit.ULBService.getCurrentTenantId(),Digit.Hooks.pt.useTenants(),o.useTranslation()),y=r.useLocation(),[_,g]=n.useState(!1),h={...s},S=r.useHistory(),b=r.useRouteMatch();sessionStorage.setItem("VisitedCommonPTSearch",!0),sessionStorage.setItem("VisitedLightCreate",!0);const T=window.Digit.Utils.browser.isMobile();let C=null===(i=Digit.Hooks.pt.useTenants())||void 0===i?void 0:i.sort((e,t)=>{var n,l;return null==e||null===(n=e.i18nKey)||void 0===n||null===(l=n.localeCompare)||void 0===l?void 0:l.call(n,null==t?void 0:t.i18nKey)});window.location.href.includes("obps")&&(C=Digit.SessionStorage.get("OBPS_TENANTS")),window.location.href.includes("fsm")&&(C=Digit.SessionStorage.get("FSM_TENANTS"));const[A,N]=n.useState(""),[I,P]=n.useState("");let O="employee"!=c&&((null==a?void 0:a.isSkipEnabled)||sessionStorage.getItem("skipenabled"));const[D,w,R]=Digit.Hooks.useSessionStorage("EMPLOYEE_MUTATION_HAPPENED",!1),[L,x,M]=Digit.Hooks.useSessionStorage("EMPLOYEE_MUTATION_SUCCESS_DATA",{}),{isLoading:F}=Digit.Hooks.pt.useMDMS(Digit.ULBService.getStateId(),"PropertyTax","CommonFieldsConfig");return n.useEffect(()=>{w(!1),M()},[]),F?l.createElement(t.Loader,null):l.createElement(l.Fragment,null,l.createElement("div",{style:{marginLeft:"12px"}},l.createElement(t.Header,{styles:window.location.href.includes("citizen")?{paddingLeft:"0px",marginLeft:"0px"}:{}},E((()=>{var e,t,n;let l=window.location.href,o=null==l||null===(e=l.split("="))||void 0===e||null===(t=e[1])||void 0===t||null===(n=t.split("/"))||void 0===n?void 0:n[3];return E(o?"ES_COMMON_CREATE_PROPERTY_HEADER_"+(null==o?void 0:o.toUpperCase()):"ES_COMMON_CREATE_PROPERTY_HEADER")})()))),l.createElement(t.FormComposer,{onSkip:()=>{u("isSkip",!0)},showSkip:O,skipStyle:T?{}:{textAlign:"right",marginRight:"55px"},sectionHeadStyle:{marginBottom:"16px"},onSubmit:function(){try{var e,t,n,l,o,i,r,a,d;return(null!=A&&null!==(e=A.owners)&&void 0!==e&&null!==(t=e.ownershipCategory)&&void 0!==t&&t.includes("MULTIPLEOWNERS")||null!=A&&null!==(n=A.owners)&&void 0!==n&&null!==(l=n[0])&&void 0!==l&&null!==(o=l.ownershipCategory)&&void 0!==o&&null!==(i=o.code)&&void 0!==i&&i.includes("MULTIPLEOWNERS"))&&1==(null==A||null===(r=A.owners)||void 0===r?void 0:r.length)?f({key:!0,label:"PT_COMMON_ONE_MORE_OWNER_INFROMATION_REQUIRED"}):u?u("cptNewProperty",{property:A}):"employee"===c?S.push(`${b.path}/save-property?redirectToUrl=${v}`,{data:A,prevState:{...null==y?void 0:y.state}}):S.replace("/digit-ui/citizen/commonPt/property/citizen-otp",{mobileNumber:null==A||null===(a=A.owners)||void 0===a||null===(d=a[0])||void 0===d?void 0:d.mobileNumber,redirectBackTo:"/digit-ui/citizen/commonPt/property/new-application/save-property",redirectData:A}),Promise.resolve()}catch(e){return Promise.reject(e)}},noBoxShadow:!0,inline:!0,config:d,label:E("SUBMIT"),isDisabled:!_,defaultValues:h,onFormValueChange:(e,t,n)=>{p.isEqual(t,A)||N(t),t.assemblyDet&&t.locationDet&&t.owners&&!Object.keys(null==n?void 0:n.errors).length?g(!0):g(!1)}}),m&&l.createElement(t.Toast,{error:m.key,label:E(m.label),onClose:()=>{f(null)}}))},m=e=>{var t,n;let{locationDet:l}=e,o={city:null==l||null===(t=l.cityCode)||void 0===t?void 0:t.name,doorNo:null==l?void 0:l.houseDoorNo,street:null==l?void 0:l.buildingColonyName,landmark:null==l?void 0:l.landmarkName,locality:{code:(null==l||null===(n=l.locality)||void 0===n?void 0:n.code)||"NA"}};return e.address=o,e},f=e=>{var t,n;const{locationDet:l,owners:o}=e;let i={},r=[],a=[];var u,d,s,c,p,v,m,f,E,y,_,g,h,S,b;return e.ownershipCategory=null==e||null===(t=e.owners)||void 0===t||null===(n=t[0])||void 0===n?void 0:n.ownershipCategory,e.ownershipCategory.includes("INSTITUTIONALPRIVATE")||e.ownershipCategory.includes("INSTITUTIONALGOVERNMENT")?(i.designation=null==o||null===(u=o[0])||void 0===u?void 0:u.designation,i.name=null==o||null===(d=o[0])||void 0===d?void 0:d.institutionName,i.type=null==o||null===(s=o[0])||void 0===s||null===(c=s.institutionType)||void 0===c||null===(p=c.code)||void 0===p||null===(v=p.split("."))||void 0===v?void 0:v[1],i.landlineNumber=null==o||null===(m=o[0])||void 0===m?void 0:m.altContactNumber,i.tenantId=null==l||null===(f=l.cityCode)||void 0===f?void 0:f.code,r.push({altContactNumber:null==o||null===(E=o[0])||void 0===E?void 0:E.altContactNumber,permanentAddress:null==o||null===(y=o[0])||void 0===y?void 0:y.permanentAddress,correspondenceAddress:null==o||null===(_=o[0])||void 0===_?void 0:_.permanentAddress,sameAsPropertyAddress:(null==o||null===(g=o[0])||void 0===g?void 0:g.isCorrespondenceAddress)||(null==o||null===(h=o[0])||void 0===h?void 0:h.isCoresAddr),mobileNumber:null==o||null===(S=o[0])||void 0===S?void 0:S.mobileNumber,name:null==o||null===(b=o[0])||void 0===b?void 0:b.name,ownerType:"NONE",status:"ACTIVE",documents:a}),e.institution=i,e.owners=r):(o.map(e=>{var t,n,l,i;r.push({emailId:null==e?void 0:e.emailId,fatherOrHusbandName:null==e?void 0:e.fatherOrHusbandName,gender:null==e||null===(t=e.gender)||void 0===t?void 0:t.value,sameAsPropertyAddress:(null==e?void 0:e.isCorrespondenceAddress)||(null==o||null===(n=o[0])||void 0===n?void 0:n.isCoresAddr),mobileNumber:null==e?void 0:e.mobileNumber,name:null==e?void 0:e.name,ownerType:(null==e||null===(l=e.ownerType)||void 0===l?void 0:l.code)||"NONE",permanentAddress:null==e?void 0:e.permanentAddress,relationship:null==e||null===(i=e.relationship)||void 0===i?void 0:i.code,documents:a})}),e.owners=r),e},E=e=>{var t,n,l;return"RESIDENTIAL"==(null==e||null===(t=e.isResdential)||void 0===t?void 0:t.code)?null==e||null===(n=e.isResdential)||void 0===n?void 0:n.code:null==e||null===(l=e.usageCategory)||void 0===l?void 0:l.code},y=e=>{var t;let n={};const{assemblyDet:l}=e;return n={propertyType:null==l||null===(t=l.BuildingType)||void 0===t?void 0:t.code,usageCategory:E(l),landArea:parseInt(null==l?void 0:l.floorarea),superBuiltUpArea:parseInt(null==l?void 0:l.constructionArea)},e.propertyDetails=n,e},g=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},h=e=>{const{t:t}=o.useTranslation();return e.isSuccess?window.location.href.includes("edit-application")?t("CS_PROPERTY_UPDATE_APPLICATION_SUCCESS"):window.location.href.includes("employee")?t("CS_NEW_PROPERTY_APPLICATION_CREATED_SUCCESS"):t("CS_NEW_PROPERTY_APPLICATION_SUBMITTED_SUCCESS"):e.isLoading?window.location.href.includes("edit-application")?t("CS_PROPERTY_UPDATE_APPLICATION_PENDING"):t("CS_PROPERTY_APPLICATION_PENDING"):e.isSuccess?void 0:window.location.href.includes("edit-application")?t("CS_PROPERTY_UPDATE_APPLICATION_FAILED"):t("CS_PROPERTY_APPLICATION_FAILED")},S={padding:"4px 0px",justifyContent:"space-between"},b=e=>{var n;return l.createElement(t.Banner,{message:h(e),applicationNumber:null===(n=e.data)||void 0===n?void 0:n.Properties[0].acknowldgementNumber,info:e.isSuccess?e.t("PT_APPLICATION_NO"):"",successful:e.isSuccess})},T=e=>{var i,a,u,d,s,c,p,v,E,_,g,h;let{onSuccess:T,onSelect:C,formData:A,redirectUrl:N,userType:I}=e;const{t:P}=o.useTranslation(),O=r.useLocation(),D=Digit.ULBService.getStateId(),w=Digit.ULBService.getCurrentTenantId(),R=r.useHistory();let L=null==O||null===(i=O.state)||void 0===i?void 0:i.data;var x;C&&(L=null==A||null===(x=A.cptNewProperty)||void 0===x?void 0:x.property);let M=!1,{data:F}=Digit.Hooks.pt.useMDMS(D,"PropertyTax","PTWorkflow");((null==F||null===(a=F.PropertyTax)||void 0===a?void 0:a.PTWorkfow)||[]).forEach(e=>{e.enable&&e.businessService.includes("WNS")&&(M=!0)});const k=Digit.Hooks.pt.usePropertyAPI(null!==(u=L)&&void 0!==u&&null!==(d=u.locationDet)&&void 0!==d&&d.city?null===(s=L.locationDet)||void 0===s||null===(c=s.city)||void 0===c?void 0:c.code:w,!0),B=Digit.Hooks.pt.usePropertyAPI(null!==(p=L)&&void 0!==p&&null!==(v=p.locationDet)&&void 0!==v&&v.city?null===(E=L.locationDet)||void 0===E||null===(_=E.city)||void 0===_?void 0:_.code:w,!1);return Digit.Hooks.useStore.getInitData(),n.useEffect(()=>{try{var e,t,n,l;let o="employee"===I?w:null===(e=L)||void 0===e||null===(t=e.locationDet)||void 0===t||null===(n=t.cityCode)||void 0===n?void 0:n.code;L.tenantId=o;let i=function(e){var t,n,l,o,i,r;void 0===e&&(e={});let a=e.PropertyType,u=null===(t=e)||void 0===t||null===(n=t.owners)||void 0===n||null===(l=n[0])||void 0===l?void 0:l.ownershipCategory;e=f(e),e=m(e);const d={Property:{tenantId:(e=y(e)).tenantId,address:e.address,propertyType:a,...e.propertyDetails,ownershipCategory:u,usageCategory:null===(o=e)||void 0===o||null===(i=o.assemblyDet)||void 0===i||null===(r=i.usageCategoryMajor)||void 0===r?void 0:r.code,owners:[...e.owners.map((e,t)=>{var n,l,o,i;return{...e,additionalDetails:{ownerSequence:t,ownerName:null==e?void 0:e.name},documents:Object.keys(e.documents).map(t=>{const{documentType:n,fileStoreId:l}=e.documents[t];return{documentType:n.code,fileStoreId:l}}),gender:null===(n=e.gender)||void 0===n?void 0:n.code,ownerType:(null===(l=e.ownerType)||void 0===l?void 0:l.code)||"NONE",relationship:null===(o=e.relationship)||void 0===o?void 0:o.code,inistitutetype:null==e||null===(i=e.inistitutetype)||void 0===i?void 0:i.value,landlineNumber:null==e?void 0:e.altContactNumber,status:"ACTIVE"}})],noOfFloors:1,additionalDetails:{isRainwaterHarvesting:!1,owners:[...e.owners.map((e,t)=>{var n,l,o,i;return{...e,additionalDetails:{ownerSequence:t,ownerName:null==e?void 0:e.name},documents:Object.keys(e.documents).map(t=>{const{documentType:n,fileStoreId:l}=e.documents[t];return{documentType:n.code,fileStoreId:l}}),gender:null===(n=e.gender)||void 0===n?void 0:n.code,ownerType:(null===(l=e.ownerType)||void 0===l?void 0:l.code)||"NONE",relationship:null===(o=e.relationship)||void 0===o?void 0:o.code,inistitutetype:null==e||null===(i=e.inistitutetype)||void 0===i?void 0:i.value,landlineNumber:null==e?void 0:e.altContactNumber,status:"ACTIVE"}})]},creationReason:"CREATE",source:"MUNICIPAL_RECORDS",channel:"SYSTEM"}};var s;return(u.includes("INSTITUTIONALPRIVATE")||u.includes("INSTITUTIONALGOVERNMENT"))&&(d.Property.institution=null===(s=e)||void 0===s?void 0:s.institution),d}(L);i.Property.tenantId=(null==i||null===(l=i.Property)||void 0===l?void 0:l.tenantId)||o,k.mutate(i,{onSuccess:T}),M||k.isLoading&&k.isIdle||k.isSuccess&&setTimeout(()=>{if(N){var e,t,n;R.push(`${N}?propertyId=${null==k||null===(e=k.data)||void 0===e||null===(t=e.Properties[0])||void 0===t?void 0:t.propertyId}&tenantId=${i.Property.tenantId}`,{...null==O||null===(n=O.state)||void 0===n?void 0:n.prevState});const l=null!=N&&N.includes("employee/tl")?1600:300;setTimeout(()=>window.scrollTo(0,l),400)}},3e3)}catch(e){}},[]),n.useEffect(()=>{var e,t,n;let l="employee"===I?w:null===(e=L)||void 0===e||null===(t=e.locationDet)||void 0===t||null===(n=t.city)||void 0===n?void 0:n.code;k.isSuccess&&setTimeout(()=>{if(N){var e,t,n;R.push(`${N}?propertyId=${null==k||null===(e=k.data)||void 0===e||null===(t=e.Properties[0])||void 0===t?void 0:t.propertyId}&tenantId=${l}`,{...null==O||null===(n=O.state)||void 0===n?void 0:n.prevState});const o=null!=N&&N.includes("employee/tl")?1600:300;setTimeout(()=>window.scrollTo(0,o),400)}},3e3)},[k]),n.useEffect(()=>{if(k.isSuccess&&M)try{var e,t,n,l;let o="employee"===I?w:null===(e=L)||void 0===e||null===(t=e.locationDet)||void 0===t||null===(n=t.city)||void 0===n?void 0:n.code;L.tenantId=o;let i=function(e){var t,n,l,o;void 0===e&&(e={});let i=e.PropertyType;e=f(e),e=m(e);const r={Property:{id:(e=y(e)).id,accountId:e.accountId,acknowldgementNumber:e.acknowldgementNumber,propertyId:e.propertyId,status:e.status||"INWORKFLOW",tenantId:e.tenantId,address:e.address,propertyType:i,ownershipCategory:null===(t=e)||void 0===t?void 0:t.ownershipCategory,owners:[...e.owners.map((e,t)=>{var n,l,o,i;return{...e,additionalDetails:{ownerSequence:t,ownerName:null==e?void 0:e.name},documents:Object.keys(e.documents).map(t=>{const{documentType:n,fileStoreId:l}=e.documents[t];return{documentType:n.code,fileStoreId:l}}),gender:null===(n=e.gender)||void 0===n?void 0:n.code,ownerType:(null===(l=e.ownerType)||void 0===l?void 0:l.code)||"NONE",relationship:null===(o=e.relationship)||void 0===o?void 0:o.code,inistitutetype:null==e||null===(i=e.inistitutetype)||void 0===i?void 0:i.value,landlineNumber:null==e?void 0:e.altContactNumber,status:"ACTIVE"}})],noOfFloors:1,additionalDetails:{isRainwaterHarvesting:!1,owners:[...e.owners.map((e,t)=>{var n,l,o,i;return{...e,additionalDetails:{ownerSequence:t,ownerName:null==e?void 0:e.name},documents:Object.keys(e.documents).map(t=>{const{documentType:n,fileStoreId:l}=e.documents[t];return{documentType:n.code,fileStoreId:l}}),gender:null===(n=e.gender)||void 0===n?void 0:n.code,ownerType:(null===(l=e.ownerType)||void 0===l?void 0:l.code)||"NONE",relationship:null===(o=e.relationship)||void 0===o?void 0:o.code,inistitutetype:null==e||null===(i=e.inistitutetype)||void 0===i?void 0:i.value,landlineNumber:null==e?void 0:e.altContactNumber,status:"ACTIVE"}})]},...e.propertyDetails,creationReason:getCreationReason(e),source:"MUNICIPAL_RECORDS",channel:"CITIZEN",workflow:getWorkflow(e)}};let a=JSON.parse(sessionStorage.getItem("propertyInitialObject"));if(checkArrayLength(null==a?void 0:a.units)&&checkIsAnArray(null===(n=r.Property)||void 0===n?void 0:n.units)&&null!==(l=e)&&void 0!==l&&l.isEditProperty){var u;a.units=a.units.filter(e=>e.active);let e=a.units.map(e=>({...e,active:!1}));null===(u=r.Property)||void 0===u||u.units.push(...e)}return checkArrayLength(null==a?void 0:a.owners)&&checkIsAnArray(null===(o=r.Property)||void 0===o?void 0:o.owners)&&(r.Property.owners=[...a.owners]),null!=a&&a.auditDetails&&(r.Property.auditDetails={...a.auditDetails}),r}(L);i.Property.tenantId=(null==i||null===(l=i.Property)||void 0===l?void 0:l.tenantId)||o,B.mutate(i,{onSuccess:T}),B.isSuccess&&setTimeout(()=>{if(N){var e,t,n,l,o;R.push(`${N}?propertyId=${null==B||null===(e=B.data)||void 0===e||null===(t=e.Properties[0])||void 0===t?void 0:t.propertyId}&tenantId=${null==B||null===(n=B.data)||void 0===n||null===(l=n.Properties[0])||void 0===l?void 0:l.tenantId}`,{...null==O||null===(o=O.state)||void 0===o?void 0:o.prevState});const i=null!=N&&N.includes("employee/tl")?1600:300;setTimeout(()=>window.scrollTo(0,i),400)}},3e3)}catch(e){}},[k.isSuccess]),k.isLoading||k.isIdle?l.createElement(t.Loader,null):l.createElement(t.Card,null,l.createElement(b,{t:P,data:k.data,isSuccess:k.isSuccess,isLoading:k.isIdle||k.isLoading}),k.isSuccess&&l.createElement(t.CardText,null,window.location.href.includes("employee")?P("CS_CREATE_PROPERTY_SUCCESS_EMP_RESPONSE"):P("CS_CREATE_PROPERTY_SUCCESS_CITIZEN_RESPONSE")),!k.isSuccess&&l.createElement(t.CardText,null,P("CS_FILE_PROPERTY_FAILED_RESPONSE")),l.createElement(t.StatusTable,null,k.isSuccess&&l.createElement(t.Row,{rowContainerStyle:S,last:!0,label:P("PT_COMMON_TABLE_COL_PT_ID"),text:null==k||null===(g=k.data)||void 0===g||null===(h=g.Properties[0])||void 0===h?void 0:h.propertyId,textStyle:{whiteSpace:"pre",width:"200%"}})),k.isSuccess&&window.location.href.includes("/citizen/")&&l.createElement(t.SubmitBar,C?{label:P("CS_COMMON_PROCEED"),onSubmit:()=>{var e,t,n;C&&k.isSuccess&&(sessionStorage.setItem("Digit_OBPS_PT",JSON.stringify(null==k||null===(e=k.data)||void 0===e?void 0:e.Properties[0])),sessionStorage.setItem("Digit_FSM_PT",JSON.stringify(null==k||null===(t=k.data)||void 0===t?void 0:t.Properties[0])),C("cpt",{details:null==k||null===(n=k.data)||void 0===n?void 0:n.Properties[0]}))}}:{label:P("CS_COMMON_PROCEED"),onSubmit:()=>{var e,t,n,l,o;N&&R.push(`${N}?propertyId=${null==B||null===(e=B.data)||void 0===e||null===(t=e.Properties[0])||void 0===t?void 0:t.propertyId}&tenantId=${null==B||null===(n=B.data)||void 0===n||null===(l=n.Properties[0])||void 0===l?void 0:l.tenantId}`,{...null==O||null===(o=O.state)||void 0===o?void 0:o.prevState})}}))},C=e=>{const n=a.useQueryClient(),i=r.useRouteMatch(),u=(o.useTranslation(),r.useLocation(),r.useHistory()),d=Digit.ULBService.getStateId(),[s,c,p]=Digit.Hooks.useSessionStorage("PT_CREATE_PROPERTY",{});let{isLoading:m}=Digit.Hooks.pt.useMDMS(d,"PropertyTax","CommonFieldsConfig");const f=r.useLocation().search,E=new URLSearchParams(f).get("redirectUrl");return m?l.createElement(t.Loader,null):l.createElement(r.Switch,null,l.createElement(r.Route,{exact:!0,path:""+i.path},l.createElement(v,{onSubmit:function(){try{return u.push(i.path+"/acknowledgement"),Promise.resolve()}catch(e){return Promise.reject(e)}},value:s,userType:"citizen"})),l.createElement(r.Route,{exact:!0,path:i.path+"/save-property"},l.createElement(T,{data:s,onSuccess:()=>{p(),n.invalidateQueries("PT_CREATE_PROPERTY")},redirectUrl:E,userType:"citizen"})))},A=[{texts:{header:"SEARCH_PROPERTY",submitButtonLabel:"PT_HOME_SEARCH_RESULTS_BUTTON_SEARCH",text:""},inputs:[{label:"PT_OWNER_MOB_NO_LABEL",type:"mobileNumber",name:"mobileNumber",validation:{pattern:{value:/[6789][0-9]{9}/,message:"CORE_COMMON_MOBILE_ERROR"}},error:"CORE_COMMON_MOBILE_ERROR"},{label:"PT_PROPERTY_ID",description:"CS_PROPERTY_ID_FORMAT_MUST_BE",type:"text",name:"propertyIds",error:"ERR_INVALID_PROPERTY_ID",validation:{pattern:{value:"[A-Za-z]{2}-[A-Za-z]{2}-[0-9]{4}-[0-9]{4}-[0-9]{2}-[0-9]{2}-[0-9]{6}||[A-Za-z]{2}-[A-Za-z]{2}-[0-9]{4}-[0-9]{4}-[0-9]{2}-[0-9]{2}-[0-9]{6}||[A-Za-z]{2}-[A-Za-z]{2}-[0-9]{4}-[0-9]{2}-[0-9]{2}-[0-9]{6}",message:"ERR_INVALID_PROPERTY_ID"}}},{label:"PT_PROPERTY_ADDRESS_OLDPID",type:"text",name:"oldPropertyId",error:"ERR_INVALID_PROPERTY_ID",validation:{pattern:{value:"[A-Za-z]{2}-[A-Za-z]{2}-[0-9]{4}-[0-9]{4}-[0-9]{2}-[0-9]{2}-[0-9]{6}|[A-Za-z]{2}-[A-Za-z]{2}-[0-9]{4}-[0-9]{2}-[0-9]{2}-[0-9]{6}",message:"ERR_INVALID_PROPERTY_ID"}}},{label:"PT_COMMON_PAYEE_NAME",type:"text",name:"name",validation:{pattern:{value:"^[a-zA-Z ]+$",message:"PAYMENT_INVALID_NAME"}},error:"PAYMENT_INVALID_NAME"},{label:"PT_DOOR_NUM_LABEL",type:"text",name:"doorNumber",validation:{pattern:{value:"[A-Za-z0-9#,/ -()]{1,63}",message:"ERR_INVALID_DOOR_NO"}},error:"ERR_INVALID_DOOR_NO"}]}];function N(){return(N=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)}
2
- /** @license React v16.13.1
3
- * react-is.production.min.js
4
- *
5
- * Copyright (c) Facebook, Inc. and its affiliates.
6
- *
7
- * This source code is licensed under the MIT license found in the
8
- * LICENSE file in the root directory of this source tree.
9
- */var I="function"==typeof Symbol&&Symbol.for,P=I?Symbol.for("react.element"):60103,O=I?Symbol.for("react.portal"):60106,D=I?Symbol.for("react.fragment"):60107,w=I?Symbol.for("react.strict_mode"):60108,R=I?Symbol.for("react.profiler"):60114,L=I?Symbol.for("react.provider"):60109,x=I?Symbol.for("react.context"):60110,M=I?Symbol.for("react.async_mode"):60111,F=I?Symbol.for("react.concurrent_mode"):60111,k=I?Symbol.for("react.forward_ref"):60112,B=I?Symbol.for("react.suspense"):60113,U=I?Symbol.for("react.suspense_list"):60120,j=I?Symbol.for("react.memo"):60115,H=I?Symbol.for("react.lazy"):60116,W=I?Symbol.for("react.block"):60121,V=I?Symbol.for("react.fundamental"):60117,$=I?Symbol.for("react.responder"):60118,z=I?Symbol.for("react.scope"):60119;function Y(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case P:switch(e=e.type){case M:case F:case D:case R:case w:case B:return e;default:switch(e=e&&e.$$typeof){case x:case k:case H:case j:case L:return e;default:return t}}case O:return t}}}function K(e){return Y(e)===F}var q={AsyncMode:M,ConcurrentMode:F,ContextConsumer:x,ContextProvider:L,Element:P,ForwardRef:k,Fragment:D,Lazy:H,Memo:j,Portal:O,Profiler:R,StrictMode:w,Suspense:B,isAsyncMode:function(e){return K(e)||Y(e)===M},isConcurrentMode:K,isContextConsumer:function(e){return Y(e)===x},isContextProvider:function(e){return Y(e)===L},isElement:function(e){return"object"==typeof e&&null!==e&&e.$$typeof===P},isForwardRef:function(e){return Y(e)===k},isFragment:function(e){return Y(e)===D},isLazy:function(e){return Y(e)===H},isMemo:function(e){return Y(e)===j},isPortal:function(e){return Y(e)===O},isProfiler:function(e){return Y(e)===R},isStrictMode:function(e){return Y(e)===w},isSuspense:function(e){return Y(e)===B},isValidElementType:function(e){return"string"==typeof e||"function"==typeof e||e===D||e===F||e===R||e===w||e===B||e===U||"object"==typeof e&&null!==e&&(e.$$typeof===H||e.$$typeof===j||e.$$typeof===L||e.$$typeof===x||e.$$typeof===k||e.$$typeof===V||e.$$typeof===$||e.$$typeof===z||e.$$typeof===W)},typeOf:Y},G=c(function(e,t){"production"!==process.env.NODE_ENV&&function(){var e="function"==typeof Symbol&&Symbol.for,n=e?Symbol.for("react.element"):60103,l=e?Symbol.for("react.portal"):60106,o=e?Symbol.for("react.fragment"):60107,i=e?Symbol.for("react.strict_mode"):60108,r=e?Symbol.for("react.profiler"):60114,a=e?Symbol.for("react.provider"):60109,u=e?Symbol.for("react.context"):60110,d=e?Symbol.for("react.async_mode"):60111,s=e?Symbol.for("react.concurrent_mode"):60111,c=e?Symbol.for("react.forward_ref"):60112,p=e?Symbol.for("react.suspense"):60113,v=e?Symbol.for("react.suspense_list"):60120,m=e?Symbol.for("react.memo"):60115,f=e?Symbol.for("react.lazy"):60116,E=e?Symbol.for("react.block"):60121,y=e?Symbol.for("react.fundamental"):60117,_=e?Symbol.for("react.responder"):60118,g=e?Symbol.for("react.scope"):60119;function h(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case n:var v=e.type;switch(v){case d:case s:case o:case r:case i:case p:return v;default:var E=v&&v.$$typeof;switch(E){case u:case c:case f:case m:case a:return E;default:return t}}case l:return t}}}var S=s,b=u,T=a,C=n,A=c,N=o,I=f,P=m,O=l,D=r,w=i,R=p,L=!1;function x(e){return h(e)===s}t.AsyncMode=d,t.ConcurrentMode=S,t.ContextConsumer=b,t.ContextProvider=T,t.Element=C,t.ForwardRef=A,t.Fragment=N,t.Lazy=I,t.Memo=P,t.Portal=O,t.Profiler=D,t.StrictMode=w,t.Suspense=R,t.isAsyncMode=function(e){return L||(L=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),x(e)||h(e)===d},t.isConcurrentMode=x,t.isContextConsumer=function(e){return h(e)===u},t.isContextProvider=function(e){return h(e)===a},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===n},t.isForwardRef=function(e){return h(e)===c},t.isFragment=function(e){return h(e)===o},t.isLazy=function(e){return h(e)===f},t.isMemo=function(e){return h(e)===m},t.isPortal=function(e){return h(e)===l},t.isProfiler=function(e){return h(e)===r},t.isStrictMode=function(e){return h(e)===i},t.isSuspense=function(e){return h(e)===p},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===o||e===s||e===r||e===i||e===p||e===v||"object"==typeof e&&null!==e&&(e.$$typeof===f||e.$$typeof===m||e.$$typeof===a||e.$$typeof===u||e.$$typeof===c||e.$$typeof===y||e.$$typeof===_||e.$$typeof===g||e.$$typeof===E)},t.typeOf=h}()}),Z=c(function(e){e.exports="production"===process.env.NODE_ENV?q:G}),X=Object.getOwnPropertySymbols,J=Object.prototype.hasOwnProperty,Q=Object.prototype.propertyIsEnumerable;function ee(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}var te=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(""))return!1;var l={};return"abcdefghijklmnopqrst".split("").forEach(function(e){l[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},l)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var n,l,o=ee(e),i=1;i<arguments.length;i++){for(var r in n=Object(arguments[i]))J.call(n,r)&&(o[r]=n[r]);if(X){l=X(n);for(var a=0;a<l.length;a++)Q.call(n,l[a])&&(o[l[a]]=n[l[a]])}}return o},ne="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",le=Function.call.bind(Object.prototype.hasOwnProperty),oe=function(){};if("production"!==process.env.NODE_ENV){var ie=ne,re={},ae=le;oe=function(e){var t="Warning: "+e;"undefined"!=typeof console&&console.error(t);try{throw new Error(t)}catch(e){}}}function ue(e,t,n,l,o){if("production"!==process.env.NODE_ENV)for(var i in e)if(ae(e,i)){var r;try{if("function"!=typeof e[i]){var a=Error((l||"React class")+": "+n+" type `"+i+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[i]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw a.name="Invariant Violation",a}r=e[i](t,i,l,n,null,ie)}catch(e){r=e}if(!r||r instanceof Error||oe((l||"React class")+": type specification of "+n+" `"+i+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof r+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),r instanceof Error&&!(r.message in re)){re[r.message]=!0;var u=o?o():"";oe("Failed "+n+" type: "+r.message+(null!=u?u:""))}}}ue.resetWarningCache=function(){"production"!==process.env.NODE_ENV&&(re={})};var de=ue,se=function(){};function ce(){return null}function pe(){}function ve(){}"production"!==process.env.NODE_ENV&&(se=function(e){var t="Warning: "+e;"undefined"!=typeof console&&console.error(t);try{throw new Error(t)}catch(e){}}),ve.resetWarningCache=pe;var me=c(function(e){e.exports="production"!==process.env.NODE_ENV?function(e,t){var n="function"==typeof Symbol&&Symbol.iterator,l={array:a("array"),bigint:a("bigint"),bool:a("boolean"),func:a("function"),number:a("number"),object:a("object"),string:a("string"),symbol:a("symbol"),any:r(ce),arrayOf:function(e){return r(function(t,n,l,o,r){if("function"!=typeof e)return new i("Property `"+r+"` of component `"+l+"` has invalid PropType notation inside arrayOf.");var a=t[n];if(!Array.isArray(a))return new i("Invalid "+o+" `"+r+"` of type `"+s(a)+"` supplied to `"+l+"`, expected an array.");for(var u=0;u<a.length;u++){var d=e(a,u,l,o,r+"["+u+"]",ne);if(d instanceof Error)return d}return null})},element:r(function(t,n,l,o,r){var a=t[n];return e(a)?null:new i("Invalid "+o+" `"+r+"` of type `"+s(a)+"` supplied to `"+l+"`, expected a single ReactElement.")}),elementType:r(function(e,t,n,l,o){var r=e[t];return Z.isValidElementType(r)?null:new i("Invalid "+l+" `"+o+"` of type `"+s(r)+"` supplied to `"+n+"`, expected a single ReactElement type.")}),instanceOf:function(e){return r(function(t,n,l,o,r){var a;return t[n]instanceof e?null:new i("Invalid "+o+" `"+r+"` of type `"+((a=t[n]).constructor&&a.constructor.name?a.constructor.name:"<<anonymous>>")+"` supplied to `"+l+"`, expected instance of `"+(e.name||"<<anonymous>>")+"`.")})},node:r(function(e,t,n,l,o){return d(e[t])?null:new i("Invalid "+l+" `"+o+"` supplied to `"+n+"`, expected a ReactNode.")}),objectOf:function(e){return r(function(t,n,l,o,r){if("function"!=typeof e)return new i("Property `"+r+"` of component `"+l+"` has invalid PropType notation inside objectOf.");var a=t[n],u=s(a);if("object"!==u)return new i("Invalid "+o+" `"+r+"` of type `"+u+"` supplied to `"+l+"`, expected an object.");for(var d in a)if(le(a,d)){var c=e(a,d,l,o,r+"."+d,ne);if(c instanceof Error)return c}return null})},oneOf:function(e){if(!Array.isArray(e))return"production"!==process.env.NODE_ENV&&se(arguments.length>1?"Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).":"Invalid argument supplied to oneOf, expected an array."),ce;function t(t,n,l,r,a){for(var u=t[n],d=0;d<e.length;d++)if(o(u,e[d]))return null;var s=JSON.stringify(e,function(e,t){return"symbol"===c(t)?String(t):t});return new i("Invalid "+r+" `"+a+"` of value `"+String(u)+"` supplied to `"+l+"`, expected one of "+s+".")}return r(t)},oneOfType:function(e){if(!Array.isArray(e))return"production"!==process.env.NODE_ENV&&se("Invalid argument supplied to oneOfType, expected an instance of array."),ce;for(var t=0;t<e.length;t++){var n=e[t];if("function"!=typeof n)return se("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+p(n)+" at index "+t+"."),ce}return r(function(t,n,l,o,r){for(var a=[],u=0;u<e.length;u++){var d=(0,e[u])(t,n,l,o,r,ne);if(null==d)return null;d.data&&le(d.data,"expectedType")&&a.push(d.data.expectedType)}return new i("Invalid "+o+" `"+r+"` supplied to `"+l+"`"+(a.length>0?", expected one of type ["+a.join(", ")+"]":"")+".")})},shape:function(e){return r(function(t,n,l,o,r){var a=t[n],d=s(a);if("object"!==d)return new i("Invalid "+o+" `"+r+"` of type `"+d+"` supplied to `"+l+"`, expected `object`.");for(var p in e){var v=e[p];if("function"!=typeof v)return u(l,o,r,p,c(v));var m=v(a,p,l,o,r+"."+p,ne);if(m)return m}return null})},exact:function(e){return r(function(t,n,l,o,r){var a=t[n],d=s(a);if("object"!==d)return new i("Invalid "+o+" `"+r+"` of type `"+d+"` supplied to `"+l+"`, expected `object`.");var p=te({},t[n],e);for(var v in p){var m=e[v];if(le(e,v)&&"function"!=typeof m)return u(l,o,r,v,c(m));if(!m)return new i("Invalid "+o+" `"+r+"` key `"+v+"` supplied to `"+l+"`.\nBad object: "+JSON.stringify(t[n],null," ")+"\nValid keys: "+JSON.stringify(Object.keys(e),null," "));var f=m(a,v,l,o,r+"."+v,ne);if(f)return f}return null})}};function o(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}function i(e,t){this.message=e,this.data=t&&"object"==typeof t?t:{},this.stack=""}function r(e){function t(t,n,l,o,r,a,u){if(o=o||"<<anonymous>>",a=a||l,u!==ne){var d=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw d.name="Invariant Violation",d}return null==n[l]?t?new i(null===n[l]?"The "+r+" `"+a+"` is marked as required in `"+o+"`, but its value is `null`.":"The "+r+" `"+a+"` is marked as required in `"+o+"`, but its value is `undefined`."):null:e(n,l,o,r,a)}process;var n=t.bind(null,!1);return n.isRequired=t.bind(null,!0),n}function a(e){return r(function(t,n,l,o,r,a){var u=t[n];return s(u)!==e?new i("Invalid "+o+" `"+r+"` of type `"+c(u)+"` supplied to `"+l+"`, expected `"+e+"`.",{expectedType:e}):null})}function u(e,t,n,l,o){return new i((e||"React class")+": "+t+" type `"+n+"."+l+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+o+"`.")}function d(t){switch(typeof t){case"number":case"string":case"undefined":return!0;case"boolean":return!t;case"object":if(Array.isArray(t))return t.every(d);if(null===t||e(t))return!0;var l=function(e){var t=e&&(n&&e[n]||e["@@iterator"]);if("function"==typeof t)return t}(t);if(!l)return!1;var o,i=l.call(t);if(l!==t.entries){for(;!(o=i.next()).done;)if(!d(o.value))return!1}else for(;!(o=i.next()).done;){var r=o.value;if(r&&!d(r[1]))return!1}return!0;default:return!1}}function s(e){var t=typeof e;return Array.isArray(e)?"array":e instanceof RegExp?"object":function(e,t){return"symbol"===e||!!t&&("Symbol"===t["@@toStringTag"]||"function"==typeof Symbol&&t instanceof Symbol)}(t,e)?"symbol":t}function c(e){if(null==e)return""+e;var t=s(e);if("object"===t){if(e instanceof Date)return"date";if(e instanceof RegExp)return"regexp"}return t}function p(e){var t=c(e);switch(t){case"array":case"object":return"an "+t;case"boolean":case"date":case"regexp":return"a "+t;default:return t}}return i.prototype=Error.prototype,l.checkPropTypes=de,l.resetWarningCache=de.resetWarningCache,l.PropTypes=l,l}(Z.isElement):function(){function e(e,t,n,l,o,i){if(i!==ne){var r=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw r.name="Invariant Violation",r}}function t(){return e}e.isRequired=e;var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:ve,resetWarningCache:pe};return n.PropTypes=n,n}()});const fe={description:"PT_SEARCH_OR_DESC",descriptionStyles:{fontWeight:"300",color:"#505A5F",marginTop:"0px",textAlign:"center",marginBottom:"20px",maxWidth:"540px"}},Ee=e=>{var i,a,u,d,s,c,v;let{config:m,onSelect:f,redirectToUrl:E}=e;const{t:y}=o.useTranslation(),_=r.useHistory(),{action:g=0}=Digit.Hooks.useQueryParams(),[h,S]=n.useState({}),[b,T]=n.useState(null);sessionStorage.setItem("VisitedCommonPTSearch",!0),sessionStorage.setItem("VisitedLightCreate",!1);let C=null===(i=Digit.Hooks.pt.useTenants())||void 0===i?void 0:i.sort((e,t)=>{var n,l;return null==e||null===(n=e.i18nKey)||void 0===n||null===(l=n.localeCompare)||void 0===l?void 0:l.call(n,null==t?void 0:t.i18nKey)});C=C||(null===(a=Digit.Hooks.tl.useTenants())||void 0===a?void 0:a.sort((e,t)=>{var n,l;return null==e||null===(n=e.i18nKey)||void 0===n||null===(l=n.localeCompare)||void 0===l?void 0:l.call(n,null==t?void 0:t.i18nKey)})),window.location.href.includes("obps")?C=Digit.SessionStorage.get("OBPS_TENANTS"):window.location.href.includes("fsm")&&(C=[{i18nKey:"TENANT_TENANTS_PG_CITYA",code:Digit.ULBService.getCurrentTenantId(),name:"City A",description:"City A",pincode:[143001,143002,143003,143004,143005],logoId:"https://in-egov-assets.s3.ap-south-1.amazonaws.com/in.citya/logo.png",imageId:null,domainUrl:"https://www.upyog.niua.org",type:"CITY",twitterUrl:null,facebookUrl:null,emailId:"citya@gmail.com",OfficeTimings:{"Mon - Fri":"9.00 AM - 6.00 PM"},city:{name:"City A",localName:null,districtCode:"CITYA",districtName:null,districtTenantCode:Digit.ULBService.getCurrentTenantId(),regionName:null,ulbGrade:"Municipal Corporation",longitude:75.5761829,latitude:31.3260152,shapeFileLocation:null,captcha:null,code:"1013",ddrName:"DDR A"},address:"City A Municipal Corporation",contactNumber:"001-2345876"},{i18nKey:"TENANT_TENANTS_PG_CITYB",code:"pg.cityb",name:"City B",description:null,pincode:[143006,143007,143008,143009,143010],logoId:"https://in-egov-assets.s3.ap-south-1.amazonaws.com/in.citya/logo.png",imageId:null,domainUrl:"https://www.upyog.niua.org",type:"CITY",twitterUrl:null,facebookUrl:null,emailId:"cityb@gmail.com",OfficeTimings:{"Mon - Fri":"9.00 AM - 6.00 PM",Sat:"9.00 AM - 12.00 PM"},city:{name:"City B",localName:null,districtCode:"CITYB",districtName:null,districtTenantCode:"pg.cityb",regionName:null,ulbGrade:"Municipal Corporation",longitude:74.8722642,latitude:31.6339793,shapeFileLocation:null,captcha:null,code:"107",ddrName:"DDR B"},address:"City B Municipal Corporation Address",contactNumber:"0978-7645345",helpLineNumber:"0654-8734567"},{i18nKey:"TENANT_TENANTS_PG_CITYC",code:"pg.cityc",name:"City C",description:null,logoId:"https://in-egov-assets.s3.ap-south-1.amazonaws.com/in.citya/logo.png",imageId:null,domainUrl:"https://www.upyog.niua.org",type:"CITY",twitterUrl:null,facebookUrl:null,emailId:"cityc@gmail.com",OfficeTimings:{"Mon - Fri":"9.00 AM - 6.00 PM",Sat:"9.00 AM - 12.00 PM"},city:{name:"City C",localName:null,districtCode:"CITYC",districtName:null,districtTenantCode:"pg.cityc",regionName:null,ulbGrade:"Municipal Corporation",longitude:73.8722642,latitude:31.6339793,shapeFileLocation:null,captcha:null,code:"108",ddrName:"DDR C"},address:"City C Municipal Corporation Address",contactNumber:"0978-7645345",helpLineNumber:"0654-8734567"}]),console.log("allCities",C);const[A,I]=n.useState(),[P,O]=n.useState(),[D,w]=n.useState(!1);let R=window.Digit.Utils.browser.isMobile();const{data:L,isLoading:x,error:M}=Digit.Hooks.pt.usePropertySearchWithDue({tenantId:null==h?void 0:h.city,filters:null==h?void 0:h.filters,auth:!0,configs:{enabled:Object.keys(h).length>0,retry:!1,retryOnMount:!1,staleTime:Infinity}});n.useEffect(()=>{var e,t,n;(null==h||null===(e=h.filters)||void 0===e||!e.mobileNumber||1!=(null===(t=Object.values(null==h?void 0:h.filters))||void 0===t||null===(n=t.filter(e=>void 0!==e))||void 0===n?void 0:n.length))&&(null==L?void 0:L.Properties.length)>0&&null!=F&&F.maxResultValidation&&(null==L?void 0:L.Properties.length)>(null==F?void 0:F.maxPropertyResult)&&!D&&T({error:!0,warning:!0,label:"ERR_PLEASE_REFINED_UR_SEARCH"})},[L]),n.useEffect(()=>{b&&"ERR_PLEASE_REFINED_UR_SEARCH"!==(null==b?void 0:b.label)&&"NO_PROPERTIES_FOUND"!==(null==b?void 0:b.label)&&T(null)},[g,x]),n.useEffect(()=>{var e;!x&&L&&h&&(null==L||null===(e=L.Properties)||void 0===e?void 0:e.length)<=0&&T({error:!0,warning:!0,label:"NO_PROPERTIES_FOUND"})},[null==L||null===(u=L.Properties)||void 0===u||null===(d=u[0])||void 0===d?void 0:d.propertyId,x]),n.useLayoutEffect(()=>{const e=()=>{let t=document.querySelector("div.action-bar-wrap");t?(t.style.position="static",t.style.padding="8px 0",t.style.boxShadow="none",t.style.marginBottom="16px",t.style.textAlign="left",t.style.zIndex="0"):setTimeout(()=>{e()},100)};e()},[]);const{data:F,isLoading:k}=Digit.Hooks.pt.useMDMS(Digit.ULBService.getStateId(),"DIGIT-UI","HelpText",{select:e=>{var t,n,l;return null==e||null===(t=e["DIGIT-UI"])||void 0===t||null===(n=t.HelpText)||void 0===n||null===(l=n[0])||void 0===l?void 0:l.PT}}),[B,U,j,H,W]=m.inputs,V=[{body:[{type:"custom",populators:{name:"addParam",defaultValue:{code:0,name:y("PT_KNOW_PTID")},customProps:{t:y,isMandatory:!0,optionsKey:"name",options:[{code:0,name:y("PT_KNOW_PTID")},{code:1,name:y("PT_SEARCH_DOOR_NO")}]},component:(e,n)=>l.createElement(t.RadioButtons,N({},n,{selectedOption:e.value,onSelect:t=>{null==e||e.setValue("city",{}),null==e||e.setValue("locality",{}),null==e||e.setValue("mobileNumber",""),null==e||e.setValue("propertyIds",""),null==e||e.setValue("doorNumber",""),null==e||e.setValue("oldPropertyId",""),null==e||e.setValue("name",""),_.replace(`${_.location.pathname}?action=${0==g?1:0}`)}}))}},{label:"PT_SELECT_CITY",isMandatory:!0,type:"custom",populators:{name:"city",defaultValue:null,rules:{required:!0},customProps:{t:y,isMandatory:!0,option:[...C],optionKey:"i18nKey"},component:(e,n)=>l.createElement(t.Dropdown,N({},n,{selected:e.value,select:t=>{Digit.ULBService.getCurrentTenantId(),t.code!==A&&e.setValue("locality",null),e.onChange(t)}}))}},{label:y("PT_PROVIDE_ONE_MORE_PARAM"),isInsideBox:!0,placementinbox:0,isSectionText:!0},{label:B.label,type:B.type,populators:{defaultValue:"",name:B.name,validation:null==B?void 0:B.validation},...fe,isMandatory:!1,isInsideBox:!0,placementinbox:1},{label:"",labelChildren:l.createElement("div",{className:"tooltip"},l.createElement("div",{style:{display:"flex",gap:"0 4px"}},l.createElement("h2",null,y(U.label)),l.createElement(t.InfoBannerIcon,{fill:"#0b0c0c"}),l.createElement("span",{className:"tooltiptext",style:{position:"absolute",width:"72%",marginLeft:"50%",fontSize:"medium"}},y(U.description)+" PG-PT-xxxx-xxxxxx"))),type:U.type,populators:{name:U.name,defaultValue:"",validation:null==U?void 0:U.validation},...fe,isMandatory:!1,isInsideBox:!0,placementinbox:1},{label:j.label,type:j.type,populators:{name:j.name,defaultValue:"",validation:null==j?void 0:j.validation},isMandatory:!1,isInsideBox:!0,placementinbox:2}],body1:[{type:"custom",populators:{name:"addParam1",defaultValue:{code:1,name:y("PT_SEARCH_DOOR_NO")},customProps:{t:y,isMandatory:!0,optionsKey:"name",options:[{code:0,name:y("PT_KNOW_PTID")},{code:1,name:y("PT_SEARCH_DOOR_NO")}]},component:(e,n)=>l.createElement(t.RadioButtons,N({},n,{selectedOption:e.value,onSelect:t=>{null==e||e.setValue("city",{}),null==e||e.setValue("locality",{}),null==e||e.setValue("mobileNumber",""),null==e||e.setValue("propertyIds",""),null==e||e.setValue("doorNumber",""),null==e||e.setValue("oldPropertyId",""),null==e||e.setValue("name",""),_.replace(`${_.location.pathname}?action=${0==g?1:0}`)}}))}},{label:"PT_SELECT_CITY",isMandatory:!0,type:"custom",populators:{name:"city",defaultValue:null,rules:{required:!0},customProps:{t:y,isMandatory:!0,option:[...C],optionKey:"i18nKey"},component:(e,n)=>l.createElement(t.Dropdown,N({},n,{selected:e.value,select:t=>{var n,l;Digit.LocalizationService.getLocale({modules:["rainmaker-"+(null==e||null===(n=e.value)||void 0===n?void 0:n.code)],locale:Digit.StoreData.getCurrentLanguage(),tenantId:""+(null==e||null===(l=e.value)||void 0===l?void 0:l.code)}),t.code!==A&&e.setValue("locality",null),e.onChange(t)}}))}},{label:"PT_SELECT_LOCALITY",type:"custom",isMandatory:!0,populators:{name:"locality",defaultValue:"",rules:{required:!0},customProps:{},component:(e,n)=>l.createElement(t.Localities,{selectLocality:t=>{e.onChange(t)},tenantId:A,boundaryType:"revenue",keepNull:!1,optionCardStyles:{height:"600px",overflow:"auto",zIndex:"10",maxHeight:"300px"},selected:null==P?void 0:P.locality,disable:!A,disableLoader:!0})}},{label:y("PT_PROVIDE_ONE_MORE_PARAM"),isInsideBox:!0,placementinbox:0,isSectionText:!0},{label:W.label,type:W.type,populators:{defaultValue:"",name:W.name,validation:null==W?void 0:W.validation},isMandatory:!1,isInsideBox:!0,placementinbox:1},{label:H.label,type:H.type,populators:{defaultValue:"",name:H.name,validation:null==H?void 0:H.validation},isMandatory:!1,isInsideBox:!0,placementinbox:2}]}];if(k)return l.createElement(t.Loader,null);let $=!(null!=F&&F.maxResultValidation&&(null==h||null===(s=h.filters)||void 0===s||!s.mobileNumber||1!=(null===(c=Object.values(null==h?void 0:h.filters))||void 0===c||null===(v=c.filter(e=>void 0!==e))||void 0===v?void 0:v.length)))||(null==L?void 0:L.Properties.length)<(null==F?void 0:F.maxPropertyResult)&&(null==b||null!==b&&!(null!=b&&b.error));if(L&&!x&&!M&&$){var z,Y,K,q,G;let e={};if(e={...h.filters,city:h.city},(null==h||null===(z=h.filters)||void 0===z||!z.mobileNumber||1!=(null===(Y=Object.values(null==h?void 0:h.filters))||void 0===Y||null===(K=Y.filter(e=>void 0!==e))||void 0===K?void 0:K.length))&&null!=F&&F.ptSearchCount&&null!=h&&null!==(q=h.filters)&&void 0!==q&&q.locality&&x&&null!=x&&null!==(G=x.Properties)&&void 0!==G&&G.length&&x.Properties.length>(null==F?void 0:F.ptSearchCount))!b&&T({error:!0,label:"PT_MODIFY_SEARCH_CRITERIA"});else if("MUTATION"===m.action)f(m.key,e,null,null,null,{queryParams:{...e}});else if(E||window.location.href.includes("digit-ui/citizen/commonpt/property/citizen-search"))_.push(`/digit-ui/citizen/commonPt/property/search-results?${Object.keys(e).map(t=>`${t}=${e[t]}`).join("&")}${E?"&redirectToUrl="+E:""}`);else{var Z,X,J,Q,ee,te,ne,le,oe,ie;let t={};t=0==g?{city:null===(Z=e)||void 0===Z?void 0:Z.city,mobileNumber:(null===(X=e)||void 0===X?void 0:X.mobileNumber)||"",propertyIds:(null===(J=e)||void 0===J?void 0:J.propertyIds)||"",oldPropertyIds:(null===(Q=e)||void 0===Q?void 0:Q.oldPropertyIds)||"",locality:"",doorNo:"",name:""}:{city:null===(ee=e)||void 0===ee?void 0:ee.city,locality:(null===(te=e)||void 0===te?void 0:te.locality)||"",doorNo:(null===(ne=e)||void 0===ne?void 0:ne.doorNumber)||(null===(le=e)||void 0===le?void 0:le.doorNo)||"",name:(null===(oe=e)||void 0===oe?void 0:oe.name)||"",mobileNumber:"",propertyIds:"",oldPropertyIds:""},!x&&(null==L||null===(ie=L.Properties)||void 0===ie?void 0:ie.length)>0&&f("cptSearchQuery",t,null,null,null,{queryParams:{...t}})}}var re,ae,ue,de;return M&&!b&&T({error:!0,label:(null==M||null===(re=M.response)||void 0===re||null===(ae=re.data)||void 0===ae||null===(ue=ae.Errors)||void 0===ue||null===(de=ue[0])||void 0===de?void 0:de.code)||M}),1==g&&(V[0].body=[...V[0].body1]),l.createElement("div",{style:{marginTop:"16px",marginBottom:"16px",backgroundColor:"white",maxWidth:"960px"}},l.createElement(t.FormComposer,{onSubmit:function(e){try{var t,n;if(null!=F&&F.maxResultValidation&&(null==L?void 0:L.Properties.length)>0&&(null==L?void 0:L.Properties.length)>(null==F?void 0:F.maxPropertyResult)&&D)return w(!0),Promise.resolve();if(null==e||null===(t=e.city)||void 0===t||!t.code)return T({error:!0,label:"ERR_PT_FILL_VALID_FIELDS"}),Promise.resolve();if(0==g){var l,o,i,r,a,u,d,s,c,p,v,m,f,E,y;if(!(null!=e&&e.mobileNumber||null!=e&&e.propertyIds||null!=e&&e.oldPropertyId))return T({error:!0,label:"ERR_PT_FILL_VALID_FIELDS"}),Promise.resolve();if(null!=e&&e.mobileNumber&&(null===(l=e.mobileNumber)||void 0===l||!l.match(null==B||null===(o=B.validation)||void 0===o||null===(i=o.pattern)||void 0===i?void 0:i.value)))return T({error:!0,label:null==B||null===(p=B.validation)||void 0===p||null===(v=p.pattern)||void 0===v?void 0:v.message}),Promise.resolve();if(null!=e&&e.propertyIds&&(null===(r=e.propertyIds)||void 0===r||!r.match(null==U||null===(a=U.validation)||void 0===a||null===(u=a.pattern)||void 0===u?void 0:u.value)))return T({error:!0,label:null==U||null===(m=U.validation)||void 0===m||null===(f=m.pattern)||void 0===f?void 0:f.message}),Promise.resolve();if(null!=e&&e.oldPropertyId&&(null===(d=e.oldPropertyId)||void 0===d||!d.match(null==j||null===(s=j.validation)||void 0===s||null===(c=s.pattern)||void 0===c?void 0:c.value)))return T({error:!0,label:null==j||null===(E=j.validation)||void 0===E||null===(y=E.pattern)||void 0===y?void 0:y.message}),Promise.resolve()}else{var _,h,C,A,N,I,P,O,R,x,M;if(null==e||null===(_=e.locality)||void 0===_||!_.code)return T({error:!0,label:"ERR_PT_FILL_VALID_FIELDS"}),Promise.resolve();if(!(null!=e&&e.doorNumber||null!=e&&e.name))return T({error:!0,label:"ERR_PT_FILL_VALID_FIELDS"}),Promise.resolve();if(null!=e&&e.name&&(null===(h=e.name)||void 0===h||!h.match(null==H||null===(C=H.validation)||void 0===C||null===(A=C.pattern)||void 0===A?void 0:A.value)))return T({error:!0,label:null==H||null===(O=H.validation)||void 0===O||null===(R=O.pattern)||void 0===R?void 0:R.message}),Promise.resolve();if(null!=e&&e.doorNumber&&(null===(N=e.doorNumber)||void 0===N||!N.match(null==W||null===(I=W.validation)||void 0===I||null===(P=I.pattern)||void 0===P?void 0:P.value)))return T({error:!0,label:null==W||null===(x=W.validation)||void 0===x||null===(M=x.pattern)||void 0===M?void 0:M.message}),Promise.resolve()}"ERR_PLEASE_REFINED_UR_SEARCH"===(null==b?void 0:b.label)&&"NO_PROPERTIES_FOUND"===(null==b?void 0:b.label)||T(null),null!=e&&e.doorNumber&&""!==(null==e?void 0:e.doorNumber)&&""!==(null==e?void 0:e.propertyIds)&&(e.propertyIds="");let G=Object.keys(e).filter(t=>e[t]).reduce((t,n)=>({...t,[n]:"object"==typeof e[n]?e[n].code:e[n]}),{}),Z=G.city;var k,V,$;if(G.doorNo=G.doorNumber||(null===(n=G)||void 0===n?void 0:n.doorNo),delete G.addParam,delete G.addParam1,delete G.city,"0"===g)G={oldPropertyId:null===(k=G)||void 0===k?void 0:k.oldPropertyId,mobileNumber:null===(V=G)||void 0===V?void 0:V.mobileNumber,propertyIds:null===($=G)||void 0===$?void 0:$.propertyIds};else if("1"===g){var z,Y,K,q;G={name:null===(z=G)||void 0===z?void 0:z.name,doorNo:(null===(Y=G)||void 0===Y?void 0:Y.doorNumber)||(null===(K=G)||void 0===K?void 0:K.doorNo),locality:null===(q=G)||void 0===q?void 0:q.locality}}return S({city:Z,filters:G}),Promise.resolve()}catch(e){return Promise.reject(e)}},noBoxShadow:!0,inline:!0,config:V,label:m.texts.submitButtonLabel,heading:y(m.texts.header),text:y(m.texts.text),headingStyle:{fontSize:"32px",marginBottom:"16px",fontFamily:"Roboto Condensed,sans-serif"},onFormValueChange:(e,t,n)=>{const l=(null==t?void 0:t.city)||C[0];console.log("citycity",l),I(l.code),(null==l?void 0:l.code)!==A&&I(null==l?void 0:l.code),p.isEqual(t,P)||O(t)},cardStyle:{marginBottom:"0",maxWidth:"960px"}}),l.createElement("div",{style:{display:"flex"}},window.location.href.includes("/obps/bpa/")?l.createElement("span",{className:"link",style:R?{display:"flex",justifyContent:"center",paddingBottom:"16px"}:{display:"flex",justifyContent:"left",paddingBottom:"16px",marginLeft:"45px"}},l.createElement(r.Link,{to:"/digit-ui/citizen/obps/bpa/building_plan_scrutiny/new_construction/location"},y("CORE_COMMON_SKIP_CONTINUE"))):l.createElement("span",{className:"link",style:R?{display:"flex",justifyContent:"center",paddingBottom:"16px"}:{display:"flex",justifyContent:"left",paddingBottom:"16px",marginLeft:"45px"}},l.createElement(r.Link,{to:window.location.href.includes("/ws/")?"/digit-ui/citizen/ws/create-application/create-property":window.location.href.includes("/tl/tradelicence/")?"/digit-ui/citizen/tl/tradelicence/new-application/create-property":window.location.href.includes("/fsm/")?"/digit-ui/citizen/fsm/new-application/create-property":"/digit-ui/citizen/commonpt/property/new-application"},y("CPT_REG_NEW_PROPERTY")))),b&&l.createElement(t.Toast,{isDleteBtn:!0,error:b.error,warning:b.warning,label:y(b.label),onClose:()=>{T(null)}}))};Ee.propTypes={loginParams:me.any},Ee.defaultProps={loginParams:null};const ye=e=>{let{onSelect:t}=e;const{t:i}=o.useTranslation(),{path:a}=r.useRouteMatch(),u=r.useLocation().search,d=new URLSearchParams(u).get("redirectToUrl"),s=n.useMemo(()=>A.map(e=>{const t={};for(const n in e.texts)t[n]=i(e.texts[n]);return{...e,texts:t}},[A]));return l.createElement(r.Switch,null,l.createElement(r.Route,{path:""+a,exact:!0},l.createElement(Ee,{config:s[0],onSelect:t,redirectToUrl:d})))},_e=[{texts:{header:"CS_SEARCH_RESULTS",actionButtonLabel:"PT_COMMONS_SELECT_PLACEHOLDER"},labels:[{label:"PT_DUES_ARE_PENDING",key:"total_due",noteStyle:{fontSize:"24px",fontWeight:"bold"},notePrefix:"₹ "},{label:"TL_PROPERTY_ID",key:"property_id"},{label:"PT_OWNERS_NAME",key:"owner_name"},{label:"PT_COMMON_COL_ADDRESS",key:"property_address"},{label:"PT_COMMON_TABLE_COL_STATUS_LABEL",key:"status"}]}];function ge(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 he={type:"login"},Se=e=>{var i,a,u,d,s,c,v;let{template:m,header:f,actionButtonLabel:E,onSelect:y,clearParams:_=(()=>{}),stateCode:g,redirectToUrl:h,searchQuery:S}=e;const{t:b}=o.useTranslation(),T=n.useRef(),{mobileNumber:C,propertyIds:A,oldPropertyIds:N,locality:I,city:P,doorNo:O,name:D,PToffset:w}=Digit.Hooks.useQueryParams(),R={},[L,x]=n.useState(!1),M=Digit.ComponentRegistryService.getComponent("WSInfoLabel");let F,k,B=w;isNaN(parseInt(B))?F=5:(k=B,F=parseInt(B)+5);let U=isNaN(parseInt(B))?{limit:"5",sortOrder:"ASC",sortBy:"createdTime",offset:"0"}:{limit:"5",sortOrder:"ASC",sortBy:"createdTime",offset:k};Digit.Hooks.useClickOutside(T,()=>{x(!1)},L),(C||S&&S.mobileNumber)&&(R.mobileNumber=C||(null==S?void 0:S.mobileNumber)),(A||S&&S.propertyIds)&&(R.propertyIds=A||(null==S?void 0:S.propertyIds)),(N||S&&S.oldPropertyIds)&&(R.oldPropertyIds=N||(null==S?void 0:S.oldPropertyIds)),(I||S&&S.locality)&&(R.locality=I||(null==S?void 0:S.locality)),(O||S&&S.doorNo)&&(R.doorNo=O||(null==S?void 0:S.doorNo)),(D||S&&S.name)&&(R.name=D||(null==S?void 0:S.name)),(I||S&&S.locality)&&(R.limit=U.limit,R.sortOrder=U.sortOrder,R.sortBy=U.sortBy,R.offset=U.offset);const[j,H,W]=Digit.Hooks.useSessionStorage("PT_MUTATE_MULTIPLE_OWNERS",null),[V,$,z]=Digit.Hooks.useSessionStorage("PT_MUTATE_MULTIPLE_OWNERS_LAST_PATH",null),Y=(r.useRouteMatch(),Digit.Hooks.useQueryParams());n.useEffect(()=>{H([]),_(),$("")},[]);const K=Digit.ULBService.getCurrentTenantId(),q=P||(null==S?void 0:S.city),G=Digit.Hooks.pt.usePropertySearch(q?{tenantId:q,filters:R,auth:!0}:{filters:R,auth:!0},{privacy:Digit.Utils.getPrivacyObject()}),Z=null==G||null===(i=G.data)||void 0===i||null===(a=i.Properties)||void 0===a?void 0:a.map(e=>e.propertyId).join(",");console.log("result",G);const X=Digit.Hooks.useFetchBillsForBuissnessService({businessService:"PT",...C?{mobileNumber:C,consumerCode:Z}:{consumerCode:Z},tenantId:q},{enabled:!!Z,retry:!1}),J=r.useHistory();if(X.isLoading||G.isLoading)return l.createElement(t.Loader,null);if(G.error||!Z)return l.createElement("div",{style:{height:"150px"}},l.createElement(t.Card,{style:{display:"flex",justifyContent:"center",alignItems:"center",height:"100%"}},b("CS_PT_NO_PROPERTIES_FOUND")));const Q={};null==X||null===(u=X.data)||void 0===u||null===(d=u.Bill)||void 0===d||d.forEach(e=>{null!=e&&e.consumerCode&&(Q[null==e?void 0:e.consumerCode]={total_due:null==e?void 0:e.totalAmount,bil_due__date:new Date(null==e?void 0:e.billDate).toDateString()})});const ee=null==G||null===(s=G.data)||void 0===s||null===(c=s.Properties)||void 0===c?void 0:c.filter(e=>"ACTIVE"===e.status);console.log("arrarr",ee);const te=null==ee?void 0:ee.map(e=>{var t,n,l,o,i,r,a,u;let d=(null==e?void 0:e.address)||{};return{property_id:null==e?void 0:e.propertyId,owner_name:null===(t=((null==e?void 0:e.owners)||[]).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)}))||void 0===t||null===(n=t[0])||void 0===n?void 0:n.name,property_address:[d.doorNo||"",d.buildingName||"",d.street||"",b("TENANTS_MOHALLA_"+(null===(l=d.locality)||void 0===l?void 0:l.code))||"",b(d.tenantId)||""].filter(e=>e).join(", "),total_due:(null===(o=Q[null==e?void 0:e.propertyId])||void 0===o?void 0:o.total_due)||0,bil_due__date:(null===(i=Q[null==e?void 0:e.propertyId])||void 0===i?void 0:i.bil_due__date)||b("N/A"),status:b(e.status),owner_mobile:null===(r=((null==e?void 0:e.owners)||[])[0])||void 0===r?void 0:r.mobileNumber,address:null==e?void 0:e.address,owners:e.owners,propertyDetails:e,privacy:{property_address:{uuid:null==e||null===(a=e.owners)||void 0===a||null===(u=a[0])||void 0===u?void 0:u.uuid,fieldName:["doorNo","street","landmark"],model:"Property",showValue:!0,loadData:{serviceName:"/property-services/property/_search",requestBody:{},requestParam:{tenantId:null==e?void 0:e.tenantId,propertyIds:null==e?void 0:e.propertyId},jsonPath:"Properties[0].address.street",isArray:!1,d:e=>(p.get(e,"Properties[0].address.doorNo")?p.get(e,"Properties[0].address.doorNo")+", ":"")+(p.get(e,"Properties[0].address.street")?p.get(e,"Properties[0].address.street")+", ":"")+(p.get(e,"Properties[0].address.landmark")?""+p.get(e,"Properties[0].address.landmark"):"")}}}}}),ne=(e,t)=>(null==e?void 0:e.from)||(null==t?void 0:t.from)||"/digit-ui/citizen";return l.createElement("div",{className:"static",style:{marginTop:"16px"}},l.createElement("div",{className:"static-wrapper"},f&&l.createElement(t.Header,{style:{marginLeft:"8px"}},b(f)," (",null==te?void 0:te.length,")"),l.createElement(M,{t:b}),l.createElement(t.ResponseComposer,{data:te,template:m,actionButtonLabel:E,onSubmit:function(e){try{return sessionStorage.setItem("Digit_OBPS_PT",JSON.stringify(e)),sessionStorage.setItem("Digit_FSM_PT",JSON.stringify(e)),Promise.resolve(function(){if(!y){const t={mobileNumber:null==e?void 0:e.owner_mobile,tenantId:g,userType:Digit.UserService.getType()};return Promise.resolve(function(e){return Promise.resolve(ge(function(){return Promise.resolve(Digit.UserService.sendOtp(e,g)).then(function(e){return[e,null]})},function(e){return[null,e]}))}({otp:{...t,...he}})).then(function(n){let[l,o]=n;if(o)J.push("/digit-ui/citizen/",{from:ne(location.state,Y),data:t});else{let t="/digit-ui/citizen/commonPt/property/link-success/"+e.property_id;h&&(t=h+"?propertyId="+e.property_id+"&tenantId="+K),J.replace("/digit-ui/citizen/commonPt/property/citizen-otp",{from:ne(location.state,Y),mobileNumber:e.owner_mobile,redirectBackTo:t})}})}y("cptId",{id:e.property_id})}())}catch(e){return Promise.reject(e)}}})),L?l.createElement(t.Modal,{hideSubmit:!0,isDisabled:!1,popupStyles:{width:"319px",height:"250px",margin:"auto"},formId:"modal-action"},l.createElement("div",{ref:T},l.createElement(t.KeyNote,{keyValue:b("PT_AMOUNT_DUE"),note:"₹ "+(null==L||null===(v=L.total_due)||void 0===v?void 0:v.toLocaleString("en-IN")),noteStyle:{fontSize:"24px",fontWeight:"bold"}}),l.createElement("p",null,b("PT_YOU_HAVE")+" ₹ "+(null==L?void 0:L.total_due.toLocaleString("en-IN"))+" "+b("PT_PENDING_AMOUNT")+" "+b("PT_INORDER_TO_TRANSFER")),l.createElement(t.SubmitBar,{submit:!1,onSubmit:()=>{J.push("/digit-ui/citizen/payment/my-bills/PT/"+L.property_id,{tenantId:K})},style:{marginTop:"14px",width:"100%"},label:b("PT_PROCEED_PAYMENT")}))):null,!(null!=te&&te.length)>0&&l.createElement("p",{style:{marginLeft:"16px",marginTop:"16px"}},b("PT_NO_PROP_FOUND_MSG")),0!==(null==te?void 0:te.length)&&(5==(null==te?void 0:te.length)||50==(null==te?void 0:te.length))&&(I||S&&S.locality)&&l.createElement("div",null,l.createElement("p",{style:{marginLeft:"16px",marginTop:"16px"}},b("PT_LOAD_MORE_MSG")," ",l.createElement("span",{className:"link"},l.createElement(r.Link,{to:`/digit-ui/citizen/pt/property/search-results?mobileNumber=${C||S.mobileNumber?C||(null==S?void 0:S.mobileNumber):""}&propertyIds=${A||null!=S&&S.propertyIds?A||(null==S?void 0:S.propertyIds):""}&oldPropertyIds=${N||null!=S&&S.oldPropertyIds?N||(null==S?void 0:S.oldPropertyIds):""}&doorNo=${O||null!=S&&S.doorNo?O||(null==S?void 0:S.doorNo):""}&name=${D||null!=S&&S.name?D||(null==S?void 0:S.name):""}&city=${P||""}&locality=${I||null!=S&&S.locality?I||(null==S?void 0:S.locality):""}&PToffset=${F}`},b("PT_COMMON_CLICK_HERE"))))))};Se.propTypes={template:me.any,header:me.string,actionButtonLabel:me.string},Se.defaultProps={template:[],header:null,actionButtonLabel:null};const be=[{texts:{header:"CS_LOGIN_PROVIDE_MOBILE_NUMBER",cardText:"CS_LOGIN_TEXT",nextText:"CS_COMMONS_NEXT",submitBarLabel:"CS_COMMONS_NEXT"},inputs:[{label:"CORE_COMMON_MOBILE_NUMBER",type:"text",name:"mobileNumber",error:"ERR_HRMS_INVALID_MOB_NO",validation:{required:!0,minLength:10,maxLength:10}}]},{texts:{header:"CS_LOGIN_OTP",cardText:"CS_LOGIN_OTP_TEXT",nextText:"CS_COMMONS_NEXT",submitBarLabel:"CS_COMMONS_NEXT"}},{texts:{header:"CS_LOGIN_PROVIDE_NAME",cardText:"CS_LOGIN_NAME_TEXT",nextText:"CS_COMMONS_NEXT",submitBarLabel:"CS_COMMONS_NEXT"},inputs:[{label:"CORE_COMMON_NAME",type:"text",name:"name",error:"CORE_COMMON_NAME_VALIDMSG",validation:{required:!0,minLength:1,pattern:/^[^{0-9}^\$\"<>?\\\\~!@#$%^()+={}\[\]*,/_:;“”‘’]{1,50}$/i}}]}],Te=e=>{const{config:t,onSelect:i,clearParams:a,formData:u,stateCode:d}=e,{t:s}=o.useTranslation(),{path:c}=r.useRouteMatch(),p=r.useLocation().search,v=new URLSearchParams(p).get("redirectToUrl");let m=_e;const f=n.useMemo(()=>{var e;return null==m||null===(e=m.map)||void 0===e?void 0:e.call(m,e=>{const t={};for(const n in e.texts)t[n]=s(e.texts[n]);return{...e,texts:t}})},[m]);return l.createElement(r.Switch,null,l.createElement(r.Route,{path:""+c,exact:!0},l.createElement(Se,{template:f[0].labels,header:f[0].texts.header,actionButtonLabel:f[0].texts.actionButtonLabel,t:s,isMutation:"MUTATION"===(null==t?void 0:t.action),onSelect:i,config:t,clearParams:a,stateCode:d,redirectToUrl:v,searchQuery:null==u?void 0:u.cptSearchQuery})))},Ce=e=>{let{onSelect:i}=e;const{t:a}=o.useTranslation(),{propertyIds:u}=r.useParams(),d=r.useHistory(),{data:s}=Digit.Hooks.pt.usePropertySearch({filters:{propertyIds:u}},{filters:{propertyIds:u}}),[c,p]=n.useState(()=>(null==s?void 0:s.Properties[0])||" ");return n.useEffect(()=>{s&&p(null==s?void 0:s.Properties[0])},[s]),l.createElement(l.Fragment,null,l.createElement(t.Header,null,a("PT_PROPERTY_DETAILS")),l.createElement("div",null,l.createElement(t.Card,null,l.createElement(t.StatusTable,null,l.createElement(t.Row,{label:a("PT_PROPERTY_PTUID"),text:""+(c.propertyId||a("CS_NA")),textStyle:{whiteSpace:"pre"}})),l.createElement(t.SubmitBar,i?{submit:!1,label:a("CS_COMMONS_NEXT"),onSubmit:()=>{i&&i("propertyId",u)}}:{submit:!1,label:a("PT_PROPERTY_CREATE"),onSubmit:()=>d.push("/digit-ui/citizen/commonPt/property/new-application")}))))},Ae=e=>{let{config:o,otp:i,onOtpChange:r,onResend:a,onSelect:u,t:d,error:s,userType:c="citizen"}=e;const[p,v]=n.useState(30);!function(e,t){const l=n.useRef();n.useEffect(()=>{l.current=e},[e]),n.useEffect(()=>{if(null!==t){const e=setInterval(function(){l.current()},t);return()=>clearInterval(e)}},[t])}(()=>{v(p-1)},p>0?1e3:null);const m=()=>{a(),v(2)};return"employee"===c?l.createElement(n.Fragment,null,l.createElement(t.OTPInput,{length:6,onChange:r,value:i}),p>0?l.createElement(t.CardText,null,`${d("CS_RESEND_ANOTHER_OTP")} ${p} ${d("CS_RESEND_SECONDS")}`):l.createElement("p",{className:"card-text-button",onClick:m},d("CS_RESEND_OTP")),!s&&l.createElement(t.CardLabelError,null,d("CS_INVALID_OTP"))):l.createElement(t.FormStep,{onSelect:u,config:o,t:d,isDisabled:6!==(null==i?void 0:i.length)},l.createElement(t.OTPInput,{length:6,onChange:r,value:i}),p>0?l.createElement(t.CardText,null,`${d("CS_RESEND_ANOTHER_OTP")} ${p} ${d("CS_RESEND_SECONDS")}`):l.createElement("p",{className:"card-text-button",onClick:m},d("CS_RESEND_OTP")),!s&&l.createElement(t.CardLabelError,null,d("CS_INVALID_OTP")))},Ne=e=>{const{t:t}=o.useTranslation(),i=(r.useRouteMatch(),r.useLocation()),a=r.useHistory(),[u,d]=n.useState({mobileNumber:i.state.mobileNumber,otp:""}),[s,c]=n.useState(!0),p=()=>Digit.UserService.getType(),v=n.useMemo(()=>be.map(e=>{const n={};for(const l in e.texts)n[l]=t(e.texts[l]);return{...e,texts:n}},[be]));return l.createElement(Ae,{config:{...v[1],texts:{...v[1].texts,cardText:`${v[1].texts.cardText} ${u.mobileNumber||""}`}},onOtpChange:e=>{d({...u,otp:e})},onResend:function(){try{const{mobileNumber:t}=u,n={mobileNumber:t,tenantId:e.stateCode,userType:p()};return Promise.resolve(sendOtp({otp:{...n,...TYPE_LOGIN}})).then(function(){})}catch(e){return Promise.reject(e)}},onSelect:function(){try{const t=ge(function(){c(!0);const{mobileNumber:t,otp:n}=u,l={username:t,password:n,tenantId:e.stateCode,userType:p()};return Promise.resolve(Digit.UserService.authenticate(l)).then(function(e){var t;let{...n}=e;var l,o;null!==(t=i.state)&&void 0!==t&&t.redirectBackTo?a.replace(null===(l=i.state)||void 0===l?void 0:l.redirectBackTo,{data:null===(o=i.state)||void 0===o?void 0:o.redirectData}):a.replace("digit-ui/citizen/")})},function(){c(!1)});return Promise.resolve(t&&t.then?t.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},otp:u.otp,error:s,t:t})};function Ie(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 Pe=e=>l.createElement("h1",{className:"heading-m"},e.label),Oe=()=>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"})),De=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(Oe,null)),we=e=>{var o,i;let{t:r,action:a,tenantId:u,closeModal:d,submitAction:s,applicationData:c,businessService:p,moduleCode:v}=e;const{data:m,isLoading:f}=Digit.Hooks.useEmployeeSearch(u,{roles:null==a||null===(o=a.assigneeRoles)||void 0===o||null===(i=o.map)||void 0===i?void 0:i.call(o,e=>({code:e})),isActive:!0},{enabled:!(null!=a&&a.isTerminateState)}),{isLoading:E,data:y}=Digit.Hooks.pt.useMDMS(u,p,"FINANCIAL_YEARLS",{},{details:{tenantId:Digit.ULBService.getStateId(),moduleDetails:[{moduleName:"egf-master",masterDetails:[{name:"FinancialYear",filter:"[?(@.module == 'PT')]"}]}]}}),[_,g]=n.useState({}),[h,S]=n.useState({}),[b,T]=n.useState([]),[C,A]=n.useState(null),[N,I]=n.useState(null),[P,O]=n.useState(null),[D,w]=n.useState(null),[R,L]=n.useState([]),[x,M]=n.useState(null),[F,k]=n.useState(!1);function B(e){I(e.target.files[0])}return n.useEffect(()=>{var e;y&&y["egf-master"]&&L(null===(e=y["egf-master"])||void 0===e?void 0:e.FinancialYear)},[y]),n.useEffect(()=>{var e;T(null==m||null===(e=m.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[m]),n.useEffect(()=>{!function(){try{w(null);const e=function(){if(N){const e=function(){if(N.size>=5242880)w(r("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=Ie(function(){return Promise.resolve(Digit.UploadServices.Filestorage("PT",N,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?O(null==e||null===(l=e.data)||void 0===l||null===(o=l.files[0])||void 0===o?void 0:o.fileStoreId):w(r("CS_FILE_UPLOAD_ERROR"))})},function(){w(r("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[N]),n.useEffect(()=>{a&&g(null!=a&&a.showFinancialYearsModal?(e=>{let{t:n,action:o,financialYears:i,selectedFinancialYear:r,setSelectedFinancialYear:a}=e;return{label:{heading:`WF_${o.action}_APPLICATION`,submit:"WF_PT.CREATE_"+o.action,cancel:"ES_PT_COMMON_CANCEL"},form:[{body:[{label:n("ES_PT_FINANCIAL_YEARS"),isMandatory:!0,type:"radio",populators:l.createElement(t.RadioButtons,{options:i,optionsKey:"name",onSelect:a,selectedOption:r})}]}]}})({t:r,action:a,financialYears:R,selectedFinancialYear:x,setSelectedFinancialYear:M}):(e=>{var n;let{t:o,action:i,approvers:r,selectedApprover:a,setSelectedApprover:u,selectFile:d,uploadedFile:s,setUploadedFile:c,assigneeLabel:p,businessService:v}=e;return{label:{heading:`WF_${null==i?void 0:i.action}_APPLICATION`,submit:`WF_${v}_${null==i?void 0:i.action}`,cancel:"ES_PT_COMMON_CANCEL"},form:[{body:[{label:i.isTerminateState||"SENDBACKTOCITIZEN"===(null==i?void 0:i.action)?null:o(p||"WF_ROLE_"+(null===(n=i.assigneeRoles)||void 0===n?void 0:n[0])),type:"dropdown",populators:i.isTerminateState||"SENDBACKTOCITIZEN"===(null==i?void 0:i.action)?null:l.createElement(t.Dropdown,{option:r,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:u,selected:a})},{label:o("ES_PT_ACTION_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:`${o("ES_PT_ATTACH_FILE")}${i.docUploadRequired?" *":""}`,populators:l.createElement(t.UploadFile,{id:"workflow-doc",onUpload:d,onDelete:()=>{c(null)},showHint:!0,hintText:o("PT_ATTACH_RESTRICTIONS_SIZE"),message:s?"1 "+o("ES_PT_ACTION_FILEUPLOADED"):o("ES_PT_ACTION_NO_FILEUPLOADED")})}]}]}})({t:r,action:a,approvers:b,selectedApprover:C,setSelectedApprover:A,selectFile:B,uploadedFile:P,setUploadedFile:O,businessService:p}))},[a,b,R,x,P]),a&&_.form?l.createElement(t.Modal,{headerBarMain:l.createElement(Pe,{label:r(_.label.heading)}),headerBarEnd:l.createElement(De,{onClick:d}),actionCancelLabel:r(_.label.cancel),actionCancelOnSubmit:d,actionSaveLabel:r(_.label.submit),actionSaveOnSubmit:()=>{},isDisabled:a.showFinancialYearsModal?!x:f||(null==a?void 0:a.docUploadRequired)&&!P,formId:"modal-action"},E?l.createElement(t.Loader,null):l.createElement(t.FormComposer,{config:_.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){if("INACTIVE_PROPERTY"==(null==a?void 0:a.action)){let t={action:"OPEN",comment:null==e?void 0:e.comments,businessService:"PT.CREATE",moduleName:"PT"};c.creationReason="STATUS",s({customFunctionToExecute:null==a?void 0:a.customFunctionToExecute,Property:{...c,workflow:t}})}else if(null!=a&&a.showFinancialYearsModal)s({customFunctionToExecute:null==a?void 0:a.customFunctionToExecute,Assessment:{financialYear:null==x?void 0:x.name,propertyId:null==c?void 0:c.propertyId,tenantId:u,source:null==c?void 0:c.source,channel:null==c?void 0:c.channel,assessmentDate:Date.now()}});else{let t={action:null==a?void 0:a.action,comment:null==e?void 0:e.comments,businessService:p,moduleName:v};t.assignes=null!=a&&a.isTerminateState||!C?[]:[C],P&&(t.documents=[{documentType:(null==a?void 0:a.action)+" DOC",fileName:null==N?void 0:N.name,fileStoreId:P}]),s({Property:{...c,workflow:t}})}},defaultValues:h,formId:"modal-action"})):l.createElement(t.Loader,null)},Re=e=>l.createElement("h1",{className:"heading-m"},e.label),Le=()=>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"})),xe=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(Le,null)),Me=e=>{var o,i;let{t:r,action:a,tenantId:u,closeModal:d,submitAction:s,applicationData:c,businessService:p}=e;const{data:v}=Digit.Hooks.useEmployeeSearch(u,{roles:null==a||null===(o=a.assigneeRoles)||void 0===o||null===(i=o.map)||void 0===i?void 0:i.call(o,e=>({code:e})),isActive:!0},{enabled:!(null!=a&&a.isTerminateState)}),{isLoading:m,data:f}=Digit.Hooks.pt.useMDMS(u,p,"FINANCIAL_YEARLS",{},{details:{tenantId:Digit.ULBService.getStateId(),moduleDetails:[{moduleName:"egf-master",masterDetails:[{name:"FinancialYear",filter:"[?(@.module == 'TL')]"}]}]}}),[E,y]=n.useState({}),[_,g]=n.useState({}),[h,S]=n.useState([]),[b,T]=n.useState({}),[C,A]=n.useState(null),[N,I]=n.useState(null),[P,O]=n.useState(null),[D,w]=n.useState([]),[R,L]=n.useState(null);function x(e){A(e.target.files[0])}return n.useEffect(()=>{var e;f&&f["egf-master"]&&w(null===(e=f["egf-master"])||void 0===e?void 0:e.FinancialYear)},[f]),n.useEffect(()=>{var e;S(null==v||null===(e=v.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}}))},[v]),n.useEffect(()=>{!function(){try{O(null);const e=function(){if(C){const e=function(){if(C.size>=5242880)O(r("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=Ie(function(){return Promise.resolve(Digit.UploadServices.Filestorage("PT",C,Digit.ULBService.getStateId())).then(function(e){var t,n,l,o;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?I(null==e||null===(l=e.data)||void 0===l||null===(o=l.files[0])||void 0===o?void 0:o.fileStoreId):O(r("CS_FILE_UPLOAD_ERROR"))})},function(){O(r("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(()=>{a&&y((e=>{let{t:n,action:o,approvers:i,selectedApprover:r,setSelectedApprover:a,selectFile:u,uploadedFile:d,setUploadedFile:s,businessService:c}=e,p=!0;return"SENDBACKTOCITIZEN"!=(null==o?void 0:o.action)&&"APPROVE"!=(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==c?void 0:c.toUpperCase()}_${null==o?void 0:o.action}`,cancel:"WF_EMPLOYEE_NEWTL_CANCEL"},form:[{body:[{label:p?n("WF_ASSIGNEE_NAME_LABEL"):null,placeholder:p?n("WF_ASSIGNEE_NAME_PLACEHOLDER"):null,type:"dropdown",populators:p?l.createElement(t.Dropdown,{option:i,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:a,selected:r}):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:r,action:a,approvers:h,selectedApprover:b,setSelectedApprover:T,selectFile:x,uploadedFile:N,setUploadedFile:I,businessService:p}))},[a,h,D,R,N]),a&&E.form?l.createElement(t.Modal,{headerBarMain:l.createElement(Re,{label:r(E.label.heading)}),headerBarEnd:l.createElement(xe,{onClick:d}),actionCancelLabel:r(E.label.cancel),actionCancelOnSubmit:d,actionSaveLabel:r(E.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},m?l.createElement(t.Loader,null):l.createElement(t.FormComposer,{config:E.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){c={...c,action:null==a?void 0:a.action,comment:null==e?void 0:e.comments,assignee:null!=b&&b.uuid?[null==b?void 0:b.uuid]:null,wfDocuments:N?[{documentType:(null==a?void 0:a.action)+" DOC",fileName:null==C?void 0:C.name,fileStoreId:N}]:null},s({Licenses:[c]})},defaultValues:_,formId:"modal-action"})):l.createElement(t.Loader,null)},Fe=e=>l.createElement("h1",{style:{marginLeft:"22px"},className:"heading-m BPAheading-m"},e.label),ke=()=>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"})),Be=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(ke,null)),Ue=e=>{var o,i;let{t:r,action:a,tenantId:u,closeModal:d,submitAction:s,applicationData:c,businessService:p}=e;const{data:v,isLoading:m}=Digit.Hooks.useEmployeeSearch(u,{roles:null==a||null===(o=a.assigneeRoles)||void 0===o||null===(i=o.map)||void 0===i?void 0:i.call(o,e=>({code:e})),isActive:!0},{enabled:!(null!=a&&a.isTerminateState)}),[f,E]=n.useState({}),[y,_]=n.useState({}),[g,h]=n.useState([]),[S,b]=n.useState({}),[T,C]=n.useState(null),[A,N]=n.useState(null),[I,P]=n.useState(null),O=!!Digit.Utils.browser.isMobile();function D(e){C(e.target.files[0])}return n.useEffect(()=>{var e;h(null==v||null===(e=v.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}}))},[v]),n.useEffect(()=>{!function(){try{P(null);const e=function(){if(T){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(T.size>=5242880)P(r("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=T&&T.type&&!e.test(null==T?void 0:T.type))P(r("NOT_SUPPORTED_FILE_TYPE"));else{const e=Ie(function(){return Promise.resolve(Digit.UploadServices.Filestorage("OBPS",T,Digit.ULBService.getStateId()||(null==u?void 0:u.split(".")[0]))).then(function(e){var t,n,l,o;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?N(null==e||null===(l=e.data)||void 0===l||null===(o=l.files[0])||void 0===o?void 0:o.fileStoreId):P(r("CS_FILE_UPLOAD_ERROR"))})},function(){P(r("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[T]),n.useEffect(()=>{a&&E((e=>{let{t:n,action:o,approvers:i,selectedApprover:r,setSelectedApprover:a,selectFile:u,uploadedFile:d,setUploadedFile:s,businessService:c,error:p}=e,v=!0;return"SENDBACKTOCITIZEN"==(null==o?void 0:o.action)&&(v=!1),o.isTerminateState&&(v=!1),{label:{heading:`WF_${null==o?void 0:o.action}_APPLICATION`,submit:`WF_${null==c?void 0:c.toUpperCase()}_${null==o?void 0:o.action}`,cancel:"WF_EMPLOYEE_BPAREG_CANCEL"},form:[{body:[{label:v?n("WF_ASSIGNEE_NAME_LABEL"):null,placeholder:v?n("WF_ASSIGNEE_NAME_PLACEHOLDER"):null,type:"dropdown",populators:v?l.createElement(t.Dropdown,{option:i,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:a,selected:r}):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:p})}]}]}})({t:r,action:a,approvers:g,selectedApprover:S,setSelectedApprover:b,selectFile:D,uploadedFile:A,setUploadedFile:N,businessService:p,error:I}))},[a,g,A,I]),a&&f.form?l.createElement(t.Modal,{headerBarMain:l.createElement(Fe,{label:r(f.label.heading)}),headerBarEnd:l.createElement(Be,{onClick:d}),actionCancelLabel:r(f.label.cancel),actionCancelOnSubmit:d,actionSaveLabel:r(f.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action",isOBPSFlow:!0,popupStyles:O?{width:"720px"}:{},style:O?{height:"45px",width:"44%"}:{height:"45px",width:"107px",paddingLeft:"0px",paddingRight:"0px"},popupModuleMianStyles:O?{paddingLeft:"5px"}:{}},m?l.createElement(t.Loader,null):l.createElement(t.FormComposer,{config:f.form,cardStyle:{marginLeft:"0px",marginRight:"0px",marginTop:"-25px"},className:"BPAemployeeCard",noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){c={...c,action:null==a?void 0:a.action,comment:null==e?void 0:e.comments,assignee:null!=S&&S.uuid?[null==S?void 0:S.uuid]:null,wfDocuments:A?[{documentType:(null==a?void 0:a.action)+" DOC",fileName:null==T?void 0:T.name,fileStoreId:A}]:null},s({Licenses:[c]},!1,{isStakeholder:!0,bpa:!1})},defaultValues:y,formId:"modal-action"})):l.createElement(t.Loader,null)},je=e=>l.createElement("h1",{style:{marginLeft:"22px"},className:"heading-m BPAheading-m"},e.label),He=()=>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"})),We=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(He,null)),Ve=e=>{var o,i,r,u,d,s,c,p,v,m,f,E;let{t:y,action:_,tenantId:g,closeModal:h,submitAction:S,applicationDetails:b,applicationData:T,businessService:C,workflowDetails:A}=e;Digit.Hooks.obps.useObpsAPI(null!==(o=T)&&void 0!==o&&null!==(i=o.landInfo)&&void 0!==i&&null!==(r=i.address)&&void 0!==r&&r.city?null===(u=T)||void 0===u||null===(d=u.landInfo)||void 0===d||null===(s=d.address)||void 0===s?void 0:s.city:g,!1);const{data:N,isLoading:I}=Digit.Hooks.useEmployeeSearch(g,{roles:null==A||null===(c=A.data)||void 0===c||null===(p=c.initialActionState)||void 0===p||null===(v=p.nextActions)||void 0===v||null===(m=v.filter(e=>(null==e?void 0:e.action)==(null==_?void 0:_.action)))||void 0===m||null===(f=m[0])||void 0===f||null===(E=f.assigneeRoles)||void 0===E?void 0:E.map(e=>({code:e})),isActive:!0},{enabled:!(null!=_&&_.isTerminateState)}),[P,O]=(a.useQueryClient(),n.useState({})),[D,w]=n.useState({}),[R,L]=n.useState([]),[x,M]=n.useState({}),[F,k]=n.useState(null),[B,U]=n.useState(null),[j,H]=n.useState(null),[W,V]=n.useState(null),$=!!Digit.Utils.browser.isMobile();function z(e){k(e.target.files[0])}n.useEffect(()=>{var e;L(null==N||null===(e=N.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[N]),n.useEffect(()=>{!function(){try{H(null);const e=function(){if(F){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(F.size>=5242880)H(y("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=F&&F.type&&!e.test(null==F?void 0:F.type))H(y("NOT_SUPPORTED_FILE_TYPE"));else{const e=Ie(function(){return Promise.resolve(Digit.UploadServices.Filestorage("OBPS",F,Digit.ULBService.getStateId()||(null==g?void 0:g.split(".")[0]))).then(function(e){var t,n,l,o;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?U(null==e||null===(l=e.data)||void 0===l||null===(o=l.files[0])||void 0===o?void 0:o.fileStoreId):H(y("CS_FILE_UPLOAD_ERROR"))})},function(){H(y("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[F]);const Y=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},K=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},q=e=>{var t,n;let l=[],o=[];var i,r;return(null==e||null===(t=e.additionalDetails)||void 0===t||null===(n=t.fieldinspection_pending)||void 0===n?void 0:n.length)>0&&(o=null==e||null===(i=e.additionalDetails)||void 0===i?void 0:i.fieldinspection_pending),"FIELDINSPECTION_INPROGRESS"==e.status?(l=JSON.parse(sessionStorage.getItem("INSPECTION_DATA")),(null===(r=l)||void 0===r?void 0:r.length)>0&&l.map((e,t)=>{o.push({docs:Y(e.Documents),date:e.InspectionDate,questions:K(e),time:null==e?void 0:e.InspectionTime})}),o=o.filter(e=>e.docs&&e.docs.length>0)):sessionStorage.removeItem("INSPECTION_DATA"),[...o]},G=e=>{let t=JSON.parse(sessionStorage.getItem("BPA_DOCUMENTS")),n=[];return t.map(e=>{var t,l,o,i,r,a;(null==e||null===(t=e.uploadedDocuments)||void 0===t||null===(l=t[0])||void 0===l||null===(o=l.values)||void 0===o?void 0:o.length)>0&&(n=[...n,...null==e||null===(i=e.uploadedDocuments)||void 0===i||null===(r=i[0])||void 0===r?void 0:r.values]),(null==e||null===(a=e.newUploadedDocs)||void 0===a?void 0:a.length)>0&&(n=[...n,...null==e?void 0:e.newUploadedDocs])}),n},Z=()=>{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(()=>{_&&O((e=>{var n;let{t:o,action:i,approvers:r,selectedApprover:a,setSelectedApprover:u,selectFile:d,uploadedFile:s,setUploadedFile:c,assigneeLabel:p,businessService:v,error:m}=e,f=!1;return"REVOCATE"!=(null==i?void 0:i.action)&&"REJECT"!=(null==i?void 0:i.action)&&"SKIP_PAYMENT"!=i.action&&"SEND_BACK_TO_CITIZEN"!=(null==i?void 0:i.action)&&"APPROVE"!=(null==i?void 0:i.action)||(f=!0),{label:{heading:`WF_${null==i?void 0:i.action}_APPLICATION`,submit:`WF_${v}_${null==i?void 0:i.action}`,cancel:"BPA_CITIZEN_CANCEL_BUTTON"},form:[{body:[{label:i.isTerminateState||f?null:o(p||"WF_ROLE_"+(null===(n=i.assigneeRoles)||void 0===n?void 0:n[0])),type:"dropdown",populators:i.isTerminateState||f?null:l.createElement(t.Dropdown,{option:r,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:u,selected:a})},{label:o("WF_COMMON_COMMENTS"),type:"textarea",isMandatory:!0,populators:{name:"comments"}},{label:""+o("WF_APPROVAL_UPLOAD_HEAD"),populators:l.createElement(t.UploadFile,{id:"workflow-doc",onUpload:d,onDelete:()=>{c(null)},message:s?"1 "+o("ES_PT_ACTION_FILEUPLOADED"):o("CS_ACTION_NO_FILEUPLOADED"),accept:"image/*, .pdf, .png, .jpeg, .jpg",iserror:m})}]}]}})({t:y,action:_,approvers:R,selectedApprover:x,setSelectedApprover:M,selectFile:z,uploadedFile:B,setUploadedFile:U,businessService:C,assigneeLabel:"WF_ASSIGNEE_NAME_LABEL",error:j}))},[_,R,W,B,j]),_&&P.form?l.createElement(t.Modal,{headerBarMain:l.createElement(je,{label:y(P.label.heading)}),headerBarEnd:l.createElement(We,{onClick:h}),actionCancelLabel:y(P.label.cancel),actionCancelOnSubmit:h,actionSaveLabel:y(P.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action",isOBPSFlow:!0,popupStyles:$?{width:"720px"}:{},style:$?{minHeight:"45px",height:"auto",width:"44%"}:{minHeight:"45px",height:"auto",width:"107px",paddingLeft:"0px",paddingRight:"0px"},popupModuleMianStyles:$?{paddingLeft:"5px"}:{}},I?l.createElement(t.Loader,null):l.createElement(t.FormComposer,{config:P.form,cardStyle:{marginLeft:"0px",marginRight:"0px",marginTop:"-25px"},className:"BPAemployeeCard",noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){try{var t,n,l,o,i,r;T={...T,documents:G(),additionalDetails:{...null===(t=T)||void 0===t?void 0:t.additionalDetails,fieldinspection_pending:q(T),pendingapproval:Z()},workflow:{action:null==_?void 0:_.action,comment:(null==e||null===(n=e.comments)||void 0===n?void 0:n.length)>0?null==e?void 0:e.comments:null,comments:(null==e||null===(l=e.comments)||void 0===l?void 0:l.length)>0?null==e?void 0:e.comments:null,assignee:null!=x&&x.uuid?[null==x?void 0:x.uuid]:null,assignes:null!=x&&x.uuid?[null==x?void 0:x.uuid]:null,varificationDocuments:B?[{documentType:(null==_?void 0:_.action)+" DOC",fileName:null==F?void 0:F.name,fileStoreId:B}]:null},action:null==_?void 0:_.action,comment:null==e?void 0:e.comments,assignee:null!=x&&x.uuid?[null==x?void 0:x.uuid]:null,wfDocuments:B?[{documentType:(null==_?void 0:_.action)+" DOC",fileName:null==F?void 0:F.name,fileStoreId:B}]:null};const a=null==b||null===(o=b.nocData)||void 0===o?void 0:o.map(e=>{const t=Digit.SessionStorage.get(null==e?void 0:e.nocType)||[];return{Noc:{...e,documents:[...null!=e&&e.documents?null==e?void 0:e.documents:[],...t||[]]}}});let u={sourceRefId:null==a||null===(i=a[0])||void 0===i||null===(r=i.Noc)||void 0===r?void 0:r.sourceRefId};return Promise.resolve(Digit.NOCSearch.all(g,u)).then(function(e){var t;let n=!0,l=!0;null==e||null===(t=e.Noc)||void 0===t||t.map(e=>{var t,o,i,r,a;"APPROVED"!==(null==e||null===(t=e.applicationStatus)||void 0===t?void 0:t.toUpperCase())&&"AUTO_APPROVED"!==(null==e||null===(o=e.applicationStatus)||void 0===o?void 0:o.toUpperCase())&&"REJECTED"!==(null==e||null===(i=e.applicationStatus)||void 0===i?void 0:i.toUpperCase())&&"AUTO_REJECTED"!==(null==e||null===(r=e.applicationStatus)||void 0===r?void 0:r.toUpperCase())&&"VOIDED"!==(null==e||null===(a=e.applicationStatus)||void 0===a?void 0:a.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 o=[];a&&a.map(e=>{var t,i,r,a,u,d,s,c,p,v,m,f;("APPROVED"!=(null==e||null===(t=e.Noc)||void 0===t||null===(i=t.applicationStatus)||void 0===i?void 0:i.toUpperCase())&&"AUTO_APPROVED"!=(null==e||null===(r=e.Noc)||void 0===r||null===(a=r.applicationStatus)||void 0===a?void 0:a.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===(p=e.Noc)||void 0===p||null===(v=p.applicationStatus)||void 0===v?void 0:v.toUpperCase())&&"AIRPORT_AUTHORITY"===(null==e||null===(m=e.Noc)||void 0===m?void 0:m.nocType)&&n||"FIRE_NOC"===(null==e||null===(f=e.Noc)||void 0===f?void 0:f.nocType)&&l)&&o.push(e)}),S({BPA:T},(null==o?void 0:o.length)>0&&o,{isStakeholder:!1,bpa:!0})})}catch(e){return Promise.reject(e)}},defaultValues:D,formId:"modal-action"})):l.createElement(t.Loader,null)},$e=e=>l.createElement("h1",{style:{marginLeft:"22px"},className:"heading-m BPAheading-m"},e.label),ze=()=>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"})),Ye=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(ze,null)),Ke=e=>{var o,i;let{t:u,action:d,tenantId:s,closeModal:c,submitAction:p,applicationData:v,businessService:m}=e;const{data:f,isLoading:E}=Digit.Hooks.useEmployeeSearch(s,{roles:null==d||null===(o=d.assigneeRoles)||void 0===o||null===(i=o.map)||void 0===i?void 0:i.call(o,e=>({code:e})),isActive:!0},{enabled:!(null!=d&&d.isTerminateState)}),[y,_]=(a.useQueryClient(),n.useState({})),[g,h]=n.useState({}),[S,b]=n.useState([]),[T,C]=n.useState({}),[A,N]=n.useState(null),[I,P]=n.useState(null),[O,D]=n.useState(null),w=!!Digit.Utils.browser.isMobile();function R(e){N(e.target.files[0])}return r.useHistory(),n.useEffect(()=>{var e;b(null==f||null===(e=f.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[f]),n.useEffect(()=>{!function(){try{D(null);const e=function(){if(A){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(A.size>=5242880)D(u("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=A&&A.type&&!e.test(null==A?void 0:A.type))D(u("NOT_SUPPORTED_FILE_TYPE"));else{const e=Ie(function(){return Promise.resolve(Digit.UploadServices.Filestorage("NOC",A,Digit.ULBService.getStateId()||(null==s?void 0:s.split(".")[0]))).then(function(e){var t,n,l,o;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?P(null==e||null===(l=e.data)||void 0===l||null===(o=l.files[0])||void 0===o?void 0:o.fileStoreId):D(u("CS_FILE_UPLOAD_ERROR"))})},function(){D(u("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[A]),n.useEffect(()=>{d&&_((e=>{var n;let{t:o,action:i,approvers:r,selectedApprover:a,setSelectedApprover:u,selectFile:d,uploadedFile:s,setUploadedFile:c,assigneeLabel:p,businessService:v,error:m}=e,f=!1;"REVOCATE"!=(null==i?void 0:i.action)&&"REJECT"!=(null==i?void 0:i.action)||(f=!0);let E=!1;return"APPROVE"!=(null==i?void 0:i.action)&&"REJECT"!=(null==i?void 0:i.action)&&"AUTO_APPROVE"!=i.action&&"AUTO_REJECT"!=i.action||(E=!0),{label:{heading:`WF_${null==i?void 0:i.action}_APPLICATION`,submit:`WF_${v}_${null==i?void 0:i.action}`,cancel:"CORE_LOGOUTPOPUP_CANCEL"},form:[{body:[{label:i.isTerminateState||E?null:o(p||"WF_ROLE_"+(null===(n=i.assigneeRoles)||void 0===n?void 0:n[0])),type:"dropdown",populators:i.isTerminateState||E?null:l.createElement(t.Dropdown,{option:r,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:u,selected:a})},{label:o("WF_COMMON_COMMENTS"),type:"textarea",isMandatory:f,populators:{name:"comments"}},{label:""+o("WF_APPROVAL_UPLOAD_HEAD"),populators:l.createElement(t.UploadFile,{id:"workflow-doc",onUpload:d,onDelete:()=>{c(null)},showHint:!0,message:s?"1 "+o("ES_PT_ACTION_FILEUPLOADED"):o("CS_ACTION_NO_FILEUPLOADED"),accept:"image/*, .pdf, .png, .jpeg, .jpg",iserror:m})}]}]}})({t:u,action:d,approvers:S,selectedApprover:T,setSelectedApprover:C,selectFile:R,uploadedFile:I,setUploadedFile:P,businessService:m,assigneeLabel:"WF_ASSIGNEE_NAME_LABEL",error:O}))},[d,S,I,O]),d&&y.form?l.createElement(t.Modal,{headerBarMain:l.createElement($e,{label:u(y.label.heading)}),headerBarEnd:l.createElement(Ye,{onClick:c}),actionCancelLabel:u(y.label.cancel),actionCancelOnSubmit:c,actionSaveLabel:u(y.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action",isOBPSFlow:!0,popupStyles:w?{width:"720px"}:{},style:w?{height:"45px",width:"44%"}:{height:"45px",width:"107px",paddingLeft:"0px",paddingRight:"0px"},popupModuleMianStyles:w?{paddingLeft:"5px"}:{}},E?l.createElement(t.Loader,null):l.createElement(t.FormComposer,{config:y.form,cardStyle:{marginLeft:"0px",marginRight:"0px",marginTop:"-25px"},className:"BPAemployeeCard",noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){var t,n,l;let o=JSON.parse(sessionStorage.getItem("NewNOCDocs")),i=(null===(t=v)||void 0===t||null===(n=t.documents)||void 0===n?void 0:n.length)>0?[...null===(l=v)||void 0===l?void 0:l.documents]:[];o.map((e,t)=>{i.push(e)}),v={...v,workflow:{action:null==d?void 0:d.action,comment:null!=e&&e.comments?null==e?void 0:e.comments:null,assignee:null!=T&&T.uuid?[null==T?void 0:T.uuid]:null,documents:I?[{documentType:(null==d?void 0:d.action)+" DOC",fileName:null==A?void 0:A.name,fileStoreId:I}]:null},documents:i},p({Noc:v},!1,{isNoc:!0})},defaultValues:g,formId:"modal-action"})):l.createElement(t.Loader,null)};var qe=function(e,t){return e===t||e!=e&&t!=t},Ge=function(e,t){for(var n=e.length;n--;)if(qe(e[n][0],t))return n;return-1},Ze=Array.prototype.splice;function Xe(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])}}Xe.prototype.clear=function(){this.__data__=[],this.size=0},Xe.prototype.delete=function(e){var t=this.__data__,n=Ge(t,e);return!(n<0||(n==t.length-1?t.pop():Ze.call(t,n,1),--this.size,0))},Xe.prototype.get=function(e){var t=this.__data__,n=Ge(t,e);return n<0?void 0:t[n][1]},Xe.prototype.has=function(e){return Ge(this.__data__,e)>-1},Xe.prototype.set=function(e,t){var n=this.__data__,l=Ge(n,e);return l<0?(++this.size,n.push([e,t])):n[l][1]=t,this};var Je,Qe=Xe,et="object"==typeof s&&s&&s.Object===Object&&s,tt="object"==typeof self&&self&&self.Object===Object&&self,nt=et||tt||Function("return this")(),lt=nt.Symbol,ot=Object.prototype,it=ot.hasOwnProperty,rt=ot.toString,at=lt?lt.toStringTag:void 0,ut=Object.prototype.toString,dt=lt?lt.toStringTag:void 0,st=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":dt&&dt in Object(e)?function(e){var t=it.call(e,at),n=e[at];try{e[at]=void 0;var l=!0}catch(e){}var o=rt.call(e);return l&&(t?e[at]=n:delete e[at]),o}(e):function(e){return ut.call(e)}(e)},ct=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},pt=function(e){if(!ct(e))return!1;var t=st(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t},vt=nt["__core-js_shared__"],mt=(Je=/[^.]+$/.exec(vt&&vt.keys&&vt.keys.IE_PROTO||""))?"Symbol(src)_1."+Je:"",ft=Function.prototype.toString,Et=function(e){if(null!=e){try{return ft.call(e)}catch(e){}try{return e+""}catch(e){}}return""},yt=/^\[object .+?Constructor\]$/,_t=RegExp("^"+Function.prototype.toString.call(Object.prototype.hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),gt=function(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return function(e){return!(!ct(e)||(t=e,mt&&mt in t))&&(pt(e)?_t:yt).test(Et(e));var t}(n)?n:void 0},ht=gt(nt,"Map"),St=gt(Object,"create"),bt=Object.prototype.hasOwnProperty,Tt=Object.prototype.hasOwnProperty;function Ct(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])}}Ct.prototype.clear=function(){this.__data__=St?St(null):{},this.size=0},Ct.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Ct.prototype.get=function(e){var t=this.__data__;if(St){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return bt.call(t,e)?t[e]:void 0},Ct.prototype.has=function(e){var t=this.__data__;return St?void 0!==t[e]:Tt.call(t,e)},Ct.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=St&&void 0===t?"__lodash_hash_undefined__":t,this};var At=Ct,Nt=function(e,t){var n,l,o=e.__data__;return("string"==(l=typeof(n=t))||"number"==l||"symbol"==l||"boolean"==l?"__proto__"!==n:null===n)?o["string"==typeof t?"string":"hash"]:o.map};function It(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])}}It.prototype.clear=function(){this.size=0,this.__data__={hash:new At,map:new(ht||Qe),string:new At}},It.prototype.delete=function(e){var t=Nt(this,e).delete(e);return this.size-=t?1:0,t},It.prototype.get=function(e){return Nt(this,e).get(e)},It.prototype.has=function(e){return Nt(this,e).has(e)},It.prototype.set=function(e,t){var n=Nt(this,e),l=n.size;return n.set(e,t),this.size+=n.size==l?0:1,this};var Pt=It;function Ot(e){var t=this.__data__=new Qe(e);this.size=t.size}Ot.prototype.clear=function(){this.__data__=new Qe,this.size=0},Ot.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},Ot.prototype.get=function(e){return this.__data__.get(e)},Ot.prototype.has=function(e){return this.__data__.has(e)},Ot.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Qe){var l=n.__data__;if(!ht||l.length<199)return l.push([e,t]),this.size=++n.size,this;n=this.__data__=new Pt(l)}return n.set(e,t),this.size=n.size,this};var Dt=Ot,wt=function(){try{var e=gt(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),Rt=function(e,t,n){"__proto__"==t&&wt?wt(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n},Lt=Object.prototype.hasOwnProperty,xt=function(e,t,n){var l=e[t];Lt.call(e,t)&&qe(l,n)&&(void 0!==n||t in e)||Rt(e,t,n)},Mt=function(e,t,n,l){var o=!n;n||(n={});for(var i=-1,r=t.length;++i<r;){var a=t[i],u=l?l(n[a],e[a],a,n,e):void 0;void 0===u&&(u=e[a]),o?Rt(n,a,u):xt(n,a,u)}return n},Ft=function(e){return null!=e&&"object"==typeof e},kt=function(e){return Ft(e)&&"[object Arguments]"==st(e)},Bt=Object.prototype,Ut=Bt.hasOwnProperty,jt=Bt.propertyIsEnumerable,Ht=kt(function(){return arguments}())?kt:function(e){return Ft(e)&&Ut.call(e,"callee")&&!jt.call(e,"callee")},Wt=Array.isArray,Vt=function(){return!1},$t=c(function(e,t){var n=t&&!t.nodeType&&t,l=n&&e&&!e.nodeType&&e,o=l&&l.exports===n?nt.Buffer:void 0;e.exports=(o?o.isBuffer:void 0)||Vt}),zt=/^(?:0|[1-9]\d*)$/,Yt=function(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&zt.test(e))&&e>-1&&e%1==0&&e<t},Kt=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991},qt={};qt["[object Float32Array]"]=qt["[object Float64Array]"]=qt["[object Int8Array]"]=qt["[object Int16Array]"]=qt["[object Int32Array]"]=qt["[object Uint8Array]"]=qt["[object Uint8ClampedArray]"]=qt["[object Uint16Array]"]=qt["[object Uint32Array]"]=!0,qt["[object Arguments]"]=qt["[object Array]"]=qt["[object ArrayBuffer]"]=qt["[object Boolean]"]=qt["[object DataView]"]=qt["[object Date]"]=qt["[object Error]"]=qt["[object Function]"]=qt["[object Map]"]=qt["[object Number]"]=qt["[object Object]"]=qt["[object RegExp]"]=qt["[object Set]"]=qt["[object String]"]=qt["[object WeakMap]"]=!1;var Gt=function(e){return function(t){return e(t)}},Zt=c(function(e,t){var n=t&&!t.nodeType&&t,l=n&&e&&!e.nodeType&&e,o=l&&l.exports===n&&et.process,i=function(){try{return l&&l.require&&l.require("util").types||o&&o.binding&&o.binding("util")}catch(e){}}();e.exports=i}),Xt=Zt&&Zt.isTypedArray,Jt=Xt?Gt(Xt):function(e){return Ft(e)&&Kt(e.length)&&!!qt[st(e)]},Qt=Object.prototype.hasOwnProperty,en=function(e,t){var n=Wt(e),l=!n&&Ht(e),o=!n&&!l&&$t(e),i=!n&&!l&&!o&&Jt(e),r=n||l||o||i,a=r?function(e,t){for(var n=-1,l=Array(e);++n<e;)l[n]=t(n);return l}(e.length,String):[],u=a.length;for(var d in e)!t&&!Qt.call(e,d)||r&&("length"==d||o&&("offset"==d||"parent"==d)||i&&("buffer"==d||"byteLength"==d||"byteOffset"==d)||Yt(d,u))||a.push(d);return a},tn=Object.prototype,nn=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||tn)},ln=function(e,t){return function(n){return e(t(n))}},on=ln(Object.keys,Object),rn=Object.prototype.hasOwnProperty,an=function(e){return null!=e&&Kt(e.length)&&!pt(e)},un=function(e){return an(e)?en(e):function(e){if(!nn(e))return on(e);var t=[];for(var n in Object(e))rn.call(e,n)&&"constructor"!=n&&t.push(n);return t}(e)},dn=Object.prototype.hasOwnProperty,sn=function(e){return an(e)?en(e,!0):function(e){if(!ct(e))return function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}(e);var t=nn(e),n=[];for(var l in e)("constructor"!=l||!t&&dn.call(e,l))&&n.push(l);return n}(e)},cn=c(function(e,t){var n=t&&!t.nodeType&&t,l=n&&e&&!e.nodeType&&e,o=l&&l.exports===n?nt.Buffer:void 0,i=o?o.allocUnsafe:void 0;e.exports=function(e,t){if(t)return e.slice();var n=e.length,l=i?i(n):new e.constructor(n);return e.copy(l),l}}),pn=function(){return[]},vn=Object.prototype.propertyIsEnumerable,mn=Object.getOwnPropertySymbols,fn=mn?function(e){return null==e?[]:(e=Object(e),function(t,n){for(var l=-1,o=null==t?0:t.length,i=0,r=[];++l<o;){var a=t[l];vn.call(e,a)&&(r[i++]=a)}return r}(mn(e)))}:pn,En=function(e,t){for(var n=-1,l=t.length,o=e.length;++n<l;)e[o+n]=t[n];return e},yn=ln(Object.getPrototypeOf,Object),_n=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)En(t,fn(e)),e=yn(e);return t}:pn,gn=function(e,t,n){var l=t(e);return Wt(e)?l:En(l,n(e))},hn=function(e){return gn(e,un,fn)},Sn=function(e){return gn(e,sn,_n)},bn=gt(nt,"DataView"),Tn=gt(nt,"Promise"),Cn=gt(nt,"Set"),An=gt(nt,"WeakMap"),Nn=Et(bn),In=Et(ht),Pn=Et(Tn),On=Et(Cn),Dn=Et(An),wn=st;(bn&&"[object DataView]"!=wn(new bn(new ArrayBuffer(1)))||ht&&"[object Map]"!=wn(new ht)||Tn&&"[object Promise]"!=wn(Tn.resolve())||Cn&&"[object Set]"!=wn(new Cn)||An&&"[object WeakMap]"!=wn(new An))&&(wn=function(e){var t=st(e),n="[object Object]"==t?e.constructor:void 0,l=n?Et(n):"";if(l)switch(l){case Nn:return"[object DataView]";case In:return"[object Map]";case Pn:return"[object Promise]";case On:return"[object Set]";case Dn:return"[object WeakMap]"}return t});var Rn=wn,Ln=Object.prototype.hasOwnProperty,xn=nt.Uint8Array,Mn=function(e){var t=new e.constructor(e.byteLength);return new xn(t).set(new xn(e)),t},Fn=/\w*$/,kn=lt?lt.prototype:void 0,Bn=kn?kn.valueOf:void 0,Un=Object.create,jn=function(){function e(){}return function(t){if(!ct(t))return{};if(Un)return Un(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}(),Hn=Zt&&Zt.isMap,Wn=Hn?Gt(Hn):function(e){return Ft(e)&&"[object Map]"==Rn(e)},Vn=Zt&&Zt.isSet,$n=Vn?Gt(Vn):function(e){return Ft(e)&&"[object Set]"==Rn(e)},zn={};zn["[object Arguments]"]=zn["[object Array]"]=zn["[object ArrayBuffer]"]=zn["[object DataView]"]=zn["[object Boolean]"]=zn["[object Date]"]=zn["[object Float32Array]"]=zn["[object Float64Array]"]=zn["[object Int8Array]"]=zn["[object Int16Array]"]=zn["[object Int32Array]"]=zn["[object Map]"]=zn["[object Number]"]=zn["[object Object]"]=zn["[object RegExp]"]=zn["[object Set]"]=zn["[object String]"]=zn["[object Symbol]"]=zn["[object Uint8Array]"]=zn["[object Uint8ClampedArray]"]=zn["[object Uint16Array]"]=zn["[object Uint32Array]"]=!0,zn["[object Error]"]=zn["[object Function]"]=zn["[object WeakMap]"]=!1;var Yn=function e(t,n,l,o,i,r){var a,u=1&n,d=2&n,s=4&n;if(l&&(a=i?l(t,o,i,r):l(t)),void 0!==a)return a;if(!ct(t))return t;var c=Wt(t);if(c){if(a=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&Ln.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,a)}else{var p=Rn(t),v="[object Function]"==p||"[object GeneratorFunction]"==p;if($t(t))return cn(t,u);if("[object Object]"==p||"[object Arguments]"==p||v&&!i){if(a=d||v?{}:function(e){return"function"!=typeof e.constructor||nn(e)?{}:jn(yn(e))}(t),!u)return d?function(e,t){return Mt(e,_n(e),t)}(t,function(e,t){return e&&Mt(t,sn(t),e)}(a,t)):function(e,t){return Mt(e,fn(e),t)}(t,function(e,t){return e&&Mt(t,un(t),e)}(a,t))}else{if(!zn[p])return i?t:{};a=function(e,t,n){var l,o,i=e.constructor;switch(t){case"[object ArrayBuffer]":return Mn(e);case"[object Boolean]":case"[object Date]":return new i(+e);case"[object DataView]":return function(e,t){var n=t?Mn(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?Mn(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}(e,n);case"[object Map]":return new i;case"[object Number]":case"[object String]":return new i(e);case"[object RegExp]":return(o=new(l=e).constructor(l.source,Fn.exec(l))).lastIndex=l.lastIndex,o;case"[object Set]":return new i;case"[object Symbol]":return Bn?Object(Bn.call(e)):{}}}(t,p,u)}}r||(r=new Dt);var m=r.get(t);if(m)return m;r.set(t,a),$n(t)?t.forEach(function(o){a.add(e(o,n,l,o,t,r))}):Wn(t)&&t.forEach(function(o,i){a.set(i,e(o,n,l,i,t,r))});var f=c?void 0:(s?d?Sn:hn:d?sn:un)(t);return function(e,t){for(var n=-1,l=null==e?0:e.length;++n<l&&!1!==t(e[n],n););}(f||t,function(o,i){f&&(o=t[i=o]),xt(a,i,e(o,n,l,i,t,r))}),a},Kn=function(e){return Yn(e,5)};const qn=e=>l.createElement("h1",{className:"heading-m"},e.label),Gn=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),Zn=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(Gn,null)),Xn=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}},Jn=e=>{var o,i;let{t:r,action:a,tenantId:u,closeModal:d,submitAction:s,applicationData:c,businessService:p,cardClassName:v,cardFormWrapperClassName:m,cardFormClassName:f,formClassName:E}=e;const{data:y,isLoading:_}=Digit.Hooks.useEmployeeSearch(u,{roles:null==a||null===(o=a.assigneeRoles)||void 0===o||null===(i=o.map)||void 0===i?void 0:i.call(o,e=>({code:e})),isActive:!0},{enabled:!(null!=a&&a.isTerminateState)}),[g,h]=n.useState({}),[S,b]=n.useState({}),[T,C]=n.useState([]),[A,I]=n.useState({}),[P,O]=n.useState(null),[D,w]=n.useState(null),[R,L]=n.useState(null),x=window.Digit.Utils.browser.isMobile(),M=window.location.href.includes("/employee");function F(e){O(e.target.files[0])}return n.useEffect(()=>{var e;C(null==y||null===(e=y.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}}))},[y]),n.useEffect(()=>{!function(){try{L(null);const e=function(){if(P){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(P.size>=5242880)L(r("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=P&&P.type&&!e.test(null==P?void 0:P.type))L(r("NOT_SUPPORTED_FILE_TYPE"));else{const e=Ie(function(){return Promise.resolve(Digit.UploadServices.Filestorage("WS",P,Digit.ULBService.getCurrentTenantId())).then(function(e){var t,n,l,o;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?w(null==e||null===(l=e.data)||void 0===l||null===(o=l.files[0])||void 0===o?void 0:o.fileStoreId):L(r("CS_FILE_UPLOAD_ERROR"))})},function(e){console.error("Modal -> err ",e),L(r("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[P]),n.useEffect(()=>{var e,n,o,i;"DisconnectWSConnection"==(null===(e=c)||void 0===e||null===(n=e.processInstance)||void 0===n?void 0:n.businessService)||"DisconnectSWConnection"==(null===(o=c)||void 0===o||null===(i=o.processInstance)||void 0===i?void 0:i.businessService)?a&&h((e=>{var n;let{t:o,action:i,approvers:r,selectedApprover:a,setSelectedApprover:u,selectFile:d,uploadedFile:s,setUploadedFile:c,businessService:p,error:v}=e,m=!0,f=!1;return(null!=i&&null!==(n=i.action)&&void 0!==n&&n.includes("SEND_BACK")||"APPROVE_FOR_DISCONNECTION"==(null==i?void 0:i.action)||"RESUBMIT_APPLICATION"==(null==i?void 0:i.action))&&(m=!1),i.isTerminateState&&(m=!1),"EXECUTE_DISCONNECTION"!=(null==i?void 0:i.action)&&"DISCONNECTION_EXECUTED"!=(null==i?void 0:i.action)||(f=!0),{label:{heading:`WF_${null==i?void 0:i.action}_APPLICATION`,submit:`WF_${null==p?void 0:p.toUpperCase()}_${null==i?void 0:i.action}`,cancel:"CS_COMMON_CANCEL"},form:[{body:[{label:m?o("WF_ASSIGNEE_NAME_LABEL"):null,placeholder:m?o("WF_ASSIGNEE_NAME_PLACEHOLDER"):null,type:"dropdown",populators:m?l.createElement(t.Dropdown,{option:r,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:u,selected:a}):null},f&&{label:o("ES_FSM_ACTION_SERVICE_DATE"),isMandatory:!!f,type:"custom",populators:f?{name:"date",validation:{required:!0},defaultValue:Digit.Utils.date.getDate(),component:(e,n)=>l.createElement(t.DatePicker,N({onChange:e.onChange,date:e.value},n))}:null},{label:o("WF_COMMON_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:o("WS_APPROVAL_CHECKLIST_BUTTON_UP_FILE"),populators:l.createElement(t.UploadFile,{id:"workflow-doc",accept:".jpg,.pdf,.png,.jpeg",onUpload:d,onDelete:()=>{c(null)},message:s?"1 "+o("ES_PT_ACTION_FILEUPLOADED"):o("CS_ACTION_NO_FILEUPLOADED"),error:v,iserror:v,showHintBelow:!0,hintText:"WS_HINT_TEXT_LABEL"})}]}]}})({t:r,action:a,approvers:T,selectedApprover:A,setSelectedApprover:I,selectFile:F,uploadedFile:D,setUploadedFile:w,businessService:p,error:R})):a&&h((e=>{var n;let{t:o,action:i,approvers:r,selectedApprover:a,setSelectedApprover:u,selectFile:d,uploadedFile:s,setUploadedFile:c,businessService:p,error:v}=e,m=!0;return(null!=i&&null!==(n=i.action)&&void 0!==n&&n.includes("SEND_BACK")||"APPROVE_FOR_CONNECTION"==(null==i?void 0:i.action))&&(m=!1),i.isTerminateState&&(m=!1),{label:{heading:`WF_${null==i?void 0:i.action}_APPLICATION`,submit:`WF_${null==p?void 0:p.toUpperCase()}_${null==i?void 0:i.action}`,cancel:"CS_COMMON_CANCEL"},form:[{body:[{label:m?o("WF_ASSIGNEE_NAME_LABEL"):null,placeholder:m?o("WF_ASSIGNEE_NAME_PLACEHOLDER"):null,type:"dropdown",populators:m?l.createElement(t.Dropdown,{option:r,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:u,selected:a}):null},{label:o("WF_COMMON_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:o("WS_APPROVAL_CHECKLIST_BUTTON_UP_FILE"),populators:l.createElement(t.UploadFile,{id:"workflow-doc",accept:".jpg,.pdf,.png,.jpeg",onUpload:d,onDelete:()=>{c(null)},message:s?"1 "+o("ES_PT_ACTION_FILEUPLOADED"):o("CS_ACTION_NO_FILEUPLOADED"),error:v,iserror:v,showHintBelow:!0,hintText:"WS_HINT_TEXT_LABEL"})}]}]}})({t:r,action:a,approvers:T,selectedApprover:A,setSelectedApprover:I,selectFile:F,uploadedFile:D,setUploadedFile:w,businessService:p,error:R}))},[a,T,D,R]),a&&g.form?l.createElement(t.Modal,{headerBarMain:l.createElement(qn,{label:r(g.label.heading)}),headerBarEnd:l.createElement(Zn,{onClick:d}),actionCancelLabel:r(g.label.cancel),actionCancelOnSubmit:d,actionSaveLabel:r(g.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action",style:x&&M?{width:"100%",height:"auto"}:{}},_?l.createElement(t.Loader,null):l.createElement(t.FormComposer,{config:g.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){var t,n,l,o,i,r,d,p,v,m;if(null!==(t=c)&&void 0!==t&&t.isBillAmend){var f,E,y,_,g,h,S,b,T;const t={...null===(f=c)||void 0===f||null===(E=f.billAmendmentDetails)||void 0===E?void 0:E.additionalDetails,comments:null!=e&&e.comments?e.comments:null},n={...null===(y=c)||void 0===y?void 0:y.billAmendmentDetails,workflow:{businessId:null===(_=c)||void 0===_||null===(g=_.billAmendmentDetails)||void 0===g?void 0:g.amendmentId,action:null==a?void 0:a.action,tenantId:u,businessService:null!==(h=c)&&void 0!==h&&null!==(S=h.applicationType)&&void 0!==S&&S.includes("WATER")?"WS.AMENDMENT":"SW.AMENDMENT",moduleName:null!==(b=c)&&void 0!==b&&null!==(T=b.applicationType)&&void 0!==T&&T.includes("WATER")?"WS":"SW",assignes:null!=A&&A.uuid?[{uuid:null==A?void 0:A.uuid}]:[],comment:(null==e?void 0:e.comments)||"",documents:D?[{documentType:(null==a?void 0:a.action)+" DOC",fileName:null==P?void 0:P.name,fileStoreId:D}]:[]},additionalDetails:t,comment:(null==e?void 0:e.comments)||"",wfDocuments:D?[{documentType:(null==a?void 0:a.action)+" DOC",fileName:null==P?void 0:P.name,fileStoreId:D}]:null,processInstance:{action:null==a?void 0:a.action,assignes:null!=A&&A.uuid?[{uuid:null==A?void 0:A.uuid}]:[],comment:(null==e?void 0:e.comments)||"",documents:D?[{documentType:(null==a?void 0:a.action)+" DOC",fileName:null==P?void 0:P.name,fileStoreId:D}]:[]}};s({AmendmentUpdate:n})}else{if(c={...c,action:null==a?void 0:a.action,comment:(null==e?void 0:e.comments)||"",assignee:null!=A&&A.uuid?[null==A?void 0:A.uuid]:[],assignes:null!=A&&A.uuid?[{uuid:null==A?void 0:A.uuid}]:[],wfDocuments:D?[{documentType:(null==a?void 0:a.action)+" DOC",fileName:null==P?void 0:P.name,fileStoreId:D}]:null,processInstance:{...null===(n=c)||void 0===n?void 0:n.processInstance,action:null==a?void 0:a.action,assignes:null!=A&&A.uuid?[{uuid:null==A?void 0:A.uuid}]:[],comment:(null==e?void 0:e.comments)||"",documents:D?[{documentType:(null==a?void 0:a.action)+" DOC",fileName:null==P?void 0:P.name,fileStoreId:D}]:[]}},null!=e&&e.date&&null!==(l=c)&&void 0!==l&&null!==(o=l.applicationType)&&void 0!==o&&o.includes("DISCONNECT")){const t=Kn(null==e?void 0:e.date);c.disconnectionExecutionDate=Xn(t)}else if(null!=e&&e.date){const t=Kn(null==e?void 0:e.date);c.connectionExecutionDate=Xn(t)}var C;if("DisconnectWSConnection"==(null===(i=c)||void 0===i||null===(r=i.processInstance)||void 0===r?void 0:r.businessService)||"DisconnectSWConnection"==(null===(d=c)||void 0===d||null===(p=d.processInstance)||void 0===p?void 0:p.businessService)||window.location.href.includes("disconnection"))"WATER"==(null===(C=c)||void 0===C?void 0:C.serviceType)?s({WaterConnection:c,disconnectRequest:!0}):s({SewerageConnection:c,disconnectRequest:!0});else if("SEWERAGE_RECONNECTION"==(null===(v=c)||void 0===v?void 0:v.applicationType))s({SewerageConnection:c,disconnectRequest:!1,reconnectRequest:!0});else if("WATER_RECONNECTION"==(null===(m=c)||void 0===m?void 0:m.applicationType))s({WaterConnection:c,disconnectRequest:!1,reconnectRequest:!0});else{var N,I,O,w,R,L,x,M,F,k,B,U,j;const e=sessionStorage.getItem("Digit.ADHOC_ADD_REBATE_DATA"),t=e?JSON.parse(e):"";null!=t&&null!==(N=t.value)&&void 0!==N&&N.adhocPenalty&&(c.additionalDetails.adhocPenalty=parseInt(null==t||null===(I=t.value)||void 0===I?void 0:I.adhocPenalty)||""),null!=t&&null!==(O=t.value)&&void 0!==O&&O.adhocPenaltyComment&&(c.additionalDetails.adhocPenaltyComment=(null==t||null===(w=t.value)||void 0===w?void 0:w.adhocPenaltyComment)||""),null!=t&&null!==(R=t.value)&&void 0!==R&&R.adhocPenaltyReason&&(c.additionalDetails.adhocPenaltyReason=(null==t||null===(L=t.value)||void 0===L?void 0:L.adhocPenaltyReason)||""),null!=t&&null!==(x=t.value)&&void 0!==x&&x.adhocRebate&&(c.additionalDetails.adhocRebate=parseInt(null==t||null===(M=t.value)||void 0===M?void 0:M.adhocRebate)||""),null!=t&&null!==(F=t.value)&&void 0!==F&&F.adhocRebateComment&&(c.additionalDetails.adhocRebateComment=(null==t||null===(k=t.value)||void 0===k?void 0:k.adhocRebateComment)||""),null!=t&&null!==(B=t.value)&&void 0!==B&&B.adhocRebateReason&&(c.additionalDetails.adhocRebateReason=(null==t||null===(U=t.value)||void 0===U?void 0:U.adhocRebateReason)||""),"WATER"==(null===(j=c)||void 0===j?void 0:j.serviceType)?s({WaterConnection:c,disconnectRequest:!1,reconnectRequest:!1}):s({SewerageConnection:c,disconnectRequest:!1,reconnectRequest:!1})}}},defaultValues:S,formId:"modal-action",cardFormClassName:f,cardFormWrapperClassName:m,cardClassName:v,formClassName:E})):l.createElement(t.Loader,null)},Qn=e=>l.createElement("h1",{className:"heading-m"},e.label),el=()=>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"})),tl=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(el,null)),nl=e=>{var o,i;let{t:r,action:a,tenantId:u,closeModal:d,submitAction:s,applicationData:c,businessService:p,moduleCode:v}=e;console.log("applicationData",c);const{data:m}=Digit.Hooks.useEmployeeSearch(u,{roles:null==a||null===(o=a.assigneeRoles)||void 0===o||null===(i=o.map)||void 0===i?void 0:i.call(o,e=>({code:e})),isActive:!0},{enabled:!(null!=a&&a.isTerminateState)}),[f,E]=n.useState({}),[y,_]=n.useState({}),[g,h]=n.useState([]),[S,b]=n.useState(null),[T,C]=n.useState(null),[A,N]=n.useState(null),[I,P]=n.useState(null),[O,D]=n.useState(!1);function w(e){C(e.target.files[0])}return n.useEffect(()=>{var e;h(null==m||null===(e=m.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[m]),n.useEffect(()=>{!function(){try{P(null);const e=function(){if(T){const e=function(){if(T.size>=5242880)P(r("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=Ie(function(){return Promise.resolve(Digit.UploadServices.Filestorage("PTR",T,Digit.ULBService.getStateId())).then(function(e){var t,n,l,o;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?N(null==e||null===(l=e.data)||void 0===l||null===(o=l.files[0])||void 0===o?void 0:o.fileStoreId):P(r("CS_FILE_UPLOAD_ERROR"))})},function(){P(r("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(()=>{a&&E((e=>{let{t:n,action:o,selectFile:i,uploadedFile:r,setUploadedFile:a,businessService:u}=e;return{label:{heading:`WF_${null==o?void 0:o.action}_APPLICATION`,submit:`WF_${u}_${null==o?void 0:o.action}`,cancel:"ES_PTR_COMMON_CANCEL"},form:[{body:[{label:n("ES_PTR_ACTION_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:`${n("ES_PTR_ATTACH_FILE")}${o.docUploadRequired?" *":""}`,populators:l.createElement(t.UploadFile,{id:"workflow-doc",onUpload:i,onDelete:()=>{a(null)},showHint:!0,hintText:n("PTR_ATTACH_RESTRICTIONS_SIZE"),message:r?"1 "+n("ES_PTR_ACTION_FILEUPLOADED"):n("ES_PTR_ACTION_NO_FILEUPLOADED")})}]}]}})({t:r,action:a,approvers:g,selectedApprover:S,setSelectedApprover:b,selectFile:w,uploadedFile:A,setUploadedFile:N,businessService:p}))},[a,g,A]),a&&f.form?l.createElement(t.Modal,{headerBarMain:l.createElement(Qn,{label:r(f.label.heading)}),headerBarEnd:l.createElement(tl,{onClick:d}),actionCancelLabel:r(f.label.cancel),actionCancelOnSubmit:d,actionSaveLabel:r(f.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},l.createElement(t.FormComposer,{config:f.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){let t={action:null==a?void 0:a.action,comments:null==e?void 0:e.comments,businessService:p,moduleName:v};A&&(t.documents=[{documentType:(null==a?void 0:a.action)+" DOC",fileName:null==T?void 0:T.name,filestoreId:A}]),s({PetRegistrationApplications:[{...c,workflow:t}]})},defaultValues:y,formId:"modal-action"})):l.createElement(t.Loader,null)},ll=e=>l.createElement("h1",{className:"heading-m"},e.label),ol=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),il=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(ol,null)),rl=e=>{var o,i,a;let{t:u,action:d,tenantId:s,closeModal:c,submitAction:p,applicationData:v,businessService:m,moduleCode:f,cardClassName:E,cardFormWrapperClassName:y,cardFormClassName:_,formClassName:g}=e;const{data:h}=Digit.Hooks.useEmployeeSearch(s,{roles:null==d||null===(o=d.roles)||void 0===o||null===(i=o[0])||void 0===i||null===(a=i.map)||void 0===a?void 0:a.call(i,e=>({code:e})),isActive:!0},{enabled:!(null!=d&&d.isTerminateState)}),S=r.useHistory(),[b,T]=n.useState({}),[C,A]=n.useState({}),[N,I]=n.useState([]),[P,O]=n.useState(null),[D,w]=n.useState(null);return n.useEffect(()=>{var e;I(null==h||null===(e=h.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[h]),n.useEffect(()=>{"INITIATED"===(null==d?void 0:d.state)?S.push("/digit-ui/employee/asset/assetservice/edit/"+(null==v?void 0:v.applicationNo)):T((e=>{let{t:t,action:n,businessService:l}=e;return console.log("njhsegfdhjsbedwfdwe",n),{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:N,selectedApprover:P,setSelectedApprover:O,uploadedFile:D,setUploadedFile:w,businessService:m}))},[d,N,D]),d&&b.form?l.createElement(t.Modal,{headerBarMain:l.createElement(ll,{label:u(b.label.heading)}),headerBarEnd:l.createElement(il,{onClick:c}),actionCancelLabel:u(b.label.cancel),actionCancelOnSubmit:c,actionSaveLabel:u(b.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},l.createElement(t.FormComposer,{config:b.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){let t={action:null==d?void 0:d.action,comment:null==e?void 0:e.comments,businessService:m,moduleName:f};D&&(t.documents=[]),p({Asset:{...v,workflow:t}})},defaultValues:C,formId:"modal-action",cardFormClassName:_,cardFormWrapperClassName:y,cardClassName:E,formClassName:g})):l.createElement(t.Loader,null)},al=e=>l.createElement("h1",{className:"heading-m"},e.label),ul=()=>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(ul,null)),sl=e=>{var o,i;let{t:r,action:a,tenantId:u,closeModal:d,submitAction:s,applicationData:c,businessService:p,moduleCode:v}=e;const{data:m}=Digit.Hooks.useEmployeeSearch(u,{roles:null==a||null===(o=a.assigneeRoles)||void 0===o||null===(i=o.map)||void 0===i?void 0:i.call(o,e=>({code:e})),isActive:!0},{enabled:!(null!=a&&a.isTerminateState)}),[f,E]=n.useState({}),[y,_]=n.useState({}),[g,h]=n.useState([]),[S,b]=n.useState(null),[T,C]=n.useState(null),[A,N]=n.useState(null),[I,P]=n.useState(null),[O,D]=n.useState(!1);function w(e){C(e.target.files[0])}return n.useEffect(()=>{var e;h(null==m||null===(e=m.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[m]),n.useEffect(()=>{!function(){try{P(null);const e=function(){if(T){const e=function(){if(T.size>=5242880)P(r("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=Ie(function(){return Promise.resolve(Digit.UploadServices.Filestorage("CHB",T,u)).then(function(e){var t,n,l,o;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?N(null==e||null===(l=e.data)||void 0===l||null===(o=l.files[0])||void 0===o?void 0:o.fileStoreId):P(r("CS_FILE_UPLOAD_ERROR"))})},function(){P(r("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(()=>{a&&E((e=>{let{t:n,action:o,selectFile:i,uploadedFile:r,setUploadedFile:a}=e;return{label:{heading:"CHB_"+(null==o?void 0:o.action),submit:"CHB_"+(null==o?void 0:o.action),cancel:"CS_COMMON_BACK"},form:[{body:[{label:n("ES_CHB_ACTION_COMMENTS")+" *",type:"textarea",populators:{name:"comments",validation:{required:!0}}},{label:`${n("ES_CHB_ATTACH_FILE")}${o.docUploadRequired?" *":""}`,populators:l.createElement(t.UploadFile,{id:"workflow-doc",onUpload:i,onDelete:()=>{a(null)},message:r?"1 "+n("CS_ACTION_FILEUPLOADED"):n("CS_ACTION_NO_FILEUPLOADED")})}]}]}})({t:r,action:a,approvers:g,selectedApprover:S,setSelectedApprover:b,selectFile:w,uploadedFile:A,setUploadedFile:N,businessService:p}))},[a,g,A]),a&&f.form?l.createElement(t.Modal,{headerBarMain:l.createElement(al,{label:r(f.label.heading)}),headerBarEnd:l.createElement(dl,{onClick:d}),actionCancelLabel:r(f.label.cancel),actionCancelOnSubmit:d,actionSaveLabel:r(f.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},l.createElement(t.FormComposer,{config:f.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){let t={action:null==a?void 0:a.action,comment:null==e?void 0:e.comments,businessService:p,moduleName:v};A&&(t.documents=[{documentType:(null==a?void 0:a.action)+" DOC",fileName:null==T?void 0:T.name,fileStoreId:A}]),s({hallsBookingApplication:{...c,workflow:t}})},defaultValues:y,formId:"modal-action"})):l.createElement(t.Loader,null)},cl=e=>l.createElement("h1",{className:"heading-m"},e.label),pl=()=>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"})),vl=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(pl,null)),ml=e=>{var o,i;let{t:r,action:a,tenantId:u,closeModal:d,submitAction:s,applicationData:c,businessService:p,moduleCode:v}=e;console.log("snjdskbjdfbjskfjkbs",a);const{data:m}=Digit.Hooks.useEmployeeSearch(u,{roles:null==a||null===(o=a.assigneeRoles)||void 0===o||null===(i=o.map)||void 0===i?void 0:i.call(o,e=>({code:e})),isActive:!0},{enabled:!(null!=a&&a.isTerminateState)}),[f,E]=n.useState({}),[y,_]=n.useState({}),[g,h]=n.useState([]),[S,b]=n.useState(null),[T,C]=n.useState(null),[A,N]=n.useState(null),[I,P]=n.useState(null),[O,D]=n.useState(null),[w,R]=n.useState(!1);function L(e){N(e.target.files[0])}return n.useEffect(()=>{var e;h(null==m||null===(e=m.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[m]),n.useEffect(()=>{!function(){try{D(null);const e=function(){if(A){const e=function(){if(A.size>=5242880)D(r("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=Ie(function(){return Promise.resolve(Digit.UploadServices.Filestorage("PTR",A,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?P(null==e||null===(l=e.data)||void 0===l||null===(o=l.files[0])||void 0===o?void 0:o.fileStoreId):D(r("CS_FILE_UPLOAD_ERROR"))})},function(){D(r("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)}}()},[A]),n.useEffect(()=>{a&&E((e=>{let{t:n,action:o,selectFile:i,uploadedFile:r,setUploadedFile:a,businessService:u}=e;console.log("action",o);const d=(new Date).toISOString().split("T")[0];return console.log("todayedsta ::",d),{label:{heading:`WF_${null==o?void 0:o.action}_APPLICATION`,submit:`WF_${u}_${null==o?void 0:o.action}`,cancel:"ES_PTR_COMMON_CANCEL"},form:[{body:["COMPLETIONPENDING"===(null==o?void 0:o.state)?{label:n("EW_PICKUP_DATE"),type:"date",isMandatory:!0,populators:{name:"date",min:(new Date).toISOString().split("T")[0],max:new Date(Date.now()+6048e5).toISOString().split("T")[0]}}:"null","REQUESTCOMPLETED"===(null==o?void 0:o.state)?{label:n("ES_EW_ACTION_TRANSACTION_ID"),type:"text",isMandatory:!0,populators:{name:"transactionId"}}:"null","REQUESTCOMPLETED"===(null==o?void 0:o.state)?{label:n("ES_EW_ACTION_FINALAMOUNT"),type:"text",isMandatory:!0,populators:{name:"finalAmount"}}:"null",{label:n("ES_EW_ACTION_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:`${n("ES_EW_PHOTO")}${o.docUploadRequired?" *":""}`,populators:l.createElement(t.UploadFile,{id:"workflow-doc",onUpload:i,onDelete:()=>{a(null)},showHint:!0,hintText:n("EW_ATTACH_RESTRICTIONS_SIZE"),message:r?"1 "+n("ES_EW_ACTION_FILEUPLOADED"):n("ES_EW_ACTION_NO_FILEUPLOADED")})}]}]}})({t:r,action:a,approvers:g,selectedApprover:S,setSelectedApprover:b,selectFile:L,uploadedFile:I,setUploadedFile:P,businessService:p}))},[a,g,I]),console.log("conggg",f),a&&f.form?l.createElement(t.Modal,{headerBarMain:l.createElement(cl,{label:r(f.label.heading)}),headerBarEnd:l.createElement(vl,{onClick:d}),actionCancelLabel:r(f.label.cancel),actionCancelOnSubmit:d,actionSaveLabel:r(f.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},l.createElement(t.FormComposer,{config:f.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){let t={action:null==a?void 0:a.action,comments:null==e?void 0:e.comments,businessService:p,moduleName:v};console.log("applicationData",e),I&&(t.documents=[{documentType:(null==a?void 0:a.action)+" DOC",fileName:null==A?void 0:A.name,filestoreId:I},{}]),c.pickUpDate=null==e?void 0:e.date,c.transactionId=null==e?void 0:e.transactionId,c.finalAmount=null==e?void 0:e.finalAmount,s({EwasteApplication:[{...c,workflow:t}]})},defaultValues:y,formId:"modal-action"})):l.createElement(t.Loader,null)},fl=e=>l.createElement("h1",{className:"heading-m"},e.label),El=()=>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"})),yl=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(El,null)),_l=e=>{var o,i;let{t:r,action:a,tenantId:u,closeModal:d,submitAction:s,applicationData:c,businessService:p,moduleCode:v}=e;const{data:m}=Digit.Hooks.useEmployeeSearch(u,{roles:null==a||null===(o=a.assigneeRoles)||void 0===o||null===(i=o.map)||void 0===i?void 0:i.call(o,e=>({code:e})),isActive:!0},{enabled:null==a?void 0:a.isTerminateState}),[f,E]=n.useState({}),[y,_]=n.useState({}),[g,h]=n.useState([]),[S,b]=n.useState(null),[T,C]=n.useState(null),[A,N]=n.useState(null),[I,P]=n.useState(null),[O,D]=n.useState(!1);function w(e){D(!0),C(e.target.files[0])}return n.useEffect(()=>{var e;h(null==m||null===(e=m.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[m]),n.useEffect(()=>{!function(){try{P(null);const e=function(){if(T){const e=function(){if(T.size>=5242880)P(r("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=function(e,t){try{var n=Ie(function(){return Promise.resolve(Digit.UploadServices.Filestorage("StreetVending",T,u)).then(function(e){var t,n,l,o;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?N(null==e||null===(l=e.data)||void 0===l||null===(o=l.files[0])||void 0===o?void 0:o.fileStoreId):P(r("CS_FILE_UPLOAD_ERROR"))})},function(){P(r("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(D(!1),e)throw t;return t});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[T]),console.log("actyhdesh,jhfsefsef",a,c),n.useEffect(()=>{E((e=>{let{t:n,action:o,selectFile:i,uploadedFile:r,setUploadedFile:a,approvers:u,selectedApprover:d,setSelectedApprover:s,isUploading:c}=e;const p=()=>l.createElement("div",{className:"loading-spinner"});return console.log("isuploading ",c),{label:{heading:`WF_${null==o?void 0:o.action}_APPLICATION`,submit:"SV_"+(null==o?void 0:o.action),cancel:"SV_COMMON_CANCEL"},form:[{body:["APPROVE"===(null==o?void 0:o.action)||"REJECT"===(null==o?void 0:o.action)||"SENDBACKTOCITIZEN"===(null==o?void 0:o.action)?"":{label:n("SV_ASSIGNEE"),type:"dropdown",populators:l.createElement(t.Dropdown,{option:u,t:n,optionKey:"name",select:s,selected:d})},{label:n("SV_ACTION_COMMENTS"),isMandatory:!0,type:"textarea",populators:{name:"comments",validation:{required:!0}}},{label:`${n("SV_ATTATCH_FILE")}${o.docUploadRequired?" *":""}`,populators:l.createElement(t.UploadFile,{id:"workflow-doc-sv",onUpload:i,onDelete:()=>{a(null)},message:c?l.createElement("div",{style:{display:"flex",alignItems:"center",gap:"8px"}},l.createElement(p,null),l.createElement("span",null,"Uploading...")):r?"1 "+n("SV_FILE_UPLOADED"):n("SV_NO_FILE")})}]}]}})({t:r,action:a,approvers:g,selectedApprover:S,setSelectedApprover:b,selectFile:w,uploadedFile:A,setUploadedFile:N,businessService:p,isUploading:O}))},[a,g,A]),a&&f.form?l.createElement(t.Modal,{headerBarMain:l.createElement(fl,{label:r(f.label.heading)}),headerBarEnd:l.createElement(yl,{onClick:d}),actionCancelLabel:r(f.label.cancel),actionCancelOnSubmit:d,actionSaveLabel:r(f.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},l.createElement(t.FormComposer,{config:f.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){var t;let n={action:null==a?void 0:a.action,comments:null==e?void 0:e.comments,businessService:p,moduleName:v,assignes:"SENDBACKTOCITIZEN"===(null==a?void 0:a.action)?[null==c||null===(t=c.auditDetails)||void 0===t?void 0:t.createdBy]:null!=S&&S.uuid?[null==S?void 0:S.uuid]:null};A&&(n.documents=[{documentType:(null==a?void 0:a.action)+" DOC",fileName:null==T?void 0:T.name,fileStoreId:A}]),s({streetVendingDetail:{...c,workflow:n}})},defaultValues:y,formId:"modal-action"})):l.createElement(t.Loader,null)},gl=e=>l.createElement("h1",{className:"heading-m"},e.label),hl=()=>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"})),Sl=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(hl,null)),bl=e=>{var o,i,r,a,u;let{t:d,action:s,tenantId:c,closeModal:p,submitAction:v,applicationData:m,businessService:f,moduleCode:E,cardClassName:y,cardFormWrapperClassName:_,cardFormClassName:g,formClassName:h}=e;const{data:S}=Digit.Hooks.useEmployeeSearch(c,{roles:null==s||null===(o=s.assigneeRoles)||void 0===o||null===(i=o.map)||void 0===i?void 0:i.call(o,e=>({code:e})),isActive:!0},{enabled:!(null!=s&&s.isTerminateState)}),{data:b}=Digit.Hooks.fsm.useVendorSearch({tenantId:c,config:{enabled:"PENDING_FOR_VEHICLE_DRIVER_ASSIGN"===(null==s?void 0:s.state)||"ASSIGN_VEHICLE_DRIVER"===(null==s?void 0:s.action)}});let T=[];null==b||null===(r=b.vendor)||void 0===r||r.forEach(e=>{var t,n;if("WT"===(null==e||null===(t=e.additionalDetails)||void 0===t?void 0:t.description)||"WT"===(null==e||null===(n=e.additionalDetails)||void 0===n?void 0:n.serviceType)){var l;const t=`${null==e?void 0:e.name} (${null==e||null===(l=e.owner)||void 0===l?void 0:l.mobileNumber})`;T.push({code:null==e?void 0:e.name,name:t,i18nKey:t,vendorId:null==e?void 0:e.id})}});const{data:C}=Digit.Hooks.fsm.useVehiclesSearch({tenantId:c,config:{enabled:"DELIVERY_PENDING"===(null==s?void 0:s.state)||"ASSIGN_VEHICLE_DRIVER"===(null==s?void 0:s.action)}});let A=[];null==C||null===(a=C.vehicle)||void 0===a||null===(u=a.filter(e=>{var t,n;return(null==e||null===(t=e.driverData)||void 0===t?void 0:t.id)||(null==e||null===(n=e.driver)||void 0===n?void 0:n.id)}))||void 0===u||u.map(e=>{var t,n;A.push({code:null==e?void 0:e.registrationNumber,name:null==e?void 0:e.registrationNumber,i18nKey:null==e?void 0:e.registrationNumber,tankerCapacity:null==e?void 0:e.tankCapacity,vehicleId:null==e?void 0:e.id,driverId:(null==e||null===(t=e.driverData)||void 0===t?void 0:t.ownerId)||(null==e||null===(n=e.driver)||void 0===n?void 0:n.ownerId)})});const[N,I]=n.useState({}),[P,O]=n.useState({}),[D,w]=n.useState([]),[R,L]=n.useState(null),[x,M]=n.useState(null),[F,k]=n.useState(null),[B,U]=n.useState(null),[j,H]=n.useState(null);function W(e){L(e.target.files[0])}return n.useEffect(()=>{var e;w(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{k(null);const e=function(){if(R){const e=function(){if(R.size>=5242880)k(d("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=Ie(function(){return Promise.resolve(Digit.UploadServices.Filestorage("WT",R,c)).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?M(null==e||null===(l=e.data)||void 0===l||null===(o=l.files[0])||void 0===o?void 0:o.fileStoreId):k(d("CS_FILE_UPLOAD_ERROR"))})},function(){k(d("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)}}()},[R]),n.useEffect(()=>{s&&I((e=>{let{t:n,action:o,selectFile:i,uploadedFile:r,setUploadedFile:a,selectedVendor:u,setSelectedVendor:d,vendorDescription:s,vehicleDescription:c,selectVehicle:p,setSelectVehicle:v}=e;return{label:{heading:"RS_"+(null==o?void 0:o.action),submit:"RS_"+(null==o?void 0:o.action),cancel:"CS_COMMON_BACK"},form:[{body:[{label:n("ES_RS_ACTION_COMMENTS")+" *",type:"textarea",populators:{name:"comments",validation:{required:!0}}},"PENDING_FOR_VEHICLE_DRIVER_ASSIGN"===(null==o?void 0:o.state)&&"ASSIGN_VEHICLE_DRIVER"!==(null==o?void 0:o.action)?{label:n("RS_ASSIGN"),type:"dropdown",populators:l.createElement(t.Dropdown,{option:s,t:n,optionKey:"i18nKey",select:d,selected:u})}:"null","DELIVERY_PENDING"===(null==o?void 0:o.state)||"ASSIGN_VEHICLE_DRIVER"===(null==o?void 0:o.action)?{label:n("RS_REGISTRATION_NUMBER"),type:"dropdown",populators:l.createElement(t.Dropdown,{option:c,t:n,optionKey:"i18nKey",select:v,selected:p})}:"null",{label:`${n("ES_RS_ATTACH_FILE")}${o.docUploadRequired?" *":""}`,populators:l.createElement(t.UploadFile,{id:"workflow-doc",onUpload:i,onDelete:()=>{a(null)},message:r?"1 "+n("CS_ACTION_FILEUPLOADED"):n("CS_ACTION_NO_FILEUPLOADED")})}]}]}})({t:d,action:s,selectFile:W,uploadedFile:x,setUploadedFile:M,selectedVendor:B,setSelectedVendor:U,vendorDescription:b?T:void 0,vehicleDescription:C||"ASSIGN_VEHICLE_DRIVER"===(null==s?void 0:s.action)?A:void 0,selectVehicle:j,setSelectVehicle:H}))},[s,D,x,b,j,C]),s&&N.form?l.createElement(t.Modal,{headerBarMain:l.createElement(gl,{label:d(N.label.heading)}),headerBarEnd:l.createElement(Sl,{onClick:p}),actionCancelLabel:d(N.label.cancel),actionCancelOnSubmit:p,actionSaveLabel:d(N.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},l.createElement(t.FormComposer,{config:N.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){let t={action:null==s?void 0:s.action,comments:null==e?void 0:e.comments,businessService:f,moduleName:E};x&&(t.documents=[{documentType:(null==s?void 0:s.action)+" DOC",fileName:null==R?void 0:R.name,fileStoreId:x}]),"PENDING_FOR_VEHICLE_DRIVER_ASSIGN"===(null==s?void 0:s.state)&&(m.vendorId=null==B?void 0:B.vendorId),"DELIVERY_PENDING"===(null==s?void 0:s.state)&&(m.vehicleId=null==j?void 0:j.vehicleId),"ASSIGN_VEHICLE_DRIVER"===(null==s?void 0:s.action)&&(m.vehicleId=null==j?void 0:j.vehicleId,m.driverId=null==j?void 0:j.driverId);let n="watertanker"===f?{waterTankerBookingDetail:{...m,workflow:t}}:{mobileToiletBookingDetail:{...m,workflow:t}};v(n)},defaultValues:P,formId:"modal-action",cardFormClassName:g,cardFormWrapperClassName:_,cardClassName:y,formClassName:h})):l.createElement(t.Loader,null)},Tl=e=>null!=e&&e.businessService.includes("PT")?l.createElement(we,e):null!=e&&e.businessService.includes("ptr")?l.createElement(nl,e):null!=e&&e.businessService.includes("NewTL")||null!=e&&e.businessService.includes("TL")||null!=e&&e.businessService.includes("EDITRENEWAL")||null!=e&&e.businessService.includes("DIRECTRENEWAL")?l.createElement(Me,e):null!=e&&e.moduleCode.includes("BPAREG")?l.createElement(Ue,e):null!=e&&e.moduleCode.includes("BPA")?l.createElement(Ve,e):null!=e&&e.moduleCode.includes("NOC")?l.createElement(Ke,e):null!=e&&e.moduleCode.includes("WS")?l.createElement(Jn,e):null!=e&&e.businessService.includes("asset-create")?l.createElement(rl,e):null!=e&&e.businessService.includes("ewst")?l.createElement(ml,e):null!=e&&e.businessService.includes("booking-refund")?l.createElement(sl,e):null!=e&&e.businessService.includes("street-vending")?l.createElement(_l,e):null!=e&&e.businessService.includes("watertanker")||null!=e&&e.businessService.includes("mobileToilet")?l.createElement(bl,e):void 0;function Cl(e){let{documents:n,svgStyles:i={},isSendBackFlow:r=!1,isHrLine:a=!1,titleStyles:u}=e;const{t:d}=o.useTranslation(),s=window.location.href.includes("stakeholder");return l.createElement("div",{style:{marginTop:"19px"}},!s&&(null==n?void 0:n.map((e,o)=>{var i;return l.createElement(l.Fragment,{key:o},null!=e&&e.title?l.createElement(t.CardSubHeader,{style:u||{marginTop:"32px",marginBottom:"8px",color:"#505A5F",fontSize:"24px"}},d(null==e?void 0:e.title)):null,l.createElement("div",{style:{display:"flex",flexWrap:"wrap",justifyContent:"flex-start"}},null!=e&&e.values&&(null==e?void 0:e.values.length)>0?null==e||null===(i=e.values)||void 0===i?void 0:i.map((e,n)=>{var o;return l.createElement("a",{target:"_",href:null==e?void 0:e.url,style:{minWidth:"80px",marginRight:"10px",maxWidth:"100px",height:"auto",minWidth:"100px"},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",color:"#505A5F"}},d(null==e?void 0:e.title)),r?null!=e&&null!==(o=e.documentType)&&void 0!==o&&o.includes("NOC")?l.createElement("p",{style:{textAlign:"center"}},d(null==e?void 0:e.documentType.split(".")[1])):l.createElement("p",{style:{textAlign:"center"}},d(null==e?void 0:e.documentType)):"")}):!window.location.href.includes("citizen")&&l.createElement("div",null,l.createElement("p",null,d("BPA_NO_DOCUMENTS_UPLOADED_LABEL")))),a&&(null==n?void 0:n.length)!=o+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 Al=e=>{var t,o;let{t:i,formData:r,applicationData:a,docs:u,bpaActionsDetails:d}=e;const s=(null==a?void 0:a.status)||"",c=(null==d||null===(t=d.data)||void 0===t?void 0:t.nextActions)||[],p=Digit.ULBService.getStateId(),[v,m]=n.useState((null==r||null===(o=r.documents)||void 0===o?void 0:o.documents)||[]),[f,E]=n.useState(null),[y,_]=n.useState([]),[g,h]=n.useState(!0),[S,b]=n.useState(!1),[T,C]=n.useState(!1),{isLoading:A,data:N}=Digit.Hooks.obps.useMDMS(p,"BPA",["DocTypeMapping"]),{isLoading:I,data:P}=Digit.Hooks.obps.useMDMS(p,"common-masters",["DocumentType"]);return n.useEffect(()=>{var e,t,n,l;let o=[];var i,r;null!=N&&null!==(e=N.BPA)&&void 0!==e&&e.DocTypeMapping&&(o=null==N||null===(i=N.BPA)||void 0===i||null===(r=i.DocTypeMapping)||void 0===r?void 0:r.filter(e=>{var t,n;return e.WFState==(null==a?void 0:a.status)?null==a?void 0:a.status:e.RiskType==(null==a?void 0:a.riskType)&&e.ServiceType==(null==a||null===(t=a.additionalDetails)||void 0===t?void 0:t.serviceType)&&e.applicationType==(null==a||null===(n=a.additionalDetails)||void 0===n?void 0:n.applicationType)}));let d=[];null===(t=o)||void 0===t||null===(n=t[0])||void 0===n||null===(l=n.docTypes)||void 0===l||l.forEach(e=>{var t,n,l,o;let i=e.code;e.dropdownData=[],e.uploadedDocuments=[],null==P||null===(t=P["common-masters"])||void 0===t||null===(n=t.DocumentType)||void 0===n||n.forEach(t=>{let n=t.code.slice(0,i.length);i===n&&(e.hasDropdown=!0,t.i18nKey=t.code,e.dropdownData.push(t))}),e.uploadedDocuments[0]={},e.uploadedDocuments[0].values=[],null==u||null===(l=u[0])||void 0===l||null===(o=l.values)||void 0===o||o.map(t=>{var n,l;i===`${null==t||null===(n=t.documentType)||void 0===n?void 0:n.split(".")[0]}.${null==t||null===(l=t.documentType)||void 0===l?void 0:l.split(".")[1]}`&&e.uploadedDocuments[0].values.push(t)}),d.push(e)}),sessionStorage.setItem("BPA_DOCUMENTS",JSON.stringify(d)),_(d)},[!A,!I]),n.useEffect(()=>{let e=0;y.map(t=>{let n=!1;v.map(e=>{t.required&&t.code==`${e.documentType.split(".")[0]}.${e.documentType.split(".")[1]}`&&(n=!0)}),!n&&t.required&&(e+=1)}),h("0"!=e&&0!=e||!(v.length>0))},[v,S]),n.useEffect(()=>{C("DOC_VERIFICATION_INPROGRESS"===s&&(null==c?void 0:c.length)>0)},[a,d]),l.createElement("div",null,null==y?void 0:y.map((e,t)=>l.createElement("div",null,l.createElement(Nl,{key:t,index:t,document:e,t:i,error:f,setError:E,setDocuments:m,documents:v,setCheckRequiredFields:b,applicationStatus:s,actions:c,bpaTaxDocuments:y,checkEnablingDocs:T}))))};function Nl(e){var o,i;let{t:r,document:a,setDocuments:u,documents:d,index:s,bpaTaxDocuments:c,checkEnablingDocs:p}=e;const v=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],m=Digit.ULBService.getStateId(),[f,E]=n.useState(v?{...v,active:!0,code:null==v?void 0:v.documentType,i18nKey:null==v?void 0:v.documentType}:1===(null==a||null===(o=a.dropdownData)||void 0===o?void 0:o.length)?null==a?void 0:a.dropdownData[0]:{}),[y,_]=n.useState(null),[g,h]=n.useState(()=>(null==v?void 0:v.fileStoreId)||null),[S,b]=n.useState([]);return n.useEffect(()=>{null!=f&&f.code&&u(e=>{var t;const n=null==e?void 0:e.filter(e=>(null==e?void 0:e.documentType)!==(null==f?void 0:f.code));return 0===(null==g?void 0:g.length)||null===g?n:[...null==n?void 0:n.filter(e=>(null==e?void 0:e.fileStoreId)!==g),{documentType:null==f?void 0:f.code,fileStoreId:g,documentUid:g,fileName:(null==y?void 0:y.name)||"",id:d?null===(t=d.find(e=>e.documentType===(null==f?void 0:f.code)))||void 0===t?void 0:t.id:void 0}]})},[g,f]),n.useEffect(()=>{try{S.length>0&&(sessionStorage.removeItem("BPA_DOCUMENTS"),a.newUploadedDocs=[],S.map(e=>{var t,n,l;null!=f&&f.code&&a.newUploadedDocs.push({documentType:null==f?void 0:f.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})}),c[s]=a,sessionStorage.setItem("BPA_DOCUMENTS",JSON.stringify(c)))}catch(e){Promise.reject(e)}},[S,f]),n.useEffect(()=>{},[y]),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"}},""+r(null==a?void 0:a.code)),(null==a||null===(i=a.uploadedDocuments)||void 0===i?void 0:i.length)&&l.createElement(Cl,{documents:null==a?void 0:a.uploadedDocuments,svgStyles:{width:"100px",height:"100px",viewBox:"0 0 25 25",minWidth:"100px"}}),p?l.createElement("div",{style:{marginTop:"20px"}},l.createElement(t.LabelFieldPair,{style:{width:"100%"}},l.createElement(t.CardLabel,{style:{marginTop:"-10px",width:"100%"}},null!=a&&a.required?r(null==a?void 0:a.code)+"* ":""+r(null==a?void 0:a.code)),l.createElement(t.Dropdown,{className:"form-field",t:r,isMandatory:!1,option:null==a?void 0:a.dropdownData,selected:f,optionKey:"i18nKey",select:e=>E(e),style:{width:"100%"}})),l.createElement(t.LabelFieldPair,{style:{width:"100%"}},l.createElement(t.CardLabel,{className:"card-label-smaller",style:{width:"100%"}}),l.createElement("div",{className:"field",style:{width:"100%"}},l.createElement(t.MultiUploadWrapper,{module:"BPA",tenantId:m,getFormState:e=>((e,t)=>{let n=Object.fromEntries(t),l=Object.values(n);0!==Object.keys(n).length&&b(l),function(e){e&&_(e.file)}(l[l.length-1])})(0,e),t:r,allowedFileTypesRegex:/(.*?)(jpg|jpeg|png|image|pdf)$/i,allowedMaxSizeInMB:5,acceptFiles:"image/*, .pdf, .png, .jpeg, .jpg"})))):null)}function Il(e){let{fiReport:n,isCitizen:i=!1}=e;const{t:r}=o.useTranslation();return l.createElement(l.Fragment,null,l.createElement("div",{style:{marginTop:"10px"}},l.createElement(i?t.CardHeader:t.CardSectionHeader,{style:{fontSize:"24px"}},""+r("BPA_FI_REPORT")),n.map((e,o)=>{var i,a,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)?""+r("BPA_FI_REPORT"):`${r("BPA_FI_REPORT")} - ${o+1}`),l.createElement(t.Row,{className:"border-none",label:""+r("BPA_FI_DATE_LABEL"),text:null!=e&&e.date?e.date.includes("-")?`${null===(i=e.date)||void 0===i?void 0:i.split("-")[2]}/${null===(a=e.date)||void 0===a?void 0:a.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:""+r("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:""+r(""+e.question),text:null!=e&&e.value?null==e?void 0:e.value:"NA"}),l.createElement(t.Row,{className:"border-none",label:""+r("BPA_ENTER_REMARKS"),text:e.remarks?e.remarks:"NA"})))),l.createElement(Cl,{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 Pl(e){let{t:o,document:i,setNocDocuments:r,setError:a,nocDocuments:u}=e;const d=null==u?void 0:u.filter(e=>{var t;return null==e||null===(t=e.documentType)||void 0===t?void 0:t.includes(null==i?void 0:i.code)})[0],s=Digit.ULBService.getStateId(),[c,p]=n.useState(),[v,m]=n.useState(null),[f,E]=n.useState(()=>(null==d?void 0:d.fileStoreId)||null);return n.useEffect(()=>{var e,t;null!=i&&null!==(e=i.dropdownData)&&void 0!==e&&null!==(t=e[0])&&void 0!==t&&t.code&&r(e=>{var t;const n=null==e?void 0:e.filter(e=>{var t,n;return(null==e?void 0:e.documentType)!==(null==i||null===(t=i.dropdownData)||void 0===t||null===(n=t[0])||void 0===n?void 0:n.code)});return 0===(null==f?void 0:f.length)||null===f?n:[...null==n?void 0:n.filter(e=>(null==e?void 0:e.fileStoreId)!==f),{documentType:null==i||null===(t=i.dropdownData)||void 0===t?void 0:t[0].code,fileStoreId:f,documentUid:f,fileName:(null==v?void 0:v.name)||""}]})},[f]),n.useEffect(()=>{!function(){try{a(null);const e=function(){if(v){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(v.size>=5242880)a(o("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=v&&v.type&&!e.test(null==v?void 0:v.type))a(o("NOT_SUPPORTED_FILE_TYPE"));else{const e=Ie(function(){return E(null),Promise.resolve(Digit.UploadServices.Filestorage("PT",v,Digit.ULBService.getStateId())).then(function(e){var t,n,l,i;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?E(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):a(o("CS_FILE_UPLOAD_ERROR"))})},function(){a(o("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[v]),l.createElement("div",{style:{}},l.createElement(t.LabelFieldPair,{style:{width:"98%",marginRight:"10px"}},l.createElement(t.CardLabel,{style:{width:"100%"}},null!=i&&i.required?o("TL_BUTTON_UPLOAD FILE")+"*":""+o("TL_BUTTON_UPLOAD FILE")),l.createElement("div",{className:"field",style:{width:"100%"}},l.createElement(t.MultiUploadWrapper,{module:"NOC",tenantId:s,getFormState:e=>(e=>{let t=Object.fromEntries(e),n=Object.values(t);!function(e){e&&m(e.file)}(n[n.length-1])})(e),t:o,allowedFileTypesRegex:/(.*?)(jpg|jpeg|png|image|pdf)$/i,allowedMaxSizeInMB:5,acceptFiles:"image/*, .pdf, .png, .jpeg, .jpg"}))))}const Ol=e=>{var o;let{t:i,noc:r,docs:a,isNoc:u,applicationData:d,NOCdata:s,bpaActionsDetails:c}=e;Digit.ULBService.getStateId();const p=Digit.ULBService.getStateId(),v=(null==d?void 0:d.status)||"",m=(null==c||null===(o=c.data)||void 0===o?void 0:o.nextActions)||[],{data:f}=Digit.Hooks.obps.useMDMS(p,"NOC",["DocumentTypeMapping"],{enabled:u}),{data:E}=Digit.Hooks.obps.useMDMS(p,"BPA",["DocTypeMapping"],{enabled:!u}),{data:y}=Digit.Hooks.obps.useMDMS(p,"common-masters",["DocumentType"]),[_,g]=n.useState([]),[h,S]=n.useState([]),[b,T]=n.useState(!1),[C,A]=Digit.Hooks.useSessionStorage(null==r?void 0:r.nocType,[]),[N,I]=n.useState(null),P=window.location.href.includes("/employee/");return n.useEffect(()=>{var e;g(null==y||null===(e=y["common-masters"])||void 0===e?void 0:e.DocumentType)},[y]),n.useEffect(()=>{var e,t,n;let l,o=[];var i,a,s,c;l=u?null==f||null===(i=f.NOC)||void 0===i||null===(a=i.DocumentTypeMapping)||void 0===a?void 0:a.filter(e=>(null==e?void 0:e.applicationType)===(null==r?void 0:r.applicationType)&&(null==e?void 0:e.nocType)===(null==r?void 0:r.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==r?void 0:r.additionalDetails,applicationStatus:null==r?void 0:r.applicationStatus,appNumberLink:null==r?void 0:r.applicationNo,nocNo:null==r?void 0:r.nocNo},o.push(l[0].docTypes[0]));let p=[];o&&o.length>0&&(o.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))}),p.push(e)}),S(p))},[f,_]),n.useEffect(()=>{T("NOC_VERIFICATION_INPROGRESS"===v&&(null==m?void 0:m.length)>0)},[d,c]),l.createElement("div",{style:{border:"1px solid #D6D5D4",padding:"16px 0px 16px 8px",background:"#FAFAFA",borderRadius:"5px",marginBottom:"24px",maxWidth:"950px"}},l.createElement(t.StatusTable,null,l.createElement(t.Row,{label:P?""+i(`BPA_${null==r?void 0:r.nocType}_HEADER`):i(`BPA_${null==r?void 0:r.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:P?""+i(null==e?void 0:e.title):i(null==e?void 0:e.title),text:i(null!=e&&e.value?null==e?void 0:e.value:"CS_NA"),textStyle:"APPROVED"==(null==e?void 0:e.value)||"AUTO_APPROVED"==(null==e?void 0:e.value)?{color:"#00703C"}:{color:"#D4351C"}}:{className:"border-none",label:P?""+i(null==e?void 0:e.title):i(null==e?void 0:e.title),text:i(null!=e&&e.value?null==e?void 0:e.value:"CS_NA")})})),l.createElement(Cl,{documents:a,svgStyles:{width:"80px",height:"100px",viewBox:"0 0 25 25",minWidth:"80px"}}),b&&(null==h?void 0:h.map((e,t)=>l.createElement(Pl,{key:t,document:e,t:i,error:N,setError:I,setNocDocuments:A,nocDocuments:C,checkEnablingDocs:b}))))},Dl=e=>{let{permissions:o,t:i}=e;const[r,a,u]=Digit.Hooks.useSessionStorage("OBPS_APPROVAL_CHECKS",null==o?void 0:o.map(e=>({label:e,checked:!1}))),[d,s,c]=Digit.Hooks.useSessionStorage("OBPS_NEW_APPROVALS",[]);n.useEffect(()=>()=>{Digit.SessionStorage.del("OBPS_NEW_APPROVALS"),Digit.SessionStorage.del("OBPS_APPROVAL_CHECKS")},[]);const p=window.Digit.Utils.browser.isMobile();return l.createElement("div",null,l.createElement(t.CardSubHeader,{style:{marginBottom:"16px",fontSize:"24px"}},i("BPA_PERMIT_CONDITIONS")),null==r?void 0:r.map((e,n)=>l.createElement(t.CheckBox,{key:n,styles:{margin:"20px 0 40px",maxWidth:p?"100%":"70%"},label:null==e?void 0:e.label,checked:null==e?void 0:e.checked,onChange:e=>((e,t,n)=>{const l=e.target.checked;a(()=>null==r?void 0:r.map((e,t)=>n===t?{...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 o;return t===l?{label:null==e||null===(o=e.target)||void 0===o?void 0:o.value}:n}))})(e,n),textInputStyle:{maxWidth:p?"96%":"830px",width:p?"96%":"830px"},style:p?{paddingRight:"10%"}:{},placeholder:i("BPA_ENTER_PERMIT_CONDITIONS_LABEL")}),l.createElement(t.LinkButton,{label:l.createElement("div",null,l.createElement("span",null,l.createElement(t.Close,{style:{float:"right",position:"relative",bottom:"32px",marginTop:"-22px",marginRight:p?"5%":"35%"}}))),style:{},onClick:e=>(e=>{const t=[...d];t.splice(e,1),s([...t])})(n)}))),l.createElement(t.LinkButton,{style:{color:"#a82227",maxWidth:p?"fit-content":"10%",marginRight:"3%"},label:i("BPA_ADD_MORE"),onClick:()=>{s([...d,{label:""}])}}))};function wl(e){let{documents:i,svgStyles:r={},isSendBackFlow:a=!1}=e;const{t:u}=o.useTranslation(),[d,s]=n.useState(()=>[]),[c,p]=(Digit.ULBService.getCurrentTenantId(),n.useState({}));n.useEffect(()=>{var e;let t=[];null==i||i.forEach((e,n,l)=>{t=[...t,...e.values?e.values:[]]}),s(null===(e=t)||void 0===e?void 0:e.map(e=>null==e?void 0:e.fileStoreId))},[i]),n.useEffect(()=>{var e;null!=d&&d.length&&"BillAmend"===(null==i||null===(e=i[0])||void 0===e?void 0:e.BS)?Digit.UploadServices.Filefetch(d,Digit.ULBService.getCurrentTenantId()).then(e=>{p(null==e?void 0:e.data)}):null!=d&&d.length&&Digit.UploadServices.Filefetch(d,Digit.ULBService.getStateId()).then(e=>{p(null==e?void 0:e.data)})},[d]);const v=window.location.href.includes("employee/tl")||window.location.href.includes("/obps")||window.location.href.includes("employee/ws"),m=window.location.href.includes("stakeholder");return l.createElement("div",{style:{marginTop:"19px"}},!m&&(null==i?void 0:i.map((e,n)=>{var o;return l.createElement(l.Fragment,{key:n},null!=e&&e.title?l.createElement(t.CardSubHeader,{style:v?{marginTop:"32px",marginBottom:"18px",color:"#0B0C0C, 100%",fontSize:"24px",lineHeight:"30px"}:{marginTop:"32px",marginBottom:"8px",color:"#505A5F",fontSize:"24px"}},u(null==e?void 0:e.title)):null,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((e,n)=>{var o,i;return l.createElement("a",{target:"_",href:null===(o=c[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:v?{marginTop:"8px",fontWeight:"bold",fontSize:"16px",lineHeight:"19px",color:"#505A5F",textAlign:"center"}:{marginTop:"8px",fontWeight:"bold"}},u(null==e?void 0:e.title)),a?null!=e&&null!==(i=e.documentType)&&void 0!==i&&i.includes("NOC")?l.createElement("p",{style:{textAlign:"center"}},u(null==e?void 0:e.documentType.split(".")[1])):l.createElement("p",{style:{textAlign:"center"}},u(null==e?void 0:e.documentType)):"")}):!window.location.href.includes("citizen")&&l.createElement("div",null,l.createElement("p",null,u("BPA_NO_DOCUMENTS_UPLOADED_LABEL")))))})),m&&(null==i?void 0:i.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"}},u(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)=>{var o;return l.createElement("a",{target:"_",href:null===(o=c[e.fileStoreId])||void 0===o?void 0:o.split(",")[0],style:{minWidth:null!=r&&r.minWidth?null==r?void 0:r.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"}},u(null==e?void 0:e.title)),null!=e&&e.docInfo?l.createElement("div",{style:{fontSize:"12px",color:"#505A5F",fontWeight:400,lineHeight:"15px",marginBottom:"10px"}},""+u(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"}},""+u(null==e?void 0:e.title))))}):!window.location.href.includes("citizen")&&l.createElement("div",null,l.createElement("p",null,u("BPA_NO_DOCUMENTS_UPLOADED_LABEL")))))})))}function Rl(e){let{taxHeadEstimatesCalculation:n}=e;const{taxHeadEstimates:i}=n,{t:r}=o.useTranslation();return l.createElement("div",{style:{marginTop:"40px"}},l.createElement(t.StatusTable,null,l.createElement(t.Row,{label:r("ES_PT_TITLE_TAX_HEADS"),text:r("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:r(e.taxHeadCode),label:r(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:r("ES_PT_TITLE_TOTAL_DUE_AMOUNT"),text:"₹ "+(null==n?void 0:n.totalAmount)||"N/A",className:"border-none",textStyle:{fontSize:"24px",fontWeight:"bold"}})))}function Ll(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 xl(e){let{owners:n}=e,i={};i=window.location.href.includes("/employee/pt/")?n.slice().reverse():n;const{t:r}=o.useTranslation(),a=(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(a)>1?u={marginTop:"19px",background:"#FAFAFA",border:"1px solid #D6D5D4",borderRadius:"4px",padding:"8px",lineHeight:"19px",maxWidth:"600px",minWidth:"280px"}:Number(a)>1||(u={marginTop:"19px",lineHeight:"19px",maxWidth:"600px",minWidth:"280px"},d={position:"relative",marginTop:"19px"}),window.location.href.includes("obps")&&(u={...u,maxWidth:"950px"},u={...u,maxWidth:"950px"},s={}),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 o;return l.createElement("div",{key:r(null==e?void 0:e.title),style:u,className:"owner-details-child"},l.createElement(t.CardSubHeader,{style:Number(a)>1?{marginBottom:"8px",paddingBottom:"9px",color:"#0B0C0C",fontSize:"16px",lineHeight:"19px"}:{marginBottom:"8px",color:"#505A5F",fontSize:"24px"}},Number(a)>1?`${r(null==e?void 0:e.title)} ${n+1}`:r(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===(o=e.values)||void 0===o?void 0:o.map((e,n)=>{var o;return!0===e.map&&"N/A"!==e.value?l.createElement(t.Row,{key:r(e.title),label:r(e.title),text:l.createElement("img",{src:r(e.value),alt:"",privacy:null==e?void 0:e.privacy})}):l.createElement("span",null,l.createElement(t.Row,{key:r(e.title),label:""+r(e.title),text:r(e.value)||"N/A",last:n===(null==e||null===(o=e.values)||void 0===o?void 0:o.length)-1,caption:e.caption,className:"border-none",textStyle:e.textStyle,privacy:null==e?void 0:e.privacy,rowContainerStyle:s}))}))))})))}const Ml=e=>{var i,r,a;let{scrutinyDetails:u,paymentsList:d=[]}=e;const{t:s}=o.useTranslation(),c=e=>null!=e&&e.value&&null!=e&&e.isTransLate?l.createElement("span",{style:{color:"#00703C"}},s(null==e?void 0:e.value)):null!=e&&e.value&&null!=e&&e.isTransLate?s(null==e?void 0:e.value):null!=e&&e.value?null==e?void 0:e.value:void s("NA");return l.createElement(n.Fragment,null,!(null!=u&&u.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==u||null===(i=u.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:""+s(""+e.title),text:null!=e&&e.value?`${c(e)} ${s(null==e?void 0:e.isUnit)}`:s("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:""+s(""+e.title),text:c(e),labelStyle:null!=e&&e.isHeader?{fontSize:"20px"}:{}}):l.createElement(t.CardSubHeader,{style:{fontSize:"20px",paddingBottom:"10px",margin:"0px"}},s(null==e?void 0:e.title)):l.createElement(t.CardSubHeader,{style:{fontSize:"20px",paddingBottom:"10px"}},s(null==e?void 0:e.title))),null==u||null===(r=u.permit)||void 0===r?void 0:r.map((e,n)=>l.createElement(t.CardLabel,{style:{fontWeight:"400"}},null==e?void 0:e.title))),l.createElement("div",null,null==u||null===(a=u.scruntinyDetails)||void 0===a?void 0:a.map((e,o)=>l.createElement(n.Fragment,null,l.createElement(t.Row,{className:"border-none",label:""+s(null==e?void 0:e.title),labelStyle:{width:"150%"}}),l.createElement("a",{href:null==e?void 0:e.value}," ",l.createElement(t.PDFSvg,null)," "),l.createElement("p",{style:{margin:"8px 0px",fontWeight:"bold",fontSize:"16px",lineHeight:"19px",color:"#505A5F"}},s(null==e?void 0:e.text))))))))},Fl=e=>{var i,r,a,u,d;let{edcrDetails:s,applicationData:c}=e;const{t:p}=o.useTranslation(),v=window.Digit.Utils.browser.isMobile(),m=[{name:"BPA_TABLE_COL_FLOOR",id:"Floor"},{name:"BPA_TABLE_COL_LEVEL",id:"Level"},{name:"BPA_TABLE_COL_OCCUPANCY",id:"Occupancy"},{name:"BPA_TABLE_COL_BUILDUPAREA",id:"BuildupArea"},{name:"BPA_TABLE_COL_FLOORAREA",id:"FloorArea"},{name:"BPA_TABLE_COL_CARPETAREA",id:"CarpetArea"}],f=e=>{const t=e;return(e,n,l)=>e[t]},E=n.useMemo(()=>m.map(e=>({Header:p(""+e.name),accessor:f(e.id),id:e.id})));function y(e){var t;let n=[];return null==e||null===(t=e.building)||void 0===t||t.floors.map(e=>{var t,l,o,i,r,a,u,d;n.push({Floor:p("BPA_FLOOR_NAME_"+e.number),Level:e.number,Occupancy:p(""+(null===(t=e.occupancies)||void 0===t||null===(l=t[0])||void 0===l?void 0:l.type)),BuildupArea:null===(o=e.occupancies)||void 0===o||null===(i=o[0])||void 0===i?void 0:i.builtUpArea,FloorArea:(null===(r=e.occupancies)||void 0===r||null===(a=r[0])||void 0===a?void 0:a.floorArea)||0,CarpetArea:(null===(u=e.occupancies)||void 0===u||null===(d=u[0])||void 0===d?void 0:d.CarpetArea)||0,key:p("BPA_FLOOR_NAME_"+e.number)})}),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 o,i;let t=null===(o=n[e])||void 0===o||null===(i=o.usageCategory)||void 0===i?void 0:i.split(",");null!=t&&t.length&&(l=t.map(e=>e?""+p("BPA_SUBOCCUPANCYTYPE_"+function(e,t,n){if(void 0===e&&(e=""),void 0===t&&(t=""),void 0===n&&(n=""),""==t)return e;for(;e.includes(t);)e=e.replace(t,n);return e}(null==e?void 0:e.toUpperCase(),"-","_")):"NA").join(", "))}return l||"NA"}return l.createElement(n.Fragment,null,l.createElement("div",{style:{background:"#FAFAFA",border:"1px solid #D6D5D4",padding:"8px",borderRadius:"4px",maxWidth:"950px",minWidth:"280px"}},l.createElement(t.StatusTable,null,null==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"}},p(null==e?void 0:e.title)):l.createElement(t.Row,{className:"border-none",labelStyle:{width:"100%",fontSize:"20px"},key:""+e.title,label:""+p(""+e.title),text:null!=e&&e.value?null==e?void 0:e.value:""}))),null==s||null===(r=s.subOccupancyTableDetails)||void 0===r||null===(a=r[0])||void 0===a||null===(u=a.value)||void 0===u||null===(d=u.planDetail)||void 0===d?void 0:d.blocks.map((e,n)=>{var o,i,r,a,u;return l.createElement("div",{key:n,style:(null==s||null===(o=s.subOccupancyTableDetails)||void 0===o||null===(i=o[0])||void 0===i||null===(r=i.value)||void 0===r||null===(a=r.planDetail)||void 0===a||null===(u=a.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"}},p("BPA_BLOCK_SUBHEADER")," ",n+1),l.createElement(t.StatusTable,null,l.createElement(t.Row,{className:"border-none",textStyle:{wordBreak:"break-word"},label:""+p("BPA_SUB_OCCUPANCY_LABEL"),text:_(n)})),l.createElement("div",{style:window.location.href.includes("citizen")||v?{overflow:"scroll"}:{maxWidth:"950px",maxHeight:"280px"}},l.createElement(t.Table,{className:"customTable table-fixed-first-column table-border-style",t:p,disableSort:!1,autoSort:!0,manualPagination:!1,isPaginationRequired:!1,initSortId:"S N ",data:y(e),columns:E,getCellProps:e=>({style:{}})})))})))},kl=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))},Bl=e=>{var n,i,r;let{data:a,OpenImage:u,privacy:d={}}=e;const{t:s}=o.useTranslation();return l.createElement("div",null,a.date&&l.createElement("p",null,a.date),l.createElement("p",null,a.name),a.mobileNumber&&l.createElement("span",{style:{display:"inline-flex",width:"fit-content",marginLeft:"10px"}},l.createElement(t.TelePhone,{mobile:a.mobileNumber,privacy:d}),l.createElement("p",null,"    ")),a.source&&l.createElement("p",null,s("ES_APPLICATION_DETAILS_APPLICATION_CHANNEL_"+a.source.toUpperCase())),a.comment&&l.createElement(kl,{otherComment:null==a?void 0:a.otherComment,headComment:null==a?void 0:a.comment}),null!=a&&a.wfComment?l.createElement("div",null,null==a||null===(n=a.wfComment)||void 0===n?void 0:n.map((e,t)=>l.createElement("div",{className:"TLComments",key:t},l.createElement("h3",null,s("WF_COMMON_COMMENTS")),l.createElement("p",{style:{overflowX:"scroll"}},e)))):null,(null==a||null===(i=a.thumbnailsToShow)||void 0===i||null===(r=i.thumbs)||void 0===r?void 0:r.length)>0?l.createElement("div",{className:"TLComments"},l.createElement("h3",null,s("CS_COMMON_ATTACHMENTS")),l.createElement(t.DisplayPhotos,{srcs:null==a?void 0:a.thumbnailsToShow.thumbs,onClick:(e,t)=>{u(e,t,null==a?void 0:a.thumbnailsToShow)}})):null)};function Ul(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 jl(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 Hl=e=>{var n,i,r,a;let{wsAdditionalDetails:u}=e;const{t:d}=o.useTranslation();let s=(c=location.search)?(/^[?#]/.test(c)?c.slice(1):c).split("&").reduce((e,t)=>{let[n,l]=t.split("=");return e[n]=l?decodeURIComponent(l.replace(/\+/g," ")):"",e},{}):{};var c;const p=null==s?void 0:s.mode;var{connectionDetails:v,plumberDetails:m,roadCuttingDetails:f,activationDetails:E}=(null==u?void 0:u.additionalDetails)||{connectionDetails:[],plumberDetails:[]};return l.createElement(l.Fragment,null,l.createElement("div",{style:{lineHeight:"19px",maxWidth:"950px",minWidth:"280px"}},(null==u||null===(n=u.additionalDetails)||void 0===n?void 0:n.connectionDetails)&&l.createElement(t.StatusTable,null,l.createElement(t.CardSubHeader,{style:{fontSize:"24px",marginBottom:"16px",marginTop:"32px"}},d("WS_COMMON_CONNECTION_DETAIL")),l.createElement("div",null,l.createElement("div",{className:"connection-details-new-value-wrapper"},null==v?void 0:v.map((e,n)=>l.createElement("div",{key:n},l.createElement(t.Row,{className:"border-none",key:""+e.title,label:""+d(""+e.title),text:null!=e&&e.oldValue?null==e?void 0:e.oldValue:null!=e&&e.value?null==e?void 0:e.value:""})))))),(null==u||null===(i=u.additionalDetails)||void 0===i?void 0:i.plumberDetails)&&"MODIFY"!=p&&l.createElement(t.StatusTable,null,l.createElement(t.CardSubHeader,{style:{fontSize:"24px",marginBottom:"16px",marginTop:"32px"}},d("WS_COMMON_PLUMBER_DETAILS")),l.createElement("div",null,l.createElement("div",{className:"plumber-details-new-value-wrapper"},null==m?void 0:m.map((e,n)=>l.createElement(t.Row,{className:"border-none",key:""+e.title,label:""+d(""+e.title),text:null!=e&&e.oldValue?null==e?void 0:e.oldValue:null!=e&&e.value?null==e?void 0:e.value:"",privacy:e.privacy}))))),(null==u||null===(r=u.additionalDetails)||void 0===r?void 0:r.roadCuttingDetails)&&"MODIFY"!=p&&l.createElement(t.StatusTable,null,l.createElement(t.CardSubHeader,{style:{fontSize:"24px",marginBottom:"16px",marginTop:"32px"}},d("WS_ROAD_CUTTING_DETAILS")),l.createElement("div",null,l.createElement("div",{className:"plumber-details-new-value-wrapper"},null==f?void 0:f.map((e,n)=>{var o;return l.createElement("div",{key:n,style:(null==f?void 0:f.length)>1?{border:"1px solid #D6D5D4",background:"#FAFAFA",borderRadius:"4px",padding:"10px 10px 0px 10px",margin:"5px 0px"}:{}},null==e||null===(o=e.values)||void 0===o?void 0:o.map(e=>l.createElement(t.Row,{className:"border-none",key:""+e.title,label:""+d(""+e.title),text:null!=e&&e.oldValue?null==e?void 0:e.oldValue:null!=e&&e.value?null==e?void 0:e.value:""})))})))),(null==u||null===(a=u.additionalDetails)||void 0===a?void 0:a.activationDetails)&&l.createElement(t.StatusTable,null,l.createElement(t.CardSubHeader,{style:{fontSize:"24px",marginBottom:"16px",marginTop:"32px"}},d("WS_ACTIVATION_DETAILS")),l.createElement("div",null,l.createElement("div",{className:"plumber-details-new-value-wrapper"},null==E?void 0:E.map((e,n)=>l.createElement(t.Row,{className:"border-none",key:""+e.title,label:""+d(""+e.title),text:null!=e&&e.oldValue?null==e?void 0:e.oldValue:null!=e&&e.value?null==e?void 0:e.value:""})))))))},Wl=[{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"}],Vl=[{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"}],$l=e=>{var i,r,a,u;let{wsAdditionalDetails:d}=e;const{t:s}=o.useTranslation(),[c,p,v]=Digit.Hooks.useSessionStorage("ADHOC_ADD_REBATE_DATA",{}),[m,f,E]=Digit.Hooks.useSessionStorage("ADHOC_BILL_ADD_REBATE_DATA",{}),y=!(null==d||null===(i=d.additionalDetails)||void 0===i||!i.isPaid),[g,h]=n.useState(!1),[S,b]=n.useState(c||{}),[T,C]=n.useState(null),[A,I]=n.useState(d.additionalDetails.data?d.additionalDetails.data:{}),[P,O]=n.useState(d.additionalDetails.values?d.additionalDetails.values:[]),D=Digit.ULBService.getStateId();Digit.Hooks.ws.useMDMS(D,"BillingService",["TaxHeadMaster"]),n.useEffect(()=>{var e,t,n;const o={...null==d||null===(e=d.additionalDetails)||void 0===e||null===(t=e.appDetails)||void 0===t?void 0:t.additionalDetails};if((null==c||null===(n=c.billDetails)||void 0===n?void 0:n.length)>0){var i,r,a,u,s,v,m;const e=[{title:"WS_APPLICATION_FEE_HEADER",value:l.createElement("span",null,"₹",null==c||null===(i=c.billDetails)||void 0===i||null===(r=i[0])||void 0===r?void 0:r.fee)},{title:"WS_SERVICE_FEE_HEADER",value:l.createElement("span",null,"₹",null==c||null===(a=c.billDetails)||void 0===a||null===(u=a[0])||void 0===u?void 0:u.charge)},{title:"WS_TAX_HEADER",value:l.createElement("span",null,"₹",null==c||null===(s=c.billDetails)||void 0===s||null===(v=s[0])||void 0===v?void 0:v.taxAmount)}];O(e),I(null==c||null===(m=c.billDetails)||void 0===m?void 0:m[0])}else p(o),b(o)},[]);let w={};const R=e=>l.createElement("h1",{className:"heading-m"},e.label),L=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),x=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(L,null)),M=function(e,t,n){void 0===t&&(t=!1);let l={...S};if("adhocPenalty"!=e&&"adhocRebate"!=e||!n.target.value)t?(l[e+"_data"]=n,l[e]=n.title,"PT_OTHERS"==n.title&&"adhocPenaltyReason"==e&&(l.adhocPenaltyComment=""),"PT_OTHERS"==n.title&&"adhocRebateReason"==e&&(l.adhocRebateComment="")):l[e]=n.target.value;else{var o,i;const t=0==(null==n||null===(o=n.target)||void 0===o?void 0:o.value)?1:Math.sign(null==n||null===(i=n.target)||void 0===i?void 0:i.value)||-1;l[e]=1==t?n.target.value:""}b(l)};return l.createElement(n.Fragment,null,l.createElement("div",{style:{lineHeight:"19px",maxWidth:"950px",minWidth:"280px"}},P&&l.createElement(t.StatusTable,null,l.createElement("div",null,null==P?void 0:P.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==A?void 0:A.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(y?"WS_COMMON_PAID_LABEL":"WS_COMMON_NOT_PAID"),textStyle:y?{color:"#00703C"}:{color:"#D4351C"}}))),null!=d&&null!==(r=d.additionalDetails)&&void 0!==r&&r.isAdhocRebate?l.createElement("div",{onClick:e=>{h(!0)}},l.createElement("span",{style:{cursor:"pointer",color:"#a82227"}},s("WS_PAYMENT_ADD_REBATE_PENALTY"))):null,g&&l.createElement(t.Modal,{headerBarMain:l.createElement(R,{label:s("PT_ADD_REBATE_PENALITY")}),headerBarEnd:l.createElement(x,{onClick:()=>{b(c),h(!1)}}),actionCancelLabel:s("PT_CANCEL"),actionCancelOnSubmit:()=>{b(c),h(!1)},actionSaveLabel:s("PT_ADD"),actionSaveOnSubmit:e=>(e=>{const t=null!=S&&S.adhocPenalty?Number(null==S?void 0:S.adhocPenalty):0,n=null!=S&&S.adhocRebate?Number(null==S?void 0:S.adhocRebate):0;var l,o;if(t||n)if(n>(null==d||null===(l=d.additionalDetails)||void 0===l||null===(o=l.data)||void 0===o?void 0:o.totalAmount))C({isError:!1,isWarning:!0,key:"error",message:s("ERR_WS_REBATE_GREATER_THAN_AMOUNT")});else{var i,r,a,u,c,v,m,E,y,g;const e=null==d||null===(i=d.additionalDetails)||void 0===i||null===(r=i.appDetails)||void 0===r?void 0:r.applicationNo,t=null==d||null===(a=d.additionalDetails)||void 0===a||null===(u=a.appDetails)||void 0===u?void 0:u.tenantId,n={...null==d||null===(c=d.additionalDetails)||void 0===c||null===(v=c.appDetails)||void 0===v?void 0:v.additionalDetails,...S};d.additionalDetails.appDetails.additionalDetails=n;const l={CalculationCriteria:"WATER"==(null==d||null===(m=d.additionalDetails)||void 0===m||null===(E=m.appDetails)||void 0===E?void 0:E.service)?[{applicationNo:e,tenantId:t,waterConnection:d.additionalDetails.appDetails}]:[{applicationNo:e,tenantId:t,sewerageConnection:d.additionalDetails.appDetails}],isconnectionCalculation:!1};let o="WATER"==(null==d||null===(y=d.additionalDetails)||void 0===y||null===(g=y.appDetails)||void 0===g?void 0:g.service)?"WS":"SW";Digit.WSService.wsCalculationEstimate(l,o).then((e,t)=>{var n,l,o,i,r,a,u,d,s,c,v,m,E,y,g;(null==e||null===(n=e.Calculation)||void 0===n||null===(l=n[0])||void 0===l||null===(o=l.taxHeadEstimates)||void 0===o?void 0:o.length)>0&&(null==e||null===(E=e.Calculation)||void 0===E||null===(y=E[0])||void 0===y||null===(g=y.taxHeadEstimates)||void 0===g||g.forEach(e=>e.amount=e.estimateAmount)),e.Calculation[0].billSlabData=_.groupBy(null==e||null===(i=e.Calculation)||void 0===i||null===(r=i[0])||void 0===r?void 0:r.taxHeadEstimates,"category");const b=[{title:"WS_APPLICATION_FEE_HEADER",value:null===(a=e.Calculation)||void 0===a||null===(u=a[0])||void 0===u?void 0:u.fee},{title:"WS_SERVICE_FEE_HEADER",value:null===(d=e.Calculation)||void 0===d||null===(s=d[0])||void 0===s?void 0:s.charge},{title:"WS_TAX_HEADER",value:null===(c=e.Calculation)||void 0===c||null===(v=c[0])||void 0===v?void 0:v.taxAmount}];f(Kn(e.Calculation[0])),I(null==e||null===(m=e.Calculation)||void 0===m?void 0:m[0]),O(b),S.billDetails=null==e?void 0:e.Calculation,p(S),h(!1)}).catch(e=>{var t,n,l,o,i,r;C({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===(o=e.response)||void 0===o||null===(i=o.data)||void 0===i||null===(r=i.Errors[0])||void 0===r?void 0:r.code)):s("PT_COMMON_ADD_REBATE_PENALITY")})})}else C({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:Wl,optionKey:"title",select:e=>M("adhocPenaltyReason",!0,e),selected:(null==S?void 0:S.adhocPenaltyReason_data)||"",isPropertyAssess:!0,name:"adhocPenaltyReason_data",t:s})),"PT_OTHERS"===(null==S||null===(a=S.adhocPenaltyReason_data)||void 0===a?void 0:a.title)&&l.createElement("div",{className:"field"},l.createElement(t.CardLabel,null,s("PT_REASON")),l.createElement("div",{className:"field"},l.createElement(t.TextInput,N({style:{background:"#FAFAFA"},t:s,type:"text",isMandatory:!1,name:"adhocPenaltyComment",value:(null==S?void 0:S.adhocPenaltyComment)||"",onChange:e=>M("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,N({style:{background:"#FAFAFA"},t:s,type:"number",isMandatory:!1,name:"adhocPenalty",value:(null==S?void 0:S.adhocPenalty)||"",onChange:e=>M("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:Vl,optionKey:"title",select:e=>M("adhocRebateReason",!0,e),selected:(null==S?void 0:S.adhocRebateReason_data)||"",name:"adhocRebateReason_data",isPropertyAssess:!0,t:s})),"PT_OTHERS"===(null==S||null===(u=S.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,N({style:{background:"#FAFAFA"},t:s,type:"text",isMandatory:!1,name:"adhocRebateComment",value:(null==S?void 0:S.adhocRebateComment)||"",onChange:e=>M("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,N({style:{background:"#FAFAFA"},t:s,type:"number",isMandatory:!1,name:"adhocRebate",value:(null==S?void 0:S.adhocRebate)||"",onChange:e=>M("adhocRebate",!1,e)},w={isRequired:!0,pattern:"^[1-9]+[0-9]*$",title:s("ERR_DEFAULT_INPUT_FIELD_MSG")})))))," "),T&&l.createElement(t.Toast,{style:{zIndex:"10000"},warning:null==T?void 0:T.isWarning,error:null==T||!T.isWarning,label:s(null==T?void 0:T.message),onClose:()=>{C(!1)},isDleteBtn:!0})))},zl=e=>{let{style:t}=e;return l.createElement("span",null,l.createElement("svg",{style:{...t},display:"inline",width:"22",height:"16",viewBox:"0 0 22 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l.createElement("path",{d:"M11 0.5C6 0.5 1.73 3.61 0 8C1.73 12.39 6 15.5 11 15.5C16 15.5 20.27 12.39 22 8C20.27 3.61 16 0.5 11 0.5ZM11 13C8.24 13 6 10.76 6 8C6 5.24 8.24 3 11 3C13.76 3 16 5.24 16 8C16 10.76 13.76 13 11 13ZM11 5C9.34 5 8 6.34 8 8C8 9.66 9.34 11 11 11C12.66 11 14 9.66 14 8C14 6.34 12.66 5 11 5Z",fill:"#a82227"})))},Yl=e=>{let{t:n,userType:o=!1,infoBannerLabel:i="",infoClickLable:r="",infoClickInfoLabel:a="",infoClickInfoLabel1:u=""}=e;o=o||Digit.SessionStorage.get("userType");const d=window.Digit.Utils.browser.isMobile();return l.createElement(l.Fragment,null,l.createElement("div",{style:d?{}:{width:"80%"}},l.createElement("div",{className:"info-banner-wrap",style:{color:"#3498DB",margin:"0px"}},l.createElement("div",null,l.createElement(t.InfoBannerIcon,null),l.createElement("h2",{style:{color:"#3498DB"}},n(i))),n(r)+" ",l.createElement(zl,{style:{display:"inline",marginBottom:"5px"}})," "+n(a),l.createElement("div",null," "+n(u)))))},Kl=e=>{var i,r,a,u,d,s,c;let{wsAdditionalDetails:p}=e;const{t:v}=o.useTranslation(),[m,f]=n.useState(!1),[E,y]=n.useState({}),_=e=>l.createElement("h1",{className:"heading-m"},e.label),g=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),h=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(g,null));return l.createElement(n.Fragment,null,l.createElement("div",{style:{lineHeight:"19px",maxWidth:"950px",minWidth:"280px"}},null!=p&&null!==(i=p.additionalDetails)&&void 0!==i&&i.isViewBreakup?l.createElement("div",{onClick:e=>(()=>{var e;let t=p.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),y(t),f(!0)})(),style:{marginTop:"12px"}},l.createElement("span",{style:{cursor:"pointer",color:"#a82227"}},v("WS_PAYMENT_VIEW_BREAKUP"))):null,m&&l.createElement(t.Modal,{headerBarMain:l.createElement(_,{label:v("WS_CALCULATION_BREAKUP")}),headerBarEnd:l.createElement(h,{onClick:()=>{f(!1)}}),hideSubmit:!0,popupStyles:{overflowY:"auto"},headerBarMainStyle:{marginBottom:"0px"},popupModuleMianStyles:{paddingTop:"0px"}},l.createElement(t.StatusTable,{style:{padding:"10px",paddingTop:"0px"}},l.createElement(t.CardSectionHeader,{style:{margin:"10px 0px"}},v("WS_APPLICATION_FEE_HEADER")),null==E||null===(r=E.billSlabData)||void 0===r||null===(a=r.FEE)||void 0===a?void 0:a.map(e=>l.createElement(t.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:""+(null==e?void 0:e.taxHeadCode),label:""+v(""+(null==e?void 0:e.taxHeadCode)),text:l.createElement("span",null,"₹",Number(null==e?void 0:e.amount)||0),textStyle:{textAlign:"right"}})),l.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",marginBottom:"10px"}}),l.createElement(t.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:"PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT1",label:""+v("PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT"),text:l.createElement("span",null,"₹",Number(null==E?void 0:E.fee)||0),textStyle:{textAlign:"right",fontWeight:"700",fontSize:"24px"}}),l.createElement(t.CardSectionHeader,{style:{margin:"10px 0px"}},v("WS_SERVICE_FEE_HEADER")),null==E||null===(u=E.billSlabData)||void 0===u||null===(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:""+v(""+(null==e?void 0:e.taxHeadCode)),text:l.createElement("span",null,"₹",Number(null==e?void 0:e.amount)||0),textStyle:{textAlign:"right"}})),l.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",marginBottom:"10px"}}),l.createElement(t.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:"PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT2",label:""+v("PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT"),text:l.createElement("span",null,"₹",Number(null==E?void 0:E.charge)||0),textStyle:{textAlign:"right",fontWeight:"700",fontSize:"24px"}}),null==E||null===(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:""+v(""+(null==e?void 0:e.taxHeadCode)),text:l.createElement("span",null,"₹",Number(null==e?void 0:e.amount)||0),textStyle:{textAlign:"right"}})),l.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",marginBottom:"10px"}}),l.createElement(t.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:"PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT3",label:""+v("PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT"),text:l.createElement("span",null,"₹",Number(null==E?void 0:E.totalAmount)||0),textStyle:{textAlign:"right",fontWeight:"700",fontSize:"24px"}})))))},ql={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:{}},Gl=e=>{let{className:t="table",headers:n=[],values:i=[],arrears:r=0}=e;const{t:a}=o.useTranslation();return l.createElement(l.Fragment,null,l.createElement("div",{style:ql.root},l.createElement("table",{className:"table-fixed-column-common-pay",style:ql.table},l.createElement("thead",null,l.createElement("tr",null,l.createElement("th",{style:{...ql.cell,...ql.cellLeft,...ql.cellHeader}},a("CS_BILL_PERIOD")),n.map((e,t)=>l.createElement("th",{style:{...ql.cell,...n.length==t+1?ql.cellRight:{},...ql.cellHeader},key:t},a(e))))),l.createElement("tbody",null,Object.values(i).map((e,t)=>l.createElement("tr",{key:t},l.createElement("td",{style:{...ql.cell,...ql.cellLeft},component:"th",scope:"row"},Object.keys(i)[t]),n.map((t,o)=>l.createElement("td",{style:{...ql.cell,textAlign:"left",...n.length==o+1?ql.cellRight:{},whiteSpace:"pre"},key:o,numeric:!0},o>1&&"₹",e[t]&&e[t].value||"0")))),l.createElement("tr",null,l.createElement("td",{style:{...ql.cell,...ql.cellLeft}}),n.map((e,t)=>t==n.length-1?l.createElement("td",{style:{...ql.cell,...ql.cellRight,textAlign:"left",fontWeight:"700",whiteSpace:"pre"},key:t,numeric:!0},r):t==n.length-2?l.createElement("td",{style:{...ql.cell,textAlign:"left"},key:t,numeric:!0},a("COMMON_ARREARS_TOTAL")):l.createElement("td",{style:ql.cell,key:t,numeric:!0})))))))},Zl={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))"}},Xl=e=>{var t,i,r;let{bill:a={}}=e;const{t:u}=o.useTranslation();let d={},s=(null==a||null===(t=a.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)=>0===n?e:e+t.amount,0))||0;let p="₹ "+((null==c||null===(r=c.toFixed)||void 0===r?void 0:r.call(c,0))||Number(0).toFixed(0));s.shift(),s.map(e=>{let t=function(e){var t,n,l;void 0===e&&(e={});let o={};const{billAccountDetails:i=[]}=e;return i.map(e=>{o[e.taxHeadCode]={value:e.amount,order:e.order}}),o.CS_BILL_NO={value:(null===(t=e)||void 0===t?void 0:t.billNumber)||"NA",order:-2},o.CS_BILL_DUEDATE={value:(null===(n=e)||void 0===n?void 0:n.expiryDate)&&new Date(null===(l=e)||void 0===l?void 0:l.expiryDate).toLocaleDateString()||"NA",order:-1},o.TL_COMMON_TOTAL_AMT={value:e.amount,order:10},o}(e);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 v={};!d||Object.keys(d).map((e,t)=>{Object.keys(d[e]).map(t=>{v[t]=d[e]&&d[e][t]&&d[e][t].order||0})});let m=[];m=Object.keys(v),m.sort((e,t)=>v[e]-v[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:Zl.headerStyle},u("CS_ARREARS_DETAILS")),f&&l.createElement(Gl,{headers:[...m],values:d,arrears:p}),!f&&l.createElement("div",{style:Zl.buttonStyle},l.createElement("button",{type:"button",onClick:()=>{E(!0)}},u("CS_SHOW_CARD"))),f&&l.createElement("div",{style:Zl.buttonStyle},l.createElement("button",{type:"button",onClick:()=>{E(!1)}},u("CS_HIDE_CARD"))))},Jl=()=>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"})),Ql=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(Jl,null)),eo=e=>{let{t:n,closeModal:o}=e;console.log(" ----- Renew POP coming "),Digit.Hooks.sv.useCreateDemand();const i=r.useHistory();return l.createElement(l.Fragment,null,l.createElement(t.Modal,{headerBarMain:l.createElement(e=>l.createElement("h1",{className:"heading-m"},e.label),{label:"SV_WANT_TO_EDIT"}),headerBarEnd:l.createElement(Ql,{onClick:o}),actionCancelLabel:n("CS_COMMON_BACK"),actionCancelOnSubmit:o,hideSubmit:!0,formId:"modal-action"},l.createElement(t.Card,{style:{boxShadow:"none"}},l.createElement("div",{style:{display:"flex",justifyContent:"center",gap:"20px",flexDirection:"column",alignItems:"center"}},l.createElement(t.SubmitBar,{label:n("SV_YES_PROCEED_WITH_APPLICATION"),onSubmit:()=>{i.push("renew-application/info")}}),l.createElement(t.SubmitBar,{label:n("SV_NO_PROCEED_PAYEMNT"),onSubmit:()=>{console.log(" testing coming compilter"),i.push("renew-application/check/makePayment")}})))))};function to(e){var i,a,u,d,s,c,p,v,m,f,E,y,g,h;let{applicationDetails:S,workflowDetails:b,isDataLoading:T,applicationData:C,timelineStatusPrefix:A,showTimeLine:N=!0,statusAttribute:I="status",paymentsList:P,oldValue:O,isInfoLabel:D=!1}=e;const{t:w}=o.useTranslation(),R=(r.useHistory(),r.useLocation()),[L,x]=n.useState(!1),[M,F]=n.useState(null);new URLSearchParams(R.search);let{id:k}=r.useParams();function B(e,t,n){var l;window.open(null==n||null===(l=n.fullImage)||void 0===l?void 0:l[0],"_blank")}const[U,j]=n.useState({}),[H,W]=n.useState({loading:!1,loaded:!1,canLoad:!1});"ACTIVE"!=(null==C?void 0:C.status)||H.loading||H.loaded||H.canLoad||W({loading:!1,loaded:!1,canLoad:!0}),null==H||!H.canLoad||H.loading||H.loaded||(W({loading:!0,loaded:!1,canLoad:!0}),function(e,t,n,l){try{Promise.resolve(Digit.PTService.assessmentSearch({tenantId:e,filters:{propertyIds:t}})).then(function(o){function i(){n(r),l({loading:!1,loaded:!0,canLoad:!0})}let r={};const a=function(n){if((null==o||null===(n=o.Assessments)||void 0===n?void 0:n.length)>0)return Promise.resolve(Digit.PaymentService.fetchBill(e,{businessService:"PT",consumerCode:t})).then(function(e){r=e})}();return a&&a.then?a.then(i):i()})}catch(e){return Promise.reject(e)}}((null==C?void 0:C.tenantId)||tenantId,null==C?void 0:C.propertyId,j,W));const V=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()}`},$=function(e,t,n){if(void 0===t&&(t=0),"OPEN"===e.state||"INITIATED"===e.status&&!window.location.href.includes("/obps/")){var o;const e={date:V(null==C||null===(o=C.auditDetails)||void 0===o?void 0:o.createdTime),source:(null==C?void 0:C.channel)||""};return l.createElement(Bl,{data:e})}if(window.location.href.includes("/obps/")||window.location.href.includes("/noc/")||window.location.href.includes("/ws/")){var i,r,a,u,d,s,c,p,v,m,f,E,y,g,h,b,T,A;const o={uuid:null==e||null===(i=e.assignes)||void 0===i||null===(r=i[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==S?void 0:S.tenantId,businessIds:null==S?void 0:S.applicationNo,history:!0},jsonPath:"ProcessInstances[0].assignes[0].mobileNumber",isArray:!1,d:e=>{let n="";return n="+91 "+_.get(e,`ProcessInstances[${t}].assignes[0].mobileNumber`),n}}},N=n[t-1],I={date:null==e||null===(a=e.auditDetails)||void 0===a?void 0:a.lastModified,name:null==e||null===(u=e.assignes)||void 0===u||null===(d=u[0])||void 0===d?void 0:d.name,mobileNumber:(null==C||null===(s=C.processInstance)||void 0===s||null===(c=s.assignes)||void 0===c||null===(p=c[0])||void 0===p?void 0:p.uuid)===(null==e||null===(v=e.assignes)||void 0===v||null===(m=v[0])||void 0===m?void 0:m.uuid)&&null!=C&&null!==(f=C.processInstance)&&void 0!==f&&null!==(E=f.assignes)&&void 0!==E&&null!==(y=E[0])&&void 0!==y&&y.mobileNumber?null==C||null===(g=C.processInstance)||void 0===g||null===(h=g.assignes)||void 0===h||null===(b=h[0])||void 0===b?void 0:b.mobileNumber:null==e||null===(T=e.assignes)||void 0===T||null===(A=T[0])||void 0===A?void 0:A.mobileNumber,comment:w(null==e?void 0:e.comment),wfComment:N?N.wfComment:[],thumbnailsToShow:null==e?void 0:e.thumbnailsToShow};return l.createElement(Bl,{data:I,OpenImage:B,privacy:o})}{var N,I,P,O,D;const t={date:V(null==C||null===(N=C.auditDetails)||void 0===N?void 0:N.lastModifiedTime),name:null==e||null===(I=e.assignes)||void 0===I||null===(P=I[0])||void 0===P?void 0:P.name,wfComment:null==e?void 0:e.wfComment,mobileNumber:null==e||null===(O=e.assignes)||void 0===O||null===(D=O[0])||void 0===D?void 0:D.mobileNumber,thumbnailsToShow:null==e?void 0:e.thumbnailsToShow};return l.createElement(Bl,{data:t,OpenImage:B})}},z=(e,t)=>e?t?e:w(e):w("NA"),Y=window.location.href.includes("employee/tl")||window.location.href.includes("employee/obps")||window.location.href.includes("employee/noc"),K=window.location.href.includes("employee/noc"),q=window.location.href.includes("employee/obps"),G=(window.location.href.includes("employee/ws"),()=>window.location.href.includes("employee/obps")||window.location.href.includes("employee/noc")||Y?{justifyContent:"space-between",fontSize:"16px",lineHeight:"19px",color:"#0B0C0C"}:{}),Z=e=>null!=e&&e.skip?e.value:null!=e&&e.isUnit?null!=e&&e.value?`${z(null==e?void 0:e.value,null==e?void 0:e.isNotTranslated)} ${w(null==e?void 0:e.isUnit)}`:w("N/A"):null!=e&&e.value?z(null==e?void 0:e.value,null==e?void 0:e.isNotTranslated):w("N/A"),[X,J]=n.useState(!1);return l.createElement(t.Card,{style:{position:"relative"},className:"employeeCard-override"},D?l.createElement(Yl,{t:w,userType:!1,infoBannerLabel:"CS_FILE_APPLICATION_INFO_LABEL",infoClickLable:"WS_CLICK_ON_LABEL",infoClickInfoLabel:window.location.href.includes("disconnection")||window.location.href.includes("application")?"WS_DISCONNECTION_CLICK_ON_INFO_LABEL":"WS_CLICK_ON_INFO_LABEL",infoClickInfoLabel1:window.location.href.includes("disconnection")||window.location.href.includes("application")?"WS_DISCONNECTION_CLICK_ON_INFO1_LABEL":""}):null,null==S||null===(i=S.applicationDetails)||void 0===i?void 0:i.map((e,n)=>{var o,i,a,u,d,s,c,p,v,m,f,E,y,_,g,h,T,C,A,N,I,D,R,L,M,B,j,H,W,V,$,z,X,J,Q,ee,te,ne,le,oe;return l.createElement(l.Fragment,{key:n},l.createElement("div",{style:window.location.href.includes("employee/obps")||window.location.href.includes("employee/noc")||window.location.href.includes("employee/ws")?{lineHeight:"19px",maxWidth:"950px",minWidth:"280px"}:Y?{lineHeight:"19px",maxWidth:"600px",minWidth:"280px"}:{}},(null==e||null===(o=e.title)||void 0===o?void 0:o.trim())&&(0!==n||e.asSectionHeader?l.createElement(t.CardSectionHeader,{style:0===n&&Y?{marginBottom:"16px",fontSize:"24px"}:{marginBottom:"16px",marginTop:"32px",fontSize:"24px"}},w(e.title),null!=e&&e.Component?l.createElement(e.Component,null):null):l.createElement(t.CardSubHeader,{style:{marginBottom:"16px",fontSize:"24px"}},w(e.title))),(null==e?void 0:e.isTable)&&l.createElement("table",{style:{tableLayout:"fixed",width:"100%",borderCollapse:"collapse",border:"1px solid black"}},l.createElement("tr",{style:{textAlign:"left"}},null==e?void 0:e.headers.map((e,t)=>l.createElement("th",{style:{padding:"10px",paddingLeft:"5px",border:"1px solid black"},key:t},w(e)))),null==e?void 0:e.tableRows.map((n,o)=>l.createElement("tr",{key:o},n.map((n,i)=>Array.isArray(n)&&n.length>1&&!0===e.isMaintenance?l.createElement("td",{style:{paddingTop:"20px",textAlign:"left",border:"1px solid black",verticalAlign:"middle"},key:i},l.createElement("div",{style:{display:"flex",flexWrap:"nowrap",gap:"5px"}},n.map((e,n)=>l.createElement("a",{key:n,onClick:()=>{Digit.UploadServices.Filefetch([e.fileStoreId],Digit.ULBService.getStateId()).then(e=>{var t,n,l;const o=null==e||null===(t=e.data)||void 0===t||null===(n=t.fileStoreIds)||void 0===n||null===(l=n[0])||void 0===l?void 0:l.url;if(o){const e=o.split(",")[0];e?window.open(e,"_blank"):console.error("No valid URL found to open!")}else console.error("URL is missing in the response!")}).catch(e=>{console.error("Error fetching file:",e)})},rel:"noopener noreferrer",style:{marginRight:"5px",display:"inline-block",cursor:"pointer"}},l.createElement(t.PDFSvg,{style:{width:"25px",height:"25px"}}))))):l.createElement("td",{key:i,style:{paddingTop:"20px",textAlign:"left",border:"1px solid black",verticalAlign:"middle"}},n&&!0===n.editButton?l.createElement("span",{style:{display:"inline-flex",gap:"10px",alignItems:"center"}},l.createElement(r.Link,{to:{pathname:"/digit-ui/employee/asset/assetservice/maintenance-edit/"+k,state:{data:n.data}}},l.createElement("button",null," ",l.createElement(t.EditIcon,null)," ")),l.createElement("div",{key:o,onClick:()=>(F(n.data),void x(!0)),style:{cursor:"pointer"}},l.createElement(t.ViewsIcon,null))):w(n)))))),l.createElement(t.StatusTable,{style:window.location.href.includes("employee/obps")||window.location.href.includes("employee/noc")||Y?{position:"relative",marginTop:"19px"}:{}},(null==e?void 0:e.title)&&!(null!=e&&e.title.includes("NOC"))&&(null==e||null===(i=e.values)||void 0===i?void 0:i.map((n,o)=>{var i,a,u;return!0===n.map&&"N/A"!==n.value?l.createElement(t.Row,{labelStyle:{wordBreak:"break-all"},textStyle:{wordBreak:"break-all"},key:w(n.title),label:w(n.title),text:l.createElement("img",{src:w(n.value),alt:"",privacy:null==n?void 0:n.privacy})}):!0===(null==n?void 0:n.isLink)?l.createElement(t.Row,{key:w(n.title),label:window.location.href.includes("tl")||window.location.href.includes("ws")?l.createElement("div",{style:{width:"200%"}},l.createElement(r.Link,{to:null==n?void 0:n.to},l.createElement("span",{className:"link",style:{color:"#a82227"}},w(null==n?void 0:n.title)))):K||q?""+w(n.title):w(n.title),text:l.createElement("div",null,l.createElement(r.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:G(),labelStyle:{wordBreak:"break-all"},textStyle:{wordBreak:"break-all"}}):l.createElement("div",{key:o},window.location.href.includes("modify")?l.createElement(t.Row,{className:"border-none",key:""+n.title,label:""+w(""+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:w(n.title),label:w(n.title),text:Z(n),last:o===(null==e||null===(i=e.values)||void 0===i?void 0:i.length)-1,caption:n.caption,className:"border-none",privacy:null==n?void 0:n.privacy,rowContainerStyle:G(),labelStyle:{wordBreak:"break-all",fontWeight:n.isBold?"bold":"normal",fontStyle:n.isBold?"italic":"normal"},textStyle:{wordBreak:"break-all",fontWeight:n.isBold?"bold":"normal",fontStyle:n.isBold?"italic":"normal"}}),"PT_TOTAL_DUES"===n.title?l.createElement(Xl,{bill:null===(a=U.Bill)||void 0===a?void 0:a[0]}):"")})))),(null==e?void 0:e.belowComponent)&&l.createElement(e.belowComponent,null),(null==e||null===(a=e.additionalDetails)||void 0===a?void 0:a.inspectionReport)&&l.createElement(Ml,{scrutinyDetails:null==e?void 0:e.additionalDetails,paymentsList:P}),(null==S||null===(u=S.applicationData)||void 0===u||null===(d=u.additionalDetails)||void 0===d||null===(s=d.fieldinspection_pending)||void 0===s?void 0:s.length)>0&&(null==e||null===(c=e.additionalDetails)||void 0===c?void 0:c.fiReport)&&l.createElement(Il,{fiReport:null==S||null===(p=S.applicationData)||void 0===p||null===(v=p.additionalDetails)||void 0===v?void 0:v.fieldinspection_pending}),(null==e||null===(m=e.additionalDetails)||void 0===m?void 0:m.floors)&&l.createElement(Ll,{floors:null==e||null===(f=e.additionalDetails)||void 0===f?void 0:f.floors}),(null==e||null===(E=e.additionalDetails)||void 0===E?void 0:E.owners)&&l.createElement(xl,{owners:null==e||null===(y=e.additionalDetails)||void 0===y?void 0:y.owners}),(null==e||null===(_=e.additionalDetails)||void 0===_?void 0:_.units)&&l.createElement(jl,{units:null==e||null===(g=e.additionalDetails)||void 0===g?void 0:g.units}),(null==e||null===(h=e.additionalDetails)||void 0===h?void 0:h.accessories)&&l.createElement(Ul,{units:null==e||null===(T=e.additionalDetails)||void 0===T?void 0:T.accessories}),(null==e||null===(C=e.additionalDetails)||void 0===C?void 0:C.permissions)&&(null==b||null===(A=b.data)||void 0===A||null===(N=A.nextActions)||void 0===N?void 0:N.length)>0&&l.createElement(Dl,{applicationData:null==S?void 0:S.applicationData,t:w,permissions:null==e||null===(I=e.additionalDetails)||void 0===I?void 0:I.permissions}),(null==e||null===(D=e.additionalDetails)||void 0===D?void 0:D.obpsDocuments)&&l.createElement(Al,{t:w,applicationData:null==S?void 0:S.applicationData,docs:e.additionalDetails.obpsDocuments,bpaActionsDetails:b}),(null==e||null===(R=e.additionalDetails)||void 0===R?void 0:R.noc)&&l.createElement(Ol,{t:w,isNoc:!0,NOCdata:e.values,applicationData:null==S?void 0:S.applicationData,docs:e.additionalDetails.noc,noc:null===(L=e.additionalDetails)||void 0===L?void 0:L.data,bpaActionsDetails:b}),(null==e||null===(M=e.additionalDetails)||void 0===M?void 0:M.scruntinyDetails)&&l.createElement(Ml,{scrutinyDetails:null==e?void 0:e.additionalDetails}),(null==e||null===(B=e.additionalDetails)||void 0===B?void 0:B.buildingExtractionDetails)&&l.createElement(Ml,{scrutinyDetails:null==e?void 0:e.additionalDetails}),(null==e||null===(j=e.additionalDetails)||void 0===j?void 0:j.subOccupancyTableDetails)&&l.createElement(Fl,{edcrDetails:null==e?void 0:e.additionalDetails,applicationData:null==S?void 0:S.applicationData}),(null==e||null===(H=e.additionalDetails)||void 0===H?void 0:H.documentsWithUrl)&&l.createElement(Cl,{documents:null==e||null===(W=e.additionalDetails)||void 0===W?void 0:W.documentsWithUrl}),(null==e||null===(V=e.additionalDetails)||void 0===V?void 0:V.documents)&&l.createElement(wl,{documents:null==e||null===($=e.additionalDetails)||void 0===$?void 0:$.documents}),(null==e||null===(z=e.additionalDetails)||void 0===z?void 0:z.taxHeadEstimatesCalculation)&&l.createElement(Rl,{taxHeadEstimatesCalculation:null==e||null===(X=e.additionalDetails)||void 0===X?void 0:X.taxHeadEstimatesCalculation}),(null==e?void 0:e.isWaterConnectionDetails)&&l.createElement(Hl,{wsAdditionalDetails:e,oldValue:O}),(null==e||null===(J=e.additionalDetails)||void 0===J?void 0:J.redirectUrl)&&l.createElement("div",{style:{fontSize:"16px",lineHeight:"24px",fontWeight:"400",padding:"10px 0px"}},l.createElement(r.Link,{to:null==e||null===(Q=e.additionalDetails)||void 0===Q||null===(ee=Q.redirectUrl)||void 0===ee?void 0:ee.url},l.createElement("span",{className:"link",style:{color:"#a82227"}},null==e||null===(te=e.additionalDetails)||void 0===te||null===(ne=te.redirectUrl)||void 0===ne?void 0:ne.title))),(null==e||null===(le=e.additionalDetails)||void 0===le?void 0:le.estimationDetails)&&l.createElement($l,{wsAdditionalDetails:e,workflowDetails:b}),(null==e||null===(oe=e.additionalDetails)||void 0===oe?void 0:oe.estimationDetails)&&l.createElement(Kl,{wsAdditionalDetails:e,workflowDetails:b}))}),N&&(null==b||null===(a=b.data)||void 0===a||null===(u=a.timeline)||void 0===u?void 0:u.length)>0&&l.createElement(l.Fragment,null,l.createElement(t.BreakLine,null),((null==b?void 0:b.isLoading)||T)&&l.createElement(t.Loader,null),!(null!=b&&b.isLoading)&&!T&&l.createElement(n.Fragment,null,l.createElement("div",{id:"timeline"},l.createElement(t.CardSectionHeader,{style:{marginBottom:"16px",marginTop:"32px"}},w("ES_APPLICATION_DETAILS_APPLICATION_TIMELINE")),null!=b&&null!==(d=b.data)&&void 0!==d&&d.timeline&&1===(null==b||null===(s=b.data)||void 0===s||null===(c=s.timeline)||void 0===c?void 0:c.length)?l.createElement(t.CheckPoint,{isCompleted:!0,label:w(`${A}${null==b||null===(p=b.data)||void 0===p||null===(v=p.timeline[0])||void 0===v?void 0:v.state}`),customChild:$(null==b||null===(m=b.data)||void 0===m?void 0:m.timeline[0],null==b||null===(f=b.data)||void 0===f?void 0:f.timeline)}):l.createElement(t.ConnectingCheckPoints,null,(null==b||null===(E=b.data)||void 0===E?void 0:E.timeline)&&(null==b||null===(y=b.data)||void 0===y?void 0:y.timeline.slice(0,X?null==b?void 0:b.data.timeline.length:2).map((e,n,o)=>{var i;let r="";var a,u,d,s,c,p;return window.location.href.includes("/obps/")&&(r=null!=b&&null!==(a=b.data)&&void 0!==a&&null!==(u=a.timeline[n-1])&&void 0!==u&&null!==(d=u.state)&&void 0!==d&&d.includes("BACK_FROM")||null!=b&&null!==(s=b.data)&&void 0!==s&&null!==(c=s.timeline[n-1])&&void 0!==c&&null!==(p=c.state)&&void 0!==p&&p.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:w(`${A}${"REOPEN"===(null==e?void 0:e.performedAction)?null==e?void 0:e.performedAction:null==e?void 0:e[I]}${r}`),customChild:$(e,n,null==b||null===(i=b.data)||void 0===i?void 0:i.timeline)}))}))),(null==b||null===(g=b.data)||void 0===g||null===(h=g.timeline)||void 0===h?void 0:h.length)>2&&l.createElement(t.LinkButton,{label:w(X?"COLLAPSE":"VIEW_TIMELINE"),onClick:()=>{J(e=>!e)}})))),l.createElement("div",null,L&&l.createElement(eo,{t:w,closeModal:()=>setRnewButton(!1),actionCancelOnSubmit:()=>setRnewButton(!1),application:application})))}function no(e){var n,o,i,r,a,u,d,s,c,p,v,m,f,E,y,_,g,h;let{t:S,showToast:b,closeToast:T,businessService:C}=e;if(null!=C&&C.includes("NewTL")||null!=C&&C.includes("TL")||null!=C&&C.includes("EDITRENEWAL")){var A;let e="";switch(null==b||null===(A=b.action)||void 0===A?void 0:A.action){case"SENDBACK":e="error"===(null==b?void 0:b.key)?null==b||null===(n=b.error)||void 0===n?void 0:n.message:S("TL_SENDBACK_CHECKLIST_MESSAGE_HEAD");break;case"FORWARD":e="error"===(null==b?void 0:b.key)?null==b||null===(o=b.error)||void 0===o?void 0:o.message:S("TL_FORWARD_SUCCESS_MESSAGE_MAIN");break;case"APPROVE":e="error"===(null==b?void 0:b.key)?null==b||null===(i=b.error)||void 0===i?void 0:i.message:S("TL_APPROVAL_CHECKLIST_MESSAGE_HEAD");break;case"SENDBACKTOCITIZEN":e="error"===(null==b?void 0:b.key)?null==b||null===(r=b.error)||void 0===r?void 0:r.message:S("TL_SENDBACK_TOCITIZEN_CHECKLIST_MESSAGE_HEAD");break;case"REJECT":e="error"===(null==b?void 0:b.key)?null==b||null===(a=b.error)||void 0===a?void 0:a.message:S("TL_APPROVAL_REJ_MESSAGE_HEAD");break;case"RESUBMIT":e="error"===(null==b?void 0:b.key)?null==b||null===(u=b.error)||void 0===u?void 0:u.message:S("TL_APPLICATION_RESUBMIT_SUCCESS_MESSAGE_MAIN");break;case"CANCEL":e="error"===(null==b?void 0:b.key)?null==b||null===(d=b.error)||void 0===d?void 0:d.message:S("TL_TL_CANCELLED_MESSAGE_HEAD");break;default:e="error"===(null==b?void 0:b.key)?null==b||null===(s=b.error)||void 0===s?void 0:s.message:S(`ES_${C}_${null==b||null===(c=b.action)||void 0===c?void 0:c.action}_UPDATE_SUCCESS`)}return l.createElement(l.Fragment,null,b&&l.createElement(t.Toast,{error:"error"===b.key,label:e,onClose:T}))}if(null!=C&&C.includes("BPA")||null!=C&&C.includes("BPA_LOW")||null!=C&&C.includes("BPA_OC")){var N;const e=function(e){var t;void 0===e&&(e=[]);let n=e[0];return n=2==(null===(t=e)||void 0===t?void 0:t.length)&&null!=C&&C.includes("BPA_OC")?S(e[1]):S(e[0]),n};let n="";switch(null==b||null===(N=b.action)||void 0===N?void 0:N.action){case"REVOCATE":n="error"===(null==b?void 0:b.key)?null==b||null===(p=b.error)||void 0===p?void 0:p.message:e(["BPA_APPROVAL_REVOCATED_MESSAGE_HEAD","BPA_APPROVAL_OC_REVOCATED_MESSAGE_HEAD"]);break;case"VERIFY_AND_FORWARD":n="error"===(null==b?void 0:b.key)?null==b||null===(v=b.error)||void 0===v?void 0:v.message:e(["BPA_FORWARD_SUCCESS_MESSAGE_MAIN"]);break;case"SEND_BACK_TO_CITIZEN":n="error"===(null==b?void 0:b.key)?null==b||null===(m=b.error)||void 0===m?void 0:m.message:e(["BPA_SENDBACK_SUCCESS_MESSAGE_MAIN"]);break;case"APPROVE":n="error"===(null==b?void 0:b.key)?null==b||null===(f=b.error)||void 0===f?void 0:f.message:e(["BPA_APPROVAL_CHECKLIST_MESSAGE_HEAD"]);break;case"REJECT":n="error"===(null==b?void 0:b.key)?null==b||null===(E=b.error)||void 0===E?void 0:E.message:e(["BPA_APPROVAL_REJECTED_MESSAGE_HEAD","BPA_OC_APPROVAL_REJECTED_MESSAGE_HEAD"]);break;case"FORWARD":n="error"===(null==b?void 0:b.key)?null==b||null===(y=b.error)||void 0===y?void 0:y.message:e(["BPA_FORWARD_SUCCESS_MESSAGE_MAIN"]);break;case"SEND_BACK_FOR_DOCUMENT_VERIFICATION":case"SEND_BACK_FOR_FIELD_INSPECTION":n="error"===(null==b?void 0:b.key)?null==b||null===(_=b.error)||void 0===_?void 0:_.message:e(["BPA_SENDBACK_SUCCESS_MESSAGE_MAIN"]);break;default:n="error"===(null==b?void 0:b.key)?null==b||null===(g=b.error)||void 0===g?void 0:g.message:S(`ES_${C}_${null==b||null===(h=b.action)||void 0===h?void 0:h.action}_UPDATE_SUCCESS`)}return l.createElement(l.Fragment,null,b&&l.createElement(t.Toast,{error:"error"===b.key,label:n,onClose:T}))}{var I,P;const e="error"===(null==b?void 0:b.key)?null==b||null===(I=b.error)||void 0===I?void 0:I.message:`ES_${C}_${null==b||null===(P=b.action)||void 0===P?void 0:P.action}_UPDATE_SUCCESS`;return l.createElement(l.Fragment,null,b&&l.createElement(t.Toast,{error:"error"===b.key,label:S(e),onClose:T}))}}function lo(e){var i,r,a,u,d,s,c,p,v,m,f,E,y,_,g,h,S,b,T;let{workflowDetails:C,displayMenu:A,onActionSelect:N,setDisplayMenu:I,businessService:P,forcedActionPrefix:O,ActionBarStyle:D={},MenuStyle:w={},isAction:R,applicationDetails:L}=e;const{t:x}=o.useTranslation();let M=Digit.UserService.getUser();const F=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):{};M=null==t?void 0:t.value}const k=null===(i=M)||void 0===i||null===(r=i.info)||void 0===r||null===(a=r.roles)||void 0===a?void 0:a.map(e=>e.code);let B=!1,U=!1,j=(null==C||null===(u=C.data)||void 0===u||null===(d=u.actionState)||void 0===d||null===(s=d.nextActions)||void 0===s?void 0:s.filter(e=>(null==k?void 0:k.some(t=>{var n;return null===(n=e.roles)||void 0===n?void 0:n.includes(t)}))||!e.roles))||(null==C||null===(c=C.data)||void 0===c||null===(p=c.nextActions)||void 0===p?void 0:p.filter(e=>(null==k?void 0:k.some(t=>{var n;return null===(n=e.roles)||void 0===n?void 0:n.includes(t)}))||!e.roles));Digit.Hooks.useClickOutside(F,()=>{I(!1)},A),(window.location.href.includes("/obps")||window.location.href.includes("/noc"))&&1==(null==j?void 0:j.length)||null!=j&&null!==(v=j[0])&&void 0!==v&&null!==(m=v.redirectionUrl)&&void 0!==m&&m.pathname.includes("/pt/property-details/")&&1==(null==j?void 0:j.length)?(U=!1,B=!0):(null==j?void 0:j.length)>0&&(U=!0,B=!1);const H=Digit.SessionStorage.get("User"),W=null==H||null===(f=H.info)||void 0===f?void 0:f.uuid,V=null==L||null===(E=L.applicationData)||void 0===E||null===(y=E.auditDetails)||void 0===y?void 0:y.lastModifiedBy;return l.createElement(l.Fragment,null,!(null!=C&&C.isLoading)&&U&&!B&&!R&&l.createElement(t.ActionBar,{style:{...D}},A&&(null!=C&&null!==(_=C.data)&&void 0!==_&&null!==(g=_.actionState)&&void 0!==g&&g.nextActions||null!=C&&null!==(h=C.data)&&void 0!==h&&h.nextActions)?l.createElement(t.Menu,{localeKeyPrefix:O||"WF_EMPLOYEE_"+(null==P?void 0:P.toUpperCase()),options:j,optionKey:"action",t:x,onSelect:N,style:w}):null,"ewst"===P?V===W||null==V?l.createElement(t.SubmitBar,{ref:F,label:x("WF_TAKE_ACTION"),onSubmit:()=>I(!A)}):l.createElement(t.CardLabel,{style:{color:"red",font:"30px",fontWeight:"bold"}},""+x("EW_ALERT_ANOTHER_VENDOR")):l.createElement(t.SubmitBar,{ref:F,label:x("WF_TAKE_ACTION"),onSubmit:()=>I(!A)})),!(null!=C&&C.isLoading)&&!U&&B&&!R&&l.createElement(t.ActionBar,{style:{...D}},l.createElement("button",{style:{color:"#FFFFFF",fontSize:"18px"},className:"submit-bar",name:null==j||null===(S=j[0])||void 0===S?void 0:S.action,value:null==j||null===(b=j[0])||void 0===b?void 0:b.action,onClick:e=>{N((null==j?void 0:j[0])||{})}},x(`${O||"WF_EMPLOYEE_"+(null==P?void 0:P.toUpperCase())}_${null==j||null===(T=j[0])||void 0===T?void 0:T.action}`))))}const oo=()=>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"})),io=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(oo,null));function ro(e){let{action:n,closeWarningPopup:i}=e;const{t:r}=o.useTranslation(),a=window.Digit.Utils.browser.isMobile();return l.createElement(l.Fragment,null,l.createElement(t.Modal,{headerBarMain:l.createElement("h1",{className:"heading-m"},r("PT_DUES_ARE_PENDING")),headerBarEnd:l.createElement(io,{onClick:()=>{i()}}),hideSubmit:!0,isDisabled:!1,popupStyles:a?{}:{width:"29%",marginTop:"auto"}},l.createElement(t.Card,null,l.createElement("div",{style:{marginBottom:"30px"}},l.createElement("h1",null,r("PT_YOU_HAVE")," ₹",null==n?void 0:n.AmountDueForPay," ",r("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:""+r("PT_AMOUNT_DUE"),text:"₹"+r(null==n?void 0:n.AmountDueForPay)}),l.createElement("div",{style:{width:"100%",display:"flex",justifyContent:"flex-end"}},l.createElement(t.ButtonSelector,{theme:"border",label:r("ES_PT_COMMON_CANCEL"),onSubmit:i,style:{marginLeft:"10px"}}),l.createElement(t.ButtonSelector,{label:r("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 ao=e=>{var i;const u=Digit.ULBService.getCurrentTenantId(),d=Digit.ULBService.getStateId(),{t:s}=o.useTranslation(),c=r.useHistory();let{id:p}=r.useParams();const[v,m]=n.useState(!1),[f,E]=n.useState(null),[y,_]=n.useState(!1),[g,h]=n.useState(!1),[S,b]=n.useState(!1),{applicationDetails:T,showToast:C,setShowToast:A,isLoading:N,isDataLoading:I,applicationData:P,mutate:O,nocMutation:D,workflowDetails:w,id:R,businessService:L,closeToast:x,moduleCode:M,timelineStatusPrefix:F,forcedActionPrefix:k,statusAttribute:B,ActionBarStyle:U,MenuStyle:j,paymentsList:H,showTimeLine:W=!0,oldValue:V,isInfoLabel:$=!1,clearDataDetails:z,isAction:Y=!1}=e;n.useEffect(()=>{C&&w.revalidate()},[C]);const K=a.useQueryClient(),q=()=>{E(null),_(!1)};return N||g?l.createElement(t.Loader,null):l.createElement(l.Fragment,null,N?l.createElement(t.Loader,null):l.createElement(l.Fragment,null,l.createElement(to,{applicationDetails:T,id:R,workflowDetails:w,isDataLoading:I,applicationData:P,businessService:L,timelineStatusPrefix:F,statusAttribute:B,paymentsList:H,showTimeLine:W,oldValue:V,isInfoLabel:$}),y?l.createElement(Tl,{t:s,action:f,tenantId:u,state:d,id:p,applicationDetails:T,applicationData:null==T?void 0:T.applicationData,closeModal:q,submitAction:function(e,t,n){void 0===t&&(t=!1),void 0===n&&(n={});try{let l=!1;const o=function(o,i,r,a,u,d,p,v,m,E,y,_){if(0!=(null==e||null===(o=e.Property)||void 0===o||null===(i=o.workflow)||void 0===i||null===(r=i.comment)||void 0===r?void 0:r.length)&&0!=(null==e||null===(a=e.Licenses)||void 0===a||null===(u=a[0])||void 0===u||null===(d=u.comment)||void 0===d?void 0:d.length)&&0!=(null==e||null===(p=e.WaterConnection)||void 0===p||null===(v=p.comment)||void 0===v?void 0:v.length)&&0!=(null==e||null===(m=e.SewerageConnection)||void 0===m||null===(E=m.comment)||void 0===E?void 0:E.length)&&0!=(null==e||null===(y=e.BPA)||void 0===y||null===(_=y.comment)||void 0===_?void 0:_.length)){function g(t){if(l)return t;O&&(h(!0),O(e,{onError:(e,t)=>{h(!1),A({key:"error",error:e}),setTimeout(x,5e3)},onSuccess:(e,t)=>{var l,o,i,r,a,u,d,p,v,m,E,y;sessionStorage.removeItem("WS_SESSION_APPLICATION_DETAILS"),h(!1),null!==(l=n)&&void 0!==l&&l.bpa&&(e.selectedAction=f,c.replace("/digit-ui/employee/obps/response",{data:e})),null!==(o=n)&&void 0!==o&&o.isStakeholder&&(e.selectedAction=f,c.push("/digit-ui/employee/obps/stakeholder-response",{data:e})),null!==(i=n)&&void 0!==i&&i.isNoc&&c.push("/digit-ui/employee/noc/response",{data:e}),(null==e||null===(r=e.Amendments)||void 0===r?void 0:r.length)>0?null!=t&&null!==(a=t.AmendmentUpdate)&&void 0!==a&&null!==(u=a.workflow)&&void 0!==u&&u.action.includes("SEND_BACK")?A({key:"success",label:s("ES_MODIFYSWCONNECTION_SEND_BACK_UPDATE_SUCCESS")}):null!=t&&null!==(d=t.AmendmentUpdate)&&void 0!==d&&null!==(p=d.workflow)&&void 0!==p&&p.action.includes("RE-SUBMIT")?A({key:"success",label:s("ES_MODIFYSWCONNECTION_RE_SUBMIT_UPDATE_SUCCESS")}):null!=t&&null!==(v=t.AmendmentUpdate)&&void 0!==v&&null!==(m=v.workflow)&&void 0!==m&&m.action.includes("APPROVE")?A({key:"success",label:s("ES_MODIFYSWCONNECTION_APPROVE_UPDATE_SUCCESS")}):null!=t&&null!==(E=t.AmendmentUpdate)&&void 0!==E&&null!==(y=E.workflow)&&void 0!==y&&y.action.includes("REJECT")&&A({key:"success",label:s("ES_MODIFYWSCONNECTION_REJECT_UPDATE_SUCCESS")}):(A({key:"success",action:f}),z&&setTimeout(z,3e3),setTimeout(x,5e3),K.clear(),K.refetchQueries("APPLICATION_SEARCH"))}})),q()}h(!0),"function"==typeof(null==e?void 0:e.customFunctionToExecute)&&(null==e||e.customFunctionToExecute({...e}));const o=function(){if(!1!==t&&D){var e;const n=null===(e=t)||void 0===e?void 0:e.map(e=>null==D?void 0:D.mutateAsync(e)),o=Ie(function(){return h(!0),Promise.resolve(Promise.all(n)).then(function(e){e&&e.map(e=>{var t,n;Digit.SessionStorage.del(null==e||null===(t=e.Noc)||void 0===t||null===(n=t[0])||void 0===n?void 0:n.nocType)})})},function(e){var t,n,o,i,r,a,u,d,c,p,v,m;h(!1);let f=null!=e&&null!==(t=e.response)&&void 0!==t&&null!==(n=t.data)&&void 0!==n&&null!==(o=n.Errors)&&void 0!==o&&null!==(i=o[0])&&void 0!==i&&i.code?s(null==e||null===(r=e.response)||void 0===r||null===(a=r.data)||void 0===a||null===(u=a.Errors)||void 0===u||null===(d=u[0])||void 0===d?void 0:d.code):(null==e||null===(c=e.response)||void 0===c||null===(p=c.data)||void 0===p||null===(v=p.Errors)||void 0===v||null===(m=v[0])||void 0===m?void 0:m.message)||e;q(),A({key:"error",error:{message:f}}),setTimeout(x,5e3),l=!0});if(o&&o.then)return o.then(function(){})}}();return o&&o.then?o.then(g):g(o)}alert("Please fill in the comments before submitting")}();return Promise.resolve(o&&o.then?o.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},actionData:null==w||null===(i=w.data)||void 0===i?void 0:i.timeline,businessService:L,workflowDetails:w,moduleCode:M,cardFormWrapperClassName:"modal-form"}):null,S?l.createElement(ro,{action:f,workflowDetails:w,businessService:L,isWarningPop:S,closeWarningPopup:()=>{b(!1)}}):null,l.createElement(no,{t:s,showToast:C,closeToast:x,businessService:L}),l.createElement(lo,{isAction:Y,workflowDetails:w,displayMenu:v,onActionSelect:function(e){if(sessionStorage.setItem("SELECTED_ACTION",null==e?void 0:e.action),e)if(null!=e&&e.isToast)A({key:"error",error:{message:null==e?void 0:e.toastMessage}}),setTimeout(x,5e3);else if(null!=e&&e.isWarningPopUp)b(!0);else if(null!=e&&e.redirectionUrll){var t,n,l,o,i;if("ACTIVATE_CONNECTION"===(null==e||null===(t=e.redirectionUrll)||void 0===t?void 0:t.action))c.push(""+(null==e||null===(l=e.redirectionUrll)||void 0===l?void 0:l.pathname),JSON.stringify({data:null==e||null===(o=e.redirectionUrll)||void 0===o?void 0:o.state,url:`${null===(i=location)||void 0===i?void 0:i.pathname}${location.search}`}));else if("RE-SUBMIT-APPLICATION"===(null==e||null===(n=e.redirectionUrll)||void 0===n?void 0:n.action)){var r,a;c.push(""+(null==e||null===(r=e.redirectionUrll)||void 0===r?void 0:r.pathname),{data:null==e||null===(a=e.redirectionUrll)||void 0===a?void 0:a.state})}else{var u;window.location.assign(`${window.location.origin}/digit-ui/employee/payment/collect/${null==e||null===(u=e.redirectionUrll)||void 0===u?void 0:u.pathname}`)}}else if(null!=e&&e.redirectionUrl){var d,s;c.push({pathname:null===(d=e.redirectionUrl)||void 0===d?void 0:d.pathname,state:{...null===(s=e.redirectionUrl)||void 0===s?void 0:s.state}})}else _(!0);E(e),m(!1)},setDisplayMenu:m,businessService:L,forcedActionPrefix:k,ActionBarStyle:U,MenuStyle:j,applicationDetails:T})))},uo=()=>{var e;const{t:i}=o.useTranslation(),{propertyId:a,tenantId:u,redirectToUrl:d}=Digit.Hooks.useQueryParams(),{isLoading:s,data:c}=Digit.Hooks.pt.useGenericViewProperty(i,u,a,{}),{state:p}=r.useLocation(),v=r.useHistory();return n.useEffect(()=>{"true"===sessionStorage.getItem("isCreateEnabledEmployee")?(sessionStorage.removeItem("isCreateEnabledEmployee"),v.replace("/digit-ui/employee")):sessionStorage.removeItem("isCreateEnabledEmployee")}),l.createElement("div",null,l.createElement("div",null,l.createElement(t.Header,null,i("PT_PROPERTY_INFO_HEADER"))),l.createElement(ao,{applicationDetails:c,isLoading:s,isDataLoading:s,workflowDetails:{},applicationData:null==c?void 0:c.applicationData,moduleCode:"PT"}),window.location.href.includes("redirectToUrl")&&"INACTIVE"!==(null==c||null===(e=c.applicationData)||void 0===e?void 0:e.status)&&l.createElement(t.ActionBar,{style:{display:"flex",justifyContent:"flex-end",alignItems:"baseline"}},l.createElement("div",null,l.createElement(t.SubmitBar,{label:i("PT_ADD_PROPERTY_TO_APP"),onSubmit:()=>(()=>{var e,t,n,l,o,i,r;const s=null!=d&&d.includes("employee/tl")?1600:300;return setTimeout(()=>window.scrollTo(0,s),400),v.push(`${d}?propertyId=${a}&tenantId=${(null==c?void 0:c.tenantId)||u}${"PENDING_FOR_FIELD_INSPECTION"===(null==p||null===(e=p.data)||void 0===e||null===(t=e.applicationDetails)||void 0===t?void 0:t.applicationStatus)?`&applicationNumber=${null==p||null===(n=p.data)||void 0===n||null===(l=n.applicationDetails)||void 0===l?void 0:l.applicationNo}&service=${null==p||null===(o=p.data)||void 0===o||null===(i=o.applicationDetails)||void 0===i||null===(r=i.applicationData)||void 0===r?void 0:r.serviceType}`:""}`,{...p})})()}))))},so=e=>{let{stateCode:n}=e;const{path:o,...i}=r.useRouteMatch();return l.createElement("span",{className:"pt-citizen",style:{width:"100%"}},l.createElement(r.Switch,null,l.createElement(t.AppContainer,null,l.createElement(t.BackButton,null,"Back"),l.createElement(r.Route,{path:o+"/property/citizen-search",component:ye}),l.createElement(r.Route,{path:o+"/property/search-results"},l.createElement(Te,{stateCode:n})),l.createElement(r.Route,{path:o+"/property/citizen-otp"},l.createElement(Ne,{stateCode:n})," "),l.createElement(t.PrivateRoute,{path:o+"/property/link-success/:propertyIds",component:Ce}),l.createElement(t.PrivateRoute,{path:o+"/property/new-application",component:C}),l.createElement(t.PrivateRoute,{path:o+"/view-property",component:()=>l.createElement(uo,null)}))))},co=e=>{o.useTranslation();const n=a.useQueryClient(),i=r.useRouteMatch(),u=(r.useLocation(),r.useHistory()),d=Digit.ULBService.getStateId(),[s,c,p]=(Digit.ULBService.getCurrentTenantId(),Digit.Hooks.useSessionStorage("PT_CREATE_PROPERTY",{}));let{isLoading:m}=Digit.Hooks.pt.useMDMS(d,"PropertyTax","CommonFieldsConfig");const f=r.useLocation().search,E=new URLSearchParams(f).get("redirectToUrl");return m?l.createElement(t.Loader,null):l.createElement(r.Switch,null,l.createElement(r.Route,{exact:!0,path:""+i.path},l.createElement(v,{onSubmit:function(){try{return u.push(i.path+"/acknowledgement"),Promise.resolve()}catch(e){return Promise.reject(e)}},value:s,redirectUrl:E,userType:"employee"})),l.createElement(r.Route,{exact:!0,path:i.path+"/save-property"},l.createElement(T,{data:s,onSuccess:()=>{p(),n.invalidateQueries("PT_CREATE_PROPERTY")},redirectUrl:E,userType:"employee"})))},po={searchId:{propertyIds:{type:"text",label:"PT_PROPERTY_UNIQUE_ID",placeHolder:"PT_PROPERTY_UNIQUE_ID_PLACEHOLDER",validation:{pattern:{value:"[A-Za-z]{2}-[A-Za-z]{2}-[0-9]{4}-[0-9]{4}-[0-9]{2}-[0-9]{2}-[0-9]{6}|[A-Za-z]{2}-[A-Za-z]{2}-[0-9]{4}-[0-9]{2}-[0-9]{2}-[0-9]{6}",message:"ERR_INVALID_PROPERTY_ID"}}},oldPropertyId:{type:"text",label:"PT_EXISTING_PROPERTY_ID",placeholder:"PT_EXISTING_PROPERTY_ID_PLACEHOLDER",validation:{pattern:{value:"[A-Za-z]{2}-[A-Za-z]{2}-[0-9]{4}-[0-9]{4}-[0-9]{2}-[0-9]{2}-[0-9]{6}|[A-Za-z]{2}-[A-Za-z]{2}-[0-9]{4}-[0-9]{2}-[0-9]{2}-[0-9]{6}",message:"ERR_INVALID_PROPERTY_ID"}}},mobileNumber:{type:"number",label:"PT_HOME_SEARCH_RESULTS_OWN_MOB_LABEL",componentInFront:"+91",placeHolder:"PT_HOME_SEARCH_RESULTS_OWN_MOB_PLACEHOLDER",validation:{minLength:{value:10,message:"CORE_COMMON_MOBILE_ERROR"},maxLength:{value:10,message:"CORE_COMMON_MOBILE_ERROR"},pattern:{value:/[6789][0-9]{9}/,message:"CORE_COMMON_MOBILE_ERROR"}}}},searchDetail:{locality:{type:"custom",label:"PT_SEARCH_LOCALITY",placeHolder:"PT_SEARCH_LOCALITY_PLACEHOLDER",validation:{required:"PTLOCALITYMANDATORY"},customComponent:t.Localities,customCompProps:{boundaryType:"revenue",keepNull:!1,optionCardStyles:{height:"600px",overflow:"auto",zIndex:"10"},disableLoader:!0}},doorNo:{type:"text",label:"PT_SEARCHPROPERTY_TABEL_DOOR_NO",placeHolder:"PT_SEARCH_DOOR_NO_PLACEHOLDER",validation:{pattern:{value:"[A-Za-z0-9#,/ -()]{1,63}",message:"ERR_INVALID_DOOR_NO"}}},name:{type:"text",label:"PT_SEARCHPROPERTY_TABEL_OWNERNAME",placeHolder:"PT_SEARCH_OWNER_NAME_PLACEHOLDER",validation:{minLength:{value:3,message:"PT_MIN_3CHAR"},pattern:{value:"^[a-zA-Z ]+$",message:"PAYMENT_INVALID_NAME"}}}}},vo={propertyIds:"",mobileNumber:"",oldPropertyId:"",locality:"",name:"",doorNo:""},mo=e=>{const{t:i}=o.useTranslation(),a=Digit.ULBService.getCurrentTenantId(),[u,d]=n.useState({}),[s,c]=n.useState(vo),[p,v]=n.useState("searchId"),[m,f]=n.useState(null),E=r.useLocation().search,y=new URLSearchParams(E).get("redirectToUrl"),_=n.memo(Digit.ComponentRegistryService.getComponent("CPTPropertySearchForm")),g=n.memo(Digit.ComponentRegistryService.getComponent("CPTPropertySearchResults")),{data:h,isLoading:S}=Digit.Hooks.pt.useMDMS(Digit.ULBService.getStateId(),"DIGIT-UI","HelpText",{select:e=>{var t,n,l;return null==e||null===(t=e["DIGIT-UI"])||void 0===t||null===(n=t.HelpText)||void 0===n||null===(l=n[0])||void 0===l?void 0:l.PT}});n.useEffect(()=>{1==sessionStorage.getItem("searchDetailValue")&&"searchId"===p&&v("searchDetail")},[p]);const b=n.useCallback(()=>{c(vo),d({}),f(null)}),T=n.useCallback(e=>{c(e),Object.keys(e).filter(t=>e[t]&&"object"!=typeof e[t]).length>0?(d(Object.keys(e).filter(t=>e[t]).reduce((t,n)=>({...t,[n]:"object"==typeof e[n]?e[n].code:e[n]}),{})),f(null)):f({warning:!0,label:"ERR_PT_FILL_VALID_FIELDS"})});return S?l.createElement(t.Loader,null):l.createElement(l.Fragment,null,l.createElement(t.Header,null,i("SEARCH_PROPERTY")),l.createElement(_,{t:i,payload:s,searchBy:p,setSearchBy:v,PTSearchFields:po,tenantId:a,onSubmit:T,onReset:b}),Object.keys(u).length>0&&l.createElement(g,{t:i,showToast:m,setShowToast:f,tenantId:a,payload:u,ptSearchConfig:{...h},redirectToUrl:y}),m&&l.createElement(t.Toast,{error:m.error,warning:m.warning,label:i(m.label),onClose:()=>{f(null)}}))},fo=e=>{let{path:n,url:i,userType:a}=e;const{t:u}=o.useTranslation(),d=r.useLocation(),s=new URLSearchParams(r.useLocation().search).get("propertyId"),c=new URLSearchParams(r.useLocation().search).get("tenantId"),p=r.useLocation().search,v=new URLSearchParams(p).get("redirectToUrl"),m=new URLSearchParams(p).get("from")||"",f=[{path:"/digit-ui/employee",content:u("ES_COMMON_HOME"),show:!0},{path:{pathname:s?`${v}?propertyId=${s}&tenantId=${c}`:v,state:{...d.state}},content:v?(e=>e.includes("employee/tl/new-application")?u("ES_TITLE_NEW_TRADE_LICESE_APPLICATION"):e.includes("employee/ws/new-application")?u("ES_COMMON_WS_NEW_CONNECTION"):e.includes("employee/ws/modify-application")?u("WS_WATER_AND_SEWERAGE_MODIFY_CONNECTION_LABEL"):u("WF_EMPLOYEE_NEWTL_RENEWAL_SUBMIT_BUTTON"))(v):m&&u(m)||"NONE",show:(v||m)&&!0,isBack:m&&!0,isredirected:!0},{path:"/digit-ui/employee/dss/drilldown",content:d.pathname.includes("/commonpt/search")?u("SEARCH_PROPERTY"):d.pathname.includes("/view-property")?u("PT_PROPERTY_INFORMATION"):u("PT_NEW_PROPERTY"),show:!0}],E=window.location.href.includes("/employee/commonpt/new-application");return l.createElement(r.Switch,null,l.createElement(l.Fragment,null,l.createElement("div",{className:"ground-container"},l.createElement("div",{style:E?{marginLeft:"12px"}:{}},l.createElement(t.BreadCrumb,{crumbs:f})),l.createElement(t.PrivateRoute,{exact:!0,path:n+"/",component:()=>l.createElement(bo,{matchPath:n,userType:a})}),l.createElement(t.PrivateRoute,{path:n+"/new-application",component:()=>l.createElement(co,{parentUrl:i})}),l.createElement(t.PrivateRoute,{path:n+"/search",component:()=>l.createElement(mo,null)}),l.createElement(t.PrivateRoute,{path:n+"/view-property",component:()=>l.createElement(uo,null)}))))},Eo=e=>l.createElement("div",{className:"w-fullwidth PropertySearchFormSwitcher"},e.keys.map(t=>l.createElement("span",{key:t,className:e.searchBy===t?"selected":"non-selected",onClick:()=>{"searchDetail"===t&&!sessionStorage.getItem("searchDetailValue")&&sessionStorage.setItem("searchDetailValue",1),"searchId"===t&&1==sessionStorage.getItem("searchDetailValue")&&sessionStorage.setItem("searchDetailValue",2),e.onSwitch(t),e.onReset()}},e.t("PT_SEARCH_BY_"+(null==t?void 0:t.toUpperCase()))))),yo=e=>l.createElement("span",{className:"cell-text"},e);let _o=[];const go=e=>{let{currentStep:n=1,flow:i=""}=e;const{t:r}=o.useTranslation(),a=window.Digit.Utils.browser.isMobile();return(e=>{switch(e){case"STAKEHOLDER":_o=[];break;case"WS":_o=["WS_COMMON_PROPERTY_DETAILS","WS_COMMON_CONNECTION_DETAIL","WS_COMMON_DOCUMENT_DETAILS","WS_COMMON_SUMMARY"];break;case"TL":_o=["TL_COMMON_TR_DETAILS","TL_LOCATION_AND_OWNER_DETAILS","TL_DOCUMENT_DETAIL","TL_COMMON_SUMMARY"];default:_o=[]}})(i),l.createElement("div",{className:"timeline-container",style:a?{}:{maxWidth:"960px",minWidth:"640px",marginRight:"auto"}},_o.map((e,o,i)=>l.createElement("div",{className:"timeline-checkpoint",key:o},l.createElement("div",{className:"timeline-content"},l.createElement("span",{className:"circle "+(o<=n-1&&"active")},o<n-1?l.createElement(t.TickMark,null):o+1),l.createElement("span",{className:"secondary-color"},r(e))),o<i.length-1&&l.createElement("span",{className:"line "+(o<n-1&&"active")}))))},ho={CPTPropertySearchForm:e=>{let{tenantId:o,t:i,onSubmit:r,onReset:a,searchBy:d,PTSearchFields:s,setSearchBy:c,payload:p}=e;const{register:v,control:m,handleSubmit:f,watch:E,getValues:y,formState:_}=u.useForm({defaultValues:{...p}}),g=E(),h=(null==s?void 0:s[d])||{};return n.useEffect(()=>{"true"===sessionStorage.getItem("isCreateEnabledEmployee")?(sessionStorage.removeItem("isCreateEnabledEmployee"),history.replace("/digit-ui/employee")):sessionStorage.removeItem("isCreateEnabledEmployee")}),l.createElement("div",{className:"PropertySearchForm"},l.createElement(t.SearchForm,{onSubmit:r,handleSubmit:f},l.createElement(Eo,{keys:Object.keys(s||{}),searchBy:d,onReset:a,t:i,onSwitch:c}),h&&Object.keys(h).map(e=>{var n,r,a;let d=h[e],s=(null==d?void 0:d.validation)||{};return l.createElement(t.SearchField,{key:e},l.createElement("label",null,i(null==d?void 0:d.label),null!=d&&null!==(n=d.validation)&&void 0!==n&&n.required?"*":""),"custom"===(null==d?void 0:d.type)?l.createElement(u.Controller,{name:e,defaultValue:null==g?void 0:g[e],rules:d.validation,control:m,render:(t,n)=>l.createElement(d.customComponent,N({selectLocality:e=>{t.onChange(e)},tenantId:o,selected:null==g?void 0:g[e]},d.customCompProps))}):l.createElement("div",{className:"field-container"},null!=d&&d.componentInFront?l.createElement("span",{className:"employee-card-input employee-card-input--front",style:{flex:"none"}},null==d?void 0:d.componentInFront):null,l.createElement(t.TextInput,{name:e,type:null==d?void 0:d.type,inputRef:v({value:y(e),shouldUnregister:!0,...s})})),l.createElement(t.CardLabelError,{style:{marginTop:"-10px",marginBottom:"-10px"}},i(null==_||null===(r=_.errors)||void 0===r||null===(a=r[e])||void 0===a?void 0:a.message)))}),l.createElement("div",{className:"pt-search-action"},l.createElement(t.SearchField,{className:"pt-search-action-reset"},l.createElement("p",{onClick:()=>{a({})}},i("ES_COMMON_CLEAR_ALL"))),l.createElement(t.SearchField,{className:"pt-search-action-submit"},l.createElement(t.SubmitBar,{label:i("ES_COMMON_SEARCH"),submit:!0})))))},CPTPropertySearchResults:e=>{var o,i;let{tenantId:a,t:u,payload:d,showToast:s,setShowToast:c,ptSearchConfig:p,redirectToUrl:v}=e;const m=r.useHistory(),{state:f}=r.useLocation(),E=r.useLocation().search,y=new URLSearchParams(E).get("propertyId");let _=window.location.href.includes("&")?window.location.href.substring(window.location.href.indexOf("&")+1,window.location.href.length):"";const[g,h]=n.useState({...d}),{data:S,isLoading:b,error:T}=Digit.Hooks.pt.usePropertySearchWithDue({tenantId:a,filters:g,configs:{enabled:Object.keys(d).length>0,retry:!1,retryOnMount:!1,staleTime:Infinity}}),C=n.useMemo(()=>[{Header:u("PT_COMMON_TABLE_COL_PT_ID"),disableSortBy:!0,Cell:e=>{let{row:t}=e;return l.createElement("div",null,l.createElement("span",{className:"link"},l.createElement("span",{onClick:()=>{m.push(`/digit-ui/employee/commonpt/view-property?propertyId=${t.original.propertyId}&tenantId=${a}&redirectToUrl=${v}`,{...f})}},t.original.propertyId)))}},{Header:u("PT_COMMON_TABLE_COL_OWNER_NAME"),disableSortBy:!0,Cell:e=>{let{row:t}=e;return yo(t.original.owners.sort((e,t)=>e.additionalDetails.ownerSequence-t.additionalDetails.ownerSequence).map(e=>e.name).join(",")||"")}},{Header:u("ES_INBOX_LOCALITY"),disableSortBy:!0,Cell:e=>{let{row:t}=e;return yo(u(t.original.locality)||"")}},{Header:u("PT_COMMON_TABLE_COL_STATUS_LABEL"),Cell:e=>{var t;let{row:n}=e;return yo(u((null==n||null===(t=n.original)||void 0===t?void 0:t.status)||"NA"))},disableSortBy:!0},{Header:u("PT_AMOUNT_DUE"),Cell:e=>{var t,n;let{row:l}=e;return yo(null!=l&&null!==(t=l.original)&&void 0!==t&&t.due?"₹ "+(null==l||null===(n=l.original)||void 0===n?void 0:n.due):u("PT_NA"))},disableSortBy:!0},{Header:u("ES_SEARCH_ACTION"),disableSortBy:!0,Cell:e=>{var t;let{row:n}=e;return l.createElement("div",null,"INACTIVE"!==(null==n||null===(t=n.original)||void 0===t?void 0:t.status)?l.createElement("span",{className:"link"},v?l.createElement("span",{onClick:()=>{m.push(_?`${v}?${null==_?void 0:_.replace(y,n.original.propertyId)}`:`${v}?propertyId=${n.original.propertyId}&tenantId=${a}`,{...f});const e=null!=v&&v.includes("employee/tl")?1600:300;setTimeout(()=>window.scrollTo(0,e),400)}},u("CPT_SELECT_PROPERTY")):null):u("PT_NA"))}}],[]);let A=window.Digit.Utils.browser.isMobile();if(b)return s&&c(null),l.createElement(t.Loader,null);var N,I,P,O;if(T)return!s&&c({error:!0,label:(null==T||null===(N=T.response)||void 0===N||null===(I=N.data)||void 0===I||null===(P=I.Errors)||void 0===P||null===(O=P[0])||void 0===O?void 0:O.code)||T}),null;const D=n.memo(Digit.ComponentRegistryService.getComponent("PTEmptyResultInbox")),w=Object.values((null==S?void 0:S.FormattedData)||{})||[];return null!=p&&p.ptSearchCount&&d.locality&&w&&w.length>(null==p?void 0:p.ptSearchCount)?(!s&&c({error:!0,label:"PT_MODIFY_SEARCH_CRITERIA"}),null):l.createElement(l.Fragment,null,0===(null==S||null===(o=S.Properties)||void 0===o?void 0:o.length)?l.createElement(D,{data:!0}):A?l.createElement(t.DetailsCard,{data:function(e){var t;return void 0===e&&(e=[]),null===(t=e)||void 0===t?void 0:t.map(e=>{const t={};return C.forEach(n=>{n.Cell&&(t[n.Header]=n.Cell({row:{original:e}}))}),t})}(w),t:u}):l.createElement(t.Table,{t:u,data:w,totalRecords:null==S||null===(i=S.Properties)||void 0===i?void 0:i.length,columns:C,getCellProps:e=>({style:{padding:"20px 18px",fontSize:"16px"}}),manualPagination:!1,disableSort:!0}))},CPTSearchProperty:ye,CPTPropertyAssemblyDetails:e=>{var o,r,a,d,s,c,v,m;let{t:f,config:E,onSelect:y,userType:_,formData:h,formState:S,setError:b,clearErrors:T}=e;const[C,A]=l.useState({...h.assemblyDet,BuildingType:null==h?void 0:h.PropertyType,floorarea:null==h?void 0:h.landArea,constructionArea:null==h?void 0:h.constructionArea,usageCategoryMajor:null!=h&&h.usageCategoryMajor&&"NONRESIDENTIAL.OTHERS"===(null==h||null===(o=h.usageCategoryMajor)||void 0===o?void 0:o.code)?{code:""+(null==h||null===(r=h.usageCategoryMajor)||void 0===r?void 0:r.code),i18nKey:"PROPERTYTAX_BILLING_SLAB_OTHERS"}:null==h?void 0:h.usageCategoryMajor}),[N,I]=l.useState(""),P=Digit.ULBService.getStateId(),[O,D]=n.useState(!1),w=window.Digit.Utils.browser.isMobile();let R=[];const{data:L={}}=Digit.Hooks.pt.usePropertyMDMS(P,"PropertyTax","PTPropertyType")||{};R=null==L||null===(a=L.PropertyTax)||void 0===a?void 0:a.PropertyType;const{data:x={}}=Digit.Hooks.pt.usePropertyMDMS(P,"PropertyTax","UsageCategory")||{};let M=[];function F(e){var t,n;if("employee"===_)return null==e||null===(t=e.filter(e=>"VACANT"===e.code||e.code.split(".").length>1))||void 0===t||null===(n=t.map(e=>({i18nKey:"COMMON_PROPTYPE_"+g(null==e?void 0:e.code,".","_"),code:null==e?void 0:e.code})))||void 0===n?void 0:n.sort((e,t)=>e.i18nKey.split("_").pop().localeCompare(t.i18nKey.split("_").pop()));if(Array.isArray(e)&&e.length>0)for(i=0;i<e.length;i++)1!=i&&4!=i&&Array.isArray(e)&&e.length>0&&menu.push({i18nKey:"COMMON_PROPTYPE_"+g(e[i].code,".","_"),code:e[i].code});return menu.sort((e,t)=>e.i18nKey.split("_").pop().localeCompare(t.i18nKey.split("_").pop())),menu}function k(e){var t;if("employee"===_)return null==e||null===(t=e.filter(e=>(null==e?void 0:e.code.split(".").length)<=2&&"NONRESIDENTIAL"!==e.code))||void 0===t?void 0:t.map(e=>{const t=null==e?void 0:e.code.split(".");return 2==t.length?{i18nKey:"PROPERTYTAX_BILLING_SLAB_"+t[1],code:null==e?void 0:e.code}:{i18nKey:"PROPERTYTAX_BILLING_SLAB_"+(null==e?void 0:e.code),code:null==e?void 0:e.code}});for(i=0;i<10;i++)Array.isArray(e)&&e.length>0&&"NONRESIDENTIAL"==e[i].code.split(".")[0]&&2==e[i].code.split(".").length&&menu.push({i18nKey:"PROPERTYTAX_BILLING_SLAB_"+e[i].code.split(".")[1],code:e[i].code});return menu}M=(null==x||null===(d=x.PropertyTax)||void 0===d?void 0:d.UsageCategory)||[];const{control:B,formState:{errors:U,touched:j},trigger:H,watch:W,clearErrors:V}=u.useForm(),$=W(),z={width:"70%",marginLeft:"30%",fontSize:"12px",marginTop:"-21px"};return l.useEffect(()=>{let e=!1;const t={};Object.keys(C).forEach(e=>{t[e]=null==$?void 0:$[e]}),p.isEqual(t,C)||Object.keys(C).forEach(t=>{C[t]?(e=!1,V(t)):e=!0}),e?b(null==E?void 0:E.key,{type:U}):T(null==E?void 0:E.key),H(),D(e),y(null==E?void 0:E.key,C)},[C]),l.useEffect(()=>{var e;Object.keys(U).length&&!p.isEqual((null===(e=S.errors[E.key])||void 0===e?void 0:e.type)||{},U)?b(E.key,{type:U}):!Object.keys(U).length&&S.errors[E.key]&&O&&T(E.key)},[U]),l.createElement("div",null,l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,f("PT_PROP_TYPE")+"*"),l.createElement("div",{class:"form-field"},l.createElement(u.Controller,{name:"BuildingType",control:B,defaultValue:null==C?void 0:C.BuildingType,rules:{required:f("REQUIRED_FIELD")},key:null==E?void 0:E.key,render:e=>{var n,o;return l.createElement(t.Dropdown,{selected:1===(null===(n=F(R))||void 0===n?void 0:n.length)?F(R)[0]:null==C?void 0:C.BuildingType,disable:1===(null===(o=F(R))||void 0===o?void 0:o.length),option:F(R),autoFocus:"BuildingType"===N,select:t=>{e.onChange(t),A({...C,BuildingType:t}),I("BuildingType")},optionKey:"i18nKey",onBlur:null==e?void 0:e.onBlur,t:f})}}))),l.createElement(t.CardLabelError,{style:z},null!=j&&j.BuildingType?null==U||null===(s=U.BuildingType)||void 0===s?void 0:s.message:""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,f("PT_TOT_LAND_AREA")+"*"),l.createElement("div",{className:"form-field"},l.createElement(u.Controller,{name:"floorarea",control:B,defaultValue:null==C?void 0:C.floorarea,rules:{required:f("REQUIRED_FIELD"),validate:e=>!!/^([0-9]){0,8}$/i.test(e)||f("PT_TOT_LAND_AREA_ERROR_MESSAGE")},key:null==E?void 0:E.key,render:e=>l.createElement(t.TextInput,{t:f,type:"number",isMandatory:!1,optionKey:"i18nKey",name:"totLandArea",value:null==e?void 0:e.value,autoFocus:"floorarea"===N,onChange:t=>{null==e||e.onChange(t.target.value),A({...C,floorarea:t.target.value}),I("floorarea")},onBlur:null==e?void 0:e.onBlur})}))),l.createElement(t.CardLabelError,{style:z},null!=j&&j.floorarea?null==U||null===(c=U.floorarea)||void 0===c?void 0:c.message:""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,f("PT_TOT_CONSTRUCTION_AREA")+"*"),l.createElement("div",{className:"form-field"},l.createElement(u.Controller,{name:"constructionArea",control:B,defaultValue:null==C?void 0:C.constructionArea,key:null==E?void 0:E.key,rules:{required:f("REQUIRED_FIELD"),validate:e=>!!(/^([0-9]){0,8}$/i.test(e)&&null!=C&&C.floorarea&&parseInt(e)<parseInt(null==C?void 0:C.floorarea))||f("PT_TOT_CONSTRUCTION_AREA_ERROR_MESSAGE")},render:e=>l.createElement(t.TextInput,{t:f,type:"number",isMandatory:!1,optionKey:"i18nKey",name:"totConstructionArea",value:null==e?void 0:e.value,autoFocus:"constructionArea"===N,onChange:t=>{null==e||e.onChange(t.target.value),I("constructionArea"),A({...C,constructionArea:t.target.value})},onBlur:null==e?void 0:e.onBlur})}))),l.createElement(t.CardLabelError,{style:w?{...z,marginLeft:"0px"}:{...z}},null!=j&&j.constructionArea?null==U||null===(v=U.constructionArea)||void 0===v?void 0:v.message:""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,f("PT_ASSESMENT_INFO_USAGE_TYPE")+"*"),l.createElement("div",{className:"form-field"},l.createElement(u.Controller,{name:"usageCategoryMajor",defaultValue:null==C?void 0:C.usageCategoryMajor,rules:{required:f("REQUIRED_FIELD")},control:B,key:null==E?void 0:E.key,render:e=>{var n;return l.createElement(t.Dropdown,{selected:null==e?void 0:e.value,disable:1===(null===(n=k(M))||void 0===n?void 0:n.length),option:k(M),autoFocus:"usageCategoryMajor"===N,select:t=>{null==e||e.onChange(t),I("usageCategoryMajor"),A({...C,usageCategoryMajor:t})},optionKey:"i18nKey",onBlur:null==e?void 0:e.onBlur,t:f})}}))),l.createElement(t.CardLabelError,{style:z},null!=j&&j.usageCategoryMajor?null==U||null===(m=U.usageCategoryMajor)||void 0===m?void 0:m.message:""))},CPTPropertyLocationDetails:e=>{var n,o,i,r,a,d;let{t:s,config:c,onSelect:v,userType:m,formData:f,formState:E,setError:y,clearErrors:_}=e,g={},h=Digit.Hooks.pt.useTenants()?Digit.Hooks.pt.useTenants():Digit.Hooks.tl.useTenants();window.location.href.includes("obps")&&(h=Digit.SessionStorage.get("OBPS_TENANTS")),window.location.href.includes("fsm")&&(h=Digit.SessionStorage.get("FSM_TENANTS"),console.log("allc",h));const S=null===(n=Digit.UserService.getUser())||void 0===n?void 0:n.info;m="EMPLOYEE"==(null==S?void 0:S.type)?"employee":"citizen";const b=null==S?void 0:S.tenantId,T="TENANT_TENANTS_"+(null==S?void 0:S.tenantId.replace(".","_").toUpperCase()),C="employee"===m?{code:b,name:s(T),i18nKey:T}:null,[A,I]=l.useState({...null==f?void 0:f.locationDet,cityCode:C,locality:null==f?void 0:f.locality,houseDoorNo:null==f?void 0:f.houseDoorNo,buildingColonyName:null==f?void 0:f.buildingColonyName,landmarkName:null==f?void 0:f.landmarkName}),[P,O]=l.useState(!1),{control:D,formState:{errors:w,touched:R},trigger:L,watch:x,clearErrors:M}=u.useForm(),F=x();l.useEffect(()=>{let e=!1;const t={};Object.keys(A).forEach(e=>{t[e]=null==F?void 0:F[e]}),p.isEqual(t,A)||Object.keys(A).forEach(t=>{A[t]?(e=!1,M(t)):e=!0}),e?y(null==c?void 0:c.key,{type:w}):_(null==c?void 0:c.key),L(),O(e),v(null==c?void 0:c.key,A)},[A]),l.useEffect(()=>{var e;Object.keys(w).length&&!p.isEqual((null===(e=E.errors[c.key])||void 0===e?void 0:e.type)||{},w)?y(c.key,{type:w}):!Object.keys(w).length&&E.errors[c.key]&&P&&_(c.key)},[w]);const k={width:"70%",marginLeft:"30%",fontSize:"12px",marginTop:"-21px"};return l.createElement("div",null,l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,s("PT_PROP_CITY")+"*"),l.createElement(u.Controller,{name:"",defaultValue:null==A?void 0:A.cityCode,control:D,rules:{required:s("REQUIRED_FIELD")},render:e=>{let{value:n,onBlur:o,onChange:i}=e;return l.createElement(t.Dropdown,{className:"form-field",selected:n,disable:"employee"===m,option:h.sort((e,t)=>e.name>t.name?1:t.name>e.name?-1:0),select:e=>{i(e),I({...A,cityCode:e})},optionKey:"code",onBlur:o,t:s})}})),l.createElement(t.CardLabelError,{style:k},null!=R&&R.cityCode?null==w||null===(o=w.cityCode)||void 0===o?void 0:o.message:""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,s("PT_PROP_LOCALITY")+"*"),l.createElement("div",{className:"form-field"},l.createElement(u.Controller,{name:"locality",defaultValue:null==A?void 0:A.locality,control:D,rules:{required:s("REQUIRED_FIELD")},render:e=>{var n,o;let{value:i,onBlur:r,onChange:a}=e;return l.createElement(t.Localities,{selectLocality:e=>{a(e),I({...A,locality:e})},tenantId:null==A||null===(n=A.cityCode)||void 0===n?void 0:n.code,boundaryType:"revenue",keepNull:!1,optionCardStyles:{height:"600px",overflow:"auto",zIndex:"10"},selected:i,disable:!(null!=A&&null!==(o=A.cityCode)&&void 0!==o&&o.code),disableLoader:!0,onBlur:r})}}))),l.createElement(t.CardLabelError,{style:k},null!=R&&R.locality?null==w||null===(i=w.locality)||void 0===i?void 0:i.message:""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,s("PT_HOUSE_DOOR_NO")+"*"),l.createElement("div",{className:"form-field"},l.createElement(u.Controller,{name:"houseDoorNo",defaultValue:null==A?void 0:A.houseDoorNo,control:D,rules:{required:s("REQUIRED_FIELD"),validate:e=>!!/^([a-zA-Z0-9 !@#$%^&*()_+\-={};':\\\\|,.<>/?]){1,64}$/i.test(e)||s("PT_HOUSE_DOOR_NO_ERROR_MESSAGE")},render:e=>{let{value:n,onBlur:o,onChange:i}=e;return l.createElement(t.TextInput,N({t:s,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"houseDoorNo",value:n,onChange:e=>{i(e.target.value),I({...A,houseDoorNo:e.target.value})},onBlur:o},g={pattern:"^([a-zA-Z0-9 !@#$%^&*()_+-={};':\\\\|,.<>/?]){1,64}$",title:s("PT_HOUSE_DOOR_NO_ERROR_MESSAGE")}))}}))),l.createElement(t.CardLabelError,{style:k},null!=R&&R.houseDoorNo?null==w||null===(r=w.houseDoorNo)||void 0===r?void 0:r.message:""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,s("PT_PROPERTY_ADDRESS_STREET_NAME")+"*"),l.createElement("div",{className:"form-field"},l.createElement(u.Controller,{name:"buildingColonyName",defaultValue:null==A?void 0:A.buildingColonyName,control:D,rules:{required:s("REQUIRED_FIELD")},render:e=>{let{value:n,onChange:o,onBlur:i}=e;return l.createElement(t.TextInput,{t:s,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"buildingColonyName",value:n,onChange:e=>{o(e.target.value),I({...A,buildingColonyName:e.target.value})},onBlur:i})}}))),l.createElement(t.CardLabelError,{style:k},null!=R&&R.buildingColonyName?null==w||null===(a=w.buildingColonyName)||void 0===a?void 0:a.message:""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,""+s("PT_LANDMARK_NAME")),l.createElement("div",{className:"form-field"},l.createElement(u.Controller,{name:"landmarkName",defaultValue:null==A?void 0:A.landmarkName,control:D,rules:{},render:e=>{let{value:n,onChange:o,onBlur:i}=e;return l.createElement(t.TextInput,{t:s,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"landmarkName",value:n,onChange:e=>{o(e.target.value),I({...A,landmarkName:e.target.value})},onBlur:i})}}))),l.createElement(t.CardLabelError,{style:k},null!=R&&R.landmarkName?null==w||null===(d=w.landmarkName)||void 0===d?void 0:d.message:""))},CPTPropertyOwnerDetails:e=>{var o,i,a,d,s,c,v,m,f,E,y,_,g,h;let{t:S,config:b,onSelect:T,userType:C,formData:A,formState:N,setError:I,clearErrors:P}=e;const{pathname:O}=r.useLocation(),D=O.includes("/modify-application/"),w=O.includes("/property-mutation/"),R=window.Digit.Utils.browser.isMobile(),[L,x]=l.useState(""),[M,F]=l.useState([{...A.owners&&A.owners[0],name:A.owners&&A.owners[0]&&A.owners[0].name||(null==A||null===(o=A.owners)||void 0===o?void 0:o.name)||"",gender:A.owners&&A.owners[0]&&A.owners[0].gender||(null==A||null===(i=A.owners)||void 0===i?void 0:i.gender),mobileNumber:A.owners&&A.owners[0]&&A.owners[0].mobileNumber||(null==A||null===(a=A.owners)||void 0===a?void 0:a.mobileNumber)||"",fatherOrHusbandName:A.owners&&A.owners[0]&&A.owners[0].fatherOrHusbandName||(null==A||null===(d=A.owners)||void 0===d?void 0:d.fatherOrHusbandName)||"",relationship:A.owners&&A.owners[0]&&A.owners[0].relationship||(null==A||null===(s=A.owners)||void 0===s?void 0:s.relationship),ownershipCategory:L,ownerType:A.owners&&A.owners[0]&&(null===(c=A.owners[0])||void 0===c?void 0:c.ownerType)||(null===(v=A.owners)||void 0===v?void 0:v.ownerType),permanentAddress:A.owners&&A.owners[0]&&A.owners[0].permanentAddress||(null==A||null===(m=A.owners)||void 0===m?void 0:m.permanentAddress)||"",email:A.owners&&A.owners[0]&&A.owners[0].email||(null==A||null===(f=A.owners)||void 0===f?void 0:f.emailId)||"",isCoresAddr:!1}]),[k,B]=n.useState(!1),[U,j]=l.useState(!1),H=(null==A?void 0:A.isUpdateProperty)||!1;let W=(null==A?void 0:A.isEditProperty)||!1;const V=Digit.ULBService.getStateId(),{data:$}=Digit.Hooks.pt.useGenderMDMS(V,"common-masters","GenderType");let z=[];$&&$.map(e=>{z.push({i18nKey:"PT_COMMON_GENDER_"+e.code,code:""+e.code,value:""+e.code})});const{data:Y}=Digit.Hooks.tl.useTradeLicenseMDMS(V,"common-masters","TLOwnerTypeWithSubtypes",{userType:C}),{data:K}=Digit.Hooks.pt.usePropertyMDMS(V,"PropertyTax","OwnerType"),{data:q}=Digit.Hooks.pt.usePropertyMDMS(V,"PropertyTax",["OwnerShipCategory"]),[G,Z]=n.useState(null==A||null===(E=A.owners)||void 0===E?void 0:E.isCorrespondenceAddress);function X(e,t){let n="";var l,o;!0===e.target.checked&&(n=((e,t)=>`${null!=e&&e.houseDoorNo?(null==e?void 0:e.houseDoorNo)+", ":""} ${null!=e&&e.buildingColonyName?(null==e?void 0:e.buildingColonyName)+", ":""}${null!=e&&e.landmarkName?(null==e?void 0:e.landmarkName)+", ":""}${t(null==e?void 0:e.locality.i18nkey)}, ${t(null==e?void 0:e.cityCode.i18nKey)},${t(null==e?void 0:e.pincode)?""+e.pincode:" "}`)(w?null==A||null===(l=A.searchResult)||void 0===l||null===(o=l.property)||void 0===o?void 0:o.locationDet:null==A?void 0:A.locationDet,S)),re("permanentAddress",t,n),re("isCoresAddr",t,e.target.checked)}const J=[{name:"HUSBAND",code:"HUSBAND",i18nKey:"PT_RELATION_HUSBAND"},{name:"Father",code:"FATHER",i18nKey:"PT_RELATION_FATHER"}],{control:Q,formState:{errors:ee,touched:te},trigger:ne,watch:le,clearErrors:oe}=u.useForm(),ie=le();n.useEffect(()=>{let e=!1;const t={};M.map(n=>{Object.keys(n).forEach(e=>{t[e]=null==ie?void 0:ie[e]}),p.isEqual(t,n)||Object.keys(n).forEach(t=>{n[t]?(e=!1,oe(t)):e=!0})}),e?I(null==b?void 0:b.key,{type:ee}):P(null==b?void 0:b.key),ne(),B(e),T(null==b?void 0:b.key,M.map(e=>({...e,ownershipCategory:null==L?void 0:L.value})))},[M]),n.useEffect(()=>{var e;Object.keys(ee).length&&!p.isEqual((null===(e=N.errors[b.key])||void 0===e?void 0:e.type)||{},ee)?I(b.key,{type:ee}):!Object.keys(ee).length&&N.errors[b.key]&&k&&P(b.key)},[ee]);const re=function(e,t,n){void 0===e&&(e="name"),void 0===t&&(t=0),void 0===n&&(n=""),F(M.map((l,o)=>(o===t&&(l[e]=n),{...l})))},ae=n.useMemo(()=>{var e,t;const n=null==L?void 0:L.code,l=null==q||null===(e=q.PropertyTax)||void 0===e||null===(t=e.OwnerShipCategory)||void 0===t?void 0:t.filter(e=>{var t;return(null==e||null===(t=e.code)||void 0===t?void 0:t.split(".")[0])==(null==n?void 0:n.split(".")[0])}),o=null==l?void 0:l.filter(e=>{var t,n;return null==e||null===(t=e.code)||void 0===t||null===(n=t.split("."))||void 0===n?void 0:n[1]});return null==o?void 0:o.map(e=>{var t,n,l,o,i;return(null===(t=e.code)||void 0===t||null===(n=t.split("."))||void 0===n?void 0:n[1])&&{...e,i18nKey:"COMMON_MASTERS_OWNERSHIPCATEGORY_"+(null===(l=e.code)||void 0===l||null===(o=l.split("."))||void 0===o||null===(i=o[1])||void 0===i?void 0:i.replaceAll(".","_"))}})},[q,null==L?void 0:L.code]),ue={width:"70%",marginLeft:"30%",fontSize:"12px",marginTop:"-21px"},de=!(null==L||null===(y=L.code)||void 0===y||!y.includes("MULTIPLEOWNERS")),se=null==L||null===(_=L.code)||void 0===_?void 0:_.includes("INSTITUTIONAL");return l.createElement("div",null,l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:""},S("TL_NEW_OWNER_DETAILS_OWNERSHIP_TYPE_LABEL")+"*"),l.createElement(u.Controller,{name:"ownershipCategory",defaultValue:L,control:Q,rules:{required:S("REQUIRED_FIELD")},render:e=>{let{value:n,onChange:o,onBlur:i}=e;return l.createElement(t.Dropdown,{className:"form-field",selected:n,option:Y,select:e=>{var t;(null==e||null===(t=e.code)||void 0===t||!t.includes("MULTIPLEOWNERS"))&&(null==M?void 0:M.length)>1&&F([...M.filter((e,t)=>0==t)]),o(e),x(e)},optionKey:"i18nKey",onBlur:i,t:S})}})),null==M?void 0:M.map((e,n)=>{var o,i,r,a,d,s,c,p,v,m,f,E,y,_,g,h,b,T,C,A;return l.createElement("div",{style:{border:"1px solid #D6D5D4",background:"#FAFAFA",borderRadius:"4px",boxSizing:"border-box",margin:"16px 0px",padding:"16px 8px"}},R&&de&&M.length>1&&l.createElement("div",{style:{display:"flex",justifyContent:"flex-end"}},l.createElement(t.LinkButton,{label:l.createElement(t.DeleteIcon,{style:{bottom:"5px"},fill:1!=M.length?"#494848":"#FAFAFA"}),style:{margin:"0px"},onClick:e=>{F([...M.filter((e,t)=>t!=n)])}})),se?l.createElement(l.Fragment,null,l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,S("PT_INSTITUTION_NAME")+"*"),l.createElement("div",{className:"form-field"},l.createElement(u.Controller,{key:"institutionName"+n,name:"institutionName"+n,defaultValue:null==e?void 0:e.institutionName,control:Q,rules:{required:S("REQUIRED_FIELD"),validate:e=>!!/^[a-zA-Z ]*$/i.test(e)||S("PT_NAME_ERROR_MESSAGE")},render:e=>{let{value:o,onChange:i,onBlur:r}=e;return l.createElement(t.TextInput,{t:S,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"institutionName"+n,value:o,onChange:e=>{i(e.target.value),re("institutionName",n,e.target.value)},disable:H||W,onBlur:r})}}))),l.createElement(t.CardLabelError,{style:ue},null!=te&&te["institutionName"+n]?null==ee||null===(o=ee["institutionName"+n])||void 0===o?void 0:o.message:""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:""},S("PT_INSTITUTION_TYPE")+"*"),l.createElement("div",{className:"form-field"},l.createElement(u.Controller,{key:"institutionType"+n,name:"institutionType"+n,defaultValue:null==e?void 0:e.institutionType,control:Q,rules:{required:S("REQUIRED_FIELD")},render:e=>{let{value:o,onChange:i,onBlur:r}=e;return l.createElement(t.Dropdown,{selected:1===(null==ae?void 0:ae.length)?K[0]:o,disable:1===(null==ae?void 0:ae.length)||D,option:ae?ae.sort((e,t)=>e.name.localeCompare(t.name)):[],select:e=>{i(e),re("institutionType",n,e)},optionKey:"i18nKey",t:S,onBlur:r})}}))),l.createElement(t.CardLabelError,{style:ue},null!=te&&te["institutionType"+n]?null==ee||null===(i=ee["institutionType"+n])||void 0===i?void 0:i.message:""),l.createElement(t.CardSectionHeader,null,S("TL_AUTHORIZED_PERSON_DETAILS")),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,S("PT_OWNER_NAME")+"*"),l.createElement("div",{className:"form-field"},l.createElement(u.Controller,{key:"name"+n,name:"name"+n,defaultValue:null==e?void 0:e.name,control:Q,rules:{required:S("REQUIRED_FIELD"),validate:e=>!!/^[a-zA-Z ]+$/i.test(e)||S("PT_NAME_ERROR_MESSAGE")},render:e=>{let{value:o,onChange:i,onBlur:r}=e;return l.createElement(t.TextInput,{t:S,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"name"+n,value:o,onChange:e=>{i(e.target.value),re("name",n,e.target.value)},disable:H||W,onBlur:r})}}))),l.createElement(t.CardLabelError,{style:ue},null!=te&&te["name"+n]?null==ee||null===(r=ee["name"+n])||void 0===r?void 0:r.message:""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,S("PT_LANDLINE_NUMBER_FLOATING_LABEL")+"*"),l.createElement("div",{className:"form-field"},l.createElement(u.Controller,{key:"altContactNumber"+n,name:"altContactNumber"+n,defaultValue:e.altContactNumber,control:Q,rules:{required:S("REQUIRED_FIELD"),validate:e=>!!/^[0-9]{11}$/i.test(e)||S("ERR_DEFAULT_INPUT_FIELD_MSG")},render:e=>{let{value:o,onChange:i,onBlur:r}=e;return l.createElement(t.MobileNumber,{type:"text",t:S,maxLength:11,value:o,name:"altContactNumber"+n,onChange:e=>{i(e),re("altContactNumber",n,e)},disable:H||W,labelStyle:{border:"1px solid #000",borderRight:"none"},onBlur:r})}}))),l.createElement(t.CardLabelError,{style:ue},null!=te&&te["altContactNumber"+n]?null==ee||null===(a=ee["altContactNumber"+n])||void 0===a?void 0:a.message:""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,S("PT_FORM3_MOBILE_NUMBER")+"*"),l.createElement("div",{className:"form-field"},l.createElement(u.Controller,{key:"mobileNumber"+n,name:"mobileNumber"+n,defaultValue:e.mobileNumber,control:Q,rules:{required:S("REQUIRED_FIELD"),validate:e=>!!/[6-9]{1}[0-9]{9}/i.test(e)||S("CORE_COMMON_APPLICANT_MOBILE_NUMBER_INVALID")},render:e=>{let{value:o,onChange:i,onBlur:r}=e;return l.createElement(t.MobileNumber,{value:o,name:"mobileNumber"+n,onChange:e=>{i(e),re("mobileNumber",n,e)},disable:H||W,labelStyle:{border:"1px solid #000",borderRight:"none"},onBlur:r})}})),!R&&l.createElement("div",{style:{display:"flex",justifyContent:"flex-end",width:"20%",alignSelf:"flex-start"}},de&&l.createElement(t.LinkButton,{label:l.createElement(t.DeleteIcon,{style:{bottom:"0px"},fill:1!=M.length?"#494848":"#FAFAFA"}),style:{margin:"0px"},onClick:e=>{F([...M.filter((e,t)=>t!=n)])}}))),l.createElement(t.CardLabelError,{style:ue},null!=te&&te["mobileNumber"+n]?null==ee||null===(d=ee["mobileNumber"+n])||void 0===d?void 0:d.message:""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,S("TL_NEW_DESIG_OWNER_LABEL")+"*"),l.createElement("div",{className:"form-field"},l.createElement(u.Controller,{key:"designation"+n,name:"designation"+n,defaultValue:null==e?void 0:e.designation,control:Q,rules:{required:S("REQUIRED_FIELD"),validate:e=>!!/^[a-zA-Z ]*$/i.test(e)||S("PT_NAME_ERROR_MESSAGE")},render:e=>{let{value:o,onChange:i,onBlur:r}=e;return l.createElement(t.TextInput,{t:S,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"designation"+n,value:o,onChange:e=>{i(e.target.value),re("designation",n,e.target.value)},disable:H||W,onBlur:r})}}))),l.createElement(t.CardLabelError,{style:ue},null!=te&&te["designation"+n]?null==ee||null===(s=ee["designation"+n])||void 0===s?void 0:s.message:""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,S("PT_CORRESPONDANCE_ADDRESS")),l.createElement("div",{className:"form-field"},l.createElement(t.TextArea,{isMandatory:!1,optionKey:"i18nKey",t:S,disabled:!0===(null==M||null===(c=M[n])||void 0===c?void 0:c.isCoresAddr),name:"address"+n,onChange:e=>{var t;!0!==(null==M||null===(t=M[n])||void 0===t?void 0:t.isCoresAddr)&&re("permanentAddress",n,e.target.value)},value:null==M||null===(p=M[n])||void 0===p?void 0:p.permanentAddress}))),l.createElement(t.CheckBox,{className:"form-field",label:""+S("PT_COMMON_SAME_AS_PROPERTY_ADDRESS"),onChange:e=>X(e,n),value:null==M||null===(v=M[n])||void 0===v?void 0:v.isCoresAddr,checked:(null==M||null===(m=M[n])||void 0===m?void 0:m.isCoresAddr)||!1,style:window.location.href.includes("/citizen/")?{paddingTop:"10px"}:{}})):l.createElement(l.Fragment,null,l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,S("PT_FORM3_MOBILE_NUMBER")+"*"),l.createElement("div",{className:"form-field"},l.createElement(u.Controller,{key:"mobileNumber"+n,name:"mobileNumber"+n,defaultValue:e.mobileNumber,control:Q,rules:{required:S("REQUIRED_FIELD"),validate:e=>!!/[6-9]{1}[0-9]{9}/i.test(e)||S("CORE_COMMON_APPLICANT_MOBILE_NUMBER_INVALID")},render:e=>{let{value:o,onChange:i,onBlur:r}=e;return l.createElement(t.MobileNumber,{value:o,name:"mobileNumber"+n,onChange:e=>{i(e),re("mobileNumber",n,e)},disable:H||W,labelStyle:{border:"1px solid #000",borderRight:"none"},onBlur:r})}})),!R&&l.createElement("div",{style:{display:"flex",justifyContent:"flex-end",width:"20%",alignSelf:"flex-start"}},de&&l.createElement(t.LinkButton,{label:l.createElement(t.DeleteIcon,{style:{bottom:"0px"},fill:1!=M.length?"#494848":"#FAFAFA"}),style:{margin:"0px"},onClick:e=>{F([...M.filter((e,t)=>t!=n)])}}))),l.createElement(t.CardLabelError,{style:ue},null!=te&&te["mobileNumber"+n]?null==ee||null===(f=ee["mobileNumber"+n])||void 0===f?void 0:f.message:""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,S("PT_OWNER_NAME")+"*"),l.createElement("div",{className:"form-field"},l.createElement(u.Controller,{key:"name"+n,name:"name"+n,defaultValue:null==e?void 0:e.name,control:Q,rules:{required:S("REQUIRED_FIELD"),validate:e=>!!/^[a-zA-Z ]+$/i.test(e)||S("PT_NAME_ERROR_MESSAGE")},render:e=>{let{value:o,onChange:i,onBlur:r}=e;return l.createElement(t.TextInput,{t:S,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"name"+n,value:o,onChange:e=>{i(e.target.value),re("name",n,e.target.value)},disable:H||W,onBlur:r})}}))),l.createElement(t.CardLabelError,{style:ue},null!=te&&te["name"+n]?null==ee||null===(E=ee["name"+n])||void 0===E?void 0:E.message:""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,S("PT_FORM3_GENDER")+"*"),l.createElement("div",{className:"form-field"},l.createElement(u.Controller,{key:"gender"+n,name:"gender"+n,defaultValue:null==e?void 0:e.gender,control:Q,rules:{required:S("REQUIRED_FIELD")},render:e=>{let{value:o,onChange:i,onBlur:r}=e;return l.createElement(t.RadioOrSelect,{name:"gender"+n,options:z,selectedOption:o,optionKey:"code",onSelect:e=>{i(e),re("gender",n,e)},t:S,disabled:H||W,isDropDown:!!window.location.href.includes("/employee"),onBlur:r})}}))),l.createElement(t.CardLabelError,{style:ue},null!=te&&te["gender"+n]?null==ee||null===(y=ee["gender"+n])||void 0===y?void 0:y.message:""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,S("PT_FORM3_GUARDIAN_NAME")+"*"),l.createElement("div",{className:"form-field"},l.createElement(u.Controller,{key:"fatherOrHusbandName"+n,name:"fatherOrHusbandName"+n,defaultValue:null==e?void 0:e.fatherOrHusbandName,control:Q,rules:{required:S("REQUIRED_FIELD"),validate:e=>!!/^[a-zA-Z ]+$/i.test(e)||S("PT_NAME_ERROR_MESSAGE")},render:e=>{let{value:o,onChange:i,onBlur:r}=e;return l.createElement(t.TextInput,{t:S,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"fatherOrHusbandName"+n,value:o,onChange:e=>{i(e.target.value),re("fatherOrHusbandName",n,e.target.value)},disable:H||W,onBlur:r})}}))),l.createElement(t.CardLabelError,{style:ue},null!=te&&te["fatherOrHusbandName"+n]?null==ee||null===(_=ee["fatherOrHusbandName"+n])||void 0===_?void 0:_.message:""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,S("PT_FORM3_RELATIONSHIP")+"*"),l.createElement("div",{className:"form-field"},l.createElement(u.Controller,{key:"relationship"+n,name:"relationship"+n,defaultValue:null==e?void 0:e.relationship,control:Q,rules:{required:S("REQUIRED_FIELD")},render:e=>{let{value:o,onChange:i,onBlur:r}=e;return l.createElement(t.RadioOrSelect,{name:"relationship"+n,options:J,selectedOption:o,optionKey:"i18nKey",onSelect:e=>{i(e),re("relationship",n,e)},t:S,disabled:H||W,isDropDown:!!window.location.href.includes("/employee"),onBlur:r})}}))),l.createElement(t.CardLabelError,{style:ue},null!=te&&te["relationship"+n]?null==ee||null===(g=ee["relationship"+n])||void 0===g?void 0:g.message:""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:""},S("PT_SPECIAL_APPLICANT_CATEGORY")+"*"),l.createElement("div",{className:"form-field"},l.createElement(u.Controller,{key:"ownerType"+n,name:"ownerType"+n,defaultValue:null==e?void 0:e.ownerType,control:Q,rules:{required:S("REQUIRED_FIELD")},render:e=>{let{value:o,onChange:i,onBlur:r}=e;return l.createElement(t.Dropdown,{selected:1===(null==K?void 0:K.length)?K[0]:o,disable:1===(null==K?void 0:K.length)||D,option:K?K.sort((e,t)=>e.name.localeCompare(t.name)):[],select:e=>{i(e),re("ownerType",n,e)},optionKey:"i18nKey",t:S,onBlur:r})}}))),l.createElement(t.CardLabelError,{style:ue},null!=te&&te["ownerType"+n]?null==ee||null===(h=ee["ownerType"+n])||void 0===h?void 0:h.message:""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,S("PT_CORRESPONDANCE_ADDRESS")),l.createElement("div",{className:"form-field"},l.createElement(t.TextArea,{isMandatory:!1,optionKey:"i18nKey",t:S,disabled:!0===(null==M||null===(b=M[n])||void 0===b?void 0:b.isCoresAddr),name:"address"+n,onChange:e=>{var t;!0!==(null==M||null===(t=M[n])||void 0===t?void 0:t.isCoresAddr)&&re("permanentAddress",n,e.target.value)},value:null==M||null===(T=M[n])||void 0===T?void 0:T.permanentAddress}))),l.createElement(t.CheckBox,{className:"form-field",label:""+S("PT_COMMON_SAME_AS_PROPERTY_ADDRESS"),onChange:e=>X(e,n),value:null==M||null===(C=M[n])||void 0===C?void 0:C.isCoresAddr,checked:(null==M||null===(A=M[n])||void 0===A?void 0:A.isCoresAddr)||!1,style:window.location.href.includes("/citizen/")?{paddingTop:"10px"}:{}})))}),de?l.createElement("div",null,l.createElement("div",{style:{display:"flex",paddingBottom:"15px",color:"#FF8C00"}},l.createElement("button",{type:"button",style:{paddingTop:"10px"},onClick:()=>F(e=>[...e,{name:"",gender:"",mobileNumber:"",fatherOrHusbandName:"",relationship:"",ownershipCategory:L,ownerType:"",permanentAddress:"",email:"",isCoresAddr:!1}])},S("PT_COMMON_ADD_APPLICANT_LABEL"))),l.createElement(t.CardLabelError,{style:{width:"70%",marginLeft:"30%",fontSize:"12px",marginTop:"-35px"}},S((null===(g=N.errors)||void 0===g||null===(h=g.mulipleOwnerError)||void 0===h?void 0:h.message)||""))):null)},CPTKnowYourProperty:e=>{var o,i;let{t:r,config:a,onSelect:u,formData:d}=e;const[s,c]=n.useState(null===(o=d)||void 0===o||null===(i=o.PropDetails)||void 0===i?void 0:i.KnowProperty);if(window.location.href.includes("/tl/tradelicence/edit-application/")||window.location.href.includes("/renew-trade/")){let e=JSON.parse(sessionStorage.getItem("EditFormData"));d={...d,...e}}return l.createElement(l.Fragment,null,window.location.href.includes("/citizen")?l.createElement(go,null):null,l.createElement(t.FormStep,{t:r,config:a,onSelect:function(){sessionStorage.setItem("KnowProperty",s.i18nKey),u(a.key,{KnowProperty:s})},onSkip:()=>u(),isDisabled:!s},l.createElement(t.RadioButtons,{t:r,optionsKey:"i18nKey",isMandatory:a.isMandatory,options:[{i18nKey:"TL_COMMON_YES",code:"YES"},{i18nKey:"TL_COMMON_NO",code:"NO"}],selectedOption:s,onSelect:function(e){c(e)}})))},CPTPropertyDetails:e=>{var n,o,i,a,u,d,s,c,p,v,m,f,E,y,g,h,S,b,T,C,A,N,I,P,O,D,w,R,L,x,M,F,k,B,U,j,H,W,V,$,z,Y,K,q,G,Z,X,J,Q,ee,te,ne,le,oe,ie,re,ae,ue,de,se,ce,pe,ve,me,fe;let{t:Ee,config:ye,onSelect:_e,formData:ge}=e;const he=("YES"===(null===(n=ge)||void 0===n||null===(o=n.knowyourproperty)||void 0===o||null===(i=o.KnowProperty)||void 0===i?void 0:i.code)||"false"===sessionStorage.getItem("VisitedLightCreate")?null===(a=ge)||void 0===a||null===(u=a.cptSearchQuery)||void 0===u?void 0:u.city:null===(d=ge)||void 0===d||null===(s=d.cpt)||void 0===s||null===(c=s.details)||void 0===c?void 0:c.tenantId)||Digit.ULBService.getCitizenCurrentTenant();if(window.location.href.includes("/tl/tradelicence/edit-application/")||window.location.href.includes("/renew-trade/")&&JSON.parse(sessionStorage.getItem("EditFormData"))){let e=JSON.parse(sessionStorage.getItem("EditFormData"));ge={...ge,...e}}const{isLoading:Se,data:be}=Digit.Hooks.pt.usePropertySearch({filters:{propertyIds:null!==(p=ge)&&void 0!==p&&null!==(v=p.cptId)&&void 0!==v&&v.id||null!==(m=ge)&&void 0!==m&&null!==(f=m.cpt)&&void 0!==f&&null!==(E=f.details)&&void 0!==E&&E.propertyId?"YES"===(null===(y=ge)||void 0===y||null===(g=y.knowyourproperty)||void 0===g||null===(h=g.KnowProperty)||void 0===h?void 0:h.code)||"false"===sessionStorage.getItem("VisitedLightCreate")?null===(S=ge)||void 0===S||null===(b=S.cptId)||void 0===b?void 0:b.id:null===(T=ge)||void 0===T||null===(C=T.cpt)||void 0===C||null===(A=C.details)||void 0===A?void 0:A.propertyId:window.location.href.includes("/tl/tradelicence/edit-application")||window.location.href.includes("/renew-trade/")?null===(N=ge)||void 0===N||null===(I=N.tradeLicenseDetail)||void 0===I||null===(P=I.additionalDetail)||void 0===P?void 0:P.propertyId:(null===(O=ge)||void 0===O||null===(D=O.cptId)||void 0===D?void 0:D.id)||(null===(w=ge)||void 0===w||null===(R=w.cpt)||void 0===R||null===(L=R.details)||void 0===L?void 0:L.propertyId)},tenantId:he,privacy:Digit.Utils.getPrivacyObject()},{filters:{propertyIds:null!==(x=ge)&&void 0!==x&&null!==(M=x.cptId)&&void 0!==M&&M.id||null!==(F=ge)&&void 0!==F&&null!==(k=F.cpt)&&void 0!==k&&null!==(B=k.details)&&void 0!==B&&B.propertyId?"YES"===(null===(U=ge)||void 0===U||null===(j=U.knowyourproperty)||void 0===j||null===(H=j.KnowProperty)||void 0===H?void 0:H.code)||"false"===sessionStorage.getItem("VisitedLightCreate")?null===(W=ge)||void 0===W||null===(V=W.cptId)||void 0===V?void 0:V.id:null===($=ge)||void 0===$||null===(z=$.cpt)||void 0===z||null===(Y=z.details)||void 0===Y?void 0:Y.propertyId:window.location.href.includes("/tl/tradelicence/edit-application")||window.location.href.includes("/renew-trade/")?null===(K=ge)||void 0===K||null===(q=K.tradeLicenseDetail)||void 0===q||null===(G=q.additionalDetail)||void 0===G?void 0:G.propertyId:(null===(Z=ge)||void 0===Z||null===(X=Z.cptId)||void 0===X?void 0:X.id)||(null===(J=ge)||void 0===J||null===(Q=J.cpt)||void 0===Q||null===(ee=Q.details)||void 0===ee?void 0:ee.propertyId)},tenantId:he,privacy:Digit.Utils.getPrivacyObject()}),Te=()=>{sessionStorage.setItem("cpt",null==be?void 0:be.Properties[0]),_e("cpt",{details:null==be?void 0:be.Properties[0]})},Ce=Array.isArray(null==be||null===(te=be.Properties)||void 0===te||null===(ne=te[0])||void 0===ne?void 0:ne.owners)?null==be||null===(le=be.Properties)||void 0===le||null===(oe=le[0])||void 0===oe?void 0:oe.owners.slice().reverse():[];let Ae=[];var Ne,Ie,Pe,Oe,De,we,Re,Le,xe,Me,Fe,ke,Be,Ue,je,He,We,Ve,$e,ze,Ye,Ke,qe,Ge,Ze,Xe,Je,Qe,et,tt,nt,lt,ot,it,rt;return be&&null!=be&&be.Properties.length&&(null!=be&&null!==(Ne=be.Properties[0])&&void 0!==Ne&&null!==(Ie=Ne.address)&&void 0!==Ie&&Ie.doorNo&&Ae.push(null==be||null===(je=be.Properties[0])||void 0===je||null===(He=je.address)||void 0===He?void 0:He.doorNo),(null!=be&&null!==(Pe=be.Properties[0])&&void 0!==Pe&&null!==(Oe=Pe.address)&&void 0!==Oe&&Oe.street||null!=be&&null!==(De=be.Properties[0])&&void 0!==De&&null!==(we=De.address)&&void 0!==we&&we.buildingName)&&Ae.push((null==be||null===(We=be.Properties[0])||void 0===We||null===(Ve=We.address)||void 0===Ve?void 0:Ve.street)||(null==be||null===($e=be.Properties[0])||void 0===$e||null===(ze=$e.address)||void 0===ze?void 0:ze.buildingName)),null!=be&&null!==(Re=be.Properties[0])&&void 0!==Re&&null!==(Le=Re.address)&&void 0!==Le&&Le.landmark&&Ae.push(null==be||null===(Ye=be.Properties[0])||void 0===Ye||null===(Ke=Ye.address)||void 0===Ke?void 0:Ke.landmark),null!=be&&null!==(xe=be.Properties[0])&&void 0!==xe&&null!==(Me=xe.address)&&void 0!==Me&&null!==(Fe=Me.locality)&&void 0!==Fe&&Fe.code&&Ae.push(Ee(Digit.Utils.pt.getMohallaLocale(null==be||null===(qe=be.Properties[0])||void 0===qe||null===(Ge=qe.address)||void 0===Ge||null===(Ze=Ge.locality)||void 0===Ze?void 0:Ze.code,null==be||null===(Xe=be.Properties[0])||void 0===Xe?void 0:Xe.tenantId))),null!=be&&null!==(ke=be.Properties[0])&&void 0!==ke&&ke.tenantId&&Ae.push(Ee(Digit.Utils.pt.getCityLocale(null==be||null===(Je=be.Properties[0])||void 0===Je?void 0:Je.tenantId))),null!=be&&null!==(Be=be.Properties[0])&&void 0!==Be&&null!==(Ue=Be.address)&&void 0!==Ue&&Ue.pincode&&Ae.push(null==be||null===(Qe=be.Properties[0])||void 0===Qe||null===(et=Qe.address)||void 0===et?void 0:et.pincode)),Se?l.createElement(t.Loader,null):l.createElement(l.Fragment,null,window.location.href.includes("/citizen")?l.createElement(go,{currentStep:window.location.href.includes("/ws/")?1:2,flow:window.location.href.includes("/ws/")?"WS":"",businessService:"WS"}):null,l.createElement(t.FormStep,{t:Ee,config:ye,onSelect:Te,onSkip:()=>_e()},be&&(null==be?void 0:be.Properties.length)&&l.createElement(l.Fragment,null,l.createElement(t.CardHeader,null,Ee("PT_DETAILS")),l.createElement(t.StatusTable,null,l.createElement(t.Row,{className:"border-none",label:Ee("PROPERTY_ID"),text:null==be||null===(ie=be.Properties[0])||void 0===ie?void 0:ie.propertyId}),l.createElement(t.Row,{className:"border-none",label:Ee("OWNER_NAME"),text:null==Ce||null===(re=Ce[0])||void 0===re?void 0:re.name}),l.createElement(t.Row,{className:"border-none",textStyle:{wordBreak:"break-word"},label:Ee("PROPERTY_ADDRESS"),text:Ae.join(", "),privacy:{uuid:null==be||null===(ae=be.Properties)||void 0===ae||null===(ue=ae[0])||void 0===ue||null===(de=ue.owners)||void 0===de||null===(se=de[0])||void 0===se?void 0:se.uuid,fieldName:["doorNo","street","landmark"],model:"Property",showValue:!0,loadData:{serviceName:"/property-services/property/_search",requestBody:{},requestParam:{tenantId:null==be||null===(ce=be.Properties[0])||void 0===ce?void 0:ce.tenantId,propertyIds:null==be||null===(pe=be.Properties[0])||void 0===pe?void 0:pe.propertyId},jsonPath:"Properties[0].address.street",d:e=>(_.get(e,"Properties[0].address.doorNo")?_.get(e,"Properties[0].address.doorNo")+", ":"")+(_.get(e,"Properties[0].address.street")?_.get(e,"Properties[0].address.street")+", ":"")+(_.get(e,"Properties[0].address.landmark")?""+_.get(e,"Properties[0].address.landmark"):""),isArray:!1}}}),l.createElement(t.Row,{className:"border-none",label:Ee("PT_MUTATION_STATUS"),text:Ee(null==be||null===(ve=be.Properties[0])||void 0===ve?void 0:ve.status)}),l.createElement("div",{style:{textAlign:"left"}},l.createElement(r.Link,{to:`/digit-ui/citizen/commonpt/view-property?propertyId=${null==be||null===(me=be.Properties[0])||void 0===me?void 0:me.propertyId}&tenantId=${null==be||null===(fe=be.Properties[0])||void 0===fe?void 0:fe.tenantId}`},l.createElement(t.LinkButton,{style:{textAlign:"left"},label:Ee("PT_VIEW_MORE_DETAILS")})),l.createElement(r.Link,{to:window.location.href.includes("/ws/modify-connection/")?`/digit-ui/citizen/ws/modify-connection/${null===(tt=ge)||void 0===tt?void 0:tt.tenantId}/search-property`:window.location.href.includes("/ws/edit-application/")?`/digit-ui/citizen/ws/edit-application/${null===(nt=ge)||void 0===nt?void 0:nt.tenantId}/search-property`:window.location.href.includes("/ws/")?"/digit-ui/citizen/ws/create-application/search-property":window.location.href.includes("/renew-trade/")?`/digit-ui/citizen/tl/tradelicence/renew-trade/${null===(lt=ge)||void 0===lt?void 0:lt.applicationNumber}/${null===(ot=ge)||void 0===ot?void 0:ot.tenantId}/know-your-property`:window.location.href.includes("/edit-application/")?`/digit-ui/citizen/tl/tradelicence/edit-application/${null===(it=ge)||void 0===it?void 0:it.applicationNumber}/${null===(rt=ge)||void 0===rt?void 0:rt.tenantId}/know-your-property`:"/digit-ui/citizen/tl/tradelicence/new-application/know-your-property"},l.createElement(t.LinkButton,{style:{textAlign:"left"},label:Ee("PT_CHANGE_PROPERTY"),onClick:()=>{sessionStorage.setItem("changePropertySelected","yes"),sessionStorage.setItem("EditFormData",JSON.stringify(ge))}})))),l.createElement(t.SubmitBar,{style:{marginTop:"10px"},onSubmit:Te,label:Ee("CS_COMMON_NEXT")}))))},CPTPropertySearchNSummary:e=>{var i,a,u,d,s,c,v,m,f,E,y,_,g;let{config:h,onSelect:S,formData:b}=e;const{t:T}=o.useTranslation(),C=r.useHistory();let{pathname:A,state:N}=r.useLocation();N=N&&("string"==typeof N||N instanceof String)?JSON.parse(N):N;const I=A.includes("/modify-application/"),P=Digit.ULBService.getCurrentTenantId(),O=window.location.href.includes("/employee/tl/new-application"),D=window.location.href.includes("/employee/tl/renew-application-details")||window.location.href.includes("/employee/tl/edit-application-details"),w=r.useLocation().search,R=new URLSearchParams(w).get("propertyId"),[L,x]=n.useState((null==b||null===(i=b.cptId)||void 0===i?void 0:i.id)||("null"!==R?R:"")||""),[M,F]=n.useState("null"!==R?R:""),[k,B]=n.useState(null),U=window.Digit.Utils.browser.isMobile(),j=window.location.href.includes("?")?window.location.href.substring(window.location.href.indexOf("?")+1,window.location.href.length):"",{isLoading:H,error:W,data:V}=Digit.Hooks.pt.usePropertySearch({filters:{propertyIds:M},tenantId:P},{filters:{propertyIds:M},tenantId:P,enabled:!!M,privacy:Digit.Utils.getPrivacyObject()});if(n.useEffect(()=>{L&&(window.location.href.includes("/renew-application-details/")||window.location.href.includes("/edit-application-details/"))&&F(L)},[L]),n.useEffect(()=>{var e;(0==H&&W&&1==W||0==(null==V||null===(e=V.Properties)||void 0===e?void 0:e.length))&&B({error:!0,label:"PT_ENTER_VALID_PROPERTY_ID"})},[W,V]),n.useEffect(()=>{S("cpt",{details:null==V?void 0:V.Properties[0]}),sessionStorage.setItem("Digit_FSM_PT",JSON.stringify(null==V?void 0:V.Properties[0])),localStorage.setItem("pgrProperty",JSON.stringify(null==V?void 0:V.Properties[0]))},[V,A]),I)return l.createElement(l.Fragment,null);const $=window.location.pathname;let z="";var Y,K,q,G,Z;return V&&null!=V&&V.Properties.length&&(z=((e,t)=>`${null!=e&&e.doorNo?(null==e?void 0:e.doorNo)+", ":""} ${null!=e&&e.street?(null==e?void 0:e.street)+", ":""}${null!=e&&e.landmark?(null==e?void 0:e.landmark)+", ":""}${t(Digit.Utils.pt.getMohallaLocale(null==e?void 0:e.locality.code,null==e?void 0:e.tenantId))}, ${t(Digit.Utils.pt.getCityLocale(null==e?void 0:e.tenantId))}${null!=e&&e.pincode&&t(null==e?void 0:e.pincode)?", "+e.pincode:" "}`)(null==V||null===(Y=V.Properties[0])||void 0===Y?void 0:Y.address,T)),window.location.href.includes("/ws/"),l.createElement(t.Card,{className:"no-shadow"},(!window.location.href.includes("/tl/")||!("MOVABLE"===(null==b||null===(a=b.tradedetils)||void 0===a||null===(u=a[0])||void 0===u||null===(d=u.structureType)||void 0===d?void 0:d.code))&&(O||D))&&l.createElement(l.Fragment,null,l.createElement(t.LabelFieldPair,null,l.createElement(t.Label,{style:window.location.href.includes("/ws/")?{fontWeight:"700"}:{}},""+T("PROPERTY_ID")),l.createElement("div",{style:{display:"flex",gap:"12px"}},l.createElement(t.TextInput,{key:h.key,value:L,onChange:e=>{x(e.target.value),S(h.key,{id:e.target.value})},style:{width:"80%",float:"left"}}),l.createElement("button",{className:"submit-bar",type:"button",style:{color:"white"},onClick:()=>{if(L||B({error:!0,label:"PT_ENTER_PROPERTY_ID_AND_SEARCH"}),F(L),window.location.pathname.includes("/tl/new-application")){C.push("/digit-ui/employee/tl/new-application?propertyId="+L);const e=1600;setTimeout(()=>window.scrollTo(0,e),0)}else window.location.pathname.includes("/ws/new-application")&&C.push("/digit-ui/employee/ws/new-application?propertyId="+L)}},""+T("PT_SEARCH")))),l.createElement("span",{onClick:()=>C.push(`/digit-ui/employee/commonpt/search?redirectToUrl=${$}&${j}`,{...N})},l.createElement(t.LinkButton,{label:T("CPT_SEARCH_PROPERTY"),style:{color:"#a82227",display:"inline-block"}})),"  |  ",l.createElement("span",{onClick:()=>C.push(`/digit-ui/employee/commonpt/new-application?redirectToUrl=${$}&${j}`,{...N})},l.createElement(t.LinkButton,{label:T("CPT_CREATE_PROPERTY"),style:{color:"#a82227",display:"inline-block"}})),V&&null!=V&&V.Properties.length?l.createElement(l.Fragment,null,l.createElement("header",{className:"card-section-header",style:{marginBottom:"5px",marginTop:"20px"}},T("PT_DETAILS")),l.createElement(t.StatusTable,null,l.createElement("div",{className:"formcomposer-section-grid",style:{}},l.createElement(t.Row,{className:"border-none",labelStyle:U?{width:"40%"}:{},label:T("PROPERTY_ID"),text:null==V||null===(s=V.Properties[0])||void 0===s?void 0:s.propertyId}),l.createElement(t.Row,{className:"border-none",labelStyle:U?{width:"40%"}:{},label:T("OWNER_NAME"),text:(K=null==V?void 0:V.Properties[0],(null===(G=(null==K||null===(q=K.owners)||void 0===q?void 0:q.filter(e=>null==e?void 0:e.active)).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)}))||void 0===G||null===(Z=G.map(e=>null==e?void 0:e.name))||void 0===Z?void 0:Z.join(","))||T("NA"))}),l.createElement(t.Row,{className:"border-none",labelStyle:U?{width:"40%"}:{},textStyle:{wordBreak:"break-word"},label:T("PROPERTY_ADDRESS"),text:z,privacy:{uuid:null==V||null===(c=V.Properties[0])||void 0===c||null===(v=c.owners)||void 0===v||null===(m=v[0])||void 0===m?void 0:m.uuid,fieldName:["doorNo","street","landmark"],model:"Property",showValue:!0,loadData:{serviceName:"/property-services/property/_search",requestBody:{},requestParam:{tenantId:null==V||null===(f=V.Properties[0])||void 0===f?void 0:f.tenantId,propertyIds:null==V||null===(E=V.Properties[0])||void 0===E?void 0:E.propertyId},jsonPath:"Properties[0].address.street",d:e=>(p.get(e,"Properties[0].address.doorNo")?p.get(e,"Properties[0].address.doorNo")+", ":"")+(p.get(e,"Properties[0].address.street")?p.get(e,"Properties[0].address.street")+", ":"")+(p.get(e,"Properties[0].address.landmark")?""+p.get(e,"Properties[0].address.landmark"):""),isArray:!1}}}))),l.createElement(r.Link,{to:`/digit-ui/employee/commonpt/view-property?propertyId=${L}&tenantId=${P}&from=${null!==(y=window.location.pathname)&&void 0!==y&&y.includes("employee/ws/new-application")?"ES_COMMON_WS_NEW_CONNECTION":null!==(_=window.location.pathname)&&void 0!==_&&_.includes("employee/ws/modify-application")?"WS_MODIFY_CONNECTION_BUTTON":null!==(g=window.location.pathname)&&void 0!==g&&g.includes("employee/tl/new-application")?"ES_TITLE_NEW_TRADE_LICESE_APPLICATION":"WF_EMPLOYEE_NEWTL_RENEWAL_SUBMIT_BUTTON"}`},l.createElement(t.LinkButton,{label:T("CPT_COMPLETE_PROPERTY_DETAILS"),style:{color:"#a82227",textAlign:"Left"}}))):null,k&&l.createElement(t.Toast,{isDleteBtn:!0,labelstyle:{width:"100%"},error:k.error,warning:k.warning,label:T(k.label),onClose:()=>{B(null)}})))},CPTSearchResults:Te,CPTCreateProperty:v,CPTAcknowledgement:T},So=e=>{let{stateCode:t,userType:n,tenants:o}=e;const{path:i,url:a}=r.useRouteMatch(),u=Digit.StoreData.getCurrentLanguage();return Digit.Services.useStore({stateCode:t,moduleCode:"PT",language:u}),Object.entries(ho).forEach(e=>{let[t,n]=e;Digit.ComponentRegistryService.setComponent(t,n)}),Digit.SessionStorage.set("PT_TENANTS",o),"employee"===n?l.createElement(fo,{path:i,url:a,userType:n}):l.createElement(so,{stateCode:t})},bo=e=>{let{matchPath:i}=e;const{t:r}=o.useTranslation(),[a,u,d]=Digit.Hooks.useSessionStorage("CPT_CREATE_PROPERTY",{});n.useEffect(()=>{d()},[]);const s=[{link:i+"/property/citizen-search",i18nKey:r("PT_SEARCH_AND_PAY")},{link:i+"/property/new-application",i18nKey:r("PT_CREATE_PROPERTY")}];return l.createElement(t.CitizenHomeCard,{header:r("ACTION_TEST_COMMON_PROPERTY_TAX"),links:s,Icon:()=>l.createElement(t.PTIcon,{className:"fill-path-primary-main"})})},To={CommonPTCardTemp:()=>{var e;const{t:n}=o.useTranslation();if(!Digit.Utils.ptAccess())return null;const i={Icon:l.createElement(t.PropertyHouse,null),moduleName:n("ACTION_TEST_COMMON_PROPERTY_TAX"),links:[{label:n("PT_SEARCH_AND_PAY"),link:"/digit-ui/employee/commonpt/search"}]};return!Digit.UserService.hasAccess(["PT_CEMP"])||null!==(e=i.links)&&void 0!==e&&e[1]||i.links.push({label:n("PT_CREATE_PROPERTY"),link:"/digit-ui/employee/commonpt/new-application"}),l.createElement(t.EmployeeModuleCard,i)},CommonPTModule:So,CommonPTLinksTemp:bo,...ho};exports.CommonPTComponents=To,exports.CommonPTLinks=bo,exports.CommonPTModule=So,exports.initCommonPTComponents=()=>{Object.entries(To).forEach(e=>{let[t,n]=e;Digit.ComponentRegistryService.setComponent(t,n)})};
1
+ var e,t=require("@djb25/digit-ui-react-components"),n=require("react"),l=(e=n)&&"object"==typeof e&&"default"in e?e.default:e,o=require("react-i18next"),i=require("react-router-dom"),r=require("react-query"),a=require("react-hook-form");const u=[{head:"PT_LOCATION_DETAILS",body:[{type:"component",route:"property-type",isMandatory:!0,component:"CPTPropertyLocationDetails",texts:{headerCaption:"",header:"PT_LOCATION_DETAILS",cardText:"",submitBarLabel:"PT_COMMONS_NEXT"},nextStep:{COMMON_PROPTYPE_BUILTUP_INDEPENDENTPROPERTY:"landarea",COMMON_PROPTYPE_BUILTUP_SHAREDPROPERTY:"PtUnits",COMMON_PROPTYPE_VACANT:"area"},key:"locationDet",withoutLabel:!0,colSpan:"span 2"}]},{head:"PT_PROPERTY_WATER_CONNECTION",body:[{type:"component",route:"property-type",isMandatory:!1,component:"PropertyWaterConnection",texts:{headerCaption:"",header:"PT_PROPERTY_WATER_CONNECTION",cardText:"",submitBarLabel:"PT_COMMONS_NEXT"},key:"waterConnection",withoutLabel:!0,colSpan:"span 2"}]},{head:"PT_OWNERSHIP_DETAILS",body:[{type:"component",route:"institutional-owner-address",isMandatory:!1,component:"CPTPropertyOwnerDetails",texts:{headerCaption:"PT_OWNERS_DETAILS",header:"PT_OWNERS_ADDRESS",cardText:"",submitBarLabel:"PT_COMMON_NEXT"},key:"owners",withoutLabel:!0,nextStep:"institutional-proof-of-identity",colSpan:"span 2"}]}];var d="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function s(e,t){return e(t={exports:{}},t.exports),t.exports}var c=s(function(e,t){(function(){var n="Expected a function",l="__lodash_placeholder__",o=[["ary",128],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",32],["partialRight",64],["rearg",256]],i="[object Arguments]",r="[object Array]",a="[object Boolean]",u="[object Date]",s="[object Error]",c="[object Function]",p="[object GeneratorFunction]",v="[object Map]",m="[object Number]",f="[object Object]",E="[object RegExp]",y="[object Set]",_="[object String]",g="[object Symbol]",h="[object WeakMap]",S="[object ArrayBuffer]",b="[object DataView]",T="[object Float32Array]",C="[object Float64Array]",A="[object Int8Array]",D="[object Int16Array]",N="[object Int32Array]",I="[object Uint8Array]",O="[object Uint16Array]",P="[object Uint32Array]",w=/\b__p \+= '';/g,R=/\b(__p \+=) '' \+/g,L=/(__e\(.*?\)|\b__t\)) \+\n'';/g,x=/&(?:amp|lt|gt|quot|#39);/g,M=/[&<>"']/g,F=RegExp(x.source),k=RegExp(M.source),U=/<%-([\s\S]+?)%>/g,B=/<%([\s\S]+?)%>/g,j=/<%=([\s\S]+?)%>/g,H=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,W=/^\w*$/,V=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,z=/[\\^$.*+?()[\]{}|]/g,$=RegExp(z.source),Y=/^\s+/,K=/\s/,q=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,G=/\{\n\/\* \[wrapped with (.+)\] \*/,Z=/,? & /,X=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,J=/[()=,{}\[\]\/\s]/,Q=/\\(\\)?/g,ee=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,te=/\w*$/,ne=/^[-+]0x[0-9a-f]+$/i,le=/^0b[01]+$/i,oe=/^\[object .+?Constructor\]$/,ie=/^0o[0-7]+$/i,re=/^(?:0|[1-9]\d*)$/,ae=/[\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",pe="["+ce+"]",ve="["+se+"]",me="\\d+",fe="[a-z\\xdf-\\xf6\\xf8-\\xff]",Ee="[^\\ud800-\\udfff"+ce+me+"\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",ye="\\ud83c[\\udffb-\\udfff]",_e="[^\\ud800-\\udfff]",ge="(?:\\ud83c[\\udde6-\\uddff]){2}",he="[\\ud800-\\udbff][\\udc00-\\udfff]",Se="[A-Z\\xc0-\\xd6\\xd8-\\xde]",be="(?:"+fe+"|"+Ee+")",Te="(?:"+Se+"|"+Ee+")",Ce="(?:"+ve+"|"+ye+")?",Ae="[\\ufe0e\\ufe0f]?"+Ce+"(?:\\u200d(?:"+[_e,ge,he].join("|")+")[\\ufe0e\\ufe0f]?"+Ce+")*",De="(?:"+["[\\u2700-\\u27bf]",ge,he].join("|")+")"+Ae,Ne="(?:"+[_e+ve+"?",ve,ge,he,"[\\ud800-\\udfff]"].join("|")+")",Ie=RegExp("['’]","g"),Oe=RegExp(ve,"g"),Pe=RegExp(ye+"(?="+ye+")|"+Ne+Ae,"g"),we=RegExp([Se+"?"+fe+"+(?:['’](?:d|ll|m|re|s|t|ve))?(?="+[pe,Se,"$"].join("|")+")",Te+"+(?:['’](?:D|LL|M|RE|S|T|VE))?(?="+[pe,Se+be,"$"].join("|")+")",Se+"?"+be+"+(?:['’](?: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_])",me,De].join("|"),"g"),Re=RegExp("[\\u200d\\ud800-\\udfff"+se+"\\ufe0e\\ufe0f]"),Le=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,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"],Me=-1,Fe={};Fe[T]=Fe[C]=Fe[A]=Fe[D]=Fe[N]=Fe[I]=Fe["[object Uint8ClampedArray]"]=Fe[O]=Fe[P]=!0,Fe[i]=Fe[r]=Fe[S]=Fe[a]=Fe[b]=Fe[u]=Fe[s]=Fe[c]=Fe[v]=Fe[m]=Fe[f]=Fe[E]=Fe[y]=Fe[_]=Fe[h]=!1;var ke={};ke[i]=ke[r]=ke[S]=ke[b]=ke[a]=ke[u]=ke[T]=ke[C]=ke[A]=ke[D]=ke[N]=ke[v]=ke[m]=ke[f]=ke[E]=ke[y]=ke[_]=ke[g]=ke[I]=ke["[object Uint8ClampedArray]"]=ke[O]=ke[P]=!0,ke[s]=ke[c]=ke[h]=!1;var Ue={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Be=parseFloat,je=parseInt,He="object"==typeof d&&d&&d.Object===Object&&d,We="object"==typeof self&&self&&self.Object===Object&&self,Ve=He||We||Function("return this")(),ze=t&&!t.nodeType&&t,$e=ze&&e&&!e.nodeType&&e,Ye=$e&&$e.exports===ze,Ke=Ye&&He.process,qe=function(){try{return $e&&$e.require&&$e.require("util").types||Ke&&Ke.binding&&Ke.binding("util")}catch(e){}}(),Ge=qe&&qe.isArrayBuffer,Ze=qe&&qe.isDate,Xe=qe&&qe.isMap,Je=qe&&qe.isRegExp,Qe=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 o=-1,i=null==e?0:e.length;++o<i;){var r=e[o];t(l,r,n(r),e)}return l}function lt(e,t){for(var n=-1,l=null==e?0:e.length;++n<l&&!1!==t(e[n],n,e););return e}function ot(e,t){for(var n=null==e?0:e.length;n--&&!1!==t(e[n],n,e););return e}function it(e,t){for(var n=-1,l=null==e?0:e.length;++n<l;)if(!t(e[n],n,e))return!1;return!0}function rt(e,t){for(var n=-1,l=null==e?0:e.length,o=0,i=[];++n<l;){var r=e[n];t(r,n,e)&&(i[o++]=r)}return i}function at(e,t){return!(null==e||!e.length)&&yt(e,t,0)>-1}function ut(e,t,n){for(var l=-1,o=null==e?0:e.length;++l<o;)if(n(t,e[l]))return!0;return!1}function dt(e,t){for(var n=-1,l=null==e?0:e.length,o=Array(l);++n<l;)o[n]=t(e[n],n,e);return o}function st(e,t){for(var n=-1,l=t.length,o=e.length;++n<l;)e[o+n]=t[n];return e}function ct(e,t,n,l){var o=-1,i=null==e?0:e.length;for(l&&i&&(n=e[++o]);++o<i;)n=t(n,e[o],o,e);return n}function pt(e,t,n,l){var o=null==e?0:e.length;for(l&&o&&(n=e[--o]);o--;)n=t(n,e[o],o,e);return n}function vt(e,t){for(var n=-1,l=null==e?0:e.length;++n<l;)if(t(e[n],n,e))return!0;return!1}var mt=St("length");function ft(e,t,n){var l;return n(e,function(e,n,o){if(t(e,n,o))return l=n,!1}),l}function Et(e,t,n,l){for(var o=e.length,i=n+(l?1:-1);l?i--:++i<o;)if(t(e[i],i,e))return i;return-1}function yt(e,t,n){return t==t?function(e,t,n){for(var l=n-1,o=e.length;++l<o;)if(e[l]===t)return l;return-1}(e,t,n):Et(e,gt,n)}function _t(e,t,n,l){for(var o=n-1,i=e.length;++o<i;)if(l(e[o],t))return o;return-1}function gt(e){return e!=e}function ht(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 bt(e){return function(t){return null==e?void 0:e[t]}}function Tt(e,t,n,l,o){return o(e,function(e,o,i){n=l?(l=!1,e):t(n,e,o,i)}),n}function Ct(e,t){for(var n,l=-1,o=e.length;++l<o;){var i=t(e[l]);void 0!==i&&(n=void 0===n?i:n+i)}return n}function At(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,zt(e)+1).replace(Y,""):e}function Nt(e){return function(t){return e(t)}}function It(e,t){return dt(t,function(t){return e[t]})}function Ot(e,t){return e.has(t)}function Pt(e,t){for(var n=-1,l=e.length;++n<l&&yt(t,e[n],0)>-1;);return n}function wt(e,t){for(var n=e.length;n--&&yt(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 Lt=bt({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),xt=bt({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"});function Mt(e){return"\\"+Ue[e]}function Ft(e){return Re.test(e)}function kt(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 Bt(e,t){for(var n=-1,o=e.length,i=0,r=[];++n<o;){var a=e[n];a!==t&&a!==l||(e[n]=l,r[i++]=n)}return r}function jt(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 Wt(e){return Ft(e)?function(e){for(var t=Pe.lastIndex=0;Pe.test(e);)++t;return t}(e):mt(e)}function Vt(e){return Ft(e)?function(e){return e.match(Pe)||[]}(e):function(e){return e.split("")}(e)}function zt(e){for(var t=e.length;t--&&K.test(e.charAt(t)););return t}var $t=bt({"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"}),Yt=function e(t){var d,K=(t=null==t?Ve:Yt.defaults(Ve.Object(),t,Yt.pick(Ve,xe))).Array,se=t.Date,ce=t.Error,pe=t.Function,ve=t.Math,me=t.Object,fe=t.RegExp,Ee=t.String,ye=t.TypeError,_e=K.prototype,ge=me.prototype,he=t["__core-js_shared__"],Se=pe.prototype.toString,be=ge.hasOwnProperty,Te=0,Ce=(d=/[^.]+$/.exec(he&&he.keys&&he.keys.IE_PROTO||""))?"Symbol(src)_1."+d:"",Ae=ge.toString,De=Se.call(me),Ne=Ve._,Pe=fe("^"+Se.call(be).replace(z,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Re=Ye?t.Buffer:void 0,Ue=t.Symbol,He=t.Uint8Array,We=Re?Re.allocUnsafe:void 0,ze=Ut(me.getPrototypeOf,me),$e=me.create,Ke=ge.propertyIsEnumerable,qe=_e.splice,mt=Ue?Ue.isConcatSpreadable:void 0,bt=Ue?Ue.iterator:void 0,Kt=Ue?Ue.toStringTag:void 0,qt=function(){try{var e=Qo(me,"defineProperty");return e({},"",{}),e}catch(e){}}(),Gt=t.clearTimeout!==Ve.clearTimeout&&t.clearTimeout,Zt=se&&se.now!==Ve.Date.now&&se.now,Xt=t.setTimeout!==Ve.setTimeout&&t.setTimeout,Jt=ve.ceil,Qt=ve.floor,en=me.getOwnPropertySymbols,tn=Re?Re.isBuffer:void 0,nn=t.isFinite,ln=_e.join,on=Ut(me.keys,me),rn=ve.max,an=ve.min,un=se.now,dn=t.parseInt,sn=ve.random,cn=_e.reverse,pn=Qo(t,"DataView"),vn=Qo(t,"Map"),mn=Qo(t,"Promise"),fn=Qo(t,"Set"),En=Qo(t,"WeakMap"),yn=Qo(me,"create"),_n=En&&new En,gn={},hn=Ii(pn),Sn=Ii(vn),bn=Ii(mn),Tn=Ii(fn),Cn=Ii(En),An=Ue?Ue.prototype:void 0,Dn=An?An.valueOf:void 0,Nn=An?An.toString:void 0;function In(e){if($r(e)&&!xr(e)&&!(e instanceof Rn)){if(e instanceof wn)return e;if(be.call(e,"__wrapped__"))return Oi(e)}return new wn(e)}var On=function(){function e(){}return function(t){if(!zr(t))return{};if($e)return $e(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function Pn(){}function wn(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=void 0}function Rn(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=4294967295,this.__views__=[]}function Ln(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var l=e[t];this.set(l[0],l[1])}}function 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 Mn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var l=e[t];this.set(l[0],l[1])}}function Fn(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new Mn;++t<n;)this.add(e[t])}function kn(e){var t=this.__data__=new xn(e);this.size=t.size}function Un(e,t){var n=xr(e),l=!n&&Lr(e),o=!n&&!l&&Ur(e),i=!n&&!l&&!o&&Qr(e),r=n||l||o||i,a=r?At(e.length,Ee):[],u=a.length;for(var d in e)!t&&!be.call(e,d)||r&&("length"==d||o&&("offset"==d||"parent"==d)||i&&("buffer"==d||"byteLength"==d||"byteOffset"==d)||ri(d,u))||a.push(d);return a}function Bn(e){var t=e.length;return t?e[Ml(0,t-1)]:void 0}function jn(e,t){return Ti(yo(e),Gn(t,0,e.length))}function Hn(e){return Ti(yo(e))}function Wn(e,t,n){(void 0!==n&&!Pr(e[t],n)||void 0===n&&!(t in e))&&Kn(e,t,n)}function Vn(e,t,n){var l=e[t];be.call(e,t)&&Pr(l,n)&&(void 0!==n||t in e)||Kn(e,t,n)}function zn(e,t){for(var n=e.length;n--;)if(Pr(e[n][0],t))return n;return-1}function $n(e,t,n,l){return el(e,function(e,o,i){t(l,e,n(e),i)}),l}function Yn(e,t){return e&&_o(t,Sa(t),e)}function Kn(e,t,n){"__proto__"==t&&qt?qt(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function qn(e,t){for(var n=-1,l=t.length,o=K(l),i=null==e;++n<l;)o[n]=i?void 0:Ea(e,t[n]);return o}function Gn(e,t,n){return e==e&&(void 0!==n&&(e=e<=n?e:n),void 0!==t&&(e=e>=t?e:t)),e}function Zn(e,t,n,l,o,r){var d,s=1&t,h=2&t,w=4&t;if(n&&(d=o?n(e,l,o,r):n(e)),void 0!==d)return d;if(!zr(e))return e;var R=xr(e);if(R){if(d=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&be.call(e,"index")&&(n.index=e.index,n.input=e.input),n}(e),!s)return yo(e,d)}else{var L=ni(e),x=L==c||L==p;if(Ur(e))return co(e,s);if(L==f||L==i||x&&!o){if(d=h||x?{}:oi(e),!s)return h?function(e,t){return _o(e,ti(e),t)}(e,function(e,t){return e&&_o(t,ba(t),e)}(d,e)):function(e,t){return _o(e,ei(e),t)}(e,Yn(d,e))}else{if(!ke[L])return o?e:{};d=function(e,t,n){var l=e.constructor;switch(t){case S:return po(e);case a:case u:return new l(+e);case b:return function(e,t){var n=t?po(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,n);case T:case C:case A:case D:case N:case I:case"[object Uint8ClampedArray]":case O:case P:return vo(e,n);case v:return new l;case m:case _:return new l(e);case E:return function(e){var t=new e.constructor(e.source,te.exec(e));return t.lastIndex=e.lastIndex,t}(e);case y:return new l;case g:return Dn?me(Dn.call(e)):{}}}(e,L,s)}}r||(r=new kn);var M=r.get(e);if(M)return M;r.set(e,d),Zr(e)?e.forEach(function(l){d.add(Zn(l,t,n,l,e,r))}):Yr(e)&&e.forEach(function(l,o){d.set(o,Zn(l,t,n,o,e,r))});var F=R?void 0:(w?h?Yo:$o:h?ba:Sa)(e);return lt(F||e,function(l,o){F&&(l=e[o=l]),Vn(d,o,Zn(l,t,n,o,e,r))}),d}function Xn(e,t,n){var l=n.length;if(null==e)return!l;for(e=me(e);l--;){var o=n[l],i=e[o];if(void 0===i&&!(o in e)||!(0,t[o])(i))return!1}return!0}function Jn(e,t,l){if("function"!=typeof e)throw new ye(n);return gi(function(){e.apply(void 0,l)},t)}function Qn(e,t,n,l){var o=-1,i=at,r=!0,a=e.length,u=[],d=t.length;if(!a)return u;n&&(t=dt(t,Nt(n))),l?(i=ut,r=!1):t.length>=200&&(i=Ot,r=!1,t=new Fn(t));e:for(;++o<a;){var s=e[o],c=null==n?s:n(s);if(s=l||0!==s?s:0,r&&c==c){for(var p=d;p--;)if(t[p]===c)continue e;u.push(s)}else i(t,c,l)||u.push(s)}return u}In.templateSettings={escape:U,evaluate:B,interpolate:j,variable:"",imports:{_:In}},(In.prototype=Pn.prototype).constructor=In,(wn.prototype=On(Pn.prototype)).constructor=wn,(Rn.prototype=On(Pn.prototype)).constructor=Rn,Ln.prototype.clear=function(){this.__data__=yn?yn(null):{},this.size=0},Ln.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Ln.prototype.get=function(e){var t=this.__data__;if(yn){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return be.call(t,e)?t[e]:void 0},Ln.prototype.has=function(e){var t=this.__data__;return yn?void 0!==t[e]:be.call(t,e)},Ln.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=yn&&void 0===t?"__lodash_hash_undefined__":t,this},xn.prototype.clear=function(){this.__data__=[],this.size=0},xn.prototype.delete=function(e){var t=this.__data__,n=zn(t,e);return!(n<0||(n==t.length-1?t.pop():qe.call(t,n,1),--this.size,0))},xn.prototype.get=function(e){var t=this.__data__,n=zn(t,e);return n<0?void 0:t[n][1]},xn.prototype.has=function(e){return zn(this.__data__,e)>-1},xn.prototype.set=function(e,t){var n=this.__data__,l=zn(n,e);return l<0?(++this.size,n.push([e,t])):n[l][1]=t,this},Mn.prototype.clear=function(){this.size=0,this.__data__={hash:new Ln,map:new(vn||xn),string:new Ln}},Mn.prototype.delete=function(e){var t=Xo(this,e).delete(e);return this.size-=t?1:0,t},Mn.prototype.get=function(e){return Xo(this,e).get(e)},Mn.prototype.has=function(e){return Xo(this,e).has(e)},Mn.prototype.set=function(e,t){var n=Xo(this,e),l=n.size;return n.set(e,t),this.size+=n.size==l?0:1,this},Fn.prototype.add=Fn.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},Fn.prototype.has=function(e){return this.__data__.has(e)},kn.prototype.clear=function(){this.__data__=new xn,this.size=0},kn.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},kn.prototype.get=function(e){return this.__data__.get(e)},kn.prototype.has=function(e){return this.__data__.has(e)},kn.prototype.set=function(e,t){var n=this.__data__;if(n instanceof xn){var l=n.__data__;if(!vn||l.length<199)return l.push([e,t]),this.size=++n.size,this;n=this.__data__=new Mn(l)}return n.set(e,t),this.size=n.size,this};var el=So(ul),tl=So(dl,!0);function nl(e,t){var n=!0;return el(e,function(e,l,o){return n=!!t(e,l,o)}),n}function ll(e,t,n){for(var l=-1,o=e.length;++l<o;){var i=e[l],r=t(i);if(null!=r&&(void 0===a?r==r&&!Jr(r):n(r,a)))var a=r,u=i}return u}function ol(e,t){var n=[];return el(e,function(e,l,o){t(e,l,o)&&n.push(e)}),n}function il(e,t,n,l,o){var i=-1,r=e.length;for(n||(n=ii),o||(o=[]);++i<r;){var a=e[i];t>0&&n(a)?t>1?il(a,t-1,n,l,o):st(o,a):l||(o[o.length]=a)}return o}var rl=bo(),al=bo(!0);function ul(e,t){return e&&rl(e,t,Sa)}function dl(e,t){return e&&al(e,t,Sa)}function sl(e,t){return rt(t,function(t){return Hr(e[t])})}function cl(e,t){for(var n=0,l=(t=ro(t,e)).length;null!=e&&n<l;)e=e[Ni(t[n++])];return n&&n==l?e:void 0}function pl(e,t,n){var l=t(e);return xr(e)?l:st(l,n(e))}function vl(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Kt&&Kt in me(e)?function(e){var t=be.call(e,Kt),n=e[Kt];try{e[Kt]=void 0;var l=!0}catch(e){}var o=Ae.call(e);return l&&(t?e[Kt]=n:delete e[Kt]),o}(e):function(e){return Ae.call(e)}(e)}function ml(e,t){return e>t}function fl(e,t){return null!=e&&be.call(e,t)}function El(e,t){return null!=e&&t in me(e)}function yl(e,t,n){for(var l=n?ut:at,o=e[0].length,i=e.length,r=i,a=K(i),u=Infinity,d=[];r--;){var s=e[r];r&&t&&(s=dt(s,Nt(t))),u=an(s.length,u),a[r]=!n&&(t||o>=120&&s.length>=120)?new Fn(r&&s):void 0}s=e[0];var c=-1,p=a[0];e:for(;++c<o&&d.length<u;){var v=s[c],m=t?t(v):v;if(v=n||0!==v?v:0,!(p?Ot(p,m):l(d,m,n))){for(r=i;--r;){var f=a[r];if(!(f?Ot(f,m):l(e[r],m,n)))continue e}p&&p.push(m),d.push(v)}}return d}function _l(e,t,n){var l=null==(e=fi(e,t=ro(t,e)))?e:e[Ni(ji(t))];return null==l?void 0:tt(l,e,n)}function gl(e){return $r(e)&&vl(e)==i}function hl(e,t,n,l,o){return e===t||(null==e||null==t||!$r(e)&&!$r(t)?e!=e&&t!=t:function(e,t,n,l,o,d){var c=xr(e),p=xr(t),h=c?r:ni(e),T=p?r:ni(t),C=(h=h==i?f:h)==f,A=(T=T==i?f:T)==f,D=h==T;if(D&&Ur(e)){if(!Ur(t))return!1;c=!0,C=!1}if(D&&!C)return d||(d=new kn),c||Qr(e)?Vo(e,t,n,l,o,d):function(e,t,n,l,o,i,r){switch(n){case b:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case S:return!(e.byteLength!=t.byteLength||!i(new He(e),new He(t)));case a:case u:case m:return Pr(+e,+t);case s:return e.name==t.name&&e.message==t.message;case E:case _:return e==t+"";case v:var d=kt;case y:if(d||(d=jt),e.size!=t.size&&!(1&l))return!1;var c=r.get(e);if(c)return c==t;l|=2,r.set(e,t);var p=Vo(d(e),d(t),l,o,i,r);return r.delete(e),p;case g:if(Dn)return Dn.call(e)==Dn.call(t)}return!1}(e,t,h,n,l,o,d);if(!(1&n)){var N=C&&be.call(e,"__wrapped__"),I=A&&be.call(t,"__wrapped__");if(N||I){var O=N?e.value():e,P=I?t.value():t;return d||(d=new kn),o(O,P,n,l,d)}}return!!D&&(d||(d=new kn),function(e,t,n,l,o,i){var r=1&n,a=$o(e),u=a.length;if(u!=$o(t).length&&!r)return!1;for(var d=u;d--;){var s=a[d];if(!(r?s in t:be.call(t,s)))return!1}var c=i.get(e),p=i.get(t);if(c&&p)return c==t&&p==e;var v=!0;i.set(e,t),i.set(t,e);for(var m=r;++d<u;){var f=e[s=a[d]],E=t[s];if(l)var y=r?l(E,f,s,t,e,i):l(f,E,s,e,t,i);if(!(void 0===y?f===E||o(f,E,n,l,i):y)){v=!1;break}m||(m="constructor"==s)}if(v&&!m){var _=e.constructor,g=t.constructor;_==g||!("constructor"in e)||!("constructor"in t)||"function"==typeof _&&_ instanceof _&&"function"==typeof g&&g instanceof g||(v=!1)}return i.delete(e),i.delete(t),v}(e,t,n,l,o,d))}(e,t,n,l,hl,o))}function Sl(e,t,n,l){var o=n.length,i=o,r=!l;if(null==e)return!i;for(e=me(e);o--;){var a=n[o];if(r&&a[2]?a[1]!==e[a[0]]:!(a[0]in e))return!1}for(;++o<i;){var u=(a=n[o])[0],d=e[u],s=a[1];if(r&&a[2]){if(void 0===d&&!(u in e))return!1}else{var c=new kn;if(l)var p=l(d,s,u,e,t,c);if(!(void 0===p?hl(s,d,3,l,c):p))return!1}}return!0}function bl(e){return!(!zr(e)||(t=e,Ce&&Ce in t))&&(Hr(e)?Pe:oe).test(Ii(e));var t}function Tl(e){return"function"==typeof e?e:null==e?Ka:"object"==typeof e?xr(e)?Il(e[0],e[1]):Nl(e):nu(e)}function Cl(e){if(!ci(e))return on(e);var t=[];for(var n in me(e))be.call(e,n)&&"constructor"!=n&&t.push(n);return t}function Al(e,t){return e<t}function Dl(e,t){var n=-1,l=Fr(e)?K(e.length):[];return el(e,function(e,o,i){l[++n]=t(e,o,i)}),l}function Nl(e){var t=Jo(e);return 1==t.length&&t[0][2]?vi(t[0][0],t[0][1]):function(n){return n===e||Sl(n,e,t)}}function Il(e,t){return ui(e)&&pi(t)?vi(Ni(e),t):function(n){var l=Ea(n,e);return void 0===l&&l===t?ya(n,e):hl(t,l,3)}}function Ol(e,t,n,l,o){e!==t&&rl(t,function(i,r){if(o||(o=new kn),zr(i))!function(e,t,n,l,o,i,r){var a=yi(e,n),u=yi(t,n),d=r.get(u);if(d)Wn(e,n,d);else{var s=i?i(a,u,n+"",e,t,r):void 0,c=void 0===s;if(c){var p=xr(u),v=!p&&Ur(u),m=!p&&!v&&Qr(u);s=u,p||v||m?xr(a)?s=a:kr(a)?s=yo(a):v?(c=!1,s=co(u,!0)):m?(c=!1,s=vo(u,!0)):s=[]:qr(u)||Lr(u)?(s=a,Lr(a)?s=aa(a):zr(a)&&!Hr(a)||(s=oi(u))):c=!1}c&&(r.set(u,s),o(s,u,l,i,r),r.delete(u)),Wn(e,n,s)}}(e,t,r,n,Ol,l,o);else{var a=l?l(yi(e,r),i,r+"",e,t,o):void 0;void 0===a&&(a=i),Wn(e,r,a)}},ba)}function Pl(e,t){var n=e.length;if(n)return ri(t+=t<0?n:0,n)?e[t]:void 0}function wl(e,t,n){t=t.length?dt(t,function(e){return xr(e)?function(t){return cl(t,1===e.length?e[0]:e)}:e}):[Ka];var l=-1;return t=dt(t,Nt(Zo())),function(e,t){var l=e.length;for(e.sort(function(e,t){return function(e,t,n){for(var l=-1,o=e.criteria,i=t.criteria,r=o.length,a=n.length;++l<r;){var u=mo(o[l],i[l]);if(u)return l>=a?u:u*("desc"==n[l]?-1:1)}return e.index-t.index}(e,t,n)});l--;)e[l]=e[l].value;return e}(Dl(e,function(e,n,o){return{criteria:dt(t,function(t){return t(e)}),index:++l,value:e}}))}function Rl(e,t,n){for(var l=-1,o=t.length,i={};++l<o;){var r=t[l],a=cl(e,r);n(a,r)&&jl(i,ro(r,e),a)}return i}function Ll(e,t,n,l){var o=l?_t:yt,i=-1,r=t.length,a=e;for(e===t&&(t=yo(t)),n&&(a=dt(e,Nt(n)));++i<r;)for(var u=0,d=t[i],s=n?n(d):d;(u=o(a,s,u,l))>-1;)a!==e&&qe.call(a,u,1),qe.call(e,u,1);return e}function xl(e,t){for(var n=e?t.length:0,l=n-1;n--;){var o=t[n];if(n==l||o!==i){var i=o;ri(o)?qe.call(e,o,1):Jl(e,o)}}return e}function Ml(e,t){return e+Qt(sn()*(t-e+1))}function Fl(e,t){var n="";if(!e||t<1||t>9007199254740991)return n;do{t%2&&(n+=e),(t=Qt(t/2))&&(e+=e)}while(t);return n}function kl(e,t){return hi(mi(e,t,Ka),e+"")}function Ul(e){return Bn(Pa(e))}function Bl(e,t){var n=Pa(e);return Ti(n,Gn(t,0,n.length))}function jl(e,t,n,l){if(!zr(e))return e;for(var o=-1,i=(t=ro(t,e)).length,r=i-1,a=e;null!=a&&++o<i;){var u=Ni(t[o]),d=n;if("__proto__"===u||"constructor"===u||"prototype"===u)return e;if(o!=r){var s=a[u];void 0===(d=l?l(s,u,a):void 0)&&(d=zr(s)?s:ri(t[o+1])?[]:{})}Vn(a,u,d),a=a[u]}return e}var Hl=_n?function(e,t){return _n.set(e,t),e}:Ka,Wl=qt?function(e,t){return qt(e,"toString",{configurable:!0,enumerable:!1,value:za(t),writable:!0})}:Ka;function Vl(e){return Ti(Pa(e))}function zl(e,t,n){var l=-1,o=e.length;t<0&&(t=-t>o?0:o+t),(n=n>o?o:n)<0&&(n+=o),o=t>n?0:n-t>>>0,t>>>=0;for(var i=K(o);++l<o;)i[l]=e[l+t];return i}function $l(e,t){var n;return el(e,function(e,l,o){return!(n=t(e,l,o))}),!!n}function Yl(e,t,n){var l=0,o=null==e?l:e.length;if("number"==typeof t&&t==t&&o<=2147483647){for(;l<o;){var i=l+o>>>1,r=e[i];null!==r&&!Jr(r)&&(n?r<=t:r<t)?l=i+1:o=i}return o}return Kl(e,t,Ka,n)}function Kl(e,t,n,l){var o=0,i=null==e?0:e.length;if(0===i)return 0;for(var r=(t=n(t))!=t,a=null===t,u=Jr(t),d=void 0===t;o<i;){var s=Qt((o+i)/2),c=n(e[s]),p=void 0!==c,v=null===c,m=c==c,f=Jr(c);if(r)var E=l||m;else E=d?m&&(l||p):a?m&&p&&(l||!v):u?m&&p&&!v&&(l||!f):!v&&!f&&(l?c<=t:c<t);E?o=s+1:i=s}return an(i,4294967294)}function ql(e,t){for(var n=-1,l=e.length,o=0,i=[];++n<l;){var r=e[n],a=t?t(r):r;if(!n||!Pr(a,u)){var u=a;i[o++]=0===r?0:r}}return i}function Gl(e){return"number"==typeof e?e:Jr(e)?NaN:+e}function Zl(e){if("string"==typeof e)return e;if(xr(e))return dt(e,Zl)+"";if(Jr(e))return Nn?Nn.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Xl(e,t,n){var l=-1,o=at,i=e.length,r=!0,a=[],u=a;if(n)r=!1,o=ut;else if(i>=200){var d=t?null:ko(e);if(d)return jt(d);r=!1,o=Ot,u=new Fn}else u=t?[]:a;e:for(;++l<i;){var s=e[l],c=t?t(s):s;if(s=n||0!==s?s:0,r&&c==c){for(var p=u.length;p--;)if(u[p]===c)continue e;t&&u.push(c),a.push(s)}else o(u,c,n)||(u!==a&&u.push(c),a.push(s))}return a}function Jl(e,t){return null==(e=fi(e,t=ro(t,e)))||delete e[Ni(ji(t))]}function Ql(e,t,n,l){return jl(e,t,n(cl(e,t)),l)}function eo(e,t,n,l){for(var o=e.length,i=l?o:-1;(l?i--:++i<o)&&t(e[i],i,e););return n?zl(e,l?0:i,l?i+1:o):zl(e,l?i+1:0,l?o:i)}function to(e,t){var n=e;return n instanceof Rn&&(n=n.value()),ct(t,function(e,t){return t.func.apply(t.thisArg,st([e],t.args))},n)}function no(e,t,n){var l=e.length;if(l<2)return l?Xl(e[0]):[];for(var o=-1,i=K(l);++o<l;)for(var r=e[o],a=-1;++a<l;)a!=o&&(i[o]=Qn(i[o]||r,e[a],t,n));return Xl(il(i,1),t,n)}function lo(e,t,n){for(var l=-1,o=e.length,i=t.length,r={};++l<o;)n(r,e[l],l<i?t[l]:void 0);return r}function oo(e){return kr(e)?e:[]}function io(e){return"function"==typeof e?e:Ka}function ro(e,t){return xr(e)?e:ui(e,t)?[e]:Di(ua(e))}var ao=kl;function uo(e,t,n){var l=e.length;return n=void 0===n?l:n,!t&&n>=l?e:zl(e,t,n)}var so=Gt||function(e){return Ve.clearTimeout(e)};function co(e,t){if(t)return e.slice();var n=e.length,l=We?We(n):new e.constructor(n);return e.copy(l),l}function po(e){var t=new e.constructor(e.byteLength);return new He(t).set(new He(e)),t}function vo(e,t){var n=t?po(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function mo(e,t){if(e!==t){var n=void 0!==e,l=null===e,o=e==e,i=Jr(e),r=void 0!==t,a=null===t,u=t==t,d=Jr(t);if(!a&&!d&&!i&&e>t||i&&r&&u&&!a&&!d||l&&r&&u||!n&&u||!o)return 1;if(!l&&!i&&!d&&e<t||d&&n&&o&&!l&&!i||a&&n&&o||!r&&o||!u)return-1}return 0}function fo(e,t,n,l){for(var o=-1,i=e.length,r=n.length,a=-1,u=t.length,d=rn(i-r,0),s=K(u+d),c=!l;++a<u;)s[a]=t[a];for(;++o<r;)(c||o<i)&&(s[n[o]]=e[o]);for(;d--;)s[a++]=e[o++];return s}function Eo(e,t,n,l){for(var o=-1,i=e.length,r=-1,a=n.length,u=-1,d=t.length,s=rn(i-a,0),c=K(s+d),p=!l;++o<s;)c[o]=e[o];for(var v=o;++u<d;)c[v+u]=t[u];for(;++r<a;)(p||o<i)&&(c[v+n[r]]=e[o++]);return c}function yo(e,t){var n=-1,l=e.length;for(t||(t=K(l));++n<l;)t[n]=e[n];return t}function _o(e,t,n,l){var o=!n;n||(n={});for(var i=-1,r=t.length;++i<r;){var a=t[i],u=l?l(n[a],e[a],a,n,e):void 0;void 0===u&&(u=e[a]),o?Kn(n,a,u):Vn(n,a,u)}return n}function go(e,t){return function(n,l){var o=xr(n)?nt:$n,i=t?t():{};return o(n,e,Zo(l,2),i)}}function ho(e){return kl(function(t,n){var l=-1,o=n.length,i=o>1?n[o-1]:void 0,r=o>2?n[2]:void 0;for(i=e.length>3&&"function"==typeof i?(o--,i):void 0,r&&ai(n[0],n[1],r)&&(i=o<3?void 0:i,o=1),t=me(t);++l<o;){var a=n[l];a&&e(t,a,l,i)}return t})}function So(e,t){return function(n,l){if(null==n)return n;if(!Fr(n))return e(n,l);for(var o=n.length,i=t?o:-1,r=me(n);(t?i--:++i<o)&&!1!==l(r[i],i,r););return n}}function bo(e){return function(t,n,l){for(var o=-1,i=me(t),r=l(t),a=r.length;a--;){var u=r[e?a:++o];if(!1===n(i[u],u,i))break}return t}}function To(e){return function(t){var n=Ft(t=ua(t))?Vt(t):void 0,l=n?n[0]:t.charAt(0),o=n?uo(n,1).join(""):t.slice(1);return l[e]()+o}}function Co(e){return function(t){return ct(Ha(La(t).replace(Ie,"")),e,"")}}function Ao(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 zr(l)?l:n}}function Do(e){return function(t,n,l){var o=me(t);if(!Fr(t)){var i=Zo(n,3);t=Sa(t),n=function(e){return i(o[e],e,o)}}var r=e(t,n,l);return r>-1?o[i?t[r]:r]:void 0}}function No(e){return zo(function(t){var l=t.length,o=l,i=wn.prototype.thru;for(e&&t.reverse();o--;){var r=t[o];if("function"!=typeof r)throw new ye(n);if(i&&!a&&"wrapper"==qo(r))var a=new wn([],!0)}for(o=a?o:l;++o<l;){var u=qo(r=t[o]),d="wrapper"==u?Ko(r):void 0;a=d&&di(d[0])&&424==d[1]&&!d[4].length&&1==d[9]?a[qo(d[0])].apply(a,d[3]):1==r.length&&di(r)?a[u]():a.thru(r)}return function(){var e=arguments,n=e[0];if(a&&1==e.length&&xr(n))return a.plant(n).value();for(var o=0,i=l?t[o].apply(this,e):n;++o<l;)i=t[o].call(this,i);return i}})}function Io(e,t,n,l,o,i,r,a,u,d){var s=128&t,c=1&t,p=2&t,v=24&t,m=512&t,f=p?void 0:Ao(e);return function E(){for(var y=arguments.length,_=K(y),g=y;g--;)_[g]=arguments[g];if(v)var h=Go(E),S=Rt(_,h);if(l&&(_=fo(_,l,o,v)),i&&(_=Eo(_,i,r,v)),y-=S,v&&y<d){var b=Bt(_,h);return Mo(e,t,Io,E.placeholder,n,_,b,a,u,d-y)}var T=c?n:this,C=p?T[e]:e;return y=_.length,a?_=Ei(_,a):m&&y>1&&_.reverse(),s&&u<y&&(_.length=u),this&&this!==Ve&&this instanceof E&&(C=f||Ao(C)),C.apply(T,_)}}function Oo(e,t){return function(n,l){return function(e,t,n,l){return ul(e,function(e,o,i){t(l,n(e),o,i)}),l}(n,e,t(l),{})}}function Po(e,t){return function(n,l){var o;if(void 0===n&&void 0===l)return t;if(void 0!==n&&(o=n),void 0!==l){if(void 0===o)return l;"string"==typeof n||"string"==typeof l?(n=Zl(n),l=Zl(l)):(n=Gl(n),l=Gl(l)),o=e(n,l)}return o}}function wo(e){return zo(function(t){return t=dt(t,Nt(Zo())),kl(function(n){var l=this;return e(t,function(e){return tt(e,l,n)})})})}function Ro(e,t){var n=(t=void 0===t?" ":Zl(t)).length;if(n<2)return n?Fl(t,e):t;var l=Fl(t,Jt(e/Wt(t)));return Ft(t)?uo(Vt(l),0,e).join(""):l.slice(0,e)}function Lo(e){return function(t,n,l){return l&&"number"!=typeof l&&ai(t,n,l)&&(n=l=void 0),t=la(t),void 0===n?(n=t,t=0):n=la(n),function(e,t,n,l){for(var o=-1,i=rn(Jt((t-e)/(n||1)),0),r=K(i);i--;)r[l?i:++o]=e,e+=n;return r}(t,n,l=void 0===l?t<n?1:-1:la(l),e)}}function xo(e){return function(t,n){return"string"==typeof t&&"string"==typeof n||(t=ra(t),n=ra(n)),e(t,n)}}function Mo(e,t,n,l,o,i,r,a,u,d){var s=8&t;t|=s?32:64,4&(t&=~(s?64:32))||(t&=-4);var c=[e,t,o,s?i:void 0,s?r:void 0,s?void 0:i,s?void 0:r,a,u,d],p=n.apply(void 0,c);return di(e)&&_i(p,c),p.placeholder=l,Si(p,e,t)}function Fo(e){var t=ve[e];return function(e,n){if(e=ra(e),(n=null==n?0:an(oa(n),292))&&nn(e)){var l=(ua(e)+"e").split("e");return+((l=(ua(t(l[0]+"e"+(+l[1]+n)))+"e").split("e"))[0]+"e"+(+l[1]-n))}return t(e)}}var ko=fn&&1/jt(new fn([,-0]))[1]==1/0?function(e){return new fn(e)}:Ja;function Uo(e){return function(t){var n=ni(t);return n==v?kt(t):n==y?Ht(t):function(e,t){return dt(t,function(t){return[t,e[t]]})}(t,e(t))}}function Bo(e,t,o,i,r,a,u,d){var s=2&t;if(!s&&"function"!=typeof e)throw new ye(n);var c=i?i.length:0;if(c||(t&=-97,i=r=void 0),u=void 0===u?u:rn(oa(u),0),d=void 0===d?d:oa(d),c-=r?r.length:0,64&t){var p=i,v=r;i=r=void 0}var m=s?void 0:Ko(e),f=[e,t,o,i,r,p,v,a,u,d];if(m&&function(e,t){var n=e[1],o=t[1],i=n|o;if(!(i<131||128==o&&8==n||128==o&&256==n&&e[7].length<=t[8]||384==o&&t[7].length<=t[8]&&8==n))return e;1&o&&(e[2]=t[2],i|=1&n?0:4);var r=t[3];if(r){var a=e[3];e[3]=a?fo(a,r,t[4]):r,e[4]=a?Bt(e[3],l):t[4]}(r=t[5])&&(e[5]=(a=e[5])?Eo(a,r,t[6]):r,e[6]=a?Bt(e[5],l):t[6]),(r=t[7])&&(e[7]=r),128&o&&(e[8]=null==e[8]?t[8]:an(e[8],t[8])),null==e[9]&&(e[9]=t[9]),e[0]=t[0],e[1]=i}(f,m),e=f[0],t=f[1],o=f[2],i=f[3],r=f[4],!(d=f[9]=void 0===f[9]?s?0:e.length:rn(f[9]-c,0))&&24&t&&(t&=-25),t&&1!=t)E=8==t||16==t?function(e,t,n){var l=Ao(e);return function o(){for(var i=arguments.length,r=K(i),a=i,u=Go(o);a--;)r[a]=arguments[a];var d=i<3&&r[0]!==u&&r[i-1]!==u?[]:Bt(r,u);if((i-=d.length)<n)return Mo(e,t,Io,o.placeholder,void 0,r,d,void 0,void 0,n-i);var s=this&&this!==Ve&&this instanceof o?l:e;return tt(s,this,r)}}(e,t,d):32!=t&&33!=t||r.length?Io.apply(void 0,f):function(e,t,n,l){var o=1&t,i=Ao(e);return function t(){for(var r=-1,a=arguments.length,u=-1,d=l.length,s=K(d+a),c=this&&this!==Ve&&this instanceof t?i:e;++u<d;)s[u]=l[u];for(;a--;)s[u++]=arguments[++r];return tt(c,o?n:this,s)}}(e,t,o,i);else var E=function(e,t,n){var l=1&t,o=Ao(e);return function t(){var i=this&&this!==Ve&&this instanceof t?o:e;return i.apply(l?n:this,arguments)}}(e,t,o);return Si((m?Hl:_i)(E,f),e,t)}function jo(e,t,n,l){return void 0===e||Pr(e,ge[n])&&!be.call(l,n)?t:e}function Ho(e,t,n,l,o,i){return zr(e)&&zr(t)&&(i.set(t,e),Ol(e,t,void 0,Ho,i),i.delete(t)),e}function Wo(e){return qr(e)?void 0:e}function Vo(e,t,n,l,o,i){var r=1&n,a=e.length,u=t.length;if(a!=u&&!(r&&u>a))return!1;var d=i.get(e),s=i.get(t);if(d&&s)return d==t&&s==e;var c=-1,p=!0,v=2&n?new Fn:void 0;for(i.set(e,t),i.set(t,e);++c<a;){var m=e[c],f=t[c];if(l)var E=r?l(f,m,c,t,e,i):l(m,f,c,e,t,i);if(void 0!==E){if(E)continue;p=!1;break}if(v){if(!vt(t,function(e,t){if(!Ot(v,t)&&(m===e||o(m,e,n,l,i)))return v.push(t)})){p=!1;break}}else if(m!==f&&!o(m,f,n,l,i)){p=!1;break}}return i.delete(e),i.delete(t),p}function zo(e){return hi(mi(e,void 0,Mi),e+"")}function $o(e){return pl(e,Sa,ei)}function Yo(e){return pl(e,ba,ti)}var Ko=_n?function(e){return _n.get(e)}:Ja;function qo(e){for(var t=e.name+"",n=gn[t],l=be.call(gn,t)?n.length:0;l--;){var o=n[l],i=o.func;if(null==i||i==e)return o.name}return t}function Go(e){return(be.call(In,"placeholder")?In:e).placeholder}function Zo(){var e=In.iteratee||qa;return e=e===qa?Tl:e,arguments.length?e(arguments[0],arguments[1]):e}function Xo(e,t){var n,l,o=e.__data__;return("string"==(l=typeof(n=t))||"number"==l||"symbol"==l||"boolean"==l?"__proto__"!==n:null===n)?o["string"==typeof t?"string":"hash"]:o.map}function Jo(e){for(var t=Sa(e),n=t.length;n--;){var l=t[n],o=e[l];t[n]=[l,o,pi(o)]}return t}function Qo(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return bl(n)?n:void 0}var ei=en?function(e){return null==e?[]:(e=me(e),rt(en(e),function(t){return Ke.call(e,t)}))}:iu,ti=en?function(e){for(var t=[];e;)st(t,ei(e)),e=ze(e);return t}:iu,ni=vl;function li(e,t,n){for(var l=-1,o=(t=ro(t,e)).length,i=!1;++l<o;){var r=Ni(t[l]);if(!(i=null!=e&&n(e,r)))break;e=e[r]}return i||++l!=o?i:!!(o=null==e?0:e.length)&&Vr(o)&&ri(r,o)&&(xr(e)||Lr(e))}function oi(e){return"function"!=typeof e.constructor||ci(e)?{}:On(ze(e))}function ii(e){return xr(e)||Lr(e)||!!(mt&&e&&e[mt])}function ri(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&re.test(e))&&e>-1&&e%1==0&&e<t}function ai(e,t,n){if(!zr(n))return!1;var l=typeof t;return!!("number"==l?Fr(n)&&ri(t,n.length):"string"==l&&t in n)&&Pr(n[t],e)}function ui(e,t){if(xr(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!Jr(e))||W.test(e)||!H.test(e)||null!=t&&e in me(t)}function di(e){var t=qo(e),n=In[t];if("function"!=typeof n||!(t in Rn.prototype))return!1;if(e===n)return!0;var l=Ko(n);return!!l&&e===l[0]}(pn&&ni(new pn(new ArrayBuffer(1)))!=b||vn&&ni(new vn)!=v||mn&&"[object Promise]"!=ni(mn.resolve())||fn&&ni(new fn)!=y||En&&ni(new En)!=h)&&(ni=function(e){var t=vl(e),n=t==f?e.constructor:void 0,l=n?Ii(n):"";if(l)switch(l){case hn:return b;case Sn:return v;case bn:return"[object Promise]";case Tn:return y;case Cn:return h}return t});var si=he?Hr:ru;function ci(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||ge)}function pi(e){return e==e&&!zr(e)}function vi(e,t){return function(n){return null!=n&&n[e]===t&&(void 0!==t||e in me(n))}}function mi(e,t,n){return t=rn(void 0===t?e.length-1:t,0),function(){for(var l=arguments,o=-1,i=rn(l.length-t,0),r=K(i);++o<i;)r[o]=l[t+o];o=-1;for(var a=K(t+1);++o<t;)a[o]=l[o];return a[t]=n(r),tt(e,this,a)}}function fi(e,t){return t.length<2?e:cl(e,zl(t,0,-1))}function Ei(e,t){for(var n=e.length,l=an(t.length,n),o=yo(e);l--;){var i=t[l];e[l]=ri(i,n)?o[i]:void 0}return e}function yi(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var _i=bi(Hl),gi=Xt||function(e,t){return Ve.setTimeout(e,t)},hi=bi(Wl);function Si(e,t,n){var l=t+"";return hi(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(o,function(n){var l="_."+n[0];t&n[1]&&!at(e,l)&&e.push(l)}),e.sort()}(function(e){var t=e.match(G);return t?t[1].split(Z):[]}(l),n)))}function bi(e){var t=0,n=0;return function(){var l=un(),o=16-(l-n);if(n=l,o>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function Ti(e,t){var n=-1,l=e.length,o=l-1;for(t=void 0===t?l:t;++n<t;){var i=Ml(n,o),r=e[i];e[i]=e[n],e[n]=r}return e.length=t,e}var Ci,Ai,Di=(Ci=Cr(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(V,function(e,n,l,o){t.push(l?o.replace(Q,"$1"):n||e)}),t},function(e){return 500===Ai.size&&Ai.clear(),e}),Ai=Ci.cache,Ci);function Ni(e){if("string"==typeof e||Jr(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Ii(e){if(null!=e){try{return Se.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function Oi(e){if(e instanceof Rn)return e.clone();var t=new wn(e.__wrapped__,e.__chain__);return t.__actions__=yo(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var Pi=kl(function(e,t){return kr(e)?Qn(e,il(t,1,kr,!0)):[]}),wi=kl(function(e,t){var n=ji(t);return kr(n)&&(n=void 0),kr(e)?Qn(e,il(t,1,kr,!0),Zo(n,2)):[]}),Ri=kl(function(e,t){var n=ji(t);return kr(n)&&(n=void 0),kr(e)?Qn(e,il(t,1,kr,!0),void 0,n):[]});function Li(e,t,n){var l=null==e?0:e.length;if(!l)return-1;var o=null==n?0:oa(n);return o<0&&(o=rn(l+o,0)),Et(e,Zo(t,3),o)}function xi(e,t,n){var l=null==e?0:e.length;if(!l)return-1;var o=l-1;return void 0!==n&&(o=oa(n),o=n<0?rn(l+o,0):an(o,l-1)),Et(e,Zo(t,3),o,!0)}function Mi(e){return null!=e&&e.length?il(e,1):[]}function Fi(e){return e&&e.length?e[0]:void 0}var ki=kl(function(e){var t=dt(e,oo);return t.length&&t[0]===e[0]?yl(t):[]}),Ui=kl(function(e){var t=ji(e),n=dt(e,oo);return t===ji(n)?t=void 0:n.pop(),n.length&&n[0]===e[0]?yl(n,Zo(t,2)):[]}),Bi=kl(function(e){var t=ji(e),n=dt(e,oo);return(t="function"==typeof t?t:void 0)&&n.pop(),n.length&&n[0]===e[0]?yl(n,void 0,t):[]});function ji(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}var Hi=kl(Wi);function Wi(e,t){return e&&e.length&&t&&t.length?Ll(e,t):e}var Vi=zo(function(e,t){var n=null==e?0:e.length,l=qn(e,t);return xl(e,dt(t,function(e){return ri(e,n)?+e:e}).sort(mo)),l});function zi(e){return null==e?e:cn.call(e)}var $i=kl(function(e){return Xl(il(e,1,kr,!0))}),Yi=kl(function(e){var t=ji(e);return kr(t)&&(t=void 0),Xl(il(e,1,kr,!0),Zo(t,2))}),Ki=kl(function(e){var t=ji(e);return t="function"==typeof t?t:void 0,Xl(il(e,1,kr,!0),void 0,t)});function qi(e){if(!e||!e.length)return[];var t=0;return e=rt(e,function(e){if(kr(e))return t=rn(e.length,t),!0}),At(t,function(t){return dt(e,St(t))})}function Gi(e,t){if(!e||!e.length)return[];var n=qi(e);return null==t?n:dt(n,function(e){return tt(t,void 0,e)})}var Zi=kl(function(e,t){return kr(e)?Qn(e,t):[]}),Xi=kl(function(e){return no(rt(e,kr))}),Ji=kl(function(e){var t=ji(e);return kr(t)&&(t=void 0),no(rt(e,kr),Zo(t,2))}),Qi=kl(function(e){var t=ji(e);return t="function"==typeof t?t:void 0,no(rt(e,kr),void 0,t)}),er=kl(qi),tr=kl(function(e){var t=e.length,n=t>1?e[t-1]:void 0;return n="function"==typeof n?(e.pop(),n):void 0,Gi(e,n)});function nr(e){var t=In(e);return t.__chain__=!0,t}function lr(e,t){return t(e)}var or=zo(function(e){var t=e.length,n=t?e[0]:0,l=this.__wrapped__,o=function(t){return qn(t,e)};return!(t>1||this.__actions__.length)&&l instanceof Rn&&ri(n)?((l=l.slice(n,+n+(t?1:0))).__actions__.push({func:lr,args:[o],thisArg:void 0}),new wn(l,this.__chain__).thru(function(e){return t&&!e.length&&e.push(void 0),e})):this.thru(o)}),ir=go(function(e,t,n){be.call(e,n)?++e[n]:Kn(e,n,1)}),rr=Do(Li),ar=Do(xi);function ur(e,t){return(xr(e)?lt:el)(e,Zo(t,3))}function dr(e,t){return(xr(e)?ot:tl)(e,Zo(t,3))}var sr=go(function(e,t,n){be.call(e,n)?e[n].push(t):Kn(e,n,[t])}),cr=kl(function(e,t,n){var l=-1,o="function"==typeof t,i=Fr(e)?K(e.length):[];return el(e,function(e){i[++l]=o?tt(t,e,n):_l(e,t,n)}),i}),pr=go(function(e,t,n){Kn(e,n,t)});function vr(e,t){return(xr(e)?dt:Dl)(e,Zo(t,3))}var mr=go(function(e,t,n){e[n?0:1].push(t)},function(){return[[],[]]}),fr=kl(function(e,t){if(null==e)return[];var n=t.length;return n>1&&ai(e,t[0],t[1])?t=[]:n>2&&ai(t[0],t[1],t[2])&&(t=[t[0]]),wl(e,il(t,1),[])}),Er=Zt||function(){return Ve.Date.now()};function yr(e,t,n){return t=n?void 0:t,Bo(e,128,void 0,void 0,void 0,void 0,t=e&&null==t?e.length:t)}function _r(e,t){var l;if("function"!=typeof t)throw new ye(n);return e=oa(e),function(){return--e>0&&(l=t.apply(this,arguments)),e<=1&&(t=void 0),l}}var gr=kl(function(e,t,n){var l=1;if(n.length){var o=Bt(n,Go(gr));l|=32}return Bo(e,l,t,n,o)}),hr=kl(function(e,t,n){var l=3;if(n.length){var o=Bt(n,Go(hr));l|=32}return Bo(t,l,e,n,o)});function Sr(e,t,l){var o,i,r,a,u,d,s=0,c=!1,p=!1,v=!0;if("function"!=typeof e)throw new ye(n);function m(t){var n=o,l=i;return o=i=void 0,s=t,a=e.apply(l,n)}function f(e){return s=e,u=gi(y,t),c?m(e):a}function E(e){var n=e-d;return void 0===d||n>=t||n<0||p&&e-s>=r}function y(){var e=Er();if(E(e))return _(e);u=gi(y,function(e){var n=t-(e-d);return p?an(n,r-(e-s)):n}(e))}function _(e){return u=void 0,v&&o?m(e):(o=i=void 0,a)}function g(){var e=Er(),n=E(e);if(o=arguments,i=this,d=e,n){if(void 0===u)return f(d);if(p)return so(u),u=gi(y,t),m(d)}return void 0===u&&(u=gi(y,t)),a}return t=ra(t)||0,zr(l)&&(c=!!l.leading,r=(p="maxWait"in l)?rn(ra(l.maxWait)||0,t):r,v="trailing"in l?!!l.trailing:v),g.cancel=function(){void 0!==u&&so(u),s=0,o=d=i=u=void 0},g.flush=function(){return void 0===u?a:_(Er())},g}var br=kl(function(e,t){return Jn(e,1,t)}),Tr=kl(function(e,t,n){return Jn(e,ra(t)||0,n)});function Cr(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new ye(n);var l=function(){var n=arguments,o=t?t.apply(this,n):n[0],i=l.cache;if(i.has(o))return i.get(o);var r=e.apply(this,n);return l.cache=i.set(o,r)||i,r};return l.cache=new(Cr.Cache||Mn),l}function Ar(e){if("function"!=typeof e)throw new ye(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)}}Cr.Cache=Mn;var Dr=ao(function(e,t){var n=(t=1==t.length&&xr(t[0])?dt(t[0],Nt(Zo())):dt(il(t,1),Nt(Zo()))).length;return kl(function(l){for(var o=-1,i=an(l.length,n);++o<i;)l[o]=t[o].call(this,l[o]);return tt(e,this,l)})}),Nr=kl(function(e,t){return Bo(e,32,void 0,t,Bt(t,Go(Nr)))}),Ir=kl(function(e,t){return Bo(e,64,void 0,t,Bt(t,Go(Ir)))}),Or=zo(function(e,t){return Bo(e,256,void 0,void 0,void 0,t)});function Pr(e,t){return e===t||e!=e&&t!=t}var wr=xo(ml),Rr=xo(function(e,t){return e>=t}),Lr=gl(function(){return arguments}())?gl:function(e){return $r(e)&&be.call(e,"callee")&&!Ke.call(e,"callee")},xr=K.isArray,Mr=Ge?Nt(Ge):function(e){return $r(e)&&vl(e)==S};function Fr(e){return null!=e&&Vr(e.length)&&!Hr(e)}function kr(e){return $r(e)&&Fr(e)}var Ur=tn||ru,Br=Ze?Nt(Ze):function(e){return $r(e)&&vl(e)==u};function jr(e){if(!$r(e))return!1;var t=vl(e);return t==s||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!qr(e)}function Hr(e){if(!zr(e))return!1;var t=vl(e);return t==c||t==p||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Wr(e){return"number"==typeof e&&e==oa(e)}function Vr(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}function zr(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function $r(e){return null!=e&&"object"==typeof e}var Yr=Xe?Nt(Xe):function(e){return $r(e)&&ni(e)==v};function Kr(e){return"number"==typeof e||$r(e)&&vl(e)==m}function qr(e){if(!$r(e)||vl(e)!=f)return!1;var t=ze(e);if(null===t)return!0;var n=be.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&Se.call(n)==De}var Gr=Je?Nt(Je):function(e){return $r(e)&&vl(e)==E},Zr=Qe?Nt(Qe):function(e){return $r(e)&&ni(e)==y};function Xr(e){return"string"==typeof e||!xr(e)&&$r(e)&&vl(e)==_}function Jr(e){return"symbol"==typeof e||$r(e)&&vl(e)==g}var Qr=et?Nt(et):function(e){return $r(e)&&Vr(e.length)&&!!Fe[vl(e)]},ea=xo(Al),ta=xo(function(e,t){return e<=t});function na(e){if(!e)return[];if(Fr(e))return Xr(e)?Vt(e):yo(e);if(bt&&e[bt])return function(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}(e[bt]());var t=ni(e);return(t==v?kt:t==y?jt:Pa)(e)}function la(e){return e?(e=ra(e))===1/0||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function oa(e){var t=la(e),n=t%1;return t==t?n?t-n:t:0}function ia(e){return e?Gn(oa(e),0,4294967295):0}function ra(e){if("number"==typeof e)return e;if(Jr(e))return NaN;if(zr(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=zr(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Dt(e);var n=le.test(e);return n||ie.test(e)?je(e.slice(2),n?2:8):ne.test(e)?NaN:+e}function aa(e){return _o(e,ba(e))}function ua(e){return null==e?"":Zl(e)}var da=ho(function(e,t){if(ci(t)||Fr(t))_o(t,Sa(t),e);else for(var n in t)be.call(t,n)&&Vn(e,n,t[n])}),sa=ho(function(e,t){_o(t,ba(t),e)}),ca=ho(function(e,t,n,l){_o(t,ba(t),e,l)}),pa=ho(function(e,t,n,l){_o(t,Sa(t),e,l)}),va=zo(qn),ma=kl(function(e,t){e=me(e);var n=-1,l=t.length,o=l>2?t[2]:void 0;for(o&&ai(t[0],t[1],o)&&(l=1);++n<l;)for(var i=t[n],r=ba(i),a=-1,u=r.length;++a<u;){var d=r[a],s=e[d];(void 0===s||Pr(s,ge[d])&&!be.call(e,d))&&(e[d]=i[d])}return e}),fa=kl(function(e){return e.push(void 0,Ho),tt(Ca,void 0,e)});function Ea(e,t,n){var l=null==e?void 0:cl(e,t);return void 0===l?n:l}function ya(e,t){return null!=e&&li(e,t,El)}var _a=Oo(function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=Ae.call(t)),e[t]=n},za(Ka)),ga=Oo(function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=Ae.call(t)),be.call(e,t)?e[t].push(n):e[t]=[n]},Zo),ha=kl(_l);function Sa(e){return Fr(e)?Un(e):Cl(e)}function ba(e){return Fr(e)?Un(e,!0):function(e){if(!zr(e))return function(e){var t=[];if(null!=e)for(var n in me(e))t.push(n);return t}(e);var t=ci(e),n=[];for(var l in e)("constructor"!=l||!t&&be.call(e,l))&&n.push(l);return n}(e)}var Ta=ho(function(e,t,n){Ol(e,t,n)}),Ca=ho(function(e,t,n,l){Ol(e,t,n,l)}),Aa=zo(function(e,t){var n={};if(null==e)return n;var l=!1;t=dt(t,function(t){return t=ro(t,e),l||(l=t.length>1),t}),_o(e,Yo(e),n),l&&(n=Zn(n,7,Wo));for(var o=t.length;o--;)Jl(n,t[o]);return n}),Da=zo(function(e,t){return null==e?{}:function(e,t){return Rl(e,t,function(t,n){return ya(e,n)})}(e,t)});function Na(e,t){if(null==e)return{};var n=dt(Yo(e),function(e){return[e]});return t=Zo(t),Rl(e,n,function(e,n){return t(e,n[0])})}var Ia=Uo(Sa),Oa=Uo(ba);function Pa(e){return null==e?[]:It(e,Sa(e))}var wa=Co(function(e,t,n){return t=t.toLowerCase(),e+(n?Ra(t):t)});function Ra(e){return ja(ua(e).toLowerCase())}function La(e){return(e=ua(e))&&e.replace(ae,Lt).replace(Oe,"")}var xa=Co(function(e,t,n){return e+(n?"-":"")+t.toLowerCase()}),Ma=Co(function(e,t,n){return e+(n?" ":"")+t.toLowerCase()}),Fa=To("toLowerCase"),ka=Co(function(e,t,n){return e+(n?"_":"")+t.toLowerCase()}),Ua=Co(function(e,t,n){return e+(n?" ":"")+ja(t)}),Ba=Co(function(e,t,n){return e+(n?" ":"")+t.toUpperCase()}),ja=To("toUpperCase");function Ha(e,t,n){return e=ua(e),void 0===(t=n?void 0:t)?function(e){return Le.test(e)}(e)?function(e){return e.match(we)||[]}(e):function(e){return e.match(X)||[]}(e):e.match(t)||[]}var Wa=kl(function(e,t){try{return tt(e,void 0,t)}catch(e){return jr(e)?e:new ce(e)}}),Va=zo(function(e,t){return lt(t,function(t){t=Ni(t),Kn(e,t,gr(e[t],e))}),e});function za(e){return function(){return e}}var $a=No(),Ya=No(!0);function Ka(e){return e}function qa(e){return Tl("function"==typeof e?e:Zn(e,1))}var Ga=kl(function(e,t){return function(n){return _l(n,e,t)}}),Za=kl(function(e,t){return function(n){return _l(e,n,t)}});function Xa(e,t,n){var l=Sa(t),o=sl(t,l);null!=n||zr(t)&&(o.length||!l.length)||(n=t,t=e,e=this,o=sl(t,Sa(t)));var i=!(zr(n)&&"chain"in n&&!n.chain),r=Hr(e);return lt(o,function(n){var l=t[n];e[n]=l,r&&(e.prototype[n]=function(){var t=this.__chain__;if(i||t){var n=e(this.__wrapped__),o=n.__actions__=yo(this.__actions__);return o.push({func:l,args:arguments,thisArg:e}),n.__chain__=t,n}return l.apply(e,st([this.value()],arguments))})}),e}function Ja(){}var Qa=wo(dt),eu=wo(it),tu=wo(vt);function nu(e){return ui(e)?St(Ni(e)):function(e){return function(t){return cl(t,e)}}(e)}var lu=Lo(),ou=Lo(!0);function iu(){return[]}function ru(){return!1}var au,uu=Po(function(e,t){return e+t},0),du=Fo("ceil"),su=Po(function(e,t){return e/t},1),cu=Fo("floor"),pu=Po(function(e,t){return e*t},1),vu=Fo("round"),mu=Po(function(e,t){return e-t},0);return In.after=function(e,t){if("function"!=typeof t)throw new ye(n);return e=oa(e),function(){if(--e<1)return t.apply(this,arguments)}},In.ary=yr,In.assign=da,In.assignIn=sa,In.assignInWith=ca,In.assignWith=pa,In.at=va,In.before=_r,In.bind=gr,In.bindAll=Va,In.bindKey=hr,In.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return xr(e)?e:[e]},In.chain=nr,In.chunk=function(e,t,n){t=(n?ai(e,t,n):void 0===t)?1:rn(oa(t),0);var l=null==e?0:e.length;if(!l||t<1)return[];for(var o=0,i=0,r=K(Jt(l/t));o<l;)r[i++]=zl(e,o,o+=t);return r},In.compact=function(e){for(var t=-1,n=null==e?0:e.length,l=0,o=[];++t<n;){var i=e[t];i&&(o[l++]=i)}return o},In.concat=function(){var e=arguments.length;if(!e)return[];for(var t=K(e-1),n=arguments[0],l=e;l--;)t[l-1]=arguments[l];return st(xr(n)?yo(n):[n],il(t,1))},In.cond=function(e){var t=null==e?0:e.length,l=Zo();return e=t?dt(e,function(e){if("function"!=typeof e[1])throw new ye(n);return[l(e[0]),e[1]]}):[],kl(function(n){for(var l=-1;++l<t;){var o=e[l];if(tt(o[0],this,n))return tt(o[1],this,n)}})},In.conforms=function(e){return function(e){var t=Sa(e);return function(n){return Xn(n,e,t)}}(Zn(e,1))},In.constant=za,In.countBy=ir,In.create=function(e,t){var n=On(e);return null==t?n:Yn(n,t)},In.curry=function e(t,n,l){var o=Bo(t,8,void 0,void 0,void 0,void 0,void 0,n=l?void 0:n);return o.placeholder=e.placeholder,o},In.curryRight=function e(t,n,l){var o=Bo(t,16,void 0,void 0,void 0,void 0,void 0,n=l?void 0:n);return o.placeholder=e.placeholder,o},In.debounce=Sr,In.defaults=ma,In.defaultsDeep=fa,In.defer=br,In.delay=Tr,In.difference=Pi,In.differenceBy=wi,In.differenceWith=Ri,In.drop=function(e,t,n){var l=null==e?0:e.length;return l?zl(e,(t=n||void 0===t?1:oa(t))<0?0:t,l):[]},In.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:oa(t)))<0?0:t):[]},In.dropRightWhile=function(e,t){return e&&e.length?eo(e,Zo(t,3),!0,!0):[]},In.dropWhile=function(e,t){return e&&e.length?eo(e,Zo(t,3),!0):[]},In.fill=function(e,t,n,l){var o=null==e?0:e.length;return o?(n&&"number"!=typeof n&&ai(e,t,n)&&(n=0,l=o),function(e,t,n,l){var o=e.length;for((n=oa(n))<0&&(n=-n>o?0:o+n),(l=void 0===l||l>o?o:oa(l))<0&&(l+=o),l=n>l?0:ia(l);n<l;)e[n++]=t;return e}(e,t,n,l)):[]},In.filter=function(e,t){return(xr(e)?rt:ol)(e,Zo(t,3))},In.flatMap=function(e,t){return il(vr(e,t),1)},In.flatMapDeep=function(e,t){return il(vr(e,t),1/0)},In.flatMapDepth=function(e,t,n){return n=void 0===n?1:oa(n),il(vr(e,t),n)},In.flatten=Mi,In.flattenDeep=function(e){return null!=e&&e.length?il(e,1/0):[]},In.flattenDepth=function(e,t){return null!=e&&e.length?il(e,t=void 0===t?1:oa(t)):[]},In.flip=function(e){return Bo(e,512)},In.flow=$a,In.flowRight=Ya,In.fromPairs=function(e){for(var t=-1,n=null==e?0:e.length,l={};++t<n;){var o=e[t];l[o[0]]=o[1]}return l},In.functions=function(e){return null==e?[]:sl(e,Sa(e))},In.functionsIn=function(e){return null==e?[]:sl(e,ba(e))},In.groupBy=sr,In.initial=function(e){return null!=e&&e.length?zl(e,0,-1):[]},In.intersection=ki,In.intersectionBy=Ui,In.intersectionWith=Bi,In.invert=_a,In.invertBy=ga,In.invokeMap=cr,In.iteratee=qa,In.keyBy=pr,In.keys=Sa,In.keysIn=ba,In.map=vr,In.mapKeys=function(e,t){var n={};return t=Zo(t,3),ul(e,function(e,l,o){Kn(n,t(e,l,o),e)}),n},In.mapValues=function(e,t){var n={};return t=Zo(t,3),ul(e,function(e,l,o){Kn(n,l,t(e,l,o))}),n},In.matches=function(e){return Nl(Zn(e,1))},In.matchesProperty=function(e,t){return Il(e,Zn(t,1))},In.memoize=Cr,In.merge=Ta,In.mergeWith=Ca,In.method=Ga,In.methodOf=Za,In.mixin=Xa,In.negate=Ar,In.nthArg=function(e){return e=oa(e),kl(function(t){return Pl(t,e)})},In.omit=Aa,In.omitBy=function(e,t){return Na(e,Ar(Zo(t)))},In.once=function(e){return _r(2,e)},In.orderBy=function(e,t,n,l){return null==e?[]:(xr(t)||(t=null==t?[]:[t]),xr(n=l?void 0:n)||(n=null==n?[]:[n]),wl(e,t,n))},In.over=Qa,In.overArgs=Dr,In.overEvery=eu,In.overSome=tu,In.partial=Nr,In.partialRight=Ir,In.partition=mr,In.pick=Da,In.pickBy=Na,In.property=nu,In.propertyOf=function(e){return function(t){return null==e?void 0:cl(e,t)}},In.pull=Hi,In.pullAll=Wi,In.pullAllBy=function(e,t,n){return e&&e.length&&t&&t.length?Ll(e,t,Zo(n,2)):e},In.pullAllWith=function(e,t,n){return e&&e.length&&t&&t.length?Ll(e,t,void 0,n):e},In.pullAt=Vi,In.range=lu,In.rangeRight=ou,In.rearg=Or,In.reject=function(e,t){return(xr(e)?rt:ol)(e,Ar(Zo(t,3)))},In.remove=function(e,t){var n=[];if(!e||!e.length)return n;var l=-1,o=[],i=e.length;for(t=Zo(t,3);++l<i;){var r=e[l];t(r,l,e)&&(n.push(r),o.push(l))}return xl(e,o),n},In.rest=function(e,t){if("function"!=typeof e)throw new ye(n);return kl(e,t=void 0===t?t:oa(t))},In.reverse=zi,In.sampleSize=function(e,t,n){return t=(n?ai(e,t,n):void 0===t)?1:oa(t),(xr(e)?jn:Bl)(e,t)},In.set=function(e,t,n){return null==e?e:jl(e,t,n)},In.setWith=function(e,t,n,l){return l="function"==typeof l?l:void 0,null==e?e:jl(e,t,n,l)},In.shuffle=function(e){return(xr(e)?Hn:Vl)(e)},In.slice=function(e,t,n){var l=null==e?0:e.length;return l?(n&&"number"!=typeof n&&ai(e,t,n)?(t=0,n=l):(t=null==t?0:oa(t),n=void 0===n?l:oa(n)),zl(e,t,n)):[]},In.sortBy=fr,In.sortedUniq=function(e){return e&&e.length?ql(e):[]},In.sortedUniqBy=function(e,t){return e&&e.length?ql(e,Zo(t,2)):[]},In.split=function(e,t,n){return n&&"number"!=typeof n&&ai(e,t,n)&&(t=n=void 0),(n=void 0===n?4294967295:n>>>0)?(e=ua(e))&&("string"==typeof t||null!=t&&!Gr(t))&&!(t=Zl(t))&&Ft(e)?uo(Vt(e),0,n):e.split(t,n):[]},In.spread=function(e,t){if("function"!=typeof e)throw new ye(n);return t=null==t?0:rn(oa(t),0),kl(function(n){var l=n[t],o=uo(n,0,t);return l&&st(o,l),tt(e,this,o)})},In.tail=function(e){var t=null==e?0:e.length;return t?zl(e,1,t):[]},In.take=function(e,t,n){return e&&e.length?zl(e,0,(t=n||void 0===t?1:oa(t))<0?0:t):[]},In.takeRight=function(e,t,n){var l=null==e?0:e.length;return l?zl(e,(t=l-(t=n||void 0===t?1:oa(t)))<0?0:t,l):[]},In.takeRightWhile=function(e,t){return e&&e.length?eo(e,Zo(t,3),!1,!0):[]},In.takeWhile=function(e,t){return e&&e.length?eo(e,Zo(t,3)):[]},In.tap=function(e,t){return t(e),e},In.throttle=function(e,t,l){var o=!0,i=!0;if("function"!=typeof e)throw new ye(n);return zr(l)&&(o="leading"in l?!!l.leading:o,i="trailing"in l?!!l.trailing:i),Sr(e,t,{leading:o,maxWait:t,trailing:i})},In.thru=lr,In.toArray=na,In.toPairs=Ia,In.toPairsIn=Oa,In.toPath=function(e){return xr(e)?dt(e,Ni):Jr(e)?[e]:yo(Di(ua(e)))},In.toPlainObject=aa,In.transform=function(e,t,n){var l=xr(e),o=l||Ur(e)||Qr(e);if(t=Zo(t,4),null==n){var i=e&&e.constructor;n=o?l?new i:[]:zr(e)&&Hr(i)?On(ze(e)):{}}return(o?lt:ul)(e,function(e,l,o){return t(n,e,l,o)}),n},In.unary=function(e){return yr(e,1)},In.union=$i,In.unionBy=Yi,In.unionWith=Ki,In.uniq=function(e){return e&&e.length?Xl(e):[]},In.uniqBy=function(e,t){return e&&e.length?Xl(e,Zo(t,2)):[]},In.uniqWith=function(e,t){return t="function"==typeof t?t:void 0,e&&e.length?Xl(e,void 0,t):[]},In.unset=function(e,t){return null==e||Jl(e,t)},In.unzip=qi,In.unzipWith=Gi,In.update=function(e,t,n){return null==e?e:Ql(e,t,io(n))},In.updateWith=function(e,t,n,l){return l="function"==typeof l?l:void 0,null==e?e:Ql(e,t,io(n),l)},In.values=Pa,In.valuesIn=function(e){return null==e?[]:It(e,ba(e))},In.without=Zi,In.words=Ha,In.wrap=function(e,t){return Nr(io(t),e)},In.xor=Xi,In.xorBy=Ji,In.xorWith=Qi,In.zip=er,In.zipObject=function(e,t){return lo(e||[],t||[],Vn)},In.zipObjectDeep=function(e,t){return lo(e||[],t||[],jl)},In.zipWith=tr,In.entries=Ia,In.entriesIn=Oa,In.extend=sa,In.extendWith=ca,Xa(In,In),In.add=uu,In.attempt=Wa,In.camelCase=wa,In.capitalize=Ra,In.ceil=du,In.clamp=function(e,t,n){return void 0===n&&(n=t,t=void 0),void 0!==n&&(n=(n=ra(n))==n?n:0),void 0!==t&&(t=(t=ra(t))==t?t:0),Gn(ra(e),t,n)},In.clone=function(e){return Zn(e,4)},In.cloneDeep=function(e){return Zn(e,5)},In.cloneDeepWith=function(e,t){return Zn(e,5,t="function"==typeof t?t:void 0)},In.cloneWith=function(e,t){return Zn(e,4,t="function"==typeof t?t:void 0)},In.conformsTo=function(e,t){return null==t||Xn(e,t,Sa(t))},In.deburr=La,In.defaultTo=function(e,t){return null==e||e!=e?t:e},In.divide=su,In.endsWith=function(e,t,n){e=ua(e),t=Zl(t);var l=e.length,o=n=void 0===n?l:Gn(oa(n),0,l);return(n-=t.length)>=0&&e.slice(n,o)==t},In.eq=Pr,In.escape=function(e){return(e=ua(e))&&k.test(e)?e.replace(M,xt):e},In.escapeRegExp=function(e){return(e=ua(e))&&$.test(e)?e.replace(z,"\\$&"):e},In.every=function(e,t,n){var l=xr(e)?it:nl;return n&&ai(e,t,n)&&(t=void 0),l(e,Zo(t,3))},In.find=rr,In.findIndex=Li,In.findKey=function(e,t){return ft(e,Zo(t,3),ul)},In.findLast=ar,In.findLastIndex=xi,In.findLastKey=function(e,t){return ft(e,Zo(t,3),dl)},In.floor=cu,In.forEach=ur,In.forEachRight=dr,In.forIn=function(e,t){return null==e?e:rl(e,Zo(t,3),ba)},In.forInRight=function(e,t){return null==e?e:al(e,Zo(t,3),ba)},In.forOwn=function(e,t){return e&&ul(e,Zo(t,3))},In.forOwnRight=function(e,t){return e&&dl(e,Zo(t,3))},In.get=Ea,In.gt=wr,In.gte=Rr,In.has=function(e,t){return null!=e&&li(e,t,fl)},In.hasIn=ya,In.head=Fi,In.identity=Ka,In.includes=function(e,t,n,l){e=Fr(e)?e:Pa(e),n=n&&!l?oa(n):0;var o=e.length;return n<0&&(n=rn(o+n,0)),Xr(e)?n<=o&&e.indexOf(t,n)>-1:!!o&&yt(e,t,n)>-1},In.indexOf=function(e,t,n){var l=null==e?0:e.length;if(!l)return-1;var o=null==n?0:oa(n);return o<0&&(o=rn(l+o,0)),yt(e,t,o)},In.inRange=function(e,t,n){return t=la(t),void 0===n?(n=t,t=0):n=la(n),function(e,t,n){return e>=an(t,n)&&e<rn(t,n)}(e=ra(e),t,n)},In.invoke=ha,In.isArguments=Lr,In.isArray=xr,In.isArrayBuffer=Mr,In.isArrayLike=Fr,In.isArrayLikeObject=kr,In.isBoolean=function(e){return!0===e||!1===e||$r(e)&&vl(e)==a},In.isBuffer=Ur,In.isDate=Br,In.isElement=function(e){return $r(e)&&1===e.nodeType&&!qr(e)},In.isEmpty=function(e){if(null==e)return!0;if(Fr(e)&&(xr(e)||"string"==typeof e||"function"==typeof e.splice||Ur(e)||Qr(e)||Lr(e)))return!e.length;var t=ni(e);if(t==v||t==y)return!e.size;if(ci(e))return!Cl(e).length;for(var n in e)if(be.call(e,n))return!1;return!0},In.isEqual=function(e,t){return hl(e,t)},In.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},In.isError=jr,In.isFinite=function(e){return"number"==typeof e&&nn(e)},In.isFunction=Hr,In.isInteger=Wr,In.isLength=Vr,In.isMap=Yr,In.isMatch=function(e,t){return e===t||Sl(e,t,Jo(t))},In.isMatchWith=function(e,t,n){return n="function"==typeof n?n:void 0,Sl(e,t,Jo(t),n)},In.isNaN=function(e){return Kr(e)&&e!=+e},In.isNative=function(e){if(si(e))throw new ce("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return bl(e)},In.isNil=function(e){return null==e},In.isNull=function(e){return null===e},In.isNumber=Kr,In.isObject=zr,In.isObjectLike=$r,In.isPlainObject=qr,In.isRegExp=Gr,In.isSafeInteger=function(e){return Wr(e)&&e>=-9007199254740991&&e<=9007199254740991},In.isSet=Zr,In.isString=Xr,In.isSymbol=Jr,In.isTypedArray=Qr,In.isUndefined=function(e){return void 0===e},In.isWeakMap=function(e){return $r(e)&&ni(e)==h},In.isWeakSet=function(e){return $r(e)&&"[object WeakSet]"==vl(e)},In.join=function(e,t){return null==e?"":ln.call(e,t)},In.kebabCase=xa,In.last=ji,In.lastIndexOf=function(e,t,n){var l=null==e?0:e.length;if(!l)return-1;var o=l;return void 0!==n&&(o=(o=oa(n))<0?rn(l+o,0):an(o,l-1)),t==t?function(e,t,n){for(var l=n+1;l--;)if(e[l]===t)return l;return l}(e,t,o):Et(e,gt,o,!0)},In.lowerCase=Ma,In.lowerFirst=Fa,In.lt=ea,In.lte=ta,In.max=function(e){return e&&e.length?ll(e,Ka,ml):void 0},In.maxBy=function(e,t){return e&&e.length?ll(e,Zo(t,2),ml):void 0},In.mean=function(e){return ht(e,Ka)},In.meanBy=function(e,t){return ht(e,Zo(t,2))},In.min=function(e){return e&&e.length?ll(e,Ka,Al):void 0},In.minBy=function(e,t){return e&&e.length?ll(e,Zo(t,2),Al):void 0},In.stubArray=iu,In.stubFalse=ru,In.stubObject=function(){return{}},In.stubString=function(){return""},In.stubTrue=function(){return!0},In.multiply=pu,In.nth=function(e,t){return e&&e.length?Pl(e,oa(t)):void 0},In.noConflict=function(){return Ve._===this&&(Ve._=Ne),this},In.noop=Ja,In.now=Er,In.pad=function(e,t,n){e=ua(e);var l=(t=oa(t))?Wt(e):0;if(!t||l>=t)return e;var o=(t-l)/2;return Ro(Qt(o),n)+e+Ro(Jt(o),n)},In.padEnd=function(e,t,n){e=ua(e);var l=(t=oa(t))?Wt(e):0;return t&&l<t?e+Ro(t-l,n):e},In.padStart=function(e,t,n){e=ua(e);var l=(t=oa(t))?Wt(e):0;return t&&l<t?Ro(t-l,n)+e:e},In.parseInt=function(e,t,n){return n||null==t?t=0:t&&(t=+t),dn(ua(e).replace(Y,""),t||0)},In.random=function(e,t,n){if(n&&"boolean"!=typeof n&&ai(e,t,n)&&(t=n=void 0),void 0===n&&("boolean"==typeof t?(n=t,t=void 0):"boolean"==typeof e&&(n=e,e=void 0)),void 0===e&&void 0===t?(e=0,t=1):(e=la(e),void 0===t?(t=e,e=0):t=la(t)),e>t){var l=e;e=t,t=l}if(n||e%1||t%1){var o=sn();return an(e+o*(t-e+Be("1e-"+((o+"").length-1))),t)}return Ml(e,t)},In.reduce=function(e,t,n){var l=xr(e)?ct:Tt,o=arguments.length<3;return l(e,Zo(t,4),n,o,el)},In.reduceRight=function(e,t,n){var l=xr(e)?pt:Tt,o=arguments.length<3;return l(e,Zo(t,4),n,o,tl)},In.repeat=function(e,t,n){return t=(n?ai(e,t,n):void 0===t)?1:oa(t),Fl(ua(e),t)},In.replace=function(){var e=arguments,t=ua(e[0]);return e.length<3?t:t.replace(e[1],e[2])},In.result=function(e,t,n){var l=-1,o=(t=ro(t,e)).length;for(o||(o=1,e=void 0);++l<o;){var i=null==e?void 0:e[Ni(t[l])];void 0===i&&(l=o,i=n),e=Hr(i)?i.call(e):i}return e},In.round=vu,In.runInContext=e,In.sample=function(e){return(xr(e)?Bn:Ul)(e)},In.size=function(e){if(null==e)return 0;if(Fr(e))return Xr(e)?Wt(e):e.length;var t=ni(e);return t==v||t==y?e.size:Cl(e).length},In.snakeCase=ka,In.some=function(e,t,n){var l=xr(e)?vt:$l;return n&&ai(e,t,n)&&(t=void 0),l(e,Zo(t,3))},In.sortedIndex=function(e,t){return Yl(e,t)},In.sortedIndexBy=function(e,t,n){return Kl(e,t,Zo(n,2))},In.sortedIndexOf=function(e,t){var n=null==e?0:e.length;if(n){var l=Yl(e,t);if(l<n&&Pr(e[l],t))return l}return-1},In.sortedLastIndex=function(e,t){return Yl(e,t,!0)},In.sortedLastIndexBy=function(e,t,n){return Kl(e,t,Zo(n,2),!0)},In.sortedLastIndexOf=function(e,t){if(null!=e&&e.length){var n=Yl(e,t,!0)-1;if(Pr(e[n],t))return n}return-1},In.startCase=Ua,In.startsWith=function(e,t,n){return e=ua(e),n=null==n?0:Gn(oa(n),0,e.length),t=Zl(t),e.slice(n,n+t.length)==t},In.subtract=mu,In.sum=function(e){return e&&e.length?Ct(e,Ka):0},In.sumBy=function(e,t){return e&&e.length?Ct(e,Zo(t,2)):0},In.template=function(e,t,n){var l=In.templateSettings;n&&ai(e,t,n)&&(t=void 0),e=ua(e),t=ca({},t,l,jo);var o,i,r=ca({},t.imports,l.imports,jo),a=Sa(r),u=It(r,a),d=0,s=t.interpolate||ue,c="__p += '",p=fe((t.escape||ue).source+"|"+s.source+"|"+(s===j?ee:ue).source+"|"+(t.evaluate||ue).source+"|$","g"),v="//# sourceURL="+(be.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Me+"]")+"\n";e.replace(p,function(t,n,l,r,a,u){return l||(l=r),c+=e.slice(d,u).replace(de,Mt),n&&(o=!0,c+="' +\n__e("+n+") +\n'"),a&&(i=!0,c+="';\n"+a+";\n__p += '"),l&&(c+="' +\n((__t = ("+l+")) == null ? '' : __t) +\n'"),d=u+t.length,t}),c+="';\n";var m=be.call(t,"variable")&&t.variable;if(m){if(J.test(m))throw new ce("Invalid `variable` option passed into `_.template`")}else c="with (obj) {\n"+c+"\n}\n";c=(i?c.replace(w,""):c).replace(R,"$1").replace(L,"$1;"),c="function("+(m||"obj")+") {\n"+(m?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(o?", __e = _.escape":"")+(i?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+c+"return __p\n}";var f=Wa(function(){return pe(a,v+"return "+c).apply(void 0,u)});if(f.source=c,jr(f))throw f;return f},In.times=function(e,t){if((e=oa(e))<1||e>9007199254740991)return[];var n=4294967295,l=an(e,4294967295);e-=4294967295;for(var o=At(l,t=Zo(t));++n<e;)t(n);return o},In.toFinite=la,In.toInteger=oa,In.toLength=ia,In.toLower=function(e){return ua(e).toLowerCase()},In.toNumber=ra,In.toSafeInteger=function(e){return e?Gn(oa(e),-9007199254740991,9007199254740991):0===e?e:0},In.toString=ua,In.toUpper=function(e){return ua(e).toUpperCase()},In.trim=function(e,t,n){if((e=ua(e))&&(n||void 0===t))return Dt(e);if(!e||!(t=Zl(t)))return e;var l=Vt(e),o=Vt(t);return uo(l,Pt(l,o),wt(l,o)+1).join("")},In.trimEnd=function(e,t,n){if((e=ua(e))&&(n||void 0===t))return e.slice(0,zt(e)+1);if(!e||!(t=Zl(t)))return e;var l=Vt(e);return uo(l,0,wt(l,Vt(t))+1).join("")},In.trimStart=function(e,t,n){if((e=ua(e))&&(n||void 0===t))return e.replace(Y,"");if(!e||!(t=Zl(t)))return e;var l=Vt(e);return uo(l,Pt(l,Vt(t))).join("")},In.truncate=function(e,t){var n=30,l="...";if(zr(t)){var o="separator"in t?t.separator:o;n="length"in t?oa(t.length):n,l="omission"in t?Zl(t.omission):l}var i=(e=ua(e)).length;if(Ft(e)){var r=Vt(e);i=r.length}if(n>=i)return e;var a=n-Wt(l);if(a<1)return l;var u=r?uo(r,0,a).join(""):e.slice(0,a);if(void 0===o)return u+l;if(r&&(a+=u.length-a),Gr(o)){if(e.slice(a).search(o)){var d,s=u;for(o.global||(o=fe(o.source,ua(te.exec(o))+"g")),o.lastIndex=0;d=o.exec(s);)var c=d.index;u=u.slice(0,void 0===c?a:c)}}else if(e.indexOf(Zl(o),a)!=a){var p=u.lastIndexOf(o);p>-1&&(u=u.slice(0,p))}return u+l},In.unescape=function(e){return(e=ua(e))&&F.test(e)?e.replace(x,$t):e},In.uniqueId=function(e){var t=++Te;return ua(e)+t},In.upperCase=Ba,In.upperFirst=ja,In.each=ur,In.eachRight=dr,In.first=Fi,Xa(In,(au={},ul(In,function(e,t){be.call(In.prototype,t)||(au[t]=e)}),au),{chain:!1}),In.VERSION="4.17.21",lt(["bind","bindKey","curry","curryRight","partial","partialRight"],function(e){In[e].placeholder=In}),lt(["drop","take"],function(e,t){Rn.prototype[e]=function(n){n=void 0===n?1:rn(oa(n),0);var l=this.__filtered__&&!t?new Rn(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},Rn.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;Rn.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:Zo(e,3),type:n}),t.__filtered__=t.__filtered__||l,t}}),lt(["head","last"],function(e,t){var n="take"+(t?"Right":"");Rn.prototype[e]=function(){return this[n](1).value()[0]}}),lt(["initial","tail"],function(e,t){var n="drop"+(t?"":"Right");Rn.prototype[e]=function(){return this.__filtered__?new Rn(this):this[n](1)}}),Rn.prototype.compact=function(){return this.filter(Ka)},Rn.prototype.find=function(e){return this.filter(e).head()},Rn.prototype.findLast=function(e){return this.reverse().find(e)},Rn.prototype.invokeMap=kl(function(e,t){return"function"==typeof e?new Rn(this):this.map(function(n){return _l(n,e,t)})}),Rn.prototype.reject=function(e){return this.filter(Ar(Zo(e)))},Rn.prototype.slice=function(e,t){e=oa(e);var n=this;return n.__filtered__&&(e>0||t<0)?new Rn(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),void 0!==t&&(n=(t=oa(t))<0?n.dropRight(-t):n.take(t-e)),n)},Rn.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},Rn.prototype.toArray=function(){return this.take(4294967295)},ul(Rn.prototype,function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),l=/^(?:head|last)$/.test(t),o=In[l?"take"+("last"==t?"Right":""):t],i=l||/^find/.test(t);o&&(In.prototype[t]=function(){var t=this.__wrapped__,r=l?[1]:arguments,a=t instanceof Rn,u=r[0],d=a||xr(t),s=function(e){var t=o.apply(In,st([e],r));return l&&c?t[0]:t};d&&n&&"function"==typeof u&&1!=u.length&&(a=d=!1);var c=this.__chain__,p=!!this.__actions__.length,v=i&&!c,m=a&&!p;if(!i&&d){t=m?t:new Rn(this);var f=e.apply(t,r);return f.__actions__.push({func:lr,args:[s],thisArg:void 0}),new wn(f,c)}return v&&m?e.apply(this,r):(f=this.thru(s),v?l?f.value()[0]:f.value():f)})}),lt(["pop","push","shift","sort","splice","unshift"],function(e){var t=_e[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",l=/^(?:pop|shift)$/.test(e);In.prototype[e]=function(){var e=arguments;if(l&&!this.__chain__){var o=this.value();return t.apply(xr(o)?o:[],e)}return this[n](function(n){return t.apply(xr(n)?n:[],e)})}}),ul(Rn.prototype,function(e,t){var n=In[t];if(n){var l=n.name+"";be.call(gn,l)||(gn[l]=[]),gn[l].push({name:t,func:n})}}),gn[Io(void 0,2).name]=[{name:"wrapper",func:void 0}],Rn.prototype.clone=function(){var e=new Rn(this.__wrapped__);return e.__actions__=yo(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=yo(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=yo(this.__views__),e},Rn.prototype.reverse=function(){if(this.__filtered__){var e=new Rn(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},Rn.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,n=xr(e),l=t<0,o=n?e.length:0,i=function(e,t,n){for(var l=-1,o=n.length;++l<o;){var i=n[l],r=i.size;switch(i.type){case"drop":e+=r;break;case"dropRight":t-=r;break;case"take":t=an(t,e+r);break;case"takeRight":e=rn(e,t-r)}}return{start:e,end:t}}(0,o,this.__views__),r=i.start,a=i.end,u=a-r,d=l?a:r-1,s=this.__iteratees__,c=s.length,p=0,v=an(u,this.__takeCount__);if(!n||!l&&o==u&&v==u)return to(e,this.__actions__);var m=[];e:for(;u--&&p<v;){for(var f=-1,E=e[d+=t];++f<c;){var y=s[f],_=y.type,g=(0,y.iteratee)(E);if(2==_)E=g;else if(!g){if(1==_)continue e;break e}}m[p++]=E}return m},In.prototype.at=or,In.prototype.chain=function(){return nr(this)},In.prototype.commit=function(){return new wn(this.value(),this.__chain__)},In.prototype.next=function(){void 0===this.__values__&&(this.__values__=na(this.value()));var e=this.__index__>=this.__values__.length;return{done:e,value:e?void 0:this.__values__[this.__index__++]}},In.prototype.plant=function(e){for(var t,n=this;n instanceof Pn;){var l=Oi(n);l.__index__=0,l.__values__=void 0,t?o.__wrapped__=l:t=l;var o=l;n=n.__wrapped__}return o.__wrapped__=e,t},In.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof Rn){var t=e;return this.__actions__.length&&(t=new Rn(this)),(t=t.reverse()).__actions__.push({func:lr,args:[zi],thisArg:void 0}),new wn(t,this.__chain__)}return this.thru(zi)},In.prototype.toJSON=In.prototype.valueOf=In.prototype.value=function(){return to(this.__wrapped__,this.__actions__)},In.prototype.first=In.prototype.head,bt&&(In.prototype[bt]=function(){return this}),In}();$e?(($e.exports=Yt)._=Yt,ze._=Yt):Ve._=Yt}).call(d)});const p=e=>{var t,n,l,o,i,r,a,u;let{locationDet:d,propertyAddress:s}=e,c=(Array.isArray(d)?d[0]:d)||(Array.isArray(s)?s[0]:s);if(console.log(c,"address_debug"),!c)return e;let p={city:(null==c||null===(t=c.city)||void 0===t?void 0:t.code)||(null==c||null===(n=c.city)||void 0===n?void 0:n.name)||(null==c?void 0:c.city),houseNo:(null==c?void 0:c.houseNo)||(null==c?void 0:c.houseDoorNo)||(null==c?void 0:c.doorNo),street:(null==c?void 0:c.street)||(null==c?void 0:c.buildingColonyName)||(null==c?void 0:c.streetName),landmark:(null==c?void 0:c.landmark)||(null==c?void 0:c.landmarkName),pincode:(null==c?void 0:c.pincode)||(null==c?void 0:c.pinCode),latitude:(null==c?void 0:c.latitude)||(null==c?void 0:c.Latitude),longitude:(null==c?void 0:c.longitude)||(null==c?void 0:c.Longitude),locality:{code:(null==c||null===(l=c.locality)||void 0===l?void 0:l.code)||(null==c||null===(o=c.locality)||void 0===o?void 0:o.name)||(null==c?void 0:c.locality),latitude:null==c||null===(i=c.locality)||void 0===i?void 0:i.latitude,longitude:null==c||null===(r=c.locality)||void 0===r?void 0:r.longitude},addressLine1:null==c?void 0:c.addressLine1,addressLine2:null==c?void 0:c.addressLine2,assembly:(null==c?void 0:c.assembly)||(null==c?void 0:c.Assembly),block:null==c?void 0:c.block,zone:null==c?void 0:c.zone,zro:(null==c||null===(a=c.zro)||void 0===a?void 0:a.code)||(null==c?void 0:c.zro),addressType:(null==c||null===(u=c.addressType)||void 0===u?void 0:u.code)||(null==c?void 0:c.addressType)};return e.address=p,e},v=e=>{var t,n,l;const{locationDet:o,owners:i}=e;let r={},a=[],u=[];e.ownershipCategory=(null==e||null===(t=e.owners)||void 0===t||null===(n=t[0])||void 0===n?void 0:n.ownershipCategory)||"INDIVIDUAL.SINGLEOWNER";const d="string"==typeof e.ownershipCategory?e.ownershipCategory:null===(l=e.ownershipCategory)||void 0===l?void 0:l.code;var s,c,p,v,m,f,E,y,_,g,h,S,b,T,C;if(null!=d&&d.includes("INSTITUTIONALPRIVATE")||null!=d&&d.includes("INSTITUTIONALGOVERNMENT"))r.designation=null==i||null===(s=i[0])||void 0===s?void 0:s.designation,r.name=null==i||null===(c=i[0])||void 0===c?void 0:c.institutionName,r.type=null==i||null===(p=i[0])||void 0===p||null===(v=p.institutionType)||void 0===v||null===(m=v.code)||void 0===m||null===(f=m.split("."))||void 0===f?void 0:f[1],r.landlineNumber=null==i||null===(E=i[0])||void 0===E?void 0:E.altContactNumber,r.tenantId=(null==o||null===(y=o.city)||void 0===y?void 0:y.code)||(null==o?void 0:o.city),a.push({altContactNumber:null==i||null===(_=i[0])||void 0===_?void 0:_.altContactNumber,permanentAddress:null==i||null===(g=i[0])||void 0===g?void 0:g.permanentAddress,correspondenceAddress:null==i||null===(h=i[0])||void 0===h?void 0:h.permanentAddress,sameAsPropertyAddress:(null==i||null===(S=i[0])||void 0===S?void 0:S.isCorrespondenceAddress)||(null==i||null===(b=i[0])||void 0===b?void 0:b.isCoresAddr),mobileNumber:null==i||null===(T=i[0])||void 0===T?void 0:T.mobileNumber,name:null==i||null===(C=i[0])||void 0===C?void 0:C.name,ownerType:"NONE",status:"ACTIVE",documents:u}),e.institution=r,e.owners=a;else if(i&&i.length>0)i.map(e=>{var t,n,l,o;a.push({emailId:null==e?void 0:e.emailId,fatherOrHusbandName:null==e?void 0:e.fatherOrHusbandName,gender:(null==e||null===(t=e.gender)||void 0===t?void 0:t.code)||(null==e||null===(n=e.gender)||void 0===n?void 0:n.value)||(null==e?void 0:e.gender),sameAsPropertyAddress:(null==e?void 0:e.isCorrespondenceAddress)||(null==e?void 0:e.isCoresAddr),mobileNumber:null==e?void 0:e.mobileNumber,name:null==e?void 0:e.name,ownerType:(null==e||null===(l=e.ownerType)||void 0===l?void 0:l.code)||(null==e?void 0:e.ownerType)||"NONE",permanentAddress:null==e?void 0:e.permanentAddress,relationship:(null==e||null===(o=e.relationship)||void 0===o?void 0:o.code)||(null==e?void 0:e.relationship),documents:(null==e?void 0:e.documents)||u})}),e.owners=a;else if(null!=e&&e.applicant&&null!=e&&e.contact){var A;const{applicant:t,contact:n,useDetails:l}=e;a.push({name:`${t.firstName}${t.middleName?" "+t.middleName:""}${t.lastName?" "+t.lastName:""}`,mobileNumber:n.mobileNumber,gender:(null==l||null===(A=l.gender)||void 0===A?void 0:A.code)||(null==l?void 0:l.gender)||"MALE",fatherOrHusbandName:t.ParentorSpouse||"NA",relationship:"FATHER",ownerType:"NONE",status:"ACTIVE"}),e.owners=a}return e},m=e=>{var t,n,l,o,i,r,a,u,d;let s={};const{waterConnection:c,useDetails:p}=e,v=(null==c?void 0:c.useDetails)||p;return s={propertyType:(null==v||null===(t=v.propertyType)||void 0===t?void 0:t.code)||(null==v?void 0:v.propertyType),usageCategory:(null==v||null===(n=v.propertyCategory)||void 0===n?void 0:n.code)||(null==v?void 0:v.propertyCategory),landArea:parseFloat(null==v?void 0:v.plotArea),superBuiltUpArea:parseFloat(null==v?void 0:v.builtUpArea),noOfFloors:"BASEMENT"===(null==v||null===(l=v.noOfFloors)||void 0===l?void 0:l.code)?0:parseInt((null==v||null===(o=v.noOfFloors)||void 0===o||null===(i=o.code)||void 0===i||null===(r=i.split("_"))||void 0===r?void 0:r[0])||(null==v||null===(a=v.noOfFloors)||void 0===a||null===(u=a.split)||void 0===u||null===(d=u.call(a,"_"))||void 0===d?void 0:d[0]))||1},e.propertyDetails=s,e},f=function(e){var t,n,l,o,i,r,a,u,d,s,c,f,E,y,_,g,h,S,b,T,C,A,D,N,I;void 0===e&&(e={}),e=v(e),e=p(e);let O=null===(t=(e=m(e)).propertyDetails)||void 0===t?void 0:t.propertyType,P=(null===(n=e.propertyDetails)||void 0===n?void 0:n.noOfFloors)||1,w=null===(l=e)||void 0===l||null===(o=l.owners)||void 0===o||null===(i=o[0])||void 0===i?void 0:i.ownershipCategory;const R={Property:{tenantId:e.tenantId,address:e.address,propertyType:O,...e.propertyDetails,ownershipCategory:"INDIVIDUAL.SINGLEOWNER",usageCategory:null===(r=e.propertyDetails)||void 0===r?void 0:r.usageCategory,owners:[...(e.owners||[]).map((e,t)=>{var n,l,o,i,r;return{...e,additionalDetails:{ownerSequence:t,ownerName:null==e?void 0:e.name},documents:e.documents?Array.isArray(e.documents)?e.documents:Object.keys(e.documents).map(t=>{var n;const l=e.documents[t];return{documentType:(null==l||null===(n=l.documentType)||void 0===n?void 0:n.code)||(null==l?void 0:l.documentType)||"",fileStoreId:(null==l?void 0:l.fileStoreId)||""}}):[],gender:"string"==typeof e.gender?e.gender:(null===(n=e.gender)||void 0===n?void 0:n.code)||(null===(l=e.gender)||void 0===l?void 0:l.value),ownerType:(null===(o=e.ownerType)||void 0===o?void 0:o.code)||e.ownerType||"NONE",relationship:(null===(i=e.relationship)||void 0===i?void 0:i.code)||e.relationship,inistitutetype:null==e||null===(r=e.inistitutetype)||void 0===r?void 0:r.value,landlineNumber:null==e?void 0:e.altContactNumber,status:"ACTIVE"}})],noOfFloors:P,additionalDetails:{isRainwaterHarvesting:!1,propertyType:O,propertyCategory:null===(a=e.propertyDetails)||void 0===a?void 0:a.usageCategory,waterConnectionUsageType:null===(u=e.waterConnection)||void 0===u||null===(d=u.useDetails)||void 0===d||null===(s=d.WaterConnectionUsageType)||void 0===s?void 0:s.code,yearOfConstruction:null===(c=e.waterConnection)||void 0===c||null===(f=c.useDetails)||void 0===f||null===(E=f.SelectYearofConstruction)||void 0===E?void 0:E.value,numberOfDwellingUnits:null===(y=e.waterConnection)||void 0===y||null===(_=y.useDetails)||void 0===_?void 0:_.NumberofDwellingUnits,numberOfRooms:null===(g=e.waterConnection)||void 0===g||null===(h=g.useDetails)||void 0===h?void 0:h.NumberofRooms,numberOfFloors:null===(S=e.waterConnection)||void 0===S||null===(b=S.useDetails)||void 0===b?void 0:b.NumberofFloors,plotArea:null===(T=e.waterConnection)||void 0===T||null===(C=T.useDetails)||void 0===C?void 0:C.plotArea,builtUpArea:null===(A=e.waterConnection)||void 0===A||null===(D=A.useDetails)||void 0===D?void 0:D.builtUpArea,numberOfBeds:null===(N=e.waterConnection)||void 0===N||null===(I=N.useDetails)||void 0===I?void 0:I.hospitalBeds,owners:[...(e.owners||[]).map((e,t)=>{var n,l,o,i,r;return{...e,additionalDetails:{ownerSequence:t,ownerName:null==e?void 0:e.name},documents:e.documents?Array.isArray(e.documents)?e.documents:Object.keys(e.documents).map(t=>{var n;const l=e.documents[t];return{documentType:(null==l||null===(n=l.documentType)||void 0===n?void 0:n.code)||(null==l?void 0:l.documentType)||"",fileStoreId:(null==l?void 0:l.fileStoreId)||""}}):[],gender:"string"==typeof e.gender?e.gender:(null===(n=e.gender)||void 0===n?void 0:n.code)||(null===(l=e.gender)||void 0===l?void 0:l.value),ownerType:(null===(o=e.ownerType)||void 0===o?void 0:o.code)||e.ownerType||"NONE",relationship:(null===(i=e.relationship)||void 0===i?void 0:i.code)||e.relationship,inistitutetype:null==e||null===(r=e.inistitutetype)||void 0===r?void 0:r.value,landlineNumber:null==e?void 0:e.altContactNumber,status:"ACTIVE"}})]},creationReason:"CREATE",source:"MUNICIPAL_RECORDS",channel:"SYSTEM"}},L="string"==typeof w?w:null==w?void 0:w.code;var x;return(null!=L&&L.includes("INSTITUTIONALPRIVATE")||null!=L&&L.includes("INSTITUTIONALGOVERNMENT"))&&(R.Property.institution=null===(x=e)||void 0===x?void 0:x.institution),R},E=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},y=e=>{var r;let{config:a,onSelect:d,value:s,userType:p}=e;const[v,m]=n.useState(null),E=Digit.ULBService.getCurrentTenantId(),{t:y}=(Digit.Hooks.pt.useTenants(),o.useTranslation()),_=i.useLocation(),[g,h]=n.useState(!0),S={...s};i.useHistory(),i.useRouteMatch(),sessionStorage.setItem("VisitedCommonPTSearch",!0),sessionStorage.setItem("VisitedLightCreate",!0);const b=window.Digit.Utils.browser.isMobile();let T=null===(r=Digit.Hooks.pt.useTenants())||void 0===r?void 0:r.sort((e,t)=>{var n,l;return null==e||null===(n=e.i18nKey)||void 0===n||null===(l=n.localeCompare)||void 0===l?void 0:l.call(n,null==t?void 0:t.i18nKey)});window.location.href.includes("obps")&&(T=Digit.SessionStorage.get("OBPS_TENANTS")),window.location.href.includes("fsm")&&(T=Digit.SessionStorage.get("FSM_TENANTS"));const[C,A]=n.useState(""),[D,N]=n.useState([]);n.useEffect(()=>{if(null!=_&&_.state&&(!D||0===D.length)){var e,t,n,l;const o=null===(e=_.state)||void 0===e?void 0:e.applicant,i=null===(t=_.state)||void 0===t?void 0:t.contact,r=null===(n=_.state)||void 0===n?void 0:n.useDetails,a=null===(l=_.state)||void 0===l?void 0:l.propertyAddress;o&&i&&N([{name:`${o.firstName}${o.middleName?" "+o.middleName:""}${o.lastName?" "+o.lastName:""}`,mobileNumber:i.mobileNumber,gender:(null==r?void 0:r.gender)||{code:"MALE",name:"Male"},fatherOrHusbandName:o.ParentorSpouse||"NA",relationship:{code:"FATHER",name:"Father"},ownerType:{code:"NONE",name:"None"},ownershipCategory:"INDIVIDUAL.SINGLEOWNER"}]),(a||r)&&A({locationDet:{cityCode:(null==a?void 0:a.cityCode)||(null==a?void 0:a.city),locality:null==a?void 0:a.locality,houseDoorNo:(null==a?void 0:a.houseNo)||(null==a?void 0:a.houseDoorNo),buildingColonyName:(null==a?void 0:a.street)||(null==a?void 0:a.buildingColonyName),landmarkName:(null==a?void 0:a.landmark)||(null==a?void 0:a.landmarkName)},waterConnection:{useDetails:r}})}},[null==_?void 0:_.state]);const[I,O]=n.useState("");let P="employee"!=p&&((null==a?void 0:a.isSkipEnabled)||sessionStorage.getItem("skipenabled"));const[w,R,L]=Digit.Hooks.useSessionStorage("EMPLOYEE_MUTATION_HAPPENED",!1),[x,M,F]=Digit.Hooks.useSessionStorage("EMPLOYEE_MUTATION_SUCCESS_DATA",{}),{isLoading:k}=Digit.Hooks.pt.useMDMS(Digit.ULBService.getStateId(),"PropertyTax","CommonFieldsConfig"),U=Digit.Hooks.pt.usePropertyAPI(E,!0);return n.useEffect(()=>{R(!1),F()},[]),k?l.createElement(t.Loader,null):l.createElement(l.Fragment,null,l.createElement("div",{className:"employee-form-section-wrapper"},l.createElement(t.VerticalTimeline,{config:[{timeLine:[{actions:(()=>{var e,t,n;let l=window.location.href,o=null==l||null===(e=l.split("="))||void 0===e||null===(t=e[1])||void 0===t||null===(n=t.split("/"))||void 0===n?void 0:n[3];return y(o?"ES_COMMON_CREATE_PROPERTY_HEADER_"+(null==o?void 0:o.toUpperCase()):"ES_COMMON_CREATE_PROPERTY_HEADER")})(),currentStep:1}]}],showFinalStep:!1}),l.createElement(t.FormComposer,{onSkip:()=>{d("isSkip",!0)},showSkip:P,skipStyle:b?{}:{textAlign:"right",marginRight:"55px"},onSubmit:function(){try{var e,t,n,l,o,i,r;const a=D&&D.length>0?D:null==C?void 0:C.owners;if((null!=C&&null!==(e=C.owners)&&void 0!==e&&null!==(t=e.ownershipCategory)&&void 0!==t&&t.includes("MULTIPLEOWNERS")||null!=C&&null!==(n=C.owners)&&void 0!==n&&null!==(l=n[0])&&void 0!==l&&null!==(o=l.ownershipCategory)&&void 0!==o&&null!==(i=o.code)&&void 0!==i&&i.includes("MULTIPLEOWNERS"))&&1==(null==C||null===(r=C.owners)||void 0===r?void 0:r.length))m({key:!0,label:"PT_COMMON_ONE_MORE_OWNER_INFROMATION_REQUIRED"});else if(a&&0!==a.length){const e=f({...C,owners:a});e.Property.tenantId=E,U.mutate(e,{onSuccess:e=>{var t,n,l,o;null!=e&&e.Errors&&(null==e?void 0:e.Errors.length)>0?m({key:!0,label:(null==e||null===(l=e.Errors[0])||void 0===l?void 0:l.message)||y("PT_COMMON_FAILED_TO_CREATE_PROPERTY")}):(m({key:!1,label:`${y("CS_NEW_PROPERTY_APPLICATION_CREATED_SUCCESS")} - ${null==e||null===(t=e.Properties)||void 0===t||null===(n=t[0])||void 0===n?void 0:n.propertyId}`}),d&&d("cptNewProperty",{property:null==e||null===(o=e.Properties)||void 0===o?void 0:o[0]}))},onError:e=>{var t,n,l,o;m({key:!0,label:(null==e||null===(t=e.response)||void 0===t||null===(n=t.data)||void 0===n||null===(l=n.Errors)||void 0===l||null===(o=l[0])||void 0===o?void 0:o.message)||y("PT_COMMON_FAILED_TO_CREATE_PROPERTY")})}})}else m({key:!0,label:y("PT_COMMON_OWNER_DETAILS_REQUIRED")});return Promise.resolve()}catch(e){return Promise.reject(e)}},noBoxShadow:!0,inline:!0,config:u,label:y("SUBMIT"),isDisabled:!g,defaultValues:S,onFormValueChange:(e,t,n)=>{c.isEqual(t,C)||A(t),h(!0)},noBreakLine:!0,noCard:!0})),v&&l.createElement(t.Toast,{error:v.key,label:v.label,onClose:()=>{m(null)}}))},g=e=>{const{t:t}=o.useTranslation();return e.isSuccess?window.location.href.includes("edit-application")?t("CS_PROPERTY_UPDATE_APPLICATION_SUCCESS"):window.location.href.includes("employee")?t("CS_NEW_PROPERTY_APPLICATION_CREATED_SUCCESS"):t("CS_NEW_PROPERTY_APPLICATION_SUBMITTED_SUCCESS"):e.isLoading?window.location.href.includes("edit-application")?t("CS_PROPERTY_UPDATE_APPLICATION_PENDING"):t("CS_PROPERTY_APPLICATION_PENDING"):e.isSuccess?void 0:window.location.href.includes("edit-application")?t("CS_PROPERTY_UPDATE_APPLICATION_FAILED"):t("CS_PROPERTY_APPLICATION_FAILED")},h={padding:"4px 0px",justifyContent:"space-between"},S=e=>{var n;return l.createElement(t.Banner,{message:g(e),applicationNumber:null===(n=e.data)||void 0===n?void 0:n.Properties[0].acknowldgementNumber,info:e.isSuccess?e.t("PT_APPLICATION_NO"):"",successful:e.isSuccess})},b=e=>{var r,a,u,d,s,c,E,y,_,g,b,T;let{onSuccess:C,onSelect:A,formData:D,redirectUrl:N,userType:I}=e;const{t:O}=o.useTranslation(),P=i.useLocation(),w=Digit.ULBService.getStateId(),R=Digit.ULBService.getCurrentTenantId(),L=i.useHistory();let x=null==P||null===(r=P.state)||void 0===r?void 0:r.data;var M;A&&(x=null==D||null===(M=D.cptNewProperty)||void 0===M?void 0:M.property);const F=null==P||null===(a=P.state)||void 0===a?void 0:a.property;let k=!1,{data:U}=Digit.Hooks.pt.useMDMS(w,"PropertyTax","PTWorkflow");((null==U||null===(u=U.PropertyTax)||void 0===u?void 0:u.PTWorkfow)||[]).forEach(e=>{e.enable&&e.businessService.includes("WNS")&&(k=!0)});const B=Digit.Hooks.pt.usePropertyAPI(null!==(d=x)&&void 0!==d&&null!==(s=d.locationDet)&&void 0!==s&&s.city?null===(c=x.locationDet)||void 0===c||null===(E=c.city)||void 0===E?void 0:E.code:R,!0),j=Digit.Hooks.pt.usePropertyAPI(null!==(y=x)&&void 0!==y&&null!==(_=y.locationDet)&&void 0!==_&&_.city?null===(g=x.locationDet)||void 0===g||null===(b=g.city)||void 0===b?void 0:b.code:R,!1);Digit.Hooks.useStore.getInitData(),n.useEffect(()=>{if(!F)try{var e,t,n,l;let o="employee"===I?R:null===(e=x)||void 0===e||null===(t=e.locationDet)||void 0===t||null===(n=t.city)||void 0===n?void 0:n.code;x.tenantId=o;let i=f(x);i.Property.tenantId=(null==i||null===(l=i.Property)||void 0===l?void 0:l.tenantId)||o,B.mutate(i,{onSuccess:C})}catch(e){}},[]),n.useEffect(()=>{new URLSearchParams(P.search).get("redirectToUrl")},[B]),n.useEffect(()=>{if(B.isSuccess&&k)try{var e,t,n,l;let o="employee"===I?R:null===(e=x)||void 0===e||null===(t=e.locationDet)||void 0===t||null===(n=t.city)||void 0===n?void 0:n.code;x.tenantId=o;let i=function(e){var t,n,l,o,i,r,a,u,d,s,c,f,E,y,_,g,h;void 0===e&&(e={}),e=v(e),e=p(e);let S=null===(t=(e=m(e)).propertyDetails)||void 0===t?void 0:t.propertyType,b=(null===(n=e.propertyDetails)||void 0===n?void 0:n.noOfFloors)||1;const T={Property:{id:e.id,accountId:e.accountId,acknowldgementNumber:e.acknowldgementNumber,propertyId:e.propertyId,status:e.status||"INWORKFLOW",tenantId:e.tenantId,address:e.address,propertyType:S,ownershipCategory:"INDIVIDUAL.SINGLEOWNER",owners:[...e.owners.map((e,t)=>{var n,l,o,i;return{...e,additionalDetails:{ownerSequence:t,ownerName:null==e?void 0:e.name},documents:Object.keys(e.documents).map(t=>{const{documentType:n,fileStoreId:l}=e.documents[t];return{documentType:n.code,fileStoreId:l}}),gender:null===(n=e.gender)||void 0===n?void 0:n.code,ownerType:(null===(l=e.ownerType)||void 0===l?void 0:l.code)||"NONE",relationship:null===(o=e.relationship)||void 0===o?void 0:o.code,inistitutetype:null==e||null===(i=e.inistitutetype)||void 0===i?void 0:i.value,landlineNumber:null==e?void 0:e.altContactNumber,status:"ACTIVE"}})],noOfFloors:b,additionalDetails:{isRainwaterHarvesting:!1,waterConnectionUsageType:null===(l=e.waterConnection)||void 0===l||null===(o=l.useDetails)||void 0===o||null===(i=o.WaterConnectionUsageType)||void 0===i?void 0:i.code,yearOfConstruction:null===(r=e.waterConnection)||void 0===r||null===(a=r.useDetails)||void 0===a||null===(u=a.SelectYearofConstruction)||void 0===u?void 0:u.value,numberOfDwellingUnits:null===(d=e.waterConnection)||void 0===d||null===(s=d.useDetails)||void 0===s?void 0:s.NumberofDwellingUnits,numberOfRooms:null===(c=e.waterConnection)||void 0===c||null===(f=c.useDetails)||void 0===f?void 0:f.NumberofRooms,hospitalBeds:null===(E=e.waterConnection)||void 0===E||null===(y=E.useDetails)||void 0===y?void 0:y.hospitalBeds,owners:[...e.owners.map((e,t)=>{var n,l,o,i;return{...e,additionalDetails:{ownerSequence:t,ownerName:null==e?void 0:e.name},documents:Object.keys(e.documents).map(t=>{const{documentType:n,fileStoreId:l}=e.documents[t];return{documentType:n.code,fileStoreId:l}}),gender:null===(n=e.gender)||void 0===n?void 0:n.code,ownerType:(null===(l=e.ownerType)||void 0===l?void 0:l.code)||"NONE",relationship:null===(o=e.relationship)||void 0===o?void 0:o.code,inistitutetype:null==e||null===(i=e.inistitutetype)||void 0===i?void 0:i.value,landlineNumber:null==e?void 0:e.altContactNumber,status:"ACTIVE"}})]},...e.propertyDetails,creationReason:getCreationReason(e),source:"MUNICIPAL_RECORDS",channel:"CITIZEN",workflow:getWorkflow(e)}};let C=JSON.parse(sessionStorage.getItem("propertyInitialObject"));if(checkArrayLength(null==C?void 0:C.units)&&checkIsAnArray(null===(_=T.Property)||void 0===_?void 0:_.units)&&null!==(g=e)&&void 0!==g&&g.isEditProperty){var A;C.units=C.units.filter(e=>e.active);let e=C.units.map(e=>({...e,active:!1}));null===(A=T.Property)||void 0===A||A.units.push(...e)}return checkArrayLength(null==C?void 0:C.owners)&&checkIsAnArray(null===(h=T.Property)||void 0===h?void 0:h.owners)&&(T.Property.owners=[...C.owners]),null!=C&&C.auditDetails&&(T.Property.auditDetails={...C.auditDetails}),T}(x);i.Property.tenantId=(null==i||null===(l=i.Property)||void 0===l?void 0:l.tenantId)||o,j.mutate(i,{onSuccess:C})}catch(e){}},[B.isSuccess]);const H=!F&&(B.isLoading||B.isIdle),W=!!F||B.isSuccess,V=F?{Properties:[F]}:B.data;return H?l.createElement(t.Loader,null):l.createElement(t.Card,null,l.createElement(S,{t:O,data:V,isSuccess:W,isLoading:H}),W&&l.createElement(t.CardText,null,window.location.href.includes("employee")?O("CS_CREATE_PROPERTY_SUCCESS_EMP_RESPONSE"):O("CS_CREATE_PROPERTY_SUCCESS_CITIZEN_RESPONSE")),!W&&l.createElement(t.CardText,null,O("CS_FILE_PROPERTY_FAILED_RESPONSE")),l.createElement(t.StatusTable,null,W&&l.createElement(t.Row,{rowContainerStyle:h,last:!0,label:O("PT_COMMON_TABLE_COL_PT_ID"),text:null==V||null===(T=V.Properties[0])||void 0===T?void 0:T.propertyId,textStyle:{whiteSpace:"pre",width:"200%"}})),W&&(window.location.href.includes("/citizen/")||window.location.href.includes("/employee/"))&&l.createElement(t.SubmitBar,A?{label:O("CS_COMMON_PROCEED"),onSubmit:()=>{var e,t,n;A&&B.isSuccess&&(sessionStorage.setItem("Digit_OBPS_PT",JSON.stringify(null==B||null===(e=B.data)||void 0===e?void 0:e.Properties[0])),sessionStorage.setItem("Digit_FSM_PT",JSON.stringify(null==B||null===(t=B.data)||void 0===t?void 0:t.Properties[0])),A("cpt",{details:null==B||null===(n=B.data)||void 0===n?void 0:n.Properties[0]}))}}:{label:O("CS_COMMON_PROCEED"),onSubmit:()=>{const e=new URLSearchParams(P.search).get("redirectToUrl"),t=N&&"undefined"!==N?N:e&&"undefined"!==e?e:null;var n,l,o;t&&L.push(`${t}?propertyId=${null==V||null===(n=V.Properties[0])||void 0===n?void 0:n.propertyId}&tenantId=${null==V||null===(l=V.Properties[0])||void 0===l?void 0:l.tenantId}`,{...null==P||null===(o=P.state)||void 0===o?void 0:o.prevState})}}))},T=e=>{const n=r.useQueryClient(),a=i.useRouteMatch(),u=(o.useTranslation(),i.useLocation(),i.useHistory()),d=Digit.ULBService.getStateId(),[s,c,p]=Digit.Hooks.useSessionStorage("PT_CREATE_PROPERTY",{});let{isLoading:v}=Digit.Hooks.pt.useMDMS(d,"PropertyTax","CommonFieldsConfig");const m=i.useLocation().search,f=new URLSearchParams(m).get("redirectUrl");return v?l.createElement(t.Loader,null):l.createElement(i.Switch,null,l.createElement(i.Route,{exact:!0,path:""+a.path},l.createElement(y,{onSubmit:function(){try{return u.push(a.path+"/acknowledgement"),Promise.resolve()}catch(e){return Promise.reject(e)}},value:s,userType:"citizen"})),l.createElement(i.Route,{exact:!0,path:a.path+"/save-property"},l.createElement(b,{data:s,onSuccess:()=>{p(),n.invalidateQueries("PT_CREATE_PROPERTY")},redirectUrl:f,userType:"citizen"})))},C=[{texts:{header:"SEARCH_PROPERTY",submitButtonLabel:"PT_HOME_SEARCH_RESULTS_BUTTON_SEARCH",text:""},inputs:[{label:"PT_OWNER_MOB_NO_LABEL",type:"mobileNumber",name:"mobileNumber",validation:{pattern:{value:/[6789][0-9]{9}/,message:"CORE_COMMON_MOBILE_ERROR"}},error:"CORE_COMMON_MOBILE_ERROR"},{label:"PT_PROPERTY_ID",description:"CS_PROPERTY_ID_FORMAT_MUST_BE",type:"text",name:"propertyIds",error:"ERR_INVALID_PROPERTY_ID",validation:{pattern:{value:"[A-Za-z]{2}-[A-Za-z]{2}-[0-9]{4}-[0-9]{4}-[0-9]{2}-[0-9]{2}-[0-9]{6}||[A-Za-z]{2}-[A-Za-z]{2}-[0-9]{4}-[0-9]{4}-[0-9]{2}-[0-9]{2}-[0-9]{6}||[A-Za-z]{2}-[A-Za-z]{2}-[0-9]{4}-[0-9]{2}-[0-9]{2}-[0-9]{6}",message:"ERR_INVALID_PROPERTY_ID"}}},{label:"PT_PROPERTY_ADDRESS_OLDPID",type:"text",name:"oldPropertyId",error:"ERR_INVALID_PROPERTY_ID",validation:{pattern:{value:"[A-Za-z]{2}-[A-Za-z]{2}-[0-9]{4}-[0-9]{4}-[0-9]{2}-[0-9]{2}-[0-9]{6}|[A-Za-z]{2}-[A-Za-z]{2}-[0-9]{4}-[0-9]{2}-[0-9]{2}-[0-9]{6}",message:"ERR_INVALID_PROPERTY_ID"}}},{label:"PT_COMMON_PAYEE_NAME",type:"text",name:"name",validation:{pattern:{value:"^[a-zA-Z ]+$",message:"PAYMENT_INVALID_NAME"}},error:"PAYMENT_INVALID_NAME"},{label:"PT_DOOR_NUM_LABEL",type:"text",name:"doorNumber",validation:{pattern:{value:"[A-Za-z0-9#,/ -()]{1,63}",message:"ERR_INVALID_DOOR_NO"}},error:"ERR_INVALID_DOOR_NO"}]}];function A(){return(A=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)}var D="function"==typeof Symbol&&Symbol.for,N=D?Symbol.for("react.element"):60103,I=D?Symbol.for("react.portal"):60106,O=D?Symbol.for("react.fragment"):60107,P=D?Symbol.for("react.strict_mode"):60108,w=D?Symbol.for("react.profiler"):60114,R=D?Symbol.for("react.provider"):60109,L=D?Symbol.for("react.context"):60110,x=D?Symbol.for("react.async_mode"):60111,M=D?Symbol.for("react.concurrent_mode"):60111,F=D?Symbol.for("react.forward_ref"):60112,k=D?Symbol.for("react.suspense"):60113,U=D?Symbol.for("react.suspense_list"):60120,B=D?Symbol.for("react.memo"):60115,j=D?Symbol.for("react.lazy"):60116,H=D?Symbol.for("react.block"):60121,W=D?Symbol.for("react.fundamental"):60117,V=D?Symbol.for("react.responder"):60118,z=D?Symbol.for("react.scope"):60119;function $(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case N:switch(e=e.type){case x:case M:case O:case w:case P:case k:return e;default:switch(e=e&&e.$$typeof){case L:case F:case j:case B:case R:return e;default:return t}}case I:return t}}}function Y(e){return $(e)===M}var K={AsyncMode:x,ConcurrentMode:M,ContextConsumer:L,ContextProvider:R,Element:N,ForwardRef:F,Fragment:O,Lazy:j,Memo:B,Portal:I,Profiler:w,StrictMode:P,Suspense:k,isAsyncMode:function(e){return Y(e)||$(e)===x},isConcurrentMode:Y,isContextConsumer:function(e){return $(e)===L},isContextProvider:function(e){return $(e)===R},isElement:function(e){return"object"==typeof e&&null!==e&&e.$$typeof===N},isForwardRef:function(e){return $(e)===F},isFragment:function(e){return $(e)===O},isLazy:function(e){return $(e)===j},isMemo:function(e){return $(e)===B},isPortal:function(e){return $(e)===I},isProfiler:function(e){return $(e)===w},isStrictMode:function(e){return $(e)===P},isSuspense:function(e){return $(e)===k},isValidElementType:function(e){return"string"==typeof e||"function"==typeof e||e===O||e===M||e===w||e===P||e===k||e===U||"object"==typeof e&&null!==e&&(e.$$typeof===j||e.$$typeof===B||e.$$typeof===R||e.$$typeof===L||e.$$typeof===F||e.$$typeof===W||e.$$typeof===V||e.$$typeof===z||e.$$typeof===H)},typeOf:$},q=s(function(e,t){"production"!==process.env.NODE_ENV&&function(){var e="function"==typeof Symbol&&Symbol.for,n=e?Symbol.for("react.element"):60103,l=e?Symbol.for("react.portal"):60106,o=e?Symbol.for("react.fragment"):60107,i=e?Symbol.for("react.strict_mode"):60108,r=e?Symbol.for("react.profiler"):60114,a=e?Symbol.for("react.provider"):60109,u=e?Symbol.for("react.context"):60110,d=e?Symbol.for("react.async_mode"):60111,s=e?Symbol.for("react.concurrent_mode"):60111,c=e?Symbol.for("react.forward_ref"):60112,p=e?Symbol.for("react.suspense"):60113,v=e?Symbol.for("react.suspense_list"):60120,m=e?Symbol.for("react.memo"):60115,f=e?Symbol.for("react.lazy"):60116,E=e?Symbol.for("react.block"):60121,y=e?Symbol.for("react.fundamental"):60117,_=e?Symbol.for("react.responder"):60118,g=e?Symbol.for("react.scope"):60119;function h(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case n:var v=e.type;switch(v){case d:case s:case o:case r:case i:case p:return v;default:var E=v&&v.$$typeof;switch(E){case u:case c:case f:case m:case a:return E;default:return t}}case l:return t}}}var S=s,b=u,T=a,C=n,A=c,D=o,N=f,I=m,O=l,P=r,w=i,R=p,L=!1;function x(e){return h(e)===s}t.AsyncMode=d,t.ConcurrentMode=S,t.ContextConsumer=b,t.ContextProvider=T,t.Element=C,t.ForwardRef=A,t.Fragment=D,t.Lazy=N,t.Memo=I,t.Portal=O,t.Profiler=P,t.StrictMode=w,t.Suspense=R,t.isAsyncMode=function(e){return L||(L=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),x(e)||h(e)===d},t.isConcurrentMode=x,t.isContextConsumer=function(e){return h(e)===u},t.isContextProvider=function(e){return h(e)===a},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===n},t.isForwardRef=function(e){return h(e)===c},t.isFragment=function(e){return h(e)===o},t.isLazy=function(e){return h(e)===f},t.isMemo=function(e){return h(e)===m},t.isPortal=function(e){return h(e)===l},t.isProfiler=function(e){return h(e)===r},t.isStrictMode=function(e){return h(e)===i},t.isSuspense=function(e){return h(e)===p},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===o||e===s||e===r||e===i||e===p||e===v||"object"==typeof e&&null!==e&&(e.$$typeof===f||e.$$typeof===m||e.$$typeof===a||e.$$typeof===u||e.$$typeof===c||e.$$typeof===y||e.$$typeof===_||e.$$typeof===g||e.$$typeof===E)},t.typeOf=h}()}),G=s(function(e){e.exports="production"===process.env.NODE_ENV?K:q}),Z=Object.getOwnPropertySymbols,X=Object.prototype.hasOwnProperty,J=Object.prototype.propertyIsEnumerable;function Q(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}var ee=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(""))return!1;var l={};return"abcdefghijklmnopqrst".split("").forEach(function(e){l[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},l)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var n,l,o=Q(e),i=1;i<arguments.length;i++){for(var r in n=Object(arguments[i]))X.call(n,r)&&(o[r]=n[r]);if(Z){l=Z(n);for(var a=0;a<l.length;a++)J.call(n,l[a])&&(o[l[a]]=n[l[a]])}}return o},te="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",ne=Function.call.bind(Object.prototype.hasOwnProperty),le=function(){};if("production"!==process.env.NODE_ENV){var oe=te,ie={},re=ne;le=function(e){var t="Warning: "+e;"undefined"!=typeof console&&console.error(t);try{throw new Error(t)}catch(e){}}}function ae(e,t,n,l,o){if("production"!==process.env.NODE_ENV)for(var i in e)if(re(e,i)){var r;try{if("function"!=typeof e[i]){var a=Error((l||"React class")+": "+n+" type `"+i+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[i]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw a.name="Invariant Violation",a}r=e[i](t,i,l,n,null,oe)}catch(e){r=e}if(!r||r instanceof Error||le((l||"React class")+": type specification of "+n+" `"+i+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof r+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),r instanceof Error&&!(r.message in ie)){ie[r.message]=!0;var u=o?o():"";le("Failed "+n+" type: "+r.message+(null!=u?u:""))}}}ae.resetWarningCache=function(){"production"!==process.env.NODE_ENV&&(ie={})};var ue=ae,de=function(){};function se(){return null}function ce(){}function pe(){}"production"!==process.env.NODE_ENV&&(de=function(e){var t="Warning: "+e;"undefined"!=typeof console&&console.error(t);try{throw new Error(t)}catch(e){}}),pe.resetWarningCache=ce;var ve=s(function(e){e.exports="production"!==process.env.NODE_ENV?function(e,t){var n="function"==typeof Symbol&&Symbol.iterator,l={array:a("array"),bigint:a("bigint"),bool:a("boolean"),func:a("function"),number:a("number"),object:a("object"),string:a("string"),symbol:a("symbol"),any:r(se),arrayOf:function(e){return r(function(t,n,l,o,r){if("function"!=typeof e)return new i("Property `"+r+"` of component `"+l+"` has invalid PropType notation inside arrayOf.");var a=t[n];if(!Array.isArray(a))return new i("Invalid "+o+" `"+r+"` of type `"+s(a)+"` supplied to `"+l+"`, expected an array.");for(var u=0;u<a.length;u++){var d=e(a,u,l,o,r+"["+u+"]",te);if(d instanceof Error)return d}return null})},element:r(function(t,n,l,o,r){var a=t[n];return e(a)?null:new i("Invalid "+o+" `"+r+"` of type `"+s(a)+"` supplied to `"+l+"`, expected a single ReactElement.")}),elementType:r(function(e,t,n,l,o){var r=e[t];return G.isValidElementType(r)?null:new i("Invalid "+l+" `"+o+"` of type `"+s(r)+"` supplied to `"+n+"`, expected a single ReactElement type.")}),instanceOf:function(e){return r(function(t,n,l,o,r){var a;return t[n]instanceof e?null:new i("Invalid "+o+" `"+r+"` of type `"+((a=t[n]).constructor&&a.constructor.name?a.constructor.name:"<<anonymous>>")+"` supplied to `"+l+"`, expected instance of `"+(e.name||"<<anonymous>>")+"`.")})},node:r(function(e,t,n,l,o){return d(e[t])?null:new i("Invalid "+l+" `"+o+"` supplied to `"+n+"`, expected a ReactNode.")}),objectOf:function(e){return r(function(t,n,l,o,r){if("function"!=typeof e)return new i("Property `"+r+"` of component `"+l+"` has invalid PropType notation inside objectOf.");var a=t[n],u=s(a);if("object"!==u)return new i("Invalid "+o+" `"+r+"` of type `"+u+"` supplied to `"+l+"`, expected an object.");for(var d in a)if(ne(a,d)){var c=e(a,d,l,o,r+"."+d,te);if(c instanceof Error)return c}return null})},oneOf:function(e){if(!Array.isArray(e))return"production"!==process.env.NODE_ENV&&de(arguments.length>1?"Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).":"Invalid argument supplied to oneOf, expected an array."),se;function t(t,n,l,r,a){for(var u=t[n],d=0;d<e.length;d++)if(o(u,e[d]))return null;var s=JSON.stringify(e,function(e,t){return"symbol"===c(t)?String(t):t});return new i("Invalid "+r+" `"+a+"` of value `"+String(u)+"` supplied to `"+l+"`, expected one of "+s+".")}return r(t)},oneOfType:function(e){if(!Array.isArray(e))return"production"!==process.env.NODE_ENV&&de("Invalid argument supplied to oneOfType, expected an instance of array."),se;for(var t=0;t<e.length;t++){var n=e[t];if("function"!=typeof n)return de("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+p(n)+" at index "+t+"."),se}return r(function(t,n,l,o,r){for(var a=[],u=0;u<e.length;u++){var d=(0,e[u])(t,n,l,o,r,te);if(null==d)return null;d.data&&ne(d.data,"expectedType")&&a.push(d.data.expectedType)}return new i("Invalid "+o+" `"+r+"` supplied to `"+l+"`"+(a.length>0?", expected one of type ["+a.join(", ")+"]":"")+".")})},shape:function(e){return r(function(t,n,l,o,r){var a=t[n],d=s(a);if("object"!==d)return new i("Invalid "+o+" `"+r+"` of type `"+d+"` supplied to `"+l+"`, expected `object`.");for(var p in e){var v=e[p];if("function"!=typeof v)return u(l,o,r,p,c(v));var m=v(a,p,l,o,r+"."+p,te);if(m)return m}return null})},exact:function(e){return r(function(t,n,l,o,r){var a=t[n],d=s(a);if("object"!==d)return new i("Invalid "+o+" `"+r+"` of type `"+d+"` supplied to `"+l+"`, expected `object`.");var p=ee({},t[n],e);for(var v in p){var m=e[v];if(ne(e,v)&&"function"!=typeof m)return u(l,o,r,v,c(m));if(!m)return new i("Invalid "+o+" `"+r+"` key `"+v+"` supplied to `"+l+"`.\nBad object: "+JSON.stringify(t[n],null," ")+"\nValid keys: "+JSON.stringify(Object.keys(e),null," "));var f=m(a,v,l,o,r+"."+v,te);if(f)return f}return null})}};function o(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}function i(e,t){this.message=e,this.data=t&&"object"==typeof t?t:{},this.stack=""}function r(e){function t(t,n,l,o,r,a,u){if(o=o||"<<anonymous>>",a=a||l,u!==te){var d=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw d.name="Invariant Violation",d}return null==n[l]?t?new i(null===n[l]?"The "+r+" `"+a+"` is marked as required in `"+o+"`, but its value is `null`.":"The "+r+" `"+a+"` is marked as required in `"+o+"`, but its value is `undefined`."):null:e(n,l,o,r,a)}process;var n=t.bind(null,!1);return n.isRequired=t.bind(null,!0),n}function a(e){return r(function(t,n,l,o,r,a){var u=t[n];return s(u)!==e?new i("Invalid "+o+" `"+r+"` of type `"+c(u)+"` supplied to `"+l+"`, expected `"+e+"`.",{expectedType:e}):null})}function u(e,t,n,l,o){return new i((e||"React class")+": "+t+" type `"+n+"."+l+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+o+"`.")}function d(t){switch(typeof t){case"number":case"string":case"undefined":return!0;case"boolean":return!t;case"object":if(Array.isArray(t))return t.every(d);if(null===t||e(t))return!0;var l=function(e){var t=e&&(n&&e[n]||e["@@iterator"]);if("function"==typeof t)return t}(t);if(!l)return!1;var o,i=l.call(t);if(l!==t.entries){for(;!(o=i.next()).done;)if(!d(o.value))return!1}else for(;!(o=i.next()).done;){var r=o.value;if(r&&!d(r[1]))return!1}return!0;default:return!1}}function s(e){var t=typeof e;return Array.isArray(e)?"array":e instanceof RegExp?"object":function(e,t){return"symbol"===e||!!t&&("Symbol"===t["@@toStringTag"]||"function"==typeof Symbol&&t instanceof Symbol)}(t,e)?"symbol":t}function c(e){if(null==e)return""+e;var t=s(e);if("object"===t){if(e instanceof Date)return"date";if(e instanceof RegExp)return"regexp"}return t}function p(e){var t=c(e);switch(t){case"array":case"object":return"an "+t;case"boolean":case"date":case"regexp":return"a "+t;default:return t}}return i.prototype=Error.prototype,l.checkPropTypes=ue,l.resetWarningCache=ue.resetWarningCache,l.PropTypes=l,l}(G.isElement):function(){function e(e,t,n,l,o,i){if(i!==te){var r=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw r.name="Invariant Violation",r}}function t(){return e}e.isRequired=e;var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:pe,resetWarningCache:ce};return n.PropTypes=n,n}()});const me={description:"PT_SEARCH_OR_DESC",descriptionStyles:{fontWeight:"300",color:"#505A5F",marginTop:"0px",textAlign:"center",marginBottom:"20px",maxWidth:"540px"}},fe=e=>{var r,a,u,d,s,p,v;let{config:m,onSelect:f,redirectToUrl:E}=e;const{t:y}=o.useTranslation(),_=i.useHistory(),{action:g=0}=Digit.Hooks.useQueryParams(),[h,S]=n.useState({}),[b,T]=n.useState(null);sessionStorage.setItem("VisitedCommonPTSearch",!0),sessionStorage.setItem("VisitedLightCreate",!1);let C=null===(r=Digit.Hooks.pt.useTenants())||void 0===r?void 0:r.sort((e,t)=>{var n,l;return null==e||null===(n=e.i18nKey)||void 0===n||null===(l=n.localeCompare)||void 0===l?void 0:l.call(n,null==t?void 0:t.i18nKey)});C=C||(null===(a=Digit.Hooks.tl.useTenants())||void 0===a?void 0:a.sort((e,t)=>{var n,l;return null==e||null===(n=e.i18nKey)||void 0===n||null===(l=n.localeCompare)||void 0===l?void 0:l.call(n,null==t?void 0:t.i18nKey)})),window.location.href.includes("obps")?C=Digit.SessionStorage.get("OBPS_TENANTS"):window.location.href.includes("fsm")&&(C=[{i18nKey:"TENANT_TENANTS_PG_CITYA",code:Digit.ULBService.getCurrentTenantId(),name:"City A",description:"City A",pincode:[143001,143002,143003,143004,143005],logoId:"https://in-egov-assets.s3.ap-south-1.amazonaws.com/in.citya/logo.png",imageId:null,domainUrl:"https://www.upyog.niua.org",type:"CITY",twitterUrl:null,facebookUrl:null,emailId:"citya@gmail.com",OfficeTimings:{"Mon - Fri":"9.00 AM - 6.00 PM"},city:{name:"City A",localName:null,districtCode:"CITYA",districtName:null,districtTenantCode:Digit.ULBService.getCurrentTenantId(),regionName:null,ulbGrade:"Municipal Corporation",longitude:75.5761829,latitude:31.3260152,shapeFileLocation:null,captcha:null,code:"1013",ddrName:"DDR A"},address:"City A Municipal Corporation",contactNumber:"001-2345876"},{i18nKey:"TENANT_TENANTS_PG_CITYB",code:"pg.cityb",name:"City B",description:null,pincode:[143006,143007,143008,143009,143010],logoId:"https://in-egov-assets.s3.ap-south-1.amazonaws.com/in.citya/logo.png",imageId:null,domainUrl:"https://www.upyog.niua.org",type:"CITY",twitterUrl:null,facebookUrl:null,emailId:"cityb@gmail.com",OfficeTimings:{"Mon - Fri":"9.00 AM - 6.00 PM",Sat:"9.00 AM - 12.00 PM"},city:{name:"City B",localName:null,districtCode:"CITYB",districtName:null,districtTenantCode:"pg.cityb",regionName:null,ulbGrade:"Municipal Corporation",longitude:74.8722642,latitude:31.6339793,shapeFileLocation:null,captcha:null,code:"107",ddrName:"DDR B"},address:"City B Municipal Corporation Address",contactNumber:"0978-7645345",helpLineNumber:"0654-8734567"},{i18nKey:"TENANT_TENANTS_PG_CITYC",code:"pg.cityc",name:"City C",description:null,logoId:"https://in-egov-assets.s3.ap-south-1.amazonaws.com/in.citya/logo.png",imageId:null,domainUrl:"https://www.upyog.niua.org",type:"CITY",twitterUrl:null,facebookUrl:null,emailId:"cityc@gmail.com",OfficeTimings:{"Mon - Fri":"9.00 AM - 6.00 PM",Sat:"9.00 AM - 12.00 PM"},city:{name:"City C",localName:null,districtCode:"CITYC",districtName:null,districtTenantCode:"pg.cityc",regionName:null,ulbGrade:"Municipal Corporation",longitude:73.8722642,latitude:31.6339793,shapeFileLocation:null,captcha:null,code:"108",ddrName:"DDR C"},address:"City C Municipal Corporation Address",contactNumber:"0978-7645345",helpLineNumber:"0654-8734567"}]),console.log("allCities",C);const[D,N]=n.useState(),[I,O]=n.useState(),[P,w]=n.useState(!1);let R=window.Digit.Utils.browser.isMobile();const{data:L,isLoading:x,error:M}=Digit.Hooks.pt.usePropertySearchWithDue({tenantId:null==h?void 0:h.city,filters:null==h?void 0:h.filters,auth:!1,configs:{enabled:Object.keys(h).length>0,retry:!1,retryOnMount:!1,staleTime:Infinity}});n.useEffect(()=>{var e,t,n;(null==h||null===(e=h.filters)||void 0===e||!e.mobileNumber||1!=(null===(t=Object.values(null==h?void 0:h.filters))||void 0===t||null===(n=t.filter(e=>void 0!==e))||void 0===n?void 0:n.length))&&(null==L?void 0:L.Properties.length)>0&&null!=F&&F.maxResultValidation&&(null==L?void 0:L.Properties.length)>(null==F?void 0:F.maxPropertyResult)&&!P&&T({error:!0,warning:!0,label:"ERR_PLEASE_REFINED_UR_SEARCH"})},[L]),n.useEffect(()=>{b&&"ERR_PLEASE_REFINED_UR_SEARCH"!==(null==b?void 0:b.label)&&"NO_PROPERTIES_FOUND"!==(null==b?void 0:b.label)&&T(null)},[g,x]),n.useEffect(()=>{var e;!x&&L&&h&&(null==L||null===(e=L.Properties)||void 0===e?void 0:e.length)<=0&&T({error:!0,warning:!0,label:"NO_PROPERTIES_FOUND"})},[null==L||null===(u=L.Properties)||void 0===u||null===(d=u[0])||void 0===d?void 0:d.propertyId,x]),n.useLayoutEffect(()=>{const e=()=>{let t=document.querySelector("div.action-bar-wrap");t?(t.style.position="static",t.style.padding="8px 0",t.style.boxShadow="none",t.style.marginBottom="16px",t.style.textAlign="left",t.style.zIndex="0"):setTimeout(()=>{e()},100)};e()},[]);const{data:F,isLoading:k}=Digit.Hooks.pt.useMDMS(Digit.ULBService.getStateId(),"DIGIT-UI","HelpText",{select:e=>{var t,n,l;return null==e||null===(t=e["DIGIT-UI"])||void 0===t||null===(n=t.HelpText)||void 0===n||null===(l=n[0])||void 0===l?void 0:l.PT}}),[U,B,j,H,W]=m.inputs,V=[{body:[{type:"custom",populators:{name:"addParam",defaultValue:{code:0,name:y("PT_KNOW_PTID")},customProps:{t:y,isMandatory:!0,optionsKey:"name",options:[{code:0,name:y("PT_KNOW_PTID")},{code:1,name:y("PT_SEARCH_DOOR_NO")}]},component:(e,n)=>l.createElement(t.RadioButtons,A({},n,{selectedOption:e.value,onSelect:t=>{null==e||e.setValue("city",{}),null==e||e.setValue("locality",{}),null==e||e.setValue("mobileNumber",""),null==e||e.setValue("propertyIds",""),null==e||e.setValue("doorNumber",""),null==e||e.setValue("oldPropertyId",""),null==e||e.setValue("name",""),_.replace(`${_.location.pathname}?action=${0==g?1:0}`)}}))}},{label:"PT_SELECT_CITY",isMandatory:!0,type:"custom",populators:{name:"city",defaultValue:null,rules:{required:!0},customProps:{t:y,isMandatory:!0,option:[...C],optionKey:"i18nKey"},component:(e,n)=>l.createElement(t.Dropdown,A({},n,{selected:e.value,select:t=>{Digit.ULBService.getCurrentTenantId(),t.code!==D&&e.setValue("locality",null),e.onChange(t)}}))}},{label:y("PT_PROVIDE_ONE_MORE_PARAM"),isInsideBox:!0,placementinbox:0,isSectionText:!0},{label:U.label,type:U.type,populators:{defaultValue:"",name:U.name,validation:null==U?void 0:U.validation},...me,isMandatory:!1,isInsideBox:!0,placementinbox:1},{label:"",labelChildren:l.createElement("div",{className:"tooltip"},l.createElement("div",{style:{display:"flex",gap:"0 4px"}},l.createElement("h2",null,y(B.label)),l.createElement(t.InfoBannerIcon,{fill:"#0b0c0c"}),l.createElement("span",{className:"tooltiptext",style:{position:"absolute",width:"72%",marginLeft:"50%",fontSize:"medium"}},y(B.description)+" PG-PT-xxxx-xxxxxx"))),type:B.type,populators:{name:B.name,defaultValue:"",validation:null==B?void 0:B.validation},...me,isMandatory:!1,isInsideBox:!0,placementinbox:1},{label:j.label,type:j.type,populators:{name:j.name,defaultValue:"",validation:null==j?void 0:j.validation},isMandatory:!1,isInsideBox:!0,placementinbox:2}],body1:[{type:"custom",populators:{name:"addParam1",defaultValue:{code:1,name:y("PT_SEARCH_DOOR_NO")},customProps:{t:y,isMandatory:!0,optionsKey:"name",options:[{code:0,name:y("PT_KNOW_PTID")},{code:1,name:y("PT_SEARCH_DOOR_NO")}]},component:(e,n)=>l.createElement(t.RadioButtons,A({},n,{selectedOption:e.value,onSelect:t=>{null==e||e.setValue("city",{}),null==e||e.setValue("locality",{}),null==e||e.setValue("mobileNumber",""),null==e||e.setValue("propertyIds",""),null==e||e.setValue("doorNumber",""),null==e||e.setValue("oldPropertyId",""),null==e||e.setValue("name",""),_.replace(`${_.location.pathname}?action=${0==g?1:0}`)}}))}},{label:"PT_SELECT_CITY",isMandatory:!0,type:"custom",populators:{name:"city",defaultValue:null,rules:{required:!0},customProps:{t:y,isMandatory:!0,option:[...C],optionKey:"i18nKey"},component:(e,n)=>l.createElement(t.Dropdown,A({},n,{selected:e.value,select:t=>{var n,l;Digit.LocalizationService.getLocale({modules:["rainmaker-"+(null==e||null===(n=e.value)||void 0===n?void 0:n.code)],locale:Digit.StoreData.getCurrentLanguage(),tenantId:""+(null==e||null===(l=e.value)||void 0===l?void 0:l.code)}),t.code!==D&&e.setValue("locality",null),e.onChange(t)}}))}},{label:"PT_SELECT_LOCALITY",type:"custom",isMandatory:!0,populators:{name:"locality",defaultValue:"",rules:{required:!0},customProps:{},component:(e,n)=>l.createElement(t.Localities,{selectLocality:t=>{e.onChange(t)},tenantId:D,boundaryType:"revenue",keepNull:!1,optionCardStyles:{height:"600px",overflow:"auto",zIndex:"10",maxHeight:"300px"},selected:null==I?void 0:I.locality,disable:!D,disableLoader:!0})}},{label:y("PT_PROVIDE_ONE_MORE_PARAM"),isInsideBox:!0,placementinbox:0,isSectionText:!0},{label:W.label,type:W.type,populators:{defaultValue:"",name:W.name,validation:null==W?void 0:W.validation},isMandatory:!1,isInsideBox:!0,placementinbox:1},{label:H.label,type:H.type,populators:{defaultValue:"",name:H.name,validation:null==H?void 0:H.validation},isMandatory:!1,isInsideBox:!0,placementinbox:2}]}];if(k)return l.createElement(t.Loader,null);let z=!(null!=F&&F.maxResultValidation&&(null==h||null===(s=h.filters)||void 0===s||!s.mobileNumber||1!=(null===(p=Object.values(null==h?void 0:h.filters))||void 0===p||null===(v=p.filter(e=>void 0!==e))||void 0===v?void 0:v.length)))||(null==L?void 0:L.Properties.length)<(null==F?void 0:F.maxPropertyResult)&&(null==b||null!==b&&!(null!=b&&b.error));if(L&&!x&&!M&&z){var $,Y,K,q,G;let e={};if(e={...h.filters,city:h.city},(null==h||null===($=h.filters)||void 0===$||!$.mobileNumber||1!=(null===(Y=Object.values(null==h?void 0:h.filters))||void 0===Y||null===(K=Y.filter(e=>void 0!==e))||void 0===K?void 0:K.length))&&null!=F&&F.ptSearchCount&&null!=h&&null!==(q=h.filters)&&void 0!==q&&q.locality&&x&&null!=x&&null!==(G=x.Properties)&&void 0!==G&&G.length&&x.Properties.length>(null==F?void 0:F.ptSearchCount))!b&&T({error:!0,label:"PT_MODIFY_SEARCH_CRITERIA"});else if("MUTATION"===m.action)f(m.key,e,null,null,null,{queryParams:{...e}});else if(E||window.location.href.includes("digit-ui/citizen/commonpt/property/citizen-search"))_.push(`/digit-ui/citizen/commonPt/property/search-results?${Object.keys(e).map(t=>`${t}=${e[t]}`).join("&")}${E?"&redirectToUrl="+E:""}`);else{var Z,X,J,Q,ee,te,ne,le,oe,ie;let t={};t=0==g?{city:null===(Z=e)||void 0===Z?void 0:Z.city,mobileNumber:(null===(X=e)||void 0===X?void 0:X.mobileNumber)||"",propertyIds:(null===(J=e)||void 0===J?void 0:J.propertyIds)||"",oldPropertyIds:(null===(Q=e)||void 0===Q?void 0:Q.oldPropertyIds)||"",locality:"",doorNo:"",name:""}:{city:null===(ee=e)||void 0===ee?void 0:ee.city,locality:(null===(te=e)||void 0===te?void 0:te.locality)||"",doorNo:(null===(ne=e)||void 0===ne?void 0:ne.doorNumber)||(null===(le=e)||void 0===le?void 0:le.doorNo)||"",name:(null===(oe=e)||void 0===oe?void 0:oe.name)||"",mobileNumber:"",propertyIds:"",oldPropertyIds:""},!x&&(null==L||null===(ie=L.Properties)||void 0===ie?void 0:ie.length)>0&&f("cptSearchQuery",t,null,null,null,{queryParams:{...t}})}}var re,ae,ue,de;return M&&!b&&T({error:!0,label:(null==M||null===(re=M.response)||void 0===re||null===(ae=re.data)||void 0===ae||null===(ue=ae.Errors)||void 0===ue||null===(de=ue[0])||void 0===de?void 0:de.code)||M}),1==g&&(V[0].body=[...V[0].body1]),l.createElement("div",{style:{marginTop:"16px",marginBottom:"16px",backgroundColor:"white",maxWidth:"960px"}},l.createElement(t.FormComposer,{onSubmit:function(e){try{var t,n;if(null!=F&&F.maxResultValidation&&(null==L?void 0:L.Properties.length)>0&&(null==L?void 0:L.Properties.length)>(null==F?void 0:F.maxPropertyResult)&&P)return w(!0),Promise.resolve();if(null==e||null===(t=e.city)||void 0===t||!t.code)return T({error:!0,label:"ERR_PT_FILL_VALID_FIELDS"}),Promise.resolve();if(0==g){var l,o,i,r,a,u,d,s,c,p,v,m,f,E,y;if(!(null!=e&&e.mobileNumber||null!=e&&e.propertyIds||null!=e&&e.oldPropertyId))return T({error:!0,label:"ERR_PT_FILL_VALID_FIELDS"}),Promise.resolve();if(null!=e&&e.mobileNumber&&(null===(l=e.mobileNumber)||void 0===l||!l.match(null==U||null===(o=U.validation)||void 0===o||null===(i=o.pattern)||void 0===i?void 0:i.value)))return T({error:!0,label:null==U||null===(p=U.validation)||void 0===p||null===(v=p.pattern)||void 0===v?void 0:v.message}),Promise.resolve();if(null!=e&&e.propertyIds&&(null===(r=e.propertyIds)||void 0===r||!r.match(null==B||null===(a=B.validation)||void 0===a||null===(u=a.pattern)||void 0===u?void 0:u.value)))return T({error:!0,label:null==B||null===(m=B.validation)||void 0===m||null===(f=m.pattern)||void 0===f?void 0:f.message}),Promise.resolve();if(null!=e&&e.oldPropertyId&&(null===(d=e.oldPropertyId)||void 0===d||!d.match(null==j||null===(s=j.validation)||void 0===s||null===(c=s.pattern)||void 0===c?void 0:c.value)))return T({error:!0,label:null==j||null===(E=j.validation)||void 0===E||null===(y=E.pattern)||void 0===y?void 0:y.message}),Promise.resolve()}else{var _,h,C,A,D,N,I,O,R,x,M;if(null==e||null===(_=e.locality)||void 0===_||!_.code)return T({error:!0,label:"ERR_PT_FILL_VALID_FIELDS"}),Promise.resolve();if(!(null!=e&&e.doorNumber||null!=e&&e.name))return T({error:!0,label:"ERR_PT_FILL_VALID_FIELDS"}),Promise.resolve();if(null!=e&&e.name&&(null===(h=e.name)||void 0===h||!h.match(null==H||null===(C=H.validation)||void 0===C||null===(A=C.pattern)||void 0===A?void 0:A.value)))return T({error:!0,label:null==H||null===(O=H.validation)||void 0===O||null===(R=O.pattern)||void 0===R?void 0:R.message}),Promise.resolve();if(null!=e&&e.doorNumber&&(null===(D=e.doorNumber)||void 0===D||!D.match(null==W||null===(N=W.validation)||void 0===N||null===(I=N.pattern)||void 0===I?void 0:I.value)))return T({error:!0,label:null==W||null===(x=W.validation)||void 0===x||null===(M=x.pattern)||void 0===M?void 0:M.message}),Promise.resolve()}"ERR_PLEASE_REFINED_UR_SEARCH"===(null==b?void 0:b.label)&&"NO_PROPERTIES_FOUND"===(null==b?void 0:b.label)||T(null),null!=e&&e.doorNumber&&""!==(null==e?void 0:e.doorNumber)&&""!==(null==e?void 0:e.propertyIds)&&(e.propertyIds="");let G=Object.keys(e).filter(t=>e[t]).reduce((t,n)=>({...t,[n]:"object"==typeof e[n]?e[n].code:e[n]}),{}),Z=G.city;var k,V,z;if(G.doorNo=G.doorNumber||(null===(n=G)||void 0===n?void 0:n.doorNo),delete G.addParam,delete G.addParam1,delete G.city,"0"===g)G={oldPropertyId:null===(k=G)||void 0===k?void 0:k.oldPropertyId,mobileNumber:null===(V=G)||void 0===V?void 0:V.mobileNumber,propertyIds:null===(z=G)||void 0===z?void 0:z.propertyIds};else if("1"===g){var $,Y,K,q;G={name:null===($=G)||void 0===$?void 0:$.name,doorNo:(null===(Y=G)||void 0===Y?void 0:Y.doorNumber)||(null===(K=G)||void 0===K?void 0:K.doorNo),locality:null===(q=G)||void 0===q?void 0:q.locality}}return S({city:Z,filters:G}),Promise.resolve()}catch(e){return Promise.reject(e)}},noBoxShadow:!0,inline:!0,config:V,label:m.texts.submitButtonLabel,heading:y(m.texts.header),text:y(m.texts.text),headingStyle:{fontSize:"32px",marginBottom:"16px",fontFamily:"Roboto Condensed,sans-serif"},onFormValueChange:(e,t,n)=>{const l=(null==t?void 0:t.city)||C[0];console.log("citycity",l),N(l.code),(null==l?void 0:l.code)!==D&&N(null==l?void 0:l.code),c.isEqual(t,I)||O(t)},cardStyle:{marginBottom:"0",maxWidth:"960px"}}),l.createElement("div",{style:{display:"flex"}},window.location.href.includes("/obps/bpa/")?l.createElement("span",{className:"link",style:R?{display:"flex",justifyContent:"center",paddingBottom:"16px"}:{display:"flex",justifyContent:"left",paddingBottom:"16px",marginLeft:"45px"}},l.createElement(i.Link,{to:"/digit-ui/citizen/obps/bpa/building_plan_scrutiny/new_construction/location"},y("CORE_COMMON_SKIP_CONTINUE"))):l.createElement("span",{className:"link",style:R?{display:"flex",justifyContent:"center",paddingBottom:"16px"}:{display:"flex",justifyContent:"left",paddingBottom:"16px",marginLeft:"45px"}},l.createElement(i.Link,{to:window.location.href.includes("/ws/")?"/digit-ui/citizen/ws/create-application/create-property":window.location.href.includes("/tl/tradelicence/")?"/digit-ui/citizen/tl/tradelicence/new-application/create-property":window.location.href.includes("/fsm/")?"/digit-ui/citizen/fsm/new-application/create-property":"/digit-ui/citizen/commonpt/property/new-application"},y("CPT_REG_NEW_PROPERTY")))),b&&l.createElement(t.Toast,{isDleteBtn:!0,error:b.error,warning:b.warning,label:y(b.label),onClose:()=>{T(null)}}))};fe.propTypes={loginParams:ve.any},fe.defaultProps={loginParams:null};const Ee=e=>{let{onSelect:t}=e;const{t:r}=o.useTranslation(),{path:a}=i.useRouteMatch(),u=i.useLocation().search,d=new URLSearchParams(u).get("redirectToUrl"),s=n.useMemo(()=>C.map(e=>{const t={};for(const n in e.texts)t[n]=r(e.texts[n]);return{...e,texts:t}},[C]));return l.createElement(i.Switch,null,l.createElement(i.Route,{path:""+a,exact:!0},l.createElement(fe,{config:s[0],onSelect:t,redirectToUrl:d})))},ye=[{texts:{header:"CS_SEARCH_RESULTS",actionButtonLabel:"PT_COMMONS_SELECT_PLACEHOLDER"},labels:[{label:"PT_DUES_ARE_PENDING",key:"total_due",noteStyle:{fontSize:"24px",fontWeight:"bold"},notePrefix:"₹ "},{label:"TL_PROPERTY_ID",key:"property_id"},{label:"PT_OWNERS_NAME",key:"owner_name"},{label:"PT_COMMON_COL_ADDRESS",key:"property_address"},{label:"PT_COMMON_TABLE_COL_STATUS_LABEL",key:"status"}]}];function _e(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 ge={type:"login"},he=e=>{var r,a,u,d,s,p,v;let{template:m,header:f,actionButtonLabel:E,onSelect:y,clearParams:_=(()=>{}),stateCode:g,redirectToUrl:h,searchQuery:S}=e;const{t:b}=o.useTranslation(),T=n.useRef(),{mobileNumber:C,propertyIds:A,oldPropertyIds:D,locality:N,city:I,tenantId:O,doorNo:P,name:w,PToffset:R}=Digit.Hooks.useQueryParams(),L={},[x,M]=n.useState(!1),F=Digit.ComponentRegistryService.getComponent("WSInfoLabel");let k,U,B=R;isNaN(parseInt(B))?k=5:(U=B,k=parseInt(B)+5);let j=isNaN(parseInt(B))?{limit:"5",sortOrder:"ASC",sortBy:"createdTime",offset:"0"}:{limit:"5",sortOrder:"ASC",sortBy:"createdTime",offset:U};Digit.Hooks.useClickOutside(T,()=>{M(!1)},x);const H=(null==S?void 0:S.mobileNumber)||(null==S?void 0:S.mobileNo),W=(null==S?void 0:S.propertyIds)||(null==S?void 0:S.propertyId),V=(null==S?void 0:S.oldPropertyIds)||(null==S?void 0:S.oldPropertyId);(C||H)&&(L.mobileNumber=C||H),(A||W)&&(L.propertyIds=A||W),(D||V)&&(L.oldPropertyIds=D||V),(N||S&&S.locality)&&(L.locality=N||(null==S?void 0:S.locality)),(P||S&&S.doorNo)&&(L.doorNo=P||(null==S?void 0:S.doorNo)),(w||S&&S.name)&&(L.name=w||(null==S?void 0:S.name)),L.limit=j.limit,L.sortOrder=j.sortOrder,L.sortBy=j.sortBy,L.offset=j.offset,L.status||(L.status="ACTIVE,INWORKFLOW");const[z,$,Y]=Digit.Hooks.useSessionStorage("PT_MUTATE_MULTIPLE_OWNERS",null),[K,q,G]=Digit.Hooks.useSessionStorage("PT_MUTATE_MULTIPLE_OWNERS_LAST_PATH",null),Z=(i.useRouteMatch(),Digit.Hooks.useQueryParams());n.useEffect(()=>{$([]),_(),q("")},[]);const X=Digit.ULBService.getCurrentTenantId(),J=I||O||(null==S?void 0:S.city)||X,Q=Digit.Hooks.pt.usePropertySearch(J?{tenantId:J,filters:L,auth:!1}:{filters:L,auth:!1},{privacy:Digit.Utils.getPrivacyObject()}),ee=(null==Q||null===(r=Q.data)||void 0===r?void 0:r.Properties)||(null==Q||null===(a=Q.data)||void 0===a?void 0:a.properties)||(Array.isArray(null==Q?void 0:Q.data)?null==Q?void 0:Q.data:[]),te=null==ee||null===(u=ee.map)||void 0===u?void 0:u.call(ee,e=>e.propertyId||e.id).filter(e=>e).join(",");!Q.isSuccess||ee&&0!==ee.length||console.warn("Property Search: No properties found in result.data",Q.data);const ne=Digit.Hooks.useFetchBillsForBuissnessService({businessService:"PT",...C?{mobileNumber:C,consumerCode:te}:{consumerCode:te},tenantId:J},{enabled:!(!te||!J),retry:!1}),le=i.useHistory();if(ne.isLoading||Q.isLoading)return l.createElement(t.Loader,null);if(Q.error||Q.isSuccess&&(!ee||0===ee.length))return l.createElement("div",{style:{height:"150px"}},l.createElement(t.Card,{style:{display:"flex",justifyContent:"center",alignItems:"center",height:"100%"}},b("CS_PT_NO_PROPERTIES_FOUND")));const oe={};null==ne||null===(d=ne.data)||void 0===d||null===(s=d.Bill)||void 0===s||s.forEach(e=>{null!=e&&e.consumerCode&&(oe[null==e?void 0:e.consumerCode]={total_due:null==e?void 0:e.totalAmount,bil_due__date:new Date(null==e?void 0:e.billDate).toDateString()})});const ie=null===(p=ee||[])||void 0===p?void 0:p.map(e=>{var t,n,l,o,i,r,a,u,d,s,p;let v=(null==e?void 0:e.address)||{};return{property_id:null==e?void 0:e.propertyId,owner_name:null===(t=((null==e?void 0:e.owners)||[]).sort((e,t)=>{var n,l;return((null==e||null===(n=e.additionalDetails)||void 0===n?void 0:n.ownerSequence)||0)-((null==t||null===(l=t.additionalDetails)||void 0===l?void 0:l.ownerSequence)||0)}))||void 0===t||null===(n=t[0])||void 0===n?void 0:n.name,property_address:[v.doorNo||"",v.buildingName||"",v.street||"",b("TENANTS_MOHALLA_"+(null===(l=v.locality)||void 0===l?void 0:l.code))!=="TENANTS_MOHALLA_"+(null===(o=v.locality)||void 0===o?void 0:o.code)?b("TENANTS_MOHALLA_"+(null===(i=v.locality)||void 0===i?void 0:i.code)):(null===(r=v.locality)||void 0===r?void 0:r.name)||"",b(v.tenantId)||""].filter(e=>e).join(", "),total_due:(null===(a=oe[null==e?void 0:e.propertyId])||void 0===a?void 0:a.total_due)||0,bil_due__date:(null===(u=oe[null==e?void 0:e.propertyId])||void 0===u?void 0:u.bil_due__date)||b("N/A"),status:b(e.status),owner_mobile:null===(d=((null==e?void 0:e.owners)||[])[0])||void 0===d?void 0:d.mobileNumber,address:null==e?void 0:e.address,owners:e.owners,propertyDetails:e,privacy:{property_address:{uuid:null==e||null===(s=e.owners)||void 0===s||null===(p=s[0])||void 0===p?void 0:p.uuid,fieldName:["doorNo","street","landmark"],model:"Property",showValue:!0,loadData:{serviceName:"/property-services/property/_search",requestBody:{},requestParam:{tenantId:null==e?void 0:e.tenantId,propertyIds:null==e?void 0:e.propertyId},jsonPath:"Properties[0].address.street",isArray:!1,d:e=>(c.get(e,"Properties[0].address.doorNo")?c.get(e,"Properties[0].address.doorNo")+", ":"")+(c.get(e,"Properties[0].address.street")?c.get(e,"Properties[0].address.street")+", ":"")+(c.get(e,"Properties[0].address.landmark")?""+c.get(e,"Properties[0].address.landmark"):"")}}}}}),re=(e,t)=>(null==e?void 0:e.from)||(null==t?void 0:t.from)||"/digit-ui/citizen";return l.createElement("div",{className:"static",style:{marginTop:"16px"}},l.createElement("div",{className:"static-wrapper"},f&&l.createElement(t.Header,{style:{marginLeft:"8px"}},b(f)," (",null==ie?void 0:ie.length,")"),F&&l.createElement(F,{t:b}),l.createElement(t.ResponseComposer,{data:ie,template:m,actionButtonLabel:E,onSubmit:function(e){try{return sessionStorage.setItem("Digit_OBPS_PT",JSON.stringify(e)),sessionStorage.setItem("Digit_FSM_PT",JSON.stringify(e)),Promise.resolve(function(){if(!y){const t={mobileNumber:null==e?void 0:e.owner_mobile,tenantId:g,userType:Digit.UserService.getType()};return Promise.resolve(function(e){return Promise.resolve(_e(function(){return Promise.resolve(Digit.UserService.sendOtp(e,g)).then(function(e){return[e,null]})},function(e){return[null,e]}))}({otp:{...t,...ge}})).then(function(n){let[l,o]=n;if(o)le.push("/digit-ui/citizen/",{from:re(location.state,Z),data:t});else{let t="/digit-ui/citizen/commonPt/property/link-success/"+e.property_id;h&&(t=h+"?propertyId="+e.property_id+"&tenantId="+X),le.replace("/digit-ui/citizen/commonPt/property/citizen-otp",{from:re(location.state,Z),mobileNumber:e.owner_mobile,redirectBackTo:t})}})}y("cptId",{id:e.property_id})}())}catch(e){return Promise.reject(e)}}})),x?l.createElement(t.Modal,{hideSubmit:!0,isDisabled:!1,popupStyles:{width:"319px",height:"250px",margin:"auto"},formId:"modal-action"},l.createElement("div",{ref:T},l.createElement(t.KeyNote,{keyValue:b("PT_AMOUNT_DUE"),note:"₹ "+(null==x||null===(v=x.total_due)||void 0===v?void 0:v.toLocaleString("en-IN")),noteStyle:{fontSize:"24px",fontWeight:"bold"}}),l.createElement("p",null,b("PT_YOU_HAVE")+" ₹ "+(null==x?void 0:x.total_due.toLocaleString("en-IN"))+" "+b("PT_PENDING_AMOUNT")+" "+b("PT_INORDER_TO_TRANSFER")),l.createElement(t.SubmitBar,{submit:!1,onSubmit:()=>{le.push("/digit-ui/citizen/payment/my-bills/PT/"+x.property_id,{tenantId:X})},style:{marginTop:"14px",width:"100%"},label:b("PT_PROCEED_PAYMENT")}))):null,0===(null==ie?void 0:ie.length)&&l.createElement("p",{style:{marginLeft:"16px",marginTop:"16px"}},b("PT_NO_PROP_FOUND_MSG")),0!==(null==ie?void 0:ie.length)&&(5==(null==ie?void 0:ie.length)||50==(null==ie?void 0:ie.length))&&(N||S&&S.locality)&&l.createElement("div",null,l.createElement("p",{style:{marginLeft:"16px",marginTop:"16px"}},b("PT_LOAD_MORE_MSG")," ",l.createElement("span",{className:"link"},l.createElement(i.Link,{to:`/digit-ui/citizen/pt/property/search-results?mobileNumber=${C||S.mobileNumber?C||(null==S?void 0:S.mobileNumber):""}&propertyIds=${A||null!=S&&S.propertyIds?A||(null==S?void 0:S.propertyIds):""}&oldPropertyIds=${D||null!=S&&S.oldPropertyIds?D||(null==S?void 0:S.oldPropertyIds):""}&doorNo=${P||null!=S&&S.doorNo?P||(null==S?void 0:S.doorNo):""}&name=${w||null!=S&&S.name?w||(null==S?void 0:S.name):""}&city=${I||""}&locality=${N||null!=S&&S.locality?N||(null==S?void 0:S.locality):""}&PToffset=${k}`},b("PT_COMMON_CLICK_HERE"))))))};he.propTypes={template:ve.any,header:ve.string,actionButtonLabel:ve.string},he.defaultProps={template:[],header:null,actionButtonLabel:null};const Se=[{texts:{header:"CS_LOGIN_PROVIDE_MOBILE_NUMBER",cardText:"CS_LOGIN_TEXT",nextText:"CS_COMMONS_NEXT",submitBarLabel:"CS_COMMONS_NEXT"},inputs:[{label:"CORE_COMMON_MOBILE_NUMBER",type:"text",name:"mobileNumber",error:"ERR_HRMS_INVALID_MOB_NO",validation:{required:!0,minLength:10,maxLength:10}}]},{texts:{header:"CS_LOGIN_OTP",cardText:"CS_LOGIN_OTP_TEXT",nextText:"CS_COMMONS_NEXT",submitBarLabel:"CS_COMMONS_NEXT"}},{texts:{header:"CS_LOGIN_PROVIDE_NAME",cardText:"CS_LOGIN_NAME_TEXT",nextText:"CS_COMMONS_NEXT",submitBarLabel:"CS_COMMONS_NEXT"},inputs:[{label:"CORE_COMMON_NAME",type:"text",name:"name",error:"CORE_COMMON_NAME_VALIDMSG",validation:{required:!0,minLength:1,pattern:/^[^{0-9}^\$\"<>?\\\\~!@#$%^()+={}\[\]*,/_:;“”‘’]{1,50}$/i}}]}],be=e=>{const{config:t,onSelect:r,clearParams:a,formData:u,stateCode:d}=e,{t:s}=o.useTranslation(),{path:c}=i.useRouteMatch(),p=i.useLocation().search,v=new URLSearchParams(p).get("redirectToUrl");let m=ye;const f=n.useMemo(()=>{var e;return null==m||null===(e=m.map)||void 0===e?void 0:e.call(m,e=>{const t={};for(const n in e.texts)t[n]=s(e.texts[n]);return{...e,texts:t}})},[m]);return l.createElement(i.Switch,null,l.createElement(i.Route,{path:""+c,exact:!0},l.createElement(he,{template:f[0].labels,header:f[0].texts.header,actionButtonLabel:f[0].texts.actionButtonLabel,t:s,isMutation:"MUTATION"===(null==t?void 0:t.action),onSelect:r,config:t,clearParams:a,stateCode:d,redirectToUrl:v,searchQuery:null==u?void 0:u.cptSearchQuery})))},Te=e=>{let{onSelect:r}=e;const{t:a}=o.useTranslation(),{propertyIds:u}=i.useParams(),d=i.useHistory(),{data:s}=Digit.Hooks.pt.usePropertySearch({filters:{propertyIds:u}},{filters:{propertyIds:u}}),[c,p]=n.useState(()=>(null==s?void 0:s.Properties[0])||" ");return n.useEffect(()=>{s&&p(null==s?void 0:s.Properties[0])},[s]),l.createElement(l.Fragment,null,l.createElement(t.Header,null,a("PT_PROPERTY_DETAILS")),l.createElement("div",null,l.createElement(t.Card,null,l.createElement(t.StatusTable,null,l.createElement(t.Row,{label:a("PT_PROPERTY_PTUID"),text:""+(c.propertyId||a("CS_NA")),textStyle:{whiteSpace:"pre"}})),l.createElement(t.SubmitBar,r?{submit:!1,label:a("CS_COMMONS_NEXT"),onSubmit:()=>{r&&r("propertyId",u)}}:{submit:!1,label:a("PT_PROPERTY_CREATE"),onSubmit:()=>d.push("/digit-ui/citizen/commonPt/property/new-application")}))))},Ce=e=>{let{config:o,otp:i,onOtpChange:r,onResend:a,onSelect:u,t:d,error:s,userType:c="citizen"}=e;const[p,v]=n.useState(30);!function(e,t){const l=n.useRef();n.useEffect(()=>{l.current=e},[e]),n.useEffect(()=>{if(null!==t){const e=setInterval(function(){l.current()},t);return()=>clearInterval(e)}},[t])}(()=>{v(p-1)},p>0?1e3:null);const m=()=>{a(),v(2)};return"employee"===c?l.createElement(n.Fragment,null,l.createElement(t.OTPInput,{length:6,onChange:r,value:i}),p>0?l.createElement(t.CardText,null,`${d("CS_RESEND_ANOTHER_OTP")} ${p} ${d("CS_RESEND_SECONDS")}`):l.createElement("p",{className:"card-text-button",onClick:m},d("CS_RESEND_OTP")),!s&&l.createElement(t.CardLabelError,null,d("CS_INVALID_OTP"))):l.createElement(t.FormStep,{onSelect:u,config:o,t:d,isDisabled:6!==(null==i?void 0:i.length)},l.createElement(t.OTPInput,{length:6,onChange:r,value:i}),p>0?l.createElement(t.CardText,null,`${d("CS_RESEND_ANOTHER_OTP")} ${p} ${d("CS_RESEND_SECONDS")}`):l.createElement("p",{className:"card-text-button",onClick:m},d("CS_RESEND_OTP")),!s&&l.createElement(t.CardLabelError,null,d("CS_INVALID_OTP")))},Ae=e=>{const{t:t}=o.useTranslation(),r=(i.useRouteMatch(),i.useLocation()),a=i.useHistory(),[u,d]=n.useState({mobileNumber:r.state.mobileNumber,otp:""}),[s,c]=n.useState(!0),p=()=>Digit.UserService.getType(),v=n.useMemo(()=>Se.map(e=>{const n={};for(const l in e.texts)n[l]=t(e.texts[l]);return{...e,texts:n}},[Se]));return l.createElement(Ce,{config:{...v[1],texts:{...v[1].texts,cardText:`${v[1].texts.cardText} ${u.mobileNumber||""}`}},onOtpChange:e=>{d({...u,otp:e})},onResend:function(){try{const{mobileNumber:t}=u,n={mobileNumber:t,tenantId:e.stateCode,userType:p()};return Promise.resolve(sendOtp({otp:{...n,...TYPE_LOGIN}})).then(function(){})}catch(e){return Promise.reject(e)}},onSelect:function(){try{const t=_e(function(){c(!0);const{mobileNumber:t,otp:n}=u,l={username:t,password:n,tenantId:e.stateCode,userType:p()};return Promise.resolve(Digit.UserService.authenticate(l)).then(function(e){var t;let{...n}=e;var l,o;null!==(t=r.state)&&void 0!==t&&t.redirectBackTo?a.replace(null===(l=r.state)||void 0===l?void 0:l.redirectBackTo,{data:null===(o=r.state)||void 0===o?void 0:o.redirectData}):a.replace("digit-ui/citizen/")})},function(){c(!1)});return Promise.resolve(t&&t.then?t.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},otp:u.otp,error:s,t:t})},De=e=>l.createElement("h1",{className:"heading-m"},e.label),Ne=()=>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"})),Ie=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(Ne,null)),Oe=e=>{var o,i;let{t:r,action:a,tenantId:u,closeModal:d,submitAction:s,applicationData:c,businessService:p,moduleCode:v}=e;const{data:m,isLoading:f}=Digit.Hooks.useEmployeeSearch(u,{roles:null==a||null===(o=a.assigneeRoles)||void 0===o||null===(i=o.map)||void 0===i?void 0:i.call(o,e=>({code:e})),isActive:!0},{enabled:!(null!=a&&a.isTerminateState)}),{isLoading:E,data:y}=Digit.Hooks.pt.useMDMS(u,p,"FINANCIAL_YEARLS",{},{details:{tenantId:Digit.ULBService.getStateId(),moduleDetails:[{moduleName:"egf-master",masterDetails:[{name:"FinancialYear",filter:"[?(@.module == 'PT')]"}]}]}}),[_,g]=n.useState({}),[h,S]=n.useState({}),[b,T]=n.useState([]),[C,A]=n.useState(null),[D,N]=n.useState(null),[I,O]=n.useState(null),[P,w]=n.useState(null),[R,L]=n.useState([]),[x,M]=n.useState(null),[F,k]=n.useState(!1);function U(e){N(e.target.files[0])}return n.useEffect(()=>{var e;y&&y["egf-master"]&&L(null===(e=y["egf-master"])||void 0===e?void 0:e.FinancialYear)},[y]),n.useEffect(()=>{var e;T(null==m||null===(e=m.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[m]),n.useEffect(()=>{!function(){try{w(null);const e=function(){if(D){const e=function(){if(D.size>=5242880)w(r("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=_e(function(){return Promise.resolve(Digit.UploadServices.Filestorage("PT",D,Digit.ULBService.getStateId())).then(function(e){var t,n,l,o;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?O(null==e||null===(l=e.data)||void 0===l||null===(o=l.files[0])||void 0===o?void 0:o.fileStoreId):w(r("CS_FILE_UPLOAD_ERROR"))})},function(){w(r("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[D]),n.useEffect(()=>{a&&g(null!=a&&a.showFinancialYearsModal?(e=>{let{t:n,action:o,financialYears:i,selectedFinancialYear:r,setSelectedFinancialYear:a}=e;return{label:{heading:`WF_${o.action}_APPLICATION`,submit:"WF_PT.CREATE_"+o.action,cancel:"ES_PT_COMMON_CANCEL"},form:[{body:[{label:n("ES_PT_FINANCIAL_YEARS"),isMandatory:!0,type:"radio",populators:l.createElement(t.RadioButtons,{options:i,optionsKey:"name",onSelect:a,selectedOption:r})}]}]}})({t:r,action:a,financialYears:R,selectedFinancialYear:x,setSelectedFinancialYear:M}):(e=>{var n;let{t:o,action:i,approvers:r,selectedApprover:a,setSelectedApprover:u,selectFile:d,uploadedFile:s,setUploadedFile:c,assigneeLabel:p,businessService:v}=e;return{label:{heading:`WF_${null==i?void 0:i.action}_APPLICATION`,submit:`WF_${v}_${null==i?void 0:i.action}`,cancel:"ES_PT_COMMON_CANCEL"},form:[{body:[{label:i.isTerminateState||"SENDBACKTOCITIZEN"===(null==i?void 0:i.action)?null:o(p||"WF_ROLE_"+(null===(n=i.assigneeRoles)||void 0===n?void 0:n[0])),type:"dropdown",populators:i.isTerminateState||"SENDBACKTOCITIZEN"===(null==i?void 0:i.action)?null:l.createElement(t.Dropdown,{option:r,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:u,selected:a})},{label:o("ES_PT_ACTION_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:`${o("ES_PT_ATTACH_FILE")}${i.docUploadRequired?" *":""}`,populators:l.createElement(t.UploadFile,{id:"workflow-doc",onUpload:d,onDelete:()=>{c(null)},showHint:!0,hintText:o("PT_ATTACH_RESTRICTIONS_SIZE"),message:s?"1 "+o("ES_PT_ACTION_FILEUPLOADED"):o("ES_PT_ACTION_NO_FILEUPLOADED")})}]}]}})({t:r,action:a,approvers:b,selectedApprover:C,setSelectedApprover:A,selectFile:U,uploadedFile:I,setUploadedFile:O,businessService:p}))},[a,b,R,x,I]),a&&_.form?l.createElement(t.Modal,{headerBarMain:l.createElement(De,{label:r(_.label.heading)}),headerBarEnd:l.createElement(Ie,{onClick:d}),actionCancelLabel:r(_.label.cancel),actionCancelOnSubmit:d,actionSaveLabel:r(_.label.submit),actionSaveOnSubmit:()=>{},isDisabled:a.showFinancialYearsModal?!x:f||(null==a?void 0:a.docUploadRequired)&&!I,formId:"modal-action"},E?l.createElement(t.Loader,null):l.createElement(t.FormComposer,{config:_.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){if("INACTIVE_PROPERTY"==(null==a?void 0:a.action)){let t={action:"OPEN",comment:null==e?void 0:e.comments,businessService:"PT.CREATE",moduleName:"PT"};c.creationReason="STATUS",s({customFunctionToExecute:null==a?void 0:a.customFunctionToExecute,Property:{...c,workflow:t}})}else if(null!=a&&a.showFinancialYearsModal)s({customFunctionToExecute:null==a?void 0:a.customFunctionToExecute,Assessment:{financialYear:null==x?void 0:x.name,propertyId:null==c?void 0:c.propertyId,tenantId:u,source:null==c?void 0:c.source,channel:null==c?void 0:c.channel,assessmentDate:Date.now()}});else{let t={action:null==a?void 0:a.action,comment:null==e?void 0:e.comments,businessService:p,moduleName:v};t.assignes=null!=a&&a.isTerminateState||!C?[]:[C],I&&(t.documents=[{documentType:(null==a?void 0:a.action)+" DOC",fileName:null==D?void 0:D.name,fileStoreId:I}]),s({Property:{...c,workflow:t}})}},defaultValues:h,formId:"modal-action"})):l.createElement(t.Loader,null)},Pe=e=>l.createElement("h1",{className:"heading-m"},e.label),we=()=>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"})),Re=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(we,null)),Le=e=>{var o,i;let{t:r,action:a,tenantId:u,closeModal:d,submitAction:s,applicationData:c,businessService:p}=e;const{data:v}=Digit.Hooks.useEmployeeSearch(u,{roles:null==a||null===(o=a.assigneeRoles)||void 0===o||null===(i=o.map)||void 0===i?void 0:i.call(o,e=>({code:e})),isActive:!0},{enabled:!(null!=a&&a.isTerminateState)}),{isLoading:m,data:f}=Digit.Hooks.pt.useMDMS(u,p,"FINANCIAL_YEARLS",{},{details:{tenantId:Digit.ULBService.getStateId(),moduleDetails:[{moduleName:"egf-master",masterDetails:[{name:"FinancialYear",filter:"[?(@.module == 'TL')]"}]}]}}),[E,y]=n.useState({}),[_,g]=n.useState({}),[h,S]=n.useState([]),[b,T]=n.useState({}),[C,A]=n.useState(null),[D,N]=n.useState(null),[I,O]=n.useState(null),[P,w]=n.useState([]),[R,L]=n.useState(null);function x(e){A(e.target.files[0])}return n.useEffect(()=>{var e;f&&f["egf-master"]&&w(null===(e=f["egf-master"])||void 0===e?void 0:e.FinancialYear)},[f]),n.useEffect(()=>{var e;S(null==v||null===(e=v.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}}))},[v]),n.useEffect(()=>{!function(){try{O(null);const e=function(){if(C){const e=function(){if(C.size>=5242880)O(r("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=_e(function(){return Promise.resolve(Digit.UploadServices.Filestorage("PT",C,Digit.ULBService.getStateId())).then(function(e){var t,n,l,o;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?N(null==e||null===(l=e.data)||void 0===l||null===(o=l.files[0])||void 0===o?void 0:o.fileStoreId):O(r("CS_FILE_UPLOAD_ERROR"))})},function(){O(r("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(()=>{a&&y((e=>{let{t:n,action:o,approvers:i,selectedApprover:r,setSelectedApprover:a,selectFile:u,uploadedFile:d,setUploadedFile:s,businessService:c}=e,p=!0;return"SENDBACKTOCITIZEN"!=(null==o?void 0:o.action)&&"APPROVE"!=(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==c?void 0:c.toUpperCase()}_${null==o?void 0:o.action}`,cancel:"WF_EMPLOYEE_NEWTL_CANCEL"},form:[{body:[{label:p?n("WF_ASSIGNEE_NAME_LABEL"):null,placeholder:p?n("WF_ASSIGNEE_NAME_PLACEHOLDER"):null,type:"dropdown",populators:p?l.createElement(t.Dropdown,{option:i,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:a,selected:r}):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:r,action:a,approvers:h,selectedApprover:b,setSelectedApprover:T,selectFile:x,uploadedFile:D,setUploadedFile:N,businessService:p}))},[a,h,P,R,D]),a&&E.form?l.createElement(t.Modal,{headerBarMain:l.createElement(Pe,{label:r(E.label.heading)}),headerBarEnd:l.createElement(Re,{onClick:d}),actionCancelLabel:r(E.label.cancel),actionCancelOnSubmit:d,actionSaveLabel:r(E.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},m?l.createElement(t.Loader,null):l.createElement(t.FormComposer,{config:E.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){c={...c,action:null==a?void 0:a.action,comment:null==e?void 0:e.comments,assignee:null!=b&&b.uuid?[null==b?void 0:b.uuid]:null,wfDocuments:D?[{documentType:(null==a?void 0:a.action)+" DOC",fileName:null==C?void 0:C.name,fileStoreId:D}]:null},s({Licenses:[c]})},defaultValues:_,formId:"modal-action"})):l.createElement(t.Loader,null)},xe=e=>l.createElement("h1",{style:{marginLeft:"22px"},className:"heading-m BPAheading-m"},e.label),Me=()=>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"})),Fe=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(Me,null)),ke=e=>{var o,i;let{t:r,action:a,tenantId:u,closeModal:d,submitAction:s,applicationData:c,businessService:p}=e;const{data:v,isLoading:m}=Digit.Hooks.useEmployeeSearch(u,{roles:null==a||null===(o=a.assigneeRoles)||void 0===o||null===(i=o.map)||void 0===i?void 0:i.call(o,e=>({code:e})),isActive:!0},{enabled:!(null!=a&&a.isTerminateState)}),[f,E]=n.useState({}),[y,_]=n.useState({}),[g,h]=n.useState([]),[S,b]=n.useState({}),[T,C]=n.useState(null),[A,D]=n.useState(null),[N,I]=n.useState(null),O=!!Digit.Utils.browser.isMobile();function P(e){C(e.target.files[0])}return n.useEffect(()=>{var e;h(null==v||null===(e=v.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}}))},[v]),n.useEffect(()=>{!function(){try{I(null);const e=function(){if(T){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(T.size>=5242880)I(r("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=T&&T.type&&!e.test(null==T?void 0:T.type))I(r("NOT_SUPPORTED_FILE_TYPE"));else{const e=_e(function(){return Promise.resolve(Digit.UploadServices.Filestorage("OBPS",T,Digit.ULBService.getStateId()||(null==u?void 0:u.split(".")[0]))).then(function(e){var t,n,l,o;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?D(null==e||null===(l=e.data)||void 0===l||null===(o=l.files[0])||void 0===o?void 0:o.fileStoreId):I(r("CS_FILE_UPLOAD_ERROR"))})},function(){I(r("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[T]),n.useEffect(()=>{a&&E((e=>{let{t:n,action:o,approvers:i,selectedApprover:r,setSelectedApprover:a,selectFile:u,uploadedFile:d,setUploadedFile:s,businessService:c,error:p}=e,v=!0;return"SENDBACKTOCITIZEN"==(null==o?void 0:o.action)&&(v=!1),o.isTerminateState&&(v=!1),{label:{heading:`WF_${null==o?void 0:o.action}_APPLICATION`,submit:`WF_${null==c?void 0:c.toUpperCase()}_${null==o?void 0:o.action}`,cancel:"WF_EMPLOYEE_BPAREG_CANCEL"},form:[{body:[{label:v?n("WF_ASSIGNEE_NAME_LABEL"):null,placeholder:v?n("WF_ASSIGNEE_NAME_PLACEHOLDER"):null,type:"dropdown",populators:v?l.createElement(t.Dropdown,{option:i,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:a,selected:r}):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:p})}]}]}})({t:r,action:a,approvers:g,selectedApprover:S,setSelectedApprover:b,selectFile:P,uploadedFile:A,setUploadedFile:D,businessService:p,error:N}))},[a,g,A,N]),a&&f.form?l.createElement(t.Modal,{headerBarMain:l.createElement(xe,{label:r(f.label.heading)}),headerBarEnd:l.createElement(Fe,{onClick:d}),actionCancelLabel:r(f.label.cancel),actionCancelOnSubmit:d,actionSaveLabel:r(f.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action",isOBPSFlow:!0,popupStyles:O?{width:"720px"}:{},style:O?{height:"45px",width:"44%"}:{height:"45px",width:"107px",paddingLeft:"0px",paddingRight:"0px"},popupModuleMianStyles:O?{paddingLeft:"5px"}:{}},m?l.createElement(t.Loader,null):l.createElement(t.FormComposer,{config:f.form,cardStyle:{marginLeft:"0px",marginRight:"0px",marginTop:"-25px"},className:"BPAemployeeCard",noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){c={...c,action:null==a?void 0:a.action,comment:null==e?void 0:e.comments,assignee:null!=S&&S.uuid?[null==S?void 0:S.uuid]:null,wfDocuments:A?[{documentType:(null==a?void 0:a.action)+" DOC",fileName:null==T?void 0:T.name,fileStoreId:A}]:null},s({Licenses:[c]},!1,{isStakeholder:!0,bpa:!1})},defaultValues:y,formId:"modal-action"})):l.createElement(t.Loader,null)},Ue=e=>l.createElement("h1",{style:{marginLeft:"22px"},className:"heading-m BPAheading-m"},e.label),Be=()=>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"})),je=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(Be,null)),He=e=>{var o,i,a,u,d,s,c,p,v,m,f,E;let{t:y,action:_,tenantId:g,closeModal:h,submitAction:S,applicationDetails:b,applicationData:T,businessService:C,workflowDetails:A}=e;Digit.Hooks.obps.useObpsAPI(null!==(o=T)&&void 0!==o&&null!==(i=o.landInfo)&&void 0!==i&&null!==(a=i.address)&&void 0!==a&&a.city?null===(u=T)||void 0===u||null===(d=u.landInfo)||void 0===d||null===(s=d.address)||void 0===s?void 0:s.city:g,!1);const{data:D,isLoading:N}=Digit.Hooks.useEmployeeSearch(g,{roles:null==A||null===(c=A.data)||void 0===c||null===(p=c.initialActionState)||void 0===p||null===(v=p.nextActions)||void 0===v||null===(m=v.filter(e=>(null==e?void 0:e.action)==(null==_?void 0:_.action)))||void 0===m||null===(f=m[0])||void 0===f||null===(E=f.assigneeRoles)||void 0===E?void 0:E.map(e=>({code:e})),isActive:!0},{enabled:!(null!=_&&_.isTerminateState)}),[I,O]=(r.useQueryClient(),n.useState({})),[P,w]=n.useState({}),[R,L]=n.useState([]),[x,M]=n.useState({}),[F,k]=n.useState(null),[U,B]=n.useState(null),[j,H]=n.useState(null),[W,V]=n.useState(null),z=!!Digit.Utils.browser.isMobile();function $(e){k(e.target.files[0])}n.useEffect(()=>{var e;L(null==D||null===(e=D.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}}))},[D]),n.useEffect(()=>{!function(){try{H(null);const e=function(){if(F){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(F.size>=5242880)H(y("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=F&&F.type&&!e.test(null==F?void 0:F.type))H(y("NOT_SUPPORTED_FILE_TYPE"));else{const e=_e(function(){return Promise.resolve(Digit.UploadServices.Filestorage("OBPS",F,Digit.ULBService.getStateId()||(null==g?void 0:g.split(".")[0]))).then(function(e){var t,n,l,o;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?B(null==e||null===(l=e.data)||void 0===l||null===(o=l.files[0])||void 0===o?void 0:o.fileStoreId):H(y("CS_FILE_UPLOAD_ERROR"))})},function(){H(y("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[F]);const Y=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},K=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},q=e=>{var t,n;let l=[],o=[];var i,r;return(null==e||null===(t=e.additionalDetails)||void 0===t||null===(n=t.fieldinspection_pending)||void 0===n?void 0:n.length)>0&&(o=null==e||null===(i=e.additionalDetails)||void 0===i?void 0:i.fieldinspection_pending),"FIELDINSPECTION_INPROGRESS"==e.status?(l=JSON.parse(sessionStorage.getItem("INSPECTION_DATA")),(null===(r=l)||void 0===r?void 0:r.length)>0&&l.map((e,t)=>{o.push({docs:Y(e.Documents),date:e.InspectionDate,questions:K(e),time:null==e?void 0:e.InspectionTime})}),o=o.filter(e=>e.docs&&e.docs.length>0)):sessionStorage.removeItem("INSPECTION_DATA"),[...o]},G=e=>{let t=JSON.parse(sessionStorage.getItem("BPA_DOCUMENTS")),n=[];return t.map(e=>{var t,l,o,i,r,a;(null==e||null===(t=e.uploadedDocuments)||void 0===t||null===(l=t[0])||void 0===l||null===(o=l.values)||void 0===o?void 0:o.length)>0&&(n=[...n,...null==e||null===(i=e.uploadedDocuments)||void 0===i||null===(r=i[0])||void 0===r?void 0:r.values]),(null==e||null===(a=e.newUploadedDocs)||void 0===a?void 0:a.length)>0&&(n=[...n,...null==e?void 0:e.newUploadedDocs])}),n},Z=()=>{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(()=>{_&&O((e=>{var n;let{t:o,action:i,approvers:r,selectedApprover:a,setSelectedApprover:u,selectFile:d,uploadedFile:s,setUploadedFile:c,assigneeLabel:p,businessService:v,error:m}=e,f=!1;return"REVOCATE"!=(null==i?void 0:i.action)&&"REJECT"!=(null==i?void 0:i.action)&&"SKIP_PAYMENT"!=i.action&&"SEND_BACK_TO_CITIZEN"!=(null==i?void 0:i.action)&&"APPROVE"!=(null==i?void 0:i.action)||(f=!0),{label:{heading:`WF_${null==i?void 0:i.action}_APPLICATION`,submit:`WF_${v}_${null==i?void 0:i.action}`,cancel:"BPA_CITIZEN_CANCEL_BUTTON"},form:[{body:[{label:i.isTerminateState||f?null:o(p||"WF_ROLE_"+(null===(n=i.assigneeRoles)||void 0===n?void 0:n[0])),type:"dropdown",populators:i.isTerminateState||f?null:l.createElement(t.Dropdown,{option:r,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:u,selected:a})},{label:o("WF_COMMON_COMMENTS"),type:"textarea",isMandatory:!0,populators:{name:"comments"}},{label:""+o("WF_APPROVAL_UPLOAD_HEAD"),populators:l.createElement(t.UploadFile,{id:"workflow-doc",onUpload:d,onDelete:()=>{c(null)},message:s?"1 "+o("ES_PT_ACTION_FILEUPLOADED"):o("CS_ACTION_NO_FILEUPLOADED"),accept:"image/*, .pdf, .png, .jpeg, .jpg",iserror:m})}]}]}})({t:y,action:_,approvers:R,selectedApprover:x,setSelectedApprover:M,selectFile:$,uploadedFile:U,setUploadedFile:B,businessService:C,assigneeLabel:"WF_ASSIGNEE_NAME_LABEL",error:j}))},[_,R,W,U,j]),_&&I.form?l.createElement(t.Modal,{headerBarMain:l.createElement(Ue,{label:y(I.label.heading)}),headerBarEnd:l.createElement(je,{onClick:h}),actionCancelLabel:y(I.label.cancel),actionCancelOnSubmit:h,actionSaveLabel:y(I.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action",isOBPSFlow:!0,popupStyles:z?{width:"720px"}:{},style:z?{minHeight:"45px",height:"auto",width:"44%"}:{minHeight:"45px",height:"auto",width:"107px",paddingLeft:"0px",paddingRight:"0px"},popupModuleMianStyles:z?{paddingLeft:"5px"}:{}},N?l.createElement(t.Loader,null):l.createElement(t.FormComposer,{config:I.form,cardStyle:{marginLeft:"0px",marginRight:"0px",marginTop:"-25px"},className:"BPAemployeeCard",noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){try{var t,n,l,o,i,r;T={...T,documents:G(),additionalDetails:{...null===(t=T)||void 0===t?void 0:t.additionalDetails,fieldinspection_pending:q(T),pendingapproval:Z()},workflow:{action:null==_?void 0:_.action,comment:(null==e||null===(n=e.comments)||void 0===n?void 0:n.length)>0?null==e?void 0:e.comments:null,comments:(null==e||null===(l=e.comments)||void 0===l?void 0:l.length)>0?null==e?void 0:e.comments:null,assignee:null!=x&&x.uuid?[null==x?void 0:x.uuid]:null,assignes:null!=x&&x.uuid?[null==x?void 0:x.uuid]:null,varificationDocuments:U?[{documentType:(null==_?void 0:_.action)+" DOC",fileName:null==F?void 0:F.name,fileStoreId:U}]:null},action:null==_?void 0:_.action,comment:null==e?void 0:e.comments,assignee:null!=x&&x.uuid?[null==x?void 0:x.uuid]:null,wfDocuments:U?[{documentType:(null==_?void 0:_.action)+" DOC",fileName:null==F?void 0:F.name,fileStoreId:U}]:null};const a=null==b||null===(o=b.nocData)||void 0===o?void 0:o.map(e=>{const t=Digit.SessionStorage.get(null==e?void 0:e.nocType)||[];return{Noc:{...e,documents:[...null!=e&&e.documents?null==e?void 0:e.documents:[],...t||[]]}}});let u={sourceRefId:null==a||null===(i=a[0])||void 0===i||null===(r=i.Noc)||void 0===r?void 0:r.sourceRefId};return Promise.resolve(Digit.NOCSearch.all(g,u)).then(function(e){var t;let n=!0,l=!0;null==e||null===(t=e.Noc)||void 0===t||t.map(e=>{var t,o,i,r,a;"APPROVED"!==(null==e||null===(t=e.applicationStatus)||void 0===t?void 0:t.toUpperCase())&&"AUTO_APPROVED"!==(null==e||null===(o=e.applicationStatus)||void 0===o?void 0:o.toUpperCase())&&"REJECTED"!==(null==e||null===(i=e.applicationStatus)||void 0===i?void 0:i.toUpperCase())&&"AUTO_REJECTED"!==(null==e||null===(r=e.applicationStatus)||void 0===r?void 0:r.toUpperCase())&&"VOIDED"!==(null==e||null===(a=e.applicationStatus)||void 0===a?void 0:a.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 o=[];a&&a.map(e=>{var t,i,r,a,u,d,s,c,p,v,m,f;("APPROVED"!=(null==e||null===(t=e.Noc)||void 0===t||null===(i=t.applicationStatus)||void 0===i?void 0:i.toUpperCase())&&"AUTO_APPROVED"!=(null==e||null===(r=e.Noc)||void 0===r||null===(a=r.applicationStatus)||void 0===a?void 0:a.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===(p=e.Noc)||void 0===p||null===(v=p.applicationStatus)||void 0===v?void 0:v.toUpperCase())&&"AIRPORT_AUTHORITY"===(null==e||null===(m=e.Noc)||void 0===m?void 0:m.nocType)&&n||"FIRE_NOC"===(null==e||null===(f=e.Noc)||void 0===f?void 0:f.nocType)&&l)&&o.push(e)}),S({BPA:T},(null==o?void 0:o.length)>0&&o,{isStakeholder:!1,bpa:!0})})}catch(e){return Promise.reject(e)}},defaultValues:P,formId:"modal-action"})):l.createElement(t.Loader,null)},We=e=>l.createElement("h1",{style:{marginLeft:"22px"},className:"heading-m BPAheading-m"},e.label),Ve=()=>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"})),ze=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(Ve,null)),$e=e=>{var o,a;let{t:u,action:d,tenantId:s,closeModal:c,submitAction:p,applicationData:v,businessService:m}=e;const{data:f,isLoading:E}=Digit.Hooks.useEmployeeSearch(s,{roles:null==d||null===(o=d.assigneeRoles)||void 0===o||null===(a=o.map)||void 0===a?void 0:a.call(o,e=>({code:e})),isActive:!0},{enabled:!(null!=d&&d.isTerminateState)}),[y,_]=(r.useQueryClient(),n.useState({})),[g,h]=n.useState({}),[S,b]=n.useState([]),[T,C]=n.useState({}),[A,D]=n.useState(null),[N,I]=n.useState(null),[O,P]=n.useState(null),w=!!Digit.Utils.browser.isMobile();function R(e){D(e.target.files[0])}return i.useHistory(),n.useEffect(()=>{var e;b(null==f||null===(e=f.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[f]),n.useEffect(()=>{!function(){try{P(null);const e=function(){if(A){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(A.size>=5242880)P(u("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=A&&A.type&&!e.test(null==A?void 0:A.type))P(u("NOT_SUPPORTED_FILE_TYPE"));else{const e=_e(function(){return Promise.resolve(Digit.UploadServices.Filestorage("NOC",A,Digit.ULBService.getStateId()||(null==s?void 0:s.split(".")[0]))).then(function(e){var t,n,l,o;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?I(null==e||null===(l=e.data)||void 0===l||null===(o=l.files[0])||void 0===o?void 0:o.fileStoreId):P(u("CS_FILE_UPLOAD_ERROR"))})},function(){P(u("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[A]),n.useEffect(()=>{d&&_((e=>{var n;let{t:o,action:i,approvers:r,selectedApprover:a,setSelectedApprover:u,selectFile:d,uploadedFile:s,setUploadedFile:c,assigneeLabel:p,businessService:v,error:m}=e,f=!1;"REVOCATE"!=(null==i?void 0:i.action)&&"REJECT"!=(null==i?void 0:i.action)||(f=!0);let E=!1;return"APPROVE"!=(null==i?void 0:i.action)&&"REJECT"!=(null==i?void 0:i.action)&&"AUTO_APPROVE"!=i.action&&"AUTO_REJECT"!=i.action||(E=!0),{label:{heading:`WF_${null==i?void 0:i.action}_APPLICATION`,submit:`WF_${v}_${null==i?void 0:i.action}`,cancel:"CORE_LOGOUTPOPUP_CANCEL"},form:[{body:[{label:i.isTerminateState||E?null:o(p||"WF_ROLE_"+(null===(n=i.assigneeRoles)||void 0===n?void 0:n[0])),type:"dropdown",populators:i.isTerminateState||E?null:l.createElement(t.Dropdown,{option:r,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:u,selected:a})},{label:o("WF_COMMON_COMMENTS"),type:"textarea",isMandatory:f,populators:{name:"comments"}},{label:""+o("WF_APPROVAL_UPLOAD_HEAD"),populators:l.createElement(t.UploadFile,{id:"workflow-doc",onUpload:d,onDelete:()=>{c(null)},showHint:!0,message:s?"1 "+o("ES_PT_ACTION_FILEUPLOADED"):o("CS_ACTION_NO_FILEUPLOADED"),accept:"image/*, .pdf, .png, .jpeg, .jpg",iserror:m})}]}]}})({t:u,action:d,approvers:S,selectedApprover:T,setSelectedApprover:C,selectFile:R,uploadedFile:N,setUploadedFile:I,businessService:m,assigneeLabel:"WF_ASSIGNEE_NAME_LABEL",error:O}))},[d,S,N,O]),d&&y.form?l.createElement(t.Modal,{headerBarMain:l.createElement(We,{label:u(y.label.heading)}),headerBarEnd:l.createElement(ze,{onClick:c}),actionCancelLabel:u(y.label.cancel),actionCancelOnSubmit:c,actionSaveLabel:u(y.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action",isOBPSFlow:!0,popupStyles:w?{width:"720px"}:{},style:w?{height:"45px",width:"44%"}:{height:"45px",width:"107px",paddingLeft:"0px",paddingRight:"0px"},popupModuleMianStyles:w?{paddingLeft:"5px"}:{}},E?l.createElement(t.Loader,null):l.createElement(t.FormComposer,{config:y.form,cardStyle:{marginLeft:"0px",marginRight:"0px",marginTop:"-25px"},className:"BPAemployeeCard",noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){var t,n,l;let o=JSON.parse(sessionStorage.getItem("NewNOCDocs")),i=(null===(t=v)||void 0===t||null===(n=t.documents)||void 0===n?void 0:n.length)>0?[...null===(l=v)||void 0===l?void 0:l.documents]:[];o.map((e,t)=>{i.push(e)}),v={...v,workflow:{action:null==d?void 0:d.action,comment:null!=e&&e.comments?null==e?void 0:e.comments:null,assignee:null!=T&&T.uuid?[null==T?void 0:T.uuid]:null,documents:N?[{documentType:(null==d?void 0:d.action)+" DOC",fileName:null==A?void 0:A.name,fileStoreId:N}]:null},documents:i},p({Noc:v},!1,{isNoc:!0})},defaultValues:g,formId:"modal-action"})):l.createElement(t.Loader,null)};var Ye=function(e,t){return e===t||e!=e&&t!=t},Ke=function(e,t){for(var n=e.length;n--;)if(Ye(e[n][0],t))return n;return-1},qe=Array.prototype.splice;function Ge(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])}}Ge.prototype.clear=function(){this.__data__=[],this.size=0},Ge.prototype.delete=function(e){var t=this.__data__,n=Ke(t,e);return!(n<0||(n==t.length-1?t.pop():qe.call(t,n,1),--this.size,0))},Ge.prototype.get=function(e){var t=this.__data__,n=Ke(t,e);return n<0?void 0:t[n][1]},Ge.prototype.has=function(e){return Ke(this.__data__,e)>-1},Ge.prototype.set=function(e,t){var n=this.__data__,l=Ke(n,e);return l<0?(++this.size,n.push([e,t])):n[l][1]=t,this};var Ze,Xe=Ge,Je="object"==typeof d&&d&&d.Object===Object&&d,Qe="object"==typeof self&&self&&self.Object===Object&&self,et=Je||Qe||Function("return this")(),tt=et.Symbol,nt=Object.prototype,lt=nt.hasOwnProperty,ot=nt.toString,it=tt?tt.toStringTag:void 0,rt=Object.prototype.toString,at=tt?tt.toStringTag:void 0,ut=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":at&&at in Object(e)?function(e){var t=lt.call(e,it),n=e[it];try{e[it]=void 0;var l=!0}catch(e){}var o=ot.call(e);return l&&(t?e[it]=n:delete e[it]),o}(e):function(e){return rt.call(e)}(e)},dt=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},st=function(e){if(!dt(e))return!1;var t=ut(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t},ct=et["__core-js_shared__"],pt=(Ze=/[^.]+$/.exec(ct&&ct.keys&&ct.keys.IE_PROTO||""))?"Symbol(src)_1."+Ze:"",vt=Function.prototype.toString,mt=function(e){if(null!=e){try{return vt.call(e)}catch(e){}try{return e+""}catch(e){}}return""},ft=/^\[object .+?Constructor\]$/,Et=RegExp("^"+Function.prototype.toString.call(Object.prototype.hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),yt=function(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return function(e){return!(!dt(e)||(t=e,pt&&pt in t))&&(st(e)?Et:ft).test(mt(e));var t}(n)?n:void 0},_t=yt(et,"Map"),gt=yt(Object,"create"),ht=Object.prototype.hasOwnProperty,St=Object.prototype.hasOwnProperty;function bt(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])}}bt.prototype.clear=function(){this.__data__=gt?gt(null):{},this.size=0},bt.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},bt.prototype.get=function(e){var t=this.__data__;if(gt){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return ht.call(t,e)?t[e]:void 0},bt.prototype.has=function(e){var t=this.__data__;return gt?void 0!==t[e]:St.call(t,e)},bt.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=gt&&void 0===t?"__lodash_hash_undefined__":t,this};var Tt=bt,Ct=function(e,t){var n,l,o=e.__data__;return("string"==(l=typeof(n=t))||"number"==l||"symbol"==l||"boolean"==l?"__proto__"!==n:null===n)?o["string"==typeof t?"string":"hash"]:o.map};function At(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])}}At.prototype.clear=function(){this.size=0,this.__data__={hash:new Tt,map:new(_t||Xe),string:new Tt}},At.prototype.delete=function(e){var t=Ct(this,e).delete(e);return this.size-=t?1:0,t},At.prototype.get=function(e){return Ct(this,e).get(e)},At.prototype.has=function(e){return Ct(this,e).has(e)},At.prototype.set=function(e,t){var n=Ct(this,e),l=n.size;return n.set(e,t),this.size+=n.size==l?0:1,this};var Dt=At;function Nt(e){var t=this.__data__=new Xe(e);this.size=t.size}Nt.prototype.clear=function(){this.__data__=new Xe,this.size=0},Nt.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},Nt.prototype.get=function(e){return this.__data__.get(e)},Nt.prototype.has=function(e){return this.__data__.has(e)},Nt.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Xe){var l=n.__data__;if(!_t||l.length<199)return l.push([e,t]),this.size=++n.size,this;n=this.__data__=new Dt(l)}return n.set(e,t),this.size=n.size,this};var It=Nt,Ot=function(){try{var e=yt(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),Pt=function(e,t,n){"__proto__"==t&&Ot?Ot(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n},wt=Object.prototype.hasOwnProperty,Rt=function(e,t,n){var l=e[t];wt.call(e,t)&&Ye(l,n)&&(void 0!==n||t in e)||Pt(e,t,n)},Lt=function(e,t,n,l){var o=!n;n||(n={});for(var i=-1,r=t.length;++i<r;){var a=t[i],u=l?l(n[a],e[a],a,n,e):void 0;void 0===u&&(u=e[a]),o?Pt(n,a,u):Rt(n,a,u)}return n},xt=function(e){return null!=e&&"object"==typeof e},Mt=function(e){return xt(e)&&"[object Arguments]"==ut(e)},Ft=Object.prototype,kt=Ft.hasOwnProperty,Ut=Ft.propertyIsEnumerable,Bt=Mt(function(){return arguments}())?Mt:function(e){return xt(e)&&kt.call(e,"callee")&&!Ut.call(e,"callee")},jt=Array.isArray,Ht=function(){return!1},Wt=s(function(e,t){var n=t&&!t.nodeType&&t,l=n&&e&&!e.nodeType&&e,o=l&&l.exports===n?et.Buffer:void 0;e.exports=(o?o.isBuffer:void 0)||Ht}),Vt=/^(?:0|[1-9]\d*)$/,zt=function(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&Vt.test(e))&&e>-1&&e%1==0&&e<t},$t=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991},Yt={};Yt["[object Float32Array]"]=Yt["[object Float64Array]"]=Yt["[object Int8Array]"]=Yt["[object Int16Array]"]=Yt["[object Int32Array]"]=Yt["[object Uint8Array]"]=Yt["[object Uint8ClampedArray]"]=Yt["[object Uint16Array]"]=Yt["[object Uint32Array]"]=!0,Yt["[object Arguments]"]=Yt["[object Array]"]=Yt["[object ArrayBuffer]"]=Yt["[object Boolean]"]=Yt["[object DataView]"]=Yt["[object Date]"]=Yt["[object Error]"]=Yt["[object Function]"]=Yt["[object Map]"]=Yt["[object Number]"]=Yt["[object Object]"]=Yt["[object RegExp]"]=Yt["[object Set]"]=Yt["[object String]"]=Yt["[object WeakMap]"]=!1;var Kt=function(e){return function(t){return e(t)}},qt=s(function(e,t){var n=t&&!t.nodeType&&t,l=n&&e&&!e.nodeType&&e,o=l&&l.exports===n&&Je.process,i=function(){try{return l&&l.require&&l.require("util").types||o&&o.binding&&o.binding("util")}catch(e){}}();e.exports=i}),Gt=qt&&qt.isTypedArray,Zt=Gt?Kt(Gt):function(e){return xt(e)&&$t(e.length)&&!!Yt[ut(e)]},Xt=Object.prototype.hasOwnProperty,Jt=function(e,t){var n=jt(e),l=!n&&Bt(e),o=!n&&!l&&Wt(e),i=!n&&!l&&!o&&Zt(e),r=n||l||o||i,a=r?function(e,t){for(var n=-1,l=Array(e);++n<e;)l[n]=t(n);return l}(e.length,String):[],u=a.length;for(var d in e)!t&&!Xt.call(e,d)||r&&("length"==d||o&&("offset"==d||"parent"==d)||i&&("buffer"==d||"byteLength"==d||"byteOffset"==d)||zt(d,u))||a.push(d);return a},Qt=Object.prototype,en=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Qt)},tn=function(e,t){return function(n){return e(t(n))}},nn=tn(Object.keys,Object),ln=Object.prototype.hasOwnProperty,on=function(e){return null!=e&&$t(e.length)&&!st(e)},rn=function(e){return on(e)?Jt(e):function(e){if(!en(e))return nn(e);var t=[];for(var n in Object(e))ln.call(e,n)&&"constructor"!=n&&t.push(n);return t}(e)},an=Object.prototype.hasOwnProperty,un=function(e){return on(e)?Jt(e,!0):function(e){if(!dt(e))return function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}(e);var t=en(e),n=[];for(var l in e)("constructor"!=l||!t&&an.call(e,l))&&n.push(l);return n}(e)},dn=s(function(e,t){var n=t&&!t.nodeType&&t,l=n&&e&&!e.nodeType&&e,o=l&&l.exports===n?et.Buffer:void 0,i=o?o.allocUnsafe:void 0;e.exports=function(e,t){if(t)return e.slice();var n=e.length,l=i?i(n):new e.constructor(n);return e.copy(l),l}}),sn=function(){return[]},cn=Object.prototype.propertyIsEnumerable,pn=Object.getOwnPropertySymbols,vn=pn?function(e){return null==e?[]:(e=Object(e),function(t,n){for(var l=-1,o=null==t?0:t.length,i=0,r=[];++l<o;){var a=t[l];cn.call(e,a)&&(r[i++]=a)}return r}(pn(e)))}:sn,mn=function(e,t){for(var n=-1,l=t.length,o=e.length;++n<l;)e[o+n]=t[n];return e},fn=tn(Object.getPrototypeOf,Object),En=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)mn(t,vn(e)),e=fn(e);return t}:sn,yn=function(e,t,n){var l=t(e);return jt(e)?l:mn(l,n(e))},_n=function(e){return yn(e,rn,vn)},gn=function(e){return yn(e,un,En)},hn=yt(et,"DataView"),Sn=yt(et,"Promise"),bn=yt(et,"Set"),Tn=yt(et,"WeakMap"),Cn=mt(hn),An=mt(_t),Dn=mt(Sn),Nn=mt(bn),In=mt(Tn),On=ut;(hn&&"[object DataView]"!=On(new hn(new ArrayBuffer(1)))||_t&&"[object Map]"!=On(new _t)||Sn&&"[object Promise]"!=On(Sn.resolve())||bn&&"[object Set]"!=On(new bn)||Tn&&"[object WeakMap]"!=On(new Tn))&&(On=function(e){var t=ut(e),n="[object Object]"==t?e.constructor:void 0,l=n?mt(n):"";if(l)switch(l){case Cn:return"[object DataView]";case An:return"[object Map]";case Dn:return"[object Promise]";case Nn:return"[object Set]";case In:return"[object WeakMap]"}return t});var Pn=On,wn=Object.prototype.hasOwnProperty,Rn=et.Uint8Array,Ln=function(e){var t=new e.constructor(e.byteLength);return new Rn(t).set(new Rn(e)),t},xn=/\w*$/,Mn=tt?tt.prototype:void 0,Fn=Mn?Mn.valueOf:void 0,kn=Object.create,Un=function(){function e(){}return function(t){if(!dt(t))return{};if(kn)return kn(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}(),Bn=qt&&qt.isMap,jn=Bn?Kt(Bn):function(e){return xt(e)&&"[object Map]"==Pn(e)},Hn=qt&&qt.isSet,Wn=Hn?Kt(Hn):function(e){return xt(e)&&"[object Set]"==Pn(e)},Vn={};Vn["[object Arguments]"]=Vn["[object Array]"]=Vn["[object ArrayBuffer]"]=Vn["[object DataView]"]=Vn["[object Boolean]"]=Vn["[object Date]"]=Vn["[object Float32Array]"]=Vn["[object Float64Array]"]=Vn["[object Int8Array]"]=Vn["[object Int16Array]"]=Vn["[object Int32Array]"]=Vn["[object Map]"]=Vn["[object Number]"]=Vn["[object Object]"]=Vn["[object RegExp]"]=Vn["[object Set]"]=Vn["[object String]"]=Vn["[object Symbol]"]=Vn["[object Uint8Array]"]=Vn["[object Uint8ClampedArray]"]=Vn["[object Uint16Array]"]=Vn["[object Uint32Array]"]=!0,Vn["[object Error]"]=Vn["[object Function]"]=Vn["[object WeakMap]"]=!1;var zn=function e(t,n,l,o,i,r){var a,u=1&n,d=2&n,s=4&n;if(l&&(a=i?l(t,o,i,r):l(t)),void 0!==a)return a;if(!dt(t))return t;var c=jt(t);if(c){if(a=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&wn.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,a)}else{var p=Pn(t),v="[object Function]"==p||"[object GeneratorFunction]"==p;if(Wt(t))return dn(t,u);if("[object Object]"==p||"[object Arguments]"==p||v&&!i){if(a=d||v?{}:function(e){return"function"!=typeof e.constructor||en(e)?{}:Un(fn(e))}(t),!u)return d?function(e,t){return Lt(e,En(e),t)}(t,function(e,t){return e&&Lt(t,un(t),e)}(a,t)):function(e,t){return Lt(e,vn(e),t)}(t,function(e,t){return e&&Lt(t,rn(t),e)}(a,t))}else{if(!Vn[p])return i?t:{};a=function(e,t,n){var l,o,i=e.constructor;switch(t){case"[object ArrayBuffer]":return Ln(e);case"[object Boolean]":case"[object Date]":return new i(+e);case"[object DataView]":return function(e,t){var n=t?Ln(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?Ln(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}(e,n);case"[object Map]":return new i;case"[object Number]":case"[object String]":return new i(e);case"[object RegExp]":return(o=new(l=e).constructor(l.source,xn.exec(l))).lastIndex=l.lastIndex,o;case"[object Set]":return new i;case"[object Symbol]":return Fn?Object(Fn.call(e)):{}}}(t,p,u)}}r||(r=new It);var m=r.get(t);if(m)return m;r.set(t,a),Wn(t)?t.forEach(function(o){a.add(e(o,n,l,o,t,r))}):jn(t)&&t.forEach(function(o,i){a.set(i,e(o,n,l,i,t,r))});var f=c?void 0:(s?d?gn:_n:d?un:rn)(t);return function(e,t){for(var n=-1,l=null==e?0:e.length;++n<l&&!1!==t(e[n],n););}(f||t,function(o,i){f&&(o=t[i=o]),Rt(a,i,e(o,n,l,i,t,r))}),a},$n=function(e){return zn(e,5)};const Yn=e=>l.createElement("h1",{className:"heading-m"},e.label),Kn=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),qn=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(Kn,null)),Gn=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}},Zn=e=>{var o,i;let{t:r,action:a,tenantId:u,closeModal:d,submitAction:s,applicationData:c,businessService:p,cardClassName:v,cardFormWrapperClassName:m,cardFormClassName:f,formClassName:E}=e;const{data:y,isLoading:_}=Digit.Hooks.useEmployeeSearch(u,{roles:null==a||null===(o=a.assigneeRoles)||void 0===o||null===(i=o.map)||void 0===i?void 0:i.call(o,e=>({code:e})),isActive:!0},{enabled:!(null!=a&&a.isTerminateState)}),[g,h]=n.useState({}),[S,b]=n.useState({}),[T,C]=n.useState([]),[D,N]=n.useState({}),[I,O]=n.useState(null),[P,w]=n.useState(null),[R,L]=n.useState(null),x=window.Digit.Utils.browser.isMobile(),M=window.location.href.includes("/employee");function F(e){O(e.target.files[0])}return n.useEffect(()=>{var e;C(null==y||null===(e=y.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}}))},[y]),n.useEffect(()=>{!function(){try{L(null);const e=function(){if(I){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(I.size>=5242880)L(r("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=I&&I.type&&!e.test(null==I?void 0:I.type))L(r("NOT_SUPPORTED_FILE_TYPE"));else{const e=_e(function(){return Promise.resolve(Digit.UploadServices.Filestorage("WS",I,Digit.ULBService.getCurrentTenantId())).then(function(e){var t,n,l,o;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?w(null==e||null===(l=e.data)||void 0===l||null===(o=l.files[0])||void 0===o?void 0:o.fileStoreId):L(r("CS_FILE_UPLOAD_ERROR"))})},function(e){console.error("Modal -> err ",e),L(r("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[I]),n.useEffect(()=>{var e,n,o,i;"DisconnectWSConnection"==(null===(e=c)||void 0===e||null===(n=e.processInstance)||void 0===n?void 0:n.businessService)||"DisconnectSWConnection"==(null===(o=c)||void 0===o||null===(i=o.processInstance)||void 0===i?void 0:i.businessService)?a&&h((e=>{var n;let{t:o,action:i,approvers:r,selectedApprover:a,setSelectedApprover:u,selectFile:d,uploadedFile:s,setUploadedFile:c,businessService:p,error:v}=e,m=!0,f=!1;return(null!=i&&null!==(n=i.action)&&void 0!==n&&n.includes("SEND_BACK")||"APPROVE_FOR_DISCONNECTION"==(null==i?void 0:i.action)||"RESUBMIT_APPLICATION"==(null==i?void 0:i.action))&&(m=!1),i.isTerminateState&&(m=!1),"EXECUTE_DISCONNECTION"!=(null==i?void 0:i.action)&&"DISCONNECTION_EXECUTED"!=(null==i?void 0:i.action)||(f=!0),{label:{heading:`WF_${null==i?void 0:i.action}_APPLICATION`,submit:`WF_${null==p?void 0:p.toUpperCase()}_${null==i?void 0:i.action}`,cancel:"CS_COMMON_CANCEL"},form:[{body:[{label:m?o("WF_ASSIGNEE_NAME_LABEL"):null,placeholder:m?o("WF_ASSIGNEE_NAME_PLACEHOLDER"):null,type:"dropdown",populators:m?l.createElement(t.Dropdown,{option:r,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:u,selected:a}):null},f&&{label:o("ES_FSM_ACTION_SERVICE_DATE"),isMandatory:!!f,type:"custom",populators:f?{name:"date",validation:{required:!0},defaultValue:Digit.Utils.date.getDate(),component:(e,n)=>l.createElement(t.DatePicker,A({onChange:e.onChange,date:e.value},n))}:null},{label:o("WF_COMMON_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:o("WS_APPROVAL_CHECKLIST_BUTTON_UP_FILE"),populators:l.createElement(t.UploadFile,{id:"workflow-doc",accept:".jpg,.pdf,.png,.jpeg",onUpload:d,onDelete:()=>{c(null)},message:s?"1 "+o("ES_PT_ACTION_FILEUPLOADED"):o("CS_ACTION_NO_FILEUPLOADED"),error:v,iserror:v,showHintBelow:!0,hintText:"WS_HINT_TEXT_LABEL"})}]}]}})({t:r,action:a,approvers:T,selectedApprover:D,setSelectedApprover:N,selectFile:F,uploadedFile:P,setUploadedFile:w,businessService:p,error:R})):a&&h((e=>{var n;let{t:o,action:i,approvers:r,selectedApprover:a,setSelectedApprover:u,selectFile:d,uploadedFile:s,setUploadedFile:c,businessService:p,error:v}=e,m=!0;return(null!=i&&null!==(n=i.action)&&void 0!==n&&n.includes("SEND_BACK")||"APPROVE_FOR_CONNECTION"==(null==i?void 0:i.action))&&(m=!1),i.isTerminateState&&(m=!1),{label:{heading:`WF_${null==i?void 0:i.action}_APPLICATION`,submit:`WF_${null==p?void 0:p.toUpperCase()}_${null==i?void 0:i.action}`,cancel:"CS_COMMON_CANCEL"},form:[{body:[{label:m?o("WF_ASSIGNEE_NAME_LABEL"):null,placeholder:m?o("WF_ASSIGNEE_NAME_PLACEHOLDER"):null,type:"dropdown",populators:m?l.createElement(t.Dropdown,{option:r,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:u,selected:a}):null},{label:o("WF_COMMON_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:o("WS_APPROVAL_CHECKLIST_BUTTON_UP_FILE"),populators:l.createElement(t.UploadFile,{id:"workflow-doc",accept:".jpg,.pdf,.png,.jpeg",onUpload:d,onDelete:()=>{c(null)},message:s?"1 "+o("ES_PT_ACTION_FILEUPLOADED"):o("CS_ACTION_NO_FILEUPLOADED"),error:v,iserror:v,showHintBelow:!0,hintText:"WS_HINT_TEXT_LABEL"})}]}]}})({t:r,action:a,approvers:T,selectedApprover:D,setSelectedApprover:N,selectFile:F,uploadedFile:P,setUploadedFile:w,businessService:p,error:R}))},[a,T,P,R]),a&&g.form?l.createElement(t.Modal,{headerBarMain:l.createElement(Yn,{label:r(g.label.heading)}),headerBarEnd:l.createElement(qn,{onClick:d}),actionCancelLabel:r(g.label.cancel),actionCancelOnSubmit:d,actionSaveLabel:r(g.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action",style:x&&M?{width:"100%",height:"auto"}:{}},_?l.createElement(t.Loader,null):l.createElement(t.FormComposer,{config:g.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){var t,n,l,o,i,r,d,p,v,m;if(null!==(t=c)&&void 0!==t&&t.isBillAmend){var f,E,y,_,g,h,S,b,T;const t={...null===(f=c)||void 0===f||null===(E=f.billAmendmentDetails)||void 0===E?void 0:E.additionalDetails,comments:null!=e&&e.comments?e.comments:null},n={...null===(y=c)||void 0===y?void 0:y.billAmendmentDetails,workflow:{businessId:null===(_=c)||void 0===_||null===(g=_.billAmendmentDetails)||void 0===g?void 0:g.amendmentId,action:null==a?void 0:a.action,tenantId:u,businessService:null!==(h=c)&&void 0!==h&&null!==(S=h.applicationType)&&void 0!==S&&S.includes("WATER")?"WS.AMENDMENT":"SW.AMENDMENT",moduleName:null!==(b=c)&&void 0!==b&&null!==(T=b.applicationType)&&void 0!==T&&T.includes("WATER")?"WS":"SW",assignes:null!=D&&D.uuid?[{uuid:null==D?void 0:D.uuid}]:[],comment:(null==e?void 0:e.comments)||"",documents:P?[{documentType:(null==a?void 0:a.action)+" DOC",fileName:null==I?void 0:I.name,fileStoreId:P}]:[]},additionalDetails:t,comment:(null==e?void 0:e.comments)||"",wfDocuments:P?[{documentType:(null==a?void 0:a.action)+" DOC",fileName:null==I?void 0:I.name,fileStoreId:P}]:null,processInstance:{action:null==a?void 0:a.action,assignes:null!=D&&D.uuid?[{uuid:null==D?void 0:D.uuid}]:[],comment:(null==e?void 0:e.comments)||"",documents:P?[{documentType:(null==a?void 0:a.action)+" DOC",fileName:null==I?void 0:I.name,fileStoreId:P}]:[]}};s({AmendmentUpdate:n})}else{if(c={...c,action:null==a?void 0:a.action,comment:(null==e?void 0:e.comments)||"",assignee:null!=D&&D.uuid?[null==D?void 0:D.uuid]:[],assignes:null!=D&&D.uuid?[{uuid:null==D?void 0:D.uuid}]:[],wfDocuments:P?[{documentType:(null==a?void 0:a.action)+" DOC",fileName:null==I?void 0:I.name,fileStoreId:P}]:null,processInstance:{...null===(n=c)||void 0===n?void 0:n.processInstance,action:null==a?void 0:a.action,assignes:null!=D&&D.uuid?[{uuid:null==D?void 0:D.uuid}]:[],comment:(null==e?void 0:e.comments)||"",documents:P?[{documentType:(null==a?void 0:a.action)+" DOC",fileName:null==I?void 0:I.name,fileStoreId:P}]:[]}},null!=e&&e.date&&null!==(l=c)&&void 0!==l&&null!==(o=l.applicationType)&&void 0!==o&&o.includes("DISCONNECT")){const t=$n(null==e?void 0:e.date);c.disconnectionExecutionDate=Gn(t)}else if(null!=e&&e.date){const t=$n(null==e?void 0:e.date);c.connectionExecutionDate=Gn(t)}var C;if("DisconnectWSConnection"==(null===(i=c)||void 0===i||null===(r=i.processInstance)||void 0===r?void 0:r.businessService)||"DisconnectSWConnection"==(null===(d=c)||void 0===d||null===(p=d.processInstance)||void 0===p?void 0:p.businessService)||window.location.href.includes("disconnection"))"WATER"==(null===(C=c)||void 0===C?void 0:C.serviceType)?s({WaterConnection:c,disconnectRequest:!0}):s({SewerageConnection:c,disconnectRequest:!0});else if("SEWERAGE_RECONNECTION"==(null===(v=c)||void 0===v?void 0:v.applicationType))s({SewerageConnection:c,disconnectRequest:!1,reconnectRequest:!0});else if("WATER_RECONNECTION"==(null===(m=c)||void 0===m?void 0:m.applicationType))s({WaterConnection:c,disconnectRequest:!1,reconnectRequest:!0});else{var A,N,O,w,R,L,x,M,F,k,U,B,j;const e=sessionStorage.getItem("Digit.ADHOC_ADD_REBATE_DATA"),t=e?JSON.parse(e):"";null!=t&&null!==(A=t.value)&&void 0!==A&&A.adhocPenalty&&(c.additionalDetails.adhocPenalty=parseInt(null==t||null===(N=t.value)||void 0===N?void 0:N.adhocPenalty)||""),null!=t&&null!==(O=t.value)&&void 0!==O&&O.adhocPenaltyComment&&(c.additionalDetails.adhocPenaltyComment=(null==t||null===(w=t.value)||void 0===w?void 0:w.adhocPenaltyComment)||""),null!=t&&null!==(R=t.value)&&void 0!==R&&R.adhocPenaltyReason&&(c.additionalDetails.adhocPenaltyReason=(null==t||null===(L=t.value)||void 0===L?void 0:L.adhocPenaltyReason)||""),null!=t&&null!==(x=t.value)&&void 0!==x&&x.adhocRebate&&(c.additionalDetails.adhocRebate=parseInt(null==t||null===(M=t.value)||void 0===M?void 0:M.adhocRebate)||""),null!=t&&null!==(F=t.value)&&void 0!==F&&F.adhocRebateComment&&(c.additionalDetails.adhocRebateComment=(null==t||null===(k=t.value)||void 0===k?void 0:k.adhocRebateComment)||""),null!=t&&null!==(U=t.value)&&void 0!==U&&U.adhocRebateReason&&(c.additionalDetails.adhocRebateReason=(null==t||null===(B=t.value)||void 0===B?void 0:B.adhocRebateReason)||""),"WATER"==(null===(j=c)||void 0===j?void 0:j.serviceType)?s({WaterConnection:c,disconnectRequest:!1,reconnectRequest:!1}):s({SewerageConnection:c,disconnectRequest:!1,reconnectRequest:!1})}}},defaultValues:S,formId:"modal-action",cardFormClassName:f,cardFormWrapperClassName:m,cardClassName:v,formClassName:E})):l.createElement(t.Loader,null)},Xn=e=>l.createElement("h1",{className:"heading-m"},e.label),Jn=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),Qn=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(Jn,null)),el=e=>{var o,i;let{t:r,action:a,tenantId:u,closeModal:d,submitAction:s,applicationData:c,businessService:p,moduleCode:v}=e;console.log("applicationData",c);const{data:m}=Digit.Hooks.useEmployeeSearch(u,{roles:null==a||null===(o=a.assigneeRoles)||void 0===o||null===(i=o.map)||void 0===i?void 0:i.call(o,e=>({code:e})),isActive:!0},{enabled:!(null!=a&&a.isTerminateState)}),[f,E]=n.useState({}),[y,_]=n.useState({}),[g,h]=n.useState([]),[S,b]=n.useState(null),[T,C]=n.useState(null),[A,D]=n.useState(null),[N,I]=n.useState(null),[O,P]=n.useState(!1);function w(e){C(e.target.files[0])}return n.useEffect(()=>{var e;h(null==m||null===(e=m.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[m]),n.useEffect(()=>{!function(){try{I(null);const e=function(){if(T){const e=function(){if(T.size>=5242880)I(r("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=_e(function(){return Promise.resolve(Digit.UploadServices.Filestorage("PTR",T,Digit.ULBService.getStateId())).then(function(e){var t,n,l,o;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?D(null==e||null===(l=e.data)||void 0===l||null===(o=l.files[0])||void 0===o?void 0:o.fileStoreId):I(r("CS_FILE_UPLOAD_ERROR"))})},function(){I(r("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(()=>{a&&E((e=>{let{t:n,action:o,selectFile:i,uploadedFile:r,setUploadedFile:a,businessService:u}=e;return{label:{heading:`WF_${null==o?void 0:o.action}_APPLICATION`,submit:`WF_${u}_${null==o?void 0:o.action}`,cancel:"ES_PTR_COMMON_CANCEL"},form:[{body:[{label:n("ES_PTR_ACTION_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:`${n("ES_PTR_ATTACH_FILE")}${o.docUploadRequired?" *":""}`,populators:l.createElement(t.UploadFile,{id:"workflow-doc",onUpload:i,onDelete:()=>{a(null)},showHint:!0,hintText:n("PTR_ATTACH_RESTRICTIONS_SIZE"),message:r?"1 "+n("ES_PTR_ACTION_FILEUPLOADED"):n("ES_PTR_ACTION_NO_FILEUPLOADED")})}]}]}})({t:r,action:a,approvers:g,selectedApprover:S,setSelectedApprover:b,selectFile:w,uploadedFile:A,setUploadedFile:D,businessService:p}))},[a,g,A]),a&&f.form?l.createElement(t.Modal,{headerBarMain:l.createElement(Xn,{label:r(f.label.heading)}),headerBarEnd:l.createElement(Qn,{onClick:d}),actionCancelLabel:r(f.label.cancel),actionCancelOnSubmit:d,actionSaveLabel:r(f.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},l.createElement(t.FormComposer,{config:f.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){let t={action:null==a?void 0:a.action,comments:null==e?void 0:e.comments,businessService:p,moduleName:v};A&&(t.documents=[{documentType:(null==a?void 0:a.action)+" DOC",fileName:null==T?void 0:T.name,filestoreId:A}]),s({PetRegistrationApplications:[{...c,workflow:t}]})},defaultValues:y,formId:"modal-action"})):l.createElement(t.Loader,null)},tl=e=>l.createElement("h1",{className:"heading-m"},e.label),nl=()=>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"})),ll=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(nl,null)),ol=e=>{var o,r,a;let{t:u,action:d,tenantId:s,closeModal:c,submitAction:p,applicationData:v,businessService:m,moduleCode:f,cardClassName:E,cardFormWrapperClassName:y,cardFormClassName:_,formClassName:g}=e;const{data:h}=Digit.Hooks.useEmployeeSearch(s,{roles:null==d||null===(o=d.roles)||void 0===o||null===(r=o[0])||void 0===r||null===(a=r.map)||void 0===a?void 0:a.call(r,e=>({code:e})),isActive:!0},{enabled:!(null!=d&&d.isTerminateState)}),S=i.useHistory(),[b,T]=n.useState({}),[C,A]=n.useState({}),[D,N]=n.useState([]),[I,O]=n.useState(null),[P,w]=n.useState(null);return n.useEffect(()=>{var e;N(null==h||null===(e=h.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[h]),n.useEffect(()=>{"INITIATED"===(null==d?void 0:d.state)?S.push("/digit-ui/employee/asset/assetservice/edit/"+(null==v?void 0:v.applicationNo)):T((e=>{let{t:t,action:n,businessService:l}=e;return console.log("njhsegfdhjsbedwfdwe",n),{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:D,selectedApprover:I,setSelectedApprover:O,uploadedFile:P,setUploadedFile:w,businessService:m}))},[d,D,P]),d&&b.form?l.createElement(t.Modal,{headerBarMain:l.createElement(tl,{label:u(b.label.heading)}),headerBarEnd:l.createElement(ll,{onClick:c}),actionCancelLabel:u(b.label.cancel),actionCancelOnSubmit:c,actionSaveLabel:u(b.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},l.createElement(t.FormComposer,{config:b.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){let t={action:null==d?void 0:d.action,comment:null==e?void 0:e.comments,businessService:m,moduleName:f};P&&(t.documents=[]),p({Asset:{...v,workflow:t}})},defaultValues:C,formId:"modal-action",cardFormClassName:_,cardFormWrapperClassName:y,cardClassName:E,formClassName:g})):l.createElement(t.Loader,null)},il=e=>l.createElement("h1",{className:"heading-m"},e.label),rl=()=>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"})),al=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(rl,null)),ul=e=>{var o,i;let{t:r,action:a,tenantId:u,closeModal:d,submitAction:s,applicationData:c,businessService:p,moduleCode:v}=e;const{data:m}=Digit.Hooks.useEmployeeSearch(u,{roles:null==a||null===(o=a.assigneeRoles)||void 0===o||null===(i=o.map)||void 0===i?void 0:i.call(o,e=>({code:e})),isActive:!0},{enabled:!(null!=a&&a.isTerminateState)}),[f,E]=n.useState({}),[y,_]=n.useState({}),[g,h]=n.useState([]),[S,b]=n.useState(null),[T,C]=n.useState(null),[A,D]=n.useState(null),[N,I]=n.useState(null),[O,P]=n.useState(!1);function w(e){C(e.target.files[0])}return n.useEffect(()=>{var e;h(null==m||null===(e=m.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[m]),n.useEffect(()=>{!function(){try{I(null);const e=function(){if(T){const e=function(){if(T.size>=5242880)I(r("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=_e(function(){return Promise.resolve(Digit.UploadServices.Filestorage("CHB",T,u)).then(function(e){var t,n,l,o;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?D(null==e||null===(l=e.data)||void 0===l||null===(o=l.files[0])||void 0===o?void 0:o.fileStoreId):I(r("CS_FILE_UPLOAD_ERROR"))})},function(){I(r("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(()=>{a&&E((e=>{let{t:n,action:o,selectFile:i,uploadedFile:r,setUploadedFile:a}=e;return{label:{heading:"CHB_"+(null==o?void 0:o.action),submit:"CHB_"+(null==o?void 0:o.action),cancel:"CS_COMMON_BACK"},form:[{body:[{label:n("ES_CHB_ACTION_COMMENTS")+" *",type:"textarea",populators:{name:"comments",validation:{required:!0}}},{label:`${n("ES_CHB_ATTACH_FILE")}${o.docUploadRequired?" *":""}`,populators:l.createElement(t.UploadFile,{id:"workflow-doc",onUpload:i,onDelete:()=>{a(null)},message:r?"1 "+n("CS_ACTION_FILEUPLOADED"):n("CS_ACTION_NO_FILEUPLOADED")})}]}]}})({t:r,action:a,approvers:g,selectedApprover:S,setSelectedApprover:b,selectFile:w,uploadedFile:A,setUploadedFile:D,businessService:p}))},[a,g,A]),a&&f.form?l.createElement(t.Modal,{headerBarMain:l.createElement(il,{label:r(f.label.heading)}),headerBarEnd:l.createElement(al,{onClick:d}),actionCancelLabel:r(f.label.cancel),actionCancelOnSubmit:d,actionSaveLabel:r(f.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},l.createElement(t.FormComposer,{config:f.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){let t={action:null==a?void 0:a.action,comment:null==e?void 0:e.comments,businessService:p,moduleName:v};A&&(t.documents=[{documentType:(null==a?void 0:a.action)+" DOC",fileName:null==T?void 0:T.name,fileStoreId:A}]),s({hallsBookingApplication:{...c,workflow:t}})},defaultValues:y,formId:"modal-action"})):l.createElement(t.Loader,null)},dl=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"})),cl=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(sl,null)),pl=e=>{var o,i;let{t:r,action:a,tenantId:u,closeModal:d,submitAction:s,applicationData:c,businessService:p,moduleCode:v}=e;console.log("snjdskbjdfbjskfjkbs",a);const{data:m}=Digit.Hooks.useEmployeeSearch(u,{roles:null==a||null===(o=a.assigneeRoles)||void 0===o||null===(i=o.map)||void 0===i?void 0:i.call(o,e=>({code:e})),isActive:!0},{enabled:!(null!=a&&a.isTerminateState)}),[f,E]=n.useState({}),[y,_]=n.useState({}),[g,h]=n.useState([]),[S,b]=n.useState(null),[T,C]=n.useState(null),[A,D]=n.useState(null),[N,I]=n.useState(null),[O,P]=n.useState(null),[w,R]=n.useState(!1);function L(e){D(e.target.files[0])}return n.useEffect(()=>{var e;h(null==m||null===(e=m.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[m]),n.useEffect(()=>{!function(){try{P(null);const e=function(){if(A){const e=function(){if(A.size>=5242880)P(r("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=_e(function(){return Promise.resolve(Digit.UploadServices.Filestorage("PTR",A,Digit.ULBService.getStateId())).then(function(e){var t,n,l,o;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?I(null==e||null===(l=e.data)||void 0===l||null===(o=l.files[0])||void 0===o?void 0:o.fileStoreId):P(r("CS_FILE_UPLOAD_ERROR"))})},function(){P(r("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)}}()},[A]),n.useEffect(()=>{a&&E((e=>{let{t:n,action:o,selectFile:i,uploadedFile:r,setUploadedFile:a,businessService:u}=e;console.log("action",o);const d=(new Date).toISOString().split("T")[0];return console.log("todayedsta ::",d),{label:{heading:`WF_${null==o?void 0:o.action}_APPLICATION`,submit:`WF_${u}_${null==o?void 0:o.action}`,cancel:"ES_PTR_COMMON_CANCEL"},form:[{body:["COMPLETIONPENDING"===(null==o?void 0:o.state)?{label:n("EW_PICKUP_DATE"),type:"date",isMandatory:!0,populators:{name:"date",min:(new Date).toISOString().split("T")[0],max:new Date(Date.now()+6048e5).toISOString().split("T")[0]}}:"null","REQUESTCOMPLETED"===(null==o?void 0:o.state)?{label:n("ES_EW_ACTION_TRANSACTION_ID"),type:"text",isMandatory:!0,populators:{name:"transactionId"}}:"null","REQUESTCOMPLETED"===(null==o?void 0:o.state)?{label:n("ES_EW_ACTION_FINALAMOUNT"),type:"text",isMandatory:!0,populators:{name:"finalAmount"}}:"null",{label:n("ES_EW_ACTION_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:`${n("ES_EW_PHOTO")}${o.docUploadRequired?" *":""}`,populators:l.createElement(t.UploadFile,{id:"workflow-doc",onUpload:i,onDelete:()=>{a(null)},showHint:!0,hintText:n("EW_ATTACH_RESTRICTIONS_SIZE"),message:r?"1 "+n("ES_EW_ACTION_FILEUPLOADED"):n("ES_EW_ACTION_NO_FILEUPLOADED")})}]}]}})({t:r,action:a,approvers:g,selectedApprover:S,setSelectedApprover:b,selectFile:L,uploadedFile:N,setUploadedFile:I,businessService:p}))},[a,g,N]),console.log("conggg",f),a&&f.form?l.createElement(t.Modal,{headerBarMain:l.createElement(dl,{label:r(f.label.heading)}),headerBarEnd:l.createElement(cl,{onClick:d}),actionCancelLabel:r(f.label.cancel),actionCancelOnSubmit:d,actionSaveLabel:r(f.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},l.createElement(t.FormComposer,{config:f.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){let t={action:null==a?void 0:a.action,comments:null==e?void 0:e.comments,businessService:p,moduleName:v};console.log("applicationData",e),N&&(t.documents=[{documentType:(null==a?void 0:a.action)+" DOC",fileName:null==A?void 0:A.name,filestoreId:N},{}]),c.pickUpDate=null==e?void 0:e.date,c.transactionId=null==e?void 0:e.transactionId,c.finalAmount=null==e?void 0:e.finalAmount,s({EwasteApplication:[{...c,workflow:t}]})},defaultValues:y,formId:"modal-action"})):l.createElement(t.Loader,null)},vl=e=>l.createElement("h1",{className:"heading-m"},e.label),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"})),fl=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(ml,null)),El=e=>{var o,i;let{t:r,action:a,tenantId:u,closeModal:d,submitAction:s,applicationData:c,businessService:p,moduleCode:v}=e;const{data:m}=Digit.Hooks.useEmployeeSearch(u,{roles:null==a||null===(o=a.assigneeRoles)||void 0===o||null===(i=o.map)||void 0===i?void 0:i.call(o,e=>({code:e})),isActive:!0},{enabled:null==a?void 0:a.isTerminateState}),[f,E]=n.useState({}),[y,_]=n.useState({}),[g,h]=n.useState([]),[S,b]=n.useState(null),[T,C]=n.useState(null),[A,D]=n.useState(null),[N,I]=n.useState(null),[O,P]=n.useState(!1);function w(e){P(!0),C(e.target.files[0])}return n.useEffect(()=>{var e;h(null==m||null===(e=m.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[m]),n.useEffect(()=>{!function(){try{I(null);const e=function(){if(T){const e=function(){if(T.size>=5242880)I(r("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=function(e,t){try{var n=_e(function(){return Promise.resolve(Digit.UploadServices.Filestorage("StreetVending",T,u)).then(function(e){var t,n,l,o;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?D(null==e||null===(l=e.data)||void 0===l||null===(o=l.files[0])||void 0===o?void 0:o.fileStoreId):I(r("CS_FILE_UPLOAD_ERROR"))})},function(){I(r("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(P(!1),e)throw t;return t});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[T]),console.log("actyhdesh,jhfsefsef",a,c),n.useEffect(()=>{E((e=>{let{t:n,action:o,selectFile:i,uploadedFile:r,setUploadedFile:a,approvers:u,selectedApprover:d,setSelectedApprover:s,isUploading:c}=e;const p=()=>l.createElement("div",{className:"loading-spinner"});return console.log("isuploading ",c),{label:{heading:`WF_${null==o?void 0:o.action}_APPLICATION`,submit:"SV_"+(null==o?void 0:o.action),cancel:"SV_COMMON_CANCEL"},form:[{body:["APPROVE"===(null==o?void 0:o.action)||"REJECT"===(null==o?void 0:o.action)||"SENDBACKTOCITIZEN"===(null==o?void 0:o.action)?"":{label:n("SV_ASSIGNEE"),type:"dropdown",populators:l.createElement(t.Dropdown,{option:u,t:n,optionKey:"name",select:s,selected:d})},{label:n("SV_ACTION_COMMENTS"),isMandatory:!0,type:"textarea",populators:{name:"comments",validation:{required:!0}}},{label:`${n("SV_ATTATCH_FILE")}${o.docUploadRequired?" *":""}`,populators:l.createElement(t.UploadFile,{id:"workflow-doc-sv",onUpload:i,onDelete:()=>{a(null)},message:c?l.createElement("div",{style:{display:"flex",alignItems:"center",gap:"8px"}},l.createElement(p,null),l.createElement("span",null,"Uploading...")):r?"1 "+n("SV_FILE_UPLOADED"):n("SV_NO_FILE")})}]}]}})({t:r,action:a,approvers:g,selectedApprover:S,setSelectedApprover:b,selectFile:w,uploadedFile:A,setUploadedFile:D,businessService:p,isUploading:O}))},[a,g,A]),a&&f.form?l.createElement(t.Modal,{headerBarMain:l.createElement(vl,{label:r(f.label.heading)}),headerBarEnd:l.createElement(fl,{onClick:d}),actionCancelLabel:r(f.label.cancel),actionCancelOnSubmit:d,actionSaveLabel:r(f.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},l.createElement(t.FormComposer,{config:f.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){var t;let n={action:null==a?void 0:a.action,comments:null==e?void 0:e.comments,businessService:p,moduleName:v,assignes:"SENDBACKTOCITIZEN"===(null==a?void 0:a.action)?[null==c||null===(t=c.auditDetails)||void 0===t?void 0:t.createdBy]:null!=S&&S.uuid?[null==S?void 0:S.uuid]:null};A&&(n.documents=[{documentType:(null==a?void 0:a.action)+" DOC",fileName:null==T?void 0:T.name,fileStoreId:A}]),s({streetVendingDetail:{...c,workflow:n}})},defaultValues:y,formId:"modal-action"})):l.createElement(t.Loader,null)},yl=e=>l.createElement("h1",{className:"heading-m"},e.label),_l=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),gl=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(_l,null)),hl=e=>{var o,i,r,a,u;let{t:d,action:s,tenantId:c,closeModal:p,submitAction:v,applicationData:m,businessService:f,moduleCode:E,cardClassName:y,cardFormWrapperClassName:_,cardFormClassName:g,formClassName:h}=e;const{data:S}=Digit.Hooks.useEmployeeSearch(c,{roles:null==s||null===(o=s.assigneeRoles)||void 0===o||null===(i=o.map)||void 0===i?void 0:i.call(o,e=>({code:e})),isActive:!0},{enabled:!(null!=s&&s.isTerminateState)}),{data:b}=Digit.Hooks.fsm.useVendorSearch({tenantId:c,config:{enabled:"PENDING_FOR_VEHICLE_DRIVER_ASSIGN"===(null==s?void 0:s.state)||"ASSIGN_VEHICLE_DRIVER"===(null==s?void 0:s.action)}});let T=[];null==b||null===(r=b.vendor)||void 0===r||r.forEach(e=>{var t,n;if("WT"===(null==e||null===(t=e.additionalDetails)||void 0===t?void 0:t.description)||"WT"===(null==e||null===(n=e.additionalDetails)||void 0===n?void 0:n.serviceType)){var l;const t=`${null==e?void 0:e.name} (${null==e||null===(l=e.owner)||void 0===l?void 0:l.mobileNumber})`;T.push({code:null==e?void 0:e.name,name:t,i18nKey:t,vendorId:null==e?void 0:e.id})}});const{data:C}=Digit.Hooks.fsm.useVehiclesSearch({tenantId:c,filters:{vendorId:null==m?void 0:m.vendorId},config:{enabled:"DELIVERY_PENDING"===(null==s?void 0:s.state)||"ASSIGN_VEHICLE_DRIVER"===(null==s?void 0:s.action)}});let A=[];null==C||null===(a=C.vehicle)||void 0===a||null===(u=a.filter(e=>{var t,n,l;return(null==e||null===(t=e.driverData)||void 0===t?void 0:t.id)||(null==e||null===(n=e.driver)||void 0===n?void 0:n.id)||(null==e||null===(l=e.owner)||void 0===l?void 0:l.id)}))||void 0===u||u.map(e=>{var t,n,l;A.push({code:null==e?void 0:e.registrationNumber,name:null==e?void 0:e.registrationNumber,i18nKey:null==e?void 0:e.registrationNumber,tankerCapacity:null==e?void 0:e.tankCapacity,vehicleId:null==e?void 0:e.id,driverId:(null==e||null===(t=e.driverData)||void 0===t?void 0:t.ownerId)||(null==e||null===(n=e.driver)||void 0===n?void 0:n.ownerId)||(null==e?void 0:e.ownerId)||(null==e||null===(l=e.owner)||void 0===l?void 0:l.uuid)})});const[D,N]=n.useState({}),[I,O]=n.useState({}),[P,w]=n.useState([]),[R,L]=n.useState(null),[x,M]=n.useState(null),[F,k]=n.useState(null),[U,B]=n.useState(null),[j,H]=n.useState(null);function W(e){L(e.target.files[0])}return n.useEffect(()=>{var e;w(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{k(null);const e=function(){if(R){const e=function(){if(R.size>=5242880)k(d("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=_e(function(){return Promise.resolve(Digit.UploadServices.Filestorage("WT",R,c)).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?M(null==e||null===(l=e.data)||void 0===l||null===(o=l.files[0])||void 0===o?void 0:o.fileStoreId):k(d("CS_FILE_UPLOAD_ERROR"))})},function(){k(d("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)}}()},[R]),n.useEffect(()=>{s&&N((e=>{let{t:n,action:o,selectFile:i,uploadedFile:r,setUploadedFile:a,selectedVendor:u,setSelectedVendor:d,vendorDescription:s,vehicleDescription:c,selectVehicle:p,setSelectVehicle:v}=e;return{label:{heading:"RS_"+(null==o?void 0:o.action),submit:"RS_"+(null==o?void 0:o.action),cancel:"CS_COMMON_BACK"},form:[{body:[{label:n("ES_RS_ACTION_COMMENTS")+" *",type:"textarea",populators:{name:"comments",validation:{required:!0}}},"PENDING_FOR_VEHICLE_DRIVER_ASSIGN"===(null==o?void 0:o.state)&&"ASSIGN_VEHICLE_DRIVER"!==(null==o?void 0:o.action)?{label:n("RS_ASSIGN"),type:"dropdown",populators:l.createElement(t.Dropdown,{option:s,t:n,optionKey:"i18nKey",select:d,selected:u})}:"null","DELIVERY_PENDING"===(null==o?void 0:o.state)||"ASSIGN_VEHICLE_DRIVER"===(null==o?void 0:o.action)?{label:n("RS_REGISTRATION_NUMBER"),type:"dropdown",populators:l.createElement(t.Dropdown,{option:c,t:n,optionKey:"i18nKey",select:v,selected:p})}:"null",{label:`${n("ES_RS_ATTACH_FILE")}${o.docUploadRequired?" *":""}`,populators:l.createElement(t.UploadFile,{id:"workflow-doc",onUpload:i,onDelete:()=>{a(null)},message:r?"1 "+n("CS_ACTION_FILEUPLOADED"):n("CS_ACTION_NO_FILEUPLOADED")})}]}]}})({t:d,action:s,selectFile:W,uploadedFile:x,setUploadedFile:M,selectedVendor:U,setSelectedVendor:B,vendorDescription:b?T:void 0,vehicleDescription:C||"ASSIGN_VEHICLE_DRIVER"===(null==s?void 0:s.action)?A:void 0,selectVehicle:j,setSelectVehicle:H}))},[s,P,x,b,j,C]),s&&D.form?l.createElement(t.Modal,{headerBarMain:l.createElement(yl,{label:d(D.label.heading)}),headerBarEnd:l.createElement(gl,{onClick:p}),actionCancelLabel:d(D.label.cancel),actionCancelOnSubmit:p,actionSaveLabel:d(D.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},l.createElement(t.FormComposer,{config:D.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){let t={action:null==s?void 0:s.action,comments:null==e?void 0:e.comments,businessService:f,moduleName:E};x&&(t.documents=[{documentType:(null==s?void 0:s.action)+" DOC",fileName:null==R?void 0:R.name,fileStoreId:x}]),"PENDING_FOR_VEHICLE_DRIVER_ASSIGN"===(null==s?void 0:s.state)&&(m.vendorId=null==U?void 0:U.vendorId),"DELIVERY_PENDING"===(null==s?void 0:s.state)&&(m.vehicleId=null==j?void 0:j.vehicleId),"ASSIGN_VEHICLE_DRIVER"===(null==s?void 0:s.action)&&(m.vehicleId=null==j?void 0:j.vehicleId,m.driverId=null==j?void 0:j.driverId),"watertanker-fixedpoint"===f&&(t.moduleName="request-service.water_tanker",t.businessService="watertanker-fixedpoint");let n="watertanker"===f||"watertanker-fixedpoint"===f?{waterTankerBookingDetail:{...m,workflow:t}}:{mobileToiletBookingDetail:{...m,workflow:t}};v(n)},defaultValues:I,formId:"modal-action",cardFormClassName:g,cardFormWrapperClassName:_,cardClassName:y,formClassName:h})):l.createElement(t.Loader,null)},Sl=e=>null!=e&&e.businessService.includes("PT")?l.createElement(Oe,e):null!=e&&e.businessService.includes("ptr")?l.createElement(el,e):null!=e&&e.businessService.includes("NewTL")||null!=e&&e.businessService.includes("TL")||null!=e&&e.businessService.includes("EDITRENEWAL")||null!=e&&e.businessService.includes("DIRECTRENEWAL")?l.createElement(Le,e):null!=e&&e.moduleCode.includes("BPAREG")?l.createElement(ke,e):null!=e&&e.moduleCode.includes("BPA")?l.createElement(He,e):null!=e&&e.moduleCode.includes("NOC")?l.createElement($e,e):null!=e&&e.moduleCode.includes("WS")?l.createElement(Zn,e):null!=e&&e.businessService.includes("asset-create")?l.createElement(ol,e):null!=e&&e.businessService.includes("ewst")?l.createElement(pl,e):null!=e&&e.businessService.includes("booking-refund")?l.createElement(ul,e):null!=e&&e.businessService.includes("street-vending")?l.createElement(El,e):null!=e&&e.businessService.includes("watertanker")||null!=e&&e.businessService.includes("mobileToilet")?l.createElement(hl,e):void 0;function bl(e){let{documents:n,svgStyles:i={},isSendBackFlow:r=!1,isHrLine:a=!1,titleStyles:u}=e;const{t:d}=o.useTranslation(),s=window.location.href.includes("stakeholder");return l.createElement("div",{style:{marginTop:"19px"}},!s&&(null==n?void 0:n.map((e,o)=>{var i;return l.createElement(l.Fragment,{key:o},null!=e&&e.title?l.createElement(t.CardSubHeader,{style:u||{marginTop:"32px",marginBottom:"8px",color:"#505A5F",fontSize:"24px"}},d(null==e?void 0:e.title)):null,l.createElement("div",{style:{display:"flex",flexWrap:"wrap",justifyContent:"flex-start"}},null!=e&&e.values&&(null==e?void 0:e.values.length)>0?null==e||null===(i=e.values)||void 0===i?void 0:i.map((e,n)=>{var o;return l.createElement("a",{target:"_",href:null==e?void 0:e.url,style:{minWidth:"80px",marginRight:"10px",maxWidth:"100px",height:"auto",minWidth:"100px"},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",color:"#505A5F"}},d(null==e?void 0:e.title)),r?null!=e&&null!==(o=e.documentType)&&void 0!==o&&o.includes("NOC")?l.createElement("p",{style:{textAlign:"center"}},d(null==e?void 0:e.documentType.split(".")[1])):l.createElement("p",{style:{textAlign:"center"}},d(null==e?void 0:e.documentType)):"")}):!window.location.href.includes("citizen")&&l.createElement("div",null,l.createElement("p",null,d("BPA_NO_DOCUMENTS_UPLOADED_LABEL")))),a&&(null==n?void 0:n.length)!=o+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 Tl=e=>{var t,o;let{t:i,formData:r,applicationData:a,docs:u,bpaActionsDetails:d}=e;const s=(null==a?void 0:a.status)||"",c=(null==d||null===(t=d.data)||void 0===t?void 0:t.nextActions)||[],p=Digit.ULBService.getStateId(),[v,m]=n.useState((null==r||null===(o=r.documents)||void 0===o?void 0:o.documents)||[]),[f,E]=n.useState(null),[y,_]=n.useState([]),[g,h]=n.useState(!0),[S,b]=n.useState(!1),[T,C]=n.useState(!1),{isLoading:A,data:D}=Digit.Hooks.obps.useMDMS(p,"BPA",["DocTypeMapping"]),{isLoading:N,data:I}=Digit.Hooks.obps.useMDMS(p,"common-masters",["DocumentType"]);return n.useEffect(()=>{var e,t,n,l;let o=[];var i,r;null!=D&&null!==(e=D.BPA)&&void 0!==e&&e.DocTypeMapping&&(o=null==D||null===(i=D.BPA)||void 0===i||null===(r=i.DocTypeMapping)||void 0===r?void 0:r.filter(e=>{var t,n;return e.WFState==(null==a?void 0:a.status)?null==a?void 0:a.status:e.RiskType==(null==a?void 0:a.riskType)&&e.ServiceType==(null==a||null===(t=a.additionalDetails)||void 0===t?void 0:t.serviceType)&&e.applicationType==(null==a||null===(n=a.additionalDetails)||void 0===n?void 0:n.applicationType)}));let d=[];null===(t=o)||void 0===t||null===(n=t[0])||void 0===n||null===(l=n.docTypes)||void 0===l||l.forEach(e=>{var t,n,l,o;let i=e.code;e.dropdownData=[],e.uploadedDocuments=[],null==I||null===(t=I["common-masters"])||void 0===t||null===(n=t.DocumentType)||void 0===n||n.forEach(t=>{let n=t.code.slice(0,i.length);i===n&&(e.hasDropdown=!0,t.i18nKey=t.code,e.dropdownData.push(t))}),e.uploadedDocuments[0]={},e.uploadedDocuments[0].values=[],null==u||null===(l=u[0])||void 0===l||null===(o=l.values)||void 0===o||o.map(t=>{var n,l;i===`${null==t||null===(n=t.documentType)||void 0===n?void 0:n.split(".")[0]}.${null==t||null===(l=t.documentType)||void 0===l?void 0:l.split(".")[1]}`&&e.uploadedDocuments[0].values.push(t)}),d.push(e)}),sessionStorage.setItem("BPA_DOCUMENTS",JSON.stringify(d)),_(d)},[!A,!N]),n.useEffect(()=>{let e=0;y.map(t=>{let n=!1;v.map(e=>{t.required&&t.code==`${e.documentType.split(".")[0]}.${e.documentType.split(".")[1]}`&&(n=!0)}),!n&&t.required&&(e+=1)}),h("0"!=e&&0!=e||!(v.length>0))},[v,S]),n.useEffect(()=>{C("DOC_VERIFICATION_INPROGRESS"===s&&(null==c?void 0:c.length)>0)},[a,d]),l.createElement("div",null,null==y?void 0:y.map((e,t)=>l.createElement("div",null,l.createElement(Cl,{key:t,index:t,document:e,t:i,error:f,setError:E,setDocuments:m,documents:v,setCheckRequiredFields:b,applicationStatus:s,actions:c,bpaTaxDocuments:y,checkEnablingDocs:T}))))};function Cl(e){var o,i;let{t:r,document:a,setDocuments:u,documents:d,index:s,bpaTaxDocuments:c,checkEnablingDocs:p}=e;const v=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],m=Digit.ULBService.getStateId(),[f,E]=n.useState(v?{...v,active:!0,code:null==v?void 0:v.documentType,i18nKey:null==v?void 0:v.documentType}:1===(null==a||null===(o=a.dropdownData)||void 0===o?void 0:o.length)?null==a?void 0:a.dropdownData[0]:{}),[y,_]=n.useState(null),[g,h]=n.useState(()=>(null==v?void 0:v.fileStoreId)||null),[S,b]=n.useState([]);return n.useEffect(()=>{null!=f&&f.code&&u(e=>{var t;const n=null==e?void 0:e.filter(e=>(null==e?void 0:e.documentType)!==(null==f?void 0:f.code));return 0===(null==g?void 0:g.length)||null===g?n:[...null==n?void 0:n.filter(e=>(null==e?void 0:e.fileStoreId)!==g),{documentType:null==f?void 0:f.code,fileStoreId:g,documentUid:g,fileName:(null==y?void 0:y.name)||"",id:d?null===(t=d.find(e=>e.documentType===(null==f?void 0:f.code)))||void 0===t?void 0:t.id:void 0}]})},[g,f]),n.useEffect(()=>{try{S.length>0&&(sessionStorage.removeItem("BPA_DOCUMENTS"),a.newUploadedDocs=[],S.map(e=>{var t,n,l;null!=f&&f.code&&a.newUploadedDocs.push({documentType:null==f?void 0:f.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})}),c[s]=a,sessionStorage.setItem("BPA_DOCUMENTS",JSON.stringify(c)))}catch(e){Promise.reject(e)}},[S,f]),n.useEffect(()=>{},[y]),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"}},""+r(null==a?void 0:a.code)),(null==a||null===(i=a.uploadedDocuments)||void 0===i?void 0:i.length)&&l.createElement(bl,{documents:null==a?void 0:a.uploadedDocuments,svgStyles:{width:"100px",height:"100px",viewBox:"0 0 25 25",minWidth:"100px"}}),p?l.createElement("div",{style:{marginTop:"20px"}},l.createElement(t.LabelFieldPair,{style:{width:"100%"}},l.createElement(t.CardLabel,{style:{marginTop:"-10px",width:"100%"}},null!=a&&a.required?r(null==a?void 0:a.code)+"* ":""+r(null==a?void 0:a.code)),l.createElement(t.Dropdown,{className:"form-field",t:r,isMandatory:!1,option:null==a?void 0:a.dropdownData,selected:f,optionKey:"i18nKey",select:e=>E(e),style:{width:"100%"}})),l.createElement(t.LabelFieldPair,{style:{width:"100%"}},l.createElement(t.CardLabel,{className:"card-label-smaller",style:{width:"100%"}}),l.createElement("div",{className:"field",style:{width:"100%"}},l.createElement(t.MultiUploadWrapper,{module:"BPA",tenantId:m,getFormState:e=>((e,t)=>{let n=Object.fromEntries(t),l=Object.values(n);0!==Object.keys(n).length&&b(l),function(e){e&&_(e.file)}(l[l.length-1])})(0,e),t:r,allowedFileTypesRegex:/(.*?)(jpg|jpeg|png|image|pdf)$/i,allowedMaxSizeInMB:5,acceptFiles:"image/*, .pdf, .png, .jpeg, .jpg"})))):null)}function Al(e){let{fiReport:n,isCitizen:i=!1}=e;const{t:r}=o.useTranslation();return l.createElement(l.Fragment,null,l.createElement("div",{style:{marginTop:"10px"}},l.createElement(i?t.CardHeader:t.CardSectionHeader,{style:{fontSize:"24px"}},""+r("BPA_FI_REPORT")),n.map((e,o)=>{var i,a,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)?""+r("BPA_FI_REPORT"):`${r("BPA_FI_REPORT")} - ${o+1}`),l.createElement(t.Row,{className:"border-none",label:""+r("BPA_FI_DATE_LABEL"),text:null!=e&&e.date?e.date.includes("-")?`${null===(i=e.date)||void 0===i?void 0:i.split("-")[2]}/${null===(a=e.date)||void 0===a?void 0:a.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:""+r("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:""+r(""+e.question),text:null!=e&&e.value?null==e?void 0:e.value:"NA"}),l.createElement(t.Row,{className:"border-none",label:""+r("BPA_ENTER_REMARKS"),text:e.remarks?e.remarks:"NA"})))),l.createElement(bl,{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 Dl(e){let{t:o,document:i,setNocDocuments:r,setError:a,nocDocuments:u}=e;const d=null==u?void 0:u.filter(e=>{var t;return null==e||null===(t=e.documentType)||void 0===t?void 0:t.includes(null==i?void 0:i.code)})[0],s=Digit.ULBService.getStateId(),[c,p]=n.useState(),[v,m]=n.useState(null),[f,E]=n.useState(()=>(null==d?void 0:d.fileStoreId)||null);return n.useEffect(()=>{var e,t;null!=i&&null!==(e=i.dropdownData)&&void 0!==e&&null!==(t=e[0])&&void 0!==t&&t.code&&r(e=>{var t;const n=null==e?void 0:e.filter(e=>{var t,n;return(null==e?void 0:e.documentType)!==(null==i||null===(t=i.dropdownData)||void 0===t||null===(n=t[0])||void 0===n?void 0:n.code)});return 0===(null==f?void 0:f.length)||null===f?n:[...null==n?void 0:n.filter(e=>(null==e?void 0:e.fileStoreId)!==f),{documentType:null==i||null===(t=i.dropdownData)||void 0===t?void 0:t[0].code,fileStoreId:f,documentUid:f,fileName:(null==v?void 0:v.name)||""}]})},[f]),n.useEffect(()=>{!function(){try{a(null);const e=function(){if(v){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(v.size>=5242880)a(o("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=v&&v.type&&!e.test(null==v?void 0:v.type))a(o("NOT_SUPPORTED_FILE_TYPE"));else{const e=_e(function(){return E(null),Promise.resolve(Digit.UploadServices.Filestorage("PT",v,Digit.ULBService.getStateId())).then(function(e){var t,n,l,i;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?E(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):a(o("CS_FILE_UPLOAD_ERROR"))})},function(){a(o("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[v]),l.createElement("div",{style:{}},l.createElement(t.LabelFieldPair,{style:{width:"98%",marginRight:"10px"}},l.createElement(t.CardLabel,{style:{width:"100%"}},null!=i&&i.required?o("TL_BUTTON_UPLOAD FILE")+"*":""+o("TL_BUTTON_UPLOAD FILE")),l.createElement("div",{className:"field",style:{width:"100%"}},l.createElement(t.MultiUploadWrapper,{module:"NOC",tenantId:s,getFormState:e=>(e=>{let t=Object.fromEntries(e),n=Object.values(t);!function(e){e&&m(e.file)}(n[n.length-1])})(e),t:o,allowedFileTypesRegex:/(.*?)(jpg|jpeg|png|image|pdf)$/i,allowedMaxSizeInMB:5,acceptFiles:"image/*, .pdf, .png, .jpeg, .jpg"}))))}const Nl=e=>{var o;let{t:i,noc:r,docs:a,isNoc:u,applicationData:d,NOCdata:s,bpaActionsDetails:c}=e;Digit.ULBService.getStateId();const p=Digit.ULBService.getStateId(),v=(null==d?void 0:d.status)||"",m=(null==c||null===(o=c.data)||void 0===o?void 0:o.nextActions)||[],{data:f}=Digit.Hooks.obps.useMDMS(p,"NOC",["DocumentTypeMapping"],{enabled:u}),{data:E}=Digit.Hooks.obps.useMDMS(p,"BPA",["DocTypeMapping"],{enabled:!u}),{data:y}=Digit.Hooks.obps.useMDMS(p,"common-masters",["DocumentType"]),[_,g]=n.useState([]),[h,S]=n.useState([]),[b,T]=n.useState(!1),[C,A]=Digit.Hooks.useSessionStorage(null==r?void 0:r.nocType,[]),[D,N]=n.useState(null),I=window.location.href.includes("/employee/");return n.useEffect(()=>{var e;g(null==y||null===(e=y["common-masters"])||void 0===e?void 0:e.DocumentType)},[y]),n.useEffect(()=>{var e,t,n;let l,o=[];var i,a,s,c;l=u?null==f||null===(i=f.NOC)||void 0===i||null===(a=i.DocumentTypeMapping)||void 0===a?void 0:a.filter(e=>(null==e?void 0:e.applicationType)===(null==r?void 0:r.applicationType)&&(null==e?void 0:e.nocType)===(null==r?void 0:r.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==r?void 0:r.additionalDetails,applicationStatus:null==r?void 0:r.applicationStatus,appNumberLink:null==r?void 0:r.applicationNo,nocNo:null==r?void 0:r.nocNo},o.push(l[0].docTypes[0]));let p=[];o&&o.length>0&&(o.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))}),p.push(e)}),S(p))},[f,_]),n.useEffect(()=>{T("NOC_VERIFICATION_INPROGRESS"===v&&(null==m?void 0:m.length)>0)},[d,c]),l.createElement("div",{style:{border:"1px solid #D6D5D4",padding:"16px 0px 16px 8px",background:"#FAFAFA",borderRadius:"5px",marginBottom:"24px",maxWidth:"950px"}},l.createElement(t.StatusTable,null,l.createElement(t.Row,{label:I?""+i(`BPA_${null==r?void 0:r.nocType}_HEADER`):i(`BPA_${null==r?void 0:r.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:I?""+i(null==e?void 0:e.title):i(null==e?void 0:e.title),text:i(null!=e&&e.value?null==e?void 0:e.value:"CS_NA"),textStyle:"APPROVED"==(null==e?void 0:e.value)||"AUTO_APPROVED"==(null==e?void 0:e.value)?{color:"#2E9E8F"}:{color:"#D83A2F"}}:{className:"border-none",label:I?""+i(null==e?void 0:e.title):i(null==e?void 0:e.title),text:i(null!=e&&e.value?null==e?void 0:e.value:"CS_NA")})})),l.createElement(bl,{documents:a,svgStyles:{width:"80px",height:"100px",viewBox:"0 0 25 25",minWidth:"80px"}}),b&&(null==h?void 0:h.map((e,t)=>l.createElement(Dl,{key:t,document:e,t:i,error:D,setError:N,setNocDocuments:A,nocDocuments:C,checkEnablingDocs:b}))))},Il=e=>{let{permissions:o,t:i}=e;const[r,a,u]=Digit.Hooks.useSessionStorage("OBPS_APPROVAL_CHECKS",null==o?void 0:o.map(e=>({label:e,checked:!1}))),[d,s,c]=Digit.Hooks.useSessionStorage("OBPS_NEW_APPROVALS",[]);n.useEffect(()=>()=>{Digit.SessionStorage.del("OBPS_NEW_APPROVALS"),Digit.SessionStorage.del("OBPS_APPROVAL_CHECKS")},[]);const p=window.Digit.Utils.browser.isMobile();return l.createElement("div",null,l.createElement(t.CardSubHeader,{style:{marginBottom:"16px",fontSize:"24px"}},i("BPA_PERMIT_CONDITIONS")),null==r?void 0:r.map((e,n)=>l.createElement(t.CheckBox,{key:n,styles:{margin:"20px 0 40px",maxWidth:p?"100%":"70%"},label:null==e?void 0:e.label,checked:null==e?void 0:e.checked,onChange:e=>((e,t,n)=>{const l=e.target.checked;a(()=>null==r?void 0:r.map((e,t)=>n===t?{...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 o;return t===l?{label:null==e||null===(o=e.target)||void 0===o?void 0:o.value}:n}))})(e,n),textInputStyle:{maxWidth:p?"96%":"830px",width:p?"96%":"830px"},style:p?{paddingRight:"10%"}:{},placeholder:i("BPA_ENTER_PERMIT_CONDITIONS_LABEL")}),l.createElement(t.LinkButton,{label:l.createElement("div",null,l.createElement("span",null,l.createElement(t.Close,{style:{float:"right",position:"relative",bottom:"32px",marginTop:"-22px",marginRight:p?"5%":"35%"}}))),style:{},onClick:e=>(e=>{const t=[...d];t.splice(e,1),s([...t])})(n)}))),l.createElement(t.LinkButton,{style:{color:"#a82227",maxWidth:p?"fit-content":"10%",marginRight:"3%"},label:i("BPA_ADD_MORE"),onClick:()=>{s([...d,{label:""}])}}))};function Ol(e){let{documents:i,svgStyles:r={},isSendBackFlow:a=!1}=e;const{t:u}=o.useTranslation(),[d,s]=n.useState(()=>[]),[c,p]=(Digit.ULBService.getCurrentTenantId(),n.useState({}));n.useEffect(()=>{var e;let t=[];null==i||i.forEach((e,n,l)=>{t=[...t,...e.values?e.values:[]]}),s(null===(e=t)||void 0===e?void 0:e.map(e=>null==e?void 0:e.fileStoreId))},[i]),n.useEffect(()=>{var e;null!=d&&d.length&&"BillAmend"===(null==i||null===(e=i[0])||void 0===e?void 0:e.BS)?Digit.UploadServices.Filefetch(d,Digit.ULBService.getCurrentTenantId()).then(e=>{p(null==e?void 0:e.data)}):null!=d&&d.length&&Digit.UploadServices.Filefetch(d,Digit.ULBService.getStateId()).then(e=>{p(null==e?void 0:e.data)})},[d]);const v=window.location.href.includes("employee/tl")||window.location.href.includes("/obps")||window.location.href.includes("employee/ws"),m=window.location.href.includes("stakeholder");return l.createElement("div",{style:{marginTop:"19px"}},!m&&(null==i?void 0:i.map((e,n)=>{var o;return l.createElement(l.Fragment,{key:n},null!=e&&e.title?l.createElement(t.CardSubHeader,{style:v?{marginTop:"32px",marginBottom:"18px",color:"#0B0C0C, 100%",fontSize:"24px",lineHeight:"30px"}:{marginTop:"32px",marginBottom:"8px",color:"#505A5F",fontSize:"24px"}},u(null==e?void 0:e.title)):null,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((e,n)=>{var o,i;return l.createElement("a",{target:"_",href:null===(o=c[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:v?{marginTop:"8px",fontWeight:"bold",fontSize:"16px",lineHeight:"19px",color:"#505A5F",textAlign:"center"}:{marginTop:"8px",fontWeight:"bold"}},u(null==e?void 0:e.title)),a?null!=e&&null!==(i=e.documentType)&&void 0!==i&&i.includes("NOC")?l.createElement("p",{style:{textAlign:"center"}},u(null==e?void 0:e.documentType.split(".")[1])):l.createElement("p",{style:{textAlign:"center"}},u(null==e?void 0:e.documentType)):"")}):!window.location.href.includes("citizen")&&l.createElement("div",null,l.createElement("p",null,u("BPA_NO_DOCUMENTS_UPLOADED_LABEL")))))})),m&&(null==i?void 0:i.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"}},u(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)=>{var o;return l.createElement("a",{target:"_",href:null===(o=c[e.fileStoreId])||void 0===o?void 0:o.split(",")[0],style:{minWidth:null!=r&&r.minWidth?null==r?void 0:r.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"}},u(null==e?void 0:e.title)),null!=e&&e.docInfo?l.createElement("div",{style:{fontSize:"12px",color:"#505A5F",fontWeight:400,lineHeight:"15px",marginBottom:"10px"}},""+u(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"}},""+u(null==e?void 0:e.title))))}):!window.location.href.includes("citizen")&&l.createElement("div",null,l.createElement("p",null,u("BPA_NO_DOCUMENTS_UPLOADED_LABEL")))))})))}function Pl(e){let{taxHeadEstimatesCalculation:n}=e;const{taxHeadEstimates:i}=n,{t:r}=o.useTranslation();return l.createElement("div",{style:{marginTop:"40px"}},l.createElement(t.StatusTable,null,l.createElement(t.Row,{label:r("ES_PT_TITLE_TAX_HEADS"),text:r("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:r(e.taxHeadCode),label:r(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:r("ES_PT_TITLE_TOTAL_DUE_AMOUNT"),text:"₹ "+(null==n?void 0:n.totalAmount)||"N/A",className:"border-none",textStyle:{fontSize:"24px",fontWeight:"bold"}})))}function wl(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 Rl(e){let{owners:n}=e,i={};i=window.location.href.includes("/employee/pt/")?n.slice().reverse():n;const{t:r}=o.useTranslation(),a=(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(a)>1?u={marginTop:"19px",background:"#FAFAFA",border:"1px solid #D6D5D4",borderRadius:"4px",padding:"8px",lineHeight:"19px",maxWidth:"600px",minWidth:"280px"}:Number(a)>1||(u={marginTop:"19px",lineHeight:"19px",maxWidth:"600px",minWidth:"280px"},d={position:"relative",marginTop:"19px"}),window.location.href.includes("obps")&&(u={...u,maxWidth:"950px"},u={...u,maxWidth:"950px"},s={}),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 o;return l.createElement("div",{key:r(null==e?void 0:e.title),style:u,className:"owner-details-child"},l.createElement(t.CardSubHeader,{style:Number(a)>1?{marginBottom:"8px",paddingBottom:"9px",color:"#0B0C0C",fontSize:"16px",lineHeight:"19px"}:{marginBottom:"8px",color:"#505A5F",fontSize:"24px"}},Number(a)>1?`${r(null==e?void 0:e.title)} ${n+1}`:r(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===(o=e.values)||void 0===o?void 0:o.map((e,n)=>{var o;return!0===e.map&&"N/A"!==e.value?l.createElement(t.Row,{key:r(e.title),label:r(e.title),text:l.createElement("img",{src:r(e.value),alt:"",privacy:null==e?void 0:e.privacy})}):l.createElement("span",null,l.createElement(t.Row,{key:r(e.title),label:""+r(e.title),text:r(e.value)||"N/A",last:n===(null==e||null===(o=e.values)||void 0===o?void 0:o.length)-1,caption:e.caption,className:"border-none",textStyle:e.textStyle,privacy:null==e?void 0:e.privacy,rowContainerStyle:s}))}))))})))}const Ll=e=>{var i,r,a;let{scrutinyDetails:u,paymentsList:d=[]}=e;const{t:s}=o.useTranslation(),c=e=>null!=e&&e.value&&null!=e&&e.isTransLate?l.createElement("span",{style:{color:"#2E9E8F"}},s(null==e?void 0:e.value)):null!=e&&e.value&&null!=e&&e.isTransLate?s(null==e?void 0:e.value):null!=e&&e.value?null==e?void 0:e.value:void s("NA");return l.createElement(n.Fragment,null,!(null!=u&&u.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==u||null===(i=u.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:""+s(""+e.title),text:null!=e&&e.value?`${c(e)} ${s(null==e?void 0:e.isUnit)}`:s("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:""+s(""+e.title),text:c(e),labelStyle:null!=e&&e.isHeader?{fontSize:"20px"}:{}}):l.createElement(t.CardSubHeader,{style:{fontSize:"20px",paddingBottom:"10px",margin:"0px"}},s(null==e?void 0:e.title)):l.createElement(t.CardSubHeader,{style:{fontSize:"20px",paddingBottom:"10px"}},s(null==e?void 0:e.title))),null==u||null===(r=u.permit)||void 0===r?void 0:r.map((e,n)=>l.createElement(t.CardLabel,{style:{fontWeight:"400"}},null==e?void 0:e.title))),l.createElement("div",null,null==u||null===(a=u.scruntinyDetails)||void 0===a?void 0:a.map((e,o)=>l.createElement(n.Fragment,null,l.createElement(t.Row,{className:"border-none",label:""+s(null==e?void 0:e.title),labelStyle:{width:"150%"}}),l.createElement("a",{href:null==e?void 0:e.value}," ",l.createElement(t.PDFSvg,null)," "),l.createElement("p",{style:{margin:"8px 0px",fontWeight:"bold",fontSize:"16px",lineHeight:"19px",color:"#505A5F"}},s(null==e?void 0:e.text))))))))},xl=e=>{var i,r,a,u,d;let{edcrDetails:s,applicationData:c}=e;const{t:p}=o.useTranslation(),v=window.Digit.Utils.browser.isMobile(),m=[{name:"BPA_TABLE_COL_FLOOR",id:"Floor"},{name:"BPA_TABLE_COL_LEVEL",id:"Level"},{name:"BPA_TABLE_COL_OCCUPANCY",id:"Occupancy"},{name:"BPA_TABLE_COL_BUILDUPAREA",id:"BuildupArea"},{name:"BPA_TABLE_COL_FLOORAREA",id:"FloorArea"},{name:"BPA_TABLE_COL_CARPETAREA",id:"CarpetArea"}],f=e=>{const t=e;return(e,n,l)=>e[t]},E=n.useMemo(()=>m.map(e=>({Header:p(""+e.name),accessor:f(e.id),id:e.id})));function y(e){var t;let n=[];return null==e||null===(t=e.building)||void 0===t||t.floors.map(e=>{var t,l,o,i,r,a,u,d;n.push({Floor:p("BPA_FLOOR_NAME_"+e.number),Level:e.number,Occupancy:p(""+(null===(t=e.occupancies)||void 0===t||null===(l=t[0])||void 0===l?void 0:l.type)),BuildupArea:null===(o=e.occupancies)||void 0===o||null===(i=o[0])||void 0===i?void 0:i.builtUpArea,FloorArea:(null===(r=e.occupancies)||void 0===r||null===(a=r[0])||void 0===a?void 0:a.floorArea)||0,CarpetArea:(null===(u=e.occupancies)||void 0===u||null===(d=u[0])||void 0===d?void 0:d.CarpetArea)||0,key:p("BPA_FLOOR_NAME_"+e.number)})}),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 o,i;let t=null===(o=n[e])||void 0===o||null===(i=o.usageCategory)||void 0===i?void 0:i.split(",");null!=t&&t.length&&(l=t.map(e=>e?""+p("BPA_SUBOCCUPANCYTYPE_"+function(e,t,n){if(void 0===e&&(e=""),void 0===t&&(t=""),void 0===n&&(n=""),""==t)return e;for(;e.includes(t);)e=e.replace(t,n);return e}(null==e?void 0:e.toUpperCase(),"-","_")):"NA").join(", "))}return l||"NA"}return l.createElement(n.Fragment,null,l.createElement("div",{style:{background:"#FAFAFA",border:"1px solid #D6D5D4",padding:"8px",borderRadius:"4px",maxWidth:"950px",minWidth:"280px"}},l.createElement(t.StatusTable,null,null==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"}},p(null==e?void 0:e.title)):l.createElement(t.Row,{className:"border-none",labelStyle:{width:"100%",fontSize:"20px"},key:""+e.title,label:""+p(""+e.title),text:null!=e&&e.value?null==e?void 0:e.value:""}))),null==s||null===(r=s.subOccupancyTableDetails)||void 0===r||null===(a=r[0])||void 0===a||null===(u=a.value)||void 0===u||null===(d=u.planDetail)||void 0===d?void 0:d.blocks.map((e,n)=>{var o,i,r,a,u;return l.createElement("div",{key:n,style:(null==s||null===(o=s.subOccupancyTableDetails)||void 0===o||null===(i=o[0])||void 0===i||null===(r=i.value)||void 0===r||null===(a=r.planDetail)||void 0===a||null===(u=a.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"}},p("BPA_BLOCK_SUBHEADER")," ",n+1),l.createElement(t.StatusTable,null,l.createElement(t.Row,{className:"border-none",textStyle:{wordBreak:"break-word"},label:""+p("BPA_SUB_OCCUPANCY_LABEL"),text:_(n)})),l.createElement("div",{style:window.location.href.includes("citizen")||v?{overflow:"scroll"}:{maxWidth:"950px",maxHeight:"280px"}},l.createElement(t.Table,{className:"customTable table-fixed-first-column table-border-style",t:p,disableSort:!1,autoSort:!0,manualPagination:!1,isPaginationRequired:!1,initSortId:"S N ",data:y(e),columns:E,getCellProps:e=>({style:{}})})))})))},Ml=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))},Fl=e=>{var n,i,r;let{data:a,OpenImage:u,privacy:d={}}=e;const{t:s}=o.useTranslation();return l.createElement("div",null,a.date&&l.createElement("p",null,a.date),l.createElement("p",null,a.name),a.mobileNumber&&l.createElement("span",{style:{display:"inline-flex",width:"fit-content",marginLeft:"10px"}},l.createElement(t.TelePhone,{mobile:a.mobileNumber,privacy:d}),l.createElement("p",null,"    ")),a.source&&l.createElement("p",null,s("ES_APPLICATION_DETAILS_APPLICATION_CHANNEL_"+a.source.toUpperCase())),a.comment&&l.createElement(Ml,{otherComment:null==a?void 0:a.otherComment,headComment:null==a?void 0:a.comment}),null!=a&&a.wfComment?l.createElement("div",null,null==a||null===(n=a.wfComment)||void 0===n?void 0:n.map((e,t)=>l.createElement("div",{className:"TLComments",key:t},l.createElement("h3",null,s("WF_COMMON_COMMENTS")),l.createElement("p",{style:{overflowX:"scroll"}},e)))):null,(null==a||null===(i=a.thumbnailsToShow)||void 0===i||null===(r=i.thumbs)||void 0===r?void 0:r.length)>0?l.createElement("div",{className:"TLComments"},l.createElement("h3",null,s("CS_COMMON_ATTACHMENTS")),l.createElement(t.DisplayPhotos,{srcs:null==a?void 0:a.thumbnailsToShow.thumbs,onClick:(e,t)=>{u(e,t,null==a?void 0:a.thumbnailsToShow)}})):null)};function kl(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 Ul(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 Bl=e=>{var n,i,r,a;let{wsAdditionalDetails:u}=e;const{t:d}=o.useTranslation();let s=(c=location.search)?(/^[?#]/.test(c)?c.slice(1):c).split("&").reduce((e,t)=>{let[n,l]=t.split("=");return e[n]=l?decodeURIComponent(l.replace(/\+/g," ")):"",e},{}):{};var c;const p=null==s?void 0:s.mode;var{connectionDetails:v,plumberDetails:m,roadCuttingDetails:f,activationDetails:E}=(null==u?void 0:u.additionalDetails)||{connectionDetails:[],plumberDetails:[]};return l.createElement(l.Fragment,null,l.createElement("div",{style:{lineHeight:"19px",maxWidth:"950px",minWidth:"280px"}},(null==u||null===(n=u.additionalDetails)||void 0===n?void 0:n.connectionDetails)&&l.createElement(t.StatusTable,null,l.createElement(t.CardSubHeader,{style:{fontSize:"24px",marginBottom:"16px",marginTop:"32px"}},d("WS_COMMON_CONNECTION_DETAIL")),l.createElement("div",null,l.createElement("div",{className:"connection-details-new-value-wrapper"},null==v?void 0:v.map((e,n)=>l.createElement("div",{key:n},l.createElement(t.Row,{className:"border-none",key:""+e.title,label:""+d(""+e.title),text:null!=e&&e.oldValue?null==e?void 0:e.oldValue:null!=e&&e.value?null==e?void 0:e.value:""})))))),(null==u||null===(i=u.additionalDetails)||void 0===i?void 0:i.plumberDetails)&&"MODIFY"!=p&&l.createElement(t.StatusTable,null,l.createElement(t.CardSubHeader,{style:{fontSize:"24px",marginBottom:"16px",marginTop:"32px"}},d("WS_COMMON_PLUMBER_DETAILS")),l.createElement("div",null,l.createElement("div",{className:"plumber-details-new-value-wrapper"},null==m?void 0:m.map((e,n)=>l.createElement(t.Row,{className:"border-none",key:""+e.title,label:""+d(""+e.title),text:null!=e&&e.oldValue?null==e?void 0:e.oldValue:null!=e&&e.value?null==e?void 0:e.value:"",privacy:e.privacy}))))),(null==u||null===(r=u.additionalDetails)||void 0===r?void 0:r.roadCuttingDetails)&&"MODIFY"!=p&&l.createElement(t.StatusTable,null,l.createElement(t.CardSubHeader,{style:{fontSize:"24px",marginBottom:"16px",marginTop:"32px"}},d("WS_ROAD_CUTTING_DETAILS")),l.createElement("div",null,l.createElement("div",{className:"plumber-details-new-value-wrapper"},null==f?void 0:f.map((e,n)=>{var o;return l.createElement("div",{key:n,style:(null==f?void 0:f.length)>1?{border:"1px solid #D6D5D4",background:"#FAFAFA",borderRadius:"4px",padding:"10px 10px 0px 10px",margin:"5px 0px"}:{}},null==e||null===(o=e.values)||void 0===o?void 0:o.map(e=>l.createElement(t.Row,{className:"border-none",key:""+e.title,label:""+d(""+e.title),text:null!=e&&e.oldValue?null==e?void 0:e.oldValue:null!=e&&e.value?null==e?void 0:e.value:""})))})))),(null==u||null===(a=u.additionalDetails)||void 0===a?void 0:a.activationDetails)&&l.createElement(t.StatusTable,null,l.createElement(t.CardSubHeader,{style:{fontSize:"24px",marginBottom:"16px",marginTop:"32px"}},d("WS_ACTIVATION_DETAILS")),l.createElement("div",null,l.createElement("div",{className:"plumber-details-new-value-wrapper"},null==E?void 0:E.map((e,n)=>l.createElement(t.Row,{className:"border-none",key:""+e.title,label:""+d(""+e.title),text:null!=e&&e.oldValue?null==e?void 0:e.oldValue:null!=e&&e.value?null==e?void 0:e.value:""})))))))},jl=[{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"}],Hl=[{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"}],Wl=e=>{var i,r,a,u;let{wsAdditionalDetails:d}=e;const{t:s}=o.useTranslation(),[c,p,v]=Digit.Hooks.useSessionStorage("ADHOC_ADD_REBATE_DATA",{}),[m,f,E]=Digit.Hooks.useSessionStorage("ADHOC_BILL_ADD_REBATE_DATA",{}),y=!(null==d||null===(i=d.additionalDetails)||void 0===i||!i.isPaid),[g,h]=n.useState(!1),[S,b]=n.useState(c||{}),[T,C]=n.useState(null),[D,N]=n.useState(d.additionalDetails.data?d.additionalDetails.data:{}),[I,O]=n.useState(d.additionalDetails.values?d.additionalDetails.values:[]),P=Digit.ULBService.getStateId();Digit.Hooks.ws.useMDMS(P,"BillingService",["TaxHeadMaster"]),n.useEffect(()=>{var e,t,n;const o={...null==d||null===(e=d.additionalDetails)||void 0===e||null===(t=e.appDetails)||void 0===t?void 0:t.additionalDetails};if((null==c||null===(n=c.billDetails)||void 0===n?void 0:n.length)>0){var i,r,a,u,s,v,m;const e=[{title:"WS_APPLICATION_FEE_HEADER",value:l.createElement("span",null,"₹",null==c||null===(i=c.billDetails)||void 0===i||null===(r=i[0])||void 0===r?void 0:r.fee)},{title:"WS_SERVICE_FEE_HEADER",value:l.createElement("span",null,"₹",null==c||null===(a=c.billDetails)||void 0===a||null===(u=a[0])||void 0===u?void 0:u.charge)},{title:"WS_TAX_HEADER",value:l.createElement("span",null,"₹",null==c||null===(s=c.billDetails)||void 0===s||null===(v=s[0])||void 0===v?void 0:v.taxAmount)}];O(e),N(null==c||null===(m=c.billDetails)||void 0===m?void 0:m[0])}else p(o),b(o)},[]);let w={};const R=e=>l.createElement("h1",{className:"heading-m"},e.label),L=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),x=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(L,null)),M=function(e,t,n){void 0===t&&(t=!1);let l={...S};if("adhocPenalty"!=e&&"adhocRebate"!=e||!n.target.value)t?(l[e+"_data"]=n,l[e]=n.title,"PT_OTHERS"==n.title&&"adhocPenaltyReason"==e&&(l.adhocPenaltyComment=""),"PT_OTHERS"==n.title&&"adhocRebateReason"==e&&(l.adhocRebateComment="")):l[e]=n.target.value;else{var o,i;const t=0==(null==n||null===(o=n.target)||void 0===o?void 0:o.value)?1:Math.sign(null==n||null===(i=n.target)||void 0===i?void 0:i.value)||-1;l[e]=1==t?n.target.value:""}b(l)};return l.createElement(n.Fragment,null,l.createElement("div",{style:{lineHeight:"19px",maxWidth:"100%",minWidth:"280px"}},I&&l.createElement(t.StatusTable,null,l.createElement("div",null,null==I?void 0:I.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(y?"WS_COMMON_PAID_LABEL":"WS_COMMON_NOT_PAID"),textStyle:y?{color:"#2E9E8F"}:{color:"#D83A2F"}}))),null!=d&&null!==(r=d.additionalDetails)&&void 0!==r&&r.isAdhocRebate?l.createElement("div",{onClick:e=>{h(!0)}},l.createElement("span",{className:"add-details-link hover-button",style:{cursor:"pointer",color:"#a82227"}},s("WS_PAYMENT_ADD_REBATE_PENALTY"))):null,g&&l.createElement(t.Modal,{headerBarMain:l.createElement(R,{label:s("PT_ADD_REBATE_PENALITY")}),headerBarEnd:l.createElement(x,{onClick:()=>{b(c),h(!1)}}),actionCancelLabel:s("PT_CANCEL"),actionCancelOnSubmit:()=>{b(c),h(!1)},actionSaveLabel:s("PT_ADD"),actionSaveOnSubmit:e=>(e=>{const t=null!=S&&S.adhocPenalty?Number(null==S?void 0:S.adhocPenalty):0,n=null!=S&&S.adhocRebate?Number(null==S?void 0:S.adhocRebate):0;var l,o;if(t||n)if(n>(null==d||null===(l=d.additionalDetails)||void 0===l||null===(o=l.data)||void 0===o?void 0:o.totalAmount))C({isError:!1,isWarning:!0,key:"error",message:s("ERR_WS_REBATE_GREATER_THAN_AMOUNT")});else{var i,r,a,u,c,v,m,E,y,g;const e=null==d||null===(i=d.additionalDetails)||void 0===i||null===(r=i.appDetails)||void 0===r?void 0:r.applicationNo,t=null==d||null===(a=d.additionalDetails)||void 0===a||null===(u=a.appDetails)||void 0===u?void 0:u.tenantId,n={...null==d||null===(c=d.additionalDetails)||void 0===c||null===(v=c.appDetails)||void 0===v?void 0:v.additionalDetails,...S};d.additionalDetails.appDetails.additionalDetails=n;const l={CalculationCriteria:"WATER"==(null==d||null===(m=d.additionalDetails)||void 0===m||null===(E=m.appDetails)||void 0===E?void 0:E.service)?[{applicationNo:e,tenantId:t,waterConnection:d.additionalDetails.appDetails}]:[{applicationNo:e,tenantId:t,sewerageConnection:d.additionalDetails.appDetails}],isconnectionCalculation:!1};let o="WATER"==(null==d||null===(y=d.additionalDetails)||void 0===y||null===(g=y.appDetails)||void 0===g?void 0:g.service)?"WS":"SW";Digit.WSService.wsCalculationEstimate(l,o).then((e,t)=>{var n,l,o,i,r,a,u,d,s,c,v,m,E,y,g;(null==e||null===(n=e.Calculation)||void 0===n||null===(l=n[0])||void 0===l||null===(o=l.taxHeadEstimates)||void 0===o?void 0:o.length)>0&&(null==e||null===(E=e.Calculation)||void 0===E||null===(y=E[0])||void 0===y||null===(g=y.taxHeadEstimates)||void 0===g||g.forEach(e=>e.amount=e.estimateAmount)),e.Calculation[0].billSlabData=_.groupBy(null==e||null===(i=e.Calculation)||void 0===i||null===(r=i[0])||void 0===r?void 0:r.taxHeadEstimates,"category");const b=[{title:"WS_APPLICATION_FEE_HEADER",value:null===(a=e.Calculation)||void 0===a||null===(u=a[0])||void 0===u?void 0:u.fee},{title:"WS_SERVICE_FEE_HEADER",value:null===(d=e.Calculation)||void 0===d||null===(s=d[0])||void 0===s?void 0:s.charge},{title:"WS_TAX_HEADER",value:null===(c=e.Calculation)||void 0===c||null===(v=c[0])||void 0===v?void 0:v.taxAmount}];f($n(e.Calculation[0])),N(null==e||null===(m=e.Calculation)||void 0===m?void 0:m[0]),O(b),S.billDetails=null==e?void 0:e.Calculation,p(S),h(!1)}).catch(e=>{var t,n,l,o,i,r;C({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===(o=e.response)||void 0===o||null===(i=o.data)||void 0===i||null===(r=i.Errors[0])||void 0===r?void 0:r.code)):s("PT_COMMON_ADD_REBATE_PENALITY")})})}else C({isError:!1,isWarning:!0,key:"warning",message:s("ERR_WS_ENTER_ATLEAST_ONE_FIELD")})})(),hideSubmit:!1,popupStyles:{overflowY:"auto",background:"#f0f3f7"}},l.createElement("div",{style:{display:"flex",flexDirection:"column",gap:"16px"}},l.createElement(t.Card,null,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.LabelFieldPair,null,l.createElement(t.CardLabel,null,s("PT_TX_HEADS")),l.createElement("div",{className:"field"},l.createElement(t.Dropdown,{isMandatory:!0,option:jl,optionKey:"title",select:e=>M("adhocPenaltyReason",!0,e),selected:(null==S?void 0:S.adhocPenaltyReason_data)||"",isPropertyAssess:!0,name:"adhocPenaltyReason_data",t:s}))),"PT_OTHERS"===(null==S||null===(a=S.adhocPenaltyReason_data)||void 0===a?void 0:a.title)&&l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,s("PT_REASON")),l.createElement("div",{className:"field"},l.createElement(t.TextInput,A({style:{background:"#FAFAFA"},t:s,type:"text",isMandatory:!1,name:"adhocPenaltyComment",value:(null==S?void 0:S.adhocPenaltyComment)||"",onChange:e=>M("adhocPenaltyComment",!1,e)},w={isRequired:!0,pattern:"^[a-zA-Z ]*$",type:"text",title:s("TL_NAME_ERROR_MESSAGE")})))),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,s("PT_HEAD_AMT")),l.createElement("div",{className:"field"},l.createElement(t.TextInput,A({style:{background:"#FAFAFA"},t:s,type:"number",isMandatory:!1,name:"adhocPenalty",value:(null==S?void 0:S.adhocPenalty)||"",onChange:e=>M("adhocPenalty",!1,e)},w={isRequired:!0,pattern:"^[1-9]+[0-9]*$",title:s("ERR_DEFAULT_INPUT_FIELD_MSG")}))))),l.createElement(t.Card,null,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.LabelFieldPair,null,l.createElement(t.CardLabel,null,s("PT_TX_HEADS")),l.createElement("div",{className:"field"},l.createElement(t.Dropdown,{isMandatory:!0,option:Hl,optionKey:"title",select:e=>M("adhocRebateReason",!0,e),selected:(null==S?void 0:S.adhocRebateReason_data)||"",name:"adhocRebateReason_data",isPropertyAssess:!0,t:s}))),"PT_OTHERS"===(null==S||null===(u=S.adhocRebateReason_data)||void 0===u?void 0:u.title)&&l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,s("PT_REASON")),l.createElement(t.TextInput,A({style:{background:"#FAFAFA"},t:s,type:"text",isMandatory:!1,name:"adhocRebateComment",value:(null==S?void 0:S.adhocRebateComment)||"",onChange:e=>M("adhocRebateComment",!1,e)},w={isRequired:!0,pattern:"^[a-zA-Z ]*$",type:"text",title:s("TL_NAME_ERROR_MESSAGE")}))),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,s("PT_HEAD_AMT")),l.createElement("div",{className:"field"},l.createElement(t.TextInput,A({style:{background:"#FAFAFA"},t:s,type:"number",isMandatory:!1,name:"adhocRebate",value:(null==S?void 0:S.adhocRebate)||"",onChange:e=>M("adhocRebate",!1,e)},w={isRequired:!0,pattern:"^[1-9]+[0-9]*$",title:s("ERR_DEFAULT_INPUT_FIELD_MSG")}))))))),T&&l.createElement(t.Toast,{style:{zIndex:"10000"},warning:null==T?void 0:T.isWarning,error:null==T||!T.isWarning,label:s(null==T?void 0:T.message),onClose:()=>{C(!1)},isDleteBtn:!0})))},Vl=e=>{let{style:t}=e;return l.createElement("span",null,l.createElement("svg",{style:{...t},display:"inline",width:"22",height:"16",viewBox:"0 0 22 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l.createElement("path",{d:"M11 0.5C6 0.5 1.73 3.61 0 8C1.73 12.39 6 15.5 11 15.5C16 15.5 20.27 12.39 22 8C20.27 3.61 16 0.5 11 0.5ZM11 13C8.24 13 6 10.76 6 8C6 5.24 8.24 3 11 3C13.76 3 16 5.24 16 8C16 10.76 13.76 13 11 13ZM11 5C9.34 5 8 6.34 8 8C8 9.66 9.34 11 11 11C12.66 11 14 9.66 14 8C14 6.34 12.66 5 11 5Z",fill:"#a82227"})))},zl=e=>{let{t:n,userType:o=!1,infoBannerLabel:i="",infoClickLable:r="",infoClickInfoLabel:a="",infoClickInfoLabel1:u=""}=e;o=o||Digit.SessionStorage.get("userType");const d=window.Digit.Utils.browser.isMobile();return l.createElement(l.Fragment,null,l.createElement("div",{style:d?{}:{width:"80%"}},l.createElement("div",{className:"info-banner-wrap",style:{color:"#3498DB",margin:"0px"}},l.createElement("div",null,l.createElement(t.InfoBannerIcon,null),l.createElement("h2",{style:{color:"#3498DB"}},n(i))),n(r)+" ",l.createElement(Vl,{style:{display:"inline",marginBottom:"5px"}})," "+n(a),l.createElement("div",null," "+n(u)))))},$l=e=>{var i,r,a,u,d,s,c;let{wsAdditionalDetails:p}=e;const{t:v}=o.useTranslation(),[m,f]=n.useState(!1),[E,y]=n.useState({}),_=e=>l.createElement("h1",{className:"heading-m"},e.label),g=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),h=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(g,null));return l.createElement(n.Fragment,null,l.createElement("div",{style:{lineHeight:"19px",maxWidth:"950px",minWidth:"280px"}},null!=p&&null!==(i=p.additionalDetails)&&void 0!==i&&i.isViewBreakup?l.createElement("div",{onClick:e=>(()=>{var e;let t=p.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),y(t),f(!0)})(),style:{marginTop:"12px"}},l.createElement("span",{className:"add-details-link hover-button"},v("WS_PAYMENT_VIEW_BREAKUP"))):null,m&&l.createElement(t.Modal,{headerBarMain:l.createElement(_,{label:v("WS_CALCULATION_BREAKUP")}),headerBarEnd:l.createElement(h,{onClick:()=>{f(!1)}}),hideSubmit:!0,popupStyles:{overflowY:"auto"},headerBarMainStyle:{marginBottom:"0px"},popupModuleMianStyles:{paddingTop:"0px"}},l.createElement(t.StatusTable,{style:{padding:"10px",paddingTop:"0px"}},l.createElement(t.CardSectionHeader,{style:{margin:"10px 0px"}},v("WS_APPLICATION_FEE_HEADER")),null==E||null===(r=E.billSlabData)||void 0===r||null===(a=r.FEE)||void 0===a?void 0:a.map(e=>l.createElement(t.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:""+(null==e?void 0:e.taxHeadCode),label:""+v(""+(null==e?void 0:e.taxHeadCode)),text:l.createElement("span",null,"₹",Number(null==e?void 0:e.amount)||0),textStyle:{textAlign:"right"}})),l.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",marginBottom:"10px"}}),l.createElement(t.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:"PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT1",label:""+v("PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT"),text:l.createElement("span",null,"₹",Number(null==E?void 0:E.fee)||0),textStyle:{textAlign:"right",fontWeight:"700",fontSize:"24px"}}),l.createElement(t.CardSectionHeader,{style:{margin:"10px 0px"}},v("WS_SERVICE_FEE_HEADER")),null==E||null===(u=E.billSlabData)||void 0===u||null===(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:""+v(""+(null==e?void 0:e.taxHeadCode)),text:l.createElement("span",null,"₹",Number(null==e?void 0:e.amount)||0),textStyle:{textAlign:"right"}})),l.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",marginBottom:"10px"}}),l.createElement(t.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:"PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT2",label:""+v("PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT"),text:l.createElement("span",null,"₹",Number(null==E?void 0:E.charge)||0),textStyle:{textAlign:"right",fontWeight:"700",fontSize:"24px"}}),null==E||null===(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:""+v(""+(null==e?void 0:e.taxHeadCode)),text:l.createElement("span",null,"₹",Number(null==e?void 0:e.amount)||0),textStyle:{textAlign:"right"}})),l.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",marginBottom:"10px"}}),l.createElement(t.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:"PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT3",label:""+v("PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT"),text:l.createElement("span",null,"₹",Number(null==E?void 0:E.totalAmount)||0),textStyle:{textAlign:"right",fontWeight:"700",fontSize:"24px"}})))))},Yl={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:{}},Kl=e=>{let{className:t="table",headers:n=[],values:i=[],arrears:r=0}=e;const{t:a}=o.useTranslation();return l.createElement(l.Fragment,null,l.createElement("div",{style:Yl.root},l.createElement("table",{className:"table-fixed-column-common-pay",style:Yl.table},l.createElement("thead",null,l.createElement("tr",null,l.createElement("th",{style:{...Yl.cell,...Yl.cellLeft,...Yl.cellHeader}},a("CS_BILL_PERIOD")),n.map((e,t)=>l.createElement("th",{style:{...Yl.cell,...n.length==t+1?Yl.cellRight:{},...Yl.cellHeader},key:t},a(e))))),l.createElement("tbody",null,Object.values(i).map((e,t)=>l.createElement("tr",{key:t},l.createElement("td",{style:{...Yl.cell,...Yl.cellLeft},component:"th",scope:"row"},Object.keys(i)[t]),n.map((t,o)=>l.createElement("td",{style:{...Yl.cell,textAlign:"left",...n.length==o+1?Yl.cellRight:{},whiteSpace:"pre"},key:o,numeric:!0},o>1&&"₹",e[t]&&e[t].value||"0")))),l.createElement("tr",null,l.createElement("td",{style:{...Yl.cell,...Yl.cellLeft}}),n.map((e,t)=>t==n.length-1?l.createElement("td",{style:{...Yl.cell,...Yl.cellRight,textAlign:"left",fontWeight:"700",whiteSpace:"pre"},key:t,numeric:!0},r):t==n.length-2?l.createElement("td",{style:{...Yl.cell,textAlign:"left"},key:t,numeric:!0},a("COMMON_ARREARS_TOTAL")):l.createElement("td",{style:Yl.cell,key:t,numeric:!0})))))))},ql={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))"}},Gl=e=>{var t,i,r;let{bill:a={}}=e;const{t:u}=o.useTranslation();let d={},s=(null==a||null===(t=a.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)=>0===n?e:e+t.amount,0))||0;let p="₹ "+((null==c||null===(r=c.toFixed)||void 0===r?void 0:r.call(c,0))||Number(0).toFixed(0));s.shift(),s.map(e=>{let t=function(e){var t,n,l;void 0===e&&(e={});let o={};const{billAccountDetails:i=[]}=e;return i.map(e=>{o[e.taxHeadCode]={value:e.amount,order:e.order}}),o.CS_BILL_NO={value:(null===(t=e)||void 0===t?void 0:t.billNumber)||"NA",order:-2},o.CS_BILL_DUEDATE={value:(null===(n=e)||void 0===n?void 0:n.expiryDate)&&new Date(null===(l=e)||void 0===l?void 0:l.expiryDate).toLocaleDateString()||"NA",order:-1},o.TL_COMMON_TOTAL_AMT={value:e.amount,order:10},o}(e);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 v={};!d||Object.keys(d).map((e,t)=>{Object.keys(d[e]).map(t=>{v[t]=d[e]&&d[e][t]&&d[e][t].order||0})});let m=[];m=Object.keys(v),m.sort((e,t)=>v[e]-v[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:ql.headerStyle},u("CS_ARREARS_DETAILS")),f&&l.createElement(Kl,{headers:[...m],values:d,arrears:p}),!f&&l.createElement("div",{style:ql.buttonStyle},l.createElement("button",{type:"button",onClick:()=>{E(!0)}},u("CS_SHOW_CARD"))),f&&l.createElement("div",{style:ql.buttonStyle},l.createElement("button",{type:"button",onClick:()=>{E(!1)}},u("CS_HIDE_CARD"))))},Zl=()=>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"})),Xl=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(Zl,null)),Jl=e=>{let{t:n,closeModal:o}=e;console.log(" ----- Renew POP coming "),Digit.Hooks.sv.useCreateDemand();const r=i.useHistory();return l.createElement(l.Fragment,null,l.createElement(t.Modal,{headerBarMain:l.createElement(e=>l.createElement("h1",{className:"heading-m"},e.label),{label:"SV_WANT_TO_EDIT"}),headerBarEnd:l.createElement(Xl,{onClick:o}),actionCancelLabel:n("CS_COMMON_BACK"),actionCancelOnSubmit:o,hideSubmit:!0,formId:"modal-action"},l.createElement(t.Card,{style:{boxShadow:"none"}},l.createElement("div",{style:{display:"flex",justifyContent:"center",gap:"20px",flexDirection:"column",alignItems:"center"}},l.createElement(t.SubmitBar,{label:n("SV_YES_PROCEED_WITH_APPLICATION"),onSubmit:()=>{r.push("renew-application/info")}}),l.createElement(t.SubmitBar,{label:n("SV_NO_PROCEED_PAYEMNT"),onSubmit:()=>{console.log(" testing coming compilter"),r.push("renew-application/check/makePayment")}})))))};function Ql(e){var r,a,u,d,s,c,p,v,m,f,E,y,g,h;let{applicationDetails:S,workflowDetails:b,isDataLoading:T,applicationData:C,timelineStatusPrefix:A,showTimeLine:D=!0,statusAttribute:N="status",paymentsList:I,oldValue:O,isInfoLabel:P=!1}=e;const{t:w}=o.useTranslation(),[R,L]=n.useState(!1);let{id:x}=i.useParams();function M(e,t,n){var l;window.open(null==n||null===(l=n.fullImage)||void 0===l?void 0:l[0],"_blank")}const[F,k]=n.useState({}),[U,B]=n.useState({loading:!1,loaded:!1,canLoad:!1});"ACTIVE"!==(null==C?void 0:C.status)||U.loading||U.loaded||U.canLoad||B({loading:!1,loaded:!1,canLoad:!0}),null==U||!U.canLoad||U.loading||U.loaded||(B({loading:!0,loaded:!1,canLoad:!0}),function(e,t,n,l){try{Promise.resolve(Digit.PTService.assessmentSearch({tenantId:e,filters:{propertyIds:t}})).then(function(o){function i(){n(r),l({loading:!1,loaded:!0,canLoad:!0})}let r={};const a=function(n){if((null==o||null===(n=o.Assessments)||void 0===n?void 0:n.length)>0)return Promise.resolve(Digit.PaymentService.fetchBill(e,{businessService:"PT",consumerCode:t})).then(function(e){r=e})}();return a&&a.then?a.then(i):i()})}catch(e){return Promise.reject(e)}}((null==C?void 0:C.tenantId)||tenantId,null==C?void 0:C.propertyId,k,B));const j=e=>{if(null==e||void 0===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()}`},H=function(e,t,n){if(void 0===t&&(t=0),"OPEN"===e.state||"INITIATED"===e.status&&!window.location.href.includes("/obps/")){var o;const e={date:j(null==C||null===(o=C.auditDetails)||void 0===o?void 0:o.createdTime),source:(null==C?void 0:C.channel)||""};return l.createElement(Fl,{data:e})}if(window.location.href.includes("/obps/")||window.location.href.includes("/noc/")||window.location.href.includes("/ws/")){var i,r,a,u,d,s,c,p,v,m,f,E,y,g,h,b,T,A;const o={uuid:null==e||null===(i=e.assignes)||void 0===i||null===(r=i[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==S?void 0:S.tenantId,businessIds:null==S?void 0:S.applicationNo,history:!0},jsonPath:"ProcessInstances[0].assignes[0].mobileNumber",isArray:!1,d:e=>{let n="";return n="+91 "+_.get(e,`ProcessInstances[${t}].assignes[0].mobileNumber`),n}}},D=n[t-1],N={date:null==e||null===(a=e.auditDetails)||void 0===a?void 0:a.lastModified,name:null==e||null===(u=e.assignes)||void 0===u||null===(d=u[0])||void 0===d?void 0:d.name,mobileNumber:(null==C||null===(s=C.processInstance)||void 0===s||null===(c=s.assignes)||void 0===c||null===(p=c[0])||void 0===p?void 0:p.uuid)===(null==e||null===(v=e.assignes)||void 0===v||null===(m=v[0])||void 0===m?void 0:m.uuid)&&null!=C&&null!==(f=C.processInstance)&&void 0!==f&&null!==(E=f.assignes)&&void 0!==E&&null!==(y=E[0])&&void 0!==y&&y.mobileNumber?null==C||null===(g=C.processInstance)||void 0===g||null===(h=g.assignes)||void 0===h||null===(b=h[0])||void 0===b?void 0:b.mobileNumber:null==e||null===(T=e.assignes)||void 0===T||null===(A=T[0])||void 0===A?void 0:A.mobileNumber,comment:w(null==e?void 0:e.comment),wfComment:D?D.wfComment:[],thumbnailsToShow:null==e?void 0:e.thumbnailsToShow};return l.createElement(Fl,{data:N,OpenImage:M,privacy:o})}{var D,N,I,O,P;const t={date:j(null==C||null===(D=C.auditDetails)||void 0===D?void 0:D.lastModifiedTime),name:null==e||null===(N=e.assignes)||void 0===N||null===(I=N[0])||void 0===I?void 0:I.name,wfComment:null==e?void 0:e.wfComment,mobileNumber:null==e||null===(O=e.assignes)||void 0===O||null===(P=O[0])||void 0===P?void 0:P.mobileNumber,thumbnailsToShow:null==e?void 0:e.thumbnailsToShow};return l.createElement(Fl,{data:t,OpenImage:M})}},W=(e,t)=>e?t?e:w(e):w("NA"),V=window.location.href.includes("employee/tl")||window.location.href.includes("employee/obps")||window.location.href.includes("employee/noc"),z=window.location.href.includes("employee/noc"),$=window.location.href.includes("employee/obps"),Y=()=>window.location.href.includes("employee/obps")||window.location.href.includes("employee/noc")||V?{justifyContent:"space-between",fontSize:"16px",lineHeight:"19px",color:"#0B0C0C"}:{},K=e=>null!=e&&e.skip?e.value:null!=e&&e.isUnit?null!=e&&e.value?`${W(null==e?void 0:e.value,null==e?void 0:e.isNotTranslated)} ${w(null==e?void 0:e.isUnit)}`:w("N/A"):null!=e&&e.value?W(null==e?void 0:e.value,null==e?void 0:e.isNotTranslated):w("N/A"),[q,G]=n.useState(!1);return l.createElement(t.Card,{style:{position:"relative"},className:"employeeCard-override"},P?l.createElement(zl,{t:w,userType:!1,infoBannerLabel:"CS_FILE_APPLICATION_INFO_LABEL",infoClickLable:"WS_CLICK_ON_LABEL",infoClickInfoLabel:window.location.href.includes("disconnection")||window.location.href.includes("application")?"WS_DISCONNECTION_CLICK_ON_INFO_LABEL":"WS_CLICK_ON_INFO_LABEL",infoClickInfoLabel1:window.location.href.includes("disconnection")||window.location.href.includes("application")?"WS_DISCONNECTION_CLICK_ON_INFO1_LABEL":""}):null,null==S||null===(r=S.applicationDetails)||void 0===r?void 0:r.map((e,n)=>{var o,r,a,u,d,s,c,p,v,m,f,E,y,_,g,h,T,C,A,D,N,P,R,M,k,U,B,j,H,W,q,G,Z,X,J,Q,ee,te,ne,le;return l.createElement(l.Fragment,{key:n},l.createElement("div",{style:window.location.href.includes("employee/obps")||window.location.href.includes("employee/noc")||window.location.href.includes("employee/ws")||V?{lineHeight:"19px",maxWidth:"100%",minWidth:"280px"}:{}},(null==e||null===(o=e.title)||void 0===o?void 0:o.trim())&&(0!==n||e.asSectionHeader?l.createElement(t.CardSectionHeader,{style:0===n&&V?{marginBottom:"16px",fontSize:"24px"}:{marginBottom:"16px",marginTop:"16px",fontSize:"24px"}},w(e.title),null!=e&&e.Component?l.createElement(e.Component,null):null):l.createElement(t.CardSubHeader,{style:{marginBottom:"16px",fontSize:"24px"}},w(e.title))),(null==e?void 0:e.isTable)&&l.createElement("table",{style:{tableLayout:"fixed",width:"100%",borderCollapse:"collapse",border:"1px solid black"}},l.createElement("tr",{style:{textAlign:"left"}},null==e?void 0:e.headers.map((e,t)=>l.createElement("th",{style:{padding:"10px",paddingLeft:"5px",border:"1px solid black"},key:t},w(e)))),null==e?void 0:e.tableRows.map((n,o)=>l.createElement("tr",{key:o},n.map((n,r)=>Array.isArray(n)&&n.length>1&&!0===e.isMaintenance?l.createElement("td",{style:{paddingTop:"20px",textAlign:"left",border:"1px solid black",verticalAlign:"middle"},key:r},l.createElement("div",{style:{display:"flex",flexWrap:"nowrap",gap:"5px"}},n.map((e,n)=>l.createElement("a",{key:n,onClick:()=>{Digit.UploadServices.Filefetch([e.fileStoreId],Digit.ULBService.getStateId()).then(e=>{var t,n,l;const o=null==e||null===(t=e.data)||void 0===t||null===(n=t.fileStoreIds)||void 0===n||null===(l=n[0])||void 0===l?void 0:l.url;if(o){const e=o.split(",")[0];e?window.open(e,"_blank"):console.error("No valid URL found to open!")}else console.error("URL is missing in the response!")}).catch(e=>{console.error("Error fetching file:",e)})},rel:"noopener noreferrer",style:{marginRight:"5px",display:"inline-block",cursor:"pointer"}},l.createElement(t.PDFSvg,{style:{width:"25px",height:"25px"}}))))):l.createElement("td",{key:r,style:{paddingTop:"20px",textAlign:"left",border:"1px solid black",verticalAlign:"middle"}},n&&!0===n.editButton?l.createElement("span",{style:{display:"inline-flex",gap:"10px",alignItems:"center"}},l.createElement(i.Link,{to:{pathname:"/digit-ui/employee/asset/assetservice/maintenance-edit/"+x,state:{data:n.data}}},l.createElement("button",null," ",l.createElement(t.EditIcon,null)," ")),l.createElement("div",{key:o,onClick:()=>{L(!0)},style:{cursor:"pointer"}},l.createElement(t.ViewsIcon,null))):w(n)))))),l.createElement(t.StatusTable,{style:window.location.href.includes("employee/obps")||window.location.href.includes("employee/noc")||V?{position:"relative",marginTop:"19px"}:{}},(null==e?void 0:e.title)&&!(null!=e&&e.title.includes("NOC"))&&(null==e||null===(r=e.values)||void 0===r?void 0:r.map((n,o)=>{var r,a,u;return!0===n.map&&"N/A"!==n.value?l.createElement(t.Row,{labelStyle:{wordBreak:"break-all"},textStyle:{wordBreak:"break-all"},key:w(n.title),label:w(n.title),text:l.createElement("img",{src:w(n.value),alt:"",privacy:null==n?void 0:n.privacy})}):!0===(null==n?void 0:n.isLink)?l.createElement(t.Row,{key:w(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"}},w(null==n?void 0:n.title)))):z||$?""+w(n.title):w(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:Y(),labelStyle:{wordBreak:"break-all"},textStyle:{wordBreak:"break-all"}}):l.createElement("div",{key:o},window.location.href.includes("modify")?l.createElement(t.Row,{className:"border-none",key:""+n.title,label:""+w(""+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:w(n.title),label:w(n.title),text:K(n),last:o===(null==e||null===(r=e.values)||void 0===r?void 0:r.length)-1,caption:n.caption,className:"border-none",privacy:null==n?void 0:n.privacy,rowContainerStyle:Y(),labelStyle:{wordBreak:"break-all",fontWeight:n.isBold?"bold":"normal",fontStyle:n.isBold?"italic":"normal"},textStyle:{wordBreak:"break-all",fontWeight:n.isBold?"bold":"normal",fontStyle:n.isBold?"italic":"normal"}}),"PT_TOTAL_DUES"===n.title?l.createElement(Gl,{bill:null===(a=F.Bill)||void 0===a?void 0:a[0]}):"")})))),(null==e?void 0:e.belowComponent)&&l.createElement(e.belowComponent,null),(null==e||null===(a=e.additionalDetails)||void 0===a?void 0:a.inspectionReport)&&l.createElement(Ll,{scrutinyDetails:null==e?void 0:e.additionalDetails,paymentsList:I}),(null==S||null===(u=S.applicationData)||void 0===u||null===(d=u.additionalDetails)||void 0===d||null===(s=d.fieldinspection_pending)||void 0===s?void 0:s.length)>0&&(null==e||null===(c=e.additionalDetails)||void 0===c?void 0:c.fiReport)&&l.createElement(Al,{fiReport:null==S||null===(p=S.applicationData)||void 0===p||null===(v=p.additionalDetails)||void 0===v?void 0:v.fieldinspection_pending}),(null==e||null===(m=e.additionalDetails)||void 0===m?void 0:m.floors)&&l.createElement(wl,{floors:null==e||null===(f=e.additionalDetails)||void 0===f?void 0:f.floors}),(null==e||null===(E=e.additionalDetails)||void 0===E?void 0:E.owners)&&l.createElement(Rl,{owners:null==e||null===(y=e.additionalDetails)||void 0===y?void 0:y.owners}),(null==e||null===(_=e.additionalDetails)||void 0===_?void 0:_.units)&&l.createElement(Ul,{units:null==e||null===(g=e.additionalDetails)||void 0===g?void 0:g.units}),(null==e||null===(h=e.additionalDetails)||void 0===h?void 0:h.accessories)&&l.createElement(kl,{units:null==e||null===(T=e.additionalDetails)||void 0===T?void 0:T.accessories}),(null==e||null===(C=e.additionalDetails)||void 0===C?void 0:C.permissions)&&(null==b||null===(A=b.data)||void 0===A||null===(D=A.nextActions)||void 0===D?void 0:D.length)>0&&l.createElement(Il,{applicationData:null==S?void 0:S.applicationData,t:w,permissions:null==e||null===(N=e.additionalDetails)||void 0===N?void 0:N.permissions}),(null==e||null===(P=e.additionalDetails)||void 0===P?void 0:P.obpsDocuments)&&l.createElement(Tl,{t:w,applicationData:null==S?void 0:S.applicationData,docs:e.additionalDetails.obpsDocuments,bpaActionsDetails:b}),(null==e||null===(R=e.additionalDetails)||void 0===R?void 0:R.noc)&&l.createElement(Nl,{t:w,isNoc:!0,NOCdata:e.values,applicationData:null==S?void 0:S.applicationData,docs:e.additionalDetails.noc,noc:null===(M=e.additionalDetails)||void 0===M?void 0:M.data,bpaActionsDetails:b}),(null==e||null===(k=e.additionalDetails)||void 0===k?void 0:k.scruntinyDetails)&&l.createElement(Ll,{scrutinyDetails:null==e?void 0:e.additionalDetails}),(null==e||null===(U=e.additionalDetails)||void 0===U?void 0:U.buildingExtractionDetails)&&l.createElement(Ll,{scrutinyDetails:null==e?void 0:e.additionalDetails}),(null==e||null===(B=e.additionalDetails)||void 0===B?void 0:B.subOccupancyTableDetails)&&l.createElement(xl,{edcrDetails:null==e?void 0:e.additionalDetails,applicationData:null==S?void 0:S.applicationData}),(null==e||null===(j=e.additionalDetails)||void 0===j?void 0:j.documentsWithUrl)&&l.createElement(bl,{documents:null==e||null===(H=e.additionalDetails)||void 0===H?void 0:H.documentsWithUrl}),(null==e||null===(W=e.additionalDetails)||void 0===W?void 0:W.documents)&&l.createElement(Ol,{documents:null==e||null===(q=e.additionalDetails)||void 0===q?void 0:q.documents}),(null==e||null===(G=e.additionalDetails)||void 0===G?void 0:G.taxHeadEstimatesCalculation)&&l.createElement(Pl,{taxHeadEstimatesCalculation:null==e||null===(Z=e.additionalDetails)||void 0===Z?void 0:Z.taxHeadEstimatesCalculation}),(null==e?void 0:e.isWaterConnectionDetails)&&l.createElement(Bl,{wsAdditionalDetails:e,oldValue:O}),(null==e||null===(X=e.additionalDetails)||void 0===X?void 0:X.redirectUrl)&&l.createElement(i.Link,{to:null==e||null===(J=e.additionalDetails)||void 0===J||null===(Q=J.redirectUrl)||void 0===Q?void 0:Q.url},l.createElement("span",{className:"add-details-link hover-button"},null==e||null===(ee=e.additionalDetails)||void 0===ee||null===(te=ee.redirectUrl)||void 0===te?void 0:te.title)),(null==e||null===(ne=e.additionalDetails)||void 0===ne?void 0:ne.estimationDetails)&&l.createElement(Wl,{wsAdditionalDetails:e,workflowDetails:b}),(null==e||null===(le=e.additionalDetails)||void 0===le?void 0:le.estimationDetails)&&l.createElement($l,{wsAdditionalDetails:e,workflowDetails:b}))}),D&&(null==b||null===(a=b.data)||void 0===a||null===(u=a.timeline)||void 0===u?void 0:u.length)>0&&l.createElement(l.Fragment,null,l.createElement(t.BreakLine,null),((null==b?void 0:b.isLoading)||T)&&l.createElement(t.Loader,null),!(null!=b&&b.isLoading)&&!T&&l.createElement(n.Fragment,null,l.createElement("div",{id:"timeline"},l.createElement(t.CardSectionHeader,{style:{marginBottom:"16px",marginTop:"32px"}},w("ES_APPLICATION_DETAILS_APPLICATION_TIMELINE")),null!=b&&null!==(d=b.data)&&void 0!==d&&d.timeline&&1===(null==b||null===(s=b.data)||void 0===s||null===(c=s.timeline)||void 0===c?void 0:c.length)?l.createElement(t.CheckPoint,{isCompleted:!0,label:w(`${A}${null==b||null===(p=b.data)||void 0===p||null===(v=p.timeline[0])||void 0===v?void 0:v.state}`),customChild:H(null==b||null===(m=b.data)||void 0===m?void 0:m.timeline[0],null==b||null===(f=b.data)||void 0===f?void 0:f.timeline)}):l.createElement(t.ConnectingCheckPoints,null,(null==b||null===(E=b.data)||void 0===E?void 0:E.timeline)&&(null==b||null===(y=b.data)||void 0===y?void 0:y.timeline.slice(0,q?null==b?void 0:b.data.timeline.length:2).map((e,n,o)=>{var i;let r="";var a,u,d,s,c,p;return window.location.href.includes("/obps/")&&(r=null!=b&&null!==(a=b.data)&&void 0!==a&&null!==(u=a.timeline[n-1])&&void 0!==u&&null!==(d=u.state)&&void 0!==d&&d.includes("BACK_FROM")||null!=b&&null!==(s=b.data)&&void 0!==s&&null!==(c=s.timeline[n-1])&&void 0!==c&&null!==(p=c.state)&&void 0!==p&&p.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:w(`${A}${"REOPEN"===(null==e?void 0:e.performedAction)?null==e?void 0:e.performedAction:null==e?void 0:e[N]}${r}`),customChild:H(e,n,null==b||null===(i=b.data)||void 0===i?void 0:i.timeline)}))}))),(null==b||null===(g=b.data)||void 0===g||null===(h=g.timeline)||void 0===h?void 0:h.length)>2&&l.createElement(t.LinkButton,{label:w(q?"COLLAPSE":"VIEW_TIMELINE"),onClick:()=>{G(e=>!e)}})))),l.createElement("div",null,R&&l.createElement(Jl,{t:w,closeModal:()=>setRnewButton(!1),actionCancelOnSubmit:()=>setRnewButton(!1),application:application})))}function eo(e){var n,o,i,r,a,u,d,s,c,p,v,m,f,E,y,_,g,h;let{t:S,showToast:b,closeToast:T,businessService:C}=e;if(null!=C&&C.includes("NewTL")||null!=C&&C.includes("TL")||null!=C&&C.includes("EDITRENEWAL")){var A;let e="";switch(null==b||null===(A=b.action)||void 0===A?void 0:A.action){case"SENDBACK":e="error"===(null==b?void 0:b.key)?null==b||null===(n=b.error)||void 0===n?void 0:n.message:S("TL_SENDBACK_CHECKLIST_MESSAGE_HEAD");break;case"FORWARD":e="error"===(null==b?void 0:b.key)?null==b||null===(o=b.error)||void 0===o?void 0:o.message:S("TL_FORWARD_SUCCESS_MESSAGE_MAIN");break;case"APPROVE":e="error"===(null==b?void 0:b.key)?null==b||null===(i=b.error)||void 0===i?void 0:i.message:S("TL_APPROVAL_CHECKLIST_MESSAGE_HEAD");break;case"SENDBACKTOCITIZEN":e="error"===(null==b?void 0:b.key)?null==b||null===(r=b.error)||void 0===r?void 0:r.message:S("TL_SENDBACK_TOCITIZEN_CHECKLIST_MESSAGE_HEAD");break;case"REJECT":e="error"===(null==b?void 0:b.key)?null==b||null===(a=b.error)||void 0===a?void 0:a.message:S("TL_APPROVAL_REJ_MESSAGE_HEAD");break;case"RESUBMIT":e="error"===(null==b?void 0:b.key)?null==b||null===(u=b.error)||void 0===u?void 0:u.message:S("TL_APPLICATION_RESUBMIT_SUCCESS_MESSAGE_MAIN");break;case"CANCEL":e="error"===(null==b?void 0:b.key)?null==b||null===(d=b.error)||void 0===d?void 0:d.message:S("TL_TL_CANCELLED_MESSAGE_HEAD");break;default:e="error"===(null==b?void 0:b.key)?null==b||null===(s=b.error)||void 0===s?void 0:s.message:S(`ES_${C}_${null==b||null===(c=b.action)||void 0===c?void 0:c.action}_UPDATE_SUCCESS`)}return l.createElement(l.Fragment,null,b&&l.createElement(t.Toast,{error:"error"===b.key,label:e,onClose:T}))}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==b||null===(D=b.action)||void 0===D?void 0:D.action){case"REVOCATE":n="error"===(null==b?void 0:b.key)?null==b||null===(p=b.error)||void 0===p?void 0:p.message:e(["BPA_APPROVAL_REVOCATED_MESSAGE_HEAD","BPA_APPROVAL_OC_REVOCATED_MESSAGE_HEAD"]);break;case"VERIFY_AND_FORWARD":n="error"===(null==b?void 0:b.key)?null==b||null===(v=b.error)||void 0===v?void 0:v.message:e(["BPA_FORWARD_SUCCESS_MESSAGE_MAIN"]);break;case"SEND_BACK_TO_CITIZEN":n="error"===(null==b?void 0:b.key)?null==b||null===(m=b.error)||void 0===m?void 0:m.message:e(["BPA_SENDBACK_SUCCESS_MESSAGE_MAIN"]);break;case"APPROVE":n="error"===(null==b?void 0:b.key)?null==b||null===(f=b.error)||void 0===f?void 0:f.message:e(["BPA_APPROVAL_CHECKLIST_MESSAGE_HEAD"]);break;case"REJECT":n="error"===(null==b?void 0:b.key)?null==b||null===(E=b.error)||void 0===E?void 0:E.message:e(["BPA_APPROVAL_REJECTED_MESSAGE_HEAD","BPA_OC_APPROVAL_REJECTED_MESSAGE_HEAD"]);break;case"FORWARD":n="error"===(null==b?void 0:b.key)?null==b||null===(y=b.error)||void 0===y?void 0:y.message:e(["BPA_FORWARD_SUCCESS_MESSAGE_MAIN"]);break;case"SEND_BACK_FOR_DOCUMENT_VERIFICATION":case"SEND_BACK_FOR_FIELD_INSPECTION":n="error"===(null==b?void 0:b.key)?null==b||null===(_=b.error)||void 0===_?void 0:_.message:e(["BPA_SENDBACK_SUCCESS_MESSAGE_MAIN"]);break;default:n="error"===(null==b?void 0:b.key)?null==b||null===(g=b.error)||void 0===g?void 0:g.message:S(`ES_${C}_${null==b||null===(h=b.action)||void 0===h?void 0:h.action}_UPDATE_SUCCESS`)}return l.createElement(l.Fragment,null,b&&l.createElement(t.Toast,{error:"error"===b.key,label:n,onClose:T}))}{var N,I;const e="error"===(null==b?void 0:b.key)?null==b||null===(N=b.error)||void 0===N?void 0:N.message:`ES_${C}_${null==b||null===(I=b.action)||void 0===I?void 0:I.action}_UPDATE_SUCCESS`;return l.createElement(l.Fragment,null,b&&l.createElement(t.Toast,{error:"error"===b.key,label:S(e),onClose:T}))}}function to(e){var i,r,a,u,d,s,c,p,v,m,f,E,y,_,g,h,S,b,T;let{workflowDetails:C,displayMenu:A,onActionSelect:D,setDisplayMenu:N,businessService:I,forcedActionPrefix:O,ActionBarStyle:P={},MenuStyle:w={},isAction:R,applicationDetails:L}=e;const{t:x}=o.useTranslation();let M=Digit.UserService.getUser();const F=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):{};M=null==t?void 0:t.value}const k=null===(i=M)||void 0===i||null===(r=i.info)||void 0===r||null===(a=r.roles)||void 0===a?void 0:a.map(e=>e.code);let U=!1,B=!1,j=(null==C||null===(u=C.data)||void 0===u||null===(d=u.actionState)||void 0===d||null===(s=d.nextActions)||void 0===s?void 0:s.filter(e=>(null==k?void 0:k.some(t=>{var n;return null===(n=e.roles)||void 0===n?void 0:n.includes(t)}))||!e.roles))||(null==C||null===(c=C.data)||void 0===c||null===(p=c.nextActions)||void 0===p?void 0:p.filter(e=>(null==k?void 0:k.some(t=>{var n;return null===(n=e.roles)||void 0===n?void 0:n.includes(t)}))||!e.roles));Digit.Hooks.useClickOutside(F,()=>{N(!1)},A),(window.location.href.includes("/obps")||window.location.href.includes("/noc"))&&1==(null==j?void 0:j.length)||null!=j&&null!==(v=j[0])&&void 0!==v&&null!==(m=v.redirectionUrl)&&void 0!==m&&m.pathname.includes("/pt/property-details/")&&1==(null==j?void 0:j.length)?(B=!1,U=!0):(null==j?void 0:j.length)>0&&(B=!0,U=!1);const H=Digit.SessionStorage.get("User"),W=null==H||null===(f=H.info)||void 0===f?void 0:f.uuid,V=null==L||null===(E=L.applicationData)||void 0===E||null===(y=E.auditDetails)||void 0===y?void 0:y.lastModifiedBy;return l.createElement(l.Fragment,null,!(null!=C&&C.isLoading)&&B&&!U&&!R&&l.createElement(t.ActionBar,{style:{...P}},A&&(null!=C&&null!==(_=C.data)&&void 0!==_&&null!==(g=_.actionState)&&void 0!==g&&g.nextActions||null!=C&&null!==(h=C.data)&&void 0!==h&&h.nextActions)?l.createElement(t.Menu,{localeKeyPrefix:O||"WF_EMPLOYEE_"+(null==I?void 0:I.toUpperCase()),options:j,optionKey:"action",t:x,onSelect:D,style:w}):null,"ewst"===I?V===W||null==V?l.createElement(t.SubmitBar,{ref:F,label:x("WF_TAKE_ACTION"),onSubmit:()=>N(!A)}):l.createElement(t.CardLabel,{style:{color:"red",font:"30px",fontWeight:"bold"}},""+x("EW_ALERT_ANOTHER_VENDOR")):l.createElement(t.SubmitBar,{ref:F,label:x("WF_TAKE_ACTION"),onSubmit:()=>N(!A)})),!(null!=C&&C.isLoading)&&!B&&U&&!R&&l.createElement(t.ActionBar,{style:{...P}},l.createElement("button",{style:{color:"#FFFFFF",fontSize:"18px"},className:"submit-bar",name:null==j||null===(S=j[0])||void 0===S?void 0:S.action,value:null==j||null===(b=j[0])||void 0===b?void 0:b.action,onClick:e=>{D((null==j?void 0:j[0])||{})}},x(`${O||"WF_EMPLOYEE_"+(null==I?void 0:I.toUpperCase())}_${null==j||null===(T=j[0])||void 0===T?void 0:T.action}`))))}const no=()=>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"})),lo=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(no,null));function oo(e){let{action:n,closeWarningPopup:i}=e;const{t:r}=o.useTranslation(),a=window.Digit.Utils.browser.isMobile();return l.createElement(l.Fragment,null,l.createElement(t.Modal,{headerBarMain:l.createElement("h1",{className:"heading-m"},r("PT_DUES_ARE_PENDING")),headerBarEnd:l.createElement(lo,{onClick:()=>{i()}}),hideSubmit:!0,isDisabled:!1,popupStyles:a?{}:{width:"29%",marginTop:"auto"}},l.createElement(t.Card,null,l.createElement("div",{style:{marginBottom:"30px"}},l.createElement("h1",null,r("PT_YOU_HAVE")," ₹",null==n?void 0:n.AmountDueForPay," ",r("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:""+r("PT_AMOUNT_DUE"),text:"₹"+r(null==n?void 0:n.AmountDueForPay)}),l.createElement("div",{style:{width:"100%",display:"flex",justifyContent:"flex-end"}},l.createElement(t.ButtonSelector,{theme:"border",label:r("ES_PT_COMMON_CANCEL"),onSubmit:i,style:{marginLeft:"10px"}}),l.createElement(t.ButtonSelector,{label:r("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 io=e=>{var a;const u=Digit.ULBService.getCurrentTenantId(),d=Digit.ULBService.getStateId(),{t:s}=o.useTranslation(),c=i.useHistory();let{id:p}=i.useParams();const[v,m]=n.useState(!1),[f,E]=n.useState(null),[y,_]=n.useState(!1),[g,h]=n.useState(!1),[S,b]=n.useState(!1),{applicationDetails:T,showToast:C,setShowToast:A,isLoading:D,isDataLoading:N,applicationData:I,mutate:O,nocMutation:P,workflowDetails:w,id:R,businessService:L,closeToast:x,moduleCode:M,timelineStatusPrefix:F,forcedActionPrefix:k,statusAttribute:U,ActionBarStyle:B,MenuStyle:j,paymentsList:H,showTimeLine:W=!0,oldValue:V,isInfoLabel:z=!1,clearDataDetails:$,isAction:Y=!1}=e;n.useEffect(()=>{C&&w.revalidate()},[C]);const K=r.useQueryClient(),q=()=>{E(null),_(!1)};return D||g?l.createElement(t.Loader,null):l.createElement(l.Fragment,null,D?l.createElement(t.Loader,null):l.createElement(l.Fragment,null,l.createElement(Ql,{applicationDetails:T,id:R,workflowDetails:w,isDataLoading:N,applicationData:I,businessService:L,timelineStatusPrefix:F,statusAttribute:U,paymentsList:H,showTimeLine:W,oldValue:V,isInfoLabel:z}),y?l.createElement(Sl,{t:s,action:f,tenantId:u,state:d,id:p,applicationDetails:T,applicationData:null==T?void 0:T.applicationData,closeModal:q,submitAction:function(e,t,n){void 0===t&&(t=!1),void 0===n&&(n={});try{let l=!1;const o=function(o,i,r,a,u,d,p,v,m,E,y,_){if(0!=(null==e||null===(o=e.Property)||void 0===o||null===(i=o.workflow)||void 0===i||null===(r=i.comment)||void 0===r?void 0:r.length)&&0!=(null==e||null===(a=e.Licenses)||void 0===a||null===(u=a[0])||void 0===u||null===(d=u.comment)||void 0===d?void 0:d.length)&&0!=(null==e||null===(p=e.WaterConnection)||void 0===p||null===(v=p.comment)||void 0===v?void 0:v.length)&&0!=(null==e||null===(m=e.SewerageConnection)||void 0===m||null===(E=m.comment)||void 0===E?void 0:E.length)&&0!=(null==e||null===(y=e.BPA)||void 0===y||null===(_=y.comment)||void 0===_?void 0:_.length)){function g(t){if(l)return t;O&&(h(!0),O(e,{onError:(e,t)=>{h(!1),A({key:"error",error:e}),setTimeout(x,5e3)},onSuccess:(e,t)=>{var l,o,i,r,a,u,d,p,v,m,E,y;sessionStorage.removeItem("WS_SESSION_APPLICATION_DETAILS"),h(!1),null!==(l=n)&&void 0!==l&&l.bpa&&(e.selectedAction=f,c.replace("/digit-ui/employee/obps/response",{data:e})),null!==(o=n)&&void 0!==o&&o.isStakeholder&&(e.selectedAction=f,c.push("/digit-ui/employee/obps/stakeholder-response",{data:e})),null!==(i=n)&&void 0!==i&&i.isNoc&&c.push("/digit-ui/employee/noc/response",{data:e}),(null==e||null===(r=e.Amendments)||void 0===r?void 0:r.length)>0?null!=t&&null!==(a=t.AmendmentUpdate)&&void 0!==a&&null!==(u=a.workflow)&&void 0!==u&&u.action.includes("SEND_BACK")?A({key:"success",label:s("ES_MODIFYSWCONNECTION_SEND_BACK_UPDATE_SUCCESS")}):null!=t&&null!==(d=t.AmendmentUpdate)&&void 0!==d&&null!==(p=d.workflow)&&void 0!==p&&p.action.includes("RE-SUBMIT")?A({key:"success",label:s("ES_MODIFYSWCONNECTION_RE_SUBMIT_UPDATE_SUCCESS")}):null!=t&&null!==(v=t.AmendmentUpdate)&&void 0!==v&&null!==(m=v.workflow)&&void 0!==m&&m.action.includes("APPROVE")?A({key:"success",label:s("ES_MODIFYSWCONNECTION_APPROVE_UPDATE_SUCCESS")}):null!=t&&null!==(E=t.AmendmentUpdate)&&void 0!==E&&null!==(y=E.workflow)&&void 0!==y&&y.action.includes("REJECT")&&A({key:"success",label:s("ES_MODIFYWSCONNECTION_REJECT_UPDATE_SUCCESS")}):(A({key:"success",action:f}),$&&setTimeout($,3e3),setTimeout(x,5e3),K.clear(),K.refetchQueries("APPLICATION_SEARCH"))}})),q()}h(!0),"function"==typeof(null==e?void 0:e.customFunctionToExecute)&&(null==e||e.customFunctionToExecute({...e}));const o=function(){if(!1!==t&&P){var e;const n=null===(e=t)||void 0===e?void 0:e.map(e=>null==P?void 0:P.mutateAsync(e)),o=_e(function(){return h(!0),Promise.resolve(Promise.all(n)).then(function(e){e&&e.map(e=>{var t,n;Digit.SessionStorage.del(null==e||null===(t=e.Noc)||void 0===t||null===(n=t[0])||void 0===n?void 0:n.nocType)})})},function(e){var t,n,o,i,r,a,u,d,c,p,v,m;h(!1);let f=null!=e&&null!==(t=e.response)&&void 0!==t&&null!==(n=t.data)&&void 0!==n&&null!==(o=n.Errors)&&void 0!==o&&null!==(i=o[0])&&void 0!==i&&i.code?s(null==e||null===(r=e.response)||void 0===r||null===(a=r.data)||void 0===a||null===(u=a.Errors)||void 0===u||null===(d=u[0])||void 0===d?void 0:d.code):(null==e||null===(c=e.response)||void 0===c||null===(p=c.data)||void 0===p||null===(v=p.Errors)||void 0===v||null===(m=v[0])||void 0===m?void 0:m.message)||e;q(),A({key:"error",error:{message:f}}),setTimeout(x,5e3),l=!0});if(o&&o.then)return o.then(function(){})}}();return o&&o.then?o.then(g):g(o)}alert("Please fill in the comments before submitting")}();return Promise.resolve(o&&o.then?o.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},actionData:null==w||null===(a=w.data)||void 0===a?void 0:a.timeline,businessService:L,workflowDetails:w,moduleCode:M,cardFormWrapperClassName:"modal-form"}):null,S?l.createElement(oo,{action:f,workflowDetails:w,businessService:L,isWarningPop:S,closeWarningPopup:()=>{b(!1)}}):null,l.createElement(eo,{t:s,showToast:C,closeToast:x,businessService:L}),l.createElement(to,{isAction:Y,workflowDetails:w,displayMenu:v,onActionSelect:function(e){if(sessionStorage.setItem("SELECTED_ACTION",null==e?void 0:e.action),e)if(null!=e&&e.isToast)A({key:"error",error:{message:null==e?void 0:e.toastMessage}}),setTimeout(x,5e3);else if(null!=e&&e.isWarningPopUp)b(!0);else if(null!=e&&e.redirectionUrll){var t,n,l,o,i;if("ACTIVATE_CONNECTION"===(null==e||null===(t=e.redirectionUrll)||void 0===t?void 0:t.action))c.push(""+(null==e||null===(l=e.redirectionUrll)||void 0===l?void 0:l.pathname),JSON.stringify({data:null==e||null===(o=e.redirectionUrll)||void 0===o?void 0:o.state,url:`${null===(i=location)||void 0===i?void 0:i.pathname}${location.search}`}));else if("RE-SUBMIT-APPLICATION"===(null==e||null===(n=e.redirectionUrll)||void 0===n?void 0:n.action)){var r,a;c.push(""+(null==e||null===(r=e.redirectionUrll)||void 0===r?void 0:r.pathname),{data:null==e||null===(a=e.redirectionUrll)||void 0===a?void 0:a.state})}else{var u;window.location.assign(`${window.location.origin}/digit-ui/employee/payment/collect/${null==e||null===(u=e.redirectionUrll)||void 0===u?void 0:u.pathname}`)}}else if(null!=e&&e.redirectionUrl){var d,s;c.push({pathname:null===(d=e.redirectionUrl)||void 0===d?void 0:d.pathname,state:{...null===(s=e.redirectionUrl)||void 0===s?void 0:s.state}})}else _(!0);E(e),m(!1)},setDisplayMenu:m,businessService:L,forcedActionPrefix:k,ActionBarStyle:B,MenuStyle:j,applicationDetails:T})))},ro=()=>{var e;const{t:r}=o.useTranslation(),{propertyId:a,tenantId:u,redirectToUrl:d}=Digit.Hooks.useQueryParams(),{isLoading:s,data:c}=Digit.Hooks.pt.useGenericViewProperty(r,u,a,{}),{state:p}=i.useLocation(),v=i.useHistory();return n.useEffect(()=>{"true"===sessionStorage.getItem("isCreateEnabledEmployee")?(sessionStorage.removeItem("isCreateEnabledEmployee"),v.replace("/digit-ui/employee")):sessionStorage.removeItem("isCreateEnabledEmployee")}),l.createElement("div",null,l.createElement("div",null,l.createElement(t.Header,null,r("PT_PROPERTY_INFO_HEADER"))),l.createElement(io,{applicationDetails:c,isLoading:s,isDataLoading:s,workflowDetails:{},applicationData:null==c?void 0:c.applicationData,moduleCode:"PT"}),window.location.href.includes("redirectToUrl")&&"INACTIVE"!==(null==c||null===(e=c.applicationData)||void 0===e?void 0:e.status)&&l.createElement(t.ActionBar,{style:{display:"flex",justifyContent:"flex-end",alignItems:"baseline"}},l.createElement("div",null,l.createElement(t.SubmitBar,{label:r("PT_ADD_PROPERTY_TO_APP"),onSubmit:()=>(()=>{var e,t,n,l,o,i,r;const s=null!=d&&d.includes("employee/tl")?1600:300;return setTimeout(()=>window.scrollTo(0,s),400),v.push(`${d}?propertyId=${a}&tenantId=${(null==c?void 0:c.tenantId)||u}${"PENDING_FOR_FIELD_INSPECTION"===(null==p||null===(e=p.data)||void 0===e||null===(t=e.applicationDetails)||void 0===t?void 0:t.applicationStatus)?`&applicationNumber=${null==p||null===(n=p.data)||void 0===n||null===(l=n.applicationDetails)||void 0===l?void 0:l.applicationNo}&service=${null==p||null===(o=p.data)||void 0===o||null===(i=o.applicationDetails)||void 0===i||null===(r=i.applicationData)||void 0===r?void 0:r.serviceType}`:""}`,{...p})})()}))))},ao=e=>{let{stateCode:n}=e;const{path:o,...r}=i.useRouteMatch();return l.createElement("span",{className:"pt-citizen",style:{width:"100%"}},l.createElement(i.Switch,null,l.createElement(t.AppContainer,null,l.createElement(t.BackButton,null,"Back"),l.createElement(i.Route,{path:o+"/property/citizen-search",component:Ee}),l.createElement(i.Route,{path:o+"/property/search-results"},l.createElement(be,{stateCode:n})),l.createElement(i.Route,{path:o+"/property/citizen-otp"},l.createElement(Ae,{stateCode:n})," "),l.createElement(t.PrivateRoute,{path:o+"/property/link-success/:propertyIds",component:Te}),l.createElement(t.PrivateRoute,{path:o+"/property/new-application",component:T}),l.createElement(t.PrivateRoute,{path:o+"/view-property",component:()=>l.createElement(ro,null)}))))},uo=e=>{o.useTranslation();const n=r.useQueryClient(),a=i.useRouteMatch(),u=(i.useLocation(),i.useHistory()),d=Digit.ULBService.getStateId(),[s,c,p]=(Digit.ULBService.getCurrentTenantId(),Digit.Hooks.useSessionStorage("PT_CREATE_PROPERTY",{}));let{isLoading:v}=Digit.Hooks.pt.useMDMS(d,"PropertyTax","CommonFieldsConfig");const m=i.useLocation().search;return new URLSearchParams(m).get("redirectToUrl"),v?l.createElement(t.Loader,null):l.createElement(i.Switch,null,l.createElement(i.Route,{exact:!0,path:""+a.path},l.createElement(y,{onSubmit:function(){try{return u.push(a.path+"/save-property"),Promise.resolve()}catch(e){return Promise.reject(e)}},value:s,userType:"employee"})),l.createElement(i.Route,{exact:!0,path:a.path+"/save-property"},l.createElement(b,{data:s,onSuccess:()=>{p(),n.invalidateQueries("PT_CREATE_PROPERTY")},userType:"employee"})))},so={searchId:{propertyIds:{type:"text",label:"PT_PROPERTY_UNIQUE_ID",placeHolder:"PT_PROPERTY_UNIQUE_ID_PLACEHOLDER",validation:{pattern:{value:"[A-Za-z]{2}-[A-Za-z]{2}-[0-9]{4}-[0-9]{4}-[0-9]{2}-[0-9]{2}-[0-9]{6}|[A-Za-z]{2}-[A-Za-z]{2}-[0-9]{4}-[0-9]{2}-[0-9]{2}-[0-9]{6}",message:"ERR_INVALID_PROPERTY_ID"}}},oldPropertyId:{type:"text",label:"PT_EXISTING_PROPERTY_ID",placeholder:"PT_EXISTING_PROPERTY_ID_PLACEHOLDER",validation:{pattern:{value:"[A-Za-z]{2}-[A-Za-z]{2}-[0-9]{4}-[0-9]{4}-[0-9]{2}-[0-9]{2}-[0-9]{6}|[A-Za-z]{2}-[A-Za-z]{2}-[0-9]{4}-[0-9]{2}-[0-9]{2}-[0-9]{6}",message:"ERR_INVALID_PROPERTY_ID"}}},mobileNumber:{type:"number",label:"PT_HOME_SEARCH_RESULTS_OWN_MOB_LABEL",componentInFront:"+91",placeHolder:"PT_HOME_SEARCH_RESULTS_OWN_MOB_PLACEHOLDER",validation:{minLength:{value:10,message:"CORE_COMMON_MOBILE_ERROR"},maxLength:{value:10,message:"CORE_COMMON_MOBILE_ERROR"},pattern:{value:/[6789][0-9]{9}/,message:"CORE_COMMON_MOBILE_ERROR"}}}},searchDetail:{locality:{type:"custom",label:"PT_SEARCH_LOCALITY",placeHolder:"PT_SEARCH_LOCALITY_PLACEHOLDER",validation:{required:"PTLOCALITYMANDATORY"},customComponent:t.Localities,customCompProps:{boundaryType:"revenue",keepNull:!1,optionCardStyles:{height:"600px",overflow:"auto",zIndex:"10"},disableLoader:!0}},doorNo:{type:"text",label:"PT_SEARCHPROPERTY_TABEL_DOOR_NO",placeHolder:"PT_SEARCH_DOOR_NO_PLACEHOLDER",validation:{pattern:{value:"[A-Za-z0-9#,/ -()]{1,63}",message:"ERR_INVALID_DOOR_NO"}}},name:{type:"text",label:"PT_SEARCHPROPERTY_TABEL_OWNERNAME",placeHolder:"PT_SEARCH_OWNER_NAME_PLACEHOLDER",validation:{minLength:{value:3,message:"PT_MIN_3CHAR"},pattern:{value:"^[a-zA-Z ]+$",message:"PAYMENT_INVALID_NAME"}}}}},co={propertyIds:"",mobileNumber:"",oldPropertyId:"",locality:"",name:"",doorNo:""},po=e=>{const{t:r}=o.useTranslation(),a=Digit.ULBService.getCurrentTenantId(),[u,d]=n.useState({}),[s,c]=n.useState(co),[p,v]=n.useState("searchId"),[m,f]=n.useState(null),E=i.useLocation().search,y=new URLSearchParams(E).get("redirectToUrl"),_=n.memo(Digit.ComponentRegistryService.getComponent("CPTPropertySearchForm")),g=n.memo(Digit.ComponentRegistryService.getComponent("CPTPropertySearchResults")),{data:h,isLoading:S}=Digit.Hooks.pt.useMDMS(Digit.ULBService.getStateId(),"DIGIT-UI","HelpText",{select:e=>{var t,n,l;return null==e||null===(t=e["DIGIT-UI"])||void 0===t||null===(n=t.HelpText)||void 0===n||null===(l=n[0])||void 0===l?void 0:l.PT}});n.useEffect(()=>{1==sessionStorage.getItem("searchDetailValue")&&"searchId"===p&&v("searchDetail")},[p]);const b=n.useCallback(()=>{c(co),d({}),f(null)}),T=n.useCallback(e=>{c(e),Object.keys(e).filter(t=>e[t]&&"object"!=typeof e[t]).length>0?(d(Object.keys(e).filter(t=>e[t]).reduce((t,n)=>({...t,[n]:"object"==typeof e[n]?e[n].code:e[n]}),{})),f(null)):f({warning:!0,label:"ERR_PT_FILL_VALID_FIELDS"})});return S?l.createElement(t.Loader,null):l.createElement(l.Fragment,null,l.createElement(t.Header,null,r("SEARCH_PROPERTY")),l.createElement(_,{t:r,payload:s,searchBy:p,setSearchBy:v,PTSearchFields:so,tenantId:a,onSubmit:T,onReset:b}),Object.keys(u).length>0&&l.createElement(g,{t:r,showToast:m,setShowToast:f,tenantId:a,payload:u,ptSearchConfig:{...h},redirectToUrl:y}),m&&l.createElement(t.Toast,{error:m.error,warning:m.warning,label:r(m.label),onClose:()=>{f(null)}}))},vo=e=>{let{path:n,userType:r}=e;const{t:a}=o.useTranslation(),u=i.useLocation(),d=new URLSearchParams(i.useLocation().search).get("propertyId"),s=new URLSearchParams(i.useLocation().search).get("tenantId"),c=i.useLocation().search,p=new URLSearchParams(c).get("redirectToUrl"),v=new URLSearchParams(c).get("from")||"",m=[{path:"/digit-ui/employee",content:a("ES_COMMON_HOME"),show:!0},{path:{pathname:d?`${p}?propertyId=${d}&tenantId=${s}`:p,state:{...u.state}},content:p?(e=>e.includes("employee/tl/new-application")?a("ES_TITLE_NEW_TRADE_LICESE_APPLICATION"):e.includes("employee/ws/new-application")?a("ES_COMMON_WS_NEW_CONNECTION"):e.includes("employee/ws/modify-application")?a("WS_WATER_AND_SEWERAGE_MODIFY_CONNECTION_LABEL"):a("WF_EMPLOYEE_NEWTL_RENEWAL_SUBMIT_BUTTON"))(p):v&&a(v)||"NONE",show:(p||v)&&!0,isBack:v&&!0,isredirected:!0},{path:"/digit-ui/employee/dss/drilldown",content:u.pathname.includes("/commonpt/search")?a("SEARCH_PROPERTY"):u.pathname.includes("/view-property")?a("PT_PROPERTY_INFORMATION"):a("PT_NEW_PROPERTY"),show:!0}],f=window.location.href.includes("/employee/commonpt/new-application");return l.createElement("div",{className:"ground-container"},l.createElement("div",{style:f?{marginLeft:"12px"}:{}},l.createElement(t.BreadCrumb,{crumbs:m})),l.createElement(i.Switch,null,l.createElement(t.PrivateRoute,{exact:!0,path:n+"/",component:()=>l.createElement(bo,{matchPath:n,userType:r})}),l.createElement(t.PrivateRoute,{path:n+"/new-application",component:()=>l.createElement(t.LayoutWrapper,{layoutClass:"action"},l.createElement(uo,{path:n}))}),l.createElement(t.PrivateRoute,{path:n+"/search",component:po}),l.createElement(t.PrivateRoute,{path:n+"/view-property",component:ro})))},mo=/^\d+$/,fo=/^\d+(\.\d{1,2})?$/,Eo=e=>l.createElement("div",{className:"w-fullwidth PropertySearchFormSwitcher"},e.keys.map(t=>l.createElement("span",{key:t,className:e.searchBy===t?"selected":"non-selected",onClick:()=>{"searchDetail"===t&&!sessionStorage.getItem("searchDetailValue")&&sessionStorage.setItem("searchDetailValue",1),"searchId"===t&&1==sessionStorage.getItem("searchDetailValue")&&sessionStorage.setItem("searchDetailValue",2),e.onSwitch(t),e.onReset()}},e.t("PT_SEARCH_BY_"+(null==t?void 0:t.toUpperCase()))))),yo=e=>l.createElement("span",{className:"cell-text"},e);let _o=[];const go=e=>{let{currentStep:n=1,flow:i=""}=e;const{t:r}=o.useTranslation(),a=window.Digit.Utils.browser.isMobile();return(e=>{switch(e){case"STAKEHOLDER":_o=[];break;case"WS":_o=["WS_COMMON_CONNECTION_DETAIL","WS_COMMON_DOCUMENT_DETAILS","WS_COMMON_SUMMARY"];break;case"TL":_o=["TL_COMMON_TR_DETAILS","TL_LOCATION_AND_OWNER_DETAILS","TL_DOCUMENT_DETAIL","TL_COMMON_SUMMARY"];default:_o=[]}})(i),l.createElement("div",{className:"timeline-container",style:a?{}:{maxWidth:"960px",minWidth:"640px",marginRight:"auto"}},_o.map((e,o,i)=>l.createElement("div",{className:"timeline-checkpoint",key:o},l.createElement("div",{className:"timeline-content"},l.createElement("span",{className:"circle "+(o<=n-1&&"active")},o<n-1?l.createElement(t.TickMark,null):o+1),l.createElement("span",{className:"secondary-color"},r(e))),o<i.length-1&&l.createElement("span",{className:"line "+(o<n-1&&"active")}))))},ho={CPTPropertySearchForm:e=>{let{tenantId:o,t:i,onSubmit:r,onReset:u,searchBy:d,PTSearchFields:s,setSearchBy:c,payload:p}=e;const{register:v,control:m,handleSubmit:f,watch:E,getValues:y,formState:_}=a.useForm({defaultValues:{...p}}),g=E(),h=(null==s?void 0:s[d])||{};return n.useEffect(()=>{"true"===sessionStorage.getItem("isCreateEnabledEmployee")?(sessionStorage.removeItem("isCreateEnabledEmployee"),history.replace("/digit-ui/employee")):sessionStorage.removeItem("isCreateEnabledEmployee")}),l.createElement("div",{className:"PropertySearchForm"},l.createElement(t.SearchForm,{onSubmit:r,handleSubmit:f},l.createElement(Eo,{keys:Object.keys(s||{}),searchBy:d,onReset:u,t:i,onSwitch:c}),h&&Object.keys(h).map(e=>{var n,r,u;let d=h[e],s=(null==d?void 0:d.validation)||{};return l.createElement(t.SearchField,{key:e},l.createElement("label",null,i(null==d?void 0:d.label),null!=d&&null!==(n=d.validation)&&void 0!==n&&n.required?"*":""),"custom"===(null==d?void 0:d.type)?l.createElement(a.Controller,{name:e,defaultValue:null==g?void 0:g[e],rules:d.validation,control:m,render:(t,n)=>l.createElement(d.customComponent,A({selectLocality:e=>{t.onChange(e)},tenantId:o,selected:null==g?void 0:g[e]},d.customCompProps))}):l.createElement("div",{className:"field-container"},null!=d&&d.componentInFront?l.createElement("span",{className:"employee-card-input employee-card-input--front",style:{flex:"none"}},null==d?void 0:d.componentInFront):null,l.createElement(t.TextInput,{name:e,type:null==d?void 0:d.type,inputRef:v({value:y(e),shouldUnregister:!0,...s})})),l.createElement(t.CardLabelError,{style:{marginTop:"-10px",marginBottom:"-10px"}},i(null==_||null===(r=_.errors)||void 0===r||null===(u=r[e])||void 0===u?void 0:u.message)))}),l.createElement("div",{className:"pt-search-action"},l.createElement(t.SearchField,{className:"pt-search-action-reset"},l.createElement("p",{onClick:()=>{u({})}},i("ES_COMMON_CLEAR_ALL"))),l.createElement(t.SearchField,{className:"pt-search-action-submit"},l.createElement(t.SubmitBar,{label:i("ES_COMMON_SEARCH"),submit:!0})))))},CPTPropertySearchResults:e=>{var o,r;let{tenantId:a,t:u,payload:d,showToast:s,setShowToast:c,ptSearchConfig:p,redirectToUrl:v}=e;const m=i.useHistory(),{state:f}=i.useLocation(),E=i.useLocation().search,y=new URLSearchParams(E).get("propertyId");let _=window.location.href.includes("&")?window.location.href.substring(window.location.href.indexOf("&")+1,window.location.href.length):"";const[g,h]=n.useState({...d}),{data:S,isLoading:b,error:T}=Digit.Hooks.pt.usePropertySearchWithDue({tenantId:a,filters:g,configs:{enabled:Object.keys(d).length>0,retry:!1,retryOnMount:!1,staleTime:Infinity}}),C=n.useMemo(()=>[{Header:u("PT_COMMON_TABLE_COL_PT_ID"),disableSortBy:!0,Cell:e=>{let{row:t}=e;return l.createElement("div",null,l.createElement("span",{className:"link"},l.createElement("span",{onClick:()=>{m.push(`/digit-ui/employee/commonpt/view-property?propertyId=${t.original.propertyId}&tenantId=${a}&redirectToUrl=${v}`,{...f})}},t.original.propertyId)))}},{Header:u("PT_COMMON_TABLE_COL_OWNER_NAME"),disableSortBy:!0,Cell:e=>{let{row:t}=e;return yo(t.original.owners.sort((e,t)=>e.additionalDetails.ownerSequence-t.additionalDetails.ownerSequence).map(e=>e.name).join(",")||"")}},{Header:u("ES_INBOX_LOCALITY"),disableSortBy:!0,Cell:e=>{let{row:t}=e;return yo(u(t.original.locality)||"")}},{Header:u("PT_COMMON_TABLE_COL_STATUS_LABEL"),Cell:e=>{var t;let{row:n}=e;return yo(u((null==n||null===(t=n.original)||void 0===t?void 0:t.status)||"NA"))},disableSortBy:!0},{Header:u("PT_AMOUNT_DUE"),Cell:e=>{var t,n;let{row:l}=e;return yo(null!=l&&null!==(t=l.original)&&void 0!==t&&t.due?"₹ "+(null==l||null===(n=l.original)||void 0===n?void 0:n.due):u("PT_NA"))},disableSortBy:!0},{Header:u("ES_SEARCH_ACTION"),disableSortBy:!0,Cell:e=>{var t;let{row:n}=e;return l.createElement("div",null,"INACTIVE"!==(null==n||null===(t=n.original)||void 0===t?void 0:t.status)?l.createElement("span",{className:"link"},v?l.createElement("span",{onClick:()=>{m.push(_?`${v}?${null==_?void 0:_.replace(y,n.original.propertyId)}`:`${v}?propertyId=${n.original.propertyId}&tenantId=${a}`,{...f});const e=null!=v&&v.includes("employee/tl")?1600:300;setTimeout(()=>window.scrollTo(0,e),400)}},u("CPT_SELECT_PROPERTY")):null):u("PT_NA"))}}],[]);let A=window.Digit.Utils.browser.isMobile();if(b)return s&&c(null),l.createElement(t.Loader,null);var D,N,I,O;if(T)return!s&&c({error:!0,label:(null==T||null===(D=T.response)||void 0===D||null===(N=D.data)||void 0===N||null===(I=N.Errors)||void 0===I||null===(O=I[0])||void 0===O?void 0:O.code)||T}),null;const P=n.memo(Digit.ComponentRegistryService.getComponent("PTEmptyResultInbox")),w=Object.values((null==S?void 0:S.FormattedData)||{})||[];return null!=p&&p.ptSearchCount&&d.locality&&w&&w.length>(null==p?void 0:p.ptSearchCount)?(!s&&c({error:!0,label:"PT_MODIFY_SEARCH_CRITERIA"}),null):l.createElement(l.Fragment,null,0===(null==S||null===(o=S.Properties)||void 0===o?void 0:o.length)?l.createElement(P,{data:!0}):A?l.createElement(t.DetailsCard,{data:function(e){var t;return void 0===e&&(e=[]),null===(t=e)||void 0===t?void 0:t.map(e=>{const t={};return C.forEach(n=>{n.Cell&&(t[n.Header]=n.Cell({row:{original:e}}))}),t})}(w),t:u}):l.createElement(t.Table,{t:u,data:w,totalRecords:null==S||null===(r=S.Properties)||void 0===r?void 0:r.length,columns:C,getCellProps:e=>({style:{padding:"20px 18px",fontSize:"16px"}}),manualPagination:!1,disableSort:!0}))},CPTSearchProperty:Ee,CPTPropertyAssemblyDetails:e=>{var o,i,r,u,d,s,p,v,m,f,y,_;let{t:g,config:h,onSelect:S,formData:b,formState:T,setError:C,clearErrors:A}=e;const[D,N]=l.useState({...b.assemblyDet,BuildingType:null==b?void 0:b.PropertyType,floorarea:null==b?void 0:b.landArea,constructionArea:null==b?void 0:b.constructionArea,usageCategoryMajor:null!=b&&b.usageCategoryMajor&&"NONRESIDENTIAL.OTHERS"===(null==b||null===(o=b.usageCategoryMajor)||void 0===o?void 0:o.code)?{code:""+(null==b||null===(i=b.usageCategoryMajor)||void 0===i?void 0:i.code),i18nKey:"PROPERTYTAX_BILLING_SLAB_OTHERS"}:null==b?void 0:b.usageCategoryMajor}),[I,O]=l.useState("");let P=Digit.ULBService.getCurrentTenantId();const[w,R]=n.useState(!1),L=window.Digit.Utils.browser.isMobile();let x=[];console.log("Calling usePropertyMDMS with tenantId:",P);const{data:M=[]}=Digit.Hooks.pt.usePropertyMDMS(P,"PropertyTax","PTPropertyType")||{};x=(null==M||null===(r=M.PropertyTax)||void 0===r?void 0:r.PropertyType)||(Array.isArray(M)?M:[]);const{data:F=[]}=Digit.Hooks.pt.usePropertyMDMS(P,"PropertyTax","UsageCategory")||{};console.log("UsageCategory Menu Data (transformed):",F);let k=(null==F||null===(u=F.PropertyTax)||void 0===u?void 0:u.UsageCategory)||(Array.isArray(F)?F:[]);function U(e){let t=[];if(Array.isArray(e)&&e.length>0)for(let n=0;n<e.length;n++)1!=n&&4!=n&&t.push({i18nKey:"COMMON_PROPTYPE_"+E(e[n].code,".","_"),code:e[n].code});return t.sort((e,t)=>e.i18nKey.split("_").pop().localeCompare(t.i18nKey.split("_").pop())),t}function B(e){let t=[];for(let u=0;u<e.length;u++){var n,l,o,i,r,a;Array.isArray(e)&&e.length>0&&"NONRESIDENTIAL"==(null===(n=e[u])||void 0===n||null===(l=n.code)||void 0===l||null===(o=l.split)||void 0===o?void 0:o.call(l,".")[0])&&2==(null===(i=e[u])||void 0===i||null===(r=i.code)||void 0===r||null===(a=r.split)||void 0===a?void 0:a.call(r,".").length)&&t.push({i18nKey:"PROPERTYTAX_BILLING_SLAB_"+e[u].code.split(".")[1],code:e[u].code})}return t}const{control:j,formState:{errors:H,touched:W},trigger:V,watch:z,clearErrors:$}=a.useForm(),Y=z(),K={width:"70%",marginLeft:"30%",fontSize:"12px",marginTop:"-21px"};return l.useEffect(()=>{let e=!1;const t={};Object.keys(D).forEach(e=>{t[e]=null==Y?void 0:Y[e]}),c.isEqual(t,D)||Object.keys(D).forEach(t=>{D[t]?(e=!1,$(t)):e=!0}),e?C(null==h?void 0:h.key,{type:H}):A(null==h?void 0:h.key),V(),R(e),S(null==h?void 0:h.key,D)},[D]),l.useEffect(()=>{var e;Object.keys(H).length&&!c.isEqual((null===(e=T.errors[h.key])||void 0===e?void 0:e.type)||{},H)?C(h.key,{type:H}):!Object.keys(H).length&&T.errors[h.key]&&w&&A(h.key)},[H]),l.createElement("div",null,l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,g("PT_PROP_TYPE")+"*"),l.createElement("div",{className:"form-field"},l.createElement(a.Controller,{name:"BuildingType",control:j,defaultValue:null==D?void 0:D.BuildingType,rules:{required:g("REQUIRED_FIELD")},key:null==h?void 0:h.key,render:e=>{var n,o;return l.createElement(t.Dropdown,{selected:1===(null===(n=U(x))||void 0===n?void 0:n.length)?U(x)[0]:null==D?void 0:D.BuildingType,disable:1===(null===(o=U(x))||void 0===o?void 0:o.length),option:U(x),autoFocus:"BuildingType"===I,select:t=>{e.onChange(t),N({...D,BuildingType:t}),O("BuildingType")},optionKey:"i18nKey",onBlur:null==e?void 0:e.onBlur,t:g})}}))),(null==W?void 0:W.BuildingType)&&(null==H||null===(d=H.BuildingType)||void 0===d?void 0:d.message)&&l.createElement(t.CardLabelError,{style:K},null==H||null===(s=H.BuildingType)||void 0===s?void 0:s.message),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,g("PT_TOT_LAND_AREA")+"*"),l.createElement("div",{className:"form-field"},l.createElement(a.Controller,{name:"floorarea",control:j,defaultValue:null==D?void 0:D.floorarea,rules:{required:g("REQUIRED_FIELD"),validate:e=>!!/^([0-9]){0,8}$/i.test(e)||g("PT_TOT_LAND_AREA_ERROR_MESSAGE")},key:null==h?void 0:h.key,render:e=>l.createElement(t.TextInput,{t:g,type:"number",isMandatory:!1,optionKey:"i18nKey",name:"totLandArea",value:null==e?void 0:e.value,autoFocus:"floorarea"===I,onChange:t=>{null==e||e.onChange(t.target.value),N({...D,floorarea:t.target.value}),O("floorarea")},onBlur:null==e?void 0:e.onBlur})}))),(null==W?void 0:W.floorarea)&&(null==H||null===(p=H.floorarea)||void 0===p?void 0:p.message)&&l.createElement(t.CardLabelError,{style:K},null==H||null===(v=H.floorarea)||void 0===v?void 0:v.message),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,g("PT_TOT_CONSTRUCTION_AREA")+"*"),l.createElement("div",{className:"form-field"},l.createElement(a.Controller,{name:"constructionArea",control:j,defaultValue:null==D?void 0:D.constructionArea,key:null==h?void 0:h.key,rules:{required:g("REQUIRED_FIELD"),validate:e=>!!(/^([0-9]){0,8}$/i.test(e)&&null!=D&&D.floorarea&&parseInt(e)<parseInt(null==D?void 0:D.floorarea))||g("PT_TOT_CONSTRUCTION_AREA_ERROR_MESSAGE")},render:e=>l.createElement(t.TextInput,{t:g,type:"number",isMandatory:!1,optionKey:"i18nKey",name:"totConstructionArea",value:null==e?void 0:e.value,autoFocus:"constructionArea"===I,onChange:t=>{null==e||e.onChange(t.target.value),O("constructionArea"),N({...D,constructionArea:t.target.value})},onBlur:null==e?void 0:e.onBlur})}))),(null==W?void 0:W.constructionArea)&&(null==H||null===(m=H.constructionArea)||void 0===m?void 0:m.message)&&l.createElement(t.CardLabelError,{style:L?{...K,marginLeft:"0px"}:{...K}},null==H||null===(f=H.constructionArea)||void 0===f?void 0:f.message),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,g("PT_ASSESMENT_INFO_USAGE_TYPE")+"*"),l.createElement("div",{className:"form-field"},l.createElement(a.Controller,{name:"usageCategoryMajor",defaultValue:null==D?void 0:D.usageCategoryMajor,rules:{required:g("REQUIRED_FIELD")},control:j,key:null==h?void 0:h.key,render:e=>{var n;return l.createElement(t.Dropdown,{selected:null==e?void 0:e.value,disable:1===(null===(n=B(k))||void 0===n?void 0:n.length),option:B(k),autoFocus:"usageCategoryMajor"===I,select:t=>{null==e||e.onChange(t),O("usageCategoryMajor"),N({...D,usageCategoryMajor:t})},optionKey:"i18nKey",onBlur:null==e?void 0:e.onBlur,t:g})}}))),(null==W?void 0:W.usageCategoryMajor)&&(null==H||null===(y=H.usageCategoryMajor)||void 0===y?void 0:y.message)&&l.createElement(t.CardLabelError,{style:K},null==H||null===(_=H.usageCategoryMajor)||void 0===_?void 0:_.message))},CPTPropertyLocationDetails:e=>{var i,r,u;let{address:d,isEdit:s,onSelect:c,config:p,formData:v,...m}=e;const{t:f}=o.useTranslation(),[E,y]=(Digit.Hooks.useTenants(),a.useForm(),n.useState(null)),[_,g]=n.useState({addressType:(null==d?void 0:d.addressType)||"",pincode:(null==d?void 0:d.pinCode)||"",city:(null==d?void 0:d.city)||"",locality:(null==d?void 0:d.locality)||"",streetName:(null==d?void 0:d.streetName)||"",houseNo:(null==d?void 0:d.houseNumber)||"",houseName:(null==d?void 0:d.houseName)||"",landmark:(null==d?void 0:d.landmark)||"",addressLine1:(null==d?void 0:d.address)||"",addressLine2:(null==d?void 0:d.address2)||"",latitude:(null==d?void 0:d.latitude)||"",longitude:(null==d?void 0:d.longitude)||"",assembly:(null==d?void 0:d.assembly)||"",block:(null==d?void 0:d.block)||"",zone:(null==d?void 0:d.zone)||"",zro:(null==d?void 0:d.zro)||""}),h=!(null==v||null===(i=v.cpt)||void 0===i||null===(r=i.details)||void 0===r||!r.propertyId);return n.useEffect(()=>{var e;if(null!=v&&null!==(e=v.cpt)&&void 0!==e&&e.details){var t,n,l,o,i,r,a,u,d,s,c,p,m,f,E;const e=v.cpt.details,y=e.address||{},_=e.additionalDetails||{},h=(null===(t=y.locality)||void 0===t?void 0:t.code)||y.locality||"",S=null!==(n=y.geoLocation)&&void 0!==n&&n.latitude&&0!==(null===(l=y.geoLocation)||void 0===l?void 0:l.latitude)?y.geoLocation.latitude:(null===(o=y.locality)||void 0===o?void 0:o.latitude)||y.latitude||"",b=null!==(i=y.geoLocation)&&void 0!==i&&i.longitude&&0!==(null===(r=y.geoLocation)||void 0===r?void 0:r.longitude)?y.geoLocation.longitude:(null===(a=y.locality)||void 0===a?void 0:a.longitude)||y.longitude||"";g({pincode:y.pincode||"",city:y.city||"",locality:h,streetName:y.street||"",houseNo:y.houseNo||"",landmark:y.landmark||"",latitude:S,longitude:b,assembly:_.assembly||(null===(u=y.additionalDetails)||void 0===u?void 0:u.assembly)||"",block:_.block||(null===(d=y.additionalDetails)||void 0===d?void 0:d.block)||"",zone:_.zone||(null===(s=y.additionalDetails)||void 0===s?void 0:s.zone)||"",zro:_.zro||(null===(c=y.additionalDetails)||void 0===c?void 0:c.zro)||"",address:{...y,city:y.city||"",pincode:y.pincode||"",locality:h,streetName:y.street||"",houseNo:y.houseNo||"",addressLine1:y.street||"",latitude:S,longitude:b,zro:_.zro||(null===(p=y.additionalDetails)||void 0===p?void 0:p.zro)||"",assembly:_.assembly||(null===(m=y.additionalDetails)||void 0===m?void 0:m.assembly)||"",block:_.block||(null===(f=y.additionalDetails)||void 0===f?void 0:f.block)||"",zone:_.zone||(null===(E=y.additionalDetails)||void 0===E?void 0:E.zone)||""}})}},[null==v||null===(u=v.cpt)||void 0===u?void 0:u.details]),n.useEffect(()=>{if(E){const e=setTimeout(()=>{y(null)},1e3);return()=>clearTimeout(e)}},[E]),Digit.Hooks.useAddress(null,Digit.ULBService.getCurrentTenantId()),l.createElement(t.CollapsibleCardPage,{title:f("PT_LOCATION_DETAILS"),defaultOpen:!0},l.createElement("div",{style:{boxShadow:"none",...m.style}},l.createElement(t.AddressDetails,{t:f,formData:_,onSelect:(e,t)=>{g(t),c(e,t)},config:{isCollapsible:!1,...p},isEdit:s,showZRO:!0,disable:h,hideNextButton:!0})))},CPTPropertyOwnerDetails:e=>{var o,r,u,d,s,p,v,m,f,E,y,_,g,h,S;let{t:b,config:T,onSelect:C,formData:A,formState:D,setError:N,clearErrors:I,...O}=e;const{pathname:P}=i.useLocation(),w=P.includes("/modify-application/"),R=(P.includes("/property-mutation/"),window.Digit.Utils.browser.isMobile()),[L,x]=l.useState((null==A?void 0:A.ownershipCategory)||""),[M,F]=l.useState([{...A.owners&&A.owners[0],name:A.owners&&A.owners[0]&&A.owners[0].name||(null==A||null===(o=A.owners)||void 0===o?void 0:o.name)||"",gender:A.owners&&A.owners[0]&&A.owners[0].gender||(null==A||null===(r=A.owners)||void 0===r?void 0:r.gender),mobileNumber:A.owners&&A.owners[0]&&A.owners[0].mobileNumber||(null==A||null===(u=A.owners)||void 0===u?void 0:u.mobileNumber)||"",fatherOrHusbandName:A.owners&&A.owners[0]&&A.owners[0].fatherOrHusbandName||(null==A||null===(d=A.owners)||void 0===d?void 0:d.fatherOrHusbandName)||"",relationship:A.owners&&A.owners[0]&&A.owners[0].relationship||(null==A||null===(s=A.owners)||void 0===s?void 0:s.relationship),ownershipCategory:L,ownerType:A.owners&&A.owners[0]&&(null===(p=A.owners[0])||void 0===p?void 0:p.ownerType)||(null===(v=A.owners)||void 0===v?void 0:v.ownerType),permanentAddress:A.owners&&A.owners[0]&&A.owners[0].permanentAddress||(null==A||null===(m=A.owners)||void 0===m?void 0:m.permanentAddress)||"",email:A.owners&&A.owners[0]&&A.owners[0].email||(null==A||null===(f=A.owners)||void 0===f?void 0:f.emailId)||"",isCoresAddr:!1}]),[k,U]=n.useState(!1),[B,j]=l.useState(!1),H=(null==A?void 0:A.isUpdateProperty)||!1;let W=(null==A?void 0:A.isEditProperty)||!1;const V=Digit.ULBService.getStateId(),z=Digit.ULBService.getCurrentTenantId(),{data:$}=Digit.Hooks.pt.useGenderMDMS(V,"common-masters","GenderType");let Y=[];$&&$.map(e=>{Y.push({i18nKey:"PT_COMMON_GENDER_"+e.code,code:""+e.code,value:""+e.code})});const{data:K}=Digit.Hooks.pt.usePropertyMDMS(z,"PropertyTax","OwnerType"),q=(null==K||null===(E=K.PropertyTax)||void 0===E?void 0:E.OwnerType)||(Array.isArray(K)?K:[]),{data:G}=Digit.Hooks.pt.usePropertyMDMS(z,"PropertyTax",["OwnerShipCategory"]),[Z,X]=n.useState(null==A||null===(y=A.owners)||void 0===y?void 0:y.isCorrespondenceAddress),J=[{name:"HUSBAND",code:"HUSBAND",i18nKey:"PT_RELATION_HUSBAND"},{name:"Father",code:"FATHER",i18nKey:"PT_RELATION_FATHER"}],{control:Q,formState:{errors:ee,touched:te},trigger:ne,watch:le,clearErrors:oe}=a.useForm(),ie=le();n.useEffect(()=>{let e=!1;const t={};M.map(n=>{Object.keys(n).forEach(e=>{t[e]=null==ie?void 0:ie[e]}),c.isEqual(t,n)||Object.keys(n).forEach(t=>{n[t]?(e=!1,oe(t)):e=!0})}),e?N(null==T?void 0:T.key,{type:ee}):I(null==T?void 0:T.key),ne(),U(e),C(null==T?void 0:T.key,M.map(e=>({...e,ownershipCategory:L})))},[M]),n.useEffect(()=>{var e;Object.keys(ee).length&&!c.isEqual((null===(e=D.errors[T.key])||void 0===e?void 0:e.type)||{},ee)?N(T.key,{type:ee}):!Object.keys(ee).length&&D.errors[T.key]&&k&&I(T.key)},[ee]);const re=function(e,t,n){void 0===e&&(e="name"),void 0===t&&(t=0),void 0===n&&(n=""),F(M.map((l,o)=>(o===t&&(l[e]=n),{...l})))},ae=(n.useMemo(()=>{var e,t,n;return null==G||null===(e=G.PropertyTax)||void 0===e||null===(t=e.OwnerShipCategory)||void 0===t||null===(n=t.filter(e=>"INDIVIDUAL.SINGLEOWNER"===e.code||"INDIVIDUAL.MULTIPLEOWNERS"===e.code||1===e.code.split(".").length&&e.code.includes("INSTITUTIONAL")))||void 0===n?void 0:n.map(e=>({...e,i18nKey:"PT_OWNERSHIP_CATEGORY_"+e.code.replaceAll(".","_")}))},[G]),n.useMemo(()=>{var e,t;const n=null==L?void 0:L.code,l=null==G||null===(e=G.PropertyTax)||void 0===e||null===(t=e.OwnerShipCategory)||void 0===t?void 0:t.filter(e=>{var t;return(null==e||null===(t=e.code)||void 0===t?void 0:t.split(".")[0])==(null==n?void 0:n.split(".")[0])}),o=null==l?void 0:l.filter(e=>{var t,n;return null==e||null===(t=e.code)||void 0===t||null===(n=t.split("."))||void 0===n?void 0:n[1]});return null==o?void 0:o.map(e=>{var t,n,l;return(null===(t=e.code)||void 0===t||null===(n=t.split("."))||void 0===n?void 0:n[1])&&{...e,i18nKey:"PT_OWNERSHIP_CATEGORY_"+(null===(l=e.code)||void 0===l?void 0:l.replaceAll(".","_"))}})},[G,null==L?void 0:L.code]),{width:"70%",marginLeft:"30%",fontSize:"12px",marginTop:"-21px"}),ue=!(null==L||null===(_=L.code)||void 0===_||!_.includes("MULTIPLEOWNERS"));return null==L||null===(g=L.code)||void 0===g||g.includes("INSTITUTIONAL"),l.createElement(t.CollapsibleCardPage,{title:b("PT_OWNER_DETAILS"),defaultOpen:!0,style:O.style},null==M?void 0:M.map((e,n)=>{var o,i,r,u,d,s,c,p,v,m,f,E,y,_;return l.createElement("div",{key:n},R&&ue&&M.length>1&&l.createElement("div",{style:{display:"flex",justifyContent:"flex-end"}},l.createElement(t.LinkButton,{label:l.createElement(t.DeleteIcon,{style:{bottom:"5px"},fill:1!=M.length?"#494848":"#FAFAFA"}),style:{margin:"0px"},onClick:e=>{F([...M.filter((e,t)=>t!=n)])}})),l.createElement(l.Fragment,null,l.createElement("div",{className:"formcomposer-section-grid"},l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,b("PT_FORM3_MOBILE_NUMBER")+"*"),l.createElement("div",{className:"form-field"},l.createElement(a.Controller,{key:"mobileNumber"+n,name:"mobileNumber"+n,defaultValue:e.mobileNumber,control:Q,rules:{required:b("REQUIRED_FIELD"),validate:e=>!!/[6-9]{1}[0-9]{9}/i.test(e)||b("CORE_COMMON_APPLICANT_MOBILE_NUMBER_INVALID")},render:e=>{let{value:o,onChange:i,onBlur:r}=e;return l.createElement(t.MobileNumber,{value:o,name:"mobileNumber"+n,onChange:e=>{i(e),re("mobileNumber",n,e)},disable:H||W,labelStyle:{border:"1px solid #000",borderRight:"none"},onBlur:r})}})),!R&&l.createElement("div",{style:{display:"flex",justifyContent:"flex-end",width:"20%",alignSelf:"flex-start"}},ue&&l.createElement(t.LinkButton,{label:l.createElement(t.DeleteIcon,{style:{bottom:"0px"},fill:1!=M.length?"#494848":"#FAFAFA"}),style:{margin:"0px"},onClick:e=>{F([...M.filter((e,t)=>t!=n)])}}))),(null==te?void 0:te["mobileNumber"+n])&&(null==ee||null===(o=ee["mobileNumber"+n])||void 0===o?void 0:o.message)&&l.createElement(t.CardLabelError,{style:ae},null==ee||null===(i=ee["mobileNumber"+n])||void 0===i?void 0:i.message),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,b("PT_OWNER_NAME")+"*"),l.createElement("div",{className:"form-field"},l.createElement(a.Controller,{key:"name"+n,name:"name"+n,defaultValue:null==e?void 0:e.name,control:Q,rules:{required:b("REQUIRED_FIELD"),validate:e=>!!/^[a-zA-Z ]+$/i.test(e)||b("PT_NAME_ERROR_MESSAGE")},render:e=>{let{value:o,onChange:i,onBlur:r}=e;return l.createElement(t.TextInput,{t:b,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"name"+n,value:o,onChange:e=>{i(e.target.value),re("name",n,e.target.value)},disable:H||W,onBlur:r})}}))),(null==te?void 0:te["name"+n])&&(null==ee||null===(r=ee["name"+n])||void 0===r?void 0:r.message)&&l.createElement(t.CardLabelError,{style:ae},null==ee||null===(u=ee["name"+n])||void 0===u?void 0:u.message),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,b("PT_FORM3_GENDER")+"*"),l.createElement("div",{className:"form-field"},l.createElement(a.Controller,{key:"gender"+n,name:"gender"+n,defaultValue:null==e?void 0:e.gender,control:Q,rules:{required:b("REQUIRED_FIELD")},render:e=>{let{value:o,onChange:i,onBlur:r}=e;return l.createElement(t.RadioOrSelect,{name:"gender"+n,options:Y,selectedOption:o,optionKey:"code",onSelect:e=>{i(e),re("gender",n,e)},t:b,disabled:H||W,isDropDown:!!window.location.href.includes("/employee"),onBlur:r})}}))),(null==te?void 0:te["gender"+n])&&(null==ee||null===(d=ee["gender"+n])||void 0===d?void 0:d.message)&&l.createElement(t.CardLabelError,{style:ae},null==ee||null===(s=ee["gender"+n])||void 0===s?void 0:s.message),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,b("PT_FORM3_GUARDIAN_NAME")+"*"),l.createElement("div",{className:"form-field"},l.createElement(a.Controller,{key:"fatherOrHusbandName"+n,name:"fatherOrHusbandName"+n,defaultValue:null==e?void 0:e.fatherOrHusbandName,control:Q,rules:{required:b("REQUIRED_FIELD"),validate:e=>!!/^[a-zA-Z ]+$/i.test(e)||b("PT_NAME_ERROR_MESSAGE")},render:e=>{let{value:o,onChange:i,onBlur:r}=e;return l.createElement(t.TextInput,{t:b,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"fatherOrHusbandName"+n,value:o,onChange:e=>{i(e.target.value),re("fatherOrHusbandName",n,e.target.value)},disable:H||W,onBlur:r})}}))),(null==te?void 0:te["fatherOrHusbandName"+n])&&(null==ee||null===(c=ee["fatherOrHusbandName"+n])||void 0===c?void 0:c.message)&&l.createElement(t.CardLabelError,{style:ae},null==ee||null===(p=ee["fatherOrHusbandName"+n])||void 0===p?void 0:p.message),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,b("PT_FORM3_RELATIONSHIP")+"*"),l.createElement("div",{className:"form-field"},l.createElement(a.Controller,{key:"relationship"+n,name:"relationship"+n,defaultValue:null==e?void 0:e.relationship,control:Q,rules:{required:b("REQUIRED_FIELD")},render:e=>{let{value:o,onChange:i,onBlur:r}=e;return l.createElement(t.RadioOrSelect,{name:"relationship"+n,options:J,selectedOption:o,optionKey:"i18nKey",onSelect:e=>{i(e),re("relationship",n,e)},t:b,disabled:H||W,isDropDown:!!window.location.href.includes("/employee"),onBlur:r})}}))),(null==te?void 0:te["relationship"+n])&&(null==ee||null===(v=ee["relationship"+n])||void 0===v?void 0:v.message)&&l.createElement(t.CardLabelError,{style:ae},null==ee||null===(m=ee["relationship"+n])||void 0===m?void 0:m.message),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:""},b("PT_SPECIAL_APPLICANT_CATEGORY")+"*"),l.createElement("div",{className:"form-field"},l.createElement(a.Controller,{key:"ownerType"+n,name:"ownerType"+n,defaultValue:null==e?void 0:e.ownerType,control:Q,rules:{required:b("REQUIRED_FIELD")},render:e=>{let{value:o,onChange:i,onBlur:r}=e;return l.createElement(t.Dropdown,{selected:1===(null==q?void 0:q.length)?q[0]:o,disable:1===(null==q?void 0:q.length)||w,option:q?q.sort((e,t)=>e.name.localeCompare(t.name)):[],select:e=>{i(e),re("ownerType",n,e)},optionKey:"i18nKey",t:b,onBlur:r})}}))),(null==te?void 0:te["ownerType"+n])&&(null==ee||null===(f=ee["ownerType"+n])||void 0===f?void 0:f.message)&&l.createElement(t.CardLabelError,{style:ae},null==ee||null===(E=ee["ownerType"+n])||void 0===E?void 0:E.message),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,b("PT_CORRESPONDANCE_ADDRESS")),l.createElement("div",{className:"form-field"},l.createElement(t.TextArea,{isMandatory:!1,optionKey:"i18nKey",t:b,disabled:!0===(null==M||null===(y=M[n])||void 0===y?void 0:y.isCoresAddr),name:"address"+n,onChange:e=>{var t;!0!==(null==M||null===(t=M[n])||void 0===t?void 0:t.isCoresAddr)&&re("permanentAddress",n,e.target.value)},value:null==M||null===(_=M[n])||void 0===_?void 0:_.permanentAddress}))))))}),ue?l.createElement("div",null,l.createElement("div",{style:{display:"flex",paddingBottom:"15px",color:"#FF8C00"}},l.createElement("button",{type:"button",style:{paddingTop:"10px"},onClick:()=>F(e=>[...e,{name:"",gender:"",mobileNumber:"",fatherOrHusbandName:"",relationship:"",ownershipCategory:L,ownerType:"",permanentAddress:"",email:"",isCoresAddr:!1}])},b("PT_COMMON_ADD_APPLICANT_LABEL"))),l.createElement(t.CardLabelError,{style:{width:"70%",marginLeft:"30%",fontSize:"12px",marginTop:"-35px"}},b((null===(h=D.errors)||void 0===h||null===(S=h.mulipleOwnerError)||void 0===S?void 0:S.message)||""))):null)},PropertyWaterConnection:e=>{var o,i,r,u,d,s,p,v,m,f,E,y,_;let{t:g,config:h,onSelect:S,formData:b,setError:T,clearErrors:C,...A}=e;const{control:D,register:N,formState:{errors:I},watch:O,setValue:P}=a.useForm({defaultValues:(null==b?void 0:b[h.key])||{useDetails:{propertyCategory:null,propertyType:null,WaterConnectionUsageType:null,noOfFloors:null,plotArea:"",builtUpArea:"",SelectYearofConstruction:null,NumberofDwellingUnits:"",NumberofRooms:"",hospitalBeds:""}}}),w=Digit.ULBService.getCurrentTenantId(),{data:R}=Digit.Hooks.pt.usePropertyMDMS(w,"PropertyTax",["PropertyCategory","PropertyType","NoOfFloors","PropertyNewUsageType"]),L=!(null==b||null===(o=b.cpt)||void 0===o||null===(i=o.details)||void 0===i||!i.propertyId),x=O(),M=O("useDetails.propertyType"),F=(O("useDetails.propertyCategory"),"HOSPITAL_NURSING_HOME"===(null==M?void 0:M.code)||"HospitalNursingHome"===(null==M?void 0:M.code)),k=n.useMemo(()=>{const e=(new Date).getFullYear(),t=[];for(let n=e;n>=e-100;n--)t.push({value:n.toString(),name:n.toString()});return t},[]),U=n.useMemo(()=>{var e,t;return null==R||null===(e=R.PropertyTax)||void 0===e||null===(t=e.PropertyCategory)||void 0===t?void 0:t.filter(e=>e.active).map(e=>({code:e.code,name:e.name}))},[R]),B=n.useMemo(()=>{var e,t;return(null==R||null===(e=R.PropertyTax)||void 0===e||null===(t=e.PropertyType)||void 0===t?void 0:t.filter(e=>e.active).map(e=>({code:e.code,name:e.name})))||[]},[R]),j=n.useMemo(()=>{var e,t;return null==R||null===(e=R.PropertyTax)||void 0===e||null===(t=e.PropertyNewUsageType)||void 0===t?void 0:t.filter(e=>e.active).map(e=>({code:e.code,name:e.name}))},[R]),H=n.useMemo(()=>{var e,t;return null==R||null===(e=R.PropertyTax)||void 0===e||null===(t=e.NoOfFloors)||void 0===t?void 0:t.filter(e=>e.active).map(e=>({code:e.code,name:e.name}))},[R]),W=l.useRef(null);n.useEffect(()=>{c.isEqual(W.current,x)||(W.current=c.cloneDeep(x),S(h.key,x))},[x,h.key,S]),n.useEffect(()=>{var e;if(null!=b&&null!==(e=b.cpt)&&void 0!==e&&e.details){const e=b.cpt.details,t=(null==e?void 0:e.additionalDetails)||{};P("useDetails.propertyCategory",(null==U?void 0:U.find(e=>e.code===t.propertyCategory))||null),P("useDetails.propertyType",(null==B?void 0:B.find(e=>e.code===t.propertyType))||null),P("useDetails.WaterConnectionUsageType",(null==j?void 0:j.find(e=>e.code===t.waterConnectionUsageType))||null),P("useDetails.noOfFloors",(null==H?void 0:H.find(n=>{var l;return n.code===((null===(l=e.noOfFloors)||void 0===l?void 0:l.toString())||t.noOfFloors)}))||null),P("useDetails.plotArea",t.plotArea||""),P("useDetails.builtUpArea",t.builtUpArea||""),P("useDetails.SelectYearofConstruction",(null==k?void 0:k.find(e=>e.value===t.yearOfConstruction))||null),P("useDetails.NumberofDwellingUnits",t.numberOfDwellingUnits||""),P("useDetails.NumberofRooms",t.numberOfRooms||"")}},[null==b||null===(r=b.cpt)||void 0===r?void 0:r.details,U,B,j,H,k,P]);const V=l.useRef(null);n.useEffect(()=>{const e=Object.keys(I).length>0;V.current!==e&&(V.current=e,e?T(h.key,{type:"custom",message:"Validation failed"}):C(h.key))},[I,h.key,T,C]);const z={width:"70%",marginLeft:"30%",fontSize:"12px",marginTop:"-21px"};return l.createElement(t.CollapsibleCardPage,{title:g("WS_PROPERTY_AND_WATER_CONNECTION_USE_DETAILS"),defaultOpen:!0,style:A.style},l.createElement("div",{className:"formcomposer-section-grid"},l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,g("WS_PROPERTY_CATEGORY")+"*"),l.createElement("div",{className:"form-field"},l.createElement(a.Controller,{control:D,name:"useDetails.propertyCategory",rules:{required:g("REQUIRED_FIELD")},render:e=>l.createElement(t.Dropdown,{option:U,optionKey:"name",selected:e.value,select:e.onChange,t:g,onBlur:e.onBlur,disable:L})}))),(null==I||null===(u=I.useDetails)||void 0===u?void 0:u.propertyCategory)&&l.createElement(t.CardLabelError,{style:z},I.useDetails.propertyCategory.message),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,g("WS_PROPERTY_TYPE")+"*"),l.createElement("div",{className:"form-field"},l.createElement(a.Controller,{control:D,name:"useDetails.propertyType",rules:{required:g("REQUIRED_FIELD")},render:e=>l.createElement(t.Dropdown,{option:B,optionKey:"name",selected:e.value,select:e.onChange,t:g,onBlur:e.onBlur,disable:L})}))),(null==I||null===(d=I.useDetails)||void 0===d?void 0:d.propertyType)&&l.createElement(t.CardLabelError,{style:z},I.useDetails.propertyType.message),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,g("WS_WATER_CONNECTION_USAGE_TYPE")+"*"),l.createElement("div",{className:"form-field"},l.createElement(a.Controller,{control:D,name:"useDetails.WaterConnectionUsageType",rules:{required:g("REQUIRED_FIELD")},render:e=>l.createElement(t.Dropdown,{option:j,optionKey:"name",selected:e.value,select:e.onChange,t:g,onBlur:e.onBlur,disable:L})}))),(null==I||null===(s=I.useDetails)||void 0===s?void 0:s.WaterConnectionUsageType)&&l.createElement(t.CardLabelError,{style:z},I.useDetails.WaterConnectionUsageType.message),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,g("WS_NUMBER_OF_FLOORS")+"*"),l.createElement("div",{className:"form-field"},l.createElement(a.Controller,{control:D,name:"useDetails.noOfFloors",rules:{required:g("REQUIRED_FIELD")},render:e=>l.createElement(t.Dropdown,{option:H,optionKey:"name",selected:e.value,select:e.onChange,t:g,onBlur:e.onBlur,disable:L})}))),(null==I||null===(p=I.useDetails)||void 0===p?void 0:p.noOfFloors)&&l.createElement(t.CardLabelError,{style:z},I.useDetails.noOfFloors.message),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,g("WS_PLOT_AREA")+"*"),l.createElement("div",{className:"form-field"},l.createElement(t.TextInput,{t:g,inputRef:N({pattern:{value:fo,message:g("ERR_INVALID_DECIMAL")},required:g("REQUIRED_FIELD")}),name:"useDetails.plotArea",disabled:L}))),(null==I||null===(v=I.useDetails)||void 0===v?void 0:v.plotArea)&&l.createElement(t.CardLabelError,{style:z},I.useDetails.plotArea.message),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,g("WS_BUILT_UP_AREA")+"*"),l.createElement("div",{className:"form-field"},l.createElement(t.TextInput,{t:g,inputRef:N({pattern:{value:fo,message:g("ERR_INVALID_DECIMAL")},required:g("REQUIRED_FIELD")}),name:"useDetails.builtUpArea",disabled:L}))),(null==I||null===(m=I.useDetails)||void 0===m?void 0:m.builtUpArea)&&l.createElement(t.CardLabelError,{style:z},I.useDetails.builtUpArea.message),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,g("WS_SELECT_YEAR_OF_CONSTRUCTION")+"*"),l.createElement("div",{className:"form-field"},l.createElement(a.Controller,{control:D,name:"useDetails.SelectYearofConstruction",rules:{required:g("REQUIRED_FIELD")},render:e=>l.createElement(t.Dropdown,{option:k,optionKey:"value",selected:e.value,select:e.onChange,t:g,onBlur:e.onBlur,disable:L})}))),(null==I||null===(f=I.useDetails)||void 0===f?void 0:f.SelectYearofConstruction)&&l.createElement(t.CardLabelError,{style:z},I.useDetails.SelectYearofConstruction.message),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,g("WS_NUMBER_OF_DWELLING_UNITS")+"*"),l.createElement("div",{className:"form-field"},l.createElement(t.TextInput,{t:g,inputRef:N({pattern:{value:mo,message:g("ERR_INVALID_NUMBER")},required:g("REQUIRED_FIELD")}),name:"useDetails.NumberofDwellingUnits",disabled:L}))),(null==I||null===(E=I.useDetails)||void 0===E?void 0:E.NumberofDwellingUnits)&&l.createElement(t.CardLabelError,{style:z},I.useDetails.NumberofDwellingUnits.message),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,g("WS_NUMBER_OF_ROOMS")+"*"),l.createElement("div",{className:"form-field"},l.createElement(t.TextInput,{t:g,inputRef:N({pattern:{value:mo,message:g("ERR_INVALID_NUMBER")},required:g("REQUIRED_FIELD")}),name:"useDetails.NumberofRooms",disabled:L}))),(null==I||null===(y=I.useDetails)||void 0===y?void 0:y.NumberofRooms)&&l.createElement(t.CardLabelError,{style:z},I.useDetails.NumberofRooms.message),F?l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,g("WS_NUMBER_OF_BEDS")+"*"),l.createElement("div",{className:"form-field"},l.createElement(t.TextInput,{t:g,inputRef:N({pattern:{value:mo,message:g("ERR_INVALID_NUMBER")},required:!!F&&g("REQUIRED_FIELD")}),name:"useDetails.hospitalBeds",disabled:L}))):null,F&&(null==I||null===(_=I.useDetails)||void 0===_?void 0:_.hospitalBeds)&&l.createElement(t.CardLabelError,{style:z},I.useDetails.hospitalBeds.message)))},CPTKnowYourProperty:e=>{var o,i;let{t:r,config:a,onSelect:u,formData:d}=e;const[s,c]=n.useState(null===(o=d)||void 0===o||null===(i=o.PropDetails)||void 0===i?void 0:i.KnowProperty);if(window.location.href.includes("/tl/tradelicence/edit-application/")||window.location.href.includes("/renew-trade/")){let e=JSON.parse(sessionStorage.getItem("EditFormData"));d={...d,...e}}return l.createElement(l.Fragment,null,window.location.href.includes("/citizen")?l.createElement(go,null):null,l.createElement(t.FormStep,{t:r,config:a,onSelect:function(){sessionStorage.setItem("KnowProperty",s.i18nKey),u(a.key,{KnowProperty:s})},onSkip:()=>u(),isDisabled:!s},l.createElement(t.RadioButtons,{t:r,optionsKey:"i18nKey",isMandatory:a.isMandatory,options:[{i18nKey:"TL_COMMON_YES",code:"YES"},{i18nKey:"TL_COMMON_NO",code:"NO"}],selectedOption:s,onSelect:function(e){c(e)}})))},CPTPropertyDetails:e=>{var n,o,r,a,u,d,s,c,p,v,m,f,E,y,g,h,S,b,T,C,A,D,N,I,O,P,w,R,L,x,M,F,k,U,B,j,H,W,V,z,$,Y,K,q,G,Z,X,J,Q,ee,te,ne,le,oe,ie,re,ae,ue,de,se,ce,pe,ve,me,fe;let{t:Ee,config:ye,onSelect:_e,formData:ge}=e;const he=("YES"===(null===(n=ge)||void 0===n||null===(o=n.knowyourproperty)||void 0===o||null===(r=o.KnowProperty)||void 0===r?void 0:r.code)||"false"===sessionStorage.getItem("VisitedLightCreate")?null===(a=ge)||void 0===a||null===(u=a.cptSearchQuery)||void 0===u?void 0:u.city:null===(d=ge)||void 0===d||null===(s=d.cpt)||void 0===s||null===(c=s.details)||void 0===c?void 0:c.tenantId)||Digit.ULBService.getCitizenCurrentTenant();if(window.location.href.includes("/tl/tradelicence/edit-application/")||window.location.href.includes("/renew-trade/")&&JSON.parse(sessionStorage.getItem("EditFormData"))){let e=JSON.parse(sessionStorage.getItem("EditFormData"));ge={...ge,...e}}const{isLoading:Se,data:be}=Digit.Hooks.pt.usePropertySearch({filters:{propertyIds:null!==(p=ge)&&void 0!==p&&null!==(v=p.cptId)&&void 0!==v&&v.id||null!==(m=ge)&&void 0!==m&&null!==(f=m.cpt)&&void 0!==f&&null!==(E=f.details)&&void 0!==E&&E.propertyId?"YES"===(null===(y=ge)||void 0===y||null===(g=y.knowyourproperty)||void 0===g||null===(h=g.KnowProperty)||void 0===h?void 0:h.code)||"false"===sessionStorage.getItem("VisitedLightCreate")?null===(S=ge)||void 0===S||null===(b=S.cptId)||void 0===b?void 0:b.id:null===(T=ge)||void 0===T||null===(C=T.cpt)||void 0===C||null===(A=C.details)||void 0===A?void 0:A.propertyId:window.location.href.includes("/tl/tradelicence/edit-application")||window.location.href.includes("/renew-trade/")?null===(D=ge)||void 0===D||null===(N=D.tradeLicenseDetail)||void 0===N||null===(I=N.additionalDetail)||void 0===I?void 0:I.propertyId:(null===(O=ge)||void 0===O||null===(P=O.cptId)||void 0===P?void 0:P.id)||(null===(w=ge)||void 0===w||null===(R=w.cpt)||void 0===R||null===(L=R.details)||void 0===L?void 0:L.propertyId)},tenantId:he,privacy:Digit.Utils.getPrivacyObject()},{filters:{propertyIds:null!==(x=ge)&&void 0!==x&&null!==(M=x.cptId)&&void 0!==M&&M.id||null!==(F=ge)&&void 0!==F&&null!==(k=F.cpt)&&void 0!==k&&null!==(U=k.details)&&void 0!==U&&U.propertyId?"YES"===(null===(B=ge)||void 0===B||null===(j=B.knowyourproperty)||void 0===j||null===(H=j.KnowProperty)||void 0===H?void 0:H.code)||"false"===sessionStorage.getItem("VisitedLightCreate")?null===(W=ge)||void 0===W||null===(V=W.cptId)||void 0===V?void 0:V.id:null===(z=ge)||void 0===z||null===($=z.cpt)||void 0===$||null===(Y=$.details)||void 0===Y?void 0:Y.propertyId:window.location.href.includes("/tl/tradelicence/edit-application")||window.location.href.includes("/renew-trade/")?null===(K=ge)||void 0===K||null===(q=K.tradeLicenseDetail)||void 0===q||null===(G=q.additionalDetail)||void 0===G?void 0:G.propertyId:(null===(Z=ge)||void 0===Z||null===(X=Z.cptId)||void 0===X?void 0:X.id)||(null===(J=ge)||void 0===J||null===(Q=J.cpt)||void 0===Q||null===(ee=Q.details)||void 0===ee?void 0:ee.propertyId)},tenantId:he,privacy:Digit.Utils.getPrivacyObject()}),Te=()=>{sessionStorage.setItem("cpt",null==be?void 0:be.Properties[0]),_e("cpt",{details:null==be?void 0:be.Properties[0]})},Ce=Array.isArray(null==be||null===(te=be.Properties)||void 0===te||null===(ne=te[0])||void 0===ne?void 0:ne.owners)?null==be||null===(le=be.Properties)||void 0===le||null===(oe=le[0])||void 0===oe?void 0:oe.owners.slice().reverse():[];let Ae=[];var De,Ne,Ie,Oe,Pe,we,Re,Le,xe,Me,Fe,ke,Ue,Be,je,He,We,Ve,ze,$e,Ye,Ke,qe,Ge,Ze,Xe,Je,Qe,et,tt,nt,lt,ot,it,rt;return be&&null!=be&&be.Properties.length&&(null!=be&&null!==(De=be.Properties[0])&&void 0!==De&&null!==(Ne=De.address)&&void 0!==Ne&&Ne.doorNo&&Ae.push(null==be||null===(je=be.Properties[0])||void 0===je||null===(He=je.address)||void 0===He?void 0:He.doorNo),(null!=be&&null!==(Ie=be.Properties[0])&&void 0!==Ie&&null!==(Oe=Ie.address)&&void 0!==Oe&&Oe.street||null!=be&&null!==(Pe=be.Properties[0])&&void 0!==Pe&&null!==(we=Pe.address)&&void 0!==we&&we.buildingName)&&Ae.push((null==be||null===(We=be.Properties[0])||void 0===We||null===(Ve=We.address)||void 0===Ve?void 0:Ve.street)||(null==be||null===(ze=be.Properties[0])||void 0===ze||null===($e=ze.address)||void 0===$e?void 0:$e.buildingName)),null!=be&&null!==(Re=be.Properties[0])&&void 0!==Re&&null!==(Le=Re.address)&&void 0!==Le&&Le.landmark&&Ae.push(null==be||null===(Ye=be.Properties[0])||void 0===Ye||null===(Ke=Ye.address)||void 0===Ke?void 0:Ke.landmark),null!=be&&null!==(xe=be.Properties[0])&&void 0!==xe&&null!==(Me=xe.address)&&void 0!==Me&&null!==(Fe=Me.locality)&&void 0!==Fe&&Fe.code&&Ae.push(Ee(Digit.Utils.pt.getMohallaLocale(null==be||null===(qe=be.Properties[0])||void 0===qe||null===(Ge=qe.address)||void 0===Ge||null===(Ze=Ge.locality)||void 0===Ze?void 0:Ze.code,null==be||null===(Xe=be.Properties[0])||void 0===Xe?void 0:Xe.tenantId))),null!=be&&null!==(ke=be.Properties[0])&&void 0!==ke&&ke.tenantId&&Ae.push(Ee(Digit.Utils.pt.getCityLocale(null==be||null===(Je=be.Properties[0])||void 0===Je?void 0:Je.tenantId))),null!=be&&null!==(Ue=be.Properties[0])&&void 0!==Ue&&null!==(Be=Ue.address)&&void 0!==Be&&Be.pincode&&Ae.push(null==be||null===(Qe=be.Properties[0])||void 0===Qe||null===(et=Qe.address)||void 0===et?void 0:et.pincode)),Se?l.createElement(t.Loader,null):l.createElement(l.Fragment,null,window.location.href.includes("/citizen")?l.createElement(go,{currentStep:window.location.href.includes("/ws/")?1:2,flow:window.location.href.includes("/ws/")?"WS":"",businessService:"WS"}):null,l.createElement(t.FormStep,{t:Ee,config:ye,onSelect:Te,onSkip:()=>_e()},be&&(null==be?void 0:be.Properties.length)&&l.createElement(l.Fragment,null,l.createElement(t.CardHeader,null,Ee("PT_DETAILS")),l.createElement(t.StatusTable,null,l.createElement(t.Row,{className:"border-none",label:Ee("PROPERTY_ID"),text:null==be||null===(ie=be.Properties[0])||void 0===ie?void 0:ie.propertyId}),l.createElement(t.Row,{className:"border-none",label:Ee("OWNER_NAME"),text:null==Ce||null===(re=Ce[0])||void 0===re?void 0:re.name}),l.createElement(t.Row,{className:"border-none",textStyle:{wordBreak:"break-word"},label:Ee("PROPERTY_ADDRESS"),text:Ae.join(", "),privacy:{uuid:null==be||null===(ae=be.Properties)||void 0===ae||null===(ue=ae[0])||void 0===ue||null===(de=ue.owners)||void 0===de||null===(se=de[0])||void 0===se?void 0:se.uuid,fieldName:["doorNo","street","landmark"],model:"Property",showValue:!0,loadData:{serviceName:"/property-services/property/_search",requestBody:{},requestParam:{tenantId:null==be||null===(ce=be.Properties[0])||void 0===ce?void 0:ce.tenantId,propertyIds:null==be||null===(pe=be.Properties[0])||void 0===pe?void 0:pe.propertyId},jsonPath:"Properties[0].address.street",d:e=>(_.get(e,"Properties[0].address.doorNo")?_.get(e,"Properties[0].address.doorNo")+", ":"")+(_.get(e,"Properties[0].address.street")?_.get(e,"Properties[0].address.street")+", ":"")+(_.get(e,"Properties[0].address.landmark")?""+_.get(e,"Properties[0].address.landmark"):""),isArray:!1}}}),l.createElement(t.Row,{className:"border-none",label:Ee("PT_MUTATION_STATUS"),text:Ee(null==be||null===(ve=be.Properties[0])||void 0===ve?void 0:ve.status)}),l.createElement("div",{style:{textAlign:"left"}},l.createElement(i.Link,{to:`/digit-ui/citizen/commonpt/view-property?propertyId=${null==be||null===(me=be.Properties[0])||void 0===me?void 0:me.propertyId}&tenantId=${null==be||null===(fe=be.Properties[0])||void 0===fe?void 0:fe.tenantId}`},l.createElement(t.LinkButton,{style:{textAlign:"left"},label:Ee("PT_VIEW_MORE_DETAILS")})),l.createElement(i.Link,{to:window.location.href.includes("/ws/modify-connection/")?`/digit-ui/citizen/ws/modify-connection/${null===(tt=ge)||void 0===tt?void 0:tt.tenantId}/search-property`:window.location.href.includes("/ws/edit-application/")?`/digit-ui/citizen/ws/edit-application/${null===(nt=ge)||void 0===nt?void 0:nt.tenantId}/search-property`:window.location.href.includes("/ws/")?"/digit-ui/citizen/ws/create-application/search-property":window.location.href.includes("/renew-trade/")?`/digit-ui/citizen/tl/tradelicence/renew-trade/${null===(lt=ge)||void 0===lt?void 0:lt.applicationNumber}/${null===(ot=ge)||void 0===ot?void 0:ot.tenantId}/know-your-property`:window.location.href.includes("/edit-application/")?`/digit-ui/citizen/tl/tradelicence/edit-application/${null===(it=ge)||void 0===it?void 0:it.applicationNumber}/${null===(rt=ge)||void 0===rt?void 0:rt.tenantId}/know-your-property`:"/digit-ui/citizen/tl/tradelicence/new-application/know-your-property"},l.createElement(t.LinkButton,{style:{textAlign:"left"},label:Ee("PT_CHANGE_PROPERTY"),onClick:()=>{sessionStorage.setItem("changePropertySelected","yes"),sessionStorage.setItem("EditFormData",JSON.stringify(ge))}})))),l.createElement(t.SubmitBar,{style:{marginTop:"10px"},onSubmit:Te,label:Ee("CS_COMMON_NEXT")}))))},CPTPropertySearchNSummary:e=>{var r,a,u,d,s,p,v,m,f,E;let{config:y,onSelect:_,userType:g,formData:h}=e;const{t:S}=o.useTranslation(),b=i.useHistory();let{pathname:T,state:C}=i.useLocation();C=C&&("string"==typeof C||C instanceof String)?JSON.parse(C):C;const A=T.includes("/modify-application/"),D=Digit.ULBService.getCurrentTenantId(),N=window.location.href.includes("/employee/tl/new-application"),I=window.location.href.includes("/employee/tl/renew-application-details")||window.location.href.includes("/employee/tl/edit-application-details"),O=i.useLocation().search,P=new URLSearchParams(O).get("propertyId"),[w,R]=n.useState((null==h||null===(r=h.cptId)||void 0===r?void 0:r.id)||("null"!==P?P:"")||""),[L,x]=n.useState("null"!==P?P:""),[M,F]=n.useState(null),k=window.Digit.Utils.browser.isMobile(),{isLoading:U,error:B,data:j}=(window.location.href.includes("?")&&window.location.href.substring(window.location.href.indexOf("?")+1,window.location.href.length),Digit.Hooks.pt.usePropertySearch({filters:{propertyIds:L},tenantId:D},{filters:{propertyIds:L},tenantId:D,enabled:!!L,privacy:Digit.Utils.getPrivacyObject()}));if(n.useEffect(()=>{w&&(window.location.href.includes("/renew-application-details/")||window.location.href.includes("/edit-application-details/"))&&x(w)},[w]),n.useEffect(()=>{var e;(0==U&&B&&1==B||0==(null==j||null===(e=j.Properties)||void 0===e?void 0:e.length))&&F({error:!0,label:"PT_ENTER_VALID_PROPERTY_ID"})},[B,j]),n.useEffect(()=>{_("cpt",{details:null==j?void 0:j.Properties[0]}),sessionStorage.setItem("Digit_FSM_PT",JSON.stringify(null==j?void 0:j.Properties[0])),localStorage.setItem("pgrProperty",JSON.stringify(null==j?void 0:j.Properties[0]))},[j,T]),A)return l.createElement(l.Fragment,null);let H="";var W,V,z,$,Y;return j&&null!=j&&j.Properties.length&&(H=((e,t)=>`${null!=e&&e.doorNo?(null==e?void 0:e.doorNo)+", ":""} ${null!=e&&e.street?(null==e?void 0:e.street)+", ":""}${null!=e&&e.landmark?(null==e?void 0:e.landmark)+", ":""}${t(Digit.Utils.pt.getMohallaLocale(null==e?void 0:e.locality.code,null==e?void 0:e.tenantId))}, ${t(Digit.Utils.pt.getCityLocale(null==e?void 0:e.tenantId))}${null!=e&&e.pincode&&t(null==e?void 0:e.pincode)?", "+e.pincode:" "}`)(null==j||null===(W=j.Properties[0])||void 0===W?void 0:W.address,S)),window.location.href.includes("/ws/"),l.createElement(t.CollapsibleCardPage,{title:S("PT_PROPERTY_DETAILS"),defaultOpen:!0},(!window.location.href.includes("/tl/")||!("MOVABLE"===(null==h||null===(a=h.tradedetils)||void 0===a||null===(u=a[0])||void 0===u||null===(d=u.structureType)||void 0===d?void 0:d.code))&&(N||I))&&l.createElement(l.Fragment,null,l.createElement(t.LabelFieldPair,null,l.createElement(t.Label,{style:window.location.href.includes("/ws/")?{fontWeight:"700"}:{}},""+S("PROPERTY_ID")),l.createElement("div",{style:{display:"flex",gap:"12px"}},l.createElement(t.TextInput,{key:y.key,value:w,onChange:e=>{R(e.target.value),_(y.key,{id:e.target.value})},style:{width:"80%",float:"left"},placeholder:""+S("PT_ENTER_PROPERTY_ID")}),l.createElement("button",{className:"submit-bar",type:"button",style:{color:"white"},onClick:()=>{if(w||F({error:!0,label:"PT_ENTER_PROPERTY_ID_AND_SEARCH"}),x(w),window.location.pathname.includes("/tl/new-application")){b.push("/digit-ui/employee/tl/new-application?propertyId="+w);const e=1600;setTimeout(()=>window.scrollTo(0,e),0)}else window.location.pathname.includes("/ws/new-application")&&b.push("/digit-ui/employee/ws/new-application?propertyId="+w)}},""+S("PT_SEARCH")),l.createElement("span",{onClick:()=>b.push(`/digit-ui/${g}/${T.split("/")[3]}/create-application/create-property`,{...C,...h})},l.createElement("button",{className:"submit-bar",type:"button",style:{color:"white"}},S("CPT_CREATE_PROPERTY"))))),j&&null!=j&&j.Properties.length?l.createElement(l.Fragment,null,l.createElement(t.Card,{className:"card-with-background",style:{margin:"16px 0px",padding:"20px",boxShadow:"none"}},l.createElement(t.StatusTable,{style:{padding:"0",margin:"0"}},l.createElement("div",{className:"formcomposer-section-grid",style:{}},l.createElement(t.Row,{className:"border-none",labelStyle:k?{width:"40%"}:{width:"30%",color:"#505a5f",fontWeight:"600"},textStyle:{color:"#000"},label:S("PROPERTY_ID"),text:null==j||null===(s=j.Properties[0])||void 0===s?void 0:s.propertyId}),l.createElement(t.Row,{className:"border-none",labelStyle:k?{width:"40%"}:{width:"30%",color:"#505a5f",fontWeight:"600"},textStyle:{color:"#000"},label:S("OWNER_NAME"),text:(V=null==j?void 0:j.Properties[0],(null===($=(null==V||null===(z=V.owners)||void 0===z?void 0:z.filter(e=>null==e?void 0:e.active)).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)}))||void 0===$||null===(Y=$.map(e=>null==e?void 0:e.name))||void 0===Y?void 0:Y.join(","))||S("NA"))}),l.createElement(t.Row,{className:"border-none",labelStyle:k?{width:"40%"}:{width:"30%",color:"#505a5f",fontWeight:"600"},textStyle:{wordBreak:"break-word",color:"#000"},label:S("PROPERTY_ADDRESS"),text:H,privacy:{uuid:null==j||null===(p=j.Properties[0])||void 0===p||null===(v=p.owners)||void 0===v||null===(m=v[0])||void 0===m?void 0:m.uuid,fieldName:["doorNo","street","landmark"],model:"Property",showValue:!0,loadData:{serviceName:"/property-services/property/_search",requestBody:{},requestParam:{tenantId:null==j||null===(f=j.Properties[0])||void 0===f?void 0:f.tenantId,propertyIds:null==j||null===(E=j.Properties[0])||void 0===E?void 0:E.propertyId},jsonPath:"Properties[0].address.street",d:e=>(c.get(e,"Properties[0].address.doorNo")?c.get(e,"Properties[0].address.doorNo")+", ":"")+(c.get(e,"Properties[0].address.street")?c.get(e,"Properties[0].address.street")+", ":"")+(c.get(e,"Properties[0].address.landmark")?""+c.get(e,"Properties[0].address.landmark"):""),isArray:!1}}}))))):null,M&&l.createElement(t.Toast,{isDleteBtn:!0,labelstyle:{width:"100%"},error:M.error,warning:M.warning,label:S(M.label),onClose:()=>{F(null)}})))},CPTSearchResults:be,CPTCreateProperty:y,CPTAcknowledgement:b},So=e=>{let{stateCode:t,userType:n,tenants:o}=e;const{path:r,url:a}=i.useRouteMatch(),u=Digit.StoreData.getCurrentLanguage();return Digit.Services.useStore({stateCode:t,moduleCode:"PT",language:u}),Object.entries(ho).forEach(e=>{let[t,n]=e;Digit.ComponentRegistryService.setComponent(t,n)}),Digit.SessionStorage.set("PT_TENANTS",o),"employee"===n?l.createElement(vo,{path:r,url:a,userType:n}):l.createElement(ao,{stateCode:t})},bo=e=>{let{matchPath:i}=e;const{t:r}=o.useTranslation(),[a,u,d]=Digit.Hooks.useSessionStorage("CPT_CREATE_PROPERTY",{});n.useEffect(()=>{d()},[]);const s=[{link:i+"/property/citizen-search",i18nKey:r("PT_SEARCH_AND_PAY")},{link:i+"/property/new-application",i18nKey:r("PT_CREATE_PROPERTY")}];return l.createElement(t.CitizenHomeCard,{header:r("ACTION_TEST_COMMON_PROPERTY_TAX"),links:s,Icon:()=>l.createElement(t.PTIcon,{className:"fill-path-primary-main"})})},To={CommonPTCardTemp:()=>{var e;const{t:n}=o.useTranslation();if(!Digit.Utils.ptAccess())return null;const i={Icon:l.createElement(t.PropertyHouse,null),moduleName:n("ACTION_TEST_COMMON_PROPERTY_TAX"),links:[{label:n("PT_SEARCH_AND_PAY"),link:"/digit-ui/employee/commonpt/search"}]};return!Digit.UserService.hasAccess(["PT_CEMP"])||null!==(e=i.links)&&void 0!==e&&e[1]||i.links.push({label:n("PT_CREATE_PROPERTY"),link:"/digit-ui/employee/commonpt/new-application"}),l.createElement(t.EmployeeModuleCard,i)},CommonPTModule:So,CommonPTLinksTemp:bo,...ho};exports.CommonPTComponents=To,exports.CommonPTLinks=bo,exports.CommonPTModule=So,exports.initCommonPTComponents=()=>{Object.entries(To).forEach(e=>{let[t,n]=e;Digit.ComponentRegistryService.setComponent(t,n)})};