1!function(){try{var R="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},N=(new R.Error).stack;N&&(R._sentryDebugIds=R._sentryDebugIds||{},R._sentryDebugIds[N]="af3ec047-e30a-4ac3-ae44-f9dbcfcfc992",R._sentryDebugIdIdentifier="sentry-dbid-af3ec047-e30a-4ac3-ae44-f9dbcfcfc992")}catch(R){}}();"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5975],{22288:function(R,N,W){let j;W.d(N,{D:function(){return bi}});var B,z,U,V,G,Y,Z,te,tn,tr,ts,ta,th,tc,tu,tp,tf,tg,tm,tw,ty,tA,tx,t_,tS,tE,tk,tC,tM,tT,tR,tP,tI,tD,tN,tO,tF,tW,tj,tB,t$,tz,tH,tU,tV,tG,tq,tX,tY,tK,tQ,tJ,tZ,t0,t1,t3,t5,t4,t6,t8,t7,t9,ee,ei,en,er,es,ea,eo,el,eh,ec,ed,eu,ef,em,ew,ey,eb,eA,e_,eS,eE,ek,eC,eM,eT,eR,eP,eL,eI,eD,eN,eO,eF,eW,ej,eB,e$,ez,eH,eU,eV,eG,eq,eX,eY,eK,eQ,eJ,eZ,e1,e2,e3,e5,e4,e6,e8,e7,e9,it,ie,ii,ir,is,ia,ih,ic,id,ig,im,iA,ix,i_,iS,iC,iM,iT,iR,iL,iI,iD,iN,iO,iF,iW,ij,iB,i$,iz,iH,iU,iV,iG,iq,iX,iY,iK,iQ,iJ,iZ,i0,i1,i3,i5,i4,i6,i8,i7,i9,nt,ne,nn,nr,ns,na,no,nh,nc,nu,np,nf,ng,nm,nv,ny,nA,nx,n_,nS,nk,nC,nM,nT,nR,nP,nL,nI,nD,nN,nO,nF,nW,nj,nB,n$,nz,nH,nU,nV,nG,nq,nX,nY,nK,nQ,nJ,nZ,n1,n3,n5,n4,n6,n8,n7,n9,rt,re,ri,rn,rr,rs,ra,ro,rl,rh,rc,rd,ru,rf,rg,rm,ry,rA,rx,r_,rS,rE,rk,rC,rM,rT,rR,rI,rD,rN,rO,rF,rW,rj,rB,r$,rz,rH,rU,rV,rG,rq,rX,rY,rK,rQ,rJ,rZ,r1,r3,r5,r4,r6,r8,r7,r9,se,si,sr,ss,sa,so,sh,sc,sd,sf,sg,sm,sy,sb,sA,sx,s_,sS,sE,sC,sM,sT,sR,sI,sD,sN,sO,sF,sW,sj,sB,s$,sz,sH,sU,sV,sG,sq,sX,sY,sK,sQ,sJ,sZ,s1,s3,s5,s4,s6,s8,s7,s9,at,ai,an,ar,as,aa,al,ah,ac,ad,au,ap,af,ag,av,ab,aA,ax,a_,aS,aE,ak,aC,aM,aT,aR,aP,aI,aD,aN,aO,aF,aW,aj,aB,a$,az,aH,aU,aV,aG,aq,aX,aY,aK,aQ,aJ,aZ,a1,a3,a5,a4,a6,a8,a7,a9,oe,on,or,os,oa,ol,oh,oc,od,ou,op,of,og,om,ov,ow,oy,ob,oA,ox,o_,oS,oE,oC,oM,oT,oR,oI,oD,oN,oO,oF,oW,oj,oB,o$,oz,oH,oU,oV,oG,oq,oX,oY,oK,oQ,oJ,oZ,o1,o3,o5,o4,o6,o8,o7,o9,le,ln,lr,ls,la,ll,lh,lc,ld,lu,lp,lf,lm,lv,lb,lA,lx,l_,lS,lk,lC,lM,lT,lR,lP,lI,lD,lN,lO,lF,lW,lj,lB,l$,lz,lH,lU,lV,lG,lq,lX,lY,lK,lQ,lJ,lZ,l1,l3,l5,l4,l6,l8,l7,l9,hn,hr,hs,ha,ho,hl,hh,hc,hd,hu,hf,hg,hm,hw,hy,hb,hA,hx,h_,hS,hE,hk,hC,hM,hT,hR,hP,hI,hD,hN,hO,hF,hW,hj,hB,h$,hz,hH,hU,hV,hG,hq,hX,hY,hK,hQ,hJ,hZ,h1,h2,h3,h5,h4,h6,h8,h7,h9,ct,cn,cr,cs,ca,ch,cc,cu,cf,cm,cw,cb,cA,cx,c_,cS,cE,ck,cC,cM,cT,cR,cP,cI,cD,cN,cO,cF,cW,cj,cB,c$,cz,cH,cU,cV,cG,cq,cX,cY,cK,cQ,cJ,cZ,c0,c1,c2,c3,c5,c4,c6,c8,c7,c9,de,dn,dr,ds,da,dl,dh,dc,du,df,dm,dv,dw,dy,db,dA,dx,d_,dS,dE,dC,dM,dT,dR,dI,dD,dN,dO,dF,dW,dj,dB,d$,dz,dH,dU,dV,dG,dq,dX,dY=W(85893),dK=W(67294),dQ=Object.defineProperty,j1=(R,N,W)=>N in R?dQ(R,N,{enumerable:!0,configurable:!0,writable:!0,value:W}):R[N]=W,dt=(R,N,W)=>(j1(R,"symbol"!=typeof N?N+"":N,W),W),xp=(R,N,W)=>{if(!N.has(R))throw TypeError("Cannot "+W)},a=(R,N,W)=>(xp(R,N,"read from private field"),W?W.call(R):N.get(R)),m=(R,N,W)=>{if(N.has(R))throw TypeError("Cannot add the same private member more than once");N instanceof WeakSet?N.add(R):N.set(R,W)},w=(R,N,W,j)=>(xp(R,N,"write to private field"),j?j.call(R,W):N.set(R,W),W),We=(R,N,W,j)=>({set _(i){w(R,N,i,W)},get _(){return a(R,N,j)}}),A=(R,N,W)=>(xp(R,N,"access private method"),W),dJ="u">typeof globalThis?globalThis:"u">typeof window?window:"u">typeof global?global:"u">typeof self?self:{};function Jv(R){return R&&R.__esModule&&Object.prototype.hasOwnProperty.call(R,"default")?R.default:R}var tl=function(R){return R&&R.Math===Math&&R},dZ=tl("object"==typeof globalThis&&globalThis)||tl("object"==typeof window&&window)||tl("object"==typeof self&&self)||tl("object"==typeof dJ&&dJ)||tl("object"==typeof dJ&&dJ)||function(){return this}()||Function("return this")(),d1={},Tr=function(R){try{return!!R()}catch{return!0}},d3=!Tr(function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]}),d5=!Tr(function(){var R=(function(){}).bind();return"function"!=typeof R||R.hasOwnProperty("prototype")}),d4=Function.prototype.call,d6=d5?d4.bind(d4):function(){return d4.apply(d4,arguments)},d8={},d7={}.propertyIsEnumerable,d9=Object.getOwnPropertyDescriptor,ue=d9&&!d7.call({1:2},1);d8.f=ue?function(R){var N=d9(this,R);return!!N&&N.enumerable}:d7;var ui,un,iy=function(R,N){return{enumerable:!(1&R),configurable:!(2&R),writable:!(4&R),value:N}},ur=Function.prototype,us=ur.call,ua=d5&&ur.bind.bind(us,us),uh=d5?ua:function(R){return function(){return us.apply(R,arguments)}},uc=uh({}.toString),uu=uh("".slice),uf=Object,um=uh("".split),uw=Tr(function(){return!uf("z").propertyIsEnumerable(0)})?function(R){return"String"===uu(uc(R),8,-1)?um(R,""):uf(R)}:uf,ay=function(R){return null==R},uy=TypeError,ly=function(R){if(ay(R))throw new uy("Can't call method on "+R);return R},Wm=function(R){return uw(ly(R))},ub="object"==typeof document&&document.all,uA=typeof ub>"u"&&void 0!==ub?function(R){return"function"==typeof R||R===ub}:function(R){return"function"==typeof R},Yh=function(R){return"object"==typeof R?null!==R:uA(R)},cy=function(R,N){var W;return arguments.length<2?uA(W=dZ[R])?W:void 0:dZ[R]&&dZ[R][N]},ux=uh({}.isPrototypeOf),u_="u">typeof navigator&&String(navigator.userAgent)||"",uS=dZ.process,uE=dZ.Deno,uk=uS&&uS.versions||uE&&uE.version,uC=uk&&uk.v8;uC&&(un=(ui=uC.split("."))[0]>0&&ui[0]<4?1:+(ui[0]+ui[1])),!un&&u_&&(!(ui=u_.match(/Edge\/(\d+)/))||ui[1]>
1=74)&&(ui=u_.match(/Chrome\/(\d+)/))&&(un=+ui[1]);var uM=un,uT=dZ.String,uR=!!Object.getOwnPropertySymbols&&!Tr(function(){var R=Symbol("symbol detection");return!uT(R)||!(Object(R) instanceof Symbol)||!Symbol.sham&&uM&&uM<41}),uI=uR&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,uD=Object,uN=uI?function(R){return"symbol"==typeof R}:function(R){var N=cy("Symbol");return uA(N)&&ux(N.prototype,uD(R))},uO=String,PA=function(R){try{return uO(R)}catch{return"Object"}},uF=TypeError,py=function(R){if(uA(R))return R;throw new uF(PA(R)+" is not a function")},uW=TypeError,uj={exports:{}},uB=Object.defineProperty,qm=function(R,N){try{uB(dZ,R,{value:N,configurable:!0,writable:!0})}catch{dZ[R]=N}return N},u$="__core-js_shared__",uz=uj.exports=dZ[u$]||qm(u$,{});(uz.versions||(uz.versions=[])).push({version:"3.37.1",mode:"global",copyright:"\xa9 2014-2024 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.37.1/LICENSE",source:"https://github.com/zloirock/core-js"});var uH=uj.exports,my=function(R,N){return uH[R]||(uH[R]=N||{})},uU=Object,uV=uh({}.hasOwnProperty),uG=Object.hasOwn||function(R,N){return uV(uU(ly(R)),N)},uq=0,uX=Math.random(),uY=uh(1..toString),vy=function(R){return"Symbol("+(void 0===R?"":R)+")_"+uY(++uq+uX,36)},uK=dZ.Symbol,uQ=my("wks"),uJ=uI?uK.for||uK:uK&&uK.withoutSetter||vy,nE=function(R,N){var W=R[N];return ay(W)?void 0:py(W)},iE=function(R,N){var W,j;if("string"===N&&uA(W=R.toString)&&!Yh(j=d6(W,R))||uA(W=R.valueOf)&&!Yh(j=d6(W,R))||"string"!==N&&uA(W=R.toString)&&!Yh(j=d6(W,R)))return j;throw new uW("Can't convert object to primitive value")},uZ=TypeError,u1=(uG(uQ,pA="toPrimitive")||(uQ[pA]=uR&&uG(uK,pA)?uK[pA]:uJ("Symbol."+pA)),uQ[pA]),lE=function(R,N){if(!Yh(R)||uN(R))return R;var W,j=nE(R,u1);if(j){if(void 0===N&&(N="default"),!Yh(W=d6(j,R,N))||uN(W))return W;throw new uZ("Can't convert object to primitive value")}return void 0===N&&(N="number"),iE(R,N)},yy=function(R){var N=lE(R,"string");return uN(N)?N:N+""},u3=dZ.document,u5=Yh(u3)&&Yh(u3.createElement),u4=!d3&&!Tr(function(){return 7!==Object.defineProperty(u5?u3.createElement("div"):{},"a",{get:function(){return 7}}).a}),u6=Object.getOwnPropertyDescriptor;d1.f=d3?u6:function(R,N){if(R=Wm(R),N=yy(N),u4)try{return u6(R,N)}catch{}if(uG(R,N))return iy(!d6(d8.f,R,N),R[N])};var u8={},u7=d3&&Tr(function(){return 42!==Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype}),u9=String,pi=TypeError,wy=function(R){if(Yh(R))return R;throw new pi(u9(R)+" is not an object")},pn=TypeError,pr=Object.defineProperty,ps=Object.getOwnPropertyDescriptor,pa="enumerable",po="configurable",pl="writable";u8.f=d3?u7?function(R,N,W){if(wy(R),N=yy(N),wy(W),"function"==typeof R&&"prototype"===N&&"value"in W&&pl in W&&!W[pl]){var j=ps(R,N);j&&j[pl]&&(R[N]=W.value,W={configurable:po in W?W[po]:j[po],enumerable:pa in W?W[pa]:j[pa],writable:!1})}return pr(R,N,W)}:pr:function(R,N,W){if(wy(R),N=yy(N),wy(W),u4)try{return pr(R,N,W)}catch{}if("get"in W||"set"in W)throw new pn("Accessors not supported");return"value"in W&&(R[N]=W.value),R};var ph=d3?function(R,N,W){return u8.f(R,N,iy(1,W))}:function(R,N,W){return R[N]=W,R},pc={exports:{}},pd=Function.prototype,pu=d3&&Object.getOwnPropertyDescriptor,pf=uG(pd,"name")&&(!d3||d3&&pu(pd,"name").configurable),pb=uh(Function.toString);uA(uH.inspectSource)||(uH.inspectSource=function(R){return pb(R)});var pA,px,p_,pS,pE=uH.inspectSource,pk=dZ.WeakMap,pC=uA(pk)&&/native code/.test(String(pk)),pM=my("keys"),pT={},pR="Object already initialized",pP=dZ.TypeError,pI=dZ.WeakMap;if(pC||uH.state){var pD=uH.state||(uH.state=new pI);pD.get=pD.get,pD.has=pD.has,pD.set=pD.set,px=function(R,N){if(pD.has(R))throw new pP(pR);return N.facade=R,pD.set(R,N),N},p_=function(R){return pD.get(R)||{}},pS=function(R){return pD.has(R)}}else{var pN,pO=pM[pN="state"]||(pM[pN]=vy(pN));pT[pO]=!0,px=function(R,N){if(uG(R,pO))throw new pP(pR);return N.facade=R,ph(R,pO,N),N},p_=function(R){return uG(R,pO)?R[pO]:{}},pS=function(R){return uG(R,pO)}}var pF={get:p_,enforce:function(R){return pS(R)?p_(R):px(R,{})}},pW=pF.enforce,pj=pF.get,pB=String,p$=Object.defineProperty,pz=uh("".slice),pH=uh("".replace),pU=uh([].join),pV=d3&&!Tr(function(){return 8!==p$(function(){},"length",{value:8}).length}),pG=String(String).split("String"),pq=pc.exports=function(R,N,W){"Symbol("===pz(pB(N),0,7)&&(N="["+pH(pB(N),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),W&&W.getter&&(N="get "+N),W&&W.setter&&(N="set "+N),(!uG(R,"name")||pf&&R.name!==N)&&(d3?p$(R,"name",{value:N,configurable:!0}):R.name=N),pV&&W&&uG(W,"arity")&&R.length!==W.arity&&p$(R,"length",{value:W.arity});try{W&&uG(W,"constructor")&&W.constructor?d3&&p$(R,"prototype",{writable:!1}):R.prototype&&(R.prototype=void 0)}catch{}var j=pW(R);return uG(j,"source")||(j.source=pU(pG,"string"==typeof N?N:"")),R};Function.prototype.toString=pq(function(){return uA(this)&&pj(this).source||pE(this)},"toString");var pX=pc.exports,pY={},pK=Math.ceil,pQ=Math.floor,pJ=Math.trunc||function(R){var N=+R;return(N>0?pQ:pK)(N)},Py=function(R){var N=+R;return N!=N||0===N?0:pJ(N)}
1,pZ=Math.max,p1=Math.min,p3=Math.min,N_=function(R){var N=Py(R);return N>0?p3(N,9007199254740991):0},U_=function(R,N){var W=Py(R);return W<0?pZ(W+N,0):p1(W,N)},Y0=function(R){return function(N,W,j){var B=Wm(N),z=N_(B.length);if(0===z)return!R&&-1;var U,V=U_(j,z);if(R&&W!=W){for(;z>V;)if((U=B[V++])!=U)return!0}else for(;z>V;V++)if((R||V in B)&&B[V]===W)return R||V||0;return!R&&-1}},p5={includes:Y0(!0),indexOf:Y0(!1)}.indexOf,p4=uh([].push),Y_=function(R,N){var W,j=Wm(R),B=0,z=[];for(W in j)!uG(pT,W)&&uG(j,W)&&p4(z,W);for(;N.length>B;)uG(j,W=N[B++])&&(~p5(z,W)||p4(z,W));return z},p6=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"].concat("length","prototype");pY.f=Object.getOwnPropertyNames||function(R){return Y_(R,p6)};var p8={};p8.f=Object.getOwnPropertySymbols;var p7=uh([].concat),p9=cy("Reflect","ownKeys")||function(R){var N=pY.f(wy(R)),W=p8.f;return W?p7(N,W(R)):N},fe=/#|\.prototype\./,Kh=function(R,N){var W=fn[fi(R)];return W===fs||W!==fr&&(uA(N)?Tr(N):!!N)},fi=Kh.normalize=function(R){return String(R).replace(fe,".").toLowerCase()},fn=Kh.data={},fr=Kh.NATIVE="N",fs=Kh.POLYFILL="P",fa=d1.f,bS=function(R,N,W,j){j||(j={});var B=j.enumerable,z=void 0!==j.name?j.name:N;if(uA(W)&&pX(W,z,j),j.global)B?R[N]=W:qm(N,W);else{try{j.unsafe?R[N]&&(B=!0):delete R[N]}catch{}B?R[N]=W:u8.f(R,N,{value:W,enumerable:!1,configurable:!j.nonConfigurable,writable:!j.nonWritable})}return R},AS=function(R,N,W){for(var j=p9(N),B=u8.f,z=d1.f,U=0;U<j.length;U++){var V=j[U];uG(R,V)||W&&uG(W,V)||B(R,V,z(N,V))}},fo={},fl=TypeError,xS=function(R){var N,W;this.promise=new R(function(R,j){if(void 0!==N||void 0!==W)throw new fl("Bad Promise constructor");N=R,W=j}),this.resolve=py(N),this.reject=py(W)};fo.f=function(R){return new xS(R)},function(R,N){var W,j,B,z,U,V=R.target,G=R.global,Y=R.stat;if(W=G?dZ:Y?dZ[V]||qm(V,{}):dZ[V]&&dZ[V].prototype)for(j in N){if(z=N[j],B=R.dontCallGetSet?(U=fa(W,j))&&U.value:W[j],!Kh(G?j:V+(Y?".":"#")+j,R.forced)&&void 0!==B){if(typeof z==typeof B)continue;AS(z,B)}(R.sham||B&&B.sham)&&ph(z,"sham",!0),bS(W,j,z,R)}}({target:"Promise",stat:!0},{withResolvers:function(){var R=fo.f(this);return{promise:R.promise,resolve:R.resolve,reject:R.reject}}});var fh,fc,fd={exports:{}},fu=fd.exports={};function lg(){throw Error("setTimeout has not been defined")}function cg(){throw Error("clearTimeout has not been defined")}function Iy(R){if(fh===setTimeout)return setTimeout(R,0);if((fh===lg||!fh)&&setTimeout)return fh=setTimeout,setTimeout(R,0);try{return fh(R,0)}catch{try{return fh.call(null,R,0)}catch{return fh.call(this,R,0)}}}!function(){try{fh="function"==typeof setTimeout?setTimeout:lg}catch{fh=lg}try{fc="function"==typeof clearTimeout?clearTimeout:cg}catch{fc=cg}}();var ff,fg=[],fm=!1,fy=-1;function kS(){fm&&ff&&(fm=!1,ff.length?fg=ff.concat(fg):fy=-1,fg.length&&Fy())}function Fy(){if(!fm){var R=Iy(kS);fm=!0;for(var N=fg.length;N;){for(ff=fg,fg=[];++fy<N;)ff&&ff[fy].run();fy=-1,N=fg.length}ff=null,fm=!1,function(R){if(fc===clearTimeout)return clearTimeout(R);if((fc===cg||!fc)&&clearTimeout)return fc=clearTimeout,clearTimeout(R);try{fc(R)}catch{try{return fc.call(null,R)}catch{return fc.call(this,R)}}}(R)}}function My(R,N){this.fun=R,this.array=N}function qi(){}fu.nextTick=function(R){var N=Array(arguments.length-1);if(arguments.length>1)for(var W=1;W<arguments.length;W++)N[W-1]=arguments[W];fg.push(new My(R,N)),1!==fg.length||fm||Iy(Fy)},My.prototype.run=function(){this.fun.apply(null,this.array)},fu.title="browser",fu.browser=!0,fu.env={},fu.argv=[],fu.version="",fu.versions={},fu.on=qi,fu.addListener=qi,fu.once=qi,fu.off=qi,fu.removeListener=qi,fu.removeAllListeners=qi,fu.emit=qi,fu.prependListener=qi,fu.prependOnceListener=qi,fu.listeners=function(R){return[]},fu.binding=function(R){throw Error("process.binding is not supported")},fu.cwd=function(){return"/"},fu.chdir=function(R){throw Error("process.chdir is not supported")},fu.umask=function(){return 0};var fA=fd.exports;let fx=fA&&fA.__esModule&&Object.prototype.hasOwnProperty.call(fA,"default")?fA.default:fA;var Te=function(){return(Te=Object.assign||function(R){for(var N,W=1,j=arguments.length;W<j;W++)for(var B in N=arguments[W])Object.prototype.hasOwnProperty.call(N,B)&&(R[B]=N[B]);return R}).apply(this,arguments)};function Zs(R,N,W){if(W||2==arguments.length)for(var j,B=0,z=N.length;B<z;B++)!j&&B in N||(j||(j=Array.prototype.slice.call(N,0,B)),j[B]=N[B]);return R.concat(j||Array.prototype.slice.call(N))}var f_=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInl
1ine|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,fS=(f6=Object.create(null),function(R){return void 0===f6[R]&&(f6[R]=f_.test(R)||111===R.charCodeAt(0)&&110===R.charCodeAt(1)&&91>R.charCodeAt(2)),f6[R]}),fE="-ms-",fk="-moz-",fC="-webkit-",fM="comm",fT="rule",fR="decl",fI="@keyframes",fD=Math.abs,fN=String.fromCharCode,fO=Object.assign;function li(R,N){return(R=N.exec(R))?R[0]:R}function pt(R,N,W){return R.replace(N,W)}function bd(R,N,W){return R.indexOf(N,W)}function pe(R,N){return 0|R.charCodeAt(N)}function Va(R,N,W){return R.slice(N,W)}function ti(R){return R.length}function sl(R,N){return N.push(R),R}function Q0(R,N){return R.filter(function(R){return!li(R,N)})}var fF=1,fW=1,fj=0,fB=0,f$=0,fz="";function Zf(R,N,W,j,B,z,U,V){return{value:R,root:N,parent:W,type:j,props:B,children:z,line:fF,column:fW,length:U,return:"",siblings:V}}function Xi(R,N){return fO(Zf("",null,null,"",null,null,0,R.siblings),R,{length:-R.length},N)}function uo(R){for(;R.root;)R=Xi(R.root,{children:[R]});sl(R,R.siblings)}function kn(){return f$=fB<fj?pe(fz,fB++):0,fW++,10===f$&&(fW=1,fF++),f$}function Xs(){return pe(fz,fB)}function dg(R){switch(R){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function Hp(R){var N,W;return(N=fB-1,W=function ug(R){for(;kn();)switch(f$){case R:return fB;case 34:case 39:34!==R&&39!==R&&ug(f$);break;case 40:41===R&&ug(R);break;case 92:kn()}return fB}(91===R?R+2:40===R?R+1:R),Va(fz,N,W)).trim()}function tv(R,N,W,j,B,z,U,V,G,Y,Z,te){for(var tn=B-1,tr=0===B?z:[""],ts=tr.length,ta=0,th=0,tc=0;ta<j;++ta)for(var tu=0,tp=Va(R,tn+1,tn=fD(th=U[ta])),tf=R;tu<ts;++tu)(tf=(th>0?tr[tu]+" "+tp:pt(tp,/&\f/g,tr[tu])).trim())&&(G[tc++]=tf);return Zf(R,N,W,0===B?fT:V,G,Y,Z,te)}function ev(R,N,W,j,B){return Zf(R,N,W,fR,Va(R,0,j),Va(R,j+1,-1),j,B)}function Jd(R,N){for(var W="",j=0;j<R.length;j++)W+=N(R[j],j,R,N)||"";return W}var fH={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGr
1idRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},fU="u">typeof fx&&void 0!==fx.env&&(fx.env.REACT_APP_SC_ATTR||fx.env.SC_ATTR)||"data-styled",fV="active",fG="data-styled-version",fq="6.1.11",fX=`/*!sc*/ 2`,fY="u">typeof window&&"HTMLElement"in window,fK=!!("boolean"==typeof SC_DISABLE_SPEEDY?SC_DISABLE_SPEEDY:"u">typeof fx&&void 0!==fx.env&&void 0!==fx.env.REACT_APP_SC_DISABLE_SPEEDY&&""!==fx.env.REACT_APP_SC_DISABLE_SPEEDY?"false"!==fx.env.REACT_APP_SC_DISABLE_SPEEDY&&fx.env.REACT_APP_SC_DISABLE_SPEEDY:"u">typeof fx&&void 0!==fx.env&&void 0!==fx.env.SC_DISABLE_SPEEDY&&""!==fx.env.SC_DISABLE_SPEEDY?"false"!==fx.env.SC_DISABLE_SPEEDY&&fx.env.SC_DISABLE_SPEEDY:"production"!==fx.env.NODE_ENV),fQ=/invalid hook call/i,fJ=new Set,ex=function(R,N){if("production"!==fx.env.NODE_ENV){var W="The component ".concat(R).concat(N?' with the id of "'.concat(N,'"'):"",` has been created dynamically. 3`)+`You may see this warning because you've called styled inside another component. 4To resolve this only create new StyledComponents outside of any render method and function component.`,j=console.error;try{var B=!0;console.error=function(R){for(var N=[],z=1;z<arguments.length;z++)N[z-1]=arguments[z];fQ.test(R)?(B=!1,fJ.delete(W)):j.apply(void 0,Zs([R],N,!1))},(0,dK.useRef)(),B&&!fJ.has(W)&&(console.warn(W),fJ.add(W))}catch(R){fQ.test(R.message)&&fJ.delete(W)}finally{console.error=j}}},fZ=Object.freeze([]),f1=Object.freeze({}),f2=new Set(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","track","u","ul","use","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"]),f3=/[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g,f5=/(^-|-$)/g;function iv(R){return R.replace(f3,"-").replace(f5,"")}var f4=/(a)(d)/gi,rv=function(R){return String.fromCharCode(R+(R>25?39:97))};function pg(R){var N,W="";for(N=Math.abs(R);N>52;N=N/52|0)W=rv(N%52)+W;return(rv(N%52)+W).replace(f4,"$1-$2")}var f6,f8,Or=function(R,N){for(var W=N.length;W;)R=33*R^N.charCodeAt(--W);return R},Vy=function(R){return Or(5381,R)};function qy(R){return"production"!==fx.env.NODE_ENV&&"string"==typeof R&&R||R.displayName||R.name||"Component"}function zp(R){return"string"==typeof R&&("production"===fx.env.NODE_ENV||R.charAt(0)===R.charAt(0).toLowerCase())}var f7="function"==typeof Symbol&&Symbol.for,f9=f7?Symbol.for("react.memo"):60115,gi=f7?Symbol.for("react.forward_ref"):60112,gr={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},gs={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},ga={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},go=((f8={})[gi]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},f8[f9]=ga,f8);function sv(R){return("type"in R&&R.type.$$typeof)===f9?ga:"$$typeof"in R?go[R.$$typeof]:gr}var gl=Object.defineProperty,gh=Object.getOwnPropertyNames,gc=Object.getOwnPropertySymbols,gd=Object.getOwnPropertyDescriptor,gu=Object.getPrototypeOf,gf=Object.prototype;function Qs(R){return"function"==typeof R}function e0(R){return"object"==typeof R&&"styledComponentId"in R}function Ur(R,N){return R&&N?"".concat(R," ").concat(N):R||N||""}function gg(R,N){if(0===R.length)return"";
4for(var W=R[0],j=1;j<R.length;j++)W+=R[j];return W}function Xa(R){return null!==R&&"object"==typeof R&&R.constructor.name===Object.name&&!("props"in R&&R.$$typeof)}function n0(R,N){Object.defineProperty(R,"toString",{value:N})}var gm="production"!==fx.env.NODE_ENV?{1:`Cannot create styled-component for component: %s. 5 6`,2:`Can't collect styles once you've consumed a \`ServerStyleSheet\`'s styles! \`ServerStyleSheet\` is a one off instance for each server-side render cycle. 7 8- Are you trying to reuse it across renders? 9- Are you accidentally calling collectStyles twice? 10 11`,3:`Streaming SSR is only supported in a Node.js environment; Please do not try to call this method in the browser. 12 13`,4:`The \`StyleSheetManager\` expects a valid target or sheet prop! 14 15- Does this error occur on the client and is your target falsy? 16- Does this error occur on the server and is the sheet falsy? 17 18`,5:`The clone method cannot be used on the client! 19 20- Are you running in a client-like environment on the server? 21- Are you trying to run SSR on the client? 22 23`,6:`Trying to insert a new style tag, but the given Node is unmounted! 24 25- Are you using a custom target that isn't mounted? 26- Does your document not have a valid head element? 27- Have you accidentally removed a style tag manually? 28 29`,7:'ThemeProvider: Please return an object from your "theme" prop function, e.g.\n\n```js\ntheme={() => ({})}\n```\n\n',8:`ThemeProvider: Please make your "theme" prop an object. 30 31`,9:"Missing document `<head>`\n\n",10:`Cannot find a StyleSheet instance. Usually this happens if there are multiple copies of styled-components loaded at once. Check out this issue for how to troubleshoot and fix the common cases where this situation can happen: https://github.com/styled-components/styled-components/issues/1941#issuecomment-417862021 32 33`,11:`_This error was replaced with a dev-time warning, it will be deleted for v4 final._ [createGlobalStyle] received children which will not be rendered. Please use the component without passing children elements. 34 35`,12:"It seems you are interpolating a keyframe declaration (%s) into an untagged string. This was supported in styled-components v3, but is not longer supported in v4 as keyframes are now injected on-demand. Please wrap your string in the css\\`\\` helper which ensures the styles are injected correctly. See https://www.styled-components.com/docs/api#css\n\n",13:`%s is not a styled component and cannot be referred to via component selector. See https://www.styled-components.com/docs/advanced#referring-to-other-components for more details. 36 37`,14:`ThemeProvider: "theme" prop is required. 38 39`,15:"A stylis plugin has been supplied that is not named. We need a name for each plugin to be able to prevent styling collisions between different stylis configurations within the same app. Before you pass your plugin to `<StyleSheetManager stylisPlugins={[]}>`, please make sure each plugin is uniquely-named, e.g.\n\n```js\nObject.defineProperty(importedPlugin, 'name', { value: 'some-unique-name' });\n```\n\n",16:`Reached the limit of how many styled components may be created at group %s. 40You may only create up to 1,073,741,824 components. If you're creating components dynamically, 41as for instance in your render method then you may be running into this limitation. 42 43`,17:`CSSStyleSheet could not be found on HTMLStyleElement. 44Has styled-components' style tag been unmounted or altered by another script? 45`,18:"ThemeProvider: Please make sure your useTheme hook is within a `<ThemeProvider>`"}:{};function gx(){for(var R=[],N=0;N<arguments.length;N++)R[N]=arguments[N];for(var W=R[0],j=[],B=1,z=R.length;B<z;B+=1)j.push(R[B]);return j.forEach(function(R){W=W.replace(/%[a-z]/,R)}),W}function ji(R){for(var N=[],W=1;W<arguments.length;W++)N[W-1]=arguments[W];return"production"===fx.env.NODE_ENV?Error("An error occurred. See https://github.com/styled-components/styled-components/blob/main/packages/styled-components/src/utils/errors.md#".concat(R," for more information.").concat(N.length>0?" Args: ".concat(N.join(", ")):"")):Error(gx.apply(void 0,Zs([gm[R]],N,!1)).trim())}
45var gv=function(){function r(R){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=R}return r.prototype.indexOfGroup=function(R){for(var N=0,W=0;W<R;W++)N+=this.groupSizes[W];return N},r.prototype.insertRules=function(R,N){if(R>=this.groupSizes.length){for(var W=this.groupSizes,j=W.length,B=j;R>=B;)if((B<<=1)<0)throw ji(16,"".concat(R));this.groupSizes=new Uint32Array(B),this.groupSizes.set(W),this.length=B;for(var z=j;z<B;z++)this.groupSizes[z]=0}for(var U=this.indexOfGroup(R+1),V=(z=0,N.length);z<V;z++)this.tag.insertRule(U,N[z])&&(this.groupSizes[R]++,U++)},r.prototype.clearGroup=function(R){if(R<this.length){var N=this.groupSizes[R],W=this.indexOfGroup(R),j=W+N;this.groupSizes[R]=0;for(var B=W;B<j;B++)this.tag.deleteRule(W)}},r.prototype.getGroup=function(R){var N="";if(R>=this.length||0===this.groupSizes[R])return N;for(var W=this.groupSizes[R],j=this.indexOfGroup(R),B=j+W,z=j;z<B;z++)N+="".concat(this.tag.getRule(z)).concat(fX);return N},r}(),gy=new Map,gA=new Map,g_=1,cd=function(R){if(gy.has(R))return gy.get(R);for(;gA.has(g_);)g_++;var N=g_++;if("production"!==fx.env.NODE_ENV&&((0|N)<0||N>1073741824))throw ji(16,"".concat(N));return gy.set(R,N),gA.set(N,R),N},yx=function(R,N){g_=N+1,gy.set(R,N),gA.set(N,R)},gS="style[".concat(fU,"][").concat(fG,'="').concat(fq,'"]'),gE=new RegExp("^".concat(fU,'\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)')),Ax=function(R,N,W){for(var j,B=W.split(","),z=0,U=B.length;z<U;z++)(j=B[z])&&R.registerName(N,j)},Ex=function(R,N){for(var W,j=(null!==(W=N.textContent)&&void 0!==W?W:"").split(fX),B=[],z=0,U=j.length;z<U;z++){var V=j[z].trim();if(V){var G=V.match(gE);if(G){var Y=0|parseInt(G[1],10),Z=G[2];0!==Y&&(yx(Z,Y),Ax(R,Z,G[3]),R.getTag().insertRules(Y,B)),B.length=0}else B.push(V)}}},Jy=function(R){var N,j=document.head,B=R||j,z=document.createElement("style"),U=(N=Array.from(B.querySelectorAll("style[".concat(fU,"]"))))[N.length-1],V=void 0!==U?U.nextSibling:null;z.setAttribute(fU,fV),z.setAttribute(fG,fq);var G=W.nc;return G&&z.setAttribute("nonce",G),B.insertBefore(z,V),z},gk=function(){function r(R){this.element=Jy(R),this.element.appendChild(document.createTextNode("")),this.sheet=function(R){if(R.sheet)return R.sheet;for(var N=document.styleSheets,W=0,j=N.length;W<j;W++){var B=N[W];if(B.ownerNode===R)return B}throw ji(17)}(this.element),this.length=0}return r.prototype.insertRule=function(R,N){try{return this.sheet.insertRule(N,R),this.length++,!0}catch{return!1}},r.prototype.deleteRule=function(R){this.sheet.deleteRule(R),this.length--},r.prototype.getRule=function(R){var N=this.sheet.cssRules[R];return N&&N.cssText?N.cssText:""},r}(),gC=function(){function r(R){this.element=Jy(R),this.nodes=this.element.childNodes,this.length=0}return r.prototype.insertRule=function(R,N){if(R<=this.length&&R>=0){var W=document.createTextNode(N);return this.element.insertBefore(W,this.nodes[R]||null),this.length++,!0}return!1},r.prototype.deleteRule=function(R){this.element.removeChild(this.nodes[R]),this.length--},r.prototype.getRule=function(R){return R<this.length?this.nodes[R].textContent:""},r}(),gM=function(){function r(R){this.rules=[],this.length=0}return r.prototype.insertRule=function(R,N){return R<=this.length&&(this.rules.splice(R,0,N),this.length++,!0)},r.prototype.deleteRule=function(R){this.rules.splice(R,1),this.length--},r.prototype.getRule=function(R){return R<this.length?this.rules[R]:""},r}(),gT=fY,gR={isServer:!fY,useCSSOMInjection:!fK},gP=function(){function r(R,N,W){void 0===R&&(R=f1),void 0===N&&(N={});var j=this;this.options=Te(Te({},gR),R),this.gs=N,this.names=new Map(W),this.server=!!R.isServer,!this.server&&fY&&gT&&(gT=!1,function(R){for(var N=document.querySelectorAll(gS),W=0,j=N.length;W<j;W++){var B=N[W];B&&B.getAttribute(fU)!==fV&&(Ex(R,B),B.parentNode&&B.parentNode.removeChild(B))}}(this)),n0(this,function(){return function(R){for(var N=R.getTag(),W=N.length,j="",B=0;B<W;B++)(function(W){var B=gA.get(W);if(void 0!==B){var z=R.names.get(B),U=N.getGroup(W);if(void 0!==z&&0!==U.length){var V="".concat(fU,".g").concat(W,'[id="').concat(B,'"]'),G="";void 0!==z&&z.forEach(function(R){R.length>0&&(G+="".concat(R,","))}
45),j+="".concat(U).concat(V,'{content:"').concat(G,'"}').concat(fX)}}})(B);return j}(j)})}return r.registerId=function(R){return cd(R)},r.prototype.reconstructWithOptions=function(R,N){return void 0===N&&(N=!0),new r(Te(Te({},this.options),R),this.gs,N&&this.names||void 0)},r.prototype.allocateGSInstance=function(R){return this.gs[R]=(this.gs[R]||0)+1},r.prototype.getTag=function(){var R,N,W,j;return this.tag||(this.tag=(W=(N=this.options).useCSSOMInjection,j=N.target,R=N.isServer?new gM(j):W?new gk(j):new gC(j),new gv(R)))},r.prototype.hasNameForId=function(R,N){return this.names.has(R)&&this.names.get(R).has(N)},r.prototype.registerName=function(R,N){if(cd(R),this.names.has(R))this.names.get(R).add(N);else{var W=new Set;W.add(N),this.names.set(R,W)}},r.prototype.insertRules=function(R,N,W){this.registerName(R,N),this.getTag().insertRules(cd(R),W)},r.prototype.clearNames=function(R){this.names.has(R)&&this.names.get(R).clear()},r.prototype.clearRules=function(R){this.getTag().clearGroup(cd(R)),this.clearNames(R)},r.prototype.clearTag=function(){this.tag=void 0},r}(),gI=/&/g,gD=/^\s*\/\/.*$/gm,gN=new gP,gO=(G=void 0===(V=f1.options)?f1:V,Z=void 0===(Y=f1.plugins)?fZ:Y,te=function(R,N,W){return W.startsWith(z)&&W.endsWith(z)&&W.replaceAll(z,"").length>0?".".concat(B):R},(tn=Z.slice()).push(function(R){R.type===fT&&R.value.includes("&")&&(R.props[0]=R.props[0].replace(gI,z).replace(U,te))}),G.prefix&&tn.push(function(R,N,W,j){if(R.length>-1&&!R.return)switch(R.type){case fR:R.return=function Hy(R,N,W){var j;switch(j=N,45^pe(R,0)?(((j<<2^pe(R,0))<<2^pe(R,1))<<2^pe(R,2))<<2^pe(R,3):0){case 5103:return fC+"print-"+R+R;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return fC+R+R;case 4789:return fk+R+R;case 5349:case 4246:case 4810:case 6968:case 2756:return fC+R+fk+R+fE+R+R;case 5936:switch(pe(R,N+11)){case 114:return fC+R+fE+pt(R,/[svh]\w+-[tblr]{2}/,"tb")+R;case 108:return fC+R+fE+pt(R,/[svh]\w+-[tblr]{2}/,"tb-rl")+R;case 45:return fC+R+fE+pt(R,/[svh]\w+-[tblr]{2}/,"lr")+R}case 6828:case 4268:case 2903:return fC+R+fE+R+R;case 6165:return fC+R+fE+"flex-"+R+R;case 5187:return fC+R+pt(R,/(\w+).+(:[^]+)/,fC+"box-$1$2"+fE+"flex-$1$2")+R;case 5443:return fC+R+fE+"flex-item-"+pt(R,/flex-|-self/g,"")+(li(R,/flex-|baseline/)?"":fE+"grid-row-"+pt(R,/flex-|-self/g,""))+R;case 4675:return fC+R+fE+"flex-line-pack"+pt(R,/align-content|flex-|-self/g,"")+R;case 5548:return fC+R+fE+pt(R,"shrink","negative")+R;case 5292:return fC+R+fE+pt(R,"basis","preferred-size")+R;case 6060:return fC+"box-"+pt(R,"-grow","")+fC+R+fE+pt(R,"grow","positive")+R;case 4554:return fC+pt(R,/([^-])(transform)/g,"$1"+fC+"$2")+R;case 6187:return pt(pt(pt(R,/(zoom-|grab)/,fC+"$1"),/(image-set)/,fC+"$1"),R,"")+R;case 5495:case 3959:return pt(R,/(image-set\([^]*)/,fC+"$1$`$1");case 4968:return pt(pt(R,/(.+:)(flex-)?(.*)/,fC+"box-pack:$3"+fE+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+fC+R+R;case 4200:if(!li(R,/flex-|baseline/))return fE+"grid-column-align"+Va(R,N)+R;break;case 2592:case 3360:return fE+pt(R,"template-","")+R;case 4384:case 3616:return W&&W.some(function(R,W){return N=W,li(R.props,/grid-\w+-end/)})?~bd(R+(W=W[N].value),"span",0)?R:fE+pt(R,"-start","")+R+fE+"grid-row-span:"+(~bd(W,"span",0)?li(W,/\d+/):+li(W,/\d+/)-+li(R,/\d+/))+";":fE+pt(R,"-start","")+R;case 4896:case 4128:return W&&W.some(function(R){return li(R.props,/grid-\w+-start/)})?R:fE+pt(pt(R,"-end","-span"),"span ","")+R;case 4095:case 3583:case 4068:case 2532:return pt(R,/(.+)-inline(.+)/,fC+"$1$2")+R;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(ti(R)-1-N>6)switch(pe(R,N+1)){case 109:if(45!==pe(R,N+4))break;case 102:return pt(R,/(.+:)(.+)-([^]+)/,"$1"+fC+"$2-$3$1"+fk+(108==pe(R,N+3)?"$3":"$2-$3"))+R;case 115:return~bd(R,"stretch",0)?Hy(pt(R,"stretch","fill-available"),N,W)+R:R}break;case 5152:case 5920:return pt(R,/(.+?):(\d+)(\s*\/\s*(span)?\s*(\d+))?(.*)/,function(N,W,j,B,z,U,V){return fE+W+":"+j+V+(B?fE+W+"-span:"+(z?U:+U-+j)+V:"")+R});case 4949:if(121===pe(R,N+6))return pt(R,":",":"+fC)+R;break;case 6444:switch(pe(R,45===pe(R,14)?18:11)){case 120:return pt(R,/(.+:)([^;\s!]+)(;|(\s+)?!.+)?/,"$1"+fC+(45===pe(R,14)?"inline-":"")+"box$3$1"+fC+"$2$3$1"+fE+"$2box$3")+R;case 100:return pt(R,":",":"+fE)+R}break;case 5719:case 2647:case 2135:case 3927:case 2391:return pt(R,"scroll-","scroll-snap-")+R}return R}(R.value,R.length,W);return;case fI:return Jd([Xi(R,{value:pt(R.value,"@","@"+fC)})],j);case fT:if(R.length)return(W=R.props).map(function(N){switch(li(N,j=/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":uo(Xi(R,{props:[pt(N,/:(read-\w+)/,":"+fk+"$1")]})),uo(Xi(R,{props:[N]})),fO(R,{props:Q0(W,j)});break;case"::placeholder":uo(Xi(R,{props:[pt(N,/:(plac\w+)/,":"+fC+"input-$1")]})),uo(Xi(R,{props:[pt(N,/:(plac\w+)/,":"+fk+"$1")]})),uo(Xi(R,{props:[pt(N,/:(plac\w+)/,fE+"input-$1")]})),uo(Xi(R,{props:[N]})),fO(R,{props:Q0(W,j)})}return""}).join("")}}),tn.push(function(R,N,W,j){switch(R.type){case"@layer":if(R.children.length)break;case"@import":case fR:return R.return=R.return||R.value;case fM:return"";case fI:return R.return=R.value+"{"+Jd(R.children,j)+"}";case fT:if(!ti(R.value=R.props.join(",")))return""}return ti(W=Jd(R.children,j))?R.return=R.value+"{"+W+"}":""}),(tr=function(R,N,W,j){void 0===N&&(N=""),void 0===W&&(W=""),void 0===j&&(j="&"),B=j,z=N,U=RegExp("\\".concat(z,"\\b"),"g");var V,Y,Z,te,tr,ts=R.replace(gD,""),ta=(tr=function Ad(R,N,W,j,B,z,U,V,G){for(var Y,Z=0,te=0,tn=U,tr=0,ts=0,ta=0,th=1,tc=1,tu=1,tp=0,tf="",tg=B,tm=z,tw=j,ty=tf;tc;)switch(ta=tp,tp=kn()){case 40:if(108!=ta&&58==pe(ty,tn-1)){-1!=bd(ty+=pt(Hp(tp),"&","&\f"),"&\f",fD(Z?V[Z-1]:0))&&(tu=-1);break}case 34:case 39:case 91:ty+=Hp(tp);break;case 9:case 10:case 13:case 32:ty+=function(R){for(;(f$=Xs())&&f$<33;)kn();return dg(R)>2||dg(f$)>3?"":" "}(ta);break;case 92:ty+=function(R,N){for(var W;
45--N&&kn()&&!(f$<48||f$>102||f$>57&&f$<65||f$>70&&f$<97););return W=fB+(N<6&&32==Xs()&&32==kn()),Va(fz,R,W)}(fB-1,7);continue;case 47:switch(Xs()){case 42:case 47:sl(Zf(Y=function(R,N){for(;kn()&&R+f$!==57&&(R+f$!==84||47!==Xs()););return"/*"+Va(fz,N,fB-1)+"*"+fN(47===R?R:kn())}(kn(),fB),N,W,fM,fN(f$),Va(Y,2,-2),0,G),G);break;default:ty+="/"}break;case 123*th:V[Z++]=ti(ty)*tu;case 125*th:case 59:case 0:switch(tp){case 0:case 125:tc=0;case 59+te:-1==tu&&(ty=pt(ty,/\f/g,"")),ts>0&&ti(ty)-tn&&sl(ts>32?ev(ty+";",j,W,tn-1,G):ev(pt(ty," ","")+";",j,W,tn-2,G),G);break;case 59:ty+=";";default:if(sl(tw=tv(ty,N,W,Z,te,B,V,tf,tg=[],tm=[],tn,z),z),123===tp){if(0===te)Ad(ty,N,tw,tw,tg,z,tn,V,tm);else switch(99===tr&&110===pe(ty,3)?100:tr){case 100:case 108:case 109:case 115:Ad(R,tw,tw,j&&sl(tv(R,tw,tw,0,0,B,V,tf,B,tg=[],tn,tm),tm),B,tm,tn,V,j?tg:tm);break;default:Ad(ty,tw,tw,tw,[""],tm,0,V,tm)}}}Z=te=ts=0,th=tu=1,tf=ty="",tn=U;break;case 58:tn=1+ti(ty),ts=ta;default:if(th<1){if(123==tp)--th;else if(125==tp&&0==th++&&125==(f$=fB>0?pe(fz,--fB):0,fW--,10===f$&&(fW=1,fF--),f$))continue}switch(ty+=fN(tp),tp*th){case 38:tu=te>0?1:(ty+="\f",-1);break;case 44:V[Z++]=(ti(ty)-1)*tu,tu=1;break;case 64:45===Xs()&&(ty+=Hp(kn())),tr=Xs(),te=tn=ti(tf=ty+=function(R){for(;!dg(Xs());)kn();return Va(fz,R,fB)}(fB)),tp++;break;case 45:45===ta&&2==ti(ty)&&(th=0)}}return z}("",null,null,null,[""],(te=Z=W||N?"".concat(W," ").concat(N," { ").concat(ts," }"):ts,fF=fW=1,fj=ti(fz=te),fB=0,Z=[]),0,[0],Z),fz="",tr);G.namespace&&(ta=function tb(R,N){return R.map(function(R){return"rule"===R.type&&(R.value="".concat(N," ").concat(R.value),R.value=R.value.replaceAll(",",",".concat(N," ")),R.props=R.props.map(function(R){return"".concat(N," ").concat(R)})),Array.isArray(R.children)&&"@keyframes"!==R.type&&(R.children=tb(R.children,N)),R})}(ta,G.namespace));var th=[];return Jd(ta,(Y=(V=tn.concat(function(R){var N;R.root||(R=R.return)&&(N=R,th.push(N))})).length,function(R,N,W,j){for(var B="",z=0;z<Y;z++)B+=V[z](R,N,W,j)||"";return B})),th}).hash=Z.length?Z.reduce(function(R,N){return N.name||ji(15),Or(R,N.name)},5381).toString():"",tr),gF=dK.createContext({shouldForwardProp:void 0,styleSheet:gN,stylis:gO});function cv(){return(0,dK.useContext)(gF)}gF.Consumer,dK.createContext(void 0);var gW=function(){function r(R,N){var W=this;this.inject=function(R,N){void 0===N&&(N=gO);var j=W.name+N.hash;R.hasNameForId(W.id,j)||R.insertRules(W.id,j,N(W.rules,j,"@keyframes"))},this.name=R,this.id="sc-keyframes-".concat(R),this.rules=N,n0(this,function(){throw ji(12,String(W.name))})}return r.prototype.getName=function(R){return void 0===R&&(R=gO),this.name+R.hash},r}();function hv(R){for(var N="",W=0;W<R.length;W++){var j=R[W];if(1===W&&"-"===j&&"-"===R[0])return R;j>="A"&&j<="Z"?N+="-"+j.toLowerCase():N+=j}return N.startsWith("ms-")?"-"+N:N}var nb=function(R){return null==R||!1===R||""===R},ib=function(R){var N=[];for(var W in R){var j=R[W];R.hasOwnProperty(W)&&!nb(j)&&(Array.isArray(j)&&j.isCss||Qs(j)?N.push("".concat(hv(W),":"),j,";"):Xa(j)?N.push.apply(N,Zs(Zs(["".concat(W," {")],ib(j),!1),["}"],!1)):N.push("".concat(hv(W),": ").concat(null==j||"boolean"==typeof j||""===j?"":"number"!=typeof j||0===j||W in fH||W.startsWith("--")?String(j).trim():"".concat(j,"px"),";")))}return N};function Ys(R,N,W,j){if(nb(R))return[];if(e0(R))return[".".concat(R.styledComponentId)];if(Qs(R)){if(!Qs(R)||R.prototype&&R.prototype.isReactComponent||!N)return[R];var B=R(N);return"production"===fx.env.NODE_ENV||"object"!=typeof B||Array.isArray(B)||B instanceof gW||Xa(B)||null===B||console.error("".concat(qy(R)," is not a styled component and cannot be referred to via component selector. See https://www.styled-components.com/docs/advanced#referring-to-other-components for more details.")),Ys(B,N,W,j)}return R instanceof gW?W?(R.inject(W,j),[R.getName(j)]):[R]:Xa(R)?ib(R):Array.isArray(R)?Array.prototype.concat.apply(fZ,R.map(function(R){return Ys(R,N,W,j)})):[R.toString()]}var gj=Vy(fq),gB=function(){function r(R,N,W){this.rules=R,this.staticRulesId="",this.isStatic="production"===fx.env.NODE_ENV&&(void 0===W||W.isStatic)&&function(R){for(var N=0;N<R.length;N+=1){var W=R[N];if(Qs(W)&&!e0(W))return!1}return!0}(R),this.componentId=N,this.baseHash=Or(gj,N),this.baseStyle=W,gP.registerId(N)}return r.prototype.generateAndInjectStyles=function(R,N,W){var j=this.baseStyle?this.baseStyle.generateAndInjectStyles(R,N,W):"";if(this.isStatic&&!W.hash){if(this.staticRulesId&&N.hasNameForId(this.componentId,this.staticRulesId))j=Ur(j,this.staticRulesId);else{var B=gg(Ys(this.rules,R,N,W)),z=pg(Or(this.baseHash,B)>>>0);if(!N.hasNameForId(this.componentId,z)){var U=W(B,".".concat(z),void 0,this.componentId);N.insertRules(this.componentId,z,U)}j=Ur(j,z),this.staticRulesId=z}}else{for(var V=Or(this.baseHash,W.hash),G="",Y=0;Y<this.rules.length;Y++){var Z=this.rules[Y];if("string"==typeof Z)G+=Z,"production"!==fx.env.NODE_ENV&&(V=Or(V,Z));
45else if(Z){var te=gg(Ys(Z,R,N,W));V=Or(V,te+Y),G+=te}}if(G){var tn=pg(V>>>0);N.hasNameForId(this.componentId,tn)||N.insertRules(this.componentId,tn,W(G,".".concat(tn),void 0,this.componentId)),j=Ur(j,tn)}}return j},r}(),g$=dK.createContext(void 0);function Ox(R){var N=dK.useContext(g$),W=(0,dK.useMemo)(function(){return function(R,N){if(!R)throw ji(14);if(Qs(R)){var W=R(N);if("production"!==fx.env.NODE_ENV&&(null===W||Array.isArray(W)||"object"!=typeof W))throw ji(7);return W}if(Array.isArray(R)||"object"!=typeof R)throw ji(8);return N?Te(Te({},N),R):R}(R.theme,N)},[R.theme,N]);return R.children?dK.createElement(g$.Provider,{value:W},R.children):null}g$.Consumer;var gz={},gH=new Set;function Nx(R,N,W){var j,B,z,U,V,G,Y=e0(R),Z=!zp(R),te=N.attrs,tn=void 0===te?fZ:te,tr=N.componentId,ts=void 0===tr?(j=N.displayName,B=N.parentComponentId,gz[z="string"!=typeof j?"sc":iv(j)]=(gz[z]||0)+1,U="".concat(z,"-").concat(pg(Vy(fq+z+gz[z])>>>0)),B?"".concat(B,"-").concat(U):U):tr,ta=N.displayName,th=void 0===ta?zp(R)?"styled.".concat(R):"Styled(".concat(qy(R),")"):ta,tc=N.displayName&&N.componentId?"".concat(iv(N.displayName),"-").concat(N.componentId):N.componentId||ts,tu=Y&&R.attrs?R.attrs.concat(tn).filter(Boolean):tn,tp=N.shouldForwardProp;if(Y&&R.shouldForwardProp){var tf=R.shouldForwardProp;if(N.shouldForwardProp){var tg=N.shouldForwardProp;tp=function(R,N){return tf(R,N)&&tg(R,N)}}else tp=tf}var tm=new gB(W,tc,Y?R.componentStyle:void 0);function P(R,N){return function(R,N,W){var j,B,z,U=R.attrs,V=R.componentStyle,G=R.defaultProps,Y=R.foldedComponentIds,Z=R.styledComponentId,te=R.target,tn=dK.useContext(g$),tr=cv(),ts=R.shouldForwardProp||tr.shouldForwardProp;"production"!==fx.env.NODE_ENV&&(0,dK.useDebugValue)(Z);var ta=(void 0===(j=G)&&(j=f1),N.theme!==j.theme&&N.theme||tn||j.theme||f1),th=function(R,N,W){for(var j,B=Te(Te({},N),{className:void 0,theme:W}),z=0;z<R.length;z+=1){var U=Qs(j=R[z])?j(B):j;for(var V in U)B[V]="className"===V?Ur(B[V],U[V]):"style"===V?Te(Te({},B[V]),U[V]):U[V]}return N.className&&(B.className=Ur(B.className,N.className)),B}(U,N,ta),tc=th.as||te,tu={};for(var tp in th)void 0===th[tp]||"$"===tp[0]||"as"===tp||"theme"===tp&&th.theme===ta||("forwardedAs"===tp?tu.as=th.forwardedAs:ts&&!ts(tp,tc)||(tu[tp]=th[tp],ts||"development"!==fx.env.NODE_ENV||fS(tp)||gH.has(tp)||!f2.has(tc)||(gH.add(tp),console.warn('styled-components: it looks like an unknown prop "'.concat(tp,'" is being sent through to the DOM, which will likely trigger a React console error. If you would like automatic filtering of unknown props, you can opt-into that behavior via `<StyleSheetManager shouldForwardProp={...}>` (connect an API like `@emotion/is-prop-valid`) or consider using transient props (`$` prefix for automatic filtering.)')))));var tf=(B=cv(),z=V.generateAndInjectStyles(th,B.styleSheet,B.stylis),"production"!==fx.env.NODE_ENV&&(0,dK.useDebugValue)(z),z);"production"!==fx.env.NODE_ENV&&R.warnTooManyClasses&&R.warnTooManyClasses(tf);var tg=Ur(Y,Z);return tf&&(tg+=" "+tf),th.className&&(tg+=" "+th.className),tu[zp(tc)&&!f2.has(tc)?"class":"className"]=tg,tu.ref=W,(0,dK.createElement)(tc,tu)}(tw,R,N)}P.displayName=th;var tw=dK.forwardRef(P);return tw.attrs=tu,tw.componentStyle=tm,tw.displayName=th,tw.shouldForwardProp=tp,tw.foldedComponentIds=Y?Ur(R.foldedComponentIds,R.styledComponentId):"",tw.styledComponentId=tc,tw.target=Y?R.target:R,Object.defineProperty(tw,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(N){this._foldedDefaultProps=Y?function(R){for(var N=[],W=1;W<arguments.length;W++)N[W-1]=arguments[W];for(var j=0;j<N.length;j++)(function mg(R,N,W){if(void 0===W&&(W=!1),!W&&!Xa(R)&&!Array.isArray(R))return N;if(Array.isArray(N))for(var j=0;j<N.length;j++)R[j]=mg(R[j],N[j]);else if(Xa(N))for(var j in N)R[j]=mg(R[j],N[j]);return R})(R,N[j],!0);return R}({},R.defaultProps,N):N}}),"production"!==fx.env.NODE_ENV&&(ex(th,tc),tw.warnTooManyClasses=(V={},G=!1,function(R){if(!G&&(V[R]=!0,Object.keys(V).length>=200)){var N=tc?' with the id of "'.concat(tc,'"'):"";console.warn("Over ".concat(200," classes were generated for component ").
45concat(th).concat(N,`. 46`)+`Consider using the attrs method, together with a style object for frequently changed styles. 47Example: 48 const Component = styled.div.attrs(props => ({ 49 style: { 50 background: props.background, 51 }, 52 }))\`width: 100%;\` 53 54 <Component />`),G=!0,V={}}})),n0(tw,function(){return".".concat(tw.styledComponentId)}),Z&&function Zy(R,N,W){if("string"!=typeof N){if(gf){var j=gu(N);j&&j!==gf&&Zy(R,j,W)}var B=gh(N);gc&&(B=B.concat(gc(N)));for(var z=sv(R),U=sv(N),V=0;V<B.length;++V){var G=B[V];if(!(G in gs||W&&W[G]||U&&G in U||z&&G in z)){var Y=gd(N,G);try{gl(R,G,Y)}catch{}}}}return R}(tw,R,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0}),tw}function uv(R,N){for(var W=[R[0]],j=0,B=N.length;j<B;j+=1)W.push(N[j],R[j+1]);return W}var fv=function(R){return Object.assign(R,{isCss:!0})};function ep(R){for(var N=[],W=1;W<arguments.length;W++)N[W-1]=arguments[W];return Qs(R)||Xa(R)?fv(Ys(uv(fZ,Zs([R],N,!0)))):0===N.length&&1===R.length&&"string"==typeof R[0]?Ys(R):fv(Ys(uv(R,N)))}var rb=function(R){return function bg(R,N,W){if(void 0===W&&(W=f1),!N)throw ji(1,N);var n=function(j){for(var B=[],z=1;z<arguments.length;z++)B[z-1]=arguments[z];return R(N,W,ep.apply(void 0,Zs([j],B,!1)))};return n.attrs=function(j){return bg(R,N,Te(Te({},W),{attrs:Array.prototype.concat(W.attrs,j).filter(Boolean)}))},n.withConfig=function(j){return bg(R,N,Te(Te({},W),j))},n}(Nx,R)};f2.forEach(function(R){rb[R]=rb(R)}),"production"!==fx.env.NODE_ENV&&"u">typeof navigator&&"ReactNative"===navigator.product&&console.warn(`It looks like you've imported 'styled-components' on React Native. 55Perhaps you're looking to import 'styled-components/native'? 56Read more about this at https://www.styled-components.com/docs/basics#react-native`);var gU="__sc-".concat(fU,"__");"production"!==fx.env.NODE_ENV&&"test"!==fx.env.NODE_ENV&&"u">typeof window&&(window[gU]||(window[gU]=0),1===window[gU]&&console.warn(`It looks like there are several instances of 'styled-components' initialized in this application. This may cause dynamic styles to not render properly, errors during the rehydration process, a missing theme prop, and makes your application bigger without good reason. 57 58See https://s-c.sh/2BAXzed for more info.`),window[gU]+=1);let gV={en:{documentNavInfo:"Document {{ currentFileNo }} of {{ allFilesCount }}",noRendererMessage:"No renderer for file type: {{{ fileType }}}",downloadButtonLabel:"Download file",brokenFile:"Your file is broken. Please check it on your machine.",msgPluginRecipients:"Recipients",msgPluginSender:"Sender",pdfPluginLoading:"Loading...",pdfPluginPageNumber:"Page {{ currentPage }}/{{ allPagesCount }}"},pl:{documentNavInfo:"Dokument {{ currentFileNo }} z {{ allFilesCount }}",noRendererMessage:"Brak funckji renderujÄ cej dla: {{{ fileType }}}",downloadButtonLabel:"Pobierz plik",brokenFile:"Tw\xf3j plik jest uszkodzony. Sprawdź go na swoim komputerze.",msgPluginRecipients:"Odbiorcy",msgPluginSender:"Nadawca",pdfPluginLoading:"Wczytywanie...",pdfPluginPageNumber:"Strona {{ currentPage }}/{{ allPagesCount }}"},es:{documentNavInfo:"Documento {{ currentFileNo }} de {{ allFilesCount }}",noRendererMessage:"No hay procesador para el tipo de archivo: {{{ fileType }}}",downloadButtonLabel:"Descargar archivo",brokenFile:"Tu archivo est\xe1 roto. Compru\xe9balo en tu m\xe1quina.",msgPluginRecipients:"Destinatarios",msgPluginSender:"Remitente",pdfPluginLoading:"Cargando...",pdfPluginPageNumber:"P\xe1gina {{ currentPage }}/{{ allPagesCount }}"},de:{documentNavInfo:"Dokument {{ currentFileNo }} von {{ allFilesCount }}",noRendererMessage:"Kein Renderer f\xfcr Dateityp: {{{ fileType }}}",downloadButtonLabel:"Datei herunterladen",brokenFile:"Ihre Datei ist defekt. Bitte \xfcberpr\xfcfen Sie sie auf Ihrem Rechner.",msgPluginRecipients:"Empf\xe4nger",msgPluginSender:"Absender",pdfPluginLoading:"Wird geladen...",pdfPluginPageNumber:"Seite {{ currentPage }}/{{ allPagesCount }}"},it:{documentNavInfo:"Documento {{ currentFileNo }} di {{ allFilesCount }}",noRendererMessage:"Nessun renderer per il tipo di file: {{{ fileType }}}",downloadButtonLabel:"Scarica file",brokenFile:"Il tuo file \xe8 danneggiato. Controllalo sul tuo computer.",msgPluginRecipients:"Destinatari",msgPluginSender:"Mittente",pdfPluginLoading:"Caricamento in corso...",pdfPluginPageNumber:"Pagina {{ currentPage }}/{{ allPagesCount }}"},pt:{documentNavInfo:"Documento {{ currentFileNo }} de {{ allFilesCount }}",noRendererMessage:"Nenhum renderizador para o tipo de arquivo: {{{ fileType }}}",downloadButtonLabel:"Baixar arquivo",brokenFile:"Seu arquivo est\xe1 quebrado. Por favor, verifique-o em sua m\xe1quina.",msgPluginRecipients:"Destinat\xe1rios",msgPluginSender:"Remetente",pdfPluginLoading:"Carregando...",pdfPluginPageNumber:"P\xe1gina {{ currentPage }}/{{ allPagesCount }}"},fr:{documentNavInfo:"Document {{ currentFileNo }} de {{ allFilesCount }}",noRendererMessage:"Aucun moteur de rendu pour le type de fichier : {{{ fileType }}}",downloadButtonLabel:"T\xe9l\xe9charger le fichier",brokenFile:"Votre fichier est cass\xe9. Veuillez le v\xe9rifier sur votre machine.",msgPluginRecipients:"Destinataires",msgPluginSender:"Exp\xe9diteur",pdfPluginLoading:"Chargement...",pdfPluginPageNumber:"Page {{ currentPage }}/{{ allPagesCount }}"},ar:{documentNavInfo:"Ù Ø³ØªÙØ¯ {{ currentFileNo }} Ù Ù {{ allFilesCount }}",noRendererMessage:"{{{ fileType }}} : ÙØ§ ÙÙ ÙÙÙØ§ عرض ÙØ°Ø§ اÙÙÙØ¹ ٠٠اÙÙ ÙÙØ§Øª",downloadButtonLabel:"تØÙ Ù٠اÙÙ ÙÙ",brokenFile:"اÙÙ Ù٠تاÙÙØ ÙØ±Ø¬Ù Ø§ÙØªØÙÙ Ù Ù٠عÙÙ Ø¬ÙØ§Ø²Ù Ø§ÙØ®Ø§Øµ.",msgPluginRecipients:"اÙ٠ستÙÙ ÙÙ",msgPluginSender:"اÙ٠رسÙ",pdfPluginLoading:"تØÙ ÙÙ ...",pdfPluginPageNumber:" {{ allPagesCount }} \\ {{ currentPage }} ØµÙØØ© "},sr:{documentNavInfo:"Dokument {{ currentFileNo }} od {{ allFilesCount }}",noRendererMessage:"Ne postoji pregledaÄ za tip fajla: {{ fileType }}",downloadButtonLabel:"Preuzimanje fajla",brokenFile:"VaÅ¡ fajl nije dobar. Molimo Vas da probate da ga otvorite na vaÅ¡em raÄunaru.",msgPluginRecipients:"Primaoci",msgPluginSender:"PoÅ¡iljalac",pdfPluginLoading:"UÄitavanje...",pdfPluginPageNumber:"Strana {{ currentPage }}/{{ allPagesCount }}"},sr_cyr:{documentNavInfo:"ÐокÑÐ¼ÐµÐ½Ñ {{ currentFileNo }} od {{ allFilesCount }}",noRendererMessage:"Ðе поÑÑоÑи пÑÐµÐ³Ð»ÐµÐ´Ð°Ñ Ð·Ð° Ñип ÑаÑла: {{ fileType }}",downloadButtonLabel:"ÐÑеÑзимаÑе ÑаÑла",brokenFile:"ÐÐ°Ñ ÑаÑл ниÑе добаÑ. Ðолимо ÐÐ°Ñ Ð´Ð° пÑобаÑе да га оÑвоÑиÑе на ваÑем ÑаÑÑнаÑÑ.",msgPluginRecipients:"ÐÑимаоÑи",msgPluginSender:"ÐоÑиÑалаÑ",pdfPluginLoading:"УÑиÑаваÑе...",pdfPluginPageNumber:"СÑÑана {{ currentPage }}/{{ allPagesCount }}"},ja:{documentNavInfo:"ãã¡ã¤ã« {{ currentFileNo }} / {{ allFilesCount }}
58",noRendererMessage:"ãã¡ã¤ã«ã¿ã¤ãã«å¯¾å¿ããã¬ã³ãã©ã¼ã¯ããã¾ãã: {{ fileType }}",downloadButtonLabel:"ãã¦ã³ãã¼ã",brokenFile:"ãã¡ã¤ã«ãå£ãã¦ãã¾ããããªãã®ãã·ã³ã§ãã¡ã¤ã«ã確èªãã¦ãã ããã",msgPluginRecipients:"åä¿¡è ",msgPluginSender:"éä¿¡è ",pdfPluginLoading:"ãã¼ãã£ã³ã°ä¸...",pdfPluginPageNumber:"ãã¼ã¸ {{ currentPage }}/{{ allPagesCount }}"},ru:{documentNavInfo:"ÐокÑÐ¼ÐµÐ½Ñ {{ currentFileNo }} из {{ allFilesCount }}",noRendererMessage:"ÐаннÑй Ñип Ñайла не поддеÑживаеÑÑÑ ÑендеÑом: {{{ fileType }}}",downloadButtonLabel:"СкаÑаÑÑ Ñайл",brokenFile:"ÐÐ°Ñ Ñайл Ñломан. ÐожалÑйÑÑа, пÑовеÑÑÑе его на ÑвоÑм комÑÑÑеÑе.",msgPluginRecipients:"ÐолÑÑаÑели",msgPluginSender:"ÐÑпÑавиÑелÑ",pdfPluginLoading:"ÐагÑÑзка...",pdfPluginPageNumber:"СÑÑаниÑа {{ currentPage }}/{{ allPagesCount }}"},se:{documentNavInfo:"Dokument {{ currentFileNo }} av {{ allFilesCount }}",noRendererMessage:"Ingen renderare f\xf6r filtypen: {{{ fileType }}}",downloadButtonLabel:"Ladda ner",brokenFile:"Filen \xe4r trasig. Var v\xe4nlig kontrollera den p\xe5 din maskin.",msgPluginRecipients:"Mottagare",msgPluginSender:"Avs\xe4ndare",pdfPluginLoading:"Laddar...",pdfPluginPageNumber:"Sida {{ currentPage }}/{{ allPagesCount }}"},tr:{documentNavInfo:"Belge {{ currentFileNo }} / {{ allFilesCount }}",noRendererMessage:"Dosya t\xfcr\xfc i\xe7in g\xf6r\xfcnt\xfcleyici bulunamadı: {{{ fileType }}}",downloadButtonLabel:"Dosyayı indir",brokenFile:"Dosyanız bozuk. L\xfctfen kendi cihazınızda kontrol edin.",msgPluginRecipients:"Alıcılar",msgPluginSender:"G\xf6nderen",pdfPluginLoading:"Y\xfckleniyor...",pdfPluginPageNumber:"Sayfa {{ currentPage }}/{{ allPagesCount }}"}},gG=(Object.keys(gV),"SET_ALL_DOCUMENTS"),gq="SET_DOCUMENT_LOADING",gX="NEXT_DOCUMENT",gY="PREVIOUS_DOCUMENT",gK="UPDATE_CURRENT_DOCUMENT",gQ="SET_RENDERER_RECT",gJ="SET_MAIN_CONFIG",iP=(R,N)=>({type:gG,documents:R,initialActiveDocument:N}),Vp=R=>({type:gq,value:R}),r0=()=>({type:gX}),s0=()=>({type:gY}),wg=R=>({type:gK,document:R}),rP=R=>({type:gQ,rect:R}),sP=R=>({type:gJ,config:R}),gZ={currentFileNo:0,documents:[],documentLoading:!0,currentDocument:void 0,rendererRect:void 0,config:{},pluginRenderers:[],language:"en"},oP=(R=gZ,N)=>{switch(N.type){case gG:{let{documents:W,initialActiveDocument:j}=N;return{...R,documents:W,currentDocument:j||W[0]||null,currentFileNo:j&&W.includes(j)?W.indexOf(j):gZ.currentFileNo}}case gq:{let{value:W}=N;return{...R,documentLoading:W}}case gX:{if(R.currentFileNo>=R.documents.length-1)return R;let N=R.currentFileNo+1;return R.onDocumentChange&&R.onDocumentChange(R.documents[N]),{...R,currentFileNo:N,currentDocument:R.documents[N],documentLoading:!0}}case gY:{if(R.currentFileNo<=0)return R;let N=R.currentFileNo-1;return R.onDocumentChange&&R.onDocumentChange(R.documents[N]),{...R,currentFileNo:R.currentFileNo-1,currentDocument:R.documents[N],documentLoading:!0}}case gK:{let{document:W}=N;return{...R,currentDocument:W,currentFileNo:R.documents.findIndex(R=>R.uri===W.uri)}}case gQ:{let{rect:W}=N;return{...R,rendererRect:W}}case gJ:{let{config:W}=N;return{...R,config:W}}default:return R}},g1=(0,dK.createContext)({state:gZ,dispatch:()=>null}),g3=(0,dK.forwardRef)((R,N)=>{let{children:W,documents:j,config:B,pluginRenderers:z,prefetchMethod:U,requestHeaders:V,initialActiveDocument:G,language:Y,activeDocument:Z,onDocumentChange:te}=R,[tn,tr]=(0,dK.useReducer)(oP,{...gZ,documents:j||[],currentDocument:j&&j.length?G||j[0]:void 0,config:B,pluginRenderers:z,prefetchMethod:U,requestHeaders:V,currentFileNo:G?j.findIndex(R=>R===G)??0:0,language:Y&&gV[Y]?Y:"en",activeDocument:Z,onDocumentChange:te});return(0,dK.useEffect)(()=>{tr(iP(j,G)),B&&tr(sP(B))},[j,B,G]),(0,dK.useEffect)(()=>{Z&&tr(wg(Z))},[Z]),(0,dK.useImperativeHandle)(N,()=>({prev(){tr(s0())},next(){tr(r0())}}),[tr]),(0,dY.jsx)(g1.Provider,{value:{state:tn,dispatch:tr},children:W})}),g5=ep` 59 background-color: ${R=>R.theme.primary}; 60 color: ${R=>R.theme.textPrimary}; 61`,g4=ep` 62 background-color: ${R=>R.theme.secondary}; 63 color: ${R=>R.theme.textSecondary}; 64`,g6=rb.button` 65 ${g5} 66 display: flex; 67 justify-content: center; 68 align-items: center; 69 width: 35px; 70 height: 35px; 71 padding: 0; 72 margin: 0 0 0 5px; 73 text-align: center; 74 font-size: 18px; 75 border: 0; 76 outline: none; 77 cursor: pointer; 78 text-decoration: none; 79 border-radius: 35px; 80 opacity: ${R=>R.disabled?.4:1}; 81 pointer-events: ${R=>R.disabled?"none":"all"}; 82 box-shadow: 2px 2px 3px #00000033; 83 84 @media (max-width: 768px) { 85 width: 30px; 86 height: 30px; 87 font-size: 15px; 88 } 89`,g8=rb.a` 90 display: flex; 91 justify-content: center; 92 align-items: center; 93 border: 0; 94 outline: none; 95 cursor: pointer; 96 text-decoration: none; 97 border-radius: 35px; 98 background-color: ${R=>R.theme.primary}; 99 color: ${R=>R.theme.textPrimary}; 100 box-shadow: 2px 2px 3px #00000033; 101 102 width: 35px; 103 height: 35px; 104 font-size: 18px; 105 @media (max-width: 768px) { 106 width: 30px; 107 height: 30px; 108 font-size: 15px; 109 } 110`;rb(g6)``;let g7=rb(g6)` 111 ${g4} 112`,dP=R=>(0,dY.jsx)(fb,{...R}),uP=R=>(0,dY.jsx)(fb,{...R,reverse:!0}),fb=({color:R,size:N,reverse:W})=>(0,dY.jsx)("svg",{width:N||"100%",height:N||"100%",style:{transform:`${W?"rotate(180deg)":""}`},id:"arrow_left",version:"1.1",viewBox:"0 0 32 32",xmlSpace:"preserve",children:(0,dY.jsx)("path",{clipRule:"evenodd",d:"M31.106,15H3.278l8.325-8.293 c0.391-0.391,0.391-1.024,0-1.414c-0.391-0.391-1.024-0.391-1.414,0l-9.9,9.899c-0.385,0.385-0.385,1.029,0,1.414l9.9,9.9 c0.391,0.391,1.024,0.391,1.414,0c0.391-0.391,0.391-1.024,0-1.414L3.278,17h27.828c0.552,0,1-0.448,1-1 C32.106,15.448,31.658,15,31.106,15z",fill:R||"#aaa",fillRule:"evenodd",id:"Arrow_Back"})}),fP=R=>{let{color:N,size:W}=R;return(0,dY.jsx)("svg",{width:W||"100%",height:W||"100%",version:"1.1",id:"Icons",viewBox:"0 0 32 32",xmlSpace:"preserve",style:{alignSelf:"center",justifySelf:"center"},children:(0,dY.jsxs)("g",{children:[(0,dY.jsx)("path",{fill:N||"#aaa",d:"M16,2c-0.6,0-1,0.4-1,1v5c0,0.6,0.4,1,1,1s1-0.4,1-1V3C17,2.4,16.6,2,16,2z"}),(0,dY.jsx)("path",{fill:N||"#aaa",d:`M7.5,6.1c-0.4-0.4-1-0.4-1.4,0s-0.4,1,0,1.4l3.5,3.5c0.2,0.2,0.5,0.3,0.7,0.3s0.5-0.1,0.7-0.3c0.4-0.4,0.4-1,0-1.4L7.5,6.1 113 z`}),(0,dY.jsx)("path",{fill:N||"#aaa",d:"M9,16c0-0.6-0.4-1-1-1H3c-0.6,0-1,0.4-1,1s0.4,1,1,1h5C8.6,17,9,16.6,9,16z"}),(0,dY.jsx)("path",{fill:N||"#aaa",d:`M9.6,20.9l-3.5,3.5c-0.4,0.4-0.4,1,0,1.4c0.2,0.2,0.5,0.3,0.7,0.3s0.5-0.1,0.7-0.3l3.5-3.5c0.4-0.4,0.4-1,0-1.4 114 S10,20.6,9.6,20.9z`}),(0,dY.jsx)("path",{fill:N||"#aaa",d:"M16,23c-0.6,0-1,0.4-1,1v5c0,0.6,0.4,1,1,1s1-0.4,1-1v-5C17,23.4,16.6,23,16,23z"}),(0,dY.jsx)("path",{fill:N||"#aaa",d:`M22.4,20.9c-0.4-0.4-1-0.4-1.4,0s-0.4,1,0,1.4l3.5,3.5c0.2,0.2,0.5,0.3,0.7,0.3s0.5-0.1,0.7-0.3c0.4-0.4,0.4-1,0-1.4 115 L22.4,20.9z`}),(0,dY.jsx)("path",{fill:N||"#aaa",d:"M29,15h-5c-0.6,0-1,0.4-1,1s0.4,1,1,1h5c0.6,0,1-0.4,1-1S29.6,15,29,15z"}),(0,dY.jsx)("path",{fill:N||"#aaa",d:`M21.7,11.3c0.3,0,0.5-0.1,0.7-0.3l3.5-3.5c0.4-0.4,0.4-1,0-1.4s-1-0.4-1.4,0l-3.5,3.5c-0.4,0.4-0.4,1,0,1.4 116 C21.1,11.2,21.4,11.3,21.7,11.3z`})]})})};/*! 117 * mustache.js - Logic-less {{mustache}} templates with JavaScript 118 * http://github.com/janl/mustache.js 119 */var g9=Object.prototype.toString,me=Array.isArray||function(R){return"[object Array]"===g9.call(R)};function o0(R){return"function"==typeof R}function Wp(R){return R.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function pv(R,N){return null!=R&&"object"==typeof R&&N in R}var mi=RegExp.prototype.test,mn=/\S/,mr={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`","=":"="},ms=/\s*/,ma=/\s+/,mo=/\s*=/,ml=/\s*\}/,mh=/#|\^|\/|>|\{|&|=|!/;function Zh(R){this.string=R,this.tail=R,this.pos=0}function Ya(R,N){this.view=R,this.cache={".":this.view},this.parent=N}function Ne(){this.templateCache={_cache:{},set:function(R,N){this._cache[R]=N},get:function(R){return this._cache[R]},clear:function(){this._cache={}}}}Zh.prototype.eos=function(){return""===this.tail},Zh.prototype.scan=function(R){var N=this.tail.match(R);if(!N||0!==N.index)return"";var W=N[0];return this.tail=this.tail.substring(W.length),this.pos+=W.length,W},Zh.prototype.scanUntil=function(R){var N,W=this.tail.search(R);switch(W){case -1:N=this.tail,this.tail="";break;case 0:N="";break;default:N=this.tail.substring(0,W),this.tail=this.tail.substring(W)}return this.pos+=N.length,N},Ya.prototype.push=function(R){return new Ya(R,this)},Ya.prototype.lookup=function(R){var N,W=this.cache;if(W.hasOwnProperty(R))N=W[R];else{for(var j,B,z,U,V,G=this,Y=!1;G;){if(R.indexOf(".")>0)for(z=G.view,U=R.split("."),V=0;null!=z&&V<U.length;
119)V===U.length-1&&(Y=pv(z,U[V])||(j=z,B=U[V],null!=j&&"object"!=typeof j&&j.hasOwnProperty&&j.hasOwnProperty(B))),z=z[U[V++]];else z=G.view[R],Y=pv(G.view,R);if(Y){N=z;break}G=G.parent}W[R]=N}return o0(N)&&(N=N.call(this.view)),N},Ne.prototype.clearCache=function(){"u">typeof this.templateCache&&this.templateCache.clear()},Ne.prototype.parse=function(R,N){var W=this.templateCache,j=R+":"+(N||mc.tags).join(":"),B="u">typeof W,z=B?W.get(j):void 0;return null==z&&(z=function(R,N){if(!R)return[];var W=!1,j=[],B=[],z=[],U=!1,V=!1,G="",Y=0;function h(){if(U&&!V)for(;z.length;)delete B[z.pop()];else z=[];U=!1,V=!1}function y(R){if("string"==typeof R&&(R=R.split(ma,2)),!me(R)||2!==R.length)throw Error("Invalid tags: "+R);Z=RegExp(Wp(R[0])+"\\s*"),te=RegExp("\\s*"+Wp(R[1])),tn=RegExp("\\s*"+Wp("}"+R[1]))}y(N||mc.tags);for(var Z,te,tn,tr,ts,ta,th,tc,tu,tp=new Zh(R);!tp.eos();){if(tr=tp.pos,ta=tp.scanUntil(Z))for(var tf,tg=0,tm=ta.length;tg<tm;++tg){(tf=th=ta.charAt(tg),mi.call(mn,tf))?(V=!0,W=!0,G+=" "):(z.push(B.length),G+=th),B.push(["text",th,tr,tr+1]),tr+=1,th===` 120`&&(h(),G="",Y=0,W=!1)}if(!tp.scan(Z))break;if(U=!0,ts=tp.scan(mh)||"name",tp.scan(ms),"="===ts?(ta=tp.scanUntil(mo),tp.scan(mo),tp.scanUntil(te)):"{"===ts?(ta=tp.scanUntil(tn),tp.scan(ml),tp.scanUntil(te),ts="&"):ta=tp.scanUntil(te),!tp.scan(te))throw Error("Unclosed tag at "+tp.pos);if(tc=">"==ts?[ts,ta,tr,tp.pos,G,Y,W]:[ts,ta,tr,tp.pos],Y++,B.push(tc),"#"===ts||"^"===ts)j.push(tc);else if("/"===ts){if(!(tu=j.pop()))throw Error('Unopened section "'+ta+'" at '+tr);if(tu[1]!==ta)throw Error('Unclosed section "'+tu[1]+'" at '+tr)}else"name"===ts||"{"===ts||"&"===ts?V=!0:"="===ts&&y(ta)}if(h(),tu=j.pop())throw Error('Unclosed section "'+tu[1]+'" at '+tp.pos);return function(R){for(var N,W=[],j=W,B=[],z=0,U=R.length;z<U;++z)switch((N=R[z])[0]){case"#":case"^":j.push(N),B.push(N),j=N[4]=[];break;case"/":B.pop()[5]=N[2],j=B.length>0?B[B.length-1][4]:W;break;default:j.push(N)}return W}(function(R){for(var N,W,j=[],B=0,z=R.length;B<z;++B)(N=R[B])&&("text"===N[0]&&W&&"text"===W[0]?(W[1]+=N[1],W[3]=N[3]):(j.push(N),W=N));return j}(B))}(R,N),B&&W.set(j,z)),z},Ne.prototype.render=function(R,N,W,j){var B=this.getConfigTags(j),z=this.parse(R,B),U=N instanceof Ya?N:new Ya(N,void 0);return this.renderTokens(z,U,W,R,j)},Ne.prototype.renderTokens=function(R,N,W,j,B){for(var z,U,V,G="",Y=0,Z=R.length;Y<Z;++Y)V=void 0,"#"===(U=(z=R[Y])[0])?V=this.renderSection(z,N,W,j,B):"^"===U?V=this.renderInverted(z,N,W,j,B):">"===U?V=this.renderPartial(z,N,W,B):"&"===U?V=this.unescapedValue(z,N):"name"===U?V=this.escapedValue(z,N,B):"text"===U&&(V=this.rawValue(z)),void 0!==V&&(G+=V);return G},Ne.prototype.renderSection=function(R,N,W,j,B){var z=this,U="",V=N.lookup(R[1]);if(V){if(me(V))for(var G=0,Y=V.length;G<Y;++G)U+=this.renderTokens(R[4],N.push(V[G]),W,j,B);else if("object"==typeof V||"string"==typeof V||"number"==typeof V)U+=this.renderTokens(R[4],N.push(V),W,j,B);else if(o0(V)){if("string"!=typeof j)throw Error("Cannot use higher-order sections without the original template");null!=(V=V.call(N.view,j.slice(R[3],R[5]),function(R){return z.render(R,N,W,B)}))&&(U+=V)}else U+=this.renderTokens(R[4],N,W,j,B);return U}},Ne.prototype.renderInverted=function(R,N,W,j,B){var z=N.lookup(R[1]);if(!z||me(z)&&0===z.length)return this.renderTokens(R[4],N,W,j,B)},Ne.prototype.indentPartial=function(R,N,W){for(var j=N.replace(/[^ \t]/g,""),B=R.split(` 121`),z=0;z<B.length;z++)B[z].length&&(z>0||!W)&&(B[z]=j+B[z]);return B.join(` 122`)},Ne.prototype.renderPartial=function(R,N,W,j){if(W){var B=this.getConfigTags(j),z=o0(W)?W(R[1]):W[R[1]];if(null!=z){var U=R[6],V=R[5],G=R[4],Y=z;0==V&&G&&(Y=this.indentPartial(z,G,U));var Z=this.parse(Y,B);return this.renderTokens(Z,N,W,Y,j)}}},Ne.prototype.unescapedValue=function(R,N){var W=N.lookup(R[1]);if(null!=W)return W},Ne.prototype.escapedValue=function(R,N,W){var j=this.getConfigEscape(W)||mc.escape,B=N.lookup(R[1]);if(null!=B)return"number"==typeof B&&j===mc.escape?String(B):j(B)},Ne.prototype.rawValue=function(R){return R[1]},Ne.prototype.getConfigTags=function(R){return me(R)?R:R&&"object"==typeof R?R.tags:void 0},Ne.prototype.getConfigEscape=function(R){if(R&&"object"==typeof R&&!me(R))return R.escape};var mc={name:"mustache.js",version:"4.2.0",tags:["{{","}}"],clearCache:void 0,escape:void 0,parse:void 0,render:void 0,Scanner:void 0,Context:void 0,Writer:void 0,set templateCache(r){md.templateCache=r},get templateCache(){return md.templateCache}},md=new Ne;mc.clearCache=function(){return md.clearCache()},mc.parse=function(R,N){return md.parse(R,N)},mc.render=function(R,N,W,j){if("string"!=typeof R)throw TypeError('Invalid template! Template should be a "string" but "'+(me(R)?"array":typeof R)+'" was given as the first argument for mustache#render(template, view, partials)');return md.render(R,N,W,j)},mc.escape=function(R){return String(R).replace(/[&<>"'`=\/]/g,function(R){return mr[R]})},mc.Scanner=Zh,mc.Context=Ya,mc.Writer=Ne;let oo=()=>{let{state:{language:R}}=(0,dK.useContext)(g1),N=gV.en;
122return{t:(0,dK.useCallback)((W,j)=>{let B=gV[R];return B[W]?mc.render(B[W],j):N[W]?mc.render(N[W],j):W},[R,N])}},kP=()=>{let{state:{currentDocument:R,currentFileNo:N,documents:W},dispatch:j}=(0,dK.useContext)(g1),{t:B}=oo();if(W.length<=1||!R)return null;let z=R.uri||"",U=null==z?void 0:z.split("/");return U.length&&(z=U[U.length-1]),(0,dY.jsxs)(mu,{id:"doc-nav",children:[(0,dY.jsx)("p",{id:"doc-nav-info",children:B("documentNavInfo",{currentFileNo:N+1,allFilesCount:W.length})}),(0,dY.jsx)(mf,{id:"doc-nav-prev",onClick:()=>j(s0()),disabled:0===N,children:(0,dY.jsx)(dP,{color:"#fff",size:"60%"})}),(0,dY.jsx)(mm,{id:"doc-nav-next",onClick:()=>j(r0()),disabled:N>=W.length-1,children:(0,dY.jsx)(uP,{color:"#fff",size:"60%"})})]})},mu=rb.div` 123 min-width: 150px; 124 display: flex; 125 flex-direction: row; 126 align-items: center; 127 justify-content: flex-end; 128 margin: 0 10px; 129 color: ${R=>R.theme.textPrimary}; 130`,mf=rb(g7)` 131 width: 30px; 132 height: 30px; 133 margin: 0 5px 0 10px; 134 135 @media (max-width: 768px) { 136 width: 25px; 137 height: 25px; 138 } 139`,mm=rb(mf)` 140 margin: 0 5px; 141`,gb=(R,N)=>{var W;if(!R)return"";let j="";if(R.fileName)j=R.fileName;else{j=decodeURI(j=R.uri||""),N||(j=null==(W=null==j?void 0:j.split("?"))?void 0:W[0]);let B=null==j?void 0:j.split("/");B.length&&(j=B[B.length-1])}return j},FP=()=>{var R,N;let{state:{config:W,currentDocument:j}}=(0,dK.useContext)(g1);if(!j||null!=(R=null==W?void 0:W.header)&&R.disableFileName)return null;let B=gb(j,(null==(N=null==W?void 0:W.header)?void 0:N.retainURLParams)||!1);return(0,dY.jsx)(mw,{id:"file-name","data-testid":"file-name",children:B})},mw=rb.div` 142 flex: 1; 143 text-align: left; 144 color: ${R=>R.theme.textPrimary}; 145 font-weight: bold; 146 margin: 0 10px; 147 overflow: hidden; 148`,DP=()=>{var R,N,W;let{state:j,dispatch:B}=(0,dK.useContext)(g1),{config:z}=j;if(null!=(R=null==z?void 0:z.header)&&R.disableHeader)return null;let U=null==(W=null==(N=null==z?void 0:z.header)?void 0:N.overrideComponent)?void 0:W.call(N,j,()=>B(s0()),()=>B(r0()));return U||(0,dY.jsxs)(mA,{id:"header-bar","data-testid":"header-bar",children:[(0,dY.jsx)(FP,{}),(0,dY.jsx)(kP,{})]})},mA=rb.div` 149 display: flex; 150 justify-content: flex-end; 151 align-items: center; 152 z-index: 1; 153 padding: 0 10px; 154 background-color: ${R=>R.theme.primary}; 155 font-size: 16px; 156 min-height: 50px; 157 158 @media (max-width: 768px) { 159 min-height: 30px; 160 padding: 5px; 161 font-size: 10px; 162 } 163`,ip=({documentURI:R,signal:N,fileLoaderComplete:W,readerTypeFunction:j,headers:B})=>fetch(R,{signal:N,headers:B}).then(async R=>{let N=await R.blob(),B=new FileReader;switch(B.addEventListener("loadend",()=>W(B)),j){case"arrayBuffer":B.readAsArrayBuffer(N);break;case"binaryString":B.readAsBinaryString(N);break;
163case"dataURL":B.readAsDataURL(N);break;case"text":B.readAsText(N)}}).catch(R=>R),mb=R=>ip({...R,readerTypeFunction:"dataURL"}),vb=R=>ip({...R,readerTypeFunction:"text"}),$P=()=>{let{state:{currentDocument:R,pluginRenderers:N}}=(0,dK.useContext)(g1),[W,j]=(0,dK.useState)();return(0,dK.useEffect)(()=>{if(!R)return;if(!R.fileType){j(void 0);return}let W=[];null==N||N.forEach(N=>{void 0!==R.fileType&&N.fileTypes.indexOf(R.fileType)>=0&&W.push(N)});let[B]=W.sort((R,N)=>N.weight-R.weight);j(B&&void 0!==B?()=>B:null)},[R,N]),{CurrentRenderer:W}},UP=()=>{let{state:R,dispatch:N}=(0,dK.useContext)(g1),{currentFileNo:W,currentDocument:j,prefetchMethod:B}=R,{CurrentRenderer:z}=$P(),U=(null==j?void 0:j.uri)||"";return(0,dK.useEffect)(()=>{if(!j||void 0!==j.fileType)return;let W=new AbortController,{signal:z}=W;return fetch(U,{method:B||U.startsWith("blob:")?"GET":"HEAD",signal:z,headers:null==R?void 0:R.requestHeaders}).then(R=>{let W=R.headers.get("content-type"),B=(null==W?void 0:W.split(";"))||[],z=B.length?B[0]:void 0;N(wg({...j,fileType:z||void 0}))}).catch(R=>{if((null==R?void 0:R.name)!=="AbortError")throw R}),()=>{W.abort()}},[W,U,j]),(0,dK.useEffect)(()=>{var W;if(!j||void 0===z)return;let B=new AbortController,{signal:V}=B,G={documentURI:U,signal:V,fileLoaderComplete:R=>{if(!j||!R){N(Vp(!1));return}let W={...j};null!==R.result&&(W.fileData=R.result),N(wg(W)),N(Vp(!1))},headers:null==R?void 0:R.requestHeaders};return null===z?N(Vp(!1)):void 0!==z.fileLoader?null==(W=z.fileLoader)||W.call(z,G):mb(G),()=>{B.abort()}},[z,W]),{state:R,dispatch:N,CurrentRenderer:z}},HP=()=>{let[R,N]=(0,dK.useState)({width:void 0,height:void 0});return(0,dK.useEffect)(()=>{function e(){N({width:window.innerWidth,height:window.innerHeight})}return window.addEventListener("resize",e),e(),()=>window.removeEventListener("resize",e)},[]),R},mv=({children:R})=>{var N,W;let{state:j}=(0,dK.useContext)(g1),{config:B}=j,[z,U]=(0,dK.useState)((null==(N=null==B?void 0:B.loadingRenderer)?void 0:N.showLoadingTimeout)===!1);return(0,dK.useEffect)(()=>{var R;setTimeout(()=>{U(!0)},"number"==typeof(null==(R=null==B?void 0:B.loadingRenderer)?void 0:R.showLoadingTimeout)?B.loadingRenderer.showLoadingTimeout:500)},[null==(W=null==B?void 0:B.loadingRenderer)?void 0:W.showLoadingTimeout]),z?(0,dY.jsx)(dY.Fragment,{children:R}):null},jP=({documents:R,documentLoading:N,config:W,currentDocument:j,fileName:B,CurrentRenderer:z,state:U,t:V})=>{var G,Y;if(!R.length)return(0,dY.jsx)("div",{id:"no-documents"});if(N){if(W&&null!=(G=null==W?void 0:W.loadingRenderer)&&G.overrideComponent){let R=W.loadingRenderer.overrideComponent;return(0,dY.jsx)(mv,{children:(0,dY.jsx)(R,{document:j,fileName:B})})}return(0,dY.jsx)(mv,{children:(0,dY.jsx)(mx,{id:"loading-renderer","data-testid":"loading-renderer",children:(0,dY.jsx)(mS,{children:(0,dY.jsx)(fP,{color:"#444",size:40})})})})}if(z)return(0,dY.jsx)(z,{mainState:U});if(void 0===z)return null;if(W&&null!=(Y=null==W?void 0:W.noRenderer)&&Y.overrideComponent){let R=W.noRenderer.overrideComponent;return(0,dY.jsx)(R,{document:j,fileName:B})}return(0,dY.jsxs)("div",{id:"no-renderer","data-testid":"no-renderer",children:[V("noRendererMessage",{fileType:(null==j?void 0:j.fileType)??""}),(0,dY.jsx)(mE,{id:"no-renderer-download",href:null==j?void 0:j.uri,download:null==j?void 0:j.uri,children:V("downloadButtonLabel")})]})},zP=()=>{var R;let{state:N,dispatch:W,CurrentRenderer:j}=UP(),{documents:B,documentLoading:z,currentDocument:U,config:V}=N,G=HP(),{t:Y}=oo(),Z=(0,dK.useCallback)(R=>{R&&W(rP(null==R?void 0:R.getBoundingClientRect()))},[G,W]),te=gb(U,(null==(R=null==V?void 0:V.header)?void 0:R.retainURLParams)||!1);return(0,dY.jsx)("div",{id:"proxy-renderer","data-testid":"proxy-renderer",ref:Z,children:(0,dY.jsx)(jP,{state:N,documents:B,documentLoading:z,config:V,currentDocument:U,fileName:te,CurrentRenderer:j,t:Y})})},mx=rb.div` 164 display: flex; 165 flex: 1; 166 height: 75px; 167 align-items: center; 168 justify-content: center; 169`,m_=(function(R){for(var N=[],W=1;W<arguments.length;W++)N[W-1]=arguments[W];"production"!==fx.env.NODE_ENV&&"u">
169typeof navigator&&"ReactNative"===navigator.product&&console.warn("`keyframes` cannot be used on ReactNative, only on the web. To do animation in ReactNative please use Animated.");var j=gg(ep.apply(void 0,Zs([R],N,!1))),B=pg(Vy(j)>>>0);return new gW(B,j)})` 170 from { 171 transform: rotate(0deg); 172 } 173 to { 174 transform: rotate(360deg); 175 } 176`,mS=rb.div` 177 animation-name: ${m_}; 178 animation-duration: 4s; 179 animation-timing-function: linear; 180 animation-iteration-count: infinite; 181`,mE=rb(g8)` 182 width: 130px; 183 height: 30px; 184 background-color: ${R=>R.theme.primary}; 185 @media (max-width: 768px) { 186 width: 125px; 187 height: 25px; 188 } 189`,mC={primary:"#fff",secondary:"#000",tertiary:"#ffffff99",textPrimary:"#000",textSecondary:"#fff",textTertiary:"#00000044",disableThemeScrollbar:!1},Vi=({mainState:{currentDocument:R},children:N,...W})=>R?(0,dY.jsx)(mM,{id:"image-renderer",...W,children:N||(0,dY.jsx)(mT,{id:"image-img",src:R.fileData})}):null;Vi.fileTypes=[],Vi.weight=0;let mM=rb.div` 190 display: flex; 191 flex: 1; 192 align-items: center; 193 justify-content: center; 194 width: 100%; 195 height: 100%; 196 background-color: #fff; 197`,mT=rb.img` 198 max-width: 95%; 199 max-height: 95%; 200`,a0=R=>(0,dY.jsx)(Vi,{...R});a0.fileTypes=["bmp","image/bmp"],a0.weight=0;let rp=({mainState:{currentDocument:R}})=>((0,dK.useEffect)(()=>{let N=null==R?void 0:R.fileData,W="",j=null==N?void 0:N.replace(/^data:text\/html;(?:charset=([^;]*);)?base64,/,(R,N)=>(W=N||"utf-8","")),B=window.atob(j),z=Uint8Array.from(B,R=>R.charCodeAt(0));B=new TextDecoder(W).decode(z);let U=document.getElementById("html-body"),V=(null==U?void 0:U.contentWindow)&&U.contentWindow;if(!V)return;let G=V.document;G.open(),G.write(`${B}`),G.close()},[R]),(0,dY.jsx)(mR,{id:"html-renderer",children:(0,dY.jsx)(mP,{id:"html-body",sandbox:"allow-same-origin"})}));rp.fileTypes=["htm","html","text/htm","text/html"],rp.weight=0,rp.fileLoader=mb;let mR=rb.div` 201 display: flex; 202 flex-direction: column; 203 width: 100%; 204 padding: 0 30px; 205`,mP=rb.iframe` 206 height: 100%; 207 padding: 15px; 208 margin: 20px 0 20px 0; 209 border: 1px solid ${R=>R.theme.secondary}; 210`,l0=R=>(0,dY.jsx)(Vi,{...R});l0.fileTypes=["jpg","jpeg","image/jpg","image/jpeg"],l0.weight=0;let sp=({mainState:{currentDocument:R}})=>R?(0,dY.jsx)(mD,{id:"msdoc-renderer",children:(0,dY.jsx)(mN,{id:"msdoc-iframe",title:"msdoc-iframe",src:`https://view.officeapps.live.com/op/embed.aspx?src=${encodeURIComponent(R.uri)}`,frameBorder:"0"})}):null,mI={odt:["odt","application/vnd.oasis.opendocument.text"],doc:["doc","application/msword"],docx:["docx","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/octet-stream"],xls:["xls","application/vnd.ms-excel"],xlsx:["xlsx","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],ppt:["ppt","application/vnd.ms-powerpoint"],pptx:["pptx","application/vnd.openxmlformats-officedocument.presentationml.presentation"]};sp.fileTypes=[...mI.odt,...mI.doc,...mI.docx,...mI.xls,...mI.xlsx,...mI.ppt,...mI.pptx],sp.weight=0,sp.fileLoader=({fileLoaderComplete:R})=>R();let mD=rb.div` 211 width: 100%; 212`,mN=rb.iframe` 213 width: 100%; 214 height: 100%; 215 border: 0; 216`;var mO={},mF={};mF.byteLength=function(R){var N=yb(R),W=N[0],j=N[1];return(W+j)*3/4-j},mF.toByteArray=function(R){var N,W,j=yb(R),B=j[0],z=j[1],U=new mB((B+z)*3/4-z),V=0,G=z>0?B-4:B;for(W=0;W<G;W+=4)N=mj[R.charCodeAt(W)]<<18|mj[R.charCodeAt(W+1)]<<12|mj[R.charCodeAt(W+2)]<<6|mj[R.charCodeAt(W+3)],U[V++]=N>>16&255,U[V++]=N>>8&255,U[V++]=255&N;return 2===z&&(N=mj[R.charCodeAt(W)]<<2|mj[R.charCodeAt(W+1)]>>4,U[V++]=255&N),1===z&&(N=mj[R.charCodeAt(W)]<<10|mj[R.charCodeAt(W+1)]<<4|mj[R.charCodeAt(W+2)]>>2,U[V++]=N>>8&255,U[V++]=255&N),U},mF.fromByteArray=function(R){for(var N,W=R.length,j=W%3,B=[],z=0,U=W-j;z<U;z+=16383)B.push(function(R,N,W){for(var j,B=[],z=N;z<W;z+=3)B.push(mW[(j=(R[z]<<16&16711680)+(R[z+1]<<8&65280)+(255&R[z+2]))>>18&63]+mW[j>>12&63]+mW[j>>6&63]+mW[63&j]);return B.join("")}(R,z,z+16383>U?U:z+16383));return 1===j?B.push(mW[(N=R[W-1])>>2]+mW[N<<4&63]+"=="):2===j&&B.push(mW[(N=(R[W-2]<<8)+R[W-1])>>10]+mW[N>>4&63]+mW[N<<2&63]+"="),B.join("")};for(var mW=[],mj=[],mB="u">typeof Uint8Array?Uint8Array:Array,m$="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789
216+/",mz=0,mH=m$.length;mz<mH;++mz)mW[mz]=m$[mz],mj[m$.charCodeAt(mz)]=mz;function yb(R){var N=R.length;if(N%4>0)throw Error("Invalid string. Length must be a multiple of 4");var W=R.indexOf("=");-1===W&&(W=N);var j=W===N?0:4-W%4;return[W,j]}mj[45]=62,mj[95]=63;var mU={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */mU.read=function(R,N,W,j,B){var z,U,V=8*B-j-1,G=(1<<V)-1,Y=G>>1,Z=-7,te=W?B-1:0,tn=W?-1:1,tr=R[N+te];for(te+=tn,z=tr&(1<<-Z)-1,tr>>=-Z,Z+=V;Z>0;z=256*z+R[N+te],te+=tn,Z-=8);for(U=z&(1<<-Z)-1,z>>=-Z,Z+=j;Z>0;U=256*U+R[N+te],te+=tn,Z-=8);if(0===z)z=1-Y;else{if(z===G)return U?NaN:(tr?-1:1)*(1/0);U+=Math.pow(2,j),z-=Y}return(tr?-1:1)*U*Math.pow(2,z-j)},mU.write=function(R,N,W,j,B,z){var U,V,G,Y=8*z-B-1,Z=(1<<Y)-1,te=Z>>1,tn=23===B?5960464477539062e-23:0,tr=j?0:z-1,ts=j?1:-1,ta=N<0||0===N&&1/N<0?1:0;for(isNaN(N=Math.abs(N))||N===1/0?(V=isNaN(N)?1:0,U=Z):(U=Math.floor(Math.log(N)/Math.LN2),N*(G=Math.pow(2,-U))<1&&(U--,G*=2),U+te>=1?N+=tn/G:N+=tn*Math.pow(2,1-te),N*G>=2&&(U++,G/=2),U+te>=Z?(V=0,U=Z):U+te>=1?(V=(N*G-1)*Math.pow(2,B),U+=te):(V=N*Math.pow(2,te-1)*Math.pow(2,B),U=0));B>=8;R[W+tr]=255&V,tr+=ts,V/=256,B-=8);for(U=U<<B|V,Y+=B;Y>0;R[W+tr]=255&U,tr+=ts,U/=256,Y-=8);R[W+tr-ts]|=128*ta},/*! 217 * The buffer module from node.js, for the browser. 218 * 219 * @author Feross Aboukhadijeh <https://feross.org> 220 * @license MIT 221 */function(R){let N="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;R.Buffer=h,R.SlowBuffer=function(R){return+R!=R&&(R=0),h.alloc(+R)},R.INSPECT_MAX_BYTES=50,R.kMaxLength=2147483647;let{Uint8Array:W,ArrayBuffer:j,SharedArrayBuffer:B}=globalThis;function d(R){if(R>2147483647)throw RangeError('The value "'+R+'" is invalid for option "size"');let N=new W(R);return Object.setPrototypeOf(N,h.prototype),N}function h(R,N,W){if("number"==typeof R){if("string"==typeof N)throw TypeError('The "string" argument must be of type string. Received type number');return y(R)}return f(R,N,W)}function f(R,N,z){if("string"==typeof R)return function(R,N){if(("string"!=typeof N||""===N)&&(N="utf8"),!h.isEncoding(N))throw TypeError("Unknown encoding: "+N);let W=0|I(R,N),j=d(W),B=j.write(R,N);return B!==W&&(j=j.slice(0,B)),j}(R,N);if(j.isView(R))return function(R){if(ot(R,W)){let N=new W(R);return P(N.buffer,N.byteOffset,N.byteLength)}return x(R)}(R);if(null==R)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof R);if(ot(R,j)||R&&ot(R.buffer,j)||"u">typeof B&&(ot(R,B)||R&&ot(R.buffer,B)))return P(R,N,z);if("number"==typeof R)throw TypeError('The "value" argument must not be of type number. Received type number');let U=R.valueOf&&R.valueOf();if(null!=U&&U!==R)return h.from(U,N,z);let V=function(R){var N;if(h.isBuffer(R)){let N=0|L(R.length),W=d(N);return 0===W.length||R.copy(W,0,0,N),W}return void 0!==R.length?"number"!=typeof R.length||(N=R.length)!=N?d(0):x(R):"Buffer"===R.type&&Array.isArray(R.data)?x(R.data):void 0}(R);if(V)return V;if("u">typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof R[Symbol.toPrimitive])return h.from(R[Symbol.toPrimitive]("string"),N,z);throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof R)}function g(R){if("number"!=typeof R)throw TypeError('"size" argument must be of type number');if(R<0)throw RangeError('The value "'+R+'" is invalid for option "size"')}function y(R){return g(R),d(R<0?0:0|L(R))}function x(R){let N=R.length<0?0:0|L(R.length),W=d(N);for(let j=0;j<N;j+=1)W[j]=255&R[j];return W}function P(R,N,j){let B;if(N<0||R.byteLength<N)throw RangeError('"offset" is outside of buffer bounds');if(R.byteLength<N+(j||0))throw RangeError('"length" is outside of buffer bounds');return Object.setPrototypeOf(B=void 0===N&&void 0===j?new W(R):void 0===j?new W(R,N):new W(R,N,j),h.prototype),B}function L(R){if(R>=2147483647)throw RangeError("Attempt to allocate Buffer larger than maximum size: 0x7fffffff bytes");return 0|R}
221function I(R,N){if(h.isBuffer(R))return R.length;if(j.isView(R)||ot(R,j))return R.byteLength;if("string"!=typeof R)throw TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof R);let W=R.length,B=arguments.length>2&&!0===arguments[2];if(!B&&0===W)return 0;let z=!1;for(;;)switch(N){case"ascii":case"latin1":case"binary":return W;case"utf8":case"utf-8":return Kt(R).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*W;case"hex":return W>>>1;case"base64":return Lt(R).length;default:if(z)return B?-1:Kt(R).length;N=(""+N).toLowerCase(),z=!0}}function M(R,N,W){let j=!1;if((void 0===N||N<0)&&(N=0),N>this.length||((void 0===W||W>this.length)&&(W=this.length),W<=0)||(W>>>=0)<=(N>>>=0))return"";for(R||(R="utf8");;)switch(R){case"hex":return function(R,N,W){let j=R.length;(!N||N<0)&&(N=0),(!W||W<0||W>j)&&(W=j);let B="";for(let j=N;j<W;++j)B+=V[R[j]];return B}(this,N,W);case"utf8":case"utf-8":return $(this,N,W);case"ascii":return function(R,N,W){let j="";W=Math.min(R.length,W);for(let B=N;B<W;++B)j+=String.fromCharCode(127&R[B]);return j}(this,N,W);case"latin1":case"binary":return function(R,N,W){let j="";W=Math.min(R.length,W);for(let B=N;B<W;++B)j+=String.fromCharCode(R[B]);return j}(this,N,W);case"base64":var B,z;return B=N,z=W,0===B&&z===this.length?mF.fromByteArray(this):mF.fromByteArray(this.slice(B,z));case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return function(R,N,W){let j=R.slice(N,W),B="";for(let R=0;R<j.length-1;R+=2)B+=String.fromCharCode(j[R]+256*j[R+1]);return B}(this,N,W);default:if(j)throw TypeError("Unknown encoding: "+R);R=(R+"").toLowerCase(),j=!0}}function C(R,N,W){let j=R[N];R[N]=R[W],R[W]=j}function T(R,N,j,B,z){var U;if(0===R.length)return -1;if("string"==typeof j?(B=j,j=0):j>2147483647?j=2147483647:j<-2147483648&&(j=-2147483648),(U=j=+j)!=U&&(j=z?0:R.length-1),j<0&&(j=R.length+j),j>=R.length){if(z)return -1;j=R.length-1}else if(j<0){if(!z)return -1;j=0}if("string"==typeof N&&(N=h.from(N,B)),h.isBuffer(N))return 0===N.length?-1:O(R,N,j,B,z);if("number"==typeof N)return N&=255,"function"==typeof W.prototype.indexOf?z?W.prototype.indexOf.call(R,N,j):W.prototype.lastIndexOf.call(R,N,j):O(R,[N],j,B,z);throw TypeError("val must be string, number or Buffer")}function O(R,N,W,j,B){let z,U=1,V=R.length,G=N.length;if(void 0!==j&&("ucs2"===(j=String(j).toLowerCase())||"ucs-2"===j||"utf16le"===j||"utf-16le"===j)){if(R.length<2||N.length<2)return -1;U=2,V/=2,G/=2,W/=2}function qt(R,N){return 1===U?R[N]:R.readUInt16BE(N*U)}if(B){let j=-1;for(z=W;z<V;z++)if(qt(R,z)===qt(N,-1===j?0:z-j)){if(-1===j&&(j=z),z-j+1===G)return j*U}else -1!==j&&(z-=z-j),j=-1}else for(W+G>V&&(W=V-G),z=W;z>=0;z--){let W=!0;for(let j=0;j<G;j++)if(qt(R,z+j)!==qt(N,j)){W=!1;break}if(W)return z}return -1}function $(R,N,W){W=Math.min(R.length,W);let j=[],B=N;for(;B<W;){let N=R[B],z=null,U=N>239?4:N>223?3:N>191?2:1;if(B+U<=W){let W,j,V,G;switch(U){case 1:N<128&&(z=N);break;case 2:(192&(W=R[B+1]))==128&&(G=(31&N)<<6|63&W)>127&&(z=G);break;case 3:W=R[B+1],j=R[B+2],(192&W)==128&&(192&j)==128&&(G=(15&N)<<12|(63&W)<<6|63&j)>2047&&(G<55296||G>57343)&&(z=G);break;case 4:W=R[B+1],j=R[B+2],V=R[B+3],(192&W)==128&&(192&j)==128&&(192&V)==128&&(G=(15&N)<<18|(63&W)<<12|(63&j)<<6|63&V)>65535&&G<1114112&&(z=G)}}null===z?(z=65533,U=1):z>65535&&(z-=65536,j.push(z>>>10&1023|55296),z=56320|1023&z),j.push(z),B+=U}return function(R){let N=R.length;if(N<=4096)return String.fromCharCode.apply(String,R);let W="",j=0;for(;j<N;)W+=String.fromCharCode.apply(String,R.slice(j,j+=4096));return W}(j)}function tt(R,N,W){if(R%1!=0||R<0)throw RangeError("offset is not uint");if(R+N>W)throw RangeError("Trying to access beyond buffer length")}function et(R,N,W,j,B,z){if(!h.isBuffer(R))throw TypeError('"buffer" argument must be a Buffer instance');if(N>B||N<z)throw RangeError('"value" argument is out of bounds');if(W+j>R.length)throw RangeError("Index out of range")}function lt(R,N,W,j,B){wt(N,j,B,R,W,7);let z=Number(N&BigInt(4294967295));R[W++]=z,z>>=8,R[W++]=z,z>>=8,R[W++]=z,z>>=8,R[W++]=z;let U=Number(N>>BigInt(32)&BigInt(4294967295));return R[W++]=U,U>>=8,R[W++]=U,U>>=8,R[W++]=U,U>>=8,R[W++]=U,W}function K(R,N,W,j,B){wt(N,j,B,R,W,7);let z=Number(N&BigInt(4294967295));R[W+7]=z,z>>=8,R[W+6]=z,z>>=8,R[W+5]=z,z>>=8,R[W+4]=z;let U=Number(N>>BigInt(32)&BigInt(4294967295));return R[W+3]=U,U>>=8,R[W+2]=U,U>>=8,R[W+1]=U,U>>=8,R[W]=U,W+8}function gt(R,N,W,j,B,z){if(W+j>R.length||W<0)throw RangeError("Index out of range")}function q(R,N,W,j,B){return N=+N,W>>>=0,B||gt(R,N,W,4),mU.write(R,N,W,j,23,4),W+4}function J(R,N,W,j,B){return N=+N,W>>>=0,B||gt(R,N,W,8),mU.write(R,N,W,j,52,8),W+8}h.TYPED_ARRAY_SUPPORT=function(){try{let R=new W(1),N={foo:function(){return 42}};return Object.setPrototypeOf(N,W.prototype),Object.setPrototypeOf(R,N),42===R.foo()}catch{return!1}}(),!h.TYPED_ARRAY_SUPPORT&&"u">typeof console&&"function"==typeof console.error&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(h.prototype,"parent",{enumerable:!0,get:function(){if(h.isBuffer(this))return this.buffer}}),Object.defineProperty(h.prototype,"offset",{enumerable:!0,get:function(){if(h.isBuffer(this))return this.byteOffset}}),h.poolSize=8192,h.from=function(R,N,W){return f(R,N,W)},Object.setPrototypeOf(h.prototype,W.prototype),Object.setPrototypeOf(h,W),h.alloc=function(R,N,W){return g(R),R<=0?d(R):void 0!==N?"string"==typeof W?d(R).fill(N,W):d(R).fill(N):d(R)},h.allocUnsafe=function(R){return y(R)},h.allocUnsafeSlow=function(R){return y(R)},h.isBuffer=function(R){return null!=R&&!0===R._isBuffer&&R!==h.prototype}
vendor: 4,210 bytes, line 221
221,h.compare=function(R,N){if(ot(R,W)&&(R=h.from(R,R.offset,R.byteLength)),ot(N,W)&&(N=h.from(N,N.offset,N.byteLength)),!h.isBuffer(R)||!h.isBuffer(N))throw TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(R===N)return 0;let j=R.length,B=N.length;for(let W=0,z=Math.min(j,B);W<z;++W)if(R[W]!==N[W]){j=R[W],B=N[W];break}return j<B?-1:B<j?1:0},h.isEncoding=function(R){switch(String(R).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},h.concat=function(R,N){let j;if(!Array.isArray(R))throw TypeError('"list" argument must be an Array of Buffers');if(0===R.length)return h.alloc(0);if(void 0===N)for(N=0,j=0;j<R.length;++j)N+=R[j].length;let B=h.allocUnsafe(N),z=0;for(j=0;j<R.length;++j){let N=R[j];if(ot(N,W))z+N.length>B.length?(h.isBuffer(N)||(N=h.from(N)),N.copy(B,z)):W.prototype.set.call(B,N,z);else if(h.isBuffer(N))N.copy(B,z);else throw TypeError('"list" argument must be an Array of Buffers');z+=N.length}return B},h.byteLength=I,h.prototype._isBuffer=!0,h.prototype.swap16=function(){let R=this.length;if(R%2!=0)throw RangeError("Buffer size must be a multiple of 16-bits");for(let N=0;N<R;N+=2)C(this,N,N+1);return this},h.prototype.swap32=function(){let R=this.length;if(R%4!=0)throw RangeError("Buffer size must be a multiple of 32-bits");for(let N=0;N<R;N+=4)C(this,N,N+3),C(this,N+1,N+2);return this},h.prototype.swap64=function(){let R=this.length;if(R%8!=0)throw RangeError("Buffer size must be a multiple of 64-bits");for(let N=0;N<R;N+=8)C(this,N,N+7),C(this,N+1,N+6),C(this,N+2,N+5),C(this,N+3,N+4);return this},h.prototype.toString=function(){let R=this.length;return 0===R?"":0==arguments.length?$(this,0,R):M.apply(this,arguments)},h.prototype.toLocaleString=h.prototype.toString,h.prototype.equals=function(R){if(!h.isBuffer(R))throw TypeError("Argument must be a Buffer");return this===R||0===h.compare(this,R)},h.prototype.inspect=function(){let N="",W=R.INSPECT_MAX_BYTES;return N=this.toString("hex",0,W).replace(/(.{2})/g,"$1 ").trim(),this.length>W&&(N+=" ... "),"<Buffer "+N+">"},N&&(h.prototype[N]=h.prototype.inspect),h.prototype.compare=function(R,N,j,B,z){if(ot(R,W)&&(R=h.from(R,R.offset,R.byteLength)),!h.isBuffer(R))throw TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof R);if(void 0===N&&(N=0),void 0===j&&(j=R?R.length:0),void 0===B&&(B=0),void 0===z&&(z=this.length),N<0||j>R.length||B<0||z>this.length)throw RangeError("out of range index");if(B>=z&&N>=j)return 0;if(B>=z)return -1;if(N>=j)return 1;if(N>>>=0,j>>>=0,B>>>=0,z>>>=0,this===R)return 0;let U=z-B,V=j-N,G=Math.min(U,V),Y=this.slice(B,z),Z=R.slice(N,j);for(let R=0;R<G;++R)if(Y[R]!==Z[R]){U=Y[R],V=Z[R];break}return U<V?-1:V<U?1:0},h.prototype.includes=function(R,N,W){return -1!==this.indexOf(R,N,W)},h.prototype.indexOf=function(R,N,W){return T(this,R,N,W,!0)},h.prototype.lastIndexOf=function(R,N,W){return T(this,R,N,W,!1)},h.prototype.write=function(R,N,W,j){var B,z,U,V,G,Y,Z,te;if(void 0===N)j="utf8",W=this.length,N=0;else if(void 0===W&&"string"==typeof N)j=N,W=this.length,N=0;else if(isFinite(N))N>>>=0,isFinite(W)?(W>>>=0,void 0===j&&(j="utf8")):(j=W,W=void 0);else throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let tn=this.length-N;if((void 0===W||W>tn)&&(W=tn),R.length>0&&(W<0||N<0)||N>this.length)throw RangeError("Attempt to write outside buffer bounds");j||(j="utf8");let tr=!1;for(;;)switch(j){case"hex":return function(R,N,W,j){let B;W=Number(W)||0;let z=R.length-W;j?(j=Number(j))>z&&(j=z):j=z;let U=N.length;for(j>U/2&&(j=U/2),B=0;B<j;++B){let j=parseInt(N.substr(2*B,2),16);if(j!=j)break;R[W+B]=j}return B}(this,R,N,W);case"utf8":case"utf-8":return B=N,z=W,Wt(Kt(R,this.length-B),this,B,z);case"ascii":case"latin1":case"binary":return U=N,V=W,Wt(function(R){let N=[];for(let W=0;W<R.length;++W)N.push(255&R.charCodeAt(W));return N}(R),this,U,V);case"base64":return G=N,Y=W,Wt(Lt(R),this,G,Y);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Z=N,te=W,Wt(function(R,N){let W,j;let B=[];for(let z=0;z<R.length&&!((N-=2)<0);
vendor: 10,738 bytes, line 221
221++z)j=(W=R.charCodeAt(z))>>8,B.push(W%256),B.push(j);return B}(R,this.length-Z),this,Z,te);default:if(tr)throw TypeError("Unknown encoding: "+j);j=(""+j).toLowerCase(),tr=!0}},h.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},h.prototype.slice=function(R,N){let W=this.length;R=~~R,N=void 0===N?W:~~N,R<0?(R+=W)<0&&(R=0):R>W&&(R=W),N<0?(N+=W)<0&&(N=0):N>W&&(N=W),N<R&&(N=R);let j=this.subarray(R,N);return Object.setPrototypeOf(j,h.prototype),j},h.prototype.readUintLE=h.prototype.readUIntLE=function(R,N,W){R>>>=0,N>>>=0,W||tt(R,N,this.length);let j=this[R],B=1,z=0;for(;++z<N&&(B*=256);)j+=this[R+z]*B;return j},h.prototype.readUintBE=h.prototype.readUIntBE=function(R,N,W){R>>>=0,N>>>=0,W||tt(R,N,this.length);let j=this[R+--N],B=1;for(;N>0&&(B*=256);)j+=this[R+--N]*B;return j},h.prototype.readUint8=h.prototype.readUInt8=function(R,N){return R>>>=0,N||tt(R,1,this.length),this[R]},h.prototype.readUint16LE=h.prototype.readUInt16LE=function(R,N){return R>>>=0,N||tt(R,2,this.length),this[R]|this[R+1]<<8},h.prototype.readUint16BE=h.prototype.readUInt16BE=function(R,N){return R>>>=0,N||tt(R,2,this.length),this[R]<<8|this[R+1]},h.prototype.readUint32LE=h.prototype.readUInt32LE=function(R,N){return R>>>=0,N||tt(R,4,this.length),(this[R]|this[R+1]<<8|this[R+2]<<16)+16777216*this[R+3]},h.prototype.readUint32BE=h.prototype.readUInt32BE=function(R,N){return R>>>=0,N||tt(R,4,this.length),16777216*this[R]+(this[R+1]<<16|this[R+2]<<8|this[R+3])},h.prototype.readBigUInt64LE=ce(function(R){X(R>>>=0,"offset");let N=this[R],W=this[R+7];(void 0===N||void 0===W)&&mt(R,this.length-8);let j=N+256*this[++R]+65536*this[++R]+16777216*this[++R],B=this[++R]+256*this[++R]+65536*this[++R]+16777216*W;return BigInt(j)+(BigInt(B)<<BigInt(32))}),h.prototype.readBigUInt64BE=ce(function(R){X(R>>>=0,"offset");let N=this[R],W=this[R+7];(void 0===N||void 0===W)&&mt(R,this.length-8);let j=16777216*N+65536*this[++R]+256*this[++R]+this[++R],B=16777216*this[++R]+65536*this[++R]+256*this[++R]+W;return(BigInt(j)<<BigInt(32))+BigInt(B)}),h.prototype.readIntLE=function(R,N,W){R>>>=0,N>>>=0,W||tt(R,N,this.length);let j=this[R],B=1,z=0;for(;++z<N&&(B*=256);)j+=this[R+z]*B;return j>=(B*=128)&&(j-=Math.pow(2,8*N)),j},h.prototype.readIntBE=function(R,N,W){R>>>=0,N>>>=0,W||tt(R,N,this.length);let j=N,B=1,z=this[R+--j];for(;j>0&&(B*=256);)z+=this[R+--j]*B;return z>=(B*=128)&&(z-=Math.pow(2,8*N)),z},h.prototype.readInt8=function(R,N){return R>>>=0,N||tt(R,1,this.length),128&this[R]?-((255-this[R]+1)*1):this[R]},h.prototype.readInt16LE=function(R,N){R>>>=0,N||tt(R,2,this.length);let W=this[R]|this[R+1]<<8;return 32768&W?4294901760|W:W},h.prototype.readInt16BE=function(R,N){R>>>=0,N||tt(R,2,this.length);let W=this[R+1]|this[R]<<8;return 32768&W?4294901760|W:W},h.prototype.readInt32LE=function(R,N){return R>>>=0,N||tt(R,4,this.length),this[R]|this[R+1]<<8|this[R+2]<<16|this[R+3]<<24},h.prototype.readInt32BE=function(R,N){return R>>>=0,N||tt(R,4,this.length),this[R]<<24|this[R+1]<<16|this[R+2]<<8|this[R+3]},h.prototype.readBigInt64LE=ce(function(R){X(R>>>=0,"offset");let N=this[R],W=this[R+7];(void 0===N||void 0===W)&&mt(R,this.length-8);let j=this[R+4]+256*this[R+5]+65536*this[R+6]+(W<<24);return(BigInt(j)<<BigInt(32))+BigInt(N+256*this[++R]+65536*this[++R]+16777216*this[++R])}),h.prototype.readBigInt64BE=ce(function(R){X(R>>>=0,"offset");let N=this[R],W=this[R+7];(void 0===N||void 0===W)&&mt(R,this.length-8);let j=(N<<24)+65536*this[++R]+256*this[++R]+this[++R];return(BigInt(j)<<BigInt(32))+BigInt(16777216*this[++R]+65536*this[++R]+256*this[++R]+W)}),h.prototype.readFloatLE=function(R,N){return R>>>=0,N||tt(R,4,this.length),mU.read(this,R,!0,23,4)},h.prototype.readFloatBE=function(R,N){return R>>>=0,N||tt(R,4,this.length),mU.read(this,R,!1,23,4)},h.prototype.readDoubleLE=function(R,N){return R>>>=0,N||tt(R,8,this.length),mU.read(this,R,!0,52,8)},h.prototype.readDoubleBE=function(R,N){return R>>>=0,N||tt(R,8,this.length),mU.read(this,R,!1,52,8)},h.prototype.writeUintLE=h.prototype.writeUIntLE=function(R,N,W,j){if(R=+R,N>>>=0,W>>>=0,!j){let j=Math.pow(2,8*W)-1;et(this,R,N,W,j,0)}let B=1,z=0;for(this[N]=255&R;++z<W&&(B*=256);)this[N+z]=R/B&255;return N+W},h.prototype.writeUintBE=h.prototype.writeUIntBE=function(R,N,W,j){if(R=+R,N>>>=0,W>>>=0,!j){let j=Math.pow(2,8*W)-1;et(this,R,N,W,j,0)}let B=W-1,z=1;for(this[N+B]=255&R;--B>=0&&(z*=256);)this[N+B]=R/z&255;return N+W},h.prototype.writeUint8=h.prototype.writeUInt8=function(R,N,W){return R=+R,N>>>=0,W||et(this,R,N,1,255,0),this[N]=255&R,N+1},h.prototype.writeUint16LE=h.prototype.writeUInt16LE=function(R,N,W){return R=+R,N>>>=0,W||et(this,R,N,2,65535,0),this[N]=255&R,this[N+1]=R>>>8,N+2},h.prototype.writeUint16BE=h.prototype.writeUInt16BE=function(R,N,W){return R=+R,N>>>=0,W||et(this,R,N,2,65535,0),this[N]=R>>>8,this[N+1]=255&R,N+2},h.prototype.writeUint32LE=h.prototype.writeUInt32LE=function(R,N,W){return R=+R,N>>>=0,W||et(this,R,N,4,4294967295,0),this[N+3]=R>>>24,this[N+2]=R>>>16,this[N+1]=R>>>8,this[N]=255&R,N+4},h.prototype.writeUint32BE=h.prototype.writeUInt32BE=function(R,N,W){return R=+R,N>>>=0,W||et(this,R,N,4,4294967295,0),this[N]=R>>>24,this[N+1]=R>>>16,this[N+2]=R>>>8,this[N+3]=255&R,N+4},h.prototype.writeBigUInt64LE=ce(function(R,N=0){return lt(this,R,N,BigInt(0),BigInt("0xffffffffffffffff"))}),h.prototype.writeBigUInt64BE=ce(function(R,N=0){return K(this,R,N,BigInt(0),BigInt("0xffffffffffffffff"))}),h.prototype.writeIntLE=function(R,N,W,j){if(R=+R,N>>>=0,!j){let j=Math.pow(2,8*W-1);et(this,R,N,W,j-1,-j)}let B=0,z=1,U=0;for(this[N]=255&R;++B<W&&(z*=256);)R<0&&0===U&&0!==this[N+B-1]&&(U=1),this[N+B]=(R/z>>0)-U&255;return N+W},h.prototype.writeIntBE=function(R,N,W,j){if(R=+R,N>>>=0,!j){let j=Math.pow(2,8*W-1);et(this,R,N,W,j-1,-j)}let B=W-1,z=1,U=0;for(this[N+B]=255&R;--B>=0&&(z*=256);)R<0&&0===U&&0!==this[N+B+1]&&(U=1),this[N+B]=(R/z>>0)-U&255;return N+W},h.prototype.writeInt8=function(R,N,W){return R=+R,N>>>=0,W||et(this,R,N,1,127,-128),R<0&&(R=255+R+1),this[N]=255&R,N+1},h.prototype.writeInt16LE=function(R,N,W){return R=+R,N>>>=0,W||et(this,R,N,2,32767,-32768),this[N]=255&R,this[N+1]=R>>>8,N+2},h.prototype.writeInt16BE=function(R,N,W){return R=+R,N>>>=0,W||et(this,R,N,2,32767,-32768),this[N]=R>>>8,this[N+1]=255&R,N+2},h.prototype.writeInt32LE=function(R,N,W){return R=+R,N>>>=0,W||et(this,R,N,4,2147483647,-2147483648),this[N]=255&R,this[N+1]=R>>>8,this[N+2]=R>>>16,this[N+3]=R>>>24,N+4},h.prototype.writeInt32BE=function(R,N,W){return R=+R,N>>>=0,W||et(this,R,N,4,2147483647,-2147483648),R<0&&(R=4294967295+R+1),this[N]=R>>>24,this[N+1]=R>>>16,this[N+2]=R>>>8,this[N+3]=255&R,N+4},h.prototype.writeBigInt64LE=ce(function(R,N=0){return lt(this,R,N,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),h.prototype.writeBigInt64BE=ce(function(R,N=0){return K(this,R,N,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),h.prototype.writeFloatLE=function(R,N,W){return q(this,R,N,!0,W)},h.prototype.writeFloatBE=function(R,N,W){return q(this,R,N,!1,W)},h.prototype.writeDoubleLE=function(R,N,W){return J(this,R,N,!0,W)},h.prototype.writeDoubleBE=function(R,N,W){return J(this,R,N,!1,W)},h.prototype.copy=function(R,N,j,B){if(!h.isBuffer(R))throw TypeError("argument should be a Buffer");if(j||(j=0),B||0===B||(B=this.length),N>=R.length&&(N=R.length),N||(N=0),B>0&&B<j&&(B=j),B===j||0===R.length||0===this.length)return 0;if(N<0)throw RangeError("targetStart out of bounds");if(j<0||j>=this.length)throw RangeError("Index out of range");if(B<0)throw RangeError("sourceEnd out of bounds");B>this.length&&(B=this.length),R.length-N<B-j&&(B=R.length-N+j);let z=B-j;return this===R&&"function"==typeof W.prototype.copyWithin?this.copyWithin(N,j,B):W.prototype.set.call(R,this.subarray(j,B),N),z},h.prototype.fill=function(R,N,W,j){let B;if("string"==typeof R){if("string"==typeof N?(j=N,N=0,W=this.length):"string"==typeof W&&(j=W,W=this.length),void 0!==j&&"string"!=typeof j)throw TypeError("encoding must be a string");if("string"==typeof j&&!h.isEncoding(j))throw TypeError("Unknown encoding: "+j);if(1===R.length){let N=R.charCodeAt(0);("utf8"===j&&N<128||"latin1"===j)&&(R=N)}}else"number"==typeof R?R&=255:"boolean"==typeof R&&(R=Number(R));if(N<0||this.length<N||this.length<W)throw RangeError("Out of range index");if(W<=N)return this;if(N>>>=0,W=void 0===W?this.length:W>>>0,R||(R=0),"number"==typeof R)for(B=N;B<W;++B)this[B]=R;else{let z=h.isBuffer(R)?R:h.from(R,j),U=z.length;if(0===U)throw TypeError('The value "'+R+'" is invalid for argument "value"');for(B=0;B<W-N;++B)this[B+N]=z[B%U]}return this};let z={};function ft(R,N,W){z[R]=class extends W{constructor(){super(),Object.defineProperty(this,"message",{value:N.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${R}]`,this.stack,delete this.name}get code(){return R}set code(R){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:R,writable:!0})}toString(){return`${this.name} [${R}]: ${this.message}`}}}function st(R){let N="",W=R.length,j="-"===R[0]?1:0;for(;W>=j+4;W-=3)N=`_${R.slice(W-3,W)}${N}`;return`${R.slice(0,W)}${N}`}function wt(R,N,W,j,B,U){if(R>W||R<N){let W;let j="bigint"==typeof N?"n":"";throw W=0===N||N===BigInt(0)?`>= 0${j} and < 2${j} ** ${(U+1)*8}${j}`:`>= -(2${j} ** ${(U+1)*8-1}${j}) and < 2 ** ${(U+1)*8-1}${j}`,new z.ERR_OUT_OF_RANGE("value",W,R)}X(B,"offset"),(void 0===j[B]||void 0===j[B+U])&&mt(B,j.length-(U+1))}function X(R,N){if("number"!=typeof R)throw new z.ERR_INVALID_ARG_TYPE(N,"number",R)}function mt(R,N,W){throw Math.floor(R)!==R?(X(R,W),new z.ERR_OUT_OF_RANGE("offset","an integer",R)):N<0?new z.ERR_BUFFER_OUT_OF_BOUNDS:new z.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${N}`,R)}ft("ERR_BUFFER_OUT_OF_BOUNDS",function(R){return R?`${R} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),ft("ERR_INVALID_ARG_TYPE",function(R,N){return`The "${R}" argument must be of type number. Received type ${typeof N}`},TypeError),ft("ERR_OUT_OF_RANGE",function(R,N,W){let j=`The value of "${R}" is out of range.`,B=W;return Number.isInteger(W)&&Math.abs(W)>4294967296?B=st(String(W)):"bigint"==typeof W&&(B=String(W),(W>BigInt(2)**BigInt(32)||W<-(BigInt(2)**BigInt(32)))&&(B=st(B)),B+="n"),j+=` It must be ${N}. Received ${B}`},RangeError);let U=/[^+/0-9A-Za-z-_]/g;function Kt(R,N){let W;N=N||1/0;let j=R.length,B=null,z=[];for(let U=0;U<j;++U){if((W=R.charCodeAt(U))>55295&&W<57344){if(!B){if(W>56319||U+1===j){(N-=3)>-1&&z.push(239,191,189);continue}B=W;continue}if(W<56320){(N-=3)>-1&&z.push(239,191,189),B=W;continue}W=(B-55296<<10|W-56320)+65536}else B&&(N-=3)>-1&&z.push(239,191,189);if(B=null,W<128){if((N-=1)<0)break;z.push(W)}else if(W<2048){if((N-=2)<0)break;z.push(W>>
2216|192,63&W|128)}else if(W<65536){if((N-=3)<0)break;z.push(W>>12|224,W>>6&63|128,63&W|128)}else if(W<1114112){if((N-=4)<0)break;z.push(W>>18|240,W>>12&63|128,W>>6&63|128,63&W|128)}else throw Error("Invalid code point")}return z}function Lt(R){return mF.toByteArray(function(R){if((R=(R=R.split("=")[0]).trim().replace(U,"")).length<2)return"";for(;R.length%4!=0;)R+="=";return R}(R))}function Wt(R,N,W,j){let B;for(B=0;B<j&&!(B+W>=N.length||B>=R.length);++B)N[B+W]=R[B];return B}function ot(R,N){return R instanceof N||null!=R&&null!=R.constructor&&null!=R.constructor.name&&R.constructor.name===N.name}let V=function(){let R="0123456789abcdef",N=Array(256);for(let W=0;W<16;++W){let j=16*W;for(let B=0;B<16;++B)N[j+B]=R[W]+R[B]}return N}();function ce(R){return typeof BigInt>"u"?sn:R}function sn(){throw Error("BigInt not supported")}}(mO);let mV=mO.Buffer;mO.Blob,mO.BlobOptions,mO.Buffer,mO.File,mO.FileOptions,mO.INSPECT_MAX_BYTES,mO.SlowBuffer,mO.TranscodeEncoding,mO.atob,mO.btoa,mO.constants,mO.isAscii,mO.isUtf8,mO.kMaxLength,mO.kStringMaxLength,mO.resolveObjectURL,mO.transcode;var mG={};mG.d=(R,N)=>{for(var W in N)mG.o(N,W)&&!mG.o(R,W)&&Object.defineProperty(R,W,{enumerable:!0,get:N[W]})},mG.o=(R,N)=>Object.prototype.hasOwnProperty.call(R,N);var mq=globalThis.pdfjsLib={};mG.d(mq,{AbortException:()=>lo,AnnotationEditorLayer:()=>wu,AnnotationEditorParamsType:()=>m1,AnnotationEditorType:()=>mZ,AnnotationEditorUIManager:()=>vx,AnnotationLayer:()=>wi,AnnotationMode:()=>mJ,CMapCompressionType:()=>m9,ColorPicker:()=>wo,DOMSVGFactory:()=>u0,DrawLayer:()=>wm,FeatureTest:()=>Ge,GlobalWorkerOptions:()=>zi,ImageKind:()=>m4,InvalidPDFException:()=>wb,MissingPDFException:()=>ao,OPS:()=>ve,Outliner:()=>pm,PDFDataRangeTransport:()=>vK,PDFDateString:()=>Tb,PDFWorker:()=>vZ,PasswordResponses:()=>vi,PermissionFlag:()=>m3,PixelsPerInch:()=>vf,RenderingCancelledException:()=>f0,TextLayer:()=>vH,UnexpectedResponseException:()=>hp,Util:()=>Q,VerbosityLevel:()=>m7,XfaLayer:()=>pw,build:()=>v8,createValidAbsoluteUrl:()=>IR,fetchData:()=>mp,getDocument:()=>qk,getFilenameFromUrl:()=>jR,getPdfFilenameFromUrl:()=>zR,getXfaPageViewport:()=>GR,isDataScheme:()=>p0,isPdfFile:()=>g0,noContextMenu:()=>Ve,normalizeUnicode:()=>BR,renderTextLayer:()=>Bk,setLayerDimensions:()=>to,shadow:()=>Tt,updateTextLayer:()=>$k,version:()=>v6});let mX="object"==typeof fx&&fx+""=="[object process]"&&!fx.versions.nw&&!(fx.versions.electron&&fx.type&&"browser"!==fx.type),mY=[1,0,0,1,0,0],mK=[.001,0,0,.001,0,0],mQ={ANY:1,DISPLAY:2,PRINT:4,ANNOTATIONS_FORMS:16,ANNOTATIONS_STORAGE:32,ANNOTATIONS_DISABLE:64,OPLIST:256},mJ={DISABLE:0,ENABLE:1,ENABLE_FORMS:2,ENABLE_STORAGE:3},mZ={DISABLE:-1,NONE:0,FREETEXT:3,HIGHLIGHT:9,STAMP:13,INK:15},m1={RESIZE:1,CREATE:2,FREETEXT_SIZE:11,FREETEXT_COLOR:12,FREETEXT_OPACITY:13,INK_COLOR:21,INK_THICKNESS:22,INK_OPACITY:23,HIGHLIGHT_COLOR:31,HIGHLIGHT_DEFAULT_COLOR:32,HIGHLIGHT_THICKNESS:33,HIGHLIGHT_FREE:34,HIGHLIGHT_SHOW_ALL:35},m3={PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048},m5={FILL:0,STROKE:1,FILL_STROKE:2,INVISIBLE:3,FILL_STROKE_MASK:3,ADD_TO_PATH_FLAG:4},m4={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3},m6={TEXT:1,LINK:2,FREETEXT:3,LINE:4,SQUARE:5,CIRCLE:6,POLYGON:7,POLYLINE:8,HIGHLIGHT:9,UNDERLINE:10,SQUIGGLY:11,STRIKEOUT:12,STAMP:13,CARET:14,INK:15,POPUP:16,FILEATTACHMENT:17,WIDGET:20},m8={SOLID:1,DASHED:2,BEVELED:3,INSET:4,UNDERLINE:5},m7={ERRORS:0,WARNINGS:1,INFOS:5},m9={NONE:0,BINARY:1},ve={dependency:1,setLineWidth:2,setLineCap:3,setLineJoin:4,setMiterLimit:5,setDash:6,setRenderingIntent:7,setFlatness:8,setGState:9,save:10,restore:11,transform:12,moveTo:13,lineTo:14,curveTo:15,curveTo2:16,curveTo3:17,closePath:18,rectangle:19,stroke:20,closeStroke:21,fill:22,eoFill:23,fillStroke:24,eoFillStroke:25,closeFillStroke:26,closeEOFillStroke:27,endPath:28,clip:29,eoClip:30,beginText:31,endText:32,setCharSpacing:33,setWordSpacing:34,setHScale:35,setLeading:36,setFont:37,setTextRenderingMode:38,setTextRise:39,moveText:40,setLeadingMoveText:41,setTextMatrix:42,nextLine:43,showText:44,showSpacedText:45,nextLineShowText:46,nextLineSetSpacingShowText:47,setCharWidth:48,setCharWidthAndBounds:49,setStrokeColorSpace:50,setFillColorSpace:51,setStrokeColor:52,setStrokeColorN:53,setFillColor:54,setFillColorN:55,setStrokeGray:56,setFillGray:57,setStrokeRGBColor:58,setFillRGBColor:59,setStrokeCMYKColor:60,setFillCMYKColor:61,shadingFill:62,beginInlineImage:63,beginImageData:64,endInlineImage:65,paintXObject:66,markPoint:67,markPointProps:68,beginMarkedContent:69,beginMarkedContentProps:70,endMarkedContent:71,beginCompat:72,endCompat:73,paintFormXObjectBegin:74,paintFormXObjectEnd:75,beginGroup:76,endGroup:77,beginAnnotation:80,endAnnotation:81,paintImageMaskXObject:83,paintImageMaskXObjectGroup:84,paintImageXObject:85,paintInlineImageXObject:86,paintInlineImageXObjectGroup:87,paintImageXObjectRepeat:88,paintImageMaskXObjectRepeat:89,paintSolidColorImageMask:90,constructPath:91},vi={NEED_PASSWORD:1,INCORRECT_PASSWORD:2},vn=m7.WARNINGS;function cp(R){vn>=m7.INFOS&&console.log(`Info: ${R}`)}function vt(R){vn>=m7.WARNINGS&&console.log(`Warning: ${R}`)}function Dt(R){throw Error(R)}function ae(R,N){R||Dt(N)}function IR(R,N=null,W=null){if(!R)return null;try{if(W&&"string"==typeof R){if(W.addDefaultProtocol&&R.startsWith("www.")){let N=R.match(/\./g);(null==N?void 0:N.length)>=2&&(R=`http://${R}`)}if(W.tryConvertEncoding)try{var j;j=R,R=decodeURIComponent(escape(j))}catch{}}let B=N?new URL(R,N):new URL(R);if(function(R){switch(null==R?void 0:R.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}(B))return B}catch{}return null}function Tt(R,N,W,j=!1){return Object.defineProperty(R,N,{value:W,enumerable:!j,configurable:!0,writable:!1}),W}let vr=function(){function t(R,N){this.constructor===t&&Dt("Cannot initialize BaseException."),this.message=R,this.name=N}return t.prototype=Error(),t.constructor=t,t}();let Sg=class Sg extends vr{constructor(R,N){super(R,"PasswordException"),this.code=N}};let xg=class xg extends vr{constructor(R,N){super(R,"UnknownErrorException"),this.details=N}};let wb=class wb extends vr{constructor(R){super(R,"InvalidPDFException")}};let ao=class ao extends vr{constructor(R){super(R,"MissingPDFException")}};let hp=class hp extends vr{constructor(R,N){super(R,"UnexpectedResponseException"),this.status=N}};let FR=class FR extends vr{constructor(R){super(R,"FormatError")}};let lo=class lo extends vr{constructor(R){super(R,"AbortException")}};function Ab(R){("object"!=typeof R||(null==R?void 0:R.length)===void 0)&&Dt("Invalid argument for bytesToString");let N=R.length;if(N<8192)return String.fromCharCode.apply(null,R);let W=[];for(let j=0;j<N;j+=8192){let B=Math.min(j+8192,N),z=R.subarray(j,B);W.push(String.fromCharCode.apply(null,z))}return W.join("")}function dp(R){"string"!=typeof R&&Dt("Invalid argument for stringToBytes");let N=R.length,W=new Uint8Array(N);for(let j=0;j<N;++j)W[j]=255&R.charCodeAt(j);return W}function h0(R){let N=Object.create(null);for(let[W,j]of R)N[W]=j;return N}let Ge=class Ge{static get isLittleEndian(){return Tt(this,"isLittleEndian",function(){let R=new Uint8Array(4);return R[0]=1,1===new Uint32Array(R.buffer,0,1)[0]}())}static get isEvalSupported(){return Tt(this,"isEvalSupported",function(){try{return Function(""),!0}catch{return!1}}())}static get isOffscreenCanvasSupported(){return Tt(this,"isOffscreenCanvasSupported","u">typeof OffscreenCanvas)}static get platform(){return"u">typeof navigator&&"string"==typeof(null==navigator?void 0:navigator.platform)?Tt(this,"platform",{isMac:navigator.platform.includes("Mac")}):Tt(this,"platform",{isMac:!1})}static get isCSSRoundSupported(){var R,N;return Tt(this,"isCSSRoundSupported",null==(N=null==(R=globalThis.CSS)?void 0:R.supports)?void 0:N.call(R,"width: round(1.5px, 1px)"))}};let vs=Array.from(Array(256).keys(),R=>R.toString(16).padStart(2,"0"));let Q=class Q{static makeHexColor(R,N,W){return`#${vs[R]}${vs[N]}${vs[W]}`}static scaleMinMax(R,N){let W;R[0]?(R[0]<0&&(W=N[0],N[0]=N[2],N[2]=W),N[0]*=R[0],N[2]*=R[0],R[3]<0&&(W=N[1],N[1]=N[3],N[3]=W),N[1]*=R[3],N[3]*=R[3]):(W=N[0],N[0]=N[1],N[1]=W,W=N[2],N[2]=N[3],N[3]=W,R[1]<0&&(W=N[1],N[1]=N[3],N[3]=W),N[1]*=R[1],N[3]*=R[1],R[2]<0&&(W=N[0],N[0]=N[2],N[2]=W),N[0]*=R[2],N[2]*=R[2]),N[0]+=R[4],N[1]+=R[5],N[2]+=R[4],N[3]+=R[5]}static transform(R,N){return[R[0]*N[0]+R[2]*N[1],R[1]*N[0]+R[3]*N[1],R[0]*N[2]+R[2]*N[3],R[1]*N[2]+R[3]*N[3],R[0]*N[4]+R[2]*N[5]+R[4],R[1]*N[4]+R[3]*N[5]+R[5]]}static applyTransform(R,N){let W=R[0]*N[0]+R[1]*N[2]+N[4],j=R[0]*N[1]+R[1]*N[3]+N[5];return[W,j]}static applyInverseTransform(R,N){let W=N[0]*N[3]-N[1]*N[2],j=(R[0]*N[3]-R[1]*N[2]+N[2]*N[5]-N[4]*N[3])/W,B=(-R[0]
221*N[1]+R[1]*N[0]+N[4]*N[1]-N[5]*N[0])/W;return[j,B]}static getAxialAlignedBoundingBox(R,N){let W=this.applyTransform(R,N),j=this.applyTransform(R.slice(2,4),N),B=this.applyTransform([R[0],R[3]],N),z=this.applyTransform([R[2],R[1]],N);return[Math.min(W[0],j[0],B[0],z[0]),Math.min(W[1],j[1],B[1],z[1]),Math.max(W[0],j[0],B[0],z[0]),Math.max(W[1],j[1],B[1],z[1])]}static inverseTransform(R){let N=R[0]*R[3]-R[1]*R[2];return[R[3]/N,-R[1]/N,-R[2]/N,R[0]/N,(R[2]*R[5]-R[4]*R[3])/N,(R[4]*R[1]-R[5]*R[0])/N]}static singularValueDecompose2dScale(R){let N=[R[0],R[2],R[1],R[3]],W=R[0]*N[0]+R[1]*N[2],j=R[0]*N[1]+R[1]*N[3],B=R[2]*N[0]+R[3]*N[2],z=R[2]*N[1]+R[3]*N[3],U=(W+z)/2,V=Math.sqrt((W+z)**2-4*(W*z-B*j))/2;return[Math.sqrt(U+V||1),Math.sqrt(U-V||1)]}static normalizeRect(R){let N=R.slice(0);return R[0]>R[2]&&(N[0]=R[2],N[2]=R[0]),R[1]>R[3]&&(N[1]=R[3],N[3]=R[1]),N}static intersect(R,N){let W=Math.max(Math.min(R[0],R[2]),Math.min(N[0],N[2])),j=Math.min(Math.max(R[0],R[2]),Math.max(N[0],N[2]));if(W>j)return null;let B=Math.max(Math.min(R[1],R[3]),Math.min(N[1],N[3])),z=Math.min(Math.max(R[1],R[3]),Math.max(N[1],N[3]));return B>z?null:[W,B,j,z]}static bezierBoundingBox(R,N,W,j,B,z,U,V,G){return G?(G[0]=Math.min(G[0],R,U),G[1]=Math.min(G[1],N,V),G[2]=Math.max(G[2],R,U),G[3]=Math.max(G[3],N,V)):G=[Math.min(R,U),Math.min(N,V),Math.max(R,U),Math.max(N,V)],A(this,th,tc).call(this,R,W,B,U,N,j,z,V,3*(-R+3*(W-B)+U),6*(R-2*W+B),3*(W-R),G),A(this,th,tc).call(this,R,W,B,U,N,j,z,V,3*(-N+3*(j-z)+V),6*(N-2*j+z),3*(j-N),G),G}};ts=new WeakSet,ta=function(R,N,W,j,B,z,U,V,G,Y){if(G<=0||G>=1)return;let Z=1-G,te=G*G,tn=te*G,tr=Z*(Z*(Z*R+3*G*N)+3*te*W)+tn*j,ts=Z*(Z*(Z*B+3*G*z)+3*te*U)+tn*V;Y[0]=Math.min(Y[0],tr),Y[1]=Math.min(Y[1],ts),Y[2]=Math.max(Y[2],tr),Y[3]=Math.max(Y[3],ts)},th=new WeakSet,tc=function(R,N,W,j,B,z,U,V,G,Y,Z,te){if(1e-12>Math.abs(G)){Math.abs(Y)>=1e-12&&A(this,ts,ta).call(this,R,N,W,j,B,z,U,V,-Z/Y,te);return}let tn=Y**2-4*Z*G;if(tn<0)return;let tr=Math.sqrt(tn),th=2*G;A(this,ts,ta).call(this,R,N,W,j,B,z,U,V,(-Y+tr)/th,te),A(this,ts,ta).call(this,R,N,W,j,B,z,U,V,(-Y-tr)/th,te)},m(Q,ts),m(Q,th);let va=null,vo=null;function BR(R){return va||(va=/([\u00a0\u00b5\u037e\u0eb3\u2000-\u200a\u202f\u2126\ufb00-\ufb04\ufb06\ufb20-\ufb36\ufb38-\ufb3c\ufb3e\ufb40-\ufb41\ufb43-\ufb44\ufb46-\ufba1\ufba4-\ufba9\ufbae-\ufbb1\ufbd3-\ufbdc\ufbde-\ufbe7\ufbea-\ufbf8\ufbfc-\ufbfd\ufc00-\ufc5d\ufc64-\ufcf1\ufcf5-\ufd3d\ufd88\ufdf4\ufdfa-\ufdfb\ufe71\ufe77\ufe79\ufe7b\ufe7d]+)|(\ufb05+)/gu,vo=new Map([["ï¬
","ſt"]])),R.replaceAll(va,(R,N,W)=>N?N.normalize("NFKC"):vo.get(W))}let vl="pdfjs_internal_id_",vh={BEZIER_CURVE_TO:0,MOVE_TO:1,LINE_TO:2,QUADRATIC_CURVE_TO:3,RESTORE:4,SAVE:5,SCALE:6,TRANSFORM:7,TRANSLATE:8};let up=class up{constructor(){this.constructor===up&&Dt("Cannot initialize BaseFilterFactory.")}addFilter(R){return"none"}addHCMFilter(R,N){return"none"}addAlphaFilter(R){return"none"}addLuminosityFilter(R){return"none"}addHighlightHCMFilter(R,N,W,j,B){return"none"}destroy(R=!1){}};let fp=class fp{constructor(){this.constructor===fp&&Dt("Cannot initialize BaseCanvasFactory.")}create(R,N){if(R<=0||N<=0)throw Error("Invalid canvas size");let W=this._createCanvas(R,N);return{canvas:W,context:W.getContext("2d")}}reset(R,N,W){if(!R.canvas)throw Error("Canvas is not specified");if(N<=0||W<=0)throw Error("Invalid canvas size");R.canvas.width=N,R.canvas.height=W}destroy(R){if(!R.canvas)throw Error("Canvas is not specified");R.canvas.width=0,R.canvas.height=0,R.canvas=null,R.context=null}_createCanvas(R,N){Dt("Abstract method `_createCanvas` called.")}};let pp=class pp{constructor({baseUrl:R=null,isCompressed:N=!0}){this.constructor===pp&&Dt("Cannot initialize BaseCMapReaderFactory."),this.baseUrl=R,this.isCompressed=N}async fetch({name:R}){if(!this.baseUrl)throw Error('The CMap "baseUrl" parameter must be specified, ensure that the "cMapUrl" and "cMapPacked" API parameters are provided.');if(!R)throw Error("CMap name must be specified.");let N=this.baseUrl+R+(this.isCompressed?".bcmap":""),W=this.isCompressed?m9.BINARY:m9.NONE;return this._fetchData(N,W).catch(R=>{throw Error(`Unable to load ${this.isCompressed?"binary ":""}CMap at: ${N}`)})}_fetchData(R,N){Dt("Abstract method `_fetchData` called.")}};let gp=class gp{constructor({baseUrl:R=null}){this.constructor===gp&&Dt("Cannot initialize BaseStandardFontDataFactory."),this.baseUrl=R}async fetch({filename:R}){if(!this.baseUrl)throw Error('The standard font "baseUrl" parameter must be specified, ensure that the "standardFontDataUrl" API parameter is provided.');if(!R)throw Error("Font filename must be specified.");let N=`${this.baseUrl}${R}`;return this._fetchData(N).catch(R=>{throw Error(`Unable to load font data at: ${N}`)})}_fetchData(R){Dt("Abstract method `_fetchData` called.")}};let d0=class d0{constructor(){this.constructor===d0&&Dt("Cannot initialize BaseSVGFactory.")}create(R,N,W=!1){if(R<=0||N<=0)throw Error("Invalid SVG dimensions");let j=this._createSVG("svg:svg");return j.setAttribute("version","1.1"),W||(j.setAttribute("width",`${R}px`),j.setAttribute("height",`${N}px`)),j.setAttribute("preserveAspectRatio","none"),j.setAttribute("viewBox",`0 0 ${R} ${N}`),j}createElement(R){if("string"!=typeof R)throw Error("Invalid SVG element type");return this._createSVG(R)}_createSVG(R){Dt("Abstract method `_createSVG` called.")}};let vc="http://www.w3.org/2000/svg",vd=class{};dt(vd,"CSS",96),dt(vd,"PDF",72),dt(vd,"PDF_TO_CSS_UNITS",vd.CSS/vd.PDF);let vf=vd;async function mp(R,N="text"){if(cl(R,document.baseURI)){let W=await fetch(R);if(!W.ok)throw Error(W.statusText);switch(N){case"arraybuffer":return W.arrayBuffer();case"blob":return W.blob();case"json":return W.json()}return W.text()}return new Promise((W,j)=>{let B=new XMLHttpRequest;B.open("GET",R,!0),B.responseType=N,B.onreadystatechange=()=>{if(B.readyState===XMLHttpRequest.DONE){if(200===B.status||0===B.status){switch(N){case"arraybuffer":case"blob":case"json":W(B.response);return}W(B.responseText);return}j(Error(B.statusText))}},B.send(null)})}tu=new WeakMap,tp=new WeakMap,tf=new WeakMap,tg=new WeakMap,tm=new WeakMap,tw=new WeakMap,ty=new WeakSet,tA=function(){return a(this,tu)||w(this,tu,new Map)},tx=new WeakSet,t_=function(){return a(this,tm)||w(this,tm,new Map)},tS=new WeakSet,tE=function(){if(!a(this,tp)){let R=a(this,tg).createElement("div"),{style:N}=R;N.visibility="hidden",N.contain="strict",N.width=N.height=0,N.position="absolute",N.top=N.left=0,N.zIndex=-1;let W=a(this,tg).createElementNS(vc,"svg");W.setAttribute("width",0),W.setAttribute("height",0),w(this,tp,a(this,tg).createElementNS(vc,"defs")),R.append(W),W.append(a(this,tp)),a(this,tg).body.append(R)}return a(this,tp)},tk=new WeakSet,tC=function(R){if(1===R.length){let N=R[0],W=Array(256);for(let R=0;R<256;R++)W[R]=N[R]/255;let j=W.join(",");return[j,j,j]}let[N,W,j]=R,B=Array(256),z=Array(256),U=Array(256);for(let R=0;R<256;R++)B[R]=N[R]/255,z[R]=W[R]/255,U[R]=j[R]/255;return[B.join(","),z.join(","),U.join(",")]},tM=new WeakSet,tT=function(R){let N=a(this,tg).createElementNS(vc,"feC
221olorMatrix");N.setAttribute("type","matrix"),N.setAttribute("values","0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.3 0.59 0.11 0 0"),R.append(N)},tR=new WeakSet,tP=function(R){let N=a(this,tg).createElementNS(vc,"feColorMatrix");N.setAttribute("type","matrix"),N.setAttribute("values","0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0 0 0 1 0"),R.append(N)},tI=new WeakSet,tD=function(R){let N=a(this,tg).createElementNS(vc,"filter");return N.setAttribute("color-interpolation-filters","sRGB"),N.setAttribute("id",R),a(this,tS,tE).append(N),N},tN=new WeakSet,tO=function(R,N,W){let j=a(this,tg).createElementNS(vc,N);j.setAttribute("type","discrete"),j.setAttribute("tableValues",W),R.append(j)},tF=new WeakSet,tW=function(R,N,W,j){let B=a(this,tg).createElementNS(vc,"feComponentTransfer");j.append(B),A(this,tN,tO).call(this,B,"feFuncR",R),A(this,tN,tO).call(this,B,"feFuncG",N),A(this,tN,tO).call(this,B,"feFuncB",W)},tj=new WeakSet,tB=function(R,N){let W=a(this,tg).createElementNS(vc,"feComponentTransfer");N.append(W),A(this,tN,tO).call(this,W,"feFuncA",R)},t$=new WeakSet,tz=function(R){return a(this,tS,tE).style.color=R,m0(getComputedStyle(a(this,tS,tE)).getPropertyValue("color"))};let Sb=class Sb extends pp{_fetchData(R,N){return mp(R,this.isCompressed?"arraybuffer":"text").then(R=>({cMapData:R instanceof ArrayBuffer?new Uint8Array(R):dp(R),compressionType:N}))}};let xb=class xb extends gp{_fetchData(R){return mp(R,"arraybuffer").then(R=>new Uint8Array(R))}};let u0=class u0 extends d0{_createSVG(R){return document.createElementNS(vc,R)}};let Jh=class Jh{constructor({viewBox:R,scale:N,rotation:W,offsetX:j=0,offsetY:B=0,dontFlip:z=!1}){let U,V,G,Y,Z,te,tn,tr;this.viewBox=R,this.scale=N,this.rotation=W,this.offsetX=j,this.offsetY=B;let ts=(R[2]+R[0])/2,ta=(R[3]+R[1])/2;switch((W%=360)<0&&(W+=360),W){case 180:U=-1,V=0,G=0,Y=1;break;case 90:U=0,V=1,G=1,Y=0;break;case 270:U=0,V=-1,G=-1,Y=0;break;case 0:U=1,V=0,G=0,Y=-1;break;default:throw Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.")}z&&(G=-G,Y=-Y),0===U?(Z=Math.abs(ta-R[1])*N+j,te=Math.abs(ts-R[0])*N+B,tn=(R[3]-R[1])*N,tr=(R[2]-R[0])*N):(Z=Math.abs(ts-R[0])*N+j,te=Math.abs(ta-R[1])*N+B,tn=(R[2]-R[0])*N,tr=(R[3]-R[1])*N),this.transform=[U*N,V*N,G*N,Y*N,Z-U*N*ts-G*N*ta,te-V*N*ts-Y*N*ta],this.width=tn,this.height=tr}get rawDims(){let{viewBox:R}=this;return Tt(this,"rawDims",{pageWidth:R[2]-R[0],pageHeight:R[3]-R[1],pageX:R[0],pageY:R[1]})}clone({scale:R=this.scale,rotation:N=this.rotation,offsetX:W=this.offsetX,offsetY:j=this.offsetY,dontFlip:B=!1}={}){return new Jh({viewBox:this.viewBox.slice(),scale:R,rotation:N,offsetX:W,offsetY:j,dontFlip:B})}convertToViewportPoint(R,N){return Q.applyTransform([R,N],this.transform)}convertToViewportRectangle(R){let N=Q.applyTransform([R[0],R[1]],this.transform),W=Q.applyTransform([R[2],R[3]],this.transform);return[N[0],N[1],W[0],W[1]]}convertToPdfPoint(R,N){return Q.applyInverseTransform([R,N],this.transform)}};let f0=class f0 extends vr{constructor(R,N=0){super(R,"RenderingCancelledException"),this.extraDelay=N}};function p0(R){let N=R.length,W=0;for(;W<N&&""===R[W].trim();)W++;return"data:"===R.substring(W,W+5).toLowerCase()}function g0(R){return"string"==typeof R&&/\.pdf$/i.test(R)}function jR(R){return[R]=R.split(/[#?]/,1),R.substring(R.lastIndexOf("/")+1)}function zR(R,N="document.pdf"){if("string"!=typeof R)return N;if(p0(R))return vt('getPdfFilenameFromUrl: ignore "data:"-URL for performance reasons.'),N;let W=/[^/?#=]+\.pdf\b(?!.*\.pdf\b)/i,j=/^(?:(?:[^:]+:)?\/\/[^/]+)?([^?#]*)(\?[^#]*)?(#.*)?$/.exec(R),B=W.exec(j[1])||W.exec(j[2])||W.exec(j[3]);if(B&&(B=B[0]).includes("%"))try{B=W.exec(decodeURIComponent(B))[0]}catch{}return B||N}let bv=class bv{constructor(){dt(this,"started",Object.create(null)),dt(this,"times",[])}time(R){R in this.started&&vt(`Timer is already running for ${R}`),this.started[R]=Date.now()}timeEnd(R){R in this.started||vt(`Timer has not been started for ${R}`),this.times.push({name:R,start:this.started[R],end:Date.now()}),delete this.started[R]}toString(){let R=[],N=0;for(let{name:R}of this.times)N=Math.max(R.length,N);for(let{name:W,start:j,end:B}of this.times)R.push(`${W.padEnd(N)} ${B-j}ms 222`);return R.join("")}};function cl(R,N){try{let{protocol:W}=N?new URL(R,N):new URL(R);return"http:"===W||"https:"===W}catch{return!1}}function Ve(R){R.preventDefault()}function Cb(R){console.log("Deprecated API usage: "+R)}let Tb=class Tb{static toDateObject(R){if(!R||"string"!=typeof R)return null;j||(j=RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?"));let N=j.exec(R);if(!N)return null;let W=parseInt(N[1],10),B=parseInt(N[2],10);B=B>=1&&B<=12?B-1:0;let z=parseInt(N[3],10);z=z>=1&&z<=31?z:1;let U=parseInt(N[4],10);U=U>=0&&U<=23?U:0;let V=parseInt(N[5],10);V=V>=0&&V<=59?V:0;let G=parseInt(N[6],10);G=G>=0&&G<=59?G:0;let Y=N[7]||"Z",Z=parseInt(N[8],10);Z=Z>=0&&Z<=23?Z:0;let te=parseInt(N[9],10)||0;return te=te>=0&&te<=59?te:0,"-"===Y?(U+=Z,V+=te):"+"===Y&&(U-=Z,V-=te),new Date(Date.UTC(W,B,z,U,V,G))}};function GR(R,{scale:N=1,rotation:W=0}){let{width:j,height:B}=R.attributes.style,z=[0,0,parseInt(j),parseInt(B)];return new Jh({viewBox:z,scale:N,rotation:W})}function m0(R){if(R.startsWith("#")){let N=parseInt(R.slice(1),16);return[(16711680&N)>>16,(65280&N)>>8,255&N]}return R.startsWith("rgb(")?R.slice(4,-1).split(",").map(R=>parseInt(R)):R.startsWith("rgba(")?R.slice(5,-1).split(",").map(R=>parseInt(R)).slice(0,3):(vt(`Not a valid color format: "${R}"`),[0,0,0])}function Gt(R){let{a:N,b:W,c:j,d:B,e:z,f:U}=R.getTransform();return[N,W,j,B,z,U]}function oi(R){let{a:N,b:W,c:j,d:B,e:z,f:U}=R.getTransform().invertSelf();return[N,W,j,B,z,U]}function to(R,N,W=!1,j=!0){if(N instanceof Jh){let{pageWidth:j,pageHeight:B}=N.rawDims,{style:z}=R,U=Ge.isCSSRoundSupported,V=`var(--scale-factor) * ${j}px`,G=`var(--scale-factor) * ${B}px`,Y=U?`round(${V}, 1px)`:`calc(${V})`,Z=U?`round(${G}, 1px)`:`calc(${G})`;
222W&&N.rotation%180!=0?(z.width=Z,z.height=Y):(z.width=Y,z.height=Z)}j&&R.setAttribute("data-main-rotation",N.rotation)}let vg=class vu{constructor(R){m(this,tY),m(this,tQ),m(this,tZ),m(this,t1),m(this,t5),m(this,tH,null),m(this,tU,null),m(this,tV,void 0),m(this,tG,null),w(this,tV,R)}render(){let R=w(this,tH,document.createElement("div"));R.className="editToolbar",R.setAttribute("role","toolbar"),R.addEventListener("contextmenu",Ve),R.addEventListener("pointerdown",A(vu,tq,tX));let N=w(this,tG,document.createElement("div"));N.className="buttons",R.append(N);let W=a(this,tV).toolbarPosition;if(W){let{style:N}=R,j="ltr"===a(this,tV)._uiManager.direction?1-W[0]:W[0];N.insetInlineEnd=`${100*j}%`,N.top=`calc(${100*W[1]}% + var(--editor-toolbar-vert-offset))`}return A(this,t1,t3).call(this),R}hide(){var R;a(this,tH).classList.add("hidden"),null==(R=a(this,tU))||R.hideDropdown()}show(){a(this,tH).classList.remove("hidden")}addAltTextButton(R){A(this,tZ,t0).call(this,R),a(this,tG).prepend(R,a(this,t5,t4))}addColorPicker(R){w(this,tU,R);let N=R.renderButton();A(this,tZ,t0).call(this,N),a(this,tG).prepend(N,a(this,t5,t4))}remove(){var R;a(this,tH).remove(),null==(R=a(this,tU))||R.destroy(),w(this,tU,null)}};tH=new WeakMap,tU=new WeakMap,tV=new WeakMap,tG=new WeakMap,tq=new WeakSet,tX=function(R){R.stopPropagation()},tY=new WeakSet,tK=function(R){a(this,tV)._focusEventsAllowed=!1,R.preventDefault(),R.stopPropagation()},tQ=new WeakSet,tJ=function(R){a(this,tV)._focusEventsAllowed=!0,R.preventDefault(),R.stopPropagation()},tZ=new WeakSet,t0=function(R){R.addEventListener("focusin",A(this,tY,tK).bind(this),{capture:!0}),R.addEventListener("focusout",A(this,tQ,tJ).bind(this),{capture:!0}),R.addEventListener("contextmenu",Ve)},t1=new WeakSet,t3=function(){let R=document.createElement("button");R.className="delete",R.tabIndex=0,R.setAttribute("data-l10n-id",`pdfjs-editor-remove-${a(this,tV).editorType}-button`),A(this,tZ,t0).call(this,R),R.addEventListener("click",R=>{a(this,tV)._uiManager.delete()}),a(this,tG).append(R)},t5=new WeakSet,t4=function(){let R=document.createElement("div");return R.className="divider",R},m(vg,tq);let WR=class WR{constructor(R){m(this,t9),m(this,ei),m(this,er),m(this,t6,null),m(this,t8,null),m(this,t7,void 0),w(this,t7,R)}show(R,N,W){let[j,B]=A(this,ei,en).call(this,N,W),{style:z}=a(this,t8)||w(this,t8,A(this,t9,ee).call(this));R.append(a(this,t8)),z.insetInlineEnd=`${100*j}%`,z.top=`calc(${100*B}% + var(--editor-toolbar-vert-offset))`}hide(){a(this,t8).remove()}};function iu(R,N,W){for(let j of W)N.addEventListener(j,R[j].bind(R))}t6=new WeakMap,t8=new WeakMap,t7=new WeakMap,t9=new WeakSet,ee=function(){let R=w(this,t8,document.createElement("div"));R.className="editToolbar",R.setAttribute("role","toolbar"),R.addEventListener("contextmenu",Ve);let N=w(this,t6,document.createElement("div"));return N.className="buttons",R.append(N),A(this,er,es).call(this),R},ei=new WeakSet,en=function(R,N){let W=0,j=0;for(let B of R){let R=B.y+B.height;if(R<W)continue;let z=B.x+(N?B.width:0);if(R>W){j=z,W=R;continue}N?z>j&&(j=z):z<j&&(j=z)}return[N?1-j:j,W]},er=new WeakSet,es=function(){let R=document.createElement("button");R.className="highlightButton",R.tabIndex=0,R.setAttribute("data-l10n-id","pdfjs-highlight-floating-button1");let N=document.createElement("span");R.append(N),N.className="visuallyHidden",N.setAttribute("data-l10n-id","pdfjs-highlight-floating-button-label"),R.addEventListener("contextmenu",Ve),R.addEventListener("click",()=>{a(this,t7).highlightSelection("floating_button")}),a(this,t6).append(R)};let XR=class XR{constructor(){m(this,ea,0)}get id(){return`pdfjs_internal_editor_${We(this,ea)._++}`}};ea=new WeakMap;let vv=class{constructor(){m(this,ec),m(this,eo,function(){if("u">typeof crypto&&"function"==typeof(null==crypto?void 0:crypto.randomUUID))return crypto.randomUUID();let R=new Uint8Array(32);if("u">typeof crypto&&"function"==typeof(null==crypto?void 0:crypto.getRandomValues))crypto.getRandomValues(R);else for(let N=0;N<32;N++)R[N]=Math.floor(255*Math.random());return Ab(R)}()),m(this,el,0),m(this,eh,null)}static get _isSVGFittingCanvas(){let R=new OffscreenCanvas(1,3).getContext("2d"),N=new Image;N.src='data:image/svg+xml;charset=UTF-8,<svg viewBox="0 0 1 1" width="1" height="1" xmlns="http://www.w3.org/2000/svg"><rect width="1" height="1" style="fill:red;"/></svg>';let W=N.decode().then(()=>(R.drawImage(N,0,0,1,1,0,0,1,3),0===new Uint32Array(R.getImageData(0,0,1,1).data.buffer)[0]));return Tt(this,"_isSVGFittingCanvas",W)}async getFromFile(R){let{lastModified:N,name:W,size:j,type:B}=R;return A(this,ec,ed).call(this,`${N}_${W}_${j}_${B}`,R)}async getFromUrl(R){return A(this,ec,ed).call(this,R,R)}async getFromId(R){a(this,eh)||w(this,eh,new Map);let N=a(this,eh).get(R);return N?N.bitmap?(N.refCounter+=1,N):N.file?this.getFromFile(N.file):this.getFromUrl(N.url):null}getSvgUrl(R){let N=a(this,eh).get(R);return null!=N&&N.isSvg?N.svgUrl:null}deleteId(R){a(this,eh)||w(this,eh,new Map);let N=a(this,eh).get(R);N&&(N.refCounter-=1,0===N.refCounter&&(N.bitmap=null))}isValidId(R){return R.startsWith(`image_${a(this,eo)}_`)}};eo=new WeakMap,el=new WeakMap,eh=new WeakMap,ec=new WeakSet,ed=async function(R,N){a(this,eh)||w(this,eh,new Map);let W=a(this,eh).get(R);if(null===W)return null;if(null!=W&&W.bitmap)return W.refCounter+=1,W;try{let R;if(W||(W={bitmap:null,id:`image_${a(this,eo)}_${We(this,el)._++}`,refCounter:0,isSvg:!1}),"string"==typeof N?(W.url=N,R=await mp(N,"blob")):R=W.file=N,"image/svg+xml"===R.type){let N=vv._isSVGFittingCanvas,j=new FileReader,B=new Image,z=new Promise((R,z)=>{B.onload=()=>{W.bitmap=B,W.isSvg=!0,R()},j.onload=async()=>{let R=W.svgUrl=j.result;B.src=await N?`${R}#svgView(preserveAspectRatio(none))`:R},B.onerror=j.onerror=z});j.readAsDataURL(R),await z}else W.bitmap=await createImageBitmap(R);W.refCounter=1}catch(R){console.error(R),W=null}return a(this,eh).set(R,W),W&&a(this,eh).set(W.id,W),W};let YR=class YR{constructor(R=128){m(this,eu,[]),m(this,ef,!1),m(this,em,void 0),m(this,ew,-1),w(this,em,R)}add({cmd:R,undo:N,post:W,mustExec:j,type:B=NaN,overwriteIfSameType:z=!1,keepUndo:U=!1}
222){if(j&&R(),a(this,ef))return;let V={cmd:R,undo:N,post:W,type:B};if(-1===a(this,ew)){a(this,eu).length>0&&(a(this,eu).length=0),w(this,ew,0),a(this,eu).push(V);return}if(z&&a(this,eu)[a(this,ew)].type===B){U&&(V.undo=a(this,eu)[a(this,ew)].undo),a(this,eu)[a(this,ew)]=V;return}let G=a(this,ew)+1;G===a(this,em)?a(this,eu).splice(0,1):(w(this,ew,G),G<a(this,eu).length&&a(this,eu).splice(G)),a(this,eu).push(V)}undo(){if(-1===a(this,ew))return;w(this,ef,!0);let{undo:R,post:N}=a(this,eu)[a(this,ew)];R(),null==N||N(),w(this,ef,!1),w(this,ew,a(this,ew)-1)}redo(){if(a(this,ew)<a(this,eu).length-1){w(this,ew,a(this,ew)+1),w(this,ef,!0);let{cmd:R,post:N}=a(this,eu)[a(this,ew)];R(),null==N||N(),w(this,ef,!1)}}hasSomethingToUndo(){return -1!==a(this,ew)}hasSomethingToRedo(){return a(this,ew)<a(this,eu).length-1}destroy(){w(this,eu,null)}};eu=new WeakMap,ef=new WeakMap,em=new WeakMap,ew=new WeakMap;let Qh=class Qh{constructor(R){m(this,ey),this.buffer=[],this.callbacks=new Map,this.allKeys=new Set;let{isMac:N}=Ge.platform;for(let[W,j,B={}]of R)for(let R of W){let W=R.startsWith("mac+");N&&W?(this.callbacks.set(R.slice(4),{callback:j,options:B}),this.allKeys.add(R.split("+").at(-1))):N||W||(this.callbacks.set(R,{callback:j,options:B}),this.allKeys.add(R.split("+").at(-1)))}}
222exec(R,N){if(!this.allKeys.has(N.key))return;let W=this.callbacks.get(A(this,ey,eb).call(this,N));if(!W)return;let{callback:j,options:{bubbles:B=!1,args:z=[],checker:U=null}}=W;U&&!U(R,N)||(j.bind(R,...z,N)(),B||(N.stopPropagation(),N.preventDefault()))}};ey=new WeakSet,eb=function(R){R.altKey&&this.buffer.push("alt"),R.ctrlKey&&this.buffer.push("ctrl"),R.metaKey&&this.buffer.push("meta"),R.shiftKey&&this.buffer.push("shift"),this.buffer.push(R.key);let N=this.buffer.join("+");return this.buffer.length=0,N};let vw=class Su{get _colors(){let R=new Map([["CanvasText",null],["Canvas",null]]);return function(R){let N=document.createElement("span");for(let W of(N.style.visibility="hidden",document.body.append(N),R.keys())){N.style.color=W;let j=window.getComputedStyle(N).color;R.set(W,m0(j))}N.remove()}(R),Tt(this,"_colors",R)}convert(R){let N=m0(R);if(!window.matchMedia("(forced-colors: active)").matches)return N;for(let[R,W]of this._colors)if(W.every((R,W)=>R===N[W]))return Su._colorsMapping.get(R);return N}getHexCode(R){let N=this._colors.get(R);return N?Q.makeHexColor(...N):R}};dt(vw,"_colorsMapping",new Map([["CanvasText",[0,0,0]],["Canvas",[255,255,255]]]));let vA=class Ao{constructor(R,N,W,j,B,z,U,V,G){m(this,ia),m(this,ic),m(this,ig),m(this,iA),m(this,i_),m(this,iC),m(this,iT),m(this,iL),m(this,iD),m(this,iO),m(this,iW),m(this,iB),m(this,iz),m(this,iU),m(this,iG),m(this,iX),m(this,iK),m(this,iJ),m(this,i0),m(this,i3),m(this,eA,null),m(this,e_,new Map),m(this,eS,new Map),m(this,eE,null),m(this,ek,null),m(this,eC,null),m(this,eM,new YR),m(this,eT,0),m(this,eR,new Set),m(this,eP,null),m(this,eL,null),m(this,eI,new Set),m(this,eD,!1),m(this,eN,null),m(this,eO,null),m(this,eF,null),m(this,eW,!1),m(this,ej,null),m(this,eB,new XR),m(this,e$,!1),m(this,ez,!1),m(this,eH,null),m(this,eU,null),m(this,eV,null),m(this,eG,mZ.NONE),m(this,eq,new Set),m(this,eX,null),m(this,eY,null),m(this,eK,null),m(this,eQ,this.blur.bind(this)),m(this,eJ,this.focus.bind(this)),m(this,eZ,this.copy.bind(this)),m(this,e1,this.cut.bind(this)),m(this,e2,this.paste.bind(this)),m(this,e3,this.keydown.bind(this)),m(this,e5,this.keyup.bind(this)),m(this,e4,this.onEditingAction.bind(this)),m(this,e6,this.onPageChanging.bind(this)),m(this,e8,this.onScaleChanging.bind(this)),m(this,e7,A(this,ig,im).bind(this)),m(this,e9,this.onRotationChanging.bind(this)),m(this,it,{isEditing:!1,isEmpty:!0,hasSomethingToUndo:!1,hasSomethingToRedo:!1,hasSelectedEditor:!1,hasSelectedText:!1}),m(this,ie,[0,0]),m(this,ii,null),m(this,ir,null),m(this,is,null),w(this,ir,R),w(this,is,N),w(this,eE,W),this._eventBus=j,this._eventBus._on("editingaction",a(this,e4)),this._eventBus._on("pagechanging",a(this,e6)),this._eventBus._on("scalechanging",a(this,e8)),this._eventBus._on("rotationchanging",a(this,e9)),A(this,i_,iS).call(this),A(this,iD,iN).call(this),w(this,ek,B.annotationStorage),w(this,eN,B.filterFactory),w(this,eY,z),w(this,eF,U||null),w(this,eD,V),w(this,eV,G||null),this.viewParameters={realScale:vf.PDF_TO_CSS_UNITS,rotation:0},this.isShiftKeyDown=!1}static get _keyboardManager(){let R=Ao.prototype,e=R=>a(R,ir).contains(document.activeElement)&&"BUTTON"!==document.activeElement.tagName&&R.hasSomethingToControl(),n=(R,{target:N})=>{if(N instanceof HTMLInputElement){let{type:R}=N;return"text"!==R&&"number"!==R}return!0},N=this.TRANSLATE_SMALL,W=this.TRANSLATE_BIG;return Tt(this,"_keyboardManager",new Qh([[["ctrl+a","mac+meta+a"],R.selectAll,{checker:n}],[["ctrl+z","mac+meta+z"],R.undo,{checker:n}],[["ctrl+y","ctrl+shift+z","mac+meta+shift+z","ctrl+shift+Z","mac+meta+shift+Z"],R.redo,{checker:n}],[["Backspace","alt+Backspace","ctrl+Backspace","shift+Backspace","mac+Backspace","mac+alt+Backspace","mac+ctrl+Backspace","Delete","ctrl+Delete","shift+Delete","mac+Delete"],R.delete,{checker:n}],[["Enter","mac+Enter"],R.addNewEditorFromKeyboard,{checker:(R,{target:N})=>!(N instanceof HTMLButtonElement)&&a(R,ir).contains(N)&&!R.isEnterHandled}],[[" ","mac+ "],R.addNewEditorFromKeyboard,{checker:(R,{target:N})=>!(N instanceof HTMLButtonElement)&&a(R,ir).contains(document.activeElement)}],[["Escape","mac+Escape"],R.unselectAll],[["ArrowLeft","mac+ArrowLeft"],R.translateSelectedEditors,{args:[-N,0],checker:e}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],R.translateSelectedEditors,{args:[-W,0],checker:e}],[["ArrowRight","mac+ArrowRight"],R.translateSelectedEditors,{args:[N,0],checker:e}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],R.translateSelectedEditors,{args:[W,0],checker:e}],[["ArrowUp","mac+ArrowUp"],R.translateSelectedEditors,{args:[0,-N],checker:e}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],R.translateSelectedEditors,{args:[0,-W],checker:e}],[["ArrowDown","mac+ArrowDown"],R.translateSelectedEditors,{args:[0,N],checker:e}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],R.translateSelectedEditors,{args:[0,W],checker:e}]]))}destroy(){var R,N;
222for(let R of(A(this,iO,iF).call(this),A(this,iL,iI).call(this),this._eventBus._off("editingaction",a(this,e4)),this._eventBus._off("pagechanging",a(this,e6)),this._eventBus._off("scalechanging",a(this,e8)),this._eventBus._off("rotationchanging",a(this,e9)),a(this,eS).values()))R.destroy();a(this,eS).clear(),a(this,e_).clear(),a(this,eI).clear(),w(this,eA,null),a(this,eq).clear(),a(this,eM).destroy(),null==(R=a(this,eE))||R.destroy(),null==(N=a(this,ej))||N.hide(),w(this,ej,null),a(this,eO)&&(clearTimeout(a(this,eO)),w(this,eO,null)),a(this,ii)&&(clearTimeout(a(this,ii)),w(this,ii,null)),A(this,iC,iM).call(this)}async mlGuess(R){var N;return(null==(N=a(this,eV))?void 0:N.guess(R))||null}get hasMLManager(){return!!a(this,eV)}get hcmFilter(){return Tt(this,"hcmFilter",a(this,eY)?a(this,eN).addHCMFilter(a(this,eY).foreground,a(this,eY).background):"none")}get direction(){return Tt(this,"direction",getComputedStyle(a(this,ir)).direction)}get highlightColors(){return Tt(this,"highlightColors",a(this,eF)?new Map(a(this,eF).split(",").map(R=>R.split("=").map(R=>R.trim()))):null)}get highlightColorNames(){return Tt(this,"highlightColorNames",this.highlightColors?new Map(Array.from(this.highlightColors,R=>R.reverse())):null)}setMainHighlightColorPicker(R){w(this,eU,R)}editAltText(R){var N;null==(N=a(this,eE))||N.editAltText(this,R)}onPageChanging({pageNumber:R}){w(this,eT,R-1)}focusMainContainer(){a(this,ir).focus()}findParent(R,N){for(let W of a(this,eS).values()){let{x:j,y:B,width:z,height:U}=W.div.getBoundingClientRect();if(R>=j&&R<=j+z&&N>=B&&N<=B+U)return W}return null}disableUserSelect(R=!1){a(this,is).classList.toggle("noUserSelect",R)}addShouldRescale(R){a(this,eI).add(R)}removeShouldRescale(R){a(this,eI).delete(R)}onScaleChanging({scale:R}){for(let N of(this.commitOrRemove(),this.viewParameters.realScale=R*vf.PDF_TO_CSS_UNITS,a(this,eI)))N.onScaleChanging()}onRotationChanging({pagesRotation:R}){this.commitOrRemove(),this.viewParameters.rotation=R}highlightSelection(R=""){let N=document.getSelection();if(!N||N.isCollapsed)return;let{anchorNode:W,anchorOffset:j,focusNode:B,focusOffset:z}=N,U=N.toString(),V=A(this,ia,ih).call(this,N).closest(".textLayer"),G=this.getSelectionBoxes(V);if(G){for(let Y of(N.empty(),a(this,eG)===mZ.NONE&&(this._eventBus.dispatch("showannotationeditorui",{source:this,mode:mZ.HIGHLIGHT}),this.showAllEditors("highlight",!0,!0)),a(this,eS).values()))if(Y.hasTextLayer(V)){Y.createAndAddNewEditor({x:0,y:0},!1,{methodOfCreation:R,boxes:G,anchorNode:W,anchorOffset:j,focusNode:B,focusOffset:z,text:U});break}}}addToAnnotationStorage(R){!R.isEmpty()&&a(this,ek)&&!a(this,ek).has(R.id)&&a(this,ek).setValue(R.id,R)}blur(){if(this.isShiftKeyDown=!1,a(this,eW)&&(w(this,eW,!1),A(this,iA,ix).call(this,"main_toolbar")),!this.hasSelection)return;let{activeElement:R}=document;for(let N of a(this,eq))if(N.div.contains(R)){w(this,eH,[N,R]),N._focusEventsAllowed=!1;break}}focus(){if(!a(this,eH))return;let[R,N]=a(this,eH);w(this,eH,null),N.addEventListener("focusin",()=>{R._focusEventsAllowed=!0},{once:!0}),N.focus()}addEditListeners(){A(this,iD,iN).call(this),A(this,iW,ij).call(this)}removeEditListeners(){A(this,iO,iF).call(this),A(this,iB,i$).call(this)}copy(R){var N;if(R.preventDefault(),null==(N=a(this,eA))||N.commitOrRemove(),!this.hasSelection)return;let W=[];for(let R of a(this,eq)){let N=R.serialize(!0);N&&W.push(N)}0!==W.length&&R.clipboardData.setData("application/pdfjs",JSON.stringify(W))}cut(R){this.copy(R),this.delete()}paste(R){R.preventDefault();let{clipboardData:N}=R;for(let R of N.items)for(let N of a(this,eL))if(N.isHandlingMimeForPasting(R.type)){N.paste(R,this.currentLayer);return}let W=N.getData("application/pdfjs");if(!W)return;try{W=JSON.parse(W)}catch(R){vt(`paste: "${R.message}".`);return}if(!Array.isArray(W))return;this.unselectAll();let j=this.currentLayer;try{let R=[];for(let N of W){let W=j.deserialize(N);if(!W)return;R.push(W)}this.addCommands({cmd:()=>{for(let N of R)A(this,iK,iQ).call(this,N);A(this,i3,i5).call(this,R)},undo:()=>{for(let N of R)N.remove()},mustExec:!0})}catch(R){vt(`paste: "${R.message}".`)}}keydown(R){this.isShiftKeyDown||"Shift"!==R.key||(this.isShiftKeyDown=!0),a(this,eG)===mZ.NONE||this.isEditorHandlingKeyboard||Ao._keyboardManager.exec(this,R)}keyup(R){this.isShiftKeyDown&&"Shift"===R.key&&(this.isShiftKeyDown=!1,a(this,eW)&&(w(this,eW,!1),A(this,iA,ix).call(this,"main_toolbar")))}onEditingAction({name:R}){switch(R){case"undo":case"redo":case"delete":case"selectAll":this[R]();break;case"highlightSelection":this.highlightSelection("context_menu")}}
222setEditingState(R){R?(A(this,iT,iR).call(this),A(this,iW,ij).call(this),A(this,iz,iH).call(this,{isEditing:a(this,eG)!==mZ.NONE,isEmpty:A(this,i0,i1).call(this),hasSomethingToUndo:a(this,eM).hasSomethingToUndo(),hasSomethingToRedo:a(this,eM).hasSomethingToRedo(),hasSelectedEditor:!1})):(A(this,iL,iI).call(this),A(this,iB,i$).call(this),A(this,iz,iH).call(this,{isEditing:!1}),this.disableUserSelect(!1))}registerEditorTypes(R){if(!a(this,eL))for(let N of(w(this,eL,R),a(this,eL)))A(this,iU,iV).call(this,N.defaultPropertiesToUpdate)}getId(){return a(this,eB).id}get currentLayer(){return a(this,eS).get(a(this,eT))}getLayer(R){return a(this,eS).get(R)}get currentPageIndex(){return a(this,eT)}addLayer(R){a(this,eS).set(R.pageIndex,R),a(this,e$)?R.enable():R.disable()}removeLayer(R){a(this,eS).delete(R.pageIndex)}updateMode(R,N=null,W=!1){if(a(this,eG)!==R){if(w(this,eG,R),R===mZ.NONE){this.setEditingState(!1),A(this,iX,iY).call(this);return}for(let N of(this.setEditingState(!0),A(this,iG,iq).call(this),this.unselectAll(),a(this,eS).values()))N.updateMode(R);if(!N&&W){this.addNewEditorFromKeyboard();return}if(N){for(let R of a(this,e_).values())if(R.annotationElementId===N){this.setSelected(R),R.enterInEditMode();break}}}}addNewEditorFromKeyboard(){this.currentLayer.canCreateNewEmptyEditor()&&this.currentLayer.addNewEditor()}updateToolbar(R){R!==a(this,eG)&&this._eventBus.dispatch("switchannotationeditormode",{source:this,mode:R})}updateParams(R,N){var W;if(a(this,eL)){switch(R){case m1.CREATE:this.currentLayer.addNewEditor();return;case m1.HIGHLIGHT_DEFAULT_COLOR:null==(W=a(this,eU))||W.updateColor(N);break;case m1.HIGHLIGHT_SHOW_ALL:this._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",data:{type:"highlight",action:"toggle_visibility"}}}),(a(this,eK)||w(this,eK,new Map)).set(R,N),this.showAllEditors("highlight",N)}for(let W of a(this,eq))W.updateParams(R,N);for(let W of a(this,eL))W.updateDefaultParams(R,N)}}showAllEditors(R,N,W=!1){var j;for(let W of a(this,e_).values())W.editorType===R&&W.show(N);((null==(j=a(this,eK))?void 0:j.get(m1.HIGHLIGHT_SHOW_ALL))??!0)!==N&&A(this,iU,iV).call(this,[[m1.HIGHLIGHT_SHOW_ALL,N]])}enableWaiting(R=!1){if(a(this,ez)!==R)for(let N of(w(this,ez,R),a(this,eS).values()))R?N.disableClick():N.enableClick(),N.div.classList.toggle("waiting",R)}getEditors(R){let N=[];for(let W of a(this,e_).values())W.pageIndex===R&&N.push(W);return N}getEditor(R){return a(this,e_).get(R)}
222addEditor(R){a(this,e_).set(R.id,R)}removeEditor(R){var N;R.div.contains(document.activeElement)&&(a(this,eO)&&clearTimeout(a(this,eO)),w(this,eO,setTimeout(()=>{this.focusMainContainer(),w(this,eO,null)},0))),a(this,e_).delete(R.id),this.unselect(R),R.annotationElementId&&a(this,eR).has(R.annotationElementId)||null==(N=a(this,ek))||N.remove(R.id)}addDeletedAnnotationElement(R){a(this,eR).add(R.annotationElementId),this.addChangedExistingAnnotation(R),R.deleted=!0}isDeletedAnnotationElement(R){return a(this,eR).has(R)}removeDeletedAnnotationElement(R){a(this,eR).delete(R.annotationElementId),this.removeChangedExistingAnnotation(R),R.deleted=!1}setActiveEditor(R){a(this,eA)!==R&&(w(this,eA,R),R&&A(this,iU,iV).call(this,R.propertiesToUpdate))}updateUI(R){a(this,iJ,iZ)===R&&A(this,iU,iV).call(this,R.propertiesToUpdate)}toggleSelected(R){if(a(this,eq).has(R)){a(this,eq).delete(R),R.unselect(),A(this,iz,iH).call(this,{hasSelectedEditor:this.hasSelection});return}a(this,eq).add(R),R.select(),A(this,iU,iV).call(this,R.propertiesToUpdate),A(this,iz,iH).call(this,{hasSelectedEditor:!0})}setSelected(R){for(let N of a(this,eq))N!==R&&N.unselect();a(this,eq).clear(),a(this,eq).add(R),R.select(),A(this,iU,iV).call(this,R.propertiesToUpdate),A(this,iz,iH).call(this,{hasSelectedEditor:!0})}isSelected(R){return a(this,eq).has(R)}get firstSelectedEditor(){return a(this,eq).values().next().value}unselect(R){R.unselect(),a(this,eq).delete(R),A(this,iz,iH).call(this,{hasSelectedEditor:this.hasSelection})}get hasSelection(){return 0!==a(this,eq).size}get isEnterHandled(){return 1===a(this,eq).size&&this.firstSelectedEditor.isEnterHandled}undo(){a(this,eM).undo(),A(this,iz,iH).call(this,{hasSomethingToUndo:a(this,eM).hasSomethingToUndo(),hasSomethingToRedo:!0,isEmpty:A(this,i0,i1).call(this)})}redo(){a(this,eM).redo(),A(this,iz,iH).call(this,{hasSomethingToUndo:!0,hasSomethingToRedo:a(this,eM).hasSomethingToRedo(),isEmpty:A(this,i0,i1).call(this)})}addCommands(R){a(this,eM).add(R),A(this,iz,iH).call(this,{hasSomethingToUndo:!0,hasSomethingToRedo:!1,isEmpty:A(this,i0,i1).call(this)})}delete(){if(this.commitOrRemove(),!this.hasSelection)return;let R=[...a(this,eq)];this.addCommands({cmd:()=>{for(let N of R)N.remove()},undo:()=>{for(let N of R)A(this,iK,iQ).call(this,N)},mustExec:!0})}commitOrRemove(){var R;null==(R=a(this,eA))||R.commitOrRemove()}hasSomethingToControl(){return a(this,eA)||this.hasSelection}selectAll(){for(let R of a(this,eq))R.commit();A(this,i3,i5).call(this,a(this,e_).values())}unselectAll(){if(!(a(this,eA)&&(a(this,eA).commitOrRemove(),a(this,eG)!==mZ.NONE))&&this.hasSelection){for(let R of a(this,eq))R.unselect();a(this,eq).clear(),A(this,iz,iH).call(this,{hasSelectedEditor:!1})}}translateSelectedEditors(R,N,W=!1){if(W||this.commitOrRemove(),!this.hasSelection)return;a(this,ie)[0]+=R,a(this,ie)[1]+=N;let[j,B]=a(this,ie),z=[...a(this,eq)];for(let W of(a(this,ii)&&clearTimeout(a(this,ii)),w(this,ii,setTimeout(()=>{w(this,ii,null),a(this,ie)[0]=a(this,ie)[1]=0,this.addCommands({cmd:()=>{for(let R of z)a(this,e_).has(R.id)&&R.translateInPage(j,B)},undo:()=>{for(let R of z)a(this,e_).has(R.id)&&R.translateInPage(-j,-B)},mustExec:!1})},1e3)),z))W.translateInPage(R,N)}setUpDragSession(){if(this.hasSelection)for(let R of(this.disableUserSelect(!0),w(this,eP,new Map),a(this,eq)))a(this,eP).set(R,{savedX:R.x,savedY:R.y,savedPageIndex:R.pageIndex,newX:0,newY:0,newPageIndex:-1})}endDragSession(){if(!a(this,eP))return!1;this.disableUserSelect(!1);let R=a(this,eP);w(this,eP,null);let N=!1;for(let[{x:W,y:j,pageIndex:B},z]of R)z.newX=W,z.newY=j,z.newPageIndex=B,N||(N=W!==z.savedX||j!==z.savedY||B!==z.savedPageIndex);if(!N)return!1;let n=(R,N,W,j)=>{if(a(this,e_).has(R.id)){let B=a(this,eS).get(j);B?R._setParentAndPosition(B,N,W):(R.pageIndex=j,R.x=N,R.y=W)}};return this.addCommands({cmd:()=>{for(let[N,{newX:W,newY:j,newPageIndex:B}]of R)n(N,W,j,B)},undo:()=>{for(let[N,{savedX:W,savedY:j,savedPageIndex:B}]of R)n(N,W,j,B)},mustExec:!0}),!0}dragSelectedEditors(R,N){if(a(this,eP))for(let W of a(this,eP).keys())W.drag(R,N)}rebuild(R){if(null===R.parent){let N=this.getLayer(R.pageIndex);
222N?(N.changeParent(R),N.addOrRebuild(R)):(this.addEditor(R),this.addToAnnotationStorage(R),R.rebuild())}else R.parent.addOrRebuild(R)}get isEditorHandlingKeyboard(){var R;return(null==(R=this.getActive())?void 0:R.shouldGetKeyboardEvents())||1===a(this,eq).size&&this.firstSelectedEditor.shouldGetKeyboardEvents()}isActive(R){return a(this,eA)===R}getActive(){return a(this,eA)}getMode(){return a(this,eG)}get imageManager(){return Tt(this,"imageManager",new vv)}getSelectionBoxes(R){let N;if(!R)return null;let W=document.getSelection();for(let N=0,j=W.rangeCount;N<j;N++)if(!R.contains(W.getRangeAt(N).commonAncestorContainer))return null;let{x:j,y:B,width:z,height:U}=R.getBoundingClientRect();switch(R.getAttribute("data-main-rotation")){case"90":N=(R,N,W,V)=>({x:(N-B)/U,y:1-(R+W-j)/z,width:V/U,height:W/z});break;case"180":N=(R,N,W,V)=>({x:1-(R+W-j)/z,y:1-(N+V-B)/U,width:W/z,height:V/U});break;case"270":N=(R,N,W,V)=>({x:1-(N+V-B)/U,y:(R-j)/z,width:V/U,height:W/z});break;default:N=(R,N,W,V)=>({x:(R-j)/z,y:(N-B)/U,width:W/z,height:V/U})}let V=[];for(let R=0,j=W.rangeCount;R<j;R++){let j=W.getRangeAt(R);if(!j.collapsed)for(let{x:R,y:W,width:B,height:z}of j.getClientRects())0===B||0===z||V.push(N(R,W,B,z))}return 0===V.length?null:V}addChangedExistingAnnotation({annotationElementId:R,id:N}){(a(this,eC)||w(this,eC,new Map)).set(R,N)}removeChangedExistingAnnotation({annotationElementId:R}){var N;null==(N=a(this,eC))||N.delete(R)}renderAnnotationElement(R){var N;let W=null==(N=a(this,eC))?void 0:N.get(R.data.id);if(!W)return;let j=a(this,ek).getRawValue(W);j&&(a(this,eG)!==mZ.NONE||j.hasBeenModified)&&j.renderAnnotationElement(R)}};eA=new WeakMap,e_=new WeakMap,eS=new WeakMap,eE=new WeakMap,ek=new WeakMap,eC=new WeakMap,eM=new WeakMap,eT=new WeakMap,eR=new WeakMap,eP=new WeakMap,eL=new WeakMap,eI=new WeakMap,eD=new WeakMap,eN=new WeakMap,eO=new WeakMap,eF=new WeakMap,eW=new WeakMap,ej=new WeakMap,eB=new WeakMap,e$=new WeakMap,ez=new WeakMap,eH=new WeakMap,eU=new WeakMap,eV=new WeakMap,eG=new WeakMap,eq=new WeakMap,eX=new WeakMap,eY=new WeakMap,eK=new WeakMap,eQ=new WeakMap,eJ=new WeakMap,eZ=new WeakMap,e1=new WeakMap,e2=new WeakMap,e3=new WeakMap,e5=new WeakMap,e4=new WeakMap,e6=new WeakMap,e8=new WeakMap,e7=new WeakMap,e9=new WeakMap,it=new WeakMap,ie=new WeakMap,ii=new WeakMap,ir=new WeakMap,is=new WeakMap,ia=new WeakSet,ih=function({anchorNode:R}){return R.nodeType===Node.TEXT_NODE?R.parentElement:R},ic=new WeakSet,id=function(){let R=document.getSelection();if(!R||R.isCollapsed)return;let N=A(this,ia,ih).call(this,R).closest(".textLayer"),W=this.getSelectionBoxes(N);W&&(a(this,ej)||w(this,ej,new WR(this)),a(this,ej).show(N,W,"ltr"===this.direction))},ig=new WeakSet,im=function(){var R,N,W;let j=document.getSelection();if(!j||j.isCollapsed){a(this,eX)&&(null==(R=a(this,ej))||R.hide(),w(this,eX,null),A(this,iz,iH).call(this,{hasSelectedText:!1}));return}let{anchorNode:B}=j;if(B!==a(this,eX)){if(!A(this,ia,ih).call(this,j).closest(".textLayer")){a(this,eX)&&(null==(N=a(this,ej))||N.hide(),w(this,eX,null),A(this,iz,iH).call(this,{hasSelectedText:!1}));return}if(null==(W=a(this,ej))||W.hide(),w(this,eX,B),A(this,iz,iH).call(this,{hasSelectedText:!0}),!(a(this,eG)!==mZ.HIGHLIGHT&&a(this,eG)!==mZ.NONE)&&(a(this,eG)===mZ.HIGHLIGHT&&this.showAllEditors("highlight",!0,!0),w(this,eW,this.isShiftKeyDown),!this.isShiftKeyDown)){let c=R=>{"pointerup"===R.type&&0!==R.button||(window.removeEventListener("pointerup",c),window.removeEventListener("blur",c),"pointerup"===R.type&&A(this,iA,ix).call(this,"main_toolbar"))};window.addEventListener("pointerup",c),window.addEventListener("blur",c)}}},iA=new WeakSet,ix=function(R=""){a(this,eG)===mZ.HIGHLIGHT?this.highlightSelection(R):a(this,eD)&&A(this,ic,id).call(this)},i_=new WeakSet,iS=function(){document.addEventListener("selectionchange",a(this,e7))},iC=new WeakSet,iM=function(){document.removeEventListener("selectionchange",a(this,e7))},iT=new WeakSet,iR=function(){window.addEventListener("focus",a(this,eJ)),window.addEventListener("blur",a(this,eQ))},iL=new WeakSet,iI=function(){window.removeEventListener("focus",a(this,eJ)),window.removeEventListener("blur",a(this,eQ))},iD=new WeakSet,iN=function(){window.addEventListener("keydown",a(this,e3)),window.addEventListener("keyup",a(this,e5))},iO=new WeakSet,iF=function(){window.removeEventListener("keydown",a(this,e3)),window.removeEventListener("keyup",a(this,e5))},iW=new WeakSet,ij=function(){document.addEventListener("copy",a(this,eZ)),document.addEventListener("cut",a(this,e1)),document.addEventListener("paste",a(this,e2))},iB=new WeakSet,i$=function(){document.removeEventListener("copy",a(this,eZ)),document.removeEventListener("cut",a(this,e1)),document.removeEventListener("paste",a(this,e2))},iz=new WeakSet,iH=function(R){Object.entries(R).some(([R,N])=>a(this,it)[R]!==N)&&(this._eventBus.dispatch("annotationeditorstateschanged",{source:this,details:Object.assign(a(this,it),R)}),a(this,eG)===mZ.HIGHLIGHT&&!1===R.hasSelectedEditor&&A(this,iU,iV).call(this,[[m1.HIGHLIGHT_FREE,!0]]))},iU=new WeakSet,iV=function(R){this._eventBus.dispatch("annotationeditorparamschanged",{source:this,details:R})},iG=new WeakSet,iq=function(){if(!a(this,e$)){for(let R of(w(this,e$,!0),a(this,eS).values())
222)R.enable();for(let R of a(this,e_).values())R.enable()}},iX=new WeakSet,iY=function(){if(this.unselectAll(),a(this,e$)){for(let R of(w(this,e$,!1),a(this,eS).values()))R.disable();for(let R of a(this,e_).values())R.disable()}},iK=new WeakSet,iQ=function(R){let N=a(this,eS).get(R.pageIndex);N?N.addOrRebuild(R):(this.addEditor(R),this.addToAnnotationStorage(R))},iJ=new WeakSet,iZ=function(){let R=null;for(R of a(this,eq));return R},i0=new WeakSet,i1=function(){if(0===a(this,e_).size)return!0;if(1===a(this,e_).size)for(let R of a(this,e_).values())return R.isEmpty();return!1},i3=new WeakSet,i5=function(R){for(let R of a(this,eq))R.unselect();for(let N of(a(this,eq).clear(),R))N.isEmpty()||(a(this,eq).add(N),N.select());A(this,iz,iH).call(this,{hasSelectedEditor:this.hasSelection})},dt(vA,"TRANSLATE_SMALL",1),dt(vA,"TRANSLATE_BIG",10);let vx=vA,v_=class ci{constructor(R){m(this,nn),m(this,i4,""),m(this,i6,!1),m(this,i8,null),m(this,i7,null),m(this,i9,null),m(this,nt,!1),m(this,ne,null),w(this,ne,R)}static initialize(R){ci._l10nPromise||(ci._l10nPromise=R)}async render(){let R=w(this,i8,document.createElement("button"));R.className="altText";let N=await ci._l10nPromise.get("pdfjs-editor-alt-text-button-label");R.textContent=N,R.setAttribute("aria-label",N),R.tabIndex="0",R.addEventListener("contextmenu",Ve),R.addEventListener("pointerdown",R=>R.stopPropagation());let n=R=>{R.preventDefault(),a(this,ne)._uiManager.editAltText(a(this,ne))};return R.addEventListener("click",n,{capture:!0}),R.addEventListener("keydown",N=>{N.target===R&&"Enter"===N.key&&(w(this,nt,!0),n(N))}),await A(this,nn,nr).call(this),R}finish(){a(this,i8)&&(a(this,i8).focus({focusVisible:a(this,nt)}),w(this,nt,!1))}isEmpty(){return!a(this,i4)&&!a(this,i6)}get data(){return{altText:a(this,i4),decorative:a(this,i6)}}set data({altText:R,decorative:N}){a(this,i4)===R&&a(this,i6)===N||(w(this,i4,R),w(this,i6,N),A(this,nn,nr).call(this))}toggle(R=!1){a(this,i8)&&(!R&&a(this,i9)&&(clearTimeout(a(this,i9)),w(this,i9,null)),a(this,i8).disabled=!R)}destroy(){var R;null==(R=a(this,i8))||R.remove(),w(this,i8,null),w(this,i7,null)}};i4=new WeakMap,i6=new WeakMap,i8=new WeakMap,i7=new WeakMap,i9=new WeakMap,nt=new WeakMap,ne=new WeakMap,nn=new WeakSet,nr=async function(){var R;let N=a(this,i8);if(!N)return;if(!a(this,i4)&&!a(this,i6)){N.classList.remove("done"),null==(R=a(this,i7))||R.remove();return}N.classList.add("done"),v_._l10nPromise.get("pdfjs-editor-alt-text-edit-button-label").then(R=>{N.setAttribute("aria-label",R)});let W=a(this,i7);if(!W){w(this,i7,W=document.createElement("span")),W.className="tooltip",W.setAttribute("role","tooltip");let R=W.id=`alt-text-tooltip-${a(this,ne).id}`;N.setAttribute("aria-describedby",R),N.addEventListener("mouseenter",()=>{w(this,i9,setTimeout(()=>{w(this,i9,null),a(this,i7).classList.add("show"),a(this,ne)._reportTelemetry({action:"alt_text_tooltip"})},100))}),N.addEventListener("mouseleave",()=>{var R;a(this,i9)&&(clearTimeout(a(this,i9)),w(this,i9,null)),null==(R=a(this,i7))||R.classList.remove("show")})}W.innerText=a(this,i6)?await v_._l10nPromise.get("pdfjs-editor-alt-text-decorative-tooltip"):a(this,i4),W.parentNode||N.append(W);let j=a(this,ne).getImageForAltText();null==j||j.setAttribute("aria-describedby",W.id)},dt(v_,"_l10nPromise",null);let vS=class Nt{constructor(R){m(this,nP),m(this,nN),m(this,nF),m(this,nj),m(this,n$),m(this,nH),m(this,nV),m(this,nq),m(this,nY),m(this,nQ),m(this,nZ),m(this,n3),m(this,n4),m(this,ns,null),m(this,na,null),m(this,no,!1),m(this,nh,!1),m(this,nc,null),m(this,nu,null),m(this,np,this.focusin.bind(this)),m(this,nf,this.focusout.bind(this)),m(this,ng,null),m(this,nm,""),m(this,nv,!1),m(this,ny,null),m(this,nA,!1),m(this,nx,!1),m(this,n_,!1),m(this,nS,null),m(this,nk,0),m(this,nC,0),m(this,nM,null),dt(this,"_initialOptions",Object.create(null)),dt(this,"_isVisible",!0),dt(this,"_uiManager",null),dt(this,"_focusEventsAllowed",!0),dt(this,"_l10nPromise",null),m(this,nT,!1),m(this,nR,Nt._zIndex++),this.constructor===Nt&&Dt("Cannot initialize AnnotationEditor."),this.parent=R.parent,this.id=R.id,this.width=this.height=null,this.pageIndex=R.parent.pageIndex,this.name=R.name,this.div=null,this._uiManager=R.uiManager,this.annotationElementId=null,this._willKeepAspectRatio=!1,this._initialOptions.isCentered=R.isCentered,this._structTreeParentId=null;let{rotation:N,rawDims:{pageWidth:W,pageHeight:j,pageX:B,pageY:z}}=this.parent.viewport;this.rotation=N,this.pageRotation=(360+N-this._uiManager.viewParameters.rotation)%360,this.pageDimensions=[W,j],this.pageTranslation=[B,z];let[U,V]=this.parentDimensions;this.x=R.x/U,this.y=R.y/V,this.isAttachedToDOM=!1,this.deleted=!1}static get _resizerKeyboardManager(){let R=Nt.prototype._resizeWithKeyboard,N=vx.TRANSLATE_SMALL,W=vx.TRANSLATE_BIG;return Tt(this,"_resizerKeyboardManager",new Qh([[["ArrowLeft","mac+ArrowLeft"],R,{args:[-N,0]}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],R,{args:[-W,0]}],[["ArrowRight","mac+ArrowRight"],R,{args:[N,0]}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],R,{args:[W,0]}],[["ArrowUp","mac+ArrowUp"],R,{args:[0,-N]}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],R,{args:[0,-W]}],[["ArrowDown","mac+ArrowDown"],R,{args:[0,N]}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],R,{args:[0,W]}],[["Escape","mac+Escape"],Nt.prototype._stopResizingWithKeyboard]]))}get editorType(){return Object.getPrototypeOf(this).constructor._type}static get _defaultLineColor(){return Tt(this,"_defaultLineColor",this._colorManager.getHexCode("CanvasText"))}static deleteAnnotationElement(R){let N=new KR({id:R.parent.getNextId(),parent:R.parent,uiManager:R._uiManager});N.annotationElementId=R.annotationElementId,N.deleted=!0,N._uiManager.addToAnnotationStorage(N)}static initialize(R,N,W){if(Nt._l10nPromise||(Nt._l10nPromise=new Map(["pdfjs-editor-alt-text-button-label","pdfjs-editor-alt-text-edit-button-label","pdfjs-editor-alt-text-decorative-tooltip","pdfjs-editor-resizer-label-topLeft","pdfjs-editor-resizer-label-topMiddle","pdfjs-editor-resizer-label-topRight","pdfjs-editor-resizer-label-middleRight","pdfjs-editor-resizer-label-bottomRight","pdfjs-editor-resizer-label-bottomMiddle","pdfjs-editor-resizer-label-bottomLeft","pdfjs-editor-resizer-label-middleLeft"].map(N=>[N,R.get(N.replaceAll(/([A-Z])/g,R=>`-${R.toLowerCase()}`))]))),null!=W&&W.strings)for(let N of W.strings)Nt._l10nPromise.set(N,R.get(N));if(-1!==Nt._borderLineWidth)return;let j=getComputedStyle(document.documentElement);Nt._borderLineWidth=parseFloat(j.getPropertyValue("--outline-width"))||0}static updateDefaultParams(R,N){}static get defaultPropertiesToUpdate(){return[]}static isHandlingMimeForPasting(R){return!1}static paste(R,N){Dt("Not implemented")}get propertiesToUpdate(){return[]}get _isDraggable(){return a(this,nT)}set _isDraggable(R){var N;w(this,nT,R),null==(N=this.div)||N.classList.toggle("draggable",R)}get isEnterHandled(){return!0}center(){let[R,N]=this.pageDimensions;switch(this.parentRotation){case 90:this.x-=this.height*N/(2*R),this.y+=this.width*R/(2*N);break;case 180:this.x+=this.width/2,this.y+=this.height/2;break;case 270:this.x+=this.height*N/(2*R),this.y-=this.width*R/(2*N);break;default:this.x-=this.width/2,this.y-=this.height/2}this.fixAndSetPosition()}addCommands(R){this._uiManager.addCommands(R)}get currentLayer(){return this._uiManager.currentLayer}
222setInBackground(){this.div.style.zIndex=0}setInForeground(){this.div.style.zIndex=a(this,nR)}setParent(R){null!==R?(this.pageIndex=R.pageIndex,this.pageDimensions=R.pageDimensions):A(this,n4,n6).call(this),this.parent=R}focusin(R){this._focusEventsAllowed&&(a(this,nv)?w(this,nv,!1):this.parent.setSelected(this))}focusout(R){var N;if(!this._focusEventsAllowed||!this.isAttachedToDOM)return;let W=R.relatedTarget;null!=W&&W.closest(`#${this.id}`)||(R.preventDefault(),null!=(N=this.parent)&&N.isMultipleSelection||this.commitOrRemove())}commitOrRemove(){this.isEmpty()?this.remove():this.commit()}commit(){this.addToAnnotationStorage()}addToAnnotationStorage(){this._uiManager.addToAnnotationStorage(this)}setAt(R,N,W,j){let[B,z]=this.parentDimensions;[W,j]=this.screenToPageTranslation(W,j),this.x=(R+W)/B,this.y=(N+j)/z,this.fixAndSetPosition()}translate(R,N){A(this,nP,nL).call(this,this.parentDimensions,R,N)}translateInPage(R,N){a(this,ny)||w(this,ny,[this.x,this.y]),A(this,nP,nL).call(this,this.pageDimensions,R,N),this.div.scrollIntoView({block:"nearest"})}drag(R,N){a(this,ny)||w(this,ny,[this.x,this.y]);let[W,j]=this.parentDimensions;if(this.x+=R/W,this.y+=N/j,this.parent&&(this.x<0||this.x>1||this.y<0||this.y>1)){let{x:R,y:N}=this.div.getBoundingClientRect();this.parent.findNewParent(this,R,N)&&(this.x-=Math.floor(this.x),this.y-=Math.floor(this.y))}let{x:B,y:z}=this,[U,V]=this.getBaseTranslation();B+=U,z+=V,this.div.style.left=`${(100*B).toFixed(2)}%`,this.div.style.top=`${(100*z).toFixed(2)}%`,this.div.scrollIntoView({block:"nearest"})}get _hasBeenMoved(){return!!a(this,ny)&&(a(this,ny)[0]!==this.x||a(this,ny)[1]!==this.y)}getBaseTranslation(){let[R,N]=this.parentDimensions,{_borderLineWidth:W}=Nt,j=W/R,B=W/N;switch(this.rotation){case 90:return[-j,B];case 180:return[j,B];case 270:return[j,-B];default:return[-j,-B]}}get _mustFixPosition(){return!0}fixAndSetPosition(R=this.rotation){let[N,W]=this.pageDimensions,{x:j,y:B,width:z,height:U}=this;if(z*=N,U*=W,j*=N,B*=W,this._mustFixPosition)switch(R){case 0:j=Math.max(0,Math.min(N-z,j)),B=Math.max(0,Math.min(W-U,B));break;case 90:j=Math.max(0,Math.min(N-U,j)),B=Math.min(W,Math.max(z,B));break;case 180:j=Math.min(N,Math.max(z,j)),B=Math.min(W,Math.max(U,B));break;case 270:j=Math.min(N,Math.max(U,j)),B=Math.max(0,Math.min(W-z,B))}this.x=j/=N,this.y=B/=W;let[V,G]=this.getBaseTranslation();j+=V,B+=G;let{style:Y}=this.div;Y.left=`${(100*j).toFixed(2)}%`,Y.top=`${(100*B).toFixed(2)}%`,this.moveInDOM()}screenToPageTranslation(R,N){return A(Nt,nI,nD).call(Nt,R,N,this.parentRotation)}pageTranslationToScreen(R,N){return A(Nt,nI,nD).call(Nt,R,N,360-this.parentRotation)}get parentScale(){return this._uiManager.viewParameters.realScale}get parentRotation(){return(this._uiManager.viewParameters.rotation+this.pageRotation)%360}get parentDimensions(){let{parentScale:R,pageDimensions:[N,W]}=this,j=N*R,B=W*R;return Ge.isCSSRoundSupported?[Math.round(j),Math.round(B)]:[j,B]}setDims(R,N){let[W,j]=this.parentDimensions;this.div.style.width=`${(100*R/W).toFixed(2)}%`,a(this,nh)||(this.div.style.height=`${(100*N/j).toFixed(2)}%`)}fixDims(){let{style:R}=this.div,{height:N,width:W}=R,j=W.endsWith("%"),B=!a(this,nh)&&N.endsWith("%");if(j&&B)return;let[z,U]=this.parentDimensions;j||(R.width=`${(100*parseFloat(W)/z).toFixed(2)}%`),a(this,nh)||B||(R.height=`${(100*parseFloat(N)/U).toFixed(2)}%`)}getInitialTranslation(){return[0,0]}altTextFinish(){var R;null==(R=a(this,na))||R.finish()}async addEditToolbar(){return a(this,ng)||a(this,nx)||(w(this,ng,new vg(this)),this.div.append(a(this,ng).render()),a(this,na)&&a(this,ng).addAltTextButton(await a(this,na).render())),a(this,ng)}removeEditToolbar(){var R;a(this,ng)&&(a(this,ng).remove(),w(this,ng,null),null==(R=a(this,na))||R.destroy())}getClientDimensions(){return this.div.getBoundingClientRect()}async addAltTextButton(){a(this,na)||(v_.initialize(Nt._l10nPromise),w(this,na,new v_(this)),await this.addEditToolbar())}get altTextData(){var R;return null==(R=a(this,na))?void 0:R.data}set altTextData(R){a(this,na)&&(a(this,na).data=R)}hasAltText(){var R;return!(null!=(R=a(this,na))&&R.isEmpty())}render(){this.div=document.createElement("div"),this.div.setAttribute("data-editor-rotation",(360-this.rotation)%360),this.div.className=this.name,this.div.setAttribute("id",this.id),this.div.tabIndex=a(this,no)?-1:0,this._isVisible||this.div.classList.add("hidden"),this.setInForeground(),this.div.addEventListener("focusin",a(this,np)),this.div.addEventListener("focusout",a(this,nf));let[R,N]=this.parentDimensions;this.parentRotation%180!=0&&(this.div.style.maxWidth=`${(100*N/R).toFixed(2)}%`,this.div.style.maxHeight=`${(100*R/N).toFixed(2)}%`);let[W,j]=this.getInitialTranslation();return this.translate(W,j),iu(this,this.div,["pointerdown"]),this.div}pointerdown(R){let{isMac:N}=Ge.platform;if(0!==R.button||R.ctrlKey&&N){R.preventDefault();return}if(w(this,nv,!0),this._isDraggable){A(this,nq,nX).call(this,R);return}A(this,nV,nG).call(this,R)}moveInDOM(){a(this,nS)&&clearTimeout(a(this,nS)),w(this,nS,setTimeout(()=>{var R;w(this,nS,null),null==(R=this.parent)||R.moveEditorInDOM(this)},0))}_setParentAndPosition(R,N,W){R.changeParent(this),this.x=N,this.y=W,this.fixAndSetPosition()}getRect(R,N,W=this.rotation){let j=this.parentScale,[B,z]=this.pageDimensions,[U,V]=this.pageTranslation,G=R/j,Y=N/j,Z=this.x*B,te=this.y*z,tn=this.width*B,tr=this.height*z;switch(W){case 0:return[Z+G+U,z-te-Y-tr+V,Z+G+tn+U,z-te-Y+V];case 90:return[Z+Y+U,z-te+G+V,Z+Y+tr+U,z-te+G+tn+V];case 180:return[Z-G-tn+U,z-te+Y+V,Z-G+U,z-te+Y+tr+V];
222case 270:return[Z-Y-tr+U,z-te-G-tn+V,Z-Y+U,z-te-G+V];default:throw Error("Invalid rotation")}}getRectInCurrentCoords(R,N){let[W,j,B,z]=R,U=B-W,V=z-j;switch(this.rotation){case 0:return[W,N-z,U,V];case 90:return[W,N-j,V,U];case 180:return[B,N-j,U,V];case 270:return[B,N-z,V,U];default:throw Error("Invalid rotation")}}onceAdded(){}isEmpty(){return!1}enableEditMode(){w(this,nx,!0)}disableEditMode(){w(this,nx,!1)}isInEditMode(){return a(this,nx)}shouldGetKeyboardEvents(){return a(this,n_)}needsToBeRebuilt(){return this.div&&!this.isAttachedToDOM}rebuild(){var R,N;null==(R=this.div)||R.addEventListener("focusin",a(this,np)),null==(N=this.div)||N.addEventListener("focusout",a(this,nf))}rotate(R){}serialize(R=!1,N=null){Dt("An editor must be serializable")}static deserialize(R,N,W){let j=new this.prototype.constructor({parent:N,id:N.getNextId(),uiManager:W});j.rotation=R.rotation;let[B,z]=j.pageDimensions,[U,V,G,Y]=j.getRectInCurrentCoords(R.rect,z);return j.x=U/B,j.y=V/z,j.width=G/B,j.height=Y/z,j}get hasBeenModified(){return!!this.annotationElementId&&(this.deleted||null!==this.serialize())}remove(){if(this.div.removeEventListener("focusin",a(this,np)),this.div.removeEventListener("focusout",a(this,nf)),this.isEmpty()||this.commit(),this.parent?this.parent.remove(this):this._uiManager.removeEditor(this),a(this,nS)&&(clearTimeout(a(this,nS)),w(this,nS,null)),A(this,n4,n6).call(this),this.removeEditToolbar(),a(this,nM)){for(let R of a(this,nM).values())clearTimeout(R);w(this,nM,null)}this.parent=null}get isResizable(){return!1}makeResizable(){this.isResizable&&(A(this,nF,nW).call(this),a(this,nc).classList.remove("hidden"),iu(this,this.div,["keydown"]))}get toolbarPosition(){return null}keydown(R){if(!this.isResizable||R.target!==this.div||"Enter"!==R.key)return;this._uiManager.setSelected(this),w(this,nu,{savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height});let N=a(this,nc).children;if(!a(this,ns)){w(this,ns,Array.from(N));let R=A(this,nY,nK).bind(this),W=A(this,nQ,nJ).bind(this);for(let N of a(this,ns)){let j=N.getAttribute("data-resizer-name");N.setAttribute("role","spinbutton"),N.addEventListener("keydown",R),N.addEventListener("blur",W),N.addEventListener("focus",A(this,nZ,n1).bind(this,j)),Nt._l10nPromise.get(`pdfjs-editor-resizer-label-${j}`).then(R=>N.setAttribute("aria-label",R))}}let W=a(this,ns)[0],j=0;for(let R of N){if(R===W)break;j++}let B=(360-this.rotation+this.parentRotation)%360/90*(a(this,ns).length/4);if(B!==j){if(B<j)for(let R=0;R<j-B;R++)a(this,nc).append(a(this,nc).firstChild);else if(B>j)for(let R=0;R<B-j;R++)a(this,nc).firstChild.before(a(this,nc).lastChild);let R=0;for(let W of N){let N=a(this,ns)[R++].getAttribute("data-resizer-name");Nt._l10nPromise.get(`pdfjs-editor-resizer-label-${N}`).then(R=>W.setAttribute("aria-label",R))}}A(this,n3,n5).call(this,0),w(this,n_,!0),a(this,nc).firstChild.focus({focusVisible:!0}),R.preventDefault(),R.stopImmediatePropagation()}_resizeWithKeyboard(R,N){a(this,n_)&&A(this,nH,nU).call(this,a(this,nm),{movementX:R,movementY:N})}_stopResizingWithKeyboard(){A(this,n4,n6).call(this),this.div.focus()}select(){var R,N;if(this.makeResizable(),null==(R=this.div)||R.classList.add("selectedEditor"),!a(this,ng)){this.addEditToolbar().then(()=>{var R,N;null!=(R=this.div)&&R.classList.contains("selectedEditor")&&(null==(N=a(this,ng))||N.show())});return}null==(N=a(this,ng))||N.show()}unselect(){var R,N,W,j;null==(R=a(this,nc))||R.classList.add("hidden"),null==(N=this.div)||N.classList.remove("selectedEditor"),null!=(W=this.div)&&W.contains(document.activeElement)&&this._uiManager.currentLayer.div.focus({preventScroll:!0}),null==(j=a(this,ng))||j.hide()}updateParams(R,N){}disableEditing(){}enableEditing(){}enterInEditMode(){}getImageForAltText(){return null}get contentDiv(){return this.div}get isEditing(){return a(this,nA)}set isEditing(R){w(this,nA,R),this.parent&&(R?(this.parent.setSelected(this),this.parent.setActiveEditor(this)):this.parent.setActiveEditor(null))}setAspectRatio(R,N){w(this,nh,!0);let{style:W}=this.div;W.aspectRatio=R/N,W.height="auto"}static get MIN_SIZE(){return 16}static canCreateNewEmptyEditor(){return!0}get telemetryInitialData(){return{action:"added"}}get telemetryFinalData(){return null}_reportTelemetry(R,N=!1){if(N){a(this,nM)||w(this,nM,new Map);let{action:N}=R,W=a(this,nM).get(N);W&&clearTimeout(W),W=setTimeout(()=>{this._reportTelemetry(R),a(this,nM).delete(N),0===a(this,nM).size&&w(this,nM,null)},Nt._telemetryTimeout),a(this,nM).set(N,W);return}R.type||(R.type=this.editorType),this._uiManager._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",data:R}})}show(R=this._isVisible){this.div.classList.toggle("hidden",!R),this._isVisible=R}enable(){this.div&&(this.div.tabIndex=0),w(this,no,!1)}disable(){this.div&&(this.div.tabIndex=-1),w(this,no,!0)}renderAnnotationElement(R){let N=R.container.querySelector(".annotationContent");
222if(N){if("CANVAS"===N.nodeName){let R=N;(N=document.createElement("div")).classList.add("annotationContent",this.editorType),R.before(N)}}else(N=document.createElement("div")).classList.add("annotationContent",this.editorType),R.container.prepend(N);return N}resetAnnotationElement(R){let{firstChild:N}=R.container;"DIV"===N.nodeName&&N.classList.contains("annotationContent")&&N.remove()}};ns=new WeakMap,na=new WeakMap,no=new WeakMap,nh=new WeakMap,nc=new WeakMap,nu=new WeakMap,np=new WeakMap,nf=new WeakMap,ng=new WeakMap,nm=new WeakMap,nv=new WeakMap,ny=new WeakMap,nA=new WeakMap,nx=new WeakMap,n_=new WeakMap,nS=new WeakMap,nk=new WeakMap,nC=new WeakMap,nM=new WeakMap,nT=new WeakMap,nR=new WeakMap,nP=new WeakSet,nL=function([R,N],W,j){[W,j]=this.screenToPageTranslation(W,j),this.x+=W/R,this.y+=j/N,this.fixAndSetPosition()},nI=new WeakSet,nD=function(R,N,W){switch(W){case 90:return[N,-R];case 180:return[-R,-N];case 270:return[-N,R];default:return[R,N]}},nN=new WeakSet,nO=function(R){switch(R){case 90:{let[R,N]=this.pageDimensions;return[0,-R/N,N/R,0]}case 180:return[-1,0,0,-1];case 270:{let[R,N]=this.pageDimensions;return[0,R/N,-N/R,0]}default:return[1,0,0,1]}},nF=new WeakSet,nW=function(){if(a(this,nc))return;w(this,nc,document.createElement("div")),a(this,nc).classList.add("resizers");let R=this._willKeepAspectRatio?["topLeft","topRight","bottomRight","bottomLeft"]:["topLeft","topMiddle","topRight","middleRight","bottomRight","bottomMiddle","bottomLeft","middleLeft"];for(let N of R){let R=document.createElement("div");a(this,nc).append(R),R.classList.add("resizer",N),R.setAttribute("data-resizer-name",N),R.addEventListener("pointerdown",A(this,nj,nB).bind(this,N)),R.addEventListener("contextmenu",Ve),R.tabIndex=-1}this.div.prepend(a(this,nc))},nj=new WeakSet,nB=function(R,N){var W;N.preventDefault();let{isMac:j}=Ge.platform;if(0!==N.button||N.ctrlKey&&j)return;null==(W=a(this,na))||W.toggle(!1);let B=A(this,nH,nU).bind(this,R),z=this._isDraggable;this._isDraggable=!1;let U={passive:!0,capture:!0};this.parent.togglePointerEvents(!1),window.addEventListener("pointermove",B,U),window.addEventListener("contextmenu",Ve);let V=this.x,G=this.y,Y=this.width,Z=this.height,te=this.parent.div.style.cursor,tn=this.div.style.cursor;this.div.style.cursor=this.parent.div.style.cursor=window.getComputedStyle(N.target).cursor;let v=()=>{var R;this.parent.togglePointerEvents(!0),null==(R=a(this,na))||R.toggle(!0),this._isDraggable=z,window.removeEventListener("pointerup",v),window.removeEventListener("blur",v),window.removeEventListener("pointermove",B,U),window.removeEventListener("contextmenu",Ve),this.parent.div.style.cursor=te,this.div.style.cursor=tn,A(this,n$,nz).call(this,V,G,Y,Z)};window.addEventListener("pointerup",v),window.addEventListener("blur",v)},n$=new WeakSet,nz=function(R,N,W,j){let B=this.x,z=this.y,U=this.width,V=this.height;B===R&&z===N&&U===W&&V===j||this.addCommands({cmd:()=>{this.width=U,this.height=V,this.x=B,this.y=z;let[R,N]=this.parentDimensions;this.setDims(R*U,N*V),this.fixAndSetPosition()},undo:()=>{this.width=W,this.height=j,this.x=R,this.y=N;let[B,z]=this.parentDimensions;this.setDims(B*W,z*j),this.fixAndSetPosition()},mustExec:!0})},nH=new WeakSet,nU=function(R,N){var W,j;let[B,z]=this.parentDimensions,U=this.x,V=this.y,G=this.width,Y=this.height,Z=vS.MIN_SIZE/B,te=vS.MIN_SIZE/z,f=R=>Math.round(1e4*R)/1e4,tn=A(this,nN,nO).call(this,this.rotation),v=(R,N)=>[tn[0]*R+tn[2]*N,tn[1]*R+tn[3]*N],tr=A(this,nN,nO).call(this,360-this.rotation),ts,ta,th=!1,tc=!1;switch(R){case"topLeft":th=!0,ts=(R,N)=>[0,0],ta=(R,N)=>[R,N];break;case"topMiddle":ts=(R,N)=>[R/2,0],ta=(R,N)=>[R/2,N];break;case"topRight":th=!0,ts=(R,N)=>[R,0],ta=(R,N)=>[0,N];break;case"middleRight":tc=!0,ts=(R,N)=>[R,N/2],ta=(R,N)=>[0,N/2];break;case"bottomRight":th=!0,ts=(R,N)=>[R,N],ta=(R,N)=>[0,0];break;case"bottomMiddle":ts=(R,N)=>[R/2,N],ta=(R,N)=>[R/2,0];break;case"bottomLeft":th=!0,ts=(R,N)=>[0,N],ta=(R,N)=>[R,0];break;case"middleLeft":tc=!0,ts=(R,N)=>[0,N/2],ta=(R,N)=>[R,N/2]}let tu=ts(G,Y),tp=ta(G,Y),tf=v(...tp),tg=f(U+tf[0]),tm=f(V+tf[1]),tw=1,ty=1,[tA,tx]=this.screenToPageTranslation(N.movementX,N.movementY);if([tA,tx]=(W=tA/B,j=tx/z,[tr[0]*W+tr[2]*j,tr[1]*W+tr[3]*j]),th){let R=Math.hypot(G,Y);tw=ty=Math.max(Math.min(Math.hypot(tp[0]-tu[0]-tA,tp[1]-tu[1]-tx)/R,1/G,1/Y),Z/G,te/Y)}else tc?tw=Math.max(Z,Math.min(1,Math.abs(tp[0]-tu[0]-tA)))/G:ty=Math.max(te,Math.min(1,Math.abs(tp[1]-tu[1]-tx)))/Y;let t_=f(G*tw),tS=f(Y*ty);tf=v(...ta(t_,tS));let tE=tg-tf[0],tk=tm-tf[1];this.width=t_,this.height=tS,this.x=tE,this.y=tk,this.setDims(B*t_,z*tS),this.fixAndSetPosition()},nV=new WeakSet,nG=function(R){let{isMac:N}=Ge.platform;R.ctrlKey&&!N||R.shiftKey||R.metaKey&&N?this.parent.toggleSelected(this):this.parent.setSelected(this)},nq=new WeakSet,nX=function(R){let N,W;let j=this._uiManager.isSelected(this);this._uiManager.setUpDragSession(),j&&(this.div.classList.add("moving"),N={passive:!0,capture:!0},w(this,nk,R.clientX),w(this,nC,R.clientY),W=R=>{let{clientX:N,clientY:W}=R,[j,B]=this.screenToPageTranslation(N-a(this,nk),W-a(this,nC));w(this,nk,N),w(this,nC,W),this._uiManager.dragSelectedEditors(j,B)},window.addEventListener("pointermove",W,N));let s=()=>{window.removeEventListener("pointerup",s),window.removeEventListener("blur",s),j&&(this.div.classList.remove("moving"),window.removeEventListener("pointermove",W,N)),w(this,nv,!1),this._uiManager.endDragSession()||A(this,nV,nG).call(this,R)};window.addEventListener("pointerup",s),window.addEventListener("blur",s)},nY=new WeakSet,nK=function(R){vS._resizerKeyboardManager.exec(this,R)},nQ=new WeakSet,nJ=function(R){var N;a(this,n_)&&(null==(N=R.relatedTarget)?void 0:N.parentNode)!==a(this,nc)&&A(this,n4,n6).call(this)},nZ=new WeakSet,n1=function(R){w(this,nm,a(this,n_)?R:"")},n3=new WeakSet,n5=function(R){if(a(this,ns))for(let N of a(this,ns))N.tabIndex=R},n4=new WeakSet,n6=function(){if(w(this,n_,!1),A(this,n3,n5).call(this,-1),a(this,nu)){let{savedX:R,savedY:N,savedWidth:W,savedHeight:j}=a(this,nu);A(this,n$,nz).call(this,R,N,W,j),w(this,nu,null)}},m(vS,nI),dt(vS,"_borderLineWidth",-1),dt(vS,"_colorManager",new vw),dt(vS,"_zIndex",1),dt(vS,"_telemetryTimeout",1e3);let vE=vS;let KR=class KR extends vE{constructor(R){super(R),this.annotationElementId=R.annotationElementId,this.deleted=!0}
222serialize(){return{id:this.annotationElementId,deleted:!0,pageIndex:this.pageIndex}}};let Kb=class Kb{constructor(R){this.h1=R?4294967295&R:3285377520,this.h2=R?4294967295&R:3285377520}update(R){let N,W;if("string"==typeof R){N=new Uint8Array(2*R.length),W=0;for(let j=0,B=R.length;j<B;j++){let B=R.charCodeAt(j);B<=255?N[W++]=B:(N[W++]=B>>>8,N[W++]=255&B)}}else if(ArrayBuffer.isView(R))W=(N=R.slice()).byteLength;else throw Error("Invalid data format, must be a string or TypedArray.");let j=W>>2,B=W-4*j,z=new Uint32Array(N.buffer,0,j),U=0,V=0,G=this.h1,Y=this.h2;for(let R=0;R<j;R++)1&R?(G^=U=461845907*(U=(U=3432918353*(U=z[R])&4294901760|11601*U&65535)<<15|U>>>17)&4294901760|13715*U&65535,G=5*(G=G<<13|G>>>19)+3864292196):(Y^=V=461845907*(V=(V=3432918353*(V=z[R])&4294901760|11601*V&65535)<<15|V>>>17)&4294901760|13715*V&65535,Y=5*(Y=Y<<13|Y>>>19)+3864292196);switch(U=0,B){case 3:U^=N[4*j+2]<<16;case 2:U^=N[4*j+1]<<8;case 1:U^=N[4*j],U=461845907*(U=(U=3432918353*U&4294901760|11601*U&65535)<<15|U>>>17)&4294901760|13715*U&65535,1&j?G^=U:Y^=U}this.h1=G,this.h2=Y}hexdigest(){let R=this.h1,N=this.h2;return R^=N>>>1,N=4283543511*N&4294901760|((N<<16|(R=3981806797*R&4294901760|36045*R&65535)>>>16)*2950163797&4294901760)>>>16,R^=N>>>1,N=3301882366*N&4294901760|((N<<16|(R=444984403*R&4294901760|60499*R&65535)>>>16)*3120437893&4294901760)>>>16,((R^=N>>>1)>>>0).toString(16).padStart(8,"0")+(N>>>0).toString(16).padStart(8,"0")}};let vC=Object.freeze({map:null,hash:"",transfer:void 0});let v0=class v0{constructor(){m(this,n9),m(this,n8,!1),m(this,n7,new Map),this.onSetModified=null,this.onResetModified=null,this.onAnnotationEditor=null}getValue(R,N){let W=a(this,n7).get(R);return void 0===W?N:Object.assign(N,W)}getRawValue(R){return a(this,n7).get(R)}remove(R){if(a(this,n7).delete(R),0===a(this,n7).size&&this.resetModified(),"function"==typeof this.onAnnotationEditor){for(let R of a(this,n7).values())if(R instanceof vE)return;this.onAnnotationEditor(null)}}setValue(R,N){let W=a(this,n7).get(R),j=!1;if(void 0!==W)for(let[R,B]of Object.entries(N))W[R]!==B&&(j=!0,W[R]=B);else j=!0,a(this,n7).set(R,N);j&&A(this,n9,rt).call(this),N instanceof vE&&"function"==typeof this.onAnnotationEditor&&this.onAnnotationEditor(N.constructor._type)}has(R){return a(this,n7).has(R)}getAll(){return a(this,n7).size>0?h0(a(this,n7)):null}setAll(R){for(let[N,W]of Object.entries(R))this.setValue(N,W)}get size(){return a(this,n7).size}resetModified(){a(this,n8)&&(w(this,n8,!1),"function"==typeof this.onResetModified&&this.onResetModified())}get print(){return new Jb(this)}get serializable(){if(0===a(this,n7).size)return vC;let R=new Map,N=new Kb,W=[],j=Object.create(null),B=!1;for(let[W,z]of a(this,n7)){let U=z instanceof vE?z.serialize(!1,j):z;U&&(R.set(W,U),N.update(`${W}:${JSON.stringify(U)}`),B||(B=!!U.bitmap))}if(B)for(let N of R.values())N.bitmap&&W.push(N.bitmap);return R.size>0?{map:R,hash:N.hexdigest(),transfer:W}:vC}get editorStats(){let R=null,N=new Map;for(let W of a(this,n7).values()){if(!(W instanceof vE))continue;let j=W.telemetryFinalData;if(!j)continue;let{type:B}=j;N.has(B)||N.set(B,Object.getPrototypeOf(W).constructor),R||(R=Object.create(null));let z=R[B]||(R[B]=new Map);for(let[R,N]of Object.entries(j)){if("type"===R)continue;let W=z.get(R);W||(W=new Map,z.set(R,W));let j=W.get(N)??0;W.set(N,j+1)}}for(let[W,j]of N)R[W]=j.computeTelemetryFinalData(R[W]);return R}};n8=new WeakMap,n7=new WeakMap,n9=new WeakSet,rt=function(){a(this,n8)||(w(this,n8,!0),"function"==typeof this.onSetModified&&this.onSetModified())};let Jb=class Jb extends v0{constructor(R){super(),m(this,re,void 0);let{map:N,hash:W,transfer:j}=R.serializable,B=structuredClone(N,j?{transfer:j}:null);w(this,re,{map:B,hash:W,transfer:j})}get print(){Dt("Should not call PrintAnnotationStorage.print")}get serializable(){return a(this,re)}};re=new WeakMap;let ZR=class ZR{constructor({ownerDocument:R=globalThis.document,styleElement:N=null}){m(this,ri,new Set),this._document=R,this.nativeFontFaces=new Set,this.styleElement=null,this.loadingRequests=[],this.loadTestFontId=0}addNativeFontFace(R){this.nativeFontFaces.add(R),this._document.fonts.add(R)}removeNativeFontFace(R){this.nativeFontFaces.delete(R),this._document.fonts.delete(R)}insertRule(R){this.styleElement||(this.styleElement=this._document.createElement("style"),this._document.documentElement.getElementsByTagName("head")[0].append(this.styleElement));let N=this.styleElement.sheet;N.insertRule(R,N.cssRules.length)}clear(){for(let R of this.nativeFontFaces)this._document.fonts.delete(R);this.nativeFontFaces.clear(),a(this,ri).clear(),this.styleElement&&(this.styleElement.remove(),this.styleElement=null)}async loadSystemFont({systemFontInfo:R,_inspectFont:N}
222){if(!(!R||a(this,ri).has(R.loadedName))){if(ae(!this.disableFontFace,"loadSystemFont shouldn't be called when `disableFontFace` is set."),this.isFontLoadingAPISupported){let{loadedName:W,src:j,style:B}=R,z=new FontFace(W,j,B);this.addNativeFontFace(z);try{await z.load(),a(this,ri).add(W),null==N||N(R)}catch{vt(`Cannot load system font: ${R.baseFontName}, installing it could help to improve PDF rendering.`),this.removeNativeFontFace(z)}return}Dt("Not implemented: loadSystemFont without the Font Loading API.")}}async bind(R){if(R.attached||R.missingFile&&!R.systemFontInfo)return;if(R.attached=!0,R.systemFontInfo){await this.loadSystemFont(R);return}if(this.isFontLoadingAPISupported){let N=R.createNativeFontFace();if(N){this.addNativeFontFace(N);try{await N.loaded}catch(W){throw vt(`Failed to load font '${N.family}': '${W}'.`),R.disableFontFace=!0,W}}return}let N=R.createFontFaceRule();if(N){if(this.insertRule(N),this.isSyncFontLoadingSupported)return;await new Promise(N=>{let W=this._queueLoadingCallback(N);this._prepareFontLoadEvent(R,W)})}}get isFontLoadingAPISupported(){var R;let N=!!(null!=(R=this._document)&&R.fonts);return Tt(this,"isFontLoadingAPISupported",N)}get isSyncFontLoadingSupported(){let R=!1;return(mX||"u">typeof navigator&&"string"==typeof(null==navigator?void 0:navigator.userAgent)&&/Mozilla\/5.0.*?rv:\d+.*? Gecko/.test(navigator.userAgent))&&(R=!0),Tt(this,"isSyncFontLoadingSupported",R)}_queueLoadingCallback(R){let{loadingRequests:N}=this,W={done:!1,complete:function(){for(ae(!W.done,"completeRequest() cannot be called twice."),W.done=!0;N.length>0&&N[0].done;){let R=N.shift();setTimeout(R.callback,0)}},callback:R};return N.push(W),W}get _loadTestFont(){let R=atob("T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACMAooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4DIP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAAAAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUAAQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgABAAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABYAAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAAAC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAAAAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQACAQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTjFQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA==");return Tt(this,"_loadTestFont",R)}_prepareFontLoadEvent(R,N){var W;let j,B;function n(R,N){return R.charCodeAt(N)<<24|R.charCodeAt(N+1)<<16|R.charCodeAt(N+2)<<8|255&R.charCodeAt(N+3)}function i(R,N,W,j){let B=R.substring(0,N),z=R.substring(N+W);return B+j+z}let z=this._document.createElement("canvas");z.width=1,z.height=1;let U=z.getContext("2d"),V=0,G=`lt${Date.now()}${this.loadTestFontId++}`,Y=this._loadTestFont,Z=n(Y=i(Y,976,G.length,G),16);for(j=0,B=G.length-3;j<B;j+=4)Z=Z-1482184792+n(G,j)|0;j<G.length&&(Z=Z-1482184792+n(G+"XXX",j)|0),Y=i(Y,16,4,String.fromCharCode((W=Z)>>24&255,W>>16&255,W>>8&255,255&W));let te=`url(data:font/opentype;base64,${btoa(Y)});`,tn=`@font-face {font-family:"${G}";src:${te}}`;this.insertRule(tn);let tr=this._document.createElement("div");for(let N of(tr.style.visibility="hidden",tr.style.width=tr.style.height="10px",tr.style.position="absolute",tr.style.top=tr.style.left="0px",[R.loadedName,G])){let R=this._document.createElement("span");R.textContent="Hi",R.style.fontFamily=N,tr.append(R)}
222this._document.body.append(tr),function h(R,N){if(++V>30){vt("Load test font never loaded."),N();return}if(U.font="30px "+R,U.fillText(".",0,20),U.getImageData(0,0,1,1).data[3]>0){N();return}setTimeout(h.bind(null,R,N))}(G,()=>{tr.remove(),N.complete()})}};ri=new WeakMap;let JR=class JR{constructor(R,{disableFontFace:N=!1,inspectFont:W=null}){for(let N in this.compiledGlyphs=Object.create(null),R)this[N]=R[N];this.disableFontFace=!0===N,this._inspectFont=W}createNativeFontFace(){var R;let N;if(!this.data||this.disableFontFace)return null;if(this.cssFontInfo){let R={weight:this.cssFontInfo.fontWeight};this.cssFontInfo.italicAngle&&(R.style=`oblique ${this.cssFontInfo.italicAngle}deg`),N=new FontFace(this.cssFontInfo.fontFamily,this.data,R)}else N=new FontFace(this.loadedName,this.data,{});return null==(R=this._inspectFont)||R.call(this,this),N}createFontFaceRule(){var R;let N;if(!this.data||this.disableFontFace)return null;let W=Ab(this.data),j=`url(data:${this.mimetype};base64,${btoa(W)});`;if(this.cssFontInfo){let R=`font-weight: ${this.cssFontInfo.fontWeight};`;this.cssFontInfo.italicAngle&&(R+=`font-style: oblique ${this.cssFontInfo.italicAngle}deg;`),N=`@font-face {font-family:"${this.cssFontInfo.fontFamily}";${R}src:${j}}`}else N=`@font-face {font-family:"${this.loadedName}";src:${j}}`;return null==(R=this._inspectFont)||R.call(this,this,j),N}getPathGenerator(R,N){let W;if(void 0!==this.compiledGlyphs[N])return this.compiledGlyphs[N];try{W=R.get(this.loadedName+"_path_"+N)}catch(R){vt(`getPathGenerator - ignoring character: "${R}".`)}if(!Array.isArray(W)||0===W.length)return this.compiledGlyphs[N]=function(R,N){};let j=[];for(let R=0,N=W.length;R<N;)switch(W[R++]){case vh.BEZIER_CURVE_TO:{let[N,B,z,U,V,G]=W.slice(R,R+6);j.push(R=>R.bezierCurveTo(N,B,z,U,V,G)),R+=6}break;case vh.MOVE_TO:{let[N,B]=W.slice(R,R+2);j.push(R=>R.moveTo(N,B)),R+=2}break;case vh.LINE_TO:{let[N,B]=W.slice(R,R+2);j.push(R=>R.lineTo(N,B)),R+=2}break;case vh.QUADRATIC_CURVE_TO:{let[N,B,z,U]=W.slice(R,R+4);j.push(R=>R.quadraticCurveTo(N,B,z,U)),R+=4}break;case vh.RESTORE:j.push(R=>R.restore());break;case vh.SAVE:j.push(R=>R.save());break;case vh.SCALE:ae(2===j.length,"Scale command is only valid at the third position.");break;case vh.TRANSFORM:{let[N,B,z,U,V,G]=W.slice(R,R+6);j.push(R=>R.transform(N,B,z,U,V,G)),R+=6}break;case vh.TRANSLATE:{let[N,B]=W.slice(R,R+2);j.push(R=>R.translate(N,B)),R+=2}}return this.compiledGlyphs[N]=function(R,N){j[0](R),j[1](R),R.scale(N,-N);for(let N=2,W=j.length;N<W;N++)j[N](R)}}};if(mX){var vM=Promise.withResolvers(),vT=null;(async()=>{let R,N;let W=await import("./empty-GlqisfcO.js"),j=await import("./index-B0Gk_P0t.js").then(R=>R.i),B=await import("./index-rMqNZYyA.js").then(R=>R.i),z=await import("./url-Bs332b_7.js").then(R=>R.u);return new Map(Object.entries({fs:W,http:j,https:B,url:z,canvas:R,path2d:N}))})().then(R=>{vT=R,vM.resolve()},R=>{vt(`loadPackages: ${R}`),vT=new Map,vM.resolve()})}let ni=class ni{static get promise(){return vM.promise}static get(R){return null==vT?void 0:vT.get(R)}};let Qb=function(R){return ni.get("fs").promises.readFile(R).then(R=>new Uint8Array(R))},vR={FILL:"Fill",STROKE:"Stroke",SHADING:"Shading"};function Zg(R,N){if(!N)return;let W=N[2]-N[0],j=N[3]-N[1],B=new Path2D;B.rect(N[0],N[1],W,j),R.clip(B)}let td=class td{constructor(){this.constructor===td&&Dt("Cannot initialize BaseShadingPattern.")}getPattern(){Dt("Abstract method `getPattern` called.")}};let ik=class ik extends td{constructor(R){super(),this._type=R[1],this._bbox=R[2],this._colorStops=R[3],this._p0=R[4],this._p1=R[5],this._r0=R[6],this._r1=R[7],this.matrix=null}_createGradient(R){let N;for(let W of("axial"===this._type?N=R.createLinearGradient(this._p0[0],this._p0[1],this._p1[0],this._p1[1]):"radial"===this._type&&(N=R.createRadialGradient(this._p0[0],this._p0[1],this._r0,this._p1[0],this._p1[1],this._r1)),this._colorStops))N.addColorStop(W[0],W[1]);return N}getPattern(R,N,W,j){let B;if(j===vR.STROKE||j===vR.FILL){let z=N.current.getClippedPathBoundingBox(j,Gt(R))||[0,0,0,0],U=Math.ceil(z[2]-z[0])||1,V=Math.ceil(z[3]-z[1])||1,G=N.cachedCanvases.getCanvas("pattern",U,V,!0),Y=G.context;Y.clearRect(0,0,Y.canvas.width,Y.canvas.height),Y.beginPath(),Y.rect(0,0,Y.canvas.width,Y.canvas.height),Y.translate(-z[0],-z[1]),W=Q.transform(W,[1,0,0,1,z[0],z[1]]),Y.transform(...N.baseTransform),this.matrix&&Y.transform(...this.matrix
222),Zg(Y,this._bbox),Y.fillStyle=this._createGradient(Y),Y.fill(),B=R.createPattern(G.canvas,"no-repeat");let Z=new DOMMatrix(W);B.setTransform(Z)}else Zg(R,this._bbox),B=this._createGradient(R);return B}};function Zp(R,N,W,j,B,z,U,V){let G,Y,Z,te,tn,tr,ts,ta,th;let tc=N.coords,tu=N.colors,tp=R.data,tf=4*R.width;tc[W+1]>tc[j+1]&&(G=W,W=j,j=G,G=z,z=U,U=G),tc[j+1]>tc[B+1]&&(G=j,j=B,B=G,G=U,U=V,V=G),tc[W+1]>tc[j+1]&&(G=W,W=j,j=G,G=z,z=U,U=G);let tg=(tc[W]+N.offsetX)*N.scaleX,tm=(tc[W+1]+N.offsetY)*N.scaleY,tw=(tc[j]+N.offsetX)*N.scaleX,ty=(tc[j+1]+N.offsetY)*N.scaleY,tA=(tc[B]+N.offsetX)*N.scaleX,tx=(tc[B+1]+N.offsetY)*N.scaleY;if(tm>=tx)return;let t_=tu[z],tS=tu[z+1],tE=tu[z+2],tk=tu[U],tC=tu[U+1],tM=tu[U+2],tT=tu[V],tR=tu[V+1],tP=tu[V+2],tI=Math.round(tm),tD=Math.round(tx);for(let R=tI;R<=tD;R++){let N;if(R<ty){let N=R<tm?0:(tm-R)/(tm-ty);Y=tg-(tg-tw)*N,Z=t_-(t_-tk)*N,te=tS-(tS-tC)*N,tn=tE-(tE-tM)*N}else{let N;Y=tw-(tw-tA)*(N=R>tx?1:ty===tx?0:(ty-R)/(ty-tx)),Z=tk-(tk-tT)*N,te=tC-(tC-tR)*N,tn=tM-(tM-tP)*N}tr=tg-(tg-tA)*(N=R<tm?0:R>tx?1:(tm-R)/(tm-tx)),ts=t_-(t_-tT)*N,ta=tS-(tS-tR)*N,th=tE-(tE-tP)*N;let W=Math.round(Math.min(Y,tr)),j=Math.round(Math.max(Y,tr)),B=tf*R+4*W;for(let R=W;R<=j;R++)(N=(Y-R)/(Y-tr))<0?N=0:N>1&&(N=1),tp[B++]=Z-(Z-ts)*N|0,tp[B++]=te-(te-ta)*N|0,tp[B++]=tn-(tn-th)*N|0,tp[B++]=255}}let sk=class sk extends td{constructor(R){super(),this._coords=R[2],this._colors=R[3],this._figures=R[4],this._bounds=R[5],this._bbox=R[7],this._background=R[8],this.matrix=null}_createMeshCanvas(R,N,W){let j=Math.floor(this._bounds[0]),B=Math.floor(this._bounds[1]),z=Math.ceil(this._bounds[2])-j,U=Math.ceil(this._bounds[3])-B,V=Math.min(Math.ceil(Math.abs(z*R[0]*1.1)),3e3),G=Math.min(Math.ceil(Math.abs(U*R[1]*1.1)),3e3),Y=z/V,Z=U/G,te={coords:this._coords,colors:this._colors,offsetX:-j,offsetY:-B,scaleX:1/Y,scaleY:1/Z},tn=V+4,tr=G+4,ts=W.getCanvas("mesh",tn,tr,!1),ta=ts.context,th=ta.createImageData(V,G);if(N){let R=th.data;for(let W=0,j=R.length;W<j;W+=4)R[W]=N[0],R[W+1]=N[1],R[W+2]=N[2],R[W+3]=255}for(let R of this._figures)!function(R,N,W){let j,B;let z=N.coords,U=N.colors;switch(N.type){case"lattice":let V=N.verticesPerRow,G=Math.floor(z.length/V)-1,Y=V-1;for(j=0;j<G;j++){let N=j*V;for(let j=0;j<Y;j++,N++)Zp(R,W,z[N],z[N+1],z[N+V],U[N],U[N+1],U[N+V]),Zp(R,W,z[N+V+1],z[N+1],z[N+V],U[N+V+1],U[N+1],U[N+V])}break;case"triangles":for(j=0,B=z.length;j<B;j+=3)Zp(R,W,z[j],z[j+1],z[j+2],U[j],U[j+1],U[j+2]);break;default:throw Error("illegal figure")}}(th,R,te);return ta.putImageData(th,2,2),{canvas:ts.canvas,offsetX:j-2*Y,offsetY:B-2*Z,scaleX:Y,scaleY:Z}}getPattern(R,N,W,j){let B;if(Zg(R,this._bbox),j===vR.SHADING)B=Q.singularValueDecompose2dScale(Gt(R));else if(B=Q.singularValueDecompose2dScale(N.baseTransform),this.matrix){let R=Q.singularValueDecompose2dScale(this.matrix);B=[B[0]*R[0],B[1]*R[1]]}let z=this._createMeshCanvas(B,j===vR.SHADING?null:this._background,N.cachedCanvases);return j!==vR.SHADING&&(R.setTransform(...N.baseTransform),this.matrix&&R.transform(...this.matrix)),R.translate(z.offsetX,z.offsetY),R.scale(z.scaleX,z.scaleY),R.createPattern(z.canvas,"no-repeat")}};let ok=class ok extends td{getPattern(){return"hotpink"}};let vP={COLORED:1,UNCOLORED:2},vI=class ju{constructor(R,N,W,j,B){this.operatorList=R[2],this.matrix=R[3],this.bbox=R[4],this.xstep=R[5],this.ystep=R[6],this.paintType=R[7],this.tilingType=R[8],this.color=N,this.ctx=W,this.canvasGraphicsFactory=j,this.baseTransform=B}createPatternCanvas(R){let N=this.operatorList,W=this.bbox,j=this.xstep,B=this.ystep,z=this.paintType,U=this.tilingType,V=this.color,G=this.canvasGraphicsFactory;cp("TilingType: "+U);let Y=W[0],Z=W[1],te=W[2],tn=W[3],tr=Q.singularValueDecompose2dScale(this.matrix),ts=Q.singularValueDecompose2dScale(this.baseTransform),ta=[tr[0]*ts[0],tr[1]*ts[1]],th=this.getSizeAndScale(j,this.ctx.canvas.width,ta[0]),tc=this.getSizeAndScale(B,this.ctx.canvas.height,ta[1]),tu=R.cachedCanvases.getCanvas("pattern",th.size,tc.size,!0),tp=tu.context,tf=G.createCanvasGraphics(tp);tf.groupLevel=R.groupLevel,this.setFillAndStrokeStyleToContext(tf,z,V);let tg=Y,tm=Z,tw=te,ty=tn;return Y<0&&(tg=0,tw+=Math.abs(Y)),Z<0&&(tm=0,ty+=Math.abs(Z)),tp.translate(-(th.scale*tg),-(tc.scale*tm)),tf.transform(th.scale,0,0,tc.scale,0,0),tp.save(),this.clipBbox(tf,tg,tm,tw,ty),tf.baseTransform=Gt(tf.ctx),tf.executeOperatorList(N),tf.endDrawing(),{canvas:tu.canvas,scaleX:th.scale,scaleY:tc.scale,offsetX:tg,offsetY:tm}}getSizeAndScale(R,N,W){R=Math.abs(R);let j=Math.max(ju.MAX_PATTERN_SIZE,N),B=Math.ceil(R*W);return B>=j?B=j:W=B/R,{scale:W,size:B}}clipBbox(R,N,W,j,B){let z=j-N,U=B-W;R.ctx.rect(N,W,z,U),R.current.updateRectMinMax(Gt(R.ctx),[N,W,j,B]),R.clip(),R.endPath()}setFillAndStrokeStyleToContext(R,N,W){let j=R.ctx,B=R.current;switch(N){case vP.COLORED:let z=this.ctx;j.fillStyle=z.fillStyle,j.strokeStyle=z.strokeStyle,B.fillColor=z.fillStyle,B.strokeColor=z.strokeStyle;break;case vP.UNCOLORED:let U=Q.makeHexColor(W[0],W[1],W[2]);j.fillStyle=U,j.strokeStyle=U,B.fillColor=U,B.strokeColor=U;break;default:throw new FR(`Unsupported paint type: ${N}`)}}getPattern(R,N,W,j){let B=W;j!==vR.SHADING&&(B=Q.transform(B,N.baseTransform),this.matrix&&(B=
222Q.transform(B,this.matrix)));let z=this.createPatternCanvas(N),U=new DOMMatrix(B);U=(U=U.translate(z.offsetX,z.offsetY)).scale(1/z.scaleX,1/z.scaleY);let V=R.createPattern(z.canvas,"repeat");return V.setTransform(U),V}};dt(vI,"MAX_PATTERN_SIZE",3e3);let dk=class dk{constructor(R){this.canvasFactory=R,this.cache=Object.create(null)}getCanvas(R,N,W){let j;return void 0!==this.cache[R]?(j=this.cache[R],this.canvasFactory.reset(j,N,W)):(j=this.canvasFactory.create(N,W),this.cache[R]=j),j}delete(R){delete this.cache[R]}clear(){for(let R in this.cache){let N=this.cache[R];this.canvasFactory.destroy(N),delete this.cache[R]}}};function dd(R,N,W,j,B,z,U,V,G,Y){let[Z,te,tn,tr,ts,ta]=Gt(R);if(0===te&&0===tn){let th=U*Z+ts,tc=Math.round(th),tu=V*tr+ta,tp=Math.round(tu),tf=(U+G)*Z+ts,tg=Math.abs(Math.round(tf)-tc)||1,tm=(V+Y)*tr+ta,tw=Math.abs(Math.round(tm)-tp)||1;return R.setTransform(Math.sign(Z),0,0,Math.sign(tr),tc,tp),R.drawImage(N,W,j,B,z,0,0,tg,tw),R.setTransform(Z,te,tn,tr,ts,ta),[tg,tw]}if(0===Z&&0===tr){let th=V*tn+ts,tc=Math.round(th),tu=U*te+ta,tp=Math.round(tu),tf=(V+Y)*tn+ts,tg=Math.abs(Math.round(tf)-tc)||1,tm=(U+G)*te+ta,tw=Math.abs(Math.round(tm)-tp)||1;return R.setTransform(0,Math.sign(te),Math.sign(tn),0,tc,tp),R.drawImage(N,W,j,B,z,0,0,tw,tg),R.setTransform(Z,te,tn,tr,ts,ta),[tw,tg]}R.drawImage(N,W,j,B,z,U,V,G,Y);let th=Math.hypot(Z,te),tc=Math.hypot(tn,tr);return[th*G,tc*Y]}let Tv=class Tv{constructor(R,N){this.alphaIsShape=!1,this.fontSize=0,this.fontSizeScale=1,this.textMatrix=mY,this.textMatrixScale=1,this.fontMatrix=mK,this.leading=0,this.x=0,this.y=0,this.lineX=0,this.lineY=0,this.charSpacing=0,this.wordSpacing=0,this.textHScale=1,this.textRenderingMode=m5.FILL,this.textRise=0,this.fillColor="#000000",this.strokeColor="#000000",this.patternFill=!1,this.fillAlpha=1,this.strokeAlpha=1,this.lineWidth=1,this.activeSMask=null,this.transferMaps="none",this.startNewPathAndClipBox([0,0,R,N])}clone(){let R=Object.create(this);return R.clipBox=this.clipBox.slice(),R}setCurrentPoint(R,N){this.x=R,this.y=N}updatePathMinMax(R,N,W){[N,W]=Q.applyTransform([N,W],R),this.minX=Math.min(this.minX,N),this.minY=Math.min(this.minY,W),this.maxX=Math.max(this.maxX,N),this.maxY=Math.max(this.maxY,W)}updateRectMinMax(R,N){let W=Q.applyTransform(N,R),j=Q.applyTransform(N.slice(2),R),B=Q.applyTransform([N[0],N[3]],R),z=Q.applyTransform([N[2],N[1]],R);this.minX=Math.min(this.minX,W[0],j[0],B[0],z[0]),this.minY=Math.min(this.minY,W[1],j[1],B[1],z[1]),this.maxX=Math.max(this.maxX,W[0],j[0],B[0],z[0]),this.maxY=Math.max(this.maxY,W[1],j[1],B[1],z[1])}updateScalingPathMinMax(R,N){Q.scaleMinMax(R,N),this.minX=Math.min(this.minX,N[0]),this.minY=Math.min(this.minY,N[1]),this.maxX=Math.max(this.maxX,N[2]),this.maxY=Math.max(this.maxY,N[3])}updateCurvePathMinMax(R,N,W,j,B,z,U,V,G,Y){let Z=Q.bezierBoundingBox(N,W,j,B,z,U,V,G,Y);Y||this.updateRectMinMax(R,Z)}getPathBoundingBox(R=vR.FILL,N=null){let W=[this.minX,this.minY,this.maxX,this.maxY];if(R===vR.STROKE){N||Dt("Stroke bounding box must include transform.");let R=Q.singularValueDecompose2dScale(N),j=R[0]*this.lineWidth/2,B=R[1]*this.lineWidth/2;W[0]-=j,W[1]-=B,W[2]+=j,W[3]+=B}return W}updateClipFromPath(){let R=Q.intersect(this.clipBox,this.getPathBoundingBox());this.startNewPathAndClipBox(R||[0,0,0,0])}isEmptyClip(){return this.minX===1/0}startNewPathAndClipBox(R){this.clipBox=R,this.minX=1/0,this.minY=1/0,this.maxX=0,this.maxY=0}getClippedPathBoundingBox(R=vR.FILL,N=null){return Q.intersect(this.clipBox,this.getPathBoundingBox(R,N))}};function Pv(R,N){let W,j,B,z;if("u">typeof ImageData&&N instanceof ImageData){R.putImageData(N,0,0);return}let U=N.height,V=N.width,G=U%16,Y=(U-G)/16,Z=0===G?Y:Y+1,te=R.createImageData(V,16),tn=0,tr,ts=N.data,ta=te.data;if(N.kind===m4.GRAYSCALE_1BPP){let N=ts.byteLength,z=new Uint32Array(ta.buffer,0,ta.byteLength>>2),U=z.length,th=V+7>>3,tc=Ge.isLittleEndian?4278190080:255;for(W=0;W<Z;W++){for(B=W<Y?16:G,tr=0,j=0;j<B;j++){let R=N-tn,W=0,j=R>th?V:8*R-7,B=-8&j,U=0,G=0;for(;W<B;W+=8)G=ts[tn++],z[tr++]=128&G?4294967295:tc,z[tr++]=64&G?4294967295:tc,z[tr++]=32&G?4294967295:tc,z[tr++]=16&G?4294967295:tc,z[tr++]=8&G?4294967295:tc,z[tr++]=4&G?4294967295:tc,z[tr++]=2&G?4294967295:tc,z[tr++]=1&G?4294967295:tc;for(;W<j;W++)0===U&&(G=ts[tn++],U=128),z[tr++]=G&U?4294967295:tc,U>>=1}for(;tr<U;)z[tr++]=0;R.putImageData(te,0,16*W)}}else if(N.kind===m4.RGBA_32BPP){for(j=0,z=64*V,W=0;W<Y;W++)ta.set(ts.subarray(tn,tn+z)),tn+=z,R.putImageData(te,0,j),j+=16;W<Z&&(z=V*G*4,ta.set(ts.subarray(tn,tn+z)),R.putImageData(te,0,j)
222)}else if(N.kind===m4.RGB_24BPP)for(z=V*(B=16),W=0;W<Z;W++){for(W>=Y&&(z=V*(B=G)),tr=0,j=z;j--;)ta[tr++]=ts[tn++],ta[tr++]=ts[tn++],ta[tr++]=ts[tn++],ta[tr++]=255;R.putImageData(te,0,16*W)}else throw Error(`bad image kind: ${N.kind}`)}function Rv(R,N){if(N.bitmap){R.drawImage(N.bitmap,0,0);return}let W=N.height,j=N.width,B=W%16,z=(W-B)/16,U=0===B?z:z+1,V=R.createImageData(j,16),G=0,Y=N.data,Z=V.data;for(let N=0;N<U;N++){let W=N<z?16:B;({srcPos:G}=function({src:R,srcPos:N=0,dest:W,width:j,height:B,nonBlackColor:z=4294967295,inverseDecode:U=!1}){let V=Ge.isLittleEndian?4278190080:255,[G,Y]=U?[z,V]:[V,z],Z=j>>3,te=7&j,tn=R.length;W=new Uint32Array(W.buffer);let tr=0;for(let j=0;j<B;j++){for(let j=N+Z;N<j;N++){let j=N<tn?R[N]:255;W[tr++]=128&j?Y:G,W[tr++]=64&j?Y:G,W[tr++]=32&j?Y:G,W[tr++]=16&j?Y:G,W[tr++]=8&j?Y:G,W[tr++]=4&j?Y:G,W[tr++]=2&j?Y:G,W[tr++]=1&j?Y:G}if(0===te)continue;let j=N<tn?R[N++]:255;for(let R=0;R<te;R++)W[tr++]=j&1<<7-R?Y:G}return{srcPos:N,destPos:tr}}({src:Y,srcPos:G,dest:Z,width:j,height:W,nonBlackColor:0})),R.putImageData(V,0,16*N)}}function nl(R,N){for(let W of["strokeStyle","fillStyle","fillRule","globalAlpha","lineWidth","lineCap","lineJoin","miterLimit","globalCompositeOperation","font","filter"])void 0!==R[W]&&(N[W]=R[W]);void 0!==R.setLineDash&&(N.setLineDash(R.getLineDash()),N.lineDashOffset=R.lineDashOffset)}function ud(R){if(R.strokeStyle=R.fillStyle="#000000",R.fillRule="nonzero",R.globalAlpha=1,R.lineWidth=1,R.lineCap="butt",R.lineJoin="miter",R.miterLimit=10,R.globalCompositeOperation="source-over",R.font="10px sans-serif",void 0!==R.setLineDash&&(R.setLineDash([]),R.lineDashOffset=0),!mX){let{filter:N}=R;"none"!==N&&""!==N&&(R.filter="none")}}function kv(R,N){if(N)return!0;let W=Q.singularValueDecompose2dScale(R);W[0]=Math.fround(W[0]),W[1]=Math.fround(W[1]);let j=Math.fround((globalThis.devicePixelRatio||1)*vf.PDF_TO_CSS_UNITS);return W[0]<=j&&W[1]<=j}let vD=["butt","round","square"],vN=["miter","round","bevel"],vO={},vF={},vW=class T0{constructor(R,N,W,j,B,{optionalContentConfig:z,markedContentStack:U=null},V,G){m(this,rn),m(this,rs),this.ctx=R,this.current=new Tv(this.ctx.canvas.width,this.ctx.canvas.height),this.stateStack=[],this.pendingClip=null,this.pendingEOFill=!1,this.res=null,this.xobjs=null,this.commonObjs=N,this.objs=W,this.canvasFactory=j,this.filterFactory=B,this.groupStack=[],this.processingType3=null,this.baseTransform=null,this.baseTransformStack=[],this.groupLevel=0,this.smaskStack=[],this.smaskCounter=0,this.tempSMask=null,this.suspendedCtx=null,this.contentVisible=!0,this.markedContentStack=U||[],this.optionalContentConfig=z,this.cachedCanvases=new dk(this.canvasFactory),this.cachedPatterns=new Map,this.annotationCanvasMap=V,this.viewportScale=1,this.outputScaleX=1,this.outputScaleY=1,this.pageColors=G,this._cachedScaleForStroking=[-1,0],this._cachedGetSinglePixelWidth=null,this._cachedBitmapsMap=new Map}getObject(R,N=null){return"string"==typeof R?R.startsWith("g_")?this.commonObjs.get(R):this.objs.get(R):N}beginDrawing({transform:R,viewport:N,transparency:W=!1,background:j=null}){let B=this.ctx.canvas.width,z=this.ctx.canvas.height,U=this.ctx.fillStyle;if(this.ctx.fillStyle=j||"#ffffff",this.ctx.fillRect(0,0,B,z),this.ctx.fillStyle=U,W){let R=this.cachedCanvases.getCanvas("transparent",B,z);this.compositeCtx=this.ctx,this.transparentCanvas=R.canvas,this.ctx=R.context,this.ctx.save(),this.ctx.transform(...Gt(this.compositeCtx))}this.ctx.save(),ud(this.ctx),R&&(this.ctx.transform(...R),this.outputScaleX=R[0],this.outputScaleY=R[0]),this.ctx.transform(...N.transform),this.viewportScale=N.scale,this.baseTransform=Gt(this.ctx)}executeOperatorList(R,N,W,j){let B;let z=R.argsArray,U=R.fnArray,V=N||0,G=z.length;if(G===V)return V;let Y=G-V>10&&"function"==typeof W,Z=Y?Date.now()+15:0,te=0,tn=this.commonObjs,tr=this.objs;for(;;){if(void 0!==j&&V===j.nextBreakPoint)return j.breakIt(V,W),V;if((B=U[V])!==ve.dependency)this[B].apply(this,z[V]);else for(let R of z[V]){let N=R.startsWith("g_")?tn:tr;if(!N.has(R))return N.get(R,W),V}if(++V===G)return V;if(Y&&++te>10){if(Date.now()>Z)return W(),V;te=0}}}endDrawing(){for(let R of(A(this,rn,rr).call(this),this.cachedCanvases.clear(),this.cachedPatterns.clear(),this._cachedBitmapsMap.values())
222){for(let N of R.values())"u">typeof HTMLCanvasElement&&N instanceof HTMLCanvasElement&&(N.width=N.height=0);R.clear()}this._cachedBitmapsMap.clear(),A(this,rs,ra).call(this)}_scaleImage(R,N){let W=R.width,j=R.height,B=Math.max(Math.hypot(N[0],N[1]),1),z=Math.max(Math.hypot(N[2],N[3]),1),U=W,V=j,G="prescale1",Y,Z;for(;B>2&&U>1||z>2&&V>1;){let N=U,W=V;B>2&&U>1&&(N=U>=16384?Math.floor(U/2)-1||1:Math.ceil(U/2),B/=U/N),z>2&&V>1&&(W=V>=16384?Math.floor(V/2)-1||1:Math.ceil(V)/2,z/=V/W),(Z=(Y=this.cachedCanvases.getCanvas(G,N,W)).context).clearRect(0,0,N,W),Z.drawImage(R,0,0,U,V,0,0,N,W),R=Y.canvas,U=N,V=W,G="prescale1"===G?"prescale2":"prescale1"}return{img:R,paintWidth:U,paintHeight:V}}_createMaskCanvas(R){let N,W,j,B;let z=this.ctx,{width:U,height:V}=R,G=this.current.fillColor,Y=this.current.patternFill,Z=Gt(z);if((R.bitmap||R.data)&&R.count>1){let B=R.bitmap||R.data.buffer;W=JSON.stringify(Y?Z:[Z.slice(0,4),G]),(N=this._cachedBitmapsMap.get(B))||(N=new Map,this._cachedBitmapsMap.set(B,N));let z=N.get(W);if(z&&!Y){let R=Math.round(Math.min(Z[0],Z[2])+Z[4]),N=Math.round(Math.min(Z[1],Z[3])+Z[5]);return{canvas:z,offsetX:R,offsetY:N}}j=z}j||Rv((B=this.cachedCanvases.getCanvas("maskCanvas",U,V)).context,R);let te=Q.transform(Z,[1/U,0,0,-1/V,0,0]);te=Q.transform(te,[1,0,0,1,0,-V]);let[tn,tr,ts,ta]=Q.getAxialAlignedBoundingBox([0,0,U,V],te),th=Math.round(ts-tn)||1,tc=Math.round(ta-tr)||1,tu=this.cachedCanvases.getCanvas("fillCanvas",th,tc),tp=tu.context;tp.translate(-tn,-tr),tp.transform(...te),j||(j=(j=this._scaleImage(B.canvas,oi(tp))).img,N&&Y&&N.set(W,j)),tp.imageSmoothingEnabled=kv(Gt(tp),R.interpolate),dd(tp,j,0,0,j.width,j.height,0,0,U,V),tp.globalCompositeOperation="source-in";let tf=Q.transform(oi(tp),[1,0,0,1,-tn,-tr]);return tp.fillStyle=Y?G.getPattern(z,this,tf,vR.FILL):G,tp.fillRect(0,0,U,V),N&&!Y&&(this.cachedCanvases.delete("fillCanvas"),N.set(W,tu.canvas)),{canvas:tu.canvas,offsetX:Math.round(tn),offsetY:Math.round(tr)}}setLineWidth(R){R!==this.current.lineWidth&&(this._cachedScaleForStroking[0]=-1),this.current.lineWidth=R,this.ctx.lineWidth=R}setLineCap(R){this.ctx.lineCap=vD[R]}setLineJoin(R){this.ctx.lineJoin=vN[R]}setMiterLimit(R){this.ctx.miterLimit=R}setDash(R,N){let W=this.ctx;void 0!==W.setLineDash&&(W.setLineDash(R),W.lineDashOffset=N)}setRenderingIntent(R){}setFlatness(R){}setGState(R){for(let[N,W]of R)switch(N){case"LW":this.setLineWidth(W);break;case"LC":this.setLineCap(W);break;case"LJ":this.setLineJoin(W);break;case"ML":this.setMiterLimit(W);break;case"D":this.setDash(W[0],W[1]);break;case"RI":this.setRenderingIntent(W);break;case"FL":this.setFlatness(W);break;case"Font":this.setFont(W[0],W[1]);break;case"CA":this.current.strokeAlpha=W;break;case"ca":this.current.fillAlpha=W,this.ctx.globalAlpha=W;break;case"BM":this.ctx.globalCompositeOperation=W;break;case"SMask":this.current.activeSMask=W?this.tempSMask:null,this.tempSMask=null,this.checkSMaskState();break;case"TR":this.ctx.filter=this.current.transferMaps=this.filterFactory.addFilter(W)}}get inSMaskMode(){return!!this.suspendedCtx}checkSMaskState(){let R=this.inSMaskMode;this.current.activeSMask&&!R?this.beginSMaskMode():!this.current.activeSMask&&R&&this.endSMaskMode()}beginSMaskMode(){if(this.inSMaskMode)throw Error("beginSMaskMode called while already in smask mode");let R=this.ctx.canvas.width,N=this.ctx.canvas.height,W="smaskGroupAt"+this.groupLevel,j=this.cachedCanvases.getCanvas(W,R,N);this.suspendedCtx=this.ctx,this.ctx=j.context;let B=this.ctx;B.setTransform(...Gt(this.suspendedCtx)),nl(this.suspendedCtx,B),function(R,N){if(R._removeMirroring)throw Error("Context is already forwarding operations.");R.__originalSave=R.save,R.__originalRestore=R.restore,R.__originalRotate=R.rotate,R.__originalScale=R.scale,R.__originalTranslate=R.translate,R.__originalTransform=R.transform,R.__originalSetTransform=R.setTransform,R.__originalResetTransform=R.resetTransform,R.__originalClip=R.clip,R.__originalMoveTo=R.moveTo,R.__originalLineTo=R.lineTo,R.__originalBezierCurveTo=R.bezierCurveTo,R.__originalRect=R.rect,R.__originalClosePath=R.closePath,R.__originalBeginPath=R.beginPath,R._removeMirroring=()=>{R.save=R.__originalSave,R.restore=R.__originalRestore,R.rotate=R.__originalRotate,R.scale=R.__originalScale,R.translate=R.__originalTranslate,R.transform=R.__originalTransform,R.setTransform=R.__originalSetTransform,R.resetTransform=R.__originalResetTransform,R.clip=R.__originalClip,R.moveTo=R.__originalMoveTo,R.lineTo=R.__originalLineTo,R.bezierCurveTo=R.__originalBezierCurveTo,R.rect=R.__originalRect,R.closePath=R.__originalClosePath,R.beginPath=R.__originalBeginPath,delete R._removeMirroring},R.save=function(){N.save(),this.__originalSave()}
222,R.restore=function(){N.restore(),this.__originalRestore()},R.translate=function(R,W){N.translate(R,W),this.__originalTranslate(R,W)},R.scale=function(R,W){N.scale(R,W),this.__originalScale(R,W)},R.transform=function(R,W,j,B,z,U){N.transform(R,W,j,B,z,U),this.__originalTransform(R,W,j,B,z,U)},R.setTransform=function(R,W,j,B,z,U){N.setTransform(R,W,j,B,z,U),this.__originalSetTransform(R,W,j,B,z,U)},R.resetTransform=function(){N.resetTransform(),this.__originalResetTransform()},R.rotate=function(R){N.rotate(R),this.__originalRotate(R)},R.clip=function(R){N.clip(R),this.__originalClip(R)},R.moveTo=function(R,W){N.moveTo(R,W),this.__originalMoveTo(R,W)},R.lineTo=function(R,W){N.lineTo(R,W),this.__originalLineTo(R,W)},R.bezierCurveTo=function(R,W,j,B,z,U){N.bezierCurveTo(R,W,j,B,z,U),this.__originalBezierCurveTo(R,W,j,B,z,U)},R.rect=function(R,W,j,B){N.rect(R,W,j,B),this.__originalRect(R,W,j,B)},R.closePath=function(){N.closePath(),this.__originalClosePath()},R.beginPath=function(){N.beginPath(),this.__originalBeginPath()}}(B,this.suspendedCtx),this.setGState([["BM","source-over"],["ca",1],["CA",1]])}endSMaskMode(){if(!this.inSMaskMode)throw Error("endSMaskMode called while not in smask mode");this.ctx._removeMirroring(),nl(this.ctx,this.suspendedCtx),this.ctx=this.suspendedCtx,this.suspendedCtx=null}compose(R){if(!this.current.activeSMask)return;R?(R[0]=Math.floor(R[0]),R[1]=Math.floor(R[1]),R[2]=Math.ceil(R[2]),R[3]=Math.ceil(R[3])):R=[0,0,this.ctx.canvas.width,this.ctx.canvas.height];let N=this.current.activeSMask,W=this.suspendedCtx;this.composeSMask(W,N,this.ctx,R),this.ctx.save(),this.ctx.setTransform(1,0,0,1,0,0),this.ctx.clearRect(0,0,this.ctx.canvas.width,this.ctx.canvas.height),this.ctx.restore()}composeSMask(R,N,W,j){let B=j[0],z=j[1],U=j[2]-B,V=j[3]-z;0===U||0===V||(this.genericComposeSMask(N.context,W,U,V,N.subtype,N.backdrop,N.transferMap,B,z,N.offsetX,N.offsetY),R.save(),R.globalAlpha=1,R.globalCompositeOperation="source-over",R.setTransform(1,0,0,1,0,0),R.drawImage(W.canvas,0,0),R.restore())}genericComposeSMask(R,N,W,j,B,z,U,V,G,Y,Z){let te=R.canvas,tn=V-Y,tr=G-Z;if(z){if(tn<0||tr<0||tn+W>te.width||tr+j>te.height){let R=this.cachedCanvases.getCanvas("maskExtension",W,j),N=R.context;N.drawImage(te,-tn,-tr),z.some(R=>0!==R)&&(N.globalCompositeOperation="destination-atop",N.fillStyle=Q.makeHexColor(...z),N.fillRect(0,0,W,j),N.globalCompositeOperation="source-over"),te=R.canvas,tn=tr=0}else if(z.some(R=>0!==R)){R.save(),R.globalAlpha=1,R.setTransform(1,0,0,1,0,0);let N=new Path2D;N.rect(tn,tr,W,j),R.clip(N),R.globalCompositeOperation="destination-atop",R.fillStyle=Q.makeHexColor(...z),R.fillRect(tn,tr,W,j),R.restore()}}N.save(),N.globalAlpha=1,N.setTransform(1,0,0,1,0,0),"Alpha"===B&&U?N.filter=this.filterFactory.addAlphaFilter(U):"Luminosity"===B&&(N.filter=this.filterFactory.addLuminosityFilter(U));let ts=new Path2D;ts.rect(V,G,W,j),N.clip(ts),N.globalCompositeOperation="destination-in",N.drawImage(te,tn,tr,W,j,V,G,W,j),N.restore()}save(){this.inSMaskMode?(nl(this.ctx,this.suspendedCtx),this.suspendedCtx.save()):this.ctx.save();let R=this.current;this.stateStack.push(R),this.current=R.clone()}restore(){0===this.stateStack.length&&this.inSMaskMode&&this.endSMaskMode(),0!==this.stateStack.length&&(this.current=this.stateStack.pop(),this.inSMaskMode?(this.suspendedCtx.restore(),nl(this.suspendedCtx,this.ctx)):this.ctx.restore(),this.checkSMaskState(),this.pendingClip=null,this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null)}transform(R,N,W,j,B,z){this.ctx.transform(R,N,W,j,B,z),this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null}constructPath(R,N,W){let j=this.ctx,B=this.current,z=B.x,U=B.y,V,G,Y=Gt(j),Z=0===Y[0]&&0===Y[3]||0===Y[1]&&0===Y[2],te=Z?W.slice(0):null;for(let W=0,tn=0,tr=R.length;W<tr;W++)switch(0|R[W]){case ve.rectangle:z=N[tn++],U=N[tn++];let tr=N[tn++],ts=N[tn++],ta=z+tr,th=U+ts;j.moveTo(z,U),0===tr||0===ts?j.lineTo(ta,th):(j.lineTo(ta,U),j.lineTo(ta,th),j.lineTo(z,th)),Z||B.updateRectMinMax(Y,[z,U,ta,th]),j.closePath();break;case ve.moveTo:z=N[tn++],U=N[tn++],j.moveTo(z,U),Z||B.updatePathMinMax(Y,z,U);break;case ve.lineTo:z=N[tn++],U=N[tn++],j.lineTo(z,U),Z||B.updatePathMinMax(Y,z,U);break;case ve.curveTo:V=z,G=U,z=N[tn+4],U=N[tn+5],j.bezierCurveTo(N[tn],N[tn+1],N[tn+2],N[tn+3],z,U),B.updateCurvePathMinMax(Y,V,G,N[tn],N[tn+1],N[tn+2],N[tn+3],z,U,te),tn+=6;break;case ve.curveTo2:V=z,G=U,j.bezierCurveTo(z,U,N[tn],N[tn+1],N[tn+2],N[tn+3]),B.updateCurvePathMinMax(Y,V,G,z,U,N[tn],N[tn+1],N[tn+2],N[tn+3],te),z=N[tn+2],U=N[tn+3],tn+=4;break;case ve.curveTo3:V=z,G=U,z=N[tn+2],U=N[tn+3],j.bezierCurveTo(N[tn],N[tn+1],z,U,z,U),B.updateCurvePathMinMax(Y,V,G,N[tn],N[tn+1],z,U,z,U,te),tn+=4;break;case ve.closePath:j.closePath()}
222Z&&B.updateScalingPathMinMax(Y,te),B.setCurrentPoint(z,U)}closePath(){this.ctx.closePath()}stroke(R=!0){let N=this.ctx,W=this.current.strokeColor;N.globalAlpha=this.current.strokeAlpha,this.contentVisible&&("object"==typeof W&&null!=W&&W.getPattern?(N.save(),N.strokeStyle=W.getPattern(N,this,oi(N),vR.STROKE),this.rescaleAndStroke(!1),N.restore()):this.rescaleAndStroke(!0)),R&&this.consumePath(this.current.getClippedPathBoundingBox()),N.globalAlpha=this.current.fillAlpha}closeStroke(){this.closePath(),this.stroke()}fill(R=!0){let N=this.ctx,W=this.current.fillColor,j=this.current.patternFill,B=!1;j&&(N.save(),N.fillStyle=W.getPattern(N,this,oi(N),vR.FILL),B=!0);let z=this.current.getClippedPathBoundingBox();this.contentVisible&&null!==z&&(this.pendingEOFill?(N.fill("evenodd"),this.pendingEOFill=!1):N.fill()),B&&N.restore(),R&&this.consumePath(z)}eoFill(){this.pendingEOFill=!0,this.fill()}fillStroke(){this.fill(!1),this.stroke(!1),this.consumePath()}eoFillStroke(){this.pendingEOFill=!0,this.fillStroke()}closeFillStroke(){this.closePath(),this.fillStroke()}closeEOFillStroke(){this.pendingEOFill=!0,this.closePath(),this.fillStroke()}endPath(){this.consumePath()}clip(){this.pendingClip=vO}eoClip(){this.pendingClip=vF}beginText(){this.current.textMatrix=mY,this.current.textMatrixScale=1,this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0}endText(){let R=this.pendingTextPaths,N=this.ctx;if(void 0===R){N.beginPath();return}for(let W of(N.save(),N.beginPath(),R))N.setTransform(...W.transform),N.translate(W.x,W.y),W.addToPath(N,W.fontSize);N.restore(),N.clip(),N.beginPath(),delete this.pendingTextPaths}setCharSpacing(R){this.current.charSpacing=R}setWordSpacing(R){this.current.wordSpacing=R}setHScale(R){this.current.textHScale=R/100}setLeading(R){this.current.leading=-R}setFont(R,N){var W;let j=this.commonObjs.get(R),B=this.current;if(!j)throw Error(`Can't find font for ${R}`);if(B.fontMatrix=j.fontMatrix||mK,(0===B.fontMatrix[0]||0===B.fontMatrix[3])&&vt("Invalid font matrix for font "+R),N<0?(N=-N,B.fontDirection=-1):B.fontDirection=1,this.current.font=j,this.current.fontSize=N,j.isType3Font)return;let z=j.loadedName||"sans-serif",U=(null==(W=j.systemFontInfo)?void 0:W.css)||`"${z}", ${j.fallbackName}`,V="normal";j.black?V="900":j.bold&&(V="bold");let G=j.italic?"italic":"normal",Y=N;N<16?Y=16:N>100&&(Y=100),this.current.fontSizeScale=N/Y,this.ctx.font=`${G} ${V} ${Y}px ${U}`}setTextRenderingMode(R){this.current.textRenderingMode=R}setTextRise(R){this.current.textRise=R}moveText(R,N){this.current.x=this.current.lineX+=R,this.current.y=this.current.lineY+=N}setLeadingMoveText(R,N){this.setLeading(-N),this.moveText(R,N)}setTextMatrix(R,N,W,j,B,z){this.current.textMatrix=[R,N,W,j,B,z],this.current.textMatrixScale=Math.hypot(R,N),this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0}nextLine(){this.moveText(0,this.current.leading)}paintChar(R,N,W,j){let B;let z=this.ctx,U=this.current,V=U.font,G=U.textRenderingMode,Y=U.fontSize/U.fontSizeScale,Z=G&m5.FILL_STROKE_MASK,te=!!(G&m5.ADD_TO_PATH_FLAG),tn=U.patternFill&&!V.missingFile;(V.disableFontFace||te||tn)&&(B=V.getPathGenerator(this.commonObjs,R)),V.disableFontFace||tn?(z.save(),z.translate(N,W),z.beginPath(),B(z,Y),j&&z.setTransform(...j),(Z===m5.FILL||Z===m5.FILL_STROKE)&&z.fill(),(Z===m5.STROKE||Z===m5.FILL_STROKE)&&z.stroke(),z.restore()):((Z===m5.FILL||Z===m5.FILL_STROKE)&&z.fillText(R,N,W),(Z===m5.STROKE||Z===m5.FILL_STROKE)&&z.strokeText(R,N,W)),te&&(this.pendingTextPaths||(this.pendingTextPaths=[])).push({transform:Gt(z),x:N,y:W,fontSize:Y,addToPath:B})}get isFontSubpixelAAEnabled(){let{context:R}=this.cachedCanvases.getCanvas("isFontSubpixelAAEnabled",10,10);R.scale(1.5,1),R.fillText("I",0,10);let N=R.getImageData(0,0,10,10).data,W=!1;for(let R=3;R<N.length;R+=4)if(N[R]>0&&N[R]<255){W=!0;break}return Tt(this,"isFontSubpixelAAEnabled",W)}showText(R){let N;let W=this.current,j=W.font;if(j.isType3Font)return this.showType3Text(R);let B=W.fontSize;if(0===B)return;let z=this.ctx,U=W.fontSizeScale,V=W.charSpacing,G=W.wordSpacing,Y=W.fontDirection,Z=W.textHScale*Y,te=R.length,tn=j.vertical,tr=tn?1:-1,ts=j.defaultVMetrics,ta=B*W.fontMatrix[0],th=W.textRenderingMode===m5.FILL&&!j.disableFontFace&&!W.patternFill;if(z.save(),z.transform(...W.textMatrix),z.translate(W.x,W.y+W.textRise),Y>0?z.scale(Z,-1):z.scale(Z,1),W.patternFill){z.save();let R=W.fillColor.getPattern(z,this,oi(z),vR.FILL);
222N=Gt(z),z.restore(),z.fillStyle=R}let tc=W.lineWidth,tu=W.textMatrixScale;if(0===tu||0===tc){let R=W.textRenderingMode&m5.FILL_STROKE_MASK;(R===m5.STROKE||R===m5.FILL_STROKE)&&(tc=this.getSinglePixelWidth())}else tc/=tu;if(1!==U&&(z.scale(U,U),tc/=U),z.lineWidth=tc,j.isInvalidPDFjsFont){let N=[],j=0;for(let W of R)N.push(W.unicode),j+=W.width;z.fillText(N.join(""),0,0),W.x+=j*ta*Z,z.restore(),this.compose();return}let tp=0,tf;for(tf=0;tf<te;++tf){let W=R[tf];if("number"==typeof W){tp+=tr*W*B/1e3;continue}let Z=!1,te=(W.isSpace?G:0)+V,tc=W.fontChar,tu=W.accent,tg,tm,tw=W.width;if(tn){let R=W.vmetric||ts,N=-(W.vmetric?R[1]:.5*tw)*ta,j=R[2]*ta;tw=R?-R[0]:tw,tg=N/U,tm=(tp+j)/U}else tg=tp/U,tm=0;if(j.remeasure&&tw>0){let R=1e3*z.measureText(tc).width/B*U;if(tw<R&&this.isFontSubpixelAAEnabled){let N=tw/R;Z=!0,z.save(),z.scale(N,1),tg/=N}else tw!==R&&(tg+=(tw-R)/2e3*B/U)}if(this.contentVisible&&(W.isInFont||j.missingFile)){if(th&&!tu)z.fillText(tc,tg,tm);else if(this.paintChar(tc,tg,tm,N),tu){let R=tg+B*tu.offset.x/U,W=tm-B*tu.offset.y/U;this.paintChar(tu.fontChar,R,W,N)}}let ty=tn?tw*ta-te*Y:tw*ta+te*Y;tp+=ty,Z&&z.restore()}tn?W.y-=tp:W.x+=tp*Z,z.restore(),this.compose()}showType3Text(R){let N,W,j,B;let z=this.ctx,U=this.current,V=U.font,G=U.fontSize,Y=U.fontDirection,Z=V.vertical?1:-1,te=U.charSpacing,tn=U.wordSpacing,tr=U.textHScale*Y,ts=U.fontMatrix||mK,ta=R.length,th=U.textRenderingMode===m5.INVISIBLE;if(!(th||0===G)){for(this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null,z.save(),z.transform(...U.textMatrix),z.translate(U.x,U.y),z.scale(tr,Y),N=0;N<ta;++N){if("number"==typeof(W=R[N])){B=Z*W*G/1e3,this.ctx.translate(B,0),U.x+=B*tr;continue}let Y=(W.isSpace?tn:0)+te,ta=V.charProcOperatorList[W.operatorListId];if(!ta){vt(`Type3 character "${W.operatorListId}" is not available.`);continue}this.contentVisible&&(this.processingType3=W,this.save(),z.scale(G,G),z.transform(...ts),this.executeOperatorList(ta),this.restore()),j=Q.applyTransform([W.width,0],ts)[0]*G+Y,z.translate(j,0),U.x+=j*tr}z.restore(),this.processingType3=null}}setCharWidth(R,N){}setCharWidthAndBounds(R,N,W,j,B,z){this.ctx.rect(W,j,B-W,z-j),this.ctx.clip(),this.endPath()}getColorN_Pattern(R){let N;if("TilingPattern"===R[0]){let W=R[1],j=this.baseTransform||Gt(this.ctx);N=new vI(R,W,this.ctx,{createCanvasGraphics:R=>new T0(R,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:this.optionalContentConfig,markedContentStack:this.markedContentStack})},j)}else N=this._getPattern(R[1],R[2]);return N}setStrokeColorN(){this.current.strokeColor=this.getColorN_Pattern(arguments)}setFillColorN(){this.current.fillColor=this.getColorN_Pattern(arguments),this.current.patternFill=!0}setStrokeRGBColor(R,N,W){let j=Q.makeHexColor(R,N,W);this.ctx.strokeStyle=j,this.current.strokeColor=j}setFillRGBColor(R,N,W){let j=Q.makeHexColor(R,N,W);this.ctx.fillStyle=j,this.current.fillColor=j,this.current.patternFill=!1}_getPattern(R,N=null){let W;return this.cachedPatterns.has(R)?W=this.cachedPatterns.get(R):(W=function(R){switch(R[0]){case"RadialAxial":return new ik(R);case"Mesh":return new sk(R);case"Dummy":return new ok}throw Error(`Unknown IR type: ${R[0]}`)}(this.getObject(R)),this.cachedPatterns.set(R,W)),N&&(W.matrix=N),W}shadingFill(R){if(!this.contentVisible)return;let N=this.ctx;this.save();let W=this._getPattern(R);N.fillStyle=W.getPattern(N,this,oi(N),vR.SHADING);let j=oi(N);if(j){let{width:R,height:W}=N.canvas,[B,z,U,V]=Q.getAxialAlignedBoundingBox([0,0,R,W],j);this.ctx.fillRect(B,z,U-B,V-z)}else this.ctx.fillRect(-1e10,-1e10,2e10,2e10);this.compose(this.current.getClippedPathBoundingBox()),this.restore()}beginInlineImage(){Dt("Should not call beginInlineImage")}beginImageData(){Dt("Should not call beginImageData")}paintFormXObjectBegin(R,N){if(this.contentVisible&&(this.save(),this.baseTransformStack.push(this.baseTransform),R&&this.transform(...R),this.baseTransform=Gt(this.ctx),N)){let R=N[2]-N[0],W=N[3]-N[1];this.ctx.rect(N[0],N[1],R,W),this.current.updateRectMinMax(Gt(this.ctx),N),this.clip(),this.endPath()}}
222paintFormXObjectEnd(){this.contentVisible&&(this.restore(),this.baseTransform=this.baseTransformStack.pop())}beginGroup(R){if(!this.contentVisible)return;this.save(),this.inSMaskMode&&(this.endSMaskMode(),this.current.activeSMask=null);let N=this.ctx;R.isolated||cp("TODO: Support non-isolated groups."),R.knockout&&vt("Knockout groups not supported.");let W=Gt(N);if(R.matrix&&N.transform(...R.matrix),!R.bbox)throw Error("Bounding box is required.");let j=Q.getAxialAlignedBoundingBox(R.bbox,Gt(N)),B=[0,0,N.canvas.width,N.canvas.height];j=Q.intersect(j,B)||[0,0,0,0];let z=Math.floor(j[0]),U=Math.floor(j[1]),V=Math.max(Math.ceil(j[2])-z,1),G=Math.max(Math.ceil(j[3])-U,1);this.current.startNewPathAndClipBox([0,0,V,G]);let Y="groupAt"+this.groupLevel;R.smask&&(Y+="_smask_"+this.smaskCounter++%2);let Z=this.cachedCanvases.getCanvas(Y,V,G),te=Z.context;te.translate(-z,-U),te.transform(...W),R.smask?this.smaskStack.push({canvas:Z.canvas,context:te,offsetX:z,offsetY:U,subtype:R.smask.subtype,backdrop:R.smask.backdrop,transferMap:R.smask.transferMap||null,startTransformInverse:null}):(N.setTransform(1,0,0,1,0,0),N.translate(z,U),N.save()),nl(N,te),this.ctx=te,this.setGState([["BM","source-over"],["ca",1],["CA",1]]),this.groupStack.push(N),this.groupLevel++}endGroup(R){if(!this.contentVisible)return;this.groupLevel--;let N=this.ctx,W=this.groupStack.pop();if(this.ctx=W,this.ctx.imageSmoothingEnabled=!1,R.smask)this.tempSMask=this.smaskStack.pop(),this.restore();else{this.ctx.restore();let R=Gt(this.ctx);this.restore(),this.ctx.save(),this.ctx.setTransform(...R);let W=Q.getAxialAlignedBoundingBox([0,0,N.canvas.width,N.canvas.height],R);this.ctx.drawImage(N.canvas,0,0),this.ctx.restore(),this.compose(W)}}beginAnnotation(R,N,W,j,B){if(A(this,rn,rr).call(this),ud(this.ctx),this.ctx.save(),this.save(),this.baseTransform&&this.ctx.setTransform(...this.baseTransform),N){let j=N[2]-N[0],z=N[3]-N[1];if(B&&this.annotationCanvasMap){W=W.slice(),W[4]-=N[0],W[5]-=N[1],(N=N.slice())[0]=N[1]=0,N[2]=j,N[3]=z;let[B,U]=Q.singularValueDecompose2dScale(Gt(this.ctx)),{viewportScale:V}=this,G=Math.ceil(j*this.outputScaleX*V),Y=Math.ceil(z*this.outputScaleY*V);this.annotationCanvas=this.canvasFactory.create(G,Y);let{canvas:Z,context:te}=this.annotationCanvas;this.annotationCanvasMap.set(R,Z),this.annotationCanvas.savedCtx=this.ctx,this.ctx=te,this.ctx.save(),this.ctx.setTransform(B,0,0,-U,0,z*U),ud(this.ctx)}else ud(this.ctx),this.ctx.rect(N[0],N[1],j,z),this.ctx.clip(),this.endPath()}this.current=new Tv(this.ctx.canvas.width,this.ctx.canvas.height),this.transform(...W),this.transform(...j)}endAnnotation(){this.annotationCanvas&&(this.ctx.restore(),A(this,rs,ra).call(this),this.ctx=this.annotationCanvas.savedCtx,delete this.annotationCanvas.savedCtx,delete this.annotationCanvas)}paintImageMaskXObject(R){if(!this.contentVisible)return;let N=R.count;(R=this.getObject(R.data,R)).count=N;let W=this.ctx,j=this.processingType3;if(j&&(void 0===j.compiled&&(j.compiled=function(R){let{width:N,height:W}=R;if(N>1e3||W>1e3)return null;let j=new Uint8Array([0,2,4,0,1,0,5,4,8,10,0,8,0,2,1,0]),B=N+1,z=new Uint8Array(B*(W+1)),U,V,G,Y=N+7&-8,Z=new Uint8Array(Y*W),te=0;for(let N of R.data){let R=128;for(;R>0;)Z[te++]=N&R?0:255,R>>=1}let tn=0;for(0!==Z[te=0]&&(z[0]=1,++tn),V=1;V<N;V++)Z[te]!==Z[te+1]&&(z[V]=Z[te]?2:1,++tn),te++;for(0!==Z[te]&&(z[V]=2,++tn),U=1;U<W;U++){te=U*Y,G=U*B,Z[te-Y]!==Z[te]&&(z[G]=Z[te]?1:8,++tn);let R=(Z[te]?4:0)+(Z[te-Y]?8:0);for(V=1;V<N;V++)j[R=(R>>2)+(Z[te+1]?4:0)+(Z[te-Y+1]?8:0)]&&(z[G+V]=j[R],++tn),te++;if(Z[te-Y]!==Z[te]&&(z[G+V]=Z[te]?2:4,++tn),tn>1e3)return null}for(te=Y*(W-1),G=U*B,0!==Z[te]&&(z[G]=8,++tn),V=1;V<N;V++)Z[te]!==Z[te+1]&&(z[G+V]=Z[te]?4:8,++tn),te++;if(0!==Z[te]&&(z[G+V]=4,++tn),tn>1e3)return null;let tr=new Int32Array([0,B,-1,0,-B,0,0,0,1]),ts=new Path2D;for(U=0;tn&&U<=W;U++){let R=U*B,W=R+N;for(;R<W&&!z[R];)R++;if(R===W)continue;ts.moveTo(R%B,U);let j=R,V=z[R];do{let N=tr[V];do R+=N;while(!z[R]);let W=z[R];5!==W&&10!==W?(V=W,z[R]=0):(V=W&51*V>>4,z[R]&=V>>2|V<<2),ts.lineTo(R%B,R/B|0),z[R]||--tn}while(j!==R);--U}return Z=null,z=null,function(R){R.save(),R.scale(1/N,-1/W),R.translate(0,-W),R.fill(ts),R.beginPath(),R.restore(
222)}}(R)),j.compiled)){j.compiled(W);return}let B=this._createMaskCanvas(R),z=B.canvas;W.save(),W.setTransform(1,0,0,1,0,0),W.drawImage(z,B.offsetX,B.offsetY),W.restore(),this.compose()}paintImageMaskXObjectRepeat(R,N,W=0,j=0,B,z){if(!this.contentVisible)return;R=this.getObject(R.data,R);let U=this.ctx;U.save();let V=Gt(U);U.transform(N,W,j,B,0,0);let G=this._createMaskCanvas(R);U.setTransform(1,0,0,1,G.offsetX-V[4],G.offsetY-V[5]);for(let R=0,Y=z.length;R<Y;R+=2){let Y=Q.transform(V,[N,W,j,B,z[R],z[R+1]]),[Z,te]=Q.applyTransform([0,0],Y);U.drawImage(G.canvas,Z,te)}U.restore(),this.compose()}paintImageMaskXObjectGroup(R){if(!this.contentVisible)return;let N=this.ctx,W=this.current.fillColor,j=this.current.patternFill;for(let B of R){let{data:R,width:z,height:U,transform:V}=B,G=this.cachedCanvases.getCanvas("maskCanvas",z,U),Y=G.context;Y.save();let Z=this.getObject(R,B);Rv(Y,Z),Y.globalCompositeOperation="source-in",Y.fillStyle=j?W.getPattern(Y,this,oi(N),vR.FILL):W,Y.fillRect(0,0,z,U),Y.restore(),N.save(),N.transform(...V),N.scale(1,-1),dd(N,G.canvas,0,0,z,U,0,-1,1,1),N.restore()}this.compose()}paintImageXObject(R){if(!this.contentVisible)return;let N=this.getObject(R);if(!N){vt("Dependent image isn't ready yet");return}this.paintInlineImageXObject(N)}paintImageXObjectRepeat(R,N,W,j){if(!this.contentVisible)return;let B=this.getObject(R);if(!B){vt("Dependent image isn't ready yet");return}let z=B.width,U=B.height,V=[];for(let R=0,B=j.length;R<B;R+=2)V.push({transform:[N,0,0,W,j[R],j[R+1]],x:0,y:0,w:z,h:U});this.paintInlineImageXObjectGroup(B,V)}applyTransferMapsToCanvas(R){return"none"!==this.current.transferMaps&&(R.filter=this.current.transferMaps,R.drawImage(R.canvas,0,0),R.filter="none"),R.canvas}applyTransferMapsToBitmap(R){if("none"===this.current.transferMaps)return R.bitmap;let{bitmap:N,width:W,height:j}=R,B=this.cachedCanvases.getCanvas("inlineImage",W,j),z=B.context;return z.filter=this.current.transferMaps,z.drawImage(N,0,0),z.filter="none",B.canvas}paintInlineImageXObject(R){let N;if(!this.contentVisible)return;let W=R.width,j=R.height,B=this.ctx;if(this.save(),!mX){let{filter:R}=B;"none"!==R&&""!==R&&(B.filter="none")}if(B.scale(1/W,-1/j),R.bitmap)N=this.applyTransferMapsToBitmap(R);else if("function"==typeof HTMLElement&&R instanceof HTMLElement||!R.data)N=R;else{let B=this.cachedCanvases.getCanvas("inlineImage",W,j).context;Pv(B,R),N=this.applyTransferMapsToCanvas(B)}let z=this._scaleImage(N,oi(B));B.imageSmoothingEnabled=kv(Gt(B),R.interpolate),dd(B,z.img,0,0,z.paintWidth,z.paintHeight,0,-j,W,j),this.compose(),this.restore()}paintInlineImageXObjectGroup(R,N){let W;if(!this.contentVisible)return;let j=this.ctx;if(R.bitmap)W=R.bitmap;else{let N=R.width,j=R.height,B=this.cachedCanvases.getCanvas("inlineImage",N,j).context;Pv(B,R),W=this.applyTransferMapsToCanvas(B)}for(let R of N)j.save(),j.transform(...R.transform),j.scale(1,-1),dd(j,W,R.x,R.y,R.w,R.h,0,-1,1,1),j.restore();this.compose()}paintSolidColorImageMask(){this.contentVisible&&(this.ctx.fillRect(0,0,1,1),this.compose())}markPoint(R){}markPointProps(R,N){}beginMarkedContent(R){this.markedContentStack.push({visible:!0})}beginMarkedContentProps(R,N){"OC"===R?this.markedContentStack.push({visible:this.optionalContentConfig.isVisible(N)}):this.markedContentStack.push({visible:!0}),this.contentVisible=this.isContentVisible()}endMarkedContent(){this.markedContentStack.pop(),this.contentVisible=this.isContentVisible()}beginCompat(){}endCompat(){}consumePath(R){let N=this.current.isEmptyClip();this.pendingClip&&this.current.updateClipFromPath(),this.pendingClip||this.compose(R);let W=this.ctx;this.pendingClip&&(N||(this.pendingClip===vF?W.clip("evenodd"):W.clip()),this.pendingClip=null),this.current.startNewPathAndClipBox(this.current.clipBox),W.beginPath()}getSinglePixelWidth(){if(!this._cachedGetSinglePixelWidth){let R=Gt(this.ctx);if(0===R[1]&&0===R[2])this._cachedGetSinglePixelWidth=1/Math.min(Math.abs(R[0]),Math.abs(R[3]));else{let N=Math.abs(R[0]*R[3]-R[2]*R[1]),W=Math.hypot(R[0],R[2]),j=Math.hypot(R[1],R[3]);this._cachedGetSinglePixelWidth=Math.max(W,j)/N}}return this._cachedGetSinglePixelWidth}getScaleForStroking(){if(-1===this._cachedScaleForStroking[0]){let R,N;let{lineWidth:W}=this.current,{a:j,b:B,c:z,d:U}=this.ctx.getTransform();if(0===B&&0===z){let B=Math.abs(j),z=Math.abs(U);if(B===z){if(0===W)R=N=1/B;else{let j=B*W;R=N=j<1?1/j:1}}else if(0===W)R=1/B,N=1/z;else{let j=B*W,U=z*W;R=j<1?1/j:1,N=U<1?1/U:1}}else{let V=Math.abs(j*U-B*z),G=Math.hypot(j,B),Y=Math.hypot(z,U);if(0===W)R=Y/V,N=G/V;else{let j=W*V;R=Y>j?Y/j:1,N=G>j?G/j:1}}this._cachedScaleForStroking[0]=R,this._cachedScaleForStroking[1]=N}return this._cachedScaleForStroking}rescaleAndStroke(R){let{ctx:N}=this,{lineWidth:W}=this.current,[j,B]=this.getScaleForStroking();if(N.lineWidth=W||1,1===j&&1===B){N.stroke();return}let z=N.getLineDash();if(R&&N.save(),N.scale(j,B),z.length>0){let R=Math.max(j,B);N.setLineDash(z.map(N=>N/R)),N.lineDashOffset/=R}
222N.stroke(),R&&N.restore()}isContentVisible(){for(let R=this.markedContentStack.length-1;R>=0;R--)if(!this.markedContentStack[R].visible)return!1;return!0}};for(let R in rn=new WeakSet,rr=function(){for(;this.stateStack.length||this.inSMaskMode;)this.restore();this.ctx.restore(),this.transparentCanvas&&(this.ctx=this.compositeCtx,this.ctx.save(),this.ctx.setTransform(1,0,0,1,0,0),this.ctx.drawImage(this.transparentCanvas,0,0),this.ctx.restore(),this.transparentCanvas=null)},rs=new WeakSet,ra=function(){if(this.pageColors){let R=this.filterFactory.addHCMFilter(this.pageColors.foreground,this.pageColors.background);if("none"!==R){let N=this.ctx.filter;this.ctx.filter=R,this.ctx.drawImage(this.ctx.canvas,0,0),this.ctx.filter=N}}},ve)void 0!==vW.prototype[R]&&(vW.prototype[ve[R]]=vW.prototype[R]);let zi=class zi{static get workerPort(){return a(this,ro)}static set workerPort(R){if(!("u">typeof Worker&&R instanceof Worker)&&null!==R)throw Error("Invalid `workerPort` type.");w(this,ro,R)}static get workerSrc(){return a(this,rl)}static set workerSrc(R){if("string"!=typeof R)throw Error("Invalid `workerSrc` type.");w(this,rl,R)}};ro=new WeakMap,rl=new WeakMap,m(zi,ro,null),m(zi,rl,"");let vj={DATA:1,ERROR:2},vB={CANCEL:1,CANCEL_COMPLETE:2,CLOSE:3,ENQUEUE:4,ERROR:5,PULL:6,PULL_COMPLETE:7,START_COMPLETE:8};function qe(R){switch(R instanceof Error||"object"==typeof R&&null!==R||Dt('wrapReason: Expected "reason" to be a (possibly cloned) Error.'),R.name){case"AbortException":return new lo(R.message);case"MissingPDFException":return new ao(R.message);case"PasswordException":return new Sg(R.message,R.code);case"UnexpectedResponseException":return new hp(R.message,R.status);case"UnknownErrorException":return new xg(R.message,R.details);default:return new xg(R.message,R.toString())}}let ul=class ul{constructor(R,N,W){m(this,rh),m(this,rd),m(this,rf),this.sourceName=R,this.targetName=N,this.comObj=W,this.callbackId=1,this.streamId=1,this.streamSinks=Object.create(null),this.streamControllers=Object.create(null),this.callbackCapabilities=Object.create(null),this.actionHandler=Object.create(null),this._onComObjOnMessage=R=>{let N=R.data;if(N.targetName!==this.sourceName)return;if(N.stream){A(this,rd,ru).call(this,N);return}if(N.callback){let R=N.callbackId,W=this.callbackCapabilities[R];if(!W)throw Error(`Cannot resolve callback ${R}`);if(delete this.callbackCapabilities[R],N.callback===vj.DATA)W.resolve(N.data);else if(N.callback===vj.ERROR)W.reject(qe(N.reason));else throw Error("Unexpected callback case");return}let j=this.actionHandler[N.action];if(!j)throw Error(`Unknown action from worker: ${N.action}`);if(N.callbackId){let R=this.sourceName,B=N.sourceName;new Promise(function(R){R(j(N.data))}).then(function(j){W.postMessage({sourceName:R,targetName:B,callback:vj.DATA,callbackId:N.callbackId,data:j})},function(j){W.postMessage({sourceName:R,targetName:B,callback:vj.ERROR,callbackId:N.callbackId,reason:qe(j)})});return}if(N.streamId){A(this,rh,rc).call(this,N);return}j(N.data)},W.addEventListener("message",this._onComObjOnMessage)}on(R,N){let W=this.actionHandler;if(W[R])throw Error(`There is already an actionName called "${R}"`);W[R]=N}send(R,N,W){this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:R,data:N},W)}sendWithPromise(R,N,W){let j=this.callbackId++,B=Promise.withResolvers();this.callbackCapabilities[j]=B;try{this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:R,callbackId:j,data:N},W)}catch(R){B.reject(R)}return B.promise}sendWithStream(R,N,W,j){let B=this.streamId++,z=this.sourceName,U=this.targetName,V=this.comObj;return new ReadableStream({start:W=>{let G=Promise.withResolvers();return this.streamControllers[B]={controller:W,startCall:G,pullCall:null,cancelCall:null,isClosed:!1},V.postMessage({sourceName:z,targetName:U,action:R,streamId:B,data:N,desiredSize:W.desiredSize},j),G.promise},pull:R=>{let N=Promise.withResolvers();return this.streamControllers[B].pullCall=N,V.postMessage({sourceName:z,targetName:U,stream:vB.PULL,streamId:B,desiredSize:R.desiredSize}),N.promise},cancel:R=>{ae(R instanceof Error,"cancel must have a valid reason");let N=Promise.withResolvers();return this.streamControllers[B].cancelCall=N,this.streamControllers[B].isClosed=!0,V.postMessage({sourceName:z,targetName:U,stream:vB.CANCEL,streamId:B,reason:qe(R)}),N.promise}},W)}destroy(){this.comObj.removeEventListener("message",this._onComObjOnMessage)}};rh=new WeakSet,rc=function(R){let N=R.streamId,W=this.sourceName,j=R.sourceName,B=this.comObj,z=this,U=this.actionHandler[R.action],V={enqueue(R,z=1,U){if(this.isCancelled)return;let V=this.desiredSize;this.desiredSize-=z,V>0&&this.desiredSize<=0&&(this.sinkCapability=Promise.withResolvers(),this.ready=this.sinkCapability.promise),B.postMessage({sourceName:W,targetName:j,stream:vB.ENQUEUE,streamId:N,chunk:R},U)},close(){this.isCancelled||(this.isCancelled=!0,B.postMessage({sourceName:W,targetName:j,stream:vB.CLOSE,streamId:N}),delete z.streamSinks[N])},error(R){ae(R instanceof Error,"error must have a valid reason"),this.isCancelled||(this.isCancelled=!0,B.postMessage({sourceName:W,targetName:j,stream:vB.ERROR,streamId:N,reason:qe(R)}))},sinkCapability:Promise.withResolvers(),onPull:null,onCancel:null,isCancelled:!1,desiredSize:R.desiredSize,ready:null};V.sinkCapability.resolve(),V.ready=V.sinkCapability.promise,this.streamSinks[N]=V,new Promise(function(N){N(U(R.data,V))}).then(function(){B.postMessage({sourceName:W,targetName:j,stream:vB.START_COMPLETE,streamId:N,success:!0})},function(R){B.postMessage({sourceName:W,targetName:j,stream:vB.START_COMPLETE,streamId:N,reason:qe(R)})})},rd=new WeakSet,ru=function(R){let N=R.streamId,W=this.sourceName,j=R.sourceName,B=this.comObj,z=this.streamControllers[N],U=this.streamSinks[N];switch(R.stream){case vB.START_COMPLETE:R.success?z.startCall.resolve():z.startCall.reject(qe(R.reason));break;case vB.PULL_COMPLETE:R.success?z.pullCall.resolve():z.pullCall.reject(qe(R.reason));break;case vB.PULL:if(!U){B.postMessage({sourceName:W,targetName:j,stream:vB.PULL_COMPLETE,streamId:N,success:!0});break}U.desiredSize<=0&&R.desiredSize>0&&U.sinkCapability.resolve(),U.desiredSize=R.desiredSize,new Promise(function(R){var N;R(null==(N=U.onPull)?void 0:N.call(U))}).then(function(){B.postMessage({sourceName:W,targetName:j,stream:vB.PULL_COMPLETE,streamId:N,success:!0})},function(R){B.postMessage({sourceName:W,targetName:j,stream:vB.PULL_COMPLETE,streamId:N,reason:qe(R)})});break;case vB.ENQUEUE:if(ae(z,"enqueue should have stream controller"),z.isClosed)break;z.controller.enqueue(R.chunk);break;case vB.CLOSE:if(ae(z,"close should have stream controller"),z.isClosed)break;z.isClosed=!0,z.controller.close(),A(this,rf,rg).call(this,z,N);break;case vB.ERROR:ae(z,"error should have stream controller"),z.controller.error(qe(R.reason)),A(this,rf,rg).call(this,z,N);break;case vB.CANCEL_COMPLETE:R.success?z.cancelCall.resolve():z.cancelCall.reject(qe(R.reason)),A(this,rf,rg).call(this,z,N);break;case vB.CANCEL:if(!U)break;new Promise(function(N){var W;N(null==(W=U.onCancel)?void 0:W.call(U,qe(R.reason)))}).then(function(){B.postMessage({sourceName:W,targetName:j,stream:vB.CANCEL_COMPLETE,streamId:N,success:!0})},function(R){B.postMessage({sourceName:W,targetName:j,stream:vB.CANCEL_COMPLETE,streamId:N,reason:qe(R)})}),U.sinkCapability.reject(qe(R.reason)),U.isCancelled=!0,delete this.streamSinks[N];break;default:throw Error("Unexpected stream case")}},rf=new WeakSet,rg=async function(R,N){var W,j,B;await Promise.allSettled([null==(W=R.startCall)?void 0:W.promise,null==(j=R.pullCall)?void 0:j.promise,null==(B=R.cancelCall)?void 0:B.promise]),delete this.streamControllers[N]};let mk=class mk{constructor({parsedData:R,rawData:N}){m(this,rm,void 0),m(this,ry,void 0),w(this,rm,R),w(this,ry,N)}getRaw(){return a(this,ry)}get(R){return a(this,rm).get(R)??null}getAll(){return h0(a(this,rm))}has(R){return a(this,rm).has(R)}};
222rm=new WeakMap,ry=new WeakMap;let v$=Symbol("INTERNAL");let vk=class vk{constructor(R,{name:N,intent:W,usage:j}){m(this,rA,!1),m(this,rx,!1),m(this,r_,!1),m(this,rS,!0),w(this,rA,!!(R&mQ.DISPLAY)),w(this,rx,!!(R&mQ.PRINT)),this.name=N,this.intent=W,this.usage=j}get visible(){if(a(this,r_))return a(this,rS);if(!a(this,rS))return!1;let{print:R,view:N}=this.usage;return a(this,rA)?(null==N?void 0:N.viewState)!=="OFF":!a(this,rx)||(null==R?void 0:R.printState)!=="OFF"}_setVisible(R,N,W=!1){R!==v$&&Dt("Internal method `_setVisible` called."),w(this,r_,W),w(this,rS,N)}};rA=new WeakMap,rx=new WeakMap,r_=new WeakMap,rS=new WeakMap;let yk=class yk{constructor(R,N=mQ.DISPLAY){if(m(this,rT),m(this,rE,null),m(this,rk,new Map),m(this,rC,null),m(this,rM,null),this.renderingIntent=N,this.name=null,this.creator=null,null!==R){for(let W of(this.name=R.name,this.creator=R.creator,w(this,rM,R.order),R.groups))a(this,rk).set(W.id,new vk(N,W));if("OFF"===R.baseState)for(let R of a(this,rk).values())R._setVisible(v$,!1);for(let N of R.on)a(this,rk).get(N)._setVisible(v$,!0);for(let N of R.off)a(this,rk).get(N)._setVisible(v$,!1);w(this,rC,this.getHash())}}isVisible(R){if(0===a(this,rk).size)return!0;if(!R)return cp("Optional content group not defined."),!0;if("OCG"===R.type)return a(this,rk).has(R.id)?a(this,rk).get(R.id).visible:(vt(`Optional content group not found: ${R.id}`),!0);if("OCMD"===R.type){if(R.expression)return A(this,rT,rR).call(this,R.expression);if(R.policy&&"AnyOn"!==R.policy){if("AllOn"===R.policy){for(let N of R.ids){if(!a(this,rk).has(N))return vt(`Optional content group not found: ${N}`),!0;if(!a(this,rk).get(N).visible)return!1}return!0}if("AnyOff"===R.policy){for(let N of R.ids){if(!a(this,rk).has(N))return vt(`Optional content group not found: ${N}`),!0;if(!a(this,rk).get(N).visible)return!0}return!1}if("AllOff"===R.policy){for(let N of R.ids){if(!a(this,rk).has(N))return vt(`Optional content group not found: ${N}`),!0;if(a(this,rk).get(N).visible)return!1}return!0}}else{for(let N of R.ids){if(!a(this,rk).has(N))return vt(`Optional content group not found: ${N}`),!0;if(a(this,rk).get(N).visible)return!0}return!1}return vt(`Unknown optional content policy ${R.policy}.`),!0}return vt(`Unknown group type ${R.type}.`),!0}setVisibility(R,N=!0){let W=a(this,rk).get(R);if(!W){vt(`Optional content group not found: ${R}`);return}W._setVisible(v$,!!N,!0),w(this,rE,null)}setOCGState({state:R,preserveRB:N}){let W;for(let N of R){switch(N){case"ON":case"OFF":case"Toggle":W=N;continue}let R=a(this,rk).get(N);if(R)switch(W){case"ON":R._setVisible(v$,!0);break;case"OFF":R._setVisible(v$,!1);break;case"Toggle":R._setVisible(v$,!R.visible)}}w(this,rE,null)}get hasInitialVisibility(){return null===a(this,rC)||this.getHash()===a(this,rC)}getOrder(){return a(this,rk).size?a(this,rM)?a(this,rM).slice():[...a(this,rk).keys()]:null}getGroups(){return a(this,rk).size>0?h0(a(this,rk)):null}getGroup(R){return a(this,rk).get(R)||null}getHash(){if(null!==a(this,rE))return a(this,rE);let R=new Kb;for(let[N,W]of a(this,rk))R.update(`${N}:${W.visible}`);return w(this,rE,R.hexdigest())}};rE=new WeakMap,rk=new WeakMap,rC=new WeakMap,rM=new WeakMap,rT=new WeakSet,rR=function(R){let N=R.length;if(N<2)return!0;let W=R[0];for(let j=1;j<N;j++){let N;let B=R[j];if(Array.isArray(B))N=A(this,rT,rR).call(this,B);else{if(!a(this,rk).has(B))return vt(`Optional content group not found: ${B}`),!0;N=a(this,rk).get(B).visible}switch(W){case"And":if(!N)return!1;break;case"Or":if(N)return!0;break;case"Not":return!N;default:return!0}}return"And"===W};let bk=class bk{constructor(R,{disableRange:N=!1,disableStream:W=!1}){ae(R,'PDFDataTransportStream - missing required "pdfDataRangeTransport" argument.');let{length:j,initialData:B,progressiveDone:z,contentDispositionFilename:U}=R;if(this._queuedChunks=[],this._progressiveDone=z,this._contentDispositionFilename=U,(null==B?void 0:B.length)>0){let R=B instanceof Uint8Array&&B.byteLength===B.buffer.byteLength?B.buffer:new Uint8Array(B).buffer;this._queuedChunks.push(R)}this._pdfDataRangeTransport=R,this._isStreamingSupported=!W,this._isRangeSupported=!N,this._contentLength=j,this._fullRequestReader=null,this._rangeReaders=[],R.addRangeListener((R,N)=>{this._onReceiveData({begin:R,chunk:N})}),R.addProgressListener((R,N)=>{this._onProgress({loaded:R,total:N})}),R.addProgressiveReadListener(R=>{this._onReceiveData({chunk:R})}),R.addProgressiveDoneListener(()=>{this._onProgressiveDone()}),R.transportReady()}_onReceiveData({begin:R,chunk:N}){let W=N instanceof Uint8Array&&N.byteLength===N.buffer.byteLength?N.buffer:new Uint8Array(N).buffer;if(void 0===R)this._fullRequestReader?this._fullRequestReader._enqueue(W):this._queuedChunks.push(W);else{let N=this._rangeReaders.some(function(N){return N._begin===R&&(N._enqueue(W),!0)});ae(N,"_onReceiveData - no `PDFDataTransportStreamRangeReader` instance found.")}}get _progressiveDataLength(){var R;return(null==(R=this._fullRequestReader)?void 0:R._loaded)??0}_onProgress(R){var N,W,j,B;void 0===R.total?null==(W=null==(N=this._rangeReaders[0])?void 0:N.onProgress)||W.call(N,{loaded:R.loaded}):null==(B=null==(j=this._fullRequestReader)?void 0:j.onProgress)||B.call(j,{loaded:R.loaded,total:R.total})}_onProgressiveDone(){var R;null==(R=this._fullRequestReader)||R.progressiveDone(),this._progressiveDone=!0}_removeRangeReader(R){let N=this._rangeReaders.indexOf(R);N>=0&&this._rangeReaders.splice(N,1)}getFullReader(){ae(!this._fullRequestReader,"PDFDataTransportStream.getFullReader can only be called once.");let R=this._queuedChunks;return this._queuedChunks=null,new wk(this,R,this._progressiveDone,this._contentDispositionFilename)}getRangeReader(R,N){if(N<=this._progressiveDataLength)return null;let W=new Ak(this,R,N);return this._pdfDataRangeTransport.requestDataRange(R,N),this._rangeReaders.push(W),W}cancelAllRequests(R){var N;for(let W of(null==(N=this._fullRequestReader)||N.cancel(R),this._rangeReaders.slice(0)))W.cancel(R);this._pdfDataRangeTransport.abort()}};let wk=class wk{constructor(R,N,W=!1,j=null){for(let B of(this._stream=R,this._done=W||!1,this._filename=g0(j)?j:null,this._queuedChunks=N||[],this._loaded=0,this._queuedChunks))this._loaded+=B.byteLength;
222this._requests=[],this._headersReady=Promise.resolve(),R._fullRequestReader=this,this.onProgress=null}_enqueue(R){this._done||(this._requests.length>0?this._requests.shift().resolve({value:R,done:!1}):this._queuedChunks.push(R),this._loaded+=R.byteLength)}get headersReady(){return this._headersReady}get filename(){return this._filename}get isRangeSupported(){return this._stream._isRangeSupported}get isStreamingSupported(){return this._stream._isStreamingSupported}get contentLength(){return this._stream._contentLength}async read(){if(this._queuedChunks.length>0)return{value:this._queuedChunks.shift(),done:!1};if(this._done)return{value:void 0,done:!0};let R=Promise.withResolvers();return this._requests.push(R),R.promise}cancel(R){for(let R of(this._done=!0,this._requests))R.resolve({value:void 0,done:!0});this._requests.length=0}progressiveDone(){this._done||(this._done=!0)}};let Ak=class Ak{constructor(R,N,W){this._stream=R,this._begin=N,this._end=W,this._queuedChunk=null,this._requests=[],this._done=!1,this.onProgress=null}_enqueue(R){if(!this._done){if(0===this._requests.length)this._queuedChunk=R;else{for(let N of(this._requests.shift().resolve({value:R,done:!1}),this._requests))N.resolve({value:void 0,done:!0});this._requests.length=0}this._done=!0,this._stream._removeRangeReader(this)}}get isStreamingSupported(){return!1}async read(){if(this._queuedChunk){let R=this._queuedChunk;return this._queuedChunk=null,{value:R,done:!1}}if(this._done)return{value:void 0,done:!0};let R=Promise.withResolvers();return this._requests.push(R),R.promise}cancel(R){for(let R of(this._done=!0,this._requests))R.resolve({value:void 0,done:!0});this._requests.length=0,this._stream._removeRangeReader(this)}};function y0({getResponseHeader:R,isHttp:N,rangeChunkSize:W,disableRange:j}){let B={allowRangeRequests:!1,suggestedLength:void 0},z=parseInt(R("Content-Length"),10);return!Number.isInteger(z)||(B.suggestedLength=z,z<=2*W)||j||!N||"bytes"!==R("Accept-Ranges")||"identity"!==(R("Content-Encoding")||"identity")||(B.allowRangeRequests=!0),B}function b0(R){let N=R("Content-Disposition");if(N){let R=function(R){let N=!0,W=n("filename\\*","i").exec(R);if(W){let R=l(W=W[1]);return s(R=d(R=c(R=unescape(R))))}if(W=function(R){let N;let W=[],j=n("filename\\*((?!0\\d)\\d+)(\\*?)","ig");for(;null!==(N=j.exec(R));){let[,R,j,B]=N;if((R=parseInt(R,10))in W){if(0===R)break;continue}W[R]=[j,B]}let B=[];for(let R=0;R<W.length&&(R in W);++R){let[N,j]=W[R];j=l(j),N&&(j=unescape(j),0===R&&(j=c(j))),B.push(j)}return B.join("")}(R)){let R=d(W);return s(R)}if(W=n("filename","i").exec(R)){let R=l(W=W[1]);return s(R=d(R))}function n(R,N){return RegExp("(?:^|;)\\s*"+R+'\\s*=\\s*([^";\\s][^;\\s]*|"(?:[^"\\\\]|\\\\"?)+"?)',N)}function i(R,W){if(R){if(!/^[\x00-\xFF]+$/.test(W))return W;try{let j=new TextDecoder(R,{fatal:!0}),B=dp(W);W=j.decode(B),N=!1}catch{}}return W}function s(R){return N&&/[\x80-\xff]/.test(R)&&(R=i("utf-8",R),N&&(R=i("iso-8859-1",R))),R}function l(R){if(R.startsWith('"')){let N=R.slice(1).split('\\"');for(let R=0;R<N.length;++R){let W=N[R].indexOf('"');-1!==W&&(N[R]=N[R].slice(0,W),N.length=R+1),N[R]=N[R].replaceAll(/\\(.)/g,"$1")}R=N.join('"')}return R}function c(R){let N=R.indexOf("'");if(-1===N)return R;let W=R.slice(0,N),j=R.slice(N+1).replace(/^[^']*'/,"");return i(W,j)}function d(R){return!R.startsWith("=?")||/[\x00-\x19\x80-\xff]/.test(R)?R:R.replaceAll(/=\?([\w-]*)\?([QqBb])\?((?:[^?]|\?(?!=))*)\?=/g,function(R,N,W,j){if("q"===W||"Q"===W)return i(N,j=(j=j.replaceAll("_"," ")).replaceAll(/=([0-9a-fA-F]{2})/g,function(R,N){return String.fromCharCode(parseInt(N,16))}));try{j=atob(j)}catch{}return i(N,j)})}return""}(N);if(R.includes("%"))try{R=decodeURIComponent(R)}catch{}if(g0(R))return R}return null}function vp(R,N){return 404===R||0===R&&N.startsWith("file:")?new ao('Missing PDF "'+N+'".'):new hp(`Unexpected server response (${R}) while retrieving PDF "${N}".`,R)}function nw(R){return 200===R||206===R}function iw(R,N,W){return{method:"GET",headers:R,signal:W.signal,mode:"cors",credentials:N?"include":"same-origin",redirect:"follow"}}function rw(R){let N=new Headers;for(let W in R){let j=R[W];void 0!==j&&N.append(W,j)}return N}function sw(R){return R instanceof Uint8Array?R.buffer:R instanceof ArrayBuffer?R:(vt(`getArrayBuffer - unexpected data format: ${R}`),new Uint8Array(R).buffer)}let Iv=class Iv{constructor(R){this.source=R,this.isHttp=/^https?:/i.test(R.url),this.httpHeaders=this.isHttp&&R.httpHeaders||{},this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){var R;return(null==(R=this._fullRequestReader)?void 0:R._loaded)??0}getFullReader(){return ae(!this._fullRequestReader,"PDFFetchStream.getFullReader can only be called once."),this._fullRequestReader=new _k(this),this._fullRequestReader}getRangeReader(R,N){if(N<=this._progressiveDataLength)return null;let W=new Sk(this,R,N);return this._rangeRequestReaders.push(W),W}cancelAllRequests(R){var N;for(let W of(null==(N=this._fullRequestReader)||N.cancel(R),this._rangeRequestReaders.slice(0)))W.cancel(R)}};let _k=class _k{constructor(R){this._stream=R,this._reader=null,this._loaded=0,this._filename=null;let N=R.source;this._withCredentials=N.withCredentials||!1,this._contentLength=N.length,this._headersCapability=Promise.withResolvers(),this._disableRange=N.disableRange||!1,this._rangeChunkSize=N.rangeChunkSize,this._rangeChunkSize||this._disableRange||(this._disableRange=!0),this._abortController=new AbortController,this._isStreamingSupported=!N.disableStream,this._isRangeSupported=!N.disableRange,this._headers=rw(this._stream.httpHeaders);let W=N.url;fetch(W,iw(this._headers,this._withCredentials,this._abortController)).then(R=>{if(!nw(R.status))throw vp(R.status,W);this._reader=R.body.getReader(),this._headersCapability.resolve();let s=N=>R.headers.get(N),{allowRangeRequests:N,suggestedLength:j}=y0({getResponseHeader:s,isHttp:this._stream.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=N,this._contentLength=j||this._contentLength,this._filename=b0(s),!this._isStreamingSupported&&this._isRangeSupported&&this.cancel(new lo("Streaming is disabled."))}).catch(this._headersCapability.reject),this.onProgress=null}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}async read(){var R;await this._headersCapability.promise;let{value:N,done:W}=await this._reader.read();return W?{value:N,done:W}:(this._loaded+=N.byteLength,null==(R=this.onProgress)||R.call(this,{loaded:this._loaded,total:this._contentLength}),{value:sw(N),done:!1})}cancel(R){var N;null==(N=this._reader)||N.cancel(R),this._abortController.abort()}};let Sk=class Sk{constructor(R,N,W){this._stream=R,this._reader=null,this._loaded=0;let j=R.source;this._withCredentials=j.withCredentials||!1,this._readCapability=Promise.withResolvers(),this._isStreamingSupported=!j.disableStream,this._abortController=new AbortController,this._headers=rw(this._stream.httpHeaders),this._headers.append("Range",`bytes=${N}-${W-1}`);let B=j.url;fetch(B,iw(this._headers,this._withCredentials,this._abortController)).then(R=>{if(!nw(R.status))throw vp(R.status,B);this._readCapability.resolve(),this._reader=R.body.getReader()}).catch(this._readCapability.reject),this.onProgress=null}get isStreamingSupported(){return this._isStreamingSupported}async read(){var R;await this._readCapability.promise;let{value:N,done:W}=await this._reader.read();return W?{value:N,done:W}:(this._loaded+=N.byteLength,null==(R=this.onProgress)||R.call(this,{loaded:this._loaded}),{value:sw(N),done:!1})}cancel(R){var N;null==(N=this._reader)||N.cancel(R),this._abortController.abort()}};let Ck=class Ck{constructor(R,N={}){this.url=R,this.isHttp=/^https?:/i.test(R),this.httpHeaders=this.isHttp&&N.httpHeaders||Object.create(null),this.withCredentials=N.withCredentials||!1,this.currXhrId=0,this.pendingRequests=Object.create(null)}requestRange(R,N,W){let j={begin:R,end:N};for(let R in W)j[R]=W[R];return this.request(j)}requestFull(R){return this.request(R)}request(R){let N=new XMLHttpRequest,W=this.currXhrId++,j=this.pendingRequests[W]={xhr:N};for(let R in N.open("GET",this.url),N.withCredentials=this.withCredentials,this.httpHeaders){let W=this.httpHeaders[R];void 0!==W&&N.setRequestHeader(R,W)}return this.isHttp&&"begin"in R&&"end"in R?(N.setRequestHeader("Range",`bytes=${R.begin}-${R.end-1}`),j.expectedStatus=206):j.expectedStatus=200,N.responseType="arraybuffer",R.onError&&(N.onerror=function(W){R.onError(N.status)}),N.onreadystatechange=this.onStateChange.bind(this,W),N.onprogress=this.onProgress.bind(this,W),j.onHeadersReceived=R.onHeadersReceived,j.onDone=R.onDone,j.onError=R.onError,j.onProgress=R.onProgress,N.send(null),W}onProgress(R,N){var W;let j=this.pendingRequests[R];j&&(null==(W=j.onProgress)||W.call(j,N))}onStateChange(R,N){var W,j,B;let z=this.pendingRequests[R];if(!z)return;let U=z.xhr;if(U.readyState>=2&&z.onHeadersReceived&&(z.onHeadersReceived(),delete z.onHeadersReceived),4!==U.readyState||!(R in this.pendingRequests))return;if(delete this.pendingRequests[R],0===U.status&&this.isHttp){null==(W=z.onError)||W.call(z,U.status);return}let V=U.status||200;if(!(200===V&&206===z.expectedStatus)&&V!==z.expectedStatus){null==(j=z.onError)||j.call(z,U.status);return}let G=function(R){let N=R.response;return"string"!=typeof N?N:dp(N).buffer}(U);if(206===V){let R=U.getResponseHeader("Content-Range"),N=/bytes (\d+)-(\d+)\/(\d+)/.exec(R);z.onDone({begin:parseInt(N[1],10),chunk:G})}else G?z.onDone({begin:0,chunk:G}):null==(B=z.onError)||B.call(z,U.status)}getRequestXhr(R){return this.pendingRequests[R].xhr}isPendingRequest(R){return R in this.pendingRequests}
222abortRequest(R){let N=this.pendingRequests[R].xhr;delete this.pendingRequests[R],N.abort()}};let Tk=class Tk{constructor(R){this._source=R,this._manager=new Ck(R.url,{httpHeaders:R.httpHeaders,withCredentials:R.withCredentials}),this._rangeChunkSize=R.rangeChunkSize,this._fullRequestReader=null,this._rangeRequestReaders=[]}_onRangeRequestReaderClosed(R){let N=this._rangeRequestReaders.indexOf(R);N>=0&&this._rangeRequestReaders.splice(N,1)}getFullReader(){return ae(!this._fullRequestReader,"PDFNetworkStream.getFullReader can only be called once."),this._fullRequestReader=new Pk(this._manager,this._source),this._fullRequestReader}getRangeReader(R,N){let W=new Rk(this._manager,R,N);return W.onClosed=this._onRangeRequestReaderClosed.bind(this),this._rangeRequestReaders.push(W),W}cancelAllRequests(R){var N;for(let W of(null==(N=this._fullRequestReader)||N.cancel(R),this._rangeRequestReaders.slice(0)))W.cancel(R)}};let Pk=class Pk{constructor(R,N){this._manager=R;let W={onHeadersReceived:this._onHeadersReceived.bind(this),onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=N.url,this._fullRequestId=R.requestFull(W),this._headersReceivedCapability=Promise.withResolvers(),this._disableRange=N.disableRange||!1,this._contentLength=N.length,this._rangeChunkSize=N.rangeChunkSize,this._rangeChunkSize||this._disableRange||(this._disableRange=!0),this._isStreamingSupported=!1,this._isRangeSupported=!1,this._cachedChunks=[],this._requests=[],this._done=!1,this._storedError=void 0,this._filename=null,this.onProgress=null}_onHeadersReceived(){let R=this._fullRequestId,N=this._manager.getRequestXhr(R),n=R=>N.getResponseHeader(R),{allowRangeRequests:W,suggestedLength:j}=y0({getResponseHeader:n,isHttp:this._manager.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});W&&(this._isRangeSupported=!0),this._contentLength=j||this._contentLength,this._filename=b0(n),this._isRangeSupported&&this._manager.abortRequest(R),this._headersReceivedCapability.resolve()}_onDone(R){if(R&&(this._requests.length>0?this._requests.shift().resolve({value:R.chunk,done:!1}):this._cachedChunks.push(R.chunk)),this._done=!0,!(this._cachedChunks.length>0)){for(let R of this._requests)R.resolve({value:void 0,done:!0});this._requests.length=0}}_onError(R){for(let N of(this._storedError=vp(R,this._url),this._headersReceivedCapability.reject(this._storedError),this._requests))N.reject(this._storedError);this._requests.length=0,this._cachedChunks.length=0}_onProgress(R){var N;null==(N=this.onProgress)||N.call(this,{loaded:R.loaded,total:R.lengthComputable?R.total:this._contentLength})}get filename(){return this._filename}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}get contentLength(){return this._contentLength}get headersReady(){return this._headersReceivedCapability.promise}async read(){if(this._storedError)throw this._storedError;if(this._cachedChunks.length>0)return{value:this._cachedChunks.shift(),done:!1};if(this._done)return{value:void 0,done:!0};let R=Promise.withResolvers();return this._requests.push(R),R.promise}cancel(R){for(let N of(this._done=!0,this._headersReceivedCapability.reject(R),this._requests))N.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._fullRequestId)&&this._manager.abortRequest(this._fullRequestId),this._fullRequestReader=null}};let Rk=class Rk{constructor(R,N,W){this._manager=R;let j={onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=R.url,this._requestId=R.requestRange(N,W,j),this._requests=[],this._queuedChunk=null,this._done=!1,this._storedError=void 0,this.onProgress=null,this.onClosed=null}_close(){var R;null==(R=this.onClosed)||R.call(this,this)}_onDone(R){let N=R.chunk;for(let R of(this._requests.length>0?this._requests.shift().resolve({value:N,done:!1}):this._queuedChunk=N,this._done=!0,this._requests))R.resolve({value:void 0,done:!0});this._requests.length=0,this._close()}_onError(R){for(let N of(this._storedError=vp(R,this._url),this._requests))N.reject(this._storedError);this._requests.length=0,this._queuedChunk=null}_onProgress(R){var N;this.isStreamingSupported||null==(N=this.onProgress)||N.call(this,{loaded:R.loaded})}get isStreamingSupported(){return!1}async read(){if(this._storedError)throw this._storedError;if(null!==this._queuedChunk){let R=this._queuedChunk;return this._queuedChunk=null,{value:R,done:!1}}if(this._done)return{value:void 0,done:!0};
222let R=Promise.withResolvers();return this._requests.push(R),R.promise}cancel(R){for(let R of(this._done=!0,this._requests))R.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._requestId)&&this._manager.abortRequest(this._requestId),this._close()}};let vz=/^file:\/\/\/[a-zA-Z]:\//;let Lk=class Lk{constructor(R){this.source=R,this.url=function(R){let N=ni.get("url"),W=N.parse(R);return"file:"===W.protocol||W.host?W:/^[a-z]:[/\\]/i.test(R)?N.parse(`file:///${R}`):(W.host||(W.protocol="file:"),W)}(R.url),this.isHttp="http:"===this.url.protocol||"https:"===this.url.protocol,this.isFsUrl="file:"===this.url.protocol,this.httpHeaders=this.isHttp&&R.httpHeaders||{},this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){var R;return(null==(R=this._fullRequestReader)?void 0:R._loaded)??0}getFullReader(){return ae(!this._fullRequestReader,"PDFNodeStream.getFullReader can only be called once."),this._fullRequestReader=this.isFsUrl?new Mk(this):new Ik(this),this._fullRequestReader}getRangeReader(R,N){if(N<=this._progressiveDataLength)return null;let W=this.isFsUrl?new Dk(this,R,N):new Fk(this,R,N);return this._rangeRequestReaders.push(W),W}cancelAllRequests(R){var N;for(let W of(null==(N=this._fullRequestReader)||N.cancel(R),this._rangeRequestReaders.slice(0)))W.cancel(R)}};let aw=class aw{constructor(R){this._url=R.url,this._done=!1,this._storedError=null,this.onProgress=null;let N=R.source;this._contentLength=N.length,this._loaded=0,this._filename=null,this._disableRange=N.disableRange||!1,this._rangeChunkSize=N.rangeChunkSize,this._rangeChunkSize||this._disableRange||(this._disableRange=!0),this._isStreamingSupported=!N.disableStream,this._isRangeSupported=!N.disableRange,this._readableStream=null,this._readCapability=Promise.withResolvers(),this._headersCapability=Promise.withResolvers()}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}async read(){var R;if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;let N=this._readableStream.read();return null===N?(this._readCapability=Promise.withResolvers(),this.read()):(this._loaded+=N.length,null==(R=this.onProgress)||R.call(this,{loaded:this._loaded,total:this._contentLength}),{value:new Uint8Array(N).buffer,done:!1})}cancel(R){if(!this._readableStream){this._error(R);return}this._readableStream.destroy(R)}_error(R){this._storedError=R,this._readCapability.resolve()}_setReadableStream(R){this._readableStream=R,R.on("readable",()=>{this._readCapability.resolve()}),R.on("end",()=>{R.destroy(),this._done=!0,this._readCapability.resolve()}),R.on("error",R=>{this._error(R)}),!this._isStreamingSupported&&this._isRangeSupported&&this._error(new lo("streaming is disabled")),this._storedError&&this._readableStream.destroy(this._storedError)}};let lw=class lw{constructor(R){this._url=R.url,this._done=!1,this._storedError=null,this.onProgress=null,this._loaded=0,this._readableStream=null,this._readCapability=Promise.withResolvers();let N=R.source;this._isStreamingSupported=!N.disableStream}get isStreamingSupported(){return this._isStreamingSupported}async read(){var R;if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;let N=this._readableStream.read();return null===N?(this._readCapability=Promise.withResolvers(),this.read()):(this._loaded+=N.length,null==(R=this.onProgress)||R.call(this,{loaded:this._loaded}),{value:new Uint8Array(N).buffer,done:!1})}cancel(R){if(!this._readableStream){this._error(R);return}this._readableStream.destroy(R)}_error(R){this._storedError=R,this._readCapability.resolve()}_setReadableStream(R){this._readableStream=R,R.on("readable",()=>{this._readCapability.resolve()}),R.on("end",()=>{R.destroy(),this._done=!0,this._readCapability.resolve()}),R.on("error",R=>{this._error(R)}),this._storedError&&this._readableStream.destroy(this._storedError)}};function su(R,N){return{protocol:R.protocol,auth:R.auth,host:R.hostname,port:R.port,path:R.path,method:"GET",headers:N}}let Ik=class Ik extends aw{constructor(R){super(R);let e=N=>{if(404===N.statusCode){let R=new ao(`Missing PDF "${this._url}".`);this._storedError=R,this._headersCapability.reject(R);return}this._headersCapability.resolve(),this._setReadableStream(N);let i=R=>this._readableStream.headers[R.toLowerCase()],{allowRangeRequests:W,suggestedLength:j}=y0({getResponseHeader:i,isHttp:R.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=W,this._contentLength=j||this._contentLength,this._filename=b0(i)};if(this._request=null,"http:"===this._url.protocol){let N=ni.get("http");this._request=N.request(su(this._url,R.httpHeaders),e)}else{let N=ni.get("https");this._request=N.request(su(this._url,R.httpHeaders),e)}this._request.on("error",R=>{this._storedError=R,this._headersCapability.reject(R)}),this._request.end()}};let Fk=class Fk extends lw{constructor(R,N,W){for(let N in super(R),this._httpHeaders={},R.httpHeaders){let W=R.httpHeaders[N];void 0!==W&&(this._httpHeaders[N]=W)}this._httpHeaders.Range=`bytes=${N}-${W-1}`;let i=R=>
222{if(404===R.statusCode){let R=new ao(`Missing PDF "${this._url}".`);this._storedError=R;return}this._setReadableStream(R)};if(this._request=null,"http:"===this._url.protocol){let R=ni.get("http");this._request=R.request(su(this._url,this._httpHeaders),i)}else{let R=ni.get("https");this._request=R.request(su(this._url,this._httpHeaders),i)}this._request.on("error",R=>{this._storedError=R}),this._request.end()}};let Mk=class Mk extends aw{constructor(R){super(R);let N=decodeURIComponent(this._url.path);vz.test(this._url.href)&&(N=N.replace(/^\//,""));let W=ni.get("fs");W.promises.lstat(N).then(R=>{this._contentLength=R.size,this._setReadableStream(W.createReadStream(N)),this._headersCapability.resolve()},R=>{"ENOENT"===R.code&&(R=new ao(`Missing PDF "${N}".`)),this._storedError=R,this._headersCapability.reject(R)})}};let Dk=class Dk extends lw{constructor(R,N,W){super(R);let j=decodeURIComponent(this._url.path);vz.test(this._url.href)&&(j=j.replace(/^\//,""));let B=ni.get("fs");this._setReadableStream(B.createReadStream(j,{start:N,end:W-1}))}};let vH=(rJ=class{constructor({textContentSource:R,container:N,viewport:W}){if(m(this,r5),m(this,r6),m(this,r7),m(this,rD,Promise.withResolvers()),m(this,rN,null),m(this,rO,!1),m(this,rF,!!(null!=(rI=globalThis.FontInspector)&&rI.enabled)),m(this,rW,null),m(this,rj,null),m(this,rB,0),m(this,r$,0),m(this,rz,null),m(this,rH,null),m(this,rU,0),m(this,rV,0),m(this,rG,Object.create(null)),m(this,rq,[]),m(this,rX,null),m(this,rY,[]),m(this,rK,new WeakMap),m(this,rQ,null),R instanceof ReadableStream)w(this,rX,R);else if("object"==typeof R)w(this,rX,new ReadableStream({start(N){N.enqueue(R),N.close()}}));else throw Error('No "textContentSource" parameter specified.');w(this,rN,w(this,rH,N)),w(this,rV,W.scale*(globalThis.devicePixelRatio||1)),w(this,rU,W.rotation),w(this,rj,{prevFontSize:null,prevFontFamily:null,div:null,properties:null,ctx:null});let{pageWidth:j,pageHeight:B,pageX:z,pageY:U}=W.rawDims;w(this,rQ,[1,0,0,-1,-z,U+B]),w(this,r$,j),w(this,rB,B),to(N,W),a(this,rD).promise.catch(()=>{}).then(()=>{a(rJ,r3).delete(this),w(this,rj,null),w(this,rG,null)})}render(){let t=()=>{a(this,rz).read().then(({value:R,done:N})=>{if(N){a(this,rD).resolve();return}a(this,rW)??w(this,rW,R.lang),Object.assign(a(this,rG),R.styles),A(this,r5,r4).call(this,R.items),t()},a(this,rD).reject)};return w(this,rz,a(this,rX).getReader()),a(rJ,r3).add(this),t(),a(this,rD).promise}update({viewport:R,onBefore:N=null}){let W=R.scale*(globalThis.devicePixelRatio||1),j=R.rotation;if(j!==a(this,rU)&&(null==N||N(),w(this,rU,j),to(a(this,rH),{rotation:j})),W!==a(this,rV)){null==N||N(),w(this,rV,W);let R={prevFontSize:null,prevFontFamily:null,div:null,properties:null,ctx:A(rJ,se,si).call(rJ,a(this,rW))};for(let N of a(this,rY))R.properties=a(this,rK).get(N),R.div=N,A(this,r7,r9).call(this,R)}}cancel(){var R;let N=new lo("TextLayer task cancelled.");null==(R=a(this,rz))||R.cancel(N).catch(()=>{}),w(this,rz,null),a(this,rD).reject(N)}get textDivs(){return a(this,rY)}get textContentItemsStr(){return a(this,rq)}static cleanup(){if(!(a(this,r3).size>0)){for(let{canvas:R}of(a(this,rZ).clear(),a(this,r1).values()))R.remove();a(this,r1).clear()}}},rD=new WeakMap,rN=new WeakMap,rO=new WeakMap,rF=new WeakMap,rW=new WeakMap,rj=new WeakMap,rB=new WeakMap,r$=new WeakMap,rz=new WeakMap,rH=new WeakMap,rU=new WeakMap,rV=new WeakMap,rG=new WeakMap,rq=new WeakMap,rX=new WeakMap,rY=new WeakMap,rK=new WeakMap,rQ=new WeakMap,rZ=new WeakMap,r1=new WeakMap,r3=new WeakMap,r5=new WeakSet,r4=function(R){var N;if(a(this,rO))return;(N=a(this,rj)).ctx||(N.ctx=A(rJ,se,si).call(rJ,a(this,rW)));let W=a(this,rY),j=a(this,rq);for(let N of R){if(W.length>1e5){vt("Ignoring additional textDivs for performance reasons."),w(this,rO,!0);return}if(void 0===N.str){if("beginMarkedContentProps"===N.type||"beginMarkedContent"===N.type){let R=a(this,rN);w(this,rN,document.createElement("span")),a(this,rN).classList.add("markedContent"),null!==N.id&&a(this,rN).setAttribute("id",`${N.id}`),R.append(a(this,rN))}else"endMarkedContent"===N.type&&w(this,rN,a(this,rN).parentNode);continue}j.push(N.str),A(this,r6,r8).call(this,N)}},r6=new WeakSet,r8=function(R){let N,W;let j=document.createElement("span"),B={angle:0,canvasWidth:0,hasText:""!==R.str,hasEOL:R.hasEOL,fontSize:0};a(this,rY).push(j);let z=Q.transform(a(this,rQ),R.transform),U=Math.atan2(z[1],z[0]),V=a(this,rG)[R.fontName];V.vertical&&(U+=Math.PI/2);let G=a(this,rF)&&V.fontSubstitution||V.fontFamily,Y=Math.hypot(z[2],z[3]),Z=Y*A(rJ,sr,ss).call(rJ,G,a(this,rW));0===U?(N=z[4],W=z[5]-Z):(N=z[4]+Z*Math.sin(U),W=z[5]-Z*Math.cos(U));let te="calc(var(--scale-factor)*",tn=j.style;a(this,rN)===a(this,rH)?(tn.left=`${(100*N/a(this,r$)).toFixed(2)}%`,tn.top=`${(100*W/a(this,rB)).toFixed(2)}%`):(tn.left=`${te}${N.toFixed(2)}px)`,tn.top=`${te}${W.toFixed(2)}px)`),tn.fontSize=`${te}${Y.toFixed(2)}px)`,tn.fontFamily=G,B.fontSize=Y,j.setAttribute("role","presentation"),j.textContent=R.str,j.dir=R.dir,a(this,rF)&&(j.dataset.fontName=V.fontSubstitutionLoadedName||R.fontName),0!==U&&(B.angle=U*(180/Math.PI));let tr=!1;if(R.str.length>1)tr=!0;else if(" "!==R.str&&R.transform[0]!==R.transform[3]){let N=Math.abs(R.transform[0]),W=Math.abs(R.transform[3]);N!==W&&Math.max(N,W)/Math.min(N,W)>1.5&&(tr=!0)}if(tr&&(B.canvasWidth=V.vertical?R.height:R.width),a(this,rK).set(j,B),a(this,rj).div=j,a(this,rj).properties=B,A(this,r7,r9).call(this,a(this,rj)),B.hasText&&a(this,rN).append(j),B.hasEOL){let R=document.createElement("br");R.setAttribute("role","presentation"),a(this,rN).append(R)}},r7=new WeakSet,r9=function(R){let{div:N,properties:W,ctx:j,prevFontSize:B,prevFontFamily:z}=R,{style:U}=N,V="";if(0!==W.canvasWidth&&W.hasText){let{fontFamily:G}=U,{canvasWidth:Y,fontSize:Z}=W;(B!==Z||z!==G)&&(j.font=`${Z*a(this,rV)}px ${G}`,R.prevFontSize=Z,R.prevFontFamily=G);let{width:te}=j.measureText(N.textContent);te>0&&(V=`scaleX(${Y*a(this,rV)/te})`)}0!==W.angle&&(V=`rotate(${W.angle}deg) ${V}`),V.length>0&&(U.transform=V)},se=new WeakSet,si=function(R=null){let N=a(this,r1).get(R||(R=""));if(!N){let W=document.createElement("canvas");W.className="hiddenCanvasElement",W.lang=R,document.body.append(W),N=W.getContext("2d",{alpha:!1}),a(this,r1).set(R,N)}return N},sr=new WeakSet,ss=function(R,N){let W=a(this,rZ).get(R);if(W)return W;let j=A(this,se,si).call(this,N),B=j.font;j.canvas.width=j.canvas.height=30,j.font=`30px ${R}`;let z=j.measureText(""),U=z.fontBoundingBoxAscent,V=Math.abs(z.fontBoundingBoxDescent);if(U){let N=U/(U+V);return a(this,rZ).set(R,N),j.canvas.width=j.canvas.height=0,j.font=B,N}j.strokeStyle="red",j.clearRect(0,0,30,30),j.strokeText("g",0,0);let G=j.getImageData(0,0,30,30).data;V=0;for(let R=G.length-1-3;R>=0;R-=4)if(G[R]>0){V=Math.ceil(R/4/30);break}j.clearRect(0,0,30,30),j.strokeText("A",0,30),G=j.getImageData(0,0,30,30).data,U=0;for(let R=0,N=G.length;R<N;R+=4)if(G[R]>0){U=30-Math.floor(R/4/30);break}j.canvas.width=j.canvas.height=0,j.font=B;let Y=U?U/(U+V):.8;return a(this,rZ).set(R,Y),Y},m(rJ,se),m(rJ,sr),m(rJ,rZ,new Map),m(rJ,r1,new Map),m(rJ,r3,new Set),rJ);function Bk(){Cb("`renderTextLayer`, please use `TextLayer` instead.");let{textContentSource:R,container:N,viewport:W,...j}=arguments[0],B=Object.keys(j);B.length>0&&vt("Ignoring `renderTextLayer` parameters: "+B.join(", "));let z=new vH({textContentSource:R,container:N,viewport:W}),{textDivs:U,textContentItemsStr:V}=z;return{promise:z.render(),textDivs:U,textContentItemsStr:V}}function $k(){Cb("`updateTextLayer`, please use `TextLayer` instead.")}let Tl=class Tl{static textContent(R){let N=[],W={items:N,styles:Object.create(null)};return function i(R){var W;if(!R)return;let j=null,B=R.name;if("#text"===B)j=R.value;else{if(!Tl.shouldBuildText(B))return;null!=(W=null==R?void 0:R.attributes)&&W.textContent?j=R.attributes.textContent:R.value&&(j=R.value)}if(null!==j&&N.push({str:j}),R.children)for(let N of R.children)i(N)}(R),W}static shouldBuildText(R){return!("textarea"===R||"input"===R||"option"===R||"select"===R)}};let vU=mX?class extends fp{_createCanvas(R,N){return ni.get("canvas").createCanvas(R,N)}}:class extends fp{constructor({ownerDocument:R=globalThis.document}={}){super(),this._document=R}_createCanvas(R,N){let W=this._document.createElement("canvas");return W.width=R,W.height=N,W}},vV=mX?class extends pp{_fetchData(R,N){return Qb(R).then(R=>({cMapData:R,compressionType:N}))}}:Sb,vG=mX?class extends up{}:class extends up{constructor({docId:R,ownerDocument:N=globalThis.document}={}){super(),m(this,ty),m(this,tx),m(this,tS),m(this,tk),m(this,tM),m(this,tR),m(this,tI),m(this,tN),m(this,tF),m(this,tj),m(this,t$),m(this,tu,void 0),m(this,tp,void 0),m(this,tf,void 0),m(this,tg,void 0),m(this,tm,void 0),m(this,tw,0),w(this,tf,R),w(this,tg,N)}addFilter(R){if(!R)return"none";let N=a(this,ty,tA).get(R);if(N)return N;let[W,j,B]=A(this,tk,tC).call(this,R),z=1===R.length?W:`${W}${j}${B}`;if(N=a(this,ty,tA).get(z))return a(this,ty,tA).set(R,N),N;let U=`g_${a(this,tf)}_transfer_map_${We(this,tw)._++}`,V=`url(#${U})`;a(this,ty,tA).set(R,V),a(this,ty,tA).set(z,V);let G=A(this,tI,tD).call(this,U);return A(this,tF,tW).call(this,W,j,B,G),V}addHCMFilter(R,N){var W;let j=`${R}-${N}`,B="base",z=a(this,tx,t_).get(B);if((null==z?void 0:z.key)===j||(z?(null==(W=z.filter)||W.remove(),z.key=j,z.url="none",z.filter=null):(z={key:j,url:"none",filter:null},a(this,tx,t_).set(B,z)),!R||!N))return z.url;let U=A(this,t$,tz).call(this,R);R=Q.makeHexColor(...U);let V=A(this,t$,tz).call(this,N);if(N=Q.makeHexColor(...V),a(this,tS,tE).style.color="","#000000"===R&&"#ffffff"===N||R===N)return z.url;let G=Array(256);for(let R=0;R<=255;R++){let N=R/255;G[R]=N<=.03928?N/12.92:((N+.055)/1.055)**2.4}let Y=G.join(","),Z=`g_${a(this,tf)}_hcm_filter`,te=z.filter=A(this,tI,tD).call(this,Z);A(this,tF,tW).call(this,Y,Y,Y,te),A(this,tR,tP).call(this,te);let v=(R,N)=>{let W=U[R]/255,j=V[R]/255,B=Array(N+1);for(let R=0;R<=N;R++)B[R]=W+R/N*(j-W);return B.join(",")};return A(this,tF,tW).call(this,v(0,5),v(1,5),v(2,5),te),z.url=`url(#${Z})`,z.url}addAlphaFilter(R){let N=a(this,ty,tA).get(R);if(N)return N;let[W]=A(this,tk,tC).call(this,[R]),j=`alpha_${W}`;if(N=a(this,ty,tA).get(j))return a(this,ty,tA).set(R,N),N;let B=`g_${a(this,tf)}_alpha_map_${We(this,tw)._++}`,z=`url(#${B})`;a(this,ty,tA).set(R,z),a(this,ty,tA).set(j,z);let U=A(this,tI,tD).call(this,B);return A(this,tj,tB).call(this,W,U),z}addLuminosityFilter(R){let N,W,j=a(this,ty,tA).get(R||"luminosity");if(j)return j;if(R?([N]=A(this,tk,tC).call(this,[R]),W=`luminosity_${N}`):W="luminosity",j=a(this,ty,tA).get(W))return a(this,ty,tA).set(R,j),j;let B=`g_${a(this,tf)}_luminosity_map_${We(this,tw)._++}`,z=`url(#${B})`;a(this,ty,tA).set(R,z),a(this,ty,tA).set(W,z);let U=A(this,tI,tD).call(this,B);return A(this,tM,tT).call(this,U),R&&A(this,tj,tB).call(this,N,U),z}addHighlightHCMFilter(R,N,W,j,B){var z;let U=`${N}-${W}-${j}-${B}`,V=a(this,tx,t_).get(R);if((null==V?void 0:V.key)===U||(V?(null==(z=V.filter)||z.remove(),V.key=U,V.url="none",V.filter=null):(V={key:U,url:"none",filter:null},a(this,tx,t_).set(R,V)),!N||!W))return V.url;let[G,Y]=[N,W].map(A(this,t$,tz).bind(this)),Z=Math.round(.2126*G[0]+.7152*G[1]+.0722*G[2]),te=Math.round(.2126*Y[0]+.7152*Y[1]+.0722*Y[2]),[tn,tr]=[j,B].map(A(this,t$,tz).bind(this));te<Z&&([Z,te,tn,tr]=[te,Z,tr,tn]),a(this,tS,tE).style.color="";let E=(R,N,W)=>{let j=Array(256),B=(te-Z)/W,z=R/255,U=(N-R)/(255*W),V=0;for(let R=0;R<=W;R++){let N=Math.round(Z+R*B),W=z+R*U;for(let R=V;R<=N;R++)j[R]=W;V=N+1}for(let R=V;R<256;R++)j[R]=j[V-1];return j.join(",")},ts=`g_${a(this,tf)}_hcm_${R}_filter`,ta=V.filter=A(this,tI,tD).call(this,ts);return A(this,tR,tP).call(this,ta),A(this,tF,tW).call(this,E(tn[0],tr[0],5),E(tn[1],tr[1],5),E(tn[2],tr[2],5),ta),V.url=`url(#${ts})`,V.url}destroy(R=!1){R&&0!==a(this,tx,t_).size||(a(this,tp)&&(a(this,tp).parentNode.parentNode.remove(),w(this,tp,null)),a(this,tu)&&(a(this,tu).clear(),w(this,tu,null)),w(this,tw,0))}},vq=mX?class extends gp{_fetchData(R){return Qb(R)}}:xb;function qk(R){if("string"==typeof R||R instanceof URL?R={url:R}:(R instanceof ArrayBuffer||ArrayBuffer.isView(R))&&(R={data:R}),"object"!=typeof R)throw Error("Invalid parameter in getDocument, need parameter object.");if(!R.url&&!R.data&&!R.range)throw Error("Invalid parameter object: need either .data, .range or .url");let N=new vY,{docId:W}=N,j=R.url?function(R){if(R instanceof URL)return R.href;try{return new URL(R,window.location).href}catch{if(mX&&"string"==typeof R)return R}throw Error("Invalid PDF url data: either string or URL-object is expected in the url property.")}(R.url):null,B=R.data?function(R){if(mX&&"u">typeof mV&&R instanceof mV)throw Error("Please provide binary data as `Uint8Array`, rather than `Buffer`.");if(R instanceof Uint8Array&&R.byteLength===R.buffer.byteLength)return R;if("string"==typeof R)return dp(R);if(R instanceof ArrayBuffer||ArrayBuffer.isView(R)||"object"==typeof R&&!isNaN(null==R?void 0:R.length))return new Uint8Array(R);throw Error("Invalid PDF binary data: either TypedArray, string, or array-like object is expected in the data property.")}(R.data):null,z=R.httpHeaders||null,U=!0===R.withCredentials,V=R.password??null,G=R.range instanceof vK?R.range:null,Y=Number.isInteger(R.rangeChunkSize)&&R.rangeChunkSize>0?R.rangeChunkSize:65536,Z=R.worker instanceof vZ?R.worker:null,te=R.verbosity,tn="string"!=typeof R.docBaseUrl||p0(R.docBaseUrl)?null:R.docBaseUrl,tr="string"==typeof R.cMapUrl?R.cMapUrl:null,ts=!1!==R.cMapPacked,ta=R.CMapReaderFactory||vV,th="string"==typeof R.standardFontDataUrl?R.standardFontDataUrl:null,tc=R.StandardFontDataFactory||vq,tu=!0!==R.stopAtErrors,tp=Number.isInteger(R.maxImageSize)&&R.maxImageSize>-1?R.maxImageSize:-1,tf=!1!==R.isEvalSupported,tg="boolean"==typeof R.isOffscreenCanvasSupported?R.isOffscreenCanvasSupported:!mX,tm=Number.isInteger(R.canvasMaxAreaInBytes)?R.
222canvasMaxAreaInBytes:-1,tw="boolean"==typeof R.disableFontFace?R.disableFontFace:mX,ty=!0===R.fontExtraProperties,tA=!0===R.enableXfa,tx=R.ownerDocument||globalThis.document,t_=!0===R.disableRange,tS=!0===R.disableStream,tE=!0===R.disableAutoFetch,tk=!0===R.pdfBug,tC=G?G.length:R.length??NaN,tM="boolean"==typeof R.useSystemFonts?R.useSystemFonts:!mX&&!tw,tT="boolean"==typeof R.useWorkerFetch?R.useWorkerFetch:ta===Sb&&tc===xb&&tr&&th&&cl(tr,document.baseURI)&&cl(th,document.baseURI),tR=R.canvasFactory||new vU({ownerDocument:tx}),tP=R.filterFactory||new vG({docId:W,ownerDocument:tx});Number.isInteger(te)&&(vn=te);let tI={canvasFactory:tR,filterFactory:tP};if(tT||(tI.cMapReaderFactory=new ta({baseUrl:tr,isCompressed:ts}),tI.standardFontDataFactory=new tc({baseUrl:th})),!Z){let R={verbosity:te,port:zi.workerPort};Z=R.port?vZ.fromPort(R):new vZ(R),N._worker=Z}let tD={docId:W,apiVersion:"4.3.136",data:B,password:V,disableAutoFetch:tE,rangeChunkSize:Y,length:tC,docBaseUrl:tn,enableXfa:tA,evaluatorOptions:{maxImageSize:tp,disableFontFace:tw,ignoreErrors:tu,isEvalSupported:tf,isOffscreenCanvasSupported:tg,canvasMaxAreaInBytes:tm,fontExtraProperties:ty,useSystemFonts:tM,cMapUrl:tT?tr:null,standardFontDataUrl:tT?th:null}},tN={disableFontFace:tw,fontExtraProperties:ty,ownerDocument:tx,pdfBug:tk,styleElement:null,loadingParams:{disableAutoFetch:tE,enableXfa:tA}};return Z.promise.then(function(){var R;let V;if(N.destroyed)throw Error("Loading aborted");if(Z.destroyed)throw Error("Worker was destroyed");let te=Z.messageHandler.sendWithPromise("GetDocRequest",tD,B?[B.buffer]:null);return G?V=new bk(G,{disableRange:t_,disableStream:tS}):B||(R={url:j,length:tC,httpHeaders:z,withCredentials:U,rangeChunkSize:Y,disableRange:t_,disableStream:tS},V=mX?"u">typeof fetch&&"u">typeof Response&&"body"in Response.prototype&&cl(R.url)?new Iv(R):new Lk(R):cl(R.url)?new Iv(R):new Tk(R)),te.then(R=>{if(N.destroyed)throw Error("Loading aborted");if(Z.destroyed)throw Error("Worker was destroyed");let j=new ul(W,R,Z.port),B=new Qk(j,N,V,tN,tI);N._transport=B,j.send("Ready",null)})}).catch(N._capability.reject),N}function Fv(R){return"object"==typeof R&&Number.isInteger(null==R?void 0:R.num)&&R.num>=0&&Number.isInteger(null==R?void 0:R.gen)&&R.gen>=0}let vX=class Yu{constructor(){this._capability=Promise.withResolvers(),this._transport=null,this._worker=null,this.docId=`d${We(Yu,sa)._++}`,this.destroyed=!1,this.onPassword=null,this.onProgress=null}get promise(){return this._capability.promise}async destroy(){var R,N,W;this.destroyed=!0;try{null!=(R=this._worker)&&R.port&&(this._worker._pendingDestroy=!0),await (null==(N=this._transport)?void 0:N.destroy())}catch(R){throw null!=(W=this._worker)&&W.port&&delete this._worker._pendingDestroy,R}this._transport=null,this._worker&&(this._worker.destroy(),this._worker=null)}};m(vX,sa=new WeakMap,0);let vY=vX,vK=class{constructor(R,N,W=!1,j=null){this.length=R,this.initialData=N,this.progressiveDone=W,this.contentDispositionFilename=j,this._rangeListeners=[],this._progressListeners=[],this._progressiveReadListeners=[],this._progressiveDoneListeners=[],this._readyCapability=Promise.withResolvers()}addRangeListener(R){this._rangeListeners.push(R)}addProgressListener(R){this._progressListeners.push(R)}addProgressiveReadListener(R){this._progressiveReadListeners.push(R)}addProgressiveDoneListener(R){this._progressiveDoneListeners.push(R)}onDataRange(R,N){for(let W of this._rangeListeners)W(R,N)}onDataProgress(R,N){this._readyCapability.promise.then(()=>{for(let W of this._progressListeners)W(R,N)})}onDataProgressiveRead(R){this._readyCapability.promise.then(()=>{for(let N of this._progressiveReadListeners)N(R)})}onDataProgressiveDone(){this._readyCapability.promise.then(()=>{for(let R of this._progressiveDoneListeners)R()})}transportReady(){this._readyCapability.resolve()}requestDataRange(R,N){Dt("Abstract method PDFDataRangeTransport.requestDataRange")}abort(){}};let Kk=class Kk{constructor(R,N){this._pdfInfo=R,this._transport=N}get annotationStorage(){return this._transport.annotationStorage}get filterFactory(){return this._transport.filterFactory}get numPages(){return this._pdfInfo.numPages}get fingerprints(){return this._pdfInfo.fingerprints}get isPureXfa(){return Tt(this,"isPureXfa",!!this._transport._htmlForXfa)}get allXfaHtml(){return this._transport._htmlForXfa}getPage(R){return this._transport.getPage(R)}getPageIndex(R){return this._transport.getPageIndex(R)}getDestinations(){return this._transport.getDestinations()}getDestination(R){return this._transport.getDestination(R)}getPageLabels(){return this._transport.getPageLabels()}getPageLayout(){return this._transport.getPageLayout()}getPageMode(){return this._transport.getPageMode()}getViewerPreferences(){return this._transport.getViewerPreferences()}getOpenAction(){return this._transport.getOpenAction()}getAttachments(){return this._transport.getAttachments()}getJSActions(){return this._transport.getDocJSActions()}getOutline(){return this._transport.getOutline()}getOptionalContentConfig({intent:R="display"}={}){let{renderingIntent:N}
222=this._transport.getRenderingIntent(R);return this._transport.getOptionalContentConfig(N)}getPermissions(){return this._transport.getPermissions()}getMetadata(){return this._transport.getMetadata()}getMarkInfo(){return this._transport.getMarkInfo()}getData(){return this._transport.getData()}saveDocument(){return this._transport.saveDocument()}getDownloadInfo(){return this._transport.downloadInfoCapability.promise}cleanup(R=!1){return this._transport.startCleanup(R||this.isPureXfa)}destroy(){return this.loadingTask.destroy()}cachedPageNumber(R){return this._transport.cachedPageNumber(R)}get loadingParams(){return this._transport.loadingParams}get loadingTask(){return this._transport.loadingTask}getFieldObjects(){return this._transport.getFieldObjects()}hasJSActions(){return this._transport.hasJSActions()}getCalculationOrderIds(){return this._transport.getCalculationOrderIds()}};let Zk=class Zk{constructor(R,N,W,j=!1){m(this,sc),m(this,sf),m(this,so,null),m(this,sh,!1),this._pageIndex=R,this._pageInfo=N,this._transport=W,this._stats=j?new bv:null,this._pdfBug=j,this.commonObjs=W.commonObjs,this.objs=new fw,this._maybeCleanupAfterRender=!1,this._intentStates=new Map,this.destroyed=!1}get pageNumber(){return this._pageIndex+1}get rotate(){return this._pageInfo.rotate}get ref(){return this._pageInfo.ref}get userUnit(){return this._pageInfo.userUnit}get view(){return this._pageInfo.view}getViewport({scale:R,rotation:N=this.rotate,offsetX:W=0,offsetY:j=0,dontFlip:B=!1}={}){return new Jh({viewBox:this.view,scale:R,rotation:N,offsetX:W,offsetY:j,dontFlip:B})}getAnnotations({intent:R="display"}={}){let{renderingIntent:N}=this._transport.getRenderingIntent(R);return this._transport.getAnnotations(this._pageIndex,N)}getJSActions(){return this._transport.getPageJSActions(this._pageIndex)}get filterFactory(){return this._transport.filterFactory}get isPureXfa(){return Tt(this,"isPureXfa",!!this._transport._htmlForXfa)}async getXfa(){var R;return(null==(R=this._transport._htmlForXfa)?void 0:R.children[this._pageIndex])||null}render({canvasContext:R,viewport:N,intent:W="display",annotationMode:j=mJ.ENABLE,transform:B=null,background:z=null,optionalContentConfigPromise:U=null,annotationCanvasMap:V=null,pageColors:G=null,printAnnotationStorage:Y=null}){var Z,te;null==(Z=this._stats)||Z.time("Overall");let tn=this._transport.getRenderingIntent(W,j,Y),{renderingIntent:tr,cacheKey:ts}=tn;w(this,sh,!1),A(this,sf,sg).call(this),U||(U=this._transport.getOptionalContentConfig(tr));let ta=this._intentStates.get(ts);ta||(ta=Object.create(null),this._intentStates.set(ts,ta)),ta.streamReaderCancelTimeout&&(clearTimeout(ta.streamReaderCancelTimeout),ta.streamReaderCancelTimeout=null);let th=!!(tr&mQ.PRINT);ta.displayReadyCapability||(ta.displayReadyCapability=Promise.withResolvers(),ta.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},null==(te=this._stats)||te.time("Page Request"),this._pumpOperatorList(tn));let x=R=>{var N;ta.renderTasks.delete(tc),(this._maybeCleanupAfterRender||th)&&w(this,sh,!0),A(this,sc,sd).call(this,!th),R?(tc.capability.reject(R),this._abortOperatorList({intentState:ta,reason:R instanceof Error?R:Error(R)})):tc.capability.resolve(),this._stats&&(this._stats.timeEnd("Rendering"),this._stats.timeEnd("Overall"),null!=(N=globalThis.Stats)&&N.enabled&&globalThis.Stats.add(this.pageNumber,this._stats))},tc=new v4({callback:x,params:{canvasContext:R,viewport:N,transform:B,background:z},objs:this.objs,commonObjs:this.commonObjs,annotationCanvasMap:V,operatorList:ta.operatorList,pageIndex:this._pageIndex,canvasFactory:this._transport.canvasFactory,filterFactory:this._transport.filterFactory,useRequestAnimationFrame:!th,pdfBug:this._pdfBug,pageColors:G});(ta.renderTasks||(ta.renderTasks=new Set)).add(tc);let tu=tc.task;return Promise.all([ta.displayReadyCapability.promise,U]).then(([R,N])=>{var W;if(this.destroyed){x();return}if(null==(W=this._stats)||W.time("Rendering"),!(N.renderingIntent&tr))throw Error("Must use the same `intent`-argument when calling the `PDFPageProxy.render` and `PDFDocumentProxy.getOptionalContentConfig` methods.");tc.initializeGraphics({transparency:R,optionalContentConfig:N}),tc.operatorListChanged()}).catch(x),tu}getOperatorList({intent:R="display",annotationMode:N=mJ.ENABLE,printAnnotationStorage:W=null}={}){var j;let B;
222let z=this._transport.getRenderingIntent(R,N,W,!0),U=this._intentStates.get(z.cacheKey);return U||(U=Object.create(null),this._intentStates.set(z.cacheKey,U)),U.opListReadCapability||((B=Object.create(null)).operatorListChanged=function(){U.operatorList.lastChunk&&(U.opListReadCapability.resolve(U.operatorList),U.renderTasks.delete(B))},U.opListReadCapability=Promise.withResolvers(),(U.renderTasks||(U.renderTasks=new Set)).add(B),U.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},null==(j=this._stats)||j.time("Page Request"),this._pumpOperatorList(z)),U.opListReadCapability.promise}streamTextContent({includeMarkedContent:R=!1,disableNormalization:N=!1}={}){return this._transport.messageHandler.sendWithStream("GetTextContent",{pageIndex:this._pageIndex,includeMarkedContent:!0===R,disableNormalization:!0===N},{highWaterMark:100,size:R=>R.items.length})}getTextContent(R={}){if(this._transport._htmlForXfa)return this.getXfa().then(R=>Tl.textContent(R));let N=this.streamTextContent(R);return new Promise(function(R,W){let j=N.getReader(),B={items:[],styles:Object.create(null),lang:null};!function s(){j.read().then(function({value:N,done:W}){if(W){R(B);return}B.lang??(B.lang=N.lang),Object.assign(B.styles,N.styles),B.items.push(...N.items),s()},W)}()})}getStructTree(){return this._transport.getStructTree(this._pageIndex)}_destroy(){this.destroyed=!0;let R=[];for(let N of this._intentStates.values())if(this._abortOperatorList({intentState:N,reason:Error("Page was destroyed."),force:!0}),!N.opListReadCapability)for(let W of N.renderTasks)R.push(W.completed),W.cancel();return this.objs.clear(),w(this,sh,!1),A(this,sf,sg).call(this),Promise.all(R)}cleanup(R=!1){w(this,sh,!0);let N=A(this,sc,sd).call(this,!1);return R&&N&&this._stats&&(this._stats=new bv),N}_startRenderPage(R,N){var W,j;let B=this._intentStates.get(N);B&&(null==(W=this._stats)||W.timeEnd("Page Request"),null==(j=B.displayReadyCapability)||j.resolve(R))}_renderPageChunk(R,N){for(let W=0,j=R.length;W<j;W++)N.operatorList.fnArray.push(R.fnArray[W]),N.operatorList.argsArray.push(R.argsArray[W]);for(let W of(N.operatorList.lastChunk=R.lastChunk,N.operatorList.separateAnnots=R.separateAnnots,N.renderTasks))W.operatorListChanged();R.lastChunk&&A(this,sc,sd).call(this,!0)}_pumpOperatorList({renderingIntent:R,cacheKey:N,annotationStorageSerializable:W}){let{map:j,transfer:B}=W,z=this._transport.messageHandler.sendWithStream("GetOperatorList",{pageIndex:this._pageIndex,intent:R,cacheKey:N,annotationStorage:j},B).getReader(),U=this._intentStates.get(N);U.streamReader=z;let d=()=>{z.read().then(({value:R,done:N})=>{if(N){U.streamReader=null;return}this._transport.destroyed||(this._renderPageChunk(R,U),d())},R=>{if(U.streamReader=null,!this._transport.destroyed){if(U.operatorList){for(let R of(U.operatorList.lastChunk=!0,U.renderTasks))R.operatorListChanged();A(this,sc,sd).call(this,!0)}if(U.displayReadyCapability)U.displayReadyCapability.reject(R);else if(U.opListReadCapability)U.opListReadCapability.reject(R);else throw R}})};d()}_abortOperatorList({intentState:R,reason:N,force:W=!1}){if(R.streamReader){if(R.streamReaderCancelTimeout&&(clearTimeout(R.streamReaderCancelTimeout),R.streamReaderCancelTimeout=null),!W){if(R.renderTasks.size>0)return;if(N instanceof f0){let W=100;N.extraDelay>0&&N.extraDelay<1e3&&(W+=N.extraDelay),R.streamReaderCancelTimeout=setTimeout(()=>{R.streamReaderCancelTimeout=null,this._abortOperatorList({intentState:R,reason:N,force:!0})},W);return}}if(R.streamReader.cancel(new lo(N.message)).catch(()=>{}),R.streamReader=null,!this._transport.destroyed){for(let[N,W]of this._intentStates)if(W===R){this._intentStates.delete(N);break}this.cleanup()}}}get stats(){return this._stats}};so=new WeakMap,sh=new WeakMap,sc=new WeakSet,sd=function(R=!1){if(A(this,sf,sg).call(this),!a(this,sh)||this.destroyed)return!1;if(R)return w(this,so,setTimeout(()=>{w(this,so,null),A(this,sc,sd).call(this,!1)},5e3)),!1;for(let{renderTasks:R,operatorList:N}of this._intentStates.values())if(R.size>0||!N.lastChunk)return!1;return this._intentStates.clear(),this.objs.clear(),w(this,sh,!1),!0},sf=new WeakSet,sg=function(){a(this,so)&&(clearTimeout(a(this,so)),w(this,so,null))};let Jk=class Jk{constructor(){m(this,sm,new Set),m(this,sy,Promise.resolve())}postMessage(R,N){let W={data:structuredClone(R,N?{transfer:N}:null)};a(this,sy).then(()=>{for(let R of a(this,sm))R.call(this,W)})}addEventListener(R,N){a(this,sm).add(N)}removeEventListener(R,N){a(this,sm).delete(N)}terminate(){a(this,sm).clear()}};sm=new WeakMap,sy=new WeakMap;let vQ={isWorkerDisabled:!1,fakeWorkerId:0};
222mX&&(vQ.isWorkerDisabled=!0,zi.workerSrc||(zi.workerSrc="./pdf.worker.mjs")),vQ.isSameOrigin=function(R,N){let W;try{if(!(W=new URL(R)).origin||"null"===W.origin)return!1}catch{return!1}let j=new URL(N,W);return W.origin===j.origin},vQ.createCDNWrapper=function(R){let N=`await import("${R}");`;return URL.createObjectURL(new Blob([N],{type:"text/javascript"}))};let vJ=class Xe{constructor({name:R=null,port:N=null,verbosity:W=vn}={}){var j;if(this.name=R,this.destroyed=!1,this.verbosity=W,this._readyCapability=Promise.withResolvers(),this._port=null,this._webWorker=null,this._messageHandler=null,N){if(null!=(j=a(Xe,sb))&&j.has(N))throw Error("Cannot use more than one PDFWorker per port.");(a(Xe,sb)||w(Xe,sb,new WeakMap)).set(N,this),this._initializeFromPort(N);return}this._initialize()}get promise(){return mX?Promise.all([ni.promise,this._readyCapability.promise]):this._readyCapability.promise}get port(){return this._port}get messageHandler(){return this._messageHandler}_initializeFromPort(R){this._port=R,this._messageHandler=new ul("main","worker",R),this._messageHandler.on("ready",function(){}),this._readyCapability.resolve(),this._messageHandler.send("configure",{verbosity:this.verbosity})}_initialize(){if(!vQ.isWorkerDisabled&&!a(Xe,sA,sx)){let{workerSrc:R}=Xe;try{vQ.isSameOrigin(window.location.href,R)||(R=vQ.createCDNWrapper(new URL(R,window.location).href));let N=new Worker(R,{type:"module"}),W=new ul("main","worker",N),i=()=>{N.removeEventListener("error",s),W.destroy(),N.terminate(),this.destroyed?this._readyCapability.reject(Error("Worker was destroyed")):this._setupFakeWorker()},s=()=>{this._webWorker||i()};N.addEventListener("error",s),W.on("test",R=>{if(N.removeEventListener("error",s),this.destroyed){i();return}R?(this._messageHandler=W,this._port=N,this._webWorker=N,this._readyCapability.resolve(),W.send("configure",{verbosity:this.verbosity})):(this._setupFakeWorker(),W.destroy(),N.terminate())}),W.on("ready",R=>{if(N.removeEventListener("error",s),this.destroyed){i();return}try{o()}catch{this._setupFakeWorker()}});let o=()=>{let R=new Uint8Array;W.send("test",R,[R.buffer])};o();return}catch{cp("The worker has been disabled.")}}this._setupFakeWorker()}_setupFakeWorker(){vQ.isWorkerDisabled||(vt("Setting up fake worker."),vQ.isWorkerDisabled=!0),Xe._setupFakeWorkerGlobal.then(R=>{if(this.destroyed){this._readyCapability.reject(Error("Worker was destroyed"));return}let N=new Jk;this._port=N;let W=`fake${vQ.fakeWorkerId++}`,j=new ul(W+"_worker",W,N);R.setup(j,N);let B=new ul(W,W+"_worker",N);this._messageHandler=B,this._readyCapability.resolve(),B.send("configure",{verbosity:this.verbosity})}).catch(R=>{this._readyCapability.reject(Error(`Setting up fake worker failed: "${R.message}".`))})}destroy(){var R;this.destroyed=!0,this._webWorker&&(this._webWorker.terminate(),this._webWorker=null),null==(R=a(Xe,sb))||R.delete(this._port),this._port=null,this._messageHandler&&(this._messageHandler.destroy(),this._messageHandler=null)}static fromPort(R){var N;if(!(null!=R&&R.port))throw Error("PDFWorker.fromPort - invalid method signature.");let W=null==(N=a(this,sb))?void 0:N.get(R.port);if(W){if(W._pendingDestroy)throw Error("PDFWorker.fromPort - the worker is being destroyed.\nPlease remember to await `PDFDocumentLoadingTask.destroy()`-calls.");return W}return new Xe(R)}static get workerSrc(){if(zi.workerSrc)return zi.workerSrc;throw Error('No "GlobalWorkerOptions.workerSrc" specified.')}static get _setupFakeWorkerGlobal(){return Tt(this,"_setupFakeWorkerGlobal",(async()=>a(this,sA,sx)?a(this,sA,sx):(await import(this.workerSrc)).WorkerMessageHandler)())}};sb=new WeakMap,sA=new WeakSet,sx=function(){var R;try{return(null==(R=globalThis.pdfjsWorker)?void 0:R.WorkerMessageHandler)||null}catch{return null}},m(vJ,sA),m(vJ,sb,void 0);let vZ=vJ;let Qk=class Qk{constructor(R,N,W,j,B){m(this,sT),m(this,s_,new Map),m(this,sS,new Map),m(this,sE,new Map),m(this,sC,new Map),m(this,sM,null),this.messageHandler=R,this.loadingTask=N,this.commonObjs=new fw,this.fontLoader=new ZR({ownerDocument:j.ownerDocument,styleElement:j.styleElement}),this.loadingParams=j.loadingParams,this._params=j,this.canvasFactory=B.canvasFactory,this.filterFactory=B.filterFactory,this.cMapReaderFactory=B.cMapReaderFactory,this.standardFontDataFactory=B.standardFontDataFactory,this.destroyed=!1,this.destroyCapability=null,this._networkStream=W,this._fullReader=null,this._lastProgress=null,this.downloadInfoCapability=Promise.withResolvers(),this.setupMessageHandler()}get annotationStorage(){return Tt(this,"annotationStorage",new v0)}
222getRenderingIntent(R,N=mJ.ENABLE,W=null,j=!1){let B=mQ.DISPLAY,z=vC;switch(R){case"any":B=mQ.ANY;break;case"display":break;case"print":B=mQ.PRINT;break;default:vt(`getRenderingIntent - invalid intent: ${R}`)}switch(N){case mJ.DISABLE:B+=mQ.ANNOTATIONS_DISABLE;break;case mJ.ENABLE:break;case mJ.ENABLE_FORMS:B+=mQ.ANNOTATIONS_FORMS;break;case mJ.ENABLE_STORAGE:B+=mQ.ANNOTATIONS_STORAGE,z=(B&mQ.PRINT&&W instanceof Jb?W:this.annotationStorage).serializable;break;default:vt(`getRenderingIntent - invalid annotationMode: ${N}`)}return j&&(B+=mQ.OPLIST),{renderingIntent:B,cacheKey:`${B}_${z.hash}`,annotationStorageSerializable:z}}destroy(){var R;if(this.destroyCapability)return this.destroyCapability.promise;this.destroyed=!0,this.destroyCapability=Promise.withResolvers(),null==(R=a(this,sM))||R.reject(Error("Worker was destroyed during onPassword callback"));let N=[];for(let R of a(this,sS).values())N.push(R._destroy());a(this,sS).clear(),a(this,sE).clear(),a(this,sC).clear(),this.hasOwnProperty("annotationStorage")&&this.annotationStorage.resetModified();let W=this.messageHandler.sendWithPromise("Terminate",null);return N.push(W),Promise.all(N).then(()=>{var R;this.commonObjs.clear(),this.fontLoader.clear(),a(this,s_).clear(),this.filterFactory.destroy(),vH.cleanup(),null==(R=this._networkStream)||R.cancelAllRequests(new lo("Worker was terminated.")),this.messageHandler&&(this.messageHandler.destroy(),this.messageHandler=null),this.destroyCapability.resolve()},this.destroyCapability.reject),this.destroyCapability.promise}setupMessageHandler(){let{messageHandler:R,loadingTask:N}=this;R.on("GetReader",(R,N)=>{ae(this._networkStream,"GetReader - no `IPDFStream` instance available."),this._fullReader=this._networkStream.getFullReader(),this._fullReader.onProgress=R=>{this._lastProgress={loaded:R.loaded,total:R.total}},N.onPull=()=>{this._fullReader.read().then(function({value:R,done:W}){if(W){N.close();return}ae(R instanceof ArrayBuffer,"GetReader - expected an ArrayBuffer."),N.enqueue(new Uint8Array(R),1,[R])}).catch(R=>{N.error(R)})},N.onCancel=R=>{this._fullReader.cancel(R),N.ready.catch(R=>{if(!this.destroyed)throw R})}}),R.on("ReaderHeadersReady",R=>{let W=Promise.withResolvers(),j=this._fullReader;return j.headersReady.then(()=>{var R;j.isStreamingSupported&&j.isRangeSupported||(this._lastProgress&&(null==(R=N.onProgress)||R.call(N,this._lastProgress)),j.onProgress=R=>{var W;null==(W=N.onProgress)||W.call(N,{loaded:R.loaded,total:R.total})}),W.resolve({isStreamingSupported:j.isStreamingSupported,isRangeSupported:j.isRangeSupported,contentLength:j.contentLength})},W.reject),W.promise}),R.on("GetRangeReader",(R,N)=>{ae(this._networkStream,"GetRangeReader - no `IPDFStream` instance available.");let W=this._networkStream.getRangeReader(R.begin,R.end);if(!W){N.close();return}N.onPull=()=>{W.read().then(function({value:R,done:W}){if(W){N.close();return}ae(R instanceof ArrayBuffer,"GetRangeReader - expected an ArrayBuffer."),N.enqueue(new Uint8Array(R),1,[R])}).catch(R=>{N.error(R)})},N.onCancel=R=>{W.cancel(R),N.ready.catch(R=>{if(!this.destroyed)throw R})}}),R.on("GetDoc",({pdfInfo:R})=>{this._numPages=R.numPages,this._htmlForXfa=R.htmlForXfa,delete R.htmlForXfa,N._capability.resolve(new Kk(R,this))}),R.on("DocException",function(R){let W;switch(R.name){case"PasswordException":W=new Sg(R.message,R.code);break;case"InvalidPDFException":W=new wb(R.message);break;case"MissingPDFException":W=new ao(R.message);break;case"UnexpectedResponseException":W=new hp(R.message,R.status);break;case"UnknownErrorException":W=new xg(R.message,R.details);break;default:Dt("DocException - expected a valid Error.")}N._capability.reject(W)}),R.on("PasswordRequest",R=>{if(w(this,sM,Promise.withResolvers()),N.onPassword)try{N.onPassword(R=>{R instanceof Error?a(this,sM).reject(R):a(this,sM).resolve({password:R})},R.code)}catch(R){a(this,sM).reject(R)}else a(this,sM).reject(new Sg(R.message,R.code));return a(this,sM).promise}),R.on("DataLoaded",R=>{var W;null==(W=N.onProgress)||W.call(N,{loaded:R.length,total:R.length}),this.downloadInfoCapability.resolve(R)}),R.on("StartRenderPage",R=>{this.destroyed||a(this,sS).get(R.pageIndex)._startRenderPage(R.transparency,R.cacheKey)}),R.on("commonobj",([N,W,j])=>{var B;if(this.destroyed||this.commonObjs.has(N))return null;
222switch(W){case"Font":let{disableFontFace:z,fontExtraProperties:U,pdfBug:V}=this._params;if("error"in j){let R=j.error;vt(`Error during font loading: ${R}`),this.commonObjs.resolve(N,R);break}let G=V&&null!=(B=globalThis.FontInspector)&&B.enabled?(R,N)=>globalThis.FontInspector.fontAdded(R,N):null,Y=new JR(j,{disableFontFace:z,inspectFont:G});this.fontLoader.bind(Y).catch(()=>R.sendWithPromise("FontFallback",{id:N})).finally(()=>{!U&&Y.data&&(Y.data=null),this.commonObjs.resolve(N,Y)});break;case"CopyLocalImage":let{imageRef:Z}=j;for(let R of(ae(Z,"The imageRef must be defined."),a(this,sS).values()))for(let[,W]of R.objs)if((null==W?void 0:W.ref)===Z)return W.dataLen?(this.commonObjs.resolve(N,structuredClone(W)),W.dataLen):null;break;case"FontPath":case"Image":case"Pattern":this.commonObjs.resolve(N,j);break;default:throw Error(`Got unknown common object type ${W}`)}return null}),R.on("obj",([R,N,W,j])=>{var B;if(this.destroyed)return;let z=a(this,sS).get(N);if(!z.objs.has(R)){if(0===z._intentStates.size){null==(B=null==j?void 0:j.bitmap)||B.close();return}switch(W){case"Image":z.objs.resolve(R,j),(null==j?void 0:j.dataLen)>1e7&&(z._maybeCleanupAfterRender=!0);break;case"Pattern":z.objs.resolve(R,j);break;default:throw Error(`Got unknown object type ${W}`)}}}),R.on("DocProgress",R=>{var W;this.destroyed||null==(W=N.onProgress)||W.call(N,{loaded:R.loaded,total:R.total})}),R.on("FetchBuiltInCMap",R=>this.destroyed?Promise.reject(Error("Worker was destroyed.")):this.cMapReaderFactory?this.cMapReaderFactory.fetch(R):Promise.reject(Error("CMapReaderFactory not initialized, see the `useWorkerFetch` parameter."))),R.on("FetchStandardFontData",R=>this.destroyed?Promise.reject(Error("Worker was destroyed.")):this.standardFontDataFactory?this.standardFontDataFactory.fetch(R):Promise.reject(Error("StandardFontDataFactory not initialized, see the `useWorkerFetch` parameter.")))}getData(){return this.messageHandler.sendWithPromise("GetData",null)}saveDocument(){var R;this.annotationStorage.size<=0&&vt("saveDocument called while `annotationStorage` is empty, please use the getData-method instead.");let{map:N,transfer:W}=this.annotationStorage.serializable;return this.messageHandler.sendWithPromise("SaveDocument",{isPureXfa:!!this._htmlForXfa,numPages:this._numPages,annotationStorage:N,filename:(null==(R=this._fullReader)?void 0:R.filename)??null},W).finally(()=>{this.annotationStorage.resetModified()})}getPage(R){if(!Number.isInteger(R)||R<=0||R>this._numPages)return Promise.reject(Error("Invalid page request."));let N=R-1,W=a(this,sE).get(N);if(W)return W;let j=this.messageHandler.sendWithPromise("GetPage",{pageIndex:N}).then(W=>{if(this.destroyed)throw Error("Transport destroyed");W.refStr&&a(this,sC).set(W.refStr,R);let j=new Zk(N,W,this,this._params.pdfBug);return a(this,sS).set(N,j),j});return a(this,sE).set(N,j),j}getPageIndex(R){return Fv(R)?this.messageHandler.sendWithPromise("GetPageIndex",{num:R.num,gen:R.gen}):Promise.reject(Error("Invalid pageIndex request."))}getAnnotations(R,N){return this.messageHandler.sendWithPromise("GetAnnotations",{pageIndex:R,intent:N})}getFieldObjects(){return A(this,sT,sR).call(this,"GetFieldObjects")}hasJSActions(){return A(this,sT,sR).call(this,"HasJSActions")}getCalculationOrderIds(){return this.messageHandler.sendWithPromise("GetCalculationOrderIds",null)}getDestinations(){return this.messageHandler.sendWithPromise("GetDestinations",null)}getDestination(R){return"string"!=typeof R?Promise.reject(Error("Invalid destination request.")):this.messageHandler.sendWithPromise("GetDestination",{id:R})}getPageLabels(){return this.messageHandler.sendWithPromise("GetPageLabels",null)}getPageLayout(){return this.messageHandler.sendWithPromise("GetPageLayout",null)}getPageMode(){return this.messageHandler.sendWithPromise("GetPageMode",null)}getViewerPreferences(){return this.messageHandler.sendWithPromise("GetViewerPreferences",null)}getOpenAction(){return this.messageHandler.sendWithPromise("GetOpenAction",null)}getAttachments(){return this.messageHandler.sendWithPromise("GetAttachments",null)}getDocJSActions(){return A(this,sT,sR).call(this,"GetDocJSActions")}
222getPageJSActions(R){return this.messageHandler.sendWithPromise("GetPageJSActions",{pageIndex:R})}getStructTree(R){return this.messageHandler.sendWithPromise("GetStructTree",{pageIndex:R})}getOutline(){return this.messageHandler.sendWithPromise("GetOutline",null)}getOptionalContentConfig(R){return A(this,sT,sR).call(this,"GetOptionalContentConfig").then(N=>new yk(N,R))}getPermissions(){return this.messageHandler.sendWithPromise("GetPermissions",null)}getMetadata(){let R="GetMetadata",N=a(this,s_).get(R);if(N)return N;let W=this.messageHandler.sendWithPromise(R,null).then(R=>{var N,W;return{info:R[0],metadata:R[1]?new mk(R[1]):null,contentDispositionFilename:(null==(N=this._fullReader)?void 0:N.filename)??null,contentLength:(null==(W=this._fullReader)?void 0:W.contentLength)??null}});return a(this,s_).set(R,W),W}getMarkInfo(){return this.messageHandler.sendWithPromise("GetMarkInfo",null)}async startCleanup(R=!1){if(!this.destroyed){for(let R of(await this.messageHandler.sendWithPromise("Cleanup",null),a(this,sS).values()))if(!R.cleanup())throw Error(`startCleanup: Page ${R.pageNumber} is currently rendering.`);this.commonObjs.clear(),R||this.fontLoader.clear(),a(this,s_).clear(),this.filterFactory.destroy(!0),vH.cleanup()}}cachedPageNumber(R){if(!Fv(R))return null;let N=0===R.gen?`${R.num}R`:`${R.num}R${R.gen}`;return a(this,sC).get(N)??null}};s_=new WeakMap,sS=new WeakMap,sE=new WeakMap,sC=new WeakMap,sM=new WeakMap,sT=new WeakSet,sR=function(R,N=null){let W=a(this,s_).get(R);if(W)return W;let j=this.messageHandler.sendWithPromise(R,N);return a(this,s_).set(R,j),j};let v3=Symbol("INITIAL_DATA");let fw=class fw{constructor(){m(this,sD),m(this,sI,Object.create(null))}get(R,N=null){if(N){let W=A(this,sD,sN).call(this,R);return W.promise.then(()=>N(W.data)),null}let W=a(this,sI)[R];if(!W||W.data===v3)throw Error(`Requesting object that isn't resolved yet ${R}.`);return W.data}has(R){let N=a(this,sI)[R];return!!N&&N.data!==v3}resolve(R,N=null){let W=A(this,sD,sN).call(this,R);W.data=N,W.resolve()}clear(){var R;for(let N in a(this,sI)){let{data:W}=a(this,sI)[N];null==(R=null==W?void 0:W.bitmap)||R.close()}w(this,sI,Object.create(null))}*[Symbol.iterator](){for(let R in a(this,sI)){let{data:N}=a(this,sI)[R];N!==v3&&(yield[R,N])}}};sI=new WeakMap,sD=new WeakSet,sN=function(R){var N;return(N=a(this,sI))[R]||(N[R]={...Promise.withResolvers(),data:v3})};let tL=class tL{constructor(R){m(this,sO,null),w(this,sO,R),this.onContinue=null}get promise(){return a(this,sO).capability.promise}cancel(R=0){a(this,sO).cancel(null,R)}get separateAnnots(){let{separateAnnots:R}=a(this,sO).operatorList;if(!R)return!1;let{annotationCanvasMap:N}=a(this,sO);return R.form||R.canvas&&(null==N?void 0:N.size)>0}};sO=new WeakMap;let v5=class Br{constructor({callback:R,params:N,objs:W,commonObjs:j,annotationCanvasMap:B,operatorList:z,pageIndex:U,canvasFactory:V,filterFactory:G,useRequestAnimationFrame:Y=!1,pdfBug:Z=!1,pageColors:te=null}){this.callback=R,this.params=N,this.objs=W,this.commonObjs=j,this.annotationCanvasMap=B,this.operatorListIdx=null,this.operatorList=z,this._pageIndex=U,this.canvasFactory=V,this.filterFactory=G,this._pdfBug=Z,this.pageColors=te,this.running=!1,this.graphicsReadyCallback=null,this.graphicsReady=!1,this._useRequestAnimationFrame=!0===Y&&"u">typeof window,this.cancelled=!1,this.capability=Promise.withResolvers(),this.task=new tL(this),this._cancelBound=this.cancel.bind(this),this._continueBound=this._continue.bind(this),this._scheduleNextBound=this._scheduleNext.bind(this),this._nextBound=this._next.bind(this),this._canvas=N.canvasContext.canvas}get completed(){return this.capability.promise.catch(function(){})}initializeGraphics({transparency:R=!1,optionalContentConfig:N}){var W,j;if(this.cancelled)return;if(this._canvas){if(a(Br,sF).has(this._canvas))throw Error("Cannot use the same canvas during multiple render() operations. Use different canvas or ensure previous operations were cancelled or completed.");a(Br,sF).add(this._canvas)}this._pdfBug&&null!=(W=globalThis.StepperManager)&&W.enabled&&(this.stepper=globalThis.StepperManager.create(this._pageIndex),this.stepper.init(this.operatorList),this.stepper.nextBreakPoint=this.stepper.getNextBreakPoint());let{canvasContext:B,viewport:z,transform:U,background:V}=this.params;this.gfx=new vW(B,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:N},this.annotationCanvasMap,this.pageColors),this.gfx.beginDrawing({transform:U,viewport:z,transparency:R,background:V}),this.operatorListIdx=0,this.graphicsReady=!0,null==(j=this.graphicsReadyCallback)||j.call(this)}cancel(R=null,N=0){var W;this.running=!1,this.cancelled=!0,null==(W=this.gfx)||W.endDrawing(),a(Br,sF).delete(this._canvas),this.callback(R||new f0(`Rendering cancelled, page ${this._pageIndex+1}`,N))}operatorListChanged(){var R;if(!this.graphicsReady){this.graphicsReadyCallback||(this.graphicsReadyCallback=this._continueBound);return}null==(R=this.stepper)||R.updateOperatorList(this.operatorList),this.running||this._continue()}_continue(){this.running=!0,this.cancelled||(this.task.onContinue?this.task.onContinue(this._scheduleNextBound):this._scheduleNext())}_scheduleNext(){this._useRequestAnimationFrame?window.requestAnimationFrame(()=>{this._nextBound().catch(this._cancelBound)}
222):Promise.resolve().then(this._nextBound).catch(this._cancelBound)}async _next(){this.cancelled||(this.operatorListIdx=this.gfx.executeOperatorList(this.operatorList,this.operatorListIdx,this._continueBound,this.stepper),this.operatorListIdx===this.operatorList.argsArray.length&&(this.running=!1,this.operatorList.lastChunk&&(this.gfx.endDrawing(),a(Br,sF).delete(this._canvas),this.callback())))}};m(v5,sF=new WeakMap,new WeakSet);let v4=v5,v6="4.3.136",v8="0cec64437";function Mv(R){return Math.floor(255*Math.max(0,Math.min(1,R))).toString(16).padStart(2,"0")}function il(R){return Math.max(0,Math.min(255,255*R))}let Dv=class Dv{static CMYK_G([R,N,W,j]){return["G",1-Math.min(1,.3*R+.59*W+.11*N+j)]}static G_CMYK([R]){return["CMYK",0,0,0,1-R]}static G_RGB([R]){return["RGB",R,R,R]}static G_rgb([R]){return[R=il(R),R,R]}static G_HTML([R]){let N=Mv(R);return`#${N}${N}${N}`}static RGB_G([R,N,W]){return["G",.3*R+.59*N+.11*W]}static RGB_rgb(R){return R.map(il)}static RGB_HTML(R){return`#${R.map(Mv).join("")}`}static T_HTML(){return"#00000000"}static T_rgb(){return[null]}static CMYK_RGB([R,N,W,j]){return["RGB",1-Math.min(1,R+j),1-Math.min(1,W+j),1-Math.min(1,N+j)]}static CMYK_rgb([R,N,W,j]){return[il(1-Math.min(1,R+j)),il(1-Math.min(1,W+j)),il(1-Math.min(1,N+j))]}static CMYK_HTML(R){let N=this.CMYK_RGB(R).slice(1);return this.RGB_HTML(N)}static RGB_CMYK([R,N,W]){let j=1-R,B=1-N,z=1-W;return["CMYK",j,B,z,Math.min(j,B,z)]}};let pw=class pw{static setupStorage(R,N,W,j,B){let z=j.getValue(N,{value:null});switch(W.name){case"textarea":if(null!==z.value&&(R.textContent=z.value),"print"===B)break;R.addEventListener("input",R=>{j.setValue(N,{value:R.target.value})});break;case"input":if("radio"===W.attributes.type||"checkbox"===W.attributes.type){if(z.value===W.attributes.xfaOn?R.setAttribute("checked",!0):z.value===W.attributes.xfaOff&&R.removeAttribute("checked"),"print"===B)break;R.addEventListener("change",R=>{j.setValue(N,{value:R.target.checked?R.target.getAttribute("xfaOn"):R.target.getAttribute("xfaOff")})})}else{if(null!==z.value&&R.setAttribute("value",z.value),"print"===B)break;R.addEventListener("input",R=>{j.setValue(N,{value:R.target.value})})}break;case"select":if(null!==z.value)for(let N of(R.setAttribute("value",z.value),W.children))N.attributes.value===z.value?N.attributes.selected=!0:N.attributes.hasOwnProperty("selected")&&delete N.attributes.selected;R.addEventListener("input",R=>{let W=R.target.options,B=-1===W.selectedIndex?"":W[W.selectedIndex].value;j.setValue(N,{value:B})})}}static setAttributes({html:R,element:N,storage:W=null,intent:j,linkService:B}){let{attributes:z}=N,U=R instanceof HTMLAnchorElement;for(let[N,W]of("radio"===z.type&&(z.name=`${z.name}-${j}`),Object.entries(z)))if(null!=W)switch(N){case"class":W.length&&R.setAttribute(N,W.join(" "));break;case"dataId":break;case"id":R.setAttribute("data-element-id",W);break;case"style":Object.assign(R.style,W);break;case"textContent":R.textContent=W;break;default:U&&("href"===N||"newWindow"===N)||R.setAttribute(N,W)}U&&B.addLinkAttributes(R,z.href,z.newWindow),W&&z.dataId&&this.setupStorage(R,z.dataId,N,W)}static render(R){var N,W;let j=R.annotationStorage,B=R.linkService,z=R.xfaHtml,U=R.intent||"display",V=document.createElement(z.name);z.attributes&&this.setAttributes({html:V,element:z,intent:U,linkService:B});let G="richText"!==U,Y=R.div;if(Y.append(V),R.viewport){let N=`matrix(${R.viewport.transform.join(",")})`;Y.style.transform=N}G&&Y.setAttribute("class","xfaLayer xfaFont");let Z=[];if(0===z.children.length){if(z.value){let R=document.createTextNode(z.value);V.append(R),G&&Tl.shouldBuildText(z.name)&&Z.push(R)}return{textDivs:Z}}let te=[[z,-1,V]];for(;te.length>0;){let[R,z,V]=te.at(-1);if(z+1===R.children.length){te.pop();continue}let Y=R.children[++te.at(-1)[1]];if(null===Y)continue;let{name:tn}=Y;if("#text"===tn){let R=document.createTextNode(Y.value);Z.push(R),V.append(R);continue}let tr=null!=(N=null==Y?void 0:Y.attributes)&&N.xmlns?document.createElementNS(Y.attributes.xmlns,tn):document.createElement(tn);if(V.append(tr),Y.attributes&&this.setAttributes({html:tr,element:Y,storage:j,intent:U,linkService:B}),(null==(W=Y.children)?void 0:W.length)>0)te.push([Y,-1,tr]);else if(Y.value){let R=document.createTextNode(Y.value);G&&Tl.shouldBuildText(tn)&&Z.push(R),tr.append(R)}}for(let R of Y.querySelectorAll(".xfaNonInteractive input, .xfaNonInteractive textarea"))R.setAttribute("readOnly",!0);return{textDivs:Z}}static update(R){let N=`matrix(${R.viewport.transform.join(",")})`;R.div.style.transform=N,R.div.hidden=!1}};let v7=new WeakSet;function Gi(R){return{width:R[2]-R[0],height:R[3]-R[1]}}let rL=class rL{static create(R){switch(R.data.annotationType){case m6.LINK:return new gw(R);case m6.TEXT:return new sL(R);case m6.WIDGET:switch(R.data.fieldType){case"Tx":return new oL(R);case"Btn":return R.data.radioButton?new yw(R):R.data.checkBox?new lL(R):new cL(R);case"Ch":return new hL(R);case"Sig":return new aL(R)}return new co(R);case m6.POPUP:return new am(R);case m6.FREETEXT:return new _w(R);case m6.LINE:return new uL(R);case m6.SQUARE:return new fL(R);case m6.CIRCLE:return new pL(R);case m6.POLYLINE:return new Sw(R);case m6.CARET:return new mL(R);case m6.INK:return new xw(R);case m6.POLYGON:return new gL(R);case m6.HIGHLIGHT:return new vL(R);case m6.UNDERLINE:return new yL(R);case m6.SQUIGGLY:return new bL(R);case m6.STRIKEOUT:return new wL(R);case m6.STAMP:return new Cw(R);case m6.FILEATTACHMENT:return new AL(R);default:return new we(R)}}};let v9=class P0{constructor(R,{isRenderable:N=!1,ignoreBorder:W=!1,createQuadrilaterals:j=!1}={}){m(this,s$),m(this,sW,null),m(this,sj,!1),m(this,sB,null),this.isRenderable=N,this.data=R.data,this.layer=R.layer,this.linkService=R.linkService,this.downloadManager=R.downloadManager,this.imageResourcesPath=R.imageResourcesPath,this.renderForms=R.renderForms,this.svgFactory=R.svgFactory,this.annotationStorage=R.annotationStorage,this.enableScripting=R.enableScripting,this.hasJSActions=R.hasJSActions,this._fieldObjects=R.fieldObjects,this.parent=R.parent,N&&(this.container=this._createContainer(W)),j&&this._createQuadrilaterals()}static _hasPopupData({titleObj:R,contentsObj:N,richText:W}){return!!(null!=R&&R.str||null!=N&&N.str||null!=W&&W.str)}get hasPopupData(){return P0._hasPopupData(this.data)}updateEdited(R){var N;if(!this.container)return;a(this,sW)||w(this,sW,{rect:this.data.rect.slice(0)});let{rect:W}=R;W&&A(this,s$,sz).call(this,W),null==(N=a(this,sB))||N.popup.updateEdited(R)}resetEdited(){var R;a(this,sW)&&(A(this,s$,sz).call(this,a(this,sW).rect),null==(R=a(this,sB))||R.popup.resetEdited(),w(this,sW,null))}_createContainer(R){let{data:N,parent:{page:W,viewport:j}}=this,B=document.createElement("section");B.setAttribute("data-annotation-id",N.id),this instanceof co||(B.tabIndex=1e3);let{style:z}=B;if(z.zIndex=this.parent.zIndex++,N.popupRef&&B.setAttribute("aria-haspopup","dialog"),N.alternativeText&&(B.title=N.alternativeText),N.noRotate&&B.classList.add("norotate"),!N.rect||this instanceof am){let{rotation:R}=N;return N.hasOwnCanvas||0===R||this.setRotation(R,B),B}let{width:U,height:V}=Gi(N.rect);if(!R&&N.borderStyle.width>0){z.borderWidth=`${N.borderStyle.width}px`;let R=N.borderStyle.horizontalCornerRadius,W=N.borderStyle.verticalCornerRadius;if(R>0||W>0){let N=`calc(${R}px * var(--scale-factor)) / calc(${W}px * var(--scale-factor))`;z.borderRadius=N}else if(this instanceof yw){let R=`calc(${U}px * var(--scale-factor)) / calc(${V}px * var(--scale-factor))`;z.borderRadius=R}switch(N.borderStyle.style){case m8.SOLID:z.borderStyle="solid";break;case m8.DASHED:z.borderStyle="dashed";break;case m8.BEVELED:vt("Unimplemented border style: beveled");break;case m8.INSET:vt("Unimplemented border style: inset");break;case m8.UNDERLINE:z.borderBottomStyle="solid"}let j=N.borderColor||null;j?(w(this,sj,!0),z.borderColor=Q.makeHexColor(0|j[0],0|j[1],0|j[2])):z.borderWidth=0}let G=Q.normalizeRect([N.rect[0],W.view[3]-N.rect[1]+W.view[1],N.rect[2],W.view[3]-N.rect[3]+W.view[1]]),{pageWidth:Y,pageHeight:Z,pageX:te,pageY:tn}=j.rawDims;z.left=`${100*(G[0]-te)/Y}%`,z.top=`${100*(G[1]-tn)/Z}%`;let{rotation:tr}=N;return N.hasOwnCanvas||0===tr?(z.width=`${100*U/Y}%`,z.height=`${100*V/Z}%`):this.setRotation(tr,B),B}setRotation(R,N=this.container){let W,j;if(!this.data.rect)return;let{pageWidth:B,pageHeight:z}=this.parent.viewport.rawDims,{width:U,height:V}=Gi(this.data.rect);
222R%180==0?(W=100*U/B,j=100*V/z):(W=100*V/B,j=100*U/z),N.style.width=`${W}%`,N.style.height=`${j}%`,N.setAttribute("data-main-rotation",(360-R)%360)}get _commonActions(){let t=(R,N,W)=>{let j=W.detail[R],B=j[0],z=j.slice(1);W.target.style[N]=Dv[`${B}_HTML`](z),this.annotationStorage.setValue(this.data.id,{[N]:Dv[`${B}_rgb`](z)})};return Tt(this,"_commonActions",{display:R=>{let{display:N}=R.detail,W=N%2==1;this.container.style.visibility=W?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noView:W,noPrint:1===N||2===N})},print:R=>{this.annotationStorage.setValue(this.data.id,{noPrint:!R.detail.print})},hidden:R=>{let{hidden:N}=R.detail;this.container.style.visibility=N?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noPrint:N,noView:N})},focus:R=>{setTimeout(()=>R.target.focus({preventScroll:!1}),0)},userName:R=>{R.target.title=R.detail.userName},readonly:R=>{R.target.disabled=R.detail.readonly},required:R=>{this._setRequired(R.target,R.detail.required)},bgColor:R=>{t("bgColor","backgroundColor",R)},fillColor:R=>{t("fillColor","backgroundColor",R)},fgColor:R=>{t("fgColor","color",R)},textColor:R=>{t("textColor","color",R)},borderColor:R=>{t("borderColor","borderColor",R)},strokeColor:R=>{t("strokeColor","borderColor",R)},rotation:R=>{let N=R.detail.rotation;this.setRotation(N),this.annotationStorage.setValue(this.data.id,{rotation:N})}})}_dispatchEventFromSandbox(R,N){let W=this._commonActions;for(let j of Object.keys(N.detail)){let B=R[j]||W[j];null==B||B(N)}}_setDefaultPropertiesFromJS(R){if(!this.enableScripting)return;let N=this.annotationStorage.getRawValue(this.data.id);if(!N)return;let W=this._commonActions;for(let[j,B]of Object.entries(N)){let z=W[j];if(z){let W={detail:{[j]:B},target:R};z(W),delete N[j]}}}_createQuadrilaterals(){let R;if(!this.container)return;let{quadPoints:N}=this.data;if(!N)return;let[W,j,B,z]=this.data.rect;if(1===N.length){let[,{x:R,y:U},{x:V,y:G}]=N[0];if(B===R&&z===U&&W===V&&j===G)return}let{style:U}=this.container;if(a(this,sj)){let{borderColor:N,borderWidth:W}=U;U.borderWidth=0,R=["url('data:image/svg+xml;utf8,",'<svg xmlns="http://www.w3.org/2000/svg"',' preserveAspectRatio="none" viewBox="0 0 1 1">',`<g fill="transparent" stroke="${N}" stroke-width="${W}">`],this.container.classList.add("hasBorder")}let V=B-W,G=z-j,{svgFactory:Y}=this,Z=Y.createElement("svg");Z.classList.add("quadrilateralsContainer"),Z.setAttribute("width",0),Z.setAttribute("height",0);let te=Y.createElement("defs");Z.append(te);let tn=Y.createElement("clipPath"),tr=`clippath_${this.data.id}`;for(let[,{x:j,y:B},{x:U,y:Z}]of(tn.setAttribute("id",tr),tn.setAttribute("clipPathUnits","objectBoundingBox"),te.append(tn),N)){let N=Y.createElement("rect"),te=(U-W)/V,tr=(z-B)/G,ts=(j-U)/V,ta=(B-Z)/G;N.setAttribute("x",te),N.setAttribute("y",tr),N.setAttribute("width",ts),N.setAttribute("height",ta),tn.append(N),null==R||R.push(`<rect vector-effect="non-scaling-stroke" x="${te}" y="${tr}" width="${ts}" height="${ta}"/>`)}a(this,sj)&&(R.push("</g></svg>')"),U.backgroundImage=R.join("")),this.container.append(Z),this.container.style.clipPath=`url(#${tr})`}_createPopup(){let{container:R,data:N}=this;R.setAttribute("aria-haspopup","dialog");let W=w(this,sB,new am({data:{color:N.color,titleObj:N.titleObj,modificationDate:N.modificationDate,contentsObj:N.contentsObj,richText:N.richText,parentRect:N.rect,borderStyle:0,id:`popup_${N.id}`,rotation:N.rotation},parent:this.parent,elements:[this]}));this.parent.div.append(W.render())}render(){Dt("Abstract method `AnnotationElement.render` called")}_getElementsByName(R,N=null){let W=[];if(this._fieldObjects){let j=this._fieldObjects[R];if(j)for(let{page:R,id:B,exportValues:z}of j){if(-1===R||B===N)continue;let j="string"==typeof z?z:null,U=document.querySelector(`[data-element-id="${B}"]`);if(U&&!v7.has(U)){vt(`_getElementsByName - element not allowed: ${B}`);continue}W.push({id:B,exportValue:j,domElement:U})}return W}for(let j of document.getElementsByName(R)){let{exportValue:R}=j,B=j.getAttribute("data-element-id");B!==N&&v7.has(j)&&W.push({id:B,exportValue:R,domElement:j})}return W}show(){var R;this.container&&(this.container.hidden=!1),null==(R=this.popup)||R.maybeShow()}hide(){var R;this.container&&(this.container.hidden=!0),null==(R=this.popup)||R.forceHide()}getElementsToTriggerPopup(){return this.container}addHighlightArea(){let R=this.getElementsToTriggerPopup();if(Array.isArray(R))for(let N of R)N.classList.add("highlightArea");else R.classList.add("highlightArea")}get _isEditable(){return!1}_editOnDoubleClick(){if(!this._isEditable)return;let{annotationEditorType:R,data:{id:N}}=this;this.container.addEventListener("dblclick",()=>{var W;null==(W=this.linkService.eventBus)||W.dispatch("switchannotationeditormode",{source:this,mode:R,editId:N})})}};sW=new WeakMap,sj=new WeakMap,sB=new WeakMap,s$=new WeakSet,sz=function(R){let{container:{style:N},data:{rect:W,rotation:j},parent:{viewport:{rawDims:{pageWidth:B,pageHeight:z,pageX:U,pageY:V}}}}=this;null==W||W.splice(0,4,...R);let{width:G,height:Y}=Gi(R);N.left=`${100*(R[0]-U)/B}%`,N.top=`${100*(z-R[3]+V)/z}%`,0===j?(N.width=`${100*G/B}
222%`,N.height=`${100*Y/z}%`):this.setRotation(j)};let we=v9;let gw=class gw extends we{constructor(R,N=null){super(R,{isRenderable:!0,ignoreBorder:!!(null!=N&&N.ignoreBorder),createQuadrilaterals:!0}),m(this,sH),m(this,sV),m(this,sq),this.isTooltipOnly=R.data.isTooltipOnly}render(){let{data:R,linkService:N}=this,W=document.createElement("a");W.setAttribute("data-element-id",R.id);let j=!1;return R.url?(N.addLinkAttributes(W,R.url,R.newWindow),j=!0):R.action?(this._bindNamedAction(W,R.action),j=!0):R.attachment?(A(this,sV,sG).call(this,W,R.attachment,R.attachmentDest),j=!0):R.setOCGState?(A(this,sq,sX).call(this,W,R.setOCGState),j=!0):R.dest?(this._bindLink(W,R.dest),j=!0):(R.actions&&(R.actions.Action||R.actions["Mouse Up"]||R.actions["Mouse Down"])&&this.enableScripting&&this.hasJSActions&&(this._bindJSAction(W,R),j=!0),R.resetForm?(this._bindResetFormAction(W,R.resetForm),j=!0):this.isTooltipOnly&&!j&&(this._bindLink(W,""),j=!0)),this.container.classList.add("linkAnnotation"),j&&this.container.append(W),this.container}_bindLink(R,N){R.href=this.linkService.getDestinationHash(N),R.onclick=()=>(N&&this.linkService.goToDestination(N),!1),(N||""===N)&&A(this,sH,sU).call(this)}_bindNamedAction(R,N){R.href=this.linkService.getAnchorUrl(""),R.onclick=()=>(this.linkService.executeNamedAction(N),!1),A(this,sH,sU).call(this)}_bindJSAction(R,N){R.href=this.linkService.getAnchorUrl("");let W=new Map([["Action","onclick"],["Mouse Up","onmouseup"],["Mouse Down","onmousedown"]]);for(let j of Object.keys(N.actions)){let B=W.get(j);B&&(R[B]=()=>{var R;return null==(R=this.linkService.eventBus)||R.dispatch("dispatcheventinsandbox",{source:this,detail:{id:N.id,name:j}}),!1})}R.onclick||(R.onclick=()=>!1),A(this,sH,sU).call(this)}_bindResetFormAction(R,N){let W=R.onclick;if(W||(R.href=this.linkService.getAnchorUrl("")),A(this,sH,sU).call(this),!this._fieldObjects){vt('_bindResetFormAction - "resetForm" action not supported, ensure that the `fieldObjects` parameter is provided.'),W||(R.onclick=()=>!1);return}R.onclick=()=>{var R;null==W||W();let{fields:j,refs:B,include:z}=N,U=[];if(0!==j.length||0!==B.length){let R=new Set(B);for(let N of j){let W=this._fieldObjects[N]||[];for(let{id:N}of W)R.add(N)}for(let N of Object.values(this._fieldObjects))for(let W of N)R.has(W.id)===z&&U.push(W)}else for(let R of Object.values(this._fieldObjects))U.push(...R);let V=this.annotationStorage,G=[];for(let R of U){let{id:N}=R;switch(G.push(N),R.type){case"text":{let W=R.defaultValue||"";V.setValue(N,{value:W});break}case"checkbox":case"radiobutton":{let W=R.defaultValue===R.exportValues;V.setValue(N,{value:W});break}case"combobox":case"listbox":{let W=R.defaultValue||"";V.setValue(N,{value:W});break}default:continue}let W=document.querySelector(`[data-element-id="${N}"]`);if(W){if(!v7.has(W)){vt(`_bindResetFormAction - element not allowed: ${N}`);continue}W.dispatchEvent(new Event("resetform"))}}return this.enableScripting&&(null==(R=this.linkService.eventBus)||R.dispatch("dispatcheventinsandbox",{source:this,detail:{id:"app",ids:G,name:"ResetForm"}})),!1}}};sH=new WeakSet,sU=function(){this.container.setAttribute("data-internal-link","")},sV=new WeakSet,sG=function(R,N,W=null){R.href=this.linkService.getAnchorUrl(""),N.description&&(R.title=N.description),R.onclick=()=>{var R;return null==(R=this.downloadManager)||R.openOrDownloadData(N.content,N.filename,W),!1},A(this,sH,sU).call(this)},sq=new WeakSet,sX=function(R,N){R.href=this.linkService.getAnchorUrl(""),R.onclick=()=>(this.linkService.executeSetOCGState(N),!1),A(this,sH,sU).call(this)};let sL=class sL extends we{constructor(R){super(R,{isRenderable:!0})}render(){this.container.classList.add("textAnnotation");let R=document.createElement("img");return R.src=this.imageResourcesPath+"annotation-"+this.data.name.toLowerCase()+".svg",R.setAttribute("data-l10n-id","pdfjs-text-annotation-type"),R.setAttribute("data-l10n-args",JSON.stringify({type:this.data.name})),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.append(R),this.container}};let co=class co extends we{render(){return this.container}showElementAndHideCanvas(R){var N;this.data.hasOwnCanvas&&((null==(N=R.previousSibling)?void 0:N.nodeName)==="CANVAS"&&(R.previousSibling.hidden=!0),R.hidden=!1)}_getKeyModifier(R){return Ge.platform.isMac?R.metaKey:R.ctrlKey}_setEventListener(R,N,W,j,B){W.includes("mouse")?R.addEventListener(W,R=>{var N;null==(N=this.linkService.eventBus)||N.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:j,value:B(R),shift:R.shift
222Key,modifier:this._getKeyModifier(R)}})}):R.addEventListener(W,R=>{var z;if("blur"===W){if(!N.focused||!R.relatedTarget)return;N.focused=!1}else if("focus"===W){if(N.focused)return;N.focused=!0}B&&(null==(z=this.linkService.eventBus)||z.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:j,value:B(R)}}))})}_setEventListeners(R,N,W,j){var B,z,U;for(let[V,G]of W)("Action"===G||null!=(B=this.data.actions)&&B[G])&&(("Focus"===G||"Blur"===G)&&(N||(N={focused:!1})),this._setEventListener(R,N,V,G,j),"Focus"!==G||null!=(z=this.data.actions)&&z.Blur?"Blur"!==G||null!=(U=this.data.actions)&&U.Focus||this._setEventListener(R,N,"focus","Focus",null):this._setEventListener(R,N,"blur","Blur",null))}_setBackgroundColor(R){let N=this.data.backgroundColor||null;R.style.backgroundColor=null===N?"transparent":Q.makeHexColor(N[0],N[1],N[2])}_setTextStyle(R){let N;let{fontColor:W}=this.data.defaultAppearanceData,j=this.data.defaultAppearanceData.fontSize||9,B=R.style,c=R=>Math.round(10*R)/10;if(this.data.multiLine){let R=Math.abs(this.data.rect[3]-this.data.rect[1]-2);N=Math.min(j,c(R/(Math.round(R/(1.35*j))||1)/1.35))}else{let R=Math.abs(this.data.rect[3]-this.data.rect[1]-2);N=Math.min(j,c(R/1.35))}B.fontSize=`calc(${N}px * var(--scale-factor))`,B.color=Q.makeHexColor(W[0],W[1],W[2]),null!==this.data.textAlignment&&(B.textAlign=["left","center","right"][this.data.textAlignment])}_setRequired(R,N){N?R.setAttribute("required",!0):R.removeAttribute("required"),R.setAttribute("aria-required",N)}};let oL=class oL extends co{constructor(R){let N=R.renderForms||R.data.hasOwnCanvas||!R.data.hasAppearance&&!!R.data.fieldValue;super(R,{isRenderable:N})}setPropertyOnSiblings(R,N,W,j){let B=this.annotationStorage;
222for(let z of this._getElementsByName(R.name,R.id))z.domElement&&(z.domElement[N]=W),B.setValue(z.id,{[j]:W})}render(){var R,N;let W=this.annotationStorage,j=this.data.id;this.container.classList.add("textWidgetAnnotation");let B=null;if(this.renderForms){let z=W.getValue(j,{value:this.data.fieldValue}),U=z.value||"",V=W.getValue(j,{charLimit:this.data.maxLen}).charLimit;V&&U.length>V&&(U=U.slice(0,V));let G=z.formattedValue||(null==(R=this.data.textContent)?void 0:R.join(` 223`))||null;G&&this.data.comb&&(G=G.replaceAll(/\s+/g,""));let Y={userValue:U,formattedValue:G,lastCommittedValue:null,commitKey:1,focused:!1};this.data.multiLine?((B=document.createElement("textarea")).textContent=G??U,this.data.doNotScroll&&(B.style.overflowY="hidden")):((B=document.createElement("input")).type="text",B.setAttribute("value",G??U),this.data.doNotScroll&&(B.style.overflowX="hidden")),this.data.hasOwnCanvas&&(B.hidden=!0),v7.add(B),B.setAttribute("data-element-id",j),B.disabled=this.data.readOnly,B.name=this.data.fieldName,B.tabIndex=1e3,this._setRequired(B,this.data.required),V&&(B.maxLength=V),B.addEventListener("input",R=>{W.setValue(j,{value:R.target.value}),this.setPropertyOnSiblings(B,"value",R.target.value,"value"),Y.formattedValue=null}),B.addEventListener("resetform",R=>{let N=this.data.defaultFieldValue??"";B.value=Y.userValue=N,Y.formattedValue=null});let f=R=>{let{formattedValue:N}=Y;null!=N&&(R.target.value=N),R.target.scrollLeft=0};if(this.enableScripting&&this.hasJSActions){B.addEventListener("focus",R=>{var N;if(Y.focused)return;let{target:W}=R;Y.userValue&&(W.value=Y.userValue),Y.lastCommittedValue=W.value,Y.commitKey=1,null!=(N=this.data.actions)&&N.Focus||(Y.focused=!0)}),B.addEventListener("updatefromsandbox",R=>{this.showElementAndHideCanvas(R.target),this._dispatchEventFromSandbox({value(R){Y.userValue=R.detail.value??"",W.setValue(j,{value:Y.userValue.toString()}),R.target.value=Y.userValue},formattedValue(R){let{formattedValue:N}=R.detail;Y.formattedValue=N,null!=N&&R.target!==document.activeElement&&(R.target.value=N),W.setValue(j,{formattedValue:N})},selRange(R){R.target.setSelectionRange(...R.detail.selRange)},charLimit:R=>{var N;let{charLimit:B}=R.detail,{target:z}=R;if(0===B){z.removeAttribute("maxLength");return}z.setAttribute("maxLength",B);let U=Y.userValue;!U||U.length<=B||(U=U.slice(0,B),z.value=Y.userValue=U,W.setValue(j,{value:U}),null==(N=this.linkService.eventBus)||N.dispatch("dispatcheventinsandbox",{source:this,detail:{id:j,name:"Keystroke",value:U,willCommit:!0,commitKey:1,selStart:z.selectionStart,selEnd:z.selectionEnd}}))}},R)}),B.addEventListener("keydown",R=>{var N;Y.commitKey=1;let W=-1;if("Escape"===R.key?W=0:"Enter"!==R.key||this.data.multiLine?"Tab"===R.key&&(Y.commitKey=3):W=2,-1===W)return;let{value:B}=R.target;Y.lastCommittedValue!==B&&(Y.lastCommittedValue=B,Y.userValue=B,null==(N=this.linkService.eventBus)||N.dispatch("dispatcheventinsandbox",{source:this,detail:{id:j,name:"Keystroke",value:B,willCommit:!0,commitKey:W,selStart:R.target.selectionStart,selEnd:R.target.selectionEnd}}))});let R=f;f=null,B.addEventListener("blur",N=>{var W,B;if(!Y.focused||!N.relatedTarget)return;null!=(W=this.data.actions)&&W.Blur||(Y.focused=!1);let{value:z}=N.target;Y.userValue=z,Y.lastCommittedValue!==z&&(null==(B=this.linkService.eventBus)||B.dispatch("dispatcheventinsandbox",{source:this,detail:{id:j,name:"Keystroke",value:z,willCommit:!0,commitKey:Y.commitKey,selStart:N.target.selectionStart,selEnd:N.target.selectionEnd}})),R(N)}),null!=(N=this.data.actions)&&N.Keystroke&&B.addEventListener("beforeinput",R=>{var N;Y.lastCommittedValue=null;let{data:W,target:B}=R,{value:z,selectionStart:U,selectionEnd:V}=B,G=U,Z=V;switch(R.inputType){case"deleteWordBackward":{let R=z.substring(0,U).match(/\w*[^\w]*$/);R&&(G-=R[0].length);break}
223case"deleteWordForward":{let R=z.substring(U).match(/^[^\w]*\w*/);R&&(Z+=R[0].length);break}case"deleteContentBackward":U===V&&(G-=1);break;case"deleteContentForward":U===V&&(Z+=1)}R.preventDefault(),null==(N=this.linkService.eventBus)||N.dispatch("dispatcheventinsandbox",{source:this,detail:{id:j,name:"Keystroke",value:z,change:W||"",willCommit:!1,selStart:G,selEnd:Z}})}),this._setEventListeners(B,Y,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],R=>R.target.value)}if(f&&B.addEventListener("blur",f),this.data.comb){let R=(this.data.rect[2]-this.data.rect[0])/V;B.classList.add("comb"),B.style.letterSpacing=`calc(${R}px * var(--scale-factor) - 1ch)`}}else(B=document.createElement("div")).textContent=this.data.fieldValue,B.style.verticalAlign="middle",B.style.display="table-cell",this.data.hasOwnCanvas&&(B.hidden=!0);return this._setTextStyle(B),this._setBackgroundColor(B),this._setDefaultPropertiesFromJS(B),this.container.append(B),this.container}};let aL=class aL extends co{constructor(R){super(R,{isRenderable:!!R.data.hasOwnCanvas})}};let lL=class lL extends co{constructor(R){super(R,{isRenderable:R.renderForms})}render(){let R=this.annotationStorage,N=this.data,W=N.id,j=R.getValue(W,{value:N.exportValue===N.fieldValue}).value;"string"==typeof j&&(j="Off"!==j,R.setValue(W,{value:j})),this.container.classList.add("buttonWidgetAnnotation","checkBox");let B=document.createElement("input");return v7.add(B),B.setAttribute("data-element-id",W),B.disabled=N.readOnly,this._setRequired(B,this.data.required),B.type="checkbox",B.name=N.fieldName,j&&B.setAttribute("checked",!0),B.setAttribute("exportValue",N.exportValue),B.tabIndex=1e3,B.addEventListener("change",j=>{let{name:B,checked:z}=j.target;for(let j of this._getElementsByName(B,W)){let W=z&&j.exportValue===N.exportValue;j.domElement&&(j.domElement.checked=W),R.setValue(j.id,{value:W})}R.setValue(W,{value:z})}),B.addEventListener("resetform",R=>{let W=N.defaultFieldValue||"Off";R.target.checked=W===N.exportValue}),this.enableScripting&&this.hasJSActions&&(B.addEventListener("updatefromsandbox",N=>{this._dispatchEventFromSandbox({value(N){N.target.checked="Off"!==N.detail.value,R.setValue(W,{value:N.target.checked})}},N)}),this._setEventListeners(B,null,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],R=>R.target.checked)),this._setBackgroundColor(B),this._setDefaultPropertiesFromJS(B),this.container.append(B),this.container}};let yw=class yw extends co{constructor(R){super(R,{isRenderable:R.renderForms})}render(){this.container.classList.add("buttonWidgetAnnotation","radioButton");let R=this.annotationStorage,N=this.data,W=N.id,j=R.getValue(W,{value:N.fieldValue===N.buttonValue}).value;if("string"==typeof j&&(j=j!==N.buttonValue,R.setValue(W,{value:j})),j)for(let j of this._getElementsByName(N.fieldName,W))R.setValue(j.id,{value:!1});let B=document.createElement("input");if(v7.add(B),B.setAttribute("data-element-id",W),B.disabled=N.readOnly,this._setRequired(B,this.data.required),B.type="radio",B.name=N.fieldName,j&&B.setAttribute("checked",!0),B.tabIndex=1e3,B.addEventListener("change",N=>{let{name:j,checked:B}=N.target;for(let N of this._getElementsByName(j,W))R.setValue(N.id,{value:!1});R.setValue(W,{value:B})}),B.addEventListener("resetform",R=>{let W=N.defaultFieldValue;R.target.checked=null!=W&&W===N.buttonValue}),this.enableScripting&&this.hasJSActions){let j=N.buttonValue;B.addEventListener("updatefromsandbox",N=>{this._dispatchEventFromSandbox({value:N=>{let B=j===N.detail.value;for(let j of this._getElementsByName(N.target.name)){let N=B&&j.id===W;j.domElement&&(j.domElement.checked=N),R.setValue(j.id,{value:N})}}},N)}),this._setEventListeners(B,null,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],R=>R.target.checked)}
223return this._setBackgroundColor(B),this._setDefaultPropertiesFromJS(B),this.container.append(B),this.container}};let cL=class cL extends gw{constructor(R){super(R,{ignoreBorder:R.data.hasAppearance})}render(){let R=super.render();R.classList.add("buttonWidgetAnnotation","pushButton");let N=R.lastChild;return this.enableScripting&&this.hasJSActions&&N&&(this._setDefaultPropertiesFromJS(N),N.addEventListener("updatefromsandbox",R=>{this._dispatchEventFromSandbox({},R)})),R}};let hL=class hL extends co{constructor(R){super(R,{isRenderable:R.renderForms})}render(){this.container.classList.add("choiceWidgetAnnotation");let R=this.annotationStorage,N=this.data.id,W=R.getValue(N,{value:this.data.fieldValue}),j=document.createElement("select");v7.add(j),j.setAttribute("data-element-id",N),j.disabled=this.data.readOnly,this._setRequired(j,this.data.required),j.name=this.data.fieldName,j.tabIndex=1e3;let B=this.data.combo&&this.data.options.length>0;for(let R of(this.data.combo||(j.size=this.data.options.length,this.data.multiSelect&&(j.multiple=!0)),j.addEventListener("resetform",R=>{let N=this.data.defaultFieldValue;for(let R of j.options)R.selected=R.value===N}),this.data.options)){let N=document.createElement("option");N.textContent=R.displayValue,N.value=R.exportValue,W.value.includes(R.exportValue)&&(N.setAttribute("selected",!0),B=!1),j.append(N)}let z=null;if(B){let R=document.createElement("option");R.value=" ",R.setAttribute("hidden",!0),R.setAttribute("selected",!0),j.prepend(R),z=()=>{R.remove(),j.removeEventListener("input",z),z=null},j.addEventListener("input",z)}let l=R=>{let N=R?"value":"textContent",{options:W,multiple:B}=j;return B?Array.prototype.filter.call(W,R=>R.selected).map(R=>R[N]):-1===W.selectedIndex?null:W[W.selectedIndex][N]},U=l(!1),d=R=>{let N=R.target.options;return Array.prototype.map.call(N,R=>({displayValue:R.textContent,exportValue:R.value}))};return this.enableScripting&&this.hasJSActions?(j.addEventListener("updatefromsandbox",W=>{this._dispatchEventFromSandbox({value(W){null==z||z();let B=W.detail.value,V=new Set(Array.isArray(B)?B:[B]);for(let R of j.options)R.selected=V.has(R.value);R.setValue(N,{value:l(!0)}),U=l(!1)},multipleSelection(R){j.multiple=!0},remove(W){let B=j.options,z=W.detail.remove;B[z].selected=!1,j.remove(z),B.length>0&&-1===Array.prototype.findIndex.call(B,R=>R.selected)&&(B[0].selected=!0),R.setValue(N,{value:l(!0),items:d(W)}),U=l(!1)},clear(W){for(;0!==j.length;)j.remove(0);R.setValue(N,{value:null,items:[]}),U=l(!1)},insert(W){let{index:B,displayValue:z,exportValue:V}=W.detail.insert,G=j.children[B],Y=document.createElement("option");Y.textContent=z,Y.value=V,G?G.before(Y):j.append(Y),R.setValue(N,{value:l(!0),items:d(W)}),U=l(!1)},items(W){let{items:B}=W.detail;for(;0!==j.length;)j.remove(0);for(let R of B){let{displayValue:N,exportValue:W}=R,B=document.createElement("option");B.textContent=N,B.value=W,j.append(B)}j.options.length>0&&(j.options[0].selected=!0),R.setValue(N,{value:l(!0),items:d(W)}),U=l(!1)},indices(W){let j=new Set(W.detail.indices);for(let R of W.target.options)R.selected=j.has(R.index);R.setValue(N,{value:l(!0)}),U=l(!1)},editable(R){R.target.disabled=!R.detail.editable}},W)}),j.addEventListener("input",W=>{var j;let B=l(!0),z=l(!1);R.setValue(N,{value:B}),W.preventDefault(),null==(j=this.linkService.eventBus)||j.dispatch("dispatcheventinsandbox",{source:this,detail:{id:N,name:"Keystroke",value:U,change:z,changeEx:B,willCommit:!1,commitKey:1,keyDown:!1}})}),this._setEventListeners(j,null,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"],["input","Action"],["input","Validate"]],R=>R.target.value)):j.addEventListener("input",function(W){R.setValue(N,{value:l(!0)})}),this.data.combo&&this._setTextStyle(j),this._setBackgroundColor(j),this._setDefaultPropertiesFromJS(j),this.container.append(j),this.container}};let am=class am extends we{constructor(R){let{data:N,elements:W}=R;super(R,{isRenderable:we._hasPopupData(N)}),this.elements=W,this.popup=null}render(){this.container.classList.add("popupAnnotation");let R=this.popup=new dL({container:this.container,color:this.data.color,titleObj:this.data.titleObj,modificationDate:this.data.modificationDate,contentsObj:this.data.contentsObj,richText:this.data.richText,rect:this.data.rect,parentRect:this.data.parentRect||null,parent:this.parent,elements:this.elements,open:this.data.open}),N=[];for(let W of this.elements)W.popup=R,N.push(W.data.id),W.addHighlightArea();return this.container.setAttribute("aria-controls",N.map(R=>`${vl}${R}`).join(",")),this.container}}
223;let dL=class dL{constructor({container:R,color:N,elements:W,titleObj:j,modificationDate:B,contentsObj:z,richText:U,parent:V,rect:G,parentRect:Y,open:Z}){var te;for(let Z of(m(this,al),m(this,ac),m(this,au),m(this,af),m(this,av),m(this,aA),m(this,a_),m(this,aE),m(this,aC),m(this,sY,A(this,av,ab).bind(this)),m(this,sK,A(this,aC,aM).bind(this)),m(this,sQ,A(this,aE,ak).bind(this)),m(this,sJ,A(this,a_,aS).bind(this)),m(this,sZ,null),m(this,s1,null),m(this,s3,null),m(this,s5,null),m(this,s4,null),m(this,s6,null),m(this,s8,null),m(this,s7,!1),m(this,s9,null),m(this,at,null),m(this,ai,null),m(this,an,null),m(this,ar,null),m(this,as,null),m(this,aa,!1),w(this,s1,R),w(this,ar,j),w(this,s3,z),w(this,an,U),w(this,s6,V),w(this,sZ,N),w(this,ai,G),w(this,s8,Y),w(this,s4,W),w(this,s5,Tb.toDateObject(B)),this.trigger=W.flatMap(R=>R.getElementsToTriggerPopup()),this.trigger))Z.addEventListener("click",a(this,sJ)),Z.addEventListener("mouseenter",a(this,sQ)),Z.addEventListener("mouseleave",a(this,sK)),Z.classList.add("popupTriggerArea");for(let R of W)null==(te=R.container)||te.addEventListener("keydown",a(this,sY));a(this,s1).hidden=!0,Z&&A(this,a_,aS).call(this)}render(){if(a(this,s9))return;let R=w(this,s9,document.createElement("div"));if(R.className="popup",a(this,sZ)){let N=R.style.outlineColor=Q.makeHexColor(...a(this,sZ));CSS.supports("background-color","color-mix(in srgb, red 30%, white)")?R.style.backgroundColor=`color-mix(in srgb, ${N} 30%, white)`:R.style.backgroundColor=Q.makeHexColor(...a(this,sZ).map(R=>Math.floor(.7*(255-R)+R)))}let N=document.createElement("span");N.className="header";let W=document.createElement("h1");if(N.append(W),{dir:W.dir,str:W.textContent}=a(this,ar),R.append(N),a(this,s5)){let R=document.createElement("span");R.classList.add("popupDate"),R.setAttribute("data-l10n-id","pdfjs-annotation-date-string"),R.setAttribute("data-l10n-args",JSON.stringify({date:a(this,s5).toLocaleDateString(),time:a(this,s5).toLocaleTimeString()})),N.append(R)}let j=a(this,al,ah);if(j)pw.render({xfaHtml:j,intent:"richText",div:R}),R.lastChild.classList.add("richText","popupContent");else{let N=this._formatContents(a(this,s3));R.append(N)}a(this,s1).append(R)}_formatContents({str:R,dir:N}){let W=document.createElement("p");W.classList.add("popupContent"),W.dir=N;let j=R.split(/(?:\r\n?|\n)/);for(let R=0,N=j.length;R<N;++R){let B=j[R];W.append(document.createTextNode(B)),R<N-1&&W.append(document.createElement("br"))}return W}updateEdited({rect:R,popupContent:N}){var W;a(this,as)||w(this,as,{contentsObj:a(this,s3),richText:a(this,an)}),R&&w(this,at,null),N&&(w(this,an,A(this,af,ag).call(this,N)),w(this,s3,null)),null==(W=a(this,s9))||W.remove(),w(this,s9,null)}resetEdited(){var R;a(this,as)&&({contentsObj:We(this,s3)._,richText:We(this,an)._}=a(this,as),w(this,as,null),null==(R=a(this,s9))||R.remove(),w(this,s9,null),w(this,at,null))}forceHide(){w(this,aa,this.isVisible),a(this,aa)&&(a(this,s1).hidden=!0)}maybeShow(){a(this,aa)&&(a(this,s9)||A(this,aE,ak).call(this),w(this,aa,!1),a(this,s1).hidden=!1)}get isVisible(){return!1===a(this,s1).hidden}};sY=new WeakMap,sK=new WeakMap,sQ=new WeakMap,sJ=new WeakMap,sZ=new WeakMap,s1=new WeakMap,s3=new WeakMap,s5=new WeakMap,s4=new WeakMap,s6=new WeakMap,s8=new WeakMap,s7=new WeakMap,s9=new WeakMap,at=new WeakMap,ai=new WeakMap,an=new WeakMap,ar=new WeakMap,as=new WeakMap,aa=new WeakMap,al=new WeakSet,ah=function(){let R=a(this,an),N=a(this,s3);return null!=R&&R.str&&(!(null!=N&&N.str)||N.str===R.str)&&a(this,an).html||null},ac=new WeakSet,ad=function(){var R,N,W;return(null==(W=null==(N=null==(R=a(this,al,ah))?void 0:R.attributes)?void 0:N.style)?void 0:W.fontSize)||0},au=new WeakSet,ap=function(){var R,N,W;return(null==(W=null==(N=null==(R=a(this,al,ah))?void 0:R.attributes)?void 0:N.style)?void 0:W.color)||null},af=new WeakSet,ag=function(R){let N=[],W={style:{color:a(this,au,ap),fontSize:a(this,ac,ad)?`calc(${a(this,ac,ad)}px * var(--scale-factor))`:""}};for(let j of R.split(` 224`))N.push({name:"span",value:j,attributes:W});return{str:R,html:{name:"div",attributes:{dir:"auto"},children:[{name:"p",children:N}]}}},av=new WeakSet,ab=function(R){R.altKey||R.shiftKey||R.ctrlKey||R.metaKey||("Enter"===R.key||"Escape"===R.key&&a(this,s7))&&A(this,a_,aS).call(this)},aA=new WeakSet,ax=function(){if(null!==a(this,at))return;let{page:{view:R},viewport:{rawDims:{pageWidth:N,pageHeight:W,pageX:j,pageY:B}}}=a(this,s6),z=!!a(this,s8),U=z?a(this,s8):a(this,ai);for(let R of a(this,s4))if(!U||null!==Q.intersect(R.data.rect,U)){U=R.data.rect,z=!0;break}let V=Q.normalizeRect([U[0],R[3]-U[1]+R[1],U[2],R[3]-U[3]+R[1]]),G=z?U[2]-U[0]+5:0,Y=V[0]+G,Z=V[1];w(this,at,[100*(Y-j)/N,100*(Z-B)/W]);let{style:te}=a(this,s1);te.left=`${a(this,at)[0]}%`,te.top=`${a(this,at)[1]}%`},a_=new WeakSet,aS=function(){w(this,s7,!a(this,s7)),a(this,s7)?(A(this,aE,ak).call(this),a(this,s1).addEventListener("click",a(this,sJ)),a(this,s1).addEventListener("keydown",a(this,sY))):(A(this,aC,aM).call(this),a(this,s1).removeEventListener("click",a(this,sJ)),a(this,s1).removeEventListener("keydown",a(this,sY)))},aE=new WeakSet,ak=function(){a(this,s9)||this.render(),this.isVisible?a(this,s7)&&a(this,s1).classList.add("focused"):(A(this,aA,ax).call(this),a(this,s1).hidden=!1,a(this,s1).style.zIndex=parseInt(a(this,s1).style.zIndex)+1e3)},aC=new WeakSet,aM=function(){a(this,s1).classList.remove("focused"),a(this,s7)||!this.isVisible||(a(this,s1).hidden=!0,a(this,s1).style.zIndex=parseInt(a(this,s1).style.zIndex)-1e3)};let _w=class _w extends we{constructor(R){super(R,{isRenderable:!0,ignoreBorder:!0}),this.textContent=R.data.textContent,this.textPosition=R.data.textPosition,this.annotationEditorType=mZ.FREETEXT}
224render(){if(this.container.classList.add("freeTextAnnotation"),this.textContent){let R=document.createElement("div");for(let N of(R.classList.add("annotationTextContent"),R.setAttribute("role","comment"),this.textContent)){let W=document.createElement("span");W.textContent=N,R.append(W)}this.container.append(R)}return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this._editOnDoubleClick(),this.container}get _isEditable(){return this.data.hasOwnCanvas}};let uL=class uL extends we{constructor(R){super(R,{isRenderable:!0,ignoreBorder:!0}),m(this,aT,null)}render(){this.container.classList.add("lineAnnotation");let R=this.data,{width:N,height:W}=Gi(R.rect),j=this.svgFactory.create(N,W,!0),B=w(this,aT,this.svgFactory.createElement("svg:line"));return B.setAttribute("x1",R.rect[2]-R.lineCoordinates[0]),B.setAttribute("y1",R.rect[3]-R.lineCoordinates[1]),B.setAttribute("x2",R.rect[2]-R.lineCoordinates[2]),B.setAttribute("y2",R.rect[3]-R.lineCoordinates[3]),B.setAttribute("stroke-width",R.borderStyle.width||1),B.setAttribute("stroke","transparent"),B.setAttribute("fill","transparent"),j.append(B),this.container.append(j),!R.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return a(this,aT)}addHighlightArea(){this.container.classList.add("highlightArea")}};aT=new WeakMap;let fL=class fL extends we{constructor(R){super(R,{isRenderable:!0,ignoreBorder:!0}),m(this,aR,null)}render(){this.container.classList.add("squareAnnotation");let R=this.data,{width:N,height:W}=Gi(R.rect),j=this.svgFactory.create(N,W,!0),B=R.borderStyle.width,z=w(this,aR,this.svgFactory.createElement("svg:rect"));return z.setAttribute("x",B/2),z.setAttribute("y",B/2),z.setAttribute("width",N-B),z.setAttribute("height",W-B),z.setAttribute("stroke-width",B||1),z.setAttribute("stroke","transparent"),z.setAttribute("fill","transparent"),j.append(z),this.container.append(j),!R.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return a(this,aR)}addHighlightArea(){this.container.classList.add("highlightArea")}};aR=new WeakMap;let pL=class pL extends we{constructor(R){super(R,{isRenderable:!0,ignoreBorder:!0}),m(this,aP,null)}render(){this.container.classList.add("circleAnnotation");let R=this.data,{width:N,height:W}=Gi(R.rect),j=this.svgFactory.create(N,W,!0),B=R.borderStyle.width,z=w(this,aP,this.svgFactory.createElement("svg:ellipse"));return z.setAttribute("cx",N/2),z.setAttribute("cy",W/2),z.setAttribute("rx",N/2-B/2),z.setAttribute("ry",W/2-B/2),z.setAttribute("stroke-width",B||1),z.setAttribute("stroke","transparent"),z.setAttribute("fill","transparent"),j.append(z),this.container.append(j),!R.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return a(this,aP)}addHighlightArea(){this.container.classList.add("highlightArea")}};aP=new WeakMap;let Sw=class Sw extends we{constructor(R){super(R,{isRenderable:!0,ignoreBorder:!0}),m(this,aI,null),this.containerClassName="polylineAnnotation",this.svgElementName="svg:polyline"}render(){this.container.classList.add(this.containerClassName);let R=this.data,{width:N,height:W}=Gi(R.rect),j=this.svgFactory.create(N,W,!0),B=[];for(let N of R.vertices){let W=N.x-R.rect[0],j=R.rect[3]-N.y;B.push(W+","+j)}B=B.join(" ");let z=w(this,aI,this.svgFactory.createElement(this.svgElementName));return z.setAttribute("points",B),z.setAttribute("stroke-width",R.borderStyle.width||1),z.setAttribute("stroke","transparent"),z.setAttribute("fill","transparent"),j.append(z),this.container.append(j),!R.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return a(this,aI)}addHighlightArea(){this.container.classList.add("highlightArea")}};aI=new WeakMap;let gL=class gL extends Sw{constructor(R){super(R),this.containerClassName="polygonAnnotation",this.svgElementName="svg:polygon"}};let mL=class mL extends we{constructor(R){super(R,{isRenderable:!0,ignoreBorder:!0})}render(){return this.container.classList.add("caretAnnotation"),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container}}
224;let xw=class xw extends we{constructor(R){super(R,{isRenderable:!0,ignoreBorder:!0}),m(this,aD,[]),this.containerClassName="inkAnnotation",this.svgElementName="svg:polyline",this.annotationEditorType=mZ.INK}render(){this.container.classList.add(this.containerClassName);let R=this.data,{width:N,height:W}=Gi(R.rect),j=this.svgFactory.create(N,W,!0);for(let N of R.inkLists){let W=[];for(let j of N){let N=j.x-R.rect[0],B=R.rect[3]-j.y;W.push(`${N},${B}`)}W=W.join(" ");let B=this.svgFactory.createElement(this.svgElementName);a(this,aD).push(B),B.setAttribute("points",W),B.setAttribute("stroke-width",R.borderStyle.width||1),B.setAttribute("stroke","transparent"),B.setAttribute("fill","transparent"),!R.popupRef&&this.hasPopupData&&this._createPopup(),j.append(B)}return this.container.append(j),this.container}getElementsToTriggerPopup(){return a(this,aD)}addHighlightArea(){this.container.classList.add("highlightArea")}};aD=new WeakMap;let vL=class vL extends we{constructor(R){super(R,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("highlightAnnotation"),this.container}};let yL=class yL extends we{constructor(R){super(R,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("underlineAnnotation"),this.container}};let bL=class bL extends we{constructor(R){super(R,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("squigglyAnnotation"),this.container}};let wL=class wL extends we{constructor(R){super(R,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("strikeoutAnnotation"),this.container}};let Cw=class Cw extends we{constructor(R){super(R,{isRenderable:!0,ignoreBorder:!0})}render(){return this.container.classList.add("stampAnnotation"),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container}};let AL=class AL extends we{constructor(R){var N;super(R,{isRenderable:!0}),m(this,aO),m(this,aN,null);let{file:W}=this.data;this.filename=W.filename,this.content=W.content,null==(N=this.linkService.eventBus)||N.dispatch("fileattachmentannotation",{source:this,...W})}render(){let R;this.container.classList.add("fileAttachmentAnnotation");let{container:N,data:W}=this;W.hasAppearance||0===W.fillAlpha?R=document.createElement("div"):((R=document.createElement("img")).src=`${this.imageResourcesPath}annotation-${/paperclip/i.test(W.name)?"paperclip":"pushpin"}.svg`,W.fillAlpha&&W.fillAlpha<1&&(R.style=`filter: opacity(${Math.round(100*W.fillAlpha)}%);`)),R.addEventListener("dblclick",A(this,aO,aF).bind(this)),w(this,aN,R);let{isMac:j}=Ge.platform;return N.addEventListener("keydown",R=>{"Enter"===R.key&&(j?R.metaKey:R.ctrlKey)&&A(this,aO,aF).call(this)}),!W.popupRef&&this.hasPopupData?this._createPopup():R.classList.add("popupTriggerArea"),N.append(R),N}getElementsToTriggerPopup(){return a(this,aN)}addHighlightArea(){this.container.classList.add("highlightArea")}};aN=new WeakMap,aO=new WeakSet,aF=function(){var R;null==(R=this.downloadManager)||R.openOrDownloadData(this.content,this.filename)};let wi=(aV=class{constructor({div:R,accessibilityManager:N,annotationCanvasMap:W,annotationEditorUIManager:j,page:B,viewport:z}){m(this,a$),m(this,aH),m(this,aW,null),m(this,aj,null),m(this,aB,new Map),this.div=R,w(this,aW,N),w(this,aj,W),this.page=B,this.viewport=z,this.zIndex=0,this._annotationEditorUIManager=j}async render(R){var N;let{annotations:W}=R,j=this.div;to(j,this.viewport);let B=new Map,z={data:null,layer:j,linkService:R.linkService,downloadManager:R.downloadManager,imageResourcesPath:R.imageResourcesPath||"",renderForms:!1!==R.renderForms,svgFactory:new u0,annotationStorage:R.annotationStorage||new v0,enableScripting:!0===R.enableScripting,hasJSActions:R.hasJSActions,fieldObjects:R.fieldObjects,parent:this,elements:null};for(let R of W){if(R.noHTML)continue;let W=R.annotationType===m6.POPUP;if(W){let N=B.get(R.id);if(!N)continue;z.elements=N}else{let{width:N,height:W}=Gi(R.rect);if(N<=0||W<=0)continue}z.data=R;let j=rL.create(z);if(!j.isRenderable)continue;if(!W&&R.popupRef){let N=B.get(R.popupRef);N?N.push(j):B.set(R.popupRef,[j])}let U=j.render();R.hidden&&(U.style.visibility="hidden"),A(this,a$,az).call(this,U,R.id),j.annotationEditorType>0&&(a(this,aB).set(j.data.id,j),null==(N=this._annotationEditorUIManager)||N.renderAnnotationElement(j))}A(this,aH,aU).call(this)}update({viewport:R}){let N=this.div;this.viewport=R,to(N,{rotation:R.rotation}),A(this,aH,aU).call(this),N.hidden=!1}getEditableAnnotations(){return Array.from(a(this,aB).values())}getEditableAnnotation(R){return a(this,aB).get(R)}},aW=new WeakMap,aj=new WeakMap,aB=new WeakMap,a$=new WeakSet,az=function(R,N){var W;let j=R.firstChild||R;j.id=`${vl}${N}`,this.div.append(R),null==(W=a(this,aW))||W.moveElementInDOM(this.div,R,j,!1)},aH=new WeakSet,aU=function(){if(!a(this,aj))return;let R=this.div;for(let[N,W]of a(this,aj)){let j=R.querySelector(`[data-annotation-id="${N}"]`);if(!j)continue;W.className="annotationContent";let{firstChild:B}=j;B?"CANVAS"===B.nodeName?B.replaceWith(W):B.classList.contains("annotationContent")?B.after(W):B.before(W):j.append(W)}a(this,aj).clear()},aV),wn=/\r\n?|\n/g,wr=class Bt extends vE{constructor(R){super({...R,name:"freeTextEditor"}),m(this,a5),m(this,a6),m(this,a7),m(this,oe),m(this,oa),m(this,oh),m(this,op),m(this,aG,this.editorDivBlur.bind(this)),m(this,aq,this.editorDivFocus.bind(this)),m(this,aX,this.editorDivInput.bind(this)),m(this,aY,this.editorDivKeydown.bind(this)),m(this,aK,this.editorDivPaste.bind(this)),m(this,aQ,void 0),m(this,aJ,""),m(this,aZ,`${this.id}-editor`),m(this,a1,void 0),m(this,a3,null),w(this,aQ,R.color||Bt._defaultColor||vE._defaultLineColor),w(this,a1,R.fontSize||Bt._defaultFontSize)}static get _keyboardManager(){let R=Bt.prototype,n=R=>R.isEmpty(),N=vx.TRANSLATE_SMALL,W=vx.TRANSLATE_BIG;return Tt(this,"_keyboardManager",new Qh([[["ctrl+s","mac+meta+s","ctrl+p","mac+meta+p"],R.commitOrRemove,{bubbles:!0}],[["ctrl+Enter","mac+meta+Enter","Escape","mac+Escape"],R.commitOrRemove],[["ArrowLeft","mac+ArrowLeft"],R._translateEmpty,{args:[-N,0],checker:n}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],R._translateEmpty,{args:[-W,0],checker:n}],[["ArrowRight","mac+ArrowRight"],R._translateEmpty,{args:[N,0],checker:n}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],R._translateEmpty,{args:[W,0],checker:n}],[["ArrowUp","mac+ArrowUp"],R._translateEmpty,{args:[0,-N],checker:n}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],R._translateEmpty,{args:[0,-W],checker:n}],[["ArrowDown","mac+ArrowDown"],R._translateEmpty,{args:[0,N],checker:n}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],R._translateEmpty,{args:[0,W],checker:n}]]))}static initialize(R,N){vE.initialize(R,N,{strings:["pdfjs-free-text-default-content"]});let W=getComputedStyle(document.documentElement);this._internalPadding=parseFloat(W.getPropertyValue("--freetext-padding"))}
224static updateDefaultParams(R,N){switch(R){case m1.FREETEXT_SIZE:Bt._defaultFontSize=N;break;case m1.FREETEXT_COLOR:Bt._defaultColor=N}}updateParams(R,N){switch(R){case m1.FREETEXT_SIZE:A(this,a5,a4).call(this,N);break;case m1.FREETEXT_COLOR:A(this,a6,a8).call(this,N)}}static get defaultPropertiesToUpdate(){return[[m1.FREETEXT_SIZE,Bt._defaultFontSize],[m1.FREETEXT_COLOR,Bt._defaultColor||vE._defaultLineColor]]}get propertiesToUpdate(){return[[m1.FREETEXT_SIZE,a(this,a1)],[m1.FREETEXT_COLOR,a(this,aQ)]]}_translateEmpty(R,N){this._uiManager.translateSelectedEditors(R,N,!0)}getInitialTranslation(){let R=this.parentScale;return[-Bt._internalPadding*R,-(Bt._internalPadding+a(this,a1))*R]}rebuild(){this.parent&&(super.rebuild(),null!==this.div&&(this.isAttachedToDOM||this.parent.add(this)))}enableEditMode(){this.isInEditMode()||(this.parent.setEditingState(!1),this.parent.updateToolbar(mZ.FREETEXT),super.enableEditMode(),this.overlayDiv.classList.remove("enabled"),this.editorDiv.contentEditable=!0,this._isDraggable=!1,this.div.removeAttribute("aria-activedescendant"),this.editorDiv.addEventListener("keydown",a(this,aY)),this.editorDiv.addEventListener("focus",a(this,aq)),this.editorDiv.addEventListener("blur",a(this,aG)),this.editorDiv.addEventListener("input",a(this,aX)),this.editorDiv.addEventListener("paste",a(this,aK)))}disableEditMode(){this.isInEditMode()&&(this.parent.setEditingState(!0),super.disableEditMode(),this.overlayDiv.classList.add("enabled"),this.editorDiv.contentEditable=!1,this.div.setAttribute("aria-activedescendant",a(this,aZ)),this._isDraggable=!0,this.editorDiv.removeEventListener("keydown",a(this,aY)),this.editorDiv.removeEventListener("focus",a(this,aq)),this.editorDiv.removeEventListener("blur",a(this,aG)),this.editorDiv.removeEventListener("input",a(this,aX)),this.editorDiv.removeEventListener("paste",a(this,aK)),this.div.focus({preventScroll:!0}),this.isEditing=!1,this.parent.div.classList.add("freetextEditing"))}focusin(R){this._focusEventsAllowed&&(super.focusin(R),R.target!==this.editorDiv&&this.editorDiv.focus())}onceAdded(){var R;this.width||(this.enableEditMode(),this.editorDiv.focus(),null!=(R=this._initialOptions)&&R.isCentered&&this.center(),this._initialOptions=null)}isEmpty(){return!this.editorDiv||""===this.editorDiv.innerText.trim()}remove(){this.isEditing=!1,this.parent&&(this.parent.setEditingState(!0),this.parent.div.classList.add("freetextEditing")),super.remove()}commit(){if(!this.isInEditMode())return;super.commit(),this.disableEditMode();let R=a(this,aJ),N=w(this,aJ,A(this,a7,a9).call(this).trimEnd());if(R===N)return;let i=R=>{if(w(this,aJ,R),!R){this.remove();return}A(this,oa,ol).call(this),this._uiManager.rebuild(this),A(this,oe,on).call(this)};this.addCommands({cmd:()=>{i(N)},undo:()=>{i(R)},mustExec:!1}),A(this,oe,on).call(this)}shouldGetKeyboardEvents(){return this.isInEditMode()}enterInEditMode(){this.enableEditMode(),this.editorDiv.focus()}dblclick(R){this.enterInEditMode()}keydown(R){R.target===this.div&&"Enter"===R.key&&(this.enterInEditMode(),R.preventDefault())}editorDivKeydown(R){Bt._keyboardManager.exec(this,R)}editorDivFocus(R){this.isEditing=!0}editorDivBlur(R){this.isEditing=!1}editorDivInput(R){this.parent.div.classList.toggle("freetextEditing",this.isEmpty())}disableEditing(){this.editorDiv.setAttribute("role","comment"),this.editorDiv.removeAttribute("aria-multiline")}enableEditing(){this.editorDiv.setAttribute("role","textbox"),this.editorDiv.setAttribute("aria-multiline",!0)}render(){let R,N;if(this.div)return this.div;this.width&&(R=this.x,N=this.y),super.render(),this.editorDiv=document.createElement("div"),this.editorDiv.className="internal",this.editorDiv.setAttribute("id",a(this,aZ)),this.editorDiv.setAttribute("data-l10n-id","pdfjs-free-text"),this.enableEditing(),vE._l10nPromise.get("pdfjs-free-text-default-content").then(R=>{var N;return null==(N=this.editorDiv)?void 0:N.setAttribute("default-content",R)}),this.editorDiv.contentEditable=!0;let{style:W}=this.editorDiv;if(W.fontSize=`calc(${a(this,a1)}px * var(--scale-factor))`,W.color=a(this,aQ),this.div.append(this.editorDiv),this.overlayDiv=document.createElement("div"),this.overlayDiv.classList.add("overlay","enabled"),this.div.append(this.overlayDiv),iu(this,this.div,["dblclick","keydown"]),this.width){let[W,j]=this.parentDimensions;
224if(this.annotationElementId){let B,z;let{position:U}=a(this,a3),[V,G]=this.getInitialTranslation();[V,G]=this.pageTranslationToScreen(V,G);let[Y,Z]=this.pageDimensions,[te,tn]=this.pageTranslation;switch(this.rotation){case 0:B=R+(U[0]-te)/Y,z=N+this.height-(U[1]-tn)/Z;break;case 90:B=R+(U[0]-te)/Y,z=N-(U[1]-tn)/Z,[V,G]=[G,-V];break;case 180:B=R-this.width+(U[0]-te)/Y,z=N-(U[1]-tn)/Z,[V,G]=[-V,-G];break;case 270:B=R+(U[0]-te-this.height*Z)/Y,z=N+(U[1]-tn-this.width*Y)/Z,[V,G]=[-G,V]}this.setAt(B*W,z*j,V,G)}else this.setAt(R*W,N*j,this.width*W,this.height*j);A(this,oa,ol).call(this),this._isDraggable=!0,this.editorDiv.contentEditable=!1}else this._isDraggable=!1,this.editorDiv.contentEditable=!0;return this.div}editorDivPaste(R){let N=R.clipboardData||window.clipboardData,{types:W}=N;if(1===W.length&&"text/plain"===W[0])return;R.preventDefault();let j=A(Bt,od,ou).call(Bt,N.getData("text")||"").replaceAll(wn,` 225`);if(!j)return;let B=window.getSelection();if(!B.rangeCount)return;this.editorDiv.normalize(),B.deleteFromDocument();let z=B.getRangeAt(0);if(!j.includes(` 226`)){z.insertNode(document.createTextNode(j)),this.editorDiv.normalize(),B.collapseToStart();return}let{startContainer:U,startOffset:V}=z,G=[],Y=[];if(U.nodeType===Node.TEXT_NODE){let R=U.parentElement;if(Y.push(U.nodeValue.slice(V).replaceAll(wn,"")),R!==this.editorDiv){let N=G;for(let W of this.editorDiv.childNodes){if(W===R){N=Y;continue}N.push(A(Bt,or,os).call(Bt,W))}}G.push(U.nodeValue.slice(0,V).replaceAll(wn,""))}else if(U===this.editorDiv){let R=G,N=0;for(let W of this.editorDiv.childNodes)N++===V&&(R=Y),R.push(A(Bt,or,os).call(Bt,W))}w(this,aJ,`${G.join(` 227`)}${j}${Y.join(` 228`)}`),A(this,oa,ol).call(this);let Z=new Range,te=G.reduce((R,N)=>R+N.length,0);for(let{firstChild:R}of this.editorDiv.childNodes)if(R.nodeType===Node.TEXT_NODE){let N=R.nodeValue.length;if(te<=N){Z.setStart(R,te),Z.setEnd(R,te);break}te-=N}B.removeAllRanges(),B.addRange(Z)}get contentDiv(){return this.editorDiv}static deserialize(R,N,W){let j=null;if(R instanceof _w){let{data:{defaultAppearanceData:{fontSize:N,fontColor:W},rect:B,rotation:z,id:U},textContent:V,textPosition:G,parent:{page:{pageNumber:Y}}}=R;if(!V||0===V.length)return null;j=R={annotationType:mZ.FREETEXT,color:Array.from(W),fontSize:N,value:V.join(` 229`),position:G,pageIndex:Y-1,rect:B.slice(0),rotation:z,id:U,deleted:!1}}let B=super.deserialize(R,N,W);return w(B,a1,R.fontSize),w(B,aQ,Q.makeHexColor(...R.color)),w(B,aJ,A(Bt,od,ou).call(Bt,R.value)),B.annotationElementId=R.id||null,w(B,a3,j),B}serialize(R=!1){if(this.isEmpty())return null;if(this.deleted)return{pageIndex:this.pageIndex,id:this.annotationElementId,deleted:!0};let N=Bt._internalPadding*this.parentScale,W=this.getRect(N,N),j=vE._colorManager.convert(this.isAttachedToDOM?getComputedStyle(this.editorDiv).color:a(this,aQ)),B={annotationType:mZ.FREETEXT,color:j,fontSize:a(this,a1),value:A(this,oh,oc).call(this),pageIndex:this.pageIndex,rect:W,rotation:this.rotation,structTreeParentId:this._structTreeParentId};return R?B:this.annotationElementId&&!A(this,op,of).call(this,B)?null:(B.id=this.annotationElementId,B)}renderAnnotationElement(R){let N=super.renderAnnotationElement(R);if(this.deleted)return N;let{style:W}=N;for(let R of(W.fontSize=`calc(${a(this,a1)}px * var(--scale-factor))`,W.color=a(this,aQ),N.replaceChildren(),a(this,aJ).split(` 230`))){let W=document.createElement("div");W.append(R?document.createTextNode(R):document.createElement("br")),N.append(W)}let j=Bt._internalPadding*this.parentScale;return R.updateEdited({rect:this.getRect(j,j),popupContent:a(this,aJ)}),N}resetAnnotationElement(R){super.resetAnnotationElement(R),R.resetEdited()}};aG=new WeakMap,aq=new WeakMap,aX=new WeakMap,aY=new WeakMap,aK=new WeakMap,aQ=new WeakMap,aJ=new WeakMap,aZ=new WeakMap,a1=new WeakMap,a3=new WeakMap,a5=new WeakSet,a4=function(R){let n=R=>{this.editorDiv.style.fontSize=`calc(${R}px * var(--scale-factor))`,this.translate(0,-(R-a(this,a1))*this.parentScale),w(this,a1,R),A(this,oe,on).call(this)},N=a(this,a1);this.addCommands({cmd:n.bind(this,R),undo:n.bind(this,N),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:m1.FREETEXT_S
230IZE,overwriteIfSameType:!0,keepUndo:!0})},a6=new WeakSet,a8=function(R){let n=R=>{w(this,aQ,this.editorDiv.style.color=R)},N=a(this,aQ);this.addCommands({cmd:n.bind(this,R),undo:n.bind(this,N),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:m1.FREETEXT_COLOR,overwriteIfSameType:!0,keepUndo:!0})},a7=new WeakSet,a9=function(){let R=[];for(let N of(this.editorDiv.normalize(),this.editorDiv.childNodes))R.push(A(wr,or,os).call(wr,N));return R.join(` 231`)},oe=new WeakSet,on=function(){let R;let[N,W]=this.parentDimensions;if(this.isAttachedToDOM)R=this.div.getBoundingClientRect();else{let{currentLayer:N,div:W}=this,j=W.style.display,B=W.classList.contains("hidden");W.classList.remove("hidden"),W.style.display="hidden",N.div.append(this.div),R=W.getBoundingClientRect(),W.remove(),W.style.display=j,W.classList.toggle("hidden",B)}this.rotation%180==this.parentRotation%180?(this.width=R.width/N,this.height=R.height/W):(this.width=R.height/N,this.height=R.width/W),this.fixAndSetPosition()},or=new WeakSet,os=function(R){return(R.nodeType===Node.TEXT_NODE?R.nodeValue:R.innerText).replaceAll(wn,"")},oa=new WeakSet,ol=function(){if(this.editorDiv.replaceChildren(),a(this,aJ))for(let R of a(this,aJ).split(` 232`)){let N=document.createElement("div");N.append(R?document.createTextNode(R):document.createElement("br")),this.editorDiv.append(N)}},oh=new WeakSet,oc=function(){return a(this,aJ).replaceAll("\xa0"," ")},od=new WeakSet,ou=function(R){return R.replaceAll(" ","\xa0")},op=new WeakSet,of=function(R){let{value:N,fontSize:W,color:j,pageIndex:B}=a(this,a3);return this._hasBeenMoved||R.value!==N||R.fontSize!==W||R.color.some((R,N)=>R!==j[N])||R.pageIndex!==B},m(wr,or),m(wr,od),dt(wr,"_freeTextDefaultContent",""),dt(wr,"_internalPadding",0),dt(wr,"_defaultColor",null),dt(wr,"_defaultFontSize",10),dt(wr,"_type","freetext"),dt(wr,"_editorType",mZ.FREETEXT);let pm=class pm{constructor(R,N=0,W=0,j=!0){m(this,ow),m(this,ob),m(this,ox),m(this,oS),m(this,oC),m(this,og,void 0),m(this,om,[]),m(this,ov,[]);let B=1/0,z=-1/0,U=1/0,V=-1/0;for(let{x:W,y:j,width:G,height:Y}of R){let R=1e-4*Math.floor((W-N)/1e-4),Z=1e-4*Math.ceil((W+G+N)/1e-4),te=1e-4*Math.floor((j-N)/1e-4),tn=1e-4*Math.ceil((j+Y+N)/1e-4),tr=[R,te,tn,!0],ts=[Z,te,tn,!1];a(this,om).push(tr,ts),B=Math.min(B,R),z=Math.max(z,Z),U=Math.min(U,te),V=Math.max(V,tn)}let G=z-B+2*W,Y=V-U+2*W,Z=B-W,te=U-W,tn=a(this,om).at(j?-1:-2),tr=[tn[0],tn[2]];for(let R of a(this,om)){let[N,W,j]=R;R[0]=(N-Z)/G,R[1]=(W-te)/Y,R[2]=(j-te)/Y}w(this,og,{x:Z,y:te,width:G,height:Y,lastPoint:tr})}getOutlines(){a(this,om).sort((R,N)=>R[0]-N[0]||R[1]-N[1]||R[2]-N[2]);let R=[];for(let N of a(this,om))N[3]?(R.push(...A(this,oC,oM).call(this,N)),A(this,ox,o_).call(this,N)):(A(this,oS,oE).call(this,N),R.push(...A(this,oC,oM).call(this,N)));return A(this,ow,oy).call(this,R)}};og=new WeakMap,om=new WeakMap,ov=new WeakMap,ow=new WeakSet,oy=function(R){let N;let W=[],j=new Set;for(let N of R){let[R,j,B]=N;W.push([R,j,N],[R,B,N])}W.sort((R,N)=>R[1]-N[1]||R[0]-N[0]);for(let R=0,N=W.length;R<N;R+=2){let N=W[R][2],B=W[R+1][2];N.push(B),B.push(N),j.add(N),j.add(B)}let B=[];for(;j.size>0;){let R=j.values().next().value,[W,z,U,V,G]=R;j.delete(R);let Y=W,Z=z;for(N=[W,U],B.push(N);;){let R;if(j.has(V))R=V;else if(j.has(G))R=G;else break;j.delete(R),[W,z,U,V,G]=R,Y!==W&&(N.push(Y,Z,W,Z===z?z:U),Y=W),Z=Z===z?U:z}N.push(Y,Z)}return new _L(B,a(this,og))},ob=new WeakSet,oA=function(R){let N=a(this,ov),W=0,j=N.length-1;for(;W<=j;){let B=W+j>>1,z=N[B][0];if(z===R)return B;z<R?W=B+1:j=B-1}return j+1},ox=new WeakSet,o_=function([,R,N]){let W=A(this,ob,oA).call(this,R);a(this,ov).splice(W,0,[R,N])},oS=new WeakSet,oE=function([,R,N]){let W=A(this,ob,oA).call(this,R);for(let j=W;j<a(this,ov).length;j++){let[W,B]=a(this,ov)[j];if(W!==R)break;if(W===R&&B===N){a(this,ov).splice(j,1);return}}for(let j=W-1;j>=0;j--){let[W,B]=a(this,ov)[j];if(W!==R)break;if(W===R&&B===N){a(this,ov).splice(j,1);return}}},oC=new WeakSet,oM=function(R){let[N,W,j]=R,B=[[N,W,j]],z=A(this,ob,oA).call(this,j);for(let R=0;R<z;R++){let[W,j]=a(this,ov)[R];for(let R=0,z=B.length;R<z;R++){let[,U,V]=B[R];if(!(j<=U||V<=W)){if(U>=W){if(V>j)B[R][1]=j;else{if(1===z)return[];B.splice(R,1),R--,z--}continue}B[R][2]=W,V>j&&B.push([N,j,V])}}}return B};let Ow=class Ow{toSVGPath(){throw Error("Abstract method `toSVGPath` must be implemented.")}get box(){throw Error("Abstract getter `box` must be implemented.")}serialize(R,N){throw Error("Abstract method `serialize` must be implemented.")}get free(){return this instanceof vm}};let _L=class _L extends Ow{constructor(R,N){super(),m(this,oT,void 0),m(this,oR,void 0),w(this,oR,R),w(this,oT,N)}toSVGPath(){let R=[];for(let N of a(this,oR)){let[W,j]=N;R.push(`M${W} ${j}`);for(let B=2;B<N.length;B+=2){let z=N[B],U=N[B+1];z===W?(R.push(`V${U}`),j=U):U===j&&(R.push(`H${z}`),W=z)}R.push("Z")}return R.join(" ")}serialize([R,N,W,j],B){let z=[],U=W-R,V=j-N;for(let N of a(this,oR)){let W=Array(N.length);for(let B=0;B<N.length;B+=2)W[B]=R+N[B]*U,W[B+1]=j-N[B+1]*V;z.push(W)}return z}get box(){return a(this,oT)}};oT=new WeakMap,oR=new WeakMap;let ws=class hi{constructor({x:R,y:N},W,j,B,z,U=0){m(this,oY),m(this,oI,void 0),m(this,oD,[]),m(this,oN,void 0),m(this,oO,void 0),m(this,oF,[]),m(this,oW,new Float64Array(18)),m(this,oj,void 0),m(this,oB,void 0),m(this,o$,void 0),m(this,oz,void 0),m(this,oH,void 0),m(this,oU,void 0),m(this,oV,[]),w(this,oI,W),w(this,oU,B*j),w(this,oO,z),a(this,oW).set([NaN,NaN,NaN,NaN,R,N],6),w(this,oN,U),w(this,oz,a(hi,oG)*j),w(this,o$,a(hi,oX)*j),w(this,oH,j),a(this,oV).push(R,N)}get free(){return!0}isEmpty(){return isNaN(a(this,oW)[8])}add({x:R,y:N}){var W;w(this,oj,R),w(this,oB,N);let[j,B,z,U]=a(this,oI),[V,G,Y,Z]=a(this,oW).subarray(8,12),te=R-Y,tn=N-Z,tr=Math.hypot(te,tn);if(tr<a(this,o$))return!1;let ts=tr-a(this,oz),ta=ts/tr,th=ta*te,tc=ta*tn,tu=V,tp=G;V=Y,G=Z,Y+=th,Z+=tc,null==(W=a(this,oV))||W.push(R,N);let tf=-tc/ts*a(this,oU),tg=th/ts*a(this,oU);return a(this,oW).set(a(this,oW).subarray(2,8),0),a(this,oW).set([Y+tf,Z+tg],4),a(this,oW).set(a(this,oW).subarray(14,18),12),a(this,oW).set([Y-tf,Z-tg],16),isNaN(a(this,oW)[6])?(0===a(this,oF).length&&(a(this,oW).set([V+tf,G+tg],2),a(this,oF).push(NaN,NaN,NaN,NaN,(V+tf-j)/z,(G+tg-B)/U),a(this,oW).set([V-tf,G-tg],14),a(this,oD).push(NaN,NaN,NaN,NaN,(V-tf-j)/z,(G-tg-B
232)/U)),a(this,oW).set([tu,tp,V,G,Y,Z],6),!this.isEmpty()):(a(this,oW).set([tu,tp,V,G,Y,Z],6),Math.abs(Math.atan2(tp-G,tu-V)-Math.atan2(tc,th))<Math.PI/2?([V,G,Y,Z]=a(this,oW).subarray(2,6),a(this,oF).push(NaN,NaN,NaN,NaN,((V+Y)/2-j)/z,((G+Z)/2-B)/U),[V,G,tu,tp]=a(this,oW).subarray(14,18),a(this,oD).push(NaN,NaN,NaN,NaN,((tu+V)/2-j)/z,((tp+G)/2-B)/U)):([tu,tp,V,G,Y,Z]=a(this,oW).subarray(0,6),a(this,oF).push(((tu+5*V)/6-j)/z,((tp+5*G)/6-B)/U,((5*V+Y)/6-j)/z,((5*G+Z)/6-B)/U,((V+Y)/2-j)/z,((G+Z)/2-B)/U),[Y,Z,V,G,tu,tp]=a(this,oW).subarray(12,18),a(this,oD).push(((tu+5*V)/6-j)/z,((tp+5*G)/6-B)/U,((5*V+Y)/6-j)/z,((5*G+Z)/6-B)/U,((V+Y)/2-j)/z,((G+Z)/2-B)/U)),!0)}toSVGPath(){if(this.isEmpty())return"";let R=a(this,oF),N=a(this,oD),W=a(this,oW).subarray(4,6),j=a(this,oW).subarray(16,18),[B,z,U,V]=a(this,oI),[G,Y,Z,te]=A(this,oY,oK).call(this);if(isNaN(a(this,oW)[6])&&!this.isEmpty())return`M${(a(this,oW)[2]-B)/U} ${(a(this,oW)[3]-z)/V} L${(a(this,oW)[4]-B)/U} ${(a(this,oW)[5]-z)/V} L${G} ${Y} L${Z} ${te} L${(a(this,oW)[16]-B)/U} ${(a(this,oW)[17]-z)/V} L${(a(this,oW)[14]-B)/U} ${(a(this,oW)[15]-z)/V} Z`;let tn=[];tn.push(`M${R[4]} ${R[5]}`);for(let N=6;N<R.length;N+=6)isNaN(R[N])?tn.push(`L${R[N+4]} ${R[N+5]}`):tn.push(`C${R[N]} ${R[N+1]} ${R[N+2]} ${R[N+3]} ${R[N+4]} ${R[N+5]}`);tn.push(`L${(W[0]-B)/U} ${(W[1]-z)/V} L${G} ${Y} L${Z} ${te} L${(j[0]-B)/U} ${(j[1]-z)/V}`);for(let R=N.length-6;R>=6;R-=6)isNaN(N[R])?tn.push(`L${N[R+4]} ${N[R+5]}`):tn.push(`C${N[R]} ${N[R+1]} ${N[R+2]} ${N[R+3]} ${N[R+4]} ${N[R+5]}`);return tn.push(`L${N[4]} ${N[5]} Z`),tn.join(" ")}getOutlines(){var R;let N=a(this,oF),W=a(this,oD),j=a(this,oW),B=j.subarray(4,6),z=j.subarray(16,18),[U,V,G,Y]=a(this,oI),Z=new Float64Array(((null==(R=a(this,oV))?void 0:R.length)??0)+2);for(let R=0,N=Z.length-2;R<N;R+=2)Z[R]=(a(this,oV)[R]-U)/G,Z[R+1]=(a(this,oV)[R+1]-V)/Y;Z[Z.length-2]=(a(this,oj)-U)/G,Z[Z.length-1]=(a(this,oB)-V)/Y;let[te,tn,tr,ts]=A(this,oY,oK).call(this);if(isNaN(j[6])&&!this.isEmpty()){let R=new Float64Array(36);return R.set([NaN,NaN,NaN,NaN,(j[2]-U)/G,(j[3]-V)/Y,NaN,NaN,NaN,NaN,(j[4]-U)/G,(j[5]-V)/Y,NaN,NaN,NaN,NaN,te,tn,NaN,NaN,NaN,NaN,tr,ts,NaN,NaN,NaN,NaN,(j[16]-U)/G,(j[17]-V)/Y,NaN,NaN,NaN,NaN,(j[14]-U)/G,(j[15]-V)/Y],0),new vm(R,Z,a(this,oI),a(this,oH),a(this,oN),a(this,oO))}let ta=new Float64Array(a(this,oF).length+24+a(this,oD).length),th=N.length;for(let R=0;R<th;R+=2){if(isNaN(N[R])){ta[R]=ta[R+1]=NaN;continue}ta[R]=N[R],ta[R+1]=N[R+1]}ta.set([NaN,NaN,NaN,NaN,(B[0]-U)/G,(B[1]-V)/Y,NaN,NaN,NaN,NaN,te,tn,NaN,NaN,NaN,NaN,tr,ts,NaN,NaN,NaN,NaN,(z[0]-U)/G,(z[1]-V)/Y],th),th+=24;for(let R=W.length-6;R>=6;R-=6)for(let N=0;N<6;N+=2){if(isNaN(W[R+N])){ta[th]=ta[th+1]=NaN,th+=2;continue}ta[th]=W[R+N],ta[th+1]=W[R+N+1],th+=2}return ta.set([NaN,NaN,NaN,NaN,W[4],W[5]],th),new vm(ta,Z,a(this,oI),a(this,oH),a(this,oN),a(this,oO))}};oI=new WeakMap,oD=new WeakMap,oN=new WeakMap,oO=new WeakMap,oF=new WeakMap,oW=new WeakMap,oj=new WeakMap,oB=new WeakMap,o$=new WeakMap,oz=new WeakMap,oH=new WeakMap,oU=new WeakMap,oV=new WeakMap,oG=new WeakMap,oq=new WeakMap,oX=new WeakMap,oY=new WeakSet,oK=function(){let R=a(this,oW).subarray(4,6),N=a(this,oW).subarray(16,18),[W,j,B,z]=a(this,oI);return[(a(this,oj)+(R[0]-N[0])/2-W)/B,(a(this,oB)+(R[1]-N[1])/2-j)/z,(a(this,oj)+(N[0]-R[0])/2-W)/B,(a(this,oB)+(N[1]-R[1])/2-j)/z]},m(ws,oG,8),m(ws,oq,2),m(ws,oX,a(ws,oG)+a(ws,oq));let vm=class vm extends Ow{constructor(R,N,W,j,B,z){super(),m(this,o6),m(this,o7),m(this,le),m(this,oQ,void 0),m(this,oJ,null),m(this,oZ,void 0),m(this,o1,void 0),m(this,o3,void 0),m(this,o5,void 0),m(this,o4,void 0),w(this,o4,R),w(this,o3,N),w(this,oQ,W),w(this,o5,j),w(this,oZ,B),w(this,o1,z),A(this,le,ln).call(this,z);let{x:U,y:V,width:G,height:Y}=a(this,oJ);for(let N=0,W=R.length;N<W;N+=2)R[N]=(R[N]-U)/G,R[N+1]=(R[N+1]-V)/Y;for(let R=0,W=N.length;R<W;R+=2)N[R]=(N[R]-U)/G,N[R+1]=(N[R+1]-V)/Y}toSVGPath(){let R=[`M${a(this,o4)[4]} ${a(this,o4)[5]}`];for(let N=6,W=a(this,o4).length;N<W;N+=6){if(isNaN(a(this,o4)[N])){R.push(`L${a(this,o4)[N+4]} ${a(this,o4)[N+5]}`);continue}R.push(`C${a(this,o4)[N]} ${a(this,o4)[N+1]} ${a(this,o4)[N+2]} ${a(this,o4)[N+3]} ${a(this,o4)[N+4]} ${a(this,o4)[N+5]}`)}return R.push("Z"),R.join(" ")}serialize([R,N,W,j],B){let z,U;let V=W-R,G=j-N;switch(B){case 0:z=A(this,o6,o8).call(this,a(this,o4),R,j,V,-G),U=A(this,o6,o8).call(this,a(this,o3),R,j,V,-G);break;case 90:z=A(this,o7,o9).call(this,a(this,o4),R,N,V,G),U=A(this,o7,o9).call(this,a(this,o3),R,N,V,G);break;case 180:z=A(this,o6,o8).call(this,a(this,o4),W,N,-V,G),U=A(this,o6,o8).call(this,a(this,o3),W,N,-V,G);break;case 270:z=A(this,o7,o9).call(this,a(this,o4),W,j,-V,-G),U=A(this,o7,o9).call(this,a(this,o3),W,j,-V,-G)}return{outline:Array.from(z),points:[Array.from(U)]}}get box(){return a(this,oJ)}getNewOutline(R,N){let{x:W,y:j,width:B,height:z}=a(this,oJ),[U,V,G,Y]=a(this,oQ),Z=B*G,te=z*Y,tn=W*G+U,tr=j*Y+V,ts=new ws({x:a(this,o3)[0]*Z+tn,y:a(this,o3)[1]*te+tr},a(this,oQ),a(this,o5),R,a(this,o1),N??a(this,oZ));for(let R=2;R<a(this,o3).length;R+=2)ts.add({x:a(this,o3)[R]*Z+tn,y:a(this,o3)[R+1]*te+tr});return ts.getOutlines()}};oQ=new WeakMap,oJ=new WeakMap,oZ=new WeakMap,o1=new WeakMap,o3=new WeakMap,o5=new WeakMap,o4=new WeakMap,o6=new WeakSet,o8=function(R,N,W,j,B){let z=new Float64Array(R.length);for(let U=0,V=R.length;U<V;U+=2)z[U]=N+R[U]*j,z[U+1]=W+R[U+1]*B;return z},o7=new WeakSet,o9=function(R,N,W,j,B){let z=new Float64Array(R.length);for(let U=0,V=R.length;U<V;U+=2)z[U]=N+R[U+1]*j,z[U+1]=W+R[U]*B;return z},le=new WeakSet,ln=function(R){let N=a(this,o4),W=N[4],j=N[5],B=W,z=j,U=W,V=j,G=W,Y=j,Z=R?Math.max:Math.min;for(let R=6,te=N.length;R<te;R+=6){if(isNaN(N[R]))B=Math.min(B,N[R+4]),z=Math.min(z,N[R+5]),U=Math.max(U,N[R+4]),V=Math.max(V,N[R+5]),Y<N[R+5]?(G=N[R+4],Y=N[R+5]):Y===N[R+5]&&(G=Z(G,N[R+4]));else{let te=Q.bezierBoundingBox(W,j,...N.slice(R,R+6));B=Math.min(B,te[0]),z=Math.min(z,te[1]),U=Math.max(U,te[2]),V=Math.max(V,te[3]),Y<te[3]?(G=te[2],Y=te[3]):Y===te[3]&&(G=Z(G,te[2]))}W=N[R+4],j=N[R+5]}let te=B-a(this,oZ),tn=z-a(this,oZ),tr=U-B+2*a(this,oZ),ts=V-z+2*a(this,oZ);w(this,oJ,{x:te,y:tn,width:tr,height:ts,lastPoint:[G,Y]})};let wa=class di{constructor({editor:R=null,uiManager:N=null}){var W;m(this,lb),m(this,lx),m(this,lS),m(this,lC),m(this,lT),m(this,lP),m(this,lr,A(this,lS,lk).bind(this)),m(this,ls,A(this,lT,lR).bind(this)),m(this,la,null),m(this,ll,null),m(this,lh,void 0),m(this,lc,null),m(this,ld,!1),m(this,lu,!1),m(this,lp,null),m(this,lf,void 0),m(this,lm,null),m(this,lv,void 0),R?(w(this,lu,!1),w(this,lv,m1.HIGHLIGHT_COLOR),w(this,lp,R)):(w(this,lu,!0),w(this,lv,m1.HIGHLIGHT_DEFAULT_COLOR)),w(this,lm,(null==R?void 0:R._uiManager)||N),w(this,lf,a(this,lm)._eventBus),w(this,lh,(null==R?void 0:R.color)||(null==(W=a(this,lm))?void 0:W.highlightColors.values().next().value)||"#FFFF98")}static get _keyboardManager(){return Tt(this,"_keyboardManager",new Qh([[["Escape","mac+Escape"],di.prototype._hideDropdownFromKeyboard],[[" ","mac+ "],di.prototype._colorSelectFromKeyboard],[["ArrowDown","ArrowRight","mac+ArrowDown","mac+ArrowRight"],di.prototype._moveToNext],[["ArrowUp","ArrowLeft","mac+ArrowUp","mac+ArrowLeft"],di.prototype._moveToPrevious],[["Home","mac+Home"],di.prototype._moveToBeginning],[["End","mac+End"],di.prototype._moveToEnd]]))}renderButton(){let R=w(this,la,document.createElement("button"));
232R.className="colorPicker",R.tabIndex="0",R.setAttribute("data-l10n-id","pdfjs-editor-colorpicker-button"),R.setAttribute("aria-haspopup",!0),R.addEventListener("click",A(this,lC,lM).bind(this)),R.addEventListener("keydown",a(this,lr));let N=w(this,ll,document.createElement("span"));return N.className="swatch",N.setAttribute("aria-hidden",!0),N.style.backgroundColor=a(this,lh),R.append(N),R}renderMainDropdown(){let R=w(this,lc,A(this,lb,lA).call(this));return R.setAttribute("aria-orientation","horizontal"),R.setAttribute("aria-labelledby","highlightColorPickerLabel"),R}_colorSelectFromKeyboard(R){if(R.target===a(this,la)){A(this,lC,lM).call(this,R);return}let N=R.target.getAttribute("data-color");N&&A(this,lx,l_).call(this,N,R)}_moveToNext(R){var N,W;if(!a(this,lP,lI)){A(this,lC,lM).call(this,R);return}if(R.target===a(this,la)){null==(N=a(this,lc).firstChild)||N.focus();return}null==(W=R.target.nextSibling)||W.focus()}_moveToPrevious(R){var N,W;if(R.target===(null==(N=a(this,lc))?void 0:N.firstChild)||R.target===a(this,la)){a(this,lP,lI)&&this._hideDropdownFromKeyboard();return}a(this,lP,lI)||A(this,lC,lM).call(this,R),null==(W=R.target.previousSibling)||W.focus()}_moveToBeginning(R){var N;if(!a(this,lP,lI)){A(this,lC,lM).call(this,R);return}null==(N=a(this,lc).firstChild)||N.focus()}_moveToEnd(R){var N;if(!a(this,lP,lI)){A(this,lC,lM).call(this,R);return}null==(N=a(this,lc).lastChild)||N.focus()}hideDropdown(){var R;null==(R=a(this,lc))||R.classList.add("hidden"),window.removeEventListener("pointerdown",a(this,ls))}_hideDropdownFromKeyboard(){var R;if(!a(this,lu)){if(!a(this,lP,lI)){null==(R=a(this,lp))||R.unselect();return}this.hideDropdown(),a(this,la).focus({preventScroll:!0,focusVisible:a(this,ld)})}}updateColor(R){if(a(this,ll)&&(a(this,ll).style.backgroundColor=R),!a(this,lc))return;let N=a(this,lm).highlightColors.values();for(let W of a(this,lc).children)W.setAttribute("aria-selected",N.next().value===R)}destroy(){var R,N;null==(R=a(this,la))||R.remove(),w(this,la,null),w(this,ll,null),null==(N=a(this,lc))||N.remove(),w(this,lc,null)}};lr=new WeakMap,ls=new WeakMap,la=new WeakMap,ll=new WeakMap,lh=new WeakMap,lc=new WeakMap,ld=new WeakMap,lu=new WeakMap,lp=new WeakMap,lf=new WeakMap,lm=new WeakMap,lv=new WeakMap,lb=new WeakSet,lA=function(){let R=document.createElement("div");for(let[N,W]of(R.addEventListener("contextmenu",Ve),R.className="dropdown",R.role="listbox",R.setAttribute("aria-multiselectable",!1),R.setAttribute("aria-orientation","vertical"),R.setAttribute("data-l10n-id","pdfjs-editor-colorpicker-dropdown"),a(this,lm).highlightColors)){let j=document.createElement("button");j.tabIndex="0",j.role="option",j.setAttribute("data-color",W),j.title=N,j.setAttribute("data-l10n-id",`pdfjs-editor-colorpicker-${N}`);let B=document.createElement("span");j.append(B),B.className="swatch",B.style.backgroundColor=W,j.setAttribute("aria-selected",W===a(this,lh)),j.addEventListener("click",A(this,lx,l_).bind(this,W)),R.append(j)}return R.addEventListener("keydown",a(this,lr)),R},lx=new WeakSet,l_=function(R,N){N.stopPropagation(),a(this,lf).dispatch("switchannotationeditorparams",{source:this,type:a(this,lv),value:R})},lS=new WeakSet,lk=function(R){wa._keyboardManager.exec(this,R)},lC=new WeakSet,lM=function(R){if(a(this,lP,lI)){this.hideDropdown();return}if(w(this,ld,0===R.detail),window.addEventListener("pointerdown",a(this,ls)),a(this,lc)){a(this,lc).classList.remove("hidden");return}let N=w(this,lc,A(this,lb,lA).call(this));a(this,la).append(N)},lT=new WeakSet,lR=function(R){var N;null!=(N=a(this,lc))&&N.contains(R.target)||this.hideDropdown()},lP=new WeakSet,lI=function(){return a(this,lc)&&!a(this,lc).classList.contains("hidden")};let wo=wa,wl=class Ct extends vE{constructor(R){super({...R,name:"highlightEditor"}),m(this,lZ),m(this,l3),m(this,l4),m(this,l8),m(this,l9),m(this,hr),m(this,ha),m(this,hc),m(this,hu),m(this,hg),m(this,hw),m(this,hb),m(this,lD,null),m(this,lN,0),m(this,lO,void 0),m(this,lF,null),m(this,lW,null),m(this,lj,null),m(this,lB,null),m(this,l$,0),m(this,lz,null),m(this,lH,null),m(this,lU,null),m(this,lV,!1),m(this,lG,A(this,hc,hd).bind(this)),m(this,lq,null),m(this,lX,void 0),m(this,lY,null),m(this,lK,""),m(this,lQ,void 0),m(this,lJ,""),this.color=R.color||Ct._defaultColor,w(this,lQ,R.thickness||Ct._defaultThickness),w(this,lX,R.opacity||Ct._defaultOpacity),w(this,lO,R.boxes||null),w(this,lJ,R.methodOfCreation||""),w(this,lK,R.text||""),this._isDraggable=!1,R.highlightId>-1?(w(this,lV,!0),A(this,l3,l5).call(this,R),A(this,ha,ho).call(this)):(w(this,lD,R.anchorNode),w(this,lN,R.anch
232orOffset),w(this,lB,R.focusNode),w(this,l$,R.focusOffset),A(this,lZ,l1).call(this),A(this,ha,ho).call(this),this.rotate(this.rotation))}static get _keyboardManager(){let R=Ct.prototype;return Tt(this,"_keyboardManager",new Qh([[["ArrowLeft","mac+ArrowLeft"],R._moveCaret,{args:[0]}],[["ArrowRight","mac+ArrowRight"],R._moveCaret,{args:[1]}],[["ArrowUp","mac+ArrowUp"],R._moveCaret,{args:[2]}],[["ArrowDown","mac+ArrowDown"],R._moveCaret,{args:[3]}]]))}get telemetryInitialData(){return{action:"added",type:a(this,lV)?"free_highlight":"highlight",color:this._uiManager.highlightColorNames.get(this.color),thickness:a(this,lQ),methodOfCreation:a(this,lJ)}}get telemetryFinalData(){return{type:"highlight",color:this._uiManager.highlightColorNames.get(this.color)}}static computeTelemetryFinalData(R){return{numberOfColors:R.get("color").size}}static initialize(R,N){var W;vE.initialize(R,N),Ct._defaultColor||(Ct._defaultColor=(null==(W=N.highlightColors)?void 0:W.values().next().value)||"#fff066")}static updateDefaultParams(R,N){switch(R){case m1.HIGHLIGHT_DEFAULT_COLOR:Ct._defaultColor=N;break;case m1.HIGHLIGHT_THICKNESS:Ct._defaultThickness=N}}translateInPage(R,N){}get toolbarPosition(){return a(this,lq)}updateParams(R,N){switch(R){case m1.HIGHLIGHT_COLOR:A(this,l4,l6).call(this,N);break;case m1.HIGHLIGHT_THICKNESS:A(this,l8,l7).call(this,N)}}static get defaultPropertiesToUpdate(){return[[m1.HIGHLIGHT_DEFAULT_COLOR,Ct._defaultColor],[m1.HIGHLIGHT_THICKNESS,Ct._defaultThickness]]}get propertiesToUpdate(){return[[m1.HIGHLIGHT_COLOR,this.color||Ct._defaultColor],[m1.HIGHLIGHT_THICKNESS,a(this,lQ)||Ct._defaultThickness],[m1.HIGHLIGHT_FREE,a(this,lV)]]}async addEditToolbar(){let R=await super.addEditToolbar();return R?(this._uiManager.highlightColors&&(w(this,lW,new wo({editor:this})),R.addColorPicker(a(this,lW))),R):null}disableEditing(){super.disableEditing(),this.div.classList.toggle("disabled",!0)}enableEditing(){super.enableEditing(),this.div.classList.toggle("disabled",!1)}fixAndSetPosition(){return super.fixAndSetPosition(A(this,hg,hm).call(this))}getBaseTranslation(){return[0,0]}getRect(R,N){return super.getRect(R,N,A(this,hg,hm).call(this))}onceAdded(){this.parent.addUndoableEditor(this),this.div.focus()}remove(){A(this,hr,hs).call(this),this._reportTelemetry({action:"deleted"}),super.remove()}rebuild(){this.parent&&(super.rebuild(),null!==this.div&&(A(this,ha,ho).call(this),this.isAttachedToDOM||this.parent.add(this)))}setParent(R){var N;let W=!1;this.parent&&!R?A(this,hr,hs).call(this):R&&(A(this,ha,ho).call(this,R),W=!this.parent&&(null==(N=this.div)?void 0:N.classList.contains("selectedEditor"))),super.setParent(R),this.show(this._isVisible),W&&this.select()}rotate(R){let N;let{drawLayer:W}=this.parent;a(this,lV)?(R=(R-this.rotation+360)%360,N=A(Ct,hl,hh).call(Ct,a(this,lH).box,R)):N=A(Ct,hl,hh).call(Ct,this,R),W.rotate(a(this,lU),R),W.rotate(a(this,lY),R),W.updateBox(a(this,lU),N),W.updateBox(a(this,lY),A(Ct,hl,hh).call(Ct,a(this,lj).box,R))}render(){if(this.div)return this.div;let R=super.render();a(this,lK)&&(R.setAttribute("aria-label",a(this,lK)),R.setAttribute("role","mark")),a(this,lV)?R.classList.add("free"):this.div.addEventListener("keydown",a(this,lG));let N=w(this,lz,document.createElement("div"));R.append(N),N.setAttribute("aria-hidden","true"),N.className="internal",N.style.clipPath=a(this,lF);let[W,j]=this.parentDimensions;return this.setDims(this.width*W,this.height*j),iu(this,a(this,lz),["pointerover","pointerleave"]),this.enableEditing(),R}pointerover(){this.parent.drawLayer.addClass(a(this,lY),"hovered")}pointerleave(){this.parent.drawLayer.removeClass(a(this,lY),"hovered")}_moveCaret(R){switch(this.parent.unselect(this),R){case 0:case 2:A(this,hu,hf).call(this,!0);break;case 1:case 3:A(this,hu,hf).call(this,!1)}}select(){var R,N;super.select(),a(this,lY)&&(null==(R=this.parent)||R.drawLayer.removeClass(a(this,lY),"hovered"),null==(N=this.parent)||N.drawLayer.addClass(a(this,lY),"selected"))}unselect(){var R;super.unselect(),a(this,lY)&&(null==(R=this.parent)||R.drawLayer.removeClass(a(this,lY),"selected"),a(this,lV)||A(this,hu,hf).call(this,!1))}get _mustFixPosition(){return!a(this,lV)}
232show(R=this._isVisible){super.show(R),this.parent&&(this.parent.drawLayer.show(a(this,lU),R),this.parent.drawLayer.show(a(this,lY),R))}static startHighlighting(R,N,{target:W,x:j,y:B}){let{x:z,y:U,width:V,height:G}=W.getBoundingClientRect(),f=N=>{A(this,hx,h_).call(this,R,N)},Y={capture:!0,passive:!1},v=R=>{R.preventDefault(),R.stopPropagation()},y=N=>{W.removeEventListener("pointermove",f),window.removeEventListener("blur",y),window.removeEventListener("pointerup",y),window.removeEventListener("pointerdown",v,Y),window.removeEventListener("contextmenu",Ve),A(this,hS,hE).call(this,R,N)};window.addEventListener("blur",y),window.addEventListener("pointerup",y),window.addEventListener("pointerdown",v,Y),window.addEventListener("contextmenu",Ve),W.addEventListener("pointermove",f),this._freeHighlight=new ws({x:j,y:B},[z,U,V,G],R.scale,this._defaultThickness/2,N,.001),{id:this._freeHighlightId,clipPathId:this._freeHighlightClipId}=R.drawLayer.highlight(this._freeHighlight,this._defaultColor,this._defaultOpacity,!0)}static deserialize(R,N,W){let j=super.deserialize(R,N,W),{rect:[B,z,U,V],color:G,quadPoints:Y}=R;j.color=Q.makeHexColor(...G),w(j,lX,R.opacity);let[Z,te]=j.pageDimensions;j.width=(U-B)/Z,j.height=(V-z)/te;let tn=w(j,lO,[]);for(let R=0;R<Y.length;R+=8)tn.push({x:(Y[4]-U)/Z,y:(V-(1-Y[R+5]))/te,width:(Y[R+2]-Y[R])/Z,height:(Y[R+5]-Y[R+1])/te});return A(j,lZ,l1).call(j),j}serialize(R=!1){if(this.isEmpty()||R)return null;let N=this.getRect(0,0),W=vE._colorManager.convert(this.color);return{annotationType:mZ.HIGHLIGHT,color:W,opacity:a(this,lX),thickness:a(this,lQ),quadPoints:A(this,hw,hy).call(this),outlines:A(this,hb,hA).call(this,N),pageIndex:this.pageIndex,rect:N,rotation:A(this,hg,hm).call(this),structTreeParentId:this._structTreeParentId}}static canCreateNewEmptyEditor(){return!1}};lD=new WeakMap,lN=new WeakMap,lO=new WeakMap,lF=new WeakMap,lW=new WeakMap,lj=new WeakMap,lB=new WeakMap,l$=new WeakMap,lz=new WeakMap,lH=new WeakMap,lU=new WeakMap,lV=new WeakMap,lG=new WeakMap,lq=new WeakMap,lX=new WeakMap,lY=new WeakMap,lK=new WeakMap,lQ=new WeakMap,lJ=new WeakMap,lZ=new WeakSet,l1=function(){let R=new pm(a(this,lO),.001);w(this,lH,R.getOutlines()),{x:this.x,y:this.y,width:this.width,height:this.height}=a(this,lH).box;let N=new pm(a(this,lO),.0025,.001,"ltr"===this._uiManager.direction);w(this,lj,N.getOutlines());let{lastPoint:W}=a(this,lj).box;w(this,lq,[(W[0]-this.x)/this.width,(W[1]-this.y)/this.height])},l3=new WeakSet,l5=function({highlightOutlines:R,highlightId:N,clipPathId:W}){if(w(this,lH,R),w(this,lj,R.getNewOutline(a(this,lQ)/2+1.5,.0025)),N>=0)w(this,lU,N),w(this,lF,W),this.parent.drawLayer.finalizeLine(N,R),w(this,lY,this.parent.drawLayer.highlightOutline(a(this,lj)));else if(this.parent){let N=this.parent.viewport.rotation;this.parent.drawLayer.updateLine(a(this,lU),R),this.parent.drawLayer.updateBox(a(this,lU),A(wl,hl,hh).call(wl,a(this,lH).box,(N-this.rotation+360)%360)),this.parent.drawLayer.updateLine(a(this,lY),a(this,lj)),this.parent.drawLayer.updateBox(a(this,lY),A(wl,hl,hh).call(wl,a(this,lj).box,N))}let{x:j,y:B,width:z,height:U}=R.box;switch(this.rotation){case 0:this.x=j,this.y=B,this.width=z,this.height=U;break;case 90:{let[R,N]=this.parentDimensions;this.x=B,this.y=1-j,this.width=z*N/R,this.height=U*R/N;break}case 180:this.x=1-j,this.y=1-B,this.width=z,this.height=U;break;case 270:{let[R,N]=this.parentDimensions;this.x=1-B,this.y=j,this.width=z*N/R,this.height=U*R/N}}let{lastPoint:V}=a(this,lj).box;w(this,lq,[(V[0]-j)/z,(V[1]-B)/U])},l4=new WeakSet,l6=function(R){let n=R=>{var N,W;this.color=R,null==(N=this.parent)||N.drawLayer.changeColor(a(this,lU),R),null==(W=a(this,lW))||W.updateColor(R)},N=this.color;this.addCommands({cmd:n.bind(this,R),undo:n.bind(this,N),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:m1.HIGHLIGHT_COLOR,overwriteIfSameType:!0,keepUndo:!0}),this._reportTelemetry({action:"color_changed",color:this._uiManager.highlightColorNames.get(R)},!0)},l8=new WeakSet,l7=function(R){let N=a(this,lQ),i=R=>{w(this,lQ,R),A(this,l9,hn).call(this,R)};this.addCommands({cmd:i.bind(this,R),undo:i.bind(this,N),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:m1.INK_THICKNESS,overwriteIfSameType:!0,keepUndo:!0}),this._reportTelemetry({action:"thickness_changed",thickness:R},!0)},l9=new WeakSet,hn=function(R){if(!a(this,lV))return;A(this,l3,l5).call(this,{highlightOutlines:a(this,lH).getNewOutline(R/2)}),this.fixAndSetPosition();let[N,W]=this.parentDimensions;this.setDims(this.width*N,this.height*W)},hr=new WeakSet,hs=function(){null!==a(this,lU)&&this.parent&&(this.parent.drawLayer.remove(a(this,lU)),w(this,lU,null),this.parent.drawLayer.remove(a(this,lY)),w(this,lY,null))},ha=new WeakSet,ho=function(R=this.parent){null===a(this,lU)&&({id:We(this,lU)._,clipPathId:We(this,lF)._}=R.drawLayer.highlight(a(this,lH),this.color,a(this,lX)),w(this,lY,R.drawLayer.highlightOutline(a(this,lj))),a(this,lz)&&(a(this,lz).style.clipPath=a(this,lF)))},hl=new WeakSet,hh=function({x:R,y:N,width:W,height:j},B){switch(B){case 90:return{x:1-N-j,y:R,width:j,height:W};case 180:return{x:1-R-W,y:1-N-j,width:W,height:j};case 270:return{x:N,y:1-R-W,width:j,height:W}}return{x:R,y:N,width:W,height:j}},hc=new WeakSet,hd=function(R){wl._keyboardManager.exec(this,R)},hu=new WeakSet,hf=function(R){if(!a(this,lD))return;let N=window.getSelection();R?N.setPosition(a(this,lD),a(this,lN)):N.setPosition(a(this,lB),a(this,l$))},hg=new WeakSet,hm=function(){return a(this,lV)?this.rotation:0},hw=new WeakSet,hy=function(){if(a(this,lV))return null;let[R,N]=this.pageDimensions,W=a(this,lO),j=Array(8*W.length),B=0;for(let{x:z,y:U,width:V,height:G}of W){let W=z*R,Y=(1-U-G)*N;j[B]=j[B+4]=W,j[B+1]=j[B+3]=Y,j[B+2]=j[B+6]=W+V*R,j[B+5]=j[B+7]=Y+G*N,B+=8}return j},hb=new WeakSet,hA=function(R){return a(this,lH).serialize(R,A(this,hg,hm).call(this))},hx=new WeakSet,h_=function(R,N){this._freeHighlight.add(N)&&R.drawLayer.updatePath(this._freeHighlightId,this._freeHighlight)},hS=new WeakSet,hE=function(R,N){this._freeHighlight.isEmpty()?R.drawLayer.removeFreeHighlight(this._freeHighlightId):R.createAndAddNewEditor(N,!1,{highlightId:this._freeHighlightId,highlightOutlines:this._freeHighlight.getOutlines(),clipPathId:this._freeHighlightClipId,methodOfCreation:"main_toolbar"}),this._freeHighlightId=-1,this._freeHighlight=null,this._freeHighlightClipId=""},m(wl,hl),m(wl,hx),m(wl,hS),dt(wl,"_defaultColor",null),dt(wl,"_defaultOpacity",1),dt(wl,"_defaultThickness",12),dt(wl,"_l10nPromise"),dt(wl,"_type","highlight"),dt(wl,"_editorType",mZ.HIGHLIGHT),dt(wl,"_freeHighlightId",-1),dt(wl,"_freeHighlight",null),dt(wl,"_freeHighlightClipId","");let wh=class jt extends vE{constructor(R){super({...R,name:"inkEditor"}),m(this,hz),m(this,hU),m(this,hG),m(this,hX),m(this,hK),m(this,hJ),m(this,h1),m(this,h3),m(this,h4),m(this,h8),m(this,h9),m(this,cn),m(this,cs),m(this,ch),m(this,cu),m(this,cm),m(this,cb),m(this,cx),m(this,cS),m(this,cI),m(this,cN),m(this,cF),m(this,cj),m(this,hk,
2320),m(this,hC,0),m(this,hM,this.canvasPointermove.bind(this)),m(this,hT,this.canvasPointerleave.bind(this)),m(this,hR,this.canvasPointerup.bind(this)),m(this,hP,this.canvasPointerdown.bind(this)),m(this,hI,null),m(this,hD,new Path2D),m(this,hN,!1),m(this,hO,!1),m(this,hF,!1),m(this,hW,null),m(this,hj,0),m(this,hB,0),m(this,h$,null),this.color=R.color||null,this.thickness=R.thickness||null,this.opacity=R.opacity||null,this.paths=[],this.bezierPath2D=[],this.allRawPaths=[],this.currentPath=[],this.scaleFactor=1,this.translationX=this.translationY=0,this.x=0,this.y=0,this._willKeepAspectRatio=!0}static initialize(R,N){vE.initialize(R,N)}static updateDefaultParams(R,N){switch(R){case m1.INK_THICKNESS:jt._defaultThickness=N;break;case m1.INK_COLOR:jt._defaultColor=N;break;case m1.INK_OPACITY:jt._defaultOpacity=N/100}}updateParams(R,N){switch(R){case m1.INK_THICKNESS:A(this,hz,hH).call(this,N);break;case m1.INK_COLOR:A(this,hU,hV).call(this,N);break;case m1.INK_OPACITY:A(this,hG,hq).call(this,N)}}static get defaultPropertiesToUpdate(){return[[m1.INK_THICKNESS,jt._defaultThickness],[m1.INK_COLOR,jt._defaultColor||vE._defaultLineColor],[m1.INK_OPACITY,Math.round(100*jt._defaultOpacity)]]}get propertiesToUpdate(){return[[m1.INK_THICKNESS,this.thickness||jt._defaultThickness],[m1.INK_COLOR,this.color||jt._defaultColor||vE._defaultLineColor],[m1.INK_OPACITY,Math.round(100*(this.opacity??jt._defaultOpacity))]]}rebuild(){this.parent&&(super.rebuild(),null!==this.div&&(this.canvas||(A(this,cu,cf).call(this),A(this,cm,cw).call(this)),this.isAttachedToDOM||(this.parent.add(this),A(this,cb,cA).call(this)),A(this,cj,cB).call(this)))}remove(){null!==this.canvas&&(this.isEmpty()||this.commit(),this.canvas.width=this.canvas.height=0,this.canvas.remove(),this.canvas=null,a(this,hI)&&(clearTimeout(a(this,hI)),w(this,hI,null)),a(this,hW).disconnect(),w(this,hW,null),super.remove())}setParent(R){!this.parent&&R?this._uiManager.removeShouldRescale(this):this.parent&&null===R&&this._uiManager.addShouldRescale(this),super.setParent(R)}onScaleChanging(){let[R,N]=this.parentDimensions,W=this.width*R,j=this.height*N;this.setDimensions(W,j)}enableEditMode(){a(this,hN)||null===this.canvas||(super.enableEditMode(),this._isDraggable=!1,this.canvas.addEventListener("pointerdown",a(this,hP)))}disableEditMode(){this.isInEditMode()&&null!==this.canvas&&(super.disableEditMode(),this._isDraggable=!this.isEmpty(),this.div.classList.remove("editing"),this.canvas.removeEventListener("pointerdown",a(this,hP)))}onceAdded(){this._isDraggable=!this.isEmpty()}isEmpty(){return 0===this.paths.length||1===this.paths.length&&0===this.paths[0].length}commit(){a(this,hN)||(super.commit(),this.isEditing=!1,this.disableEditMode(),this.setInForeground(),w(this,hN,!0),this.div.classList.add("disabled"),A(this,cj,cB).call(this,!0),this.select(),this.parent.addInkEditorIfNeeded(!0),this.moveInDOM(),this.div.focus({preventScroll:!0}))}focusin(R){this._focusEventsAllowed&&(super.focusin(R),this.enableEditMode())}canvasPointerdown(R){0!==R.button||!this.isInEditMode()||a(this,hN)||(this.setInForeground(),R.preventDefault(),this.div.contains(document.activeElement)||this.div.focus({preventScroll:!0}),A(this,hJ,hZ).call(this,R.offsetX,R.offsetY))}canvasPointermove(R){R.preventDefault(),A(this,h1,h2).call(this,R.offsetX,R.offsetY)}canvasPointerup(R){R.preventDefault(),A(this,ch,cc).call(this,R)}canvasPointerleave(R){A(this,ch,cc).call(this,R)}get isResizable(){return!this.isEmpty()&&a(this,hN)}render(){let R,N;if(this.div)return this.div;this.width&&(R=this.x,N=this.y),super.render(),this.div.setAttribute("data-l10n-id","pdfjs-ink");let[W,j,B,z]=A(this,hX,hY).call(this);if(this.setAt(W,j,0,0),this.setDims(B,z),A(this,cu,cf).call(this),this.width){let[W,j]=this.parentDimensions;this.setAspectRatio(this.width*W,this.height*j),this.setAt(R*W,N*j,this.width*W,this.height*j),w(this,hF,!0),A(this,cb,cA).call(this),this.setDims(this.width*W,this.height*j),A(this,cs,ca).call(this),this.div.classList.add("disabled")}else this.div.classList.add("editing"),this.enableEditMode();return A(this,cm,cw).call(this),this.div}setDimensions(R,N){let W=Math.round(R),j=Math.round(N);if(a(this,hj)===W&&a(this,hB)===j)return;w(this,hj,W),w(this,hB,j),this.canvas.style.visibility="hidden";let[B,z]=this.parentDimensions;this.width=R/B,this.height=N/z,this.fixAndSetPosition(),a(this,hN)&&A(this,cx,c_).call(this,R,N),A(this,cb,cA).call(this),A(this,cs,ca).c
232all(this),this.canvas.style.visibility="visible",this.fixDims()}static deserialize(R,N,W){if(R instanceof xw)return null;let j=super.deserialize(R,N,W);j.thickness=R.thickness,j.color=Q.makeHexColor(...R.color),j.opacity=R.opacity;let[B,z]=j.pageDimensions,U=j.width*B,V=j.height*z,G=j.parentScale,Y=R.thickness/2;w(j,hN,!0),w(j,hj,Math.round(U)),w(j,hB,Math.round(V));let{paths:Z,rect:te,rotation:tn}=R;for(let{bezier:R}of Z){R=A(jt,cR,cP).call(jt,R,te,tn);let N=[];j.paths.push(N);let W=G*(R[0]-Y),B=G*(R[1]-Y);for(let j=2,z=R.length;j<z;j+=6){let z=G*(R[j]-Y),U=G*(R[j+1]-Y),V=G*(R[j+2]-Y),Z=G*(R[j+3]-Y),te=G*(R[j+4]-Y),tn=G*(R[j+5]-Y);N.push([[W,B],[z,U],[V,Z],[te,tn]]),W=te,B=tn}let z=A(this,ck,cC).call(this,N);j.bezierPath2D.push(z)}let tr=A(j,cN,cO).call(j);return w(j,hC,Math.max(vE.MIN_SIZE,tr[2]-tr[0])),w(j,hk,Math.max(vE.MIN_SIZE,tr[3]-tr[1])),A(j,cx,c_).call(j,U,V),j}serialize(){if(this.isEmpty())return null;let R=this.getRect(0,0),N=vE._colorManager.convert(this.ctx.strokeStyle);return{annotationType:mZ.INK,color:N,thickness:this.thickness,opacity:this.opacity,paths:A(this,cI,cD).call(this,this.scaleFactor/this.parentScale,this.translationX,this.translationY,R),pageIndex:this.pageIndex,rect:R,rotation:this.rotation,structTreeParentId:this._structTreeParentId}}};hk=new WeakMap,hC=new WeakMap,hM=new WeakMap,hT=new WeakMap,hR=new WeakMap,hP=new WeakMap,hI=new WeakMap,hD=new WeakMap,hN=new WeakMap,hO=new WeakMap,hF=new WeakMap,hW=new WeakMap,hj=new WeakMap,hB=new WeakMap,h$=new WeakMap,hz=new WeakSet,hH=function(R){let n=R=>{this.thickness=R,A(this,cj,cB).call(this)},N=this.thickness;this.addCommands({cmd:n.bind(this,R),undo:n.bind(this,N),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:m1.INK_THICKNESS,overwriteIfSameType:!0,keepUndo:!0})},hU=new WeakSet,hV=function(R){let n=R=>{this.color=R,A(this,cs,ca).call(this)},N=this.color;this.addCommands({cmd:n.bind(this,R),undo:n.bind(this,N),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:m1.INK_COLOR,overwriteIfSameType:!0,keepUndo:!0})},hG=new WeakSet,hq=function(R){let n=R=>{this.opacity=R,A(this,cs,ca).call(this)};R/=100;let N=this.opacity;this.addCommands({cmd:n.bind(this,R),undo:n.bind(this,N),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:m1.INK_OPACITY,overwriteIfSameType:!0,keepUndo:!0})},hX=new WeakSet,hY=function(){let{parentRotation:R,parentDimensions:[N,W]}=this;switch(R){case 90:return[0,W,W,N];case 180:return[N,W,N,W];case 270:return[N,0,W,N];default:return[0,0,N,W]}},hK=new WeakSet,hQ=function(){let{ctx:R,color:N,opacity:W,thickness:j,parentScale:B,scaleFactor:z}=this;R.lineWidth=j*B/z,R.lineCap="round",R.lineJoin="round",R.miterLimit=10,R.strokeStyle=`${N}${Math.round(Math.min(255,Math.max(1,255*W))).toString(16).padStart(2,"0")}`},hJ=new WeakSet,hZ=function(R,N){this.canvas.addEventListener("contextmenu",Ve),this.canvas.addEventListener("pointerleave",a(this,hT)),this.canvas.addEventListener("pointermove",a(this,hM)),this.canvas.addEventListener("pointerup",a(this,hR)),this.canvas.removeEventListener("pointerdown",a(this,hP)),this.isEditing=!0,a(this,hF)||(w(this,hF,!0),A(this,cb,cA).call(this),this.thickness||(this.thickness=wh._defaultThickness),this.color||(this.color=wh._defaultColor||vE._defaultLineColor),this.opacity??(this.opacity=wh._defaultOpacity)),this.currentPath.push([R,N]),w(this,hO,!1),A(this,hK,hQ).call(this),w(this,h$,()=>{A(this,h8,h7).call(this),a(this,h$)&&window.requestAnimationFrame(a(this,h$))}),window.requestAnimationFrame(a(this,h$))},h1=new WeakSet,h2=function(R,N){let[W,j]=this.currentPath.at(-1);if(this.currentPath.length>1&&R===W&&N===j)return;let B=this.currentPath,z=a(this,hD);if(B.push([R,N]),w(this,hO,!0),B.length<=2){z.moveTo(...B[0]),z.lineTo(R,N);return}3===B.length&&(w(this,hD,z=new Path2D),z.moveTo(...B[0])),A(this,h9,ct).call(this,z,...B.at(-3),...B.at(-2),R,N)},h3=new WeakSet,h5=function(){if(0===this.currentPath.length)return;let R=this.currentPath.at(-1);a(this,hD).lineTo(...R)},h4=new WeakSet,h6=function(R,N){let W;if(w(this,h$,null),R=Math.min(Math.max(R,0),this.canvas.width),N=Math.min(Math.max(N,0),this.canvas.height),A(this,h1,h2).call(this,R,N),A(this,h3,h5).call(this),1!==this.currentPath.length)W=A(this,cn,cr).call(this);else{let j=[R,N];W=[[j,j.slice(),j.slice(),j]]}let j=a(this,hD),B=this.currentPath;this.currentPath=[],w(this,hD,new Path2D),this.addCommands({cmd:()=>{this.allRawPaths.push(B),this.paths.push(W),this.bezierPath2D.push(j),this._uiManager.rebuild(this)},undo:()=>{this.allRawPaths.pop(),this.paths.pop(),this.bezierPath2D.pop(),0===this.paths.length?this.remove():(this.canvas||(A(this,cu,cf).call(this),A(this,cm,cw).call(this)),A(this,cj,cB).call(this))},mustExec:!0})},h8=new WeakSet,h7=function(){if(!a(this,hO))return;w(this,hO,!1),this.thickness,this.parentScale;let R=this.currentPath.slice(-3);R.map(R=>R[0]),R.map(R=>R[1]);let{ctx:N}=this;for(let R of(N.save(),N.clearRect(0,0,this.canvas.width,this.canvas.height),this.bezierPath2D))N.stroke(R);
232N.stroke(a(this,hD)),N.restore()},h9=new WeakSet,ct=function(R,N,W,j,B,z,U){let V=(N+j)/2,G=(W+B)/2,Y=(j+z)/2,Z=(B+U)/2;R.bezierCurveTo(V+2*(j-V)/3,G+2*(B-G)/3,Y+2*(j-Y)/3,Z+2*(B-Z)/3,Y,Z)},cn=new WeakSet,cr=function(){let R=this.currentPath;if(R.length<=2)return[[R[0],R[0],R.at(-1),R.at(-1)]];let N=[],W,[j,B]=R[0];for(W=1;W<R.length-2;W++){let[z,U]=R[W],[V,G]=R[W+1],Y=(z+V)/2,Z=(U+G)/2,te=[j+2*(z-j)/3,B+2*(U-B)/3],tn=[Y+2*(z-Y)/3,Z+2*(U-Z)/3];N.push([[j,B],te,tn,[Y,Z]]),[j,B]=[Y,Z]}let[z,U]=R[W],[V,G]=R[W+1],Y=[j+2*(z-j)/3,B+2*(U-B)/3],Z=[V+2*(z-V)/3,G+2*(U-G)/3];return N.push([[j,B],Y,Z,[V,G]]),N},cs=new WeakSet,ca=function(){if(this.isEmpty()){A(this,cS,cE).call(this);return}A(this,hK,hQ).call(this);let{canvas:R,ctx:N}=this;for(let W of(N.setTransform(1,0,0,1,0,0),N.clearRect(0,0,R.width,R.height),A(this,cS,cE).call(this),this.bezierPath2D))N.stroke(W)},ch=new WeakSet,cc=function(R){this.canvas.removeEventListener("pointerleave",a(this,hT)),this.canvas.removeEventListener("pointermove",a(this,hM)),this.canvas.removeEventListener("pointerup",a(this,hR)),this.canvas.addEventListener("pointerdown",a(this,hP)),a(this,hI)&&clearTimeout(a(this,hI)),w(this,hI,setTimeout(()=>{w(this,hI,null),this.canvas.removeEventListener("contextmenu",Ve)},10)),A(this,h4,h6).call(this,R.offsetX,R.offsetY),this.addToAnnotationStorage(),this.setInBackground()},cu=new WeakSet,cf=function(){this.canvas=document.createElement("canvas"),this.canvas.width=this.canvas.height=0,this.canvas.className="inkEditorCanvas",this.canvas.setAttribute("data-l10n-id","pdfjs-ink-canvas"),this.div.append(this.canvas),this.ctx=this.canvas.getContext("2d")},cm=new WeakSet,cw=function(){w(this,hW,new ResizeObserver(R=>{let N=R[0].contentRect;N.width&&N.height&&this.setDimensions(N.width,N.height)})),a(this,hW).observe(this.div)},cb=new WeakSet,cA=function(){if(!a(this,hF))return;let[R,N]=this.parentDimensions;this.canvas.width=Math.ceil(this.width*R),this.canvas.height=Math.ceil(this.height*N),A(this,cS,cE).call(this)},cx=new WeakSet,c_=function(R,N){let W=A(this,cF,cW).call(this),j=(R-W)/a(this,hC),B=(N-W)/a(this,hk);this.scaleFactor=Math.min(j,B)},cS=new WeakSet,cE=function(){let R=A(this,cF,cW).call(this)/2;this.ctx.setTransform(this.scaleFactor,0,0,this.scaleFactor,this.translationX*this.scaleFactor+R,this.translationY*this.scaleFactor+R)},ck=new WeakSet,cC=function(R){let N=new Path2D;for(let W=0,j=R.length;W<j;W++){let[j,B,z,U]=R[W];0===W&&N.moveTo(...j),N.bezierCurveTo(B[0],B[1],z[0],z[1],U[0],U[1])}return N},cM=new WeakSet,cT=function(R,N,W){let[j,B,z,U]=N;switch(W){case 0:for(let N=0,W=R.length;N<W;N+=2)R[N]+=j,R[N+1]=U-R[N+1];break;case 90:for(let N=0,W=R.length;N<W;N+=2){let W=R[N];R[N]=R[N+1]+j,R[N+1]=W+B}break;case 180:for(let N=0,W=R.length;N<W;N+=2)R[N]=z-R[N],R[N+1]+=B;break;case 270:for(let N=0,W=R.length;N<W;N+=2){let W=R[N];R[N]=z-R[N+1],R[N+1]=U-W}break;default:throw Error("Invalid rotation")}return R},cR=new WeakSet,cP=function(R,N,W){let[j,B,z,U]=N;switch(W){case 0:for(let N=0,W=R.length;N<W;N+=2)R[N]-=j,R[N+1]=U-R[N+1];break;case 90:for(let N=0,W=R.length;N<W;N+=2){let W=R[N];R[N]=R[N+1]-B,R[N+1]=W-j}break;case 180:for(let N=0,W=R.length;N<W;N+=2)R[N]=z-R[N],R[N+1]-=B;break;case 270:for(let N=0,W=R.length;N<W;N+=2){let W=R[N];R[N]=U-R[N+1],R[N+1]=z-W}break;default:throw Error("Invalid rotation")}return R},cI=new WeakSet,cD=function(R,N,W,j){let B=[],z=this.thickness/2,U=R*N+z,V=R*W+z;for(let N of this.paths){let W=[],z=[];for(let j=0,B=N.length;j<B;j++){let[G,Y,Z,te]=N[j];if(G[0]===te[0]&&G[1]===te[1]&&1===B){let N=R*G[0]+U,j=R*G[1]+V;W.push(N,j),z.push(N,j);break}let tn=R*G[0]+U,tr=R*G[1]+V,ts=R*Y[0]+U,ta=R*Y[1]+V,th=R*Z[0]+U,tc=R*Z[1]+V,tu=R*te[0]+U,tp=R*te[1]+V;0===j&&(W.push(tn,tr),z.push(tn,tr)),W.push(ts,ta,th,tc,tu,tp),z.push(ts,ta),j===B-1&&z.push(tu,tp)}B.push({bezier:A(wh,cM,cT).call(wh,W,j,this.rotation),points:A(wh,cM,cT).call(wh,z,j,this.rotation)})}return B},cN=new WeakSet,cO=function(){let R=1/0,N=-1/0,W=1/0,j=-1/0;for(let B of this.paths)for(let[z,U,V,G]of B){let B=Q.bezierBoundingBox(...z,...U,...V,...G);R=Math.min(R,B[0]),W=Math.min(W,B[1]),N=Math.max(N,B[2]),j=Math.max(j,B[3])}return[R,W,N,j]}
232,cF=new WeakSet,cW=function(){return a(this,hN)?Math.ceil(this.thickness*this.parentScale):0},cj=new WeakSet,cB=function(R=!1){if(this.isEmpty())return;if(!a(this,hN)){A(this,cs,ca).call(this);return}let N=A(this,cN,cO).call(this),W=A(this,cF,cW).call(this);w(this,hC,Math.max(vE.MIN_SIZE,N[2]-N[0])),w(this,hk,Math.max(vE.MIN_SIZE,N[3]-N[1]));let j=Math.ceil(W+a(this,hC)*this.scaleFactor),B=Math.ceil(W+a(this,hk)*this.scaleFactor),[z,U]=this.parentDimensions;this.width=j/z,this.height=B/U,this.setAspectRatio(j,B);let V=this.translationX,G=this.translationY;this.translationX=-N[0],this.translationY=-N[1],A(this,cb,cA).call(this),A(this,cs,ca).call(this),w(this,hj,j),w(this,hB,B),this.setDims(j,B);let Y=R?W/this.scaleFactor/2:0;this.translate(V-this.translationX-Y,G-this.translationY-Y)},m(wh,ck),m(wh,cM),m(wh,cR),dt(wh,"_defaultColor",null),dt(wh,"_defaultOpacity",1),dt(wh,"_defaultThickness",1),dt(wh,"_type","ink"),dt(wh,"_editorType",mZ.INK);let wc=class extends vE{constructor(R){super({...R,name:"stampEditor"}),m(this,cJ),m(this,c0),m(this,c2),m(this,c5),m(this,c6),m(this,c7),m(this,de),m(this,dr),m(this,da),m(this,c$,null),m(this,cz,null),m(this,cH,null),m(this,cU,null),m(this,cV,null),m(this,cG,""),m(this,cq,null),m(this,cX,null),m(this,cY,null),m(this,cK,!1),m(this,cQ,!1),w(this,cU,R.bitmapUrl),w(this,cV,R.bitmapFile)}static initialize(R,N){vE.initialize(R,N)}static get supportedTypes(){return Tt(this,"supportedTypes",["apng","avif","bmp","gif","jpeg","png","svg+xml","webp","x-icon"].map(R=>`image/${R}`))}static get supportedTypesStr(){return Tt(this,"supportedTypesStr",this.supportedTypes.join(","))}static isHandlingMimeForPasting(R){return this.supportedTypes.includes(R)}static paste(R,N){N.pasteEditor(mZ.STAMP,{bitmapFile:R.getAsFile()})}remove(){var R,N;a(this,cz)&&(w(this,c$,null),this._uiManager.imageManager.deleteId(a(this,cz)),null==(R=a(this,cq))||R.remove(),w(this,cq,null),null==(N=a(this,cX))||N.disconnect(),w(this,cX,null),a(this,cY)&&(clearTimeout(a(this,cY)),w(this,cY,null))),super.remove()}rebuild(){if(!this.parent){a(this,cz)&&A(this,c2,c3).call(this);return}super.rebuild(),null!==this.div&&(a(this,cz)&&null===a(this,cq)&&A(this,c2,c3).call(this),this.isAttachedToDOM||this.parent.add(this))}onceAdded(){this._isDraggable=!0,this.div.focus()}isEmpty(){return!(a(this,cH)||a(this,c$)||a(this,cU)||a(this,cV)||a(this,cz))}get isResizable(){return!0}render(){let R,N;if(this.div)return this.div;if(this.width&&(R=this.x,N=this.y),super.render(),this.div.hidden=!0,this.addAltTextButton(),a(this,c$)?A(this,c5,c4).call(this):A(this,c2,c3).call(this),this.width){let[W,j]=this.parentDimensions;this.setAt(R*W,N*j,this.width*W,this.height*j)}return this.div}getImageForAltText(){return a(this,cq)}static deserialize(R,N,W){if(R instanceof Cw)return null;let j=super.deserialize(R,N,W),{rect:B,bitmapUrl:z,bitmapId:U,isSvg:V,accessibilityData:G}=R;U&&W.imageManager.isValidId(U)?w(j,cz,U):w(j,cU,z),w(j,cK,V);let[Y,Z]=j.pageDimensions;return j.width=(B[2]-B[0])/Y,j.height=(B[3]-B[1])/Z,G&&(j.altTextData=G),j}serialize(R=!1,N=null){if(this.isEmpty())return null;let W={annotationType:mZ.STAMP,bitmapId:a(this,cz),pageIndex:this.pageIndex,rect:this.getRect(0,0),rotation:this.rotation,isSvg:a(this,cK),structTreeParentId:this._structTreeParentId};if(R)return W.bitmapUrl=A(this,dr,ds).call(this,!0),W.accessibilityData=this.altTextData,W;let{decorative:j,altText:B}=this.altTextData;if(!j&&B&&(W.accessibilityData={type:"Figure",alt:B}),null===N)return W;N.stamps||(N.stamps=new Map);let z=a(this,cK)?(W.rect[2]-W.rect[0])*(W.rect[3]-W.rect[1]):null;if(N.stamps.has(a(this,cz))){if(a(this,cK)){let R=N.stamps.get(a(this,cz));z>R.area&&(R.area=z,R.serialized.bitmap.close(),R.serialized.bitmap=A(this,dr,ds).call(this,!1))}}else N.stamps.set(a(this,cz),{area:z,serialized:W}),W.bitmap=A(this,dr,ds).call(this,!1);return W}};c$=new WeakMap,cz=new WeakMap,cH=new WeakMap,cU=new WeakMap,cV=new WeakMap,cG=new WeakMap,cq=new WeakMap,cX=new WeakMap,cY=new WeakMap,cK=new WeakMap,cQ=new WeakMap,cJ=new WeakSet,cZ=function(R,N=!1){if(!R){this.remove();return}w(this,c$,R.bitmap),N||(w(this,cz,R.id),w(this,cK,R.isSvg)),R.file&&w(this,cG,R.file.name),A(this,c5,c4).call(this)},c0=new WeakSet,c1=function(){w(this,cH,null),this._uiManager.enableWaiting(!1),a(this,cq)&&this.div.focus()},c2=new WeakSet,c3=function(){if(a(this,cz)){this._uiManager.enableWaiting(!0),this._uiManager.imageManager.getFromId(a(this,cz)).then(R=>A(this,cJ,cZ).call(this,R,!0)).finally(()=>A(this,c0,c1).call(this));return}if(a(this,cU)){let R=a(this,cU);w(this,cU,null),this._uiManager.enableWaiting(!0),w(this,cH,this._uiManager.imageManager.getFromUrl(R).then(R=>A(this,cJ,cZ).call(this,R)).finally(()=>A(this,c0,c1).call(this)));return}if(a(this,cV)){let R=a(this,cV);w(this,cV,null),this._uiManager.enableWaiting(!0),w(this,cH,this._uiManager.imageManager.getFromFile(R).then(R=>A(this,cJ,cZ).call(this,R)).finally(()=>A(this,c0,c1).call(this)));return}let R=document.createElement("input");R.type="file",R.accept=wc.supportedTypesStr,w(this,cH,new Promise(N=>{R.addEventListener("change",async()=>
232{if(R.files&&0!==R.files.length){this._uiManager.enableWaiting(!0);let N=await this._uiManager.imageManager.getFromFile(R.files[0]);A(this,cJ,cZ).call(this,N)}else this.remove();N()}),R.addEventListener("cancel",()=>{this.remove(),N()})}).finally(()=>A(this,c0,c1).call(this))),R.click()},c5=new WeakSet,c4=function(){let{div:R}=this,{width:N,height:W}=a(this,c$),[j,B]=this.pageDimensions;if(this.width)N=this.width*j,W=this.height*B;else if(N>.75*j||W>.75*B){let R=Math.min(.75*j/N,.75*B/W);N*=R,W*=R}let[z,U]=this.parentDimensions;this.setDims(N*z/j,W*U/B),this._uiManager.enableWaiting(!1);let V=w(this,cq,document.createElement("canvas"));R.append(V),R.hidden=!1,A(this,de,dn).call(this,N,W),A(this,da,dl).call(this),a(this,cQ)||(this.parent.addUndoableEditor(this),w(this,cQ,!0)),this._reportTelemetry({action:"inserted_image"}),a(this,cG)&&V.setAttribute("aria-label",a(this,cG))},c6=new WeakSet,c8=function(R,N){var W;let[j,B]=this.parentDimensions;this.width=R/j,this.height=N/B,this.setDims(R,N),null!=(W=this._initialOptions)&&W.isCentered?this.center():this.fixAndSetPosition(),this._initialOptions=null,null!==a(this,cY)&&clearTimeout(a(this,cY)),w(this,cY,setTimeout(()=>{w(this,cY,null),A(this,de,dn).call(this,R,N)},200))},c7=new WeakSet,c9=function(R,N){let{width:W,height:j}=a(this,c$),B=W,z=j,U=a(this,c$);for(;B>2*R||z>2*N;){let W=B,j=z;B>2*R&&(B=B>=16384?Math.floor(B/2)-1:Math.ceil(B/2)),z>2*N&&(z=z>=16384?Math.floor(z/2)-1:Math.ceil(z/2));let V=new OffscreenCanvas(B,z);V.getContext("2d").drawImage(U,0,0,W,j,0,0,B,z),U=V.transferToImageBitmap()}return U},de=new WeakSet,dn=function(R,N){R=Math.ceil(R),N=Math.ceil(N);let W=a(this,cq);if(!W||W.width===R&&W.height===N)return;W.width=R,W.height=N;let j=a(this,cK)?a(this,c$):A(this,c7,c9).call(this,R,N);if(this._uiManager.hasMLManager&&!this.hasAltText()){let W=new OffscreenCanvas(R,N).getContext("2d");W.drawImage(j,0,0,j.width,j.height,0,0,R,N),this._uiManager.mlGuess({service:"image-to-text",request:{data:W.getImageData(0,0,R,N).data,width:R,height:N,channels:4}}).then(R=>{let N=(null==R?void 0:R.output)||"";this.parent&&N&&!this.hasAltText()&&(this.altTextData={altText:N,decorative:!1})})}let B=W.getContext("2d");B.filter=this._uiManager.hcmFilter,B.drawImage(j,0,0,j.width,j.height,0,0,R,N)},dr=new WeakSet,ds=function(R){if(R){if(a(this,cK)){let R=this._uiManager.imageManager.getSvgUrl(a(this,cz));if(R)return R}let R=document.createElement("canvas");return{width:R.width,height:R.height}=a(this,c$),R.getContext("2d").drawImage(a(this,c$),0,0),R.toDataURL()}if(a(this,cK)){let[R,N]=this.pageDimensions,W=Math.round(this.width*R*vf.PDF_TO_CSS_UNITS),j=Math.round(this.height*N*vf.PDF_TO_CSS_UNITS),B=new OffscreenCanvas(W,j);return B.getContext("2d").drawImage(a(this,c$),0,0,a(this,c$).width,a(this,c$).height,0,0,W,j),B.transferToImageBitmap()}return structuredClone(a(this,c$))},da=new WeakSet,dl=function(){w(this,cX,new ResizeObserver(R=>{let N=R[0].contentRect;N.width&&N.height&&A(this,c6,c8).call(this,N.width,N.height)})),a(this,cX).observe(this.div)},dt(wc,"_type","stamp"),dt(wc,"_editorType",mZ.STAMP);let wd=class gn{constructor({uiManager:R,pageIndex:N,div:W,accessibilityManager:j,annotationLayer:B,drawLayer:z,textLayer:U,viewport:V,l10n:G}){m(this,dC),m(this,dT),m(this,dI),m(this,dN),m(this,dF),m(this,dh,void 0),m(this,dc,!1),m(this,du,null),m(this,df,null),m(this,dm,null),m(this,dv,null),m(this,dw,null),m(this,dy,new Map),m(this,db,!1),m(this,dA,!1),m(this,dx,!1),m(this,d_,null),m(this,dS,void 0);let Y=[...a(gn,dE).values()];if(!gn._initialized)for(let N of(gn._initialized=!0,Y))N.initialize(G,R);
232R.registerEditorTypes(Y),w(this,dS,R),this.pageIndex=N,this.div=W,w(this,dh,j),w(this,du,B),this.viewport=V,w(this,d_,U),this.drawLayer=z,a(this,dS).addLayer(this)}get isEmpty(){return 0===a(this,dy).size}get isInvisible(){return this.isEmpty&&a(this,dS).getMode()===mZ.NONE}updateToolbar(R){a(this,dS).updateToolbar(R)}updateMode(R=a(this,dS).getMode()){switch(A(this,dF,dW).call(this),R){case mZ.NONE:this.disableTextSelection(),this.togglePointerEvents(!1),this.toggleAnnotationLayerPointerEvents(!0),this.disableClick();return;case mZ.INK:this.addInkEditorIfNeeded(!1),this.disableTextSelection(),this.togglePointerEvents(!0),this.disableClick();break;case mZ.HIGHLIGHT:this.enableTextSelection(),this.togglePointerEvents(!1),this.disableClick();break;default:this.disableTextSelection(),this.togglePointerEvents(!0),this.enableClick()}this.toggleAnnotationLayerPointerEvents(!1);let{classList:N}=this.div;for(let W of a(gn,dE).values())N.toggle(`${W._type}Editing`,R===W._editorType);this.div.hidden=!1}hasTextLayer(R){var N;return R===(null==(N=a(this,d_))?void 0:N.div)}addInkEditorIfNeeded(R){if(a(this,dS).getMode()===mZ.INK){if(!R){for(let R of a(this,dy).values())if(R.isEmpty()){R.setInBackground();return}}this.createAndAddNewEditor({offsetX:0,offsetY:0},!1).setInBackground()}}setEditingState(R){a(this,dS).setEditingState(R)}addCommands(R){a(this,dS).addCommands(R)}togglePointerEvents(R=!1){this.div.classList.toggle("disabled",!R)}toggleAnnotationLayerPointerEvents(R=!1){var N;null==(N=a(this,du))||N.div.classList.toggle("disabled",!R)}enable(){this.div.tabIndex=0,this.togglePointerEvents(!0);let R=new Set;for(let N of a(this,dy).values())N.enableEditing(),N.show(!0),N.annotationElementId&&(a(this,dS).removeChangedExistingAnnotation(N),R.add(N.annotationElementId));if(!a(this,du))return;let N=a(this,du).getEditableAnnotations();for(let W of N){if(W.hide(),a(this,dS).isDeletedAnnotationElement(W.data.id)||R.has(W.data.id))continue;let N=this.deserialize(W);N&&(this.addOrRebuild(N),N.enableEditing())}}disable(){var R;w(this,dx,!0),this.div.tabIndex=-1,this.togglePointerEvents(!1);let N=new Map,W=new Map;for(let j of a(this,dy).values())if(j.disableEditing(),j.annotationElementId){if(null!==j.serialize()){N.set(j.annotationElementId,j);continue}W.set(j.annotationElementId,j),null==(R=this.getEditableAnnotation(j.annotationElementId))||R.show(),j.remove()}if(a(this,du)){let R=a(this,du).getEditableAnnotations();for(let j of R){let{id:R}=j.data;if(a(this,dS).isDeletedAnnotationElement(R))continue;let B=W.get(R);if(B){B.resetAnnotationElement(j),B.show(!1),j.show();continue}(B=N.get(R))&&(a(this,dS).addChangedExistingAnnotation(B),B.renderAnnotationElement(j),B.show(!1)),j.show()}}A(this,dF,dW).call(this),this.isEmpty&&(this.div.hidden=!0);let{classList:j}=this.div;for(let R of a(gn,dE).values())j.remove(`${R._type}Editing`);this.disableTextSelection(),this.toggleAnnotationLayerPointerEvents(!0),w(this,dx,!1)}getEditableAnnotation(R){var N;return(null==(N=a(this,du))?void 0:N.getEditableAnnotation(R))||null}setActiveEditor(R){a(this,dS).getActive()!==R&&a(this,dS).setActiveEditor(R)}enableTextSelection(){var R;this.div.tabIndex=-1,null!=(R=a(this,d_))&&R.div&&!a(this,dv)&&(w(this,dv,A(this,dC,dM).bind(this)),a(this,d_).div.addEventListener("pointerdown",a(this,dv)),a(this,d_).div.classList.add("highlighting"))}disableTextSelection(){var R;this.div.tabIndex=0,null!=(R=a(this,d_))&&R.div&&a(this,dv)&&(a(this,d_).div.removeEventListener("pointerdown",a(this,dv)),w(this,dv,null),a(this,d_).div.classList.remove("highlighting"))}enableClick(){a(this,dm)||(w(this,dm,this.pointerdown.bind(this)),w(this,df,this.pointerup.bind(this)),this.div.addEventListener("pointerdown",a(this,dm)),this.div.addEventListener("pointerup",a(this,df)))}disableClick(){a(this,dm)&&(this.div.removeEventListener("pointerdown",a(this,dm)),this.div.removeEventListener("pointerup",a(this,df)),w(this,dm,null),w(this,df,null))}attach(R){a(this,dy).set(R.id,R);let{annotationElementId:N}=R;N&&a(this,dS).isDeletedAnnotationElement(N)&&a(this,dS).removeDeletedAnnotationElement(R)}detach(R){var N;a(this,dy).delete(R.id),null==(N=a(this,dh))||N.removePointerInTextLayer(R.contentDiv),!a(this,dx)&&R.annotationElementId&&a(this,dS).addDeletedAnnotationElement(R)}remove(R){this.detach(R),a(this,dS).removeEditor(R),R.div.remove(),R.isAttachedToDOM=!1,a(this,dA)||this.addInkEditorIfNeeded(!1)}changeParent(R){var N;R.parent!==this&&(R.parent&&R.annotationElementId&&(a(this,dS).addDeletedAnnotationElement(R.annotationElementId),vE.deleteAnnotationElement(R),R.annotationElementId=null),this.attach(R),null==(N=R.parent)||N.detach(R),R.setParent(this),R.div&&R.isAttachedToDOM&&(R.div.remove(),this.div.append(R.div)))}
232add(R){if(!(R.parent===this&&R.isAttachedToDOM)){if(this.changeParent(R),a(this,dS).addEditor(R),this.attach(R),!R.isAttachedToDOM){let N=R.render();this.div.append(N),R.isAttachedToDOM=!0}R.fixAndSetPosition(),R.onceAdded(),a(this,dS).addToAnnotationStorage(R),R._reportTelemetry(R.telemetryInitialData)}}moveEditorInDOM(R){var N;if(!R.isAttachedToDOM)return;let{activeElement:W}=document;R.div.contains(W)&&!a(this,dw)&&(R._focusEventsAllowed=!1,w(this,dw,setTimeout(()=>{w(this,dw,null),R.div.contains(document.activeElement)?R._focusEventsAllowed=!0:(R.div.addEventListener("focusin",()=>{R._focusEventsAllowed=!0},{once:!0}),W.focus())},0))),R._structTreeParentId=null==(N=a(this,dh))?void 0:N.moveElementInDOM(this.div,R.div,R.contentDiv,!0)}addOrRebuild(R){R.needsToBeRebuilt()?(R.parent||(R.parent=this),R.rebuild(),R.show()):this.add(R)}addUndoableEditor(R){this.addCommands({cmd:()=>R._uiManager.rebuild(R),undo:()=>{R.remove()},mustExec:!1})}getNextId(){return a(this,dS).getId()}canCreateNewEmptyEditor(){var R;return null==(R=a(this,dT,dR))?void 0:R.canCreateNewEmptyEditor()}pasteEditor(R,N){a(this,dS).updateToolbar(R),a(this,dS).updateMode(R);let{offsetX:W,offsetY:j}=A(this,dN,dO).call(this),B=this.getNextId(),z=A(this,dI,dD).call(this,{parent:this,id:B,x:W,y:j,uiManager:a(this,dS),isCentered:!0,...N});z&&this.add(z)}deserialize(R){var N;return(null==(N=a(gn,dE).get(R.annotationType??R.annotationEditorType))?void 0:N.deserialize(R,this,a(this,dS)))||null}createAndAddNewEditor(R,N,W={}){let j=this.getNextId(),B=A(this,dI,dD).call(this,{parent:this,id:j,x:R.offsetX,y:R.offsetY,uiManager:a(this,dS),isCentered:N,...W});return B&&this.add(B),B}addNewEditor(){this.createAndAddNewEditor(A(this,dN,dO).call(this),!0)}setSelected(R){a(this,dS).setSelected(R)}toggleSelected(R){a(this,dS).toggleSelected(R)}isSelected(R){return a(this,dS).isSelected(R)}unselect(R){a(this,dS).unselect(R)}pointerup(R){let{isMac:N}=Ge.platform;if(!(0!==R.button||R.ctrlKey&&N)&&R.target===this.div&&a(this,db)){if(w(this,db,!1),!a(this,dc)){w(this,dc,!0);return}if(a(this,dS).getMode()===mZ.STAMP){a(this,dS).unselectAll();return}this.createAndAddNewEditor(R,!1)}}pointerdown(R){if(a(this,dS).getMode()===mZ.HIGHLIGHT&&this.enableTextSelection(),a(this,db)){w(this,db,!1);return}let{isMac:N}=Ge.platform;if(0!==R.button||R.ctrlKey&&N||R.target!==this.div)return;w(this,db,!0);let W=a(this,dS).getActive();w(this,dc,!W||W.isEmpty())}findNewParent(R,N,W){let j=a(this,dS).findParent(N,W);return null!==j&&j!==this&&(j.changeParent(R),!0)}destroy(){var R,N;for(let W of((null==(R=a(this,dS).getActive())?void 0:R.parent)===this&&(a(this,dS).commitOrRemove(),a(this,dS).setActiveEditor(null)),a(this,dw)&&(clearTimeout(a(this,dw)),w(this,dw,null)),a(this,dy).values()))null==(N=a(this,dh))||N.removePointerInTextLayer(W.contentDiv),W.setParent(null),W.isAttachedToDOM=!1,W.div.remove();this.div=null,a(this,dy).clear(),a(this,dS).removeLayer(this)}render({viewport:R}){for(let N of(this.viewport=R,to(this.div,R),a(this,dS).getEditors(this.pageIndex)))this.add(N),N.rebuild();this.updateMode()}update({viewport:R}){a(this,dS).commitOrRemove(),A(this,dF,dW).call(this);let N=this.viewport.rotation,W=R.rotation;if(this.viewport=R,to(this.div,{rotation:W}),N!==W)for(let R of a(this,dy).values())R.rotate(W);this.addInkEditorIfNeeded(!1)}get pageDimensions(){let{pageWidth:R,pageHeight:N}=this.viewport.rawDims;return[R,N]}get scale(){return a(this,dS).viewParameters.realScale}};dh=new WeakMap,dc=new WeakMap,du=new WeakMap,df=new WeakMap,dm=new WeakMap,dv=new WeakMap,dw=new WeakMap,dy=new WeakMap,db=new WeakMap,dA=new WeakMap,dx=new WeakMap,d_=new WeakMap,dS=new WeakMap,dE=new WeakMap,dC=new WeakSet,dM=function(R){if(a(this,dS).unselectAll(),R.target===a(this,d_).div){let{isMac:N}=Ge.platform;0!==R.button||R.ctrlKey&&N||(a(this,dS).showAllEditors("highlight",!0,!0),a(this,d_).div.classList.add("free"),wl.startHighlighting(this,"ltr"===a(this,dS).direction,R),a(this,d_).div.addEventListener("pointerup",()=>{a(this,d_).div.classList.remove("free")},{once:!0}),R.preventDefault())}},dT=new WeakSet,dR=function(){return a(wd,dE).get(a(this,dS).getMode())},dI=new WeakSet,dD=function(R){let N=a(this,dT,dR);return N?new N.prototype.constructor(R):null},dN=new WeakSet,dO=function(){let{x:R,y:N,width:W,height:j}=this.div.getBoundingClientRect(),B=Math.min(window.innerWidth,R+W),z=Math.min(window.innerHeight,N+j),U=(Math.max(0,R)+B)/2-R,V=(Math.max(0,N)+z)/2-N,[G,Y]=this.viewport.rotation%180==0?[U,V]:[V,U];return{offsetX:G,offsetY:Y}},dF=new WeakSet,dW=function(){for(let R of(w(this,dA,!0),a(this,dy).values())
232)R.isEmpty()&&R.remove();w(this,dA,!1)},dt(wd,"_initialized",!1),m(wd,dE,new Map([wr,wh,wc,wl].map(R=>[R._editorType,R])));let wu=wd,wf=class ge{constructor({pageIndex:R}){m(this,dV),m(this,dq),m(this,dj,null),m(this,dB,0),m(this,d$,new Map),m(this,dz,new Map),this.pageIndex=R}setParent(R){if(!a(this,dj)){w(this,dj,R);return}if(a(this,dj)!==R){if(a(this,d$).size>0)for(let N of a(this,d$).values())N.remove(),R.append(N);w(this,dj,R)}}static get _svgFactory(){return Tt(this,"_svgFactory",new u0)}highlight(R,N,W,j=!1){let B=We(this,dB)._++,z=A(this,dV,dG).call(this,R.box);z.classList.add("highlight"),R.free&&z.classList.add("free");let U=ge._svgFactory.createElement("defs");z.append(U);let V=ge._svgFactory.createElement("path");U.append(V);let G=`path_p${this.pageIndex}_${B}`;V.setAttribute("id",G),V.setAttribute("d",R.toSVGPath()),j&&a(this,dz).set(B,V);let Y=A(this,dq,dX).call(this,U,G),Z=ge._svgFactory.createElement("use");return z.append(Z),z.setAttribute("fill",N),z.setAttribute("fill-opacity",W),Z.setAttribute("href",`#${G}`),a(this,d$).set(B,z),{id:B,clipPathId:`url(#${Y})`}}highlightOutline(R){let N;let W=We(this,dB)._++,j=A(this,dV,dG).call(this,R.box);j.classList.add("highlightOutline");let B=ge._svgFactory.createElement("defs");j.append(B);let z=ge._svgFactory.createElement("path");B.append(z);let U=`path_p${this.pageIndex}_${W}`;if(z.setAttribute("id",U),z.setAttribute("d",R.toSVGPath()),z.setAttribute("vector-effect","non-scaling-stroke"),R.free){j.classList.add("free");let R=ge._svgFactory.createElement("mask");B.append(R),N=`mask_p${this.pageIndex}_${W}`,R.setAttribute("id",N),R.setAttribute("maskUnits","objectBoundingBox");let z=ge._svgFactory.createElement("rect");R.append(z),z.setAttribute("width","1"),z.setAttribute("height","1"),z.setAttribute("fill","white");let V=ge._svgFactory.createElement("use");R.append(V),V.setAttribute("href",`#${U}`),V.setAttribute("stroke","none"),V.setAttribute("fill","black"),V.setAttribute("fill-rule","nonzero"),V.classList.add("mask")}let V=ge._svgFactory.createElement("use");j.append(V),V.setAttribute("href",`#${U}`),N&&V.setAttribute("mask",`url(#${N})`);let G=V.cloneNode();return j.append(G),V.classList.add("mainOutline"),G.classList.add("secondaryOutline"),a(this,d$).set(W,j),W}finalizeLine(R,N){let W=a(this,dz).get(R);a(this,dz).delete(R),this.updateBox(R,N.box),W.setAttribute("d",N.toSVGPath())}updateLine(R,N){a(this,d$).get(R).firstChild.firstChild.setAttribute("d",N.toSVGPath())}removeFreeHighlight(R){this.remove(R),a(this,dz).delete(R)}updatePath(R,N){a(this,dz).get(R).setAttribute("d",N.toSVGPath())}updateBox(R,N){A(ge,dH,dU).call(ge,a(this,d$).get(R),N)}show(R,N){a(this,d$).get(R).classList.toggle("hidden",!N)}rotate(R,N){a(this,d$).get(R).setAttribute("data-main-rotation",N)}changeColor(R,N){a(this,d$).get(R).setAttribute("fill",N)}changeOpacity(R,N){a(this,d$).get(R).setAttribute("fill-opacity",N)}addClass(R,N){a(this,d$).get(R).classList.add(N)}removeClass(R,N){a(this,d$).get(R).classList.remove(N)}remove(R){null!==a(this,dj)&&(a(this,d$).get(R).remove(),a(this,d$).delete(R))}destroy(){for(let R of(w(this,dj,null),a(this,d$).values()))R.remove();a(this,d$).clear()}};dj=new WeakMap,dB=new WeakMap,d$=new WeakMap,dz=new WeakMap,dH=new WeakSet,dU=function(R,{x:N=0,y:W=0,width:j=1,height:B=1}={}){let{style:z}=R;z.top=`${100*W}%`,z.left=`${100*N}%`,z.width=`${100*j}%`,z.height=`${100*B}%`},dV=new WeakSet,dG=function(R){let N=wf._svgFactory.create(1,1,!0);return a(this,dj).append(N),N.setAttribute("aria-hidden",!0),A(wf,dH,dU).call(wf,N,R),N},dq=new WeakSet,dX=function(R,N){let W=wf._svgFactory.createElement("clipPath");R.append(W);let j=`clip_${N}`;W.setAttribute("id",j),W.setAttribute("clipPathUnits","objectBoundingBox");let B=wf._svgFactory.createElement("use");return W.append(B),B.setAttribute("href",`#${N}`),B.classList.add("clip"),j},m(wf,dH);let wm=wf;var wv=mq.AbortException,ww=mq.AnnotationEditorLayer,wA=mq.AnnotationEditorParamsType,wx=mq.AnnotationEditorType,w_=mq.AnnotationEditorUIManager,wS=mq.AnnotationLayer,wE=mq.AnnotationMode,wC=mq.CMapCompressionType,wM=mq.ColorPicker,wT=mq.DOMSVGFactory,wR=mq.DrawLayer,wP=mq.FeatureTest,wI=mq.GlobalWorkerOptions,wD=mq.ImageKind,wN=mq.InvalidPDFException,wO=mq.MissingPDFException,wF=mq.OPS,wW=mq.Outliner,wj=mq.PDFDataRangeTransport,wB=mq.PDFDateString,w$=mq.PDFWorker,wz=mq.PasswordResponses,wH=mq.PermissionFlag,wU=mq.PixelsPerInch,wV=mq.RenderingCancelledException,wG=mq.TextLayer,wq=mq.UnexpectedResponseException,wX=mq.Util,wY=mq.VerbosityLevel,wK=mq.XfaLayer,wQ=mq.build,wJ=mq.createValidAbsoluteUrl,wZ=mq.fetchData,w0=mq.getDocument,w1=mq.getFilenameFromUrl,w3=mq.getPdfFilenameFromUrl,w5=mq.getXfaPageViewport,w4=mq.isDataScheme,w6=mq.isPdfFile,w8=mq.noContextMenu,w7=mq.normalizeUnicode,w9=mq.renderTextLayer,yt=mq.setLayerDimensions,ye=mq.shadow,yi=mq.updateTextLayer,yn=mq.version;let yr=Object.freeze(Object.defineProperty({__proto__:null,AbortException:wv,AnnotationEditorLayer:ww,AnnotationEditorParamsType:wA,AnnotationEditorType:wx,AnnotationEditorUIManager:w_,AnnotationLayer:wS,AnnotationMode:wE,CMapCompressionType:wC,ColorPicker:wM,DOMSVGFactory:wT,DrawLayer:wR,FeatureTest:wP,GlobalWorkerOptions:wI,ImageKind:wD,InvalidPDFException:wN,MissingPDFException:wO,OPS:wF,Outliner:wW,PDFDataRangeTransport:wj,PDFDateString:wB,PDFWorker:w$,PasswordResponses:wz,PermissionFlag:wH,PixelsPerInch:wU,RenderingCancelledException:wV,TextLayer:wG,UnexpectedResponseException:wq,Util:wX,VerbosityLevel:wY,XfaLayer:wK,build:wQ,createValidAbsoluteUrl:wJ,fetchData:wZ,getDocument:w0,getFilenameFromUrl:w1,getPdfFilenameFromUrl:w3,getXfaPageViewport:w5,isDataScheme:w4,isPdfFile:w6,noContextMenu:w8,normalizeUnicode:w7,renderTextLayer:w9,setLayerDimensions:yt,shadow:ye,updateTextLayer:yi,version:yn},Symbol.toStringTag,{value:"Module"}));var he=function(R,N,W){if(W||2==arguments.length)for(var j,B=0,z=N.length;B<z;B++)!j&&B in N||(j||(j=Array.prototype.slice.call(N,0,B)),j[B]=N[B]);return R.concat(j||Array.prototype.slice.call(N))},ys=he(he(he(he(he(he(he(he(he(he(he(he(he(he(he(he(he(he([],["onCopy","onCut","onPaste"],!0),["onCompositionEnd","onCompositionStart","onCompositionUpdate"],!0),["onFocus","onBlur"],!0),["onInput","onInvalid","onReset","onSubmit"],!0),["onLoad","onError"],!0),["onKeyDown","onKeyPress","onKeyUp"],!0),["onAbort","onCanPlay","onCanPlayThrough","onDurationChange","onEmptied","onEncrypted","onEnded","onError","onLoadedData","onLoadedMetadata","onLoadStart","onPause","onPlay","onPlaying","onProgress","onRateChange","onSeeked","onSeeking","onStalled","onSuspend","onTimeUpdate","onVolumeChange","onWaiting"],!0),["onClick","onContextMenu","onDoubleClick","onMouseDown","onMouseEnter","onMouseLeave","onMouseMove","onMouseOut","onMouseOver","onMouseUp"],!0),["onDrag","onDragEnd","onDragEnter","onDragExit","onDragLeave","onDragOver","onDragStart","onDrop"],!0),["onSelect"],!0),["onTouchCancel","onTouchEnd","onTouchMove","onTouchStart"],!0),["onPointerDown","onPointerMove","onPointerUp","onPointerCancel","onGotPointerCapture","onLostPointerCapture","onPointerEnter","onPointerLeave","onPointerOver","onPointerOut"],!0),["onScroll"],!0),["onWheel"],!0),["onAnimationStart","onAnimationEnd","onAnimationIteration"],!0),["onTransitionEnd"],!0),["onChange"],!0),["onToggle"],!0);function v1(R,N){var W={};return ys.forEach(function(j){var B=R[j];B&&(N?W[j]=function(R){return B(R,N(j))}:W[j]=B)}),W}
232function nd(R){var N=!1;return{promise:new Promise(function(W,j){R.then(function(R){return!N&&W(R)}).catch(function(R){return!N&&j(R)})}),cancel:function(){N=!0}}}function yp(){for(var R,N,W=0,j="";W<arguments.length;)(R=arguments[W++])&&(N=function y1(R){var N,W,j="";if("string"==typeof R||"number"==typeof R)j+=R;else if("object"==typeof R){if(Array.isArray(R))for(N=0;N<R.length;N++)R[N]&&(W=y1(R[N]))&&(j&&(j+=" "),j+=W);else for(N in R)R[N]&&(j&&(j+=" "),j+=N)}return j}(R))&&(j&&(j+=" "),j+=N);return j}var ya="production"===fx.env.NODE_ENV,yo="Invariant failed";function $t(R,N){if(!R){if(ya)throw Error(yo);var W="function"==typeof N?N():N;throw Error(W?"".concat(yo,": ").concat(W):yo)}}var yl="production"!==fx.env.NODE_ENV,b1=function(){};if(yl){var II=function(R,N){var W=arguments.length;N=Array(W>1?W-1:0);for(var j=1;j<W;j++)N[j-1]=arguments[j];var B=0,z="Warning: "+R.replace(/%s/g,function(){return N[B++]});"u">typeof console&&console.error(z);try{throw Error(z)}catch{}};b1=function(R,N,W){var j=arguments.length;W=Array(j>2?j-2:0);for(var B=2;B<j;B++)W[B-2]=arguments[B];if(void 0===N)throw Error("`warning(condition, format, ...args)` requires a warning message argument");R||II.apply(null,[N].concat(W))}}var yh=b1;let yc=Jv(yh);var yd=Object.prototype.hasOwnProperty;function Nv(R,N,W){for(W of R.keys())if(xo(W,N))return W}function xo(R,N){var W,j,B;if(R===N)return!0;if(R&&N&&(W=R.constructor)===N.constructor){if(W===Date)return R.getTime()===N.getTime();if(W===RegExp)return R.toString()===N.toString();if(W===Array){if((j=R.length)===N.length)for(;j--&&xo(R[j],N[j]););return -1===j}if(W===Set){if(R.size!==N.size)return!1;for(j of R)if((B=j)&&"object"==typeof B&&!(B=Nv(N,B))||!N.has(B))return!1;return!0}if(W===Map){if(R.size!==N.size)return!1;for(j of R)if((B=j[0])&&"object"==typeof B&&!(B=Nv(N,B))||!xo(j[1],N.get(B)))return!1;return!0}if(W===ArrayBuffer)R=new Uint8Array(R),N=new Uint8Array(N);else if(W===DataView){if((j=R.byteLength)===N.byteLength)for(;j--&&R.getInt8(j)===N.getInt8(j););return -1===j}if(ArrayBuffer.isView(R)){if((j=R.byteLength)===N.byteLength)for(;j--&&R[j]===N[j];);return -1===j}if(!W||"object"==typeof R){for(W in j=0,R)if(yd.call(R,W)&&++j&&!yd.call(N,W)||!(W in N)||!xo(R[W],N[W]))return!1;return Object.keys(N).length===j}}return R!=R&&N!=N}let yu=(0,dK.createContext)(null);function Co({children:R,type:N}){return(0,dY.jsx)("div",{className:`react-pdf__message react-pdf__message--${N}`,children:R})}let DI=class DI{constructor(){this.externalLinkEnabled=!0,this.externalLinkRel=void 0,this.externalLinkTarget=void 0,this.isInPresentationMode=!1,this.pdfDocument=void 0,this.pdfViewer=void 0}setDocument(R){this.pdfDocument=R}setViewer(R){this.pdfViewer=R}setExternalLinkRel(R){this.externalLinkRel=R}setExternalLinkTarget(R){this.externalLinkTarget=R}setHistory(){}get pagesCount(){return this.pdfDocument?this.pdfDocument.numPages:0}get page(){return $t(this.pdfViewer,"PDF viewer is not initialized."),this.pdfViewer.currentPageNumber||0}set page(R){$t(this.pdfViewer,"PDF viewer is not initialized."),this.pdfViewer.currentPageNumber=R}get rotation(){return 0}set rotation(R){}goToDestination(R){return new Promise(N=>{$t(this.pdfDocument,"PDF document not loaded."),$t(R,"Destination is not specified."),"string"==typeof R?this.pdfDocument.getDestination(R).then(N):Array.isArray(R)?N(R):R.then(N)}).then(R=>{$t(Array.isArray(R),`"${R}" is not a valid destination array.`);let N=R[0];new Promise(R=>{$t(this.pdfDocument,"PDF document not loaded."),N instanceof Object?this.pdfDocument.getPageIndex(N).then(N=>{R(N)}).catch(()=>{$t(!1,`"${N}" is not a valid page reference.`)}):"number"==typeof N?R(N):$t(!1,`"${N}" is not a valid destination reference.`)}).then(N=>{let W=N+1;$t(this.pdfViewer,"PDF viewer is not initialized."),$t(W>=1&&W<=this.pagesCount,`"${W}" is not a valid page number.`),this.pdfViewer.scrollPageIntoView({dest:R,pageIndex:N,pageNumber:W})})})}navigateTo(R){this.goToDestination(R)}goToPage(R){let N=R-1;$t(this.pdfViewer,"PDF viewer is not initialized."),$t(R>=1&&R<=this.pagesCount,`"${R}" is not a valid page number.`),this.pdfViewer.scrollPageIntoView({pageIndex:N,pageNumber:R})}addLinkAttributes(R,N,W){R.href=N,R.rel=this.externalLinkRel||"noopener noreferrer nofollow",R.target=W?"_blank":this.externalLinkTarget||""}getDestinationHash(){return"#"}getAnchorUrl(){return"#"}setHash(){}executeNamedAction(){}cachePageRef(){}isPageVisible(){return!0}isPageCached(){return!0}executeSetOCGState(){}};let yf={NEED_PASSWORD:1,INCORRECT_PASSWORD:2},yg="u">typeof document,ym=yg&&"file:"===window.location.protocol;function Lr(R){return"u">typeof R&&null!==R}function Um(R){return"string"==typeof R&&/^data:/.test(R)}function $v(R){$t(Um(R),"Invalid data URI.");let[N="",W=""]=R.split(",");return -1!==N.split(";").indexOf("base64")?atob(W):unescape(W)}let yv="On Chromium based browsers, you can use --allow-file-access-from-files flag for debugging purposes.";function Uv(){yc(!ym,`Loading PDF as base64 strings/URLs may not work on protocols other than HTTP/HTTPS. ${yv}`)}function io(R){R&&R.cancel&&R.cancel()}function Hm(R,N){return Object.defineProperty(R,"width",{get(){return this.view[2]*N},configurable:!0}),Object.defineProperty(R,"height",{get(){return this.view[3]*N},configurable:!0}),Object.defineProperty(R,"originalWidth",{get(){return this.view[2]},configurable:!0}),Object.defineProperty(R,"originalHeight",{get(){return this.view[3]},configurable:!0}),R}function GI(R,N){switch(N.type){case"RESOLVE":return{value:N.value,error:void 0};case"REJECT":return{value:!1,error:N.error};case"RESET":return{value:void 0,error:void 0};default:return R}}function Ka(){return(0,dK.useReducer)(GI,{value:void 0,error:void 0})}var Hv=function(R,N){var W={};for(var j in R)Object.prototype.hasOwnProperty.call(R,j)&&0>N.indexOf(j)&&(W[j]=R[j]);if(null!=R&&"function"==typeof Object.getOwnPropertySymbols)for(var B=0,j=Object.getOwnPropertySymbols(R);B<j.length;B++)0>N.indexOf(j[B])&&Object.prototype.propertyIsEnumerable.call(R,j[B])&&(W[j[B]]=R[j[B]]);return W};let{PDFDataRangeTransport:yA}=yr,qI=(R,N)=>{switch(N){case yf.NEED_PASSWORD:{let N=prompt("Enter the password to open this PDF file.");R(N);break}case yf.INCORRECT_PASSWORD:{let N=prompt("Invalid password. Please try again.");R(N)}}};
232function jv(R){return"object"==typeof R&&null!==R&&("data"in R||"range"in R||"url"in R)}let y_=(0,dK.forwardRef)(function(R,N){var{children:W,className:j,error:B="Failed to load PDF file.",externalLinkRel:z,externalLinkTarget:U,file:V,inputRef:G,imageResourcesPath:Y,loading:Z="Loading PDFâ¦",noData:te="No PDF file specified.",onItemClick:tn,onLoadError:tr,onLoadProgress:ts,onLoadSuccess:ta,onPassword:th=qI,onSourceError:tc,onSourceSuccess:tu,options:tp,renderMode:tf,rotate:tg}=R,tm=Hv(R,["children","className","error","externalLinkRel","externalLinkTarget","file","inputRef","imageResourcesPath","loading","noData","onItemClick","onLoadError","onLoadProgress","onLoadSuccess","onPassword","onSourceError","onSourceSuccess","options","renderMode","rotate"]);let[tw,ty]=Ka(),{value:tA,error:tx}=tw,[t_,tS]=Ka(),{value:tE,error:tk}=t_,tC=(0,dK.useRef)(new DI),tM=(0,dK.useRef)([]),tT=(0,dK.useRef)(void 0),tR=(0,dK.useRef)(void 0);V&&V!==tT.current&&jv(V)&&(yc(!xo(V,tT.current),'File prop passed to <Document /> changed, but it\'s equal to previous one. This might result in unnecessary reloads. Consider memoizing the value passed to "file" prop.'),tT.current=V),tp&&tp!==tR.current&&(yc(!xo(tp,tR.current),'Options prop passed to <Document /> changed, but it\'s equal to previous one. This might result in unnecessary reloads. Consider memoizing the value passed to "options" prop.'),tR.current=tp);let tP=(0,dK.useRef)({scrollPageIntoView:R=>{let{dest:N,pageNumber:W,pageIndex:j=W-1}=R;if(tn){tn({dest:N,pageIndex:j,pageNumber:W});return}let B=tM.current[j];if(B){B.scrollIntoView();return}yc(!1,`An internal link leading to page ${W} was clicked, but neither <Document> was provided with onItemClick nor it was able to find the page within itself. Either provide onItemClick to <Document> and handle navigating by yourself or ensure that all pages are rendered within <Document>.`)}});(0,dK.useImperativeHandle)(N,()=>({linkService:tC,pages:tM,viewer:tP}),[]),(0,dK.useEffect)(function(){ty({type:"RESET"})},[V,ty]);let tI=(0,dK.useCallback)(()=>{var R,N,W,j;return R=this,N=void 0,W=void 0,j=function*(){if(!V)return null;if("string"==typeof V)return Um(V)?{data:$v(V)}:(Uv(),{url:V});if(V instanceof yA)return{range:V};if(V instanceof ArrayBuffer)return{data:V};if(yg&&($t(yg,"isBlob can only be used in a browser environment"),V instanceof Blob))return{data:yield new Promise((R,N)=>{let W=new FileReader;W.onload=()=>{if(!W.result)return N(Error("Error while reading a file."));R(W.result)},W.onerror=R=>{if(!R.target)return N(Error("Error while reading a file."));let{error:W}=R.target;if(!W)return N(Error("Error while reading a file."));switch(W.code){case W.NOT_FOUND_ERR:return N(Error("Error while reading a file: File not found."));case W.SECURITY_ERR:return N(Error("Error while reading a file: Security error."));case W.ABORT_ERR:return N(Error("Error while reading a file: Aborted."));default:return N(Error("Error while reading a file."))}},W.readAsArrayBuffer(V)})};if($t("object"==typeof V,"Invalid parameter in file, need either Uint8Array, string or a parameter object"),$t(jv(V),"Invalid parameter object: need either .data, .range or .url"),"url"in V&&"string"==typeof V.url){if(Um(V.url)){let{url:R}=V,N=Hv(V,["url"]),W=$v(R);return Object.assign({data:W},N)}Uv()}return V},new(W||(W=Promise))(function(B,z){function l(R){try{d(j.next(R))}catch(R){z(R)}}function c(R){try{d(j.throw(R))}catch(R){z(R)}}function d(R){var N;R.done?B(R.value):((N=R.value)instanceof W?N:new W(function(R){R(N)})).then(l,c)}d((j=j.apply(R,N||[])).next())})},[V]);function J(R,N){tM.current[R]=N}function ht(R){delete tM.current[R]}(0,dK.useEffect)(()=>{let R=nd(tI());return R.promise.then(R=>{ty({type:"RESOLVE",value:R})}).catch(R=>{ty({type:"REJECT",error:R})}),()=>{io(R)}},[tI,ty]),(0,dK.useEffect)(()=>{if(!(typeof tA>"u")){if(!1===tA){tx&&(yc(!1,tx.toString()),tc&&tc(tx));return}tu&&tu()}},[tA]),(0,dK.useEffect)(function(){tS({type:"RESET"})},[tS,tA]),(0,dK.useEffect)(function(){if(!tA)return;let R=Object.assign(Object.assign({},tA),tp),N=w0(R);return ts&&(N.onProgress=ts),th&&(N.onPassword=th),N.promise.then(R=>{tS({type:"RESOLVE",value:R})}).catch(R=>{N.destroyed||tS({type:"REJECT",error:R})}),()=>{N.destroy()}},[tp,tS,tA]),(0,dK.useEffect)(()=>
232{if(!(typeof tE>"u")){if(!1===tE){tk&&(yc(!1,tk.toString()),tr&&tr(tk));return}tE&&(ta&&ta(tE),tM.current=Array(tE.numPages),tC.current.setDocument(tE))}},[tE]),(0,dK.useEffect)(function(){tC.current.setViewer(tP.current),tC.current.setExternalLinkRel(z),tC.current.setExternalLinkTarget(U)},[z,U]);let tD=(0,dK.useMemo)(()=>({imageResourcesPath:Y,linkService:tC.current,onItemClick:tn,pdf:tE,registerPage:J,renderMode:tf,rotate:tg,unregisterPage:ht}),[Y,tn,tE,tf,tg]),tN=(0,dK.useMemo)(()=>v1(tm,()=>tE),[tm,tE]);return(0,dY.jsx)("div",Object.assign({className:yp("react-pdf__Document",j),ref:G,style:{"--scale-factor":"1"}},tN,{children:V?null==tE?(0,dY.jsx)(Co,{type:"loading",children:"function"==typeof Z?Z():Z}):!1===tE?(0,dY.jsx)(Co,{type:"error",children:"function"==typeof B?B():B}):(0,dY.jsx)(yu.Provider,{value:tD,children:W}):(0,dY.jsx)(Co,{type:"no-data",children:"function"==typeof te?te():te})}))});function _1(){return(0,dK.useContext)(yu)}function S1(){for(var R=[],N=0;N<arguments.length;N++)R[N]=arguments[N];var W=R.filter(Boolean);return W.length<=1?W[0]||null:function(R){W.forEach(function(N){"function"==typeof N?N(R):N&&(N.current=R)})}}let yS=(0,dK.createContext)(null),yE={Document:null,DocumentFragment:null,Part:"group",Sect:"group",Div:"group",Aside:"note",NonStruct:"none",P:null,H:"heading",Title:null,FENote:"note",Sub:"group",Lbl:null,Span:null,Em:null,Strong:null,Link:"link",Annot:"note",Form:"form",Ruby:null,RB:null,RT:null,RP:null,Warichu:null,WT:null,WP:null,L:"list",LI:"listitem",LBody:null,Table:"table",TR:"row",TH:"columnheader",TD:"cell",THead:"columnheader",TBody:null,TFoot:null,Caption:null,Figure:"figure",Formula:null,Artifact:null},yC=/^H(\d+)$/;function wp(R){return"children"in R}function T1(R){return!!wp(R)&&1===R.children.length&&0 in R.children&&"id"in R.children[0]}function R1({className:R,node:N}){let W=(0,dK.useMemo)(()=>N?Object.assign(Object.assign({},function(R){let N={};if(wp(R)){let{role:W}=R,j=W.match(yC);if(j)N.role="heading",N["aria-level"]=Number(j[1]);else if(W in yE){let R=yE[W];R&&(N.role=R)}}return N}(N)),function P1(R){let N={};if(wp(R)){if(void 0!==R.alt&&(N["aria-label"]=R.alt),void 0!==R.lang&&(N.lang=R.lang),T1(R)){let[W]=R.children;if(W){let R=P1(W);return Object.assign(Object.assign({},N),R)}}}else"id"in R&&(N["aria-owns"]=R.id);return N}(N)):null,[N]),j=(0,dK.useMemo)(()=>!wp(N)||T1(N)?null:N.children.map((R,N)=>(0,dY.jsx)(R1,{node:R},N)),[N]);return(0,dY.jsx)("span",Object.assign({className:R},W,{children:j}))}function Ap(){return(0,dK.useContext)(yS)}function QI(){let R=Ap();$t(R,"Unable to find Page context.");let{onGetStructTreeError:N,onGetStructTreeSuccess:W}=R,[j,B]=Ka(),{value:z,error:U}=j,{customTextRenderer:V,page:G}=R;return(0,dK.useEffect)(function(){B({type:"RESET"})},[B,G]),(0,dK.useEffect)(function(){if(V||!G)return;let R=nd(G.getStructTree());return R.promise.then(R=>{B({type:"RESOLVE",value:R})}).catch(R=>{B({type:"REJECT",error:R})}),()=>io(R)},[V,G,B]),(0,dK.useEffect)(()=>{if(void 0!==z){if(!1===z){U&&(yc(!1,U.toString()),N&&N(U));return}z&&W&&W(z)}},[z]),z?(0,dY.jsx)(R1,{className:"react-pdf__Page__structTree structTree",node:z}):null}function t2(R){let N=Ap();$t(N,"Unable to find Page context.");let W=Object.assign(Object.assign({},N),R),{_className:j,canvasBackground:B,devicePixelRatio:z=yg&&window.devicePixelRatio||1,onRenderError:U,onRenderSuccess:V,page:G,renderForms:Y,renderTextLayer:Z,rotate:te,scale:tn}=W,{canvasRef:tr}=R;$t(G,"Attempted to render page canvas, but no page was specified.");let ts=(0,dK.useRef)(null);function x(R){"RenderingCancelledException"===R.name||(yc(!1,R.toString()),U&&U(R))}let ta=(0,dK.useMemo)(()=>G.getViewport({scale:tn*z,rotation:te}),[z,G,te,tn]),th=(0,dK.useMemo)(()=>G.getViewport({scale:tn,rotation:te}),[G,te,tn]);(0,dK.useEffect)(function(){if(!G)return;G.cleanup();let{current:R}=ts;if(!R)return;R.width=ta.width,R.height=ta.height,R.style.width=`${Math.floor(th.width)}px`,R.style.height=`${Math.floor(th.height)}px`,R.style.visibility="hidden";let N={annotationMode:Y?wE.ENABLE_FORMS:wE.ENABLE,canvasContext:R.getContext("2d",{alpha:!1}),viewport:ta};B&&(N.background=B);let W=G.render(N);return W.promise.then(()=>{R.style.visibility="",G&&V&&V(Hm(G,tn))}).catch(x),()=>io(W)},[B,ts,z,G,Y,ta,th]);let tc=(0,dK.useCallback)(()=>{let{current:R}=ts;R&&(R.width=0,R.height=0)},[ts]);return(0,dK.useEffect)(()=>tc,[tc]),(0,dY.jsx)("canvas",{className:`${j}__canvas`,dir:"ltr",ref:S1(tr,ts),style:{display:"block",userSelect:"none"},children:Z?(0,dY.jsx)(QI,{}):null})}function n2(){let R=Ap();$t(R,"Unable to find Page context.");let{customTextRenderer:N,onGetTextError:W,onGetTextSuccess:j,onRenderTextLayerError:B,onRenderTextLayerSuccess:z,page:U,pageIndex:V,pageNumber:G,rotate:Y,scale:Z}=R;$t(U,"Attempted to load page text content, but no page was specified.");let[te,tn]=Ka(),{value:tr,error:ts}=te,ta=(0,dK.useRef)(null),th=(0,dK.useRef)(void 0);yc(1===parseInt(window.getComputedStyle(document.body).getPropertyValue("--react-pdf-text-layer"),10),"TextLayer styles not found. Read more: https://github.com/wojtekmaj/react-pdf#support-for-text-layer"),(0,dK.useEffect)(function(){tn({type:"RESET"})},[U,tn]),(0,dK.useEffect)(function(){if(!U)return;let R=nd(U.getTextContent());return R.promise.then(R=>{tn({type:"RESOLVE",value:R})}).catch(R=>{tn({type:"REJECT",error:R})}),()=>io(R)},[U,tn]),(0,dK.useEffect)(()=>
232{if(void 0!==tr){if(!1===tr){ts&&(yc(!1,ts.toString()),W&&W(ts));return}tr&&j&&j(tr)}},[tr]);let tc=(0,dK.useCallback)(()=>{z&&z()},[z]),tu=(0,dK.useCallback)(R=>{yc(!1,R.toString()),B&&B(R)},[B]),tp=(0,dK.useMemo)(()=>U.getViewport({scale:Z,rotation:Y}),[U,Y,Z]);return(0,dK.useLayoutEffect)(function(){if(!U||!tr)return;let{current:R}=ta;if(!R)return;R.innerHTML="";let W=U.streamTextContent({includeMarkedContent:!0}),j=new wG({container:R,textContentSource:W,viewport:tp});return j.render().then(()=>{let W=document.createElement("div");W.className="endOfContent",R.append(W),th.current=W;let j=R.querySelectorAll('[role="presentation"]');if(N){let R=0;tr.items.forEach((W,B)=>{if(!("str"in W))return;let z=j[R];if(!z)return;let U=N(Object.assign({pageIndex:V,pageNumber:G,itemIndex:B},W));z.innerHTML=U,R+=W.str&&W.hasEOL?2:1})}tc()}).catch(tu),()=>io(j)},[N,tu,tc,U,V,G,tr,tp]),(0,dY.jsx)("div",{className:yp("react-pdf__Page__textContent","textLayer"),onMouseUp:function(){let R=th.current;R&&R.classList.remove("active")},onMouseDown:function(){let R=th.current;R&&R.classList.add("active")},ref:ta})}function i2(){let R=_1(),N=Ap();$t(N,"Unable to find Page context.");let W=Object.assign(Object.assign({},R),N),{imageResourcesPath:j,linkService:B,onGetAnnotationsError:z,onGetAnnotationsSuccess:U,onRenderAnnotationLayerError:V,onRenderAnnotationLayerSuccess:G,page:Y,pdf:Z,renderForms:te,rotate:tn,scale:tr=1}=W;$t(Z,"Attempted to load page annotations, but no document was specified. Wrap <Page /> in a <Document /> or pass explicit `pdf` prop."),$t(Y,"Attempted to load page annotations, but no page was specified."),$t(B,"Attempted to load page annotations, but no linkService was specified.");let[ts,ta]=Ka(),{value:th,error:tc}=ts,tu=(0,dK.useRef)(null);yc(1===parseInt(window.getComputedStyle(document.body).getPropertyValue("--react-pdf-annotation-layer"),10),"AnnotationLayer styles not found. Read more: https://github.com/wojtekmaj/react-pdf#support-for-annotations"),(0,dK.useEffect)(function(){ta({type:"RESET"})},[ta,Y]),(0,dK.useEffect)(function(){if(!Y)return;let R=nd(Y.getAnnotations());return R.promise.then(R=>{ta({type:"RESOLVE",value:R})}).catch(R=>{ta({type:"REJECT",error:R})}),()=>{io(R)}},[ta,Y,te]),(0,dK.useEffect)(()=>{if(void 0!==th){if(!1===th){tc&&(yc(!1,tc.toString()),z&&z(tc));return}th&&U&&U(th)}},[th]);let tp=(0,dK.useMemo)(()=>Y.getViewport({scale:tr,rotation:tn}),[Y,tn,tr]);return(0,dK.useEffect)(function(){if(!Z||!Y||!B||!th)return;let{current:R}=tu;if(!R)return;let N=tp.clone({dontFlip:!0}),W={annotations:th,annotationStorage:Z.annotationStorage,div:R,imageResourcesPath:j,linkService:B,page:Y,renderForms:te,viewport:N};R.innerHTML="";try{new wS({accessibilityManager:null,annotationCanvasMap:null,annotationEditorUIManager:null,div:R,l10n:null,page:Y,viewport:N}).render(W),G&&G()}catch(R){yc(!1,`${R}`),V&&V(R)}return()=>{}},[th,j,B,Y,te,tp]),(0,dY.jsx)("div",{className:yp("react-pdf__Page__annotations","annotationLayer"),ref:tu})}var r2=function(R,N){var W={};for(var j in R)Object.prototype.hasOwnProperty.call(R,j)&&0>N.indexOf(j)&&(W[j]=R[j]);if(null!=R&&"function"==typeof Object.getOwnPropertySymbols)for(var B=0,j=Object.getOwnPropertySymbols(R);B<j.length;B++)0>N.indexOf(j[B])&&Object.prototype.propertyIsEnumerable.call(R,j[B])&&(W[j[B]]=R[j[B]]);return W};function s2(R){let N=_1(),W=Object.assign(Object.assign({},N),R),{_className:j="react-pdf__Page",_enableRegisterUnregisterPage:B=!0,canvasBackground:z,canvasRef:U,children:V,className:G,customRenderer:Y,customTextRenderer:Z,devicePixelRatio:te,error:tn="Failed to load the page.",height:tr,inputRef:ts,loading:ta="Loading pageâ¦",noData:th="No page specified.",onGetAnnotationsError:tc,onGetAnnotationsSuccess:tu,onGetStructTreeError:tp,onGetStructTreeSuccess:tf,onGetTextError:tg,onGetTextSuccess:tm,onLoadError:tw,onLoadSuccess:ty,onRenderAnnotationLayerError:tA,onRenderAnnotationLayerSuccess:tx,onRenderError:t_,onRenderSuccess:tS,onRenderTextLayerError:tE,onRenderTextLayerSuccess:tk,pageIndex:tC,pageNumber:tM,pdf:tT,registerPage:tR,renderAnnotationLayer:tP=!0,renderForms:tI=!1,renderMode:tD="canvas",renderTextLayer:tN=!0,rotate:tO,scale:tF=1,unregisterPage:tW,width:tj}=W,tB=r2(W,["_className","_enableRegisterUnregisterPage","canvasBackgroun
232d","canvasRef","children","className","customRenderer","customTextRenderer","devicePixelRatio","error","height","inputRef","loading","noData","onGetAnnotationsError","onGetAnnotationsSuccess","onGetStructTreeError","onGetStructTreeSuccess","onGetTextError","onGetTextSuccess","onLoadError","onLoadSuccess","onRenderAnnotationLayerError","onRenderAnnotationLayerSuccess","onRenderError","onRenderSuccess","onRenderTextLayerError","onRenderTextLayerSuccess","pageIndex","pageNumber","pdf","registerPage","renderAnnotationLayer","renderForms","renderMode","renderTextLayer","rotate","scale","unregisterPage","width"]),[t$,tz]=Ka(),{value:tH,error:tU}=t$,tV=(0,dK.useRef)(null);$t(tT,"Attempted to load a page, but no document was specified. Wrap <Page /> in a <Document /> or pass explicit `pdf` prop.");let tG=Lr(tM)?tM-1:tC??null,tq=tM??(Lr(tC)?tC+1:null),tX=tO??(tH?tH.rotate:null),tY=(0,dK.useMemo)(()=>{if(!tH)return null;let R=1,N=tF??1;if(tj||tr){let N=tH.getViewport({scale:1,rotation:tX});tj?R=tj/N.width:tr&&(R=tr/N.height)}return N*R},[tr,tH,tX,tF,tj]);(0,dK.useEffect)(function(){return()=>{Lr(tG)&&B&&tW&&tW(tG)}},[B,tT,tG,tW]),(0,dK.useEffect)(function(){tz({type:"RESET"})},[tz,tT,tG]),(0,dK.useEffect)(function(){if(!tT||!tq)return;let R=nd(tT.getPage(tq));return R.promise.then(R=>{tz({type:"RESOLVE",value:R})}).catch(R=>{tz({type:"REJECT",error:R})}),()=>io(R)},[tz,tT,tG,tq,tR]),(0,dK.useEffect)(()=>{if(void 0!==tH){if(!1===tH){tU&&(yc(!1,tU.toString()),tw&&tw(tU));return}(function(){if(ty){if(!tH||!tY)return;ty(Hm(tH,tY))}if(B&&tR){if(!Lr(tG)||!tV.current)return;tR(tG,tV.current)}})()}},[tH,tY]);let tK=(0,dK.useMemo)(()=>tH&&Lr(tG)&&tq&&Lr(tX)&&Lr(tY)?{_className:j,canvasBackground:z,customTextRenderer:Z,devicePixelRatio:te,onGetAnnotationsError:tc,onGetAnnotationsSuccess:tu,onGetStructTreeError:tp,onGetStructTreeSuccess:tf,onGetTextError:tg,onGetTextSuccess:tm,onRenderAnnotationLayerError:tA,onRenderAnnotationLayerSuccess:tx,onRenderError:t_,onRenderSuccess:tS,onRenderTextLayerError:tE,onRenderTextLayerSuccess:tk,page:tH,pageIndex:tG,pageNumber:tq,renderForms:tI,renderTextLayer:tN,rotate:tX,scale:tY}:null,[j,z,Z,te,tc,tu,tp,tf,tg,tm,tA,tx,t_,tS,tE,tk,tH,tG,tq,tI,tN,tX,tY]),tQ=(0,dK.useMemo)(()=>v1(tB,()=>tH&&(tY?Hm(tH,tY):void 0)),[tB,tH,tY]),tJ=`${tG}@${tY}/${tX}`;return(0,dY.jsx)("div",Object.assign({className:yp(j,G),"data-page-number":tq,ref:S1(ts,tV),style:{"--scale-factor":`${tY}`,backgroundColor:z||"white",position:"relative",minWidth:"min-content",minHeight:"min-content"}},tQ,{children:tq?null===tT||null==tH?(0,dY.jsx)(Co,{type:"loading",children:"function"==typeof ta?ta():ta}):!1===tT||!1===tH?(0,dY.jsx)(Co,{type:"error",children:"function"==typeof tn?tn():tn}):(0,dY.jsxs)(yS.Provider,{value:tK,children:[function(){switch(tD){case"custom":return $t(Y,'renderMode was set to "custom", but no customRenderer was passed.'),(0,dY.jsx)(Y,{},`${tJ}_custom`);case"none":return null;default:return(0,dY.jsx)(t2,{canvasRef:U},`${tJ}_canvas`)}}(),tN?(0,dY.jsx)(n2,{},`${tJ}_text`):null,tP?(0,dY.jsx)(i2,{},`${tJ}_annotations`):null,V]}):(0,dY.jsx)(Co,{type:"no-data",children:"function"==typeof th?th():th})}))}yc(!ym,`Loading PDF.js worker may not work on protocols other than HTTP/HTTPS. ${yv}`),wI.workerSrc="pdf.worker.mjs";let yM="SET_ZOOM_LEVEL",eg=R=>({type:yM,value:R}),yT="SET_PDF_PAGINATED",o2=R=>({type:yT,value:R}),yR="SET_NUM_PAGES",Vv=R=>({type:yR,value:R}),yP="SET_CURRENT_PAGE",yI="SET_CURRENT_MAIN_STATE",Wv=R=>({type:yP,value:R}),yD={defaultZoomLevel:1,zoomLevel:1,zoomJump:.1,paginated:!0,numPages:0,currentPage:1},a2=(R=yD,N)=>{switch(N.type){case yM:{let{value:W}=N;return{...R,zoomLevel:W}}case yT:{let{value:W}=N;return{...R,paginated:W}}case yR:{let{value:W}=N;return{...R,numPages:W}}case yP:{let{value:W}=N;return{...R,currentPage:W}}case yI:{let{value:W}=N;return{...R,mainState:W}}default:return R}},yN=(0,dK.createContext)({state:yD,dispatch:()=>null}),l2=({children:R,mainState:N})=>{var W,j,B,z,U,V,G;let[Y,Z]=(0,dK.useReducer)(a2,{...yD,defaultZoomLevel:(null==(j=null==(W=N.config)?void 0:W.pdfZoom)?void 0:j.defaultZoom)??yD.defaultZoomLevel,zoomLevel:(null==(z=null==(B=N.config)?void 0:B.pdfZoom)?void 0:z.defaultZoom)??yD.zoomLevel,zoomJump:(null==(V=null==(U=N.config)?void 0:U.pdfZoom)?void 0:V.zoomJump)??yD.zoomJump,paginated:(null==(G=N.config)||!G.pdfVerticalScrollByDefault)&&yD.paginated,mainState:N});return(0,dK.useEffect)(()=>{Z({type:yI,value:N})},[N]),(0,dY.jsx)(yN.Provider,{value:{state:Y,dispatch:Z},children:R})},D1=({pageNum:R})=>{let{state:{mainState:N,paginated:W,zoomLevel:j,numPages:B,currentPage:z}}=(0,dK.useContext)(yN),{t:U}=oo(),V=(null==N?void 0:N.rendererRect)||null,G=R??z;return(0,dY.jsxs)(yO,{id:"pdf-page-wrapper",$lastPage:G>=B,children:[!W&&(0,dY.jsx)(yF,{id:"pdf-page-info",children:U("pdfPluginPageNumber",{currentPage:G,allPagesCount:B})}),(0,dY.jsx)(s2,{pageNumber:G||z,scale:j,height:((null==V?void 0:V.height)??100)-100,width:((null==V?void 0:V.width)??100)-100,loading:U("pdfPluginLoading")})]})},yO=rb.div` 233 margin: ${R=>R.$lastPage?"20px 0":void 0}; 234`,yF=rb.div` 235 padding: 0 0 10px 10px; 236 color: ${R=>R.theme.textTertiary}; 237 font-size: 14px; 238 text-align: left; 239 240 @media (max-width: 768px) { 241 font-size: 10px; 242 } 243`,d2=()=>{let{state:{numPages:R}}=(0,dK.useContext)(yN),N=[];for(let W=0;W<R;W++)N.push((0,dY.jsx)(D1,{pageNum:W+1},W+1));return(0,dY.jsx)(dY.Fragment,{children:N})},u2=()=>{let{state:{mainState:R,paginated:N},dispatch:W}=(0,dK.useContext)(yN),{t:j}=oo(),B=(null==R?void 0:R.currentDocument)||null;return(0,dK.useEffect)(()=>{W(Vv(yD.numPages))},[B]),B&&void 0!==B.fileData?(0,dY.jsx)(yW,{file:B.fileData,onLoadSuccess:({numPages:R})=>W(Vv(R)),loading:(0,dY.jsx)("span",{children:j("pdfPluginLoading")}),children:N?(0,dY.jsx)(D1,{}):(0,dY.jsx)(d2,{})}):null},yW=rb(y_)` 244 display: flex; 245 flex-direction: column; 246 margin: 0 auto; 247`,p2=R=>(0,dY.jsx)(O1,{...R,reverse:!0}),g2=R=>(0,dY.jsx)(O1,{...R}),O1=R=>{let{color:N,size:W,reverse:j}=R;return(0,dY.jsx)("svg",{width:W||"100%",height:W||"100%",style:{transform:`${j?"rotate(180deg)":""}`},viewBox:"0 0 12 12",version:"1.1",children:(0,dY.jsx)("g",{id:"Icons",stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd",children:(0,dY.jsx)("g",{id:"Rounded",transform:"translate(-548.000000, -1000.000000)",children:(0,dY.jsx)("g",{id:"AV",transform:"translate(100.000000, 852.000000)",children:(0,dY.jsx)("g",{id:"-Round-/-AV-/-skip_next",transform:"translate(442.000000, 142.000000)",children:(0,dY.jsxs)("g",{children:[(0,dY.jsx)("rect",{id:"Rectangle-Copy-52",x:"0",y:"0",width:"24",height:"24"}),(0,dY.jsx)("path",{d:"M7.58,16.89 L13.35,12.82 C13.91,12.42 13.91,11.58 13.35,11.19 L7.58,7.11 C6.91,6.65 6,7.12 6,7.93 L6,16.07 C6,16.88 6.91,17.35 7.58,16.89 Z M16,7 L16,17 C16,17.55 16.45,
24718 17,18 C17.55,18 18,17.55 18,17 L18,7 C18,6.45 17.55,6 17,6 C16.45,6 16,6.45 16,7 Z",id:"icon_color",fill:N||"#aaa"})]})})})})})})},m2=R=>{let{color:N,size:W,reverse:j}=R;return(0,dY.jsxs)("svg",{width:W||"100%",height:W||"100%",style:{transform:`${j?"rotate(180deg)":""}`},id:"Layer_1",viewBox:"0 0 24 24",children:[(0,dY.jsx)("path",{d:"M20.57,9.43A8,8,0,0,0,5.26,10,5,5,0,1,0,5,20h5V18H5a3,3,0,0,1,0-6,3.1,3.1,0,0,1,.79.12l1.12.31.14-1.15a6,6,0,0,1,11.74-.82l.15.54.54.16A3.46,3.46,0,0,1,22,14.5,3.5,3.5,0,0,1,18.5,18H16v2h2.5A5.48,5.48,0,0,0,20.57,9.43Z",fill:N||"#aaa"}),(0,dY.jsx)("polygon",{points:"12 11 12 15.59 10.71 14.29 9.29 15.71 13 19.41 16.71 15.71 15.29 14.29 14 15.59 14 11 12 11",fill:N||"#aaa"})]})},v2=R=>(0,dY.jsx)(N1,{...R}),y2=R=>(0,dY.jsx)(N1,{...R,reverse:!0}),N1=R=>{let{color:N,size:W,reverse:j}=R;return(0,dY.jsx)("svg",{width:W||"100%",height:W||"100%",viewBox:"0 0 32 32",version:"1.1",children:(0,dY.jsx)("g",{id:"Page-1",stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd",children:(0,dY.jsx)("g",{id:"search-plus-icon",fill:N||"#aaa",children:(0,dY.jsx)("path",{id:"search-plus",d:j?"M 13 13 L 16 13 L 19 13 L 19 16 L 16 16 L 13 16 L 10 16 L 10 13 Z M 19.4271 21.4271 C 18.0372 22.4175 16.3367 23 14.5 23 C 9.8056 23 6 19.1944 6 14.5 C 6 9.8056 9.8056 6 14.5 6 C 19.1944 6 23 9.8056 23 14.5 C 23 16.3367 22.4175 18.0372 21.4271 19.4271 L 27.0119 25.0119 C 27.5621 25.5621 27.5575 26.4425 27.0117 26.9883 L 26.9883 27.0117 C 26.4439 27.5561 25.5576 27.5576 25.0119 27.0119 L 19.4271 21.4271 L 19.4271 21.4271 L 19.4271 21.4271 Z M 14.5 21 C 18.0899 21 21 18.0899 21 14.5 C 21 10.9101 18.0899 8 14.5 8 C 10.9101 8 8 10.9101 8 14.5 C 8 18.0899 10.9101 21 14.5 21 L 14.5 21 Z":"M 13 13 L 13 10 L 16 10 L 16 13 L 19 13 L 19 16 L 16 16 L 16 19 L 13 19 L 13 16 L 10 16 L 10 13 Z M 19.4271 21.4271 C 18.0372 22.4175 16.3367 23 14.5 23 C 9.8056 23 6 19.1944 6 14.5 C 6 9.8056 9.8056 6 14.5 6 C 19.1944 6 23 9.8056 23 14.5 C 23 16.3367 22.4175 18.0372 21.4271 19.4271 L 27.0119 25.0119 C 27.5621 25.5621 27.5575 26.4425 27.0117 26.9883 L 26.9883 27.0117 C 26.4439 27.5561 25.5576 27.5576 25.0119 27.0119 L 19.4271 21.4271 L 19.4271 21.4271 L 19.4271 21.4271 Z M 14.5 21 C 18.0899 21 21 18.0899 21 14.5 C 21 10.9101 18.0899 8 14.5 8 C 10.9101 8 8 10.9101 8 14.5 C 8 18.0899 10.9101 21 14.5 21 L 14.5 21 Z"})})})})},b2=R=>{let{color:N,size:W}=R;return(0,dY.jsx)("svg",{width:W||"100%",height:W||"100%",viewBox:"0 0 24 24",children:(0,dY.jsx)("path",{fill:N||"#aaa",d:"M9.29,13.29,4,18.59V17a1,1,0,0,0-2,0v4a1,1,0,0,0,.08.38,1,1,0,0,0,.54.54A1,1,0,0,0,3,22H7a1,1,0,0,0,0-2H5.41l5.3-5.29a1,1,0,0,0-1.42-1.42ZM5.41,4H7A1,1,0,0,0,7,2H3a1,1,0,0,0-.38.08,1,1,0,0,0-.54.54A1,1,0,0,0,2,3V7A1,1,0,0,0,4,7V5.41l5.29,5.3a1,1,0,0,0,1.42,0,1,1,0,0,0,0-1.42ZM21,16a1,1,0,0,0-1,1v1.59l-5.29-5.3a1,1,0,0,0-1.42,1.42L18.59,20H17a1,1,0,0,0,0,2h4a1,1,0,0,0,.38-.08,1,1,0,0,0,.54-.54A1,1,0,0,0,22,21V17A1,1,0,0,0,21,16Zm.92-13.38a1,1,0,0,0-.54-.54A1,1,0,0,0,21,2H17a1,1,0,0,0,0,2h1.59l-5.3,5.29a1,1,0,0,0,0,1.42,1,1,0,0,0,1.42,0L20,5.41V7a1,1,0,0,0,2,0V3A1,1,0,0,0,21.92,2.62Z"})})},w2=R=>{let{color:N,size:W,reverse:j}=R;return(0,dY.jsx)("svg",{width:W||"100%",height:W||"100%",style:{transform:`${j?"rotate(90deg)":""}`},version:"1.1",id:"Scroll_1",viewBox:"0 0 297 297",xmlSpace:"preserve",children:(0,dY.jsx)("path",{fill:N||"#aaa",d:`M206.004,200.723h-31.231V96.277h31.231c0.005,0,0.014,0,0.019,0c5.289,0,9.575-4.287,9.575-9.574 248 c0-2.342-0.841-4.488-2.236-6.151L156.168,3.851C154.36,1.428,151.515,0,148.492,0c-3.023,0-5.868,1.428-7.675,3.851L83.302,80.98 249 c-2.166,2.902-2.507,6.779-0.883,10.017c1.624,3.236,4.936,5.28,8.559,5.28h31.231v104.445H90.978c-3.623,0-6.934,2.044-8.559,5.28 250 c-1.624,3.237-1.283,7.114,0.883,10.017l57.513,77.129c1.808,2.424,4.652,3.852,7.675,3.852c3.023,0,5.868-1.428,7.676-3.852 251 l57.514-77.129c2.164-2.902,2.507-6.779,0.883-10.017C212.938,202.767,209.627,200.723,206.004,200.723z`})})},A2=()=>{let{state:{currentPage:R,numPages:N},dispatch:W}=(0,dK.useContext)(yN),{t:j}=oo();return(0,dY.jsxs)(yj,{id:"pdf-pagination",children:[(0,dY.jsx)(yB,{id:"pdf-pagination-prev",onClick:()=>W(Wv(R-1)),disabled:1===R,children:(0,dY.jsx)(p2,{color:"#000",size:"50%"})}),(0,dY.jsx)(yz,{id:"pdf-pagination-info",children:j("pdfPluginPageNumber",{currentPage:R,allPagesCount:N})}),(0,dY.jsx)(y$,{id:"pdf-pagination-next",onClick:()=>W(Wv(R+1)),disabled:R>=N,children:(0,dY.jsx)(g2,{color:"#000",size:"50%"})})]})},yj=rb.div` 252 display: flex; 253 align-items: center; 254`,yB=rb(g6)` 255 width: 30px; 256 height: 30px; 257 margin: 0 5px; 258 259 @media (max-width: 768px) { 260 width: 25px; 261 height: 25px; 262 } 263`,y$=rb(yB)` 264 margin: 0 20px 0 5px; 265`,yz=rb.div` 266 color: ${R=>R.theme.textPrimary}; 267 font-size: 14px; 268 text-align: left; 269 270 @media (max-width: 768px) { 271 font-size: 10px; 272 } 273`,x2=()=>{let{t:R}=oo(),{state:{mainState:N,paginated:W,zoomLevel:j,numPages:B,zoomJump:z,defaultZoomLevel:U},dispatch:V}=(0,dK.useContext)(yN),G=(null==N?void 0:N.currentDocument)||null;
273return(0,dY.jsxs)(yH,{id:"pdf-controls",children:[W&&B>1&&(0,dY.jsx)(A2,{}),(null==G?void 0:G.fileData)&&(0,dY.jsx)(yV,{id:"pdf-download",href:null==G?void 0:G.fileData,download:(null==G?void 0:G.fileName)||(null==G?void 0:G.uri),title:R("downloadButtonLabel"),children:(0,dY.jsx)(m2,{color:"#000",size:"75%"})}),(0,dY.jsx)(yU,{id:"pdf-zoom-out",onMouseDown:()=>V(eg(j-z)),children:(0,dY.jsx)(y2,{color:"#000",size:"80%"})}),(0,dY.jsx)(yU,{id:"pdf-zoom-in",onMouseDown:()=>V(eg(j+z)),children:(0,dY.jsx)(v2,{color:"#000",size:"80%"})}),(0,dY.jsx)(yU,{id:"pdf-zoom-reset",onMouseDown:()=>V(eg(U)),disabled:j===U,children:(0,dY.jsx)(b2,{color:"#000",size:"70%"})}),B>1&&(0,dY.jsx)(yU,{id:"pdf-toggle-pagination",onMouseDown:()=>V(o2(!W)),children:(0,dY.jsx)(w2,{color:"#000",size:"70%",reverse:W})})]})},yH=rb.div` 274 display: flex; 275 position: sticky; 276 top: 0; 277 left: 0; 278 z-index: 1; 279 justify-content: flex-end; 280 padding: 8px; 281 background-color: ${R=>R.theme.tertiary}; 282 box-shadow: 0px 2px 3px #00000033; 283 284 @media (max-width: 768px) { 285 padding: 6px; 286 } 287`,yU=rb(g6)` 288 width: 30px; 289 height: 30px; 290 @media (max-width: 768px) { 291 width: 25px; 292 height: 25px; 293 } 294`,yV=rb(g8)` 295 width: 30px; 296 height: 30px; 297 @media (max-width: 768px) { 298 width: 25px; 299 height: 25px; 300 } 301`;wI.workerSrc=new URL(`https://unpkg.com/pdfjs-dist@${yn}/build/pdf.worker.min.mjs`).toString();let A0=({mainState:R})=>(0,dY.jsx)(l2,{mainState:R,children:(0,dY.jsxs)(yG,{id:"pdf-renderer","data-testid":"pdf-renderer",children:[(0,dY.jsx)(x2,{}),(0,dY.jsx)(u2,{})]})});A0.fileTypes=["pdf","application/pdf"],A0.weight=0;let yG=rb.div` 302 display: flex; 303 flex-direction: column; 304 flex: 1; 305 306 /* width */ 307 &::-webkit-scrollbar {
308 ${R=>R.theme.disableThemeScrollbar?"":"width: 10px"}; 309 } 310 /* Track */ 311 &::-webkit-scrollbar-track { 312 /* background: ${R=>R.theme.secondary}; */ 313 } 314 /* Handle */ 315 &::-webkit-scrollbar-thumb { 316 background: ${R=>R.theme.tertiary}; 317 } 318 /* Handle on hover */ 319 &::-webkit-scrollbar-thumb:hover { 320 background: ${R=>R.theme.primary}; 321 } 322`,yq=rb(Vi)` 323 display: flex; 324 flex: 1; 325 align-items: center; 326 justify-content: center; 327 height: 100%; 328 background-color: white; 329 background-image: linear-gradient(45deg, #e0e0e0 25%, transparent 25%), 330 linear-gradient(-45deg, #e0e0e0 25%, transparent 25%), 331 linear-gradient(45deg, transparent 75%, #e0e0e0 75%), 332 linear-gradient(-45deg, transparent 75%, #e0e0e0 75%); 333 background-size: 20px 20px; 334 background-position: 335 0 0, 336 0 10px, 337 10px -10px, 338 -10px 0px; 339`,E0=R=>(0,dY.jsx)(yq,{...R});E0.fileTypes=["png","image/png"],E0.weight=0;let yX,yY,yK=[],k2=()=>{var R=ze(2,0);if(18761===R)yY=!0;else if(19789===R)yY=!1;else throw TypeError("Invalid byte order value.");return yY},L2=()=>{if(42!==ze(2,2))throw RangeError("You forgot your towel!");return!0},I2=R=>{var N={315:"Artist",258:"BitsPerSample",265:"CellLength",264:"CellWidth",320:"ColorMap",259:"Compression",33432:"Copyright",306:"DateTime",338:"ExtraSamples",266:"FillOrder",289:"FreeByteCounts",288:"FreeOffsets",291:"GrayResponseCurve",290:"GrayResponseUnit",316:"HostComputer",270:"ImageDescription",257:"ImageLength",256:"ImageWidth",271:"Make",281:"MaxSampleValue",280:"MinSampleValue",272:"Model",254:"NewSubfileType",274:"Orientation",262:"PhotometricInterpretation",284:"PlanarConfiguration",296:"ResolutionUnit",278:"RowsPerStrip",277:"SamplesPerPixel",305:"Software",279:"StripByteCounts",273:"StripOffsets",255:"SubfileType",263:"Threshholding",282:"XResolution",283:"YResolution",326:"BadFaxLines",327:"CleanFaxData",343:"ClipPath",328:"ConsecutiveBadFaxLines",433:"Decode",434:"DefaultImageColor",269:"DocumentName",336:"DotRange",321:"HalftoneHints",346:"Indexed",347:"JPEGTables",285:"PageName",297:"PageNumber",317:"Predictor",319:"PrimaryChromaticities",532:"ReferenceBlackWhite",339:"SampleFormat",559:"StripRowCounts",330:"SubIFDs",292:"T4Options",293:"T6Options",325:"TileByteCounts",323:"TileLength",324:"TileOffsets",322:"TileWidth",301:"TransferFunction",318:"WhitePoint",344:"XClipPathUnits",286:"XPosition",529:"YCbCrCoefficients",531:"YCbCrPositioning",530:"YCbCrSubSampling",345:"YClipPathUnits",287:"YPosition",37378:"ApertureValue",40961:"ColorSpace",36868:"DateTimeDigitized",36867:"DateTimeOriginal",34665:"Exif IFD",36864:"ExifVersion",33434:"ExposureTime",41728:"FileSource",37385:"Flash",40960:"FlashpixVersion",33437:"FNumber",42016:"ImageUniqueID",37384:"LightSource",37500:"MakerNote",37377:"ShutterSpeedValue",37510:"UserComment",33723:"IPTC",34675:"ICC Profile",700:"XMP",42112:"GDAL_METADATA",42113:"GDAL_NODATA",34377:"Photoshop"};return R in N?N[R]:"Tag"+R},F2=R=>{var N,W={1:"BYTE",2:"ASCII",3:"SHORT",4:"LONG",5:"RATIONAL",6:"SBYTE",7:"UNDEFINED",8:"SSHORT",9:"SLONG",10:"SRATIONAL",11:"FLOAT",12:"DOUBLE"};return R in W&&(N=W[R]),N},M2=R=>{var N;return -1!==["BYTE","ASCII","SBYTE","UNDEFINED"].indexOf(R)?N=1:-1!==["SHORT","SSHORT"].indexOf(R)?N=2:-1!==["LONG","SLONG","FLOAT"].indexOf(R)?N=4:-1!==["RATIONAL","SRATIONAL","DOUBLE"].indexOf(R)&&(N=8),N},D2=(R,N,W)=>{var j=N+Math.floor((W=W||0)/8),B=W+R;if(B<=0)throw RangeError("No bits requested");if(B<=8)var z=24+W,U=yX.getUint8(j,yY);else if(B<=16)var z=16+W,U=yX.getUint16(j,yY);else if(B<=32)var z=W,U=yX.getUint32(j,yY);else throw RangeError("Too many bits requested");return{bits:U<<z>>>32-R,byteOffset:j+Math.floor(B/8),bitOffset:B%8}},ze=(R,N)=>{if(R<=0)throw RangeError("No bytes requested");if(R<=1)return yX.getUint8(N,yY);if(R<=2)return yX.getUint16(N,yY);if(R<=3)return yX.getUint32(N,yY)>>>8;if(R<=4)return yX.getUint32(N,yY);throw RangeError("Too many bytes requested")},O2=(R,N,W,j)=>{var B=[],z=M2(N);if(z*W<=4){if(!1===yY)var U=j>>>(4-z)*8;else var U=j;B.push(U)}else for(var V=0;V<W;V++){var G=z*V;if(z>=8){if(-1!==["RATIONAL","SRATIONAL"].indexOf(N))B.push(ze(4,j+G)),B.push(ze(4,j+G+4));else throw TypeError("Can't handle this field type or size")}else B.push(ze(z,j+G))}return"ASCII"===N&&B.forEach(function(R,N,W){W[N]=String.fromCharCode(R)}),B},Ir=(R,N)=>{var W=Math.pow(2,8-N);return Math.floor(R*W+(W-1))},qv=(R,N,W,j)=>(typeof j>"u"&&(j=1),"rgba("+R+", "+N+", "+W+", "+j+")"),$1=R=>{for(var N=ze(2,R),W=[],j=R+2,B=0;B<N;j+=12,B++){var z=ze(2,j),U=ze(2,j+2),V=ze(4,j+4),G=ze(4,j+8),Y=I2(z),Z=F2(U),te=O2(Y,Z,V,G);W[Y]={type:Z,values:te}}yK.push(W);var tn=ze(4,j);return 0===tn?yK:$1(tn)},N2=(R,N)=>{let W=N||document.createElement("canvas");if(R&&(yX=new DataView(R),yY=k2(),L2())){var j=(yK=$1(ze(4,4)))[0],B=j.ImageWidth.values[0],z=j.ImageLength.values[0];W.width=B,W.height=z;var U=[],V=j.Compression?j.Compression.values[0]:1,G=j.SamplesPerPixel.values[0],Y=[],Z=0,te=!1;
339if(j.BitsPerSample.values.forEach(function(R,N,W){Y[N]={bitsPerSample:R,hasBytesPerSample:!1,bytesPerSample:void 0},R%8==0&&(Y[N].hasBytesPerSample=!0,Y[N].bytesPerSample=R/8),Z+=R},void 0),Z%8==0){te=!0;var tn=Z/8}var tr=j.StripOffsets.values,ts=tr.length;if(j.StripByteCounts)var ta=j.StripByteCounts.values;else if(1===ts)var ta=[Math.ceil(B*z*Z/8)];else throw Error("Cannot recover from missing StripByteCounts");for(var th=0;th<ts;th++){var tc=tr[th];U[th]=[];for(var tu=ta[th],tp=0,tf=0,tg=1,tm=!0,tw=[],ty=0,tA=0,tx=0;tp<tu;tp+=tg)switch(V){case 1:for(var t_=0,tw=[];t_<G;t_++)if(Y[t_].hasBytesPerSample){var tS=Y[t_].bytesPerSample*t_;tw.push(ze(Y[t_].bytesPerSample,tc+tp+tS))}else{var tE=D2(Y[t_].bitsPerSample,tc+tp,tf);throw tw.push(tE.bits),tp=tE.byteOffset-tc,tf=tE.bitOffset,RangeError("Cannot handle sub-byte bits per sample")}if(U[th].push(tw),te)tg=tn;else throw tg=0,RangeError("Cannot handle sub-byte bits per pixel");break;case 2:case 3:case 4:case 5:case 6:case 7:break;case 32773:if(tm){tm=!1;var tk=1,tC=1,tM=yX.getInt8(tc+tp,yY);tM>=0&&tM<=127?tk=tM+1:tM>=-127&&tM<=-1?tC=-tM+1:tm=!0}else{for(var tT=ze(1,tc+tp),t_=0;t_<tC;t_++){if(Y[tA].hasBytesPerSample)tx=tx<<8*ty|tT,++ty===Y[tA].bytesPerSample&&(tw.push(tx),tx=ty=0,tA++);else throw RangeError("Cannot handle sub-byte bits per sample");tA===G&&(U[th].push(tw),tw=[],tA=0)}0==--tk&&(tm=!0)}tg=1}}if(W.getContext){var tR=W.getContext("2d");if(tR.fillStyle=qv(255,255,255,0),j.RowsPerStrip)var tP=j.RowsPerStrip.values[0];else var tP=z;var tI=U.length,tD=z%tP,tN=0===tD?tP:tD,tO=tP,tF=0,tW=j.PhotometricInterpretation.values[0],tj=[],tB=0;if(j.ExtraSamples&&(tB=(tj=j.ExtraSamples.values).length),j.ColorMap)var t$=j.ColorMap.values,tz=Math.pow(2,Y[0].bitsPerSample);for(var th=0;th<tI;th++){th+1===tI&&(tO=tN);for(var tH=U[th].length,tU=tF*th,tV=0,tG=0;tG<tH;tV++)for(var tq=0;tq<B;tq++,tG++){var tX=U[th][tG],tY=0,tK=0,tQ=0,tJ=1;if(tB>0){for(var tZ=0;tZ<tB;tZ++)if(1===tj[tZ]||2===tj[tZ]){tJ=tX[3+tZ]/256;break}}switch(tW){case 0:if(Y[0].hasBytesPerSample)var t0=Math.pow(16,2*Y[0].bytesPerSample);tX.forEach(function(R,N,W){W[N]=t0-R});case 1:tY=tK=tQ=Ir(tX[0],Y[0].bitsPerSample);break;case 2:tY=Ir(tX[0],Y[0].bitsPerSample),tK=Ir(tX[1],Y[1].bitsPerSample),tQ=Ir(tX[2],Y[2].bitsPerSample);break;case 3:if(void 0===t$)throw Error("Palette image missing color map");var t1=tX[0];tY=Ir(t$[t1],16),tK=Ir(t$[tz+t1],16),tQ=Ir(t$[2*tz+t1],16);break;case 4:throw RangeError("Not Yet Implemented: Transparency mask");case 5:throw RangeError("Not Yet Implemented: CMYK");case 6:throw RangeError("Not Yet Implemented: YCbCr");case 8:throw RangeError("Not Yet Implemented: CIELab");default:throw RangeError("Unknown Photometric Interpretation:",tW)}tR.fillStyle=qv(tY,tK,tQ,tJ),tR.fillRect(tq,tU+tV,1,1)}tF=tO}}return W}},Ep=R=>{let{mainState:{currentDocument:N}}=R,{t:W}=oo(),[j,B]=(0,dK.useState)(!1),[z,U]=(0,dK.useState)(!1);return(0,dK.useEffect)(()=>{if(!N||j)return;let R=document.getElementById("tiff-img");try{R&&N2(N.fileData,R),B(!0)}catch{U(!0)}},[N,j]),z?(0,dY.jsx)(Vi,{...R,children:(0,dY.jsx)("div",{children:W("brokenFile")})}):(0,dY.jsx)(Vi,{...R,children:(0,dY.jsx)(yQ,{id:"tiff-img"})})};Ep.fileTypes=["tif","tiff","image/tif","image/tiff"],Ep.weight=0,Ep.fileLoader=R=>ip({...R,readerTypeFunction:"arrayBuffer"});let yQ=rb.canvas` 340 max-width: 95%; 341 max-height: 95%; 342`,_p=({mainState:{currentDocument:R}})=>(0,dY.jsx)(yJ,{id:"txt-renderer",children:null==R?void 0:R.fileData});_p.fileTypes=["txt","text/plain"],_p.weight=0,_p.fileLoader=vb;let yJ=rb.div` 343 display: flex; 344 flex-direction: column; 345 width: 100%; 346 padding: 30px; 347`;var yZ={exports:{}};yZ.exports=function e(){var R="u">typeof self?self:"u">typeof window?window:void 0!==R?R:{},N=!R.document&&!!R.postMessage,W=R.IS_PAPA_WORKER||!1,j={},B=0,z={parse:function(N,W){var U,V=(W=W||{}).dynamicTyping||!1;if(M(V)&&(W.dynamicTypingFunction=V,V={}),W.dynamicTyping=V,W.transform=!!M(W.transform)&&W.transform,W.worker&&z.WORKERS_SUPPORTED){var G=function(){if(!z.WORKERS_SUPPORTED)return!1;var N,W,U=(N=R.URL||R.webkitURL||null,W=e.toString(),z.BLOB_URL||(z.BLOB_URL=N.createObjectURL(new Blob(["var global = (function() { if (typeof self !== 'undefined') { return self; } if (typeof window !== 'undefined') { return window; } if (typeof global !== 'undefined') { return global; } return {}; })(); global.IS_PAPA_WORKER=true; ","(",W,")();"],{type:"text/javascript"})))),V=new R.Worker(U);return V.onmessage=P,V.id=B++,j[V.id]=V}();return G.userStep=W.step,G.userChunk=W.chunk,G.userComplete=W.complete,G.userError=W.error,W.step=M(W.step),W.chunk=M(W.chunk),W.complete=M(W.complete),W.error=M(W.error),delete W.w
347orker,void G.postMessage({input:N,config:W,workerId:G.id})}var Y=null;return z.NODE_STREAM_INPUT,"string"==typeof N?(N=65279===(U=N).charCodeAt(0)?U.slice(1):U,Y=W.download?new f(W):new v(W)):!0===N.readable&&M(N.read)&&M(N.on)?Y=new y(W):(R.File&&N instanceof File||N instanceof Object)&&(Y=new g(W)),Y.stream(N)},unparse:function(R,N){var W=!1,j=!0,B=",",U=`\r 348`,V='"',G=V+V,Y=!1,Z=null,te=!1;!function(){if("object"==typeof N){if("string"!=typeof N.delimiter||z.BAD_DELIMITERS.filter(function(R){return -1!==N.delimiter.indexOf(R)}).length||(B=N.delimiter),("boolean"==typeof N.quotes||"function"==typeof N.quotes||Array.isArray(N.quotes))&&(W=N.quotes),"boolean"!=typeof N.skipEmptyLines&&"string"!=typeof N.skipEmptyLines||(Y=N.skipEmptyLines),"string"==typeof N.newline&&(U=N.newline),"string"==typeof N.quoteChar&&(V=N.quoteChar),"boolean"==typeof N.header&&(j=N.header),Array.isArray(N.columns)){if(0===N.columns.length)throw Error("Option columns is empty");Z=N.columns}void 0!==N.escapeChar&&(G=N.escapeChar+V),("boolean"==typeof N.escapeFormulae||N.escapeFormulae instanceof RegExp)&&(te=N.escapeFormulae instanceof RegExp?N.escapeFormulae:/^[=+\-@\t\r].*$/)}}();var tn=RegExp(x(V),"g");if("string"==typeof R&&(R=JSON.parse(R)),Array.isArray(R)){if(!R.length||Array.isArray(R[0]))return bt(null,R,Y);if("object"==typeof R[0])return bt(Z||Object.keys(R[0]),R,Y)}
vendor: 4,526 bytes, lines 348-349
348else if("object"==typeof R)return"string"==typeof R.data&&(R.data=JSON.parse(R.data)),Array.isArray(R.data)&&(R.fields||(R.fields=R.meta&&R.meta.fields||Z),R.fields||(R.fields=Array.isArray(R.data[0])?R.fields:"object"==typeof R.data[0]?Object.keys(R.data[0]):[]),Array.isArray(R.data[0])||"object"==typeof R.data[0]||(R.data=[R.data])),bt(R.fields||[],R.data||[],Y);throw Error("Unable to serialize unrecognized input");function bt(R,N,W){var z="";"string"==typeof R&&(R=JSON.parse(R)),"string"==typeof N&&(N=JSON.parse(N));var V=Array.isArray(R)&&0<R.length,G=!Array.isArray(N[0]);if(V&&j){for(var Y=0;Y<R.length;Y++)0<Y&&(z+=B),z+=ut(R[Y],Y);0<N.length&&(z+=U)}for(var Z=0;Z<N.length;Z++){var te=V?R.length:N[Z].length,tn=!1,tr=V?0===Object.keys(N[Z]).length:0===N[Z].length;if(W&&!V&&(tn="greedy"===W?""===N[Z].join("").trim():1===N[Z].length&&0===N[Z][0].length),"greedy"===W&&V){for(var ts=[],ta=0;ta<te;ta++){var th=G?R[ta]:ta;ts.push(N[Z][th])}tn=""===ts.join("").trim()}if(!tn){for(var tc=0;tc<te;tc++){0<tc&&!tr&&(z+=B);var tu=V&&G?R[tc]:tc;z+=ut(N[Z][tu],tc)}Z<N.length-1&&(!W||0<te&&!tr)&&(z+=U)}}return z}function ut(R,N){if(null==R)return"";if(R.constructor===Date)return JSON.stringify(R).slice(1,25);var j=!1;te&&"string"==typeof R&&te.test(R)&&(R="'"+R,j=!0);var U=R.toString().replace(tn,G);return(j=j||!0===W||"function"==typeof W&&W(R,N)||Array.isArray(W)&&W[N]||function(R,N){for(var W=0;W<N.length;W++)if(-1<R.indexOf(N[W]))return!0;return!1}(U,z.BAD_DELIMITERS)||-1<U.indexOf(B)||" "===U.charAt(0)||" "===U.charAt(U.length-1))?V+U+V:U}}};if(z.RECORD_SEP="\x1e",z.UNIT_SEP="\x1f",z.BYTE_ORDER_MARK="\uFEFF",z.BAD_DELIMITERS=["\r",` 349`,'"',z.BYTE_ORDER_MARK],z.WORKERS_SUPPORTED=!N&&!!R.Worker,z.NODE_STREAM_INPUT=1,z.LocalChunkSize=10485760,z.RemoteChunkSize=5242880,z.DefaultDelimiter=",",z.Parser=_,z.ParserHandle=E,z.NetworkStreamer=f,z.FileStreamer=g,z.StringStreamer=v,z.ReadableStreamStreamer=y,R.jQuery){var U=R.jQuery;U.fn.parse=function(N){var W=N.config||{},j=[];return this.each(function(N){if(!("INPUT"===U(this).prop("tagName").toUpperCase()&&"file"===U(this).attr("type").toLowerCase()&&R.FileReader)||!this.files||0===this.files.length)return!0;for(var B=0;B<this.files.length;B++)j.push({file:this.files[B],inputElem:this,instanceConfig:U.extend({},W)})}),D(),this;function D(){if(0!==j.length){var R,W,B,V=j[0];if(M(N.before)){var G=N.before(V.file,V.inputElem);if("object"==typeof G){if("abort"===G.action)return R=V.file,W=V.inputElem,B=G.reason,void(M(N.error)&&N.error({name:"AbortError"},R,W,B));if("skip"===G.action)return void H();"object"==typeof G.config&&(V.instanceConfig=U.extend(V.instanceConfig,G.config))}else if("skip"===G)return void H()}var Y=V.instanceConfig.complete;V.instanceConfig.complete=function(R){M(Y)&&Y(R,V.file,V.inputElem),H()},z.parse(V.file,V.instanceConfig)}else M(N.complete)&&N.complete()}function H(){j.splice(0,1),D()}}}function h(N){this._handle=null,this._finished=!1,this._completed=!1,this._halted=!1,this._input=null,this._baseIndex=0,this._partialLine="",this._rowCount=0,this._start=0,this._nextChunk=null,this.isFirstChunk=!0,this._completeResults={data:[],errors:[],meta:{}},(function(R){var N=F(R);N.chunkSize=parseInt(N.chunkSize),R.step||R.chunk||(N.chunkSize=null),this._handle=new E(N),(this._handle.streamer=this)._config=N}).call(this,N),this.parseChunk=function(N,j){if(this.isFirstChunk&&M(this._config.beforeFirstChunk)){var B=this._config.beforeFirstChunk(N);void 0!==B&&(N=B)}this.isFirstChunk=!1,this._halted=!1;var U=this._partialLine+N;this._partialLine="";var V=this._handle.parse(U,this._baseIndex,!this._finished);if(!this._handle.paused()&&!this._handle.aborted()){var G=V.meta.cursor;this._finished||(this._partialLine=U.substring(G-this._baseIndex),this._baseIndex=G),V&&V.data&&(this._rowCount+=V.data.length);var Y=this._finished||this._config.preview&&this._rowCount>=this._config.preview;if(W)R.postMessage({results:V,workerId:z.WORKER_ID,finished:Y});else if(M(this._config.chunk)&&!j){if(this._config.chunk(V,this._handle),this._handle.paused()||this._handle.aborted())return void(this._halted=!0);V=void 0,this._completeResults=void 0}return this._config.step||this._config.chunk||(this._completeResults.data=this._completeResults.data.concat(V.data),this._completeResults.errors=this._completeResults.errors.concat(V.errors),this._completeResults.meta=V.meta),this._completed||!Y||!M(this._config.complete)||V&&V.meta.aborted||(this._config.complete(this._completeResults,this._input),this._completed=!0),Y||V&&
349V.meta.paused||this._nextChunk(),V}this._halted=!0},this._sendError=function(N){M(this._config.error)?this._config.error(N):W&&this._config.error&&R.postMessage({workerId:z.WORKER_ID,error:N,finished:!1})}}function f(R){var W;(R=R||{}).chunkSize||(R.chunkSize=z.RemoteChunkSize),h.call(this,R),this._nextChunk=N?function(){this._readChunk(),this._chunkLoaded()}:function(){this._readChunk()},this.stream=function(R){this._input=R,this._nextChunk()},this._readChunk=function(){if(this._finished)this._chunkLoaded();else{if(W=new XMLHttpRequest,this._config.withCredentials&&(W.withCredentials=this._config.withCredentials),N||(W.onload=I(this._chunkLoaded,this),W.onerror=I(this._chunkError,this)),W.open(this._config.downloadRequestBody?"POST":"GET",this._input,!N),this._config.downloadRequestHeaders){var R=this._config.downloadRequestHeaders;for(var j in R)W.setRequestHeader(j,R[j])}if(this._config.chunkSize){var B=this._start+this._config.chunkSize-1;W.setRequestHeader("Range","bytes="+this._start+"-"+B)}try{W.send(this._config.downloadRequestBody)}catch(R){this._chunkError(R.message)}N&&0===W.status&&this._chunkError()}},this._chunkLoaded=function(){var R;4===W.readyState&&(W.status<200||400<=W.status?this._chunkError():(this._start+=this._config.chunkSize?this._config.chunkSize:W.responseText.length,this._finished=!this._config.chunkSize||this._start>=(null===(R=W.getResponseHeader("Content-Range"))?-1:parseInt(R.substring(R.lastIndexOf("/")+1))),this.parseChunk(W.responseText)))},this._chunkError=function(R){var N=W.statusText||R;this._sendError(Error(N))}}function g(R){(R=R||{}).chunkSize||(R.chunkSize=z.LocalChunkSize),h.call(this,R);var N,W,j="u">typeof FileReader;this.stream=function(R){this._input=R,W=R.slice||R.webkitSlice||R.mozSlice,j?((N=new FileReader).onload=I(this._chunkLoaded,this),N.onerror=I(this._chunkError,this)):N=new FileReaderSync,this._nextChunk()},this._nextChunk=function(){this._finished||this._config.preview&&!(this._rowCount<this._config.preview)||this._readChunk()},this._readChunk=function(){var R=this._input;if(this._config.chunkSize){var B=Math.min(this._start+this._config.chunkSize,this._input.size);R=W.call(R,this._start,B)}var z=N.readAsText(R,this._config.encoding);j||this._chunkLoaded({target:{result:z}})},this._chunkLoaded=function(R){this._start+=this._config.chunkSize,this._finished=!this._config.chunkSize||this._start>=this._input.size,this.parseChunk(R.target.result)},this._chunkError=function(){this._sendError(N.error)}}function v(R){var N;h.call(this,R=R||{}),this.stream=function(R){return N=R,this._nextChunk()},this._nextChunk=function(){if(!this._finished){var R,W=this._config.chunkSize;return W?(R=N.substring(0,W),N=N.substring(W)):(R=N,N=""),this._finished=!N,this.parseChunk(R)}}}function y(R){h.call(this,R=R||{});var N=[],W=!0,j=!1;this.pause=function(){h.prototype.pause.apply(this,arguments),this._input.pause()},this.resume=function(){h.prototype.resume.apply(this,arguments),this._input.resume()},this.stream=function(R){this._input=R,this._input.on("data",this._streamData),this._input.on("end",this._streamEnd),this._input.on("error",this._streamError)},this._checkIsFinished=function(){j&&1===N.length&&(this._finished=!0)},this._nextChunk=function(){this._checkIsFinished(),N.length?this.parseChunk(N.shift()):W=!0},this._streamData=I(function(R){try{N.push("string"==typeof R?R:R.toString(this._config.encoding)),W&&(W=!1,this._checkIsFinished(),this.parseChunk(N.shift()))}catch(R){this._streamError(R)}},this),this._streamError=I(function(R){this._streamCleanUp(),this._sendError(R)},this),this._streamEnd=I(function(){this._streamCleanUp(),j=!0,this._streamData("")},this),this._streamCleanUp=I(function(){this._input.removeListener("data",this._streamData),this._input.removeListener("end",this._streamEnd),this._input.removeListener("error",this._streamError)},this)}function E(R){var N,W,j,B=/^\s*-?(\d+\.?|\.\d+|\d+\.\d+)([eE][-+]?\d+)?\s*$/,U=/^((\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z)))$/,V=this,G=0,Y=0,Z=!1,te=!1,tn=[],tr={data:[],errors:[],meta:{}};if(M(R.step)){var ts=R.step;R.step=function(N){if(tr=N,lt())et();else{if(et(),0===tr.data.length)return;G+=N.data.length,R.preview&&G>R.preview?W.abort():(tr.data=tr.data[0],ts(tr,V))}}}function tt(N){return"greedy"===R.skipEmptyLines?""===N.join("").trim():1===N.length&&0===N[0].length}function et(){return tr&&j&&(gt("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+z.DefaultDelimiter+"'"),j=!1),R.skipEmptyLines&&(tr.data=tr.data.filter(function(R){return!tt(R)})),lt()&&function(){if(tr){if(Array.isArray(tr.data[0])){for(var N=0;lt()&&N<tr.data.length;
349N++)tr.data[N].forEach(q);tr.data.splice(0,1)}else tr.data.forEach(q)}function q(N,W){M(R.transformHeader)&&(N=R.transformHeader(N,W)),tn.push(N)}}(),function(){if(!tr||!R.header&&!R.dynamicTyping&&!R.transform)return tr;function q(N,W){var j,z=R.header?{}:[];for(j=0;j<N.length;j++){var V,G,Z=j,te=N[j];R.header&&(Z=j>=tn.length?"__parsed_extra":tn[j]),R.transform&&(te=R.transform(te,Z)),V=Z,G=te,R.dynamicTypingFunction&&void 0===R.dynamicTyping[V]&&(R.dynamicTyping[V]=R.dynamicTypingFunction(V)),te=(R.dynamicTyping[V]||R.dynamicTyping)===!0?"true"===G||"TRUE"===G||"false"!==G&&"FALSE"!==G&&(!function(R){if(B.test(R)){var N=parseFloat(R);if(-9007199254740992<N&&N<9007199254740992)return!0}return!1}(G)?U.test(G)?new Date(G):""===G?null:G:parseFloat(G)):G,"__parsed_extra"===Z?(z[Z]=z[Z]||[],z[Z].push(te)):z[Z]=te}return R.header&&(j>tn.length?gt("FieldMismatch","TooManyFields","Too many fields: expected "+tn.length+" fields but parsed "+j,Y+W):j<tn.length&>("FieldMismatch","TooFewFields","Too few fields: expected "+tn.length+" fields but parsed "+j,Y+W)),z}var N=1;return!tr.data.length||Array.isArray(tr.data[0])?(tr.data=tr.data.map(q),N=tr.data.length):tr.data=q(tr.data,0),R.header&&tr.meta&&(tr.meta.fields=tn),Y+=N,tr}()}function lt(){return R.header&&0===tn.length}function gt(R,N,W,j){var B={type:R,code:N,message:W};void 0!==j&&(B.row=j),tr.errors.push(B)}this.parse=function(B,U,V){var G=R.quoteChar||'"';if(R.newline||(R.newline=function(R,N){R=R.substring(0,1048576);var W=RegExp(x(N)+"([^]*?)"+x(N),"gm"),j=(R=R.replace(W,"")).split("\r"),B=R.split(` 350`),z=1<B.length&&B[0].length<j[0].length;if(1===j.length||z)return` 351`;for(var U=0,V=0;V<j.length;V++)j[V][0]===` 352`&&U++;return U>=j.length/2?`\r 353`:"\r"}(B,G)),j=!1,R.delimiter)M(R.delimiter)&&(R.delimiter=R.delimiter(B),tr.meta.delimiter=R.delimiter);else{var Y=function(N,W,j,B,U){var V,G,Y,Z;U=U||[","," ","|",";",z.RECORD_SEP,z.UNIT_SEP];for(var te=0;te<U.length;te++){var tn=U[te],tr=0,ts=0,ta=0;Y=void 0;for(var th=new _({comments:B,delimiter:tn,newline:W,preview:10}).parse(N),tc=0;tc<th.data.length;tc++)if(j&&tt(th.data[tc]))ta++;else{var tu=th.data[tc].length;ts+=tu,void 0!==Y?0<tu&&(tr+=Math.abs(tu-Y),Y=tu):Y=tu}0<th.data.length&&(ts/=th.data.length-ta),(void 0===G||tr<=G)&&(void 0===Z||Z<ts)&&1.99<ts&&(G=tr,V=tn,Z=ts)}return{successful:!!(R.delimiter=V),bestDelimiter:V}}(B,R.newline,R.skipEmptyLines,R.comments,R.delimitersToGuess);Y.successful?R.delimiter=Y.bestDelimiter:(j=!0,R.delimiter=z.DefaultDelimiter),tr.meta.delimiter=R.delimiter}var te=F(R);return R.preview&&R.header&&te.preview++,N=B,tr=(W=new _(te)).parse(N,U,V),et(),Z?{meta:{paused:!0}}:tr||{meta:{paused:!1}}},this.paused=function(){return Z},this.pause=function(){Z=!0,W.abort(),N=M(R.chunk)?"":N.substring(W.getCharIndex())},this.resume=function(){V.streamer._halted?(Z=!1,V.streamer.parseChunk(N,!0)):setTimeout(V.resume,3)},this.aborted=function(){return te},this.abort=function(){te=!0,W.abort(),tr.meta.aborted=!0,M(R.complete)&&R.complete(tr),N=""}}function x(R){return R.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function _(R){var N,W=(R=R||{}).delimiter,j=R.newline,B=R.comments,U=R.step,V=R.preview,G=R.fastMode,Y=N=void 0===R.quoteChar||null===R.quoteChar?'"':R.quoteChar;if(void 0!==R.escapeChar&&(Y=R.escapeChar),("string"!=typeof W||-1<z.BAD_DELIMITERS.indexOf(W))&&(W=","),B===W)throw Error("Comment character same as delimiter");!0===B?B="#":("string"!=typeof B||-1<z.BAD_DELIMITERS.indexOf(B))&&(B=!1),j!==` 354`&&"\r"!==j&&j!==`\r 355`&&(j=` 356`);var Z=0,te=!1;this.parse=function(z,tn,tr){if("string"!=typeof z)throw Error("Input must be a string");var ts=z.length,ta=W.length,th=j.length,tc=B.length,tu=M(U),tp=[],tf=[],tg=[],tm=Z=0;if(!z)return p();if(R.header&&!tn){var tw=z.split(j)[0].split(W),ty=[],tA={},tx=!1;for(var t_ in tw){var tS=tw[t_];M(R.transformHeader)&&(tS=R.transformHeader(tS,t_));var tE=tS,tk=tA[tS]||0;for(0<tk&&(tx=!0,tE=tS+"_"+tk),tA[tS]=tk+1;ty.includes(tE);)tE=tE+"_"+tk;ty.push(tE)}if(tx){var tC=z.split(j);tC[0]=ty.join(W),z=tC.join(j)}}if(G||!1!==G&&-1===z.indexOf(N)){for(var tM=z.split(j),tT=0;tT<tM.length;tT++){if(tg=tM[tT],Z+=tg.length,tT!==tM.length-1)Z+=j.length;else if(tr)break;if(!B||tg.substring(0,tc)!==B){if(tu){if(tp=[],ce(tg.split(W)),S(),te)return p()}else ce(tg.split(W));if(V&&V<=tT)return tp=tp.slice(0,V),p(!0)}}return p()}for(var tR=z.indexOf(W,Z),tP=z.indexOf(j,Z),tI=RegExp(x(Y)+x(N),"g"),tD=z.indexOf(N,Z);;)if(z[Z]!==N){if(B&&0===tg.length&&z.substring(Z,Z+tc)===B){if(-1===tP)return p();Z=tP+th,tP=z.indexOf(j,Z),tR=z.indexOf(W,Z)}else if(-1!==tR&&(tR<tP||-1===tP))tg.push(z.substring(Z,tR)),Z=tR+ta,tR=z.indexOf(W,Z);else{if(-1===tP)break;if(tg.push(z.substring(Z,tP)),u(tP+th),tu&&(S(),te))return p();if(V&&tp.length>=V)return p(!0)}}else for(tD=Z,Z++;;){if(-1===(tD=z.indexOf(N,tD+1)))return tr||tf.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:tp.length,index:Z}),b();if(tD===ts-1)return b(z.substring(Z,tD).replace(tI,N));if(N!==Y||z[tD+1]!==Y){if(N===Y||0===tD||z[tD-1]!==Y){-1!==tR&&tR<tD+1&&(tR=z.indexOf(W,tD+1)),-1!==tP&&tP<tD+1&&(tP=z.indexOf(j,tD+1));var tN=sn(-1===tP?tR:Math.min(tR,tP));if(z.substr(tD+1+tN,ta)===W){tg.push(z.substring(Z,tD).replace(tI,N)),z[Z=tD+1+tN+ta]!==N&&(tD=z.
356indexOf(N,Z)),tR=z.indexOf(W,Z),tP=z.indexOf(j,Z);break}var tO=sn(tP);if(z.substring(tD+1+tO,tD+1+tO+th)===j){if(tg.push(z.substring(Z,tD).replace(tI,N)),u(tD+1+tO+th),tR=z.indexOf(W,Z),tD=z.indexOf(N,Z),tu&&(S(),te))return p();if(V&&tp.length>=V)return p(!0);break}tf.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:tp.length,index:Z}),tD++}}else tD++}return b();function ce(R){tp.push(R),tm=Z}function sn(R){var N=0;if(-1!==R){var W=z.substring(tD+1,R);W&&""===W.trim()&&(N=W.length)}return N}function b(R){return tr||(void 0===R&&(R=z.substring(Z)),tg.push(R),Z=ts,ce(tg),tu&&S()),p()}function u(R){Z=R,ce(tg),tg=[],tP=z.indexOf(j,Z)}function p(R){return{data:tp,errors:tf,meta:{delimiter:W,linebreak:j,aborted:te,truncated:!!R,cursor:tm+(tn||0)}}}function S(){U(p()),tp=[],tf=[]}},this.abort=function(){te=!0},this.getCharIndex=function(){return Z}}function P(R){var N=R.data,W=j[N.workerId],B=!1;if(N.error)W.userError(N.error,N.file);else if(N.results&&N.results.data){var z={abort:function(){B=!0,k(N.workerId,{data:[],errors:[],meta:{aborted:!0}})},pause:L,resume:L};if(M(W.userStep)){for(var U=0;U<N.results.data.length&&(W.userStep({data:N.results.data[U],errors:N.results.errors,meta:N.results.meta},z),!B);U++);delete N.results}else M(W.userChunk)&&(W.userChunk(N.results,z,N.file),delete N.results)}N.finished&&!B&&k(N.workerId,N.results)}function k(R,N){var W=j[R];M(W.userComplete)&&W.userComplete(N),W.terminate(),delete j[R]}function L(){throw Error("Not implemented.")}function F(R){if("object"!=typeof R||null===R)return R;var N=Array.isArray(R)?[]:{};for(var W in R)N[W]=F(R[W]);return N}function I(R,N){return function(){R.apply(N,arguments)}}function M(R){return"function"==typeof R}return W&&(R.onmessage=function(N){var W=N.data;if(void 0===z.WORKER_ID&&W&&(z.WORKER_ID=W.workerId),"string"==typeof W.input)R.postMessage({workerId:z.WORKER_ID,results:z.parse(W.input,W.config),finished:!0});else if(R.File&&W.input instanceof File||W.input instanceof Object){var j=z.parse(W.input,W.config);j&&R.postMessage({workerId:z.WORKER_ID,results:j,finished:!0})}}),(f.prototype=Object.create(h.prototype)).constructor=f,(g.prototype=Object.create(h.prototype)).constructor=g,(v.prototype=Object.create(v.prototype)).constructor=v,(y.prototype=Object.create(h.prototype)).constructor=y,z}();var y3=yZ.exports;let y5=Jv(y3),Sp=({mainState:{currentDocument:R,config:N}})=>{let[W,j]=(0,dK.useState)([]);return(0,dK.useEffect)(()=>{var W;if(null!=R&&R.fileData){let B=y5.parse(R.fileData,{delimiter:(null==N?void 0:N.csvDelimiter)??","});!(null!=(W=B.errors)&&W.length)&&B.data&&j(B.data)}},[R,null==N?void 0:N.csvDelimiter]),W.length?(0,dY.jsx)(y4,{children:(0,dY.jsxs)(y6,{children:[(0,dY.jsx)("thead",{children:(0,dY.jsx)("tr",{children:W[0].map(R=>(0,dY.jsx)("th",{children:R},R))})}),(0,dY.jsx)("tbody",{children:W.slice(1,W.length).map(R=>(0,dY.jsx)("tr",{children:R.map(R=>(0,dY.jsx)("td",{children:R},R))},R.join("")))})]})}):null};Sp.fileTypes=["csv","text/csv"],Sp.weight=0,Sp.fileLoader=vb;let y4=rb.div` 357 width: 100%; 358`,y6=rb.table` 359 width: 100%; 360 text-align: left; 361 362 th, 363 td { 364 padding: 5px 10px; 365 366 &:empty { 367 display: none; 368 } 369 } 370`,_0=R=>(0,dY.jsx)(Vi,{...R});_0.fileTypes=["gif","image/gif"],_0.weight=0;let S0=({mainState:{currentDocument:R}})=>R?(0,dY.jsx)(y8,{id:"video-renderer",children:(0,dY.jsx)(y7,{controls:!0,src:R.uri})}):null;S0.fileTypes=["video/mp4","video/quicktime","video/x-msvideo"],S0.weight=0;let y8=rb.div` 371 width: 100%; 372`,y7=rb.video` 373 width: 100%; 374 height: 100%; 375 border: 0; 376`,x0=R=>(0,dY.jsx)(Vi,{...R});x0.fileTypes=["webp","image/webp"],x0.weight=0;let y9=[a0,rp,l0,sp,A0,E0,Ep,_p,Sp,_0,S0,x0],be=(0,dK.forwardRef)((R,N)=>{let{documents:W,theme:j}=R;if(!W)throw Error("Please provide an array of documents to DocViewer!");return(0,dY.jsx)(g3,{ref:N,pluginRenderers:y9,...R,children:(0,dY.jsx)(Ox,{theme:j?{...mC,...j}:mC,children:(0,dY.jsxs)(bn,{id:"react-doc-viewer","data-testid":"react-doc-viewer",className:R.className,style:R.style,children:[(0,dY.jsx)(DP,{}),(0,dY.jsx)(zP,{})]})})})}),bi=(0,dK.memo)(be),bn=rb.div` 377 display: flex; 378 flex-direction: column; 379 background: #ffffff; 380 width: 100%; 381 height: 100%; 382`}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.