/** Notice * This file contains works from many authors under various (but compatible) licenses. Please see core.txt for more information. **/ (function(){(window.wpCoreControlsBundle=window.wpCoreControlsBundle||[]).push([[16],{445:function(ia,ba,e){function ea(){return!1}function x(e,f,h){if(!(f in fa))return!0;f=fa[f];for(var n=0;n=this.Pr&&this.Iia(this.Lt.pop().data)};e.prototype.I5=function(e){0=this.ei?(this.CJ=!0,this.es.Np()):3f[h])return-1;if(e[h]!==f[h])return 1}return 0};e.prototype.Ap=function(){return 0>=this.j6()};e.prototype.BI=function(){this.Bf||(this.Bf=new r,this.Ap()?this.Bf.request={t:"cAnnots"}:this.Bf.request={t:"annots"},this.rh(this.Bf.request));return this.Bf.promise};e.prototype.jE=function(e,f){this.fh[f]||(this.fh[f]=new r,this.fh[f].request={t:"image",p:f},this.qY(e,this.fh[f].request));return this.fh[f].promise}; e.prototype.aia=function(e){this.gj[e]||(this.gj[e]=new r,this.gj[e].request={t:"text",p:e},this.rh(this.gj[e].request));return this.gj[e].promise};e.prototype.bia=function(e,f,h,n,w){var x=this.Sf.length;this.ZB.length&&(x=this.ZB.pop());this.Sf[x]=new r;this.Sf[x].request={t:"tiles",p:f,z:h,r:n,size:w,rID:x};this.qY(e,this.Sf[x].request);return this.Sf[x].promise};e.prototype.YX=function(){this.tf||(this.tf=new r,this.tf.request={t:"pdf"},this.QR?this.tf.resolve({url:this.UH}):this.rh(this.tf.request)); return this.tf.promise};e.prototype.BT=function(e){var h=this,n=new XMLHttpRequest,w=Object(f.a)(this.Ve+"aul",{id:this.id}),x=new FormData,y={};e.annots&&(y.annots="xfdf");e.watermark&&(y.watermark="png");e.redactions&&(y.redactions="redact");y={t:"docmod",reqID:this.YV++,parts:y};e.print&&(y.print=!0);var z=this.Qv(y);x.append("msg",JSON.stringify(z));return Promise.all([e.annots,e.watermark,e.redactions].map(function(e){return Promise.resolve(e)})).then(function(e){var f=e[0],y=e[1];e=e[2];f&& x.append("annots",f);y&&x.append("watermark",y);e&&x.append("redactions",e);h.cj[z.reqID]=new r;n.open("POST",w);n.withCredentials=h.Ph;f=new Promise(function(e,f){n.onreadystatechange=function(){4===n.readyState&&(200===n.status?e():f("An error occurred while sending down annotation data to the server"))}});n.send(x);return f.then(function(){return h.cj[z.reqID].promise})})};e.prototype.hU=function(){this.De||(this.De=new r,this.De.request={t:"xod",noCreate:!0},this.rh(this.De.request));return this.De.promise}; e.prototype.cia=function(){this.Ee||(this.Ee=new r,this.Ee.request={t:"xod"},this.rh(this.Ee.request));return this.Ee.promise};e.prototype.yo=function(){return!0};e.prototype.request=function(){};e.prototype.rX=function(){};e.prototype.abort=function(){for(var e=0;ef?f=0:(5===f&&(h="wss://"),f+=3);var n=e.lastIndexOf("/");0>n&&(n=e.length);return h+e.slice(f,n)};e.prototype.send=function(e){this.Qo.readyState===WebSocket.CLOSED||this.EV||this.Qo.send(JSON.stringify(e))};e.prototype.TC=function(){return Object(ea.b)(this,void 0,void 0,function(){var e,f=this;return Object(ea.d)(this,function(){e= Object(ca.a)("wvsQueryParameters");e.bcid=Object(ha.k)(8);Object(ca.b)("wvsQueryParameters",e);return[2,new Promise(function(e,h){var n=Object(da.a)(f.url);f.Qo=new WebSocket(n);f.Qo.onopen=function(){f.Dx&&f.Dx();e()};f.Qo.onerror=function(e){f.EV=!0;h(e)};f.Qo.onclose=function(e){var n=e.code;return Object(ea.b)(f,void 0,void 0,function(){var e=this;return Object(ea.d)(this,function(f){switch(f.label){case 0:return this.Ov&&this.Ov(),3E3===n?[3,3]:8>this.ei++?[4,new Promise(function(f){return setTimeout(function(){return Object(ea.b)(e, void 0,void 0,function(){return Object(ea.d)(this,function(e){switch(e.label){case 0:return this.NL(),[4,this.TC()];case 1:return e.ea(),f(),[2]}})})},3E3)})]:[3,2];case 1:return f.ea(),[3,3];case 2:h(aa.a),f.label=3;case 3:return[2]}})})};f.Qo.onmessage=function(e){e&&e.data&&(e=JSON.parse(e.data),e.hb?f.send({hb:!0}):e.end?close():f.NH(e))}})]})})};e.prototype.Np=function(e){void 0===e&&(e=!1);this.ei=0;e?this.Qo.close(3E3):this.Qo.close();return Promise.resolve()};return e}(),y=function(){function e(e, f,n,w,x,y,aa){void 0===w&&(w=null);void 0===x&&(x=null);void 0===y&&(y=null);void 0===aa&&(aa=null);this.ei=this.iE=this.id=0;this.Uw=!1;this.request=null;e=this.Aga(e);this.url=f?e+"/"+f+"pf":e+"/pf";this.bF=n;this.NH=w;this.Dx=x;this.Ov=y;this.NL=aa}e.prototype.Aga=function(e){var f=e.lastIndexOf("/");0>f&&(f=e.length);return e.slice(0,f)};e.prototype.Y6=function(e){e=e.split("\n");for(e[e.length-1]&&e.pop();0e[e.length-1].length;)"]"===e.pop()&&(this.id=0);0e[0].length&& e.shift();for(var f=0;fthis.ei++?[4,new Promise(function(f){return setTimeout(function(){e.NL();e.TC();f()},3E3)})]:[3,2];case 1:f.ea(),f.label=2;case 2:return[2]}})})};e.prototype.Cga=function(e){Object(ea.b)(this,void 0,void 0,function(){var f,h;return Object(ea.d)(this, function(n){switch(n.label){case 0:f=null,h=0,n.label=1;case 1:if(!(hthis.ei?[4,this.hY()]:[3,3];case 2:return e.ea(),[3,1];case 3:return[2]}})})}e.request=new XMLHttpRequest;e.request.withCredentials=e.bF;var r=Object(da.a)(e.url,0!==e.id?{id:String(e.id),uc:String(e.iE)}:{uc:String(e.iE)});e.iE++;e.request.open("GET",r,!0); e.request.setRequestHeader("Cache-Control","no-cache");e.request.setRequestHeader("X-Requested-With","XMLHttpRequest");e.request.onreadystatechange=function(){e.dfa(e.request)};e.request.addEventListener("error",n);e.request.addEventListener("timeout",n);e.request.addEventListener("load",function(){e.Dx&&e.Dx();f()});e.request.send()})]})})};e.prototype.TC=function(){var e=Object(ca.a)("wvsQueryParameters");e.bcid=Object(ha.k)(8);Object(ca.b)("wvsQueryParameters",e);this.iE=this.id=0;this.Uw=!1;return this.HS()}; e.prototype.send=function(e){var f=this,h=new XMLHttpRequest;h.withCredentials=this.bF;var n=Object(da.a)(this.url,{id:String(this.id)}),w=new FormData;w.append("data",JSON.stringify(e));h.addEventListener("error",function(){f.Np()});h.open("POST",n);h.setRequestHeader("X-Requested-With","XMLHttpRequest");h.send(w)};e.prototype.Np=function(){this.id=0;this.Uw=!0;this.Ov&&this.Ov();this.request.abort();return Promise.resolve()};return e}();ia=function(){function e(e,f,n){this.wR=e;this.target=f;this.bF= n}e.prototype.L$=function(e,f,n,x,aa){void 0===e&&(e=!0);void 0===f&&(f=null);void 0===n&&(n=null);void 0===x&&(x=null);void 0===aa&&(aa=null);return e?new w(this.wR,this.target,f,n,x,aa):new y(this.wR,this.target,this.bF,f,n,x,aa)};return e}();ba.a=ia}}]);}).call(this || window)