@upyog/upyog-ui-module-ptr 3.10.1 → 3.10.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +1 -1
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- var e,t=require("@upyog/digit-ui-react-components"),n=require("react"),l=(e=n)&&"object"==typeof e&&"default"in e?e.default:e,r=require("react-i18next"),i=require("react-router-dom"),o=require("react-hook-form"),a=require("react-query");function u(){return(u=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var l in n)({}).hasOwnProperty.call(n,l)&&(e[l]=n[l])}return e}).apply(null,arguments)}function c(e,t){if(null==e)return{};var n={};for(var l in e)if({}.hasOwnProperty.call(e,l)){if(-1!==t.indexOf(l))continue;n[l]=e[l]}return n}let s=[];const d=e=>{let{currentStep:n=1,flow:i=""}=e;const{t:o}=r.useTranslation(),a=window.Digit.Utils.browser.isMobile();return(e=>{switch(e){case"STAKEHOLDER":s=[];break;default:s=["ES_TITILE_OWNER_DETAILS","ES_TITILE_PET_DETAILS","PTR_LOCATION_DETAILS","ES_TITILE_DOCUMENT_DETAILS","PTR_SUMMARY"]}})(i),l.createElement("div",{className:"timeline-container",style:a?{}:{maxWidth:"960px",minWidth:"640px",marginRight:"auto"}},s.map((e,r,i)=>l.createElement("div",{className:"timeline-checkpoint",key:r},l.createElement("div",{className:"timeline-content"},l.createElement("span",{className:"circle "+(r<=n-1&&"active")},r<n-1?l.createElement(t.TickMark,null):r+1),l.createElement("span",{className:"secondary-color"},o(e))),r<i.length-1&&l.createElement("span",{className:"line "+(r<n-1&&"active")}))))};var p="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function v(e,t){return e(t={exports:{}},t.exports),t.exports}var f=v(function(e,t){(function(){var n="Expected a function",l="__lodash_placeholder__",r=[["ary",128],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",32],["partialRight",64],["rearg",256]],i="[object Arguments]",o="[object Array]",a="[object Boolean]",u="[object Date]",c="[object Error]",s="[object Function]",d="[object GeneratorFunction]",v="[object Map]",f="[object Number]",m="[object Object]",h="[object RegExp]",E="[object Set]",_="[object String]",g="[object Symbol]",y="[object WeakMap]",S="[object ArrayBuffer]",b="[object DataView]",T="[object Float32Array]",A="[object Float64Array]",C="[object Int8Array]",D="[object Int16Array]",N="[object Int32Array]",P="[object Uint8Array]",R="[object Uint16Array]",I="[object Uint32Array]",w=/\b__p \+= '';/g,x=/\b(__p \+=) '' \+/g,O=/(__e\(.*?\)|\b__t\)) \+\n'';/g,L=/&(?:amp|lt|gt|quot|#39);/g,M=/[&<>"']/g,k=RegExp(L.source),F=RegExp(M.source),B=/<%-([\s\S]+?)%>/g,U=/<%([\s\S]+?)%>/g,j=/<%=([\s\S]+?)%>/g,H=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,W=/^\w*$/,z=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,V=/[\\^$.*+?()[\]{}|]/g,K=RegExp(V.source),Y=/^\s+/,q=/\s/,$=/\{(?:\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,re=/^\[object .+?Constructor\]$/,ie=/^0o[0-7]+$/i,oe=/^(?:0|[1-9]\d*)$/,ae=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ue=/($^)/,ce=/['\n\r\u2028\u2029\\]/g,se="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",de="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",pe="["+de+"]",ve="["+se+"]",fe="\\d+",me="[a-z\\xdf-\\xf6\\xf8-\\xff]",he="[^\\ud800-\\udfff"+de+fe+"\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",Ee="\\ud83c[\\udffb-\\udfff]",_e="[^\\ud800-\\udfff]",ge="(?:\\ud83c[\\udde6-\\uddff]){2}",ye="[\\ud800-\\udbff][\\udc00-\\udfff]",Se="[A-Z\\xc0-\\xd6\\xd8-\\xde]",be="(?:"+me+"|"+he+")",Te="(?:"+Se+"|"+he+")",Ae="(?:"+ve+"|"+Ee+")?",Ce="[\\ufe0e\\ufe0f]?"+Ae+"(?:\\u200d(?:"+[_e,ge,ye].join("|")+")[\\ufe0e\\ufe0f]?"+Ae+")*",De="(?:"+["[\\u2700-\\u27bf]",ge,ye].join("|")+")"+Ce,Ne="(?:"+[_e+ve+"?",ve,ge,ye,"[\\ud800-\\udfff]"].join("|")+")",Pe=RegExp("['’]","g"),Re=RegExp(ve,"g"),Ie=RegExp(Ee+"(?="+Ee+")|"+Ne+Ce,"g"),we=RegExp([Se+"?"+me+"+(?:['’](?: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_])",fe,De].join("|"),"g"),xe=RegExp("[\\u200d\\ud800-\\udfff"+se+"\\ufe0e\\ufe0f]"),Oe=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Le=["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,ke={};ke[T]=ke[A]=ke[C]=ke[D]=ke[N]=ke[P]=ke["[object Uint8ClampedArray]"]=ke[R]=ke[I]=!0,ke[i]=ke[o]=ke[S]=ke[a]=ke[b]=ke[u]=ke[c]=ke[s]=ke[v]=ke[f]=ke[m]=ke[h]=ke[E]=ke[_]=ke[y]=!1;var Fe={};Fe[i]=Fe[o]=Fe[S]=Fe[b]=Fe[a]=Fe[u]=Fe[T]=Fe[A]=Fe[C]=Fe[D]=Fe[N]=Fe[v]=Fe[f]=Fe[m]=Fe[h]=Fe[E]=Fe[_]=Fe[g]=Fe[P]=Fe["[object Uint8ClampedArray]"]=Fe[R]=Fe[I]=!0,Fe[c]=Fe[s]=Fe[y]=!1;var Be={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Ue=parseFloat,je=parseInt,He="object"==typeof p&&p&&p.Object===Object&&p,We="object"==typeof self&&self&&self.Object===Object&&self,ze=He||We||Function("return this")(),Ve=t&&!t.nodeType&&t,Ke=Ve&&e&&!e.nodeType&&e,Ye=Ke&&Ke.exports===Ve,qe=Ye&&He.process,$e=function(){try{return Ke&&Ke.require&&Ke.require("util").types||qe&&qe.binding&&qe.binding("util")}catch(e){}}(),Ge=$e&&$e.isArrayBuffer,Ze=$e&&$e.isDate,Xe=$e&&$e.isMap,Je=$e&&$e.isRegExp,Qe=$e&&$e.isSet,et=$e&&$e.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 r=-1,i=null==e?0:e.length;++r<i;){var o=e[r];t(l,o,n(o),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 rt(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 ot(e,t){for(var n=-1,l=null==e?0:e.length,r=0,i=[];++n<l;){var o=e[n];t(o,n,e)&&(i[r++]=o)}return i}function at(e,t){return!(null==e||!e.length)&&Et(e,t,0)>-1}function ut(e,t,n){for(var l=-1,r=null==e?0:e.length;++l<r;)if(n(t,e[l]))return!0;return!1}function ct(e,t){for(var n=-1,l=null==e?0:e.length,r=Array(l);++n<l;)r[n]=t(e[n],n,e);return r}function st(e,t){for(var n=-1,l=t.length,r=e.length;++n<l;)e[r+n]=t[n];return e}function dt(e,t,n,l){var r=-1,i=null==e?0:e.length;for(l&&i&&(n=e[++r]);++r<i;)n=t(n,e[r],r,e);return n}function pt(e,t,n,l){var r=null==e?0:e.length;for(l&&r&&(n=e[--r]);r--;)n=t(n,e[r],r,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 ft=St("length");function mt(e,t,n){var l;return n(e,function(e,n,r){if(t(e,n,r))return l=n,!1}),l}function ht(e,t,n,l){for(var r=e.length,i=n+(l?1:-1);l?i--:++i<r;)if(t(e[i],i,e))return i;return-1}function Et(e,t,n){return t==t?function(e,t,n){for(var l=n-1,r=e.length;++l<r;)if(e[l]===t)return l;return-1}(e,t,n):ht(e,gt,n)}function _t(e,t,n,l){for(var r=n-1,i=e.length;++r<i;)if(l(e[r],t))return r;return-1}function gt(e){return e!=e}function yt(e,t){var n=null==e?0:e.length;return n?At(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,r){return r(e,function(e,r,i){n=l?(l=!1,e):t(n,e,r,i)}),n}function At(e,t){for(var n,l=-1,r=e.length;++l<r;){var i=t(e[l]);void 0!==i&&(n=void 0===n?i:n+i)}return n}function Ct(e,t){for(var n=-1,l=Array(e);++n<e;)l[n]=t(n);return l}function Dt(e){return e?e.slice(0,Vt(e)+1).replace(Y,""):e}function Nt(e){return function(t){return e(t)}}function Pt(e,t){return ct(t,function(t){return e[t]})}function Rt(e,t){return e.has(t)}function It(e,t){for(var n=-1,l=e.length;++n<l&&Et(t,e[n],0)>-1;);return n}function wt(e,t){for(var n=e.length;n--&&Et(t,e[n],0)>-1;);return n}function xt(e,t){for(var n=e.length,l=0;n--;)e[n]===t&&++l;return l}var Ot=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"}),Lt=bt({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"});function Mt(e){return"\\"+Be[e]}function kt(e){return xe.test(e)}function Ft(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,r=e.length,i=0,o=[];++n<r;){var a=e[n];a!==t&&a!==l||(e[n]=l,o[i++]=n)}return o}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 kt(e)?function(e){for(var t=Ie.lastIndex=0;Ie.test(e);)++t;return t}(e):ft(e)}function zt(e){return kt(e)?function(e){return e.match(Ie)||[]}(e):function(e){return e.split("")}(e)}function Vt(e){for(var t=e.length;t--&&q.test(e.charAt(t)););return t}var Kt=bt({"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"}),Yt=function e(t){var p,q=(t=null==t?ze:Yt.defaults(ze.Object(),t,Yt.pick(ze,Le))).Array,se=t.Date,de=t.Error,pe=t.Function,ve=t.Math,fe=t.Object,me=t.RegExp,he=t.String,Ee=t.TypeError,_e=q.prototype,ge=fe.prototype,ye=t["__core-js_shared__"],Se=pe.prototype.toString,be=ge.hasOwnProperty,Te=0,Ae=(p=/[^.]+$/.exec(ye&&ye.keys&&ye.keys.IE_PROTO||""))?"Symbol(src)_1."+p:"",Ce=ge.toString,De=Se.call(fe),Ne=ze._,Ie=me("^"+Se.call(be).replace(V,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),xe=Ye?t.Buffer:void 0,Be=t.Symbol,He=t.Uint8Array,We=xe?xe.allocUnsafe:void 0,Ve=Bt(fe.getPrototypeOf,fe),Ke=fe.create,qe=ge.propertyIsEnumerable,$e=_e.splice,ft=Be?Be.isConcatSpreadable:void 0,bt=Be?Be.iterator:void 0,qt=Be?Be.toStringTag:void 0,$t=function(){try{var e=Jr(fe,"defineProperty");return e({},"",{}),e}catch(e){}}(),Gt=t.clearTimeout!==ze.clearTimeout&&t.clearTimeout,Zt=se&&se.now!==ze.Date.now&&se.now,Xt=t.setTimeout!==ze.setTimeout&&t.setTimeout,Jt=ve.ceil,Qt=ve.floor,en=fe.getOwnPropertySymbols,tn=xe?xe.isBuffer:void 0,nn=t.isFinite,ln=_e.join,rn=Bt(fe.keys,fe),on=ve.max,an=ve.min,un=se.now,cn=t.parseInt,sn=ve.random,dn=_e.reverse,pn=Jr(t,"DataView"),vn=Jr(t,"Map"),fn=Jr(t,"Promise"),mn=Jr(t,"Set"),hn=Jr(t,"WeakMap"),En=Jr(fe,"create"),_n=hn&&new hn,gn={},yn=Ni(pn),Sn=Ni(vn),bn=Ni(fn),Tn=Ni(mn),An=Ni(hn),Cn=Be?Be.prototype:void 0,Dn=Cn?Cn.valueOf:void 0,Nn=Cn?Cn.toString:void 0;function Pn(e){if(Ko(e)&&!Lo(e)&&!(e instanceof xn)){if(e instanceof wn)return e;if(be.call(e,"__wrapped__"))return Pi(e)}return new wn(e)}var Rn=function(){function e(){}return function(t){if(!Vo(t))return{};if(Ke)return Ke(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function In(){}function wn(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=void 0}function xn(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=4294967295,this.__views__=[]}function On(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 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 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 kn(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new Mn;++t<n;)this.add(e[t])}function Fn(e){var t=this.__data__=new Ln(e);this.size=t.size}function Bn(e,t){var n=Lo(e),l=!n&&Oo(e),r=!n&&!l&&Bo(e),i=!n&&!l&&!r&&Qo(e),o=n||l||r||i,a=o?Ct(e.length,he):[],u=a.length;for(var c in e)!t&&!be.call(e,c)||o&&("length"==c||r&&("offset"==c||"parent"==c)||i&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||ii(c,u))||a.push(c);return a}function Un(e){var t=e.length;return t?e[Ml(0,t-1)]:void 0}function jn(e,t){return bi(hr(e),Gn(t,0,e.length))}function Hn(e){return bi(hr(e))}function Wn(e,t,n){(void 0!==n&&!Io(e[t],n)||void 0===n&&!(t in e))&&qn(e,t,n)}function zn(e,t,n){var l=e[t];be.call(e,t)&&Io(l,n)&&(void 0!==n||t in e)||qn(e,t,n)}function Vn(e,t){for(var n=e.length;n--;)if(Io(e[n][0],t))return n;return-1}function Kn(e,t,n,l){return el(e,function(e,r,i){t(l,e,n(e),i)}),l}function Yn(e,t){return e&&Er(t,Sa(t),e)}function qn(e,t,n){"__proto__"==t&&$t?$t(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function $n(e,t){for(var n=-1,l=t.length,r=q(l),i=null==e;++n<l;)r[n]=i?void 0:ha(e,t[n]);return r}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,r,o){var c,p=1&t,y=2&t,w=4&t;if(n&&(c=r?n(e,l,r,o):n(e)),void 0!==c)return c;if(!Vo(e))return e;var x=Lo(e);if(x){if(c=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),!p)return hr(e,c)}else{var O=ti(e),L=O==s||O==d;if(Bo(e))return sr(e,p);if(O==m||O==i||L&&!r){if(c=y||L?{}:li(e),!p)return y?function(e,t){return Er(e,ei(e),t)}(e,function(e,t){return e&&Er(t,ba(t),e)}(c,e)):function(e,t){return Er(e,Qr(e),t)}(e,Yn(c,e))}else{if(!Fe[O])return r?e:{};c=function(e,t,n){var l=e.constructor;switch(t){case S:return dr(e);case a:case u:return new l(+e);case b:return function(e,t){var n=t?dr(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,n);case T:case A:case C:case D:case N:case P:case"[object Uint8ClampedArray]":case R:case I:return pr(e,n);case v:return new l;case f:case _:return new l(e);case h:return function(e){var t=new e.constructor(e.source,te.exec(e));return t.lastIndex=e.lastIndex,t}(e);case E:return new l;case g:return Dn?fe(Dn.call(e)):{}}}(e,O,p)}}o||(o=new Fn);var M=o.get(e);if(M)return M;o.set(e,c),Zo(e)?e.forEach(function(l){c.add(Zn(l,t,n,l,e,o))}):Yo(e)&&e.forEach(function(l,r){c.set(r,Zn(l,t,n,r,e,o))});var k=x?void 0:(w?y?Kr:Vr:y?ba:Sa)(e);return lt(k||e,function(l,r){k&&(l=e[r=l]),zn(c,r,Zn(l,t,n,r,e,o))}),c}function Xn(e,t,n){var l=n.length;if(null==e)return!l;for(e=fe(e);l--;){var r=n[l],i=e[r];if(void 0===i&&!(r in e)||!(0,t[r])(i))return!1}return!0}function Jn(e,t,l){if("function"!=typeof e)throw new Ee(n);return _i(function(){e.apply(void 0,l)},t)}function Qn(e,t,n,l){var r=-1,i=at,o=!0,a=e.length,u=[],c=t.length;if(!a)return u;n&&(t=ct(t,Nt(n))),l?(i=ut,o=!1):t.length>=200&&(i=Rt,o=!1,t=new kn(t));e:for(;++r<a;){var s=e[r],d=null==n?s:n(s);if(s=l||0!==s?s:0,o&&d==d){for(var p=c;p--;)if(t[p]===d)continue e;u.push(s)}else i(t,d,l)||u.push(s)}return u}Pn.templateSettings={escape:B,evaluate:U,interpolate:j,variable:"",imports:{_:Pn}},(Pn.prototype=In.prototype).constructor=Pn,(wn.prototype=Rn(In.prototype)).constructor=wn,(xn.prototype=Rn(In.prototype)).constructor=xn,On.prototype.clear=function(){this.__data__=En?En(null):{},this.size=0},On.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},On.prototype.get=function(e){var t=this.__data__;if(En){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return be.call(t,e)?t[e]:void 0},On.prototype.has=function(e){var t=this.__data__;return En?void 0!==t[e]:be.call(t,e)},On.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=En&&void 0===t?"__lodash_hash_undefined__":t,this},Ln.prototype.clear=function(){this.__data__=[],this.size=0},Ln.prototype.delete=function(e){var t=this.__data__,n=Vn(t,e);return!(n<0||(n==t.length-1?t.pop():$e.call(t,n,1),--this.size,0))},Ln.prototype.get=function(e){var t=this.__data__,n=Vn(t,e);return n<0?void 0:t[n][1]},Ln.prototype.has=function(e){return Vn(this.__data__,e)>-1},Ln.prototype.set=function(e,t){var n=this.__data__,l=Vn(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 On,map:new(vn||Ln),string:new On}},Mn.prototype.delete=function(e){var t=Zr(this,e).delete(e);return this.size-=t?1:0,t},Mn.prototype.get=function(e){return Zr(this,e).get(e)},Mn.prototype.has=function(e){return Zr(this,e).has(e)},Mn.prototype.set=function(e,t){var n=Zr(this,e),l=n.size;return n.set(e,t),this.size+=n.size==l?0:1,this},kn.prototype.add=kn.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},kn.prototype.has=function(e){return this.__data__.has(e)},Fn.prototype.clear=function(){this.__data__=new Ln,this.size=0},Fn.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},Fn.prototype.get=function(e){return this.__data__.get(e)},Fn.prototype.has=function(e){return this.__data__.has(e)},Fn.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Ln){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=yr(ul),tl=yr(cl,!0);function nl(e,t){var n=!0;return el(e,function(e,l,r){return n=!!t(e,l,r)}),n}function ll(e,t,n){for(var l=-1,r=e.length;++l<r;){var i=e[l],o=t(i);if(null!=o&&(void 0===a?o==o&&!Jo(o):n(o,a)))var a=o,u=i}return u}function rl(e,t){var n=[];return el(e,function(e,l,r){t(e,l,r)&&n.push(e)}),n}function il(e,t,n,l,r){var i=-1,o=e.length;for(n||(n=ri),r||(r=[]);++i<o;){var a=e[i];t>0&&n(a)?t>1?il(a,t-1,n,l,r):st(r,a):l||(r[r.length]=a)}return r}var ol=Sr(),al=Sr(!0);function ul(e,t){return e&&ol(e,t,Sa)}function cl(e,t){return e&&al(e,t,Sa)}function sl(e,t){return ot(t,function(t){return Ho(e[t])})}function dl(e,t){for(var n=0,l=(t=or(t,e)).length;null!=e&&n<l;)e=e[Di(t[n++])];return n&&n==l?e:void 0}function pl(e,t,n){var l=t(e);return Lo(e)?l:st(l,n(e))}function vl(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":qt&&qt in fe(e)?function(e){var t=be.call(e,qt),n=e[qt];try{e[qt]=void 0;var l=!0}catch(e){}var r=Ce.call(e);return l&&(t?e[qt]=n:delete e[qt]),r}(e):function(e){return Ce.call(e)}(e)}function fl(e,t){return e>t}function ml(e,t){return null!=e&&be.call(e,t)}function hl(e,t){return null!=e&&t in fe(e)}function El(e,t,n){for(var l=n?ut:at,r=e[0].length,i=e.length,o=i,a=q(i),u=Infinity,c=[];o--;){var s=e[o];o&&t&&(s=ct(s,Nt(t))),u=an(s.length,u),a[o]=!n&&(t||r>=120&&s.length>=120)?new kn(o&&s):void 0}s=e[0];var d=-1,p=a[0];e:for(;++d<r&&c.length<u;){var v=s[d],f=t?t(v):v;if(v=n||0!==v?v:0,!(p?Rt(p,f):l(c,f,n))){for(o=i;--o;){var m=a[o];if(!(m?Rt(m,f):l(e[o],f,n)))continue e}p&&p.push(f),c.push(v)}}return c}function _l(e,t,n){var l=null==(e=fi(e,t=or(t,e)))?e:e[Di(Ui(t))];return null==l?void 0:tt(l,e,n)}function gl(e){return Ko(e)&&vl(e)==i}function yl(e,t,n,l,r){return e===t||(null==e||null==t||!Ko(e)&&!Ko(t)?e!=e&&t!=t:function(e,t,n,l,r,s){var d=Lo(e),p=Lo(t),y=d?o:ti(e),T=p?o:ti(t),A=(y=y==i?m:y)==m,C=(T=T==i?m:T)==m,D=y==T;if(D&&Bo(e)){if(!Bo(t))return!1;d=!0,A=!1}if(D&&!A)return s||(s=new Fn),d||Qo(e)?Wr(e,t,n,l,r,s):function(e,t,n,l,r,i,o){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 f:return Io(+e,+t);case c:return e.name==t.name&&e.message==t.message;case h:case _:return e==t+"";case v:var s=Ft;case E:if(s||(s=jt),e.size!=t.size&&!(1&l))return!1;var d=o.get(e);if(d)return d==t;l|=2,o.set(e,t);var p=Wr(s(e),s(t),l,r,i,o);return o.delete(e),p;case g:if(Dn)return Dn.call(e)==Dn.call(t)}return!1}(e,t,y,n,l,r,s);if(!(1&n)){var N=A&&be.call(e,"__wrapped__"),P=C&&be.call(t,"__wrapped__");if(N||P){var R=N?e.value():e,I=P?t.value():t;return s||(s=new Fn),r(R,I,n,l,s)}}return!!D&&(s||(s=new Fn),function(e,t,n,l,r,i){var o=1&n,a=Vr(e),u=a.length;if(u!=Vr(t).length&&!o)return!1;for(var c=u;c--;){var s=a[c];if(!(o?s in t:be.call(t,s)))return!1}var d=i.get(e),p=i.get(t);if(d&&p)return d==t&&p==e;var v=!0;i.set(e,t),i.set(t,e);for(var f=o;++c<u;){var m=e[s=a[c]],h=t[s];if(l)var E=o?l(h,m,s,t,e,i):l(m,h,s,e,t,i);if(!(void 0===E?m===h||r(m,h,n,l,i):E)){v=!1;break}f||(f="constructor"==s)}if(v&&!f){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,r,s))}(e,t,n,l,yl,r))}function Sl(e,t,n,l){var r=n.length,i=r,o=!l;if(null==e)return!i;for(e=fe(e);r--;){var a=n[r];if(o&&a[2]?a[1]!==e[a[0]]:!(a[0]in e))return!1}for(;++r<i;){var u=(a=n[r])[0],c=e[u],s=a[1];if(o&&a[2]){if(void 0===c&&!(u in e))return!1}else{var d=new Fn;if(l)var p=l(c,s,u,e,t,d);if(!(void 0===p?yl(s,c,3,l,d):p))return!1}}return!0}function bl(e){return!(!Vo(e)||(t=e,Ae&&Ae in t))&&(Ho(e)?Ie:re).test(Ni(e));var t}function Tl(e){return"function"==typeof e?e:null==e?qa:"object"==typeof e?Lo(e)?Pl(e[0],e[1]):Nl(e):nu(e)}function Al(e){if(!si(e))return rn(e);var t=[];for(var n in fe(e))be.call(e,n)&&"constructor"!=n&&t.push(n);return t}function Cl(e,t){return e<t}function Dl(e,t){var n=-1,l=ko(e)?q(e.length):[];return el(e,function(e,r,i){l[++n]=t(e,r,i)}),l}function Nl(e){var t=Xr(e);return 1==t.length&&t[0][2]?pi(t[0][0],t[0][1]):function(n){return n===e||Sl(n,e,t)}}function Pl(e,t){return ai(e)&&di(t)?pi(Di(e),t):function(n){var l=ha(n,e);return void 0===l&&l===t?Ea(n,e):yl(t,l,3)}}function Rl(e,t,n,l,r){e!==t&&ol(t,function(i,o){if(r||(r=new Fn),Vo(i))!function(e,t,n,l,r,i,o){var a=hi(e,n),u=hi(t,n),c=o.get(u);if(c)Wn(e,n,c);else{var s=i?i(a,u,n+"",e,t,o):void 0,d=void 0===s;if(d){var p=Lo(u),v=!p&&Bo(u),f=!p&&!v&&Qo(u);s=u,p||v||f?Lo(a)?s=a:Fo(a)?s=hr(a):v?(d=!1,s=sr(u,!0)):f?(d=!1,s=pr(u,!0)):s=[]:$o(u)||Oo(u)?(s=a,Oo(a)?s=aa(a):Vo(a)&&!Ho(a)||(s=li(u))):d=!1}d&&(o.set(u,s),r(s,u,l,i,o),o.delete(u)),Wn(e,n,s)}}(e,t,o,n,Rl,l,r);else{var a=l?l(hi(e,o),i,o+"",e,t,r):void 0;void 0===a&&(a=i),Wn(e,o,a)}},ba)}function Il(e,t){var n=e.length;if(n)return ii(t+=t<0?n:0,n)?e[t]:void 0}function wl(e,t,n){t=t.length?ct(t,function(e){return Lo(e)?function(t){return dl(t,1===e.length?e[0]:e)}:e}):[qa];var l=-1;return t=ct(t,Nt(Gr())),function(e,t){var l=e.length;for(e.sort(function(e,t){return function(e,t,n){for(var l=-1,r=e.criteria,i=t.criteria,o=r.length,a=n.length;++l<o;){var u=vr(r[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,r){return{criteria:ct(t,function(t){return t(e)}),index:++l,value:e}}))}function xl(e,t,n){for(var l=-1,r=t.length,i={};++l<r;){var o=t[l],a=dl(e,o);n(a,o)&&jl(i,or(o,e),a)}return i}function Ol(e,t,n,l){var r=l?_t:Et,i=-1,o=t.length,a=e;for(e===t&&(t=hr(t)),n&&(a=ct(e,Nt(n)));++i<o;)for(var u=0,c=t[i],s=n?n(c):c;(u=r(a,s,u,l))>-1;)a!==e&&$e.call(a,u,1),$e.call(e,u,1);return e}function Ll(e,t){for(var n=e?t.length:0,l=n-1;n--;){var r=t[n];if(n==l||r!==i){var i=r;ii(r)?$e.call(e,r,1):Jl(e,r)}}return e}function Ml(e,t){return e+Qt(sn()*(t-e+1))}function kl(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 Fl(e,t){return gi(vi(e,t,qa),e+"")}function Bl(e){return Un(Ia(e))}function Ul(e,t){var n=Ia(e);return bi(n,Gn(t,0,n.length))}function jl(e,t,n,l){if(!Vo(e))return e;for(var r=-1,i=(t=or(t,e)).length,o=i-1,a=e;null!=a&&++r<i;){var u=Di(t[r]),c=n;if("__proto__"===u||"constructor"===u||"prototype"===u)return e;if(r!=o){var s=a[u];void 0===(c=l?l(s,u,a):void 0)&&(c=Vo(s)?s:ii(t[r+1])?[]:{})}zn(a,u,c),a=a[u]}return e}var Hl=_n?function(e,t){return _n.set(e,t),e}:qa,Wl=$t?function(e,t){return $t(e,"toString",{configurable:!0,enumerable:!1,value:Va(t),writable:!0})}:qa;function zl(e){return bi(Ia(e))}function Vl(e,t,n){var l=-1,r=e.length;t<0&&(t=-t>r?0:r+t),(n=n>r?r:n)<0&&(n+=r),r=t>n?0:n-t>>>0,t>>>=0;for(var i=q(r);++l<r;)i[l]=e[l+t];return i}function Kl(e,t){var n;return el(e,function(e,l,r){return!(n=t(e,l,r))}),!!n}function Yl(e,t,n){var l=0,r=null==e?l:e.length;if("number"==typeof t&&t==t&&r<=2147483647){for(;l<r;){var i=l+r>>>1,o=e[i];null!==o&&!Jo(o)&&(n?o<=t:o<t)?l=i+1:r=i}return r}return ql(e,t,qa,n)}function ql(e,t,n,l){var r=0,i=null==e?0:e.length;if(0===i)return 0;for(var o=(t=n(t))!=t,a=null===t,u=Jo(t),c=void 0===t;r<i;){var s=Qt((r+i)/2),d=n(e[s]),p=void 0!==d,v=null===d,f=d==d,m=Jo(d);if(o)var h=l||f;else h=c?f&&(l||p):a?f&&p&&(l||!v):u?f&&p&&!v&&(l||!m):!v&&!m&&(l?d<=t:d<t);h?r=s+1:i=s}return an(i,4294967294)}function $l(e,t){for(var n=-1,l=e.length,r=0,i=[];++n<l;){var o=e[n],a=t?t(o):o;if(!n||!Io(a,u)){var u=a;i[r++]=0===o?0:o}}return i}function Gl(e){return"number"==typeof e?e:Jo(e)?NaN:+e}function Zl(e){if("string"==typeof e)return e;if(Lo(e))return ct(e,Zl)+"";if(Jo(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,r=at,i=e.length,o=!0,a=[],u=a;if(n)o=!1,r=ut;else if(i>=200){var c=t?null:kr(e);if(c)return jt(c);o=!1,r=Rt,u=new kn}else u=t?[]:a;e:for(;++l<i;){var s=e[l],d=t?t(s):s;if(s=n||0!==s?s:0,o&&d==d){for(var p=u.length;p--;)if(u[p]===d)continue e;t&&u.push(d),a.push(s)}else r(u,d,n)||(u!==a&&u.push(d),a.push(s))}return a}function Jl(e,t){return null==(e=fi(e,t=or(t,e)))||delete e[Di(Ui(t))]}function Ql(e,t,n,l){return jl(e,t,n(dl(e,t)),l)}function er(e,t,n,l){for(var r=e.length,i=l?r:-1;(l?i--:++i<r)&&t(e[i],i,e););return n?Vl(e,l?0:i,l?i+1:r):Vl(e,l?i+1:0,l?r:i)}function tr(e,t){var n=e;return n instanceof xn&&(n=n.value()),dt(t,function(e,t){return t.func.apply(t.thisArg,st([e],t.args))},n)}function nr(e,t,n){var l=e.length;if(l<2)return l?Xl(e[0]):[];for(var r=-1,i=q(l);++r<l;)for(var o=e[r],a=-1;++a<l;)a!=r&&(i[r]=Qn(i[r]||o,e[a],t,n));return Xl(il(i,1),t,n)}function lr(e,t,n){for(var l=-1,r=e.length,i=t.length,o={};++l<r;)n(o,e[l],l<i?t[l]:void 0);return o}function rr(e){return Fo(e)?e:[]}function ir(e){return"function"==typeof e?e:qa}function or(e,t){return Lo(e)?e:ai(e,t)?[e]:Ci(ua(e))}var ar=Fl;function ur(e,t,n){var l=e.length;return n=void 0===n?l:n,!t&&n>=l?e:Vl(e,t,n)}var cr=Gt||function(e){return ze.clearTimeout(e)};function sr(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 dr(e){var t=new e.constructor(e.byteLength);return new He(t).set(new He(e)),t}function pr(e,t){var n=t?dr(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function vr(e,t){if(e!==t){var n=void 0!==e,l=null===e,r=e==e,i=Jo(e),o=void 0!==t,a=null===t,u=t==t,c=Jo(t);if(!a&&!c&&!i&&e>t||i&&o&&u&&!a&&!c||l&&o&&u||!n&&u||!r)return 1;if(!l&&!i&&!c&&e<t||c&&n&&r&&!l&&!i||a&&n&&r||!o&&r||!u)return-1}return 0}function fr(e,t,n,l){for(var r=-1,i=e.length,o=n.length,a=-1,u=t.length,c=on(i-o,0),s=q(u+c),d=!l;++a<u;)s[a]=t[a];for(;++r<o;)(d||r<i)&&(s[n[r]]=e[r]);for(;c--;)s[a++]=e[r++];return s}function mr(e,t,n,l){for(var r=-1,i=e.length,o=-1,a=n.length,u=-1,c=t.length,s=on(i-a,0),d=q(s+c),p=!l;++r<s;)d[r]=e[r];for(var v=r;++u<c;)d[v+u]=t[u];for(;++o<a;)(p||r<i)&&(d[v+n[o]]=e[r++]);return d}function hr(e,t){var n=-1,l=e.length;for(t||(t=q(l));++n<l;)t[n]=e[n];return t}function Er(e,t,n,l){var r=!n;n||(n={});for(var i=-1,o=t.length;++i<o;){var a=t[i],u=l?l(n[a],e[a],a,n,e):void 0;void 0===u&&(u=e[a]),r?qn(n,a,u):zn(n,a,u)}return n}function _r(e,t){return function(n,l){var r=Lo(n)?nt:Kn,i=t?t():{};return r(n,e,Gr(l,2),i)}}function gr(e){return Fl(function(t,n){var l=-1,r=n.length,i=r>1?n[r-1]:void 0,o=r>2?n[2]:void 0;for(i=e.length>3&&"function"==typeof i?(r--,i):void 0,o&&oi(n[0],n[1],o)&&(i=r<3?void 0:i,r=1),t=fe(t);++l<r;){var a=n[l];a&&e(t,a,l,i)}return t})}function yr(e,t){return function(n,l){if(null==n)return n;if(!ko(n))return e(n,l);for(var r=n.length,i=t?r:-1,o=fe(n);(t?i--:++i<r)&&!1!==l(o[i],i,o););return n}}function Sr(e){return function(t,n,l){for(var r=-1,i=fe(t),o=l(t),a=o.length;a--;){var u=o[e?a:++r];if(!1===n(i[u],u,i))break}return t}}function br(e){return function(t){var n=kt(t=ua(t))?zt(t):void 0,l=n?n[0]:t.charAt(0),r=n?ur(n,1).join(""):t.slice(1);return l[e]()+r}}function Tr(e){return function(t){return dt(Ha(Oa(t).replace(Pe,"")),e,"")}}function Ar(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=Rn(e.prototype),l=e.apply(n,t);return Vo(l)?l:n}}function Cr(e){return function(t,n,l){var r=fe(t);if(!ko(t)){var i=Gr(n,3);t=Sa(t),n=function(e){return i(r[e],e,r)}}var o=e(t,n,l);return o>-1?r[i?t[o]:o]:void 0}}function Dr(e){return zr(function(t){var l=t.length,r=l,i=wn.prototype.thru;for(e&&t.reverse();r--;){var o=t[r];if("function"!=typeof o)throw new Ee(n);if(i&&!a&&"wrapper"==qr(o))var a=new wn([],!0)}for(r=a?r:l;++r<l;){var u=qr(o=t[r]),c="wrapper"==u?Yr(o):void 0;a=c&&ui(c[0])&&424==c[1]&&!c[4].length&&1==c[9]?a[qr(c[0])].apply(a,c[3]):1==o.length&&ui(o)?a[u]():a.thru(o)}return function(){var e=arguments,n=e[0];if(a&&1==e.length&&Lo(n))return a.plant(n).value();for(var r=0,i=l?t[r].apply(this,e):n;++r<l;)i=t[r].call(this,i);return i}})}function Nr(e,t,n,l,r,i,o,a,u,c){var s=128&t,d=1&t,p=2&t,v=24&t,f=512&t,m=p?void 0:Ar(e);return function h(){for(var E=arguments.length,_=q(E),g=E;g--;)_[g]=arguments[g];if(v)var y=$r(h),S=xt(_,y);if(l&&(_=fr(_,l,r,v)),i&&(_=mr(_,i,o,v)),E-=S,v&&E<c){var b=Ut(_,y);return Lr(e,t,Nr,h.placeholder,n,_,b,a,u,c-E)}var T=d?n:this,A=p?T[e]:e;return E=_.length,a?_=mi(_,a):f&&E>1&&_.reverse(),s&&u<E&&(_.length=u),this&&this!==ze&&this instanceof h&&(A=m||Ar(A)),A.apply(T,_)}}function Pr(e,t){return function(n,l){return function(e,t,n,l){return ul(e,function(e,r,i){t(l,n(e),r,i)}),l}(n,e,t(l),{})}}function Rr(e,t){return function(n,l){var r;if(void 0===n&&void 0===l)return t;if(void 0!==n&&(r=n),void 0!==l){if(void 0===r)return l;"string"==typeof n||"string"==typeof l?(n=Zl(n),l=Zl(l)):(n=Gl(n),l=Gl(l)),r=e(n,l)}return r}}function Ir(e){return zr(function(t){return t=ct(t,Nt(Gr())),Fl(function(n){var l=this;return e(t,function(e){return tt(e,l,n)})})})}function wr(e,t){var n=(t=void 0===t?" ":Zl(t)).length;if(n<2)return n?kl(t,e):t;var l=kl(t,Jt(e/Wt(t)));return kt(t)?ur(zt(l),0,e).join(""):l.slice(0,e)}function xr(e){return function(t,n,l){return l&&"number"!=typeof l&&oi(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 r=-1,i=on(Jt((t-e)/(n||1)),0),o=q(i);i--;)o[l?i:++r]=e,e+=n;return o}(t,n,l=void 0===l?t<n?1:-1:la(l),e)}}function Or(e){return function(t,n){return"string"==typeof t&&"string"==typeof n||(t=oa(t),n=oa(n)),e(t,n)}}function Lr(e,t,n,l,r,i,o,a,u,c){var s=8&t;t|=s?32:64,4&(t&=~(s?64:32))||(t&=-4);var d=[e,t,r,s?i:void 0,s?o:void 0,s?void 0:i,s?void 0:o,a,u,c],p=n.apply(void 0,d);return ui(e)&&Ei(p,d),p.placeholder=l,yi(p,e,t)}function Mr(e){var t=ve[e];return function(e,n){if(e=oa(e),(n=null==n?0:an(ra(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 kr=mn&&1/jt(new mn([,-0]))[1]==1/0?function(e){return new mn(e)}:Ja;function Fr(e){return function(t){var n=ti(t);return n==v?Ft(t):n==E?Ht(t):function(e,t){return ct(t,function(t){return[t,e[t]]})}(t,e(t))}}function Br(e,t,r,i,o,a,u,c){var s=2&t;if(!s&&"function"!=typeof e)throw new Ee(n);var d=i?i.length:0;if(d||(t&=-97,i=o=void 0),u=void 0===u?u:on(ra(u),0),c=void 0===c?c:ra(c),d-=o?o.length:0,64&t){var p=i,v=o;i=o=void 0}var f=s?void 0:Yr(e),m=[e,t,r,i,o,p,v,a,u,c];if(f&&function(e,t){var n=e[1],r=t[1],i=n|r;if(!(i<131||128==r&&8==n||128==r&&256==n&&e[7].length<=t[8]||384==r&&t[7].length<=t[8]&&8==n))return e;1&r&&(e[2]=t[2],i|=1&n?0:4);var o=t[3];if(o){var a=e[3];e[3]=a?fr(a,o,t[4]):o,e[4]=a?Ut(e[3],l):t[4]}(o=t[5])&&(e[5]=(a=e[5])?mr(a,o,t[6]):o,e[6]=a?Ut(e[5],l):t[6]),(o=t[7])&&(e[7]=o),128&r&&(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}(m,f),e=m[0],t=m[1],r=m[2],i=m[3],o=m[4],!(c=m[9]=void 0===m[9]?s?0:e.length:on(m[9]-d,0))&&24&t&&(t&=-25),t&&1!=t)h=8==t||16==t?function(e,t,n){var l=Ar(e);return function r(){for(var i=arguments.length,o=q(i),a=i,u=$r(r);a--;)o[a]=arguments[a];var c=i<3&&o[0]!==u&&o[i-1]!==u?[]:Ut(o,u);if((i-=c.length)<n)return Lr(e,t,Nr,r.placeholder,void 0,o,c,void 0,void 0,n-i);var s=this&&this!==ze&&this instanceof r?l:e;return tt(s,this,o)}}(e,t,c):32!=t&&33!=t||o.length?Nr.apply(void 0,m):function(e,t,n,l){var r=1&t,i=Ar(e);return function t(){for(var o=-1,a=arguments.length,u=-1,c=l.length,s=q(c+a),d=this&&this!==ze&&this instanceof t?i:e;++u<c;)s[u]=l[u];for(;a--;)s[u++]=arguments[++o];return tt(d,r?n:this,s)}}(e,t,r,i);else var h=function(e,t,n){var l=1&t,r=Ar(e);return function t(){var i=this&&this!==ze&&this instanceof t?r:e;return i.apply(l?n:this,arguments)}}(e,t,r);return yi((f?Hl:Ei)(h,m),e,t)}function Ur(e,t,n,l){return void 0===e||Io(e,ge[n])&&!be.call(l,n)?t:e}function jr(e,t,n,l,r,i){return Vo(e)&&Vo(t)&&(i.set(t,e),Rl(e,t,void 0,jr,i),i.delete(t)),e}function Hr(e){return $o(e)?void 0:e}function Wr(e,t,n,l,r,i){var o=1&n,a=e.length,u=t.length;if(a!=u&&!(o&&u>a))return!1;var c=i.get(e),s=i.get(t);if(c&&s)return c==t&&s==e;var d=-1,p=!0,v=2&n?new kn:void 0;for(i.set(e,t),i.set(t,e);++d<a;){var f=e[d],m=t[d];if(l)var h=o?l(m,f,d,t,e,i):l(f,m,d,e,t,i);if(void 0!==h){if(h)continue;p=!1;break}if(v){if(!vt(t,function(e,t){if(!Rt(v,t)&&(f===e||r(f,e,n,l,i)))return v.push(t)})){p=!1;break}}else if(f!==m&&!r(f,m,n,l,i)){p=!1;break}}return i.delete(e),i.delete(t),p}function zr(e){return gi(vi(e,void 0,Li),e+"")}function Vr(e){return pl(e,Sa,Qr)}function Kr(e){return pl(e,ba,ei)}var Yr=_n?function(e){return _n.get(e)}:Ja;function qr(e){for(var t=e.name+"",n=gn[t],l=be.call(gn,t)?n.length:0;l--;){var r=n[l],i=r.func;if(null==i||i==e)return r.name}return t}function $r(e){return(be.call(Pn,"placeholder")?Pn:e).placeholder}function Gr(){var e=Pn.iteratee||$a;return e=e===$a?Tl:e,arguments.length?e(arguments[0],arguments[1]):e}function Zr(e,t){var n,l,r=e.__data__;return("string"==(l=typeof(n=t))||"number"==l||"symbol"==l||"boolean"==l?"__proto__"!==n:null===n)?r["string"==typeof t?"string":"hash"]:r.map}function Xr(e){for(var t=Sa(e),n=t.length;n--;){var l=t[n],r=e[l];t[n]=[l,r,di(r)]}return t}function Jr(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return bl(n)?n:void 0}var Qr=en?function(e){return null==e?[]:(e=fe(e),ot(en(e),function(t){return qe.call(e,t)}))}:iu,ei=en?function(e){for(var t=[];e;)st(t,Qr(e)),e=Ve(e);return t}:iu,ti=vl;function ni(e,t,n){for(var l=-1,r=(t=or(t,e)).length,i=!1;++l<r;){var o=Di(t[l]);if(!(i=null!=e&&n(e,o)))break;e=e[o]}return i||++l!=r?i:!!(r=null==e?0:e.length)&&zo(r)&&ii(o,r)&&(Lo(e)||Oo(e))}function li(e){return"function"!=typeof e.constructor||si(e)?{}:Rn(Ve(e))}function ri(e){return Lo(e)||Oo(e)||!!(ft&&e&&e[ft])}function ii(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&oe.test(e))&&e>-1&&e%1==0&&e<t}function oi(e,t,n){if(!Vo(n))return!1;var l=typeof t;return!!("number"==l?ko(n)&&ii(t,n.length):"string"==l&&t in n)&&Io(n[t],e)}function ai(e,t){if(Lo(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!Jo(e))||W.test(e)||!H.test(e)||null!=t&&e in fe(t)}function ui(e){var t=qr(e),n=Pn[t];if("function"!=typeof n||!(t in xn.prototype))return!1;if(e===n)return!0;var l=Yr(n);return!!l&&e===l[0]}(pn&&ti(new pn(new ArrayBuffer(1)))!=b||vn&&ti(new vn)!=v||fn&&"[object Promise]"!=ti(fn.resolve())||mn&&ti(new mn)!=E||hn&&ti(new hn)!=y)&&(ti=function(e){var t=vl(e),n=t==m?e.constructor:void 0,l=n?Ni(n):"";if(l)switch(l){case yn:return b;case Sn:return v;case bn:return"[object Promise]";case Tn:return E;case An:return y}return t});var ci=ye?Ho:ou;function si(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||ge)}function di(e){return e==e&&!Vo(e)}function pi(e,t){return function(n){return null!=n&&n[e]===t&&(void 0!==t||e in fe(n))}}function vi(e,t,n){return t=on(void 0===t?e.length-1:t,0),function(){for(var l=arguments,r=-1,i=on(l.length-t,0),o=q(i);++r<i;)o[r]=l[t+r];r=-1;for(var a=q(t+1);++r<t;)a[r]=l[r];return a[t]=n(o),tt(e,this,a)}}function fi(e,t){return t.length<2?e:dl(e,Vl(t,0,-1))}function mi(e,t){for(var n=e.length,l=an(t.length,n),r=hr(e);l--;){var i=t[l];e[l]=ii(i,n)?r[i]:void 0}return e}function hi(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var Ei=Si(Hl),_i=Xt||function(e,t){return ze.setTimeout(e,t)},gi=Si(Wl);function yi(e,t,n){var l=t+"";return gi(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($,"{\n/* [wrapped with "+t+"] */\n")}(l,function(e,t){return lt(r,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 Si(e){var t=0,n=0;return function(){var l=un(),r=16-(l-n);if(n=l,r>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function bi(e,t){var n=-1,l=e.length,r=l-1;for(t=void 0===t?l:t;++n<t;){var i=Ml(n,r),o=e[i];e[i]=e[n],e[n]=o}return e.length=t,e}var Ti,Ai,Ci=(Ti=Ao(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(z,function(e,n,l,r){t.push(l?r.replace(Q,"$1"):n||e)}),t},function(e){return 500===Ai.size&&Ai.clear(),e}),Ai=Ti.cache,Ti);function Di(e){if("string"==typeof e||Jo(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Ni(e){if(null!=e){try{return Se.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function Pi(e){if(e instanceof xn)return e.clone();var t=new wn(e.__wrapped__,e.__chain__);return t.__actions__=hr(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var Ri=Fl(function(e,t){return Fo(e)?Qn(e,il(t,1,Fo,!0)):[]}),Ii=Fl(function(e,t){var n=Ui(t);return Fo(n)&&(n=void 0),Fo(e)?Qn(e,il(t,1,Fo,!0),Gr(n,2)):[]}),wi=Fl(function(e,t){var n=Ui(t);return Fo(n)&&(n=void 0),Fo(e)?Qn(e,il(t,1,Fo,!0),void 0,n):[]});function xi(e,t,n){var l=null==e?0:e.length;if(!l)return-1;var r=null==n?0:ra(n);return r<0&&(r=on(l+r,0)),ht(e,Gr(t,3),r)}function Oi(e,t,n){var l=null==e?0:e.length;if(!l)return-1;var r=l-1;return void 0!==n&&(r=ra(n),r=n<0?on(l+r,0):an(r,l-1)),ht(e,Gr(t,3),r,!0)}function Li(e){return null!=e&&e.length?il(e,1):[]}function Mi(e){return e&&e.length?e[0]:void 0}var ki=Fl(function(e){var t=ct(e,rr);return t.length&&t[0]===e[0]?El(t):[]}),Fi=Fl(function(e){var t=Ui(e),n=ct(e,rr);return t===Ui(n)?t=void 0:n.pop(),n.length&&n[0]===e[0]?El(n,Gr(t,2)):[]}),Bi=Fl(function(e){var t=Ui(e),n=ct(e,rr);return(t="function"==typeof t?t:void 0)&&n.pop(),n.length&&n[0]===e[0]?El(n,void 0,t):[]});function Ui(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}var ji=Fl(Hi);function Hi(e,t){return e&&e.length&&t&&t.length?Ol(e,t):e}var Wi=zr(function(e,t){var n=null==e?0:e.length,l=$n(e,t);return Ll(e,ct(t,function(e){return ii(e,n)?+e:e}).sort(vr)),l});function zi(e){return null==e?e:dn.call(e)}var Vi=Fl(function(e){return Xl(il(e,1,Fo,!0))}),Ki=Fl(function(e){var t=Ui(e);return Fo(t)&&(t=void 0),Xl(il(e,1,Fo,!0),Gr(t,2))}),Yi=Fl(function(e){var t=Ui(e);return t="function"==typeof t?t:void 0,Xl(il(e,1,Fo,!0),void 0,t)});function qi(e){if(!e||!e.length)return[];var t=0;return e=ot(e,function(e){if(Fo(e))return t=on(e.length,t),!0}),Ct(t,function(t){return ct(e,St(t))})}function $i(e,t){if(!e||!e.length)return[];var n=qi(e);return null==t?n:ct(n,function(e){return tt(t,void 0,e)})}var Gi=Fl(function(e,t){return Fo(e)?Qn(e,t):[]}),Zi=Fl(function(e){return nr(ot(e,Fo))}),Xi=Fl(function(e){var t=Ui(e);return Fo(t)&&(t=void 0),nr(ot(e,Fo),Gr(t,2))}),Ji=Fl(function(e){var t=Ui(e);return t="function"==typeof t?t:void 0,nr(ot(e,Fo),void 0,t)}),Qi=Fl(qi),eo=Fl(function(e){var t=e.length,n=t>1?e[t-1]:void 0;return n="function"==typeof n?(e.pop(),n):void 0,$i(e,n)});function to(e){var t=Pn(e);return t.__chain__=!0,t}function no(e,t){return t(e)}var lo=zr(function(e){var t=e.length,n=t?e[0]:0,l=this.__wrapped__,r=function(t){return $n(t,e)};return!(t>1||this.__actions__.length)&&l instanceof xn&&ii(n)?((l=l.slice(n,+n+(t?1:0))).__actions__.push({func:no,args:[r],thisArg:void 0}),new wn(l,this.__chain__).thru(function(e){return t&&!e.length&&e.push(void 0),e})):this.thru(r)}),ro=_r(function(e,t,n){be.call(e,n)?++e[n]:qn(e,n,1)}),io=Cr(xi),oo=Cr(Oi);function ao(e,t){return(Lo(e)?lt:el)(e,Gr(t,3))}function uo(e,t){return(Lo(e)?rt:tl)(e,Gr(t,3))}var co=_r(function(e,t,n){be.call(e,n)?e[n].push(t):qn(e,n,[t])}),so=Fl(function(e,t,n){var l=-1,r="function"==typeof t,i=ko(e)?q(e.length):[];return el(e,function(e){i[++l]=r?tt(t,e,n):_l(e,t,n)}),i}),po=_r(function(e,t,n){qn(e,n,t)});function vo(e,t){return(Lo(e)?ct:Dl)(e,Gr(t,3))}var fo=_r(function(e,t,n){e[n?0:1].push(t)},function(){return[[],[]]}),mo=Fl(function(e,t){if(null==e)return[];var n=t.length;return n>1&&oi(e,t[0],t[1])?t=[]:n>2&&oi(t[0],t[1],t[2])&&(t=[t[0]]),wl(e,il(t,1),[])}),ho=Zt||function(){return ze.Date.now()};function Eo(e,t,n){return t=n?void 0:t,Br(e,128,void 0,void 0,void 0,void 0,t=e&&null==t?e.length:t)}function _o(e,t){var l;if("function"!=typeof t)throw new Ee(n);return e=ra(e),function(){return--e>0&&(l=t.apply(this,arguments)),e<=1&&(t=void 0),l}}var go=Fl(function(e,t,n){var l=1;if(n.length){var r=Ut(n,$r(go));l|=32}return Br(e,l,t,n,r)}),yo=Fl(function(e,t,n){var l=3;if(n.length){var r=Ut(n,$r(yo));l|=32}return Br(t,l,e,n,r)});function So(e,t,l){var r,i,o,a,u,c,s=0,d=!1,p=!1,v=!0;if("function"!=typeof e)throw new Ee(n);function f(t){var n=r,l=i;return r=i=void 0,s=t,a=e.apply(l,n)}function m(e){return s=e,u=_i(E,t),d?f(e):a}function h(e){var n=e-c;return void 0===c||n>=t||n<0||p&&e-s>=o}function E(){var e=ho();if(h(e))return _(e);u=_i(E,function(e){var n=t-(e-c);return p?an(n,o-(e-s)):n}(e))}function _(e){return u=void 0,v&&r?f(e):(r=i=void 0,a)}function g(){var e=ho(),n=h(e);if(r=arguments,i=this,c=e,n){if(void 0===u)return m(c);if(p)return cr(u),u=_i(E,t),f(c)}return void 0===u&&(u=_i(E,t)),a}return t=oa(t)||0,Vo(l)&&(d=!!l.leading,o=(p="maxWait"in l)?on(oa(l.maxWait)||0,t):o,v="trailing"in l?!!l.trailing:v),g.cancel=function(){void 0!==u&&cr(u),s=0,r=c=i=u=void 0},g.flush=function(){return void 0===u?a:_(ho())},g}var bo=Fl(function(e,t){return Jn(e,1,t)}),To=Fl(function(e,t,n){return Jn(e,oa(t)||0,n)});function Ao(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new Ee(n);var l=function(){var n=arguments,r=t?t.apply(this,n):n[0],i=l.cache;if(i.has(r))return i.get(r);var o=e.apply(this,n);return l.cache=i.set(r,o)||i,o};return l.cache=new(Ao.Cache||Mn),l}function Co(e){if("function"!=typeof e)throw new Ee(n);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}Ao.Cache=Mn;var Do=ar(function(e,t){var n=(t=1==t.length&&Lo(t[0])?ct(t[0],Nt(Gr())):ct(il(t,1),Nt(Gr()))).length;return Fl(function(l){for(var r=-1,i=an(l.length,n);++r<i;)l[r]=t[r].call(this,l[r]);return tt(e,this,l)})}),No=Fl(function(e,t){return Br(e,32,void 0,t,Ut(t,$r(No)))}),Po=Fl(function(e,t){return Br(e,64,void 0,t,Ut(t,$r(Po)))}),Ro=zr(function(e,t){return Br(e,256,void 0,void 0,void 0,t)});function Io(e,t){return e===t||e!=e&&t!=t}var wo=Or(fl),xo=Or(function(e,t){return e>=t}),Oo=gl(function(){return arguments}())?gl:function(e){return Ko(e)&&be.call(e,"callee")&&!qe.call(e,"callee")},Lo=q.isArray,Mo=Ge?Nt(Ge):function(e){return Ko(e)&&vl(e)==S};function ko(e){return null!=e&&zo(e.length)&&!Ho(e)}function Fo(e){return Ko(e)&&ko(e)}var Bo=tn||ou,Uo=Ze?Nt(Ze):function(e){return Ko(e)&&vl(e)==u};function jo(e){if(!Ko(e))return!1;var t=vl(e);return t==c||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!$o(e)}function Ho(e){if(!Vo(e))return!1;var t=vl(e);return t==s||t==d||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Wo(e){return"number"==typeof e&&e==ra(e)}function zo(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}function Vo(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function Ko(e){return null!=e&&"object"==typeof e}var Yo=Xe?Nt(Xe):function(e){return Ko(e)&&ti(e)==v};function qo(e){return"number"==typeof e||Ko(e)&&vl(e)==f}function $o(e){if(!Ko(e)||vl(e)!=m)return!1;var t=Ve(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 Go=Je?Nt(Je):function(e){return Ko(e)&&vl(e)==h},Zo=Qe?Nt(Qe):function(e){return Ko(e)&&ti(e)==E};function Xo(e){return"string"==typeof e||!Lo(e)&&Ko(e)&&vl(e)==_}function Jo(e){return"symbol"==typeof e||Ko(e)&&vl(e)==g}var Qo=et?Nt(et):function(e){return Ko(e)&&zo(e.length)&&!!ke[vl(e)]},ea=Or(Cl),ta=Or(function(e,t){return e<=t});function na(e){if(!e)return[];if(ko(e))return Xo(e)?zt(e):hr(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=ti(e);return(t==v?Ft:t==E?jt:Ia)(e)}function la(e){return e?(e=oa(e))===1/0||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function ra(e){var t=la(e),n=t%1;return t==t?n?t-n:t:0}function ia(e){return e?Gn(ra(e),0,4294967295):0}function oa(e){if("number"==typeof e)return e;if(Jo(e))return NaN;if(Vo(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=Vo(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 Er(e,ba(e))}function ua(e){return null==e?"":Zl(e)}var ca=gr(function(e,t){if(si(t)||ko(t))Er(t,Sa(t),e);else for(var n in t)be.call(t,n)&&zn(e,n,t[n])}),sa=gr(function(e,t){Er(t,ba(t),e)}),da=gr(function(e,t,n,l){Er(t,ba(t),e,l)}),pa=gr(function(e,t,n,l){Er(t,Sa(t),e,l)}),va=zr($n),fa=Fl(function(e,t){e=fe(e);var n=-1,l=t.length,r=l>2?t[2]:void 0;for(r&&oi(t[0],t[1],r)&&(l=1);++n<l;)for(var i=t[n],o=ba(i),a=-1,u=o.length;++a<u;){var c=o[a],s=e[c];(void 0===s||Io(s,ge[c])&&!be.call(e,c))&&(e[c]=i[c])}return e}),ma=Fl(function(e){return e.push(void 0,jr),tt(Aa,void 0,e)});function ha(e,t,n){var l=null==e?void 0:dl(e,t);return void 0===l?n:l}function Ea(e,t){return null!=e&&ni(e,t,hl)}var _a=Pr(function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=Ce.call(t)),e[t]=n},Va(qa)),ga=Pr(function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=Ce.call(t)),be.call(e,t)?e[t].push(n):e[t]=[n]},Gr),ya=Fl(_l);function Sa(e){return ko(e)?Bn(e):Al(e)}function ba(e){return ko(e)?Bn(e,!0):function(e){if(!Vo(e))return function(e){var t=[];if(null!=e)for(var n in fe(e))t.push(n);return t}(e);var t=si(e),n=[];for(var l in e)("constructor"!=l||!t&&be.call(e,l))&&n.push(l);return n}(e)}var Ta=gr(function(e,t,n){Rl(e,t,n)}),Aa=gr(function(e,t,n,l){Rl(e,t,n,l)}),Ca=zr(function(e,t){var n={};if(null==e)return n;var l=!1;t=ct(t,function(t){return t=or(t,e),l||(l=t.length>1),t}),Er(e,Kr(e),n),l&&(n=Zn(n,7,Hr));for(var r=t.length;r--;)Jl(n,t[r]);return n}),Da=zr(function(e,t){return null==e?{}:function(e,t){return xl(e,t,function(t,n){return Ea(e,n)})}(e,t)});function Na(e,t){if(null==e)return{};var n=ct(Kr(e),function(e){return[e]});return t=Gr(t),xl(e,n,function(e,n){return t(e,n[0])})}var Pa=Fr(Sa),Ra=Fr(ba);function Ia(e){return null==e?[]:Pt(e,Sa(e))}var wa=Tr(function(e,t,n){return t=t.toLowerCase(),e+(n?xa(t):t)});function xa(e){return ja(ua(e).toLowerCase())}function Oa(e){return(e=ua(e))&&e.replace(ae,Ot).replace(Re,"")}var La=Tr(function(e,t,n){return e+(n?"-":"")+t.toLowerCase()}),Ma=Tr(function(e,t,n){return e+(n?" ":"")+t.toLowerCase()}),ka=br("toLowerCase"),Fa=Tr(function(e,t,n){return e+(n?"_":"")+t.toLowerCase()}),Ba=Tr(function(e,t,n){return e+(n?" ":"")+ja(t)}),Ua=Tr(function(e,t,n){return e+(n?" ":"")+t.toUpperCase()}),ja=br("toUpperCase");function Ha(e,t,n){return e=ua(e),void 0===(t=n?void 0:t)?function(e){return Oe.test(e)}(e)?function(e){return e.match(we)||[]}(e):function(e){return e.match(X)||[]}(e):e.match(t)||[]}var Wa=Fl(function(e,t){try{return tt(e,void 0,t)}catch(e){return jo(e)?e:new de(e)}}),za=zr(function(e,t){return lt(t,function(t){t=Di(t),qn(e,t,go(e[t],e))}),e});function Va(e){return function(){return e}}var Ka=Dr(),Ya=Dr(!0);function qa(e){return e}function $a(e){return Tl("function"==typeof e?e:Zn(e,1))}var Ga=Fl(function(e,t){return function(n){return _l(n,e,t)}}),Za=Fl(function(e,t){return function(n){return _l(e,n,t)}});function Xa(e,t,n){var l=Sa(t),r=sl(t,l);null!=n||Vo(t)&&(r.length||!l.length)||(n=t,t=e,e=this,r=sl(t,Sa(t)));var i=!(Vo(n)&&"chain"in n&&!n.chain),o=Ho(e);return lt(r,function(n){var l=t[n];e[n]=l,o&&(e.prototype[n]=function(){var t=this.__chain__;if(i||t){var n=e(this.__wrapped__),r=n.__actions__=hr(this.__actions__);return r.push({func:l,args:arguments,thisArg:e}),n.__chain__=t,n}return l.apply(e,st([this.value()],arguments))})}),e}function Ja(){}var Qa=Ir(ct),eu=Ir(it),tu=Ir(vt);function nu(e){return ai(e)?St(Di(e)):function(e){return function(t){return dl(t,e)}}(e)}var lu=xr(),ru=xr(!0);function iu(){return[]}function ou(){return!1}var au,uu=Rr(function(e,t){return e+t},0),cu=Mr("ceil"),su=Rr(function(e,t){return e/t},1),du=Mr("floor"),pu=Rr(function(e,t){return e*t},1),vu=Mr("round"),fu=Rr(function(e,t){return e-t},0);return Pn.after=function(e,t){if("function"!=typeof t)throw new Ee(n);return e=ra(e),function(){if(--e<1)return t.apply(this,arguments)}},Pn.ary=Eo,Pn.assign=ca,Pn.assignIn=sa,Pn.assignInWith=da,Pn.assignWith=pa,Pn.at=va,Pn.before=_o,Pn.bind=go,Pn.bindAll=za,Pn.bindKey=yo,Pn.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return Lo(e)?e:[e]},Pn.chain=to,Pn.chunk=function(e,t,n){t=(n?oi(e,t,n):void 0===t)?1:on(ra(t),0);var l=null==e?0:e.length;if(!l||t<1)return[];for(var r=0,i=0,o=q(Jt(l/t));r<l;)o[i++]=Vl(e,r,r+=t);return o},Pn.compact=function(e){for(var t=-1,n=null==e?0:e.length,l=0,r=[];++t<n;){var i=e[t];i&&(r[l++]=i)}return r},Pn.concat=function(){var e=arguments.length;if(!e)return[];for(var t=q(e-1),n=arguments[0],l=e;l--;)t[l-1]=arguments[l];return st(Lo(n)?hr(n):[n],il(t,1))},Pn.cond=function(e){var t=null==e?0:e.length,l=Gr();return e=t?ct(e,function(e){if("function"!=typeof e[1])throw new Ee(n);return[l(e[0]),e[1]]}):[],Fl(function(n){for(var l=-1;++l<t;){var r=e[l];if(tt(r[0],this,n))return tt(r[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=Va,Pn.countBy=ro,Pn.create=function(e,t){var n=Rn(e);return null==t?n:Yn(n,t)},Pn.curry=function e(t,n,l){var r=Br(t,8,void 0,void 0,void 0,void 0,void 0,n=l?void 0:n);return r.placeholder=e.placeholder,r},Pn.curryRight=function e(t,n,l){var r=Br(t,16,void 0,void 0,void 0,void 0,void 0,n=l?void 0:n);return r.placeholder=e.placeholder,r},Pn.debounce=So,Pn.defaults=fa,Pn.defaultsDeep=ma,Pn.defer=bo,Pn.delay=To,Pn.difference=Ri,Pn.differenceBy=Ii,Pn.differenceWith=wi,Pn.drop=function(e,t,n){var l=null==e?0:e.length;return l?Vl(e,(t=n||void 0===t?1:ra(t))<0?0:t,l):[]},Pn.dropRight=function(e,t,n){var l=null==e?0:e.length;return l?Vl(e,0,(t=l-(t=n||void 0===t?1:ra(t)))<0?0:t):[]},Pn.dropRightWhile=function(e,t){return e&&e.length?er(e,Gr(t,3),!0,!0):[]},Pn.dropWhile=function(e,t){return e&&e.length?er(e,Gr(t,3),!0):[]},Pn.fill=function(e,t,n,l){var r=null==e?0:e.length;return r?(n&&"number"!=typeof n&&oi(e,t,n)&&(n=0,l=r),function(e,t,n,l){var r=e.length;for((n=ra(n))<0&&(n=-n>r?0:r+n),(l=void 0===l||l>r?r:ra(l))<0&&(l+=r),l=n>l?0:ia(l);n<l;)e[n++]=t;return e}(e,t,n,l)):[]},Pn.filter=function(e,t){return(Lo(e)?ot:rl)(e,Gr(t,3))},Pn.flatMap=function(e,t){return il(vo(e,t),1)},Pn.flatMapDeep=function(e,t){return il(vo(e,t),1/0)},Pn.flatMapDepth=function(e,t,n){return n=void 0===n?1:ra(n),il(vo(e,t),n)},Pn.flatten=Li,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:ra(t)):[]},Pn.flip=function(e){return Br(e,512)},Pn.flow=Ka,Pn.flowRight=Ya,Pn.fromPairs=function(e){for(var t=-1,n=null==e?0:e.length,l={};++t<n;){var r=e[t];l[r[0]]=r[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=co,Pn.initial=function(e){return null!=e&&e.length?Vl(e,0,-1):[]},Pn.intersection=ki,Pn.intersectionBy=Fi,Pn.intersectionWith=Bi,Pn.invert=_a,Pn.invertBy=ga,Pn.invokeMap=so,Pn.iteratee=$a,Pn.keyBy=po,Pn.keys=Sa,Pn.keysIn=ba,Pn.map=vo,Pn.mapKeys=function(e,t){var n={};return t=Gr(t,3),ul(e,function(e,l,r){qn(n,t(e,l,r),e)}),n},Pn.mapValues=function(e,t){var n={};return t=Gr(t,3),ul(e,function(e,l,r){qn(n,l,t(e,l,r))}),n},Pn.matches=function(e){return Nl(Zn(e,1))},Pn.matchesProperty=function(e,t){return Pl(e,Zn(t,1))},Pn.memoize=Ao,Pn.merge=Ta,Pn.mergeWith=Aa,Pn.method=Ga,Pn.methodOf=Za,Pn.mixin=Xa,Pn.negate=Co,Pn.nthArg=function(e){return e=ra(e),Fl(function(t){return Il(t,e)})},Pn.omit=Ca,Pn.omitBy=function(e,t){return Na(e,Co(Gr(t)))},Pn.once=function(e){return _o(2,e)},Pn.orderBy=function(e,t,n,l){return null==e?[]:(Lo(t)||(t=null==t?[]:[t]),Lo(n=l?void 0:n)||(n=null==n?[]:[n]),wl(e,t,n))},Pn.over=Qa,Pn.overArgs=Do,Pn.overEvery=eu,Pn.overSome=tu,Pn.partial=No,Pn.partialRight=Po,Pn.partition=fo,Pn.pick=Da,Pn.pickBy=Na,Pn.property=nu,Pn.propertyOf=function(e){return function(t){return null==e?void 0:dl(e,t)}},Pn.pull=ji,Pn.pullAll=Hi,Pn.pullAllBy=function(e,t,n){return e&&e.length&&t&&t.length?Ol(e,t,Gr(n,2)):e},Pn.pullAllWith=function(e,t,n){return e&&e.length&&t&&t.length?Ol(e,t,void 0,n):e},Pn.pullAt=Wi,Pn.range=lu,Pn.rangeRight=ru,Pn.rearg=Ro,Pn.reject=function(e,t){return(Lo(e)?ot:rl)(e,Co(Gr(t,3)))},Pn.remove=function(e,t){var n=[];if(!e||!e.length)return n;var l=-1,r=[],i=e.length;for(t=Gr(t,3);++l<i;){var o=e[l];t(o,l,e)&&(n.push(o),r.push(l))}return Ll(e,r),n},Pn.rest=function(e,t){if("function"!=typeof e)throw new Ee(n);return Fl(e,t=void 0===t?t:ra(t))},Pn.reverse=zi,Pn.sampleSize=function(e,t,n){return t=(n?oi(e,t,n):void 0===t)?1:ra(t),(Lo(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(Lo(e)?Hn:zl)(e)},Pn.slice=function(e,t,n){var l=null==e?0:e.length;return l?(n&&"number"!=typeof n&&oi(e,t,n)?(t=0,n=l):(t=null==t?0:ra(t),n=void 0===n?l:ra(n)),Vl(e,t,n)):[]},Pn.sortBy=mo,Pn.sortedUniq=function(e){return e&&e.length?$l(e):[]},Pn.sortedUniqBy=function(e,t){return e&&e.length?$l(e,Gr(t,2)):[]},Pn.split=function(e,t,n){return n&&"number"!=typeof n&&oi(e,t,n)&&(t=n=void 0),(n=void 0===n?4294967295:n>>>0)?(e=ua(e))&&("string"==typeof t||null!=t&&!Go(t))&&!(t=Zl(t))&&kt(e)?ur(zt(e),0,n):e.split(t,n):[]},Pn.spread=function(e,t){if("function"!=typeof e)throw new Ee(n);return t=null==t?0:on(ra(t),0),Fl(function(n){var l=n[t],r=ur(n,0,t);return l&&st(r,l),tt(e,this,r)})},Pn.tail=function(e){var t=null==e?0:e.length;return t?Vl(e,1,t):[]},Pn.take=function(e,t,n){return e&&e.length?Vl(e,0,(t=n||void 0===t?1:ra(t))<0?0:t):[]},Pn.takeRight=function(e,t,n){var l=null==e?0:e.length;return l?Vl(e,(t=l-(t=n||void 0===t?1:ra(t)))<0?0:t,l):[]},Pn.takeRightWhile=function(e,t){return e&&e.length?er(e,Gr(t,3),!1,!0):[]},Pn.takeWhile=function(e,t){return e&&e.length?er(e,Gr(t,3)):[]},Pn.tap=function(e,t){return t(e),e},Pn.throttle=function(e,t,l){var r=!0,i=!0;if("function"!=typeof e)throw new Ee(n);return Vo(l)&&(r="leading"in l?!!l.leading:r,i="trailing"in l?!!l.trailing:i),So(e,t,{leading:r,maxWait:t,trailing:i})},Pn.thru=no,Pn.toArray=na,Pn.toPairs=Pa,Pn.toPairsIn=Ra,Pn.toPath=function(e){return Lo(e)?ct(e,Di):Jo(e)?[e]:hr(Ci(ua(e)))},Pn.toPlainObject=aa,Pn.transform=function(e,t,n){var l=Lo(e),r=l||Bo(e)||Qo(e);if(t=Gr(t,4),null==n){var i=e&&e.constructor;n=r?l?new i:[]:Vo(e)&&Ho(i)?Rn(Ve(e)):{}}return(r?lt:ul)(e,function(e,l,r){return t(n,e,l,r)}),n},Pn.unary=function(e){return Eo(e,1)},Pn.union=Vi,Pn.unionBy=Ki,Pn.unionWith=Yi,Pn.uniq=function(e){return e&&e.length?Xl(e):[]},Pn.uniqBy=function(e,t){return e&&e.length?Xl(e,Gr(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=$i,Pn.update=function(e,t,n){return null==e?e:Ql(e,t,ir(n))},Pn.updateWith=function(e,t,n,l){return l="function"==typeof l?l:void 0,null==e?e:Ql(e,t,ir(n),l)},Pn.values=Ia,Pn.valuesIn=function(e){return null==e?[]:Pt(e,ba(e))},Pn.without=Gi,Pn.words=Ha,Pn.wrap=function(e,t){return No(ir(t),e)},Pn.xor=Zi,Pn.xorBy=Xi,Pn.xorWith=Ji,Pn.zip=Qi,Pn.zipObject=function(e,t){return lr(e||[],t||[],zn)},Pn.zipObjectDeep=function(e,t){return lr(e||[],t||[],jl)},Pn.zipWith=eo,Pn.entries=Pa,Pn.entriesIn=Ra,Pn.extend=sa,Pn.extendWith=da,Xa(Pn,Pn),Pn.add=uu,Pn.attempt=Wa,Pn.camelCase=wa,Pn.capitalize=xa,Pn.ceil=cu,Pn.clamp=function(e,t,n){return void 0===n&&(n=t,t=void 0),void 0!==n&&(n=(n=oa(n))==n?n:0),void 0!==t&&(t=(t=oa(t))==t?t:0),Gn(oa(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=Oa,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,r=n=void 0===n?l:Gn(ra(n),0,l);return(n-=t.length)>=0&&e.slice(n,r)==t},Pn.eq=Io,Pn.escape=function(e){return(e=ua(e))&&F.test(e)?e.replace(M,Lt):e},Pn.escapeRegExp=function(e){return(e=ua(e))&&K.test(e)?e.replace(V,"\\$&"):e},Pn.every=function(e,t,n){var l=Lo(e)?it:nl;return n&&oi(e,t,n)&&(t=void 0),l(e,Gr(t,3))},Pn.find=io,Pn.findIndex=xi,Pn.findKey=function(e,t){return mt(e,Gr(t,3),ul)},Pn.findLast=oo,Pn.findLastIndex=Oi,Pn.findLastKey=function(e,t){return mt(e,Gr(t,3),cl)},Pn.floor=du,Pn.forEach=ao,Pn.forEachRight=uo,Pn.forIn=function(e,t){return null==e?e:ol(e,Gr(t,3),ba)},Pn.forInRight=function(e,t){return null==e?e:al(e,Gr(t,3),ba)},Pn.forOwn=function(e,t){return e&&ul(e,Gr(t,3))},Pn.forOwnRight=function(e,t){return e&&cl(e,Gr(t,3))},Pn.get=ha,Pn.gt=wo,Pn.gte=xo,Pn.has=function(e,t){return null!=e&&ni(e,t,ml)},Pn.hasIn=Ea,Pn.head=Mi,Pn.identity=qa,Pn.includes=function(e,t,n,l){e=ko(e)?e:Ia(e),n=n&&!l?ra(n):0;var r=e.length;return n<0&&(n=on(r+n,0)),Xo(e)?n<=r&&e.indexOf(t,n)>-1:!!r&&Et(e,t,n)>-1},Pn.indexOf=function(e,t,n){var l=null==e?0:e.length;if(!l)return-1;var r=null==n?0:ra(n);return r<0&&(r=on(l+r,0)),Et(e,t,r)},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<on(t,n)}(e=oa(e),t,n)},Pn.invoke=ya,Pn.isArguments=Oo,Pn.isArray=Lo,Pn.isArrayBuffer=Mo,Pn.isArrayLike=ko,Pn.isArrayLikeObject=Fo,Pn.isBoolean=function(e){return!0===e||!1===e||Ko(e)&&vl(e)==a},Pn.isBuffer=Bo,Pn.isDate=Uo,Pn.isElement=function(e){return Ko(e)&&1===e.nodeType&&!$o(e)},Pn.isEmpty=function(e){if(null==e)return!0;if(ko(e)&&(Lo(e)||"string"==typeof e||"function"==typeof e.splice||Bo(e)||Qo(e)||Oo(e)))return!e.length;var t=ti(e);if(t==v||t==E)return!e.size;if(si(e))return!Al(e).length;for(var n in e)if(be.call(e,n))return!1;return!0},Pn.isEqual=function(e,t){return yl(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?yl(e,t,void 0,n):!!l},Pn.isError=jo,Pn.isFinite=function(e){return"number"==typeof e&&nn(e)},Pn.isFunction=Ho,Pn.isInteger=Wo,Pn.isLength=zo,Pn.isMap=Yo,Pn.isMatch=function(e,t){return e===t||Sl(e,t,Xr(t))},Pn.isMatchWith=function(e,t,n){return n="function"==typeof n?n:void 0,Sl(e,t,Xr(t),n)},Pn.isNaN=function(e){return qo(e)&&e!=+e},Pn.isNative=function(e){if(ci(e))throw new de("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=qo,Pn.isObject=Vo,Pn.isObjectLike=Ko,Pn.isPlainObject=$o,Pn.isRegExp=Go,Pn.isSafeInteger=function(e){return Wo(e)&&e>=-9007199254740991&&e<=9007199254740991},Pn.isSet=Zo,Pn.isString=Xo,Pn.isSymbol=Jo,Pn.isTypedArray=Qo,Pn.isUndefined=function(e){return void 0===e},Pn.isWeakMap=function(e){return Ko(e)&&ti(e)==y},Pn.isWeakSet=function(e){return Ko(e)&&"[object WeakSet]"==vl(e)},Pn.join=function(e,t){return null==e?"":ln.call(e,t)},Pn.kebabCase=La,Pn.last=Ui,Pn.lastIndexOf=function(e,t,n){var l=null==e?0:e.length;if(!l)return-1;var r=l;return void 0!==n&&(r=(r=ra(n))<0?on(l+r,0):an(r,l-1)),t==t?function(e,t,n){for(var l=n+1;l--;)if(e[l]===t)return l;return l}(e,t,r):ht(e,gt,r,!0)},Pn.lowerCase=Ma,Pn.lowerFirst=ka,Pn.lt=ea,Pn.lte=ta,Pn.max=function(e){return e&&e.length?ll(e,qa,fl):void 0},Pn.maxBy=function(e,t){return e&&e.length?ll(e,Gr(t,2),fl):void 0},Pn.mean=function(e){return yt(e,qa)},Pn.meanBy=function(e,t){return yt(e,Gr(t,2))},Pn.min=function(e){return e&&e.length?ll(e,qa,Cl):void 0},Pn.minBy=function(e,t){return e&&e.length?ll(e,Gr(t,2),Cl):void 0},Pn.stubArray=iu,Pn.stubFalse=ou,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?Il(e,ra(t)):void 0},Pn.noConflict=function(){return ze._===this&&(ze._=Ne),this},Pn.noop=Ja,Pn.now=ho,Pn.pad=function(e,t,n){e=ua(e);var l=(t=ra(t))?Wt(e):0;if(!t||l>=t)return e;var r=(t-l)/2;return wr(Qt(r),n)+e+wr(Jt(r),n)},Pn.padEnd=function(e,t,n){e=ua(e);var l=(t=ra(t))?Wt(e):0;return t&&l<t?e+wr(t-l,n):e},Pn.padStart=function(e,t,n){e=ua(e);var l=(t=ra(t))?Wt(e):0;return t&&l<t?wr(t-l,n)+e:e},Pn.parseInt=function(e,t,n){return n||null==t?t=0:t&&(t=+t),cn(ua(e).replace(Y,""),t||0)},Pn.random=function(e,t,n){if(n&&"boolean"!=typeof n&&oi(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 r=sn();return an(e+r*(t-e+Ue("1e-"+((r+"").length-1))),t)}return Ml(e,t)},Pn.reduce=function(e,t,n){var l=Lo(e)?dt:Tt,r=arguments.length<3;return l(e,Gr(t,4),n,r,el)},Pn.reduceRight=function(e,t,n){var l=Lo(e)?pt:Tt,r=arguments.length<3;return l(e,Gr(t,4),n,r,tl)},Pn.repeat=function(e,t,n){return t=(n?oi(e,t,n):void 0===t)?1:ra(t),kl(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,r=(t=or(t,e)).length;for(r||(r=1,e=void 0);++l<r;){var i=null==e?void 0:e[Di(t[l])];void 0===i&&(l=r,i=n),e=Ho(i)?i.call(e):i}return e},Pn.round=vu,Pn.runInContext=e,Pn.sample=function(e){return(Lo(e)?Un:Bl)(e)},Pn.size=function(e){if(null==e)return 0;if(ko(e))return Xo(e)?Wt(e):e.length;var t=ti(e);return t==v||t==E?e.size:Al(e).length},Pn.snakeCase=Fa,Pn.some=function(e,t,n){var l=Lo(e)?vt:Kl;return n&&oi(e,t,n)&&(t=void 0),l(e,Gr(t,3))},Pn.sortedIndex=function(e,t){return Yl(e,t)},Pn.sortedIndexBy=function(e,t,n){return ql(e,t,Gr(n,2))},Pn.sortedIndexOf=function(e,t){var n=null==e?0:e.length;if(n){var l=Yl(e,t);if(l<n&&Io(e[l],t))return l}return-1},Pn.sortedLastIndex=function(e,t){return Yl(e,t,!0)},Pn.sortedLastIndexBy=function(e,t,n){return ql(e,t,Gr(n,2),!0)},Pn.sortedLastIndexOf=function(e,t){if(null!=e&&e.length){var n=Yl(e,t,!0)-1;if(Io(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(ra(n),0,e.length),t=Zl(t),e.slice(n,n+t.length)==t},Pn.subtract=fu,Pn.sum=function(e){return e&&e.length?At(e,qa):0},Pn.sumBy=function(e,t){return e&&e.length?At(e,Gr(t,2)):0},Pn.template=function(e,t,n){var l=Pn.templateSettings;n&&oi(e,t,n)&&(t=void 0),e=ua(e),t=da({},t,l,Ur);var r,i,o=da({},t.imports,l.imports,Ur),a=Sa(o),u=Pt(o,a),c=0,s=t.interpolate||ue,d="__p += '",p=me((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,o,a,u){return l||(l=o),d+=e.slice(c,u).replace(ce,Mt),n&&(r=!0,d+="' +\n__e("+n+") +\n'"),a&&(i=!0,d+="';\n"+a+";\n__p += '"),l&&(d+="' +\n((__t = ("+l+")) == null ? '' : __t) +\n'"),c=u+t.length,t}),d+="';\n";var f=be.call(t,"variable")&&t.variable;if(f){if(J.test(f))throw new de("Invalid `variable` option passed into `_.template`")}else d="with (obj) {\n"+d+"\n}\n";d=(i?d.replace(w,""):d).replace(x,"$1").replace(O,"$1;"),d="function("+(f||"obj")+") {\n"+(f?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(r?", __e = _.escape":"")+(i?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+d+"return __p\n}";var m=Wa(function(){return pe(a,v+"return "+d).apply(void 0,u)});if(m.source=d,jo(m))throw m;return m},Pn.times=function(e,t){if((e=ra(e))<1||e>9007199254740991)return[];var n=4294967295,l=an(e,4294967295);e-=4294967295;for(var r=Ct(l,t=Gr(t));++n<e;)t(n);return r},Pn.toFinite=la,Pn.toInteger=ra,Pn.toLength=ia,Pn.toLower=function(e){return ua(e).toLowerCase()},Pn.toNumber=oa,Pn.toSafeInteger=function(e){return e?Gn(ra(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 Dt(e);if(!e||!(t=Zl(t)))return e;var l=zt(e),r=zt(t);return ur(l,It(l,r),wt(l,r)+1).join("")},Pn.trimEnd=function(e,t,n){if((e=ua(e))&&(n||void 0===t))return e.slice(0,Vt(e)+1);if(!e||!(t=Zl(t)))return e;var l=zt(e);return ur(l,0,wt(l,zt(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=zt(e);return ur(l,It(l,zt(t))).join("")},Pn.truncate=function(e,t){var n=30,l="...";if(Vo(t)){var r="separator"in t?t.separator:r;n="length"in t?ra(t.length):n,l="omission"in t?Zl(t.omission):l}var i=(e=ua(e)).length;if(kt(e)){var o=zt(e);i=o.length}if(n>=i)return e;var a=n-Wt(l);if(a<1)return l;var u=o?ur(o,0,a).join(""):e.slice(0,a);if(void 0===r)return u+l;if(o&&(a+=u.length-a),Go(r)){if(e.slice(a).search(r)){var c,s=u;for(r.global||(r=me(r.source,ua(te.exec(r))+"g")),r.lastIndex=0;c=r.exec(s);)var d=c.index;u=u.slice(0,void 0===d?a:d)}}else if(e.indexOf(Zl(r),a)!=a){var p=u.lastIndexOf(r);p>-1&&(u=u.slice(0,p))}return u+l},Pn.unescape=function(e){return(e=ua(e))&&k.test(e)?e.replace(L,Kt):e},Pn.uniqueId=function(e){var t=++Te;return ua(e)+t},Pn.upperCase=Ua,Pn.upperFirst=ja,Pn.each=ao,Pn.eachRight=uo,Pn.first=Mi,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){xn.prototype[e]=function(n){n=void 0===n?1:on(ra(n),0);var l=this.__filtered__&&!t?new xn(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},xn.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;xn.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:Gr(e,3),type:n}),t.__filtered__=t.__filtered__||l,t}}),lt(["head","last"],function(e,t){var n="take"+(t?"Right":"");xn.prototype[e]=function(){return this[n](1).value()[0]}}),lt(["initial","tail"],function(e,t){var n="drop"+(t?"":"Right");xn.prototype[e]=function(){return this.__filtered__?new xn(this):this[n](1)}}),xn.prototype.compact=function(){return this.filter(qa)},xn.prototype.find=function(e){return this.filter(e).head()},xn.prototype.findLast=function(e){return this.reverse().find(e)},xn.prototype.invokeMap=Fl(function(e,t){return"function"==typeof e?new xn(this):this.map(function(n){return _l(n,e,t)})}),xn.prototype.reject=function(e){return this.filter(Co(Gr(e)))},xn.prototype.slice=function(e,t){e=ra(e);var n=this;return n.__filtered__&&(e>0||t<0)?new xn(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),void 0!==t&&(n=(t=ra(t))<0?n.dropRight(-t):n.take(t-e)),n)},xn.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},xn.prototype.toArray=function(){return this.take(4294967295)},ul(xn.prototype,function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),l=/^(?:head|last)$/.test(t),r=Pn[l?"take"+("last"==t?"Right":""):t],i=l||/^find/.test(t);r&&(Pn.prototype[t]=function(){var t=this.__wrapped__,o=l?[1]:arguments,a=t instanceof xn,u=o[0],c=a||Lo(t),s=function(e){var t=r.apply(Pn,st([e],o));return l&&d?t[0]:t};c&&n&&"function"==typeof u&&1!=u.length&&(a=c=!1);var d=this.__chain__,p=!!this.__actions__.length,v=i&&!d,f=a&&!p;if(!i&&c){t=f?t:new xn(this);var m=e.apply(t,o);return m.__actions__.push({func:no,args:[s],thisArg:void 0}),new wn(m,d)}return v&&f?e.apply(this,o):(m=this.thru(s),v?l?m.value()[0]:m.value():m)})}),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 r=this.value();return t.apply(Lo(r)?r:[],e)}return this[n](function(n){return t.apply(Lo(n)?n:[],e)})}}),ul(xn.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[Nr(void 0,2).name]=[{name:"wrapper",func:void 0}],xn.prototype.clone=function(){var e=new xn(this.__wrapped__);return e.__actions__=hr(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=hr(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=hr(this.__views__),e},xn.prototype.reverse=function(){if(this.__filtered__){var e=new xn(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},xn.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,n=Lo(e),l=t<0,r=n?e.length:0,i=function(e,t,n){for(var l=-1,r=n.length;++l<r;){var i=n[l],o=i.size;switch(i.type){case"drop":e+=o;break;case"dropRight":t-=o;break;case"take":t=an(t,e+o);break;case"takeRight":e=on(e,t-o)}}return{start:e,end:t}}(0,r,this.__views__),o=i.start,a=i.end,u=a-o,c=l?a:o-1,s=this.__iteratees__,d=s.length,p=0,v=an(u,this.__takeCount__);if(!n||!l&&r==u&&v==u)return tr(e,this.__actions__);var f=[];e:for(;u--&&p<v;){for(var m=-1,h=e[c+=t];++m<d;){var E=s[m],_=E.type,g=(0,E.iteratee)(h);if(2==_)h=g;else if(!g){if(1==_)continue e;break e}}f[p++]=h}return f},Pn.prototype.at=lo,Pn.prototype.chain=function(){return to(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 In;){var l=Pi(n);l.__index__=0,l.__values__=void 0,t?r.__wrapped__=l:t=l;var r=l;n=n.__wrapped__}return r.__wrapped__=e,t},Pn.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof xn){var t=e;return this.__actions__.length&&(t=new xn(this)),(t=t.reverse()).__actions__.push({func:no,args:[zi],thisArg:void 0}),new wn(t,this.__chain__)}return this.thru(zi)},Pn.prototype.toJSON=Pn.prototype.valueOf=Pn.prototype.value=function(){return tr(this.__wrapped__,this.__actions__)},Pn.prototype.first=Pn.prototype.head,bt&&(Pn.prototype[bt]=function(){return this}),Pn}();Ke?((Ke.exports=Yt)._=Yt,Ve._=Yt):ze._=Yt}).call(p)});const m=function(e){return void 0===e&&(e=""),function(e){return void 0===e&&(e=""),!(!e||null==e||null==e||""==e)}(e)?e:"PTR_NA"},h=e=>{if(e){const t=new Date(e);let n=t.getMonth()+1,l=t.getDate(),r=t.getFullYear();return n=(n>9?"":"0")+n,l=(l>9?"":"0")+l,r+"-"+n+"-"+l}return null},E=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}},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},y=[{head:"ES_TITILE_OWNER_DETAILS",body:[{route:"info",component:"PTRServiceDoc",nextStep:"owners",key:"Documents"},{route:"owners",component:"PTRCitizenDetails",withoutLabel:!0,key:"ownerss",type:"component",nextStep:"pet-details",hideInEmployee:!0,isMandatory:!0,texts:{submitBarLabel:"PTR_COMMON_NEXT"}}]},{head:"ES_TITILE_PET_DETAILS",body:[{route:"pet-details",component:"PTRCitizenPet",withoutLabel:!0,key:"pets",type:"component",isMandatory:!0,hideInEmployee:!0,nextStep:"address",texts:{submitBarLabel:"PTR_COMMON_NEXT"}}]},{head:"PTR_LOCATION_DETAILS",body:[{route:"address",component:"PTRSelectAddress",withoutLabel:!0,texts:{submitBarLabel:"PTR_COMMON_NEXT"},key:"address",nextStep:"documents",isMandatory:!0,type:"component"}]},{head:"ES_TITILE_DOCUMENT_DETAILS",body:[{route:"documents",component:"PTRSelectProofIdentity",withoutLabel:!0,key:"documents",type:"component",nextStep:null,texts:{submitBarLabel:"PTR_COMMON_NEXT"}}]}];function S(e){var r,i;let{t:o,document:a,setDocuments:c,setError:s,documents:d,id:p,renewApplication:v,user:f}=e;const m=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],h=null==v||null===(r=v.documents)||void 0===r?void 0:r.find(e=>{var t;return null==e||null===(t=e.documentType)||void 0===t?void 0:t.includes(null==a?void 0:a.code)}),[E,_]=n.useState(!1),[g,y]=n.useState(h?u({},h,{active:!0===(null==a?void 0:a.active),code:null==h?void 0:h.documentType,i18nKey:null==h?void 0:h.documentType}):1===(null==a||null===(i=a.dropdownData)||void 0===i?void 0:i.length)?null==a?void 0:a.dropdownData[0]:u({},m,{active:!0===(null==a?void 0:a.active),code:null==m?void 0:m.documentType,i18nKey:null==m?void 0:m.documentType.replaceAll(".","_")})),S=()=>l.createElement("div",{className:"loading-spinner"}),[b,T]=n.useState(null),[A,C]=n.useState(()=>(null==m?void 0:m.filestoreId)||null),{dropdownData:D}=a;var N=D;const[P,R]=n.useState(!1);return n.useEffect(()=>{var e;null==v||null===(e=v.documents)||void 0===e||e.map((e,t)=>{null!=e&&e.documentType.includes(null==a?void 0:a.code)&&C(e)})},[null==v?void 0:v.documents]),n.useEffect(()=>{null!=g&&g.code&&null!=v&&v.applicationNumber?c(e=>{const t=null==e?void 0:e.filter(e=>(null==e?void 0:e.documentType)!==(null==g?void 0:g.code));return 0===(null==A?void 0:A.length)||null===A?t:[...null==t?void 0:t.filter(e=>(null==e?void 0:e.fileStoreId)!==A),{documentType:null==g?void 0:g.code,filestoreId:null==A?void 0:A.documentUid,documentUid:null==A?void 0:A.documentUid}]}):null!=g&&g.code&&c(e=>{const t=null==e?void 0:e.filter(e=>(null==e?void 0:e.documentType)!==(null==g?void 0:g.code));return 0===(null==A?void 0:A.length)||null===A?t:[...null==t?void 0:t.filter(e=>(null==e?void 0:e.fileStoreId)!==A),{documentType:null==g?void 0:g.code,filestoreId:A,documentUid:A}]})},[A,g]),n.useEffect(()=>{!function(){try{s(null);const e=function(){if(b){const e=function(){if(b.size>=5242880)s(o("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=function(e,t){try{var n=function(e,t){try{var n=(C(null),_(!0),Promise.resolve(Digit.UploadServices.Filestorage("PTR",b,Digit.ULBService.getStateId())).then(function(e){var t,n,l,r;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?C(null==e||null===(l=e.data)||void 0===l||null===(r=l.files[0])||void 0===r?void 0:r.fileStoreId):s(o("CS_FILE_UPLOAD_ERROR"))}))}catch(e){return t()}return n&&n.then?n.then(void 0,t):n}(0,function(){s(o("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(_(!1),e)throw t;return t});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[b]),n.useEffect(()=>{P&&C(null)},[P]),l.createElement("div",{style:{marginBottom:"24px"}},null!=a&&a.hasDropdown?l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},o(null==a?void 0:a.code.replaceAll(".","_"))," ",l.createElement("span",{className:"astericColor"},"*")),l.createElement(t.Dropdown,{className:"form-field",selected:g,style:{width:"EMPLOYEE"===(null==f?void 0:f.type)?"50%":"100%"},option:N.map(e=>{var t;return u({},e,{i18nKey:null===(t=e.code)||void 0===t?void 0:t.replaceAll(".","_")})}),select:e=>y(e),optionKey:"i18nKey",t:o})):l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},o(null==a?void 0:a.code.replaceAll(".","_"))," ",l.createElement("span",{className:"astericColor"},"*"))),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"}),l.createElement("div",{className:"field"},l.createElement(t.UploadFile,{onUpload:function(e){T(e.target.files[0])},onDelete:()=>{C(null)},id:p,message:E?l.createElement("div",{style:{display:"flex",alignItems:"center",gap:"8px"}},l.createElement(S,null),l.createElement("span",null,"Uploading...")):A?"1 File Uploaded":"No File Uploaded",textStyles:{width:"100%"},inputStyles:{width:"280px"},accept:".pdf, .jpeg, .jpg, .png",buttonType:"button",error:!A}))))}"undefined"!=typeof Symbol&&(Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator"))),"undefined"!=typeof Symbol&&(Symbol.asyncIterator||(Symbol.asyncIterator=Symbol("Symbol.asyncIterator")));const b=e=>{var n,i,o;let{data:a,OpenImage:u}=e;const{t:c}=r.useTranslation();return l.createElement("div",null,a.date&&l.createElement("p",null,a.date),l.createElement("p",null,a.name),a.mobileNumber&&l.createElement(t.TelePhone,{mobile:a.mobileNumber}),a.source&&l.createElement("p",null,c("ES_APPLICATION_DETAILS_APPLICATION_CHANNEL_"+a.source.toUpperCase())),a.comment&&l.createElement(Reason,{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=>l.createElement("div",{className:"TLComments"},l.createElement("h3",null,c("WF_COMMON_COMMENTS")),l.createElement("p",{style:{overflowX:"scroll"}},e)))):null,(null==a||null===(i=a.thumbnailsToShow)||void 0===i||null===(o=i.thumbs)||void 0===o?void 0:o.length)>0?l.createElement("div",{className:"TLComments"},l.createElement("h3",null,c("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)},T=e=>{var o,a,u,c,s,d,p;const{t:v}=r.useTranslation(),f=null==e||null===(o=e.application)||void 0===o||null===(a=o.workflow)||void 0===a?void 0:a.businessService,{isLoading:m,data:h}=Digit.Hooks.useWorkflowDetails({tenantId:null===(u=e.application)||void 0===u?void 0:u.tenantId,id:null===(c=e.application)||void 0===c?void 0:c.applicationNumber,moduleCode:f});function E(e){var t;window.open(null==e||null===(t=e.fullImage)||void 0===t?void 0:t[0],"_blank")}const _=t=>{if("OPEN"===t.state){var n,r;const i={date:null==t||null===(n=t.auditDetails)||void 0===n?void 0:n.lastModified,source:(null===(r=e.application)||void 0===r?void 0:r.channel)||""};return l.createElement(b,{data:i})}if(t.state){var i,o,a,u,c;const e={date:null==t||null===(i=t.auditDetails)||void 0===i?void 0:i.lastModified,name:null==t||null===(o=t.assignes)||void 0===o||null===(a=o[0])||void 0===a?void 0:a.name,mobileNumber:null==t||null===(u=t.assignes)||void 0===u||null===(c=u[0])||void 0===c?void 0:c.mobileNumber,comment:v(null==t?void 0:t.comment),wfComment:t.wfComment,thumbnailsToShow:null==t?void 0:t.thumbnailsToShow};return l.createElement(b,{data:e,OpenImage:E})}{var s,d;const n={date:Digit.DateUtils.ConvertTimestampToDate(null===(s=e.application)||void 0===s?void 0:s.auditDetails.lastModified),name:null==t||null===(d=t.assigner)||void 0===d?void 0:d.name,comment:v(null==t?void 0:t.comment)};return l.createElement(b,{data:n})}};return m?l.createElement(t.Loader,null):l.createElement(l.Fragment,null,!m&&l.createElement(n.Fragment,null,(null==h||null===(s=h.timeline)||void 0===s?void 0:s.length)>0&&l.createElement(t.CardSectionHeader,{style:{marginBottom:"16px",marginTop:"32px"}},v("CS_APPLICATION_DETAILS_APPLICATION_TIMELINE")),null!=h&&h.timeline&&1===(null==h||null===(d=h.timeline)||void 0===d?void 0:d.length)?l.createElement(t.CheckPoint,{isCompleted:!0,label:v((null==h||null===(p=h.timeline[0])||void 0===p?void 0:p.state)&&"WF_"+f+"_"+h.timeline[0].state||"NA"),customChild:_(null==h?void 0:h.timeline[0])}):l.createElement(t.ConnectingCheckPoints,null,(null==h?void 0:h.timeline)&&(null==h?void 0:h.timeline.map((e,n,r)=>{var i;return l.createElement(l.Fragment,{key:n},l.createElement(t.CheckPoint,{keyValue:n,isCompleted:0===n,label:v("ES_PTR_COMMON_STATUS_"+(null==h||null===(i=h.processInstances[n].state)||void 0===i?void 0:i.state)),customChild:_(e)}))})))),h&&(n=>{var r,o,a;let u=n[0];const c=n.map(e=>e.action);if(c.includes("PAY")||c.includes("EDIT")){let e=c.indexOf("EDIT")||c.indexOf("PAY");e=-1!=e?e:c.indexOf("PAY"),u=n[e]}switch(null===(r=u)||void 0===r?void 0:r.action){case"PAY":return"citizen"===(null==e?void 0:e.userType)?l.createElement("div",{style:{marginTop:"1em",bottom:"0px",width:"100%",marginBottom:"1.2em"}},l.createElement(i.Link,{to:{pathname:"/upyog-ui/citizen/payment/my-bills/"+f+"/"+(null==e||null===(o=e.application)||void 0===o?void 0:o.applicationNumber),state:{tenantId:e.application.tenantId,applicationNumber:null==e||null===(a=e.application)||void 0===a?void 0:a.applicationNumber}}},l.createElement(t.SubmitBar,{label:v("CS_APPLICATION_DETAILS_MAKE_PAYMENT")}))):null;default:return null}})(null==h?void 0:h.nextActions))},A=["path","url"],C=[{screenPath:"petservice/new-application/acknowledgement"},{screenPath:"petservice/edit-application/acknowledgement"}],D=()=>{var e,n,o,a,s,d;const p=i.useRouteMatch(),{path:v}=p,{t:f}=(c(p,A),r.useTranslation()),m=null===(e=Digit)||void 0===e||null===(n=e.ComponentRegistryService)||void 0===n?void 0:n.getComponent("PTRCreatePet"),h=null===(o=Digit)||void 0===o||null===(a=o.ComponentRegistryService)||void 0===a?void 0:a.getComponent("PTRApplicationDetails"),E=null===(s=Digit)||void 0===s||null===(d=s.ComponentRegistryService)||void 0===d?void 0:d.getComponent("PTRMyApplications");return l.createElement("span",{className:"pet-citizen",style:{width:"100%"}},l.createElement(i.Switch,null,l.createElement(t.AppContainer,null,(void 0===(_=C)&&(_=[]),_.filter(e=>window.location.href.includes(e.screenPath)).length>0?"":l.createElement(t.BackButton,null,"Back")),l.createElement(t.PrivateRoute,{path:v+"/petservice/new-application",component:m}),l.createElement(t.PrivateRoute,{path:v+"/petservice/revised-application",component:m}),l.createElement(t.PrivateRoute,{path:v+"/petservice/application/:acknowledgementIds/:tenantId",component:h}),l.createElement(t.PrivateRoute,{path:v+"/petservice/my-applications",component:E}),l.createElement(t.PrivateRoute,{path:v+"/petservice/search",component:e=>l.createElement(Search,u({},e,{t:f,parentRoute:v}))}))));var _},N=e=>{let{jumpTo:n}=e;const{t:o}=r.useTranslation(),a=i.useHistory();return l.createElement(t.LinkButton,{label:o("CS_COMMON_CHANGE"),className:"check-page-link-button",onClick:function(){a.push(n)}})},P=e=>e.substr(0,1).toUpperCase()+e.substr(1),R=(e,t)=>{let n=[{title:t("PTR_PET_NAME"),value:null==e?void 0:e.petDetails.petName},{title:t("PTR_PET_TYPE"),value:null==e?void 0:e.petDetails.petType},{title:t("PTR_BREED_TYPE"),value:null==e?void 0:e.petDetails.breedType},{title:t("PTR_VACCINATED_DATE"),value:null==e?void 0:e.petDetails.lastVaccineDate},{title:t("PTR_VACCINATION_NUMBER"),value:null==e?void 0:e.petDetails.vaccinationNumber},{title:t("PTR_DOCTOR_NAME"),value:null==e?void 0:e.petDetails.doctorName},{title:t("PTR_CLINIC_NAME"),value:null==e?void 0:e.petDetails.clinicName},{title:t("PTR_PET_AGE"),value:(null==e?void 0:e.petDetails.petAge)+" Months"},{title:t("PTR_PET_SEX"),value:null==e?void 0:e.petDetails.petGender}];return{title:t("ES_TITILE_PET_DETAILS"),values:n}},I=function(e,t,n){try{var l;function r(l){var r,i,o,a,u,c,s,d;return{t:n,tenantId:null==t?void 0:t.code,name:n(null==t?void 0:t.i18nKey)+" "+(d=n("ULBGRADE_"+(null==t||null===(r=t.city)||void 0===r?void 0:r.ulbGrade.toUpperCase().replace(" ","_").replace(".","_"))),d.toLowerCase().split(" ").map(P).join(" ")),email:null==t?void 0:t.emailId,phoneNumber:null==t?void 0:t.contactNumber,applicationNumber:null==e?void 0:e.applicationNumber,heading:n("PTR_ACKNOWLEDGEMENT"),details:[{title:n("CS_TITLE_APPLICATION_DETAILS"),values:[{title:n("PTR_VALIDITY_DATE"),value:(s=null==e?void 0:e.validityDate,s?new Date(1e3*s).getDate()+"/"+(new Date(1e3*s).getMonth()+1)+"/"+new Date(1e3*s).getFullYear().toString():"NA")},{title:n("PTR_APPLICANT_NAME"),value:null==e?void 0:e.applicantName},{title:n("CS_APPLICATION_DETAILS_APPLICATION_DATE"),value:Digit.DateUtils.ConvertTimestampToDate(null==e||null===(i=e.auditDetails)||void 0===i?void 0:i.createdTime,"dd/MM/yyyy")},{title:n("PTR_MOBILE_NUMBER"),value:null==e?void 0:e.mobileNumber},{title:n("PTR_EMAIL_ID"),value:null==e?void 0:e.emailId}]},R(e,n),{title:n("PTR_LOCATION_DETAILS"),values:[{title:n("PTR_PINCODE"),value:null==e||null===(o=e.address)||void 0===o?void 0:o.pincode},{title:n("PTR_CITY"),value:null==e||null===(a=e.address)||void 0===a?void 0:a.city},{title:n("PTR_STREET_NAME"),value:null==e||null===(u=e.address)||void 0===u?void 0:u.street},{title:n("PTR_HOUSE_NO"),value:null==e||null===(c=e.address)||void 0===c?void 0:c.doorNo}]}]}}const i=null==e||null===(l=e.documents)||void 0===l?void 0:l.map(e=>null==e?void 0:e.fileStoreId);return Promise.resolve((null==i?void 0:i.length)>0?Promise.resolve(Digit.UploadServices.Filefetch(i,Digit.ULBService.getStateId())).then(r):r())}catch(e){return Promise.reject(e)}},w=e=>{const{t:t}=r.useTranslation();return e.isSuccess?window.location.href.includes("revised-application")?t("PTR_REVISED_SUCCESSFULLY"):t("ES_PTR_RESPONSE_CREATE_ACTION"):e.isLoading?t("CS_PTR_APPLICATION_PENDING"):e.isSuccess?void 0:t("CS_PTR_APPLICATION_FAILED")},x={padding:"4px 0px",justifyContent:"space-between"},O=e=>{var n;return l.createElement(t.Banner,{message:w(e),applicationNumber:null===(n=e.data)||void 0===n?void 0:n.PetRegistrationApplications[0].applicationNumber,info:e.isSuccess?e.t("PTR_APPLICATION_NO"):"",successful:e.isSuccess,style:{width:"100%"}})},L=e=>{var n;let{application:o,buttonLabel:a}=e;const{t:u}=r.useTranslation(),c=i.useHistory();return l.createElement(t.Card,null,l.createElement(t.KeyNote,{keyValue:u("PTR_APPLICATION_NO_LABEL"),note:null==o?void 0:o.applicationNumber}),l.createElement(t.KeyNote,{keyValue:u("PTR_APPLICANT_NAME"),note:null==o?void 0:o.applicantName}),l.createElement(t.KeyNote,{keyValue:u("PTR_APPLICATION_TYPE"),note:null==o?void 0:o.applicationType}),l.createElement(t.KeyNote,{keyValue:u("PTR_APPLICATION_STATUS"),note:null==o?void 0:o.status}),l.createElement(t.KeyNote,{keyValue:u("PTR_SEARCH_PET_TYPE"),note:null==o||null===(n=o.petDetails)||void 0===n?void 0:n.petType}),"Expired"==(null==o?void 0:o.status)&&l.createElement(t.SubmitBar,{style:{marginBottom:"5px"},label:"Renewal",onSubmit:()=>{var e;sessionStorage.setItem("petId",null==o?void 0:o.applicationNumber),null!=o&&o.petToken&&(null==o||null===(e=o.petToken)||void 0===e?void 0:e.length)>0&&sessionStorage.setItem("petToken",null==o?void 0:o.petToken),c.push("/upyog-ui/citizen/ptr/petservice/revised-application")}}),l.createElement(i.Link,{to:"/upyog-ui/citizen/ptr/petservice/application/"+(null==o?void 0:o.applicationNumber)+"/"+(null==o?void 0:o.tenantId)},l.createElement(t.SubmitBar,{label:a})))};var M,k=Array.isArray,F="object"==typeof self&&self&&self.Object===Object&&self,B="object"==typeof p&&p&&p.Object===Object&&p||F||Function("return this")(),U=B.Symbol,j=Object.prototype,H=j.hasOwnProperty,W=j.toString,z=U?U.toStringTag:void 0,V=Object.prototype.toString,K=U?U.toStringTag:void 0,Y=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":K&&K in Object(e)?function(e){var t=H.call(e,z),n=e[z];try{e[z]=void 0;var l=!0}catch(e){}var r=W.call(e);return l&&(t?e[z]=n:delete e[z]),r}(e):function(e){return V.call(e)}(e)},q=function(e){return"symbol"==typeof e||function(e){return null!=e&&"object"==typeof e}(e)&&"[object Symbol]"==Y(e)},$=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,G=/^\w*$/,Z=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},X=B["__core-js_shared__"],J=(M=/[^.]+$/.exec(X&&X.keys&&X.keys.IE_PROTO||""))?"Symbol(src)_1."+M:"",Q=Function.prototype.toString,ee=/^\[object .+?Constructor\]$/,te=RegExp("^"+Function.prototype.toString.call(Object.prototype.hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ne=function(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return function(e){return!(!Z(e)||(t=e,J&&J in t))&&(function(e){if(!Z(e))return!1;var t=Y(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}(e)?te:ee).test(function(e){if(null!=e){try{return Q.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(e));var t}(n)?n:void 0},le=ne(Object,"create"),re=Object.prototype.hasOwnProperty,ie=Object.prototype.hasOwnProperty;function oe(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])}}oe.prototype.clear=function(){this.__data__=le?le(null):{},this.size=0},oe.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},oe.prototype.get=function(e){var t=this.__data__;if(le){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return re.call(t,e)?t[e]:void 0},oe.prototype.has=function(e){var t=this.__data__;return le?void 0!==t[e]:ie.call(t,e)},oe.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=le&&void 0===t?"__lodash_hash_undefined__":t,this};var ae=oe,ue=function(e,t){for(var n=e.length;n--;)if((l=e[n][0])===(r=t)||l!=l&&r!=r)return n;var l,r;return-1},ce=Array.prototype.splice;function se(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])}}se.prototype.clear=function(){this.__data__=[],this.size=0},se.prototype.delete=function(e){var t=this.__data__,n=ue(t,e);return!(n<0||(n==t.length-1?t.pop():ce.call(t,n,1),--this.size,0))},se.prototype.get=function(e){var t=this.__data__,n=ue(t,e);return n<0?void 0:t[n][1]},se.prototype.has=function(e){return ue(this.__data__,e)>-1},se.prototype.set=function(e,t){var n=this.__data__,l=ue(n,e);return l<0?(++this.size,n.push([e,t])):n[l][1]=t,this};var de=se,pe=ne(B,"Map"),ve=function(e,t){var n,l,r=e.__data__;return("string"==(l=typeof(n=t))||"number"==l||"symbol"==l||"boolean"==l?"__proto__"!==n:null===n)?r["string"==typeof t?"string":"hash"]:r.map};function fe(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])}}fe.prototype.clear=function(){this.size=0,this.__data__={hash:new ae,map:new(pe||de),string:new ae}},fe.prototype.delete=function(e){var t=ve(this,e).delete(e);return this.size-=t?1:0,t},fe.prototype.get=function(e){return ve(this,e).get(e)},fe.prototype.has=function(e){return ve(this,e).has(e)},fe.prototype.set=function(e,t){var n=ve(this,e),l=n.size;return n.set(e,t),this.size+=n.size==l?0:1,this};var me=fe;function he(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function(){var l=arguments,r=t?t.apply(this,l):l[0],i=n.cache;if(i.has(r))return i.get(r);var o=e.apply(this,l);return n.cache=i.set(r,o)||i,o};return n.cache=new(he.Cache||me),n}he.Cache=me;var Ee,_e,ge=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ye=/\\(\\)?/g,Se=(Ee=he(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(ge,function(e,n,l,r){t.push(l?r.replace(ye,"$1"):n||e)}),t},function(e){return 500===_e.size&&_e.clear(),e}),_e=Ee.cache,Ee),be=U?U.prototype:void 0,Te=be?be.toString:void 0,Ae=function(e){if("string"==typeof e||q(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t},Ce=function(e,t,n){var l=null==e?void 0:function(e,t){for(var n=0,l=(t=function(e,t){return k(e)?e:function(e,t){if(k(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!q(e))||G.test(e)||!$.test(e)||null!=t&&e in Object(t)}(e,t)?[e]:Se(function(e){return null==e?"":function e(t){if("string"==typeof t)return t;if(k(t))return function(e,t){for(var n=-1,l=null==e?0:e.length,r=Array(l);++n<l;)r[n]=t(e[n],n,e);return r}(t,e)+"";if(q(t))return Te?Te.call(t):"";var n=t+"";return"0"==n&&1/t==-1/0?"-0":n}(e)}(e))}(t,e)).length;null!=e&&n<l;)e=e[Ae(t[n++])];return n&&n==l?e:void 0}(e,t);return void 0===l?n:l};const De=["tenantId","payments"],Ne=e=>{let{t:n,currentPage:r,columns:i,data:o,getCellProps:a,disableSort:u,onSort:c,onNextPage:s,onPrevPage:d,onPageSizeChange:p,pageSizeLimit:v,sortParams:f,totalRecords:m}=e;return l.createElement(t.Table,{t:n,data:o,currentPage:r,columns:i,getCellProps:a,onNextPage:s,onPrevPage:d,pageSizeLimit:v,disableSort:u,onPageSizeChange:p,onSort:c,sortParams:f,totalRecords:m})},Pe=e=>{let{businessService:o}=e;const{t:a}=r.useTranslation(),u=[{text:"ES_TITLE_NEW_PET_REGISTRATION",link:"/upyog-ui/employee/ptr/new-application",businessService:"ptr",roles:["PT_CEMP"]},{text:"PTR_SEARCH_PET",link:"/upyog-ui/employee/ptr/search",businessService:"ptr",roles:[]},{text:"PTR_COMMON_APPLICATION_SEARCH",link:"/upyog-ui/employee/ptr/application-search",businessService:"ptr",roles:[]}],[c,s]=n.useState([]),{roles:d}=Digit.UserService.getUser().info;return n.useEffect(()=>{let e=u.filter(e=>e.businessService===o).filter(e=>{let{roles:t}=e;return t.some(e=>d.map(e=>{let{code:t}=e;return t}).includes(e))||!(null!=t&&t.length)});s(e)},[]),l.createElement(t.Card,{className:"employeeCard filter inboxLinks"},l.createElement("div",{className:"complaint-links-container"},l.createElement("div",{className:"header"},l.createElement("span",{className:"logo"},l.createElement(t.PropertyHouse,null))," ",l.createElement("span",{className:"text"},a("PET_SERVICE"))),l.createElement("div",{className:"body"},c.map((e,t)=>{let{link:n,text:r,hyperlink:o=!1,roles:u=[]}=e;return l.createElement("span",{className:"link",key:t},o?l.createElement("a",{href:n},r):l.createElement(i.Link,{to:n},a(r)))}))))},Re={date:t.DatePicker,mobileNumber:t.MobileNumber},Ie=e=>{var n;let{onSearch:i,type:a,onClose:c,searchFields:s,searchParams:d,isInboxPage:p,clearSearch:v}=e;const{t:f}=r.useTranslation(),{handleSubmit:m,reset:h,watch:E,control:_,formState:g,setValue:y}=o.useForm({defaultValues:p?d:u({locality:null,city:null},d)}),S=E(),b=innerWidth<=640;function T(){const e=s.reduce((e,t)=>u({},e,{[null==t?void 0:t.name]:""}),{});if(h(e),p){const e=u({},d);e.delete=[],s.forEach(t=>{e.delete.push(null==t?void 0:t.name)}),i(u({},e))}else v()}const A=e=>l.createElement(t.LinkLabel,{style:u({display:"inline"},e?{margin:0}:{}),onClick:T},f("ES_COMMON_CLEAR_SEARCH"));return l.createElement("form",{onSubmit:m(e=>{e.mobileNumber||delete e.mobileNumber,e.delete=[],s.forEach(t=>{e[t.name]||e.delete.push(t.name)}),i(e),"mobile"===a&&c()})},l.createElement(l.Fragment,null,l.createElement("div",{className:"search-container",style:{width:"auto",marginLeft:p?"24px":"revert"}},l.createElement("div",{className:"search-complaint-container"},("mobile"===a||b)&&l.createElement("div",{className:"complaint-header"},l.createElement("h2",null,f("ES_COMMON_SEARCH_BY")),l.createElement("span",{onClick:c},l.createElement(t.CloseSvg,null))),l.createElement("div",{className:"complaint-input-container for-pt "+(p?"":"for-search"),style:{width:"100%",display:"grid"}},null==s||null===(n=s.filter(e=>!0))||void 0===n?void 0:n.map((e,n)=>{var r,i,a;return l.createElement("div",{key:e.name,className:"input-fields"},l.createElement("span",{className:"mobile-input"},l.createElement(t.Label,null,f(e.label)+" "+(e.isMendatory?"*":"")),l.createElement(o.Controller,e.type?{render:t=>l.createElement(null==Re?void 0:Re[e.type],{formValue:S,setValue:y,onChange:t.onChange,value:t.value}),name:e.name,control:_,defaultValue:""}:{render:e=>l.createElement(t.TextInput,{onChange:e.onChange,value:e.value}),name:e.name,control:_,defaultValue:""})),null!=g&&null!==(r=g.dirtyFields)&&void 0!==r&&r[e.name]?l.createElement("span",{style:{fontWeight:"700",color:"rgba(212, 53, 28)",paddingLeft:"8px",marginTop:"-20px",fontSize:"12px"},className:"inbox-search-form-error"},null==g||null===(i=g.errors)||void 0===i||null===(a=i[e.name])||void 0===a?void 0:a.message):null)}),p&&l.createElement("div",{style:{gridColumn:"2/3",textAlign:"right",paddingTop:"10px"},className:"input-fields"},l.createElement("div",null,A())),"desktop"===a&&!b&&l.createElement("div",{style:{maxWidth:"unset",marginLeft:"unset"},className:"search-submit-wrapper"},l.createElement(t.SubmitBar,{className:"submit-bar-search",label:f("ES_COMMON_SEARCH"),disabled:!!Object.keys(g.errors).length||(()=>{var e;let t=!0;return Object.keys(S).forEach(e=>{!["locality","city"].includes(e)&&S[e]&&(t=!1)}),null==s||!s.find(e=>"locality"===e.name)||null!=S&&null!==(e=S.locality)&&void 0!==e&&e.code||(t=!0),t})(),submit:!0}),!p&&l.createElement("div",null,A()))))),("mobile"===a||b)&&l.createElement(t.ActionBar,{className:"clear-search-container"},l.createElement("button",{className:"clear-search",style:{flex:1}},A(b)),l.createElement(t.SubmitBar,{disabled:!!Object.keys(g.errors).length,label:f("ES_COMMON_SEARCH"),style:{flex:1},submit:!0}))))},we=["tableConfig","filterComponent"],xe=e=>{let{tableConfig:i,filterComponent:o}=e,a=c(e,we);const{data:u,useNewInboxAPI:s}=a,{t:d}=r.useTranslation(),[p,v]=n.useState(()=>{var e;return null===(e=Digit.ComponentRegistryService)||void 0===e?void 0:e.getComponent(o)}),[f,m]=n.useState(()=>{var e;return null===(e=Digit.ComponentRegistryService)||void 0===e?void 0:e.getComponent(a.EmptyResultInboxComp)}),[h,E]=n.useState(!1),_=l.useMemo(()=>a.isSearch?i.searchColumns(a):i.inboxColumns(a)||[],[]);let g;return a.isLoading?g=l.createElement(t.Loader,null):h?g=null:!u||0===(null==u?void 0:u.length)||s&&null!=u&&u[0].dataEmpty?g=f&&l.createElement(f,{data:u})||(0===(null==u?void 0:u.length)||s&&null!=u&&u[0].dataEmpty?l.createElement(t.Card,{style:{marginTop:20}},d("CS_MYAPPLICATIONS_NO_APPLICATION").split("\\n").map((e,t)=>l.createElement("p",{key:t,style:{textAlign:"center"}},e))):l.createElement(t.Loader,null)):(null==u?void 0:u.length)>0&&(g=l.createElement(Ne,{t:d,data:u,columns:_,getCellProps:e=>({style:{minWidth:e.column.Header===d("ES_INBOX_APPLICATION_NO")?"240px":"",padding:"20px 18px",fontSize:"16px"}}),onPageSizeChange:a.onPageSizeChange,currentPage:a.currentPage,onNextPage:a.onNextPage,onPrevPage:a.onPrevPage,pageSizeLimit:a.pageSizeLimit,onSort:a.onSort,disableSort:a.disableSort,sortParams:a.sortParams,totalRecords:a.totalRecords})),l.createElement("div",{className:"inbox-container"},!a.isSearch&&l.createElement("div",{className:"filters-container"},l.createElement(Pe,{parentRoute:a.parentRoute,businessService:a.moduleCode}),l.createElement("div",null,l.createElement(p,{defaultSearchParams:a.defaultSearchParams,onFilterChange:a.onFilterChange,searchParams:a.searchParams,type:"desktop",useNewInboxAPI:s,statusMap:s?null==u?void 0:u[0].statusMap:null,moduleCode:a.moduleCode}))),l.createElement("div",{style:{flex:1}},l.createElement(Ie,{defaultSearchParams:a.defaultSearchParams,onSearch:e=>{a.onSearch(e),E(!1)},type:"desktop",searchFields:a.searchFields,isInboxPage:!(null!=a&&a.isSearch),searchParams:a.searchParams,clearSearch:()=>E(!0)}),l.createElement("div",{className:"result",style:{marginLeft:null!=a&&a.isSearch?"":"24px",flex:1}},g)))},Oe=e=>{const{t:i}=r.useTranslation(),[o,a]=n.useState(()=>{var t,n;return null!==(t=e.sortParams)&&void 0!==t&&null!==(n=t[0])&&void 0!==n&&n.desc?{code:"DESC",name:i("ES_INBOX_DATE_LATEST_FIRST")}:{code:"ASC",name:i("ES_INBOX_DATE_LATEST_LAST")}});function u(){}return l.createElement(l.Fragment,null,l.createElement("div",{className:"filter"},l.createElement("div",{className:"filter-card"},l.createElement("div",{className:"heading"},l.createElement("div",{className:"filter-label"},i("SORT_BY"),":"),l.createElement("div",{className:"clearAll",onClick:u},i("ES_COMMON_CLEAR_ALL")),"desktop"===e.type&&l.createElement("span",{className:"clear-search",onClick:u},i("ES_COMMON_CLEAR_ALL")),"mobile"===e.type&&l.createElement("span",{onClick:e.onClose},l.createElement(t.CloseSvg,null))),l.createElement("div",null,l.createElement(t.RadioButtons,{onSelect:function(t){e.onSort([{id:"createdTime",desc:"DESC"===t.code}]),e.onClose()},selectedOption:o,optionsKey:"name",options:[{code:"DESC",name:i("ES_INBOX_DATE_LATEST_FIRST")},{code:"ASC",name:i("ES_INBOX_DATE_LATEST_LAST")}]})))))},Le=e=>{let{t:r,data:i,onFilterChange:o,onSearch:a,onSort:u,serviceRequestIdKey:c,isFstpOperator:s,isLoading:d,isSearch:p,searchParams:v,searchFields:f,sortParams:m,linkPrefix:h,filterComponent:E}=e;const[_,g]=n.useState(p?"SEARCH":""),[y,S]=n.useState(!!p),[b,T]=n.useState(m),[A]=n.useState(()=>{var e;return null===(e=Digit.ComponentRegistryService)||void 0===e?void 0:e.getComponent(E)});n.useEffect(()=>{_&&S(!0)},[_]);const C=()=>{S(!1),g(""),T(m)};if(d)return l.createElement(t.Loader,null);let D;return i&&0!==(null==i?void 0:i.length)?i&&(null==i?void 0:i.length)>0&&(D=l.createElement(t.DetailsCard,{data:i,serviceRequestIdKey:c,linkPrefix:h||"/upyog-ui/employee/ptr/"})):D=l.createElement(t.Card,{style:{marginTop:20}},r("CS_MYAPPLICATIONS_NO_APPLICATION").split("\\n").map((e,t)=>l.createElement("p",{key:t,style:{textAlign:"center"}},e))),l.createElement(l.Fragment,null,l.createElement("div",{className:"searchBox"},a&&l.createElement(t.SearchAction,{text:"SEARCH",handleActionClick:()=>{g("SEARCH"),S(!0)}}),!p&&o&&l.createElement(t.FilterAction,{text:"FILTER",handleActionClick:()=>{g("FILTER"),S(!0)}}),l.createElement(t.FilterAction,{text:"SORT",handleActionClick:()=>{g("SORT"),S(!0)}})),D,y&&l.createElement(t.PopUp,null,"FILTER"===_&&l.createElement("div",{className:"popup-module"},l.createElement(A,{onFilterChange:e=>{o(e),S(!1)},Close:C,type:"mobile",searchParams:v})),"SORT"===_&&l.createElement("div",{className:"popup-module"},l.createElement(Oe,{type:"mobile",sortParams:m,onClose:C,onSort:u})),"SEARCH"===_&&l.createElement("div",{className:"popup-module"},l.createElement(Ie,{type:"mobile",onClose:C,onSearch:a,isFstpOperator:s,searchParams:v,searchFields:f}))))},Me=e=>{let{linkPrefix:o,classNameForMobileView:a=""}=e;const{t:u}=r.useTranslation(),c=[{text:u("ES_TITLE_NEW_REGISTRATION"),link:"/upyog-ui/employee/ptr/new-application"},{text:u("ES_TITILE_SEARCH_APPLICATION"),link:o+"/search"}],[s,d]=n.useState([]),{roles:p}=Digit.UserService.getUser().info;return n.useEffect(()=>{let e=[];c.forEach(t=>{var n;t.accessTo?(n=t.accessTo,p.filter(e=>n.includes(e.code)).length&&e.push(t)):e.push(t)}),d(e)},[]),l.createElement(t.Card,{className:"employeeCard filter"},l.createElement("div",{className:"complaint-links-container "+a},l.createElement("div",{className:"header"},l.createElement("span",{className:"logo"},l.createElement(t.ShippingTruck,null))," ",l.createElement("span",{className:"text"},u("ES_TITLE_PET_REGISTRATION"))),l.createElement("div",{className:"body"},s.map((e,t)=>{let{link:n,text:r}=e;return l.createElement("span",{className:"link",key:t},l.createElement(i.Link,{to:n},r))}))))},ke=e=>{let{data:t,isLoading:n,isSearch:i,searchFields:o,onFilterChange:a,onSearch:u,onSort:c,parentRoute:s,searchParams:d,sortParams:p,linkPrefix:v,tableConfig:f,filterComponent:m}=e;const{t:h}=r.useTranslation();return l.createElement("div",{style:{padding:0}},l.createElement("div",{className:"inbox-container"},l.createElement("div",{className:"filters-container"},!i&&l.createElement(Me,{classNameForMobileView:"linksWrapperForMobileInbox",linkPrefix:s,isMobile:!0}),l.createElement(Le,{t:h,data:null==t?void 0:t.map(e=>{const t={};return(i?f.searchColumns():f.inboxColumns()).forEach(n=>{n.mobileCell&&(t[n.Header]=n.mobileCell(e))}),t}),onFilterChange:a,isLoading:n,isSearch:i,onSearch:u,onSort:c,searchParams:d,searchFields:o,linkPrefix:v,sortParams:p,serviceRequestIdKey:null==f?void 0:f.serviceRequestIdKey,filterComponent:m}))))},Fe=["isFetching","isLoading","searchResponseKey","data","searchFields"],Be=e=>{var i,o,a,s,d;let{useNewInboxAPI:p,parentRoute:v,moduleCode:f="PTR",initialStates:m={},filterComponent:h,isInbox:E,rawWfHandler:_,rawSearchHandler:g,combineResponse:y,wfConfig:S,searchConfig:b,middlewaresWf:T,middlewareSearch:A,EmptyResultInboxComp:C}=e;const D=Digit.ULBService.getCurrentTenantId(),{t:N}=r.useTranslation(),[P,R]=n.useState(()=>E?{}:{enabled:!1}),[I,w]=n.useState(()=>{var e;return null===(e=Digit.ComponentRegistryService)||void 0===e?void 0:e.getComponent("PTRInboxTableConfig")}),[x,O]=n.useState(m.pageOffset||0),[L,M]=n.useState(m.pageSize||10),[k,F]=n.useState(m.sortParams||[{id:"createdTime",desc:!0}]),[B,U]=n.useState(m.searchParams||{});let j=window.Digit.Utils.browser.isMobile(),H=j?{limit:100,offset:0,sortBy:null==k||null===(i=k[0])||void 0===i?void 0:i.id,sortOrder:null!=k&&null!==(o=k[0])&&void 0!==o&&o.desc?"DESC":"ASC"}:{limit:L,offset:x,sortBy:null==k||null===(a=k[0])||void 0===a?void 0:a.id,sortOrder:null!=k&&null!==(s=k[0])&&void 0!==s&&s.desc?"DESC":"ASC"};const W=p?Digit.Hooks.useNewInboxGeneral({tenantId:D,ModuleCode:f,filters:u({},B,H,{sortParams:k})}):Digit.Hooks.useInboxGeneral({tenantId:D,businessService:f,isInbox:E,filters:u({},B,H,{sortParams:k}),rawWfHandler:_,rawSearchHandler:g,combineResponse:y,wfConfig:S,searchConfig:u({},P,b),middlewaresWf:T,middlewareSearch:A}),{isLoading:z,data:V,searchFields:K}=W,Y=c(W,Fe);n.useEffect(()=>{O(0)},[B]);const q=e=>{let t=e.delete,n=u({},B,e);t&&t.forEach(e=>delete n[e]),delete e.delete,U(u({},n)),R({enabled:!0})},$=n.useCallback(e=>{0!==e.length&&F(e)},[]);var G,Z;if(null!==(null==Y||null===(d=Y.data)||void 0===d?void 0:d.length))return j?l.createElement(ke,{data:V,isLoading:z,isSearch:!E,searchFields:K,onFilterChange:q,onSearch:q,onSort:$,parentRoute:v,searchParams:B,sortParams:k,linkPrefix:v+"/application-details/",tableConfig:null!=Y&&Y.tableConfig?null===(G=res)||void 0===G?void 0:G.tableConfig:I(N).PTR,filterComponent:h,EmptyResultInboxComp:C,useNewInboxAPI:p}):l.createElement("div",null,E&&l.createElement(t.Header,null,N("ES_COMMON_INBOX")),l.createElement(xe,{moduleCode:f,data:V,tableConfig:I(N).PTR,isLoading:z,defaultSearchParams:m.searchParams,isSearch:!E,onFilterChange:q,searchFields:K,onSearch:q,onSort:$,onNextPage:()=>{O(e=>e+L)},onPrevPage:()=>{O(e=>e-L)},currentPage:Math.floor(x/L),pageSizeLimit:L,disableSort:!1,onPageSizeChange:e=>{M(Number(e.target.value))},parentRoute:v,searchParams:B,sortParams:k,totalRecords:Number(null==V||null===(Z=V[0])||void 0===Z?void 0:Z.totalCount),filterComponent:h,EmptyResultInboxComp:C,useNewInboxAPI:p}))},Ue=e=>{var r,a;let{isLoading:u,t:c,onSubmit:s,data:d,count:p,setShowToast:v}=e;const f=window.Digit.Utils.browser.isMobile(),{register:m,control:h,handleSubmit:E,setValue:_,getValues:g,reset:y,formState:S}=o.useForm({defaultValues:{offset:0,limit:!f&&10,sortBy:"commencementDate",sortOrder:"DESC"}});n.useEffect(()=>{m("offset",0),m("limit",10),m("sortBy","commencementDate"),m("sortOrder","DESC")},[m]);const b=[{code:"NEWAPPLICATION",i18nKey:"NEWAPPLICATION"},{code:"RENEWAPPLICATION",i18nKey:"RENEWAPPLICATION"}],T=Digit.ULBService.getStateId(),{data:A}=Digit.Hooks.ptr.usePTRPetMDMS(T,"PetService","PetType");let C=[];A&&A.map(e=>{C.push({i18nKey:"PTR_PET_"+e.code,code:""+e.code,value:""+e.name})});const D=e=>l.createElement("span",{className:"cell-text"},e),N=n.useMemo(()=>[{Header:c("PTR_APPLICATION_NUMBER"),accessor:"applicationNumber",disableSortBy:!0,Cell:e=>{let{row:t}=e;return l.createElement("div",null,l.createElement("span",{className:"link"},l.createElement(i.Link,{to:"/upyog-ui/employee/ptr/petservice/applicationsearch/application-details/"+t.original.applicationNumber},t.original.applicationNumber)))}},{Header:c("PTR_APPLICANT_NAME"),Cell:e=>{var t,n;return D(""+(null==e||null===(t=e.row)||void 0===t||null===(n=t.original)||void 0===n?void 0:n.applicantName))},disableSortBy:!0},{Header:c("PTR_PET_TYPE"),Cell:e=>{var t,n;let{row:l}=e;return D(""+(null===(t=l.original)||void 0===t||null===(n=t.petDetails)||void 0===n?void 0:n.petType))},disableSortBy:!0},{Header:c("PTR_BREED_TYPE"),Cell:e=>{var t,n;let{row:l}=e;return D(""+(null===(t=l.original)||void 0===t||null===(n=t.petDetails)||void 0===n?void 0:n.breedType))},disableSortBy:!0},{Header:c("PTR_MOBILE_NUMBER"),Cell:e=>{var t;let{row:n}=e;return D(""+(null==n||null===(t=n.original)||void 0===t?void 0:t.mobileNumber))},disableSortBy:!0},{Header:c("PTR_APPLICATION_STATUS"),Cell:e=>{var t;let{row:n}=e;return D(""+(null==n||null===(t=n.original)||void 0===t?void 0:t.status))},disableSortBy:!0}],[]),P=n.useCallback(e=>{0!==e.length&&(_("sortBy",e.id),_("sortOrder",e.desc?"DESC":"ASC"))},[]);function R(){_("offset",g("offset")-g("limit")),E(s)()}return l.createElement(l.Fragment,null,l.createElement("div",null,l.createElement(t.Header,null,c("PTR_SEARCH_PET_APPLICATIONS")),l.createElement(t.Card,{className:"card-search-heading"},l.createElement("span",{style:{color:"#505A5F"}},c("Provide at least one parameter to search for an application"))),l.createElement(t.SearchForm,{onSubmit:s,handleSubmit:E},l.createElement(t.SearchField,null,l.createElement("label",null,c("PTR_APPLICATION_NO_LABEL")),l.createElement(t.TextInput,{name:"applicationNumber",inputRef:m({})})),l.createElement(t.SearchField,null,l.createElement("label",null,c("PTR_SEARCH_PET_TYPE")),l.createElement(o.Controller,{control:h,name:"petType",render:e=>l.createElement(t.Dropdown,{selected:e.value,select:e.onChange,onBlur:e.onBlur,option:C,optionKey:"i18nKey",t:c,disable:!1})})),l.createElement(t.SearchField,null,l.createElement("label",null,c("PTR_APPLICATION_TYPE")),l.createElement(o.Controller,{control:h,name:"applicationType",render:e=>l.createElement(t.Dropdown,{selected:e.value,select:e.onChange,onBlur:e.onBlur,option:b,optionKey:"i18nKey",t:c,disable:!1})})),l.createElement(t.SearchField,null,l.createElement("label",null,c("PTR_OWNER_MOBILE_NO")),l.createElement(t.MobileNumber,{name:"mobileNumber",inputRef:m({minLength:{value:10,message:c("CORE_COMMON_MOBILE_ERROR")},maxLength:{value:10,message:c("CORE_COMMON_MOBILE_ERROR")},pattern:{value:/[6789][0-9]{9}/,message:c("CORE_COMMON_MOBILE_ERROR")}}),type:"number",componentInFront:l.createElement("div",{className:"employee-card-input employee-card-input--front"},"+91")}),l.createElement(t.CardLabelError,null,null==S||null===(r=S.errors)||void 0===r||null===(a=r.mobileNumber)||void 0===a?void 0:a.message)),l.createElement(t.SearchField,null,l.createElement("label",null,c("PTR_FROM_DATE")),l.createElement(o.Controller,{render:e=>l.createElement(t.DatePicker,{date:e.value,disabled:!1,onChange:e.onChange}),name:"fromDate",control:h})),l.createElement(t.SearchField,null,l.createElement("label",null,c("PTR_TO_DATE")),l.createElement(o.Controller,{render:e=>l.createElement(t.DatePicker,{date:e.value,disabled:!1,onChange:e.onChange}),name:"toDate",control:h})),l.createElement(t.SearchField,{className:"submit"},l.createElement(t.SubmitBar,{label:c("ES_COMMON_SEARCH"),submit:!0}),l.createElement("p",{style:{marginTop:"10px"},onClick:()=>{y({applicationNumber:"",fromDate:"",toDate:"",petType:"",mobileNumber:"",status:"",breedType:"",offset:0,limit:10,sortBy:"commencementDate",sortOrder:"DESC"}),v(null),R()}},c("ES_COMMON_CLEAR_ALL")))),!u&&null!=d&&d.display?l.createElement(t.Card,{style:{marginTop:20}},c(d.display).split("\\n").map((e,t)=>l.createElement("p",{key:t,style:{textAlign:"center"}},e))):u||""===d?""!==d||u&&l.createElement(t.Loader,null):l.createElement(t.Table,{t:c,data:d,totalRecords:p,columns:N,getCellProps:e=>({style:{minWidth:e.column.Header===c("PTR_INBOX_APPLICATION_NO")?"240px":"",padding:"20px 18px",fontSize:"16px"}}),onPageSizeChange:function(e){_("limit",Number(e.target.value)),E(s)()},currentPage:g("offset")/g("limit"),onNextPage:function(){_("offset",g("offset")+g("limit")),E(s)()},onPrevPage:R,pageSizeLimit:g("limit"),onSort:P,disableSort:!1,sortParams:[{id:g("sortBy"),desc:"DESC"===g("sortOrder")}]})))},je=e=>{i.useParams();const{t:o}=r.useTranslation(),a=Digit.ULBService.getCurrentTenantId(),[c,s]=n.useState({}),[d,p]=n.useState(null),v={enabled:!!(c&&Object.keys(c).length>0)},{isLoading:f,isSuccess:m,data:{PetRegistrationApplications:h,Count:E}={}}=Digit.Hooks.ptr.usePTRSearch({tenantId:a,filters:c},v);return l.createElement(l.Fragment,null,l.createElement(Ue,{t:o,isLoading:f,tenantId:a,setShowToast:p,onSubmit:function(e){var t=new Date(null==e?void 0:e.fromDate);null==t||t.setSeconds((null==t?void 0:t.getSeconds())-19800);var n=new Date(null==e?void 0:e.toDate);null==n||n.setSeconds((null==n?void 0:n.getSeconds())+86399-19800);const l=u({},e,e.toDate?{toDate:null==n?void 0:n.getTime()}:{},e.fromDate?{fromDate:null==t?void 0:t.getTime()}:{});let r=Object.keys(l).filter(e=>l[e]).reduce((e,t)=>u({},e,{[t]:"object"==typeof l[t]?l[t].code:l[t]}),{});!(Object.entries(r).length>0)||r.applicationNumber||r.creationReason||r.fromDate||r.mobileNumber||r.applicationNumber||r.status||r.toDate?!(Object.entries(r).length>0&&(r.creationReason||r.status))||r.applicationNumber||r.fromDate||r.mobileNumber||r.applicationNumber||r.toDate?Object.entries(r).length>0&&r.fromDate&&!r.toDate||!r.fromDate&&r.toDate?p({warning:!0,label:"ERR_PROVIDE_BOTH_FORM_TO_DATE"}):s(r):p({warning:!0,label:"ERR_PROVIDE_MORE_PARAM_WITH_TYPE_STATUS"}):p({warning:!0,label:"ERR_PTR_FILL_VALID_FIELDS"})},data:m&&!f?h.length>0?h:{display:"ES_COMMON_NO_DATA"}:"",count:E}),d&&l.createElement(t.Toast,{error:d.error,warning:d.warning,label:o(d.label),isDleteBtn:!0,onClose:()=>{p(null)}}))},He=e=>{var n,o,a,c;let{path:s,userType:d}=e;const{t:p}=r.useTranslation(),v=i.useLocation();sessionStorage.removeItem("revalidateddone");const f=window.Digit.Utils.browser.isMobile(),m={searchParams:{uuid:{code:"ASSIGNED_TO_ALL",name:"ES_INBOX_ASSIGNED_TO_ALL"},services:["ptr"],applicationStatus:[],locality:[]}},h=e=>{let{location:n}=e;const{t:o}=r.useTranslation(),a=i.useLocation().search,u=(new URLSearchParams(a).get("from"),Digit.Hooks.useQueryParams(),[{path:"/upyog-ui/employee",content:o("ES_COMMON_HOME"),show:!0},{path:"/upyog-ui/employee/ptr/petservice/inbox",content:o("ES_TITLE_INBOX"),show:!!n.pathname.includes("ptr/petservice/inbox")},{path:"/upyog-ui/employee/ptr/petservice/my-applications",content:o("ES_COMMON_APPLICATION_SEARCH"),show:!(!n.pathname.includes("/ptr/petservice/my-applications")&&!n.pathname.includes("/ptr/applicationsearch/application-details/"))}]);return l.createElement(t.BreadCrumb,{style:f?{display:"flex"}:{},spanStyle:{maxWidth:"min-content"},crumbs:u})},E=null===(n=Digit)||void 0===n||null===(o=n.ComponentRegistryService)||void 0===o?void 0:o.getComponent("PTRNewApplication"),_=null===(a=Digit)||void 0===a||null===(c=a.ComponentRegistryService)||void 0===c?void 0:c.getComponent("ApplicationDetails"),g=window.location.href.includes("ptr/response"),y=window.location.href.includes("new-application")||window.location.href.includes("modify-application")||window.location.href.includes("ptr/application-details");return l.createElement(i.Switch,null,l.createElement(l.Fragment,null,l.createElement("div",{className:"ground-container"},g?null:l.createElement("div",{style:y?{marginLeft:"12px"}:{marginLeft:"-4px"}},l.createElement(h,{location:v})),l.createElement(t.PrivateRoute,{exact:!0,path:s+"/",component:()=>l.createElement(yi,{matchPath:s,userType:d})}),l.createElement(t.PrivateRoute,{path:s+"/petservice/inbox",component:()=>l.createElement(Be,{useNewInboxAPI:!0,parentRoute:s,businessService:"ptr",filterComponent:"PTR_INBOX_FILTER",initialStates:m,isInbox:!0})}),l.createElement(t.PrivateRoute,{path:s+"/petservice/new-application",component:E}),l.createElement(t.PrivateRoute,{path:s+"/petservice/revised-application",component:E}),l.createElement(t.PrivateRoute,{path:s+"/petservice/application-details/:id",component:()=>l.createElement(_,{parentRoute:s})}),l.createElement(t.PrivateRoute,{path:s+"/petservice/applicationsearch/application-details/:id",component:()=>l.createElement(_,{parentRoute:s})}),l.createElement(t.PrivateRoute,{path:s+"/petservice/search",component:e=>l.createElement(Search,u({},e,{t:p,parentRoute:s}))}),l.createElement(t.PrivateRoute,{path:s+"/searchold",component:()=>l.createElement(Be,{parentRoute:s,businessService:"ptr",middlewareSearch:searchMW,initialStates:m,isInbox:!1,EmptyResultInboxComp:"PTEmptyResultInbox"})}),l.createElement(t.PrivateRoute,{path:s+"/petservice/my-applications",component:e=>l.createElement(je,u({},e,{parentRoute:s}))}))))},We=e=>{var n;let{status:i,searchParams:o,onAssignmentChange:a,statusMap:c}=e;return r.useTranslation(),l.createElement(t.CheckBox,{styles:{height:"unset"},onChange:e=>a(u({},e,{state:i.state}),i),checked:null==o?void 0:o.applicationStatus.some(e=>e.uuid===i.uuid),label:i.name+" ("+((null==c||null===(n=c.find(e=>e.statusid===i.uuid))||void 0===n?void 0:n.count)||"-")+")"})},ze=e=>{var i,o,a,c,s;let{onAssignmentChange:d,searchParams:p,businessServices:v,statusMap:f}=e;const{t:m}=r.useTranslation(),[h,E]=n.useState(!1),{data:_,isLoading:g}=Digit.Hooks.useApplicationStatusGeneral({businessServices:v},{}),{userRoleStates:y}=_||{},S=(e,t)=>t(map[e.stateBusinessService])+" - "+t("ES_PTR_COMMON_STATUS_"+(e.state||"CREATED"));return g?l.createElement(t.Loader,null):null!=y&&y.filter(e=>!e.isTerminateState).length?l.createElement("div",{className:"status-container"},l.createElement("div",{className:"filter-label",style:{fontWeight:"normal"}},m("ES_INBOX_STATUS")),null==y||null===(i=y.filter(e=>!e.isTerminateState))||void 0===i||null===(o=i.slice(0,4))||void 0===o?void 0:o.map((e,t)=>l.createElement(We,{businessServices:v,key:t,onAssignmentChange:d,status:u({name:S(e,m),code:e.applicationStatus},e),searchParams:p,statusMap:f})),(null==y||null===(a=y.filter(e=>!e.isTerminateState))||void 0===a?void 0:a.slice(4).length)>0?l.createElement(l.Fragment,null,h&&(null==y||null===(c=y.filter(e=>!e.isTerminateState))||void 0===c||null===(s=c.slice(4))||void 0===s?void 0:s.map((e,t)=>l.createElement(We,{businessServices:v,key:e.uuid,onAssignmentChange:d,status:u({name:S(e,m),code:e.applicationStatus},e),searchParams:p,statusMap:f}))),l.createElement("div",{className:"filter-button",onClick:()=>E(!h)}," ",m(h?"ES_COMMON_LESS":"ES_COMMON_MORE")," ")):null):null},Ve=["searchParams","onFilterChange","defaultSearchParams","statusMap","moduleCode"],Ke=e=>{var i;let{searchParams:o,onFilterChange:s,defaultSearchParams:d,statusMap:p,moduleCode:v}=e,f=c(e,Ve);const{t:m}=r.useTranslation(),h=a.useQueryClient(),[E,_]=n.useState(()=>u({},o,{services:[]})),g=[{label:"PTR_NEW_REGISTRATION",value:"ptr"}],y=e=>{let t=e.delete,n=u({},E,e);t&&t.forEach(e=>delete n[e]),delete e.delete,_(u({},n))},S=()=>{_(u({},d,{services:[]})),s(u({},d))},b=Digit.ULBService.getCurrentTenantId();return l.createElement(l.Fragment,null,l.createElement("div",{className:"filter"},l.createElement("div",{className:"filter-card"},l.createElement("div",{className:"heading",style:{alignItems:"center"}},l.createElement("div",{className:"filter-label",style:{display:"flex",alignItems:"center"}},l.createElement("span",null,l.createElement("svg",{width:"17",height:"17",viewBox:"0 0 22 22",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l.createElement("path",{d:"M0.66666 2.48016C3.35999 5.9335 8.33333 12.3335 8.33333 12.3335V20.3335C8.33333 21.0668 8.93333 21.6668 9.66666 21.6668H12.3333C13.0667 21.6668 13.6667 21.0668 13.6667 20.3335V12.3335C13.6667 12.3335 18.6267 5.9335 21.32 2.48016C22 1.60016 21.3733 0.333496 20.2667 0.333496H1.71999C0.613327 0.333496 -0.01334 1.60016 0.66666 2.48016Z",fill:"#505A5F"}))),l.createElement("span",{style:{marginLeft:"8px",fontWeight:"normal"}},m("ES_COMMON_FILTER_BY"),":")),l.createElement("div",{className:"clearAll",onClick:S},m("ES_COMMON_CLEAR_ALL")),"desktop"===f.type&&l.createElement("span",{className:"clear-search",onClick:S,style:{border:"1px solid #e0e0e0",padding:"6px"}},l.createElement("svg",{width:"17",height:"17",viewBox:"0 0 16 22",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l.createElement("path",{d:"M8 5V8L12 4L8 0V3C3.58 3 0 6.58 0 11C0 12.57 0.46 14.03 1.24 15.26L2.7 13.8C2.25 12.97 2 12.01 2 11C2 7.69 4.69 5 8 5ZM14.76 6.74L13.3 8.2C13.74 9.04 14 9.99 14 11C14 14.31 11.31 17 8 17V14L4 18L8 22V19C12.42 19 16 15.42 16 11C16 9.43 15.54 7.97 14.76 6.74Z",fill:"#505A5F"}))),"mobile"===f.type&&l.createElement("span",{onClick:f.onClose},l.createElement(t.CloseSvg,null))),l.createElement("div",null,l.createElement("div",null,l.createElement("div",{className:"filter-label",style:{fontWeight:"normal"}},m("ES_INBOX_LOCALITY"),":"),l.createElement(t.Localities,{selectLocality:e=>{y({locality:[...(null==E?void 0:E.locality)||[],e]})},tenantId:b,boundaryType:"revenue"}),l.createElement("div",{className:"tag-container"},null==E||null===(i=E.locality)||void 0===i?void 0:i.map((e,n)=>l.createElement(t.RemoveableTag,{key:n,text:m(e.i18nkey),onClick:()=>{y({locality:null==E?void 0:E.locality.filter(t=>t.code!==e.code)})}})))),l.createElement("div",null,l.createElement("div",{className:"filter-label",style:{fontWeight:"normal"}},m("ES_PTR_APP_TYPE")),g.map((e,n)=>{var r;const i=null==E||null===(r=E.services)||void 0===r?void 0:r.includes(e.value);return l.createElement(t.CheckBox,{key:n+"service",label:m(e.label),value:e.label,checked:i,onChange:t=>((e,t)=>{var n;y(e.target.checked?{services:Array.isArray(E.services)?[...E.services,t]:[t]}:{services:E.services.filter(e=>e!==t),applicationStatus:null===(n=E.applicationStatus)||void 0===n?void 0:n.filter(e=>e.stateBusinessService!==t)})})(t,e.value)})})),l.createElement("div",null,l.createElement(ze,{searchParams:E,businessServices:E.services,statusMap:p||h.getQueryData("INBOX_STATUS_MAP_"+v),moduleCode:v,onAssignmentChange:(e,t)=>{if(e.target.checked)y({applicationStatus:[...null==E?void 0:E.applicationStatus,t]});else{let e=null==E?void 0:E.applicationStatus.filter(e=>e.state!==t.state);y({applicationStatus:e})}}})),l.createElement("div",null,l.createElement(t.SubmitBar,{onSubmit:()=>{s(0===E.services.length?u({},E,{services:g.map(e=>e.value)}):E)},label:m("ES_COMMON_APPLY")}))))))},Ye=e=>l.createElement("span",{className:"cell-text"},e),qe=e=>l.createElement("span",{className:"sla-cell"},e);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=e=>l.createElement("h1",{className:"heading-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"})),Xe=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(Ze,null)),Je=e=>{var r,i;let{t:o,action:a,tenantId:c,closeModal:s,submitAction:d,applicationData:p,businessService:v,moduleCode:f}=e;const{data:m,isLoading:h}=Digit.Hooks.useEmployeeSearch(c,{roles:null==a||null===(r=a.assigneeRoles)||void 0===r||null===(i=r.map)||void 0===i?void 0:i.call(r,e=>({code:e})),isActive:!0},{enabled:!(null!=a&&a.isTerminateState)}),{isLoading:E,data:_}=Digit.Hooks.pt.useMDMS(c,v,"FINANCIAL_YEARLS",{},{details:{tenantId:Digit.ULBService.getStateId(),moduleDetails:[{moduleName:"egf-master",masterDetails:[{name:"FinancialYear",filter:"[?(@.module == 'PT')]"}]}]}}),[g,y]=n.useState({}),[S,b]=n.useState({}),[T,A]=n.useState([]),[C,D]=n.useState(null),[N,P]=n.useState(null),[R,I]=n.useState(null),[w,x]=n.useState(null),[O,L]=n.useState([]),[M,k]=n.useState(null),[F,B]=n.useState(!1);function U(e){P(e.target.files[0])}return n.useEffect(()=>{var e;_&&_["egf-master"]&&L(null===(e=_["egf-master"])||void 0===e?void 0:e.FinancialYear)},[_]),n.useEffect(()=>{var e;A(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{x(null);const e=function(){if(N){const e=function(){if(N.size>=5242880)x(o("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=$e(function(){return Promise.resolve(Digit.UploadServices.Filestorage("PT",N,Digit.ULBService.getStateId())).then(function(e){var t,n,l,r;(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===(r=l.files[0])||void 0===r?void 0:r.fileStoreId):x(o("CS_FILE_UPLOAD_ERROR"))})},function(){x(o("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[N]),n.useEffect(()=>{a&&y(null!=a&&a.showFinancialYearsModal?(e=>{let{t:n,action:r,financialYears:i,selectedFinancialYear:o,setSelectedFinancialYear:a}=e;return{label:{heading:"WF_"+r.action+"_APPLICATION",submit:"WF_PT.CREATE_"+r.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:o})}]}]}})({t:o,action:a,financialYears:O,selectedFinancialYear:M,setSelectedFinancialYear:k}):(e=>{var n;let{t:r,action:i,approvers:o,selectedApprover:a,setSelectedApprover:u,selectFile:c,uploadedFile:s,setUploadedFile:d,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:r(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:o,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:u,selected:a})},{label:r("ES_PT_ACTION_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:r("ES_PT_ATTACH_FILE")+(i.docUploadRequired?" *":""),populators:l.createElement(t.UploadFile,{id:"workflow-doc",onUpload:c,onDelete:()=>{d(null)},showHint:!0,hintText:r("PT_ATTACH_RESTRICTIONS_SIZE"),message:s?"1 "+r("ES_PT_ACTION_FILEUPLOADED"):r("ES_PT_ACTION_NO_FILEUPLOADED")})}]}]}})({t:o,action:a,approvers:T,selectedApprover:C,setSelectedApprover:D,selectFile:U,uploadedFile:R,setUploadedFile:I,businessService:v}))},[a,T,O,M,R]),a&&g.form?l.createElement(t.Modal,{headerBarMain:l.createElement(Ge,{label:o(g.label.heading)}),headerBarEnd:l.createElement(Xe,{onClick:s}),actionCancelLabel:o(g.label.cancel),actionCancelOnSubmit:s,actionSaveLabel:o(g.label.submit),actionSaveOnSubmit:()=>{},isDisabled:a.showFinancialYearsModal?!M:h||(null==a?void 0:a.docUploadRequired)&&!R,formId:"modal-action"},E?l.createElement(t.Loader,null):l.createElement(t.FormComposer,{config:g.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){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"};p.creationReason="STATUS",d({customFunctionToExecute:null==a?void 0:a.customFunctionToExecute,Property:u({},p,{workflow:t})})}else if(null!=a&&a.showFinancialYearsModal)d({customFunctionToExecute:null==a?void 0:a.customFunctionToExecute,Assessment:{financialYear:null==M?void 0:M.name,propertyId:null==p?void 0:p.propertyId,tenantId:c,source:null==p?void 0:p.source,channel:null==p?void 0:p.channel,assessmentDate:Date.now()}});else{let t={action:null==a?void 0:a.action,comment:null==e?void 0:e.comments,businessService:v,moduleName:f};t.assignes=null!=a&&a.isTerminateState||!C?[]:[C],R&&(t.documents=[{documentType:(null==a?void 0:a.action)+" DOC",fileName:null==N?void 0:N.name,fileStoreId:R}]),d({Property:u({},p,{workflow:t})})}},defaultValues:S,formId:"modal-action"})):l.createElement(t.Loader,null)},Qe=e=>l.createElement("h1",{className:"heading-m"},e.label),et=()=>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"})),tt=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(et,null)),nt=e=>{var r,i;let{t:o,action:a,tenantId:c,closeModal:s,submitAction:d,applicationData:p,businessService:v}=e;const{data:f}=Digit.Hooks.useEmployeeSearch(c,{roles:null==a||null===(r=a.assigneeRoles)||void 0===r||null===(i=r.map)||void 0===i?void 0:i.call(r,e=>({code:e})),isActive:!0},{enabled:!(null!=a&&a.isTerminateState)}),{isLoading:m,data:h}=Digit.Hooks.pt.useMDMS(c,v,"FINANCIAL_YEARLS",{},{details:{tenantId:Digit.ULBService.getStateId(),moduleDetails:[{moduleName:"egf-master",masterDetails:[{name:"FinancialYear",filter:"[?(@.module == 'TL')]"}]}]}}),[E,_]=n.useState({}),[g,y]=n.useState({}),[S,b]=n.useState([]),[T,A]=n.useState({}),[C,D]=n.useState(null),[N,P]=n.useState(null),[R,I]=n.useState(null),[w,x]=n.useState([]),[O,L]=n.useState(null);function M(e){D(e.target.files[0])}return n.useEffect(()=>{var e;h&&h["egf-master"]&&x(null===(e=h["egf-master"])||void 0===e?void 0:e.FinancialYear)},[h]),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{I(null);const e=function(){if(C){const e=function(){if(C.size>=5242880)I(o("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,r;(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===(r=l.files[0])||void 0===r?void 0:r.fileStoreId):I(o("CS_FILE_UPLOAD_ERROR"))})},function(){I(o("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[C]),n.useEffect(()=>{a&&_((e=>{let{t:n,action:r,approvers:i,selectedApprover:o,setSelectedApprover:a,selectFile:u,uploadedFile:c,setUploadedFile:s,businessService:d}=e,p=!0;return"SENDBACKTOCITIZEN"!=(null==r?void 0:r.action)&&"APPROVE"!=(null==r?void 0:r.action)||(p=!1),r.isTerminateState&&(p=!1),{label:{heading:"WF_"+(null==r?void 0:r.action)+"_APPLICATION",submit:"WF_"+(null==d?void 0:d.toUpperCase())+"_"+(null==r?void 0:r.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:o}):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:c?"1 "+n("ES_PT_ACTION_FILEUPLOADED"):n("CS_ACTION_NO_FILEUPLOADED")})}]}]}})({t:o,action:a,approvers:S,selectedApprover:T,setSelectedApprover:A,selectFile:M,uploadedFile:N,setUploadedFile:P,businessService:v}))},[a,S,w,O,N]),a&&E.form?l.createElement(t.Modal,{headerBarMain:l.createElement(Qe,{label:o(E.label.heading)}),headerBarEnd:l.createElement(tt,{onClick:s}),actionCancelLabel:o(E.label.cancel),actionCancelOnSubmit:s,actionSaveLabel:o(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){p=u({},p,{action:null==a?void 0:a.action,comment:null==e?void 0:e.comments,assignee:null!=T&&T.uuid?[null==T?void 0:T.uuid]:null,wfDocuments:N?[{documentType:(null==a?void 0:a.action)+" DOC",fileName:null==C?void 0:C.name,fileStoreId:N}]:null}),d({Licenses:[p]})},defaultValues:g,formId:"modal-action"})):l.createElement(t.Loader,null)},lt=e=>l.createElement("h1",{style:{marginLeft:"22px"},className:"heading-m BPAheading-m"},e.label),rt=()=>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"})),it=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(rt,null)),ot=e=>{var r,i;let{t:o,action:a,tenantId:c,closeModal:s,submitAction:d,applicationData:p,businessService:v}=e;const{data:f,isLoading:m}=Digit.Hooks.useEmployeeSearch(c,{roles:null==a||null===(r=a.assigneeRoles)||void 0===r||null===(i=r.map)||void 0===i?void 0:i.call(r,e=>({code:e})),isActive:!0},{enabled:!(null!=a&&a.isTerminateState)}),[h,E]=n.useState({}),[_,g]=n.useState({}),[y,S]=n.useState([]),[b,T]=n.useState({}),[A,C]=n.useState(null),[D,N]=n.useState(null),[P,R]=n.useState(null),I=!!Digit.Utils.browser.isMobile();function w(e){C(e.target.files[0])}return n.useEffect(()=>{var e;S(null==f||null===(e=f.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[f]),n.useEffect(()=>{!function(){try{R(null);const e=function(){if(A){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(A.size>=5242880)R(o("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=A&&A.type&&!e.test(null==A?void 0:A.type))R(o("NOT_SUPPORTED_FILE_TYPE"));else{const e=$e(function(){return Promise.resolve(Digit.UploadServices.Filestorage("OBPS",A,Digit.ULBService.getStateId()||(null==c?void 0:c.split(".")[0]))).then(function(e){var t,n,l,r;(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===(r=l.files[0])||void 0===r?void 0:r.fileStoreId):R(o("CS_FILE_UPLOAD_ERROR"))})},function(){R(o("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[A]),n.useEffect(()=>{a&&E((e=>{let{t:n,action:r,approvers:i,selectedApprover:o,setSelectedApprover:a,selectFile:u,uploadedFile:c,setUploadedFile:s,businessService:d,error:p}=e,v=!0;return"SENDBACKTOCITIZEN"==(null==r?void 0:r.action)&&(v=!1),r.isTerminateState&&(v=!1),{label:{heading:"WF_"+(null==r?void 0:r.action)+"_APPLICATION",submit:"WF_"+(null==d?void 0:d.toUpperCase())+"_"+(null==r?void 0:r.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:o}):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:c?"1 "+n("ES_PT_ACTION_FILEUPLOADED"):n("CS_ACTION_NO_FILEUPLOADED"),accept:"image/*, .pdf, .png, .jpeg, .jpg",iserror:p})}]}]}})({t:o,action:a,approvers:y,selectedApprover:b,setSelectedApprover:T,selectFile:w,uploadedFile:D,setUploadedFile:N,businessService:v,error:P}))},[a,y,D,P]),a&&h.form?l.createElement(t.Modal,{headerBarMain:l.createElement(lt,{label:o(h.label.heading)}),headerBarEnd:l.createElement(it,{onClick:s}),actionCancelLabel:o(h.label.cancel),actionCancelOnSubmit:s,actionSaveLabel:o(h.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action",isOBPSFlow:!0,popupStyles:I?{width:"720px"}:{},style:I?{height:"45px",width:"44%"}:{height:"45px",width:"107px",paddingLeft:"0px",paddingRight:"0px"},popupModuleMianStyles:I?{paddingLeft:"5px"}:{}},m?l.createElement(t.Loader,null):l.createElement(t.FormComposer,{config:h.form,cardStyle:{marginLeft:"0px",marginRight:"0px",marginTop:"-25px"},className:"BPAemployeeCard",noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){p=u({},p,{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==A?void 0:A.name,fileStoreId:D}]:null}),d({Licenses:[p]},!1,{isStakeholder:!0,bpa:!1})},defaultValues:_,formId:"modal-action"})):l.createElement(t.Loader,null)},at=e=>l.createElement("h1",{style:{marginLeft:"22px"},className:"heading-m BPAheading-m"},e.label),ut=()=>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"})),ct=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(ut,null)),st=e=>{var r,i,o,c,s,d,p,v,f,m,h,E;let{t:_,action:g,tenantId:y,closeModal:S,submitAction:b,applicationDetails:T,applicationData:A,businessService:C,workflowDetails:D}=e;Digit.Hooks.obps.useObpsAPI(null!==(r=A)&&void 0!==r&&null!==(i=r.landInfo)&&void 0!==i&&null!==(o=i.address)&&void 0!==o&&o.city?null===(c=A)||void 0===c||null===(s=c.landInfo)||void 0===s||null===(d=s.address)||void 0===d?void 0:d.city:y,!1);const{data:N,isLoading:P}=Digit.Hooks.useEmployeeSearch(y,{roles:null==D||null===(p=D.data)||void 0===p||null===(v=p.initialActionState)||void 0===v||null===(f=v.nextActions)||void 0===f||null===(m=f.filter(e=>(null==e?void 0:e.action)==(null==g?void 0:g.action)))||void 0===m||null===(h=m[0])||void 0===h||null===(E=h.assigneeRoles)||void 0===E?void 0:E.map(e=>({code:e})),isActive:!0},{enabled:!(null!=g&&g.isTerminateState)}),[R,I]=(a.useQueryClient(),n.useState({})),[w,x]=n.useState({}),[O,L]=n.useState([]),[M,k]=n.useState({}),[F,B]=n.useState(null),[U,j]=n.useState(null),[H,W]=n.useState(null),[z,V]=n.useState(null),K=!!Digit.Utils.browser.isMobile();function Y(e){B(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{W(null);const e=function(){if(F){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(F.size>=5242880)W(_("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=F&&F.type&&!e.test(null==F?void 0:F.type))W(_("NOT_SUPPORTED_FILE_TYPE"));else{const e=$e(function(){return Promise.resolve(Digit.UploadServices.Filestorage("OBPS",F,Digit.ULBService.getStateId()||(null==y?void 0:y.split(".")[0]))).then(function(e){var t,n,l,r;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?j(null==e||null===(l=e.data)||void 0===l||null===(r=l.files[0])||void 0===r?void 0:r.fileStoreId):W(_("CS_FILE_UPLOAD_ERROR"))})},function(){W(_("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 q=e=>{let t=[];return e&&e.map((e,n)=>{t.push({documentType:(e.documentType+"_"+e.documentType.split("_")[1]).replaceAll("_","."),fileStoreId:e.fileStoreId,fileStore:e.fileStoreId,fileName:"",dropDownValues:{value:(e.documentType+"_"+e.documentType.split("_")[1]).replaceAll("_",".")}})}),t},$=e=>{let t=[];var n;for(n=0;n<(null==e?void 0:e.questionLength);n++){var l;t.push({remarks:e["Remarks_"+n],question:null==e?void 0:e.questionList[n].question,value:null==e||null===(l=e["question_"+n])||void 0===l?void 0:l.code})}return t},G=e=>{var t,n;let l=[],r=[];var i,o;return(null==e||null===(t=e.additionalDetails)||void 0===t||null===(n=t.fieldinspection_pending)||void 0===n?void 0:n.length)>0&&(r=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===(o=l)||void 0===o?void 0:o.length)>0&&l.map((e,t)=>{r.push({docs:q(e.Documents),date:e.InspectionDate,questions:$(e),time:null==e?void 0:e.InspectionTime})}),r=r.filter(e=>e.docs&&e.docs.length>0)):sessionStorage.removeItem("INSPECTION_DATA"),[...r]},Z=e=>{let t=JSON.parse(sessionStorage.getItem("BPA_DOCUMENTS")),n=[];return t.map(e=>{var t,l,r,i,o,a;(null==e||null===(t=e.uploadedDocuments)||void 0===t||null===(l=t[0])||void 0===l||null===(r=l.values)||void 0===r?void 0:r.length)>0&&(n=[...n,...null==e||null===(i=e.uploadedDocuments)||void 0===i||null===(o=i[0])||void 0===o?void 0:o.values]),(null==e||null===(a=e.newUploadedDocs)||void 0===a?void 0:a.length)>0&&(n=[...n,...null==e?void 0:e.newUploadedDocs])}),n},X=()=>{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(()=>{g&&I((e=>{var n;let{t:r,action:i,approvers:o,selectedApprover:a,setSelectedApprover:u,selectFile:c,uploadedFile:s,setUploadedFile:d,assigneeLabel:p,businessService:v,error:f}=e,m=!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)||(m=!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||m?null:r(p||"WF_ROLE_"+(null===(n=i.assigneeRoles)||void 0===n?void 0:n[0])),type:"dropdown",populators:i.isTerminateState||m?null:l.createElement(t.Dropdown,{option:o,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:u,selected:a})},{label:r("WF_COMMON_COMMENTS"),type:"textarea",isMandatory:!0,populators:{name:"comments"}},{label:""+r("WF_APPROVAL_UPLOAD_HEAD"),populators:l.createElement(t.UploadFile,{id:"workflow-doc",onUpload:c,onDelete:()=>{d(null)},message:s?"1 "+r("ES_PT_ACTION_FILEUPLOADED"):r("CS_ACTION_NO_FILEUPLOADED"),accept:"image/*, .pdf, .png, .jpeg, .jpg",iserror:f})}]}]}})({t:_,action:g,approvers:O,selectedApprover:M,setSelectedApprover:k,selectFile:Y,uploadedFile:U,setUploadedFile:j,businessService:C,assigneeLabel:"WF_ASSIGNEE_NAME_LABEL",error:H}))},[g,O,z,U,H]),g&&R.form?l.createElement(t.Modal,{headerBarMain:l.createElement(at,{label:_(R.label.heading)}),headerBarEnd:l.createElement(ct,{onClick:S}),actionCancelLabel:_(R.label.cancel),actionCancelOnSubmit:S,actionSaveLabel:_(R.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action",isOBPSFlow:!0,popupStyles:K?{width:"720px"}:{},style:K?{minHeight:"45px",height:"auto",width:"44%"}:{minHeight:"45px",height:"auto",width:"107px",paddingLeft:"0px",paddingRight:"0px"},popupModuleMianStyles:K?{paddingLeft:"5px"}:{}},P?l.createElement(t.Loader,null):l.createElement(t.FormComposer,{config:R.form,cardStyle:{marginLeft:"0px",marginRight:"0px",marginTop:"-25px"},className:"BPAemployeeCard",noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){try{var t,n,l,r,i,o;A=u({},A,{documents:Z(),additionalDetails:u({},null===(t=A)||void 0===t?void 0:t.additionalDetails,{fieldinspection_pending:G(A),pendingapproval:X()}),workflow:{action:null==g?void 0:g.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!=M&&M.uuid?[null==M?void 0:M.uuid]:null,assignes:null!=M&&M.uuid?[null==M?void 0:M.uuid]:null,varificationDocuments:U?[{documentType:(null==g?void 0:g.action)+" DOC",fileName:null==F?void 0:F.name,fileStoreId:U}]:null},action:null==g?void 0:g.action,comment:null==e?void 0:e.comments,assignee:null!=M&&M.uuid?[null==M?void 0:M.uuid]:null,wfDocuments:U?[{documentType:(null==g?void 0:g.action)+" DOC",fileName:null==F?void 0:F.name,fileStoreId:U}]:null});const a=null==T||null===(r=T.nocData)||void 0===r?void 0:r.map(e=>{const t=Digit.SessionStorage.get(null==e?void 0:e.nocType)||[];return{Noc:u({},e,{documents:[...null!=e&&e.documents?null==e?void 0:e.documents:[],...t||[]]})}});let c={sourceRefId:null==a||null===(i=a[0])||void 0===i||null===(o=i.Noc)||void 0===o?void 0:o.sourceRefId};return Promise.resolve(Digit.NOCSearch.all(y,c)).then(function(e){var t;let n=!0,l=!0;null==e||null===(t=e.Noc)||void 0===t||t.map(e=>{var t,r,i,o,a;"APPROVED"!==(null==e||null===(t=e.applicationStatus)||void 0===t?void 0:t.toUpperCase())&&"AUTO_APPROVED"!==(null==e||null===(r=e.applicationStatus)||void 0===r?void 0:r.toUpperCase())&&"REJECTED"!==(null==e||null===(i=e.applicationStatus)||void 0===i?void 0:i.toUpperCase())&&"AUTO_REJECTED"!==(null==e||null===(o=e.applicationStatus)||void 0===o?void 0:o.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 r=[];a&&a.map(e=>{var t,i,o,a,u,c,s,d,p,v,f,m;("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===(o=e.Noc)||void 0===o||null===(a=o.applicationStatus)||void 0===a?void 0:a.toUpperCase())&&"REJECTED"!=(null==e||null===(u=e.Noc)||void 0===u||null===(c=u.applicationStatus)||void 0===c?void 0:c.toUpperCase())&&"AUTO_REJECTED"!=(null==e||null===(s=e.Noc)||void 0===s||null===(d=s.applicationStatus)||void 0===d?void 0:d.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===(f=e.Noc)||void 0===f?void 0:f.nocType)&&n||"FIRE_NOC"===(null==e||null===(m=e.Noc)||void 0===m?void 0:m.nocType)&&l)&&r.push(e)}),b({BPA:A},(null==r?void 0:r.length)>0&&r,{isStakeholder:!1,bpa:!0})})}catch(e){return Promise.reject(e)}},defaultValues:w,formId:"modal-action"})):l.createElement(t.Loader,null)},dt=e=>l.createElement("h1",{style:{marginLeft:"22px"},className:"heading-m BPAheading-m"},e.label),pt=()=>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"})),vt=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(pt,null)),ft=e=>{var r,o;let{t:c,action:s,tenantId:d,closeModal:p,submitAction:v,applicationData:f,businessService:m}=e;const{data:h,isLoading:E}=Digit.Hooks.useEmployeeSearch(d,{roles:null==s||null===(r=s.assigneeRoles)||void 0===r||null===(o=r.map)||void 0===o?void 0:o.call(r,e=>({code:e})),isActive:!0},{enabled:!(null!=s&&s.isTerminateState)}),[_,g]=(a.useQueryClient(),n.useState({})),[y,S]=n.useState({}),[b,T]=n.useState([]),[A,C]=n.useState({}),[D,N]=n.useState(null),[P,R]=n.useState(null),[I,w]=n.useState(null),x=!!Digit.Utils.browser.isMobile();function O(e){N(e.target.files[0])}return i.useHistory(),n.useEffect(()=>{var e;T(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(()=>{!function(){try{w(null);const e=function(){if(D){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(D.size>=5242880)w(c("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=D&&D.type&&!e.test(null==D?void 0:D.type))w(c("NOT_SUPPORTED_FILE_TYPE"));else{const e=$e(function(){return Promise.resolve(Digit.UploadServices.Filestorage("NOC",D,Digit.ULBService.getStateId()||(null==d?void 0:d.split(".")[0]))).then(function(e){var t,n,l,r;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?R(null==e||null===(l=e.data)||void 0===l||null===(r=l.files[0])||void 0===r?void 0:r.fileStoreId):w(c("CS_FILE_UPLOAD_ERROR"))})},function(){w(c("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[D]),n.useEffect(()=>{s&&g((e=>{var n;let{t:r,action:i,approvers:o,selectedApprover:a,setSelectedApprover:u,selectFile:c,uploadedFile:s,setUploadedFile:d,assigneeLabel:p,businessService:v,error:f}=e,m=!1;"REVOCATE"!=(null==i?void 0:i.action)&&"REJECT"!=(null==i?void 0:i.action)||(m=!0);let h=!1;return"APPROVE"!=(null==i?void 0:i.action)&&"REJECT"!=(null==i?void 0:i.action)&&"AUTO_APPROVE"!=i.action&&"AUTO_REJECT"!=i.action||(h=!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||h?null:r(p||"WF_ROLE_"+(null===(n=i.assigneeRoles)||void 0===n?void 0:n[0])),type:"dropdown",populators:i.isTerminateState||h?null:l.createElement(t.Dropdown,{option:o,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:u,selected:a})},{label:r("WF_COMMON_COMMENTS"),type:"textarea",isMandatory:m,populators:{name:"comments"}},{label:""+r("WF_APPROVAL_UPLOAD_HEAD"),populators:l.createElement(t.UploadFile,{id:"workflow-doc",onUpload:c,onDelete:()=>{d(null)},showHint:!0,message:s?"1 "+r("ES_PT_ACTION_FILEUPLOADED"):r("CS_ACTION_NO_FILEUPLOADED"),accept:"image/*, .pdf, .png, .jpeg, .jpg",iserror:f})}]}]}})({t:c,action:s,approvers:b,selectedApprover:A,setSelectedApprover:C,selectFile:O,uploadedFile:P,setUploadedFile:R,businessService:m,assigneeLabel:"WF_ASSIGNEE_NAME_LABEL",error:I}))},[s,b,P,I]),s&&_.form?l.createElement(t.Modal,{headerBarMain:l.createElement(dt,{label:c(_.label.heading)}),headerBarEnd:l.createElement(vt,{onClick:p}),actionCancelLabel:c(_.label.cancel),actionCancelOnSubmit:p,actionSaveLabel:c(_.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action",isOBPSFlow:!0,popupStyles:x?{width:"720px"}:{},style:x?{height:"45px",width:"44%"}:{height:"45px",width:"107px",paddingLeft:"0px",paddingRight:"0px"},popupModuleMianStyles:x?{paddingLeft:"5px"}:{}},E?l.createElement(t.Loader,null):l.createElement(t.FormComposer,{config:_.form,cardStyle:{marginLeft:"0px",marginRight:"0px",marginTop:"-25px"},className:"BPAemployeeCard",noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){var t,n,l;let r=JSON.parse(sessionStorage.getItem("NewNOCDocs")),i=(null===(t=f)||void 0===t||null===(n=t.documents)||void 0===n?void 0:n.length)>0?[...null===(l=f)||void 0===l?void 0:l.documents]:[];r.map((e,t)=>{i.push(e)}),f=u({},f,{workflow:{action:null==s?void 0:s.action,comment:null!=e&&e.comments?null==e?void 0:e.comments:null,assignee:null!=A&&A.uuid?[null==A?void 0:A.uuid]:null,documents:P?[{documentType:(null==s?void 0:s.action)+" DOC",fileName:null==D?void 0:D.name,fileStoreId:P}]:null},documents:i}),v({Noc:f},!1,{isNoc:!0})},defaultValues:y,formId:"modal-action"})):l.createElement(t.Loader,null)};var mt=function(e,t){return e===t||e!=e&&t!=t},ht=function(e,t){for(var n=e.length;n--;)if(mt(e[n][0],t))return n;return-1},Et=Array.prototype.splice;function _t(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])}}_t.prototype.clear=function(){this.__data__=[],this.size=0},_t.prototype.delete=function(e){var t=this.__data__,n=ht(t,e);return!(n<0||(n==t.length-1?t.pop():Et.call(t,n,1),--this.size,0))},_t.prototype.get=function(e){var t=this.__data__,n=ht(t,e);return n<0?void 0:t[n][1]},_t.prototype.has=function(e){return ht(this.__data__,e)>-1},_t.prototype.set=function(e,t){var n=this.__data__,l=ht(n,e);return l<0?(++this.size,n.push([e,t])):n[l][1]=t,this};var gt=_t,yt="object"==typeof p&&p&&p.Object===Object&&p,St="object"==typeof self&&self&&self.Object===Object&&self,bt=yt||St||Function("return this")(),Tt=bt.Symbol,At=Object.prototype,Ct=At.hasOwnProperty,Dt=At.toString,Nt=Tt?Tt.toStringTag:void 0,Pt=Object.prototype.toString,Rt=Tt?Tt.toStringTag:void 0,It=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Rt&&Rt in Object(e)?function(e){var t=Ct.call(e,Nt),n=e[Nt];try{e[Nt]=void 0;var l=!0}catch(e){}var r=Dt.call(e);return l&&(t?e[Nt]=n:delete e[Nt]),r}(e):function(e){return Pt.call(e)}(e)},wt=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},xt=function(e){if(!wt(e))return!1;var t=It(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t},Ot=bt["__core-js_shared__"],Lt=function(){var e=/[^.]+$/.exec(Ot&&Ot.keys&&Ot.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),Mt=Function.prototype.toString,kt=function(e){if(null!=e){try{return Mt.call(e)}catch(e){}try{return e+""}catch(e){}}return""},Ft=/^\[object .+?Constructor\]$/,Bt=RegExp("^"+Function.prototype.toString.call(Object.prototype.hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ut=function(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return function(e){return!(!wt(e)||(t=e,Lt&&Lt in t))&&(xt(e)?Bt:Ft).test(kt(e));var t}(n)?n:void 0},jt=Ut(bt,"Map"),Ht=Ut(Object,"create"),Wt=Object.prototype.hasOwnProperty,zt=Object.prototype.hasOwnProperty;function Vt(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])}}Vt.prototype.clear=function(){this.__data__=Ht?Ht(null):{},this.size=0},Vt.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Vt.prototype.get=function(e){var t=this.__data__;if(Ht){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return Wt.call(t,e)?t[e]:void 0},Vt.prototype.has=function(e){var t=this.__data__;return Ht?void 0!==t[e]:zt.call(t,e)},Vt.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Ht&&void 0===t?"__lodash_hash_undefined__":t,this};var Kt=Vt,Yt=function(e,t){var n,l,r=e.__data__;return("string"==(l=typeof(n=t))||"number"==l||"symbol"==l||"boolean"==l?"__proto__"!==n:null===n)?r["string"==typeof t?"string":"hash"]:r.map};function qt(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])}}qt.prototype.clear=function(){this.size=0,this.__data__={hash:new Kt,map:new(jt||gt),string:new Kt}},qt.prototype.delete=function(e){var t=Yt(this,e).delete(e);return this.size-=t?1:0,t},qt.prototype.get=function(e){return Yt(this,e).get(e)},qt.prototype.has=function(e){return Yt(this,e).has(e)},qt.prototype.set=function(e,t){var n=Yt(this,e),l=n.size;return n.set(e,t),this.size+=n.size==l?0:1,this};var $t=qt;function Gt(e){var t=this.__data__=new gt(e);this.size=t.size}Gt.prototype.clear=function(){this.__data__=new gt,this.size=0},Gt.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},Gt.prototype.get=function(e){return this.__data__.get(e)},Gt.prototype.has=function(e){return this.__data__.has(e)},Gt.prototype.set=function(e,t){var n=this.__data__;if(n instanceof gt){var l=n.__data__;if(!jt||l.length<199)return l.push([e,t]),this.size=++n.size,this;n=this.__data__=new $t(l)}return n.set(e,t),this.size=n.size,this};var Zt=Gt,Xt=function(){try{var e=Ut(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),Jt=function(e,t,n){"__proto__"==t&&Xt?Xt(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n},Qt=Object.prototype.hasOwnProperty,en=function(e,t,n){var l=e[t];Qt.call(e,t)&&mt(l,n)&&(void 0!==n||t in e)||Jt(e,t,n)},tn=function(e,t,n,l){var r=!n;n||(n={});for(var i=-1,o=t.length;++i<o;){var a=t[i],u=l?l(n[a],e[a],a,n,e):void 0;void 0===u&&(u=e[a]),r?Jt(n,a,u):en(n,a,u)}return n},nn=function(e){return null!=e&&"object"==typeof e},ln=function(e){return nn(e)&&"[object Arguments]"==It(e)},rn=Object.prototype,on=rn.hasOwnProperty,an=rn.propertyIsEnumerable,un=ln(function(){return arguments}())?ln:function(e){return nn(e)&&on.call(e,"callee")&&!an.call(e,"callee")},cn=Array.isArray,sn=function(){return!1},dn=v(function(e,t){var n=t&&!t.nodeType&&t,l=n&&e&&!e.nodeType&&e,r=l&&l.exports===n?bt.Buffer:void 0;e.exports=(r?r.isBuffer:void 0)||sn}),pn=/^(?:0|[1-9]\d*)$/,vn=function(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&pn.test(e))&&e>-1&&e%1==0&&e<t},fn=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991},mn={};mn["[object Float32Array]"]=mn["[object Float64Array]"]=mn["[object Int8Array]"]=mn["[object Int16Array]"]=mn["[object Int32Array]"]=mn["[object Uint8Array]"]=mn["[object Uint8ClampedArray]"]=mn["[object Uint16Array]"]=mn["[object Uint32Array]"]=!0,mn["[object Arguments]"]=mn["[object Array]"]=mn["[object ArrayBuffer]"]=mn["[object Boolean]"]=mn["[object DataView]"]=mn["[object Date]"]=mn["[object Error]"]=mn["[object Function]"]=mn["[object Map]"]=mn["[object Number]"]=mn["[object Object]"]=mn["[object RegExp]"]=mn["[object Set]"]=mn["[object String]"]=mn["[object WeakMap]"]=!1;var hn=function(e){return function(t){return e(t)}},En=v(function(e,t){var n=t&&!t.nodeType&&t,l=n&&e&&!e.nodeType&&e,r=l&&l.exports===n&&yt.process,i=function(){try{return l&&l.require&&l.require("util").types||r&&r.binding&&r.binding("util")}catch(e){}}();e.exports=i}),_n=En&&En.isTypedArray,gn=_n?hn(_n):function(e){return nn(e)&&fn(e.length)&&!!mn[It(e)]},yn=Object.prototype.hasOwnProperty,Sn=function(e,t){var n=cn(e),l=!n&&un(e),r=!n&&!l&&dn(e),i=!n&&!l&&!r&&gn(e),o=n||l||r||i,a=o?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 c in e)!t&&!yn.call(e,c)||o&&("length"==c||r&&("offset"==c||"parent"==c)||i&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||vn(c,u))||a.push(c);return a},bn=Object.prototype,Tn=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||bn)},An=function(e,t){return function(n){return e(t(n))}},Cn=An(Object.keys,Object),Dn=Object.prototype.hasOwnProperty,Nn=function(e){return null!=e&&fn(e.length)&&!xt(e)},Pn=function(e){return Nn(e)?Sn(e):function(e){if(!Tn(e))return Cn(e);var t=[];for(var n in Object(e))Dn.call(e,n)&&"constructor"!=n&&t.push(n);return t}(e)},Rn=Object.prototype.hasOwnProperty,In=function(e){return Nn(e)?Sn(e,!0):function(e){if(!wt(e))return function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}(e);var t=Tn(e),n=[];for(var l in e)("constructor"!=l||!t&&Rn.call(e,l))&&n.push(l);return n}(e)},wn=v(function(e,t){var n=t&&!t.nodeType&&t,l=n&&e&&!e.nodeType&&e,r=l&&l.exports===n?bt.Buffer:void 0,i=r?r.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}}),xn=function(){return[]},On=Object.prototype.propertyIsEnumerable,Ln=Object.getOwnPropertySymbols,Mn=Ln?function(e){return null==e?[]:(e=Object(e),function(t,n){for(var l=-1,r=null==t?0:t.length,i=0,o=[];++l<r;){var a=t[l];On.call(e,a)&&(o[i++]=a)}return o}(Ln(e)))}:xn,kn=function(e,t){for(var n=-1,l=t.length,r=e.length;++n<l;)e[r+n]=t[n];return e},Fn=An(Object.getPrototypeOf,Object),Bn=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)kn(t,Mn(e)),e=Fn(e);return t}:xn,Un=function(e,t,n){var l=t(e);return cn(e)?l:kn(l,n(e))},jn=function(e){return Un(e,Pn,Mn)},Hn=function(e){return Un(e,In,Bn)},Wn=Ut(bt,"DataView"),zn=Ut(bt,"Promise"),Vn=Ut(bt,"Set"),Kn=Ut(bt,"WeakMap"),Yn=kt(Wn),qn=kt(jt),$n=kt(zn),Gn=kt(Vn),Zn=kt(Kn),Xn=It;(Wn&&"[object DataView]"!=Xn(new Wn(new ArrayBuffer(1)))||jt&&"[object Map]"!=Xn(new jt)||zn&&"[object Promise]"!=Xn(zn.resolve())||Vn&&"[object Set]"!=Xn(new Vn)||Kn&&"[object WeakMap]"!=Xn(new Kn))&&(Xn=function(e){var t=It(e),n="[object Object]"==t?e.constructor:void 0,l=n?kt(n):"";if(l)switch(l){case Yn:return"[object DataView]";case qn:return"[object Map]";case $n:return"[object Promise]";case Gn:return"[object Set]";case Zn:return"[object WeakMap]"}return t});var Jn=Xn,Qn=Object.prototype.hasOwnProperty,el=bt.Uint8Array,tl=function(e){var t=new e.constructor(e.byteLength);return new el(t).set(new el(e)),t},nl=/\w*$/,ll=Tt?Tt.prototype:void 0,rl=ll?ll.valueOf:void 0,il=Object.create,ol=function(){function e(){}return function(t){if(!wt(t))return{};if(il)return il(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}(),al=En&&En.isMap,ul=al?hn(al):function(e){return nn(e)&&"[object Map]"==Jn(e)},cl=En&&En.isSet,sl=cl?hn(cl):function(e){return nn(e)&&"[object Set]"==Jn(e)},dl={};dl["[object Arguments]"]=dl["[object Array]"]=dl["[object ArrayBuffer]"]=dl["[object DataView]"]=dl["[object Boolean]"]=dl["[object Date]"]=dl["[object Float32Array]"]=dl["[object Float64Array]"]=dl["[object Int8Array]"]=dl["[object Int16Array]"]=dl["[object Int32Array]"]=dl["[object Map]"]=dl["[object Number]"]=dl["[object Object]"]=dl["[object RegExp]"]=dl["[object Set]"]=dl["[object String]"]=dl["[object Symbol]"]=dl["[object Uint8Array]"]=dl["[object Uint8ClampedArray]"]=dl["[object Uint16Array]"]=dl["[object Uint32Array]"]=!0,dl["[object Error]"]=dl["[object Function]"]=dl["[object WeakMap]"]=!1;var pl=function e(t,n,l,r,i,o){var a,u=1&n,c=2&n,s=4&n;if(l&&(a=i?l(t,r,i,o):l(t)),void 0!==a)return a;if(!wt(t))return t;var d=cn(t);if(d){if(a=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&Qn.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=Jn(t),v="[object Function]"==p||"[object GeneratorFunction]"==p;if(dn(t))return wn(t,u);if("[object Object]"==p||"[object Arguments]"==p||v&&!i){if(a=c||v?{}:function(e){return"function"!=typeof e.constructor||Tn(e)?{}:ol(Fn(e))}(t),!u)return c?function(e,t){return tn(e,Bn(e),t)}(t,function(e,t){return e&&tn(t,In(t),e)}(a,t)):function(e,t){return tn(e,Mn(e),t)}(t,function(e,t){return e&&tn(t,Pn(t),e)}(a,t))}else{if(!dl[p])return i?t:{};a=function(e,t,n){var l=e.constructor;switch(t){case"[object ArrayBuffer]":return tl(e);case"[object Boolean]":case"[object Date]":return new l(+e);case"[object DataView]":return function(e,t){var n=t?tl(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?tl(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}(e,n);case"[object Map]":return new l;case"[object Number]":case"[object String]":return new l(e);case"[object RegExp]":return function(e){var t=new e.constructor(e.source,nl.exec(e));return t.lastIndex=e.lastIndex,t}(e);case"[object Set]":return new l;case"[object Symbol]":return rl?Object(rl.call(e)):{}}}(t,p,u)}}o||(o=new Zt);var f=o.get(t);if(f)return f;o.set(t,a),sl(t)?t.forEach(function(r){a.add(e(r,n,l,r,t,o))}):ul(t)&&t.forEach(function(r,i){a.set(i,e(r,n,l,i,t,o))});var m=d?void 0:(s?c?Hn:jn:c?In:Pn)(t);return function(e,t){for(var n=-1,l=null==e?0:e.length;++n<l&&!1!==t(e[n],n););}(m||t,function(r,i){m&&(r=t[i=r]),en(a,i,e(r,n,l,i,t,o))}),a},vl=function(e){return pl(e,5)};const fl=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"})),hl=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(ml,null)),El=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}},_l=e=>{var r,i;let{t:o,action:a,tenantId:c,closeModal:s,submitAction:d,applicationData:p,businessService:v}=e;const{data:f,isLoading:m}=Digit.Hooks.useEmployeeSearch(c,{roles:null==a||null===(r=a.assigneeRoles)||void 0===r||null===(i=r.map)||void 0===i?void 0:i.call(r,e=>({code:e})),isActive:!0},{enabled:!(null!=a&&a.isTerminateState)}),[h,E]=n.useState({}),[_,g]=n.useState({}),[y,S]=n.useState([]),[b,T]=n.useState({}),[A,C]=n.useState(null),[D,N]=n.useState(null),[P,R]=n.useState(null),I=window.Digit.Utils.browser.isMobile(),w=window.location.href.includes("/employee");function x(e){C(e.target.files[0])}return n.useEffect(()=>{var e;S(null==f||null===(e=f.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[f]),n.useEffect(()=>{!function(){try{R(null);const e=function(){if(A){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(A.size>=5242880)R(o("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=A&&A.type&&!e.test(null==A?void 0:A.type))R(o("NOT_SUPPORTED_FILE_TYPE"));else{const e=$e(function(){return Promise.resolve(Digit.UploadServices.Filestorage("WS",A,Digit.ULBService.getCurrentTenantId())).then(function(e){var t,n,l,r;(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===(r=l.files[0])||void 0===r?void 0:r.fileStoreId):R(o("CS_FILE_UPLOAD_ERROR"))})},function(e){console.error("Modal -> err ",e),R(o("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[A]),n.useEffect(()=>{var e,n,r,i;"DisconnectWSConnection"==(null===(e=p)||void 0===e||null===(n=e.processInstance)||void 0===n?void 0:n.businessService)||"DisconnectSWConnection"==(null===(r=p)||void 0===r||null===(i=r.processInstance)||void 0===i?void 0:i.businessService)?a&&E((e=>{var n;let{t:r,action:i,approvers:o,selectedApprover:a,setSelectedApprover:c,selectFile:s,uploadedFile:d,setUploadedFile:p,businessService:v,error:f}=e,m=!0,h=!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)||(h=!0),{label:{heading:"WF_"+(null==i?void 0:i.action)+"_APPLICATION",submit:"WF_"+(null==v?void 0:v.toUpperCase())+"_"+(null==i?void 0:i.action),cancel:"CS_COMMON_CANCEL"},form:[{body:[{label:m?r("WF_ASSIGNEE_NAME_LABEL"):null,placeholder:m?r("WF_ASSIGNEE_NAME_PLACEHOLDER"):null,type:"dropdown",populators:m?l.createElement(t.Dropdown,{option:o,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:c,selected:a}):null},h&&{label:r("ES_FSM_ACTION_SERVICE_DATE"),isMandatory:!!h,type:"custom",populators:h?{name:"date",validation:{required:!0},defaultValue:Digit.Utils.date.getDate(),component:(e,n)=>l.createElement(t.DatePicker,u({onChange:e.onChange,date:e.value},n))}:null},{label:r("WF_COMMON_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:r("WS_APPROVAL_CHECKLIST_BUTTON_UP_FILE"),populators:l.createElement(t.UploadFile,{id:"workflow-doc",accept:".jpg,.pdf,.png,.jpeg",onUpload:s,onDelete:()=>{p(null)},message:d?"1 "+r("ES_PT_ACTION_FILEUPLOADED"):r("CS_ACTION_NO_FILEUPLOADED"),error:f,iserror:f,showHintBelow:!0,hintText:"WS_HINT_TEXT_LABEL"})}]}]}})({t:o,action:a,approvers:y,selectedApprover:b,setSelectedApprover:T,selectFile:x,uploadedFile:D,setUploadedFile:N,businessService:v,error:P})):a&&E((e=>{var n;let{t:r,action:i,approvers:o,selectedApprover:a,setSelectedApprover:u,selectFile:c,uploadedFile:s,setUploadedFile:d,businessService:p,error:v}=e,f=!0;return(null!=i&&null!==(n=i.action)&&void 0!==n&&n.includes("SEND_BACK")||"APPROVE_FOR_CONNECTION"==(null==i?void 0:i.action))&&(f=!1),i.isTerminateState&&(f=!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:f?r("WF_ASSIGNEE_NAME_LABEL"):null,placeholder:f?r("WF_ASSIGNEE_NAME_PLACEHOLDER"):null,type:"dropdown",populators:f?l.createElement(t.Dropdown,{option:o,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:u,selected:a}):null},{label:r("WF_COMMON_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:r("WS_APPROVAL_CHECKLIST_BUTTON_UP_FILE"),populators:l.createElement(t.UploadFile,{id:"workflow-doc",accept:".jpg,.pdf,.png,.jpeg",onUpload:c,onDelete:()=>{d(null)},message:s?"1 "+r("ES_PT_ACTION_FILEUPLOADED"):r("CS_ACTION_NO_FILEUPLOADED"),error:v,iserror:v,showHintBelow:!0,hintText:"WS_HINT_TEXT_LABEL"})}]}]}})({t:o,action:a,approvers:y,selectedApprover:b,setSelectedApprover:T,selectFile:x,uploadedFile:D,setUploadedFile:N,businessService:v,error:P}))},[a,y,D,P]),a&&h.form?l.createElement(t.Modal,{headerBarMain:l.createElement(fl,{label:o(h.label.heading)}),headerBarEnd:l.createElement(hl,{onClick:s}),actionCancelLabel:o(h.label.cancel),actionCancelOnSubmit:s,actionSaveLabel:o(h.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action",style:I&&w?{width:"100%",height:"auto"}:{}},m?l.createElement(t.Loader,null):l.createElement(t.FormComposer,{config:h.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){var t,n,l,r,i,o,s,v,f,m;if(null!==(t=p)&&void 0!==t&&t.isBillAmend){var h,E,_,g,y,S,T,C,N;const t=u({},null===(h=p)||void 0===h||null===(E=h.billAmendmentDetails)||void 0===E?void 0:E.additionalDetails,{comments:null!=e&&e.comments?e.comments:null}),n=u({},null===(_=p)||void 0===_?void 0:_.billAmendmentDetails,{workflow:{businessId:null===(g=p)||void 0===g||null===(y=g.billAmendmentDetails)||void 0===y?void 0:y.amendmentId,action:null==a?void 0:a.action,tenantId:c,businessService:null!==(S=p)&&void 0!==S&&null!==(T=S.applicationType)&&void 0!==T&&T.includes("WATER")?"WS.AMENDMENT":"SW.AMENDMENT",moduleName:null!==(C=p)&&void 0!==C&&null!==(N=C.applicationType)&&void 0!==N&&N.includes("WATER")?"WS":"SW",assignes:null!=b&&b.uuid?[{uuid:null==b?void 0:b.uuid}]:[],comment:(null==e?void 0:e.comments)||"",documents:D?[{documentType:(null==a?void 0:a.action)+" DOC",fileName:null==A?void 0:A.name,fileStoreId:D}]:[]},additionalDetails:t,comment:(null==e?void 0:e.comments)||"",wfDocuments:D?[{documentType:(null==a?void 0:a.action)+" DOC",fileName:null==A?void 0:A.name,fileStoreId:D}]:null,processInstance:{action:null==a?void 0:a.action,assignes:null!=b&&b.uuid?[{uuid:null==b?void 0:b.uuid}]:[],comment:(null==e?void 0:e.comments)||"",documents:D?[{documentType:(null==a?void 0:a.action)+" DOC",fileName:null==A?void 0:A.name,fileStoreId:D}]:[]}});d({AmendmentUpdate:n})}else{if(p=u({},p,{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]:[],assignes:null!=b&&b.uuid?[{uuid:null==b?void 0:b.uuid}]:[],wfDocuments:D?[{documentType:(null==a?void 0:a.action)+" DOC",fileName:null==A?void 0:A.name,fileStoreId:D}]:null,processInstance:u({},null===(n=p)||void 0===n?void 0:n.processInstance,{action:null==a?void 0:a.action,assignes:null!=b&&b.uuid?[{uuid:null==b?void 0:b.uuid}]:[],comment:(null==e?void 0:e.comments)||"",documents:D?[{documentType:(null==a?void 0:a.action)+" DOC",fileName:null==A?void 0:A.name,fileStoreId:D}]:[]})}),null!=e&&e.date&&null!==(l=p)&&void 0!==l&&null!==(r=l.applicationType)&&void 0!==r&&r.includes("DISCONNECT")){const t=vl(null==e?void 0:e.date);p.disconnectionExecutionDate=El(t)}else if(null!=e&&e.date){const t=vl(null==e?void 0:e.date);p.connectionExecutionDate=El(t)}var P;if("DisconnectWSConnection"==(null===(i=p)||void 0===i||null===(o=i.processInstance)||void 0===o?void 0:o.businessService)||"DisconnectSWConnection"==(null===(s=p)||void 0===s||null===(v=s.processInstance)||void 0===v?void 0:v.businessService)||window.location.href.includes("disconnection"))"WATER"==(null===(P=p)||void 0===P?void 0:P.serviceType)?d({WaterConnection:p,disconnectRequest:!0}):d({SewerageConnection:p,disconnectRequest:!0});else if("SEWERAGE_RECONNECTION"==(null===(f=p)||void 0===f?void 0:f.applicationType))d({SewerageConnection:p,disconnectRequest:!1,reconnectRequest:!0});else if("WATER_RECONNECTION"==(null===(m=p)||void 0===m?void 0:m.applicationType))d({WaterConnection:p,disconnectRequest:!1,reconnectRequest:!0});else{var R,I,w,x,O,L,M,k,F,B,U,j,H;const e=sessionStorage.getItem("Digit.ADHOC_ADD_REBATE_DATA"),t=e?JSON.parse(e):"";null!=t&&null!==(R=t.value)&&void 0!==R&&R.adhocPenalty&&(p.additionalDetails.adhocPenalty=parseInt(null==t||null===(I=t.value)||void 0===I?void 0:I.adhocPenalty)||""),null!=t&&null!==(w=t.value)&&void 0!==w&&w.adhocPenaltyComment&&(p.additionalDetails.adhocPenaltyComment=(null==t||null===(x=t.value)||void 0===x?void 0:x.adhocPenaltyComment)||""),null!=t&&null!==(O=t.value)&&void 0!==O&&O.adhocPenaltyReason&&(p.additionalDetails.adhocPenaltyReason=(null==t||null===(L=t.value)||void 0===L?void 0:L.adhocPenaltyReason)||""),null!=t&&null!==(M=t.value)&&void 0!==M&&M.adhocRebate&&(p.additionalDetails.adhocRebate=parseInt(null==t||null===(k=t.value)||void 0===k?void 0:k.adhocRebate)||""),null!=t&&null!==(F=t.value)&&void 0!==F&&F.adhocRebateComment&&(p.additionalDetails.adhocRebateComment=(null==t||null===(B=t.value)||void 0===B?void 0:B.adhocRebateComment)||""),null!=t&&null!==(U=t.value)&&void 0!==U&&U.adhocRebateReason&&(p.additionalDetails.adhocRebateReason=(null==t||null===(j=t.value)||void 0===j?void 0:j.adhocRebateReason)||""),"WATER"==(null===(H=p)||void 0===H?void 0:H.serviceType)?d({WaterConnection:p,disconnectRequest:!1,reconnectRequest:!1}):d({SewerageConnection:p,disconnectRequest:!1,reconnectRequest:!1})}}},defaultValues:_,formId:"modal-action"})):l.createElement(t.Loader,null)},gl=e=>l.createElement("h1",{className:"heading-m"},e.label),yl=()=>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(yl,null)),bl=e=>{var r,i;let{t:o,action:a,tenantId:c,closeModal:s,submitAction:d,applicationData:p,businessService:v,moduleCode:f}=e;const{data:m}=Digit.Hooks.useEmployeeSearch(c,{roles:null==a||null===(r=a.assigneeRoles)||void 0===r||null===(i=r.map)||void 0===i?void 0:i.call(r,e=>({code:e})),isActive:!0},{enabled:!(null!=a&&a.isTerminateState)}),[h,E]=n.useState({}),[_,g]=n.useState({}),[y,S]=n.useState([]),[b,T]=n.useState(null),[A,C]=n.useState(null),[D,N]=n.useState(null),[P,R]=n.useState(null),[I,w]=n.useState(!1);function x(e){C(e.target.files[0])}return n.useEffect(()=>{var e;S(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{R(null);const e=function(){if(A){const e=function(){if(A.size>=5242880)R(o("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,r;(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===(r=l.files[0])||void 0===r?void 0:r.fileStoreId):R(o("CS_FILE_UPLOAD_ERROR"))})},function(){R(o("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[A]),n.useEffect(()=>{a&&E((e=>{let{t:n,action:r,selectFile:i,uploadedFile:o,setUploadedFile:a,businessService:u}=e;return{label:{heading:"WF_"+(null==r?void 0:r.action)+"_APPLICATION",submit:"WF_"+u+"_"+(null==r?void 0:r.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")+(r.docUploadRequired?" *":""),populators:l.createElement(t.UploadFile,{id:"workflow-doc",onUpload:i,onDelete:()=>{a(null)},showHint:!0,hintText:n("PTR_ATTACH_RESTRICTIONS_SIZE"),message:o?"1 "+n("ES_PTR_ACTION_FILEUPLOADED"):n("ES_PTR_ACTION_NO_FILEUPLOADED")})}]}]}})({t:o,action:a,approvers:y,selectedApprover:b,setSelectedApprover:T,selectFile:x,uploadedFile:D,setUploadedFile:N,businessService:v}))},[a,y,D]),a&&h.form?l.createElement(t.Modal,{headerBarMain:l.createElement(gl,{label:o(h.label.heading)}),headerBarEnd:l.createElement(Sl,{onClick:s}),actionCancelLabel:o(h.label.cancel),actionCancelOnSubmit:s,actionSaveLabel:o(h.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},l.createElement(t.FormComposer,{config:h.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){let t={action:null==a?void 0:a.action,comments:null==e?void 0:e.comments,businessService:v,moduleName:f};D&&(t.documents=[{documentType:(null==a?void 0:a.action)+" DOC",fileName:null==A?void 0:A.name,filestoreId:D}]),d({PetRegistrationApplications:[u({},p,{workflow:t})]})},defaultValues:_,formId:"modal-action"})):l.createElement(t.Loader,null)},Tl=e=>l.createElement("h1",{className:"heading-m"},e.label),Al=()=>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(Al,null)),Dl=e=>{var r,o,a;let{t:c,action:s,tenantId:d,closeModal:p,submitAction:v,applicationData:f,businessService:m,moduleCode:h}=e;const{data:E}=Digit.Hooks.useEmployeeSearch(d,{roles:null==s||null===(r=s.roles)||void 0===r||null===(o=r[0])||void 0===o||null===(a=o.map)||void 0===a?void 0:a.call(o,e=>({code:e})),isActive:!0},{enabled:!(null!=s&&s.isTerminateState)}),_=i.useHistory(),[g,y]=n.useState({}),[S,b]=n.useState({}),[T,A]=n.useState([]),[C,D]=n.useState(null),[N,P]=n.useState(null);return n.useEffect(()=>{var e;A(null==E||null===(e=E.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[E]),n.useEffect(()=>{"INITIATED"===(null==s?void 0:s.state)?_.push("/upyog-ui/employee/asset/assetservice/edit/"+(null==f?void 0:f.applicationNo)):y((e=>{let{t:t,action:n,businessService:l}=e;return{label:{heading:"WF_"+(null==n?void 0:n.action)+"_APPLICATION",submit:"WF_"+l+"_"+(null==n?void 0:n.action),cancel:"ES_AST_COMMON_CANCEL"},form:[{body:[{label:t("AST_ACTION_COMMENTS"),type:"textarea",populators:{name:"comments"}}]}]}})({t:c,action:s,approvers:T,selectedApprover:C,setSelectedApprover:D,uploadedFile:N,setUploadedFile:P,businessService:m}))},[s,T,N]),s&&g.form?l.createElement(t.Modal,{headerBarMain:l.createElement(Tl,{label:c(g.label.heading)}),headerBarEnd:l.createElement(Cl,{onClick:p}),actionCancelLabel:c(g.label.cancel),actionCancelOnSubmit:p,actionSaveLabel:c(g.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},l.createElement(t.FormComposer,{config:g.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){let t={action:null==s?void 0:s.action,comment:null==e?void 0:e.comments,businessService:m,moduleName:h};N&&(t.documents=[]),v({Asset:u({},f,{workflow:t})})},defaultValues:S,formId:"modal-action"})):l.createElement(t.Loader,null)},Nl=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"})),Rl=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(Pl,null)),Il=e=>{var r,i;let{t:o,action:a,tenantId:c,closeModal:s,submitAction:d,applicationData:p,businessService:v,moduleCode:f}=e;const{data:m}=Digit.Hooks.useEmployeeSearch(c,{roles:null==a||null===(r=a.assigneeRoles)||void 0===r||null===(i=r.map)||void 0===i?void 0:i.call(r,e=>({code:e})),isActive:!0},{enabled:!(null!=a&&a.isTerminateState)}),[h,E]=n.useState({}),[_,g]=n.useState({}),[y,S]=n.useState([]),[b,T]=n.useState(null),[A,C]=n.useState(null),[D,N]=n.useState(null),[P,R]=n.useState(null),[I,w]=n.useState(!1);function x(e){C(e.target.files[0])}return n.useEffect(()=>{var e;S(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{R(null);const e=function(){if(A){const e=function(){if(A.size>=5242880)R(o("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=$e(function(){return Promise.resolve(Digit.UploadServices.Filestorage("CHB",A,c)).then(function(e){var t,n,l,r;(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===(r=l.files[0])||void 0===r?void 0:r.fileStoreId):R(o("CS_FILE_UPLOAD_ERROR"))})},function(){R(o("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[A]),n.useEffect(()=>{a&&E((e=>{let{t:n,action:r,selectFile:i,uploadedFile:o,setUploadedFile:a}=e;return{label:{heading:"CHB_"+(null==r?void 0:r.action),submit:"CHB_"+(null==r?void 0:r.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")+(r.docUploadRequired?" *":""),populators:l.createElement(t.UploadFile,{id:"workflow-doc",onUpload:i,onDelete:()=>{a(null)},message:o?"1 "+n("CS_ACTION_FILEUPLOADED"):n("CS_ACTION_NO_FILEUPLOADED")})}]}]}})({t:o,action:a,approvers:y,selectedApprover:b,setSelectedApprover:T,selectFile:x,uploadedFile:D,setUploadedFile:N,businessService:v}))},[a,y,D]),a&&h.form?l.createElement(t.Modal,{headerBarMain:l.createElement(Nl,{label:o(h.label.heading)}),headerBarEnd:l.createElement(Rl,{onClick:s}),actionCancelLabel:o(h.label.cancel),actionCancelOnSubmit:s,actionSaveLabel:o(h.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},l.createElement(t.FormComposer,{config:h.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){let t={action:null==a?void 0:a.action,comment:null==e?void 0:e.comments,businessService:v,moduleName:f};D&&(t.documents=[{documentType:(null==a?void 0:a.action)+" DOC",fileName:null==A?void 0:A.name,fileStoreId:D}]),d({hallsBookingApplication:u({},p,{workflow:t})})},defaultValues:_,formId:"modal-action"})):l.createElement(t.Loader,null)},wl=e=>l.createElement("h1",{className:"heading-m"},e.label),xl=()=>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"})),Ol=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(xl,null)),Ll=e=>{var r,i;let{t:o,action:a,tenantId:c,closeModal:s,submitAction:d,applicationData:p,businessService:v,moduleCode:f}=e;const{data:m}=Digit.Hooks.useEmployeeSearch(c,{roles:null==a||null===(r=a.assigneeRoles)||void 0===r||null===(i=r.map)||void 0===i?void 0:i.call(r,e=>({code:e})),isActive:!0},{enabled:!(null!=a&&a.isTerminateState)}),[h,E]=n.useState({}),[_,g]=n.useState({}),[y,S]=n.useState([]),[b,T]=n.useState(null),[A,C]=n.useState(null),[D,N]=n.useState(null),[P,R]=n.useState(null),[I,w]=n.useState(null),[x,O]=n.useState(!1);function L(e){N(e.target.files[0])}return n.useEffect(()=>{var e;S(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(o("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=$e(function(){return Promise.resolve(Digit.UploadServices.Filestorage("PTR",D,Digit.ULBService.getStateId())).then(function(e){var t,n,l,r;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?R(null==e||null===(l=e.data)||void 0===l||null===(r=l.files[0])||void 0===r?void 0:r.fileStoreId):w(o("CS_FILE_UPLOAD_ERROR"))})},function(){w(o("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[D]),n.useEffect(()=>{a&&E((e=>{let{t:n,action:r,selectFile:i,uploadedFile:o,setUploadedFile:a,businessService:u}=e;return(new Date).toISOString().split("T"),{label:{heading:"WF_"+(null==r?void 0:r.action)+"_APPLICATION",submit:"WF_"+u+"_"+(null==r?void 0:r.action),cancel:"ES_PTR_COMMON_CANCEL"},form:[{body:["COMPLETIONPENDING"===(null==r?void 0:r.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==r?void 0:r.state)?{label:n("ES_EW_ACTION_TRANSACTION_ID"),type:"text",isMandatory:!0,populators:{name:"transactionId"}}:"null","REQUESTCOMPLETED"===(null==r?void 0:r.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")+(r.docUploadRequired?" *":""),populators:l.createElement(t.UploadFile,{id:"workflow-doc",onUpload:i,onDelete:()=>{a(null)},showHint:!0,hintText:n("EW_ATTACH_RESTRICTIONS_SIZE"),message:o?"1 "+n("ES_EW_ACTION_FILEUPLOADED"):n("ES_EW_ACTION_NO_FILEUPLOADED")})}]}]}})({t:o,action:a,approvers:y,selectedApprover:b,setSelectedApprover:T,selectFile:L,uploadedFile:P,setUploadedFile:R,businessService:v}))},[a,y,P]),a&&h.form?l.createElement(t.Modal,{headerBarMain:l.createElement(wl,{label:o(h.label.heading)}),headerBarEnd:l.createElement(Ol,{onClick:s}),actionCancelLabel:o(h.label.cancel),actionCancelOnSubmit:s,actionSaveLabel:o(h.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},l.createElement(t.FormComposer,{config:h.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){let t={action:null==a?void 0:a.action,comments:null==e?void 0:e.comments,businessService:v,moduleName:f};P&&(t.documents=[{documentType:(null==a?void 0:a.action)+" DOC",fileName:null==D?void 0:D.name,filestoreId:P},{}]),p.pickUpDate=null==e?void 0:e.date,p.transactionId=null==e?void 0:e.transactionId,p.finalAmount=null==e?void 0:e.finalAmount,d({EwasteApplication:[u({},p,{workflow:t})]})},defaultValues:_,formId:"modal-action"})):l.createElement(t.Loader,null)},Ml=e=>l.createElement("h1",{className:"heading-m"},e.label),kl=()=>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(kl,null)),Bl=e=>{var r,i;let{t:o,action:a,tenantId:c,closeModal:s,submitAction:d,applicationData:p,businessService:v,moduleCode:f}=e;const{data:m}=Digit.Hooks.useEmployeeSearch(c,{roles:null==a||null===(r=a.assigneeRoles)||void 0===r||null===(i=r.map)||void 0===i?void 0:i.call(r,e=>({code:e})),isActive:!0},{enabled:null==a?void 0:a.isTerminateState}),[h,E]=n.useState({}),[_,g]=n.useState({}),[y,S]=n.useState([]),[b,T]=n.useState(null),[A,C]=n.useState(null),[D,N]=n.useState(null),[P,R]=n.useState(null),[I,w]=n.useState(!1);function x(e){w(!0),C(e.target.files[0])}return n.useEffect(()=>{var e;S(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{R(null);const e=function(){if(A){const e=function(){if(A.size>=5242880)R(o("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=function(e,t){try{var n=$e(function(){return Promise.resolve(Digit.UploadServices.Filestorage("StreetVending",A,c)).then(function(e){var t,n,l,r;(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===(r=l.files[0])||void 0===r?void 0:r.fileStoreId):R(o("CS_FILE_UPLOAD_ERROR"))})},function(){R(o("CS_FILE_UPLOAD_ERROR"))})}catch(e){return t(!0,e)}return n&&n.then?n.then(t.bind(null,!1),t.bind(null,!0)):t(!1,n)}(0,function(e,t){if(w(!1),e)throw t;return t});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[A]),n.useEffect(()=>{E((e=>{let{t:n,action:r,selectFile:i,uploadedFile:o,setUploadedFile:a,approvers:u,selectedApprover:c,setSelectedApprover:s,isUploading:d}=e;const p=()=>l.createElement("div",{className:"loading-spinner"});return{label:{heading:"WF_"+(null==r?void 0:r.action)+"_APPLICATION",submit:"SV_"+(null==r?void 0:r.action),cancel:"SV_COMMON_CANCEL"},form:[{body:["APPROVE"===(null==r?void 0:r.action)||"REJECT"===(null==r?void 0:r.action)||"SENDBACKTOCITIZEN"===(null==r?void 0:r.action)?"":{label:n("SV_ASSIGNEE"),type:"dropdown",populators:l.createElement(t.Dropdown,{option:u,t:n,optionKey:"name",select:s,selected:c})},{label:n("SV_ACTION_COMMENTS"),isMandatory:!0,type:"textarea",populators:{name:"comments",validation:{required:!0}}},{label:n("SV_ATTATCH_FILE")+(r.docUploadRequired?" *":""),populators:l.createElement(t.UploadFile,{id:"workflow-doc-sv",onUpload:i,onDelete:()=>{a(null)},message:d?l.createElement("div",{style:{display:"flex",alignItems:"center",gap:"8px"}},l.createElement(p,null),l.createElement("span",null,"Uploading...")):o?"1 "+n("SV_FILE_UPLOADED"):n("SV_NO_FILE")})}]}]}})({t:o,action:a,approvers:y,selectedApprover:b,setSelectedApprover:T,selectFile:x,uploadedFile:D,setUploadedFile:N,businessService:v,isUploading:I}))},[a,y,D]),a&&h.form?l.createElement(t.Modal,{headerBarMain:l.createElement(Ml,{label:o(h.label.heading)}),headerBarEnd:l.createElement(Fl,{onClick:s}),actionCancelLabel:o(h.label.cancel),actionCancelOnSubmit:s,actionSaveLabel:o(h.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},l.createElement(t.FormComposer,{config:h.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:v,moduleName:f,assignes:"SENDBACKTOCITIZEN"===(null==a?void 0:a.action)?[null==p||null===(t=p.auditDetails)||void 0===t?void 0:t.createdBy]:null!=b&&b.uuid?[null==b?void 0:b.uuid]:null};D&&(n.documents=[{documentType:(null==a?void 0:a.action)+" DOC",fileName:null==A?void 0:A.name,fileStoreId:D}]),d({streetVendingDetail:u({},p,{workflow:n})})},defaultValues:_,formId:"modal-action"})):l.createElement(t.Loader,null)},Ul=e=>l.createElement("h1",{className:"heading-m"},e.label),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"})),Hl=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(jl,null)),Wl=e=>{var r,o,a,c;let{t:s,action:d,tenantId:p,closeModal:v,submitAction:f,applicationData:m,businessService:h,moduleCode:E}=e;const{data:_}=Digit.Hooks.useEmployeeSearch(p,{roles:null==d||null===(r=d.assigneeRoles)||void 0===r||null===(o=r.map)||void 0===o?void 0:o.call(r,e=>({code:e})),isActive:!0},{enabled:!(null!=d&&d.isTerminateState)}),{data:g}=Digit.Hooks.fsm.useVendorSearch({tenantId:p,config:{enabled:"PENDING_FOR_VEHICLE_DRIVER_ASSIGN"===(null==d?void 0:d.state)}});let y=[];null==g||null===(a=g.vendor)||void 0===a||a.map(e=>{var t,n;(null==e||null===(t=e.additionalDetails)||void 0===t?void 0:t.serviceType)===(null==m?void 0:m.bookingNo.split("-")[0])&&y.push({code:null==e?void 0:e.name,name:null==e?void 0:e.name,i18nKey:null==e?void 0:e.name,vendorId:null==e?void 0:e.id,uuid:null==e||null===(n=e.owner)||void 0===n?void 0:n.uuid})});const{data:S}=Digit.Hooks.fsm.useVehiclesSearch({tenantId:p,config:{enabled:"DELIVERY_PENDING"===(null==d?void 0:d.state)}});let b=[];null==S||null===(c=S.vehicle)||void 0===c||c.map(e=>{var t;b.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,uuid:null==e||null===(t=e.owner)||void 0===t?void 0:t.uuid})});const[T,A]=n.useState({}),[C,D]=n.useState({}),[N,P]=n.useState([]),[R,I]=n.useState(null),[w,x]=n.useState(null),[O,L]=n.useState(null),[M,k]=n.useState(null),[F,B]=n.useState(null),[U,j]=n.useState(""),H=i.useHistory();function W(e){I(e.target.files[0])}return n.useEffect(()=>{var e;P(null==_||null===(e=_.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[_]),n.useEffect(()=>{!function(){try{L(null);const e=function(){if(R){const e=function(){if(R.size>=5242880)L(s("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=$e(function(){return Promise.resolve(Digit.UploadServices.Filestorage("WT",R,p)).then(function(e){var t,n,l,r;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?x(null==e||null===(l=e.data)||void 0===l||null===(r=l.files[0])||void 0===r?void 0:r.fileStoreId):L(s("CS_FILE_UPLOAD_ERROR"))})},function(){L(s("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(()=>{if(d){if("PAY"===d.action){var e;const t=null===(e=m.bookingNo)||void 0===e?void 0:e.split("-")[0];let n="";switch(t){case"WT":n="request-service.water_tanker";break;case"MT":n="request-service.mobile_toilet";break;case"TP":n="request-service.tree_pruning";break;default:return void console.error("Unknown booking prefix:",t)}return H.push("/upyog-ui/employee/payment/collect/"+n+"/"+m.bookingNo)}A((e=>{let{t:n,action:r,selectFile:i,uploadedFile:o,setUploadedFile:a,selectedVendor:u,setSelectedVendor:c,vendorDescription:s,vehicleDescription:d,selectVehicle:p,setSelectVehicle:v}=e;return{label:{heading:"RS_"+(null==r?void 0:r.action),submit:"RS_"+(null==r?void 0:r.action),cancel:"CS_COMMON_BACK"},form:[{body:["PENDING_FOR_VEHICLE_DRIVER_ASSIGN"===(null==r?void 0:r.state)?{label:n("RS_ASSIGN"),type:"dropdown",isMandatory:!0,populators:l.createElement(t.Dropdown,{option:s,t:n,optionKey:"i18nKey",select:c,selected:u})}:"null","DELIVERY_PENDING"===(null==r?void 0:r.state)?{label:n("RS_REGISTRATION_NUMBER"),isMandatory:!0,type:"dropdown",populators:l.createElement(t.Dropdown,{option:d,t:n,optionKey:"i18nKey",select:v,selected:p})}:"null",{label:n("ES_RS_ACTION_COMMENTS")+" *",type:"textarea",populators:{name:"comments",validation:{required:!0}}},{label:n("ES_RS_ATTACH_FILE")+(r.docUploadRequired?" *":""),populators:l.createElement(t.UploadFile,{id:"workflow-doc",onUpload:i,onDelete:()=>{a(null)},message:o?"1 "+n("CS_ACTION_FILEUPLOADED"):n("CS_ACTION_NO_FILEUPLOADED")})}]}]}})({t:s,action:d,selectFile:W,uploadedFile:w,setUploadedFile:x,selectedVendor:M,setSelectedVendor:k,vendorDescription:g?y:void 0,vehicleDescription:S?b:void 0,selectVehicle:F,setSelectVehicle:B}))}},[d,N,w,g,F,S]),d&&T.form?l.createElement(t.Modal,{headerBarMain:l.createElement(Ul,{label:s(T.label.heading)}),headerBarEnd:l.createElement(Hl,{onClick:v}),actionCancelLabel:s(T.label.cancel),actionCancelOnSubmit:v,actionSaveLabel:s(T.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action",isDisabled:(null==d?void 0:d.docUploadRequired)&&!w&&!U||"PENDING_FOR_VEHICLE_DRIVER_ASSIGN"===(null==d?void 0:d.state)&&!M&&!U||"DELIVERY_PENDING"===(null==d?void 0:d.state)&&!F&&!U||!U},l.createElement(t.FormComposer,{config:T.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){let t,n={action:null==d?void 0:d.action,comments:null==e?void 0:e.comments,businessService:h,moduleName:E};w&&(n.documents=[{documentType:(null==d?void 0:d.action)+" DOC",fileName:null==R?void 0:R.name,fileStoreId:w}]),"PENDING_FOR_VEHICLE_DRIVER_ASSIGN"===(null==d?void 0:d.state)&&(n.assignes=[null==M?void 0:M.uuid],m.vendorId=null==M?void 0:M.vendorId),"DELIVERY_PENDING"===(null==d?void 0:d.state)&&(m.vehicleId=null==F?void 0:F.vehicleId),t="watertanker"===h?{waterTankerBookingDetail:u({},m,{workflow:n})}:"treePruning"===h?{treePruningBookingDetail:u({},m,{workflow:n})}:{mobileToiletBookingDetail:u({},m,{workflow:n})},f(t)},defaultValues:C,formId:"modal-action",onFormValueChange:(e,t)=>{j(null==t?void 0:t.comments)}})):l.createElement(t.Loader,null)},zl=e=>null!=e&&e.businessService.includes("PT")?l.createElement(Je,e):null!=e&&e.businessService.includes("ptr")?l.createElement(bl,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(nt,e):null!=e&&e.moduleCode.includes("BPAREG")?l.createElement(ot,e):null!=e&&e.moduleCode.includes("BPA")?l.createElement(st,e):null!=e&&e.moduleCode.includes("NOC")?l.createElement(ft,e):null!=e&&e.moduleCode.includes("WS")?l.createElement(_l,e):null!=e&&e.businessService.includes("asset-create")?l.createElement(Dl,e):null!=e&&e.businessService.includes("ewst")?l.createElement(Ll,e):null!=e&&e.businessService.includes("booking-refund")?l.createElement(Il,e):null!=e&&e.businessService.includes("street-vending")?l.createElement(Bl,e):null!=e&&e.businessService.includes("watertanker")||null!=e&&e.businessService.includes("mobileToilet")||null!=e&&e.businessService.includes("treePruning")?l.createElement(Wl,e):void 0;function Vl(e){let{documents:n,svgStyles:i={},isSendBackFlow:o=!1,isHrLine:a=!1,titleStyles:u}=e;const{t:c}=r.useTranslation(),s=window.location.href.includes("stakeholder");return l.createElement("div",{style:{marginTop:"19px"}},!s&&(null==n?void 0:n.map((e,r)=>{var i;return l.createElement(l.Fragment,{key:r},null!=e&&e.title?l.createElement(t.CardSubHeader,{style:u||{marginTop:"32px",marginBottom:"8px",color:"#505A5F",fontSize:"24px"}},c(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 r;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"}},c(null==e?void 0:e.title)),o?null!=e&&null!==(r=e.documentType)&&void 0!==r&&r.includes("NOC")?l.createElement("p",{style:{textAlign:"center"}},c(null==e?void 0:e.documentType.split(".")[1])):l.createElement("p",{style:{textAlign:"center"}},c(null==e?void 0:e.documentType)):"")}):!window.location.href.includes("citizen")&&l.createElement("div",null,l.createElement("p",null,c("BPA_NO_DOCUMENTS_UPLOADED_LABEL")))),a&&(null==n?void 0:n.length)!=r+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 r;return l.createElement(l.Fragment,{key:n},null!=e&&e.title?l.createElement(t.CardSubHeader,{style:{marginTop:"32px",marginBottom:"8px",color:"#505A5F",fontSize:"24px"}},c(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===(r=e.values)||void 0===r?void 0:r.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"}},c(null==e?void 0:e.title)),null!=e&&e.docInfo?l.createElement("div",{style:{fontSize:"12px",color:"#505A5F",fontWeight:400,lineHeight:"15px",marginBottom:"10px"}},""+c(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"}},""+c(null==e?void 0:e.title))))):!window.location.href.includes("citizen")&&l.createElement("div",null,l.createElement("p",null,c("BPA_NO_DOCUMENTS_UPLOADED_LABEL")))))})))}v(function(e,t){(function(){var n="Expected a function",l="__lodash_placeholder__",r=[["ary",128],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",32],["partialRight",64],["rearg",256]],i="[object Arguments]",o="[object Array]",a="[object Boolean]",u="[object Date]",c="[object Error]",s="[object Function]",d="[object GeneratorFunction]",v="[object Map]",f="[object Number]",m="[object Object]",h="[object RegExp]",E="[object Set]",_="[object String]",g="[object Symbol]",y="[object WeakMap]",S="[object ArrayBuffer]",b="[object DataView]",T="[object Float32Array]",A="[object Float64Array]",C="[object Int8Array]",D="[object Int16Array]",N="[object Int32Array]",P="[object Uint8Array]",R="[object Uint16Array]",I="[object Uint32Array]",w=/\b__p \+= '';/g,x=/\b(__p \+=) '' \+/g,O=/(__e\(.*?\)|\b__t\)) \+\n'';/g,L=/&(?:amp|lt|gt|quot|#39);/g,M=/[&<>"']/g,k=RegExp(L.source),F=RegExp(M.source),B=/<%-([\s\S]+?)%>/g,U=/<%([\s\S]+?)%>/g,j=/<%=([\s\S]+?)%>/g,H=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,W=/^\w*$/,z=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,V=/[\\^$.*+?()[\]{}|]/g,K=RegExp(V.source),Y=/^\s+/,q=/\s/,$=/\{(?:\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,re=/^\[object .+?Constructor\]$/,ie=/^0o[0-7]+$/i,oe=/^(?:0|[1-9]\d*)$/,ae=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ue=/($^)/,ce=/['\n\r\u2028\u2029\\]/g,se="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",de="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",pe="["+de+"]",ve="["+se+"]",fe="\\d+",me="[a-z\\xdf-\\xf6\\xf8-\\xff]",he="[^\\ud800-\\udfff"+de+fe+"\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",Ee="\\ud83c[\\udffb-\\udfff]",_e="[^\\ud800-\\udfff]",ge="(?:\\ud83c[\\udde6-\\uddff]){2}",ye="[\\ud800-\\udbff][\\udc00-\\udfff]",Se="[A-Z\\xc0-\\xd6\\xd8-\\xde]",be="(?:"+me+"|"+he+")",Te="(?:"+Se+"|"+he+")",Ae="(?:"+ve+"|"+Ee+")?",Ce="[\\ufe0e\\ufe0f]?"+Ae+"(?:\\u200d(?:"+[_e,ge,ye].join("|")+")[\\ufe0e\\ufe0f]?"+Ae+")*",De="(?:"+["[\\u2700-\\u27bf]",ge,ye].join("|")+")"+Ce,Ne="(?:"+[_e+ve+"?",ve,ge,ye,"[\\ud800-\\udfff]"].join("|")+")",Pe=RegExp("['’]","g"),Re=RegExp(ve,"g"),Ie=RegExp(Ee+"(?="+Ee+")|"+Ne+Ce,"g"),we=RegExp([Se+"?"+me+"+(?:['’](?: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_])",fe,De].join("|"),"g"),xe=RegExp("[\\u200d\\ud800-\\udfff"+se+"\\ufe0e\\ufe0f]"),Oe=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Le=["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,ke={};ke[T]=ke[A]=ke[C]=ke[D]=ke[N]=ke[P]=ke["[object Uint8ClampedArray]"]=ke[R]=ke[I]=!0,ke[i]=ke[o]=ke[S]=ke[a]=ke[b]=ke[u]=ke[c]=ke[s]=ke[v]=ke[f]=ke[m]=ke[h]=ke[E]=ke[_]=ke[y]=!1;var Fe={};Fe[i]=Fe[o]=Fe[S]=Fe[b]=Fe[a]=Fe[u]=Fe[T]=Fe[A]=Fe[C]=Fe[D]=Fe[N]=Fe[v]=Fe[f]=Fe[m]=Fe[h]=Fe[E]=Fe[_]=Fe[g]=Fe[P]=Fe["[object Uint8ClampedArray]"]=Fe[R]=Fe[I]=!0,Fe[c]=Fe[s]=Fe[y]=!1;var Be={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Ue=parseFloat,je=parseInt,He="object"==typeof p&&p&&p.Object===Object&&p,We="object"==typeof self&&self&&self.Object===Object&&self,ze=He||We||Function("return this")(),Ve=t&&!t.nodeType&&t,Ke=Ve&&e&&!e.nodeType&&e,Ye=Ke&&Ke.exports===Ve,qe=Ye&&He.process,$e=function(){try{return Ke&&Ke.require&&Ke.require("util").types||qe&&qe.binding&&qe.binding("util")}catch(e){}}(),Ge=$e&&$e.isArrayBuffer,Ze=$e&&$e.isDate,Xe=$e&&$e.isMap,Je=$e&&$e.isRegExp,Qe=$e&&$e.isSet,et=$e&&$e.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 r=-1,i=null==e?0:e.length;++r<i;){var o=e[r];t(l,o,n(o),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 rt(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 ot(e,t){for(var n=-1,l=null==e?0:e.length,r=0,i=[];++n<l;){var o=e[n];t(o,n,e)&&(i[r++]=o)}return i}function at(e,t){return!(null==e||!e.length)&&Et(e,t,0)>-1}function ut(e,t,n){for(var l=-1,r=null==e?0:e.length;++l<r;)if(n(t,e[l]))return!0;return!1}function ct(e,t){for(var n=-1,l=null==e?0:e.length,r=Array(l);++n<l;)r[n]=t(e[n],n,e);return r}function st(e,t){for(var n=-1,l=t.length,r=e.length;++n<l;)e[r+n]=t[n];return e}function dt(e,t,n,l){var r=-1,i=null==e?0:e.length;for(l&&i&&(n=e[++r]);++r<i;)n=t(n,e[r],r,e);return n}function pt(e,t,n,l){var r=null==e?0:e.length;for(l&&r&&(n=e[--r]);r--;)n=t(n,e[r],r,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 ft=St("length");function mt(e,t,n){var l;return n(e,function(e,n,r){if(t(e,n,r))return l=n,!1}),l}function ht(e,t,n,l){for(var r=e.length,i=n+(l?1:-1);l?i--:++i<r;)if(t(e[i],i,e))return i;return-1}function Et(e,t,n){return t==t?function(e,t,n){for(var l=n-1,r=e.length;++l<r;)if(e[l]===t)return l;return-1}(e,t,n):ht(e,gt,n)}function _t(e,t,n,l){for(var r=n-1,i=e.length;++r<i;)if(l(e[r],t))return r;return-1}function gt(e){return e!=e}function yt(e,t){var n=null==e?0:e.length;return n?At(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,r){return r(e,function(e,r,i){n=l?(l=!1,e):t(n,e,r,i)}),n}function At(e,t){for(var n,l=-1,r=e.length;++l<r;){var i=t(e[l]);void 0!==i&&(n=void 0===n?i:n+i)}return n}function Ct(e,t){for(var n=-1,l=Array(e);++n<e;)l[n]=t(n);return l}function Dt(e){return e?e.slice(0,Vt(e)+1).replace(Y,""):e}function Nt(e){return function(t){return e(t)}}function Pt(e,t){return ct(t,function(t){return e[t]})}function Rt(e,t){return e.has(t)}function It(e,t){for(var n=-1,l=e.length;++n<l&&Et(t,e[n],0)>-1;);return n}function wt(e,t){for(var n=e.length;n--&&Et(t,e[n],0)>-1;);return n}function xt(e,t){for(var n=e.length,l=0;n--;)e[n]===t&&++l;return l}var Ot=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"}),Lt=bt({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"});function Mt(e){return"\\"+Be[e]}function kt(e){return xe.test(e)}function Ft(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,r=e.length,i=0,o=[];++n<r;){var a=e[n];a!==t&&a!==l||(e[n]=l,o[i++]=n)}return o}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 kt(e)?function(e){for(var t=Ie.lastIndex=0;Ie.test(e);)++t;return t}(e):ft(e)}function zt(e){return kt(e)?function(e){return e.match(Ie)||[]}(e):function(e){return e.split("")}(e)}function Vt(e){for(var t=e.length;t--&&q.test(e.charAt(t)););return t}var Kt=bt({"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"}),Yt=function e(t){var p=(t=null==t?ze:Yt.defaults(ze.Object(),t,Yt.pick(ze,Le))).Array,q=t.Date,se=t.Error,de=t.Function,pe=t.Math,ve=t.Object,fe=t.RegExp,me=t.String,he=t.TypeError,Ee=p.prototype,_e=ve.prototype,ge=t["__core-js_shared__"],ye=de.prototype.toString,Se=_e.hasOwnProperty,be=0,Te=function(){var e=/[^.]+$/.exec(ge&&ge.keys&&ge.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),Ae=_e.toString,Ce=ye.call(ve),De=ze._,Ne=fe("^"+ye.call(Se).replace(V,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ie=Ye?t.Buffer:void 0,xe=t.Symbol,Be=t.Uint8Array,He=Ie?Ie.allocUnsafe:void 0,We=Bt(ve.getPrototypeOf,ve),Ve=ve.create,Ke=_e.propertyIsEnumerable,qe=Ee.splice,$e=xe?xe.isConcatSpreadable:void 0,ft=xe?xe.iterator:void 0,bt=xe?xe.toStringTag:void 0,qt=function(){try{var e=Xr(ve,"defineProperty");return e({},"",{}),e}catch(e){}}(),$t=t.clearTimeout!==ze.clearTimeout&&t.clearTimeout,Gt=q&&q.now!==ze.Date.now&&q.now,Zt=t.setTimeout!==ze.setTimeout&&t.setTimeout,Xt=pe.ceil,Jt=pe.floor,Qt=ve.getOwnPropertySymbols,en=Ie?Ie.isBuffer:void 0,tn=t.isFinite,nn=Ee.join,ln=Bt(ve.keys,ve),rn=pe.max,on=pe.min,an=q.now,un=t.parseInt,cn=pe.random,sn=Ee.reverse,dn=Xr(t,"DataView"),pn=Xr(t,"Map"),vn=Xr(t,"Promise"),fn=Xr(t,"Set"),mn=Xr(t,"WeakMap"),hn=Xr(ve,"create"),En=mn&&new mn,_n={},gn=Ai(dn),yn=Ai(pn),Sn=Ai(vn),bn=Ai(fn),Tn=Ai(mn),An=xe?xe.prototype:void 0,Cn=An?An.valueOf:void 0,Dn=An?An.toString:void 0;function Nn(e){if(Wo(e)&&!wo(e)&&!(e instanceof wn)){if(e instanceof In)return e;if(Se.call(e,"__wrapped__"))return Ci(e)}return new In(e)}var Pn=function(){function e(){}return function(t){if(!Ho(t))return{};if(Ve)return Ve(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function Rn(){}function In(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=void 0}function wn(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=4294967295,this.__views__=[]}function xn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var l=e[t];this.set(l[0],l[1])}}function On(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 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 Mn(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new Ln;++t<n;)this.add(e[t])}function kn(e){var t=this.__data__=new On(e);this.size=t.size}function Fn(e,t){var n=wo(e),l=!n&&Io(e),r=!n&&!l&&Mo(e),i=!n&&!l&&!r&&Zo(e),o=n||l||r||i,a=o?Ct(e.length,me):[],u=a.length;for(var c in e)!t&&!Se.call(e,c)||o&&("length"==c||r&&("offset"==c||"parent"==c)||i&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||ri(c,u))||a.push(c);return a}function Bn(e){var t=e.length;return t?e[Ll(0,t-1)]:void 0}function Un(e,t){return Si(mr(e),$n(t,0,e.length))}function jn(e){return Si(mr(e))}function Hn(e,t,n){(void 0!==n&&!No(e[t],n)||void 0===n&&!(t in e))&&Yn(e,t,n)}function Wn(e,t,n){var l=e[t];Se.call(e,t)&&No(l,n)&&(void 0!==n||t in e)||Yn(e,t,n)}function zn(e,t){for(var n=e.length;n--;)if(No(e[n][0],t))return n;return-1}function Vn(e,t,n,l){return Qn(e,function(e,r,i){t(l,e,n(e),i)}),l}function Kn(e,t){return e&&hr(t,_a(t),e)}function Yn(e,t,n){"__proto__"==t&&qt?qt(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function qn(e,t){for(var n=-1,l=t.length,r=p(l),i=null==e;++n<l;)r[n]=i?void 0:va(e,t[n]);return r}function $n(e,t,n){return e==e&&(void 0!==n&&(e=e<=n?e:n),void 0!==t&&(e=e>=t?e:t)),e}function Gn(e,t,n,l,r,o){var c,p=1&t,y=2&t,w=4&t;if(n&&(c=r?n(e,l,r,o):n(e)),void 0!==c)return c;if(!Ho(e))return e;var x=wo(e);if(x){if(c=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&Se.call(e,"index")&&(n.index=e.index,n.input=e.input),n}(e),!p)return mr(e,c)}else{var O=ei(e),L=O==s||O==d;if(Mo(e))return cr(e,p);if(O==m||O==i||L&&!r){if(c=y||L?{}:ni(e),!p)return y?function(e,t){return hr(e,Qr(e),t)}(e,function(e,t){return e&&hr(t,ga(t),e)}(c,e)):function(e,t){return hr(e,Jr(e),t)}(e,Kn(c,e))}else{if(!Fe[O])return r?e:{};c=function(e,t,n){var l=e.constructor;switch(t){case S:return sr(e);case a:case u:return new l(+e);case b:return function(e,t){var n=t?sr(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,n);case T:case A:case C:case D:case N:case P:case"[object Uint8ClampedArray]":case R:case I:return dr(e,n);case v:return new l;case f:case _:return new l(e);case h:return function(e){var t=new e.constructor(e.source,te.exec(e));return t.lastIndex=e.lastIndex,t}(e);case E:return new l;case g:return Cn?ve(Cn.call(e)):{}}}(e,O,p)}}o||(o=new kn);var M=o.get(e);if(M)return M;o.set(e,c),qo(e)?e.forEach(function(l){c.add(Gn(l,t,n,l,e,o))}):zo(e)&&e.forEach(function(l,r){c.set(r,Gn(l,t,n,r,e,o))});var k=x?void 0:(w?y?Vr:zr:y?ga:_a)(e);return lt(k||e,function(l,r){k&&(l=e[r=l]),Wn(c,r,Gn(l,t,n,r,e,o))}),c}function Zn(e,t,n){var l=n.length;if(null==e)return!l;for(e=ve(e);l--;){var r=n[l],i=e[r];if(void 0===i&&!(r in e)||!(0,t[r])(i))return!1}return!0}function Xn(e,t,l){if("function"!=typeof e)throw new he(n);return Ei(function(){e.apply(void 0,l)},t)}function Jn(e,t,n,l){var r=-1,i=at,o=!0,a=e.length,u=[],c=t.length;if(!a)return u;n&&(t=ct(t,Nt(n))),l?(i=ut,o=!1):t.length>=200&&(i=Rt,o=!1,t=new Mn(t));e:for(;++r<a;){var s=e[r],d=null==n?s:n(s);if(s=l||0!==s?s:0,o&&d==d){for(var p=c;p--;)if(t[p]===d)continue e;u.push(s)}else i(t,d,l)||u.push(s)}return u}Nn.templateSettings={escape:B,evaluate:U,interpolate:j,variable:"",imports:{_:Nn}},(Nn.prototype=Rn.prototype).constructor=Nn,(In.prototype=Pn(Rn.prototype)).constructor=In,(wn.prototype=Pn(Rn.prototype)).constructor=wn,xn.prototype.clear=function(){this.__data__=hn?hn(null):{},this.size=0},xn.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},xn.prototype.get=function(e){var t=this.__data__;if(hn){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return Se.call(t,e)?t[e]:void 0},xn.prototype.has=function(e){var t=this.__data__;return hn?void 0!==t[e]:Se.call(t,e)},xn.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=hn&&void 0===t?"__lodash_hash_undefined__":t,this},On.prototype.clear=function(){this.__data__=[],this.size=0},On.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))},On.prototype.get=function(e){var t=this.__data__,n=zn(t,e);return n<0?void 0:t[n][1]},On.prototype.has=function(e){return zn(this.__data__,e)>-1},On.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},Ln.prototype.clear=function(){this.size=0,this.__data__={hash:new xn,map:new(pn||On),string:new xn}},Ln.prototype.delete=function(e){var t=Gr(this,e).delete(e);return this.size-=t?1:0,t},Ln.prototype.get=function(e){return Gr(this,e).get(e)},Ln.prototype.has=function(e){return Gr(this,e).has(e)},Ln.prototype.set=function(e,t){var n=Gr(this,e),l=n.size;return n.set(e,t),this.size+=n.size==l?0:1,this},Mn.prototype.add=Mn.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},Mn.prototype.has=function(e){return this.__data__.has(e)},kn.prototype.clear=function(){this.__data__=new On,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 On){var l=n.__data__;if(!pn||l.length<199)return l.push([e,t]),this.size=++n.size,this;n=this.__data__=new Ln(l)}return n.set(e,t),this.size=n.size,this};var Qn=gr(al),el=gr(ul,!0);function tl(e,t){var n=!0;return Qn(e,function(e,l,r){return n=!!t(e,l,r)}),n}function nl(e,t,n){for(var l=-1,r=e.length;++l<r;){var i=e[l],o=t(i);if(null!=o&&(void 0===a?o==o&&!Go(o):n(o,a)))var a=o,u=i}return u}function ll(e,t){var n=[];return Qn(e,function(e,l,r){t(e,l,r)&&n.push(e)}),n}function rl(e,t,n,l,r){var i=-1,o=e.length;for(n||(n=li),r||(r=[]);++i<o;){var a=e[i];t>0&&n(a)?t>1?rl(a,t-1,n,l,r):st(r,a):l||(r[r.length]=a)}return r}var il=yr(),ol=yr(!0);function al(e,t){return e&&il(e,t,_a)}function ul(e,t){return e&&ol(e,t,_a)}function cl(e,t){return ot(t,function(t){return Bo(e[t])})}function sl(e,t){for(var n=0,l=(t=ir(t,e)).length;null!=e&&n<l;)e=e[Ti(t[n++])];return n&&n==l?e:void 0}function dl(e,t,n){var l=t(e);return wo(e)?l:st(l,n(e))}function pl(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":bt&&bt in ve(e)?function(e){var t=Se.call(e,bt),n=e[bt];try{e[bt]=void 0;var l=!0}catch(e){}var r=Ae.call(e);return l&&(t?e[bt]=n:delete e[bt]),r}(e):function(e){return Ae.call(e)}(e)}function vl(e,t){return e>t}function fl(e,t){return null!=e&&Se.call(e,t)}function ml(e,t){return null!=e&&t in ve(e)}function hl(e,t,n){for(var l=n?ut:at,r=e[0].length,i=e.length,o=i,a=p(i),u=Infinity,c=[];o--;){var s=e[o];o&&t&&(s=ct(s,Nt(t))),u=on(s.length,u),a[o]=!n&&(t||r>=120&&s.length>=120)?new Mn(o&&s):void 0}s=e[0];var d=-1,v=a[0];e:for(;++d<r&&c.length<u;){var f=s[d],m=t?t(f):f;if(f=n||0!==f?f:0,!(v?Rt(v,m):l(c,m,n))){for(o=i;--o;){var h=a[o];if(!(h?Rt(h,m):l(e[o],m,n)))continue e}v&&v.push(m),c.push(f)}}return c}function El(e,t,n){var l=null==(e=vi(e,t=ir(t,e)))?e:e[Ti(ki(t))];return null==l?void 0:tt(l,e,n)}function _l(e){return Wo(e)&&pl(e)==i}function gl(e,t,n,l,r){return e===t||(null==e||null==t||!Wo(e)&&!Wo(t)?e!=e&&t!=t:function(e,t,n,l,r,s){var d=wo(e),p=wo(t),y=d?o:ei(e),T=p?o:ei(t),A=(y=y==i?m:y)==m,C=(T=T==i?m:T)==m,D=y==T;if(D&&Mo(e)){if(!Mo(t))return!1;d=!0,A=!1}if(D&&!A)return s||(s=new kn),d||Zo(e)?Hr(e,t,n,l,r,s):function(e,t,n,l,r,i,o){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 Be(e),new Be(t)));case a:case u:case f:return No(+e,+t);case c:return e.name==t.name&&e.message==t.message;case h:case _:return e==t+"";case v:var s=Ft;case E:if(s||(s=jt),e.size!=t.size&&!(1&l))return!1;var d=o.get(e);if(d)return d==t;l|=2,o.set(e,t);var p=Hr(s(e),s(t),l,r,i,o);return o.delete(e),p;case g:if(Cn)return Cn.call(e)==Cn.call(t)}return!1}(e,t,y,n,l,r,s);if(!(1&n)){var N=A&&Se.call(e,"__wrapped__"),P=C&&Se.call(t,"__wrapped__");if(N||P){var R=N?e.value():e,I=P?t.value():t;return s||(s=new kn),r(R,I,n,l,s)}}return!!D&&(s||(s=new kn),function(e,t,n,l,r,i){var o=1&n,a=zr(e),u=a.length;if(u!=zr(t).length&&!o)return!1;for(var c=u;c--;){var s=a[c];if(!(o?s in t:Se.call(t,s)))return!1}var d=i.get(e),p=i.get(t);if(d&&p)return d==t&&p==e;var v=!0;i.set(e,t),i.set(t,e);for(var f=o;++c<u;){var m=e[s=a[c]],h=t[s];if(l)var E=o?l(h,m,s,t,e,i):l(m,h,s,e,t,i);if(!(void 0===E?m===h||r(m,h,n,l,i):E)){v=!1;break}f||(f="constructor"==s)}if(v&&!f){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,r,s))}(e,t,n,l,gl,r))}function yl(e,t,n,l){var r=n.length,i=r,o=!l;if(null==e)return!i;for(e=ve(e);r--;){var a=n[r];if(o&&a[2]?a[1]!==e[a[0]]:!(a[0]in e))return!1}for(;++r<i;){var u=(a=n[r])[0],c=e[u],s=a[1];if(o&&a[2]){if(void 0===c&&!(u in e))return!1}else{var d=new kn;if(l)var p=l(c,s,u,e,t,d);if(!(void 0===p?gl(s,c,3,l,d):p))return!1}}return!0}function Sl(e){return!(!Ho(e)||(t=e,Te&&Te in t))&&(Bo(e)?Ne:re).test(Ai(e));var t}function bl(e){return"function"==typeof e?e:null==e?Va:"object"==typeof e?wo(e)?Nl(e[0],e[1]):Dl(e):Qa(e)}function Tl(e){if(!ci(e))return ln(e);var t=[];for(var n in ve(e))Se.call(e,n)&&"constructor"!=n&&t.push(n);return t}function Al(e,t){return e<t}function Cl(e,t){var n=-1,l=Oo(e)?p(e.length):[];return Qn(e,function(e,r,i){l[++n]=t(e,r,i)}),l}function Dl(e){var t=Zr(e);return 1==t.length&&t[0][2]?di(t[0][0],t[0][1]):function(n){return n===e||yl(n,e,t)}}function Nl(e,t){return oi(e)&&si(t)?di(Ti(e),t):function(n){var l=va(n,e);return void 0===l&&l===t?fa(n,e):gl(t,l,3)}}function Pl(e,t,n,l,r){e!==t&&il(t,function(i,o){if(r||(r=new kn),Ho(i))!function(e,t,n,l,r,i,o){var a=mi(e,n),u=mi(t,n),c=o.get(u);if(c)Hn(e,n,c);else{var s=i?i(a,u,n+"",e,t,o):void 0,d=void 0===s;if(d){var p=wo(u),v=!p&&Mo(u),f=!p&&!v&&Zo(u);s=u,p||v||f?wo(a)?s=a:Lo(a)?s=mr(a):v?(d=!1,s=cr(u,!0)):f?(d=!1,s=dr(u,!0)):s=[]:Ko(u)||Io(u)?(s=a,Io(a)?s=ra(a):Ho(a)&&!Bo(a)||(s=ni(u))):d=!1}d&&(o.set(u,s),r(s,u,l,i,o),o.delete(u)),Hn(e,n,s)}}(e,t,o,n,Pl,l,r);else{var a=l?l(mi(e,o),i,o+"",e,t,r):void 0;void 0===a&&(a=i),Hn(e,o,a)}},ga)}function Rl(e,t){var n=e.length;if(n)return ri(t+=t<0?n:0,n)?e[t]:void 0}function Il(e,t,n){t=t.length?ct(t,function(e){return wo(e)?function(t){return sl(t,1===e.length?e[0]:e)}:e}):[Va];var l=-1;return t=ct(t,Nt($r())),function(e,t){var l=e.length;for(e.sort(function(e,t){return function(e,t,n){for(var l=-1,r=e.criteria,i=t.criteria,o=r.length,a=n.length;++l<o;){var u=pr(r[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}(Cl(e,function(e,n,r){return{criteria:ct(t,function(t){return t(e)}),index:++l,value:e}}))}function wl(e,t,n){for(var l=-1,r=t.length,i={};++l<r;){var o=t[l],a=sl(e,o);n(a,o)&&Ul(i,ir(o,e),a)}return i}function xl(e,t,n,l){var r=l?_t:Et,i=-1,o=t.length,a=e;for(e===t&&(t=mr(t)),n&&(a=ct(e,Nt(n)));++i<o;)for(var u=0,c=t[i],s=n?n(c):c;(u=r(a,s,u,l))>-1;)a!==e&&qe.call(a,u,1),qe.call(e,u,1);return e}function Ol(e,t){for(var n=e?t.length:0,l=n-1;n--;){var r=t[n];if(n==l||r!==i){var i=r;ri(r)?qe.call(e,r,1):Xl(e,r)}}return e}function Ll(e,t){return e+Jt(cn()*(t-e+1))}function Ml(e,t){var n="";if(!e||t<1||t>9007199254740991)return n;do{t%2&&(n+=e),(t=Jt(t/2))&&(e+=e)}while(t);return n}function kl(e,t){return _i(pi(e,t,Va),e+"")}function Fl(e){return Bn(Na(e))}function Bl(e,t){var n=Na(e);return Si(n,$n(t,0,n.length))}function Ul(e,t,n,l){if(!Ho(e))return e;for(var r=-1,i=(t=ir(t,e)).length,o=i-1,a=e;null!=a&&++r<i;){var u=Ti(t[r]),c=n;if("__proto__"===u||"constructor"===u||"prototype"===u)return e;if(r!=o){var s=a[u];void 0===(c=l?l(s,u,a):void 0)&&(c=Ho(s)?s:ri(t[r+1])?[]:{})}Wn(a,u,c),a=a[u]}return e}var jl=En?function(e,t){return En.set(e,t),e}:Va,Hl=qt?function(e,t){return qt(e,"toString",{configurable:!0,enumerable:!1,value:Ha(t),writable:!0})}:Va;function Wl(e){return Si(Na(e))}function zl(e,t,n){var l=-1,r=e.length;t<0&&(t=-t>r?0:r+t),(n=n>r?r:n)<0&&(n+=r),r=t>n?0:n-t>>>0,t>>>=0;for(var i=p(r);++l<r;)i[l]=e[l+t];return i}function Vl(e,t){var n;return Qn(e,function(e,l,r){return!(n=t(e,l,r))}),!!n}function Kl(e,t,n){var l=0,r=null==e?l:e.length;if("number"==typeof t&&t==t&&r<=2147483647){for(;l<r;){var i=l+r>>>1,o=e[i];null!==o&&!Go(o)&&(n?o<=t:o<t)?l=i+1:r=i}return r}return Yl(e,t,Va,n)}function Yl(e,t,n,l){var r=0,i=null==e?0:e.length;if(0===i)return 0;for(var o=(t=n(t))!=t,a=null===t,u=Go(t),c=void 0===t;r<i;){var s=Jt((r+i)/2),d=n(e[s]),p=void 0!==d,v=null===d,f=d==d,m=Go(d);if(o)var h=l||f;else h=c?f&&(l||p):a?f&&p&&(l||!v):u?f&&p&&!v&&(l||!m):!v&&!m&&(l?d<=t:d<t);h?r=s+1:i=s}return on(i,4294967294)}function ql(e,t){for(var n=-1,l=e.length,r=0,i=[];++n<l;){var o=e[n],a=t?t(o):o;if(!n||!No(a,u)){var u=a;i[r++]=0===o?0:o}}return i}function $l(e){return"number"==typeof e?e:Go(e)?NaN:+e}function Gl(e){if("string"==typeof e)return e;if(wo(e))return ct(e,Gl)+"";if(Go(e))return Dn?Dn.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Zl(e,t,n){var l=-1,r=at,i=e.length,o=!0,a=[],u=a;if(n)o=!1,r=ut;else if(i>=200){var c=t?null:Mr(e);if(c)return jt(c);o=!1,r=Rt,u=new Mn}else u=t?[]:a;e:for(;++l<i;){var s=e[l],d=t?t(s):s;if(s=n||0!==s?s:0,o&&d==d){for(var p=u.length;p--;)if(u[p]===d)continue e;t&&u.push(d),a.push(s)}else r(u,d,n)||(u!==a&&u.push(d),a.push(s))}return a}function Xl(e,t){return null==(e=vi(e,t=ir(t,e)))||delete e[Ti(ki(t))]}function Jl(e,t,n,l){return Ul(e,t,n(sl(e,t)),l)}function Ql(e,t,n,l){for(var r=e.length,i=l?r:-1;(l?i--:++i<r)&&t(e[i],i,e););return n?zl(e,l?0:i,l?i+1:r):zl(e,l?i+1:0,l?r:i)}function er(e,t){var n=e;return n instanceof wn&&(n=n.value()),dt(t,function(e,t){return t.func.apply(t.thisArg,st([e],t.args))},n)}function tr(e,t,n){var l=e.length;if(l<2)return l?Zl(e[0]):[];for(var r=-1,i=p(l);++r<l;)for(var o=e[r],a=-1;++a<l;)a!=r&&(i[r]=Jn(i[r]||o,e[a],t,n));return Zl(rl(i,1),t,n)}function nr(e,t,n){for(var l=-1,r=e.length,i=t.length,o={};++l<r;)n(o,e[l],l<i?t[l]:void 0);return o}function lr(e){return Lo(e)?e:[]}function rr(e){return"function"==typeof e?e:Va}function ir(e,t){return wo(e)?e:oi(e,t)?[e]:bi(ia(e))}var or=kl;function ar(e,t,n){var l=e.length;return n=void 0===n?l:n,!t&&n>=l?e:zl(e,t,n)}var ur=$t||function(e){return ze.clearTimeout(e)};function cr(e,t){if(t)return e.slice();var n=e.length,l=He?He(n):new e.constructor(n);return e.copy(l),l}function sr(e){var t=new e.constructor(e.byteLength);return new Be(t).set(new Be(e)),t}function dr(e,t){var n=t?sr(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function pr(e,t){if(e!==t){var n=void 0!==e,l=null===e,r=e==e,i=Go(e),o=void 0!==t,a=null===t,u=t==t,c=Go(t);if(!a&&!c&&!i&&e>t||i&&o&&u&&!a&&!c||l&&o&&u||!n&&u||!r)return 1;if(!l&&!i&&!c&&e<t||c&&n&&r&&!l&&!i||a&&n&&r||!o&&r||!u)return-1}return 0}function vr(e,t,n,l){for(var r=-1,i=e.length,o=n.length,a=-1,u=t.length,c=rn(i-o,0),s=p(u+c),d=!l;++a<u;)s[a]=t[a];for(;++r<o;)(d||r<i)&&(s[n[r]]=e[r]);for(;c--;)s[a++]=e[r++];return s}function fr(e,t,n,l){for(var r=-1,i=e.length,o=-1,a=n.length,u=-1,c=t.length,s=rn(i-a,0),d=p(s+c),v=!l;++r<s;)d[r]=e[r];for(var f=r;++u<c;)d[f+u]=t[u];for(;++o<a;)(v||r<i)&&(d[f+n[o]]=e[r++]);return d}function mr(e,t){var n=-1,l=e.length;for(t||(t=p(l));++n<l;)t[n]=e[n];return t}function hr(e,t,n,l){var r=!n;n||(n={});for(var i=-1,o=t.length;++i<o;){var a=t[i],u=l?l(n[a],e[a],a,n,e):void 0;void 0===u&&(u=e[a]),r?Yn(n,a,u):Wn(n,a,u)}return n}function Er(e,t){return function(n,l){var r=wo(n)?nt:Vn,i=t?t():{};return r(n,e,$r(l,2),i)}}function _r(e){return kl(function(t,n){var l=-1,r=n.length,i=r>1?n[r-1]:void 0,o=r>2?n[2]:void 0;for(i=e.length>3&&"function"==typeof i?(r--,i):void 0,o&&ii(n[0],n[1],o)&&(i=r<3?void 0:i,r=1),t=ve(t);++l<r;){var a=n[l];a&&e(t,a,l,i)}return t})}function gr(e,t){return function(n,l){if(null==n)return n;if(!Oo(n))return e(n,l);for(var r=n.length,i=t?r:-1,o=ve(n);(t?i--:++i<r)&&!1!==l(o[i],i,o););return n}}function yr(e){return function(t,n,l){for(var r=-1,i=ve(t),o=l(t),a=o.length;a--;){var u=o[e?a:++r];if(!1===n(i[u],u,i))break}return t}}function Sr(e){return function(t){var n=kt(t=ia(t))?zt(t):void 0,l=n?n[0]:t.charAt(0),r=n?ar(n,1).join(""):t.slice(1);return l[e]()+r}}function br(e){return function(t){return dt(Ba(Ia(t).replace(Pe,"")),e,"")}}function Tr(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=Pn(e.prototype),l=e.apply(n,t);return Ho(l)?l:n}}function Ar(e){return function(t,n,l){var r=ve(t);if(!Oo(t)){var i=$r(n,3);t=_a(t),n=function(e){return i(r[e],e,r)}}var o=e(t,n,l);return o>-1?r[i?t[o]:o]:void 0}}function Cr(e){return Wr(function(t){var l=t.length,r=l,i=In.prototype.thru;for(e&&t.reverse();r--;){var o=t[r];if("function"!=typeof o)throw new he(n);if(i&&!a&&"wrapper"==Yr(o))var a=new In([],!0)}for(r=a?r:l;++r<l;){var u=Yr(o=t[r]),c="wrapper"==u?Kr(o):void 0;a=c&&ai(c[0])&&424==c[1]&&!c[4].length&&1==c[9]?a[Yr(c[0])].apply(a,c[3]):1==o.length&&ai(o)?a[u]():a.thru(o)}return function(){var e=arguments,n=e[0];if(a&&1==e.length&&wo(n))return a.plant(n).value();for(var r=0,i=l?t[r].apply(this,e):n;++r<l;)i=t[r].call(this,i);return i}})}function Dr(e,t,n,l,r,i,o,a,u,c){var s=128&t,d=1&t,v=2&t,f=24&t,m=512&t,h=v?void 0:Tr(e);return function E(){for(var _=arguments.length,g=p(_),y=_;y--;)g[y]=arguments[y];if(f)var S=qr(E),b=xt(g,S);if(l&&(g=vr(g,l,r,f)),i&&(g=fr(g,i,o,f)),_-=b,f&&_<c){var T=Ut(g,S);return Or(e,t,Dr,E.placeholder,n,g,T,a,u,c-_)}var A=d?n:this,C=v?A[e]:e;return _=g.length,a?g=fi(g,a):m&&_>1&&g.reverse(),s&&u<_&&(g.length=u),this&&this!==ze&&this instanceof E&&(C=h||Tr(C)),C.apply(A,g)}}function Nr(e,t){return function(n,l){return function(e,t,n,l){return al(e,function(e,r,i){t(l,n(e),r,i)}),l}(n,e,t(l),{})}}function Pr(e,t){return function(n,l){var r;if(void 0===n&&void 0===l)return t;if(void 0!==n&&(r=n),void 0!==l){if(void 0===r)return l;"string"==typeof n||"string"==typeof l?(n=Gl(n),l=Gl(l)):(n=$l(n),l=$l(l)),r=e(n,l)}return r}}function Rr(e){return Wr(function(t){return t=ct(t,Nt($r())),kl(function(n){var l=this;return e(t,function(e){return tt(e,l,n)})})})}function Ir(e,t){var n=(t=void 0===t?" ":Gl(t)).length;if(n<2)return n?Ml(t,e):t;var l=Ml(t,Xt(e/Wt(t)));return kt(t)?ar(zt(l),0,e).join(""):l.slice(0,e)}function wr(e){return function(t,n,l){return l&&"number"!=typeof l&&ii(t,n,l)&&(n=l=void 0),t=ea(t),void 0===n?(n=t,t=0):n=ea(n),function(e,t,n,l){for(var r=-1,i=rn(Xt((t-e)/(n||1)),0),o=p(i);i--;)o[l?i:++r]=e,e+=n;return o}(t,n,l=void 0===l?t<n?1:-1:ea(l),e)}}function xr(e){return function(t,n){return"string"==typeof t&&"string"==typeof n||(t=la(t),n=la(n)),e(t,n)}}function Or(e,t,n,l,r,i,o,a,u,c){var s=8&t;t|=s?32:64,4&(t&=~(s?64:32))||(t&=-4);var d=[e,t,r,s?i:void 0,s?o:void 0,s?void 0:i,s?void 0:o,a,u,c],p=n.apply(void 0,d);return ai(e)&&hi(p,d),p.placeholder=l,gi(p,e,t)}function Lr(e){var t=pe[e];return function(e,n){if(e=la(e),(n=null==n?0:on(ta(n),292))&&tn(e)){var l=(ia(e)+"e").split("e");return+((l=(ia(t(l[0]+"e"+(+l[1]+n)))+"e").split("e"))[0]+"e"+(+l[1]-n))}return t(e)}}var Mr=fn&&1/jt(new fn([,-0]))[1]==1/0?function(e){return new fn(e)}:Ga;function kr(e){return function(t){var n=ei(t);return n==v?Ft(t):n==E?Ht(t):function(e,t){return ct(t,function(t){return[t,e[t]]})}(t,e(t))}}function Fr(e,t,r,i,o,a,u,c){var s=2&t;if(!s&&"function"!=typeof e)throw new he(n);var d=i?i.length:0;if(d||(t&=-97,i=o=void 0),u=void 0===u?u:rn(ta(u),0),c=void 0===c?c:ta(c),d-=o?o.length:0,64&t){var v=i,f=o;i=o=void 0}var m=s?void 0:Kr(e),h=[e,t,r,i,o,v,f,a,u,c];if(m&&function(e,t){var n=e[1],r=t[1],i=n|r;if(!(i<131||128==r&&8==n||128==r&&256==n&&e[7].length<=t[8]||384==r&&t[7].length<=t[8]&&8==n))return e;1&r&&(e[2]=t[2],i|=1&n?0:4);var o=t[3];if(o){var a=e[3];e[3]=a?vr(a,o,t[4]):o,e[4]=a?Ut(e[3],l):t[4]}(o=t[5])&&(e[5]=(a=e[5])?fr(a,o,t[6]):o,e[6]=a?Ut(e[5],l):t[6]),(o=t[7])&&(e[7]=o),128&r&&(e[8]=null==e[8]?t[8]:on(e[8],t[8])),null==e[9]&&(e[9]=t[9]),e[0]=t[0],e[1]=i}(h,m),e=h[0],t=h[1],r=h[2],i=h[3],o=h[4],!(c=h[9]=void 0===h[9]?s?0:e.length:rn(h[9]-d,0))&&24&t&&(t&=-25),t&&1!=t)E=8==t||16==t?function(e,t,n){var l=Tr(e);return function r(){for(var i=arguments.length,o=p(i),a=i,u=qr(r);a--;)o[a]=arguments[a];var c=i<3&&o[0]!==u&&o[i-1]!==u?[]:Ut(o,u);if((i-=c.length)<n)return Or(e,t,Dr,r.placeholder,void 0,o,c,void 0,void 0,n-i);var s=this&&this!==ze&&this instanceof r?l:e;return tt(s,this,o)}}(e,t,c):32!=t&&33!=t||o.length?Dr.apply(void 0,h):function(e,t,n,l){var r=1&t,i=Tr(e);return function t(){for(var o=-1,a=arguments.length,u=-1,c=l.length,s=p(c+a),d=this&&this!==ze&&this instanceof t?i:e;++u<c;)s[u]=l[u];for(;a--;)s[u++]=arguments[++o];return tt(d,r?n:this,s)}}(e,t,r,i);else var E=function(e,t,n){var l=1&t,r=Tr(e);return function t(){var i=this&&this!==ze&&this instanceof t?r:e;return i.apply(l?n:this,arguments)}}(e,t,r);return gi((m?jl:hi)(E,h),e,t)}function Br(e,t,n,l){return void 0===e||No(e,_e[n])&&!Se.call(l,n)?t:e}function Ur(e,t,n,l,r,i){return Ho(e)&&Ho(t)&&(i.set(t,e),Pl(e,t,void 0,Ur,i),i.delete(t)),e}function jr(e){return Ko(e)?void 0:e}function Hr(e,t,n,l,r,i){var o=1&n,a=e.length,u=t.length;if(a!=u&&!(o&&u>a))return!1;var c=i.get(e),s=i.get(t);if(c&&s)return c==t&&s==e;var d=-1,p=!0,v=2&n?new Mn:void 0;for(i.set(e,t),i.set(t,e);++d<a;){var f=e[d],m=t[d];if(l)var h=o?l(m,f,d,t,e,i):l(f,m,d,e,t,i);if(void 0!==h){if(h)continue;p=!1;break}if(v){if(!vt(t,function(e,t){if(!Rt(v,t)&&(f===e||r(f,e,n,l,i)))return v.push(t)})){p=!1;break}}else if(f!==m&&!r(f,m,n,l,i)){p=!1;break}}return i.delete(e),i.delete(t),p}function Wr(e){return _i(pi(e,void 0,wi),e+"")}function zr(e){return dl(e,_a,Jr)}function Vr(e){return dl(e,ga,Qr)}var Kr=En?function(e){return En.get(e)}:Ga;function Yr(e){for(var t=e.name+"",n=_n[t],l=Se.call(_n,t)?n.length:0;l--;){var r=n[l],i=r.func;if(null==i||i==e)return r.name}return t}function qr(e){return(Se.call(Nn,"placeholder")?Nn:e).placeholder}function $r(){var e=Nn.iteratee||Ka;return e=e===Ka?bl:e,arguments.length?e(arguments[0],arguments[1]):e}function Gr(e,t){var n,l,r=e.__data__;return("string"==(l=typeof(n=t))||"number"==l||"symbol"==l||"boolean"==l?"__proto__"!==n:null===n)?r["string"==typeof t?"string":"hash"]:r.map}function Zr(e){for(var t=_a(e),n=t.length;n--;){var l=t[n],r=e[l];t[n]=[l,r,si(r)]}return t}function Xr(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return Sl(n)?n:void 0}var Jr=Qt?function(e){return null==e?[]:(e=ve(e),ot(Qt(e),function(t){return Ke.call(e,t)}))}:nu,Qr=Qt?function(e){for(var t=[];e;)st(t,Jr(e)),e=We(e);return t}:nu,ei=pl;function ti(e,t,n){for(var l=-1,r=(t=ir(t,e)).length,i=!1;++l<r;){var o=Ti(t[l]);if(!(i=null!=e&&n(e,o)))break;e=e[o]}return i||++l!=r?i:!!(r=null==e?0:e.length)&&jo(r)&&ri(o,r)&&(wo(e)||Io(e))}function ni(e){return"function"!=typeof e.constructor||ci(e)?{}:Pn(We(e))}function li(e){return wo(e)||Io(e)||!!($e&&e&&e[$e])}function ri(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&oe.test(e))&&e>-1&&e%1==0&&e<t}function ii(e,t,n){if(!Ho(n))return!1;var l=typeof t;return!!("number"==l?Oo(n)&&ri(t,n.length):"string"==l&&t in n)&&No(n[t],e)}function oi(e,t){if(wo(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!Go(e))||W.test(e)||!H.test(e)||null!=t&&e in ve(t)}function ai(e){var t=Yr(e),n=Nn[t];if("function"!=typeof n||!(t in wn.prototype))return!1;if(e===n)return!0;var l=Kr(n);return!!l&&e===l[0]}(dn&&ei(new dn(new ArrayBuffer(1)))!=b||pn&&ei(new pn)!=v||vn&&"[object Promise]"!=ei(vn.resolve())||fn&&ei(new fn)!=E||mn&&ei(new mn)!=y)&&(ei=function(e){var t=pl(e),n=t==m?e.constructor:void 0,l=n?Ai(n):"";if(l)switch(l){case gn:return b;case yn:return v;case Sn:return"[object Promise]";case bn:return E;case Tn:return y}return t});var ui=ge?Bo:lu;function ci(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||_e)}function si(e){return e==e&&!Ho(e)}function di(e,t){return function(n){return null!=n&&n[e]===t&&(void 0!==t||e in ve(n))}}function pi(e,t,n){return t=rn(void 0===t?e.length-1:t,0),function(){for(var l=arguments,r=-1,i=rn(l.length-t,0),o=p(i);++r<i;)o[r]=l[t+r];r=-1;for(var a=p(t+1);++r<t;)a[r]=l[r];return a[t]=n(o),tt(e,this,a)}}function vi(e,t){return t.length<2?e:sl(e,zl(t,0,-1))}function fi(e,t){for(var n=e.length,l=on(t.length,n),r=mr(e);l--;){var i=t[l];e[l]=ri(i,n)?r[i]:void 0}return e}function mi(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var hi=yi(jl),Ei=Zt||function(e,t){return ze.setTimeout(e,t)},_i=yi(Hl);function gi(e,t,n){var l=t+"";return _i(e,function(e,t){var n=t.length;if(!n)return e;var l=n-1;return t[l]=(n>1?"& ":"")+t[l],t=t.join(n>2?", ":" "),e.replace($,"{\n/* [wrapped with "+t+"] */\n")}(l,function(e,t){return lt(r,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 yi(e){var t=0,n=0;return function(){var l=an(),r=16-(l-n);if(n=l,r>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function Si(e,t){var n=-1,l=e.length,r=l-1;for(t=void 0===t?l:t;++n<t;){var i=Ll(n,r),o=e[i];e[i]=e[n],e[n]=o}return e.length=t,e}var bi=function(e){var t=So(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(z,function(e,n,l,r){t.push(l?r.replace(Q,"$1"):n||e)}),t},function(e){return 500===n.size&&n.clear(),e}),n=t.cache;return t}();function Ti(e){if("string"==typeof e||Go(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Ai(e){if(null!=e){try{return ye.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function Ci(e){if(e instanceof wn)return e.clone();var t=new In(e.__wrapped__,e.__chain__);return t.__actions__=mr(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var Di=kl(function(e,t){return Lo(e)?Jn(e,rl(t,1,Lo,!0)):[]}),Ni=kl(function(e,t){var n=ki(t);return Lo(n)&&(n=void 0),Lo(e)?Jn(e,rl(t,1,Lo,!0),$r(n,2)):[]}),Pi=kl(function(e,t){var n=ki(t);return Lo(n)&&(n=void 0),Lo(e)?Jn(e,rl(t,1,Lo,!0),void 0,n):[]});function Ri(e,t,n){var l=null==e?0:e.length;if(!l)return-1;var r=null==n?0:ta(n);return r<0&&(r=rn(l+r,0)),ht(e,$r(t,3),r)}function Ii(e,t,n){var l=null==e?0:e.length;if(!l)return-1;var r=l-1;return void 0!==n&&(r=ta(n),r=n<0?rn(l+r,0):on(r,l-1)),ht(e,$r(t,3),r,!0)}function wi(e){return null!=e&&e.length?rl(e,1):[]}function xi(e){return e&&e.length?e[0]:void 0}var Oi=kl(function(e){var t=ct(e,lr);return t.length&&t[0]===e[0]?hl(t):[]}),Li=kl(function(e){var t=ki(e),n=ct(e,lr);return t===ki(n)?t=void 0:n.pop(),n.length&&n[0]===e[0]?hl(n,$r(t,2)):[]}),Mi=kl(function(e){var t=ki(e),n=ct(e,lr);return(t="function"==typeof t?t:void 0)&&n.pop(),n.length&&n[0]===e[0]?hl(n,void 0,t):[]});function ki(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}var Fi=kl(Bi);function Bi(e,t){return e&&e.length&&t&&t.length?xl(e,t):e}var Ui=Wr(function(e,t){var n=null==e?0:e.length,l=qn(e,t);return Ol(e,ct(t,function(e){return ri(e,n)?+e:e}).sort(pr)),l});function ji(e){return null==e?e:sn.call(e)}var Hi=kl(function(e){return Zl(rl(e,1,Lo,!0))}),Wi=kl(function(e){var t=ki(e);return Lo(t)&&(t=void 0),Zl(rl(e,1,Lo,!0),$r(t,2))}),zi=kl(function(e){var t=ki(e);return t="function"==typeof t?t:void 0,Zl(rl(e,1,Lo,!0),void 0,t)});function Vi(e){if(!e||!e.length)return[];var t=0;return e=ot(e,function(e){if(Lo(e))return t=rn(e.length,t),!0}),Ct(t,function(t){return ct(e,St(t))})}function Ki(e,t){if(!e||!e.length)return[];var n=Vi(e);return null==t?n:ct(n,function(e){return tt(t,void 0,e)})}var Yi=kl(function(e,t){return Lo(e)?Jn(e,t):[]}),qi=kl(function(e){return tr(ot(e,Lo))}),$i=kl(function(e){var t=ki(e);return Lo(t)&&(t=void 0),tr(ot(e,Lo),$r(t,2))}),Gi=kl(function(e){var t=ki(e);return t="function"==typeof t?t:void 0,tr(ot(e,Lo),void 0,t)}),Zi=kl(Vi),Xi=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,Ki(e,n)});function Ji(e){var t=Nn(e);return t.__chain__=!0,t}function Qi(e,t){return t(e)}var eo=Wr(function(e){var t=e.length,n=t?e[0]:0,l=this.__wrapped__,r=function(t){return qn(t,e)};return!(t>1||this.__actions__.length)&&l instanceof wn&&ri(n)?((l=l.slice(n,+n+(t?1:0))).__actions__.push({func:Qi,args:[r],thisArg:void 0}),new In(l,this.__chain__).thru(function(e){return t&&!e.length&&e.push(void 0),e})):this.thru(r)}),to=Er(function(e,t,n){Se.call(e,n)?++e[n]:Yn(e,n,1)}),no=Ar(Ri),lo=Ar(Ii);function ro(e,t){return(wo(e)?lt:Qn)(e,$r(t,3))}function io(e,t){return(wo(e)?rt:el)(e,$r(t,3))}var oo=Er(function(e,t,n){Se.call(e,n)?e[n].push(t):Yn(e,n,[t])}),ao=kl(function(e,t,n){var l=-1,r="function"==typeof t,i=Oo(e)?p(e.length):[];return Qn(e,function(e){i[++l]=r?tt(t,e,n):El(e,t,n)}),i}),uo=Er(function(e,t,n){Yn(e,n,t)});function co(e,t){return(wo(e)?ct:Cl)(e,$r(t,3))}var so=Er(function(e,t,n){e[n?0:1].push(t)},function(){return[[],[]]}),po=kl(function(e,t){if(null==e)return[];var n=t.length;return n>1&&ii(e,t[0],t[1])?t=[]:n>2&&ii(t[0],t[1],t[2])&&(t=[t[0]]),Il(e,rl(t,1),[])}),vo=Gt||function(){return ze.Date.now()};function fo(e,t,n){return t=n?void 0:t,Fr(e,128,void 0,void 0,void 0,void 0,t=e&&null==t?e.length:t)}function mo(e,t){var l;if("function"!=typeof t)throw new he(n);return e=ta(e),function(){return--e>0&&(l=t.apply(this,arguments)),e<=1&&(t=void 0),l}}var ho=kl(function(e,t,n){var l=1;if(n.length){var r=Ut(n,qr(ho));l|=32}return Fr(e,l,t,n,r)}),Eo=kl(function(e,t,n){var l=3;if(n.length){var r=Ut(n,qr(Eo));l|=32}return Fr(t,l,e,n,r)});function _o(e,t,l){var r,i,o,a,u,c,s=0,d=!1,p=!1,v=!0;if("function"!=typeof e)throw new he(n);function f(t){var n=r,l=i;return r=i=void 0,s=t,a=e.apply(l,n)}function m(e){return s=e,u=Ei(E,t),d?f(e):a}function h(e){var n=e-c;return void 0===c||n>=t||n<0||p&&e-s>=o}function E(){var e=vo();if(h(e))return _(e);u=Ei(E,function(e){var n=t-(e-c);return p?on(n,o-(e-s)):n}(e))}function _(e){return u=void 0,v&&r?f(e):(r=i=void 0,a)}function g(){var e=vo(),n=h(e);if(r=arguments,i=this,c=e,n){if(void 0===u)return m(c);if(p)return ur(u),u=Ei(E,t),f(c)}return void 0===u&&(u=Ei(E,t)),a}return t=la(t)||0,Ho(l)&&(d=!!l.leading,o=(p="maxWait"in l)?rn(la(l.maxWait)||0,t):o,v="trailing"in l?!!l.trailing:v),g.cancel=function(){void 0!==u&&ur(u),s=0,r=c=i=u=void 0},g.flush=function(){return void 0===u?a:_(vo())},g}var go=kl(function(e,t){return Xn(e,1,t)}),yo=kl(function(e,t,n){return Xn(e,la(t)||0,n)});function So(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new he(n);var l=function(){var n=arguments,r=t?t.apply(this,n):n[0],i=l.cache;if(i.has(r))return i.get(r);var o=e.apply(this,n);return l.cache=i.set(r,o)||i,o};return l.cache=new(So.Cache||Ln),l}function bo(e){if("function"!=typeof e)throw new he(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)}}So.Cache=Ln;var To=or(function(e,t){var n=(t=1==t.length&&wo(t[0])?ct(t[0],Nt($r())):ct(rl(t,1),Nt($r()))).length;return kl(function(l){for(var r=-1,i=on(l.length,n);++r<i;)l[r]=t[r].call(this,l[r]);return tt(e,this,l)})}),Ao=kl(function(e,t){return Fr(e,32,void 0,t,Ut(t,qr(Ao)))}),Co=kl(function(e,t){return Fr(e,64,void 0,t,Ut(t,qr(Co)))}),Do=Wr(function(e,t){return Fr(e,256,void 0,void 0,void 0,t)});function No(e,t){return e===t||e!=e&&t!=t}var Po=xr(vl),Ro=xr(function(e,t){return e>=t}),Io=_l(function(){return arguments}())?_l:function(e){return Wo(e)&&Se.call(e,"callee")&&!Ke.call(e,"callee")},wo=p.isArray,xo=Ge?Nt(Ge):function(e){return Wo(e)&&pl(e)==S};function Oo(e){return null!=e&&jo(e.length)&&!Bo(e)}function Lo(e){return Wo(e)&&Oo(e)}var Mo=en||lu,ko=Ze?Nt(Ze):function(e){return Wo(e)&&pl(e)==u};function Fo(e){if(!Wo(e))return!1;var t=pl(e);return t==c||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!Ko(e)}function Bo(e){if(!Ho(e))return!1;var t=pl(e);return t==s||t==d||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Uo(e){return"number"==typeof e&&e==ta(e)}function jo(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}function Ho(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function Wo(e){return null!=e&&"object"==typeof e}var zo=Xe?Nt(Xe):function(e){return Wo(e)&&ei(e)==v};function Vo(e){return"number"==typeof e||Wo(e)&&pl(e)==f}function Ko(e){if(!Wo(e)||pl(e)!=m)return!1;var t=We(e);if(null===t)return!0;var n=Se.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&ye.call(n)==Ce}var Yo=Je?Nt(Je):function(e){return Wo(e)&&pl(e)==h},qo=Qe?Nt(Qe):function(e){return Wo(e)&&ei(e)==E};function $o(e){return"string"==typeof e||!wo(e)&&Wo(e)&&pl(e)==_}function Go(e){return"symbol"==typeof e||Wo(e)&&pl(e)==g}var Zo=et?Nt(et):function(e){return Wo(e)&&jo(e.length)&&!!ke[pl(e)]},Xo=xr(Al),Jo=xr(function(e,t){return e<=t});function Qo(e){if(!e)return[];if(Oo(e))return $o(e)?zt(e):mr(e);if(ft&&e[ft])return function(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}(e[ft]());var t=ei(e);return(t==v?Ft:t==E?jt:Na)(e)}function ea(e){return e?(e=la(e))===1/0||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function ta(e){var t=ea(e),n=t%1;return t==t?n?t-n:t:0}function na(e){return e?$n(ta(e),0,4294967295):0}function la(e){if("number"==typeof e)return e;if(Go(e))return NaN;if(Ho(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=Ho(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 ra(e){return hr(e,ga(e))}function ia(e){return null==e?"":Gl(e)}var oa=_r(function(e,t){if(ci(t)||Oo(t))hr(t,_a(t),e);else for(var n in t)Se.call(t,n)&&Wn(e,n,t[n])}),aa=_r(function(e,t){hr(t,ga(t),e)}),ua=_r(function(e,t,n,l){hr(t,ga(t),e,l)}),ca=_r(function(e,t,n,l){hr(t,_a(t),e,l)}),sa=Wr(qn),da=kl(function(e,t){e=ve(e);var n=-1,l=t.length,r=l>2?t[2]:void 0;for(r&&ii(t[0],t[1],r)&&(l=1);++n<l;)for(var i=t[n],o=ga(i),a=-1,u=o.length;++a<u;){var c=o[a],s=e[c];(void 0===s||No(s,_e[c])&&!Se.call(e,c))&&(e[c]=i[c])}return e}),pa=kl(function(e){return e.push(void 0,Ur),tt(Sa,void 0,e)});function va(e,t,n){var l=null==e?void 0:sl(e,t);return void 0===l?n:l}function fa(e,t){return null!=e&&ti(e,t,ml)}var ma=Nr(function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=Ae.call(t)),e[t]=n},Ha(Va)),ha=Nr(function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=Ae.call(t)),Se.call(e,t)?e[t].push(n):e[t]=[n]},$r),Ea=kl(El);function _a(e){return Oo(e)?Fn(e):Tl(e)}function ga(e){return Oo(e)?Fn(e,!0):function(e){if(!Ho(e))return function(e){var t=[];if(null!=e)for(var n in ve(e))t.push(n);return t}(e);var t=ci(e),n=[];for(var l in e)("constructor"!=l||!t&&Se.call(e,l))&&n.push(l);return n}(e)}var ya=_r(function(e,t,n){Pl(e,t,n)}),Sa=_r(function(e,t,n,l){Pl(e,t,n,l)}),ba=Wr(function(e,t){var n={};if(null==e)return n;var l=!1;t=ct(t,function(t){return t=ir(t,e),l||(l=t.length>1),t}),hr(e,Vr(e),n),l&&(n=Gn(n,7,jr));for(var r=t.length;r--;)Xl(n,t[r]);return n}),Ta=Wr(function(e,t){return null==e?{}:function(e,t){return wl(e,t,function(t,n){return fa(e,n)})}(e,t)});function Aa(e,t){if(null==e)return{};var n=ct(Vr(e),function(e){return[e]});return t=$r(t),wl(e,n,function(e,n){return t(e,n[0])})}var Ca=kr(_a),Da=kr(ga);function Na(e){return null==e?[]:Pt(e,_a(e))}var Pa=br(function(e,t,n){return t=t.toLowerCase(),e+(n?Ra(t):t)});function Ra(e){return Fa(ia(e).toLowerCase())}function Ia(e){return(e=ia(e))&&e.replace(ae,Ot).replace(Re,"")}var wa=br(function(e,t,n){return e+(n?"-":"")+t.toLowerCase()}),xa=br(function(e,t,n){return e+(n?" ":"")+t.toLowerCase()}),Oa=Sr("toLowerCase"),La=br(function(e,t,n){return e+(n?"_":"")+t.toLowerCase()}),Ma=br(function(e,t,n){return e+(n?" ":"")+Fa(t)}),ka=br(function(e,t,n){return e+(n?" ":"")+t.toUpperCase()}),Fa=Sr("toUpperCase");function Ba(e,t,n){return e=ia(e),void 0===(t=n?void 0:t)?function(e){return Oe.test(e)}(e)?function(e){return e.match(we)||[]}(e):function(e){return e.match(X)||[]}(e):e.match(t)||[]}var Ua=kl(function(e,t){try{return tt(e,void 0,t)}catch(e){return Fo(e)?e:new se(e)}}),ja=Wr(function(e,t){return lt(t,function(t){t=Ti(t),Yn(e,t,ho(e[t],e))}),e});function Ha(e){return function(){return e}}var Wa=Cr(),za=Cr(!0);function Va(e){return e}function Ka(e){return bl("function"==typeof e?e:Gn(e,1))}var Ya=kl(function(e,t){return function(n){return El(n,e,t)}}),qa=kl(function(e,t){return function(n){return El(e,n,t)}});function $a(e,t,n){var l=_a(t),r=cl(t,l);null!=n||Ho(t)&&(r.length||!l.length)||(n=t,t=e,e=this,r=cl(t,_a(t)));var i=!(Ho(n)&&"chain"in n&&!n.chain),o=Bo(e);return lt(r,function(n){var l=t[n];e[n]=l,o&&(e.prototype[n]=function(){var t=this.__chain__;if(i||t){var n=e(this.__wrapped__),r=n.__actions__=mr(this.__actions__);return r.push({func:l,args:arguments,thisArg:e}),n.__chain__=t,n}return l.apply(e,st([this.value()],arguments))})}),e}function Ga(){}var Za=Rr(ct),Xa=Rr(it),Ja=Rr(vt);function Qa(e){return oi(e)?St(Ti(e)):function(e){return function(t){return sl(t,e)}}(e)}var eu=wr(),tu=wr(!0);function nu(){return[]}function lu(){return!1}var ru,iu=Pr(function(e,t){return e+t},0),ou=Lr("ceil"),au=Pr(function(e,t){return e/t},1),uu=Lr("floor"),cu=Pr(function(e,t){return e*t},1),su=Lr("round"),du=Pr(function(e,t){return e-t},0);return Nn.after=function(e,t){if("function"!=typeof t)throw new he(n);return e=ta(e),function(){if(--e<1)return t.apply(this,arguments)}},Nn.ary=fo,Nn.assign=oa,Nn.assignIn=aa,Nn.assignInWith=ua,Nn.assignWith=ca,Nn.at=sa,Nn.before=mo,Nn.bind=ho,Nn.bindAll=ja,Nn.bindKey=Eo,Nn.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return wo(e)?e:[e]},Nn.chain=Ji,Nn.chunk=function(e,t,n){t=(n?ii(e,t,n):void 0===t)?1:rn(ta(t),0);var l=null==e?0:e.length;if(!l||t<1)return[];for(var r=0,i=0,o=p(Xt(l/t));r<l;)o[i++]=zl(e,r,r+=t);return o},Nn.compact=function(e){for(var t=-1,n=null==e?0:e.length,l=0,r=[];++t<n;){var i=e[t];i&&(r[l++]=i)}return r},Nn.concat=function(){var e=arguments.length;if(!e)return[];for(var t=p(e-1),n=arguments[0],l=e;l--;)t[l-1]=arguments[l];return st(wo(n)?mr(n):[n],rl(t,1))},Nn.cond=function(e){var t=null==e?0:e.length,l=$r();return e=t?ct(e,function(e){if("function"!=typeof e[1])throw new he(n);return[l(e[0]),e[1]]}):[],kl(function(n){for(var l=-1;++l<t;){var r=e[l];if(tt(r[0],this,n))return tt(r[1],this,n)}})},Nn.conforms=function(e){return function(e){var t=_a(e);return function(n){return Zn(n,e,t)}}(Gn(e,1))},Nn.constant=Ha,Nn.countBy=to,Nn.create=function(e,t){var n=Pn(e);return null==t?n:Kn(n,t)},Nn.curry=function e(t,n,l){var r=Fr(t,8,void 0,void 0,void 0,void 0,void 0,n=l?void 0:n);return r.placeholder=e.placeholder,r},Nn.curryRight=function e(t,n,l){var r=Fr(t,16,void 0,void 0,void 0,void 0,void 0,n=l?void 0:n);return r.placeholder=e.placeholder,r},Nn.debounce=_o,Nn.defaults=da,Nn.defaultsDeep=pa,Nn.defer=go,Nn.delay=yo,Nn.difference=Di,Nn.differenceBy=Ni,Nn.differenceWith=Pi,Nn.drop=function(e,t,n){var l=null==e?0:e.length;return l?zl(e,(t=n||void 0===t?1:ta(t))<0?0:t,l):[]},Nn.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:ta(t)))<0?0:t):[]},Nn.dropRightWhile=function(e,t){return e&&e.length?Ql(e,$r(t,3),!0,!0):[]},Nn.dropWhile=function(e,t){return e&&e.length?Ql(e,$r(t,3),!0):[]},Nn.fill=function(e,t,n,l){var r=null==e?0:e.length;return r?(n&&"number"!=typeof n&&ii(e,t,n)&&(n=0,l=r),function(e,t,n,l){var r=e.length;for((n=ta(n))<0&&(n=-n>r?0:r+n),(l=void 0===l||l>r?r:ta(l))<0&&(l+=r),l=n>l?0:na(l);n<l;)e[n++]=t;return e}(e,t,n,l)):[]},Nn.filter=function(e,t){return(wo(e)?ot:ll)(e,$r(t,3))},Nn.flatMap=function(e,t){return rl(co(e,t),1)},Nn.flatMapDeep=function(e,t){return rl(co(e,t),1/0)},Nn.flatMapDepth=function(e,t,n){return n=void 0===n?1:ta(n),rl(co(e,t),n)},Nn.flatten=wi,Nn.flattenDeep=function(e){return null!=e&&e.length?rl(e,1/0):[]},Nn.flattenDepth=function(e,t){return null!=e&&e.length?rl(e,t=void 0===t?1:ta(t)):[]},Nn.flip=function(e){return Fr(e,512)},Nn.flow=Wa,Nn.flowRight=za,Nn.fromPairs=function(e){for(var t=-1,n=null==e?0:e.length,l={};++t<n;){var r=e[t];l[r[0]]=r[1]}return l},Nn.functions=function(e){return null==e?[]:cl(e,_a(e))},Nn.functionsIn=function(e){return null==e?[]:cl(e,ga(e))},Nn.groupBy=oo,Nn.initial=function(e){return null!=e&&e.length?zl(e,0,-1):[]},Nn.intersection=Oi,Nn.intersectionBy=Li,Nn.intersectionWith=Mi,Nn.invert=ma,Nn.invertBy=ha,Nn.invokeMap=ao,Nn.iteratee=Ka,Nn.keyBy=uo,Nn.keys=_a,Nn.keysIn=ga,Nn.map=co,Nn.mapKeys=function(e,t){var n={};return t=$r(t,3),al(e,function(e,l,r){Yn(n,t(e,l,r),e)}),n},Nn.mapValues=function(e,t){var n={};return t=$r(t,3),al(e,function(e,l,r){Yn(n,l,t(e,l,r))}),n},Nn.matches=function(e){return Dl(Gn(e,1))},Nn.matchesProperty=function(e,t){return Nl(e,Gn(t,1))},Nn.memoize=So,Nn.merge=ya,Nn.mergeWith=Sa,Nn.method=Ya,Nn.methodOf=qa,Nn.mixin=$a,Nn.negate=bo,Nn.nthArg=function(e){return e=ta(e),kl(function(t){return Rl(t,e)})},Nn.omit=ba,Nn.omitBy=function(e,t){return Aa(e,bo($r(t)))},Nn.once=function(e){return mo(2,e)},Nn.orderBy=function(e,t,n,l){return null==e?[]:(wo(t)||(t=null==t?[]:[t]),wo(n=l?void 0:n)||(n=null==n?[]:[n]),Il(e,t,n))},Nn.over=Za,Nn.overArgs=To,Nn.overEvery=Xa,Nn.overSome=Ja,Nn.partial=Ao,Nn.partialRight=Co,Nn.partition=so,Nn.pick=Ta,Nn.pickBy=Aa,Nn.property=Qa,Nn.propertyOf=function(e){return function(t){return null==e?void 0:sl(e,t)}},Nn.pull=Fi,Nn.pullAll=Bi,Nn.pullAllBy=function(e,t,n){return e&&e.length&&t&&t.length?xl(e,t,$r(n,2)):e},Nn.pullAllWith=function(e,t,n){return e&&e.length&&t&&t.length?xl(e,t,void 0,n):e},Nn.pullAt=Ui,Nn.range=eu,Nn.rangeRight=tu,Nn.rearg=Do,Nn.reject=function(e,t){return(wo(e)?ot:ll)(e,bo($r(t,3)))},Nn.remove=function(e,t){var n=[];if(!e||!e.length)return n;var l=-1,r=[],i=e.length;for(t=$r(t,3);++l<i;){var o=e[l];t(o,l,e)&&(n.push(o),r.push(l))}return Ol(e,r),n},Nn.rest=function(e,t){if("function"!=typeof e)throw new he(n);return kl(e,t=void 0===t?t:ta(t))},Nn.reverse=ji,Nn.sampleSize=function(e,t,n){return t=(n?ii(e,t,n):void 0===t)?1:ta(t),(wo(e)?Un:Bl)(e,t)},Nn.set=function(e,t,n){return null==e?e:Ul(e,t,n)},Nn.setWith=function(e,t,n,l){return l="function"==typeof l?l:void 0,null==e?e:Ul(e,t,n,l)},Nn.shuffle=function(e){return(wo(e)?jn:Wl)(e)},Nn.slice=function(e,t,n){var l=null==e?0:e.length;return l?(n&&"number"!=typeof n&&ii(e,t,n)?(t=0,n=l):(t=null==t?0:ta(t),n=void 0===n?l:ta(n)),zl(e,t,n)):[]},Nn.sortBy=po,Nn.sortedUniq=function(e){return e&&e.length?ql(e):[]},Nn.sortedUniqBy=function(e,t){return e&&e.length?ql(e,$r(t,2)):[]},Nn.split=function(e,t,n){return n&&"number"!=typeof n&&ii(e,t,n)&&(t=n=void 0),(n=void 0===n?4294967295:n>>>0)?(e=ia(e))&&("string"==typeof t||null!=t&&!Yo(t))&&!(t=Gl(t))&&kt(e)?ar(zt(e),0,n):e.split(t,n):[]},Nn.spread=function(e,t){if("function"!=typeof e)throw new he(n);return t=null==t?0:rn(ta(t),0),kl(function(n){var l=n[t],r=ar(n,0,t);return l&&st(r,l),tt(e,this,r)})},Nn.tail=function(e){var t=null==e?0:e.length;return t?zl(e,1,t):[]},Nn.take=function(e,t,n){return e&&e.length?zl(e,0,(t=n||void 0===t?1:ta(t))<0?0:t):[]},Nn.takeRight=function(e,t,n){var l=null==e?0:e.length;return l?zl(e,(t=l-(t=n||void 0===t?1:ta(t)))<0?0:t,l):[]},Nn.takeRightWhile=function(e,t){return e&&e.length?Ql(e,$r(t,3),!1,!0):[]},Nn.takeWhile=function(e,t){return e&&e.length?Ql(e,$r(t,3)):[]},Nn.tap=function(e,t){return t(e),e},Nn.throttle=function(e,t,l){var r=!0,i=!0;if("function"!=typeof e)throw new he(n);return Ho(l)&&(r="leading"in l?!!l.leading:r,i="trailing"in l?!!l.trailing:i),_o(e,t,{leading:r,maxWait:t,trailing:i})},Nn.thru=Qi,Nn.toArray=Qo,Nn.toPairs=Ca,Nn.toPairsIn=Da,Nn.toPath=function(e){return wo(e)?ct(e,Ti):Go(e)?[e]:mr(bi(ia(e)))},Nn.toPlainObject=ra,Nn.transform=function(e,t,n){var l=wo(e),r=l||Mo(e)||Zo(e);if(t=$r(t,4),null==n){var i=e&&e.constructor;n=r?l?new i:[]:Ho(e)&&Bo(i)?Pn(We(e)):{}}return(r?lt:al)(e,function(e,l,r){return t(n,e,l,r)}),n},Nn.unary=function(e){return fo(e,1)},Nn.union=Hi,Nn.unionBy=Wi,Nn.unionWith=zi,Nn.uniq=function(e){return e&&e.length?Zl(e):[]},Nn.uniqBy=function(e,t){return e&&e.length?Zl(e,$r(t,2)):[]},Nn.uniqWith=function(e,t){return t="function"==typeof t?t:void 0,e&&e.length?Zl(e,void 0,t):[]},Nn.unset=function(e,t){return null==e||Xl(e,t)},Nn.unzip=Vi,Nn.unzipWith=Ki,Nn.update=function(e,t,n){return null==e?e:Jl(e,t,rr(n))},Nn.updateWith=function(e,t,n,l){return l="function"==typeof l?l:void 0,null==e?e:Jl(e,t,rr(n),l)},Nn.values=Na,Nn.valuesIn=function(e){return null==e?[]:Pt(e,ga(e))},Nn.without=Yi,Nn.words=Ba,Nn.wrap=function(e,t){return Ao(rr(t),e)},Nn.xor=qi,Nn.xorBy=$i,Nn.xorWith=Gi,Nn.zip=Zi,Nn.zipObject=function(e,t){return nr(e||[],t||[],Wn)},Nn.zipObjectDeep=function(e,t){return nr(e||[],t||[],Ul)},Nn.zipWith=Xi,Nn.entries=Ca,Nn.entriesIn=Da,Nn.extend=aa,Nn.extendWith=ua,$a(Nn,Nn),Nn.add=iu,Nn.attempt=Ua,Nn.camelCase=Pa,Nn.capitalize=Ra,Nn.ceil=ou,Nn.clamp=function(e,t,n){return void 0===n&&(n=t,t=void 0),void 0!==n&&(n=(n=la(n))==n?n:0),void 0!==t&&(t=(t=la(t))==t?t:0),$n(la(e),t,n)},Nn.clone=function(e){return Gn(e,4)},Nn.cloneDeep=function(e){return Gn(e,5)},Nn.cloneDeepWith=function(e,t){return Gn(e,5,t="function"==typeof t?t:void 0)},Nn.cloneWith=function(e,t){return Gn(e,4,t="function"==typeof t?t:void 0)},Nn.conformsTo=function(e,t){return null==t||Zn(e,t,_a(t))},Nn.deburr=Ia,Nn.defaultTo=function(e,t){return null==e||e!=e?t:e},Nn.divide=au,Nn.endsWith=function(e,t,n){e=ia(e),t=Gl(t);var l=e.length,r=n=void 0===n?l:$n(ta(n),0,l);return(n-=t.length)>=0&&e.slice(n,r)==t},Nn.eq=No,Nn.escape=function(e){return(e=ia(e))&&F.test(e)?e.replace(M,Lt):e},Nn.escapeRegExp=function(e){return(e=ia(e))&&K.test(e)?e.replace(V,"\\$&"):e},Nn.every=function(e,t,n){var l=wo(e)?it:tl;return n&&ii(e,t,n)&&(t=void 0),l(e,$r(t,3))},Nn.find=no,Nn.findIndex=Ri,Nn.findKey=function(e,t){return mt(e,$r(t,3),al)},Nn.findLast=lo,Nn.findLastIndex=Ii,Nn.findLastKey=function(e,t){return mt(e,$r(t,3),ul)},Nn.floor=uu,Nn.forEach=ro,Nn.forEachRight=io,Nn.forIn=function(e,t){return null==e?e:il(e,$r(t,3),ga)},Nn.forInRight=function(e,t){return null==e?e:ol(e,$r(t,3),ga)},Nn.forOwn=function(e,t){return e&&al(e,$r(t,3))},Nn.forOwnRight=function(e,t){return e&&ul(e,$r(t,3))},Nn.get=va,Nn.gt=Po,Nn.gte=Ro,Nn.has=function(e,t){return null!=e&&ti(e,t,fl)},Nn.hasIn=fa,Nn.head=xi,Nn.identity=Va,Nn.includes=function(e,t,n,l){e=Oo(e)?e:Na(e),n=n&&!l?ta(n):0;var r=e.length;return n<0&&(n=rn(r+n,0)),$o(e)?n<=r&&e.indexOf(t,n)>-1:!!r&&Et(e,t,n)>-1},Nn.indexOf=function(e,t,n){var l=null==e?0:e.length;if(!l)return-1;var r=null==n?0:ta(n);return r<0&&(r=rn(l+r,0)),Et(e,t,r)},Nn.inRange=function(e,t,n){return t=ea(t),void 0===n?(n=t,t=0):n=ea(n),function(e,t,n){return e>=on(t,n)&&e<rn(t,n)}(e=la(e),t,n)},Nn.invoke=Ea,Nn.isArguments=Io,Nn.isArray=wo,Nn.isArrayBuffer=xo,Nn.isArrayLike=Oo,Nn.isArrayLikeObject=Lo,Nn.isBoolean=function(e){return!0===e||!1===e||Wo(e)&&pl(e)==a},Nn.isBuffer=Mo,Nn.isDate=ko,Nn.isElement=function(e){return Wo(e)&&1===e.nodeType&&!Ko(e)},Nn.isEmpty=function(e){if(null==e)return!0;if(Oo(e)&&(wo(e)||"string"==typeof e||"function"==typeof e.splice||Mo(e)||Zo(e)||Io(e)))return!e.length;var t=ei(e);if(t==v||t==E)return!e.size;if(ci(e))return!Tl(e).length;for(var n in e)if(Se.call(e,n))return!1;return!0},Nn.isEqual=function(e,t){return gl(e,t)},Nn.isEqualWith=function(e,t,n){var l=(n="function"==typeof n?n:void 0)?n(e,t):void 0;return void 0===l?gl(e,t,void 0,n):!!l},Nn.isError=Fo,Nn.isFinite=function(e){return"number"==typeof e&&tn(e)},Nn.isFunction=Bo,Nn.isInteger=Uo,Nn.isLength=jo,Nn.isMap=zo,Nn.isMatch=function(e,t){return e===t||yl(e,t,Zr(t))},Nn.isMatchWith=function(e,t,n){return n="function"==typeof n?n:void 0,yl(e,t,Zr(t),n)},Nn.isNaN=function(e){return Vo(e)&&e!=+e},Nn.isNative=function(e){if(ui(e))throw new se("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return Sl(e)},Nn.isNil=function(e){return null==e},Nn.isNull=function(e){return null===e},Nn.isNumber=Vo,Nn.isObject=Ho,Nn.isObjectLike=Wo,Nn.isPlainObject=Ko,Nn.isRegExp=Yo,Nn.isSafeInteger=function(e){return Uo(e)&&e>=-9007199254740991&&e<=9007199254740991},Nn.isSet=qo,Nn.isString=$o,Nn.isSymbol=Go,Nn.isTypedArray=Zo,Nn.isUndefined=function(e){return void 0===e},Nn.isWeakMap=function(e){return Wo(e)&&ei(e)==y},Nn.isWeakSet=function(e){return Wo(e)&&"[object WeakSet]"==pl(e)},Nn.join=function(e,t){return null==e?"":nn.call(e,t)},Nn.kebabCase=wa,Nn.last=ki,Nn.lastIndexOf=function(e,t,n){var l=null==e?0:e.length;if(!l)return-1;var r=l;return void 0!==n&&(r=(r=ta(n))<0?rn(l+r,0):on(r,l-1)),t==t?function(e,t,n){for(var l=n+1;l--;)if(e[l]===t)return l;return l}(e,t,r):ht(e,gt,r,!0)},Nn.lowerCase=xa,Nn.lowerFirst=Oa,Nn.lt=Xo,Nn.lte=Jo,Nn.max=function(e){return e&&e.length?nl(e,Va,vl):void 0},Nn.maxBy=function(e,t){return e&&e.length?nl(e,$r(t,2),vl):void 0},Nn.mean=function(e){return yt(e,Va)},Nn.meanBy=function(e,t){return yt(e,$r(t,2))},Nn.min=function(e){return e&&e.length?nl(e,Va,Al):void 0},Nn.minBy=function(e,t){return e&&e.length?nl(e,$r(t,2),Al):void 0},Nn.stubArray=nu,Nn.stubFalse=lu,Nn.stubObject=function(){return{}},Nn.stubString=function(){return""},Nn.stubTrue=function(){return!0},Nn.multiply=cu,Nn.nth=function(e,t){return e&&e.length?Rl(e,ta(t)):void 0},Nn.noConflict=function(){return ze._===this&&(ze._=De),this},Nn.noop=Ga,Nn.now=vo,Nn.pad=function(e,t,n){e=ia(e);var l=(t=ta(t))?Wt(e):0;if(!t||l>=t)return e;var r=(t-l)/2;return Ir(Jt(r),n)+e+Ir(Xt(r),n)},Nn.padEnd=function(e,t,n){e=ia(e);var l=(t=ta(t))?Wt(e):0;return t&&l<t?e+Ir(t-l,n):e},Nn.padStart=function(e,t,n){e=ia(e);var l=(t=ta(t))?Wt(e):0;return t&&l<t?Ir(t-l,n)+e:e},Nn.parseInt=function(e,t,n){return n||null==t?t=0:t&&(t=+t),un(ia(e).replace(Y,""),t||0)},Nn.random=function(e,t,n){if(n&&"boolean"!=typeof n&&ii(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=ea(e),void 0===t?(t=e,e=0):t=ea(t)),e>t){var l=e;e=t,t=l}if(n||e%1||t%1){var r=cn();return on(e+r*(t-e+Ue("1e-"+((r+"").length-1))),t)}return Ll(e,t)},Nn.reduce=function(e,t,n){var l=wo(e)?dt:Tt,r=arguments.length<3;return l(e,$r(t,4),n,r,Qn)},Nn.reduceRight=function(e,t,n){var l=wo(e)?pt:Tt,r=arguments.length<3;return l(e,$r(t,4),n,r,el)},Nn.repeat=function(e,t,n){return t=(n?ii(e,t,n):void 0===t)?1:ta(t),Ml(ia(e),t)},Nn.replace=function(){var e=arguments,t=ia(e[0]);return e.length<3?t:t.replace(e[1],e[2])},Nn.result=function(e,t,n){var l=-1,r=(t=ir(t,e)).length;for(r||(r=1,e=void 0);++l<r;){var i=null==e?void 0:e[Ti(t[l])];void 0===i&&(l=r,i=n),e=Bo(i)?i.call(e):i}return e},Nn.round=su,Nn.runInContext=e,Nn.sample=function(e){return(wo(e)?Bn:Fl)(e)},Nn.size=function(e){if(null==e)return 0;if(Oo(e))return $o(e)?Wt(e):e.length;var t=ei(e);return t==v||t==E?e.size:Tl(e).length},Nn.snakeCase=La,Nn.some=function(e,t,n){var l=wo(e)?vt:Vl;return n&&ii(e,t,n)&&(t=void 0),l(e,$r(t,3))},Nn.sortedIndex=function(e,t){return Kl(e,t)},Nn.sortedIndexBy=function(e,t,n){return Yl(e,t,$r(n,2))},Nn.sortedIndexOf=function(e,t){var n=null==e?0:e.length;if(n){var l=Kl(e,t);if(l<n&&No(e[l],t))return l}return-1},Nn.sortedLastIndex=function(e,t){return Kl(e,t,!0)},Nn.sortedLastIndexBy=function(e,t,n){return Yl(e,t,$r(n,2),!0)},Nn.sortedLastIndexOf=function(e,t){if(null!=e&&e.length){var n=Kl(e,t,!0)-1;if(No(e[n],t))return n}return-1},Nn.startCase=Ma,Nn.startsWith=function(e,t,n){return e=ia(e),n=null==n?0:$n(ta(n),0,e.length),t=Gl(t),e.slice(n,n+t.length)==t},Nn.subtract=du,Nn.sum=function(e){return e&&e.length?At(e,Va):0},Nn.sumBy=function(e,t){return e&&e.length?At(e,$r(t,2)):0},Nn.template=function(e,t,n){var l=Nn.templateSettings;n&&ii(e,t,n)&&(t=void 0),e=ia(e),t=ua({},t,l,Br);var r,i,o=ua({},t.imports,l.imports,Br),a=_a(o),u=Pt(o,a),c=0,s=t.interpolate||ue,d="__p += '",p=fe((t.escape||ue).source+"|"+s.source+"|"+(s===j?ee:ue).source+"|"+(t.evaluate||ue).source+"|$","g"),v="//# sourceURL="+(Se.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Me+"]")+"\n";e.replace(p,function(t,n,l,o,a,u){return l||(l=o),d+=e.slice(c,u).replace(ce,Mt),n&&(r=!0,d+="' +\n__e("+n+") +\n'"),a&&(i=!0,d+="';\n"+a+";\n__p += '"),l&&(d+="' +\n((__t = ("+l+")) == null ? '' : __t) +\n'"),c=u+t.length,t}),d+="';\n";var f=Se.call(t,"variable")&&t.variable;if(f){if(J.test(f))throw new se("Invalid `variable` option passed into `_.template`")}else d="with (obj) {\n"+d+"\n}\n";d=(i?d.replace(w,""):d).replace(x,"$1").replace(O,"$1;"),d="function("+(f||"obj")+") {\n"+(f?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(r?", __e = _.escape":"")+(i?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+d+"return __p\n}";var m=Ua(function(){return de(a,v+"return "+d).apply(void 0,u)});if(m.source=d,Fo(m))throw m;return m},Nn.times=function(e,t){if((e=ta(e))<1||e>9007199254740991)return[];var n=4294967295,l=on(e,4294967295);e-=4294967295;for(var r=Ct(l,t=$r(t));++n<e;)t(n);return r},Nn.toFinite=ea,Nn.toInteger=ta,Nn.toLength=na,Nn.toLower=function(e){return ia(e).toLowerCase()},Nn.toNumber=la,Nn.toSafeInteger=function(e){return e?$n(ta(e),-9007199254740991,9007199254740991):0===e?e:0},Nn.toString=ia,Nn.toUpper=function(e){return ia(e).toUpperCase()},Nn.trim=function(e,t,n){if((e=ia(e))&&(n||void 0===t))return Dt(e);if(!e||!(t=Gl(t)))return e;var l=zt(e),r=zt(t);return ar(l,It(l,r),wt(l,r)+1).join("")},Nn.trimEnd=function(e,t,n){if((e=ia(e))&&(n||void 0===t))return e.slice(0,Vt(e)+1);if(!e||!(t=Gl(t)))return e;var l=zt(e);return ar(l,0,wt(l,zt(t))+1).join("")},Nn.trimStart=function(e,t,n){if((e=ia(e))&&(n||void 0===t))return e.replace(Y,"");if(!e||!(t=Gl(t)))return e;var l=zt(e);return ar(l,It(l,zt(t))).join("")},Nn.truncate=function(e,t){var n=30,l="...";if(Ho(t)){var r="separator"in t?t.separator:r;n="length"in t?ta(t.length):n,l="omission"in t?Gl(t.omission):l}var i=(e=ia(e)).length;if(kt(e)){var o=zt(e);i=o.length}if(n>=i)return e;var a=n-Wt(l);if(a<1)return l;var u=o?ar(o,0,a).join(""):e.slice(0,a);if(void 0===r)return u+l;if(o&&(a+=u.length-a),Yo(r)){if(e.slice(a).search(r)){var c,s=u;for(r.global||(r=fe(r.source,ia(te.exec(r))+"g")),r.lastIndex=0;c=r.exec(s);)var d=c.index;u=u.slice(0,void 0===d?a:d)}}else if(e.indexOf(Gl(r),a)!=a){var p=u.lastIndexOf(r);p>-1&&(u=u.slice(0,p))}return u+l},Nn.unescape=function(e){return(e=ia(e))&&k.test(e)?e.replace(L,Kt):e},Nn.uniqueId=function(e){var t=++be;return ia(e)+t},Nn.upperCase=ka,Nn.upperFirst=Fa,Nn.each=ro,Nn.eachRight=io,Nn.first=xi,$a(Nn,(ru={},al(Nn,function(e,t){Se.call(Nn.prototype,t)||(ru[t]=e)}),ru),{chain:!1}),Nn.VERSION="4.17.21",lt(["bind","bindKey","curry","curryRight","partial","partialRight"],function(e){Nn[e].placeholder=Nn}),lt(["drop","take"],function(e,t){wn.prototype[e]=function(n){n=void 0===n?1:rn(ta(n),0);var l=this.__filtered__&&!t?new wn(this):this.clone();return l.__filtered__?l.__takeCount__=on(n,l.__takeCount__):l.__views__.push({size:on(n,4294967295),type:e+(l.__dir__<0?"Right":"")}),l},wn.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}}),lt(["filter","map","takeWhile"],function(e,t){var n=t+1,l=1==n||3==n;wn.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:$r(e,3),type:n}),t.__filtered__=t.__filtered__||l,t}}),lt(["head","last"],function(e,t){var n="take"+(t?"Right":"");wn.prototype[e]=function(){return this[n](1).value()[0]}}),lt(["initial","tail"],function(e,t){var n="drop"+(t?"":"Right");wn.prototype[e]=function(){return this.__filtered__?new wn(this):this[n](1)}}),wn.prototype.compact=function(){return this.filter(Va)},wn.prototype.find=function(e){return this.filter(e).head()},wn.prototype.findLast=function(e){return this.reverse().find(e)},wn.prototype.invokeMap=kl(function(e,t){return"function"==typeof e?new wn(this):this.map(function(n){return El(n,e,t)})}),wn.prototype.reject=function(e){return this.filter(bo($r(e)))},wn.prototype.slice=function(e,t){e=ta(e);var n=this;return n.__filtered__&&(e>0||t<0)?new wn(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),void 0!==t&&(n=(t=ta(t))<0?n.dropRight(-t):n.take(t-e)),n)},wn.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},wn.prototype.toArray=function(){return this.take(4294967295)},al(wn.prototype,function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),l=/^(?:head|last)$/.test(t),r=Nn[l?"take"+("last"==t?"Right":""):t],i=l||/^find/.test(t);r&&(Nn.prototype[t]=function(){var t=this.__wrapped__,o=l?[1]:arguments,a=t instanceof wn,u=o[0],c=a||wo(t),s=function(e){var t=r.apply(Nn,st([e],o));return l&&d?t[0]:t};c&&n&&"function"==typeof u&&1!=u.length&&(a=c=!1);var d=this.__chain__,p=!!this.__actions__.length,v=i&&!d,f=a&&!p;if(!i&&c){t=f?t:new wn(this);var m=e.apply(t,o);return m.__actions__.push({func:Qi,args:[s],thisArg:void 0}),new In(m,d)}return v&&f?e.apply(this,o):(m=this.thru(s),v?l?m.value()[0]:m.value():m)})}),lt(["pop","push","shift","sort","splice","unshift"],function(e){var t=Ee[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",l=/^(?:pop|shift)$/.test(e);Nn.prototype[e]=function(){var e=arguments;if(l&&!this.__chain__){var r=this.value();return t.apply(wo(r)?r:[],e)}return this[n](function(n){return t.apply(wo(n)?n:[],e)})}}),al(wn.prototype,function(e,t){var n=Nn[t];if(n){var l=n.name+"";Se.call(_n,l)||(_n[l]=[]),_n[l].push({name:t,func:n})}}),_n[Dr(void 0,2).name]=[{name:"wrapper",func:void 0}],wn.prototype.clone=function(){var e=new wn(this.__wrapped__);return e.__actions__=mr(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=mr(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=mr(this.__views__),e},wn.prototype.reverse=function(){if(this.__filtered__){var e=new wn(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},wn.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,n=wo(e),l=t<0,r=n?e.length:0,i=function(e,t,n){for(var l=-1,r=n.length;++l<r;){var i=n[l],o=i.size;switch(i.type){case"drop":e+=o;break;case"dropRight":t-=o;break;case"take":t=on(t,e+o);break;case"takeRight":e=rn(e,t-o)}}return{start:e,end:t}}(0,r,this.__views__),o=i.start,a=i.end,u=a-o,c=l?a:o-1,s=this.__iteratees__,d=s.length,p=0,v=on(u,this.__takeCount__);if(!n||!l&&r==u&&v==u)return er(e,this.__actions__);var f=[];e:for(;u--&&p<v;){for(var m=-1,h=e[c+=t];++m<d;){var E=s[m],_=E.type,g=(0,E.iteratee)(h);if(2==_)h=g;else if(!g){if(1==_)continue e;break e}}f[p++]=h}return f},Nn.prototype.at=eo,Nn.prototype.chain=function(){return Ji(this)},Nn.prototype.commit=function(){return new In(this.value(),this.__chain__)},Nn.prototype.next=function(){void 0===this.__values__&&(this.__values__=Qo(this.value()));var e=this.__index__>=this.__values__.length;return{done:e,value:e?void 0:this.__values__[this.__index__++]}},Nn.prototype.plant=function(e){for(var t,n=this;n instanceof Rn;){var l=Ci(n);l.__index__=0,l.__values__=void 0,t?r.__wrapped__=l:t=l;var r=l;n=n.__wrapped__}return r.__wrapped__=e,t},Nn.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof wn){var t=e;return this.__actions__.length&&(t=new wn(this)),(t=t.reverse()).__actions__.push({func:Qi,args:[ji],thisArg:void 0}),new In(t,this.__chain__)}return this.thru(ji)},Nn.prototype.toJSON=Nn.prototype.valueOf=Nn.prototype.value=function(){return er(this.__wrapped__,this.__actions__)},Nn.prototype.first=Nn.prototype.head,ft&&(Nn.prototype[ft]=function(){return this}),Nn}();Ke?((Ke.exports=Yt)._=Yt,Ve._=Yt):ze._=Yt}).call(p)});const Kl=e=>{var t,r;let{t:i,formData:o,applicationData:a,docs:u,bpaActionsDetails:c}=e;const s=(null==a?void 0:a.status)||"",d=(null==c||null===(t=c.data)||void 0===t?void 0:t.nextActions)||[],p=Digit.ULBService.getStateId(),[v,f]=n.useState((null==o||null===(r=o.documents)||void 0===r?void 0:r.documents)||[]),[m,h]=n.useState(null),[E,_]=n.useState([]),[g,y]=n.useState(!0),[S,b]=n.useState(!1),[T,A]=n.useState(!1),{isLoading:C,data:D}=Digit.Hooks.obps.useMDMS(p,"BPA",["DocTypeMapping"]),{isLoading:N,data:P}=Digit.Hooks.obps.useMDMS(p,"common-masters",["DocumentType"]);return n.useEffect(()=>{var e,t,n,l;let r=[];var i,o;null!=D&&null!==(e=D.BPA)&&void 0!==e&&e.DocTypeMapping&&(r=null==D||null===(i=D.BPA)||void 0===i||null===(o=i.DocTypeMapping)||void 0===o?void 0:o.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 c=[];null===(t=r)||void 0===t||null===(n=t[0])||void 0===n||null===(l=n.docTypes)||void 0===l||l.forEach(e=>{var t,n,l,r;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===(r=l.values)||void 0===r||r.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)}),c.push(e)}),sessionStorage.setItem("BPA_DOCUMENTS",JSON.stringify(c)),_(c)},[!C,!N]),n.useEffect(()=>{let e=0;E.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)}),y("0"!=e&&0!=e||!(v.length>0))},[v,S]),n.useEffect(()=>{A("DOC_VERIFICATION_INPROGRESS"===s&&(null==d?void 0:d.length)>0)},[a,c]),l.createElement("div",null,null==E?void 0:E.map((e,t)=>l.createElement("div",null,l.createElement(Yl,{key:t,index:t,document:e,t:i,error:m,setError:h,setDocuments:f,documents:v,setCheckRequiredFields:b,applicationStatus:s,actions:d,bpaTaxDocuments:E,checkEnablingDocs:T}))))};function Yl(e){var r,i;let{t:o,document:a,setDocuments:c,documents:s,index:d,bpaTaxDocuments:p,checkEnablingDocs:v}=e;const f=null==s?void 0:s.filter(e=>{var t;return null==e||null===(t=e.documentType)||void 0===t?void 0:t.includes(null==a?void 0:a.code)})[0],m=Digit.ULBService.getStateId(),[h,E]=n.useState(f?u({},f,{active:!0,code:null==f?void 0:f.documentType,i18nKey:null==f?void 0:f.documentType}):1===(null==a||null===(r=a.dropdownData)||void 0===r?void 0:r.length)?null==a?void 0:a.dropdownData[0]:{}),[_,g]=n.useState(null),[y,S]=n.useState(()=>(null==f?void 0:f.fileStoreId)||null),[b,T]=n.useState([]);return n.useEffect(()=>{null!=h&&h.code&&c(e=>{var t;const n=null==e?void 0:e.filter(e=>(null==e?void 0:e.documentType)!==(null==h?void 0:h.code));return 0===(null==y?void 0:y.length)||null===y?n:[...null==n?void 0:n.filter(e=>(null==e?void 0:e.fileStoreId)!==y),{documentType:null==h?void 0:h.code,fileStoreId:y,documentUid:y,fileName:(null==_?void 0:_.name)||"",id:s?null===(t=s.find(e=>e.documentType===(null==h?void 0:h.code)))||void 0===t?void 0:t.id:void 0}]})},[y,h]),n.useEffect(()=>{try{b.length>0&&(sessionStorage.removeItem("BPA_DOCUMENTS"),a.newUploadedDocs=[],b.map(e=>{var t,n,l;null!=h&&h.code&&a.newUploadedDocs.push({documentType:null==h?void 0:h.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})}),p[d]=a,sessionStorage.setItem("BPA_DOCUMENTS",JSON.stringify(p)))}catch(e){Promise.reject(e)}},[b,h]),n.useEffect(()=>{},[_]),l.createElement("div",{style:{marginBottom:"24px",maxWidth:"950px",minWidth:"280px",background:"#FAFAFA",borderRadius:"4px",border:"1px solid #D6D5D4",padding:"8px"}},l.createElement(t.CardSubHeader,{style:{marginBottom:"8px",paddingBottom:"9px",color:"#0B0C0C",fontSize:"16px",lineHeight:"19px"}},""+o(null==a?void 0:a.code)),(null==a||null===(i=a.uploadedDocuments)||void 0===i?void 0:i.length)&&l.createElement(Vl,{documents:null==a?void 0:a.uploadedDocuments,svgStyles:{width:"100px",height:"100px",viewBox:"0 0 25 25",minWidth:"100px"}}),v?l.createElement("div",{style:{marginTop:"20px"}},l.createElement(t.LabelFieldPair,{style:{width:"100%"}},l.createElement(t.CardLabel,{style:{marginTop:"-10px",width:"100%"}},null!=a&&a.required?o(null==a?void 0:a.code)+"* ":""+o(null==a?void 0:a.code)),l.createElement(t.Dropdown,{className:"form-field",t:o,isMandatory:!1,option:null==a?void 0:a.dropdownData,selected:h,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&&T(l),function(e){e&&g(e.file)}(l[l.length-1])})(0,e),t:o,allowedFileTypesRegex:/(.*?)(jpg|jpeg|png|image|pdf)$/i,allowedMaxSizeInMB:5,acceptFiles:"image/*, .pdf, .png, .jpeg, .jpg"})))):null)}function ql(e){let{fiReport:n,isCitizen:i=!1}=e;const{t:o}=r.useTranslation();return l.createElement(l.Fragment,null,l.createElement("div",{style:{marginTop:"10px"}},l.createElement(i?t.CardHeader:t.CardSectionHeader,{style:{fontSize:"24px"}},""+o("BPA_FI_REPORT")),n.map((e,r)=>{var i,a,u,c,s,d;return l.createElement("div",{style:{background:"#FAFAFA",border:"1px solid #D6D5D4",padding:"8px",borderRadius:"4px",maxWidth:"950px",minWidth:"280px",marginBottom:"24px"}},l.createElement(t.StatusTable,null,l.createElement(t.CardSectionHeader,{style:{fontSize:"20px"}},1==(null==n?void 0:n.length)?""+o("BPA_FI_REPORT"):o("BPA_FI_REPORT")+" - "+(r+1)),l.createElement(t.Row,{className:"border-none",label:""+o("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:""+o("BPA_FI_TIME_LABEL"),text:null!=e&&e.time?null==e?void 0:e.time:"NA"}),(null==e||null===(c=e.questions)||void 0===c?void 0:c.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:""+o(""+e.question),text:null!=e&&e.value?null==e?void 0:e.value:"NA"}),l.createElement(t.Row,{className:"border-none",label:""+o("BPA_ENTER_REMARKS"),text:e.remarks?e.remarks:"NA"})))),l.createElement(Vl,{documents:(d=null==e?void 0:e.docs,[{title:"BPA_DOCUMENT_DETAILS_LABEL",values:null==d?void 0:d.map(e=>{var t;return{title:null==e||null===(t=e.documentType)||void 0===t?void 0:t.replaceAll(".","_"),documentType:null==e?void 0:e.documentType,documentUid:null==e?void 0:e.documentUid,fileStoreId:null==e?void 0:e.fileStoreId,id:null==e?void 0:e.id,url:null==e?void 0:e.url}})}]),svgStyles:{width:"100px",height:"100px",viewBox:"0 0 25 25",minWidth:"100px"}})))})))}function $l(e){let{t:r,document:i,setNocDocuments:o,setError:a,nocDocuments:u}=e;const c=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(),[d,p]=n.useState(),[v,f]=n.useState(null),[m,h]=n.useState(()=>(null==c?void 0:c.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&&o(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==m?void 0:m.length)||null===m?n:[...null==n?void 0:n.filter(e=>(null==e?void 0:e.fileStoreId)!==m),{documentType:null==i||null===(t=i.dropdownData)||void 0===t?void 0:t[0].code,fileStoreId:m,documentUid:m,fileName:(null==v?void 0:v.name)||""}]})},[m]),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(r("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=v&&v.type&&!e.test(null==v?void 0:v.type))a(r("NOT_SUPPORTED_FILE_TYPE"));else{const e=$e(function(){return h(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?h(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):a(r("CS_FILE_UPLOAD_ERROR"))})},function(){a(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)}}()},[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?r("TL_BUTTON_UPLOAD FILE")+"*":""+r("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&&f(e.file)}(n[n.length-1])})(e),t:r,allowedFileTypesRegex:/(.*?)(jpg|jpeg|png|image|pdf)$/i,allowedMaxSizeInMB:5,acceptFiles:"image/*, .pdf, .png, .jpeg, .jpg"}))))}const Gl=e=>{var r;let{t:i,noc:o,docs:a,isNoc:u,applicationData:c,NOCdata:s,bpaActionsDetails:d}=e;Digit.ULBService.getStateId();const p=Digit.ULBService.getStateId(),v=(null==c?void 0:c.status)||"",f=(null==d||null===(r=d.data)||void 0===r?void 0:r.nextActions)||[],{data:m}=Digit.Hooks.obps.useMDMS(p,"NOC",["DocumentTypeMapping"],{enabled:u}),{data:h}=Digit.Hooks.obps.useMDMS(p,"BPA",["DocTypeMapping"],{enabled:!u}),{data:E}=Digit.Hooks.obps.useMDMS(p,"common-masters",["DocumentType"]),[_,g]=n.useState([]),[y,S]=n.useState([]),[b,T]=n.useState(!1),[A,C]=Digit.Hooks.useSessionStorage(null==o?void 0:o.nocType,[]),[D,N]=n.useState(null),P=window.location.href.includes("/employee/");return n.useEffect(()=>{var e;g(null==E||null===(e=E["common-masters"])||void 0===e?void 0:e.DocumentType)},[E]),n.useEffect(()=>{var e,t,n;let l,r=[];var i,a,s,d;l=u?null==m||null===(i=m.NOC)||void 0===i||null===(a=i.DocumentTypeMapping)||void 0===a?void 0:a.filter(e=>(null==e?void 0:e.applicationType)===(null==o?void 0:o.applicationType)&&(null==e?void 0:e.nocType)===(null==o?void 0:o.nocType)):null==h||null===(s=h.BPA)||void 0===s||null===(d=s.DocTypeMapping)||void 0===d?void 0:d.filter(e=>{var t,n;return e.WFState==(null==c?void 0:c.status)&&e.RiskType==(null==c?void 0:c.riskType)&&e.ServiceType==(null==c||null===(t=c.additionalDetails)||void 0===t?void 0:t.serviceType)&&e.applicationType==(null==c||null===(n=c.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==o?void 0:o.additionalDetails,applicationStatus:null==o?void 0:o.applicationStatus,appNumberLink:null==o?void 0:o.applicationNo,nocNo:null==o?void 0:o.nocNo},r.push(l[0].docTypes[0]));let p=[];r&&r.length>0&&(r.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))},[m,_]),n.useEffect(()=>{T("NOC_VERIFICATION_INPROGRESS"===v&&(null==f?void 0:f.length)>0)},[c,d]),l.createElement("div",{style:{border:"1px solid #D6D5D4",padding:"16px 0px 16px 8px",background:"#FAFAFA",borderRadius:"5px",marginBottom:"24px",maxWidth:"950px"}},l.createElement(t.StatusTable,null,l.createElement(t.Row,{label:P?""+i("BPA_"+(null==o?void 0:o.nocType)+"_HEADER"):i("BPA_"+(null==o?void 0:o.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(Vl,{documents:a,svgStyles:{width:"80px",height:"100px",viewBox:"0 0 25 25",minWidth:"80px"}}),b&&(null==y?void 0:y.map((e,t)=>l.createElement($l,{key:t,document:e,t:i,error:D,setError:N,setNocDocuments:C,nocDocuments:A,checkEnablingDocs:b}))))},Zl=e=>{let{permissions:r,t:i}=e;const[o,a,c]=Digit.Hooks.useSessionStorage("OBPS_APPROVAL_CHECKS",null==r?void 0:r.map(e=>({label:e,checked:!1}))),[s,d,p]=Digit.Hooks.useSessionStorage("OBPS_NEW_APPROVALS",[]);n.useEffect(()=>()=>{Digit.SessionStorage.del("OBPS_NEW_APPROVALS"),Digit.SessionStorage.del("OBPS_APPROVAL_CHECKS")},[]);const v=window.Digit.Utils.browser.isMobile();return l.createElement("div",null,l.createElement(t.CardSubHeader,{style:{marginBottom:"16px",fontSize:"24px"}},i("BPA_PERMIT_CONDITIONS")),null==o?void 0:o.map((e,n)=>l.createElement(t.CheckBox,{key:n,styles:{margin:"20px 0 40px",maxWidth:v?"100%":"70%"},label:null==e?void 0:e.label,checked:null==e?void 0:e.checked,onChange:e=>((e,t,n)=>{const l=e.target.checked;a(()=>null==o?void 0:o.map((e,t)=>n===t?u({},e,{checked:l}):e))})(e,0,n),isLabelFirst:!0,index:n})),null==s?void 0:s.map((e,n)=>l.createElement("div",null,l.createElement(t.TextInput,{key:n,value:null==e?void 0:e.label,onChange:e=>((e,t)=>{d(()=>null==s?void 0:s.map((n,l)=>{var r;return t===l?{label:null==e||null===(r=e.target)||void 0===r?void 0:r.value}:n}))})(e,n),textInputStyle:{maxWidth:v?"96%":"830px",width:v?"96%":"830px"},style:v?{paddingRight:"10%"}:{},placeholder:i("BPA_ENTER_PERMIT_CONDITIONS_LABEL")}),l.createElement(t.LinkButton,{label:l.createElement("div",null,l.createElement("span",null,l.createElement(t.Close,{style:{float:"right",position:"relative",bottom:"32px",marginTop:"-22px",marginRight:v?"5%":"35%"}}))),style:{},onClick:e=>(e=>{const t=[...s];t.splice(e,1),d([...t])})(n)}))),l.createElement(t.LinkButton,{style:{color:"#a82227",maxWidth:v?"fit-content":"10%",marginRight:"3%"},label:i("BPA_ADD_MORE"),onClick:()=>{d([...s,{label:""}])}}))};function Xl(e){let{documents:i,svgStyles:o={},isSendBackFlow:a=!1}=e;const{t:u}=r.useTranslation(),[c,s]=n.useState(()=>[]),[d,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!=c&&c.length&&"BillAmend"===(null==i||null===(e=i[0])||void 0===e?void 0:e.BS)?Digit.UploadServices.Filefetch(c,Digit.ULBService.getCurrentTenantId()).then(e=>{p(null==e?void 0:e.data)}):null!=c&&c.length&&Digit.UploadServices.Filefetch(c,Digit.ULBService.getStateId()).then(e=>{p(null==e?void 0:e.data)})},[c]);const v=window.location.href.includes("employee/tl")||window.location.href.includes("/obps")||window.location.href.includes("employee/ws"),f=window.location.href.includes("stakeholder");return l.createElement("div",{style:{marginTop:"19px"}},!f&&(null==i?void 0:i.map((e,n)=>{var r;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===(r=e.values)||void 0===r?void 0:r.map((e,n)=>{var r,i;return l.createElement("a",{target:"_",href:null===(r=d[e.fileStoreId])||void 0===r?void 0:r.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")))))})),f&&(null==i?void 0:i.map((e,n)=>{var r;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===(r=e.values)||void 0===r?void 0:r.map((e,n)=>{var r;return l.createElement("a",{target:"_",href:null===(r=d[e.fileStoreId])||void 0===r?void 0:r.split(",")[0],style:{minWidth:null!=o&&o.minWidth?null==o?void 0:o.minWidth:"160px",marginRight:"20px"},key:n},l.createElement("div",{style:{maxWidth:"940px",padding:"8px",borderRadius:"4px",border:"1px solid #D6D5D4",background:"#FAFAFA"}},l.createElement("p",{style:{marginTop:"8px",fontWeight:"bold",marginBottom:"10px"}},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 Jl(e){let{taxHeadEstimatesCalculation:n}=e;const{taxHeadEstimates:i}=n,{t:o}=r.useTranslation();return l.createElement("div",{style:{marginTop:"40px"}},l.createElement(t.StatusTable,null,l.createElement(t.Row,{label:o("ES_PT_TITLE_TAX_HEADS"),text:o("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:o(e.taxHeadCode),label:o(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:o("ES_PT_TITLE_TOTAL_DUE_AMOUNT"),text:"₹ "+(null==n?void 0:n.totalAmount)||"N/A",className:"border-none",textStyle:{fontSize:"24px",fontWeight:"bold"}})))}function Ql(e){let{floors:n}=e;const{t:i}=r.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 r;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===(r=e.values)||void 0===r?void 0:r.map((e,n)=>{var r;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===(r=e.values)||void 0===r?void 0:r.length)-1,caption:e.caption,className:"border-none"})}))))}))}))}function er(e){let{owners:n}=e,i={};i=window.location.href.includes("/employee/pt/")?n.slice().reverse():n;const{t:o}=r.useTranslation(),a=(null==n?void 0:n.length)||1;let c={marginTop:"19px"},s={position:"relative",padding:"8px"},d={justifyContent:"space-between",fontSize:"16px",lineHeight:"19px",color:"#0B0C0C"};return Number(a)>1?c={marginTop:"19px",background:"#FAFAFA",border:"1px solid #D6D5D4",borderRadius:"4px",padding:"8px",lineHeight:"19px",maxWidth:"600px",minWidth:"280px"}:Number(a)>1||(c={marginTop:"19px",lineHeight:"19px",maxWidth:"600px",minWidth:"280px"},s={position:"relative",marginTop:"19px"}),window.location.href.includes("obps")&&(c=u({},c,{maxWidth:"950px"}),c=u({},c,{maxWidth:"950px"}),d={}),n.sort((e,t)=>{var n,l;return(null==e||null===(n=e.additionalDetails)||void 0===n?void 0:n.ownerSequence)-(null==t||null===(l=t.additionalDetails)||void 0===l?void 0:l.ownerSequence)}),l.createElement(l.Fragment,null,l.createElement("div",{className:"owner-details"},i.map((e,n)=>{var r;return l.createElement("div",{key:o(null==e?void 0:e.title),style:c,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?o(null==e?void 0:e.title)+" "+(n+1):o(null==e?void 0:e.title)),l.createElement(l.Fragment,{key:n},l.createElement(t.StatusTable,{style:s},l.createElement("div",{style:{maxWidth:"640px",top:0,left:0,bottom:0,right:0,width:"auto"}}),null==e||null===(r=e.values)||void 0===r?void 0:r.map((e,n)=>{var r;return!0===e.map&&"N/A"!==e.value?l.createElement(t.Row,{key:o(e.title),label:o(e.title),text:l.createElement("img",{src:o(e.value),alt:"",privacy:null==e?void 0:e.privacy})}):l.createElement("span",null,l.createElement(t.Row,{key:o(e.title),label:""+o(e.title),text:o(e.value)||"N/A",last:n===(null==e||null===(r=e.values)||void 0===r?void 0:r.length)-1,caption:e.caption,className:"border-none",textStyle:e.textStyle,privacy:null==e?void 0:e.privacy,rowContainerStyle:d}))}))))})))}const tr=e=>{var i,o,a;let{scrutinyDetails:u,paymentsList:c=[]}=e;const{t:s}=r.useTranslation(),d=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?d(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:d(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===(o=u.permit)||void 0===o?void 0:o.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,r)=>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))))))))},nr=e=>{var i,o,a,u,c,s,d,p,v;let{edcrDetails:f,applicationData:m}=e;const{t:h}=r.useTranslation(),E=window.Digit.Utils.browser.isMobile(),_=[{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"}],g=e=>{const t=e;return(e,n,l)=>e[t]},y=n.useMemo(()=>_.map(e=>({Header:h(""+e.name),accessor:g(e.id),id:e.id})));function S(e){var t;let n=[];return null==e||null===(t=e.building)||void 0===t||t.floors.map(e=>{var t,l,r,i,o,a,u,c;n.push({Floor:(null==e?void 0:e.floorName)||h("BPA_FLOOR_NAME_"+e.number),Level:(null==e?void 0:e.number)||(null==e?void 0:e.floorNo),Occupancy:h(""+("BPA-PAP"===(null==m?void 0:m.businessService)?"Residential":null===(t=e.occupancies)||void 0===t||null===(l=t[0])||void 0===l?void 0:l.type))||"NA",BuildupArea:(null==e||null===(r=e.occupancies)||void 0===r||null===(i=r[0])||void 0===i?void 0:i.builtUpArea)||(null==e?void 0:e.builtUpArea),FloorArea:(null==e||null===(o=e.occupancies)||void 0===o||null===(a=o[0])||void 0===a?void 0:a.floorArea)||(null==e?void 0:e.builtUpArea),CarpetArea:(null==e||null===(u=e.occupancies)||void 0===u||null===(c=u[0])||void 0===c?void 0:c.carpetArea)||0,key:(null==e?void 0:e.floorName)||h("BPA_FLOOR_NAME_"+e.number)})}),n}function b(e){var t;let n=null==m||null===(t=m.landInfo)||void 0===t?void 0:t.unit,l="";if((null==n?void 0:n.length)>0){var r,i;let t=null===(r=n[e])||void 0===r||null===(i=r.usageCategory)||void 0===i?void 0:i.split(",");null!=t&&t.length&&(l=t.map(e=>e?""+h("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==f||null===(i=f.values)||void 0===i?void 0:i.map((e,n)=>null!=e&&e.isHeader?l.createElement(t.CardSubHeader,{style:{fontSize:"20px",paddingBottom:"10px"}},h(null==e?void 0:e.title)):l.createElement(t.Row,{className:"border-none",labelStyle:{width:"100%",fontSize:"20px"},key:""+e.title,label:""+h(""+e.title),text:null!=e&&e.value?null==e?void 0:e.value:""}))),null==f||null===(o=f.subOccupancyTableDetails)||void 0===o||null===(a=o[0])||void 0===a||null===(u=a.value)||void 0===u||null===(c=u.planDetail)||void 0===c?void 0:c.blocks.map((e,n)=>{var r,i,o,a,u;return l.createElement("div",{key:n,style:(null==f||null===(r=f.subOccupancyTableDetails)||void 0===r||null===(i=r[0])||void 0===i||null===(o=i.value)||void 0===o||null===(a=o.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"}},h("BPA_BLOCK_SUBHEADER")," ",n+1),l.createElement(t.StatusTable,null,l.createElement(t.Row,{className:"border-none",textStyle:{wordBreak:"break-word"},label:""+h("BPA_SUB_OCCUPANCY_LABEL"),text:b(n)})),l.createElement("div",{style:window.location.href.includes("citizen")||E?{overflow:"scroll"}:{maxWidth:"950px",maxHeight:"280px"}},l.createElement(t.Table,{className:"customTable table-fixed-first-column table-border-style",t:h,disableSort:!1,autoSort:!0,manualPagination:!1,isPaginationRequired:!1,initSortId:"S N ",data:S(e),columns:y,getCellProps:e=>({style:{}})})))}),null==f||null===(s=f.subOccupancyTableDetails)||void 0===s||null===(d=s[0])||void 0===d||null===(p=d.value)||void 0===p||null===(v=p.drawingDetail)||void 0===v?void 0:v.blocks.map((e,n)=>{var r,i,o,a,u;return l.createElement("div",{key:n,style:(null==f||null===(r=f.subOccupancyTableDetails)||void 0===r||null===(i=r[0])||void 0===i||null===(o=i.value)||void 0===o||null===(a=o.drawingDetail)||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"}},h("BPA_BLOCK_SUBHEADER")," ",n+1),l.createElement(t.StatusTable,null,l.createElement(t.Row,{className:"border-none",textStyle:{wordBreak:"break-word"},label:""+h("BPA_SUB_OCCUPANCY_LABEL"),text:b(n)})),l.createElement("div",{style:window.location.href.includes("citizen")||E?{overflow:"scroll"}:{maxWidth:"950px",maxHeight:"280px"}},l.createElement(t.Table,{className:"customTable table-fixed-first-column table-border-style",t:h,disableSort:!1,autoSort:!0,manualPagination:!1,isPaginationRequired:!1,initSortId:"S N ",data:S(e),columns:y,getCellProps:e=>({style:{}})})))})))},lr=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))};var rr="function"==typeof Symbol&&Symbol.for,ir=rr?Symbol.for("react.element"):60103,or=rr?Symbol.for("react.portal"):60106,ar=rr?Symbol.for("react.fragment"):60107,ur=rr?Symbol.for("react.strict_mode"):60108,cr=rr?Symbol.for("react.profiler"):60114,sr=rr?Symbol.for("react.provider"):60109,dr=rr?Symbol.for("react.context"):60110,pr=rr?Symbol.for("react.async_mode"):60111,vr=rr?Symbol.for("react.concurrent_mode"):60111,fr=rr?Symbol.for("react.forward_ref"):60112,mr=rr?Symbol.for("react.suspense"):60113,hr=rr?Symbol.for("react.suspense_list"):60120,Er=rr?Symbol.for("react.memo"):60115,_r=rr?Symbol.for("react.lazy"):60116,gr=rr?Symbol.for("react.block"):60121,yr=rr?Symbol.for("react.fundamental"):60117,Sr=rr?Symbol.for("react.responder"):60118,br=rr?Symbol.for("react.scope"):60119;function Tr(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case ir:switch(e=e.type){case pr:case vr:case ar:case cr:case ur:case mr:return e;default:switch(e=e&&e.$$typeof){case dr:case fr:case _r:case Er:case sr:return e;default:return t}}case or:return t}}}function Ar(e){return Tr(e)===vr}var Cr={AsyncMode:pr,ConcurrentMode:vr,ContextConsumer:dr,ContextProvider:sr,Element:ir,ForwardRef:fr,Fragment:ar,Lazy:_r,Memo:Er,Portal:or,Profiler:cr,StrictMode:ur,Suspense:mr,isAsyncMode:function(e){return Ar(e)||Tr(e)===pr},isConcurrentMode:Ar,isContextConsumer:function(e){return Tr(e)===dr},isContextProvider:function(e){return Tr(e)===sr},isElement:function(e){return"object"==typeof e&&null!==e&&e.$$typeof===ir},isForwardRef:function(e){return Tr(e)===fr},isFragment:function(e){return Tr(e)===ar},isLazy:function(e){return Tr(e)===_r},isMemo:function(e){return Tr(e)===Er},isPortal:function(e){return Tr(e)===or},isProfiler:function(e){return Tr(e)===cr},isStrictMode:function(e){return Tr(e)===ur},isSuspense:function(e){return Tr(e)===mr},isValidElementType:function(e){return"string"==typeof e||"function"==typeof e||e===ar||e===vr||e===cr||e===ur||e===mr||e===hr||"object"==typeof e&&null!==e&&(e.$$typeof===_r||e.$$typeof===Er||e.$$typeof===sr||e.$$typeof===dr||e.$$typeof===fr||e.$$typeof===yr||e.$$typeof===Sr||e.$$typeof===br||e.$$typeof===gr)},typeOf:Tr},Dr=v(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,r=e?Symbol.for("react.fragment"):60107,i=e?Symbol.for("react.strict_mode"):60108,o=e?Symbol.for("react.profiler"):60114,a=e?Symbol.for("react.provider"):60109,u=e?Symbol.for("react.context"):60110,c=e?Symbol.for("react.async_mode"):60111,s=e?Symbol.for("react.concurrent_mode"):60111,d=e?Symbol.for("react.forward_ref"):60112,p=e?Symbol.for("react.suspense"):60113,v=e?Symbol.for("react.suspense_list"):60120,f=e?Symbol.for("react.memo"):60115,m=e?Symbol.for("react.lazy"):60116,h=e?Symbol.for("react.block"):60121,E=e?Symbol.for("react.fundamental"):60117,_=e?Symbol.for("react.responder"):60118,g=e?Symbol.for("react.scope"):60119;function y(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case n:var v=e.type;switch(v){case c:case s:case r:case o:case i:case p:return v;default:var h=v&&v.$$typeof;switch(h){case u:case d:case m:case f:case a:return h;default:return t}}case l:return t}}}var S=s,b=u,T=a,A=n,C=d,D=r,N=m,P=f,R=l,I=o,w=i,x=p,O=!1;function L(e){return y(e)===s}t.AsyncMode=c,t.ConcurrentMode=S,t.ContextConsumer=b,t.ContextProvider=T,t.Element=A,t.ForwardRef=C,t.Fragment=D,t.Lazy=N,t.Memo=P,t.Portal=R,t.Profiler=I,t.StrictMode=w,t.Suspense=x,t.isAsyncMode=function(e){return O||(O=!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.")),L(e)||y(e)===c},t.isConcurrentMode=L,t.isContextConsumer=function(e){return y(e)===u},t.isContextProvider=function(e){return y(e)===a},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===n},t.isForwardRef=function(e){return y(e)===d},t.isFragment=function(e){return y(e)===r},t.isLazy=function(e){return y(e)===m},t.isMemo=function(e){return y(e)===f},t.isPortal=function(e){return y(e)===l},t.isProfiler=function(e){return y(e)===o},t.isStrictMode=function(e){return y(e)===i},t.isSuspense=function(e){return y(e)===p},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===r||e===s||e===o||e===i||e===p||e===v||"object"==typeof e&&null!==e&&(e.$$typeof===m||e.$$typeof===f||e.$$typeof===a||e.$$typeof===u||e.$$typeof===d||e.$$typeof===E||e.$$typeof===_||e.$$typeof===g||e.$$typeof===h)},t.typeOf=y}()}),Nr=v(function(e){e.exports="production"===process.env.NODE_ENV?Cr:Dr}),Pr=Object.getOwnPropertySymbols,Rr=Object.prototype.hasOwnProperty,Ir=Object.prototype.propertyIsEnumerable;function wr(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}var xr=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,r=wr(e),i=1;i<arguments.length;i++){for(var o in n=Object(arguments[i]))Rr.call(n,o)&&(r[o]=n[o]);if(Pr){l=Pr(n);for(var a=0;a<l.length;a++)Ir.call(n,l[a])&&(r[l[a]]=n[l[a]])}}return r},Or="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",Lr=Function.call.bind(Object.prototype.hasOwnProperty),Mr=function(){};if("production"!==process.env.NODE_ENV){var kr=Or,Fr={},Br=Lr;Mr=function(e){var t="Warning: "+e;"undefined"!=typeof console&&console.error(t);try{throw new Error(t)}catch(e){}}}function Ur(e,t,n,l,r){if("production"!==process.env.NODE_ENV)for(var i in e)if(Br(e,i)){var o;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}o=e[i](t,i,l,n,null,kr)}catch(e){o=e}if(!o||o instanceof Error||Mr((l||"React class")+": type specification of "+n+" `"+i+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof o+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),o instanceof Error&&!(o.message in Fr)){Fr[o.message]=!0;var u=r?r():"";Mr("Failed "+n+" type: "+o.message+(null!=u?u:""))}}}Ur.resetWarningCache=function(){"production"!==process.env.NODE_ENV&&(Fr={})};var jr=Ur,Hr=function(){};function Wr(){return null}function zr(){}function Vr(){}"production"!==process.env.NODE_ENV&&(Hr=function(e){var t="Warning: "+e;"undefined"!=typeof console&&console.error(t);try{throw new Error(t)}catch(e){}}),Vr.resetWarningCache=zr;var Kr=v(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:o(Wr),arrayOf:function(e){return o(function(t,n,l,r,o){if("function"!=typeof e)return new i("Property `"+o+"` of component `"+l+"` has invalid PropType notation inside arrayOf.");var a=t[n];if(!Array.isArray(a))return new i("Invalid "+r+" `"+o+"` of type `"+s(a)+"` supplied to `"+l+"`, expected an array.");for(var u=0;u<a.length;u++){var c=e(a,u,l,r,o+"["+u+"]",Or);if(c instanceof Error)return c}return null})},element:o(function(t,n,l,r,o){var a=t[n];return e(a)?null:new i("Invalid "+r+" `"+o+"` of type `"+s(a)+"` supplied to `"+l+"`, expected a single ReactElement.")}),elementType:o(function(e,t,n,l,r){var o=e[t];return Nr.isValidElementType(o)?null:new i("Invalid "+l+" `"+r+"` of type `"+s(o)+"` supplied to `"+n+"`, expected a single ReactElement type.")}),instanceOf:function(e){return o(function(t,n,l,r,o){var a;return t[n]instanceof e?null:new i("Invalid "+r+" `"+o+"` of type `"+((a=t[n]).constructor&&a.constructor.name?a.constructor.name:"<<anonymous>>")+"` supplied to `"+l+"`, expected instance of `"+(e.name||"<<anonymous>>")+"`.")})},node:o(function(e,t,n,l,r){return c(e[t])?null:new i("Invalid "+l+" `"+r+"` supplied to `"+n+"`, expected a ReactNode.")}),objectOf:function(e){return o(function(t,n,l,r,o){if("function"!=typeof e)return new i("Property `"+o+"` of component `"+l+"` has invalid PropType notation inside objectOf.");var a=t[n],u=s(a);if("object"!==u)return new i("Invalid "+r+" `"+o+"` of type `"+u+"` supplied to `"+l+"`, expected an object.");for(var c in a)if(Lr(a,c)){var d=e(a,c,l,r,o+"."+c,Or);if(d instanceof Error)return d}return null})},oneOf:function(e){if(!Array.isArray(e))return"production"!==process.env.NODE_ENV&&Hr(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."),Wr;function t(t,n,l,o,a){for(var u=t[n],c=0;c<e.length;c++)if(r(u,e[c]))return null;var s=JSON.stringify(e,function(e,t){return"symbol"===d(t)?String(t):t});return new i("Invalid "+o+" `"+a+"` of value `"+String(u)+"` supplied to `"+l+"`, expected one of "+s+".")}return o(t)},oneOfType:function(e){if(!Array.isArray(e))return"production"!==process.env.NODE_ENV&&Hr("Invalid argument supplied to oneOfType, expected an instance of array."),Wr;for(var t=0;t<e.length;t++){var n=e[t];if("function"!=typeof n)return Hr("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+p(n)+" at index "+t+"."),Wr}return o(function(t,n,l,r,o){for(var a=[],u=0;u<e.length;u++){var c=(0,e[u])(t,n,l,r,o,Or);if(null==c)return null;c.data&&Lr(c.data,"expectedType")&&a.push(c.data.expectedType)}return new i("Invalid "+r+" `"+o+"` supplied to `"+l+"`"+(a.length>0?", expected one of type ["+a.join(", ")+"]":"")+".")})},shape:function(e){return o(function(t,n,l,r,o){var a=t[n],c=s(a);if("object"!==c)return new i("Invalid "+r+" `"+o+"` of type `"+c+"` supplied to `"+l+"`, expected `object`.");for(var p in e){var v=e[p];if("function"!=typeof v)return u(l,r,o,p,d(v));var f=v(a,p,l,r,o+"."+p,Or);if(f)return f}return null})},exact:function(e){return o(function(t,n,l,r,o){var a=t[n],c=s(a);if("object"!==c)return new i("Invalid "+r+" `"+o+"` of type `"+c+"` supplied to `"+l+"`, expected `object`.");var p=xr({},t[n],e);for(var v in p){var f=e[v];if(Lr(e,v)&&"function"!=typeof f)return u(l,r,o,v,d(f));if(!f)return new i("Invalid "+r+" `"+o+"` key `"+v+"` supplied to `"+l+"`.\nBad object: "+JSON.stringify(t[n],null," ")+"\nValid keys: "+JSON.stringify(Object.keys(e),null," "));var m=f(a,v,l,r,o+"."+v,Or);if(m)return m}return null})}};function r(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 o(e){function t(t,n,l,r,o,a,u){if(r=r||"<<anonymous>>",a=a||l,u!==Or){var c=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 c.name="Invariant Violation",c}return null==n[l]?t?new i(null===n[l]?"The "+o+" `"+a+"` is marked as required in `"+r+"`, but its value is `null`.":"The "+o+" `"+a+"` is marked as required in `"+r+"`, but its value is `undefined`."):null:e(n,l,r,o,a)}process;var n=t.bind(null,!1);return n.isRequired=t.bind(null,!0),n}function a(e){return o(function(t,n,l,r,o,a){var u=t[n];return s(u)!==e?new i("Invalid "+r+" `"+o+"` of type `"+d(u)+"` supplied to `"+l+"`, expected `"+e+"`.",{expectedType:e}):null})}function u(e,t,n,l,r){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 `"+r+"`.")}function c(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(c);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 r,i=l.call(t);if(l!==t.entries){for(;!(r=i.next()).done;)if(!c(r.value))return!1}else for(;!(r=i.next()).done;){var o=r.value;if(o&&!c(o[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 d(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=d(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=jr,l.resetWarningCache=jr.resetWarningCache,l.PropTypes=l,l}(Nr.isElement):function(){function e(e,t,n,l,r,i){if(i!==Or){var o=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 o.name="Invariant Violation",o}}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:Vr,resetWarningCache:zr};return n.PropTypes=n,n}()});const Yr=e=>{let{className:t,width:n=80,height:r=80,style:i={background:"#f6f6f6",padding:"8px",boxShadow:"0px 2px 0px #d6d5d3",borderRadius:"2px"},viewBox:o="0 0 80 80"}=e;return l.createElement("svg",{className:t,width:n,height:r,style:i,viewBox:o,fill:"none",xmlns:"http://www.w3.org/2000/svg"},l.createElement("path",{d:"M46.6667 6.6665H20C16.3334 6.6665 13.3667 9.6665 13.3667 13.3332L13.3334 66.6665C13.3334 70.3332 16.3 73.3332 19.9667 73.3332H60C63.6667 73.3332 66.6667 70.3332 66.6667 66.6665V26.6665L46.6667 6.6665ZM53.3334 59.9998H26.6667V53.3332H53.3334V59.9998ZM53.3334 46.6665H26.6667V39.9998H53.3334V46.6665ZM43.3334 29.9998V11.6665L61.6667 29.9998H43.3334Z",fill:"#505A5F"}))},qr=e=>{let{source:t,index:n,last:r=!1,onClick:i,selectedIndex:o,drawingNo:a}=e;const u=o===n;return"pdf"===Digit.Utils.getFileTypeFromFileStoreURL(t)?l.createElement("div",{style:{display:"flex",flexWrap:"wrap",justifyContent:"flex-start",alignContent:"center"}},l.createElement("a",{target:"_blank",rel:"noopener noreferrer",href:t,style:{minWidth:"100px",marginRight:"10px",maxWidth:"100px",height:"auto"}},l.createElement("div",{style:{display:"flex",justifyContent:"center"}},l.createElement(Yr,{style:{background:"#f6f6f6",padding:"8px",width:"100px"},width:"100px",height:"100px"})))):l.createElement("div",null,l.createElement("img",{style:{width:"200px",padding:"3px",height:"200px",margin:"8px",border:u?"4px solid black":"none"},src:t,alt:"issue thumbnail",onClick:()=>i(t,n),className:r?"last":""}),a&&l.createElement("div",{style:{marginTop:"12px",marginLeft:"12px",marginBottom:"5px",fontSize:"14px"}},a))},$r=e=>{let{srcs:t,drawingNos:r=[],onClick:i}=e;const[o,a]=n.useState(null),u=(e,t)=>{a(t),i&&i(e,t)};return l.createElement("div",{className:"photos-wrap",style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(200px, 1fr))"}},t.map((e,n)=>l.createElement(qr,{key:n,source:e,index:n,last:n===t.length-1,selectedIndex:o,onClick:u,drawingNo:r[n]})))};$r.propTypes={srcs:Kr.arrayOf(Kr.string),drawingNos:Kr.arrayOf(Kr.string),onClick:Kr.func},$r.defaultProps={srcs:[],drawingNos:[]};const Gr=e=>{var n,i,o;let{data:a,OpenImage:u,privacy:c={}}=e;const{t:s}=r.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:c}),l.createElement("p",null,"    ")),a.source&&l.createElement("p",null,s("ES_APPLICATION_DETAILS_APPLICATION_CHANNEL_"+a.source.toUpperCase())),a.comment&&l.createElement(lr,{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=>l.createElement("div",{className:"TLComments"},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===(o=i.thumbs)||void 0===o?void 0:o.length)>0?l.createElement("div",{className:"TLComments"},l.createElement("h3",null,s("CS_COMMON_ATTACHMENTS")),l.createElement($r,{srcs:null==a?void 0:a.thumbnailsToShow.thumbs,onClick:(e,t)=>{u(e,t,null==a?void 0:a.thumbnailsToShow)}})):null)};function Zr(e){let{units:n}=e;const{t:i}=r.useTranslation();return l.createElement(l.Fragment,null,n.map((e,n)=>{var r;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===(r=e.values)||void 0===r?void 0:r.map((e,n)=>{var r;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===(r=e.values)||void 0===r?void 0:r.length)-1,caption:e.caption,className:"border-none",rowContainerStyle:{justifyContent:"space-between",fontSize:"16px",lineHeight:"19px",color:"#0B0C0C"}})}))))}))}function Xr(e){let{units:n}=e;const{t:i}=r.useTranslation();return l.createElement(l.Fragment,null,n.map((e,n)=>{var r;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===(r=e.values)||void 0===r?void 0:r.map((e,n)=>{var r;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===(r=e.values)||void 0===r?void 0:r.length)-1,caption:e.caption,className:"border-none",rowContainerStyle:{justifyContent:"space-between",fontSize:"16px",lineHeight:"19px",color:"#0B0C0C"}})}))))}))}const Jr=e=>{var i,o,a,u;let{wsAdditionalDetails:c}=e;const{t:s}=r.useTranslation();let d=(p=location.search)?(/^[?#]/.test(p)?p.slice(1):p).split("&").reduce((e,t)=>{let[n,l]=t.split("=");return e[n]=l?decodeURIComponent(l.replace(/\+/g," ")):"",e},{}):{};var p;const v=null==d?void 0:d.mode;var{connectionDetails:f,plumberDetails:m,roadCuttingDetails:h,activationDetails:E}=(null==c?void 0:c.additionalDetails)||{connectionDetails:[],plumberDetails:[]};return l.createElement(n.Fragment,null,l.createElement("div",{style:{lineHeight:"19px",maxWidth:"950px",minWidth:"280px"}},(null==c||null===(i=c.additionalDetails)||void 0===i?void 0:i.connectionDetails)&&l.createElement(t.StatusTable,null,l.createElement(t.CardSubHeader,{style:{fontSize:"24px",marginBottom:"16px",marginTop:"32px"}},s("WS_COMMON_CONNECTION_DETAIL")),l.createElement("div",null,l.createElement("div",{className:"connection-details-new-value-wrapper"},null==f?void 0:f.map((e,n)=>l.createElement("div",null,l.createElement(t.Row,{className:"border-none",key:""+e.title,label:""+s(""+e.title),text:null!=e&&e.oldValue?null==e?void 0:e.oldValue:null!=e&&e.value?null==e?void 0:e.value:""})))))),(null==c||null===(o=c.additionalDetails)||void 0===o?void 0:o.plumberDetails)&&"MODIFY"!=v&&l.createElement(t.StatusTable,null,l.createElement(t.CardSubHeader,{style:{fontSize:"24px",marginBottom:"16px",marginTop:"32px"}},s("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:""+s(""+e.title),text:null!=e&&e.oldValue?null==e?void 0:e.oldValue:null!=e&&e.value?null==e?void 0:e.value:"",privacy:e.privacy}))))),(null==c||null===(a=c.additionalDetails)||void 0===a?void 0:a.roadCuttingDetails)&&"MODIFY"!=v&&l.createElement(t.StatusTable,null,l.createElement(t.CardSubHeader,{style:{fontSize:"24px",marginBottom:"16px",marginTop:"32px"}},s("WS_ROAD_CUTTING_DETAILS")),l.createElement("div",null,l.createElement("div",{className:"plumber-details-new-value-wrapper"},null==h?void 0:h.map(e=>{var n;return l.createElement("div",{style:(null==h?void 0:h.length)>1?{border:"1px solid #D6D5D4",background:"#FAFAFA",borderRadius:"4px",padding:"10px 10px 0px 10px",margin:"5px 0px"}:{}},null==e||null===(n=e.values)||void 0===n?void 0:n.map(e=>l.createElement(t.Row,{className:"border-none",key:""+e.title,label:""+s(""+e.title),text:null!=e&&e.oldValue?null==e?void 0:e.oldValue:null!=e&&e.value?null==e?void 0:e.value:""})))})))),(null==c||null===(u=c.additionalDetails)||void 0===u?void 0:u.activationDetails)&&l.createElement(t.StatusTable,null,l.createElement(t.CardSubHeader,{style:{fontSize:"24px",marginBottom:"16px",marginTop:"32px"}},s("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:""+s(""+e.title),text:null!=e&&e.oldValue?null==e?void 0:e.oldValue:null!=e&&e.value?null==e?void 0:e.value:""})))))))},Qr=[{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"}],ei=[{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"}],ti=e=>{var i,o,a,c;let{wsAdditionalDetails:s}=e;const{t:d}=r.useTranslation(),[p,v,f]=Digit.Hooks.useSessionStorage("ADHOC_ADD_REBATE_DATA",{}),[m,h,E]=Digit.Hooks.useSessionStorage("ADHOC_BILL_ADD_REBATE_DATA",{}),g=!(null==s||null===(i=s.additionalDetails)||void 0===i||!i.isPaid),[y,S]=n.useState(!1),[b,T]=n.useState(p||{}),[A,C]=n.useState(null),[D,N]=n.useState(s.additionalDetails.data?s.additionalDetails.data:{}),[P,R]=n.useState(s.additionalDetails.values?s.additionalDetails.values:[]),I=Digit.ULBService.getStateId();Digit.Hooks.ws.useMDMS(I,"BillingService",["TaxHeadMaster"]),n.useEffect(()=>{var e,t,n;const r=u({},null==s||null===(e=s.additionalDetails)||void 0===e||null===(t=e.appDetails)||void 0===t?void 0:t.additionalDetails);if((null==p||null===(n=p.billDetails)||void 0===n?void 0:n.length)>0){var i,o,a,c,d,f,m;const e=[{title:"WS_APPLICATION_FEE_HEADER",value:l.createElement("span",null,"₹",null==p||null===(i=p.billDetails)||void 0===i||null===(o=i[0])||void 0===o?void 0:o.fee)},{title:"WS_SERVICE_FEE_HEADER",value:l.createElement("span",null,"₹",null==p||null===(a=p.billDetails)||void 0===a||null===(c=a[0])||void 0===c?void 0:c.charge)},{title:"WS_TAX_HEADER",value:l.createElement("span",null,"₹",null==p||null===(d=p.billDetails)||void 0===d||null===(f=d[0])||void 0===f?void 0:f.taxAmount)}];R(e),N(null==p||null===(m=p.billDetails)||void 0===m?void 0:m[0])}else v(r),T(r)},[]);let w={};const x=e=>l.createElement("h1",{className:"heading-m"},e.label),O=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),L=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(O,null)),M=function(e,t,n){void 0===t&&(t=!1);let l=u({},b);if("adhocPenalty"!=e&&"adhocRebate"!=e||!n.target.value)t?(l[e+"_data"]=n,l[e]=n.title,"PT_OTHERS"==n.title&&"adhocPenaltyReason"==e&&(l.adhocPenaltyComment=""),"PT_OTHERS"==n.title&&"adhocRebateReason"==e&&(l.adhocRebateComment="")):l[e]=n.target.value;else{var r,i;const t=0==(null==n||null===(r=n.target)||void 0===r?void 0:r.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:""}T(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:""+d(""+e.title),text:null!=e&&e.value?null==e?void 0:e.value:""}))),l.createElement("hr",{style:{border:"1px solid #D6D5D4",color:"#D6D5D4",margin:"16px 0px"}}),l.createElement("div",null,l.createElement(t.Row,{className:"border-none",key:"WS_COMMON_TOTAL_AMT",label:""+d("WS_COMMON_TOTAL_AMT"),text:l.createElement("span",null,"₹",(null==D?void 0:D.totalAmount)||0),textStyle:{fontSize:"24px",fontWeight:"700"}}),l.createElement(t.Row,{className:"border-none",key:"CS_INBOX_STATUS_FILTER",label:""+d("CS_INBOX_STATUS_FILTER"),text:d(g?"WS_COMMON_PAID_LABEL":"WS_COMMON_NOT_PAID"),textStyle:g?{color:"#00703C"}:{color:"#D4351C"}}))),null!=s&&null!==(o=s.additionalDetails)&&void 0!==o&&o.isAdhocRebate?l.createElement("div",{onClick:e=>{S(!0)}},l.createElement("span",{style:{cursor:"pointer",color:"#a82227"}},d("WS_PAYMENT_ADD_REBATE_PENALTY"))):null,y&&l.createElement(t.Modal,{headerBarMain:l.createElement(x,{label:d("PT_ADD_REBATE_PENALITY")}),headerBarEnd:l.createElement(L,{onClick:()=>{T(p),S(!1)}}),actionCancelLabel:d("PT_CANCEL"),actionCancelOnSubmit:()=>{T(p),S(!1)},actionSaveLabel:d("PT_ADD"),actionSaveOnSubmit:e=>(e=>{const t=null!=b&&b.adhocPenalty?Number(null==b?void 0:b.adhocPenalty):0,n=null!=b&&b.adhocRebate?Number(null==b?void 0:b.adhocRebate):0;var l,r;if(t||n)if(n>(null==s||null===(l=s.additionalDetails)||void 0===l||null===(r=l.data)||void 0===r?void 0:r.totalAmount))C({isError:!1,isWarning:!0,key:"error",message:d("ERR_WS_REBATE_GREATER_THAN_AMOUNT")});else{var i,o,a,c,p,f,m,E,g,y;const e=null==s||null===(i=s.additionalDetails)||void 0===i||null===(o=i.appDetails)||void 0===o?void 0:o.applicationNo,t=null==s||null===(a=s.additionalDetails)||void 0===a||null===(c=a.appDetails)||void 0===c?void 0:c.tenantId,n=u({},null==s||null===(p=s.additionalDetails)||void 0===p||null===(f=p.appDetails)||void 0===f?void 0:f.additionalDetails,b);s.additionalDetails.appDetails.additionalDetails=n;const l={CalculationCriteria:"WATER"==(null==s||null===(m=s.additionalDetails)||void 0===m||null===(E=m.appDetails)||void 0===E?void 0:E.service)?[{applicationNo:e,tenantId:t,waterConnection:s.additionalDetails.appDetails}]:[{applicationNo:e,tenantId:t,sewerageConnection:s.additionalDetails.appDetails}],isconnectionCalculation:!1};let r="WATER"==(null==s||null===(g=s.additionalDetails)||void 0===g||null===(y=g.appDetails)||void 0===y?void 0:y.service)?"WS":"SW";Digit.WSService.wsCalculationEstimate(l,r).then((e,t)=>{var n,l,r,i,o,a,u,c,s,d,p,f,m,E,g;(null==e||null===(n=e.Calculation)||void 0===n||null===(l=n[0])||void 0===l||null===(r=l.taxHeadEstimates)||void 0===r?void 0:r.length)>0&&(null==e||null===(m=e.Calculation)||void 0===m||null===(E=m[0])||void 0===E||null===(g=E.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===(o=i[0])||void 0===o?void 0:o.taxHeadEstimates,"category");const y=[{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===(c=e.Calculation)||void 0===c||null===(s=c[0])||void 0===s?void 0:s.charge},{title:"WS_TAX_HEADER",value:null===(d=e.Calculation)||void 0===d||null===(p=d[0])||void 0===p?void 0:p.taxAmount}];h(vl(e.Calculation[0])),N(null==e||null===(f=e.Calculation)||void 0===f?void 0:f[0]),R(y),b.billDetails=null==e?void 0:e.Calculation,v(b),S(!1)}).catch(e=>{var t,n,l,r,i,o;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?d(""+(null==e||null===(r=e.response)||void 0===r||null===(i=r.data)||void 0===i||null===(o=i.Errors[0])||void 0===o?void 0:o.code)):d("PT_COMMON_ADD_REBATE_PENALITY")})})}else C({isError:!1,isWarning:!0,key:"warning",message:d("ERR_WS_ENTER_ATLEAST_ONE_FIELD")})})(),hideSubmit:!1,popupStyles:{overflowY:"auto"}},l.createElement("div",null,l.createElement(t.Card,{style:{padding:"10px 10px 1px 10px",margin:"0px 0px 15px 0px"}},l.createElement(t.CardSectionHeader,{style:{fontSize:"16px",fontWeight:"700",lineHeight:"18px",padding:"0px",margin:"0px 0px 10px 0px"}},d("PT_AD_PENALTY")),l.createElement(t.CardLabel,null,d("PT_TX_HEADS")),l.createElement("div",{className:"field"},l.createElement(t.Dropdown,{isMandatory:!0,option:Qr,optionKey:"title",select:e=>M("adhocPenaltyReason",!0,e),selected:(null==b?void 0:b.adhocPenaltyReason_data)||"",isPropertyAssess:!0,name:"adhocPenaltyReason_data",t:d})),"PT_OTHERS"===(null==b||null===(a=b.adhocPenaltyReason_data)||void 0===a?void 0:a.title)&&l.createElement("div",{className:"field"},l.createElement(t.CardLabel,null,d("PT_REASON")),l.createElement("div",{className:"field"},l.createElement(t.TextInput,u({style:{background:"#FAFAFA"},t:d,type:"text",isMandatory:!1,name:"adhocPenaltyComment",value:(null==b?void 0:b.adhocPenaltyComment)||"",onChange:e=>M("adhocPenaltyComment",!1,e)},w={isRequired:!0,pattern:"^[a-zA-Z ]*$",type:"text",title:d("TL_NAME_ERROR_MESSAGE")})))),l.createElement(t.CardLabel,null,d("PT_HEAD_AMT")),l.createElement("div",{className:"field"},l.createElement(t.TextInput,u({style:{background:"#FAFAFA"},t:d,type:"number",isMandatory:!1,name:"adhocPenalty",value:(null==b?void 0:b.adhocPenalty)||"",onChange:e=>M("adhocPenalty",!1,e)},w={isRequired:!0,pattern:"^[1-9]+[0-9]*$",title:d("ERR_DEFAULT_INPUT_FIELD_MSG")})))),l.createElement(t.Card,{style:{padding:"10px 10px 1px 10px",margin:"0px 0px 15px 0px"}},l.createElement(t.CardSectionHeader,{style:{fontSize:"16px",fontWeight:"700",lineHeight:"18px",padding:"0px",margin:"0px 0px 10px 0px"}},d("PT_AD_REBATE")),l.createElement(t.CardLabel,null,d("PT_TX_HEADS")),l.createElement("div",{className:"field"},l.createElement(t.Dropdown,{isMandatory:!0,option:ei,optionKey:"title",select:e=>M("adhocRebateReason",!0,e),selected:(null==b?void 0:b.adhocRebateReason_data)||"",name:"adhocRebateReason_data",isPropertyAssess:!0,t:d})),"PT_OTHERS"===(null==b||null===(c=b.adhocRebateReason_data)||void 0===c?void 0:c.title)&&l.createElement("div",{className:"field"},l.createElement(t.CardLabel,null,d("PT_REASON")),l.createElement(t.TextInput,u({style:{background:"#FAFAFA"},t:d,type:"text",isMandatory:!1,name:"adhocRebateComment",value:(null==b?void 0:b.adhocRebateComment)||"",onChange:e=>M("adhocRebateComment",!1,e)},w={isRequired:!0,pattern:"^[a-zA-Z ]*$",type:"text",title:d("TL_NAME_ERROR_MESSAGE")}))),l.createElement(t.CardLabel,null,d("PT_HEAD_AMT")),l.createElement("div",{className:"field"},l.createElement(t.TextInput,u({style:{background:"#FAFAFA"},t:d,type:"number",isMandatory:!1,name:"adhocRebate",value:(null==b?void 0:b.adhocRebate)||"",onChange:e=>M("adhocRebate",!1,e)},w={isRequired:!0,pattern:"^[1-9]+[0-9]*$",title:d("ERR_DEFAULT_INPUT_FIELD_MSG")})))))," "),A&&l.createElement(t.Toast,{style:{zIndex:"10000"},warning:null==A?void 0:A.isWarning,error:null==A||!A.isWarning,label:d(null==A?void 0:A.message),onClose:()=>{C(!1)},isDleteBtn:!0})))},ni=e=>{let{style:t}=e;return l.createElement("span",null,l.createElement("svg",{style:u({},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"})))},li=e=>{let{t:n,userType:r=!1,infoBannerLabel:i="",infoClickLable:o="",infoClickInfoLabel:a="",infoClickInfoLabel1:u=""}=e;r=r||Digit.SessionStorage.get("userType");const c=window.Digit.Utils.browser.isMobile();return l.createElement(l.Fragment,null,l.createElement("div",{style:c?{}:{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(o)+" ",l.createElement(ni,{style:{display:"inline",marginBottom:"5px"}})," "+n(a),l.createElement("div",null," "+n(u)))))},ri=e=>{var i,o,a,u,c,s,d;let{wsAdditionalDetails:p}=e;const{t:v}=r.useTranslation(),[f,m]=n.useState(!1),[h,E]=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"})),y=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),E(t),m(!0)})(),style:{marginTop:"12px"}},l.createElement("span",{style:{cursor:"pointer",color:"#a82227"}},v("WS_PAYMENT_VIEW_BREAKUP"))):null,f&&l.createElement(t.Modal,{headerBarMain:l.createElement(_,{label:v("WS_CALCULATION_BREAKUP")}),headerBarEnd:l.createElement(y,{onClick:()=>{m(!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==h||null===(o=h.billSlabData)||void 0===o||null===(a=o.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==h?void 0:h.fee)||0),textStyle:{textAlign:"right",fontWeight:"700",fontSize:"24px"}}),l.createElement(t.CardSectionHeader,{style:{margin:"10px 0px"}},v("WS_SERVICE_FEE_HEADER")),null==h||null===(u=h.billSlabData)||void 0===u||null===(c=u.CHARGES)||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_AMOUNT2",label:""+v("PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT"),text:l.createElement("span",null,"₹",Number(null==h?void 0:h.charge)||0),textStyle:{textAlign:"right",fontWeight:"700",fontSize:"24px"}}),null==h||null===(s=h.billSlabData)||void 0===s||null===(d=s.TAX)||void 0===d?void 0:d.map(e=>l.createElement(t.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:""+(null==e?void 0:e.taxHeadCode),label:""+v(""+(null==e?void 0:e.taxHeadCode)),text:l.createElement("span",null,"₹",Number(null==e?void 0:e.amount)||0),textStyle:{textAlign:"right"}})),l.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",marginBottom:"10px"}}),l.createElement(t.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:"PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT3",label:""+v("PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT"),text:l.createElement("span",null,"₹",Number(null==h?void 0:h.totalAmount)||0),textStyle:{textAlign:"right",fontWeight:"700",fontSize:"24px"}})))))},ii={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:{}},oi=e=>{let{className:t="table",headers:n=[],values:i=[],arrears:o=0}=e;const{t:a}=r.useTranslation();return l.createElement(l.Fragment,null,l.createElement("div",{style:ii.root},l.createElement("table",{className:"table-fixed-column-common-pay",style:ii.table},l.createElement("thead",null,l.createElement("tr",null,l.createElement("th",{style:u({},ii.cell,ii.cellLeft,ii.cellHeader)},a("CS_BILL_PERIOD")),n.map((e,t)=>l.createElement("th",{style:u({},ii.cell,n.length==t+1?ii.cellRight:{},ii.cellHeader),key:t},a(e))))),l.createElement("tbody",null,Object.values(i).map((e,t)=>l.createElement("tr",{key:t},l.createElement("td",{style:u({},ii.cell,ii.cellLeft),component:"th",scope:"row"},Object.keys(i)[t]),n.map((t,r)=>l.createElement("td",{style:u({},ii.cell,{textAlign:"left"},n.length==r+1?ii.cellRight:{},{whiteSpace:"pre"}),key:r,numeric:!0},r>1&&"₹",e[t]&&e[t].value||"0")))),l.createElement("tr",null,l.createElement("td",{style:u({},ii.cell,ii.cellLeft)}),n.map((e,t)=>t==n.length-1?l.createElement("td",{style:u({},ii.cell,ii.cellRight,{textAlign:"left",fontWeight:"700",whiteSpace:"pre"}),key:t,numeric:!0},o):t==n.length-2?l.createElement("td",{style:u({},ii.cell,{textAlign:"left"}),key:t,numeric:!0},a("COMMON_ARREARS_TOTAL")):l.createElement("td",{style:ii.cell,key:t,numeric:!0})))))))},ai={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))"}},ui=e=>{var t,i,o;let{bill:a={}}=e;const{t:u}=r.useTranslation();let c={},s=(null==a||null===(t=a.billDetails)||void 0===t?void 0:t.sort((e,t)=>t.fromPeriod-e.fromPeriod))||[];s=[...s];const d=(null===(i=s)||void 0===i?void 0:i.reduce((e,t,n)=>0===n?e:e+t.amount,0))||0;let p="₹ "+((null==d||null===(o=d.toFixed)||void 0===o?void 0:o.call(d,0))||Number(0).toFixed(0));s.shift(),s.map(e=>{let t=function(e){var t,n,l;void 0===e&&(e={});let r={};const{billAccountDetails:i=[]}=e;return i.map(e=>{r[e.taxHeadCode]={value:e.amount,order:e.order}}),r.CS_BILL_NO={value:(null===(t=e)||void 0===t?void 0:t.billNumber)||"NA",order:-2},r.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},r.TL_COMMON_TOTAL_AMT={value:e.amount,order:10},r}(e);c[((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={};!c||Object.keys(c).map((e,t)=>{Object.keys(c[e]).map(t=>{v[t]=c[e]&&c[e][t]&&c[e][t].order||0})});let f=[];f=Object.keys(v),f.sort((e,t)=>v[e]-v[t]);const[m,h]=n.useState(!1);return 0==d||d<0?l.createElement("span",null):l.createElement(l.Fragment,null,l.createElement("div",{style:ai.headerStyle},u("CS_ARREARS_DETAILS")),m&&l.createElement(oi,{headers:[...f],values:c,arrears:p}),!m&&l.createElement("div",{style:ai.buttonStyle},l.createElement("button",{type:"button",onClick:()=>{h(!0)}},u("CS_SHOW_CARD"))),m&&l.createElement("div",{style:ai.buttonStyle},l.createElement("button",{type:"button",onClick:()=>{h(!1)}},u("CS_HIDE_CARD"))))};function ci(e){var o,a,u,c,s,d,p,v,f,m,h,E,g,y,S;let{applicationDetails:b,workflowDetails:T,isDataLoading:A,applicationData:C,timelineStatusPrefix:D,showTimeLine:N=!0,statusAttribute:P="status",paymentsList:R,oldValue:I,isInfoLabel:w=!1}=e;const{t:x}=r.useTranslation();let{id:O}=i.useParams();const L=null==b||null===(o=b.applicationData)||void 0===o?void 0:o.owners;function M(e,t,n){var l;window.open(null==n||null===(l=n.fullImage)||void 0===l?void 0:l[0],"_blank")}console.log("ownersSequences:- ",L);const[k,F]=n.useState({}),[B,U]=n.useState({loading:!1,loaded:!1,canLoad:!1});"ACTIVE"!=(null==C?void 0:C.status)||B.loading||B.loaded||B.canLoad||U({loading:!1,loaded:!1,canLoad:!0}),null==B||!B.canLoad||B.loading||B.loaded||(U({loading:!0,loaded:!1,canLoad:!0}),function(e,t,n,l){try{Promise.resolve(Digit.PTService.assessmentSearch({tenantId:e,filters:{propertyIds:t}})).then(function(r){function i(){n(o),l({loading:!1,loaded:!0,canLoad:!0})}let o={};const a=function(n){if((null==r||null===(n=r.Assessments)||void 0===n?void 0:n.length)>0)return Promise.resolve(Digit.PaymentService.fetchBill(e,{businessService:"PT",consumerCode:t})).then(function(e){o=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,F,U));const j=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()},H=function(e,t,n){if(void 0===t&&(t=0),"OPEN"===e.state||"INITIATED"===e.status&&!window.location.href.includes("/obps/")){var r;const e={date:j(null==C||null===(r=C.auditDetails)||void 0===r?void 0:r.createdTime),source:(null==C?void 0:C.channel)||""};return l.createElement(Gr,{data:e})}if(window.location.href.includes("/obps/")||window.location.href.includes("/noc/")||window.location.href.includes("/ws/")){var i,o,a,u,c,s,d,p,v,f,m,h,E,g,y,S,T,A;const r={uuid:null==e||null===(i=e.assignes)||void 0===i||null===(o=i[0])||void 0===o?void 0:o.uuid,fieldName:"mobileNumber",model:"User",showValue:!1,loadData:{serviceName:"/egov-workflow-v2/egov-wf/process/_search",requestBody:{},requestParam:{tenantId:null==b?void 0:b.tenantId,businessIds:null==b?void 0:b.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&&n[t-1]&&(null==n?void 0: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===(c=u[0])||void 0===c?void 0:c.name,mobileNumber:(null==C||null===(s=C.processInstance)||void 0===s||null===(d=s.assignes)||void 0===d||null===(p=d[0])||void 0===p?void 0:p.uuid)===(null==e||null===(v=e.assignes)||void 0===v||null===(f=v[0])||void 0===f?void 0:f.uuid)&&null!=C&&null!==(m=C.processInstance)&&void 0!==m&&null!==(h=m.assignes)&&void 0!==h&&null!==(E=h[0])&&void 0!==E&&E.mobileNumber?null==C||null===(g=C.processInstance)||void 0===g||null===(y=g.assignes)||void 0===y||null===(S=y[0])||void 0===S?void 0:S.mobileNumber:null==e||null===(T=e.assignes)||void 0===T||null===(A=T[0])||void 0===A?void 0:A.mobileNumber,comment:x(e&&(null==e?void 0:e.comment)),wfComment:D?D&&D.wfComment:[],thumbnailsToShow:null==e?void 0:e.thumbnailsToShow};return l.createElement(Gr,{data:N,OpenImage:M,privacy:r})}{var D,N,P,R,I;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===(P=N[0])||void 0===P?void 0:P.name,wfComment:null==e?void 0:e.wfComment,mobileNumber:null==e||null===(R=e.assignes)||void 0===R||null===(I=R[0])||void 0===I?void 0:I.mobileNumber,thumbnailsToShow:null==e?void 0:e.thumbnailsToShow};return l.createElement(Gr,{data:t,OpenImage:M})}},W=(e,t)=>e?t?e:x(e):x("NA"),z=window.location.href.includes("employee/tl")||window.location.href.includes("employee/obps")||window.location.href.includes("employee/noc"),V=window.location.href.includes("employee/noc"),K=window.location.href.includes("employee/obps"),Y=(window.location.href.includes("employee/ws"),()=>window.location.href.includes("employee/obps")||window.location.href.includes("employee/noc")||z?{justifyContent:"space-between",fontSize:"16px",lineHeight:"19px",color:"#0B0C0C"}:{}),q=e=>{if(null!=e&&e.isTimeValue&&null!=e&&e.value){const t=e.value,[n,l]=t.split(":").map(e=>parseInt(e,10));if(!isNaN(n)&&!isNaN(l)){const e=n>=12?"PM":"AM";return(n%12||12)+":"+String(l).padStart(2,"0")+" "+e}return e.value}return 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)+" "+x(null==e?void 0:e.isUnit):x("N/A"):null!=e&&e.value?W(null==e?void 0:e.value,null==e?void 0:e.isNotTranslated):x("N/A")},[$,G]=n.useState(!1);return l.createElement(t.Card,{style:{position:"relative"},className:"employeeCard-override"},w?l.createElement(li,{t:x,userType:!1,infoBannerLabel:"CS_FILE_APPLICATION_INFO_LABEL",infoClickLable:"WS_CLICK_ON_LABEL",infoClickInfoLabel:window.location.href.includes("disconnection")||window.location.href.includes("application")?"WS_DISCONNECTION_CLICK_ON_INFO_LABEL":"WS_CLICK_ON_INFO_LABEL",infoClickInfoLabel1:window.location.href.includes("disconnection")||window.location.href.includes("application")?"WS_DISCONNECTION_CLICK_ON_INFO1_LABEL":""}):null,null==b||null===(a=b.applicationDetails)||void 0===a?void 0:a.map((e,n)=>{var r,o,a,u,c,s,d,p,v,f,m,h,E,_,g,y,S,A,C,D,N,P,w,L,M,F,B,U,j,H,W,$,G,Z,X,J,Q,ee,te;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"}:z?{lineHeight:"19px",maxWidth:"600px",minWidth:"280px"}:{}},0!==n||e.asSectionHeader?l.createElement(l.Fragment,null,l.createElement(t.CardSectionHeader,{style:0==n&&z?{marginBottom:"16px",fontSize:"24px"}:{marginBottom:"16px",marginTop:"32px",fontSize:"24px"}},V?""+x(e.title):x(e.title),null!=e&&e.Component?l.createElement(e.Component,null):null)):l.createElement(t.CardSubHeader,{style:{marginBottom:"16px",fontSize:"24px"}},x(e.title)),(null==e?void 0:e.isTable)&&l.createElement("table",{style:{tableLayout:"fixed",width:"100%",borderCollapse:"collapse",borderCollapse:"collapse",border:"1px solid black"}},l.createElement("tr",{style:{textAlign:"left"}},null==e?void 0:e.headers.map(e=>l.createElement("th",{style:{padding:"10px",paddingLeft:"5px",border:"1px solid black"}},x(e)))),null==e?void 0:e.tableRows.map((n,r)=>l.createElement("tr",null,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;console.log("Response of file:",e);const r=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(r){const e=r.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"}},console.log("Comming Maintainaince data row:- ",n.data),n&&!0===n.editButton?l.createElement("span",{style:{display:"inline-flex",gap:"10px",alignItems:"center"}},l.createElement(i.Link,{to:{pathname:"/upyog-ui/employee/asset/assetservice/maintenance-edit/"+O,state:{data:n.data}}},l.createElement("button",null," ",l.createElement(t.EditIcon,null)," "))):x(n)))))),l.createElement(t.StatusTable,{style:window.location.href.includes("employee/obps")||window.location.href.includes("employee/noc")||z?{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,r)=>{var o,a,u;return!0===n.map&&"N/A"!==n.value?l.createElement(t.Row,{labelStyle:{wordBreak:"break-all"},textStyle:{wordBreak:"break-all"},key:x(n.title),label:x(n.title),text:l.createElement("img",{src:x(n.value),alt:"",privacy:null==n?void 0:n.privacy})}):1==(null==n?void 0:n.isLink)?l.createElement(t.Row,{key:x(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"}},x(null==n?void 0:n.title)))):V||K?""+x(n.title):x(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:r===(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",null,window.location.href.includes("modify")?l.createElement(t.Row,{className:"border-none",key:""+n.title,label:""+x(""+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:x(n.title),label:x(n.title),text:q(n),last:r===(null==e||null===(o=e.values)||void 0===o?void 0:o.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(ui,{bill:null===(a=k.Bill)||void 0===a?void 0:a[0]}):"")})))),(null==e?void 0:e.belowComponent)&&l.createElement(e.belowComponent,null),(null==e||null===(o=e.additionalDetails)||void 0===o?void 0:o.inspectionReport)&&l.createElement(tr,{scrutinyDetails:null==e?void 0:e.additionalDetails,paymentsList:R}),(null==b||null===(a=b.applicationData)||void 0===a||null===(u=a.additionalDetails)||void 0===u||null===(c=u.fieldinspection_pending)||void 0===c?void 0:c.length)>0&&(null==e||null===(s=e.additionalDetails)||void 0===s?void 0:s.fiReport)&&l.createElement(ql,{fiReport:null==b||null===(d=b.applicationData)||void 0===d||null===(p=d.additionalDetails)||void 0===p?void 0:p.fieldinspection_pending}),(null==e||null===(v=e.additionalDetails)||void 0===v?void 0:v.floors)&&l.createElement(Ql,{floors:null==e||null===(f=e.additionalDetails)||void 0===f?void 0:f.floors}),(null==e||null===(m=e.additionalDetails)||void 0===m?void 0:m.owners)&&l.createElement(er,{owners:null==e||null===(h=e.additionalDetails)||void 0===h?void 0:h.owners}),(null==e||null===(E=e.additionalDetails)||void 0===E?void 0:E.units)&&l.createElement(Xr,{units:null==e||null===(_=e.additionalDetails)||void 0===_?void 0:_.units}),(null==e||null===(g=e.additionalDetails)||void 0===g?void 0:g.accessories)&&l.createElement(Zr,{units:null==e||null===(y=e.additionalDetails)||void 0===y?void 0:y.accessories}),(null==e||null===(S=e.additionalDetails)||void 0===S?void 0:S.permissions)&&(null==T||null===(A=T.data)||void 0===A||null===(C=A.nextActions)||void 0===C?void 0:C.length)>0&&l.createElement(Zl,{applicationData:null==b?void 0:b.applicationData,t:x,permissions:null==e||null===(D=e.additionalDetails)||void 0===D?void 0:D.permissions}),(null==e||null===(N=e.additionalDetails)||void 0===N?void 0:N.obpsDocuments)&&l.createElement(Kl,{t:x,applicationData:null==b?void 0:b.applicationData,docs:e.additionalDetails.obpsDocuments,bpaActionsDetails:T}),(null==e||null===(P=e.additionalDetails)||void 0===P?void 0:P.noc)&&l.createElement(Gl,{t:x,isNoc:!0,NOCdata:e.values,applicationData:null==b?void 0:b.applicationData,docs:e.additionalDetails.noc,noc:null===(w=e.additionalDetails)||void 0===w?void 0:w.data,bpaActionsDetails:T}),(null==e||null===(L=e.additionalDetails)||void 0===L?void 0:L.scruntinyDetails)&&l.createElement(tr,{scrutinyDetails:null==e?void 0:e.additionalDetails}),(null==e||null===(M=e.additionalDetails)||void 0===M?void 0:M.buildingExtractionDetails)&&l.createElement(tr,{scrutinyDetails:null==e?void 0:e.additionalDetails}),(null==e||null===(F=e.additionalDetails)||void 0===F?void 0:F.subOccupancyTableDetails)&&l.createElement(nr,{edcrDetails:null==e?void 0:e.additionalDetails,applicationData:null==b?void 0:b.applicationData}),(null==e||null===(B=e.additionalDetails)||void 0===B?void 0:B.documentsWithUrl)&&l.createElement(Vl,{documents:null==e||null===(U=e.additionalDetails)||void 0===U?void 0:U.documentsWithUrl}),(null==e||null===(j=e.additionalDetails)||void 0===j?void 0:j.documents)&&l.createElement(Xl,{documents:null==e||null===(H=e.additionalDetails)||void 0===H?void 0:H.documents}),(null==e||null===(W=e.additionalDetails)||void 0===W?void 0:W.taxHeadEstimatesCalculation)&&l.createElement(Jl,{taxHeadEstimatesCalculation:null==e||null===($=e.additionalDetails)||void 0===$?void 0:$.taxHeadEstimatesCalculation}),(null==e?void 0:e.isWaterConnectionDetails)&&l.createElement(Jr,{wsAdditionalDetails:e,oldValue:I}),(null==e||null===(G=e.additionalDetails)||void 0===G?void 0:G.redirectUrl)&&l.createElement("div",{style:{fontSize:"16px",lineHeight:"24px",fontWeight:"400",padding:"10px 0px"}},l.createElement(i.Link,{to:null==e||null===(Z=e.additionalDetails)||void 0===Z||null===(X=Z.redirectUrl)||void 0===X?void 0:X.url},l.createElement("span",{className:"link",style:{color:"#a82227"}},null==e||null===(J=e.additionalDetails)||void 0===J||null===(Q=J.redirectUrl)||void 0===Q?void 0:Q.title))),(null==e||null===(ee=e.additionalDetails)||void 0===ee?void 0:ee.estimationDetails)&&l.createElement(ti,{wsAdditionalDetails:e,workflowDetails:T}),(null==e||null===(te=e.additionalDetails)||void 0===te?void 0:te.estimationDetails)&&l.createElement(ri,{wsAdditionalDetails:e,workflowDetails:T}))}),N&&(null==T||null===(u=T.data)||void 0===u||null===(c=u.timeline)||void 0===c?void 0:c.length)>0&&l.createElement(l.Fragment,null,l.createElement(t.BreakLine,null),((null==T?void 0:T.isLoading)||A)&&l.createElement(t.Loader,null),!(null!=T&&T.isLoading)&&!A&&l.createElement(n.Fragment,null,l.createElement("div",{id:"timeline"},l.createElement(t.CardSectionHeader,{style:{marginBottom:"16px",marginTop:"32px"}},x("ES_APPLICATION_DETAILS_APPLICATION_TIMELINE")),null!=T&&null!==(s=T.data)&&void 0!==s&&s.timeline&&1===(null==T||null===(d=T.data)||void 0===d||null===(p=d.timeline)||void 0===p?void 0:p.length)?l.createElement(t.CheckPoint,{isCompleted:!0,label:x(""+D+(null==T||null===(v=T.data)||void 0===v||null===(f=v.timeline[0])||void 0===f?void 0:f.state)),customChild:H(null==T||null===(m=T.data)||void 0===m?void 0:m.timeline[0],null==T||null===(h=T.data)||void 0===h?void 0:h.timeline)}):l.createElement(t.ConnectingCheckPoints,null,(null==T||null===(E=T.data)||void 0===E?void 0:E.timeline)&&(null==T||null===(g=T.data)||void 0===g?void 0:g.timeline.slice(0,$?null==T?void 0:T.data.timeline.length:2).map((e,n,r)=>{var i;let o="";var a,u,c,s,d,p;return window.location.href.includes("/obps/")&&(o=null!=T&&null!==(a=T.data)&&void 0!==a&&null!==(u=a.timeline[n-1])&&void 0!==u&&null!==(c=u.state)&&void 0!==c&&c.includes("BACK_FROM")||null!=T&&null!==(s=T.data)&&void 0!==s&&null!==(d=s.timeline[n-1])&&void 0!==d&&null!==(p=d.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:x(""+D+("REOPEN"===(null==e?void 0:e.performedAction)?null==e?void 0:e.performedAction:null==e?void 0:e[P])+o),customChild:H(e,n,null==T||null===(i=T.data)||void 0===i?void 0:i.timeline)}))}))),(null==T||null===(y=T.data)||void 0===y||null===(S=y.timeline)||void 0===S?void 0:S.length)>2&&l.createElement(t.LinkButton,{label:x($?"COLLAPSE":"VIEW_TIMELINE"),onClick:()=>{G(e=>!e)}})))))}function si(e){var n,r,i,o,a,u,c,s,d,p,v,f,m,h,E,_,g,y;let{t:S,showToast:b,closeToast:T,businessService:A}=e;if(null!=A&&A.includes("NewTL")||null!=A&&A.includes("TL")||null!=A&&A.includes("EDITRENEWAL")){var C;let e="";switch(null==b||null===(C=b.action)||void 0===C?void 0:C.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===(r=b.error)||void 0===r?void 0:r.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===(o=b.error)||void 0===o?void 0:o.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===(c=b.error)||void 0===c?void 0:c.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_"+A+"_"+(null==b||null===(d=b.action)||void 0===d?void 0:d.action)+"_UPDATE_SUCCESS")}return l.createElement(l.Fragment,null,b&&l.createElement(t.Toast,{error:"error"===b.key,label:e,onClose:T}))}if(null!=A&&A.includes("BPA")||null!=A&&A.includes("BPA_LOW")||null!=A&&A.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!=A&&A.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===(f=b.error)||void 0===f?void 0:f.message:e(["BPA_SENDBACK_SUCCESS_MESSAGE_MAIN"]);break;case"APPROVE":n="error"===(null==b?void 0:b.key)?null==b||null===(m=b.error)||void 0===m?void 0:m.message:e(["BPA_APPROVAL_CHECKLIST_MESSAGE_HEAD"]);break;case"REJECT":n="error"===(null==b?void 0:b.key)?null==b||null===(h=b.error)||void 0===h?void 0:h.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===(E=b.error)||void 0===E?void 0:E.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_"+A+"_"+(null==b||null===(y=b.action)||void 0===y?void 0:y.action)+"_UPDATE_SUCCESS")}return l.createElement(l.Fragment,null,b&&l.createElement(t.Toast,{error:"error"===b.key,label:n,onClose:T}))}{var N,P;const e="error"===(null==b?void 0:b.key)?null==b||null===(N=b.error)||void 0===N?void 0:N.message:"ES_"+A+"_"+(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 di(e){var i,o,a,c,s,d,p,v,f,m,h,E,_,g,y,S,b,T,A;let{workflowDetails:C,displayMenu:D,onActionSelect:N,setDisplayMenu:P,businessService:R,forcedActionPrefix:I,ActionBarStyle:w={},MenuStyle:x={},isAction:O,applicationDetails:L}=e;const{t:M}=r.useTranslation();let k=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):{};k=null==t?void 0:t.value}const B=null===(i=k)||void 0===i||null===(o=i.info)||void 0===o||null===(a=o.roles)||void 0===a?void 0:a.map(e=>e.code);let U=!1,j=!1,H=(null==C||null===(c=C.data)||void 0===c||null===(s=c.actionState)||void 0===s||null===(d=s.nextActions)||void 0===d?void 0:d.filter(e=>(null==B?void 0:B.some(t=>{var n;return null===(n=e.roles)||void 0===n?void 0:n.includes(t)}))||!e.roles))||(null==C||null===(p=C.data)||void 0===p||null===(v=p.nextActions)||void 0===v?void 0:v.filter(e=>(null==B?void 0:B.some(t=>{var n;return null===(n=e.roles)||void 0===n?void 0:n.includes(t)}))||!e.roles));Digit.Hooks.useClickOutside(F,()=>{P(!1)},D),(window.location.href.includes("/obps")||window.location.href.includes("/noc"))&&1==(null==H?void 0:H.length)||null!=H&&null!==(f=H[0])&&void 0!==f&&null!==(m=f.redirectionUrl)&&void 0!==m&&m.pathname.includes("/pt/property-details/")&&1==(null==H?void 0:H.length)?(j=!1,U=!0):(null==H?void 0:H.length)>0&&(j=!0,U=!1);const W=Digit.SessionStorage.get("User"),z=null==W||null===(h=W.info)||void 0===h?void 0:h.uuid,V=null==L||null===(E=L.applicationData)||void 0===E||null===(_=E.auditDetails)||void 0===_?void 0:_.lastModifiedBy;return l.createElement(l.Fragment,null,!(null!=C&&C.isLoading)&&j&&!U&&!O&&l.createElement(t.ActionBar,{style:u({},w)},D&&(null!=C&&null!==(g=C.data)&&void 0!==g&&null!==(y=g.actionState)&&void 0!==y&&y.nextActions||null!=C&&null!==(S=C.data)&&void 0!==S&&S.nextActions)?l.createElement(t.Menu,{localeKeyPrefix:I||"WF_EMPLOYEE_"+(null==R?void 0:R.toUpperCase()),options:H,optionKey:"action",t:M,onSelect:N,style:x}):null,"ewst"===R?V===z||null==V?l.createElement(t.SubmitBar,{ref:F,label:M("WF_TAKE_ACTION"),onSubmit:()=>P(!D)}):l.createElement(t.CardLabel,{style:{color:"red",font:"30px",fontWeight:"bold"}},""+M("EW_ALERT_ANOTHER_VENDOR")):l.createElement(t.SubmitBar,{ref:F,label:M("WF_TAKE_ACTION"),onSubmit:()=>P(!D)})),!(null!=C&&C.isLoading)&&!j&&U&&!O&&l.createElement(t.ActionBar,{style:u({},w)},l.createElement("button",{style:{color:"#FFFFFF",fontSize:"18px"},className:"submit-bar",name:null==H||null===(b=H[0])||void 0===b?void 0:b.action,value:null==H||null===(T=H[0])||void 0===T?void 0:T.action,onClick:e=>{N((null==H?void 0:H[0])||{})}},M((I||"WF_EMPLOYEE_"+(null==R?void 0:R.toUpperCase()))+"_"+(null==H||null===(A=H[0])||void 0===A?void 0:A.action)))))}const pi=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),vi=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(pi,null));function fi(e){let{action:n,closeWarningPopup:i}=e;const{t:o}=r.useTranslation(),a=window.Digit.Utils.browser.isMobile();return l.createElement(l.Fragment,null,l.createElement(t.Modal,{headerBarMain:l.createElement("h1",{className:"heading-m"},o("PT_DUES_ARE_PENDING")),headerBarEnd:l.createElement(vi,{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,o("PT_YOU_HAVE")," ₹",null==n?void 0:n.AmountDueForPay," ",o("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:""+o("PT_AMOUNT_DUE"),text:"₹"+o(null==n?void 0:n.AmountDueForPay)}),l.createElement("div",{style:{width:"100%",display:"flex",justifyContent:"flex-end"}},l.createElement(t.ButtonSelector,{theme:"border",label:o("ES_PT_COMMON_CANCEL"),onSubmit:i,style:{marginLeft:"10px"}}),l.createElement(t.ButtonSelector,{label:o("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 mi=e=>{var o;const c=Digit.ULBService.getCurrentTenantId(),s=Digit.ULBService.getStateId(),{t:d}=r.useTranslation(),p=i.useHistory();let{id:v}=i.useParams();const[f,m]=n.useState(!1),[h,E]=n.useState(null),[_,g]=n.useState(!1),[y,S]=n.useState(!1),[b,T]=n.useState(!1),{applicationDetails:A,showToast:C,setShowToast:D,isLoading:N,isDataLoading:P,applicationData:R,mutate:I,nocMutation:w,workflowDetails:x,id:O,businessService:L,closeToast:M,moduleCode:k,timelineStatusPrefix:F,forcedActionPrefix:B,statusAttribute:U,ActionBarStyle:j,MenuStyle:H,paymentsList:W,showTimeLine:z=!0,oldValue:V,isInfoLabel:K=!1,clearDataDetails:Y,isAction:q=!1}=e;n.useEffect(()=>{C&&x.revalidate()},[C]);const $=a.useQueryClient(),G=()=>{E(null),g(!1)};return N||y?l.createElement(t.Loader,null):l.createElement(l.Fragment,null,N?l.createElement(t.Loader,null):l.createElement(l.Fragment,null,l.createElement(ci,{applicationDetails:A,id:O,workflowDetails:x,isDataLoading:P,applicationData:R,businessService:L,timelineStatusPrefix:F,statusAttribute:U,paymentsList:W,showTimeLine:z,oldValue:V,isInfoLabel:K}),_?l.createElement(zl,{t:d,action:h,tenantId:c,state:s,id:v,applicationDetails:A,applicationData:null==A?void 0:A.applicationData,closeModal:G,submitAction:function(e,t,n){void 0===t&&(t=!1),void 0===n&&(n={});try{let l=!1;const r=function(r,i,o,a,c,s,v,f,m,E,_,g){if(0!=(null==e||null===(r=e.Property)||void 0===r||null===(i=r.workflow)||void 0===i||null===(o=i.comment)||void 0===o?void 0:o.length)&&0!=(null==e||null===(a=e.Licenses)||void 0===a||null===(c=a[0])||void 0===c||null===(s=c.comment)||void 0===s?void 0:s.length)&&0!=(null==e||null===(v=e.WaterConnection)||void 0===v||null===(f=v.comment)||void 0===f?void 0:f.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===(_=e.BPA)||void 0===_||null===(g=_.comment)||void 0===g?void 0:g.length)){function y(t){if(l)return t;sessionStorage.setItem("updateData",JSON.stringify(e)),I&&(S(!0),I(e,{onError:(e,t)=>{S(!1),D({key:"error",error:e}),setTimeout(M,5e3)},onSuccess:(e,t)=>{var l,r,i,o,a,u,c,s,v,f,m,E;sessionStorage.removeItem("WS_SESSION_APPLICATION_DETAILS"),S(!1),null!==(l=n)&&void 0!==l&&l.bpa&&p.replace("/upyog-ui/employee/obps/response",{data:e}),null!==(r=n)&&void 0!==r&&r.isStakeholder&&p.push("/upyog-ui/employee/obps/stakeholder-response",{data:e}),null!==(i=n)&&void 0!==i&&i.isNoc&&p.push("/upyog-ui/employee/noc/response",{data:e}),(null==e||null===(o=e.Amendments)||void 0===o?void 0:o.length)>0?null!=t&&null!==(a=t.AmendmentUpdate)&&void 0!==a&&null!==(u=a.workflow)&&void 0!==u&&u.action.includes("SEND_BACK")?D({key:"success",label:d("ES_MODIFYSWCONNECTION_SEND_BACK_UPDATE_SUCCESS")}):null!=t&&null!==(c=t.AmendmentUpdate)&&void 0!==c&&null!==(s=c.workflow)&&void 0!==s&&s.action.includes("RE-SUBMIT")?D({key:"success",label:d("ES_MODIFYSWCONNECTION_RE_SUBMIT_UPDATE_SUCCESS")}):null!=t&&null!==(v=t.AmendmentUpdate)&&void 0!==v&&null!==(f=v.workflow)&&void 0!==f&&f.action.includes("APPROVE")?D({key:"success",label:d("ES_MODIFYSWCONNECTION_APPROVE_UPDATE_SUCCESS")}):null!=t&&null!==(m=t.AmendmentUpdate)&&void 0!==m&&null!==(E=m.workflow)&&void 0!==E&&E.action.includes("REJECT")&&D({key:"success",label:d("ES_MODIFYWSCONNECTION_REJECT_UPDATE_SUCCESS")}):(D({key:"success",action:h}),Y&&setTimeout(Y,3e3),setTimeout(M,5e3),$.clear(),$.refetchQueries("APPLICATION_SEARCH"))}})),G()}S(!0),"function"==typeof(null==e?void 0:e.customFunctionToExecute)&&(null==e||e.customFunctionToExecute(u({},e)));const r=function(){if(!1!==t&&w){var e;const n=null===(e=t)||void 0===e?void 0:e.map(e=>null==w?void 0:w.mutateAsync(e)),r=$e(function(){return S(!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,r,i,o,a,u,c,s,p,v,f;S(!1);let m=null!=e&&null!==(t=e.response)&&void 0!==t&&null!==(n=t.data)&&void 0!==n&&null!==(r=n.Errors)&&void 0!==r&&null!==(i=r[0])&&void 0!==i&&i.code?d(null==e||null===(o=e.response)||void 0===o||null===(a=o.data)||void 0===a||null===(u=a.Errors)||void 0===u||null===(c=u[0])||void 0===c?void 0:c.code):(null==e||null===(s=e.response)||void 0===s||null===(p=s.data)||void 0===p||null===(v=p.Errors)||void 0===v||null===(f=v[0])||void 0===f?void 0:f.message)||e;G(),D({key:"error",error:{message:m}}),setTimeout(M,5e3),l=!0});if(r&&r.then)return r.then(function(){})}}();return r&&r.then?r.then(y):y(r)}alert("Please fill in the comments before submitting")}();return Promise.resolve(r&&r.then?r.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},actionData:null==x||null===(o=x.data)||void 0===o?void 0:o.timeline,businessService:L,workflowDetails:x,moduleCode:k}):null,b?l.createElement(fi,{action:h,workflowDetails:x,businessService:L,isWarningPop:b,closeWarningPopup:()=>{T(!1)}}):null,l.createElement(si,{t:d,showToast:C,closeToast:M,businessService:L}),l.createElement(di,{isAction:q,workflowDetails:x,displayMenu:f,onActionSelect:function(e){if(sessionStorage.setItem("SELECTED_ACTION",null==e?void 0:e.action),e)if(null!=e&&e.isToast)D({key:"error",error:{message:null==e?void 0:e.toastMessage}}),setTimeout(M,5e3);else if(null!=e&&e.isWarningPopUp)T(!0);else if(null!=e&&e.redirectionUrll){var t,n,l,r,i;if("ACTIVATE_CONNECTION"===(null==e||null===(t=e.redirectionUrll)||void 0===t?void 0:t.action))p.push(""+(null==e||null===(l=e.redirectionUrll)||void 0===l?void 0:l.pathname),JSON.stringify({data:null==e||null===(r=e.redirectionUrll)||void 0===r?void 0:r.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 o,a;p.push(""+(null==e||null===(o=e.redirectionUrll)||void 0===o?void 0:o.pathname),{data:null==e||null===(a=e.redirectionUrll)||void 0===a?void 0:a.state})}else{var c;window.location.assign(window.location.origin+"/upyog-ui/employee/payment/collect/"+(null==e||null===(c=e.redirectionUrll)||void 0===c?void 0:c.pathname))}}else if(null!=e&&e.redirectionUrl){var s,d;p.push({pathname:null===(s=e.redirectionUrl)||void 0===s?void 0:s.pathname,state:u({},null===(d=e.redirectionUrl)||void 0===d?void 0:d.state)})}else g(!0);E(e),m(!1)},setDisplayMenu:m,businessService:L,forcedActionPrefix:B,ActionBarStyle:j,MenuStyle:H,applicationDetails:A})))},hi=["tenantId","payments"];var Ei=l.memo(()=>{var e,o,a,s,d,p,v,m,h,E,_,g,y,S;const{t:b}=r.useTranslation(),{data:T}=Digit.Hooks.useStore.getInitData(),A=Digit.ULBService.getCurrentTenantId(),{tenants:C}=T||{},{id:D}=i.useParams(),[N,P]=n.useState(null),[R,w]=n.useState({}),[x,O]=n.useState(!1),[L,M]=n.useState(!1),[k,F]=n.useState("ptr");i.useHistory();let B=!1;window.location.href.includes("applicationsearch")&&(B=!0),sessionStorage.setItem("applicationNoinAppDetails",D);const{isLoading:U,data:j}=Digit.Hooks.ptr.usePtrApplicationDetail(b,A,D),{mutate:H}=Digit.Hooks.ptr.usePTRApplicationAction(A);let W=Digit.Hooks.useWorkflowDetails({tenantId:(null==j||null===(e=j.applicationData)||void 0===e?void 0:e.tenantId)||A,id:null==j||null===(o=j.applicationData)||void 0===o||null===(a=o.applicationData)||void 0===a?void 0:a.applicationNumber,moduleCode:k,role:"PTR_CEMP"});var z,V;Digit.Hooks.ptr.usePTRSearch({tenantId:A,filters:{applicationNumber:D,audit:!0}}),n.useEffect(()=>{j&&w(f.cloneDeep(j))},[j]),n.useEffect(()=>{var e,t,n;null==W||null===(e=W.data)||void 0===e||!e.applicationBusinessService||"ptr"===(null==W||null===(t=W.data)||void 0===t?void 0:t.applicationBusinessService)&&"ptr"===k||F(null==W||null===(n=W.data)||void 0===n?void 0:n.applicationBusinessService)},[W.data]),!Digit.UserService.hasAccess(["PTR_CEMP"])||"ptr"!==(null==W||null===(s=W.data)||void 0===s?void 0:s.applicationBusinessService)||null==W||null===(d=W.data)||void 0===d||null===(p=d.actionState)||void 0===p||null===(v=p.nextActions)||void 0===v||!v.find(e=>"PAY"===e.action)||(W.data.actionState.nextActions=null==W||null===(z=W.data)||void 0===z||null===(V=z.actionState)||void 0===V?void 0:V.nextActions.map(e=>{var t,n;return"PAY"===e.action?{action:"PAY",forcedName:"WF_PAY_APPLICATION",redirectionUrl:{pathname:"/upyog-ui/employee/payment/collect/pet-services/"+(null==R||null===(t=R.applicationData)||void 0===t||null===(n=t.applicationData)||void 0===n?void 0:n.applicationNumber)}}:e}));let K=[{order:1,label:b("PTR_APPLICATION"),onClick:()=>function(){try{const e=null==R?void 0:R.applicationData,t=C.find(t=>t.code===e.tenantId);return Promise.resolve(I(e.applicationData,t,b)).then(function(e){Digit.Utils.pdf.generate(e)})}catch(e){return Promise.reject(e)}}()}];const{data:Y,isLoading:q}=Digit.Hooks.useRecieptSearch({tenantId:A,businessService:"pet-services",consumerCodes:null==R||null===(m=R.applicationData)||void 0===m||null===(h=m.applicationData)||void 0===h?void 0:h.applicationNumber,isEmployee:!1},{enabled:!(null==R||null===(E=R.applicationData)||void 0===E||null===(_=E.applicationData)||void 0===_||!_.applicationNumber)});return Y&&(null==Y?void 0:Y.Payments.length)>0&&0==q&&K.push({label:b("PTR_FEE_RECIEPT"),onClick:()=>{var e;return function(e){let{tenantId:t,payments:n}=e;c(e,hi);try{let e={filestoreIds:[null==n?void 0:n.fileStoreId]};return Promise.resolve(Digit.PaymentService.generatePdf(t,{Payments:[u({},n)]},"petservice-receipt")).then(function(n){return e=n,Promise.resolve(Digit.PaymentService.printReciept(t,{fileStoreIds:e.filestoreIds[0]})).then(function(t){var n;window.open(t[null===(n=e)||void 0===n?void 0:n.filestoreIds[0]],"_blank")})})}catch(e){return Promise.reject(e)}}({tenantId:null==Y||null===(e=Y.Payments[0])||void 0===e?void 0:e.tenantId,payments:null==Y?void 0:Y.Payments[0]})}}),Y&&(null==Y?void 0:Y.Payments.length)>0&&0==q&&K.push({label:b("PTR_CERTIFICATE"),onClick:()=>function(){try{var e;return Promise.resolve(Digit.PaymentService.generatePdf(A,{PetRegistrationApplications:[null==j||null===(e=j.applicationData)||void 0===e?void 0:e.applicationData]},"petservicecertificate")).then(function(e){return Promise.resolve(Digit.PaymentService.printReciept(A,{fileStoreIds:e.filestoreIds[0]})).then(function(t){window.open(t[null==e?void 0:e.filestoreIds[0]],"_blank")})})}catch(e){return Promise.reject(e)}}()}),l.createElement("div",null,l.createElement("div",{className:"employee-application-details",style:{marginBottom:"15px"}},l.createElement(t.Header,{styles:{marginLeft:"0px",paddingTop:"10px",fontSize:"32px"}},b("PTR_PET_APPLICATION_DETAILS")),l.createElement("div",{style:{zIndex:"10",display:"flex",flexDirection:"row-reverse",alignItems:"center",marginTop:"-25px"}},l.createElement("div",{style:{zIndex:"10",position:"relative"}},K&&K.length>0&&l.createElement(t.MultiLink,{className:"multilinkWrapper",onHeadClick:()=>O(!x),displayOptions:x,options:K,downloadBtnClassName:"employee-download-btn-className",optionsClassName:"employee-options-btn-className"})))),l.createElement(mi,{isAction:B,applicationDetails:null==R?void 0:R.applicationData,isLoading:U,isDataLoading:U,applicationData:null==R||null===(g=R.applicationData)||void 0===g?void 0:g.applicationData,mutate:H,workflowDetails:W,businessService:k,moduleCode:"pet-services",showToast:N,setShowToast:P,closeToast:()=>{P(null)},timelineStatusPrefix:"PTR_COMMON_STATUS_",forcedActionPrefix:"EMPLOYEE_PTR",statusAttribute:"state",MenuStyle:{color:"#FFFFFF",fontSize:"18px"}}),"Expired"==(null==R||null===(y=R.applicationData)||void 0===y||null===(S=y.applicationData)||void 0===S?void 0:S.status)&&l.createElement(i.Link,{to:"/upyog-ui/employee/ptr/petservice/revised-application"},l.createElement(t.SubmitBar,{style:{marginBottom:"5px"},label:"Renewal"})))});const _i={PTRCheckPage:e=>{var i,o,a,u,c,s;let{onSubmit:p,value:v={}}=e;const{t:f}=r.useTranslation(),{address:h,pets:E,isEditPET:_,isUpdatePET:g,ownerss:y}=v,S=_||g?"edit-application":"new-application",[b,T]=n.useState(!1);return l.createElement(l.Fragment,null,l.createElement(d,{currentStep:5}),l.createElement(t.Card,null,l.createElement(t.CardHeader,null,f("PTR_CHECK_YOUR_DETAILS")),l.createElement("div",null,l.createElement("br",null),l.createElement(t.CardSubHeader,null,f("ES_TITILE_OWNER_DETAILS")),l.createElement("br",null),l.createElement(t.StatusTable,null,l.createElement(t.Row,{label:f("PTR_APPLICANT_NAME"),text:""+f(m(null==y?void 0:y.applicantName)),actionButton:l.createElement(N,{jumpTo:"/upyog-ui/citizen/ptr/petservice/"+S+"/owners"})}),l.createElement(t.Row,{label:f("PTR_FATHER_HUSBAND_NAME"),text:""+f(m(null==y?void 0:y.fatherName)),actionButton:l.createElement(N,{jumpTo:"/upyog-ui/citizen/ptr/petservice/"+S+"/owners"})}),l.createElement(t.Row,{label:f("PTR_MOBILE_NUMBER"),text:""+f(m(null==y?void 0:y.mobileNumber)),actionButton:l.createElement(N,{jumpTo:"/upyog-ui/citizen/ptr/petservice/"+S+"/owners"})}),l.createElement(t.Row,{label:f("PTR_EMAIL_ID"),text:""+f(m(null==y?void 0:y.emailId)),actionButton:l.createElement(N,{jumpTo:"/upyog-ui/citizen/ptr/petservice/"+S+"/owners"})})),l.createElement("br",null),l.createElement(t.CardSubHeader,null,f("ES_TITILE_PET_DETAILS")),l.createElement("br",null),l.createElement(t.StatusTable,null,l.createElement(t.Row,{label:f("PTR_SEARCH_PET_TYPE"),text:""+f(m(null==E||null===(i=E.petType)||void 0===i?void 0:i.value)),actionButton:l.createElement(N,{jumpTo:"/upyog-ui/citizen/ptr/petservice/"+S+"/pet-details"})}),l.createElement(t.Row,{label:f("PTR_SEARCH_BREED_TYPE"),text:""+f(m(null==E||null===(o=E.breedType)||void 0===o?void 0:o.value)),actionButton:l.createElement(N,{jumpTo:"/upyog-ui/citizen/ptr/petservice/"+S+"/pet-details"})}),l.createElement(t.Row,{label:f("PTR_PET_NAME"),text:""+f(m(null==E?void 0:E.petName)),actionButton:l.createElement(N,{jumpTo:"/upyog-ui/citizen/ptr/petservice/"+S+"/pet-details"})}),l.createElement(t.Row,{label:f("PTR_DOCTOR_NAME"),text:""+f(m(null==E?void 0:E.doctorName)),actionButton:l.createElement(N,{jumpTo:"/upyog-ui/citizen/ptr/petservice/"+S+"/pet-details"})}),l.createElement(t.Row,{label:f("PTR_CLINIC_NAME"),text:""+f(m(null==E?void 0:E.clinicName)),actionButton:l.createElement(N,{jumpTo:"/upyog-ui/citizen/ptr/petservice/"+S+"/pet-details"})}),l.createElement(t.Row,{label:f("PTR_VACCINATED_DATE"),text:""+f(m(null==E?void 0:E.lastVaccineDate)),actionButton:l.createElement(N,{jumpTo:"/upyog-ui/citizen/ptr/petservice/"+S+"/pet-details"})}),l.createElement(t.Row,{label:f("PTR_PET_AGE"),text:""+f(m((null==E?void 0:E.petAge)+" Months")),actionButton:l.createElement(N,{jumpTo:"/upyog-ui/citizen/ptr/petservice/"+S+"/pet-details"})}),l.createElement(t.Row,{label:f("PTR_PET_SEX"),text:""+f(m(null==E||null===(a=E.petGender)||void 0===a?void 0:a.name)),actionButton:l.createElement(N,{jumpTo:"/upyog-ui/citizen/ptr/petservice/"+S+"/pet-details"})}),l.createElement(t.Row,{label:f("PTR_IDENTIFICATION_MARK"),text:""+f(m(null==E?void 0:E.identificationMark)),actionButton:l.createElement(N,{jumpTo:"/upyog-ui/citizen/ptr/petservice/"+S+"/pet-details"})}),l.createElement(t.Row,{label:f("PTR_PET_COLOR"),text:""+f(m(null==E||null===(u=E.petColor)||void 0===u?void 0:u.code)),actionButton:l.createElement(N,{jumpTo:"/upyog-ui/citizen/ptr/petservice/"+S+"/pet-details"})}),l.createElement(t.Row,{label:f("PTR_VACCINATION_NUMBER"),text:""+f(m(null==E?void 0:E.vaccinationNumber)),actionButton:l.createElement(N,{jumpTo:"/upyog-ui/citizen/ptr/petservice/"+S+"/pet-details"})}),l.createElement(t.Row,{label:f("PTR_SEARCH_BIRTH_ADOPTION"),text:""+f(m(null!=E&&E.adoptionDate?null==E?void 0:E.adoptionDate:null==E?void 0:E.birthDate)),actionButton:l.createElement(N,{jumpTo:"/upyog-ui/citizen/ptr/petservice/"+S+"/pet-details"})})),l.createElement("br",null),l.createElement(t.CardSubHeader,null,f("PTR_LOCATION_DETAILS")),l.createElement("br",null),l.createElement(t.StatusTable,null,l.createElement(t.Row,{label:f("PTR_HOUSE_NO"),text:""+f(m(null==h?void 0:h.houseNo)),actionButton:l.createElement(N,{jumpTo:"/upyog-ui/citizen/ptr/petservice/"+S+"/address"})}),(null==h?void 0:h.houseName)&&l.createElement(t.Row,{label:f("PTR_HOUSE_NAME"),text:""+f(m(null==h?void 0:h.houseName)),actionButton:l.createElement(N,{jumpTo:"/upyog-ui/citizen/ptr/petservice/"+S+"/address"})}),l.createElement(t.Row,{label:f("PTR_STREET_NAME"),text:""+f(m(null==h?void 0:h.streetName)),actionButton:l.createElement(N,{jumpTo:"/upyog-ui/citizen/ptr/petservice/"+S+"/address"})}),l.createElement(t.Row,{label:f("PTR_ADDRESS_LINE1"),text:""+f(m(null==h?void 0:h.addressline1)),actionButton:l.createElement(N,{jumpTo:"/upyog-ui/citizen/ptr/petservice/"+S+"/address"})}),(null==h?void 0:h.addressline2)&&l.createElement(t.Row,{label:f("PTR_ADDRESS_LINE2"),text:""+f(m(null==h?void 0:h.addressline2)),actionButton:l.createElement(N,{jumpTo:"/upyog-ui/citizen/ptr/petservice/"+S+"/address"})}),l.createElement(t.Row,{label:f("PTR_ADDRESS_PINCODE"),text:""+f(m(null==h?void 0:h.pincode)),actionButton:l.createElement(N,{jumpTo:"/upyog-ui/citizen/ptr/petservice/"+S+"/address"})}),l.createElement(t.Row,{label:f("MYCITY_CODE_LABEL"),text:""+f(m(null==h||null===(c=h.city)||void 0===c?void 0:c.name)),actionButton:l.createElement(N,{jumpTo:"/upyog-ui/citizen/ptr/petservice/"+S+"/address"})}),l.createElement(t.Row,{label:f("PTR_LOCALITY"),text:""+f(m(null==h||null===(s=h.locality)||void 0===s?void 0:s.i18nKey)),actionButton:l.createElement(N,{jumpTo:"/upyog-ui/citizen/ptr/petservice/"+S+"/address"})}),l.createElement(t.Row,{label:f("PTR_LANDMARK"),text:""+f(m(null==h?void 0:h.landmark)),actionButton:l.createElement(N,{jumpTo:"/upyog-ui/citizen/ptr/petservice/"+S+"/address"})})),l.createElement("br",null),l.createElement(t.CheckBox,{label:f("PTR_FINAL_DECLARATION_MESSAGE"),onChange:()=>{T(!b)},styles:{height:"auto"}})),l.createElement(t.SubmitBar,{label:f("PTR_COMMON_BUTTON_SUBMIT"),onSubmit:p,disabled:!b})))},PTRAcknowledgement:e=>{var o,a;let{data:c,onSuccess:s}=e;const{t:d}=r.useTranslation(),p=Digit.ULBService.getCitizenCurrentTenant(!0)||Digit.ULBService.getCurrentTenantId(),v=Digit.UserService.getUser().info,f=Digit.Hooks.ptr.usePTRCreateAPI(null===(o=c.address)||void 0===o||null===(a=o.city)||void 0===a?void 0:a.code),{data:m}=Digit.Hooks.useStore.getInitData(),{tenants:h}=m||{};return n.useEffect(()=>{try{c.tenantId=p;let e=(e=>{var t,n,l,r,i,o;return e=(e=>{let{ownerss:t}=e,n=u({},t);return e.ownerss=n,e})(e),{PetRegistrationApplications:[u({tenantId:(e=(e=>{var t,n,l,r;let{pets:i}=e,o={petType:null==i||null===(t=i.petType)||void 0===t?void 0:t.value,breedType:null==i||null===(n=i.breedType)||void 0===n?void 0:n.value,petGender:null==i||null===(l=i.petGender)||void 0===l?void 0:l.code,birthDate:null!=i&&i.birthDate?E(null==i?void 0:i.birthDate):null,adoptionDate:null!=i&&i.adoptionDate?E(null==i?void 0:i.adoptionDate):null,identificationMark:null==i?void 0:i.identificationMark,petColor:null==i||null===(r=i.petColor)||void 0===r?void 0:r.colourCode,clinicName:null==i?void 0:i.clinicName,petName:null==i?void 0:i.petName,doctorName:null==i?void 0:i.doctorName,lastVaccineDate:null==i?void 0:i.lastVaccineDate,petAge:null==i?void 0:i.petAge,vaccinationNumber:null==i?void 0:i.vaccinationNumber};return e.pets=o,e})(e=(e=>{var t,n,l;let{address:r}=e,i={pincode:null==r?void 0:r.pincode,landmark:null==r?void 0:r.landmark,city:null==r||null===(t=r.city)||void 0===t?void 0:t.name,doorNo:(null==r?void 0:r.houseNo)||null,street:(null==r?void 0:r.streetName)||null,locality:{code:(null==r||null===(n=r.locality)||void 0===n?void 0:n.i18nKey)||"NA",area:null==r||null===(l=r.locality)||void 0===l?void 0:l.name},buildingName:null==r?void 0:r.houseName,addressLine1:null==r?void 0:r.addressline1,addressLine2:null==r?void 0:r.addressline2,propertyId:(null==r?void 0:r.propertyId)||null};return e.address=i,e})(e))).tenantId},null===(t=e)||void 0===t?void 0:t.ownerss,{applicationType:sessionStorage.getItem("applicationType"),validityDate:(null===(n=e)||void 0===n?void 0:n.validityDate)||null,status:(null===(l=e)||void 0===l?void 0:l.status)||null,expireflag:!1,petToken:sessionStorage.getItem("petToken")||"",previousapplicationnumber:sessionStorage.getItem("petId"),address:e.address,petDetails:e.pets},null===(r=e)||void 0===r?void 0:r.documents,{propertyId:null===(i=e)||void 0===i||null===(o=i.address)||void 0===o?void 0:o.propertyId,workflow:{businessService:"ptr",action:"APPLY",moduleName:"pet-services"}})]}})(c);f.mutate(e,{onSuccess:s})}catch(e){}},[]),f.isLoading||f.isIdle?l.createElement(t.Loader,null):l.createElement(t.Card,null,l.createElement(O,{t:d,data:f.data,isSuccess:f.isSuccess,isLoading:f.isIdle||f.isLoading}),l.createElement(t.StatusTable,null,f.isSuccess&&l.createElement(t.Row,{rowContainerStyle:x,last:!0,textStyle:{whiteSpace:"pre",width:"60%"}})),f.isSuccess&&l.createElement(t.SubmitBar,{label:d("PTR_PET_DOWNLOAD_ACK_FORM"),onSubmit:function(){try{const{PetRegistrationApplications:e=[]}=f.data;let t=e&&e[0]||{};const n=h.find(e=>e.code===t.tenantId);return Promise.resolve(I(u({},t),n,d)).then(function(e){Digit.Utils.pdf.generate(e)})}catch(e){return Promise.reject(e)}}}),l.createElement(i.Link,"CITIZEN"===(null==v?void 0:v.type)?{to:"/upyog-ui/citizen"}:{to:"/upyog-ui/employee"},l.createElement(t.LinkButton,{label:d("CORE_COMMON_GO_TO_HOME")})))},PTRWFCaption:b,PTRNewApplication:e=>{var n,o,c,s;const d=a.useQueryClient(),p=i.useRouteMatch(),{t:v}=r.useTranslation(),{pathname:f}=i.useLocation(),m=i.useHistory();Digit.ULBService.getStateId();let h=[];const[E,_,g]=Digit.Hooks.useSessionStorage("PTR_CREATE_PET",{});let{data:S,isLoading:b}=Digit.Hooks.useEnabledMDMS(Digit.ULBService.getStateId(),"PetService",[{name:"CommonFieldsConfig"}],{select:e=>{var t;return null==e||null===(t=e.PetService)||void 0===t?void 0:t.CommonFieldsConfigEmp}});const T=sessionStorage.getItem("petId")?sessionStorage.getItem("petId"):null;sessionStorage.setItem("applicationType",f.includes("new-application")?"NEWAPPLICATION":"RENEWAPPLICATION");const A=Digit.ULBService.getCitizenCurrentTenant(!0),{data:C}=Digit.Hooks.ptr.usePTRSearch({tenantId:A,filters:{applicationNumber:T}});let D=null==C?void 0:C.PetRegistrationApplications[0];function N(e,t,n,l,r){if(void 0===r&&(r=!1),"owners"===e){let n=E.owners||[];n[l]=t,_(u({},E,{[e]:[...n]}))}else if("units"===e){let e=E.units||[];e=t,_(u({},E,{units:e}))}else _(u({},E,{[e]:u({},E[e],t)}));((e,t,n,l)=>{let r,i=f.split("/").pop(),o=i.charAt(i.length-1),a=!1;Number(parseInt(i))||"0"==i||"-1"==i?"-1"==i||"-2"==i?(i=f.slice(0,-3),i=i.split("/").pop(),a=!0):(i=f.slice(0,-2),i=i.split("/").pop(),a=!0):a=!1,isNaN(o)||(a=!0);let{nextStep:u={}}=h.find(e=>e.route===(i||"0")),c=m.push;if(e&&(c=m.replace),n&&(u=l),null===u)return c(p.path+"/check");r=isNaN(u.split("/").pop())&&a&&"map"!==u?p.path+"/"+u+"/"+t:p.path+"/"+u,c(r)})(n,l,r,e)}E&&Object.keys(E).length>0&&window.location.href.includes("/info")&&"true"!==sessionStorage.getItem("docReqScreenByBack")&&(g(),d.invalidateQueries("PTR_CREATE_PET"));const P=()=>{},R=()=>{};if(b)return l.createElement(t.Loader,null);S=S||y,S.forEach(e=>{h=h.concat(e.body.filter(e=>!e.hideInCitizen))}),h.indexRoute="info";const I=null===(n=Digit)||void 0===n||null===(o=n.ComponentRegistryService)||void 0===o?void 0:o.getComponent("PTRCheckPage"),w=null===(c=Digit)||void 0===c||null===(s=c.ComponentRegistryService)||void 0===s?void 0:s.getComponent("PTRAcknowledgement");return l.createElement(i.Switch,null,h.map((e,t)=>{const{component:n,texts:r,inputs:o,key:a}=e,u="string"==typeof n?Digit.ComponentRegistryService.getComponent(n):n;return l.createElement(i.Route,{path:p.path+"/"+e.route,key:t},l.createElement(u,{config:{texts:r,inputs:o,key:a},onSelect:N,onSkip:P,t:v,formData:E,onAdd:R,renewApplication:f.includes("new-application")?{}:D}))}),l.createElement(i.Route,{path:p.path+"/check"},l.createElement(I,{onSubmit:function(){try{return m.push(p.path+"/acknowledgement"),Promise.resolve()}catch(e){return Promise.reject(e)}},value:E})),l.createElement(i.Route,{path:p.path+"/acknowledgement"},l.createElement(w,{data:E,onSuccess:()=>{g(),d.invalidateQueries("PTR_CREATE_PET"),sessionStorage.removeItem(["applicationType","petId"])}})),l.createElement(i.Route,null,l.createElement(i.Redirect,{to:p.path+"/"+h.indexRoute})))},ApplicationDetails:Ei,PTRMyApplications:()=>{const{t:e}=r.useTranslation(),n=Digit.ULBService.getCitizenCurrentTenant(!0)||Digit.ULBService.getCurrentTenantId(),o=Digit.UserService.getUser().info;let a,u,c=window.location.href.split("/").pop();isNaN(parseInt(c))?a=4:(u=c,a=parseInt(c)+50);let s=isNaN(parseInt(c))?{limit:"4",sortOrder:"ASC",sortBy:"createdTime",offset:"0",mobileNumber:null==o?void 0:o.mobileNumber,tenantId:n}:{limit:"50",sortOrder:"ASC",sortBy:"createdTime",offset:u,tenantId:n};const{isLoading:d,data:p}=Digit.Hooks.ptr.usePTRSearch({filters:s},{filters:s}),{PetRegistrationApplications:v}=p||{};let f=(null==v?void 0:v.length)>0?null==v?void 0:v.map(e=>null==e?void 0:e.applicationNumber):[],m={tenantId:n,referenceIds:f};const{isLoading:h,data:E}=Digit.Hooks.useFeedBackSearch({filters:{serviceSearchArgs:m}},{filters:{serviceSearchArgs:m},enabled:(null==f?void 0:f.length)>0,cacheTime:0});function _(t){var n;let l=null==E||null===(n=E.Service)||void 0===n?void 0:n.find(e=>{var n;return null==e||null===(n=e.referenceId)||void 0===n?void 0:n.includes(null==t?void 0:t.applicationNumber)});return e(l?"CS_CF_VIEW":"CS_CF_TRACK")}return d||h?l.createElement(t.Loader,null):l.createElement(l.Fragment,null,l.createElement(t.Header,null,e("CS_TITLE_MY_APPLICATIONS")+" "+(v?"("+v.length+")":"")),l.createElement("div",null,(null==v?void 0:v.length)>0&&v.map((e,t)=>l.createElement("div",{key:t},l.createElement(L,{application:e,tenantId:null==o?void 0:o.permanentCity,buttonLabel:_(e)}))),!(null!=v&&v.length)>0&&l.createElement("p",{style:{marginLeft:"16px",marginTop:"16px"}},e("PTR_NO_APPLICATION_FOUND_MSG")),0!==(null==v?void 0:v.length)&&l.createElement("div",null,l.createElement("p",{style:{marginLeft:"16px",marginTop:"16px"}},l.createElement("span",{className:"link"},l.createElement(i.Link,{to:"/upyog-ui/citizen/ptr/petservice/my-application/"+a},e("PTR_LOAD_MORE_MSG")))))),l.createElement("p",{style:{marginLeft:"16px",marginTop:"16px"}},e("PTR_TEXT_NOT_ABLE_TO_FIND_THE_APPLICATION")," ",l.createElement("span",{className:"link",style:{display:"block"}},l.createElement(i.Link,{to:"/upyog-ui/citizen/ptr/petservice/new-application/info"},e("PTR_COMMON_CLICK_HERE_TO_REGISTER_NEW_PET")))))},PTRApplicationDetails:()=>{var e,o,a,s,d,p,v,f,m,E,_,g,y,S,b,A,C,D,N,P;const{t:R}=r.useTranslation(),{acknowledgementIds:w,tenantId:x}=i.useParams(),[O,L]=n.useState(!1),[M,k]=n.useState(!1),[F,B]=n.useState(null),{data:U}=Digit.Hooks.useStore.getInitData(),{tenants:j}=U||{},{isLoading:H,data:W}=Digit.Hooks.ptr.usePTRSearch({tenantId:x,filters:{applicationNumber:w}}),[z,V]=n.useState(null),K=Ce(W,"PetRegistrationApplications",[]),Y=Ce(W,"PetRegistrationApplications[0].applicationNumber",[]);let q=K&&K.length>0&&K[0]||{};const $=q;sessionStorage.setItem("ptr-pet",JSON.stringify($));const[G,Z]=n.useState(!1);n.useEffect(()=>{!function(){try{Z(!0),Promise.resolve(Digit.PaymentService.fetchBill(x,{businessService:"pet-services",consumerCode:w})).then(function(e){V(e),Z(!1)})}catch(e){return Promise.reject(e)}}()},[x,w]);const{isLoading:X}=Digit.Hooks.ptr.usePTRSearch({tenantId:x,filters:{applicationNumber:Y,audit:!0}},{enabled:!0}),{data:J,isLoading:Q}=Digit.Hooks.useRecieptSearch({tenantId:x,businessService:"pet-services",consumerCodes:w,isEmployee:!1},{enabled:!!w});if(q.workflow||(q.workflow={id:null,tenantId:x,businessService:"pet-services",businessId:null==$?void 0:$.applicationNumber,action:"",moduleName:"pet-services",state:null,comment:null,documents:null,assignes:null}),H||X)return l.createElement(t.Loader,null);let ee=[];return ee.push({label:R("PTR_PET_DOWNLOAD_ACK_FORM"),onClick:()=>function(){try{const e=$||{},t=j.find(t=>t.code===e.tenantId);return Promise.resolve(I(u({},e),t,R)).then(function(e){Digit.Utils.pdf.generate(e)})}catch(e){return Promise.reject(e)}}()}),J&&(null==J?void 0:J.Payments.length)>0&&0==Q&&ee.push({label:R("PTR_FEE_RECIEPT"),onClick:()=>{var e;return function(e){let{tenantId:t,payments:n}=e;c(e,De);try{let e={filestoreIds:[null==n?void 0:n.fileStoreId]};return Promise.resolve(Digit.PaymentService.generatePdf(t,{Payments:[u({},n)]},"petservice-receipt")).then(function(n){return e=n,Promise.resolve(Digit.PaymentService.printReciept(t,{fileStoreIds:e.filestoreIds[0]})).then(function(t){var n;window.open(t[null===(n=e)||void 0===n?void 0:n.filestoreIds[0]],"_blank")})})}catch(e){return Promise.reject(e)}}({tenantId:null==J||null===(e=J.Payments[0])||void 0===e?void 0:e.tenantId,payments:null==J?void 0:J.Payments[0]})}}),J&&(null==J?void 0:J.Payments.length)>0&&0==Q&&ee.push({label:R("PTR_CERTIFICATE"),onClick:()=>function(){try{var e;return Promise.resolve(Digit.PaymentService.generatePdf(x,{PetRegistrationApplications:[null==W||null===(e=W.PetRegistrationApplications)||void 0===e?void 0:e[0]]},"petservicecertificate")).then(function(e){return Promise.resolve(Digit.PaymentService.printReciept(x,{fileStoreIds:e.filestoreIds[0]})).then(function(t){window.open(t[null==e?void 0:e.filestoreIds[0]],"_blank")})})}catch(e){return Promise.reject(e)}}()}),l.createElement(l.Fragment,null,l.createElement("div",null,l.createElement("div",{className:"cardHeaderWithOptions",style:{marginRight:"auto",maxWidth:"960px"}},l.createElement(t.Header,{styles:{fontSize:"32px"}},R("PTR_PET_APPLICATION_DETAILS")),ee&&ee.length>0&&l.createElement(t.MultiLink,{className:"multilinkWrapper",onHeadClick:()=>L(!O),displayOptions:O,options:ee})),l.createElement(t.Card,null,l.createElement(t.StatusTable,null,l.createElement(t.Row,{className:"border-none",label:R("PTR_APPLICATION_NO_LABEL"),text:null==q?void 0:q.applicationNumber})),l.createElement(t.StatusTable,null,l.createElement(t.Row,{className:"border-none",label:R("PTR_VALIDITY_DATE"),text:(te=null==q?void 0:q.validityDate,te?new Date(1e3*te).getDate()+"/"+(new Date(1e3*te).getMonth()+1)+"/"+new Date(1e3*te).getFullYear().toString():"NA")})),(null==q?void 0:q.petToken)&&(null==q?void 0:q.petToken.length)>0&&l.createElement(t.StatusTable,null,l.createElement(t.Row,{className:"border-none",label:R("PTR_TOKEN"),text:null==q?void 0:q.petToken})),l.createElement(t.CardSubHeader,{style:{fontSize:"24px"}},R("PTR_ADDRESS_HEADER")),l.createElement(t.StatusTable,null,l.createElement(t.Row,{className:"border-none",label:R("PTR_PINCODE"),text:(null==q||null===(e=q.address)||void 0===e?void 0:e.pincode)||R("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:R("PTR_CITY"),text:(null==q||null===(o=q.address)||void 0===o?void 0:o.city)||R("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:R("PTR_STREET_NAME"),text:(null==q||null===(a=q.address)||void 0===a?void 0:a.street)||R("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:R("PTR_HOUSE_NO"),text:(null==q||null===(s=q.address)||void 0===s?void 0:s.doorNo)||R("CS_NA")})),l.createElement(t.CardSubHeader,{style:{fontSize:"24px"}},R("PTR_APPLICANT_DETAILS_HEADER")),l.createElement(t.StatusTable,null,l.createElement(t.Row,{className:"border-none",label:R("PTR_APPLICANT_NAME"),text:(null==q?void 0:q.applicantName)||R("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:R("PTR_FATHER/HUSBAND_NAME"),text:(null==q?void 0:q.fatherName)||R("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:R("PTR_APPLICANT_MOBILE_NO"),text:(null==q?void 0:q.mobileNumber)||R("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:R("PTR_APPLICANT_EMAILID"),text:(null==q?void 0:q.emailId)||R("CS_NA")})),l.createElement(t.CardSubHeader,{style:{fontSize:"24px"}},R("PTR_PET_DETAILS_HEADER")),l.createElement(t.StatusTable,null,l.createElement(t.Row,{className:"border-none",label:R("PTR_PET_TYPE"),text:(null==q||null===(d=q.petDetails)||void 0===d?void 0:d.petType)||R("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:R("PTR_BREED_TYPE"),text:(null==q||null===(p=q.petDetails)||void 0===p?void 0:p.breedType)||R("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:R("PTR_DOCTOR_NAME"),text:(null==q||null===(v=q.petDetails)||void 0===v?void 0:v.doctorName)||R("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:R("PTR_CLINIC_NAME"),text:(null==q||null===(f=q.petDetails)||void 0===f?void 0:f.clinicName)||R("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:R("PTR_VACCINATED_DATE"),text:(null==q||null===(m=q.petDetails)||void 0===m?void 0:m.lastVaccineDate)||R("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:R("PTR_VACCINATION_NUMBER"),text:(null==q||null===(E=q.petDetails)||void 0===E?void 0:E.vaccinationNumber)||R("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:R("PTR_PET_NAME"),text:(null==q||null===(_=q.petDetails)||void 0===_?void 0:_.petName)||R("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:R("PTR_PET_AGE"),text:(null==q||null===(g=q.petDetails)||void 0===g?void 0:g.petAge)||R("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:R("PTR_PET_SEX"),text:(null==q||null===(y=q.petDetails)||void 0===y?void 0:y.petGender)||R("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:R("PTR_IDENTIFICATION_MARK"),text:(null==q||null===(S=q.petDetails)||void 0===S?void 0:S.identificationMark)||R("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:R("PTR_VACCINATION_NUMBER"),text:(null==q||null===(b=q.petDetails)||void 0===b?void 0:b.vaccinationNumber)||R("CS_NA")}),null!=q&&null!==(A=q.petDetails)&&void 0!==A&&A.birthDate?(null==q||null===(C=q.petDetails)||void 0===C?void 0:C.birthDate)&&l.createElement(t.Row,{className:"border-none",label:R("PTR_BIRTH"),text:h(null==q||null===(D=q.petDetails)||void 0===D?void 0:D.birthDate)||R("CS_NA")}):(null==q||null===(N=q.petDetails)||void 0===N?void 0:N.adoptionDate)&&l.createElement(t.Row,{className:"border-none",label:R("PTR_ADOPTION"),text:h(null==q||null===(P=q.petDetails)||void 0===P?void 0:P.adoptionDate)||R("CS_NA")})),l.createElement(T,{application:$,id:null==$?void 0:$.applicationNumber,userType:"citizen"}),F&&l.createElement(t.Toast,{error:F.key,label:R(F.label),style:{bottom:"0px"},onClose:()=>{B(null)}})),M&&l.createElement(PTCitizenFeedbackPopUp,{setpopup:k,setShowToast:B,data:W})));var te},PTRCreatePet:e=>{var n,o,c,s;const d=a.useQueryClient(),p=i.useRouteMatch(),{t:v}=r.useTranslation(),{pathname:f}=i.useLocation(),m=i.useHistory();Digit.ULBService.getStateId();let h=[];const[E,_,g]=Digit.Hooks.useSessionStorage("PTR_CREATE_PET",{});let{data:S,isLoading:b}=Digit.Hooks.useEnabledMDMS(Digit.ULBService.getStateId(),"PetService",[{name:"CommonFieldsConfig"}],{select:e=>{var t;return null==e||null===(t=e.PetService)||void 0===t?void 0:t.CommonFieldsConfigEmp}});const T=sessionStorage.getItem("petId")?sessionStorage.getItem("petId"):null;sessionStorage.setItem("applicationType",f.includes("new-application")?"NEWAPPLICATION":"RENEWAPPLICATION");const A=Digit.ULBService.getCitizenCurrentTenant(!0),{data:C}=Digit.Hooks.ptr.usePTRSearch({tenantId:A,filters:{applicationNumber:T}});let D=null==C?void 0:C.PetRegistrationApplications[0];function N(e,t,n,l,r){if(void 0===r&&(r=!1),"owners"===e){let n=E.owners||[];n[l]=t,_(u({},E,{[e]:[...n]}))}else if("units"===e){let e=E.units||[];e=t,_(u({},E,{units:e}))}else _(u({},E,{[e]:u({},E[e],t)}));((e,t,n,l)=>{let r,i=f.split("/").pop(),o=i.charAt(i.length-1),a=!1;Number(parseInt(i))||"0"==i||"-1"==i?"-1"==i||"-2"==i?(i=f.slice(0,-3),i=i.split("/").pop(),a=!0):(i=f.slice(0,-2),i=i.split("/").pop(),a=!0):a=!1,isNaN(o)||(a=!0);let{nextStep:u={}}=h.find(e=>e.route===(i||"0")),c=m.push;if(e&&(c=m.replace),n&&(u=l),null===u)return c(p.path+"/check");r=isNaN(u.split("/").pop())&&a&&"map"!==u?p.path+"/"+u+"/"+t:p.path+"/"+u,c(r)})(n,l,r,e)}E&&Object.keys(E).length>0&&window.location.href.includes("/info")&&"true"!==sessionStorage.getItem("docReqScreenByBack")&&(g(),d.invalidateQueries("PTR_CREATE_PET"));const P=()=>{},R=()=>{};if(b)return l.createElement(t.Loader,null);S=S||y,S.forEach(e=>{h=h.concat(e.body.filter(e=>!e.hideInCitizen))}),h.indexRoute="info";const I=null===(n=Digit)||void 0===n||null===(o=n.ComponentRegistryService)||void 0===o?void 0:o.getComponent("PTRCheckPage"),w=null===(c=Digit)||void 0===c||null===(s=c.ComponentRegistryService)||void 0===s?void 0:s.getComponent("PTRAcknowledgement");return l.createElement(i.Switch,null,h.map((e,t)=>{const{component:n,texts:r,inputs:o,key:a}=e,u="string"==typeof n?Digit.ComponentRegistryService.getComponent(n):n;return l.createElement(i.Route,{path:p.path+"/"+e.route,key:t},l.createElement(u,{config:{texts:r,inputs:o,key:a},onSelect:N,onSkip:P,t:v,formData:E,onAdd:R,renewApplication:f.includes("new-application")?{}:D}))}),l.createElement(i.Route,{path:p.path+"/check"},l.createElement(I,{onSubmit:function(){try{return m.push(p.path+"/acknowledgement"),Promise.resolve()}catch(e){return Promise.reject(e)}},value:E})),l.createElement(i.Route,{path:p.path+"/acknowledgement"},l.createElement(w,{data:E,onSuccess:()=>{g(),d.invalidateQueries("PTR_CREATE_PET"),sessionStorage.removeItem(["applicationType","petId"]),sessionStorage.removeItem("petToken")}})),l.createElement(i.Route,null,l.createElement(i.Redirect,{to:p.path+"/"+h.indexRoute})))},PTRCitizenDetails:e=>{var r,i,o,a,c;let{t:s,config:p,onSelect:v,userType:f,formData:m,renewApplication:h}=e;const E=Digit.UserService.getUser().info,_={width:"EMPLOYEE"===E.type?"50%":"86%"};let g={};const[y,S]=n.useState((null==h?void 0:h.applicantName)||("EMPLOYEE"===E.type?"":null==E?void 0:E.name)||(null==m||null===(r=m.ownerss)||void 0===r?void 0:r.applicantName)||""),[b,T]=n.useState((null==h?void 0:h.emailId)||(null==m||null===(i=m.ownerss)||void 0===i?void 0:i.emailId)||""),[A,C]=n.useState((null==h?void 0:h.mobileNumber)||("EMPLOYEE"===E.type?"":null==E?void 0:E.mobileNumber)||(null==m||null===(o=m.ownerss)||void 0===o?void 0:o.mobileNumber)||""),[D,N]=n.useState((null==m||null===(a=m.ownerss)||void 0===a?void 0:a.alternateNumber)||""),[P,R]=n.useState((null==h?void 0:h.fatherName)||(null==m||null===(c=m.ownerss)||void 0===c?void 0:c.fatherName)||""),I=()=>{let e,t=m.ownerss;"citizen"===f?(e=u({},t,{applicantName:y,mobileNumber:A,alternateNumber:D,fatherName:P,emailId:b}),v(p.key,u({},m[p.key],e),!1)):(e=u({},t,{applicantName:y,mobileNumber:A,alternateNumber:D,fatherName:P,emailId:b}),v(p.key,e,!1))};return n.useEffect(()=>{"citizen"===f&&I()},[y,A,P,b]),l.createElement(l.Fragment,null,l.createElement(d,{currentStep:1}),l.createElement(t.FormStep,{config:p,onSelect:I,onSkip:()=>v(),t:s,isDisabled:!(y&&A&&P&&b)},l.createElement("div",null,l.createElement(t.CardLabel,null,""+s("PTR_APPLICANT_NAME")," ",l.createElement("span",{className:"astericColor"},"*")),l.createElement(t.TextInput,u({t:s,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"applicantName",value:y,style:_,onChange:function(e){S(e.target.value)},ValidationRequired:!0},g={isRequired:!0,pattern:"^[a-zA-Z ]+$",type:"tel",title:s("PT_NAME_ERROR_MESSAGE")})),l.createElement(t.CardLabel,null,""+s("PTR_MOBILE_NUMBER")," ",l.createElement("span",{className:"astericColor"},"*")),l.createElement(t.MobileNumber,{value:A,name:"mobileNumber",onChange:e=>function(e){C(e.target.value)}({target:{value:e}}),style:{width:"EMPLOYEE"===E.type?"49%":"86%"},required:!0,pattern:"[6-9]{1}[0-9]{9}",type:"tel",title:s("CORE_COMMON_APPLICANT_MOBILE_NUMBER_INVALID")}),l.createElement(t.CardLabel,null,""+s("PTR_ALT_MOBILE_NUMBER")),l.createElement(t.MobileNumber,{value:D,name:"alternateNumber",onChange:e=>function(e){N(e.target.value)}({target:{value:e}}),style:{width:"EMPLOYEE"===E.type?"49%":"86%"},required:!1,pattern:"[6-9]{1}[0-9]{9}",type:"tel",title:s("CORE_COMMON_APPLICANT_MOBILE_NUMBER_INVALID")}),l.createElement(t.CardLabel,null,""+s("PTR_FATHER_HUSBAND_NAME")," ",l.createElement("span",{className:"astericColor"},"*")),l.createElement(t.TextInput,u({t:s,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"fatherName",style:_,value:P,onChange:function(e){R(e.target.value)},ValidationRequired:!0},g={isRequired:!0,pattern:"^[a-zA-Z ]+$",type:"tel",title:s("PT_NAME_ERROR_MESSAGE")})),l.createElement(t.CardLabel,null,""+s("PTR_EMAIL_ID")," ",l.createElement("span",{className:"astericColor"},"*")),l.createElement(t.TextInput,u({t:s,type:"email",isMandatory:!0,optionKey:"i18nKey",name:"emailId",value:b,style:_,onChange:function(e){T(e.target.value)},ValidationRequired:!0},g={isRequired:!0,pattern:"^[a-zA-Z0-9._%+-]+@[a-zA-Z]+\\.[a-zA-Z]{3,4}$",type:"email",title:s("PT_NAME_ERROR_MESSAGE")})))))},PTRCitizenPet:e=>{var r,i,a,c,s,p,v,f,m,E,_,g,y,S,b,T,A,C,D,N,P,R,I,w,x,O,L,M,k,F,B,U,j;let{t:H,config:W,onSelect:z,userType:V,formData:K,renewApplication:Y}=e;const q=Digit.UserService.getUser().info,$=e=>e?{i18nKey:e,code:e,value:e}:null;let G={},{data:Z}=Digit.Hooks.useEnabledMDMS(Digit.ULBService.getStateId(),"PetService",[{name:"PetColor"}],{select:e=>{var t;return null==e||null===(t=e.PetService)||void 0===t?void 0:t.PetColor.map(e=>({i18nKey:""+e.colourName,colourCode:""+e.colourCode,code:""+e.colourName,active:""+e.active}))}});const X={width:"EMPLOYEE"===q.type?"50%":"86%"},[J,Q]=n.useState($(null==Y||null===(r=Y.petDetails)||void 0===r?void 0:r.petType)||(null==K||null===(i=K.pets)||void 0===i?void 0:i.petType)||""),[ee,te]=n.useState($(null==Y||null===(a=Y.petDetails)||void 0===a?void 0:a.breedType)||(null==K||null===(c=K.pets)||void 0===c?void 0:c.breedType)||""),[ne,le]=n.useState($(null==Y||null===(s=Y.petDetails)||void 0===s?void 0:s.petGender)||(null==K||null===(p=K.pets)||void 0===p?void 0:p.petGender)||""),[re,ie]=n.useState((null==Y||null===(v=Y.petDetails)||void 0===v?void 0:v.petName)||(null==K||null===(f=K.pets)||void 0===f?void 0:f.petName)||""),[oe,ae]=n.useState((null==Y||null===(m=Y.petDetails)||void 0===m?void 0:m.petAge)||(null==K||null===(E=K.pets)||void 0===E?void 0:E.petAge)||""),[ue,ce]=n.useState((null==Y||null===(_=Y.petDetails)||void 0===_?void 0:_.petName)||(null==K||null===(g=K.pets)||void 0===g?void 0:g.doctorName)||""),[se,de]=n.useState((null==Y||null===(y=Y.petDetails)||void 0===y?void 0:y.clinicName)||(null==K||null===(S=K.pets)||void 0===S?void 0:S.clinicName)||""),[pe,ve]=n.useState((null==Y||null===(b=Y.petDetails)||void 0===b?void 0:b.vaccinationNumber)||(null==K||null===(T=K.pets)||void 0===T?void 0:T.vaccinationNumber)||""),[fe,me]=n.useState((null==Y||null===(A=Y.petDetails)||void 0===A?void 0:A.lastVaccineDate)||(null==K||null===(C=K.pets)||void 0===C?void 0:C.lastVaccineDate)||""),[he,Ee]=n.useState((null==K||null===(D=K.pets)||void 0===D?void 0:D.petColor)||""),[_e,ge]=n.useState((null==Y||null===(N=Y.petDetails)||void 0===N?void 0:N.identificationMark)||(null==K||null===(P=K.pets)||void 0===P?void 0:P.identificationMark)||""),[ye,Se]=n.useState($(null!=Y&&null!==(R=Y.petDetails)&&void 0!==R&&R.birthDate||null!=Y&&null!==(I=Y.petDetails)&&void 0!==I&&I.adoptionDate?null!=Y&&null!==(w=Y.petDetails)&&void 0!==w&&w.birthDate?"Birth":"Adoption":null)||$(null!=K&&null!==(x=K.pets)&&void 0!==x&&x.birthDate||null!=K&&null!==(O=K.pets)&&void 0!==O&&O.adoptionDate?null!=K&&null!==(L=K.pets)&&void 0!==L&&L.birthDate?"Birth":"Adoption":null)||[{i18nKey:"",code:""}]),[be,Te]=n.useState(h(null==Y||null===(M=Y.petDetails)||void 0===M?void 0:M.birthDate)||(null==K||null===(k=K.pets)||void 0===k?void 0:k.birthDate)||""),[Ae,Ce]=n.useState(h(null==Y||null===(F=Y.petDetails)||void 0===F?void 0:F.adoptionDate)||(null==K||null===(B=K.pets)||void 0===B?void 0:B.adoptionDate)||""),De=Digit.ULBService.getStateId(),[Ne,Pe]=n.useState(""),{data:Re}=Digit.Hooks.useEnabledMDMS(De,"PetService",[{name:"PetType"}],{select:e=>{var t;return null==e||null===(t=e.PetService)||void 0===t?void 0:t.PetType}}),{data:Ie}=Digit.Hooks.useEnabledMDMS(De,"PetService",[{name:"BreedType"}],{select:e=>{var t;return null==e||null===(t=e.PetService)||void 0===t?void 0:t.BreedType}});let we=[],xe=[];Re&&Re.map(e=>{we.push({i18nKey:"PTR_PET_"+e.code,code:""+e.code,value:""+e.name})});const{control:Oe}=o.useForm();Ie&&Ie.map(e=>{e.PetType==(null==J?void 0:J.code)&&xe.push({i18nKey:"PTR_BREED_TYPE_"+e.code,code:""+e.code,value:""+e.name})}),n.useEffect(()=>{var e;null!=Y&&Y.petDetails&&Ee(null==Z||null===(e=Z.filter(e=>{var t;return(null==e?void 0:e.colourCode)===(null==Y||null===(t=Y.petDetails)||void 0===t?void 0:t.petColor)}))||void 0===e?void 0:e[0])},[Z]),n.useEffect(()=>{be?(Pe(be),fe&&fe<be&&me("")):Pe("")},[be,Ae]);const{data:Le}=Digit.Hooks.ptr.usePTRGenderMDMS(De,"common-masters","GenderType");let Me=[];Le&&Le.map(e=>{"TRANSGENDER"!==e.code&&Me.push({i18nKey:"PTR_GENDER_"+e.code,code:""+e.code,name:""+e.code})}),n.useEffect(()=>{if(be){const[e,t,n]=be.split("-").map(Number),l=new Date(e,t-1,n),r=new Date;let i=r.getFullYear()-l.getFullYear(),o=r.getMonth()-l.getMonth();o<0&&(i-=1,o+=12),ae(12*i+o)}},[be]);const ke=()=>{let e;e=u({},K.pets,{petType:J,breedType:ee,petGender:ne,petName:re,petAge:oe,doctorName:ue,clinicName:se,lastVaccineDate:fe,vaccinationNumber:pe,birthDate:be,adoptionDate:Ae,identificationMark:_e,petColor:he}),z(W.key,e,!1)};return n.useEffect(()=>{"citizen"===V&&ke()},[J,ee,ne,re,oe,ue,fe,be,Ae,_e,he]),l.createElement(l.Fragment,null,l.createElement(d,{currentStep:2}),l.createElement(t.FormStep,{config:W,onSelect:ke,onSkip:()=>z(),t:H,isDisabled:!(J&&ee&&ne&&re&&oe&&ue&&se&&fe&&pe&&(!be&&Ae||!Ae&&be))},l.createElement("div",null,l.createElement(t.CardLabel,null,""+H("PTR_SEARCH_PET_TYPE")," ",l.createElement("span",{className:"astericColor"},"*")),l.createElement(o.Controller,{control:Oe,name:"petType",defaultValue:J,rules:{required:H("CORE_COMMON_REQUIRED_ERRMSG")},render:e=>l.createElement(t.Dropdown,{className:"form-field",selected:J,select:Q,option:we,optionKey:"i18nKey",t:H,placeholder:"Select"})}),l.createElement(t.CardLabel,null,""+H("PTR_SEARCH_BREED_TYPE")," ",l.createElement("span",{className:"astericColor"},"*")),l.createElement(o.Controller,{control:Oe,name:"breedType",defaultValue:ee,rules:{required:H("CORE_COMMON_REQUIRED_ERRMSG")},render:e=>l.createElement(t.Dropdown,{className:"form-field",selected:ee,select:te,option:xe,optionKey:"i18nKey",t:H,placeholder:"Select"})}),l.createElement(t.CardLabel,null,""+H("PTR_PET_SEX")," ",l.createElement("span",{className:"astericColor"},"*")),l.createElement(o.Controller,{control:Oe,name:"petGender",defaultValue:ne,rules:{required:H("CORE_COMMON_REQUIRED_ERRMSG")},render:e=>l.createElement(t.Dropdown,{className:"form-field",selected:ne,select:le,option:Me,optionKey:"i18nKey",t:H,placeholder:"Select"})}),l.createElement(t.CardLabel,null,""+H("PTR_PET_COLOR")," ",l.createElement("span",{className:"astericColor"},"*")),l.createElement(o.Controller,{control:Oe,name:"petColor",defaultValue:he,rules:{required:H("CORE_COMMON_REQUIRED_ERRMSG")},render:e=>l.createElement(t.Dropdown,{className:"form-field",selected:he,select:Ee,optionCardStyles:{overflowY:"auto",maxHeight:"300px"},option:Z,optionKey:"i18nKey",t:H,placeholder:"Select"})}),l.createElement(t.CardLabel,null,""+H("PTR_SELECT_BIRTH_ADOPTION")," ",l.createElement("span",{className:"astericColor"},"*")),l.createElement(t.RadioButtons,{t:H,options:[{i18nKey:"Birth",code:"Birth"},{i18nKey:"Adoption",code:"Adoption"}],optionsKey:"code",name:"selectBirthAdoption",value:ye,selectedOption:ye,innerStyles:{display:"inline-block",marginLeft:"20px",paddingBottom:"2px",marginBottom:"2px"},onSelect:Se,isDependent:!0}),("Birth"===(null==ye?void 0:ye.code)||(null==Y||null===(U=Y.petDetails)||void 0===U?void 0:U.birth))&&l.createElement("div",null,l.createElement(t.CardLabel,null,""+H("PTR_BIRTH")," ",l.createElement("span",{className:"astericColor"},"*")),l.createElement(t.TextInput,{t:H,type:"date",isMandatory:!1,optionKey:"i18nKey",name:"birthDate",value:be,onChange:function(e){Ce(null),Te(e.target.value)},style:X,max:(new Date).toISOString().split("T")[0],rules:{required:H("CORE_COMMON_REQUIRED_ERRMSG"),validDate:e=>!!/^\d{4}-\d{2}-\d{2}$/.test(e)||H("ERR_DEFAULT_INPUT_FIELD_MSG")}})),("Adoption"===(null==ye?void 0:ye.code)||(null==Y||null===(j=Y.petDetails)||void 0===j?void 0:j.adoption))&&l.createElement("div",null,l.createElement(t.CardLabel,null,""+H("PTR_ADOPTION")," ",l.createElement("span",{className:"astericColor"},"*")),l.createElement(t.TextInput,{t:H,type:"date",isMandatory:!1,optionKey:"i18nKey",name:"adoptionDate",value:Ae,onChange:function(e){Te(null),Ce(e.target.value)},style:X,max:(new Date).toISOString().split("T")[0],rules:{required:H("CORE_COMMON_REQUIRED_ERRMSG"),validDate:e=>!!/^\d{4}-\d{2}-\d{2}$/.test(e)||H("ERR_DEFAULT_INPUT_FIELD_MSG")}})),l.createElement(t.CardLabel,null,""+H("PTR_PET_NAME")," ",l.createElement("span",{className:"astericColor"},"*")),l.createElement(t.TextInput,u({t:H,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"petName",value:re,onChange:function(e){ie(e.target.value)},style:X,ValidationRequired:!1},G={isRequired:!0,pattern:"^[a-zA-Z ]+$",type:"text",title:H("PT_NAME_ERROR_MESSAGE")})),l.createElement(t.CardLabel,null,""+H("PTR_IDENTIFICATION_MARK")),l.createElement(t.TextInput,{t:H,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"identificationMark",value:_e,onChange:function(e){ge(e.target.value)},style:X,ValidationRequired:!1}),l.createElement(t.CardLabel,null,H("PTR_PET_AGE")+" (in months)"," ",l.createElement("span",{className:"astericColor"},"*")),l.createElement(t.TextInput,u({t:H,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"petAge",value:oe,onChange:function(e){ae(e.target.value)},style:X,placeholder:"in months",ValidationRequired:!0},G={isRequired:!0,pattern:"^(?:[1-9][0-9]?|[1-3][0-9]{2}|400)$",type:"tel",title:H("PT_NAME_ERROR_MESSAGE")})),null!=oe&&oe>=0&&l.createElement("div",null,Math.floor(oe/12),"  ",1===Math.floor(oe/12)?"YEAR":"YEARS","  ",oe%12,"  ",oe%12==1?"MONTH":"MONTHS"),l.createElement("br",null),l.createElement(t.CardLabel,null,""+H("PTR_DOCTOR_NAME")," ",l.createElement("span",{className:"astericColor"},"*")),l.createElement(t.TextInput,u({t:H,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"doctorName",value:ue,onChange:function(e){ce(e.target.value)},style:X,ValidationRequired:!1},G={isRequired:!0,pattern:"^[a-zA-Z ]+$",type:"text",title:H("PT_NAME_ERROR_MESSAGE")})),l.createElement(t.CardLabel,null,""+H("PTR_CLINIC_NAME")," ",l.createElement("span",{className:"astericColor"},"*")),l.createElement(t.TextInput,u({t:H,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"clinicName",value:se,onChange:function(e){de(e.target.value)},style:X,ValidationRequired:!1},G={isRequired:!0,pattern:"^[a-zA-Z0-9 .,?!'\"-]+$",type:"text",title:H("PT_NAME_ERROR_MESSAGE")})),l.createElement(t.CardLabel,null,""+H("PTR_VACCINATED_DATE")," ",l.createElement("span",{className:"astericColor"},"*")),l.createElement(t.TextInput,{t:H,type:"date",isMandatory:!1,optionKey:"i18nKey",name:"lastVaccineDate",value:fe,onChange:function(e){me(e.target.value)},style:X,min:Ne,max:(new Date).toISOString().split("T")[0],rules:{required:H("CORE_COMMON_REQUIRED_ERRMSG"),validDate:e=>!!/^\d{4}-\d{2}-\d{2}$/.test(e)||H("ERR_DEFAULT_INPUT_FIELD_MSG")}}),l.createElement(t.CardLabel,null,""+H("PTR_VACCINATION_NUMBER")," ",l.createElement("span",{className:"astericColor"},"*")),l.createElement(t.TextInput,{t:H,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"vaccinationNumber",value:pe,onChange:function(e){ve(e.target.value)},style:X}))))},PTRSelectAddress:e=>{var r,a,c,s,p,v,f,m,h,E,_,g,y,S,b,T,A,C,D,N,P,R,I,w,x;let{t:O,config:L,onSelect:M,formData:k,renewApplication:F}=e;const B=e=>e?{i18nKey:e,code:e,value:e}:null,U=Digit.Hooks.ptr.useTenants(),{pathname:j}=i.useLocation();let H={};const{control:W}=o.useForm(),z=Digit.UserService.getUser().info,[V,K]=n.useState((null==F||null===(r=F.address)||void 0===r?void 0:r.pincode)||(null==k||null===(a=k.address)||void 0===a?void 0:a.pincode)||""),[Y,q]=n.useState((null==k||null===(c=k.address)||void 0===c?void 0:c.city)||B(null==F||null===(s=F.address)||void 0===s?void 0:s.city)||""),[$,G]=n.useState(B(null==F||null===(p=F.address)||void 0===p?void 0:p.locality)||(null==k||null===(v=k.address)||void 0===v?void 0:v.locality)||""),[Z,X]=n.useState((null==F||null===(f=F.address)||void 0===f?void 0:f.streetName)||(null==F||null===(m=F.address)||void 0===m?void 0:m.street)||(null==k||null===(h=k.address)||void 0===h?void 0:h.streetName)||""),[J,Q]=n.useState((null==F||null===(E=F.address)||void 0===E?void 0:E.houseNo)||(null==F||null===(_=F.address)||void 0===_?void 0:_.doorNo)||(null==k||null===(g=k.address)||void 0===g?void 0:g.houseNo)||""),[ee,te]=n.useState((null==F||null===(y=F.address)||void 0===y?void 0:y.landmark)||(null==k||null===(S=k.address)||void 0===S?void 0:S.landmark)||""),[ne,le]=n.useState((null==F||null===(b=F.address)||void 0===b?void 0:b.houseName)||(null==F||null===(T=F.address)||void 0===T?void 0:T.buildingName)||(null==k||null===(A=k.address)||void 0===A?void 0:A.houseName)||""),[re,ie]=n.useState((null==F||null===(C=F.address)||void 0===C?void 0:C.addressline1)||(null==F||null===(D=F.address)||void 0===D?void 0:D.addressLine1)||(null==k||null===(N=k.address)||void 0===N?void 0:N.addressline1)||""),[oe,ae]=n.useState((null==F||null===(P=F.address)||void 0===P?void 0:P.addressline2)||(null==F||null===(R=F.address)||void 0===R?void 0:R.addressLine2)||(null==k||null===(I=k.address)||void 0===I?void 0:I.addressline2)||""),[ue,ce]=n.useState((null==F||null===(w=F.address)||void 0===w?void 0:w.propertyId)||(null==k||null===(x=k.address)||void 0===x?void 0:x.propertyId)||""),[se,de]=n.useState(!1),pe=Digit.ULBService.getStateId(),ve={width:"EMPLOYEE"===z.type?"50%":"86%"},[fe,me]=n.useState(null),{data:he}=Digit.Hooks.useBoundaryLocalities(null==Y?void 0:Y.code,"revenue",{enabled:!!Y},O);let Ee=[];he&&he.map((e,t)=>{Ee.push({i18nKey:e.i18nkey,code:e.code,label:e.label})}),n.useEffect(()=>{if(fe){const e=setTimeout(()=>me(null),2e3);return()=>clearTimeout(e)}},[fe]);const{isLoading:_e,isError:ge,data:ye,error:Se}=Digit.Hooks.pt.useApplicationDetail(O,pe,ue,se);return n.useEffect(()=>{if(se){if(_e)me({warning:!0,label:O("PTR_LOADING_DETAILS")});else if(ge)me({error:!0,label:O("PTR_ERROR_FETCHING_DETAILS")});else if(ye){var e,t,n,l,r,i;const o=null==ye||null===(e=ye.applicationData)||void 0===e||null===(t=e.address)||void 0===t?void 0:t.street,a=null==ye||null===(n=ye.applicationData)||void 0===n||null===(l=n.address)||void 0===l?void 0:l.doorNo,u=null==ye||null===(r=ye.applicationData)||void 0===r||null===(i=r.address)||void 0===i?void 0:i.pincode;o&&a&&u&&(Q(a),X(o),K(u))}de(!1)}},[se,_e,ge,ye,Se]),l.createElement(l.Fragment,null,l.createElement(d,{currentStep:3}),l.createElement(t.FormStep,{config:L,onSelect:()=>{let e=u({},k.address,{pincode:V,city:Y,locality:$,streetName:Z,houseNo:J,landmark:ee,houseName:ne,addressline1:re,addressline2:oe,propertyId:ue});M(L.key,u({},k[L.key],e),!1)},onSkip:()=>M(),t:O,isDisabled:!(V&&Y&&Z&&J&&ee&&(j.includes("revised")||j.includes("renew")||$)&&re)},l.createElement("div",null,l.createElement("style",null,"\n .select-wrap .options-card {\n width: 100% !important;\n -webkit-box-shadow: 0 8px 10px 1px rgba(0, 0, 0, 0.14), 0 3px 14px 2px rgba(0, 0, 0, 0.12), 0 5px 5px -3px rgba(0, 0, 0, 0.2);\n box-shadow: 0 8px 10px 1px rgba(0, 0, 0, 0.14), 0 3px 14px 2px rgba(0, 0, 0, 0.12), 0 5px 5px -3px rgba(0, 0, 0, 0.2);\n position: absolute;\n z-index: 20;\n margin-top: 4px;\n --bg-opacity: 1;\n background-color: #fff;\n background-color: rgba(255, 255, 255, var(--bg-opacity));\n overflow: scroll;\n max-height: 250px; \n min-height:50px;\n } "),l.createElement(t.CardLabel,null,""+O("PTR_PROPERTY_NO")),l.createElement("div",{className:"field-container"},l.createElement(t.TextInput,u({t:O,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"propertyId",value:ue,onChange:e=>{ce(e.target.value)},style:ve,ValidationRequired:!1},H={isRequired:!0,pattern:"^[a-zA-Z0-9/-]*$",type:"text",title:O("PT_NAME_ERROR_MESSAGE")})),l.createElement("div",{style:{position:"relative",zIndex:"100",right:"EMPLOYEE"===z.type?"52%":"95px",marginTop:"-14px",marginRight:"-20px",cursor:"pointer"},onClick:()=>{ue?de(!0):me({error:!0,label:O("PROPERTY_ID_REQUIRED")})}}," ",l.createElement(t.SearchIcon,null)," ")),l.createElement(t.CardLabel,null,""+O("PTR_HOUSE_NO")," ",l.createElement("span",{className:"check-page-link-button"},"*")),l.createElement(t.TextInput,u({t:O,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"houseNo",value:J,placeholder:"Enter House No",onChange:e=>{Q(e.target.value)},style:{width:"EMPLOYEE"===z.type?"50%":"86%"},ValidationRequired:!0},H={isRequired:!0,pattern:"^[a-zA-Z0-9 ,\\-]+$",type:"text",title:O("PTR_HOUSE_NO_ERROR_MESSAGE")})),l.createElement(t.CardLabel,null,""+O("PTR_HOUSE_NAME")),l.createElement(t.TextInput,{t:O,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"houseName",value:ne,placeholder:"Enter House Name",onChange:e=>{le(e.target.value)},style:{width:"EMPLOYEE"===z.type?"50%":"86%"},ValidationRequired:!1}),l.createElement(t.CardLabel,null,""+O("PTR_STREET_NAME")," ",l.createElement("span",{className:"check-page-link-button"},"*")),l.createElement(t.TextInput,u({t:O,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"streetName",value:Z,placeholder:"Enter Street Name",onChange:e=>{X(e.target.value)},style:{width:"EMPLOYEE"===z.type?"50%":"86%"},ValidationRequired:!0},H={pattern:"^[a-zA-Z0-9 ,\\-]+$",type:"text",title:O("PTR_STREET_NAME_ERROR_MESSAGE")})),l.createElement(t.CardLabel,null,""+O("PTR_ADDRESS_LINE1")," ",l.createElement("span",{className:"check-page-link-button"},"*")),l.createElement(t.TextInput,u({t:O,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"addressline1",value:re,placeholder:"Enter Address",onChange:e=>{ie(e.target.value)},style:{width:"EMPLOYEE"===z.type?"50%":"86%"},ValidationRequired:!0},H={isRequired:!1,pattern:"^[a-zA-Z0-9 .,?!'\"-]+$",type:"textarea",title:O("SV_LANDMARK_ERROR_MESSAGE")})),l.createElement(t.CardLabel,null,""+O("PTR_ADDRESS_LINE2")),l.createElement(t.TextInput,u({t:O,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"addressline2",value:oe,placeholder:"Enter Address",onChange:e=>{ae(e.target.value)},style:{width:"EMPLOYEE"===z.type?"50%":"86%"},ValidationRequired:!0},H={isRequired:!1,pattern:"^[a-zA-Z ]*$",type:"textarea",title:O("SV_LANDMARK_ERROR_MESSAGE")})),l.createElement(t.CardLabel,null,""+O("PTR_LANDMARK")," ",l.createElement("span",{className:"check-page-link-button"},"*")),l.createElement(t.TextArea,u({t:O,type:"textarea",isMandatory:!1,optionKey:"i18nKey",name:"landmark",value:ee,placeholder:"Enter Landmark",onChange:e=>{te(e.target.value)},style:{width:"50%"},ValidationRequired:!0},H={isRequired:!0,pattern:"^[a-zA-Z0-9 ,\\-]+$",type:"textarea",title:O("PTR_LANDMARK_ERROR_MESSAGE")})),l.createElement(t.CardLabel,null,""+O("PTR_CITY")," ",l.createElement("span",{className:"check-page-link-button"},"*")),l.createElement(o.Controller,{control:W,name:"city",defaultValue:Y,rules:{required:O("CORE_COMMON_REQUIRED_ERRMSG")},render:e=>l.createElement(t.Dropdown,{className:"form-field",selected:Y,select:q,option:U,optionKey:"i18nKey",t:O,placeholder:"Select"})}),l.createElement(t.CardLabel,null,""+O("PTR_LOCALITY")," ",l.createElement("span",{className:"check-page-link-button"},"*")),l.createElement(o.Controller,{control:W,name:"locality",defaultValue:$,rules:{required:O("CORE_COMMON_REQUIRED_ERRMSG")},render:e=>l.createElement(t.Dropdown,{className:"form-field",selected:$,select:G,option:Ee,optionCardStyles:{overflowY:"auto",maxHeight:"300px"},optionKey:"i18nKey",t:O,placeholder:"Select"})}),l.createElement(t.CardLabel,null,""+O("PTR_ADDRESS_PINCODE")," ",l.createElement("span",{className:"check-page-link-button"},"*")),l.createElement(t.TextInput,{t:O,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"pincode",value:V,onChange:e=>{const t=e.target.value.slice(0,6);K(t)},placeholder:"Enter Pincode",style:{width:"EMPLOYEE"===z.type?"50%":"86%"},ValidationRequired:!0,validation:{required:!1,pattern:"^[0-9]{6}$",type:"tel",title:O("SV_ADDRESS_PINCODE_INVALID")},maxLength:6}))),fe&&l.createElement(t.Toast,{error:fe.error,warning:fe.warning,label:O(fe.label),onClose:()=>me(null)}))},PTRSelectProofIdentity:e=>{var r,o,a;let{t:c,config:s,onSelect:p,formData:v,renewApplication:f}=e;const[m,h]=n.useState((null==v||null===(r=v.documents)||void 0===r?void 0:r.documents)||[]),[E,_]=n.useState(null),[g,y]=n.useState(!0),[b,T]=n.useState(!1),{pathname:A}=i.useLocation(),C=Digit.UserService.getUser().info,D=Digit.ULBService.getStateId(),{isLoading:N,data:P}=Digit.Hooks.ptr.usePetMDMS(D,"PetService","Documents"),R=e=>{if(e.length>0){const t={documentType:"PET.PETPHOTO",filestoreId:e[0],documentUid:e[0]};h(e=>[...e.filter(e=>"PET.PETPHOTO"!==e.documentType),t])}};return n.useEffect(()=>{var e,t;let n=0;null==P||null===(e=P.PetService)||void 0===e||null===(t=e.Documents)||void 0===t||t.forEach(e=>{let t=!1;m.forEach(n=>{var l;e.required&&null!=n&&null!==(l=n.documentType)&&void 0!==l&&l.includes(e.code)&&(t=!0)}),!t&&e.required&&(n+=1)}),0===n&&m.length>0&&m.some(e=>"PET.PETPHOTO"===e.documentType)?y(!0):y(!1)},[m,b]),l.createElement("div",null,l.createElement(d,{currentStep:4}),N?l.createElement(t.Loader,null):l.createElement(t.FormStep,{t:c,config:s,onSelect:()=>{let e=u({},v.documents,{documents:m});p(s.key,e)},onSkip:()=>p(),isDisabled:!g},null==P||null===(o=P.PetService)||void 0===o||null===(a=o.Documents)||void 0===a?void 0:a.map((e,n)=>"PET.PETPHOTO"!==(null==e?void 0:e.code)||A.includes("revised-application")?l.createElement(S,{key:n,document:e,t:c,error:E,setError:_,setDocuments:h,documents:m,setCheckRequiredFields:T,renewApplication:f,user:C}):l.createElement("div",{key:n},l.createElement(t.CardLabel,{className:"card-label-smaller",style:{display:"inline"}},c("PET_PETPHOTO"),l.createElement("span",{style:{color:"#b0242c"}},c("PET_ONLY_PNG_ALLOWED")," ")),l.createElement("div",{style:{marginLeft:"EMPLOYEE"===(null==C?void 0:C.type)?"37%":""}},l.createElement(t.ImageUploadHandler,{tenantId:D,uploadedImages:m.filter(e=>"PET.PETPHOTO"===e.documentType).map(e=>e.filestoreId),onPhotoChange:R,t:c,error:E,setError:_,maxImages:1})))),E&&l.createElement(t.Toast,{label:E,onClose:()=>_(null),error:!0})))},PTRServiceDoc:e=>{var n;let{t:r,config:i,onSelect:o}=e;Digit.ULBService.getCurrentTenantId();const a=Digit.ULBService.getStateId();sessionStorage.removeItem("docReqScreenByBack");const{isLoading:u,data:c={}}=Digit.Hooks.ptr.usePetMDMS(a,"PetService","Documents");let s=null==c||null===(n=c.PetService)||void 0===n?void 0:n.Documents;return l.createElement(l.Fragment,null,l.createElement(t.Card,null,l.createElement(t.CardHeader,null,r(i.isMutation?"PT_REQIURED_DOC_TRANSFER_OWNERSHIP":"PTR_DOC_REQ_SCREEN_HEADER")),l.createElement("div",null,l.createElement(t.CardText,{className:"primaryColor"},r("PTR_DOC_REQ_SCREEN_SUB_HEADER")),l.createElement(t.CardText,{className:"primaryColor"},r("PTR_DOC_REQ_SCREEN_TEXT")),l.createElement(t.CardText,{className:"primaryColor"},r("PTR_DOC_REQ_SCREEN_SUB_TEXT")),l.createElement(t.CardSubHeader,null,r("PTR_DOC_REQ_SCREEN_LABEL")),l.createElement(t.CardText,{className:"primaryColor"},r("PTR_DOC_REQ_SCREEN_LABEL_TEXT")),l.createElement(t.CardText,{style:{color:"red"}},r("PTR_PDF_AND_JPG_BOTH_FORMAT_ACCEPTED_IN_DOCUMENT_UPLOAD")),l.createElement("div",null,u&&l.createElement(t.Loader,null),Array.isArray(s)?s.map(null!=i&&i.isMutation?(e,n)=>{let{code:i,dropdownData:o}=e;return l.createElement("div",{key:n},l.createElement(t.CardSubHeader,null,n+1,". ",r(i)),l.createElement(t.CardText,{className:"primaryColor"},o.map(e=>r(null==e?void 0:e.code)).join(", ")))}:(e,n)=>{let{code:i,dropdownData:o}=e;return l.createElement("div",{key:n},l.createElement(t.CardSubHeader,null,n+1,". ",r(g(i,".","_"))),o.map((e,n)=>l.createElement(t.CardText,{className:"primaryColor"},""+(n+1),". ",r(g(null==e?void 0:e.code,".","_")))))}):null)),l.createElement("span",null,l.createElement(t.SubmitBar,{label:r("PTR_COMMON_NEXT"),onSubmit:o}))))},PTRWFApplicationTimeline:T},gi=e=>{let{stateCode:t,userType:r,tenants:o}=e;const{path:a,url:u}=i.useRouteMatch(),c=Digit.StoreData.getCurrentLanguage();return Digit.Services.useStore({stateCode:t,moduleCode:"PTR",language:c}),Object.entries(_i).forEach(e=>{let[t,n]=e;Digit.ComponentRegistryService.setComponent(t,n)}),Digit.SessionStorage.set("PTR_TENANTS",o),n.useEffect(()=>"employee"===r&&Digit.LocalizationService.getLocale({modules:["rainmaker-"+Digit.ULBService.getCurrentTenantId()],locale:Digit.StoreData.getCurrentLanguage(),tenantId:Digit.ULBService.getCurrentTenantId()}),[]),"employee"===r?l.createElement(He,{path:a,url:u,userType:r}):l.createElement(D,null)},yi=e=>{const{t:i}=r.useTranslation(),[o,a,u]=Digit.Hooks.useSessionStorage("PTR_PET",{});return n.useEffect(()=>{u()},[]),l.createElement(t.CitizenHomeCard,{header:i("ACTION_TEST_PTR"),links:[],Icon:()=>l.createElement(t.PTIcon,{className:"fill-path-primary-main"})})};exports.PTRComponents={PTRCard:()=>{const{t:e}=r.useTranslation(),[i,o]=n.useState("-"),{data:a,isLoading:u,isFetching:c,isSuccess:s}=Digit.Hooks.useNewInboxGeneral({tenantId:Digit.ULBService.getCurrentTenantId(),ModuleCode:"PTR",filters:{limit:10,offset:0,services:["ptr"]},config:{select:e=>({totalCount:null==e?void 0:e.totalCount,nearingSlaCount:null==e?void 0:e.nearingSlaCount}||"-"),enabled:Digit.Utils.ptrAccess()}});if(n.useEffect(()=>{!c&&s&&o(a)},[c]),!Digit.Utils.ptrAccess())return null;const d=[{count:u?"-":null==i?void 0:i.totalCount,label:e("ES_COMMON_INBOX"),link:"/upyog-ui/employee/ptr/petservice/inbox"},{label:e("PTR_TITLE_NEW_PET_REGISTRATION"),link:"/upyog-ui/employee/ptr/petservice/new-application",role:"PTR_CEMP"},{label:e("ES_COMMON_APPLICATION_SEARCH"),link:"/upyog-ui/employee/ptr/petservice/my-applications"}],p=Digit.UserService.hasAccess(["PTR_APPROVER","PTR_CEMP","PTR_VERIFIER"])||!1,v={Icon:l.createElement(t.PropertyHouse,null),moduleName:e("PTR_TITLE_PET_REGISTRATION"),kpis:[{count:null==i?void 0:i.totalCount,label:e("ES_TITLE_INBOX"),link:"/upyog-ui/employee/ptr/petservice/inbox"}],links:d.filter(e=>!(null!=e&&e.role)||p)};return l.createElement(t.EmployeeModuleCard,v)},PTRModule:gi,PTRLinks:yi,PTR_INBOX_FILTER:e=>l.createElement(Ke,e),PTRInboxTableConfig:e=>({PTR:{inboxColumns:t=>[{Header:e("PTR_APPLICATION_NUMBER"),Cell:e=>{var n,r,o,a;let{row:u}=e;return l.createElement("div",null,l.createElement("span",{className:"link"},l.createElement(i.Link,{to:t.parentRoute+"/petservice/application-details/"+(null==u||null===(n=u.original)||void 0===n||null===(r=n.searchData)||void 0===r?void 0:r.applicationNumber)},null===(o=u.original)||void 0===o||null===(a=o.searchData)||void 0===a?void 0:a.applicationNumber)))},mobileCell:e=>{var t;return qe(null==e||null===(t=e.searchData)||void 0===t?void 0:t.applicationNumber)}},{Header:e("PTR_APPLICANT_NAME"),Cell:e=>{var t,n,l,r;return Ye(""+(null==e||null===(t=e.cell)||void 0===t||null===(n=t.row)||void 0===n||null===(l=n.original)||void 0===l||null===(r=l.searchData)||void 0===r?void 0:r.applicantName))},mobileCell:e=>{var t;return qe(null==e||null===(t=e.searchData)||void 0===t?void 0:t.applicantName)}},{Header:e("PTR_PET_TYPE"),Cell:e=>{var t,n,l;let{row:r}=e;return Ye(""+(null===(t=r.original)||void 0===t||null===(n=t.searchData)||void 0===n||null===(l=n.petDetails)||void 0===l?void 0:l.petType))},mobileCell:e=>{var t,n;return qe(null==e||null===(t=e.searchData)||void 0===t||null===(n=t.petDetails)||void 0===n?void 0:n.petType)}},{Header:e("PTR_BREED_TYPE"),Cell:e=>{var t,n,l;let{row:r}=e;return Ye(""+(null===(t=r.original)||void 0===t||null===(n=t.searchData)||void 0===n||null===(l=n.petDetails)||void 0===l?void 0:l.breedType))},mobileCell:e=>{var t,n;return qe(null==e||null===(t=e.searchData)||void 0===t||null===(n=t.petDetails)||void 0===n?void 0:n.breedType)}},{Header:e("PTR_STATUS"),Cell:t=>{var n,l,r;let{row:i}=t;return Ye(e(""+(null==i||null===(n=i.original)||void 0===n||null===(l=n.workflowData)||void 0===l||null===(r=l.state)||void 0===r?void 0:r.applicationStatus)))},mobileCell:t=>{var n,l;return qe(e("ES_PTR_COMMON_STATUS_"+(null==t||null===(n=t.workflowData)||void 0===n||null===(l=n.state)||void 0===l?void 0:l.applicationStatus)))}}],serviceRequestIdKey:t=>{var n,l;return null==t||null===(n=t[e("PTR_INBOX_UNIQUE_APPLICATION_NUMBER")])||void 0===n||null===(l=n.props)||void 0===l?void 0:l.children}}})},exports.PTRLinks=yi,exports.PTRModule=gi;
1
+ var e,t=require("@upyog/digit-ui-react-components"),n=require("react"),l=(e=n)&&"object"==typeof e&&"default"in e?e.default:e,i=require("react-i18next"),o=require("react-router-dom"),a=require("react-hook-form"),r=require("react-query");function u(){return(u=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var l in n)({}).hasOwnProperty.call(n,l)&&(e[l]=n[l])}return e}).apply(null,arguments)}function c(e,t){if(null==e)return{};var n={};for(var l in e)if({}.hasOwnProperty.call(e,l)){if(-1!==t.indexOf(l))continue;n[l]=e[l]}return n}let s=[];const d=e=>{let{currentStep:n=1,flow:o=""}=e;const{t:a}=i.useTranslation(),r=window.Digit.Utils.browser.isMobile();return(e=>{switch(e){case"STAKEHOLDER":s=[];break;default:s=["ES_TITILE_OWNER_DETAILS","ES_TITILE_PET_DETAILS","PTR_LOCATION_DETAILS","ES_TITILE_DOCUMENT_DETAILS","PTR_SUMMARY"]}})(o),l.createElement("div",{className:"timeline-container",style:r?{}:{maxWidth:"960px",minWidth:"640px",marginRight:"auto"}},s.map((e,i,o)=>l.createElement("div",{className:"timeline-checkpoint",key:i},l.createElement("div",{className:"timeline-content"},l.createElement("span",{className:"circle "+(i<=n-1&&"active")},i<n-1?l.createElement(t.TickMark,null):i+1),l.createElement("span",{className:"secondary-color"},a(e))),i<o.length-1&&l.createElement("span",{className:"line "+(i<n-1&&"active")}))))};var p="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function v(e,t){return e(t={exports:{}},t.exports),t.exports}var m=v(function(e,t){(function(){var n="Expected a function",l="__lodash_placeholder__",i=[["ary",128],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",32],["partialRight",64],["rearg",256]],o="[object Arguments]",a="[object Array]",r="[object Boolean]",u="[object Date]",c="[object Error]",s="[object Function]",d="[object GeneratorFunction]",v="[object Map]",m="[object Number]",f="[object Object]",E="[object RegExp]",_="[object Set]",h="[object String]",g="[object Symbol]",S="[object WeakMap]",y="[object ArrayBuffer]",b="[object DataView]",T="[object Float32Array]",A="[object Float64Array]",C="[object Int8Array]",D="[object Int16Array]",N="[object Int32Array]",P="[object Uint8Array]",R="[object Uint16Array]",I="[object Uint32Array]",O=/\b__p \+= '';/g,x=/\b(__p \+=) '' \+/g,w=/(__e\(.*?\)|\b__t\)) \+\n'';/g,L=/&(?:amp|lt|gt|quot|#39);/g,M=/[&<>"']/g,k=RegExp(L.source),F=RegExp(M.source),B=/<%-([\s\S]+?)%>/g,U=/<%([\s\S]+?)%>/g,H=/<%=([\s\S]+?)%>/g,j=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,W=/^\w*$/,z=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,V=/[\\^$.*+?()[\]{}|]/g,K=RegExp(V.source),Y=/^\s+/,G=/\s/,q=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,$=/\{\n\/\* \[wrapped with (.+)\] \*/,X=/,? & /,Z=/[^\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,ie=/^\[object .+?Constructor\]$/,oe=/^0o[0-7]+$/i,ae=/^(?:0|[1-9]\d*)$/,re=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ue=/($^)/,ce=/['\n\r\u2028\u2029\\]/g,se="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",de="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",pe="["+de+"]",ve="["+se+"]",me="\\d+",fe="[a-z\\xdf-\\xf6\\xf8-\\xff]",Ee="[^\\ud800-\\udfff"+de+me+"\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",_e="\\ud83c[\\udffb-\\udfff]",he="[^\\ud800-\\udfff]",ge="(?:\\ud83c[\\udde6-\\uddff]){2}",Se="[\\ud800-\\udbff][\\udc00-\\udfff]",ye="[A-Z\\xc0-\\xd6\\xd8-\\xde]",be="(?:"+fe+"|"+Ee+")",Te="(?:"+ye+"|"+Ee+")",Ae="(?:"+ve+"|"+_e+")?",Ce="[\\ufe0e\\ufe0f]?"+Ae+"(?:\\u200d(?:"+[he,ge,Se].join("|")+")[\\ufe0e\\ufe0f]?"+Ae+")*",De="(?:"+["[\\u2700-\\u27bf]",ge,Se].join("|")+")"+Ce,Ne="(?:"+[he+ve+"?",ve,ge,Se,"[\\ud800-\\udfff]"].join("|")+")",Pe=RegExp("['’]","g"),Re=RegExp(ve,"g"),Ie=RegExp(_e+"(?="+_e+")|"+Ne+Ce,"g"),Oe=RegExp([ye+"?"+fe+"+(?:['’](?:d|ll|m|re|s|t|ve))?(?="+[pe,ye,"$"].join("|")+")",Te+"+(?:['’](?:D|LL|M|RE|S|T|VE))?(?="+[pe,ye+be,"$"].join("|")+")",ye+"?"+be+"+(?:['’](?:d|ll|m|re|s|t|ve))?",ye+"+(?:['’](?: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"),xe=RegExp("[\\u200d\\ud800-\\udfff"+se+"\\ufe0e\\ufe0f]"),we=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Le=["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,ke={};ke[T]=ke[A]=ke[C]=ke[D]=ke[N]=ke[P]=ke["[object Uint8ClampedArray]"]=ke[R]=ke[I]=!0,ke[o]=ke[a]=ke[y]=ke[r]=ke[b]=ke[u]=ke[c]=ke[s]=ke[v]=ke[m]=ke[f]=ke[E]=ke[_]=ke[h]=ke[S]=!1;var Fe={};Fe[o]=Fe[a]=Fe[y]=Fe[b]=Fe[r]=Fe[u]=Fe[T]=Fe[A]=Fe[C]=Fe[D]=Fe[N]=Fe[v]=Fe[m]=Fe[f]=Fe[E]=Fe[_]=Fe[h]=Fe[g]=Fe[P]=Fe["[object Uint8ClampedArray]"]=Fe[R]=Fe[I]=!0,Fe[c]=Fe[s]=Fe[S]=!1;var Be={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Ue=parseFloat,He=parseInt,je="object"==typeof p&&p&&p.Object===Object&&p,We="object"==typeof self&&self&&self.Object===Object&&self,ze=je||We||Function("return this")(),Ve=t&&!t.nodeType&&t,Ke=Ve&&e&&!e.nodeType&&e,Ye=Ke&&Ke.exports===Ve,Ge=Ye&&je.process,qe=function(){try{return Ke&&Ke.require&&Ke.require("util").types||Ge&&Ge.binding&&Ge.binding("util")}catch(e){}}(),$e=qe&&qe.isArrayBuffer,Xe=qe&&qe.isDate,Ze=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 i=-1,o=null==e?0:e.length;++i<o;){var a=e[i];t(l,a,n(a),e)}return l}function lt(e,t){for(var n=-1,l=null==e?0:e.length;++n<l&&!1!==t(e[n],n,e););return e}function it(e,t){for(var n=null==e?0:e.length;n--&&!1!==t(e[n],n,e););return e}function ot(e,t){for(var n=-1,l=null==e?0:e.length;++n<l;)if(!t(e[n],n,e))return!1;return!0}function at(e,t){for(var n=-1,l=null==e?0:e.length,i=0,o=[];++n<l;){var a=e[n];t(a,n,e)&&(o[i++]=a)}return o}function rt(e,t){return!(null==e||!e.length)&&_t(e,t,0)>-1}function ut(e,t,n){for(var l=-1,i=null==e?0:e.length;++l<i;)if(n(t,e[l]))return!0;return!1}function ct(e,t){for(var n=-1,l=null==e?0:e.length,i=Array(l);++n<l;)i[n]=t(e[n],n,e);return i}function st(e,t){for(var n=-1,l=t.length,i=e.length;++n<l;)e[i+n]=t[n];return e}function dt(e,t,n,l){var i=-1,o=null==e?0:e.length;for(l&&o&&(n=e[++i]);++i<o;)n=t(n,e[i],i,e);return n}function pt(e,t,n,l){var i=null==e?0:e.length;for(l&&i&&(n=e[--i]);i--;)n=t(n,e[i],i,e);return n}function 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=yt("length");function ft(e,t,n){var l;return n(e,function(e,n,i){if(t(e,n,i))return l=n,!1}),l}function Et(e,t,n,l){for(var i=e.length,o=n+(l?1:-1);l?o--:++o<i;)if(t(e[o],o,e))return o;return-1}function _t(e,t,n){return t==t?function(e,t,n){for(var l=n-1,i=e.length;++l<i;)if(e[l]===t)return l;return-1}(e,t,n):Et(e,gt,n)}function ht(e,t,n,l){for(var i=n-1,o=e.length;++i<o;)if(l(e[i],t))return i;return-1}function gt(e){return e!=e}function St(e,t){var n=null==e?0:e.length;return n?At(e,t)/n:NaN}function yt(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,i){return i(e,function(e,i,o){n=l?(l=!1,e):t(n,e,i,o)}),n}function At(e,t){for(var n,l=-1,i=e.length;++l<i;){var o=t(e[l]);void 0!==o&&(n=void 0===n?o:n+o)}return n}function Ct(e,t){for(var n=-1,l=Array(e);++n<e;)l[n]=t(n);return l}function Dt(e){return e?e.slice(0,Vt(e)+1).replace(Y,""):e}function Nt(e){return function(t){return e(t)}}function Pt(e,t){return ct(t,function(t){return e[t]})}function Rt(e,t){return e.has(t)}function It(e,t){for(var n=-1,l=e.length;++n<l&&_t(t,e[n],0)>-1;);return n}function Ot(e,t){for(var n=e.length;n--&&_t(t,e[n],0)>-1;);return n}function xt(e,t){for(var n=e.length,l=0;n--;)e[n]===t&&++l;return l}var wt=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"}),Lt=bt({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"});function Mt(e){return"\\"+Be[e]}function kt(e){return xe.test(e)}function Ft(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,i=e.length,o=0,a=[];++n<i;){var r=e[n];r!==t&&r!==l||(e[n]=l,a[o++]=n)}return a}function Ht(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}function jt(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=[e,e]}),n}function Wt(e){return kt(e)?function(e){for(var t=Ie.lastIndex=0;Ie.test(e);)++t;return t}(e):mt(e)}function zt(e){return kt(e)?function(e){return e.match(Ie)||[]}(e):function(e){return e.split("")}(e)}function Vt(e){for(var t=e.length;t--&&G.test(e.charAt(t)););return t}var Kt=bt({"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"}),Yt=function e(t){var p,G=(t=null==t?ze:Yt.defaults(ze.Object(),t,Yt.pick(ze,Le))).Array,se=t.Date,de=t.Error,pe=t.Function,ve=t.Math,me=t.Object,fe=t.RegExp,Ee=t.String,_e=t.TypeError,he=G.prototype,ge=me.prototype,Se=t["__core-js_shared__"],ye=pe.prototype.toString,be=ge.hasOwnProperty,Te=0,Ae=(p=/[^.]+$/.exec(Se&&Se.keys&&Se.keys.IE_PROTO||""))?"Symbol(src)_1."+p:"",Ce=ge.toString,De=ye.call(me),Ne=ze._,Ie=fe("^"+ye.call(be).replace(V,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),xe=Ye?t.Buffer:void 0,Be=t.Symbol,je=t.Uint8Array,We=xe?xe.allocUnsafe:void 0,Ve=Bt(me.getPrototypeOf,me),Ke=me.create,Ge=ge.propertyIsEnumerable,qe=he.splice,mt=Be?Be.isConcatSpreadable:void 0,bt=Be?Be.iterator:void 0,Gt=Be?Be.toStringTag:void 0,qt=function(){try{var e=Ji(me,"defineProperty");return e({},"",{}),e}catch(e){}}(),$t=t.clearTimeout!==ze.clearTimeout&&t.clearTimeout,Xt=se&&se.now!==ze.Date.now&&se.now,Zt=t.setTimeout!==ze.setTimeout&&t.setTimeout,Jt=ve.ceil,Qt=ve.floor,en=me.getOwnPropertySymbols,tn=xe?xe.isBuffer:void 0,nn=t.isFinite,ln=he.join,on=Bt(me.keys,me),an=ve.max,rn=ve.min,un=se.now,cn=t.parseInt,sn=ve.random,dn=he.reverse,pn=Ji(t,"DataView"),vn=Ji(t,"Map"),mn=Ji(t,"Promise"),fn=Ji(t,"Set"),En=Ji(t,"WeakMap"),_n=Ji(me,"create"),hn=En&&new En,gn={},Sn=Po(pn),yn=Po(vn),bn=Po(mn),Tn=Po(fn),An=Po(En),Cn=Be?Be.prototype:void 0,Dn=Cn?Cn.valueOf:void 0,Nn=Cn?Cn.toString:void 0;function Pn(e){if(Ka(e)&&!La(e)&&!(e instanceof xn)){if(e instanceof On)return e;if(be.call(e,"__wrapped__"))return Ro(e)}return new On(e)}var Rn=function(){function e(){}return function(t){if(!Va(t))return{};if(Ke)return Ke(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function In(){}function On(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=void 0}function xn(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=4294967295,this.__views__=[]}function wn(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 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 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 kn(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new Mn;++t<n;)this.add(e[t])}function Fn(e){var t=this.__data__=new Ln(e);this.size=t.size}function Bn(e,t){var n=La(e),l=!n&&wa(e),i=!n&&!l&&Ba(e),o=!n&&!l&&!i&&Qa(e),a=n||l||i||o,r=a?Ct(e.length,Ee):[],u=r.length;for(var c in e)!t&&!be.call(e,c)||a&&("length"==c||i&&("offset"==c||"parent"==c)||o&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||oo(c,u))||r.push(c);return r}function Un(e){var t=e.length;return t?e[Ml(0,t-1)]:void 0}function Hn(e,t){return To(Ei(e),$n(t,0,e.length))}function jn(e){return To(Ei(e))}function Wn(e,t,n){(void 0!==n&&!Ia(e[t],n)||void 0===n&&!(t in e))&&Gn(e,t,n)}function zn(e,t,n){var l=e[t];be.call(e,t)&&Ia(l,n)&&(void 0!==n||t in e)||Gn(e,t,n)}function Vn(e,t){for(var n=e.length;n--;)if(Ia(e[n][0],t))return n;return-1}function Kn(e,t,n,l){return el(e,function(e,i,o){t(l,e,n(e),o)}),l}function Yn(e,t){return e&&_i(t,yr(t),e)}function Gn(e,t,n){"__proto__"==t&&qt?qt(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function qn(e,t){for(var n=-1,l=t.length,i=G(l),o=null==e;++n<l;)i[n]=o?void 0:Er(e,t[n]);return i}function $n(e,t,n){return e==e&&(void 0!==n&&(e=e<=n?e:n),void 0!==t&&(e=e>=t?e:t)),e}function Xn(e,t,n,l,i,a){var c,p=1&t,S=2&t,O=4&t;if(n&&(c=i?n(e,l,i,a):n(e)),void 0!==c)return c;if(!Va(e))return e;var x=La(e);if(x){if(c=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),!p)return Ei(e,c)}else{var w=to(e),L=w==s||w==d;if(Ba(e))return si(e,p);if(w==f||w==o||L&&!i){if(c=S||L?{}:lo(e),!p)return S?function(e,t){return _i(e,eo(e),t)}(e,function(e,t){return e&&_i(t,br(t),e)}(c,e)):function(e,t){return _i(e,Qi(e),t)}(e,Yn(c,e))}else{if(!Fe[w])return i?e:{};c=function(e,t,n){var l=e.constructor;switch(t){case y:return di(e);case r:case u:return new l(+e);case b:return function(e,t){var n=t?di(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,n);case T:case A:case C:case D:case N:case P:case"[object Uint8ClampedArray]":case R:case I:return pi(e,n);case v:return new l;case m:case h: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 _:return new l;case g:return Dn?me(Dn.call(e)):{}}}(e,w,p)}}a||(a=new Fn);var M=a.get(e);if(M)return M;a.set(e,c),Xa(e)?e.forEach(function(l){c.add(Xn(l,t,n,l,e,a))}):Ya(e)&&e.forEach(function(l,i){c.set(i,Xn(l,t,n,i,e,a))});var k=x?void 0:(O?S?Ki:Vi:S?br:yr)(e);return lt(k||e,function(l,i){k&&(l=e[i=l]),zn(c,i,Xn(l,t,n,i,e,a))}),c}function Zn(e,t,n){var l=n.length;if(null==e)return!l;for(e=me(e);l--;){var i=n[l],o=e[i];if(void 0===o&&!(i in e)||!(0,t[i])(o))return!1}return!0}function Jn(e,t,l){if("function"!=typeof e)throw new _e(n);return go(function(){e.apply(void 0,l)},t)}function Qn(e,t,n,l){var i=-1,o=rt,a=!0,r=e.length,u=[],c=t.length;if(!r)return u;n&&(t=ct(t,Nt(n))),l?(o=ut,a=!1):t.length>=200&&(o=Rt,a=!1,t=new kn(t));e:for(;++i<r;){var s=e[i],d=null==n?s:n(s);if(s=l||0!==s?s:0,a&&d==d){for(var p=c;p--;)if(t[p]===d)continue e;u.push(s)}else o(t,d,l)||u.push(s)}return u}Pn.templateSettings={escape:B,evaluate:U,interpolate:H,variable:"",imports:{_:Pn}},(Pn.prototype=In.prototype).constructor=Pn,(On.prototype=Rn(In.prototype)).constructor=On,(xn.prototype=Rn(In.prototype)).constructor=xn,wn.prototype.clear=function(){this.__data__=_n?_n(null):{},this.size=0},wn.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},wn.prototype.get=function(e){var t=this.__data__;if(_n){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return be.call(t,e)?t[e]:void 0},wn.prototype.has=function(e){var t=this.__data__;return _n?void 0!==t[e]:be.call(t,e)},wn.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=_n&&void 0===t?"__lodash_hash_undefined__":t,this},Ln.prototype.clear=function(){this.__data__=[],this.size=0},Ln.prototype.delete=function(e){var t=this.__data__,n=Vn(t,e);return!(n<0||(n==t.length-1?t.pop():qe.call(t,n,1),--this.size,0))},Ln.prototype.get=function(e){var t=this.__data__,n=Vn(t,e);return n<0?void 0:t[n][1]},Ln.prototype.has=function(e){return Vn(this.__data__,e)>-1},Ln.prototype.set=function(e,t){var n=this.__data__,l=Vn(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 wn,map:new(vn||Ln),string:new wn}},Mn.prototype.delete=function(e){var t=Xi(this,e).delete(e);return this.size-=t?1:0,t},Mn.prototype.get=function(e){return Xi(this,e).get(e)},Mn.prototype.has=function(e){return Xi(this,e).has(e)},Mn.prototype.set=function(e,t){var n=Xi(this,e),l=n.size;return n.set(e,t),this.size+=n.size==l?0:1,this},kn.prototype.add=kn.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},kn.prototype.has=function(e){return this.__data__.has(e)},Fn.prototype.clear=function(){this.__data__=new Ln,this.size=0},Fn.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},Fn.prototype.get=function(e){return this.__data__.get(e)},Fn.prototype.has=function(e){return this.__data__.has(e)},Fn.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Ln){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=Si(ul),tl=Si(cl,!0);function nl(e,t){var n=!0;return el(e,function(e,l,i){return n=!!t(e,l,i)}),n}function ll(e,t,n){for(var l=-1,i=e.length;++l<i;){var o=e[l],a=t(o);if(null!=a&&(void 0===r?a==a&&!Ja(a):n(a,r)))var r=a,u=o}return u}function il(e,t){var n=[];return el(e,function(e,l,i){t(e,l,i)&&n.push(e)}),n}function ol(e,t,n,l,i){var o=-1,a=e.length;for(n||(n=io),i||(i=[]);++o<a;){var r=e[o];t>0&&n(r)?t>1?ol(r,t-1,n,l,i):st(i,r):l||(i[i.length]=r)}return i}var al=yi(),rl=yi(!0);function ul(e,t){return e&&al(e,t,yr)}function cl(e,t){return e&&rl(e,t,yr)}function sl(e,t){return at(t,function(t){return ja(e[t])})}function dl(e,t){for(var n=0,l=(t=ai(t,e)).length;null!=e&&n<l;)e=e[No(t[n++])];return n&&n==l?e:void 0}function pl(e,t,n){var l=t(e);return La(e)?l:st(l,n(e))}function vl(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Gt&&Gt in me(e)?function(e){var t=be.call(e,Gt),n=e[Gt];try{e[Gt]=void 0;var l=!0}catch(e){}var i=Ce.call(e);return l&&(t?e[Gt]=n:delete e[Gt]),i}(e):function(e){return Ce.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 _l(e,t,n){for(var l=n?ut:rt,i=e[0].length,o=e.length,a=o,r=G(o),u=Infinity,c=[];a--;){var s=e[a];a&&t&&(s=ct(s,Nt(t))),u=rn(s.length,u),r[a]=!n&&(t||i>=120&&s.length>=120)?new kn(a&&s):void 0}s=e[0];var d=-1,p=r[0];e:for(;++d<i&&c.length<u;){var v=s[d],m=t?t(v):v;if(v=n||0!==v?v:0,!(p?Rt(p,m):l(c,m,n))){for(a=o;--a;){var f=r[a];if(!(f?Rt(f,m):l(e[a],m,n)))continue e}p&&p.push(m),c.push(v)}}return c}function hl(e,t,n){var l=null==(e=fo(e,t=ai(t,e)))?e:e[No(Ho(t))];return null==l?void 0:tt(l,e,n)}function gl(e){return Ka(e)&&vl(e)==o}function Sl(e,t,n,l,i){return e===t||(null==e||null==t||!Ka(e)&&!Ka(t)?e!=e&&t!=t:function(e,t,n,l,i,s){var d=La(e),p=La(t),S=d?a:to(e),T=p?a:to(t),A=(S=S==o?f:S)==f,C=(T=T==o?f:T)==f,D=S==T;if(D&&Ba(e)){if(!Ba(t))return!1;d=!0,A=!1}if(D&&!A)return s||(s=new Fn),d||Qa(e)?Wi(e,t,n,l,i,s):function(e,t,n,l,i,o,a){switch(n){case b:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case y:return!(e.byteLength!=t.byteLength||!o(new je(e),new je(t)));case r:case u:case m:return Ia(+e,+t);case c:return e.name==t.name&&e.message==t.message;case E:case h:return e==t+"";case v:var s=Ft;case _:if(s||(s=Ht),e.size!=t.size&&!(1&l))return!1;var d=a.get(e);if(d)return d==t;l|=2,a.set(e,t);var p=Wi(s(e),s(t),l,i,o,a);return a.delete(e),p;case g:if(Dn)return Dn.call(e)==Dn.call(t)}return!1}(e,t,S,n,l,i,s);if(!(1&n)){var N=A&&be.call(e,"__wrapped__"),P=C&&be.call(t,"__wrapped__");if(N||P){var R=N?e.value():e,I=P?t.value():t;return s||(s=new Fn),i(R,I,n,l,s)}}return!!D&&(s||(s=new Fn),function(e,t,n,l,i,o){var a=1&n,r=Vi(e),u=r.length;if(u!=Vi(t).length&&!a)return!1;for(var c=u;c--;){var s=r[c];if(!(a?s in t:be.call(t,s)))return!1}var d=o.get(e),p=o.get(t);if(d&&p)return d==t&&p==e;var v=!0;o.set(e,t),o.set(t,e);for(var m=a;++c<u;){var f=e[s=r[c]],E=t[s];if(l)var _=a?l(E,f,s,t,e,o):l(f,E,s,e,t,o);if(!(void 0===_?f===E||i(f,E,n,l,o):_)){v=!1;break}m||(m="constructor"==s)}if(v&&!m){var h=e.constructor,g=t.constructor;h==g||!("constructor"in e)||!("constructor"in t)||"function"==typeof h&&h instanceof h&&"function"==typeof g&&g instanceof g||(v=!1)}return o.delete(e),o.delete(t),v}(e,t,n,l,i,s))}(e,t,n,l,Sl,i))}function yl(e,t,n,l){var i=n.length,o=i,a=!l;if(null==e)return!o;for(e=me(e);i--;){var r=n[i];if(a&&r[2]?r[1]!==e[r[0]]:!(r[0]in e))return!1}for(;++i<o;){var u=(r=n[i])[0],c=e[u],s=r[1];if(a&&r[2]){if(void 0===c&&!(u in e))return!1}else{var d=new Fn;if(l)var p=l(c,s,u,e,t,d);if(!(void 0===p?Sl(s,c,3,l,d):p))return!1}}return!0}function bl(e){return!(!Va(e)||(t=e,Ae&&Ae in t))&&(ja(e)?Ie:ie).test(Po(e));var t}function Tl(e){return"function"==typeof e?e:null==e?Gr:"object"==typeof e?La(e)?Pl(e[0],e[1]):Nl(e):nu(e)}function Al(e){if(!so(e))return on(e);var t=[];for(var n in me(e))be.call(e,n)&&"constructor"!=n&&t.push(n);return t}function Cl(e,t){return e<t}function Dl(e,t){var n=-1,l=ka(e)?G(e.length):[];return el(e,function(e,i,o){l[++n]=t(e,i,o)}),l}function Nl(e){var t=Zi(e);return 1==t.length&&t[0][2]?vo(t[0][0],t[0][1]):function(n){return n===e||yl(n,e,t)}}function Pl(e,t){return ro(e)&&po(t)?vo(No(e),t):function(n){var l=Er(n,e);return void 0===l&&l===t?_r(n,e):Sl(t,l,3)}}function Rl(e,t,n,l,i){e!==t&&al(t,function(o,a){if(i||(i=new Fn),Va(o))!function(e,t,n,l,i,o,a){var r=_o(e,n),u=_o(t,n),c=a.get(u);if(c)Wn(e,n,c);else{var s=o?o(r,u,n+"",e,t,a):void 0,d=void 0===s;if(d){var p=La(u),v=!p&&Ba(u),m=!p&&!v&&Qa(u);s=u,p||v||m?La(r)?s=r:Fa(r)?s=Ei(r):v?(d=!1,s=si(u,!0)):m?(d=!1,s=pi(u,!0)):s=[]:qa(u)||wa(u)?(s=r,wa(r)?s=rr(r):Va(r)&&!ja(r)||(s=lo(u))):d=!1}d&&(a.set(u,s),i(s,u,l,o,a),a.delete(u)),Wn(e,n,s)}}(e,t,a,n,Rl,l,i);else{var r=l?l(_o(e,a),o,a+"",e,t,i):void 0;void 0===r&&(r=o),Wn(e,a,r)}},br)}function Il(e,t){var n=e.length;if(n)return oo(t+=t<0?n:0,n)?e[t]:void 0}function Ol(e,t,n){t=t.length?ct(t,function(e){return La(e)?function(t){return dl(t,1===e.length?e[0]:e)}:e}):[Gr];var l=-1;return t=ct(t,Nt($i())),function(e,t){var l=e.length;for(e.sort(function(e,t){return function(e,t,n){for(var l=-1,i=e.criteria,o=t.criteria,a=i.length,r=n.length;++l<a;){var u=vi(i[l],o[l]);if(u)return l>=r?u:u*("desc"==n[l]?-1:1)}return e.index-t.index}(e,t,n)});l--;)e[l]=e[l].value;return e}(Dl(e,function(e,n,i){return{criteria:ct(t,function(t){return t(e)}),index:++l,value:e}}))}function xl(e,t,n){for(var l=-1,i=t.length,o={};++l<i;){var a=t[l],r=dl(e,a);n(r,a)&&Hl(o,ai(a,e),r)}return o}function wl(e,t,n,l){var i=l?ht:_t,o=-1,a=t.length,r=e;for(e===t&&(t=Ei(t)),n&&(r=ct(e,Nt(n)));++o<a;)for(var u=0,c=t[o],s=n?n(c):c;(u=i(r,s,u,l))>-1;)r!==e&&qe.call(r,u,1),qe.call(e,u,1);return e}function Ll(e,t){for(var n=e?t.length:0,l=n-1;n--;){var i=t[n];if(n==l||i!==o){var o=i;oo(i)?qe.call(e,i,1):Jl(e,i)}}return e}function Ml(e,t){return e+Qt(sn()*(t-e+1))}function kl(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 Fl(e,t){return So(mo(e,t,Gr),e+"")}function Bl(e){return Un(Ir(e))}function Ul(e,t){var n=Ir(e);return To(n,$n(t,0,n.length))}function Hl(e,t,n,l){if(!Va(e))return e;for(var i=-1,o=(t=ai(t,e)).length,a=o-1,r=e;null!=r&&++i<o;){var u=No(t[i]),c=n;if("__proto__"===u||"constructor"===u||"prototype"===u)return e;if(i!=a){var s=r[u];void 0===(c=l?l(s,u,r):void 0)&&(c=Va(s)?s:oo(t[i+1])?[]:{})}zn(r,u,c),r=r[u]}return e}var jl=hn?function(e,t){return hn.set(e,t),e}:Gr,Wl=qt?function(e,t){return qt(e,"toString",{configurable:!0,enumerable:!1,value:Vr(t),writable:!0})}:Gr;function zl(e){return To(Ir(e))}function Vl(e,t,n){var l=-1,i=e.length;t<0&&(t=-t>i?0:i+t),(n=n>i?i:n)<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var o=G(i);++l<i;)o[l]=e[l+t];return o}function Kl(e,t){var n;return el(e,function(e,l,i){return!(n=t(e,l,i))}),!!n}function Yl(e,t,n){var l=0,i=null==e?l:e.length;if("number"==typeof t&&t==t&&i<=2147483647){for(;l<i;){var o=l+i>>>1,a=e[o];null!==a&&!Ja(a)&&(n?a<=t:a<t)?l=o+1:i=o}return i}return Gl(e,t,Gr,n)}function Gl(e,t,n,l){var i=0,o=null==e?0:e.length;if(0===o)return 0;for(var a=(t=n(t))!=t,r=null===t,u=Ja(t),c=void 0===t;i<o;){var s=Qt((i+o)/2),d=n(e[s]),p=void 0!==d,v=null===d,m=d==d,f=Ja(d);if(a)var E=l||m;else E=c?m&&(l||p):r?m&&p&&(l||!v):u?m&&p&&!v&&(l||!f):!v&&!f&&(l?d<=t:d<t);E?i=s+1:o=s}return rn(o,4294967294)}function ql(e,t){for(var n=-1,l=e.length,i=0,o=[];++n<l;){var a=e[n],r=t?t(a):a;if(!n||!Ia(r,u)){var u=r;o[i++]=0===a?0:a}}return o}function $l(e){return"number"==typeof e?e:Ja(e)?NaN:+e}function Xl(e){if("string"==typeof e)return e;if(La(e))return ct(e,Xl)+"";if(Ja(e))return Nn?Nn.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Zl(e,t,n){var l=-1,i=rt,o=e.length,a=!0,r=[],u=r;if(n)a=!1,i=ut;else if(o>=200){var c=t?null:ki(e);if(c)return Ht(c);a=!1,i=Rt,u=new kn}else u=t?[]:r;e:for(;++l<o;){var s=e[l],d=t?t(s):s;if(s=n||0!==s?s:0,a&&d==d){for(var p=u.length;p--;)if(u[p]===d)continue e;t&&u.push(d),r.push(s)}else i(u,d,n)||(u!==r&&u.push(d),r.push(s))}return r}function Jl(e,t){return null==(e=fo(e,t=ai(t,e)))||delete e[No(Ho(t))]}function Ql(e,t,n,l){return Hl(e,t,n(dl(e,t)),l)}function ei(e,t,n,l){for(var i=e.length,o=l?i:-1;(l?o--:++o<i)&&t(e[o],o,e););return n?Vl(e,l?0:o,l?o+1:i):Vl(e,l?o+1:0,l?i:o)}function ti(e,t){var n=e;return n instanceof xn&&(n=n.value()),dt(t,function(e,t){return t.func.apply(t.thisArg,st([e],t.args))},n)}function ni(e,t,n){var l=e.length;if(l<2)return l?Zl(e[0]):[];for(var i=-1,o=G(l);++i<l;)for(var a=e[i],r=-1;++r<l;)r!=i&&(o[i]=Qn(o[i]||a,e[r],t,n));return Zl(ol(o,1),t,n)}function li(e,t,n){for(var l=-1,i=e.length,o=t.length,a={};++l<i;)n(a,e[l],l<o?t[l]:void 0);return a}function ii(e){return Fa(e)?e:[]}function oi(e){return"function"==typeof e?e:Gr}function ai(e,t){return La(e)?e:ro(e,t)?[e]:Do(ur(e))}var ri=Fl;function ui(e,t,n){var l=e.length;return n=void 0===n?l:n,!t&&n>=l?e:Vl(e,t,n)}var ci=$t||function(e){return ze.clearTimeout(e)};function si(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 di(e){var t=new e.constructor(e.byteLength);return new je(t).set(new je(e)),t}function pi(e,t){var n=t?di(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function vi(e,t){if(e!==t){var n=void 0!==e,l=null===e,i=e==e,o=Ja(e),a=void 0!==t,r=null===t,u=t==t,c=Ja(t);if(!r&&!c&&!o&&e>t||o&&a&&u&&!r&&!c||l&&a&&u||!n&&u||!i)return 1;if(!l&&!o&&!c&&e<t||c&&n&&i&&!l&&!o||r&&n&&i||!a&&i||!u)return-1}return 0}function mi(e,t,n,l){for(var i=-1,o=e.length,a=n.length,r=-1,u=t.length,c=an(o-a,0),s=G(u+c),d=!l;++r<u;)s[r]=t[r];for(;++i<a;)(d||i<o)&&(s[n[i]]=e[i]);for(;c--;)s[r++]=e[i++];return s}function fi(e,t,n,l){for(var i=-1,o=e.length,a=-1,r=n.length,u=-1,c=t.length,s=an(o-r,0),d=G(s+c),p=!l;++i<s;)d[i]=e[i];for(var v=i;++u<c;)d[v+u]=t[u];for(;++a<r;)(p||i<o)&&(d[v+n[a]]=e[i++]);return d}function Ei(e,t){var n=-1,l=e.length;for(t||(t=G(l));++n<l;)t[n]=e[n];return t}function _i(e,t,n,l){var i=!n;n||(n={});for(var o=-1,a=t.length;++o<a;){var r=t[o],u=l?l(n[r],e[r],r,n,e):void 0;void 0===u&&(u=e[r]),i?Gn(n,r,u):zn(n,r,u)}return n}function hi(e,t){return function(n,l){var i=La(n)?nt:Kn,o=t?t():{};return i(n,e,$i(l,2),o)}}function gi(e){return Fl(function(t,n){var l=-1,i=n.length,o=i>1?n[i-1]:void 0,a=i>2?n[2]:void 0;for(o=e.length>3&&"function"==typeof o?(i--,o):void 0,a&&ao(n[0],n[1],a)&&(o=i<3?void 0:o,i=1),t=me(t);++l<i;){var r=n[l];r&&e(t,r,l,o)}return t})}function Si(e,t){return function(n,l){if(null==n)return n;if(!ka(n))return e(n,l);for(var i=n.length,o=t?i:-1,a=me(n);(t?o--:++o<i)&&!1!==l(a[o],o,a););return n}}function yi(e){return function(t,n,l){for(var i=-1,o=me(t),a=l(t),r=a.length;r--;){var u=a[e?r:++i];if(!1===n(o[u],u,o))break}return t}}function bi(e){return function(t){var n=kt(t=ur(t))?zt(t):void 0,l=n?n[0]:t.charAt(0),i=n?ui(n,1).join(""):t.slice(1);return l[e]()+i}}function Ti(e){return function(t){return dt(jr(wr(t).replace(Pe,"")),e,"")}}function Ai(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=Rn(e.prototype),l=e.apply(n,t);return Va(l)?l:n}}function Ci(e){return function(t,n,l){var i=me(t);if(!ka(t)){var o=$i(n,3);t=yr(t),n=function(e){return o(i[e],e,i)}}var a=e(t,n,l);return a>-1?i[o?t[a]:a]:void 0}}function Di(e){return zi(function(t){var l=t.length,i=l,o=On.prototype.thru;for(e&&t.reverse();i--;){var a=t[i];if("function"!=typeof a)throw new _e(n);if(o&&!r&&"wrapper"==Gi(a))var r=new On([],!0)}for(i=r?i:l;++i<l;){var u=Gi(a=t[i]),c="wrapper"==u?Yi(a):void 0;r=c&&uo(c[0])&&424==c[1]&&!c[4].length&&1==c[9]?r[Gi(c[0])].apply(r,c[3]):1==a.length&&uo(a)?r[u]():r.thru(a)}return function(){var e=arguments,n=e[0];if(r&&1==e.length&&La(n))return r.plant(n).value();for(var i=0,o=l?t[i].apply(this,e):n;++i<l;)o=t[i].call(this,o);return o}})}function Ni(e,t,n,l,i,o,a,r,u,c){var s=128&t,d=1&t,p=2&t,v=24&t,m=512&t,f=p?void 0:Ai(e);return function E(){for(var _=arguments.length,h=G(_),g=_;g--;)h[g]=arguments[g];if(v)var S=qi(E),y=xt(h,S);if(l&&(h=mi(h,l,i,v)),o&&(h=fi(h,o,a,v)),_-=y,v&&_<c){var b=Ut(h,S);return Li(e,t,Ni,E.placeholder,n,h,b,r,u,c-_)}var T=d?n:this,A=p?T[e]:e;return _=h.length,r?h=Eo(h,r):m&&_>1&&h.reverse(),s&&u<_&&(h.length=u),this&&this!==ze&&this instanceof E&&(A=f||Ai(A)),A.apply(T,h)}}function Pi(e,t){return function(n,l){return function(e,t,n,l){return ul(e,function(e,i,o){t(l,n(e),i,o)}),l}(n,e,t(l),{})}}function Ri(e,t){return function(n,l){var i;if(void 0===n&&void 0===l)return t;if(void 0!==n&&(i=n),void 0!==l){if(void 0===i)return l;"string"==typeof n||"string"==typeof l?(n=Xl(n),l=Xl(l)):(n=$l(n),l=$l(l)),i=e(n,l)}return i}}function Ii(e){return zi(function(t){return t=ct(t,Nt($i())),Fl(function(n){var l=this;return e(t,function(e){return tt(e,l,n)})})})}function Oi(e,t){var n=(t=void 0===t?" ":Xl(t)).length;if(n<2)return n?kl(t,e):t;var l=kl(t,Jt(e/Wt(t)));return kt(t)?ui(zt(l),0,e).join(""):l.slice(0,e)}function xi(e){return function(t,n,l){return l&&"number"!=typeof l&&ao(t,n,l)&&(n=l=void 0),t=lr(t),void 0===n?(n=t,t=0):n=lr(n),function(e,t,n,l){for(var i=-1,o=an(Jt((t-e)/(n||1)),0),a=G(o);o--;)a[l?o:++i]=e,e+=n;return a}(t,n,l=void 0===l?t<n?1:-1:lr(l),e)}}function wi(e){return function(t,n){return"string"==typeof t&&"string"==typeof n||(t=ar(t),n=ar(n)),e(t,n)}}function Li(e,t,n,l,i,o,a,r,u,c){var s=8&t;t|=s?32:64,4&(t&=~(s?64:32))||(t&=-4);var d=[e,t,i,s?o:void 0,s?a:void 0,s?void 0:o,s?void 0:a,r,u,c],p=n.apply(void 0,d);return uo(e)&&ho(p,d),p.placeholder=l,yo(p,e,t)}function Mi(e){var t=ve[e];return function(e,n){if(e=ar(e),(n=null==n?0:rn(ir(n),292))&&nn(e)){var l=(ur(e)+"e").split("e");return+((l=(ur(t(l[0]+"e"+(+l[1]+n)))+"e").split("e"))[0]+"e"+(+l[1]-n))}return t(e)}}var ki=fn&&1/Ht(new fn([,-0]))[1]==1/0?function(e){return new fn(e)}:Jr;function Fi(e){return function(t){var n=to(t);return n==v?Ft(t):n==_?jt(t):function(e,t){return ct(t,function(t){return[t,e[t]]})}(t,e(t))}}function Bi(e,t,i,o,a,r,u,c){var s=2&t;if(!s&&"function"!=typeof e)throw new _e(n);var d=o?o.length:0;if(d||(t&=-97,o=a=void 0),u=void 0===u?u:an(ir(u),0),c=void 0===c?c:ir(c),d-=a?a.length:0,64&t){var p=o,v=a;o=a=void 0}var m=s?void 0:Yi(e),f=[e,t,i,o,a,p,v,r,u,c];if(m&&function(e,t){var n=e[1],i=t[1],o=n|i;if(!(o<131||128==i&&8==n||128==i&&256==n&&e[7].length<=t[8]||384==i&&t[7].length<=t[8]&&8==n))return e;1&i&&(e[2]=t[2],o|=1&n?0:4);var a=t[3];if(a){var r=e[3];e[3]=r?mi(r,a,t[4]):a,e[4]=r?Ut(e[3],l):t[4]}(a=t[5])&&(e[5]=(r=e[5])?fi(r,a,t[6]):a,e[6]=r?Ut(e[5],l):t[6]),(a=t[7])&&(e[7]=a),128&i&&(e[8]=null==e[8]?t[8]:rn(e[8],t[8])),null==e[9]&&(e[9]=t[9]),e[0]=t[0],e[1]=o}(f,m),e=f[0],t=f[1],i=f[2],o=f[3],a=f[4],!(c=f[9]=void 0===f[9]?s?0:e.length:an(f[9]-d,0))&&24&t&&(t&=-25),t&&1!=t)E=8==t||16==t?function(e,t,n){var l=Ai(e);return function i(){for(var o=arguments.length,a=G(o),r=o,u=qi(i);r--;)a[r]=arguments[r];var c=o<3&&a[0]!==u&&a[o-1]!==u?[]:Ut(a,u);if((o-=c.length)<n)return Li(e,t,Ni,i.placeholder,void 0,a,c,void 0,void 0,n-o);var s=this&&this!==ze&&this instanceof i?l:e;return tt(s,this,a)}}(e,t,c):32!=t&&33!=t||a.length?Ni.apply(void 0,f):function(e,t,n,l){var i=1&t,o=Ai(e);return function t(){for(var a=-1,r=arguments.length,u=-1,c=l.length,s=G(c+r),d=this&&this!==ze&&this instanceof t?o:e;++u<c;)s[u]=l[u];for(;r--;)s[u++]=arguments[++a];return tt(d,i?n:this,s)}}(e,t,i,o);else var E=function(e,t,n){var l=1&t,i=Ai(e);return function t(){var o=this&&this!==ze&&this instanceof t?i:e;return o.apply(l?n:this,arguments)}}(e,t,i);return yo((m?jl:ho)(E,f),e,t)}function Ui(e,t,n,l){return void 0===e||Ia(e,ge[n])&&!be.call(l,n)?t:e}function Hi(e,t,n,l,i,o){return Va(e)&&Va(t)&&(o.set(t,e),Rl(e,t,void 0,Hi,o),o.delete(t)),e}function ji(e){return qa(e)?void 0:e}function Wi(e,t,n,l,i,o){var a=1&n,r=e.length,u=t.length;if(r!=u&&!(a&&u>r))return!1;var c=o.get(e),s=o.get(t);if(c&&s)return c==t&&s==e;var d=-1,p=!0,v=2&n?new kn:void 0;for(o.set(e,t),o.set(t,e);++d<r;){var m=e[d],f=t[d];if(l)var E=a?l(f,m,d,t,e,o):l(m,f,d,e,t,o);if(void 0!==E){if(E)continue;p=!1;break}if(v){if(!vt(t,function(e,t){if(!Rt(v,t)&&(m===e||i(m,e,n,l,o)))return v.push(t)})){p=!1;break}}else if(m!==f&&!i(m,f,n,l,o)){p=!1;break}}return o.delete(e),o.delete(t),p}function zi(e){return So(mo(e,void 0,Mo),e+"")}function Vi(e){return pl(e,yr,Qi)}function Ki(e){return pl(e,br,eo)}var Yi=hn?function(e){return hn.get(e)}:Jr;function Gi(e){for(var t=e.name+"",n=gn[t],l=be.call(gn,t)?n.length:0;l--;){var i=n[l],o=i.func;if(null==o||o==e)return i.name}return t}function qi(e){return(be.call(Pn,"placeholder")?Pn:e).placeholder}function $i(){var e=Pn.iteratee||qr;return e=e===qr?Tl:e,arguments.length?e(arguments[0],arguments[1]):e}function Xi(e,t){var n,l,i=e.__data__;return("string"==(l=typeof(n=t))||"number"==l||"symbol"==l||"boolean"==l?"__proto__"!==n:null===n)?i["string"==typeof t?"string":"hash"]:i.map}function Zi(e){for(var t=yr(e),n=t.length;n--;){var l=t[n],i=e[l];t[n]=[l,i,po(i)]}return t}function Ji(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return bl(n)?n:void 0}var Qi=en?function(e){return null==e?[]:(e=me(e),at(en(e),function(t){return Ge.call(e,t)}))}:ou,eo=en?function(e){for(var t=[];e;)st(t,Qi(e)),e=Ve(e);return t}:ou,to=vl;function no(e,t,n){for(var l=-1,i=(t=ai(t,e)).length,o=!1;++l<i;){var a=No(t[l]);if(!(o=null!=e&&n(e,a)))break;e=e[a]}return o||++l!=i?o:!!(i=null==e?0:e.length)&&za(i)&&oo(a,i)&&(La(e)||wa(e))}function lo(e){return"function"!=typeof e.constructor||so(e)?{}:Rn(Ve(e))}function io(e){return La(e)||wa(e)||!!(mt&&e&&e[mt])}function oo(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&ae.test(e))&&e>-1&&e%1==0&&e<t}function ao(e,t,n){if(!Va(n))return!1;var l=typeof t;return!!("number"==l?ka(n)&&oo(t,n.length):"string"==l&&t in n)&&Ia(n[t],e)}function ro(e,t){if(La(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!Ja(e))||W.test(e)||!j.test(e)||null!=t&&e in me(t)}function uo(e){var t=Gi(e),n=Pn[t];if("function"!=typeof n||!(t in xn.prototype))return!1;if(e===n)return!0;var l=Yi(n);return!!l&&e===l[0]}(pn&&to(new pn(new ArrayBuffer(1)))!=b||vn&&to(new vn)!=v||mn&&"[object Promise]"!=to(mn.resolve())||fn&&to(new fn)!=_||En&&to(new En)!=S)&&(to=function(e){var t=vl(e),n=t==f?e.constructor:void 0,l=n?Po(n):"";if(l)switch(l){case Sn:return b;case yn:return v;case bn:return"[object Promise]";case Tn:return _;case An:return S}return t});var co=Se?ja:au;function so(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||ge)}function po(e){return e==e&&!Va(e)}function vo(e,t){return function(n){return null!=n&&n[e]===t&&(void 0!==t||e in me(n))}}function mo(e,t,n){return t=an(void 0===t?e.length-1:t,0),function(){for(var l=arguments,i=-1,o=an(l.length-t,0),a=G(o);++i<o;)a[i]=l[t+i];i=-1;for(var r=G(t+1);++i<t;)r[i]=l[i];return r[t]=n(a),tt(e,this,r)}}function fo(e,t){return t.length<2?e:dl(e,Vl(t,0,-1))}function Eo(e,t){for(var n=e.length,l=rn(t.length,n),i=Ei(e);l--;){var o=t[l];e[l]=oo(o,n)?i[o]:void 0}return e}function _o(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var ho=bo(jl),go=Zt||function(e,t){return ze.setTimeout(e,t)},So=bo(Wl);function yo(e,t,n){var l=t+"";return So(e,function(e,t){var n=t.length;if(!n)return e;var l=n-1;return t[l]=(n>1?"& ":"")+t[l],t=t.join(n>2?", ":" "),e.replace(q,"{\n/* [wrapped with "+t+"] */\n")}(l,function(e,t){return lt(i,function(n){var l="_."+n[0];t&n[1]&&!rt(e,l)&&e.push(l)}),e.sort()}(function(e){var t=e.match($);return t?t[1].split(X):[]}(l),n)))}function bo(e){var t=0,n=0;return function(){var l=un(),i=16-(l-n);if(n=l,i>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function To(e,t){var n=-1,l=e.length,i=l-1;for(t=void 0===t?l:t;++n<t;){var o=Ml(n,i),a=e[o];e[o]=e[n],e[n]=a}return e.length=t,e}var Ao,Co,Do=(Ao=Aa(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(z,function(e,n,l,i){t.push(l?i.replace(Q,"$1"):n||e)}),t},function(e){return 500===Co.size&&Co.clear(),e}),Co=Ao.cache,Ao);function No(e){if("string"==typeof e||Ja(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Po(e){if(null!=e){try{return ye.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function Ro(e){if(e instanceof xn)return e.clone();var t=new On(e.__wrapped__,e.__chain__);return t.__actions__=Ei(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var Io=Fl(function(e,t){return Fa(e)?Qn(e,ol(t,1,Fa,!0)):[]}),Oo=Fl(function(e,t){var n=Ho(t);return Fa(n)&&(n=void 0),Fa(e)?Qn(e,ol(t,1,Fa,!0),$i(n,2)):[]}),xo=Fl(function(e,t){var n=Ho(t);return Fa(n)&&(n=void 0),Fa(e)?Qn(e,ol(t,1,Fa,!0),void 0,n):[]});function wo(e,t,n){var l=null==e?0:e.length;if(!l)return-1;var i=null==n?0:ir(n);return i<0&&(i=an(l+i,0)),Et(e,$i(t,3),i)}function Lo(e,t,n){var l=null==e?0:e.length;if(!l)return-1;var i=l-1;return void 0!==n&&(i=ir(n),i=n<0?an(l+i,0):rn(i,l-1)),Et(e,$i(t,3),i,!0)}function Mo(e){return null!=e&&e.length?ol(e,1):[]}function ko(e){return e&&e.length?e[0]:void 0}var Fo=Fl(function(e){var t=ct(e,ii);return t.length&&t[0]===e[0]?_l(t):[]}),Bo=Fl(function(e){var t=Ho(e),n=ct(e,ii);return t===Ho(n)?t=void 0:n.pop(),n.length&&n[0]===e[0]?_l(n,$i(t,2)):[]}),Uo=Fl(function(e){var t=Ho(e),n=ct(e,ii);return(t="function"==typeof t?t:void 0)&&n.pop(),n.length&&n[0]===e[0]?_l(n,void 0,t):[]});function Ho(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}var jo=Fl(Wo);function Wo(e,t){return e&&e.length&&t&&t.length?wl(e,t):e}var zo=zi(function(e,t){var n=null==e?0:e.length,l=qn(e,t);return Ll(e,ct(t,function(e){return oo(e,n)?+e:e}).sort(vi)),l});function Vo(e){return null==e?e:dn.call(e)}var Ko=Fl(function(e){return Zl(ol(e,1,Fa,!0))}),Yo=Fl(function(e){var t=Ho(e);return Fa(t)&&(t=void 0),Zl(ol(e,1,Fa,!0),$i(t,2))}),Go=Fl(function(e){var t=Ho(e);return t="function"==typeof t?t:void 0,Zl(ol(e,1,Fa,!0),void 0,t)});function qo(e){if(!e||!e.length)return[];var t=0;return e=at(e,function(e){if(Fa(e))return t=an(e.length,t),!0}),Ct(t,function(t){return ct(e,yt(t))})}function $o(e,t){if(!e||!e.length)return[];var n=qo(e);return null==t?n:ct(n,function(e){return tt(t,void 0,e)})}var Xo=Fl(function(e,t){return Fa(e)?Qn(e,t):[]}),Zo=Fl(function(e){return ni(at(e,Fa))}),Jo=Fl(function(e){var t=Ho(e);return Fa(t)&&(t=void 0),ni(at(e,Fa),$i(t,2))}),Qo=Fl(function(e){var t=Ho(e);return t="function"==typeof t?t:void 0,ni(at(e,Fa),void 0,t)}),ea=Fl(qo),ta=Fl(function(e){var t=e.length,n=t>1?e[t-1]:void 0;return n="function"==typeof n?(e.pop(),n):void 0,$o(e,n)});function na(e){var t=Pn(e);return t.__chain__=!0,t}function la(e,t){return t(e)}var ia=zi(function(e){var t=e.length,n=t?e[0]:0,l=this.__wrapped__,i=function(t){return qn(t,e)};return!(t>1||this.__actions__.length)&&l instanceof xn&&oo(n)?((l=l.slice(n,+n+(t?1:0))).__actions__.push({func:la,args:[i],thisArg:void 0}),new On(l,this.__chain__).thru(function(e){return t&&!e.length&&e.push(void 0),e})):this.thru(i)}),oa=hi(function(e,t,n){be.call(e,n)?++e[n]:Gn(e,n,1)}),aa=Ci(wo),ra=Ci(Lo);function ua(e,t){return(La(e)?lt:el)(e,$i(t,3))}function ca(e,t){return(La(e)?it:tl)(e,$i(t,3))}var sa=hi(function(e,t,n){be.call(e,n)?e[n].push(t):Gn(e,n,[t])}),da=Fl(function(e,t,n){var l=-1,i="function"==typeof t,o=ka(e)?G(e.length):[];return el(e,function(e){o[++l]=i?tt(t,e,n):hl(e,t,n)}),o}),pa=hi(function(e,t,n){Gn(e,n,t)});function va(e,t){return(La(e)?ct:Dl)(e,$i(t,3))}var ma=hi(function(e,t,n){e[n?0:1].push(t)},function(){return[[],[]]}),fa=Fl(function(e,t){if(null==e)return[];var n=t.length;return n>1&&ao(e,t[0],t[1])?t=[]:n>2&&ao(t[0],t[1],t[2])&&(t=[t[0]]),Ol(e,ol(t,1),[])}),Ea=Xt||function(){return ze.Date.now()};function _a(e,t,n){return t=n?void 0:t,Bi(e,128,void 0,void 0,void 0,void 0,t=e&&null==t?e.length:t)}function ha(e,t){var l;if("function"!=typeof t)throw new _e(n);return e=ir(e),function(){return--e>0&&(l=t.apply(this,arguments)),e<=1&&(t=void 0),l}}var ga=Fl(function(e,t,n){var l=1;if(n.length){var i=Ut(n,qi(ga));l|=32}return Bi(e,l,t,n,i)}),Sa=Fl(function(e,t,n){var l=3;if(n.length){var i=Ut(n,qi(Sa));l|=32}return Bi(t,l,e,n,i)});function ya(e,t,l){var i,o,a,r,u,c,s=0,d=!1,p=!1,v=!0;if("function"!=typeof e)throw new _e(n);function m(t){var n=i,l=o;return i=o=void 0,s=t,r=e.apply(l,n)}function f(e){return s=e,u=go(_,t),d?m(e):r}function E(e){var n=e-c;return void 0===c||n>=t||n<0||p&&e-s>=a}function _(){var e=Ea();if(E(e))return h(e);u=go(_,function(e){var n=t-(e-c);return p?rn(n,a-(e-s)):n}(e))}function h(e){return u=void 0,v&&i?m(e):(i=o=void 0,r)}function g(){var e=Ea(),n=E(e);if(i=arguments,o=this,c=e,n){if(void 0===u)return f(c);if(p)return ci(u),u=go(_,t),m(c)}return void 0===u&&(u=go(_,t)),r}return t=ar(t)||0,Va(l)&&(d=!!l.leading,a=(p="maxWait"in l)?an(ar(l.maxWait)||0,t):a,v="trailing"in l?!!l.trailing:v),g.cancel=function(){void 0!==u&&ci(u),s=0,i=c=o=u=void 0},g.flush=function(){return void 0===u?r:h(Ea())},g}var ba=Fl(function(e,t){return Jn(e,1,t)}),Ta=Fl(function(e,t,n){return Jn(e,ar(t)||0,n)});function Aa(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new _e(n);var l=function(){var n=arguments,i=t?t.apply(this,n):n[0],o=l.cache;if(o.has(i))return o.get(i);var a=e.apply(this,n);return l.cache=o.set(i,a)||o,a};return l.cache=new(Aa.Cache||Mn),l}function Ca(e){if("function"!=typeof e)throw new _e(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)}}Aa.Cache=Mn;var Da=ri(function(e,t){var n=(t=1==t.length&&La(t[0])?ct(t[0],Nt($i())):ct(ol(t,1),Nt($i()))).length;return Fl(function(l){for(var i=-1,o=rn(l.length,n);++i<o;)l[i]=t[i].call(this,l[i]);return tt(e,this,l)})}),Na=Fl(function(e,t){return Bi(e,32,void 0,t,Ut(t,qi(Na)))}),Pa=Fl(function(e,t){return Bi(e,64,void 0,t,Ut(t,qi(Pa)))}),Ra=zi(function(e,t){return Bi(e,256,void 0,void 0,void 0,t)});function Ia(e,t){return e===t||e!=e&&t!=t}var Oa=wi(ml),xa=wi(function(e,t){return e>=t}),wa=gl(function(){return arguments}())?gl:function(e){return Ka(e)&&be.call(e,"callee")&&!Ge.call(e,"callee")},La=G.isArray,Ma=$e?Nt($e):function(e){return Ka(e)&&vl(e)==y};function ka(e){return null!=e&&za(e.length)&&!ja(e)}function Fa(e){return Ka(e)&&ka(e)}var Ba=tn||au,Ua=Xe?Nt(Xe):function(e){return Ka(e)&&vl(e)==u};function Ha(e){if(!Ka(e))return!1;var t=vl(e);return t==c||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!qa(e)}function ja(e){if(!Va(e))return!1;var t=vl(e);return t==s||t==d||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Wa(e){return"number"==typeof e&&e==ir(e)}function za(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}function Va(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function Ka(e){return null!=e&&"object"==typeof e}var Ya=Ze?Nt(Ze):function(e){return Ka(e)&&to(e)==v};function Ga(e){return"number"==typeof e||Ka(e)&&vl(e)==m}function qa(e){if(!Ka(e)||vl(e)!=f)return!1;var t=Ve(e);if(null===t)return!0;var n=be.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&ye.call(n)==De}var $a=Je?Nt(Je):function(e){return Ka(e)&&vl(e)==E},Xa=Qe?Nt(Qe):function(e){return Ka(e)&&to(e)==_};function Za(e){return"string"==typeof e||!La(e)&&Ka(e)&&vl(e)==h}function Ja(e){return"symbol"==typeof e||Ka(e)&&vl(e)==g}var Qa=et?Nt(et):function(e){return Ka(e)&&za(e.length)&&!!ke[vl(e)]},er=wi(Cl),tr=wi(function(e,t){return e<=t});function nr(e){if(!e)return[];if(ka(e))return Za(e)?zt(e):Ei(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=to(e);return(t==v?Ft:t==_?Ht:Ir)(e)}function lr(e){return e?(e=ar(e))===1/0||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function ir(e){var t=lr(e),n=t%1;return t==t?n?t-n:t:0}function or(e){return e?$n(ir(e),0,4294967295):0}function ar(e){if("number"==typeof e)return e;if(Ja(e))return NaN;if(Va(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=Va(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Dt(e);var n=le.test(e);return n||oe.test(e)?He(e.slice(2),n?2:8):ne.test(e)?NaN:+e}function rr(e){return _i(e,br(e))}function ur(e){return null==e?"":Xl(e)}var cr=gi(function(e,t){if(so(t)||ka(t))_i(t,yr(t),e);else for(var n in t)be.call(t,n)&&zn(e,n,t[n])}),sr=gi(function(e,t){_i(t,br(t),e)}),dr=gi(function(e,t,n,l){_i(t,br(t),e,l)}),pr=gi(function(e,t,n,l){_i(t,yr(t),e,l)}),vr=zi(qn),mr=Fl(function(e,t){e=me(e);var n=-1,l=t.length,i=l>2?t[2]:void 0;for(i&&ao(t[0],t[1],i)&&(l=1);++n<l;)for(var o=t[n],a=br(o),r=-1,u=a.length;++r<u;){var c=a[r],s=e[c];(void 0===s||Ia(s,ge[c])&&!be.call(e,c))&&(e[c]=o[c])}return e}),fr=Fl(function(e){return e.push(void 0,Hi),tt(Ar,void 0,e)});function Er(e,t,n){var l=null==e?void 0:dl(e,t);return void 0===l?n:l}function _r(e,t){return null!=e&&no(e,t,El)}var hr=Pi(function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=Ce.call(t)),e[t]=n},Vr(Gr)),gr=Pi(function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=Ce.call(t)),be.call(e,t)?e[t].push(n):e[t]=[n]},$i),Sr=Fl(hl);function yr(e){return ka(e)?Bn(e):Al(e)}function br(e){return ka(e)?Bn(e,!0):function(e){if(!Va(e))return function(e){var t=[];if(null!=e)for(var n in me(e))t.push(n);return t}(e);var t=so(e),n=[];for(var l in e)("constructor"!=l||!t&&be.call(e,l))&&n.push(l);return n}(e)}var Tr=gi(function(e,t,n){Rl(e,t,n)}),Ar=gi(function(e,t,n,l){Rl(e,t,n,l)}),Cr=zi(function(e,t){var n={};if(null==e)return n;var l=!1;t=ct(t,function(t){return t=ai(t,e),l||(l=t.length>1),t}),_i(e,Ki(e),n),l&&(n=Xn(n,7,ji));for(var i=t.length;i--;)Jl(n,t[i]);return n}),Dr=zi(function(e,t){return null==e?{}:function(e,t){return xl(e,t,function(t,n){return _r(e,n)})}(e,t)});function Nr(e,t){if(null==e)return{};var n=ct(Ki(e),function(e){return[e]});return t=$i(t),xl(e,n,function(e,n){return t(e,n[0])})}var Pr=Fi(yr),Rr=Fi(br);function Ir(e){return null==e?[]:Pt(e,yr(e))}var Or=Ti(function(e,t,n){return t=t.toLowerCase(),e+(n?xr(t):t)});function xr(e){return Hr(ur(e).toLowerCase())}function wr(e){return(e=ur(e))&&e.replace(re,wt).replace(Re,"")}var Lr=Ti(function(e,t,n){return e+(n?"-":"")+t.toLowerCase()}),Mr=Ti(function(e,t,n){return e+(n?" ":"")+t.toLowerCase()}),kr=bi("toLowerCase"),Fr=Ti(function(e,t,n){return e+(n?"_":"")+t.toLowerCase()}),Br=Ti(function(e,t,n){return e+(n?" ":"")+Hr(t)}),Ur=Ti(function(e,t,n){return e+(n?" ":"")+t.toUpperCase()}),Hr=bi("toUpperCase");function jr(e,t,n){return e=ur(e),void 0===(t=n?void 0:t)?function(e){return we.test(e)}(e)?function(e){return e.match(Oe)||[]}(e):function(e){return e.match(Z)||[]}(e):e.match(t)||[]}var Wr=Fl(function(e,t){try{return tt(e,void 0,t)}catch(e){return Ha(e)?e:new de(e)}}),zr=zi(function(e,t){return lt(t,function(t){t=No(t),Gn(e,t,ga(e[t],e))}),e});function Vr(e){return function(){return e}}var Kr=Di(),Yr=Di(!0);function Gr(e){return e}function qr(e){return Tl("function"==typeof e?e:Xn(e,1))}var $r=Fl(function(e,t){return function(n){return hl(n,e,t)}}),Xr=Fl(function(e,t){return function(n){return hl(e,n,t)}});function Zr(e,t,n){var l=yr(t),i=sl(t,l);null!=n||Va(t)&&(i.length||!l.length)||(n=t,t=e,e=this,i=sl(t,yr(t)));var o=!(Va(n)&&"chain"in n&&!n.chain),a=ja(e);return lt(i,function(n){var l=t[n];e[n]=l,a&&(e.prototype[n]=function(){var t=this.__chain__;if(o||t){var n=e(this.__wrapped__),i=n.__actions__=Ei(this.__actions__);return i.push({func:l,args:arguments,thisArg:e}),n.__chain__=t,n}return l.apply(e,st([this.value()],arguments))})}),e}function Jr(){}var Qr=Ii(ct),eu=Ii(ot),tu=Ii(vt);function nu(e){return ro(e)?yt(No(e)):function(e){return function(t){return dl(t,e)}}(e)}var lu=xi(),iu=xi(!0);function ou(){return[]}function au(){return!1}var ru,uu=Ri(function(e,t){return e+t},0),cu=Mi("ceil"),su=Ri(function(e,t){return e/t},1),du=Mi("floor"),pu=Ri(function(e,t){return e*t},1),vu=Mi("round"),mu=Ri(function(e,t){return e-t},0);return Pn.after=function(e,t){if("function"!=typeof t)throw new _e(n);return e=ir(e),function(){if(--e<1)return t.apply(this,arguments)}},Pn.ary=_a,Pn.assign=cr,Pn.assignIn=sr,Pn.assignInWith=dr,Pn.assignWith=pr,Pn.at=vr,Pn.before=ha,Pn.bind=ga,Pn.bindAll=zr,Pn.bindKey=Sa,Pn.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return La(e)?e:[e]},Pn.chain=na,Pn.chunk=function(e,t,n){t=(n?ao(e,t,n):void 0===t)?1:an(ir(t),0);var l=null==e?0:e.length;if(!l||t<1)return[];for(var i=0,o=0,a=G(Jt(l/t));i<l;)a[o++]=Vl(e,i,i+=t);return a},Pn.compact=function(e){for(var t=-1,n=null==e?0:e.length,l=0,i=[];++t<n;){var o=e[t];o&&(i[l++]=o)}return i},Pn.concat=function(){var e=arguments.length;if(!e)return[];for(var t=G(e-1),n=arguments[0],l=e;l--;)t[l-1]=arguments[l];return st(La(n)?Ei(n):[n],ol(t,1))},Pn.cond=function(e){var t=null==e?0:e.length,l=$i();return e=t?ct(e,function(e){if("function"!=typeof e[1])throw new _e(n);return[l(e[0]),e[1]]}):[],Fl(function(n){for(var l=-1;++l<t;){var i=e[l];if(tt(i[0],this,n))return tt(i[1],this,n)}})},Pn.conforms=function(e){return function(e){var t=yr(e);return function(n){return Zn(n,e,t)}}(Xn(e,1))},Pn.constant=Vr,Pn.countBy=oa,Pn.create=function(e,t){var n=Rn(e);return null==t?n:Yn(n,t)},Pn.curry=function e(t,n,l){var i=Bi(t,8,void 0,void 0,void 0,void 0,void 0,n=l?void 0:n);return i.placeholder=e.placeholder,i},Pn.curryRight=function e(t,n,l){var i=Bi(t,16,void 0,void 0,void 0,void 0,void 0,n=l?void 0:n);return i.placeholder=e.placeholder,i},Pn.debounce=ya,Pn.defaults=mr,Pn.defaultsDeep=fr,Pn.defer=ba,Pn.delay=Ta,Pn.difference=Io,Pn.differenceBy=Oo,Pn.differenceWith=xo,Pn.drop=function(e,t,n){var l=null==e?0:e.length;return l?Vl(e,(t=n||void 0===t?1:ir(t))<0?0:t,l):[]},Pn.dropRight=function(e,t,n){var l=null==e?0:e.length;return l?Vl(e,0,(t=l-(t=n||void 0===t?1:ir(t)))<0?0:t):[]},Pn.dropRightWhile=function(e,t){return e&&e.length?ei(e,$i(t,3),!0,!0):[]},Pn.dropWhile=function(e,t){return e&&e.length?ei(e,$i(t,3),!0):[]},Pn.fill=function(e,t,n,l){var i=null==e?0:e.length;return i?(n&&"number"!=typeof n&&ao(e,t,n)&&(n=0,l=i),function(e,t,n,l){var i=e.length;for((n=ir(n))<0&&(n=-n>i?0:i+n),(l=void 0===l||l>i?i:ir(l))<0&&(l+=i),l=n>l?0:or(l);n<l;)e[n++]=t;return e}(e,t,n,l)):[]},Pn.filter=function(e,t){return(La(e)?at:il)(e,$i(t,3))},Pn.flatMap=function(e,t){return ol(va(e,t),1)},Pn.flatMapDeep=function(e,t){return ol(va(e,t),1/0)},Pn.flatMapDepth=function(e,t,n){return n=void 0===n?1:ir(n),ol(va(e,t),n)},Pn.flatten=Mo,Pn.flattenDeep=function(e){return null!=e&&e.length?ol(e,1/0):[]},Pn.flattenDepth=function(e,t){return null!=e&&e.length?ol(e,t=void 0===t?1:ir(t)):[]},Pn.flip=function(e){return Bi(e,512)},Pn.flow=Kr,Pn.flowRight=Yr,Pn.fromPairs=function(e){for(var t=-1,n=null==e?0:e.length,l={};++t<n;){var i=e[t];l[i[0]]=i[1]}return l},Pn.functions=function(e){return null==e?[]:sl(e,yr(e))},Pn.functionsIn=function(e){return null==e?[]:sl(e,br(e))},Pn.groupBy=sa,Pn.initial=function(e){return null!=e&&e.length?Vl(e,0,-1):[]},Pn.intersection=Fo,Pn.intersectionBy=Bo,Pn.intersectionWith=Uo,Pn.invert=hr,Pn.invertBy=gr,Pn.invokeMap=da,Pn.iteratee=qr,Pn.keyBy=pa,Pn.keys=yr,Pn.keysIn=br,Pn.map=va,Pn.mapKeys=function(e,t){var n={};return t=$i(t,3),ul(e,function(e,l,i){Gn(n,t(e,l,i),e)}),n},Pn.mapValues=function(e,t){var n={};return t=$i(t,3),ul(e,function(e,l,i){Gn(n,l,t(e,l,i))}),n},Pn.matches=function(e){return Nl(Xn(e,1))},Pn.matchesProperty=function(e,t){return Pl(e,Xn(t,1))},Pn.memoize=Aa,Pn.merge=Tr,Pn.mergeWith=Ar,Pn.method=$r,Pn.methodOf=Xr,Pn.mixin=Zr,Pn.negate=Ca,Pn.nthArg=function(e){return e=ir(e),Fl(function(t){return Il(t,e)})},Pn.omit=Cr,Pn.omitBy=function(e,t){return Nr(e,Ca($i(t)))},Pn.once=function(e){return ha(2,e)},Pn.orderBy=function(e,t,n,l){return null==e?[]:(La(t)||(t=null==t?[]:[t]),La(n=l?void 0:n)||(n=null==n?[]:[n]),Ol(e,t,n))},Pn.over=Qr,Pn.overArgs=Da,Pn.overEvery=eu,Pn.overSome=tu,Pn.partial=Na,Pn.partialRight=Pa,Pn.partition=ma,Pn.pick=Dr,Pn.pickBy=Nr,Pn.property=nu,Pn.propertyOf=function(e){return function(t){return null==e?void 0:dl(e,t)}},Pn.pull=jo,Pn.pullAll=Wo,Pn.pullAllBy=function(e,t,n){return e&&e.length&&t&&t.length?wl(e,t,$i(n,2)):e},Pn.pullAllWith=function(e,t,n){return e&&e.length&&t&&t.length?wl(e,t,void 0,n):e},Pn.pullAt=zo,Pn.range=lu,Pn.rangeRight=iu,Pn.rearg=Ra,Pn.reject=function(e,t){return(La(e)?at:il)(e,Ca($i(t,3)))},Pn.remove=function(e,t){var n=[];if(!e||!e.length)return n;var l=-1,i=[],o=e.length;for(t=$i(t,3);++l<o;){var a=e[l];t(a,l,e)&&(n.push(a),i.push(l))}return Ll(e,i),n},Pn.rest=function(e,t){if("function"!=typeof e)throw new _e(n);return Fl(e,t=void 0===t?t:ir(t))},Pn.reverse=Vo,Pn.sampleSize=function(e,t,n){return t=(n?ao(e,t,n):void 0===t)?1:ir(t),(La(e)?Hn:Ul)(e,t)},Pn.set=function(e,t,n){return null==e?e:Hl(e,t,n)},Pn.setWith=function(e,t,n,l){return l="function"==typeof l?l:void 0,null==e?e:Hl(e,t,n,l)},Pn.shuffle=function(e){return(La(e)?jn:zl)(e)},Pn.slice=function(e,t,n){var l=null==e?0:e.length;return l?(n&&"number"!=typeof n&&ao(e,t,n)?(t=0,n=l):(t=null==t?0:ir(t),n=void 0===n?l:ir(n)),Vl(e,t,n)):[]},Pn.sortBy=fa,Pn.sortedUniq=function(e){return e&&e.length?ql(e):[]},Pn.sortedUniqBy=function(e,t){return e&&e.length?ql(e,$i(t,2)):[]},Pn.split=function(e,t,n){return n&&"number"!=typeof n&&ao(e,t,n)&&(t=n=void 0),(n=void 0===n?4294967295:n>>>0)?(e=ur(e))&&("string"==typeof t||null!=t&&!$a(t))&&!(t=Xl(t))&&kt(e)?ui(zt(e),0,n):e.split(t,n):[]},Pn.spread=function(e,t){if("function"!=typeof e)throw new _e(n);return t=null==t?0:an(ir(t),0),Fl(function(n){var l=n[t],i=ui(n,0,t);return l&&st(i,l),tt(e,this,i)})},Pn.tail=function(e){var t=null==e?0:e.length;return t?Vl(e,1,t):[]},Pn.take=function(e,t,n){return e&&e.length?Vl(e,0,(t=n||void 0===t?1:ir(t))<0?0:t):[]},Pn.takeRight=function(e,t,n){var l=null==e?0:e.length;return l?Vl(e,(t=l-(t=n||void 0===t?1:ir(t)))<0?0:t,l):[]},Pn.takeRightWhile=function(e,t){return e&&e.length?ei(e,$i(t,3),!1,!0):[]},Pn.takeWhile=function(e,t){return e&&e.length?ei(e,$i(t,3)):[]},Pn.tap=function(e,t){return t(e),e},Pn.throttle=function(e,t,l){var i=!0,o=!0;if("function"!=typeof e)throw new _e(n);return Va(l)&&(i="leading"in l?!!l.leading:i,o="trailing"in l?!!l.trailing:o),ya(e,t,{leading:i,maxWait:t,trailing:o})},Pn.thru=la,Pn.toArray=nr,Pn.toPairs=Pr,Pn.toPairsIn=Rr,Pn.toPath=function(e){return La(e)?ct(e,No):Ja(e)?[e]:Ei(Do(ur(e)))},Pn.toPlainObject=rr,Pn.transform=function(e,t,n){var l=La(e),i=l||Ba(e)||Qa(e);if(t=$i(t,4),null==n){var o=e&&e.constructor;n=i?l?new o:[]:Va(e)&&ja(o)?Rn(Ve(e)):{}}return(i?lt:ul)(e,function(e,l,i){return t(n,e,l,i)}),n},Pn.unary=function(e){return _a(e,1)},Pn.union=Ko,Pn.unionBy=Yo,Pn.unionWith=Go,Pn.uniq=function(e){return e&&e.length?Zl(e):[]},Pn.uniqBy=function(e,t){return e&&e.length?Zl(e,$i(t,2)):[]},Pn.uniqWith=function(e,t){return t="function"==typeof t?t:void 0,e&&e.length?Zl(e,void 0,t):[]},Pn.unset=function(e,t){return null==e||Jl(e,t)},Pn.unzip=qo,Pn.unzipWith=$o,Pn.update=function(e,t,n){return null==e?e:Ql(e,t,oi(n))},Pn.updateWith=function(e,t,n,l){return l="function"==typeof l?l:void 0,null==e?e:Ql(e,t,oi(n),l)},Pn.values=Ir,Pn.valuesIn=function(e){return null==e?[]:Pt(e,br(e))},Pn.without=Xo,Pn.words=jr,Pn.wrap=function(e,t){return Na(oi(t),e)},Pn.xor=Zo,Pn.xorBy=Jo,Pn.xorWith=Qo,Pn.zip=ea,Pn.zipObject=function(e,t){return li(e||[],t||[],zn)},Pn.zipObjectDeep=function(e,t){return li(e||[],t||[],Hl)},Pn.zipWith=ta,Pn.entries=Pr,Pn.entriesIn=Rr,Pn.extend=sr,Pn.extendWith=dr,Zr(Pn,Pn),Pn.add=uu,Pn.attempt=Wr,Pn.camelCase=Or,Pn.capitalize=xr,Pn.ceil=cu,Pn.clamp=function(e,t,n){return void 0===n&&(n=t,t=void 0),void 0!==n&&(n=(n=ar(n))==n?n:0),void 0!==t&&(t=(t=ar(t))==t?t:0),$n(ar(e),t,n)},Pn.clone=function(e){return Xn(e,4)},Pn.cloneDeep=function(e){return Xn(e,5)},Pn.cloneDeepWith=function(e,t){return Xn(e,5,t="function"==typeof t?t:void 0)},Pn.cloneWith=function(e,t){return Xn(e,4,t="function"==typeof t?t:void 0)},Pn.conformsTo=function(e,t){return null==t||Zn(e,t,yr(t))},Pn.deburr=wr,Pn.defaultTo=function(e,t){return null==e||e!=e?t:e},Pn.divide=su,Pn.endsWith=function(e,t,n){e=ur(e),t=Xl(t);var l=e.length,i=n=void 0===n?l:$n(ir(n),0,l);return(n-=t.length)>=0&&e.slice(n,i)==t},Pn.eq=Ia,Pn.escape=function(e){return(e=ur(e))&&F.test(e)?e.replace(M,Lt):e},Pn.escapeRegExp=function(e){return(e=ur(e))&&K.test(e)?e.replace(V,"\\$&"):e},Pn.every=function(e,t,n){var l=La(e)?ot:nl;return n&&ao(e,t,n)&&(t=void 0),l(e,$i(t,3))},Pn.find=aa,Pn.findIndex=wo,Pn.findKey=function(e,t){return ft(e,$i(t,3),ul)},Pn.findLast=ra,Pn.findLastIndex=Lo,Pn.findLastKey=function(e,t){return ft(e,$i(t,3),cl)},Pn.floor=du,Pn.forEach=ua,Pn.forEachRight=ca,Pn.forIn=function(e,t){return null==e?e:al(e,$i(t,3),br)},Pn.forInRight=function(e,t){return null==e?e:rl(e,$i(t,3),br)},Pn.forOwn=function(e,t){return e&&ul(e,$i(t,3))},Pn.forOwnRight=function(e,t){return e&&cl(e,$i(t,3))},Pn.get=Er,Pn.gt=Oa,Pn.gte=xa,Pn.has=function(e,t){return null!=e&&no(e,t,fl)},Pn.hasIn=_r,Pn.head=ko,Pn.identity=Gr,Pn.includes=function(e,t,n,l){e=ka(e)?e:Ir(e),n=n&&!l?ir(n):0;var i=e.length;return n<0&&(n=an(i+n,0)),Za(e)?n<=i&&e.indexOf(t,n)>-1:!!i&&_t(e,t,n)>-1},Pn.indexOf=function(e,t,n){var l=null==e?0:e.length;if(!l)return-1;var i=null==n?0:ir(n);return i<0&&(i=an(l+i,0)),_t(e,t,i)},Pn.inRange=function(e,t,n){return t=lr(t),void 0===n?(n=t,t=0):n=lr(n),function(e,t,n){return e>=rn(t,n)&&e<an(t,n)}(e=ar(e),t,n)},Pn.invoke=Sr,Pn.isArguments=wa,Pn.isArray=La,Pn.isArrayBuffer=Ma,Pn.isArrayLike=ka,Pn.isArrayLikeObject=Fa,Pn.isBoolean=function(e){return!0===e||!1===e||Ka(e)&&vl(e)==r},Pn.isBuffer=Ba,Pn.isDate=Ua,Pn.isElement=function(e){return Ka(e)&&1===e.nodeType&&!qa(e)},Pn.isEmpty=function(e){if(null==e)return!0;if(ka(e)&&(La(e)||"string"==typeof e||"function"==typeof e.splice||Ba(e)||Qa(e)||wa(e)))return!e.length;var t=to(e);if(t==v||t==_)return!e.size;if(so(e))return!Al(e).length;for(var n in e)if(be.call(e,n))return!1;return!0},Pn.isEqual=function(e,t){return Sl(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?Sl(e,t,void 0,n):!!l},Pn.isError=Ha,Pn.isFinite=function(e){return"number"==typeof e&&nn(e)},Pn.isFunction=ja,Pn.isInteger=Wa,Pn.isLength=za,Pn.isMap=Ya,Pn.isMatch=function(e,t){return e===t||yl(e,t,Zi(t))},Pn.isMatchWith=function(e,t,n){return n="function"==typeof n?n:void 0,yl(e,t,Zi(t),n)},Pn.isNaN=function(e){return Ga(e)&&e!=+e},Pn.isNative=function(e){if(co(e))throw new de("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=Ga,Pn.isObject=Va,Pn.isObjectLike=Ka,Pn.isPlainObject=qa,Pn.isRegExp=$a,Pn.isSafeInteger=function(e){return Wa(e)&&e>=-9007199254740991&&e<=9007199254740991},Pn.isSet=Xa,Pn.isString=Za,Pn.isSymbol=Ja,Pn.isTypedArray=Qa,Pn.isUndefined=function(e){return void 0===e},Pn.isWeakMap=function(e){return Ka(e)&&to(e)==S},Pn.isWeakSet=function(e){return Ka(e)&&"[object WeakSet]"==vl(e)},Pn.join=function(e,t){return null==e?"":ln.call(e,t)},Pn.kebabCase=Lr,Pn.last=Ho,Pn.lastIndexOf=function(e,t,n){var l=null==e?0:e.length;if(!l)return-1;var i=l;return void 0!==n&&(i=(i=ir(n))<0?an(l+i,0):rn(i,l-1)),t==t?function(e,t,n){for(var l=n+1;l--;)if(e[l]===t)return l;return l}(e,t,i):Et(e,gt,i,!0)},Pn.lowerCase=Mr,Pn.lowerFirst=kr,Pn.lt=er,Pn.lte=tr,Pn.max=function(e){return e&&e.length?ll(e,Gr,ml):void 0},Pn.maxBy=function(e,t){return e&&e.length?ll(e,$i(t,2),ml):void 0},Pn.mean=function(e){return St(e,Gr)},Pn.meanBy=function(e,t){return St(e,$i(t,2))},Pn.min=function(e){return e&&e.length?ll(e,Gr,Cl):void 0},Pn.minBy=function(e,t){return e&&e.length?ll(e,$i(t,2),Cl):void 0},Pn.stubArray=ou,Pn.stubFalse=au,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?Il(e,ir(t)):void 0},Pn.noConflict=function(){return ze._===this&&(ze._=Ne),this},Pn.noop=Jr,Pn.now=Ea,Pn.pad=function(e,t,n){e=ur(e);var l=(t=ir(t))?Wt(e):0;if(!t||l>=t)return e;var i=(t-l)/2;return Oi(Qt(i),n)+e+Oi(Jt(i),n)},Pn.padEnd=function(e,t,n){e=ur(e);var l=(t=ir(t))?Wt(e):0;return t&&l<t?e+Oi(t-l,n):e},Pn.padStart=function(e,t,n){e=ur(e);var l=(t=ir(t))?Wt(e):0;return t&&l<t?Oi(t-l,n)+e:e},Pn.parseInt=function(e,t,n){return n||null==t?t=0:t&&(t=+t),cn(ur(e).replace(Y,""),t||0)},Pn.random=function(e,t,n){if(n&&"boolean"!=typeof n&&ao(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=lr(e),void 0===t?(t=e,e=0):t=lr(t)),e>t){var l=e;e=t,t=l}if(n||e%1||t%1){var i=sn();return rn(e+i*(t-e+Ue("1e-"+((i+"").length-1))),t)}return Ml(e,t)},Pn.reduce=function(e,t,n){var l=La(e)?dt:Tt,i=arguments.length<3;return l(e,$i(t,4),n,i,el)},Pn.reduceRight=function(e,t,n){var l=La(e)?pt:Tt,i=arguments.length<3;return l(e,$i(t,4),n,i,tl)},Pn.repeat=function(e,t,n){return t=(n?ao(e,t,n):void 0===t)?1:ir(t),kl(ur(e),t)},Pn.replace=function(){var e=arguments,t=ur(e[0]);return e.length<3?t:t.replace(e[1],e[2])},Pn.result=function(e,t,n){var l=-1,i=(t=ai(t,e)).length;for(i||(i=1,e=void 0);++l<i;){var o=null==e?void 0:e[No(t[l])];void 0===o&&(l=i,o=n),e=ja(o)?o.call(e):o}return e},Pn.round=vu,Pn.runInContext=e,Pn.sample=function(e){return(La(e)?Un:Bl)(e)},Pn.size=function(e){if(null==e)return 0;if(ka(e))return Za(e)?Wt(e):e.length;var t=to(e);return t==v||t==_?e.size:Al(e).length},Pn.snakeCase=Fr,Pn.some=function(e,t,n){var l=La(e)?vt:Kl;return n&&ao(e,t,n)&&(t=void 0),l(e,$i(t,3))},Pn.sortedIndex=function(e,t){return Yl(e,t)},Pn.sortedIndexBy=function(e,t,n){return Gl(e,t,$i(n,2))},Pn.sortedIndexOf=function(e,t){var n=null==e?0:e.length;if(n){var l=Yl(e,t);if(l<n&&Ia(e[l],t))return l}return-1},Pn.sortedLastIndex=function(e,t){return Yl(e,t,!0)},Pn.sortedLastIndexBy=function(e,t,n){return Gl(e,t,$i(n,2),!0)},Pn.sortedLastIndexOf=function(e,t){if(null!=e&&e.length){var n=Yl(e,t,!0)-1;if(Ia(e[n],t))return n}return-1},Pn.startCase=Br,Pn.startsWith=function(e,t,n){return e=ur(e),n=null==n?0:$n(ir(n),0,e.length),t=Xl(t),e.slice(n,n+t.length)==t},Pn.subtract=mu,Pn.sum=function(e){return e&&e.length?At(e,Gr):0},Pn.sumBy=function(e,t){return e&&e.length?At(e,$i(t,2)):0},Pn.template=function(e,t,n){var l=Pn.templateSettings;n&&ao(e,t,n)&&(t=void 0),e=ur(e),t=dr({},t,l,Ui);var i,o,a=dr({},t.imports,l.imports,Ui),r=yr(a),u=Pt(a,r),c=0,s=t.interpolate||ue,d="__p += '",p=fe((t.escape||ue).source+"|"+s.source+"|"+(s===H?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,a,r,u){return l||(l=a),d+=e.slice(c,u).replace(ce,Mt),n&&(i=!0,d+="' +\n__e("+n+") +\n'"),r&&(o=!0,d+="';\n"+r+";\n__p += '"),l&&(d+="' +\n((__t = ("+l+")) == null ? '' : __t) +\n'"),c=u+t.length,t}),d+="';\n";var m=be.call(t,"variable")&&t.variable;if(m){if(J.test(m))throw new de("Invalid `variable` option passed into `_.template`")}else d="with (obj) {\n"+d+"\n}\n";d=(o?d.replace(O,""):d).replace(x,"$1").replace(w,"$1;"),d="function("+(m||"obj")+") {\n"+(m?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(i?", __e = _.escape":"")+(o?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+d+"return __p\n}";var f=Wr(function(){return pe(r,v+"return "+d).apply(void 0,u)});if(f.source=d,Ha(f))throw f;return f},Pn.times=function(e,t){if((e=ir(e))<1||e>9007199254740991)return[];var n=4294967295,l=rn(e,4294967295);e-=4294967295;for(var i=Ct(l,t=$i(t));++n<e;)t(n);return i},Pn.toFinite=lr,Pn.toInteger=ir,Pn.toLength=or,Pn.toLower=function(e){return ur(e).toLowerCase()},Pn.toNumber=ar,Pn.toSafeInteger=function(e){return e?$n(ir(e),-9007199254740991,9007199254740991):0===e?e:0},Pn.toString=ur,Pn.toUpper=function(e){return ur(e).toUpperCase()},Pn.trim=function(e,t,n){if((e=ur(e))&&(n||void 0===t))return Dt(e);if(!e||!(t=Xl(t)))return e;var l=zt(e),i=zt(t);return ui(l,It(l,i),Ot(l,i)+1).join("")},Pn.trimEnd=function(e,t,n){if((e=ur(e))&&(n||void 0===t))return e.slice(0,Vt(e)+1);if(!e||!(t=Xl(t)))return e;var l=zt(e);return ui(l,0,Ot(l,zt(t))+1).join("")},Pn.trimStart=function(e,t,n){if((e=ur(e))&&(n||void 0===t))return e.replace(Y,"");if(!e||!(t=Xl(t)))return e;var l=zt(e);return ui(l,It(l,zt(t))).join("")},Pn.truncate=function(e,t){var n=30,l="...";if(Va(t)){var i="separator"in t?t.separator:i;n="length"in t?ir(t.length):n,l="omission"in t?Xl(t.omission):l}var o=(e=ur(e)).length;if(kt(e)){var a=zt(e);o=a.length}if(n>=o)return e;var r=n-Wt(l);if(r<1)return l;var u=a?ui(a,0,r).join(""):e.slice(0,r);if(void 0===i)return u+l;if(a&&(r+=u.length-r),$a(i)){if(e.slice(r).search(i)){var c,s=u;for(i.global||(i=fe(i.source,ur(te.exec(i))+"g")),i.lastIndex=0;c=i.exec(s);)var d=c.index;u=u.slice(0,void 0===d?r:d)}}else if(e.indexOf(Xl(i),r)!=r){var p=u.lastIndexOf(i);p>-1&&(u=u.slice(0,p))}return u+l},Pn.unescape=function(e){return(e=ur(e))&&k.test(e)?e.replace(L,Kt):e},Pn.uniqueId=function(e){var t=++Te;return ur(e)+t},Pn.upperCase=Ur,Pn.upperFirst=Hr,Pn.each=ua,Pn.eachRight=ca,Pn.first=ko,Zr(Pn,(ru={},ul(Pn,function(e,t){be.call(Pn.prototype,t)||(ru[t]=e)}),ru),{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){xn.prototype[e]=function(n){n=void 0===n?1:an(ir(n),0);var l=this.__filtered__&&!t?new xn(this):this.clone();return l.__filtered__?l.__takeCount__=rn(n,l.__takeCount__):l.__views__.push({size:rn(n,4294967295),type:e+(l.__dir__<0?"Right":"")}),l},xn.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;xn.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:$i(e,3),type:n}),t.__filtered__=t.__filtered__||l,t}}),lt(["head","last"],function(e,t){var n="take"+(t?"Right":"");xn.prototype[e]=function(){return this[n](1).value()[0]}}),lt(["initial","tail"],function(e,t){var n="drop"+(t?"":"Right");xn.prototype[e]=function(){return this.__filtered__?new xn(this):this[n](1)}}),xn.prototype.compact=function(){return this.filter(Gr)},xn.prototype.find=function(e){return this.filter(e).head()},xn.prototype.findLast=function(e){return this.reverse().find(e)},xn.prototype.invokeMap=Fl(function(e,t){return"function"==typeof e?new xn(this):this.map(function(n){return hl(n,e,t)})}),xn.prototype.reject=function(e){return this.filter(Ca($i(e)))},xn.prototype.slice=function(e,t){e=ir(e);var n=this;return n.__filtered__&&(e>0||t<0)?new xn(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),void 0!==t&&(n=(t=ir(t))<0?n.dropRight(-t):n.take(t-e)),n)},xn.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},xn.prototype.toArray=function(){return this.take(4294967295)},ul(xn.prototype,function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),l=/^(?:head|last)$/.test(t),i=Pn[l?"take"+("last"==t?"Right":""):t],o=l||/^find/.test(t);i&&(Pn.prototype[t]=function(){var t=this.__wrapped__,a=l?[1]:arguments,r=t instanceof xn,u=a[0],c=r||La(t),s=function(e){var t=i.apply(Pn,st([e],a));return l&&d?t[0]:t};c&&n&&"function"==typeof u&&1!=u.length&&(r=c=!1);var d=this.__chain__,p=!!this.__actions__.length,v=o&&!d,m=r&&!p;if(!o&&c){t=m?t:new xn(this);var f=e.apply(t,a);return f.__actions__.push({func:la,args:[s],thisArg:void 0}),new On(f,d)}return v&&m?e.apply(this,a):(f=this.thru(s),v?l?f.value()[0]:f.value():f)})}),lt(["pop","push","shift","sort","splice","unshift"],function(e){var t=he[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 i=this.value();return t.apply(La(i)?i:[],e)}return this[n](function(n){return t.apply(La(n)?n:[],e)})}}),ul(xn.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[Ni(void 0,2).name]=[{name:"wrapper",func:void 0}],xn.prototype.clone=function(){var e=new xn(this.__wrapped__);return e.__actions__=Ei(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=Ei(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=Ei(this.__views__),e},xn.prototype.reverse=function(){if(this.__filtered__){var e=new xn(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},xn.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,n=La(e),l=t<0,i=n?e.length:0,o=function(e,t,n){for(var l=-1,i=n.length;++l<i;){var o=n[l],a=o.size;switch(o.type){case"drop":e+=a;break;case"dropRight":t-=a;break;case"take":t=rn(t,e+a);break;case"takeRight":e=an(e,t-a)}}return{start:e,end:t}}(0,i,this.__views__),a=o.start,r=o.end,u=r-a,c=l?r:a-1,s=this.__iteratees__,d=s.length,p=0,v=rn(u,this.__takeCount__);if(!n||!l&&i==u&&v==u)return ti(e,this.__actions__);var m=[];e:for(;u--&&p<v;){for(var f=-1,E=e[c+=t];++f<d;){var _=s[f],h=_.type,g=(0,_.iteratee)(E);if(2==h)E=g;else if(!g){if(1==h)continue e;break e}}m[p++]=E}return m},Pn.prototype.at=ia,Pn.prototype.chain=function(){return na(this)},Pn.prototype.commit=function(){return new On(this.value(),this.__chain__)},Pn.prototype.next=function(){void 0===this.__values__&&(this.__values__=nr(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 In;){var l=Ro(n);l.__index__=0,l.__values__=void 0,t?i.__wrapped__=l:t=l;var i=l;n=n.__wrapped__}return i.__wrapped__=e,t},Pn.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof xn){var t=e;return this.__actions__.length&&(t=new xn(this)),(t=t.reverse()).__actions__.push({func:la,args:[Vo],thisArg:void 0}),new On(t,this.__chain__)}return this.thru(Vo)},Pn.prototype.toJSON=Pn.prototype.valueOf=Pn.prototype.value=function(){return ti(this.__wrapped__,this.__actions__)},Pn.prototype.first=Pn.prototype.head,bt&&(Pn.prototype[bt]=function(){return this}),Pn}();Ke?((Ke.exports=Yt)._=Yt,Ve._=Yt):ze._=Yt}).call(p)});const f=function(e){return void 0===e&&(e=""),function(e){return void 0===e&&(e=""),!(!e||null==e||null==e||""==e)}(e)?e:"PTR_NA"},E=e=>{if(e){const t=new Date(e);let n=t.getMonth()+1,l=t.getDate(),i=t.getFullYear();return n=(n>9?"":"0")+n,l=(l>9?"":"0")+l,i+"-"+n+"-"+l}return null},h=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}},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},S=[{head:"ES_TITILE_OWNER_DETAILS",body:[{route:"info",component:"PTRServiceDoc",nextStep:"owners",key:"Documents"},{route:"owners",component:"PTRCitizenDetails",withoutLabel:!0,key:"ownerss",type:"component",nextStep:"pet-details",hideInEmployee:!0,isMandatory:!0,texts:{submitBarLabel:"PTR_COMMON_NEXT"}}]},{head:"ES_TITILE_PET_DETAILS",body:[{route:"pet-details",component:"PTRCitizenPet",withoutLabel:!0,key:"pets",type:"component",isMandatory:!0,hideInEmployee:!0,nextStep:"address",texts:{submitBarLabel:"PTR_COMMON_NEXT"}}]},{head:"PTR_LOCATION_DETAILS",body:[{route:"address",component:"PTRSelectAddress",withoutLabel:!0,texts:{submitBarLabel:"PTR_COMMON_NEXT"},key:"address",nextStep:"documents",isMandatory:!0,type:"component"}]},{head:"ES_TITILE_DOCUMENT_DETAILS",body:[{route:"documents",component:"PTRSelectProofIdentity",withoutLabel:!0,key:"documents",type:"component",nextStep:null,texts:{submitBarLabel:"PTR_COMMON_NEXT"}}]}];function y(e,t){try{var n=e()}catch(e){return t(e)}return n&&n.then?n.then(void 0,t):n}function b(e,t){try{var n=e()}catch(e){return t(!0,e)}return n&&n.then?n.then(t.bind(null,!1),t.bind(null,!0)):t(!1,n)}function T(e){var i,o;let{t:a,document:r,setDocuments:c,setError:s,documents:d,id:p,renewApplication:v,user:m}=e;const f=null==d?void 0:d.filter(e=>{var t;return null==e||null===(t=e.documentType)||void 0===t?void 0:t.includes(null==r?void 0:r.code)})[0],E=null==v||null===(i=v.documents)||void 0===i?void 0:i.find(e=>{var t;return null==e||null===(t=e.documentType)||void 0===t?void 0:t.includes(null==r?void 0:r.code)}),[_,h]=n.useState(!1),[g,S]=n.useState(E?u({},E,{active:!0===(null==r?void 0:r.active),code:null==E?void 0:E.documentType,i18nKey:null==E?void 0:E.documentType}):1===(null==r||null===(o=r.dropdownData)||void 0===o?void 0:o.length)?null==r?void 0:r.dropdownData[0]:u({},f,{active:!0===(null==r?void 0:r.active),code:null==f?void 0:f.documentType,i18nKey:null==f?void 0:f.documentType.replaceAll(".","_")})),T=()=>l.createElement("div",{className:"loading-spinner"}),[A,C]=n.useState(null),[D,N]=n.useState(()=>(null==f?void 0:f.filestoreId)||null),{dropdownData:P}=r;var R=P;const[I,O]=n.useState(!1);return n.useEffect(()=>{var e;null==v||null===(e=v.documents)||void 0===e||e.map((e,t)=>{null!=e&&e.documentType.includes(null==r?void 0:r.code)&&N(e)})},[null==v?void 0:v.documents]),n.useEffect(()=>{null!=g&&g.code&&null!=v&&v.applicationNumber?c(e=>{const t=null==e?void 0:e.filter(e=>(null==e?void 0:e.documentType)!==(null==g?void 0:g.code));return 0===(null==D?void 0:D.length)||null===D?t:[...null==t?void 0:t.filter(e=>(null==e?void 0:e.fileStoreId)!==D),{documentType:null==g?void 0:g.code,filestoreId:null==D?void 0:D.documentUid,documentUid:null==D?void 0:D.documentUid}]}):null!=g&&g.code&&c(e=>{const t=null==e?void 0:e.filter(e=>(null==e?void 0:e.documentType)!==(null==g?void 0:g.code));return 0===(null==D?void 0:D.length)||null===D?t:[...null==t?void 0:t.filter(e=>(null==e?void 0:e.fileStoreId)!==D),{documentType:null==g?void 0:g.code,filestoreId:D,documentUid:D}]})},[D,g]),n.useEffect(()=>{!function(){try{s(null);const e=function(){if(A){const e=function(){if(A.size>=5242880)s(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=b(function(){return y(function(){return N(null),h(!0),Promise.resolve(Digit.UploadServices.Filestorage("PTR",A,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?N(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):s(a("CS_FILE_UPLOAD_ERROR"))})},function(){s(a("CS_FILE_UPLOAD_ERROR"))})},function(e,t){if(h(!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)}}()},[A]),n.useEffect(()=>{I&&N(null)},[I]),l.createElement("div",{style:{marginBottom:"24px"}},null!=r&&r.hasDropdown?l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},a(null==r?void 0:r.code.replaceAll(".","_"))," ",l.createElement("span",{className:"astericColor"},"*")),l.createElement(t.Dropdown,{className:"form-field",selected:g,style:{width:"EMPLOYEE"===(null==m?void 0:m.type)?"50%":"100%"},option:R.map(e=>{var t;return u({},e,{i18nKey:null===(t=e.code)||void 0===t?void 0:t.replaceAll(".","_")})}),select:e=>S(e),optionKey:"i18nKey",t:a})):l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},a(null==r?void 0:r.code.replaceAll(".","_"))," ",l.createElement("span",{className:"astericColor"},"*"))),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"}),l.createElement("div",{className:"field"},l.createElement(t.UploadFile,{onUpload:function(e){C(e.target.files[0])},onDelete:()=>{N(null)},id:p,message:_?l.createElement("div",{style:{display:"flex",alignItems:"center",gap:"8px"}},l.createElement(T,null),l.createElement("span",null,"Uploading...")):D?"1 File Uploaded":"No File Uploaded",textStyles:{width:"100%"},inputStyles:{width:"280px"},accept:".pdf, .jpeg, .jpg, .png",buttonType:"button",error:!D}))))}"undefined"!=typeof Symbol&&(Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator"))),"undefined"!=typeof Symbol&&(Symbol.asyncIterator||(Symbol.asyncIterator=Symbol("Symbol.asyncIterator")));const A=e=>{var n,o,a;let{data:r,OpenImage:u}=e;const{t:c}=i.useTranslation();return l.createElement("div",null,r.date&&l.createElement("p",null,r.date),l.createElement("p",null,r.name),r.mobileNumber&&l.createElement(t.TelePhone,{mobile:r.mobileNumber}),r.source&&l.createElement("p",null,c("ES_APPLICATION_DETAILS_APPLICATION_CHANNEL_"+r.source.toUpperCase())),r.comment&&l.createElement(Reason,{otherComment:null==r?void 0:r.otherComment,headComment:null==r?void 0:r.comment}),null!=r&&r.wfComment?l.createElement("div",null,null==r||null===(n=r.wfComment)||void 0===n?void 0:n.map(e=>l.createElement("div",{className:"TLComments"},l.createElement("h3",null,c("WF_COMMON_COMMENTS")),l.createElement("p",{style:{overflowX:"scroll"}},e)))):null,(null==r||null===(o=r.thumbnailsToShow)||void 0===o||null===(a=o.thumbs)||void 0===a?void 0:a.length)>0?l.createElement("div",{className:"TLComments"},l.createElement("h3",null,c("CS_COMMON_ATTACHMENTS")),l.createElement(t.DisplayPhotos,{srcs:null==r?void 0:r.thumbnailsToShow.thumbs,onClick:(e,t)=>{u(e,t,null==r?void 0:r.thumbnailsToShow)}})):null)},C=e=>{var a,r,u,c,s,d,p;const{t:v}=i.useTranslation(),m=null==e||null===(a=e.application)||void 0===a||null===(r=a.workflow)||void 0===r?void 0:r.businessService,{isLoading:f,data:E}=Digit.Hooks.useWorkflowDetails({tenantId:null===(u=e.application)||void 0===u?void 0:u.tenantId,id:null===(c=e.application)||void 0===c?void 0:c.applicationNumber,moduleCode:m});function _(e){var t;window.open(null==e||null===(t=e.fullImage)||void 0===t?void 0:t[0],"_blank")}const h=t=>{if("OPEN"===t.state){var n,i;const o={date:null==t||null===(n=t.auditDetails)||void 0===n?void 0:n.lastModified,source:(null===(i=e.application)||void 0===i?void 0:i.channel)||""};return l.createElement(A,{data:o})}if(t.state){var o,a,r,u,c;const e={date:null==t||null===(o=t.auditDetails)||void 0===o?void 0:o.lastModified,name:null==t||null===(a=t.assignes)||void 0===a||null===(r=a[0])||void 0===r?void 0:r.name,mobileNumber:null==t||null===(u=t.assignes)||void 0===u||null===(c=u[0])||void 0===c?void 0:c.mobileNumber,comment:v(null==t?void 0:t.comment),wfComment:t.wfComment,thumbnailsToShow:null==t?void 0:t.thumbnailsToShow};return l.createElement(A,{data:e,OpenImage:_})}{var s,d;const n={date:Digit.DateUtils.ConvertTimestampToDate(null===(s=e.application)||void 0===s?void 0:s.auditDetails.lastModified),name:null==t||null===(d=t.assigner)||void 0===d?void 0:d.name,comment:v(null==t?void 0:t.comment)};return l.createElement(A,{data:n})}};return f?l.createElement(t.Loader,null):l.createElement(l.Fragment,null,!f&&l.createElement(n.Fragment,null,(null==E||null===(s=E.timeline)||void 0===s?void 0:s.length)>0&&l.createElement(t.CardSectionHeader,{style:{marginBottom:"16px",marginTop:"32px"}},v("CS_APPLICATION_DETAILS_APPLICATION_TIMELINE")),null!=E&&E.timeline&&1===(null==E||null===(d=E.timeline)||void 0===d?void 0:d.length)?l.createElement(t.CheckPoint,{isCompleted:!0,label:v((null==E||null===(p=E.timeline[0])||void 0===p?void 0:p.state)&&"WF_"+m+"_"+E.timeline[0].state||"NA"),customChild:h(null==E?void 0:E.timeline[0])}):l.createElement(t.ConnectingCheckPoints,null,(null==E?void 0:E.timeline)&&(null==E?void 0:E.timeline.map((e,n,i)=>{var o;return l.createElement(l.Fragment,{key:n},l.createElement(t.CheckPoint,{keyValue:n,isCompleted:0===n,label:v("ES_PTR_COMMON_STATUS_"+(null==E||null===(o=E.processInstances[n].state)||void 0===o?void 0:o.state)),customChild:h(e)}))})))),E&&(n=>{var i,a,r;let u=n[0];const c=n.map(e=>e.action);if(c.includes("PAY")||c.includes("EDIT")){let e=c.indexOf("EDIT")||c.indexOf("PAY");e=-1!=e?e:c.indexOf("PAY"),u=n[e]}switch(null===(i=u)||void 0===i?void 0:i.action){case"PAY":return"citizen"===(null==e?void 0:e.userType)?l.createElement("div",{style:{marginTop:"1em",bottom:"0px",width:"100%",marginBottom:"1.2em"}},l.createElement(o.Link,{to:{pathname:"/upyog-ui/citizen/payment/my-bills/"+m+"/"+(null==e||null===(a=e.application)||void 0===a?void 0:a.applicationNumber),state:{tenantId:e.application.tenantId,applicationNumber:null==e||null===(r=e.application)||void 0===r?void 0:r.applicationNumber}}},l.createElement(t.SubmitBar,{label:v("CS_APPLICATION_DETAILS_MAKE_PAYMENT")}))):null;default:return null}})(null==E?void 0:E.nextActions))},D=["path","url"],N=[{screenPath:"petservice/new-application/acknowledgement"},{screenPath:"petservice/edit-application/acknowledgement"}],P=()=>{var e,n,a,r,s,d;const p=o.useRouteMatch(),{path:v}=p,{t:m}=(c(p,D),i.useTranslation()),f=null===(e=Digit)||void 0===e||null===(n=e.ComponentRegistryService)||void 0===n?void 0:n.getComponent("PTRCreatePet"),E=null===(a=Digit)||void 0===a||null===(r=a.ComponentRegistryService)||void 0===r?void 0:r.getComponent("PTRApplicationDetails"),_=null===(s=Digit)||void 0===s||null===(d=s.ComponentRegistryService)||void 0===d?void 0:d.getComponent("PTRMyApplications");return l.createElement("span",{className:"pet-citizen",style:{width:"100%"}},l.createElement(o.Switch,null,l.createElement(t.AppContainer,null,(void 0===(h=N)&&(h=[]),h.filter(e=>window.location.href.includes(e.screenPath)).length>0?"":l.createElement(t.BackButton,null,"Back")),l.createElement(t.PrivateRoute,{path:v+"/petservice/new-application",component:f}),l.createElement(t.PrivateRoute,{path:v+"/petservice/revised-application",component:f}),l.createElement(t.PrivateRoute,{path:v+"/petservice/application/:acknowledgementIds/:tenantId",component:E}),l.createElement(t.PrivateRoute,{path:v+"/petservice/my-applications",component:_}),l.createElement(t.PrivateRoute,{path:v+"/petservice/search",component:e=>l.createElement(Search,u({},e,{t:m,parentRoute:v}))}))));var h},R=e=>{let{jumpTo:n}=e;const{t:a}=i.useTranslation(),r=o.useHistory();return l.createElement(t.LinkButton,{label:a("CS_COMMON_CHANGE"),className:"check-page-link-button",onClick:function(){r.push(n)}})},I=e=>e.substr(0,1).toUpperCase()+e.substr(1),O=(e,t)=>{let n=[{title:t("PTR_PET_NAME"),value:null==e?void 0:e.petDetails.petName},{title:t("PTR_PET_TYPE"),value:null==e?void 0:e.petDetails.petType},{title:t("PTR_BREED_TYPE"),value:null==e?void 0:e.petDetails.breedType},{title:t("PTR_VACCINATED_DATE"),value:null==e?void 0:e.petDetails.lastVaccineDate},{title:t("PTR_VACCINATION_NUMBER"),value:null==e?void 0:e.petDetails.vaccinationNumber},{title:t("PTR_DOCTOR_NAME"),value:null==e?void 0:e.petDetails.doctorName},{title:t("PTR_CLINIC_NAME"),value:null==e?void 0:e.petDetails.clinicName},{title:t("PTR_PET_AGE"),value:(null==e?void 0:e.petDetails.petAge)+" Months"},{title:t("PTR_PET_SEX"),value:null==e?void 0:e.petDetails.petGender}];return{title:t("ES_TITILE_PET_DETAILS"),values:n}},x=function(e,t,n){try{var l;function i(l){var i,o,a,r,u,c,s,d;return{t:n,tenantId:null==t?void 0:t.code,name:n(null==t?void 0:t.i18nKey)+" "+(d=n("ULBGRADE_"+(null==t||null===(i=t.city)||void 0===i?void 0:i.ulbGrade.toUpperCase().replace(" ","_").replace(".","_"))),d.toLowerCase().split(" ").map(I).join(" ")),email:null==t?void 0:t.emailId,phoneNumber:null==t?void 0:t.contactNumber,applicationNumber:null==e?void 0:e.applicationNumber,heading:n("PTR_ACKNOWLEDGEMENT"),details:[{title:n("CS_TITLE_APPLICATION_DETAILS"),values:[{title:n("PTR_VALIDITY_DATE"),value:(s=null==e?void 0:e.validityDate,s?new Date(1e3*s).getDate()+"/"+(new Date(1e3*s).getMonth()+1)+"/"+new Date(1e3*s).getFullYear().toString():"NA")},{title:n("PTR_APPLICANT_NAME"),value:null==e?void 0:e.applicantName},{title:n("CS_APPLICATION_DETAILS_APPLICATION_DATE"),value:Digit.DateUtils.ConvertTimestampToDate(null==e||null===(o=e.auditDetails)||void 0===o?void 0:o.createdTime,"dd/MM/yyyy")},{title:n("PTR_MOBILE_NUMBER"),value:null==e?void 0:e.mobileNumber},{title:n("PTR_EMAIL_ID"),value:null==e?void 0:e.emailId}]},O(e,n),{title:n("PTR_LOCATION_DETAILS"),values:[{title:n("PTR_PINCODE"),value:null==e||null===(a=e.address)||void 0===a?void 0:a.pincode},{title:n("PTR_CITY"),value:null==e||null===(r=e.address)||void 0===r?void 0:r.city},{title:n("PTR_STREET_NAME"),value:null==e||null===(u=e.address)||void 0===u?void 0:u.street},{title:n("PTR_HOUSE_NO"),value:null==e||null===(c=e.address)||void 0===c?void 0:c.doorNo}]}]}}const o=null==e||null===(l=e.documents)||void 0===l?void 0:l.map(e=>null==e?void 0:e.fileStoreId);return Promise.resolve((null==o?void 0:o.length)>0?Promise.resolve(Digit.UploadServices.Filefetch(o,Digit.ULBService.getStateId())).then(i):i())}catch(e){return Promise.reject(e)}},w=e=>{const{t:t}=i.useTranslation();return e.isSuccess?window.location.href.includes("revised-application")?t("PTR_REVISED_SUCCESSFULLY"):t("ES_PTR_RESPONSE_CREATE_ACTION"):e.isLoading?t("CS_PTR_APPLICATION_PENDING"):e.isSuccess?void 0:t("CS_PTR_APPLICATION_FAILED")},L={padding:"4px 0px",justifyContent:"space-between"},M=e=>{var n;return l.createElement(t.Banner,{message:w(e),applicationNumber:null===(n=e.data)||void 0===n?void 0:n.PetRegistrationApplications[0].applicationNumber,info:e.isSuccess?e.t("PTR_APPLICATION_NO"):"",successful:e.isSuccess,style:{width:"100%"}})},k=e=>{var n;let{application:a,buttonLabel:r}=e;const{t:u}=i.useTranslation(),c=o.useHistory();return l.createElement(t.Card,null,l.createElement(t.KeyNote,{keyValue:u("PTR_APPLICATION_NO_LABEL"),note:null==a?void 0:a.applicationNumber}),l.createElement(t.KeyNote,{keyValue:u("PTR_APPLICANT_NAME"),note:null==a?void 0:a.applicantName}),l.createElement(t.KeyNote,{keyValue:u("PTR_APPLICATION_TYPE"),note:null==a?void 0:a.applicationType}),l.createElement(t.KeyNote,{keyValue:u("PTR_APPLICATION_STATUS"),note:null==a?void 0:a.status}),l.createElement(t.KeyNote,{keyValue:u("PTR_SEARCH_PET_TYPE"),note:null==a||null===(n=a.petDetails)||void 0===n?void 0:n.petType}),"Expired"==(null==a?void 0:a.status)&&l.createElement(t.SubmitBar,{style:{marginBottom:"5px"},label:"Renewal",onSubmit:()=>{var e;sessionStorage.setItem("petId",null==a?void 0:a.applicationNumber),null!=a&&a.petToken&&(null==a||null===(e=a.petToken)||void 0===e?void 0:e.length)>0&&sessionStorage.setItem("petToken",null==a?void 0:a.petToken),c.push("/upyog-ui/citizen/ptr/petservice/revised-application")}}),l.createElement(o.Link,{to:"/upyog-ui/citizen/ptr/petservice/application/"+(null==a?void 0:a.applicationNumber)+"/"+(null==a?void 0:a.tenantId)},l.createElement(t.SubmitBar,{label:r})))};var F,B=Array.isArray,U="object"==typeof p&&p&&p.Object===Object&&p,H="object"==typeof self&&self&&self.Object===Object&&self,j=U||H||Function("return this")(),W=j.Symbol,z=Object.prototype,V=z.hasOwnProperty,K=z.toString,Y=W?W.toStringTag:void 0,G=Object.prototype.toString,q=W?W.toStringTag:void 0,$=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":q&&q in Object(e)?function(e){var t=V.call(e,Y),n=e[Y];try{e[Y]=void 0;var l=!0}catch(e){}var i=K.call(e);return l&&(t?e[Y]=n:delete e[Y]),i}(e):function(e){return G.call(e)}(e)},X=function(e){return null!=e&&"object"==typeof e},Z=function(e){return"symbol"==typeof e||X(e)&&"[object Symbol]"==$(e)},J=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Q=/^\w*$/,ee=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},te=function(e){if(!ee(e))return!1;var t=$(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t},ne=j["__core-js_shared__"],le=(F=/[^.]+$/.exec(ne&&ne.keys&&ne.keys.IE_PROTO||""))?"Symbol(src)_1."+F:"",ie=Function.prototype.toString,oe=function(e){if(null!=e){try{return ie.call(e)}catch(e){}try{return e+""}catch(e){}}return""},ae=/^\[object .+?Constructor\]$/,re=RegExp("^"+Function.prototype.toString.call(Object.prototype.hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ue=function(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return function(e){return!(!ee(e)||(t=e,le&&le in t))&&(te(e)?re:ae).test(oe(e));var t}(n)?n:void 0},ce=ue(Object,"create"),se=Object.prototype.hasOwnProperty,de=Object.prototype.hasOwnProperty;function pe(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])}}pe.prototype.clear=function(){this.__data__=ce?ce(null):{},this.size=0},pe.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},pe.prototype.get=function(e){var t=this.__data__;if(ce){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return se.call(t,e)?t[e]:void 0},pe.prototype.has=function(e){var t=this.__data__;return ce?void 0!==t[e]:de.call(t,e)},pe.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=ce&&void 0===t?"__lodash_hash_undefined__":t,this};var ve=pe,me=function(e,t){return e===t||e!=e&&t!=t},fe=function(e,t){for(var n=e.length;n--;)if(me(e[n][0],t))return n;return-1},Ee=Array.prototype.splice;function _e(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])}}_e.prototype.clear=function(){this.__data__=[],this.size=0},_e.prototype.delete=function(e){var t=this.__data__,n=fe(t,e);return!(n<0||(n==t.length-1?t.pop():Ee.call(t,n,1),--this.size,0))},_e.prototype.get=function(e){var t=this.__data__,n=fe(t,e);return n<0?void 0:t[n][1]},_e.prototype.has=function(e){return fe(this.__data__,e)>-1},_e.prototype.set=function(e,t){var n=this.__data__,l=fe(n,e);return l<0?(++this.size,n.push([e,t])):n[l][1]=t,this};var he=_e,ge=ue(j,"Map"),Se=function(e,t){var n,l,i=e.__data__;return("string"==(l=typeof(n=t))||"number"==l||"symbol"==l||"boolean"==l?"__proto__"!==n:null===n)?i["string"==typeof t?"string":"hash"]:i.map};function ye(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])}}ye.prototype.clear=function(){this.size=0,this.__data__={hash:new ve,map:new(ge||he),string:new ve}},ye.prototype.delete=function(e){var t=Se(this,e).delete(e);return this.size-=t?1:0,t},ye.prototype.get=function(e){return Se(this,e).get(e)},ye.prototype.has=function(e){return Se(this,e).has(e)},ye.prototype.set=function(e,t){var n=Se(this,e),l=n.size;return n.set(e,t),this.size+=n.size==l?0:1,this};var be=ye;function Te(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function(){var l=arguments,i=t?t.apply(this,l):l[0],o=n.cache;if(o.has(i))return o.get(i);var a=e.apply(this,l);return n.cache=o.set(i,a)||o,a};return n.cache=new(Te.Cache||be),n}Te.Cache=be;var Ae,Ce,De=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Ne=/\\(\\)?/g,Pe=(Ae=Te(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(De,function(e,n,l,i){t.push(l?i.replace(Ne,"$1"):n||e)}),t},function(e){return 500===Ce.size&&Ce.clear(),e}),Ce=Ae.cache,Ae),Re=W?W.prototype:void 0,Ie=Re?Re.toString:void 0,Oe=function(e){if("string"==typeof e||Z(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t},xe=function(e,t,n){var l=null==e?void 0:function(e,t){for(var n=0,l=(t=function(e,t){return B(e)?e:function(e,t){if(B(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!Z(e))||Q.test(e)||!J.test(e)||null!=t&&e in Object(t)}(e,t)?[e]:Pe(function(e){return null==e?"":function e(t){if("string"==typeof t)return t;if(B(t))return function(e,t){for(var n=-1,l=null==e?0:e.length,i=Array(l);++n<l;)i[n]=t(e[n],n,e);return i}(t,e)+"";if(Z(t))return Ie?Ie.call(t):"";var n=t+"";return"0"==n&&1/t==-1/0?"-0":n}(e)}(e))}(t,e)).length;null!=e&&n<l;)e=e[Oe(t[n++])];return n&&n==l?e:void 0}(e,t);return void 0===l?n:l};const we=["tenantId","payments"],Le=e=>{let{t:n,currentPage:i,columns:o,data:a,getCellProps:r,disableSort:u,onSort:c,onNextPage:s,onPrevPage:d,onPageSizeChange:p,pageSizeLimit:v,sortParams:m,totalRecords:f}=e;return l.createElement(t.Table,{t:n,data:a,currentPage:i,columns:o,getCellProps:r,onNextPage:s,onPrevPage:d,pageSizeLimit:v,disableSort:u,onPageSizeChange:p,onSort:c,sortParams:m,totalRecords:f})},Me=e=>{let{businessService:a}=e;const{t:r}=i.useTranslation(),u=[{text:"ES_TITLE_NEW_PET_REGISTRATION",link:"/upyog-ui/employee/ptr/new-application",businessService:"ptr",roles:["PT_CEMP"]},{text:"PTR_SEARCH_PET",link:"/upyog-ui/employee/ptr/search",businessService:"ptr",roles:[]},{text:"PTR_COMMON_APPLICATION_SEARCH",link:"/upyog-ui/employee/ptr/application-search",businessService:"ptr",roles:[]}],[c,s]=n.useState([]),{roles:d}=Digit.UserService.getUser().info;return n.useEffect(()=>{let e=u.filter(e=>e.businessService===a).filter(e=>{let{roles:t}=e;return t.some(e=>d.map(e=>{let{code:t}=e;return t}).includes(e))||!(null!=t&&t.length)});s(e)},[]),l.createElement(t.Card,{className:"employeeCard filter inboxLinks"},l.createElement("div",{className:"complaint-links-container"},l.createElement("div",{className:"header"},l.createElement("span",{className:"logo"},l.createElement(t.PropertyHouse,null))," ",l.createElement("span",{className:"text"},r("PET_SERVICE"))),l.createElement("div",{className:"body"},c.map((e,t)=>{let{link:n,text:i,hyperlink:a=!1,roles:u=[]}=e;return l.createElement("span",{className:"link",key:t},a?l.createElement("a",{href:n},i):l.createElement(o.Link,{to:n},r(i)))}))))},ke={date:t.DatePicker,mobileNumber:t.MobileNumber},Fe=e=>{var n;let{onSearch:o,type:r,onClose:c,searchFields:s,searchParams:d,isInboxPage:p,clearSearch:v}=e;const{t:m}=i.useTranslation(),{handleSubmit:f,reset:E,watch:_,control:h,formState:g,setValue:S}=a.useForm({defaultValues:p?d:u({locality:null,city:null},d)}),y=_(),b=innerWidth<=640;function T(){const e=s.reduce((e,t)=>u({},e,{[null==t?void 0:t.name]:""}),{});if(E(e),p){const e=u({},d);e.delete=[],s.forEach(t=>{e.delete.push(null==t?void 0:t.name)}),o(u({},e))}else v()}const A=e=>l.createElement(t.LinkLabel,{style:u({display:"inline"},e?{margin:0}:{}),onClick:T},m("ES_COMMON_CLEAR_SEARCH"));return l.createElement("form",{onSubmit:f(e=>{e.mobileNumber||delete e.mobileNumber,e.delete=[],s.forEach(t=>{e[t.name]||e.delete.push(t.name)}),o(e),"mobile"===r&&c()})},l.createElement(l.Fragment,null,l.createElement("div",{className:"search-container",style:{width:"auto",marginLeft:p?"24px":"revert"}},l.createElement("div",{className:"search-complaint-container"},("mobile"===r||b)&&l.createElement("div",{className:"complaint-header"},l.createElement("h2",null,m("ES_COMMON_SEARCH_BY")),l.createElement("span",{onClick:c},l.createElement(t.CloseSvg,null))),l.createElement("div",{className:"complaint-input-container for-pt "+(p?"":"for-search"),style:{width:"100%",display:"grid"}},null==s||null===(n=s.filter(e=>!0))||void 0===n?void 0:n.map((e,n)=>{var i,o,r;return l.createElement("div",{key:e.name,className:"input-fields"},l.createElement("span",{className:"mobile-input"},l.createElement(t.Label,null,m(e.label)+" "+(e.isMendatory?"*":"")),l.createElement(a.Controller,e.type?{render:t=>l.createElement(null==ke?void 0:ke[e.type],{formValue:y,setValue:S,onChange:t.onChange,value:t.value}),name:e.name,control:h,defaultValue:""}:{render:e=>l.createElement(t.TextInput,{onChange:e.onChange,value:e.value}),name:e.name,control:h,defaultValue:""})),null!=g&&null!==(i=g.dirtyFields)&&void 0!==i&&i[e.name]?l.createElement("span",{style:{fontWeight:"700",color:"rgba(212, 53, 28)",paddingLeft:"8px",marginTop:"-20px",fontSize:"12px"},className:"inbox-search-form-error"},null==g||null===(o=g.errors)||void 0===o||null===(r=o[e.name])||void 0===r?void 0:r.message):null)}),p&&l.createElement("div",{style:{gridColumn:"2/3",textAlign:"right",paddingTop:"10px"},className:"input-fields"},l.createElement("div",null,A())),"desktop"===r&&!b&&l.createElement("div",{style:{maxWidth:"unset",marginLeft:"unset"},className:"search-submit-wrapper"},l.createElement(t.SubmitBar,{className:"submit-bar-search",label:m("ES_COMMON_SEARCH"),disabled:!!Object.keys(g.errors).length||(()=>{var e;let t=!0;return Object.keys(y).forEach(e=>{!["locality","city"].includes(e)&&y[e]&&(t=!1)}),null==s||!s.find(e=>"locality"===e.name)||null!=y&&null!==(e=y.locality)&&void 0!==e&&e.code||(t=!0),t})(),submit:!0}),!p&&l.createElement("div",null,A()))))),("mobile"===r||b)&&l.createElement(t.ActionBar,{className:"clear-search-container"},l.createElement("button",{className:"clear-search",style:{flex:1}},A(b)),l.createElement(t.SubmitBar,{disabled:!!Object.keys(g.errors).length,label:m("ES_COMMON_SEARCH"),style:{flex:1},submit:!0}))))},Be=["tableConfig","filterComponent"],Ue=e=>{let{tableConfig:o,filterComponent:a}=e,r=c(e,Be);const{data:u,useNewInboxAPI:s}=r,{t:d}=i.useTranslation(),[p,v]=n.useState(()=>{var e;return null===(e=Digit.ComponentRegistryService)||void 0===e?void 0:e.getComponent(a)}),[m,f]=n.useState(()=>{var e;return null===(e=Digit.ComponentRegistryService)||void 0===e?void 0:e.getComponent(r.EmptyResultInboxComp)}),[E,_]=n.useState(!1),h=l.useMemo(()=>r.isSearch?o.searchColumns(r):o.inboxColumns(r)||[],[]);let g;return r.isLoading?g=l.createElement(t.Loader,null):E?g=null:!u||0===(null==u?void 0:u.length)||s&&null!=u&&u[0].dataEmpty?g=m&&l.createElement(m,{data:u})||(0===(null==u?void 0:u.length)||s&&null!=u&&u[0].dataEmpty?l.createElement(t.Card,{style:{marginTop:20}},d("CS_MYAPPLICATIONS_NO_APPLICATION").split("\\n").map((e,t)=>l.createElement("p",{key:t,style:{textAlign:"center"}},e))):l.createElement(t.Loader,null)):(null==u?void 0:u.length)>0&&(g=l.createElement(Le,{t:d,data:u,columns:h,getCellProps:e=>({style:{minWidth:e.column.Header===d("ES_INBOX_APPLICATION_NO")?"240px":"",padding:"20px 18px",fontSize:"16px"}}),onPageSizeChange:r.onPageSizeChange,currentPage:r.currentPage,onNextPage:r.onNextPage,onPrevPage:r.onPrevPage,pageSizeLimit:r.pageSizeLimit,onSort:r.onSort,disableSort:r.disableSort,sortParams:r.sortParams,totalRecords:r.totalRecords})),l.createElement("div",{className:"inbox-container"},!r.isSearch&&l.createElement("div",{className:"filters-container"},l.createElement(Me,{parentRoute:r.parentRoute,businessService:r.moduleCode}),l.createElement("div",null,l.createElement(p,{defaultSearchParams:r.defaultSearchParams,onFilterChange:r.onFilterChange,searchParams:r.searchParams,type:"desktop",useNewInboxAPI:s,statusMap:s?null==u?void 0:u[0].statusMap:null,moduleCode:r.moduleCode}))),l.createElement("div",{style:{flex:1}},l.createElement(Fe,{defaultSearchParams:r.defaultSearchParams,onSearch:e=>{r.onSearch(e),_(!1)},type:"desktop",searchFields:r.searchFields,isInboxPage:!(null!=r&&r.isSearch),searchParams:r.searchParams,clearSearch:()=>_(!0)}),l.createElement("div",{className:"result",style:{marginLeft:null!=r&&r.isSearch?"":"24px",flex:1}},g)))},He=e=>{const{t:o}=i.useTranslation(),[a,r]=n.useState(()=>{var t,n;return null!==(t=e.sortParams)&&void 0!==t&&null!==(n=t[0])&&void 0!==n&&n.desc?{code:"DESC",name:o("ES_INBOX_DATE_LATEST_FIRST")}:{code:"ASC",name:o("ES_INBOX_DATE_LATEST_LAST")}});function u(){}return l.createElement(l.Fragment,null,l.createElement("div",{className:"filter"},l.createElement("div",{className:"filter-card"},l.createElement("div",{className:"heading"},l.createElement("div",{className:"filter-label"},o("SORT_BY"),":"),l.createElement("div",{className:"clearAll",onClick:u},o("ES_COMMON_CLEAR_ALL")),"desktop"===e.type&&l.createElement("span",{className:"clear-search",onClick:u},o("ES_COMMON_CLEAR_ALL")),"mobile"===e.type&&l.createElement("span",{onClick:e.onClose},l.createElement(t.CloseSvg,null))),l.createElement("div",null,l.createElement(t.RadioButtons,{onSelect:function(t){e.onSort([{id:"createdTime",desc:"DESC"===t.code}]),e.onClose()},selectedOption:a,optionsKey:"name",options:[{code:"DESC",name:o("ES_INBOX_DATE_LATEST_FIRST")},{code:"ASC",name:o("ES_INBOX_DATE_LATEST_LAST")}]})))))},je=e=>{let{t:i,data:o,onFilterChange:a,onSearch:r,onSort:u,serviceRequestIdKey:c,isFstpOperator:s,isLoading:d,isSearch:p,searchParams:v,searchFields:m,sortParams:f,linkPrefix:E,filterComponent:_}=e;const[h,g]=n.useState(p?"SEARCH":""),[S,y]=n.useState(!!p),[b,T]=n.useState(f),[A]=n.useState(()=>{var e;return null===(e=Digit.ComponentRegistryService)||void 0===e?void 0:e.getComponent(_)});n.useEffect(()=>{h&&y(!0)},[h]);const C=()=>{y(!1),g(""),T(f)};if(d)return l.createElement(t.Loader,null);let D;return o&&0!==(null==o?void 0:o.length)?o&&(null==o?void 0:o.length)>0&&(D=l.createElement(t.DetailsCard,{data:o,serviceRequestIdKey:c,linkPrefix:E||"/upyog-ui/employee/ptr/"})):D=l.createElement(t.Card,{style:{marginTop:20}},i("CS_MYAPPLICATIONS_NO_APPLICATION").split("\\n").map((e,t)=>l.createElement("p",{key:t,style:{textAlign:"center"}},e))),l.createElement(l.Fragment,null,l.createElement("div",{className:"searchBox"},r&&l.createElement(t.SearchAction,{text:"SEARCH",handleActionClick:()=>{g("SEARCH"),y(!0)}}),!p&&a&&l.createElement(t.FilterAction,{text:"FILTER",handleActionClick:()=>{g("FILTER"),y(!0)}}),l.createElement(t.FilterAction,{text:"SORT",handleActionClick:()=>{g("SORT"),y(!0)}})),D,S&&l.createElement(t.PopUp,null,"FILTER"===h&&l.createElement("div",{className:"popup-module"},l.createElement(A,{onFilterChange:e=>{a(e),y(!1)},Close:C,type:"mobile",searchParams:v})),"SORT"===h&&l.createElement("div",{className:"popup-module"},l.createElement(He,{type:"mobile",sortParams:f,onClose:C,onSort:u})),"SEARCH"===h&&l.createElement("div",{className:"popup-module"},l.createElement(Fe,{type:"mobile",onClose:C,onSearch:r,isFstpOperator:s,searchParams:v,searchFields:m}))))},We=e=>{let{linkPrefix:a,classNameForMobileView:r=""}=e;const{t:u}=i.useTranslation(),c=[{text:u("ES_TITLE_NEW_REGISTRATION"),link:"/upyog-ui/employee/ptr/new-application"},{text:u("ES_TITILE_SEARCH_APPLICATION"),link:a+"/search"}],[s,d]=n.useState([]),{roles:p}=Digit.UserService.getUser().info;return n.useEffect(()=>{let e=[];c.forEach(t=>{var n;t.accessTo?(n=t.accessTo,p.filter(e=>n.includes(e.code)).length&&e.push(t)):e.push(t)}),d(e)},[]),l.createElement(t.Card,{className:"employeeCard filter"},l.createElement("div",{className:"complaint-links-container "+r},l.createElement("div",{className:"header"},l.createElement("span",{className:"logo"},l.createElement(t.ShippingTruck,null))," ",l.createElement("span",{className:"text"},u("ES_TITLE_PET_REGISTRATION"))),l.createElement("div",{className:"body"},s.map((e,t)=>{let{link:n,text:i}=e;return l.createElement("span",{className:"link",key:t},l.createElement(o.Link,{to:n},i))}))))},ze=e=>{let{data:t,isLoading:n,isSearch:o,searchFields:a,onFilterChange:r,onSearch:u,onSort:c,parentRoute:s,searchParams:d,sortParams:p,linkPrefix:v,tableConfig:m,filterComponent:f}=e;const{t:E}=i.useTranslation();return l.createElement("div",{style:{padding:0}},l.createElement("div",{className:"inbox-container"},l.createElement("div",{className:"filters-container"},!o&&l.createElement(We,{classNameForMobileView:"linksWrapperForMobileInbox",linkPrefix:s,isMobile:!0}),l.createElement(je,{t:E,data:null==t?void 0:t.map(e=>{const t={};return(o?m.searchColumns():m.inboxColumns()).forEach(n=>{n.mobileCell&&(t[n.Header]=n.mobileCell(e))}),t}),onFilterChange:r,isLoading:n,isSearch:o,onSearch:u,onSort:c,searchParams:d,searchFields:a,linkPrefix:v,sortParams:p,serviceRequestIdKey:null==m?void 0:m.serviceRequestIdKey,filterComponent:f}))))},Ve=["isFetching","isLoading","searchResponseKey","data","searchFields"],Ke=e=>{var o,a,r,s,d;let{useNewInboxAPI:p,parentRoute:v,moduleCode:m="PTR",initialStates:f={},filterComponent:E,isInbox:_,rawWfHandler:h,rawSearchHandler:g,combineResponse:S,wfConfig:y,searchConfig:b,middlewaresWf:T,middlewareSearch:A,EmptyResultInboxComp:C}=e;const D=Digit.ULBService.getCurrentTenantId(),{t:N}=i.useTranslation(),[P,R]=n.useState(()=>_?{}:{enabled:!1}),[I,O]=n.useState(()=>{var e;return null===(e=Digit.ComponentRegistryService)||void 0===e?void 0:e.getComponent("PTRInboxTableConfig")}),[x,w]=n.useState(f.pageOffset||0),[L,M]=n.useState(f.pageSize||10),[k,F]=n.useState(f.sortParams||[{id:"createdTime",desc:!0}]),[B,U]=n.useState(f.searchParams||{});let H=window.Digit.Utils.browser.isMobile(),j=H?{limit:100,offset:0,sortBy:null==k||null===(o=k[0])||void 0===o?void 0:o.id,sortOrder:null!=k&&null!==(a=k[0])&&void 0!==a&&a.desc?"DESC":"ASC"}:{limit:L,offset:x,sortBy:null==k||null===(r=k[0])||void 0===r?void 0:r.id,sortOrder:null!=k&&null!==(s=k[0])&&void 0!==s&&s.desc?"DESC":"ASC"};const W=p?Digit.Hooks.useNewInboxGeneral({tenantId:D,ModuleCode:m,filters:u({},B,j,{sortParams:k})}):Digit.Hooks.useInboxGeneral({tenantId:D,businessService:m,isInbox:_,filters:u({},B,j,{sortParams:k}),rawWfHandler:h,rawSearchHandler:g,combineResponse:S,wfConfig:y,searchConfig:u({},P,b),middlewaresWf:T,middlewareSearch:A}),{isLoading:z,data:V,searchFields:K}=W,Y=c(W,Ve);n.useEffect(()=>{w(0)},[B]);const G=e=>{let t=e.delete,n=u({},B,e);t&&t.forEach(e=>delete n[e]),delete e.delete,U(u({},n)),R({enabled:!0})},q=n.useCallback(e=>{0!==e.length&&F(e)},[]);var $,X;if(null!==(null==Y||null===(d=Y.data)||void 0===d?void 0:d.length))return H?l.createElement(ze,{data:V,isLoading:z,isSearch:!_,searchFields:K,onFilterChange:G,onSearch:G,onSort:q,parentRoute:v,searchParams:B,sortParams:k,linkPrefix:v+"/application-details/",tableConfig:null!=Y&&Y.tableConfig?null===($=res)||void 0===$?void 0:$.tableConfig:I(N).PTR,filterComponent:E,EmptyResultInboxComp:C,useNewInboxAPI:p}):l.createElement("div",null,_&&l.createElement(t.Header,null,N("ES_COMMON_INBOX")),l.createElement(Ue,{moduleCode:m,data:V,tableConfig:I(N).PTR,isLoading:z,defaultSearchParams:f.searchParams,isSearch:!_,onFilterChange:G,searchFields:K,onSearch:G,onSort:q,onNextPage:()=>{w(e=>e+L)},onPrevPage:()=>{w(e=>e-L)},currentPage:Math.floor(x/L),pageSizeLimit:L,disableSort:!1,onPageSizeChange:e=>{M(Number(e.target.value))},parentRoute:v,searchParams:B,sortParams:k,totalRecords:Number(null==V||null===(X=V[0])||void 0===X?void 0:X.totalCount),filterComponent:E,EmptyResultInboxComp:C,useNewInboxAPI:p}))},Ye=e=>{var i,r;let{isLoading:u,t:c,onSubmit:s,data:d,count:p,setShowToast:v}=e;const m=window.Digit.Utils.browser.isMobile(),{register:f,control:E,handleSubmit:_,setValue:h,getValues:g,reset:S,formState:y}=a.useForm({defaultValues:{offset:0,limit:!m&&10,sortBy:"commencementDate",sortOrder:"DESC"}});n.useEffect(()=>{f("offset",0),f("limit",10),f("sortBy","commencementDate"),f("sortOrder","DESC")},[f]);const b=[{code:"NEWAPPLICATION",i18nKey:"NEWAPPLICATION"},{code:"RENEWAPPLICATION",i18nKey:"RENEWAPPLICATION"}],T=Digit.ULBService.getStateId(),{data:A}=Digit.Hooks.ptr.usePTRPetMDMS(T,"PetService","PetType");let C=[];A&&A.map(e=>{C.push({i18nKey:"PTR_PET_"+e.code,code:""+e.code,value:""+e.name})});const D=e=>l.createElement("span",{className:"cell-text"},e),N=n.useMemo(()=>[{Header:c("PTR_APPLICATION_NUMBER"),accessor:"applicationNumber",disableSortBy:!0,Cell:e=>{let{row:t}=e;return l.createElement("div",null,l.createElement("span",{className:"link"},l.createElement(o.Link,{to:"/upyog-ui/employee/ptr/petservice/applicationsearch/application-details/"+t.original.applicationNumber},t.original.applicationNumber)))}},{Header:c("PTR_APPLICANT_NAME"),Cell:e=>{var t,n;return D(""+(null==e||null===(t=e.row)||void 0===t||null===(n=t.original)||void 0===n?void 0:n.applicantName))},disableSortBy:!0},{Header:c("PTR_PET_TYPE"),Cell:e=>{var t,n;let{row:l}=e;return D(""+(null===(t=l.original)||void 0===t||null===(n=t.petDetails)||void 0===n?void 0:n.petType))},disableSortBy:!0},{Header:c("PTR_BREED_TYPE"),Cell:e=>{var t,n;let{row:l}=e;return D(""+(null===(t=l.original)||void 0===t||null===(n=t.petDetails)||void 0===n?void 0:n.breedType))},disableSortBy:!0},{Header:c("PTR_MOBILE_NUMBER"),Cell:e=>{var t;let{row:n}=e;return D(""+(null==n||null===(t=n.original)||void 0===t?void 0:t.mobileNumber))},disableSortBy:!0},{Header:c("PTR_APPLICATION_STATUS"),Cell:e=>{var t;let{row:n}=e;return D(""+(null==n||null===(t=n.original)||void 0===t?void 0:t.status))},disableSortBy:!0}],[]),P=n.useCallback(e=>{0!==e.length&&(h("sortBy",e.id),h("sortOrder",e.desc?"DESC":"ASC"))},[]);function R(){h("offset",g("offset")-g("limit")),_(s)()}return l.createElement(l.Fragment,null,l.createElement("div",null,l.createElement(t.Header,null,c("PTR_SEARCH_PET_APPLICATIONS")),l.createElement(t.Card,{className:"card-search-heading"},l.createElement("span",{style:{color:"#505A5F"}},c("Provide at least one parameter to search for an application"))),l.createElement(t.SearchForm,{onSubmit:s,handleSubmit:_},l.createElement(t.SearchField,null,l.createElement("label",null,c("PTR_APPLICATION_NO_LABEL")),l.createElement(t.TextInput,{name:"applicationNumber",inputRef:f({})})),l.createElement(t.SearchField,null,l.createElement("label",null,c("PTR_SEARCH_PET_TYPE")),l.createElement(a.Controller,{control:E,name:"petType",render:e=>l.createElement(t.Dropdown,{selected:e.value,select:e.onChange,onBlur:e.onBlur,option:C,optionKey:"i18nKey",t:c,disable:!1})})),l.createElement(t.SearchField,null,l.createElement("label",null,c("PTR_APPLICATION_TYPE")),l.createElement(a.Controller,{control:E,name:"applicationType",render:e=>l.createElement(t.Dropdown,{selected:e.value,select:e.onChange,onBlur:e.onBlur,option:b,optionKey:"i18nKey",t:c,disable:!1})})),l.createElement(t.SearchField,null,l.createElement("label",null,c("PTR_OWNER_MOBILE_NO")),l.createElement(t.MobileNumber,{name:"mobileNumber",inputRef:f({minLength:{value:10,message:c("CORE_COMMON_MOBILE_ERROR")},maxLength:{value:10,message:c("CORE_COMMON_MOBILE_ERROR")},pattern:{value:/[6789][0-9]{9}/,message:c("CORE_COMMON_MOBILE_ERROR")}}),type:"number",componentInFront:l.createElement("div",{className:"employee-card-input employee-card-input--front"},"+91")}),l.createElement(t.CardLabelError,null,null==y||null===(i=y.errors)||void 0===i||null===(r=i.mobileNumber)||void 0===r?void 0:r.message)),l.createElement(t.SearchField,null,l.createElement("label",null,c("PTR_FROM_DATE")),l.createElement(a.Controller,{render:e=>l.createElement(t.DatePicker,{date:e.value,disabled:!1,onChange:e.onChange}),name:"fromDate",control:E})),l.createElement(t.SearchField,null,l.createElement("label",null,c("PTR_TO_DATE")),l.createElement(a.Controller,{render:e=>l.createElement(t.DatePicker,{date:e.value,disabled:!1,onChange:e.onChange}),name:"toDate",control:E})),l.createElement(t.SearchField,{className:"submit"},l.createElement(t.SubmitBar,{label:c("ES_COMMON_SEARCH"),submit:!0}),l.createElement("p",{style:{marginTop:"10px"},onClick:()=>{S({applicationNumber:"",fromDate:"",toDate:"",petType:"",mobileNumber:"",status:"",breedType:"",offset:0,limit:10,sortBy:"commencementDate",sortOrder:"DESC"}),v(null),R()}},c("ES_COMMON_CLEAR_ALL")))),!u&&null!=d&&d.display?l.createElement(t.Card,{style:{marginTop:20}},c(d.display).split("\\n").map((e,t)=>l.createElement("p",{key:t,style:{textAlign:"center"}},e))):u||""===d?""!==d||u&&l.createElement(t.Loader,null):l.createElement(t.Table,{t:c,data:d,totalRecords:p,columns:N,getCellProps:e=>({style:{minWidth:e.column.Header===c("PTR_INBOX_APPLICATION_NO")?"240px":"",padding:"20px 18px",fontSize:"16px"}}),onPageSizeChange:function(e){h("limit",Number(e.target.value)),_(s)()},currentPage:g("offset")/g("limit"),onNextPage:function(){h("offset",g("offset")+g("limit")),_(s)()},onPrevPage:R,pageSizeLimit:g("limit"),onSort:P,disableSort:!1,sortParams:[{id:g("sortBy"),desc:"DESC"===g("sortOrder")}]})))},Ge=e=>{o.useParams();const{t:a}=i.useTranslation(),r=Digit.ULBService.getCurrentTenantId(),[c,s]=n.useState({}),[d,p]=n.useState(null),v={enabled:!!(c&&Object.keys(c).length>0)},{isLoading:m,isSuccess:f,data:{PetRegistrationApplications:E,Count:_}={}}=Digit.Hooks.ptr.usePTRSearch({tenantId:r,filters:c},v);return l.createElement(l.Fragment,null,l.createElement(Ye,{t:a,isLoading:m,tenantId:r,setShowToast:p,onSubmit:function(e){var t=new Date(null==e?void 0:e.fromDate);null==t||t.setSeconds((null==t?void 0:t.getSeconds())-19800);var n=new Date(null==e?void 0:e.toDate);null==n||n.setSeconds((null==n?void 0:n.getSeconds())+86399-19800);const l=u({},e,e.toDate?{toDate:null==n?void 0:n.getTime()}:{},e.fromDate?{fromDate:null==t?void 0:t.getTime()}:{});let i=Object.keys(l).filter(e=>l[e]).reduce((e,t)=>u({},e,{[t]:"object"==typeof l[t]?l[t].code:l[t]}),{});!(Object.entries(i).length>0)||i.applicationNumber||i.creationReason||i.fromDate||i.mobileNumber||i.applicationNumber||i.status||i.toDate?!(Object.entries(i).length>0&&(i.creationReason||i.status))||i.applicationNumber||i.fromDate||i.mobileNumber||i.applicationNumber||i.toDate?Object.entries(i).length>0&&i.fromDate&&!i.toDate||!i.fromDate&&i.toDate?p({warning:!0,label:"ERR_PROVIDE_BOTH_FORM_TO_DATE"}):s(i):p({warning:!0,label:"ERR_PROVIDE_MORE_PARAM_WITH_TYPE_STATUS"}):p({warning:!0,label:"ERR_PTR_FILL_VALID_FIELDS"})},data:f&&!m?E.length>0?E:{display:"ES_COMMON_NO_DATA"}:"",count:_}),d&&l.createElement(t.Toast,{error:d.error,warning:d.warning,label:a(d.label),isDleteBtn:!0,onClose:()=>{p(null)}}))},qe=e=>{var n,a,r,c;let{path:s,userType:d}=e;const{t:p}=i.useTranslation(),v=o.useLocation();sessionStorage.removeItem("revalidateddone");const m=window.Digit.Utils.browser.isMobile(),f={searchParams:{uuid:{code:"ASSIGNED_TO_ALL",name:"ES_INBOX_ASSIGNED_TO_ALL"},services:["ptr"],applicationStatus:[],locality:[]}},E=e=>{let{location:n}=e;const{t:a}=i.useTranslation(),r=o.useLocation().search,u=(new URLSearchParams(r).get("from"),Digit.Hooks.useQueryParams(),[{path:"/upyog-ui/employee",content:a("ES_COMMON_HOME"),show:!0},{path:"/upyog-ui/employee/ptr/petservice/inbox",content:a("ES_TITLE_INBOX"),show:!!n.pathname.includes("ptr/petservice/inbox")},{path:"/upyog-ui/employee/ptr/petservice/my-applications",content:a("ES_COMMON_APPLICATION_SEARCH"),show:!(!n.pathname.includes("/ptr/petservice/my-applications")&&!n.pathname.includes("/ptr/applicationsearch/application-details/"))}]);return l.createElement(t.BreadCrumb,{style:m?{display:"flex"}:{},spanStyle:{maxWidth:"min-content"},crumbs:u})},_=null===(n=Digit)||void 0===n||null===(a=n.ComponentRegistryService)||void 0===a?void 0:a.getComponent("PTRNewApplication"),h=null===(r=Digit)||void 0===r||null===(c=r.ComponentRegistryService)||void 0===c?void 0:c.getComponent("ApplicationDetails"),g=window.location.href.includes("ptr/response"),S=window.location.href.includes("new-application")||window.location.href.includes("modify-application")||window.location.href.includes("ptr/application-details");return l.createElement(o.Switch,null,l.createElement(l.Fragment,null,l.createElement("div",{className:"ground-container"},g?null:l.createElement("div",{style:S?{marginLeft:"12px"}:{marginLeft:"-4px"}},l.createElement(E,{location:v})),l.createElement(t.PrivateRoute,{exact:!0,path:s+"/",component:()=>l.createElement(Vi,{matchPath:s,userType:d})}),l.createElement(t.PrivateRoute,{path:s+"/petservice/inbox",component:()=>l.createElement(Ke,{useNewInboxAPI:!0,parentRoute:s,businessService:"ptr",filterComponent:"PTR_INBOX_FILTER",initialStates:f,isInbox:!0})}),l.createElement(t.PrivateRoute,{path:s+"/petservice/new-application",component:_}),l.createElement(t.PrivateRoute,{path:s+"/petservice/revised-application",component:_}),l.createElement(t.PrivateRoute,{path:s+"/petservice/application-details/:id",component:()=>l.createElement(h,{parentRoute:s})}),l.createElement(t.PrivateRoute,{path:s+"/petservice/applicationsearch/application-details/:id",component:()=>l.createElement(h,{parentRoute:s})}),l.createElement(t.PrivateRoute,{path:s+"/petservice/search",component:e=>l.createElement(Search,u({},e,{t:p,parentRoute:s}))}),l.createElement(t.PrivateRoute,{path:s+"/searchold",component:()=>l.createElement(Ke,{parentRoute:s,businessService:"ptr",middlewareSearch:searchMW,initialStates:f,isInbox:!1,EmptyResultInboxComp:"PTEmptyResultInbox"})}),l.createElement(t.PrivateRoute,{path:s+"/petservice/my-applications",component:e=>l.createElement(Ge,u({},e,{parentRoute:s}))}))))},$e=e=>{var n;let{status:o,searchParams:a,onAssignmentChange:r,statusMap:c}=e;return i.useTranslation(),l.createElement(t.CheckBox,{styles:{height:"unset"},onChange:e=>r(u({},e,{state:o.state}),o),checked:null==a?void 0:a.applicationStatus.some(e=>e.uuid===o.uuid),label:o.name+" ("+((null==c||null===(n=c.find(e=>e.statusid===o.uuid))||void 0===n?void 0:n.count)||"-")+")"})},Xe=e=>{var o,a,r,c,s;let{onAssignmentChange:d,searchParams:p,businessServices:v,statusMap:m}=e;const{t:f}=i.useTranslation(),[E,_]=n.useState(!1),{data:h,isLoading:g}=Digit.Hooks.useApplicationStatusGeneral({businessServices:v},{}),{userRoleStates:S}=h||{},y=(e,t)=>t(map[e.stateBusinessService])+" - "+t("ES_PTR_COMMON_STATUS_"+(e.state||"CREATED"));return g?l.createElement(t.Loader,null):null!=S&&S.filter(e=>!e.isTerminateState).length?l.createElement("div",{className:"status-container"},l.createElement("div",{className:"filter-label",style:{fontWeight:"normal"}},f("ES_INBOX_STATUS")),null==S||null===(o=S.filter(e=>!e.isTerminateState))||void 0===o||null===(a=o.slice(0,4))||void 0===a?void 0:a.map((e,t)=>l.createElement($e,{businessServices:v,key:t,onAssignmentChange:d,status:u({name:y(e,f),code:e.applicationStatus},e),searchParams:p,statusMap:m})),(null==S||null===(r=S.filter(e=>!e.isTerminateState))||void 0===r?void 0:r.slice(4).length)>0?l.createElement(l.Fragment,null,E&&(null==S||null===(c=S.filter(e=>!e.isTerminateState))||void 0===c||null===(s=c.slice(4))||void 0===s?void 0:s.map((e,t)=>l.createElement($e,{businessServices:v,key:e.uuid,onAssignmentChange:d,status:u({name:y(e,f),code:e.applicationStatus},e),searchParams:p,statusMap:m}))),l.createElement("div",{className:"filter-button",onClick:()=>_(!E)}," ",f(E?"ES_COMMON_LESS":"ES_COMMON_MORE")," ")):null):null},Ze=["searchParams","onFilterChange","defaultSearchParams","statusMap","moduleCode"],Je=e=>{var o;let{searchParams:a,onFilterChange:s,defaultSearchParams:d,statusMap:p,moduleCode:v}=e,m=c(e,Ze);const{t:f}=i.useTranslation(),E=r.useQueryClient(),[_,h]=n.useState(()=>u({},a,{services:[]})),g=[{label:"PTR_NEW_REGISTRATION",value:"ptr"}],S=e=>{let t=e.delete,n=u({},_,e);t&&t.forEach(e=>delete n[e]),delete e.delete,h(u({},n))},y=()=>{h(u({},d,{services:[]})),s(u({},d))},b=Digit.ULBService.getCurrentTenantId();return l.createElement(l.Fragment,null,l.createElement("div",{className:"filter"},l.createElement("div",{className:"filter-card"},l.createElement("div",{className:"heading",style:{alignItems:"center"}},l.createElement("div",{className:"filter-label",style:{display:"flex",alignItems:"center"}},l.createElement("span",null,l.createElement("svg",{width:"17",height:"17",viewBox:"0 0 22 22",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l.createElement("path",{d:"M0.66666 2.48016C3.35999 5.9335 8.33333 12.3335 8.33333 12.3335V20.3335C8.33333 21.0668 8.93333 21.6668 9.66666 21.6668H12.3333C13.0667 21.6668 13.6667 21.0668 13.6667 20.3335V12.3335C13.6667 12.3335 18.6267 5.9335 21.32 2.48016C22 1.60016 21.3733 0.333496 20.2667 0.333496H1.71999C0.613327 0.333496 -0.01334 1.60016 0.66666 2.48016Z",fill:"#505A5F"}))),l.createElement("span",{style:{marginLeft:"8px",fontWeight:"normal"}},f("ES_COMMON_FILTER_BY"),":")),l.createElement("div",{className:"clearAll",onClick:y},f("ES_COMMON_CLEAR_ALL")),"desktop"===m.type&&l.createElement("span",{className:"clear-search",onClick:y,style:{border:"1px solid #e0e0e0",padding:"6px"}},l.createElement("svg",{width:"17",height:"17",viewBox:"0 0 16 22",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l.createElement("path",{d:"M8 5V8L12 4L8 0V3C3.58 3 0 6.58 0 11C0 12.57 0.46 14.03 1.24 15.26L2.7 13.8C2.25 12.97 2 12.01 2 11C2 7.69 4.69 5 8 5ZM14.76 6.74L13.3 8.2C13.74 9.04 14 9.99 14 11C14 14.31 11.31 17 8 17V14L4 18L8 22V19C12.42 19 16 15.42 16 11C16 9.43 15.54 7.97 14.76 6.74Z",fill:"#505A5F"}))),"mobile"===m.type&&l.createElement("span",{onClick:m.onClose},l.createElement(t.CloseSvg,null))),l.createElement("div",null,l.createElement("div",null,l.createElement("div",{className:"filter-label",style:{fontWeight:"normal"}},f("ES_INBOX_LOCALITY"),":"),l.createElement(t.Localities,{selectLocality:e=>{S({locality:[...(null==_?void 0:_.locality)||[],e]})},tenantId:b,boundaryType:"revenue"}),l.createElement("div",{className:"tag-container"},null==_||null===(o=_.locality)||void 0===o?void 0:o.map((e,n)=>l.createElement(t.RemoveableTag,{key:n,text:f(e.i18nkey),onClick:()=>{S({locality:null==_?void 0:_.locality.filter(t=>t.code!==e.code)})}})))),l.createElement("div",null,l.createElement("div",{className:"filter-label",style:{fontWeight:"normal"}},f("ES_PTR_APP_TYPE")),g.map((e,n)=>{var i;const o=null==_||null===(i=_.services)||void 0===i?void 0:i.includes(e.value);return l.createElement(t.CheckBox,{key:n+"service",label:f(e.label),value:e.label,checked:o,onChange:t=>((e,t)=>{var n;S(e.target.checked?{services:Array.isArray(_.services)?[..._.services,t]:[t]}:{services:_.services.filter(e=>e!==t),applicationStatus:null===(n=_.applicationStatus)||void 0===n?void 0:n.filter(e=>e.stateBusinessService!==t)})})(t,e.value)})})),l.createElement("div",null,l.createElement(Xe,{searchParams:_,businessServices:_.services,statusMap:p||E.getQueryData("INBOX_STATUS_MAP_"+v),moduleCode:v,onAssignmentChange:(e,t)=>{if(e.target.checked)S({applicationStatus:[...null==_?void 0:_.applicationStatus,t]});else{let e=null==_?void 0:_.applicationStatus.filter(e=>e.state!==t.state);S({applicationStatus:e})}}})),l.createElement("div",null,l.createElement(t.SubmitBar,{onSubmit:()=>{s(0===_.services.length?u({},_,{services:g.map(e=>e.value)}):_)},label:f("ES_COMMON_APPLY")}))))))},Qe=e=>l.createElement("span",{className:"cell-text"},e),et=e=>l.createElement("span",{className:"sla-cell"},e),tt=e=>l.createElement("h1",{className:"heading-m"},e.label),nt=()=>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"})),lt=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(nt,null)),it=e=>{var i,o;let{t:a,action:r,tenantId:c,closeModal:s,submitAction:d,applicationData:p,businessService:v,moduleCode:m}=e;const{data:f,isLoading:E}=Digit.Hooks.useEmployeeSearch(c,{roles:null==r||null===(i=r.assigneeRoles)||void 0===i||null===(o=i.map)||void 0===o?void 0:o.call(i,e=>({code:e})),isActive:!0},{enabled:!(null!=r&&r.isTerminateState)}),{isLoading:_,data:h}=Digit.Hooks.pt.useMDMS(c,v,"FINANCIAL_YEARLS",{},{details:{tenantId:Digit.ULBService.getStateId(),moduleDetails:[{moduleName:"egf-master",masterDetails:[{name:"FinancialYear",filter:"[?(@.module == 'PT')]"}]}]}}),[g,S]=n.useState({}),[b,T]=n.useState({}),[A,C]=n.useState([]),[D,N]=n.useState(null),[P,R]=n.useState(null),[I,O]=n.useState(null),[x,w]=n.useState(null),[L,M]=n.useState([]),[k,F]=n.useState(null),[B,U]=n.useState(!1);function H(e){R(e.target.files[0])}return n.useEffect(()=>{if(h&&h["egf-master"]){var e;let t=function(e){var t;return null==e||null===(t=e["egf-master"])||void 0===t?void 0:t.FinancialYear.sort((e,t)=>t.startingDate-e.startingDate)}(h);console.log("datadatadata",t),M(null===(e=h["egf-master"])||void 0===e?void 0:e.FinancialYear)}},[h]),n.useEffect(()=>{var e;C(null==f||null===(e=f.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[f]),n.useEffect(()=>{!function(){try{w(null);const e=function(){if(P){const e=function(){if(P.size>=5242880)w(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=y(function(){return Promise.resolve(Digit.UploadServices.Filestorage("PT",P,Digit.ULBService.getStateId())).then(function(e){var t,n,l,i;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?O(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):w(a("CS_FILE_UPLOAD_ERROR"))})},function(){w(a("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[P]),n.useEffect(()=>{r&&S(null!=r&&r.showFinancialYearsModal?(e=>{let{t:n,action:i,financialYears:o,selectedFinancialYear:a,setSelectedFinancialYear:r}=e;return{label:{heading:"WF_"+i.action+"_APPLICATION",submit:"WF_PT.CREATE_"+i.action,cancel:"ES_PT_COMMON_CANCEL"},form:[{body:[{label:n("ES_PT_FINANCIAL_YEARS"),isMandatory:!0,type:"radio",populators:l.createElement(t.RadioButtons,{options:o,optionsKey:"name",onSelect:r,selectedOption:a})}]}]}})({t:a,action:r,financialYears:L,selectedFinancialYear:k,setSelectedFinancialYear:F}):(e=>{var n;let{t:i,action:o,approvers:a,selectedApprover:r,setSelectedApprover:u,selectFile:c,uploadedFile:s,setUploadedFile:d,assigneeLabel:p,businessService:v}=e;return{label:{heading:"WF_"+(null==o?void 0:o.action)+"_APPLICATION",submit:"WF_"+v+"_"+(null==o?void 0:o.action),cancel:"ES_PT_COMMON_CANCEL"},form:[{body:[{label:o.isTerminateState||"SENDBACKTOCITIZEN"===(null==o?void 0:o.action)?null:i(p||"WF_ROLE_"+(null===(n=o.assigneeRoles)||void 0===n?void 0:n[0])),type:"dropdown",populators:o.isTerminateState||"SENDBACKTOCITIZEN"===(null==o?void 0:o.action)?null:l.createElement(t.Dropdown,{option:a,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:u,selected:r})},{label:i("ES_PT_ACTION_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:i("ES_PT_ATTACH_FILE")+(o.docUploadRequired?" *":""),populators:l.createElement(t.UploadFile,{id:"workflow-doc",onUpload:c,onDelete:()=>{d(null)},showHint:!0,hintText:i("PT_ATTACH_RESTRICTIONS_SIZE"),message:s?"1 "+i("ES_PT_ACTION_FILEUPLOADED"):i("ES_PT_ACTION_NO_FILEUPLOADED")})}]}]}})({t:a,action:r,approvers:A,selectedApprover:D,setSelectedApprover:N,selectFile:H,uploadedFile:I,setUploadedFile:O,businessService:v}))},[r,A,L,k,I]),r&&g.form?l.createElement(t.Modal,{headerBarMain:l.createElement(tt,{label:a(g.label.heading)}),headerBarEnd:l.createElement(lt,{onClick:s}),actionCancelLabel:a(g.label.cancel),actionCancelOnSubmit:s,actionSaveLabel:a(g.label.submit),actionSaveOnSubmit:()=>{},isDisabled:r.showFinancialYearsModal?!k:E||(null==r?void 0:r.docUploadRequired)&&!I,formId:"modal-action"},_?l.createElement(t.Loader,null):l.createElement(t.FormComposer,{config:g.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){if("INACTIVE_PROPERTY"==(null==r?void 0:r.action)){let t={action:"OPEN",comment:null==e?void 0:e.comments,businessService:"PT.CREATE",moduleName:"PT"};p.creationReason="STATUS",d({customFunctionToExecute:null==r?void 0:r.customFunctionToExecute,Property:u({},p,{workflow:t})})}else if(null!=r&&r.showFinancialYearsModal)d({customFunctionToExecute:null==r?void 0:r.customFunctionToExecute,Assessment:{financialYear:null==k?void 0:k.name,propertyId:null==p?void 0:p.propertyId,tenantId:c,source:null==p?void 0:p.source,channel:null==p?void 0:p.channel,assessmentDate:Date.now()}});else{let t={action:null==r?void 0:r.action,comment:null==e?void 0:e.comments,businessService:v,moduleName:m};t.assignes=null!=r&&r.isTerminateState||!D?[]:[D],I&&(t.documents=[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==P?void 0:P.name,fileStoreId:I}]),d({Property:u({},p,{workflow:t})})}},defaultValues:b,formId:"modal-action"})):l.createElement(t.Loader,null)},ot=e=>l.createElement("h1",{className:"heading-m"},e.label),at=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),rt=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(at,null)),ut=e=>{var i,o;let{t:a,action:r,tenantId:c,closeModal:s,submitAction:d,applicationData:p,businessService:v}=e;const{data:m}=Digit.Hooks.useEmployeeSearch(c,{roles:null==r||null===(i=r.assigneeRoles)||void 0===i||null===(o=i.map)||void 0===o?void 0:o.call(i,e=>({code:e})),isActive:!0},{enabled:!(null!=r&&r.isTerminateState)}),{isLoading:f,data:E}=Digit.Hooks.pt.useMDMS(c,v,"FINANCIAL_YEARLS",{},{details:{tenantId:Digit.ULBService.getStateId(),moduleDetails:[{moduleName:"egf-master",masterDetails:[{name:"FinancialYear",filter:"[?(@.module == 'TL')]"}]}]}}),[_,h]=n.useState({}),[g,S]=n.useState({}),[b,T]=n.useState([]),[A,C]=n.useState({}),[D,N]=n.useState(null),[P,R]=n.useState(null),[I,O]=n.useState(null),[x,w]=n.useState([]),[L,M]=n.useState(null);function k(e){N(e.target.files[0])}return n.useEffect(()=>{var e;E&&E["egf-master"]&&w(null===(e=E["egf-master"])||void 0===e?void 0:e.FinancialYear)},[E]),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{O(null);const e=function(){if(D){const e=function(){if(D.size>=5242880)O(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=y(function(){return Promise.resolve(Digit.UploadServices.Filestorage("PT",D,Digit.ULBService.getStateId())).then(function(e){var t,n,l,i;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?R(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):O(a("CS_FILE_UPLOAD_ERROR"))})},function(){O(a("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[D]),n.useEffect(()=>{r&&h((e=>{let{t:n,action:i,approvers:o,selectedApprover:a,setSelectedApprover:r,selectFile:u,uploadedFile:c,setUploadedFile:s,businessService:d}=e,p=!0;return"SENDBACKTOCITIZEN"!=(null==i?void 0:i.action)&&"APPROVE"!=(null==i?void 0:i.action)||(p=!1),i.isTerminateState&&(p=!1),{label:{heading:"WF_"+(null==i?void 0:i.action)+"_APPLICATION",submit:"WF_"+(null==d?void 0:d.toUpperCase())+"_"+(null==i?void 0:i.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:o,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:r,selected:a}):null},{label:n("WF_COMMON_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:n("TL_APPROVAL_CHECKLIST_BUTTON_UP_FILE"),populators:l.createElement(t.UploadFile,{id:"workflow-doc",onUpload:u,onDelete:()=>{s(null)},message:c?"1 "+n("ES_PT_ACTION_FILEUPLOADED"):n("CS_ACTION_NO_FILEUPLOADED")})}]}]}})({t:a,action:r,approvers:b,selectedApprover:A,setSelectedApprover:C,selectFile:k,uploadedFile:P,setUploadedFile:R,businessService:v}))},[r,b,x,L,P]),r&&_.form?l.createElement(t.Modal,{headerBarMain:l.createElement(ot,{label:a(_.label.heading)}),headerBarEnd:l.createElement(rt,{onClick:s}),actionCancelLabel:a(_.label.cancel),actionCancelOnSubmit:s,actionSaveLabel:a(_.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},f?l.createElement(t.Loader,null):l.createElement(t.FormComposer,{config:_.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){p=u({},p,{action:null==r?void 0:r.action,comment:null==e?void 0:e.comments,assignee:null!=A&&A.uuid?[null==A?void 0:A.uuid]:null,wfDocuments:P?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==D?void 0:D.name,fileStoreId:P}]:null}),d({Licenses:[p]})},defaultValues:g,formId:"modal-action"})):l.createElement(t.Loader,null)},ct=e=>l.createElement("h1",{style:{marginLeft:"22px"},className:"heading-m BPAheading-m"},e.label),st=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),dt=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(st,null)),pt=e=>{var i,o;let{t:a,action:r,tenantId:c,closeModal:s,submitAction:d,applicationData:p,businessService:v}=e;const{data:m,isLoading:f}=Digit.Hooks.useEmployeeSearch(c,{roles:null==r||null===(i=r.assigneeRoles)||void 0===i||null===(o=i.map)||void 0===o?void 0:o.call(i,e=>({code:e})),isActive:!0},{enabled:!(null!=r&&r.isTerminateState)}),[E,_]=n.useState({}),[h,g]=n.useState({}),[S,b]=n.useState([]),[T,A]=n.useState({}),[C,D]=n.useState(null),[N,P]=n.useState(null),[R,I]=n.useState(null),O=!!Digit.Utils.browser.isMobile();function x(e){D(e.target.files[0])}return n.useEffect(()=>{var e;b(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(C){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(C.size>=5242880)I(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=C&&C.type&&!e.test(null==C?void 0:C.type))I(a("NOT_SUPPORTED_FILE_TYPE"));else{const e=y(function(){return Promise.resolve(Digit.UploadServices.Filestorage("OBPS",C,Digit.ULBService.getStateId()||(null==c?void 0:c.split(".")[0]))).then(function(e){var t,n,l,i;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?P(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):I(a("CS_FILE_UPLOAD_ERROR"))})},function(){I(a("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[C]),n.useEffect(()=>{r&&_((e=>{let{t:n,action:i,approvers:o,selectedApprover:a,setSelectedApprover:r,selectFile:u,uploadedFile:c,setUploadedFile:s,businessService:d,error:p}=e,v=!0;return"SENDBACKTOCITIZEN"==(null==i?void 0:i.action)&&(v=!1),i.isTerminateState&&(v=!1),{label:{heading:"WF_"+(null==i?void 0:i.action)+"_APPLICATION",submit:"WF_"+(null==d?void 0:d.toUpperCase())+"_"+(null==i?void 0:i.action),cancel:"WF_EMPLOYEE_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:o,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:r,selected:a}):null},{label:n("WF_COMMON_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:n("BPA_APPROVAL_CHECKLIST_BUTTON_UP_FILE"),populators:l.createElement(t.UploadFile,{id:"workflow-doc",onUpload:u,onDelete:()=>{s(null)},message:c?"1 "+n("ES_PT_ACTION_FILEUPLOADED"):n("CS_ACTION_NO_FILEUPLOADED"),accept:"image/*, .pdf, .png, .jpeg, .jpg",iserror:p})}]}]}})({t:a,action:r,approvers:S,selectedApprover:T,setSelectedApprover:A,selectFile:x,uploadedFile:N,setUploadedFile:P,businessService:v,error:R}))},[r,S,N,R]),r&&E.form?l.createElement(t.Modal,{headerBarMain:l.createElement(ct,{label:a(E.label.heading)}),headerBarEnd:l.createElement(dt,{onClick:s}),actionCancelLabel:a(E.label.cancel),actionCancelOnSubmit:s,actionSaveLabel:a(E.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action",isOBPSFlow:!0,popupStyles:O?{width:"720px"}:{},style:O?{height:"45px",width:"44%"}:{height:"45px",width:"107px",paddingLeft:"0px",paddingRight:"0px"},popupModuleMianStyles:O?{paddingLeft:"5px"}:{}},f?l.createElement(t.Loader,null):l.createElement(t.FormComposer,{config:E.form,cardStyle:{marginLeft:"0px",marginRight:"0px",marginTop:"-25px"},className:"BPAemployeeCard",noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){p=u({},p,{action:null==r?void 0:r.action,comment:null==e?void 0:e.comments,assignee:null!=T&&T.uuid?[null==T?void 0:T.uuid]:null,wfDocuments:N?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==C?void 0:C.name,fileStoreId:N}]:null}),d({Licenses:[p]},!1,{isStakeholder:!0,bpa:!1})},defaultValues:h,formId:"modal-action"})):l.createElement(t.Loader,null)},vt=e=>l.createElement("h1",{style:{marginLeft:"22px"},className:"heading-m BPAheading-m"},e.label),mt=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),ft=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(mt,null)),Et=e=>{var i,o,a,c,s,d,p,v,m,f,E,_;let{t:h,action:g,tenantId:S,closeModal:b,submitAction:T,applicationDetails:A,applicationData:C,businessService:D,workflowDetails:N}=e;Digit.Hooks.obps.useObpsAPI(null!==(i=C)&&void 0!==i&&null!==(o=i.landInfo)&&void 0!==o&&null!==(a=o.address)&&void 0!==a&&a.city?null===(c=C)||void 0===c||null===(s=c.landInfo)||void 0===s||null===(d=s.address)||void 0===d?void 0:d.city:S,!1);const{data:P,isLoading:R}=Digit.Hooks.useEmployeeSearch(S,{roles:null==N||null===(p=N.data)||void 0===p||null===(v=p.initialActionState)||void 0===v||null===(m=v.nextActions)||void 0===m||null===(f=m.filter(e=>(null==e?void 0:e.action)==(null==g?void 0:g.action)))||void 0===f||null===(E=f[0])||void 0===E||null===(_=E.assigneeRoles)||void 0===_?void 0:_.map(e=>({code:e})),isActive:!0},{enabled:!(null!=g&&g.isTerminateState)}),[I,O]=(r.useQueryClient(),n.useState({})),[x,w]=n.useState({}),[L,M]=n.useState([]),[k,F]=n.useState({}),[B,U]=n.useState(null),[H,j]=n.useState(null),[W,z]=n.useState(null),[V,K]=n.useState(null),Y=!!Digit.Utils.browser.isMobile();function G(e){U(e.target.files[0])}n.useEffect(()=>{var e;M(null==P||null===(e=P.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[P]),n.useEffect(()=>{!function(){try{z(null);const e=function(){if(B){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(B.size>=5242880)z(h("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=B&&B.type&&!e.test(null==B?void 0:B.type))z(h("NOT_SUPPORTED_FILE_TYPE"));else{const e=y(function(){return Promise.resolve(Digit.UploadServices.Filestorage("OBPS",B,Digit.ULBService.getStateId()||(null==S?void 0:S.split(".")[0]))).then(function(e){var t,n,l,i;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?j(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):z(h("CS_FILE_UPLOAD_ERROR"))})},function(){z(h("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[B]);const q=e=>{let t=[];return e&&e.map((e,n)=>{t.push({documentType:(e.documentType+"_"+e.documentType.split("_")[1]).replaceAll("_","."),fileStoreId:e.fileStoreId,fileStore:e.fileStoreId,fileName:"",dropDownValues:{value:(e.documentType+"_"+e.documentType.split("_")[1]).replaceAll("_",".")}})}),t},$=e=>{let t=[];var n;for(n=0;n<(null==e?void 0:e.questionLength);n++){var l;t.push({remarks:e["Remarks_"+n],question:null==e?void 0:e.questionList[n].question,value:null==e||null===(l=e["question_"+n])||void 0===l?void 0:l.code})}return t},X=e=>{var t,n;let l=[],i=[];var o,a;return(null==e||null===(t=e.additionalDetails)||void 0===t||null===(n=t.fieldinspection_pending)||void 0===n?void 0:n.length)>0&&(i=null==e||null===(o=e.additionalDetails)||void 0===o?void 0:o.fieldinspection_pending),"FIELDINSPECTION_INPROGRESS"==e.status?(l=JSON.parse(sessionStorage.getItem("INSPECTION_DATA")),(null===(a=l)||void 0===a?void 0:a.length)>0&&l.map((e,t)=>{i.push({docs:q(e.Documents),date:e.InspectionDate,questions:$(e),time:null==e?void 0:e.InspectionTime})}),i=i.filter(e=>e.docs&&e.docs.length>0)):sessionStorage.removeItem("INSPECTION_DATA"),[...i]},Z=e=>{let t=JSON.parse(sessionStorage.getItem("BPA_DOCUMENTS")),n=[];return t.map(e=>{var t,l,i,o,a,r;(null==e||null===(t=e.uploadedDocuments)||void 0===t||null===(l=t[0])||void 0===l||null===(i=l.values)||void 0===i?void 0:i.length)>0&&(n=[...n,...null==e||null===(o=e.uploadedDocuments)||void 0===o||null===(a=o[0])||void 0===a?void 0:a.values]),(null==e||null===(r=e.newUploadedDocs)||void 0===r?void 0:r.length)>0&&(n=[...n,...null==e?void 0:e.newUploadedDocs])}),n},J=()=>{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(()=>{g&&O((e=>{var n;let{t:i,action:o,approvers:a,selectedApprover:r,setSelectedApprover:u,selectFile:c,uploadedFile:s,setUploadedFile:d,assigneeLabel:p,businessService:v,error:m}=e,f=!1;return"REVOCATE"!=(null==o?void 0:o.action)&&"REJECT"!=(null==o?void 0:o.action)&&"SKIP_PAYMENT"!=o.action&&"SEND_BACK_TO_CITIZEN"!=(null==o?void 0:o.action)&&"APPROVE"!=(null==o?void 0:o.action)||(f=!0),{label:{heading:"WF_"+(null==o?void 0:o.action)+"_APPLICATION",submit:"WF_"+v+"_"+(null==o?void 0:o.action),cancel:"BPA_CITIZEN_CANCEL_BUTTON"},form:[{body:[{label:o.isTerminateState||f?null:i(p||"WF_ROLE_"+(null===(n=o.assigneeRoles)||void 0===n?void 0:n[0])),type:"dropdown",populators:o.isTerminateState||f?null:l.createElement(t.Dropdown,{option:a,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:u,selected:r})},{label:i("WF_COMMON_COMMENTS"),type:"textarea",isMandatory:!0,populators:{name:"comments"}},{label:""+i("WF_APPROVAL_UPLOAD_HEAD"),populators:l.createElement(t.UploadFile,{id:"workflow-doc",onUpload:c,onDelete:()=>{d(null)},message:s?"1 "+i("ES_PT_ACTION_FILEUPLOADED"):i("CS_ACTION_NO_FILEUPLOADED"),accept:"image/*, .pdf, .png, .jpeg, .jpg",iserror:m})}]}]}})({t:h,action:g,approvers:L,selectedApprover:k,setSelectedApprover:F,selectFile:G,uploadedFile:H,setUploadedFile:j,businessService:D,assigneeLabel:"WF_ASSIGNEE_NAME_LABEL",error:W}))},[g,L,V,H,W]),g&&I.form?l.createElement(t.Modal,{headerBarMain:l.createElement(vt,{label:h(I.label.heading)}),headerBarEnd:l.createElement(ft,{onClick:b}),actionCancelLabel:h(I.label.cancel),actionCancelOnSubmit:b,actionSaveLabel:h(I.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action",isOBPSFlow:!0,popupStyles:Y?{width:"720px"}:{},style:Y?{minHeight:"45px",height:"auto",width:"44%"}:{minHeight:"45px",height:"auto",width:"107px",paddingLeft:"0px",paddingRight:"0px"},popupModuleMianStyles:Y?{paddingLeft:"5px"}:{}},R?l.createElement(t.Loader,null):l.createElement(t.FormComposer,{config:I.form,cardStyle:{marginLeft:"0px",marginRight:"0px",marginTop:"-25px"},className:"BPAemployeeCard",noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){try{var t,n,l,i,o,a;C=u({},C,{documents:Z(),additionalDetails:u({},null===(t=C)||void 0===t?void 0:t.additionalDetails,{fieldinspection_pending:X(C),pendingapproval:J()}),workflow:{action:null==g?void 0:g.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!=k&&k.uuid?[null==k?void 0:k.uuid]:null,assignes:null!=k&&k.uuid?[null==k?void 0:k.uuid]:null,varificationDocuments:H?[{documentType:(null==g?void 0:g.action)+" DOC",fileName:null==B?void 0:B.name,fileStoreId:H}]:null},action:null==g?void 0:g.action,comment:null==e?void 0:e.comments,assignee:null!=k&&k.uuid?[null==k?void 0:k.uuid]:null,wfDocuments:H?[{documentType:(null==g?void 0:g.action)+" DOC",fileName:null==B?void 0:B.name,fileStoreId:H}]:null});const r=null==A||null===(i=A.nocData)||void 0===i?void 0:i.map(e=>{const t=Digit.SessionStorage.get(null==e?void 0:e.nocType)||[];return{Noc:u({},e,{documents:[...null!=e&&e.documents?null==e?void 0:e.documents:[],...t||[]]})}});let c={sourceRefId:null==r||null===(o=r[0])||void 0===o||null===(a=o.Noc)||void 0===a?void 0:a.sourceRefId};return Promise.resolve(Digit.NOCSearch.all(S,c)).then(function(e){var t;let n=!0,l=!0;null==e||null===(t=e.Noc)||void 0===t||t.map(e=>{var t,i,o,a,r;"APPROVED"!==(null==e||null===(t=e.applicationStatus)||void 0===t?void 0:t.toUpperCase())&&"AUTO_APPROVED"!==(null==e||null===(i=e.applicationStatus)||void 0===i?void 0:i.toUpperCase())&&"REJECTED"!==(null==e||null===(o=e.applicationStatus)||void 0===o?void 0:o.toUpperCase())&&"AUTO_REJECTED"!==(null==e||null===(a=e.applicationStatus)||void 0===a?void 0:a.toUpperCase())&&"VOIDED"!==(null==e||null===(r=e.applicationStatus)||void 0===r?void 0:r.toUpperCase())||1!=n&&1!=l||("AIRPORT_AUTHORITY"===(null==e?void 0:e.nocType)?n=!1:"FIRE_NOC"===(null==e?void 0:e.nocType)&&(l=!1))});let i=[];r&&r.map(e=>{var t,o,a,r,u,c,s,d,p,v,m,f;("APPROVED"!=(null==e||null===(t=e.Noc)||void 0===t||null===(o=t.applicationStatus)||void 0===o?void 0:o.toUpperCase())&&"AUTO_APPROVED"!=(null==e||null===(a=e.Noc)||void 0===a||null===(r=a.applicationStatus)||void 0===r?void 0:r.toUpperCase())&&"REJECTED"!=(null==e||null===(u=e.Noc)||void 0===u||null===(c=u.applicationStatus)||void 0===c?void 0:c.toUpperCase())&&"AUTO_REJECTED"!=(null==e||null===(s=e.Noc)||void 0===s||null===(d=s.applicationStatus)||void 0===d?void 0:d.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)&&i.push(e)}),T({BPA:C},(null==i?void 0:i.length)>0&&i,{isStakeholder:!1,bpa:!0})})}catch(e){return Promise.reject(e)}},defaultValues:x,formId:"modal-action"})):l.createElement(t.Loader,null)},_t=e=>l.createElement("h1",{style:{marginLeft:"22px"},className:"heading-m BPAheading-m"},e.label),ht=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),gt=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(ht,null)),St=e=>{var i,a;let{t:c,action:s,tenantId:d,closeModal:p,submitAction:v,applicationData:m,businessService:f}=e;const{data:E,isLoading:_}=Digit.Hooks.useEmployeeSearch(d,{roles:null==s||null===(i=s.assigneeRoles)||void 0===i||null===(a=i.map)||void 0===a?void 0:a.call(i,e=>({code:e})),isActive:!0},{enabled:!(null!=s&&s.isTerminateState)}),[h,g]=(r.useQueryClient(),n.useState({})),[S,b]=n.useState({}),[T,A]=n.useState([]),[C,D]=n.useState({}),[N,P]=n.useState(null),[R,I]=n.useState(null),[O,x]=n.useState(null),w=!!Digit.Utils.browser.isMobile();function L(e){P(e.target.files[0])}return o.useHistory(),n.useEffect(()=>{var e;A(null==E||null===(e=E.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[E]),n.useEffect(()=>{!function(){try{x(null);const e=function(){if(N){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(N.size>=5242880)x(c("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=N&&N.type&&!e.test(null==N?void 0:N.type))x(c("NOT_SUPPORTED_FILE_TYPE"));else{const e=y(function(){return Promise.resolve(Digit.UploadServices.Filestorage("NOC",N,Digit.ULBService.getStateId()||(null==d?void 0:d.split(".")[0]))).then(function(e){var t,n,l,i;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?I(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):x(c("CS_FILE_UPLOAD_ERROR"))})},function(){x(c("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[N]),n.useEffect(()=>{s&&g((e=>{var n;let{t:i,action:o,approvers:a,selectedApprover:r,setSelectedApprover:u,selectFile:c,uploadedFile:s,setUploadedFile:d,assigneeLabel:p,businessService:v,error:m}=e,f=!1;"REVOCATE"!=(null==o?void 0:o.action)&&"REJECT"!=(null==o?void 0:o.action)||(f=!0);let E=!1;return"APPROVE"!=(null==o?void 0:o.action)&&"REJECT"!=(null==o?void 0:o.action)&&"AUTO_APPROVE"!=o.action&&"AUTO_REJECT"!=o.action||(E=!0),{label:{heading:"WF_"+(null==o?void 0:o.action)+"_APPLICATION",submit:"WF_"+v+"_"+(null==o?void 0:o.action),cancel:"CORE_LOGOUTPOPUP_CANCEL"},form:[{body:[{label:o.isTerminateState||E?null:i(p||"WF_ROLE_"+(null===(n=o.assigneeRoles)||void 0===n?void 0:n[0])),type:"dropdown",populators:o.isTerminateState||E?null:l.createElement(t.Dropdown,{option:a,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:u,selected:r})},{label:i("WF_COMMON_COMMENTS"),type:"textarea",isMandatory:f,populators:{name:"comments"}},{label:""+i("WF_APPROVAL_UPLOAD_HEAD"),populators:l.createElement(t.UploadFile,{id:"workflow-doc",onUpload:c,onDelete:()=>{d(null)},showHint:!0,message:s?"1 "+i("ES_PT_ACTION_FILEUPLOADED"):i("CS_ACTION_NO_FILEUPLOADED"),accept:"image/*, .pdf, .png, .jpeg, .jpg",iserror:m})}]}]}})({t:c,action:s,approvers:T,selectedApprover:C,setSelectedApprover:D,selectFile:L,uploadedFile:R,setUploadedFile:I,businessService:f,assigneeLabel:"WF_ASSIGNEE_NAME_LABEL",error:O}))},[s,T,R,O]),s&&h.form?l.createElement(t.Modal,{headerBarMain:l.createElement(_t,{label:c(h.label.heading)}),headerBarEnd:l.createElement(gt,{onClick:p}),actionCancelLabel:c(h.label.cancel),actionCancelOnSubmit:p,actionSaveLabel:c(h.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"}:{}},_?l.createElement(t.Loader,null):l.createElement(t.FormComposer,{config:h.form,cardStyle:{marginLeft:"0px",marginRight:"0px",marginTop:"-25px"},className:"BPAemployeeCard",noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){var t,n,l;let i=JSON.parse(sessionStorage.getItem("NewNOCDocs")),o=(null===(t=m)||void 0===t||null===(n=t.documents)||void 0===n?void 0:n.length)>0?[...null===(l=m)||void 0===l?void 0:l.documents]:[];i.map((e,t)=>{o.push(e)}),m=u({},m,{workflow:{action:null==s?void 0:s.action,comment:null!=e&&e.comments?null==e?void 0:e.comments:null,assignee:null!=C&&C.uuid?[null==C?void 0:C.uuid]:null,documents:R?[{documentType:(null==s?void 0:s.action)+" DOC",fileName:null==N?void 0:N.name,fileStoreId:R}]:null},documents:o}),v({Noc:m},!1,{isNoc:!0})},defaultValues:S,formId:"modal-action"})):l.createElement(t.Loader,null)};function yt(e){var t=this.__data__=new he(e);this.size=t.size}yt.prototype.clear=function(){this.__data__=new he,this.size=0},yt.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},yt.prototype.get=function(e){return this.__data__.get(e)},yt.prototype.has=function(e){return this.__data__.has(e)},yt.prototype.set=function(e,t){var n=this.__data__;if(n instanceof he){var l=n.__data__;if(!ge||l.length<199)return l.push([e,t]),this.size=++n.size,this;n=this.__data__=new be(l)}return n.set(e,t),this.size=n.size,this};var bt=yt,Tt=function(){try{var e=ue(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),At=function(e,t,n){"__proto__"==t&&Tt?Tt(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n},Ct=Object.prototype.hasOwnProperty,Dt=function(e,t,n){var l=e[t];Ct.call(e,t)&&me(l,n)&&(void 0!==n||t in e)||At(e,t,n)},Nt=function(e,t,n,l){var i=!n;n||(n={});for(var o=-1,a=t.length;++o<a;){var r=t[o],u=l?l(n[r],e[r],r,n,e):void 0;void 0===u&&(u=e[r]),i?At(n,r,u):Dt(n,r,u)}return n},Pt=function(e){return X(e)&&"[object Arguments]"==$(e)},Rt=Object.prototype,It=Rt.hasOwnProperty,Ot=Rt.propertyIsEnumerable,xt=Pt(function(){return arguments}())?Pt:function(e){return X(e)&&It.call(e,"callee")&&!Ot.call(e,"callee")},wt=function(){return!1},Lt=v(function(e,t){var n=t&&!t.nodeType&&t,l=n&&e&&!e.nodeType&&e,i=l&&l.exports===n?j.Buffer:void 0;e.exports=(i?i.isBuffer:void 0)||wt}),Mt=/^(?:0|[1-9]\d*)$/,kt=function(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&Mt.test(e))&&e>-1&&e%1==0&&e<t},Ft=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991},Bt={};Bt["[object Float32Array]"]=Bt["[object Float64Array]"]=Bt["[object Int8Array]"]=Bt["[object Int16Array]"]=Bt["[object Int32Array]"]=Bt["[object Uint8Array]"]=Bt["[object Uint8ClampedArray]"]=Bt["[object Uint16Array]"]=Bt["[object Uint32Array]"]=!0,Bt["[object Arguments]"]=Bt["[object Array]"]=Bt["[object ArrayBuffer]"]=Bt["[object Boolean]"]=Bt["[object DataView]"]=Bt["[object Date]"]=Bt["[object Error]"]=Bt["[object Function]"]=Bt["[object Map]"]=Bt["[object Number]"]=Bt["[object Object]"]=Bt["[object RegExp]"]=Bt["[object Set]"]=Bt["[object String]"]=Bt["[object WeakMap]"]=!1;var Ut=function(e){return function(t){return e(t)}},Ht=v(function(e,t){var n=t&&!t.nodeType&&t,l=n&&e&&!e.nodeType&&e,i=l&&l.exports===n&&U.process,o=function(){try{return l&&l.require&&l.require("util").types||i&&i.binding&&i.binding("util")}catch(e){}}();e.exports=o}),jt=Ht&&Ht.isTypedArray,Wt=jt?Ut(jt):function(e){return X(e)&&Ft(e.length)&&!!Bt[$(e)]},zt=Object.prototype.hasOwnProperty,Vt=function(e,t){var n=B(e),l=!n&&xt(e),i=!n&&!l&&Lt(e),o=!n&&!l&&!i&&Wt(e),a=n||l||i||o,r=a?function(e,t){for(var n=-1,l=Array(e);++n<e;)l[n]=t(n);return l}(e.length,String):[],u=r.length;for(var c in e)!t&&!zt.call(e,c)||a&&("length"==c||i&&("offset"==c||"parent"==c)||o&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||kt(c,u))||r.push(c);return r},Kt=Object.prototype,Yt=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Kt)},Gt=function(e,t){return function(n){return e(t(n))}},qt=Gt(Object.keys,Object),$t=Object.prototype.hasOwnProperty,Xt=function(e){return null!=e&&Ft(e.length)&&!te(e)},Zt=function(e){return Xt(e)?Vt(e):function(e){if(!Yt(e))return qt(e);var t=[];for(var n in Object(e))$t.call(e,n)&&"constructor"!=n&&t.push(n);return t}(e)},Jt=Object.prototype.hasOwnProperty,Qt=function(e){return Xt(e)?Vt(e,!0):function(e){if(!ee(e))return function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}(e);var t=Yt(e),n=[];for(var l in e)("constructor"!=l||!t&&Jt.call(e,l))&&n.push(l);return n}(e)},en=v(function(e,t){var n=t&&!t.nodeType&&t,l=n&&e&&!e.nodeType&&e,i=l&&l.exports===n?j.Buffer:void 0,o=i?i.allocUnsafe:void 0;e.exports=function(e,t){if(t)return e.slice();var n=e.length,l=o?o(n):new e.constructor(n);return e.copy(l),l}}),tn=function(){return[]},nn=Object.prototype.propertyIsEnumerable,ln=Object.getOwnPropertySymbols,on=ln?function(e){return null==e?[]:(e=Object(e),function(t,n){for(var l=-1,i=null==t?0:t.length,o=0,a=[];++l<i;){var r=t[l];nn.call(e,r)&&(a[o++]=r)}return a}(ln(e)))}:tn,an=function(e,t){for(var n=-1,l=t.length,i=e.length;++n<l;)e[i+n]=t[n];return e},rn=Gt(Object.getPrototypeOf,Object),un=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)an(t,on(e)),e=rn(e);return t}:tn,cn=function(e,t,n){var l=t(e);return B(e)?l:an(l,n(e))},sn=function(e){return cn(e,Zt,on)},dn=function(e){return cn(e,Qt,un)},pn=ue(j,"DataView"),vn=ue(j,"Promise"),mn=ue(j,"Set"),fn=ue(j,"WeakMap"),En=oe(pn),_n=oe(ge),hn=oe(vn),gn=oe(mn),Sn=oe(fn),yn=$;(pn&&"[object DataView]"!=yn(new pn(new ArrayBuffer(1)))||ge&&"[object Map]"!=yn(new ge)||vn&&"[object Promise]"!=yn(vn.resolve())||mn&&"[object Set]"!=yn(new mn)||fn&&"[object WeakMap]"!=yn(new fn))&&(yn=function(e){var t=$(e),n="[object Object]"==t?e.constructor:void 0,l=n?oe(n):"";if(l)switch(l){case En:return"[object DataView]";case _n:return"[object Map]";case hn:return"[object Promise]";case gn:return"[object Set]";case Sn:return"[object WeakMap]"}return t});var bn=yn,Tn=Object.prototype.hasOwnProperty,An=j.Uint8Array,Cn=function(e){var t=new e.constructor(e.byteLength);return new An(t).set(new An(e)),t},Dn=/\w*$/,Nn=W?W.prototype:void 0,Pn=Nn?Nn.valueOf:void 0,Rn=Object.create,In=function(){function e(){}return function(t){if(!ee(t))return{};if(Rn)return Rn(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}(),On=Ht&&Ht.isMap,xn=On?Ut(On):function(e){return X(e)&&"[object Map]"==bn(e)},wn=Ht&&Ht.isSet,Ln=wn?Ut(wn):function(e){return X(e)&&"[object Set]"==bn(e)},Mn={};Mn["[object Arguments]"]=Mn["[object Array]"]=Mn["[object ArrayBuffer]"]=Mn["[object DataView]"]=Mn["[object Boolean]"]=Mn["[object Date]"]=Mn["[object Float32Array]"]=Mn["[object Float64Array]"]=Mn["[object Int8Array]"]=Mn["[object Int16Array]"]=Mn["[object Int32Array]"]=Mn["[object Map]"]=Mn["[object Number]"]=Mn["[object Object]"]=Mn["[object RegExp]"]=Mn["[object Set]"]=Mn["[object String]"]=Mn["[object Symbol]"]=Mn["[object Uint8Array]"]=Mn["[object Uint8ClampedArray]"]=Mn["[object Uint16Array]"]=Mn["[object Uint32Array]"]=!0,Mn["[object Error]"]=Mn["[object Function]"]=Mn["[object WeakMap]"]=!1;var kn=function e(t,n,l,i,o,a){var r,u=1&n,c=2&n,s=4&n;if(l&&(r=o?l(t,i,o,a):l(t)),void 0!==r)return r;if(!ee(t))return t;var d=B(t);if(d){if(r=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&Tn.call(e,"index")&&(n.index=e.index,n.input=e.input),n}(t),!u)return function(e,t){var n=-1,l=e.length;for(t||(t=Array(l));++n<l;)t[n]=e[n];return t}(t,r)}else{var p=bn(t),v="[object Function]"==p||"[object GeneratorFunction]"==p;if(Lt(t))return en(t,u);if("[object Object]"==p||"[object Arguments]"==p||v&&!o){if(r=c||v?{}:function(e){return"function"!=typeof e.constructor||Yt(e)?{}:In(rn(e))}(t),!u)return c?function(e,t){return Nt(e,un(e),t)}(t,function(e,t){return e&&Nt(t,Qt(t),e)}(r,t)):function(e,t){return Nt(e,on(e),t)}(t,function(e,t){return e&&Nt(t,Zt(t),e)}(r,t))}else{if(!Mn[p])return o?t:{};r=function(e,t,n){var l=e.constructor;switch(t){case"[object ArrayBuffer]":return Cn(e);case"[object Boolean]":case"[object Date]":return new l(+e);case"[object DataView]":return function(e,t){var n=t?Cn(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?Cn(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}(e,n);case"[object Map]":return new l;case"[object Number]":case"[object String]":return new l(e);case"[object RegExp]":return function(e){var t=new e.constructor(e.source,Dn.exec(e));return t.lastIndex=e.lastIndex,t}(e);case"[object Set]":return new l;case"[object Symbol]":return Pn?Object(Pn.call(e)):{}}}(t,p,u)}}a||(a=new bt);var m=a.get(t);if(m)return m;a.set(t,r),Ln(t)?t.forEach(function(i){r.add(e(i,n,l,i,t,a))}):xn(t)&&t.forEach(function(i,o){r.set(o,e(i,n,l,o,t,a))});var f=d?void 0:(s?c?dn:sn:c?Qt:Zt)(t);return function(e,t){for(var n=-1,l=null==e?0:e.length;++n<l&&!1!==t(e[n],n););}(f||t,function(i,o){f&&(i=t[o=i]),Dt(r,o,e(i,n,l,o,t,a))}),r},Fn=function(e){return kn(e,5)};const Bn=e=>l.createElement("h1",{className:"heading-m"},e.label),Un=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),Hn=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(Un,null)),jn=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}},Wn=e=>{var i,o;let{t:a,action:r,tenantId:c,closeModal:s,submitAction:d,applicationData:p,businessService:v}=e;const{data:m,isLoading:f}=Digit.Hooks.useEmployeeSearch(c,{roles:null==r||null===(i=r.assigneeRoles)||void 0===i||null===(o=i.map)||void 0===o?void 0:o.call(i,e=>({code:e})),isActive:!0},{enabled:!(null!=r&&r.isTerminateState)}),[E,_]=n.useState({}),[h,g]=n.useState({}),[S,b]=n.useState([]),[T,A]=n.useState({}),[C,D]=n.useState(null),[N,P]=n.useState(null),[R,I]=n.useState(null),O=window.Digit.Utils.browser.isMobile(),x=window.location.href.includes("/employee");function w(e){D(e.target.files[0])}return n.useEffect(()=>{var e;b(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(C){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(C.size>=5242880)I(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=C&&C.type&&!e.test(null==C?void 0:C.type))I(a("NOT_SUPPORTED_FILE_TYPE"));else{const e=y(function(){return Promise.resolve(Digit.UploadServices.Filestorage("WS",C,Digit.ULBService.getCurrentTenantId())).then(function(e){var t,n,l,i;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?P(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):I(a("CS_FILE_UPLOAD_ERROR"))})},function(e){console.error("Modal -> err ",e),I(a("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[C]),n.useEffect(()=>{var e,n,i,o;"DisconnectWSConnection"==(null===(e=p)||void 0===e||null===(n=e.processInstance)||void 0===n?void 0:n.businessService)||"DisconnectSWConnection"==(null===(i=p)||void 0===i||null===(o=i.processInstance)||void 0===o?void 0:o.businessService)?r&&_((e=>{var n;let{t:i,action:o,approvers:a,selectedApprover:r,setSelectedApprover:c,selectFile:s,uploadedFile:d,setUploadedFile:p,businessService:v,error:m}=e,f=!0,E=!1;return(null!=o&&null!==(n=o.action)&&void 0!==n&&n.includes("SEND_BACK")||"APPROVE_FOR_DISCONNECTION"==(null==o?void 0:o.action)||"RESUBMIT_APPLICATION"==(null==o?void 0:o.action))&&(f=!1),o.isTerminateState&&(f=!1),"EXECUTE_DISCONNECTION"!=(null==o?void 0:o.action)&&"DISCONNECTION_EXECUTED"!=(null==o?void 0:o.action)||(E=!0),{label:{heading:"WF_"+(null==o?void 0:o.action)+"_APPLICATION",submit:"WF_"+(null==v?void 0:v.toUpperCase())+"_"+(null==o?void 0:o.action),cancel:"CS_COMMON_CANCEL"},form:[{body:[{label:f?i("WF_ASSIGNEE_NAME_LABEL"):null,placeholder:f?i("WF_ASSIGNEE_NAME_PLACEHOLDER"):null,type:"dropdown",populators:f?l.createElement(t.Dropdown,{option:a,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:c,selected:r}):null},E&&{label:i("ES_FSM_ACTION_SERVICE_DATE"),isMandatory:!!E,type:"custom",populators:E?{name:"date",validation:{required:!0},defaultValue:Digit.Utils.date.getDate(),component:(e,n)=>l.createElement(t.DatePicker,u({onChange:e.onChange,date:e.value},n))}:null},{label:i("WF_COMMON_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:i("WS_APPROVAL_CHECKLIST_BUTTON_UP_FILE"),populators:l.createElement(t.UploadFile,{id:"workflow-doc",accept:".jpg,.pdf,.png,.jpeg",onUpload:s,onDelete:()=>{p(null)},message:d?"1 "+i("ES_PT_ACTION_FILEUPLOADED"):i("CS_ACTION_NO_FILEUPLOADED"),error:m,iserror:m,showHintBelow:!0,hintText:"WS_HINT_TEXT_LABEL"})}]}]}})({t:a,action:r,approvers:S,selectedApprover:T,setSelectedApprover:A,selectFile:w,uploadedFile:N,setUploadedFile:P,businessService:v,error:R})):r&&_((e=>{var n;let{t:i,action:o,approvers:a,selectedApprover:r,setSelectedApprover:u,selectFile:c,uploadedFile:s,setUploadedFile:d,businessService:p,error:v}=e,m=!0;return(null!=o&&null!==(n=o.action)&&void 0!==n&&n.includes("SEND_BACK")||"APPROVE_FOR_CONNECTION"==(null==o?void 0:o.action))&&(m=!1),o.isTerminateState&&(m=!1),{label:{heading:"WF_"+(null==o?void 0:o.action)+"_APPLICATION",submit:"WF_"+(null==p?void 0:p.toUpperCase())+"_"+(null==o?void 0:o.action),cancel:"CS_COMMON_CANCEL"},form:[{body:[{label:m?i("WF_ASSIGNEE_NAME_LABEL"):null,placeholder:m?i("WF_ASSIGNEE_NAME_PLACEHOLDER"):null,type:"dropdown",populators:m?l.createElement(t.Dropdown,{option:a,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:u,selected:r}):null},{label:i("WF_COMMON_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:i("WS_APPROVAL_CHECKLIST_BUTTON_UP_FILE"),populators:l.createElement(t.UploadFile,{id:"workflow-doc",accept:".jpg,.pdf,.png,.jpeg",onUpload:c,onDelete:()=>{d(null)},message:s?"1 "+i("ES_PT_ACTION_FILEUPLOADED"):i("CS_ACTION_NO_FILEUPLOADED"),error:v,iserror:v,showHintBelow:!0,hintText:"WS_HINT_TEXT_LABEL"})}]}]}})({t:a,action:r,approvers:S,selectedApprover:T,setSelectedApprover:A,selectFile:w,uploadedFile:N,setUploadedFile:P,businessService:v,error:R}))},[r,S,N,R]),r&&E.form?l.createElement(t.Modal,{headerBarMain:l.createElement(Bn,{label:a(E.label.heading)}),headerBarEnd:l.createElement(Hn,{onClick:s}),actionCancelLabel:a(E.label.cancel),actionCancelOnSubmit:s,actionSaveLabel:a(E.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action",style:O&&x?{width:"100%",height:"auto"}:{}},f?l.createElement(t.Loader,null):l.createElement(t.FormComposer,{config:E.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){var t,n,l,i,o,a,s,v,m,f;if(null!==(t=p)&&void 0!==t&&t.isBillAmend){var E,_,h,g,S,y,b,A,D;const t=u({},null===(E=p)||void 0===E||null===(_=E.billAmendmentDetails)||void 0===_?void 0:_.additionalDetails,{comments:null!=e&&e.comments?e.comments:null}),n=u({},null===(h=p)||void 0===h?void 0:h.billAmendmentDetails,{workflow:{businessId:null===(g=p)||void 0===g||null===(S=g.billAmendmentDetails)||void 0===S?void 0:S.amendmentId,action:null==r?void 0:r.action,tenantId:c,businessService:null!==(y=p)&&void 0!==y&&null!==(b=y.applicationType)&&void 0!==b&&b.includes("WATER")?"WS.AMENDMENT":"SW.AMENDMENT",moduleName:null!==(A=p)&&void 0!==A&&null!==(D=A.applicationType)&&void 0!==D&&D.includes("WATER")?"WS":"SW",assignes:null!=T&&T.uuid?[{uuid:null==T?void 0:T.uuid}]:[],comment:(null==e?void 0:e.comments)||"",documents:N?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==C?void 0:C.name,fileStoreId:N}]:[]},additionalDetails:t,comment:(null==e?void 0:e.comments)||"",wfDocuments:N?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==C?void 0:C.name,fileStoreId:N}]:null,processInstance:{action:null==r?void 0:r.action,assignes:null!=T&&T.uuid?[{uuid:null==T?void 0:T.uuid}]:[],comment:(null==e?void 0:e.comments)||"",documents:N?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==C?void 0:C.name,fileStoreId:N}]:[]}});d({AmendmentUpdate:n})}else{if(p=u({},p,{action:null==r?void 0:r.action,comment:(null==e?void 0:e.comments)||"",assignee:null!=T&&T.uuid?[null==T?void 0:T.uuid]:[],assignes:null!=T&&T.uuid?[{uuid:null==T?void 0:T.uuid}]:[],wfDocuments:N?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==C?void 0:C.name,fileStoreId:N}]:null,processInstance:u({},null===(n=p)||void 0===n?void 0:n.processInstance,{action:null==r?void 0:r.action,assignes:null!=T&&T.uuid?[{uuid:null==T?void 0:T.uuid}]:[],comment:(null==e?void 0:e.comments)||"",documents:N?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==C?void 0:C.name,fileStoreId:N}]:[]})}),null!=e&&e.date&&null!==(l=p)&&void 0!==l&&null!==(i=l.applicationType)&&void 0!==i&&i.includes("DISCONNECT")){const t=Fn(null==e?void 0:e.date);p.disconnectionExecutionDate=jn(t)}else if(null!=e&&e.date){const t=Fn(null==e?void 0:e.date);p.connectionExecutionDate=jn(t)}var P;if("DisconnectWSConnection"==(null===(o=p)||void 0===o||null===(a=o.processInstance)||void 0===a?void 0:a.businessService)||"DisconnectSWConnection"==(null===(s=p)||void 0===s||null===(v=s.processInstance)||void 0===v?void 0:v.businessService)||window.location.href.includes("disconnection"))"WATER"==(null===(P=p)||void 0===P?void 0:P.serviceType)?d({WaterConnection:p,disconnectRequest:!0}):d({SewerageConnection:p,disconnectRequest:!0});else if("SEWERAGE_RECONNECTION"==(null===(m=p)||void 0===m?void 0:m.applicationType))d({SewerageConnection:p,disconnectRequest:!1,reconnectRequest:!0});else if("WATER_RECONNECTION"==(null===(f=p)||void 0===f?void 0:f.applicationType))d({WaterConnection:p,disconnectRequest:!1,reconnectRequest:!0});else{var R,I,O,x,w,L,M,k,F,B,U,H,j;const e=sessionStorage.getItem("Digit.ADHOC_ADD_REBATE_DATA"),t=e?JSON.parse(e):"";null!=t&&null!==(R=t.value)&&void 0!==R&&R.adhocPenalty&&(p.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&&(p.additionalDetails.adhocPenaltyComment=(null==t||null===(x=t.value)||void 0===x?void 0:x.adhocPenaltyComment)||""),null!=t&&null!==(w=t.value)&&void 0!==w&&w.adhocPenaltyReason&&(p.additionalDetails.adhocPenaltyReason=(null==t||null===(L=t.value)||void 0===L?void 0:L.adhocPenaltyReason)||""),null!=t&&null!==(M=t.value)&&void 0!==M&&M.adhocRebate&&(p.additionalDetails.adhocRebate=parseInt(null==t||null===(k=t.value)||void 0===k?void 0:k.adhocRebate)||""),null!=t&&null!==(F=t.value)&&void 0!==F&&F.adhocRebateComment&&(p.additionalDetails.adhocRebateComment=(null==t||null===(B=t.value)||void 0===B?void 0:B.adhocRebateComment)||""),null!=t&&null!==(U=t.value)&&void 0!==U&&U.adhocRebateReason&&(p.additionalDetails.adhocRebateReason=(null==t||null===(H=t.value)||void 0===H?void 0:H.adhocRebateReason)||""),"WATER"==(null===(j=p)||void 0===j?void 0:j.serviceType)?d({WaterConnection:p,disconnectRequest:!1,reconnectRequest:!1}):d({SewerageConnection:p,disconnectRequest:!1,reconnectRequest:!1})}}},defaultValues:h,formId:"modal-action"})):l.createElement(t.Loader,null)},zn=e=>l.createElement("h1",{className:"heading-m"},e.label),Vn=()=>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"})),Kn=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(Vn,null)),Yn=e=>{var i,o;let{t:a,action:r,tenantId:c,closeModal:s,submitAction:d,applicationData:p,businessService:v,moduleCode:m}=e;const{data:f}=Digit.Hooks.useEmployeeSearch(c,{roles:null==r||null===(i=r.assigneeRoles)||void 0===i||null===(o=i.map)||void 0===o?void 0:o.call(i,e=>({code:e})),isActive:!0},{enabled:!(null!=r&&r.isTerminateState)}),[E,_]=n.useState({}),[h,g]=n.useState({}),[S,b]=n.useState([]),[T,A]=n.useState(null),[C,D]=n.useState(null),[N,P]=n.useState(null),[R,I]=n.useState(null),[O,x]=n.useState(!1);function w(e){D(e.target.files[0])}return n.useEffect(()=>{var e;b(null==f||null===(e=f.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[f]),n.useEffect(()=>{!function(){try{I(null);const e=function(){if(C){const e=function(){if(C.size>=5242880)I(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=y(function(){return Promise.resolve(Digit.UploadServices.Filestorage("PTR",C,c)).then(function(e){var t,n,l,i;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?P(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):I(a("CS_FILE_UPLOAD_ERROR"))})},function(){I(a("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[C]),n.useEffect(()=>{r&&_((e=>{let{t:n,action:i,selectFile:o,uploadedFile:a,setUploadedFile:r,businessService:u}=e;return{label:{heading:"WF_"+(null==i?void 0:i.action)+"_APPLICATION",submit:"WF_"+u+"_"+(null==i?void 0:i.action),cancel:"ES_PTR_COMMON_CANCEL"},form:[{body:[{label:n("ES_PTR_ACTION_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:n("ES_PTR_ATTACH_FILE")+(i.docUploadRequired?" *":""),populators:l.createElement(t.UploadFile,{id:"workflow-doc",onUpload:o,onDelete:()=>{r(null)},showHint:!0,hintText:n("PTR_ATTACH_RESTRICTIONS_SIZE"),message:a?"1 "+n("ES_PTR_ACTION_FILEUPLOADED"):n("ES_PTR_ACTION_NO_FILEUPLOADED")})}]}]}})({t:a,action:r,approvers:S,selectedApprover:T,setSelectedApprover:A,selectFile:w,uploadedFile:N,setUploadedFile:P,businessService:v}))},[r,S,N]),r&&E.form?l.createElement(t.Modal,{headerBarMain:l.createElement(zn,{label:a(E.label.heading)}),headerBarEnd:l.createElement(Kn,{onClick:s}),actionCancelLabel:a(E.label.cancel),actionCancelOnSubmit:s,actionSaveLabel:a(E.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},l.createElement(t.FormComposer,{config:E.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){let t={action:null==r?void 0:r.action,comments:null==e?void 0:e.comments,businessService:v,moduleName:m};N&&(t.documents=[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==C?void 0:C.name,filestoreId:N}]),d({PetRegistrationApplications:[u({},p,{workflow:t})]})},defaultValues:h,formId:"modal-action"})):l.createElement(t.Loader,null)},Gn=e=>l.createElement("h1",{className:"heading-m"},e.label),qn=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),$n=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(qn,null)),Xn=e=>{var i,a,r;let{t:c,action:s,tenantId:d,closeModal:p,submitAction:v,applicationData:m,businessService:f,moduleCode:E}=e;const{data:_}=Digit.Hooks.useEmployeeSearch(d,{roles:null==s||null===(i=s.roles)||void 0===i||null===(a=i[0])||void 0===a||null===(r=a.map)||void 0===r?void 0:r.call(a,e=>({code:e})),isActive:!0},{enabled:!(null!=s&&s.isTerminateState)}),h=o.useHistory(),[g,S]=n.useState({}),[y,b]=n.useState({}),[T,A]=n.useState([]),[C,D]=n.useState(null),[N,P]=n.useState(null);return n.useEffect(()=>{var e;A(null==_||null===(e=_.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[_]),n.useEffect(()=>{"INITIATED"===(null==s?void 0:s.state)?h.push("/upyog-ui/employee/asset/assetservice/edit/"+(null==m?void 0:m.applicationNo)):S((e=>{let{t:t,action:n,businessService:l}=e;return{label:{heading:"WF_"+(null==n?void 0:n.action)+"_APPLICATION",submit:"WF_"+l+"_"+(null==n?void 0:n.action),cancel:"ES_AST_COMMON_CANCEL"},form:[{body:[{label:t("AST_ACTION_COMMENTS"),type:"textarea",populators:{name:"comments"}}]}]}})({t:c,action:s,approvers:T,selectedApprover:C,setSelectedApprover:D,uploadedFile:N,setUploadedFile:P,businessService:f}))},[s,T,N]),s&&g.form?l.createElement(t.Modal,{headerBarMain:l.createElement(Gn,{label:c(g.label.heading)}),headerBarEnd:l.createElement($n,{onClick:p}),actionCancelLabel:c(g.label.cancel),actionCancelOnSubmit:p,actionSaveLabel:c(g.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},l.createElement(t.FormComposer,{config:g.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){let t={action:null==s?void 0:s.action,comment:null==e?void 0:e.comments,businessService:f,moduleName:E};N&&(t.documents=[]),v({Asset:u({},m,{workflow:t})})},defaultValues:y,formId:"modal-action"})):l.createElement(t.Loader,null)},Zn=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 i,o;let{t:a,action:r,tenantId:c,closeModal:s,submitAction:d,applicationData:p,businessService:v,moduleCode:m}=e;const{data:f}=Digit.Hooks.useEmployeeSearch(c,{roles:null==r||null===(i=r.assigneeRoles)||void 0===i||null===(o=i.map)||void 0===o?void 0:o.call(i,e=>({code:e})),isActive:!0},{enabled:!(null!=r&&r.isTerminateState)}),[E,_]=n.useState({}),[h,g]=n.useState({}),[S,b]=n.useState([]),[T,A]=n.useState(null),[C,D]=n.useState(null),[N,P]=n.useState(null),[R,I]=n.useState(null),[O,x]=n.useState(!1);function w(e){D(e.target.files[0])}return n.useEffect(()=>{var e;b(null==f||null===(e=f.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[f]),n.useEffect(()=>{!function(){try{I(null);const e=function(){if(C){const e=function(){if(C.size>=5242880)I(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=y(function(){return Promise.resolve(Digit.UploadServices.Filestorage("CHB",C,c)).then(function(e){var t,n,l,i;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?P(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):I(a("CS_FILE_UPLOAD_ERROR"))})},function(){I(a("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[C]),n.useEffect(()=>{r&&_((e=>{let{t:n,action:i,selectFile:o,uploadedFile:a,setUploadedFile:r}=e;return{label:{heading:"CHB_"+(null==i?void 0:i.action),submit:"CHB_"+(null==i?void 0:i.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")+(i.docUploadRequired?" *":""),populators:l.createElement(t.UploadFile,{id:"workflow-doc",onUpload:o,onDelete:()=>{r(null)},message:a?"1 "+n("CS_ACTION_FILEUPLOADED"):n("CS_ACTION_NO_FILEUPLOADED")})}]}]}})({t:a,action:r,approvers:S,selectedApprover:T,setSelectedApprover:A,selectFile:w,uploadedFile:N,setUploadedFile:P,businessService:v}))},[r,S,N]),r&&E.form?l.createElement(t.Modal,{headerBarMain:l.createElement(Zn,{label:a(E.label.heading)}),headerBarEnd:l.createElement(Qn,{onClick:s}),actionCancelLabel:a(E.label.cancel),actionCancelOnSubmit:s,actionSaveLabel:a(E.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},l.createElement(t.FormComposer,{config:E.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){let t={action:null==r?void 0:r.action,comment:null==e?void 0:e.comments,businessService:v,moduleName:m};N&&(t.documents=[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==C?void 0:C.name,fileStoreId:N}]),d({hallsBookingApplication:u({},p,{workflow:t})})},defaultValues:h,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)),il=e=>{var i,o;let{t:a,action:r,tenantId:c,closeModal:s,submitAction:d,applicationData:p,businessService:v,moduleCode:m}=e;const{data:f}=Digit.Hooks.useEmployeeSearch(c,{roles:null==r||null===(i=r.assigneeRoles)||void 0===i||null===(o=i.map)||void 0===o?void 0:o.call(i,e=>({code:e})),isActive:!0},{enabled:!(null!=r&&r.isTerminateState)}),[E,_]=n.useState({}),[h,g]=n.useState({}),[S,b]=n.useState([]),[T,A]=n.useState(null),[C,D]=n.useState(null),[N,P]=n.useState(null),[R,I]=n.useState(null),[O,x]=n.useState(null),[w,L]=n.useState(!1);function M(e){P(e.target.files[0])}return n.useEffect(()=>{var e;b(null==f||null===(e=f.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[f]),n.useEffect(()=>{!function(){try{x(null);const e=function(){if(N){const e=function(){if(N.size>=5242880)x(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=y(function(){return Promise.resolve(Digit.UploadServices.Filestorage("EW",N,c)).then(function(e){var t,n,l,i;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?I(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):x(a("CS_FILE_UPLOAD_ERROR"))})},function(){x(a("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[N]),n.useEffect(()=>{r&&_((e=>{let{t:n,action:i,selectFile:o,uploadedFile:a,setUploadedFile:r,businessService:u}=e;return(new Date).toISOString().split("T"),{label:{heading:"WF_"+(null==i?void 0:i.action)+"_APPLICATION",submit:"WF_"+u+"_"+(null==i?void 0:i.action),cancel:"ES_PTR_COMMON_CANCEL"},form:[{body:["COMPLETIONPENDING"===(null==i?void 0:i.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==i?void 0:i.state)?{label:n("ES_EW_ACTION_TRANSACTION_ID"),type:"text",isMandatory:!0,populators:{name:"transactionId"}}:"null","REQUESTCOMPLETED"===(null==i?void 0:i.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")+(i.docUploadRequired?" *":""),populators:l.createElement(t.UploadFile,{id:"workflow-doc",onUpload:o,onDelete:()=>{r(null)},showHint:!0,hintText:n("EW_ATTACH_RESTRICTIONS_SIZE"),message:a?"1 "+n("ES_EW_ACTION_FILEUPLOADED"):n("ES_EW_ACTION_NO_FILEUPLOADED")})}]}]}})({t:a,action:r,approvers:S,selectedApprover:T,setSelectedApprover:A,selectFile:M,uploadedFile:R,setUploadedFile:I,businessService:v}))},[r,S,R]),r&&E.form?l.createElement(t.Modal,{headerBarMain:l.createElement(tl,{label:a(E.label.heading)}),headerBarEnd:l.createElement(ll,{onClick:s}),actionCancelLabel:a(E.label.cancel),actionCancelOnSubmit:s,actionSaveLabel:a(E.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},l.createElement(t.FormComposer,{config:E.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){let t={action:null==r?void 0:r.action,comments:null==e?void 0:e.comments,businessService:v,moduleName:m};R&&(t.documents=[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==N?void 0:N.name,filestoreId:R},{}]),p.pickUpDate=null==e?void 0:e.date,p.transactionId=null==e?void 0:e.transactionId,p.finalAmount=null==e?void 0:e.finalAmount,d({EwasteApplication:[u({},p,{workflow:t})]})},defaultValues:h,formId:"modal-action"})):l.createElement(t.Loader,null)},ol=e=>l.createElement("h1",{className:"heading-m"},e.label),al=()=>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"})),rl=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(al,null)),ul=e=>{var i,o;let{t:a,action:r,tenantId:c,closeModal:s,submitAction:d,applicationData:p,businessService:v,moduleCode:m}=e;const{data:f}=Digit.Hooks.useEmployeeSearch(c,{roles:null==r||null===(i=r.assigneeRoles)||void 0===i||null===(o=i.map)||void 0===o?void 0:o.call(i,e=>({code:e})),isActive:!0},{enabled:null==r?void 0:r.isTerminateState}),[E,_]=n.useState({}),[h,g]=n.useState({}),[S,T]=n.useState([]),[A,C]=n.useState(null),[D,N]=n.useState(null),[P,R]=n.useState(null),[I,O]=n.useState(null),[x,w]=n.useState(!1);function L(e){w(!0),N(e.target.files[0])}return n.useEffect(()=>{var e;T(null==f||null===(e=f.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[f]),n.useEffect(()=>{!function(){try{O(null);const e=function(){if(D){const e=function(){if(D.size>=5242880)O(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=b(function(){return y(function(){return Promise.resolve(Digit.UploadServices.Filestorage("StreetVending",D,c)).then(function(e){var t,n,l,i;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?R(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):O(a("CS_FILE_UPLOAD_ERROR"))})},function(){O(a("CS_FILE_UPLOAD_ERROR"))})},function(e,t){if(w(!1),e)throw t;return t});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[D]),n.useEffect(()=>{_((e=>{let{t:n,action:i,selectFile:o,uploadedFile:a,setUploadedFile:r,approvers:u,selectedApprover:c,setSelectedApprover:s,isUploading:d}=e;const p=()=>l.createElement("div",{className:"loading-spinner"});return{label:{heading:"WF_"+(null==i?void 0:i.action)+"_APPLICATION",submit:"SV_"+(null==i?void 0:i.action),cancel:"SV_COMMON_CANCEL"},form:[{body:["APPROVE"===(null==i?void 0:i.action)||"REJECT"===(null==i?void 0:i.action)||"SENDBACKTOCITIZEN"===(null==i?void 0:i.action)?"":{label:n("SV_ASSIGNEE"),type:"dropdown",populators:l.createElement(t.Dropdown,{option:u,t:n,optionKey:"name",select:s,selected:c})},{label:n("SV_ACTION_COMMENTS"),isMandatory:!0,type:"textarea",populators:{name:"comments",validation:{required:!0}}},{label:n("SV_ATTATCH_FILE")+(i.docUploadRequired?" *":""),populators:l.createElement(t.UploadFile,{id:"workflow-doc-sv",onUpload:o,onDelete:()=>{r(null)},message:d?l.createElement("div",{style:{display:"flex",alignItems:"center",gap:"8px"}},l.createElement(p,null),l.createElement("span",null,"Uploading...")):a?"1 "+n("SV_FILE_UPLOADED"):n("SV_NO_FILE")})}]}]}})({t:a,action:r,approvers:S,selectedApprover:A,setSelectedApprover:C,selectFile:L,uploadedFile:P,setUploadedFile:R,businessService:v,isUploading:x}))},[r,S,P]),r&&E.form?l.createElement(t.Modal,{headerBarMain:l.createElement(ol,{label:a(E.label.heading)}),headerBarEnd:l.createElement(rl,{onClick:s}),actionCancelLabel:a(E.label.cancel),actionCancelOnSubmit:s,actionSaveLabel:a(E.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},l.createElement(t.FormComposer,{config:E.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){var t;let n={action:null==r?void 0:r.action,comments:null==e?void 0:e.comments,businessService:v,moduleName:m,assignes:"SENDBACKTOCITIZEN"===(null==r?void 0:r.action)?[null==p||null===(t=p.auditDetails)||void 0===t?void 0:t.createdBy]:null!=A&&A.uuid?[null==A?void 0:A.uuid]:null};P&&(n.documents=[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==D?void 0:D.name,fileStoreId:P}]),d({streetVendingDetail:u({},p,{workflow:n})})},defaultValues:h,formId:"modal-action"})):l.createElement(t.Loader,null)},cl=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"})),dl=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(sl,null)),pl=e=>{var i,a,r,c;let{t:s,action:d,tenantId:p,closeModal:v,submitAction:m,applicationData:f,businessService:E,moduleCode:_}=e;const{data:h}=Digit.Hooks.useEmployeeSearch(p,{roles:null==d||null===(i=d.assigneeRoles)||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)}),{data:g}=Digit.Hooks.fsm.useVendorSearch({tenantId:p,config:{enabled:"PENDING_FOR_VEHICLE_DRIVER_ASSIGN"===(null==d?void 0:d.state)}});let S=[];null==g||null===(r=g.vendor)||void 0===r||r.map(e=>{var t,n;(null==e||null===(t=e.additionalDetails)||void 0===t?void 0:t.serviceType)===(null==f?void 0:f.bookingNo.split("-")[0])&&S.push({code:null==e?void 0:e.name,name:null==e?void 0:e.name,i18nKey:null==e?void 0:e.name,vendorId:null==e?void 0:e.id,uuid:null==e||null===(n=e.owner)||void 0===n?void 0:n.uuid})});const{data:b}=Digit.Hooks.fsm.useVehiclesSearch({tenantId:p,config:{enabled:"DELIVERY_PENDING"===(null==d?void 0:d.state)}});let T=[];null==b||null===(c=b.vehicle)||void 0===c||c.map(e=>{var t;T.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,uuid:null==e||null===(t=e.owner)||void 0===t?void 0:t.uuid})});const[A,C]=n.useState({}),[D,N]=n.useState({}),[P,R]=n.useState([]),[I,O]=n.useState(null),[x,w]=n.useState(null),[L,M]=n.useState(null),[k,F]=n.useState(null),[B,U]=n.useState(null),[H,j]=n.useState(""),W=o.useHistory();function z(e){O(e.target.files[0])}return n.useEffect(()=>{var e;R(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(()=>{!function(){try{M(null);const e=function(){if(I){const e=function(){if(I.size>=5242880)M(s("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=y(function(){return Promise.resolve(Digit.UploadServices.Filestorage("WT",I,p)).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?w(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):M(s("CS_FILE_UPLOAD_ERROR"))})},function(){M(s("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)}}()},[I]),n.useEffect(()=>{if(d){if("PAY"===d.action){var e;const t=null===(e=f.bookingNo)||void 0===e?void 0:e.split("-")[0];let n="";switch(t){case"WT":n="request-service.water_tanker";break;case"MT":n="request-service.mobile_toilet";break;case"TP":n="request-service.tree_pruning";break;default:return void console.error("Unknown booking prefix:",t)}return W.push("/upyog-ui/employee/payment/collect/"+n+"/"+f.bookingNo)}C((e=>{let{t:n,action:i,selectFile:o,uploadedFile:a,setUploadedFile:r,selectedVendor:u,setSelectedVendor:c,vendorDescription:s,vehicleDescription:d,selectVehicle:p,setSelectVehicle:v}=e;return{label:{heading:"RS_"+(null==i?void 0:i.action),submit:"RS_"+(null==i?void 0:i.action),cancel:"CS_COMMON_BACK"},form:[{body:["PENDING_FOR_VEHICLE_DRIVER_ASSIGN"===(null==i?void 0:i.state)?{label:n("RS_ASSIGN"),type:"dropdown",isMandatory:!0,populators:l.createElement(t.Dropdown,{option:s,t:n,optionKey:"i18nKey",select:c,selected:u})}:"null","DELIVERY_PENDING"===(null==i?void 0:i.state)?{label:n("RS_REGISTRATION_NUMBER"),isMandatory:!0,type:"dropdown",populators:l.createElement(t.Dropdown,{option:d,t:n,optionKey:"i18nKey",select:v,selected:p})}:"null",{label:n("ES_RS_ACTION_COMMENTS")+" *",type:"textarea",populators:{name:"comments",validation:{required:!0}}},{label:n("ES_RS_ATTACH_FILE")+(i.docUploadRequired?" *":""),populators:l.createElement(t.UploadFile,{id:"workflow-doc",onUpload:o,onDelete:()=>{r(null)},message:a?"1 "+n("CS_ACTION_FILEUPLOADED"):n("CS_ACTION_NO_FILEUPLOADED")})}]}]}})({t:s,action:d,selectFile:z,uploadedFile:x,setUploadedFile:w,selectedVendor:k,setSelectedVendor:F,vendorDescription:g?S:void 0,vehicleDescription:b?T:void 0,selectVehicle:B,setSelectVehicle:U}))}},[d,P,x,g,B,b]),d&&A.form?l.createElement(t.Modal,{headerBarMain:l.createElement(cl,{label:s(A.label.heading)}),headerBarEnd:l.createElement(dl,{onClick:v}),actionCancelLabel:s(A.label.cancel),actionCancelOnSubmit:v,actionSaveLabel:s(A.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action",isDisabled:(null==d?void 0:d.docUploadRequired)&&!x&&!H||"PENDING_FOR_VEHICLE_DRIVER_ASSIGN"===(null==d?void 0:d.state)&&!k&&!H||"DELIVERY_PENDING"===(null==d?void 0:d.state)&&!B&&!H||!H},l.createElement(t.FormComposer,{config:A.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){let t,n={action:null==d?void 0:d.action,comments:null==e?void 0:e.comments,businessService:E,moduleName:_};x&&(n.documents=[{documentType:(null==d?void 0:d.action)+" DOC",fileName:null==I?void 0:I.name,fileStoreId:x}]),"PENDING_FOR_VEHICLE_DRIVER_ASSIGN"===(null==d?void 0:d.state)&&(n.assignes=[null==k?void 0:k.uuid],f.vendorId=null==k?void 0:k.vendorId),"DELIVERY_PENDING"===(null==d?void 0:d.state)&&(f.vehicleId=null==B?void 0:B.vehicleId),t="watertanker"===E?{waterTankerBookingDetail:u({},f,{workflow:n})}:"treePruning"===E?{treePruningBookingDetail:u({},f,{workflow:n})}:{mobileToiletBookingDetail:u({},f,{workflow:n})},m(t)},defaultValues:D,formId:"modal-action",onFormValueChange:(e,t)=>{j(null==t?void 0:t.comments)}})):l.createElement(t.Loader,null)},vl=e=>null!=e&&e.businessService.includes("PT")?l.createElement(it,e):null!=e&&e.businessService.includes("ptr")?l.createElement(Yn,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(ut,e):null!=e&&e.moduleCode.includes("BPAREG")?l.createElement(pt,e):null!=e&&e.moduleCode.includes("BPA")?l.createElement(Et,e):null!=e&&e.moduleCode.includes("NOC")?l.createElement(St,e):null!=e&&e.moduleCode.includes("WS")?l.createElement(Wn,e):null!=e&&e.businessService.includes("asset-create")?l.createElement(Xn,e):null!=e&&e.businessService.includes("ewst")?l.createElement(il,e):null!=e&&e.businessService.includes("booking-refund")?l.createElement(el,e):null!=e&&e.businessService.includes("street-vending")?l.createElement(ul,e):null!=e&&e.businessService.includes("watertanker")||null!=e&&e.businessService.includes("mobileToilet")||null!=e&&e.businessService.includes("treePruning")?l.createElement(pl,e):void 0;function ml(e){let{documents:n,svgStyles:o={},isSendBackFlow:a=!1,isHrLine:r=!1,titleStyles:u}=e;const{t:c}=i.useTranslation(),s=window.location.href.includes("stakeholder");return l.createElement("div",{style:{marginTop:"19px"}},!s&&(null==n?void 0:n.map((e,i)=>{var o;return l.createElement(l.Fragment,{key:i},null!=e&&e.title?l.createElement(t.CardSubHeader,{style:u||{marginTop:"32px",marginBottom:"8px",color:"#505A5F",fontSize:"24px"}},c(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 i;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"}},c(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"}},c(null==e?void 0:e.documentType.split(".")[1])):l.createElement("p",{style:{textAlign:"center"}},c(null==e?void 0:e.documentType)):"")}):!window.location.href.includes("citizen")&&l.createElement("div",null,l.createElement("p",null,c("BPA_NO_DOCUMENTS_UPLOADED_LABEL")))),r&&(null==n?void 0:n.length)!=i+1?l.createElement("hr",{style:{color:"#D6D5D4",backgroundColor:"#D6D5D4",height:"2px",marginTop:"20px",marginBottom:"20px"}}):null)})),s&&(null==n?void 0:n.map((e,n)=>{var i;return l.createElement(l.Fragment,{key:n},null!=e&&e.title?l.createElement(t.CardSubHeader,{style:{marginTop:"32px",marginBottom:"8px",color:"#505A5F",fontSize:"24px"}},c(null==e?void 0:e.title)):null,l.createElement("div",null,null!=e&&e.values&&(null==e?void 0:e.values.length)>0?null==e||null===(i=e.values)||void 0===i?void 0:i.map((e,n)=>l.createElement("a",{target:"_",href:null==e?void 0:e.url,style:{minWidth:null!=o&&o.minWidth?null==o?void 0:o.minWidth:"160px",marginRight:"20px"},key:n},l.createElement("div",{style:{maxWidth:"940px",padding:"8px",borderRadius:"4px",border:"1px solid #D6D5D4",background:"#FAFAFA"}},l.createElement("p",{style:{marginTop:"8px",fontWeight:"bold",marginBottom:"10px"}},c(null==e?void 0:e.title)),null!=e&&e.docInfo?l.createElement("div",{style:{fontSize:"12px",color:"#505A5F",fontWeight:400,lineHeight:"15px",marginBottom:"10px"}},""+c(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"}},""+c(null==e?void 0:e.title))))):!window.location.href.includes("citizen")&&l.createElement("div",null,l.createElement("p",null,c("BPA_NO_DOCUMENTS_UPLOADED_LABEL")))))})))}const fl=e=>{var t,i;let{t:o,formData:a,applicationData:r,docs:u,bpaActionsDetails:c}=e;const s=(null==r?void 0:r.status)||"",d=(null==c||null===(t=c.data)||void 0===t?void 0:t.nextActions)||[],p=Digit.ULBService.getStateId(),[v,m]=n.useState((null==a||null===(i=a.documents)||void 0===i?void 0:i.documents)||[]),[f,E]=n.useState(null),[_,h]=n.useState([]),[g,S]=n.useState(!0),[y,b]=n.useState(!1),[T,A]=n.useState(!1),{isLoading:C,data:D}=Digit.Hooks.obps.useMDMS(p,"BPA",["DocTypeMapping"]),{isLoading:N,data:P}=Digit.Hooks.obps.useMDMS(p,"common-masters",["DocumentType"]);return n.useEffect(()=>{var e,t,n,l;let i=[];var o,a;null!=D&&null!==(e=D.BPA)&&void 0!==e&&e.DocTypeMapping&&(i=null==D||null===(o=D.BPA)||void 0===o||null===(a=o.DocTypeMapping)||void 0===a?void 0:a.filter(e=>{var t,n;return e.WFState==(null==r?void 0:r.status)?null==r?void 0:r.status:e.RiskType==(null==r?void 0:r.riskType)&&e.ServiceType==(null==r||null===(t=r.additionalDetails)||void 0===t?void 0:t.serviceType)&&e.applicationType==(null==r||null===(n=r.additionalDetails)||void 0===n?void 0:n.applicationType)}));let c=[];null===(t=i)||void 0===t||null===(n=t[0])||void 0===n||null===(l=n.docTypes)||void 0===l||l.forEach(e=>{var t,n,l,i;let o=e.code;e.dropdownData=[],e.uploadedDocuments=[],null==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,o.length);o===n&&(e.hasDropdown=!0,t.i18nKey=t.code,e.dropdownData.push(t))}),e.uploadedDocuments[0]={},e.uploadedDocuments[0].values=[],null==u||null===(l=u[0])||void 0===l||null===(i=l.values)||void 0===i||i.map(t=>{var n,l;o===(null==t||null===(n=t.documentType)||void 0===n?void 0:n.split(".")[0])+"."+(null==t||null===(l=t.documentType)||void 0===l?void 0:l.split(".")[1])&&e.uploadedDocuments[0].values.push(t)}),c.push(e)}),sessionStorage.setItem("BPA_DOCUMENTS",JSON.stringify(c)),h(c)},[!C,!N]),n.useEffect(()=>{let e=0;_.map(t=>{let n=!1;v.map(e=>{t.required&&t.code==e.documentType.split(".")[0]+"."+e.documentType.split(".")[1]&&(n=!0)}),!n&&t.required&&(e+=1)}),S("0"!=e&&0!=e||!(v.length>0))},[v,y]),n.useEffect(()=>{A("DOC_VERIFICATION_INPROGRESS"===s&&(null==d?void 0:d.length)>0)},[r,c]),l.createElement("div",null,null==_?void 0:_.map((e,t)=>l.createElement("div",null,l.createElement(El,{key:t,index:t,document:e,t:o,error:f,setError:E,setDocuments:m,documents:v,setCheckRequiredFields:b,applicationStatus:s,actions:d,bpaTaxDocuments:_,checkEnablingDocs:T}))))};function El(e){var i,o;let{t:a,document:r,setDocuments:c,documents:s,index:d,bpaTaxDocuments:p,checkEnablingDocs:v}=e;const m=null==s?void 0:s.filter(e=>{var t;return null==e||null===(t=e.documentType)||void 0===t?void 0:t.includes(null==r?void 0:r.code)})[0],f=Digit.ULBService.getStateId(),[E,_]=n.useState(m?u({},m,{active:!0,code:null==m?void 0:m.documentType,i18nKey:null==m?void 0:m.documentType}):1===(null==r||null===(i=r.dropdownData)||void 0===i?void 0:i.length)?null==r?void 0:r.dropdownData[0]:{}),[h,g]=n.useState(null),[S,y]=n.useState(()=>(null==m?void 0:m.fileStoreId)||null),[b,T]=n.useState([]);return n.useEffect(()=>{null!=E&&E.code&&c(e=>{var t;const n=null==e?void 0:e.filter(e=>(null==e?void 0:e.documentType)!==(null==E?void 0:E.code));return 0===(null==S?void 0:S.length)||null===S?n:[...null==n?void 0:n.filter(e=>(null==e?void 0:e.fileStoreId)!==S),{documentType:null==E?void 0:E.code,fileStoreId:S,documentUid:S,fileName:(null==h?void 0:h.name)||"",id:s?null===(t=s.find(e=>e.documentType===(null==E?void 0:E.code)))||void 0===t?void 0:t.id:void 0}]})},[S,E]),n.useEffect(()=>{try{b.length>0&&(sessionStorage.removeItem("BPA_DOCUMENTS"),r.newUploadedDocs=[],b.map(e=>{var t,n,l;null!=E&&E.code&&r.newUploadedDocs.push({documentType:null==E?void 0:E.code,fileStoreId:null==e||null===(t=e.fileStoreId)||void 0===t?void 0:t.fileStoreId,documentUid:null==e||null===(n=e.fileStoreId)||void 0===n?void 0:n.fileStoreId,tenantId:null==e||null===(l=e.fileStoreId)||void 0===l?void 0:l.tenantId})}),p[d]=r,sessionStorage.setItem("BPA_DOCUMENTS",JSON.stringify(p)))}catch(e){Promise.reject(e)}},[b,E]),n.useEffect(()=>{},[h]),l.createElement("div",{style:{marginBottom:"24px",maxWidth:"950px",minWidth:"280px",background:"#FAFAFA",borderRadius:"4px",border:"1px solid #D6D5D4",padding:"8px"}},l.createElement(t.CardSubHeader,{style:{marginBottom:"8px",paddingBottom:"9px",color:"#0B0C0C",fontSize:"16px",lineHeight:"19px"}},""+a(null==r?void 0:r.code)),(null==r||null===(o=r.uploadedDocuments)||void 0===o?void 0:o.length)&&l.createElement(ml,{documents:null==r?void 0:r.uploadedDocuments,svgStyles:{width:"100px",height:"100px",viewBox:"0 0 25 25",minWidth:"100px"}}),v?l.createElement("div",{style:{marginTop:"20px"}},l.createElement(t.LabelFieldPair,{style:{width:"100%"}},l.createElement(t.CardLabel,{style:{marginTop:"-10px",width:"100%"}},null!=r&&r.required?a(null==r?void 0:r.code)+"* ":""+a(null==r?void 0:r.code)),l.createElement(t.Dropdown,{className:"form-field",t:a,isMandatory:!1,option:null==r?void 0:r.dropdownData,selected:E,optionKey:"i18nKey",select:e=>_(e),style:{width:"100%"}})),l.createElement(t.LabelFieldPair,{style:{width:"100%"}},l.createElement(t.CardLabel,{className:"card-label-smaller",style:{width:"100%"}}),l.createElement("div",{className:"field",style:{width:"100%"}},l.createElement(t.MultiUploadWrapper,{module:"BPA",tenantId:f,getFormState:e=>((e,t)=>{let n=Object.fromEntries(t),l=Object.values(n);0!==Object.keys(n).length&&T(l),function(e){e&&g(e.file)}(l[l.length-1])})(0,e),t:a,allowedFileTypesRegex:/(.*?)(jpg|jpeg|png|image|pdf)$/i,allowedMaxSizeInMB:5,acceptFiles:"image/*, .pdf, .png, .jpeg, .jpg"})))):null)}function _l(e){let{fiReport:n,isCitizen:o=!1}=e;const{t:a}=i.useTranslation();return l.createElement(l.Fragment,null,l.createElement("div",{style:{marginTop:"10px"}},l.createElement(o?t.CardHeader:t.CardSectionHeader,{style:{fontSize:"24px"}},""+a("BPA_FI_REPORT")),n.map((e,i)=>{var o,r,u,c,s,d;return l.createElement("div",{style:{background:"#FAFAFA",border:"1px solid #D6D5D4",padding:"8px",borderRadius:"4px",maxWidth:"950px",minWidth:"280px",marginBottom:"24px"}},l.createElement(t.StatusTable,null,l.createElement(t.CardSectionHeader,{style:{fontSize:"20px"}},1==(null==n?void 0:n.length)?""+a("BPA_FI_REPORT"):a("BPA_FI_REPORT")+" - "+(i+1)),l.createElement(t.Row,{className:"border-none",label:""+a("BPA_FI_DATE_LABEL"),text:null!=e&&e.date?e.date.includes("-")?(null===(o=e.date)||void 0===o?void 0:o.split("-")[2])+"/"+(null===(r=e.date)||void 0===r?void 0:r.split("-")[1])+"/"+(null===(u=e.date)||void 0===u?void 0:u.split("-")[0]):null==e?void 0:e.date:"NA"}),l.createElement(t.Row,{className:"border-none",label:""+a("BPA_FI_TIME_LABEL"),text:null!=e&&e.time?null==e?void 0:e.time:"NA"}),(null==e||null===(c=e.questions)||void 0===c?void 0:c.length)&&(null==e||null===(s=e.questions)||void 0===s?void 0:s.map(e=>l.createElement("div",{style:{background:"white",border:"1px solid #D6D5D4",padding:"8px",borderRadius:"4px",marginTop:"10px"}},l.createElement(t.Row,{className:"border-none",label:""+a(""+e.question),text:null!=e&&e.value?null==e?void 0:e.value:"NA"}),l.createElement(t.Row,{className:"border-none",label:""+a("BPA_ENTER_REMARKS"),text:e.remarks?e.remarks:"NA"})))),l.createElement(ml,{documents:(d=null==e?void 0:e.docs,[{title:"BPA_DOCUMENT_DETAILS_LABEL",values:null==d?void 0:d.map(e=>{var t;return{title:null==e||null===(t=e.documentType)||void 0===t?void 0:t.replaceAll(".","_"),documentType:null==e?void 0:e.documentType,documentUid:null==e?void 0:e.documentUid,fileStoreId:null==e?void 0:e.fileStoreId,id:null==e?void 0:e.id,url:null==e?void 0:e.url}})}]),svgStyles:{width:"100px",height:"100px",viewBox:"0 0 25 25",minWidth:"100px"}})))})))}function hl(e){let{t:i,document:o,setNocDocuments:a,setError:r,nocDocuments:u}=e;const c=null==u?void 0:u.filter(e=>{var t;return null==e||null===(t=e.documentType)||void 0===t?void 0:t.includes(null==o?void 0:o.code)})[0],s=Digit.ULBService.getStateId(),[d,p]=n.useState(),[v,m]=n.useState(null),[f,E]=n.useState(()=>(null==c?void 0:c.fileStoreId)||null);return n.useEffect(()=>{var e,t;null!=o&&null!==(e=o.dropdownData)&&void 0!==e&&null!==(t=e[0])&&void 0!==t&&t.code&&a(e=>{var t;const n=null==e?void 0:e.filter(e=>{var t,n;return(null==e?void 0:e.documentType)!==(null==o||null===(t=o.dropdownData)||void 0===t||null===(n=t[0])||void 0===n?void 0:n.code)});return 0===(null==f?void 0:f.length)||null===f?n:[...null==n?void 0:n.filter(e=>(null==e?void 0:e.fileStoreId)!==f),{documentType:null==o||null===(t=o.dropdownData)||void 0===t?void 0:t[0].code,fileStoreId:f,documentUid:f,fileName:(null==v?void 0:v.name)||""}]})},[f]),n.useEffect(()=>{!function(){try{r(null);const e=function(){if(v){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(v.size>=5242880)r(i("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=v&&v.type&&!e.test(null==v?void 0:v.type))r(i("NOT_SUPPORTED_FILE_TYPE"));else{const e=y(function(){return E(null),Promise.resolve(Digit.UploadServices.Filestorage("PT",v,Digit.ULBService.getStateId())).then(function(e){var t,n,l,o;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?E(null==e||null===(l=e.data)||void 0===l||null===(o=l.files[0])||void 0===o?void 0:o.fileStoreId):r(i("CS_FILE_UPLOAD_ERROR"))})},function(){r(i("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[v]),l.createElement("div",{style:{}},l.createElement(t.LabelFieldPair,{style:{width:"98%",marginRight:"10px"}},l.createElement(t.CardLabel,{style:{width:"100%"}},null!=o&&o.required?i("TL_BUTTON_UPLOAD FILE")+"*":""+i("TL_BUTTON_UPLOAD FILE")),l.createElement("div",{className:"field",style:{width:"100%"}},l.createElement(t.MultiUploadWrapper,{module:"NOC",tenantId:s,getFormState:e=>(e=>{let t=Object.fromEntries(e),n=Object.values(t);!function(e){e&&m(e.file)}(n[n.length-1])})(e),t:i,allowedFileTypesRegex:/(.*?)(jpg|jpeg|png|image|pdf)$/i,allowedMaxSizeInMB:5,acceptFiles:"image/*, .pdf, .png, .jpeg, .jpg"}))))}const gl=e=>{var i;let{t:o,noc:a,docs:r,isNoc:u,applicationData:c,NOCdata:s,bpaActionsDetails:d}=e;Digit.ULBService.getStateId();const p=Digit.ULBService.getStateId(),v=(null==c?void 0:c.status)||"",m=(null==d||null===(i=d.data)||void 0===i?void 0:i.nextActions)||[],{data:f}=Digit.Hooks.obps.useMDMS(p,"NOC",["DocumentTypeMapping"],{enabled:u}),{data:E}=Digit.Hooks.obps.useMDMS(p,"BPA",["DocTypeMapping"],{enabled:!u}),{data:_}=Digit.Hooks.obps.useMDMS(p,"common-masters",["DocumentType"]),[h,g]=n.useState([]),[S,y]=n.useState([]),[b,T]=n.useState(!1),[A,C]=Digit.Hooks.useSessionStorage(null==a?void 0:a.nocType,[]),[D,N]=n.useState(null),P=window.location.href.includes("/employee/");return n.useEffect(()=>{var e;g(null==_||null===(e=_["common-masters"])||void 0===e?void 0:e.DocumentType)},[_]),n.useEffect(()=>{var e,t,n;let l,i=[];var o,r,s,d;l=u?null==f||null===(o=f.NOC)||void 0===o||null===(r=o.DocumentTypeMapping)||void 0===r?void 0:r.filter(e=>(null==e?void 0:e.applicationType)===(null==a?void 0:a.applicationType)&&(null==e?void 0:e.nocType)===(null==a?void 0:a.nocType)):null==E||null===(s=E.BPA)||void 0===s||null===(d=s.DocTypeMapping)||void 0===d?void 0:d.filter(e=>{var t,n;return e.WFState==(null==c?void 0:c.status)&&e.RiskType==(null==c?void 0:c.riskType)&&e.ServiceType==(null==c||null===(t=c.additionalDetails)||void 0===t?void 0:t.serviceType)&&e.applicationType==(null==c||null===(n=c.additionalDetails)||void 0===n?void 0:n.applicationType)}),null!==(e=l)&&void 0!==e&&null!==(t=e[0])&&void 0!==t&&null!==(n=t.docTypes)&&void 0!==n&&n[0]&&(l[0].docTypes[0].nocType=l[0].nocType,l[0].docTypes[0].additionalDetails={submissionDetails:null==a?void 0:a.additionalDetails,applicationStatus:null==a?void 0:a.applicationStatus,appNumberLink:null==a?void 0:a.applicationNo,nocNo:null==a?void 0:a.nocNo},i.push(l[0].docTypes[0]));let p=[];i&&i.length>0&&(i.map(e=>{let t=e.documentType;e.dropdownData=[],null==h||h.forEach(n=>{let l=n.code.slice(0,null==t?void 0:t.length);t===l&&(e.hasDropdown=!0,e.dropdownData.push(n))}),p.push(e)}),y(p))},[f,h]),n.useEffect(()=>{T("NOC_VERIFICATION_INPROGRESS"===v&&(null==m?void 0:m.length)>0)},[c,d]),l.createElement("div",{style:{border:"1px solid #D6D5D4",padding:"16px 0px 16px 8px",background:"#FAFAFA",borderRadius:"5px",marginBottom:"24px",maxWidth:"950px"}},l.createElement(t.StatusTable,null,l.createElement(t.Row,{label:P?""+o("BPA_"+(null==a?void 0:a.nocType)+"_HEADER"):o("BPA_"+(null==a?void 0:a.nocType)+"_HEADER"),labelStyle:{fontSize:"20px",width:"150%"}}),s&&s.map((e,n)=>{if(null!=e&&e.value)return l.createElement(t.Row,"STATUS"==(null==e?void 0:e.field)?{className:"border-none",label:P?""+o(null==e?void 0:e.title):o(null==e?void 0:e.title),text:o(null!=e&&e.value?null==e?void 0:e.value:"CS_NA"),textStyle:"APPROVED"==(null==e?void 0:e.value)||"AUTO_APPROVED"==(null==e?void 0:e.value)?{color:"#00703C"}:{color:"#D4351C"}}:{className:"border-none",label:P?""+o(null==e?void 0:e.title):o(null==e?void 0:e.title),text:o(null!=e&&e.value?null==e?void 0:e.value:"CS_NA")})})),l.createElement(ml,{documents:r,svgStyles:{width:"80px",height:"100px",viewBox:"0 0 25 25",minWidth:"80px"}}),b&&(null==S?void 0:S.map((e,t)=>l.createElement(hl,{key:t,document:e,t:o,error:D,setError:N,setNocDocuments:C,nocDocuments:A,checkEnablingDocs:b}))))},Sl=e=>{let{permissions:i,t:o}=e;const[a,r,c]=Digit.Hooks.useSessionStorage("OBPS_APPROVAL_CHECKS",null==i?void 0:i.map(e=>({label:e,checked:!1}))),[s,d,p]=Digit.Hooks.useSessionStorage("OBPS_NEW_APPROVALS",[]);n.useEffect(()=>()=>{Digit.SessionStorage.del("OBPS_NEW_APPROVALS"),Digit.SessionStorage.del("OBPS_APPROVAL_CHECKS")},[]);const v=window.Digit.Utils.browser.isMobile();return l.createElement("div",null,l.createElement(t.CardSubHeader,{style:{marginBottom:"16px",fontSize:"24px"}},o("BPA_PERMIT_CONDITIONS")),null==a?void 0:a.map((e,n)=>l.createElement(t.CheckBox,{key:n,styles:{margin:"20px 0 40px",maxWidth:v?"100%":"70%"},label:null==e?void 0:e.label,checked:null==e?void 0:e.checked,onChange:e=>((e,t,n)=>{const l=e.target.checked;r(()=>null==a?void 0:a.map((e,t)=>n===t?u({},e,{checked:l}):e))})(e,0,n),isLabelFirst:!0,index:n})),null==s?void 0:s.map((e,n)=>l.createElement("div",null,l.createElement(t.TextInput,{key:n,value:null==e?void 0:e.label,onChange:e=>((e,t)=>{d(()=>null==s?void 0:s.map((n,l)=>{var i;return t===l?{label:null==e||null===(i=e.target)||void 0===i?void 0:i.value}:n}))})(e,n),textInputStyle:{maxWidth:v?"96%":"830px",width:v?"96%":"830px"},style:v?{paddingRight:"10%"}:{},placeholder:o("BPA_ENTER_PERMIT_CONDITIONS_LABEL")}),l.createElement(t.LinkButton,{label:l.createElement("div",null,l.createElement("span",null,l.createElement(t.Close,{style:{float:"right",position:"relative",bottom:"32px",marginTop:"-22px",marginRight:v?"5%":"35%"}}))),style:{},onClick:e=>(e=>{const t=[...s];t.splice(e,1),d([...t])})(n)}))),l.createElement(t.LinkButton,{style:{color:"#a82227",maxWidth:v?"fit-content":"10%",marginRight:"3%"},label:o("BPA_ADD_MORE"),onClick:()=>{d([...s,{label:""}])}}))};function yl(e){let{documents:o,svgStyles:a={},isSendBackFlow:r=!1}=e;const{t:u}=i.useTranslation(),[c,s]=n.useState(()=>[]),[d,p]=(Digit.ULBService.getCurrentTenantId(),n.useState({}));n.useEffect(()=>{var e;let t=[];null==o||o.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))},[o]),n.useEffect(()=>{var e;null!=c&&c.length&&"BillAmend"===(null==o||null===(e=o[0])||void 0===e?void 0:e.BS)?Digit.UploadServices.Filefetch(c,Digit.ULBService.getCurrentTenantId()).then(e=>{p(null==e?void 0:e.data)}):null!=c&&c.length&&Digit.UploadServices.Filefetch(c,Digit.ULBService.getStateId()).then(e=>{p(null==e?void 0:e.data)})},[c]);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==o?void 0:o.map((e,n)=>{var i;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===(i=e.values)||void 0===i?void 0:i.map((e,n)=>{var i,o;return l.createElement("a",{target:"_",href:null===(i=d[e.fileStoreId])||void 0===i?void 0:i.split(",")[0],style:{minWidth:"80px",marginRight:"10px",maxWidth:"100px",height:"auto"},key:n},l.createElement("div",{style:{display:"flex",justifyContent:"center"}},l.createElement(t.PDFSvg,null)),l.createElement("p",{style:v?{marginTop:"8px",fontWeight:"bold",fontSize:"16px",lineHeight:"19px",color:"#505A5F",textAlign:"center"}:{marginTop:"8px",fontWeight:"bold"}},u(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"}},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==o?void 0:o.map((e,n)=>{var i;return l.createElement(l.Fragment,{key:n},null!=e&&e.title?l.createElement(t.CardSubHeader,{style:{marginTop:"32px",marginBottom:"8px",color:"#505A5F",fontSize:"24px"}},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===(i=e.values)||void 0===i?void 0:i.map((e,n)=>{var i;return l.createElement("a",{target:"_",href:null===(i=d[e.fileStoreId])||void 0===i?void 0:i.split(",")[0],style:{minWidth:null!=a&&a.minWidth?null==a?void 0:a.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 bl(e){let{taxHeadEstimatesCalculation:n}=e;const{taxHeadEstimates:o}=n,{t:a}=i.useTranslation();return l.createElement("div",{style:{marginTop:"40px"}},l.createElement(t.StatusTable,null,l.createElement(t.Row,{label:a("ES_PT_TITLE_TAX_HEADS"),text:a("ES_PT_TITLE_AMOUNT"),className:"border-none",textStyle:{fontWeight:"bold"}}),l.createElement(t.BreakLine,{style:{margin:"16px 0",width:"40%"}}),null==o?void 0:o.map((e,n)=>l.createElement(t.Row,{key:a(e.taxHeadCode),label:a(e.taxHeadCode),text:"₹ "+e.estimateAmount||"N/A",last:n===(null==o?void 0:o.length)-1,className:"border-none",textStyle:{color:"#505A5F"},labelStyle:{color:"#505A5F"}})),l.createElement(t.BreakLine,{style:{margin:"16px 0",width:"40%"}}),l.createElement(t.Row,{label:a("ES_PT_TITLE_TOTAL_DUE_AMOUNT"),text:"₹ "+(null==n?void 0:n.totalAmount)||"N/A",className:"border-none",textStyle:{fontSize:"24px",fontWeight:"bold"}})))}function Tl(e){let{floors:n}=e;const{t:o}=i.useTranslation();return l.createElement(l.Fragment,null,n.map(e=>{var n;return l.createElement("div",{key:o(null==e?void 0:e.title),style:{marginTop:"19px"}},l.createElement(t.CardSubHeader,{style:{marginBottom:"8px",color:"#505A5F",fontSize:"24px"}},o(null==e?void 0:e.title)),null==e||null===(n=e.values)||void 0===n?void 0:n.map((e,n)=>{var i;return l.createElement(l.Fragment,{key:n},l.createElement(t.CardSectionHeader,{style:{marginBottom:"16px",color:"#505A5F",fontSize:"16px",marginTop:0!==n?"16px":"revert"}},o(e.title)),l.createElement(t.StatusTable,{style:{position:"relative",padding:"8px"}},l.createElement("div",{style:{border:"1px solid #D6D5D4",padding:"16px",marginTop:"8px",borderRadius:"4px",background:"#FAFAFA",maxWidth:"100%"}},null==e||null===(i=e.values)||void 0===i?void 0:i.map((e,n)=>{var i;return l.createElement(t.Row,!0===e.map&&"N/A"!==e.value?{key:o(e.title),label:o(e.title),text:l.createElement("img",{src:o(e.value),alt:""})}:{key:o(e.title),label:o(e.title),text:o(e.value)||"N/A",last:n===(null==e||null===(i=e.values)||void 0===i?void 0:i.length)-1,caption:e.caption,className:"border-none"})}))))}))}))}function Al(e){let{owners:n}=e,o={};o=window.location.href.includes("/employee/pt/")?n.slice().reverse():n;const{t:a}=i.useTranslation(),r=(null==n?void 0:n.length)||1;let c={marginTop:"19px"},s={position:"relative",padding:"8px"},d={justifyContent:"space-between",fontSize:"16px",lineHeight:"19px",color:"#0B0C0C"};return Number(r)>1?c={marginTop:"19px",background:"#FAFAFA",border:"1px solid #D6D5D4",borderRadius:"4px",padding:"8px",lineHeight:"19px",maxWidth:"600px",minWidth:"280px"}:Number(r)>1||(c={marginTop:"19px",lineHeight:"19px",maxWidth:"600px",minWidth:"280px"},s={position:"relative",marginTop:"19px"}),window.location.href.includes("obps")&&(c=u({},c,{maxWidth:"950px"}),c=u({},c,{maxWidth:"950px"}),d={}),n.sort((e,t)=>{var n,l;return(null==e||null===(n=e.additionalDetails)||void 0===n?void 0:n.ownerSequence)-(null==t||null===(l=t.additionalDetails)||void 0===l?void 0:l.ownerSequence)}),l.createElement(l.Fragment,null,l.createElement("div",{className:"owner-details"},o.map((e,n)=>{var i;return l.createElement("div",{key:a(null==e?void 0:e.title),style:c,className:"owner-details-child"},l.createElement(t.CardSubHeader,{style:Number(r)>1?{marginBottom:"8px",paddingBottom:"9px",color:"#0B0C0C",fontSize:"16px",lineHeight:"19px"}:{marginBottom:"8px",color:"#505A5F",fontSize:"24px"}},Number(r)>1?a(null==e?void 0:e.title)+" "+(n+1):a(null==e?void 0:e.title)),l.createElement(l.Fragment,{key:n},l.createElement(t.StatusTable,{style:s},l.createElement("div",{style:{maxWidth:"640px",top:0,left:0,bottom:0,right:0,width:"auto"}}),null==e||null===(i=e.values)||void 0===i?void 0:i.map((e,n)=>{var i;return!0===e.map&&"N/A"!==e.value?l.createElement(t.Row,{key:a(e.title),label:a(e.title),text:l.createElement("img",{src:a(e.value),alt:"",privacy:null==e?void 0:e.privacy})}):l.createElement("span",null,l.createElement(t.Row,{key:a(e.title),label:""+a(e.title),text:a(e.value)||"N/A",last:n===(null==e||null===(i=e.values)||void 0===i?void 0:i.length)-1,caption:e.caption,className:"border-none",textStyle:e.textStyle,privacy:null==e?void 0:e.privacy,rowContainerStyle:d}))}))))})))}const Cl=e=>{var o,a,r;let{scrutinyDetails:u,paymentsList:c=[]}=e;const{t:s}=i.useTranslation(),d=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===(o=u.values)||void 0===o?void 0:o.map((e,n)=>null!=e&&e.isUnit?l.createElement(t.Row,{className:"border-none",textStyle:"Paid"===(null==e?void 0:e.value)?{color:"darkgreen"}:"Unpaid"===(null==e?void 0:e.value)?{color:"red"}:{},key:""+e.title,label:""+s(""+e.title),text:null!=e&&e.value?d(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:d(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===(a=u.permit)||void 0===a?void 0:a.map((e,n)=>l.createElement(t.CardLabel,{style:{fontWeight:"400"}},null==e?void 0:e.title))),l.createElement("div",null,null==u||null===(r=u.scruntinyDetails)||void 0===r?void 0:r.map((e,i)=>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))))))))},Dl=e=>{var o,a,r,u,c,s,d,p,v;let{edcrDetails:m,applicationData:f}=e;const{t:E}=i.useTranslation(),_=window.Digit.Utils.browser.isMobile(),h=[{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"}],g=e=>{const t=e;return(e,n,l)=>e[t]},S=n.useMemo(()=>h.map(e=>({Header:E(""+e.name),accessor:g(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,i,o,a,r,u,c;n.push({Floor:(null==e?void 0:e.floorName)||E("BPA_FLOOR_NAME_"+e.number),Level:(null==e?void 0:e.number)||(null==e?void 0:e.floorNo),Occupancy:E(""+("BPA-PAP"===(null==f?void 0:f.businessService)?"Residential":null===(t=e.occupancies)||void 0===t||null===(l=t[0])||void 0===l?void 0:l.type))||"NA",BuildupArea:(null==e||null===(i=e.occupancies)||void 0===i||null===(o=i[0])||void 0===o?void 0:o.builtUpArea)||(null==e?void 0:e.builtUpArea),FloorArea:(null==e||null===(a=e.occupancies)||void 0===a||null===(r=a[0])||void 0===r?void 0:r.floorArea)||(null==e?void 0:e.builtUpArea),CarpetArea:(null==e||null===(u=e.occupancies)||void 0===u||null===(c=u[0])||void 0===c?void 0:c.carpetArea)||0,key:(null==e?void 0:e.floorName)||E("BPA_FLOOR_NAME_"+e.number)})}),n}function b(e){var t;let n=null==f||null===(t=f.landInfo)||void 0===t?void 0:t.unit,l="";if((null==n?void 0:n.length)>0){var i,o;let t=null===(i=n[e])||void 0===i||null===(o=i.usageCategory)||void 0===o?void 0:o.split(",");null!=t&&t.length&&(l=t.map(e=>e?""+E("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==m||null===(o=m.values)||void 0===o?void 0:o.map((e,n)=>null!=e&&e.isHeader?l.createElement(t.CardSubHeader,{style:{fontSize:"20px",paddingBottom:"10px"}},E(null==e?void 0:e.title)):l.createElement(t.Row,{className:"border-none",labelStyle:{width:"100%",fontSize:"20px"},key:""+e.title,label:""+E(""+e.title),text:null!=e&&e.value?null==e?void 0:e.value:""}))),null==m||null===(a=m.subOccupancyTableDetails)||void 0===a||null===(r=a[0])||void 0===r||null===(u=r.value)||void 0===u||null===(c=u.planDetail)||void 0===c?void 0:c.blocks.map((e,n)=>{var i,o,a,r,u;return l.createElement("div",{key:n,style:(null==m||null===(i=m.subOccupancyTableDetails)||void 0===i||null===(o=i[0])||void 0===o||null===(a=o.value)||void 0===a||null===(r=a.planDetail)||void 0===r||null===(u=r.blocks)||void 0===u?void 0:u.length)>0?{marginBottom:"30px",background:"#FAFAFA",border:"1px solid #D6D5D4",padding:"8px",borderRadius:"4px",maxWidth:"950px",minWidth:"280px"}:{marginBottom:"30px"}},l.createElement(t.CardSubHeader,{style:{marginBottom:"8px",paddingBottom:"9px",color:"#0B0C0C",fontSize:"18px",lineHeight:"19px"}},E("BPA_BLOCK_SUBHEADER")," ",n+1),l.createElement(t.StatusTable,null,l.createElement(t.Row,{className:"border-none",textStyle:{wordBreak:"break-word"},label:""+E("BPA_SUB_OCCUPANCY_LABEL"),text:b(n)})),l.createElement("div",{style:window.location.href.includes("citizen")||_?{overflow:"scroll"}:{maxWidth:"950px",maxHeight:"280px"}},l.createElement(t.Table,{className:"customTable table-fixed-first-column table-border-style",t:E,disableSort:!1,autoSort:!0,manualPagination:!1,isPaginationRequired:!1,initSortId:"S N ",data:y(e),columns:S,getCellProps:e=>({style:{}})})))}),null==m||null===(s=m.subOccupancyTableDetails)||void 0===s||null===(d=s[0])||void 0===d||null===(p=d.value)||void 0===p||null===(v=p.drawingDetail)||void 0===v?void 0:v.blocks.map((e,n)=>{var i,o,a,r,u;return l.createElement("div",{key:n,style:(null==m||null===(i=m.subOccupancyTableDetails)||void 0===i||null===(o=i[0])||void 0===o||null===(a=o.value)||void 0===a||null===(r=a.drawingDetail)||void 0===r||null===(u=r.blocks)||void 0===u?void 0:u.length)>0?{marginBottom:"30px",background:"#FAFAFA",border:"1px solid #D6D5D4",padding:"8px",borderRadius:"4px",maxWidth:"950px",minWidth:"280px"}:{marginBottom:"30px"}},l.createElement(t.CardSubHeader,{style:{marginBottom:"8px",paddingBottom:"9px",color:"#0B0C0C",fontSize:"18px",lineHeight:"19px"}},E("BPA_BLOCK_SUBHEADER")," ",n+1),l.createElement(t.StatusTable,null,l.createElement(t.Row,{className:"border-none",textStyle:{wordBreak:"break-word"},label:""+E("BPA_SUB_OCCUPANCY_LABEL"),text:b(n)})),l.createElement("div",{style:window.location.href.includes("citizen")||_?{overflow:"scroll"}:{maxWidth:"950px",maxHeight:"280px"}},l.createElement(t.Table,{className:"customTable table-fixed-first-column table-border-style",t:E,disableSort:!1,autoSort:!0,manualPagination:!1,isPaginationRequired:!1,initSortId:"S N ",data:y(e),columns:S,getCellProps:e=>({style:{}})})))})))},Nl=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))};var Pl="function"==typeof Symbol&&Symbol.for,Rl=Pl?Symbol.for("react.element"):60103,Il=Pl?Symbol.for("react.portal"):60106,Ol=Pl?Symbol.for("react.fragment"):60107,xl=Pl?Symbol.for("react.strict_mode"):60108,wl=Pl?Symbol.for("react.profiler"):60114,Ll=Pl?Symbol.for("react.provider"):60109,Ml=Pl?Symbol.for("react.context"):60110,kl=Pl?Symbol.for("react.async_mode"):60111,Fl=Pl?Symbol.for("react.concurrent_mode"):60111,Bl=Pl?Symbol.for("react.forward_ref"):60112,Ul=Pl?Symbol.for("react.suspense"):60113,Hl=Pl?Symbol.for("react.suspense_list"):60120,jl=Pl?Symbol.for("react.memo"):60115,Wl=Pl?Symbol.for("react.lazy"):60116,zl=Pl?Symbol.for("react.block"):60121,Vl=Pl?Symbol.for("react.fundamental"):60117,Kl=Pl?Symbol.for("react.responder"):60118,Yl=Pl?Symbol.for("react.scope"):60119;function Gl(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case Rl:switch(e=e.type){case kl:case Fl:case Ol:case wl:case xl:case Ul:return e;default:switch(e=e&&e.$$typeof){case Ml:case Bl:case Wl:case jl:case Ll:return e;default:return t}}case Il:return t}}}function ql(e){return Gl(e)===Fl}var $l={AsyncMode:kl,ConcurrentMode:Fl,ContextConsumer:Ml,ContextProvider:Ll,Element:Rl,ForwardRef:Bl,Fragment:Ol,Lazy:Wl,Memo:jl,Portal:Il,Profiler:wl,StrictMode:xl,Suspense:Ul,isAsyncMode:function(e){return ql(e)||Gl(e)===kl},isConcurrentMode:ql,isContextConsumer:function(e){return Gl(e)===Ml},isContextProvider:function(e){return Gl(e)===Ll},isElement:function(e){return"object"==typeof e&&null!==e&&e.$$typeof===Rl},isForwardRef:function(e){return Gl(e)===Bl},isFragment:function(e){return Gl(e)===Ol},isLazy:function(e){return Gl(e)===Wl},isMemo:function(e){return Gl(e)===jl},isPortal:function(e){return Gl(e)===Il},isProfiler:function(e){return Gl(e)===wl},isStrictMode:function(e){return Gl(e)===xl},isSuspense:function(e){return Gl(e)===Ul},isValidElementType:function(e){return"string"==typeof e||"function"==typeof e||e===Ol||e===Fl||e===wl||e===xl||e===Ul||e===Hl||"object"==typeof e&&null!==e&&(e.$$typeof===Wl||e.$$typeof===jl||e.$$typeof===Ll||e.$$typeof===Ml||e.$$typeof===Bl||e.$$typeof===Vl||e.$$typeof===Kl||e.$$typeof===Yl||e.$$typeof===zl)},typeOf:Gl},Xl=v(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,i=e?Symbol.for("react.fragment"):60107,o=e?Symbol.for("react.strict_mode"):60108,a=e?Symbol.for("react.profiler"):60114,r=e?Symbol.for("react.provider"):60109,u=e?Symbol.for("react.context"):60110,c=e?Symbol.for("react.async_mode"):60111,s=e?Symbol.for("react.concurrent_mode"):60111,d=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,_=e?Symbol.for("react.fundamental"):60117,h=e?Symbol.for("react.responder"):60118,g=e?Symbol.for("react.scope"):60119;function S(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case n:var v=e.type;switch(v){case c:case s:case i:case a:case o:case p:return v;default:var E=v&&v.$$typeof;switch(E){case u:case d:case f:case m:case r:return E;default:return t}}case l:return t}}}var y=s,b=u,T=r,A=n,C=d,D=i,N=f,P=m,R=l,I=a,O=o,x=p,w=!1;function L(e){return S(e)===s}t.AsyncMode=c,t.ConcurrentMode=y,t.ContextConsumer=b,t.ContextProvider=T,t.Element=A,t.ForwardRef=C,t.Fragment=D,t.Lazy=N,t.Memo=P,t.Portal=R,t.Profiler=I,t.StrictMode=O,t.Suspense=x,t.isAsyncMode=function(e){return w||(w=!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.")),L(e)||S(e)===c},t.isConcurrentMode=L,t.isContextConsumer=function(e){return S(e)===u},t.isContextProvider=function(e){return S(e)===r},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===n},t.isForwardRef=function(e){return S(e)===d},t.isFragment=function(e){return S(e)===i},t.isLazy=function(e){return S(e)===f},t.isMemo=function(e){return S(e)===m},t.isPortal=function(e){return S(e)===l},t.isProfiler=function(e){return S(e)===a},t.isStrictMode=function(e){return S(e)===o},t.isSuspense=function(e){return S(e)===p},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===i||e===s||e===a||e===o||e===p||e===v||"object"==typeof e&&null!==e&&(e.$$typeof===f||e.$$typeof===m||e.$$typeof===r||e.$$typeof===u||e.$$typeof===d||e.$$typeof===_||e.$$typeof===h||e.$$typeof===g||e.$$typeof===E)},t.typeOf=S}()}),Zl=v(function(e){e.exports="production"===process.env.NODE_ENV?$l:Xl}),Jl=Object.getOwnPropertySymbols,Ql=Object.prototype.hasOwnProperty,ei=Object.prototype.propertyIsEnumerable;function ti(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}var ni=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,i=ti(e),o=1;o<arguments.length;o++){for(var a in n=Object(arguments[o]))Ql.call(n,a)&&(i[a]=n[a]);if(Jl){l=Jl(n);for(var r=0;r<l.length;r++)ei.call(n,l[r])&&(i[l[r]]=n[l[r]])}}return i},li="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",ii=Function.call.bind(Object.prototype.hasOwnProperty),oi=function(){};if("production"!==process.env.NODE_ENV){var ai=li,ri={},ui=ii;oi=function(e){var t="Warning: "+e;"undefined"!=typeof console&&console.error(t);try{throw new Error(t)}catch(e){}}}function ci(e,t,n,l,i){if("production"!==process.env.NODE_ENV)for(var o in e)if(ui(e,o)){var a;try{if("function"!=typeof e[o]){var r=Error((l||"React class")+": "+n+" type `"+o+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[o]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw r.name="Invariant Violation",r}a=e[o](t,o,l,n,null,ai)}catch(e){a=e}if(!a||a instanceof Error||oi((l||"React class")+": type specification of "+n+" `"+o+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof a+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),a instanceof Error&&!(a.message in ri)){ri[a.message]=!0;var u=i?i():"";oi("Failed "+n+" type: "+a.message+(null!=u?u:""))}}}ci.resetWarningCache=function(){"production"!==process.env.NODE_ENV&&(ri={})};var si=ci,di=function(){};function pi(){return null}function vi(){}function mi(){}"production"!==process.env.NODE_ENV&&(di=function(e){var t="Warning: "+e;"undefined"!=typeof console&&console.error(t);try{throw new Error(t)}catch(e){}}),mi.resetWarningCache=vi;var fi=v(function(e){e.exports="production"!==process.env.NODE_ENV?function(e,t){var n="function"==typeof Symbol&&Symbol.iterator,l={array:r("array"),bigint:r("bigint"),bool:r("boolean"),func:r("function"),number:r("number"),object:r("object"),string:r("string"),symbol:r("symbol"),any:a(pi),arrayOf:function(e){return a(function(t,n,l,i,a){if("function"!=typeof e)return new o("Property `"+a+"` of component `"+l+"` has invalid PropType notation inside arrayOf.");var r=t[n];if(!Array.isArray(r))return new o("Invalid "+i+" `"+a+"` of type `"+s(r)+"` supplied to `"+l+"`, expected an array.");for(var u=0;u<r.length;u++){var c=e(r,u,l,i,a+"["+u+"]",li);if(c instanceof Error)return c}return null})},element:a(function(t,n,l,i,a){var r=t[n];return e(r)?null:new o("Invalid "+i+" `"+a+"` of type `"+s(r)+"` supplied to `"+l+"`, expected a single ReactElement.")}),elementType:a(function(e,t,n,l,i){var a=e[t];return Zl.isValidElementType(a)?null:new o("Invalid "+l+" `"+i+"` of type `"+s(a)+"` supplied to `"+n+"`, expected a single ReactElement type.")}),instanceOf:function(e){return a(function(t,n,l,i,a){var r;return t[n]instanceof e?null:new o("Invalid "+i+" `"+a+"` of type `"+((r=t[n]).constructor&&r.constructor.name?r.constructor.name:"<<anonymous>>")+"` supplied to `"+l+"`, expected instance of `"+(e.name||"<<anonymous>>")+"`.")})},node:a(function(e,t,n,l,i){return c(e[t])?null:new o("Invalid "+l+" `"+i+"` supplied to `"+n+"`, expected a ReactNode.")}),objectOf:function(e){return a(function(t,n,l,i,a){if("function"!=typeof e)return new o("Property `"+a+"` of component `"+l+"` has invalid PropType notation inside objectOf.");var r=t[n],u=s(r);if("object"!==u)return new o("Invalid "+i+" `"+a+"` of type `"+u+"` supplied to `"+l+"`, expected an object.");for(var c in r)if(ii(r,c)){var d=e(r,c,l,i,a+"."+c,li);if(d instanceof Error)return d}return null})},oneOf:function(e){if(!Array.isArray(e))return"production"!==process.env.NODE_ENV&&di(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."),pi;function t(t,n,l,a,r){for(var u=t[n],c=0;c<e.length;c++)if(i(u,e[c]))return null;var s=JSON.stringify(e,function(e,t){return"symbol"===d(t)?String(t):t});return new o("Invalid "+a+" `"+r+"` of value `"+String(u)+"` supplied to `"+l+"`, expected one of "+s+".")}return a(t)},oneOfType:function(e){if(!Array.isArray(e))return"production"!==process.env.NODE_ENV&&di("Invalid argument supplied to oneOfType, expected an instance of array."),pi;for(var t=0;t<e.length;t++){var n=e[t];if("function"!=typeof n)return di("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+p(n)+" at index "+t+"."),pi}return a(function(t,n,l,i,a){for(var r=[],u=0;u<e.length;u++){var c=(0,e[u])(t,n,l,i,a,li);if(null==c)return null;c.data&&ii(c.data,"expectedType")&&r.push(c.data.expectedType)}return new o("Invalid "+i+" `"+a+"` supplied to `"+l+"`"+(r.length>0?", expected one of type ["+r.join(", ")+"]":"")+".")})},shape:function(e){return a(function(t,n,l,i,a){var r=t[n],c=s(r);if("object"!==c)return new o("Invalid "+i+" `"+a+"` of type `"+c+"` supplied to `"+l+"`, expected `object`.");for(var p in e){var v=e[p];if("function"!=typeof v)return u(l,i,a,p,d(v));var m=v(r,p,l,i,a+"."+p,li);if(m)return m}return null})},exact:function(e){return a(function(t,n,l,i,a){var r=t[n],c=s(r);if("object"!==c)return new o("Invalid "+i+" `"+a+"` of type `"+c+"` supplied to `"+l+"`, expected `object`.");var p=ni({},t[n],e);for(var v in p){var m=e[v];if(ii(e,v)&&"function"!=typeof m)return u(l,i,a,v,d(m));if(!m)return new o("Invalid "+i+" `"+a+"` key `"+v+"` supplied to `"+l+"`.\nBad object: "+JSON.stringify(t[n],null," ")+"\nValid keys: "+JSON.stringify(Object.keys(e),null," "));var f=m(r,v,l,i,a+"."+v,li);if(f)return f}return null})}};function i(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}function o(e,t){this.message=e,this.data=t&&"object"==typeof t?t:{},this.stack=""}function a(e){function t(t,n,l,i,a,r,u){if(i=i||"<<anonymous>>",r=r||l,u!==li){var c=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 c.name="Invariant Violation",c}return null==n[l]?t?new o(null===n[l]?"The "+a+" `"+r+"` is marked as required in `"+i+"`, but its value is `null`.":"The "+a+" `"+r+"` is marked as required in `"+i+"`, but its value is `undefined`."):null:e(n,l,i,a,r)}process;var n=t.bind(null,!1);return n.isRequired=t.bind(null,!0),n}function r(e){return a(function(t,n,l,i,a,r){var u=t[n];return s(u)!==e?new o("Invalid "+i+" `"+a+"` of type `"+d(u)+"` supplied to `"+l+"`, expected `"+e+"`.",{expectedType:e}):null})}function u(e,t,n,l,i){return new o((e||"React class")+": "+t+" type `"+n+"."+l+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+i+"`.")}function c(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(c);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 i,o=l.call(t);if(l!==t.entries){for(;!(i=o.next()).done;)if(!c(i.value))return!1}else for(;!(i=o.next()).done;){var a=i.value;if(a&&!c(a[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 d(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=d(e);switch(t){case"array":case"object":return"an "+t;case"boolean":case"date":case"regexp":return"a "+t;default:return t}}return o.prototype=Error.prototype,l.checkPropTypes=si,l.resetWarningCache=si.resetWarningCache,l.PropTypes=l,l}(Zl.isElement):function(){function e(e,t,n,l,i,o){if(o!==li){var a=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 a.name="Invariant Violation",a}}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:mi,resetWarningCache:vi};return n.PropTypes=n,n}()});const Ei=e=>{let{className:t,width:n=80,height:i=80,style:o={background:"#f6f6f6",padding:"8px",boxShadow:"0px 2px 0px #d6d5d3",borderRadius:"2px"},viewBox:a="0 0 80 80"}=e;return l.createElement("svg",{className:t,width:n,height:i,style:o,viewBox:a,fill:"none",xmlns:"http://www.w3.org/2000/svg"},l.createElement("path",{d:"M46.6667 6.6665H20C16.3334 6.6665 13.3667 9.6665 13.3667 13.3332L13.3334 66.6665C13.3334 70.3332 16.3 73.3332 19.9667 73.3332H60C63.6667 73.3332 66.6667 70.3332 66.6667 66.6665V26.6665L46.6667 6.6665ZM53.3334 59.9998H26.6667V53.3332H53.3334V59.9998ZM53.3334 46.6665H26.6667V39.9998H53.3334V46.6665ZM43.3334 29.9998V11.6665L61.6667 29.9998H43.3334Z",fill:"#505A5F"}))},_i=e=>{let{source:t,index:n,last:i=!1,onClick:o,selectedIndex:a,drawingNo:r}=e;const u=a===n;return"pdf"===Digit.Utils.getFileTypeFromFileStoreURL(t)?l.createElement("div",{style:{display:"flex",flexWrap:"wrap",justifyContent:"flex-start",alignContent:"center"}},l.createElement("a",{target:"_blank",rel:"noopener noreferrer",href:t,style:{minWidth:"100px",marginRight:"10px",maxWidth:"100px",height:"auto"}},l.createElement("div",{style:{display:"flex",justifyContent:"center"}},l.createElement(Ei,{style:{background:"#f6f6f6",padding:"8px",width:"100px"},width:"100px",height:"100px"})))):l.createElement("div",null,l.createElement("img",{style:{width:"200px",padding:"3px",height:"200px",margin:"8px",border:u?"4px solid black":"none"},src:t,alt:"issue thumbnail",onClick:()=>o(t,n),className:i?"last":""}),r&&l.createElement("div",{style:{marginTop:"12px",marginLeft:"12px",marginBottom:"5px",fontSize:"14px"}},r))},hi=e=>{let{srcs:t,drawingNos:i=[],onClick:o}=e;const[a,r]=n.useState(null),u=(e,t)=>{r(t),o&&o(e,t)};return l.createElement("div",{className:"photos-wrap",style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(200px, 1fr))"}},null==t?void 0:t.map((e,n)=>l.createElement(_i,{key:n,source:e,index:n,last:n===t.length-1,selectedIndex:a,onClick:u,drawingNo:i[n]})))};hi.propTypes={srcs:fi.arrayOf(fi.string),drawingNos:fi.arrayOf(fi.string),onClick:fi.func},hi.defaultProps={srcs:[],drawingNos:[]};const gi=e=>{var n,o,a;let{data:r,OpenImage:u,privacy:c={}}=e;const{t:s}=i.useTranslation();return l.createElement("div",null,r.date&&l.createElement("p",null,r.date),l.createElement("p",null,r.name),r.mobileNumber&&l.createElement("span",{style:{display:"inline-flex",width:"fit-content",marginLeft:"10px"}},l.createElement(t.TelePhone,{mobile:r.mobileNumber,privacy:c}),l.createElement("p",null,"    ")),r.source&&l.createElement("p",null,s("ES_APPLICATION_DETAILS_APPLICATION_CHANNEL_"+r.source.toUpperCase())),r.comment&&l.createElement(Nl,{otherComment:null==r?void 0:r.otherComment,headComment:null==r?void 0:r.comment}),null!=r&&r.wfComment?l.createElement("div",null,null==r||null===(n=r.wfComment)||void 0===n?void 0:n.map(e=>l.createElement("div",{className:"TLComments"},l.createElement("h3",null,s("WF_COMMON_COMMENTS")),l.createElement("p",{style:{overflowX:"scroll"}},e)))):null,(null==r||null===(o=r.thumbnailsToShow)||void 0===o||null===(a=o.thumbs)||void 0===a?void 0:a.length)>0?l.createElement("div",{className:"TLComments"},l.createElement("h3",null,s("CS_COMMON_ATTACHMENTS")),l.createElement(hi,{srcs:null==r?void 0:r.thumbnailsToShow.thumbs,onClick:(e,t)=>{u(e,t,null==r?void 0:r.thumbnailsToShow)}})):null)};function Si(e){let{units:n}=e;const{t:o}=i.useTranslation();return l.createElement(l.Fragment,null,n.map((e,n)=>{var i;return l.createElement("div",{key:o(null==e?void 0:e.title),style:{marginTop:"19px",background:"#FAFAFA",border:"1px solid #D6D5D4",borderRadius:"4px",padding:"8px",lineHeight:"19px",maxWidth:"600px",minWidth:"280px"}},l.createElement(t.CardSubHeader,{style:{marginBottom:"8px",paddingBottom:"9px",color:"#0B0C0C",fontSize:"16px",lineHeight:"19px"}},o(null==e?void 0:e.title)+" "+(n+1)),l.createElement(l.Fragment,{key:n},l.createElement(t.StatusTable,{style:{position:"relative",marginTop:"19px"}},l.createElement("div",{style:{position:"absolute",maxWidth:"640px",top:0,left:0,bottom:0,right:0,width:"auto"}}),null==e||null===(i=e.values)||void 0===i?void 0:i.map((e,n)=>{var i;return l.createElement(t.Row,!0===e.map&&"N/A"!==e.value?{key:o(e.title),label:o(e.title),text:l.createElement("img",{src:o(e.value),alt:""})}:{key:o(e.title),label:o(e.title)+":",text:o(e.value)||"N/A",last:n===(null==e||null===(i=e.values)||void 0===i?void 0:i.length)-1,caption:e.caption,className:"border-none",rowContainerStyle:{justifyContent:"space-between",fontSize:"16px",lineHeight:"19px",color:"#0B0C0C"}})}))))}))}function yi(e){let{units:n}=e;const{t:o}=i.useTranslation();return l.createElement(l.Fragment,null,n.map((e,n)=>{var i;return l.createElement("div",{key:o(null==e?void 0:e.title),style:{marginTop:"19px",background:"#FAFAFA",border:"1px solid #D6D5D4",borderRadius:"4px",padding:"8px",lineHeight:"19px",maxWidth:"600px",minWidth:"280px"}},l.createElement(t.CardSubHeader,{style:{marginBottom:"9px",paddingBottom:"9px",color:"#0B0C0C",fontSize:"16px",lineHeight:"19px"}},o(null==e?void 0:e.title)+" "+(n+1)),l.createElement(l.Fragment,{key:n},l.createElement(t.StatusTable,{style:{position:"relative",marginTop:"19px"}},l.createElement("div",{style:{position:"absolute",maxWidth:"640px",top:0,left:0,bottom:0,right:0,width:"auto"}}),null==e||null===(i=e.values)||void 0===i?void 0:i.map((e,n)=>{var i;return l.createElement(t.Row,!0===e.map&&"N/A"!==e.value?{key:o(e.title),label:o(e.title),text:l.createElement("img",{src:o(e.value),alt:""})}:{key:o(e.title),label:o(e.title)+":",text:o(e.value)||"NA",last:n===(null==e||null===(i=e.values)||void 0===i?void 0:i.length)-1,caption:e.caption,className:"border-none",rowContainerStyle:{justifyContent:"space-between",fontSize:"16px",lineHeight:"19px",color:"#0B0C0C"}})}))))}))}const bi=e=>{var o,a,r,u;let{wsAdditionalDetails:c}=e;const{t:s}=i.useTranslation();let d=(p=location.search)?(/^[?#]/.test(p)?p.slice(1):p).split("&").reduce((e,t)=>{let[n,l]=t.split("=");return e[n]=l?decodeURIComponent(l.replace(/\+/g," ")):"",e},{}):{};var p;const v=null==d?void 0:d.mode;var{connectionDetails:m,plumberDetails:f,roadCuttingDetails:E,activationDetails:_}=(null==c?void 0:c.additionalDetails)||{connectionDetails:[],plumberDetails:[]};return l.createElement(n.Fragment,null,l.createElement("div",{style:{lineHeight:"19px",maxWidth:"950px",minWidth:"280px"}},(null==c||null===(o=c.additionalDetails)||void 0===o?void 0:o.connectionDetails)&&l.createElement(t.StatusTable,null,l.createElement(t.CardSubHeader,{style:{fontSize:"24px",marginBottom:"16px",marginTop:"32px"}},s("WS_COMMON_CONNECTION_DETAIL")),l.createElement("div",null,l.createElement("div",{className:"connection-details-new-value-wrapper"},null==m?void 0:m.map((e,n)=>l.createElement("div",null,l.createElement(t.Row,{className:"border-none",key:""+e.title,label:""+s(""+e.title),text:null!=e&&e.oldValue?null==e?void 0:e.oldValue:null!=e&&e.value?null==e?void 0:e.value:""})))))),(null==c||null===(a=c.additionalDetails)||void 0===a?void 0:a.plumberDetails)&&"MODIFY"!=v&&l.createElement(t.StatusTable,null,l.createElement(t.CardSubHeader,{style:{fontSize:"24px",marginBottom:"16px",marginTop:"32px"}},s("WS_COMMON_PLUMBER_DETAILS")),l.createElement("div",null,l.createElement("div",{className:"plumber-details-new-value-wrapper"},null==f?void 0:f.map((e,n)=>l.createElement(t.Row,{className:"border-none",key:""+e.title,label:""+s(""+e.title),text:null!=e&&e.oldValue?null==e?void 0:e.oldValue:null!=e&&e.value?null==e?void 0:e.value:"",privacy:e.privacy}))))),(null==c||null===(r=c.additionalDetails)||void 0===r?void 0:r.roadCuttingDetails)&&"MODIFY"!=v&&l.createElement(t.StatusTable,null,l.createElement(t.CardSubHeader,{style:{fontSize:"24px",marginBottom:"16px",marginTop:"32px"}},s("WS_ROAD_CUTTING_DETAILS")),l.createElement("div",null,l.createElement("div",{className:"plumber-details-new-value-wrapper"},null==E?void 0:E.map(e=>{var n;return l.createElement("div",{style:(null==E?void 0:E.length)>1?{border:"1px solid #D6D5D4",background:"#FAFAFA",borderRadius:"4px",padding:"10px 10px 0px 10px",margin:"5px 0px"}:{}},null==e||null===(n=e.values)||void 0===n?void 0:n.map(e=>l.createElement(t.Row,{className:"border-none",key:""+e.title,label:""+s(""+e.title),text:null!=e&&e.oldValue?null==e?void 0:e.oldValue:null!=e&&e.value?null==e?void 0:e.value:""})))})))),(null==c||null===(u=c.additionalDetails)||void 0===u?void 0:u.activationDetails)&&l.createElement(t.StatusTable,null,l.createElement(t.CardSubHeader,{style:{fontSize:"24px",marginBottom:"16px",marginTop:"32px"}},s("WS_ACTIVATION_DETAILS")),l.createElement("div",null,l.createElement("div",{className:"plumber-details-new-value-wrapper"},null==_?void 0:_.map((e,n)=>l.createElement(t.Row,{className:"border-none",key:""+e.title,label:""+s(""+e.title),text:null!=e&&e.oldValue?null==e?void 0:e.oldValue:null!=e&&e.value?null==e?void 0:e.value:""})))))))},Ti=[{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"}],Ai=[{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"}],Ci=e=>{var o,a,r,c;let{wsAdditionalDetails:s}=e;const{t:d}=i.useTranslation(),[p,v,m]=Digit.Hooks.useSessionStorage("ADHOC_ADD_REBATE_DATA",{}),[f,E,h]=Digit.Hooks.useSessionStorage("ADHOC_BILL_ADD_REBATE_DATA",{}),g=!(null==s||null===(o=s.additionalDetails)||void 0===o||!o.isPaid),[S,y]=n.useState(!1),[b,T]=n.useState(p||{}),[A,C]=n.useState(null),[D,N]=n.useState(s.additionalDetails.data?s.additionalDetails.data:{}),[P,R]=n.useState(s.additionalDetails.values?s.additionalDetails.values:[]),I=Digit.ULBService.getStateId();Digit.Hooks.ws.useMDMS(I,"BillingService",["TaxHeadMaster"]),n.useEffect(()=>{var e,t,n;const i=u({},null==s||null===(e=s.additionalDetails)||void 0===e||null===(t=e.appDetails)||void 0===t?void 0:t.additionalDetails);if((null==p||null===(n=p.billDetails)||void 0===n?void 0:n.length)>0){var o,a,r,c,d,m,f;const e=[{title:"WS_APPLICATION_FEE_HEADER",value:l.createElement("span",null,"₹",null==p||null===(o=p.billDetails)||void 0===o||null===(a=o[0])||void 0===a?void 0:a.fee)},{title:"WS_SERVICE_FEE_HEADER",value:l.createElement("span",null,"₹",null==p||null===(r=p.billDetails)||void 0===r||null===(c=r[0])||void 0===c?void 0:c.charge)},{title:"WS_TAX_HEADER",value:l.createElement("span",null,"₹",null==p||null===(d=p.billDetails)||void 0===d||null===(m=d[0])||void 0===m?void 0:m.taxAmount)}];R(e),N(null==p||null===(f=p.billDetails)||void 0===f?void 0:f[0])}else v(i),T(i)},[]);let O={};const x=e=>l.createElement("h1",{className:"heading-m"},e.label),w=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),L=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(w,null)),M=function(e,t,n){void 0===t&&(t=!1);let l=u({},b);if("adhocPenalty"!=e&&"adhocRebate"!=e||!n.target.value)t?(l[e+"_data"]=n,l[e]=n.title,"PT_OTHERS"==n.title&&"adhocPenaltyReason"==e&&(l.adhocPenaltyComment=""),"PT_OTHERS"==n.title&&"adhocRebateReason"==e&&(l.adhocRebateComment="")):l[e]=n.target.value;else{var i,o;const t=0==(null==n||null===(i=n.target)||void 0===i?void 0:i.value)?1:Math.sign(null==n||null===(o=n.target)||void 0===o?void 0:o.value)||-1;l[e]=1==t?n.target.value:""}T(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:""+d(""+e.title),text:null!=e&&e.value?null==e?void 0:e.value:""}))),l.createElement("hr",{style:{border:"1px solid #D6D5D4",color:"#D6D5D4",margin:"16px 0px"}}),l.createElement("div",null,l.createElement(t.Row,{className:"border-none",key:"WS_COMMON_TOTAL_AMT",label:""+d("WS_COMMON_TOTAL_AMT"),text:l.createElement("span",null,"₹",(null==D?void 0:D.totalAmount)||0),textStyle:{fontSize:"24px",fontWeight:"700"}}),l.createElement(t.Row,{className:"border-none",key:"CS_INBOX_STATUS_FILTER",label:""+d("CS_INBOX_STATUS_FILTER"),text:d(g?"WS_COMMON_PAID_LABEL":"WS_COMMON_NOT_PAID"),textStyle:g?{color:"#00703C"}:{color:"#D4351C"}}))),null!=s&&null!==(a=s.additionalDetails)&&void 0!==a&&a.isAdhocRebate?l.createElement("div",{onClick:e=>{y(!0)}},l.createElement("span",{style:{cursor:"pointer",color:"#a82227"}},d("WS_PAYMENT_ADD_REBATE_PENALTY"))):null,S&&l.createElement(t.Modal,{headerBarMain:l.createElement(x,{label:d("PT_ADD_REBATE_PENALITY")}),headerBarEnd:l.createElement(L,{onClick:()=>{T(p),y(!1)}}),actionCancelLabel:d("PT_CANCEL"),actionCancelOnSubmit:()=>{T(p),y(!1)},actionSaveLabel:d("PT_ADD"),actionSaveOnSubmit:e=>(e=>{const t=null!=b&&b.adhocPenalty?Number(null==b?void 0:b.adhocPenalty):0,n=null!=b&&b.adhocRebate?Number(null==b?void 0:b.adhocRebate):0;var l,i;if(t||n)if(n>(null==s||null===(l=s.additionalDetails)||void 0===l||null===(i=l.data)||void 0===i?void 0:i.totalAmount))C({isError:!1,isWarning:!0,key:"error",message:d("ERR_WS_REBATE_GREATER_THAN_AMOUNT")});else{var o,a,r,c,p,m,f,h,g,S;const e=null==s||null===(o=s.additionalDetails)||void 0===o||null===(a=o.appDetails)||void 0===a?void 0:a.applicationNo,t=null==s||null===(r=s.additionalDetails)||void 0===r||null===(c=r.appDetails)||void 0===c?void 0:c.tenantId,n=u({},null==s||null===(p=s.additionalDetails)||void 0===p||null===(m=p.appDetails)||void 0===m?void 0:m.additionalDetails,b);s.additionalDetails.appDetails.additionalDetails=n;const l={CalculationCriteria:"WATER"==(null==s||null===(f=s.additionalDetails)||void 0===f||null===(h=f.appDetails)||void 0===h?void 0:h.service)?[{applicationNo:e,tenantId:t,waterConnection:s.additionalDetails.appDetails}]:[{applicationNo:e,tenantId:t,sewerageConnection:s.additionalDetails.appDetails}],isconnectionCalculation:!1};let i="WATER"==(null==s||null===(g=s.additionalDetails)||void 0===g||null===(S=g.appDetails)||void 0===S?void 0:S.service)?"WS":"SW";Digit.WSService.wsCalculationEstimate(l,i).then((e,t)=>{var n,l,i,o,a,r,u,c,s,d,p,m,f,h,g;(null==e||null===(n=e.Calculation)||void 0===n||null===(l=n[0])||void 0===l||null===(i=l.taxHeadEstimates)||void 0===i?void 0:i.length)>0&&(null==e||null===(f=e.Calculation)||void 0===f||null===(h=f[0])||void 0===h||null===(g=h.taxHeadEstimates)||void 0===g||g.forEach(e=>e.amount=e.estimateAmount)),e.Calculation[0].billSlabData=_.groupBy(null==e||null===(o=e.Calculation)||void 0===o||null===(a=o[0])||void 0===a?void 0:a.taxHeadEstimates,"category");const S=[{title:"WS_APPLICATION_FEE_HEADER",value:null===(r=e.Calculation)||void 0===r||null===(u=r[0])||void 0===u?void 0:u.fee},{title:"WS_SERVICE_FEE_HEADER",value:null===(c=e.Calculation)||void 0===c||null===(s=c[0])||void 0===s?void 0:s.charge},{title:"WS_TAX_HEADER",value:null===(d=e.Calculation)||void 0===d||null===(p=d[0])||void 0===p?void 0:p.taxAmount}];E(Fn(e.Calculation[0])),N(null==e||null===(m=e.Calculation)||void 0===m?void 0:m[0]),R(S),b.billDetails=null==e?void 0:e.Calculation,v(b),y(!1)}).catch(e=>{var t,n,l,i,o,a;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?d(""+(null==e||null===(i=e.response)||void 0===i||null===(o=i.data)||void 0===o||null===(a=o.Errors[0])||void 0===a?void 0:a.code)):d("PT_COMMON_ADD_REBATE_PENALITY")})})}else C({isError:!1,isWarning:!0,key:"warning",message:d("ERR_WS_ENTER_ATLEAST_ONE_FIELD")})})(),hideSubmit:!1,popupStyles:{overflowY:"auto"}},l.createElement("div",null,l.createElement(t.Card,{style:{padding:"10px 10px 1px 10px",margin:"0px 0px 15px 0px"}},l.createElement(t.CardSectionHeader,{style:{fontSize:"16px",fontWeight:"700",lineHeight:"18px",padding:"0px",margin:"0px 0px 10px 0px"}},d("PT_AD_PENALTY")),l.createElement(t.CardLabel,null,d("PT_TX_HEADS")),l.createElement("div",{className:"field"},l.createElement(t.Dropdown,{isMandatory:!0,option:Ti,optionKey:"title",select:e=>M("adhocPenaltyReason",!0,e),selected:(null==b?void 0:b.adhocPenaltyReason_data)||"",isPropertyAssess:!0,name:"adhocPenaltyReason_data",t:d})),"PT_OTHERS"===(null==b||null===(r=b.adhocPenaltyReason_data)||void 0===r?void 0:r.title)&&l.createElement("div",{className:"field"},l.createElement(t.CardLabel,null,d("PT_REASON")),l.createElement("div",{className:"field"},l.createElement(t.TextInput,u({style:{background:"#FAFAFA"},t:d,type:"text",isMandatory:!1,name:"adhocPenaltyComment",value:(null==b?void 0:b.adhocPenaltyComment)||"",onChange:e=>M("adhocPenaltyComment",!1,e)},O={isRequired:!0,pattern:"^[a-zA-Z ]*$",type:"text",title:d("TL_NAME_ERROR_MESSAGE")})))),l.createElement(t.CardLabel,null,d("PT_HEAD_AMT")),l.createElement("div",{className:"field"},l.createElement(t.TextInput,u({style:{background:"#FAFAFA"},t:d,type:"number",isMandatory:!1,name:"adhocPenalty",value:(null==b?void 0:b.adhocPenalty)||"",onChange:e=>M("adhocPenalty",!1,e)},O={isRequired:!0,pattern:"^[1-9]+[0-9]*$",title:d("ERR_DEFAULT_INPUT_FIELD_MSG")})))),l.createElement(t.Card,{style:{padding:"10px 10px 1px 10px",margin:"0px 0px 15px 0px"}},l.createElement(t.CardSectionHeader,{style:{fontSize:"16px",fontWeight:"700",lineHeight:"18px",padding:"0px",margin:"0px 0px 10px 0px"}},d("PT_AD_REBATE")),l.createElement(t.CardLabel,null,d("PT_TX_HEADS")),l.createElement("div",{className:"field"},l.createElement(t.Dropdown,{isMandatory:!0,option:Ai,optionKey:"title",select:e=>M("adhocRebateReason",!0,e),selected:(null==b?void 0:b.adhocRebateReason_data)||"",name:"adhocRebateReason_data",isPropertyAssess:!0,t:d})),"PT_OTHERS"===(null==b||null===(c=b.adhocRebateReason_data)||void 0===c?void 0:c.title)&&l.createElement("div",{className:"field"},l.createElement(t.CardLabel,null,d("PT_REASON")),l.createElement(t.TextInput,u({style:{background:"#FAFAFA"},t:d,type:"text",isMandatory:!1,name:"adhocRebateComment",value:(null==b?void 0:b.adhocRebateComment)||"",onChange:e=>M("adhocRebateComment",!1,e)},O={isRequired:!0,pattern:"^[a-zA-Z ]*$",type:"text",title:d("TL_NAME_ERROR_MESSAGE")}))),l.createElement(t.CardLabel,null,d("PT_HEAD_AMT")),l.createElement("div",{className:"field"},l.createElement(t.TextInput,u({style:{background:"#FAFAFA"},t:d,type:"number",isMandatory:!1,name:"adhocRebate",value:(null==b?void 0:b.adhocRebate)||"",onChange:e=>M("adhocRebate",!1,e)},O={isRequired:!0,pattern:"^[1-9]+[0-9]*$",title:d("ERR_DEFAULT_INPUT_FIELD_MSG")})))))," "),A&&l.createElement(t.Toast,{style:{zIndex:"10000"},warning:null==A?void 0:A.isWarning,error:null==A||!A.isWarning,label:d(null==A?void 0:A.message),onClose:()=>{C(!1)},isDleteBtn:!0})))},Di=e=>{let{style:t}=e;return l.createElement("span",null,l.createElement("svg",{style:u({},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"})))},Ni=e=>{let{t:n,userType:i=!1,infoBannerLabel:o="",infoClickLable:a="",infoClickInfoLabel:r="",infoClickInfoLabel1:u=""}=e;i=i||Digit.SessionStorage.get("userType");const c=window.Digit.Utils.browser.isMobile();return l.createElement(l.Fragment,null,l.createElement("div",{style:c?{}:{width:"80%"}},l.createElement("div",{className:"info-banner-wrap",style:{color:"#3498DB",margin:"0px"}},l.createElement("div",null,l.createElement(t.InfoBannerIcon,null),l.createElement("h2",{style:{color:"#3498DB"}},n(o))),n(a)+" ",l.createElement(Di,{style:{display:"inline",marginBottom:"5px"}})," "+n(r),l.createElement("div",null," "+n(u)))))},Pi=e=>{var o,a,r,u,c,s,d;let{wsAdditionalDetails:p}=e;const{t:v}=i.useTranslation(),[m,f]=n.useState(!1),[E,_]=n.useState({}),h=e=>l.createElement("h1",{className:"heading-m"},e.label),g=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),S=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(g,null));return l.createElement(n.Fragment,null,l.createElement("div",{style:{lineHeight:"19px",maxWidth:"950px",minWidth:"280px"}},null!=p&&null!==(o=p.additionalDetails)&&void 0!==o&&o.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),_(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(h,{label:v("WS_CALCULATION_BREAKUP")}),headerBarEnd:l.createElement(S,{onClick:()=>{f(!1)}}),hideSubmit:!0,popupStyles:{overflowY:"auto"},headerBarMainStyle:{marginBottom:"0px"},popupModuleMianStyles:{paddingTop:"0px"}},l.createElement(t.StatusTable,{style:{padding:"10px",paddingTop:"0px"}},l.createElement(t.CardSectionHeader,{style:{margin:"10px 0px"}},v("WS_APPLICATION_FEE_HEADER")),null==E||null===(a=E.billSlabData)||void 0===a||null===(r=a.FEE)||void 0===r?void 0:r.map(e=>l.createElement(t.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:""+(null==e?void 0:e.taxHeadCode),label:""+v(""+(null==e?void 0:e.taxHeadCode)),text:l.createElement("span",null,"₹",Number(null==e?void 0:e.amount)||0),textStyle:{textAlign:"right"}})),l.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",marginBottom:"10px"}}),l.createElement(t.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:"PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT1",label:""+v("PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT"),text:l.createElement("span",null,"₹",Number(null==E?void 0:E.fee)||0),textStyle:{textAlign:"right",fontWeight:"700",fontSize:"24px"}}),l.createElement(t.CardSectionHeader,{style:{margin:"10px 0px"}},v("WS_SERVICE_FEE_HEADER")),null==E||null===(u=E.billSlabData)||void 0===u||null===(c=u.CHARGES)||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_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===(d=s.TAX)||void 0===d?void 0:d.map(e=>l.createElement(t.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:""+(null==e?void 0:e.taxHeadCode),label:""+v(""+(null==e?void 0:e.taxHeadCode)),text:l.createElement("span",null,"₹",Number(null==e?void 0:e.amount)||0),textStyle:{textAlign:"right"}})),l.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",marginBottom:"10px"}}),l.createElement(t.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:"PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT3",label:""+v("PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT"),text:l.createElement("span",null,"₹",Number(null==E?void 0:E.totalAmount)||0),textStyle:{textAlign:"right",fontWeight:"700",fontSize:"24px"}})))))},Ri={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:{}},Ii=e=>{let{className:t="table",headers:n=[],values:o=[],arrears:a=0}=e;const{t:r}=i.useTranslation();return l.createElement(l.Fragment,null,l.createElement("div",{style:Ri.root},l.createElement("table",{className:"table-fixed-column-common-pay",style:Ri.table},l.createElement("thead",null,l.createElement("tr",null,l.createElement("th",{style:u({},Ri.cell,Ri.cellLeft,Ri.cellHeader)},r("CS_BILL_PERIOD")),n.map((e,t)=>l.createElement("th",{style:u({},Ri.cell,n.length==t+1?Ri.cellRight:{},Ri.cellHeader),key:t},r(e))))),l.createElement("tbody",null,Object.values(o).map((e,t)=>l.createElement("tr",{key:t},l.createElement("td",{style:u({},Ri.cell,Ri.cellLeft),component:"th",scope:"row"},Object.keys(o)[t]),n.map((t,i)=>l.createElement("td",{style:u({},Ri.cell,{textAlign:"left"},n.length==i+1?Ri.cellRight:{},{whiteSpace:"pre"}),key:i,numeric:!0},i>1&&"₹",e[t]&&e[t].value||"0")))),l.createElement("tr",null,l.createElement("td",{style:u({},Ri.cell,Ri.cellLeft)}),n.map((e,t)=>t==n.length-1?l.createElement("td",{style:u({},Ri.cell,Ri.cellRight,{textAlign:"left",fontWeight:"700",whiteSpace:"pre"}),key:t,numeric:!0},a):t==n.length-2?l.createElement("td",{style:u({},Ri.cell,{textAlign:"left"}),key:t,numeric:!0},r("COMMON_ARREARS_TOTAL")):l.createElement("td",{style:Ri.cell,key:t,numeric:!0})))))))},Oi={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))"}},xi=e=>{var t,o,a;let{bill:r={}}=e;const{t:u}=i.useTranslation();let c={},s=(null==r||null===(t=r.billDetails)||void 0===t?void 0:t.sort((e,t)=>t.fromPeriod-e.fromPeriod))||[];s=[...s];const d=(null===(o=s)||void 0===o?void 0:o.reduce((e,t,n)=>0===n?e:e+t.amount,0))||0;let p="₹ "+((null==d||null===(a=d.toFixed)||void 0===a?void 0:a.call(d,0))||Number(0).toFixed(0));s.shift(),s.map(e=>{let t=function(e){var t,n,l;void 0===e&&(e={});let i={};const{billAccountDetails:o=[]}=e;return o.map(e=>{i[e.taxHeadCode]={value:e.amount,order:e.order}}),i.CS_BILL_NO={value:(null===(t=e)||void 0===t?void 0:t.billNumber)||"NA",order:-2},i.CS_BILL_DUEDATE={value:(null===(n=e)||void 0===n?void 0:n.expiryDate)&&new Date(null===(l=e)||void 0===l?void 0:l.expiryDate).toLocaleDateString()||"NA",order:-1},i.TL_COMMON_TOTAL_AMT={value:e.amount,order:10},i}(e);c[((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={};!c||Object.keys(c).map((e,t)=>{Object.keys(c[e]).map(t=>{v[t]=c[e]&&c[e][t]&&c[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==d||d<0?l.createElement("span",null):l.createElement(l.Fragment,null,l.createElement("div",{style:Oi.headerStyle},u("CS_ARREARS_DETAILS")),f&&l.createElement(Ii,{headers:[...m],values:c,arrears:p}),!f&&l.createElement("div",{style:Oi.buttonStyle},l.createElement("button",{type:"button",onClick:()=>{E(!0)}},u("CS_SHOW_CARD"))),f&&l.createElement("div",{style:Oi.buttonStyle},l.createElement("button",{type:"button",onClick:()=>{E(!1)}},u("CS_HIDE_CARD"))))};function wi(e){var a,r,u,c,s,d,p,v,m,f,E,h,g,S,y;let{applicationDetails:b,workflowDetails:T,isDataLoading:A,applicationData:C,timelineStatusPrefix:D,showTimeLine:N=!0,statusAttribute:P="status",paymentsList:R,oldValue:I,isInfoLabel:O=!1}=e;const{t:x}=i.useTranslation();let{id:w}=o.useParams();const L=null==b||null===(a=b.applicationData)||void 0===a?void 0:a.owners;function M(e,t,n){var l;window.open(null==n||null===(l=n.fullImage)||void 0===l?void 0:l[0],"_blank")}console.log("ownersSequences:- ",L);const[k,F]=n.useState({}),[B,U]=n.useState({loading:!1,loaded:!1,canLoad:!1});"ACTIVE"!=(null==C?void 0:C.status)||B.loading||B.loaded||B.canLoad||U({loading:!1,loaded:!1,canLoad:!0}),null==B||!B.canLoad||B.loading||B.loaded||(U({loading:!0,loaded:!1,canLoad:!0}),function(e,t,n,l){try{Promise.resolve(Digit.PTService.assessmentSearch({tenantId:e,filters:{propertyIds:t}})).then(function(i){function o(){n(a),l({loading:!1,loaded:!0,canLoad:!0})}let a={};const r=function(n){if((null==i||null===(n=i.Assessments)||void 0===n?void 0:n.length)>0)return Promise.resolve(Digit.PaymentService.fetchBill(e,{businessService:"PT",consumerCode:t})).then(function(e){a=e})}();return r&&r.then?r.then(o):o()})}catch(e){return Promise.reject(e)}}((null==C?void 0:C.tenantId)||tenantId,null==C?void 0:C.propertyId,F,U));const H=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()},j=function(e,t,n){if(void 0===t&&(t=0),"OPEN"===e.state||"INITIATED"===e.status&&!window.location.href.includes("/obps/")){var i;const e={date:H(null==C||null===(i=C.auditDetails)||void 0===i?void 0:i.createdTime),source:(null==C?void 0:C.channel)||""};return l.createElement(gi,{data:e})}if(window.location.href.includes("/obps/")||window.location.href.includes("/noc/")||window.location.href.includes("/ws/")){var o,a,r,u,c,s,d,p,v,m,f,E,h,g,S,y,T,A;const i={uuid:null==e||null===(o=e.assignes)||void 0===o||null===(a=o[0])||void 0===a?void 0:a.uuid,fieldName:"mobileNumber",model:"User",showValue:!1,loadData:{serviceName:"/egov-workflow-v2/egov-wf/process/_search",requestBody:{},requestParam:{tenantId:null==b?void 0:b.tenantId,businessIds:null==b?void 0:b.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&&n[t-1]&&(null==n?void 0:n[t-1]),N={date:null==e||null===(r=e.auditDetails)||void 0===r?void 0:r.lastModified,name:null==e||null===(u=e.assignes)||void 0===u||null===(c=u[0])||void 0===c?void 0:c.name,mobileNumber:(null==C||null===(s=C.processInstance)||void 0===s||null===(d=s.assignes)||void 0===d||null===(p=d[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!==(h=E[0])&&void 0!==h&&h.mobileNumber?null==C||null===(g=C.processInstance)||void 0===g||null===(S=g.assignes)||void 0===S||null===(y=S[0])||void 0===y?void 0:y.mobileNumber:null==e||null===(T=e.assignes)||void 0===T||null===(A=T[0])||void 0===A?void 0:A.mobileNumber,comment:x(e&&(null==e?void 0:e.comment)),wfComment:D?D&&D.wfComment:[],thumbnailsToShow:null==e?void 0:e.thumbnailsToShow};return l.createElement(gi,{data:N,OpenImage:M,privacy:i})}{var D,N,P,R,I;const t={date:H(null==C||null===(D=C.auditDetails)||void 0===D?void 0:D.lastModifiedTime),name:null==e||null===(N=e.assignes)||void 0===N||null===(P=N[0])||void 0===P?void 0:P.name,wfComment:null==e?void 0:e.wfComment,mobileNumber:null==e||null===(R=e.assignes)||void 0===R||null===(I=R[0])||void 0===I?void 0:I.mobileNumber,thumbnailsToShow:null==e?void 0:e.thumbnailsToShow};return l.createElement(gi,{data:t,OpenImage:M})}},W=(e,t)=>e?t?e:x(e):x("NA"),z=window.location.href.includes("employee/tl")||window.location.href.includes("employee/obps")||window.location.href.includes("employee/noc"),V=window.location.href.includes("employee/noc"),K=window.location.href.includes("employee/obps"),Y=(window.location.href.includes("employee/ws"),()=>window.location.href.includes("employee/obps")||window.location.href.includes("employee/noc")||z?{justifyContent:"space-between",fontSize:"16px",lineHeight:"19px",color:"#0B0C0C"}:{}),G=e=>{if(null!=e&&e.isTimeValue&&null!=e&&e.value){const t=e.value,[n,l]=t.split(":").map(e=>parseInt(e,10));if(!isNaN(n)&&!isNaN(l)){const e=n>=12?"PM":"AM";return(n%12||12)+":"+String(l).padStart(2,"0")+" "+e}return e.value}return 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)+" "+x(null==e?void 0:e.isUnit):x("N/A"):null!=e&&e.value?W(null==e?void 0:e.value,null==e?void 0:e.isNotTranslated):x("N/A")},[q,$]=n.useState(!1);return l.createElement(t.Card,{style:{position:"relative"},className:"employeeCard-override"},O?l.createElement(Ni,{t:x,userType:!1,infoBannerLabel:"CS_FILE_APPLICATION_INFO_LABEL",infoClickLable:"WS_CLICK_ON_LABEL",infoClickInfoLabel:window.location.href.includes("disconnection")||window.location.href.includes("application")?"WS_DISCONNECTION_CLICK_ON_INFO_LABEL":"WS_CLICK_ON_INFO_LABEL",infoClickInfoLabel1:window.location.href.includes("disconnection")||window.location.href.includes("application")?"WS_DISCONNECTION_CLICK_ON_INFO1_LABEL":""}):null,null==b||null===(r=b.applicationDetails)||void 0===r?void 0:r.map((e,n)=>{var i,a,r,u,c,s,d,p,v,m,f,E,_,h,g,S,y,A,C,D,N,P,O,L,M,F,B,U,H,j,W,q,$,X,Z,J,Q,ee,te;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"}:z?{lineHeight:"19px",maxWidth:"600px",minWidth:"280px"}:{}},0!==n||e.asSectionHeader?l.createElement(l.Fragment,null,l.createElement(t.CardSectionHeader,{style:0==n&&z?{marginBottom:"16px",fontSize:"24px"}:{marginBottom:"16px",marginTop:"32px",fontSize:"24px"}},V?""+x(e.title):x(e.title),null!=e&&e.Component?l.createElement(e.Component,null):null)):l.createElement(t.CardSubHeader,{style:{marginBottom:"16px",fontSize:"24px"}},x(e.title)),(null==e?void 0:e.isTable)&&l.createElement("table",{style:{tableLayout:"fixed",width:"100%",borderCollapse:"collapse",borderCollapse:"collapse",border:"1px solid black"}},l.createElement("tr",{style:{textAlign:"left"}},null==e?void 0:e.headers.map(e=>l.createElement("th",{style:{padding:"10px",paddingLeft:"5px",border:"1px solid black"}},x(e)))),null==e?void 0:e.tableRows.map((n,i)=>l.createElement("tr",null,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;console.log("Response of file:",e);const i=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(i){const e=i.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"}},console.log("Comming Maintainaince data row:- ",n.data),n&&!0===n.editButton?l.createElement("span",{style:{display:"inline-flex",gap:"10px",alignItems:"center"}},l.createElement(o.Link,{to:{pathname:"/upyog-ui/employee/asset/assetservice/maintenance-edit/"+w,state:{data:n.data}}},l.createElement("button",null," ",l.createElement(t.EditIcon,null)," "))):x(n)))))),l.createElement(t.StatusTable,{style:window.location.href.includes("employee/obps")||window.location.href.includes("employee/noc")||z?{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,i)=>{var a,r,u;return!0===n.map&&"N/A"!==n.value?l.createElement(t.Row,{labelStyle:{wordBreak:"break-all"},textStyle:{wordBreak:"break-all"},key:x(n.title),label:x(n.title),text:l.createElement("img",{src:x(n.value),alt:"",privacy:null==n?void 0:n.privacy})}):1==(null==n?void 0:n.isLink)?l.createElement(t.Row,{key:x(n.title),label:window.location.href.includes("tl")||window.location.href.includes("ws")?l.createElement("div",{style:{width:"200%"}},l.createElement(o.Link,{to:null==n?void 0:n.to},l.createElement("span",{className:"link",style:{color:"#a82227"}},x(null==n?void 0:n.title)))):V||K?""+x(n.title):x(n.title),text:l.createElement("div",null,l.createElement(o.Link,{to:null==n?void 0:n.to},l.createElement("span",{className:"link",style:{color:"#a82227"}},null==n?void 0:n.value))),last:i===(null==e||null===(u=e.values)||void 0===u?void 0:u.length)-1,caption:n.caption,className:"border-none",rowContainerStyle:Y(),labelStyle:{wordBreak:"break-all"},textStyle:{wordBreak:"break-all"}}):l.createElement("div",null,window.location.href.includes("modify")?l.createElement(t.Row,{className:"border-none",key:""+n.title,label:""+x(""+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:x(n.title),label:x(n.title),text:G(n),last:i===(null==e||null===(a=e.values)||void 0===a?void 0:a.length)-1,caption:n.caption,className:"border-none",privacy:null==n?void 0:n.privacy,rowContainerStyle: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(xi,{bill:null===(r=k.Bill)||void 0===r?void 0:r[0]}):"")})))),(null==e?void 0:e.belowComponent)&&l.createElement(e.belowComponent,null),(null==e||null===(a=e.additionalDetails)||void 0===a?void 0:a.inspectionReport)&&l.createElement(Cl,{scrutinyDetails:null==e?void 0:e.additionalDetails,paymentsList:R}),(null==b||null===(r=b.applicationData)||void 0===r||null===(u=r.additionalDetails)||void 0===u||null===(c=u.fieldinspection_pending)||void 0===c?void 0:c.length)>0&&(null==e||null===(s=e.additionalDetails)||void 0===s?void 0:s.fiReport)&&l.createElement(_l,{fiReport:null==b||null===(d=b.applicationData)||void 0===d||null===(p=d.additionalDetails)||void 0===p?void 0:p.fieldinspection_pending}),(null==e||null===(v=e.additionalDetails)||void 0===v?void 0:v.floors)&&l.createElement(Tl,{floors:null==e||null===(m=e.additionalDetails)||void 0===m?void 0:m.floors}),(null==e||null===(f=e.additionalDetails)||void 0===f?void 0:f.owners)&&l.createElement(Al,{owners:null==e||null===(E=e.additionalDetails)||void 0===E?void 0:E.owners}),(null==e||null===(_=e.additionalDetails)||void 0===_?void 0:_.units)&&l.createElement(yi,{units:null==e||null===(h=e.additionalDetails)||void 0===h?void 0:h.units}),(null==e||null===(g=e.additionalDetails)||void 0===g?void 0:g.accessories)&&l.createElement(Si,{units:null==e||null===(S=e.additionalDetails)||void 0===S?void 0:S.accessories}),(null==e||null===(y=e.additionalDetails)||void 0===y?void 0:y.permissions)&&(null==T||null===(A=T.data)||void 0===A||null===(C=A.nextActions)||void 0===C?void 0:C.length)>0&&l.createElement(Sl,{applicationData:null==b?void 0:b.applicationData,t:x,permissions:null==e||null===(D=e.additionalDetails)||void 0===D?void 0:D.permissions}),(null==e||null===(N=e.additionalDetails)||void 0===N?void 0:N.obpsDocuments)&&l.createElement(fl,{t:x,applicationData:null==b?void 0:b.applicationData,docs:e.additionalDetails.obpsDocuments,bpaActionsDetails:T}),(null==e||null===(P=e.additionalDetails)||void 0===P?void 0:P.noc)&&l.createElement(gl,{t:x,isNoc:!0,NOCdata:e.values,applicationData:null==b?void 0:b.applicationData,docs:e.additionalDetails.noc,noc:null===(O=e.additionalDetails)||void 0===O?void 0:O.data,bpaActionsDetails:T}),(null==e||null===(L=e.additionalDetails)||void 0===L?void 0:L.scruntinyDetails)&&l.createElement(Cl,{scrutinyDetails:null==e?void 0:e.additionalDetails}),(null==e||null===(M=e.additionalDetails)||void 0===M?void 0:M.buildingExtractionDetails)&&l.createElement(Cl,{scrutinyDetails:null==e?void 0:e.additionalDetails}),(null==e||null===(F=e.additionalDetails)||void 0===F?void 0:F.subOccupancyTableDetails)&&l.createElement(Dl,{edcrDetails:null==e?void 0:e.additionalDetails,applicationData:null==b?void 0:b.applicationData}),(null==e||null===(B=e.additionalDetails)||void 0===B?void 0:B.documentsWithUrl)&&l.createElement(ml,{documents:null==e||null===(U=e.additionalDetails)||void 0===U?void 0:U.documentsWithUrl}),(null==e||null===(H=e.additionalDetails)||void 0===H?void 0:H.documents)&&l.createElement(yl,{documents:null==e||null===(j=e.additionalDetails)||void 0===j?void 0:j.documents}),(null==e||null===(W=e.additionalDetails)||void 0===W?void 0:W.taxHeadEstimatesCalculation)&&l.createElement(bl,{taxHeadEstimatesCalculation:null==e||null===(q=e.additionalDetails)||void 0===q?void 0:q.taxHeadEstimatesCalculation}),(null==e?void 0:e.isWaterConnectionDetails)&&l.createElement(bi,{wsAdditionalDetails:e,oldValue:I}),(null==e||null===($=e.additionalDetails)||void 0===$?void 0:$.redirectUrl)&&l.createElement("div",{style:{fontSize:"16px",lineHeight:"24px",fontWeight:"400",padding:"10px 0px"}},l.createElement(o.Link,{to:null==e||null===(X=e.additionalDetails)||void 0===X||null===(Z=X.redirectUrl)||void 0===Z?void 0:Z.url},l.createElement("span",{className:"link",style:{color:"#a82227"}},null==e||null===(J=e.additionalDetails)||void 0===J||null===(Q=J.redirectUrl)||void 0===Q?void 0:Q.title))),(null==e||null===(ee=e.additionalDetails)||void 0===ee?void 0:ee.estimationDetails)&&l.createElement(Ci,{wsAdditionalDetails:e,workflowDetails:T}),(null==e||null===(te=e.additionalDetails)||void 0===te?void 0:te.estimationDetails)&&l.createElement(Pi,{wsAdditionalDetails:e,workflowDetails:T}))}),N&&(null==T||null===(u=T.data)||void 0===u||null===(c=u.timeline)||void 0===c?void 0:c.length)>0&&l.createElement(l.Fragment,null,l.createElement(t.BreakLine,null),((null==T?void 0:T.isLoading)||A)&&l.createElement(t.Loader,null),!(null!=T&&T.isLoading)&&!A&&l.createElement(n.Fragment,null,l.createElement("div",{id:"timeline"},l.createElement(t.CardSectionHeader,{style:{marginBottom:"16px",marginTop:"32px"}},x("ES_APPLICATION_DETAILS_APPLICATION_TIMELINE")),null!=T&&null!==(s=T.data)&&void 0!==s&&s.timeline&&1===(null==T||null===(d=T.data)||void 0===d||null===(p=d.timeline)||void 0===p?void 0:p.length)?l.createElement(t.CheckPoint,{isCompleted:!0,label:x(""+D+(null==T||null===(v=T.data)||void 0===v||null===(m=v.timeline[0])||void 0===m?void 0:m.state)),customChild:j(null==T||null===(f=T.data)||void 0===f?void 0:f.timeline[0],null==T||null===(E=T.data)||void 0===E?void 0:E.timeline)}):l.createElement(t.ConnectingCheckPoints,null,(null==T||null===(h=T.data)||void 0===h?void 0:h.timeline)&&(null==T||null===(g=T.data)||void 0===g?void 0:g.timeline.slice(0,q?null==T?void 0:T.data.timeline.length:2).map((e,n,i)=>{var o;let a="";var r,u,c,s,d,p;return window.location.href.includes("/obps/")&&(a=null!=T&&null!==(r=T.data)&&void 0!==r&&null!==(u=r.timeline[n-1])&&void 0!==u&&null!==(c=u.state)&&void 0!==c&&c.includes("BACK_FROM")||null!=T&&null!==(s=T.data)&&void 0!==s&&null!==(d=s.timeline[n-1])&&void 0!==d&&null!==(p=d.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:x(""+D+("REOPEN"===(null==e?void 0:e.performedAction)?null==e?void 0:e.performedAction:null==e?void 0:e[P])+a),customChild:j(e,n,null==T||null===(o=T.data)||void 0===o?void 0:o.timeline)}))}))),(null==T||null===(S=T.data)||void 0===S||null===(y=S.timeline)||void 0===y?void 0:y.length)>2&&l.createElement(t.LinkButton,{label:x(q?"COLLAPSE":"VIEW_TIMELINE"),onClick:()=>{$(e=>!e)}})))))}function Li(e){var n,i,o,a,r,u,c,s,d,p,v,m,f,E,_,h,g,S;let{t:y,showToast:b,closeToast:T,businessService:A}=e;if(null!=A&&A.includes("NewTL")||null!=A&&A.includes("TL")||null!=A&&A.includes("EDITRENEWAL")){var C;let e="";switch(null==b||null===(C=b.action)||void 0===C?void 0:C.action){case"SENDBACK":e="error"===(null==b?void 0:b.key)?null==b||null===(n=b.error)||void 0===n?void 0:n.message:y("TL_SENDBACK_CHECKLIST_MESSAGE_HEAD");break;case"FORWARD":e="error"===(null==b?void 0:b.key)?null==b||null===(i=b.error)||void 0===i?void 0:i.message:y("TL_FORWARD_SUCCESS_MESSAGE_MAIN");break;case"APPROVE":e="error"===(null==b?void 0:b.key)?null==b||null===(o=b.error)||void 0===o?void 0:o.message:y("TL_APPROVAL_CHECKLIST_MESSAGE_HEAD");break;case"SENDBACKTOCITIZEN":e="error"===(null==b?void 0:b.key)?null==b||null===(a=b.error)||void 0===a?void 0:a.message:y("TL_SENDBACK_TOCITIZEN_CHECKLIST_MESSAGE_HEAD");break;case"REJECT":e="error"===(null==b?void 0:b.key)?null==b||null===(r=b.error)||void 0===r?void 0:r.message:y("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:y("TL_APPLICATION_RESUBMIT_SUCCESS_MESSAGE_MAIN");break;case"CANCEL":e="error"===(null==b?void 0:b.key)?null==b||null===(c=b.error)||void 0===c?void 0:c.message:y("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:y("ES_"+A+"_"+(null==b||null===(d=b.action)||void 0===d?void 0:d.action)+"_UPDATE_SUCCESS")}return l.createElement(l.Fragment,null,b&&l.createElement(t.Toast,{error:"error"===b.key,label:e,onClose:T}))}if(null!=A&&A.includes("BPA")||null!=A&&A.includes("BPA_LOW")||null!=A&&A.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!=A&&A.includes("BPA_OC")?y(e[1]):y(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===(_=b.error)||void 0===_?void 0:_.message:e(["BPA_FORWARD_SUCCESS_MESSAGE_MAIN"]);break;case"SEND_BACK_FOR_DOCUMENT_VERIFICATION":case"SEND_BACK_FOR_FIELD_INSPECTION":n="error"===(null==b?void 0:b.key)?null==b||null===(h=b.error)||void 0===h?void 0:h.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:y("ES_"+A+"_"+(null==b||null===(S=b.action)||void 0===S?void 0:S.action)+"_UPDATE_SUCCESS")}return l.createElement(l.Fragment,null,b&&l.createElement(t.Toast,{error:"error"===b.key,label:n,onClose:T}))}{var N,P;const e="error"===(null==b?void 0:b.key)?null==b||null===(N=b.error)||void 0===N?void 0:N.message:"ES_"+A+"_"+(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:y(e),onClose:T}))}}function Mi(e){var o,a,r,c,s,d,p,v,m,f,E,_,h,g,S,y,b,T,A;let{workflowDetails:C,displayMenu:D,onActionSelect:N,setDisplayMenu:P,businessService:R,forcedActionPrefix:I,ActionBarStyle:O={},MenuStyle:x={},isAction:w,applicationDetails:L}=e;const{t:M}=i.useTranslation();let k=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):{};k=null==t?void 0:t.value}const B=null===(o=k)||void 0===o||null===(a=o.info)||void 0===a||null===(r=a.roles)||void 0===r?void 0:r.map(e=>e.code);let U=!1,H=!1,j=(null==C||null===(c=C.data)||void 0===c||null===(s=c.actionState)||void 0===s||null===(d=s.nextActions)||void 0===d?void 0:d.filter(e=>(null==B?void 0:B.some(t=>{var n;return null===(n=e.roles)||void 0===n?void 0:n.includes(t)}))||!e.roles))||(null==C||null===(p=C.data)||void 0===p||null===(v=p.nextActions)||void 0===v?void 0:v.filter(e=>(null==B?void 0:B.some(t=>{var n;return null===(n=e.roles)||void 0===n?void 0:n.includes(t)}))||!e.roles));Digit.Hooks.useClickOutside(F,()=>{P(!1)},D),(window.location.href.includes("/obps")||window.location.href.includes("/noc"))&&1==(null==j?void 0:j.length)||null!=j&&null!==(m=j[0])&&void 0!==m&&null!==(f=m.redirectionUrl)&&void 0!==f&&f.pathname.includes("/pt/property-details/")&&1==(null==j?void 0:j.length)?(H=!1,U=!0):(null==j?void 0:j.length)>0&&(H=!0,U=!1);const W=Digit.SessionStorage.get("User"),z=null==W||null===(E=W.info)||void 0===E?void 0:E.uuid,V=null==L||null===(_=L.applicationData)||void 0===_||null===(h=_.auditDetails)||void 0===h?void 0:h.lastModifiedBy;return l.createElement(l.Fragment,null,!(null!=C&&C.isLoading)&&H&&!U&&!w&&l.createElement(t.ActionBar,{style:u({},O)},D&&(null!=C&&null!==(g=C.data)&&void 0!==g&&null!==(S=g.actionState)&&void 0!==S&&S.nextActions||null!=C&&null!==(y=C.data)&&void 0!==y&&y.nextActions)?l.createElement(t.Menu,{localeKeyPrefix:I||"WF_EMPLOYEE_"+(null==R?void 0:R.toUpperCase()),options:j,optionKey:"action",t:M,onSelect:N,style:x}):null,"ewst"===R?V===z||null==V?l.createElement(t.SubmitBar,{ref:F,label:M("WF_TAKE_ACTION"),onSubmit:()=>P(!D)}):l.createElement(t.CardLabel,{style:{color:"red",font:"30px",fontWeight:"bold"}},""+M("EW_ALERT_ANOTHER_VENDOR")):l.createElement(t.SubmitBar,{ref:F,label:M("WF_TAKE_ACTION"),onSubmit:()=>P(!D)})),!(null!=C&&C.isLoading)&&!H&&U&&!w&&l.createElement(t.ActionBar,{style:u({},O)},l.createElement("button",{style:{color:"#FFFFFF",fontSize:"18px"},className:"submit-bar",name:null==j||null===(b=j[0])||void 0===b?void 0:b.action,value:null==j||null===(T=j[0])||void 0===T?void 0:T.action,onClick:e=>{N((null==j?void 0:j[0])||{})}},M((I||"WF_EMPLOYEE_"+(null==R?void 0:R.toUpperCase()))+"_"+(null==j||null===(A=j[0])||void 0===A?void 0:A.action)))))}const ki=()=>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"})),Fi=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(ki,null));function Bi(e){let{action:n,closeWarningPopup:o}=e;const{t:a}=i.useTranslation(),r=window.Digit.Utils.browser.isMobile();return l.createElement(l.Fragment,null,l.createElement(t.Modal,{headerBarMain:l.createElement("h1",{className:"heading-m"},a("PT_DUES_ARE_PENDING")),headerBarEnd:l.createElement(Fi,{onClick:()=>{o()}}),hideSubmit:!0,isDisabled:!1,popupStyles:r?{}:{width:"29%",marginTop:"auto"}},l.createElement(t.Card,null,l.createElement("div",{style:{marginBottom:"30px"}},l.createElement("h1",null,a("PT_YOU_HAVE")," ₹",null==n?void 0:n.AmountDueForPay," ",a("PT_DUE_WARNING_MSG2"))),l.createElement(t.Row,{rowContainerStyle:{display:"flex"},labelStyle:{fontSize:"24px",fontWeight:"700",marginRight:"10%"},textStyle:{fontSize:"24px",fontWeight:"700",marginBottom:"20px"},label:""+a("PT_AMOUNT_DUE"),text:"₹"+a(null==n?void 0:n.AmountDueForPay)}),l.createElement("div",{style:{width:"100%",display:"flex",justifyContent:"flex-end"}},l.createElement(t.ButtonSelector,{theme:"border",label:a("ES_PT_COMMON_CANCEL"),onSubmit:o,style:{marginLeft:"10px"}}),l.createElement(t.ButtonSelector,{label:a("PT_COLLECT"),onSubmit:()=>{var e;return window.location.assign(""+window.location.origin+(null==n||null===(e=n.redirectionUrl)||void 0===e?void 0:e.pathname))},style:{marginLeft:"10px"}})))),")")}const Ui=e=>{var a;const c=Digit.ULBService.getCurrentTenantId(),s=Digit.ULBService.getStateId(),{t:d}=i.useTranslation(),p=o.useHistory();let{id:v}=o.useParams();const[m,f]=n.useState(!1),[E,_]=n.useState(null),[h,g]=n.useState(!1),[S,b]=n.useState(!1),[T,A]=n.useState(!1),{applicationDetails:C,showToast:D,setShowToast:N,isLoading:P,isDataLoading:R,applicationData:I,mutate:O,nocMutation:x,workflowDetails:w,id:L,businessService:M,closeToast:k,moduleCode:F,timelineStatusPrefix:B,forcedActionPrefix:U,statusAttribute:H,ActionBarStyle:j,MenuStyle:W,paymentsList:z,showTimeLine:V=!0,oldValue:K,isInfoLabel:Y=!1,clearDataDetails:G,isAction:q=!1}=e;n.useEffect(()=>{D&&w.revalidate()},[D]);const $=r.useQueryClient(),X=()=>{_(null),g(!1)};return P||S?l.createElement(t.Loader,null):l.createElement(l.Fragment,null,P?l.createElement(t.Loader,null):l.createElement(l.Fragment,null,l.createElement(wi,{applicationDetails:C,id:L,workflowDetails:w,isDataLoading:R,applicationData:I,businessService:M,timelineStatusPrefix:B,statusAttribute:H,paymentsList:z,showTimeLine:V,oldValue:K,isInfoLabel:Y}),h?l.createElement(vl,{t:d,action:E,tenantId:c,state:s,id:v,applicationDetails:C,applicationData:null==C?void 0:C.applicationData,closeModal:X,submitAction:function(e,t,n){void 0===t&&(t=!1),void 0===n&&(n={});try{let l=!1;const i=function(i,o,a,r,c,s,v,m,f,_,h,g){if(0!=(null==e||null===(i=e.Property)||void 0===i||null===(o=i.workflow)||void 0===o||null===(a=o.comment)||void 0===a?void 0:a.length)&&0!=(null==e||null===(r=e.Licenses)||void 0===r||null===(c=r[0])||void 0===c||null===(s=c.comment)||void 0===s?void 0:s.length)&&0!=(null==e||null===(v=e.WaterConnection)||void 0===v||null===(m=v.comment)||void 0===m?void 0:m.length)&&0!=(null==e||null===(f=e.SewerageConnection)||void 0===f||null===(_=f.comment)||void 0===_?void 0:_.length)&&0!=(null==e||null===(h=e.BPA)||void 0===h||null===(g=h.comment)||void 0===g?void 0:g.length)){function S(t){if(l)return t;sessionStorage.setItem("updateData",JSON.stringify(e)),O&&(b(!0),O(e,{onError:(e,t)=>{b(!1),N({key:"error",error:e}),setTimeout(k,5e3)},onSuccess:(e,t)=>{var l,i,o,a,r,u,c,s,v,m,f,_;sessionStorage.removeItem("WS_SESSION_APPLICATION_DETAILS"),b(!1),null!==(l=n)&&void 0!==l&&l.bpa&&p.replace("/upyog-ui/employee/obps/response",{data:e}),null!==(i=n)&&void 0!==i&&i.isStakeholder&&p.push("/upyog-ui/employee/obps/stakeholder-response",{data:e}),null!==(o=n)&&void 0!==o&&o.isNoc&&p.push("/upyog-ui/employee/noc/response",{data:e}),(null==e||null===(a=e.Amendments)||void 0===a?void 0:a.length)>0?null!=t&&null!==(r=t.AmendmentUpdate)&&void 0!==r&&null!==(u=r.workflow)&&void 0!==u&&u.action.includes("SEND_BACK")?N({key:"success",label:d("ES_MODIFYSWCONNECTION_SEND_BACK_UPDATE_SUCCESS")}):null!=t&&null!==(c=t.AmendmentUpdate)&&void 0!==c&&null!==(s=c.workflow)&&void 0!==s&&s.action.includes("RE-SUBMIT")?N({key:"success",label:d("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")?N({key:"success",label:d("ES_MODIFYSWCONNECTION_APPROVE_UPDATE_SUCCESS")}):null!=t&&null!==(f=t.AmendmentUpdate)&&void 0!==f&&null!==(_=f.workflow)&&void 0!==_&&_.action.includes("REJECT")&&N({key:"success",label:d("ES_MODIFYWSCONNECTION_REJECT_UPDATE_SUCCESS")}):(N({key:"success",action:E}),G&&setTimeout(G,3e3),setTimeout(k,5e3),$.clear(),$.refetchQueries("APPLICATION_SEARCH"))}})),X()}b(!0),"function"==typeof(null==e?void 0:e.customFunctionToExecute)&&(null==e||e.customFunctionToExecute(u({},e)));const i=function(){if(!1!==t&&x){var e;const n=null===(e=t)||void 0===e?void 0:e.map(e=>null==x?void 0:x.mutateAsync(e)),i=y(function(){return b(!0),Promise.resolve(Promise.all(n)).then(function(e){e&&e.map(e=>{var t,n;Digit.SessionStorage.del(null==e||null===(t=e.Noc)||void 0===t||null===(n=t[0])||void 0===n?void 0:n.nocType)})})},function(e){var t,n,i,o,a,r,u,c,s,p,v,m;b(!1);let f=null!=e&&null!==(t=e.response)&&void 0!==t&&null!==(n=t.data)&&void 0!==n&&null!==(i=n.Errors)&&void 0!==i&&null!==(o=i[0])&&void 0!==o&&o.code?d(null==e||null===(a=e.response)||void 0===a||null===(r=a.data)||void 0===r||null===(u=r.Errors)||void 0===u||null===(c=u[0])||void 0===c?void 0:c.code):(null==e||null===(s=e.response)||void 0===s||null===(p=s.data)||void 0===p||null===(v=p.Errors)||void 0===v||null===(m=v[0])||void 0===m?void 0:m.message)||e;X(),N({key:"error",error:{message:f}}),setTimeout(k,5e3),l=!0});if(i&&i.then)return i.then(function(){})}}();return i&&i.then?i.then(S):S(i)}alert("Please fill in the comments before submitting")}();return Promise.resolve(i&&i.then?i.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:M,workflowDetails:w,moduleCode:F}):null,T?l.createElement(Bi,{action:E,workflowDetails:w,businessService:M,isWarningPop:T,closeWarningPopup:()=>{A(!1)}}):null,l.createElement(Li,{t:d,showToast:D,closeToast:k,businessService:M}),l.createElement(Mi,{isAction:q,workflowDetails:w,displayMenu:m,onActionSelect:function(e){if(sessionStorage.setItem("SELECTED_ACTION",null==e?void 0:e.action),e)if(null!=e&&e.isToast)N({key:"error",error:{message:null==e?void 0:e.toastMessage}}),setTimeout(k,5e3);else if(null!=e&&e.isWarningPopUp)A(!0);else if(null!=e&&e.redirectionUrll){var t,n,l,i,o;if("ACTIVATE_CONNECTION"===(null==e||null===(t=e.redirectionUrll)||void 0===t?void 0:t.action))p.push(""+(null==e||null===(l=e.redirectionUrll)||void 0===l?void 0:l.pathname),JSON.stringify({data:null==e||null===(i=e.redirectionUrll)||void 0===i?void 0:i.state,url:""+(null===(o=location)||void 0===o?void 0:o.pathname)+location.search}));else if("RE-SUBMIT-APPLICATION"===(null==e||null===(n=e.redirectionUrll)||void 0===n?void 0:n.action)){var a,r;p.push(""+(null==e||null===(a=e.redirectionUrll)||void 0===a?void 0:a.pathname),{data:null==e||null===(r=e.redirectionUrll)||void 0===r?void 0:r.state})}else{var c;window.location.assign(window.location.origin+"/upyog-ui/employee/payment/collect/"+(null==e||null===(c=e.redirectionUrll)||void 0===c?void 0:c.pathname))}}else if(null!=e&&e.redirectionUrl){var s,d;p.push({pathname:null===(s=e.redirectionUrl)||void 0===s?void 0:s.pathname,state:u({},null===(d=e.redirectionUrl)||void 0===d?void 0:d.state)})}else g(!0);_(e),f(!1)},setDisplayMenu:f,businessService:M,forcedActionPrefix:U,ActionBarStyle:j,MenuStyle:W,applicationDetails:C})))},Hi=["tenantId","payments"];var ji=l.memo(()=>{var e,a,r,s,d,p,v,f,E,_,h,g,S,y;const{t:b}=i.useTranslation(),{data:T}=Digit.Hooks.useStore.getInitData(),A=Digit.ULBService.getCurrentTenantId(),{tenants:C}=T||{},{id:D}=o.useParams(),[N,P]=n.useState(null),[R,I]=n.useState({}),[O,w]=n.useState(!1),[L,M]=n.useState(!1),[k,F]=n.useState("ptr");o.useHistory();let B=!1;window.location.href.includes("applicationsearch")&&(B=!0),sessionStorage.setItem("applicationNoinAppDetails",D);const{isLoading:U,data:H}=Digit.Hooks.ptr.usePtrApplicationDetail(b,A,D),{mutate:j}=Digit.Hooks.ptr.usePTRApplicationAction(A);let W=Digit.Hooks.useWorkflowDetails({tenantId:(null==H||null===(e=H.applicationData)||void 0===e?void 0:e.tenantId)||A,id:null==H||null===(a=H.applicationData)||void 0===a||null===(r=a.applicationData)||void 0===r?void 0:r.applicationNumber,moduleCode:k,role:"PTR_CEMP"});var z,V;Digit.Hooks.ptr.usePTRSearch({tenantId:A,filters:{applicationNumber:D,audit:!0}}),n.useEffect(()=>{H&&I(m.cloneDeep(H))},[H]),n.useEffect(()=>{var e,t,n;null==W||null===(e=W.data)||void 0===e||!e.applicationBusinessService||"ptr"===(null==W||null===(t=W.data)||void 0===t?void 0:t.applicationBusinessService)&&"ptr"===k||F(null==W||null===(n=W.data)||void 0===n?void 0:n.applicationBusinessService)},[W.data]),!Digit.UserService.hasAccess(["PTR_CEMP"])||"ptr"!==(null==W||null===(s=W.data)||void 0===s?void 0:s.applicationBusinessService)||null==W||null===(d=W.data)||void 0===d||null===(p=d.actionState)||void 0===p||null===(v=p.nextActions)||void 0===v||!v.find(e=>"PAY"===e.action)||(W.data.actionState.nextActions=null==W||null===(z=W.data)||void 0===z||null===(V=z.actionState)||void 0===V?void 0:V.nextActions.map(e=>{var t,n;return"PAY"===e.action?{action:"PAY",forcedName:"WF_PAY_APPLICATION",redirectionUrl:{pathname:"/upyog-ui/employee/payment/collect/pet-services/"+(null==R||null===(t=R.applicationData)||void 0===t||null===(n=t.applicationData)||void 0===n?void 0:n.applicationNumber)}}:e}));let K=[{order:1,label:b("PTR_APPLICATION"),onClick:()=>function(){try{const e=null==R?void 0:R.applicationData,t=C.find(t=>t.code===e.tenantId);return Promise.resolve(x(e.applicationData,t,b)).then(function(e){Digit.Utils.pdf.generate(e)})}catch(e){return Promise.reject(e)}}()}];const{data:Y,isLoading:G}=Digit.Hooks.useRecieptSearch({tenantId:A,businessService:"pet-services",consumerCodes:null==R||null===(f=R.applicationData)||void 0===f||null===(E=f.applicationData)||void 0===E?void 0:E.applicationNumber,isEmployee:!1},{enabled:!(null==R||null===(_=R.applicationData)||void 0===_||null===(h=_.applicationData)||void 0===h||!h.applicationNumber)});return Y&&(null==Y?void 0:Y.Payments.length)>0&&0==G&&K.push({label:b("PTR_FEE_RECIEPT"),onClick:()=>{var e;return function(e){let{tenantId:t,payments:n}=e;c(e,Hi);try{let e={filestoreIds:[null==n?void 0:n.fileStoreId]};return Promise.resolve(Digit.PaymentService.generatePdf(t,{Payments:[u({},n)]},"petservice-receipt")).then(function(n){return e=n,Promise.resolve(Digit.PaymentService.printReciept(t,{fileStoreIds:e.filestoreIds[0]})).then(function(t){var n;window.open(t[null===(n=e)||void 0===n?void 0:n.filestoreIds[0]],"_blank")})})}catch(e){return Promise.reject(e)}}({tenantId:null==Y||null===(e=Y.Payments[0])||void 0===e?void 0:e.tenantId,payments:null==Y?void 0:Y.Payments[0]})}}),Y&&(null==Y?void 0:Y.Payments.length)>0&&0==G&&K.push({label:b("PTR_CERTIFICATE"),onClick:()=>function(){try{var e;return Promise.resolve(Digit.PaymentService.generatePdf(A,{PetRegistrationApplications:[null==H||null===(e=H.applicationData)||void 0===e?void 0:e.applicationData]},"petservicecertificate")).then(function(e){return Promise.resolve(Digit.PaymentService.printReciept(A,{fileStoreIds:e.filestoreIds[0]})).then(function(t){window.open(t[null==e?void 0:e.filestoreIds[0]],"_blank")})})}catch(e){return Promise.reject(e)}}()}),l.createElement("div",null,l.createElement("div",{className:"employee-application-details",style:{marginBottom:"15px"}},l.createElement(t.Header,{styles:{marginLeft:"0px",paddingTop:"10px",fontSize:"32px"}},b("PTR_PET_APPLICATION_DETAILS")),l.createElement("div",{style:{zIndex:"10",display:"flex",flexDirection:"row-reverse",alignItems:"center",marginTop:"-25px"}},l.createElement("div",{style:{zIndex:"10",position:"relative"}},K&&K.length>0&&l.createElement(t.MultiLink,{className:"multilinkWrapper",onHeadClick:()=>w(!O),displayOptions:O,options:K,downloadBtnClassName:"employee-download-btn-className",optionsClassName:"employee-options-btn-className"})))),l.createElement(Ui,{isAction:B,applicationDetails:null==R?void 0:R.applicationData,isLoading:U,isDataLoading:U,applicationData:null==R||null===(g=R.applicationData)||void 0===g?void 0:g.applicationData,mutate:j,workflowDetails:W,businessService:k,moduleCode:"pet-services",showToast:N,setShowToast:P,closeToast:()=>{P(null)},timelineStatusPrefix:"PTR_COMMON_STATUS_",forcedActionPrefix:"EMPLOYEE_PTR",statusAttribute:"state",MenuStyle:{color:"#FFFFFF",fontSize:"18px"}}),"Expired"==(null==R||null===(S=R.applicationData)||void 0===S||null===(y=S.applicationData)||void 0===y?void 0:y.status)&&l.createElement(o.Link,{to:"/upyog-ui/employee/ptr/petservice/revised-application"},l.createElement(t.SubmitBar,{style:{marginBottom:"5px"},label:"Renewal"})))});const Wi={PTRCheckPage:e=>{var o,a,r,u,c,s;let{onSubmit:p,value:v={}}=e;const{t:m}=i.useTranslation(),{address:E,pets:_,isEditPET:h,isUpdatePET:g,ownerss:S}=v,y=h||g?"edit-application":"new-application",[b,T]=n.useState(!1);return l.createElement(l.Fragment,null,l.createElement(d,{currentStep:5}),l.createElement(t.Card,null,l.createElement(t.CardHeader,null,m("PTR_CHECK_YOUR_DETAILS")),l.createElement("div",null,l.createElement("br",null),l.createElement(t.CardSubHeader,null,m("ES_TITILE_OWNER_DETAILS")),l.createElement("br",null),l.createElement(t.StatusTable,null,l.createElement(t.Row,{label:m("PTR_APPLICANT_NAME"),text:""+m(f(null==S?void 0:S.applicantName)),actionButton:l.createElement(R,{jumpTo:"/upyog-ui/citizen/ptr/petservice/"+y+"/owners"})}),l.createElement(t.Row,{label:m("PTR_FATHER_HUSBAND_NAME"),text:""+m(f(null==S?void 0:S.fatherName)),actionButton:l.createElement(R,{jumpTo:"/upyog-ui/citizen/ptr/petservice/"+y+"/owners"})}),l.createElement(t.Row,{label:m("PTR_MOBILE_NUMBER"),text:""+m(f(null==S?void 0:S.mobileNumber)),actionButton:l.createElement(R,{jumpTo:"/upyog-ui/citizen/ptr/petservice/"+y+"/owners"})}),l.createElement(t.Row,{label:m("PTR_EMAIL_ID"),text:""+m(f(null==S?void 0:S.emailId)),actionButton:l.createElement(R,{jumpTo:"/upyog-ui/citizen/ptr/petservice/"+y+"/owners"})})),l.createElement("br",null),l.createElement(t.CardSubHeader,null,m("ES_TITILE_PET_DETAILS")),l.createElement("br",null),l.createElement(t.StatusTable,null,l.createElement(t.Row,{label:m("PTR_SEARCH_PET_TYPE"),text:""+m(f(null==_||null===(o=_.petType)||void 0===o?void 0:o.value)),actionButton:l.createElement(R,{jumpTo:"/upyog-ui/citizen/ptr/petservice/"+y+"/pet-details"})}),l.createElement(t.Row,{label:m("PTR_SEARCH_BREED_TYPE"),text:""+m(f(null==_||null===(a=_.breedType)||void 0===a?void 0:a.value)),actionButton:l.createElement(R,{jumpTo:"/upyog-ui/citizen/ptr/petservice/"+y+"/pet-details"})}),l.createElement(t.Row,{label:m("PTR_PET_NAME"),text:""+m(f(null==_?void 0:_.petName)),actionButton:l.createElement(R,{jumpTo:"/upyog-ui/citizen/ptr/petservice/"+y+"/pet-details"})}),l.createElement(t.Row,{label:m("PTR_DOCTOR_NAME"),text:""+m(f(null==_?void 0:_.doctorName)),actionButton:l.createElement(R,{jumpTo:"/upyog-ui/citizen/ptr/petservice/"+y+"/pet-details"})}),l.createElement(t.Row,{label:m("PTR_CLINIC_NAME"),text:""+m(f(null==_?void 0:_.clinicName)),actionButton:l.createElement(R,{jumpTo:"/upyog-ui/citizen/ptr/petservice/"+y+"/pet-details"})}),l.createElement(t.Row,{label:m("PTR_VACCINATED_DATE"),text:""+m(f(null==_?void 0:_.lastVaccineDate)),actionButton:l.createElement(R,{jumpTo:"/upyog-ui/citizen/ptr/petservice/"+y+"/pet-details"})}),l.createElement(t.Row,{label:m("PTR_PET_AGE"),text:""+m(f((null==_?void 0:_.petAge)+" Months")),actionButton:l.createElement(R,{jumpTo:"/upyog-ui/citizen/ptr/petservice/"+y+"/pet-details"})}),l.createElement(t.Row,{label:m("PTR_PET_SEX"),text:""+m(f(null==_||null===(r=_.petGender)||void 0===r?void 0:r.name)),actionButton:l.createElement(R,{jumpTo:"/upyog-ui/citizen/ptr/petservice/"+y+"/pet-details"})}),l.createElement(t.Row,{label:m("PTR_IDENTIFICATION_MARK"),text:""+m(f(null==_?void 0:_.identificationMark)),actionButton:l.createElement(R,{jumpTo:"/upyog-ui/citizen/ptr/petservice/"+y+"/pet-details"})}),l.createElement(t.Row,{label:m("PTR_PET_COLOR"),text:""+m(f(null==_||null===(u=_.petColor)||void 0===u?void 0:u.code)),actionButton:l.createElement(R,{jumpTo:"/upyog-ui/citizen/ptr/petservice/"+y+"/pet-details"})}),l.createElement(t.Row,{label:m("PTR_VACCINATION_NUMBER"),text:""+m(f(null==_?void 0:_.vaccinationNumber)),actionButton:l.createElement(R,{jumpTo:"/upyog-ui/citizen/ptr/petservice/"+y+"/pet-details"})}),l.createElement(t.Row,{label:m("PTR_SEARCH_BIRTH_ADOPTION"),text:""+m(f(null!=_&&_.adoptionDate?null==_?void 0:_.adoptionDate:null==_?void 0:_.birthDate)),actionButton:l.createElement(R,{jumpTo:"/upyog-ui/citizen/ptr/petservice/"+y+"/pet-details"})})),l.createElement("br",null),l.createElement(t.CardSubHeader,null,m("PTR_LOCATION_DETAILS")),l.createElement("br",null),l.createElement(t.StatusTable,null,l.createElement(t.Row,{label:m("PTR_HOUSE_NO"),text:""+m(f(null==E?void 0:E.houseNo)),actionButton:l.createElement(R,{jumpTo:"/upyog-ui/citizen/ptr/petservice/"+y+"/address"})}),(null==E?void 0:E.houseName)&&l.createElement(t.Row,{label:m("PTR_HOUSE_NAME"),text:""+m(f(null==E?void 0:E.houseName)),actionButton:l.createElement(R,{jumpTo:"/upyog-ui/citizen/ptr/petservice/"+y+"/address"})}),l.createElement(t.Row,{label:m("PTR_STREET_NAME"),text:""+m(f(null==E?void 0:E.streetName)),actionButton:l.createElement(R,{jumpTo:"/upyog-ui/citizen/ptr/petservice/"+y+"/address"})}),l.createElement(t.Row,{label:m("PTR_ADDRESS_LINE1"),text:""+m(f(null==E?void 0:E.addressline1)),actionButton:l.createElement(R,{jumpTo:"/upyog-ui/citizen/ptr/petservice/"+y+"/address"})}),(null==E?void 0:E.addressline2)&&l.createElement(t.Row,{label:m("PTR_ADDRESS_LINE2"),text:""+m(f(null==E?void 0:E.addressline2)),actionButton:l.createElement(R,{jumpTo:"/upyog-ui/citizen/ptr/petservice/"+y+"/address"})}),l.createElement(t.Row,{label:m("PTR_ADDRESS_PINCODE"),text:""+m(f(null==E?void 0:E.pincode)),actionButton:l.createElement(R,{jumpTo:"/upyog-ui/citizen/ptr/petservice/"+y+"/address"})}),l.createElement(t.Row,{label:m("MYCITY_CODE_LABEL"),text:""+m(f(null==E||null===(c=E.city)||void 0===c?void 0:c.name)),actionButton:l.createElement(R,{jumpTo:"/upyog-ui/citizen/ptr/petservice/"+y+"/address"})}),l.createElement(t.Row,{label:m("PTR_LOCALITY"),text:""+m(f(null==E||null===(s=E.locality)||void 0===s?void 0:s.i18nKey)),actionButton:l.createElement(R,{jumpTo:"/upyog-ui/citizen/ptr/petservice/"+y+"/address"})}),l.createElement(t.Row,{label:m("PTR_LANDMARK"),text:""+m(f(null==E?void 0:E.landmark)),actionButton:l.createElement(R,{jumpTo:"/upyog-ui/citizen/ptr/petservice/"+y+"/address"})})),l.createElement("br",null),l.createElement(t.CheckBox,{label:m("PTR_FINAL_DECLARATION_MESSAGE"),onChange:()=>{T(!b)},styles:{height:"auto"}})),l.createElement(t.SubmitBar,{label:m("PTR_COMMON_BUTTON_SUBMIT"),onSubmit:p,disabled:!b})))},PTRAcknowledgement:e=>{var a,r;let{data:c,onSuccess:s}=e;const{t:d}=i.useTranslation(),p=Digit.ULBService.getCitizenCurrentTenant(!0)||Digit.ULBService.getCurrentTenantId(),v=Digit.UserService.getUser().info,m=Digit.Hooks.ptr.usePTRCreateAPI(null===(a=c.address)||void 0===a||null===(r=a.city)||void 0===r?void 0:r.code),{data:f}=Digit.Hooks.useStore.getInitData(),{tenants:E}=f||{};return n.useEffect(()=>{try{c.tenantId=p;let e=(e=>{var t,n,l,i,o,a;return e=(e=>{let{ownerss:t}=e,n=u({},t);return e.ownerss=n,e})(e),{PetRegistrationApplications:[u({tenantId:(e=(e=>{var t,n,l,i;let{pets:o}=e,a={petType:null==o||null===(t=o.petType)||void 0===t?void 0:t.value,breedType:null==o||null===(n=o.breedType)||void 0===n?void 0:n.value,petGender:null==o||null===(l=o.petGender)||void 0===l?void 0:l.code,birthDate:null!=o&&o.birthDate?h(null==o?void 0:o.birthDate):null,adoptionDate:null!=o&&o.adoptionDate?h(null==o?void 0:o.adoptionDate):null,identificationMark:null==o?void 0:o.identificationMark,petColor:null==o||null===(i=o.petColor)||void 0===i?void 0:i.colourCode,clinicName:null==o?void 0:o.clinicName,petName:null==o?void 0:o.petName,doctorName:null==o?void 0:o.doctorName,lastVaccineDate:null==o?void 0:o.lastVaccineDate,petAge:null==o?void 0:o.petAge,vaccinationNumber:null==o?void 0:o.vaccinationNumber};return e.pets=a,e})(e=(e=>{var t,n,l;let{address:i}=e,o={pincode:null==i?void 0:i.pincode,landmark:null==i?void 0:i.landmark,city:null==i||null===(t=i.city)||void 0===t?void 0:t.name,doorNo:(null==i?void 0:i.houseNo)||null,street:(null==i?void 0:i.streetName)||null,locality:{code:(null==i||null===(n=i.locality)||void 0===n?void 0:n.i18nKey)||"NA",area:null==i||null===(l=i.locality)||void 0===l?void 0:l.name},buildingName:null==i?void 0:i.houseName,addressLine1:null==i?void 0:i.addressline1,addressLine2:null==i?void 0:i.addressline2,propertyId:(null==i?void 0:i.propertyId)||null};return e.address=o,e})(e))).tenantId},null===(t=e)||void 0===t?void 0:t.ownerss,{applicationType:sessionStorage.getItem("applicationType"),validityDate:(null===(n=e)||void 0===n?void 0:n.validityDate)||null,status:(null===(l=e)||void 0===l?void 0:l.status)||null,expireflag:!1,petToken:sessionStorage.getItem("petToken")||"",previousapplicationnumber:sessionStorage.getItem("petId"),address:e.address,petDetails:e.pets},null===(i=e)||void 0===i?void 0:i.documents,{propertyId:null===(o=e)||void 0===o||null===(a=o.address)||void 0===a?void 0:a.propertyId,workflow:{businessService:"ptr",action:"APPLY",moduleName:"pet-services"}})]}})(c);m.mutate(e,{onSuccess:s})}catch(e){}},[]),m.isLoading||m.isIdle?l.createElement(t.Loader,null):l.createElement(t.Card,null,l.createElement(M,{t:d,data:m.data,isSuccess:m.isSuccess,isLoading:m.isIdle||m.isLoading}),l.createElement(t.StatusTable,null,m.isSuccess&&l.createElement(t.Row,{rowContainerStyle:L,last:!0,textStyle:{whiteSpace:"pre",width:"60%"}})),m.isSuccess&&l.createElement(t.SubmitBar,{label:d("PTR_PET_DOWNLOAD_ACK_FORM"),onSubmit:function(){try{const{PetRegistrationApplications:e=[]}=m.data;let t=e&&e[0]||{};const n=E.find(e=>e.code===t.tenantId);return Promise.resolve(x(u({},t),n,d)).then(function(e){Digit.Utils.pdf.generate(e)})}catch(e){return Promise.reject(e)}}}),l.createElement(o.Link,"CITIZEN"===(null==v?void 0:v.type)?{to:"/upyog-ui/citizen"}:{to:"/upyog-ui/employee"},l.createElement(t.LinkButton,{label:d("CORE_COMMON_GO_TO_HOME")})))},PTRWFCaption:A,PTRNewApplication:e=>{var n,a,c,s;const d=r.useQueryClient(),p=o.useRouteMatch(),{t:v}=i.useTranslation(),{pathname:m}=o.useLocation(),f=o.useHistory();Digit.ULBService.getStateId();let E=[];const[_,h,g]=Digit.Hooks.useSessionStorage("PTR_CREATE_PET",{});let{data:y,isLoading:b}=Digit.Hooks.useEnabledMDMS(Digit.ULBService.getStateId(),"PetService",[{name:"CommonFieldsConfig"}],{select:e=>{var t;return null==e||null===(t=e.PetService)||void 0===t?void 0:t.CommonFieldsConfigEmp}});const T=sessionStorage.getItem("petId")?sessionStorage.getItem("petId"):null;sessionStorage.setItem("applicationType",m.includes("new-application")?"NEWAPPLICATION":"RENEWAPPLICATION");const A=Digit.ULBService.getCitizenCurrentTenant(!0),{data:C}=Digit.Hooks.ptr.usePTRSearch({tenantId:A,filters:{applicationNumber:T}});let D=null==C?void 0:C.PetRegistrationApplications[0];function N(e,t,n,l,i){if(void 0===i&&(i=!1),"owners"===e){let n=_.owners||[];n[l]=t,h(u({},_,{[e]:[...n]}))}else if("units"===e){let e=_.units||[];e=t,h(u({},_,{units:e}))}else h(u({},_,{[e]:u({},_[e],t)}));((e,t,n,l)=>{let i,o=m.split("/").pop(),a=o.charAt(o.length-1),r=!1;Number(parseInt(o))||"0"==o||"-1"==o?"-1"==o||"-2"==o?(o=m.slice(0,-3),o=o.split("/").pop(),r=!0):(o=m.slice(0,-2),o=o.split("/").pop(),r=!0):r=!1,isNaN(a)||(r=!0);let{nextStep:u={}}=E.find(e=>e.route===(o||"0")),c=f.push;if(e&&(c=f.replace),n&&(u=l),null===u)return c(p.path+"/check");i=isNaN(u.split("/").pop())&&r&&"map"!==u?p.path+"/"+u+"/"+t:p.path+"/"+u,c(i)})(n,l,i,e)}_&&Object.keys(_).length>0&&window.location.href.includes("/info")&&"true"!==sessionStorage.getItem("docReqScreenByBack")&&(g(),d.invalidateQueries("PTR_CREATE_PET"));const P=()=>{},R=()=>{};if(b)return l.createElement(t.Loader,null);y=y||S,y.forEach(e=>{E=E.concat(e.body.filter(e=>!e.hideInCitizen))}),E.indexRoute="info";const I=null===(n=Digit)||void 0===n||null===(a=n.ComponentRegistryService)||void 0===a?void 0:a.getComponent("PTRCheckPage"),O=null===(c=Digit)||void 0===c||null===(s=c.ComponentRegistryService)||void 0===s?void 0:s.getComponent("PTRAcknowledgement");return l.createElement(o.Switch,null,E.map((e,t)=>{const{component:n,texts:i,inputs:a,key:r}=e,u="string"==typeof n?Digit.ComponentRegistryService.getComponent(n):n;return l.createElement(o.Route,{path:p.path+"/"+e.route,key:t},l.createElement(u,{config:{texts:i,inputs:a,key:r},onSelect:N,onSkip:P,t:v,formData:_,onAdd:R,renewApplication:m.includes("new-application")?{}:D}))}),l.createElement(o.Route,{path:p.path+"/check"},l.createElement(I,{onSubmit:function(){try{return f.push(p.path+"/acknowledgement"),Promise.resolve()}catch(e){return Promise.reject(e)}},value:_})),l.createElement(o.Route,{path:p.path+"/acknowledgement"},l.createElement(O,{data:_,onSuccess:()=>{g(),d.invalidateQueries("PTR_CREATE_PET"),sessionStorage.removeItem(["applicationType","petId"])}})),l.createElement(o.Route,null,l.createElement(o.Redirect,{to:p.path+"/"+E.indexRoute})))},ApplicationDetails:ji,PTRMyApplications:()=>{const{t:e}=i.useTranslation(),n=Digit.ULBService.getCitizenCurrentTenant(!0)||Digit.ULBService.getCurrentTenantId(),a=Digit.UserService.getUser().info;let r,u,c=window.location.href.split("/").pop();isNaN(parseInt(c))?r=4:(u=c,r=parseInt(c)+50);let s=isNaN(parseInt(c))?{limit:"4",sortOrder:"ASC",sortBy:"createdTime",offset:"0",mobileNumber:null==a?void 0:a.mobileNumber,tenantId:n}:{limit:"50",sortOrder:"ASC",sortBy:"createdTime",offset:u,tenantId:n};const{isLoading:d,data:p}=Digit.Hooks.ptr.usePTRSearch({filters:s},{filters:s}),{PetRegistrationApplications:v}=p||{};let m=(null==v?void 0:v.length)>0?null==v?void 0:v.map(e=>null==e?void 0:e.applicationNumber):[],f={tenantId:n,referenceIds:m};const{isLoading:E,data:_}=Digit.Hooks.useFeedBackSearch({filters:{serviceSearchArgs:f}},{filters:{serviceSearchArgs:f},enabled:(null==m?void 0:m.length)>0,cacheTime:0});function h(t){var n;let l=null==_||null===(n=_.Service)||void 0===n?void 0:n.find(e=>{var n;return null==e||null===(n=e.referenceId)||void 0===n?void 0:n.includes(null==t?void 0:t.applicationNumber)});return e(l?"CS_CF_VIEW":"CS_CF_TRACK")}return d||E?l.createElement(t.Loader,null):l.createElement(l.Fragment,null,l.createElement(t.Header,null,e("CS_TITLE_MY_APPLICATIONS")+" "+(v?"("+v.length+")":"")),l.createElement("div",null,(null==v?void 0:v.length)>0&&v.map((e,t)=>l.createElement("div",{key:t},l.createElement(k,{application:e,tenantId:null==a?void 0:a.permanentCity,buttonLabel:h(e)}))),!(null!=v&&v.length)>0&&l.createElement("p",{style:{marginLeft:"16px",marginTop:"16px"}},e("PTR_NO_APPLICATION_FOUND_MSG")),0!==(null==v?void 0:v.length)&&l.createElement("div",null,l.createElement("p",{style:{marginLeft:"16px",marginTop:"16px"}},l.createElement("span",{className:"link"},l.createElement(o.Link,{to:"/upyog-ui/citizen/ptr/petservice/my-application/"+r},e("PTR_LOAD_MORE_MSG")))))),l.createElement("p",{style:{marginLeft:"16px",marginTop:"16px"}},e("PTR_TEXT_NOT_ABLE_TO_FIND_THE_APPLICATION")," ",l.createElement("span",{className:"link",style:{display:"block"}},l.createElement(o.Link,{to:"/upyog-ui/citizen/ptr/petservice/new-application/info"},e("PTR_COMMON_CLICK_HERE_TO_REGISTER_NEW_PET")))))},PTRApplicationDetails:()=>{var e,a,r,s,d,p,v,m,f,_,h,g,S,y,b,T,A,D,N,P;const{t:R}=i.useTranslation(),{acknowledgementIds:I,tenantId:O}=o.useParams(),[w,L]=n.useState(!1),[M,k]=n.useState(!1),[F,B]=n.useState(null),{data:U}=Digit.Hooks.useStore.getInitData(),{tenants:H}=U||{},{isLoading:j,data:W}=Digit.Hooks.ptr.usePTRSearch({tenantId:O,filters:{applicationNumber:I}}),[z,V]=n.useState(null),K=xe(W,"PetRegistrationApplications",[]),Y=xe(W,"PetRegistrationApplications[0].applicationNumber",[]);let G=K&&K.length>0&&K[0]||{};const q=G;sessionStorage.setItem("ptr-pet",JSON.stringify(q));const[$,X]=n.useState(!1);n.useEffect(()=>{!function(){try{X(!0),Promise.resolve(Digit.PaymentService.fetchBill(O,{businessService:"pet-services",consumerCode:I})).then(function(e){V(e),X(!1)})}catch(e){return Promise.reject(e)}}()},[O,I]);const{isLoading:Z}=Digit.Hooks.ptr.usePTRSearch({tenantId:O,filters:{applicationNumber:Y,audit:!0}},{enabled:!0}),{data:J,isLoading:Q}=Digit.Hooks.useRecieptSearch({tenantId:O,businessService:"pet-services",consumerCodes:I,isEmployee:!1},{enabled:!!I});if(G.workflow||(G.workflow={id:null,tenantId:O,businessService:"pet-services",businessId:null==q?void 0:q.applicationNumber,action:"",moduleName:"pet-services",state:null,comment:null,documents:null,assignes:null}),j||Z)return l.createElement(t.Loader,null);let ee=[];return ee.push({label:R("PTR_PET_DOWNLOAD_ACK_FORM"),onClick:()=>function(){try{const e=q||{},t=H.find(t=>t.code===e.tenantId);return Promise.resolve(x(u({},e),t,R)).then(function(e){Digit.Utils.pdf.generate(e)})}catch(e){return Promise.reject(e)}}()}),J&&(null==J?void 0:J.Payments.length)>0&&0==Q&&ee.push({label:R("PTR_FEE_RECIEPT"),onClick:()=>{var e;return function(e){let{tenantId:t,payments:n}=e;c(e,we);try{let e={filestoreIds:[null==n?void 0:n.fileStoreId]};return Promise.resolve(Digit.PaymentService.generatePdf(t,{Payments:[u({},n)]},"petservice-receipt")).then(function(n){return e=n,Promise.resolve(Digit.PaymentService.printReciept(t,{fileStoreIds:e.filestoreIds[0]})).then(function(t){var n;window.open(t[null===(n=e)||void 0===n?void 0:n.filestoreIds[0]],"_blank")})})}catch(e){return Promise.reject(e)}}({tenantId:null==J||null===(e=J.Payments[0])||void 0===e?void 0:e.tenantId,payments:null==J?void 0:J.Payments[0]})}}),J&&(null==J?void 0:J.Payments.length)>0&&0==Q&&ee.push({label:R("PTR_CERTIFICATE"),onClick:()=>function(){try{var e;return Promise.resolve(Digit.PaymentService.generatePdf(O,{PetRegistrationApplications:[null==W||null===(e=W.PetRegistrationApplications)||void 0===e?void 0:e[0]]},"petservicecertificate")).then(function(e){return Promise.resolve(Digit.PaymentService.printReciept(O,{fileStoreIds:e.filestoreIds[0]})).then(function(t){window.open(t[null==e?void 0:e.filestoreIds[0]],"_blank")})})}catch(e){return Promise.reject(e)}}()}),l.createElement(l.Fragment,null,l.createElement("div",null,l.createElement("div",{className:"cardHeaderWithOptions",style:{marginRight:"auto",maxWidth:"960px"}},l.createElement(t.Header,{styles:{fontSize:"32px"}},R("PTR_PET_APPLICATION_DETAILS")),ee&&ee.length>0&&l.createElement(t.MultiLink,{className:"multilinkWrapper",onHeadClick:()=>L(!w),displayOptions:w,options:ee})),l.createElement(t.Card,null,l.createElement(t.StatusTable,null,l.createElement(t.Row,{className:"border-none",label:R("PTR_APPLICATION_NO_LABEL"),text:null==G?void 0:G.applicationNumber})),l.createElement(t.StatusTable,null,l.createElement(t.Row,{className:"border-none",label:R("PTR_VALIDITY_DATE"),text:(te=null==G?void 0:G.validityDate,te?new Date(1e3*te).getDate()+"/"+(new Date(1e3*te).getMonth()+1)+"/"+new Date(1e3*te).getFullYear().toString():"NA")})),(null==G?void 0:G.petToken)&&(null==G?void 0:G.petToken.length)>0&&l.createElement(t.StatusTable,null,l.createElement(t.Row,{className:"border-none",label:R("PTR_TOKEN"),text:null==G?void 0:G.petToken})),l.createElement(t.CardSubHeader,{style:{fontSize:"24px"}},R("PTR_ADDRESS_HEADER")),l.createElement(t.StatusTable,null,l.createElement(t.Row,{className:"border-none",label:R("PTR_PINCODE"),text:(null==G||null===(e=G.address)||void 0===e?void 0:e.pincode)||R("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:R("PTR_CITY"),text:(null==G||null===(a=G.address)||void 0===a?void 0:a.city)||R("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:R("PTR_STREET_NAME"),text:(null==G||null===(r=G.address)||void 0===r?void 0:r.street)||R("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:R("PTR_HOUSE_NO"),text:(null==G||null===(s=G.address)||void 0===s?void 0:s.doorNo)||R("CS_NA")})),l.createElement(t.CardSubHeader,{style:{fontSize:"24px"}},R("PTR_APPLICANT_DETAILS_HEADER")),l.createElement(t.StatusTable,null,l.createElement(t.Row,{className:"border-none",label:R("PTR_APPLICANT_NAME"),text:(null==G?void 0:G.applicantName)||R("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:R("PTR_FATHER/HUSBAND_NAME"),text:(null==G?void 0:G.fatherName)||R("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:R("PTR_APPLICANT_MOBILE_NO"),text:(null==G?void 0:G.mobileNumber)||R("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:R("PTR_APPLICANT_EMAILID"),text:(null==G?void 0:G.emailId)||R("CS_NA")})),l.createElement(t.CardSubHeader,{style:{fontSize:"24px"}},R("PTR_PET_DETAILS_HEADER")),l.createElement(t.StatusTable,null,l.createElement(t.Row,{className:"border-none",label:R("PTR_PET_TYPE"),text:(null==G||null===(d=G.petDetails)||void 0===d?void 0:d.petType)||R("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:R("PTR_BREED_TYPE"),text:(null==G||null===(p=G.petDetails)||void 0===p?void 0:p.breedType)||R("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:R("PTR_DOCTOR_NAME"),text:(null==G||null===(v=G.petDetails)||void 0===v?void 0:v.doctorName)||R("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:R("PTR_CLINIC_NAME"),text:(null==G||null===(m=G.petDetails)||void 0===m?void 0:m.clinicName)||R("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:R("PTR_VACCINATED_DATE"),text:(null==G||null===(f=G.petDetails)||void 0===f?void 0:f.lastVaccineDate)||R("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:R("PTR_VACCINATION_NUMBER"),text:(null==G||null===(_=G.petDetails)||void 0===_?void 0:_.vaccinationNumber)||R("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:R("PTR_PET_NAME"),text:(null==G||null===(h=G.petDetails)||void 0===h?void 0:h.petName)||R("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:R("PTR_PET_AGE"),text:(null==G||null===(g=G.petDetails)||void 0===g?void 0:g.petAge)||R("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:R("PTR_PET_SEX"),text:(null==G||null===(S=G.petDetails)||void 0===S?void 0:S.petGender)||R("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:R("PTR_IDENTIFICATION_MARK"),text:(null==G||null===(y=G.petDetails)||void 0===y?void 0:y.identificationMark)||R("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:R("PTR_VACCINATION_NUMBER"),text:(null==G||null===(b=G.petDetails)||void 0===b?void 0:b.vaccinationNumber)||R("CS_NA")}),null!=G&&null!==(T=G.petDetails)&&void 0!==T&&T.birthDate?(null==G||null===(A=G.petDetails)||void 0===A?void 0:A.birthDate)&&l.createElement(t.Row,{className:"border-none",label:R("PTR_BIRTH"),text:E(null==G||null===(D=G.petDetails)||void 0===D?void 0:D.birthDate)||R("CS_NA")}):(null==G||null===(N=G.petDetails)||void 0===N?void 0:N.adoptionDate)&&l.createElement(t.Row,{className:"border-none",label:R("PTR_ADOPTION"),text:E(null==G||null===(P=G.petDetails)||void 0===P?void 0:P.adoptionDate)||R("CS_NA")})),l.createElement(C,{application:q,id:null==q?void 0:q.applicationNumber,userType:"citizen"}),F&&l.createElement(t.Toast,{error:F.key,label:R(F.label),style:{bottom:"0px"},onClose:()=>{B(null)}})),M&&l.createElement(PTCitizenFeedbackPopUp,{setpopup:k,setShowToast:B,data:W})));var te},PTRCreatePet:e=>{var n,a,c,s;const d=r.useQueryClient(),p=o.useRouteMatch(),{t:v}=i.useTranslation(),{pathname:m}=o.useLocation(),f=o.useHistory();Digit.ULBService.getStateId();let E=[];const[_,h,g]=Digit.Hooks.useSessionStorage("PTR_CREATE_PET",{});let{data:y,isLoading:b}=Digit.Hooks.useEnabledMDMS(Digit.ULBService.getStateId(),"PetService",[{name:"CommonFieldsConfig"}],{select:e=>{var t;return null==e||null===(t=e.PetService)||void 0===t?void 0:t.CommonFieldsConfigEmp}});const T=sessionStorage.getItem("petId")?sessionStorage.getItem("petId"):null;sessionStorage.setItem("applicationType",m.includes("new-application")?"NEWAPPLICATION":"RENEWAPPLICATION");const A=Digit.ULBService.getCitizenCurrentTenant(!0),{data:C}=Digit.Hooks.ptr.usePTRSearch({tenantId:A,filters:{applicationNumber:T}});let D=null==C?void 0:C.PetRegistrationApplications[0];function N(e,t,n,l,i){if(void 0===i&&(i=!1),"owners"===e){let n=_.owners||[];n[l]=t,h(u({},_,{[e]:[...n]}))}else if("units"===e){let e=_.units||[];e=t,h(u({},_,{units:e}))}else h(u({},_,{[e]:u({},_[e],t)}));((e,t,n,l)=>{let i,o=m.split("/").pop(),a=o.charAt(o.length-1),r=!1;Number(parseInt(o))||"0"==o||"-1"==o?"-1"==o||"-2"==o?(o=m.slice(0,-3),o=o.split("/").pop(),r=!0):(o=m.slice(0,-2),o=o.split("/").pop(),r=!0):r=!1,isNaN(a)||(r=!0);let{nextStep:u={}}=E.find(e=>e.route===(o||"0")),c=f.push;if(e&&(c=f.replace),n&&(u=l),null===u)return c(p.path+"/check");i=isNaN(u.split("/").pop())&&r&&"map"!==u?p.path+"/"+u+"/"+t:p.path+"/"+u,c(i)})(n,l,i,e)}_&&Object.keys(_).length>0&&window.location.href.includes("/info")&&"true"!==sessionStorage.getItem("docReqScreenByBack")&&(g(),d.invalidateQueries("PTR_CREATE_PET"));const P=()=>{},R=()=>{};if(b)return l.createElement(t.Loader,null);y=y||S,y.forEach(e=>{E=E.concat(e.body.filter(e=>!e.hideInCitizen))}),E.indexRoute="info";const I=null===(n=Digit)||void 0===n||null===(a=n.ComponentRegistryService)||void 0===a?void 0:a.getComponent("PTRCheckPage"),O=null===(c=Digit)||void 0===c||null===(s=c.ComponentRegistryService)||void 0===s?void 0:s.getComponent("PTRAcknowledgement");return l.createElement(o.Switch,null,E.map((e,t)=>{const{component:n,texts:i,inputs:a,key:r}=e,u="string"==typeof n?Digit.ComponentRegistryService.getComponent(n):n;return l.createElement(o.Route,{path:p.path+"/"+e.route,key:t},l.createElement(u,{config:{texts:i,inputs:a,key:r},onSelect:N,onSkip:P,t:v,formData:_,onAdd:R,renewApplication:m.includes("new-application")?{}:D}))}),l.createElement(o.Route,{path:p.path+"/check"},l.createElement(I,{onSubmit:function(){try{return f.push(p.path+"/acknowledgement"),Promise.resolve()}catch(e){return Promise.reject(e)}},value:_})),l.createElement(o.Route,{path:p.path+"/acknowledgement"},l.createElement(O,{data:_,onSuccess:()=>{g(),d.invalidateQueries("PTR_CREATE_PET"),sessionStorage.removeItem(["applicationType","petId"]),sessionStorage.removeItem("petToken")}})),l.createElement(o.Route,null,l.createElement(o.Redirect,{to:p.path+"/"+E.indexRoute})))},PTRCitizenDetails:e=>{var i,o,a,r,c;let{t:s,config:p,onSelect:v,userType:m,formData:f,renewApplication:E}=e;const _=Digit.UserService.getUser().info,h={width:"EMPLOYEE"===_.type?"50%":"86%"};let g={};const[S,y]=n.useState((null==E?void 0:E.applicantName)||("EMPLOYEE"===_.type?"":null==_?void 0:_.name)||(null==f||null===(i=f.ownerss)||void 0===i?void 0:i.applicantName)||""),[b,T]=n.useState((null==E?void 0:E.emailId)||(null==f||null===(o=f.ownerss)||void 0===o?void 0:o.emailId)||""),[A,C]=n.useState((null==E?void 0:E.mobileNumber)||("EMPLOYEE"===_.type?"":null==_?void 0:_.mobileNumber)||(null==f||null===(a=f.ownerss)||void 0===a?void 0:a.mobileNumber)||""),[D,N]=n.useState((null==f||null===(r=f.ownerss)||void 0===r?void 0:r.alternateNumber)||""),[P,R]=n.useState((null==E?void 0:E.fatherName)||(null==f||null===(c=f.ownerss)||void 0===c?void 0:c.fatherName)||""),I=()=>{let e,t=f.ownerss;"citizen"===m?(e=u({},t,{applicantName:S,mobileNumber:A,alternateNumber:D,fatherName:P,emailId:b}),v(p.key,u({},f[p.key],e),!1)):(e=u({},t,{applicantName:S,mobileNumber:A,alternateNumber:D,fatherName:P,emailId:b}),v(p.key,e,!1))};return n.useEffect(()=>{"citizen"===m&&I()},[S,A,P,b]),l.createElement(l.Fragment,null,l.createElement(d,{currentStep:1}),l.createElement(t.FormStep,{config:p,onSelect:I,onSkip:()=>v(),t:s,isDisabled:!(S&&A&&P&&b)},l.createElement("div",null,l.createElement(t.CardLabel,null,""+s("PTR_APPLICANT_NAME")," ",l.createElement("span",{className:"astericColor"},"*")),l.createElement(t.TextInput,u({t:s,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"applicantName",value:S,style:h,onChange:function(e){y(e.target.value)},ValidationRequired:!0},g={isRequired:!0,pattern:"^[a-zA-Z ]+$",type:"tel",title:s("PT_NAME_ERROR_MESSAGE")})),l.createElement(t.CardLabel,null,""+s("PTR_MOBILE_NUMBER")," ",l.createElement("span",{className:"astericColor"},"*")),l.createElement(t.MobileNumber,{value:A,name:"mobileNumber",onChange:e=>function(e){C(e.target.value)}({target:{value:e}}),style:{width:"EMPLOYEE"===_.type?"49%":"86%"},required:!0,pattern:"[6-9]{1}[0-9]{9}",type:"tel",title:s("CORE_COMMON_APPLICANT_MOBILE_NUMBER_INVALID")}),l.createElement(t.CardLabel,null,""+s("PTR_ALT_MOBILE_NUMBER")),l.createElement(t.MobileNumber,{value:D,name:"alternateNumber",onChange:e=>function(e){N(e.target.value)}({target:{value:e}}),style:{width:"EMPLOYEE"===_.type?"49%":"86%"},required:!1,pattern:"[6-9]{1}[0-9]{9}",type:"tel",title:s("CORE_COMMON_APPLICANT_MOBILE_NUMBER_INVALID")}),l.createElement(t.CardLabel,null,""+s("PTR_FATHER_HUSBAND_NAME")," ",l.createElement("span",{className:"astericColor"},"*")),l.createElement(t.TextInput,u({t:s,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"fatherName",style:h,value:P,onChange:function(e){R(e.target.value)},ValidationRequired:!0},g={isRequired:!0,pattern:"^[a-zA-Z ]+$",type:"tel",title:s("PT_NAME_ERROR_MESSAGE")})),l.createElement(t.CardLabel,null,""+s("PTR_EMAIL_ID")," ",l.createElement("span",{className:"astericColor"},"*")),l.createElement(t.TextInput,u({t:s,type:"email",isMandatory:!0,optionKey:"i18nKey",name:"emailId",value:b,style:h,onChange:function(e){T(e.target.value)},ValidationRequired:!0},g={isRequired:!0,pattern:"^[a-zA-Z0-9._%+-]+@[a-zA-Z]+\\.[a-zA-Z]{3,4}$",type:"email",title:s("PT_NAME_ERROR_MESSAGE")})))))},PTRCitizenPet:e=>{var i,o,r,c,s,p,v,m,f,_,h,g,S,y,b,T,A,C,D,N,P,R,I,O,x,w,L,M,k,F,B,U,H;let{t:j,config:W,onSelect:z,userType:V,formData:K,renewApplication:Y}=e;const G=Digit.UserService.getUser().info,q=e=>e?{i18nKey:e,code:e,value:e}:null;let $={},{data:X}=Digit.Hooks.useEnabledMDMS(Digit.ULBService.getStateId(),"PetService",[{name:"PetColor"}],{select:e=>{var t;return null==e||null===(t=e.PetService)||void 0===t?void 0:t.PetColor.map(e=>({i18nKey:""+e.colourName,colourCode:""+e.colourCode,code:""+e.colourName,active:""+e.active}))}});const Z={width:"EMPLOYEE"===G.type?"50%":"86%"},[J,Q]=n.useState(q(null==Y||null===(i=Y.petDetails)||void 0===i?void 0:i.petType)||(null==K||null===(o=K.pets)||void 0===o?void 0:o.petType)||""),[ee,te]=n.useState(q(null==Y||null===(r=Y.petDetails)||void 0===r?void 0:r.breedType)||(null==K||null===(c=K.pets)||void 0===c?void 0:c.breedType)||""),[ne,le]=n.useState(q(null==Y||null===(s=Y.petDetails)||void 0===s?void 0:s.petGender)||(null==K||null===(p=K.pets)||void 0===p?void 0:p.petGender)||""),[ie,oe]=n.useState((null==Y||null===(v=Y.petDetails)||void 0===v?void 0:v.petName)||(null==K||null===(m=K.pets)||void 0===m?void 0:m.petName)||""),[ae,re]=n.useState((null==Y||null===(f=Y.petDetails)||void 0===f?void 0:f.petAge)||(null==K||null===(_=K.pets)||void 0===_?void 0:_.petAge)||""),[ue,ce]=n.useState((null==Y||null===(h=Y.petDetails)||void 0===h?void 0:h.petName)||(null==K||null===(g=K.pets)||void 0===g?void 0:g.doctorName)||""),[se,de]=n.useState((null==Y||null===(S=Y.petDetails)||void 0===S?void 0:S.clinicName)||(null==K||null===(y=K.pets)||void 0===y?void 0:y.clinicName)||""),[pe,ve]=n.useState((null==Y||null===(b=Y.petDetails)||void 0===b?void 0:b.vaccinationNumber)||(null==K||null===(T=K.pets)||void 0===T?void 0:T.vaccinationNumber)||""),[me,fe]=n.useState((null==Y||null===(A=Y.petDetails)||void 0===A?void 0:A.lastVaccineDate)||(null==K||null===(C=K.pets)||void 0===C?void 0:C.lastVaccineDate)||""),[Ee,_e]=n.useState((null==K||null===(D=K.pets)||void 0===D?void 0:D.petColor)||""),[he,ge]=n.useState((null==Y||null===(N=Y.petDetails)||void 0===N?void 0:N.identificationMark)||(null==K||null===(P=K.pets)||void 0===P?void 0:P.identificationMark)||""),[Se,ye]=n.useState(q(null!=Y&&null!==(R=Y.petDetails)&&void 0!==R&&R.birthDate||null!=Y&&null!==(I=Y.petDetails)&&void 0!==I&&I.adoptionDate?null!=Y&&null!==(O=Y.petDetails)&&void 0!==O&&O.birthDate?"Birth":"Adoption":null)||q(null!=K&&null!==(x=K.pets)&&void 0!==x&&x.birthDate||null!=K&&null!==(w=K.pets)&&void 0!==w&&w.adoptionDate?null!=K&&null!==(L=K.pets)&&void 0!==L&&L.birthDate?"Birth":"Adoption":null)||[{i18nKey:"",code:""}]),[be,Te]=n.useState(E(null==Y||null===(M=Y.petDetails)||void 0===M?void 0:M.birthDate)||(null==K||null===(k=K.pets)||void 0===k?void 0:k.birthDate)||""),[Ae,Ce]=n.useState(E(null==Y||null===(F=Y.petDetails)||void 0===F?void 0:F.adoptionDate)||(null==K||null===(B=K.pets)||void 0===B?void 0:B.adoptionDate)||""),De=Digit.ULBService.getStateId(),[Ne,Pe]=n.useState(""),{data:Re}=Digit.Hooks.useEnabledMDMS(De,"PetService",[{name:"PetType"}],{select:e=>{var t;return null==e||null===(t=e.PetService)||void 0===t?void 0:t.PetType}}),{data:Ie}=Digit.Hooks.useEnabledMDMS(De,"PetService",[{name:"BreedType"}],{select:e=>{var t;return null==e||null===(t=e.PetService)||void 0===t?void 0:t.BreedType}});let Oe=[],xe=[];Re&&Re.map(e=>{Oe.push({i18nKey:"PTR_PET_"+e.code,code:""+e.code,value:""+e.name})});const{control:we}=a.useForm();Ie&&Ie.map(e=>{e.PetType==(null==J?void 0:J.code)&&xe.push({i18nKey:"PTR_BREED_TYPE_"+e.code,code:""+e.code,value:""+e.name})}),n.useEffect(()=>{var e;null!=Y&&Y.petDetails&&_e(null==X||null===(e=X.filter(e=>{var t;return(null==e?void 0:e.colourCode)===(null==Y||null===(t=Y.petDetails)||void 0===t?void 0:t.petColor)}))||void 0===e?void 0:e[0])},[X]),n.useEffect(()=>{be?(Pe(be),me&&me<be&&fe("")):Pe("")},[be,Ae]);const{data:Le}=Digit.Hooks.ptr.usePTRGenderMDMS(De,"common-masters","GenderType");let Me=[];Le&&Le.map(e=>{"TRANSGENDER"!==e.code&&Me.push({i18nKey:"PTR_GENDER_"+e.code,code:""+e.code,name:""+e.code})}),n.useEffect(()=>{if(be){const[e,t,n]=be.split("-").map(Number),l=new Date(e,t-1,n),i=new Date;let o=i.getFullYear()-l.getFullYear(),a=i.getMonth()-l.getMonth();a<0&&(o-=1,a+=12),re(12*o+a)}},[be]);const ke=()=>{let e;e=u({},K.pets,{petType:J,breedType:ee,petGender:ne,petName:ie,petAge:ae,doctorName:ue,clinicName:se,lastVaccineDate:me,vaccinationNumber:pe,birthDate:be,adoptionDate:Ae,identificationMark:he,petColor:Ee}),z(W.key,e,!1)};return n.useEffect(()=>{"citizen"===V&&ke()},[J,ee,ne,ie,ae,ue,me,be,Ae,he,Ee]),l.createElement(l.Fragment,null,l.createElement(d,{currentStep:2}),l.createElement(t.FormStep,{config:W,onSelect:ke,onSkip:()=>z(),t:j,isDisabled:!(J&&ee&&ne&&ie&&ae&&ue&&se&&me&&pe&&(!be&&Ae||!Ae&&be))},l.createElement("div",null,l.createElement(t.CardLabel,null,""+j("PTR_SEARCH_PET_TYPE")," ",l.createElement("span",{className:"astericColor"},"*")),l.createElement(a.Controller,{control:we,name:"petType",defaultValue:J,rules:{required:j("CORE_COMMON_REQUIRED_ERRMSG")},render:e=>l.createElement(t.Dropdown,{className:"form-field",selected:J,select:Q,option:Oe,optionKey:"i18nKey",t:j,placeholder:"Select"})}),l.createElement(t.CardLabel,null,""+j("PTR_SEARCH_BREED_TYPE")," ",l.createElement("span",{className:"astericColor"},"*")),l.createElement(a.Controller,{control:we,name:"breedType",defaultValue:ee,rules:{required:j("CORE_COMMON_REQUIRED_ERRMSG")},render:e=>l.createElement(t.Dropdown,{className:"form-field",selected:ee,select:te,option:xe,optionKey:"i18nKey",t:j,placeholder:"Select"})}),l.createElement(t.CardLabel,null,""+j("PTR_PET_SEX")," ",l.createElement("span",{className:"astericColor"},"*")),l.createElement(a.Controller,{control:we,name:"petGender",defaultValue:ne,rules:{required:j("CORE_COMMON_REQUIRED_ERRMSG")},render:e=>l.createElement(t.Dropdown,{className:"form-field",selected:ne,select:le,option:Me,optionKey:"i18nKey",t:j,placeholder:"Select"})}),l.createElement(t.CardLabel,null,""+j("PTR_PET_COLOR")," ",l.createElement("span",{className:"astericColor"},"*")),l.createElement(a.Controller,{control:we,name:"petColor",defaultValue:Ee,rules:{required:j("CORE_COMMON_REQUIRED_ERRMSG")},render:e=>l.createElement(t.Dropdown,{className:"form-field",selected:Ee,select:_e,optionCardStyles:{overflowY:"auto",maxHeight:"300px"},option:X,optionKey:"i18nKey",t:j,placeholder:"Select"})}),l.createElement(t.CardLabel,null,""+j("PTR_SELECT_BIRTH_ADOPTION")," ",l.createElement("span",{className:"astericColor"},"*")),l.createElement(t.RadioButtons,{t:j,options:[{i18nKey:"Birth",code:"Birth"},{i18nKey:"Adoption",code:"Adoption"}],optionsKey:"code",name:"selectBirthAdoption",value:Se,selectedOption:Se,innerStyles:{display:"inline-block",marginLeft:"20px",paddingBottom:"2px",marginBottom:"2px"},onSelect:ye,isDependent:!0}),("Birth"===(null==Se?void 0:Se.code)||(null==Y||null===(U=Y.petDetails)||void 0===U?void 0:U.birth))&&l.createElement("div",null,l.createElement(t.CardLabel,null,""+j("PTR_BIRTH")," ",l.createElement("span",{className:"astericColor"},"*")),l.createElement(t.TextInput,{t:j,type:"date",isMandatory:!1,optionKey:"i18nKey",name:"birthDate",value:be,onChange:function(e){Ce(null),Te(e.target.value)},style:Z,max:(new Date).toISOString().split("T")[0],rules:{required:j("CORE_COMMON_REQUIRED_ERRMSG"),validDate:e=>!!/^\d{4}-\d{2}-\d{2}$/.test(e)||j("ERR_DEFAULT_INPUT_FIELD_MSG")}})),("Adoption"===(null==Se?void 0:Se.code)||(null==Y||null===(H=Y.petDetails)||void 0===H?void 0:H.adoption))&&l.createElement("div",null,l.createElement(t.CardLabel,null,""+j("PTR_ADOPTION")," ",l.createElement("span",{className:"astericColor"},"*")),l.createElement(t.TextInput,{t:j,type:"date",isMandatory:!1,optionKey:"i18nKey",name:"adoptionDate",value:Ae,onChange:function(e){Te(null),Ce(e.target.value)},style:Z,max:(new Date).toISOString().split("T")[0],rules:{required:j("CORE_COMMON_REQUIRED_ERRMSG"),validDate:e=>!!/^\d{4}-\d{2}-\d{2}$/.test(e)||j("ERR_DEFAULT_INPUT_FIELD_MSG")}})),l.createElement(t.CardLabel,null,""+j("PTR_PET_NAME")," ",l.createElement("span",{className:"astericColor"},"*")),l.createElement(t.TextInput,u({t:j,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"petName",value:ie,onChange:function(e){oe(e.target.value)},style:Z,ValidationRequired:!1},$={isRequired:!0,pattern:"^[a-zA-Z ]+$",type:"text",title:j("PT_NAME_ERROR_MESSAGE")})),l.createElement(t.CardLabel,null,""+j("PTR_IDENTIFICATION_MARK")),l.createElement(t.TextInput,{t:j,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"identificationMark",value:he,onChange:function(e){ge(e.target.value)},style:Z,ValidationRequired:!1}),l.createElement(t.CardLabel,null,j("PTR_PET_AGE")+" (in months)"," ",l.createElement("span",{className:"astericColor"},"*")),l.createElement(t.TextInput,u({t:j,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"petAge",value:ae,onChange:function(e){re(e.target.value)},style:Z,placeholder:"in months",ValidationRequired:!0},$={isRequired:!0,pattern:"^(?:[1-9][0-9]?|[1-3][0-9]{2}|400)$",type:"tel",title:j("PT_NAME_ERROR_MESSAGE")})),null!=ae&&ae>=0&&l.createElement("div",null,Math.floor(ae/12),"  ",1===Math.floor(ae/12)?"YEAR":"YEARS","  ",ae%12,"  ",ae%12==1?"MONTH":"MONTHS"),l.createElement("br",null),l.createElement(t.CardLabel,null,""+j("PTR_DOCTOR_NAME")," ",l.createElement("span",{className:"astericColor"},"*")),l.createElement(t.TextInput,u({t:j,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"doctorName",value:ue,onChange:function(e){ce(e.target.value)},style:Z,ValidationRequired:!1},$={isRequired:!0,pattern:"^[a-zA-Z ]+$",type:"text",title:j("PT_NAME_ERROR_MESSAGE")})),l.createElement(t.CardLabel,null,""+j("PTR_CLINIC_NAME")," ",l.createElement("span",{className:"astericColor"},"*")),l.createElement(t.TextInput,u({t:j,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"clinicName",value:se,onChange:function(e){de(e.target.value)},style:Z,ValidationRequired:!1},$={isRequired:!0,pattern:"^[a-zA-Z0-9 .,?!'\"-]+$",type:"text",title:j("PT_NAME_ERROR_MESSAGE")})),l.createElement(t.CardLabel,null,""+j("PTR_VACCINATED_DATE")," ",l.createElement("span",{className:"astericColor"},"*")),l.createElement(t.TextInput,{t:j,type:"date",isMandatory:!1,optionKey:"i18nKey",name:"lastVaccineDate",value:me,onChange:function(e){fe(e.target.value)},style:Z,min:Ne,max:(new Date).toISOString().split("T")[0],rules:{required:j("CORE_COMMON_REQUIRED_ERRMSG"),validDate:e=>!!/^\d{4}-\d{2}-\d{2}$/.test(e)||j("ERR_DEFAULT_INPUT_FIELD_MSG")}}),l.createElement(t.CardLabel,null,""+j("PTR_VACCINATION_NUMBER")," ",l.createElement("span",{className:"astericColor"},"*")),l.createElement(t.TextInput,{t:j,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"vaccinationNumber",value:pe,onChange:function(e){ve(e.target.value)},style:Z}))))},PTRSelectAddress:e=>{var i,r,c,s,p,v,m,f,E,_,h,g,S,y,b,T,A,C,D,N,P,R,I,O,x;let{t:w,config:L,onSelect:M,formData:k,renewApplication:F}=e;const B=e=>e?{i18nKey:e,code:e,value:e}:null,U=Digit.Hooks.ptr.useTenants(),{pathname:H}=o.useLocation();let j={};const{control:W}=a.useForm(),z=Digit.UserService.getUser().info,[V,K]=n.useState((null==F||null===(i=F.address)||void 0===i?void 0:i.pincode)||(null==k||null===(r=k.address)||void 0===r?void 0:r.pincode)||""),[Y,G]=n.useState((null==k||null===(c=k.address)||void 0===c?void 0:c.city)||B(null==F||null===(s=F.address)||void 0===s?void 0:s.city)||""),[q,$]=n.useState(B(null==F||null===(p=F.address)||void 0===p?void 0:p.locality)||(null==k||null===(v=k.address)||void 0===v?void 0:v.locality)||""),[X,Z]=n.useState((null==F||null===(m=F.address)||void 0===m?void 0:m.streetName)||(null==F||null===(f=F.address)||void 0===f?void 0:f.street)||(null==k||null===(E=k.address)||void 0===E?void 0:E.streetName)||""),[J,Q]=n.useState((null==F||null===(_=F.address)||void 0===_?void 0:_.houseNo)||(null==F||null===(h=F.address)||void 0===h?void 0:h.doorNo)||(null==k||null===(g=k.address)||void 0===g?void 0:g.houseNo)||""),[ee,te]=n.useState((null==F||null===(S=F.address)||void 0===S?void 0:S.landmark)||(null==k||null===(y=k.address)||void 0===y?void 0:y.landmark)||""),[ne,le]=n.useState((null==F||null===(b=F.address)||void 0===b?void 0:b.houseName)||(null==F||null===(T=F.address)||void 0===T?void 0:T.buildingName)||(null==k||null===(A=k.address)||void 0===A?void 0:A.houseName)||""),[ie,oe]=n.useState((null==F||null===(C=F.address)||void 0===C?void 0:C.addressline1)||(null==F||null===(D=F.address)||void 0===D?void 0:D.addressLine1)||(null==k||null===(N=k.address)||void 0===N?void 0:N.addressline1)||""),[ae,re]=n.useState((null==F||null===(P=F.address)||void 0===P?void 0:P.addressline2)||(null==F||null===(R=F.address)||void 0===R?void 0:R.addressLine2)||(null==k||null===(I=k.address)||void 0===I?void 0:I.addressline2)||""),[ue,ce]=n.useState((null==F||null===(O=F.address)||void 0===O?void 0:O.propertyId)||(null==k||null===(x=k.address)||void 0===x?void 0:x.propertyId)||""),[se,de]=n.useState(!1),pe=Digit.ULBService.getStateId(),ve={width:"EMPLOYEE"===z.type?"50%":"86%"},[me,fe]=n.useState(null),{data:Ee}=Digit.Hooks.useBoundaryLocalities(null==Y?void 0:Y.code,"revenue",{enabled:!!Y},w);let _e=[];Ee&&Ee.map((e,t)=>{_e.push({i18nKey:e.i18nkey,code:e.code,label:e.label})}),n.useEffect(()=>{if(me){const e=setTimeout(()=>fe(null),2e3);return()=>clearTimeout(e)}},[me]);const{isLoading:he,isError:ge,data:Se,error:ye}=Digit.Hooks.pt.useApplicationDetail(w,pe,ue,se);return n.useEffect(()=>{if(se){if(he)fe({warning:!0,label:w("PTR_LOADING_DETAILS")});else if(ge)fe({error:!0,label:w("PTR_ERROR_FETCHING_DETAILS")});else if(Se){var e,t,n,l,i,o;const a=null==Se||null===(e=Se.applicationData)||void 0===e||null===(t=e.address)||void 0===t?void 0:t.street,r=null==Se||null===(n=Se.applicationData)||void 0===n||null===(l=n.address)||void 0===l?void 0:l.doorNo,u=null==Se||null===(i=Se.applicationData)||void 0===i||null===(o=i.address)||void 0===o?void 0:o.pincode;(a||r||u)&&(Q(r),Z(a),K(u))}de(!1)}},[se,he,ge,Se,ye]),l.createElement(l.Fragment,null,l.createElement(d,{currentStep:3}),l.createElement(t.FormStep,{config:L,onSelect:()=>{let e=u({},k.address,{pincode:V,city:Y,locality:q,streetName:X,houseNo:J,landmark:ee,houseName:ne,addressline1:ie,addressline2:ae,propertyId:ue});M(L.key,u({},k[L.key],e),!1)},onSkip:()=>M(),t:w,isDisabled:!(V&&Y&&X&&J&&ee&&(H.includes("revised")||H.includes("renew")||q)&&ie)},l.createElement("div",null,l.createElement("style",null,"\n .select-wrap .options-card {\n width: 100% !important;\n -webkit-box-shadow: 0 8px 10px 1px rgba(0, 0, 0, 0.14), 0 3px 14px 2px rgba(0, 0, 0, 0.12), 0 5px 5px -3px rgba(0, 0, 0, 0.2);\n box-shadow: 0 8px 10px 1px rgba(0, 0, 0, 0.14), 0 3px 14px 2px rgba(0, 0, 0, 0.12), 0 5px 5px -3px rgba(0, 0, 0, 0.2);\n position: absolute;\n z-index: 20;\n margin-top: 4px;\n --bg-opacity: 1;\n background-color: #fff;\n background-color: rgba(255, 255, 255, var(--bg-opacity));\n overflow: scroll;\n max-height: 250px; \n min-height:50px;\n } "),l.createElement(t.CardLabel,null,""+w("PTR_PROPERTY_NO")),l.createElement("div",{className:"field-container"},l.createElement(t.TextInput,u({t:w,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"propertyId",value:ue,onChange:e=>{ce(e.target.value)},style:ve,ValidationRequired:!1},j={isRequired:!0,pattern:"^[a-zA-Z0-9/-]*$",type:"text",title:w("PT_NAME_ERROR_MESSAGE")})),l.createElement("div",{style:{position:"relative",zIndex:"100",right:"EMPLOYEE"===z.type?"52%":"95px",marginTop:"-14px",marginRight:"-20px",cursor:"pointer"},onClick:()=>{ue?de(!0):fe({error:!0,label:w("PROPERTY_ID_REQUIRED")})}}," ",l.createElement(t.SearchIcon,null)," ")),l.createElement(t.CardLabel,null,""+w("PTR_HOUSE_NO")," ",l.createElement("span",{className:"check-page-link-button"},"*")),l.createElement(t.TextInput,u({t:w,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"houseNo",value:J,placeholder:"Enter House No",onChange:e=>{Q(e.target.value)},style:{width:"EMPLOYEE"===z.type?"50%":"86%"},ValidationRequired:!0},j={isRequired:!0,pattern:"^[a-zA-Z0-9 ,\\-]+$",type:"text",title:w("PTR_HOUSE_NO_ERROR_MESSAGE")})),l.createElement(t.CardLabel,null,""+w("PTR_HOUSE_NAME")),l.createElement(t.TextInput,{t:w,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"houseName",value:ne,placeholder:"Enter House Name",onChange:e=>{le(e.target.value)},style:{width:"EMPLOYEE"===z.type?"50%":"86%"},ValidationRequired:!1}),l.createElement(t.CardLabel,null,""+w("PTR_STREET_NAME")," ",l.createElement("span",{className:"check-page-link-button"},"*")),l.createElement(t.TextInput,u({t:w,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"streetName",value:X,placeholder:"Enter Street Name",onChange:e=>{Z(e.target.value)},style:{width:"EMPLOYEE"===z.type?"50%":"86%"},ValidationRequired:!0},j={pattern:"^[a-zA-Z0-9 ,\\-]+$",type:"text",title:w("PTR_STREET_NAME_ERROR_MESSAGE")})),l.createElement(t.CardLabel,null,""+w("PTR_ADDRESS_LINE1")," ",l.createElement("span",{className:"check-page-link-button"},"*")),l.createElement(t.TextInput,u({t:w,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"addressline1",value:ie,placeholder:"Enter Address",onChange:e=>{oe(e.target.value)},style:{width:"EMPLOYEE"===z.type?"50%":"86%"},ValidationRequired:!0},j={isRequired:!1,pattern:"^[a-zA-Z0-9 .,?!'\"-]+$",type:"textarea",title:w("SV_LANDMARK_ERROR_MESSAGE")})),l.createElement(t.CardLabel,null,""+w("PTR_ADDRESS_LINE2")),l.createElement(t.TextInput,u({t:w,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"addressline2",value:ae,placeholder:"Enter Address",onChange:e=>{re(e.target.value)},style:{width:"EMPLOYEE"===z.type?"50%":"86%"},ValidationRequired:!0},j={isRequired:!1,pattern:"^[a-zA-Z ]*$",type:"textarea",title:w("SV_LANDMARK_ERROR_MESSAGE")})),l.createElement(t.CardLabel,null,""+w("PTR_LANDMARK")," ",l.createElement("span",{className:"check-page-link-button"},"*")),l.createElement(t.TextArea,u({t:w,type:"textarea",isMandatory:!1,optionKey:"i18nKey",name:"landmark",value:ee,placeholder:"Enter Landmark",onChange:e=>{te(e.target.value)},style:{width:"50%"},ValidationRequired:!0},j={isRequired:!0,pattern:"^[a-zA-Z0-9 ,\\-]+$",type:"textarea",title:w("PTR_LANDMARK_ERROR_MESSAGE")})),l.createElement(t.CardLabel,null,""+w("PTR_CITY")," ",l.createElement("span",{className:"check-page-link-button"},"*")),l.createElement(a.Controller,{control:W,name:"city",defaultValue:Y,rules:{required:w("CORE_COMMON_REQUIRED_ERRMSG")},render:e=>l.createElement(t.Dropdown,{className:"form-field",selected:Y,select:G,option:U,optionKey:"i18nKey",t:w,placeholder:"Select"})}),l.createElement(t.CardLabel,null,""+w("PTR_LOCALITY")," ",l.createElement("span",{className:"check-page-link-button"},"*")),l.createElement(a.Controller,{control:W,name:"locality",defaultValue:q,rules:{required:w("CORE_COMMON_REQUIRED_ERRMSG")},render:e=>l.createElement(t.Dropdown,{className:"form-field",selected:q,select:$,option:_e,optionCardStyles:{overflowY:"auto",maxHeight:"300px"},optionKey:"i18nKey",t:w,placeholder:"Select"})}),l.createElement(t.CardLabel,null,""+w("PTR_ADDRESS_PINCODE")," ",l.createElement("span",{className:"check-page-link-button"},"*")),l.createElement(t.TextInput,{t:w,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"pincode",value:V,onChange:e=>{const t=e.target.value.slice(0,6);K(t)},placeholder:"Enter Pincode",style:{width:"EMPLOYEE"===z.type?"50%":"86%"},ValidationRequired:!0,validation:{required:!1,pattern:"^[0-9]{6}$",type:"tel",title:w("SV_ADDRESS_PINCODE_INVALID")},maxLength:6}))),me&&l.createElement(t.Toast,{error:me.error,warning:me.warning,label:w(me.label),onClose:()=>fe(null)}))},PTRSelectProofIdentity:e=>{var i,a,r;let{t:c,config:s,onSelect:p,formData:v,renewApplication:m}=e;const[f,E]=n.useState((null==v||null===(i=v.documents)||void 0===i?void 0:i.documents)||[]),[_,h]=n.useState(null),[g,S]=n.useState(!0),[y,b]=n.useState(!1),{pathname:A}=o.useLocation(),C=Digit.UserService.getUser().info,D=Digit.ULBService.getStateId(),{isLoading:N,data:P}=Digit.Hooks.ptr.usePetMDMS(D,"PetService","Documents"),R=e=>{if(e.length>0){const t={documentType:"PET.PETPHOTO",filestoreId:e[0],documentUid:e[0]};E(e=>[...e.filter(e=>"PET.PETPHOTO"!==e.documentType),t])}};return n.useEffect(()=>{var e,t;let n=0;null==P||null===(e=P.PetService)||void 0===e||null===(t=e.Documents)||void 0===t||t.forEach(e=>{let t=!1;f.forEach(n=>{var l;e.required&&null!=n&&null!==(l=n.documentType)&&void 0!==l&&l.includes(e.code)&&(t=!0)}),!t&&e.required&&(n+=1)}),0===n&&f.length>0&&f.some(e=>"PET.PETPHOTO"===e.documentType)?S(!0):S(!1)},[f,y]),l.createElement("div",null,l.createElement(d,{currentStep:4}),N?l.createElement(t.Loader,null):l.createElement(t.FormStep,{t:c,config:s,onSelect:()=>{let e=u({},v.documents,{documents:f});p(s.key,e)},onSkip:()=>p(),isDisabled:!g},null==P||null===(a=P.PetService)||void 0===a||null===(r=a.Documents)||void 0===r?void 0:r.map((e,n)=>"PET.PETPHOTO"!==(null==e?void 0:e.code)||A.includes("revised-application")?l.createElement(T,{key:n,document:e,t:c,error:_,setError:h,setDocuments:E,documents:f,setCheckRequiredFields:b,renewApplication:m,user:C}):l.createElement("div",{key:n},l.createElement(t.CardLabel,{className:"card-label-smaller",style:{display:"inline"}},c("PET_PETPHOTO"),l.createElement("span",{style:{color:"#b0242c"}},c("PET_ONLY_PNG_ALLOWED")," ")),l.createElement("div",{style:{marginLeft:"EMPLOYEE"===(null==C?void 0:C.type)?"37%":""}},l.createElement(t.ImageUploadHandler,{tenantId:D,uploadedImages:f.filter(e=>"PET.PETPHOTO"===e.documentType).map(e=>e.filestoreId),onPhotoChange:R,t:c,error:_,setError:h,maxImages:1})))),_&&l.createElement(t.Toast,{label:_,onClose:()=>h(null),error:!0})))},PTRServiceDoc:e=>{var n;let{t:i,config:o,onSelect:a}=e;Digit.ULBService.getCurrentTenantId();const r=Digit.ULBService.getStateId();sessionStorage.removeItem("docReqScreenByBack");const{isLoading:u,data:c={}}=Digit.Hooks.ptr.usePetMDMS(r,"PetService","Documents");let s=null==c||null===(n=c.PetService)||void 0===n?void 0:n.Documents;return l.createElement(l.Fragment,null,l.createElement(t.Card,null,l.createElement(t.CardHeader,null,i(o.isMutation?"PT_REQIURED_DOC_TRANSFER_OWNERSHIP":"PTR_DOC_REQ_SCREEN_HEADER")),l.createElement("div",null,l.createElement(t.CardText,{className:"primaryColor"},i("PTR_DOC_REQ_SCREEN_SUB_HEADER")),l.createElement(t.CardText,{className:"primaryColor"},i("PTR_DOC_REQ_SCREEN_TEXT")),l.createElement(t.CardText,{className:"primaryColor"},i("PTR_DOC_REQ_SCREEN_SUB_TEXT")),l.createElement(t.CardSubHeader,null,i("PTR_DOC_REQ_SCREEN_LABEL")),l.createElement(t.CardText,{className:"primaryColor"},i("PTR_DOC_REQ_SCREEN_LABEL_TEXT")),l.createElement(t.CardText,{style:{color:"red"}},i("PTR_PDF_AND_JPG_BOTH_FORMAT_ACCEPTED_IN_DOCUMENT_UPLOAD")),l.createElement("div",null,u&&l.createElement(t.Loader,null),Array.isArray(s)?s.map(null!=o&&o.isMutation?(e,n)=>{let{code:o,dropdownData:a}=e;return l.createElement("div",{key:n},l.createElement(t.CardSubHeader,null,n+1,". ",i(o)),l.createElement(t.CardText,{className:"primaryColor"},a.map(e=>i(null==e?void 0:e.code)).join(", ")))}:(e,n)=>{let{code:o,dropdownData:a}=e;return l.createElement("div",{key:n},l.createElement(t.CardSubHeader,null,n+1,". ",i(g(o,".","_"))),a.map((e,n)=>l.createElement(t.CardText,{className:"primaryColor"},""+(n+1),". ",i(g(null==e?void 0:e.code,".","_")))))}):null)),l.createElement("span",null,l.createElement(t.SubmitBar,{label:i("PTR_COMMON_NEXT"),onSubmit:a}))))},PTRWFApplicationTimeline:C},zi=e=>{let{stateCode:t,userType:i,tenants:a}=e;const{path:r,url:u}=o.useRouteMatch(),c=Digit.StoreData.getCurrentLanguage();return Digit.Services.useStore({stateCode:t,moduleCode:"PTR",language:c}),Object.entries(Wi).forEach(e=>{let[t,n]=e;Digit.ComponentRegistryService.setComponent(t,n)}),Digit.SessionStorage.set("PTR_TENANTS",a),n.useEffect(()=>"employee"===i&&Digit.LocalizationService.getLocale({modules:["rainmaker-"+Digit.ULBService.getCurrentTenantId()],locale:Digit.StoreData.getCurrentLanguage(),tenantId:Digit.ULBService.getCurrentTenantId()}),[]),"employee"===i?l.createElement(qe,{path:r,url:u,userType:i}):l.createElement(P,null)},Vi=e=>{const{t:o}=i.useTranslation(),[a,r,u]=Digit.Hooks.useSessionStorage("PTR_PET",{});return n.useEffect(()=>{u()},[]),l.createElement(t.CitizenHomeCard,{header:o("ACTION_TEST_PTR"),links:[],Icon:()=>l.createElement(t.PTIcon,{className:"fill-path-primary-main"})})};exports.PTRComponents={PTRCard:()=>{const{t:e}=i.useTranslation(),[o,a]=n.useState("-"),{data:r,isLoading:u,isFetching:c,isSuccess:s}=Digit.Hooks.useNewInboxGeneral({tenantId:Digit.ULBService.getCurrentTenantId(),ModuleCode:"PTR",filters:{limit:10,offset:0,services:["ptr"]},config:{select:e=>({totalCount:null==e?void 0:e.totalCount,nearingSlaCount:null==e?void 0:e.nearingSlaCount}||"-"),enabled:Digit.Utils.ptrAccess()}});if(n.useEffect(()=>{!c&&s&&a(r)},[c]),!Digit.Utils.ptrAccess())return null;const d=[{count:u?"-":null==o?void 0:o.totalCount,label:e("ES_COMMON_INBOX"),link:"/upyog-ui/employee/ptr/petservice/inbox"},{label:e("PTR_TITLE_NEW_PET_REGISTRATION"),link:"/upyog-ui/employee/ptr/petservice/new-application",role:"PTR_CEMP"},{label:e("ES_COMMON_APPLICATION_SEARCH"),link:"/upyog-ui/employee/ptr/petservice/my-applications"}],p=Digit.UserService.hasAccess(["PTR_APPROVER","PTR_CEMP","PTR_VERIFIER"])||!1,v={Icon:l.createElement(t.PropertyHouse,null),moduleName:e("PTR_TITLE_PET_REGISTRATION"),kpis:[{count:null==o?void 0:o.totalCount,label:e("ES_TITLE_INBOX"),link:"/upyog-ui/employee/ptr/petservice/inbox"}],links:d.filter(e=>!(null!=e&&e.role)||p)};return l.createElement(t.EmployeeModuleCard,v)},PTRModule:zi,PTRLinks:Vi,PTR_INBOX_FILTER:e=>l.createElement(Je,e),PTRInboxTableConfig:e=>({PTR:{inboxColumns:t=>[{Header:e("PTR_APPLICATION_NUMBER"),Cell:e=>{var n,i,a,r;let{row:u}=e;return l.createElement("div",null,l.createElement("span",{className:"link"},l.createElement(o.Link,{to:t.parentRoute+"/petservice/application-details/"+(null==u||null===(n=u.original)||void 0===n||null===(i=n.searchData)||void 0===i?void 0:i.applicationNumber)},null===(a=u.original)||void 0===a||null===(r=a.searchData)||void 0===r?void 0:r.applicationNumber)))},mobileCell:e=>{var t;return et(null==e||null===(t=e.searchData)||void 0===t?void 0:t.applicationNumber)}},{Header:e("PTR_APPLICANT_NAME"),Cell:e=>{var t,n,l,i;return Qe(""+(null==e||null===(t=e.cell)||void 0===t||null===(n=t.row)||void 0===n||null===(l=n.original)||void 0===l||null===(i=l.searchData)||void 0===i?void 0:i.applicantName))},mobileCell:e=>{var t;return et(null==e||null===(t=e.searchData)||void 0===t?void 0:t.applicantName)}},{Header:e("PTR_PET_TYPE"),Cell:e=>{var t,n,l;let{row:i}=e;return Qe(""+(null===(t=i.original)||void 0===t||null===(n=t.searchData)||void 0===n||null===(l=n.petDetails)||void 0===l?void 0:l.petType))},mobileCell:e=>{var t,n;return et(null==e||null===(t=e.searchData)||void 0===t||null===(n=t.petDetails)||void 0===n?void 0:n.petType)}},{Header:e("PTR_BREED_TYPE"),Cell:e=>{var t,n,l;let{row:i}=e;return Qe(""+(null===(t=i.original)||void 0===t||null===(n=t.searchData)||void 0===n||null===(l=n.petDetails)||void 0===l?void 0:l.breedType))},mobileCell:e=>{var t,n;return et(null==e||null===(t=e.searchData)||void 0===t||null===(n=t.petDetails)||void 0===n?void 0:n.breedType)}},{Header:e("PTR_STATUS"),Cell:t=>{var n,l,i;let{row:o}=t;return Qe(e(""+(null==o||null===(n=o.original)||void 0===n||null===(l=n.workflowData)||void 0===l||null===(i=l.state)||void 0===i?void 0:i.applicationStatus)))},mobileCell:t=>{var n,l;return et(e("ES_PTR_COMMON_STATUS_"+(null==t||null===(n=t.workflowData)||void 0===n||null===(l=n.state)||void 0===l?void 0:l.applicationStatus)))}}],serviceRequestIdKey:t=>{var n,l;return null==t||null===(n=t[e("PTR_INBOX_UNIQUE_APPLICATION_NUMBER")])||void 0===n||null===(l=n.props)||void 0===l?void 0:l.children}}})},exports.PTRLinks=Vi,exports.PTRModule=zi;