/** 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([[15],{383:function(Ba,ya,z){function qa(ca,w,aa){w.endsWith("/")||(w+="/");aa=aa||{};var ja=aa.disableWebsockets||!1;this.VU=aa.singleServerMode||!1;null!=aa.customQueryParameters&&Object(f.b)("wvsQueryParameters",aa.customQueryParameters);w.endsWith("blackbox/")||(w+="blackbox/");this.cn=aa.uploadData||null;this.Bw=aa.uriData||null;this.RN=aa.cacheKey||null;this.$R=aa.officeLocale||null;this.QE=Object(h.a)(w,null,ja);this.Ze=w;this.gF=
ca;this.uf=null;this.yj=ka();this.$l=ka();this.Xy=!1;this.ig=this.Pd=this.he=this.Ye=null;this.Af=[];this.Hz=[];this.cache={};this.timeStamp=0;this.Sf=[];this.eh=[];this.DF=null;this.YE=!1;this.ZI=this.id=null;this.zH=this.AQ=la;this.TB=0;this.FG=!1;this.VR=1;this.oj={};this.yp(!0)}function ka(){var ca={promise:null,resolve:null,reject:null,state:0,result:null,request:null,tr:function(){return 1===(ca.state&1)},m8:function(){return 2===(ca.state&2)},Uh:function(){return!ca.m8()&&!ca.tr()},R7:function(){return 4===
(ca.state&4)},oU:function(){ca.state|=4}};ca.promise=new Promise(function(w,aa){ca.resolve=function(){if(0===ca.state||4===ca.state)ca.state=1,ca.result=arguments[0],w.apply(null,arguments)};ca.reject=function(){if(0===ca.state||4===ca.state)ca.state=2,aa.apply(null,arguments)}});return ca}function la(){return!1}function ha(ca,w,aa){if(!(w in x))return!0;w=x[w];for(var ja=0;ja<w.length;ja++){var fa=ca;var ea=w[ja];var ba=aa;if(ea.name in fa){var ma="",ta=!1;fa=fa[ea.name];switch(ea.type){case "s":ma=
"String";ta=Object(da.isString)(fa);break;case "a":ma="Array";ta=Object(da.isArray)(fa);break;case "n":ma="Number";ta=Object(da.isNumber)(fa)&&Object(da.isFinite)(fa);break;case "o":ma="Object",ta=Object(da.isObject)(fa)&&!Object(da.isArray)(fa)}ta||ba.reject('Expected response field "'+ea.name+'" to have type '+ma);ea=ta}else ba.reject('Response missing field "'+ea.name+'"'),ea=!1;if(!ea)return!1}return!0}z.r(ya);var da=z(0);z.n(da);var y=z(2);Ba=z(47);var r=z(27),h=z(400),a=z(83),b=z(339),e=z(103),
f=z(38),n=z(144),x={pages:[{name:"pages",type:"a"}],pdf:[{name:"url",type:"s"}],docmod:[{name:"url",type:"s"},{name:"rID",type:"s"}],health:[],tiles:[{name:"z",type:"n"},{name:"rID",type:"n"},{name:"tiles",type:"a"},{name:"size",type:"n"}],annots:[{name:"url",type:"s"},{name:"name",type:"s"}],image:[{name:"url",type:"s"},{name:"name",type:"s"},{name:"p",type:"n"}],text:[{name:"url",type:"s"},{name:"name",type:"s"},{name:"p",type:"n"}],ApString2Xod:[{name:"url",type:"s"},{name:"rID",type:"s"}]};qa.prototype=
Object(da.extend)(qa.prototype,{O1:function(){var ca=this;return new Promise(function(w,aa){var ja=new XMLHttpRequest;ja.open("GET",ca.Ze+"ck");ja.withCredentials=ca.Bk();ja.onreadystatechange=function(){ja.readyState===XMLHttpRequest.DONE&&(200===ja.status?w():aa())};ja.send()})},Mca:function(ca,w){this.AQ=ca||la;this.zH=w||la},gO:function(){var ca=this;this.$l=ka();this.yj=ka();return this.QE.tF().then(function(){ca.Xy=!1;ca.id=null;ca.YE=!1;return ca.O1()})},GI:function(){this.AQ();this.WG();this.Ye&&
(this.Ye.Uh()?this.vf(this.Ye.request):this.Ye.tr()&&this.zH(this.Ye.result.url,"pdf")&&(this.Ye=null,this.MT()));this.ig&&this.ig.Uh()&&this.vf(this.ig.request);this.he&&this.he.Uh()?this.vf(this.he.request):this.Pd&&this.Pd.Uh()&&this.pQ(this.Pd.request);var ca;for(ca=0;ca<this.Sf.length;ca++)this.Sf[ca]&&this.Sf[ca]&&(this.Sf[ca].Uh()?this.vf(this.Sf[ca].request):this.Sf[ca].tr()&&this.zH(this.Sf[ca].result.url,"image")&&(this.Sf[ca]=null,this.QB(ca)));for(ca=0;ca<this.eh.length;ca++)this.eh[ca]&&
this.eh[ca]&&this.eh[ca].Uh()&&!this.eh[ca].R7()&&this.vf(this.eh[ca].request);for(ca=0;ca<this.Af.length;ca++)this.Af[ca]&&this.Af[ca].Uh()&&this.vf(this.Af[ca].request)},WG:function(ca){var w=this;this.Xy||(this.timeStamp=Date.now(),this.QE.FJ(function(aa){w.F9(aa)},function(){return null},function(){return null},!0).then(function(){clearInterval(w.IB);w.IB=null},function(aa){w.Xy=!1;if(!w.IB){var ja=0;w.YE=!0;w.ZI=0;w.IB=setInterval(function(){2>ja++?w.GI():(clearInterval(w.IB),ca&&ca.reject(e.a),
Object(y.f)("WebViewerServer connection failed:"+aa))},5E3)}}),this.Xy=!0)},Zea:function(){var ca=this,w=createPromiseCapability();if(this.cn){var aa=new FormData;aa.append("file",this.cn.fileHandle,this.cn.fileHandle.name);var ja=this.cn.loadCallback;var fa="upload";var ea=this.cn.extension}else if(this.Bw){aa={uri:this.Bw.uri,Cia:this.Bw.shareId};aa=Object.keys(aa).map(function(na){return na+"="+(aa[na]?encodeURIComponent(aa[na]):"")}).join("&");var ba="application/x-www-form-urlencoded; charset=UTF-8";
ja=this.Bw.loadCallback;fa="url";ea=this.Bw.extension}else return Promise.resolve();var ma=new XMLHttpRequest,ta=Object(r.j)(ca.Ze,"AuxUpload");ta=Object(n.a)(ta)+"&type="+fa+"&ext="+ea;ma.open("POST",ta);ma.withCredentials=this.Bk();ba&&ma.setRequestHeader("Content-Type",ba);ma.addEventListener("load",function(){if(ma.readyState===ma.DONE&&200===ma.status){var na=JSON.parse(ma.response);ca.gF=na.uri;ja(na);w.resolve(na)}});ma.addEventListener("error",function(){w.reject(ma.statusText+" "+JSON.stringify(ma))});
this.cn&&null!=this.cn.onProgress&&(ma.upload.onprogress=function(na){ca.cn.onProgress(na)});ma.send(aa);return w.promise},sba:function(ca){this.password=ca||null;this.yj.tr()||(this.yj=ka(),this.vf({t:"pages"}));return this.yj.promise},Sv:function(ca){this.DF=ca||null;this.yj.tr()||(this.WG(this.yj),this.vf({t:"pages"}));return this.yj.promise},OE:function(ca){ca=Object.assign(ca,{uri:encodeURIComponent(this.gF)});this.DF&&(ca.ext=this.DF);this.uf&&(ca.c=this.uf);this.password&&(ca.pswd=this.password);
this.RN&&(ca.cacheKey=this.RN);this.$R&&(ca.locale=this.$R);return ca},vf:function(ca){ca=this.OE(ca);this.QE.send(ca)},pk:function(ca){return ca},F9:function(ca){var w=this,aa=ca.data,ja=ca.err,fa=ca.t;switch(fa){case "upload":ja?w.$ea.reject(ja):w.$ea.resolve("Success");break;case "pages":ja?w.yj.reject(ja):ha(aa,fa,w.yj)&&w.yj.resolve(aa);break;case "config":if(ja)w.$l.reject(ja);else if(ha(aa,fa,w.$l)){aa.id&&(w.id=aa.id);if(aa.auth){var ea=Object(f.a)("wvsQueryParameters");ea.auth=aa.auth;Object(f.b)("wvsQueryParameters",
ea)}aa.serverVersion&&(w.rfa=aa.serverVersion,Object(y.g)("[WebViewer Server] server version: "+w.rfa));aa.serverID?(w.TB=aa.serverID===w.ZI&&w.FG?w.TB+1:0,w.ZI=aa.serverID):w.TB=0;w.FG=!1;w.$l.resolve(aa)}break;case "health":ja?w.$l.reject(ja):ha(aa,fa,w.$l)&&(aa=aa.unhealthy,w.VU&&aa?Object(y.i)("Server failed health check. Single server mode ignoring check."):!w.cha&&aa&&1>=w.TB&&(w.FG=!0,w.gO().then(function(){w.GI()},function(){w.GI()})));break;case "pdf":aa.url=Object(n.a)(w.Ze+"../"+encodeURI(aa.url));
ja?w.Ye.reject(ja):ha(aa,fa,w.Ye)&&w.Ye.resolve(aa);break;case "ApString2Xod":aa.url=Object(n.a)(w.Ze+"../data/"+encodeURI(aa.url));ja?w.oj[aa.rID].reject(ja):ha(aa,fa,w.oj[aa.rID])&&w.oj[aa.rID].resolve(aa);break;case "docmod":aa.url=Object(n.a)(w.Ze+"../"+encodeURI(aa.url));ja?w.oj[aa.rID].reject(ja):ha(aa,fa,w.Ye)&&w.oj[aa.rID].resolve(aa);break;case "xod":if(ja)this.he&&this.he.Uh()&&this.he.reject(ja),this.Pd&&this.Pd.Uh()&&this.Pd.reject(ja);else if(aa.notFound)aa.noCreate||this.he&&this.he.Uh()&&
this.he.resolve(aa),this.Pd&&this.Pd.Uh()&&this.Pd.resolve(aa);else{aa.url&&(aa.url=Object(n.a)(w.Ze+"../"+encodeURI(aa.url)));if(!this.Pd||this.Pd.tr())this.Pd=ka(),this.Pd.request={t:"xod",noCreate:!0};this.he||(this.he=ka(),this.he.request={t:"xod"});this.Pd.resolve(aa);this.he.resolve(aa)}break;case "annots":if(ja)w.ig.reject(ja);else if(ha(aa,fa,w.ig)){w.ig.oU();var ba=new XMLHttpRequest;ea=w.Ze+"../"+encodeURI(aa.url);var ma=aa.hasAppearance?Object(n.a)(ea+".xodapp"):null;ba.open("GET",Object(n.a)(ea));
ba.responseType="text";ba.withCredentials=this.Bk();ba.addEventListener("load",function(){ba.readyState===ba.DONE&&200===ba.status&&w.ig.resolve({cK:ba.response,CN:ma})});ba.addEventListener("error",function(){w.ig.reject(ba.statusText+" "+JSON.stringify(ba))});ba.send()}break;case "image":var ta=this.Sf[aa.p];ja?ta.promise.reject(ja):ha(aa,fa,ta)&&(ta.result=aa,ta.result.url=Object(n.a)(w.Ze+"../"+encodeURI(ta.result.url)),ta.resolve(ta.result));break;case "tiles":ta=aa.rID;ea=this.Af[ta];this.Af[ta]=
null;this.Hz.push(ta);if(ja)ea.reject(ja);else if(ha(aa,fa,ea)){for(ja=0;ja<aa.tiles.length;ja++)aa.tiles[ja]=Object(n.a)(w.Ze+"../"+encodeURI(aa.tiles[ja]));ea.resolve(aa)}break;case "text":ta=this.eh[aa.p];if(ja)ta.reject(ja);else if(ha(aa,fa,ta)){ta.oU();var na=new XMLHttpRequest;aa=Object(n.a)(w.Ze+"../"+encodeURI(aa.url));na.open("GET",aa);na.withCredentials=this.Bk();na.addEventListener("load",function(){na.readyState===na.DONE&&200===na.status&&(ta.result=JSON.parse(na.response),ta.resolve(ta.result))});
na.addEventListener("error",function(oa){ta.reject(na.statusText+" "+JSON.stringify(oa))});na.send()}break;case "progress":"loading"===aa.t&&w.trigger(a.a.Events.DOCUMENT_LOADING_PROGRESS,[aa.bytes,aa.total])}!fa&&ca.echo&&ca&&"apstring2xod"==ca.echo.t&&(ca=ca.echo.reqID)&&w.oj[ca].reject("Message unhandled by server")},AP:function(){this.WG(this.$l);return this.$l.promise},b5:function(ca){var w=this,aa=new XMLHttpRequest,ja=Object(n.a)(this.Ze+"aul")+"&id="+this.id,fa=new FormData,ea={};ca=pd(ca.body);
for(var ba=ca.next();!ba.done;ba=ca.next())ba=ba.value,ea[ba.id]=ba.nE.w+";"+ba.nE.h,fa.append(ba.id,ba.nE.dataString);ea={t:"apstring2xod",reqID:this.VR++,parts:ea};var ma=this.OE(ea);fa.append("msg",JSON.stringify(ma));w.oj[ma.reqID]=ka();aa.open("POST",ja);aa.withCredentials=w.Bk;ja=new Promise(function(ta,na){aa.onreadystatechange=function(){4===aa.readyState&&(200===aa.status?ta():na("An error occurred while sending down appearance strings to the server"))}});aa.send(fa);return ja.then(function(){return w.oj[ma.reqID].promise})},
a5:function(){this.ig||(this.ig=ka(),this.ig.request={t:"annots"},this.vf(this.ig.request));return this.ig.promise},QB:function(ca){this.Sf[ca]||(this.Sf[ca]=ka(),this.Sf[ca].request={t:"image",p:ca},this.vf(this.Sf[ca].request));return this.Sf[ca].promise},tba:function(ca){this.eh[ca]||(this.eh[ca]=ka(),this.eh[ca].request={t:"text",p:ca},this.vf(this.eh[ca].request));return this.eh[ca].promise},uba:function(ca,w,aa,ja){var fa=this.Af.length;this.Hz.length&&(fa=this.Hz.pop());this.Af[fa]=ka();this.Af[fa].request=
{t:"tiles",p:ca,z:w,r:aa,size:ja,rID:fa};this.vf(this.Af[fa].request);return this.Af[fa].promise},MT:function(){this.Ye||(this.Ye=ka(),this.Ye.request={t:"pdf"},this.YE?this.Ye.resolve({url:this.gF}):this.vf(this.Ye.request));return this.Ye.promise},RP:function(ca){var w=this,aa=new XMLHttpRequest,ja=Object(n.a)(this.Ze+"aul")+"&id="+this.id,fa=new FormData,ea={};ca.annots&&(ea.annots="xfdf");ca.watermark&&(ea.watermark="png");ca.redactions&&(ea.redactions="redact");ea={t:"docmod",reqID:this.VR++,
parts:ea};ca.print&&(ea.print=!0);var ba=this.OE(ea);fa.append("msg",JSON.stringify(ba));return Promise.all([ca.annots,ca.watermark,ca.redactions].map(function(ma){return Promise.resolve(ma)})).then(function(ma){var ta=ma[0],na=ma[1],oa=ma[2];ta&&fa.append("annots",ta);na&&fa.append("watermark",ma.watermark);oa&&fa.append("redactions",oa);w.oj[ba.reqID]=ka();aa.open("POST",ja);aa.withCredentials=w.Bk;ma=new Promise(function(pa,ua){aa.onreadystatechange=function(){4===aa.readyState&&(200===aa.status?
pa():ua("An error occurred while sending down annotation data to the server"))}});aa.send(fa);return ma.then(function(){return w.oj[ba.reqID].promise})})},pQ:function(){this.Pd||(this.Pd=ka(),this.Pd.request={t:"xod",noCreate:!0},this.vf(this.Pd.request));return this.Pd.promise},vba:function(){this.he||(this.he=ka(),this.he.request={t:"xod"},this.vf(this.he.request));return this.he.promise},Om:function(){return!0},request:function(){},eT:function(){},abort:function(){for(var ca=0;ca<this.Af.length;ca++)this.Af[ca]&&
(this.Af[ca].resolve(null),this.Af[ca]=null,this.Hz.push(ca));this.close()},bC:function(ca){this.uf=this.uf||{};this.uf.headers=ca},uha:function(){return this.uf?Object(da.omit)(this.uf.headers,["Cookie","cookie"]):null},yp:function(ca){this.uf=this.uf||{};this.uf.internal=this.uf.internal||{};this.uf.internal.withCredentials=ca},Bk:function(){return this.uf&&this.uf.internal?this.uf.internal.withCredentials:null},getFileData:function(){return Promise.reject()}});Object(Ba.a)(qa);Object(b.a)(qa);
Object(b.b)(qa);ya["default"]=qa},400:function(Ba,ya,z){function qa(y,r,h){function a(e,f){function n(oa){ca().then(function(pa){ba&&!ma?setTimeout(function(){n(oa)},1):pa.send(JSON.stringify(oa))})}function x(oa,pa,ua,va){var ra=window.createPromiseCapability(),xa=!1,Aa=ra;ja=oa;fa=pa;ea=ua;aa=null;va&&(oa=Object(ha.a)("wvsQueryParameters"),oa.bcid=Object(la.k)(8),Object(ha.b)("wvsQueryParameters",oa));try{oa=ta?na+"/"+ta:na+"/ws";oa=Object(da.a)(oa);var Ga=new WebSocket(oa);Ga.onopen=function(){ra.resolve();
xa=!0;ra=null;ba=!1;w.resolve(Ga);fa&&fa()};Ga.onerror=function(Ka){ba=ma=!0;ra&&ra.reject(Ka);aa&&aa.reject()};Ga.onclose=function(){w=window.createPromiseCapability();ba=!0;aa||(aa=window.createPromiseCapability());aa.resolve();ea&&ea();ja&&xa&&ja({t:"health",data:{unhealthy:!0,isDead:!0}})};Ga.onmessage=function(Ka){Ka&&Ka.data&&(Ka=JSON.parse(Ka.data),Ka.hb?n({hb:!0}):Ka.end?close():ja(Ka))}}catch(Ka){ra.reject(Ka),ra=null}return Aa.promise}function ca(){ba&&ja&&x(ja);return w.promise}var w=window.createPromiseCapability(),
aa=null,ja,fa,ea=null,ba=!1,ma=!1,ta=f,na=function(oa){var pa=oa.indexOf("://"),ua="ws://";0>pa?pa=0:(5===pa&&(ua="wss://"),pa+=3);var va=oa.lastIndexOf("/");0>va&&(va=oa.length);return ua+oa.slice(pa,va)}(e);return{send:n,FJ:x,tF:function(){return aa?aa.promise:ca().then(function(oa){aa=window.createPromiseCapability();ja=null;oa.close();return aa.promise})}}}function b(e){var f=e.lastIndexOf("/");0>f&&(f=e.length);return e.slice(0,f)}return window.WebSocket&&!h?a(y,r):function(e,f){function n(oa){(ea?
ea.promise:Promise.resolve(fa)).then(function(pa){var ua=new XMLHttpRequest,va=ja?aa+"/"+ja+"pf":aa+"/pf";va=Object(da.a)(va)+"&id="+pa;pa=new FormData;pa.append("data",JSON.stringify(oa));ua.open("POST",va);ua.withCredentials=!0;ua.send(pa)})}function x(){fa=0;ea||(ea=window.createPromiseCapability())}function ca(){w=new XMLHttpRequest;var oa=aa+"/pf";oa+=0!==fa?"?id="+fa+"&uc="+na:"?uc="+na;na++;w.open("GET",oa,!0);w.withCredentials=!0;w.setRequestHeader("Cache-Control","no-cache");w.setRequestHeader("X-Requested-With",
"XMLHttpRequest");var pa=w,ua=!1;w.onreadystatechange=function(){a:if(3<=pa.readyState&&!ua){try{var va=pa.responseText.length}catch(Aa){Object(ka.g)("caught exception");break a}if(0<va)try{var ra=pa.responseText.split("\n");for(ra[ra.length-1]&&ra.pop();0<ra.length&&3>ra[ra.length-1].length;)"]"===ra.pop()&&x();0<ra.length&&3>ra[0].length&&ra.shift();for(va=0;va<ra.length;++va)ra[va].endsWith(",")&&(ra[va]=ra[va].substr(0,ra[va].length-1));0===fa&&0<ra.length&&(fa=JSON.parse(ra.shift()).id,va=ea,
ea=null,va.resolve(fa));var xa;for(va=0;va<ra.length;++va)(xa=JSON.parse(ra[va]))&&xa.end?close():xa&&xa.hb&&xa.id===fa?n({hb:!0}):ta(xa)}catch(Aa){}ba||(ua=!0,ca())}};w.send()}var w,aa=b(e),ja=f,fa=0,ea=window.createPromiseCapability(),ba=!1,ma=null,ta=null,na=0;return{send:n,FJ:function(oa,pa,ua){ta=oa;ma=ua;ba=!1;x();ca();pa&&pa();return Promise.resolve()},tF:function(){x();ta=null;ba=!0;ma&&ma();w.abort();return Promise.resolve()}}}(y,r)}z.d(ya,"a",function(){return qa});var ka=z(2),la=z(27),
ha=z(38),da=z(144)}}]);}).call(this || window)
