Linux ip-172-26-7-228 5.4.0-1103-aws #111~18.04.1-Ubuntu SMP Tue May 23 20:04:10 UTC 2023 x86_64
Your IP : 18.223.209.114
(window.webpackJsonp=window.webpackJsonp||[]).push([[214],{1236:function(e,t,n){"use strict";n.r(t);var r=n(68),a=n(69),o=n(2),i=n.n(o),l=n(271),s=n(105),u=n(1333),c=n(1343),f=n(1377),p=n(272),h=n(1335),m=n(1337),d=n(1338),v=n(1153),g=n(941),y=n(275),w=n.n(y),b=n(267),k=n(287),E=n.n(k),O=n(109),S=(n(171),n(274));function C(){C=function(){return t};var e,t={},n=Object.prototype,r=n.hasOwnProperty,a=Object.defineProperty||function(e,t,n){e[t]=n.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",l=o.asyncIterator||"@@asyncIterator",s=o.toStringTag||"@@toStringTag";function u(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{u({},"")}catch(e){u=function(e,t,n){return e[t]=n}}function c(e,t,n,r){var o=t&&t.prototype instanceof g?t:g,i=Object.create(o.prototype),l=new I(r||[]);return a(i,"_invoke",{value:j(e,n,l)}),i}function f(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=c;var p="suspendedStart",h="suspendedYield",m="executing",d="completed",v={};function g(){}function y(){}function w(){}var b={};u(b,i,function(){return this});var k=Object.getPrototypeOf,E=k&&k(k(A([])));E&&E!==n&&r.call(E,i)&&(b=E);var O=w.prototype=g.prototype=Object.create(b);function S(e){["next","throw","return"].forEach(function(t){u(e,t,function(e){return this._invoke(t,e)})})}function x(e,t){function n(a,o,i,l){var s=f(e[a],e,o);if("throw"!==s.type){var u=s.arg,c=u.value;return c&&"object"==typeof c&&r.call(c,"__await")?t.resolve(c.__await).then(function(e){n("next",e,i,l)},function(e){n("throw",e,i,l)}):t.resolve(c).then(function(e){u.value=e,i(u)},function(e){return n("throw",e,i,l)})}l(s.arg)}var o;a(this,"_invoke",{value:function(e,r){function a(){return new t(function(t,a){n(e,r,t,a)})}return o=o?o.then(a,a):a()}})}function j(t,n,r){var a=p;return function(o,i){if(a===m)throw new Error("Generator is already running");if(a===d){if("throw"===o)throw i;return{value:e,done:!0}}for(r.method=o,r.arg=i;;){var l=r.delegate;if(l){var s=M(l,r);if(s){if(s===v)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(a===p)throw a=d,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);a=m;var u=f(t,n,r);if("normal"===u.type){if(a=r.done?d:h,u.arg===v)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(a=d,r.method="throw",r.arg=u.arg)}}}function M(t,n){var r=n.method,a=t.iterator[r];if(a===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,M(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),v;var o=f(a,t.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,v;var i=o.arg;return i?i.done?(n[t.resultName]=i.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,v):i:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function L(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function D(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function I(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(L,this),this.reset(!0)}function A(t){if(t||""===t){var n=t[i];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var a=-1,o=function n(){for(;++a<t.length;)if(r.call(t,a))return n.value=t[a],n.done=!1,n;return n.value=e,n.done=!0,n};return o.next=o}}throw new TypeError(typeof t+" is not iterable")}return y.prototype=w,a(O,"constructor",{value:w,configurable:!0}),a(w,"constructor",{value:y,configurable:!0}),y.displayName=u(w,s,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===y||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,w):(e.__proto__=w,u(e,s,"GeneratorFunction")),e.prototype=Object.create(O),e},t.awrap=function(e){return{__await:e}},S(x.prototype),u(x.prototype,l,function(){return this}),t.AsyncIterator=x,t.async=function(e,n,r,a,o){void 0===o&&(o=Promise);var i=new x(c(e,n,r,a),o);return t.isGeneratorFunction(n)?i:i.next().then(function(e){return e.done?e.value:i.next()})},S(O),u(O,s,"Generator"),u(O,i,function(){return this}),u(O,"toString",function(){return"[object Generator]"}),t.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},t.values=A,I.prototype={constructor:I,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(D),!t)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function a(r,a){return l.type="throw",l.arg=t,n.next=r,a&&(n.method="next",n.arg=e),!!a}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],l=i.completion;if("root"===i.tryLoc)return a("end");if(i.tryLoc<=this.prev){var s=r.call(i,"catchLoc"),u=r.call(i,"finallyLoc");if(s&&u){if(this.prev<i.catchLoc)return a(i.catchLoc,!0);if(this.prev<i.finallyLoc)return a(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return a(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return a(i.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,v):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),v},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),D(n),v}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var a=r.arg;D(n)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:A(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),v}},t}t.default=Object(s.b)(function(e){return{user:e.user,univ:e.univ}},{})(function(e){var t=Object(o.useState)(""),n=Object(a.a)(t,2),s=n[0],y=n[1],k=Object(o.useState)(""),x=Object(a.a)(k,2),j=(x[0],x[1],Object(o.useState)(E()().subtract(7,"days").format("DD/MM/YYYY"))),M=Object(a.a)(j,2),L=M[0],D=M[1],I=Object(o.useState)(E()().format("DD/MM/YYYY")),A=Object(a.a)(I,2),N=A[0],P=A[1],V=Object(o.useState)(!1),_=Object(a.a)(V,2),F=_[0],T=_[1],Y=Object(o.useState)([]),B=Object(a.a)(Y,2),R=B[0],z=B[1],H=Object(o.useState)([]),G=Object(a.a)(H,2),U=(G[0],G[1]),X=Object(o.useState)([]),q=Object(a.a)(X,2),W=q[0],J=q[1],Z=Object(o.useContext)(O.a),K=Z.err_msg,Q=(Z.load,Object(a.a)(K,2)),$=Q[0],ee=Q[1],te=Object(o.useState)(""),ne=Object(a.a)(te,2),re=ne[0],ae=ne[1];Object(o.useEffect)(function(){function e(){return(e=Object(r.a)(C().mark(function e(){return C().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}},e)}))).apply(this,arguments)}!function(){e.apply(this,arguments)}(),oe()},[]);var oe=function(){var t=Object(r.a)(C().mark(function t(){var n,r,a,o;return C().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,l.a.get("/app.php",{params:{a:"getunivmcf",univcode:e.user.fcuruniv}});case 2:if("object"===typeof(n=t.sent).data){t.next=9;break}return r={header:"Error",content:"Something went wrong"},Object(b.A)(r),t.abrupt("return");case 9:if(0!==n.data.error_code){t.next=16;break}return U(n.data.data),a=n.data.data.map(function(e,t){return{key:e.funivcode,value:e.funivcode,text:e.funivcode+"-"+e.funivname}}),J(a),t.abrupt("return");case 16:return o={header:"Error",content:n.data.data.msg},Object(b.A)(o),t.abrupt("return");case 19:case"end":return t.stop()}},t)}));return function(){return t.apply(this,arguments)}}(),ie={n:"[0-1]",m:"[0-9]",e:"[0-3]",d:"[0-9]",z:"[1-2]",y:"[0-9]"},le=function(){var e=Object(r.a)(C().mark(function e(){return C().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:y(""),D(E()().subtract(7,"days").format("DD/MM/YYYY")),P(E()().format("DD/MM/YYYY")),T(!1);case 4:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),se=function(){var t=Object(r.a)(C().mark(function t(){var n,r,a;return C().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(""!=s){t.next=3;break}return ee({type:"OPEN_MSG_BOX",payload:{header:"Error",message:"Enter University..!"}}),t.abrupt("return");case 3:if(!1!==F){t.next=6;break}return ee({type:"OPEN_MSG_BOX",payload:{header:"Error",message:"Submit and Select the applications..!"}}),t.abrupt("return");case 6:return t.next=8,l.a.post("/app.php?a=savemcfverify&univcode="+e.univ.funivcode,{data:{savemcf:R,univcodemcf:s,user:e.user.fname}});case 8:if("object"===typeof(n=t.sent).data){t.next=15;break}return r={header:"Error",content:"Something went wrong"},Object(b.A)(r),t.abrupt("return");case 15:if(0!==n.data.error_code){t.next=22;break}return ee({type:"OPEN_MSG_BOX",payload:{header:"Success",message:n.data.data.msg}}),t.next=19,le();case 19:return t.abrupt("return");case 22:return a={header:"Error",content:n.data.data.msg},Object(b.A)(a),t.abrupt("return");case 25:case"end":return t.stop()}},t)}));return function(){return t.apply(this,arguments)}}(),ue=function(){var t=Object(r.a)(C().mark(function t(n,r){var a,o,i;return C().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(""!=s){t.next=3;break}return ee({type:"OPEN_MSG_BOX",payload:{header:"Error",message:"Select University..!"}}),t.abrupt("return");case 3:return T(!0),t.next=6,l.a.get("/app.php",{params:{a:"getmcfsubmit",univcode:e.user.fcuruniv,univcodemcf:s,datefrom:L,dateto:N}});case 6:if("object"===typeof(a=t.sent).data){t.next=13;break}return o={header:"Error",content:"Something went wrong"},Object(b.A)(o),t.abrupt("return");case 13:if(0!==a.data.error_code){t.next=19;break}return z(a.data.data),T(!0),t.abrupt("return");case 19:return i={header:"Error",content:a.data.data.msg},z([]),Object(b.A)(i),t.abrupt("return");case 23:case"end":return t.stop()}},t)}));return function(e,n){return t.apply(this,arguments)}}();return i.a.createElement(i.a.Fragment,null,i.a.createElement(u.a,{size:"mini",open:$.open,dimmer:"inverted",style:{height:"180px"}},i.a.createElement(u.a.Header,{style:{backgroundColor:$.color,color:"#fff"}},$.header),i.a.createElement(u.a.Content,null,i.a.createElement("div",{dangerouslySetInnerHTML:{__html:$.message}})),i.a.createElement(u.a.Actions,null,i.a.createElement(c.a,{positive:!0,onClick:function(){return ee({type:"CLOSE_MSG_BOX"})}},"OK"))),i.a.createElement("div",{className:"animated fadeIn"},i.a.createElement(f.a,{fluid:!0,style:{minHeight:"82vh"}},i.a.createElement(f.a.Content,null,i.a.createElement(f.a.Header,{style:{display:"flex"},className:"sticky"},i.a.createElement("h4",null,"Verify Application"),i.a.createElement("div",{className:"ml-auto"},i.a.createElement(c.a,{basic:!0,color:"green",content:"Verify",icon:"file",onClick:function(){se()}}),i.a.createElement(c.a,{basic:!0,color:"blue",content:"Pending Report",icon:"file",onClick:function(){!function(){var t=e.user.fcuruniv;window.open(S.c+"mcfpendingReport&univcode="+t+"&datefrom="+L+"&dateto="+N,"_blank")}()}}),i.a.createElement(c.a,{basic:!0,color:"black",content:"cancel",icon:"cancel",onClick:function(){le()}}),i.a.createElement(g.a,{to:"/dashboard"},i.a.createElement(c.a,{basic:!0,color:"red",content:"Exit",icon:"home"})))),i.a.createElement(p.a,null),i.a.createElement("div",{className:"col-md-6"},i.a.createElement(h.a,null,i.a.createElement(h.a.Field,{width:16},i.a.createElement("label",null,"University"),i.a.createElement(m.a,{placeholder:"Select University",name:"univcode",value:s,selection:!0,search:!0,options:W,onChange:function(e,t){y(t.value)}})),i.a.createElement(h.a.Group,null,i.a.createElement(h.a.Field,{width:8},i.a.createElement("label",null," Date Range "),i.a.createElement(w.a,{formatChars:ie,type:"text",value:L,mask:"ed/nm/zyyy",placeholder:"Date From",name:"datefrom",onChange:function(e){return D(e.target.value)}})),i.a.createElement(h.a.Field,{width:8},i.a.createElement(w.a,{formatChars:ie,type:"text",value:N,mask:"ed/nm/zyyy",placeholder:"To",name:"dateto",onChange:function(e){return P(e.target.value)},style:{marginTop:"1.6em"}}))),i.a.createElement(c.a,{color:"blue",onClick:function(e,t){return ue(e,t)}},"Submit"))),1==F?i.a.createElement("div",{className:"ui mini form"},i.a.createElement(d.a,{className:"stickymcf",celled:!0,padded:!0,selectable:!0,structured:!0,size:"small",color:"olive",style:{marginTop:"25px"}},i.a.createElement(d.a.Header,{style:{fontSize:"1.2em"}},i.a.createElement(d.a.Row,null,i.a.createElement(d.a.HeaderCell,{style:{width:"3%"},singleLine:!0,textAlign:"center"},i.a.createElement("label",null,"Sl. No.")),i.a.createElement(d.a.HeaderCell,{style:{width:"5%"},textAlign:"center"},i.a.createElement("label",null,"Log SL No.")),i.a.createElement(d.a.HeaderCell,{style:{width:"5%"},textAlign:"center"},i.a.createElement("label",null,"Company Name")),i.a.createElement(d.a.HeaderCell,{style:{width:"12%"},textAlign:"center"},i.a.createElement("label",null,"Log Name")),i.a.createElement(d.a.HeaderCell,{style:{width:"20%"},textAlign:"center"},i.a.createElement("label",null,"Remarks")),i.a.createElement(d.a.HeaderCell,{style:{width:"7%"},textAlign:"center"},i.a.createElement("label",null,"Host Name")),i.a.createElement(d.a.HeaderCell,{style:{width:"7%"},textAlign:"center"},i.a.createElement("label",null,"Client ID")),i.a.createElement(d.a.HeaderCell,{style:{width:"7%"},textAlign:"center"},i.a.createElement("label",null,"DB Name")),i.a.createElement(d.a.HeaderCell,{style:{width:"7%"},textAlign:"center"},i.a.createElement("label",null,"Date")),i.a.createElement(d.a.HeaderCell,{style:{width:"3%"},textAlign:"center"},i.a.createElement("label",null,"Select"),i.a.createElement("div",{className:"checkbox"},i.a.createElement("input",{type:"checkbox",name:"chkall",onChange:function(e){return function(e){var t=R.map(function(t){return t.fverifystatus=e?"T":"F",t});ae(1==e?"T":"F"),z(t)}(e.target.checked)},value:re,checked:"T"==re}))))),i.a.createElement(d.a.Body,null,R.map(function(e,t){return i.a.createElement(d.a.Row,{key:e.fslno},i.a.createElement(d.a.Cell,{textAlign:"center",style:{fontSize:"1.2em"}},t+1),i.a.createElement(d.a.Cell,{textAlign:"center",style:{fontSize:"1.2em"}},e.fslno),i.a.createElement(d.a.Cell,{textAlign:"center",style:{fontSize:"1.2em"}},e.fcompname),i.a.createElement(d.a.Cell,{textAlign:"left",style:{fontSize:"1.2em"}},e.flogname),i.a.createElement(d.a.Cell,{textAlign:"left",style:{fontSize:"1.2em"}},e.fremarks),i.a.createElement(d.a.Cell,{textAlign:"center",style:{fontSize:"1.2em"}},e.fhostname),i.a.createElement(d.a.Cell,{textAlign:"center",style:{fontSize:"1.2em"}},e.fclientid),i.a.createElement(d.a.Cell,{textAlign:"center",style:{fontSize:"1.2em"}},e.fdbname),i.a.createElement(d.a.Cell,{textAlign:"center",style:{fontSize:"1.2em"}},e.fdate),i.a.createElement(d.a.Cell,{textAlign:"center",style:{fontSize:"1.2em",padding:"0.4em"}},"Verified"==e.fstatus,i.a.createElement(v.a,{onChange:function(t,n){return function(e,t){var n=R.map(function(n){return t==n.fslno&&(n.fverifystatus=e?"T":"F"),n});z(n)}(n.checked,e.fslno)},value:e.fverifystatus,checked:"T"==e.fverifystatus})))})))):null))))})},275:function(e,t,n){e.exports=n(276)},276:function(e,t,n){"use strict";var r,a=(r=n(2))&&"object"==typeof r&&"default"in r?r.default:r,o=n(106);function i(){return(i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function l(e,t){e.prototype=Object.create(t.prototype),function(e,t){for(var n=Object.getOwnPropertyNames(t),r=0;r<n.length;r++){var a=n[r],o=Object.getOwnPropertyDescriptor(t,a);o&&o.configurable&&void 0===e[a]&&Object.defineProperty(e,a,o)}}(e.prototype.constructor=e,t)}function s(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var u=function(e,t,n,r,a,o,i,l){if(!e){var s;if(void 0===t)s=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var u=[n,r,a,o,i,l],c=0;(s=new Error(t.replace(/%s/g,function(){return u[c++]}))).name="Invariant Violation"}throw s.framesToPop=1,s}};function c(e,t,n){if("selectionStart"in e&&"selectionEnd"in e)e.selectionStart=t,e.selectionEnd=n;else{var r=e.createTextRange();r.collapse(!0),r.moveStart("character",t),r.moveEnd("character",n-t),r.select()}}var f={9:"[0-9]",a:"[A-Za-z]","*":"[A-Za-z0-9]"},p="_";function h(e,t,n){var r="",a="",o=null,i=[];if(void 0===t&&(t=p),null==n&&(n=f),!e||"string"!=typeof e)return{maskChar:t,formatChars:n,mask:null,prefix:null,lastEditablePosition:null,permanents:[]};var l=!1;return e.split("").forEach(function(e){l=!l&&"\\"===e||(l||!n[e]?(i.push(r.length),r.length===i.length-1&&(a+=e)):o=r.length+1,r+=e,!1)}),{maskChar:t,formatChars:n,prefix:a,mask:r,lastEditablePosition:o,permanents:i}}function m(e,t){return-1!==e.permanents.indexOf(t)}function d(e,t,n){var r=e.mask,a=e.formatChars;if(!n)return!1;if(m(e,t))return r[t]===n;var o=a[r[t]];return new RegExp(o).test(n)}function v(e,t){return t.split("").every(function(t,n){return m(e,n)||!d(e,n,t)})}function g(e,t){var n=e.maskChar,r=e.prefix;if(!n){for(;t.length>r.length&&m(e,t.length-1);)t=t.slice(0,t.length-1);return t.length}for(var a=r.length,o=t.length;o>=r.length;o--){var i=t[o];if(!m(e,o)&&d(e,o,i)){a=o+1;break}}return a}function y(e,t){return g(e,t)===e.mask.length}function w(e,t){var n=e.maskChar,r=e.mask,a=e.prefix;if(!n){for((t=b(e,"",t,0)).length<a.length&&(t=a);t.length<r.length&&m(e,t.length);)t+=r[t.length];return t}if(t)return b(e,w(e,""),t,0);for(var o=0;o<r.length;o++)m(e,o)?t+=r[o]:t+=n;return t}function b(e,t,n,r){var a=e.mask,o=e.maskChar,i=e.prefix,l=n.split(""),s=y(e,t);return!o&&r>t.length&&(t+=a.slice(t.length,r)),l.every(function(n){for(;c=n,m(e,u=r)&&c!==a[u];){if(r>=t.length&&(t+=a[r]),l=n,o&&m(e,r)&&l===o)return!0;if(++r>=a.length)return!1}var l,u,c;return!d(e,r,n)&&n!==o||(r<t.length?t=o||s||r<i.length?t.slice(0,r)+n+t.slice(r+1):(t=t.slice(0,r)+n+t.slice(r),w(e,t)):o||(t+=n),++r<a.length)}),t}function k(e,t){for(var n=e.mask,r=t;r<n.length;++r)if(!m(e,r))return r;return null}function E(e){return e||0===e?e+"":""}function O(e,t,n,r,a){var o=e.mask,i=e.prefix,l=e.lastEditablePosition,s=t,u="",c=0,f=0,p=Math.min(a.start,n.start);return n.end>a.start?f=(c=function(e,t,n,r){var a=e.mask,o=e.maskChar,i=n.split(""),l=r;return i.every(function(t){for(;i=t,m(e,n=r)&&i!==a[n];)if(++r>=a.length)return!1;var n,i;return(d(e,r,t)||t===o)&&r++,r<a.length}),r-l}(e,0,u=s.slice(a.start,n.end),p))?a.length:0:s.length<r.length&&(f=r.length-s.length),s=r,f&&(1!==f||a.length||(p=a.start===n.start?k(e,n.start):function(e,t){for(var n=t;0<=n;--n)if(!m(e,n))return n;return null}(e,n.start)),s=function(e,t,n,r){var a=n+r,o=e.maskChar,i=e.mask,l=e.prefix,s=t.split("");if(o)return s.map(function(t,r){return r<n||a<=r?t:m(e,r)?i[r]:o}).join("");for(var u=a;u<s.length;u++)m(e,u)&&(s[u]="");return n=Math.max(l.length,n),s.splice(n,a-n),t=s.join(""),w(e,t)}(e,s,p,f)),s=b(e,s,u,p),(p+=c)>=o.length?p=o.length:p<i.length&&!c?p=i.length:p>=i.length&&p<l&&c&&(p=k(e,p)),u||(u=null),{value:s=w(e,s),enteredString:u,selection:{start:p,end:p}}}function S(e){return"function"==typeof e}function C(){return window.cancelAnimationFrame||window.webkitCancelRequestAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame}function x(e){return(C()?window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame:function(){return setTimeout(e,1e3/60)})(e)}function j(e){(C()||clearTimeout)(e)}var M=function(e){function t(t){var n=e.call(this,t)||this;n.focused=!1,n.mounted=!1,n.previousSelection=null,n.selectionDeferId=null,n.saveSelectionLoopDeferId=null,n.saveSelectionLoop=function(){n.previousSelection=n.getSelection(),n.saveSelectionLoopDeferId=x(n.saveSelectionLoop)},n.runSaveSelectionLoop=function(){null===n.saveSelectionLoopDeferId&&n.saveSelectionLoop()},n.stopSaveSelectionLoop=function(){null!==n.saveSelectionLoopDeferId&&(j(n.saveSelectionLoopDeferId),n.saveSelectionLoopDeferId=null,n.previousSelection=null)},n.getInputDOMNode=function(){if(!n.mounted)return null;var e=o.findDOMNode(s(s(n))),t="undefined"!=typeof window&&e instanceof window.Element;if(e&&!t)return null;if("INPUT"!==e.nodeName&&(e=e.querySelector("input")),!e)throw new Error("react-input-mask: inputComponent doesn't contain input node");return e},n.getInputValue=function(){var e=n.getInputDOMNode();return e?e.value:null},n.setInputValue=function(e){var t=n.getInputDOMNode();t&&(n.value=e,t.value=e)},n.setCursorToEnd=function(){var e=g(n.maskOptions,n.value),t=k(n.maskOptions,e);null!==t&&n.setCursorPosition(t)},n.setSelection=function(e,t,r){void 0===r&&(r={});var a=n.getInputDOMNode(),o=n.isFocused();a&&o&&(r.deferred||c(a,e,t),null!==n.selectionDeferId&&j(n.selectionDeferId),n.selectionDeferId=x(function(){n.selectionDeferId=null,c(a,e,t)}),n.previousSelection={start:e,end:t,length:Math.abs(t-e)})},n.getSelection=function(){return function(e){var t=0,n=0;if("selectionStart"in e&&"selectionEnd"in e)t=e.selectionStart,n=e.selectionEnd;else{var r=document.selection.createRange();r.parentElement()===e&&(t=-r.moveStart("character",-e.value.length),n=-r.moveEnd("character",-e.value.length))}return{start:t,end:n,length:n-t}}(n.getInputDOMNode())},n.getCursorPosition=function(){return n.getSelection().start},n.setCursorPosition=function(e){n.setSelection(e,e)},n.isFocused=function(){return n.focused},n.getBeforeMaskedValueChangeConfig=function(){var e=n.maskOptions,t=e.mask,r=e.maskChar,a=e.permanents,o=e.formatChars;return{mask:t,maskChar:r,permanents:a,alwaysShowMask:!!n.props.alwaysShowMask,formatChars:o}},n.isInputAutofilled=function(e,t,r,a){var o=n.getInputDOMNode();try{if(o.matches(":-webkit-autofill"))return!0}catch(u){}return!n.focused||a.end<r.length&&t.end===e.length},n.onChange=function(e){var t=s(s(n)).beforePasteState,r=s(s(n)).previousSelection,a=n.props.beforeMaskedValueChange,o=n.getInputValue(),i=n.value,l=n.getSelection();n.isInputAutofilled(o,l,i,r)&&(i=w(n.maskOptions,""),r={start:0,end:0,length:0}),t&&(r=t.selection,i=t.value,l={start:r.start+o.length,end:r.start+o.length,length:0},o=i.slice(0,r.start)+o+i.slice(r.end),n.beforePasteState=null);var u=O(n.maskOptions,o,l,i,r),c=u.enteredString,f=u.selection,p=u.value;if(S(a)){var h=a({value:p,selection:f},{value:i,selection:r},c,n.getBeforeMaskedValueChangeConfig());p=h.value,f=h.selection}n.setInputValue(p),S(n.props.onChange)&&n.props.onChange(e),n.isWindowsPhoneBrowser?n.setSelection(f.start,f.end,{deferred:!0}):n.setSelection(f.start,f.end)},n.onFocus=function(e){var t=n.props.beforeMaskedValueChange,r=n.maskOptions,a=r.mask,o=r.prefix;if(n.focused=!0,n.mounted=!0,a){if(n.value)g(n.maskOptions,n.value)<n.maskOptions.mask.length&&n.setCursorToEnd();else{var i=w(n.maskOptions,o),l=w(n.maskOptions,i),s=g(n.maskOptions,l),u=k(n.maskOptions,s),c={start:u,end:u};if(S(t)){var f=t({value:l,selection:c},{value:n.value,selection:null},null,n.getBeforeMaskedValueChangeConfig());l=f.value,c=f.selection}var p=l!==n.getInputValue();p&&n.setInputValue(l),p&&S(n.props.onChange)&&n.props.onChange(e),n.setSelection(c.start,c.end)}n.runSaveSelectionLoop()}S(n.props.onFocus)&&n.props.onFocus(e)},n.onBlur=function(e){var t=n.props.beforeMaskedValueChange,r=n.maskOptions.mask;if(n.stopSaveSelectionLoop(),n.focused=!1,r&&!n.props.alwaysShowMask&&v(n.maskOptions,n.value)){var a="";S(t)&&(a=t({value:a,selection:null},{value:n.value,selection:n.previousSelection},null,n.getBeforeMaskedValueChangeConfig()).value);var o=a!==n.getInputValue();o&&n.setInputValue(a),o&&S(n.props.onChange)&&n.props.onChange(e)}S(n.props.onBlur)&&n.props.onBlur(e)},n.onMouseDown=function(e){if(!n.focused&&document.addEventListener){n.mouseDownX=e.clientX,n.mouseDownY=e.clientY,n.mouseDownTime=(new Date).getTime();document.addEventListener("mouseup",function e(t){if(document.removeEventListener("mouseup",e),n.focused){var r=Math.abs(t.clientX-n.mouseDownX),a=Math.abs(t.clientY-n.mouseDownY),o=Math.max(r,a),i=(new Date).getTime()-n.mouseDownTime;(o<=10&&i<=200||o<=5&&i<=300)&&n.setCursorToEnd()}})}S(n.props.onMouseDown)&&n.props.onMouseDown(e)},n.onPaste=function(e){S(n.props.onPaste)&&n.props.onPaste(e),e.defaultPrevented||(n.beforePasteState={value:n.getInputValue(),selection:n.getSelection()},n.setInputValue(""))},n.handleRef=function(e){null==n.props.children&&S(n.props.inputRef)&&n.props.inputRef(e)};var r=t.mask,a=t.maskChar,i=t.formatChars,l=t.alwaysShowMask,u=t.beforeMaskedValueChange,f=t.defaultValue,p=t.value;n.maskOptions=h(r,a,i),null==f&&(f=""),null==p&&(p=f);var m=E(p);if(n.maskOptions.mask&&(l||m)&&(m=w(n.maskOptions,m),S(u))){var d=t.value;null==t.value&&(d=f),m=u({value:m,selection:null},{value:d=E(d),selection:null},null,n.getBeforeMaskedValueChangeConfig()).value}return n.value=m,n}l(t,e);var n=t.prototype;return n.componentDidMount=function(){this.mounted=!0,this.getInputDOMNode()&&(this.isWindowsPhoneBrowser=function(){var e=new RegExp("windows","i"),t=new RegExp("phone","i"),n=navigator.userAgent;return e.test(n)&&t.test(n)}(),this.maskOptions.mask&&this.getInputValue()!==this.value&&this.setInputValue(this.value))},n.componentDidUpdate=function(){var e=this.previousSelection,t=this.props,n=t.beforeMaskedValueChange,r=t.alwaysShowMask,a=t.mask,o=t.maskChar,i=t.formatChars,l=this.maskOptions,s=r||this.isFocused(),u=null!=this.props.value,c=u?E(this.props.value):this.value,f=e?e.start:null;if(this.maskOptions=h(a,o,i),this.maskOptions.mask){!l.mask&&this.isFocused()&&this.runSaveSelectionLoop();var p=this.maskOptions.mask&&this.maskOptions.mask!==l.mask;if(l.mask||u||(c=this.getInputValue()),(p||this.maskOptions.mask&&(c||s))&&(c=w(this.maskOptions,c)),p){var m=g(this.maskOptions,c);(null===f||m<f)&&(f=y(this.maskOptions,c)?m:k(this.maskOptions,m))}!this.maskOptions.mask||!v(this.maskOptions,c)||s||u&&this.props.value||(c="");var d={start:f,end:f};if(S(n)){var b=n({value:c,selection:d},{value:this.value,selection:this.previousSelection},null,this.getBeforeMaskedValueChangeConfig());c=b.value,d=b.selection}this.value=c;var O=this.getInputValue()!==this.value;O?(this.setInputValue(this.value),this.forceUpdate()):p&&this.forceUpdate();var C=!1;null!=d.start&&null!=d.end&&(C=!e||e.start!==d.start||e.end!==d.end),(C||O)&&this.setSelection(d.start,d.end)}else l.mask&&(this.stopSaveSelectionLoop(),this.forceUpdate())},n.componentWillUnmount=function(){this.mounted=!1,null!==this.selectionDeferId&&j(this.selectionDeferId),this.stopSaveSelectionLoop()},n.render=function(){var e,t=this.props,n=(t.mask,t.alwaysShowMask,t.maskChar,t.formatChars,t.inputRef,t.beforeMaskedValueChange,t.children),r=function(e,t){if(null==e)return{};var n,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],0<=t.indexOf(n)||(a[n]=e[n]);return a}(t,["mask","alwaysShowMask","maskChar","formatChars","inputRef","beforeMaskedValueChange","children"]);if(n){S(n)||u(!1);var o=["onChange","onPaste","onMouseDown","onFocus","onBlur","value","disabled","readOnly"],l=i({},r);o.forEach(function(e){return delete l[e]}),e=n(l),o.filter(function(t){return null!=e.props[t]&&e.props[t]!==r[t]}).length&&u(!1)}else e=a.createElement("input",i({ref:this.handleRef},r));var s={onFocus:this.onFocus,onBlur:this.onBlur};return this.maskOptions.mask&&(r.disabled||r.readOnly||(s.onChange=this.onChange,s.onPaste=this.onPaste,s.onMouseDown=this.onMouseDown),null!=r.value&&(s.value=this.value)),e=a.cloneElement(e,s)},t}(a.Component);e.exports=M}}]);
//# sourceMappingURL=214.cda02b90.chunk.js.map
|