@mseva/digit-ui-module-ptr 1.0.27 → 1.0.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var e,t=require("@mseva/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 s(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}var c="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function d(e,t){return e(t={exports:{}},t.exports),t.exports}var p=d(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]",s="[object Error]",d="[object Function]",p="[object GeneratorFunction]",f="[object Map]",v="[object Number]",m="[object Object]",h="[object RegExp]",g="[object Set]",E="[object String]",_="[object Symbol]",y="[object WeakMap]",S="[object ArrayBuffer]",b="[object DataView]",T="[object Float32Array]",C="[object Float64Array]",A="[object Int8Array]",D="[object Int16Array]",x="[object Int32Array]",P="[object Uint8Array]",N="[object Uint16Array]",w="[object Uint32Array]",R=/\b__p \+= '';/g,I=/\b(__p \+=) '' \+/g,O=/(__e\(.*?\)|\b__t\)) \+\n'';/g,L=/&(?:amp|lt|gt|quot|#39);/g,k=/[&<>"']/g,M=RegExp(L.source),F=RegExp(k.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,q=RegExp(V.source),G=/^\s+/,K=/\s/,Y=/\{(?:\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,re=/^\[object .+?Constructor\]$/,ie=/^0o[0-7]+$/i,oe=/^(?:0|[1-9]\d*)$/,ae=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ue=/($^)/,se=/['\n\r\u2028\u2029\\]/g,ce="\\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+"]",fe="["+ce+"]",ve="\\d+",me="[a-z\\xdf-\\xf6\\xf8-\\xff]",he="[^\\ud800-\\udfff"+de+ve+"\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",ge="\\ud83c[\\udffb-\\udfff]",Ee="[^\\ud800-\\udfff]",_e="(?:\\ud83c[\\udde6-\\uddff]){2}",ye="[\\ud800-\\udbff][\\udc00-\\udfff]",Se="[A-Z\\xc0-\\xd6\\xd8-\\xde]",be="(?:"+me+"|"+he+")",Te="(?:"+Se+"|"+he+")",Ce="(?:"+fe+"|"+ge+")?",Ae="[\\ufe0e\\ufe0f]?"+Ce+"(?:\\u200d(?:"+[Ee,_e,ye].join("|")+")[\\ufe0e\\ufe0f]?"+Ce+")*",De="(?:"+["[\\u2700-\\u27bf]",_e,ye].join("|")+")"+Ae,xe="(?:"+[Ee+fe+"?",fe,_e,ye,"[\\ud800-\\udfff]"].join("|")+")",Pe=RegExp("['’]","g"),Ne=RegExp(fe,"g"),we=RegExp(ge+"(?="+ge+")|"+xe+Ae,"g"),Re=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_])",ve,De].join("|"),"g"),Ie=RegExp("[\\u200d\\ud800-\\udfff"+ce+"\\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"],ke=-1,Me={};Me[T]=Me[C]=Me[A]=Me[D]=Me[x]=Me[P]=Me["[object Uint8ClampedArray]"]=Me[N]=Me[w]=!0,Me[i]=Me[o]=Me[S]=Me[a]=Me[b]=Me[u]=Me[s]=Me[d]=Me[f]=Me[v]=Me[m]=Me[h]=Me[g]=Me[E]=Me[y]=!1;var Fe={};Fe[i]=Fe[o]=Fe[S]=Fe[b]=Fe[a]=Fe[u]=Fe[T]=Fe[C]=Fe[A]=Fe[D]=Fe[x]=Fe[f]=Fe[v]=Fe[m]=Fe[h]=Fe[g]=Fe[E]=Fe[_]=Fe[P]=Fe["[object Uint8ClampedArray]"]=Fe[N]=Fe[w]=!0,Fe[s]=Fe[d]=Fe[y]=!1;var Be={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Ue=parseFloat,je=parseInt,He="object"==typeof c&&c&&c.Object===Object&&c,We="object"==typeof self&&self&&self.Object===Object&&self,ze=He||We||Function("return this")(),Ve=t&&!t.nodeType&&t,qe=Ve&&e&&!e.nodeType&&e,Ge=qe&&qe.exports===Ve,Ke=Ge&&He.process,Ye=function(){try{return qe&&qe.require&&qe.require("util").types||Ke&&Ke.binding&&Ke.binding("util")}catch(e){}}(),$e=Ye&&Ye.isArrayBuffer,Xe=Ye&&Ye.isDate,Ze=Ye&&Ye.isMap,Je=Ye&&Ye.isRegExp,Qe=Ye&&Ye.isSet,et=Ye&&Ye.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)&>(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 st(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 ct(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 ft(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 vt=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 gt(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,_t,n)}function Et(e,t,n,l){for(var r=n-1,i=e.length;++r<i;)if(l(e[r],t))return r;return-1}function _t(e){return e!=e}function yt(e,t){var n=null==e?0:e.length;return n?Ct(e,t)/n:NaN}function St(e){return function(t){return null==t?void 0:t[e]}}function bt(e){return function(t){return null==e?void 0:e[t]}}function Tt(e,t,n,l,r){return r(e,function(e,r,i){n=l?(l=!1,e):t(n,e,r,i)}),n}function Ct(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 At(e,t){for(var n=-1,l=Array(e);++n<e;)l[n]=t(n);return l}function Dt(e){return e?e.slice(0,Vt(e)+1).replace(G,""):e}function xt(e){return function(t){return e(t)}}function Pt(e,t){return st(t,function(t){return e[t]})}function Nt(e,t){return e.has(t)}function wt(e,t){for(var n=-1,l=e.length;++n<l&>(t,e[n],0)>-1;);return n}function Rt(e,t){for(var n=e.length;n--&>(t,e[n],0)>-1;);return n}function It(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({"&":"&","<":"<",">":">",'"':""","'":"'"});function kt(e){return"\\"+Be[e]}function Mt(e){return Ie.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 Mt(e)?function(e){for(var t=we.lastIndex=0;we.test(e);)++t;return t}(e):vt(e)}function zt(e){return Mt(e)?function(e){return e.match(we)||[]}(e):function(e){return e.split("")}(e)}function Vt(e){for(var t=e.length;t--&&K.test(e.charAt(t)););return t}var qt=bt({"&":"&","<":"<",">":">",""":'"',"'":"'"}),Gt=function e(t){var c,K=(t=null==t?ze:Gt.defaults(ze.Object(),t,Gt.pick(ze,Le))).Array,ce=t.Date,de=t.Error,pe=t.Function,fe=t.Math,ve=t.Object,me=t.RegExp,he=t.String,ge=t.TypeError,Ee=K.prototype,_e=ve.prototype,ye=t["__core-js_shared__"],Se=pe.prototype.toString,be=_e.hasOwnProperty,Te=0,Ce=(c=/[^.]+$/.exec(ye&&ye.keys&&ye.keys.IE_PROTO||""))?"Symbol(src)_1."+c:"",Ae=_e.toString,De=Se.call(ve),xe=ze._,we=me("^"+Se.call(be).replace(V,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ie=Ge?t.Buffer:void 0,Be=t.Symbol,He=t.Uint8Array,We=Ie?Ie.allocUnsafe:void 0,Ve=Bt(ve.getPrototypeOf,ve),qe=ve.create,Ke=_e.propertyIsEnumerable,Ye=Ee.splice,vt=Be?Be.isConcatSpreadable:void 0,bt=Be?Be.iterator:void 0,Kt=Be?Be.toStringTag:void 0,Yt=function(){try{var e=Jr(ve,"defineProperty");return e({},"",{}),e}catch(e){}}(),$t=t.clearTimeout!==ze.clearTimeout&&t.clearTimeout,Xt=ce&&ce.now!==ze.Date.now&&ce.now,Zt=t.setTimeout!==ze.setTimeout&&t.setTimeout,Jt=fe.ceil,Qt=fe.floor,en=ve.getOwnPropertySymbols,tn=Ie?Ie.isBuffer:void 0,nn=t.isFinite,ln=Ee.join,rn=Bt(ve.keys,ve),on=fe.max,an=fe.min,un=ce.now,sn=t.parseInt,cn=fe.random,dn=Ee.reverse,pn=Jr(t,"DataView"),fn=Jr(t,"Map"),vn=Jr(t,"Promise"),mn=Jr(t,"Set"),hn=Jr(t,"WeakMap"),gn=Jr(ve,"create"),En=hn&&new hn,_n={},yn=xi(pn),Sn=xi(fn),bn=xi(vn),Tn=xi(mn),Cn=xi(hn),An=Be?Be.prototype:void 0,Dn=An?An.valueOf:void 0,xn=An?An.toString:void 0;function Pn(e){if(qo(e)&&!Lo(e)&&!(e instanceof In)){if(e instanceof Rn)return e;if(be.call(e,"__wrapped__"))return Pi(e)}return new Rn(e)}var Nn=function(){function e(){}return function(t){if(!Vo(t))return{};if(qe)return qe(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function wn(){}function Rn(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=void 0}function In(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 kn(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 kn;++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?At(e.length,he):[],u=a.length;for(var s in e)!t&&!be.call(e,s)||o&&("length"==s||r&&("offset"==s||"parent"==s)||i&&("buffer"==s||"byteLength"==s||"byteOffset"==s)||ii(s,u))||a.push(s);return a}function Un(e){var t=e.length;return t?e[kl(0,t-1)]:void 0}function jn(e,t){return bi(hr(e),$n(t,0,e.length))}function Hn(e){return bi(hr(e))}function Wn(e,t,n){(void 0!==n&&!wo(e[t],n)||void 0===n&&!(t in e))&&Kn(e,t,n)}function zn(e,t,n){var l=e[t];be.call(e,t)&&wo(l,n)&&(void 0!==n||t in e)||Kn(e,t,n)}function Vn(e,t){for(var n=e.length;n--;)if(wo(e[n][0],t))return n;return-1}function qn(e,t,n,l){return el(e,function(e,r,i){t(l,e,n(e),i)}),l}function Gn(e,t){return e&&gr(t,Sa(t),e)}function Kn(e,t,n){"__proto__"==t&&Yt?Yt(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function Yn(e,t){for(var n=-1,l=t.length,r=K(l),i=null==e;++n<l;)r[n]=i?void 0:ha(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 Xn(e,t,n,l,r,o){var s,c=1&t,y=2&t,R=4&t;if(n&&(s=r?n(e,l,r,o):n(e)),void 0!==s)return s;if(!Vo(e))return e;var I=Lo(e);if(I){if(s=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),!c)return hr(e,s)}else{var O=ti(e),L=O==d||O==p;if(Bo(e))return cr(e,c);if(O==m||O==i||L&&!r){if(s=y||L?{}:li(e),!c)return y?function(e,t){return gr(e,ei(e),t)}(e,function(e,t){return e&&gr(t,ba(t),e)}(s,e)):function(e,t){return gr(e,Qr(e),t)}(e,Gn(s,e))}else{if(!Fe[O])return r?e:{};s=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 C:case A:case D:case x:case P:case"[object Uint8ClampedArray]":case N:case w:return pr(e,n);case f:return new l;case v:case E: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 g:return new l;case _:return Dn?ve(Dn.call(e)):{}}}(e,O,c)}}o||(o=new Fn);var k=o.get(e);if(k)return k;o.set(e,s),Xo(e)?e.forEach(function(l){s.add(Xn(l,t,n,l,e,o))}):Go(e)&&e.forEach(function(l,r){s.set(r,Xn(l,t,n,r,e,o))});var M=I?void 0:(R?y?qr:Vr:y?ba:Sa)(e);return lt(M||e,function(l,r){M&&(l=e[r=l]),zn(s,r,Xn(l,t,n,r,e,o))}),s}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 Jn(e,t,l){if("function"!=typeof e)throw new ge(n);return Ei(function(){e.apply(void 0,l)},t)}function Qn(e,t,n,l){var r=-1,i=at,o=!0,a=e.length,u=[],s=t.length;if(!a)return u;n&&(t=st(t,xt(n))),l?(i=ut,o=!1):t.length>=200&&(i=Nt,o=!1,t=new Mn(t));e:for(;++r<a;){var c=e[r],d=null==n?c:n(c);if(c=l||0!==c?c:0,o&&d==d){for(var p=s;p--;)if(t[p]===d)continue e;u.push(c)}else i(t,d,l)||u.push(c)}return u}Pn.templateSettings={escape:B,evaluate:U,interpolate:j,variable:"",imports:{_:Pn}},(Pn.prototype=wn.prototype).constructor=Pn,(Rn.prototype=Nn(wn.prototype)).constructor=Rn,(In.prototype=Nn(wn.prototype)).constructor=In,On.prototype.clear=function(){this.__data__=gn?gn(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(gn){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 gn?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]=gn&&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():Ye.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},kn.prototype.clear=function(){this.size=0,this.__data__={hash:new On,map:new(fn||Ln),string:new On}},kn.prototype.delete=function(e){var t=Xr(this,e).delete(e);return this.size-=t?1:0,t},kn.prototype.get=function(e){return Xr(this,e).get(e)},kn.prototype.has=function(e){return Xr(this,e).has(e)},kn.prototype.set=function(e,t){var n=Xr(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)},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(!fn||l.length<199)return l.push([e,t]),this.size=++n.size,this;n=this.__data__=new kn(l)}return n.set(e,t),this.size=n.size,this};var el=yr(ul),tl=yr(sl,!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):ct(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 sl(e,t){return e&&al(e,t,Sa)}function cl(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:ct(l,n(e))}function fl(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Kt&&Kt in ve(e)?function(e){var t=be.call(e,Kt),n=e[Kt];try{e[Kt]=void 0;var l=!0}catch(e){}var r=Ae.call(e);return l&&(t?e[Kt]=n:delete e[Kt]),r}(e):function(e){return Ae.call(e)}(e)}function vl(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 ve(e)}function gl(e,t,n){for(var l=n?ut:at,r=e[0].length,i=e.length,o=i,a=K(i),u=Infinity,s=[];o--;){var c=e[o];o&&t&&(c=st(c,xt(t))),u=an(c.length,u),a[o]=!n&&(t||r>=120&&c.length>=120)?new Mn(o&&c):void 0}c=e[0];var d=-1,p=a[0];e:for(;++d<r&&s.length<u;){var f=c[d],v=t?t(f):f;if(f=n||0!==f?f:0,!(p?Nt(p,v):l(s,v,n))){for(o=i;--o;){var m=a[o];if(!(m?Nt(m,v):l(e[o],v,n)))continue e}p&&p.push(v),s.push(f)}}return s}function El(e,t,n){var l=null==(e=vi(e,t=or(t,e)))?e:e[Di(Ui(t))];return null==l?void 0:tt(l,e,n)}function _l(e){return qo(e)&&fl(e)==i}function yl(e,t,n,l,r){return e===t||(null==e||null==t||!qo(e)&&!qo(t)?e!=e&&t!=t:function(e,t,n,l,r,c){var d=Lo(e),p=Lo(t),y=d?o:ti(e),T=p?o:ti(t),C=(y=y==i?m:y)==m,A=(T=T==i?m:T)==m,D=y==T;if(D&&Bo(e)){if(!Bo(t))return!1;d=!0,C=!1}if(D&&!C)return c||(c=new Fn),d||Qo(e)?Wr(e,t,n,l,r,c):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 v:return wo(+e,+t);case s:return e.name==t.name&&e.message==t.message;case h:case E:return e==t+"";case f:var c=Ft;case g:if(c||(c=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(c(e),c(t),l,r,i,o);return o.delete(e),p;case _:if(Dn)return Dn.call(e)==Dn.call(t)}return!1}(e,t,y,n,l,r,c);if(!(1&n)){var x=C&&be.call(e,"__wrapped__"),P=A&&be.call(t,"__wrapped__");if(x||P){var N=x?e.value():e,w=P?t.value():t;return c||(c=new Fn),r(N,w,n,l,c)}}return!!D&&(c||(c=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 s=u;s--;){var c=a[s];if(!(o?c in t:be.call(t,c)))return!1}var d=i.get(e),p=i.get(t);if(d&&p)return d==t&&p==e;var f=!0;i.set(e,t),i.set(t,e);for(var v=o;++s<u;){var m=e[c=a[s]],h=t[c];if(l)var g=o?l(h,m,c,t,e,i):l(m,h,c,e,t,i);if(!(void 0===g?m===h||r(m,h,n,l,i):g)){f=!1;break}v||(v="constructor"==c)}if(f&&!v){var E=e.constructor,_=t.constructor;E==_||!("constructor"in e)||!("constructor"in t)||"function"==typeof E&&E instanceof E&&"function"==typeof _&&_ instanceof _||(f=!1)}return i.delete(e),i.delete(t),f}(e,t,n,l,r,c))}(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=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],s=e[u],c=a[1];if(o&&a[2]){if(void 0===s&&!(u in e))return!1}else{var d=new Fn;if(l)var p=l(s,c,u,e,t,d);if(!(void 0===p?yl(c,s,3,l,d):p))return!1}}return!0}function bl(e){return!(!Vo(e)||(t=e,Ce&&Ce in t))&&(Ho(e)?we:re).test(xi(e));var t}function Tl(e){return"function"==typeof e?e:null==e?Ka:"object"==typeof e?Lo(e)?Pl(e[0],e[1]):xl(e):nu(e)}function Cl(e){if(!ci(e))return rn(e);var t=[];for(var n in ve(e))be.call(e,n)&&"constructor"!=n&&t.push(n);return t}function Al(e,t){return e<t}function Dl(e,t){var n=-1,l=Mo(e)?K(e.length):[];return el(e,function(e,r,i){l[++n]=t(e,r,i)}),l}function xl(e){var t=Zr(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?ga(n,e):yl(t,l,3)}}function Nl(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),s=o.get(u);if(s)Wn(e,n,s);else{var c=i?i(a,u,n+"",e,t,o):void 0,d=void 0===c;if(d){var p=Lo(u),f=!p&&Bo(u),v=!p&&!f&&Qo(u);c=u,p||f||v?Lo(a)?c=a:Fo(a)?c=hr(a):f?(d=!1,c=cr(u,!0)):v?(d=!1,c=pr(u,!0)):c=[]:Yo(u)||Oo(u)?(c=a,Oo(a)?c=aa(a):Vo(a)&&!Ho(a)||(c=li(u))):d=!1}d&&(o.set(u,c),r(c,u,l,i,o),o.delete(u)),Wn(e,n,c)}}(e,t,o,n,Nl,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 wl(e,t){var n=e.length;if(n)return ii(t+=t<0?n:0,n)?e[t]:void 0}function Rl(e,t,n){t=t.length?st(t,function(e){return Lo(e)?function(t){return dl(t,1===e.length?e[0]:e)}:e}):[Ka];var l=-1;return t=st(t,xt($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=fr(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:st(t,function(t){return t(e)}),index:++l,value:e}}))}function Il(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?Et:gt,i=-1,o=t.length,a=e;for(e===t&&(t=hr(t)),n&&(a=st(e,xt(n)));++i<o;)for(var u=0,s=t[i],c=n?n(s):s;(u=r(a,c,u,l))>-1;)a!==e&&Ye.call(a,u,1),Ye.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)?Ye.call(e,r,1):Jl(e,r)}}return e}function kl(e,t){return e+Qt(cn()*(t-e+1))}function Ml(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 _i(fi(e,t,Ka),e+"")}function Bl(e){return Un(wa(e))}function Ul(e,t){var n=wa(e);return bi(n,$n(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]),s=n;if("__proto__"===u||"constructor"===u||"prototype"===u)return e;if(r!=o){var c=a[u];void 0===(s=l?l(c,u,a):void 0)&&(s=Vo(c)?c:ii(t[r+1])?[]:{})}zn(a,u,s),a=a[u]}return e}var Hl=En?function(e,t){return En.set(e,t),e}:Ka,Wl=Yt?function(e,t){return Yt(e,"toString",{configurable:!0,enumerable:!1,value:Va(t),writable:!0})}:Ka;function zl(e){return bi(wa(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=K(r);++l<r;)i[l]=e[l+t];return i}function ql(e,t){var n;return el(e,function(e,l,r){return!(n=t(e,l,r))}),!!n}function Gl(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 Kl(e,t,Ka,n)}function Kl(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),s=void 0===t;r<i;){var c=Qt((r+i)/2),d=n(e[c]),p=void 0!==d,f=null===d,v=d==d,m=Jo(d);if(o)var h=l||v;else h=s?v&&(l||p):a?v&&p&&(l||!f):u?v&&p&&!f&&(l||!m):!f&&!m&&(l?d<=t:d<t);h?r=c+1:i=c}return an(i,4294967294)}function Yl(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||!wo(a,u)){var u=a;i[r++]=0===o?0:o}}return i}function $l(e){return"number"==typeof e?e:Jo(e)?NaN:+e}function Xl(e){if("string"==typeof e)return e;if(Lo(e))return st(e,Xl)+"";if(Jo(e))return xn?xn.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 s=t?null:Mr(e);if(s)return jt(s);o=!1,r=Nt,u=new Mn}else u=t?[]:a;e:for(;++l<i;){var c=e[l],d=t?t(c):c;if(c=n||0!==c?c:0,o&&d==d){for(var p=u.length;p--;)if(u[p]===d)continue e;t&&u.push(d),a.push(c)}else r(u,d,n)||(u!==a&&u.push(d),a.push(c))}return a}function Jl(e,t){return null==(e=vi(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 In&&(n=n.value()),dt(t,function(e,t){return t.func.apply(t.thisArg,ct([e],t.args))},n)}function nr(e,t,n){var l=e.length;if(l<2)return l?Zl(e[0]):[];for(var r=-1,i=K(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 Zl(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:Ka}function or(e,t){return Lo(e)?e:ai(e,t)?[e]:Ai(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 sr=$t||function(e){return ze.clearTimeout(e)};function cr(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 fr(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,s=Jo(t);if(!a&&!s&&!i&&e>t||i&&o&&u&&!a&&!s||l&&o&&u||!n&&u||!r)return 1;if(!l&&!i&&!s&&e<t||s&&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,s=on(i-o,0),c=K(u+s),d=!l;++a<u;)c[a]=t[a];for(;++r<o;)(d||r<i)&&(c[n[r]]=e[r]);for(;s--;)c[a++]=e[r++];return c}function mr(e,t,n,l){for(var r=-1,i=e.length,o=-1,a=n.length,u=-1,s=t.length,c=on(i-a,0),d=K(c+s),p=!l;++r<c;)d[r]=e[r];for(var f=r;++u<s;)d[f+u]=t[u];for(;++o<a;)(p||r<i)&&(d[f+n[o]]=e[r++]);return d}function hr(e,t){var n=-1,l=e.length;for(t||(t=K(l));++n<l;)t[n]=e[n];return t}function gr(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?Kn(n,a,u):zn(n,a,u)}return n}function Er(e,t){return function(n,l){var r=Lo(n)?nt:qn,i=t?t():{};return r(n,e,$r(l,2),i)}}function _r(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=ve(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(!Mo(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 Sr(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 br(e){return function(t){var n=Mt(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 Cr(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=Nn(e.prototype),l=e.apply(n,t);return Vo(l)?l:n}}function Ar(e){return function(t,n,l){var r=ve(t);if(!Mo(t)){var i=$r(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=Rn.prototype.thru;for(e&&t.reverse();r--;){var o=t[r];if("function"!=typeof o)throw new ge(n);if(i&&!a&&"wrapper"==Kr(o))var a=new Rn([],!0)}for(r=a?r:l;++r<l;){var u=Kr(o=t[r]),s="wrapper"==u?Gr(o):void 0;a=s&&ui(s[0])&&424==s[1]&&!s[4].length&&1==s[9]?a[Kr(s[0])].apply(a,s[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 xr(e,t,n,l,r,i,o,a,u,s){var c=128&t,d=1&t,p=2&t,f=24&t,v=512&t,m=p?void 0:Cr(e);return function h(){for(var g=arguments.length,E=K(g),_=g;_--;)E[_]=arguments[_];if(f)var y=Yr(h),S=It(E,y);if(l&&(E=vr(E,l,r,f)),i&&(E=mr(E,i,o,f)),g-=S,f&&g<s){var b=Ut(E,y);return Lr(e,t,xr,h.placeholder,n,E,b,a,u,s-g)}var T=d?n:this,C=p?T[e]:e;return g=E.length,a?E=mi(E,a):v&&g>1&&E.reverse(),c&&u<g&&(E.length=u),this&&this!==ze&&this instanceof h&&(C=m||Cr(C)),C.apply(T,E)}}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 Nr(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=Xl(n),l=Xl(l)):(n=$l(n),l=$l(l)),r=e(n,l)}return r}}function wr(e){return zr(function(t){return t=st(t,xt($r())),Fl(function(n){var l=this;return e(t,function(e){return tt(e,l,n)})})})}function Rr(e,t){var n=(t=void 0===t?" ":Xl(t)).length;if(n<2)return n?Ml(t,e):t;var l=Ml(t,Jt(e/Wt(t)));return Mt(t)?ur(zt(l),0,e).join(""):l.slice(0,e)}function Ir(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=K(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,s){var c=8&t;t|=c?32:64,4&(t&=~(c?64:32))||(t&=-4);var d=[e,t,r,c?i:void 0,c?o:void 0,c?void 0:i,c?void 0:o,a,u,s],p=n.apply(void 0,d);return ui(e)&&gi(p,d),p.placeholder=l,yi(p,e,t)}function kr(e){var t=fe[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 Mr=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==f?Ft(t):n==g?Ht(t):function(e,t){return st(t,function(t){return[t,e[t]]})}(t,e(t))}}function Br(e,t,r,i,o,a,u,s){var c=2&t;if(!c&&"function"!=typeof e)throw new ge(n);var d=i?i.length:0;if(d||(t&=-97,i=o=void 0),u=void 0===u?u:on(ra(u),0),s=void 0===s?s:ra(s),d-=o?o.length:0,64&t){var p=i,f=o;i=o=void 0}var v=c?void 0:Gr(e),m=[e,t,r,i,o,p,f,a,u,s];if(v&&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])?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,v),e=m[0],t=m[1],r=m[2],i=m[3],o=m[4],!(s=m[9]=void 0===m[9]?c?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=Cr(e);return function r(){for(var i=arguments.length,o=K(i),a=i,u=Yr(r);a--;)o[a]=arguments[a];var s=i<3&&o[0]!==u&&o[i-1]!==u?[]:Ut(o,u);if((i-=s.length)<n)return Lr(e,t,xr,r.placeholder,void 0,o,s,void 0,void 0,n-i);var c=this&&this!==ze&&this instanceof r?l:e;return tt(c,this,o)}}(e,t,s):32!=t&&33!=t||o.length?xr.apply(void 0,m):function(e,t,n,l){var r=1&t,i=Cr(e);return function t(){for(var o=-1,a=arguments.length,u=-1,s=l.length,c=K(s+a),d=this&&this!==ze&&this instanceof t?i:e;++u<s;)c[u]=l[u];for(;a--;)c[u++]=arguments[++o];return tt(d,r?n:this,c)}}(e,t,r,i);else var h=function(e,t,n){var l=1&t,r=Cr(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((v?Hl:gi)(h,m),e,t)}function Ur(e,t,n,l){return void 0===e||wo(e,_e[n])&&!be.call(l,n)?t:e}function jr(e,t,n,l,r,i){return Vo(e)&&Vo(t)&&(i.set(t,e),Nl(e,t,void 0,jr,i),i.delete(t)),e}function Hr(e){return Yo(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 s=i.get(e),c=i.get(t);if(s&&c)return s==t&&c==e;var d=-1,p=!0,f=2&n?new Mn:void 0;for(i.set(e,t),i.set(t,e);++d<a;){var v=e[d],m=t[d];if(l)var h=o?l(m,v,d,t,e,i):l(v,m,d,e,t,i);if(void 0!==h){if(h)continue;p=!1;break}if(f){if(!ft(t,function(e,t){if(!Nt(f,t)&&(v===e||r(v,e,n,l,i)))return f.push(t)})){p=!1;break}}else if(v!==m&&!r(v,m,n,l,i)){p=!1;break}}return i.delete(e),i.delete(t),p}function zr(e){return _i(fi(e,void 0,Li),e+"")}function Vr(e){return pl(e,Sa,Qr)}function qr(e){return pl(e,ba,ei)}var Gr=En?function(e){return En.get(e)}:Ja;function Kr(e){for(var t=e.name+"",n=_n[t],l=be.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 Yr(e){return(be.call(Pn,"placeholder")?Pn:e).placeholder}function $r(){var e=Pn.iteratee||Ya;return e=e===Ya?Tl:e,arguments.length?e(arguments[0],arguments[1]):e}function Xr(e,t){var n=e.__data__;return function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}(t)?n["string"==typeof t?"string":"hash"]:n.map}function Zr(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=ve(e),ot(en(e),function(t){return Ke.call(e,t)}))}:iu,ei=en?function(e){for(var t=[];e;)ct(t,Qr(e)),e=Ve(e);return t}:iu,ti=fl;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||ci(e)?{}:Nn(Ve(e))}function ri(e){return Lo(e)||Oo(e)||!!(vt&&e&&e[vt])}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?Mo(n)&&ii(t,n.length):"string"==l&&t in n)&&wo(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 ve(t)}function ui(e){var t=Kr(e),n=Pn[t];if("function"!=typeof n||!(t in In.prototype))return!1;if(e===n)return!0;var l=Gr(n);return!!l&&e===l[0]}(pn&&ti(new pn(new ArrayBuffer(1)))!=b||fn&&ti(new fn)!=f||vn&&"[object Promise]"!=ti(vn.resolve())||mn&&ti(new mn)!=g||hn&&ti(new hn)!=y)&&(ti=function(e){var t=fl(e),n=t==m?e.constructor:void 0,l=n?xi(n):"";if(l)switch(l){case yn:return b;case Sn:return f;case bn:return"[object Promise]";case Tn:return g;case Cn:return y}return t});var si=ye?Ho:ou;function ci(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||_e)}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 ve(n))}}function fi(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=K(i);++r<i;)o[r]=l[t+r];r=-1;for(var a=K(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: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 gi=Si(Hl),Ei=Zt||function(e,t){return ze.setTimeout(e,t)},_i=Si(Wl);function yi(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(Y,"{\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($);return t?t[1].split(X):[]}(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=kl(n,r),o=e[i];e[i]=e[n],e[n]=o}return e.length=t,e}var Ti,Ci,Ai=(Ti=Co(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===Ci.size&&Ci.clear(),e}),Ci=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 xi(e){if(null!=e){try{return Se.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function Pi(e){if(e instanceof In)return e.clone();var t=new Rn(e.__wrapped__,e.__chain__);return t.__actions__=hr(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var Ni=Fl(function(e,t){return Fo(e)?Qn(e,il(t,1,Fo,!0)):[]}),wi=Fl(function(e,t){var n=Ui(t);return Fo(n)&&(n=void 0),Fo(e)?Qn(e,il(t,1,Fo,!0),$r(n,2)):[]}),Ri=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 Ii(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,$r(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,$r(t,3),r,!0)}function Li(e){return null!=e&&e.length?il(e,1):[]}function ki(e){return e&&e.length?e[0]:void 0}var Mi=Fl(function(e){var t=st(e,rr);return t.length&&t[0]===e[0]?gl(t):[]}),Fi=Fl(function(e){var t=Ui(e),n=st(e,rr);return t===Ui(n)?t=void 0:n.pop(),n.length&&n[0]===e[0]?gl(n,$r(t,2)):[]}),Bi=Fl(function(e){var t=Ui(e),n=st(e,rr);return(t="function"==typeof t?t:void 0)&&n.pop(),n.length&&n[0]===e[0]?gl(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=Yn(e,t);return Ll(e,st(t,function(e){return ii(e,n)?+e:e}).sort(fr)),l});function zi(e){return null==e?e:dn.call(e)}var Vi=Fl(function(e){return Zl(il(e,1,Fo,!0))}),qi=Fl(function(e){var t=Ui(e);return Fo(t)&&(t=void 0),Zl(il(e,1,Fo,!0),$r(t,2))}),Gi=Fl(function(e){var t=Ui(e);return t="function"==typeof t?t:void 0,Zl(il(e,1,Fo,!0),void 0,t)});function Ki(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}),At(t,function(t){return st(e,St(t))})}function Yi(e,t){if(!e||!e.length)return[];var n=Ki(e);return null==t?n:st(n,function(e){return tt(t,void 0,e)})}var $i=Fl(function(e,t){return Fo(e)?Qn(e,t):[]}),Xi=Fl(function(e){return nr(ot(e,Fo))}),Zi=Fl(function(e){var t=Ui(e);return Fo(t)&&(t=void 0),nr(ot(e,Fo),$r(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(Ki),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,Yi(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 Yn(t,e)};return!(t>1||this.__actions__.length)&&l instanceof In&&ii(n)?((l=l.slice(n,+n+(t?1:0))).__actions__.push({func:no,args:[r],thisArg:void 0}),new Rn(l,this.__chain__).thru(function(e){return t&&!e.length&&e.push(void 0),e})):this.thru(r)}),ro=Er(function(e,t,n){be.call(e,n)?++e[n]:Kn(e,n,1)}),io=Ar(Ii),oo=Ar(Oi);function ao(e,t){return(Lo(e)?lt:el)(e,$r(t,3))}function uo(e,t){return(Lo(e)?rt:tl)(e,$r(t,3))}var so=Er(function(e,t,n){be.call(e,n)?e[n].push(t):Kn(e,n,[t])}),co=Fl(function(e,t,n){var l=-1,r="function"==typeof t,i=Mo(e)?K(e.length):[];return el(e,function(e){i[++l]=r?tt(t,e,n):El(e,t,n)}),i}),po=Er(function(e,t,n){Kn(e,n,t)});function fo(e,t){return(Lo(e)?st:Dl)(e,$r(t,3))}var vo=Er(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]]),Rl(e,il(t,1),[])}),ho=Xt||function(){return ze.Date.now()};function go(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 Eo(e,t){var l;if("function"!=typeof t)throw new ge(n);return e=ra(e),function(){return--e>0&&(l=t.apply(this,arguments)),e<=1&&(t=void 0),l}}var _o=Fl(function(e,t,n){var l=1;if(n.length){var r=Ut(n,Yr(_o));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,Yr(yo));l|=32}return Br(t,l,e,n,r)});function So(e,t,l){var r,i,o,a,u,s,c=0,d=!1,p=!1,f=!0;if("function"!=typeof e)throw new ge(n);function v(t){var n=r,l=i;return r=i=void 0,c=t,a=e.apply(l,n)}function m(e){return c=e,u=Ei(g,t),d?v(e):a}function h(e){var n=e-s;return void 0===s||n>=t||n<0||p&&e-c>=o}function g(){var e=ho();if(h(e))return E(e);u=Ei(g,function(e){var n=t-(e-s);return p?an(n,o-(e-c)):n}(e))}function E(e){return u=void 0,f&&r?v(e):(r=i=void 0,a)}function _(){var e=ho(),n=h(e);if(r=arguments,i=this,s=e,n){if(void 0===u)return m(s);if(p)return sr(u),u=Ei(g,t),v(s)}return void 0===u&&(u=Ei(g,t)),a}return t=oa(t)||0,Vo(l)&&(d=!!l.leading,o=(p="maxWait"in l)?on(oa(l.maxWait)||0,t):o,f="trailing"in l?!!l.trailing:f),_.cancel=function(){void 0!==u&&sr(u),c=0,r=s=i=u=void 0},_.flush=function(){return void 0===u?a:E(ho())},_}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 Co(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new ge(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(Co.Cache||kn),l}function Ao(e){if("function"!=typeof e)throw new ge(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)}}Co.Cache=kn;var Do=ar(function(e,t){var n=(t=1==t.length&&Lo(t[0])?st(t[0],xt($r())):st(il(t,1),xt($r()))).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)})}),xo=Fl(function(e,t){return Br(e,32,void 0,t,Ut(t,Yr(xo)))}),Po=Fl(function(e,t){return Br(e,64,void 0,t,Ut(t,Yr(Po)))}),No=zr(function(e,t){return Br(e,256,void 0,void 0,void 0,t)});function wo(e,t){return e===t||e!=e&&t!=t}var Ro=Or(vl),Io=Or(function(e,t){return e>=t}),Oo=_l(function(){return arguments}())?_l:function(e){return qo(e)&&be.call(e,"callee")&&!Ke.call(e,"callee")},Lo=K.isArray,ko=$e?xt($e):function(e){return qo(e)&&fl(e)==S};function Mo(e){return null!=e&&zo(e.length)&&!Ho(e)}function Fo(e){return qo(e)&&Mo(e)}var Bo=tn||ou,Uo=Xe?xt(Xe):function(e){return qo(e)&&fl(e)==u};function jo(e){if(!qo(e))return!1;var t=fl(e);return t==s||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!Yo(e)}function Ho(e){if(!Vo(e))return!1;var t=fl(e);return t==d||t==p||"[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 qo(e){return null!=e&&"object"==typeof e}var Go=Ze?xt(Ze):function(e){return qo(e)&&ti(e)==f};function Ko(e){return"number"==typeof e||qo(e)&&fl(e)==v}function Yo(e){if(!qo(e)||fl(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 $o=Je?xt(Je):function(e){return qo(e)&&fl(e)==h},Xo=Qe?xt(Qe):function(e){return qo(e)&&ti(e)==g};function Zo(e){return"string"==typeof e||!Lo(e)&&qo(e)&&fl(e)==E}function Jo(e){return"symbol"==typeof e||qo(e)&&fl(e)==_}var Qo=et?xt(et):function(e){return qo(e)&&zo(e.length)&&!!Me[fl(e)]},ea=Or(Al),ta=Or(function(e,t){return e<=t});function na(e){if(!e)return[];if(Mo(e))return Zo(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==f?Ft:t==g?jt:wa)(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?$n(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 gr(e,ba(e))}function ua(e){return null==e?"":Xl(e)}var sa=_r(function(e,t){if(ci(t)||Mo(t))gr(t,Sa(t),e);else for(var n in t)be.call(t,n)&&zn(e,n,t[n])}),ca=_r(function(e,t){gr(t,ba(t),e)}),da=_r(function(e,t,n,l){gr(t,ba(t),e,l)}),pa=_r(function(e,t,n,l){gr(t,Sa(t),e,l)}),fa=zr(Yn),va=Fl(function(e,t){e=ve(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 s=o[a],c=e[s];(void 0===c||wo(c,_e[s])&&!be.call(e,s))&&(e[s]=i[s])}return e}),ma=Fl(function(e){return e.push(void 0,jr),tt(Ca,void 0,e)});function ha(e,t,n){var l=null==e?void 0:dl(e,t);return void 0===l?n:l}function ga(e,t){return null!=e&&ni(e,t,hl)}var Ea=Pr(function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=Ae.call(t)),e[t]=n},Va(Ka)),_a=Pr(function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=Ae.call(t)),be.call(e,t)?e[t].push(n):e[t]=[n]},$r),ya=Fl(El);function Sa(e){return Mo(e)?Bn(e):Cl(e)}function ba(e){return Mo(e)?Bn(e,!0):function(e){if(!Vo(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&&be.call(e,l))&&n.push(l);return n}(e)}var Ta=_r(function(e,t,n){Nl(e,t,n)}),Ca=_r(function(e,t,n,l){Nl(e,t,n,l)}),Aa=zr(function(e,t){var n={};if(null==e)return n;var l=!1;t=st(t,function(t){return t=or(t,e),l||(l=t.length>1),t}),gr(e,qr(e),n),l&&(n=Xn(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 Il(e,t,function(t,n){return ga(e,n)})}(e,t)});function xa(e,t){if(null==e)return{};var n=st(qr(e),function(e){return[e]});return t=$r(t),Il(e,n,function(e,n){return t(e,n[0])})}var Pa=Fr(Sa),Na=Fr(ba);function wa(e){return null==e?[]:Pt(e,Sa(e))}var Ra=Tr(function(e,t,n){return t=t.toLowerCase(),e+(n?Ia(t):t)});function Ia(e){return ja(ua(e).toLowerCase())}function Oa(e){return(e=ua(e))&&e.replace(ae,Ot).replace(Ne,"")}var La=Tr(function(e,t,n){return e+(n?"-":"")+t.toLowerCase()}),ka=Tr(function(e,t,n){return e+(n?" ":"")+t.toLowerCase()}),Ma=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(Re)||[]}(e):function(e){return e.match(Z)||[]}(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),Kn(e,t,_o(e[t],e))}),e});function Va(e){return function(){return e}}var qa=Dr(),Ga=Dr(!0);function Ka(e){return e}function Ya(e){return Tl("function"==typeof e?e:Xn(e,1))}var $a=Fl(function(e,t){return function(n){return El(n,e,t)}}),Xa=Fl(function(e,t){return function(n){return El(e,n,t)}});function Za(e,t,n){var l=Sa(t),r=cl(t,l);null!=n||Vo(t)&&(r.length||!l.length)||(n=t,t=e,e=this,r=cl(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,ct([this.value()],arguments))})}),e}function Ja(){}var Qa=wr(st),eu=wr(it),tu=wr(ft);function nu(e){return ai(e)?St(Di(e)):function(e){return function(t){return dl(t,e)}}(e)}var lu=Ir(),ru=Ir(!0);function iu(){return[]}function ou(){return!1}var au,uu=Nr(function(e,t){return e+t},0),su=kr("ceil"),cu=Nr(function(e,t){return e/t},1),du=kr("floor"),pu=Nr(function(e,t){return e*t},1),fu=kr("round"),vu=Nr(function(e,t){return e-t},0);return Pn.after=function(e,t){if("function"!=typeof t)throw new ge(n);return e=ra(e),function(){if(--e<1)return t.apply(this,arguments)}},Pn.ary=go,Pn.assign=sa,Pn.assignIn=ca,Pn.assignInWith=da,Pn.assignWith=pa,Pn.at=fa,Pn.before=Eo,Pn.bind=_o,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=K(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=K(e-1),n=arguments[0],l=e;l--;)t[l-1]=arguments[l];return ct(Lo(n)?hr(n):[n],il(t,1))},Pn.cond=function(e){var t=null==e?0:e.length,l=$r();return e=t?st(e,function(e){if("function"!=typeof e[1])throw new ge(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 Zn(n,e,t)}}(Xn(e,1))},Pn.constant=Va,Pn.countBy=ro,Pn.create=function(e,t){var n=Nn(e);return null==t?n:Gn(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=va,Pn.defaultsDeep=ma,Pn.defer=bo,Pn.delay=To,Pn.difference=Ni,Pn.differenceBy=wi,Pn.differenceWith=Ri,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,$r(t,3),!0,!0):[]},Pn.dropWhile=function(e,t){return e&&e.length?er(e,$r(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,$r(t,3))},Pn.flatMap=function(e,t){return il(fo(e,t),1)},Pn.flatMapDeep=function(e,t){return il(fo(e,t),1/0)},Pn.flatMapDepth=function(e,t,n){return n=void 0===n?1:ra(n),il(fo(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=qa,Pn.flowRight=Ga,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?[]:cl(e,Sa(e))},Pn.functionsIn=function(e){return null==e?[]:cl(e,ba(e))},Pn.groupBy=so,Pn.initial=function(e){return null!=e&&e.length?Vl(e,0,-1):[]},Pn.intersection=Mi,Pn.intersectionBy=Fi,Pn.intersectionWith=Bi,Pn.invert=Ea,Pn.invertBy=_a,Pn.invokeMap=co,Pn.iteratee=Ya,Pn.keyBy=po,Pn.keys=Sa,Pn.keysIn=ba,Pn.map=fo,Pn.mapKeys=function(e,t){var n={};return t=$r(t,3),ul(e,function(e,l,r){Kn(n,t(e,l,r),e)}),n},Pn.mapValues=function(e,t){var n={};return t=$r(t,3),ul(e,function(e,l,r){Kn(n,l,t(e,l,r))}),n},Pn.matches=function(e){return xl(Xn(e,1))},Pn.matchesProperty=function(e,t){return Pl(e,Xn(t,1))},Pn.memoize=Co,Pn.merge=Ta,Pn.mergeWith=Ca,Pn.method=$a,Pn.methodOf=Xa,Pn.mixin=Za,Pn.negate=Ao,Pn.nthArg=function(e){return e=ra(e),Fl(function(t){return wl(t,e)})},Pn.omit=Aa,Pn.omitBy=function(e,t){return xa(e,Ao($r(t)))},Pn.once=function(e){return Eo(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]),Rl(e,t,n))},Pn.over=Qa,Pn.overArgs=Do,Pn.overEvery=eu,Pn.overSome=tu,Pn.partial=xo,Pn.partialRight=Po,Pn.partition=vo,Pn.pick=Da,Pn.pickBy=xa,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,$r(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=No,Pn.reject=function(e,t){return(Lo(e)?ot:rl)(e,Ao($r(t,3)))},Pn.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 Ll(e,r),n},Pn.rest=function(e,t){if("function"!=typeof e)throw new ge(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?Yl(e):[]},Pn.sortedUniqBy=function(e,t){return e&&e.length?Yl(e,$r(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&&!$o(t))&&!(t=Xl(t))&&Mt(e)?ur(zt(e),0,n):e.split(t,n):[]},Pn.spread=function(e,t){if("function"!=typeof e)throw new ge(n);return t=null==t?0:on(ra(t),0),Fl(function(n){var l=n[t],r=ur(n,0,t);return l&&ct(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,$r(t,3),!1,!0):[]},Pn.takeWhile=function(e,t){return e&&e.length?er(e,$r(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 ge(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=Na,Pn.toPath=function(e){return Lo(e)?st(e,Di):Jo(e)?[e]:hr(Ai(ua(e)))},Pn.toPlainObject=aa,Pn.transform=function(e,t,n){var l=Lo(e),r=l||Bo(e)||Qo(e);if(t=$r(t,4),null==n){var i=e&&e.constructor;n=r?l?new i:[]:Vo(e)&&Ho(i)?Nn(Ve(e)):{}}return(r?lt:ul)(e,function(e,l,r){return t(n,e,l,r)}),n},Pn.unary=function(e){return go(e,1)},Pn.union=Vi,Pn.unionBy=qi,Pn.unionWith=Gi,Pn.uniq=function(e){return e&&e.length?Zl(e):[]},Pn.uniqBy=function(e,t){return e&&e.length?Zl(e,$r(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=Ki,Pn.unzipWith=Yi,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=wa,Pn.valuesIn=function(e){return null==e?[]:Pt(e,ba(e))},Pn.without=$i,Pn.words=Ha,Pn.wrap=function(e,t){return xo(ir(t),e)},Pn.xor=Xi,Pn.xorBy=Zi,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=Na,Pn.extend=ca,Pn.extendWith=da,Za(Pn,Pn),Pn.add=uu,Pn.attempt=Wa,Pn.camelCase=Ra,Pn.capitalize=Ia,Pn.ceil=su,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),$n(oa(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,Sa(t))},Pn.deburr=Oa,Pn.defaultTo=function(e,t){return null==e||e!=e?t:e},Pn.divide=cu,Pn.endsWith=function(e,t,n){e=ua(e),t=Xl(t);var l=e.length,r=n=void 0===n?l:$n(ra(n),0,l);return(n-=t.length)>=0&&e.slice(n,r)==t},Pn.eq=wo,Pn.escape=function(e){return(e=ua(e))&&F.test(e)?e.replace(k,Lt):e},Pn.escapeRegExp=function(e){return(e=ua(e))&&q.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,$r(t,3))},Pn.find=io,Pn.findIndex=Ii,Pn.findKey=function(e,t){return mt(e,$r(t,3),ul)},Pn.findLast=oo,Pn.findLastIndex=Oi,Pn.findLastKey=function(e,t){return mt(e,$r(t,3),sl)},Pn.floor=du,Pn.forEach=ao,Pn.forEachRight=uo,Pn.forIn=function(e,t){return null==e?e:ol(e,$r(t,3),ba)},Pn.forInRight=function(e,t){return null==e?e:al(e,$r(t,3),ba)},Pn.forOwn=function(e,t){return e&&ul(e,$r(t,3))},Pn.forOwnRight=function(e,t){return e&&sl(e,$r(t,3))},Pn.get=ha,Pn.gt=Ro,Pn.gte=Io,Pn.has=function(e,t){return null!=e&&ni(e,t,ml)},Pn.hasIn=ga,Pn.head=ki,Pn.identity=Ka,Pn.includes=function(e,t,n,l){e=Mo(e)?e:wa(e),n=n&&!l?ra(n):0;var r=e.length;return n<0&&(n=on(r+n,0)),Zo(e)?n<=r&&e.indexOf(t,n)>-1:!!r&>(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)),gt(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=ko,Pn.isArrayLike=Mo,Pn.isArrayLikeObject=Fo,Pn.isBoolean=function(e){return!0===e||!1===e||qo(e)&&fl(e)==a},Pn.isBuffer=Bo,Pn.isDate=Uo,Pn.isElement=function(e){return qo(e)&&1===e.nodeType&&!Yo(e)},Pn.isEmpty=function(e){if(null==e)return!0;if(Mo(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==f||t==g)return!e.size;if(ci(e))return!Cl(e).length;for(var n in e)if(be.call(e,n))return!1;return!0},Pn.isEqual=function(e,t){return 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=Go,Pn.isMatch=function(e,t){return e===t||Sl(e,t,Zr(t))},Pn.isMatchWith=function(e,t,n){return n="function"==typeof n?n:void 0,Sl(e,t,Zr(t),n)},Pn.isNaN=function(e){return Ko(e)&&e!=+e},Pn.isNative=function(e){if(si(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=Ko,Pn.isObject=Vo,Pn.isObjectLike=qo,Pn.isPlainObject=Yo,Pn.isRegExp=$o,Pn.isSafeInteger=function(e){return Wo(e)&&e>=-9007199254740991&&e<=9007199254740991},Pn.isSet=Xo,Pn.isString=Zo,Pn.isSymbol=Jo,Pn.isTypedArray=Qo,Pn.isUndefined=function(e){return void 0===e},Pn.isWeakMap=function(e){return qo(e)&&ti(e)==y},Pn.isWeakSet=function(e){return qo(e)&&"[object WeakSet]"==fl(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,_t,r,!0)},Pn.lowerCase=ka,Pn.lowerFirst=Ma,Pn.lt=ea,Pn.lte=ta,Pn.max=function(e){return e&&e.length?ll(e,Ka,vl):void 0},Pn.maxBy=function(e,t){return e&&e.length?ll(e,$r(t,2),vl):void 0},Pn.mean=function(e){return yt(e,Ka)},Pn.meanBy=function(e,t){return yt(e,$r(t,2))},Pn.min=function(e){return e&&e.length?ll(e,Ka,Al):void 0},Pn.minBy=function(e,t){return e&&e.length?ll(e,$r(t,2),Al):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?wl(e,ra(t)):void 0},Pn.noConflict=function(){return ze._===this&&(ze._=xe),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 Rr(Qt(r),n)+e+Rr(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+Rr(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?Rr(t-l,n)+e:e},Pn.parseInt=function(e,t,n){return n||null==t?t=0:t&&(t=+t),sn(ua(e).replace(G,""),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=cn();return an(e+r*(t-e+Ue("1e-"+((r+"").length-1))),t)}return kl(e,t)},Pn.reduce=function(e,t,n){var l=Lo(e)?dt:Tt,r=arguments.length<3;return l(e,$r(t,4),n,r,el)},Pn.reduceRight=function(e,t,n){var l=Lo(e)?pt:Tt,r=arguments.length<3;return l(e,$r(t,4),n,r,tl)},Pn.repeat=function(e,t,n){return t=(n?oi(e,t,n):void 0===t)?1:ra(t),Ml(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=fu,Pn.runInContext=e,Pn.sample=function(e){return(Lo(e)?Un:Bl)(e)},Pn.size=function(e){if(null==e)return 0;if(Mo(e))return Zo(e)?Wt(e):e.length;var t=ti(e);return t==f||t==g?e.size:Cl(e).length},Pn.snakeCase=Fa,Pn.some=function(e,t,n){var l=Lo(e)?ft:ql;return n&&oi(e,t,n)&&(t=void 0),l(e,$r(t,3))},Pn.sortedIndex=function(e,t){return Gl(e,t)},Pn.sortedIndexBy=function(e,t,n){return Kl(e,t,$r(n,2))},Pn.sortedIndexOf=function(e,t){var n=null==e?0:e.length;if(n){var l=Gl(e,t);if(l<n&&wo(e[l],t))return l}return-1},Pn.sortedLastIndex=function(e,t){return Gl(e,t,!0)},Pn.sortedLastIndexBy=function(e,t,n){return Kl(e,t,$r(n,2),!0)},Pn.sortedLastIndexOf=function(e,t){if(null!=e&&e.length){var n=Gl(e,t,!0)-1;if(wo(e[n],t))return n}return-1},Pn.startCase=Ba,Pn.startsWith=function(e,t,n){return e=ua(e),n=null==n?0:$n(ra(n),0,e.length),t=Xl(t),e.slice(n,n+t.length)==t},Pn.subtract=vu,Pn.sum=function(e){return e&&e.length?Ct(e,Ka):0},Pn.sumBy=function(e,t){return e&&e.length?Ct(e,$r(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),s=0,c=t.interpolate||ue,d="__p += '",p=me((t.escape||ue).source+"|"+c.source+"|"+(c===j?ee:ue).source+"|"+(t.evaluate||ue).source+"|$","g"),f="//# sourceURL="+(be.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++ke+"]")+"\n";e.replace(p,function(t,n,l,o,a,u){return l||(l=o),d+=e.slice(s,u).replace(se,kt),n&&(r=!0,d+="' +\n__e("+n+") +\n'"),a&&(i=!0,d+="';\n"+a+";\n__p += '"),l&&(d+="' +\n((__t = ("+l+")) == null ? '' : __t) +\n'"),s=u+t.length,t}),d+="';\n";var v=be.call(t,"variable")&&t.variable;if(v){if(J.test(v))throw new de("Invalid `variable` option passed into `_.template`")}else d="with (obj) {\n"+d+"\n}\n";d=(i?d.replace(R,""):d).replace(I,"$1").replace(O,"$1;"),d="function("+(v||"obj")+") {\n"+(v?"":"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,f+"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=At(l,t=$r(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?$n(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=Xl(t)))return e;var l=zt(e),r=zt(t);return ur(l,wt(l,r),Rt(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=Xl(t)))return e;var l=zt(e);return ur(l,0,Rt(l,zt(t))+1).join("")},Pn.trimStart=function(e,t,n){if((e=ua(e))&&(n||void 0===t))return e.replace(G,"");if(!e||!(t=Xl(t)))return e;var l=zt(e);return ur(l,wt(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?Xl(t.omission):l}var i=(e=ua(e)).length;if(Mt(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),$o(r)){if(e.slice(a).search(r)){var s,c=u;for(r.global||(r=me(r.source,ua(te.exec(r))+"g")),r.lastIndex=0;s=r.exec(c);)var d=s.index;u=u.slice(0,void 0===d?a:d)}}else if(e.indexOf(Xl(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))&&M.test(e)?e.replace(L,qt):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=ki,Za(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){In.prototype[e]=function(n){n=void 0===n?1:on(ra(n),0);var l=this.__filtered__&&!t?new In(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},In.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;In.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":"");In.prototype[e]=function(){return this[n](1).value()[0]}}),lt(["initial","tail"],function(e,t){var n="drop"+(t?"":"Right");In.prototype[e]=function(){return this.__filtered__?new In(this):this[n](1)}}),In.prototype.compact=function(){return this.filter(Ka)},In.prototype.find=function(e){return this.filter(e).head()},In.prototype.findLast=function(e){return this.reverse().find(e)},In.prototype.invokeMap=Fl(function(e,t){return"function"==typeof e?new In(this):this.map(function(n){return El(n,e,t)})}),In.prototype.reject=function(e){return this.filter(Ao($r(e)))},In.prototype.slice=function(e,t){e=ra(e);var n=this;return n.__filtered__&&(e>0||t<0)?new In(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)},In.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},In.prototype.toArray=function(){return this.take(4294967295)},ul(In.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 In,u=o[0],s=a||Lo(t),c=function(e){var t=r.apply(Pn,ct([e],o));return l&&d?t[0]:t};s&&n&&"function"==typeof u&&1!=u.length&&(a=s=!1);var d=this.__chain__,p=!!this.__actions__.length,f=i&&!d,v=a&&!p;if(!i&&s){t=v?t:new In(this);var m=e.apply(t,o);return m.__actions__.push({func:no,args:[c],thisArg:void 0}),new Rn(m,d)}return f&&v?e.apply(this,o):(m=this.thru(c),f?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);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(In.prototype,function(e,t){var n=Pn[t];if(n){var l=n.name+"";be.call(_n,l)||(_n[l]=[]),_n[l].push({name:t,func:n})}}),_n[xr(void 0,2).name]=[{name:"wrapper",func:void 0}],In.prototype.clone=function(){var e=new In(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},In.prototype.reverse=function(){if(this.__filtered__){var e=new In(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},In.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,s=l?a:o-1,c=this.__iteratees__,d=c.length,p=0,f=an(u,this.__takeCount__);if(!n||!l&&r==u&&f==u)return tr(e,this.__actions__);var v=[];e:for(;u--&&p<f;){for(var m=-1,h=e[s+=t];++m<d;){var g=c[m],E=g.type,_=(0,g.iteratee)(h);if(2==E)h=_;else if(!_){if(1==E)continue e;break e}}v[p++]=h}return v},Pn.prototype.at=lo,Pn.prototype.chain=function(){return to(this)},Pn.prototype.commit=function(){return new Rn(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 wn;){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 In){var t=e;return this.__actions__.length&&(t=new In(this)),(t=t.reverse()).__actions__.push({func:no,args:[zi],thisArg:void 0}),new Rn(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}();qe?((qe.exports=Gt)._=Gt,Ve._=Gt):ze._=Gt}).call(c)});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"},v=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},m=e=>{var r,i,a,s,c,d,f,v,m,h;const{pets:g,focusIndex:E,allOwners:_,setFocusIndex:y,setPets:S,t:b,formData:T,config:C,setError:A,clearErrors:D,formState:x,menu:P,breed_type:N,pet_sex:w}=e,[R,I]=n.useState(null),{control:O,formState:L,watch:k,trigger:M}=o.useForm(),F=k(),{errors:B}=L,U=(Digit.ULBService.getCurrentTenantId(),n.useMemo(()=>{var e;return null==T||null===(e=T.ownershipCategory)||void 0===e?void 0:e.code.includes("INDIVIDUAL")},[null==T||null===(r=T.ownershipCategory)||void 0===r?void 0:r.code])),[j,H]=l.useState({});n.useEffect(()=>{let e=U;p.isEqual(j,F)||(H(u({},F)),S(t=>t.map(t=>t.key&&t.key===g.key?u({},t,F,e):u({},t))),M())},[F]),n.useEffect(()=>{var e;Object.keys(B).length&&!p.isEqual((null===(e=x.errors[C.key])||void 0===e?void 0:e.type)||{},B)?A(C.key,{type:B}):!Object.keys(B).length&&x.errors[C.key]&&D(C.key)},[B]);const W={width:"70%",marginLeft:"30%",fontSize:"12px",marginTop:"-21px"};return l.createElement(l.Fragment,null,l.createElement("div",{style:{marginBottom:"16px"}},l.createElement("div",{style:{border:"1px solid #E3E3E3",padding:"16px",marginTop:"8px"}},(null==_?void 0:_.length)>2?l.createElement("div",{style:{marginBottom:"16px",padding:"5px",cursor:"pointer",textAlign:"right"}},"X"):null,l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},b("PTR_SEARCH_PET_TYPE")+" *"),l.createElement(o.Controller,{control:O,name:"petType",defaultValue:null==g?void 0:g.petType,rules:{required:b("CORE_COMMON_REQUIRED_ERRMSG")},render:e=>l.createElement(t.Dropdown,{className:"form-field",selected:e.value,select:e.onChange,onBlur:e.onBlur,option:P,optionKey:"i18nKey",t:b})})),l.createElement(t.CardLabelError,{style:W},L.touched.petType?null==B||null===(i=B.petType)||void 0===i?void 0:i.message:""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},b("PTR_SEARCH_BREED_TYPE")+" *"),l.createElement(o.Controller,{control:O,name:"breedType",defaultValue:null==g?void 0:g.breedType,rules:{required:b("CORE_COMMON_REQUIRED_ERRMSG")},render:e=>l.createElement(t.Dropdown,{className:"form-field",selected:e.value,select:e.onChange,onBlur:e.onBlur,option:N,optionKey:"i18nKey",t:b})})),l.createElement(t.CardLabelError,{style:W},L.touched.breedType?null==B||null===(a=B.breedType)||void 0===a?void 0:a.message:""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},b("PTR_PET_NAME")+" *"),l.createElement("div",{className:"field"},l.createElement(o.Controller,{control:O,name:"petName",defaultValue:null==g?void 0:g.petName,rules:{required:b("CORE_COMMON_REQUIRED_ERRMSG"),validate:{pattern:e=>!!/^[a-zA-Z\s]*$/.test(e)||b("ERR_DEFAULT_INPUT_FIELD_MSG")}},render:e=>l.createElement(t.TextInput,{value:e.value,autoFocus:E.index===(null==g?void 0:g.key)&&"petName"===E.type,onChange:t=>{e.onChange(t.target.value),y({index:g.key,type:"petName"})},onBlur:t=>{y({index:-1}),e.onBlur(t)}})}))),l.createElement(t.CardLabelError,{style:W},L.touched.petName?null==B||null===(s=B.petName)||void 0===s?void 0:s.message:""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},b("PTR_PET_AGE")+" *"),l.createElement("div",{className:"field"},l.createElement(o.Controller,{control:O,name:"petAge",defaultValue:null==g?void 0:g.petAge,rules:{required:b("CORE_COMMON_REQUIRED_ERRMSG"),validate:e=>!!(/^\d{1,4}$/.test(e)&&parseInt(e,10)>=0&&parseInt(e,10)<=1440)||b("ERR_DEFAULT_INPUT_FIELD_MSG")},render:e=>l.createElement(t.TextInput,{value:e.value,autoFocus:E.index===(null==g?void 0:g.key)&&"petAge"===E.type,onChange:t=>{e.onChange(t),y({index:g.key,type:"petAge"})},labelStyle:{marginTop:"unset"},onBlur:e.onBlur,placeholder:"in months"})}))),l.createElement("div",{style:{textAlign:"center"}},Math.floor(k("petAge")/12)," ",1===Math.floor(k("petAge")/12)?"YEAR":"YEARS"," ",k("petAge")%12," ",k("petAge")%12==1?"MONTH":"MONTHS"),l.createElement("br",null),l.createElement(t.CardLabelError,{style:W},L.touched.petAge?null==B||null===(c=B.petAge)||void 0===c?void 0:c.message:""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},b("PTR_PET_SEX")+" *"),l.createElement(o.Controller,{control:O,name:"petGender",defaultValue:null==g?void 0:g.petGender,render:e=>l.createElement(t.Dropdown,{className:"form-field",selected:e.value,select:e.onChange,onBlur:e.onBlur,option:w,optionKey:"i18nKey",t:b})})),l.createElement(t.CardLabelError,{style:W},L.touched.petGender?null==B||null===(d=B.petGender)||void 0===d?void 0:d.message:""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},b("PTR_DOCTOR_NAME")+" *"),l.createElement("div",{className:"field"},l.createElement(o.Controller,{control:O,name:"doctorName",defaultValue:null==g?void 0:g.doctorName,rules:{required:b("CORE_COMMON_REQUIRED_ERRMSG"),validate:{pattern:e=>!!/^\w+( +\w+)*$/.test(e)||b("ERR_DEFAULT_INPUT_FIELD_MSG")}},render:e=>l.createElement(t.TextInput,{value:e.value,autoFocus:E.index===(null==g?void 0:g.key)&&"doctorName"===E.type,onChange:t=>{e.onChange(t.target.value),y({index:g.key,type:"doctorName"})},onBlur:e.onBlur})}))),l.createElement(t.CardLabelError,{style:W},L.touched.doctorName?null==B||null===(f=B.doctorName)||void 0===f?void 0:f.message:""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},b("PTR_CLINIC_NAME")+" *"),l.createElement("div",{className:"field"},l.createElement(o.Controller,{control:O,name:"clinicName",defaultValue:null==g?void 0:g.clinicName,rules:{required:b("CORE_COMMON_REQUIRED_ERRMSG"),validate:{pattern:e=>!!/^\w+( +\w+)*$/.test(e)||b("ERR_DEFAULT_INPUT_FIELD_MSG")}},render:e=>l.createElement(t.TextInput,{value:e.value,autoFocus:E.index===(null==g?void 0:g.key)&&"clinicName"===E.type,onChange:t=>{e.onChange(t.target.value),y({index:g.key,type:"clinicName"})},onBlur:e.onBlur})}))),l.createElement(t.CardLabelError,{style:W},L.touched.clinicName?null==B||null===(v=B.clinicName)||void 0===v?void 0:v.message:""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},b("PTR_VACCINATED_DATE")+" *"),l.createElement("div",{className:"field"},l.createElement(o.Controller,{control:O,name:"lastVaccineDate",defaultValue:null==g?void 0:g.lastVaccineDate,rules:{required:b("CORE_COMMON_REQUIRED_ERRMSG"),validDate:e=>!!/^\d{4}-\d{2}-\d{2}$/.test(e)||b("ERR_DEFAULT_INPUT_FIELD_MSG")},render:e=>l.createElement(t.TextInput,{type:"date",value:e.value,onChange:t=>{e.onChange(t.target.value)},max:(new Date).toISOString().split("T")[0]})}))),l.createElement(t.CardLabelError,{style:W},L.touched.lastVaccineDate?null==B||null===(m=B.lastVaccineDate)||void 0===m?void 0:m.message:""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},b("PTR_VACCINATION_NUMBER")+" *"),l.createElement("div",{className:"field"},l.createElement(o.Controller,{control:O,name:"vaccinationNumber",defaultValue:null==g?void 0:g.vaccinationNumber,render:e=>l.createElement(t.TextInput,{value:e.value,autoFocus:E.index===(null==g?void 0:g.key)&&"vaccinationNumber"===E.type,onChange:t=>{e.onChange(t.target.value),y({index:g.key,type:"vaccinationNumber"})},onBlur:e.onBlur})}))),l.createElement(t.CardLabelError,{style:W},L.touched.vaccinationNumber?null==B||null===(h=B.vaccinationNumber)||void 0===h?void 0:h.message:""))),(null==R?void 0:R.label)&&l.createElement(t.Toast,{label:null==R?void 0:R.label,onClose:e=>{I(e=>null)}}))},h=e=>{var r,i,a,s,c;const{owner:d,focusIndex:f,allOwners:v,setFocusIndex:m,setOwners:h,t:g,config:E,setError:_,clearErrors:y,formState:S}=e,[b,T]=n.useState(null),{control:C,formState:A,watch:D,trigger:x}=o.useForm(),P=D(),{errors:N}=A;Digit.ULBService.getCurrentTenantId(),n.useEffect(()=>{x()},[]);const[w,R]=l.useState({});n.useEffect(()=>{p.isEqual(w,P)||(R(u({},P)),h(e=>e.map(e=>e.key&&e.key===d.key?u({},e,P):u({},e))),x())},[P]),n.useEffect(()=>{var e;Object.keys(N).length&&!p.isEqual((null===(e=S.errors[E.key])||void 0===e?void 0:e.type)||{},N)?_(E.key,{type:N}):!Object.keys(N).length&&S.errors[E.key]&&y(E.key)},[N]);const I={width:"70%",marginLeft:"30%",fontSize:"12px",marginTop:"-21px"};return l.createElement(l.Fragment,null,l.createElement("div",{style:{marginBottom:"16px"}},l.createElement("div",{style:{border:"1px solid #E3E3E3",padding:"16px",marginTop:"8px"}},(null==v?void 0:v.length)>2?l.createElement("div",{style:{marginBottom:"16px",padding:"5px",cursor:"pointer",textAlign:"right"}},"X"):null,l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},g("PTR_APPLICANT_NAME")+" *"),l.createElement("div",{className:"field"},l.createElement(o.Controller,{control:C,name:"applicantName",defaultValue:null==d?void 0:d.applicantName,rules:{required:g("CORE_COMMON_REQUIRED_ERRMSG"),validate:{pattern:e=>!!/^[a-zA-Z\s]*$/.test(e)||g("ERR_DEFAULT_INPUT_FIELD_MSG")}},render:e=>l.createElement(t.TextInput,{value:e.value,autoFocus:f.index===(null==d?void 0:d.key)&&"applicantName"===f.type,onChange:t=>{e.onChange(t.target.value),m({index:d.key,type:"applicantName"})},onBlur:t=>{m({index:-1}),e.onBlur(t)}})}))),l.createElement(t.CardLabelError,{style:I},A.touched.applicantName?null==N||null===(r=N.applicantName)||void 0===r?void 0:r.message:""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},g("PTR_FATHER_HUSBAND_NAME")+" *"),l.createElement("div",{className:"field"},l.createElement(o.Controller,{control:C,name:"fatherName",defaultValue:null==d?void 0:d.fatherName,rules:{required:g("CORE_COMMON_REQUIRED_ERRMSG"),validate:{pattern:e=>!!/^[a-zA-Z\s]*$/.test(e)||g("ERR_DEFAULT_INPUT_FIELD_MSG")}},render:e=>l.createElement(t.TextInput,{value:e.value,autoFocus:f.index===(null==d?void 0:d.key)&&"fatherName"===f.type,onChange:t=>{e.onChange(t.target.value),m({index:d.key,type:"fatherName"})},onBlur:t=>{m({index:-1}),e.onBlur(t)}})}))),l.createElement(t.CardLabelError,{style:I},A.touched.fatherName?null==N||null===(i=N.fatherName)||void 0===i?void 0:i.message:""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},g("PTR_MOBILE_NUMBER")+" *"),l.createElement("div",{className:"field"},l.createElement(o.Controller,{control:C,name:"mobileNumber",defaultValue:null==d?void 0:d.mobileNumber,rules:{required:g("CORE_COMMON_REQUIRED_ERRMSG"),validate:e=>!!/^[6789]\d{9}$/.test(e)||g("ERR_DEFAULT_INPUT_FIELD_MSG")},render:e=>l.createElement(t.MobileNumber,{value:e.value,autoFocus:f.index===(null==d?void 0:d.key)&&"mobileNumber"===f.type,onChange:t=>{e.onChange(t),m({index:d.key,type:"mobileNumber"})},labelStyle:{marginTop:"unset"},onBlur:e.onBlur})}))),l.createElement(t.CardLabelError,{style:I},A.touched.mobileNumber?null==N||null===(a=N.mobileNumber)||void 0===a?void 0:a.message:""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},g("PTR_ALT_MOBILE_NUMBER")+" *"),l.createElement("div",{className:"field"},l.createElement(o.Controller,{control:C,name:"alternateNumber",defaultValue:null==d?void 0:d.alternateNumber,rules:{required:g("CORE_COMMON_REQUIRED_ERRMSG"),validate:e=>/^[6789]\d{9}$/.test(e)},render:e=>l.createElement(t.MobileNumber,{value:e.value,autoFocus:f.index===(null==d?void 0:d.key)&&"alternateNumber"===f.type,onChange:t=>{e.onChange(t),m({index:d.key,type:"alternateNumber"})},labelStyle:{marginTop:"unset"},onBlur:e.onBlur})}))),l.createElement(t.CardLabelError,{style:I},A.touched.alternateNumber?null==N||null===(s=N.alternateNumber)||void 0===s?void 0:s.message:""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},g("PTR_EMAIL_ID")),l.createElement("div",{className:"field"},l.createElement(o.Controller,{control:C,name:"emailId",defaultValue:null==d?void 0:d.emailId,rules:{validate:e=>{const t=e.trim().toLowerCase();return/^(([^<>()\[\]\.,;:\s@\"]+(\.[^<>()\[\]\.,;:\s@\"]+)*)|(\".+\"))@(([^<>()[\]\.,;:\s@\"]+\.)+[^<>()[\]\.,;:\s@\"]{2,})$/i.test(t)||"TL_EMAIL_ID_ERROR_MESSAGE"}},render:e=>l.createElement(t.TextInput,{value:e.value,autoFocus:f.index===(null==d?void 0:d.key)&&"emailId"===f.type,onChange:t=>{e.onChange(t),m({index:d.key,type:"emailId"})},labelStyle:{marginTop:"unset"},onBlur:e.onBlur})}))),l.createElement(t.CardLabelError,{style:I},A.touched.emailId?null==N||null===(c=N.emailId)||void 0===c?void 0:c.message:""))),(null==b?void 0:b.label)&&l.createElement(t.Toast,{label:null==b?void 0:b.label,onClose:e=>{T(e=>null)}}))};let g=[];const E=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":g=[];break;default:g=["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"}},g.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")}))))};function y(e,t){try{var n=e()}catch(e){return t(e)}return n&&n.then?n.then(void 0,t):n}function S(e){var r;let{t:i,document:o,setDocuments:a,setError:s,documents:c,action:d,formData:p,setFormError:f,clearFormErrors:v,config:m,formState:h,id:g}=e;const E=null==c?void 0:c.filter(e=>{var t;return null==e||null===(t=e.documentType)||void 0===t?void 0:t.includes(null==o?void 0:o.code)})[0],[_,S]=(Digit.ULBService.getCurrentTenantId(),n.useState(E?u({},E,{active:"ACTIVE"===(null==E?void 0:E.status),code:null==E?void 0:E.documentType}):1===(null==o||null===(r=o.dropdownData)||void 0===r?void 0:r.length)?null==o?void 0:o.dropdownData[0]:{})),[b,T]=n.useState(null),[C,A]=n.useState(()=>(null==E?void 0:E.fileStoreId)||null),{dropdownData:D}=o;var x=D;const[P,N]=n.useState(!1),w=()=>{var e,t;let n=null===(e=h.errors)||void 0===e||null===(t=e[m.key])||void 0===t?void 0:t.type;Array.isArray(n)||(n=[]),n.includes(null==o?void 0:o.code)&&(n=n.filter(e=>e!=(null==o?void 0:o.code)),n.length?f(m.key,{type:n}):v(m.key))};return n.useEffect(()=>{null!=_&&_.code&&a(e=>{const t=null==e?void 0:e.filter(e=>(null==e?void 0:e.documentType)!==(null==_?void 0:_.code));return 0===(null==C?void 0:C.length)||null===C?t:[...null==t?void 0:t.filter(e=>(null==e?void 0:e.fileStoreId)!==C),{documentType:null==_?void 0:_.code,filestoreId:C,documentUid:C}]}),P?P&&w():C&&null!=_&&_.code?C&&null!=_&&_.code&&w():(()=>{var e,t;let n=null===(e=h.errors)||void 0===e||null===(t=e[m.key])||void 0===t?void 0:t.type;Array.isArray(n)||(n=[]),n.includes(o.code)||(n.push(o.code),f(m.key,{type:n}))})()},[C,_,P]),n.useEffect(()=>{if("update"===d){var e,t;const n=null==p||null===(e=p.originalData)||void 0===e||null===(t=e.documents)||void 0===t?void 0:t.filter(e=>e.documentType.includes(null==o?void 0:o.code))[0],l=x.filter(e=>e.code===(null==n?void 0:n.documentType)).map(e=>{var t;return u({},e,{i18nKey:null==e||null===(t=e.code)||void 0===t?void 0:t.replaceAll(".","_")})})[0];l?(S(l),A(null==n?void 0:n.fileStoreId)):N(!0)}},[]),n.useEffect(()=>{!function(){try{s(null);const e=function(){if(b){const e=function(){if(b.size>=5242880)s(i("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=y(function(){return A(null),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?A(null==e||null===(l=e.data)||void 0===l||null===(r=l.files[0])||void 0===r?void 0:r.fileStoreId):s(i("CS_FILE_UPLOAD_ERROR"))})},function(){s(i("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[b]),n.useEffect(()=>{P&&A(null)},[P]),l.createElement("div",{style:{marginBottom:"24px"}},null!=o&&o.hasDropdown?l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},i(null==o?void 0:o.code.replaceAll(".","_"))+" *"),l.createElement(t.Dropdown,{className:"form-field",selected:_,option:x.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:i})):null,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:()=>{A(null)},id:g,message:C?"1 "+i("CS_ACTION_FILEUPLOADED"):i("CS_ACTION_NO_FILEUPLOADED"),textStyles:{width:"100%"},inputStyles:{width:"280px"},accept:".pdf, .jpeg, .jpg, .png",buttonType:"button",error:!C}))))}"undefined"!=typeof Symbol&&(Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator"))),"undefined"!=typeof Symbol&&(Symbol.asyncIterator||(Symbol.asyncIterator=Symbol("Symbol.asyncIterator")));const b=[{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:"pincode",texts:{submitBarLabel:"PTR_COMMON_NEXT"}}]},{head:"PTR_LOCATION_DETAILS",body:[{route:"pincode",component:"PTRSelectPincode",texts:{submitBarLabel:"PTR_COMMON_NEXT",skipText:"CORE_COMMON_SKIP_CONTINUE"},withoutLabel:!0,key:"address",nextStep:"address",type:"component"},{route:"address",component:"PTRSelectAddress",withoutLabel:!0,texts:{submitBarLabel:"PTR_COMMON_NEXT"},key:"address",nextStep:"street",isMandatory:!0,type:"component"},{type:"component",route:"street",component:"PTRCitizenAddress",key:"address",withoutLabel:!0,texts:{submitBarLabel:"PTR_COMMON_NEXT"},nextStep:"documents"}]},{head:"ES_TITILE_DOCUMENT_DETAILS",body:[{route:"documents",component:"PTRSelectProofIdentity",withoutLabel:!0,key:"documents",type:"component",nextStep:null,texts:{submitBarLabel:"PTR_COMMON_NEXT"}}]}];function T(e){var r;let{t:i,document:o,setDocuments:a,setError:s,documents:c,action:d,formData:p,id:f}=e;const v=null==c?void 0:c.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];console.log("filetetetetet",v),Digit.ULBService.getCurrentTenantId();const[m,h]=n.useState(v?u({},v,{active:!0===(null==o?void 0:o.active),code:null==v?void 0:v.documentType}):1===(null==o||null===(r=o.dropdownData)||void 0===r?void 0:r.length)?null==o?void 0:o.dropdownData[0]:{}),[g,E]=n.useState(null),[_,S]=n.useState(()=>(null==v?void 0:v.filestoreId)||null),{dropdownData:b}=o;var T=b;const[C,A]=n.useState(!1);return n.useEffect(()=>{null!=m&&m.code&&a(e=>{const t=null==e?void 0:e.filter(e=>(null==e?void 0:e.documentType)!==(null==m?void 0:m.code));return 0===(null==_?void 0:_.length)||null===_?t:[...null==t?void 0:t.filter(e=>(null==e?void 0:e.fileStoreId)!==_),{documentType:null==m?void 0:m.code,filestoreId:_,documentUid:_}]})},[_,m]),n.useEffect(()=>{if("update"===d){var e,t;const n=null==p||null===(e=p.originalData)||void 0===e||null===(t=e.documents)||void 0===t?void 0:t.filter(e=>e.documentType.includes(null==o?void 0:o.code))[0],l=T.filter(e=>e.code===(null==n?void 0:n.documentType)).map(e=>{var t;return u({},e,{i18nKey:null==e||null===(t=e.code)||void 0===t?void 0:t.replaceAll(".","_")})})[0];l?(h(l),S(null==n?void 0:n.fileStoreId)):A(!0)}},[]),n.useEffect(()=>{!function(){try{s(null);const e=function(){if(g){const e=function(){if(g.size>=5242880)s(i("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=y(function(){return S(null),Promise.resolve(Digit.UploadServices.Filestorage("PTR",g,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?S(null==e||null===(l=e.data)||void 0===l||null===(r=l.files[0])||void 0===r?void 0:r.fileStoreId):s(i("CS_FILE_UPLOAD_ERROR"))})},function(){s(i("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)}}()},[g]),n.useEffect(()=>{C&&S(null)},[C]),l.createElement("div",{style:{marginBottom:"24px"}},null!=o&&o.hasDropdown?l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},i(null==o?void 0:o.code.replaceAll(".","_"))+" *"),l.createElement(t.Dropdown,{className:"form-field",selected:m,style:{width:"100%"},option:T.map(e=>{var t;return u({},e,{i18nKey:null===(t=e.code)||void 0===t?void 0:t.replaceAll(".","_")})}),select:e=>h(e),optionKey:"i18nKey",t:i})):null,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){E(e.target.files[0])},onDelete:()=>{S(null)},id:f,message:_?"1 "+i("CS_ACTION_FILEUPLOADED"):i("CS_ACTION_NO_FILEUPLOADED"),textStyles:{width:"100%"},inputStyles:{width:"280px"},accept:".pdf, .jpeg, .jpg, .png",buttonType:"button",error:!_}))))}d(function(e){!function(t,n){e.exports=t.document?n(t,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return n(e)}}("undefined"!=typeof window?window:c,function(e,t){var n=[],l=Object.getPrototypeOf,r=n.slice,i=n.flat?function(e){return n.flat.call(e)}:function(e){return n.concat.apply([],e)},o=n.push,a=n.indexOf,u={},s=u.toString,c=u.hasOwnProperty,d=c.toString,p=d.call(Object),f={},v=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType&&"function"!=typeof e.item},m=function(e){return null!=e&&e===e.window},h=e.document,g={type:!0,src:!0,nonce:!0,noModule:!0};function E(e,t,n){var l,r,i=(n=n||h).createElement("script");if(i.text=e,t)for(l in g)(r=t[l]||t.getAttribute&&t.getAttribute(l))&&i.setAttribute(l,r);n.head.appendChild(i).parentNode.removeChild(i)}function _(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?u[s.call(e)]||"object":typeof e}var y=function(e,t){return new y.fn.init(e,t)};function S(e){var t=!!e&&"length"in e&&e.length,n=_(e);return!v(e)&&!m(e)&&("array"===n||0===t||"number"==typeof t&&t>0&&t-1 in e)}y.fn=y.prototype={jquery:"3.6.0",constructor:y,length:0,toArray:function(){return r.call(this)},get:function(e){return null==e?r.call(this):e<0?this[e+this.length]:this[e]},pushStack:function(e){var t=y.merge(this.constructor(),e);return t.prevObject=this,t},each:function(e){return y.each(this,e)},map:function(e){return this.pushStack(y.map(this,function(t,n){return e.call(t,n,t)}))},slice:function(){return this.pushStack(r.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},even:function(){return this.pushStack(y.grep(this,function(e,t){return(t+1)%2}))},odd:function(){return this.pushStack(y.grep(this,function(e,t){return t%2}))},eq:function(e){var t=this.length,n=+e+(e<0?t:0);return this.pushStack(n>=0&&n<t?[this[n]]:[])},end:function(){return this.prevObject||this.constructor()},push:o,sort:n.sort,splice:n.splice},y.extend=y.fn.extend=function(){var e,t,n,l,r,i,o=arguments[0]||{},a=1,u=arguments.length,s=!1;for("boolean"==typeof o&&(s=o,o=arguments[a]||{},a++),"object"==typeof o||v(o)||(o={}),a===u&&(o=this,a--);a<u;a++)if(null!=(e=arguments[a]))for(t in e)l=e[t],"__proto__"!==t&&o!==l&&(s&&l&&(y.isPlainObject(l)||(r=Array.isArray(l)))?(n=o[t],i=r&&!Array.isArray(n)?[]:r||y.isPlainObject(n)?n:{},r=!1,o[t]=y.extend(s,i,l)):void 0!==l&&(o[t]=l));return o},y.extend({expando:"jQuery"+("3.6.0"+Math.random()).replace(/\D/g,""),isReady:!0,error:function(e){throw new Error(e)},noop:function(){},isPlainObject:function(e){var t,n;return!(!e||"[object Object]"!==s.call(e)||(t=l(e))&&("function"!=typeof(n=c.call(t,"constructor")&&t.constructor)||d.call(n)!==p))},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},globalEval:function(e,t,n){E(e,{nonce:t&&t.nonce},n)},each:function(e,t){var n,l=0;if(S(e))for(n=e.length;l<n&&!1!==t.call(e[l],l,e[l]);l++);else for(l in e)if(!1===t.call(e[l],l,e[l]))break;return e},makeArray:function(e,t){var n=t||[];return null!=e&&(S(Object(e))?y.merge(n,"string"==typeof e?[e]:e):o.call(n,e)),n},inArray:function(e,t,n){return null==t?-1:a.call(t,e,n)},merge:function(e,t){for(var n=+t.length,l=0,r=e.length;l<n;l++)e[r++]=t[l];return e.length=r,e},grep:function(e,t,n){for(var l=[],r=0,i=e.length,o=!n;r<i;r++)!t(e[r],r)!==o&&l.push(e[r]);return l},map:function(e,t,n){var l,r,o=0,a=[];if(S(e))for(l=e.length;o<l;o++)null!=(r=t(e[o],o,n))&&a.push(r);else for(o in e)null!=(r=t(e[o],o,n))&&a.push(r);return i(a)},guid:1,support:f}),"function"==typeof Symbol&&(y.fn[Symbol.iterator]=n[Symbol.iterator]),y.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(e,t){u["[object "+t+"]"]=t.toLowerCase()});var b=function(e){var t,n,l,r,i,o,a,u,s,c,d,p,f,v,m,h,g,E,_,y="sizzle"+1*new Date,S=e.document,b=0,T=0,C=ue(),A=ue(),D=ue(),x=ue(),P=function(e,t){return e===t&&(d=!0),0},N={}.hasOwnProperty,w=[],R=w.pop,I=w.push,O=w.push,L=w.slice,k=function(e,t){for(var n=0,l=e.length;n<l;n++)if(e[n]===t)return n;return-1},M="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",F="[\\x20\\t\\r\\n\\f]",B="(?:\\\\[\\da-fA-F]{1,6}"+F+"?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+",U="\\["+F+"*("+B+")(?:"+F+"*([*^$|!~]?=)"+F+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+B+"))|)"+F+"*\\]",j=":("+B+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+U+")*)|.*)\\)|)",H=new RegExp(F+"+","g"),W=new RegExp("^"+F+"+|((?:^|[^\\\\])(?:\\\\.)*)"+F+"+$","g"),z=new RegExp("^"+F+"*,"+F+"*"),V=new RegExp("^"+F+"*([>+~]|"+F+")"+F+"*"),q=new RegExp(F+"|>"),G=new RegExp(j),K=new RegExp("^"+B+"$"),Y={ID:new RegExp("^#("+B+")"),CLASS:new RegExp("^\\.("+B+")"),TAG:new RegExp("^("+B+"|[*])"),ATTR:new RegExp("^"+U),PSEUDO:new RegExp("^"+j),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+F+"*(even|odd|(([+-]|)(\\d*)n|)"+F+"*(?:([+-]|)"+F+"*(\\d+)|))"+F+"*\\)|)","i"),bool:new RegExp("^(?:"+M+")$","i"),needsContext:new RegExp("^"+F+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+F+"*((?:-\\d)?\\d*)"+F+"*\\)|)(?=[^-]|$)","i")},$=/HTML$/i,X=/^(?:input|select|textarea|button)$/i,Z=/^h\d$/i,J=/^[^{]+\{\s*\[native \w/,Q=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=new RegExp("\\\\[\\da-fA-F]{1,6}"+F+"?|\\\\([^\\r\\n\\f])","g"),ne=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},le=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,re=function(e,t){return t?"\0"===e?"�":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},ie=function(){p()},oe=ye(function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()},{dir:"parentNode",next:"legend"});try{O.apply(w=L.call(S.childNodes),S.childNodes)}catch(e){O={apply:w.length?function(e,t){I.apply(e,L.call(t))}:function(e,t){for(var n=e.length,l=0;e[n++]=t[l++];);e.length=n-1}}}function ae(e,t,l,r){var i,a,s,c,d,v,g,E=t&&t.ownerDocument,S=t?t.nodeType:9;if(l=l||[],"string"!=typeof e||!e||1!==S&&9!==S&&11!==S)return l;if(!r&&(p(t),t=t||f,m)){if(11!==S&&(d=Q.exec(e)))if(i=d[1]){if(9===S){if(!(s=t.getElementById(i)))return l;if(s.id===i)return l.push(s),l}else if(E&&(s=E.getElementById(i))&&_(t,s)&&s.id===i)return l.push(s),l}else{if(d[2])return O.apply(l,t.getElementsByTagName(e)),l;if((i=d[3])&&n.getElementsByClassName&&t.getElementsByClassName)return O.apply(l,t.getElementsByClassName(i)),l}if(n.qsa&&!x[e+" "]&&(!h||!h.test(e))&&(1!==S||"object"!==t.nodeName.toLowerCase())){if(g=e,E=t,1===S&&(q.test(e)||V.test(e))){for((E=ee.test(e)&&ge(t.parentNode)||t)===t&&n.scope||((c=t.getAttribute("id"))?c=c.replace(le,re):t.setAttribute("id",c=y)),a=(v=o(e)).length;a--;)v[a]=(c?"#"+c:":scope")+" "+_e(v[a]);g=v.join(",")}try{return O.apply(l,E.querySelectorAll(g)),l}catch(t){x(e,!0)}finally{c===y&&t.removeAttribute("id")}}}return u(e.replace(W,"$1"),t,l,r)}function ue(){var e=[];return function t(n,r){return e.push(n+" ")>l.cacheLength&&delete t[e.shift()],t[n+" "]=r}}function se(e){return e[y]=!0,e}function ce(e){var t=f.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function de(e,t){for(var n=e.split("|"),r=n.length;r--;)l.attrHandle[n[r]]=t}function pe(e,t){var n=t&&e,l=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(l)return l;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function fe(e){return function(t){return"input"===t.nodeName.toLowerCase()&&t.type===e}}function ve(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function me(e){return function(t){return"form"in t?t.parentNode&&!1===t.disabled?"label"in t?"label"in t.parentNode?t.parentNode.disabled===e:t.disabled===e:t.isDisabled===e||t.isDisabled!==!e&&oe(t)===e:t.disabled===e:"label"in t&&t.disabled===e}}function he(e){return se(function(t){return t=+t,se(function(n,l){for(var r,i=e([],n.length,t),o=i.length;o--;)n[r=i[o]]&&(n[r]=!(l[r]=n[r]))})})}function ge(e){return e&&void 0!==e.getElementsByTagName&&e}for(t in n=ae.support={},i=ae.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return!$.test(e&&e.namespaceURI||t&&t.nodeName||"HTML")},p=ae.setDocument=function(e){var t,r,o=e?e.ownerDocument||e:S;return o!=f&&9===o.nodeType&&o.documentElement?(v=(f=o).documentElement,m=!i(f),S!=f&&(r=f.defaultView)&&r.top!==r&&(r.addEventListener?r.addEventListener("unload",ie,!1):r.attachEvent&&r.attachEvent("onunload",ie)),n.scope=ce(function(e){return v.appendChild(e).appendChild(f.createElement("div")),void 0!==e.querySelectorAll&&!e.querySelectorAll(":scope fieldset div").length}),n.attributes=ce(function(e){return e.className="i",!e.getAttribute("className")}),n.getElementsByTagName=ce(function(e){return e.appendChild(f.createComment("")),!e.getElementsByTagName("*").length}),n.getElementsByClassName=J.test(f.getElementsByClassName),n.getById=ce(function(e){return v.appendChild(e).id=y,!f.getElementsByName||!f.getElementsByName(y).length}),n.getById?(l.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute("id")===t}},l.find.ID=function(e,t){if(void 0!==t.getElementById&&m){var n=t.getElementById(e);return n?[n]:[]}}):(l.filter.ID=function(e){var t=e.replace(te,ne);return function(e){var n=void 0!==e.getAttributeNode&&e.getAttributeNode("id");return n&&n.value===t}},l.find.ID=function(e,t){if(void 0!==t.getElementById&&m){var n,l,r,i=t.getElementById(e);if(i){if((n=i.getAttributeNode("id"))&&n.value===e)return[i];for(r=t.getElementsByName(e),l=0;i=r[l++];)if((n=i.getAttributeNode("id"))&&n.value===e)return[i]}return[]}}),l.find.TAG=n.getElementsByTagName?function(e,t){return void 0!==t.getElementsByTagName?t.getElementsByTagName(e):n.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,l=[],r=0,i=t.getElementsByTagName(e);if("*"===e){for(;n=i[r++];)1===n.nodeType&&l.push(n);return l}return i},l.find.CLASS=n.getElementsByClassName&&function(e,t){if(void 0!==t.getElementsByClassName&&m)return t.getElementsByClassName(e)},g=[],h=[],(n.qsa=J.test(f.querySelectorAll))&&(ce(function(e){var t;v.appendChild(e).innerHTML="<a id='"+y+"'></a><select id='"+y+"-\r\\' msallowcapture=''><option selected=''></option></select>",e.querySelectorAll("[msallowcapture^='']").length&&h.push("[*^$]="+F+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||h.push("\\["+F+"*(?:value|"+M+")"),e.querySelectorAll("[id~="+y+"-]").length||h.push("~="),(t=f.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||h.push("\\["+F+"*name"+F+"*="+F+"*(?:''|\"\")"),e.querySelectorAll(":checked").length||h.push(":checked"),e.querySelectorAll("a#"+y+"+*").length||h.push(".#.+[+~]"),e.querySelectorAll("\\\f"),h.push("[\\r\\n\\f]")}),ce(function(e){e.innerHTML="<a href='' disabled='disabled'></a><select disabled='disabled'><option/></select>";var t=f.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&h.push("name"+F+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&h.push(":enabled",":disabled"),v.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&h.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),h.push(",.*:")})),(n.matchesSelector=J.test(E=v.matches||v.webkitMatchesSelector||v.mozMatchesSelector||v.oMatchesSelector||v.msMatchesSelector))&&ce(function(e){n.disconnectedMatch=E.call(e,"*"),E.call(e,"[s!='']:x"),g.push("!=",j)}),h=h.length&&new RegExp(h.join("|")),g=g.length&&new RegExp(g.join("|")),t=J.test(v.compareDocumentPosition),_=t||J.test(v.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,l=t&&t.parentNode;return e===l||!(!l||1!==l.nodeType||!(n.contains?n.contains(l):e.compareDocumentPosition&&16&e.compareDocumentPosition(l)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},P=t?function(e,t){if(e===t)return d=!0,0;var l=!e.compareDocumentPosition-!t.compareDocumentPosition;return l||(1&(l=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!n.sortDetached&&t.compareDocumentPosition(e)===l?e==f||e.ownerDocument==S&&_(S,e)?-1:t==f||t.ownerDocument==S&&_(S,t)?1:c?k(c,e)-k(c,t):0:4&l?-1:1)}:function(e,t){if(e===t)return d=!0,0;var n,l=0,r=e.parentNode,i=t.parentNode,o=[e],a=[t];if(!r||!i)return e==f?-1:t==f?1:r?-1:i?1:c?k(c,e)-k(c,t):0;if(r===i)return pe(e,t);for(n=e;n=n.parentNode;)o.unshift(n);for(n=t;n=n.parentNode;)a.unshift(n);for(;o[l]===a[l];)l++;return l?pe(o[l],a[l]):o[l]==S?-1:a[l]==S?1:0},f):f},ae.matches=function(e,t){return ae(e,null,null,t)},ae.matchesSelector=function(e,t){if(p(e),n.matchesSelector&&m&&!x[t+" "]&&(!g||!g.test(t))&&(!h||!h.test(t)))try{var l=E.call(e,t);if(l||n.disconnectedMatch||e.document&&11!==e.document.nodeType)return l}catch(e){x(t,!0)}return ae(t,f,null,[e]).length>0},ae.contains=function(e,t){return(e.ownerDocument||e)!=f&&p(e),_(e,t)},ae.attr=function(e,t){(e.ownerDocument||e)!=f&&p(e);var r=l.attrHandle[t.toLowerCase()],i=r&&N.call(l.attrHandle,t.toLowerCase())?r(e,t,!m):void 0;return void 0!==i?i:n.attributes||!m?e.getAttribute(t):(i=e.getAttributeNode(t))&&i.specified?i.value:null},ae.escape=function(e){return(e+"").replace(le,re)},ae.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},ae.uniqueSort=function(e){var t,l=[],r=0,i=0;if(d=!n.detectDuplicates,c=!n.sortStable&&e.slice(0),e.sort(P),d){for(;t=e[i++];)t===e[i]&&(r=l.push(i));for(;r--;)e.splice(l[r],1)}return c=null,e},r=ae.getText=function(e){var t,n="",l=0,i=e.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=r(e)}else if(3===i||4===i)return e.nodeValue}else for(;t=e[l++];)n+=r(t);return n},(l=ae.selectors={cacheLength:50,createPseudo:se,match:Y,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ne),e[3]=(e[3]||e[4]||e[5]||"").replace(te,ne),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||ae.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&ae.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return Y.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&G.test(n)&&(t=o(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ne).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=C[e+" "];return t||(t=new RegExp("(^|"+F+")"+e+"("+F+"|$)"))&&C(e,function(e){return t.test("string"==typeof e.className&&e.className||void 0!==e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(l){var r=ae.attr(l,e);return null==r?"!="===t:!t||(r+="","="===t?r===n:"!="===t?r!==n:"^="===t?n&&0===r.indexOf(n):"*="===t?n&&r.indexOf(n)>-1:"$="===t?n&&r.slice(-n.length)===n:"~="===t?(" "+r.replace(H," ")+" ").indexOf(n)>-1:"|="===t&&(r===n||r.slice(0,n.length+1)===n+"-"))}},CHILD:function(e,t,n,l,r){var i="nth"!==e.slice(0,3),o="last"!==e.slice(-4),a="of-type"===t;return 1===l&&0===r?function(e){return!!e.parentNode}:function(t,n,u){var s,c,d,p,f,v,m=i!==o?"nextSibling":"previousSibling",h=t.parentNode,g=a&&t.nodeName.toLowerCase(),E=!u&&!a,_=!1;if(h){if(i){for(;m;){for(p=t;p=p[m];)if(a?p.nodeName.toLowerCase()===g:1===p.nodeType)return!1;v=m="only"===e&&!v&&"nextSibling"}return!0}if(v=[o?h.firstChild:h.lastChild],o&&E){for(_=(f=(s=(c=(d=(p=h)[y]||(p[y]={}))[p.uniqueID]||(d[p.uniqueID]={}))[e]||[])[0]===b&&s[1])&&s[2],p=f&&h.childNodes[f];p=++f&&p&&p[m]||(_=f=0)||v.pop();)if(1===p.nodeType&&++_&&p===t){c[e]=[b,f,_];break}}else if(E&&(_=f=(s=(c=(d=(p=t)[y]||(p[y]={}))[p.uniqueID]||(d[p.uniqueID]={}))[e]||[])[0]===b&&s[1]),!1===_)for(;(p=++f&&p&&p[m]||(_=f=0)||v.pop())&&((a?p.nodeName.toLowerCase()!==g:1!==p.nodeType)||!++_||(E&&((c=(d=p[y]||(p[y]={}))[p.uniqueID]||(d[p.uniqueID]={}))[e]=[b,_]),p!==t)););return(_-=r)===l||_%l==0&&_/l>=0}}},PSEUDO:function(e,t){var n,r=l.pseudos[e]||l.setFilters[e.toLowerCase()]||ae.error("unsupported pseudo: "+e);return r[y]?r(t):r.length>1?(n=[e,e,"",t],l.setFilters.hasOwnProperty(e.toLowerCase())?se(function(e,n){for(var l,i=r(e,t),o=i.length;o--;)e[l=k(e,i[o])]=!(n[l]=i[o])}):function(e){return r(e,0,n)}):r}},pseudos:{not:se(function(e){var t=[],n=[],l=a(e.replace(W,"$1"));return l[y]?se(function(e,t,n,r){for(var i,o=l(e,null,r,[]),a=e.length;a--;)(i=o[a])&&(e[a]=!(t[a]=i))}):function(e,r,i){return t[0]=e,l(t,null,i,n),t[0]=null,!n.pop()}}),has:se(function(e){return function(t){return ae(e,t).length>0}}),contains:se(function(e){return e=e.replace(te,ne),function(t){return(t.textContent||r(t)).indexOf(e)>-1}}),lang:se(function(e){return K.test(e||"")||ae.error("unsupported lang: "+e),e=e.replace(te,ne).toLowerCase(),function(t){var n;do{if(n=m?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return(n=n.toLowerCase())===e||0===n.indexOf(e+"-")}while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===v},focus:function(e){return e===f.activeElement&&(!f.hasFocus||f.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:me(!1),disabled:me(!0),checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!l.pseudos.empty(e)},header:function(e){return Z.test(e.nodeName)},input:function(e){return X.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:he(function(){return[0]}),last:he(function(e,t){return[t-1]}),eq:he(function(e,t,n){return[n<0?n+t:n]}),even:he(function(e,t){for(var n=0;n<t;n+=2)e.push(n);return e}),odd:he(function(e,t){for(var n=1;n<t;n+=2)e.push(n);return e}),lt:he(function(e,t,n){for(var l=n<0?n+t:n>t?t:n;--l>=0;)e.push(l);return e}),gt:he(function(e,t,n){for(var l=n<0?n+t:n;++l<t;)e.push(l);return e})}}).pseudos.nth=l.pseudos.eq,{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})l.pseudos[t]=fe(t);for(t in{submit:!0,reset:!0})l.pseudos[t]=ve(t);function Ee(){}function _e(e){for(var t=0,n=e.length,l="";t<n;t++)l+=e[t].value;return l}function ye(e,t,n){var l=t.dir,r=t.next,i=r||l,o=n&&"parentNode"===i,a=T++;return t.first?function(t,n,r){for(;t=t[l];)if(1===t.nodeType||o)return e(t,n,r);return!1}:function(t,n,u){var s,c,d,p=[b,a];if(u){for(;t=t[l];)if((1===t.nodeType||o)&&e(t,n,u))return!0}else for(;t=t[l];)if(1===t.nodeType||o)if(c=(d=t[y]||(t[y]={}))[t.uniqueID]||(d[t.uniqueID]={}),r&&r===t.nodeName.toLowerCase())t=t[l]||t;else{if((s=c[i])&&s[0]===b&&s[1]===a)return p[2]=s[2];if(c[i]=p,p[2]=e(t,n,u))return!0}return!1}}function Se(e){return e.length>1?function(t,n,l){for(var r=e.length;r--;)if(!e[r](t,n,l))return!1;return!0}:e[0]}function be(e,t,n,l,r){for(var i,o=[],a=0,u=e.length,s=null!=t;a<u;a++)(i=e[a])&&(n&&!n(i,l,r)||(o.push(i),s&&t.push(a)));return o}function Te(e,t,n,l,r,i){return l&&!l[y]&&(l=Te(l)),r&&!r[y]&&(r=Te(r,i)),se(function(i,o,a,u){var s,c,d,p=[],f=[],v=o.length,m=i||function(e,t,n){for(var l=0,r=t.length;l<r;l++)ae(e,t[l],n);return n}(t||"*",a.nodeType?[a]:a,[]),h=!e||!i&&t?m:be(m,p,e,a,u),g=n?r||(i?e:v||l)?[]:o:h;if(n&&n(h,g,a,u),l)for(s=be(g,f),l(s,[],a,u),c=s.length;c--;)(d=s[c])&&(g[f[c]]=!(h[f[c]]=d));if(i){if(r||e){if(r){for(s=[],c=g.length;c--;)(d=g[c])&&s.push(h[c]=d);r(null,g=[],s,u)}for(c=g.length;c--;)(d=g[c])&&(s=r?k(i,d):p[c])>-1&&(i[s]=!(o[s]=d))}}else g=be(g===o?g.splice(v,g.length):g),r?r(null,o,g,u):O.apply(o,g)})}function Ce(e){for(var t,n,r,i=e.length,o=l.relative[e[0].type],a=o||l.relative[" "],u=o?1:0,c=ye(function(e){return e===t},a,!0),d=ye(function(e){return k(t,e)>-1},a,!0),p=[function(e,n,l){var r=!o&&(l||n!==s)||((t=n).nodeType?c(e,n,l):d(e,n,l));return t=null,r}];u<i;u++)if(n=l.relative[e[u].type])p=[ye(Se(p),n)];else{if((n=l.filter[e[u].type].apply(null,e[u].matches))[y]){for(r=++u;r<i&&!l.relative[e[r].type];r++);return Te(u>1&&Se(p),u>1&&_e(e.slice(0,u-1).concat({value:" "===e[u-2].type?"*":""})).replace(W,"$1"),n,u<r&&Ce(e.slice(u,r)),r<i&&Ce(e=e.slice(r)),r<i&&_e(e))}p.push(n)}return Se(p)}return Ee.prototype=l.filters=l.pseudos,l.setFilters=new Ee,o=ae.tokenize=function(e,t){var n,r,i,o,a,u,s,c=A[e+" "];if(c)return t?0:c.slice(0);for(a=e,u=[],s=l.preFilter;a;){for(o in n&&!(r=z.exec(a))||(r&&(a=a.slice(r[0].length)||a),u.push(i=[])),n=!1,(r=V.exec(a))&&(n=r.shift(),i.push({value:n,type:r[0].replace(W," ")}),a=a.slice(n.length)),l.filter)!(r=Y[o].exec(a))||s[o]&&!(r=s[o](r))||(n=r.shift(),i.push({value:n,type:o,matches:r}),a=a.slice(n.length));if(!n)break}return t?a.length:a?ae.error(e):A(e,u).slice(0)},a=ae.compile=function(e,t){var n,r=[],i=[],a=D[e+" "];if(!a){for(t||(t=o(e)),n=t.length;n--;)(a=Ce(t[n]))[y]?r.push(a):i.push(a);(a=D(e,function(e,t){var n=t.length>0,r=e.length>0,i=function(i,o,a,u,c){var d,v,h,g=0,E="0",_=i&&[],y=[],S=s,T=i||r&&l.find.TAG("*",c),C=b+=null==S?1:Math.random()||.1,A=T.length;for(c&&(s=o==f||o||c);E!==A&&null!=(d=T[E]);E++){if(r&&d){for(v=0,o||d.ownerDocument==f||(p(d),a=!m);h=e[v++];)if(h(d,o||f,a)){u.push(d);break}c&&(b=C)}n&&((d=!h&&d)&&g--,i&&_.push(d))}if(g+=E,n&&E!==g){for(v=0;h=t[v++];)h(_,y,o,a);if(i){if(g>0)for(;E--;)_[E]||y[E]||(y[E]=R.call(u));y=be(y)}O.apply(u,y),c&&!i&&y.length>0&&g+t.length>1&&ae.uniqueSort(u)}return c&&(b=C,s=S),_};return n?se(i):i}(i,r))).selector=e}return a},u=ae.select=function(e,t,n,r){var i,u,s,c,d,p="function"==typeof e&&e,f=!r&&o(e=p.selector||e);if(n=n||[],1===f.length){if((u=f[0]=f[0].slice(0)).length>2&&"ID"===(s=u[0]).type&&9===t.nodeType&&m&&l.relative[u[1].type]){if(!(t=(l.find.ID(s.matches[0].replace(te,ne),t)||[])[0]))return n;p&&(t=t.parentNode),e=e.slice(u.shift().value.length)}for(i=Y.needsContext.test(e)?0:u.length;i--&&!l.relative[c=(s=u[i]).type];)if((d=l.find[c])&&(r=d(s.matches[0].replace(te,ne),ee.test(u[0].type)&&ge(t.parentNode)||t))){if(u.splice(i,1),!(e=r.length&&_e(u)))return O.apply(n,r),n;break}}return(p||a(e,f))(r,t,!m,n,!t||ee.test(e)&&ge(t.parentNode)||t),n},n.sortStable=y.split("").sort(P).join("")===y,n.detectDuplicates=!!d,p(),n.sortDetached=ce(function(e){return 1&e.compareDocumentPosition(f.createElement("fieldset"))}),ce(function(e){return e.innerHTML="<a href='#'></a>","#"===e.firstChild.getAttribute("href")})||de("type|href|height|width",function(e,t,n){if(!n)return e.getAttribute(t,"type"===t.toLowerCase()?1:2)}),n.attributes&&ce(function(e){return e.innerHTML="<input/>",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||de("value",function(e,t,n){if(!n&&"input"===e.nodeName.toLowerCase())return e.defaultValue}),ce(function(e){return null==e.getAttribute("disabled")})||de(M,function(e,t,n){var l;if(!n)return!0===e[t]?t.toLowerCase():(l=e.getAttributeNode(t))&&l.specified?l.value:null}),ae}(e);y.find=b,y.expr=b.selectors,y.expr[":"]=y.expr.pseudos,y.uniqueSort=y.unique=b.uniqueSort,y.text=b.getText,y.isXMLDoc=b.isXML,y.contains=b.contains,y.escapeSelector=b.escape;var T=function(e,t,n){for(var l=[],r=void 0!==n;(e=e[t])&&9!==e.nodeType;)if(1===e.nodeType){if(r&&y(e).is(n))break;l.push(e)}return l},C=function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n},A=y.expr.match.needsContext;function D(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()}var x=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function P(e,t,n){return v(t)?y.grep(e,function(e,l){return!!t.call(e,l,e)!==n}):t.nodeType?y.grep(e,function(e){return e===t!==n}):"string"!=typeof t?y.grep(e,function(e){return a.call(t,e)>-1!==n}):y.filter(t,e,n)}y.filter=function(e,t,n){var l=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===l.nodeType?y.find.matchesSelector(l,e)?[l]:[]:y.find.matches(e,y.grep(t,function(e){return 1===e.nodeType}))},y.fn.extend({find:function(e){var t,n,l=this.length,r=this;if("string"!=typeof e)return this.pushStack(y(e).filter(function(){for(t=0;t<l;t++)if(y.contains(r[t],this))return!0}));for(n=this.pushStack([]),t=0;t<l;t++)y.find(e,r[t],n);return l>1?y.uniqueSort(n):n},filter:function(e){return this.pushStack(P(this,e||[],!1))},not:function(e){return this.pushStack(P(this,e||[],!0))},is:function(e){return!!P(this,"string"==typeof e&&A.test(e)?y(e):e||[],!1).length}});var N,w=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(y.fn.init=function(e,t,n){var l,r;if(!e)return this;if(n=n||N,"string"==typeof e){if(!(l="<"===e[0]&&">"===e[e.length-1]&&e.length>=3?[null,e,null]:w.exec(e))||!l[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(l[1]){if(y.merge(this,y.parseHTML(l[1],(t=t instanceof y?t[0]:t)&&t.nodeType?t.ownerDocument||t:h,!0)),x.test(l[1])&&y.isPlainObject(t))for(l in t)v(this[l])?this[l](t[l]):this.attr(l,t[l]);return this}return(r=h.getElementById(l[2]))&&(this[0]=r,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):v(e)?void 0!==n.ready?n.ready(e):e(y):y.makeArray(e,this)}).prototype=y.fn,N=y(h);var R=/^(?:parents|prev(?:Until|All))/,I={children:!0,contents:!0,next:!0,prev:!0};function O(e,t){for(;(e=e[t])&&1!==e.nodeType;);return e}y.fn.extend({has:function(e){var t=y(e,this),n=t.length;return this.filter(function(){for(var e=0;e<n;e++)if(y.contains(this,t[e]))return!0})},closest:function(e,t){var n,l=0,r=this.length,i=[],o="string"!=typeof e&&y(e);if(!A.test(e))for(;l<r;l++)for(n=this[l];n&&n!==t;n=n.parentNode)if(n.nodeType<11&&(o?o.index(n)>-1:1===n.nodeType&&y.find.matchesSelector(n,e))){i.push(n);break}return this.pushStack(i.length>1?y.uniqueSort(i):i)},index:function(e){return e?"string"==typeof e?a.call(y(e),this[0]):a.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(y.uniqueSort(y.merge(this.get(),y(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),y.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return T(e,"parentNode")},parentsUntil:function(e,t,n){return T(e,"parentNode",n)},next:function(e){return O(e,"nextSibling")},prev:function(e){return O(e,"previousSibling")},nextAll:function(e){return T(e,"nextSibling")},prevAll:function(e){return T(e,"previousSibling")},nextUntil:function(e,t,n){return T(e,"nextSibling",n)},prevUntil:function(e,t,n){return T(e,"previousSibling",n)},siblings:function(e){return C((e.parentNode||{}).firstChild,e)},children:function(e){return C(e.firstChild)},contents:function(e){return null!=e.contentDocument&&l(e.contentDocument)?e.contentDocument:(D(e,"template")&&(e=e.content||e),y.merge([],e.childNodes))}},function(e,t){y.fn[e]=function(n,l){var r=y.map(this,t,n);return"Until"!==e.slice(-5)&&(l=n),l&&"string"==typeof l&&(r=y.filter(l,r)),this.length>1&&(I[e]||y.uniqueSort(r),R.test(e)&&r.reverse()),this.pushStack(r)}});var L=/[^\x20\t\r\n\f]+/g;function k(e){return e}function M(e){throw e}function F(e,t,n,l){var r;try{e&&v(r=e.promise)?r.call(e).done(t).fail(n):e&&v(r=e.then)?r.call(e,t,n):t.apply(void 0,[e].slice(l))}catch(e){n.apply(void 0,[e])}}y.Callbacks=function(e){e="string"==typeof e?function(e){var t={};return y.each(e.match(L)||[],function(e,n){t[n]=!0}),t}(e):y.extend({},e);var t,n,l,r,i=[],o=[],a=-1,u=function(){for(r=r||e.once,l=t=!0;o.length;a=-1)for(n=o.shift();++a<i.length;)!1===i[a].apply(n[0],n[1])&&e.stopOnFalse&&(a=i.length,n=!1);e.memory||(n=!1),t=!1,r&&(i=n?[]:"")},s={add:function(){return i&&(n&&!t&&(a=i.length-1,o.push(n)),function t(n){y.each(n,function(n,l){v(l)?e.unique&&s.has(l)||i.push(l):l&&l.length&&"string"!==_(l)&&t(l)})}(arguments),n&&!t&&u()),this},remove:function(){return y.each(arguments,function(e,t){for(var n;(n=y.inArray(t,i,n))>-1;)i.splice(n,1),n<=a&&a--}),this},has:function(e){return e?y.inArray(e,i)>-1:i.length>0},empty:function(){return i&&(i=[]),this},disable:function(){return r=o=[],i=n="",this},disabled:function(){return!i},lock:function(){return r=o=[],n||t||(i=n=""),this},locked:function(){return!!r},fireWith:function(e,n){return r||(n=[e,(n=n||[]).slice?n.slice():n],o.push(n),t||u()),this},fire:function(){return s.fireWith(this,arguments),this},fired:function(){return!!l}};return s},y.extend({Deferred:function(t){var n=[["notify","progress",y.Callbacks("memory"),y.Callbacks("memory"),2],["resolve","done",y.Callbacks("once memory"),y.Callbacks("once memory"),0,"resolved"],["reject","fail",y.Callbacks("once memory"),y.Callbacks("once memory"),1,"rejected"]],l="pending",r={state:function(){return l},always:function(){return i.done(arguments).fail(arguments),this},catch:function(e){return r.then(null,e)},pipe:function(){var e=arguments;return y.Deferred(function(t){y.each(n,function(n,l){var r=v(e[l[4]])&&e[l[4]];i[l[1]](function(){var e=r&&r.apply(this,arguments);e&&v(e.promise)?e.promise().progress(t.notify).done(t.resolve).fail(t.reject):t[l[0]+"With"](this,r?[e]:arguments)})}),e=null}).promise()},then:function(t,l,r){var i=0;function o(t,n,l,r){return function(){var a=this,u=arguments,s=function(){var e,s;if(!(t<i)){if((e=l.apply(a,u))===n.promise())throw new TypeError("Thenable self-resolution");v(s=e&&("object"==typeof e||"function"==typeof e)&&e.then)?r?s.call(e,o(i,n,k,r),o(i,n,M,r)):(i++,s.call(e,o(i,n,k,r),o(i,n,M,r),o(i,n,k,n.notifyWith))):(l!==k&&(a=void 0,u=[e]),(r||n.resolveWith)(a,u))}},c=r?s:function(){try{s()}catch(e){y.Deferred.exceptionHook&&y.Deferred.exceptionHook(e,c.stackTrace),t+1>=i&&(l!==M&&(a=void 0,u=[e]),n.rejectWith(a,u))}};t?c():(y.Deferred.getStackHook&&(c.stackTrace=y.Deferred.getStackHook()),e.setTimeout(c))}}return y.Deferred(function(e){n[0][3].add(o(0,e,v(r)?r:k,e.notifyWith)),n[1][3].add(o(0,e,v(t)?t:k)),n[2][3].add(o(0,e,v(l)?l:M))}).promise()},promise:function(e){return null!=e?y.extend(e,r):r}},i={};return y.each(n,function(e,t){var o=t[2],a=t[5];r[t[1]]=o.add,a&&o.add(function(){l=a},n[3-e][2].disable,n[3-e][3].disable,n[0][2].lock,n[0][3].lock),o.add(t[3].fire),i[t[0]]=function(){return i[t[0]+"With"](this===i?void 0:this,arguments),this},i[t[0]+"With"]=o.fireWith}),r.promise(i),t&&t.call(i,i),i},when:function(e){var t=arguments.length,n=t,l=Array(n),i=r.call(arguments),o=y.Deferred(),a=function(e){return function(n){l[e]=this,i[e]=arguments.length>1?r.call(arguments):n,--t||o.resolveWith(l,i)}};if(t<=1&&(F(e,o.done(a(n)).resolve,o.reject,!t),"pending"===o.state()||v(i[n]&&i[n].then)))return o.then();for(;n--;)F(i[n],a(n),o.reject);return o.promise()}});var B=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;y.Deferred.exceptionHook=function(t,n){e.console&&e.console.warn&&t&&B.test(t.name)&&e.console.warn("jQuery.Deferred exception: "+t.message,t.stack,n)},y.readyException=function(t){e.setTimeout(function(){throw t})};var U=y.Deferred();function j(){h.removeEventListener("DOMContentLoaded",j),e.removeEventListener("load",j),y.ready()}y.fn.ready=function(e){return U.then(e).catch(function(e){y.readyException(e)}),this},y.extend({isReady:!1,readyWait:1,ready:function(e){(!0===e?--y.readyWait:y.isReady)||(y.isReady=!0,!0!==e&&--y.readyWait>0||U.resolveWith(h,[y]))}}),y.ready.then=U.then,"complete"===h.readyState||"loading"!==h.readyState&&!h.documentElement.doScroll?e.setTimeout(y.ready):(h.addEventListener("DOMContentLoaded",j),e.addEventListener("load",j));var H=function(e,t,n,l,r,i,o){var a=0,u=e.length,s=null==n;if("object"===_(n))for(a in r=!0,n)H(e,t,a,n[a],!0,i,o);else if(void 0!==l&&(r=!0,v(l)||(o=!0),s&&(o?(t.call(e,l),t=null):(s=t,t=function(e,t,n){return s.call(y(e),n)})),t))for(;a<u;a++)t(e[a],n,o?l:l.call(e[a],a,t(e[a],n)));return r?e:s?t.call(e):u?t(e[0],n):i},W=/^-ms-/,z=/-([a-z])/g;function V(e,t){return t.toUpperCase()}function q(e){return e.replace(W,"ms-").replace(z,V)}var G=function(e){return 1===e.nodeType||9===e.nodeType||!+e.nodeType};function K(){this.expando=y.expando+K.uid++}K.uid=1,K.prototype={cache:function(e){var t=e[this.expando];return t||(t={},G(e)&&(e.nodeType?e[this.expando]=t:Object.defineProperty(e,this.expando,{value:t,configurable:!0}))),t},set:function(e,t,n){var l,r=this.cache(e);if("string"==typeof t)r[q(t)]=n;else for(l in t)r[q(l)]=t[l];return r},get:function(e,t){return void 0===t?this.cache(e):e[this.expando]&&e[this.expando][q(t)]},access:function(e,t,n){return void 0===t||t&&"string"==typeof t&&void 0===n?this.get(e,t):(this.set(e,t,n),void 0!==n?n:t)},remove:function(e,t){var n,l=e[this.expando];if(void 0!==l){if(void 0!==t){n=(t=Array.isArray(t)?t.map(q):(t=q(t))in l?[t]:t.match(L)||[]).length;for(;n--;)delete l[t[n]]}(void 0===t||y.isEmptyObject(l))&&(e.nodeType?e[this.expando]=void 0:delete e[this.expando])}},hasData:function(e){var t=e[this.expando];return void 0!==t&&!y.isEmptyObject(t)}};var Y=new K,$=new K,X=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,Z=/[A-Z]/g;function J(e,t,n){var l;if(void 0===n&&1===e.nodeType)if(l="data-"+t.replace(Z,"-$&").toLowerCase(),"string"==typeof(n=e.getAttribute(l))){try{n=function(e){return"true"===e||"false"!==e&&("null"===e?null:e===+e+""?+e:X.test(e)?JSON.parse(e):e)}(n)}catch(e){}$.set(e,t,n)}else n=void 0;return n}y.extend({hasData:function(e){return $.hasData(e)||Y.hasData(e)},data:function(e,t,n){return $.access(e,t,n)},removeData:function(e,t){$.remove(e,t)},_data:function(e,t,n){return Y.access(e,t,n)},_removeData:function(e,t){Y.remove(e,t)}}),y.fn.extend({data:function(e,t){var n,l,r,i=this[0],o=i&&i.attributes;if(void 0===e){if(this.length&&(r=$.get(i),1===i.nodeType&&!Y.get(i,"hasDataAttrs"))){for(n=o.length;n--;)o[n]&&0===(l=o[n].name).indexOf("data-")&&(l=q(l.slice(5)),J(i,l,r[l]));Y.set(i,"hasDataAttrs",!0)}return r}return"object"==typeof e?this.each(function(){$.set(this,e)}):H(this,function(t){var n;if(i&&void 0===t)return void 0!==(n=$.get(i,e))||void 0!==(n=J(i,e))?n:void 0;this.each(function(){$.set(this,e,t)})},null,t,arguments.length>1,null,!0)},removeData:function(e){return this.each(function(){$.remove(this,e)})}}),y.extend({queue:function(e,t,n){var l;if(e)return l=Y.get(e,t=(t||"fx")+"queue"),n&&(!l||Array.isArray(n)?l=Y.access(e,t,y.makeArray(n)):l.push(n)),l||[]},dequeue:function(e,t){var n=y.queue(e,t=t||"fx"),l=n.length,r=n.shift(),i=y._queueHooks(e,t);"inprogress"===r&&(r=n.shift(),l--),r&&("fx"===t&&n.unshift("inprogress"),delete i.stop,r.call(e,function(){y.dequeue(e,t)},i)),!l&&i&&i.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return Y.get(e,n)||Y.access(e,n,{empty:y.Callbacks("once memory").add(function(){Y.remove(e,[t+"queue",n])})})}}),y.fn.extend({queue:function(e,t){var n=2;return"string"!=typeof e&&(t=e,e="fx",n--),arguments.length<n?y.queue(this[0],e):void 0===t?this:this.each(function(){var n=y.queue(this,e,t);y._queueHooks(this,e),"fx"===e&&"inprogress"!==n[0]&&y.dequeue(this,e)})},dequeue:function(e){return this.each(function(){y.dequeue(this,e)})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,t){var n,l=1,r=y.Deferred(),i=this,o=this.length,a=function(){--l||r.resolveWith(i,[i])};for("string"!=typeof e&&(t=e,e=void 0),e=e||"fx";o--;)(n=Y.get(i[o],e+"queueHooks"))&&n.empty&&(l++,n.empty.add(a));return a(),r.promise(t)}});var Q=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,ee=new RegExp("^(?:([+-])=|)("+Q+")([a-z%]*)$","i"),te=["Top","Right","Bottom","Left"],ne=h.documentElement,le=function(e){return y.contains(e.ownerDocument,e)},re={composed:!0};ne.getRootNode&&(le=function(e){return y.contains(e.ownerDocument,e)||e.getRootNode(re)===e.ownerDocument});var ie=function(e,t){return"none"===(e=t||e).style.display||""===e.style.display&&le(e)&&"none"===y.css(e,"display")};function oe(e,t,n,l){var r,i,o=20,a=l?function(){return l.cur()}:function(){return y.css(e,t,"")},u=a(),s=n&&n[3]||(y.cssNumber[t]?"":"px"),c=e.nodeType&&(y.cssNumber[t]||"px"!==s&&+u)&&ee.exec(y.css(e,t));if(c&&c[3]!==s){for(s=s||c[3],c=+(u/=2)||1;o--;)y.style(e,t,c+s),(1-i)*(1-(i=a()/u||.5))<=0&&(o=0),c/=i;y.style(e,t,(c*=2)+s),n=n||[]}return n&&(c=+c||+u||0,r=n[1]?c+(n[1]+1)*n[2]:+n[2],l&&(l.unit=s,l.start=c,l.end=r)),r}var ae={};function ue(e){var t,n=e.ownerDocument,l=e.nodeName,r=ae[l];return r||(t=n.body.appendChild(n.createElement(l)),r=y.css(t,"display"),t.parentNode.removeChild(t),"none"===r&&(r="block"),ae[l]=r,r)}function se(e,t){for(var n,l,r=[],i=0,o=e.length;i<o;i++)(l=e[i]).style&&(n=l.style.display,t?("none"===n&&(r[i]=Y.get(l,"display")||null,r[i]||(l.style.display="")),""===l.style.display&&ie(l)&&(r[i]=ue(l))):"none"!==n&&(r[i]="none",Y.set(l,"display",n)));for(i=0;i<o;i++)null!=r[i]&&(e[i].style.display=r[i]);return e}y.fn.extend({show:function(){return se(this,!0)},hide:function(){return se(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each(function(){ie(this)?y(this).show():y(this).hide()})}});var ce,de,pe=/^(?:checkbox|radio)$/i,fe=/<([a-z][^\/\0>\x20\t\r\n\f]*)/i,ve=/^$|^module$|\/(?:java|ecma)script/i;ce=h.createDocumentFragment().appendChild(h.createElement("div")),(de=h.createElement("input")).setAttribute("type","radio"),de.setAttribute("checked","checked"),de.setAttribute("name","t"),ce.appendChild(de),f.checkClone=ce.cloneNode(!0).cloneNode(!0).lastChild.checked,ce.innerHTML="<textarea>x</textarea>",f.noCloneChecked=!!ce.cloneNode(!0).lastChild.defaultValue,ce.innerHTML="<option></option>",f.option=!!ce.lastChild;var me={thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};function he(e,t){var n;return n=void 0!==e.getElementsByTagName?e.getElementsByTagName(t||"*"):void 0!==e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&D(e,t)?y.merge([e],n):n}function ge(e,t){for(var n=0,l=e.length;n<l;n++)Y.set(e[n],"globalEval",!t||Y.get(t[n],"globalEval"))}me.tbody=me.tfoot=me.colgroup=me.caption=me.thead,me.th=me.td,f.option||(me.optgroup=me.option=[1,"<select multiple='multiple'>","</select>"]);var Ee=/<|&#?\w+;/;function _e(e,t,n,l,r){for(var i,o,a,u,s,c,d=t.createDocumentFragment(),p=[],f=0,v=e.length;f<v;f++)if((i=e[f])||0===i)if("object"===_(i))y.merge(p,i.nodeType?[i]:i);else if(Ee.test(i)){for(o=o||d.appendChild(t.createElement("div")),a=(fe.exec(i)||["",""])[1].toLowerCase(),o.innerHTML=(u=me[a]||me._default)[1]+y.htmlPrefilter(i)+u[2],c=u[0];c--;)o=o.lastChild;y.merge(p,o.childNodes),(o=d.firstChild).textContent=""}else p.push(t.createTextNode(i));for(d.textContent="",f=0;i=p[f++];)if(l&&y.inArray(i,l)>-1)r&&r.push(i);else if(s=le(i),o=he(d.appendChild(i),"script"),s&&ge(o),n)for(c=0;i=o[c++];)ve.test(i.type||"")&&n.push(i);return d}var ye=/^([^.]*)(?:\.(.+)|)/;function Se(){return!0}function be(){return!1}function Te(e,t){return e===function(){try{return h.activeElement}catch(e){}}()==("focus"===t)}function Ce(e,t,n,l,r,i){var o,a;if("object"==typeof t){for(a in"string"!=typeof n&&(l=l||n,n=void 0),t)Ce(e,a,n,l,t[a],i);return e}if(null==l&&null==r?(r=n,l=n=void 0):null==r&&("string"==typeof n?(r=l,l=void 0):(r=l,l=n,n=void 0)),!1===r)r=be;else if(!r)return e;return 1===i&&(o=r,(r=function(e){return y().off(e),o.apply(this,arguments)}).guid=o.guid||(o.guid=y.guid++)),e.each(function(){y.event.add(this,t,r,l,n)})}function Ae(e,t,n){n?(Y.set(e,t,!1),y.event.add(e,t,{namespace:!1,handler:function(e){var l,i,o=Y.get(this,t);if(1&e.isTrigger&&this[t]){if(o.length)(y.event.special[t]||{}).delegateType&&e.stopPropagation();else if(o=r.call(arguments),Y.set(this,t,o),l=n(this,t),this[t](),o!==(i=Y.get(this,t))||l?Y.set(this,t,!1):i={},o!==i)return e.stopImmediatePropagation(),e.preventDefault(),i&&i.value}else o.length&&(Y.set(this,t,{value:y.event.trigger(y.extend(o[0],y.Event.prototype),o.slice(1),this)}),e.stopImmediatePropagation())}})):void 0===Y.get(e,t)&&y.event.add(e,t,Se)}y.event={global:{},add:function(e,t,n,l,r){var i,o,a,u,s,c,d,p,f,v,m,h=Y.get(e);if(G(e))for(n.handler&&(n=(i=n).handler,r=i.selector),r&&y.find.matchesSelector(ne,r),n.guid||(n.guid=y.guid++),(u=h.events)||(u=h.events=Object.create(null)),(o=h.handle)||(o=h.handle=function(t){return void 0!==y&&y.event.triggered!==t.type?y.event.dispatch.apply(e,arguments):void 0}),s=(t=(t||"").match(L)||[""]).length;s--;)f=m=(a=ye.exec(t[s])||[])[1],v=(a[2]||"").split(".").sort(),f&&(d=y.event.special[f]||{},d=y.event.special[f=(r?d.delegateType:d.bindType)||f]||{},c=y.extend({type:f,origType:m,data:l,handler:n,guid:n.guid,selector:r,needsContext:r&&y.expr.match.needsContext.test(r),namespace:v.join(".")},i),(p=u[f])||((p=u[f]=[]).delegateCount=0,d.setup&&!1!==d.setup.call(e,l,v,o)||e.addEventListener&&e.addEventListener(f,o)),d.add&&(d.add.call(e,c),c.handler.guid||(c.handler.guid=n.guid)),r?p.splice(p.delegateCount++,0,c):p.push(c),y.event.global[f]=!0)},remove:function(e,t,n,l,r){var i,o,a,u,s,c,d,p,f,v,m,h=Y.hasData(e)&&Y.get(e);if(h&&(u=h.events)){for(s=(t=(t||"").match(L)||[""]).length;s--;)if(f=m=(a=ye.exec(t[s])||[])[1],v=(a[2]||"").split(".").sort(),f){for(d=y.event.special[f]||{},p=u[f=(l?d.delegateType:d.bindType)||f]||[],a=a[2]&&new RegExp("(^|\\.)"+v.join("\\.(?:.*\\.|)")+"(\\.|$)"),o=i=p.length;i--;)c=p[i],!r&&m!==c.origType||n&&n.guid!==c.guid||a&&!a.test(c.namespace)||l&&l!==c.selector&&("**"!==l||!c.selector)||(p.splice(i,1),c.selector&&p.delegateCount--,d.remove&&d.remove.call(e,c));o&&!p.length&&(d.teardown&&!1!==d.teardown.call(e,v,h.handle)||y.removeEvent(e,f,h.handle),delete u[f])}else for(f in u)y.event.remove(e,f+t[s],n,l,!0);y.isEmptyObject(u)&&Y.remove(e,"handle events")}},dispatch:function(e){var t,n,l,r,i,o,a=new Array(arguments.length),u=y.event.fix(e),s=(Y.get(this,"events")||Object.create(null))[u.type]||[],c=y.event.special[u.type]||{};for(a[0]=u,t=1;t<arguments.length;t++)a[t]=arguments[t];if(u.delegateTarget=this,!c.preDispatch||!1!==c.preDispatch.call(this,u)){for(o=y.event.handlers.call(this,u,s),t=0;(r=o[t++])&&!u.isPropagationStopped();)for(u.currentTarget=r.elem,n=0;(i=r.handlers[n++])&&!u.isImmediatePropagationStopped();)u.rnamespace&&!1!==i.namespace&&!u.rnamespace.test(i.namespace)||(u.handleObj=i,u.data=i.data,void 0!==(l=((y.event.special[i.origType]||{}).handle||i.handler).apply(r.elem,a))&&!1===(u.result=l)&&(u.preventDefault(),u.stopPropagation()));return c.postDispatch&&c.postDispatch.call(this,u),u.result}},handlers:function(e,t){var n,l,r,i,o,a=[],u=t.delegateCount,s=e.target;if(u&&s.nodeType&&!("click"===e.type&&e.button>=1))for(;s!==this;s=s.parentNode||this)if(1===s.nodeType&&("click"!==e.type||!0!==s.disabled)){for(i=[],o={},n=0;n<u;n++)void 0===o[r=(l=t[n]).selector+" "]&&(o[r]=l.needsContext?y(r,this).index(s)>-1:y.find(r,this,null,[s]).length),o[r]&&i.push(l);i.length&&a.push({elem:s,handlers:i})}return s=this,u<t.length&&a.push({elem:s,handlers:t.slice(u)}),a},addProp:function(e,t){Object.defineProperty(y.Event.prototype,e,{enumerable:!0,configurable:!0,get:v(t)?function(){if(this.originalEvent)return t(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[e]},set:function(t){Object.defineProperty(this,e,{enumerable:!0,configurable:!0,writable:!0,value:t})}})},fix:function(e){return e[y.expando]?e:new y.Event(e)},special:{load:{noBubble:!0},click:{setup:function(e){var t=this||e;return pe.test(t.type)&&t.click&&D(t,"input")&&Ae(t,"click",Se),!1},trigger:function(e){var t=this||e;return pe.test(t.type)&&t.click&&D(t,"input")&&Ae(t,"click"),!0},_default:function(e){var t=e.target;return pe.test(t.type)&&t.click&&D(t,"input")&&Y.get(t,"click")||D(t,"a")}},beforeunload:{postDispatch:function(e){void 0!==e.result&&e.originalEvent&&(e.originalEvent.returnValue=e.result)}}}},y.removeEvent=function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n)},y.Event=function(e,t){if(!(this instanceof y.Event))return new y.Event(e,t);e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||void 0===e.defaultPrevented&&!1===e.returnValue?Se:be,this.target=e.target&&3===e.target.nodeType?e.target.parentNode:e.target,this.currentTarget=e.currentTarget,this.relatedTarget=e.relatedTarget):this.type=e,t&&y.extend(this,t),this.timeStamp=e&&e.timeStamp||Date.now(),this[y.expando]=!0},y.Event.prototype={constructor:y.Event,isDefaultPrevented:be,isPropagationStopped:be,isImmediatePropagationStopped:be,isSimulated:!1,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=Se,e&&!this.isSimulated&&e.preventDefault()},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=Se,e&&!this.isSimulated&&e.stopPropagation()},stopImmediatePropagation:function(){var e=this.originalEvent;this.isImmediatePropagationStopped=Se,e&&!this.isSimulated&&e.stopImmediatePropagation(),this.stopPropagation()}},y.each({altKey:!0,bubbles:!0,cancelable:!0,changedTouches:!0,ctrlKey:!0,detail:!0,eventPhase:!0,metaKey:!0,pageX:!0,pageY:!0,shiftKey:!0,view:!0,char:!0,code:!0,charCode:!0,key:!0,keyCode:!0,button:!0,buttons:!0,clientX:!0,clientY:!0,offsetX:!0,offsetY:!0,pointerId:!0,pointerType:!0,screenX:!0,screenY:!0,targetTouches:!0,toElement:!0,touches:!0,which:!0},y.event.addProp),y.each({focus:"focusin",blur:"focusout"},function(e,t){y.event.special[e]={setup:function(){return Ae(this,e,Te),!1},trigger:function(){return Ae(this,e),!0},_default:function(){return!0},delegateType:t}}),y.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(e,t){y.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,l=this,r=e.relatedTarget,i=e.handleObj;return r&&(r===l||y.contains(l,r))||(e.type=i.origType,n=i.handler.apply(this,arguments),e.type=t),n}}}),y.fn.extend({on:function(e,t,n,l){return Ce(this,e,t,n,l)},one:function(e,t,n,l){return Ce(this,e,t,n,l,1)},off:function(e,t,n){var l,r;if(e&&e.preventDefault&&e.handleObj)return l=e.handleObj,y(e.delegateTarget).off(l.namespace?l.origType+"."+l.namespace:l.origType,l.selector,l.handler),this;if("object"==typeof e){for(r in e)this.off(r,t,e[r]);return this}return!1!==t&&"function"!=typeof t||(n=t,t=void 0),!1===n&&(n=be),this.each(function(){y.event.remove(this,e,n,t)})}});var De=/<script|<style|<link/i,xe=/checked\s*(?:[^=]|=\s*.checked.)/i,Pe=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;function Ne(e,t){return D(e,"table")&&D(11!==t.nodeType?t:t.firstChild,"tr")&&y(e).children("tbody")[0]||e}function we(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function Re(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Ie(e,t){var n,l,r,i,o,a;if(1===t.nodeType){if(Y.hasData(e)&&(a=Y.get(e).events))for(r in Y.remove(t,"handle events"),a)for(n=0,l=a[r].length;n<l;n++)y.event.add(t,r,a[r][n]);$.hasData(e)&&(i=$.access(e),o=y.extend({},i),$.set(t,o))}}function Oe(e,t){var n=t.nodeName.toLowerCase();"input"===n&&pe.test(e.type)?t.checked=e.checked:"input"!==n&&"textarea"!==n||(t.defaultValue=e.defaultValue)}function Le(e,t,n,l){t=i(t);var r,o,a,u,s,c,d=0,p=e.length,m=p-1,h=t[0],g=v(h);if(g||p>1&&"string"==typeof h&&!f.checkClone&&xe.test(h))return e.each(function(r){var i=e.eq(r);g&&(t[0]=h.call(this,r,i.html())),Le(i,t,n,l)});if(p&&(o=(r=_e(t,e[0].ownerDocument,!1,e,l)).firstChild,1===r.childNodes.length&&(r=o),o||l)){for(u=(a=y.map(he(r,"script"),we)).length;d<p;d++)s=r,d!==m&&(s=y.clone(s,!0,!0),u&&y.merge(a,he(s,"script"))),n.call(e[d],s,d);if(u)for(c=a[a.length-1].ownerDocument,y.map(a,Re),d=0;d<u;d++)ve.test((s=a[d]).type||"")&&!Y.access(s,"globalEval")&&y.contains(c,s)&&(s.src&&"module"!==(s.type||"").toLowerCase()?y._evalUrl&&!s.noModule&&y._evalUrl(s.src,{nonce:s.nonce||s.getAttribute("nonce")},c):E(s.textContent.replace(Pe,""),s,c))}return e}function ke(e,t,n){for(var l,r=t?y.filter(t,e):e,i=0;null!=(l=r[i]);i++)n||1!==l.nodeType||y.cleanData(he(l)),l.parentNode&&(n&&le(l)&&ge(he(l,"script")),l.parentNode.removeChild(l));return e}y.extend({htmlPrefilter:function(e){return e},clone:function(e,t,n){var l,r,i,o,a=e.cloneNode(!0),u=le(e);if(!(f.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||y.isXMLDoc(e)))for(o=he(a),l=0,r=(i=he(e)).length;l<r;l++)Oe(i[l],o[l]);if(t)if(n)for(i=i||he(e),o=o||he(a),l=0,r=i.length;l<r;l++)Ie(i[l],o[l]);else Ie(e,a);return(o=he(a,"script")).length>0&&ge(o,!u&&he(e,"script")),a},cleanData:function(e){for(var t,n,l,r=y.event.special,i=0;void 0!==(n=e[i]);i++)if(G(n)){if(t=n[Y.expando]){if(t.events)for(l in t.events)r[l]?y.event.remove(n,l):y.removeEvent(n,l,t.handle);n[Y.expando]=void 0}n[$.expando]&&(n[$.expando]=void 0)}}}),y.fn.extend({detach:function(e){return ke(this,e,!0)},remove:function(e){return ke(this,e)},text:function(e){return H(this,function(e){return void 0===e?y.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=e)})},null,e,arguments.length)},append:function(){return Le(this,arguments,function(e){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||Ne(this,e).appendChild(e)})},prepend:function(){return Le(this,arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=Ne(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return Le(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return Le(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)1===e.nodeType&&(y.cleanData(he(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map(function(){return y.clone(this,e,t)})},html:function(e){return H(this,function(e){var t=this[0]||{},n=0,l=this.length;if(void 0===e&&1===t.nodeType)return t.innerHTML;if("string"==typeof e&&!De.test(e)&&!me[(fe.exec(e)||["",""])[1].toLowerCase()]){e=y.htmlPrefilter(e);try{for(;n<l;n++)1===(t=this[n]||{}).nodeType&&(y.cleanData(he(t,!1)),t.innerHTML=e);t=0}catch(e){}}t&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(){var e=[];return Le(this,arguments,function(t){var n=this.parentNode;y.inArray(this,e)<0&&(y.cleanData(he(this)),n&&n.replaceChild(t,this))},e)}}),y.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){y.fn[e]=function(e){for(var n,l=[],r=y(e),i=r.length-1,a=0;a<=i;a++)n=a===i?this:this.clone(!0),y(r[a])[t](n),o.apply(l,n.get());return this.pushStack(l)}});var Me=new RegExp("^("+Q+")(?!px)[a-z%]+$","i"),Fe=function(t){var n=t.ownerDocument.defaultView;return n&&n.opener||(n=e),n.getComputedStyle(t)},Be=function(e,t,n){var l,r,i={};for(r in t)i[r]=e.style[r],e.style[r]=t[r];for(r in l=n.call(e),t)e.style[r]=i[r];return l},Ue=new RegExp(te.join("|"),"i");function je(e,t,n){var l,r,i,o,a=e.style;return(n=n||Fe(e))&&(""!==(o=n.getPropertyValue(t)||n[t])||le(e)||(o=y.style(e,t)),!f.pixelBoxStyles()&&Me.test(o)&&Ue.test(t)&&(l=a.width,r=a.minWidth,i=a.maxWidth,a.minWidth=a.maxWidth=a.width=o,o=n.width,a.width=l,a.minWidth=r,a.maxWidth=i)),void 0!==o?o+"":o}function He(e,t){return{get:function(){if(!e())return(this.get=t).apply(this,arguments);delete this.get}}}!function(){function t(){if(c){s.style.cssText="position:absolute;left:-11111px;width:60px;margin-top:1px;padding:0;border:0",c.style.cssText="position:relative;display:block;box-sizing:border-box;overflow:scroll;margin:auto;border:1px;padding:1px;width:60%;top:1%",ne.appendChild(s).appendChild(c);var t=e.getComputedStyle(c);l="1%"!==t.top,u=12===n(t.marginLeft),c.style.right="60%",o=36===n(t.right),r=36===n(t.width),c.style.position="absolute",i=12===n(c.offsetWidth/3),ne.removeChild(s),c=null}}function n(e){return Math.round(parseFloat(e))}var l,r,i,o,a,u,s=h.createElement("div"),c=h.createElement("div");c.style&&(c.style.backgroundClip="content-box",c.cloneNode(!0).style.backgroundClip="",f.clearCloneStyle="content-box"===c.style.backgroundClip,y.extend(f,{boxSizingReliable:function(){return t(),r},pixelBoxStyles:function(){return t(),o},pixelPosition:function(){return t(),l},reliableMarginLeft:function(){return t(),u},scrollboxSize:function(){return t(),i},reliableTrDimensions:function(){var t,n,l,r;return null==a&&(t=h.createElement("table"),n=h.createElement("tr"),l=h.createElement("div"),t.style.cssText="position:absolute;left:-11111px;border-collapse:separate",n.style.cssText="border:1px solid",n.style.height="1px",l.style.height="9px",l.style.display="block",ne.appendChild(t).appendChild(n).appendChild(l),r=e.getComputedStyle(n),a=parseInt(r.height,10)+parseInt(r.borderTopWidth,10)+parseInt(r.borderBottomWidth,10)===n.offsetHeight,ne.removeChild(t)),a}}))}();var We=["Webkit","Moz","ms"],ze=h.createElement("div").style,Ve={};function qe(e){return y.cssProps[e]||Ve[e]||(e in ze?e:Ve[e]=function(e){for(var t=e[0].toUpperCase()+e.slice(1),n=We.length;n--;)if((e=We[n]+t)in ze)return e}(e)||e)}var Ge=/^(none|table(?!-c[ea]).+)/,Ke=/^--/,Ye={position:"absolute",visibility:"hidden",display:"block"},$e={letterSpacing:"0",fontWeight:"400"};function Xe(e,t,n){var l=ee.exec(t);return l?Math.max(0,l[2]-(n||0))+(l[3]||"px"):t}function Ze(e,t,n,l,r,i){var o="width"===t?1:0,a=0,u=0;if(n===(l?"border":"content"))return 0;for(;o<4;o+=2)"margin"===n&&(u+=y.css(e,n+te[o],!0,r)),l?("content"===n&&(u-=y.css(e,"padding"+te[o],!0,r)),"margin"!==n&&(u-=y.css(e,"border"+te[o]+"Width",!0,r))):(u+=y.css(e,"padding"+te[o],!0,r),"padding"!==n?u+=y.css(e,"border"+te[o]+"Width",!0,r):a+=y.css(e,"border"+te[o]+"Width",!0,r));return!l&&i>=0&&(u+=Math.max(0,Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-i-u-a-.5))||0),u}function Je(e,t,n){var l=Fe(e),r=(!f.boxSizingReliable()||n)&&"border-box"===y.css(e,"boxSizing",!1,l),i=r,o=je(e,t,l),a="offset"+t[0].toUpperCase()+t.slice(1);if(Me.test(o)){if(!n)return o;o="auto"}return(!f.boxSizingReliable()&&r||!f.reliableTrDimensions()&&D(e,"tr")||"auto"===o||!parseFloat(o)&&"inline"===y.css(e,"display",!1,l))&&e.getClientRects().length&&(r="border-box"===y.css(e,"boxSizing",!1,l),(i=a in e)&&(o=e[a])),(o=parseFloat(o)||0)+Ze(e,t,n||(r?"border":"content"),i,l,o)+"px"}function Qe(e,t,n,l,r){return new Qe.prototype.init(e,t,n,l,r)}y.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=je(e,"opacity");return""===n?"1":n}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{},style:function(e,t,n,l){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var r,i,o,a=q(t),u=Ke.test(t),s=e.style;if(u||(t=qe(a)),o=y.cssHooks[t]||y.cssHooks[a],void 0===n)return o&&"get"in o&&void 0!==(r=o.get(e,!1,l))?r:s[t];"string"==(i=typeof n)&&(r=ee.exec(n))&&r[1]&&(n=oe(e,t,r),i="number"),null!=n&&n==n&&("number"!==i||u||(n+=r&&r[3]||(y.cssNumber[a]?"":"px")),f.clearCloneStyle||""!==n||0!==t.indexOf("background")||(s[t]="inherit"),o&&"set"in o&&void 0===(n=o.set(e,n,l))||(u?s.setProperty(t,n):s[t]=n))}},css:function(e,t,n,l){var r,i,o,a=q(t);return Ke.test(t)||(t=qe(a)),(o=y.cssHooks[t]||y.cssHooks[a])&&"get"in o&&(r=o.get(e,!0,n)),void 0===r&&(r=je(e,t,l)),"normal"===r&&t in $e&&(r=$e[t]),""===n||n?(i=parseFloat(r),!0===n||isFinite(i)?i||0:r):r}}),y.each(["height","width"],function(e,t){y.cssHooks[t]={get:function(e,n,l){if(n)return!Ge.test(y.css(e,"display"))||e.getClientRects().length&&e.getBoundingClientRect().width?Je(e,t,l):Be(e,Ye,function(){return Je(e,t,l)})},set:function(e,n,l){var r,i=Fe(e),o=!f.scrollboxSize()&&"absolute"===i.position,a=(o||l)&&"border-box"===y.css(e,"boxSizing",!1,i),u=l?Ze(e,t,l,a,i):0;return a&&o&&(u-=Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-parseFloat(i[t])-Ze(e,t,"border",!1,i)-.5)),u&&(r=ee.exec(n))&&"px"!==(r[3]||"px")&&(e.style[t]=n,n=y.css(e,t)),Xe(0,n,u)}}}),y.cssHooks.marginLeft=He(f.reliableMarginLeft,function(e,t){if(t)return(parseFloat(je(e,"marginLeft"))||e.getBoundingClientRect().left-Be(e,{marginLeft:0},function(){return e.getBoundingClientRect().left}))+"px"}),y.each({margin:"",padding:"",border:"Width"},function(e,t){y.cssHooks[e+t]={expand:function(n){for(var l=0,r={},i="string"==typeof n?n.split(" "):[n];l<4;l++)r[e+te[l]+t]=i[l]||i[l-2]||i[0];return r}},"margin"!==e&&(y.cssHooks[e+t].set=Xe)}),y.fn.extend({css:function(e,t){return H(this,function(e,t,n){var l,r,i={},o=0;if(Array.isArray(t)){for(l=Fe(e),r=t.length;o<r;o++)i[t[o]]=y.css(e,t[o],!1,l);return i}return void 0!==n?y.style(e,t,n):y.css(e,t)},e,t,arguments.length>1)}}),y.Tween=Qe,(Qe.prototype={constructor:Qe,init:function(e,t,n,l,r,i){this.elem=e,this.prop=n,this.easing=r||y.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=l,this.unit=i||(y.cssNumber[n]?"":"px")},cur:function(){var e=Qe.propHooks[this.prop];return e&&e.get?e.get(this):Qe.propHooks._default.get(this)},run:function(e){var t,n=Qe.propHooks[this.prop];return this.pos=t=this.options.duration?y.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):Qe.propHooks._default.set(this),this}}).init.prototype=Qe.prototype,(Qe.propHooks={_default:{get:function(e){var t;return 1!==e.elem.nodeType||null!=e.elem[e.prop]&&null==e.elem.style[e.prop]?e.elem[e.prop]:(t=y.css(e.elem,e.prop,""))&&"auto"!==t?t:0},set:function(e){y.fx.step[e.prop]?y.fx.step[e.prop](e):1!==e.elem.nodeType||!y.cssHooks[e.prop]&&null==e.elem.style[qe(e.prop)]?e.elem[e.prop]=e.now:y.style(e.elem,e.prop,e.now+e.unit)}}}).scrollTop=Qe.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},y.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"},y.fx=Qe.prototype.init,y.fx.step={};var et,tt,nt=/^(?:toggle|show|hide)$/,lt=/queueHooks$/;function rt(){tt&&(!1===h.hidden&&e.requestAnimationFrame?e.requestAnimationFrame(rt):e.setTimeout(rt,y.fx.interval),y.fx.tick())}function it(){return e.setTimeout(function(){et=void 0}),et=Date.now()}function ot(e,t){var n,l=0,r={height:e};for(t=t?1:0;l<4;l+=2-t)r["margin"+(n=te[l])]=r["padding"+n]=e;return t&&(r.opacity=r.width=e),r}function at(e,t,n){for(var l,r=(ut.tweeners[t]||[]).concat(ut.tweeners["*"]),i=0,o=r.length;i<o;i++)if(l=r[i].call(n,t,e))return l}function ut(e,t,n){var l,r,i=0,o=ut.prefilters.length,a=y.Deferred().always(function(){delete u.elem}),u=function(){if(r)return!1;for(var t=et||it(),n=Math.max(0,s.startTime+s.duration-t),l=1-(n/s.duration||0),i=0,o=s.tweens.length;i<o;i++)s.tweens[i].run(l);return a.notifyWith(e,[s,l,n]),l<1&&o?n:(o||a.notifyWith(e,[s,1,0]),a.resolveWith(e,[s]),!1)},s=a.promise({elem:e,props:y.extend({},t),opts:y.extend(!0,{specialEasing:{},easing:y.easing._default},n),originalProperties:t,originalOptions:n,startTime:et||it(),duration:n.duration,tweens:[],createTween:function(t,n){var l=y.Tween(e,s.opts,t,n,s.opts.specialEasing[t]||s.opts.easing);return s.tweens.push(l),l},stop:function(t){var n=0,l=t?s.tweens.length:0;if(r)return this;for(r=!0;n<l;n++)s.tweens[n].run(1);return t?(a.notifyWith(e,[s,1,0]),a.resolveWith(e,[s,t])):a.rejectWith(e,[s,t]),this}}),c=s.props;for(function(e,t){var n,l,r,i,o;for(n in e)if(r=t[l=q(n)],i=e[n],Array.isArray(i)&&(r=i[1],i=e[n]=i[0]),n!==l&&(e[l]=i,delete e[n]),(o=y.cssHooks[l])&&"expand"in o)for(n in i=o.expand(i),delete e[l],i)n in e||(e[n]=i[n],t[n]=r);else t[l]=r}(c,s.opts.specialEasing);i<o;i++)if(l=ut.prefilters[i].call(s,e,c,s.opts))return v(l.stop)&&(y._queueHooks(s.elem,s.opts.queue).stop=l.stop.bind(l)),l;return y.map(c,at,s),v(s.opts.start)&&s.opts.start.call(e,s),s.progress(s.opts.progress).done(s.opts.done,s.opts.complete).fail(s.opts.fail).always(s.opts.always),y.fx.timer(y.extend(u,{elem:e,anim:s,queue:s.opts.queue})),s}y.Animation=y.extend(ut,{tweeners:{"*":[function(e,t){var n=this.createTween(e,t);return oe(n.elem,e,ee.exec(t),n),n}]},tweener:function(e,t){v(e)?(t=e,e=["*"]):e=e.match(L);for(var n,l=0,r=e.length;l<r;l++)(ut.tweeners[n=e[l]]=ut.tweeners[n]||[]).unshift(t)},prefilters:[function(e,t,n){var l,r,i,o,a,u,s,c,d="width"in t||"height"in t,p=this,f={},v=e.style,m=e.nodeType&&ie(e),h=Y.get(e,"fxshow");for(l in n.queue||(null==(o=y._queueHooks(e,"fx")).unqueued&&(o.unqueued=0,a=o.empty.fire,o.empty.fire=function(){o.unqueued||a()}),o.unqueued++,p.always(function(){p.always(function(){o.unqueued--,y.queue(e,"fx").length||o.empty.fire()})})),t)if(nt.test(r=t[l])){if(delete t[l],i=i||"toggle"===r,r===(m?"hide":"show")){if("show"!==r||!h||void 0===h[l])continue;m=!0}f[l]=h&&h[l]||y.style(e,l)}if((u=!y.isEmptyObject(t))||!y.isEmptyObject(f))for(l in d&&1===e.nodeType&&(n.overflow=[v.overflow,v.overflowX,v.overflowY],null==(s=h&&h.display)&&(s=Y.get(e,"display")),"none"===(c=y.css(e,"display"))&&(s?c=s:(se([e],!0),s=e.style.display||s,c=y.css(e,"display"),se([e]))),("inline"===c||"inline-block"===c&&null!=s)&&"none"===y.css(e,"float")&&(u||(p.done(function(){v.display=s}),null==s&&(s="none"===(c=v.display)?"":c)),v.display="inline-block")),n.overflow&&(v.overflow="hidden",p.always(function(){v.overflow=n.overflow[0],v.overflowX=n.overflow[1],v.overflowY=n.overflow[2]})),u=!1,f)u||(h?"hidden"in h&&(m=h.hidden):h=Y.access(e,"fxshow",{display:s}),i&&(h.hidden=!m),m&&se([e],!0),p.done(function(){for(l in m||se([e]),Y.remove(e,"fxshow"),f)y.style(e,l,f[l])})),u=at(m?h[l]:0,l,p),l in h||(h[l]=u.start,m&&(u.end=u.start,u.start=0))}],prefilter:function(e,t){t?ut.prefilters.unshift(e):ut.prefilters.push(e)}}),y.speed=function(e,t,n){var l=e&&"object"==typeof e?y.extend({},e):{complete:n||!n&&t||v(e)&&e,duration:e,easing:n&&t||t&&!v(t)&&t};return y.fx.off?l.duration=0:"number"!=typeof l.duration&&(l.duration=l.duration in y.fx.speeds?y.fx.speeds[l.duration]:y.fx.speeds._default),null!=l.queue&&!0!==l.queue||(l.queue="fx"),l.old=l.complete,l.complete=function(){v(l.old)&&l.old.call(this),l.queue&&y.dequeue(this,l.queue)},l},y.fn.extend({fadeTo:function(e,t,n,l){return this.filter(ie).css("opacity",0).show().end().animate({opacity:t},e,n,l)},animate:function(e,t,n,l){var r=y.isEmptyObject(e),i=y.speed(t,n,l),o=function(){var t=ut(this,y.extend({},e),i);(r||Y.get(this,"finish"))&&t.stop(!0)};return o.finish=o,r||!1===i.queue?this.each(o):this.queue(i.queue,o)},stop:function(e,t,n){var l=function(e){var t=e.stop;delete e.stop,t(n)};return"string"!=typeof e&&(n=t,t=e,e=void 0),t&&this.queue(e||"fx",[]),this.each(function(){var t=!0,r=null!=e&&e+"queueHooks",i=y.timers,o=Y.get(this);if(r)o[r]&&o[r].stop&&l(o[r]);else for(r in o)o[r]&&o[r].stop&<.test(r)&&l(o[r]);for(r=i.length;r--;)i[r].elem!==this||null!=e&&i[r].queue!==e||(i[r].anim.stop(n),t=!1,i.splice(r,1));!t&&n||y.dequeue(this,e)})},finish:function(e){return!1!==e&&(e=e||"fx"),this.each(function(){var t,n=Y.get(this),l=n[e+"queue"],r=n[e+"queueHooks"],i=y.timers,o=l?l.length:0;for(n.finish=!0,y.queue(this,e,[]),r&&r.stop&&r.stop.call(this,!0),t=i.length;t--;)i[t].elem===this&&i[t].queue===e&&(i[t].anim.stop(!0),i.splice(t,1));for(t=0;t<o;t++)l[t]&&l[t].finish&&l[t].finish.call(this);delete n.finish})}}),y.each(["toggle","show","hide"],function(e,t){var n=y.fn[t];y.fn[t]=function(e,l,r){return null==e||"boolean"==typeof e?n.apply(this,arguments):this.animate(ot(t,!0),e,l,r)}}),y.each({slideDown:ot("show"),slideUp:ot("hide"),slideToggle:ot("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,t){y.fn[e]=function(e,n,l){return this.animate(t,e,n,l)}}),y.timers=[],y.fx.tick=function(){var e,t=0,n=y.timers;for(et=Date.now();t<n.length;t++)(e=n[t])()||n[t]!==e||n.splice(t--,1);n.length||y.fx.stop(),et=void 0},y.fx.timer=function(e){y.timers.push(e),y.fx.start()},y.fx.interval=13,y.fx.start=function(){tt||(tt=!0,rt())},y.fx.stop=function(){tt=null},y.fx.speeds={slow:600,fast:200,_default:400},y.fn.delay=function(t,n){return t=y.fx&&y.fx.speeds[t]||t,this.queue(n=n||"fx",function(n,l){var r=e.setTimeout(n,t);l.stop=function(){e.clearTimeout(r)}})},function(){var e=h.createElement("input"),t=h.createElement("select").appendChild(h.createElement("option"));e.type="checkbox",f.checkOn=""!==e.value,f.optSelected=t.selected,(e=h.createElement("input")).value="t",e.type="radio",f.radioValue="t"===e.value}();var st,ct=y.expr.attrHandle;y.fn.extend({attr:function(e,t){return H(this,y.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){y.removeAttr(this,e)})}}),y.extend({attr:function(e,t,n){var l,r,i=e.nodeType;if(3!==i&&8!==i&&2!==i)return void 0===e.getAttribute?y.prop(e,t,n):(1===i&&y.isXMLDoc(e)||(r=y.attrHooks[t.toLowerCase()]||(y.expr.match.bool.test(t)?st:void 0)),void 0!==n?null===n?void y.removeAttr(e,t):r&&"set"in r&&void 0!==(l=r.set(e,n,t))?l:(e.setAttribute(t,n+""),n):r&&"get"in r&&null!==(l=r.get(e,t))?l:null==(l=y.find.attr(e,t))?void 0:l)},attrHooks:{type:{set:function(e,t){if(!f.radioValue&&"radio"===t&&D(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},removeAttr:function(e,t){var n,l=0,r=t&&t.match(L);if(r&&1===e.nodeType)for(;n=r[l++];)e.removeAttribute(n)}}),st={set:function(e,t,n){return!1===t?y.removeAttr(e,n):e.setAttribute(n,n),n}},y.each(y.expr.match.bool.source.match(/\w+/g),function(e,t){var n=ct[t]||y.find.attr;ct[t]=function(e,t,l){var r,i,o=t.toLowerCase();return l||(i=ct[o],ct[o]=r,r=null!=n(e,t,l)?o:null,ct[o]=i),r}});var dt=/^(?:input|select|textarea|button)$/i,pt=/^(?:a|area)$/i;function ft(e){return(e.match(L)||[]).join(" ")}function vt(e){return e.getAttribute&&e.getAttribute("class")||""}function mt(e){return Array.isArray(e)?e:"string"==typeof e&&e.match(L)||[]}y.fn.extend({prop:function(e,t){return H(this,y.prop,e,t,arguments.length>1)},removeProp:function(e){return this.each(function(){delete this[y.propFix[e]||e]})}}),y.extend({prop:function(e,t,n){var l,r,i=e.nodeType;if(3!==i&&8!==i&&2!==i)return 1===i&&y.isXMLDoc(e)||(r=y.propHooks[t=y.propFix[t]||t]),void 0!==n?r&&"set"in r&&void 0!==(l=r.set(e,n,t))?l:e[t]=n:r&&"get"in r&&null!==(l=r.get(e,t))?l:e[t]},propHooks:{tabIndex:{get:function(e){var t=y.find.attr(e,"tabindex");return t?parseInt(t,10):dt.test(e.nodeName)||pt.test(e.nodeName)&&e.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),f.optSelected||(y.propHooks.selected={get:function(e){return null},set:function(e){}}),y.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){y.propFix[this.toLowerCase()]=this}),y.fn.extend({addClass:function(e){var t,n,l,r,i,o,a,u=0;if(v(e))return this.each(function(t){y(this).addClass(e.call(this,t,vt(this)))});if((t=mt(e)).length)for(;n=this[u++];)if(r=vt(n),l=1===n.nodeType&&" "+ft(r)+" "){for(o=0;i=t[o++];)l.indexOf(" "+i+" ")<0&&(l+=i+" ");r!==(a=ft(l))&&n.setAttribute("class",a)}return this},removeClass:function(e){var t,n,l,r,i,o,a,u=0;if(v(e))return this.each(function(t){y(this).removeClass(e.call(this,t,vt(this)))});if(!arguments.length)return this.attr("class","");if((t=mt(e)).length)for(;n=this[u++];)if(r=vt(n),l=1===n.nodeType&&" "+ft(r)+" "){for(o=0;i=t[o++];)for(;l.indexOf(" "+i+" ")>-1;)l=l.replace(" "+i+" "," ");r!==(a=ft(l))&&n.setAttribute("class",a)}return this},toggleClass:function(e,t){var n=typeof e,l="string"===n||Array.isArray(e);return"boolean"==typeof t&&l?t?this.addClass(e):this.removeClass(e):v(e)?this.each(function(n){y(this).toggleClass(e.call(this,n,vt(this),t),t)}):this.each(function(){var t,r,i,o;if(l)for(r=0,i=y(this),o=mt(e);t=o[r++];)i.hasClass(t)?i.removeClass(t):i.addClass(t);else void 0!==e&&"boolean"!==n||((t=vt(this))&&Y.set(this,"__className__",t),this.setAttribute&&this.setAttribute("class",t||!1===e?"":Y.get(this,"__className__")||""))})},hasClass:function(e){var t,n,l=0;for(t=" "+e+" ";n=this[l++];)if(1===n.nodeType&&(" "+ft(vt(n))+" ").indexOf(t)>-1)return!0;return!1}});var ht=/\r/g;y.fn.extend({val:function(e){var t,n,l,r=this[0];return arguments.length?(l=v(e),this.each(function(n){var r;1===this.nodeType&&(null==(r=l?e.call(this,n,y(this).val()):e)?r="":"number"==typeof r?r+="":Array.isArray(r)&&(r=y.map(r,function(e){return null==e?"":e+""})),(t=y.valHooks[this.type]||y.valHooks[this.nodeName.toLowerCase()])&&"set"in t&&void 0!==t.set(this,r,"value")||(this.value=r))})):r?(t=y.valHooks[r.type]||y.valHooks[r.nodeName.toLowerCase()])&&"get"in t&&void 0!==(n=t.get(r,"value"))?n:"string"==typeof(n=r.value)?n.replace(ht,""):null==n?"":n:void 0}}),y.extend({valHooks:{option:{get:function(e){var t=y.find.attr(e,"value");return null!=t?t:ft(y.text(e))}},select:{get:function(e){var t,n,l,r=e.options,i=e.selectedIndex,o="select-one"===e.type,a=o?null:[],u=o?i+1:r.length;for(l=i<0?u:o?i:0;l<u;l++)if(((n=r[l]).selected||l===i)&&!n.disabled&&(!n.parentNode.disabled||!D(n.parentNode,"optgroup"))){if(t=y(n).val(),o)return t;a.push(t)}return a},set:function(e,t){for(var n,l,r=e.options,i=y.makeArray(t),o=r.length;o--;)((l=r[o]).selected=y.inArray(y.valHooks.option.get(l),i)>-1)&&(n=!0);return n||(e.selectedIndex=-1),i}}}}),y.each(["radio","checkbox"],function(){y.valHooks[this]={set:function(e,t){if(Array.isArray(t))return e.checked=y.inArray(y(e).val(),t)>-1}},f.checkOn||(y.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})}),f.focusin="onfocusin"in e;var gt=/^(?:focusinfocus|focusoutblur)$/,Et=function(e){e.stopPropagation()};y.extend(y.event,{trigger:function(t,n,l,r){var i,o,a,u,s,d,p,f,g=[l||h],E=c.call(t,"type")?t.type:t,_=c.call(t,"namespace")?t.namespace.split("."):[];if(o=f=a=l=l||h,3!==l.nodeType&&8!==l.nodeType&&!gt.test(E+y.event.triggered)&&(E.indexOf(".")>-1&&(_=E.split("."),E=_.shift(),_.sort()),s=E.indexOf(":")<0&&"on"+E,(t=t[y.expando]?t:new y.Event(E,"object"==typeof t&&t)).isTrigger=r?2:3,t.namespace=_.join("."),t.rnamespace=t.namespace?new RegExp("(^|\\.)"+_.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=void 0,t.target||(t.target=l),n=null==n?[t]:y.makeArray(n,[t]),p=y.event.special[E]||{},r||!p.trigger||!1!==p.trigger.apply(l,n))){if(!r&&!p.noBubble&&!m(l)){for(gt.test((u=p.delegateType||E)+E)||(o=o.parentNode);o;o=o.parentNode)g.push(o),a=o;a===(l.ownerDocument||h)&&g.push(a.defaultView||a.parentWindow||e)}for(i=0;(o=g[i++])&&!t.isPropagationStopped();)f=o,t.type=i>1?u:p.bindType||E,(d=(Y.get(o,"events")||Object.create(null))[t.type]&&Y.get(o,"handle"))&&d.apply(o,n),(d=s&&o[s])&&d.apply&&G(o)&&(t.result=d.apply(o,n),!1===t.result&&t.preventDefault());return t.type=E,r||t.isDefaultPrevented()||p._default&&!1!==p._default.apply(g.pop(),n)||!G(l)||s&&v(l[E])&&!m(l)&&((a=l[s])&&(l[s]=null),y.event.triggered=E,t.isPropagationStopped()&&f.addEventListener(E,Et),l[E](),t.isPropagationStopped()&&f.removeEventListener(E,Et),y.event.triggered=void 0,a&&(l[s]=a)),t.result}},simulate:function(e,t,n){var l=y.extend(new y.Event,n,{type:e,isSimulated:!0});y.event.trigger(l,null,t)}}),y.fn.extend({trigger:function(e,t){return this.each(function(){y.event.trigger(e,t,this)})},triggerHandler:function(e,t){var n=this[0];if(n)return y.event.trigger(e,t,n,!0)}}),f.focusin||y.each({focus:"focusin",blur:"focusout"},function(e,t){var n=function(e){y.event.simulate(t,e.target,y.event.fix(e))};y.event.special[t]={setup:function(){var l=this.ownerDocument||this.document||this,r=Y.access(l,t);r||l.addEventListener(e,n,!0),Y.access(l,t,(r||0)+1)},teardown:function(){var l=this.ownerDocument||this.document||this,r=Y.access(l,t)-1;r?Y.access(l,t,r):(l.removeEventListener(e,n,!0),Y.remove(l,t))}}});var _t=e.location,yt={guid:Date.now()},St=/\?/;y.parseXML=function(t){var n,l;if(!t||"string"!=typeof t)return null;try{n=(new e.DOMParser).parseFromString(t,"text/xml")}catch(e){}return l=n&&n.getElementsByTagName("parsererror")[0],n&&!l||y.error("Invalid XML: "+(l?y.map(l.childNodes,function(e){return e.textContent}).join("\n"):t)),n};var bt=/\[\]$/,Tt=/\r?\n/g,Ct=/^(?:submit|button|image|reset|file)$/i,At=/^(?:input|select|textarea|keygen)/i;function Dt(e,t,n,l){var r;if(Array.isArray(t))y.each(t,function(t,r){n||bt.test(e)?l(e,r):Dt(e+"["+("object"==typeof r&&null!=r?t:"")+"]",r,n,l)});else if(n||"object"!==_(t))l(e,t);else for(r in t)Dt(e+"["+r+"]",t[r],n,l)}y.param=function(e,t){var n,l=[],r=function(e,t){var n=v(t)?t():t;l[l.length]=encodeURIComponent(e)+"="+encodeURIComponent(null==n?"":n)};if(null==e)return"";if(Array.isArray(e)||e.jquery&&!y.isPlainObject(e))y.each(e,function(){r(this.name,this.value)});else for(n in e)Dt(n,e[n],t,r);return l.join("&")},y.fn.extend({serialize:function(){return y.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=y.prop(this,"elements");return e?y.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!y(this).is(":disabled")&&At.test(this.nodeName)&&!Ct.test(e)&&(this.checked||!pe.test(e))}).map(function(e,t){var n=y(this).val();return null==n?null:Array.isArray(n)?y.map(n,function(e){return{name:t.name,value:e.replace(Tt,"\r\n")}}):{name:t.name,value:n.replace(Tt,"\r\n")}}).get()}});var xt=/%20/g,Pt=/#.*$/,Nt=/([?&])_=[^&]*/,wt=/^(.*?):[ \t]*([^\r\n]*)$/gm,Rt=/^(?:GET|HEAD)$/,It=/^\/\//,Ot={},Lt={},kt="*/".concat("*"),Mt=h.createElement("a");function Ft(e){return function(t,n){"string"!=typeof t&&(n=t,t="*");var l,r=0,i=t.toLowerCase().match(L)||[];if(v(n))for(;l=i[r++];)"+"===l[0]?(l=l.slice(1)||"*",(e[l]=e[l]||[]).unshift(n)):(e[l]=e[l]||[]).push(n)}}function Bt(e,t,n,l){var r={},i=e===Lt;function o(a){var u;return r[a]=!0,y.each(e[a]||[],function(e,a){var s=a(t,n,l);return"string"!=typeof s||i||r[s]?i?!(u=s):void 0:(t.dataTypes.unshift(s),o(s),!1)}),u}return o(t.dataTypes[0])||!r["*"]&&o("*")}function Ut(e,t){var n,l,r=y.ajaxSettings.flatOptions||{};for(n in t)void 0!==t[n]&&((r[n]?e:l||(l={}))[n]=t[n]);return l&&y.extend(!0,e,l),e}Mt.href=_t.href,y.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:_t.href,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(_t.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":kt,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":y.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?Ut(Ut(e,y.ajaxSettings),t):Ut(y.ajaxSettings,e)},ajaxPrefilter:Ft(Ot),ajaxTransport:Ft(Lt),ajax:function(t,n){"object"==typeof t&&(n=t,t=void 0);var l,r,i,o,a,u,s,c,d,p,f=y.ajaxSetup({},n=n||{}),v=f.context||f,m=f.context&&(v.nodeType||v.jquery)?y(v):y.event,g=y.Deferred(),E=y.Callbacks("once memory"),_=f.statusCode||{},S={},b={},T="canceled",C={readyState:0,getResponseHeader:function(e){var t;if(s){if(!o)for(o={};t=wt.exec(i);)o[t[1].toLowerCase()+" "]=(o[t[1].toLowerCase()+" "]||[]).concat(t[2]);t=o[e.toLowerCase()+" "]}return null==t?null:t.join(", ")},getAllResponseHeaders:function(){return s?i:null},setRequestHeader:function(e,t){return null==s&&(e=b[e.toLowerCase()]=b[e.toLowerCase()]||e,S[e]=t),this},overrideMimeType:function(e){return null==s&&(f.mimeType=e),this},statusCode:function(e){var t;if(e)if(s)C.always(e[C.status]);else for(t in e)_[t]=[_[t],e[t]];return this},abort:function(e){var t=e||T;return l&&l.abort(t),A(0,t),this}};if(g.promise(C),f.url=((t||f.url||_t.href)+"").replace(It,_t.protocol+"//"),f.type=n.method||n.type||f.method||f.type,f.dataTypes=(f.dataType||"*").toLowerCase().match(L)||[""],null==f.crossDomain){u=h.createElement("a");try{u.href=f.url,u.href=u.href,f.crossDomain=Mt.protocol+"//"+Mt.host!=u.protocol+"//"+u.host}catch(e){f.crossDomain=!0}}if(f.data&&f.processData&&"string"!=typeof f.data&&(f.data=y.param(f.data,f.traditional)),Bt(Ot,f,n,C),s)return C;for(d in(c=y.event&&f.global)&&0==y.active++&&y.event.trigger("ajaxStart"),f.type=f.type.toUpperCase(),f.hasContent=!Rt.test(f.type),r=f.url.replace(Pt,""),f.hasContent?f.data&&f.processData&&0===(f.contentType||"").indexOf("application/x-www-form-urlencoded")&&(f.data=f.data.replace(xt,"+")):(p=f.url.slice(r.length),f.data&&(f.processData||"string"==typeof f.data)&&(r+=(St.test(r)?"&":"?")+f.data,delete f.data),!1===f.cache&&(r=r.replace(Nt,"$1"),p=(St.test(r)?"&":"?")+"_="+yt.guid+++p),f.url=r+p),f.ifModified&&(y.lastModified[r]&&C.setRequestHeader("If-Modified-Since",y.lastModified[r]),y.etag[r]&&C.setRequestHeader("If-None-Match",y.etag[r])),(f.data&&f.hasContent&&!1!==f.contentType||n.contentType)&&C.setRequestHeader("Content-Type",f.contentType),C.setRequestHeader("Accept",f.dataTypes[0]&&f.accepts[f.dataTypes[0]]?f.accepts[f.dataTypes[0]]+("*"!==f.dataTypes[0]?", "+kt+"; q=0.01":""):f.accepts["*"]),f.headers)C.setRequestHeader(d,f.headers[d]);if(f.beforeSend&&(!1===f.beforeSend.call(v,C,f)||s))return C.abort();if(T="abort",E.add(f.complete),C.done(f.success),C.fail(f.error),l=Bt(Lt,f,n,C)){if(C.readyState=1,c&&m.trigger("ajaxSend",[C,f]),s)return C;f.async&&f.timeout>0&&(a=e.setTimeout(function(){C.abort("timeout")},f.timeout));try{s=!1,l.send(S,A)}catch(e){if(s)throw e;A(-1,e)}}else A(-1,"No Transport");function A(t,n,o,u){var d,p,h,S,b,T=n;s||(s=!0,a&&e.clearTimeout(a),l=void 0,i=u||"",C.readyState=t>0?4:0,d=t>=200&&t<300||304===t,o&&(S=function(e,t,n){for(var l,r,i,o,a=e.contents,u=e.dataTypes;"*"===u[0];)u.shift(),void 0===l&&(l=e.mimeType||t.getResponseHeader("Content-Type"));if(l)for(r in a)if(a[r]&&a[r].test(l)){u.unshift(r);break}if(u[0]in n)i=u[0];else{for(r in n){if(!u[0]||e.converters[r+" "+u[0]]){i=r;break}o||(o=r)}i=i||o}if(i)return i!==u[0]&&u.unshift(i),n[i]}(f,C,o)),!d&&y.inArray("script",f.dataTypes)>-1&&y.inArray("json",f.dataTypes)<0&&(f.converters["text script"]=function(){}),S=function(e,t,n,l){var r,i,o,a,u,s={},c=e.dataTypes.slice();if(c[1])for(o in e.converters)s[o.toLowerCase()]=e.converters[o];for(i=c.shift();i;)if(e.responseFields[i]&&(n[e.responseFields[i]]=t),!u&&l&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),u=i,i=c.shift())if("*"===i)i=u;else if("*"!==u&&u!==i){if(!(o=s[u+" "+i]||s["* "+i]))for(r in s)if((a=r.split(" "))[1]===i&&(o=s[u+" "+a[0]]||s["* "+a[0]])){!0===o?o=s[r]:!0!==s[r]&&(i=a[0],c.unshift(a[1]));break}if(!0!==o)if(o&&e.throws)t=o(t);else try{t=o(t)}catch(e){return{state:"parsererror",error:o?e:"No conversion from "+u+" to "+i}}}return{state:"success",data:t}}(f,S,C,d),d?(f.ifModified&&((b=C.getResponseHeader("Last-Modified"))&&(y.lastModified[r]=b),(b=C.getResponseHeader("etag"))&&(y.etag[r]=b)),204===t||"HEAD"===f.type?T="nocontent":304===t?T="notmodified":(T=S.state,p=S.data,d=!(h=S.error))):(h=T,!t&&T||(T="error",t<0&&(t=0))),C.status=t,C.statusText=(n||T)+"",d?g.resolveWith(v,[p,T,C]):g.rejectWith(v,[C,T,h]),C.statusCode(_),_=void 0,c&&m.trigger(d?"ajaxSuccess":"ajaxError",[C,f,d?p:h]),E.fireWith(v,[C,T]),c&&(m.trigger("ajaxComplete",[C,f]),--y.active||y.event.trigger("ajaxStop")))}return C},getJSON:function(e,t,n){return y.get(e,t,n,"json")},getScript:function(e,t){return y.get(e,void 0,t,"script")}}),y.each(["get","post"],function(e,t){y[t]=function(e,n,l,r){return v(n)&&(r=r||l,l=n,n=void 0),y.ajax(y.extend({url:e,type:t,dataType:r,data:n,success:l},y.isPlainObject(e)&&e))}}),y.ajaxPrefilter(function(e){var t;for(t in e.headers)"content-type"===t.toLowerCase()&&(e.contentType=e.headers[t]||"")}),y._evalUrl=function(e,t,n){return y.ajax({url:e,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,converters:{"text script":function(){}},dataFilter:function(e){y.globalEval(e,t,n)}})},y.fn.extend({wrapAll:function(e){var t;return this[0]&&(v(e)&&(e=e.call(this[0])),t=y(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){for(var e=this;e.firstElementChild;)e=e.firstElementChild;return e}).append(this)),this},wrapInner:function(e){return v(e)?this.each(function(t){y(this).wrapInner(e.call(this,t))}):this.each(function(){var t=y(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=v(e);return this.each(function(n){y(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(e){return this.parent(e).not("body").each(function(){y(this).replaceWith(this.childNodes)}),this}}),y.expr.pseudos.hidden=function(e){return!y.expr.pseudos.visible(e)},y.expr.pseudos.visible=function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)},y.ajaxSettings.xhr=function(){try{return new e.XMLHttpRequest}catch(e){}};var jt={0:200,1223:204},Ht=y.ajaxSettings.xhr();f.cors=!!Ht&&"withCredentials"in Ht,f.ajax=Ht=!!Ht,y.ajaxTransport(function(t){var n,l;if(f.cors||Ht&&!t.crossDomain)return{send:function(r,i){var o,a=t.xhr();if(a.open(t.type,t.url,t.async,t.username,t.password),t.xhrFields)for(o in t.xhrFields)a[o]=t.xhrFields[o];for(o in t.mimeType&&a.overrideMimeType&&a.overrideMimeType(t.mimeType),t.crossDomain||r["X-Requested-With"]||(r["X-Requested-With"]="XMLHttpRequest"),r)a.setRequestHeader(o,r[o]);n=function(e){return function(){n&&(n=l=a.onload=a.onerror=a.onabort=a.ontimeout=a.onreadystatechange=null,"abort"===e?a.abort():"error"===e?"number"!=typeof a.status?i(0,"error"):i(a.status,a.statusText):i(jt[a.status]||a.status,a.statusText,"text"!==(a.responseType||"text")||"string"!=typeof a.responseText?{binary:a.response}:{text:a.responseText},a.getAllResponseHeaders()))}},a.onload=n(),l=a.onerror=a.ontimeout=n("error"),void 0!==a.onabort?a.onabort=l:a.onreadystatechange=function(){4===a.readyState&&e.setTimeout(function(){n&&l()})},n=n("abort");try{a.send(t.hasContent&&t.data||null)}catch(e){if(n)throw e}},abort:function(){n&&n()}}}),y.ajaxPrefilter(function(e){e.crossDomain&&(e.contents.script=!1)}),y.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(e){return y.globalEval(e),e}}}),y.ajaxPrefilter("script",function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET")}),y.ajaxTransport("script",function(e){var t,n;if(e.crossDomain||e.scriptAttrs)return{send:function(l,r){t=y("<script>").attr(e.scriptAttrs||{}).prop({charset:e.scriptCharset,src:e.url}).on("load error",n=function(e){t.remove(),n=null,e&&r("error"===e.type?404:200,e.type)}),h.head.appendChild(t[0])},abort:function(){n&&n()}}});var Wt,zt=[],Vt=/(=)\?(?=&|$)|\?\?/;y.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=zt.pop()||y.expando+"_"+yt.guid++;return this[e]=!0,e}}),y.ajaxPrefilter("json jsonp",function(t,n,l){var r,i,o,a=!1!==t.jsonp&&(Vt.test(t.url)?"url":"string"==typeof t.data&&0===(t.contentType||"").indexOf("application/x-www-form-urlencoded")&&Vt.test(t.data)&&"data");if(a||"jsonp"===t.dataTypes[0])return r=t.jsonpCallback=v(t.jsonpCallback)?t.jsonpCallback():t.jsonpCallback,a?t[a]=t[a].replace(Vt,"$1"+r):!1!==t.jsonp&&(t.url+=(St.test(t.url)?"&":"?")+t.jsonp+"="+r),t.converters["script json"]=function(){return o||y.error(r+" was not called"),o[0]},t.dataTypes[0]="json",i=e[r],e[r]=function(){o=arguments},l.always(function(){void 0===i?y(e).removeProp(r):e[r]=i,t[r]&&(t.jsonpCallback=n.jsonpCallback,zt.push(r)),o&&v(i)&&i(o[0]),o=i=void 0}),"script"}),f.createHTMLDocument=((Wt=h.implementation.createHTMLDocument("").body).innerHTML="<form></form><form></form>",2===Wt.childNodes.length),y.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(f.createHTMLDocument?((l=(t=h.implementation.createHTMLDocument("")).createElement("base")).href=h.location.href,t.head.appendChild(l)):t=h),i=!n&&[],(r=x.exec(e))?[t.createElement(r[1])]:(r=_e([e],t,i),i&&i.length&&y(i).remove(),y.merge([],r.childNodes)));var l,r,i},y.fn.load=function(e,t,n){var l,r,i,o=this,a=e.indexOf(" ");return a>-1&&(l=ft(e.slice(a)),e=e.slice(0,a)),v(t)?(n=t,t=void 0):t&&"object"==typeof t&&(r="POST"),o.length>0&&y.ajax({url:e,type:r||"GET",dataType:"html",data:t}).done(function(e){i=arguments,o.html(l?y("<div>").append(y.parseHTML(e)).find(l):e)}).always(n&&function(e,t){o.each(function(){n.apply(this,i||[e.responseText,t,e])})}),this},y.expr.pseudos.animated=function(e){return y.grep(y.timers,function(t){return e===t.elem}).length},y.offset={setOffset:function(e,t,n){var l,r,i,o,a,u,s=y.css(e,"position"),c=y(e),d={};"static"===s&&(e.style.position="relative"),a=c.offset(),i=y.css(e,"top"),u=y.css(e,"left"),("absolute"===s||"fixed"===s)&&(i+u).indexOf("auto")>-1?(o=(l=c.position()).top,r=l.left):(o=parseFloat(i)||0,r=parseFloat(u)||0),v(t)&&(t=t.call(e,n,y.extend({},a))),null!=t.top&&(d.top=t.top-a.top+o),null!=t.left&&(d.left=t.left-a.left+r),"using"in t?t.using.call(e,d):c.css(d)}},y.fn.extend({offset:function(e){if(arguments.length)return void 0===e?this:this.each(function(t){y.offset.setOffset(this,e,t)});var t,n,l=this[0];return l?l.getClientRects().length?{top:(t=l.getBoundingClientRect()).top+(n=l.ownerDocument.defaultView).pageYOffset,left:t.left+n.pageXOffset}:{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,l=this[0],r={top:0,left:0};if("fixed"===y.css(l,"position"))t=l.getBoundingClientRect();else{for(t=this.offset(),n=l.ownerDocument,e=l.offsetParent||n.documentElement;e&&(e===n.body||e===n.documentElement)&&"static"===y.css(e,"position");)e=e.parentNode;e&&e!==l&&1===e.nodeType&&((r=y(e).offset()).top+=y.css(e,"borderTopWidth",!0),r.left+=y.css(e,"borderLeftWidth",!0))}return{top:t.top-r.top-y.css(l,"marginTop",!0),left:t.left-r.left-y.css(l,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){for(var e=this.offsetParent;e&&"static"===y.css(e,"position");)e=e.offsetParent;return e||ne})}}),y.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,t){var n="pageYOffset"===t;y.fn[e]=function(l){return H(this,function(e,l,r){var i;if(m(e)?i=e:9===e.nodeType&&(i=e.defaultView),void 0===r)return i?i[t]:e[l];i?i.scrollTo(n?i.pageXOffset:r,n?r:i.pageYOffset):e[l]=r},e,l,arguments.length)}}),y.each(["top","left"],function(e,t){y.cssHooks[t]=He(f.pixelPosition,function(e,n){if(n)return n=je(e,t),Me.test(n)?y(e).position()[t]+"px":n})}),y.each({Height:"height",Width:"width"},function(e,t){y.each({padding:"inner"+e,content:t,"":"outer"+e},function(n,l){y.fn[l]=function(r,i){var o=arguments.length&&(n||"boolean"!=typeof r),a=n||(!0===r||!0===i?"margin":"border");return H(this,function(t,n,r){var i;return m(t)?0===l.indexOf("outer")?t["inner"+e]:t.document.documentElement["client"+e]:9===t.nodeType?(i=t.documentElement,Math.max(t.body["scroll"+e],i["scroll"+e],t.body["offset"+e],i["offset"+e],i["client"+e])):void 0===r?y.css(t,n,a):y.style(t,n,r,a)},t,o?r:void 0,o)}})}),y.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){y.fn[t]=function(e){return this.on(t,e)}}),y.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,l){return this.on(t,e,n,l)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),y.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,t){y.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)}});var qt=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;y.proxy=function(e,t){var n,l,i;if("string"==typeof t&&(n=e[t],t=e,e=n),v(e))return l=r.call(arguments,2),(i=function(){return e.apply(t||this,l.concat(r.call(arguments)))}).guid=e.guid=e.guid||y.guid++,i},y.holdReady=function(e){e?y.readyWait++:y.ready(!0)},y.isArray=Array.isArray,y.parseJSON=JSON.parse,y.nodeName=D,y.isFunction=v,y.isWindow=m,y.camelCase=q,y.type=_,y.now=Date.now,y.isNumeric=function(e){var t=y.type(e);return("number"===t||"string"===t)&&!isNaN(e-parseFloat(e))},y.trim=function(e){return null==e?"":(e+"").replace(qt,"")};var Gt=e.jQuery,Kt=e.$;return y.noConflict=function(t){return e.$===y&&(e.$=Kt),t&&e.jQuery===y&&(e.jQuery=Gt),y},void 0===t&&(e.jQuery=e.$=y),y})});const C=e=>{var n,i,o;let{data:a,OpenImage:u}=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(t.TelePhone,{mobile:a.mobileNumber}),a.source&&l.createElement("p",null,s("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,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(t.DisplayPhotos,{srcs:null==a?void 0:a.thumbnailsToShow.thumbs,onClick:(e,t)=>{u(e,t,null==a?void 0:a.thumbnailsToShow)}})):null)},A=e=>{var o,a,u,s,c,d,p;const{t:f}=r.useTranslation(),v=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===(s=e.application)||void 0===s?void 0:s.applicationNumber,moduleCode:v});function g(e,t,n){var l;window.open(null==n||null===(l=n.fullImage)||void 0===l?void 0:l[0],"_blank")}const E=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(C,{data:i})}if(t.state){var i,o,a,u,s;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===(s=u[0])||void 0===s?void 0:s.mobileNumber,comment:f(null==t?void 0:t.comment),wfComment:t.wfComment,thumbnailsToShow:null==t?void 0:t.thumbnailsToShow};return l.createElement(C,{data:e,OpenImage:g})}{var c,d;const n={date:Digit.DateUtils.ConvertTimestampToDate(null===(c=e.application)||void 0===c?void 0:c.auditDetails.lastModified),name:null==t||null===(d=t.assigner)||void 0===d?void 0:d.name,comment:f(null==t?void 0:t.comment)};return l.createElement(C,{data:n})}};return m?l.createElement(t.Loader,null):l.createElement(l.Fragment,null,!m&&l.createElement(n.Fragment,null,(null==h||null===(c=h.timeline)||void 0===c?void 0:c.length)>0&&l.createElement(t.CardSectionHeader,{style:{marginBottom:"16px",marginTop:"32px"}},f("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:f((null==h||null===(p=h.timeline[0])||void 0===p?void 0:p.state)&&"WF_"+v+"_"+h.timeline[0].state||"NA"),customChild:E(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;let o="";var a,u,s,c,d,p,v,m;return window.location.href.includes("/obps/")&&(o=null!==(a=workflowDetails)&&void 0!==a&&null!==(u=a.data)&&void 0!==u&&null!==(s=u.timeline[n-1])&&void 0!==s&&null!==(c=s.state)&&void 0!==c&&c.includes("BACK_FROM")||null!==(d=workflowDetails)&&void 0!==d&&null!==(p=d.data)&&void 0!==p&&null!==(v=p.timeline[n-1])&&void 0!==v&&null!==(m=v.state)&&void 0!==m&&m.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,label:f("ES_PTR_COMMON_STATUS_"+(null==h||null===(i=h.processInstances[n].state)||void 0===i?void 0:i.state)+o),customChild:E(e)}))})))),h&&(n=>{var r,o,a;let u=n[0];const s=n.map(e=>e.action);if(s.includes("PAY")||s.includes("EDIT")){let e=s.indexOf("EDIT")||s.indexOf("PAY");e=-1!=e?e:s.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:"/digit-ui/citizen/payment/my-bills/"+v+"/"+(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:f("CS_APPLICATION_DETAILS_MAKE_PAYMENT")}))):null;case"SUBMIT_FEEDBACK":return l.createElement("div",{style:{marginTop:"24px"}},l.createElement(i.Link,{to:"/digit-ui/citizen/fsm/rate/"+e.id},l.createElement(t.SubmitBar,{label:f("CS_APPLICATION_DETAILS_RATE")})));default:return null}})(null==h?void 0:h.nextActions))},D=["path","url"],x=[{screenPath:"petservice/new-application/acknowledgement"},{screenPath:"petservice/edit-application/acknowledgement"}],P=()=>{var e,n,o,a,c,d;const p=i.useRouteMatch(),{path:f}=p,{t:v}=(s(p,D),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"),g=null===(c=Digit)||void 0===c||null===(d=c.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===(E=x)&&(E=[]),E.filter(e=>window.location.href.includes(e.screenPath)).length>0?"":l.createElement(t.BackButton,null,"Back")),l.createElement(t.PrivateRoute,{path:f+"/petservice/new-application",component:m}),l.createElement(t.PrivateRoute,{path:f+"/petservice/application/:acknowledgementIds/:tenantId",component:h}),l.createElement(t.PrivateRoute,{path:f+"/petservice/my-applications",component:g}),l.createElement(t.PrivateRoute,{path:f+"/petservice/search",component:e=>l.createElement(Search,u({},e,{t:v,parentRoute:f}))}))));var E},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)}})},w=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},{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,s,c;return{t:n,tenantId:null==t?void 0:t.code,name:n(null==t?void 0:t.i18nKey)+" "+(c=n("ULBGRADE_"+(null==t||null===(r=t.city)||void 0===r?void 0:r.ulbGrade.toUpperCase().replace(" ","_").replace(".","_"))),c.toLowerCase().split(" ").map(w).join(" ")),email:null==t?void 0:t.emailId,phoneNumber:null==t?void 0:t.contactNumber,heading:n("PTR_ACKNOWLEDGEMENT"),details:[{title:n("CS_TITLE_APPLICATION_DETAILS"),values:[{title:n("PTR_APPLICATION_NUMBER"),value:null==e?void 0:e.applicationNumber},{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===(s=e.address)||void 0===s?void 0:s.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)}},O=e=>{const{t:t}=r.useTranslation();return e.isSuccess?window.location.href.includes("edit-application")?t("CS_PTR_UPDATE_APPLICATION_SUCCESS"):t("ES_PTR_RESPONSE_CREATE_ACTION"):e.isLoading?window.location.href.includes("edit-application")?t("CS_PTR_UPDATE_APPLICATION_PENDING"):t("CS_PTR_APPLICATION_PENDING"):e.isSuccess?void 0:window.location.href.includes("edit-application")?t("CS_PTR_UPDATE_APPLICATION_FAILED"):t("CS_PTR_APPLICATION_FAILED")},L={padding:"4px 0px",justifyContent:"space-between"},k=e=>{var n;return l.createElement(t.Banner,{message:O(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%"}})},M=e=>{var n;let{application:o,buttonLabel:a}=e;const{t:u}=r.useTranslation();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_CATEGORY"),note:u("PTR_APPLICATION")}),l.createElement(t.KeyNote,{keyValue:u("PTR_SEARCH_PET_TYPE"),note:null==o||null===(n=o.petDetails)||void 0===n?void 0:n.petType}),l.createElement(t.KeyNote,{keyValue:u("PT_COMMON_TABLE_COL_STATUS_LABEL"),note:u("PTR_COMMON_"+(null==o?void 0:o.status))}),l.createElement(i.Link,{to:"/digit-ui/citizen/ptr/petservice/application/"+(null==o?void 0:o.applicationNumber)+"/"+(null==o?void 0:o.tenantId)},l.createElement(t.SubmitBar,{label:a})))};var F,B=Array.isArray,U="object"==typeof self&&self&&self.Object===Object&&self,j="object"==typeof c&&c&&c.Object===Object&&c||U||Function("return this")(),H=j.Symbol,W=Object.prototype,z=W.hasOwnProperty,V=W.toString,q=H?H.toStringTag:void 0,G=Object.prototype.toString,K=H?H.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=z.call(e,q),n=e[q];try{e[q]=void 0;var l=!0}catch(e){}var r=V.call(e);return l&&(t?e[q]=n:delete e[q]),r}(e):function(e){return G.call(e)}(e)},$=function(e){return"symbol"==typeof e||function(e){return null!=e&&"object"==typeof e}(e)&&"[object Symbol]"==Y(e)},X=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Z=/^\w*$/,J=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},Q=j["__core-js_shared__"],ee=(F=/[^.]+$/.exec(Q&&Q.keys&&Q.keys.IE_PROTO||""))?"Symbol(src)_1."+F:"",te=Function.prototype.toString,ne=/^\[object .+?Constructor\]$/,le=RegExp("^"+Function.prototype.toString.call(Object.prototype.hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),re=function(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return function(e){return!(!J(e)||(t=e,ee&&ee in t))&&(function(e){if(!J(e))return!1;var t=Y(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}(e)?le:ne).test(function(e){if(null!=e){try{return te.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(e));var t}(n)?n:void 0},ie=re(Object,"create"),oe=Object.prototype.hasOwnProperty,ae=Object.prototype.hasOwnProperty;function ue(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])}}ue.prototype.clear=function(){this.__data__=ie?ie(null):{},this.size=0},ue.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},ue.prototype.get=function(e){var t=this.__data__;if(ie){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return oe.call(t,e)?t[e]:void 0},ue.prototype.has=function(e){var t=this.__data__;return ie?void 0!==t[e]:ae.call(t,e)},ue.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=ie&&void 0===t?"__lodash_hash_undefined__":t,this};var se=ue,ce=function(e,t){return e===t||e!=e&&t!=t},de=function(e,t){for(var n=e.length;n--;)if(ce(e[n][0],t))return n;return-1},pe=Array.prototype.splice;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.__data__=[],this.size=0},fe.prototype.delete=function(e){var t=this.__data__,n=de(t,e);return!(n<0||(n==t.length-1?t.pop():pe.call(t,n,1),--this.size,0))},fe.prototype.get=function(e){var t=this.__data__,n=de(t,e);return n<0?void 0:t[n][1]},fe.prototype.has=function(e){return de(this.__data__,e)>-1},fe.prototype.set=function(e,t){var n=this.__data__,l=de(n,e);return l<0?(++this.size,n.push([e,t])):n[l][1]=t,this};var ve=fe,me=re(j,"Map"),he=function(e,t){var n=e.__data__;return function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}(t)?n["string"==typeof t?"string":"hash"]:n.map};function ge(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var l=e[t];this.set(l[0],l[1])}}ge.prototype.clear=function(){this.size=0,this.__data__={hash:new se,map:new(me||ve),string:new se}},ge.prototype.delete=function(e){var t=he(this,e).delete(e);return this.size-=t?1:0,t},ge.prototype.get=function(e){return he(this,e).get(e)},ge.prototype.has=function(e){return he(this,e).has(e)},ge.prototype.set=function(e,t){var n=he(this,e),l=n.size;return n.set(e,t),this.size+=n.size==l?0:1,this};var Ee=ge;function _e(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(_e.Cache||Ee),n}_e.Cache=Ee;var ye,Se,be=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Te=/\\(\\)?/g,Ce=(ye=_e(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(be,function(e,n,l,r){t.push(l?r.replace(Te,"$1"):n||e)}),t},function(e){return 500===Se.size&&Se.clear(),e}),Se=ye.cache,ye),Ae=H?H.prototype:void 0,De=Ae?Ae.toString:void 0,xe=function(e){if("string"==typeof e||$(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t},Pe=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&&!$(e))||Z.test(e)||!X.test(e)||null!=t&&e in Object(t)}(e,t)?[e]:Ce(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,r=Array(l);++n<l;)r[n]=t(e[n],n,e);return r}(t,e)+"";if($(t))return De?De.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[xe(t[n++])];return n&&n==l?e:void 0}(e,t);return void 0===l?n:l};const Ne=["tenantId","payments"],we=e=>{let{t:n,currentPage:r,columns:i,data:o,getCellProps:a,disableSort:u,onSort:s,onNextPage:c,onPrevPage:d,onPageSizeChange:p,pageSizeLimit:f,sortParams:v,totalRecords:m}=e;return l.createElement(t.Table,{t:n,data:o,currentPage:r,columns:i,getCellProps:a,onNextPage:c,onPrevPage:d,pageSizeLimit:f,disableSort:u,onPageSizeChange:p,onSort:s,sortParams:v,totalRecords:m})},Re=e=>{let{businessService:o}=e;const{t:a}=r.useTranslation(),u=[{text:"ES_TITLE_NEW_PET_REGISTRATION",link:"/digit-ui/employee/ptr/new-application",businessService:"ptr",roles:["PT_CEMP"]},{text:"PTR_SEARCH_PET",link:"/digit-ui/employee/ptr/search",businessService:"ptr",roles:[]},{text:"PTR_COMMON_APPLICATION_SEARCH",link:"/digit-ui/employee/ptr/application-search",businessService:"ptr",roles:[]}],[s,c]=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)});c(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"},s.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)))}))))},Ie={date:t.DatePicker,mobileNumber:t.MobileNumber},Oe=e=>{var n;let{onSearch:i,type:a,onClose:s,searchFields:c,searchParams:d,isInboxPage:p,clearSearch:f}=e;const{t:v}=r.useTranslation(),{handleSubmit:m,reset:h,watch:g,control:E,formState:_,setValue:y}=o.useForm({defaultValues:p?d:u({locality:null,city:null},d)}),S=g(),b=innerWidth<=640;function T(){const e=c.reduce((e,t)=>u({},e,{[null==t?void 0:t.name]:""}),{});if(h(e),p){const e=u({},d);e.delete=[],c.forEach(t=>{e.delete.push(null==t?void 0:t.name)}),i(u({},e))}else f()}const C=e=>l.createElement(t.LinkLabel,{style:u({display:"inline"},e?{margin:0}:{}),onClick:T},v("ES_COMMON_CLEAR_SEARCH"));return l.createElement("form",{onSubmit:m(e=>{e.mobileNumber||delete e.mobileNumber,e.delete=[],c.forEach(t=>{e[t.name]||e.delete.push(t.name)}),i(e),"mobile"===a&&s()})},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,v("ES_COMMON_SEARCH_BY")),l.createElement("span",{onClick:s},l.createElement(t.CloseSvg,null))),l.createElement("div",{className:"complaint-input-container for-pt "+(p?"":"for-search"),style:{width:"100%",display:"grid"}},null==c||null===(n=c.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,v(e.label)+" "+(e.isMendatory?"*":"")),l.createElement(o.Controller,e.type?{render:t=>l.createElement(null==Ie?void 0:Ie[e.type],{formValue:S,setValue:y,onChange:t.onChange,value:t.value}),name:e.name,control:E,defaultValue:""}:{render:e=>l.createElement(t.TextInput,{onChange:e.onChange,value:e.value}),name:e.name,control:E,defaultValue:""})),null!=_&&null!==(r=_.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==_||null===(i=_.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,C())),"desktop"===a&&!b&&l.createElement("div",{style:{maxWidth:"unset",marginLeft:"unset"},className:"search-submit-wrapper"},l.createElement(t.SubmitBar,{className:"submit-bar-search",label:v("ES_COMMON_SEARCH"),disabled:!!Object.keys(_.errors).length||(()=>{var e;let t=!0;return Object.keys(S).forEach(e=>{!["locality","city"].includes(e)&&S[e]&&(t=!1)}),null==c||!c.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,C()))))),("mobile"===a||b)&&l.createElement(t.ActionBar,{className:"clear-search-container"},l.createElement("button",{className:"clear-search",style:{flex:1}},C(b)),l.createElement(t.SubmitBar,{disabled:!!Object.keys(_.errors).length,label:v("ES_COMMON_SEARCH"),style:{flex:1},submit:!0}))))},Le=["tableConfig","filterComponent"],ke=e=>{let{tableConfig:i,filterComponent:o}=e,a=s(e,Le);const{data:u,useNewInboxAPI:c}=a,{t:d}=r.useTranslation(),[p,f]=n.useState(()=>{var e;return null===(e=Digit.ComponentRegistryService)||void 0===e?void 0:e.getComponent(o)}),[v,m]=n.useState(()=>{var e;return null===(e=Digit.ComponentRegistryService)||void 0===e?void 0:e.getComponent(a.EmptyResultInboxComp)}),[h,g]=n.useState(!1),E=l.useMemo(()=>a.isSearch?i.searchColumns(a):i.inboxColumns(a)||[],[]);let _;return a.isLoading?_=l.createElement(t.Loader,null):h?_=null:!u||0===(null==u?void 0:u.length)||c&&null!=u&&u[0].dataEmpty?_=v&&l.createElement(v,{data:u})||(0===(null==u?void 0:u.length)||c&&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&&(_=l.createElement(we,{t:d,data:u,columns:E,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(Re,{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:c,statusMap:c?null==u?void 0:u[0].statusMap:null,moduleCode:a.moduleCode}))),l.createElement("div",{style:{flex:1}},l.createElement(Oe,{defaultSearchParams:a.defaultSearchParams,onSearch:e=>{a.onSearch(e),g(!1)},type:"desktop",searchFields:a.searchFields,isInboxPage:!(null!=a&&a.isSearch),searchParams:a.searchParams,clearSearch:()=>g(!0)}),l.createElement("div",{className:"result",style:{marginLeft:null!=a&&a.isSearch?"":"24px",flex:1}},_)))},Me=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")}]})))))},Fe=e=>{let{t:r,data:i,onFilterChange:o,onSearch:a,onSort:u,serviceRequestIdKey:s,isFstpOperator:c,isLoading:d,isSearch:p,searchParams:f,searchFields:v,sortParams:m,linkPrefix:h,filterComponent:g}=e;const[E,_]=n.useState(p?"SEARCH":""),[y,S]=n.useState(!!p),[b,T]=n.useState(m),[C]=n.useState(()=>{var e;return null===(e=Digit.ComponentRegistryService)||void 0===e?void 0:e.getComponent(g)});n.useEffect(()=>{E&&S(!0)},[E]);const A=()=>{S(!1),_(""),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:s,linkPrefix:h||"/digit-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:()=>{_("SEARCH"),S(!0)}}),!p&&o&&l.createElement(t.FilterAction,{text:"FILTER",handleActionClick:()=>{_("FILTER"),S(!0)}}),l.createElement(t.FilterAction,{text:"SORT",handleActionClick:()=>{_("SORT"),S(!0)}})),D,y&&l.createElement(t.PopUp,null,"FILTER"===E&&l.createElement("div",{className:"popup-module"},l.createElement(C,{onFilterChange:e=>{o(e),S(!1)},Close:A,type:"mobile",searchParams:f})),"SORT"===E&&l.createElement("div",{className:"popup-module"},l.createElement(Me,{type:"mobile",sortParams:m,onClose:A,onSort:u})),"SEARCH"===E&&l.createElement("div",{className:"popup-module"},l.createElement(Oe,{type:"mobile",onClose:A,onSearch:a,isFstpOperator:c,searchParams:f,searchFields:v}))))},Be=e=>{let{linkPrefix:o,classNameForMobileView:a=""}=e;const{t:u}=r.useTranslation(),s=[{text:u("ES_TITLE_NEW_REGISTRATION"),link:"/digit-ui/employee/ptr/new-application"},{text:u("ES_TITILE_SEARCH_APPLICATION"),link:o+"/search"}],[c,d]=n.useState([]),{roles:p}=Digit.UserService.getUser().info;return n.useEffect(()=>{let e=[];s.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"},c.map((e,t)=>{let{link:n,text:r}=e;return l.createElement("span",{className:"link",key:t},l.createElement(i.Link,{to:n},r))}))))},Ue=e=>{let{data:t,isLoading:n,isSearch:i,searchFields:o,onFilterChange:a,onSearch:u,onSort:s,parentRoute:c,searchParams:d,sortParams:p,linkPrefix:f,tableConfig:v,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(Be,{classNameForMobileView:"linksWrapperForMobileInbox",linkPrefix:c,isMobile:!0}),l.createElement(Fe,{t:h,data:null==t?void 0:t.map(e=>{const t={};return(i?v.searchColumns():v.inboxColumns()).forEach(n=>{n.mobileCell&&(t[n.Header]=n.mobileCell(e))}),t}),onFilterChange:a,isLoading:n,isSearch:i,onSearch:u,onSort:s,searchParams:d,searchFields:o,linkPrefix:f,sortParams:p,serviceRequestIdKey:null==v?void 0:v.serviceRequestIdKey,filterComponent:m}))))},je=["isFetching","isLoading","searchResponseKey","data","searchFields"],He=e=>{var i,o,a,c,d;let{useNewInboxAPI:p,parentRoute:f,moduleCode:v="PTR",initialStates:m={},filterComponent:h,isInbox:g,rawWfHandler:E,rawSearchHandler:_,combineResponse:y,wfConfig:S,searchConfig:b,middlewaresWf:T,middlewareSearch:C,EmptyResultInboxComp:A}=e;const D=Digit.ULBService.getCurrentTenantId(),{t:x}=r.useTranslation(),[P,N]=n.useState(()=>g?{}:{enabled:!1}),[w,R]=n.useState(()=>{var e;return null===(e=Digit.ComponentRegistryService)||void 0===e?void 0:e.getComponent("PTRInboxTableConfig")}),[I,O]=n.useState(m.pageOffset||0),[L,k]=n.useState(m.pageSize||10),[M,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==M||null===(i=M[0])||void 0===i?void 0:i.id,sortOrder:null!=M&&null!==(o=M[0])&&void 0!==o&&o.desc?"DESC":"ASC"}:{limit:L,offset:I,sortBy:null==M||null===(a=M[0])||void 0===a?void 0:a.id,sortOrder:null!=M&&null!==(c=M[0])&&void 0!==c&&c.desc?"DESC":"ASC"};const W=p?Digit.Hooks.useNewInboxGeneral({tenantId:D,ModuleCode:v,filters:u({},B,H,{sortParams:M})}):Digit.Hooks.useInboxGeneral({tenantId:D,businessService:v,isInbox:g,filters:u({},B,H,{sortParams:M}),rawWfHandler:E,rawSearchHandler:_,combineResponse:y,wfConfig:S,searchConfig:u({},P,b),middlewaresWf:T,middlewareSearch:C}),{isLoading:z,data:V,searchFields:q}=W,G=s(W,je);n.useEffect(()=>{O(0)},[B]);const K=e=>{let t=e.delete,n=u({},B,e);t&&t.forEach(e=>delete n[e]),delete e.delete,U(u({},n)),N({enabled:!0})},Y=n.useCallback(e=>{0!==e.length&&F(e)},[]);var $,X;if(null!==(null==G||null===(d=G.data)||void 0===d?void 0:d.length))return j?l.createElement(Ue,{data:V,isLoading:z,isSearch:!g,searchFields:q,onFilterChange:K,onSearch:K,onSort:Y,parentRoute:f,searchParams:B,sortParams:M,linkPrefix:f+"/application-details/",tableConfig:null!=G&&G.tableConfig?null===($=res)||void 0===$?void 0:$.tableConfig:w(x).PTR,filterComponent:h,EmptyResultInboxComp:A,useNewInboxAPI:p}):l.createElement("div",null,g&&l.createElement(t.Header,null,x("ES_COMMON_INBOX")),l.createElement(ke,{moduleCode:v,data:V,tableConfig:w(x).PTR,isLoading:z,defaultSearchParams:m.searchParams,isSearch:!g,onFilterChange:K,searchFields:q,onSearch:K,onSort:Y,onNextPage:()=>{O(e=>e+L)},onPrevPage:()=>{O(e=>e-L)},currentPage:Math.floor(I/L),pageSizeLimit:L,disableSort:!1,onPageSizeChange:e=>{k(Number(e.target.value))},parentRoute:f,searchParams:B,sortParams:M,totalRecords:Number(null==V||null===(X=V[0])||void 0===X?void 0:X.totalCount),filterComponent:h,EmptyResultInboxComp:A,useNewInboxAPI:p}))},We=e=>{var r,a;let{isLoading:u,t:s,onSubmit:c,data:d,count:p,setShowToast:f}=e;const v=window.Digit.Utils.browser.isMobile(),{register:m,control:h,handleSubmit:g,setValue:E,getValues:_,reset:y,formState:S}=o.useForm({defaultValues:{offset:0,limit:!v&&10,sortBy:"commencementDate",sortOrder:"DESC"}});n.useEffect(()=>{m("offset",0),m("limit",10),m("sortBy","commencementDate"),m("sortOrder","DESC")},[m]);const b=Digit.ULBService.getStateId(),{data:T}=Digit.Hooks.ptr.usePTRPetMDMS(b,"PetService","PetType");let C=[];T&&T.map(e=>{C.push({i18nKey:"PTR_PET_"+e.code,code:""+e.code,value:""+e.name})});const A=e=>l.createElement("span",{className:"cell-text"},e),D=n.useMemo(()=>[{Header:s("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:"/digit-ui/employee/ptr/petservice/applicationsearch/application-details/"+t.original.applicationNumber},t.original.applicationNumber)))}},{Header:s("PTR_APPLICANT_NAME"),Cell:e=>{var t,n;return A(""+(null==e||null===(t=e.row)||void 0===t||null===(n=t.original)||void 0===n?void 0:n.applicantName))},disableSortBy:!0},{Header:s("PTR_PET_TYPE"),Cell:e=>{var t,n;let{row:l}=e;return A(""+(null===(t=l.original)||void 0===t||null===(n=t.petDetails)||void 0===n?void 0:n.petType))},disableSortBy:!0},{Header:s("PTR_BREED_TYPE"),Cell:e=>{var t,n;let{row:l}=e;return A(""+(null===(t=l.original)||void 0===t||null===(n=t.petDetails)||void 0===n?void 0:n.breedType))},disableSortBy:!0},{Header:s("PTR_MOBILE_NUMBER"),Cell:e=>{var t;let{row:n}=e;return A(""+(null==n||null===(t=n.original)||void 0===t?void 0:t.mobileNumber))},disableSortBy:!0}],[]),x=n.useCallback(e=>{0!==e.length&&(E("sortBy",e.id),E("sortOrder",e.desc?"DESC":"ASC"))},[]);function P(){E("offset",_("offset")-_("limit")),g(c)()}return l.createElement(l.Fragment,null,l.createElement("div",null,l.createElement(t.Header,null,s("PTR_SEARCH_PET_APPLICATIONS")),l.createElement(t.Card,{className:"card-search-heading"},l.createElement("span",{style:{color:"#505A5F"}},s("Provide at least one parameter to search for an application"))),l.createElement(t.SearchForm,{onSubmit:c,handleSubmit:g},l.createElement(t.SearchField,null,l.createElement("label",null,s("PTR_APPLICATION_NO_LABEL")),l.createElement(t.TextInput,{name:"applicationNumber",inputRef:m({})})),l.createElement(t.SearchField,null,l.createElement("label",null,s("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:s,disable:!1})})),l.createElement(t.SearchField,null,l.createElement("label",null,s("PTR_OWNER_MOBILE_NO")),l.createElement(t.MobileNumber,{name:"mobileNumber",inputRef:m({minLength:{value:10,message:s("CORE_COMMON_MOBILE_ERROR")},maxLength:{value:10,message:s("CORE_COMMON_MOBILE_ERROR")},pattern:{value:/[6789][0-9]{9}/,message:s("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,s("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,s("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:s("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"}),f(null),P()}},s("ES_COMMON_CLEAR_ALL")))),!u&&null!=d&&d.display?l.createElement(t.Card,{style:{marginTop:20}},s(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:s,data:d,totalRecords:p,columns:D,getCellProps:e=>({style:{minWidth:e.column.Header===s("PTR_INBOX_APPLICATION_NO")?"240px":"",padding:"20px 18px",fontSize:"16px"}}),onPageSizeChange:function(e){E("limit",Number(e.target.value)),g(c)()},currentPage:_("offset")/_("limit"),onNextPage:function(){E("offset",_("offset")+_("limit")),g(c)()},onPrevPage:P,pageSizeLimit:_("limit"),onSort:x,disableSort:!1,sortParams:[{id:_("sortBy"),desc:"DESC"===_("sortOrder")}]})))},ze=e=>{i.useParams();const{t:o}=r.useTranslation(),a=Digit.ULBService.getCurrentTenantId(),[s,c]=n.useState({}),[d,p]=n.useState(null),f={enabled:!!(s&&Object.keys(s).length>0)},{isLoading:v,isSuccess:m,data:{PetRegistrationApplications:h,Count:g}={}}=Digit.Hooks.ptr.usePTRSearch({tenantId:a,filters:s},f);return l.createElement(l.Fragment,null,l.createElement(We,{t:o,isLoading:v,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"}):c(r):p({warning:!0,label:"ERR_PROVIDE_MORE_PARAM_WITH_TYPE_STATUS"}):p({warning:!0,label:"ERR_PTR_FILL_VALID_FIELDS"})},data:m&&!v?h.length>0?h:{display:"ES_COMMON_NO_DATA"}:"",count:g}),d&&l.createElement(t.Toast,{error:d.error,warning:d.warning,label:o(d.label),isDleteBtn:!0,onClose:()=>{p(null)}}))},Ve=e=>{var n,o,a,s,c,d,p,f;let{path:v,url:m,userType:h}=e;const{t:g}=r.useTranslation(),E=i.useLocation();sessionStorage.removeItem("revalidateddone");const _=window.Digit.Utils.browser.isMobile(),y={searchParams:{uuid:{code:"ASSIGNED_TO_ALL",name:"ES_INBOX_ASSIGNED_TO_ALL"},services:["ptr"],applicationStatus:[],locality:[]}},S=e=>{let{location:n}=e;const{t:o}=r.useTranslation(),a=i.useLocation().search,u=(new URLSearchParams(a).get("from"),Digit.Hooks.useQueryParams(),[{path:"/digit-ui/employee",content:o("ES_COMMON_HOME"),show:!0},{path:"/digit-ui/employee/ptr/petservice/inbox",content:o("ES_TITLE_INBOX"),show:!!n.pathname.includes("ptr/petservice/inbox")},{path:"/digit-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:_?{display:"flex"}:{},spanStyle:{maxWidth:"min-content"},crumbs:u})},b=null===(n=Digit)||void 0===n||null===(o=n.ComponentRegistryService)||void 0===o?void 0:o.getComponent("PTRNewApplication"),T=null===(a=Digit)||void 0===a||null===(s=a.ComponentRegistryService)||void 0===s?void 0:s.getComponent("ApplicationDetails"),C=null===(c=Digit)||void 0===c||null===(d=c.ComponentRegistryService)||void 0===d?void 0:d.getComponent("PTRResponse"),A=(null===(p=Digit)||void 0===p||null===(f=p.ComponentRegistryService)||void 0===f||f.getComponent("PTRDocsRequired"),window.location.href.includes("ptr/response")),D=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"},A?null:l.createElement("div",{style:D?{marginLeft:"12px"}:{marginLeft:"-4px"}},l.createElement(S,{location:E})),l.createElement(t.PrivateRoute,{exact:!0,path:v+"/",component:()=>l.createElement(Dr,{matchPath:v,userType:h})}),l.createElement(t.PrivateRoute,{path:v+"/petservice/inbox",component:()=>l.createElement(He,{useNewInboxAPI:!0,parentRoute:v,businessService:"ptr",filterComponent:"PTR_INBOX_FILTER",initialStates:y,isInbox:!0})}),l.createElement(t.PrivateRoute,{path:v+"/petservice/new-application",component:()=>l.createElement(b,{parentUrl:m})}),l.createElement(t.PrivateRoute,{path:v+"/petservice/application-details/:id",component:()=>l.createElement(T,{parentRoute:v})}),l.createElement(t.PrivateRoute,{path:v+"/petservice/applicationsearch/application-details/:id",component:()=>l.createElement(T,{parentRoute:v})}),l.createElement(t.PrivateRoute,{path:v+"/petservice/response",component:e=>l.createElement(C,u({},e,{parentRoute:v}))}),l.createElement(t.PrivateRoute,{path:v+"/petservice/search",component:e=>l.createElement(Search,u({},e,{t:g,parentRoute:v}))}),l.createElement(t.PrivateRoute,{path:v+"/searchold",component:()=>l.createElement(He,{parentRoute:v,businessService:"ptr",middlewareSearch:searchMW,initialStates:y,isInbox:!1,EmptyResultInboxComp:"PTEmptyResultInbox"})}),l.createElement(t.PrivateRoute,{path:v+"/petservice/my-applications",component:e=>l.createElement(ze,u({},e,{parentRoute:v}))}))))},qe=e=>{var n;let{status:i,searchParams:o,onAssignmentChange:a,statusMap:s}=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==s||null===(n=s.find(e=>e.statusid===i.uuid))||void 0===n?void 0:n.count)||"-")+")"})},Ge=e=>{var i,o,a,s,c;let{onAssignmentChange:d,searchParams:p,businessServices:f,statusMap:v}=e;const{t:m}=r.useTranslation(),[h,g]=n.useState(!1),{data:E,isLoading:_}=Digit.Hooks.useApplicationStatusGeneral({businessServices:f},{}),{userRoleStates:y}=E||{},S=(e,t)=>t(map[e.stateBusinessService])+" - "+t("ES_PTR_COMMON_STATUS_"+(e.state||"CREATED"));return _?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(qe,{businessServices:f,key:t,onAssignmentChange:d,status:u({name:S(e,m),code:e.applicationStatus},e),searchParams:p,statusMap:v})),(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===(s=y.filter(e=>!e.isTerminateState))||void 0===s||null===(c=s.slice(4))||void 0===c?void 0:c.map((e,t)=>l.createElement(qe,{businessServices:f,key:e.uuid,onAssignmentChange:d,status:u({name:S(e,m),code:e.applicationStatus},e),searchParams:p,statusMap:v}))),l.createElement("div",{className:"filter-button",onClick:()=>g(!h)}," ",m(h?"ES_COMMON_LESS":"ES_COMMON_MORE")," ")):null):null},Ke=["searchParams","onFilterChange","defaultSearchParams","statusMap","moduleCode"],Ye=e=>{var i;let{searchParams:o,onFilterChange:c,defaultSearchParams:d,statusMap:p,moduleCode:f}=e,v=s(e,Ke);const{t:m}=r.useTranslation(),h=a.useQueryClient(),[g,E]=n.useState(()=>u({},o,{services:[]})),_=[{label:"PTR_NEW_REGISTRATION",value:"ptr"}],y=e=>{let t=e.delete,n=u({},g,e);t&&t.forEach(e=>delete n[e]),delete e.delete,E(u({},n))},S=()=>{E(u({},d,{services:[]})),c(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"===v.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"===v.type&&l.createElement("span",{onClick:v.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==g?void 0:g.locality)||[],e]})},tenantId:b,boundaryType:"revenue"}),l.createElement("div",{className:"tag-container"},null==g||null===(i=g.locality)||void 0===i?void 0:i.map((e,n)=>l.createElement(t.RemoveableTag,{key:n,text:m(e.i18nkey),onClick:()=>{y({locality:null==g?void 0:g.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")),_.map((e,n)=>{var r;const i=null==g||null===(r=g.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(g.services)?[...g.services,t]:[t]}:{services:g.services.filter(e=>e!==t),applicationStatus:null===(n=g.applicationStatus)||void 0===n?void 0:n.filter(e=>e.stateBusinessService!==t)})})(t,e.value)})})),l.createElement("div",null,l.createElement(Ge,{searchParams:g,businessServices:g.services,statusMap:p||h.getQueryData("INBOX_STATUS_MAP_"+f),moduleCode:f,onAssignmentChange:(e,t)=>{if(e.target.checked)y({applicationStatus:[...null==g?void 0:g.applicationStatus,t]});else{let e=null==g?void 0:g.applicationStatus.filter(e=>e.state!==t.state);y({applicationStatus:e})}}})),l.createElement("div",null,l.createElement(t.SubmitBar,{onSubmit:()=>{c(0===g.services.length?u({},g,{services:_.map(e=>e.value)}):g)},label:m("ES_COMMON_APPLY")}))))))},$e=e=>l.createElement("span",{className:"cell-text"},e),Xe=e=>l.createElement("span",{className:"sla-cell"},e),Ze=[{head:"ES_TITILE_OWNER_DETAILS",body:[{component:"PTROwnerDetails",withoutLabel:!0,key:"owners",type:"component"}]},{head:"ES_TITILE_PET_DETAILS",body:[{component:"PTRPetdetails",withoutLabel:!0,key:"pets",type:"component"}]},{head:"PTR_LOCATION_DETAILS",body:[{route:"pincode",component:"PTRSelectPincode",texts:{headerCaption:"PTR_CAPTION",header:"PTR_PINCODE_LABEL",cardText:"PTR_PINCODE_TEXT",submitBarLabel:"PTR_COMMON_NEXT",skipText:"CORE_COMMON_SKIP_CONTINUE"},withoutLabel:!0,key:"address",nextStep:"address",type:"component"},{route:"address",component:"PTRSelectAddress",withoutLabel:!0,key:"address",nextStep:"street",isMandatory:!0,type:"component"},{type:"component",route:"street",component:"PTRSelectStreet",key:"address",withoutLabel:!0,nextStep:"landmark"},{type:"component",route:"landmark",component:"PTSelectLandmark",withoutLabel:!0,key:"address",hideInEmployee:!0}]},{head:"ES_TITILE_DOCUMENT_DETAILS",body:[{component:"PTRDocumentUpload",withoutLabel:!0,key:"documents",type:"component"}]}];function Je(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 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:s,closeModal:c,submitAction:d,applicationData:p,businessService:f,moduleCode:v}=e;const{data:m,isLoading:h}=Digit.Hooks.useEmployeeSearch(s,{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:g,data:E}=Digit.Hooks.pt.useMDMS(s,f,"FINANCIAL_YEARLS",{},{details:{tenantId:Digit.ULBService.getStateId(),moduleDetails:[{moduleName:"egf-master",masterDetails:[{name:"FinancialYear",filter:"[?(@.module == 'PT')]"}]}]}}),[_,y]=n.useState({}),[S,b]=n.useState({}),[T,C]=n.useState([]),[A,D]=n.useState(null),[x,P]=n.useState(null),[N,w]=n.useState(null),[R,I]=n.useState(null),[O,L]=n.useState([]),[k,M]=n.useState(null),[F,B]=n.useState(!1);function U(e){P(e.target.files[0])}return n.useEffect(()=>{var e;E&&E["egf-master"]&&L(null===(e=E["egf-master"])||void 0===e?void 0:e.FinancialYear)},[E]),n.useEffect(()=>{var e;C(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(x){const e=function(){if(x.size>=5242880)I(o("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=Je(function(){return Promise.resolve(Digit.UploadServices.Filestorage("PT",x,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?w(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)}}()},[x]),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:k,setSelectedFinancialYear:M}):(e=>{var n;let{t:r,action:i,approvers:o,selectedApprover:a,setSelectedApprover:u,selectFile:s,uploadedFile:c,setUploadedFile:d,assigneeLabel:p,businessService:f}=e;return{label:{heading:"WF_"+(null==i?void 0:i.action)+"_APPLICATION",submit:"WF_"+f+"_"+(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:s,onDelete:()=>{d(null)},showHint:!0,hintText:r("PT_ATTACH_RESTRICTIONS_SIZE"),message:c?"1 "+r("ES_PT_ACTION_FILEUPLOADED"):r("ES_PT_ACTION_NO_FILEUPLOADED")})}]}]}})({t:o,action:a,approvers:T,selectedApprover:A,setSelectedApprover:D,selectFile:U,uploadedFile:N,setUploadedFile:w,businessService:f}))},[a,T,O,k,N]),a&&_.form?l.createElement(t.Modal,{headerBarMain:l.createElement(Qe,{label:o(_.label.heading)}),headerBarEnd:l.createElement(tt,{onClick:c}),actionCancelLabel:o(_.label.cancel),actionCancelOnSubmit:c,actionSaveLabel:o(_.label.submit),actionSaveOnSubmit:()=>{},isDisabled:a.showFinancialYearsModal?!k:h||(null==a?void 0:a.docUploadRequired)&&!N,formId:"modal-action"},g?l.createElement(t.Loader,null):l.createElement(t.FormComposer,{config:_.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){if("INACTIVE_PROPERTY"==(null==a?void 0:a.action)){let t={action:"OPEN",comment:null==e?void 0:e.comments,businessService:"PT.CREATE",moduleName:"PT"};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==k?void 0:k.name,propertyId:null==p?void 0:p.propertyId,tenantId:s,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:f,moduleName:v};t.assignes=null!=a&&a.isTerminateState||!A?[]:[A],N&&(t.documents=[{documentType:(null==a?void 0:a.action)+" DOC",fileName:null==x?void 0:x.name,fileStoreId:N}]),d({Property:u({},p,{workflow:t})})}},defaultValues:S,formId:"modal-action"})):l.createElement(t.Loader,null)},lt=e=>l.createElement("h1",{className:"heading-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:s,closeModal:c,submitAction:d,applicationData:p,businessService:f}=e;const{data:v}=Digit.Hooks.useEmployeeSearch(s,{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(s,f,"FINANCIAL_YEARLS",{},{details:{tenantId:Digit.ULBService.getStateId(),moduleDetails:[{moduleName:"egf-master",masterDetails:[{name:"FinancialYear",filter:"[?(@.module == 'TL')]"}]}]}}),[g,E]=n.useState({}),[_,y]=n.useState({}),[S,b]=n.useState([]),[T,C]=n.useState({}),[A,D]=n.useState(null),[x,P]=n.useState(null),[N,w]=n.useState(null),[R,I]=n.useState([]),[O,L]=n.useState(null);n.useEffect(()=>{var e;h&&h["egf-master"]&&I(null===(e=h["egf-master"])||void 0===e?void 0:e.FinancialYear)},[h]);const{data:k}=Digit.Hooks.useCustomMDMS(s,"common-masters",[{name:"Department"}]);function M(e){D(e.target.files[0])}return n.useEffect(()=>{if(v&&k){var e;const t=k["common-masters"].Department;b(null==v||null===(e=v.Employees)||void 0===e?void 0:e.map(e=>{var n,l,r;const i=null==e||null===(n=e.assignments)||void 0===n||null===(l=n[0])||void 0===l?void 0:l.department,o=null==t?void 0:t.find(e=>(null==e?void 0:e.code)===i);return console.log("matchedDept===",o),{uuid:null==e?void 0:e.uuid,name:(null==e||null===(r=e.user)||void 0===r?void 0:r.name)+" - "+(null==o?void 0:o.name)}}))}},[v]),n.useEffect(()=>{!function(){try{w(null);const e=function(){if(A){const e=function(){if(A.size>=5242880)w(o("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=Je(function(){return Promise.resolve(Digit.UploadServices.Filestorage("PT",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?P(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)}}()},[A]),n.useEffect(()=>{a&&E((e=>{let{t:n,action:r,approvers:i,selectedApprover:o,setSelectedApprover:a,selectFile:u,uploadedFile:s,setUploadedFile:c,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:()=>{c(null)},message:s?"1 "+n("ES_PT_ACTION_FILEUPLOADED"):n("CS_ACTION_NO_FILEUPLOADED")})}]}]}})({t:o,action:a,approvers:S,selectedApprover:T,setSelectedApprover:C,selectFile:M,uploadedFile:x,setUploadedFile:P,businessService:f}))},[a,S,R,O,x]),a&&g.form?l.createElement(t.Modal,{headerBarMain:l.createElement(lt,{label:o(g.label.heading)}),headerBarEnd:l.createElement(it,{onClick:c}),actionCancelLabel:o(g.label.cancel),actionCancelOnSubmit:c,actionSaveLabel:o(g.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},m?l.createElement(t.Loader,null):l.createElement(t.FormComposer,{config:g.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:x?[{documentType:(null==a?void 0:a.action)+" DOC",fileName:null==A?void 0:A.name,fileStoreId:x}]:null}),d({Licenses:[p]})},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"})),st=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(ut,null)),ct=e=>{var r,i;let{t:o,action:a,tenantId:s,closeModal:c,submitAction:d,applicationData:p,businessService:f}=e;const{data:v,isLoading:m}=Digit.Hooks.useEmployeeSearch(s,{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,g]=n.useState({}),[E,_]=n.useState({}),[y,S]=n.useState([]),[b,T]=n.useState({}),[C,A]=n.useState(null),[D,x]=n.useState(null),[P,N]=n.useState(null),w=!!Digit.Utils.browser.isMobile();function R(e){A(e.target.files[0])}return n.useEffect(()=>{var e;S(null==v||null===(e=v.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[v]),n.useEffect(()=>{!function(){try{N(null);const e=function(){if(C){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(C.size>=5242880)N(o("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=C&&C.type&&!e.test(null==C?void 0:C.type))N(o("NOT_SUPPORTED_FILE_TYPE"));else{const e=Je(function(){return Promise.resolve(Digit.UploadServices.Filestorage("OBPS",C,Digit.ULBService.getStateId()||(null==s?void 0:s.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?x(null==e||null===(l=e.data)||void 0===l||null===(r=l.files[0])||void 0===r?void 0:r.fileStoreId):N(o("CS_FILE_UPLOAD_ERROR"))})},function(){N(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)}}()},[C]),n.useEffect(()=>{a&&g((e=>{let{t:n,action:r,approvers:i,selectedApprover:o,setSelectedApprover:a,selectFile:u,uploadedFile:s,setUploadedFile:c,businessService:d,error:p}=e,f=!0;return"SENDBACKTOCITIZEN"==(null==r?void 0:r.action)&&(f=!1),r.isTerminateState&&(f=!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:f?n("WF_ASSIGNEE_NAME_LABEL"):null,placeholder:f?n("WF_ASSIGNEE_NAME_PLACEHOLDER"):null,type:"dropdown",populators:f?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:()=>{c(null)},message:s?"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:R,uploadedFile:D,setUploadedFile:x,businessService:f,error:P}))},[a,y,D,P]),a&&h.form?l.createElement(t.Modal,{headerBarMain:l.createElement(at,{label:o(h.label.heading)}),headerBarEnd:l.createElement(st,{onClick:c}),actionCancelLabel:o(h.label.cancel),actionCancelOnSubmit:c,actionSaveLabel:o(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"}:{}},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==C?void 0:C.name,fileStoreId:D}]:null}),d({Licenses:[p]},!1,{isStakeholder:!0,bpa:!1})},defaultValues:E,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"})),ft=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(pt,null)),vt=e=>{var r,i,o,s,c,d,p,f,v,m,h,g;let{t:E,action:_,tenantId:y,closeModal:S,submitAction:b,applicationDetails:T,applicationData:C,businessService:A,workflowDetails:D,blockReason:x}=e;console.log("applicationData",C),console.log("workflowDetails",D),Digit.Hooks.obps.useObpsAPI(null!==(r=C)&&void 0!==r&&null!==(i=r.landInfo)&&void 0!==i&&null!==(o=i.address)&&void 0!==o&&o.city?null===(s=C)||void 0===s||null===(c=s.landInfo)||void 0===c||null===(d=c.address)||void 0===d?void 0:d.city:y,!1);const{data:P,isLoading:N}=Digit.Hooks.useEmployeeSearch(y,{roles:null==D||null===(p=D.data)||void 0===p||null===(f=p.initialActionState)||void 0===f||null===(v=f.nextActions)||void 0===v||null===(m=v.filter(e=>(null==e?void 0:e.action)==(null==_?void 0:_.action)))||void 0===m||null===(h=m[0])||void 0===h||null===(g=h.assigneeRoles)||void 0===g?void 0:g.map(e=>({code:e})),isActive:!0},{enabled:!(null!=_&&_.isTerminateState)}),[w,R]=(a.useQueryClient(),n.useState({})),[I,O]=n.useState({}),[L,k]=n.useState([]),[M,F]=n.useState([]),[B,U]=n.useState({}),[j,H]=n.useState({}),[W,z]=n.useState(null),[V,q]=n.useState(null),[G,K]=n.useState(null),[Y,$]=n.useState(null),X=!!Digit.Utils.browser.isMobile();function Z(e){z(e.target.files[0])}n.useEffect(()=>{var e;k(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{K(null);const e=function(){if(W){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(W.size>=5242880)K(E("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=W&&W.type&&!e.test(null==W?void 0:W.type))K(E("NOT_SUPPORTED_FILE_TYPE"));else{const e=Je(function(){return Promise.resolve(Digit.UploadServices.Filestorage("OBPS",W,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?q(null==e||null===(l=e.data)||void 0===l||null===(r=l.files[0])||void 0===r?void 0:r.fileStoreId):K(E("CS_FILE_UPLOAD_ERROR"))})},function(){K(E("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[W]);const J=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},Q=e=>{let t=[];var n;for(n=0;n<(null==e?void 0:e.questionLength);n++){var l;t.push({remarks:e["Remarks_"+n],question:null==e?void 0:e.questionList[n].question,value:null==e||null===(l=e["question_"+n])||void 0===l?void 0:l.code})}return t},ee=e=>{var t,n;let l=[],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),r=r.filter(e=>{if(!e.date)return!1;const t=new Date;return new Date(e.date)<=t}),"FIELDINSPECTION_INPROGRESS"==e.status?(l=JSON.parse(sessionStorage.getItem("INSPECTION_DATA")),(null===(o=l)||void 0===o?void 0:o.length)>0&&l.map((e,t)=>{r.push({docs:J(e.Documents),date:e.InspectionDate,questions:Q(e),time:null==e?void 0:e.InspectionTime})}),console.log("FIELDINSPECTION_INPROGRESS",r),r=r.filter(e=>e.date&&e.time),console.log("inspectionObinspectionOb",r)):sessionStorage.removeItem("INSPECTION_DATA"),[...r]},te=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},ne=()=>{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(()=>{F(null==x?void 0:x.map(e=>({code:null==e?void 0:e.code,name:null==e?void 0:e.value}))),_&&R((e=>{var n,r,i,o,a,u,s;let{t:c,action:d,approvers:p,selectedApprover:f,setSelectedApprover:v,selectedBlockReason:m,setBlockReason:h,selectFile:g,uploadedFile:E,setUploadedFile:_,assigneeLabel:y,businessService:S,error:b,blockReasonFiltered:T}=e,C=!1;return"REVOCATE"!=(null==d?void 0:d.action)&&"REJECT"!=(null==d?void 0:d.action)&&"SKIP_PAYMENT"!=d.action&&"SEND_BACK_TO_CITIZEN"!=(null==d?void 0:d.action)&&"APPROVE"!=(null==d?void 0:d.action)||(C=!0),{label:{heading:"WF_"+(null==d?void 0:d.action)+"_APPLICATION",submit:"WF_"+S+"_"+(null==d?void 0:d.action),cancel:"BPA_CITIZEN_CANCEL_BUTTON"},form:[{body:[{label:d.isTerminateState||C||"BLOCK"==(null==d?void 0:d.action)&&"PENDINGAPPROVAL"==(null==d||null===(n=d.state)||void 0===n?void 0:n.state)||"FORWARD"==(null==d?void 0:d.action)&&"FIELDINSPECTION_PENDING"==(null==d||null===(r=d.state)||void 0===r?void 0:r.state)?null:c(y||"WF_ROLE_"+(null===(i=d.assigneeRoles)||void 0===i?void 0:i[0])),type:"dropdown",populators:d.isTerminateState||C||"BLOCK"==(null==d?void 0:d.action)&&"PENDINGAPPROVAL"==(null==d||null===(o=d.state)||void 0===o?void 0:o.state)||"FORWARD"==(null==d?void 0:d.action)&&"FIELDINSPECTION_PENDING"==(null==d||null===(a=d.state)||void 0===a?void 0:a.state)?null:l.createElement(t.Dropdown,{option:p,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:v,selected:f})},{label:"BLOCK"==(null==d?void 0:d.action)&&"PENDINGAPPROVAL"==(null==d||null===(u=d.state)||void 0===u?void 0:u.state)?c("BLOCK_REASON"):null,type:"dropdown",populators:"BLOCK"==(null==d?void 0:d.action)&&"PENDINGAPPROVAL"==(null==d||null===(s=d.state)||void 0===s?void 0:s.state)?l.createElement(t.Dropdown,{option:T,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:h,selected:m,isMandatory:!0}):null},{label:c("WF_COMMON_COMMENTS"),type:"textarea",isMandatory:!0,populators:{name:"comments"}},{label:""+c("WF_APPROVAL_UPLOAD_HEAD"),populators:l.createElement(t.UploadFile,{id:"workflow-doc",onUpload:g,onDelete:()=>{_(null)},message:E?"1 "+c("ES_PT_ACTION_FILEUPLOADED"):c("CS_ACTION_NO_FILEUPLOADED"),accept:"image/*, .pdf, .png, .jpeg, .jpg",iserror:b})}]}]}})({t:E,action:_,approvers:L,selectedApprover:B,setSelectedApprover:U,selectedBlockReason:j,setBlockReason:H,selectFile:Z,uploadedFile:V,setUploadedFile:q,businessService:A,assigneeLabel:"WF_ASSIGNEE_NAME_LABEL_BPA",error:G,blockReasonFiltered:M}))},[_,L,Y,V,G]),_&&w.form?l.createElement(t.Modal,{headerBarMain:l.createElement(dt,{label:E(w.label.heading)}),headerBarEnd:l.createElement(ft,{onClick:S}),actionCancelLabel:E(w.label.cancel),actionCancelOnSubmit:S,actionSaveLabel:E(w.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action",isOBPSFlow:!0,popupStyles:X?{width:"720px"}:{},style:X?{minHeight:"45px",height:"auto",width:"44%"}:{minHeight:"45px",height:"auto",width:"107px",paddingLeft:"0px",paddingRight:"0px"},popupModuleMianStyles:X?{paddingLeft:"5px"}:{}},N?l.createElement(t.Loader,null):l.createElement(t.FormComposer,{config:w.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,s,c,d,p,f,v,m,h,g,A,x,P,N,w,R,I,O,L,k,M;C=u({},C,{documents:te(),additionalDetails:u({},null===(t=C)||void 0===t?void 0:t.additionalDetails,{fieldinspection_pending:ee(C),pendingapproval:ne(),blockingReason:null==j?void 0:j.name}),workflow:{action:null==_?void 0:_.action,comment:(null==e||null===(n=e.comments)||void 0===n?void 0:n.length)>0?null==e?void 0:e.comments:null,comments:(null==e||null===(l=e.comments)||void 0===l?void 0:l.length)>0?null==e?void 0:e.comments:null,assignee:"FIELDINSPECTION_INPROGRESS"===(null==D||null===(r=D.data)||void 0===r||null===(i=r.processInstances)||void 0===i||null===(o=i[0])||void 0===o||null===(a=o.state)||void 0===a?void 0:a.applicationStatus)?[null==D||null===(s=D.data)||void 0===s||null===(c=s.processInstances)||void 0===c||null===(d=c[0])||void 0===d||null===(p=d.assigner)||void 0===p?void 0:p.uuid]:null!=B&&B.uuid?[null==B?void 0:B.uuid]:null,assignes:"FIELDINSPECTION_INPROGRESS"===(null==D||null===(f=D.data)||void 0===f||null===(v=f.processInstances)||void 0===v||null===(m=v[0])||void 0===m||null===(h=m.state)||void 0===h?void 0:h.applicationStatus)?[null==D||null===(g=D.data)||void 0===g||null===(A=g.processInstances)||void 0===A||null===(x=A[0])||void 0===x||null===(P=x.assigner)||void 0===P?void 0:P.uuid]:null!=B&&B.uuid?[null==B?void 0:B.uuid]:null,varificationDocuments:V?[{documentType:(null==_?void 0:_.action)+" DOC",fileName:null==W?void 0:W.name,fileStoreId:V}]:null},action:null==_?void 0:_.action,comment:null==e?void 0:e.comments,assignee:"FIELDINSPECTION_INPROGRESS"===(null==D||null===(N=D.data)||void 0===N||null===(w=N.processInstances)||void 0===w||null===(R=w[0])||void 0===R||null===(I=R.state)||void 0===I?void 0:I.applicationStatus)?[null==D||null===(O=D.data)||void 0===O||null===(L=O.processInstances)||void 0===L||null===(k=L[0])||void 0===k||null===(M=k.assigner)||void 0===M?void 0:M.uuid]:null!=B&&B.uuid?[null==B?void 0:B.uuid]:null,wfDocuments:V?[{documentType:(null==_?void 0:_.action)+" DOC",fileName:null==W?void 0:W.name,fileStoreId:V}]:null});const F=function(e,t,n,l,r,i,o,a,s,c,d,p){if(!(parseInt(sessionStorage.getItem("lessAdjusment"))>parseInt(sessionStorage.getItem("development"))+parseInt(sessionStorage.getItem("otherCharges"))+parseInt(null===(e=C)||void 0===e||null===(t=e.additionalDetails)||void 0===t||null===(n=t.selfCertificationCharges)||void 0===n?void 0:n.BPA_MALBA_CHARGES)+parseInt(null===(l=C)||void 0===l||null===(r=l.additionalDetails)||void 0===r||null===(i=r.selfCertificationCharges)||void 0===i?void 0:i.BPA_LABOUR_CESS)+parseInt(null===(o=C)||void 0===o||null===(a=o.additionalDetails)||void 0===a||null===(s=a.selfCertificationCharges)||void 0===s?void 0:s.BPA_WATER_CHARGES)+parseInt(null===(c=C)||void 0===c||null===(d=c.additionalDetails)||void 0===d||null===(p=d.selfCertificationCharges)||void 0===p?void 0:p.BPA_GAUSHALA_CHARGES_CESS))){var f,v,m;C.additionalDetails.selfCertificationCharges.BPA_DEVELOPMENT_CHARGES=sessionStorage.getItem("development")||"0",C.additionalDetails.selfCertificationCharges.BPA_OTHER_CHARGES=sessionStorage.getItem("otherCharges")||"0",C.additionalDetails.selfCertificationCharges.BPA_LESS_ADJUSMENT_PLOT=sessionStorage.getItem("lessAdjusment")||"0",C.additionalDetails.otherFeesDiscription=sessionStorage.getItem("otherChargesDisc"),C.additionalDetails.lessAdjustmentFeeFiles=JSON.parse(sessionStorage.getItem("uploadedFileLess"));const e=null==T||null===(f=T.nocData)||void 0===f?void 0:f.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 t={sourceRefId:null==e||null===(v=e[0])||void 0===v||null===(m=v.Noc)||void 0===m?void 0:m.sourceRefId};return Promise.resolve(Digit.NOCSearch.all(y,t)).then(function(t){var n;let l=!0,r=!0;null==t||null===(n=t.Noc)||void 0===n||n.map(e=>{var t,n,i,o,a;"APPROVED"!==(null==e||null===(t=e.applicationStatus)||void 0===t?void 0:t.toUpperCase())&&"AUTO_APPROVED"!==(null==e||null===(n=e.applicationStatus)||void 0===n?void 0:n.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!=l&&1!=r||("AIRPORT_AUTHORITY"===(null==e?void 0:e.nocType)?l=!1:"FIRE_NOC"===(null==e?void 0:e.nocType)&&(r=!1))});let i=[];if(e&&e.map(e=>{var t,n,o,a,u,s,c,d,p,f,v,m;("APPROVED"!=(null==e||null===(t=e.Noc)||void 0===t||null===(n=t.applicationStatus)||void 0===n?void 0:n.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===(s=u.applicationStatus)||void 0===s?void 0:s.toUpperCase())&&"AUTO_REJECTED"!=(null==e||null===(c=e.Noc)||void 0===c||null===(d=c.applicationStatus)||void 0===d?void 0:d.toUpperCase())&&"VOIDED"!=(null==e||null===(p=e.Noc)||void 0===p||null===(f=p.applicationStatus)||void 0===f?void 0:f.toUpperCase())&&"AIRPORT_AUTHORITY"===(null==e||null===(v=e.Noc)||void 0===v?void 0:v.nocType)&&l||"FIRE_NOC"===(null==e||null===(m=e.Noc)||void 0===m?void 0:m.nocType)&&r)&&i.push(e)}),"FIELDINSPECTION_INPROGRESS"==C.status){let e=JSON.parse(sessionStorage.getItem("INSPECTION_DATA"));(null==e?void 0:e.length)>0&&e.map((e,t)=>{e.InspectionDate&&e.InspectionTime?b({BPA:C},(null==i?void 0:i.length)>0&&i,{isStakeholder:!1,bpa:!0}):(S(),alert(E("Please fill Inspection Date and Time"))),console.log(" ob.InspectionDate && ob.InspectionTime",e.InspectionDate,e.InspectionTime)})}else b({BPA:C},(null==i?void 0:i.length)>0&&i,{isStakeholder:!1,bpa:!0})})}S(),alert(E("Enterd Less Adjustment amount is invalid"))}();return Promise.resolve(F&&F.then?F.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},defaultValues:I,formId:"modal-action"})):l.createElement(t.Loader,null)},mt=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)),Et=e=>{var r,o;let{t:s,action:c,tenantId:d,closeModal:p,submitAction:f,applicationData:v,businessService:m}=e;const{data:h,isLoading:g}=Digit.Hooks.useEmployeeSearch(d,{roles:null==c||null===(r=c.assigneeRoles)||void 0===r||null===(o=r.map)||void 0===o?void 0:o.call(r,e=>({code:e})),isActive:!0},{enabled:!(null!=c&&c.isTerminateState)}),[E,_]=(a.useQueryClient(),n.useState({})),[y,S]=n.useState({}),[b,T]=n.useState([]),[C,A]=n.useState({}),[D,x]=n.useState(null),[P,N]=n.useState(null),[w,R]=n.useState(null),I=!!Digit.Utils.browser.isMobile();function O(e){x(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{R(null);const e=function(){if(D){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(D.size>=5242880)R(s("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=D&&D.type&&!e.test(null==D?void 0:D.type))R(s("NOT_SUPPORTED_FILE_TYPE"));else{const e=Je(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?N(null==e||null===(l=e.data)||void 0===l||null===(r=l.files[0])||void 0===r?void 0:r.fileStoreId):R(s("CS_FILE_UPLOAD_ERROR"))})},function(){R(s("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(()=>{c&&_((e=>{var n;let{t:r,action:i,approvers:o,selectedApprover:a,setSelectedApprover:u,selectFile:s,uploadedFile:c,setUploadedFile:d,assigneeLabel:p,businessService:f,error:v}=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_"+f+"_"+(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:s,onDelete:()=>{d(null)},showHint:!0,message:c?"1 "+r("ES_PT_ACTION_FILEUPLOADED"):r("CS_ACTION_NO_FILEUPLOADED"),accept:"image/*, .pdf, .png, .jpeg, .jpg",iserror:v})}]}]}})({t:s,action:c,approvers:b,selectedApprover:C,setSelectedApprover:A,selectFile:O,uploadedFile:P,setUploadedFile:N,businessService:m,assigneeLabel:"WF_ASSIGNEE_NAME_LABEL",error:w}))},[c,b,P,w]),c&&E.form?l.createElement(t.Modal,{headerBarMain:l.createElement(mt,{label:s(E.label.heading)}),headerBarEnd:l.createElement(gt,{onClick:p}),actionCancelLabel:s(E.label.cancel),actionCancelOnSubmit:p,actionSaveLabel:s(E.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action",isOBPSFlow:!0,popupStyles:I?{width:"720px"}:{},style:I?{height:"45px",width:"44%"}:{height:"45px",width:"107px",paddingLeft:"0px",paddingRight:"0px"},popupModuleMianStyles:I?{paddingLeft:"5px"}:{}},g?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){var t,n,l;let r=JSON.parse(sessionStorage.getItem("NewNOCDocs")),i=(null===(t=v)||void 0===t||null===(n=t.documents)||void 0===n?void 0:n.length)>0?[...null===(l=v)||void 0===l?void 0:l.documents]:[];r.map((e,t)=>{i.push(e)}),v=u({},v,{workflow:{action:null==c?void 0:c.action,comment:null!=e&&e.comments?null==e?void 0:e.comments:null,assignee:null!=C&&C.uuid?[null==C?void 0:C.uuid]:null,documents:P?[{documentType:(null==c?void 0:c.action)+" DOC",fileName:null==D?void 0:D.name,fileStoreId:P}]:null},documents:i}),f({Noc:v},!1,{isNoc:!0})},defaultValues:y,formId:"modal-action"})):l.createElement(t.Loader,null)};var _t=function(e,t){return e===t||e!=e&&t!=t},yt=function(e,t){for(var n=e.length;n--;)if(_t(e[n][0],t))return n;return-1},St=Array.prototype.splice;function bt(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var l=e[t];this.set(l[0],l[1])}}bt.prototype.clear=function(){this.__data__=[],this.size=0},bt.prototype.delete=function(e){var t=this.__data__,n=yt(t,e);return!(n<0||(n==t.length-1?t.pop():St.call(t,n,1),--this.size,0))},bt.prototype.get=function(e){var t=this.__data__,n=yt(t,e);return n<0?void 0:t[n][1]},bt.prototype.has=function(e){return yt(this.__data__,e)>-1},bt.prototype.set=function(e,t){var n=this.__data__,l=yt(n,e);return l<0?(++this.size,n.push([e,t])):n[l][1]=t,this};var Tt=bt,Ct="object"==typeof c&&c&&c.Object===Object&&c,At="object"==typeof self&&self&&self.Object===Object&&self,Dt=Ct||At||Function("return this")(),xt=Dt.Symbol,Pt=Object.prototype,Nt=Pt.hasOwnProperty,wt=Pt.toString,Rt=xt?xt.toStringTag:void 0,It=Object.prototype.toString,Ot=xt?xt.toStringTag:void 0,Lt=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Ot&&Ot in Object(e)?function(e){var t=Nt.call(e,Rt),n=e[Rt];try{e[Rt]=void 0;var l=!0}catch(e){}var r=wt.call(e);return l&&(t?e[Rt]=n:delete e[Rt]),r}(e):function(e){return It.call(e)}(e)},kt=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},Mt=function(e){if(!kt(e))return!1;var t=Lt(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t},Ft=Dt["__core-js_shared__"],Bt=function(){var e=/[^.]+$/.exec(Ft&&Ft.keys&&Ft.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),Ut=Function.prototype.toString,jt=function(e){if(null!=e){try{return Ut.call(e)}catch(e){}try{return e+""}catch(e){}}return""},Ht=/^\[object .+?Constructor\]$/,Wt=RegExp("^"+Function.prototype.toString.call(Object.prototype.hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),zt=function(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return function(e){return!(!kt(e)||(t=e,Bt&&Bt in t))&&(Mt(e)?Wt:Ht).test(jt(e));var t}(n)?n:void 0},Vt=zt(Dt,"Map"),qt=zt(Object,"create"),Gt=Object.prototype.hasOwnProperty,Kt=Object.prototype.hasOwnProperty;function Yt(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])}}Yt.prototype.clear=function(){this.__data__=qt?qt(null):{},this.size=0},Yt.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Yt.prototype.get=function(e){var t=this.__data__;if(qt){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return Gt.call(t,e)?t[e]:void 0},Yt.prototype.has=function(e){var t=this.__data__;return qt?void 0!==t[e]:Kt.call(t,e)},Yt.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=qt&&void 0===t?"__lodash_hash_undefined__":t,this};var $t=Yt,Xt=function(e,t){var n=e.__data__;return function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}(t)?n["string"==typeof t?"string":"hash"]:n.map};function Zt(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])}}Zt.prototype.clear=function(){this.size=0,this.__data__={hash:new $t,map:new(Vt||Tt),string:new $t}},Zt.prototype.delete=function(e){var t=Xt(this,e).delete(e);return this.size-=t?1:0,t},Zt.prototype.get=function(e){return Xt(this,e).get(e)},Zt.prototype.has=function(e){return Xt(this,e).has(e)},Zt.prototype.set=function(e,t){var n=Xt(this,e),l=n.size;return n.set(e,t),this.size+=n.size==l?0:1,this};var Jt=Zt;function Qt(e){var t=this.__data__=new Tt(e);this.size=t.size}Qt.prototype.clear=function(){this.__data__=new Tt,this.size=0},Qt.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},Qt.prototype.get=function(e){return this.__data__.get(e)},Qt.prototype.has=function(e){return this.__data__.has(e)},Qt.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Tt){var l=n.__data__;if(!Vt||l.length<199)return l.push([e,t]),this.size=++n.size,this;n=this.__data__=new Jt(l)}return n.set(e,t),this.size=n.size,this};var en=Qt,tn=function(){try{var e=zt(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),nn=function(e,t,n){"__proto__"==t&&tn?tn(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n},ln=Object.prototype.hasOwnProperty,rn=function(e,t,n){var l=e[t];ln.call(e,t)&&_t(l,n)&&(void 0!==n||t in e)||nn(e,t,n)},on=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?nn(n,a,u):rn(n,a,u)}return n},an=function(e){return null!=e&&"object"==typeof e},un=function(e){return an(e)&&"[object Arguments]"==Lt(e)},sn=Object.prototype,cn=sn.hasOwnProperty,dn=sn.propertyIsEnumerable,pn=un(function(){return arguments}())?un:function(e){return an(e)&&cn.call(e,"callee")&&!dn.call(e,"callee")},fn=Array.isArray,vn=function(){return!1},mn=d(function(e,t){var n=t&&!t.nodeType&&t,l=n&&e&&!e.nodeType&&e,r=l&&l.exports===n?Dt.Buffer:void 0;e.exports=(r?r.isBuffer:void 0)||vn}),hn=/^(?:0|[1-9]\d*)$/,gn=function(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&hn.test(e))&&e>-1&&e%1==0&&e<t},En=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991},_n={};_n["[object Float32Array]"]=_n["[object Float64Array]"]=_n["[object Int8Array]"]=_n["[object Int16Array]"]=_n["[object Int32Array]"]=_n["[object Uint8Array]"]=_n["[object Uint8ClampedArray]"]=_n["[object Uint16Array]"]=_n["[object Uint32Array]"]=!0,_n["[object Arguments]"]=_n["[object Array]"]=_n["[object ArrayBuffer]"]=_n["[object Boolean]"]=_n["[object DataView]"]=_n["[object Date]"]=_n["[object Error]"]=_n["[object Function]"]=_n["[object Map]"]=_n["[object Number]"]=_n["[object Object]"]=_n["[object RegExp]"]=_n["[object Set]"]=_n["[object String]"]=_n["[object WeakMap]"]=!1;var yn=function(e){return function(t){return e(t)}},Sn=d(function(e,t){var n=t&&!t.nodeType&&t,l=n&&e&&!e.nodeType&&e,r=l&&l.exports===n&&Ct.process,i=function(){try{return l&&l.require&&l.require("util").types||r&&r.binding&&r.binding("util")}catch(e){}}();e.exports=i}),bn=Sn&&Sn.isTypedArray,Tn=bn?yn(bn):function(e){return an(e)&&En(e.length)&&!!_n[Lt(e)]},Cn=Object.prototype.hasOwnProperty,An=function(e,t){var n=fn(e),l=!n&&pn(e),r=!n&&!l&&mn(e),i=!n&&!l&&!r&&Tn(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 s in e)!t&&!Cn.call(e,s)||o&&("length"==s||r&&("offset"==s||"parent"==s)||i&&("buffer"==s||"byteLength"==s||"byteOffset"==s)||gn(s,u))||a.push(s);return a},Dn=Object.prototype,xn=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Dn)},Pn=function(e,t){return function(n){return e(t(n))}},Nn=Pn(Object.keys,Object),wn=Object.prototype.hasOwnProperty,Rn=function(e){return null!=e&&En(e.length)&&!Mt(e)},In=function(e){return Rn(e)?An(e):function(e){if(!xn(e))return Nn(e);var t=[];for(var n in Object(e))wn.call(e,n)&&"constructor"!=n&&t.push(n);return t}(e)},On=Object.prototype.hasOwnProperty,Ln=function(e){return Rn(e)?An(e,!0):function(e){if(!kt(e))return function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}(e);var t=xn(e),n=[];for(var l in e)("constructor"!=l||!t&&On.call(e,l))&&n.push(l);return n}(e)},kn=d(function(e,t){var n=t&&!t.nodeType&&t,l=n&&e&&!e.nodeType&&e,r=l&&l.exports===n?Dt.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}}),Mn=function(){return[]},Fn=Object.prototype.propertyIsEnumerable,Bn=Object.getOwnPropertySymbols,Un=Bn?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];Fn.call(e,a)&&(o[i++]=a)}return o}(Bn(e)))}:Mn,jn=function(e,t){for(var n=-1,l=t.length,r=e.length;++n<l;)e[r+n]=t[n];return e},Hn=Pn(Object.getPrototypeOf,Object),Wn=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)jn(t,Un(e)),e=Hn(e);return t}:Mn,zn=function(e,t,n){var l=t(e);return fn(e)?l:jn(l,n(e))},Vn=function(e){return zn(e,In,Un)},qn=function(e){return zn(e,Ln,Wn)},Gn=zt(Dt,"DataView"),Kn=zt(Dt,"Promise"),Yn=zt(Dt,"Set"),$n=zt(Dt,"WeakMap"),Xn=jt(Gn),Zn=jt(Vt),Jn=jt(Kn),Qn=jt(Yn),el=jt($n),tl=Lt;(Gn&&"[object DataView]"!=tl(new Gn(new ArrayBuffer(1)))||Vt&&"[object Map]"!=tl(new Vt)||Kn&&"[object Promise]"!=tl(Kn.resolve())||Yn&&"[object Set]"!=tl(new Yn)||$n&&"[object WeakMap]"!=tl(new $n))&&(tl=function(e){var t=Lt(e),n="[object Object]"==t?e.constructor:void 0,l=n?jt(n):"";if(l)switch(l){case Xn:return"[object DataView]";case Zn:return"[object Map]";case Jn:return"[object Promise]";case Qn:return"[object Set]";case el:return"[object WeakMap]"}return t});var nl=tl,ll=Object.prototype.hasOwnProperty,rl=Dt.Uint8Array,il=function(e){var t=new e.constructor(e.byteLength);return new rl(t).set(new rl(e)),t},ol=/\w*$/,al=xt?xt.prototype:void 0,ul=al?al.valueOf:void 0,sl=Object.create,cl=function(){function e(){}return function(t){if(!kt(t))return{};if(sl)return sl(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}(),dl=Sn&&Sn.isMap,pl=dl?yn(dl):function(e){return an(e)&&"[object Map]"==nl(e)},fl=Sn&&Sn.isSet,vl=fl?yn(fl):function(e){return an(e)&&"[object Set]"==nl(e)},ml={};ml["[object Arguments]"]=ml["[object Array]"]=ml["[object ArrayBuffer]"]=ml["[object DataView]"]=ml["[object Boolean]"]=ml["[object Date]"]=ml["[object Float32Array]"]=ml["[object Float64Array]"]=ml["[object Int8Array]"]=ml["[object Int16Array]"]=ml["[object Int32Array]"]=ml["[object Map]"]=ml["[object Number]"]=ml["[object Object]"]=ml["[object RegExp]"]=ml["[object Set]"]=ml["[object String]"]=ml["[object Symbol]"]=ml["[object Uint8Array]"]=ml["[object Uint8ClampedArray]"]=ml["[object Uint16Array]"]=ml["[object Uint32Array]"]=!0,ml["[object Error]"]=ml["[object Function]"]=ml["[object WeakMap]"]=!1;var hl=function e(t,n,l,r,i,o){var a,u=1&n,s=2&n,c=4&n;if(l&&(a=i?l(t,r,i,o):l(t)),void 0!==a)return a;if(!kt(t))return t;var d=fn(t);if(d){if(a=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&ll.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=nl(t),f="[object Function]"==p||"[object GeneratorFunction]"==p;if(mn(t))return kn(t,u);if("[object Object]"==p||"[object Arguments]"==p||f&&!i){if(a=s||f?{}:function(e){return"function"!=typeof e.constructor||xn(e)?{}:cl(Hn(e))}(t),!u)return s?function(e,t){return on(e,Wn(e),t)}(t,function(e,t){return e&&on(t,Ln(t),e)}(a,t)):function(e,t){return on(e,Un(e),t)}(t,function(e,t){return e&&on(t,In(t),e)}(a,t))}else{if(!ml[p])return i?t:{};a=function(e,t,n){var l=e.constructor;switch(t){case"[object ArrayBuffer]":return il(e);case"[object Boolean]":case"[object Date]":return new l(+e);case"[object DataView]":return function(e,t){var n=t?il(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?il(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,ol.exec(e));return t.lastIndex=e.lastIndex,t}(e);case"[object Set]":return new l;case"[object Symbol]":return ul?Object(ul.call(e)):{}}}(t,p,u)}}o||(o=new en);var v=o.get(t);if(v)return v;o.set(t,a),vl(t)?t.forEach(function(r){a.add(e(r,n,l,r,t,o))}):pl(t)&&t.forEach(function(r,i){a.set(i,e(r,n,l,i,t,o))});var m=d?void 0:(c?s?qn:Vn:s?Ln:In)(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]),rn(a,i,e(r,n,l,i,t,o))}),a},gl=function(e){return hl(e,5)};const El=e=>l.createElement("h1",{className:"heading-m"},e.label),_l=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),yl=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(_l,null)),Sl=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}},bl=e=>{var r,i;let{t:o,action:a,tenantId:s,closeModal:c,submitAction:d,applicationData:p,businessService:f}=e;const{data:v,isLoading:m}=Digit.Hooks.useEmployeeSearch(s,{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,g]=n.useState({}),[E,_]=n.useState({}),[y,S]=n.useState([]),[b,T]=n.useState({}),[C,A]=n.useState(null),[D,x]=n.useState(null),[P,N]=n.useState(null),w=window.Digit.Utils.browser.isMobile(),R=window.location.href.includes("/employee");function I(e){A(e.target.files[0])}return n.useEffect(()=>{var e;S(null==v||null===(e=v.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[v]),n.useEffect(()=>{!function(){try{N(null);const e=function(){if(C){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(C.size>=5242880)N(o("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=C&&C.type&&!e.test(null==C?void 0:C.type))N(o("NOT_SUPPORTED_FILE_TYPE"));else{const e=Je(function(){return Promise.resolve(Digit.UploadServices.Filestorage("WS",C,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?x(null==e||null===(l=e.data)||void 0===l||null===(r=l.files[0])||void 0===r?void 0:r.fileStoreId):N(o("CS_FILE_UPLOAD_ERROR"))})},function(e){console.error("Modal -> err ",e),N(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)}}()},[C]),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&&g((e=>{var n;let{t:r,action:i,approvers:o,selectedApprover:a,setSelectedApprover:s,selectFile:c,uploadedFile:d,setUploadedFile:p,businessService:f,error:v}=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==f?void 0:f.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:s,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:c,onDelete:()=>{p(null)},message:d?"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:I,uploadedFile:D,setUploadedFile:x,businessService:f,error:P})):a&&g((e=>{var n;let{t:r,action:i,approvers:o,selectedApprover:a,setSelectedApprover:u,selectFile:s,uploadedFile:c,setUploadedFile:d,businessService:p,error:f}=e,v=!0;return(null!=i&&null!==(n=i.action)&&void 0!==n&&n.includes("SEND_BACK")||"APPROVE_FOR_CONNECTION"==(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==p?void 0:p.toUpperCase())+"_"+(null==i?void 0:i.action),cancel:"CS_COMMON_CANCEL"},form:[{body:[{label:v?r("WF_ASSIGNEE_NAME_LABEL"):null,placeholder:v?r("WF_ASSIGNEE_NAME_PLACEHOLDER"):null,type:"dropdown",populators:v?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:s,onDelete:()=>{d(null)},message:c?"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:I,uploadedFile:D,setUploadedFile:x,businessService:f,error:P}))},[a,y,D,P]),a&&h.form?l.createElement(t.Modal,{headerBarMain:l.createElement(El,{label:o(h.label.heading)}),headerBarEnd:l.createElement(yl,{onClick:c}),actionCancelLabel:o(h.label.cancel),actionCancelOnSubmit:c,actionSaveLabel:o(h.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action",style:w&&R?{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,c,f,v,m;if(null!==(t=p)&&void 0!==t&&t.isBillAmend){var h,g,E,_,y,S,T,A,x;const t=u({},null===(h=p)||void 0===h||null===(g=h.billAmendmentDetails)||void 0===g?void 0:g.additionalDetails,{comments:null!=e&&e.comments?e.comments:null}),n=u({},null===(E=p)||void 0===E?void 0:E.billAmendmentDetails,{workflow:{businessId:null===(_=p)||void 0===_||null===(y=_.billAmendmentDetails)||void 0===y?void 0:y.amendmentId,action:null==a?void 0:a.action,tenantId:s,businessService:null!==(S=p)&&void 0!==S&&null!==(T=S.applicationType)&&void 0!==T&&T.includes("WATER")?"WS.AMENDMENT":"SW.AMENDMENT",moduleName:null!==(A=p)&&void 0!==A&&null!==(x=A.applicationType)&&void 0!==x&&x.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==C?void 0:C.name,fileStoreId:D}]:[]},additionalDetails:t,comment:(null==e?void 0:e.comments)||"",wfDocuments:D?[{documentType:(null==a?void 0:a.action)+" DOC",fileName:null==C?void 0:C.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==C?void 0:C.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==C?void 0:C.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==C?void 0:C.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=gl(null==e?void 0:e.date);p.disconnectionExecutionDate=Sl(t)}else if(null!=e&&e.date){const t=gl(null==e?void 0:e.date);p.connectionExecutionDate=Sl(t)}var P;if("DisconnectWSConnection"==(null===(i=p)||void 0===i||null===(o=i.processInstance)||void 0===o?void 0:o.businessService)||"DisconnectSWConnection"==(null===(c=p)||void 0===c||null===(f=c.processInstance)||void 0===f?void 0:f.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===(v=p)||void 0===v?void 0:v.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 N,w,R,I,O,L,k,M,F,B,U,j,H;const e=sessionStorage.getItem("Digit.ADHOC_ADD_REBATE_DATA"),t=e?JSON.parse(e):"";null!=t&&null!==(N=t.value)&&void 0!==N&&N.adhocPenalty&&(p.additionalDetails.adhocPenalty=parseInt(null==t||null===(w=t.value)||void 0===w?void 0:w.adhocPenalty)||""),null!=t&&null!==(R=t.value)&&void 0!==R&&R.adhocPenaltyComment&&(p.additionalDetails.adhocPenaltyComment=(null==t||null===(I=t.value)||void 0===I?void 0:I.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!==(k=t.value)&&void 0!==k&&k.adhocRebate&&(p.additionalDetails.adhocRebate=parseInt(null==t||null===(M=t.value)||void 0===M?void 0:M.adhocRebate)||""),null!=t&&null!==(F=t.value)&&void 0!==F&&F.adhocRebateComment&&(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:E,formId:"modal-action"})):l.createElement(t.Loader,null)},Tl=e=>l.createElement("h1",{className:"heading-m"},e.label),Cl=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),Al=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(Cl,null)),Dl=e=>{var r,i;let{t:o,action:a,tenantId:s,closeModal:c,submitAction:d,applicationData:p,businessService:f,moduleCode:v}=e;console.log("applicationData",p);const{data:m}=Digit.Hooks.useEmployeeSearch(s,{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,g]=n.useState({}),[E,_]=n.useState({}),[y,S]=n.useState([]),[b,T]=n.useState(null),[C,A]=n.useState(null),[D,x]=n.useState(null),[P,N]=n.useState(null),[w,R]=n.useState(!1);function I(e){A(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{N(null);const e=function(){if(C){const e=function(){if(C.size>=5242880)N(o("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=Je(function(){return Promise.resolve(Digit.UploadServices.Filestorage("PTR",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?x(null==e||null===(l=e.data)||void 0===l||null===(r=l.files[0])||void 0===r?void 0:r.fileStoreId):N(o("CS_FILE_UPLOAD_ERROR"))})},function(){N(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&&g((e=>{let{t:t,action:n,businessService:l}=e;return{label:{heading:"WF_"+(null==n?void 0:n.action)+"_APPLICATION",submit:"WF_"+l+"_"+(null==n?void 0:n.action),cancel:"ES_PTR_COMMON_CANCEL"},form:[{body:[{label:t("ES_PTR_ACTION_COMMENTS"),type:"textarea",populators:{name:"comments"}}]}]}})({t:o,action:a,approvers:y,selectedApprover:b,setSelectedApprover:T,selectFile:I,uploadedFile:D,setUploadedFile:x,businessService:f}))},[a,y,D]),a&&h.form?l.createElement(t.Modal,{headerBarMain:l.createElement(Tl,{label:o(h.label.heading)}),headerBarEnd:l.createElement(Al,{onClick:c}),actionCancelLabel:o(h.label.cancel),actionCancelOnSubmit:c,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){if("COMMON_APPROVED"==(null==a?void 0:a.action)){let t={action:"OPEN",comments:null==e?void 0:e.comments,businessService:"ptr",moduleName:"pet-services"};p.creationReason="CREATE",d({PetRegistrationApplications:[u({},p,{workflow:t})]})}let t={action:null==a?void 0:a.action,comments:null==e?void 0:e.comments,businessService:f,moduleName:v};t.assignes=null!=a&&a.isTerminateState||!b?[]:[b],D&&(t.documents=[{documentType:(null==a?void 0:a.action)+" DOC",fileName:null==C?void 0:C.name,fileStoreId:D}]),d({PetRegistrationApplications:[u({},p,{workflow:t})]})},defaultValues:E,formId:"modal-action"})):l.createElement(t.Loader,null)},xl=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"})),Nl=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(Pl,null)),wl=e=>{var r,i,o;let{t:a,action:s,closeModal:c,submitAction:d,applicationData:p,businessService:f}=e;const v=Digit.ULBService.getStateId(),{data:m,isLoading:h}=Digit.Hooks.tl.useTradeLicenseMDMS(v,"TradeLicense","TradeUnits","[?(@.type=='TL')]");console.log("tradeMdmsData",null==m||null===(r=m.TradeLicense)||void 0===r?void 0:r.TradeType),console.log("applicationData",p);const[g,E]=n.useState({}),[_,y]=n.useState({}),[S,b]=n.useState([]),[T,C]=n.useState(""),[A,D]=n.useState([]),[x,P]=n.useState(null),N=null===(i=p)||void 0===i||null===(o=i.tradeLicenseDetail)||void 0===o?void 0:o.tradeUnits;console.log("tradeUnits",N);const w=n.useMemo(()=>{var e;if(h||!m||!N.length)return[];const t=new Set(N.map(e=>e.tradeType)),n=(null===(e=m.TradeLicense)||void 0===e?void 0:e.TradeType.filter(e=>t.has(e.code))).some(e=>null==e?void 0:e.ishazardous);return console.log("hasHazardous",n),n?["1"]:["1","2","3"]},[h,m,N]);return console.log("years",w),n.useEffect(()=>{s&&E((e=>{let{t:n,action:r,years:i,selectedApprover:o,setSelectedApprover:a,businessService:u}=e;return{label:{heading:"WF_"+(null==r?void 0:r.action)+"_APPLICATION",submit:"WF_"+(null==u?void 0:u.toUpperCase())+"_"+(null==r?void 0:r.action),cancel:"WF_EMPLOYEE_NEWTL_CANCEL"},form:[{body:[{label:n("TL_VALID_FOR_NO_OF_YEARS"),type:"dropdown",populators:l.createElement(t.Dropdown,{option:i,autoComplete:"off",select:a,selected:o})}]}]}})({t:a,action:s,years:w,selectedApprover:T,setSelectedApprover:C,businessService:f}))},[s,w,A,x]),s&&g.form?l.createElement(t.Modal,{headerBarMain:l.createElement(xl,{label:a(g.label.heading)}),headerBarEnd:l.createElement(Nl,{onClick:c}),actionCancelLabel:a(g.label.cancel),actionCancelOnSubmit:c,actionSaveLabel:a(g.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},h?l.createElement(t.Loader,null):l.createElement(t.FormComposer,{config:g.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){var t;let n=null===(t=p)||void 0===t?void 0:t.financialYear;const l=null==n?void 0:n.split("-")[1],r="20"+Number(l)+"-"+(Number(l)+1);p=u({},p,{financialYear:r,action:"INITIATE",additionalDetail:u({},p.additionalDetail,{validityYears:T.length>0?parseInt(T):""})}),d({Licenses:[p]})},defaultValues:_,formId:"modal-action"})):l.createElement(t.Loader,null)},Rl=e=>l.createElement("h1",{className:"heading-m"},e.label),Il=()=>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(Il,null)),Ll=e=>{var r,i;let{t:o,action:a,tenantId:s,closeModal:c,submitAction:d,applicationData:p,businessService:f,moduleCode:v}=e;const{data:m}=Digit.Hooks.useEmployeeSearch(s,{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,g]=n.useState({}),[E,_]=n.useState({}),[y,S]=n.useState([]),[b,T]=n.useState(null),[C,A]=n.useState(null),[D,x]=n.useState(null),[P,N]=n.useState(null),[w,R]=n.useState(!1);function I(e){R(!0),A(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{N(null);const e=function(){if(C){const e=function(){if(C.size>=5242880)N(o("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=function(e,t){try{var n=Je(function(){return Promise.resolve(Digit.UploadServices.Filestorage("StreetVending",C,s)).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):N(o("CS_FILE_UPLOAD_ERROR"))})},function(){N(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(R(!1),e)throw t;return t});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[C]),console.log("actyhdesh,jhfsefsef",a,p),n.useEffect(()=>{g((e=>{let{t:n,action:r,selectFile:i,uploadedFile:o,setUploadedFile:a,approvers:u,selectedApprover:s,setSelectedApprover:c,isUploading:d}=e;const p=()=>l.createElement("div",{className:"loading-spinner"});return console.log("isuploading ",d),{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:c,selected:s})},{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:I,uploadedFile:D,setUploadedFile:x,businessService:f,isUploading:w}))},[a,y,D]),a&&h.form?l.createElement(t.Modal,{headerBarMain:l.createElement(Rl,{label:o(h.label.heading)}),headerBarEnd:l.createElement(Ol,{onClick:c}),actionCancelLabel:o(h.label.cancel),actionCancelOnSubmit:c,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:f,moduleName:v,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==C?void 0:C.name,fileStoreId:D}]),d({streetVendingDetail:u({},p,{workflow:n})})},defaultValues:E,formId:"modal-action"})):l.createElement(t.Loader,null)},kl=e=>null!=e&&e.businessService.includes("PT")?l.createElement(nt,e):null!=e&&e.businessService.includes("ptr")?l.createElement(Dl,e):null!=e&&e.businessService.includes("NewTL")||null!=e&&e.businessService.includes("TL")||null!=e&&e.businessService.includes("EDITRENEWAL")?l.createElement(ot,e):null!=e&&e.businessService.includes("DIRECTRENEWAL")?l.createElement(wl,e):null!=e&&e.moduleCode.includes("BPAREG")?l.createElement(ct,e):null!=e&&e.moduleCode.includes("BPA")?l.createElement(vt,e):null!=e&&e.moduleCode.includes("NOC")?l.createElement(Et,e):null!=e&&e.moduleCode.includes("WS")?l.createElement(bl,e):null!=e&&e.businessService.includes("street-vending")?l.createElement(Ll,e):void 0;function Ml(e){let{documents:n,svgStyles:i={},isSendBackFlow:o=!1,isHrLine:a=!1,titleStyles:u}=e;const{t:s}=r.useTranslation(),c=window.location.href.includes("stakeholder");return l.createElement("div",{style:{marginTop:"19px",display:"flex",flexWrap:"wrap",flexDirection:"row",borderRadius:"4px",background:"#FAFAFA",border:"1px solid #D6D5D4",padding:"8px"}},!c&&(null==n?void 0:n.map((e,r)=>{var i,c,d;return l.createElement(l.Fragment,{key:r},l.createElement("div",{style:{display:"flex",flexWrap:"wrap",justifyContent:"flex-start"}},l.createElement("div",{style:{display:"flex",flexWrap:"wrap",justifyContent:"flex-start"}},null!=e&&e.values&&(null==e?void 0:e.values.length)>0?null==e||null===(i=e.values)||void 0===i?void 0:i.map((n,r)=>{var i;return l.createElement("div",{style:{width:"180px"}},l.createElement(t.CardSubHeader,{style:u||{marginTop:"32px",marginBottom:"8px",color:"#505A5F",fontSize:"24px"}},s(null==e?void 0:e.title)),l.createElement("a",{target:"_",href:null==n?void 0:n.url,style:{minWidth:"80px",marginRight:"10px",maxWidth:"100px",height:"auto",minWidth:"100px"},key:r},l.createElement("div",{style:{display:"flex",justifyContent:"flex-start"}},l.createElement(t.PDFSvg,null)),l.createElement("p",{style:{marginTop:"8px",fontWeight:"bold",textAlign:"start",color:"#505A5F"}},s(null==n?void 0:n.title)),o?null!=n&&null!==(i=n.documentType)&&void 0!==i&&i.includes("NOC")?l.createElement("p",{style:{textAlign:"center"}},s(null==n?void 0:n.documentType.split(".")[1])):l.createElement("p",{style:{textAlign:"center"}},s(null==n?void 0:n.documentType)):""))}):!window.location.href.includes("citizen")&&l.createElement("div",null,l.createElement("p",null,s("BPA_NO_DOCUMENTS_UPLOADED_LABEL")),l.createElement("div",{style:{width:"180px"}},l.createElement(t.CardSubHeader,{style:u||{marginTop:"32px",marginBottom:"8px",color:"#505A5F",fontSize:"24px"}}),l.createElement("div",{style:{minWidth:"80px",marginRight:"10px",maxWidth:"100px",height:"auto",minWidth:"100px"},key:r},l.createElement("div",{style:{display:"flex",justifyContent:"flex-start"}},l.createElement(t.PDFSvg,null)),l.createElement("p",{style:{marginTop:"8px",fontWeight:"bold",textAlign:"start",color:"#505A5F"}}),o?(null!==(c=value)&&void 0!==c&&null!==(d=c.documentType)&&void 0!==d&&d.includes("NOC"),l.createElement("p",{style:{textAlign:"center"}})):"")))),a&&(null==n?void 0:n.length)!=r+1?l.createElement("hr",{style:{color:"#D6D5D4",backgroundColor:"#D6D5D4",height:"2px",marginTop:"20px",marginBottom:"20px"}}):null))})),c&&(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"}},s(null==e?void 0:e.title)):null,l.createElement("div",null,null!=e&&e.values&&(null==e?void 0:e.values.length)>0?null==e||null===(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"}},s(null==e?void 0:e.title)),null!=e&&e.docInfo?l.createElement("div",{style:{fontSize:"12px",color:"#505A5F",fontWeight:400,lineHeight:"15px",marginBottom:"10px"}},""+s(null==e?void 0:e.docInfo)):null,l.createElement(t.PDFSvg,null),l.createElement("p",{style:{marginTop:"8px",fontSize:"16px",lineHeight:"19px",color:"#505A5F",fontWeight:"400",textAlign:"center",color:"#505A5F"}},""+s(null==e?void 0:e.title))))):!window.location.href.includes("citizen")&&l.createElement("div",null,l.createElement("p",null,s("BPA_NO_DOCUMENTS_UPLOADED_LABEL")))))})))}d(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]",s="[object Error]",d="[object Function]",p="[object GeneratorFunction]",f="[object Map]",v="[object Number]",m="[object Object]",h="[object RegExp]",g="[object Set]",E="[object String]",_="[object Symbol]",y="[object WeakMap]",S="[object ArrayBuffer]",b="[object DataView]",T="[object Float32Array]",C="[object Float64Array]",A="[object Int8Array]",D="[object Int16Array]",x="[object Int32Array]",P="[object Uint8Array]",N="[object Uint16Array]",w="[object Uint32Array]",R=/\b__p \+= '';/g,I=/\b(__p \+=) '' \+/g,O=/(__e\(.*?\)|\b__t\)) \+\n'';/g,L=/&(?:amp|lt|gt|quot|#39);/g,k=/[&<>"']/g,M=RegExp(L.source),F=RegExp(k.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,q=RegExp(V.source),G=/^\s+/,K=/\s/,Y=/\{(?:\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,re=/^\[object .+?Constructor\]$/,ie=/^0o[0-7]+$/i,oe=/^(?:0|[1-9]\d*)$/,ae=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ue=/($^)/,se=/['\n\r\u2028\u2029\\]/g,ce="\\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+"]",fe="["+ce+"]",ve="\\d+",me="[a-z\\xdf-\\xf6\\xf8-\\xff]",he="[^\\ud800-\\udfff"+de+ve+"\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",ge="\\ud83c[\\udffb-\\udfff]",Ee="[^\\ud800-\\udfff]",_e="(?:\\ud83c[\\udde6-\\uddff]){2}",ye="[\\ud800-\\udbff][\\udc00-\\udfff]",Se="[A-Z\\xc0-\\xd6\\xd8-\\xde]",be="(?:"+me+"|"+he+")",Te="(?:"+Se+"|"+he+")",Ce="(?:"+fe+"|"+ge+")?",Ae="[\\ufe0e\\ufe0f]?"+Ce+"(?:\\u200d(?:"+[Ee,_e,ye].join("|")+")[\\ufe0e\\ufe0f]?"+Ce+")*",De="(?:"+["[\\u2700-\\u27bf]",_e,ye].join("|")+")"+Ae,xe="(?:"+[Ee+fe+"?",fe,_e,ye,"[\\ud800-\\udfff]"].join("|")+")",Pe=RegExp("['’]","g"),Ne=RegExp(fe,"g"),we=RegExp(ge+"(?="+ge+")|"+xe+Ae,"g"),Re=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_])",ve,De].join("|"),"g"),Ie=RegExp("[\\u200d\\ud800-\\udfff"+ce+"\\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"],ke=-1,Me={};Me[T]=Me[C]=Me[A]=Me[D]=Me[x]=Me[P]=Me["[object Uint8ClampedArray]"]=Me[N]=Me[w]=!0,Me[i]=Me[o]=Me[S]=Me[a]=Me[b]=Me[u]=Me[s]=Me[d]=Me[f]=Me[v]=Me[m]=Me[h]=Me[g]=Me[E]=Me[y]=!1;var Fe={};Fe[i]=Fe[o]=Fe[S]=Fe[b]=Fe[a]=Fe[u]=Fe[T]=Fe[C]=Fe[A]=Fe[D]=Fe[x]=Fe[f]=Fe[v]=Fe[m]=Fe[h]=Fe[g]=Fe[E]=Fe[_]=Fe[P]=Fe["[object Uint8ClampedArray]"]=Fe[N]=Fe[w]=!0,Fe[s]=Fe[d]=Fe[y]=!1;var Be={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Ue=parseFloat,je=parseInt,He="object"==typeof c&&c&&c.Object===Object&&c,We="object"==typeof self&&self&&self.Object===Object&&self,ze=He||We||Function("return this")(),Ve=t&&!t.nodeType&&t,qe=Ve&&e&&!e.nodeType&&e,Ge=qe&&qe.exports===Ve,Ke=Ge&&He.process,Ye=function(){try{return qe&&qe.require&&qe.require("util").types||Ke&&Ke.binding&&Ke.binding("util")}catch(e){}}(),$e=Ye&&Ye.isArrayBuffer,Xe=Ye&&Ye.isDate,Ze=Ye&&Ye.isMap,Je=Ye&&Ye.isRegExp,Qe=Ye&&Ye.isSet,et=Ye&&Ye.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)&>(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 st(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 ct(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 ft(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 vt=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 gt(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,_t,n)}function Et(e,t,n,l){for(var r=n-1,i=e.length;++r<i;)if(l(e[r],t))return r;return-1}function _t(e){return e!=e}function yt(e,t){var n=null==e?0:e.length;return n?Ct(e,t)/n:NaN}function St(e){return function(t){return null==t?void 0:t[e]}}function bt(e){return function(t){return null==e?void 0:e[t]}}function Tt(e,t,n,l,r){return r(e,function(e,r,i){n=l?(l=!1,e):t(n,e,r,i)}),n}function Ct(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 At(e,t){for(var n=-1,l=Array(e);++n<e;)l[n]=t(n);return l}function Dt(e){return e?e.slice(0,Vt(e)+1).replace(G,""):e}function xt(e){return function(t){return e(t)}}function Pt(e,t){return st(t,function(t){return e[t]})}function Nt(e,t){return e.has(t)}function wt(e,t){for(var n=-1,l=e.length;++n<l&>(t,e[n],0)>-1;);return n}function Rt(e,t){for(var n=e.length;n--&>(t,e[n],0)>-1;);return n}function It(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({"&":"&","<":"<",">":">",'"':""","'":"'"});function kt(e){return"\\"+Be[e]}function Mt(e){return Ie.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 Mt(e)?function(e){for(var t=we.lastIndex=0;we.test(e);)++t;return t}(e):vt(e)}function zt(e){return Mt(e)?function(e){return e.match(we)||[]}(e):function(e){return e.split("")}(e)}function Vt(e){for(var t=e.length;t--&&K.test(e.charAt(t)););return t}var qt=bt({"&":"&","<":"<",">":">",""":'"',"'":"'"}),Gt=function e(t){var c=(t=null==t?ze:Gt.defaults(ze.Object(),t,Gt.pick(ze,Le))).Array,K=t.Date,ce=t.Error,de=t.Function,pe=t.Math,fe=t.Object,ve=t.RegExp,me=t.String,he=t.TypeError,ge=c.prototype,Ee=fe.prototype,_e=t["__core-js_shared__"],ye=de.prototype.toString,Se=Ee.hasOwnProperty,be=0,Te=function(){var e=/[^.]+$/.exec(_e&&_e.keys&&_e.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),Ce=Ee.toString,Ae=ye.call(fe),De=ze._,xe=ve("^"+ye.call(Se).replace(V,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),we=Ge?t.Buffer:void 0,Ie=t.Symbol,Be=t.Uint8Array,He=we?we.allocUnsafe:void 0,We=Bt(fe.getPrototypeOf,fe),Ve=fe.create,qe=Ee.propertyIsEnumerable,Ke=ge.splice,Ye=Ie?Ie.isConcatSpreadable:void 0,vt=Ie?Ie.iterator:void 0,bt=Ie?Ie.toStringTag:void 0,Kt=function(){try{var e=Zr(fe,"defineProperty");return e({},"",{}),e}catch(e){}}(),Yt=t.clearTimeout!==ze.clearTimeout&&t.clearTimeout,$t=K&&K.now!==ze.Date.now&&K.now,Xt=t.setTimeout!==ze.setTimeout&&t.setTimeout,Zt=pe.ceil,Jt=pe.floor,Qt=fe.getOwnPropertySymbols,en=we?we.isBuffer:void 0,tn=t.isFinite,nn=ge.join,ln=Bt(fe.keys,fe),rn=pe.max,on=pe.min,an=K.now,un=t.parseInt,sn=pe.random,cn=ge.reverse,dn=Zr(t,"DataView"),pn=Zr(t,"Map"),fn=Zr(t,"Promise"),vn=Zr(t,"Set"),mn=Zr(t,"WeakMap"),hn=Zr(fe,"create"),gn=mn&&new mn,En={},_n=Ci(dn),yn=Ci(pn),Sn=Ci(fn),bn=Ci(vn),Tn=Ci(mn),Cn=Ie?Ie.prototype:void 0,An=Cn?Cn.valueOf:void 0,Dn=Cn?Cn.toString:void 0;function xn(e){if(Wo(e)&&!Ro(e)&&!(e instanceof Rn)){if(e instanceof wn)return e;if(Se.call(e,"__wrapped__"))return Ai(e)}return new wn(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 Nn(){}function wn(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=void 0}function Rn(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=4294967295,this.__views__=[]}function In(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 kn(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new Ln;++t<n;)this.add(e[t])}function Mn(e){var t=this.__data__=new On(e);this.size=t.size}function Fn(e,t){var n=Ro(e),l=!n&&wo(e),r=!n&&!l&&ko(e),i=!n&&!l&&!r&&Xo(e),o=n||l||r||i,a=o?At(e.length,me):[],u=a.length;for(var s in e)!t&&!Se.call(e,s)||o&&("length"==s||r&&("offset"==s||"parent"==s)||i&&("buffer"==s||"byteLength"==s||"byteOffset"==s)||ri(s,u))||a.push(s);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),Yn(t,0,e.length))}function jn(e){return Si(mr(e))}function Hn(e,t,n){(void 0!==n&&!xo(e[t],n)||void 0===n&&!(t in e))&&Gn(e,t,n)}function Wn(e,t,n){var l=e[t];Se.call(e,t)&&xo(l,n)&&(void 0!==n||t in e)||Gn(e,t,n)}function zn(e,t){for(var n=e.length;n--;)if(xo(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 qn(e,t){return e&&hr(t,Ea(t),e)}function Gn(e,t,n){"__proto__"==t&&Kt?Kt(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function Kn(e,t){for(var n=-1,l=t.length,r=c(l),i=null==e;++n<l;)r[n]=i?void 0:fa(e,t[n]);return r}function Yn(e,t,n){return e==e&&(void 0!==n&&(e=e<=n?e:n),void 0!==t&&(e=e>=t?e:t)),e}function $n(e,t,n,l,r,o){var s,c=1&t,y=2&t,R=4&t;if(n&&(s=r?n(e,l,r,o):n(e)),void 0!==s)return s;if(!Ho(e))return e;var I=Ro(e);if(I){if(s=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&Se.call(e,"index")&&(n.index=e.index,n.input=e.input),n}(e),!c)return mr(e,s)}else{var O=ei(e),L=O==d||O==p;if(ko(e))return sr(e,c);if(O==m||O==i||L&&!r){if(s=y||L?{}:ni(e),!c)return y?function(e,t){return hr(e,Qr(e),t)}(e,function(e,t){return e&&hr(t,_a(t),e)}(s,e)):function(e,t){return hr(e,Jr(e),t)}(e,qn(s,e))}else{if(!Fe[O])return r?e:{};s=function(e,t,n){var l=e.constructor;switch(t){case S:return cr(e);case a:case u:return new l(+e);case b:return function(e,t){var n=t?cr(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,n);case T:case C:case A:case D:case x:case P:case"[object Uint8ClampedArray]":case N:case w:return dr(e,n);case f:return new l;case v:case E: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 g:return new l;case _:return An?fe(An.call(e)):{}}}(e,O,c)}}o||(o=new Mn);var k=o.get(e);if(k)return k;o.set(e,s),Ko(e)?e.forEach(function(l){s.add($n(l,t,n,l,e,o))}):zo(e)&&e.forEach(function(l,r){s.set(r,$n(l,t,n,r,e,o))});var M=I?void 0:(R?y?Vr:zr:y?_a:Ea)(e);return lt(M||e,function(l,r){M&&(l=e[r=l]),Wn(s,r,$n(l,t,n,r,e,o))}),s}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 Zn(e,t,l){if("function"!=typeof e)throw new he(n);return gi(function(){e.apply(void 0,l)},t)}function Jn(e,t,n,l){var r=-1,i=at,o=!0,a=e.length,u=[],s=t.length;if(!a)return u;n&&(t=st(t,xt(n))),l?(i=ut,o=!1):t.length>=200&&(i=Nt,o=!1,t=new kn(t));e:for(;++r<a;){var c=e[r],d=null==n?c:n(c);if(c=l||0!==c?c:0,o&&d==d){for(var p=s;p--;)if(t[p]===d)continue e;u.push(c)}else i(t,d,l)||u.push(c)}return u}xn.templateSettings={escape:B,evaluate:U,interpolate:j,variable:"",imports:{_:xn}},(xn.prototype=Nn.prototype).constructor=xn,(wn.prototype=Pn(Nn.prototype)).constructor=wn,(Rn.prototype=Pn(Nn.prototype)).constructor=Rn,In.prototype.clear=function(){this.__data__=hn?hn(null):{},this.size=0},In.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},In.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},In.prototype.has=function(e){var t=this.__data__;return hn?void 0!==t[e]:Se.call(t,e)},In.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():Ke.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 In,map:new(pn||On),string:new In}},Ln.prototype.delete=function(e){var t=$r(this,e).delete(e);return this.size-=t?1:0,t},Ln.prototype.get=function(e){return $r(this,e).get(e)},Ln.prototype.has=function(e){return $r(this,e).has(e)},Ln.prototype.set=function(e,t){var n=$r(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)},Mn.prototype.clear=function(){this.__data__=new On,this.size=0},Mn.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},Mn.prototype.get=function(e){return this.__data__.get(e)},Mn.prototype.has=function(e){return this.__data__.has(e)},Mn.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=_r(al),el=_r(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&&!$o(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):ct(r,a):l||(r[r.length]=a)}return r}var il=yr(),ol=yr(!0);function al(e,t){return e&&il(e,t,Ea)}function ul(e,t){return e&&ol(e,t,Ea)}function sl(e,t){return ot(t,function(t){return Bo(e[t])})}function cl(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 Ro(e)?l:ct(l,n(e))}function pl(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":bt&&bt in fe(e)?function(e){var t=Se.call(e,bt),n=e[bt];try{e[bt]=void 0;var l=!0}catch(e){}var r=Ce.call(e);return l&&(t?e[bt]=n:delete e[bt]),r}(e):function(e){return Ce.call(e)}(e)}function fl(e,t){return e>t}function vl(e,t){return null!=e&&Se.call(e,t)}function ml(e,t){return null!=e&&t in fe(e)}function hl(e,t,n){for(var l=n?ut:at,r=e[0].length,i=e.length,o=i,a=c(i),u=Infinity,s=[];o--;){var d=e[o];o&&t&&(d=st(d,xt(t))),u=on(d.length,u),a[o]=!n&&(t||r>=120&&d.length>=120)?new kn(o&&d):void 0}d=e[0];var p=-1,f=a[0];e:for(;++p<r&&s.length<u;){var v=d[p],m=t?t(v):v;if(v=n||0!==v?v:0,!(f?Nt(f,m):l(s,m,n))){for(o=i;--o;){var h=a[o];if(!(h?Nt(h,m):l(e[o],m,n)))continue e}f&&f.push(m),s.push(v)}}return s}function gl(e,t,n){var l=null==(e=fi(e,t=ir(t,e)))?e:e[Ti(Mi(t))];return null==l?void 0:tt(l,e,n)}function El(e){return Wo(e)&&pl(e)==i}function _l(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,c){var d=Ro(e),p=Ro(t),y=d?o:ei(e),T=p?o:ei(t),C=(y=y==i?m:y)==m,A=(T=T==i?m:T)==m,D=y==T;if(D&&ko(e)){if(!ko(t))return!1;d=!0,C=!1}if(D&&!C)return c||(c=new Mn),d||Xo(e)?Hr(e,t,n,l,r,c):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 v:return xo(+e,+t);case s:return e.name==t.name&&e.message==t.message;case h:case E:return e==t+"";case f:var c=Ft;case g:if(c||(c=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(c(e),c(t),l,r,i,o);return o.delete(e),p;case _:if(An)return An.call(e)==An.call(t)}return!1}(e,t,y,n,l,r,c);if(!(1&n)){var x=C&&Se.call(e,"__wrapped__"),P=A&&Se.call(t,"__wrapped__");if(x||P){var N=x?e.value():e,w=P?t.value():t;return c||(c=new Mn),r(N,w,n,l,c)}}return!!D&&(c||(c=new Mn),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 s=u;s--;){var c=a[s];if(!(o?c in t:Se.call(t,c)))return!1}var d=i.get(e),p=i.get(t);if(d&&p)return d==t&&p==e;var f=!0;i.set(e,t),i.set(t,e);for(var v=o;++s<u;){var m=e[c=a[s]],h=t[c];if(l)var g=o?l(h,m,c,t,e,i):l(m,h,c,e,t,i);if(!(void 0===g?m===h||r(m,h,n,l,i):g)){f=!1;break}v||(v="constructor"==c)}if(f&&!v){var E=e.constructor,_=t.constructor;E==_||!("constructor"in e)||!("constructor"in t)||"function"==typeof E&&E instanceof E&&"function"==typeof _&&_ instanceof _||(f=!1)}return i.delete(e),i.delete(t),f}(e,t,n,l,r,c))}(e,t,n,l,_l,r))}function yl(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],s=e[u],c=a[1];if(o&&a[2]){if(void 0===s&&!(u in e))return!1}else{var d=new Mn;if(l)var p=l(s,c,u,e,t,d);if(!(void 0===p?_l(c,s,3,l,d):p))return!1}}return!0}function Sl(e){return!(!Ho(e)||(t=e,Te&&Te in t))&&(Bo(e)?xe:re).test(Ci(e));var t}function bl(e){return"function"==typeof e?e:null==e?Va:"object"==typeof e?Ro(e)?xl(e[0],e[1]):Dl(e):Qa(e)}function Tl(e){if(!si(e))return ln(e);var t=[];for(var n in fe(e))Se.call(e,n)&&"constructor"!=n&&t.push(n);return t}function Cl(e,t){return e<t}function Al(e,t){var n=-1,l=Oo(e)?c(e.length):[];return Qn(e,function(e,r,i){l[++n]=t(e,r,i)}),l}function Dl(e){var t=Xr(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 xl(e,t){return oi(e)&&ci(t)?di(Ti(e),t):function(n){var l=fa(n,e);return void 0===l&&l===t?va(n,e):_l(t,l,3)}}function Pl(e,t,n,l,r){e!==t&&il(t,function(i,o){if(r||(r=new Mn),Ho(i))!function(e,t,n,l,r,i,o){var a=mi(e,n),u=mi(t,n),s=o.get(u);if(s)Hn(e,n,s);else{var c=i?i(a,u,n+"",e,t,o):void 0,d=void 0===c;if(d){var p=Ro(u),f=!p&&ko(u),v=!p&&!f&&Xo(u);c=u,p||f||v?Ro(a)?c=a:Lo(a)?c=mr(a):f?(d=!1,c=sr(u,!0)):v?(d=!1,c=dr(u,!0)):c=[]:qo(u)||wo(u)?(c=a,wo(a)?c=ra(a):Ho(a)&&!Bo(a)||(c=ni(u))):d=!1}d&&(o.set(u,c),r(c,u,l,i,o),o.delete(u)),Hn(e,n,c)}}(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)}},_a)}function Nl(e,t){var n=e.length;if(n)return ri(t+=t<0?n:0,n)?e[t]:void 0}function wl(e,t,n){t=t.length?st(t,function(e){return Ro(e)?function(t){return cl(t,1===e.length?e[0]:e)}:e}):[Va];var l=-1;return t=st(t,xt(Yr())),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}(Al(e,function(e,n,r){return{criteria:st(t,function(t){return t(e)}),index:++l,value:e}}))}function Rl(e,t,n){for(var l=-1,r=t.length,i={};++l<r;){var o=t[l],a=cl(e,o);n(a,o)&&Ul(i,ir(o,e),a)}return i}function Il(e,t,n,l){var r=l?Et:gt,i=-1,o=t.length,a=e;for(e===t&&(t=mr(t)),n&&(a=st(e,xt(n)));++i<o;)for(var u=0,s=t[i],c=n?n(s):s;(u=r(a,c,u,l))>-1;)a!==e&&Ke.call(a,u,1),Ke.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)?Ke.call(e,r,1):Zl(e,r)}}return e}function Ll(e,t){return e+Jt(sn()*(t-e+1))}function kl(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 Ml(e,t){return Ei(pi(e,t,Va),e+"")}function Fl(e){return Bn(xa(e))}function Bl(e,t){var n=xa(e);return Si(n,Yn(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]),s=n;if("__proto__"===u||"constructor"===u||"prototype"===u)return e;if(r!=o){var c=a[u];void 0===(s=l?l(c,u,a):void 0)&&(s=Ho(c)?c:ri(t[r+1])?[]:{})}Wn(a,u,s),a=a[u]}return e}var jl=gn?function(e,t){return gn.set(e,t),e}:Va,Hl=Kt?function(e,t){return Kt(e,"toString",{configurable:!0,enumerable:!1,value:Ha(t),writable:!0})}:Va;function Wl(e){return Si(xa(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=c(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 ql(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&&!$o(o)&&(n?o<=t:o<t)?l=i+1:r=i}return r}return Gl(e,t,Va,n)}function Gl(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=$o(t),s=void 0===t;r<i;){var c=Jt((r+i)/2),d=n(e[c]),p=void 0!==d,f=null===d,v=d==d,m=$o(d);if(o)var h=l||v;else h=s?v&&(l||p):a?v&&p&&(l||!f):u?v&&p&&!f&&(l||!m):!f&&!m&&(l?d<=t:d<t);h?r=c+1:i=c}return on(i,4294967294)}function Kl(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||!xo(a,u)){var u=a;i[r++]=0===o?0:o}}return i}function Yl(e){return"number"==typeof e?e:$o(e)?NaN:+e}function $l(e){if("string"==typeof e)return e;if(Ro(e))return st(e,$l)+"";if($o(e))return Dn?Dn.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 s=t?null:kr(e);if(s)return jt(s);o=!1,r=Nt,u=new kn}else u=t?[]:a;e:for(;++l<i;){var c=e[l],d=t?t(c):c;if(c=n||0!==c?c:0,o&&d==d){for(var p=u.length;p--;)if(u[p]===d)continue e;t&&u.push(d),a.push(c)}else r(u,d,n)||(u!==a&&u.push(d),a.push(c))}return a}function Zl(e,t){return null==(e=fi(e,t=ir(t,e)))||delete e[Ti(Mi(t))]}function Jl(e,t,n,l){return Ul(e,t,n(cl(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 Rn&&(n=n.value()),dt(t,function(e,t){return t.func.apply(t.thisArg,ct([e],t.args))},n)}function tr(e,t,n){var l=e.length;if(l<2)return l?Xl(e[0]):[];for(var r=-1,i=c(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 Xl(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 Ro(e)?e:oi(e,t)?[e]:bi(ia(e))}var or=Ml;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=Yt||function(e){return ze.clearTimeout(e)};function sr(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 cr(e){var t=new e.constructor(e.byteLength);return new Be(t).set(new Be(e)),t}function dr(e,t){var n=t?cr(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=$o(e),o=void 0!==t,a=null===t,u=t==t,s=$o(t);if(!a&&!s&&!i&&e>t||i&&o&&u&&!a&&!s||l&&o&&u||!n&&u||!r)return 1;if(!l&&!i&&!s&&e<t||s&&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,s=rn(i-o,0),d=c(u+s),p=!l;++a<u;)d[a]=t[a];for(;++r<o;)(p||r<i)&&(d[n[r]]=e[r]);for(;s--;)d[a++]=e[r++];return d}function vr(e,t,n,l){for(var r=-1,i=e.length,o=-1,a=n.length,u=-1,s=t.length,d=rn(i-a,0),p=c(d+s),f=!l;++r<d;)p[r]=e[r];for(var v=r;++u<s;)p[v+u]=t[u];for(;++o<a;)(f||r<i)&&(p[v+n[o]]=e[r++]);return p}function mr(e,t){var n=-1,l=e.length;for(t||(t=c(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?Gn(n,a,u):Wn(n,a,u)}return n}function gr(e,t){return function(n,l){var r=Ro(n)?nt:Vn,i=t?t():{};return r(n,e,Yr(l,2),i)}}function Er(e){return Ml(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=fe(t);++l<r;){var a=n[l];a&&e(t,a,l,i)}return t})}function _r(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=fe(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=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 Sr(e){return function(t){var n=Mt(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(wa(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 Cr(e){return function(t,n,l){var r=fe(t);if(!Oo(t)){var i=Yr(n,3);t=Ea(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 Ar(e){return Wr(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 he(n);if(i&&!a&&"wrapper"==Gr(o))var a=new wn([],!0)}for(r=a?r:l;++r<l;){var u=Gr(o=t[r]),s="wrapper"==u?qr(o):void 0;a=s&&ai(s[0])&&424==s[1]&&!s[4].length&&1==s[9]?a[Gr(s[0])].apply(a,s[3]):1==o.length&&ai(o)?a[u]():a.thru(o)}return function(){var e=arguments,n=e[0];if(a&&1==e.length&&Ro(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,s){var d=128&t,p=1&t,f=2&t,v=24&t,m=512&t,h=f?void 0:Tr(e);return function g(){for(var E=arguments.length,_=c(E),y=E;y--;)_[y]=arguments[y];if(v)var S=Kr(g),b=It(_,S);if(l&&(_=fr(_,l,r,v)),i&&(_=vr(_,i,o,v)),E-=b,v&&E<s){var T=Ut(_,S);return Or(e,t,Dr,g.placeholder,n,_,T,a,u,s-E)}var C=p?n:this,A=f?C[e]:e;return E=_.length,a?_=vi(_,a):m&&E>1&&_.reverse(),d&&u<E&&(_.length=u),this&&this!==ze&&this instanceof g&&(A=h||Tr(A)),A.apply(C,_)}}function xr(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=$l(n),l=$l(l)):(n=Yl(n),l=Yl(l)),r=e(n,l)}return r}}function Nr(e){return Wr(function(t){return t=st(t,xt(Yr())),Ml(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?" ":$l(t)).length;if(n<2)return n?kl(t,e):t;var l=kl(t,Zt(e/Wt(t)));return Mt(t)?ar(zt(l),0,e).join(""):l.slice(0,e)}function Rr(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(Zt((t-e)/(n||1)),0),o=c(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 Ir(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,s){var c=8&t;t|=c?32:64,4&(t&=~(c?64:32))||(t&=-4);var d=[e,t,r,c?i:void 0,c?o:void 0,c?void 0:i,c?void 0:o,a,u,s],p=n.apply(void 0,d);return ai(e)&&hi(p,d),p.placeholder=l,_i(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 kr=vn&&1/jt(new vn([,-0]))[1]==1/0?function(e){return new vn(e)}:$a;function Mr(e){return function(t){var n=ei(t);return n==f?Ft(t):n==g?Ht(t):function(e,t){return st(t,function(t){return[t,e[t]]})}(t,e(t))}}function Fr(e,t,r,i,o,a,u,s){var d=2&t;if(!d&&"function"!=typeof e)throw new he(n);var p=i?i.length:0;if(p||(t&=-97,i=o=void 0),u=void 0===u?u:rn(ta(u),0),s=void 0===s?s:ta(s),p-=o?o.length:0,64&t){var f=i,v=o;i=o=void 0}var m=d?void 0:qr(e),h=[e,t,r,i,o,f,v,a,u,s];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?fr(a,o,t[4]):o,e[4]=a?Ut(e[3],l):t[4]}(o=t[5])&&(e[5]=(a=e[5])?vr(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],!(s=h[9]=void 0===h[9]?d?0:e.length:rn(h[9]-p,0))&&24&t&&(t&=-25),t&&1!=t)g=8==t||16==t?function(e,t,n){var l=Tr(e);return function r(){for(var i=arguments.length,o=c(i),a=i,u=Kr(r);a--;)o[a]=arguments[a];var s=i<3&&o[0]!==u&&o[i-1]!==u?[]:Ut(o,u);if((i-=s.length)<n)return Or(e,t,Dr,r.placeholder,void 0,o,s,void 0,void 0,n-i);var d=this&&this!==ze&&this instanceof r?l:e;return tt(d,this,o)}}(e,t,s):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,s=l.length,d=c(s+a),p=this&&this!==ze&&this instanceof t?i:e;++u<s;)d[u]=l[u];for(;a--;)d[u++]=arguments[++o];return tt(p,r?n:this,d)}}(e,t,r,i);else var g=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 _i((m?jl:hi)(g,h),e,t)}function Br(e,t,n,l){return void 0===e||xo(e,Ee[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 qo(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 s=i.get(e),c=i.get(t);if(s&&c)return s==t&&c==e;var d=-1,p=!0,f=2&n?new kn:void 0;for(i.set(e,t),i.set(t,e);++d<a;){var v=e[d],m=t[d];if(l)var h=o?l(m,v,d,t,e,i):l(v,m,d,e,t,i);if(void 0!==h){if(h)continue;p=!1;break}if(f){if(!ft(t,function(e,t){if(!Nt(f,t)&&(v===e||r(v,e,n,l,i)))return f.push(t)})){p=!1;break}}else if(v!==m&&!r(v,m,n,l,i)){p=!1;break}}return i.delete(e),i.delete(t),p}function Wr(e){return Ei(pi(e,void 0,Ri),e+"")}function zr(e){return dl(e,Ea,Jr)}function Vr(e){return dl(e,_a,Qr)}var qr=gn?function(e){return gn.get(e)}:$a;function Gr(e){for(var t=e.name+"",n=En[t],l=Se.call(En,t)?n.length:0;l--;){var r=n[l],i=r.func;if(null==i||i==e)return r.name}return t}function Kr(e){return(Se.call(xn,"placeholder")?xn:e).placeholder}function Yr(){var e=xn.iteratee||qa;return e=e===qa?bl:e,arguments.length?e(arguments[0],arguments[1]):e}function $r(e,t){var n=e.__data__;return function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}(t)?n["string"==typeof t?"string":"hash"]:n.map}function Xr(e){for(var t=Ea(e),n=t.length;n--;){var l=t[n],r=e[l];t[n]=[l,r,ci(r)]}return t}function Zr(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=fe(e),ot(Qt(e),function(t){return qe.call(e,t)}))}:nu,Qr=Qt?function(e){for(var t=[];e;)ct(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)&&(Ro(e)||wo(e))}function ni(e){return"function"!=typeof e.constructor||si(e)?{}:Pn(We(e))}function li(e){return Ro(e)||wo(e)||!!(Ye&&e&&e[Ye])}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)&&xo(n[t],e)}function oi(e,t){if(Ro(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!$o(e))||W.test(e)||!H.test(e)||null!=t&&e in fe(t)}function ai(e){var t=Gr(e),n=xn[t];if("function"!=typeof n||!(t in Rn.prototype))return!1;if(e===n)return!0;var l=qr(n);return!!l&&e===l[0]}(dn&&ei(new dn(new ArrayBuffer(1)))!=b||pn&&ei(new pn)!=f||fn&&"[object Promise]"!=ei(fn.resolve())||vn&&ei(new vn)!=g||mn&&ei(new mn)!=y)&&(ei=function(e){var t=pl(e),n=t==m?e.constructor:void 0,l=n?Ci(n):"";if(l)switch(l){case _n:return b;case yn:return f;case Sn:return"[object Promise]";case bn:return g;case Tn:return y}return t});var ui=_e?Bo:lu;function si(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Ee)}function ci(e){return e==e&&!Ho(e)}function di(e,t){return function(n){return null!=n&&n[e]===t&&(void 0!==t||e in fe(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=c(i);++r<i;)o[r]=l[t+r];r=-1;for(var a=c(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:cl(e,zl(t,0,-1))}function vi(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),gi=Xt||function(e,t){return ze.setTimeout(e,t)},Ei=yi(Hl);function _i(e,t,n){var l=t+"";return Ei(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(Y,"{\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($);return t?t[1].split(X):[]}(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||$o(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Ci(e){if(null!=e){try{return ye.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function Ai(e){if(e instanceof Rn)return e.clone();var t=new wn(e.__wrapped__,e.__chain__);return t.__actions__=mr(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var Di=Ml(function(e,t){return Lo(e)?Jn(e,rl(t,1,Lo,!0)):[]}),xi=Ml(function(e,t){var n=Mi(t);return Lo(n)&&(n=void 0),Lo(e)?Jn(e,rl(t,1,Lo,!0),Yr(n,2)):[]}),Pi=Ml(function(e,t){var n=Mi(t);return Lo(n)&&(n=void 0),Lo(e)?Jn(e,rl(t,1,Lo,!0),void 0,n):[]});function Ni(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,Yr(t,3),r)}function wi(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,Yr(t,3),r,!0)}function Ri(e){return null!=e&&e.length?rl(e,1):[]}function Ii(e){return e&&e.length?e[0]:void 0}var Oi=Ml(function(e){var t=st(e,lr);return t.length&&t[0]===e[0]?hl(t):[]}),Li=Ml(function(e){var t=Mi(e),n=st(e,lr);return t===Mi(n)?t=void 0:n.pop(),n.length&&n[0]===e[0]?hl(n,Yr(t,2)):[]}),ki=Ml(function(e){var t=Mi(e),n=st(e,lr);return(t="function"==typeof t?t:void 0)&&n.pop(),n.length&&n[0]===e[0]?hl(n,void 0,t):[]});function Mi(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}var Fi=Ml(Bi);function Bi(e,t){return e&&e.length&&t&&t.length?Il(e,t):e}var Ui=Wr(function(e,t){var n=null==e?0:e.length,l=Kn(e,t);return Ol(e,st(t,function(e){return ri(e,n)?+e:e}).sort(pr)),l});function ji(e){return null==e?e:cn.call(e)}var Hi=Ml(function(e){return Xl(rl(e,1,Lo,!0))}),Wi=Ml(function(e){var t=Mi(e);return Lo(t)&&(t=void 0),Xl(rl(e,1,Lo,!0),Yr(t,2))}),zi=Ml(function(e){var t=Mi(e);return t="function"==typeof t?t:void 0,Xl(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}),At(t,function(t){return st(e,St(t))})}function qi(e,t){if(!e||!e.length)return[];var n=Vi(e);return null==t?n:st(n,function(e){return tt(t,void 0,e)})}var Gi=Ml(function(e,t){return Lo(e)?Jn(e,t):[]}),Ki=Ml(function(e){return tr(ot(e,Lo))}),Yi=Ml(function(e){var t=Mi(e);return Lo(t)&&(t=void 0),tr(ot(e,Lo),Yr(t,2))}),$i=Ml(function(e){var t=Mi(e);return t="function"==typeof t?t:void 0,tr(ot(e,Lo),void 0,t)}),Xi=Ml(Vi),Zi=Ml(function(e){var t=e.length,n=t>1?e[t-1]:void 0;return n="function"==typeof n?(e.pop(),n):void 0,qi(e,n)});function Ji(e){var t=xn(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 Kn(t,e)};return!(t>1||this.__actions__.length)&&l instanceof Rn&&ri(n)?((l=l.slice(n,+n+(t?1:0))).__actions__.push({func:Qi,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)}),to=gr(function(e,t,n){Se.call(e,n)?++e[n]:Gn(e,n,1)}),no=Cr(Ni),lo=Cr(wi);function ro(e,t){return(Ro(e)?lt:Qn)(e,Yr(t,3))}function io(e,t){return(Ro(e)?rt:el)(e,Yr(t,3))}var oo=gr(function(e,t,n){Se.call(e,n)?e[n].push(t):Gn(e,n,[t])}),ao=Ml(function(e,t,n){var l=-1,r="function"==typeof t,i=Oo(e)?c(e.length):[];return Qn(e,function(e){i[++l]=r?tt(t,e,n):gl(e,t,n)}),i}),uo=gr(function(e,t,n){Gn(e,n,t)});function so(e,t){return(Ro(e)?st:Al)(e,Yr(t,3))}var co=gr(function(e,t,n){e[n?0:1].push(t)},function(){return[[],[]]}),po=Ml(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]]),wl(e,rl(t,1),[])}),fo=$t||function(){return ze.Date.now()};function vo(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=Ml(function(e,t,n){var l=1;if(n.length){var r=Ut(n,Kr(ho));l|=32}return Fr(e,l,t,n,r)}),go=Ml(function(e,t,n){var l=3;if(n.length){var r=Ut(n,Kr(go));l|=32}return Fr(t,l,e,n,r)});function Eo(e,t,l){var r,i,o,a,u,s,c=0,d=!1,p=!1,f=!0;if("function"!=typeof e)throw new he(n);function v(t){var n=r,l=i;return r=i=void 0,c=t,a=e.apply(l,n)}function m(e){return c=e,u=gi(g,t),d?v(e):a}function h(e){var n=e-s;return void 0===s||n>=t||n<0||p&&e-c>=o}function g(){var e=fo();if(h(e))return E(e);u=gi(g,function(e){var n=t-(e-s);return p?on(n,o-(e-c)):n}(e))}function E(e){return u=void 0,f&&r?v(e):(r=i=void 0,a)}function _(){var e=fo(),n=h(e);if(r=arguments,i=this,s=e,n){if(void 0===u)return m(s);if(p)return ur(u),u=gi(g,t),v(s)}return void 0===u&&(u=gi(g,t)),a}return t=la(t)||0,Ho(l)&&(d=!!l.leading,o=(p="maxWait"in l)?rn(la(l.maxWait)||0,t):o,f="trailing"in l?!!l.trailing:f),_.cancel=function(){void 0!==u&&ur(u),c=0,r=s=i=u=void 0},_.flush=function(){return void 0===u?a:E(fo())},_}var _o=Ml(function(e,t){return Zn(e,1,t)}),yo=Ml(function(e,t,n){return Zn(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&&Ro(t[0])?st(t[0],xt(Yr())):st(rl(t,1),xt(Yr()))).length;return Ml(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)})}),Co=Ml(function(e,t){return Fr(e,32,void 0,t,Ut(t,Kr(Co)))}),Ao=Ml(function(e,t){return Fr(e,64,void 0,t,Ut(t,Kr(Ao)))}),Do=Wr(function(e,t){return Fr(e,256,void 0,void 0,void 0,t)});function xo(e,t){return e===t||e!=e&&t!=t}var Po=Ir(fl),No=Ir(function(e,t){return e>=t}),wo=El(function(){return arguments}())?El:function(e){return Wo(e)&&Se.call(e,"callee")&&!qe.call(e,"callee")},Ro=c.isArray,Io=$e?xt($e):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 ko=en||lu,Mo=Xe?xt(Xe):function(e){return Wo(e)&&pl(e)==u};function Fo(e){if(!Wo(e))return!1;var t=pl(e);return t==s||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!qo(e)}function Bo(e){if(!Ho(e))return!1;var t=pl(e);return t==d||t==p||"[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=Ze?xt(Ze):function(e){return Wo(e)&&ei(e)==f};function Vo(e){return"number"==typeof e||Wo(e)&&pl(e)==v}function qo(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)==Ae}var Go=Je?xt(Je):function(e){return Wo(e)&&pl(e)==h},Ko=Qe?xt(Qe):function(e){return Wo(e)&&ei(e)==g};function Yo(e){return"string"==typeof e||!Ro(e)&&Wo(e)&&pl(e)==E}function $o(e){return"symbol"==typeof e||Wo(e)&&pl(e)==_}var Xo=et?xt(et):function(e){return Wo(e)&&jo(e.length)&&!!Me[pl(e)]},Zo=Ir(Cl),Jo=Ir(function(e,t){return e<=t});function Qo(e){if(!e)return[];if(Oo(e))return Yo(e)?zt(e):mr(e);if(vt&&e[vt])return function(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}(e[vt]());var t=ei(e);return(t==f?Ft:t==g?jt:xa)(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?Yn(ta(e),0,4294967295):0}function la(e){if("number"==typeof e)return e;if($o(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,_a(e))}function ia(e){return null==e?"":$l(e)}var oa=Er(function(e,t){if(si(t)||Oo(t))hr(t,Ea(t),e);else for(var n in t)Se.call(t,n)&&Wn(e,n,t[n])}),aa=Er(function(e,t){hr(t,_a(t),e)}),ua=Er(function(e,t,n,l){hr(t,_a(t),e,l)}),sa=Er(function(e,t,n,l){hr(t,Ea(t),e,l)}),ca=Wr(Kn),da=Ml(function(e,t){e=fe(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=_a(i),a=-1,u=o.length;++a<u;){var s=o[a],c=e[s];(void 0===c||xo(c,Ee[s])&&!Se.call(e,s))&&(e[s]=i[s])}return e}),pa=Ml(function(e){return e.push(void 0,Ur),tt(Sa,void 0,e)});function fa(e,t,n){var l=null==e?void 0:cl(e,t);return void 0===l?n:l}function va(e,t){return null!=e&&ti(e,t,ml)}var ma=xr(function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=Ce.call(t)),e[t]=n},Ha(Va)),ha=xr(function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=Ce.call(t)),Se.call(e,t)?e[t].push(n):e[t]=[n]},Yr),ga=Ml(gl);function Ea(e){return Oo(e)?Fn(e):Tl(e)}function _a(e){return Oo(e)?Fn(e,!0):function(e){if(!Ho(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&&Se.call(e,l))&&n.push(l);return n}(e)}var ya=Er(function(e,t,n){Pl(e,t,n)}),Sa=Er(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=st(t,function(t){return t=ir(t,e),l||(l=t.length>1),t}),hr(e,Vr(e),n),l&&(n=$n(n,7,jr));for(var r=t.length;r--;)Zl(n,t[r]);return n}),Ta=Wr(function(e,t){return null==e?{}:function(e,t){return Rl(e,t,function(t,n){return va(e,n)})}(e,t)});function Ca(e,t){if(null==e)return{};var n=st(Vr(e),function(e){return[e]});return t=Yr(t),Rl(e,n,function(e,n){return t(e,n[0])})}var Aa=Mr(Ea),Da=Mr(_a);function xa(e){return null==e?[]:Pt(e,Ea(e))}var Pa=br(function(e,t,n){return t=t.toLowerCase(),e+(n?Na(t):t)});function Na(e){return Fa(ia(e).toLowerCase())}function wa(e){return(e=ia(e))&&e.replace(ae,Ot).replace(Ne,"")}var Ra=br(function(e,t,n){return e+(n?"-":"")+t.toLowerCase()}),Ia=br(function(e,t,n){return e+(n?" ":"")+t.toLowerCase()}),Oa=Sr("toLowerCase"),La=br(function(e,t,n){return e+(n?"_":"")+t.toLowerCase()}),ka=br(function(e,t,n){return e+(n?" ":"")+Fa(t)}),Ma=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(Re)||[]}(e):function(e){return e.match(Z)||[]}(e):e.match(t)||[]}var Ua=Ml(function(e,t){try{return tt(e,void 0,t)}catch(e){return Fo(e)?e:new ce(e)}}),ja=Wr(function(e,t){return lt(t,function(t){t=Ti(t),Gn(e,t,ho(e[t],e))}),e});function Ha(e){return function(){return e}}var Wa=Ar(),za=Ar(!0);function Va(e){return e}function qa(e){return bl("function"==typeof e?e:$n(e,1))}var Ga=Ml(function(e,t){return function(n){return gl(n,e,t)}}),Ka=Ml(function(e,t){return function(n){return gl(e,n,t)}});function Ya(e,t,n){var l=Ea(t),r=sl(t,l);null!=n||Ho(t)&&(r.length||!l.length)||(n=t,t=e,e=this,r=sl(t,Ea(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,ct([this.value()],arguments))})}),e}function $a(){}var Xa=Nr(st),Za=Nr(it),Ja=Nr(ft);function Qa(e){return oi(e)?St(Ti(e)):function(e){return function(t){return cl(t,e)}}(e)}var eu=Rr(),tu=Rr(!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"),su=Pr(function(e,t){return e*t},1),cu=Lr("round"),du=Pr(function(e,t){return e-t},0);return xn.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)}},xn.ary=vo,xn.assign=oa,xn.assignIn=aa,xn.assignInWith=ua,xn.assignWith=sa,xn.at=ca,xn.before=mo,xn.bind=ho,xn.bindAll=ja,xn.bindKey=go,xn.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return Ro(e)?e:[e]},xn.chain=Ji,xn.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=c(Zt(l/t));r<l;)o[i++]=zl(e,r,r+=t);return o},xn.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},xn.concat=function(){var e=arguments.length;if(!e)return[];for(var t=c(e-1),n=arguments[0],l=e;l--;)t[l-1]=arguments[l];return ct(Ro(n)?mr(n):[n],rl(t,1))},xn.cond=function(e){var t=null==e?0:e.length,l=Yr();return e=t?st(e,function(e){if("function"!=typeof e[1])throw new he(n);return[l(e[0]),e[1]]}):[],Ml(function(n){for(var l=-1;++l<t;){var r=e[l];if(tt(r[0],this,n))return tt(r[1],this,n)}})},xn.conforms=function(e){return function(e){var t=Ea(e);return function(n){return Xn(n,e,t)}}($n(e,1))},xn.constant=Ha,xn.countBy=to,xn.create=function(e,t){var n=Pn(e);return null==t?n:qn(n,t)},xn.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},xn.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},xn.debounce=Eo,xn.defaults=da,xn.defaultsDeep=pa,xn.defer=_o,xn.delay=yo,xn.difference=Di,xn.differenceBy=xi,xn.differenceWith=Pi,xn.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):[]},xn.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):[]},xn.dropRightWhile=function(e,t){return e&&e.length?Ql(e,Yr(t,3),!0,!0):[]},xn.dropWhile=function(e,t){return e&&e.length?Ql(e,Yr(t,3),!0):[]},xn.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)):[]},xn.filter=function(e,t){return(Ro(e)?ot:ll)(e,Yr(t,3))},xn.flatMap=function(e,t){return rl(so(e,t),1)},xn.flatMapDeep=function(e,t){return rl(so(e,t),1/0)},xn.flatMapDepth=function(e,t,n){return n=void 0===n?1:ta(n),rl(so(e,t),n)},xn.flatten=Ri,xn.flattenDeep=function(e){return null!=e&&e.length?rl(e,1/0):[]},xn.flattenDepth=function(e,t){return null!=e&&e.length?rl(e,t=void 0===t?1:ta(t)):[]},xn.flip=function(e){return Fr(e,512)},xn.flow=Wa,xn.flowRight=za,xn.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},xn.functions=function(e){return null==e?[]:sl(e,Ea(e))},xn.functionsIn=function(e){return null==e?[]:sl(e,_a(e))},xn.groupBy=oo,xn.initial=function(e){return null!=e&&e.length?zl(e,0,-1):[]},xn.intersection=Oi,xn.intersectionBy=Li,xn.intersectionWith=ki,xn.invert=ma,xn.invertBy=ha,xn.invokeMap=ao,xn.iteratee=qa,xn.keyBy=uo,xn.keys=Ea,xn.keysIn=_a,xn.map=so,xn.mapKeys=function(e,t){var n={};return t=Yr(t,3),al(e,function(e,l,r){Gn(n,t(e,l,r),e)}),n},xn.mapValues=function(e,t){var n={};return t=Yr(t,3),al(e,function(e,l,r){Gn(n,l,t(e,l,r))}),n},xn.matches=function(e){return Dl($n(e,1))},xn.matchesProperty=function(e,t){return xl(e,$n(t,1))},xn.memoize=So,xn.merge=ya,xn.mergeWith=Sa,xn.method=Ga,xn.methodOf=Ka,xn.mixin=Ya,xn.negate=bo,xn.nthArg=function(e){return e=ta(e),Ml(function(t){return Nl(t,e)})},xn.omit=ba,xn.omitBy=function(e,t){return Ca(e,bo(Yr(t)))},xn.once=function(e){return mo(2,e)},xn.orderBy=function(e,t,n,l){return null==e?[]:(Ro(t)||(t=null==t?[]:[t]),Ro(n=l?void 0:n)||(n=null==n?[]:[n]),wl(e,t,n))},xn.over=Xa,xn.overArgs=To,xn.overEvery=Za,xn.overSome=Ja,xn.partial=Co,xn.partialRight=Ao,xn.partition=co,xn.pick=Ta,xn.pickBy=Ca,xn.property=Qa,xn.propertyOf=function(e){return function(t){return null==e?void 0:cl(e,t)}},xn.pull=Fi,xn.pullAll=Bi,xn.pullAllBy=function(e,t,n){return e&&e.length&&t&&t.length?Il(e,t,Yr(n,2)):e},xn.pullAllWith=function(e,t,n){return e&&e.length&&t&&t.length?Il(e,t,void 0,n):e},xn.pullAt=Ui,xn.range=eu,xn.rangeRight=tu,xn.rearg=Do,xn.reject=function(e,t){return(Ro(e)?ot:ll)(e,bo(Yr(t,3)))},xn.remove=function(e,t){var n=[];if(!e||!e.length)return n;var l=-1,r=[],i=e.length;for(t=Yr(t,3);++l<i;){var o=e[l];t(o,l,e)&&(n.push(o),r.push(l))}return Ol(e,r),n},xn.rest=function(e,t){if("function"!=typeof e)throw new he(n);return Ml(e,t=void 0===t?t:ta(t))},xn.reverse=ji,xn.sampleSize=function(e,t,n){return t=(n?ii(e,t,n):void 0===t)?1:ta(t),(Ro(e)?Un:Bl)(e,t)},xn.set=function(e,t,n){return null==e?e:Ul(e,t,n)},xn.setWith=function(e,t,n,l){return l="function"==typeof l?l:void 0,null==e?e:Ul(e,t,n,l)},xn.shuffle=function(e){return(Ro(e)?jn:Wl)(e)},xn.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)):[]},xn.sortBy=po,xn.sortedUniq=function(e){return e&&e.length?Kl(e):[]},xn.sortedUniqBy=function(e,t){return e&&e.length?Kl(e,Yr(t,2)):[]},xn.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&&!Go(t))&&!(t=$l(t))&&Mt(e)?ar(zt(e),0,n):e.split(t,n):[]},xn.spread=function(e,t){if("function"!=typeof e)throw new he(n);return t=null==t?0:rn(ta(t),0),Ml(function(n){var l=n[t],r=ar(n,0,t);return l&&ct(r,l),tt(e,this,r)})},xn.tail=function(e){var t=null==e?0:e.length;return t?zl(e,1,t):[]},xn.take=function(e,t,n){return e&&e.length?zl(e,0,(t=n||void 0===t?1:ta(t))<0?0:t):[]},xn.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):[]},xn.takeRightWhile=function(e,t){return e&&e.length?Ql(e,Yr(t,3),!1,!0):[]},xn.takeWhile=function(e,t){return e&&e.length?Ql(e,Yr(t,3)):[]},xn.tap=function(e,t){return t(e),e},xn.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),Eo(e,t,{leading:r,maxWait:t,trailing:i})},xn.thru=Qi,xn.toArray=Qo,xn.toPairs=Aa,xn.toPairsIn=Da,xn.toPath=function(e){return Ro(e)?st(e,Ti):$o(e)?[e]:mr(bi(ia(e)))},xn.toPlainObject=ra,xn.transform=function(e,t,n){var l=Ro(e),r=l||ko(e)||Xo(e);if(t=Yr(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},xn.unary=function(e){return vo(e,1)},xn.union=Hi,xn.unionBy=Wi,xn.unionWith=zi,xn.uniq=function(e){return e&&e.length?Xl(e):[]},xn.uniqBy=function(e,t){return e&&e.length?Xl(e,Yr(t,2)):[]},xn.uniqWith=function(e,t){return t="function"==typeof t?t:void 0,e&&e.length?Xl(e,void 0,t):[]},xn.unset=function(e,t){return null==e||Zl(e,t)},xn.unzip=Vi,xn.unzipWith=qi,xn.update=function(e,t,n){return null==e?e:Jl(e,t,rr(n))},xn.updateWith=function(e,t,n,l){return l="function"==typeof l?l:void 0,null==e?e:Jl(e,t,rr(n),l)},xn.values=xa,xn.valuesIn=function(e){return null==e?[]:Pt(e,_a(e))},xn.without=Gi,xn.words=Ba,xn.wrap=function(e,t){return Co(rr(t),e)},xn.xor=Ki,xn.xorBy=Yi,xn.xorWith=$i,xn.zip=Xi,xn.zipObject=function(e,t){return nr(e||[],t||[],Wn)},xn.zipObjectDeep=function(e,t){return nr(e||[],t||[],Ul)},xn.zipWith=Zi,xn.entries=Aa,xn.entriesIn=Da,xn.extend=aa,xn.extendWith=ua,Ya(xn,xn),xn.add=iu,xn.attempt=Ua,xn.camelCase=Pa,xn.capitalize=Na,xn.ceil=ou,xn.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),Yn(la(e),t,n)},xn.clone=function(e){return $n(e,4)},xn.cloneDeep=function(e){return $n(e,5)},xn.cloneDeepWith=function(e,t){return $n(e,5,t="function"==typeof t?t:void 0)},xn.cloneWith=function(e,t){return $n(e,4,t="function"==typeof t?t:void 0)},xn.conformsTo=function(e,t){return null==t||Xn(e,t,Ea(t))},xn.deburr=wa,xn.defaultTo=function(e,t){return null==e||e!=e?t:e},xn.divide=au,xn.endsWith=function(e,t,n){e=ia(e),t=$l(t);var l=e.length,r=n=void 0===n?l:Yn(ta(n),0,l);return(n-=t.length)>=0&&e.slice(n,r)==t},xn.eq=xo,xn.escape=function(e){return(e=ia(e))&&F.test(e)?e.replace(k,Lt):e},xn.escapeRegExp=function(e){return(e=ia(e))&&q.test(e)?e.replace(V,"\\$&"):e},xn.every=function(e,t,n){var l=Ro(e)?it:tl;return n&&ii(e,t,n)&&(t=void 0),l(e,Yr(t,3))},xn.find=no,xn.findIndex=Ni,xn.findKey=function(e,t){return mt(e,Yr(t,3),al)},xn.findLast=lo,xn.findLastIndex=wi,xn.findLastKey=function(e,t){return mt(e,Yr(t,3),ul)},xn.floor=uu,xn.forEach=ro,xn.forEachRight=io,xn.forIn=function(e,t){return null==e?e:il(e,Yr(t,3),_a)},xn.forInRight=function(e,t){return null==e?e:ol(e,Yr(t,3),_a)},xn.forOwn=function(e,t){return e&&al(e,Yr(t,3))},xn.forOwnRight=function(e,t){return e&&ul(e,Yr(t,3))},xn.get=fa,xn.gt=Po,xn.gte=No,xn.has=function(e,t){return null!=e&&ti(e,t,vl)},xn.hasIn=va,xn.head=Ii,xn.identity=Va,xn.includes=function(e,t,n,l){e=Oo(e)?e:xa(e),n=n&&!l?ta(n):0;var r=e.length;return n<0&&(n=rn(r+n,0)),Yo(e)?n<=r&&e.indexOf(t,n)>-1:!!r&>(e,t,n)>-1},xn.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)),gt(e,t,r)},xn.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)},xn.invoke=ga,xn.isArguments=wo,xn.isArray=Ro,xn.isArrayBuffer=Io,xn.isArrayLike=Oo,xn.isArrayLikeObject=Lo,xn.isBoolean=function(e){return!0===e||!1===e||Wo(e)&&pl(e)==a},xn.isBuffer=ko,xn.isDate=Mo,xn.isElement=function(e){return Wo(e)&&1===e.nodeType&&!qo(e)},xn.isEmpty=function(e){if(null==e)return!0;if(Oo(e)&&(Ro(e)||"string"==typeof e||"function"==typeof e.splice||ko(e)||Xo(e)||wo(e)))return!e.length;var t=ei(e);if(t==f||t==g)return!e.size;if(si(e))return!Tl(e).length;for(var n in e)if(Se.call(e,n))return!1;return!0},xn.isEqual=function(e,t){return _l(e,t)},xn.isEqualWith=function(e,t,n){var l=(n="function"==typeof n?n:void 0)?n(e,t):void 0;return void 0===l?_l(e,t,void 0,n):!!l},xn.isError=Fo,xn.isFinite=function(e){return"number"==typeof e&&tn(e)},xn.isFunction=Bo,xn.isInteger=Uo,xn.isLength=jo,xn.isMap=zo,xn.isMatch=function(e,t){return e===t||yl(e,t,Xr(t))},xn.isMatchWith=function(e,t,n){return n="function"==typeof n?n:void 0,yl(e,t,Xr(t),n)},xn.isNaN=function(e){return Vo(e)&&e!=+e},xn.isNative=function(e){if(ui(e))throw new ce("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return Sl(e)},xn.isNil=function(e){return null==e},xn.isNull=function(e){return null===e},xn.isNumber=Vo,xn.isObject=Ho,xn.isObjectLike=Wo,xn.isPlainObject=qo,xn.isRegExp=Go,xn.isSafeInteger=function(e){return Uo(e)&&e>=-9007199254740991&&e<=9007199254740991},xn.isSet=Ko,xn.isString=Yo,xn.isSymbol=$o,xn.isTypedArray=Xo,xn.isUndefined=function(e){return void 0===e},xn.isWeakMap=function(e){return Wo(e)&&ei(e)==y},xn.isWeakSet=function(e){return Wo(e)&&"[object WeakSet]"==pl(e)},xn.join=function(e,t){return null==e?"":nn.call(e,t)},xn.kebabCase=Ra,xn.last=Mi,xn.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,_t,r,!0)},xn.lowerCase=Ia,xn.lowerFirst=Oa,xn.lt=Zo,xn.lte=Jo,xn.max=function(e){return e&&e.length?nl(e,Va,fl):void 0},xn.maxBy=function(e,t){return e&&e.length?nl(e,Yr(t,2),fl):void 0},xn.mean=function(e){return yt(e,Va)},xn.meanBy=function(e,t){return yt(e,Yr(t,2))},xn.min=function(e){return e&&e.length?nl(e,Va,Cl):void 0},xn.minBy=function(e,t){return e&&e.length?nl(e,Yr(t,2),Cl):void 0},xn.stubArray=nu,xn.stubFalse=lu,xn.stubObject=function(){return{}},xn.stubString=function(){return""},xn.stubTrue=function(){return!0},xn.multiply=su,xn.nth=function(e,t){return e&&e.length?Nl(e,ta(t)):void 0},xn.noConflict=function(){return ze._===this&&(ze._=De),this},xn.noop=$a,xn.now=fo,xn.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 wr(Jt(r),n)+e+wr(Zt(r),n)},xn.padEnd=function(e,t,n){e=ia(e);var l=(t=ta(t))?Wt(e):0;return t&&l<t?e+wr(t-l,n):e},xn.padStart=function(e,t,n){e=ia(e);var l=(t=ta(t))?Wt(e):0;return t&&l<t?wr(t-l,n)+e:e},xn.parseInt=function(e,t,n){return n||null==t?t=0:t&&(t=+t),un(ia(e).replace(G,""),t||0)},xn.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=sn();return on(e+r*(t-e+Ue("1e-"+((r+"").length-1))),t)}return Ll(e,t)},xn.reduce=function(e,t,n){var l=Ro(e)?dt:Tt,r=arguments.length<3;return l(e,Yr(t,4),n,r,Qn)},xn.reduceRight=function(e,t,n){var l=Ro(e)?pt:Tt,r=arguments.length<3;return l(e,Yr(t,4),n,r,el)},xn.repeat=function(e,t,n){return t=(n?ii(e,t,n):void 0===t)?1:ta(t),kl(ia(e),t)},xn.replace=function(){var e=arguments,t=ia(e[0]);return e.length<3?t:t.replace(e[1],e[2])},xn.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},xn.round=cu,xn.runInContext=e,xn.sample=function(e){return(Ro(e)?Bn:Fl)(e)},xn.size=function(e){if(null==e)return 0;if(Oo(e))return Yo(e)?Wt(e):e.length;var t=ei(e);return t==f||t==g?e.size:Tl(e).length},xn.snakeCase=La,xn.some=function(e,t,n){var l=Ro(e)?ft:Vl;return n&&ii(e,t,n)&&(t=void 0),l(e,Yr(t,3))},xn.sortedIndex=function(e,t){return ql(e,t)},xn.sortedIndexBy=function(e,t,n){return Gl(e,t,Yr(n,2))},xn.sortedIndexOf=function(e,t){var n=null==e?0:e.length;if(n){var l=ql(e,t);if(l<n&&xo(e[l],t))return l}return-1},xn.sortedLastIndex=function(e,t){return ql(e,t,!0)},xn.sortedLastIndexBy=function(e,t,n){return Gl(e,t,Yr(n,2),!0)},xn.sortedLastIndexOf=function(e,t){if(null!=e&&e.length){var n=ql(e,t,!0)-1;if(xo(e[n],t))return n}return-1},xn.startCase=ka,xn.startsWith=function(e,t,n){return e=ia(e),n=null==n?0:Yn(ta(n),0,e.length),t=$l(t),e.slice(n,n+t.length)==t},xn.subtract=du,xn.sum=function(e){return e&&e.length?Ct(e,Va):0},xn.sumBy=function(e,t){return e&&e.length?Ct(e,Yr(t,2)):0},xn.template=function(e,t,n){var l=xn.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=Ea(o),u=Pt(o,a),s=0,c=t.interpolate||ue,d="__p += '",p=ve((t.escape||ue).source+"|"+c.source+"|"+(c===j?ee:ue).source+"|"+(t.evaluate||ue).source+"|$","g"),f="//# sourceURL="+(Se.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++ke+"]")+"\n";e.replace(p,function(t,n,l,o,a,u){return l||(l=o),d+=e.slice(s,u).replace(se,kt),n&&(r=!0,d+="' +\n__e("+n+") +\n'"),a&&(i=!0,d+="';\n"+a+";\n__p += '"),l&&(d+="' +\n((__t = ("+l+")) == null ? '' : __t) +\n'"),s=u+t.length,t}),d+="';\n";var v=Se.call(t,"variable")&&t.variable;if(v){if(J.test(v))throw new ce("Invalid `variable` option passed into `_.template`")}else d="with (obj) {\n"+d+"\n}\n";d=(i?d.replace(R,""):d).replace(I,"$1").replace(O,"$1;"),d="function("+(v||"obj")+") {\n"+(v?"":"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,f+"return "+d).apply(void 0,u)});if(m.source=d,Fo(m))throw m;return m},xn.times=function(e,t){if((e=ta(e))<1||e>9007199254740991)return[];var n=4294967295,l=on(e,4294967295);e-=4294967295;for(var r=At(l,t=Yr(t));++n<e;)t(n);return r},xn.toFinite=ea,xn.toInteger=ta,xn.toLength=na,xn.toLower=function(e){return ia(e).toLowerCase()},xn.toNumber=la,xn.toSafeInteger=function(e){return e?Yn(ta(e),-9007199254740991,9007199254740991):0===e?e:0},xn.toString=ia,xn.toUpper=function(e){return ia(e).toUpperCase()},xn.trim=function(e,t,n){if((e=ia(e))&&(n||void 0===t))return Dt(e);if(!e||!(t=$l(t)))return e;var l=zt(e),r=zt(t);return ar(l,wt(l,r),Rt(l,r)+1).join("")},xn.trimEnd=function(e,t,n){if((e=ia(e))&&(n||void 0===t))return e.slice(0,Vt(e)+1);if(!e||!(t=$l(t)))return e;var l=zt(e);return ar(l,0,Rt(l,zt(t))+1).join("")},xn.trimStart=function(e,t,n){if((e=ia(e))&&(n||void 0===t))return e.replace(G,"");if(!e||!(t=$l(t)))return e;var l=zt(e);return ar(l,wt(l,zt(t))).join("")},xn.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?$l(t.omission):l}var i=(e=ia(e)).length;if(Mt(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),Go(r)){if(e.slice(a).search(r)){var s,c=u;for(r.global||(r=ve(r.source,ia(te.exec(r))+"g")),r.lastIndex=0;s=r.exec(c);)var d=s.index;u=u.slice(0,void 0===d?a:d)}}else if(e.indexOf($l(r),a)!=a){var p=u.lastIndexOf(r);p>-1&&(u=u.slice(0,p))}return u+l},xn.unescape=function(e){return(e=ia(e))&&M.test(e)?e.replace(L,qt):e},xn.uniqueId=function(e){var t=++be;return ia(e)+t},xn.upperCase=Ma,xn.upperFirst=Fa,xn.each=ro,xn.eachRight=io,xn.first=Ii,Ya(xn,(ru={},al(xn,function(e,t){Se.call(xn.prototype,t)||(ru[t]=e)}),ru),{chain:!1}),xn.VERSION="4.17.21",lt(["bind","bindKey","curry","curryRight","partial","partialRight"],function(e){xn[e].placeholder=xn}),lt(["drop","take"],function(e,t){Rn.prototype[e]=function(n){n=void 0===n?1:rn(ta(n),0);var l=this.__filtered__&&!t?new Rn(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},Rn.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}}),lt(["filter","map","takeWhile"],function(e,t){var n=t+1,l=1==n||3==n;Rn.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:Yr(e,3),type:n}),t.__filtered__=t.__filtered__||l,t}}),lt(["head","last"],function(e,t){var n="take"+(t?"Right":"");Rn.prototype[e]=function(){return this[n](1).value()[0]}}),lt(["initial","tail"],function(e,t){var n="drop"+(t?"":"Right");Rn.prototype[e]=function(){return this.__filtered__?new Rn(this):this[n](1)}}),Rn.prototype.compact=function(){return this.filter(Va)},Rn.prototype.find=function(e){return this.filter(e).head()},Rn.prototype.findLast=function(e){return this.reverse().find(e)},Rn.prototype.invokeMap=Ml(function(e,t){return"function"==typeof e?new Rn(this):this.map(function(n){return gl(n,e,t)})}),Rn.prototype.reject=function(e){return this.filter(bo(Yr(e)))},Rn.prototype.slice=function(e,t){e=ta(e);var n=this;return n.__filtered__&&(e>0||t<0)?new Rn(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),void 0!==t&&(n=(t=ta(t))<0?n.dropRight(-t):n.take(t-e)),n)},Rn.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},Rn.prototype.toArray=function(){return this.take(4294967295)},al(Rn.prototype,function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),l=/^(?:head|last)$/.test(t),r=xn[l?"take"+("last"==t?"Right":""):t],i=l||/^find/.test(t);r&&(xn.prototype[t]=function(){var t=this.__wrapped__,o=l?[1]:arguments,a=t instanceof Rn,u=o[0],s=a||Ro(t),c=function(e){var t=r.apply(xn,ct([e],o));return l&&d?t[0]:t};s&&n&&"function"==typeof u&&1!=u.length&&(a=s=!1);var d=this.__chain__,p=!!this.__actions__.length,f=i&&!d,v=a&&!p;if(!i&&s){t=v?t:new Rn(this);var m=e.apply(t,o);return m.__actions__.push({func:Qi,args:[c],thisArg:void 0}),new wn(m,d)}return f&&v?e.apply(this,o):(m=this.thru(c),f?l?m.value()[0]:m.value():m)})}),lt(["pop","push","shift","sort","splice","unshift"],function(e){var t=ge[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",l=/^(?:pop|shift)$/.test(e);xn.prototype[e]=function(){var e=arguments;if(l&&!this.__chain__){var r=this.value();return t.apply(Ro(r)?r:[],e)}return this[n](function(n){return t.apply(Ro(n)?n:[],e)})}}),al(Rn.prototype,function(e,t){var n=xn[t];if(n){var l=n.name+"";Se.call(En,l)||(En[l]=[]),En[l].push({name:t,func:n})}}),En[Dr(void 0,2).name]=[{name:"wrapper",func:void 0}],Rn.prototype.clone=function(){var e=new Rn(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},Rn.prototype.reverse=function(){if(this.__filtered__){var e=new Rn(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},Rn.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,n=Ro(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,s=l?a:o-1,c=this.__iteratees__,d=c.length,p=0,f=on(u,this.__takeCount__);if(!n||!l&&r==u&&f==u)return er(e,this.__actions__);var v=[];e:for(;u--&&p<f;){for(var m=-1,h=e[s+=t];++m<d;){var g=c[m],E=g.type,_=(0,g.iteratee)(h);if(2==E)h=_;else if(!_){if(1==E)continue e;break e}}v[p++]=h}return v},xn.prototype.at=eo,xn.prototype.chain=function(){return Ji(this)},xn.prototype.commit=function(){return new wn(this.value(),this.__chain__)},xn.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__++]}},xn.prototype.plant=function(e){for(var t,n=this;n instanceof Nn;){var l=Ai(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},xn.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof Rn){var t=e;return this.__actions__.length&&(t=new Rn(this)),(t=t.reverse()).__actions__.push({func:Qi,args:[ji],thisArg:void 0}),new wn(t,this.__chain__)}return this.thru(ji)},xn.prototype.toJSON=xn.prototype.valueOf=xn.prototype.value=function(){return er(this.__wrapped__,this.__actions__)},xn.prototype.first=xn.prototype.head,vt&&(xn.prototype[vt]=function(){return this}),xn}();qe?((qe.exports=Gt)._=Gt,Ve._=Gt):ze._=Gt}).call(c)});const Fl=e=>{var t,r;let{t:i,formData:o,applicationData:a,docs:u,bpaActionsDetails:s}=e;const c=(null==a?void 0:a.status)||"",d=(null==s||null===(t=s.data)||void 0===t?void 0:t.nextActions)||[],p=Digit.ULBService.getStateId(),[f,v]=n.useState((null==o||null===(r=o.documents)||void 0===r?void 0:r.documents)||[]),[m,h]=n.useState(null),[g,E]=n.useState([]),[_,y]=n.useState(!0),[S,b]=n.useState(!1),[T,C]=n.useState(!1),{isLoading:A,data:D}=Digit.Hooks.obps.useMDMS(p,"BPA",["DocTypeMapping"]),{isLoading:x,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 s=[];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)}),s.push(e)}),sessionStorage.setItem("BPA_DOCUMENTS",JSON.stringify(s)),E(s)},[!A,!x]),n.useEffect(()=>{let e=0;g.map(t=>{let n=!1;f.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||!(f.length>0))},[f,S]),n.useEffect(()=>{C("DOC_VERIFICATION_INPROGRESS"===c&&(null==d?void 0:d.length)>0)},[a,s]),l.createElement("div",{style:{display:"flex",flexWrap:"wrap"}},null==g?void 0:g.map((e,t)=>l.createElement("div",{style:{padding:"20px"}},l.createElement(Bl,{key:t,index:t,document:e,t:i,error:m,setError:h,setDocuments:v,documents:f,setCheckRequiredFields:b,applicationStatus:c,actions:d,bpaTaxDocuments:g,checkEnablingDocs:T}))))};function Bl(e){var r,i;let{t:o,document:a,setDocuments:s,documents:c,index:d,bpaTaxDocuments:p,checkEnablingDocs:f}=e;const v=null==c?void 0:c.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,g]=n.useState(v?u({},v,{active:!0,code:null==v?void 0:v.documentType,i18nKey:null==v?void 0:v.documentType}):1===(null==a||null===(r=a.dropdownData)||void 0===r?void 0:r.length)?null==a?void 0:a.dropdownData[0]:{}),[E,_]=n.useState(null),[y,S]=n.useState(()=>(null==v?void 0:v.fileStoreId)||null),[b,T]=n.useState([]);return n.useEffect(()=>{null!=h&&h.code&&s(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==E?void 0:E.name)||"",id:c?null===(t=c.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(()=>{},[E]),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(Ml,{documents:null==a?void 0:a.uploadedDocuments,svgStyles:{width:"100px",height:"100px",viewBox:"0 0 25 25",minWidth:"100px"}}),f?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=>g(e),style:{width:"100%"}})),l.createElement(t.LabelFieldPair,{style:{width:"100%"}},l.createElement(t.CardLabel,{className:"card-label-smaller",style:{width:"100%"}}),l.createElement("div",{className:"field",style:{width:"100%"}},l.createElement(t.MultiUploadWrapper,{module:"BPA",tenantId:m,getFormState:e=>((e,t)=>{let n=Object.fromEntries(t),l=Object.values(n);var r;0!==Object.keys(n).length&&T(l),(r=l[l.length-1])&&_(r.file)})(0,e),t:o,allowedFileTypesRegex:/(.*?)(jpg|jpeg|png|image|pdf)$/i,allowedMaxSizeInMB:5,acceptFiles:"image/*, .pdf, .png, .jpeg, .jpg"})))):null)}function Ul(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,s,c,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===(s=e.questions)||void 0===s?void 0:s.length)&&(null==e||null===(c=e.questions)||void 0===c?void 0:c.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(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 jl(e){let{t:r,document:i,setNocDocuments:o,setError:a,nocDocuments:u}=e;const s=null==u?void 0:u.filter(e=>{var t;return null==e||null===(t=e.documentType)||void 0===t?void 0:t.includes(null==i?void 0:i.code)})[0],c=Digit.ULBService.getStateId(),[d,p]=n.useState(),[f,v]=n.useState(null),[m,h]=n.useState(()=>(null==s?void 0:s.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==f?void 0:f.name)||""}]})},[m]),n.useEffect(()=>{!function(){try{a(null);const e=function(){if(f){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(f.size>=5242880)a(r("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=f&&f.type&&!e.test(null==f?void 0:f.type))a(r("NOT_SUPPORTED_FILE_TYPE"));else{const e=Je(function(){return h(null),Promise.resolve(Digit.UploadServices.Filestorage("PT",f,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)}}()},[f]),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:c,getFormState:e=>(e=>{let t=Object.fromEntries(e),n=Object.values(t);var l;(l=n[n.length-1])&&v(l.file)})(e),t:r,allowedFileTypesRegex:/(.*?)(jpg|jpeg|png|image|pdf)$/i,allowedMaxSizeInMB:5,acceptFiles:"image/*, .pdf, .png, .jpeg, .jpg"}))))}const Hl=e=>{var r;let{t:i,noc:o,docs:a,isNoc:u,applicationData:s,NOCdata:c,bpaActionsDetails:d}=e;Digit.ULBService.getStateId();const p=Digit.ULBService.getStateId(),f=(null==s?void 0:s.status)||"",v=(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:g}=Digit.Hooks.obps.useMDMS(p,"common-masters",["DocumentType"]),[E,_]=n.useState([]),[y,S]=n.useState([]),[b,T]=n.useState(!1),[C,A]=Digit.Hooks.useSessionStorage(null==o?void 0:o.nocType,[]),[D,x]=n.useState(null),P=window.location.href.includes("/employee/");return n.useEffect(()=>{var e;_(null==g||null===(e=g["common-masters"])||void 0===e?void 0:e.DocumentType)},[g]),n.useEffect(()=>{var e,t,n;let l,r=[];var i,a,c,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===(c=h.BPA)||void 0===c||null===(d=c.DocTypeMapping)||void 0===d?void 0:d.filter(e=>{var t,n;return e.WFState==(null==s?void 0:s.status)&&e.RiskType==(null==s?void 0:s.riskType)&&e.ServiceType==(null==s||null===(t=s.additionalDetails)||void 0===t?void 0:t.serviceType)&&e.applicationType==(null==s||null===(n=s.additionalDetails)||void 0===n?void 0:n.applicationType)}),null!==(e=l)&&void 0!==e&&null!==(t=e[0])&&void 0!==t&&null!==(n=t.docTypes)&&void 0!==n&&n[0]&&(l[0].docTypes[0].nocType=l[0].nocType,l[0].docTypes[0].additionalDetails={submissionDetails:null==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==E||E.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,E]),n.useEffect(()=>{T("NOC_VERIFICATION_INPROGRESS"===f&&(null==v?void 0:v.length)>0)},[s,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%"}}),c&&c.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(Ml,{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(jl,{key:t,document:e,t:i,error:D,setError:x,setNocDocuments:A,nocDocuments:C,checkEnablingDocs:b}))))},Wl=e=>{let{permissions:r,t:i}=e;const[o,a,s]=Digit.Hooks.useSessionStorage("OBPS_APPROVAL_CHECKS",null==r?void 0:r.map(e=>({label:e,checked:!1}))),[c,d,p]=Digit.Hooks.useSessionStorage("OBPS_NEW_APPROVALS",[]);n.useEffect(()=>()=>{Digit.SessionStorage.del("OBPS_NEW_APPROVALS"),Digit.SessionStorage.del("OBPS_APPROVAL_CHECKS")},[]);const f=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:f?"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==c?void 0:c.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==c?void 0:c.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:f?"96%":"830px",width:f?"96%":"830px"},style:f?{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:f?"5%":"35%"}}))),style:{},onClick:e=>(e=>{const t=[...c];t.splice(e,1),d([...t])})(n)}))),l.createElement(t.LinkButton,{style:{color:"#a82227",maxWidth:f?"fit-content":"10%",marginRight:"3%"},label:i("BPA_ADD_MORE"),onClick:()=>{d([...c,{label:""}])}}))};function zl(e){let{documents:i,svgStyles:o={},isSendBackFlow:a=!1}=e;const{t:u}=r.useTranslation(),[s,c]=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:[]]}),c(null===(e=t)||void 0===e?void 0:e.map(e=>null==e?void 0:e.fileStoreId))},[i]),n.useEffect(()=>{var e;null!=s&&s.length&&"BillAmend"===(null==i||null===(e=i[0])||void 0===e?void 0:e.BS)?Digit.UploadServices.Filefetch(s,Digit.ULBService.getCurrentTenantId()).then(e=>{p(null==e?void 0:e.data)}):null!=s&&s.length&&Digit.UploadServices.Filefetch(s,Digit.ULBService.getStateId()).then(e=>{p(null==e?void 0:e.data)})},[s]);const f=window.location.href.includes("employee/tl")||window.location.href.includes("/obps")||window.location.href.includes("employee/ws"),v=window.location.href.includes("stakeholder");return l.createElement("div",{style:{marginTop:"19px"}},!v&&(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:f?{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:f?{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")))))})),v&&(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 Vl(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 Gl(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 s={marginTop:"19px"},c={position:"relative",padding:"8px"},d={justifyContent:"space-between",fontSize:"16px",lineHeight:"19px",color:"#0B0C0C"};return Number(a)>1?s={marginTop:"19px",background:"#FAFAFA",border:"1px solid #D6D5D4",borderRadius:"4px",padding:"8px",lineHeight:"19px",maxWidth:"600px",minWidth:"280px"}:Number(a)>1||(s={marginTop:"19px",lineHeight:"19px",maxWidth:"600px",minWidth:"280px"},c={position:"relative",marginTop:"19px"}),window.location.href.includes("obps")&&(s=u({},s,{maxWidth:"950px"}),s=u({},s,{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:s,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:c},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 Kl=e=>{var i,o,a,u,s,c,d,p,f,v,m,h,g,E,_,y,S,b,T,C,A,D,x;let{scrutinyDetails:P,paymentsList:N=[],additionalDetails:w,applicationData:R}=e;const I=(window.location.href.includes("editApplication")||"FIELDINSPECTION_INPROGRESS"==(null==R?void 0:R.status))&&window.location.href.includes("bpa"),[O,L]=n.useState(),[k,M]=n.useState(),[F,B]=n.useState(),U=Digit.ULBService.getStateId(),[j,H]=n.useState(),[W,z]=n.useState(),[V,q]=n.useState([]),[G,K]=n.useState(),[Y,$]=n.useState(""),[X,Z]=n.useState(null),[J,Q]=n.useState({}),ee={buttonStyle:{display:"flex",justifyContent:"flex-start",color:"#a82227"},headerStyle:{marginTop:"10px",fontSize:"16px",fontWeight:"700",lineHeight:"24px",color:" rgba(11, 12, 12, var(--text-opacity))"}},[te,ne]=n.useState(!1),[le,re]=n.useState(!1);n.useEffect(()=>{!function(){try{Z(null);const e=function(){if(G&&null!=G&&G.type){const e=function(e,t,n){if(null!==(e=".pdf".split(","))&&void 0!==e&&e.includes("."+(null==G||null===(t=G.type)||void 0===t||null===(n=t.split("/"))||void 0===n?void 0:n.pop()))){const e=function(){if(G.size>=2e6)Z(ie("PT_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=Je(function(){return Promise.resolve(Digit.UploadServices.Filestorage("property-upload",G,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?q([...V,{fileStoreId:null==e||null===(l=e.data)||void 0===l||null===(r=l.files[0])||void 0===r?void 0:r.fileStoreId,time:new Date}]):Z(ie("PT_FILE_UPLOAD_ERROR"))})},function(){});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}else Z(ie("PT_UPLOAD_FORMAT_NOT_SUPPORTED"))}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[G]),n.useEffect(()=>{sessionStorage.setItem("uploadedFileLess",JSON.stringify(V))},[V]),n.useEffect(()=>{var e,t,n,l,r,i,o;if(null!=w&&null!==(e=w.lessAdjustmentFeeFiles)&&void 0!==e&&e.length){const e=null==w?void 0:w.lessAdjustmentFeeFiles.map((e,t)=>{var n,l,r;return t===(null==w||null===(n=w.lessAdjustmentFeeFiles)||void 0===n?void 0:n.length)-1?null==w||null===(l=w.lessAdjustmentFeeFiles[(null==w||null===(r=w.lessAdjustmentFeeFiles)||void 0===r?void 0:r.length)-1])||void 0===l?void 0:l.fileStoreId:null});Digit.UploadServices.Filefetch(e,U).then(e=>Q(null==e?void 0:e.data))}L(null==w||null===(t=w.selfCertificationCharges)||void 0===t?void 0:t.BPA_DEVELOPMENT_CHARGES),sessionStorage.setItem("development",null==w||null===(n=w.selfCertificationCharges)||void 0===n?void 0:n.BPA_DEVELOPMENT_CHARGES),M(null==w||null===(l=w.selfCertificationCharges)||void 0===l?void 0:l.BPA_OTHER_CHARGES),sessionStorage.setItem("otherCharges",null==w||null===(r=w.selfCertificationCharges)||void 0===r?void 0:r.BPA_OTHER_CHARGES),B(null==w||null===(i=w.selfCertificationCharges)||void 0===i?void 0:i.BPA_LESS_ADJUSMENT_PLOT),sessionStorage.setItem("lessAdjusment",null==w||null===(o=w.selfCertificationCharges)||void 0===o?void 0:o.BPA_LESS_ADJUSMENT_PLOT),H(null==w?void 0:w.otherFeesDiscription),sessionStorage.setItem("otherChargesDisc",null==w?void 0:w.otherFeesDiscription),q(null==w?void 0:w.lessAdjustmentFeeFiles)},[w]);const{t:ie}=r.useTranslation(),oe=e=>null!=e&&e.value&&null!=e&&e.isTransLate?l.createElement("span",{style:{color:"#00703C"}},ie(null==e?void 0:e.value)):null!=e&&e.value&&null!=e&&e.isTransLate?ie(null==e?void 0:e.value):null!=e&&e.value?null==e?void 0:e.value:void ie("NA");return l.createElement(n.Fragment,null,!(null!=P&&P.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==P||null===(i=P.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:""+ie(""+e.title),text:null!=e&&e.value?oe(e)+" "+ie(null==e?void 0:e.isUnit):ie("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:""+ie(""+e.title),text:oe(e),labelStyle:null!=e&&e.isHeader?{fontSize:"20px"}:{}}):l.createElement(t.CardSubHeader,{style:{fontSize:"20px",paddingBottom:"10px",margin:"0px"}},ie(null==e?void 0:e.title)):l.createElement(t.CardSubHeader,{style:{fontSize:"20px",paddingBottom:"10px"}},ie(null==e?void 0:e.title))),null==P||null===(o=P.permit)||void 0===o?void 0:o.map((e,n)=>l.createElement(t.CardLabel,{style:{fontWeight:"400"}},null==e?void 0:e.title))),window.location.href.includes("employee")&&"BPA_APPL_FEES_DETAILS"==(null==P||null===(a=P.values[0])||void 0===a?void 0:a.title)&&l.createElement("div",null,!le&&l.createElement("div",{style:ee.buttonStyle},l.createElement("button",{type:"button",onClick:()=>{re(!0)}},ie("SHOW_P1_FEES_DETAILS"))),le&&l.createElement("div",{style:ee.buttonStyle},l.createElement("button",{type:"button",onClick:()=>{re(!1)}},ie("HIDE_P1_FEES_DETAILS"))),le&&l.createElement("div",null,l.createElement(t.CardSubHeader,null,ie("BPA_P1_SUMMARY_FEE_EST")),l.createElement(t.Row,{className:"border-none",label:ie("BUILDING_APPLICATION_FEES"),text:"₹ "+Math.round(10.7639*(null==w?void 0:w.builtUpArea)*2.5)}),l.createElement(t.Row,{className:"border-none",label:ie("BOUNDARY_WALL_FEES"),text:"₹ "+2.5*(null==w?void 0:w.boundaryWallLength)}),l.createElement(t.Row,{className:"border-none"}))),window.location.href.includes("employee")&&"BPA_APPL_FEES_DETAILS"==(null==P||null===(u=P.values[0])||void 0===u?void 0:u.title)&&l.createElement("div",null,!te&&l.createElement("div",{style:ee.buttonStyle},l.createElement("button",{type:"button",onClick:()=>{ne(!0)}},ie("SHOW_P2_FEES_DETAILS"))),te&&l.createElement("div",{style:ee.buttonStyle},l.createElement("button",{type:"button",onClick:()=>{ne(!1)}},ie("HIDE_P2_FEES_DETAILS"))),te&&l.createElement("div",null,l.createElement(t.CardSubHeader,null,ie("BPA_P2_SUMMARY_FEE_EST")),l.createElement(t.Row,{className:"border-none",label:ie("BPA_COMMON_MALBA_AMT"),text:"₹ "+(null==w||null===(s=w.selfCertificationCharges)||void 0===s?void 0:s.BPA_MALBA_CHARGES)}),l.createElement(t.Row,{className:"border-none",label:ie("BPA_COMMON_LABOUR_AMT"),text:"₹ "+(null==w||null===(c=w.selfCertificationCharges)||void 0===c?void 0:c.BPA_LABOUR_CESS)}),l.createElement(t.Row,{className:"border-none",label:ie("BPA_COMMON_WATER_AMT"),text:"₹ "+(null==w||null===(d=w.selfCertificationCharges)||void 0===d?void 0:d.BPA_WATER_CHARGES)}),l.createElement(t.Row,{className:"border-none",label:ie("BPA_COMMON_GAUSHALA_AMT"),text:"₹ "+(null==w||null===(p=w.selfCertificationCharges)||void 0===p?void 0:p.BPA_GAUSHALA_CHARGES_CESS)}),l.createElement(t.CardSubHeader,null,ie("BPA_P2_SUMMARY_FEE_EST_MANUAL")),l.createElement(t.CardLabel,null,ie("BPA_COMMON_DEVELOPMENT_AMT")),l.createElement(t.TextInput,{t:ie,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"development",defaultValue:(null==w||null===(f=w.selfCertificationCharges)||void 0===f?void 0:f.BPA_DEVELOPMENT_CHARGES)||0,value:O,disabled:!I,onChange:e=>{!function(e){/^\d{0,9}$/.test(e)&&(L(e),sessionStorage.setItem("development",e))}(e.target.value)},required:!0,pattern:"^[0-9]*$",type:"text"}),l.createElement(t.CardLabel,null,ie("BPA_COMMON_OTHER_AMT")),l.createElement(t.TextInput,{t:ie,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"otherCharges",defaultValue:(null==w||null===(v=w.selfCertificationCharges)||void 0===v?void 0:v.BPA_OTHER_CHARGES)||0,value:k,disabled:!I,onChange:e=>{!function(e){/^[0-9]*$/.test(e)&&(M(e),sessionStorage.setItem("otherCharges",e))}(e.target.value)},required:!0,pattern:"^[0-9]*$",type:"text"}),parseInt(k)>0?l.createElement("div",null,l.createElement(t.CardLabel,null,ie("BPA_COMMON_OTHER_AMT_DISCRIPTION")),l.createElement(t.TextArea,{t:ie,type:"text",name:"otherChargesDiscription",defaultValue:null==w||null===(m=w.selfCertificationCharges)||void 0===m?void 0:m.BPA_COMMON_OTHER_AMT_DISCRIPTION,value:j,disabled:!I,onChange:e=>{!function(e){H(e),sessionStorage.setItem("otherChargesDisc",e)}(e.target.value)},required:!0})):null,l.createElement(t.CardLabel,null,ie("BPA_COMMON_LESS_AMT")),l.createElement(t.TextInput,{t:ie,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"lessAdjusment",defaultValue:(null==w||null===(h=w.selfCertificationCharges)||void 0===h?void 0:h.BPA_LESS_ADJUSMENT_PLOT)||"",value:F,disabled:!I,onChange:e=>{!function(e){var t,n,l,r;/^[0-9]*$/.test(e)&&(parseFloat(e)>(parseFloat(O)?parseFloat(O):0)+parseFloat(k?parseFloat(k):0)+parseFloat(null==w||null===(t=w.selfCertificationCharges)||void 0===t?void 0:t.BPA_MALBA_CHARGES)+parseFloat(null==w||null===(n=w.selfCertificationCharges)||void 0===n?void 0:n.BPA_LABOUR_CESS)+parseFloat(null==w||null===(l=w.selfCertificationCharges)||void 0===l?void 0:l.BPA_WATER_CHARGES)+parseFloat(null==w||null===(r=w.selfCertificationCharges)||void 0===r?void 0:r.BPA_GAUSHALA_CHARGES_CESS)?alert("Less adjustment fees cannot be grater than Total of other P2 fees"):(B(e),sessionStorage.setItem("lessAdjusment",e)))}(e.target.value)},required:!0,pattern:"^[0-9]*$",type:"text"}),parseInt(F)>0&&I?l.createElement("div",null,l.createElement(t.CardLabel,null,ie("BPA_COMMON_LESS_AMT_FILE")),l.createElement(t.UploadFile,{id:"noc-doc",style:{marginBottom:"200px"},onUpload:function(e){z(e.target.files[0]),K(e.target.files[0])},disabled:!I,onDelete:()=>{z(null),K("")},message:W?"1 "+ie("FILEUPLOADED"):ie("ES_NO_FILE_SELECTED_LABEL"),error:X,uploadMessage:Y})):null,(null==J||null===(g=J.fileStoreIds)||void 0===g?void 0:g.length)&&parseInt(null==w||null===(E=w.selfCertificationCharges)||void 0===E?void 0:E.BPA_LESS_ADJUSMENT_PLOT)>0&&l.createElement(t.CardLabel,{style:{marginTop:"15px"}},ie("BPA_COMMON_LESS_AMT_PREVIOUS_FILE")),(null==J||null===(_=J.fileStoreIds)||void 0===_?void 0:_.length)&&parseInt(null==w||null===(y=w.selfCertificationCharges)||void 0===y?void 0:y.BPA_LESS_ADJUSMENT_PLOT)>0&&l.createElement("a",{target:"_blank",href:null==J||null===(S=J.fileStoreIds[(null==J||null===(b=J.fileStoreIds)||void 0===b?void 0:b.length)-1])||void 0===S?void 0:S.url},l.createElement(t.PDFSvg,null)),l.createElement(t.Row,{className:"border-none"}),l.createElement(t.Row,{className:"border-none",label:ie("BPA_P2_TOTAL_FEE"),text:"₹ "+((parseFloat(O)?parseFloat(O):0)+parseFloat(k?parseFloat(k):0)+parseFloat(null==w||null===(T=w.selfCertificationCharges)||void 0===T?void 0:T.BPA_MALBA_CHARGES)+parseFloat(null==w||null===(C=w.selfCertificationCharges)||void 0===C?void 0:C.BPA_LABOUR_CESS)+parseFloat(null==w||null===(A=w.selfCertificationCharges)||void 0===A?void 0:A.BPA_WATER_CHARGES)+parseFloat(null==w||null===(D=w.selfCertificationCharges)||void 0===D?void 0:D.BPA_GAUSHALA_CHARGES_CESS)-(parseFloat(F)?parseFloat(F):0))}))),l.createElement("div",null,null==P||null===(x=P.scruntinyDetails)||void 0===x?void 0:x.map((e,r)=>l.createElement(n.Fragment,null,l.createElement(t.Row,{className:"border-none",label:""+ie(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"}},ie(null==e?void 0:e.text))))))))},Yl=e=>{var i,o,a,u,s;let{edcrDetails:c,applicationData:d}=e;const{t:p}=r.useTranslation(),f=window.Digit.Utils.browser.isMobile(),v=[{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"}],m=e=>{const t=e;return(e,n,l)=>e[t]},h=n.useMemo(()=>v.map(e=>({Header:p(""+e.name),accessor:m(e.id),id:e.id})));function g(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,s;n.push({Floor:p("BPA_FLOOR_NAME_"+e.number),Level:e.number,Occupancy:p(""+(null===(t=e.occupancies)||void 0===t||null===(l=t[0])||void 0===l?void 0:l.type)),BuildupArea:null===(r=e.occupancies)||void 0===r||null===(i=r[0])||void 0===i?void 0:i.builtUpArea,FloorArea:(null===(o=e.occupancies)||void 0===o||null===(a=o[0])||void 0===a?void 0:a.floorArea)||0,CarpetArea:(null===(u=e.occupancies)||void 0===u||null===(s=u[0])||void 0===s?void 0:s.CarpetArea)||0,key:p("BPA_FLOOR_NAME_"+e.number)})}),n}function E(e){var t;let n=null==d||null===(t=d.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?""+p("BPA_SUBOCCUPANCYTYPE_"+function(e,t,n){if(void 0===e&&(e=""),void 0===t&&(t=""),void 0===n&&(n=""),""==t)return e;for(;e.includes(t);)e=e.replace(t,n);return e}(null==e?void 0:e.toUpperCase(),"-","_")):"NA").join(", "))}return l||"NA"}return l.createElement(n.Fragment,null,l.createElement("div",{style:{background:"#FAFAFA",border:"1px solid #D6D5D4",padding:"8px",borderRadius:"4px",maxWidth:"950px",minWidth:"280px"}},l.createElement(t.StatusTable,null,null==c||null===(i=c.values)||void 0===i?void 0:i.map((e,n)=>null!=e&&e.isHeader?l.createElement(t.CardSubHeader,{style:{fontSize:"20px",paddingBottom:"10px"}},p(null==e?void 0:e.title)):l.createElement(t.Row,{className:"border-none",labelStyle:{width:"100%",fontSize:"20px"},key:""+e.title,label:""+p(""+e.title),text:null!=e&&e.value?null==e?void 0:e.value:""}))),null==c||null===(o=c.subOccupancyTableDetails)||void 0===o||null===(a=o[0])||void 0===a||null===(u=a.value)||void 0===u||null===(s=u.planDetail)||void 0===s?void 0:s.blocks.map((e,n)=>{var r,i,o,a,u;return l.createElement("div",{key:n,style:(null==c||null===(r=c.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"}},p("BPA_BLOCK_SUBHEADER")," ",n+1),l.createElement(t.StatusTable,null,l.createElement(t.Row,{className:"border-none",textStyle:{wordBreak:"break-word"},label:""+p("BPA_SUB_OCCUPANCY_LABEL"),text:E(n)})),l.createElement("div",{style:window.location.href.includes("citizen")||f?{overflow:"scroll"}:{maxWidth:"950px",maxHeight:"280px"}},l.createElement(t.Table,{className:"customTable table-fixed-first-column table-border-style",t:p,disableSort:!1,autoSort:!0,manualPagination:!1,isPaginationRequired:!1,initSortId:"S N ",data:g(e),columns:h,getCellProps:e=>({style:{}})})))})))},$l=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))},Xl=e=>{var i,o,a;let{data:u,OpenImage:s,privacy:c={}}=e;const[d,p]=n.useState(!1),{t:f}=r.useTranslation();return l.createElement("div",null,u.date&&l.createElement("p",null,u.date),l.createElement("p",null,u.name),u.mobileNumber&&l.createElement("span",{style:{display:"inline-flex",width:"fit-content",marginLeft:"10px"}},l.createElement(t.TelePhone,{mobile:u.mobileNumber,privacy:c}),l.createElement("p",null," ")),u.source&&l.createElement("p",null,f("ES_APPLICATION_DETAILS_APPLICATION_CHANNEL_"+u.source.toUpperCase())),u.comment&&l.createElement($l,{otherComment:null==u?void 0:u.otherComment,headComment:null==u?void 0:u.comment}),null!=u&&u.wfComment?l.createElement("div",null,null==u||null===(i=u.wfComment)||void 0===i?void 0:i.map(e=>l.createElement("div",{className:"TLComments"},l.createElement("h3",null,f("WF_COMMON_COMMENTS")),!d&&l.createElement("div",null,l.createElement("p",{style:{overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitLineClamp:1,WebkitBoxOrient:"vertical"}},e),e.length>36?l.createElement("button",{type:"button",onClick:()=>{p(!0)},style:{color:"#800000"}},f("View More")):null),d&&l.createElement("div",null,l.createElement("p",{style:{overflow:"visible"}},e),l.createElement("button",{type:"button",onClick:()=>{p(!1)},style:{color:"#800000"}},f("View Less")))))):null,(null==u||null===(o=u.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,f("CS_COMMON_ATTACHMENTS")),l.createElement(t.DisplayPhotos,{srcs:null==u?void 0:u.thumbnailsToShow.thumbs,onClick:(e,t)=>{s(e,t,null==u?void 0:u.thumbnailsToShow)}})):null)};function Zl(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 Jl(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 Ql=e=>{var i,o,a,u,s;let{wsAdditionalDetails:c}=e;const{t:d}=r.useTranslation();let p=(f=location.search)?(/^[?#]/.test(f)?f.slice(1):f).split("&").reduce((e,t)=>{let[n,l]=t.split("=");return e[n]=l?decodeURIComponent(l.replace(/\+/g," ")):"",e},{}):{};var f;const v=null==p?void 0:p.mode;var{connectionDetails:m,plumberDetails:h,roadCuttingDetails:g,roadCuttingAddlDetails:E,activationDetails:_}=(null==c?void 0:c.additionalDetails)||{connectionDetails:[],plumberDetails:[],roadCuttingAddlDetails:[]};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"}},d("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:""+d(""+e.title),text:null!=e&&e.oldValue?null==e?void 0:e.oldValue:null!=e&&e.value?null==e?void 0:e.value:""})))))),(null==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"}},d("WS_COMMON_PLUMBER_DETAILS")),l.createElement("div",null,l.createElement("div",{className:"plumber-details-new-value-wrapper"},null==h?void 0:h.map((e,n)=>l.createElement(t.Row,{className:"border-none",key:""+e.title,label:""+d(""+e.title),text:null!=e&&e.oldValue?null==e?void 0:e.oldValue:null!=e&&e.value?null==e?void 0:e.value:"",privacy:e.privacy}))))),(null==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"}},d("WS_COMMON_ROAD_CUTTING_DETAILS")),l.createElement("div",null,l.createElement("div",{className:"road-cutting-details-new-value-wrapper"},null==g?void 0:g.map(e=>{var n;return l.createElement("div",{style:(null==g?void 0:g.length)>1?{border:"1px solid #D6D5D4",background:"#FAFAFA",borderRadius:"4px",padding:"10px 10px 0px 10px",margin:"5px 0px"}:{}},null==e||null===(n=e.values)||void 0===n?void 0:n.map(e=>l.createElement(t.Row,{className:"border-none",key:""+e.title,label:""+d(""+e.title),text:null!=e&&e.oldValue?null==e?void 0:e.oldValue:null!=e&&e.value?null==e?void 0:e.value:""})))}))),(null==c||null===(u=c.additionalDetails)||void 0===u?void 0:u.roadCuttingAddlDetails)&&l.createElement("div",null,l.createElement("br",null),l.createElement("div",{className:"road-cutting-addl-details-new-value-wrapper"},null==E?void 0:E.map((e,n)=>l.createElement("div",null,l.createElement(t.Row,{className:"border-none",key:""+e.title,label:""+d(""+e.title),text:null!=e&&e.oldValue?null==e?void 0:e.oldValue:null!=e&&e.value?null==e?void 0:e.value:""})))))),(null==c||null===(s=c.additionalDetails)||void 0===s?void 0:s.activationDetails)&&l.createElement(t.StatusTable,null,l.createElement(t.CardSubHeader,{style:{fontSize:"24px",marginBottom:"16px",marginTop:"32px"}},d("WS_ACTIVATION_DETAILS")),l.createElement("div",null,l.createElement("div",{className:"plumber-details-new-value-wrapper"},null==_?void 0:_.map((e,n)=>l.createElement(t.Row,{className:"border-none",key:""+e.title,label:""+d(""+e.title),text:null!=e&&e.oldValue?null==e?void 0:e.oldValue:null!=e&&e.value?null==e?void 0:e.value:""})))))))},er=[{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"}],tr=[{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"}],nr=e=>{var i,o,a,s;let{wsAdditionalDetails:c}=e;const{t:d}=r.useTranslation(),[p,f,v]=Digit.Hooks.useSessionStorage("ADHOC_ADD_REBATE_DATA",{}),[m,h,g]=Digit.Hooks.useSessionStorage("ADHOC_BILL_ADD_REBATE_DATA",{}),E=!(null==c||null===(i=c.additionalDetails)||void 0===i||!i.isPaid),[y,S]=n.useState(!1),[b,T]=n.useState(p||{}),[C,A]=n.useState(null),[D,x]=n.useState(c.additionalDetails.data?c.additionalDetails.data:{}),[P,N]=n.useState(c.additionalDetails.values?c.additionalDetails.values:[]),w=Digit.ULBService.getStateId();Digit.Hooks.ws.useMDMS(w,"BillingService",["TaxHeadMaster"]),n.useEffect(()=>{var e,t,n;const r=u({},null==c||null===(e=c.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,s,d,v,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===(s=a[0])||void 0===s?void 0:s.charge)},{title:"WS_TAX_HEADER",value:l.createElement("span",null,"₹",null==p||null===(d=p.billDetails)||void 0===d||null===(v=d[0])||void 0===v?void 0:v.taxAmount)}];N(e),x(null==p||null===(m=p.billDetails)||void 0===m?void 0:m[0])}else f(r),T(r)},[]);let R={};const I=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)),k=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(E?"WS_COMMON_PAID_LABEL":"WS_COMMON_NOT_PAID"),textStyle:E?{color:"#00703C"}:{color:"#D4351C"}}))),null!=c&&null!==(o=c.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(I,{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==c||null===(l=c.additionalDetails)||void 0===l||null===(r=l.data)||void 0===r?void 0:r.totalAmount))A({isError:!1,isWarning:!0,key:"error",message:d("ERR_WS_REBATE_GREATER_THAN_AMOUNT")});else{var i,o,a,s,p,v,m,g,E,y;const e=null==c||null===(i=c.additionalDetails)||void 0===i||null===(o=i.appDetails)||void 0===o?void 0:o.applicationNo,t=null==c||null===(a=c.additionalDetails)||void 0===a||null===(s=a.appDetails)||void 0===s?void 0:s.tenantId,n=u({},null==c||null===(p=c.additionalDetails)||void 0===p||null===(v=p.appDetails)||void 0===v?void 0:v.additionalDetails,b);c.additionalDetails.appDetails.additionalDetails=n;const l={CalculationCriteria:"WATER"==(null==c||null===(m=c.additionalDetails)||void 0===m||null===(g=m.appDetails)||void 0===g?void 0:g.service)?[{applicationNo:e,tenantId:t,waterConnection:c.additionalDetails.appDetails}]:[{applicationNo:e,tenantId:t,sewerageConnection:c.additionalDetails.appDetails}],isconnectionCalculation:!1};let r="WATER"==(null==c||null===(E=c.additionalDetails)||void 0===E||null===(y=E.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,s,c,d,p,v,m,g,E;(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===(g=m[0])||void 0===g||null===(E=g.taxHeadEstimates)||void 0===E||E.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===(s=e.Calculation)||void 0===s||null===(c=s[0])||void 0===c?void 0:c.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(gl(e.Calculation[0])),x(null==e||null===(v=e.Calculation)||void 0===v?void 0:v[0]),N(y),b.billDetails=null==e?void 0:e.Calculation,f(b),S(!1)}).catch(e=>{var t,n,l,r,i,o;A({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 A({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:er,optionKey:"title",select:e=>k("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=>k("adhocPenaltyComment",!1,e)},R={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=>k("adhocPenalty",!1,e)},R={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:tr,optionKey:"title",select:e=>k("adhocRebateReason",!0,e),selected:(null==b?void 0:b.adhocRebateReason_data)||"",name:"adhocRebateReason_data",isPropertyAssess:!0,t:d})),"PT_OTHERS"===(null==b||null===(s=b.adhocRebateReason_data)||void 0===s?void 0:s.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=>k("adhocRebateComment",!1,e)},R={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=>k("adhocRebate",!1,e)},R={isRequired:!0,pattern:"^[1-9]+[0-9]*$",title:d("ERR_DEFAULT_INPUT_FIELD_MSG")})))))," "),C&&l.createElement(t.Toast,{style:{zIndex:"10000"},warning:null==C?void 0:C.isWarning,error:null==C||!C.isWarning,label:d(null==C?void 0:C.message),onClose:()=>{A(!1)},isDleteBtn:!0})))},lr=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"})))},rr=e=>{let{t:n,userType:r=!1,infoBannerLabel:i="",infoClickLable:o="",infoClickInfoLabel:a="",infoClickInfoLabel1:u=""}=e;r=r||Digit.SessionStorage.get("userType");const s=window.Digit.Utils.browser.isMobile();return l.createElement(l.Fragment,null,l.createElement("div",{style:s?{}:{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(lr,{style:{display:"inline",marginBottom:"5px"}})," "+n(a),l.createElement("div",null," "+n(u)))))},ir=e=>{var i,o,a,u,s,c,d;let{wsAdditionalDetails:p}=e;const{t:f}=r.useTranslation(),[v,m]=n.useState(!1),[h,g]=n.useState({}),E=e=>l.createElement("h1",{className:"heading-m"},e.label),_=()=>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(_,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),g(t),m(!0)})(),style:{marginTop:"12px"}},l.createElement("span",{style:{cursor:"pointer",color:"#a82227"}},f("WS_PAYMENT_VIEW_BREAKUP"))):null,v&&l.createElement(t.Modal,{headerBarMain:l.createElement(E,{label:f("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"}},f("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:""+f(""+(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:""+f("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"}},f("WS_SERVICE_FEE_HEADER")),null==h||null===(u=h.billSlabData)||void 0===u||null===(s=u.CHARGES)||void 0===s?void 0:s.map(e=>l.createElement(t.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:""+(null==e?void 0:e.taxHeadCode),label:""+f(""+(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:""+f("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===(c=h.billSlabData)||void 0===c||null===(d=c.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:""+f(""+(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:""+f("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"}})))))},or={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:{}},ar=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:or.root},l.createElement("table",{className:"table-fixed-column-common-pay",style:or.table},l.createElement("thead",null,l.createElement("tr",null,l.createElement("th",{style:u({},or.cell,or.cellLeft,or.cellHeader)},a("CS_BILL_PERIOD")),n.map((e,t)=>l.createElement("th",{style:u({},or.cell,n.length==t+1?or.cellRight:{},or.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({},or.cell,or.cellLeft),component:"th",scope:"row"},Object.keys(i)[t]),n.map((t,r)=>l.createElement("td",{style:u({},or.cell,{textAlign:"left"},n.length==r+1?or.cellRight:{},{whiteSpace:"pre"}),key:r,numeric:!0},r>1&&"₹",e[t]&&e[t].value||"0")))),l.createElement("tr",null,l.createElement("td",{style:u({},or.cell,or.cellLeft)}),n.map((e,t)=>t==n.length-1?l.createElement("td",{style:u({},or.cell,or.cellRight,{textAlign:"left",fontWeight:"700",whiteSpace:"pre"}),key:t,numeric:!0},o):t==n.length-2?l.createElement("td",{style:u({},or.cell,{textAlign:"left"}),key:t,numeric:!0},a("COMMON_ARREARS_TOTAL")):l.createElement("td",{style:or.cell,key:t,numeric:!0})))))))},ur={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))"}},sr=e=>{var t,i,o;let{bill:a={}}=e;const{t:u}=r.useTranslation();let s={},c=(null==a||null===(t=a.billDetails)||void 0===t?void 0:t.sort((e,t)=>t.fromPeriod-e.fromPeriod))||[];c=[...c];const d=(null===(i=c)||void 0===i?void 0:i.reduce((e,t,n)=>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));c.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);s[((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 f={};!s||Object.keys(s).map((e,t)=>{Object.keys(s[e]).map(t=>{f[t]=s[e]&&s[e][t]&&s[e][t].order||0})});let v=[];v=Object.keys(f),v.sort((e,t)=>f[e]-f[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:ur.headerStyle},u("CS_ARREARS_DETAILS")),m&&l.createElement(ar,{headers:[...v],values:s,arrears:p}),!m&&l.createElement("div",{style:ur.buttonStyle},l.createElement("button",{type:"button",onClick:()=>{h(!0)}},u("CS_SHOW_CARD"))),m&&l.createElement("div",{style:ur.buttonStyle},l.createElement("button",{type:"button",onClick:()=>{h(!1)}},u("CS_HIDE_CARD"))))};function cr(e){var o,a,u,s,c,d,p,f,v,m,h,g,E,y;let{applicationDetails:S,demandData:b,workflowDetails:T,isDataLoading:C,applicationData:A,totalDemandTax:D,timelineStatusPrefix:x,showTimeLine:P=!0,statusAttribute:N="status",paymentsList:w,oldValue:R,isInfoLabel:I=!1}=e;const{t:O}=r.useTranslation();let L=window.location.href.includes("editApplication")&&window.location.href.includes("bpa");function k(e,t,n){var l;window.open(null==n||null===(l=n.fullImage)||void 0===l?void 0:l[0],"_blank")}console.log("appl",S);const[M,F]=n.useState({}),[B,U]=n.useState({loading:!1,loaded:!1,canLoad:!1});"ACTIVE"!=(null==A?void 0:A.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==A?void 0:A.tenantId)||tenantId,null==A?void 0:A.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==A||null===(r=A.auditDetails)||void 0===r?void 0:r.createdTime),source:(null==A?void 0:A.channel)||""};return l.createElement(Xl,{data:e})}if(window.location.href.includes("/obps/")||window.location.href.includes("/noc/")||window.location.href.includes("/ws/")){var i,o,a,u,s,c,d,p,f,v,m,h,g,E,y,b,T,C;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==S?void 0:S.tenantId,businessIds:null==S?void 0:S.applicationNo,history:!0},jsonPath:"ProcessInstances[0].assignes[0].mobileNumber",isArray:!1,d:e=>{let n="";return n="+91 "+_.get(e,"ProcessInstances["+t+"].assignes[0].mobileNumber"),n}}},D=n[t-1],x={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===(s=u[0])||void 0===s?void 0:s.name,mobileNumber:(null==A||null===(c=A.processInstance)||void 0===c||null===(d=c.assignes)||void 0===d||null===(p=d[0])||void 0===p?void 0:p.uuid)===(null==e||null===(f=e.assignes)||void 0===f||null===(v=f[0])||void 0===v?void 0:v.uuid)&&null!=A&&null!==(m=A.processInstance)&&void 0!==m&&null!==(h=m.assignes)&&void 0!==h&&null!==(g=h[0])&&void 0!==g&&g.mobileNumber?null==A||null===(E=A.processInstance)||void 0===E||null===(y=E.assignes)||void 0===y||null===(b=y[0])||void 0===b?void 0:b.mobileNumber:null==e||null===(T=e.assignes)||void 0===T||null===(C=T[0])||void 0===C?void 0:C.mobileNumber,comment:O(null==e?void 0:e.comment),wfComment:D?D.wfComment:[],thumbnailsToShow:null==e?void 0:e.thumbnailsToShow};return l.createElement(Xl,{data:x,OpenImage:k,privacy:r})}{var D,x,P,N,w;const t={date:j(null==A||null===(D=A.auditDetails)||void 0===D?void 0:D.lastModifiedTime),name:null==e||null===(x=e.assignes)||void 0===x||null===(P=x[0])||void 0===P?void 0:P.name,wfComment:null==e?void 0:e.wfComment,mobileNumber:null==e||null===(N=e.assignes)||void 0===N||null===(w=N[0])||void 0===w?void 0:w.mobileNumber};return l.createElement(Xl,{data:t})}},W=(e,t)=>e?t?e:O(e):O("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"),q=window.location.href.includes("employee/obps"),G=(window.location.href.includes("employee/ws"),()=>window.location.href.includes("employee/obps")||window.location.href.includes("employee/noc")||z?{justifyContent:"space-between",fontSize:"16px",lineHeight:"19px",color:"#0B0C0C"}:{}),K={table:{border:"2px solid black",width:"100%",fontFamily:"sans-serif"},td:{padding:"10px",border:"1px solid black",textAlign:"center"},th:{padding:"10px",border:"1px solid black",textAlign:"center"}},Y=e=>null!=e&&e.skip?e.value:null!=e&&e.isUnit?null!=e&&e.value?W(null==e?void 0:e.value,null==e?void 0:e.isNotTranslated)+" "+O(null==e?void 0:e.isUnit):O("N/A"):null!=e&&e.value?W(null==e?void 0:e.value,null==e?void 0:e.isNotTranslated):O("N/A"),[$,X]=n.useState(!1);console.log("demand Data arr",b);const Z=null==b?void 0:b.reduce((e,t)=>e+t.demandInterest,0),J=null==b?void 0:b.reduce((e,t)=>e+t.demandPenality,0),Q=null==b?void 0:b.reduce((e,t)=>e+t.collectionTax,0),ee=null==b?void 0:b.reduce((e,t)=>e+t.collectionInterest,0),te=null==b?void 0:b.reduce((e,t)=>e+t.collectionPenality,0),ne=null==b?void 0:b.reduce((e,t)=>e+t.balanceTax,0);return null==b||b.reduce((e,t)=>e+t.balanceInterest,0),null==b||b.reduce((e,t)=>e+t.balancePenality,0),l.createElement(t.Card,{style:{position:"relative"},className:"employeeCard-override"},I?l.createElement(rr,{t:O,userType:!1,infoBannerLabel:"CS_FILE_APPLICATION_INFO_LABEL",infoClickLable:"WS_CLICK_ON_LABEL",infoClickInfoLabel:window.location.href.includes("disconnection")||window.location.href.includes("application")?"WS_DISCONNECTION_CLICK_ON_INFO_LABEL":"WS_CLICK_ON_INFO_LABEL",infoClickInfoLabel1:window.location.href.includes("disconnection")||window.location.href.includes("application")?"WS_DISCONNECTION_CLICK_ON_INFO1_LABEL":""}):null,null==S||null===(o=S.applicationDetails)||void 0===o?void 0:o.map((e,r)=>{var o,a,u,s,c,d,p,f,v,m,h,g,E,_,y,b,C,A,D,x,P,N,I,k,F,B,U,j,H,W,K,$,X,Z,J,Q,ee,te,ne,le;return l.createElement(l.Fragment,{key:r},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!==r||e.asSectionHeader?l.createElement(l.Fragment,null,l.createElement(t.CardSectionHeader,{style:0==r&&z?{marginBottom:"16px",fontSize:"24px"}:{marginBottom:"16px",marginTop:"32px",fontSize:"24px"}},V?""+O(e.title):O(e.title),null!=e&&e.Component?l.createElement(e.Component,null):null)):l.createElement(t.CardSubHeader,{style:{marginBottom:"16px",fontSize:"24px"}},O(e.title)),(null==e?void 0:e.isTable)&&l.createElement("table",{style:{tableLayout:"fixed",width:"100%",borderCollapse:"collapse"}},l.createElement("tr",{style:{textAlign:"left"}},null==e?void 0:e.headers.map(e=>l.createElement("th",{style:{padding:"10px",paddingLeft:"0px"}},O(e)))),null==e?void 0:e.tableRows.map((t,r)=>r===(null==e?void 0:e.tableRows.length)-1?l.createElement(n.Fragment,null,l.createElement("hr",{style:{width:"370%",marginTop:"15px"},className:"underline"}),l.createElement("tr",null,t.map(e=>l.createElement("td",{style:{textAlign:"left"}},O(e))))):l.createElement("tr",null,t.map(e=>l.createElement("td",{style:{paddingTop:"20px",textAlign:"left"}},O(e)))))),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===(o=e.values)||void 0===o?void 0:o.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:O(n.title),label:O(n.title),text:l.createElement("img",{src:O(n.value),alt:"",privacy:null==n?void 0:n.privacy})}):1==(null==n?void 0:n.isLink)?l.createElement(t.Row,{key:O(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"}},O(null==n?void 0:n.title)))):V||q?""+O(n.title):O(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:G(),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:""+O(""+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:O(n.title),label:O(n.title),text:Y(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:G(),labelStyle:{wordBreak:"break-all"},textStyle:{wordBreak:"break-all"}}),"PT_TOTAL_DUES"===n.title?l.createElement(sr,{bill:null===(a=M.Bill)||void 0===a?void 0:a[0]}):"")})))),(null==e?void 0:e.belowComponent)&&l.createElement(e.belowComponent,null),(null==e||null===(a=e.additionalDetails)||void 0===a?void 0:a.inspectionReport)&&l.createElement(Kl,{scrutinyDetails:null==e?void 0:e.additionalDetails,paymentsList:w,additionalDetails:null==S||null===(u=S.applicationData)||void 0===u?void 0:u.additionalDetails,applicationData:null==S?void 0:S.applicationData}),(null==S||null===(s=S.applicationData)||void 0===s||null===(c=s.additionalDetails)||void 0===c||null===(d=c.fieldinspection_pending)||void 0===d?void 0:d.length)>0&&(null==e||null===(p=e.additionalDetails)||void 0===p?void 0:p.fiReport)&&l.createElement(Ul,{fiReport:null==S||null===(f=S.applicationData)||void 0===f||null===(v=f.additionalDetails)||void 0===v?void 0:v.fieldinspection_pending}),(null==e||null===(m=e.additionalDetails)||void 0===m?void 0:m.floors)&&l.createElement(ql,{floors:null==e||null===(h=e.additionalDetails)||void 0===h?void 0:h.floors}),(null==e||null===(g=e.additionalDetails)||void 0===g?void 0:g.owners)&&l.createElement(Gl,{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(Jl,{units:null==e||null===(y=e.additionalDetails)||void 0===y?void 0:y.units}),(null==e||null===(b=e.additionalDetails)||void 0===b?void 0:b.accessories)&&l.createElement(Zl,{units:null==e||null===(C=e.additionalDetails)||void 0===C?void 0:C.accessories}),!L&&(null==e||null===(A=e.additionalDetails)||void 0===A?void 0:A.permissions)&&(null==T||null===(D=T.data)||void 0===D||null===(x=D.nextActions)||void 0===x?void 0:x.length)>0&&l.createElement(Wl,{applicationData:null==S?void 0:S.applicationData,t:O,permissions:null==e||null===(P=e.additionalDetails)||void 0===P?void 0:P.permissions}),(null==e||null===(N=e.additionalDetails)||void 0===N?void 0:N.obpsDocuments)&&l.createElement("div",{style:{display:"flex"}},l.createElement(Fl,{t:O,applicationData:null==S?void 0:S.applicationData,docs:e.additionalDetails.obpsDocuments,bpaActionsDetails:T})),(null==e||null===(I=e.additionalDetails)||void 0===I?void 0:I.noc)&&l.createElement(Hl,{t:O,isNoc:!0,NOCdata:e.values,applicationData:null==S?void 0:S.applicationData,docs:e.additionalDetails.noc,noc:null===(k=e.additionalDetails)||void 0===k?void 0:k.data,bpaActionsDetails:T}),(null==e||null===(F=e.additionalDetails)||void 0===F?void 0:F.scruntinyDetails)&&l.createElement(Kl,{scrutinyDetails:null==e?void 0:e.additionalDetails}),(null==e||null===(B=e.additionalDetails)||void 0===B?void 0:B.buildingExtractionDetails)&&l.createElement(Kl,{scrutinyDetails:null==e?void 0:e.additionalDetails}),(null==e||null===(U=e.additionalDetails)||void 0===U?void 0:U.subOccupancyTableDetails)&&l.createElement(Yl,{edcrDetails:null==e?void 0:e.additionalDetails,applicationData:null==S?void 0:S.applicationData}),(null==e||null===(j=e.additionalDetails)||void 0===j?void 0:j.documentsWithUrl)&&l.createElement(Ml,{documents:null==e||null===(H=e.additionalDetails)||void 0===H?void 0:H.documentsWithUrl}),(null==e||null===(W=e.additionalDetails)||void 0===W?void 0:W.documents)&&l.createElement(zl,{documents:null==e||null===(K=e.additionalDetails)||void 0===K?void 0:K.documents}),(null==e||null===($=e.additionalDetails)||void 0===$?void 0:$.taxHeadEstimatesCalculation)&&l.createElement(Vl,{taxHeadEstimatesCalculation:null==e||null===(X=e.additionalDetails)||void 0===X?void 0:X.taxHeadEstimatesCalculation}),(null==e?void 0:e.isWaterConnectionDetails)&&l.createElement(Ql,{wsAdditionalDetails:e,oldValue:R}),(null==e||null===(Z=e.additionalDetails)||void 0===Z?void 0:Z.redirectUrl)&&l.createElement("div",{style:{fontSize:"16px",lineHeight:"24px",fontWeight:"400",padding:"10px 0px"}},l.createElement(i.Link,{to:null==e||null===(J=e.additionalDetails)||void 0===J||null===(Q=J.redirectUrl)||void 0===Q?void 0:Q.url},l.createElement("span",{className:"link",style:{color:"#a82227"}},null==e||null===(ee=e.additionalDetails)||void 0===ee||null===(te=ee.redirectUrl)||void 0===te?void 0:te.title))),(null==e||null===(ne=e.additionalDetails)||void 0===ne?void 0:ne.estimationDetails)&&l.createElement(nr,{wsAdditionalDetails:e,workflowDetails:T}),(null==e||null===(le=e.additionalDetails)||void 0===le?void 0:le.estimationDetails)&&l.createElement(ir,{wsAdditionalDetails:e,workflowDetails:T}))}),P&&(null==T||null===(a=T.data)||void 0===a||null===(u=a.timeline)||void 0===u?void 0:u.length)>0&&l.createElement(l.Fragment,null,l.createElement(t.BreakLine,null),((null==T?void 0:T.isLoading)||C)&&l.createElement(t.Loader,null),!(null!=T&&T.isLoading)&&!C&&l.createElement(n.Fragment,null,l.createElement("div",{id:"timeline"},l.createElement(t.CardSectionHeader,{style:{marginBottom:"16px",marginTop:"32px"}},O("ES_APPLICATION_DETAILS_APPLICATION_TIMELINE")),null!=T&&null!==(s=T.data)&&void 0!==s&&s.timeline&&1===(null==T||null===(c=T.data)||void 0===c||null===(d=c.timeline)||void 0===d?void 0:d.length)?l.createElement(t.CheckPoint,{isCompleted:!0,label:O(""+x+(null==T||null===(p=T.data)||void 0===p||null===(f=p.timeline[0])||void 0===f?void 0:f.state)),customChild:H(null==T||null===(v=T.data)||void 0===v?void 0:v.timeline[0],null==T||null===(m=T.data)||void 0===m?void 0:m.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,$?null==T?void 0:T.data.timeline.length:2).map((e,n,r)=>{var i;let o="";var a,u,s,c,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!==(s=u.state)&&void 0!==s&&s.includes("BACK_FROM")||null!=T&&null!==(c=T.data)&&void 0!==c&&null!==(d=c.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:O(""+x+("REOPEN"===(null==e?void 0:e.performedAction)?null==e?void 0:e.performedAction:null==e?void 0:e[N])+o),customChild:H(e,n,null==T||null===(i=T.data)||void 0===i?void 0:i.timeline)}))}))),(null==T||null===(E=T.data)||void 0===E||null===(y=E.timeline)||void 0===y?void 0:y.length)>2&&l.createElement(t.LinkButton,{label:O($?"COLLAPSE":"VIEW_TIMELINE"),onClick:()=>{X(e=>!e)}})))),l.createElement(t.CardSectionHeader,{style:{marginBottom:"16px",marginTop:"16px",fontSize:"24px"}},"DCB Details"),l.createElement("table",{border:"1px",style:K.table},l.createElement("thead",null,l.createElement("tr",null,l.createElement("th",{style:K.th},"Installments"),l.createElement("th",{colSpan:"3",style:K.th},"Demand"),l.createElement("th",{colSpan:"3",style:K.th},"Collection"),l.createElement("th",{colSpan:"3",style:K.th},"Balance"),l.createElement("th",{style:K.th},"Advance")),l.createElement("tr",null,l.createElement("th",{style:K.th}),l.createElement("th",{style:K.th},"Tax"),l.createElement("th",{style:K.th},"Interest"),l.createElement("th",{style:K.th},"Penalty"),l.createElement("th",{style:K.th},"Tax"),l.createElement("th",{style:K.th},"Interest"),l.createElement("th",{style:K.th},"Penalty"),l.createElement("th",{style:K.th},"Tax"),l.createElement("th",{style:K.th},"Interest"),l.createElement("th",{style:K.th},"Penalty"),l.createElement("th",{style:K.th},"Advance"))),l.createElement("tbody",null,null==b?void 0:b.map(e=>l.createElement("tr",null,l.createElement("td",{style:K.td},e.taxPeriodFrom,"-",e.taxPeriodTo),l.createElement("td",{style:K.td},e.demandTax),l.createElement("td",{style:K.td},e.demandInterest),l.createElement("td",{style:K.td},e.demandPenality),l.createElement("td",{style:K.td},e.collectionTax),l.createElement("td",{style:K.td},e.collectionInterest),l.createElement("td",{style:K.td},e.collectionPenality),l.createElement("td",{style:K.td},e.balanceTax),l.createElement("td",{style:K.td},e.balanceInterest),l.createElement("td",{style:K.td},e.balancePenality),l.createElement("td",{style:K.td},e.advance))),l.createElement("tr",null,l.createElement("th",{style:K.th},"Total"),l.createElement("td",{style:K.td},D),l.createElement("td",{style:K.td},Z),l.createElement("td",{style:K.td},J),l.createElement("td",{style:K.td},Q),l.createElement("td",{style:K.td},ee),l.createElement("td",{style:K.td},te),l.createElement("td",{style:K.td}),l.createElement("td",{style:K.td}),l.createElement("td",{style:K.td}),l.createElement("td",{style:K.td})),l.createElement("tr",null,l.createElement("td",{style:K.td}),l.createElement("td",{style:K.td}),l.createElement("td",{style:K.td}),l.createElement("td",{style:K.td}),l.createElement("td",{style:K.td}),l.createElement("td",{style:K.td}),l.createElement("th",{style:K.th},"Total"),l.createElement("td",{style:K.td},ne),l.createElement("td",{style:K.td},"0"),l.createElement("td",{style:K.td},"0"),l.createElement("td",{style:K.td},"0")),l.createElement("tr",null,l.createElement("td",{style:K.td}),l.createElement("td",{style:K.td}),l.createElement("td",{style:K.td}),l.createElement("td",{style:K.td}),l.createElement("td",{style:K.td}),l.createElement("td",{style:K.td}),l.createElement("th",{style:K.th},"Total Balance"),l.createElement("td",{style:K.td},ne)))))}function dr(e){var n,r,i,o,a,u,s,c,d,p,f,v,m,h,g,E,_,y;let{t:S,showToast:b,closeToast:T,businessService:C}=e;if(null!=C&&C.includes("NewTL")||null!=C&&C.includes("TL")||null!=C&&C.includes("EDITRENEWAL")){var A;let e="";switch(null==b||null===(A=b.action)||void 0===A?void 0:A.action){case"SENDBACK":e="error"===(null==b?void 0:b.key)?null==b||null===(n=b.error)||void 0===n?void 0:n.message:S("TL_SENDBACK_CHECKLIST_MESSAGE_HEAD");break;case"FORWARD":e="error"===(null==b?void 0:b.key)?null==b||null===(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===(s=b.error)||void 0===s?void 0:s.message:S("TL_TL_CANCELLED_MESSAGE_HEAD");break;default:e="error"===(null==b?void 0:b.key)?null==b||null===(c=b.error)||void 0===c?void 0:c.message:S("ES_"+C+"_"+(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!=C&&C.includes("BPA")||null!=C&&C.includes("BPA_LOW")||null!=C&&C.includes("BPA_OC")){var D;const e=function(e){var t;void 0===e&&(e=[]);let n=e[0];return n=2==(null===(t=e)||void 0===t?void 0:t.length)&&null!=C&&C.includes("BPA_OC")?S(e[1]):S(e[0]),n};let n="";switch(null==b||null===(D=b.action)||void 0===D?void 0:D.action){case"REVOCATE":n="error"===(null==b?void 0:b.key)?null==b||null===(p=b.error)||void 0===p?void 0:p.message:e(["BPA_APPROVAL_REVOCATED_MESSAGE_HEAD","BPA_APPROVAL_OC_REVOCATED_MESSAGE_HEAD"]);break;case"VERIFY_AND_FORWARD":n="error"===(null==b?void 0:b.key)?null==b||null===(f=b.error)||void 0===f?void 0:f.message:e(["BPA_FORWARD_SUCCESS_MESSAGE_MAIN"]);break;case"SEND_BACK_TO_CITIZEN":n="error"===(null==b?void 0:b.key)?null==b||null===(v=b.error)||void 0===v?void 0:v.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===(g=b.error)||void 0===g?void 0:g.message:e(["BPA_FORWARD_SUCCESS_MESSAGE_MAIN"]);break;case"SEND_BACK_FOR_DOCUMENT_VERIFICATION":case"SEND_BACK_FOR_FIELD_INSPECTION":n="error"===(null==b?void 0:b.key)?null==b||null===(E=b.error)||void 0===E?void 0:E.message:e(["BPA_SENDBACK_SUCCESS_MESSAGE_MAIN"]);break;default:n="error"===(null==b?void 0:b.key)?null==b||null===(_=b.error)||void 0===_?void 0:_.message:S("ES_"+C+"_"+(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 x,P;const e="error"===(null==b?void 0:b.key)?null==b||null===(x=b.error)||void 0===x?void 0:x.message:"ES_"+C+"_"+(null==b||null===(P=b.action)||void 0===P?void 0:P.action)+"_UPDATE_SUCCESS";return l.createElement(l.Fragment,null,b&&l.createElement(t.Toast,{error:"error"===b.key,label:S(e),onClose:T}))}}function pr(e){var i,o,a,s,c,d,p,f,v,m,h,g,E,_,y,S;let{workflowDetails:b,displayMenu:T,onActionSelect:C,setDisplayMenu:A,businessService:D,forcedActionPrefix:x,ActionBarStyle:P={},MenuStyle:N={}}=e;const{t:w}=r.useTranslation();let R=Digit.UserService.getUser();const I=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):{};R=null==t?void 0:t.value}const O=null===(i=R)||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 L=!1,k=!1,M=(null==b||null===(s=b.data)||void 0===s||null===(c=s.actionState)||void 0===c||null===(d=c.nextActions)||void 0===d?void 0:d.filter(e=>(null==O?void 0:O.some(t=>{var n;return null===(n=e.roles)||void 0===n?void 0:n.includes(t)}))||!e.roles))||(null==b||null===(p=b.data)||void 0===p||null===(f=p.nextActions)||void 0===f?void 0:f.filter(e=>(null==O?void 0:O.some(t=>{var n;return null===(n=e.roles)||void 0===n?void 0:n.includes(t)}))||!e.roles));return Digit.Hooks.useClickOutside(I,()=>{A(!1)},T),(window.location.href.includes("/obps")||window.location.href.includes("/noc"))&&1==(null==M?void 0:M.length)||null!=M&&null!==(v=M[0])&&void 0!==v&&null!==(m=v.redirectionUrl)&&void 0!==m&&m.pathname.includes("/pt/property-details/")&&1==(null==M?void 0:M.length)?(k=!1,L=!0):(null==M?void 0:M.length)>0&&(k=!0,L=!1),l.createElement(l.Fragment,null,!(null!=b&&b.isLoading)&&k&&!L&&l.createElement(t.ActionBar,{style:u({},P)},T&&(null!=b&&null!==(h=b.data)&&void 0!==h&&null!==(g=h.actionState)&&void 0!==g&&g.nextActions||null!=b&&null!==(E=b.data)&&void 0!==E&&E.nextActions)?l.createElement(t.Menu,{localeKeyPrefix:x||"WF_EMPLOYEE_"+(null==D?void 0:D.toUpperCase()),options:M,optionKey:"action",t:w,onSelect:C,style:N}):null,l.createElement(t.SubmitBar,{ref:I,label:w("WF_TAKE_ACTION"),onSubmit:()=>A(!T)})),!(null!=b&&b.isLoading)&&!k&&L&&l.createElement(t.ActionBar,{style:u({},P)},l.createElement("button",{style:{color:"#FFFFFF",fontSize:"18px"},className:"submit-bar",name:null==M||null===(_=M[0])||void 0===_?void 0:_.action,value:null==M||null===(y=M[0])||void 0===y?void 0:y.action,onClick:e=>{C((null==M?void 0:M[0])||{})}},w((x||"WF_EMPLOYEE_"+(null==D?void 0:D.toUpperCase()))+"_"+(null==M||null===(S=M[0])||void 0===S?void 0:S.action)))))}const fr=()=>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"})),vr=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(fr,null));function mr(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(vr,{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 hr=e=>{var o,s;console.log("props",e);let c=window.location.href.includes("editApplication")&&window.location.href.includes("bpa");const d=Digit.ULBService.getCurrentTenantId(),p=Digit.ULBService.getStateId(),{data:f}=Digit.Hooks.obps.useMDMS(p,"BPA",["BlockReason"]),{t:v}=r.useTranslation(),m=i.useHistory();let{id:h}=i.useParams();const[g,E]=n.useState(!1),[_,y]=n.useState(null),[S,b]=n.useState(!1),[T,C]=n.useState(!1),[A,D]=n.useState(!1),{data:x}=Digit.Hooks.obps.useMDMS(p,"BPA",["RiskTypeComputation"]),{applicationDetails:P,demandData:N,totalDemandTax:w,totalBalanceTax:R,showToast:I,setShowToast:O,isLoading:L,isDataLoading:k,applicationData:M,mutate:F,nocMutation:B,workflowDetails:U,id:j,businessService:H,closeToast:W,moduleCode:z,timelineStatusPrefix:V,forcedActionPrefix:q,statusAttribute:G,ActionBarStyle:K,MenuStyle:Y,paymentsList:$,showTimeLine:X=!0,oldValue:Z,isInfoLabel:J=!1,clearDataDetails:Q}=e;n.useEffect(()=>{I&&U.revalidate()},[I]);const ee=a.useQueryClient(),te=()=>{y(null),b(!1)};return L||T?l.createElement(t.Loader,null):l.createElement(l.Fragment,null,L?l.createElement(t.Loader,null):l.createElement(l.Fragment,null,l.createElement(cr,{applicationDetails:P,demandData:N,id:j,workflowDetails:U,isDataLoading:k,applicationData:M,totalDemandTax:w,totalBalanceTax:R,businessService:H,timelineStatusPrefix:V,statusAttribute:G,paymentsList:$,showTimeLine:X,oldValue:Z,isInfoLabel:J}),S?l.createElement(kl,{t:v,action:_,tenantId:d,state:p,id:h,applicationDetails:P,applicationData:null==P?void 0:P.applicationData,closeModal:te,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,s,c,d,p,f,h,g,E,y,S,b,T,A,D){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)||("INITIATE"===(null==e||null===(a=e.Licenses)||void 0===a||null===(s=a[0])||void 0===s?void 0:s.action)?0==(null==e||null===(c=e.Licenses)||void 0===c||null===(d=c[0])||void 0===d||null===(p=d.additionalDetail)||void 0===p||null===(f=p.validityYears)||void 0===f?void 0:f.length):0==(null==e||null===(h=e.Licenses)||void 0===h||null===(g=h[0])||void 0===g||null===(E=g.comment)||void 0===E?void 0:E.length))||0==(null==e||null===(y=e.WaterConnection)||void 0===y||null===(S=y.comment)||void 0===S?void 0:S.length)||0==(null==e||null===(b=e.SewerageConnection)||void 0===b||null===(T=b.comment)||void 0===T?void 0:T.length)||0==(null==e||null===(A=e.BPA)||void 0===A||null===(D=A.comment)||void 0===D?void 0:D.length)){var x,P;"INITIATE"===(null==e||null===(x=e.Licenses)||void 0===x||null===(P=x[0])||void 0===P?void 0:P.action)?alert(v("Please fill in the validity before submitting")):alert(v("Please fill in the comments before submitting"))}else{const r=function(r,i,o,a,s){if("BPA"!=(null==e||null===(r=e.BPA)||void 0===r?void 0:r.businessService)||null!=e&&null!==(i=e.BPA)&&void 0!==i&&null!==(o=i.additionalDetails)&&void 0!==o&&o.blockingReason||"BLOCK"!=(null==e||null===(a=e.BPA)||void 0===a||null===(s=a.workflow)||void 0===s?void 0:s.action)){function c(t){if(l)return t;F&&(C(!0),F(e,{onError:(e,t)=>{C(!1),O({key:"error",error:e}),setTimeout(W,5e3)},onSuccess:(e,t)=>{var l,r,i,o,a,u;if(sessionStorage.removeItem("WS_SESSION_APPLICATION_DETAILS"),C(!1),null!==(l=n)&&void 0!==l&&l.bpa&&(e.selectedAction=_,m.replace("/digit-ui/employee/obps/response",{data:e})),null!==(r=n)&&void 0!==r&&r.isStakeholder&&(e.selectedAction=_,m.push("/digit-ui/employee/obps/stakeholder-response",{data:e})),null!==(i=n)&&void 0!==i&&i.isNoc&&m.push("/digit-ui/employee/noc/response",{data:e}),(null==e||null===(o=e.Amendments)||void 0===o?void 0:o.length)>0){var s,c,d,p,f,h,g,E;null!=t&&null!==(s=t.AmendmentUpdate)&&void 0!==s&&null!==(c=s.workflow)&&void 0!==c&&c.action.includes("SEND_BACK")?O({key:"success",label:v("ES_MODIFYSWCONNECTION_SEND_BACK_UPDATE_SUCCESS")}):null!=t&&null!==(d=t.AmendmentUpdate)&&void 0!==d&&null!==(p=d.workflow)&&void 0!==p&&p.action.includes("RE-SUBMIT")?O({key:"success",label:v("ES_MODIFYSWCONNECTION_RE_SUBMIT_UPDATE_SUCCESS")}):null!=t&&null!==(f=t.AmendmentUpdate)&&void 0!==f&&null!==(h=f.workflow)&&void 0!==h&&h.action.includes("APPROVE")?O({key:"success",label:v("ES_MODIFYSWCONNECTION_APPROVE_UPDATE_SUCCESS")}):null!=t&&null!==(g=t.AmendmentUpdate)&&void 0!==g&&null!==(E=g.workflow)&&void 0!==E&&E.action.includes("REJECT")&&O({key:"success",label:v("ES_MODIFYWSCONNECTION_REJECT_UPDATE_SUCCESS")})}else{var y;if((null==e||null===(a=e.Licenses)||void 0===a?void 0:a.length)>0&&null!=e&&null!==(u=e.Licenses[0])&&void 0!==u&&u.applicationNumber)return O({key:"success",action:_}),void m.replace("/digit-ui/employee/tl/application-details/"+(null==e||null===(y=e.Licenses[0])||void 0===y?void 0:y.applicationNumber));O({key:"success",action:_}),Q&&setTimeout(Q,3e3),setTimeout(W,5e3),ee.clear(),ee.refetchQueries("APPLICATION_SEARCH")}}})),te()}C(!0),"function"==typeof(null==e?void 0:e.customFunctionToExecute)&&(null==e||e.customFunctionToExecute(u({},e)));const r=function(){if(!1!==t&&B){var e;const n=null===(e=t)||void 0===e?void 0:e.map(e=>null==B?void 0:B.mutateAsync(e)),r=Je(function(){return C(!0),Promise.resolve(Promise.all(n)).then(function(e){e&&e.map(e=>{var t,n;Digit.SessionStorage.del(null==e||null===(t=e.Noc)||void 0===t||null===(n=t[0])||void 0===n?void 0:n.nocType)})})},function(e){var t,n,r,i,o,a,u,s,c,d,p,f;C(!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?v(null==e||null===(o=e.response)||void 0===o||null===(a=o.data)||void 0===a||null===(u=a.Errors)||void 0===u||null===(s=u[0])||void 0===s?void 0:s.code):(null==e||null===(c=e.response)||void 0===c||null===(d=c.data)||void 0===d||null===(p=d.Errors)||void 0===p||null===(f=p[0])||void 0===f?void 0:f.message)||e;te(),O({key:"error",error:{message:m}}),setTimeout(W,5e3),l=!0});if(r&&r.then)return r.then(function(){})}}();return r&&r.then?r.then(c):c(r)}alert(v("Please select Blocking reason"))}();if(r&&r.then)return r.then(function(){})}}();return Promise.resolve(r&&r.then?r.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},actionData:null==U||null===(o=U.data)||void 0===o?void 0:o.timeline,businessService:H,workflowDetails:U,moduleCode:z,blockReason:null==f||null===(s=f.BPA)||void 0===s?void 0:s.BlockReason}):null,A?l.createElement(mr,{action:_,workflowDetails:U,businessService:H,isWarningPop:A,closeWarningPopup:()=>{D(!1)}}):null,l.createElement(dr,{t:v,showToast:I,closeToast:W,businessService:H}),c?l.createElement("div",null,l.createElement(t.SubmitBar,{style:{marginRight:20},label:v("BPA_EDIT_UPDATE"),onSubmit:function(e){try{return Promise.resolve(Digit.OBPSService.BPASearch(d,{applicationNo:null==M?void 0:M.applicationNo})).then(function(e){var t,n,l,r,i,o;const a=Digit.Utils.obps.calculateRiskType(null==x||null===(t=x.BPA)||void 0===t?void 0:t.RiskTypeComputation,null==P||null===(n=P.edcrDetails)||void 0===n||null===(l=n.planDetail)||void 0===l||null===(r=l.plot)||void 0===r?void 0:r.area,null==P||null===(i=P.edcrDetails)||void 0===i||null===(o=i.planDetail)||void 0===o?void 0:o.blocks),u={BPA:e.BPA[0]};u.BPA.riskType=a,u.BPA.workflow={action:"EDIT PAY 2",assignes:[],comments:null,varificationDocuments:null},u.BPA.additionalDetails.selfCertificationCharges.BPA_DEVELOPMENT_CHARGES=sessionStorage.getItem("development")||"0",u.BPA.additionalDetails.selfCertificationCharges.BPA_OTHER_CHARGES=sessionStorage.getItem("otherCharges")||"0",u.BPA.additionalDetails.selfCertificationCharges.BPA_LESS_ADJUSMENT_PLOT=sessionStorage.getItem("lessAdjusment")||"0",u.BPA.additionalDetails.otherFeesDiscription=sessionStorage.getItem("otherChargesDisc"),u.BPA.additionalDetails.lessAdjustmentFeeFiles=JSON.parse(sessionStorage.getItem("uploadedFileLess"));const s=function(e,t,n,l,r,i,o,a,s,c,p,f){if(!(parseInt(sessionStorage.getItem("lessAdjusment"))>parseInt(sessionStorage.getItem("development"))+parseInt(sessionStorage.getItem("otherCharges"))+parseInt(null==u||null===(e=u.BPA)||void 0===e||null===(t=e.additionalDetails)||void 0===t||null===(n=t.selfCertificationCharges)||void 0===n?void 0:n.BPA_MALBA_CHARGES)+parseInt(null==u||null===(l=u.BPA)||void 0===l||null===(r=l.additionalDetails)||void 0===r||null===(i=r.selfCertificationCharges)||void 0===i?void 0:i.BPA_LABOUR_CESS)+parseInt(null==u||null===(o=u.BPA)||void 0===o||null===(a=o.additionalDetails)||void 0===a||null===(s=a.selfCertificationCharges)||void 0===s?void 0:s.BPA_WATER_CHARGES)+parseInt(null==u||null===(c=u.BPA)||void 0===c||null===(p=c.additionalDetails)||void 0===p||null===(f=p.selfCertificationCharges)||void 0===f?void 0:f.BPA_GAUSHALA_CHARGES_CESS)))return Promise.resolve(Digit.OBPSService.update(u,d)).then(function(e){window.location.assign(window.location.href.split("/editApplication")[0]+window.location.href.split("editApplication")[1])});alert(v("Enterd Less Adjustment amount is invalid"))}();if(s&&s.then)return s.then(function(){})})}catch(e){return Promise.reject(e)}},id:!0})):l.createElement(pr,{workflowDetails:U,displayMenu:g,onActionSelect:function(e){var t,n,l;if(e)if("EDIT PAY 2"==(null==e?void 0:e.action)&&window.location.href.includes("bpa")&&window.location.assign(window.location.href.split("bpa")[0]+"editApplication/bpa"+window.location.href.split("bpa")[1]),null!=e&&e.isToast)O({key:"error",error:{message:null==e?void 0:e.toastMessage}}),setTimeout(W,5e3);else if(null!=e&&e.isWarningPopUp)D(!0);else if(null!=e&&e.redirectionUrll){var r,i,o,a,s;if("ACTIVATE_CONNECTION"===(null==e||null===(r=e.redirectionUrll)||void 0===r?void 0:r.action))m.push(""+(null==e||null===(o=e.redirectionUrll)||void 0===o?void 0:o.pathname),JSON.stringify({data:null==e||null===(a=e.redirectionUrll)||void 0===a?void 0:a.state,url:""+(null===(s=location)||void 0===s?void 0:s.pathname)+location.search}));else if("RE-SUBMIT-APPLICATION"===(null==e||null===(i=e.redirectionUrll)||void 0===i?void 0:i.action)){var c,d;m.push(""+(null==e||null===(c=e.redirectionUrll)||void 0===c?void 0:c.pathname),{data:null==e||null===(d=e.redirectionUrll)||void 0===d?void 0:d.state})}else{var p;window.location.assign(window.location.origin+"/digit-ui/employee/payment/collect/"+(null==e||null===(p=e.redirectionUrll)||void 0===p?void 0:p.pathname))}}else if(null!=e&&e.redirectionUrl||"EDIT PAY 2"==(null==e?void 0:e.action))if("DIRECTRENEWAL"===(null==e||null===(t=e.redirectionUrl)||void 0===t||null===(n=t.state)||void 0===n||null===(l=n.applicationData)||void 0===l?void 0:l.workflowCode))console.log("Got Inside Direct"),b(!0);else{var f,v;m.push({pathname:null===(f=e.redirectionUrl)||void 0===f?void 0:f.pathname,state:u({},null===(v=e.redirectionUrl)||void 0===v?void 0:v.state)})}else b(!0);y(e),E(!1)},setDisplayMenu:E,businessService:H,forcedActionPrefix:q,ActionBarStyle:K,MenuStyle:Y})))},gr=["tenantId","payments"];var Er=l.memo(()=>{var e,o,a,c,d,f,v,m,h,g,E,_,y;const{t:S}=r.useTranslation(),{data:b}=Digit.Hooks.useStore.getInitData(),T=Digit.ULBService.getCurrentTenantId(),{tenants:C}=b||{},{id:A}=i.useParams(),[D,x]=n.useState(null),[P,N]=n.useState({}),[w,R]=n.useState(!1),[O,L]=n.useState(!1),[k,M]=n.useState("ptr");console.log("gggggg",P),sessionStorage.setItem("applicationNoinAppDetails",A);const{isLoading:F,data:B}=Digit.Hooks.ptr.usePtrApplicationDetail(S,T,A),{mutate:U}=Digit.Hooks.ptr.usePTRApplicationAction(T);let j=Digit.Hooks.useWorkflowDetails({tenantId:(null==B||null===(e=B.applicationData)||void 0===e?void 0:e.tenantId)||T,id:null==B||null===(o=B.applicationData)||void 0===o||null===(a=o.applicationData)||void 0===a?void 0:a.applicationNumber,moduleCode:k,role:"PT_CEMP"});var H,W;console.log("workkkkflooowowow",j),Digit.Hooks.ptr.usePTRSearch({tenantId:T,filters:{applicationNumber:A,audit:!0}}),n.useEffect(()=>{B&&N(p.cloneDeep(B))},[B]),n.useEffect(()=>{var e,t,n;null==j||null===(e=j.data)||void 0===e||!e.applicationBusinessService||"ptr"===(null==j||null===(t=j.data)||void 0===t?void 0:t.applicationBusinessService)&&"ptr"===k||M(null==j||null===(n=j.data)||void 0===n?void 0:n.applicationBusinessService)},[j.data]),!Digit.UserService.hasAccess(["PT_CEMP"])||"ptr"!==(null==j||null===(c=j.data)||void 0===c?void 0:c.applicationBusinessService)||null==j||null===(d=j.data)||void 0===d||null===(f=d.actionState)||void 0===f||null===(v=f.nextActions)||void 0===v||!v.find(e=>"PAY"===e.action)||(j.data.actionState.nextActions=null==j||null===(H=j.data)||void 0===H||null===(W=H.actionState)||void 0===W?void 0:W.nextActions.map(e=>{var t,n;return"PAY"===e.action?{action:"PAY",forcedName:"WF_PAY_APPLICATION",redirectionUrl:{pathname:"/digit-ui/employee/payment/collect/pet-services/"+(null==P||null===(t=P.applicationData)||void 0===t||null===(n=t.applicationData)||void 0===n?void 0:n.applicationNumber)}}:e}));let z=[{order:1,label:S("PTR_APPLICATION"),onClick:()=>function(){try{const e=null==P?void 0:P.applicationData,t=C.find(t=>t.code===e.tenantId);return Promise.resolve(I(e.applicationData,t,S)).then(function(e){Digit.Utils.pdf.generate(e)})}catch(e){return Promise.reject(e)}}()}];const{data:V,isLoading:q}=Digit.Hooks.useRecieptSearch({tenantId:T,businessService:"pet-services",consumerCodes:null==P||null===(m=P.applicationData)||void 0===m||null===(h=m.applicationData)||void 0===h?void 0:h.applicationNumber,isEmployee:!1},{enabled:!(null==P||null===(g=P.applicationData)||void 0===g||null===(E=g.applicationData)||void 0===E||!E.applicationNumber)});return V&&(null==V?void 0:V.Payments.length)>0&&0==q&&z.push({label:S("PTR_FEE_RECIEPT"),onClick:()=>{var e;return function(e){let{tenantId:t,payments:n}=e;s(e,gr);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==V||null===(e=V.Payments[0])||void 0===e?void 0:e.tenantId,payments:null==V?void 0:V.Payments[0]})}}),"APPROVED"===(null==V||null===(_=V.Payments[0])||void 0===_?void 0:_.instrumentStatus)&&z.push({label:S("PTR_CERTIFICATE"),onClick:()=>function(){try{var e;return Promise.resolve(Digit.PaymentService.generatePdf(T,{PetRegistrationApplications:[null==B||null===(e=B.applicationData)||void 0===e?void 0:e.applicationData]},"petservicecertificate")).then(function(e){return Promise.resolve(Digit.PaymentService.printReciept(T,{fileStoreIds:e.filestoreIds[0]})).then(function(t){window.open(t[null==e?void 0:e.filestoreIds[0]],"_blank")})})}catch(e){return Promise.reject(e)}}()}),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"}},S("PTR_PET_APPLICATION_DETAILS")),z&&z.length>0&&l.createElement(t.MultiLink,{className:"multilinkWrapper employee-mulitlink-main-div",onHeadClick:()=>R(!w),displayOptions:w,options:z,downloadBtnClassName:"employee-download-btn-className",optionsClassName:"employee-options-btn-className"})),l.createElement(hr,{applicationDetails:null==P?void 0:P.applicationData,isLoading:F,isDataLoading:F,applicationData:null==P||null===(y=P.applicationData)||void 0===y?void 0:y.applicationData,mutate:U,workflowDetails:j,businessService:k,moduleCode:"pet-services",showToast:D,setShowToast:x,closeToast:()=>{x(null)},timelineStatusPrefix:"PTR_COMMON_STATUS_",forcedActionPrefix:"EMPLOYEE_PTR",statusAttribute:"state",MenuStyle:{color:"#FFFFFF",fontSize:"18px"}}))});const _r=(e,t,n,l,r)=>r((l?"E":"C")+"S_PTR_RESPONSE_"+(t||"CREATE")+"_"+e+(n?"":"_ERROR")),yr=(e,t,n,l)=>_r("LABEL",e,t,n,l),Sr=e=>{var n,r,i,o,a,u,s,c,d,p,f,v,m;return l.createElement(t.Banner,{message:(p=(null==e||null===(n=e.data)||void 0===n||null===(r=n.PetRegistrationApplications)||void 0===r||null===(i=r[0])||void 0===i?void 0:i.applicationStatus)||e.action,f=e.isSuccess,v=e.isEmployee,m=e.t,_r("ACTION",p,f,v,m)),applicationNumber:null==e||null===(o=e.data)||void 0===o||null===(a=o.PetRegistrationApplications)||void 0===a||null===(u=a[0])||void 0===u?void 0:u.applicationNumber,info:yr((null===(s=e.data)||void 0===s||null===(c=s.PetRegistrationApplications)||void 0===c||null===(d=c[0])||void 0===d?void 0:d.applicationStatus)||e.action,e.isSuccess,e.isEmployee,e.t),successful:e.isSuccess})},br=e=>{const{t:t}=r.useTranslation();return t(null!=e&&e.isSuccess?"CS_PROPERTY_FEEDBACK_SUCCESS":"CS_PROPERTY_FEEDBACK_FAILED")},Tr=e=>l.createElement(t.Banner,{message:br(e),applicationNumber:"",style:e.isMobile?{width:"unset"}:{width:"740px"},successful:null==e?void 0:e.isSuccess}),Cr={PTRCheckPage:e=>{var o,a,u,s;let{onSubmit:c,value:d={}}=e;const{t:p}=r.useTranslation(),{address:v,pets:m,isEditPET:h,isUpdatePET:g,ownerss:_}=(i.useHistory(),d),y=h||g?"edit-application":"new-application",[S,b]=n.useState(!1);return l.createElement(l.Fragment,null,window.location.href.includes("/citizen")?l.createElement(E,{currentStep:5}):null,l.createElement(t.Card,null,l.createElement(t.CardHeader,null,p("PTR_CHECK_YOUR_DETAILS")),l.createElement("div",null,l.createElement("br",null),l.createElement(t.CardSubHeader,null,p("ES_TITILE_OWNER_DETAILS")),l.createElement("br",null),l.createElement(t.StatusTable,null,l.createElement(t.Row,{label:p("PTR_APPLICANT_NAME"),text:""+p(f(null==_?void 0:_.applicantName)),actionButton:l.createElement(N,{jumpTo:"/digit-ui/citizen/ptr/petservice/"+y+"/owners"})}),l.createElement(t.Row,{label:p("PTR_FATHER_HUSBAND_NAME"),text:""+p(f(null==_?void 0:_.fatherName)),actionButton:l.createElement(N,{jumpTo:"/digit-ui/citizen/ptr/petservice/"+y+"/owners"})}),l.createElement(t.Row,{label:p("PTR_MOBILE_NUMBER"),text:""+p(f(null==_?void 0:_.mobileNumber)),actionButton:l.createElement(N,{jumpTo:"/digit-ui/citizen/ptr/petservice/"+y+"/owners"})}),l.createElement(t.Row,{label:p("PTR_EMAIL_ID"),text:""+p(f(null==_?void 0:_.emailId)),actionButton:l.createElement(N,{jumpTo:"/digit-ui/citizen/ptr/petservice/"+y+"/owners"})})),l.createElement("br",null),l.createElement(t.CardSubHeader,null,p("ES_TITILE_PET_DETAILS")),l.createElement("br",null),l.createElement(t.StatusTable,null,l.createElement(t.Row,{label:p("PTR_SEARCH_PET_TYPE"),text:""+p(f(null==m||null===(o=m.petType)||void 0===o?void 0:o.value)),actionButton:l.createElement(N,{jumpTo:"/digit-ui/citizen/ptr/petservice/"+y+"/pet-details"})}),l.createElement(t.Row,{label:p("PTR_SEARCH_BREED_TYPE"),text:""+p(f(null==m||null===(a=m.breedType)||void 0===a?void 0:a.value)),actionButton:l.createElement(N,{jumpTo:"/digit-ui/citizen/ptr/petservice/"+y+"/pet-details"})}),l.createElement(t.Row,{label:p("PTR_PET_NAME"),text:""+p(f(null==m?void 0:m.petName)),actionButton:l.createElement(N,{jumpTo:"/digit-ui/citizen/ptr/petservice/"+y+"/pet-details"})}),l.createElement(t.Row,{label:p("PTR_DOCTOR_NAME"),text:""+p(f(null==m?void 0:m.doctorName)),actionButton:l.createElement(N,{jumpTo:"/digit-ui/citizen/ptr/petservice/"+y+"/pet-details"})}),l.createElement(t.Row,{label:p("PTR_CLINIC_NAME"),text:""+p(f(null==m?void 0:m.clinicName)),actionButton:l.createElement(N,{jumpTo:"/digit-ui/citizen/ptr/petservice/"+y+"/pet-details"})}),l.createElement(t.Row,{label:p("PTR_VACCINATED_DATE"),text:""+p(f(null==m?void 0:m.lastVaccineDate)),actionButton:l.createElement(N,{jumpTo:"/digit-ui/citizen/ptr/petservice/"+y+"/pet-details"})})),l.createElement("br",null),l.createElement(t.CardSubHeader,null,p("PTR_LOCATION_DETAILS")),l.createElement("br",null),l.createElement(t.StatusTable,null,l.createElement(t.Row,{label:p("PTR_HOUSE_NO"),text:""+p(f(null==v?void 0:v.doorNo)),actionButton:l.createElement(N,{jumpTo:"/digit-ui/citizen/ptr/petservice/"+y+"/street"})}),l.createElement(t.Row,{label:p("PTR_STREET_NAME"),text:""+p(f(null==v?void 0:v.street)),actionButton:l.createElement(N,{jumpTo:"/digit-ui/citizen/ptr/petservice/"+y+"/street"})}),l.createElement(t.Row,{label:p("PTR_ADDRESS_LINE1"),text:""+p(f(null==v?void 0:v.addressLine1)),actionButton:l.createElement(N,{jumpTo:"/digit-ui/citizen/ptr/petservice/"+y+"/street"})}),l.createElement(t.Row,{label:p("PTR_ADDRESS_PINCODE"),text:""+p(f(null==v?void 0:v.pincode)),actionButton:l.createElement(N,{jumpTo:"/digit-ui/citizen/ptr/petservice/"+y+"/pincode"})}),l.createElement(t.Row,{label:p("MYCITY_CODE_LABEL"),text:""+p(f(null==v||null===(u=v.city)||void 0===u?void 0:u.name)),actionButton:l.createElement(N,{jumpTo:"/digit-ui/citizen/ptr/petservice/"+y+"/address"})}),l.createElement(t.Row,{label:p("PTR_LOCALITY"),text:""+p(f(null==v||null===(s=v.locality)||void 0===s?void 0:s.name)),actionButton:l.createElement(N,{jumpTo:"/digit-ui/citizen/ptr/petservice/"+y+"/address"})})),l.createElement("br",null),l.createElement(t.CheckBox,{label:p("PTR_FINAL_DECLARATION_MESSAGE"),onChange:()=>{b(!S)},styles:{height:"auto"}})),l.createElement(t.SubmitBar,{label:p("PTR_COMMON_BUTTON_SUBMIT"),onSubmit:c,disabled:!S})))},PTRAcknowledgement:e=>{var o,a;let{data:s,onSuccess:c}=e;const{t:d}=r.useTranslation(),p=(Digit.ULBService.getCurrentTenantId(),Digit.Hooks.ptr.usePTRCreateAPI(null===(o=s.address)||void 0===o||null===(a=o.city)||void 0===a?void 0:a.code)),{data:f}=Digit.Hooks.useStore.getInitData(),{tenants:v}=(i.useRouteMatch(),f||{});return n.useEffect(()=>{try{var e,t;s.tenantId=null===(e=s.address)||void 0===e||null===(t=e.city)||void 0===t?void 0:t.code;let n=(e=>{var t;return e=(e=>{var t,n,l;let{pets:r}=e,i=u({},r,{petType:null==r||null===(t=r.petType)||void 0===t?void 0:t.value,breedType:null==r||null===(n=r.breedType)||void 0===n?void 0:n.value,petGender:null==r||null===(l=r.petGender)||void 0===l?void 0:l.name,clinicName:null==r?void 0:r.clinicName,petName:null==r?void 0:r.petName,doctorName:null==r?void 0:r.doctorName,lastVaccineDate:null==r?void 0:r.lastVaccineDate,petAge:null==r?void 0:r.petAge,vaccinationNumber:null==r?void 0:r.vaccinationNumber});return e.pets=i,e})(e=(e=>{var t,n,l;let{address:r}=e,i=u({},r,{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.doorNo,street:null==r?void 0:r.street,locality:{code:(null==r||null===(n=r.locality)||void 0===n?void 0:n.code)||"NA",area:null==r||null===(l=r.locality)||void 0===l?void 0:l.name}});return e.address=i,e})(e=(e=>{let{ownerss:t}=e,n=u({},t);return e.ownerss=n,e})(e=(e=>{let{documents:t}=e,n=u({},t);return e.documents=n,e})(e)))),{PetRegistrationApplications:[u({tenantId:e.tenantId},null===(t=e)||void 0===t?void 0:t.ownerss,{address:e.address,petDetails:e.pets},e.documents,{workflow:{businessService:"ptr",action:"APPLY",moduleName:"pet-services"}})]}})(s);p.mutate(n,{onSuccess:c})}catch(e){}},[]),p.isLoading||p.isIdle?l.createElement(t.Loader,null):l.createElement(t.Card,null,l.createElement(k,{t:d,data:p.data,isSuccess:p.isSuccess,isLoading:p.isIdle||p.isLoading}),l.createElement(t.StatusTable,null,p.isSuccess&&l.createElement(t.Row,{rowContainerStyle:L,last:!0,textStyle:{whiteSpace:"pre",width:"60%"}})),p.isSuccess&&l.createElement(t.SubmitBar,{label:d("PTR_PET_DOWNLOAD_ACK_FORM"),onSubmit:function(){try{const{PetRegistrationApplications:e=[]}=p.data;let t=e&&e[0]||{};const n=v.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,{to:"/digit-ui/citizen"},l.createElement(t.LinkButton,{label:d("CORE_COMMON_GO_TO_HOME")})))},PTRWFCaption:C,PTRWFReason: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))},PTRNewApplication:()=>{const e=Digit.ULBService.getCurrentTenantId(),{t:o}=(Digit.Hooks.ptr.useTenants(),r.useTranslation()),[a,s]=n.useState(!1),c=i.useHistory(),[d,p,f]=Digit.Hooks.useSessionStorage("store-data",null),[v,m,h]=Digit.Hooks.useSessionStorage("EMPLOYEE_MUTATION_HAPPENED",!1),[g,E,_]=Digit.Hooks.useSessionStorage("EMPLOYEE_MUTATION_SUCCESS_DATA",{});n.useEffect(()=>{m(!1),_()},[]);const y=Ze;return l.createElement(t.FormComposer,{heading:o("ES_TITLE_NEW_PET_REGISTARTION"),isDisabled:!a,label:o("ES_COMMON_APPLICATION_SUBMIT"),config:y.map(e=>u({},e,{body:e.body.filter(e=>!e.hideInEmployee)})),fieldStyle:{marginRight:0},onSubmit:t=>{var n,l,r,i,o,a,s,d,p,f,v,m,h;const g=[u({tenantId:e},null==t?void 0:t.owners[0],{petDetails:u({},null==t?void 0:t.pets[0],{petType:null==t||null===(n=t.pets[0])||void 0===n||null===(l=n.petType)||void 0===l?void 0:l.value,breedType:null==t||null===(r=t.pets[0])||void 0===r||null===(i=r.breedType)||void 0===i?void 0:i.value,petGender:null==t||null===(o=t.pets[0])||void 0===o||null===(a=o.petGender)||void 0===a?void 0:a.name}),address:u({},null==t?void 0:t.address,{city:null==t||null===(s=t.address)||void 0===s||null===(d=s.city)||void 0===d?void 0:d.name,locality:{code:null==t||null===(p=t.address)||void 0===p||null===(f=p.locality)||void 0===f?void 0:f.code,area:null==t||null===(v=t.address)||void 0===v||null===(m=v.locality)||void 0===m?void 0:m.area}}),documents:null==t||null===(h=t.documents)||void 0===h?void 0:h.documents,workflow:{businessService:"ptr",action:"APPLY",moduleName:"pet-services"}})];c.replace("/digit-ui/employee/ptr/petservice/response",{PetRegistrationApplications:g})},defaultValues:{},onFormValueChange:(e,t,n)=>{s(!Object.keys(n.errors).length)}})},ApplicationDetails:Er,PTRResponse:e=>{const{t:o}=r.useTranslation(),s=a.useQueryClient(),[c,d]=(i.useHistory(),n.useState(null)),[p,f]=n.useState(null),[v,m]=n.useState(!1),[h,g,E]=Digit.Hooks.useSessionStorage("EMPLOYEE_MUTATION_HAPPENED",!1),[_,y,S]=Digit.Hooks.useSessionStorage("EMPLOYEE_MUTATION_SUCCESS_DATA",!1),b=Digit.ULBService.getCurrentTenantId(),{state:T}=e.location,C=Digit.Hooks.ptr.usePTRCreateAPI(b,"UPDATE"!==T.key),A=Digit.Hooks.ptr.usePTRCreateAPI(b,!1),{data:D}=Digit.Hooks.useStore.getInitData(),{tenants:x}=D||{},{data:P}=Digit.Hooks.ptr.usePTRSearch({tenantId:b,filters:{applicationNumber:T.PetRegistrationApplications.applicationNumber,audit:!0}},{enabled:v,select:e=>{var t;return null===(t=e.PetRegistrationApplications)||void 0===t?void 0:t.filter(e=>"ACTIVE"===e.status)}});return n.useEffect(()=>{A.data&&A.isSuccess&&y(A.data)},[C.data]),n.useEffect(()=>{A.data&&A.isSuccess&&y(A.data)},[A.data]),n.useEffect(()=>{h||C.mutate({PetRegistrationApplications:null==T?void 0:T.PetRegistrationApplications},{onError:(e,t)=>{var n,l,r;f({key:"error"}),d((null==e||null===(n=e.response)||void 0===n||null===(l=n.data)||void 0===l||null===(r=l.Errors[0])||void 0===r?void 0:r.message)||null)},onSuccess:function(e){try{var t;return g(!0),s.clear(),"CREATE"===(null==e||null===(t=e.PetRegistrationApplications[0])||void 0===t?void 0:t.creationReason)&&m(!0),Promise.resolve()}catch(e){return Promise.reject(e)}}})},[]),C.isLoading||C.isIdle&&!h?l.createElement(t.Loader,null):l.createElement("div",null,l.createElement(t.Card,null,l.createElement(Sr,{t:o,data:(null==C?void 0:C.data)||_,action:null==T?void 0:T.action,isSuccess:!!Object.keys(_||{}).length||(null==C?void 0:C.isSuccess),isLoading:C.isIdle&&!h||(null==C?void 0:C.isLoading),isEmployee:e.parentRoute.includes("employee")}),l.createElement(t.CardText,null,((e,t,n,l)=>_r("DISPLAY",e,t,n,l))(T.action,(C.isSuccess||!!_)&&!C.isError,e.parentRoute.includes("employee"),o)),(C.isSuccess||!!_)&&!C.isError&&l.createElement(t.SubmitBar,{style:{overflow:"hidden"},label:o("PTR_DOWNLOAD_ACK_FORM"),onSubmit:function(){try{const{PetRegistrationApplications:e=[]}=C.data||_,t=e&&e[0]||{},n=x.find(e=>e.code===t.tenantId);return Promise.resolve(I(u({},t,{auditData:P}),n,o)).then(function(e){Digit.Utils.pdf.generate(e)})}catch(e){return Promise.reject(e)}}})),p&&l.createElement(t.Toast,{error:"error"===p.key,label:c,onClose:()=>{f(null),d(null)}}),l.createElement(t.ActionBar,null,l.createElement(i.Link,{to:e.parentRoute.includes("employee")?"/digit-ui/employee":"/digit-ui/citizen"},l.createElement(t.SubmitBar,{label:o("CORE_COMMON_GO_TO_HOME")}))))},PTRMyApplications:()=>{const{t:e}=r.useTranslation(),n=Digit.ULBService.getCitizenCurrentTenant(!0)||Digit.ULBService.getCurrentTenantId(),o=Digit.UserService.getUser().info;let a,u,s=window.location.href.split("/").pop();isNaN(parseInt(s))?a=4:(u=s,a=parseInt(s)+50);let c=isNaN(parseInt(s))?{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:c},{filters:c}),{PetRegistrationApplications:f}=p||{};let v=(null==f?void 0:f.length)>0?null==f?void 0:f.map(e=>null==e?void 0:e.applicationNumber):[],m={tenantId:n,referenceIds:v};const{isLoading:h,data:g}=Digit.Hooks.useFeedBackSearch({filters:{serviceSearchArgs:m}},{filters:{serviceSearchArgs:m},enabled:(null==v?void 0:v.length)>0,cacheTime:0});function E(t){var n;let l=null==g||null===(n=g.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")+" "+(f?"("+f.length+")":"")),l.createElement("div",null,(null==f?void 0:f.length)>0&&f.map((e,t)=>l.createElement("div",{key:t},l.createElement(M,{application:e,tenantId:null==o?void 0:o.permanentCity,buttonLabel:E(e)}))),!(null!=f&&f.length)>0&&l.createElement("p",{style:{marginLeft:"16px",marginTop:"16px"}},e("PTR_NO_APPLICATION_FOUND_MSG")),0!==(null==f?void 0:f.length)&&l.createElement("div",null,l.createElement("p",{style:{marginLeft:"16px",marginTop:"16px"}},l.createElement("span",{className:"link"},l.createElement(i.Link,{to:"/digit-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:"/digit-ui/citizen/ptr/petservice/new-application/info"},e("PTR_COMMON_CLICK_HERE_TO_REGISTER_NEW_PET")))))},PTRApplicationDetails:()=>{var e,o,a,c,d,p,f,v,m,h,g,E;const{t:_}=r.useTranslation(),{acknowledgementIds:y,tenantId:S}=(i.useHistory(),i.useParams()),[b,T]=n.useState([]),[C,D]=n.useState(!1),[x,P]=n.useState(!1),[N,w]=n.useState(null),{data:R}=Digit.Hooks.useStore.getInitData(),{tenants:O}=R||{},{isLoading:L,data:k}=Digit.Hooks.ptr.usePTRSearch({tenantId:S,filters:{applicationNumber:y}}),[M,F]=n.useState(null),B=Pe(k,"PetRegistrationApplications",[]),U=Pe(k,"PetRegistrationApplications[0].applicationNumber",[]);let j=B&&B.length>0&&B[0]||{};const H=j;sessionStorage.setItem("ptr-pet",JSON.stringify(H));const[W,z]=n.useState(!1);n.useEffect(()=>{!function(){try{z(!0),Promise.resolve(Digit.PaymentService.fetchBill(S,{businessService:"pet-services",consumerCode:y})).then(function(e){F(e),z(!1)})}catch(e){return Promise.reject(e)}}()},[S,y]);const{isLoading:V}=Digit.Hooks.ptr.usePTRSearch({tenantId:S,filters:{applicationNumber:U,audit:!0}},{enabled:!0}),{data:q,isLoading:G}=Digit.Hooks.useRecieptSearch({tenantId:S,businessService:"pet-services",consumerCodes:y,isEmployee:!1},{enabled:!!y});if(j.workflow||(j.workflow={id:null,tenantId:S,businessService:"pet-services",businessId:null==H?void 0:H.applicationNumber,action:"",moduleName:"pet-services",state:null,comment:null,documents:null,assignes:null}),L||V)return l.createElement(t.Loader,null);let K=_("CS_NA");if(null!=j&&null!==(e=j.additionalDetails)&&void 0!==e&&e.documentDate){var Y;const e=new Date(null==j||null===(Y=j.additionalDetails)||void 0===Y?void 0:Y.documentDate),t=Digit.Utils.date.monthNames[e.getMonth()];K=e.getDate()+" "+t+" "+e.getFullYear()}let $=[];return $.push({label:_("PTR_PET_DOWNLOAD_ACK_FORM"),onClick:()=>function(){try{const e=H||{},t=O.find(t=>t.code===e.tenantId);return Promise.resolve(I(u({},e),t,_)).then(function(e){Digit.Utils.pdf.generate(e)})}catch(e){return Promise.reject(e)}}()}),q&&(null==q?void 0:q.Payments.length)>0&&0==G&&$.push({label:_("PTR_FEE_RECIEPT"),onClick:()=>{var e;return function(e){let{tenantId:t,payments:n}=e;s(e,Ne);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==q||null===(e=q.Payments[0])||void 0===e?void 0:e.tenantId,payments:null==q?void 0:q.Payments[0]})}}),"DEPOSITED"===(null==q||null===(o=q.Payments[0])||void 0===o?void 0:o.paymentStatus)&&$.push({label:_("PTR_CERTIFICATE"),onClick:()=>function(){try{var e;return Promise.resolve(Digit.PaymentService.generatePdf(S,{PetRegistrationApplications:[null==k||null===(e=k.PetRegistrationApplications)||void 0===e?void 0:e[0]]},"petservicecertificate")).then(function(e){return Promise.resolve(Digit.PaymentService.printReciept(S,{fileStoreIds:e.filestoreIds[0]})).then(function(t){window.open(t[null==e?void 0:e.filestoreIds[0]],"_blank")})})}catch(e){return Promise.reject(e)}}()}),l.createElement(l.Fragment,null,l.createElement("div",null,l.createElement("div",{className:"cardHeaderWithOptions",style:{marginRight:"auto",maxWidth:"960px"}},l.createElement(t.Header,{styles:{fontSize:"32px"}},_("PTR_PET_APPLICATION_DETAILS")),$&&$.length>0&&l.createElement(t.MultiLink,{className:"multilinkWrapper",onHeadClick:()=>D(!C),displayOptions:C,options:$})),l.createElement(t.Card,null,l.createElement(t.StatusTable,null,l.createElement(t.Row,{className:"border-none",label:_("PTR_APPLICATION_NO_LABEL"),text:null==j?void 0:j.applicationNumber})),l.createElement(t.CardSubHeader,{style:{fontSize:"24px"}},_("PTR_ADDRESS_HEADER")),l.createElement(t.StatusTable,null,l.createElement(t.Row,{className:"border-none",label:_("PTR_PINCODE"),text:(null==j||null===(a=j.address)||void 0===a?void 0:a.pincode)||_("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:_("PTR_CITY"),text:(null==j||null===(c=j.address)||void 0===c?void 0:c.city)||_("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:_("PTR_STREET_NAME"),text:(null==j||null===(d=j.address)||void 0===d?void 0:d.street)||_("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:_("PTR_HOUSE_NO"),text:(null==j||null===(p=j.address)||void 0===p?void 0:p.doorNo)||_("CS_NA")})),l.createElement(t.CardSubHeader,{style:{fontSize:"24px"}},_("PTR_APPLICANT_DETAILS_HEADER")),l.createElement(t.StatusTable,null,l.createElement(t.Row,{className:"border-none",label:_("PTR_APPLICANT_NAME"),text:(null==j?void 0:j.applicantName)||_("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:_("PTR_FATHER/HUSBAND_NAME"),text:(null==j?void 0:j.fatherName)||_("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:_("PTR_APPLICANT_MOBILE_NO"),text:(null==j?void 0:j.mobileNumber)||_("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:_("PTR_APPLICANT_EMAILID"),text:(null==j?void 0:j.emailId)||_("CS_NA")})),l.createElement(t.CardSubHeader,{style:{fontSize:"24px"}},_("PTR_PET_DETAILS_HEADER")),l.createElement(t.StatusTable,null,l.createElement(t.Row,{className:"border-none",label:_("PTR_PET_TYPE"),text:(null==j||null===(f=j.petDetails)||void 0===f?void 0:f.petType)||_("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:_("PTR_BREED_TYPE"),text:(null==j||null===(v=j.petDetails)||void 0===v?void 0:v.breedType)||_("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:_("PTR_DOCTOR_NAME"),text:(null==j||null===(m=j.petDetails)||void 0===m?void 0:m.doctorName)||_("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:_("PTR_CLINIC_NAME"),text:(null==j||null===(h=j.petDetails)||void 0===h?void 0:h.clinicName)||_("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:_("PTR_VACCINATED_DATE"),text:(null==j||null===(g=j.petDetails)||void 0===g?void 0:g.lastVaccineDate)||_("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:_("PTR_VACCINATION_NUMBER"),text:(null==j||null===(E=j.petDetails)||void 0===E?void 0:E.vaccinationNumber)||_("CS_NA")})),l.createElement(A,{application:H,id:null==H?void 0:H.applicationNumber,userType:"citizen"}),N&&l.createElement(t.Toast,{error:N.key,label:_(N.label),style:{bottom:"0px"},onClose:()=>{w(null)}})),x&&l.createElement(PTCitizenFeedbackPopUp,{setpopup:P,setShowToast:w,data:k})))},SelectOtp:e=>{let{config:r,otp:i,onOtpChange:o,onResend:a,onSelect:s,t:c,error:d,userType:p="citizen",canSubmit:f}=e;const[v,m]=n.useState(30),h={type:"register"},[g,E]=n.useState(!1);!function(e,t){const l=n.useRef();n.useEffect(()=>{l.current=e},[e]),n.useEffect(()=>{if(null!==t){const e=setInterval(function(){l.current()},t);return()=>clearInterval(e)}},[t])}(()=>{m(v-1)},v>0?1e3:null),n.useEffect(function(){try{if(window.location.href.includes("code")){let e=window.location.href.split("=")[1].split("&")[0],t={code_verifier:sessionStorage.getItem("code_verfier_register"),code:e,module:"REGISTER"};console.log("token",e,t,sessionStorage.getItem("code_verfier_register")),fetch("https://api.digitallocker.gov.in/public/oauth2/1/token",{method:"POST",mode:"cors",headers:{"Content-Type":"application/x-www-form-urlencoded","Access-Control-Allow-Origin":"*","Access-Control-Allow-Methods":"PUT, DELETE,POST"},body:new URLSearchParams({code:e,grant_type:"authorization_code",client_id:"YN77ADDADE",client_secret:"71abd480b5811ab72277",redirect_uri:"http://localhost:3001/digit-ui/citizen/login/otp",code_verifier:sessionStorage.getItem("code_verfier_register")})}).then(e=>{e.json().then(e=>_(e))})}return Promise.resolve()}catch(e){return Promise.reject(e)}},[]);const _=function(e){try{console.log("registerUser",e);const t={dob:"1998-02-03",mobileNumber:e.mobile,name:e.name,tenantId:"pg",userType:Digit.UserService.getType()};return Promise.resolve(S({otp:u({},t,h)})).then(function(e){null!=e&&e[1]&&(console.log("gggg",null==e?void 0:e[1],typeof(null==e?void 0:e[1])),E(!0),setTimeout(()=>{window.location.href=window.location.href.split("/otp")[0]},3e3))})}catch(e){return Promise.reject(e)}},y=()=>{a(),m(2)},S=function(e){return Promise.resolve(Je(function(){return console.log("sendOtpsendOtp",e),Promise.resolve(Digit.UserService.sendOtp(e,"pg")).then(function(e){return[e,null]})},function(e){return[null,e]}))};return"employee"===p?l.createElement(n.Fragment,null,l.createElement(t.OTPInput,{length:6,onChange:o,value:i}),v>0?l.createElement(t.CardText,null,c("CS_RESEND_ANOTHER_OTP")+" "+v+" "+c("CS_RESEND_SECONDS")):l.createElement("p",{className:"card-text-button",onClick:y},c("CS_RESEND_OTP")),!d&&l.createElement(t.CardLabelError,null,c("CS_INVALID_OTP"))):l.createElement(t.FormStep,{onSelect:s,config:r,t:c,isDisabled:!(6===(null==i?void 0:i.length)&&f)},l.createElement(t.OTPInput,{length:6,onChange:o,value:i}),v>0?l.createElement(t.CardText,null,c("CS_RESEND_ANOTHER_OTP")+" "+v+" "+c("CS_RESEND_SECONDS")):l.createElement("p",{className:"card-text-button",onClick:y},c("CS_RESEND_OTP")),!d&&l.createElement(t.CardLabelError,null,c("CS_INVALID_OTP")),!g&&l.createElement(t.CardLabelError,null,c("CS_ALREADY_REGISTERED")))},AcknowledgementCF:e=>{var n,o,a,u,s,c,d,p,f;const{t:v}=r.useTranslation(),m=(Digit.ULBService.getCurrentTenantId(),i.useLocation()),h=(Digit.Hooks.useStore.getInitData(),window.Digit.Utils.browser.isMobile());return l.createElement("form",null,l.createElement(t.Card,{style:h?{padding:"unset"}:{}},l.createElement(Tr,{t:v,data:m.state,isSuccess:!(null===(n=m.state)||void 0===n||null===(o=n.result)||void 0===o||null===(a=o.Service)||void 0===a||!a[0]),isMobile:h,isLoading:!1}),(null===(u=m.state)||void 0===u||null===(s=u.result)||void 0===s||null===(c=s.Service)||void 0===c?void 0:c[0])&&l.createElement(t.CardText,{style:{padding:"0px 10px 0px 10px"}},v("CS_CF_FEEDBACK_RESPONSE")),!(null!==(d=m.state)&&void 0!==d&&null!==(p=d.result)&&void 0!==p&&null!==(f=p.Service)&&void 0!==f&&f[0])&&l.createElement(t.CardText,null,v("CS_FILE_PROPERTY_FAILED_RESPONSE")),l.createElement("div",{style:{padding:"0px 10px 20px 10px"}},l.createElement(i.Link,{to:"/digit-ui/citizen"},l.createElement(t.SubmitBar,{label:v("CS_COMMON_GO_BACK_TO_HOME")})))))},CitizenFeedback:e=>{var o,a,s,c;let{popup:d=!1,onClose:p,setShowToast:f,data:v}=e;const{t:m}=r.useTranslation(),h=i.useHistory(),g=Digit.UserService.getUser();let{redirectedFrom:E,propertyId:_,acknowldgementNumber:y,creationReason:S,tenantId:b,locality:T}=Digit.Hooks.useQueryParams();const C=window.Digit.Utils.browser.isMobile();b=b||Digit.ULBService.getCurrentTenantId();const A=Digit.ULBService.getStateId(),{data:D,isLoading:x}=Digit.Hooks.pt.useRatingAndFeedbackMDMS.RatingAndFeedBack(A),[P,N]=n.useState(""),[w,R]=n.useState(0);if(x)return l.createElement(t.Loader,null);const I=e=>{var t,n;let l=null==D||null===(t=D.enabledScreensList)||void 0===t||null===(n=t.filter(e=>{var t,n,l;return"PT"===(null==e?void 0:e.module)&&((null==E?void 0:E.includes(null==e?void 0:e.screenfrom))||(null==e||null===(t=e.bussinessService)||void 0===t?void 0:t.includes(null==v||null===(n=v.Properties)||void 0===n||null===(l=n[0])||void 0===l?void 0:l.creationReason)))}))||void 0===n?void 0:n[0];return"Header"===e?null==l?void 0:l.cardHeader:"Text"===e?null==l?void 0:l.cardText:void 0};return l.createElement(l.Fragment,null,l.createElement("form",null,l.createElement(t.Card,null,l.createElement("div",{style:d?{display:"flex",justifyContent:"space-between"}:{}},l.createElement(t.CardHeader,null,m(I("Header"))||m("PT_RATE_HELP_TEXT")),d&&l.createElement("span",{style:{marginTop:"8px"},onClick:()=>p(!1)},l.createElement(t.CloseSvg,null))),l.createElement(t.CardText,null,m(I("Text"),{acknowldgementNumber:y||(null==v||null===(o=v.Properties)||void 0===o||null===(a=o[0])||void 0===a?void 0:a.acknowldgementNumber),propertyId:_||(null==v||null===(s=v.Properties)||void 0===s||null===(c=s[0])||void 0===c?void 0:c.propertyId)})||m("PT_RATE_TEXT")),l.createElement(t.Rating,{styles:{justifyContent:"center"},currentRating:w,maxRating:5,onFeedback:(e,t,n)=>{R(n)}}),0!==w&&l.createElement("div",null,l.createElement(t.CardLabel,null,m((null==D||null===(O=D.headerByRating)||void 0===O||null===(L=O.filter(e=>w>=(null==e?void 0:e.minvalue)&&w<=(null==e?void 0:e.maxvalue)))||void 0===L||null===(k=L[0])||void 0===k?void 0:k.code)||m("CS_WHAT_WENT_WRONG"))),l.createElement(t.TextArea,{name:"",minLength:"64",onChange:e=>{N(e.target.value)}}),P&&(null==P?void 0:P.length)<64&&l.createElement(t.CardLabelError,{style:{marginTop:"-20px",marginBottom:"25px"}},m("CS_MIN_LENGTH_64"))),l.createElement(t.SubmitBar,{label:m("PT_SUBMIT"),onSubmit:()=>{var e,t,n,l;let r={},i={tenantId:(null==v||null===(e=v.Properties)||void 0===e||null===(t=e[0])||void 0===t?void 0:t.tenantId)||b,code:["PT_"+(null!=E&&E.includes("payment")?"PAYMENT":S||(null==v||null===(n=v.Properties)||void 0===n||null===(l=n[0])||void 0===l?void 0:l.creationReason))],module:["PT"]};Digit.PTService.cfdefinitionsearch({filters:{ServiceDefinitionCriteria:i}}).then((e,t)=>{var n,l,i,o,a,s,c,m,E,S,C,A,D,x;(null==e||null===(n=e.ServiceDefinition)||void 0===n?void 0:n.length)>0&&(r={tenantId:(null==v||null===(l=v.Properties)||void 0===l||null===(i=l[0])||void 0===i?void 0:i.tenantId)||b,serviceDefId:null==e||null===(o=e.ServiceDefinition)||void 0===o||null===(a=o[0])||void 0===a?void 0:a.id,isActive:!0,attributes:[{attributeCode:"consumerCode",value:_||(null==v||null===(s=v.Properties)||void 0===s||null===(c=s[0])||void 0===c?void 0:c.propertyId),additionalDetails:{}},{attributeCode:"rating",value:w,additionalDetails:{}},{attributeCode:"comments",value:P,additionalDetails:{}},{attributeCode:"channel",value:"Online",additionalDetails:{}}],additionalDetails:{locality:T||(null==v||null===(m=v.Properties)||void 0===m||null===(E=m[0])||void 0===E||null===(S=E.address)||void 0===S||null===(C=S.locality)||void 0===C?void 0:C.code)||""},accountId:null==g||null===(A=g.info)||void 0===A?void 0:A.uuid},r=u({},r,{referenceId:y||(null==v||null===(D=v.Properties)||void 0===D||null===(x=D[0])||void 0===x?void 0:x.acknowldgementNumber)}),Digit.PTService.cfcreate({Service:u({},r)},b).then((e,t)=>{var n;(null==e||null===(n=e.Service)||void 0===n?void 0:n.length)>0&&(d?(p(!1),f({key:!1,label:"PT_FEEDBACK_SUBMITTED_SUCCESSFULLY"})):h.push({pathname:"/digit-ui/citizen/feedback-acknowledgement",state:{rating:w,comment:P,result:e}}))}).catch(e=>{var t,n,l;f({key:"error",label:""+(null==e||null===(t=e.response)||void 0===t||null===(n=t.data)||void 0===n||null===(l=n.Errors[0])||void 0===l?void 0:l.message)})}))})},disabled:!!(P&&(null==P?void 0:P.length)<64)||!w}),!d&&l.createElement("div",{className:"link",style:C?{marginTop:"8px",width:"100%",textAlign:"center"}:{marginTop:"8px"}},l.createElement(i.Link,{to:"/digit-ui/citizen"},m("CS_GO_BACK_HOME"))))));var O,L,k},PTRPetdetails:e=>{let{config:t,onSelect:o,formData:a,setError:s,formState:c,clearErrors:d}=e;const{t:p}=r.useTranslation(),[f,v]=(i.useLocation(),n.useState((null==a?void 0:a.pets)||[{doctorName:"",vaccinationNumber:"",lastVaccineDate:"",petAge:"",petType:"",breedType:"",clinicName:"",petName:"",petGender:"",key:Date.now()}])),[h,g]=n.useState({index:-1,type:""}),E=(Digit.ULBService.getCurrentTenantId(),Digit.ULBService.getStateId()),{data:_}=Digit.Hooks.ptr.usePTRPetMDMS(E,"PetService","PetType"),{data:y}=Digit.Hooks.ptr.useBreedTypeMDMS(E,"PetService","BreedType");let S=[],b=[];_&&_.map(e=>{S.push({i18nKey:"PTR_PET_"+e.code,code:""+e.code,value:""+e.name})}),y&&y.map(e=>{var t,n;e.PetType==(null===(t=f[0])||void 0===t||null===(n=t.petType)||void 0===n?void 0:n.code)&&b.push({i18nKey:"PTR_BREED_TYPE_"+e.code,code:""+e.code,value:""+e.name})});const{data:T}=Digit.Hooks.ptr.usePTRGenderMDMS(E,"common-masters","GenderType");let C=[];T&&T.map(e=>{"TRANSGENDER"!==e.code&&C.push({i18nKey:"PTR_GENDER_"+e.code,code:""+e.code,name:""+e.code})}),n.useEffect(()=>{o(null==t?void 0:t.key,f)},[f]);const A={focusIndex:h,allOwners:f,setFocusIndex:g,formData:a,formState:c,setPets:v,t:p,setError:s,clearErrors:d,config:t,menu:S,breed_type:b,pet_sex:C};return l.createElement(l.Fragment,null,f.map((e,t)=>l.createElement(m,u({key:e.key,index:t,pets:e},A))))},PTROwnerDetails:e=>{let{config:t,onSelect:o,formData:a,setError:s,formState:c,clearErrors:d}=e;const{t:p}=r.useTranslation(),[f,v]=(i.useLocation(),n.useState((null==a?void 0:a.owners)||[{applicantName:"",mobileNumber:"",fatherName:"",emailId:"",alternateNumber:"",key:Date.now()}])),[m,g]=n.useState({index:-1,type:""});Digit.ULBService.getCurrentTenantId(),Digit.ULBService.getStateId(),n.useEffect(()=>{o(null==t?void 0:t.key,f)},[f]);const E={focusIndex:m,allOwners:f,setFocusIndex:g,formData:a,formState:c,setOwners:v,t:p,setError:s,clearErrors:d,config:t};return l.createElement(l.Fragment,null,f.map((e,t)=>l.createElement(h,u({key:e.key,index:t,owner:e},E))))},PTRCreatePet:e=>{var n,o,s,c;const d=a.useQueryClient(),p=i.useRouteMatch(),{t:f}=r.useTranslation(),{pathname:v}=i.useLocation(),m=i.useHistory(),h=Digit.ULBService.getStateId();let g=[];const[E,_,y]=Digit.Hooks.useSessionStorage("PTR_CREATE_PET",{});let{data:S,isLoading:T}=Digit.Hooks.pt.useMDMS(h,"PropertyTax","CommonFieldsConfig");function C(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=v.split("/").pop(),o=i.charAt(i.length-1),a=!1;Number(parseInt(i))||"0"==i||"-1"==i?"-1"==i||"-2"==i?(i=v.slice(0,-3),i=i.split("/").pop(),a=!0):(i=v.slice(0,-2),i=i.split("/").pop(),a=!0):a=!1,isNaN(o)||(a=!0);let{nextStep:u={}}=g.find(e=>e.route===(i||"0")),s=m.push;if(e&&(s=m.replace),n&&(u=l),null===u)return s(p.path+"/check");r=isNaN(u.split("/").pop())&&a&&"map"!==u?p.path+"/"+u+"/"+t:p.path+"/"+u,s(r)})(n,l,r,e)}E&&Object.keys(E).length>0&&window.location.href.includes("/info")&&"true"!==sessionStorage.getItem("docReqScreenByBack")&&(y(),d.invalidateQueries("PTR_CREATE_PET"));const A=()=>{},D=()=>{};if(T)return l.createElement(t.Loader,null);S=b,S.forEach(e=>{g=g.concat(e.body.filter(e=>!e.hideInCitizen))}),g.indexRoute="info";const x=null===(n=Digit)||void 0===n||null===(o=n.ComponentRegistryService)||void 0===o?void 0:o.getComponent("PTRCheckPage"),P=null===(s=Digit)||void 0===s||null===(c=s.ComponentRegistryService)||void 0===c?void 0:c.getComponent("PTRAcknowledgement");return l.createElement(i.Switch,null,g.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:C,onSkip:A,t:f,formData:E,onAdd:D}))}),l.createElement(i.Route,{path:p.path+"/check"},l.createElement(x,{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(P,{data:E,onSuccess:()=>{y(),d.invalidateQueries("PTR_CREATE_PET")}})),l.createElement(i.Route,null,l.createElement(i.Redirect,{to:p.path+"/"+g.indexRoute})))},PTRDocumentUpload:e=>{var r,o;let{t:a,config:s,onSelect:c,formData:d,setError:p,clearErrors:f,formState:v}=e;Digit.ULBService.getCurrentTenantId();const m=Digit.ULBService.getStateId(),[h,g]=n.useState((null==d||null===(r=d.documents)||void 0===r?void 0:r.documents)||[]),[E,_]=n.useState(null);i.useLocation();const{isLoading:y,data:b}=Digit.Hooks.ptr.usePetMDMS(m,"PetService","Documents"),T=null==b||null===(o=b.PetService)||void 0===o?void 0:o.Documents.map(e=>u({},e,{hasDropdown:!0}));return n.useEffect(()=>{c(s.key,{documents:h,PTRDocumentLength:null==T?void 0:T.length})},[h]),y?l.createElement(t.Loader,null):l.createElement("div",null,null==T?void 0:T.map((e,t)=>l.createElement(S,{key:t,document:e,action:"create",t:a,id:"ptr-document-"+t,error:E,setError:_,setDocuments:g,accept:".pdf, .jpeg, .jpg, .png",documents:h,formData:d,setFormError:p,clearFormErrors:f,config:s,formState:v})),E&&l.createElement(t.Toast,{label:E,onClose:()=>_(null),error:!0}))},PTRSelectStreet:e=>{let{t:r,config:i,onSelect:a,userType:s,formData:c,formState:d,setError:f,clearErrors:v}=e;const[m,h]=n.useState({index:-1,type:""}),{control:g,formState:E,watch:_,trigger:y}=o.useForm(),S=_(),{errors:b}=E,T=window.location.href.includes("ptr/petservice/new-application");let C;var A;return C=[{label:"PTR_STREET_NAME",type:"text",name:"street",validation:{}},{label:"PTR_HOUSE_NO",type:"text",name:"doorNo",validation:{}},{label:"PTR_HOUSE_NAME",type:"text",name:"buildingName",validation:{}},{label:"PTR_ADDRESS_LINE1",type:"text",name:"addressLine1",validation:{}},{label:"PTR_ADDRESS_LINE2",type:"text",name:"addressLine2",validation:{}},{label:"PTR_landmark",type:"text",name:"landmark",validation:{}}],n.useEffect(()=>{y()},[]),n.useEffect(()=>{var e;"employee"===s&&(Object.keys(b).length&&!p.isEqual((null===(e=d.errors[i.key])||void 0===e?void 0:e.type)||{},b)?f(i.key,{type:b}):!Object.keys(b).length&&d.errors[i.key]&&v(i.key))},[b]),n.useEffect(()=>{const e=Object.keys(S),t={};e.forEach(e=>{var n;return t[e]=null===(n=c[i.key])||void 0===n?void 0:n[e]}),p.isEqual(S,t)||(a(i.key,u({},c[i.key],S)),y())},[S]),"employee"===s?null===(A=C)||void 0===A?void 0:A.map((e,n)=>{var a;return l.createElement(t.LabelFieldPair,{key:n},l.createElement(t.CardLabel,{className:"card-label-smaller"},T?r(e.label)+":":r(e.label),i.isMandatory?" * ":null),l.createElement("div",{className:"field"},l.createElement(o.Controller,{control:g,defaultValue:null==c||null===(a=c.address)||void 0===a?void 0:a[e.name],name:e.name,rules:{validate:{pattern:e=>!!/^[A-Za-z]+( +[A-Za-z]+)*$/.test(e)||r("ERR_DEFAULT_INPUT_FIELD_MSG")}},render:r=>l.createElement(t.TextInput,u({id:e.name,key:e.name,value:r.value,onChange:e=>{h({index:n}),r.onChange(e.target.value)},onBlur:r.onBlur,autoFocus:(null==m?void 0:m.index)==n},e.validation))})))}):l.createElement(l.Fragment,null,l.createElement(t.FormStep,{config:u({},i,{inputs:C}),_defaultValues:{street:null==c?void 0:c.address.street,doorNo:null==c?void 0:c.address.doorNo},onSelect:e=>a(i.key,e),onSkip:()=>a(),t:r}))},PTRCitizenDetails:e=>{var r,o,a,s,c;let{t:d,config:p,onSelect:f,userType:v,formData:m}=e;i.useLocation();let h={};const[g,_]=n.useState(m.ownerss&&m.ownerss[0]&&m.ownerss[0].applicantName||(null==m||null===(r=m.ownerss)||void 0===r?void 0:r.applicantName)||""),[y,S]=n.useState(m.ownerss&&m.ownerss[0]&&m.ownerss[0].emailId||(null==m||null===(o=m.ownerss)||void 0===o?void 0:o.emailId)||""),[b,T]=n.useState(m.ownerss&&m.ownerss[0]&&m.ownerss[0].mobileNumber||(null==m||null===(a=m.ownerss)||void 0===a?void 0:a.mobileNumber)||""),[C,A]=n.useState(m.ownerss&&m.ownerss[0]&&m.ownerss[0].alternateNumber||(null==m||null===(s=m.ownerss)||void 0===s?void 0:s.alternateNumber)||""),[D,x]=n.useState(m.ownerss&&m.ownerss[0]&&m.ownerss[0].fatherName||(null==m||null===(c=m.ownerss)||void 0===c?void 0:c.fatherName)||"");Digit.ULBService.getCurrentTenantId(),Digit.ULBService.getStateId();const P=()=>{let e,t=m.ownerss&&m.ownerss[0];"citizen"===v?(e=u({},t,{applicantName:g,mobileNumber:b,alternateNumber:C,fatherName:D,emailId:y}),f(p.key,u({},m[p.key],e),!1,0)):(e=u({},t,{applicantName:g,mobileNumber:b,alternateNumber:C,fatherName:D,emailId:y}),f(p.key,e,!1,0))};return n.useEffect(()=>{"citizen"===v&&P()},[g,b,D,y]),l.createElement(l.Fragment,null,window.location.href.includes("/citizen")?l.createElement(E,{currentStep:1}):null,l.createElement(t.FormStep,{config:p,onSelect:P,onSkip:()=>f(),t:d,isDisabled:!(g&&b&&D&&y)},l.createElement("div",null,l.createElement(t.CardLabel,null,""+d("PTR_APPLICANT_NAME")),l.createElement(t.TextInput,u({t:d,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"applicantName",value:g,onChange:function(e){_(e.target.value)},ValidationRequired:!0},h={isRequired:!0,pattern:"^[a-zA-Z ]+$",type:"tel",title:d("PT_NAME_ERROR_MESSAGE")})),l.createElement(t.CardLabel,null,""+d("PTR_MOBILE_NUMBER")),l.createElement(t.MobileNumber,{value:b,name:"mobileNumber",onChange:e=>{T({value:e}.value)},required:!0,pattern:"[6-9]{1}[0-9]{9}",type:"tel",title:d("CORE_COMMON_APPLICANT_MOBILE_NUMBER_INVALID")}),l.createElement(t.CardLabel,null,""+d("PTR_ALT_MOBILE_NUMBER")),l.createElement(t.MobileNumber,{value:C,name:"alternateNumber",onChange:e=>{A({value:e}.value)},required:!1,pattern:"[6-9]{1}[0-9]{9}",type:"tel",title:d("CORE_COMMON_APPLICANT_MOBILE_NUMBER_INVALID")}),l.createElement(t.CardLabel,null,""+d("PTR_FATHER_HUSBAND_NAME")),l.createElement(t.TextInput,u({t:d,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"fatherName",value:D,onChange:function(e){x(e.target.value)},ValidationRequired:!0},h={isRequired:!0,pattern:"^[a-zA-Z-.`' ]*$",type:"text",title:d("PTR_NAME_ERROR_MESSAGE")})),l.createElement(t.CardLabel,null,""+d("PTR_EMAIL_ID")),l.createElement(t.TextInput,u({t:d,type:"text",isMandatory:!0,optionKey:"i18nKey",name:"emailId",value:y,onChange:function(e){S(e.target.value)},ValidationRequired:!0},h={isRequired:!0,pattern:"[a-z0-9._%+-]+@[a-z0-9.-]+.[a-z]{2,}$",type:"text",title:d("PTR_NAME_ERROR_MESSAGE")})))))},PTRCitizenPet:e=>{var r,a,s,c,d,p,f,v,m;let{t:h,config:g,onSelect:_,userType:y,formData:S}=e;i.useLocation();let b=window.location.href.charAt(window.location.href.length-1),T={};const[C,A]=n.useState(S.pets&&S.pets[b]&&S.pets[b].petType||(null==S||null===(r=S.pets)||void 0===r?void 0:r.petType)||""),[D,x]=n.useState(S.pets&&S.pets[b]&&S.pets[b].breedType||(null==S||null===(a=S.pets)||void 0===a?void 0:a.breedType)||""),[P,N]=n.useState(S.pets&&S.pets[b]&&S.pets[b].petGender||(null==S||null===(s=S.pets)||void 0===s?void 0:s.petGender)||""),[w,R]=n.useState(S.pets&&S.pets[b]&&S.pets[b].petName||(null==S||null===(c=S.pets)||void 0===c?void 0:c.petName)||""),[I,O]=n.useState(S.pets&&S.pets[b]&&S.pets[b].petAge||(null==S||null===(d=S.pets)||void 0===d?void 0:d.petAge)||""),[L,k]=n.useState(S.pets&&S.pets[b]&&S.pets[b].doctorName||(null==S||null===(p=S.pets)||void 0===p?void 0:p.doctorName)||""),[M,F]=n.useState(S.pets&&S.pets[b]&&S.pets[b].clinicName||(null==S||null===(f=S.pets)||void 0===f?void 0:f.clinicName)||""),[B,U]=n.useState(S.pets&&S.pets[b]&&S.pets[b].vaccinationNumber||(null==S||null===(v=S.pets)||void 0===v?void 0:v.vaccinationNumber)||""),[j,H]=n.useState(S.pets&&S.pets[b]&&S.pets[b].lastVaccineDate||(null==S||null===(m=S.pets)||void 0===m?void 0:m.lastVaccineDate)||""),W=(Digit.ULBService.getCurrentTenantId(),Digit.ULBService.getStateId()),{data:z}=Digit.Hooks.ptr.usePTRPetMDMS(W,"PetService","PetType"),{data:V}=Digit.Hooks.ptr.useBreedTypeMDMS(W,"PetService","BreedType");let q=[],G=[];z&&z.map(e=>{q.push({i18nKey:"PTR_PET_"+e.code,code:""+e.code,value:""+e.name})});const{control:K}=o.useForm();V&&V.map(e=>{e.PetType==(null==C?void 0:C.code)&&G.push({i18nKey:"PTR_BREED_TYPE_"+e.code,code:""+e.code,value:""+e.name})});const{data:Y}=Digit.Hooks.ptr.usePTRGenderMDMS(W,"common-masters","GenderType");let $=[];Y&&Y.map(e=>{"TRANSGENDER"!==e.code&&$.push({i18nKey:"PTR_GENDER_"+e.code,code:""+e.code,name:""+e.code})});const X=()=>{let e,t=S.pets&&S.pets[b];"citizen"===y?(e=u({},t,{petType:C,breedType:D,petGender:P,petName:w,petAge:I,doctorName:L,clinicName:M,lastVaccineDate:j,vaccinationNumber:B}),_(g.key,u({},S[g.key],e),!1,b)):(e=u({},t,{petType:C,breedType:D,petGender:P,petName:w,petAge:I,doctorName:L,clinicName:M,lastVaccineDate:j,vaccinationNumber:B}),_(g.key,e,!1,b))};return n.useEffect(()=>{"citizen"===y&&X()},[C,D,P,w,I,L,j]),l.createElement(l.Fragment,null,window.location.href.includes("/citizen")?l.createElement(E,{currentStep:2}):null,l.createElement(t.FormStep,{config:g,onSelect:X,onSkip:()=>_(),t:h,isDisabled:!(C&&D&&P&&w&&I&&L&&M&&j&&B)},l.createElement("div",null,l.createElement(t.CardLabel,null,""+h("PTR_SEARCH_PET_TYPE")),l.createElement(o.Controller,{control:K,name:"petType",defaultValue:C,rules:{required:h("CORE_COMMON_REQUIRED_ERRMSG")},render:e=>l.createElement(t.Dropdown,{className:"form-field",selected:C,select:A,option:q,optionKey:"i18nKey",t:h})}),l.createElement(t.CardLabel,null,""+h("PTR_SEARCH_BREED_TYPE")),l.createElement(o.Controller,{control:K,name:"breedType",defaultValue:D,rules:{required:h("CORE_COMMON_REQUIRED_ERRMSG")},render:e=>l.createElement(t.Dropdown,{className:"form-field",selected:D,select:x,option:G,optionKey:"i18nKey",t:h})}),l.createElement(t.CardLabel,null,""+h("PTR_PET_NAME")),l.createElement(t.TextInput,u({t:h,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"petName",value:w,onChange:function(e){R(e.target.value)},style:{width:"86%"},ValidationRequired:!1},T={isRequired:!0,pattern:"^[a-zA-Z-.`' ]*$",type:"text",title:h("PT_NAME_ERROR_MESSAGE")})),l.createElement(t.CardLabel,null,""+h("PTR_PET_SEX")),l.createElement(o.Controller,{control:K,name:"petGender",defaultValue:P,rules:{required:h("CORE_COMMON_REQUIRED_ERRMSG")},render:e=>l.createElement(t.Dropdown,{className:"form-field",selected:P,select:N,option:$,optionKey:"i18nKey",t:h})}),l.createElement(t.CardLabel,null,""+h("PTR_PET_AGE")),l.createElement(t.TextInput,{t:h,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"petAge",value:I,onChange:function(e){O(e.target.value)},style:{width:"86%"},placeholder:"in months",rules:{required:h("CORE_COMMON_REQUIRED_ERRMSG"),validate:e=>!!/^[0123456789]\d{2}$/.test(e)||h("ERR_DEFAULT_INPUT_FIELD_MSG")}}),l.createElement("div",null,Math.floor(I/12)," ",1===Math.floor(I/12)?"YEAR":"YEARS"," ",I%12," ",I%12==1?"MONTH":"MONTHS"),l.createElement("br",null),l.createElement(t.CardLabel,null,""+h("PTR_DOCTOR_NAME")),l.createElement(t.TextInput,u({t:h,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"doctorName",value:L,onChange:function(e){k(e.target.value)},style:{width:"86%"},ValidationRequired:!1},T={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(t.TextInput,u({t:h,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"clinicName",value:M,onChange:function(e){F(e.target.value)},style:{width:"86%"},ValidationRequired:!1},T={isRequired:!0,pattern:"^[a-zA-Z-.`' ]*$",type:"text",title:h("PT_NAME_ERROR_MESSAGE")})),l.createElement(t.CardLabel,null,""+h("PTR_VACCINATED_DATE")),l.createElement(t.TextInput,{t:h,type:"date",isMandatory:!1,optionKey:"i18nKey",name:"lastVaccineDate",value:j,onChange:function(e){H(e.target.value)},style:{width:"86%"},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(t.TextInput,{t:h,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"vaccinationNumber",value:B,onChange:function(e){U(e.target.value)},style:{width:"86%"}}))))},PTRCitizenAddress:e=>{let{t:r,config:i,onSelect:a,userType:s,formData:c,formState:d,setError:f,clearErrors:v}=e;const[m,h]=n.useState({index:-1,type:""}),{control:g,formState:_,watch:y,trigger:S}=o.useForm(),b=y(),{errors:T}=_,C=window.location.href.includes("ptr/petservice/new-application");let A;A=[{label:"PTR_STREET_NAME",type:"text",name:"street",validation:{pattern:"[a-zA-Z0-9 !@#$%^&*()_+-={};':\\\\|,.<>/?]{1,64}",title:r("CORE_COMMON_STREET_INVALID")}},{label:"PTR_HOUSE_NO",type:"text",name:"doorNo",validation:{pattern:"[a-zA-Z0-9 !@#$%^&*()_+-={};':\\\\|,.<>/?]{1,64}",title:r("CORE_COMMON_DOOR_INVALID")}},{label:"PTR_HOUSE_NAME",type:"text",name:"buildingName",validation:{pattern:"[a-zA-Z0-9 !@#$%^&*()_+-={};':\\\\|,.<>/?]{1,64}",title:r("CORE_COMMON_DOOR_INVALID")}},{label:"PTR_ADDRESS_LINE1",type:"text",name:"addressLine1",validation:{pattern:"[a-zA-Z0-9 !@#$%^&*()_+-={};':\\\\|,.<>/?]{1,64}",title:r("CORE_COMMON_DOOR_INVALID")}},{label:"PTR_ADDRESS_LINE2",type:"text",name:"addressLine2",validation:{pattern:"[a-zA-Z0-9 !@#$%^&*()_+-={};':\\\\|,.<>/?]{1,64}",title:r("CORE_COMMON_DOOR_INVALID")}},{label:"PTR_landmark",type:"text",name:"landmark",validation:{pattern:"[a-zA-Z0-9 !@#$%^&*()_+-={};':\\\\|,.<>/?]{1,64}",title:r("CORE_COMMON_DOOR_INVALID")}}];const D=e=>{let{validation:t,name:n,messages:l}=e;if(t){let{pattern:e,maxlength:r,minlength:i,required:o}=t||{};return{pattern:t=>{if(e){var r;if(e instanceof RegExp)return!!e.test(t)||(null==l?void 0:l.pattern)||n.toUpperCase()+"_PATTERN";if("string"==typeof e)return!(null===(r=new RegExp(e))||void 0===r||!r.test(t))||(null==l?void 0:l.pattern)||n.toUpperCase()+"_PATTERN"}return!0},required:e=>!o||!!e||(null==l?void 0:l.required)||n.toUpperCase()+"_REQUIRED",maxLength:e=>!r||(null==e?void 0:e.length)<=r||(null==l?void 0:l.maxlength)||n.toUpperCase()+"_MAXLENGTH",minlength:i}}return{}};var x;return n.useEffect(()=>{S()},[]),n.useEffect(()=>{var e;"employee"===s&&(Object.keys(T).length&&!p.isEqual((null===(e=d.errors[i.key])||void 0===e?void 0:e.type)||{},T)?f(i.key,{type:T}):!Object.keys(T).length&&d.errors[i.key]&&v(i.key))},[T]),n.useEffect(()=>{const e=Object.keys(b),t={};e.forEach(e=>{var n;return t[e]=null===(n=c[i.key])||void 0===n?void 0:n[e]}),p.isEqual(b,t)||(a(i.key,u({},c[i.key],b)),S())},[b]),"employee"===s?null===(x=A)||void 0===x?void 0:x.map((e,n)=>{var a;return l.createElement(t.LabelFieldPair,{key:n},l.createElement(t.CardLabel,{className:"card-label-smaller"},C?r(e.label)+":":r(e.label),i.isMandatory?" * ":null),l.createElement("div",{className:"field"},l.createElement(o.Controller,{control:g,defaultValue:null==c||null===(a=c.address)||void 0===a?void 0:a[e.name],name:e.name,rules:{validate:D(e)},render:r=>l.createElement(t.TextInput,u({id:e.name,key:e.name,value:r.value,onChange:e=>{h({index:n}),r.onChange(e.target.value)},onBlur:r.onBlur,autoFocus:(null==m?void 0:m.index)==n},e.validation))})))}):l.createElement(l.Fragment,null,window.location.href.includes("/citizen")?l.createElement(E,{currentStep:3}):null,l.createElement(t.FormStep,{config:u({},i,{inputs:A}),_defaultValues:{street:null==c?void 0:c.address.street,doorNo:null==c?void 0:c.address.doorNo,buildingName:null==c?void 0:c.address.buildingName,addressLine1:null==c?void 0:c.address.addressLine1,addressLine2:null==c?void 0:c.address.addressLine2,landmark:null==c?void 0:c.address.landmark},onSelect:e=>a(i.key,e),onSkip:()=>a(),t:r}))},PTRSelectPincode:e=>{var r;let{t:o,config:a,onSelect:s,formData:c={},userType:d}=e;const p=Digit.Hooks.ptr.useTenants(),{pathname:f}=i.useLocation(),v=f.includes("modify");console.log("formData in oincode ",c);const[m,h]=n.useState(()=>{var e,t,n;return v&&"employee"===d?(null==c||null===(e=c.originalData)||void 0===e||null===(t=e.address)||void 0===t?void 0:t.pincode)||"":(null==c||null===(n=c.address)||void 0===n?void 0:n.pincode)||""}),g=[{label:"PTR_ADDRESS_PINCODE",type:"text",name:"pincode",validation:{minlength:6,maxlength:7,pattern:"[0-9]+",max:"9999999",title:o("PTR_ADDRESS_PINCODE_INVALID")}}],[_,y]=n.useState(null),[S,b]=n.useState("");function T(e){h(e.target.value),y(null),b("");let t=Digit.Utils.getPattern("Pincode").test(e.target.value);"employee"===d&&(e.target.value&&!t&&b(o("ERR_DEFAULT_INPUT_FIELD_MSG")),t&&((null==p?void 0:p.find(t=>{var n;return null===(n=t.pincode)||void 0===n?void 0:n.find(t=>t.toString()===e.target.value)}))||b(o("PTR_COMMON_PINCODE_NOT_SERVICABLE"))),s(a.key,u({},c.address,{pincode:e.target.value})))}return n.useEffect(()=>{var e;null!=c&&null!==(e=c.address)&&void 0!==e&&e.pincode&&h(c.address.pincode)},[null==c||null===(r=c.address)||void 0===r?void 0:r.pincode]),"employee"===d?null==g?void 0:g.map((e,n)=>l.createElement(l.Fragment,null,l.createElement(t.LabelFieldPair,{key:n},l.createElement(t.CardLabel,{className:"card-label-smaller"},o(e.label)),l.createElement("div",{className:"field"},l.createElement(t.TextInput,u({key:e.name,value:m,onChange:T},e.validation,{disable:v,autoFocus:v})))),S?l.createElement(t.CardLabelError,{style:{width:"70%",marginLeft:"30%",fontSize:"12px",marginTop:"-21px"}},S):null)):l.createElement(l.Fragment,null,window.location.href.includes("/citizen")?l.createElement(E,{currentStep:3}):null,l.createElement(t.FormStep,{t:o,config:u({},a,{inputs:g}),onSelect:function(e){try{return(null==p?void 0:p.find(t=>{var n;return null===(n=t.pincode)||void 0===n?void 0:n.find(t=>t==(null==e?void 0:e.pincode))}))?s(a.key,{pincode:m}):y("PTR_COMMON_PINCODE_NOT_SERVICABLE"),Promise.resolve()}catch(e){return Promise.reject(e)}},_defaultValues:{pincode:m},onChange:T,onSkip:()=>s(),forcedError:o(_)}))},PTRSelectAddress:e=>{var r;let{t:a,config:s,onSelect:c,userType:d,formData:f}=e;const v=Digit.Hooks.ptr.useTenants();let m=Digit.ULBService.getCurrentTenantId();const{pathname:h}=i.useLocation(),g=h.includes("modify");let _=(null==f?void 0:f.isEditAddress)||!1;g&&(_=!0);const{pincode:y}=(null==f?void 0:f.address)||"",S="employee"===d?v.filter(e=>e.code===m):y?v.filter(e=>{var t;return null==e||null===(t=e.pincode)||void 0===t?void 0:t.some(e=>e==y)}):v,[b,T]=n.useState(()=>{var e;return(null==f||null===(e=f.address)||void 0===e?void 0:e.city)||null}),{data:C}=Digit.Hooks.useBoundaryLocalities(null==b?void 0:b.code,"revenue",{enabled:!!b},a),[A,D]=n.useState(),[x,P]=n.useState();n.useEffect(()=>{if("employee"===d&&g&&null!=A&&A.length){var e,t,n;const l=null==f||null===(e=f.originalData)||void 0===e||null===(t=e.address)||void 0===t||null===(n=t.locality)||void 0===n?void 0:n.code,r=null==A?void 0:A.filter(e=>e.code===l)[0];I("locality",r)}},[A]),n.useEffect(()=>{S&&1===S.length&&T(S[0])},[S]),n.useEffect(()=>{if(b&&C){var e,t;let l=C,r=[];var n;null!=f&&null!==(e=f.address)&&void 0!==e&&e.locality&&P(f.address.locality),null!=f&&null!==(t=f.address)&&void 0!==t&&t.pincode&&(r=l.filter(e=>{var t;return null===(t=e.pincode)||void 0===t?void 0:t.find(e=>e==f.address.pincode)}),null!=f&&null!==(n=f.address)&&void 0!==n&&n.locality||P()),D(()=>r.length>0?r:l),1===r.length&&P(r[0])}},[b,null==f||null===(r=f.address)||void 0===r?void 0:r.pincode,C]);const{control:N,formState:w,watch:R,setValue:I}=o.useForm(),O=R(),{errors:L}=w,k={width:"70%",marginLeft:"30%",fontSize:"12px",marginTop:"-21px"};var M,F;return n.useEffect(()=>{if("employee"===d){let e=Object.keys(O);const t={};e.forEach(e=>{var n;return t[e]=null===(n=f[s.key])||void 0===n?void 0:n[e]}),p.isEqual(O,t)||c(s.key,u({},f[s.key],O))}},[O]),n.useEffect(()=>{},[w]),"employee"===d?l.createElement("div",null,l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},a("MYCITY_CODE_LABEL")+" *"),l.createElement(o.Controller,{name:"city",defaultValue:1===(null==S?void 0:S.length)?S[0]:b,control:N,render:e=>l.createElement(t.Dropdown,{className:"form-field",selected:e.value,disable:_||1===(null==S?void 0:S.length),option:S,select:e.onChange,optionKey:"code",onBlur:e.onBlur,t:a})})),l.createElement(t.CardLabelError,{style:k},w.touched.city?null==L||null===(M=L.city)||void 0===M?void 0:M.message:""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},a("PTR_LOCALITY")+" *"),l.createElement(o.Controller,{name:"locality",defaultValue:null,control:N,render:e=>l.createElement(t.Dropdown,{className:"form-field",selected:e.value,option:A,select:e.onChange,onBlur:e.onBlur,optionKey:"i18nkey",t:a,disable:_||!1})})),l.createElement(t.CardLabelError,{style:k},w.touched.locality?null==L||null===(F=L.locality)||void 0===F?void 0:F.message:"")):l.createElement(l.Fragment,null,window.location.href.includes("/citizen")?l.createElement(E,{currentStep:3}):null,l.createElement(t.FormStep,{config:s,onSelect:function(){c(s.key,{city:b,locality:x})},t:a,isDisabled:!x},l.createElement("div",null,l.createElement(t.CardLabel,null,a("MYCITY_CODE_LABEL")+" "),l.createElement("span",{className:"form-ptr-dropdown-only"},l.createElement(t.RadioOrSelect,{options:S.sort((e,t)=>e.name.localeCompare(t.name)),selectedOption:b,optionKey:"i18nKey",onSelect:function(e){P(null),D(null),T(e)},t:a,isPTFlow:!0,disabled:_})),b&&A&&l.createElement(t.CardLabel,null,a("PTR_LOCALITY")+" "),b&&A&&l.createElement("span",{className:"form-ptr-dropdown-only"},l.createElement(t.RadioOrSelect,{dropdownStyle:{paddingBottom:"20px"},isMandatory:s.isMandatory,options:A.sort((e,t)=>e.name.localeCompare(t.name)),selectedOption:x,optionKey:"i18nkey",onSelect:function(e){var t;null!=f&&null!==(t=f.address)&&void 0!==t&&t.locality&&(f.address.locality=e),P(e),"employee"===d&&c(s.key,u({},f[s.key],{locality:e}))},t:a,labelKey:"",disabled:_})))))},PTRSelectProofIdentity:e=>{var r,i,o;let{t:a,config:s,onSelect:c,formData:d}=e;Digit.ULBService.getStateId();const[p,f]=n.useState((null==d||null===(r=d.documents)||void 0===r?void 0:r.documents)||[]),[v,m]=n.useState(null),[h,g]=n.useState(!0),[_,y]=n.useState(!1),S=Digit.ULBService.getStateId(),{isLoading:b,data:C}=Digit.Hooks.ptr.usePetMDMS(S,"PetService","Documents");return n.useEffect(()=>{var e;let t=0;null==C||null===(e=C.PetService)||void 0===e||e.Documents.map(e=>{e.hasDropdown=!0;let n=!1;p.map(t=>{e.required&&null!=t&&t.documentType.includes(e.code)&&(n=!0)}),!n&&e.required&&(t+=1)}),g("0"!=t&&0!=t||!(p.length>0))},[p,_]),l.createElement("div",null,l.createElement(E,{currentStep:4}),b?l.createElement(t.Loader,null):l.createElement(t.FormStep,{t:a,config:s,onSelect:()=>{let e;e=u({},d.documents,{documents:p}),c(s.key,e)},onSkip:()=>c(),isDisabled:h,onAdd:function(){}},null==C||null===(i=C.PetService)||void 0===i||null===(o=i.Documents)||void 0===o?void 0:o.map((e,t)=>l.createElement(T,{key:t,document:e,t:a,error:v,setError:m,setDocuments:f,documents:p,setCheckRequiredFields:y})),v&&l.createElement(t.Toast,{label:v,onClose:()=>m(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 u=null!=i&&i.isMutation?["MutationDocuments"]:"Documents",{isLoading:s,data:c={}}=Digit.Hooks.ptr.usePetMDMS(a,"PetService",u);let d=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,s&&l.createElement(t.Loader,null),Array.isArray(d)?d.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(v(i,".","_"))),o.map((e,n)=>l.createElement(t.CardText,{className:"primaryColor"},""+(n+1),". ",r(v(null==e?void 0:e.code,".","_")))))}):null)),l.createElement("span",null,l.createElement(t.SubmitBar,{label:r("PTR_COMMON_NEXT"),onSubmit:o}))))},PTRWFApplicationTimeline:A},Ar=e=>{let{stateCode:t,userType:r,tenants:o}=e;const{path:a,url:u}=i.useRouteMatch(),s=Digit.StoreData.getCurrentLanguage();return Digit.Services.useStore({stateCode:t,moduleCode:"PTR",language:s}),Object.entries(Cr).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(Ve,{path:a,url:u,userType:r}):l.createElement(P,null)},Dr=e=>{let{matchPath:i}=e;const{t:o}=r.useTranslation(),[a,u,s]=Digit.Hooks.useSessionStorage("PTR_PET",{});n.useEffect(()=>{s()},[]);const c=[{link:i+"/ptr/petservice/new-application",i18nKey:o("PTR_CREATE_PET_APPLICATION")},{link:i+"/ptr/petservice/my-application",i18nKey:o("PTR_MY_APPLICATIONS_HEADER")},{link:i+"/howItWorks",i18nKey:o("PTR_HOW_IT_WORKS")},{link:i+"/faqs",i18nKey:o("PTR_FAQ_S")}];return l.createElement(t.CitizenHomeCard,{header:o("ACTION_TEST_PTR"),links:c,Icon:()=>l.createElement(t.PTRIcon,{className:"fill-path-primary-main"})})};exports.PTRComponents={PTRCard:()=>{const{t:e}=r.useTranslation(),[i,o]=n.useState("-"),{data:a,isLoading:u,isFetching:s,isSuccess:c}=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.ptAccess()}});if(n.useEffect(()=>{!s&&c&&o(a)},[s]),!Digit.Utils.ptAccess())return null;const d=[{count:u?"-":null==i?void 0:i.totalCount,label:e("ES_COMMON_INBOX"),link:"/digit-ui/employee/ptr/petservice/inbox"},{label:e("PTR_TITLE_NEW_PET_REGISTRATION"),link:"/digit-ui/employee/ptr/petservice/new-application",role:"PT_CEMP"},{label:e("ES_COMMON_APPLICATION_SEARCH"),link:"/digit-ui/employee/ptr/petservice/my-applications"}],p=Digit.UserService.hasAccess(["PT_CEMP"])||!1,f={Icon:l.createElement(t.PTRIcon,null),moduleName:e("PTR_TITLE_PET_REGISTRATION"),kpis:[{count:null==i?void 0:i.totalCount,label:e("ES_TITLE_INBOX"),link:"/digit-ui/employee/ptr/petservice/inbox"}],links:d.filter(e=>!(null!=e&&e.role)||p)};return l.createElement(t.EmployeeModuleCard,f)},PTRModule:Ar,PTRLinks:Dr,PTR_INBOX_FILTER:e=>l.createElement(Ye,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 Xe(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 $e(""+(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 Xe(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 $e(""+(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 Xe(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 $e(""+(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 Xe(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 $e(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 Xe(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=Dr,exports.PTRModule=Ar;
|
|
1
|
+
var e,t=require("@mseva/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"),r=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)}var s="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function c(e,t){return e(t={exports:{}},t.exports),t.exports}var d=c(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]",r="[object Array]",a="[object Boolean]",u="[object Date]",c="[object Error]",d="[object Function]",p="[object GeneratorFunction]",v="[object Map]",m="[object Number]",f="[object Object]",h="[object RegExp]",E="[object Set]",g="[object String]",y="[object Symbol]",_="[object WeakMap]",S="[object ArrayBuffer]",b="[object DataView]",T="[object Float32Array]",C="[object Float64Array]",A="[object Int8Array]",D="[object Int16Array]",N="[object Int32Array]",P="[object Uint8Array]",x="[object Uint16Array]",R="[object Uint32Array]",I=/\b__p \+= '';/g,w=/\b(__p \+=) '' \+/g,O=/(__e\(.*?\)|\b__t\)) \+\n'';/g,L=/&(?:amp|lt|gt|quot|#39);/g,k=/[&<>"']/g,M=RegExp(L.source),F=RegExp(k.source),B=/<%-([\s\S]+?)%>/g,U=/<%([\s\S]+?)%>/g,H=/<%=([\s\S]+?)%>/g,j=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,W=/^\w*$/,z=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,$=/[\\^$.*+?()[\]{}|]/g,V=RegExp($.source),q=/^\s+/,G=/\s/,K=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Y=/\{\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,re=/^(?:0|[1-9]\d*)$/,ae=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ue=/($^)/,se=/['\n\r\u2028\u2029\\]/g,ce="\\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="["+ce+"]",me="\\d+",fe="[a-z\\xdf-\\xf6\\xf8-\\xff]",he="[^\\ud800-\\udfff"+de+me+"\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",Ee="\\ud83c[\\udffb-\\udfff]",ge="[^\\ud800-\\udfff]",ye="(?:\\ud83c[\\udde6-\\uddff]){2}",_e="[\\ud800-\\udbff][\\udc00-\\udfff]",Se="[A-Z\\xc0-\\xd6\\xd8-\\xde]",be="(?:"+fe+"|"+he+")",Te="(?:"+Se+"|"+he+")",Ce="(?:"+ve+"|"+Ee+")?",Ae="[\\ufe0e\\ufe0f]?"+Ce+"(?:\\u200d(?:"+[ge,ye,_e].join("|")+")[\\ufe0e\\ufe0f]?"+Ce+")*",De="(?:"+["[\\u2700-\\u27bf]",ye,_e].join("|")+")"+Ae,Ne="(?:"+[ge+ve+"?",ve,ye,_e,"[\\ud800-\\udfff]"].join("|")+")",Pe=RegExp("['’]","g"),xe=RegExp(ve,"g"),Re=RegExp(Ee+"(?="+Ee+")|"+Ne+Ae,"g"),Ie=RegExp([Se+"?"+fe+"+(?:['’](?:d|ll|m|re|s|t|ve))?(?="+[pe,Se,"$"].join("|")+")",Te+"+(?:['’](?:D|LL|M|RE|S|T|VE))?(?="+[pe,Se+be,"$"].join("|")+")",Se+"?"+be+"+(?:['’](?:d|ll|m|re|s|t|ve))?",Se+"+(?:['’](?:D|LL|M|RE|S|T|VE))?","\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",me,De].join("|"),"g"),we=RegExp("[\\u200d\\ud800-\\udfff"+ce+"\\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"],ke=-1,Me={};Me[T]=Me[C]=Me[A]=Me[D]=Me[N]=Me[P]=Me["[object Uint8ClampedArray]"]=Me[x]=Me[R]=!0,Me[o]=Me[r]=Me[S]=Me[a]=Me[b]=Me[u]=Me[c]=Me[d]=Me[v]=Me[m]=Me[f]=Me[h]=Me[E]=Me[g]=Me[_]=!1;var Fe={};Fe[o]=Fe[r]=Fe[S]=Fe[b]=Fe[a]=Fe[u]=Fe[T]=Fe[C]=Fe[A]=Fe[D]=Fe[N]=Fe[v]=Fe[m]=Fe[f]=Fe[h]=Fe[E]=Fe[g]=Fe[y]=Fe[P]=Fe["[object Uint8ClampedArray]"]=Fe[x]=Fe[R]=!0,Fe[c]=Fe[d]=Fe[_]=!1;var Be={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Ue=parseFloat,He=parseInt,je="object"==typeof s&&s&&s.Object===Object&&s,We="object"==typeof self&&self&&self.Object===Object&&self,ze=je||We||Function("return this")(),$e=t&&!t.nodeType&&t,Ve=$e&&e&&!e.nodeType&&e,qe=Ve&&Ve.exports===$e,Ge=qe&&je.process,Ke=function(){try{return Ve&&Ve.require&&Ve.require("util").types||Ge&&Ge.binding&&Ge.binding("util")}catch(e){}}(),Ye=Ke&&Ke.isArrayBuffer,Xe=Ke&&Ke.isDate,Ze=Ke&&Ke.isMap,Je=Ke&&Ke.isRegExp,Qe=Ke&&Ke.isSet,et=Ke&&Ke.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 r=e[i];t(l,r,n(r),e)}return l}function lt(e,t){for(var n=-1,l=null==e?0:e.length;++n<l&&!1!==t(e[n],n,e););return e}function 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 rt(e,t){for(var n=-1,l=null==e?0:e.length,i=0,o=[];++n<l;){var r=e[n];t(r,n,e)&&(o[i++]=r)}return o}function at(e,t){return!(null==e||!e.length)&&Et(e,t,0)>-1}function ut(e,t,n){for(var l=-1,i=null==e?0:e.length;++l<i;)if(n(t,e[l]))return!0;return!1}function st(e,t){for(var n=-1,l=null==e?0:e.length,i=Array(l);++n<l;)i[n]=t(e[n],n,e);return i}function ct(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=St("length");function ft(e,t,n){var l;return n(e,function(e,n,i){if(t(e,n,i))return l=n,!1}),l}function ht(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 Et(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):ht(e,yt,n)}function gt(e,t,n,l){for(var i=n-1,o=e.length;++i<o;)if(l(e[i],t))return i;return-1}function yt(e){return e!=e}function _t(e,t){var n=null==e?0:e.length;return n?Ct(e,t)/n:NaN}function St(e){return function(t){return null==t?void 0:t[e]}}function bt(e){return function(t){return null==e?void 0:e[t]}}function Tt(e,t,n,l,i){return i(e,function(e,i,o){n=l?(l=!1,e):t(n,e,i,o)}),n}function Ct(e,t){for(var n,l=-1,i=e.length;++l<i;){var o=t(e[l]);void 0!==o&&(n=void 0===n?o:n+o)}return n}function At(e,t){for(var n=-1,l=Array(e);++n<e;)l[n]=t(n);return l}function Dt(e){return e?e.slice(0,$t(e)+1).replace(q,""):e}function Nt(e){return function(t){return e(t)}}function Pt(e,t){return st(t,function(t){return e[t]})}function xt(e,t){return e.has(t)}function Rt(e,t){for(var n=-1,l=e.length;++n<l&&Et(t,e[n],0)>-1;);return n}function It(e,t){for(var n=e.length;n--&&Et(t,e[n],0)>-1;);return n}function wt(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({"&":"&","<":"<",">":">",'"':""","'":"'"});function kt(e){return"\\"+Be[e]}function Mt(e){return we.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,r=[];++n<i;){var a=e[n];a!==t&&a!==l||(e[n]=l,r[o++]=n)}return r}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 Mt(e)?function(e){for(var t=Re.lastIndex=0;Re.test(e);)++t;return t}(e):mt(e)}function zt(e){return Mt(e)?function(e){return e.match(Re)||[]}(e):function(e){return e.split("")}(e)}function $t(e){for(var t=e.length;t--&&G.test(e.charAt(t)););return t}var Vt=bt({"&":"&","<":"<",">":">",""":'"',"'":"'"}),qt=function e(t){var s,G=(t=null==t?ze:qt.defaults(ze.Object(),t,qt.pick(ze,Le))).Array,ce=t.Date,de=t.Error,pe=t.Function,ve=t.Math,me=t.Object,fe=t.RegExp,he=t.String,Ee=t.TypeError,ge=G.prototype,ye=me.prototype,_e=t["__core-js_shared__"],Se=pe.prototype.toString,be=ye.hasOwnProperty,Te=0,Ce=(s=/[^.]+$/.exec(_e&&_e.keys&&_e.keys.IE_PROTO||""))?"Symbol(src)_1."+s:"",Ae=ye.toString,De=Se.call(me),Ne=ze._,Re=fe("^"+Se.call(be).replace($,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),we=qe?t.Buffer:void 0,Be=t.Symbol,je=t.Uint8Array,We=we?we.allocUnsafe:void 0,$e=Bt(me.getPrototypeOf,me),Ve=me.create,Ge=ye.propertyIsEnumerable,Ke=ge.splice,mt=Be?Be.isConcatSpreadable:void 0,bt=Be?Be.iterator:void 0,Gt=Be?Be.toStringTag:void 0,Kt=function(){try{var e=Ji(me,"defineProperty");return e({},"",{}),e}catch(e){}}(),Yt=t.clearTimeout!==ze.clearTimeout&&t.clearTimeout,Xt=ce&&ce.now!==ze.Date.now&&ce.now,Zt=t.setTimeout!==ze.setTimeout&&t.setTimeout,Jt=ve.ceil,Qt=ve.floor,en=me.getOwnPropertySymbols,tn=we?we.isBuffer:void 0,nn=t.isFinite,ln=ge.join,on=Bt(me.keys,me),rn=ve.max,an=ve.min,un=ce.now,sn=t.parseInt,cn=ve.random,dn=ge.reverse,pn=Ji(t,"DataView"),vn=Ji(t,"Map"),mn=Ji(t,"Promise"),fn=Ji(t,"Set"),hn=Ji(t,"WeakMap"),En=Ji(me,"create"),gn=hn&&new hn,yn={},_n=Po(pn),Sn=Po(vn),bn=Po(mn),Tn=Po(fn),Cn=Po(hn),An=Be?Be.prototype:void 0,Dn=An?An.valueOf:void 0,Nn=An?An.toString:void 0;function Pn(e){if(Vr(e)&&!Lr(e)&&!(e instanceof wn)){if(e instanceof In)return e;if(be.call(e,"__wrapped__"))return xo(e)}return new In(e)}var xn=function(){function e(){}return function(t){if(!$r(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 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 kn(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 kn;++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=Lr(e),l=!n&&Or(e),i=!n&&!l&&Br(e),o=!n&&!l&&!i&&Qr(e),r=n||l||i||o,a=r?At(e.length,he):[],u=a.length;for(var s in e)!t&&!be.call(e,s)||r&&("length"==s||i&&("offset"==s||"parent"==s)||o&&("buffer"==s||"byteLength"==s||"byteOffset"==s)||oo(s,u))||a.push(s);return a}function Un(e){var t=e.length;return t?e[kl(0,t-1)]:void 0}function Hn(e,t){return To(hi(e),Yn(t,0,e.length))}function jn(e){return To(hi(e))}function Wn(e,t,n){(void 0!==n&&!Rr(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)&&Rr(l,n)&&(void 0!==n||t in e)||Gn(e,t,n)}function $n(e,t){for(var n=e.length;n--;)if(Rr(e[n][0],t))return n;return-1}function Vn(e,t,n,l){return el(e,function(e,i,o){t(l,e,n(e),o)}),l}function qn(e,t){return e&&Ei(t,Sa(t),e)}function Gn(e,t,n){"__proto__"==t&&Kt?Kt(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function Kn(e,t){for(var n=-1,l=t.length,i=G(l),o=null==e;++n<l;)i[n]=o?void 0:ha(e,t[n]);return i}function Yn(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,r){var s,c=1&t,_=2&t,I=4&t;if(n&&(s=i?n(e,l,i,r):n(e)),void 0!==s)return s;if(!$r(e))return e;var w=Lr(e);if(w){if(s=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),!c)return hi(e,s)}else{var O=to(e),L=O==d||O==p;if(Br(e))return ci(e,c);if(O==f||O==o||L&&!i){if(s=_||L?{}:lo(e),!c)return _?function(e,t){return Ei(e,eo(e),t)}(e,function(e,t){return e&&Ei(t,ba(t),e)}(s,e)):function(e,t){return Ei(e,Qi(e),t)}(e,qn(s,e))}else{if(!Fe[O])return i?e:{};s=function(e,t,n){var l=e.constructor;switch(t){case S:return di(e);case a: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 C:case A:case D:case N:case P:case"[object Uint8ClampedArray]":case x:case R:return pi(e,n);case v:return new l;case m:case g: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 y:return Dn?me(Dn.call(e)):{}}}(e,O,c)}}r||(r=new Fn);var k=r.get(e);if(k)return k;r.set(e,s),Xr(e)?e.forEach(function(l){s.add(Xn(l,t,n,l,e,r))}):qr(e)&&e.forEach(function(l,i){s.set(i,Xn(l,t,n,i,e,r))});var M=w?void 0:(I?_?Vi:$i:_?ba:Sa)(e);return lt(M||e,function(l,i){M&&(l=e[i=l]),zn(s,i,Xn(l,t,n,i,e,r))}),s}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 Ee(n);return yo(function(){e.apply(void 0,l)},t)}function Qn(e,t,n,l){var i=-1,o=at,r=!0,a=e.length,u=[],s=t.length;if(!a)return u;n&&(t=st(t,Nt(n))),l?(o=ut,r=!1):t.length>=200&&(o=xt,r=!1,t=new Mn(t));e:for(;++i<a;){var c=e[i],d=null==n?c:n(c);if(c=l||0!==c?c:0,r&&d==d){for(var p=s;p--;)if(t[p]===d)continue e;u.push(c)}else o(t,d,l)||u.push(c)}return u}Pn.templateSettings={escape:B,evaluate:U,interpolate:H,variable:"",imports:{_:Pn}},(Pn.prototype=Rn.prototype).constructor=Pn,(In.prototype=xn(Rn.prototype)).constructor=In,(wn.prototype=xn(Rn.prototype)).constructor=wn,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=$n(t,e);return!(n<0||(n==t.length-1?t.pop():Ke.call(t,n,1),--this.size,0))},Ln.prototype.get=function(e){var t=this.__data__,n=$n(t,e);return n<0?void 0:t[n][1]},Ln.prototype.has=function(e){return $n(this.__data__,e)>-1},Ln.prototype.set=function(e,t){var n=this.__data__,l=$n(n,e);return l<0?(++this.size,n.push([e,t])):n[l][1]=t,this},kn.prototype.clear=function(){this.size=0,this.__data__={hash:new On,map:new(vn||Ln),string:new On}},kn.prototype.delete=function(e){var t=Xi(this,e).delete(e);return this.size-=t?1:0,t},kn.prototype.get=function(e){return Xi(this,e).get(e)},kn.prototype.has=function(e){return Xi(this,e).has(e)},kn.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},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)},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 kn(l)}return n.set(e,t),this.size=n.size,this};var el=_i(ul),tl=_i(sl,!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],r=t(o);if(null!=r&&(void 0===a?r==r&&!Jr(r):n(r,a)))var a=r,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,r=e.length;for(n||(n=io),i||(i=[]);++o<r;){var a=e[o];t>0&&n(a)?t>1?ol(a,t-1,n,l,i):ct(i,a):l||(i[i.length]=a)}return i}var rl=Si(),al=Si(!0);function ul(e,t){return e&&rl(e,t,Sa)}function sl(e,t){return e&&al(e,t,Sa)}function cl(e,t){return rt(t,function(t){return jr(e[t])})}function dl(e,t){for(var n=0,l=(t=ri(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 Lr(e)?l:ct(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=Ae.call(e);return l&&(t?e[Gt]=n:delete e[Gt]),i}(e):function(e){return Ae.call(e)}(e)}function ml(e,t){return e>t}function fl(e,t){return null!=e&&be.call(e,t)}function hl(e,t){return null!=e&&t in me(e)}function El(e,t,n){for(var l=n?ut:at,i=e[0].length,o=e.length,r=o,a=G(o),u=Infinity,s=[];r--;){var c=e[r];r&&t&&(c=st(c,Nt(t))),u=an(c.length,u),a[r]=!n&&(t||i>=120&&c.length>=120)?new Mn(r&&c):void 0}c=e[0];var d=-1,p=a[0];e:for(;++d<i&&s.length<u;){var v=c[d],m=t?t(v):v;if(v=n||0!==v?v:0,!(p?xt(p,m):l(s,m,n))){for(r=o;--r;){var f=a[r];if(!(f?xt(f,m):l(e[r],m,n)))continue e}p&&p.push(m),s.push(v)}}return s}function gl(e,t,n){var l=null==(e=fo(e,t=ri(t,e)))?e:e[No(Ho(t))];return null==l?void 0:tt(l,e,n)}function yl(e){return Vr(e)&&vl(e)==o}function _l(e,t,n,l,i){return e===t||(null==e||null==t||!Vr(e)&&!Vr(t)?e!=e&&t!=t:function(e,t,n,l,i,s){var d=Lr(e),p=Lr(t),_=d?r:to(e),T=p?r:to(t),C=(_=_==o?f:_)==f,A=(T=T==o?f:T)==f,D=_==T;if(D&&Br(e)){if(!Br(t))return!1;d=!0,C=!1}if(D&&!C)return s||(s=new Fn),d||Qr(e)?Wi(e,t,n,l,i,s):function(e,t,n,l,i,o,r){switch(n){case b:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case S:return!(e.byteLength!=t.byteLength||!o(new je(e),new je(t)));case a:case u:case m:return Rr(+e,+t);case c:return e.name==t.name&&e.message==t.message;case h:case g:return e==t+"";case v:var s=Ft;case E:if(s||(s=Ht),e.size!=t.size&&!(1&l))return!1;var d=r.get(e);if(d)return d==t;l|=2,r.set(e,t);var p=Wi(s(e),s(t),l,i,o,r);return r.delete(e),p;case y:if(Dn)return Dn.call(e)==Dn.call(t)}return!1}(e,t,_,n,l,i,s);if(!(1&n)){var N=C&&be.call(e,"__wrapped__"),P=A&&be.call(t,"__wrapped__");if(N||P){var x=N?e.value():e,R=P?t.value():t;return s||(s=new Fn),i(x,R,n,l,s)}}return!!D&&(s||(s=new Fn),function(e,t,n,l,i,o){var r=1&n,a=$i(e),u=a.length;if(u!=$i(t).length&&!r)return!1;for(var s=u;s--;){var c=a[s];if(!(r?c in t:be.call(t,c)))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=r;++s<u;){var f=e[c=a[s]],h=t[c];if(l)var E=r?l(h,f,c,t,e,o):l(f,h,c,e,t,o);if(!(void 0===E?f===h||i(f,h,n,l,o):E)){v=!1;break}m||(m="constructor"==c)}if(v&&!m){var g=e.constructor,y=t.constructor;g==y||!("constructor"in e)||!("constructor"in t)||"function"==typeof g&&g instanceof g&&"function"==typeof y&&y instanceof y||(v=!1)}return o.delete(e),o.delete(t),v}(e,t,n,l,i,s))}(e,t,n,l,_l,i))}function Sl(e,t,n,l){var i=n.length,o=i,r=!l;if(null==e)return!o;for(e=me(e);i--;){var a=n[i];if(r&&a[2]?a[1]!==e[a[0]]:!(a[0]in e))return!1}for(;++i<o;){var u=(a=n[i])[0],s=e[u],c=a[1];if(r&&a[2]){if(void 0===s&&!(u in e))return!1}else{var d=new Fn;if(l)var p=l(s,c,u,e,t,d);if(!(void 0===p?_l(c,s,3,l,d):p))return!1}}return!0}function bl(e){return!(!$r(e)||(t=e,Ce&&Ce in t))&&(jr(e)?Re:ie).test(Po(e));var t}function Tl(e){return"function"==typeof e?e:null==e?Ga:"object"==typeof e?Lr(e)?Pl(e[0],e[1]):Nl(e):nu(e)}function Cl(e){if(!co(e))return on(e);var t=[];for(var n in me(e))be.call(e,n)&&"constructor"!=n&&t.push(n);return t}function Al(e,t){return e<t}function Dl(e,t){var n=-1,l=Mr(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||Sl(n,e,t)}}function Pl(e,t){return ao(e)&&po(t)?vo(No(e),t):function(n){var l=ha(n,e);return void 0===l&&l===t?Ea(n,e):_l(t,l,3)}}function xl(e,t,n,l,i){e!==t&&rl(t,function(o,r){if(i||(i=new Fn),$r(o))!function(e,t,n,l,i,o,r){var a=Eo(e,n),u=Eo(t,n),s=r.get(u);if(s)Wn(e,n,s);else{var c=o?o(a,u,n+"",e,t,r):void 0,d=void 0===c;if(d){var p=Lr(u),v=!p&&Br(u),m=!p&&!v&&Qr(u);c=u,p||v||m?Lr(a)?c=a:Fr(a)?c=hi(a):v?(d=!1,c=ci(u,!0)):m?(d=!1,c=pi(u,!0)):c=[]:Kr(u)||Or(u)?(c=a,Or(a)?c=aa(a):$r(a)&&!jr(a)||(c=lo(u))):d=!1}d&&(r.set(u,c),i(c,u,l,o,r),r.delete(u)),Wn(e,n,c)}}(e,t,r,n,xl,l,i);else{var a=l?l(Eo(e,r),o,r+"",e,t,i):void 0;void 0===a&&(a=o),Wn(e,r,a)}},ba)}function Rl(e,t){var n=e.length;if(n)return oo(t+=t<0?n:0,n)?e[t]:void 0}function Il(e,t,n){t=t.length?st(t,function(e){return Lr(e)?function(t){return dl(t,1===e.length?e[0]:e)}:e}):[Ga];var l=-1;return t=st(t,Nt(Yi())),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,r=i.length,a=n.length;++l<r;){var u=vi(i[l],o[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,i){return{criteria:st(t,function(t){return t(e)}),index:++l,value:e}}))}function wl(e,t,n){for(var l=-1,i=t.length,o={};++l<i;){var r=t[l],a=dl(e,r);n(a,r)&&Hl(o,ri(r,e),a)}return o}function Ol(e,t,n,l){var i=l?gt:Et,o=-1,r=t.length,a=e;for(e===t&&(t=hi(t)),n&&(a=st(e,Nt(n)));++o<r;)for(var u=0,s=t[o],c=n?n(s):s;(u=i(a,c,u,l))>-1;)a!==e&&Ke.call(a,u,1),Ke.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)?Ke.call(e,i,1):Jl(e,i)}}return e}function kl(e,t){return e+Qt(cn()*(t-e+1))}function Ml(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 _o(mo(e,t,Ga),e+"")}function Bl(e){return Un(Ra(e))}function Ul(e,t){var n=Ra(e);return To(n,Yn(t,0,n.length))}function Hl(e,t,n,l){if(!$r(e))return e;for(var i=-1,o=(t=ri(t,e)).length,r=o-1,a=e;null!=a&&++i<o;){var u=No(t[i]),s=n;if("__proto__"===u||"constructor"===u||"prototype"===u)return e;if(i!=r){var c=a[u];void 0===(s=l?l(c,u,a):void 0)&&(s=$r(c)?c:oo(t[i+1])?[]:{})}zn(a,u,s),a=a[u]}return e}var jl=gn?function(e,t){return gn.set(e,t),e}:Ga,Wl=Kt?function(e,t){return Kt(e,"toString",{configurable:!0,enumerable:!1,value:$a(t),writable:!0})}:Ga;function zl(e){return To(Ra(e))}function $l(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 Vl(e,t){var n;return el(e,function(e,l,i){return!(n=t(e,l,i))}),!!n}function ql(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,r=e[o];null!==r&&!Jr(r)&&(n?r<=t:r<t)?l=o+1:i=o}return i}return Gl(e,t,Ga,n)}function Gl(e,t,n,l){var i=0,o=null==e?0:e.length;if(0===o)return 0;for(var r=(t=n(t))!=t,a=null===t,u=Jr(t),s=void 0===t;i<o;){var c=Qt((i+o)/2),d=n(e[c]),p=void 0!==d,v=null===d,m=d==d,f=Jr(d);if(r)var h=l||m;else h=s?m&&(l||p):a?m&&p&&(l||!v):u?m&&p&&!v&&(l||!f):!v&&!f&&(l?d<=t:d<t);h?i=c+1:o=c}return an(o,4294967294)}function Kl(e,t){for(var n=-1,l=e.length,i=0,o=[];++n<l;){var r=e[n],a=t?t(r):r;if(!n||!Rr(a,u)){var u=a;o[i++]=0===r?0:r}}return o}function Yl(e){return"number"==typeof e?e:Jr(e)?NaN:+e}function Xl(e){if("string"==typeof e)return e;if(Lr(e))return st(e,Xl)+"";if(Jr(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=at,o=e.length,r=!0,a=[],u=a;if(n)r=!1,i=ut;else if(o>=200){var s=t?null:Mi(e);if(s)return Ht(s);r=!1,i=xt,u=new Mn}else u=t?[]:a;e:for(;++l<o;){var c=e[l],d=t?t(c):c;if(c=n||0!==c?c:0,r&&d==d){for(var p=u.length;p--;)if(u[p]===d)continue e;t&&u.push(d),a.push(c)}else i(u,d,n)||(u!==a&&u.push(d),a.push(c))}return a}function Jl(e,t){return null==(e=fo(e,t=ri(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?$l(e,l?0:o,l?o+1:i):$l(e,l?o+1:0,l?i:o)}function ti(e,t){var n=e;return n instanceof wn&&(n=n.value()),dt(t,function(e,t){return t.func.apply(t.thisArg,ct([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 r=e[i],a=-1;++a<l;)a!=i&&(o[i]=Qn(o[i]||r,e[a],t,n));return Zl(ol(o,1),t,n)}function li(e,t,n){for(var l=-1,i=e.length,o=t.length,r={};++l<i;)n(r,e[l],l<o?t[l]:void 0);return r}function ii(e){return Fr(e)?e:[]}function oi(e){return"function"==typeof e?e:Ga}function ri(e,t){return Lr(e)?e:ao(e,t)?[e]:Do(ua(e))}var ai=Fl;function ui(e,t,n){var l=e.length;return n=void 0===n?l:n,!t&&n>=l?e:$l(e,t,n)}var si=Yt||function(e){return ze.clearTimeout(e)};function ci(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=Jr(e),r=void 0!==t,a=null===t,u=t==t,s=Jr(t);if(!a&&!s&&!o&&e>t||o&&r&&u&&!a&&!s||l&&r&&u||!n&&u||!i)return 1;if(!l&&!o&&!s&&e<t||s&&n&&i&&!l&&!o||a&&n&&i||!r&&i||!u)return-1}return 0}function mi(e,t,n,l){for(var i=-1,o=e.length,r=n.length,a=-1,u=t.length,s=rn(o-r,0),c=G(u+s),d=!l;++a<u;)c[a]=t[a];for(;++i<r;)(d||i<o)&&(c[n[i]]=e[i]);for(;s--;)c[a++]=e[i++];return c}function fi(e,t,n,l){for(var i=-1,o=e.length,r=-1,a=n.length,u=-1,s=t.length,c=rn(o-a,0),d=G(c+s),p=!l;++i<c;)d[i]=e[i];for(var v=i;++u<s;)d[v+u]=t[u];for(;++r<a;)(p||i<o)&&(d[v+n[r]]=e[i++]);return d}function hi(e,t){var n=-1,l=e.length;for(t||(t=G(l));++n<l;)t[n]=e[n];return t}function Ei(e,t,n,l){var i=!n;n||(n={});for(var o=-1,r=t.length;++o<r;){var a=t[o],u=l?l(n[a],e[a],a,n,e):void 0;void 0===u&&(u=e[a]),i?Gn(n,a,u):zn(n,a,u)}return n}function gi(e,t){return function(n,l){var i=Lr(n)?nt:Vn,o=t?t():{};return i(n,e,Yi(l,2),o)}}function yi(e){return Fl(function(t,n){var l=-1,i=n.length,o=i>1?n[i-1]:void 0,r=i>2?n[2]:void 0;for(o=e.length>3&&"function"==typeof o?(i--,o):void 0,r&&ro(n[0],n[1],r)&&(o=i<3?void 0:o,i=1),t=me(t);++l<i;){var a=n[l];a&&e(t,a,l,o)}return t})}function _i(e,t){return function(n,l){if(null==n)return n;if(!Mr(n))return e(n,l);for(var i=n.length,o=t?i:-1,r=me(n);(t?o--:++o<i)&&!1!==l(r[o],o,r););return n}}function Si(e){return function(t,n,l){for(var i=-1,o=me(t),r=l(t),a=r.length;a--;){var u=r[e?a:++i];if(!1===n(o[u],u,o))break}return t}}function bi(e){return function(t){var n=Mt(t=ua(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(ja(Oa(t).replace(Pe,"")),e,"")}}function Ci(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=xn(e.prototype),l=e.apply(n,t);return $r(l)?l:n}}function Ai(e){return function(t,n,l){var i=me(t);if(!Mr(t)){var o=Yi(n,3);t=Sa(t),n=function(e){return o(i[e],e,i)}}var r=e(t,n,l);return r>-1?i[o?t[r]:r]:void 0}}function Di(e){return zi(function(t){var l=t.length,i=l,o=In.prototype.thru;for(e&&t.reverse();i--;){var r=t[i];if("function"!=typeof r)throw new Ee(n);if(o&&!a&&"wrapper"==Gi(r))var a=new In([],!0)}for(i=a?i:l;++i<l;){var u=Gi(r=t[i]),s="wrapper"==u?qi(r):void 0;a=s&&uo(s[0])&&424==s[1]&&!s[4].length&&1==s[9]?a[Gi(s[0])].apply(a,s[3]):1==r.length&&uo(r)?a[u]():a.thru(r)}return function(){var e=arguments,n=e[0];if(a&&1==e.length&&Lr(n))return a.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,r,a,u,s){var c=128&t,d=1&t,p=2&t,v=24&t,m=512&t,f=p?void 0:Ci(e);return function h(){for(var E=arguments.length,g=G(E),y=E;y--;)g[y]=arguments[y];if(v)var _=Ki(h),S=wt(g,_);if(l&&(g=mi(g,l,i,v)),o&&(g=fi(g,o,r,v)),E-=S,v&&E<s){var b=Ut(g,_);return Li(e,t,Ni,h.placeholder,n,g,b,a,u,s-E)}var T=d?n:this,C=p?T[e]:e;return E=g.length,a?g=ho(g,a):m&&E>1&&g.reverse(),c&&u<E&&(g.length=u),this&&this!==ze&&this instanceof h&&(C=f||Ci(C)),C.apply(T,g)}}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 xi(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=Yl(n),l=Yl(l)),i=e(n,l)}return i}}function Ri(e){return zi(function(t){return t=st(t,Nt(Yi())),Fl(function(n){var l=this;return e(t,function(e){return tt(e,l,n)})})})}function Ii(e,t){var n=(t=void 0===t?" ":Xl(t)).length;if(n<2)return n?Ml(t,e):t;var l=Ml(t,Jt(e/Wt(t)));return Mt(t)?ui(zt(l),0,e).join(""):l.slice(0,e)}function wi(e){return function(t,n,l){return l&&"number"!=typeof l&&ro(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 i=-1,o=rn(Jt((t-e)/(n||1)),0),r=G(o);o--;)r[l?o:++i]=e,e+=n;return r}(t,n,l=void 0===l?t<n?1:-1:la(l),e)}}function Oi(e){return function(t,n){return"string"==typeof t&&"string"==typeof n||(t=ra(t),n=ra(n)),e(t,n)}}function Li(e,t,n,l,i,o,r,a,u,s){var c=8&t;t|=c?32:64,4&(t&=~(c?64:32))||(t&=-4);var d=[e,t,i,c?o:void 0,c?r:void 0,c?void 0:o,c?void 0:r,a,u,s],p=n.apply(void 0,d);return uo(e)&&go(p,d),p.placeholder=l,So(p,e,t)}function ki(e){var t=ve[e];return function(e,n){if(e=ra(e),(n=null==n?0:an(ia(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 Mi=fn&&1/Ht(new fn([,-0]))[1]==1/0?function(e){return new fn(e)}:Ja;function Fi(e){return function(t){var n=to(t);return n==v?Ft(t):n==E?jt(t):function(e,t){return st(t,function(t){return[t,e[t]]})}(t,e(t))}}function Bi(e,t,i,o,r,a,u,s){var c=2&t;if(!c&&"function"!=typeof e)throw new Ee(n);var d=o?o.length:0;if(d||(t&=-97,o=r=void 0),u=void 0===u?u:rn(ia(u),0),s=void 0===s?s:ia(s),d-=r?r.length:0,64&t){var p=o,v=r;o=r=void 0}var m=c?void 0:qi(e),f=[e,t,i,o,r,p,v,a,u,s];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 r=t[3];if(r){var a=e[3];e[3]=a?mi(a,r,t[4]):r,e[4]=a?Ut(e[3],l):t[4]}(r=t[5])&&(e[5]=(a=e[5])?fi(a,r,t[6]):r,e[6]=a?Ut(e[5],l):t[6]),(r=t[7])&&(e[7]=r),128&i&&(e[8]=null==e[8]?t[8]:an(e[8],t[8])),null==e[9]&&(e[9]=t[9]),e[0]=t[0],e[1]=o}(f,m),e=f[0],t=f[1],i=f[2],o=f[3],r=f[4],!(s=f[9]=void 0===f[9]?c?0:e.length:rn(f[9]-d,0))&&24&t&&(t&=-25),t&&1!=t)h=8==t||16==t?function(e,t,n){var l=Ci(e);return function i(){for(var o=arguments.length,r=G(o),a=o,u=Ki(i);a--;)r[a]=arguments[a];var s=o<3&&r[0]!==u&&r[o-1]!==u?[]:Ut(r,u);if((o-=s.length)<n)return Li(e,t,Ni,i.placeholder,void 0,r,s,void 0,void 0,n-o);var c=this&&this!==ze&&this instanceof i?l:e;return tt(c,this,r)}}(e,t,s):32!=t&&33!=t||r.length?Ni.apply(void 0,f):function(e,t,n,l){var i=1&t,o=Ci(e);return function t(){for(var r=-1,a=arguments.length,u=-1,s=l.length,c=G(s+a),d=this&&this!==ze&&this instanceof t?o:e;++u<s;)c[u]=l[u];for(;a--;)c[u++]=arguments[++r];return tt(d,i?n:this,c)}}(e,t,i,o);else var h=function(e,t,n){var l=1&t,i=Ci(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 So((m?jl:go)(h,f),e,t)}function Ui(e,t,n,l){return void 0===e||Rr(e,ye[n])&&!be.call(l,n)?t:e}function Hi(e,t,n,l,i,o){return $r(e)&&$r(t)&&(o.set(t,e),xl(e,t,void 0,Hi,o),o.delete(t)),e}function ji(e){return Kr(e)?void 0:e}function Wi(e,t,n,l,i,o){var r=1&n,a=e.length,u=t.length;if(a!=u&&!(r&&u>a))return!1;var s=o.get(e),c=o.get(t);if(s&&c)return s==t&&c==e;var d=-1,p=!0,v=2&n?new Mn:void 0;for(o.set(e,t),o.set(t,e);++d<a;){var m=e[d],f=t[d];if(l)var h=r?l(f,m,d,t,e,o):l(m,f,d,e,t,o);if(void 0!==h){if(h)continue;p=!1;break}if(v){if(!vt(t,function(e,t){if(!xt(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 _o(mo(e,void 0,ko),e+"")}function $i(e){return pl(e,Sa,Qi)}function Vi(e){return pl(e,ba,eo)}var qi=gn?function(e){return gn.get(e)}:Ja;function Gi(e){for(var t=e.name+"",n=yn[t],l=be.call(yn,t)?n.length:0;l--;){var i=n[l],o=i.func;if(null==o||o==e)return i.name}return t}function Ki(e){return(be.call(Pn,"placeholder")?Pn:e).placeholder}function Yi(){var e=Pn.iteratee||Ka;return e=e===Ka?Tl:e,arguments.length?e(arguments[0],arguments[1]):e}function Xi(e,t){var n=e.__data__;return function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}(t)?n["string"==typeof t?"string":"hash"]:n.map}function Zi(e){for(var t=Sa(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),rt(en(e),function(t){return Ge.call(e,t)}))}:ou,eo=en?function(e){for(var t=[];e;)ct(t,Qi(e)),e=$e(e);return t}:ou,to=vl;function no(e,t,n){for(var l=-1,i=(t=ri(t,e)).length,o=!1;++l<i;){var r=No(t[l]);if(!(o=null!=e&&n(e,r)))break;e=e[r]}return o||++l!=i?o:!!(i=null==e?0:e.length)&&zr(i)&&oo(r,i)&&(Lr(e)||Or(e))}function lo(e){return"function"!=typeof e.constructor||co(e)?{}:xn($e(e))}function io(e){return Lr(e)||Or(e)||!!(mt&&e&&e[mt])}function oo(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&re.test(e))&&e>-1&&e%1==0&&e<t}function ro(e,t,n){if(!$r(n))return!1;var l=typeof t;return!!("number"==l?Mr(n)&&oo(t,n.length):"string"==l&&t in n)&&Rr(n[t],e)}function ao(e,t){if(Lr(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!Jr(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 wn.prototype))return!1;if(e===n)return!0;var l=qi(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)!=E||hn&&to(new hn)!=_)&&(to=function(e){var t=vl(e),n=t==f?e.constructor:void 0,l=n?Po(n):"";if(l)switch(l){case _n:return b;case Sn:return v;case bn:return"[object Promise]";case Tn:return E;case Cn:return _}return t});var so=_e?jr:ru;function co(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||ye)}function po(e){return e==e&&!$r(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=rn(void 0===t?e.length-1:t,0),function(){for(var l=arguments,i=-1,o=rn(l.length-t,0),r=G(o);++i<o;)r[i]=l[t+i];i=-1;for(var a=G(t+1);++i<t;)a[i]=l[i];return a[t]=n(r),tt(e,this,a)}}function fo(e,t){return t.length<2?e:dl(e,$l(t,0,-1))}function ho(e,t){for(var n=e.length,l=an(t.length,n),i=hi(e);l--;){var o=t[l];e[l]=oo(o,n)?i[o]:void 0}return e}function Eo(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var go=bo(jl),yo=Zt||function(e,t){return ze.setTimeout(e,t)},_o=bo(Wl);function So(e,t,n){var l=t+"";return _o(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(K,"{\n/* [wrapped with "+t+"] */\n")}(l,function(e,t){return lt(i,function(n){var l="_."+n[0];t&n[1]&&!at(e,l)&&e.push(l)}),e.sort()}(function(e){var t=e.match(Y);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=kl(n,i),r=e[o];e[o]=e[n],e[n]=r}return e.length=t,e}var Co,Ao,Do=(Co=Cr(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===Ao.size&&Ao.clear(),e}),Ao=Co.cache,Co);function No(e){if("string"==typeof e||Jr(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Po(e){if(null!=e){try{return Se.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function xo(e){if(e instanceof wn)return e.clone();var t=new In(e.__wrapped__,e.__chain__);return t.__actions__=hi(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var Ro=Fl(function(e,t){return Fr(e)?Qn(e,ol(t,1,Fr,!0)):[]}),Io=Fl(function(e,t){var n=Ho(t);return Fr(n)&&(n=void 0),Fr(e)?Qn(e,ol(t,1,Fr,!0),Yi(n,2)):[]}),wo=Fl(function(e,t){var n=Ho(t);return Fr(n)&&(n=void 0),Fr(e)?Qn(e,ol(t,1,Fr,!0),void 0,n):[]});function Oo(e,t,n){var l=null==e?0:e.length;if(!l)return-1;var i=null==n?0:ia(n);return i<0&&(i=rn(l+i,0)),ht(e,Yi(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=ia(n),i=n<0?rn(l+i,0):an(i,l-1)),ht(e,Yi(t,3),i,!0)}function ko(e){return null!=e&&e.length?ol(e,1):[]}function Mo(e){return e&&e.length?e[0]:void 0}var Fo=Fl(function(e){var t=st(e,ii);return t.length&&t[0]===e[0]?El(t):[]}),Bo=Fl(function(e){var t=Ho(e),n=st(e,ii);return t===Ho(n)?t=void 0:n.pop(),n.length&&n[0]===e[0]?El(n,Yi(t,2)):[]}),Uo=Fl(function(e){var t=Ho(e),n=st(e,ii);return(t="function"==typeof t?t:void 0)&&n.pop(),n.length&&n[0]===e[0]?El(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?Ol(e,t):e}var zo=zi(function(e,t){var n=null==e?0:e.length,l=Kn(e,t);return Ll(e,st(t,function(e){return oo(e,n)?+e:e}).sort(vi)),l});function $o(e){return null==e?e:dn.call(e)}var Vo=Fl(function(e){return Zl(ol(e,1,Fr,!0))}),qo=Fl(function(e){var t=Ho(e);return Fr(t)&&(t=void 0),Zl(ol(e,1,Fr,!0),Yi(t,2))}),Go=Fl(function(e){var t=Ho(e);return t="function"==typeof t?t:void 0,Zl(ol(e,1,Fr,!0),void 0,t)});function Ko(e){if(!e||!e.length)return[];var t=0;return e=rt(e,function(e){if(Fr(e))return t=rn(e.length,t),!0}),At(t,function(t){return st(e,St(t))})}function Yo(e,t){if(!e||!e.length)return[];var n=Ko(e);return null==t?n:st(n,function(e){return tt(t,void 0,e)})}var Xo=Fl(function(e,t){return Fr(e)?Qn(e,t):[]}),Zo=Fl(function(e){return ni(rt(e,Fr))}),Jo=Fl(function(e){var t=Ho(e);return Fr(t)&&(t=void 0),ni(rt(e,Fr),Yi(t,2))}),Qo=Fl(function(e){var t=Ho(e);return t="function"==typeof t?t:void 0,ni(rt(e,Fr),void 0,t)}),er=Fl(Ko),tr=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,Yo(e,n)});function nr(e){var t=Pn(e);return t.__chain__=!0,t}function lr(e,t){return t(e)}var ir=zi(function(e){var t=e.length,n=t?e[0]:0,l=this.__wrapped__,i=function(t){return Kn(t,e)};return!(t>1||this.__actions__.length)&&l instanceof wn&&oo(n)?((l=l.slice(n,+n+(t?1:0))).__actions__.push({func:lr,args:[i],thisArg:void 0}),new In(l,this.__chain__).thru(function(e){return t&&!e.length&&e.push(void 0),e})):this.thru(i)}),or=gi(function(e,t,n){be.call(e,n)?++e[n]:Gn(e,n,1)}),rr=Ai(Oo),ar=Ai(Lo);function ur(e,t){return(Lr(e)?lt:el)(e,Yi(t,3))}function sr(e,t){return(Lr(e)?it:tl)(e,Yi(t,3))}var cr=gi(function(e,t,n){be.call(e,n)?e[n].push(t):Gn(e,n,[t])}),dr=Fl(function(e,t,n){var l=-1,i="function"==typeof t,o=Mr(e)?G(e.length):[];return el(e,function(e){o[++l]=i?tt(t,e,n):gl(e,t,n)}),o}),pr=gi(function(e,t,n){Gn(e,n,t)});function vr(e,t){return(Lr(e)?st:Dl)(e,Yi(t,3))}var mr=gi(function(e,t,n){e[n?0:1].push(t)},function(){return[[],[]]}),fr=Fl(function(e,t){if(null==e)return[];var n=t.length;return n>1&&ro(e,t[0],t[1])?t=[]:n>2&&ro(t[0],t[1],t[2])&&(t=[t[0]]),Il(e,ol(t,1),[])}),hr=Xt||function(){return ze.Date.now()};function Er(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 gr(e,t){var l;if("function"!=typeof t)throw new Ee(n);return e=ia(e),function(){return--e>0&&(l=t.apply(this,arguments)),e<=1&&(t=void 0),l}}var yr=Fl(function(e,t,n){var l=1;if(n.length){var i=Ut(n,Ki(yr));l|=32}return Bi(e,l,t,n,i)}),_r=Fl(function(e,t,n){var l=3;if(n.length){var i=Ut(n,Ki(_r));l|=32}return Bi(t,l,e,n,i)});function Sr(e,t,l){var i,o,r,a,u,s,c=0,d=!1,p=!1,v=!0;if("function"!=typeof e)throw new Ee(n);function m(t){var n=i,l=o;return i=o=void 0,c=t,a=e.apply(l,n)}function f(e){return c=e,u=yo(E,t),d?m(e):a}function h(e){var n=e-s;return void 0===s||n>=t||n<0||p&&e-c>=r}function E(){var e=hr();if(h(e))return g(e);u=yo(E,function(e){var n=t-(e-s);return p?an(n,r-(e-c)):n}(e))}function g(e){return u=void 0,v&&i?m(e):(i=o=void 0,a)}function y(){var e=hr(),n=h(e);if(i=arguments,o=this,s=e,n){if(void 0===u)return f(s);if(p)return si(u),u=yo(E,t),m(s)}return void 0===u&&(u=yo(E,t)),a}return t=ra(t)||0,$r(l)&&(d=!!l.leading,r=(p="maxWait"in l)?rn(ra(l.maxWait)||0,t):r,v="trailing"in l?!!l.trailing:v),y.cancel=function(){void 0!==u&&si(u),c=0,i=s=o=u=void 0},y.flush=function(){return void 0===u?a:g(hr())},y}var br=Fl(function(e,t){return Jn(e,1,t)}),Tr=Fl(function(e,t,n){return Jn(e,ra(t)||0,n)});function Cr(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new Ee(n);var l=function(){var n=arguments,i=t?t.apply(this,n):n[0],o=l.cache;if(o.has(i))return o.get(i);var r=e.apply(this,n);return l.cache=o.set(i,r)||o,r};return l.cache=new(Cr.Cache||kn),l}function Ar(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)}}Cr.Cache=kn;var Dr=ai(function(e,t){var n=(t=1==t.length&&Lr(t[0])?st(t[0],Nt(Yi())):st(ol(t,1),Nt(Yi()))).length;return Fl(function(l){for(var i=-1,o=an(l.length,n);++i<o;)l[i]=t[i].call(this,l[i]);return tt(e,this,l)})}),Nr=Fl(function(e,t){return Bi(e,32,void 0,t,Ut(t,Ki(Nr)))}),Pr=Fl(function(e,t){return Bi(e,64,void 0,t,Ut(t,Ki(Pr)))}),xr=zi(function(e,t){return Bi(e,256,void 0,void 0,void 0,t)});function Rr(e,t){return e===t||e!=e&&t!=t}var Ir=Oi(ml),wr=Oi(function(e,t){return e>=t}),Or=yl(function(){return arguments}())?yl:function(e){return Vr(e)&&be.call(e,"callee")&&!Ge.call(e,"callee")},Lr=G.isArray,kr=Ye?Nt(Ye):function(e){return Vr(e)&&vl(e)==S};function Mr(e){return null!=e&&zr(e.length)&&!jr(e)}function Fr(e){return Vr(e)&&Mr(e)}var Br=tn||ru,Ur=Xe?Nt(Xe):function(e){return Vr(e)&&vl(e)==u};function Hr(e){if(!Vr(e))return!1;var t=vl(e);return t==c||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!Kr(e)}function jr(e){if(!$r(e))return!1;var t=vl(e);return t==d||t==p||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Wr(e){return"number"==typeof e&&e==ia(e)}function zr(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}function $r(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function Vr(e){return null!=e&&"object"==typeof e}var qr=Ze?Nt(Ze):function(e){return Vr(e)&&to(e)==v};function Gr(e){return"number"==typeof e||Vr(e)&&vl(e)==m}function Kr(e){if(!Vr(e)||vl(e)!=f)return!1;var t=$e(e);if(null===t)return!0;var n=be.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&Se.call(n)==De}var Yr=Je?Nt(Je):function(e){return Vr(e)&&vl(e)==h},Xr=Qe?Nt(Qe):function(e){return Vr(e)&&to(e)==E};function Zr(e){return"string"==typeof e||!Lr(e)&&Vr(e)&&vl(e)==g}function Jr(e){return"symbol"==typeof e||Vr(e)&&vl(e)==y}var Qr=et?Nt(et):function(e){return Vr(e)&&zr(e.length)&&!!Me[vl(e)]},ea=Oi(Al),ta=Oi(function(e,t){return e<=t});function na(e){if(!e)return[];if(Mr(e))return Zr(e)?zt(e):hi(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==E?Ht:Ra)(e)}function la(e){return e?(e=ra(e))===1/0||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function ia(e){var t=la(e),n=t%1;return t==t?n?t-n:t:0}function oa(e){return e?Yn(ia(e),0,4294967295):0}function ra(e){if("number"==typeof e)return e;if(Jr(e))return NaN;if($r(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=$r(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=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 aa(e){return Ei(e,ba(e))}function ua(e){return null==e?"":Xl(e)}var sa=yi(function(e,t){if(co(t)||Mr(t))Ei(t,Sa(t),e);else for(var n in t)be.call(t,n)&&zn(e,n,t[n])}),ca=yi(function(e,t){Ei(t,ba(t),e)}),da=yi(function(e,t,n,l){Ei(t,ba(t),e,l)}),pa=yi(function(e,t,n,l){Ei(t,Sa(t),e,l)}),va=zi(Kn),ma=Fl(function(e,t){e=me(e);var n=-1,l=t.length,i=l>2?t[2]:void 0;for(i&&ro(t[0],t[1],i)&&(l=1);++n<l;)for(var o=t[n],r=ba(o),a=-1,u=r.length;++a<u;){var s=r[a],c=e[s];(void 0===c||Rr(c,ye[s])&&!be.call(e,s))&&(e[s]=o[s])}return e}),fa=Fl(function(e){return e.push(void 0,Hi),tt(Ca,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&&no(e,t,hl)}var ga=Pi(function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=Ae.call(t)),e[t]=n},$a(Ga)),ya=Pi(function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=Ae.call(t)),be.call(e,t)?e[t].push(n):e[t]=[n]},Yi),_a=Fl(gl);function Sa(e){return Mr(e)?Bn(e):Cl(e)}function ba(e){return Mr(e)?Bn(e,!0):function(e){if(!$r(e))return function(e){var t=[];if(null!=e)for(var n in me(e))t.push(n);return t}(e);var t=co(e),n=[];for(var l in e)("constructor"!=l||!t&&be.call(e,l))&&n.push(l);return n}(e)}var Ta=yi(function(e,t,n){xl(e,t,n)}),Ca=yi(function(e,t,n,l){xl(e,t,n,l)}),Aa=zi(function(e,t){var n={};if(null==e)return n;var l=!1;t=st(t,function(t){return t=ri(t,e),l||(l=t.length>1),t}),Ei(e,Vi(e),n),l&&(n=Xn(n,7,ji));for(var i=t.length;i--;)Jl(n,t[i]);return n}),Da=zi(function(e,t){return null==e?{}:function(e,t){return wl(e,t,function(t,n){return Ea(e,n)})}(e,t)});function Na(e,t){if(null==e)return{};var n=st(Vi(e),function(e){return[e]});return t=Yi(t),wl(e,n,function(e,n){return t(e,n[0])})}var Pa=Fi(Sa),xa=Fi(ba);function Ra(e){return null==e?[]:Pt(e,Sa(e))}var Ia=Ti(function(e,t,n){return t=t.toLowerCase(),e+(n?wa(t):t)});function wa(e){return Ha(ua(e).toLowerCase())}function Oa(e){return(e=ua(e))&&e.replace(ae,Ot).replace(xe,"")}var La=Ti(function(e,t,n){return e+(n?"-":"")+t.toLowerCase()}),ka=Ti(function(e,t,n){return e+(n?" ":"")+t.toLowerCase()}),Ma=bi("toLowerCase"),Fa=Ti(function(e,t,n){return e+(n?"_":"")+t.toLowerCase()}),Ba=Ti(function(e,t,n){return e+(n?" ":"")+Ha(t)}),Ua=Ti(function(e,t,n){return e+(n?" ":"")+t.toUpperCase()}),Ha=bi("toUpperCase");function ja(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(Ie)||[]}(e):function(e){return e.match(Z)||[]}(e):e.match(t)||[]}var Wa=Fl(function(e,t){try{return tt(e,void 0,t)}catch(e){return Hr(e)?e:new de(e)}}),za=zi(function(e,t){return lt(t,function(t){t=No(t),Gn(e,t,yr(e[t],e))}),e});function $a(e){return function(){return e}}var Va=Di(),qa=Di(!0);function Ga(e){return e}function Ka(e){return Tl("function"==typeof e?e:Xn(e,1))}var Ya=Fl(function(e,t){return function(n){return gl(n,e,t)}}),Xa=Fl(function(e,t){return function(n){return gl(e,n,t)}});function Za(e,t,n){var l=Sa(t),i=cl(t,l);null!=n||$r(t)&&(i.length||!l.length)||(n=t,t=e,e=this,i=cl(t,Sa(t)));var o=!($r(n)&&"chain"in n&&!n.chain),r=jr(e);return lt(i,function(n){var l=t[n];e[n]=l,r&&(e.prototype[n]=function(){var t=this.__chain__;if(o||t){var n=e(this.__wrapped__),i=n.__actions__=hi(this.__actions__);return i.push({func:l,args:arguments,thisArg:e}),n.__chain__=t,n}return l.apply(e,ct([this.value()],arguments))})}),e}function Ja(){}var Qa=Ri(st),eu=Ri(ot),tu=Ri(vt);function nu(e){return ao(e)?St(No(e)):function(e){return function(t){return dl(t,e)}}(e)}var lu=wi(),iu=wi(!0);function ou(){return[]}function ru(){return!1}var au,uu=xi(function(e,t){return e+t},0),su=ki("ceil"),cu=xi(function(e,t){return e/t},1),du=ki("floor"),pu=xi(function(e,t){return e*t},1),vu=ki("round"),mu=xi(function(e,t){return e-t},0);return Pn.after=function(e,t){if("function"!=typeof t)throw new Ee(n);return e=ia(e),function(){if(--e<1)return t.apply(this,arguments)}},Pn.ary=Er,Pn.assign=sa,Pn.assignIn=ca,Pn.assignInWith=da,Pn.assignWith=pa,Pn.at=va,Pn.before=gr,Pn.bind=yr,Pn.bindAll=za,Pn.bindKey=_r,Pn.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return Lr(e)?e:[e]},Pn.chain=nr,Pn.chunk=function(e,t,n){t=(n?ro(e,t,n):void 0===t)?1:rn(ia(t),0);var l=null==e?0:e.length;if(!l||t<1)return[];for(var i=0,o=0,r=G(Jt(l/t));i<l;)r[o++]=$l(e,i,i+=t);return r},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 ct(Lr(n)?hi(n):[n],ol(t,1))},Pn.cond=function(e){var t=null==e?0:e.length,l=Yi();return e=t?st(e,function(e){if("function"!=typeof e[1])throw new Ee(n);return[l(e[0]),e[1]]}):[],Fl(function(n){for(var l=-1;++l<t;){var i=e[l];if(tt(i[0],this,n))return tt(i[1],this,n)}})},Pn.conforms=function(e){return function(e){var t=Sa(e);return function(n){return Zn(n,e,t)}}(Xn(e,1))},Pn.constant=$a,Pn.countBy=or,Pn.create=function(e,t){var n=xn(e);return null==t?n:qn(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=Sr,Pn.defaults=ma,Pn.defaultsDeep=fa,Pn.defer=br,Pn.delay=Tr,Pn.difference=Ro,Pn.differenceBy=Io,Pn.differenceWith=wo,Pn.drop=function(e,t,n){var l=null==e?0:e.length;return l?$l(e,(t=n||void 0===t?1:ia(t))<0?0:t,l):[]},Pn.dropRight=function(e,t,n){var l=null==e?0:e.length;return l?$l(e,0,(t=l-(t=n||void 0===t?1:ia(t)))<0?0:t):[]},Pn.dropRightWhile=function(e,t){return e&&e.length?ei(e,Yi(t,3),!0,!0):[]},Pn.dropWhile=function(e,t){return e&&e.length?ei(e,Yi(t,3),!0):[]},Pn.fill=function(e,t,n,l){var i=null==e?0:e.length;return i?(n&&"number"!=typeof n&&ro(e,t,n)&&(n=0,l=i),function(e,t,n,l){var i=e.length;for((n=ia(n))<0&&(n=-n>i?0:i+n),(l=void 0===l||l>i?i:ia(l))<0&&(l+=i),l=n>l?0:oa(l);n<l;)e[n++]=t;return e}(e,t,n,l)):[]},Pn.filter=function(e,t){return(Lr(e)?rt:il)(e,Yi(t,3))},Pn.flatMap=function(e,t){return ol(vr(e,t),1)},Pn.flatMapDeep=function(e,t){return ol(vr(e,t),1/0)},Pn.flatMapDepth=function(e,t,n){return n=void 0===n?1:ia(n),ol(vr(e,t),n)},Pn.flatten=ko,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:ia(t)):[]},Pn.flip=function(e){return Bi(e,512)},Pn.flow=Va,Pn.flowRight=qa,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?[]:cl(e,Sa(e))},Pn.functionsIn=function(e){return null==e?[]:cl(e,ba(e))},Pn.groupBy=cr,Pn.initial=function(e){return null!=e&&e.length?$l(e,0,-1):[]},Pn.intersection=Fo,Pn.intersectionBy=Bo,Pn.intersectionWith=Uo,Pn.invert=ga,Pn.invertBy=ya,Pn.invokeMap=dr,Pn.iteratee=Ka,Pn.keyBy=pr,Pn.keys=Sa,Pn.keysIn=ba,Pn.map=vr,Pn.mapKeys=function(e,t){var n={};return t=Yi(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=Yi(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=Cr,Pn.merge=Ta,Pn.mergeWith=Ca,Pn.method=Ya,Pn.methodOf=Xa,Pn.mixin=Za,Pn.negate=Ar,Pn.nthArg=function(e){return e=ia(e),Fl(function(t){return Rl(t,e)})},Pn.omit=Aa,Pn.omitBy=function(e,t){return Na(e,Ar(Yi(t)))},Pn.once=function(e){return gr(2,e)},Pn.orderBy=function(e,t,n,l){return null==e?[]:(Lr(t)||(t=null==t?[]:[t]),Lr(n=l?void 0:n)||(n=null==n?[]:[n]),Il(e,t,n))},Pn.over=Qa,Pn.overArgs=Dr,Pn.overEvery=eu,Pn.overSome=tu,Pn.partial=Nr,Pn.partialRight=Pr,Pn.partition=mr,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=jo,Pn.pullAll=Wo,Pn.pullAllBy=function(e,t,n){return e&&e.length&&t&&t.length?Ol(e,t,Yi(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=zo,Pn.range=lu,Pn.rangeRight=iu,Pn.rearg=xr,Pn.reject=function(e,t){return(Lr(e)?rt:il)(e,Ar(Yi(t,3)))},Pn.remove=function(e,t){var n=[];if(!e||!e.length)return n;var l=-1,i=[],o=e.length;for(t=Yi(t,3);++l<o;){var r=e[l];t(r,l,e)&&(n.push(r),i.push(l))}return Ll(e,i),n},Pn.rest=function(e,t){if("function"!=typeof e)throw new Ee(n);return Fl(e,t=void 0===t?t:ia(t))},Pn.reverse=$o,Pn.sampleSize=function(e,t,n){return t=(n?ro(e,t,n):void 0===t)?1:ia(t),(Lr(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(Lr(e)?jn:zl)(e)},Pn.slice=function(e,t,n){var l=null==e?0:e.length;return l?(n&&"number"!=typeof n&&ro(e,t,n)?(t=0,n=l):(t=null==t?0:ia(t),n=void 0===n?l:ia(n)),$l(e,t,n)):[]},Pn.sortBy=fr,Pn.sortedUniq=function(e){return e&&e.length?Kl(e):[]},Pn.sortedUniqBy=function(e,t){return e&&e.length?Kl(e,Yi(t,2)):[]},Pn.split=function(e,t,n){return n&&"number"!=typeof n&&ro(e,t,n)&&(t=n=void 0),(n=void 0===n?4294967295:n>>>0)?(e=ua(e))&&("string"==typeof t||null!=t&&!Yr(t))&&!(t=Xl(t))&&Mt(e)?ui(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:rn(ia(t),0),Fl(function(n){var l=n[t],i=ui(n,0,t);return l&&ct(i,l),tt(e,this,i)})},Pn.tail=function(e){var t=null==e?0:e.length;return t?$l(e,1,t):[]},Pn.take=function(e,t,n){return e&&e.length?$l(e,0,(t=n||void 0===t?1:ia(t))<0?0:t):[]},Pn.takeRight=function(e,t,n){var l=null==e?0:e.length;return l?$l(e,(t=l-(t=n||void 0===t?1:ia(t)))<0?0:t,l):[]},Pn.takeRightWhile=function(e,t){return e&&e.length?ei(e,Yi(t,3),!1,!0):[]},Pn.takeWhile=function(e,t){return e&&e.length?ei(e,Yi(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 Ee(n);return $r(l)&&(i="leading"in l?!!l.leading:i,o="trailing"in l?!!l.trailing:o),Sr(e,t,{leading:i,maxWait:t,trailing:o})},Pn.thru=lr,Pn.toArray=na,Pn.toPairs=Pa,Pn.toPairsIn=xa,Pn.toPath=function(e){return Lr(e)?st(e,No):Jr(e)?[e]:hi(Do(ua(e)))},Pn.toPlainObject=aa,Pn.transform=function(e,t,n){var l=Lr(e),i=l||Br(e)||Qr(e);if(t=Yi(t,4),null==n){var o=e&&e.constructor;n=i?l?new o:[]:$r(e)&&jr(o)?xn($e(e)):{}}return(i?lt:ul)(e,function(e,l,i){return t(n,e,l,i)}),n},Pn.unary=function(e){return Er(e,1)},Pn.union=Vo,Pn.unionBy=qo,Pn.unionWith=Go,Pn.uniq=function(e){return e&&e.length?Zl(e):[]},Pn.uniqBy=function(e,t){return e&&e.length?Zl(e,Yi(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=Ko,Pn.unzipWith=Yo,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=Ra,Pn.valuesIn=function(e){return null==e?[]:Pt(e,ba(e))},Pn.without=Xo,Pn.words=ja,Pn.wrap=function(e,t){return Nr(oi(t),e)},Pn.xor=Zo,Pn.xorBy=Jo,Pn.xorWith=Qo,Pn.zip=er,Pn.zipObject=function(e,t){return li(e||[],t||[],zn)},Pn.zipObjectDeep=function(e,t){return li(e||[],t||[],Hl)},Pn.zipWith=tr,Pn.entries=Pa,Pn.entriesIn=xa,Pn.extend=ca,Pn.extendWith=da,Za(Pn,Pn),Pn.add=uu,Pn.attempt=Wa,Pn.camelCase=Ia,Pn.capitalize=wa,Pn.ceil=su,Pn.clamp=function(e,t,n){return void 0===n&&(n=t,t=void 0),void 0!==n&&(n=(n=ra(n))==n?n:0),void 0!==t&&(t=(t=ra(t))==t?t:0),Yn(ra(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,Sa(t))},Pn.deburr=Oa,Pn.defaultTo=function(e,t){return null==e||e!=e?t:e},Pn.divide=cu,Pn.endsWith=function(e,t,n){e=ua(e),t=Xl(t);var l=e.length,i=n=void 0===n?l:Yn(ia(n),0,l);return(n-=t.length)>=0&&e.slice(n,i)==t},Pn.eq=Rr,Pn.escape=function(e){return(e=ua(e))&&F.test(e)?e.replace(k,Lt):e},Pn.escapeRegExp=function(e){return(e=ua(e))&&V.test(e)?e.replace($,"\\$&"):e},Pn.every=function(e,t,n){var l=Lr(e)?ot:nl;return n&&ro(e,t,n)&&(t=void 0),l(e,Yi(t,3))},Pn.find=rr,Pn.findIndex=Oo,Pn.findKey=function(e,t){return ft(e,Yi(t,3),ul)},Pn.findLast=ar,Pn.findLastIndex=Lo,Pn.findLastKey=function(e,t){return ft(e,Yi(t,3),sl)},Pn.floor=du,Pn.forEach=ur,Pn.forEachRight=sr,Pn.forIn=function(e,t){return null==e?e:rl(e,Yi(t,3),ba)},Pn.forInRight=function(e,t){return null==e?e:al(e,Yi(t,3),ba)},Pn.forOwn=function(e,t){return e&&ul(e,Yi(t,3))},Pn.forOwnRight=function(e,t){return e&&sl(e,Yi(t,3))},Pn.get=ha,Pn.gt=Ir,Pn.gte=wr,Pn.has=function(e,t){return null!=e&&no(e,t,fl)},Pn.hasIn=Ea,Pn.head=Mo,Pn.identity=Ga,Pn.includes=function(e,t,n,l){e=Mr(e)?e:Ra(e),n=n&&!l?ia(n):0;var i=e.length;return n<0&&(n=rn(i+n,0)),Zr(e)?n<=i&&e.indexOf(t,n)>-1:!!i&&Et(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:ia(n);return i<0&&(i=rn(l+i,0)),Et(e,t,i)},Pn.inRange=function(e,t,n){return t=la(t),void 0===n?(n=t,t=0):n=la(n),function(e,t,n){return e>=an(t,n)&&e<rn(t,n)}(e=ra(e),t,n)},Pn.invoke=_a,Pn.isArguments=Or,Pn.isArray=Lr,Pn.isArrayBuffer=kr,Pn.isArrayLike=Mr,Pn.isArrayLikeObject=Fr,Pn.isBoolean=function(e){return!0===e||!1===e||Vr(e)&&vl(e)==a},Pn.isBuffer=Br,Pn.isDate=Ur,Pn.isElement=function(e){return Vr(e)&&1===e.nodeType&&!Kr(e)},Pn.isEmpty=function(e){if(null==e)return!0;if(Mr(e)&&(Lr(e)||"string"==typeof e||"function"==typeof e.splice||Br(e)||Qr(e)||Or(e)))return!e.length;var t=to(e);if(t==v||t==E)return!e.size;if(co(e))return!Cl(e).length;for(var n in e)if(be.call(e,n))return!1;return!0},Pn.isEqual=function(e,t){return _l(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?_l(e,t,void 0,n):!!l},Pn.isError=Hr,Pn.isFinite=function(e){return"number"==typeof e&&nn(e)},Pn.isFunction=jr,Pn.isInteger=Wr,Pn.isLength=zr,Pn.isMap=qr,Pn.isMatch=function(e,t){return e===t||Sl(e,t,Zi(t))},Pn.isMatchWith=function(e,t,n){return n="function"==typeof n?n:void 0,Sl(e,t,Zi(t),n)},Pn.isNaN=function(e){return Gr(e)&&e!=+e},Pn.isNative=function(e){if(so(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=Gr,Pn.isObject=$r,Pn.isObjectLike=Vr,Pn.isPlainObject=Kr,Pn.isRegExp=Yr,Pn.isSafeInteger=function(e){return Wr(e)&&e>=-9007199254740991&&e<=9007199254740991},Pn.isSet=Xr,Pn.isString=Zr,Pn.isSymbol=Jr,Pn.isTypedArray=Qr,Pn.isUndefined=function(e){return void 0===e},Pn.isWeakMap=function(e){return Vr(e)&&to(e)==_},Pn.isWeakSet=function(e){return Vr(e)&&"[object WeakSet]"==vl(e)},Pn.join=function(e,t){return null==e?"":ln.call(e,t)},Pn.kebabCase=La,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=ia(n))<0?rn(l+i,0):an(i,l-1)),t==t?function(e,t,n){for(var l=n+1;l--;)if(e[l]===t)return l;return l}(e,t,i):ht(e,yt,i,!0)},Pn.lowerCase=ka,Pn.lowerFirst=Ma,Pn.lt=ea,Pn.lte=ta,Pn.max=function(e){return e&&e.length?ll(e,Ga,ml):void 0},Pn.maxBy=function(e,t){return e&&e.length?ll(e,Yi(t,2),ml):void 0},Pn.mean=function(e){return _t(e,Ga)},Pn.meanBy=function(e,t){return _t(e,Yi(t,2))},Pn.min=function(e){return e&&e.length?ll(e,Ga,Al):void 0},Pn.minBy=function(e,t){return e&&e.length?ll(e,Yi(t,2),Al):void 0},Pn.stubArray=ou,Pn.stubFalse=ru,Pn.stubObject=function(){return{}},Pn.stubString=function(){return""},Pn.stubTrue=function(){return!0},Pn.multiply=pu,Pn.nth=function(e,t){return e&&e.length?Rl(e,ia(t)):void 0},Pn.noConflict=function(){return ze._===this&&(ze._=Ne),this},Pn.noop=Ja,Pn.now=hr,Pn.pad=function(e,t,n){e=ua(e);var l=(t=ia(t))?Wt(e):0;if(!t||l>=t)return e;var i=(t-l)/2;return Ii(Qt(i),n)+e+Ii(Jt(i),n)},Pn.padEnd=function(e,t,n){e=ua(e);var l=(t=ia(t))?Wt(e):0;return t&&l<t?e+Ii(t-l,n):e},Pn.padStart=function(e,t,n){e=ua(e);var l=(t=ia(t))?Wt(e):0;return t&&l<t?Ii(t-l,n)+e:e},Pn.parseInt=function(e,t,n){return n||null==t?t=0:t&&(t=+t),sn(ua(e).replace(q,""),t||0)},Pn.random=function(e,t,n){if(n&&"boolean"!=typeof n&&ro(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 i=cn();return an(e+i*(t-e+Ue("1e-"+((i+"").length-1))),t)}return kl(e,t)},Pn.reduce=function(e,t,n){var l=Lr(e)?dt:Tt,i=arguments.length<3;return l(e,Yi(t,4),n,i,el)},Pn.reduceRight=function(e,t,n){var l=Lr(e)?pt:Tt,i=arguments.length<3;return l(e,Yi(t,4),n,i,tl)},Pn.repeat=function(e,t,n){return t=(n?ro(e,t,n):void 0===t)?1:ia(t),Ml(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,i=(t=ri(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=jr(o)?o.call(e):o}return e},Pn.round=vu,Pn.runInContext=e,Pn.sample=function(e){return(Lr(e)?Un:Bl)(e)},Pn.size=function(e){if(null==e)return 0;if(Mr(e))return Zr(e)?Wt(e):e.length;var t=to(e);return t==v||t==E?e.size:Cl(e).length},Pn.snakeCase=Fa,Pn.some=function(e,t,n){var l=Lr(e)?vt:Vl;return n&&ro(e,t,n)&&(t=void 0),l(e,Yi(t,3))},Pn.sortedIndex=function(e,t){return ql(e,t)},Pn.sortedIndexBy=function(e,t,n){return Gl(e,t,Yi(n,2))},Pn.sortedIndexOf=function(e,t){var n=null==e?0:e.length;if(n){var l=ql(e,t);if(l<n&&Rr(e[l],t))return l}return-1},Pn.sortedLastIndex=function(e,t){return ql(e,t,!0)},Pn.sortedLastIndexBy=function(e,t,n){return Gl(e,t,Yi(n,2),!0)},Pn.sortedLastIndexOf=function(e,t){if(null!=e&&e.length){var n=ql(e,t,!0)-1;if(Rr(e[n],t))return n}return-1},Pn.startCase=Ba,Pn.startsWith=function(e,t,n){return e=ua(e),n=null==n?0:Yn(ia(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?Ct(e,Ga):0},Pn.sumBy=function(e,t){return e&&e.length?Ct(e,Yi(t,2)):0},Pn.template=function(e,t,n){var l=Pn.templateSettings;n&&ro(e,t,n)&&(t=void 0),e=ua(e),t=da({},t,l,Ui);var i,o,r=da({},t.imports,l.imports,Ui),a=Sa(r),u=Pt(r,a),s=0,c=t.interpolate||ue,d="__p += '",p=fe((t.escape||ue).source+"|"+c.source+"|"+(c===H?ee:ue).source+"|"+(t.evaluate||ue).source+"|$","g"),v="//# sourceURL="+(be.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++ke+"]")+"\n";e.replace(p,function(t,n,l,r,a,u){return l||(l=r),d+=e.slice(s,u).replace(se,kt),n&&(i=!0,d+="' +\n__e("+n+") +\n'"),a&&(o=!0,d+="';\n"+a+";\n__p += '"),l&&(d+="' +\n((__t = ("+l+")) == null ? '' : __t) +\n'"),s=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(I,""):d).replace(w,"$1").replace(O,"$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=Wa(function(){return pe(a,v+"return "+d).apply(void 0,u)});if(f.source=d,Hr(f))throw f;return f},Pn.times=function(e,t){if((e=ia(e))<1||e>9007199254740991)return[];var n=4294967295,l=an(e,4294967295);e-=4294967295;for(var i=At(l,t=Yi(t));++n<e;)t(n);return i},Pn.toFinite=la,Pn.toInteger=ia,Pn.toLength=oa,Pn.toLower=function(e){return ua(e).toLowerCase()},Pn.toNumber=ra,Pn.toSafeInteger=function(e){return e?Yn(ia(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=Xl(t)))return e;var l=zt(e),i=zt(t);return ui(l,Rt(l,i),It(l,i)+1).join("")},Pn.trimEnd=function(e,t,n){if((e=ua(e))&&(n||void 0===t))return e.slice(0,$t(e)+1);if(!e||!(t=Xl(t)))return e;var l=zt(e);return ui(l,0,It(l,zt(t))+1).join("")},Pn.trimStart=function(e,t,n){if((e=ua(e))&&(n||void 0===t))return e.replace(q,"");if(!e||!(t=Xl(t)))return e;var l=zt(e);return ui(l,Rt(l,zt(t))).join("")},Pn.truncate=function(e,t){var n=30,l="...";if($r(t)){var i="separator"in t?t.separator:i;n="length"in t?ia(t.length):n,l="omission"in t?Xl(t.omission):l}var o=(e=ua(e)).length;if(Mt(e)){var r=zt(e);o=r.length}if(n>=o)return e;var a=n-Wt(l);if(a<1)return l;var u=r?ui(r,0,a).join(""):e.slice(0,a);if(void 0===i)return u+l;if(r&&(a+=u.length-a),Yr(i)){if(e.slice(a).search(i)){var s,c=u;for(i.global||(i=fe(i.source,ua(te.exec(i))+"g")),i.lastIndex=0;s=i.exec(c);)var d=s.index;u=u.slice(0,void 0===d?a:d)}}else if(e.indexOf(Xl(i),a)!=a){var p=u.lastIndexOf(i);p>-1&&(u=u.slice(0,p))}return u+l},Pn.unescape=function(e){return(e=ua(e))&&M.test(e)?e.replace(L,Vt):e},Pn.uniqueId=function(e){var t=++Te;return ua(e)+t},Pn.upperCase=Ua,Pn.upperFirst=Ha,Pn.each=ur,Pn.eachRight=sr,Pn.first=Mo,Za(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){wn.prototype[e]=function(n){n=void 0===n?1:rn(ia(n),0);var l=this.__filtered__&&!t?new wn(this):this.clone();return l.__filtered__?l.__takeCount__=an(n,l.__takeCount__):l.__views__.push({size:an(n,4294967295),type:e+(l.__dir__<0?"Right":"")}),l},wn.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}}),lt(["filter","map","takeWhile"],function(e,t){var n=t+1,l=1==n||3==n;wn.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:Yi(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(Ga)},wn.prototype.find=function(e){return this.filter(e).head()},wn.prototype.findLast=function(e){return this.reverse().find(e)},wn.prototype.invokeMap=Fl(function(e,t){return"function"==typeof e?new wn(this):this.map(function(n){return gl(n,e,t)})}),wn.prototype.reject=function(e){return this.filter(Ar(Yi(e)))},wn.prototype.slice=function(e,t){e=ia(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=ia(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)},ul(wn.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__,r=l?[1]:arguments,a=t instanceof wn,u=r[0],s=a||Lr(t),c=function(e){var t=i.apply(Pn,ct([e],r));return l&&d?t[0]:t};s&&n&&"function"==typeof u&&1!=u.length&&(a=s=!1);var d=this.__chain__,p=!!this.__actions__.length,v=o&&!d,m=a&&!p;if(!o&&s){t=m?t:new wn(this);var f=e.apply(t,r);return f.__actions__.push({func:lr,args:[c],thisArg:void 0}),new In(f,d)}return v&&m?e.apply(this,r):(f=this.thru(c),v?l?f.value()[0]:f.value():f)})}),lt(["pop","push","shift","sort","splice","unshift"],function(e){var t=ge[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",l=/^(?:pop|shift)$/.test(e);Pn.prototype[e]=function(){var e=arguments;if(l&&!this.__chain__){var i=this.value();return t.apply(Lr(i)?i:[],e)}return this[n](function(n){return t.apply(Lr(n)?n:[],e)})}}),ul(wn.prototype,function(e,t){var n=Pn[t];if(n){var l=n.name+"";be.call(yn,l)||(yn[l]=[]),yn[l].push({name:t,func:n})}}),yn[Ni(void 0,2).name]=[{name:"wrapper",func:void 0}],wn.prototype.clone=function(){var e=new wn(this.__wrapped__);return e.__actions__=hi(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=hi(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=hi(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=Lr(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],r=o.size;switch(o.type){case"drop":e+=r;break;case"dropRight":t-=r;break;case"take":t=an(t,e+r);break;case"takeRight":e=rn(e,t-r)}}return{start:e,end:t}}(0,i,this.__views__),r=o.start,a=o.end,u=a-r,s=l?a:r-1,c=this.__iteratees__,d=c.length,p=0,v=an(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,h=e[s+=t];++f<d;){var E=c[f],g=E.type,y=(0,E.iteratee)(h);if(2==g)h=y;else if(!y){if(1==g)continue e;break e}}m[p++]=h}return m},Pn.prototype.at=ir,Pn.prototype.chain=function(){return nr(this)},Pn.prototype.commit=function(){return new In(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 Rn;){var l=xo(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 wn){var t=e;return this.__actions__.length&&(t=new wn(this)),(t=t.reverse()).__actions__.push({func:lr,args:[$o],thisArg:void 0}),new In(t,this.__chain__)}return this.thru($o)},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}();Ve?((Ve.exports=qt)._=qt,$e._=qt):ze._=qt}).call(s)});const p=function(e){return void 0===e&&(e=""),function(e){return void 0===e&&(e=""),!(!e||null==e||null==e||""==e)}(e)?e:"PTR_NA"},v=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},m=e=>{var i,o,a,u,s,c,p,v,m,f;const{pets:h,focusIndex:E,allOwners:g,setFocusIndex:y,setPets:_,t:S,formData:b,config:T,setError:C,clearErrors:A,formState:D,menu:N,breed_type:P,pet_sex:x}=e,[R,I]=n.useState(null),{control:w,formState:O,watch:L,trigger:k}=r.useForm(),M=L(),{errors:F}=O,B=(Digit.ULBService.getCurrentTenantId(),n.useMemo(()=>{var e;return null==b||null===(e=b.ownershipCategory)||void 0===e?void 0:e.code.includes("INDIVIDUAL")},[null==b||null===(i=b.ownershipCategory)||void 0===i?void 0:i.code])),[U,H]=l.useState({});n.useEffect(()=>{let e=B;d.isEqual(U,M)||(H({...M}),_(t=>t.map(t=>t.key&&t.key===h.key?{...t,...M,...e}:{...t})),k())},[M]),n.useEffect(()=>{var e;Object.keys(F).length&&!d.isEqual((null===(e=D.errors[T.key])||void 0===e?void 0:e.type)||{},F)?C(T.key,{type:F}):!Object.keys(F).length&&D.errors[T.key]&&A(T.key)},[F]);const j={width:"70%",marginLeft:"30%",fontSize:"12px",marginTop:"-21px"};return l.createElement(l.Fragment,null,l.createElement("div",{style:{marginBottom:"16px"}},l.createElement("div",{style:{border:"1px solid #E3E3E3",padding:"16px",marginTop:"8px"}},(null==g?void 0:g.length)>2?l.createElement("div",{style:{marginBottom:"16px",padding:"5px",cursor:"pointer",textAlign:"right"}},"X"):null,l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},S("PTR_SEARCH_PET_TYPE")+" *"),l.createElement(r.Controller,{control:w,name:"petType",defaultValue:null==h?void 0:h.petType,rules:{required:S("CORE_COMMON_REQUIRED_ERRMSG")},render:e=>l.createElement(t.Dropdown,{className:"form-field",selected:e.value,select:e.onChange,onBlur:e.onBlur,option:N,optionKey:"i18nKey",t:S})})),l.createElement(t.CardLabelError,{style:j},O.touched.petType?null==F||null===(o=F.petType)||void 0===o?void 0:o.message:""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},S("PTR_SEARCH_BREED_TYPE")+" *"),l.createElement(r.Controller,{control:w,name:"breedType",defaultValue:null==h?void 0:h.breedType,rules:{required:S("CORE_COMMON_REQUIRED_ERRMSG")},render:e=>l.createElement(t.Dropdown,{className:"form-field",selected:e.value,select:e.onChange,onBlur:e.onBlur,option:P,optionKey:"i18nKey",t:S})})),l.createElement(t.CardLabelError,{style:j},O.touched.breedType?null==F||null===(a=F.breedType)||void 0===a?void 0:a.message:""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},S("PTR_PET_NAME")+" *"),l.createElement("div",{className:"field"},l.createElement(r.Controller,{control:w,name:"petName",defaultValue:null==h?void 0:h.petName,rules:{required:S("CORE_COMMON_REQUIRED_ERRMSG"),validate:{pattern:e=>!!/^[a-zA-Z\s]*$/.test(e)||S("ERR_DEFAULT_INPUT_FIELD_MSG")}},render:e=>l.createElement(t.TextInput,{value:e.value,autoFocus:E.index===(null==h?void 0:h.key)&&"petName"===E.type,onChange:t=>{e.onChange(t.target.value),y({index:h.key,type:"petName"})},onBlur:t=>{y({index:-1}),e.onBlur(t)}})}))),l.createElement(t.CardLabelError,{style:j},O.touched.petName?null==F||null===(u=F.petName)||void 0===u?void 0:u.message:""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},S("PTR_PET_AGE")+" *"),l.createElement("div",{className:"field"},l.createElement(r.Controller,{control:w,name:"petAge",defaultValue:null==h?void 0:h.petAge,rules:{required:S("CORE_COMMON_REQUIRED_ERRMSG"),validate:e=>!!(/^\d{1,4}$/.test(e)&&parseInt(e,10)>=0&&parseInt(e,10)<=1440)||S("ERR_DEFAULT_INPUT_FIELD_MSG")},render:e=>l.createElement(t.TextInput,{value:e.value,autoFocus:E.index===(null==h?void 0:h.key)&&"petAge"===E.type,onChange:t=>{e.onChange(t),y({index:h.key,type:"petAge"})},labelStyle:{marginTop:"unset"},onBlur:e.onBlur,placeholder:"in months"})}))),l.createElement("div",{style:{textAlign:"center"}},Math.floor(L("petAge")/12)," ",1===Math.floor(L("petAge")/12)?"YEAR":"YEARS"," ",L("petAge")%12," ",L("petAge")%12==1?"MONTH":"MONTHS"),l.createElement("br",null),l.createElement(t.CardLabelError,{style:j},O.touched.petAge?null==F||null===(s=F.petAge)||void 0===s?void 0:s.message:""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},S("PTR_PET_SEX")+" *"),l.createElement(r.Controller,{control:w,name:"petGender",defaultValue:null==h?void 0:h.petGender,render:e=>l.createElement(t.Dropdown,{className:"form-field",selected:e.value,select:e.onChange,onBlur:e.onBlur,option:x,optionKey:"i18nKey",t:S})})),l.createElement(t.CardLabelError,{style:j},O.touched.petGender?null==F||null===(c=F.petGender)||void 0===c?void 0:c.message:""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},S("PTR_DOCTOR_NAME")+" *"),l.createElement("div",{className:"field"},l.createElement(r.Controller,{control:w,name:"doctorName",defaultValue:null==h?void 0:h.doctorName,rules:{required:S("CORE_COMMON_REQUIRED_ERRMSG"),validate:{pattern:e=>!!/^\w+( +\w+)*$/.test(e)||S("ERR_DEFAULT_INPUT_FIELD_MSG")}},render:e=>l.createElement(t.TextInput,{value:e.value,autoFocus:E.index===(null==h?void 0:h.key)&&"doctorName"===E.type,onChange:t=>{e.onChange(t.target.value),y({index:h.key,type:"doctorName"})},onBlur:e.onBlur})}))),l.createElement(t.CardLabelError,{style:j},O.touched.doctorName?null==F||null===(p=F.doctorName)||void 0===p?void 0:p.message:""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},S("PTR_CLINIC_NAME")+" *"),l.createElement("div",{className:"field"},l.createElement(r.Controller,{control:w,name:"clinicName",defaultValue:null==h?void 0:h.clinicName,rules:{required:S("CORE_COMMON_REQUIRED_ERRMSG"),validate:{pattern:e=>!!/^\w+( +\w+)*$/.test(e)||S("ERR_DEFAULT_INPUT_FIELD_MSG")}},render:e=>l.createElement(t.TextInput,{value:e.value,autoFocus:E.index===(null==h?void 0:h.key)&&"clinicName"===E.type,onChange:t=>{e.onChange(t.target.value),y({index:h.key,type:"clinicName"})},onBlur:e.onBlur})}))),l.createElement(t.CardLabelError,{style:j},O.touched.clinicName?null==F||null===(v=F.clinicName)||void 0===v?void 0:v.message:""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},S("PTR_VACCINATED_DATE")+" *"),l.createElement("div",{className:"field"},l.createElement(r.Controller,{control:w,name:"lastVaccineDate",defaultValue:null==h?void 0:h.lastVaccineDate,rules:{required:S("CORE_COMMON_REQUIRED_ERRMSG"),validDate:e=>!!/^\d{4}-\d{2}-\d{2}$/.test(e)||S("ERR_DEFAULT_INPUT_FIELD_MSG")},render:e=>l.createElement(t.TextInput,{type:"date",value:e.value,onChange:t=>{e.onChange(t.target.value)},max:(new Date).toISOString().split("T")[0]})}))),l.createElement(t.CardLabelError,{style:j},O.touched.lastVaccineDate?null==F||null===(m=F.lastVaccineDate)||void 0===m?void 0:m.message:""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},S("PTR_VACCINATION_NUMBER")+" *"),l.createElement("div",{className:"field"},l.createElement(r.Controller,{control:w,name:"vaccinationNumber",defaultValue:null==h?void 0:h.vaccinationNumber,render:e=>l.createElement(t.TextInput,{value:e.value,autoFocus:E.index===(null==h?void 0:h.key)&&"vaccinationNumber"===E.type,onChange:t=>{e.onChange(t.target.value),y({index:h.key,type:"vaccinationNumber"})},onBlur:e.onBlur})}))),l.createElement(t.CardLabelError,{style:j},O.touched.vaccinationNumber?null==F||null===(f=F.vaccinationNumber)||void 0===f?void 0:f.message:""))),(null==R?void 0:R.label)&&l.createElement(t.Toast,{label:null==R?void 0:R.label,onClose:e=>{I(e=>null)}}))},f=e=>{var i,o,a,u,s;const{owner:c,focusIndex:p,allOwners:v,setFocusIndex:m,setOwners:f,t:h,config:E,setError:g,clearErrors:y,formState:_}=e,[S,b]=n.useState(null),{control:T,formState:C,watch:A,trigger:D}=r.useForm(),N=A(),{errors:P}=C;Digit.ULBService.getCurrentTenantId(),n.useEffect(()=>{D()},[]);const[x,R]=l.useState({});n.useEffect(()=>{d.isEqual(x,N)||(R({...N}),f(e=>e.map(e=>e.key&&e.key===c.key?{...e,...N}:{...e})),D())},[N]),n.useEffect(()=>{var e;Object.keys(P).length&&!d.isEqual((null===(e=_.errors[E.key])||void 0===e?void 0:e.type)||{},P)?g(E.key,{type:P}):!Object.keys(P).length&&_.errors[E.key]&&y(E.key)},[P]);const I={width:"70%",marginLeft:"30%",fontSize:"12px",marginTop:"-21px"};return l.createElement(l.Fragment,null,l.createElement("div",{style:{marginBottom:"16px"}},l.createElement("div",{style:{border:"1px solid #E3E3E3",padding:"16px",marginTop:"8px"}},(null==v?void 0:v.length)>2?l.createElement("div",{style:{marginBottom:"16px",padding:"5px",cursor:"pointer",textAlign:"right"}},"X"):null,l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},h("PTR_APPLICANT_NAME")+" *"),l.createElement("div",{className:"field"},l.createElement(r.Controller,{control:T,name:"applicantName",defaultValue:null==c?void 0:c.applicantName,rules:{required:h("CORE_COMMON_REQUIRED_ERRMSG"),validate:{pattern:e=>!!/^[a-zA-Z\s]*$/.test(e)||h("ERR_DEFAULT_INPUT_FIELD_MSG")}},render:e=>l.createElement(t.TextInput,{value:e.value,autoFocus:p.index===(null==c?void 0:c.key)&&"applicantName"===p.type,onChange:t=>{e.onChange(t.target.value),m({index:c.key,type:"applicantName"})},onBlur:t=>{m({index:-1}),e.onBlur(t)}})}))),l.createElement(t.CardLabelError,{style:I},C.touched.applicantName?null==P||null===(i=P.applicantName)||void 0===i?void 0:i.message:""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},h("PTR_FATHER_HUSBAND_NAME")+" *"),l.createElement("div",{className:"field"},l.createElement(r.Controller,{control:T,name:"fatherName",defaultValue:null==c?void 0:c.fatherName,rules:{required:h("CORE_COMMON_REQUIRED_ERRMSG"),validate:{pattern:e=>!!/^[a-zA-Z\s]*$/.test(e)||h("ERR_DEFAULT_INPUT_FIELD_MSG")}},render:e=>l.createElement(t.TextInput,{value:e.value,autoFocus:p.index===(null==c?void 0:c.key)&&"fatherName"===p.type,onChange:t=>{e.onChange(t.target.value),m({index:c.key,type:"fatherName"})},onBlur:t=>{m({index:-1}),e.onBlur(t)}})}))),l.createElement(t.CardLabelError,{style:I},C.touched.fatherName?null==P||null===(o=P.fatherName)||void 0===o?void 0:o.message:""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},h("PTR_MOBILE_NUMBER")+" *"),l.createElement("div",{className:"field"},l.createElement(r.Controller,{control:T,name:"mobileNumber",defaultValue:null==c?void 0:c.mobileNumber,rules:{required:h("CORE_COMMON_REQUIRED_ERRMSG"),validate:e=>!!/^[6789]\d{9}$/.test(e)||h("ERR_DEFAULT_INPUT_FIELD_MSG")},render:e=>l.createElement(t.MobileNumber,{value:e.value,autoFocus:p.index===(null==c?void 0:c.key)&&"mobileNumber"===p.type,onChange:t=>{e.onChange(t),m({index:c.key,type:"mobileNumber"})},labelStyle:{marginTop:"unset"},onBlur:e.onBlur})}))),l.createElement(t.CardLabelError,{style:I},C.touched.mobileNumber?null==P||null===(a=P.mobileNumber)||void 0===a?void 0:a.message:""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},h("PTR_ALT_MOBILE_NUMBER")+" *"),l.createElement("div",{className:"field"},l.createElement(r.Controller,{control:T,name:"alternateNumber",defaultValue:null==c?void 0:c.alternateNumber,rules:{required:h("CORE_COMMON_REQUIRED_ERRMSG"),validate:e=>/^[6789]\d{9}$/.test(e)},render:e=>l.createElement(t.MobileNumber,{value:e.value,autoFocus:p.index===(null==c?void 0:c.key)&&"alternateNumber"===p.type,onChange:t=>{e.onChange(t),m({index:c.key,type:"alternateNumber"})},labelStyle:{marginTop:"unset"},onBlur:e.onBlur})}))),l.createElement(t.CardLabelError,{style:I},C.touched.alternateNumber?null==P||null===(u=P.alternateNumber)||void 0===u?void 0:u.message:""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},h("PTR_EMAIL_ID")),l.createElement("div",{className:"field"},l.createElement(r.Controller,{control:T,name:"emailId",defaultValue:null==c?void 0:c.emailId,rules:{validate:e=>{const t=e.trim().toLowerCase();return/^(([^<>()\[\]\.,;:\s@\"]+(\.[^<>()\[\]\.,;:\s@\"]+)*)|(\".+\"))@(([^<>()[\]\.,;:\s@\"]+\.)+[^<>()[\]\.,;:\s@\"]{2,})$/i.test(t)||"TL_EMAIL_ID_ERROR_MESSAGE"}},render:e=>l.createElement(t.TextInput,{value:e.value,autoFocus:p.index===(null==c?void 0:c.key)&&"emailId"===p.type,onChange:t=>{e.onChange(t),m({index:c.key,type:"emailId"})},labelStyle:{marginTop:"unset"},onBlur:e.onBlur})}))),l.createElement(t.CardLabelError,{style:I},C.touched.emailId?null==P||null===(s=P.emailId)||void 0===s?void 0:s.message:""))),(null==S?void 0:S.label)&&l.createElement(t.Toast,{label:null==S?void 0:S.label,onClose:e=>{b(e=>null)}}))};let h=[];const E=e=>{let{currentStep:n=1,flow:o=""}=e;const{t:r}=i.useTranslation(),a=window.Digit.Utils.browser.isMobile();return(e=>{switch(e){case"STAKEHOLDER":h=[];break;default:h=["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:a?{}:{maxWidth:"960px",minWidth:"640px",marginRight:"auto"}},h.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"},r(e))),i<o.length-1&&l.createElement("span",{className:"line "+(i<n-1&&"active")}))))};function g(e,t){try{var n=e()}catch(e){return t(e)}return n&&n.then?n.then(void 0,t):n}function y(e){var i;let{t:o,document:r,setDocuments:a,setError:u,documents:s,action:c,formData:d,setFormError:p,clearFormErrors:v,config:m,formState:f,id:h}=e;const E=null==s?void 0:s.filter(e=>{var t;return null==e||null===(t=e.documentType)||void 0===t?void 0:t.includes(null==r?void 0:r.code)})[0],[y,_]=(Digit.ULBService.getCurrentTenantId(),n.useState(E?{...E,active:"ACTIVE"===(null==E?void 0:E.status),code:null==E?void 0:E.documentType}:1===(null==r||null===(i=r.dropdownData)||void 0===i?void 0:i.length)?null==r?void 0:r.dropdownData[0]:{})),[S,b]=n.useState(null),[T,C]=n.useState(()=>(null==E?void 0:E.fileStoreId)||null),{dropdownData:A}=r;var D=A;const[N,P]=n.useState(!1),x=()=>{var e,t;let n=null===(e=f.errors)||void 0===e||null===(t=e[m.key])||void 0===t?void 0:t.type;Array.isArray(n)||(n=[]),n.includes(null==r?void 0:r.code)&&(n=n.filter(e=>e!=(null==r?void 0:r.code)),n.length?p(m.key,{type:n}):v(m.key))};return n.useEffect(()=>{null!=y&&y.code&&a(e=>{const t=null==e?void 0:e.filter(e=>(null==e?void 0:e.documentType)!==(null==y?void 0:y.code));return 0===(null==T?void 0:T.length)||null===T?t:[...null==t?void 0:t.filter(e=>(null==e?void 0:e.fileStoreId)!==T),{documentType:null==y?void 0:y.code,filestoreId:T,documentUid:T}]}),N?N&&x():T&&null!=y&&y.code?T&&null!=y&&y.code&&x():(()=>{var e,t;let n=null===(e=f.errors)||void 0===e||null===(t=e[m.key])||void 0===t?void 0:t.type;Array.isArray(n)||(n=[]),n.includes(r.code)||(n.push(r.code),p(m.key,{type:n}))})()},[T,y,N]),n.useEffect(()=>{if("update"===c){var e,t;const n=null==d||null===(e=d.originalData)||void 0===e||null===(t=e.documents)||void 0===t?void 0:t.filter(e=>e.documentType.includes(null==r?void 0:r.code))[0],l=D.filter(e=>e.code===(null==n?void 0:n.documentType)).map(e=>{var t;return{...e,i18nKey:null==e||null===(t=e.code)||void 0===t?void 0:t.replaceAll(".","_")}})[0];l?(_(l),C(null==n?void 0:n.fileStoreId)):P(!0)}},[]),n.useEffect(()=>{!function(){try{u(null);const e=function(){if(S){const e=function(){if(S.size>=5242880)u(o("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=g(function(){return C(null),Promise.resolve(Digit.UploadServices.Filestorage("PTR",S,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?C(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):u(o("CS_FILE_UPLOAD_ERROR"))})},function(){u(o("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[S]),n.useEffect(()=>{N&&C(null)},[N]),l.createElement("div",{style:{marginBottom:"24px"}},null!=r&&r.hasDropdown?l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},o(null==r?void 0:r.code.replaceAll(".","_"))+" *"),l.createElement(t.Dropdown,{className:"form-field",selected:y,option:D.map(e=>{var t;return{...e,i18nKey:null===(t=e.code)||void 0===t?void 0:t.replaceAll(".","_")}}),select:e=>_(e),optionKey:"i18nKey",t:o})):null,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){b(e.target.files[0])},onDelete:()=>{C(null)},id:h,message:T?"1 "+o("CS_ACTION_FILEUPLOADED"):o("CS_ACTION_NO_FILEUPLOADED"),textStyles:{width:"100%"},inputStyles:{width:"280px"},accept:".pdf, .jpeg, .jpg, .png",buttonType:"button",error:!T}))))}"undefined"!=typeof Symbol&&(Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator"))),"undefined"!=typeof Symbol&&(Symbol.asyncIterator||(Symbol.asyncIterator=Symbol("Symbol.asyncIterator")));const 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:"pincode",texts:{submitBarLabel:"PTR_COMMON_NEXT"}}]},{head:"PTR_LOCATION_DETAILS",body:[{route:"pincode",component:"PTRSelectPincode",texts:{submitBarLabel:"PTR_COMMON_NEXT",skipText:"CORE_COMMON_SKIP_CONTINUE"},withoutLabel:!0,key:"address",nextStep:"address",type:"component"},{route:"address",component:"PTRSelectAddress",withoutLabel:!0,texts:{submitBarLabel:"PTR_COMMON_NEXT"},key:"address",nextStep:"street",isMandatory:!0,type:"component"},{type:"component",route:"street",component:"PTRCitizenAddress",key:"address",withoutLabel:!0,texts:{submitBarLabel:"PTR_COMMON_NEXT"},nextStep:"documents"}]},{head:"ES_TITILE_DOCUMENT_DETAILS",body:[{route:"documents",component:"PTRSelectProofIdentity",withoutLabel:!0,key:"documents",type:"component",nextStep:null,texts:{submitBarLabel:"PTR_COMMON_NEXT"}}]}];function b(e){var i;let{t:o,document:r,setDocuments:a,setError:u,documents:s,action:c,formData:d,id:p}=e;const v=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];console.log("filetetetetet",v),Digit.ULBService.getCurrentTenantId();const[m,f]=n.useState(v?{...v,active:!0===(null==r?void 0:r.active),code:null==v?void 0:v.documentType}:1===(null==r||null===(i=r.dropdownData)||void 0===i?void 0:i.length)?null==r?void 0:r.dropdownData[0]:{}),[h,E]=n.useState(null),[y,_]=n.useState(()=>(null==v?void 0:v.filestoreId)||null),{dropdownData:S}=r;var b=S;const[T,C]=n.useState(!1);return n.useEffect(()=>{null!=m&&m.code&&a(e=>{const t=null==e?void 0:e.filter(e=>(null==e?void 0:e.documentType)!==(null==m?void 0:m.code));return 0===(null==y?void 0:y.length)||null===y?t:[...null==t?void 0:t.filter(e=>(null==e?void 0:e.fileStoreId)!==y),{documentType:null==m?void 0:m.code,filestoreId:y,documentUid:y}]})},[y,m]),n.useEffect(()=>{if("update"===c){var e,t;const n=null==d||null===(e=d.originalData)||void 0===e||null===(t=e.documents)||void 0===t?void 0:t.filter(e=>e.documentType.includes(null==r?void 0:r.code))[0],l=b.filter(e=>e.code===(null==n?void 0:n.documentType)).map(e=>{var t;return{...e,i18nKey:null==e||null===(t=e.code)||void 0===t?void 0:t.replaceAll(".","_")}})[0];l?(f(l),_(null==n?void 0:n.fileStoreId)):C(!0)}},[]),n.useEffect(()=>{!function(){try{u(null);const e=function(){if(h){const e=function(){if(h.size>=5242880)u(o("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=g(function(){return _(null),Promise.resolve(Digit.UploadServices.Filestorage("PTR",h,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?_(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):u(o("CS_FILE_UPLOAD_ERROR"))})},function(){u(o("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[h]),n.useEffect(()=>{T&&_(null)},[T]),l.createElement("div",{style:{marginBottom:"24px"}},null!=r&&r.hasDropdown?l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},o(null==r?void 0:r.code.replaceAll(".","_"))+" *"),l.createElement(t.Dropdown,{className:"form-field",selected:m,style:{width:"100%"},option:b.map(e=>{var t;return{...e,i18nKey:null===(t=e.code)||void 0===t?void 0:t.replaceAll(".","_")}}),select:e=>f(e),optionKey:"i18nKey",t:o})):null,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){E(e.target.files[0])},onDelete:()=>{_(null)},id:p,message:y?"1 "+o("CS_ACTION_FILEUPLOADED"):o("CS_ACTION_NO_FILEUPLOADED"),textStyles:{width:"100%"},inputStyles:{width:"280px"},accept:".pdf, .jpeg, .jpg, .png",buttonType:"button",error:!y}))))}c(function(e){!function(t,n){e.exports=t.document?n(t,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return n(e)}}("undefined"!=typeof window?window:s,function(e,t){var n=[],l=Object.getPrototypeOf,i=n.slice,o=n.flat?function(e){return n.flat.call(e)}:function(e){return n.concat.apply([],e)},r=n.push,a=n.indexOf,u={},s=u.toString,c=u.hasOwnProperty,d=c.toString,p=d.call(Object),v={},m=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType&&"function"!=typeof e.item},f=function(e){return null!=e&&e===e.window},h=e.document,E={type:!0,src:!0,nonce:!0,noModule:!0};function g(e,t,n){var l,i,o=(n=n||h).createElement("script");if(o.text=e,t)for(l in E)(i=t[l]||t.getAttribute&&t.getAttribute(l))&&o.setAttribute(l,i);n.head.appendChild(o).parentNode.removeChild(o)}function y(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?u[s.call(e)]||"object":typeof e}var _=function(e,t){return new _.fn.init(e,t)};function S(e){var t=!!e&&"length"in e&&e.length,n=y(e);return!m(e)&&!f(e)&&("array"===n||0===t||"number"==typeof t&&t>0&&t-1 in e)}_.fn=_.prototype={jquery:"3.6.0",constructor:_,length:0,toArray:function(){return i.call(this)},get:function(e){return null==e?i.call(this):e<0?this[e+this.length]:this[e]},pushStack:function(e){var t=_.merge(this.constructor(),e);return t.prevObject=this,t},each:function(e){return _.each(this,e)},map:function(e){return this.pushStack(_.map(this,function(t,n){return e.call(t,n,t)}))},slice:function(){return this.pushStack(i.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},even:function(){return this.pushStack(_.grep(this,function(e,t){return(t+1)%2}))},odd:function(){return this.pushStack(_.grep(this,function(e,t){return t%2}))},eq:function(e){var t=this.length,n=+e+(e<0?t:0);return this.pushStack(n>=0&&n<t?[this[n]]:[])},end:function(){return this.prevObject||this.constructor()},push:r,sort:n.sort,splice:n.splice},_.extend=_.fn.extend=function(){var e,t,n,l,i,o,r=arguments[0]||{},a=1,u=arguments.length,s=!1;for("boolean"==typeof r&&(s=r,r=arguments[a]||{},a++),"object"==typeof r||m(r)||(r={}),a===u&&(r=this,a--);a<u;a++)if(null!=(e=arguments[a]))for(t in e)l=e[t],"__proto__"!==t&&r!==l&&(s&&l&&(_.isPlainObject(l)||(i=Array.isArray(l)))?(n=r[t],o=i&&!Array.isArray(n)?[]:i||_.isPlainObject(n)?n:{},i=!1,r[t]=_.extend(s,o,l)):void 0!==l&&(r[t]=l));return r},_.extend({expando:"jQuery"+("3.6.0"+Math.random()).replace(/\D/g,""),isReady:!0,error:function(e){throw new Error(e)},noop:function(){},isPlainObject:function(e){var t,n;return!(!e||"[object Object]"!==s.call(e)||(t=l(e))&&("function"!=typeof(n=c.call(t,"constructor")&&t.constructor)||d.call(n)!==p))},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},globalEval:function(e,t,n){g(e,{nonce:t&&t.nonce},n)},each:function(e,t){var n,l=0;if(S(e))for(n=e.length;l<n&&!1!==t.call(e[l],l,e[l]);l++);else for(l in e)if(!1===t.call(e[l],l,e[l]))break;return e},makeArray:function(e,t){var n=t||[];return null!=e&&(S(Object(e))?_.merge(n,"string"==typeof e?[e]:e):r.call(n,e)),n},inArray:function(e,t,n){return null==t?-1:a.call(t,e,n)},merge:function(e,t){for(var n=+t.length,l=0,i=e.length;l<n;l++)e[i++]=t[l];return e.length=i,e},grep:function(e,t,n){for(var l=[],i=0,o=e.length,r=!n;i<o;i++)!t(e[i],i)!==r&&l.push(e[i]);return l},map:function(e,t,n){var l,i,r=0,a=[];if(S(e))for(l=e.length;r<l;r++)null!=(i=t(e[r],r,n))&&a.push(i);else for(r in e)null!=(i=t(e[r],r,n))&&a.push(i);return o(a)},guid:1,support:v}),"function"==typeof Symbol&&(_.fn[Symbol.iterator]=n[Symbol.iterator]),_.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(e,t){u["[object "+t+"]"]=t.toLowerCase()});var b=function(e){var t,n,l,i,o,r,a,u,s,c,d,p,v,m,f,h,E,g,y,_="sizzle"+1*new Date,S=e.document,b=0,T=0,C=ue(),A=ue(),D=ue(),N=ue(),P=function(e,t){return e===t&&(d=!0),0},x={}.hasOwnProperty,R=[],I=R.pop,w=R.push,O=R.push,L=R.slice,k=function(e,t){for(var n=0,l=e.length;n<l;n++)if(e[n]===t)return n;return-1},M="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",F="[\\x20\\t\\r\\n\\f]",B="(?:\\\\[\\da-fA-F]{1,6}"+F+"?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+",U="\\["+F+"*("+B+")(?:"+F+"*([*^$|!~]?=)"+F+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+B+"))|)"+F+"*\\]",H=":("+B+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+U+")*)|.*)\\)|)",j=new RegExp(F+"+","g"),W=new RegExp("^"+F+"+|((?:^|[^\\\\])(?:\\\\.)*)"+F+"+$","g"),z=new RegExp("^"+F+"*,"+F+"*"),$=new RegExp("^"+F+"*([>+~]|"+F+")"+F+"*"),V=new RegExp(F+"|>"),q=new RegExp(H),G=new RegExp("^"+B+"$"),K={ID:new RegExp("^#("+B+")"),CLASS:new RegExp("^\\.("+B+")"),TAG:new RegExp("^("+B+"|[*])"),ATTR:new RegExp("^"+U),PSEUDO:new RegExp("^"+H),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+F+"*(even|odd|(([+-]|)(\\d*)n|)"+F+"*(?:([+-]|)"+F+"*(\\d+)|))"+F+"*\\)|)","i"),bool:new RegExp("^(?:"+M+")$","i"),needsContext:new RegExp("^"+F+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+F+"*((?:-\\d)?\\d*)"+F+"*\\)|)(?=[^-]|$)","i")},Y=/HTML$/i,X=/^(?:input|select|textarea|button)$/i,Z=/^h\d$/i,J=/^[^{]+\{\s*\[native \w/,Q=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=new RegExp("\\\\[\\da-fA-F]{1,6}"+F+"?|\\\\([^\\r\\n\\f])","g"),ne=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},le=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ie=function(e,t){return t?"\0"===e?"�":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},oe=function(){p()},re=_e(function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()},{dir:"parentNode",next:"legend"});try{O.apply(R=L.call(S.childNodes),S.childNodes)}catch(e){O={apply:R.length?function(e,t){w.apply(e,L.call(t))}:function(e,t){for(var n=e.length,l=0;e[n++]=t[l++];);e.length=n-1}}}function ae(e,t,l,i){var o,a,s,c,d,m,E,g=t&&t.ownerDocument,S=t?t.nodeType:9;if(l=l||[],"string"!=typeof e||!e||1!==S&&9!==S&&11!==S)return l;if(!i&&(p(t),t=t||v,f)){if(11!==S&&(d=Q.exec(e)))if(o=d[1]){if(9===S){if(!(s=t.getElementById(o)))return l;if(s.id===o)return l.push(s),l}else if(g&&(s=g.getElementById(o))&&y(t,s)&&s.id===o)return l.push(s),l}else{if(d[2])return O.apply(l,t.getElementsByTagName(e)),l;if((o=d[3])&&n.getElementsByClassName&&t.getElementsByClassName)return O.apply(l,t.getElementsByClassName(o)),l}if(n.qsa&&!N[e+" "]&&(!h||!h.test(e))&&(1!==S||"object"!==t.nodeName.toLowerCase())){if(E=e,g=t,1===S&&(V.test(e)||$.test(e))){for((g=ee.test(e)&&Ee(t.parentNode)||t)===t&&n.scope||((c=t.getAttribute("id"))?c=c.replace(le,ie):t.setAttribute("id",c=_)),a=(m=r(e)).length;a--;)m[a]=(c?"#"+c:":scope")+" "+ye(m[a]);E=m.join(",")}try{return O.apply(l,g.querySelectorAll(E)),l}catch(t){N(e,!0)}finally{c===_&&t.removeAttribute("id")}}}return u(e.replace(W,"$1"),t,l,i)}function ue(){var e=[];return function t(n,i){return e.push(n+" ")>l.cacheLength&&delete t[e.shift()],t[n+" "]=i}}function se(e){return e[_]=!0,e}function ce(e){var t=v.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function de(e,t){for(var n=e.split("|"),i=n.length;i--;)l.attrHandle[n[i]]=t}function pe(e,t){var n=t&&e,l=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(l)return l;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function ve(e){return function(t){return"input"===t.nodeName.toLowerCase()&&t.type===e}}function me(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function fe(e){return function(t){return"form"in t?t.parentNode&&!1===t.disabled?"label"in t?"label"in t.parentNode?t.parentNode.disabled===e:t.disabled===e:t.isDisabled===e||t.isDisabled!==!e&&re(t)===e:t.disabled===e:"label"in t&&t.disabled===e}}function he(e){return se(function(t){return t=+t,se(function(n,l){for(var i,o=e([],n.length,t),r=o.length;r--;)n[i=o[r]]&&(n[i]=!(l[i]=n[i]))})})}function Ee(e){return e&&void 0!==e.getElementsByTagName&&e}for(t in n=ae.support={},o=ae.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return!Y.test(e&&e.namespaceURI||t&&t.nodeName||"HTML")},p=ae.setDocument=function(e){var t,i,r=e?e.ownerDocument||e:S;return r!=v&&9===r.nodeType&&r.documentElement?(m=(v=r).documentElement,f=!o(v),S!=v&&(i=v.defaultView)&&i.top!==i&&(i.addEventListener?i.addEventListener("unload",oe,!1):i.attachEvent&&i.attachEvent("onunload",oe)),n.scope=ce(function(e){return m.appendChild(e).appendChild(v.createElement("div")),void 0!==e.querySelectorAll&&!e.querySelectorAll(":scope fieldset div").length}),n.attributes=ce(function(e){return e.className="i",!e.getAttribute("className")}),n.getElementsByTagName=ce(function(e){return e.appendChild(v.createComment("")),!e.getElementsByTagName("*").length}),n.getElementsByClassName=J.test(v.getElementsByClassName),n.getById=ce(function(e){return m.appendChild(e).id=_,!v.getElementsByName||!v.getElementsByName(_).length}),n.getById?(l.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute("id")===t}},l.find.ID=function(e,t){if(void 0!==t.getElementById&&f){var n=t.getElementById(e);return n?[n]:[]}}):(l.filter.ID=function(e){var t=e.replace(te,ne);return function(e){var n=void 0!==e.getAttributeNode&&e.getAttributeNode("id");return n&&n.value===t}},l.find.ID=function(e,t){if(void 0!==t.getElementById&&f){var n,l,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];for(i=t.getElementsByName(e),l=0;o=i[l++];)if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),l.find.TAG=n.getElementsByTagName?function(e,t){return void 0!==t.getElementsByTagName?t.getElementsByTagName(e):n.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,l=[],i=0,o=t.getElementsByTagName(e);if("*"===e){for(;n=o[i++];)1===n.nodeType&&l.push(n);return l}return o},l.find.CLASS=n.getElementsByClassName&&function(e,t){if(void 0!==t.getElementsByClassName&&f)return t.getElementsByClassName(e)},E=[],h=[],(n.qsa=J.test(v.querySelectorAll))&&(ce(function(e){var t;m.appendChild(e).innerHTML="<a id='"+_+"'></a><select id='"+_+"-\r\\' msallowcapture=''><option selected=''></option></select>",e.querySelectorAll("[msallowcapture^='']").length&&h.push("[*^$]="+F+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||h.push("\\["+F+"*(?:value|"+M+")"),e.querySelectorAll("[id~="+_+"-]").length||h.push("~="),(t=v.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||h.push("\\["+F+"*name"+F+"*="+F+"*(?:''|\"\")"),e.querySelectorAll(":checked").length||h.push(":checked"),e.querySelectorAll("a#"+_+"+*").length||h.push(".#.+[+~]"),e.querySelectorAll("\\\f"),h.push("[\\r\\n\\f]")}),ce(function(e){e.innerHTML="<a href='' disabled='disabled'></a><select disabled='disabled'><option/></select>";var t=v.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&h.push("name"+F+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&h.push(":enabled",":disabled"),m.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&h.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),h.push(",.*:")})),(n.matchesSelector=J.test(g=m.matches||m.webkitMatchesSelector||m.mozMatchesSelector||m.oMatchesSelector||m.msMatchesSelector))&&ce(function(e){n.disconnectedMatch=g.call(e,"*"),g.call(e,"[s!='']:x"),E.push("!=",H)}),h=h.length&&new RegExp(h.join("|")),E=E.length&&new RegExp(E.join("|")),t=J.test(m.compareDocumentPosition),y=t||J.test(m.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,l=t&&t.parentNode;return e===l||!(!l||1!==l.nodeType||!(n.contains?n.contains(l):e.compareDocumentPosition&&16&e.compareDocumentPosition(l)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},P=t?function(e,t){if(e===t)return d=!0,0;var l=!e.compareDocumentPosition-!t.compareDocumentPosition;return l||(1&(l=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!n.sortDetached&&t.compareDocumentPosition(e)===l?e==v||e.ownerDocument==S&&y(S,e)?-1:t==v||t.ownerDocument==S&&y(S,t)?1:c?k(c,e)-k(c,t):0:4&l?-1:1)}:function(e,t){if(e===t)return d=!0,0;var n,l=0,i=e.parentNode,o=t.parentNode,r=[e],a=[t];if(!i||!o)return e==v?-1:t==v?1:i?-1:o?1:c?k(c,e)-k(c,t):0;if(i===o)return pe(e,t);for(n=e;n=n.parentNode;)r.unshift(n);for(n=t;n=n.parentNode;)a.unshift(n);for(;r[l]===a[l];)l++;return l?pe(r[l],a[l]):r[l]==S?-1:a[l]==S?1:0},v):v},ae.matches=function(e,t){return ae(e,null,null,t)},ae.matchesSelector=function(e,t){if(p(e),n.matchesSelector&&f&&!N[t+" "]&&(!E||!E.test(t))&&(!h||!h.test(t)))try{var l=g.call(e,t);if(l||n.disconnectedMatch||e.document&&11!==e.document.nodeType)return l}catch(e){N(t,!0)}return ae(t,v,null,[e]).length>0},ae.contains=function(e,t){return(e.ownerDocument||e)!=v&&p(e),y(e,t)},ae.attr=function(e,t){(e.ownerDocument||e)!=v&&p(e);var i=l.attrHandle[t.toLowerCase()],o=i&&x.call(l.attrHandle,t.toLowerCase())?i(e,t,!f):void 0;return void 0!==o?o:n.attributes||!f?e.getAttribute(t):(o=e.getAttributeNode(t))&&o.specified?o.value:null},ae.escape=function(e){return(e+"").replace(le,ie)},ae.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},ae.uniqueSort=function(e){var t,l=[],i=0,o=0;if(d=!n.detectDuplicates,c=!n.sortStable&&e.slice(0),e.sort(P),d){for(;t=e[o++];)t===e[o]&&(i=l.push(o));for(;i--;)e.splice(l[i],1)}return c=null,e},i=ae.getText=function(e){var t,n="",l=0,o=e.nodeType;if(o){if(1===o||9===o||11===o){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=i(e)}else if(3===o||4===o)return e.nodeValue}else for(;t=e[l++];)n+=i(t);return n},(l=ae.selectors={cacheLength:50,createPseudo:se,match:K,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ne),e[3]=(e[3]||e[4]||e[5]||"").replace(te,ne),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||ae.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&ae.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return K.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&q.test(n)&&(t=r(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ne).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=C[e+" "];return t||(t=new RegExp("(^|"+F+")"+e+"("+F+"|$)"))&&C(e,function(e){return t.test("string"==typeof e.className&&e.className||void 0!==e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(l){var i=ae.attr(l,e);return null==i?"!="===t:!t||(i+="","="===t?i===n:"!="===t?i!==n:"^="===t?n&&0===i.indexOf(n):"*="===t?n&&i.indexOf(n)>-1:"$="===t?n&&i.slice(-n.length)===n:"~="===t?(" "+i.replace(j," ")+" ").indexOf(n)>-1:"|="===t&&(i===n||i.slice(0,n.length+1)===n+"-"))}},CHILD:function(e,t,n,l,i){var o="nth"!==e.slice(0,3),r="last"!==e.slice(-4),a="of-type"===t;return 1===l&&0===i?function(e){return!!e.parentNode}:function(t,n,u){var s,c,d,p,v,m,f=o!==r?"nextSibling":"previousSibling",h=t.parentNode,E=a&&t.nodeName.toLowerCase(),g=!u&&!a,y=!1;if(h){if(o){for(;f;){for(p=t;p=p[f];)if(a?p.nodeName.toLowerCase()===E:1===p.nodeType)return!1;m=f="only"===e&&!m&&"nextSibling"}return!0}if(m=[r?h.firstChild:h.lastChild],r&&g){for(y=(v=(s=(c=(d=(p=h)[_]||(p[_]={}))[p.uniqueID]||(d[p.uniqueID]={}))[e]||[])[0]===b&&s[1])&&s[2],p=v&&h.childNodes[v];p=++v&&p&&p[f]||(y=v=0)||m.pop();)if(1===p.nodeType&&++y&&p===t){c[e]=[b,v,y];break}}else if(g&&(y=v=(s=(c=(d=(p=t)[_]||(p[_]={}))[p.uniqueID]||(d[p.uniqueID]={}))[e]||[])[0]===b&&s[1]),!1===y)for(;(p=++v&&p&&p[f]||(y=v=0)||m.pop())&&((a?p.nodeName.toLowerCase()!==E:1!==p.nodeType)||!++y||(g&&((c=(d=p[_]||(p[_]={}))[p.uniqueID]||(d[p.uniqueID]={}))[e]=[b,y]),p!==t)););return(y-=i)===l||y%l==0&&y/l>=0}}},PSEUDO:function(e,t){var n,i=l.pseudos[e]||l.setFilters[e.toLowerCase()]||ae.error("unsupported pseudo: "+e);return i[_]?i(t):i.length>1?(n=[e,e,"",t],l.setFilters.hasOwnProperty(e.toLowerCase())?se(function(e,n){for(var l,o=i(e,t),r=o.length;r--;)e[l=k(e,o[r])]=!(n[l]=o[r])}):function(e){return i(e,0,n)}):i}},pseudos:{not:se(function(e){var t=[],n=[],l=a(e.replace(W,"$1"));return l[_]?se(function(e,t,n,i){for(var o,r=l(e,null,i,[]),a=e.length;a--;)(o=r[a])&&(e[a]=!(t[a]=o))}):function(e,i,o){return t[0]=e,l(t,null,o,n),t[0]=null,!n.pop()}}),has:se(function(e){return function(t){return ae(e,t).length>0}}),contains:se(function(e){return e=e.replace(te,ne),function(t){return(t.textContent||i(t)).indexOf(e)>-1}}),lang:se(function(e){return G.test(e||"")||ae.error("unsupported lang: "+e),e=e.replace(te,ne).toLowerCase(),function(t){var n;do{if(n=f?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return(n=n.toLowerCase())===e||0===n.indexOf(e+"-")}while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===m},focus:function(e){return e===v.activeElement&&(!v.hasFocus||v.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:fe(!1),disabled:fe(!0),checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!l.pseudos.empty(e)},header:function(e){return Z.test(e.nodeName)},input:function(e){return X.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:he(function(){return[0]}),last:he(function(e,t){return[t-1]}),eq:he(function(e,t,n){return[n<0?n+t:n]}),even:he(function(e,t){for(var n=0;n<t;n+=2)e.push(n);return e}),odd:he(function(e,t){for(var n=1;n<t;n+=2)e.push(n);return e}),lt:he(function(e,t,n){for(var l=n<0?n+t:n>t?t:n;--l>=0;)e.push(l);return e}),gt:he(function(e,t,n){for(var l=n<0?n+t:n;++l<t;)e.push(l);return e})}}).pseudos.nth=l.pseudos.eq,{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})l.pseudos[t]=ve(t);for(t in{submit:!0,reset:!0})l.pseudos[t]=me(t);function ge(){}function ye(e){for(var t=0,n=e.length,l="";t<n;t++)l+=e[t].value;return l}function _e(e,t,n){var l=t.dir,i=t.next,o=i||l,r=n&&"parentNode"===o,a=T++;return t.first?function(t,n,i){for(;t=t[l];)if(1===t.nodeType||r)return e(t,n,i);return!1}:function(t,n,u){var s,c,d,p=[b,a];if(u){for(;t=t[l];)if((1===t.nodeType||r)&&e(t,n,u))return!0}else for(;t=t[l];)if(1===t.nodeType||r)if(c=(d=t[_]||(t[_]={}))[t.uniqueID]||(d[t.uniqueID]={}),i&&i===t.nodeName.toLowerCase())t=t[l]||t;else{if((s=c[o])&&s[0]===b&&s[1]===a)return p[2]=s[2];if(c[o]=p,p[2]=e(t,n,u))return!0}return!1}}function Se(e){return e.length>1?function(t,n,l){for(var i=e.length;i--;)if(!e[i](t,n,l))return!1;return!0}:e[0]}function be(e,t,n,l,i){for(var o,r=[],a=0,u=e.length,s=null!=t;a<u;a++)(o=e[a])&&(n&&!n(o,l,i)||(r.push(o),s&&t.push(a)));return r}function Te(e,t,n,l,i,o){return l&&!l[_]&&(l=Te(l)),i&&!i[_]&&(i=Te(i,o)),se(function(o,r,a,u){var s,c,d,p=[],v=[],m=r.length,f=o||function(e,t,n){for(var l=0,i=t.length;l<i;l++)ae(e,t[l],n);return n}(t||"*",a.nodeType?[a]:a,[]),h=!e||!o&&t?f:be(f,p,e,a,u),E=n?i||(o?e:m||l)?[]:r:h;if(n&&n(h,E,a,u),l)for(s=be(E,v),l(s,[],a,u),c=s.length;c--;)(d=s[c])&&(E[v[c]]=!(h[v[c]]=d));if(o){if(i||e){if(i){for(s=[],c=E.length;c--;)(d=E[c])&&s.push(h[c]=d);i(null,E=[],s,u)}for(c=E.length;c--;)(d=E[c])&&(s=i?k(o,d):p[c])>-1&&(o[s]=!(r[s]=d))}}else E=be(E===r?E.splice(m,E.length):E),i?i(null,r,E,u):O.apply(r,E)})}function Ce(e){for(var t,n,i,o=e.length,r=l.relative[e[0].type],a=r||l.relative[" "],u=r?1:0,c=_e(function(e){return e===t},a,!0),d=_e(function(e){return k(t,e)>-1},a,!0),p=[function(e,n,l){var i=!r&&(l||n!==s)||((t=n).nodeType?c(e,n,l):d(e,n,l));return t=null,i}];u<o;u++)if(n=l.relative[e[u].type])p=[_e(Se(p),n)];else{if((n=l.filter[e[u].type].apply(null,e[u].matches))[_]){for(i=++u;i<o&&!l.relative[e[i].type];i++);return Te(u>1&&Se(p),u>1&&ye(e.slice(0,u-1).concat({value:" "===e[u-2].type?"*":""})).replace(W,"$1"),n,u<i&&Ce(e.slice(u,i)),i<o&&Ce(e=e.slice(i)),i<o&&ye(e))}p.push(n)}return Se(p)}return ge.prototype=l.filters=l.pseudos,l.setFilters=new ge,r=ae.tokenize=function(e,t){var n,i,o,r,a,u,s,c=A[e+" "];if(c)return t?0:c.slice(0);for(a=e,u=[],s=l.preFilter;a;){for(r in n&&!(i=z.exec(a))||(i&&(a=a.slice(i[0].length)||a),u.push(o=[])),n=!1,(i=$.exec(a))&&(n=i.shift(),o.push({value:n,type:i[0].replace(W," ")}),a=a.slice(n.length)),l.filter)!(i=K[r].exec(a))||s[r]&&!(i=s[r](i))||(n=i.shift(),o.push({value:n,type:r,matches:i}),a=a.slice(n.length));if(!n)break}return t?a.length:a?ae.error(e):A(e,u).slice(0)},a=ae.compile=function(e,t){var n,i=[],o=[],a=D[e+" "];if(!a){for(t||(t=r(e)),n=t.length;n--;)(a=Ce(t[n]))[_]?i.push(a):o.push(a);(a=D(e,function(e,t){var n=t.length>0,i=e.length>0,o=function(o,r,a,u,c){var d,m,h,E=0,g="0",y=o&&[],_=[],S=s,T=o||i&&l.find.TAG("*",c),C=b+=null==S?1:Math.random()||.1,A=T.length;for(c&&(s=r==v||r||c);g!==A&&null!=(d=T[g]);g++){if(i&&d){for(m=0,r||d.ownerDocument==v||(p(d),a=!f);h=e[m++];)if(h(d,r||v,a)){u.push(d);break}c&&(b=C)}n&&((d=!h&&d)&&E--,o&&y.push(d))}if(E+=g,n&&g!==E){for(m=0;h=t[m++];)h(y,_,r,a);if(o){if(E>0)for(;g--;)y[g]||_[g]||(_[g]=I.call(u));_=be(_)}O.apply(u,_),c&&!o&&_.length>0&&E+t.length>1&&ae.uniqueSort(u)}return c&&(b=C,s=S),y};return n?se(o):o}(o,i))).selector=e}return a},u=ae.select=function(e,t,n,i){var o,u,s,c,d,p="function"==typeof e&&e,v=!i&&r(e=p.selector||e);if(n=n||[],1===v.length){if((u=v[0]=v[0].slice(0)).length>2&&"ID"===(s=u[0]).type&&9===t.nodeType&&f&&l.relative[u[1].type]){if(!(t=(l.find.ID(s.matches[0].replace(te,ne),t)||[])[0]))return n;p&&(t=t.parentNode),e=e.slice(u.shift().value.length)}for(o=K.needsContext.test(e)?0:u.length;o--&&!l.relative[c=(s=u[o]).type];)if((d=l.find[c])&&(i=d(s.matches[0].replace(te,ne),ee.test(u[0].type)&&Ee(t.parentNode)||t))){if(u.splice(o,1),!(e=i.length&&ye(u)))return O.apply(n,i),n;break}}return(p||a(e,v))(i,t,!f,n,!t||ee.test(e)&&Ee(t.parentNode)||t),n},n.sortStable=_.split("").sort(P).join("")===_,n.detectDuplicates=!!d,p(),n.sortDetached=ce(function(e){return 1&e.compareDocumentPosition(v.createElement("fieldset"))}),ce(function(e){return e.innerHTML="<a href='#'></a>","#"===e.firstChild.getAttribute("href")})||de("type|href|height|width",function(e,t,n){if(!n)return e.getAttribute(t,"type"===t.toLowerCase()?1:2)}),n.attributes&&ce(function(e){return e.innerHTML="<input/>",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||de("value",function(e,t,n){if(!n&&"input"===e.nodeName.toLowerCase())return e.defaultValue}),ce(function(e){return null==e.getAttribute("disabled")})||de(M,function(e,t,n){var l;if(!n)return!0===e[t]?t.toLowerCase():(l=e.getAttributeNode(t))&&l.specified?l.value:null}),ae}(e);_.find=b,_.expr=b.selectors,_.expr[":"]=_.expr.pseudos,_.uniqueSort=_.unique=b.uniqueSort,_.text=b.getText,_.isXMLDoc=b.isXML,_.contains=b.contains,_.escapeSelector=b.escape;var T=function(e,t,n){for(var l=[],i=void 0!==n;(e=e[t])&&9!==e.nodeType;)if(1===e.nodeType){if(i&&_(e).is(n))break;l.push(e)}return l},C=function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n},A=_.expr.match.needsContext;function D(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()}var N=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function P(e,t,n){return m(t)?_.grep(e,function(e,l){return!!t.call(e,l,e)!==n}):t.nodeType?_.grep(e,function(e){return e===t!==n}):"string"!=typeof t?_.grep(e,function(e){return a.call(t,e)>-1!==n}):_.filter(t,e,n)}_.filter=function(e,t,n){var l=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===l.nodeType?_.find.matchesSelector(l,e)?[l]:[]:_.find.matches(e,_.grep(t,function(e){return 1===e.nodeType}))},_.fn.extend({find:function(e){var t,n,l=this.length,i=this;if("string"!=typeof e)return this.pushStack(_(e).filter(function(){for(t=0;t<l;t++)if(_.contains(i[t],this))return!0}));for(n=this.pushStack([]),t=0;t<l;t++)_.find(e,i[t],n);return l>1?_.uniqueSort(n):n},filter:function(e){return this.pushStack(P(this,e||[],!1))},not:function(e){return this.pushStack(P(this,e||[],!0))},is:function(e){return!!P(this,"string"==typeof e&&A.test(e)?_(e):e||[],!1).length}});var x,R=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(_.fn.init=function(e,t,n){var l,i;if(!e)return this;if(n=n||x,"string"==typeof e){if(!(l="<"===e[0]&&">"===e[e.length-1]&&e.length>=3?[null,e,null]:R.exec(e))||!l[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(l[1]){if(_.merge(this,_.parseHTML(l[1],(t=t instanceof _?t[0]:t)&&t.nodeType?t.ownerDocument||t:h,!0)),N.test(l[1])&&_.isPlainObject(t))for(l in t)m(this[l])?this[l](t[l]):this.attr(l,t[l]);return this}return(i=h.getElementById(l[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):m(e)?void 0!==n.ready?n.ready(e):e(_):_.makeArray(e,this)}).prototype=_.fn,x=_(h);var I=/^(?:parents|prev(?:Until|All))/,w={children:!0,contents:!0,next:!0,prev:!0};function O(e,t){for(;(e=e[t])&&1!==e.nodeType;);return e}_.fn.extend({has:function(e){var t=_(e,this),n=t.length;return this.filter(function(){for(var e=0;e<n;e++)if(_.contains(this,t[e]))return!0})},closest:function(e,t){var n,l=0,i=this.length,o=[],r="string"!=typeof e&&_(e);if(!A.test(e))for(;l<i;l++)for(n=this[l];n&&n!==t;n=n.parentNode)if(n.nodeType<11&&(r?r.index(n)>-1:1===n.nodeType&&_.find.matchesSelector(n,e))){o.push(n);break}return this.pushStack(o.length>1?_.uniqueSort(o):o)},index:function(e){return e?"string"==typeof e?a.call(_(e),this[0]):a.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(_.uniqueSort(_.merge(this.get(),_(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),_.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return T(e,"parentNode")},parentsUntil:function(e,t,n){return T(e,"parentNode",n)},next:function(e){return O(e,"nextSibling")},prev:function(e){return O(e,"previousSibling")},nextAll:function(e){return T(e,"nextSibling")},prevAll:function(e){return T(e,"previousSibling")},nextUntil:function(e,t,n){return T(e,"nextSibling",n)},prevUntil:function(e,t,n){return T(e,"previousSibling",n)},siblings:function(e){return C((e.parentNode||{}).firstChild,e)},children:function(e){return C(e.firstChild)},contents:function(e){return null!=e.contentDocument&&l(e.contentDocument)?e.contentDocument:(D(e,"template")&&(e=e.content||e),_.merge([],e.childNodes))}},function(e,t){_.fn[e]=function(n,l){var i=_.map(this,t,n);return"Until"!==e.slice(-5)&&(l=n),l&&"string"==typeof l&&(i=_.filter(l,i)),this.length>1&&(w[e]||_.uniqueSort(i),I.test(e)&&i.reverse()),this.pushStack(i)}});var L=/[^\x20\t\r\n\f]+/g;function k(e){return e}function M(e){throw e}function F(e,t,n,l){var i;try{e&&m(i=e.promise)?i.call(e).done(t).fail(n):e&&m(i=e.then)?i.call(e,t,n):t.apply(void 0,[e].slice(l))}catch(e){n.apply(void 0,[e])}}_.Callbacks=function(e){e="string"==typeof e?function(e){var t={};return _.each(e.match(L)||[],function(e,n){t[n]=!0}),t}(e):_.extend({},e);var t,n,l,i,o=[],r=[],a=-1,u=function(){for(i=i||e.once,l=t=!0;r.length;a=-1)for(n=r.shift();++a<o.length;)!1===o[a].apply(n[0],n[1])&&e.stopOnFalse&&(a=o.length,n=!1);e.memory||(n=!1),t=!1,i&&(o=n?[]:"")},s={add:function(){return o&&(n&&!t&&(a=o.length-1,r.push(n)),function t(n){_.each(n,function(n,l){m(l)?e.unique&&s.has(l)||o.push(l):l&&l.length&&"string"!==y(l)&&t(l)})}(arguments),n&&!t&&u()),this},remove:function(){return _.each(arguments,function(e,t){for(var n;(n=_.inArray(t,o,n))>-1;)o.splice(n,1),n<=a&&a--}),this},has:function(e){return e?_.inArray(e,o)>-1:o.length>0},empty:function(){return o&&(o=[]),this},disable:function(){return i=r=[],o=n="",this},disabled:function(){return!o},lock:function(){return i=r=[],n||t||(o=n=""),this},locked:function(){return!!i},fireWith:function(e,n){return i||(n=[e,(n=n||[]).slice?n.slice():n],r.push(n),t||u()),this},fire:function(){return s.fireWith(this,arguments),this},fired:function(){return!!l}};return s},_.extend({Deferred:function(t){var n=[["notify","progress",_.Callbacks("memory"),_.Callbacks("memory"),2],["resolve","done",_.Callbacks("once memory"),_.Callbacks("once memory"),0,"resolved"],["reject","fail",_.Callbacks("once memory"),_.Callbacks("once memory"),1,"rejected"]],l="pending",i={state:function(){return l},always:function(){return o.done(arguments).fail(arguments),this},catch:function(e){return i.then(null,e)},pipe:function(){var e=arguments;return _.Deferred(function(t){_.each(n,function(n,l){var i=m(e[l[4]])&&e[l[4]];o[l[1]](function(){var e=i&&i.apply(this,arguments);e&&m(e.promise)?e.promise().progress(t.notify).done(t.resolve).fail(t.reject):t[l[0]+"With"](this,i?[e]:arguments)})}),e=null}).promise()},then:function(t,l,i){var o=0;function r(t,n,l,i){return function(){var a=this,u=arguments,s=function(){var e,s;if(!(t<o)){if((e=l.apply(a,u))===n.promise())throw new TypeError("Thenable self-resolution");m(s=e&&("object"==typeof e||"function"==typeof e)&&e.then)?i?s.call(e,r(o,n,k,i),r(o,n,M,i)):(o++,s.call(e,r(o,n,k,i),r(o,n,M,i),r(o,n,k,n.notifyWith))):(l!==k&&(a=void 0,u=[e]),(i||n.resolveWith)(a,u))}},c=i?s:function(){try{s()}catch(e){_.Deferred.exceptionHook&&_.Deferred.exceptionHook(e,c.stackTrace),t+1>=o&&(l!==M&&(a=void 0,u=[e]),n.rejectWith(a,u))}};t?c():(_.Deferred.getStackHook&&(c.stackTrace=_.Deferred.getStackHook()),e.setTimeout(c))}}return _.Deferred(function(e){n[0][3].add(r(0,e,m(i)?i:k,e.notifyWith)),n[1][3].add(r(0,e,m(t)?t:k)),n[2][3].add(r(0,e,m(l)?l:M))}).promise()},promise:function(e){return null!=e?_.extend(e,i):i}},o={};return _.each(n,function(e,t){var r=t[2],a=t[5];i[t[1]]=r.add,a&&r.add(function(){l=a},n[3-e][2].disable,n[3-e][3].disable,n[0][2].lock,n[0][3].lock),r.add(t[3].fire),o[t[0]]=function(){return o[t[0]+"With"](this===o?void 0:this,arguments),this},o[t[0]+"With"]=r.fireWith}),i.promise(o),t&&t.call(o,o),o},when:function(e){var t=arguments.length,n=t,l=Array(n),o=i.call(arguments),r=_.Deferred(),a=function(e){return function(n){l[e]=this,o[e]=arguments.length>1?i.call(arguments):n,--t||r.resolveWith(l,o)}};if(t<=1&&(F(e,r.done(a(n)).resolve,r.reject,!t),"pending"===r.state()||m(o[n]&&o[n].then)))return r.then();for(;n--;)F(o[n],a(n),r.reject);return r.promise()}});var B=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;_.Deferred.exceptionHook=function(t,n){e.console&&e.console.warn&&t&&B.test(t.name)&&e.console.warn("jQuery.Deferred exception: "+t.message,t.stack,n)},_.readyException=function(t){e.setTimeout(function(){throw t})};var U=_.Deferred();function H(){h.removeEventListener("DOMContentLoaded",H),e.removeEventListener("load",H),_.ready()}_.fn.ready=function(e){return U.then(e).catch(function(e){_.readyException(e)}),this},_.extend({isReady:!1,readyWait:1,ready:function(e){(!0===e?--_.readyWait:_.isReady)||(_.isReady=!0,!0!==e&&--_.readyWait>0||U.resolveWith(h,[_]))}}),_.ready.then=U.then,"complete"===h.readyState||"loading"!==h.readyState&&!h.documentElement.doScroll?e.setTimeout(_.ready):(h.addEventListener("DOMContentLoaded",H),e.addEventListener("load",H));var j=function(e,t,n,l,i,o,r){var a=0,u=e.length,s=null==n;if("object"===y(n))for(a in i=!0,n)j(e,t,a,n[a],!0,o,r);else if(void 0!==l&&(i=!0,m(l)||(r=!0),s&&(r?(t.call(e,l),t=null):(s=t,t=function(e,t,n){return s.call(_(e),n)})),t))for(;a<u;a++)t(e[a],n,r?l:l.call(e[a],a,t(e[a],n)));return i?e:s?t.call(e):u?t(e[0],n):o},W=/^-ms-/,z=/-([a-z])/g;function $(e,t){return t.toUpperCase()}function V(e){return e.replace(W,"ms-").replace(z,$)}var q=function(e){return 1===e.nodeType||9===e.nodeType||!+e.nodeType};function G(){this.expando=_.expando+G.uid++}G.uid=1,G.prototype={cache:function(e){var t=e[this.expando];return t||(t={},q(e)&&(e.nodeType?e[this.expando]=t:Object.defineProperty(e,this.expando,{value:t,configurable:!0}))),t},set:function(e,t,n){var l,i=this.cache(e);if("string"==typeof t)i[V(t)]=n;else for(l in t)i[V(l)]=t[l];return i},get:function(e,t){return void 0===t?this.cache(e):e[this.expando]&&e[this.expando][V(t)]},access:function(e,t,n){return void 0===t||t&&"string"==typeof t&&void 0===n?this.get(e,t):(this.set(e,t,n),void 0!==n?n:t)},remove:function(e,t){var n,l=e[this.expando];if(void 0!==l){if(void 0!==t){n=(t=Array.isArray(t)?t.map(V):(t=V(t))in l?[t]:t.match(L)||[]).length;for(;n--;)delete l[t[n]]}(void 0===t||_.isEmptyObject(l))&&(e.nodeType?e[this.expando]=void 0:delete e[this.expando])}},hasData:function(e){var t=e[this.expando];return void 0!==t&&!_.isEmptyObject(t)}};var K=new G,Y=new G,X=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,Z=/[A-Z]/g;function J(e,t,n){var l;if(void 0===n&&1===e.nodeType)if(l="data-"+t.replace(Z,"-$&").toLowerCase(),"string"==typeof(n=e.getAttribute(l))){try{n=function(e){return"true"===e||"false"!==e&&("null"===e?null:e===+e+""?+e:X.test(e)?JSON.parse(e):e)}(n)}catch(e){}Y.set(e,t,n)}else n=void 0;return n}_.extend({hasData:function(e){return Y.hasData(e)||K.hasData(e)},data:function(e,t,n){return Y.access(e,t,n)},removeData:function(e,t){Y.remove(e,t)},_data:function(e,t,n){return K.access(e,t,n)},_removeData:function(e,t){K.remove(e,t)}}),_.fn.extend({data:function(e,t){var n,l,i,o=this[0],r=o&&o.attributes;if(void 0===e){if(this.length&&(i=Y.get(o),1===o.nodeType&&!K.get(o,"hasDataAttrs"))){for(n=r.length;n--;)r[n]&&0===(l=r[n].name).indexOf("data-")&&(l=V(l.slice(5)),J(o,l,i[l]));K.set(o,"hasDataAttrs",!0)}return i}return"object"==typeof e?this.each(function(){Y.set(this,e)}):j(this,function(t){var n;if(o&&void 0===t)return void 0!==(n=Y.get(o,e))||void 0!==(n=J(o,e))?n:void 0;this.each(function(){Y.set(this,e,t)})},null,t,arguments.length>1,null,!0)},removeData:function(e){return this.each(function(){Y.remove(this,e)})}}),_.extend({queue:function(e,t,n){var l;if(e)return l=K.get(e,t=(t||"fx")+"queue"),n&&(!l||Array.isArray(n)?l=K.access(e,t,_.makeArray(n)):l.push(n)),l||[]},dequeue:function(e,t){var n=_.queue(e,t=t||"fx"),l=n.length,i=n.shift(),o=_._queueHooks(e,t);"inprogress"===i&&(i=n.shift(),l--),i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,function(){_.dequeue(e,t)},o)),!l&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return K.get(e,n)||K.access(e,n,{empty:_.Callbacks("once memory").add(function(){K.remove(e,[t+"queue",n])})})}}),_.fn.extend({queue:function(e,t){var n=2;return"string"!=typeof e&&(t=e,e="fx",n--),arguments.length<n?_.queue(this[0],e):void 0===t?this:this.each(function(){var n=_.queue(this,e,t);_._queueHooks(this,e),"fx"===e&&"inprogress"!==n[0]&&_.dequeue(this,e)})},dequeue:function(e){return this.each(function(){_.dequeue(this,e)})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,t){var n,l=1,i=_.Deferred(),o=this,r=this.length,a=function(){--l||i.resolveWith(o,[o])};for("string"!=typeof e&&(t=e,e=void 0),e=e||"fx";r--;)(n=K.get(o[r],e+"queueHooks"))&&n.empty&&(l++,n.empty.add(a));return a(),i.promise(t)}});var Q=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,ee=new RegExp("^(?:([+-])=|)("+Q+")([a-z%]*)$","i"),te=["Top","Right","Bottom","Left"],ne=h.documentElement,le=function(e){return _.contains(e.ownerDocument,e)},ie={composed:!0};ne.getRootNode&&(le=function(e){return _.contains(e.ownerDocument,e)||e.getRootNode(ie)===e.ownerDocument});var oe=function(e,t){return"none"===(e=t||e).style.display||""===e.style.display&&le(e)&&"none"===_.css(e,"display")};function re(e,t,n,l){var i,o,r=20,a=l?function(){return l.cur()}:function(){return _.css(e,t,"")},u=a(),s=n&&n[3]||(_.cssNumber[t]?"":"px"),c=e.nodeType&&(_.cssNumber[t]||"px"!==s&&+u)&&ee.exec(_.css(e,t));if(c&&c[3]!==s){for(s=s||c[3],c=+(u/=2)||1;r--;)_.style(e,t,c+s),(1-o)*(1-(o=a()/u||.5))<=0&&(r=0),c/=o;_.style(e,t,(c*=2)+s),n=n||[]}return n&&(c=+c||+u||0,i=n[1]?c+(n[1]+1)*n[2]:+n[2],l&&(l.unit=s,l.start=c,l.end=i)),i}var ae={};function ue(e){var t,n=e.ownerDocument,l=e.nodeName,i=ae[l];return i||(t=n.body.appendChild(n.createElement(l)),i=_.css(t,"display"),t.parentNode.removeChild(t),"none"===i&&(i="block"),ae[l]=i,i)}function se(e,t){for(var n,l,i=[],o=0,r=e.length;o<r;o++)(l=e[o]).style&&(n=l.style.display,t?("none"===n&&(i[o]=K.get(l,"display")||null,i[o]||(l.style.display="")),""===l.style.display&&oe(l)&&(i[o]=ue(l))):"none"!==n&&(i[o]="none",K.set(l,"display",n)));for(o=0;o<r;o++)null!=i[o]&&(e[o].style.display=i[o]);return e}_.fn.extend({show:function(){return se(this,!0)},hide:function(){return se(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each(function(){oe(this)?_(this).show():_(this).hide()})}});var ce,de,pe=/^(?:checkbox|radio)$/i,ve=/<([a-z][^\/\0>\x20\t\r\n\f]*)/i,me=/^$|^module$|\/(?:java|ecma)script/i;ce=h.createDocumentFragment().appendChild(h.createElement("div")),(de=h.createElement("input")).setAttribute("type","radio"),de.setAttribute("checked","checked"),de.setAttribute("name","t"),ce.appendChild(de),v.checkClone=ce.cloneNode(!0).cloneNode(!0).lastChild.checked,ce.innerHTML="<textarea>x</textarea>",v.noCloneChecked=!!ce.cloneNode(!0).lastChild.defaultValue,ce.innerHTML="<option></option>",v.option=!!ce.lastChild;var fe={thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};function he(e,t){var n;return n=void 0!==e.getElementsByTagName?e.getElementsByTagName(t||"*"):void 0!==e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&D(e,t)?_.merge([e],n):n}function Ee(e,t){for(var n=0,l=e.length;n<l;n++)K.set(e[n],"globalEval",!t||K.get(t[n],"globalEval"))}fe.tbody=fe.tfoot=fe.colgroup=fe.caption=fe.thead,fe.th=fe.td,v.option||(fe.optgroup=fe.option=[1,"<select multiple='multiple'>","</select>"]);var ge=/<|&#?\w+;/;function ye(e,t,n,l,i){for(var o,r,a,u,s,c,d=t.createDocumentFragment(),p=[],v=0,m=e.length;v<m;v++)if((o=e[v])||0===o)if("object"===y(o))_.merge(p,o.nodeType?[o]:o);else if(ge.test(o)){for(r=r||d.appendChild(t.createElement("div")),a=(ve.exec(o)||["",""])[1].toLowerCase(),r.innerHTML=(u=fe[a]||fe._default)[1]+_.htmlPrefilter(o)+u[2],c=u[0];c--;)r=r.lastChild;_.merge(p,r.childNodes),(r=d.firstChild).textContent=""}else p.push(t.createTextNode(o));for(d.textContent="",v=0;o=p[v++];)if(l&&_.inArray(o,l)>-1)i&&i.push(o);else if(s=le(o),r=he(d.appendChild(o),"script"),s&&Ee(r),n)for(c=0;o=r[c++];)me.test(o.type||"")&&n.push(o);return d}var _e=/^([^.]*)(?:\.(.+)|)/;function Se(){return!0}function be(){return!1}function Te(e,t){return e===function(){try{return h.activeElement}catch(e){}}()==("focus"===t)}function Ce(e,t,n,l,i,o){var r,a;if("object"==typeof t){for(a in"string"!=typeof n&&(l=l||n,n=void 0),t)Ce(e,a,n,l,t[a],o);return e}if(null==l&&null==i?(i=n,l=n=void 0):null==i&&("string"==typeof n?(i=l,l=void 0):(i=l,l=n,n=void 0)),!1===i)i=be;else if(!i)return e;return 1===o&&(r=i,(i=function(e){return _().off(e),r.apply(this,arguments)}).guid=r.guid||(r.guid=_.guid++)),e.each(function(){_.event.add(this,t,i,l,n)})}function Ae(e,t,n){n?(K.set(e,t,!1),_.event.add(e,t,{namespace:!1,handler:function(e){var l,o,r=K.get(this,t);if(1&e.isTrigger&&this[t]){if(r.length)(_.event.special[t]||{}).delegateType&&e.stopPropagation();else if(r=i.call(arguments),K.set(this,t,r),l=n(this,t),this[t](),r!==(o=K.get(this,t))||l?K.set(this,t,!1):o={},r!==o)return e.stopImmediatePropagation(),e.preventDefault(),o&&o.value}else r.length&&(K.set(this,t,{value:_.event.trigger(_.extend(r[0],_.Event.prototype),r.slice(1),this)}),e.stopImmediatePropagation())}})):void 0===K.get(e,t)&&_.event.add(e,t,Se)}_.event={global:{},add:function(e,t,n,l,i){var o,r,a,u,s,c,d,p,v,m,f,h=K.get(e);if(q(e))for(n.handler&&(n=(o=n).handler,i=o.selector),i&&_.find.matchesSelector(ne,i),n.guid||(n.guid=_.guid++),(u=h.events)||(u=h.events=Object.create(null)),(r=h.handle)||(r=h.handle=function(t){return void 0!==_&&_.event.triggered!==t.type?_.event.dispatch.apply(e,arguments):void 0}),s=(t=(t||"").match(L)||[""]).length;s--;)v=f=(a=_e.exec(t[s])||[])[1],m=(a[2]||"").split(".").sort(),v&&(d=_.event.special[v]||{},d=_.event.special[v=(i?d.delegateType:d.bindType)||v]||{},c=_.extend({type:v,origType:f,data:l,handler:n,guid:n.guid,selector:i,needsContext:i&&_.expr.match.needsContext.test(i),namespace:m.join(".")},o),(p=u[v])||((p=u[v]=[]).delegateCount=0,d.setup&&!1!==d.setup.call(e,l,m,r)||e.addEventListener&&e.addEventListener(v,r)),d.add&&(d.add.call(e,c),c.handler.guid||(c.handler.guid=n.guid)),i?p.splice(p.delegateCount++,0,c):p.push(c),_.event.global[v]=!0)},remove:function(e,t,n,l,i){var o,r,a,u,s,c,d,p,v,m,f,h=K.hasData(e)&&K.get(e);if(h&&(u=h.events)){for(s=(t=(t||"").match(L)||[""]).length;s--;)if(v=f=(a=_e.exec(t[s])||[])[1],m=(a[2]||"").split(".").sort(),v){for(d=_.event.special[v]||{},p=u[v=(l?d.delegateType:d.bindType)||v]||[],a=a[2]&&new RegExp("(^|\\.)"+m.join("\\.(?:.*\\.|)")+"(\\.|$)"),r=o=p.length;o--;)c=p[o],!i&&f!==c.origType||n&&n.guid!==c.guid||a&&!a.test(c.namespace)||l&&l!==c.selector&&("**"!==l||!c.selector)||(p.splice(o,1),c.selector&&p.delegateCount--,d.remove&&d.remove.call(e,c));r&&!p.length&&(d.teardown&&!1!==d.teardown.call(e,m,h.handle)||_.removeEvent(e,v,h.handle),delete u[v])}else for(v in u)_.event.remove(e,v+t[s],n,l,!0);_.isEmptyObject(u)&&K.remove(e,"handle events")}},dispatch:function(e){var t,n,l,i,o,r,a=new Array(arguments.length),u=_.event.fix(e),s=(K.get(this,"events")||Object.create(null))[u.type]||[],c=_.event.special[u.type]||{};for(a[0]=u,t=1;t<arguments.length;t++)a[t]=arguments[t];if(u.delegateTarget=this,!c.preDispatch||!1!==c.preDispatch.call(this,u)){for(r=_.event.handlers.call(this,u,s),t=0;(i=r[t++])&&!u.isPropagationStopped();)for(u.currentTarget=i.elem,n=0;(o=i.handlers[n++])&&!u.isImmediatePropagationStopped();)u.rnamespace&&!1!==o.namespace&&!u.rnamespace.test(o.namespace)||(u.handleObj=o,u.data=o.data,void 0!==(l=((_.event.special[o.origType]||{}).handle||o.handler).apply(i.elem,a))&&!1===(u.result=l)&&(u.preventDefault(),u.stopPropagation()));return c.postDispatch&&c.postDispatch.call(this,u),u.result}},handlers:function(e,t){var n,l,i,o,r,a=[],u=t.delegateCount,s=e.target;if(u&&s.nodeType&&!("click"===e.type&&e.button>=1))for(;s!==this;s=s.parentNode||this)if(1===s.nodeType&&("click"!==e.type||!0!==s.disabled)){for(o=[],r={},n=0;n<u;n++)void 0===r[i=(l=t[n]).selector+" "]&&(r[i]=l.needsContext?_(i,this).index(s)>-1:_.find(i,this,null,[s]).length),r[i]&&o.push(l);o.length&&a.push({elem:s,handlers:o})}return s=this,u<t.length&&a.push({elem:s,handlers:t.slice(u)}),a},addProp:function(e,t){Object.defineProperty(_.Event.prototype,e,{enumerable:!0,configurable:!0,get:m(t)?function(){if(this.originalEvent)return t(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[e]},set:function(t){Object.defineProperty(this,e,{enumerable:!0,configurable:!0,writable:!0,value:t})}})},fix:function(e){return e[_.expando]?e:new _.Event(e)},special:{load:{noBubble:!0},click:{setup:function(e){var t=this||e;return pe.test(t.type)&&t.click&&D(t,"input")&&Ae(t,"click",Se),!1},trigger:function(e){var t=this||e;return pe.test(t.type)&&t.click&&D(t,"input")&&Ae(t,"click"),!0},_default:function(e){var t=e.target;return pe.test(t.type)&&t.click&&D(t,"input")&&K.get(t,"click")||D(t,"a")}},beforeunload:{postDispatch:function(e){void 0!==e.result&&e.originalEvent&&(e.originalEvent.returnValue=e.result)}}}},_.removeEvent=function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n)},_.Event=function(e,t){if(!(this instanceof _.Event))return new _.Event(e,t);e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||void 0===e.defaultPrevented&&!1===e.returnValue?Se:be,this.target=e.target&&3===e.target.nodeType?e.target.parentNode:e.target,this.currentTarget=e.currentTarget,this.relatedTarget=e.relatedTarget):this.type=e,t&&_.extend(this,t),this.timeStamp=e&&e.timeStamp||Date.now(),this[_.expando]=!0},_.Event.prototype={constructor:_.Event,isDefaultPrevented:be,isPropagationStopped:be,isImmediatePropagationStopped:be,isSimulated:!1,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=Se,e&&!this.isSimulated&&e.preventDefault()},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=Se,e&&!this.isSimulated&&e.stopPropagation()},stopImmediatePropagation:function(){var e=this.originalEvent;this.isImmediatePropagationStopped=Se,e&&!this.isSimulated&&e.stopImmediatePropagation(),this.stopPropagation()}},_.each({altKey:!0,bubbles:!0,cancelable:!0,changedTouches:!0,ctrlKey:!0,detail:!0,eventPhase:!0,metaKey:!0,pageX:!0,pageY:!0,shiftKey:!0,view:!0,char:!0,code:!0,charCode:!0,key:!0,keyCode:!0,button:!0,buttons:!0,clientX:!0,clientY:!0,offsetX:!0,offsetY:!0,pointerId:!0,pointerType:!0,screenX:!0,screenY:!0,targetTouches:!0,toElement:!0,touches:!0,which:!0},_.event.addProp),_.each({focus:"focusin",blur:"focusout"},function(e,t){_.event.special[e]={setup:function(){return Ae(this,e,Te),!1},trigger:function(){return Ae(this,e),!0},_default:function(){return!0},delegateType:t}}),_.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(e,t){_.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,l=this,i=e.relatedTarget,o=e.handleObj;return i&&(i===l||_.contains(l,i))||(e.type=o.origType,n=o.handler.apply(this,arguments),e.type=t),n}}}),_.fn.extend({on:function(e,t,n,l){return Ce(this,e,t,n,l)},one:function(e,t,n,l){return Ce(this,e,t,n,l,1)},off:function(e,t,n){var l,i;if(e&&e.preventDefault&&e.handleObj)return l=e.handleObj,_(e.delegateTarget).off(l.namespace?l.origType+"."+l.namespace:l.origType,l.selector,l.handler),this;if("object"==typeof e){for(i in e)this.off(i,t,e[i]);return this}return!1!==t&&"function"!=typeof t||(n=t,t=void 0),!1===n&&(n=be),this.each(function(){_.event.remove(this,e,n,t)})}});var De=/<script|<style|<link/i,Ne=/checked\s*(?:[^=]|=\s*.checked.)/i,Pe=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;function xe(e,t){return D(e,"table")&&D(11!==t.nodeType?t:t.firstChild,"tr")&&_(e).children("tbody")[0]||e}function Re(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function Ie(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function we(e,t){var n,l,i,o,r,a;if(1===t.nodeType){if(K.hasData(e)&&(a=K.get(e).events))for(i in K.remove(t,"handle events"),a)for(n=0,l=a[i].length;n<l;n++)_.event.add(t,i,a[i][n]);Y.hasData(e)&&(o=Y.access(e),r=_.extend({},o),Y.set(t,r))}}function Oe(e,t){var n=t.nodeName.toLowerCase();"input"===n&&pe.test(e.type)?t.checked=e.checked:"input"!==n&&"textarea"!==n||(t.defaultValue=e.defaultValue)}function Le(e,t,n,l){t=o(t);var i,r,a,u,s,c,d=0,p=e.length,f=p-1,h=t[0],E=m(h);if(E||p>1&&"string"==typeof h&&!v.checkClone&&Ne.test(h))return e.each(function(i){var o=e.eq(i);E&&(t[0]=h.call(this,i,o.html())),Le(o,t,n,l)});if(p&&(r=(i=ye(t,e[0].ownerDocument,!1,e,l)).firstChild,1===i.childNodes.length&&(i=r),r||l)){for(u=(a=_.map(he(i,"script"),Re)).length;d<p;d++)s=i,d!==f&&(s=_.clone(s,!0,!0),u&&_.merge(a,he(s,"script"))),n.call(e[d],s,d);if(u)for(c=a[a.length-1].ownerDocument,_.map(a,Ie),d=0;d<u;d++)me.test((s=a[d]).type||"")&&!K.access(s,"globalEval")&&_.contains(c,s)&&(s.src&&"module"!==(s.type||"").toLowerCase()?_._evalUrl&&!s.noModule&&_._evalUrl(s.src,{nonce:s.nonce||s.getAttribute("nonce")},c):g(s.textContent.replace(Pe,""),s,c))}return e}function ke(e,t,n){for(var l,i=t?_.filter(t,e):e,o=0;null!=(l=i[o]);o++)n||1!==l.nodeType||_.cleanData(he(l)),l.parentNode&&(n&&le(l)&&Ee(he(l,"script")),l.parentNode.removeChild(l));return e}_.extend({htmlPrefilter:function(e){return e},clone:function(e,t,n){var l,i,o,r,a=e.cloneNode(!0),u=le(e);if(!(v.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||_.isXMLDoc(e)))for(r=he(a),l=0,i=(o=he(e)).length;l<i;l++)Oe(o[l],r[l]);if(t)if(n)for(o=o||he(e),r=r||he(a),l=0,i=o.length;l<i;l++)we(o[l],r[l]);else we(e,a);return(r=he(a,"script")).length>0&&Ee(r,!u&&he(e,"script")),a},cleanData:function(e){for(var t,n,l,i=_.event.special,o=0;void 0!==(n=e[o]);o++)if(q(n)){if(t=n[K.expando]){if(t.events)for(l in t.events)i[l]?_.event.remove(n,l):_.removeEvent(n,l,t.handle);n[K.expando]=void 0}n[Y.expando]&&(n[Y.expando]=void 0)}}}),_.fn.extend({detach:function(e){return ke(this,e,!0)},remove:function(e){return ke(this,e)},text:function(e){return j(this,function(e){return void 0===e?_.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=e)})},null,e,arguments.length)},append:function(){return Le(this,arguments,function(e){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||xe(this,e).appendChild(e)})},prepend:function(){return Le(this,arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=xe(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return Le(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return Le(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)1===e.nodeType&&(_.cleanData(he(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map(function(){return _.clone(this,e,t)})},html:function(e){return j(this,function(e){var t=this[0]||{},n=0,l=this.length;if(void 0===e&&1===t.nodeType)return t.innerHTML;if("string"==typeof e&&!De.test(e)&&!fe[(ve.exec(e)||["",""])[1].toLowerCase()]){e=_.htmlPrefilter(e);try{for(;n<l;n++)1===(t=this[n]||{}).nodeType&&(_.cleanData(he(t,!1)),t.innerHTML=e);t=0}catch(e){}}t&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(){var e=[];return Le(this,arguments,function(t){var n=this.parentNode;_.inArray(this,e)<0&&(_.cleanData(he(this)),n&&n.replaceChild(t,this))},e)}}),_.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){_.fn[e]=function(e){for(var n,l=[],i=_(e),o=i.length-1,a=0;a<=o;a++)n=a===o?this:this.clone(!0),_(i[a])[t](n),r.apply(l,n.get());return this.pushStack(l)}});var Me=new RegExp("^("+Q+")(?!px)[a-z%]+$","i"),Fe=function(t){var n=t.ownerDocument.defaultView;return n&&n.opener||(n=e),n.getComputedStyle(t)},Be=function(e,t,n){var l,i,o={};for(i in t)o[i]=e.style[i],e.style[i]=t[i];for(i in l=n.call(e),t)e.style[i]=o[i];return l},Ue=new RegExp(te.join("|"),"i");function He(e,t,n){var l,i,o,r,a=e.style;return(n=n||Fe(e))&&(""!==(r=n.getPropertyValue(t)||n[t])||le(e)||(r=_.style(e,t)),!v.pixelBoxStyles()&&Me.test(r)&&Ue.test(t)&&(l=a.width,i=a.minWidth,o=a.maxWidth,a.minWidth=a.maxWidth=a.width=r,r=n.width,a.width=l,a.minWidth=i,a.maxWidth=o)),void 0!==r?r+"":r}function je(e,t){return{get:function(){if(!e())return(this.get=t).apply(this,arguments);delete this.get}}}!function(){function t(){if(c){s.style.cssText="position:absolute;left:-11111px;width:60px;margin-top:1px;padding:0;border:0",c.style.cssText="position:relative;display:block;box-sizing:border-box;overflow:scroll;margin:auto;border:1px;padding:1px;width:60%;top:1%",ne.appendChild(s).appendChild(c);var t=e.getComputedStyle(c);l="1%"!==t.top,u=12===n(t.marginLeft),c.style.right="60%",r=36===n(t.right),i=36===n(t.width),c.style.position="absolute",o=12===n(c.offsetWidth/3),ne.removeChild(s),c=null}}function n(e){return Math.round(parseFloat(e))}var l,i,o,r,a,u,s=h.createElement("div"),c=h.createElement("div");c.style&&(c.style.backgroundClip="content-box",c.cloneNode(!0).style.backgroundClip="",v.clearCloneStyle="content-box"===c.style.backgroundClip,_.extend(v,{boxSizingReliable:function(){return t(),i},pixelBoxStyles:function(){return t(),r},pixelPosition:function(){return t(),l},reliableMarginLeft:function(){return t(),u},scrollboxSize:function(){return t(),o},reliableTrDimensions:function(){var t,n,l,i;return null==a&&(t=h.createElement("table"),n=h.createElement("tr"),l=h.createElement("div"),t.style.cssText="position:absolute;left:-11111px;border-collapse:separate",n.style.cssText="border:1px solid",n.style.height="1px",l.style.height="9px",l.style.display="block",ne.appendChild(t).appendChild(n).appendChild(l),i=e.getComputedStyle(n),a=parseInt(i.height,10)+parseInt(i.borderTopWidth,10)+parseInt(i.borderBottomWidth,10)===n.offsetHeight,ne.removeChild(t)),a}}))}();var We=["Webkit","Moz","ms"],ze=h.createElement("div").style,$e={};function Ve(e){return _.cssProps[e]||$e[e]||(e in ze?e:$e[e]=function(e){for(var t=e[0].toUpperCase()+e.slice(1),n=We.length;n--;)if((e=We[n]+t)in ze)return e}(e)||e)}var qe=/^(none|table(?!-c[ea]).+)/,Ge=/^--/,Ke={position:"absolute",visibility:"hidden",display:"block"},Ye={letterSpacing:"0",fontWeight:"400"};function Xe(e,t,n){var l=ee.exec(t);return l?Math.max(0,l[2]-(n||0))+(l[3]||"px"):t}function Ze(e,t,n,l,i,o){var r="width"===t?1:0,a=0,u=0;if(n===(l?"border":"content"))return 0;for(;r<4;r+=2)"margin"===n&&(u+=_.css(e,n+te[r],!0,i)),l?("content"===n&&(u-=_.css(e,"padding"+te[r],!0,i)),"margin"!==n&&(u-=_.css(e,"border"+te[r]+"Width",!0,i))):(u+=_.css(e,"padding"+te[r],!0,i),"padding"!==n?u+=_.css(e,"border"+te[r]+"Width",!0,i):a+=_.css(e,"border"+te[r]+"Width",!0,i));return!l&&o>=0&&(u+=Math.max(0,Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-o-u-a-.5))||0),u}function Je(e,t,n){var l=Fe(e),i=(!v.boxSizingReliable()||n)&&"border-box"===_.css(e,"boxSizing",!1,l),o=i,r=He(e,t,l),a="offset"+t[0].toUpperCase()+t.slice(1);if(Me.test(r)){if(!n)return r;r="auto"}return(!v.boxSizingReliable()&&i||!v.reliableTrDimensions()&&D(e,"tr")||"auto"===r||!parseFloat(r)&&"inline"===_.css(e,"display",!1,l))&&e.getClientRects().length&&(i="border-box"===_.css(e,"boxSizing",!1,l),(o=a in e)&&(r=e[a])),(r=parseFloat(r)||0)+Ze(e,t,n||(i?"border":"content"),o,l,r)+"px"}function Qe(e,t,n,l,i){return new Qe.prototype.init(e,t,n,l,i)}_.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=He(e,"opacity");return""===n?"1":n}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{},style:function(e,t,n,l){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var i,o,r,a=V(t),u=Ge.test(t),s=e.style;if(u||(t=Ve(a)),r=_.cssHooks[t]||_.cssHooks[a],void 0===n)return r&&"get"in r&&void 0!==(i=r.get(e,!1,l))?i:s[t];"string"==(o=typeof n)&&(i=ee.exec(n))&&i[1]&&(n=re(e,t,i),o="number"),null!=n&&n==n&&("number"!==o||u||(n+=i&&i[3]||(_.cssNumber[a]?"":"px")),v.clearCloneStyle||""!==n||0!==t.indexOf("background")||(s[t]="inherit"),r&&"set"in r&&void 0===(n=r.set(e,n,l))||(u?s.setProperty(t,n):s[t]=n))}},css:function(e,t,n,l){var i,o,r,a=V(t);return Ge.test(t)||(t=Ve(a)),(r=_.cssHooks[t]||_.cssHooks[a])&&"get"in r&&(i=r.get(e,!0,n)),void 0===i&&(i=He(e,t,l)),"normal"===i&&t in Ye&&(i=Ye[t]),""===n||n?(o=parseFloat(i),!0===n||isFinite(o)?o||0:i):i}}),_.each(["height","width"],function(e,t){_.cssHooks[t]={get:function(e,n,l){if(n)return!qe.test(_.css(e,"display"))||e.getClientRects().length&&e.getBoundingClientRect().width?Je(e,t,l):Be(e,Ke,function(){return Je(e,t,l)})},set:function(e,n,l){var i,o=Fe(e),r=!v.scrollboxSize()&&"absolute"===o.position,a=(r||l)&&"border-box"===_.css(e,"boxSizing",!1,o),u=l?Ze(e,t,l,a,o):0;return a&&r&&(u-=Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-parseFloat(o[t])-Ze(e,t,"border",!1,o)-.5)),u&&(i=ee.exec(n))&&"px"!==(i[3]||"px")&&(e.style[t]=n,n=_.css(e,t)),Xe(0,n,u)}}}),_.cssHooks.marginLeft=je(v.reliableMarginLeft,function(e,t){if(t)return(parseFloat(He(e,"marginLeft"))||e.getBoundingClientRect().left-Be(e,{marginLeft:0},function(){return e.getBoundingClientRect().left}))+"px"}),_.each({margin:"",padding:"",border:"Width"},function(e,t){_.cssHooks[e+t]={expand:function(n){for(var l=0,i={},o="string"==typeof n?n.split(" "):[n];l<4;l++)i[e+te[l]+t]=o[l]||o[l-2]||o[0];return i}},"margin"!==e&&(_.cssHooks[e+t].set=Xe)}),_.fn.extend({css:function(e,t){return j(this,function(e,t,n){var l,i,o={},r=0;if(Array.isArray(t)){for(l=Fe(e),i=t.length;r<i;r++)o[t[r]]=_.css(e,t[r],!1,l);return o}return void 0!==n?_.style(e,t,n):_.css(e,t)},e,t,arguments.length>1)}}),_.Tween=Qe,(Qe.prototype={constructor:Qe,init:function(e,t,n,l,i,o){this.elem=e,this.prop=n,this.easing=i||_.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=l,this.unit=o||(_.cssNumber[n]?"":"px")},cur:function(){var e=Qe.propHooks[this.prop];return e&&e.get?e.get(this):Qe.propHooks._default.get(this)},run:function(e){var t,n=Qe.propHooks[this.prop];return this.pos=t=this.options.duration?_.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):Qe.propHooks._default.set(this),this}}).init.prototype=Qe.prototype,(Qe.propHooks={_default:{get:function(e){var t;return 1!==e.elem.nodeType||null!=e.elem[e.prop]&&null==e.elem.style[e.prop]?e.elem[e.prop]:(t=_.css(e.elem,e.prop,""))&&"auto"!==t?t:0},set:function(e){_.fx.step[e.prop]?_.fx.step[e.prop](e):1!==e.elem.nodeType||!_.cssHooks[e.prop]&&null==e.elem.style[Ve(e.prop)]?e.elem[e.prop]=e.now:_.style(e.elem,e.prop,e.now+e.unit)}}}).scrollTop=Qe.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},_.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"},_.fx=Qe.prototype.init,_.fx.step={};var et,tt,nt=/^(?:toggle|show|hide)$/,lt=/queueHooks$/;function it(){tt&&(!1===h.hidden&&e.requestAnimationFrame?e.requestAnimationFrame(it):e.setTimeout(it,_.fx.interval),_.fx.tick())}function ot(){return e.setTimeout(function(){et=void 0}),et=Date.now()}function rt(e,t){var n,l=0,i={height:e};for(t=t?1:0;l<4;l+=2-t)i["margin"+(n=te[l])]=i["padding"+n]=e;return t&&(i.opacity=i.width=e),i}function at(e,t,n){for(var l,i=(ut.tweeners[t]||[]).concat(ut.tweeners["*"]),o=0,r=i.length;o<r;o++)if(l=i[o].call(n,t,e))return l}function ut(e,t,n){var l,i,o=0,r=ut.prefilters.length,a=_.Deferred().always(function(){delete u.elem}),u=function(){if(i)return!1;for(var t=et||ot(),n=Math.max(0,s.startTime+s.duration-t),l=1-(n/s.duration||0),o=0,r=s.tweens.length;o<r;o++)s.tweens[o].run(l);return a.notifyWith(e,[s,l,n]),l<1&&r?n:(r||a.notifyWith(e,[s,1,0]),a.resolveWith(e,[s]),!1)},s=a.promise({elem:e,props:_.extend({},t),opts:_.extend(!0,{specialEasing:{},easing:_.easing._default},n),originalProperties:t,originalOptions:n,startTime:et||ot(),duration:n.duration,tweens:[],createTween:function(t,n){var l=_.Tween(e,s.opts,t,n,s.opts.specialEasing[t]||s.opts.easing);return s.tweens.push(l),l},stop:function(t){var n=0,l=t?s.tweens.length:0;if(i)return this;for(i=!0;n<l;n++)s.tweens[n].run(1);return t?(a.notifyWith(e,[s,1,0]),a.resolveWith(e,[s,t])):a.rejectWith(e,[s,t]),this}}),c=s.props;for(function(e,t){var n,l,i,o,r;for(n in e)if(i=t[l=V(n)],o=e[n],Array.isArray(o)&&(i=o[1],o=e[n]=o[0]),n!==l&&(e[l]=o,delete e[n]),(r=_.cssHooks[l])&&"expand"in r)for(n in o=r.expand(o),delete e[l],o)n in e||(e[n]=o[n],t[n]=i);else t[l]=i}(c,s.opts.specialEasing);o<r;o++)if(l=ut.prefilters[o].call(s,e,c,s.opts))return m(l.stop)&&(_._queueHooks(s.elem,s.opts.queue).stop=l.stop.bind(l)),l;return _.map(c,at,s),m(s.opts.start)&&s.opts.start.call(e,s),s.progress(s.opts.progress).done(s.opts.done,s.opts.complete).fail(s.opts.fail).always(s.opts.always),_.fx.timer(_.extend(u,{elem:e,anim:s,queue:s.opts.queue})),s}_.Animation=_.extend(ut,{tweeners:{"*":[function(e,t){var n=this.createTween(e,t);return re(n.elem,e,ee.exec(t),n),n}]},tweener:function(e,t){m(e)?(t=e,e=["*"]):e=e.match(L);for(var n,l=0,i=e.length;l<i;l++)(ut.tweeners[n=e[l]]=ut.tweeners[n]||[]).unshift(t)},prefilters:[function(e,t,n){var l,i,o,r,a,u,s,c,d="width"in t||"height"in t,p=this,v={},m=e.style,f=e.nodeType&&oe(e),h=K.get(e,"fxshow");for(l in n.queue||(null==(r=_._queueHooks(e,"fx")).unqueued&&(r.unqueued=0,a=r.empty.fire,r.empty.fire=function(){r.unqueued||a()}),r.unqueued++,p.always(function(){p.always(function(){r.unqueued--,_.queue(e,"fx").length||r.empty.fire()})})),t)if(nt.test(i=t[l])){if(delete t[l],o=o||"toggle"===i,i===(f?"hide":"show")){if("show"!==i||!h||void 0===h[l])continue;f=!0}v[l]=h&&h[l]||_.style(e,l)}if((u=!_.isEmptyObject(t))||!_.isEmptyObject(v))for(l in d&&1===e.nodeType&&(n.overflow=[m.overflow,m.overflowX,m.overflowY],null==(s=h&&h.display)&&(s=K.get(e,"display")),"none"===(c=_.css(e,"display"))&&(s?c=s:(se([e],!0),s=e.style.display||s,c=_.css(e,"display"),se([e]))),("inline"===c||"inline-block"===c&&null!=s)&&"none"===_.css(e,"float")&&(u||(p.done(function(){m.display=s}),null==s&&(s="none"===(c=m.display)?"":c)),m.display="inline-block")),n.overflow&&(m.overflow="hidden",p.always(function(){m.overflow=n.overflow[0],m.overflowX=n.overflow[1],m.overflowY=n.overflow[2]})),u=!1,v)u||(h?"hidden"in h&&(f=h.hidden):h=K.access(e,"fxshow",{display:s}),o&&(h.hidden=!f),f&&se([e],!0),p.done(function(){for(l in f||se([e]),K.remove(e,"fxshow"),v)_.style(e,l,v[l])})),u=at(f?h[l]:0,l,p),l in h||(h[l]=u.start,f&&(u.end=u.start,u.start=0))}],prefilter:function(e,t){t?ut.prefilters.unshift(e):ut.prefilters.push(e)}}),_.speed=function(e,t,n){var l=e&&"object"==typeof e?_.extend({},e):{complete:n||!n&&t||m(e)&&e,duration:e,easing:n&&t||t&&!m(t)&&t};return _.fx.off?l.duration=0:"number"!=typeof l.duration&&(l.duration=l.duration in _.fx.speeds?_.fx.speeds[l.duration]:_.fx.speeds._default),null!=l.queue&&!0!==l.queue||(l.queue="fx"),l.old=l.complete,l.complete=function(){m(l.old)&&l.old.call(this),l.queue&&_.dequeue(this,l.queue)},l},_.fn.extend({fadeTo:function(e,t,n,l){return this.filter(oe).css("opacity",0).show().end().animate({opacity:t},e,n,l)},animate:function(e,t,n,l){var i=_.isEmptyObject(e),o=_.speed(t,n,l),r=function(){var t=ut(this,_.extend({},e),o);(i||K.get(this,"finish"))&&t.stop(!0)};return r.finish=r,i||!1===o.queue?this.each(r):this.queue(o.queue,r)},stop:function(e,t,n){var l=function(e){var t=e.stop;delete e.stop,t(n)};return"string"!=typeof e&&(n=t,t=e,e=void 0),t&&this.queue(e||"fx",[]),this.each(function(){var t=!0,i=null!=e&&e+"queueHooks",o=_.timers,r=K.get(this);if(i)r[i]&&r[i].stop&&l(r[i]);else for(i in r)r[i]&&r[i].stop&<.test(i)&&l(r[i]);for(i=o.length;i--;)o[i].elem!==this||null!=e&&o[i].queue!==e||(o[i].anim.stop(n),t=!1,o.splice(i,1));!t&&n||_.dequeue(this,e)})},finish:function(e){return!1!==e&&(e=e||"fx"),this.each(function(){var t,n=K.get(this),l=n[e+"queue"],i=n[e+"queueHooks"],o=_.timers,r=l?l.length:0;for(n.finish=!0,_.queue(this,e,[]),i&&i.stop&&i.stop.call(this,!0),t=o.length;t--;)o[t].elem===this&&o[t].queue===e&&(o[t].anim.stop(!0),o.splice(t,1));for(t=0;t<r;t++)l[t]&&l[t].finish&&l[t].finish.call(this);delete n.finish})}}),_.each(["toggle","show","hide"],function(e,t){var n=_.fn[t];_.fn[t]=function(e,l,i){return null==e||"boolean"==typeof e?n.apply(this,arguments):this.animate(rt(t,!0),e,l,i)}}),_.each({slideDown:rt("show"),slideUp:rt("hide"),slideToggle:rt("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,t){_.fn[e]=function(e,n,l){return this.animate(t,e,n,l)}}),_.timers=[],_.fx.tick=function(){var e,t=0,n=_.timers;for(et=Date.now();t<n.length;t++)(e=n[t])()||n[t]!==e||n.splice(t--,1);n.length||_.fx.stop(),et=void 0},_.fx.timer=function(e){_.timers.push(e),_.fx.start()},_.fx.interval=13,_.fx.start=function(){tt||(tt=!0,it())},_.fx.stop=function(){tt=null},_.fx.speeds={slow:600,fast:200,_default:400},_.fn.delay=function(t,n){return t=_.fx&&_.fx.speeds[t]||t,this.queue(n=n||"fx",function(n,l){var i=e.setTimeout(n,t);l.stop=function(){e.clearTimeout(i)}})},function(){var e=h.createElement("input"),t=h.createElement("select").appendChild(h.createElement("option"));e.type="checkbox",v.checkOn=""!==e.value,v.optSelected=t.selected,(e=h.createElement("input")).value="t",e.type="radio",v.radioValue="t"===e.value}();var st,ct=_.expr.attrHandle;_.fn.extend({attr:function(e,t){return j(this,_.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){_.removeAttr(this,e)})}}),_.extend({attr:function(e,t,n){var l,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return void 0===e.getAttribute?_.prop(e,t,n):(1===o&&_.isXMLDoc(e)||(i=_.attrHooks[t.toLowerCase()]||(_.expr.match.bool.test(t)?st:void 0)),void 0!==n?null===n?void _.removeAttr(e,t):i&&"set"in i&&void 0!==(l=i.set(e,n,t))?l:(e.setAttribute(t,n+""),n):i&&"get"in i&&null!==(l=i.get(e,t))?l:null==(l=_.find.attr(e,t))?void 0:l)},attrHooks:{type:{set:function(e,t){if(!v.radioValue&&"radio"===t&&D(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},removeAttr:function(e,t){var n,l=0,i=t&&t.match(L);if(i&&1===e.nodeType)for(;n=i[l++];)e.removeAttribute(n)}}),st={set:function(e,t,n){return!1===t?_.removeAttr(e,n):e.setAttribute(n,n),n}},_.each(_.expr.match.bool.source.match(/\w+/g),function(e,t){var n=ct[t]||_.find.attr;ct[t]=function(e,t,l){var i,o,r=t.toLowerCase();return l||(o=ct[r],ct[r]=i,i=null!=n(e,t,l)?r:null,ct[r]=o),i}});var dt=/^(?:input|select|textarea|button)$/i,pt=/^(?:a|area)$/i;function vt(e){return(e.match(L)||[]).join(" ")}function mt(e){return e.getAttribute&&e.getAttribute("class")||""}function ft(e){return Array.isArray(e)?e:"string"==typeof e&&e.match(L)||[]}_.fn.extend({prop:function(e,t){return j(this,_.prop,e,t,arguments.length>1)},removeProp:function(e){return this.each(function(){delete this[_.propFix[e]||e]})}}),_.extend({prop:function(e,t,n){var l,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return 1===o&&_.isXMLDoc(e)||(i=_.propHooks[t=_.propFix[t]||t]),void 0!==n?i&&"set"in i&&void 0!==(l=i.set(e,n,t))?l:e[t]=n:i&&"get"in i&&null!==(l=i.get(e,t))?l:e[t]},propHooks:{tabIndex:{get:function(e){var t=_.find.attr(e,"tabindex");return t?parseInt(t,10):dt.test(e.nodeName)||pt.test(e.nodeName)&&e.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),v.optSelected||(_.propHooks.selected={get:function(e){return null},set:function(e){}}),_.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){_.propFix[this.toLowerCase()]=this}),_.fn.extend({addClass:function(e){var t,n,l,i,o,r,a,u=0;if(m(e))return this.each(function(t){_(this).addClass(e.call(this,t,mt(this)))});if((t=ft(e)).length)for(;n=this[u++];)if(i=mt(n),l=1===n.nodeType&&" "+vt(i)+" "){for(r=0;o=t[r++];)l.indexOf(" "+o+" ")<0&&(l+=o+" ");i!==(a=vt(l))&&n.setAttribute("class",a)}return this},removeClass:function(e){var t,n,l,i,o,r,a,u=0;if(m(e))return this.each(function(t){_(this).removeClass(e.call(this,t,mt(this)))});if(!arguments.length)return this.attr("class","");if((t=ft(e)).length)for(;n=this[u++];)if(i=mt(n),l=1===n.nodeType&&" "+vt(i)+" "){for(r=0;o=t[r++];)for(;l.indexOf(" "+o+" ")>-1;)l=l.replace(" "+o+" "," ");i!==(a=vt(l))&&n.setAttribute("class",a)}return this},toggleClass:function(e,t){var n=typeof e,l="string"===n||Array.isArray(e);return"boolean"==typeof t&&l?t?this.addClass(e):this.removeClass(e):m(e)?this.each(function(n){_(this).toggleClass(e.call(this,n,mt(this),t),t)}):this.each(function(){var t,i,o,r;if(l)for(i=0,o=_(this),r=ft(e);t=r[i++];)o.hasClass(t)?o.removeClass(t):o.addClass(t);else void 0!==e&&"boolean"!==n||((t=mt(this))&&K.set(this,"__className__",t),this.setAttribute&&this.setAttribute("class",t||!1===e?"":K.get(this,"__className__")||""))})},hasClass:function(e){var t,n,l=0;for(t=" "+e+" ";n=this[l++];)if(1===n.nodeType&&(" "+vt(mt(n))+" ").indexOf(t)>-1)return!0;return!1}});var ht=/\r/g;_.fn.extend({val:function(e){var t,n,l,i=this[0];return arguments.length?(l=m(e),this.each(function(n){var i;1===this.nodeType&&(null==(i=l?e.call(this,n,_(this).val()):e)?i="":"number"==typeof i?i+="":Array.isArray(i)&&(i=_.map(i,function(e){return null==e?"":e+""})),(t=_.valHooks[this.type]||_.valHooks[this.nodeName.toLowerCase()])&&"set"in t&&void 0!==t.set(this,i,"value")||(this.value=i))})):i?(t=_.valHooks[i.type]||_.valHooks[i.nodeName.toLowerCase()])&&"get"in t&&void 0!==(n=t.get(i,"value"))?n:"string"==typeof(n=i.value)?n.replace(ht,""):null==n?"":n:void 0}}),_.extend({valHooks:{option:{get:function(e){var t=_.find.attr(e,"value");return null!=t?t:vt(_.text(e))}},select:{get:function(e){var t,n,l,i=e.options,o=e.selectedIndex,r="select-one"===e.type,a=r?null:[],u=r?o+1:i.length;for(l=o<0?u:r?o:0;l<u;l++)if(((n=i[l]).selected||l===o)&&!n.disabled&&(!n.parentNode.disabled||!D(n.parentNode,"optgroup"))){if(t=_(n).val(),r)return t;a.push(t)}return a},set:function(e,t){for(var n,l,i=e.options,o=_.makeArray(t),r=i.length;r--;)((l=i[r]).selected=_.inArray(_.valHooks.option.get(l),o)>-1)&&(n=!0);return n||(e.selectedIndex=-1),o}}}}),_.each(["radio","checkbox"],function(){_.valHooks[this]={set:function(e,t){if(Array.isArray(t))return e.checked=_.inArray(_(e).val(),t)>-1}},v.checkOn||(_.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})}),v.focusin="onfocusin"in e;var Et=/^(?:focusinfocus|focusoutblur)$/,gt=function(e){e.stopPropagation()};_.extend(_.event,{trigger:function(t,n,l,i){var o,r,a,u,s,d,p,v,E=[l||h],g=c.call(t,"type")?t.type:t,y=c.call(t,"namespace")?t.namespace.split("."):[];if(r=v=a=l=l||h,3!==l.nodeType&&8!==l.nodeType&&!Et.test(g+_.event.triggered)&&(g.indexOf(".")>-1&&(y=g.split("."),g=y.shift(),y.sort()),s=g.indexOf(":")<0&&"on"+g,(t=t[_.expando]?t:new _.Event(g,"object"==typeof t&&t)).isTrigger=i?2:3,t.namespace=y.join("."),t.rnamespace=t.namespace?new RegExp("(^|\\.)"+y.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=void 0,t.target||(t.target=l),n=null==n?[t]:_.makeArray(n,[t]),p=_.event.special[g]||{},i||!p.trigger||!1!==p.trigger.apply(l,n))){if(!i&&!p.noBubble&&!f(l)){for(Et.test((u=p.delegateType||g)+g)||(r=r.parentNode);r;r=r.parentNode)E.push(r),a=r;a===(l.ownerDocument||h)&&E.push(a.defaultView||a.parentWindow||e)}for(o=0;(r=E[o++])&&!t.isPropagationStopped();)v=r,t.type=o>1?u:p.bindType||g,(d=(K.get(r,"events")||Object.create(null))[t.type]&&K.get(r,"handle"))&&d.apply(r,n),(d=s&&r[s])&&d.apply&&q(r)&&(t.result=d.apply(r,n),!1===t.result&&t.preventDefault());return t.type=g,i||t.isDefaultPrevented()||p._default&&!1!==p._default.apply(E.pop(),n)||!q(l)||s&&m(l[g])&&!f(l)&&((a=l[s])&&(l[s]=null),_.event.triggered=g,t.isPropagationStopped()&&v.addEventListener(g,gt),l[g](),t.isPropagationStopped()&&v.removeEventListener(g,gt),_.event.triggered=void 0,a&&(l[s]=a)),t.result}},simulate:function(e,t,n){var l=_.extend(new _.Event,n,{type:e,isSimulated:!0});_.event.trigger(l,null,t)}}),_.fn.extend({trigger:function(e,t){return this.each(function(){_.event.trigger(e,t,this)})},triggerHandler:function(e,t){var n=this[0];if(n)return _.event.trigger(e,t,n,!0)}}),v.focusin||_.each({focus:"focusin",blur:"focusout"},function(e,t){var n=function(e){_.event.simulate(t,e.target,_.event.fix(e))};_.event.special[t]={setup:function(){var l=this.ownerDocument||this.document||this,i=K.access(l,t);i||l.addEventListener(e,n,!0),K.access(l,t,(i||0)+1)},teardown:function(){var l=this.ownerDocument||this.document||this,i=K.access(l,t)-1;i?K.access(l,t,i):(l.removeEventListener(e,n,!0),K.remove(l,t))}}});var yt=e.location,_t={guid:Date.now()},St=/\?/;_.parseXML=function(t){var n,l;if(!t||"string"!=typeof t)return null;try{n=(new e.DOMParser).parseFromString(t,"text/xml")}catch(e){}return l=n&&n.getElementsByTagName("parsererror")[0],n&&!l||_.error("Invalid XML: "+(l?_.map(l.childNodes,function(e){return e.textContent}).join("\n"):t)),n};var bt=/\[\]$/,Tt=/\r?\n/g,Ct=/^(?:submit|button|image|reset|file)$/i,At=/^(?:input|select|textarea|keygen)/i;function Dt(e,t,n,l){var i;if(Array.isArray(t))_.each(t,function(t,i){n||bt.test(e)?l(e,i):Dt(e+"["+("object"==typeof i&&null!=i?t:"")+"]",i,n,l)});else if(n||"object"!==y(t))l(e,t);else for(i in t)Dt(e+"["+i+"]",t[i],n,l)}_.param=function(e,t){var n,l=[],i=function(e,t){var n=m(t)?t():t;l[l.length]=encodeURIComponent(e)+"="+encodeURIComponent(null==n?"":n)};if(null==e)return"";if(Array.isArray(e)||e.jquery&&!_.isPlainObject(e))_.each(e,function(){i(this.name,this.value)});else for(n in e)Dt(n,e[n],t,i);return l.join("&")},_.fn.extend({serialize:function(){return _.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=_.prop(this,"elements");return e?_.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!_(this).is(":disabled")&&At.test(this.nodeName)&&!Ct.test(e)&&(this.checked||!pe.test(e))}).map(function(e,t){var n=_(this).val();return null==n?null:Array.isArray(n)?_.map(n,function(e){return{name:t.name,value:e.replace(Tt,"\r\n")}}):{name:t.name,value:n.replace(Tt,"\r\n")}}).get()}});var Nt=/%20/g,Pt=/#.*$/,xt=/([?&])_=[^&]*/,Rt=/^(.*?):[ \t]*([^\r\n]*)$/gm,It=/^(?:GET|HEAD)$/,wt=/^\/\//,Ot={},Lt={},kt="*/".concat("*"),Mt=h.createElement("a");function Ft(e){return function(t,n){"string"!=typeof t&&(n=t,t="*");var l,i=0,o=t.toLowerCase().match(L)||[];if(m(n))for(;l=o[i++];)"+"===l[0]?(l=l.slice(1)||"*",(e[l]=e[l]||[]).unshift(n)):(e[l]=e[l]||[]).push(n)}}function Bt(e,t,n,l){var i={},o=e===Lt;function r(a){var u;return i[a]=!0,_.each(e[a]||[],function(e,a){var s=a(t,n,l);return"string"!=typeof s||o||i[s]?o?!(u=s):void 0:(t.dataTypes.unshift(s),r(s),!1)}),u}return r(t.dataTypes[0])||!i["*"]&&r("*")}function Ut(e,t){var n,l,i=_.ajaxSettings.flatOptions||{};for(n in t)void 0!==t[n]&&((i[n]?e:l||(l={}))[n]=t[n]);return l&&_.extend(!0,e,l),e}Mt.href=yt.href,_.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:yt.href,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(yt.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":kt,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":_.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?Ut(Ut(e,_.ajaxSettings),t):Ut(_.ajaxSettings,e)},ajaxPrefilter:Ft(Ot),ajaxTransport:Ft(Lt),ajax:function(t,n){"object"==typeof t&&(n=t,t=void 0);var l,i,o,r,a,u,s,c,d,p,v=_.ajaxSetup({},n=n||{}),m=v.context||v,f=v.context&&(m.nodeType||m.jquery)?_(m):_.event,E=_.Deferred(),g=_.Callbacks("once memory"),y=v.statusCode||{},S={},b={},T="canceled",C={readyState:0,getResponseHeader:function(e){var t;if(s){if(!r)for(r={};t=Rt.exec(o);)r[t[1].toLowerCase()+" "]=(r[t[1].toLowerCase()+" "]||[]).concat(t[2]);t=r[e.toLowerCase()+" "]}return null==t?null:t.join(", ")},getAllResponseHeaders:function(){return s?o:null},setRequestHeader:function(e,t){return null==s&&(e=b[e.toLowerCase()]=b[e.toLowerCase()]||e,S[e]=t),this},overrideMimeType:function(e){return null==s&&(v.mimeType=e),this},statusCode:function(e){var t;if(e)if(s)C.always(e[C.status]);else for(t in e)y[t]=[y[t],e[t]];return this},abort:function(e){var t=e||T;return l&&l.abort(t),A(0,t),this}};if(E.promise(C),v.url=((t||v.url||yt.href)+"").replace(wt,yt.protocol+"//"),v.type=n.method||n.type||v.method||v.type,v.dataTypes=(v.dataType||"*").toLowerCase().match(L)||[""],null==v.crossDomain){u=h.createElement("a");try{u.href=v.url,u.href=u.href,v.crossDomain=Mt.protocol+"//"+Mt.host!=u.protocol+"//"+u.host}catch(e){v.crossDomain=!0}}if(v.data&&v.processData&&"string"!=typeof v.data&&(v.data=_.param(v.data,v.traditional)),Bt(Ot,v,n,C),s)return C;for(d in(c=_.event&&v.global)&&0==_.active++&&_.event.trigger("ajaxStart"),v.type=v.type.toUpperCase(),v.hasContent=!It.test(v.type),i=v.url.replace(Pt,""),v.hasContent?v.data&&v.processData&&0===(v.contentType||"").indexOf("application/x-www-form-urlencoded")&&(v.data=v.data.replace(Nt,"+")):(p=v.url.slice(i.length),v.data&&(v.processData||"string"==typeof v.data)&&(i+=(St.test(i)?"&":"?")+v.data,delete v.data),!1===v.cache&&(i=i.replace(xt,"$1"),p=(St.test(i)?"&":"?")+"_="+_t.guid+++p),v.url=i+p),v.ifModified&&(_.lastModified[i]&&C.setRequestHeader("If-Modified-Since",_.lastModified[i]),_.etag[i]&&C.setRequestHeader("If-None-Match",_.etag[i])),(v.data&&v.hasContent&&!1!==v.contentType||n.contentType)&&C.setRequestHeader("Content-Type",v.contentType),C.setRequestHeader("Accept",v.dataTypes[0]&&v.accepts[v.dataTypes[0]]?v.accepts[v.dataTypes[0]]+("*"!==v.dataTypes[0]?", "+kt+"; q=0.01":""):v.accepts["*"]),v.headers)C.setRequestHeader(d,v.headers[d]);if(v.beforeSend&&(!1===v.beforeSend.call(m,C,v)||s))return C.abort();if(T="abort",g.add(v.complete),C.done(v.success),C.fail(v.error),l=Bt(Lt,v,n,C)){if(C.readyState=1,c&&f.trigger("ajaxSend",[C,v]),s)return C;v.async&&v.timeout>0&&(a=e.setTimeout(function(){C.abort("timeout")},v.timeout));try{s=!1,l.send(S,A)}catch(e){if(s)throw e;A(-1,e)}}else A(-1,"No Transport");function A(t,n,r,u){var d,p,h,S,b,T=n;s||(s=!0,a&&e.clearTimeout(a),l=void 0,o=u||"",C.readyState=t>0?4:0,d=t>=200&&t<300||304===t,r&&(S=function(e,t,n){for(var l,i,o,r,a=e.contents,u=e.dataTypes;"*"===u[0];)u.shift(),void 0===l&&(l=e.mimeType||t.getResponseHeader("Content-Type"));if(l)for(i in a)if(a[i]&&a[i].test(l)){u.unshift(i);break}if(u[0]in n)o=u[0];else{for(i in n){if(!u[0]||e.converters[i+" "+u[0]]){o=i;break}r||(r=i)}o=o||r}if(o)return o!==u[0]&&u.unshift(o),n[o]}(v,C,r)),!d&&_.inArray("script",v.dataTypes)>-1&&_.inArray("json",v.dataTypes)<0&&(v.converters["text script"]=function(){}),S=function(e,t,n,l){var i,o,r,a,u,s={},c=e.dataTypes.slice();if(c[1])for(r in e.converters)s[r.toLowerCase()]=e.converters[r];for(o=c.shift();o;)if(e.responseFields[o]&&(n[e.responseFields[o]]=t),!u&&l&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),u=o,o=c.shift())if("*"===o)o=u;else if("*"!==u&&u!==o){if(!(r=s[u+" "+o]||s["* "+o]))for(i in s)if((a=i.split(" "))[1]===o&&(r=s[u+" "+a[0]]||s["* "+a[0]])){!0===r?r=s[i]:!0!==s[i]&&(o=a[0],c.unshift(a[1]));break}if(!0!==r)if(r&&e.throws)t=r(t);else try{t=r(t)}catch(e){return{state:"parsererror",error:r?e:"No conversion from "+u+" to "+o}}}return{state:"success",data:t}}(v,S,C,d),d?(v.ifModified&&((b=C.getResponseHeader("Last-Modified"))&&(_.lastModified[i]=b),(b=C.getResponseHeader("etag"))&&(_.etag[i]=b)),204===t||"HEAD"===v.type?T="nocontent":304===t?T="notmodified":(T=S.state,p=S.data,d=!(h=S.error))):(h=T,!t&&T||(T="error",t<0&&(t=0))),C.status=t,C.statusText=(n||T)+"",d?E.resolveWith(m,[p,T,C]):E.rejectWith(m,[C,T,h]),C.statusCode(y),y=void 0,c&&f.trigger(d?"ajaxSuccess":"ajaxError",[C,v,d?p:h]),g.fireWith(m,[C,T]),c&&(f.trigger("ajaxComplete",[C,v]),--_.active||_.event.trigger("ajaxStop")))}return C},getJSON:function(e,t,n){return _.get(e,t,n,"json")},getScript:function(e,t){return _.get(e,void 0,t,"script")}}),_.each(["get","post"],function(e,t){_[t]=function(e,n,l,i){return m(n)&&(i=i||l,l=n,n=void 0),_.ajax(_.extend({url:e,type:t,dataType:i,data:n,success:l},_.isPlainObject(e)&&e))}}),_.ajaxPrefilter(function(e){var t;for(t in e.headers)"content-type"===t.toLowerCase()&&(e.contentType=e.headers[t]||"")}),_._evalUrl=function(e,t,n){return _.ajax({url:e,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,converters:{"text script":function(){}},dataFilter:function(e){_.globalEval(e,t,n)}})},_.fn.extend({wrapAll:function(e){var t;return this[0]&&(m(e)&&(e=e.call(this[0])),t=_(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){for(var e=this;e.firstElementChild;)e=e.firstElementChild;return e}).append(this)),this},wrapInner:function(e){return m(e)?this.each(function(t){_(this).wrapInner(e.call(this,t))}):this.each(function(){var t=_(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=m(e);return this.each(function(n){_(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(e){return this.parent(e).not("body").each(function(){_(this).replaceWith(this.childNodes)}),this}}),_.expr.pseudos.hidden=function(e){return!_.expr.pseudos.visible(e)},_.expr.pseudos.visible=function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)},_.ajaxSettings.xhr=function(){try{return new e.XMLHttpRequest}catch(e){}};var Ht={0:200,1223:204},jt=_.ajaxSettings.xhr();v.cors=!!jt&&"withCredentials"in jt,v.ajax=jt=!!jt,_.ajaxTransport(function(t){var n,l;if(v.cors||jt&&!t.crossDomain)return{send:function(i,o){var r,a=t.xhr();if(a.open(t.type,t.url,t.async,t.username,t.password),t.xhrFields)for(r in t.xhrFields)a[r]=t.xhrFields[r];for(r in t.mimeType&&a.overrideMimeType&&a.overrideMimeType(t.mimeType),t.crossDomain||i["X-Requested-With"]||(i["X-Requested-With"]="XMLHttpRequest"),i)a.setRequestHeader(r,i[r]);n=function(e){return function(){n&&(n=l=a.onload=a.onerror=a.onabort=a.ontimeout=a.onreadystatechange=null,"abort"===e?a.abort():"error"===e?"number"!=typeof a.status?o(0,"error"):o(a.status,a.statusText):o(Ht[a.status]||a.status,a.statusText,"text"!==(a.responseType||"text")||"string"!=typeof a.responseText?{binary:a.response}:{text:a.responseText},a.getAllResponseHeaders()))}},a.onload=n(),l=a.onerror=a.ontimeout=n("error"),void 0!==a.onabort?a.onabort=l:a.onreadystatechange=function(){4===a.readyState&&e.setTimeout(function(){n&&l()})},n=n("abort");try{a.send(t.hasContent&&t.data||null)}catch(e){if(n)throw e}},abort:function(){n&&n()}}}),_.ajaxPrefilter(function(e){e.crossDomain&&(e.contents.script=!1)}),_.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(e){return _.globalEval(e),e}}}),_.ajaxPrefilter("script",function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET")}),_.ajaxTransport("script",function(e){var t,n;if(e.crossDomain||e.scriptAttrs)return{send:function(l,i){t=_("<script>").attr(e.scriptAttrs||{}).prop({charset:e.scriptCharset,src:e.url}).on("load error",n=function(e){t.remove(),n=null,e&&i("error"===e.type?404:200,e.type)}),h.head.appendChild(t[0])},abort:function(){n&&n()}}});var Wt,zt=[],$t=/(=)\?(?=&|$)|\?\?/;_.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=zt.pop()||_.expando+"_"+_t.guid++;return this[e]=!0,e}}),_.ajaxPrefilter("json jsonp",function(t,n,l){var i,o,r,a=!1!==t.jsonp&&($t.test(t.url)?"url":"string"==typeof t.data&&0===(t.contentType||"").indexOf("application/x-www-form-urlencoded")&&$t.test(t.data)&&"data");if(a||"jsonp"===t.dataTypes[0])return i=t.jsonpCallback=m(t.jsonpCallback)?t.jsonpCallback():t.jsonpCallback,a?t[a]=t[a].replace($t,"$1"+i):!1!==t.jsonp&&(t.url+=(St.test(t.url)?"&":"?")+t.jsonp+"="+i),t.converters["script json"]=function(){return r||_.error(i+" was not called"),r[0]},t.dataTypes[0]="json",o=e[i],e[i]=function(){r=arguments},l.always(function(){void 0===o?_(e).removeProp(i):e[i]=o,t[i]&&(t.jsonpCallback=n.jsonpCallback,zt.push(i)),r&&m(o)&&o(r[0]),r=o=void 0}),"script"}),v.createHTMLDocument=((Wt=h.implementation.createHTMLDocument("").body).innerHTML="<form></form><form></form>",2===Wt.childNodes.length),_.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(v.createHTMLDocument?((l=(t=h.implementation.createHTMLDocument("")).createElement("base")).href=h.location.href,t.head.appendChild(l)):t=h),o=!n&&[],(i=N.exec(e))?[t.createElement(i[1])]:(i=ye([e],t,o),o&&o.length&&_(o).remove(),_.merge([],i.childNodes)));var l,i,o},_.fn.load=function(e,t,n){var l,i,o,r=this,a=e.indexOf(" ");return a>-1&&(l=vt(e.slice(a)),e=e.slice(0,a)),m(t)?(n=t,t=void 0):t&&"object"==typeof t&&(i="POST"),r.length>0&&_.ajax({url:e,type:i||"GET",dataType:"html",data:t}).done(function(e){o=arguments,r.html(l?_("<div>").append(_.parseHTML(e)).find(l):e)}).always(n&&function(e,t){r.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},_.expr.pseudos.animated=function(e){return _.grep(_.timers,function(t){return e===t.elem}).length},_.offset={setOffset:function(e,t,n){var l,i,o,r,a,u,s=_.css(e,"position"),c=_(e),d={};"static"===s&&(e.style.position="relative"),a=c.offset(),o=_.css(e,"top"),u=_.css(e,"left"),("absolute"===s||"fixed"===s)&&(o+u).indexOf("auto")>-1?(r=(l=c.position()).top,i=l.left):(r=parseFloat(o)||0,i=parseFloat(u)||0),m(t)&&(t=t.call(e,n,_.extend({},a))),null!=t.top&&(d.top=t.top-a.top+r),null!=t.left&&(d.left=t.left-a.left+i),"using"in t?t.using.call(e,d):c.css(d)}},_.fn.extend({offset:function(e){if(arguments.length)return void 0===e?this:this.each(function(t){_.offset.setOffset(this,e,t)});var t,n,l=this[0];return l?l.getClientRects().length?{top:(t=l.getBoundingClientRect()).top+(n=l.ownerDocument.defaultView).pageYOffset,left:t.left+n.pageXOffset}:{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,l=this[0],i={top:0,left:0};if("fixed"===_.css(l,"position"))t=l.getBoundingClientRect();else{for(t=this.offset(),n=l.ownerDocument,e=l.offsetParent||n.documentElement;e&&(e===n.body||e===n.documentElement)&&"static"===_.css(e,"position");)e=e.parentNode;e&&e!==l&&1===e.nodeType&&((i=_(e).offset()).top+=_.css(e,"borderTopWidth",!0),i.left+=_.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-_.css(l,"marginTop",!0),left:t.left-i.left-_.css(l,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){for(var e=this.offsetParent;e&&"static"===_.css(e,"position");)e=e.offsetParent;return e||ne})}}),_.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,t){var n="pageYOffset"===t;_.fn[e]=function(l){return j(this,function(e,l,i){var o;if(f(e)?o=e:9===e.nodeType&&(o=e.defaultView),void 0===i)return o?o[t]:e[l];o?o.scrollTo(n?o.pageXOffset:i,n?i:o.pageYOffset):e[l]=i},e,l,arguments.length)}}),_.each(["top","left"],function(e,t){_.cssHooks[t]=je(v.pixelPosition,function(e,n){if(n)return n=He(e,t),Me.test(n)?_(e).position()[t]+"px":n})}),_.each({Height:"height",Width:"width"},function(e,t){_.each({padding:"inner"+e,content:t,"":"outer"+e},function(n,l){_.fn[l]=function(i,o){var r=arguments.length&&(n||"boolean"!=typeof i),a=n||(!0===i||!0===o?"margin":"border");return j(this,function(t,n,i){var o;return f(t)?0===l.indexOf("outer")?t["inner"+e]:t.document.documentElement["client"+e]:9===t.nodeType?(o=t.documentElement,Math.max(t.body["scroll"+e],o["scroll"+e],t.body["offset"+e],o["offset"+e],o["client"+e])):void 0===i?_.css(t,n,a):_.style(t,n,i,a)},t,r?i:void 0,r)}})}),_.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){_.fn[t]=function(e){return this.on(t,e)}}),_.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,l){return this.on(t,e,n,l)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),_.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,t){_.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)}});var Vt=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;_.proxy=function(e,t){var n,l,o;if("string"==typeof t&&(n=e[t],t=e,e=n),m(e))return l=i.call(arguments,2),(o=function(){return e.apply(t||this,l.concat(i.call(arguments)))}).guid=e.guid=e.guid||_.guid++,o},_.holdReady=function(e){e?_.readyWait++:_.ready(!0)},_.isArray=Array.isArray,_.parseJSON=JSON.parse,_.nodeName=D,_.isFunction=m,_.isWindow=f,_.camelCase=V,_.type=y,_.now=Date.now,_.isNumeric=function(e){var t=_.type(e);return("number"===t||"string"===t)&&!isNaN(e-parseFloat(e))},_.trim=function(e){return null==e?"":(e+"").replace(Vt,"")};var qt=e.jQuery,Gt=e.$;return _.noConflict=function(t){return e.$===_&&(e.$=Gt),t&&e.jQuery===_&&(e.jQuery=qt),_},void 0===t&&(e.jQuery=e.$=_),_})});const T=e=>{var n,o,r;let{data:a,OpenImage:u}=e;const{t:s}=i.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,s("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,s("WF_COMMON_COMMENTS")),l.createElement("p",{style:{overflowX:"scroll"}},e)))):null,(null==a||null===(o=a.thumbnailsToShow)||void 0===o||null===(r=o.thumbs)||void 0===r?void 0:r.length)>0?l.createElement("div",{className:"TLComments"},l.createElement("h3",null,s("CS_COMMON_ATTACHMENTS")),l.createElement(t.DisplayPhotos,{srcs:null==a?void 0:a.thumbnailsToShow.thumbs,onClick:(e,t)=>{u(e,t,null==a?void 0:a.thumbnailsToShow)}})):null)},C=e=>{var r,a,u,s,c,d,p;const{t:v}=i.useTranslation(),m=null==e||null===(r=e.application)||void 0===r||null===(a=r.workflow)||void 0===a?void 0:a.businessService,{isLoading:f,data:h}=Digit.Hooks.useWorkflowDetails({tenantId:null===(u=e.application)||void 0===u?void 0:u.tenantId,id:null===(s=e.application)||void 0===s?void 0:s.applicationNumber,moduleCode:m});function E(e,t,n){var l;window.open(null==n||null===(l=n.fullImage)||void 0===l?void 0:l[0],"_blank")}const g=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(T,{data:o})}if(t.state){var o,r,a,u,s;const e={date:null==t||null===(o=t.auditDetails)||void 0===o?void 0:o.lastModified,name:null==t||null===(r=t.assignes)||void 0===r||null===(a=r[0])||void 0===a?void 0:a.name,mobileNumber:null==t||null===(u=t.assignes)||void 0===u||null===(s=u[0])||void 0===s?void 0:s.mobileNumber,comment:v(null==t?void 0:t.comment),wfComment:t.wfComment,thumbnailsToShow:null==t?void 0:t.thumbnailsToShow};return l.createElement(T,{data:e,OpenImage:E})}{var c,d;const n={date:Digit.DateUtils.ConvertTimestampToDate(null===(c=e.application)||void 0===c?void 0:c.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(T,{data:n})}};return f?l.createElement(t.Loader,null):l.createElement(l.Fragment,null,!f&&l.createElement(n.Fragment,null,(null==h||null===(c=h.timeline)||void 0===c?void 0:c.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_${m}_${h.timeline[0].state}`||"NA"),customChild:g(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,i)=>{var o;let r="";var a,u,s,c,d,p,m,f;return window.location.href.includes("/obps/")&&(r=null!==(a=workflowDetails)&&void 0!==a&&null!==(u=a.data)&&void 0!==u&&null!==(s=u.timeline[n-1])&&void 0!==s&&null!==(c=s.state)&&void 0!==c&&c.includes("BACK_FROM")||null!==(d=workflowDetails)&&void 0!==d&&null!==(p=d.data)&&void 0!==p&&null!==(m=p.timeline[n-1])&&void 0!==m&&null!==(f=m.state)&&void 0!==f&&f.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,label:v(`ES_PTR_COMMON_STATUS_${null==h||null===(o=h.processInstances[n].state)||void 0===o?void 0:o.state}${r}`),customChild:g(e)}))})))),h&&(n=>{var i,r,a;let u=n[0];const s=n.map(e=>e.action);if(s.includes("PAY")||s.includes("EDIT")){let e=s.indexOf("EDIT")||s.indexOf("PAY");e=-1!=e?e:s.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:`/digit-ui/citizen/payment/my-bills/${m}/${null==e||null===(r=e.application)||void 0===r?void 0:r.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;case"SUBMIT_FEEDBACK":return l.createElement("div",{style:{marginTop:"24px"}},l.createElement(o.Link,{to:"/digit-ui/citizen/fsm/rate/"+e.id},l.createElement(t.SubmitBar,{label:v("CS_APPLICATION_DETAILS_RATE")})));default:return null}})(null==h?void 0:h.nextActions))},A=[{screenPath:"petservice/new-application/acknowledgement"},{screenPath:"petservice/edit-application/acknowledgement"}],D=()=>{var e,n,r,a,s,c;const{path:d,...p}=o.useRouteMatch(),{t:v}=i.useTranslation(),m=null===(e=Digit)||void 0===e||null===(n=e.ComponentRegistryService)||void 0===n?void 0:n.getComponent("PTRCreatePet"),f=null===(r=Digit)||void 0===r||null===(a=r.ComponentRegistryService)||void 0===a?void 0:a.getComponent("PTRApplicationDetails"),h=null===(s=Digit)||void 0===s||null===(c=s.ComponentRegistryService)||void 0===c?void 0:c.getComponent("PTRMyApplications");return l.createElement("span",{className:"pet-citizen",style:{width:"100%"}},l.createElement(o.Switch,null,l.createElement(t.AppContainer,null,(void 0===(E=A)&&(E=[]),E.filter(e=>window.location.href.includes(e.screenPath)).length>0?"":l.createElement(t.BackButton,null,"Back")),l.createElement(t.PrivateRoute,{path:d+"/petservice/new-application",component:m}),l.createElement(t.PrivateRoute,{path:d+"/petservice/application/:acknowledgementIds/:tenantId",component:f}),l.createElement(t.PrivateRoute,{path:d+"/petservice/my-applications",component:h}),l.createElement(t.PrivateRoute,{path:d+"/petservice/search",component:e=>l.createElement(Search,u({},e,{t:v,parentRoute:d}))}))));var E},N=e=>{let{jumpTo:n}=e;const{t:r}=i.useTranslation(),a=o.useHistory();return l.createElement(t.LinkButton,{label:r("CS_COMMON_CHANGE"),className:"check-page-link-button",onClick:function(){a.push(n)}})},P=e=>e.substr(0,1).toUpperCase()+e.substr(1),x=(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},{title:t("PTR_PET_SEX"),value:null==e?void 0:e.petDetails.petGender}];return{title:t("ES_TITILE_PET_DETAILS"),values:n}},R=function(e,t,n){try{var l;function i(l){var i,o,r,a,u,s,c;return{t:n,tenantId:null==t?void 0:t.code,name:`${n(null==t?void 0:t.i18nKey)} ${c=n("ULBGRADE_"+(null==t||null===(i=t.city)||void 0===i?void 0:i.ulbGrade.toUpperCase().replace(" ","_").replace(".","_"))),c.toLowerCase().split(" ").map(P).join(" ")}`,email:null==t?void 0:t.emailId,phoneNumber:null==t?void 0:t.contactNumber,heading:n("PTR_ACKNOWLEDGEMENT"),details:[{title:n("CS_TITLE_APPLICATION_DETAILS"),values:[{title:n("PTR_APPLICATION_NUMBER"),value:null==e?void 0:e.applicationNumber},{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}]},x(e,n),{title:n("PTR_LOCATION_DETAILS"),values:[{title:n("PTR_PINCODE"),value:null==e||null===(r=e.address)||void 0===r?void 0:r.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===(s=e.address)||void 0===s?void 0:s.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)}},I=e=>{const{t:t}=i.useTranslation();return e.isSuccess?window.location.href.includes("edit-application")?t("CS_PTR_UPDATE_APPLICATION_SUCCESS"):t("ES_PTR_RESPONSE_CREATE_ACTION"):e.isLoading?window.location.href.includes("edit-application")?t("CS_PTR_UPDATE_APPLICATION_PENDING"):t("CS_PTR_APPLICATION_PENDING"):e.isSuccess?void 0:window.location.href.includes("edit-application")?t("CS_PTR_UPDATE_APPLICATION_FAILED"):t("CS_PTR_APPLICATION_FAILED")},w={padding:"4px 0px",justifyContent:"space-between"},O=e=>{var n;return l.createElement(t.Banner,{message:I(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:r,buttonLabel:a}=e;const{t:u}=i.useTranslation();return l.createElement(t.Card,null,l.createElement(t.KeyNote,{keyValue:u("PTR_APPLICATION_NO_LABEL"),note:null==r?void 0:r.applicationNumber}),l.createElement(t.KeyNote,{keyValue:u("PTR_APPLICANT_NAME"),note:null==r?void 0:r.applicantName}),l.createElement(t.KeyNote,{keyValue:u("PTR_APPLICATION_CATEGORY"),note:u("PTR_APPLICATION")}),l.createElement(t.KeyNote,{keyValue:u("PTR_SEARCH_PET_TYPE"),note:null==r||null===(n=r.petDetails)||void 0===n?void 0:n.petType}),l.createElement(t.KeyNote,{keyValue:u("PT_COMMON_TABLE_COL_STATUS_LABEL"),note:u("PTR_COMMON_"+(null==r?void 0:r.status))}),l.createElement(o.Link,{to:`/digit-ui/citizen/ptr/petservice/application/${null==r?void 0:r.applicationNumber}/${null==r?void 0:r.tenantId}`},l.createElement(t.SubmitBar,{label:a})))};var k,M=Array.isArray,F="object"==typeof s&&s&&s.Object===Object&&s,B="object"==typeof self&&self&&self.Object===Object&&self,U=F||B||Function("return this")(),H=U.Symbol,j=Object.prototype,W=j.hasOwnProperty,z=j.toString,$=H?H.toStringTag:void 0,V=Object.prototype.toString,q=H?H.toStringTag:void 0,G=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":q&&q in Object(e)?function(e){var t=W.call(e,$),n=e[$];try{e[$]=void 0;var l=!0}catch(e){}var i=z.call(e);return l&&(t?e[$]=n:delete e[$]),i}(e):function(e){return V.call(e)}(e)},K=function(e){return null!=e&&"object"==typeof e},Y=function(e){return"symbol"==typeof e||K(e)&&"[object Symbol]"==G(e)},X=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Z=/^\w*$/,J=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},Q=function(e){if(!J(e))return!1;var t=G(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t},ee=U["__core-js_shared__"],te=(k=/[^.]+$/.exec(ee&&ee.keys&&ee.keys.IE_PROTO||""))?"Symbol(src)_1."+k:"",ne=Function.prototype.toString,le=function(e){if(null!=e){try{return ne.call(e)}catch(e){}try{return e+""}catch(e){}}return""},ie=/^\[object .+?Constructor\]$/,oe=RegExp("^"+Function.prototype.toString.call(Object.prototype.hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),re=function(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return function(e){return!(!J(e)||(t=e,te&&te in t))&&(Q(e)?oe:ie).test(le(e));var t}(n)?n:void 0},ae=re(Object,"create"),ue=Object.prototype.hasOwnProperty,se=Object.prototype.hasOwnProperty;function ce(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])}}ce.prototype.clear=function(){this.__data__=ae?ae(null):{},this.size=0},ce.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},ce.prototype.get=function(e){var t=this.__data__;if(ae){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return ue.call(t,e)?t[e]:void 0},ce.prototype.has=function(e){var t=this.__data__;return ae?void 0!==t[e]:se.call(t,e)},ce.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=ae&&void 0===t?"__lodash_hash_undefined__":t,this};var de=ce,pe=function(e,t){return e===t||e!=e&&t!=t},ve=function(e,t){for(var n=e.length;n--;)if(pe(e[n][0],t))return n;return-1},me=Array.prototype.splice;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.__data__=[],this.size=0},fe.prototype.delete=function(e){var t=this.__data__,n=ve(t,e);return!(n<0||(n==t.length-1?t.pop():me.call(t,n,1),--this.size,0))},fe.prototype.get=function(e){var t=this.__data__,n=ve(t,e);return n<0?void 0:t[n][1]},fe.prototype.has=function(e){return ve(this.__data__,e)>-1},fe.prototype.set=function(e,t){var n=this.__data__,l=ve(n,e);return l<0?(++this.size,n.push([e,t])):n[l][1]=t,this};var he=fe,Ee=re(U,"Map"),ge=function(e,t){var n=e.__data__;return function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}(t)?n["string"==typeof t?"string":"hash"]:n.map};function 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 de,map:new(Ee||he),string:new de}},ye.prototype.delete=function(e){var t=ge(this,e).delete(e);return this.size-=t?1:0,t},ye.prototype.get=function(e){return ge(this,e).get(e)},ye.prototype.has=function(e){return ge(this,e).has(e)},ye.prototype.set=function(e,t){var n=ge(this,e),l=n.size;return n.set(e,t),this.size+=n.size==l?0:1,this};var _e=ye;function Se(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 r=e.apply(this,l);return n.cache=o.set(i,r)||o,r};return n.cache=new(Se.Cache||_e),n}Se.Cache=_e;var be,Te,Ce=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Ae=/\\(\\)?/g,De=(be=Se(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(Ce,function(e,n,l,i){t.push(l?i.replace(Ae,"$1"):n||e)}),t},function(e){return 500===Te.size&&Te.clear(),e}),Te=be.cache,be),Ne=H?H.prototype:void 0,Pe=Ne?Ne.toString:void 0,xe=function(e){if("string"==typeof e||Y(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t},Re=function(e,t,n){var l=null==e?void 0:function(e,t){for(var n=0,l=(t=function(e,t){return M(e)?e:function(e,t){if(M(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!Y(e))||Z.test(e)||!X.test(e)||null!=t&&e in Object(t)}(e,t)?[e]:De(function(e){return null==e?"":function e(t){if("string"==typeof t)return t;if(M(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(Y(t))return Pe?Pe.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[xe(t[n++])];return n&&n==l?e:void 0}(e,t);return void 0===l?n:l};const Ie=e=>{let{t:n,currentPage:i,columns:o,data:r,getCellProps:a,disableSort:u,onSort:s,onNextPage:c,onPrevPage:d,onPageSizeChange:p,pageSizeLimit:v,sortParams:m,totalRecords:f}=e;return l.createElement(t.Table,{t:n,data:r,currentPage:i,columns:o,getCellProps:a,onNextPage:c,onPrevPage:d,pageSizeLimit:v,disableSort:u,onPageSizeChange:p,onSort:s,sortParams:m,totalRecords:f})},we=e=>{let{businessService:r}=e;const{t:a}=i.useTranslation(),u=[{text:"ES_TITLE_NEW_PET_REGISTRATION",link:"/digit-ui/employee/ptr/new-application",businessService:"ptr",roles:["PT_CEMP"]},{text:"PTR_SEARCH_PET",link:"/digit-ui/employee/ptr/search",businessService:"ptr",roles:[]},{text:"PTR_COMMON_APPLICATION_SEARCH",link:"/digit-ui/employee/ptr/application-search",businessService:"ptr",roles:[]}],[s,c]=n.useState([]),{roles:d}=Digit.UserService.getUser().info;return n.useEffect(()=>{let e=u.filter(e=>e.businessService===r).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)});c(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"},s.map((e,t)=>{let{link:n,text:i,hyperlink:r=!1,roles:u=[]}=e;return l.createElement("span",{className:"link",key:t},r?l.createElement("a",{href:n},i):l.createElement(o.Link,{to:n},a(i)))}))))},Oe={date:t.DatePicker,mobileNumber:t.MobileNumber},Le=e=>{var n;let{onSearch:o,type:a,onClose:u,searchFields:s,searchParams:c,isInboxPage:d,clearSearch:p}=e;const{t:v}=i.useTranslation(),{handleSubmit:m,reset:f,watch:h,control:E,formState:g,setValue:y}=r.useForm({defaultValues:d?c:{locality:null,city:null,...c}}),_=h(),S=innerWidth<=640;function b(){const e=s.reduce((e,t)=>({...e,[null==t?void 0:t.name]:""}),{});if(f(e),d){const e={...c};e.delete=[],s.forEach(t=>{e.delete.push(null==t?void 0:t.name)}),o({...e})}else p()}const T=e=>l.createElement(t.LinkLabel,{style:{display:"inline",...e?{margin:0}:{}},onClick:b},v("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)}),o(e),"mobile"===a&&u()})},l.createElement(l.Fragment,null,l.createElement("div",{className:"search-container",style:{width:"auto",marginLeft:d?"24px":"revert"}},l.createElement("div",{className:"search-complaint-container"},("mobile"===a||S)&&l.createElement("div",{className:"complaint-header"},l.createElement("h2",null,v("ES_COMMON_SEARCH_BY")),l.createElement("span",{onClick:u},l.createElement(t.CloseSvg,null))),l.createElement("div",{className:"complaint-input-container for-pt "+(d?"":"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,a;return l.createElement("div",{key:e.name,className:"input-fields"},l.createElement("span",{className:"mobile-input"},l.createElement(t.Label,null,v(e.label)+" "+(e.isMendatory?"*":"")),l.createElement(r.Controller,e.type?{render:t=>l.createElement(null==Oe?void 0:Oe[e.type],{formValue:_,setValue:y,onChange:t.onChange,value:t.value}),name:e.name,control:E,defaultValue:""}:{render:e=>l.createElement(t.TextInput,{onChange:e.onChange,value:e.value}),name:e.name,control:E,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===(a=o[e.name])||void 0===a?void 0:a.message):null)}),d&&l.createElement("div",{style:{gridColumn:"2/3",textAlign:"right",paddingTop:"10px"},className:"input-fields"},l.createElement("div",null,T())),"desktop"===a&&!S&&l.createElement("div",{style:{maxWidth:"unset",marginLeft:"unset"},className:"search-submit-wrapper"},l.createElement(t.SubmitBar,{className:"submit-bar-search",label:v("ES_COMMON_SEARCH"),disabled:!!Object.keys(g.errors).length||(()=>{var e;let t=!0;return Object.keys(_).forEach(e=>{!["locality","city"].includes(e)&&_[e]&&(t=!1)}),null==s||!s.find(e=>"locality"===e.name)||null!=_&&null!==(e=_.locality)&&void 0!==e&&e.code||(t=!0),t})(),submit:!0}),!d&&l.createElement("div",null,T()))))),("mobile"===a||S)&&l.createElement(t.ActionBar,{className:"clear-search-container"},l.createElement("button",{className:"clear-search",style:{flex:1}},T(S)),l.createElement(t.SubmitBar,{disabled:!!Object.keys(g.errors).length,label:v("ES_COMMON_SEARCH"),style:{flex:1},submit:!0}))))},ke=e=>{let{tableConfig:o,filterComponent:r,...a}=e;const{data:u,useNewInboxAPI:s}=a,{t:c}=i.useTranslation(),[d,p]=n.useState(()=>{var e;return null===(e=Digit.ComponentRegistryService)||void 0===e?void 0:e.getComponent(r)}),[v,m]=n.useState(()=>{var e;return null===(e=Digit.ComponentRegistryService)||void 0===e?void 0:e.getComponent(a.EmptyResultInboxComp)}),[f,h]=n.useState(!1),E=l.useMemo(()=>a.isSearch?o.searchColumns(a):o.inboxColumns(a)||[],[]);let g;return a.isLoading?g=l.createElement(t.Loader,null):f?g=null:!u||0===(null==u?void 0:u.length)||s&&null!=u&&u[0].dataEmpty?g=v&&l.createElement(v,{data:u})||(0===(null==u?void 0:u.length)||s&&null!=u&&u[0].dataEmpty?l.createElement(t.Card,{style:{marginTop:20}},c("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(Ie,{t:c,data:u,columns:E,getCellProps:e=>({style:{minWidth:e.column.Header===c("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(we,{parentRoute:a.parentRoute,businessService:a.moduleCode}),l.createElement("div",null,l.createElement(d,{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(Le,{defaultSearchParams:a.defaultSearchParams,onSearch:e=>{a.onSearch(e),h(!1)},type:"desktop",searchFields:a.searchFields,isInboxPage:!(null!=a&&a.isSearch),searchParams:a.searchParams,clearSearch:()=>h(!0)}),l.createElement("div",{className:"result",style:{marginLeft:null!=a&&a.isSearch?"":"24px",flex:1}},g)))},Me=e=>{const{t:o}=i.useTranslation(),[r,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: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:r,optionsKey:"name",options:[{code:"DESC",name:o("ES_INBOX_DATE_LATEST_FIRST")},{code:"ASC",name:o("ES_INBOX_DATE_LATEST_LAST")}]})))))},Fe=e=>{let{t:i,data:o,onFilterChange:r,onSearch:a,onSort:u,serviceRequestIdKey:s,isFstpOperator:c,isLoading:d,isSearch:p,searchParams:v,searchFields:m,sortParams:f,linkPrefix:h,filterComponent:E}=e;const[g,y]=n.useState(p?"SEARCH":""),[_,S]=n.useState(!!p),[b,T]=n.useState(f),[C]=n.useState(()=>{var e;return null===(e=Digit.ComponentRegistryService)||void 0===e?void 0:e.getComponent(E)});n.useEffect(()=>{g&&S(!0)},[g]);const A=()=>{S(!1),y(""),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:s,linkPrefix:h||"/digit-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"},a&&l.createElement(t.SearchAction,{text:"SEARCH",handleActionClick:()=>{y("SEARCH"),S(!0)}}),!p&&r&&l.createElement(t.FilterAction,{text:"FILTER",handleActionClick:()=>{y("FILTER"),S(!0)}}),l.createElement(t.FilterAction,{text:"SORT",handleActionClick:()=>{y("SORT"),S(!0)}})),D,_&&l.createElement(t.PopUp,null,"FILTER"===g&&l.createElement("div",{className:"popup-module"},l.createElement(C,{onFilterChange:e=>{r(e),S(!1)},Close:A,type:"mobile",searchParams:v})),"SORT"===g&&l.createElement("div",{className:"popup-module"},l.createElement(Me,{type:"mobile",sortParams:f,onClose:A,onSort:u})),"SEARCH"===g&&l.createElement("div",{className:"popup-module"},l.createElement(Le,{type:"mobile",onClose:A,onSearch:a,isFstpOperator:c,searchParams:v,searchFields:m}))))},Be=e=>{let{linkPrefix:r,classNameForMobileView:a=""}=e;const{t:u}=i.useTranslation(),s=[{text:u("ES_TITLE_NEW_REGISTRATION"),link:"/digit-ui/employee/ptr/new-application"},{text:u("ES_TITILE_SEARCH_APPLICATION"),link:r+"/search"}],[c,d]=n.useState([]),{roles:p}=Digit.UserService.getUser().info;return n.useEffect(()=>{let e=[];s.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"},c.map((e,t)=>{let{link:n,text:i}=e;return l.createElement("span",{className:"link",key:t},l.createElement(o.Link,{to:n},i))}))))},Ue=e=>{let{data:t,isLoading:n,isSearch:o,searchFields:r,onFilterChange:a,onSearch:u,onSort:s,parentRoute:c,searchParams:d,sortParams:p,linkPrefix:v,tableConfig:m,filterComponent:f}=e;const{t:h}=i.useTranslation();return l.createElement("div",{style:{padding:0}},l.createElement("div",{className:"inbox-container"},l.createElement("div",{className:"filters-container"},!o&&l.createElement(Be,{classNameForMobileView:"linksWrapperForMobileInbox",linkPrefix:c,isMobile:!0}),l.createElement(Fe,{t:h,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:a,isLoading:n,isSearch:o,onSearch:u,onSort:s,searchParams:d,searchFields:r,linkPrefix:v,sortParams:p,serviceRequestIdKey:null==m?void 0:m.serviceRequestIdKey,filterComponent:f}))))},He=e=>{var o,r,a,u,s;let{useNewInboxAPI:c,parentRoute:d,moduleCode:p="PTR",initialStates:v={},filterComponent:m,isInbox:f,rawWfHandler:h,rawSearchHandler:E,combineResponse:g,wfConfig:y,searchConfig:_,middlewaresWf:S,middlewareSearch:b,EmptyResultInboxComp:T}=e;const C=Digit.ULBService.getCurrentTenantId();console.log("here");const{t:A}=i.useTranslation(),[D,N]=n.useState(()=>f?{}:{enabled:!1}),[P,x]=n.useState(()=>{var e;return null===(e=Digit.ComponentRegistryService)||void 0===e?void 0:e.getComponent("PTRInboxTableConfig")}),[R,I]=n.useState(v.pageOffset||0),[w,O]=n.useState(v.pageSize||10),[L,k]=n.useState(v.sortParams||[{id:"createdTime",desc:!0}]),[M,F]=n.useState(v.searchParams||{});let B=window.Digit.Utils.browser.isMobile(),U=B?{limit:100,offset:0,sortBy:null==L||null===(o=L[0])||void 0===o?void 0:o.id,sortOrder:null!=L&&null!==(r=L[0])&&void 0!==r&&r.desc?"DESC":"ASC"}:{limit:w,offset:R,sortBy:null==L||null===(a=L[0])||void 0===a?void 0:a.id,sortOrder:null!=L&&null!==(u=L[0])&&void 0!==u&&u.desc?"DESC":"ASC"};const{isLoading:H,data:j,searchFields:W,...z}=c?Digit.Hooks.useNewInboxGeneral({tenantId:C,ModuleCode:p,filters:{...M,...U,sortParams:L}}):Digit.Hooks.useInboxGeneral({tenantId:C,businessService:p,isInbox:f,filters:{...M,...U,sortParams:L},rawWfHandler:h,rawSearchHandler:E,combineResponse:g,wfConfig:y,searchConfig:{...D,..._},middlewaresWf:S,middlewareSearch:b});n.useEffect(()=>{I(0)},[M]);const $=e=>{let t=e.delete,n={...M,...e};t&&t.forEach(e=>delete n[e]),delete e.delete,F({...n}),N({enabled:!0})},V=n.useCallback(e=>{0!==e.length&&k(e)},[]);var q,G;if(null!==(null==z||null===(s=z.data)||void 0===s?void 0:s.length))return B?l.createElement(Ue,{data:j,isLoading:H,isSearch:!f,searchFields:W,onFilterChange:$,onSearch:$,onSort:V,parentRoute:d,searchParams:M,sortParams:L,linkPrefix:d+"/application-details/",tableConfig:null!=z&&z.tableConfig?null===(q=res)||void 0===q?void 0:q.tableConfig:P(A).PTR,filterComponent:m,EmptyResultInboxComp:T,useNewInboxAPI:c}):l.createElement("div",null,f&&l.createElement(t.Header,null,A("ES_COMMON_INBOX")),l.createElement(ke,{moduleCode:p,data:j,tableConfig:P(A).PTR,isLoading:H,defaultSearchParams:v.searchParams,isSearch:!f,onFilterChange:$,searchFields:W,onSearch:$,onSort:V,onNextPage:()=>{I(e=>e+w)},onPrevPage:()=>{I(e=>e-w)},currentPage:Math.floor(R/w),pageSizeLimit:w,disableSort:!1,onPageSizeChange:e=>{O(Number(e.target.value))},parentRoute:d,searchParams:M,sortParams:L,totalRecords:Number(null==j||null===(G=j[0])||void 0===G?void 0:G.totalCount),filterComponent:m,EmptyResultInboxComp:T,useNewInboxAPI:c}))},je=e=>{var i,a;let{isLoading:u,t:s,onSubmit:c,data:d,count:p,setShowToast:v}=e;const m=window.Digit.Utils.browser.isMobile(),{register:f,control:h,handleSubmit:E,setValue:g,getValues:y,reset:_,formState:S}=r.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=Digit.ULBService.getStateId(),{data:T}=Digit.Hooks.ptr.usePTRPetMDMS(b,"PetService","PetType");let C=[];T&&T.map(e=>{C.push({i18nKey:"PTR_PET_"+e.code,code:""+e.code,value:""+e.name})});const A=e=>l.createElement("span",{className:"cell-text"},e),D=n.useMemo(()=>[{Header:s("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:"/digit-ui/employee/ptr/petservice/applicationsearch/application-details/"+t.original.applicationNumber},t.original.applicationNumber)))}},{Header:s("PTR_APPLICANT_NAME"),Cell:e=>{var t,n;return A(""+(null==e||null===(t=e.row)||void 0===t||null===(n=t.original)||void 0===n?void 0:n.applicantName))},disableSortBy:!0},{Header:s("PTR_PET_TYPE"),Cell:e=>{var t,n;let{row:l}=e;return A(""+(null===(t=l.original)||void 0===t||null===(n=t.petDetails)||void 0===n?void 0:n.petType))},disableSortBy:!0},{Header:s("PTR_BREED_TYPE"),Cell:e=>{var t,n;let{row:l}=e;return A(""+(null===(t=l.original)||void 0===t||null===(n=t.petDetails)||void 0===n?void 0:n.breedType))},disableSortBy:!0},{Header:s("PTR_MOBILE_NUMBER"),Cell:e=>{var t;let{row:n}=e;return A(""+(null==n||null===(t=n.original)||void 0===t?void 0:t.mobileNumber))},disableSortBy:!0}],[]),N=n.useCallback(e=>{0!==e.length&&(g("sortBy",e.id),g("sortOrder",e.desc?"DESC":"ASC"))},[]);function P(){g("offset",y("offset")-y("limit")),E(c)()}return l.createElement(l.Fragment,null,l.createElement("div",null,l.createElement(t.Header,null,s("PTR_SEARCH_PET_APPLICATIONS")),l.createElement(t.Card,{className:"card-search-heading"},l.createElement("span",{style:{color:"#505A5F"}},s("Provide at least one parameter to search for an application"))),l.createElement(t.SearchForm,{onSubmit:c,handleSubmit:E},l.createElement(t.SearchField,null,l.createElement("label",null,s("PTR_APPLICATION_NO_LABEL")),l.createElement(t.TextInput,{name:"applicationNumber",inputRef:f({})})),l.createElement(t.SearchField,null,l.createElement("label",null,s("PTR_SEARCH_PET_TYPE")),l.createElement(r.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:s,disable:!1})})),l.createElement(t.SearchField,null,l.createElement("label",null,s("PTR_OWNER_MOBILE_NO")),l.createElement(t.MobileNumber,{name:"mobileNumber",inputRef:f({minLength:{value:10,message:s("CORE_COMMON_MOBILE_ERROR")},maxLength:{value:10,message:s("CORE_COMMON_MOBILE_ERROR")},pattern:{value:/[6789][0-9]{9}/,message:s("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===(i=S.errors)||void 0===i||null===(a=i.mobileNumber)||void 0===a?void 0:a.message)),l.createElement(t.SearchField,null,l.createElement("label",null,s("PTR_FROM_DATE")),l.createElement(r.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,s("PTR_TO_DATE")),l.createElement(r.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:s("ES_COMMON_SEARCH"),submit:!0}),l.createElement("p",{style:{marginTop:"10px"},onClick:()=>{_({applicationNumber:"",fromDate:"",toDate:"",petType:"",mobileNumber:"",status:"",breedType:"",offset:0,limit:10,sortBy:"commencementDate",sortOrder:"DESC"}),v(null),P()}},s("ES_COMMON_CLEAR_ALL")))),!u&&null!=d&&d.display?l.createElement(t.Card,{style:{marginTop:20}},s(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:s,data:d,totalRecords:p,columns:D,getCellProps:e=>({style:{minWidth:e.column.Header===s("PTR_INBOX_APPLICATION_NO")?"240px":"",padding:"20px 18px",fontSize:"16px"}}),onPageSizeChange:function(e){g("limit",Number(e.target.value)),E(c)()},currentPage:y("offset")/y("limit"),onNextPage:function(){g("offset",y("offset")+y("limit")),E(c)()},onPrevPage:P,pageSizeLimit:y("limit"),onSort:N,disableSort:!1,sortParams:[{id:y("sortBy"),desc:"DESC"===y("sortOrder")}]})))},We=e=>{o.useParams();const{t:r}=i.useTranslation(),a=Digit.ULBService.getCurrentTenantId(),[u,s]=n.useState({}),[c,d]=n.useState(null),p={enabled:!!(u&&Object.keys(u).length>0)},{isLoading:v,isSuccess:m,data:{PetRegistrationApplications:f,Count:h}={}}=Digit.Hooks.ptr.usePTRSearch({tenantId:a,filters:u},p);return l.createElement(l.Fragment,null,l.createElement(je,{t:r,isLoading:v,tenantId:a,setShowToast:d,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={...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)=>({...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?d({warning:!0,label:"ERR_PROVIDE_BOTH_FORM_TO_DATE"}):s(i):d({warning:!0,label:"ERR_PROVIDE_MORE_PARAM_WITH_TYPE_STATUS"}):d({warning:!0,label:"ERR_PTR_FILL_VALID_FIELDS"})},data:m&&!v?f.length>0?f:{display:"ES_COMMON_NO_DATA"}:"",count:h}),c&&l.createElement(t.Toast,{error:c.error,warning:c.warning,label:r(c.label),isDleteBtn:!0,onClose:()=>{d(null)}}))},ze=e=>{var n,r,a,s,c,d,p,v;let{path:m,url:f,userType:h}=e;console.log("before coming here");const{t:E}=i.useTranslation(),g=o.useLocation();sessionStorage.removeItem("revalidateddone");const y=window.Digit.Utils.browser.isMobile(),_={searchParams:{uuid:{code:"ASSIGNED_TO_ALL",name:"ES_INBOX_ASSIGNED_TO_ALL"},services:["ptr"],applicationStatus:[],locality:[]}},S=e=>{let{location:n}=e;const{t:r}=i.useTranslation(),a=o.useLocation().search,u=(new URLSearchParams(a).get("from"),Digit.Hooks.useQueryParams(),[{path:"/digit-ui/employee",content:r("ES_COMMON_HOME"),show:!0},{path:"/digit-ui/employee/ptr/petservice/inbox",content:r("ES_TITLE_INBOX"),show:!!n.pathname.includes("ptr/petservice/inbox")},{path:"/digit-ui/employee/ptr/petservice/my-applications",content:r("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:y?{display:"flex"}:{},spanStyle:{maxWidth:"min-content"},crumbs:u})},b=null===(n=Digit)||void 0===n||null===(r=n.ComponentRegistryService)||void 0===r?void 0:r.getComponent("PTRNewApplication"),T=null===(a=Digit)||void 0===a||null===(s=a.ComponentRegistryService)||void 0===s?void 0:s.getComponent("ApplicationDetails"),C=null===(c=Digit)||void 0===c||null===(d=c.ComponentRegistryService)||void 0===d?void 0:d.getComponent("PTRResponse"),A=(null===(p=Digit)||void 0===p||null===(v=p.ComponentRegistryService)||void 0===v||v.getComponent("PTRDocsRequired"),window.location.href.includes("ptr/response")),D=window.location.href.includes("new-application")||window.location.href.includes("modify-application")||window.location.href.includes("ptr/application-details");return console.log("path",m),l.createElement(o.Switch,null,l.createElement(l.Fragment,null,l.createElement("div",{className:"ground-container"},A?null:l.createElement("div",{style:D?{marginLeft:"12px"}:{marginLeft:"-4px"}},l.createElement(S,{location:g})),l.createElement(t.PrivateRoute,{exact:!0,path:m+"/",component:()=>l.createElement($l,{matchPath:m,userType:h})}),l.createElement(t.PrivateRoute,{path:m+"/petservice/inbox",component:()=>l.createElement(He,{useNewInboxAPI:!0,parentRoute:m,businessService:"ptr",filterComponent:"PTR_INBOX_FILTER",initialStates:_,isInbox:!0})}),l.createElement(t.PrivateRoute,{path:m+"/petservice/new-application",component:()=>l.createElement(b,{parentUrl:f})}),l.createElement(t.PrivateRoute,{path:m+"/petservice/application-details/:id",component:()=>l.createElement(T,{parentRoute:m})}),l.createElement(t.PrivateRoute,{path:m+"/petservice/applicationsearch/application-details/:id",component:()=>l.createElement(T,{parentRoute:m})}),l.createElement(t.PrivateRoute,{path:m+"/petservice/response",component:e=>l.createElement(C,u({},e,{parentRoute:m}))}),l.createElement(t.PrivateRoute,{path:m+"/petservice/search",component:e=>l.createElement(Search,u({},e,{t:E,parentRoute:m}))}),l.createElement(t.PrivateRoute,{path:m+"/searchold",component:()=>l.createElement(He,{parentRoute:m,businessService:"ptr",middlewareSearch:searchMW,initialStates:_,isInbox:!1,EmptyResultInboxComp:"PTEmptyResultInbox"})}),l.createElement(t.PrivateRoute,{path:m+"/petservice/my-applications",component:e=>l.createElement(We,u({},e,{parentRoute:m}))}))))},$e=e=>{var n;let{status:o,searchParams:r,onAssignmentChange:a,statusMap:u}=e;return i.useTranslation(),l.createElement(t.CheckBox,{styles:{height:"unset"},onChange:e=>a({...e,state:o.state},o),checked:null==r?void 0:r.applicationStatus.some(e=>e.uuid===o.uuid),label:`${o.name} (${(null==u||null===(n=u.find(e=>e.statusid===o.uuid))||void 0===n?void 0:n.count)||"-"})`})},Ve=e=>{var o,r,a,u,s;let{onAssignmentChange:c,searchParams:d,businessServices:p,statusMap:v}=e;const{t:m}=i.useTranslation(),[f,h]=n.useState(!1),{data:E,isLoading:g}=Digit.Hooks.useApplicationStatusGeneral({businessServices:p},{}),{userRoleStates:y}=E||{},_=(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===(o=y.filter(e=>!e.isTerminateState))||void 0===o||null===(r=o.slice(0,4))||void 0===r?void 0:r.map((e,t)=>l.createElement($e,{businessServices:p,key:t,onAssignmentChange:c,status:{name:_(e,m),code:e.applicationStatus,...e},searchParams:d,statusMap:v})),(null==y||null===(a=y.filter(e=>!e.isTerminateState))||void 0===a?void 0:a.slice(4).length)>0?l.createElement(l.Fragment,null,f&&(null==y||null===(u=y.filter(e=>!e.isTerminateState))||void 0===u||null===(s=u.slice(4))||void 0===s?void 0:s.map((e,t)=>l.createElement($e,{businessServices:p,key:e.uuid,onAssignmentChange:c,status:{name:_(e,m),code:e.applicationStatus,...e},searchParams:d,statusMap:v}))),l.createElement("div",{className:"filter-button",onClick:()=>h(!f)}," ",m(f?"ES_COMMON_LESS":"ES_COMMON_MORE")," ")):null):null},qe=e=>{var o;let{searchParams:r,onFilterChange:u,defaultSearchParams:s,statusMap:c,moduleCode:d,...p}=e;const{t:v}=i.useTranslation(),m=a.useQueryClient(),[f,h]=n.useState(()=>({...r,services:[]})),E=[{label:"PTR_NEW_REGISTRATION",value:"ptr"}],g=e=>{let t=e.delete,n={...f,...e};t&&t.forEach(e=>delete n[e]),delete e.delete,h({...n})},y=()=>{h({...s,services:[]}),u({...s})},_=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"}},v("ES_COMMON_FILTER_BY"),":")),l.createElement("div",{className:"clearAll",onClick:y},v("ES_COMMON_CLEAR_ALL")),"desktop"===p.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"===p.type&&l.createElement("span",{onClick:p.onClose},l.createElement(t.CloseSvg,null))),l.createElement("div",null,l.createElement("div",null,l.createElement("div",{className:"filter-label",style:{fontWeight:"normal"}},v("ES_INBOX_LOCALITY"),":"),l.createElement(t.Localities,{selectLocality:e=>{g({locality:[...(null==f?void 0:f.locality)||[],e]})},tenantId:_,boundaryType:"revenue"}),l.createElement("div",{className:"tag-container"},null==f||null===(o=f.locality)||void 0===o?void 0:o.map((e,n)=>l.createElement(t.RemoveableTag,{key:n,text:v(e.i18nkey),onClick:()=>{g({locality:null==f?void 0:f.locality.filter(t=>t.code!==e.code)})}})))),l.createElement("div",null,l.createElement("div",{className:"filter-label",style:{fontWeight:"normal"}},v("ES_PTR_APP_TYPE")),E.map((e,n)=>{var i;const o=null==f||null===(i=f.services)||void 0===i?void 0:i.includes(e.value);return l.createElement(t.CheckBox,{key:n+"service",label:v(e.label),value:e.label,checked:o,onChange:t=>((e,t)=>{var n;g(e.target.checked?{services:Array.isArray(f.services)?[...f.services,t]:[t]}:{services:f.services.filter(e=>e!==t),applicationStatus:null===(n=f.applicationStatus)||void 0===n?void 0:n.filter(e=>e.stateBusinessService!==t)})})(t,e.value)})})),l.createElement("div",null,l.createElement(Ve,{searchParams:f,businessServices:f.services,statusMap:c||m.getQueryData("INBOX_STATUS_MAP_"+d),moduleCode:d,onAssignmentChange:(e,t)=>{if(e.target.checked)g({applicationStatus:[...null==f?void 0:f.applicationStatus,t]});else{let e=null==f?void 0:f.applicationStatus.filter(e=>e.state!==t.state);g({applicationStatus:e})}}})),l.createElement("div",null,l.createElement(t.SubmitBar,{onSubmit:()=>{u(0===f.services.length?{...f,services:E.map(e=>e.value)}:f)},label:v("ES_COMMON_APPLY")}))))))},Ge=e=>l.createElement("span",{className:"cell-text"},e),Ke=e=>l.createElement("span",{className:"sla-cell"},e),Ye=[{head:"ES_TITILE_OWNER_DETAILS",body:[{component:"PTROwnerDetails",withoutLabel:!0,key:"owners",type:"component"}]},{head:"ES_TITILE_PET_DETAILS",body:[{component:"PTRPetdetails",withoutLabel:!0,key:"pets",type:"component"}]},{head:"PTR_LOCATION_DETAILS",body:[{route:"pincode",component:"PTRSelectPincode",texts:{headerCaption:"PTR_CAPTION",header:"PTR_PINCODE_LABEL",cardText:"PTR_PINCODE_TEXT",submitBarLabel:"PTR_COMMON_NEXT",skipText:"CORE_COMMON_SKIP_CONTINUE"},withoutLabel:!0,key:"address",nextStep:"address",type:"component"},{route:"address",component:"PTRSelectAddress",withoutLabel:!0,key:"address",nextStep:"street",isMandatory:!0,type:"component"},{type:"component",route:"street",component:"PTRSelectStreet",key:"address",withoutLabel:!0,nextStep:"landmark"},{type:"component",route:"landmark",component:"PTSelectLandmark",withoutLabel:!0,key:"address",hideInEmployee:!0}]},{head:"ES_TITILE_DOCUMENT_DETAILS",body:[{component:"PTRDocumentUpload",withoutLabel:!0,key:"documents",type:"component"}]}],Xe=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"})),Je=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(Ze,null)),Qe=e=>{var i,o;let{t:r,action:a,tenantId:u,closeModal:s,submitAction:c,applicationData:d,businessService:p,moduleCode:v}=e;const{data:m,isLoading:f}=Digit.Hooks.useEmployeeSearch(u,{roles:null==a||null===(i=a.assigneeRoles)||void 0===i||null===(o=i.map)||void 0===o?void 0:o.call(i,e=>({code:e})),isActive:!0},{enabled:!(null!=a&&a.isTerminateState)}),{isLoading:h,data:E}=Digit.Hooks.pt.useMDMS(u,p,"FINANCIAL_YEARLS",{},{details:{tenantId:Digit.ULBService.getStateId(),moduleDetails:[{moduleName:"egf-master",masterDetails:[{name:"FinancialYear",filter:"[?(@.module == 'PT')]"}]}]}}),[y,_]=n.useState({}),[S,b]=n.useState({}),[T,C]=n.useState([]),[A,D]=n.useState(null),[N,P]=n.useState(null),[x,R]=n.useState(null),[I,w]=n.useState(null),[O,L]=n.useState([]),[k,M]=n.useState(null),[F,B]=n.useState(!1);function U(e){P(e.target.files[0])}return n.useEffect(()=>{var e;E&&E["egf-master"]&&L(null===(e=E["egf-master"])||void 0===e?void 0:e.FinancialYear)},[E]),n.useEffect(()=>{var e;C(null==m||null===(e=m.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[m]),n.useEffect(()=>{!function(){try{w(null);const e=function(){if(N){const e=function(){if(N.size>=5242880)w(r("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=g(function(){return Promise.resolve(Digit.UploadServices.Filestorage("PT",N,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):w(r("CS_FILE_UPLOAD_ERROR"))})},function(){w(r("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[N]),n.useEffect(()=>{a&&_(null!=a&&a.showFinancialYearsModal?(e=>{let{t:n,action:i,financialYears:o,selectedFinancialYear:r,setSelectedFinancialYear:a}=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:a,selectedOption:r})}]}]}})({t:r,action:a,financialYears:O,selectedFinancialYear:k,setSelectedFinancialYear:M}):(e=>{var n;let{t:i,action:o,approvers:r,selectedApprover:a,setSelectedApprover:u,selectFile:s,uploadedFile:c,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:r,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:u,selected:a})},{label:i("ES_PT_ACTION_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:`${i("ES_PT_ATTACH_FILE")}${o.docUploadRequired?" *":""}`,populators:l.createElement(t.UploadFile,{id:"workflow-doc",onUpload:s,onDelete:()=>{d(null)},showHint:!0,hintText:i("PT_ATTACH_RESTRICTIONS_SIZE"),message:c?"1 "+i("ES_PT_ACTION_FILEUPLOADED"):i("ES_PT_ACTION_NO_FILEUPLOADED")})}]}]}})({t:r,action:a,approvers:T,selectedApprover:A,setSelectedApprover:D,selectFile:U,uploadedFile:x,setUploadedFile:R,businessService:p}))},[a,T,O,k,x]),a&&y.form?l.createElement(t.Modal,{headerBarMain:l.createElement(Xe,{label:r(y.label.heading)}),headerBarEnd:l.createElement(Je,{onClick:s}),actionCancelLabel:r(y.label.cancel),actionCancelOnSubmit:s,actionSaveLabel:r(y.label.submit),actionSaveOnSubmit:()=>{},isDisabled:a.showFinancialYearsModal?!k:f||(null==a?void 0:a.docUploadRequired)&&!x,formId:"modal-action"},h?l.createElement(t.Loader,null):l.createElement(t.FormComposer,{config:y.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"};d.creationReason="STATUS",c({customFunctionToExecute:null==a?void 0:a.customFunctionToExecute,Property:{...d,workflow:t}})}else if(null!=a&&a.showFinancialYearsModal)c({customFunctionToExecute:null==a?void 0:a.customFunctionToExecute,Assessment:{financialYear:null==k?void 0:k.name,propertyId:null==d?void 0:d.propertyId,tenantId:u,source:null==d?void 0:d.source,channel:null==d?void 0:d.channel,assessmentDate:Date.now()}});else{let t={action:null==a?void 0:a.action,comment:null==e?void 0:e.comments,businessService:p,moduleName:v};t.assignes=null!=a&&a.isTerminateState||!A?[]:[A],x&&(t.documents=[{documentType:(null==a?void 0:a.action)+" DOC",fileName:null==N?void 0:N.name,fileStoreId:x}]),c({Property:{...d,workflow:t}})}},defaultValues:S,formId:"modal-action"})):l.createElement(t.Loader,null)},et=e=>l.createElement("h1",{className:"heading-m"},e.label),tt=()=>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"})),nt=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(tt,null)),lt=e=>{var i,o;let{t:r,action:a,tenantId:u,closeModal:s,submitAction:c,applicationData:d,businessService:p}=e;const{data:v}=Digit.Hooks.useEmployeeSearch(u,{roles:null==a||null===(i=a.assigneeRoles)||void 0===i||null===(o=i.map)||void 0===o?void 0:o.call(i,e=>({code:e})),isActive:!0},{enabled:!(null!=a&&a.isTerminateState)}),{isLoading:m,data:f}=Digit.Hooks.pt.useMDMS(u,p,"FINANCIAL_YEARLS",{},{details:{tenantId:Digit.ULBService.getStateId(),moduleDetails:[{moduleName:"egf-master",masterDetails:[{name:"FinancialYear",filter:"[?(@.module == 'TL')]"}]}]}}),[h,E]=n.useState({}),[y,_]=n.useState({}),[S,b]=n.useState([]),[T,C]=n.useState({}),[A,D]=n.useState(null),[N,P]=n.useState(null),[x,R]=n.useState(null),[I,w]=n.useState([]),[O,L]=n.useState(null);n.useEffect(()=>{var e;f&&f["egf-master"]&&w(null===(e=f["egf-master"])||void 0===e?void 0:e.FinancialYear)},[f]);const{data:k}=Digit.Hooks.useCustomMDMS(u,"common-masters",[{name:"Department"}]);function M(e){D(e.target.files[0])}return n.useEffect(()=>{if(v&&k){var e;const t=k["common-masters"].Department;b(null==v||null===(e=v.Employees)||void 0===e?void 0:e.map(e=>{var n,l,i;const o=null==e||null===(n=e.assignments)||void 0===n||null===(l=n[0])||void 0===l?void 0:l.department,r=null==t?void 0:t.find(e=>(null==e?void 0:e.code)===o);return console.log("matchedDept===",r),{uuid:null==e?void 0:e.uuid,name:`${null==e||null===(i=e.user)||void 0===i?void 0:i.name} - ${null==r?void 0:r.name}`}}))}},[v]),n.useEffect(()=>{!function(){try{R(null);const e=function(){if(A){const e=function(){if(A.size>=5242880)R(r("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=g(function(){return Promise.resolve(Digit.UploadServices.Filestorage("PT",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?P(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):R(r("CS_FILE_UPLOAD_ERROR"))})},function(){R(r("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[A]),n.useEffect(()=>{a&&E((e=>{let{t:n,action:i,approvers:o,selectedApprover:r,setSelectedApprover:a,selectFile:u,uploadedFile:s,setUploadedFile:c,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:a,selected:r}):null},{label:n("WF_COMMON_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:n("TL_APPROVAL_CHECKLIST_BUTTON_UP_FILE"),populators:l.createElement(t.UploadFile,{id:"workflow-doc",onUpload:u,onDelete:()=>{c(null)},message:s?"1 "+n("ES_PT_ACTION_FILEUPLOADED"):n("CS_ACTION_NO_FILEUPLOADED")})}]}]}})({t:r,action:a,approvers:S,selectedApprover:T,setSelectedApprover:C,selectFile:M,uploadedFile:N,setUploadedFile:P,businessService:p}))},[a,S,I,O,N]),a&&h.form?l.createElement(t.Modal,{headerBarMain:l.createElement(et,{label:r(h.label.heading)}),headerBarEnd:l.createElement(nt,{onClick:s}),actionCancelLabel:r(h.label.cancel),actionCancelOnSubmit:s,actionSaveLabel:r(h.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},m?l.createElement(t.Loader,null):l.createElement(t.FormComposer,{config:h.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){d={...d,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==A?void 0:A.name,fileStoreId:N}]:null},c({Licenses:[d]})},defaultValues:y,formId:"modal-action"})):l.createElement(t.Loader,null)},it=e=>l.createElement("h1",{style:{marginLeft:"22px"},className:"heading-m BPAheading-m"},e.label),ot=()=>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(ot,null)),at=e=>{var i,o;let{t:r,action:a,tenantId:u,closeModal:s,submitAction:c,applicationData:d,businessService:p}=e;const{data:v,isLoading:m}=Digit.Hooks.useEmployeeSearch(u,{roles:null==a||null===(i=a.assigneeRoles)||void 0===i||null===(o=i.map)||void 0===o?void 0:o.call(i,e=>({code:e})),isActive:!0},{enabled:!(null!=a&&a.isTerminateState)}),[f,h]=n.useState({}),[E,y]=n.useState({}),[_,S]=n.useState([]),[b,T]=n.useState({}),[C,A]=n.useState(null),[D,N]=n.useState(null),[P,x]=n.useState(null),R=!!Digit.Utils.browser.isMobile();function I(e){A(e.target.files[0])}return n.useEffect(()=>{var e;S(null==v||null===(e=v.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[v]),n.useEffect(()=>{!function(){try{x(null);const e=function(){if(C){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(C.size>=5242880)x(r("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=C&&C.type&&!e.test(null==C?void 0:C.type))x(r("NOT_SUPPORTED_FILE_TYPE"));else{const e=g(function(){return Promise.resolve(Digit.UploadServices.Filestorage("OBPS",C,Digit.ULBService.getStateId()||(null==u?void 0:u.split(".")[0]))).then(function(e){var t,n,l,i;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?N(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):x(r("CS_FILE_UPLOAD_ERROR"))})},function(){x(r("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[C]),n.useEffect(()=>{a&&h((e=>{let{t:n,action:i,approvers:o,selectedApprover:r,setSelectedApprover:a,selectFile:u,uploadedFile:s,setUploadedFile:c,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:a,selected:r}):null},{label:n("WF_COMMON_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:n("BPA_APPROVAL_CHECKLIST_BUTTON_UP_FILE"),populators:l.createElement(t.UploadFile,{id:"workflow-doc",onUpload:u,onDelete:()=>{c(null)},message:s?"1 "+n("ES_PT_ACTION_FILEUPLOADED"):n("CS_ACTION_NO_FILEUPLOADED"),accept:"image/*, .pdf, .png, .jpeg, .jpg",iserror:p})}]}]}})({t:r,action:a,approvers:_,selectedApprover:b,setSelectedApprover:T,selectFile:I,uploadedFile:D,setUploadedFile:N,businessService:p,error:P}))},[a,_,D,P]),a&&f.form?l.createElement(t.Modal,{headerBarMain:l.createElement(it,{label:r(f.label.heading)}),headerBarEnd:l.createElement(rt,{onClick:s}),actionCancelLabel:r(f.label.cancel),actionCancelOnSubmit:s,actionSaveLabel:r(f.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action",isOBPSFlow:!0,popupStyles:R?{width:"720px"}:{},style:R?{height:"45px",width:"44%"}:{height:"45px",width:"107px",paddingLeft:"0px",paddingRight:"0px"},popupModuleMianStyles:R?{paddingLeft:"5px"}:{}},m?l.createElement(t.Loader,null):l.createElement(t.FormComposer,{config:f.form,cardStyle:{marginLeft:"0px",marginRight:"0px",marginTop:"-25px"},className:"BPAemployeeCard",noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){d={...d,action:null==a?void 0:a.action,comment:null==e?void 0:e.comments,assignee:null!=b&&b.uuid?[null==b?void 0:b.uuid]:null,wfDocuments:D?[{documentType:(null==a?void 0:a.action)+" DOC",fileName:null==C?void 0:C.name,fileStoreId:D}]:null},c({Licenses:[d]},!1,{isStakeholder:!0,bpa:!1})},defaultValues:E,formId:"modal-action"})):l.createElement(t.Loader,null)},ut=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"})),ct=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(st,null)),dt=e=>{var i,o,r,u,s,c,d,p,v,m,f,h;let{t:E,action:y,tenantId:_,closeModal:S,submitAction:b,applicationDetails:T,applicationData:C,businessService:A,workflowDetails:D,blockReason:N}=e;console.log("applicationData",C),console.log("workflowDetails",D),Digit.Hooks.obps.useObpsAPI(null!==(i=C)&&void 0!==i&&null!==(o=i.landInfo)&&void 0!==o&&null!==(r=o.address)&&void 0!==r&&r.city?null===(u=C)||void 0===u||null===(s=u.landInfo)||void 0===s||null===(c=s.address)||void 0===c?void 0:c.city:_,!1);const{data:P,isLoading:x}=Digit.Hooks.useEmployeeSearch(_,{roles:null==D||null===(d=D.data)||void 0===d||null===(p=d.initialActionState)||void 0===p||null===(v=p.nextActions)||void 0===v||null===(m=v.filter(e=>(null==e?void 0:e.action)==(null==y?void 0:y.action)))||void 0===m||null===(f=m[0])||void 0===f||null===(h=f.assigneeRoles)||void 0===h?void 0:h.map(e=>({code:e})),isActive:!0},{enabled:!(null!=y&&y.isTerminateState)}),[R,I]=(a.useQueryClient(),n.useState({})),[w,O]=n.useState({}),[L,k]=n.useState([]),[M,F]=n.useState([]),[B,U]=n.useState({}),[H,j]=n.useState({}),[W,z]=n.useState(null),[$,V]=n.useState(null),[q,G]=n.useState(null),[K,Y]=n.useState(null),X=!!Digit.Utils.browser.isMobile();function Z(e){z(e.target.files[0])}n.useEffect(()=>{var e;k(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{G(null);const e=function(){if(W){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(W.size>=5242880)G(E("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=W&&W.type&&!e.test(null==W?void 0:W.type))G(E("NOT_SUPPORTED_FILE_TYPE"));else{const e=g(function(){return Promise.resolve(Digit.UploadServices.Filestorage("OBPS",W,Digit.ULBService.getStateId()||(null==_?void 0:_.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?V(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):G(E("CS_FILE_UPLOAD_ERROR"))})},function(){G(E("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[W]);const J=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},Q=e=>{let t=[];var n;for(n=0;n<(null==e?void 0:e.questionLength);n++){var l;t.push({remarks:e["Remarks_"+n],question:null==e?void 0:e.questionList[n].question,value:null==e||null===(l=e["question_"+n])||void 0===l?void 0:l.code})}return t},ee=e=>{var t,n;let l=[],i=[];var o,r;return(null==e||null===(t=e.additionalDetails)||void 0===t||null===(n=t.fieldinspection_pending)||void 0===n?void 0:n.length)>0&&(i=null==e||null===(o=e.additionalDetails)||void 0===o?void 0:o.fieldinspection_pending),i=i.filter(e=>{if(!e.date)return!1;const t=new Date;return new Date(e.date)<=t}),"FIELDINSPECTION_INPROGRESS"==e.status?(l=JSON.parse(sessionStorage.getItem("INSPECTION_DATA")),(null===(r=l)||void 0===r?void 0:r.length)>0&&l.map((e,t)=>{i.push({docs:J(e.Documents),date:e.InspectionDate,questions:Q(e),time:null==e?void 0:e.InspectionTime})}),console.log("FIELDINSPECTION_INPROGRESS",i),i=i.filter(e=>e.date&&e.time),console.log("inspectionObinspectionOb",i)):sessionStorage.removeItem("INSPECTION_DATA"),[...i]},te=e=>{let t=JSON.parse(sessionStorage.getItem("BPA_DOCUMENTS")),n=[];return t.map(e=>{var t,l,i,o,r,a;(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===(r=o[0])||void 0===r?void 0:r.values]),(null==e||null===(a=e.newUploadedDocs)||void 0===a?void 0:a.length)>0&&(n=[...n,...null==e?void 0:e.newUploadedDocs])}),n},ne=()=>{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(()=>{F(null==N?void 0:N.map(e=>({code:null==e?void 0:e.code,name:null==e?void 0:e.value}))),y&&I((e=>{var n,i,o,r,a,u,s;let{t:c,action:d,approvers:p,selectedApprover:v,setSelectedApprover:m,selectedBlockReason:f,setBlockReason:h,selectFile:E,uploadedFile:g,setUploadedFile:y,assigneeLabel:_,businessService:S,error:b,blockReasonFiltered:T}=e,C=!1;return"REVOCATE"!=(null==d?void 0:d.action)&&"REJECT"!=(null==d?void 0:d.action)&&"SKIP_PAYMENT"!=d.action&&"SEND_BACK_TO_CITIZEN"!=(null==d?void 0:d.action)&&"APPROVE"!=(null==d?void 0:d.action)||(C=!0),{label:{heading:`WF_${null==d?void 0:d.action}_APPLICATION`,submit:`WF_${S}_${null==d?void 0:d.action}`,cancel:"BPA_CITIZEN_CANCEL_BUTTON"},form:[{body:[{label:d.isTerminateState||C||"BLOCK"==(null==d?void 0:d.action)&&"PENDINGAPPROVAL"==(null==d||null===(n=d.state)||void 0===n?void 0:n.state)||"FORWARD"==(null==d?void 0:d.action)&&"FIELDINSPECTION_PENDING"==(null==d||null===(i=d.state)||void 0===i?void 0:i.state)?null:c(_||"WF_ROLE_"+(null===(o=d.assigneeRoles)||void 0===o?void 0:o[0])),type:"dropdown",populators:d.isTerminateState||C||"BLOCK"==(null==d?void 0:d.action)&&"PENDINGAPPROVAL"==(null==d||null===(r=d.state)||void 0===r?void 0:r.state)||"FORWARD"==(null==d?void 0:d.action)&&"FIELDINSPECTION_PENDING"==(null==d||null===(a=d.state)||void 0===a?void 0:a.state)?null:l.createElement(t.Dropdown,{option:p,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:m,selected:v})},{label:"BLOCK"==(null==d?void 0:d.action)&&"PENDINGAPPROVAL"==(null==d||null===(u=d.state)||void 0===u?void 0:u.state)?c("BLOCK_REASON"):null,type:"dropdown",populators:"BLOCK"==(null==d?void 0:d.action)&&"PENDINGAPPROVAL"==(null==d||null===(s=d.state)||void 0===s?void 0:s.state)?l.createElement(t.Dropdown,{option:T,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:h,selected:f,isMandatory:!0}):null},{label:c("WF_COMMON_COMMENTS"),type:"textarea",isMandatory:!0,populators:{name:"comments"}},{label:""+c("WF_APPROVAL_UPLOAD_HEAD"),populators:l.createElement(t.UploadFile,{id:"workflow-doc",onUpload:E,onDelete:()=>{y(null)},message:g?"1 "+c("ES_PT_ACTION_FILEUPLOADED"):c("CS_ACTION_NO_FILEUPLOADED"),accept:"image/*, .pdf, .png, .jpeg, .jpg",iserror:b})}]}]}})({t:E,action:y,approvers:L,selectedApprover:B,setSelectedApprover:U,selectedBlockReason:H,setBlockReason:j,selectFile:Z,uploadedFile:$,setUploadedFile:V,businessService:A,assigneeLabel:"WF_ASSIGNEE_NAME_LABEL_BPA",error:q,blockReasonFiltered:M}))},[y,L,K,$,q]),y&&R.form?l.createElement(t.Modal,{headerBarMain:l.createElement(ut,{label:E(R.label.heading)}),headerBarEnd:l.createElement(ct,{onClick:S}),actionCancelLabel:E(R.label.cancel),actionCancelOnSubmit:S,actionSaveLabel:E(R.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action",isOBPSFlow:!0,popupStyles:X?{width:"720px"}:{},style:X?{minHeight:"45px",height:"auto",width:"44%"}:{minHeight:"45px",height:"auto",width:"107px",paddingLeft:"0px",paddingRight:"0px"},popupModuleMianStyles:X?{paddingLeft:"5px"}:{}},x?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,i,o,r,a,u,s,c,d,p,v,m,f,h,g,A,N,P,x,R,I,w,O,L,k;C={...C,documents:te(),additionalDetails:{...null===(t=C)||void 0===t?void 0:t.additionalDetails,fieldinspection_pending:ee(C),pendingapproval:ne(),blockingReason:null==H?void 0:H.name},workflow:{action:null==y?void 0:y.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:"FIELDINSPECTION_INPROGRESS"===(null==D||null===(i=D.data)||void 0===i||null===(o=i.processInstances)||void 0===o||null===(r=o[0])||void 0===r||null===(a=r.state)||void 0===a?void 0:a.applicationStatus)?[null==D||null===(u=D.data)||void 0===u||null===(s=u.processInstances)||void 0===s||null===(c=s[0])||void 0===c||null===(d=c.assigner)||void 0===d?void 0:d.uuid]:null!=B&&B.uuid?[null==B?void 0:B.uuid]:null,assignes:"FIELDINSPECTION_INPROGRESS"===(null==D||null===(p=D.data)||void 0===p||null===(v=p.processInstances)||void 0===v||null===(m=v[0])||void 0===m||null===(f=m.state)||void 0===f?void 0:f.applicationStatus)?[null==D||null===(h=D.data)||void 0===h||null===(g=h.processInstances)||void 0===g||null===(A=g[0])||void 0===A||null===(N=A.assigner)||void 0===N?void 0:N.uuid]:null!=B&&B.uuid?[null==B?void 0:B.uuid]:null,varificationDocuments:$?[{documentType:(null==y?void 0:y.action)+" DOC",fileName:null==W?void 0:W.name,fileStoreId:$}]:null},action:null==y?void 0:y.action,comment:null==e?void 0:e.comments,assignee:"FIELDINSPECTION_INPROGRESS"===(null==D||null===(P=D.data)||void 0===P||null===(x=P.processInstances)||void 0===x||null===(R=x[0])||void 0===R||null===(I=R.state)||void 0===I?void 0:I.applicationStatus)?[null==D||null===(w=D.data)||void 0===w||null===(O=w.processInstances)||void 0===O||null===(L=O[0])||void 0===L||null===(k=L.assigner)||void 0===k?void 0:k.uuid]:null!=B&&B.uuid?[null==B?void 0:B.uuid]:null,wfDocuments:$?[{documentType:(null==y?void 0:y.action)+" DOC",fileName:null==W?void 0:W.name,fileStoreId:$}]:null};const M=function(e,t,n,l,i,o,r,a,u,s,c,d){if(!(parseInt(sessionStorage.getItem("lessAdjusment"))>parseInt(sessionStorage.getItem("development"))+parseInt(sessionStorage.getItem("otherCharges"))+parseInt(null===(e=C)||void 0===e||null===(t=e.additionalDetails)||void 0===t||null===(n=t.selfCertificationCharges)||void 0===n?void 0:n.BPA_MALBA_CHARGES)+parseInt(null===(l=C)||void 0===l||null===(i=l.additionalDetails)||void 0===i||null===(o=i.selfCertificationCharges)||void 0===o?void 0:o.BPA_LABOUR_CESS)+parseInt(null===(r=C)||void 0===r||null===(a=r.additionalDetails)||void 0===a||null===(u=a.selfCertificationCharges)||void 0===u?void 0:u.BPA_WATER_CHARGES)+parseInt(null===(s=C)||void 0===s||null===(c=s.additionalDetails)||void 0===c||null===(d=c.selfCertificationCharges)||void 0===d?void 0:d.BPA_GAUSHALA_CHARGES_CESS))){var p,v,m;C.additionalDetails.selfCertificationCharges.BPA_DEVELOPMENT_CHARGES=sessionStorage.getItem("development")||"0",C.additionalDetails.selfCertificationCharges.BPA_OTHER_CHARGES=sessionStorage.getItem("otherCharges")||"0",C.additionalDetails.selfCertificationCharges.BPA_LESS_ADJUSMENT_PLOT=sessionStorage.getItem("lessAdjusment")||"0",C.additionalDetails.otherFeesDiscription=sessionStorage.getItem("otherChargesDisc"),C.additionalDetails.lessAdjustmentFeeFiles=JSON.parse(sessionStorage.getItem("uploadedFileLess"));const e=null==T||null===(p=T.nocData)||void 0===p?void 0:p.map(e=>{const t=Digit.SessionStorage.get(null==e?void 0:e.nocType)||[];return{Noc:{...e,documents:[...null!=e&&e.documents?null==e?void 0:e.documents:[],...t||[]]}}});let t={sourceRefId:null==e||null===(v=e[0])||void 0===v||null===(m=v.Noc)||void 0===m?void 0:m.sourceRefId};return Promise.resolve(Digit.NOCSearch.all(_,t)).then(function(t){var n;let l=!0,i=!0;null==t||null===(n=t.Noc)||void 0===n||n.map(e=>{var t,n,o,r,a;"APPROVED"!==(null==e||null===(t=e.applicationStatus)||void 0===t?void 0:t.toUpperCase())&&"AUTO_APPROVED"!==(null==e||null===(n=e.applicationStatus)||void 0===n?void 0:n.toUpperCase())&&"REJECTED"!==(null==e||null===(o=e.applicationStatus)||void 0===o?void 0:o.toUpperCase())&&"AUTO_REJECTED"!==(null==e||null===(r=e.applicationStatus)||void 0===r?void 0:r.toUpperCase())&&"VOIDED"!==(null==e||null===(a=e.applicationStatus)||void 0===a?void 0:a.toUpperCase())||1!=l&&1!=i||("AIRPORT_AUTHORITY"===(null==e?void 0:e.nocType)?l=!1:"FIRE_NOC"===(null==e?void 0:e.nocType)&&(i=!1))});let o=[];if(e&&e.map(e=>{var t,n,r,a,u,s,c,d,p,v,m,f;("APPROVED"!=(null==e||null===(t=e.Noc)||void 0===t||null===(n=t.applicationStatus)||void 0===n?void 0:n.toUpperCase())&&"AUTO_APPROVED"!=(null==e||null===(r=e.Noc)||void 0===r||null===(a=r.applicationStatus)||void 0===a?void 0:a.toUpperCase())&&"REJECTED"!=(null==e||null===(u=e.Noc)||void 0===u||null===(s=u.applicationStatus)||void 0===s?void 0:s.toUpperCase())&&"AUTO_REJECTED"!=(null==e||null===(c=e.Noc)||void 0===c||null===(d=c.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)&&l||"FIRE_NOC"===(null==e||null===(f=e.Noc)||void 0===f?void 0:f.nocType)&&i)&&o.push(e)}),"FIELDINSPECTION_INPROGRESS"==C.status){let e=JSON.parse(sessionStorage.getItem("INSPECTION_DATA"));(null==e?void 0:e.length)>0&&e.map((e,t)=>{e.InspectionDate&&e.InspectionTime?b({BPA:C},(null==o?void 0:o.length)>0&&o,{isStakeholder:!1,bpa:!0}):(S(),alert(E("Please fill Inspection Date and Time"))),console.log(" ob.InspectionDate && ob.InspectionTime",e.InspectionDate,e.InspectionTime)})}else b({BPA:C},(null==o?void 0:o.length)>0&&o,{isStakeholder:!1,bpa:!0})})}S(),alert(E("Enterd Less Adjustment amount is invalid"))}();return Promise.resolve(M&&M.then?M.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},defaultValues:w,formId:"modal-action"})):l.createElement(t.Loader,null)},pt=e=>l.createElement("h1",{style:{marginLeft:"22px"},className:"heading-m BPAheading-m"},e.label),vt=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),mt=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(vt,null)),ft=e=>{var i,r;let{t:u,action:s,tenantId:c,closeModal:d,submitAction:p,applicationData:v,businessService:m}=e;const{data:f,isLoading:h}=Digit.Hooks.useEmployeeSearch(c,{roles:null==s||null===(i=s.assigneeRoles)||void 0===i||null===(r=i.map)||void 0===r?void 0:r.call(i,e=>({code:e})),isActive:!0},{enabled:!(null!=s&&s.isTerminateState)}),[E,y]=(a.useQueryClient(),n.useState({})),[_,S]=n.useState({}),[b,T]=n.useState([]),[C,A]=n.useState({}),[D,N]=n.useState(null),[P,x]=n.useState(null),[R,I]=n.useState(null),w=!!Digit.Utils.browser.isMobile();function O(e){N(e.target.files[0])}return o.useHistory(),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{I(null);const e=function(){if(D){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(D.size>=5242880)I(u("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=D&&D.type&&!e.test(null==D?void 0:D.type))I(u("NOT_SUPPORTED_FILE_TYPE"));else{const e=g(function(){return Promise.resolve(Digit.UploadServices.Filestorage("NOC",D,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?x(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):I(u("CS_FILE_UPLOAD_ERROR"))})},function(){I(u("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[D]),n.useEffect(()=>{s&&y((e=>{var n;let{t:i,action:o,approvers:r,selectedApprover:a,setSelectedApprover:u,selectFile:s,uploadedFile:c,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 h=!1;return"APPROVE"!=(null==o?void 0:o.action)&&"REJECT"!=(null==o?void 0:o.action)&&"AUTO_APPROVE"!=o.action&&"AUTO_REJECT"!=o.action||(h=!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||h?null:i(p||"WF_ROLE_"+(null===(n=o.assigneeRoles)||void 0===n?void 0:n[0])),type:"dropdown",populators:o.isTerminateState||h?null:l.createElement(t.Dropdown,{option:r,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:u,selected:a})},{label:i("WF_COMMON_COMMENTS"),type:"textarea",isMandatory:f,populators:{name:"comments"}},{label:""+i("WF_APPROVAL_UPLOAD_HEAD"),populators:l.createElement(t.UploadFile,{id:"workflow-doc",onUpload:s,onDelete:()=>{d(null)},showHint:!0,message:c?"1 "+i("ES_PT_ACTION_FILEUPLOADED"):i("CS_ACTION_NO_FILEUPLOADED"),accept:"image/*, .pdf, .png, .jpeg, .jpg",iserror:m})}]}]}})({t:u,action:s,approvers:b,selectedApprover:C,setSelectedApprover:A,selectFile:O,uploadedFile:P,setUploadedFile:x,businessService:m,assigneeLabel:"WF_ASSIGNEE_NAME_LABEL",error:R}))},[s,b,P,R]),s&&E.form?l.createElement(t.Modal,{headerBarMain:l.createElement(pt,{label:u(E.label.heading)}),headerBarEnd:l.createElement(mt,{onClick:d}),actionCancelLabel:u(E.label.cancel),actionCancelOnSubmit:d,actionSaveLabel:u(E.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"}:{}},h?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){var t,n,l;let i=JSON.parse(sessionStorage.getItem("NewNOCDocs")),o=(null===(t=v)||void 0===t||null===(n=t.documents)||void 0===n?void 0:n.length)>0?[...null===(l=v)||void 0===l?void 0:l.documents]:[];i.map((e,t)=>{o.push(e)}),v={...v,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:P?[{documentType:(null==s?void 0:s.action)+" DOC",fileName:null==D?void 0:D.name,fileStoreId:P}]:null},documents:o},p({Noc:v},!1,{isNoc:!0})},defaultValues:_,formId:"modal-action"})):l.createElement(t.Loader,null)};function ht(e){var t=this.__data__=new he(e);this.size=t.size}ht.prototype.clear=function(){this.__data__=new he,this.size=0},ht.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},ht.prototype.get=function(e){return this.__data__.get(e)},ht.prototype.has=function(e){return this.__data__.has(e)},ht.prototype.set=function(e,t){var n=this.__data__;if(n instanceof he){var l=n.__data__;if(!Ee||l.length<199)return l.push([e,t]),this.size=++n.size,this;n=this.__data__=new _e(l)}return n.set(e,t),this.size=n.size,this};var Et=ht,gt=function(){try{var e=re(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),yt=function(e,t,n){"__proto__"==t&>?gt(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n},_t=Object.prototype.hasOwnProperty,St=function(e,t,n){var l=e[t];_t.call(e,t)&&pe(l,n)&&(void 0!==n||t in e)||yt(e,t,n)},bt=function(e,t,n,l){var i=!n;n||(n={});for(var o=-1,r=t.length;++o<r;){var a=t[o],u=l?l(n[a],e[a],a,n,e):void 0;void 0===u&&(u=e[a]),i?yt(n,a,u):St(n,a,u)}return n},Tt=function(e){return K(e)&&"[object Arguments]"==G(e)},Ct=Object.prototype,At=Ct.hasOwnProperty,Dt=Ct.propertyIsEnumerable,Nt=Tt(function(){return arguments}())?Tt:function(e){return K(e)&&At.call(e,"callee")&&!Dt.call(e,"callee")},Pt=function(){return!1},xt=c(function(e,t){var n=t&&!t.nodeType&&t,l=n&&e&&!e.nodeType&&e,i=l&&l.exports===n?U.Buffer:void 0;e.exports=(i?i.isBuffer:void 0)||Pt}),Rt=/^(?:0|[1-9]\d*)$/,It=function(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&Rt.test(e))&&e>-1&&e%1==0&&e<t},wt=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991},Ot={};Ot["[object Float32Array]"]=Ot["[object Float64Array]"]=Ot["[object Int8Array]"]=Ot["[object Int16Array]"]=Ot["[object Int32Array]"]=Ot["[object Uint8Array]"]=Ot["[object Uint8ClampedArray]"]=Ot["[object Uint16Array]"]=Ot["[object Uint32Array]"]=!0,Ot["[object Arguments]"]=Ot["[object Array]"]=Ot["[object ArrayBuffer]"]=Ot["[object Boolean]"]=Ot["[object DataView]"]=Ot["[object Date]"]=Ot["[object Error]"]=Ot["[object Function]"]=Ot["[object Map]"]=Ot["[object Number]"]=Ot["[object Object]"]=Ot["[object RegExp]"]=Ot["[object Set]"]=Ot["[object String]"]=Ot["[object WeakMap]"]=!1;var Lt=function(e){return function(t){return e(t)}},kt=c(function(e,t){var n=t&&!t.nodeType&&t,l=n&&e&&!e.nodeType&&e,i=l&&l.exports===n&&F.process,o=function(){try{return l&&l.require&&l.require("util").types||i&&i.binding&&i.binding("util")}catch(e){}}();e.exports=o}),Mt=kt&&kt.isTypedArray,Ft=Mt?Lt(Mt):function(e){return K(e)&&wt(e.length)&&!!Ot[G(e)]},Bt=Object.prototype.hasOwnProperty,Ut=function(e,t){var n=M(e),l=!n&&Nt(e),i=!n&&!l&&xt(e),o=!n&&!l&&!i&&Ft(e),r=n||l||i||o,a=r?function(e,t){for(var n=-1,l=Array(e);++n<e;)l[n]=t(n);return l}(e.length,String):[],u=a.length;for(var s in e)!t&&!Bt.call(e,s)||r&&("length"==s||i&&("offset"==s||"parent"==s)||o&&("buffer"==s||"byteLength"==s||"byteOffset"==s)||It(s,u))||a.push(s);return a},Ht=Object.prototype,jt=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Ht)},Wt=function(e,t){return function(n){return e(t(n))}},zt=Wt(Object.keys,Object),$t=Object.prototype.hasOwnProperty,Vt=function(e){return null!=e&&wt(e.length)&&!Q(e)},qt=function(e){return Vt(e)?Ut(e):function(e){if(!jt(e))return zt(e);var t=[];for(var n in Object(e))$t.call(e,n)&&"constructor"!=n&&t.push(n);return t}(e)},Gt=Object.prototype.hasOwnProperty,Kt=function(e){return Vt(e)?Ut(e,!0):function(e){if(!J(e))return function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}(e);var t=jt(e),n=[];for(var l in e)("constructor"!=l||!t&&Gt.call(e,l))&&n.push(l);return n}(e)},Yt=c(function(e,t){var n=t&&!t.nodeType&&t,l=n&&e&&!e.nodeType&&e,i=l&&l.exports===n?U.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}}),Xt=function(){return[]},Zt=Object.prototype.propertyIsEnumerable,Jt=Object.getOwnPropertySymbols,Qt=Jt?function(e){return null==e?[]:(e=Object(e),function(t,n){for(var l=-1,i=null==t?0:t.length,o=0,r=[];++l<i;){var a=t[l];Zt.call(e,a)&&(r[o++]=a)}return r}(Jt(e)))}:Xt,en=function(e,t){for(var n=-1,l=t.length,i=e.length;++n<l;)e[i+n]=t[n];return e},tn=Wt(Object.getPrototypeOf,Object),nn=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)en(t,Qt(e)),e=tn(e);return t}:Xt,ln=function(e,t,n){var l=t(e);return M(e)?l:en(l,n(e))},on=function(e){return ln(e,qt,Qt)},rn=function(e){return ln(e,Kt,nn)},an=re(U,"DataView"),un=re(U,"Promise"),sn=re(U,"Set"),cn=re(U,"WeakMap"),dn=le(an),pn=le(Ee),vn=le(un),mn=le(sn),fn=le(cn),hn=G;(an&&"[object DataView]"!=hn(new an(new ArrayBuffer(1)))||Ee&&"[object Map]"!=hn(new Ee)||un&&"[object Promise]"!=hn(un.resolve())||sn&&"[object Set]"!=hn(new sn)||cn&&"[object WeakMap]"!=hn(new cn))&&(hn=function(e){var t=G(e),n="[object Object]"==t?e.constructor:void 0,l=n?le(n):"";if(l)switch(l){case dn:return"[object DataView]";case pn:return"[object Map]";case vn:return"[object Promise]";case mn:return"[object Set]";case fn:return"[object WeakMap]"}return t});var En=hn,gn=Object.prototype.hasOwnProperty,yn=U.Uint8Array,_n=function(e){var t=new e.constructor(e.byteLength);return new yn(t).set(new yn(e)),t},Sn=/\w*$/,bn=H?H.prototype:void 0,Tn=bn?bn.valueOf:void 0,Cn=Object.create,An=function(){function e(){}return function(t){if(!J(t))return{};if(Cn)return Cn(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}(),Dn=kt&&kt.isMap,Nn=Dn?Lt(Dn):function(e){return K(e)&&"[object Map]"==En(e)},Pn=kt&&kt.isSet,xn=Pn?Lt(Pn):function(e){return K(e)&&"[object Set]"==En(e)},Rn={};Rn["[object Arguments]"]=Rn["[object Array]"]=Rn["[object ArrayBuffer]"]=Rn["[object DataView]"]=Rn["[object Boolean]"]=Rn["[object Date]"]=Rn["[object Float32Array]"]=Rn["[object Float64Array]"]=Rn["[object Int8Array]"]=Rn["[object Int16Array]"]=Rn["[object Int32Array]"]=Rn["[object Map]"]=Rn["[object Number]"]=Rn["[object Object]"]=Rn["[object RegExp]"]=Rn["[object Set]"]=Rn["[object String]"]=Rn["[object Symbol]"]=Rn["[object Uint8Array]"]=Rn["[object Uint8ClampedArray]"]=Rn["[object Uint16Array]"]=Rn["[object Uint32Array]"]=!0,Rn["[object Error]"]=Rn["[object Function]"]=Rn["[object WeakMap]"]=!1;var In=function e(t,n,l,i,o,r){var a,u=1&n,s=2&n,c=4&n;if(l&&(a=o?l(t,i,o,r):l(t)),void 0!==a)return a;if(!J(t))return t;var d=M(t);if(d){if(a=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&gn.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=En(t),v="[object Function]"==p||"[object GeneratorFunction]"==p;if(xt(t))return Yt(t,u);if("[object Object]"==p||"[object Arguments]"==p||v&&!o){if(a=s||v?{}:function(e){return"function"!=typeof e.constructor||jt(e)?{}:An(tn(e))}(t),!u)return s?function(e,t){return bt(e,nn(e),t)}(t,function(e,t){return e&&bt(t,Kt(t),e)}(a,t)):function(e,t){return bt(e,Qt(e),t)}(t,function(e,t){return e&&bt(t,qt(t),e)}(a,t))}else{if(!Rn[p])return o?t:{};a=function(e,t,n){var l=e.constructor;switch(t){case"[object ArrayBuffer]":return _n(e);case"[object Boolean]":case"[object Date]":return new l(+e);case"[object DataView]":return function(e,t){var n=t?_n(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?_n(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,Sn.exec(e));return t.lastIndex=e.lastIndex,t}(e);case"[object Set]":return new l;case"[object Symbol]":return Tn?Object(Tn.call(e)):{}}}(t,p,u)}}r||(r=new Et);var m=r.get(t);if(m)return m;r.set(t,a),xn(t)?t.forEach(function(i){a.add(e(i,n,l,i,t,r))}):Nn(t)&&t.forEach(function(i,o){a.set(o,e(i,n,l,o,t,r))});var f=d?void 0:(c?s?rn:on:s?Kt:qt)(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]),St(a,o,e(i,n,l,o,t,r))}),a},wn=function(e){return In(e,5)};const On=e=>l.createElement("h1",{className:"heading-m"},e.label),Ln=()=>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(Ln,null)),Mn=function(e,t){void 0===t&&(t="dayend");try{const n=e.match(/(\d{4})-(\d{1,2})-(\d{1,2})/),l=new Date(Date.UTC(n[1],n[2]-1,n[3]));return l.setMinutes(l.getMinutes()+l.getTimezoneOffset()),"dayend"===t&&(l.setHours(l.getHours()+24),l.setSeconds(l.getSeconds()-1)),l.getTime()}catch(t){return e}},Fn=e=>{var i,o;let{t:r,action:a,tenantId:s,closeModal:c,submitAction:d,applicationData:p,businessService:v}=e;const{data:m,isLoading:f}=Digit.Hooks.useEmployeeSearch(s,{roles:null==a||null===(i=a.assigneeRoles)||void 0===i||null===(o=i.map)||void 0===o?void 0:o.call(i,e=>({code:e})),isActive:!0},{enabled:!(null!=a&&a.isTerminateState)}),[h,E]=n.useState({}),[y,_]=n.useState({}),[S,b]=n.useState([]),[T,C]=n.useState({}),[A,D]=n.useState(null),[N,P]=n.useState(null),[x,R]=n.useState(null),I=window.Digit.Utils.browser.isMobile(),w=window.location.href.includes("/employee");function O(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{R(null);const e=function(){if(A){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(A.size>=5242880)R(r("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=A&&A.type&&!e.test(null==A?void 0:A.type))R(r("NOT_SUPPORTED_FILE_TYPE"));else{const e=g(function(){return Promise.resolve(Digit.UploadServices.Filestorage("WS",A,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):R(r("CS_FILE_UPLOAD_ERROR"))})},function(e){console.error("Modal -> err ",e),R(r("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[A]),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)?a&&E((e=>{var n;let{t:i,action:o,approvers:r,selectedApprover:a,setSelectedApprover:s,selectFile:c,uploadedFile:d,setUploadedFile:p,businessService:v,error:m}=e,f=!0,h=!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)||(h=!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:r,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:s,selected:a}):null},h&&{label:i("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: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:()=>{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:r,action:a,approvers:S,selectedApprover:T,setSelectedApprover:C,selectFile:O,uploadedFile:N,setUploadedFile:P,businessService:v,error:x})):a&&E((e=>{var n;let{t:i,action:o,approvers:r,selectedApprover:a,setSelectedApprover:u,selectFile:s,uploadedFile:c,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:r,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:u,selected:a}):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:()=>{d(null)},message:c?"1 "+i("ES_PT_ACTION_FILEUPLOADED"):i("CS_ACTION_NO_FILEUPLOADED"),error:v,iserror:v,showHintBelow:!0,hintText:"WS_HINT_TEXT_LABEL"})}]}]}})({t:r,action:a,approvers:S,selectedApprover:T,setSelectedApprover:C,selectFile:O,uploadedFile:N,setUploadedFile:P,businessService:v,error:x}))},[a,S,N,x]),a&&h.form?l.createElement(t.Modal,{headerBarMain:l.createElement(On,{label:r(h.label.heading)}),headerBarEnd:l.createElement(kn,{onClick:c}),actionCancelLabel:r(h.label.cancel),actionCancelOnSubmit:c,actionSaveLabel:r(h.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action",style:I&&w?{width:"100%",height:"auto"}:{}},f?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,i,o,r,u,c,v,m;if(null!==(t=p)&&void 0!==t&&t.isBillAmend){var f,h,E,g,y,_,S,b,C;const t={...null===(f=p)||void 0===f||null===(h=f.billAmendmentDetails)||void 0===h?void 0:h.additionalDetails,comments:null!=e&&e.comments?e.comments:null},n={...null===(E=p)||void 0===E?void 0:E.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:s,businessService:null!==(_=p)&&void 0!==_&&null!==(S=_.applicationType)&&void 0!==S&&S.includes("WATER")?"WS.AMENDMENT":"SW.AMENDMENT",moduleName:null!==(b=p)&&void 0!==b&&null!==(C=b.applicationType)&&void 0!==C&&C.includes("WATER")?"WS":"SW",assignes:null!=T&&T.uuid?[{uuid:null==T?void 0:T.uuid}]:[],comment:(null==e?void 0:e.comments)||"",documents:N?[{documentType:(null==a?void 0:a.action)+" DOC",fileName:null==A?void 0:A.name,fileStoreId:N}]:[]},additionalDetails:t,comment:(null==e?void 0:e.comments)||"",wfDocuments:N?[{documentType:(null==a?void 0:a.action)+" DOC",fileName:null==A?void 0:A.name,fileStoreId:N}]:null,processInstance:{action:null==a?void 0:a.action,assignes:null!=T&&T.uuid?[{uuid:null==T?void 0:T.uuid}]:[],comment:(null==e?void 0:e.comments)||"",documents:N?[{documentType:(null==a?void 0:a.action)+" DOC",fileName:null==A?void 0:A.name,fileStoreId:N}]:[]}};d({AmendmentUpdate:n})}else{if(p={...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]:[],assignes:null!=T&&T.uuid?[{uuid:null==T?void 0:T.uuid}]:[],wfDocuments:N?[{documentType:(null==a?void 0:a.action)+" DOC",fileName:null==A?void 0:A.name,fileStoreId:N}]:null,processInstance:{...null===(n=p)||void 0===n?void 0:n.processInstance,action:null==a?void 0:a.action,assignes:null!=T&&T.uuid?[{uuid:null==T?void 0:T.uuid}]:[],comment:(null==e?void 0:e.comments)||"",documents:N?[{documentType:(null==a?void 0:a.action)+" DOC",fileName:null==A?void 0:A.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=wn(null==e?void 0:e.date);p.disconnectionExecutionDate=Mn(t)}else if(null!=e&&e.date){const t=wn(null==e?void 0:e.date);p.connectionExecutionDate=Mn(t)}var D;if("DisconnectWSConnection"==(null===(o=p)||void 0===o||null===(r=o.processInstance)||void 0===r?void 0:r.businessService)||"DisconnectSWConnection"==(null===(u=p)||void 0===u||null===(c=u.processInstance)||void 0===c?void 0:c.businessService)||window.location.href.includes("disconnection"))"WATER"==(null===(D=p)||void 0===D?void 0:D.serviceType)?d({WaterConnection:p,disconnectRequest:!0}):d({SewerageConnection:p,disconnectRequest:!0});else if("SEWERAGE_RECONNECTION"==(null===(v=p)||void 0===v?void 0:v.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 P,x,R,I,w,O,L,k,M,F,B,U,H;const e=sessionStorage.getItem("Digit.ADHOC_ADD_REBATE_DATA"),t=e?JSON.parse(e):"";null!=t&&null!==(P=t.value)&&void 0!==P&&P.adhocPenalty&&(p.additionalDetails.adhocPenalty=parseInt(null==t||null===(x=t.value)||void 0===x?void 0:x.adhocPenalty)||""),null!=t&&null!==(R=t.value)&&void 0!==R&&R.adhocPenaltyComment&&(p.additionalDetails.adhocPenaltyComment=(null==t||null===(I=t.value)||void 0===I?void 0:I.adhocPenaltyComment)||""),null!=t&&null!==(w=t.value)&&void 0!==w&&w.adhocPenaltyReason&&(p.additionalDetails.adhocPenaltyReason=(null==t||null===(O=t.value)||void 0===O?void 0:O.adhocPenaltyReason)||""),null!=t&&null!==(L=t.value)&&void 0!==L&&L.adhocRebate&&(p.additionalDetails.adhocRebate=parseInt(null==t||null===(k=t.value)||void 0===k?void 0:k.adhocRebate)||""),null!=t&&null!==(M=t.value)&&void 0!==M&&M.adhocRebateComment&&(p.additionalDetails.adhocRebateComment=(null==t||null===(F=t.value)||void 0===F?void 0:F.adhocRebateComment)||""),null!=t&&null!==(B=t.value)&&void 0!==B&&B.adhocRebateReason&&(p.additionalDetails.adhocRebateReason=(null==t||null===(U=t.value)||void 0===U?void 0:U.adhocRebateReason)||""),"WATER"==(null===(H=p)||void 0===H?void 0:H.serviceType)?d({WaterConnection:p,disconnectRequest:!1,reconnectRequest:!1}):d({SewerageConnection:p,disconnectRequest:!1,reconnectRequest:!1})}}},defaultValues:y,formId:"modal-action"})):l.createElement(t.Loader,null)},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=e=>{var i,o;let{t:r,action:a,tenantId:u,closeModal:s,submitAction:c,applicationData:d,businessService:p,moduleCode:v}=e;console.log("applicationData",d);const{data:m}=Digit.Hooks.useEmployeeSearch(u,{roles:null==a||null===(i=a.assigneeRoles)||void 0===i||null===(o=i.map)||void 0===o?void 0:o.call(i,e=>({code:e})),isActive:!0},{enabled:!(null!=a&&a.isTerminateState)}),[f,h]=n.useState({}),[E,y]=n.useState({}),[_,S]=n.useState([]),[b,T]=n.useState(null),[C,A]=n.useState(null),[D,N]=n.useState(null),[P,x]=n.useState(null),[R,I]=n.useState(!1);function w(e){A(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{x(null);const e=function(){if(C){const e=function(){if(C.size>=5242880)x(r("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=g(function(){return Promise.resolve(Digit.UploadServices.Filestorage("PTR",C,Digit.ULBService.getStateId())).then(function(e){var t,n,l,i;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?N(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):x(r("CS_FILE_UPLOAD_ERROR"))})},function(){x(r("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[C]),n.useEffect(()=>{a&&h((e=>{let{t:t,action:n,businessService:l}=e;return{label:{heading:`WF_${null==n?void 0:n.action}_APPLICATION`,submit:`WF_${l}_${null==n?void 0:n.action}`,cancel:"ES_PTR_COMMON_CANCEL"},form:[{body:[{label:t("ES_PTR_ACTION_COMMENTS"),type:"textarea",populators:{name:"comments"}}]}]}})({t:r,action:a,approvers:_,selectedApprover:b,setSelectedApprover:T,selectFile:w,uploadedFile:D,setUploadedFile:N,businessService:p}))},[a,_,D]),a&&f.form?l.createElement(t.Modal,{headerBarMain:l.createElement(Bn,{label:r(f.label.heading)}),headerBarEnd:l.createElement(Hn,{onClick:s}),actionCancelLabel:r(f.label.cancel),actionCancelOnSubmit:s,actionSaveLabel:r(f.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},l.createElement(t.FormComposer,{config:f.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){if("COMMON_APPROVED"==(null==a?void 0:a.action)){let t={action:"OPEN",comments:null==e?void 0:e.comments,businessService:"ptr",moduleName:"pet-services"};d.creationReason="CREATE",c({PetRegistrationApplications:[{...d,workflow:t}]})}let t={action:null==a?void 0:a.action,comments:null==e?void 0:e.comments,businessService:p,moduleName:v};t.assignes=null!=a&&a.isTerminateState||!b?[]:[b],D&&(t.documents=[{documentType:(null==a?void 0:a.action)+" DOC",fileName:null==C?void 0:C.name,fileStoreId:D}]),c({PetRegistrationApplications:[{...d,workflow:t}]})},defaultValues:E,formId:"modal-action"})):l.createElement(t.Loader,null)},Wn=e=>l.createElement("h1",{className:"heading-m"},e.label),zn=()=>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(zn,null)),Vn=e=>{var i,o,r;let{t:a,action:u,closeModal:s,submitAction:c,applicationData:d,businessService:p}=e;const v=Digit.ULBService.getStateId(),{data:m,isLoading:f}=Digit.Hooks.tl.useTradeLicenseMDMS(v,"TradeLicense","TradeUnits","[?(@.type=='TL')]");console.log("tradeMdmsData",null==m||null===(i=m.TradeLicense)||void 0===i?void 0:i.TradeType),console.log("applicationData",d);const[h,E]=n.useState({}),[g,y]=n.useState({}),[_,S]=n.useState([]),[b,T]=n.useState(""),[C,A]=n.useState([]),[D,N]=n.useState(null),P=null===(o=d)||void 0===o||null===(r=o.tradeLicenseDetail)||void 0===r?void 0:r.tradeUnits;console.log("tradeUnits",P);const x=n.useMemo(()=>{var e;if(f||!m||!P.length)return[];const t=new Set(P.map(e=>e.tradeType)),n=(null===(e=m.TradeLicense)||void 0===e?void 0:e.TradeType.filter(e=>t.has(e.code))).some(e=>null==e?void 0:e.ishazardous);return console.log("hasHazardous",n),n?["1"]:["1","2","3"]},[f,m,P]);return console.log("years",x),n.useEffect(()=>{u&&E((e=>{let{t:n,action:i,years:o,selectedApprover:r,setSelectedApprover:a,businessService:u}=e;return{label:{heading:`WF_${null==i?void 0:i.action}_APPLICATION`,submit:`WF_${null==u?void 0:u.toUpperCase()}_${null==i?void 0:i.action}`,cancel:"WF_EMPLOYEE_NEWTL_CANCEL"},form:[{body:[{label:n("TL_VALID_FOR_NO_OF_YEARS"),type:"dropdown",populators:l.createElement(t.Dropdown,{option:o,autoComplete:"off",select:a,selected:r})}]}]}})({t:a,action:u,years:x,selectedApprover:b,setSelectedApprover:T,businessService:p}))},[u,x,C,D]),u&&h.form?l.createElement(t.Modal,{headerBarMain:l.createElement(Wn,{label:a(h.label.heading)}),headerBarEnd:l.createElement($n,{onClick:s}),actionCancelLabel:a(h.label.cancel),actionCancelOnSubmit:s,actionSaveLabel:a(h.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},f?l.createElement(t.Loader,null):l.createElement(t.FormComposer,{config:h.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){var t;let n=null===(t=d)||void 0===t?void 0:t.financialYear;const l=null==n?void 0:n.split("-")[1],i=`20${Number(l)}-${Number(l)+1}`;d={...d,financialYear:i,action:"INITIATE",additionalDetail:{...d.additionalDetail,validityYears:b.length>0?parseInt(b):""}},c({Licenses:[d]})},defaultValues:g,formId:"modal-action"})):l.createElement(t.Loader,null)},qn=e=>l.createElement("h1",{className:"heading-m"},e.label),Gn=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),Kn=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(Gn,null)),Yn=e=>{var i,o;let{t:r,action:a,tenantId:u,closeModal:s,submitAction:c,applicationData:d,businessService:p,moduleCode:v}=e;const{data:m}=Digit.Hooks.useEmployeeSearch(u,{roles:null==a||null===(i=a.assigneeRoles)||void 0===i||null===(o=i.map)||void 0===o?void 0:o.call(i,e=>({code:e})),isActive:!0},{enabled:null==a?void 0:a.isTerminateState}),[f,h]=n.useState({}),[E,y]=n.useState({}),[_,S]=n.useState([]),[b,T]=n.useState(null),[C,A]=n.useState(null),[D,N]=n.useState(null),[P,x]=n.useState(null),[R,I]=n.useState(!1);function w(e){I(!0),A(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{x(null);const e=function(){if(C){const e=function(){if(C.size>=5242880)x(r("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=function(e,t){try{var n=g(function(){return Promise.resolve(Digit.UploadServices.Filestorage("StreetVending",C,u)).then(function(e){var t,n,l,i;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?N(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):x(r("CS_FILE_UPLOAD_ERROR"))})},function(){x(r("CS_FILE_UPLOAD_ERROR"))})}catch(e){return t(!0,e)}return n&&n.then?n.then(t.bind(null,!1),t.bind(null,!0)):t(!1,n)}(0,function(e,t){if(I(!1),e)throw t;return t});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[C]),console.log("actyhdesh,jhfsefsef",a,d),n.useEffect(()=>{h((e=>{let{t:n,action:i,selectFile:o,uploadedFile:r,setUploadedFile:a,approvers:u,selectedApprover:s,setSelectedApprover:c,isUploading:d}=e;const p=()=>l.createElement("div",{className:"loading-spinner"});return console.log("isuploading ",d),{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:c,selected:s})},{label:n("SV_ACTION_COMMENTS"),isMandatory:!0,type:"textarea",populators:{name:"comments",validation:{required:!0}}},{label:`${n("SV_ATTATCH_FILE")}${i.docUploadRequired?" *":""}`,populators:l.createElement(t.UploadFile,{id:"workflow-doc-sv",onUpload:o,onDelete:()=>{a(null)},message:d?l.createElement("div",{style:{display:"flex",alignItems:"center",gap:"8px"}},l.createElement(p,null),l.createElement("span",null,"Uploading...")):r?"1 "+n("SV_FILE_UPLOADED"):n("SV_NO_FILE")})}]}]}})({t:r,action:a,approvers:_,selectedApprover:b,setSelectedApprover:T,selectFile:w,uploadedFile:D,setUploadedFile:N,businessService:p,isUploading:R}))},[a,_,D]),a&&f.form?l.createElement(t.Modal,{headerBarMain:l.createElement(qn,{label:r(f.label.heading)}),headerBarEnd:l.createElement(Kn,{onClick:s}),actionCancelLabel:r(f.label.cancel),actionCancelOnSubmit:s,actionSaveLabel:r(f.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},l.createElement(t.FormComposer,{config:f.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){var t;let n={action:null==a?void 0:a.action,comments:null==e?void 0:e.comments,businessService:p,moduleName:v,assignes:"SENDBACKTOCITIZEN"===(null==a?void 0:a.action)?[null==d||null===(t=d.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==C?void 0:C.name,fileStoreId:D}]),c({streetVendingDetail:{...d,workflow:n}})},defaultValues:E,formId:"modal-action"})):l.createElement(t.Loader,null)},Xn=e=>l.createElement("h1",{className:"heading-m"},e.label),Zn=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),Jn=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(Zn,null)),Qn=e=>{var i,o;let{t:r,action:a,tenantId:u,closeModal:s,submitAction:c,applicationData:d,businessService:p,moduleCode:v}=e;console.log("applicationData",d);const{data:m}=Digit.Hooks.useEmployeeSearch(u,{roles:null==a||null===(i=a.assigneeRoles)||void 0===i||null===(o=i.map)||void 0===o?void 0:o.call(i,e=>({code:e})),isActive:!0},{enabled:!(null!=a&&a.isTerminateState)}),[f,h]=n.useState({}),[E,y]=n.useState({}),[_,S]=n.useState([]),[b,T]=n.useState(null),[C,A]=n.useState(null),[D,N]=n.useState(null),[P,x]=n.useState(null),[R,I]=n.useState(!1);function w(e){A(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{x(null);const e=function(){if(C){const e=function(){if(C.size>=5242880)x(r("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=g(function(){return Promise.resolve(Digit.UploadServices.Filestorage("CHB",C,Digit.ULBService.getStateId())).then(function(e){var t,n,l,i;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?N(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):x(r("CS_FILE_UPLOAD_ERROR"))})},function(){x(r("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[C]),n.useEffect(()=>{a&&h((e=>{let{t:n,action:i,selectFile:o,uploadedFile:r,setUploadedFile:a,businessService:u}=e;return{label:{heading:`WF_${null==i?void 0:i.action}_APPLICATION`,submit:`WF_${u}_${null==i?void 0:i.action}`,cancel:"ES_CHB_COMMON_CANCEL"},form:[{body:[{label:n("ES_CHB_ACTION_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:`${n("ES_CHB_ATTACH_FILE")}${i.docUploadRequired?" *":""}`,populators:l.createElement(t.UploadFile,{id:"workflow-doc",onUpload:o,onDelete:()=>{a(null)},showHint:!0,hintText:n("CHB_ATTACH_RESTRICTIONS_SIZE"),message:r?"1 "+n("ES_CHB_ACTION_FILEUPLOADED"):n("ES_CHB_ACTION_NO_FILEUPLOADED")})}]}]}})({t:r,action:a,approvers:_,selectedApprover:b,setSelectedApprover:T,selectFile:w,uploadedFile:D,setUploadedFile:N,businessService:p}))},[a,_,D]),a&&f.form?l.createElement(t.Modal,{headerBarMain:l.createElement(Xn,{label:r(f.label.heading)}),headerBarEnd:l.createElement(Jn,{onClick:s}),actionCancelLabel:r(f.label.cancel),actionCancelOnSubmit:s,actionSaveLabel:r(f.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},l.createElement(t.FormComposer,{config:f.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){let t={action:null==a?void 0:a.action,comments:null==e?void 0:e.comments,businessService:p,moduleName:v};D&&(t.documents=[{documentType:(null==a?void 0:a.action)+" DOC",fileName:null==C?void 0:C.name,filestoreId:D}]),c({hallsBookingApplication:[{...d,workflow:t}]})},defaultValues:E,formId:"modal-action"})):l.createElement(t.Loader,null)},el=e=>null!=e&&e.businessService.includes("PT")?l.createElement(Qe,e):null!=e&&e.businessService.includes("ptr")?l.createElement(jn,e):null!=e&&e.businessService.includes("NewTL")||null!=e&&e.businessService.includes("TL")||null!=e&&e.businessService.includes("EDITRENEWAL")?l.createElement(lt,e):null!=e&&e.businessService.includes("DIRECTRENEWAL")?l.createElement(Vn,e):null!=e&&e.moduleCode.includes("BPAREG")?l.createElement(at,e):null!=e&&e.moduleCode.includes("BPA")?l.createElement(dt,e):null!=e&&e.moduleCode.includes("NOC")?l.createElement(ft,e):null!=e&&e.moduleCode.includes("WS")?l.createElement(Fn,e):null!=e&&e.businessService.includes("street-vending")?l.createElement(Yn,e):null!=e&&e.businessService.includes("chb")?l.createElement(Qn,e):void 0;function tl(e){let{documents:n,svgStyles:o={},isSendBackFlow:r=!1,isHrLine:a=!1,titleStyles:u}=e;const{t:s}=i.useTranslation(),c=window.location.href.includes("stakeholder");return l.createElement("div",{style:{marginTop:"19px",display:"flex",flexWrap:"wrap",flexDirection:"row",borderRadius:"4px",background:"#FAFAFA",border:"1px solid #D6D5D4",padding:"8px"}},!c&&(null==n?void 0:n.map((e,i)=>{var o,c,d;return l.createElement(l.Fragment,{key:i},l.createElement("div",{style:{display:"flex",flexWrap:"wrap",justifyContent:"flex-start"}},l.createElement("div",{style:{display:"flex",flexWrap:"wrap",justifyContent:"flex-start"}},null!=e&&e.values&&(null==e?void 0:e.values.length)>0?null==e||null===(o=e.values)||void 0===o?void 0:o.map((n,i)=>{var o;return l.createElement("div",{style:{width:"180px"}},l.createElement(t.CardSubHeader,{style:u||{marginTop:"32px",marginBottom:"8px",color:"#505A5F",fontSize:"24px"}},s(null==e?void 0:e.title)),l.createElement("a",{target:"_",href:null==n?void 0:n.url,style:{minWidth:"80px",marginRight:"10px",maxWidth:"100px",height:"auto",minWidth:"100px"},key:i},l.createElement("div",{style:{display:"flex",justifyContent:"flex-start"}},l.createElement(t.PDFSvg,null)),l.createElement("p",{style:{marginTop:"8px",fontWeight:"bold",textAlign:"start",color:"#505A5F"}},s(null==n?void 0:n.title)),r?null!=n&&null!==(o=n.documentType)&&void 0!==o&&o.includes("NOC")?l.createElement("p",{style:{textAlign:"center"}},s(null==n?void 0:n.documentType.split(".")[1])):l.createElement("p",{style:{textAlign:"center"}},s(null==n?void 0:n.documentType)):""))}):!window.location.href.includes("citizen")&&l.createElement("div",null,l.createElement("p",null,s("BPA_NO_DOCUMENTS_UPLOADED_LABEL")),l.createElement("div",{style:{width:"180px"}},l.createElement(t.CardSubHeader,{style:u||{marginTop:"32px",marginBottom:"8px",color:"#505A5F",fontSize:"24px"}}),l.createElement("div",{style:{minWidth:"80px",marginRight:"10px",maxWidth:"100px",height:"auto",minWidth:"100px"},key:i},l.createElement("div",{style:{display:"flex",justifyContent:"flex-start"}},l.createElement(t.PDFSvg,null)),l.createElement("p",{style:{marginTop:"8px",fontWeight:"bold",textAlign:"start",color:"#505A5F"}}),r?(null!==(c=value)&&void 0!==c&&null!==(d=c.documentType)&&void 0!==d&&d.includes("NOC"),l.createElement("p",{style:{textAlign:"center"}})):"")))),a&&(null==n?void 0:n.length)!=i+1?l.createElement("hr",{style:{color:"#D6D5D4",backgroundColor:"#D6D5D4",height:"2px",marginTop:"20px",marginBottom:"20px"}}):null))})),c&&(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"}},s(null==e?void 0:e.title)):null,l.createElement("div",null,null!=e&&e.values&&(null==e?void 0:e.values.length)>0?null==e||null===(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"}},s(null==e?void 0:e.title)),null!=e&&e.docInfo?l.createElement("div",{style:{fontSize:"12px",color:"#505A5F",fontWeight:400,lineHeight:"15px",marginBottom:"10px"}},""+s(null==e?void 0:e.docInfo)):null,l.createElement(t.PDFSvg,null),l.createElement("p",{style:{marginTop:"8px",fontSize:"16px",lineHeight:"19px",color:"#505A5F",fontWeight:"400",textAlign:"center",color:"#505A5F"}},""+s(null==e?void 0:e.title))))):!window.location.href.includes("citizen")&&l.createElement("div",null,l.createElement("p",null,s("BPA_NO_DOCUMENTS_UPLOADED_LABEL")))))})))}const nl=e=>{var t,i;let{t:o,formData:r,applicationData:a,docs:u,bpaActionsDetails:s}=e;const c=(null==a?void 0:a.status)||"",d=(null==s||null===(t=s.data)||void 0===t?void 0:t.nextActions)||[],p=Digit.ULBService.getStateId(),[v,m]=n.useState((null==r||null===(i=r.documents)||void 0===i?void 0:i.documents)||[]),[f,h]=n.useState(null),[E,g]=n.useState([]),[y,_]=n.useState(!0),[S,b]=n.useState(!1),[T,C]=n.useState(!1),{isLoading:A,data:D}=Digit.Hooks.obps.useMDMS(p,"BPA",["DocTypeMapping"]),{isLoading:N,data:P}=Digit.Hooks.obps.useMDMS(p,"common-masters",["DocumentType"]);return n.useEffect(()=>{var e,t,n,l;let i=[];var o,r;null!=D&&null!==(e=D.BPA)&&void 0!==e&&e.DocTypeMapping&&(i=null==D||null===(o=D.BPA)||void 0===o||null===(r=o.DocTypeMapping)||void 0===r?void 0:r.filter(e=>{var t,n;return e.WFState==(null==a?void 0:a.status)?null==a?void 0:a.status:e.RiskType==(null==a?void 0:a.riskType)&&e.ServiceType==(null==a||null===(t=a.additionalDetails)||void 0===t?void 0:t.serviceType)&&e.applicationType==(null==a||null===(n=a.additionalDetails)||void 0===n?void 0:n.applicationType)}));let s=[];null===(t=i)||void 0===t||null===(n=t[0])||void 0===n||null===(l=n.docTypes)||void 0===l||l.forEach(e=>{var t,n,l,i;let o=e.code;e.dropdownData=[],e.uploadedDocuments=[],null==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)}),s.push(e)}),sessionStorage.setItem("BPA_DOCUMENTS",JSON.stringify(s)),g(s)},[!A,!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)}),_("0"!=e&&0!=e||!(v.length>0))},[v,S]),n.useEffect(()=>{C("DOC_VERIFICATION_INPROGRESS"===c&&(null==d?void 0:d.length)>0)},[a,s]),l.createElement("div",{style:{display:"flex",flexWrap:"wrap"}},null==E?void 0:E.map((e,t)=>l.createElement("div",{style:{padding:"20px"}},l.createElement(ll,{key:t,index:t,document:e,t:o,error:f,setError:h,setDocuments:m,documents:v,setCheckRequiredFields:b,applicationStatus:c,actions:d,bpaTaxDocuments:E,checkEnablingDocs:T}))))};function ll(e){var i,o;let{t:r,document:a,setDocuments:u,documents:s,index:c,bpaTaxDocuments:d,checkEnablingDocs:p}=e;const v=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(),[f,h]=n.useState(v?{...v,active:!0,code:null==v?void 0:v.documentType,i18nKey:null==v?void 0:v.documentType}:1===(null==a||null===(i=a.dropdownData)||void 0===i?void 0:i.length)?null==a?void 0:a.dropdownData[0]:{}),[E,g]=n.useState(null),[y,_]=n.useState(()=>(null==v?void 0:v.fileStoreId)||null),[S,b]=n.useState([]);return n.useEffect(()=>{null!=f&&f.code&&u(e=>{var t;const n=null==e?void 0:e.filter(e=>(null==e?void 0:e.documentType)!==(null==f?void 0:f.code));return 0===(null==y?void 0:y.length)||null===y?n:[...null==n?void 0:n.filter(e=>(null==e?void 0:e.fileStoreId)!==y),{documentType:null==f?void 0:f.code,fileStoreId:y,documentUid:y,fileName:(null==E?void 0:E.name)||"",id:s?null===(t=s.find(e=>e.documentType===(null==f?void 0:f.code)))||void 0===t?void 0:t.id:void 0}]})},[y,f]),n.useEffect(()=>{try{S.length>0&&(sessionStorage.removeItem("BPA_DOCUMENTS"),a.newUploadedDocs=[],S.map(e=>{var t,n,l;null!=f&&f.code&&a.newUploadedDocs.push({documentType:null==f?void 0:f.code,fileStoreId:null==e||null===(t=e.fileStoreId)||void 0===t?void 0:t.fileStoreId,documentUid:null==e||null===(n=e.fileStoreId)||void 0===n?void 0:n.fileStoreId,tenantId:null==e||null===(l=e.fileStoreId)||void 0===l?void 0:l.tenantId})}),d[c]=a,sessionStorage.setItem("BPA_DOCUMENTS",JSON.stringify(d)))}catch(e){Promise.reject(e)}},[S,f]),n.useEffect(()=>{},[E]),l.createElement("div",{style:{marginBottom:"24px",maxWidth:"950px",minWidth:"280px",background:"#FAFAFA",borderRadius:"4px",border:"1px solid #D6D5D4",padding:"8px"}},l.createElement(t.CardSubHeader,{style:{marginBottom:"8px",paddingBottom:"9px",color:"#0B0C0C",fontSize:"16px",lineHeight:"19px"}},""+r(null==a?void 0:a.code)),(null==a||null===(o=a.uploadedDocuments)||void 0===o?void 0:o.length)&&l.createElement(tl,{documents:null==a?void 0:a.uploadedDocuments,svgStyles:{width:"100px",height:"100px",viewBox:"0 0 25 25",minWidth:"100px"}}),p?l.createElement("div",{style:{marginTop:"20px"}},l.createElement(t.LabelFieldPair,{style:{width:"100%"}},l.createElement(t.CardLabel,{style:{marginTop:"-10px",width:"100%"}},null!=a&&a.required?r(null==a?void 0:a.code)+"* ":""+r(null==a?void 0:a.code)),l.createElement(t.Dropdown,{className:"form-field",t:r,isMandatory:!1,option:null==a?void 0:a.dropdownData,selected:f,optionKey:"i18nKey",select:e=>h(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);var i;0!==Object.keys(n).length&&b(l),(i=l[l.length-1])&&g(i.file)})(0,e),t:r,allowedFileTypesRegex:/(.*?)(jpg|jpeg|png|image|pdf)$/i,allowedMaxSizeInMB:5,acceptFiles:"image/*, .pdf, .png, .jpeg, .jpg"})))):null)}function il(e){let{fiReport:n,isCitizen:o=!1}=e;const{t:r}=i.useTranslation();return l.createElement(l.Fragment,null,l.createElement("div",{style:{marginTop:"10px"}},l.createElement(o?t.CardHeader:t.CardSectionHeader,{style:{fontSize:"24px"}},""+r("BPA_FI_REPORT")),n.map((e,i)=>{var o,a,u,s,c,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)?""+r("BPA_FI_REPORT"):`${r("BPA_FI_REPORT")} - ${i+1}`),l.createElement(t.Row,{className:"border-none",label:""+r("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===(a=e.date)||void 0===a?void 0:a.split("-")[1]}/${null===(u=e.date)||void 0===u?void 0:u.split("-")[0]}`:null==e?void 0:e.date:"NA"}),l.createElement(t.Row,{className:"border-none",label:""+r("BPA_FI_TIME_LABEL"),text:null!=e&&e.time?null==e?void 0:e.time:"NA"}),(null==e||null===(s=e.questions)||void 0===s?void 0:s.length)&&(null==e||null===(c=e.questions)||void 0===c?void 0:c.map(e=>l.createElement("div",{style:{background:"white",border:"1px solid #D6D5D4",padding:"8px",borderRadius:"4px",marginTop:"10px"}},l.createElement(t.Row,{className:"border-none",label:""+r(""+e.question),text:null!=e&&e.value?null==e?void 0:e.value:"NA"}),l.createElement(t.Row,{className:"border-none",label:""+r("BPA_ENTER_REMARKS"),text:e.remarks?e.remarks:"NA"})))),l.createElement(tl,{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 ol(e){let{t:i,document:o,setNocDocuments:r,setError:a,nocDocuments:u}=e;const s=null==u?void 0:u.filter(e=>{var t;return null==e||null===(t=e.documentType)||void 0===t?void 0:t.includes(null==o?void 0:o.code)})[0],c=Digit.ULBService.getStateId(),[d,p]=n.useState(),[v,m]=n.useState(null),[f,h]=n.useState(()=>(null==s?void 0:s.fileStoreId)||null);return n.useEffect(()=>{var e,t;null!=o&&null!==(e=o.dropdownData)&&void 0!==e&&null!==(t=e[0])&&void 0!==t&&t.code&&r(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{a(null);const e=function(){if(v){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(v.size>=5242880)a(i("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=v&&v.type&&!e.test(null==v?void 0:v.type))a(i("NOT_SUPPORTED_FILE_TYPE"));else{const e=g(function(){return h(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?h(null==e||null===(l=e.data)||void 0===l||null===(o=l.files[0])||void 0===o?void 0:o.fileStoreId):a(i("CS_FILE_UPLOAD_ERROR"))})},function(){a(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:c,getFormState:e=>(e=>{let t=Object.fromEntries(e),n=Object.values(t);var l;(l=n[n.length-1])&&m(l.file)})(e),t:i,allowedFileTypesRegex:/(.*?)(jpg|jpeg|png|image|pdf)$/i,allowedMaxSizeInMB:5,acceptFiles:"image/*, .pdf, .png, .jpeg, .jpg"}))))}const rl=e=>{var i;let{t:o,noc:r,docs:a,isNoc:u,applicationData:s,NOCdata:c,bpaActionsDetails:d}=e;Digit.ULBService.getStateId();const p=Digit.ULBService.getStateId(),v=(null==s?void 0:s.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:h}=Digit.Hooks.obps.useMDMS(p,"BPA",["DocTypeMapping"],{enabled:!u}),{data:E}=Digit.Hooks.obps.useMDMS(p,"common-masters",["DocumentType"]),[g,y]=n.useState([]),[_,S]=n.useState([]),[b,T]=n.useState(!1),[C,A]=Digit.Hooks.useSessionStorage(null==r?void 0:r.nocType,[]),[D,N]=n.useState(null),P=window.location.href.includes("/employee/");return n.useEffect(()=>{var e;y(null==E||null===(e=E["common-masters"])||void 0===e?void 0:e.DocumentType)},[E]),n.useEffect(()=>{var e,t,n;let l,i=[];var o,a,c,d;l=u?null==f||null===(o=f.NOC)||void 0===o||null===(a=o.DocumentTypeMapping)||void 0===a?void 0:a.filter(e=>(null==e?void 0:e.applicationType)===(null==r?void 0:r.applicationType)&&(null==e?void 0:e.nocType)===(null==r?void 0:r.nocType)):null==h||null===(c=h.BPA)||void 0===c||null===(d=c.DocTypeMapping)||void 0===d?void 0:d.filter(e=>{var t,n;return e.WFState==(null==s?void 0:s.status)&&e.RiskType==(null==s?void 0:s.riskType)&&e.ServiceType==(null==s||null===(t=s.additionalDetails)||void 0===t?void 0:t.serviceType)&&e.applicationType==(null==s||null===(n=s.additionalDetails)||void 0===n?void 0:n.applicationType)}),null!==(e=l)&&void 0!==e&&null!==(t=e[0])&&void 0!==t&&null!==(n=t.docTypes)&&void 0!==n&&n[0]&&(l[0].docTypes[0].nocType=l[0].nocType,l[0].docTypes[0].additionalDetails={submissionDetails:null==r?void 0:r.additionalDetails,applicationStatus:null==r?void 0:r.applicationStatus,appNumberLink:null==r?void 0:r.applicationNo,nocNo:null==r?void 0:r.nocNo},i.push(l[0].docTypes[0]));let p=[];i&&i.length>0&&(i.map(e=>{let t=e.documentType;e.dropdownData=[],null==g||g.forEach(n=>{let l=n.code.slice(0,null==t?void 0:t.length);t===l&&(e.hasDropdown=!0,e.dropdownData.push(n))}),p.push(e)}),S(p))},[f,g]),n.useEffect(()=>{T("NOC_VERIFICATION_INPROGRESS"===v&&(null==m?void 0:m.length)>0)},[s,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==r?void 0:r.nocType}_HEADER`):o(`BPA_${null==r?void 0:r.nocType}_HEADER`),labelStyle:{fontSize:"20px",width:"150%"}}),c&&c.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(tl,{documents:a,svgStyles:{width:"80px",height:"100px",viewBox:"0 0 25 25",minWidth:"80px"}}),b&&(null==_?void 0:_.map((e,t)=>l.createElement(ol,{key:t,document:e,t:o,error:D,setError:N,setNocDocuments:A,nocDocuments:C,checkEnablingDocs:b}))))},al=e=>{let{permissions:i,t:o}=e;const[r,a,u]=Digit.Hooks.useSessionStorage("OBPS_APPROVAL_CHECKS",null==i?void 0:i.map(e=>({label:e,checked:!1}))),[s,c,d]=Digit.Hooks.useSessionStorage("OBPS_NEW_APPROVALS",[]);n.useEffect(()=>()=>{Digit.SessionStorage.del("OBPS_NEW_APPROVALS"),Digit.SessionStorage.del("OBPS_APPROVAL_CHECKS")},[]);const p=window.Digit.Utils.browser.isMobile();return l.createElement("div",null,l.createElement(t.CardSubHeader,{style:{marginBottom:"16px",fontSize:"24px"}},o("BPA_PERMIT_CONDITIONS")),null==r?void 0:r.map((e,n)=>l.createElement(t.CheckBox,{key:n,styles:{margin:"20px 0 40px",maxWidth:p?"100%":"70%"},label:null==e?void 0:e.label,checked:null==e?void 0:e.checked,onChange:e=>((e,t,n)=>{const l=e.target.checked;a(()=>null==r?void 0:r.map((e,t)=>n===t?{...e,checked:l}:e))})(e,0,n),isLabelFirst:!0,index:n})),null==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)=>{c(()=>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:p?"96%":"830px",width:p?"96%":"830px"},style:p?{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:p?"5%":"35%"}}))),style:{},onClick:e=>(e=>{const t=[...s];t.splice(e,1),c([...t])})(n)}))),l.createElement(t.LinkButton,{style:{color:"#a82227",maxWidth:p?"fit-content":"10%",marginRight:"3%"},label:o("BPA_ADD_MORE"),onClick:()=>{c([...s,{label:""}])}}))};function ul(e){let{documents:o,svgStyles:r={},isSendBackFlow:a=!1}=e;const{t:u}=i.useTranslation(),[s,c]=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:[]]}),c(null===(e=t)||void 0===e?void 0:e.map(e=>null==e?void 0:e.fileStoreId))},[o]),n.useEffect(()=>{var e;null!=s&&s.length&&"BillAmend"===(null==o||null===(e=o[0])||void 0===e?void 0:e.BS)?Digit.UploadServices.Filefetch(s,Digit.ULBService.getCurrentTenantId()).then(e=>{p(null==e?void 0:e.data)}):null!=s&&s.length&&Digit.UploadServices.Filefetch(s,Digit.ULBService.getStateId()).then(e=>{p(null==e?void 0:e.data)})},[s]);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)),a?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!=r&&r.minWidth?null==r?void 0:r.minWidth:"160px",marginRight:"20px"},key:n},l.createElement("div",{style:{maxWidth:"940px",padding:"8px",borderRadius:"4px",border:"1px solid #D6D5D4",background:"#FAFAFA"}},l.createElement("p",{style:{marginTop:"8px",fontWeight:"bold",marginBottom:"10px"}},u(null==e?void 0:e.title)),null!=e&&e.docInfo?l.createElement("div",{style:{fontSize:"12px",color:"#505A5F",fontWeight:400,lineHeight:"15px",marginBottom:"10px"}},""+u(null==e?void 0:e.docInfo)):null,l.createElement(t.PDFSvg,null),l.createElement("p",{style:{marginTop:"8px",fontSize:"16px",lineHeight:"19px",color:"#505A5F",fontWeight:"400"}},""+u(null==e?void 0:e.title))))}):!window.location.href.includes("citizen")&&l.createElement("div",null,l.createElement("p",null,u("BPA_NO_DOCUMENTS_UPLOADED_LABEL")))))})))}function sl(e){let{taxHeadEstimatesCalculation:n}=e;const{taxHeadEstimates:o}=n,{t:r}=i.useTranslation();return l.createElement("div",{style:{marginTop:"40px"}},l.createElement(t.StatusTable,null,l.createElement(t.Row,{label:r("ES_PT_TITLE_TAX_HEADS"),text:r("ES_PT_TITLE_AMOUNT"),className:"border-none",textStyle:{fontWeight:"bold"}}),l.createElement(t.BreakLine,{style:{margin:"16px 0",width:"40%"}}),null==o?void 0:o.map((e,n)=>l.createElement(t.Row,{key:r(e.taxHeadCode),label:r(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:r("ES_PT_TITLE_TOTAL_DUE_AMOUNT"),text:"₹ "+(null==n?void 0:n.totalAmount)||"N/A",className:"border-none",textStyle:{fontSize:"24px",fontWeight:"bold"}})))}function cl(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 dl(e){let{owners:n}=e,o={};o=window.location.href.includes("/employee/pt/")?n.slice().reverse():n;const{t:r}=i.useTranslation(),a=(null==n?void 0:n.length)||1;let u={marginTop:"19px"},s={position:"relative",padding:"8px"},c={justifyContent:"space-between",fontSize:"16px",lineHeight:"19px",color:"#0B0C0C"};return Number(a)>1?u={marginTop:"19px",background:"#FAFAFA",border:"1px solid #D6D5D4",borderRadius:"4px",padding:"8px",lineHeight:"19px",maxWidth:"600px",minWidth:"280px"}:Number(a)>1||(u={marginTop:"19px",lineHeight:"19px",maxWidth:"600px",minWidth:"280px"},s={position:"relative",marginTop:"19px"}),window.location.href.includes("obps")&&(u={...u,maxWidth:"950px"},u={...u,maxWidth:"950px"},c={}),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:r(null==e?void 0:e.title),style:u,className:"owner-details-child"},l.createElement(t.CardSubHeader,{style:Number(a)>1?{marginBottom:"8px",paddingBottom:"9px",color:"#0B0C0C",fontSize:"16px",lineHeight:"19px"}:{marginBottom:"8px",color:"#505A5F",fontSize:"24px"}},Number(a)>1?`${r(null==e?void 0:e.title)} ${n+1}`:r(null==e?void 0:e.title)),l.createElement(l.Fragment,{key:n},l.createElement(t.StatusTable,{style: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:r(e.title),label:r(e.title),text:l.createElement("img",{src:r(e.value),alt:"",privacy:null==e?void 0:e.privacy})}):l.createElement("span",null,l.createElement(t.Row,{key:r(e.title),label:""+r(e.title),text:r(e.value)||"N/A",last:n===(null==e||null===(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:c}))}))))})))}const pl=e=>{var o,r,a,u,s,c,d,p,v,m,f,h,E,y,_,S,b,T,C,A,D,N,P;let{scrutinyDetails:x,paymentsList:R=[],additionalDetails:I,applicationData:w}=e;const O=(window.location.href.includes("editApplication")||"FIELDINSPECTION_INPROGRESS"==(null==w?void 0:w.status))&&window.location.href.includes("bpa"),[L,k]=n.useState(),[M,F]=n.useState(),[B,U]=n.useState(),H=Digit.ULBService.getStateId(),[j,W]=n.useState(),[z,$]=n.useState(),[V,q]=n.useState([]),[G,K]=n.useState(),[Y,X]=n.useState(""),[Z,J]=n.useState(null),[Q,ee]=n.useState({}),te={buttonStyle:{display:"flex",justifyContent:"flex-start",color:"#a82227"},headerStyle:{marginTop:"10px",fontSize:"16px",fontWeight:"700",lineHeight:"24px",color:" rgba(11, 12, 12, var(--text-opacity))"}},[ne,le]=n.useState(!1),[ie,oe]=n.useState(!1);n.useEffect(()=>{!function(){try{J(null);const e=function(){if(G&&null!=G&&G.type){const e=function(e,t,n){if(null!==(e=".pdf".split(","))&&void 0!==e&&e.includes("."+(null==G||null===(t=G.type)||void 0===t||null===(n=t.split("/"))||void 0===n?void 0:n.pop()))){const e=function(){if(G.size>=2e6)J(re("PT_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=g(function(){return Promise.resolve(Digit.UploadServices.Filestorage("property-upload",G,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?q([...V,{fileStoreId:null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId,time:new Date}]):J(re("PT_FILE_UPLOAD_ERROR"))})},function(){});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}else J(re("PT_UPLOAD_FORMAT_NOT_SUPPORTED"))}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[G]),n.useEffect(()=>{sessionStorage.setItem("uploadedFileLess",JSON.stringify(V))},[V]),n.useEffect(()=>{var e,t,n,l,i,o,r;if(null!=I&&null!==(e=I.lessAdjustmentFeeFiles)&&void 0!==e&&e.length){const e=null==I?void 0:I.lessAdjustmentFeeFiles.map((e,t)=>{var n,l,i;return t===(null==I||null===(n=I.lessAdjustmentFeeFiles)||void 0===n?void 0:n.length)-1?null==I||null===(l=I.lessAdjustmentFeeFiles[(null==I||null===(i=I.lessAdjustmentFeeFiles)||void 0===i?void 0:i.length)-1])||void 0===l?void 0:l.fileStoreId:null});Digit.UploadServices.Filefetch(e,H).then(e=>ee(null==e?void 0:e.data))}k(null==I||null===(t=I.selfCertificationCharges)||void 0===t?void 0:t.BPA_DEVELOPMENT_CHARGES),sessionStorage.setItem("development",null==I||null===(n=I.selfCertificationCharges)||void 0===n?void 0:n.BPA_DEVELOPMENT_CHARGES),F(null==I||null===(l=I.selfCertificationCharges)||void 0===l?void 0:l.BPA_OTHER_CHARGES),sessionStorage.setItem("otherCharges",null==I||null===(i=I.selfCertificationCharges)||void 0===i?void 0:i.BPA_OTHER_CHARGES),U(null==I||null===(o=I.selfCertificationCharges)||void 0===o?void 0:o.BPA_LESS_ADJUSMENT_PLOT),sessionStorage.setItem("lessAdjusment",null==I||null===(r=I.selfCertificationCharges)||void 0===r?void 0:r.BPA_LESS_ADJUSMENT_PLOT),W(null==I?void 0:I.otherFeesDiscription),sessionStorage.setItem("otherChargesDisc",null==I?void 0:I.otherFeesDiscription),q(null==I?void 0:I.lessAdjustmentFeeFiles)},[I]);const{t:re}=i.useTranslation(),ae=e=>null!=e&&e.value&&null!=e&&e.isTransLate?l.createElement("span",{style:{color:"#00703C"}},re(null==e?void 0:e.value)):null!=e&&e.value&&null!=e&&e.isTransLate?re(null==e?void 0:e.value):null!=e&&e.value?null==e?void 0:e.value:void re("NA");return l.createElement(n.Fragment,null,!(null!=x&&x.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==x||null===(o=x.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:""+re(""+e.title),text:null!=e&&e.value?`${ae(e)} ${re(null==e?void 0:e.isUnit)}`:re("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:""+re(""+e.title),text:ae(e),labelStyle:null!=e&&e.isHeader?{fontSize:"20px"}:{}}):l.createElement(t.CardSubHeader,{style:{fontSize:"20px",paddingBottom:"10px",margin:"0px"}},re(null==e?void 0:e.title)):l.createElement(t.CardSubHeader,{style:{fontSize:"20px",paddingBottom:"10px"}},re(null==e?void 0:e.title))),null==x||null===(r=x.permit)||void 0===r?void 0:r.map((e,n)=>l.createElement(t.CardLabel,{style:{fontWeight:"400"}},null==e?void 0:e.title))),window.location.href.includes("employee")&&"BPA_APPL_FEES_DETAILS"==(null==x||null===(a=x.values[0])||void 0===a?void 0:a.title)&&l.createElement("div",null,!ie&&l.createElement("div",{style:te.buttonStyle},l.createElement("button",{type:"button",onClick:()=>{oe(!0)}},re("SHOW_P1_FEES_DETAILS"))),ie&&l.createElement("div",{style:te.buttonStyle},l.createElement("button",{type:"button",onClick:()=>{oe(!1)}},re("HIDE_P1_FEES_DETAILS"))),ie&&l.createElement("div",null,l.createElement(t.CardSubHeader,null,re("BPA_P1_SUMMARY_FEE_EST")),l.createElement(t.Row,{className:"border-none",label:re("BUILDING_APPLICATION_FEES"),text:"₹ "+Math.round(10.7639*(null==I?void 0:I.builtUpArea)*2.5)}),l.createElement(t.Row,{className:"border-none",label:re("BOUNDARY_WALL_FEES"),text:"₹ "+2.5*(null==I?void 0:I.boundaryWallLength)}),l.createElement(t.Row,{className:"border-none"}))),window.location.href.includes("employee")&&"BPA_APPL_FEES_DETAILS"==(null==x||null===(u=x.values[0])||void 0===u?void 0:u.title)&&l.createElement("div",null,!ne&&l.createElement("div",{style:te.buttonStyle},l.createElement("button",{type:"button",onClick:()=>{le(!0)}},re("SHOW_P2_FEES_DETAILS"))),ne&&l.createElement("div",{style:te.buttonStyle},l.createElement("button",{type:"button",onClick:()=>{le(!1)}},re("HIDE_P2_FEES_DETAILS"))),ne&&l.createElement("div",null,l.createElement(t.CardSubHeader,null,re("BPA_P2_SUMMARY_FEE_EST")),l.createElement(t.Row,{className:"border-none",label:re("BPA_COMMON_MALBA_AMT"),text:"₹ "+(null==I||null===(s=I.selfCertificationCharges)||void 0===s?void 0:s.BPA_MALBA_CHARGES)}),l.createElement(t.Row,{className:"border-none",label:re("BPA_COMMON_LABOUR_AMT"),text:"₹ "+(null==I||null===(c=I.selfCertificationCharges)||void 0===c?void 0:c.BPA_LABOUR_CESS)}),l.createElement(t.Row,{className:"border-none",label:re("BPA_COMMON_WATER_AMT"),text:"₹ "+(null==I||null===(d=I.selfCertificationCharges)||void 0===d?void 0:d.BPA_WATER_CHARGES)}),l.createElement(t.Row,{className:"border-none",label:re("BPA_COMMON_GAUSHALA_AMT"),text:"₹ "+(null==I||null===(p=I.selfCertificationCharges)||void 0===p?void 0:p.BPA_GAUSHALA_CHARGES_CESS)}),l.createElement(t.CardSubHeader,null,re("BPA_P2_SUMMARY_FEE_EST_MANUAL")),l.createElement(t.CardLabel,null,re("BPA_COMMON_DEVELOPMENT_AMT")),l.createElement(t.TextInput,{t:re,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"development",defaultValue:(null==I||null===(v=I.selfCertificationCharges)||void 0===v?void 0:v.BPA_DEVELOPMENT_CHARGES)||0,value:L,disabled:!O,onChange:e=>{!function(e){/^\d{0,9}$/.test(e)&&(k(e),sessionStorage.setItem("development",e))}(e.target.value)},required:!0,pattern:"^[0-9]*$",type:"text"}),l.createElement(t.CardLabel,null,re("BPA_COMMON_OTHER_AMT")),l.createElement(t.TextInput,{t:re,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"otherCharges",defaultValue:(null==I||null===(m=I.selfCertificationCharges)||void 0===m?void 0:m.BPA_OTHER_CHARGES)||0,value:M,disabled:!O,onChange:e=>{!function(e){/^[0-9]*$/.test(e)&&(F(e),sessionStorage.setItem("otherCharges",e))}(e.target.value)},required:!0,pattern:"^[0-9]*$",type:"text"}),parseInt(M)>0?l.createElement("div",null,l.createElement(t.CardLabel,null,re("BPA_COMMON_OTHER_AMT_DISCRIPTION")),l.createElement(t.TextArea,{t:re,type:"text",name:"otherChargesDiscription",defaultValue:null==I||null===(f=I.selfCertificationCharges)||void 0===f?void 0:f.BPA_COMMON_OTHER_AMT_DISCRIPTION,value:j,disabled:!O,onChange:e=>{!function(e){W(e),sessionStorage.setItem("otherChargesDisc",e)}(e.target.value)},required:!0})):null,l.createElement(t.CardLabel,null,re("BPA_COMMON_LESS_AMT")),l.createElement(t.TextInput,{t:re,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"lessAdjusment",defaultValue:(null==I||null===(h=I.selfCertificationCharges)||void 0===h?void 0:h.BPA_LESS_ADJUSMENT_PLOT)||"",value:B,disabled:!O,onChange:e=>{!function(e){var t,n,l,i;/^[0-9]*$/.test(e)&&(parseFloat(e)>(parseFloat(L)?parseFloat(L):0)+parseFloat(M?parseFloat(M):0)+parseFloat(null==I||null===(t=I.selfCertificationCharges)||void 0===t?void 0:t.BPA_MALBA_CHARGES)+parseFloat(null==I||null===(n=I.selfCertificationCharges)||void 0===n?void 0:n.BPA_LABOUR_CESS)+parseFloat(null==I||null===(l=I.selfCertificationCharges)||void 0===l?void 0:l.BPA_WATER_CHARGES)+parseFloat(null==I||null===(i=I.selfCertificationCharges)||void 0===i?void 0:i.BPA_GAUSHALA_CHARGES_CESS)?alert("Less adjustment fees cannot be grater than Total of other P2 fees"):(U(e),sessionStorage.setItem("lessAdjusment",e)))}(e.target.value)},required:!0,pattern:"^[0-9]*$",type:"text"}),parseInt(B)>0&&O?l.createElement("div",null,l.createElement(t.CardLabel,null,re("BPA_COMMON_LESS_AMT_FILE")),l.createElement(t.UploadFile,{id:"noc-doc",style:{marginBottom:"200px"},onUpload:function(e){$(e.target.files[0]),K(e.target.files[0])},disabled:!O,onDelete:()=>{$(null),K("")},message:z?"1 "+re("FILEUPLOADED"):re("ES_NO_FILE_SELECTED_LABEL"),error:Z,uploadMessage:Y})):null,(null==Q||null===(E=Q.fileStoreIds)||void 0===E?void 0:E.length)&&parseInt(null==I||null===(y=I.selfCertificationCharges)||void 0===y?void 0:y.BPA_LESS_ADJUSMENT_PLOT)>0&&l.createElement(t.CardLabel,{style:{marginTop:"15px"}},re("BPA_COMMON_LESS_AMT_PREVIOUS_FILE")),(null==Q||null===(_=Q.fileStoreIds)||void 0===_?void 0:_.length)&&parseInt(null==I||null===(S=I.selfCertificationCharges)||void 0===S?void 0:S.BPA_LESS_ADJUSMENT_PLOT)>0&&l.createElement("a",{target:"_blank",href:null==Q||null===(b=Q.fileStoreIds[(null==Q||null===(T=Q.fileStoreIds)||void 0===T?void 0:T.length)-1])||void 0===b?void 0:b.url},l.createElement(t.PDFSvg,null)),l.createElement(t.Row,{className:"border-none"}),l.createElement(t.Row,{className:"border-none",label:re("BPA_P2_TOTAL_FEE"),text:"₹ "+((parseFloat(L)?parseFloat(L):0)+parseFloat(M?parseFloat(M):0)+parseFloat(null==I||null===(C=I.selfCertificationCharges)||void 0===C?void 0:C.BPA_MALBA_CHARGES)+parseFloat(null==I||null===(A=I.selfCertificationCharges)||void 0===A?void 0:A.BPA_LABOUR_CESS)+parseFloat(null==I||null===(D=I.selfCertificationCharges)||void 0===D?void 0:D.BPA_WATER_CHARGES)+parseFloat(null==I||null===(N=I.selfCertificationCharges)||void 0===N?void 0:N.BPA_GAUSHALA_CHARGES_CESS)-(parseFloat(B)?parseFloat(B):0))}))),l.createElement("div",null,null==x||null===(P=x.scruntinyDetails)||void 0===P?void 0:P.map((e,i)=>l.createElement(n.Fragment,null,l.createElement(t.Row,{className:"border-none",label:""+re(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"}},re(null==e?void 0:e.text))))))))},vl=e=>{var o,r,a,u,s;let{edcrDetails:c,applicationData:d}=e;const{t:p}=i.useTranslation(),v=window.Digit.Utils.browser.isMobile(),m=[{name:"BPA_TABLE_COL_FLOOR",id:"Floor"},{name:"BPA_TABLE_COL_LEVEL",id:"Level"},{name:"BPA_TABLE_COL_OCCUPANCY",id:"Occupancy"},{name:"BPA_TABLE_COL_BUILDUPAREA",id:"BuildupArea"},{name:"BPA_TABLE_COL_FLOORAREA",id:"FloorArea"}],f=e=>{const t=e;return(e,n,l)=>e[t]},h=n.useMemo(()=>m.map(e=>({Header:p(""+e.name),accessor:f(e.id),id:e.id})));function E(e){var t;let n=[];return null==e||null===(t=e.building)||void 0===t||t.floors.map(e=>{var t,l,i,o,r,a,u,s;n.push({Floor:p("BPA_FLOOR_NAME_"+e.number),Level:e.number,Occupancy:p(""+(null===(t=e.occupancies)||void 0===t||null===(l=t[0])||void 0===l?void 0:l.type)),BuildupArea:null===(i=e.occupancies)||void 0===i||null===(o=i[0])||void 0===o?void 0:o.builtUpArea,FloorArea:(null===(r=e.occupancies)||void 0===r||null===(a=r[0])||void 0===a?void 0:a.floorArea)||0,CarpetArea:(null===(u=e.occupancies)||void 0===u||null===(s=u[0])||void 0===s?void 0:s.CarpetArea)||0,key:p("BPA_FLOOR_NAME_"+e.number)})}),n}function g(e){var t;let n=null==d||null===(t=d.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?""+p("BPA_SUBOCCUPANCYTYPE_"+function(e,t,n){if(void 0===e&&(e=""),void 0===t&&(t=""),void 0===n&&(n=""),""==t)return e;for(;e.includes(t);)e=e.replace(t,n);return e}(null==e?void 0:e.toUpperCase(),"-","_")):"NA").join(", "))}return l||"NA"}return l.createElement(n.Fragment,null,l.createElement("div",{style:{background:"#FAFAFA",border:"1px solid #D6D5D4",padding:"8px",borderRadius:"4px",maxWidth:"950px",minWidth:"280px"}},l.createElement(t.StatusTable,null,null==c||null===(o=c.values)||void 0===o?void 0:o.map((e,n)=>null!=e&&e.isHeader?l.createElement(t.CardSubHeader,{style:{fontSize:"20px",paddingBottom:"10px"}},p(null==e?void 0:e.title)):l.createElement(t.Row,{className:"border-none",labelStyle:{width:"100%",fontSize:"20px"},key:""+e.title,label:""+p(""+e.title),text:null!=e&&e.value?null==e?void 0:e.value:""}))),null==c||null===(r=c.subOccupancyTableDetails)||void 0===r||null===(a=r[0])||void 0===a||null===(u=a.value)||void 0===u||null===(s=u.planDetail)||void 0===s?void 0:s.blocks.map((e,n)=>{var i,o,r,a,u;return l.createElement("div",{key:n,style:(null==c||null===(i=c.subOccupancyTableDetails)||void 0===i||null===(o=i[0])||void 0===o||null===(r=o.value)||void 0===r||null===(a=r.planDetail)||void 0===a||null===(u=a.blocks)||void 0===u?void 0:u.length)>0?{marginBottom:"30px",background:"#FAFAFA",border:"1px solid #D6D5D4",padding:"8px",borderRadius:"4px",maxWidth:"950px",minWidth:"280px"}:{marginBottom:"30px"}},l.createElement(t.CardSubHeader,{style:{marginBottom:"8px",paddingBottom:"9px",color:"#0B0C0C",fontSize:"18px",lineHeight:"19px"}},p("BPA_BLOCK_SUBHEADER")," ",n+1),l.createElement(t.StatusTable,null,l.createElement(t.Row,{className:"border-none",textStyle:{wordBreak:"break-word"},label:""+p("BPA_SUB_OCCUPANCY_LABEL"),text:g(n)})),l.createElement("div",{style:window.location.href.includes("citizen")||v?{overflow:"scroll"}:{maxWidth:"950px",maxHeight:"280px"}},l.createElement(t.Table,{className:"customTable table-fixed-first-column table-border-style",t:p,disableSort:!1,autoSort:!0,manualPagination:!1,isPaginationRequired:!1,initSortId:"S N ",data:E(e),columns:h,getCellProps:e=>({style:{}})})))})))},ml=e=>{let{headComment:t,otherComment:n}=e;return l.createElement("div",{className:"checkpoint-comments-wrap"},l.createElement("h4",null,t),l.createElement("p",null,n))},fl=e=>{var o,r,a;let{data:u,OpenImage:s,privacy:c={}}=e;const[d,p]=n.useState(!1),{t:v}=i.useTranslation();return l.createElement("div",null,u.date&&l.createElement("p",null,u.date),l.createElement("p",null,u.name),u.mobileNumber&&l.createElement("span",{style:{display:"inline-flex",width:"fit-content",marginLeft:"10px"}},l.createElement(t.TelePhone,{mobile:u.mobileNumber,privacy:c}),l.createElement("p",null," ")),u.source&&l.createElement("p",null,v("ES_APPLICATION_DETAILS_APPLICATION_CHANNEL_"+u.source.toUpperCase())),u.comment&&l.createElement(ml,{otherComment:null==u?void 0:u.otherComment,headComment:null==u?void 0:u.comment}),null!=u&&u.wfComment?l.createElement("div",null,null==u||null===(o=u.wfComment)||void 0===o?void 0:o.map(e=>l.createElement("div",{className:"TLComments"},l.createElement("h3",null,v("WF_COMMON_COMMENTS")),!d&&l.createElement("div",null,l.createElement("p",{style:{overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitLineClamp:1,WebkitBoxOrient:"vertical"}},e),e.length>36?l.createElement("button",{type:"button",onClick:()=>{p(!0)},style:{color:"#800000"}},v("View More")):null),d&&l.createElement("div",null,l.createElement("p",{style:{overflow:"visible"}},e),l.createElement("button",{type:"button",onClick:()=>{p(!1)},style:{color:"#800000"}},v("View Less")))))):null,(null==u||null===(r=u.thumbnailsToShow)||void 0===r||null===(a=r.thumbs)||void 0===a?void 0:a.length)>0?l.createElement("div",{className:"TLComments"},l.createElement("h3",null,v("CS_COMMON_ATTACHMENTS")),l.createElement(t.DisplayPhotos,{srcs:null==u?void 0:u.thumbnailsToShow.thumbs,onClick:(e,t)=>{s(e,t,null==u?void 0:u.thumbnailsToShow)}})):null)};function hl(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 El(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 gl=e=>{var o,r,a,u,s;let{wsAdditionalDetails:c}=e;const{t:d}=i.useTranslation();let p=(v=location.search)?(/^[?#]/.test(v)?v.slice(1):v).split("&").reduce((e,t)=>{let[n,l]=t.split("=");return e[n]=l?decodeURIComponent(l.replace(/\+/g," ")):"",e},{}):{};var v;const m=null==p?void 0:p.mode;var{connectionDetails:f,plumberDetails:h,roadCuttingDetails:E,roadCuttingAddlDetails:g,activationDetails:y}=(null==c?void 0:c.additionalDetails)||{connectionDetails:[],plumberDetails:[],roadCuttingAddlDetails:[]};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"}},d("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:""+d(""+e.title),text:null!=e&&e.oldValue?null==e?void 0:e.oldValue:null!=e&&e.value?null==e?void 0:e.value:""})))))),(null==c||null===(r=c.additionalDetails)||void 0===r?void 0:r.plumberDetails)&&"MODIFY"!=m&&l.createElement(t.StatusTable,null,l.createElement(t.CardSubHeader,{style:{fontSize:"24px",marginBottom:"16px",marginTop:"32px"}},d("WS_COMMON_PLUMBER_DETAILS")),l.createElement("div",null,l.createElement("div",{className:"plumber-details-new-value-wrapper"},null==h?void 0:h.map((e,n)=>l.createElement(t.Row,{className:"border-none",key:""+e.title,label:""+d(""+e.title),text:null!=e&&e.oldValue?null==e?void 0:e.oldValue:null!=e&&e.value?null==e?void 0:e.value:"",privacy:e.privacy}))))),(null==c||null===(a=c.additionalDetails)||void 0===a?void 0:a.roadCuttingDetails)&&"MODIFY"!=m&&l.createElement(t.StatusTable,null,l.createElement(t.CardSubHeader,{style:{fontSize:"24px",marginBottom:"16px",marginTop:"32px"}},d("WS_COMMON_ROAD_CUTTING_DETAILS")),l.createElement("div",null,l.createElement("div",{className:"road-cutting-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:""+d(""+e.title),text:null!=e&&e.oldValue?null==e?void 0:e.oldValue:null!=e&&e.value?null==e?void 0:e.value:""})))}))),(null==c||null===(u=c.additionalDetails)||void 0===u?void 0:u.roadCuttingAddlDetails)&&l.createElement("div",null,l.createElement("br",null),l.createElement("div",{className:"road-cutting-addl-details-new-value-wrapper"},null==g?void 0:g.map((e,n)=>l.createElement("div",null,l.createElement(t.Row,{className:"border-none",key:""+e.title,label:""+d(""+e.title),text:null!=e&&e.oldValue?null==e?void 0:e.oldValue:null!=e&&e.value?null==e?void 0:e.value:""})))))),(null==c||null===(s=c.additionalDetails)||void 0===s?void 0:s.activationDetails)&&l.createElement(t.StatusTable,null,l.createElement(t.CardSubHeader,{style:{fontSize:"24px",marginBottom:"16px",marginTop:"32px"}},d("WS_ACTIVATION_DETAILS")),l.createElement("div",null,l.createElement("div",{className:"plumber-details-new-value-wrapper"},null==y?void 0:y.map((e,n)=>l.createElement(t.Row,{className:"border-none",key:""+e.title,label:""+d(""+e.title),text:null!=e&&e.oldValue?null==e?void 0:e.oldValue:null!=e&&e.value?null==e?void 0:e.value:""})))))))},yl=[{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"}],_l=[{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"}],Sl=e=>{var o,r,a,s;let{wsAdditionalDetails:c}=e;const{t:d}=i.useTranslation(),[p,v,m]=Digit.Hooks.useSessionStorage("ADHOC_ADD_REBATE_DATA",{}),[f,h,E]=Digit.Hooks.useSessionStorage("ADHOC_BILL_ADD_REBATE_DATA",{}),g=!(null==c||null===(o=c.additionalDetails)||void 0===o||!o.isPaid),[y,S]=n.useState(!1),[b,T]=n.useState(p||{}),[C,A]=n.useState(null),[D,N]=n.useState(c.additionalDetails.data?c.additionalDetails.data:{}),[P,x]=n.useState(c.additionalDetails.values?c.additionalDetails.values:[]),R=Digit.ULBService.getStateId();Digit.Hooks.ws.useMDMS(R,"BillingService",["TaxHeadMaster"]),n.useEffect(()=>{var e,t,n;const i={...null==c||null===(e=c.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,r,a,u,s,d,m;const e=[{title:"WS_APPLICATION_FEE_HEADER",value:l.createElement("span",null,"₹",null==p||null===(o=p.billDetails)||void 0===o||null===(r=o[0])||void 0===r?void 0:r.fee)},{title:"WS_SERVICE_FEE_HEADER",value:l.createElement("span",null,"₹",null==p||null===(a=p.billDetails)||void 0===a||null===(u=a[0])||void 0===u?void 0:u.charge)},{title:"WS_TAX_HEADER",value:l.createElement("span",null,"₹",null==p||null===(s=p.billDetails)||void 0===s||null===(d=s[0])||void 0===d?void 0:d.taxAmount)}];x(e),N(null==p||null===(m=p.billDetails)||void 0===m?void 0:m[0])}else v(i),T(i)},[]);let I={};const w=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)),k=function(e,t,n){void 0===t&&(t=!1);let l={...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!=c&&null!==(r=c.additionalDetails)&&void 0!==r&&r.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(w,{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,i;if(t||n)if(n>(null==c||null===(l=c.additionalDetails)||void 0===l||null===(i=l.data)||void 0===i?void 0:i.totalAmount))A({isError:!1,isWarning:!0,key:"error",message:d("ERR_WS_REBATE_GREATER_THAN_AMOUNT")});else{var o,r,a,u,s,p,m,f,E,g;const e=null==c||null===(o=c.additionalDetails)||void 0===o||null===(r=o.appDetails)||void 0===r?void 0:r.applicationNo,t=null==c||null===(a=c.additionalDetails)||void 0===a||null===(u=a.appDetails)||void 0===u?void 0:u.tenantId,n={...null==c||null===(s=c.additionalDetails)||void 0===s||null===(p=s.appDetails)||void 0===p?void 0:p.additionalDetails,...b};c.additionalDetails.appDetails.additionalDetails=n;const l={CalculationCriteria:"WATER"==(null==c||null===(m=c.additionalDetails)||void 0===m||null===(f=m.appDetails)||void 0===f?void 0:f.service)?[{applicationNo:e,tenantId:t,waterConnection:c.additionalDetails.appDetails}]:[{applicationNo:e,tenantId:t,sewerageConnection:c.additionalDetails.appDetails}],isconnectionCalculation:!1};let i="WATER"==(null==c||null===(E=c.additionalDetails)||void 0===E||null===(g=E.appDetails)||void 0===g?void 0:g.service)?"WS":"SW";Digit.WSService.wsCalculationEstimate(l,i).then((e,t)=>{var n,l,i,o,r,a,u,s,c,d,p,m,f,E,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===(E=f[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===(o=e.Calculation)||void 0===o||null===(r=o[0])||void 0===r?void 0:r.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===(s=e.Calculation)||void 0===s||null===(c=s[0])||void 0===c?void 0:c.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(wn(e.Calculation[0])),N(null==e||null===(m=e.Calculation)||void 0===m?void 0:m[0]),x(y),b.billDetails=null==e?void 0:e.Calculation,v(b),S(!1)}).catch(e=>{var t,n,l,i,o,r;A({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===(r=o.Errors[0])||void 0===r?void 0:r.code)):d("PT_COMMON_ADD_REBATE_PENALITY")})})}else A({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:yl,optionKey:"title",select:e=>k("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=>k("adhocPenaltyComment",!1,e)},I={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=>k("adhocPenalty",!1,e)},I={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:_l,optionKey:"title",select:e=>k("adhocRebateReason",!0,e),selected:(null==b?void 0:b.adhocRebateReason_data)||"",name:"adhocRebateReason_data",isPropertyAssess:!0,t:d})),"PT_OTHERS"===(null==b||null===(s=b.adhocRebateReason_data)||void 0===s?void 0:s.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=>k("adhocRebateComment",!1,e)},I={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=>k("adhocRebate",!1,e)},I={isRequired:!0,pattern:"^[1-9]+[0-9]*$",title:d("ERR_DEFAULT_INPUT_FIELD_MSG")})))))," "),C&&l.createElement(t.Toast,{style:{zIndex:"10000"},warning:null==C?void 0:C.isWarning,error:null==C||!C.isWarning,label:d(null==C?void 0:C.message),onClose:()=>{A(!1)},isDleteBtn:!0})))},bl=e=>{let{style:t}=e;return l.createElement("span",null,l.createElement("svg",{style:{...t},display:"inline",width:"22",height:"16",viewBox:"0 0 22 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l.createElement("path",{d:"M11 0.5C6 0.5 1.73 3.61 0 8C1.73 12.39 6 15.5 11 15.5C16 15.5 20.27 12.39 22 8C20.27 3.61 16 0.5 11 0.5ZM11 13C8.24 13 6 10.76 6 8C6 5.24 8.24 3 11 3C13.76 3 16 5.24 16 8C16 10.76 13.76 13 11 13ZM11 5C9.34 5 8 6.34 8 8C8 9.66 9.34 11 11 11C12.66 11 14 9.66 14 8C14 6.34 12.66 5 11 5Z",fill:"#a82227"})))},Tl=e=>{let{t:n,userType:i=!1,infoBannerLabel:o="",infoClickLable:r="",infoClickInfoLabel:a="",infoClickInfoLabel1:u=""}=e;i=i||Digit.SessionStorage.get("userType");const s=window.Digit.Utils.browser.isMobile();return l.createElement(l.Fragment,null,l.createElement("div",{style:s?{}:{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(r)+" ",l.createElement(bl,{style:{display:"inline",marginBottom:"5px"}})," "+n(a),l.createElement("div",null," "+n(u)))))},Cl=e=>{var o,r,a,u,s,c,d;let{wsAdditionalDetails:p}=e;const{t:v}=i.useTranslation(),[m,f]=n.useState(!1),[h,E]=n.useState({}),g=e=>l.createElement("h1",{className:"heading-m"},e.label),y=()=>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"})),_=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(y,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),E(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(g,{label:v("WS_CALCULATION_BREAKUP")}),headerBarEnd:l.createElement(_,{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==h||null===(r=h.billSlabData)||void 0===r||null===(a=r.FEE)||void 0===a?void 0:a.map(e=>l.createElement(t.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:""+(null==e?void 0:e.taxHeadCode),label:""+v(""+(null==e?void 0:e.taxHeadCode)),text:l.createElement("span",null,"₹",Number(null==e?void 0:e.amount)||0),textStyle:{textAlign:"right"}})),l.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",marginBottom:"10px"}}),l.createElement(t.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:"PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT1",label:""+v("PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT"),text:l.createElement("span",null,"₹",Number(null==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===(s=u.CHARGES)||void 0===s?void 0:s.map(e=>l.createElement(t.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:""+(null==e?void 0:e.taxHeadCode),label:""+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===(c=h.billSlabData)||void 0===c||null===(d=c.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"}})))))},Al={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:{}},Dl=e=>{let{className:t="table",headers:n=[],values:o=[],arrears:r=0}=e;const{t:a}=i.useTranslation();return l.createElement(l.Fragment,null,l.createElement("div",{style:Al.root},l.createElement("table",{className:"table-fixed-column-common-pay",style:Al.table},l.createElement("thead",null,l.createElement("tr",null,l.createElement("th",{style:{...Al.cell,...Al.cellLeft,...Al.cellHeader}},a("CS_BILL_PERIOD")),n.map((e,t)=>l.createElement("th",{style:{...Al.cell,...n.length==t+1?Al.cellRight:{},...Al.cellHeader},key:t},a(e))))),l.createElement("tbody",null,Object.values(o).map((e,t)=>l.createElement("tr",{key:t},l.createElement("td",{style:{...Al.cell,...Al.cellLeft},component:"th",scope:"row"},Object.keys(o)[t]),n.map((t,i)=>l.createElement("td",{style:{...Al.cell,textAlign:"left",...n.length==i+1?Al.cellRight:{},whiteSpace:"pre"},key:i,numeric:!0},i>1&&"₹",e[t]&&e[t].value||"0")))),l.createElement("tr",null,l.createElement("td",{style:{...Al.cell,...Al.cellLeft}}),n.map((e,t)=>t==n.length-1?l.createElement("td",{style:{...Al.cell,...Al.cellRight,textAlign:"left",fontWeight:"700",whiteSpace:"pre"},key:t,numeric:!0},r):t==n.length-2?l.createElement("td",{style:{...Al.cell,textAlign:"left"},key:t,numeric:!0},a("COMMON_ARREARS_TOTAL")):l.createElement("td",{style:Al.cell,key:t,numeric:!0})))))))},Nl={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))"}},Pl=e=>{var t,o,r;let{bill:a={}}=e;const{t:u}=i.useTranslation();let s={},c=(null==a||null===(t=a.billDetails)||void 0===t?void 0:t.sort((e,t)=>t.fromPeriod-e.fromPeriod))||[];c=[...c];const d=(null===(o=c)||void 0===o?void 0:o.reduce((e,t,n)=>e+t.amount,0))||0;let p="₹ "+((null==d||null===(r=d.toFixed)||void 0===r?void 0:r.call(d,0))||Number(0).toFixed(0));c.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);s[((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={};!s||Object.keys(s).map((e,t)=>{Object.keys(s[e]).map(t=>{v[t]=s[e]&&s[e][t]&&s[e][t].order||0})});let m=[];m=Object.keys(v),m.sort((e,t)=>v[e]-v[t]);const[f,h]=n.useState(!1);return 0==d||d<0?l.createElement("span",null):l.createElement(l.Fragment,null,l.createElement("div",{style:Nl.headerStyle},u("CS_ARREARS_DETAILS")),f&&l.createElement(Dl,{headers:[...m],values:s,arrears:p}),!f&&l.createElement("div",{style:Nl.buttonStyle},l.createElement("button",{type:"button",onClick:()=>{h(!0)}},u("CS_SHOW_CARD"))),f&&l.createElement("div",{style:Nl.buttonStyle},l.createElement("button",{type:"button",onClick:()=>{h(!1)}},u("CS_HIDE_CARD"))))};function xl(e){var r,a,u,s,c,d,p,v,m,f,h,E,g,y;let{applicationDetails:S,demandData:b,workflowDetails:T,isDataLoading:C,applicationData:A,totalDemandTax:D,timelineStatusPrefix:N,showTimeLine:P=!0,statusAttribute:x="status",paymentsList:R,oldValue:I,isInfoLabel:w=!1}=e;const{t:O}=i.useTranslation();let L=window.location.href.includes("editApplication")&&window.location.href.includes("bpa");function k(e,t,n){var l;window.open(null==n||null===(l=n.fullImage)||void 0===l?void 0:l[0],"_blank")}console.log("appl",S);const[M,F]=n.useState({}),[B,U]=n.useState({loading:!1,loaded:!1,canLoad:!1});"ACTIVE"!=(null==A?void 0:A.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(r),l({loading:!1,loaded:!0,canLoad:!0})}let r={};const a=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){r=e})}();return a&&a.then?a.then(o):o()})}catch(e){return Promise.reject(e)}}((null==A?void 0:A.tenantId)||tenantId,null==A?void 0:A.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==A||null===(i=A.auditDetails)||void 0===i?void 0:i.createdTime),source:(null==A?void 0:A.channel)||""};return l.createElement(fl,{data:e})}if(window.location.href.includes("/obps/")||window.location.href.includes("/noc/")||window.location.href.includes("/ws/")){var o,r,a,u,s,c,d,p,v,m,f,h,E,g,y,b,T,C;const i={uuid:null==e||null===(o=e.assignes)||void 0===o||null===(r=o[0])||void 0===r?void 0:r.uuid,fieldName:"mobileNumber",model:"User",showValue:!1,loadData:{serviceName:"/egov-workflow-v2/egov-wf/process/_search",requestBody:{},requestParam:{tenantId:null==S?void 0:S.tenantId,businessIds:null==S?void 0:S.applicationNo,history:!0},jsonPath:"ProcessInstances[0].assignes[0].mobileNumber",isArray:!1,d:e=>{let n="";return n="+91 "+_.get(e,`ProcessInstances[${t}].assignes[0].mobileNumber`),n}}},D=n[t-1],N={date:null==e||null===(a=e.auditDetails)||void 0===a?void 0:a.lastModified,name:null==e||null===(u=e.assignes)||void 0===u||null===(s=u[0])||void 0===s?void 0:s.name,mobileNumber:(null==A||null===(c=A.processInstance)||void 0===c||null===(d=c.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!=A&&null!==(f=A.processInstance)&&void 0!==f&&null!==(h=f.assignes)&&void 0!==h&&null!==(E=h[0])&&void 0!==E&&E.mobileNumber?null==A||null===(g=A.processInstance)||void 0===g||null===(y=g.assignes)||void 0===y||null===(b=y[0])||void 0===b?void 0:b.mobileNumber:null==e||null===(T=e.assignes)||void 0===T||null===(C=T[0])||void 0===C?void 0:C.mobileNumber,comment:O(null==e?void 0:e.comment),wfComment:D?D.wfComment:[],thumbnailsToShow:null==e?void 0:e.thumbnailsToShow};return l.createElement(fl,{data:N,OpenImage:k,privacy:i})}{var D,N,P,x,R;const t={date:H(null==A||null===(D=A.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===(x=e.assignes)||void 0===x||null===(R=x[0])||void 0===R?void 0:R.mobileNumber};return l.createElement(fl,{data:t})}},W=(e,t)=>e?t?e:O(e):O("NA"),z=window.location.href.includes("employee/tl")||window.location.href.includes("employee/obps")||window.location.href.includes("employee/noc"),$=window.location.href.includes("employee/noc"),V=window.location.href.includes("employee/obps"),q=(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={table:{border:"2px solid black",width:"100%",fontFamily:"sans-serif"},td:{padding:"10px",border:"1px solid black",textAlign:"center"},th:{padding:"10px",border:"1px solid black",textAlign:"center"}},K=e=>null!=e&&e.skip?e.value:null!=e&&e.isUnit?null!=e&&e.value?`${W(null==e?void 0:e.value,null==e?void 0:e.isNotTranslated)} ${O(null==e?void 0:e.isUnit)}`:O("N/A"):null!=e&&e.value?W(null==e?void 0:e.value,null==e?void 0:e.isNotTranslated):O("N/A"),[Y,X]=n.useState(!1);console.log("demand Data arr",b);const Z=null==b?void 0:b.reduce((e,t)=>e+t.demandInterest,0),J=null==b?void 0:b.reduce((e,t)=>e+t.demandPenality,0),Q=null==b?void 0:b.reduce((e,t)=>e+t.collectionTax,0),ee=null==b?void 0:b.reduce((e,t)=>e+t.collectionInterest,0),te=null==b?void 0:b.reduce((e,t)=>e+t.collectionPenality,0),ne=null==b?void 0:b.reduce((e,t)=>e+t.balanceTax,0);return null==b||b.reduce((e,t)=>e+t.balanceInterest,0),null==b||b.reduce((e,t)=>e+t.balancePenality,0),l.createElement(t.Card,{style:{position:"relative"},className:"employeeCard-override"},w?l.createElement(Tl,{t:O,userType:!1,infoBannerLabel:"CS_FILE_APPLICATION_INFO_LABEL",infoClickLable:"WS_CLICK_ON_LABEL",infoClickInfoLabel:window.location.href.includes("disconnection")||window.location.href.includes("application")?"WS_DISCONNECTION_CLICK_ON_INFO_LABEL":"WS_CLICK_ON_INFO_LABEL",infoClickInfoLabel1:window.location.href.includes("disconnection")||window.location.href.includes("application")?"WS_DISCONNECTION_CLICK_ON_INFO1_LABEL":""}):null,null==S||null===(r=S.applicationDetails)||void 0===r?void 0:r.map((e,i)=>{var r,a,u,s,c,d,p,v,m,f,h,E,g,y,_,b,C,A,D,N,P,x,w,k,F,B,U,H,j,W,G,Y,X,Z,J,Q,ee,te,ne,le;return l.createElement(l.Fragment,{key:i},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!==i||e.asSectionHeader?l.createElement(l.Fragment,null,l.createElement(t.CardSectionHeader,{style:0==i&&z?{marginBottom:"16px",fontSize:"24px"}:{marginBottom:"16px",marginTop:"32px",fontSize:"24px"}},$?""+O(e.title):O(e.title),null!=e&&e.Component?l.createElement(e.Component,null):null)):l.createElement(t.CardSubHeader,{style:{marginBottom:"16px",fontSize:"24px"}},O(e.title)),(null==e?void 0:e.isTable)&&l.createElement("table",{style:{tableLayout:"fixed",width:"100%",borderCollapse:"collapse"}},l.createElement("tr",{style:{textAlign:"left"}},null==e?void 0:e.headers.map(e=>l.createElement("th",{style:{padding:"10px",paddingLeft:"0px"}},O(e)))),null==e?void 0:e.tableRows.map((t,i)=>i===(null==e?void 0:e.tableRows.length)-1?l.createElement(n.Fragment,null,l.createElement("hr",{style:{width:"370%",marginTop:"15px"},className:"underline"}),l.createElement("tr",null,t.map(e=>l.createElement("td",{style:{textAlign:"left"}},O(e))))):l.createElement("tr",null,t.map(e=>l.createElement("td",{style:{paddingTop:"20px",textAlign:"left"}},O(e)))))),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,i)=>{var r,a,u;return!0===n.map&&"N/A"!==n.value?l.createElement(t.Row,{labelStyle:{wordBreak:"break-all"},textStyle:{wordBreak:"break-all"},key:O(n.title),label:O(n.title),text:l.createElement("img",{src:O(n.value),alt:"",privacy:null==n?void 0:n.privacy})}):1==(null==n?void 0:n.isLink)?l.createElement(t.Row,{key:O(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"}},O(null==n?void 0:n.title)))):$||V?""+O(n.title):O(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:q(),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:""+O(""+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:O(n.title),label:O(n.title),text:K(n),last:i===(null==e||null===(r=e.values)||void 0===r?void 0:r.length)-1,caption:n.caption,className:"border-none",privacy:null==n?void 0:n.privacy,rowContainerStyle:q(),labelStyle:{wordBreak:"break-all"},textStyle:{wordBreak:"break-all"}}),"PT_TOTAL_DUES"===n.title?l.createElement(Pl,{bill:null===(a=M.Bill)||void 0===a?void 0:a[0]}):"")})))),(null==e?void 0:e.belowComponent)&&l.createElement(e.belowComponent,null),(null==e||null===(a=e.additionalDetails)||void 0===a?void 0:a.inspectionReport)&&l.createElement(pl,{scrutinyDetails:null==e?void 0:e.additionalDetails,paymentsList:R,additionalDetails:null==S||null===(u=S.applicationData)||void 0===u?void 0:u.additionalDetails,applicationData:null==S?void 0:S.applicationData}),(null==S||null===(s=S.applicationData)||void 0===s||null===(c=s.additionalDetails)||void 0===c||null===(d=c.fieldinspection_pending)||void 0===d?void 0:d.length)>0&&(null==e||null===(p=e.additionalDetails)||void 0===p?void 0:p.fiReport)&&l.createElement(il,{fiReport:null==S||null===(v=S.applicationData)||void 0===v||null===(m=v.additionalDetails)||void 0===m?void 0:m.fieldinspection_pending}),(null==e||null===(f=e.additionalDetails)||void 0===f?void 0:f.floors)&&l.createElement(cl,{floors:null==e||null===(h=e.additionalDetails)||void 0===h?void 0:h.floors}),(null==e||null===(E=e.additionalDetails)||void 0===E?void 0:E.owners)&&l.createElement(dl,{owners:null==e||null===(g=e.additionalDetails)||void 0===g?void 0:g.owners}),(null==e||null===(y=e.additionalDetails)||void 0===y?void 0:y.units)&&l.createElement(El,{units:null==e||null===(_=e.additionalDetails)||void 0===_?void 0:_.units}),(null==e||null===(b=e.additionalDetails)||void 0===b?void 0:b.accessories)&&l.createElement(hl,{units:null==e||null===(C=e.additionalDetails)||void 0===C?void 0:C.accessories}),!L&&(null==e||null===(A=e.additionalDetails)||void 0===A?void 0:A.permissions)&&(null==T||null===(D=T.data)||void 0===D||null===(N=D.nextActions)||void 0===N?void 0:N.length)>0&&l.createElement(al,{applicationData:null==S?void 0:S.applicationData,t:O,permissions:null==e||null===(P=e.additionalDetails)||void 0===P?void 0:P.permissions}),(null==e||null===(x=e.additionalDetails)||void 0===x?void 0:x.obpsDocuments)&&l.createElement("div",{style:{display:"flex"}},l.createElement(nl,{t:O,applicationData:null==S?void 0:S.applicationData,docs:e.additionalDetails.obpsDocuments,bpaActionsDetails:T})),(null==e||null===(w=e.additionalDetails)||void 0===w?void 0:w.noc)&&l.createElement(rl,{t:O,isNoc:!0,NOCdata:e.values,applicationData:null==S?void 0:S.applicationData,docs:e.additionalDetails.noc,noc:null===(k=e.additionalDetails)||void 0===k?void 0:k.data,bpaActionsDetails:T}),(null==e||null===(F=e.additionalDetails)||void 0===F?void 0:F.scruntinyDetails)&&l.createElement(pl,{scrutinyDetails:null==e?void 0:e.additionalDetails}),(null==e||null===(B=e.additionalDetails)||void 0===B?void 0:B.buildingExtractionDetails)&&l.createElement(pl,{scrutinyDetails:null==e?void 0:e.additionalDetails}),(null==e||null===(U=e.additionalDetails)||void 0===U?void 0:U.subOccupancyTableDetails)&&l.createElement(vl,{edcrDetails:null==e?void 0:e.additionalDetails,applicationData:null==S?void 0:S.applicationData}),(null==e||null===(H=e.additionalDetails)||void 0===H?void 0:H.documentsWithUrl)&&l.createElement(tl,{documents:null==e||null===(j=e.additionalDetails)||void 0===j?void 0:j.documentsWithUrl}),(null==e||null===(W=e.additionalDetails)||void 0===W?void 0:W.documents)&&l.createElement(ul,{documents:null==e||null===(G=e.additionalDetails)||void 0===G?void 0:G.documents}),(null==e||null===(Y=e.additionalDetails)||void 0===Y?void 0:Y.taxHeadEstimatesCalculation)&&l.createElement(sl,{taxHeadEstimatesCalculation:null==e||null===(X=e.additionalDetails)||void 0===X?void 0:X.taxHeadEstimatesCalculation}),(null==e?void 0:e.isWaterConnectionDetails)&&l.createElement(gl,{wsAdditionalDetails:e,oldValue:I}),(null==e||null===(Z=e.additionalDetails)||void 0===Z?void 0:Z.redirectUrl)&&l.createElement("div",{style:{fontSize:"16px",lineHeight:"24px",fontWeight:"400",padding:"10px 0px"}},l.createElement(o.Link,{to:null==e||null===(J=e.additionalDetails)||void 0===J||null===(Q=J.redirectUrl)||void 0===Q?void 0:Q.url},l.createElement("span",{className:"link",style:{color:"#a82227"}},null==e||null===(ee=e.additionalDetails)||void 0===ee||null===(te=ee.redirectUrl)||void 0===te?void 0:te.title))),(null==e||null===(ne=e.additionalDetails)||void 0===ne?void 0:ne.estimationDetails)&&l.createElement(Sl,{wsAdditionalDetails:e,workflowDetails:T}),(null==e||null===(le=e.additionalDetails)||void 0===le?void 0:le.estimationDetails)&&l.createElement(Cl,{wsAdditionalDetails:e,workflowDetails:T}))}),P&&(null==T||null===(a=T.data)||void 0===a||null===(u=a.timeline)||void 0===u?void 0:u.length)>0&&l.createElement(l.Fragment,null,l.createElement(t.BreakLine,null),((null==T?void 0:T.isLoading)||C)&&l.createElement(t.Loader,null),!(null!=T&&T.isLoading)&&!C&&l.createElement(n.Fragment,null,l.createElement("div",{id:"timeline"},l.createElement(t.CardSectionHeader,{style:{marginBottom:"16px",marginTop:"32px"}},O("ES_APPLICATION_DETAILS_APPLICATION_TIMELINE")),null!=T&&null!==(s=T.data)&&void 0!==s&&s.timeline&&1===(null==T||null===(c=T.data)||void 0===c||null===(d=c.timeline)||void 0===d?void 0:d.length)?l.createElement(t.CheckPoint,{isCompleted:!0,label:O(`${N}${null==T||null===(p=T.data)||void 0===p||null===(v=p.timeline[0])||void 0===v?void 0:v.state}`),customChild:j(null==T||null===(m=T.data)||void 0===m?void 0:m.timeline[0],null==T||null===(f=T.data)||void 0===f?void 0:f.timeline)}):l.createElement(t.ConnectingCheckPoints,null,(null==T||null===(h=T.data)||void 0===h?void 0:h.timeline)&&(null==T||null===(E=T.data)||void 0===E?void 0:E.timeline.slice(0,Y?null==T?void 0:T.data.timeline.length:2).map((e,n,i)=>{var o;let r="";var a,u,s,c,d,p;return window.location.href.includes("/obps/")&&(r=null!=T&&null!==(a=T.data)&&void 0!==a&&null!==(u=a.timeline[n-1])&&void 0!==u&&null!==(s=u.state)&&void 0!==s&&s.includes("BACK_FROM")||null!=T&&null!==(c=T.data)&&void 0!==c&&null!==(d=c.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:O(`${N}${"REOPEN"===(null==e?void 0:e.performedAction)?null==e?void 0:e.performedAction:null==e?void 0:e[x]}${r}`),customChild:j(e,n,null==T||null===(o=T.data)||void 0===o?void 0:o.timeline)}))}))),(null==T||null===(g=T.data)||void 0===g||null===(y=g.timeline)||void 0===y?void 0:y.length)>2&&l.createElement(t.LinkButton,{label:O(Y?"COLLAPSE":"VIEW_TIMELINE"),onClick:()=>{X(e=>!e)}})))),l.createElement(t.CardSectionHeader,{style:{marginBottom:"16px",marginTop:"16px",fontSize:"24px"}},"DCB Details"),l.createElement("table",{border:"1px",style:G.table},l.createElement("thead",null,l.createElement("tr",null,l.createElement("th",{style:G.th},"Installments"),l.createElement("th",{colSpan:"3",style:G.th},"Demand"),l.createElement("th",{colSpan:"3",style:G.th},"Collection"),l.createElement("th",{colSpan:"3",style:G.th},"Balance"),l.createElement("th",{style:G.th},"Advance")),l.createElement("tr",null,l.createElement("th",{style:G.th}),l.createElement("th",{style:G.th},"Tax"),l.createElement("th",{style:G.th},"Interest"),l.createElement("th",{style:G.th},"Penalty"),l.createElement("th",{style:G.th},"Tax"),l.createElement("th",{style:G.th},"Interest"),l.createElement("th",{style:G.th},"Penalty"),l.createElement("th",{style:G.th},"Tax"),l.createElement("th",{style:G.th},"Interest"),l.createElement("th",{style:G.th},"Penalty"),l.createElement("th",{style:G.th},"Advance"))),l.createElement("tbody",null,null==b?void 0:b.map(e=>l.createElement("tr",null,l.createElement("td",{style:G.td},e.taxPeriodFrom,"-",e.taxPeriodTo),l.createElement("td",{style:G.td},e.demandTax),l.createElement("td",{style:G.td},e.demandInterest),l.createElement("td",{style:G.td},e.demandPenality),l.createElement("td",{style:G.td},e.collectionTax),l.createElement("td",{style:G.td},e.collectionInterest),l.createElement("td",{style:G.td},e.collectionPenality),l.createElement("td",{style:G.td},e.balanceTax),l.createElement("td",{style:G.td},e.balanceInterest),l.createElement("td",{style:G.td},e.balancePenality),l.createElement("td",{style:G.td},e.advance))),l.createElement("tr",null,l.createElement("th",{style:G.th},"Total"),l.createElement("td",{style:G.td},D),l.createElement("td",{style:G.td},Z),l.createElement("td",{style:G.td},J),l.createElement("td",{style:G.td},Q),l.createElement("td",{style:G.td},ee),l.createElement("td",{style:G.td},te),l.createElement("td",{style:G.td}),l.createElement("td",{style:G.td}),l.createElement("td",{style:G.td}),l.createElement("td",{style:G.td})),l.createElement("tr",null,l.createElement("td",{style:G.td}),l.createElement("td",{style:G.td}),l.createElement("td",{style:G.td}),l.createElement("td",{style:G.td}),l.createElement("td",{style:G.td}),l.createElement("td",{style:G.td}),l.createElement("th",{style:G.th},"Total"),l.createElement("td",{style:G.td},ne),l.createElement("td",{style:G.td},"0"),l.createElement("td",{style:G.td},"0"),l.createElement("td",{style:G.td},"0")),l.createElement("tr",null,l.createElement("td",{style:G.td}),l.createElement("td",{style:G.td}),l.createElement("td",{style:G.td}),l.createElement("td",{style:G.td}),l.createElement("td",{style:G.td}),l.createElement("td",{style:G.td}),l.createElement("th",{style:G.th},"Total Balance"),l.createElement("td",{style:G.td},ne)))))}function Rl(e){var n,i,o,r,a,u,s,c,d,p,v,m,f,h,E,g,y,_;let{t:S,showToast:b,closeToast:T,businessService:C}=e;if(null!=C&&C.includes("NewTL")||null!=C&&C.includes("TL")||null!=C&&C.includes("EDITRENEWAL")){var A;let e="";switch(null==b||null===(A=b.action)||void 0===A?void 0:A.action){case"SENDBACK":e="error"===(null==b?void 0:b.key)?null==b||null===(n=b.error)||void 0===n?void 0:n.message:S("TL_SENDBACK_CHECKLIST_MESSAGE_HEAD");break;case"FORWARD":e="error"===(null==b?void 0:b.key)?null==b||null===(i=b.error)||void 0===i?void 0:i.message:S("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:S("TL_APPROVAL_CHECKLIST_MESSAGE_HEAD");break;case"SENDBACKTOCITIZEN":e="error"===(null==b?void 0:b.key)?null==b||null===(r=b.error)||void 0===r?void 0:r.message:S("TL_SENDBACK_TOCITIZEN_CHECKLIST_MESSAGE_HEAD");break;case"REJECT":e="error"===(null==b?void 0:b.key)?null==b||null===(a=b.error)||void 0===a?void 0:a.message:S("TL_APPROVAL_REJ_MESSAGE_HEAD");break;case"RESUBMIT":e="error"===(null==b?void 0:b.key)?null==b||null===(u=b.error)||void 0===u?void 0:u.message:S("TL_APPLICATION_RESUBMIT_SUCCESS_MESSAGE_MAIN");break;case"CANCEL":e="error"===(null==b?void 0:b.key)?null==b||null===(s=b.error)||void 0===s?void 0:s.message:S("TL_TL_CANCELLED_MESSAGE_HEAD");break;default:e="error"===(null==b?void 0:b.key)?null==b||null===(c=b.error)||void 0===c?void 0:c.message:S(`ES_${C}_${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!=C&&C.includes("BPA")||null!=C&&C.includes("BPA_LOW")||null!=C&&C.includes("BPA_OC")){var D;const e=function(e){var t;void 0===e&&(e=[]);let n=e[0];return n=2==(null===(t=e)||void 0===t?void 0:t.length)&&null!=C&&C.includes("BPA_OC")?S(e[1]):S(e[0]),n};let n="";switch(null==b||null===(D=b.action)||void 0===D?void 0:D.action){case"REVOCATE":n="error"===(null==b?void 0:b.key)?null==b||null===(p=b.error)||void 0===p?void 0:p.message:e(["BPA_APPROVAL_REVOCATED_MESSAGE_HEAD","BPA_APPROVAL_OC_REVOCATED_MESSAGE_HEAD"]);break;case"VERIFY_AND_FORWARD":n="error"===(null==b?void 0:b.key)?null==b||null===(v=b.error)||void 0===v?void 0:v.message:e(["BPA_FORWARD_SUCCESS_MESSAGE_MAIN"]);break;case"SEND_BACK_TO_CITIZEN":n="error"===(null==b?void 0:b.key)?null==b||null===(m=b.error)||void 0===m?void 0:m.message:e(["BPA_SENDBACK_SUCCESS_MESSAGE_MAIN"]);break;case"APPROVE":n="error"===(null==b?void 0:b.key)?null==b||null===(f=b.error)||void 0===f?void 0:f.message:e(["BPA_APPROVAL_CHECKLIST_MESSAGE_HEAD"]);break;case"REJECT":n="error"===(null==b?void 0:b.key)?null==b||null===(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===(g=b.error)||void 0===g?void 0:g.message:e(["BPA_SENDBACK_SUCCESS_MESSAGE_MAIN"]);break;default:n="error"===(null==b?void 0:b.key)?null==b||null===(y=b.error)||void 0===y?void 0:y.message:S(`ES_${C}_${null==b||null===(_=b.action)||void 0===_?void 0:_.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_${C}_${null==b||null===(P=b.action)||void 0===P?void 0:P.action}_UPDATE_SUCCESS`;return l.createElement(l.Fragment,null,b&&l.createElement(t.Toast,{error:"error"===b.key,label:S(e),onClose:T}))}}function Il(e){var o,r,a,u,s,c,d,p,v,m,f,h,E,g,y,_;let{workflowDetails:S,displayMenu:b,onActionSelect:T,setDisplayMenu:C,businessService:A,forcedActionPrefix:D,ActionBarStyle:N={},MenuStyle:P={}}=e;const{t:x}=i.useTranslation();let R=Digit.UserService.getUser();const I=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):{};R=null==t?void 0:t.value}const w=null===(o=R)||void 0===o||null===(r=o.info)||void 0===r||null===(a=r.roles)||void 0===a?void 0:a.map(e=>e.code);let O=!1,L=!1,k=(null==S||null===(u=S.data)||void 0===u||null===(s=u.actionState)||void 0===s||null===(c=s.nextActions)||void 0===c?void 0:c.filter(e=>(null==w?void 0:w.some(t=>{var n;return null===(n=e.roles)||void 0===n?void 0:n.includes(t)}))||!e.roles))||(null==S||null===(d=S.data)||void 0===d||null===(p=d.nextActions)||void 0===p?void 0:p.filter(e=>(null==w?void 0:w.some(t=>{var n;return null===(n=e.roles)||void 0===n?void 0:n.includes(t)}))||!e.roles));return Digit.Hooks.useClickOutside(I,()=>{C(!1)},b),(window.location.href.includes("/obps")||window.location.href.includes("/noc"))&&1==(null==k?void 0:k.length)||null!=k&&null!==(v=k[0])&&void 0!==v&&null!==(m=v.redirectionUrl)&&void 0!==m&&m.pathname.includes("/pt/property-details/")&&1==(null==k?void 0:k.length)?(L=!1,O=!0):(null==k?void 0:k.length)>0&&(L=!0,O=!1),l.createElement(l.Fragment,null,!(null!=S&&S.isLoading)&&L&&!O&&l.createElement(t.ActionBar,{style:{...N}},b&&(null!=S&&null!==(f=S.data)&&void 0!==f&&null!==(h=f.actionState)&&void 0!==h&&h.nextActions||null!=S&&null!==(E=S.data)&&void 0!==E&&E.nextActions)?l.createElement(t.Menu,{localeKeyPrefix:D||"WF_EMPLOYEE_"+(null==A?void 0:A.toUpperCase()),options:k,optionKey:"action",t:x,onSelect:T,style:P}):null,l.createElement(t.SubmitBar,{ref:I,label:x("WF_TAKE_ACTION"),onSubmit:()=>C(!b)})),!(null!=S&&S.isLoading)&&!L&&O&&l.createElement(t.ActionBar,{style:{...N}},l.createElement("button",{style:{color:"#FFFFFF",fontSize:"18px"},className:"submit-bar",name:null==k||null===(g=k[0])||void 0===g?void 0:g.action,value:null==k||null===(y=k[0])||void 0===y?void 0:y.action,onClick:e=>{T((null==k?void 0:k[0])||{})}},x(`${D||"WF_EMPLOYEE_"+(null==A?void 0:A.toUpperCase())}_${null==k||null===(_=k[0])||void 0===_?void 0:_.action}`))))}const wl=()=>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(wl,null));function Ll(e){let{action:n,closeWarningPopup:o}=e;const{t:r}=i.useTranslation(),a=window.Digit.Utils.browser.isMobile();return l.createElement(l.Fragment,null,l.createElement(t.Modal,{headerBarMain:l.createElement("h1",{className:"heading-m"},r("PT_DUES_ARE_PENDING")),headerBarEnd:l.createElement(Ol,{onClick:()=>{o()}}),hideSubmit:!0,isDisabled:!1,popupStyles:a?{}:{width:"29%",marginTop:"auto"}},l.createElement(t.Card,null,l.createElement("div",{style:{marginBottom:"30px"}},l.createElement("h1",null,r("PT_YOU_HAVE")," ₹",null==n?void 0:n.AmountDueForPay," ",r("PT_DUE_WARNING_MSG2"))),l.createElement(t.Row,{rowContainerStyle:{display:"flex"},labelStyle:{fontSize:"24px",fontWeight:"700",marginRight:"10%"},textStyle:{fontSize:"24px",fontWeight:"700",marginBottom:"20px"},label:""+r("PT_AMOUNT_DUE"),text:"₹"+r(null==n?void 0:n.AmountDueForPay)}),l.createElement("div",{style:{width:"100%",display:"flex",justifyContent:"flex-end"}},l.createElement(t.ButtonSelector,{theme:"border",label:r("ES_PT_COMMON_CANCEL"),onSubmit:o,style:{marginLeft:"10px"}}),l.createElement(t.ButtonSelector,{label:r("PT_COLLECT"),onSubmit:()=>{var e;return window.location.assign(`${window.location.origin}${null==n||null===(e=n.redirectionUrl)||void 0===e?void 0:e.pathname}`)},style:{marginLeft:"10px"}})))),")")}const kl=e=>{var r,u;console.log("props",e);let s=window.location.href.includes("editApplication")&&window.location.href.includes("bpa");const c=Digit.ULBService.getCurrentTenantId(),d=Digit.ULBService.getStateId(),{data:p}=Digit.Hooks.obps.useMDMS(d,"BPA",["BlockReason"]),{t:v}=i.useTranslation(),m=o.useHistory();let{id:f}=o.useParams();const[h,E]=n.useState(!1),[y,_]=n.useState(null),[S,b]=n.useState(!1),[T,C]=n.useState(!1),[A,D]=n.useState(!1),{data:N}=Digit.Hooks.obps.useMDMS(d,"BPA",["RiskTypeComputation"]),{applicationDetails:P,demandData:x,totalDemandTax:R,totalBalanceTax:I,showToast:w,setShowToast:O,isLoading:L,isDataLoading:k,applicationData:M,mutate:F,nocMutation:B,workflowDetails:U,id:H,businessService:j,closeToast:W,moduleCode:z,timelineStatusPrefix:$,forcedActionPrefix:V,statusAttribute:q,ActionBarStyle:G,MenuStyle:K,paymentsList:Y,showTimeLine:X=!0,oldValue:Z,isInfoLabel:J=!1,clearDataDetails:Q}=e;n.useEffect(()=>{w&&U.revalidate()},[w]);const ee=a.useQueryClient(),te=()=>{_(null),b(!1)};return L||T?l.createElement(t.Loader,null):l.createElement(l.Fragment,null,L?l.createElement(t.Loader,null):l.createElement(l.Fragment,null,l.createElement(xl,{applicationDetails:P,demandData:x,id:H,workflowDetails:U,isDataLoading:k,applicationData:M,totalDemandTax:R,totalBalanceTax:I,businessService:j,timelineStatusPrefix:$,statusAttribute:q,paymentsList:Y,showTimeLine:X,oldValue:Z,isInfoLabel:J}),S?l.createElement(el,{t:v,action:y,tenantId:c,state:d,id:f,applicationDetails:P,applicationData:null==P?void 0:P.applicationData,closeModal:te,submitAction:function(e,t,n){void 0===t&&(t=!1),void 0===n&&(n={});try{let l=!1;const i=function(i,o,r,a,u,s,c,d,p,f,h,E,_,S,b,T,A,D){if(0==(null==e||null===(i=e.Property)||void 0===i||null===(o=i.workflow)||void 0===o||null===(r=o.comment)||void 0===r?void 0:r.length)||("INITIATE"===(null==e||null===(a=e.Licenses)||void 0===a||null===(u=a[0])||void 0===u?void 0:u.action)?0==(null==e||null===(s=e.Licenses)||void 0===s||null===(c=s[0])||void 0===c||null===(d=c.additionalDetail)||void 0===d||null===(p=d.validityYears)||void 0===p?void 0:p.length):0==(null==e||null===(f=e.Licenses)||void 0===f||null===(h=f[0])||void 0===h||null===(E=h.comment)||void 0===E?void 0:E.length))||0==(null==e||null===(_=e.WaterConnection)||void 0===_||null===(S=_.comment)||void 0===S?void 0:S.length)||0==(null==e||null===(b=e.SewerageConnection)||void 0===b||null===(T=b.comment)||void 0===T?void 0:T.length)||0==(null==e||null===(A=e.BPA)||void 0===A||null===(D=A.comment)||void 0===D?void 0:D.length)){var N,P;"INITIATE"===(null==e||null===(N=e.Licenses)||void 0===N||null===(P=N[0])||void 0===P?void 0:P.action)?alert(v("Please fill in the validity before submitting")):alert(v("Please fill in the comments before submitting"))}else{const i=function(i,o,r,a,u){if("BPA"!=(null==e||null===(i=e.BPA)||void 0===i?void 0:i.businessService)||null!=e&&null!==(o=e.BPA)&&void 0!==o&&null!==(r=o.additionalDetails)&&void 0!==r&&r.blockingReason||"BLOCK"!=(null==e||null===(a=e.BPA)||void 0===a||null===(u=a.workflow)||void 0===u?void 0:u.action)){function s(t){if(l)return t;F&&(C(!0),F(e,{onError:(e,t)=>{C(!1),O({key:"error",error:e}),setTimeout(W,5e3)},onSuccess:(e,t)=>{var l,i,o,r,a,u;if(sessionStorage.removeItem("WS_SESSION_APPLICATION_DETAILS"),C(!1),null!==(l=n)&&void 0!==l&&l.bpa&&(e.selectedAction=y,m.replace("/digit-ui/employee/obps/response",{data:e})),null!==(i=n)&&void 0!==i&&i.isStakeholder&&(e.selectedAction=y,m.push("/digit-ui/employee/obps/stakeholder-response",{data:e})),null!==(o=n)&&void 0!==o&&o.isNoc&&m.push("/digit-ui/employee/noc/response",{data:e}),(null==e||null===(r=e.Amendments)||void 0===r?void 0:r.length)>0){var s,c,d,p,f,h,E,g;null!=t&&null!==(s=t.AmendmentUpdate)&&void 0!==s&&null!==(c=s.workflow)&&void 0!==c&&c.action.includes("SEND_BACK")?O({key:"success",label:v("ES_MODIFYSWCONNECTION_SEND_BACK_UPDATE_SUCCESS")}):null!=t&&null!==(d=t.AmendmentUpdate)&&void 0!==d&&null!==(p=d.workflow)&&void 0!==p&&p.action.includes("RE-SUBMIT")?O({key:"success",label:v("ES_MODIFYSWCONNECTION_RE_SUBMIT_UPDATE_SUCCESS")}):null!=t&&null!==(f=t.AmendmentUpdate)&&void 0!==f&&null!==(h=f.workflow)&&void 0!==h&&h.action.includes("APPROVE")?O({key:"success",label:v("ES_MODIFYSWCONNECTION_APPROVE_UPDATE_SUCCESS")}):null!=t&&null!==(E=t.AmendmentUpdate)&&void 0!==E&&null!==(g=E.workflow)&&void 0!==g&&g.action.includes("REJECT")&&O({key:"success",label:v("ES_MODIFYWSCONNECTION_REJECT_UPDATE_SUCCESS")})}else{var _;if((null==e||null===(a=e.Licenses)||void 0===a?void 0:a.length)>0&&null!=e&&null!==(u=e.Licenses[0])&&void 0!==u&&u.applicationNumber)return O({key:"success",action:y}),void m.replace("/digit-ui/employee/tl/application-details/"+(null==e||null===(_=e.Licenses[0])||void 0===_?void 0:_.applicationNumber));O({key:"success",action:y}),Q&&setTimeout(Q,3e3),setTimeout(W,5e3),ee.clear(),ee.refetchQueries("APPLICATION_SEARCH")}}})),te()}C(!0),"function"==typeof(null==e?void 0:e.customFunctionToExecute)&&(null==e||e.customFunctionToExecute({...e}));const i=function(){if(!1!==t&&B){var e;const n=null===(e=t)||void 0===e?void 0:e.map(e=>null==B?void 0:B.mutateAsync(e)),i=g(function(){return C(!0),Promise.resolve(Promise.all(n)).then(function(e){e&&e.map(e=>{var t,n;Digit.SessionStorage.del(null==e||null===(t=e.Noc)||void 0===t||null===(n=t[0])||void 0===n?void 0:n.nocType)})})},function(e){var t,n,i,o,r,a,u,s,c,d,p,m;C(!1);let f=null!=e&&null!==(t=e.response)&&void 0!==t&&null!==(n=t.data)&&void 0!==n&&null!==(i=n.Errors)&&void 0!==i&&null!==(o=i[0])&&void 0!==o&&o.code?v(null==e||null===(r=e.response)||void 0===r||null===(a=r.data)||void 0===a||null===(u=a.Errors)||void 0===u||null===(s=u[0])||void 0===s?void 0:s.code):(null==e||null===(c=e.response)||void 0===c||null===(d=c.data)||void 0===d||null===(p=d.Errors)||void 0===p||null===(m=p[0])||void 0===m?void 0:m.message)||e;te(),O({key:"error",error:{message:f}}),setTimeout(W,5e3),l=!0});if(i&&i.then)return i.then(function(){})}}();return i&&i.then?i.then(s):s(i)}alert(v("Please select Blocking reason"))}();if(i&&i.then)return i.then(function(){})}}();return Promise.resolve(i&&i.then?i.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},actionData:null==U||null===(r=U.data)||void 0===r?void 0:r.timeline,businessService:j,workflowDetails:U,moduleCode:z,blockReason:null==p||null===(u=p.BPA)||void 0===u?void 0:u.BlockReason}):null,A?l.createElement(Ll,{action:y,workflowDetails:U,businessService:j,isWarningPop:A,closeWarningPopup:()=>{D(!1)}}):null,l.createElement(Rl,{t:v,showToast:w,closeToast:W,businessService:j}),s?l.createElement("div",null,l.createElement(t.SubmitBar,{style:{marginRight:20},label:v("BPA_EDIT_UPDATE"),onSubmit:function(e){try{return Promise.resolve(Digit.OBPSService.BPASearch(c,{applicationNo:null==M?void 0:M.applicationNo})).then(function(e){var t,n,l,i,o,r;const a=Digit.Utils.obps.calculateRiskType(null==N||null===(t=N.BPA)||void 0===t?void 0:t.RiskTypeComputation,null==P||null===(n=P.edcrDetails)||void 0===n||null===(l=n.planDetail)||void 0===l||null===(i=l.plot)||void 0===i?void 0:i.area,null==P||null===(o=P.edcrDetails)||void 0===o||null===(r=o.planDetail)||void 0===r?void 0:r.blocks),u={BPA:e.BPA[0]};u.BPA.riskType=a,u.BPA.workflow={action:"EDIT PAY 2",assignes:[],comments:null,varificationDocuments:null},u.BPA.additionalDetails.selfCertificationCharges.BPA_DEVELOPMENT_CHARGES=sessionStorage.getItem("development")||"0",u.BPA.additionalDetails.selfCertificationCharges.BPA_OTHER_CHARGES=sessionStorage.getItem("otherCharges")||"0",u.BPA.additionalDetails.selfCertificationCharges.BPA_LESS_ADJUSMENT_PLOT=sessionStorage.getItem("lessAdjusment")||"0",u.BPA.additionalDetails.otherFeesDiscription=sessionStorage.getItem("otherChargesDisc"),u.BPA.additionalDetails.lessAdjustmentFeeFiles=JSON.parse(sessionStorage.getItem("uploadedFileLess"));const s=function(e,t,n,l,i,o,r,a,s,d,p,m){if(!(parseInt(sessionStorage.getItem("lessAdjusment"))>parseInt(sessionStorage.getItem("development"))+parseInt(sessionStorage.getItem("otherCharges"))+parseInt(null==u||null===(e=u.BPA)||void 0===e||null===(t=e.additionalDetails)||void 0===t||null===(n=t.selfCertificationCharges)||void 0===n?void 0:n.BPA_MALBA_CHARGES)+parseInt(null==u||null===(l=u.BPA)||void 0===l||null===(i=l.additionalDetails)||void 0===i||null===(o=i.selfCertificationCharges)||void 0===o?void 0:o.BPA_LABOUR_CESS)+parseInt(null==u||null===(r=u.BPA)||void 0===r||null===(a=r.additionalDetails)||void 0===a||null===(s=a.selfCertificationCharges)||void 0===s?void 0:s.BPA_WATER_CHARGES)+parseInt(null==u||null===(d=u.BPA)||void 0===d||null===(p=d.additionalDetails)||void 0===p||null===(m=p.selfCertificationCharges)||void 0===m?void 0:m.BPA_GAUSHALA_CHARGES_CESS)))return Promise.resolve(Digit.OBPSService.update(u,c)).then(function(e){window.location.assign(window.location.href.split("/editApplication")[0]+window.location.href.split("editApplication")[1])});alert(v("Enterd Less Adjustment amount is invalid"))}();if(s&&s.then)return s.then(function(){})})}catch(e){return Promise.reject(e)}},id:!0})):l.createElement(Il,{workflowDetails:U,displayMenu:h,onActionSelect:function(e){var t,n,l;if(e)if("EDIT PAY 2"==(null==e?void 0:e.action)&&window.location.href.includes("bpa")&&window.location.assign(window.location.href.split("bpa")[0]+"editApplication/bpa"+window.location.href.split("bpa")[1]),null!=e&&e.isToast)O({key:"error",error:{message:null==e?void 0:e.toastMessage}}),setTimeout(W,5e3);else if(null!=e&&e.isWarningPopUp)D(!0);else if(null!=e&&e.redirectionUrll){var i,o,r,a,u;if("ACTIVATE_CONNECTION"===(null==e||null===(i=e.redirectionUrll)||void 0===i?void 0:i.action))m.push(""+(null==e||null===(r=e.redirectionUrll)||void 0===r?void 0:r.pathname),JSON.stringify({data:null==e||null===(a=e.redirectionUrll)||void 0===a?void 0:a.state,url:`${null===(u=location)||void 0===u?void 0:u.pathname}${location.search}`}));else if("RE-SUBMIT-APPLICATION"===(null==e||null===(o=e.redirectionUrll)||void 0===o?void 0:o.action)){var s,c;m.push(""+(null==e||null===(s=e.redirectionUrll)||void 0===s?void 0:s.pathname),{data:null==e||null===(c=e.redirectionUrll)||void 0===c?void 0:c.state})}else{var d;window.location.assign(`${window.location.origin}/digit-ui/employee/payment/collect/${null==e||null===(d=e.redirectionUrll)||void 0===d?void 0:d.pathname}`)}}else if(null!=e&&e.redirectionUrl||"EDIT PAY 2"==(null==e?void 0:e.action))if("DIRECTRENEWAL"===(null==e||null===(t=e.redirectionUrl)||void 0===t||null===(n=t.state)||void 0===n||null===(l=n.applicationData)||void 0===l?void 0:l.workflowCode))console.log("Got Inside Direct"),b(!0);else{var p,v;m.push({pathname:null===(p=e.redirectionUrl)||void 0===p?void 0:p.pathname,state:{...null===(v=e.redirectionUrl)||void 0===v?void 0:v.state}})}else b(!0);_(e),E(!1)},setDisplayMenu:E,businessService:j,forcedActionPrefix:V,ActionBarStyle:G,MenuStyle:K})))};var Ml=l.memo(()=>{var e,r,a,u,s,c,p,v,m,f,h,E,g;const{t:y}=i.useTranslation(),{data:_}=Digit.Hooks.useStore.getInitData(),S=Digit.ULBService.getCurrentTenantId(),{tenants:b}=_||{},{id:T}=o.useParams(),[C,A]=n.useState(null),[D,N]=n.useState({}),[P,x]=n.useState(!1),[I,w]=n.useState(!1),[O,L]=n.useState("ptr");console.log("gggggg",D),sessionStorage.setItem("applicationNoinAppDetails",T);const{isLoading:k,data:M}=Digit.Hooks.ptr.usePtrApplicationDetail(y,S,T),{mutate:F}=Digit.Hooks.ptr.usePTRApplicationAction(S);let B=Digit.Hooks.useWorkflowDetails({tenantId:(null==M||null===(e=M.applicationData)||void 0===e?void 0:e.tenantId)||S,id:null==M||null===(r=M.applicationData)||void 0===r||null===(a=r.applicationData)||void 0===a?void 0:a.applicationNumber,moduleCode:O,role:"PT_CEMP"});var U,H;console.log("workkkkflooowowow",B),Digit.Hooks.ptr.usePTRSearch({tenantId:S,filters:{applicationNumber:T,audit:!0}}),n.useEffect(()=>{M&&N(d.cloneDeep(M))},[M]),n.useEffect(()=>{var e,t,n;null==B||null===(e=B.data)||void 0===e||!e.applicationBusinessService||"ptr"===(null==B||null===(t=B.data)||void 0===t?void 0:t.applicationBusinessService)&&"ptr"===O||L(null==B||null===(n=B.data)||void 0===n?void 0:n.applicationBusinessService)},[B.data]),!Digit.UserService.hasAccess(["PT_CEMP"])||"ptr"!==(null==B||null===(u=B.data)||void 0===u?void 0:u.applicationBusinessService)||null==B||null===(s=B.data)||void 0===s||null===(c=s.actionState)||void 0===c||null===(p=c.nextActions)||void 0===p||!p.find(e=>"PAY"===e.action)||(B.data.actionState.nextActions=null==B||null===(U=B.data)||void 0===U||null===(H=U.actionState)||void 0===H?void 0:H.nextActions.map(e=>{var t,n;return"PAY"===e.action?{action:"PAY",forcedName:"WF_PAY_APPLICATION",redirectionUrl:{pathname:"/digit-ui/employee/payment/collect/pet-services/"+(null==D||null===(t=D.applicationData)||void 0===t||null===(n=t.applicationData)||void 0===n?void 0:n.applicationNumber)}}:e}));let j=[{order:1,label:y("PTR_APPLICATION"),onClick:()=>function(){try{const e=null==D?void 0:D.applicationData,t=b.find(t=>t.code===e.tenantId);return Promise.resolve(R(e.applicationData,t,y)).then(function(e){Digit.Utils.pdf.generate(e)})}catch(e){return Promise.reject(e)}}()}];const{data:W,isLoading:z}=Digit.Hooks.useRecieptSearch({tenantId:S,businessService:"pet-services",consumerCodes:null==D||null===(v=D.applicationData)||void 0===v||null===(m=v.applicationData)||void 0===m?void 0:m.applicationNumber,isEmployee:!1},{enabled:!(null==D||null===(f=D.applicationData)||void 0===f||null===(h=f.applicationData)||void 0===h||!h.applicationNumber)});return W&&(null==W?void 0:W.Payments.length)>0&&0==z&&j.push({label:y("PTR_FEE_RECIEPT"),onClick:()=>{var e;return function(e){let{tenantId:t,payments:n,...l}=e;try{let e={filestoreIds:[null==n?void 0:n.fileStoreId]};return Promise.resolve(Digit.PaymentService.generatePdf(t,{Payments:[{...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==W||null===(e=W.Payments[0])||void 0===e?void 0:e.tenantId,payments:null==W?void 0:W.Payments[0]})}}),"APPROVED"===(null==W||null===(E=W.Payments[0])||void 0===E?void 0:E.instrumentStatus)&&j.push({label:y("PTR_CERTIFICATE"),onClick:()=>function(){try{var e;return Promise.resolve(Digit.PaymentService.generatePdf(S,{PetRegistrationApplications:[null==M||null===(e=M.applicationData)||void 0===e?void 0:e.applicationData]},"petservicecertificate")).then(function(e){return Promise.resolve(Digit.PaymentService.printReciept(S,{fileStoreIds:e.filestoreIds[0]})).then(function(t){window.open(t[null==e?void 0:e.filestoreIds[0]],"_blank")})})}catch(e){return Promise.reject(e)}}()}),l.createElement("div",null,l.createElement("div",{className:"employee-application-details",style:{marginBottom:"15px"}},l.createElement(t.Header,{styles:{marginLeft:"0px",paddingTop:"10px",fontSize:"32px"}},y("PTR_PET_APPLICATION_DETAILS")),j&&j.length>0&&l.createElement(t.MultiLink,{className:"multilinkWrapper employee-mulitlink-main-div",onHeadClick:()=>x(!P),displayOptions:P,options:j,downloadBtnClassName:"employee-download-btn-className",optionsClassName:"employee-options-btn-className"})),l.createElement(kl,{applicationDetails:null==D?void 0:D.applicationData,isLoading:k,isDataLoading:k,applicationData:null==D||null===(g=D.applicationData)||void 0===g?void 0:g.applicationData,mutate:F,workflowDetails:B,businessService:O,moduleCode:"pet-services",showToast:C,setShowToast:A,closeToast:()=>{A(null)},timelineStatusPrefix:"PTR_COMMON_STATUS_",forcedActionPrefix:"EMPLOYEE_PTR",statusAttribute:"state",MenuStyle:{color:"#FFFFFF",fontSize:"18px"}}))});const Fl=(e,t,n,l,i)=>i(`${l?"E":"C"}S_PTR_RESPONSE_${t||"CREATE"}_${e}${n?"":"_ERROR"}`),Bl=(e,t,n,l)=>Fl("LABEL",e,t,n,l),Ul=e=>{var n,i,o,r,a,u,s,c,d,p,v,m,f;return l.createElement(t.Banner,{message:(p=(null==e||null===(n=e.data)||void 0===n||null===(i=n.PetRegistrationApplications)||void 0===i||null===(o=i[0])||void 0===o?void 0:o.applicationStatus)||e.action,v=e.isSuccess,m=e.isEmployee,f=e.t,Fl("ACTION",p,v,m,f)),applicationNumber:null==e||null===(r=e.data)||void 0===r||null===(a=r.PetRegistrationApplications)||void 0===a||null===(u=a[0])||void 0===u?void 0:u.applicationNumber,info:Bl((null===(s=e.data)||void 0===s||null===(c=s.PetRegistrationApplications)||void 0===c||null===(d=c[0])||void 0===d?void 0:d.applicationStatus)||e.action,e.isSuccess,e.isEmployee,e.t),successful:e.isSuccess})},Hl=e=>{const{t:t}=i.useTranslation();return t(null!=e&&e.isSuccess?"CS_PROPERTY_FEEDBACK_SUCCESS":"CS_PROPERTY_FEEDBACK_FAILED")},jl=e=>l.createElement(t.Banner,{message:Hl(e),applicationNumber:"",style:e.isMobile?{width:"unset"}:{width:"740px"},successful:null==e?void 0:e.isSuccess}),Wl={PTRCheckPage:e=>{var r,a,u,s;let{onSubmit:c,value:d={}}=e;const{t:v}=i.useTranslation(),{address:m,pets:f,isEditPET:h,isUpdatePET:g,ownerss:y}=(o.useHistory(),d),_=h||g?"edit-application":"new-application",[S,b]=n.useState(!1);return l.createElement(l.Fragment,null,window.location.href.includes("/citizen")?l.createElement(E,{currentStep:5}):null,l.createElement(t.Card,null,l.createElement(t.CardHeader,null,v("PTR_CHECK_YOUR_DETAILS")),l.createElement("div",null,l.createElement("br",null),l.createElement(t.CardSubHeader,null,v("ES_TITILE_OWNER_DETAILS")),l.createElement("br",null),l.createElement(t.StatusTable,null,l.createElement(t.Row,{label:v("PTR_APPLICANT_NAME"),text:""+v(p(null==y?void 0:y.applicantName)),actionButton:l.createElement(N,{jumpTo:`/digit-ui/citizen/ptr/petservice/${_}/owners`})}),l.createElement(t.Row,{label:v("PTR_FATHER_HUSBAND_NAME"),text:""+v(p(null==y?void 0:y.fatherName)),actionButton:l.createElement(N,{jumpTo:`/digit-ui/citizen/ptr/petservice/${_}/owners`})}),l.createElement(t.Row,{label:v("PTR_MOBILE_NUMBER"),text:""+v(p(null==y?void 0:y.mobileNumber)),actionButton:l.createElement(N,{jumpTo:`/digit-ui/citizen/ptr/petservice/${_}/owners`})}),l.createElement(t.Row,{label:v("PTR_EMAIL_ID"),text:""+v(p(null==y?void 0:y.emailId)),actionButton:l.createElement(N,{jumpTo:`/digit-ui/citizen/ptr/petservice/${_}/owners`})})),l.createElement("br",null),l.createElement(t.CardSubHeader,null,v("ES_TITILE_PET_DETAILS")),l.createElement("br",null),l.createElement(t.StatusTable,null,l.createElement(t.Row,{label:v("PTR_SEARCH_PET_TYPE"),text:""+v(p(null==f||null===(r=f.petType)||void 0===r?void 0:r.value)),actionButton:l.createElement(N,{jumpTo:`/digit-ui/citizen/ptr/petservice/${_}/pet-details`})}),l.createElement(t.Row,{label:v("PTR_SEARCH_BREED_TYPE"),text:""+v(p(null==f||null===(a=f.breedType)||void 0===a?void 0:a.value)),actionButton:l.createElement(N,{jumpTo:`/digit-ui/citizen/ptr/petservice/${_}/pet-details`})}),l.createElement(t.Row,{label:v("PTR_PET_NAME"),text:""+v(p(null==f?void 0:f.petName)),actionButton:l.createElement(N,{jumpTo:`/digit-ui/citizen/ptr/petservice/${_}/pet-details`})}),l.createElement(t.Row,{label:v("PTR_DOCTOR_NAME"),text:""+v(p(null==f?void 0:f.doctorName)),actionButton:l.createElement(N,{jumpTo:`/digit-ui/citizen/ptr/petservice/${_}/pet-details`})}),l.createElement(t.Row,{label:v("PTR_CLINIC_NAME"),text:""+v(p(null==f?void 0:f.clinicName)),actionButton:l.createElement(N,{jumpTo:`/digit-ui/citizen/ptr/petservice/${_}/pet-details`})}),l.createElement(t.Row,{label:v("PTR_VACCINATED_DATE"),text:""+v(p(null==f?void 0:f.lastVaccineDate)),actionButton:l.createElement(N,{jumpTo:`/digit-ui/citizen/ptr/petservice/${_}/pet-details`})})),l.createElement("br",null),l.createElement(t.CardSubHeader,null,v("PTR_LOCATION_DETAILS")),l.createElement("br",null),l.createElement(t.StatusTable,null,l.createElement(t.Row,{label:v("PTR_HOUSE_NO"),text:""+v(p(null==m?void 0:m.doorNo)),actionButton:l.createElement(N,{jumpTo:`/digit-ui/citizen/ptr/petservice/${_}/street`})}),l.createElement(t.Row,{label:v("PTR_STREET_NAME"),text:""+v(p(null==m?void 0:m.street)),actionButton:l.createElement(N,{jumpTo:`/digit-ui/citizen/ptr/petservice/${_}/street`})}),l.createElement(t.Row,{label:v("PTR_ADDRESS_LINE1"),text:""+v(p(null==m?void 0:m.addressLine1)),actionButton:l.createElement(N,{jumpTo:`/digit-ui/citizen/ptr/petservice/${_}/street`})}),l.createElement(t.Row,{label:v("PTR_ADDRESS_PINCODE"),text:""+v(p(null==m?void 0:m.pincode)),actionButton:l.createElement(N,{jumpTo:`/digit-ui/citizen/ptr/petservice/${_}/pincode`})}),l.createElement(t.Row,{label:v("MYCITY_CODE_LABEL"),text:""+v(p(null==m||null===(u=m.city)||void 0===u?void 0:u.name)),actionButton:l.createElement(N,{jumpTo:`/digit-ui/citizen/ptr/petservice/${_}/address`})}),l.createElement(t.Row,{label:v("PTR_LOCALITY"),text:""+v(p(null==m||null===(s=m.locality)||void 0===s?void 0:s.name)),actionButton:l.createElement(N,{jumpTo:`/digit-ui/citizen/ptr/petservice/${_}/address`})})),l.createElement("br",null),l.createElement(t.CheckBox,{label:v("PTR_FINAL_DECLARATION_MESSAGE"),onChange:()=>{b(!S)},styles:{height:"auto"}})),l.createElement(t.SubmitBar,{label:v("PTR_COMMON_BUTTON_SUBMIT"),onSubmit:c,disabled:!S})))},PTRAcknowledgement:e=>{var r,a;let{data:u,onSuccess:s}=e;const{t:c}=i.useTranslation(),d=(Digit.ULBService.getCurrentTenantId(),Digit.Hooks.ptr.usePTRCreateAPI(null===(r=u.address)||void 0===r||null===(a=r.city)||void 0===a?void 0:a.code)),{data:p}=Digit.Hooks.useStore.getInitData(),{tenants:v}=(o.useRouteMatch(),p||{});return n.useEffect(()=>{try{var e,t;u.tenantId=null===(e=u.address)||void 0===e||null===(t=e.city)||void 0===t?void 0:t.code;let n=(e=>{var t;return{PetRegistrationApplications:[{tenantId:(e=(e=>{var t,n,l;let{pets:i}=e,o={...i,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.name,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:i}=e,o={...i,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.doorNo,street:null==i?void 0:i.street,locality:{code:(null==i||null===(n=i.locality)||void 0===n?void 0:n.code)||"NA",area:null==i||null===(l=i.locality)||void 0===l?void 0:l.name}};return e.address=o,e})(e=(e=>{let{ownerss:t}=e,n={...t};return e.ownerss=n,e})(e=(e=>{let{documents:t}=e,n={...t};return e.documents=n,e})(e))))).tenantId,...null===(t=e)||void 0===t?void 0:t.ownerss,address:e.address,petDetails:e.pets,...e.documents,workflow:{businessService:"ptr",action:"APPLY",moduleName:"pet-services"}}]}})(u);d.mutate(n,{onSuccess:s})}catch(e){}},[]),d.isLoading||d.isIdle?l.createElement(t.Loader,null):l.createElement(t.Card,null,l.createElement(O,{t:c,data:d.data,isSuccess:d.isSuccess,isLoading:d.isIdle||d.isLoading}),l.createElement(t.StatusTable,null,d.isSuccess&&l.createElement(t.Row,{rowContainerStyle:w,last:!0,textStyle:{whiteSpace:"pre",width:"60%"}})),d.isSuccess&&l.createElement(t.SubmitBar,{label:c("PTR_PET_DOWNLOAD_ACK_FORM"),onSubmit:function(){try{const{PetRegistrationApplications:e=[]}=d.data;let t=e&&e[0]||{};const n=v.find(e=>e.code===t.tenantId);return Promise.resolve(R({...t},n,c)).then(function(e){Digit.Utils.pdf.generate(e)})}catch(e){return Promise.reject(e)}}}),l.createElement(o.Link,{to:"/digit-ui/citizen"},l.createElement(t.LinkButton,{label:c("CORE_COMMON_GO_TO_HOME")})))},PTRWFCaption:T,PTRWFReason: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))},PTRNewApplication:()=>{const e=Digit.ULBService.getCurrentTenantId(),{t:r}=(Digit.Hooks.ptr.useTenants(),i.useTranslation()),[a,u]=n.useState(!1),s=o.useHistory(),[c,d,p]=Digit.Hooks.useSessionStorage("store-data",null),[v,m,f]=Digit.Hooks.useSessionStorage("EMPLOYEE_MUTATION_HAPPENED",!1),[h,E,g]=Digit.Hooks.useSessionStorage("EMPLOYEE_MUTATION_SUCCESS_DATA",{});n.useEffect(()=>{m(!1),g()},[]);const y=Ye;return l.createElement(t.FormComposer,{heading:r("ES_TITLE_NEW_PET_REGISTARTION"),isDisabled:!a,label:r("ES_COMMON_APPLICATION_SUBMIT"),config:y.map(e=>({...e,body:e.body.filter(e=>!e.hideInEmployee)})),fieldStyle:{marginRight:0},onSubmit:t=>{var n,l,i,o,r,a,u,c,d,p,v,m,f;const h=[{tenantId:e,...null==t?void 0:t.owners[0],petDetails:{...null==t?void 0:t.pets[0],petType:null==t||null===(n=t.pets[0])||void 0===n||null===(l=n.petType)||void 0===l?void 0:l.value,breedType:null==t||null===(i=t.pets[0])||void 0===i||null===(o=i.breedType)||void 0===o?void 0:o.value,petGender:null==t||null===(r=t.pets[0])||void 0===r||null===(a=r.petGender)||void 0===a?void 0:a.name},address:{...null==t?void 0:t.address,city:null==t||null===(u=t.address)||void 0===u||null===(c=u.city)||void 0===c?void 0:c.name,locality:{code:null==t||null===(d=t.address)||void 0===d||null===(p=d.locality)||void 0===p?void 0:p.code,area:null==t||null===(v=t.address)||void 0===v||null===(m=v.locality)||void 0===m?void 0:m.area}},documents:null==t||null===(f=t.documents)||void 0===f?void 0:f.documents,workflow:{businessService:"ptr",action:"APPLY",moduleName:"pet-services"}}];s.replace("/digit-ui/employee/ptr/petservice/response",{PetRegistrationApplications:h})},defaultValues:{},onFormValueChange:(e,t,n)=>{u(!Object.keys(n.errors).length)}})},ApplicationDetails:Ml,PTRResponse:e=>{const{t:r}=i.useTranslation(),u=a.useQueryClient(),[s,c]=(o.useHistory(),n.useState(null)),[d,p]=n.useState(null),[v,m]=n.useState(!1),[f,h,E]=Digit.Hooks.useSessionStorage("EMPLOYEE_MUTATION_HAPPENED",!1),[g,y,_]=Digit.Hooks.useSessionStorage("EMPLOYEE_MUTATION_SUCCESS_DATA",!1),S=Digit.ULBService.getCurrentTenantId(),{state:b}=e.location,T=Digit.Hooks.ptr.usePTRCreateAPI(S,"UPDATE"!==b.key),C=Digit.Hooks.ptr.usePTRCreateAPI(S,!1),{data:A}=Digit.Hooks.useStore.getInitData(),{tenants:D}=A||{},{data:N}=Digit.Hooks.ptr.usePTRSearch({tenantId:S,filters:{applicationNumber:b.PetRegistrationApplications.applicationNumber,audit:!0}},{enabled:v,select:e=>{var t;return null===(t=e.PetRegistrationApplications)||void 0===t?void 0:t.filter(e=>"ACTIVE"===e.status)}});return n.useEffect(()=>{C.data&&C.isSuccess&&y(C.data)},[T.data]),n.useEffect(()=>{C.data&&C.isSuccess&&y(C.data)},[C.data]),n.useEffect(()=>{f||T.mutate({PetRegistrationApplications:null==b?void 0:b.PetRegistrationApplications},{onError:(e,t)=>{var n,l,i;p({key:"error"}),c((null==e||null===(n=e.response)||void 0===n||null===(l=n.data)||void 0===l||null===(i=l.Errors[0])||void 0===i?void 0:i.message)||null)},onSuccess:function(e){try{var t;return h(!0),u.clear(),"CREATE"===(null==e||null===(t=e.PetRegistrationApplications[0])||void 0===t?void 0:t.creationReason)&&m(!0),Promise.resolve()}catch(e){return Promise.reject(e)}}})},[]),T.isLoading||T.isIdle&&!f?l.createElement(t.Loader,null):l.createElement("div",null,l.createElement(t.Card,null,l.createElement(Ul,{t:r,data:(null==T?void 0:T.data)||g,action:null==b?void 0:b.action,isSuccess:!!Object.keys(g||{}).length||(null==T?void 0:T.isSuccess),isLoading:T.isIdle&&!f||(null==T?void 0:T.isLoading),isEmployee:e.parentRoute.includes("employee")}),l.createElement(t.CardText,null,((e,t,n,l)=>Fl("DISPLAY",e,t,n,l))(b.action,(T.isSuccess||!!g)&&!T.isError,e.parentRoute.includes("employee"),r)),(T.isSuccess||!!g)&&!T.isError&&l.createElement(t.SubmitBar,{style:{overflow:"hidden"},label:r("PTR_DOWNLOAD_ACK_FORM"),onSubmit:function(){try{const{PetRegistrationApplications:e=[]}=T.data||g,t=e&&e[0]||{},n=D.find(e=>e.code===t.tenantId);return Promise.resolve(R({...t,auditData:N},n,r)).then(function(e){Digit.Utils.pdf.generate(e)})}catch(e){return Promise.reject(e)}}})),d&&l.createElement(t.Toast,{error:"error"===d.key,label:s,onClose:()=>{p(null),c(null)}}),l.createElement(t.ActionBar,null,l.createElement(o.Link,{to:e.parentRoute.includes("employee")?"/digit-ui/employee":"/digit-ui/citizen"},l.createElement(t.SubmitBar,{label:r("CORE_COMMON_GO_TO_HOME")}))))},PTRMyApplications:()=>{const{t:e}=i.useTranslation(),n=Digit.ULBService.getCitizenCurrentTenant(!0)||Digit.ULBService.getCurrentTenantId(),r=Digit.UserService.getUser().info;let a,u,s=window.location.href.split("/").pop();isNaN(parseInt(s))?a=4:(u=s,a=parseInt(s)+50);let c=isNaN(parseInt(s))?{limit:"4",sortOrder:"ASC",sortBy:"createdTime",offset:"0",mobileNumber:null==r?void 0:r.mobileNumber,tenantId:n}:{limit:"50",sortOrder:"ASC",sortBy:"createdTime",offset:u,tenantId:n};const{isLoading:d,data:p}=Digit.Hooks.ptr.usePTRSearch({filters:c},{filters:c}),{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:h,data:E}=Digit.Hooks.useFeedBackSearch({filters:{serviceSearchArgs:f}},{filters:{serviceSearchArgs:f},enabled:(null==m?void 0:m.length)>0,cacheTime:0});function g(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==r?void 0:r.permanentCity,buttonLabel:g(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:"/digit-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(o.Link,{to:"/digit-ui/citizen/ptr/petservice/new-application/info"},e("PTR_COMMON_CLICK_HERE_TO_REGISTER_NEW_PET")))))},PTRApplicationDetails:()=>{var e,r,a,u,s,c,d,p,v,m,f,h;const{t:E}=i.useTranslation(),{acknowledgementIds:g,tenantId:y}=(o.useHistory(),o.useParams()),[_,S]=n.useState([]),[b,T]=n.useState(!1),[A,D]=n.useState(!1),[N,P]=n.useState(null),{data:x}=Digit.Hooks.useStore.getInitData(),{tenants:I}=x||{},{isLoading:w,data:O}=Digit.Hooks.ptr.usePTRSearch({tenantId:y,filters:{applicationNumber:g}}),[L,k]=n.useState(null),M=Re(O,"PetRegistrationApplications",[]),F=Re(O,"PetRegistrationApplications[0].applicationNumber",[]);let B=M&&M.length>0&&M[0]||{};const U=B;sessionStorage.setItem("ptr-pet",JSON.stringify(U));const[H,j]=n.useState(!1);n.useEffect(()=>{!function(){try{j(!0),Promise.resolve(Digit.PaymentService.fetchBill(y,{businessService:"pet-services",consumerCode:g})).then(function(e){k(e),j(!1)})}catch(e){return Promise.reject(e)}}()},[y,g]);const{isLoading:W}=Digit.Hooks.ptr.usePTRSearch({tenantId:y,filters:{applicationNumber:F,audit:!0}},{enabled:!0}),{data:z,isLoading:$}=Digit.Hooks.useRecieptSearch({tenantId:y,businessService:"pet-services",consumerCodes:g,isEmployee:!1},{enabled:!!g});if(B.workflow||(B.workflow={id:null,tenantId:y,businessService:"pet-services",businessId:null==U?void 0:U.applicationNumber,action:"",moduleName:"pet-services",state:null,comment:null,documents:null,assignes:null}),w||W)return l.createElement(t.Loader,null);let V=E("CS_NA");if(null!=B&&null!==(e=B.additionalDetails)&&void 0!==e&&e.documentDate){var q;const e=new Date(null==B||null===(q=B.additionalDetails)||void 0===q?void 0:q.documentDate),t=Digit.Utils.date.monthNames[e.getMonth()];V=`${e.getDate()} ${t} ${e.getFullYear()}`}let G=[];return G.push({label:E("PTR_PET_DOWNLOAD_ACK_FORM"),onClick:()=>function(){try{const e=U||{},t=I.find(t=>t.code===e.tenantId);return Promise.resolve(R({...e},t,E)).then(function(e){Digit.Utils.pdf.generate(e)})}catch(e){return Promise.reject(e)}}()}),z&&(null==z?void 0:z.Payments.length)>0&&0==$&&G.push({label:E("PTR_FEE_RECIEPT"),onClick:()=>{var e;return function(e){let{tenantId:t,payments:n,...l}=e;try{let e={filestoreIds:[null==n?void 0:n.fileStoreId]};return Promise.resolve(Digit.PaymentService.generatePdf(t,{Payments:[{...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==z||null===(e=z.Payments[0])||void 0===e?void 0:e.tenantId,payments:null==z?void 0:z.Payments[0]})}}),"DEPOSITED"===(null==z||null===(r=z.Payments[0])||void 0===r?void 0:r.paymentStatus)&&G.push({label:E("PTR_CERTIFICATE"),onClick:()=>function(){try{var e;return Promise.resolve(Digit.PaymentService.generatePdf(y,{PetRegistrationApplications:[null==O||null===(e=O.PetRegistrationApplications)||void 0===e?void 0:e[0]]},"petservicecertificate")).then(function(e){return Promise.resolve(Digit.PaymentService.printReciept(y,{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"}},E("PTR_PET_APPLICATION_DETAILS")),G&&G.length>0&&l.createElement(t.MultiLink,{className:"multilinkWrapper",onHeadClick:()=>T(!b),displayOptions:b,options:G})),l.createElement(t.Card,null,l.createElement(t.StatusTable,null,l.createElement(t.Row,{className:"border-none",label:E("PTR_APPLICATION_NO_LABEL"),text:null==B?void 0:B.applicationNumber})),l.createElement(t.CardSubHeader,{style:{fontSize:"24px"}},E("PTR_ADDRESS_HEADER")),l.createElement(t.StatusTable,null,l.createElement(t.Row,{className:"border-none",label:E("PTR_PINCODE"),text:(null==B||null===(a=B.address)||void 0===a?void 0:a.pincode)||E("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:E("PTR_CITY"),text:(null==B||null===(u=B.address)||void 0===u?void 0:u.city)||E("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:E("PTR_STREET_NAME"),text:(null==B||null===(s=B.address)||void 0===s?void 0:s.street)||E("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:E("PTR_HOUSE_NO"),text:(null==B||null===(c=B.address)||void 0===c?void 0:c.doorNo)||E("CS_NA")})),l.createElement(t.CardSubHeader,{style:{fontSize:"24px"}},E("PTR_APPLICANT_DETAILS_HEADER")),l.createElement(t.StatusTable,null,l.createElement(t.Row,{className:"border-none",label:E("PTR_APPLICANT_NAME"),text:(null==B?void 0:B.applicantName)||E("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:E("PTR_FATHER/HUSBAND_NAME"),text:(null==B?void 0:B.fatherName)||E("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:E("PTR_APPLICANT_MOBILE_NO"),text:(null==B?void 0:B.mobileNumber)||E("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:E("PTR_APPLICANT_EMAILID"),text:(null==B?void 0:B.emailId)||E("CS_NA")})),l.createElement(t.CardSubHeader,{style:{fontSize:"24px"}},E("PTR_PET_DETAILS_HEADER")),l.createElement(t.StatusTable,null,l.createElement(t.Row,{className:"border-none",label:E("PTR_PET_TYPE"),text:(null==B||null===(d=B.petDetails)||void 0===d?void 0:d.petType)||E("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:E("PTR_BREED_TYPE"),text:(null==B||null===(p=B.petDetails)||void 0===p?void 0:p.breedType)||E("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:E("PTR_DOCTOR_NAME"),text:(null==B||null===(v=B.petDetails)||void 0===v?void 0:v.doctorName)||E("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:E("PTR_CLINIC_NAME"),text:(null==B||null===(m=B.petDetails)||void 0===m?void 0:m.clinicName)||E("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:E("PTR_VACCINATED_DATE"),text:(null==B||null===(f=B.petDetails)||void 0===f?void 0:f.lastVaccineDate)||E("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:E("PTR_VACCINATION_NUMBER"),text:(null==B||null===(h=B.petDetails)||void 0===h?void 0:h.vaccinationNumber)||E("CS_NA")})),l.createElement(C,{application:U,id:null==U?void 0:U.applicationNumber,userType:"citizen"}),N&&l.createElement(t.Toast,{error:N.key,label:E(N.label),style:{bottom:"0px"},onClose:()=>{P(null)}})),A&&l.createElement(PTCitizenFeedbackPopUp,{setpopup:D,setShowToast:P,data:O})))},SelectOtp:e=>{let{config:i,otp:o,onOtpChange:r,onResend:a,onSelect:u,t:s,error:c,userType:d="citizen",canSubmit:p}=e;const[v,m]=n.useState(30),f={type:"register"},[h,E]=n.useState(!1);!function(e,t){const l=n.useRef();n.useEffect(()=>{l.current=e},[e]),n.useEffect(()=>{if(null!==t){const e=setInterval(function(){l.current()},t);return()=>clearInterval(e)}},[t])}(()=>{m(v-1)},v>0?1e3:null),n.useEffect(function(){try{if(window.location.href.includes("code")){let e=window.location.href.split("=")[1].split("&")[0],t={code_verifier:sessionStorage.getItem("code_verfier_register"),code:e,module:"REGISTER"};console.log("token",e,t,sessionStorage.getItem("code_verfier_register")),fetch("https://api.digitallocker.gov.in/public/oauth2/1/token",{method:"POST",mode:"cors",headers:{"Content-Type":"application/x-www-form-urlencoded","Access-Control-Allow-Origin":"*","Access-Control-Allow-Methods":"PUT, DELETE,POST"},body:new URLSearchParams({code:e,grant_type:"authorization_code",client_id:"YN77ADDADE",client_secret:"71abd480b5811ab72277",redirect_uri:"http://localhost:3001/digit-ui/citizen/login/otp",code_verifier:sessionStorage.getItem("code_verfier_register")})}).then(e=>{e.json().then(e=>y(e))})}return Promise.resolve()}catch(e){return Promise.reject(e)}},[]);const y=function(e){try{console.log("registerUser",e);const t={dob:"1998-02-03",mobileNumber:e.mobile,name:e.name,tenantId:"pg",userType:Digit.UserService.getType()};return Promise.resolve(S({otp:{...t,...f}})).then(function(e){null!=e&&e[1]&&(console.log("gggg",null==e?void 0:e[1],typeof(null==e?void 0:e[1])),E(!0),setTimeout(()=>{window.location.href=window.location.href.split("/otp")[0]},3e3))})}catch(e){return Promise.reject(e)}},_=()=>{a(),m(2)},S=function(e){return Promise.resolve(g(function(){return console.log("sendOtpsendOtp",e),Promise.resolve(Digit.UserService.sendOtp(e,"pg")).then(function(e){return[e,null]})},function(e){return[null,e]}))};return"employee"===d?l.createElement(n.Fragment,null,l.createElement(t.OTPInput,{length:6,onChange:r,value:o}),v>0?l.createElement(t.CardText,null,`${s("CS_RESEND_ANOTHER_OTP")} ${v} ${s("CS_RESEND_SECONDS")}`):l.createElement("p",{className:"card-text-button",onClick:_},s("CS_RESEND_OTP")),!c&&l.createElement(t.CardLabelError,null,s("CS_INVALID_OTP"))):l.createElement(t.FormStep,{onSelect:u,config:i,t:s,isDisabled:!(6===(null==o?void 0:o.length)&&p)},l.createElement(t.OTPInput,{length:6,onChange:r,value:o}),v>0?l.createElement(t.CardText,null,`${s("CS_RESEND_ANOTHER_OTP")} ${v} ${s("CS_RESEND_SECONDS")}`):l.createElement("p",{className:"card-text-button",onClick:_},s("CS_RESEND_OTP")),!c&&l.createElement(t.CardLabelError,null,s("CS_INVALID_OTP")),!h&&l.createElement(t.CardLabelError,null,s("CS_ALREADY_REGISTERED")))},AcknowledgementCF:e=>{var n,r,a,u,s,c,d,p,v;const{t:m}=i.useTranslation(),f=(Digit.ULBService.getCurrentTenantId(),o.useLocation()),h=(Digit.Hooks.useStore.getInitData(),window.Digit.Utils.browser.isMobile());return l.createElement("form",null,l.createElement(t.Card,{style:h?{padding:"unset"}:{}},l.createElement(jl,{t:m,data:f.state,isSuccess:!(null===(n=f.state)||void 0===n||null===(r=n.result)||void 0===r||null===(a=r.Service)||void 0===a||!a[0]),isMobile:h,isLoading:!1}),(null===(u=f.state)||void 0===u||null===(s=u.result)||void 0===s||null===(c=s.Service)||void 0===c?void 0:c[0])&&l.createElement(t.CardText,{style:{padding:"0px 10px 0px 10px"}},m("CS_CF_FEEDBACK_RESPONSE")),!(null!==(d=f.state)&&void 0!==d&&null!==(p=d.result)&&void 0!==p&&null!==(v=p.Service)&&void 0!==v&&v[0])&&l.createElement(t.CardText,null,m("CS_FILE_PROPERTY_FAILED_RESPONSE")),l.createElement("div",{style:{padding:"0px 10px 20px 10px"}},l.createElement(o.Link,{to:"/digit-ui/citizen"},l.createElement(t.SubmitBar,{label:m("CS_COMMON_GO_BACK_TO_HOME")})))))},CitizenFeedback:e=>{var r,a,u,s;let{popup:c=!1,onClose:d,setShowToast:p,data:v}=e;const{t:m}=i.useTranslation(),f=o.useHistory(),h=Digit.UserService.getUser();let{redirectedFrom:E,propertyId:g,acknowldgementNumber:y,creationReason:_,tenantId:S,locality:b}=Digit.Hooks.useQueryParams();const T=window.Digit.Utils.browser.isMobile();S=S||Digit.ULBService.getCurrentTenantId();const C=Digit.ULBService.getStateId(),{data:A,isLoading:D}=Digit.Hooks.pt.useRatingAndFeedbackMDMS.RatingAndFeedBack(C),[N,P]=n.useState(""),[x,R]=n.useState(0);if(D)return l.createElement(t.Loader,null);const I=e=>{var t,n;let l=null==A||null===(t=A.enabledScreensList)||void 0===t||null===(n=t.filter(e=>{var t,n,l;return"PT"===(null==e?void 0:e.module)&&((null==E?void 0:E.includes(null==e?void 0:e.screenfrom))||(null==e||null===(t=e.bussinessService)||void 0===t?void 0:t.includes(null==v||null===(n=v.Properties)||void 0===n||null===(l=n[0])||void 0===l?void 0:l.creationReason)))}))||void 0===n?void 0:n[0];return"Header"===e?null==l?void 0:l.cardHeader:"Text"===e?null==l?void 0:l.cardText:void 0};return l.createElement(l.Fragment,null,l.createElement("form",null,l.createElement(t.Card,null,l.createElement("div",{style:c?{display:"flex",justifyContent:"space-between"}:{}},l.createElement(t.CardHeader,null,m(I("Header"))||m("PT_RATE_HELP_TEXT")),c&&l.createElement("span",{style:{marginTop:"8px"},onClick:()=>d(!1)},l.createElement(t.CloseSvg,null))),l.createElement(t.CardText,null,m(I("Text"),{acknowldgementNumber:y||(null==v||null===(r=v.Properties)||void 0===r||null===(a=r[0])||void 0===a?void 0:a.acknowldgementNumber),propertyId:g||(null==v||null===(u=v.Properties)||void 0===u||null===(s=u[0])||void 0===s?void 0:s.propertyId)})||m("PT_RATE_TEXT")),l.createElement(t.Rating,{styles:{justifyContent:"center"},currentRating:x,maxRating:5,onFeedback:(e,t,n)=>{R(n)}}),0!==x&&l.createElement("div",null,l.createElement(t.CardLabel,null,m((null==A||null===(w=A.headerByRating)||void 0===w||null===(O=w.filter(e=>x>=(null==e?void 0:e.minvalue)&&x<=(null==e?void 0:e.maxvalue)))||void 0===O||null===(L=O[0])||void 0===L?void 0:L.code)||m("CS_WHAT_WENT_WRONG"))),l.createElement(t.TextArea,{name:"",minLength:"64",onChange:e=>{P(e.target.value)}}),N&&(null==N?void 0:N.length)<64&&l.createElement(t.CardLabelError,{style:{marginTop:"-20px",marginBottom:"25px"}},m("CS_MIN_LENGTH_64"))),l.createElement(t.SubmitBar,{label:m("PT_SUBMIT"),onSubmit:()=>{var e,t,n,l;let i={},o={tenantId:(null==v||null===(e=v.Properties)||void 0===e||null===(t=e[0])||void 0===t?void 0:t.tenantId)||S,code:["PT_"+(null!=E&&E.includes("payment")?"PAYMENT":_||(null==v||null===(n=v.Properties)||void 0===n||null===(l=n[0])||void 0===l?void 0:l.creationReason))],module:["PT"]};Digit.PTService.cfdefinitionsearch({filters:{ServiceDefinitionCriteria:o}}).then((e,t)=>{var n,l,o,r,a,u,s,m,E,_,T,C,A,D;(null==e||null===(n=e.ServiceDefinition)||void 0===n?void 0:n.length)>0&&(i={tenantId:(null==v||null===(l=v.Properties)||void 0===l||null===(o=l[0])||void 0===o?void 0:o.tenantId)||S,serviceDefId:null==e||null===(r=e.ServiceDefinition)||void 0===r||null===(a=r[0])||void 0===a?void 0:a.id,isActive:!0,attributes:[{attributeCode:"consumerCode",value:g||(null==v||null===(u=v.Properties)||void 0===u||null===(s=u[0])||void 0===s?void 0:s.propertyId),additionalDetails:{}},{attributeCode:"rating",value:x,additionalDetails:{}},{attributeCode:"comments",value:N,additionalDetails:{}},{attributeCode:"channel",value:"Online",additionalDetails:{}}],additionalDetails:{locality:b||(null==v||null===(m=v.Properties)||void 0===m||null===(E=m[0])||void 0===E||null===(_=E.address)||void 0===_||null===(T=_.locality)||void 0===T?void 0:T.code)||""},accountId:null==h||null===(C=h.info)||void 0===C?void 0:C.uuid},i={...i,referenceId:y||(null==v||null===(A=v.Properties)||void 0===A||null===(D=A[0])||void 0===D?void 0:D.acknowldgementNumber)},Digit.PTService.cfcreate({Service:{...i}},S).then((e,t)=>{var n;(null==e||null===(n=e.Service)||void 0===n?void 0:n.length)>0&&(c?(d(!1),p({key:!1,label:"PT_FEEDBACK_SUBMITTED_SUCCESSFULLY"})):f.push({pathname:"/digit-ui/citizen/feedback-acknowledgement",state:{rating:x,comment:N,result:e}}))}).catch(e=>{var t,n,l;p({key:"error",label:""+(null==e||null===(t=e.response)||void 0===t||null===(n=t.data)||void 0===n||null===(l=n.Errors[0])||void 0===l?void 0:l.message)})}))})},disabled:!!(N&&(null==N?void 0:N.length)<64)||!x}),!c&&l.createElement("div",{className:"link",style:T?{marginTop:"8px",width:"100%",textAlign:"center"}:{marginTop:"8px"}},l.createElement(o.Link,{to:"/digit-ui/citizen"},m("CS_GO_BACK_HOME"))))));var w,O,L},PTRPetdetails:e=>{let{config:t,onSelect:r,formData:a,setError:s,formState:c,clearErrors:d}=e;const{t:p}=i.useTranslation(),[v,f]=(o.useLocation(),n.useState((null==a?void 0:a.pets)||[{doctorName:"",vaccinationNumber:"",lastVaccineDate:"",petAge:"",petType:"",breedType:"",clinicName:"",petName:"",petGender:"",key:Date.now()}])),[h,E]=n.useState({index:-1,type:""}),g=(Digit.ULBService.getCurrentTenantId(),Digit.ULBService.getStateId()),{data:y}=Digit.Hooks.ptr.usePTRPetMDMS(g,"PetService","PetType"),{data:_}=Digit.Hooks.ptr.useBreedTypeMDMS(g,"PetService","BreedType");let S=[],b=[];y&&y.map(e=>{S.push({i18nKey:"PTR_PET_"+e.code,code:""+e.code,value:""+e.name})}),_&&_.map(e=>{var t,n;e.PetType==(null===(t=v[0])||void 0===t||null===(n=t.petType)||void 0===n?void 0:n.code)&&b.push({i18nKey:"PTR_BREED_TYPE_"+e.code,code:""+e.code,value:""+e.name})});const{data:T}=Digit.Hooks.ptr.usePTRGenderMDMS(g,"common-masters","GenderType");let C=[];T&&T.map(e=>{"TRANSGENDER"!==e.code&&C.push({i18nKey:"PTR_GENDER_"+e.code,code:""+e.code,name:""+e.code})}),n.useEffect(()=>{r(null==t?void 0:t.key,v)},[v]);const A={focusIndex:h,allOwners:v,setFocusIndex:E,formData:a,formState:c,setPets:f,t:p,setError:s,clearErrors:d,config:t,menu:S,breed_type:b,pet_sex:C};return l.createElement(l.Fragment,null,v.map((e,t)=>l.createElement(m,u({key:e.key,index:t,pets:e},A))))},PTROwnerDetails:e=>{let{config:t,onSelect:r,formData:a,setError:s,formState:c,clearErrors:d}=e;const{t:p}=i.useTranslation(),[v,m]=(o.useLocation(),n.useState((null==a?void 0:a.owners)||[{applicantName:"",mobileNumber:"",fatherName:"",emailId:"",alternateNumber:"",key:Date.now()}])),[h,E]=n.useState({index:-1,type:""});Digit.ULBService.getCurrentTenantId(),Digit.ULBService.getStateId(),n.useEffect(()=>{r(null==t?void 0:t.key,v)},[v]);const g={focusIndex:h,allOwners:v,setFocusIndex:E,formData:a,formState:c,setOwners:m,t:p,setError:s,clearErrors:d,config:t};return l.createElement(l.Fragment,null,v.map((e,t)=>l.createElement(f,u({key:e.key,index:t,owner:e},g))))},PTRCreatePet:e=>{var n,r,u,s;const c=a.useQueryClient(),d=o.useRouteMatch(),{t:p}=i.useTranslation(),{pathname:v}=o.useLocation(),m=o.useHistory(),f=Digit.ULBService.getStateId();let h=[];const[E,g,y]=Digit.Hooks.useSessionStorage("PTR_CREATE_PET",{});let{data:_,isLoading:b}=Digit.Hooks.pt.useMDMS(f,"PropertyTax","CommonFieldsConfig");function T(e,t,n,l,i){if(void 0===i&&(i=!1),"owners"===e){let n=E.owners||[];n[l]=t,g({...E,[e]:[...n]})}else if("units"===e){let e=E.units||[];e=t,g({...E,units:e})}else g({...E,[e]:{...E[e],...t}});((e,t,n,l)=>{let i,o=v.split("/").pop(),r=o.charAt(o.length-1),a=!1;Number(parseInt(o))||"0"==o||"-1"==o?"-1"==o||"-2"==o?(o=v.slice(0,-3),o=o.split("/").pop(),a=!0):(o=v.slice(0,-2),o=o.split("/").pop(),a=!0):a=!1,isNaN(r)||(a=!0);let{nextStep:u={}}=h.find(e=>e.route===(o||"0")),s=m.push;if(e&&(s=m.replace),n&&(u=l),null===u)return s(d.path+"/check");i=isNaN(u.split("/").pop())&&a&&"map"!==u?`${d.path}/${u}/${t}`:`${d.path}/${u}`,s(i)})(n,l,i,e)}E&&Object.keys(E).length>0&&window.location.href.includes("/info")&&"true"!==sessionStorage.getItem("docReqScreenByBack")&&(y(),c.invalidateQueries("PTR_CREATE_PET"));const C=()=>{},A=()=>{};if(b)return l.createElement(t.Loader,null);_=S,_.forEach(e=>{h=h.concat(e.body.filter(e=>!e.hideInCitizen))}),h.indexRoute="info";const D=null===(n=Digit)||void 0===n||null===(r=n.ComponentRegistryService)||void 0===r?void 0:r.getComponent("PTRCheckPage"),N=null===(u=Digit)||void 0===u||null===(s=u.ComponentRegistryService)||void 0===s?void 0:s.getComponent("PTRAcknowledgement");return l.createElement(o.Switch,null,h.map((e,t)=>{const{component:n,texts:i,inputs:r,key:a}=e,u="string"==typeof n?Digit.ComponentRegistryService.getComponent(n):n;return l.createElement(o.Route,{path:`${d.path}/${e.route}`,key:t},l.createElement(u,{config:{texts:i,inputs:r,key:a},onSelect:T,onSkip:C,t:p,formData:E,onAdd:A}))}),l.createElement(o.Route,{path:d.path+"/check"},l.createElement(D,{onSubmit:function(){try{return m.push(d.path+"/acknowledgement"),Promise.resolve()}catch(e){return Promise.reject(e)}},value:E})),l.createElement(o.Route,{path:d.path+"/acknowledgement"},l.createElement(N,{data:E,onSuccess:()=>{y(),c.invalidateQueries("PTR_CREATE_PET")}})),l.createElement(o.Route,null,l.createElement(o.Redirect,{to:`${d.path}/${h.indexRoute}`})))},PTRDocumentUpload:e=>{var i,r;let{t:a,config:u,onSelect:s,formData:c,setError:d,clearErrors:p,formState:v}=e;Digit.ULBService.getCurrentTenantId();const m=Digit.ULBService.getStateId(),[f,h]=n.useState((null==c||null===(i=c.documents)||void 0===i?void 0:i.documents)||[]),[E,g]=n.useState(null);o.useLocation();const{isLoading:_,data:S}=Digit.Hooks.ptr.usePetMDMS(m,"PetService","Documents"),b=null==S||null===(r=S.PetService)||void 0===r?void 0:r.Documents.map(e=>({...e,hasDropdown:!0}));return n.useEffect(()=>{s(u.key,{documents:f,PTRDocumentLength:null==b?void 0:b.length})},[f]),_?l.createElement(t.Loader,null):l.createElement("div",null,null==b?void 0:b.map((e,t)=>l.createElement(y,{key:t,document:e,action:"create",t:a,id:"ptr-document-"+t,error:E,setError:g,setDocuments:h,accept:".pdf, .jpeg, .jpg, .png",documents:f,formData:c,setFormError:d,clearFormErrors:p,config:u,formState:v})),E&&l.createElement(t.Toast,{label:E,onClose:()=>g(null),error:!0}))},PTRSelectStreet:e=>{let{t:i,config:o,onSelect:a,userType:s,formData:c,formState:p,setError:v,clearErrors:m}=e;const[f,h]=n.useState({index:-1,type:""}),{control:E,formState:g,watch:y,trigger:_}=r.useForm(),S=y(),{errors:b}=g,T=window.location.href.includes("ptr/petservice/new-application");let C;var A;return C=[{label:"PTR_STREET_NAME",type:"text",name:"street",validation:{}},{label:"PTR_HOUSE_NO",type:"text",name:"doorNo",validation:{}},{label:"PTR_HOUSE_NAME",type:"text",name:"buildingName",validation:{}},{label:"PTR_ADDRESS_LINE1",type:"text",name:"addressLine1",validation:{}},{label:"PTR_ADDRESS_LINE2",type:"text",name:"addressLine2",validation:{}},{label:"PTR_landmark",type:"text",name:"landmark",validation:{}}],n.useEffect(()=>{_()},[]),n.useEffect(()=>{var e;"employee"===s&&(Object.keys(b).length&&!d.isEqual((null===(e=p.errors[o.key])||void 0===e?void 0:e.type)||{},b)?v(o.key,{type:b}):!Object.keys(b).length&&p.errors[o.key]&&m(o.key))},[b]),n.useEffect(()=>{const e=Object.keys(S),t={};e.forEach(e=>{var n;return t[e]=null===(n=c[o.key])||void 0===n?void 0:n[e]}),d.isEqual(S,t)||(a(o.key,{...c[o.key],...S}),_())},[S]),"employee"===s?null===(A=C)||void 0===A?void 0:A.map((e,n)=>{var a;return l.createElement(t.LabelFieldPair,{key:n},l.createElement(t.CardLabel,{className:"card-label-smaller"},T?i(e.label)+":":i(e.label),o.isMandatory?" * ":null),l.createElement("div",{className:"field"},l.createElement(r.Controller,{control:E,defaultValue:null==c||null===(a=c.address)||void 0===a?void 0:a[e.name],name:e.name,rules:{validate:{pattern:e=>!!/^[A-Za-z]+( +[A-Za-z]+)*$/.test(e)||i("ERR_DEFAULT_INPUT_FIELD_MSG")}},render:i=>l.createElement(t.TextInput,u({id:e.name,key:e.name,value:i.value,onChange:e=>{h({index:n}),i.onChange(e.target.value)},onBlur:i.onBlur,autoFocus:(null==f?void 0:f.index)==n},e.validation))})))}):l.createElement(l.Fragment,null,l.createElement(t.FormStep,{config:{...o,inputs:C},_defaultValues:{street:null==c?void 0:c.address.street,doorNo:null==c?void 0:c.address.doorNo},onSelect:e=>a(o.key,e),onSkip:()=>a(),t:i}))},PTRCitizenDetails:e=>{var i,r,a,s,c;let{t:d,config:p,onSelect:v,userType:m,formData:f}=e;o.useLocation();let h={};const[g,y]=n.useState(f.ownerss&&f.ownerss[0]&&f.ownerss[0].applicantName||(null==f||null===(i=f.ownerss)||void 0===i?void 0:i.applicantName)||""),[_,S]=n.useState(f.ownerss&&f.ownerss[0]&&f.ownerss[0].emailId||(null==f||null===(r=f.ownerss)||void 0===r?void 0:r.emailId)||""),[b,T]=n.useState(f.ownerss&&f.ownerss[0]&&f.ownerss[0].mobileNumber||(null==f||null===(a=f.ownerss)||void 0===a?void 0:a.mobileNumber)||""),[C,A]=n.useState(f.ownerss&&f.ownerss[0]&&f.ownerss[0].alternateNumber||(null==f||null===(s=f.ownerss)||void 0===s?void 0:s.alternateNumber)||""),[D,N]=n.useState(f.ownerss&&f.ownerss[0]&&f.ownerss[0].fatherName||(null==f||null===(c=f.ownerss)||void 0===c?void 0:c.fatherName)||"");Digit.ULBService.getCurrentTenantId(),Digit.ULBService.getStateId();const P=()=>{let e,t=f.ownerss&&f.ownerss[0];"citizen"===m?(e={...t,applicantName:g,mobileNumber:b,alternateNumber:C,fatherName:D,emailId:_},v(p.key,{...f[p.key],...e},!1,0)):(e={...t,applicantName:g,mobileNumber:b,alternateNumber:C,fatherName:D,emailId:_},v(p.key,e,!1,0))};return n.useEffect(()=>{"citizen"===m&&P()},[g,b,D,_]),l.createElement(l.Fragment,null,window.location.href.includes("/citizen")?l.createElement(E,{currentStep:1}):null,l.createElement(t.FormStep,{config:p,onSelect:P,onSkip:()=>v(),t:d,isDisabled:!(g&&b&&D&&_)},l.createElement("div",null,l.createElement(t.CardLabel,null,""+d("PTR_APPLICANT_NAME")),l.createElement(t.TextInput,u({t:d,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"applicantName",value:g,onChange:function(e){y(e.target.value)},ValidationRequired:!0},h={isRequired:!0,pattern:"^[a-zA-Z ]+$",type:"tel",title:d("PT_NAME_ERROR_MESSAGE")})),l.createElement(t.CardLabel,null,""+d("PTR_MOBILE_NUMBER")),l.createElement(t.MobileNumber,{value:b,name:"mobileNumber",onChange:e=>{T({value:e}.value)},required:!0,pattern:"[6-9]{1}[0-9]{9}",type:"tel",title:d("CORE_COMMON_APPLICANT_MOBILE_NUMBER_INVALID")}),l.createElement(t.CardLabel,null,""+d("PTR_ALT_MOBILE_NUMBER")),l.createElement(t.MobileNumber,{value:C,name:"alternateNumber",onChange:e=>{A({value:e}.value)},required:!1,pattern:"[6-9]{1}[0-9]{9}",type:"tel",title:d("CORE_COMMON_APPLICANT_MOBILE_NUMBER_INVALID")}),l.createElement(t.CardLabel,null,""+d("PTR_FATHER_HUSBAND_NAME")),l.createElement(t.TextInput,u({t:d,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"fatherName",value:D,onChange:function(e){N(e.target.value)},ValidationRequired:!0},h={isRequired:!0,pattern:"^[a-zA-Z-.`' ]*$",type:"text",title:d("PTR_NAME_ERROR_MESSAGE")})),l.createElement(t.CardLabel,null,""+d("PTR_EMAIL_ID")),l.createElement(t.TextInput,u({t:d,type:"text",isMandatory:!0,optionKey:"i18nKey",name:"emailId",value:_,onChange:function(e){S(e.target.value)},ValidationRequired:!0},h={isRequired:!0,pattern:"[a-z0-9._%+-]+@[a-z0-9.-]+.[a-z]{2,}$",type:"text",title:d("PTR_NAME_ERROR_MESSAGE")})))))},PTRCitizenPet:e=>{var i,a,s,c,d,p,v,m,f;let{t:h,config:g,onSelect:y,userType:_,formData:S}=e;o.useLocation();let b=window.location.href.charAt(window.location.href.length-1),T={};const[C,A]=n.useState(S.pets&&S.pets[b]&&S.pets[b].petType||(null==S||null===(i=S.pets)||void 0===i?void 0:i.petType)||""),[D,N]=n.useState(S.pets&&S.pets[b]&&S.pets[b].breedType||(null==S||null===(a=S.pets)||void 0===a?void 0:a.breedType)||""),[P,x]=n.useState(S.pets&&S.pets[b]&&S.pets[b].petGender||(null==S||null===(s=S.pets)||void 0===s?void 0:s.petGender)||""),[R,I]=n.useState(S.pets&&S.pets[b]&&S.pets[b].petName||(null==S||null===(c=S.pets)||void 0===c?void 0:c.petName)||""),[w,O]=n.useState(S.pets&&S.pets[b]&&S.pets[b].petAge||(null==S||null===(d=S.pets)||void 0===d?void 0:d.petAge)||""),[L,k]=n.useState(S.pets&&S.pets[b]&&S.pets[b].doctorName||(null==S||null===(p=S.pets)||void 0===p?void 0:p.doctorName)||""),[M,F]=n.useState(S.pets&&S.pets[b]&&S.pets[b].clinicName||(null==S||null===(v=S.pets)||void 0===v?void 0:v.clinicName)||""),[B,U]=n.useState(S.pets&&S.pets[b]&&S.pets[b].vaccinationNumber||(null==S||null===(m=S.pets)||void 0===m?void 0:m.vaccinationNumber)||""),[H,j]=n.useState(S.pets&&S.pets[b]&&S.pets[b].lastVaccineDate||(null==S||null===(f=S.pets)||void 0===f?void 0:f.lastVaccineDate)||""),W=(Digit.ULBService.getCurrentTenantId(),Digit.ULBService.getStateId()),{data:z}=Digit.Hooks.ptr.usePTRPetMDMS(W,"PetService","PetType"),{data:$}=Digit.Hooks.ptr.useBreedTypeMDMS(W,"PetService","BreedType");let V=[],q=[];z&&z.map(e=>{V.push({i18nKey:"PTR_PET_"+e.code,code:""+e.code,value:""+e.name})});const{control:G}=r.useForm();$&&$.map(e=>{e.PetType==(null==C?void 0:C.code)&&q.push({i18nKey:"PTR_BREED_TYPE_"+e.code,code:""+e.code,value:""+e.name})});const{data:K}=Digit.Hooks.ptr.usePTRGenderMDMS(W,"common-masters","GenderType");let Y=[];K&&K.map(e=>{"TRANSGENDER"!==e.code&&Y.push({i18nKey:"PTR_GENDER_"+e.code,code:""+e.code,name:""+e.code})});const X=()=>{let e,t=S.pets&&S.pets[b];"citizen"===_?(e={...t,petType:C,breedType:D,petGender:P,petName:R,petAge:w,doctorName:L,clinicName:M,lastVaccineDate:H,vaccinationNumber:B},y(g.key,{...S[g.key],...e},!1,b)):(e={...t,petType:C,breedType:D,petGender:P,petName:R,petAge:w,doctorName:L,clinicName:M,lastVaccineDate:H,vaccinationNumber:B},y(g.key,e,!1,b))};return n.useEffect(()=>{"citizen"===_&&X()},[C,D,P,R,w,L,H]),l.createElement(l.Fragment,null,window.location.href.includes("/citizen")?l.createElement(E,{currentStep:2}):null,l.createElement(t.FormStep,{config:g,onSelect:X,onSkip:()=>y(),t:h,isDisabled:!(C&&D&&P&&R&&w&&L&&M&&H&&B)},l.createElement("div",null,l.createElement(t.CardLabel,null,""+h("PTR_SEARCH_PET_TYPE")),l.createElement(r.Controller,{control:G,name:"petType",defaultValue:C,rules:{required:h("CORE_COMMON_REQUIRED_ERRMSG")},render:e=>l.createElement(t.Dropdown,{className:"form-field",selected:C,select:A,option:V,optionKey:"i18nKey",t:h})}),l.createElement(t.CardLabel,null,""+h("PTR_SEARCH_BREED_TYPE")),l.createElement(r.Controller,{control:G,name:"breedType",defaultValue:D,rules:{required:h("CORE_COMMON_REQUIRED_ERRMSG")},render:e=>l.createElement(t.Dropdown,{className:"form-field",selected:D,select:N,option:q,optionKey:"i18nKey",t:h})}),l.createElement(t.CardLabel,null,""+h("PTR_PET_NAME")),l.createElement(t.TextInput,u({t:h,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"petName",value:R,onChange:function(e){I(e.target.value)},style:{width:"86%"},ValidationRequired:!1},T={isRequired:!0,pattern:"^[a-zA-Z-.`' ]*$",type:"text",title:h("PT_NAME_ERROR_MESSAGE")})),l.createElement(t.CardLabel,null,""+h("PTR_PET_SEX")),l.createElement(r.Controller,{control:G,name:"petGender",defaultValue:P,rules:{required:h("CORE_COMMON_REQUIRED_ERRMSG")},render:e=>l.createElement(t.Dropdown,{className:"form-field",selected:P,select:x,option:Y,optionKey:"i18nKey",t:h})}),l.createElement(t.CardLabel,null,""+h("PTR_PET_AGE")),l.createElement(t.TextInput,{t:h,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"petAge",value:w,onChange:function(e){O(e.target.value)},style:{width:"86%"},placeholder:"in months",rules:{required:h("CORE_COMMON_REQUIRED_ERRMSG"),validate:e=>!!/^[0123456789]\d{2}$/.test(e)||h("ERR_DEFAULT_INPUT_FIELD_MSG")}}),l.createElement("div",null,Math.floor(w/12)," ",1===Math.floor(w/12)?"YEAR":"YEARS"," ",w%12," ",w%12==1?"MONTH":"MONTHS"),l.createElement("br",null),l.createElement(t.CardLabel,null,""+h("PTR_DOCTOR_NAME")),l.createElement(t.TextInput,u({t:h,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"doctorName",value:L,onChange:function(e){k(e.target.value)},style:{width:"86%"},ValidationRequired:!1},T={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(t.TextInput,u({t:h,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"clinicName",value:M,onChange:function(e){F(e.target.value)},style:{width:"86%"},ValidationRequired:!1},T={isRequired:!0,pattern:"^[a-zA-Z-.`' ]*$",type:"text",title:h("PT_NAME_ERROR_MESSAGE")})),l.createElement(t.CardLabel,null,""+h("PTR_VACCINATED_DATE")),l.createElement(t.TextInput,{t:h,type:"date",isMandatory:!1,optionKey:"i18nKey",name:"lastVaccineDate",value:H,onChange:function(e){j(e.target.value)},style:{width:"86%"},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(t.TextInput,{t:h,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"vaccinationNumber",value:B,onChange:function(e){U(e.target.value)},style:{width:"86%"}}))))},PTRCitizenAddress:e=>{let{t:i,config:o,onSelect:a,userType:s,formData:c,formState:p,setError:v,clearErrors:m}=e;const[f,h]=n.useState({index:-1,type:""}),{control:g,formState:y,watch:_,trigger:S}=r.useForm(),b=_(),{errors:T}=y,C=window.location.href.includes("ptr/petservice/new-application");let A;A=[{label:"PTR_STREET_NAME",type:"text",name:"street",validation:{pattern:"[a-zA-Z0-9 !@#$%^&*()_+-={};':\\\\|,.<>/?]{1,64}",title:i("CORE_COMMON_STREET_INVALID")}},{label:"PTR_HOUSE_NO",type:"text",name:"doorNo",validation:{pattern:"[a-zA-Z0-9 !@#$%^&*()_+-={};':\\\\|,.<>/?]{1,64}",title:i("CORE_COMMON_DOOR_INVALID")}},{label:"PTR_HOUSE_NAME",type:"text",name:"buildingName",validation:{pattern:"[a-zA-Z0-9 !@#$%^&*()_+-={};':\\\\|,.<>/?]{1,64}",title:i("CORE_COMMON_DOOR_INVALID")}},{label:"PTR_ADDRESS_LINE1",type:"text",name:"addressLine1",validation:{pattern:"[a-zA-Z0-9 !@#$%^&*()_+-={};':\\\\|,.<>/?]{1,64}",title:i("CORE_COMMON_DOOR_INVALID")}},{label:"PTR_ADDRESS_LINE2",type:"text",name:"addressLine2",validation:{pattern:"[a-zA-Z0-9 !@#$%^&*()_+-={};':\\\\|,.<>/?]{1,64}",title:i("CORE_COMMON_DOOR_INVALID")}},{label:"PTR_landmark",type:"text",name:"landmark",validation:{pattern:"[a-zA-Z0-9 !@#$%^&*()_+-={};':\\\\|,.<>/?]{1,64}",title:i("CORE_COMMON_DOOR_INVALID")}}];const D=e=>{let{validation:t,name:n,messages:l}=e;if(t){let{pattern:e,maxlength:i,minlength:o,required:r}=t||{};return{pattern:t=>{if(e){var i;if(e instanceof RegExp)return!!e.test(t)||(null==l?void 0:l.pattern)||n.toUpperCase()+"_PATTERN";if("string"==typeof e)return!(null===(i=new RegExp(e))||void 0===i||!i.test(t))||(null==l?void 0:l.pattern)||n.toUpperCase()+"_PATTERN"}return!0},required:e=>!r||!!e||(null==l?void 0:l.required)||n.toUpperCase()+"_REQUIRED",maxLength:e=>!i||(null==e?void 0:e.length)<=i||(null==l?void 0:l.maxlength)||n.toUpperCase()+"_MAXLENGTH",minlength:o}}return{}};var N;return n.useEffect(()=>{S()},[]),n.useEffect(()=>{var e;"employee"===s&&(Object.keys(T).length&&!d.isEqual((null===(e=p.errors[o.key])||void 0===e?void 0:e.type)||{},T)?v(o.key,{type:T}):!Object.keys(T).length&&p.errors[o.key]&&m(o.key))},[T]),n.useEffect(()=>{const e=Object.keys(b),t={};e.forEach(e=>{var n;return t[e]=null===(n=c[o.key])||void 0===n?void 0:n[e]}),d.isEqual(b,t)||(a(o.key,{...c[o.key],...b}),S())},[b]),"employee"===s?null===(N=A)||void 0===N?void 0:N.map((e,n)=>{var a;return l.createElement(t.LabelFieldPair,{key:n},l.createElement(t.CardLabel,{className:"card-label-smaller"},C?i(e.label)+":":i(e.label),o.isMandatory?" * ":null),l.createElement("div",{className:"field"},l.createElement(r.Controller,{control:g,defaultValue:null==c||null===(a=c.address)||void 0===a?void 0:a[e.name],name:e.name,rules:{validate:D(e)},render:i=>l.createElement(t.TextInput,u({id:e.name,key:e.name,value:i.value,onChange:e=>{h({index:n}),i.onChange(e.target.value)},onBlur:i.onBlur,autoFocus:(null==f?void 0:f.index)==n},e.validation))})))}):l.createElement(l.Fragment,null,window.location.href.includes("/citizen")?l.createElement(E,{currentStep:3}):null,l.createElement(t.FormStep,{config:{...o,inputs:A},_defaultValues:{street:null==c?void 0:c.address.street,doorNo:null==c?void 0:c.address.doorNo,buildingName:null==c?void 0:c.address.buildingName,addressLine1:null==c?void 0:c.address.addressLine1,addressLine2:null==c?void 0:c.address.addressLine2,landmark:null==c?void 0:c.address.landmark},onSelect:e=>a(o.key,e),onSkip:()=>a(),t:i}))},PTRSelectPincode:e=>{var i;let{t:r,config:a,onSelect:s,formData:c={},userType:d}=e;const p=Digit.Hooks.ptr.useTenants(),{pathname:v}=o.useLocation(),m=v.includes("modify");console.log("formData in oincode ",c);const[f,h]=n.useState(()=>{var e,t,n;return m&&"employee"===d?(null==c||null===(e=c.originalData)||void 0===e||null===(t=e.address)||void 0===t?void 0:t.pincode)||"":(null==c||null===(n=c.address)||void 0===n?void 0:n.pincode)||""}),g=[{label:"PTR_ADDRESS_PINCODE",type:"text",name:"pincode",validation:{minlength:6,maxlength:7,pattern:"[0-9]+",max:"9999999",title:r("PTR_ADDRESS_PINCODE_INVALID")}}],[y,_]=n.useState(null),[S,b]=n.useState("");function T(e){h(e.target.value),_(null),b("");let t=Digit.Utils.getPattern("Pincode").test(e.target.value);"employee"===d&&(e.target.value&&!t&&b(r("ERR_DEFAULT_INPUT_FIELD_MSG")),t&&((null==p?void 0:p.find(t=>{var n;return null===(n=t.pincode)||void 0===n?void 0:n.find(t=>t.toString()===e.target.value)}))||b(r("PTR_COMMON_PINCODE_NOT_SERVICABLE"))),s(a.key,{...c.address,pincode:e.target.value}))}return n.useEffect(()=>{var e;null!=c&&null!==(e=c.address)&&void 0!==e&&e.pincode&&h(c.address.pincode)},[null==c||null===(i=c.address)||void 0===i?void 0:i.pincode]),"employee"===d?null==g?void 0:g.map((e,n)=>l.createElement(l.Fragment,null,l.createElement(t.LabelFieldPair,{key:n},l.createElement(t.CardLabel,{className:"card-label-smaller"},r(e.label)),l.createElement("div",{className:"field"},l.createElement(t.TextInput,u({key:e.name,value:f,onChange:T},e.validation,{disable:m,autoFocus:m})))),S?l.createElement(t.CardLabelError,{style:{width:"70%",marginLeft:"30%",fontSize:"12px",marginTop:"-21px"}},S):null)):l.createElement(l.Fragment,null,window.location.href.includes("/citizen")?l.createElement(E,{currentStep:3}):null,l.createElement(t.FormStep,{t:r,config:{...a,inputs:g},onSelect:function(e){try{return(null==p?void 0:p.find(t=>{var n;return null===(n=t.pincode)||void 0===n?void 0:n.find(t=>t==(null==e?void 0:e.pincode))}))?s(a.key,{pincode:f}):_("PTR_COMMON_PINCODE_NOT_SERVICABLE"),Promise.resolve()}catch(e){return Promise.reject(e)}},_defaultValues:{pincode:f},onChange:T,onSkip:()=>s(),forcedError:r(y)}))},PTRSelectAddress:e=>{var i;let{t:a,config:u,onSelect:s,userType:c,formData:p}=e;const v=Digit.Hooks.ptr.useTenants();let m=Digit.ULBService.getCurrentTenantId();const{pathname:f}=o.useLocation(),h=f.includes("modify");let g=(null==p?void 0:p.isEditAddress)||!1;h&&(g=!0);const{pincode:y}=(null==p?void 0:p.address)||"",_="employee"===c?v.filter(e=>e.code===m):y?v.filter(e=>{var t;return null==e||null===(t=e.pincode)||void 0===t?void 0:t.some(e=>e==y)}):v,[S,b]=n.useState(()=>{var e;return(null==p||null===(e=p.address)||void 0===e?void 0:e.city)||null}),{data:T}=Digit.Hooks.useBoundaryLocalities(null==S?void 0:S.code,"revenue",{enabled:!!S},a),[C,A]=n.useState(),[D,N]=n.useState();n.useEffect(()=>{if("employee"===c&&h&&null!=C&&C.length){var e,t,n;const l=null==p||null===(e=p.originalData)||void 0===e||null===(t=e.address)||void 0===t||null===(n=t.locality)||void 0===n?void 0:n.code,i=null==C?void 0:C.filter(e=>e.code===l)[0];I("locality",i)}},[C]),n.useEffect(()=>{_&&1===_.length&&b(_[0])},[_]),n.useEffect(()=>{if(S&&T){var e,t;let l=T,i=[];var n;null!=p&&null!==(e=p.address)&&void 0!==e&&e.locality&&N(p.address.locality),null!=p&&null!==(t=p.address)&&void 0!==t&&t.pincode&&(i=l.filter(e=>{var t;return null===(t=e.pincode)||void 0===t?void 0:t.find(e=>e==p.address.pincode)}),null!=p&&null!==(n=p.address)&&void 0!==n&&n.locality||N()),A(()=>i.length>0?i:l),1===i.length&&N(i[0])}},[S,null==p||null===(i=p.address)||void 0===i?void 0:i.pincode,T]);const{control:P,formState:x,watch:R,setValue:I}=r.useForm(),w=R(),{errors:O}=x,L={width:"70%",marginLeft:"30%",fontSize:"12px",marginTop:"-21px"};var k,M;return n.useEffect(()=>{if("employee"===c){let e=Object.keys(w);const t={};e.forEach(e=>{var n;return t[e]=null===(n=p[u.key])||void 0===n?void 0:n[e]}),d.isEqual(w,t)||s(u.key,{...p[u.key],...w})}},[w]),n.useEffect(()=>{},[x]),"employee"===c?l.createElement("div",null,l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},a("MYCITY_CODE_LABEL")+" *"),l.createElement(r.Controller,{name:"city",defaultValue:1===(null==_?void 0:_.length)?_[0]:S,control:P,render:e=>l.createElement(t.Dropdown,{className:"form-field",selected:e.value,disable:g||1===(null==_?void 0:_.length),option:_,select:e.onChange,optionKey:"code",onBlur:e.onBlur,t:a})})),l.createElement(t.CardLabelError,{style:L},x.touched.city?null==O||null===(k=O.city)||void 0===k?void 0:k.message:""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},a("PTR_LOCALITY")+" *"),l.createElement(r.Controller,{name:"locality",defaultValue:null,control:P,render:e=>l.createElement(t.Dropdown,{className:"form-field",selected:e.value,option:C,select:e.onChange,onBlur:e.onBlur,optionKey:"i18nkey",t:a,disable:g||!1})})),l.createElement(t.CardLabelError,{style:L},x.touched.locality?null==O||null===(M=O.locality)||void 0===M?void 0:M.message:"")):l.createElement(l.Fragment,null,window.location.href.includes("/citizen")?l.createElement(E,{currentStep:3}):null,l.createElement(t.FormStep,{config:u,onSelect:function(){s(u.key,{city:S,locality:D})},t:a,isDisabled:!D},l.createElement("div",null,l.createElement(t.CardLabel,null,a("MYCITY_CODE_LABEL")+" "),l.createElement("span",{className:"form-ptr-dropdown-only"},l.createElement(t.RadioOrSelect,{options:_.sort((e,t)=>e.name.localeCompare(t.name)),selectedOption:S,optionKey:"i18nKey",onSelect:function(e){N(null),A(null),b(e)},t:a,isPTFlow:!0,disabled:g})),S&&C&&l.createElement(t.CardLabel,null,a("PTR_LOCALITY")+" "),S&&C&&l.createElement("span",{className:"form-ptr-dropdown-only"},l.createElement(t.RadioOrSelect,{dropdownStyle:{paddingBottom:"20px"},isMandatory:u.isMandatory,options:C.sort((e,t)=>e.name.localeCompare(t.name)),selectedOption:D,optionKey:"i18nkey",onSelect:function(e){var t;null!=p&&null!==(t=p.address)&&void 0!==t&&t.locality&&(p.address.locality=e),N(e),"employee"===c&&s(u.key,{...p[u.key],locality:e})},t:a,labelKey:"",disabled:g})))))},PTRSelectProofIdentity:e=>{var i,o,r;let{t:a,config:u,onSelect:s,formData:c}=e;Digit.ULBService.getStateId();const[d,p]=n.useState((null==c||null===(i=c.documents)||void 0===i?void 0:i.documents)||[]),[v,m]=n.useState(null),[f,h]=n.useState(!0),[g,y]=n.useState(!1),_=Digit.ULBService.getStateId(),{isLoading:S,data:T}=Digit.Hooks.ptr.usePetMDMS(_,"PetService","Documents");return n.useEffect(()=>{var e;let t=0;null==T||null===(e=T.PetService)||void 0===e||e.Documents.map(e=>{e.hasDropdown=!0;let n=!1;d.map(t=>{e.required&&null!=t&&t.documentType.includes(e.code)&&(n=!0)}),!n&&e.required&&(t+=1)}),h("0"!=t&&0!=t||!(d.length>0))},[d,g]),l.createElement("div",null,l.createElement(E,{currentStep:4}),S?l.createElement(t.Loader,null):l.createElement(t.FormStep,{t:a,config:u,onSelect:()=>{let e;e={...c.documents,documents:d},s(u.key,e)},onSkip:()=>s(),isDisabled:f,onAdd:function(){}},null==T||null===(o=T.PetService)||void 0===o||null===(r=o.Documents)||void 0===r?void 0:r.map((e,t)=>l.createElement(b,{key:t,document:e,t:a,error:v,setError:m,setDocuments:p,documents:d,setCheckRequiredFields:y})),v&&l.createElement(t.Toast,{label:v,onClose:()=>m(null),error:!0})))},PTRServiceDoc:e=>{var n;let{t:i,config:o,onSelect:r}=e;Digit.ULBService.getCurrentTenantId();const a=Digit.ULBService.getStateId();sessionStorage.removeItem("docReqScreenByBack");const u=null!=o&&o.isMutation?["MutationDocuments"]:"Documents",{isLoading:s,data:c={}}=Digit.Hooks.ptr.usePetMDMS(a,"PetService",u);let d=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,s&&l.createElement(t.Loader,null),Array.isArray(d)?d.map(null!=o&&o.isMutation?(e,n)=>{let{code:o,dropdownData:r}=e;return l.createElement("div",{key:n},l.createElement(t.CardSubHeader,null,n+1,". ",i(o)),l.createElement(t.CardText,{className:"primaryColor"},r.map(e=>i(null==e?void 0:e.code)).join(", ")))}:(e,n)=>{let{code:o,dropdownData:r}=e;return l.createElement("div",{key:n},l.createElement(t.CardSubHeader,null,n+1,". ",i(v(o,".","_"))),r.map((e,n)=>l.createElement(t.CardText,{className:"primaryColor"},""+(n+1),". ",i(v(null==e?void 0:e.code,".","_")))))}):null)),l.createElement("span",null,l.createElement(t.SubmitBar,{label:i("PTR_COMMON_NEXT"),onSubmit:r}))))},PTRWFApplicationTimeline:C},zl=e=>{let{stateCode:t,userType:i,tenants:r}=e;const{path:a,url:u}=o.useRouteMatch(),s=Digit.StoreData.getCurrentLanguage();return Digit.Services.useStore({stateCode:t,moduleCode:"PTR",language:s}),Object.entries(Wl).forEach(e=>{let[t,n]=e;Digit.ComponentRegistryService.setComponent(t,n)}),Digit.SessionStorage.set("PTR_TENANTS",r),n.useEffect(()=>"employee"===i&&Digit.LocalizationService.getLocale({modules:["rainmaker-"+Digit.ULBService.getCurrentTenantId()],locale:Digit.StoreData.getCurrentLanguage(),tenantId:Digit.ULBService.getCurrentTenantId()}),[]),"employee"===i?l.createElement(ze,{path:a,url:u,userType:i}):l.createElement(D,null)},$l=e=>{let{matchPath:o}=e;const{t:r}=i.useTranslation(),[a,u,s]=Digit.Hooks.useSessionStorage("PTR_PET",{});n.useEffect(()=>{s()},[]);const c=[{link:o+"/ptr/petservice/new-application",i18nKey:r("PTR_CREATE_PET_APPLICATION")},{link:o+"/ptr/petservice/my-application",i18nKey:r("PTR_MY_APPLICATIONS_HEADER")},{link:o+"/howItWorks",i18nKey:r("PTR_HOW_IT_WORKS")},{link:o+"/faqs",i18nKey:r("PTR_FAQ_S")}];return l.createElement(t.CitizenHomeCard,{header:r("ACTION_TEST_PTR"),links:c,Icon:()=>l.createElement(t.PTRIcon,{className:"fill-path-primary-main"})})};exports.PTRComponents={PTRCard:()=>{const{t:e}=i.useTranslation(),[o,r]=n.useState("-"),{data:a,isLoading:u,isFetching:s,isSuccess:c}=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.ptAccess()}});if(n.useEffect(()=>{!s&&c&&r(a)},[s]),!Digit.Utils.ptAccess())return null;const d=[{count:u?"-":null==o?void 0:o.totalCount,label:e("ES_COMMON_INBOX"),link:"/digit-ui/employee/ptr/petservice/inbox"},{label:e("PTR_TITLE_NEW_PET_REGISTRATION"),link:"/digit-ui/employee/ptr/petservice/new-application",role:"PT_CEMP"},{label:e("ES_COMMON_APPLICATION_SEARCH"),link:"/digit-ui/employee/ptr/petservice/my-applications"}],p=Digit.UserService.hasAccess(["PT_CEMP"])||!1,v={Icon:l.createElement(t.PTRIcon,null),moduleName:e("PTR_TITLE_PET_REGISTRATION"),kpis:[{count:null==o?void 0:o.totalCount,label:e("ES_TITLE_INBOX"),link:"/digit-ui/employee/ptr/petservice/inbox"}],links:d.filter(e=>!(null!=e&&e.role)||p)};return l.createElement(t.EmployeeModuleCard,v)},PTRModule:zl,PTRLinks:$l,PTR_INBOX_FILTER:e=>l.createElement(qe,e),PTRInboxTableConfig:e=>({PTR:{inboxColumns:t=>[{Header:e("PTR_APPLICATION_NUMBER"),Cell:e=>{var n,i,r,a;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===(r=u.original)||void 0===r||null===(a=r.searchData)||void 0===a?void 0:a.applicationNumber)))},mobileCell:e=>{var t;return Ke(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 Ge(""+(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 Ke(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 Ge(""+(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 Ke(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 Ge(""+(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 Ke(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 Ge(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 Ke(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=$l,exports.PTRModule=zl;
|