pdfcedar 0.1.0-beta.0 → 0.1.1-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,1026 @@
1
+ (function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports):typeof define==`function`&&define.amd?define([`exports`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.PDFCedar={}))})(this,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=Object.create,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,a=Object.getPrototypeOf,o=Object.prototype.hasOwnProperty,s=(e,t,n)=>()=>{if(n)throw n[0];try{return e&&(t=e(e=0)),t}catch(e){throw n=[e],e}},c=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t,t.exports),e=null),t.exports),l=(e,t)=>{let r={};for(var i in e)n(r,i,{get:e[i],enumerable:!0});return t||n(r,Symbol.toStringTag,{value:`Module`}),r},u=(e,t,a,s)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var c=i(t),l=0,u=c.length,d;l<u;l++)d=c[l],!o.call(e,d)&&d!==a&&n(e,d,{get:(e=>t[e]).bind(null,d),enumerable:!(s=r(t,d))||s.enumerable});return e},d=(e,r,i)=>(i=e==null?{}:t(a(e)),u(r||!e||!e.__esModule||!o.call(e,`default`)?n(i,`default`,{value:e,enumerable:!0}):i,e)),f,p=s((()=>{f=class{handlers=new Map;on(e,t){let n=this.handlers.get(e);n||(n=new Set,this.handlers.set(e,n)),n.add(t)}off(e,t){this.handlers.get(e)?.delete(t)}emit(e,t){let n=this.handlers.get(e);if(n)for(let r of[...n])try{r(t)}catch(t){console.error(`[pdfcedar] "${String(e)}" handler threw`,t)}}clear(){this.handlers.clear()}}})),m,h,g,_=s((()=>{m=[`highlight`,`underline`,`strikeout`,`note`,`reply`,`ink`,`rectangle`,`ellipse`,`line`,`arrow`,`freeText`,`signature`,`redaction`],h={highlight:`#ffd400`,underline:`#2563eb`,strikeout:`#e11d48`,note:`#ffd400`,reply:`#ffd400`,ink:`#e11d48`,rectangle:`#e11d48`,ellipse:`#e11d48`,line:`#e11d48`,arrow:`#e11d48`,freeText:`#111827`,signature:`#000000`,redaction:`#e11d48`},g=new Set([`Highlight`,`Underline`,`StrikeOut`,`Text`,`Ink`,`Square`,`Circle`,`Line`,`FreeText`,`Redact`])}));function v(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function y(e,t){throw new P(e,t)}function b(e,t,n=-1/0,r=1/0){return typeof t==`number`&&Number.isFinite(t)||y(e,`expected a finite number, got ${JSON.stringify(t)}`),(t<n||t>r)&&y(e,`expected a number from ${n} to ${r}, got ${t}`),t}function x(e,t){return typeof t!=`string`&&y(e,`expected a string, got ${JSON.stringify(t)}`),t}function S(e,t){return typeof t!=`boolean`&&y(e,`expected true or false, got ${JSON.stringify(t)}`),t}function C(e,t){let n=x(e,t).trim(),r=/^#([0-9a-f])([0-9a-f])([0-9a-f])$/i.exec(n);return r?`#${r[1]}${r[1]}${r[2]}${r[2]}${r[3]}${r[3]}`.toLowerCase():/^#[0-9a-f]{6}$/i.test(n)?n.toLowerCase():y(e,`expected a color like "#ff8800", got ${JSON.stringify(t)}`)}function w(e,t){return t===null?null:C(e,t)}function T(e,t){return v(t)||y(e,`expected { x, y }`),{x:b(`${e}.x`,t.x),y:b(`${e}.y`,t.y)}}function E(e,t){return v(t)||y(e,`expected { x, y, width, height }`),{x:b(`${e}.x`,t.x),y:b(`${e}.y`,t.y),width:b(`${e}.width`,t.width,0),height:b(`${e}.height`,t.height,0)}}function D(e,t){return Array.isArray(t)&&t.length===8||y(e,`expected 8 numbers [x1, y1, x2, y2, x3, y3, x4, y4]`),t.map((t,n)=>b(`${e}[${n}]`,t))}function O(e,t){return Array.isArray(t)&&t.length!==0||y(e,`expected a non-empty array`),t}function k(e,t){let n=x(e,t);return Number.isNaN(Date.parse(n))&&y(e,`expected an ISO 8601 date, got ${JSON.stringify(t)}`),n}function A(e,t){let n=e.map(e=>e.x),r=e.map(e=>e.y),i=Math.min(...n)-t,a=Math.min(...r)-t;return{x:i,y:a,width:Math.max(...n)+t-i,height:Math.max(...r)+t-a}}function j(e,t,n=`annotation`){v(e)||y(n,`expected an object`);let r=e.type;m.includes(r)||y(`${n}.type`,`expected one of ${m.join(`, `)}, got ${JSON.stringify(e.type)}`);let i=new Set([...ee,...te[r]]);for(let t of Object.keys(e))!i.has(t)&&e[t]!==void 0&&y(`${n}.${t}`,`unknown field for a ${r} annotation (allowed: ${[...i].join(`, `)})`);let a=e=>`${n}.${e}`,o=b(a(`page`),e.page,1,t.pageCount??1/0);Number.isInteger(o)||y(a(`page`),`expected a whole page number, got ${o}`);let s=t.now(),c=e.id===void 0?t.newId():x(a(`id`),e.id);c.trim()===``&&y(a(`id`),`must not be empty`);let l=()=>e.strokeWidth===void 0?2:b(a(`strokeWidth`),e.strokeWidth,0,100),u={id:c,page:o,color:e.color===void 0?h[r]:C(a(`color`),e.color),opacity:e.opacity===void 0?1:b(a(`opacity`),e.opacity,0,1),contents:e.contents===void 0?``:x(a(`contents`),e.contents),author:e.author===void 0?t.user?.name??``:x(a(`author`),e.author),authorId:e.authorId===void 0?t.user?.id??``:x(a(`authorId`),e.authorId),createdAt:e.createdAt===void 0?s:k(a(`createdAt`),e.createdAt),modifiedAt:e.modifiedAt===void 0?s:k(a(`modifiedAt`),e.modifiedAt),locked:e.locked!==void 0&&S(a(`locked`),e.locked)},d=()=>E(a(`rect`),e.rect);switch(r){case`highlight`:case`underline`:case`strikeout`:{let t=O(a(`quads`),e.quads).map((e,t)=>D(`${a(`quads`)}[${t}]`,e)),n=t.flatMap(e=>[0,2,4,6].map(t=>({x:e[t],y:e[t+1]})));return{...u,type:r,quads:t,rect:A(n,0)}}case`note`:return{...u,type:r,rect:d()};case`reply`:{let t=x(a(`inReplyTo`),e.inReplyTo);return{...u,type:r,inReplyTo:t,rect:e.rect===void 0?{x:0,y:0,width:0,height:0}:d()}}case`ink`:{let t=l(),n=O(a(`paths`),e.paths).map((e,t)=>O(`${a(`paths`)}[${t}]`,e).map((e,n)=>T(`${a(`paths`)}[${t}][${n}]`,e)));return{...u,type:r,paths:n,strokeWidth:t,rect:A(n.flat(),t/2)}}case`rectangle`:case`ellipse`:return{...u,type:r,rect:d(),strokeWidth:l(),fillColor:e.fillColor===void 0?null:w(a(`fillColor`),e.fillColor)};case`line`:case`arrow`:{let t=l(),n=T(a(`start`),e.start),i=T(a(`end`),e.end);return{...u,type:r,start:n,end:i,strokeWidth:t,rect:A([n,i],r===`arrow`?t*3:t/2)}}case`freeText`:return{...u,type:r,rect:d(),fontSize:e.fontSize===void 0?14:b(a(`fontSize`),e.fontSize,1,400),backgroundColor:e.backgroundColor===void 0?null:w(a(`backgroundColor`),e.backgroundColor),borderColor:e.borderColor===void 0?null:w(a(`borderColor`),e.borderColor)};case`signature`:return{...u,type:r,rect:d(),image:M(a(`image`),e.image)};case`redaction`:return{...u,type:r,rect:d(),applied:e.applied!==void 0&&S(a(`applied`),e.applied)}}}function M(e,t){let n=x(e,t);return/^data:image\/(png|jpeg);base64,[A-Za-z0-9+/]+={0,2}$/.test(n)||y(e,`expected a PNG or JPEG data URL (data:image/png;base64,…); signatures.add() converts other images`),n.length>ne&&y(e,`image is too large (over 4 MB as a data URL)`),n}function N(){let e=globalThis.crypto;if(typeof e?.randomUUID==`function`)return e.randomUUID();let t=new Uint8Array(16);e.getRandomValues(t),t[6]=t[6]&15|64,t[8]=t[8]&63|128;let n=[...t].map(e=>e.toString(16).padStart(2,`0`)).join(``);return`${n.slice(0,8)}-${n.slice(8,12)}-${n.slice(12,16)}-${n.slice(16,20)}-${n.slice(20)}`}var P,ee,te,ne,re=s((()=>{_(),P=class extends TypeError{path;constructor(e,t){super(`${e}: ${t}`),this.path=e,this.name=`AnnotationValidationError`}},ee=[`id`,`type`,`page`,`rect`,`color`,`opacity`,`contents`,`author`,`authorId`,`createdAt`,`modifiedAt`,`locked`],te={highlight:[`quads`],underline:[`quads`],strikeout:[`quads`],note:[],reply:[`inReplyTo`],ink:[`paths`,`strokeWidth`],rectangle:[`strokeWidth`,`fillColor`],ellipse:[`strokeWidth`,`fillColor`],line:[`start`,`end`,`strokeWidth`],arrow:[`start`,`end`,`strokeWidth`],freeText:[`fontSize`,`backgroundColor`,`borderColor`],signature:[`image`],redaction:[`applied`]},ne=4194304}));function ie(e){if(typeof e==`object`&&e&&!Object.isFrozen(e)){Object.freeze(e);for(let t of Object.values(e))ie(t)}return e}function ae(e,t){let n=new Set(t),r=new Map,i=[],a=e=>{i.push(e),n.add(e.id);for(let t of r.get(e.id)??[])a(t);r.delete(e.id)};for(let t of e)t.type===`reply`&&!n.has(t.inReplyTo)?r.set(t.inReplyTo,[...r.get(t.inReplyTo)??[],t]):a(t);return i}function oe(e,t){return JSON.stringify({...e,modifiedAt:``})===JSON.stringify({...t,modifiedAt:``})}var se,ce,le,ue,de,fe,pe=s((()=>{re(),se={highlight:`highlight`,underline:`underline`,strikeout:`strikeout`,note:`note`,reply:`reply`,ink:`drawing`,rectangle:`rectangle`,ellipse:`ellipse`,line:`line`,arrow:`arrow`,freeText:`text box`,signature:`signature`,redaction:`redaction mark`},ce=`redactions are applied with redaction.apply(), not by setting applied`,le=`an applied redaction is final: it can't be changed, removed or replaced`,ue=e=>e?.type===`redaction`&&e.applied,de=e=>structuredClone(e),fe=class{options;items=[];byId=new Map;constructor(e){this.options=e}get(e){let t=this.byId.get(e);return t&&de(t)}list(e={}){return this.items.filter(t=>(e.page===void 0||t.page===e.page)&&(e.type===void 0||t.type===e.type)).map(de)}replies(e){return this.items.filter(t=>t.type===`reply`&&t.inReplyTo===e).map(de)}add(e,t=`api`){let n=this.prepare(e,`annotation`);if(ue(n))throw new P(`annotation.applied`,ce);if(this.byId.has(n.id))throw new P(`annotation.id`,`an annotation with id "${n.id}" already exists`);return this.insert(n,this.items.length,t),this.options.undo.record({label:`Add ${se[n.type]}`,undo:()=>this.detach(n.id,this.sourceOf(`undo`)),redo:()=>this.insert(n,this.items.length,this.sourceOf(`redo`))}),de(n)}update(e,t,n=`api`){let r=this.require(e);if(typeof t!=`object`||!t)throw TypeError("update: `patch` must be an object.");if(ue(r)&&Object.keys(t).some(e=>e!==`page`&&e!==`modifiedAt`))throw new P(`annotation`,le);for(let e of[`id`,`type`])if(e in t&&t[e]!==r[e])throw new P(`patch.${e}`,`can't be changed (it is ${JSON.stringify(r[e])})`);let i={...r,...t,modifiedAt:t.modifiedAt??this.now()};r.type===`reply`&&`inReplyTo`in t&&this.requireParent(i,`patch`);let a=ie(j(i,this.context(),`patch`));if(ue(a)&&!ue(r))throw new P(`patch.applied`,ce);return oe(r,a)?de(r):this.options.undo.transaction(`Edit ${se[a.type]}`,()=>{if(this.replace(r,a,n),this.options.undo.record({label:`Edit ${se[a.type]}`,undo:()=>this.replace(a,r,this.sourceOf(`undo`)),redo:()=>this.replace(r,a,this.sourceOf(`redo`))}),r.page!==a.page||JSON.stringify(r.rect)!==JSON.stringify(a.rect))for(let t of this.items.filter(t=>t.type===`reply`&&t.inReplyTo===e))this.update(t.id,{page:a.page,rect:a.rect,modifiedAt:t.modifiedAt},n);return de(a)})}remove(e,t=`api`,{withPage:n=!1}={}){let r=this.require(e);if(ue(r)&&!n)throw new P(`annotation`,le);this.options.undo.transaction(`Delete ${se[r.type]}`,()=>{for(let n of this.items.filter(t=>t.type===`reply`&&t.inReplyTo===e))this.remove(n.id,t);let n=this.items.indexOf(r);this.detach(e,t),this.options.undo.record({label:`Delete ${se[r.type]}`,undo:()=>this.insert(r,n,this.sourceOf(`undo`)),redo:()=>this.detach(e,this.sourceOf(`redo`))})})}markApplied(e,t=`api`){this.options.undo.untracked(()=>{for(let n of e){let e=this.require(n);e.type!==`redaction`||e.applied||this.replace(e,ie({...e,applied:!0,locked:!0,modifiedAt:this.now()}),t)}})}applyRemote(e){let t=[];return this.options.undo.untracked(()=>{for(let t of e.remove??[])if(this.byId.has(t)){for(let e of this.items.filter(e=>e.type===`reply`&&e.inReplyTo===t))this.detach(e.id,`remote`);this.detach(t,`remote`)}let n=[];for(let r of e.upsert??[])try{n.push(ie(j(r,this.context(),`remote`)))}catch{t.push(r)}for(let e of[...n].sort((e,t)=>Number(e.type===`reply`)-Number(t.type===`reply`))){if(e.type===`reply`&&!this.byId.has(e.inReplyTo)){t.push(e);continue}let n=this.byId.get(e.id);n?oe(n,e)&&n.modifiedAt===e.modifiedAt||this.replace(n,e,`remote`):this.insert(e,this.items.length,`remote`)}}),{rejected:t}}export(){return this.list()}import(e,t={},n=`api`){if(!Array.isArray(e))throw new P(`annotations`,`expected an array`);let r=e.map((e,t)=>ie(j(e,this.context(),`annotations[${t}]`))),i=new Set;for(let[e,t]of r.entries()){if(i.has(t.id))throw new P(`annotations[${e}].id`,`duplicate id "${t.id}"`);i.add(t.id)}for(let[e,t]of r.entries()){if(ue(t))throw new P(`annotations[${e}].applied`,ce);if(ue(this.byId.get(t.id)))throw new P(`annotations[${e}].id`,le)}if(t.replace&&this.items.some(ue))throw new P(`annotations`,le);let a=t.replace?new Set:new Set(this.byId.keys()),o=new Map([...r.map(e=>[e.id,e]),...[...a].map(e=>[e,this.byId.get(e)])]);for(let[e,t]of r.entries())if(t.type===`reply`&&!o.has(t.inReplyTo))throw new P(`annotations[${e}].inReplyTo`,`no annotation with id "${t.inReplyTo}"`);let s=ae(r,a);return this.options.undo.transaction(`Import annotations`,()=>{if(t.replace)for(let e of[...this.items].reverse())this.byId.has(e.id)&&this.remove(e.id,n);for(let e of s)this.byId.has(e.id)?this.update(e.id,e,n):this.add(e,n)}),r.map(de)}prepare(e,t){let n=e;if(typeof e==`object`&&e&&e.type===`reply`){let t=this.byId.get(String(e.inReplyTo));t&&(n={page:t.page,...e,rect:t.rect})}let r=ie(j(n,this.context(),t));return r.type===`reply`&&this.requireParent(r,t),r}requireParent(e,t){if(e.type!==`reply`)return;let n=this.byId.get(e.inReplyTo);if(!n)throw new P(`${t}.inReplyTo`,`no annotation with id "${e.inReplyTo}"`);if(n.page!==e.page)throw new P(`${t}.page`,`a reply must be on its parent's page (${n.page})`)}require(e){let t=this.byId.get(e);if(!t)throw RangeError(`No annotation with id "${e}".`);return t}insert(e,t,n){this.items.splice(Math.min(t,this.items.length),0,e),this.byId.set(e.id,e),this.options.emit(`annotationAdded`,{annotation:de(e),source:n})}detach(e,t){let n=this.require(e);this.items.splice(this.items.indexOf(n),1),this.byId.delete(e),this.options.emit(`annotationRemoved`,{annotation:de(n),source:t})}replace(e,t,n){this.items[this.items.indexOf(this.require(e.id))]=t,this.byId.set(t.id,t),this.options.emit(`annotationChanged`,{annotation:de(t),previous:de(e),source:n})}sourceOf(e){return this.options.undo.replayKind??e}now(){if(this.options.now)return this.options.now();let e=new Date;return e.setMilliseconds(0),e.toISOString()}context(){return{now:()=>this.now(),newId:this.options.newId??N,user:this.options.user?.(),pageCount:this.options.pageCount?.()}}}}));function me(e,t){return{x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),width:Math.abs(t.x-e.x),height:Math.abs(t.y-e.y)}}function he(e,t,n){let r={...e.rect,x:e.rect.x+t,y:e.rect.y+n};switch(e.type){case`highlight`:case`underline`:case`strikeout`:return{quads:e.quads.map(e=>e.map((e,r)=>e+(r%2==0?t:n)))};case`ink`:return{paths:e.paths.map(e=>e.map(e=>Ce(e,t,n)))};case`line`:case`arrow`:return{start:Ce(e.start,t,n),end:Ce(e.end,t,n)};default:return{rect:r}}}function ge(e){return e.type===`rectangle`||e.type===`ellipse`||e.type===`freeText`||e.type===`ink`||e.type===`signature`||e.type===`redaction`}function _e(e){return e.type===`signature`?[`nw`,`ne`,`se`,`sw`]:[`nw`,`n`,`ne`,`e`,`se`,`s`,`sw`,`w`]}function F(e,t,n){if(e.width<=0||e.height<=0)return t;let r=Math.max(t.width/e.width,t.height/e.height),i=e.width*r,a=e.height*r,o=e.x+e.width,s=e.y+e.height;return{x:n.includes(`w`)?o-i:e.x,y:n.includes(`s`)?s-a:e.y,width:i,height:a}}function ve(e){return e.type!==`reply`&&e.type!==`highlight`&&e.type!==`underline`&&e.type!==`strikeout`}function ye(e,t){if(e.type!==`ink`)return{rect:t};let n=e.strokeWidth/2,r={x:e.rect.x+n,y:e.rect.y+n,width:e.rect.width-2*n,height:e.rect.height-2*n},i={x:t.x+n,y:t.y+n,width:Math.max(0,t.width-2*n),height:Math.max(0,t.height-2*n)},a=r.width>0?i.width/r.width:1,o=r.height>0?i.height/r.height:1;return{paths:e.paths.map(e=>e.map(e=>({x:i.x+(e.x-r.x)*a,y:i.y+(e.y-r.y)*o})))}}function be(e,t,n,r,i=4){let a=e.x,o=e.x+e.width,s=e.y,c=e.y+e.height;return t.includes(`w`)&&(a=Math.min(a+n,o-i)),t.includes(`e`)&&(o=Math.max(o+n,a+i)),t.includes(`n`)&&(c=Math.max(c+r,s+i)),t.includes(`s`)&&(s=Math.min(s+r,c-i)),{x:a,y:s,width:o-a,height:c-s}}function xe(e){let t=e.y+e.height,n=e.x+e.width;return[e.x,t,n,t,e.x,e.y,n,e.y]}function Se(e){let t=e.filter(e=>e.width>.5&&e.height>.5).sort((e,t)=>t.y+t.height-(e.y+e.height)||e.x-t.x),n=[];for(let e of t){let t=n.find(t=>{let n=Math.min(t.y+t.height,e.y+e.height)-Math.max(t.y,e.y),r=Math.max(t.x,e.x)-Math.min(t.x+t.width,e.x+e.width);return n>=Math.min(t.height,e.height)/2&&r<Math.max(t.height,e.height)});if(!t){n.push({...e});continue}let r=Math.min(t.x,e.x),i=Math.min(t.y,e.y);t.width=Math.max(t.x+t.width,e.x+e.width)-r,t.height=Math.max(t.y+t.height,e.y+e.height)-i,t.x=r,t.y=i}return n}function I(e,t,n){let r=Math.max(n*3,6),i=Math.atan2(t.y-e.y,t.x-e.x),a=Math.PI/7;return[{x:t.x-r*Math.cos(i-a),y:t.y-r*Math.sin(i-a)},{x:t.x-r*Math.cos(i+a),y:t.y-r*Math.sin(i+a)}]}var Ce,L=s((()=>{Ce=(e,t,n)=>({x:e.x+t,y:e.y+n})})),R,we,Te=s((()=>{R=200,we=class{limit;undoStack=[];redoStack=[];pending=null;depth=0;replaying=null;untrackedDepth=0;listeners=new Set;constructor(e=R){this.limit=e}get replayKind(){return this.replaying}get state(){let e=this.undoStack.at(-1),t=this.redoStack.at(-1);return{canUndo:!!e,canRedo:!!t,undoLabel:e?.label??null,redoLabel:t?.label??null}}record(e){this.replaying||this.untrackedDepth>0||(this.pending?this.pending.push(e):(this.undoStack.push(e),this.undoStack.length>this.limit&&this.undoStack.shift(),this.redoStack=[],this.notify()))}transaction(e,t){let n=this.pending,r=[];this.pending=r,this.depth++;let i;try{i=t()}catch(e){throw this.pending=n,this.depth--,this.replay(`undo`,()=>[...r].reverse().forEach(e=>e.undo())),e}return this.pending=n,this.depth--,r.length>0&&this.record({label:e,undo:()=>[...r].reverse().forEach(e=>e.undo()),redo:()=>r.forEach(e=>e.redo())}),i}untracked(e){this.untrackedDepth++;try{return e()}finally{this.untrackedDepth--}}undo(){if(this.depth>0)throw Error(`undo() cannot run inside a transaction.`);let e=this.undoStack.pop();return e?(this.replay(`undo`,()=>e.undo()),this.redoStack.push(e),this.notify(),!0):!1}redo(){if(this.depth>0)throw Error(`redo() cannot run inside a transaction.`);let e=this.redoStack.pop();return e?(this.replay(`redo`,()=>e.redo()),this.undoStack.push(e),this.notify(),!0):!1}clear(){this.undoStack.length=0,this.redoStack=[],this.notify()}onChange(e){return this.listeners.add(e),()=>this.listeners.delete(e)}replay(e,t){let n=this.replaying;this.replaying=e;try{t()}finally{this.replaying=n}}notify(){let e=this.state;for(let t of this.listeners)t(e)}}})),Ee,De,z=s((()=>{Ee=class extends Error{constructor(e,t){super(`${e} is not implemented yet (planned for Milestone ${t}).`),this.name=`NotImplementedError`}},De=class extends Error{constructor(e=`Saving password-protected (encrypted) PDFs is not supported yet.`){super(e),this.name=`EncryptedDocumentError`}}}));function Oe(e,t){let n=t=>{throw new ke(e.name,t)},r=()=>(e.options??[]).map(e=>e.value);switch(e.type){case`text`:{typeof t!=`string`&&n(`a text field takes a string.`);let r=t;return!e.multiline&&/[\r\n]/.test(r)&&n(`this field is single-line; remove line breaks.`),e.maxLength&&[...r].length>e.maxLength&&n(`at most ${e.maxLength} characters.`),r}case`checkbox`:return typeof t!=`boolean`&&n(`a checkbox takes true or false.`),t;case`radio`:{let r=[...new Set(e.widgets.map(e=>e.exportValue).filter(e=>!!e))];return t===``||typeof t==`string`&&r.includes(t)||n(`expected one of ${r.map(e=>JSON.stringify(e)).join(`, `)}, or '' for none.`),t}case`dropdown`:return typeof t!=`string`&&n(`a dropdown takes a string.`),t!==``&&!e.editable&&!r().includes(t)&&n(`expected one of ${r().map(e=>JSON.stringify(e)).join(`, `)}.`),t;case`listbox`:{let i=typeof t==`string`?t===``?[]:[t]:t;(!Array.isArray(i)||i.some(e=>typeof e!=`string`))&&n(`a list box takes a string or an array of strings.`);let a=i,o=a.find(e=>!r().includes(e));o!==void 0&&n(`${JSON.stringify(o)} is not an option.`),!e.multiSelect&&a.length>1&&n(`this list box allows one selection.`);let s=r().filter(e=>a.includes(e));return e.multiSelect?s:s[0]??``}}}var ke,Ae,je,Me=s((()=>{ke=class extends TypeError{field;constructor(e,t){super(`${e}: ${t}`),this.field=e,this.name=`FormValueError`}},Ae=(e,t)=>Array.isArray(e)&&Array.isArray(t)?e.length===t.length&&e.every((e,n)=>e===t[n]):e===t,je=class{o;byName=new Map;current=new Map;flattenedState=!1;listeners=new Set;constructor(e){this.o=e}load(e){for(let t of e)this.byName.set(t.name,t),this.current.set(t.name,t.value);this.notify(e.map(e=>e.name))}get fields(){return[...this.byName.values()].filter(e=>this.isAvailable(e))}field(e){let t=this.byName.get(e);return t&&this.isAvailable(t)?t:void 0}isAvailable(e){return this.o.available?.(e)??!0}get flattened(){return this.flattenedState}value(e){return this.current.get(e)}values(){return this.flattenedState?{}:Object.fromEntries(this.fields.map(({name:e})=>{let t=this.current.get(e);return[e,Array.isArray(t)?[...t]:t]}))}changed(){let e={};for(let[t,n]of this.current)Ae(n,this.byName.get(t).value)||(e[t]=n);return e}setValues(e,t=`api`){if(this.flattenedState)throw new ke(`form`,`the form has been flattened; its fields no longer exist.`);if(typeof e!=`object`||!e||Array.isArray(e))throw new ke(`values`,`expected an object of field names to values.`);let n=new Map;for(let[t,r]of Object.entries(e)){let e=this.field(t);if(!e)throw new ke(t,`no such field in this document.`);n.set(t,Oe(e,r))}let r=new Map;for(let[e,t]of n)Ae(t,this.current.get(e))?n.delete(e):r.set(e,this.current.get(e));n.size!==0&&(this.apply(n,t),this.o.undo.record({label:n.size===1?`Fill field`:`Fill form`,undo:()=>this.apply(r,this.o.undo.replayKind??`undo`),redo:()=>this.apply(n,this.o.undo.replayKind??`redo`)}))}applyRemote(e){let t=new Map;for(let[n,r]of Object.entries(e)){let e=this.byName.get(n);if(e)try{let i=Oe(e,r);Ae(i,this.current.get(n))||t.set(n,i)}catch{}}t.size&&this.apply(t,`remote`)}flatten(){this.flattenedState||this.byName.size===0||(this.setFlattened(!0),this.o.undo.record({label:`Flatten form`,undo:()=>this.setFlattened(!1),redo:()=>this.setFlattened(!0)}))}onChange(e){return this.listeners.add(e),()=>this.listeners.delete(e)}setFlattened(e){this.flattenedState=e,this.notify([...this.byName.keys()])}apply(e,t){for(let[t,n]of e)this.current.set(t,n);this.notify([...e.keys()]);for(let[n,r]of e)this.o.emit({name:n,value:Array.isArray(r)?[...r]:r,source:t})}notify(e){for(let t of this.listeners)t(e)}}})),Ne=s((()=>{p(),_(),pe(),L(),Te(),re(),z(),Me()}));Ne();var Pe=1<<18,Fe=e=>e&&e.length===3?`#${Array.from(e,e=>Math.round(e).toString(16).padStart(2,`0`)).join(``)}`:null;function Ie(e){switch(e.fieldType){case`Tx`:return`text`;case`Btn`:return e.checkBox?`checkbox`:e.radioButton?`radio`:null;case`Ch`:return e.combo?`dropdown`:`listbox`;default:return null}}function Le(e){return e.subtype===`Widget`&&!!e.fieldName&&Ie(e)!==null}function Re(e,t){let[n=0,r=0,i=0,a=0]=e.rect,o=e.textAlignment===1?`center`:e.textAlignment===2?`right`:`left`,s=e.checkBox?e.exportValue:e.radioButton?e.buttonValue:void 0,c=((e.rotation??0)%360+360)%360;return{id:e.id,pageIndex:t,rect:{x:Math.min(n,i),y:Math.min(r,a),width:Math.abs(i-n),height:Math.abs(a-r)},...s?{exportValue:s}:{},fontSize:e.defaultAppearanceData?.fontSize??0,color:Fe(e.defaultAppearanceData?.fontColor)??`#000000`,align:o,background:Fe(e.backgroundColor),border:Fe(e.borderColor),hidden:!!e.hidden,rotation:c===90||c===180||c===270?c:0}}function ze(e,t,n){let r=t.fieldValue;switch(e){case`text`:return typeof r==`string`?r:``;case`checkbox`:return typeof r==`string`&&r!==`Off`&&n.some(e=>e.exportValue===r);case`radio`:return typeof r==`string`&&n.some(e=>e.exportValue===r)?r:``;case`dropdown`:return Array.isArray(r)?r[0]??``:r??``;case`listbox`:{let e=Array.isArray(r)?r:r?[r]:[];return t.multiSelect?e:e[0]??``}}}function Be(e){let t=new Map;for(let{pageIndex:n,widgets:r}of e)for(let e of r){if(!Le(e))continue;let r=e.fieldName,i=Ie(e),a=t.get(r);if(!a){let n={name:r,type:i,readOnly:!!e.readOnly,required:!!e.required,widgets:[],value:``};i===`text`&&(n.multiline=!!e.multiLine,n.password=!!e.password,n.maxLength=e.maxLen??0,n.comb=!!e.comb),(i===`dropdown`||i===`listbox`)&&(n.options=(e.options??[]).map(e=>({value:e.exportValue,label:e.displayValue})),i===`listbox`?n.multiSelect=!!e.multiSelect:n.editable=((e.fieldFlags??0)&Pe)!==0),a={field:n,first:e},t.set(r,a)}a.field.widgets.push(Re(e,n))}return[...t.values()].map(({field:e,first:t})=>({...e,value:ze(e.type,t,e.widgets)}))}function Ve(e){return(Math.round(e/90)*90%360+360)%360}function He(e,t){let[n,r,i,a]=t.view,o=i-n,s=a-r,c=(e.x-n)/o,l=(e.x+e.width-n)/o,u=(a-(e.y+e.height))/s,d=(a-e.y)/s;switch(t.rotation){case 90:return{left:1-d,top:c,width:d-u,height:l-c};case 180:return{left:1-l,top:1-d,width:l-c,height:d-u};case 270:return{left:u,top:1-l,width:d-u,height:l-c};default:return{left:c,top:u,width:l-c,height:d-u}}}function Ue(e,t){let[n,r,i,a]=t.view,o=(e.x-n)/(i-n),s=(a-e.y)/(a-r);switch(t.rotation){case 90:return{x:1-s,y:o};case 180:return{x:1-o,y:1-s};case 270:return{x:s,y:1-o};default:return{x:o,y:s}}}function We(e,t){let n,r;switch(t.rotation){case 90:[n,r]=[e.y,1-e.x];break;case 180:[n,r]=[1-e.x,1-e.y];break;case 270:[n,r]=[1-e.y,e.x];break;default:[n,r]=[e.x,e.y]}let[i,a,o,s]=t.view;return{x:i+n*(o-i),y:s-r*(s-a)}}function Ge(e){let t=Ue({x:0,y:0},e),n=Ue({x:1,y:0},e),r=Ue({x:0,y:1},e);return[n.x-t.x,n.y-t.y,r.x-t.x,r.y-t.y,t.x,t.y]}var Ke=l({AbortException:()=>Vo,AnnotationEditorLayer:()=>Iu,AnnotationEditorParamsType:()=>wo,AnnotationEditorType:()=>Co,AnnotationEditorUIManager:()=>vs,AnnotationLayer:()=>uu,AnnotationMode:()=>bo,AnnotationType:()=>Oo,CSSConstants:()=>ss,ColorPicker:()=>Dl,DOMSVGFactory:()=>jl,DrawLayer:()=>Lu,FeatureTest:()=>Ho,GlobalWorkerOptions:()=>il,ImageKind:()=>Do,InvalidPDFException:()=>Ro,MathClamp:()=>lt,OPS:()=>jo,OutputScale:()=>is,PDFDataRangeTransport:()=>vl,PDFDateString:()=>rs,PDFWorker:()=>xl,PasswordException:()=>Io,PasswordResponses:()=>No,PermissionFlag:()=>To,PixelsPerInch:()=>es,RenderingCancelledException:()=>ts,ResponseException:()=>zo,SignatureExtractor:()=>ju,SupportedImageMimeTypes:()=>as,TextLayer:()=>hl,TextLayerImages:()=>Ru,TouchManager:()=>Ss,Util:()=>H,VerbosityLevel:()=>Ao,XfaLayer:()=>$o,applyOpacity:()=>wt,build:()=>El,createValidAbsoluteUrl:()=>et,fetchData:()=>ut,findContrastColor:()=>kt,getDocument:()=>En,getFilenameFromUrl:()=>pt,getPdfFilenameFromUrl:()=>mt,getRGB:()=>yt,getRGBA:()=>vt,getUuid:()=>st,isDataScheme:()=>dt,isPdfFile:()=>ft,isValidExplicitDest:()=>ic,makeArr:()=>Go,makeMap:()=>Ko,makeObj:()=>qo,makeSet:()=>Jo,noContextMenu:()=>gt,normalizeUnicode:()=>ot,renderRichText:()=>At,setLayerDimensions:()=>Ct,shadow:()=>V,stopEvent:()=>_t,updateUrlHash:()=>tt,version:()=>Tl});function B(e){let t=Ln[e];if(t!==void 0)return t.exports;let n=Ln[e]={exports:{}};return In[e](n,n.exports,B),n.exports}function qe(e){Number.isInteger(e)&&(Po=e)}function Je(){return Po}function Ye(e){Po>=Ao.INFOS&&console.info(`Info: ${e}`)}function Xe(e){Po>=Ao.WARNINGS&&console.warn(`Warning: ${e}`)}function Ze(e){throw Error(e)}function Qe(e,t){e||Ze(t)}function $e(e){switch(e?.protocol){case`http:`:case`https:`:case`ftp:`:case`mailto:`:case`tel:`:return!0;default:return!1}}function et(e,t=null,n=null){if(!e)return null;if(n&&typeof e==`string`&&(n.addDefaultProtocol&&e.startsWith(`www.`)&&e.match(/\./g)?.length>=2&&(e=`http://${e}`),n.tryConvertEncoding))try{e=at(e)}catch{}let r=t?URL.parse(e,t):URL.parse(e);return $e(r)?r:null}function tt(e,t,n=!1){let r=URL.parse(e);return r?(r.hash=t,r.href):n&&et(e,`http://example.com`)?e.split(`#`,1)[0]+`${t?`#${t}`:``}`:``}function nt(e){return e.substring(e.lastIndexOf(`/`)+1)}function V(e,t,n,r=!1){return Object.defineProperty(e,t,{value:n,enumerable:!r,configurable:!0,writable:!1}),n}function rt(e){(typeof e!=`object`||e?.length===void 0)&&Ze(`Invalid argument for bytesToString`);let t=e.length,n=8192;if(t<n)return String.fromCharCode.apply(null,e);let r=[];for(let i=0;i<t;i+=n){let a=Math.min(i+n,t),o=e.subarray(i,a);r.push(String.fromCharCode.apply(null,o))}return r.join(``)}function it(e){typeof e!=`string`&&Ze(`Invalid argument for stringToBytes`);let t=e.length,n=new Uint8Array(t);for(let r=0;r<t;++r)n[r]=e.charCodeAt(r)&255;return n}function at(e){return decodeURIComponent(escape(e))}function ot(e){return Uo||(Uo=/([\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,Wo=new Map([[`ſt`,`ſt`]])),e.replaceAll(Uo,(e,t,n)=>t?t.normalize(`NFKC`):Wo.get(n))}function st(){if(typeof crypto.randomUUID==`function`)return crypto.randomUUID();let e=new Uint8Array(32);return crypto.getRandomValues(e),rt(e)}function ct(e,t,n){if(!Array.isArray(n)||n.length<2)return!1;let[r,i,...a]=n;if(!e(r)&&!Number.isInteger(r)||!t(i))return!1;let o=a.length,s=!0;switch(i.name){case`XYZ`:if(o<2||o>3)return!1;break;case`Fit`:case`FitB`:return o===0;case`FitH`:case`FitBH`:case`FitV`:case`FitBV`:if(o>1)return!1;break;case`FitR`:if(o!==4)return!1;s=!1;break;default:return!1}for(let e of a)if(!(typeof e==`number`||s&&e===null))return!1;return!0}function lt(e,t,n){return Math.min(Math.max(e,t),n)}async function ut(e,t=`text`){if(ht(e,document.baseURI)){let n=await fetch(e);if(!n.ok)throw Error(n.statusText);switch(t){case`blob`:return n.blob();case`bytes`:return n.bytes();case`json`:return n.json()}return n.text()}return new Promise((n,r)=>{let i=new XMLHttpRequest;i.open(`GET`,e,!0),i.responseType=t===`bytes`?`arraybuffer`:t,i.onreadystatechange=()=>{if(i.readyState===XMLHttpRequest.DONE){if(i.status===200||i.status===0){switch(t){case`bytes`:n(new Uint8Array(i.response));return;case`blob`:case`json`:n(i.response);return}n(i.responseText)}else r(Error(i.statusText))}},i.send(null)})}function dt(e){let t=e.length,n=0;for(;n<t&&e[n].trim()===``;)n++;return e.substring(n,n+5).toLowerCase()===`data:`}function ft(e){return typeof e==`string`&&/\.pdf$/i.test(e)}function pt(e){return[e]=e.split(/[#?]/,1),nt(e)}function mt(e,t=`document.pdf`){if(typeof e!=`string`)return t;if(dt(e))return Xe(`getPdfFilenameFromUrl: ignore "data:"-URL for performance reasons.`),t;let n=(e=>{try{return new URL(e)}catch{}try{return new URL(decodeURIComponent(e))}catch{}try{return new URL(e,`https://foo.bar`)}catch{}try{return new URL(decodeURIComponent(e),`https://foo.bar`)}catch{}return null})(e);if(!n)return t;let r=e=>{try{let t=decodeURIComponent(e);return t.includes(`/`)&&(t=nt(t),t.length===4&&i.test(t))?e:t}catch{return e}},i=/\.pdf$/i,a=nt(n.pathname);if(i.test(a))return r(a);if(n.searchParams.size>0){let e=e=>[...e].findLast(e=>i.test(e)),t=e(n.searchParams.values())??e(n.searchParams.keys());if(t)return r(t)}if(n.hash){let{hash:e}=n,t=-1;for(let{index:n}of e.matchAll(/\.pdf\b/gi))t=n;if(t>0){let n=t;for(;n>0&&!`/?#=`.includes(e[n-1]);)n--;if(n<t)return r(e.slice(n,t+4))}}return t}function ht(e,t){let n=t?URL.parse(e,t):URL.parse(e);return/https?:/.test(n?.protocol??``)}function gt(e){e.preventDefault()}function _t(e){e.preventDefault(),e.stopPropagation()}function vt(e){if(e.startsWith(`#`)){let t=e.slice(1);return[parseInt(t.slice(0,2),16),parseInt(t.slice(2,4),16),parseInt(t.slice(4,6),16),t.length>=8?parseInt(t.slice(6,8),16)/255:1]}if(e.startsWith(`rgb(`)){let[t,n,r]=e.slice(4,-1).split(`,`).map(e=>parseInt(e,10));return[t,n,r,1]}if(e.startsWith(`rgba(`)){let t=e.slice(5,-1).split(`,`);return[parseInt(t[0],10),parseInt(t[1],10),parseInt(t[2],10),parseFloat(t[3])]}let t=e.match(/^color\(srgb\s+([\d.]+)\s+([\d.]+)\s+([\d.]+)(?:\s*\/\s*([\d.]+|none))?\)$/);return t?[Math.round(parseFloat(t[1])*255),Math.round(parseFloat(t[2])*255),Math.round(parseFloat(t[3])*255),t[4]!==void 0&&t[4]!==`none`?parseFloat(t[4]):1]:null}function yt(e){let t=vt(e);return t?t.slice(0,3):(Xe(`Not a valid color format: "${e}"`),[0,0,0])}function bt(e){let t=document.createElement(`span`);t.style.visibility=`hidden`,t.style.colorScheme=`only light`,document.body.append(t);for(let n of e.keys()){t.style.color=n;let r=window.getComputedStyle(t).color;e.set(n,yt(r))}t.remove()}function xt(e){let{a:t,b:n,c:r,d:i,e:a,f:o}=e.getTransform();return[t,n,r,i,a,o]}function St(e){let{a:t,b:n,c:r,d:i,e:a,f:o}=e.getTransform().invertSelf();return[t,n,r,i,a,o]}function Ct(e,t,n=!1,r=!0){if(t instanceof Yo){let{pageWidth:r,pageHeight:i}=t.rawDims,{style:a}=e,o=`round(down, var(--total-scale-factor) * ${r}px, var(--scale-round-x))`,s=`round(down, var(--total-scale-factor) * ${i}px, var(--scale-round-y))`;!n||t.rotation%180==0?(a.width=o,a.height=s):(a.width=s,a.height=o)}r&&e.setAttribute(`data-main-rotation`,t.rotation)}function wt(e,t){t=lt(t??1,0,1);let n=255*(1-t);return e.map(e=>Math.round(e*t+n))}function Tt(e,t){let n=e[0]/255,r=e[1]/255,i=e[2]/255,a=Math.max(n,r,i),o=Math.min(n,r,i),s=(a+o)/2;if(a===o)t[0]=t[1]=0;else{let e=a-o;switch(t[1]=s<.5?e/(a+o):e/(2-a-o),a){case n:t[0]=((r-i)/e+(r<i?6:0))*60;break;case r:t[0]=((i-n)/e+2)*60;break;case i:t[0]=((n-r)/e+4)*60}}t[2]=s}function Et(e,t){let n=e[0],r=e[1],i=e[2],a=(1-Math.abs(2*i-1))*r,o=a*(1-Math.abs(n/60%2-1)),s=i-a/2;switch(Math.floor(n/60)){case 0:t[0]=a+s,t[1]=o+s,t[2]=s;break;case 1:t[0]=o+s,t[1]=a+s,t[2]=s;break;case 2:t[0]=s,t[1]=a+s,t[2]=o+s;break;case 3:t[0]=s,t[1]=o+s,t[2]=a+s;break;case 4:t[0]=o+s,t[1]=s,t[2]=a+s;break;case 5:case 6:t[0]=a+s,t[1]=s,t[2]=o+s}}function Dt(e){return e<=.03928?e/12.92:((e+.055)/1.055)**2.4}function Ot(e,t,n){Et(e,n),n.map(Dt);let r=.2126*n[0]+.7152*n[1]+.0722*n[2];Et(t,n),n.map(Dt);let i=.2126*n[0]+.7152*n[1]+.0722*n[2];return r>i?(r+.05)/(i+.05):(i+.05)/(r+.05)}function kt(e,t){let n=e[0]+e[1]*256+e[2]*65536+t[0]*16777216+t[1]*4294967296+t[2]*1099511627776,r=cs.get(n);if(r)return r;let i=new Float32Array(9),a=i.subarray(0,3),o=i.subarray(3,6);Tt(e,o);let s=i.subarray(6,9);Tt(t,s);let c=s[2]<.5,l=c?12:4.5;if(o[2]=c?Math.sqrt(o[2]):1-Math.sqrt(1-o[2]),Ot(o,s,a)<l){let e,t;for(c?(e=o[2],t=1):(e=0,t=o[2]);t-e>.005;){let n=o[2]=(e+t)/2;c===Ot(o,s,a)<l?e=n:t=n}o[2]=c?t:e}return Et(o,a),r=H.makeHexColor(Math.round(a[0]*255),Math.round(a[1]*255),Math.round(a[2]*255)),cs.set(n,r),r}function At({html:e,dir:t,className:n},r){let i=document.createDocumentFragment();if(typeof e==`string`){let n=document.createElement(`p`);n.dir=t||`auto`;let r=e.split(/\r\n?|\n/);for(let e=0,t=r.length;e<t;++e){let i=r[e];n.append(document.createTextNode(i)),e<t-1&&n.append(document.createElement(`br`))}i.append(n)}else $o.render({xfaHtml:e,div:i,intent:`richText`});i.firstElementChild.classList.add(`richText`,n),r.append(i)}function jt(e){let t=new Path2D;if(!e)return t;for(let n=0,r=e.length;n<r;)switch(e[n++]){case Mo.moveTo:t.moveTo(e[n++],e[n++]);break;case Mo.lineTo:t.lineTo(e[n++],e[n++]);break;case Mo.curveTo:t.bezierCurveTo(e[n++],e[n++],e[n++],e[n++],e[n++],e[n++]);break;case Mo.quadraticCurveTo:t.quadraticCurveTo(e[n++],e[n++],e[n++],e[n++]);break;case Mo.closePath:t.closePath();break;default:Xe(`Unrecognized drawing path operator: ${e[n-1]}`)}return t}function Mt(e,t,n){for(let r of n)t.addEventListener(r,e[r].bind(e))}function Nt(e){e.preventDefault()}function Pt(e){return e.cancelable?(_t(e),!0):(e.stopPropagation(),!1)}function Ft(e,t,n,r,i,a){e[t*4+0]=Math.min(e[t*4+0],n),e[t*4+1]=Math.min(e[t*4+1],r),e[t*4+2]=Math.max(e[t*4+2],i),e[t*4+3]=Math.max(e[t*4+3],a)}function It(e,t,n,r,i){let a;e?(e<0&&(a=i[0],i[0]=i[2],i[2]=a),i[0]*=e,i[2]*=e,t<0&&(a=i[1],i[1]=i[3],i[3]=a),i[1]*=t,i[3]*=t):i.fill(0),i[0]+=n,i[1]+=r,i[2]+=n,i[3]+=r}function Lt(e){let t=e[0];if(e.length<2||t!==`"`&&t!==`'`||e.at(-1)!==t)return!1;let n=e.length-1;for(let r=1;r<n;r++){let i=e[r];if(i===t||Us.test(i)||i===`\\`&&(++r>=n||Us.test(e[r])))return!1}return!0}function Rt(e){return Lt(e)?e:`"${e.replaceAll(/["\\\p{Cc}]/gu,e=>e===`"`||e===`\\`?`\\${e}`:`\\${e.codePointAt(0).toString(16)} `)}"`}function zt(e,t,n,r=0){let{decoder:i}=Xs;for(let e=0;e<n;e++)r+=t.getUint32(r)+4;let a=t.getUint32(r);return i.decode(new Uint8Array(e,r+4,a))}function Bt(e){if(e instanceof URL)return e;if(typeof e==`string`){if(mo){if(/^[a-z][a-z0-9\-+.]+:/i.test(e))return new URL(e);let t=process.getBuiltinModule(`url`);return new URL(t.pathToFileURL(e))}let t=URL.parse(e,window.location);if(t)return t}throw Error(`Invalid PDF url data: either string or URL-object is expected in the url property.`)}function Vt(e){if(mo&&typeof Buffer<`u`&&e instanceof Buffer)throw Error("Please provide binary data as `Uint8Array`, rather than `Buffer`.");if(e instanceof Uint8Array&&e.byteLength===e.buffer.byteLength)return e;if(typeof e==`string`)return it(e);if(e instanceof ArrayBuffer||ArrayBuffer.isView(e)||typeof e==`object`&&!isNaN(e?.length))return new Uint8Array(e);throw Error(`Invalid PDF binary data: either TypedArray, string, or array-like object is expected in the data property.`)}function Ht(e){if(typeof e!=`string`)return null;if(e.endsWith(`/`))return e;throw Error(`Invalid factory url: "${e}" must include trailing slash.`)}function Ut(){}function Wt(e){if(e instanceof Vo||e instanceof Ro||e instanceof Io||e instanceof zo||e instanceof Lo)return e;switch(e instanceof Error||typeof e==`object`&&e||Ze(`wrapReason: Expected "reason" to be a (possibly cloned) Error.`),e.name){case`AbortException`:return new Vo(e.message);case`InvalidPDFException`:return new Ro(e.message);case`PasswordException`:return new Io(e.message,e.code);case`ResponseException`:return new zo(e.message,e.status,e.missing);case`UnknownErrorException`:return new Lo(e.message,e.details)}return new Lo(e.message,e.toString())}function Gt(e,t,n){return Math.round(n*e+(1-n)*t)}async function Kt(e){let t=await process.getBuiltinModule(`fs/promises`).readFile(e);return new Uint8Array(t)}function qt({src:e,srcPos:t=0,dest:n,width:r,height:i,nonBlackColor:a=4294967295,inverseDecode:o=!1}){let s=Ho.isLittleEndian?4278190080:255,[c,l]=o?[a,s]:[s,a],u=r>>3,d=r&7,f=c^l,p=e.length;n=new Uint32Array(n.buffer);let m=0;for(let r=0;r<i;++r){for(let r=t+u;t<r;++t,m+=8){let r=e[t];n[m]=c^-(r>>7&1)&f,n[m+1]=c^-(r>>6&1)&f,n[m+2]=c^-(r>>5&1)&f,n[m+3]=c^-(r>>4&1)&f,n[m+4]=c^-(r>>3&1)&f,n[m+5]=c^-(r>>2&1)&f,n[m+6]=c^-(r>>1&1)&f,n[m+7]=c^-(r&1)&f}if(d===0)continue;let r=t<p?e[t++]:255;for(let e=0;e<d;++e,++m)n[m]=c^-(r>>7-e&1)&f}return{srcPos:t,destPos:m}}function Jt({src:e,srcPos:t=0,dest:n,destPos:r=0,width:i,height:a}){let o=0,s=i*a*3,c=s>>2,l=new Uint32Array(e.buffer,t,c),u=Ho.isLittleEndian?4278190080:255;if(Ho.isLittleEndian){for(;o<c-2;o+=3,r+=4){let e=l[o],t=l[o+1],i=l[o+2];n[r]=e|u,n[r+1]=e>>>24|t<<8|u,n[r+2]=t>>>16|i<<16|u,n[r+3]=i>>>8|u}for(let i=t+o*4,a=t+s;i<a;i+=3)n[r++]=e[i]|e[i+1]<<8|e[i+2]<<16|u}else{for(;o<c-2;o+=3,r+=4){let e=l[o],t=l[o+1],i=l[o+2];n[r]=e|u,n[r+1]=e<<24|t>>>8|u,n[r+2]=t<<16|i>>>16|u,n[r+3]=i<<8|u}for(let i=t+o*4,a=t+s;i<a;i+=3)n[r++]=e[i]<<24|e[i+1]<<16|e[i+2]<<8|u}return{srcPos:t+s,destPos:r}}function Yt(){return bc.init()}function Xt(){return bc.isReady}function Zt(){bc.loadMeshShader()}function Qt(e,t,n,r,i,a,o,s){return bc.draw(e,t,n,r,i,a,o,s)}function $t(e,t){if(!t)return;let n=t[2]-t[0],r=t[3]-t[1],i=new Path2D;i.rect(t[0],t[1],n,r),e.clip(i)}function en(e,t,n,r,i,a,o,s){let c=t.coords,l=t.colors,u=e.data,d=e.width*4,f;c[n*2+1]>c[r*2+1]&&(f=n,n=r,r=f,f=a,a=o,o=f),c[r*2+1]>c[i*2+1]&&(f=r,r=i,i=f,f=o,o=s,s=f),c[n*2+1]>c[r*2+1]&&(f=n,n=r,r=f,f=a,a=o,o=f);let p=(c[n*2]+t.offsetX)*t.scaleX,m=(c[n*2+1]+t.offsetY)*t.scaleY,h=(c[r*2]+t.offsetX)*t.scaleX,g=(c[r*2+1]+t.offsetY)*t.scaleY,_=(c[i*2]+t.offsetX)*t.scaleX,v=(c[i*2+1]+t.offsetY)*t.scaleY;if(m>=v)return;let y=l[a*4],b=l[a*4+1],x=l[a*4+2],S=l[o*4],C=l[o*4+1],w=l[o*4+2],T=l[s*4],E=l[s*4+1],D=l[s*4+2],O=Math.round(m),k=Math.round(v),A,j,M,N,P,ee,te,ne;for(let e=O;e<=k;e++){if(e<g){let t=e<m?0:(m-e)/(m-g);A=p-(p-h)*t,j=y-(y-S)*t,M=b-(b-C)*t,N=x-(x-w)*t}else{let t;t=e>v?1:g===v?0:(g-e)/(g-v),A=h-(h-_)*t,j=S-(S-T)*t,M=C-(C-E)*t,N=w-(w-D)*t}let t;t=e<m?0:e>v?1:(m-e)/(m-v),P=p-(p-_)*t,ee=y-(y-T)*t,te=b-(b-E)*t,ne=x-(x-D)*t;let n=Math.round(Math.min(A,P)),r=Math.round(Math.max(A,P)),i=d*e+n*4;for(let e=n;e<=r;e++)t=(A-e)/(A-P),t<0?t=0:t>1&&(t=1),u[i++]=j-(j-ee)*t|0,u[i++]=M-(M-te)*t|0,u[i++]=N-(N-ne)*t|0,u[i++]=255}}function tn(e){switch(e[0]){case`RadialAxial`:return new Cc(e);case`Mesh`:return new wc(e);case`Dummy`:return new Tc}throw Error(`Unknown IR type: ${e[0]}`)}function nn(e,t){if(e._removeMirroring)throw Error(`Context is already forwarding operations.`);let n=new Map;for(let r of[`save`,`restore`,`rotate`,`scale`,`translate`,`transform`,`setTransform`,`resetTransform`,`clip`,`moveTo`,`lineTo`,`bezierCurveTo`,`quadraticCurveTo`,`arc`,`arcTo`,`ellipse`,`rect`,`roundRect`,`closePath`,`beginPath`]){let i=e[r];typeof i==`function`&&typeof t[r]==`function`&&(n.set(r,i),e[r]=function(...e){return t[r](...e),i.apply(this,e)})}e._removeMirroring=()=>{for(let[t,r]of n)e[t]=r;delete e._removeMirroring}}function rn(e,t,n,r,i,a,o,s,c,l){let[u,d,f,p,m,h]=xt(e);if(d===0&&f===0){let g=o*u+m,_=Math.round(g),v=s*p+h,y=Math.round(v),b=(o+c)*u+m,x=Math.abs(Math.round(b)-_)||1,S=(s+l)*p+h,C=Math.abs(Math.round(S)-y)||1;return e.setTransform(Math.sign(u),0,0,Math.sign(p),_,y),e.drawImage(t,n,r,i,a,0,0,x,C),e.setTransform(u,d,f,p,m,h),[x,C]}if(u===0&&p===0){let g=s*f+m,_=Math.round(g),v=o*d+h,y=Math.round(v),b=(s+l)*f+m,x=Math.abs(Math.round(b)-_)||1,S=(o+c)*d+h,C=Math.abs(Math.round(S)-y)||1;return e.setTransform(0,Math.sign(d),Math.sign(f),0,_,y),e.drawImage(t,n,r,i,a,0,0,C,x),e.setTransform(u,d,f,p,m,h),[C,x]}e.drawImage(t,n,r,i,a,o,s,c,l);let g=Math.hypot(u,d),_=Math.hypot(f,p);return[g*c,_*l]}function an(e,t){let{width:n,height:r,kind:i}=t,a=r%Mc,o=(r-a)/Mc,s=a===0?o:o+1,c=e.createImageData(n,Mc),l=0,u=t.data,d=c.data,f;if(i===Do.GRAYSCALE_1BPP)for(f=0;f<s;f++)({srcPos:l}=qt({src:u,srcPos:l,dest:d,width:n,height:f<o?Mc:a})),e.putImageData(c,0,f*Mc);else if(i===Do.RGBA_32BPP){let t=0,r=n*Mc*4;for(f=0;f<o;f++)d.set(u.subarray(l,l+r)),l+=r,e.putImageData(c,0,t),t+=Mc;f<s&&(r=n*a*4,d.set(u.subarray(l,l+r)),e.putImageData(c,0,t))}else if(i===Do.RGB_24BPP)for(f=0;f<s;f++)({srcPos:l}=Jt({src:u,srcPos:l,dest:new Uint32Array(d.buffer),width:n,height:f<o?Mc:a})),e.putImageData(c,0,f*Mc);else throw Error(`bad image kind: ${i}`)}function on(e,t){if(t.bitmap){e.drawImage(t.bitmap,0,0);return}let{width:n,height:r}=t,i=r%Mc,a=(r-i)/Mc,o=i===0?a:a+1,s=e.createImageData(n,Mc),c=0,l=t.data,u=s.data;for(let t=0;t<o;t++)({srcPos:c}=qt({src:l,srcPos:c,dest:u,width:n,height:t<a?Mc:i,nonBlackColor:0})),e.putImageData(s,0,t*Mc)}function sn(e,t){for(let n of[`strokeStyle`,`fillStyle`,`fillRule`,`globalAlpha`,`lineWidth`,`lineCap`,`lineJoin`,`miterLimit`,`globalCompositeOperation`,`font`,`filter`])e[n]!==void 0&&(t[n]=e[n]);e.setLineDash!==void 0&&(t.setLineDash(e.getLineDash()),t.lineDashOffset=e.lineDashOffset)}function cn(e){e.strokeStyle=e.fillStyle=`#000000`,e.fillRule=`nonzero`,e.globalAlpha=1,e.lineWidth=1,e.lineCap=`butt`,e.lineJoin=`miter`,e.miterLimit=10,e.globalCompositeOperation=`source-over`,e.font=`10px sans-serif`,e.setLineDash!==void 0&&(e.setLineDash([]),e.lineDashOffset=0);let{filter:t}=e;t!==`none`&&t!==``&&(e.filter=`none`)}function ln(e,t){if(t)return!0;H.singularValueDecompose2dScale(e,Nc);let n=Math.fround(is.pixelRatio*es.PDF_TO_CSS_UNITS);return Nc[0]<=n&&Nc[1]<=n}function un(e){let t=!0,n=r(`filename\\*`,`i`).exec(e);if(n){n=n[1];let e=s(n);return e=unescape(e),e=c(e),e=l(e),a(e)}if(n=o(e),n)return a(l(n));if(n=r(`filename`,`i`).exec(e),n){n=n[1];let e=s(n);return e=l(e),a(e)}function r(e,t){return RegExp(`(?:^|;)\\s*`+e+`\\s*=\\s*([^";\\s][^;\\s]*|"(?:[^"\\\\]|\\\\"?)+"?)`,t)}function i(e,n){if(e){if(!/^[\x00-\xFF]+$/.test(n))return n;try{let r=new TextDecoder(e,{fatal:!0}),i=it(n);n=r.decode(i),t=!1}catch{}}return n}function a(e){return t&&/[\x80-\xff]/.test(e)&&(e=i(`utf-8`,e),t&&(e=i(`iso-8859-1`,e))),e}function o(e){let t=[],n,i=r(`filename\\*((?!0\\d)\\d+)(\\*?)`,`ig`);for(;(n=i.exec(e))!==null;){let[,e,r,i]=n;if(e=parseInt(e,10),e in t){if(e===0)break}else t[e]=[r,i]}let a=[];for(let e=0;e<t.length&&e in t;++e){let[n,r]=t[e];r=s(r),n&&(r=unescape(r),e===0&&(r=c(r))),a.push(r)}return a.join(``)}function s(e){if(e.startsWith(`"`)){let t=e.slice(1).split(`\\"`);for(let e=0;e<t.length;++e){let n=t[e].indexOf(`"`);n!==-1&&(t[e]=t[e].slice(0,n),t.length=e+1),t[e]=t[e].replaceAll(/\\(.)/g,`$1`)}e=t.join(`"`)}return e}function c(e){let t=e.indexOf(`'`);return t===-1?e:i(e.slice(0,t),e.slice(t+1).replace(/^[^']*'/,``))}function l(e){return!e.startsWith(`=?`)||/[\x00-\x19\x80-\xff]/.test(e)?e:e.replaceAll(/=\?([\w-]*)\?([QB])\?((?:[^?]|\?(?!=))*)\?=/gi,function(e,t,n,r){if(n===`q`||n===`Q`)return r=r.replaceAll(`_`,` `).replaceAll(/=([0-9a-f]{2})/gi,(e,t)=>String.fromCharCode(parseInt(t,16))),i(t,r);try{r=atob(r)}catch{}return i(t,r)})}return``}function dn(e,t){let n=new Headers;if(!e||!t||typeof t!=`object`)return n;for(let e in t){let r=t[e];r!==void 0&&n.append(e,r)}return n}function fn(e){let t=e.length;for(;t>0&&e[t-1]!==` `&&/\s/.test(e[t-1]);)t--;return e.slice(0,t)}function pn(e){return URL.parse(e)?.origin??null}function mn({responseHeaders:e,isHttp:t,rangeChunkSize:n,disableRange:r}){let i={contentLength:0,isRangeSupported:!1},a=parseInt(e.get(`Content-Length`),10);return!Number.isInteger(a)||(i.contentLength=a,a<=2*n)||r||!t||e.get(`Accept-Ranges`)!==`bytes`||(e.get(`Content-Encoding`)||`identity`)===`identity`&&(i.isRangeSupported=!0),i}function hn(e){let t=e.get(`Content-Disposition`);if(t){let e=un(t);if(e.includes(`%`))try{e=decodeURIComponent(e)}catch{}if(ft(e))return e}return null}function gn(e,t){return new zo(`Unexpected server response (${e}) while retrieving PDF "${t.href}".`,e,e===404||e===0&&t.protocol===`file:`)}function _n(e,t){if(e!==t)throw Error(`Expected range response-origin "${e}" to match "${t}".`)}function vn(e,t,n,r){return fetch(e,{method:`GET`,headers:t,signal:r.signal,mode:`cors`,credentials:n?`include`:`same-origin`,redirect:`follow`})}function yn(e,t){if(e!==200&&e!==206)throw gn(e,t)}function bn(e){if(e instanceof Uint8Array)return e.buffer;if(e instanceof ArrayBuffer)return e;throw Error(`getArrayBuffer - unexpected data: ${e}`)}function xn(e){return e instanceof Uint8Array&&e.byteLength===e.buffer.byteLength?e.buffer:new Uint8Array(e).buffer}function Sn(){for(let e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0}function Cn(e){return typeof e==`string`?it(e).buffer:e}function wn(e,t=null){let n=process.getBuiltinModule(`fs`),{Readable:r}=process.getBuiltinModule(`stream`),i=n.createReadStream(e,t);return r.toWeb(i)}function Tn(e){return ht(e)?Wc:mo?tl:Qc}function En(e={}){let t=new _l,{docId:n}=t,r=e.url?Bt(e.url):null,i=e.data?Vt(e.data):null,a=e.httpHeaders||null,o=e.withCredentials===!0,s=e.password??null,c=e.range instanceof vl?e.range:null,l=Number.isInteger(e.rangeChunkSize)&&e.rangeChunkSize>0?e.rangeChunkSize:2**16,u=e.worker instanceof xl?e.worker:null,d=e.verbosity,f=typeof e.docBaseUrl==`string`&&!dt(e.docBaseUrl)?e.docBaseUrl:null,p=Ht(e.cMapUrl),m=e.cMapPacked!==!1,h=Ht(e.iccUrl),g=Ht(e.standardFontDataUrl),_=Ht(e.wasmUrl),v=e.stopAtErrors!==!0,y=Number.isInteger(e.maxImageSize)&&e.maxImageSize>-1?e.maxImageSize:-1,b=typeof e.isOffscreenCanvasSupported==`boolean`?e.isOffscreenCanvasSupported:!mo,x=typeof e.isImageDecoderSupported==`boolean`?e.isImageDecoderSupported:!mo,S=Number.isInteger(e.canvasMaxAreaInBytes)?e.canvasMaxAreaInBytes:-1,C=typeof e.disableFontFace==`boolean`?e.disableFontFace:mo,w=e.fontExtraProperties===!0,T=e.enableXfa===!0,E=e.ownerDocument||globalThis.document,D=e.disableRange===!0,O=e.disableStream===!0,k=e.disableAutoFetch===!0,A=e.pdfBug===!0,j=e.CanvasFactory||(mo?gc:fc),M=e.FilterFactory||(mo?hc:mc),N=e.BinaryDataFactory||(mo?_c:uc),P=e.enableHWA===!0,ee=e.enableWebGPU===!0?Yt():Promise.resolve(!1),te=e.useWasm!==!1,ne=e.pagesMapper||new ll,re=typeof e.useSystemFonts==`boolean`?e.useSystemFonts:!mo&&!C,ie=typeof e.useWorkerFetch==`boolean`?e.useWorkerFetch:!!(N===uc&&p&&m&&g&&_&&ht(p,document.baseURI)&&ht(g,document.baseURI)&&ht(_,document.baseURI));qe(d);let ae={canvasFactory:new j({ownerDocument:E,enableHWA:P}),filterFactory:new M({docId:n,ownerDocument:E}),binaryDataFactory:ie?null:new N({cMapUrl:p,standardFontDataUrl:g,wasmUrl:_})};u||(u=xl.create({verbosity:d,port:il.workerPort}),t._worker=u);let oe={docId:n,apiVersion:`6.4.299`,data:i,password:s,disableAutoFetch:k,rangeChunkSize:l,docBaseUrl:f,enableXfa:T,evaluatorOptions:{maxImageSize:y,disableFontFace:C,ignoreErrors:v,isOffscreenCanvasSupported:b,isImageDecoderSupported:x,canvasMaxAreaInBytes:S,fontExtraProperties:w,useSystemFonts:re,useWasm:te,useWorkerFetch:ie,cMapUrl:p,cMapPacked:m,iccUrl:h,standardFontDataUrl:g,wasmUrl:_,hasGPU:!1}},se={ownerDocument:E,pdfBug:A,styleElement:null,enableHWA:P,loadingParams:{disableAutoFetch:k,enableXfa:T}};return Promise.all([u.promise,ee]).then(function([,e]){if(u.destroyed)throw Error(`Worker was destroyed`);oe.evaluatorOptions.hasGPU=e;let s=u.messageHandler.sendWithPromise(`GetDocRequest`,oe,i?[i.buffer]:null),d;if(!i){if(c)d=new qc({pdfDataRangeTransport:c,disableRange:D,disableStream:O});else if(r)d=new(Tn(r))({url:r,httpHeaders:a,withCredentials:o,rangeChunkSize:l,disableRange:D,disableStream:O});else throw Error("getDocument - expected either `data`, `range`, or `url` parameter.")}return s.then(e=>{if(u.destroyed)throw Error(`Worker was destroyed`);let r=new cc(n,e,u.port),i=new Sl(r,t,d,se,ae,ne);if(t._transport=i,t.destroyed)throw Error(`Loading aborted`);r.send(`Ready`,null)})}).catch(t._capability.reject).finally(t._setupCapability.resolve),t}function Dn(e){return Math.floor(lt(e,0,1)*255).toString(16).padStart(2,`0`)}function On(e){return lt(e,0,1)*255}function kn(e){return{bbox:e.box,root:{viewBox:`0 0 1 1`},rootClass:{highlight:!0,free:e.isFree},path:{d:e.toSVGPath()}}}function An(e,t){let{focusOutline:n}=e;return{bbox:U._rotateBox(n.box,t),root:{"data-main-rotation":t},rootClass:{highlightOutline:!0,free:e.isFree},path:{d:n.toSVGPath()}}}function jn(e,t){return e===t?0:e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1}function Mn(e){return e?e.nodeType===Node.ELEMENT_NODE?e.closest(`.textLayer`):e.parentElement?.closest(`.textLayer`)||null:null}function Nn(e,t,n,r){if(e===n)return t<=r;let i=e.compareDocumentPosition(n);return i&Node.DOCUMENT_POSITION_FOLLOWING?!0:i&Node.DOCUMENT_POSITION_PRECEDING?!1:null}function Pn(e,t,n){if(e.nodeType!==Node.ELEMENT_NODE||!e.classList.contains(`textLayer`)||t!==e.childNodes.length)return{container:e,offset:t};let r=e.lastChild;return r?.nodeType===Node.ELEMENT_NODE&&r.classList.contains(`endOfContent`)&&(r=r.previousSibling),!r||!n.contains(r)?null:r.nodeType===Node.TEXT_NODE?{container:r,offset:r.textContent.length}:{container:r,offset:r.childNodes.length}}function Fn(e){return`${(e*100).toFixed(2)}%`}var In,Ln,Rn,zn,Bn,Vn,Hn,Un,Wn,Gn,Kn,qn,Jn,Yn,Xn,Zn,Qn,$n,er,tr,nr,rr,ir,ar,or,sr,cr,lr,ur,dr,fr,pr,mr,hr,gr,_r,vr,yr,br,xr,Sr,Cr,wr,Tr,Er,Dr,Or,kr,Ar,jr,Mr,Nr,Pr,Fr,Ir,Lr,Rr,zr,Br,Vr,Hr,Ur,Wr,Gr,Kr,qr,Jr,Yr,Xr,Zr,Qr,$r,ei,ti,ni,ri,ii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Gl,Kl,ql,Jl,Yl,Xl,Zl,Ql,$l,eu,tu,nu,ru,iu,au,ou,su,cu,lu,uu,du,fu,pu,mu,U,hu,gu,_u,vu,yu,bu,xu,Su,Cu,wu,Tu,Eu,Du,Ou,ku,Au,ju,Mu,Nu,Pu,Fu,Iu,Lu,Ru,zu=s((()=>{if(In={463(e){var t=TypeError;e.exports=function(e){if(typeof e==`string`)return e;throw new t(`Argument is not a string`)}},804(e){var t=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789`,n=t+`+/`,r=t+`-_`,i=function(e){for(var t={},n=0;n<64;n++)t[e.charAt(n)]=n;return t};e.exports={i2c:n,c2i:i(n),i2cUrl:r,c2iUrl:i(r)}},529(e){e.exports=function(e,t){return{value:e,done:t}}},837(e){var t=TypeError,n=9007199254740991;e.exports=function(e){if(e>n)throw new t(`Maximum allowed index exceeded`);return e}},2(e){e.exports={IndexSizeError:{s:`INDEX_SIZE_ERR`,c:1,m:1},DOMStringSizeError:{s:`DOMSTRING_SIZE_ERR`,c:2,m:0},HierarchyRequestError:{s:`HIERARCHY_REQUEST_ERR`,c:3,m:1},WrongDocumentError:{s:`WRONG_DOCUMENT_ERR`,c:4,m:1},InvalidCharacterError:{s:`INVALID_CHARACTER_ERR`,c:5,m:1},NoDataAllowedError:{s:`NO_DATA_ALLOWED_ERR`,c:6,m:0},NoModificationAllowedError:{s:`NO_MODIFICATION_ALLOWED_ERR`,c:7,m:1},NotFoundError:{s:`NOT_FOUND_ERR`,c:8,m:1},NotSupportedError:{s:`NOT_SUPPORTED_ERR`,c:9,m:1},InUseAttributeError:{s:`INUSE_ATTRIBUTE_ERR`,c:10,m:1},InvalidStateError:{s:`INVALID_STATE_ERR`,c:11,m:1},SyntaxError:{s:`SYNTAX_ERR`,c:12,m:1},InvalidModificationError:{s:`INVALID_MODIFICATION_ERR`,c:13,m:1},NamespaceError:{s:`NAMESPACE_ERR`,c:14,m:1},InvalidAccessError:{s:`INVALID_ACCESS_ERR`,c:15,m:1},ValidationError:{s:`VALIDATION_ERR`,c:16,m:0},TypeMismatchError:{s:`TYPE_MISMATCH_ERR`,c:17,m:1},SecurityError:{s:`SECURITY_ERR`,c:18,m:1},NetworkError:{s:`NETWORK_ERR`,c:19,m:1},AbortError:{s:`ABORT_ERR`,c:20,m:1},URLMismatchError:{s:`URL_MISMATCH_ERR`,c:21,m:1},QuotaExceededError:{s:`QUOTA_EXCEEDED_ERR`,c:22,m:1},TimeoutError:{s:`TIMEOUT_ERR`,c:23,m:1},InvalidNodeTypeError:{s:`INVALID_NODE_TYPE_ERR`,c:24,m:1},DataCloneError:{s:`DATA_CLONE_ERR`,c:25,m:1}}},944(e){var t=TypeError;e.exports=function(e){var n=e&&e.alphabet;if(n===void 0||n===`base64`||n===`base64url`)return n||`base64`;throw new t("Incorrect `alphabet` option")}},767(e){e.exports=function(e){return{iterator:e,next:e.next,done:!1}}},117(e){e.exports=function(e){return e==null}},859(e){e.exports=function(e){e.iterator=e.next=e.nextHandler=e.mapper=e.predicate=e.inner=e.iterables=e.iters=e.openIters=e.padding=e.finishResults=e.buffer=null}},684(e){e.exports=function(e,t){var n=typeof Iterator==`function`&&Iterator.prototype[e];if(n)try{n.call({next:null},t).next()}catch{return!0}}},269(e){e.exports=Object.create?Object.create(null):{}},741(e){var t=Math.ceil,n=Math.floor;e.exports=Math.trunc||function(e){var r=+e;return(r>0?n:t)(r)}},149(e){var t=RangeError;e.exports=function(e){if(e===e)return e;throw new t(`NaN is not allowed`)}},717(e,t){t.f=Object.getOwnPropertySymbols},103(e){e.exports=function(e){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}}},750(e,t,n){var r=n(117),i=TypeError;e.exports=function(e){if(r(e))throw new i(`Can't call method on `+e);return e}},835(e){e.exports=function(e){try{var t=new Set,n=t[e]({size:0,has:function(){return!0},keys:function(){return Object.defineProperty({},"next",{get:function(){return t.clear(),t.add(4),function(){return{done:!0}}}})}});return n.size===1&&n.values().next().value===4}catch{return!1}}},291(e,t,n){var r=n(741);e.exports=function(e){var t=+e;return t!==t||t===0?0:r(t)}},14(e,t,n){var r=n(291),i=Math.min;e.exports=function(e){var t=r(e);return t>0?i(t,9007199254740991):0}},981(e,t,n){var r=n(750),i=Object;e.exports=function(e){return i(r(e))}},590(e,t,n){var r=n(291),i=RangeError;e.exports=function(e){var t=r(e);if(t<0)throw new i(`The argument can't be less than 0`);return t}},812(e){var t=TypeError;e.exports=function(e,n){if(e<n)throw new t(`Not enough arguments`);return e}}},Ln={},B.cw=e=>{var t;return()=>{if(e){var n=e;e=0,t={exports:{}},n.call(t.exports,t,t.exports)}return t.exports}},B.d=(e,t)=>{for(var n in t)B.o(t,n)&&!B.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},B.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),Rn=B.cw(function(e,t){var n=ni(),r=ba(),i=TypeError;e.exports=function(e){if(n(e))return e;throw new i(r(e)+` is not a function`)}}),zn=B.cw(function(e,t){var n=oi(),r=String,i=TypeError;e.exports=function(e){if(n(e))return e;throw new i(`Can't set `+r(e)+` as a prototype`)}}),Bn=B.cw(function(e,t){var n=qi().has;e.exports=function(e){return n(e),e}}),Vn=()=>B(463),Hn=B.cw(function(e,t){var n=ka(),r=new n.WeakMap,i=n.set,a=n.remove;e.exports=function(e){return i(r,e,1),a(r,e),e}}),Un=B.cw(function(e,t){var n=ka().has;e.exports=function(e){return n(e),e}}),Wn=B.cw(function(e,t){var n=Aa(),r=Di(),i=ki().f,a=n(`unscopables`),o=Array.prototype;o[a]===void 0&&i(o,a,{configurable:!0,value:r(null)}),e.exports=function(e){o[a][e]=!0}}),Gn=B.cw(function(e,t){var n=Pi(),r=TypeError;e.exports=function(e,t){if(n(t,e))return e;throw new r(`Incorrect invocation`)}}),Kn=B.cw(function(e,t){var n=ai(),r=String,i=TypeError;e.exports=function(e){if(e===void 0||n(e))return e;throw new i(r(e)+` is not an object or undefined`)}}),qn=B.cw(function(e,t){var n=ai(),r=String,i=TypeError;e.exports=function(e){if(n(e))return e;throw new i(r(e)+` is not an object`)}}),Jn=B.cw(function(e,t){var n=sr(),r=TypeError;e.exports=function(e){if(n(e)===`Uint8Array`)return e;throw new r(`Argument is not an Uint8Array`)}}),Yn=B.cw(function(e,t){e.exports=typeof ArrayBuffer<`u`&&typeof DataView<`u`}),Xn=B.cw(function(e,t){var n=Wr(),r=Nr(),i=or(),a=n.ArrayBuffer,o=n.TypeError;e.exports=a&&r(a.prototype,`byteLength`,`get`)||function(e){if(i(e)!==`ArrayBuffer`)throw new o(`ArrayBuffer expected`);return e.byteLength}}),Zn=B.cw(function(e,t){var n=Wr(),r=Yn(),i=Xn(),a=n.DataView;e.exports=function(e){if(!r||i(e)!==0)return!1;try{return new a(e),!1}catch{return!0}}}),Qn=B.cw(function(e,t){var n=Zn(),r=TypeError;e.exports=function(e){if(n(e))throw new r(`ArrayBuffer is detached`);return e}}),$n=B.cw(function(e,t){var n=Yn(),r=vr(),i=Wr(),a=ni(),o=ai(),s=Gr(),c=sr(),l=ba(),u=dr(),d=hr(),f=mr(),p=Pi(),m=Ni(),h=Ri(),g=Aa(),_=xa(),v=Qr(),y=v.enforce,b=v.get,x=i.Int8Array,S=x&&x.prototype,C=i.Uint8ClampedArray,w=C&&C.prototype,T=x&&m(x),E=S&&m(S),D=Object.prototype,O=i.TypeError,k=g(`toStringTag`),A=_(`TYPED_ARRAY_TAG`),j=`TypedArrayConstructor`,M=n&&!!h&&c(i.opera)!==`Opera`,N=!1,P,ee,te,ne={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},re={BigInt64Array:8,BigUint64Array:8},ie=function(e){if(!o(e))return!1;var t=c(e);return t===`DataView`||s(ne,t)||s(re,t)},ae=function(e){var t=m(e);if(o(t)){var n=b(t);return n&&s(n,j)?n[j]:ae(t)}},oe=function(e){if(!o(e))return!1;var t=c(e);return s(ne,t)||s(re,t)},se=function(e){if(oe(e))return e;throw new O(`Target is not a typed array`)},ce=function(e){if(a(e)&&(!h||p(T,e)))return e;throw new O(l(e)+` is not a typed array constructor`)},le=function(e,t,n,a){if(r){if(n)for(var o in ne){var c=i[o];if(c&&s(c.prototype,e))try{delete c.prototype[e]}catch{try{c.prototype[e]=t}catch{}}}(!E[e]||n)&&d(E,e,n?t:M&&S[e]||t,a)}},ue=function(e,t,n){var a,o;if(r){if(h){if(n){for(a in ne)if(o=i[a],o&&s(o,e))try{delete o[e]}catch{}}if(!T[e]||n)try{return d(T,e,n?t:M&&T[e]||t)}catch{}else return}for(a in ne)o=i[a],o&&(!o[e]||n)&&d(o,e,t)}};for(P in ne)ee=i[P],te=ee&&ee.prototype,te?y(te)[j]=ee:M=!1;for(P in re)ee=i[P],te=ee&&ee.prototype,te&&(y(te)[j]=ee);if((!M||!a(T)||T===Function.prototype)&&(T=function(){throw new O(`Incorrect invocation`)},M))for(P in ne)i[P]&&h(i[P],T);if((!M||!E||E===D)&&(E=T.prototype,M))for(P in ne)i[P]&&h(i[P].prototype,E);if(M&&m(w)!==E&&h(w,E),r&&!s(E,k))for(P in N=!0,f(E,k,{configurable:!0,get:function(){return o(this)?this[A]:void 0}}),ne)i[P]&&u(i[P].prototype,A,P);e.exports={NATIVE_ARRAY_BUFFER_VIEWS:M,TYPED_ARRAY_TAG:N&&A,aTypedArray:se,aTypedArrayConstructor:ce,exportTypedArrayMethod:le,exportTypedArrayStaticMethod:ue,getTypedArrayConstructor:ae,isView:ie,isTypedArray:oe,TypedArray:T,TypedArrayPrototype:E}}),er=B.cw(function(e,t){var n=bi();e.exports=function(e,t,r){for(var i=0,a=arguments.length>2?r:n(t),o=new e(a);a>i;)o[i]=t[i++];return o}}),tr=B.cw(function(e,t){var n=da(),r=la(),i=bi(),a=function(e){return function(t,a,o){var s=n(t),c=i(s);if(c===0)return!e&&-1;var l=r(o,c),u;if(e&&a!==a){for(;c>l;)if(u=s[l++],u!==u)return!0}else for(;c>l;l++)if((e||l in s)&&s[l]===a)return e||l||0;return!e&&-1}};e.exports={includes:a(!0),indexOf:a(!1)}}),nr=B.cw(function(e,t){var n=vr(),r=ei(),i=TypeError,a=Object.getOwnPropertyDescriptor;e.exports=n&&!function(){if(this!==void 0)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(e){return e instanceof TypeError}}()?function(e,t){if(r(e)&&!a(e,`length`).writable)throw new i(`Cannot set read only .length`);return e.length=t}:function(e,t){return e.length=t}}),rr=B.cw(function(e,t){e.exports=Fr()([].slice)}),ir=()=>B(804),ar=B.cw(function(e,t){var n=qn(),r=mi();e.exports=function(e,t,i,a){try{return a?t(n(i)[0],i[1]):t(i)}catch(t){r(e,`throw`,t)}}}),or=B.cw(function(e,t){var n=Fr(),r=n({}.toString),i=n(``.slice);e.exports=function(e){return i(r(e),8,-1)}}),sr=B.cw(function(e,t){var n=va(),r=ni(),i=or(),a=Aa()(`toStringTag`),o=Object,s=i(function(){return arguments}())===`Arguments`,c=function(e,t){try{return e[t]}catch{}};e.exports=n?i:function(e){var t,n,l;return e===void 0?`Undefined`:e===null?`Null`:typeof(n=c(t=o(e),a))==`string`?n:s?i(t):(l=i(t))===`Object`&&r(t.callee)?`Arguments`:l}}),cr=B.cw(function(e,t){var n=Gr(),r=Bi(),i=Ai(),a=ki();e.exports=function(e,t,o){for(var s=r(t),c=a.f,l=i.f,u=0;u<s.length;u++){var d=s[u];!n(e,d)&&!(o&&n(o,d))&&c(e,d,l(t,d))}}}),lr=B.cw(function(e,t){e.exports=!Dr()(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype})}),ur=()=>B(529),dr=B.cw(function(e,t){var n=vr(),r=ki(),i=fr();e.exports=n?function(e,t,n){return r.f(e,t,i(1,n))}:function(e,t,n){return e[t]=n,e}}),fr=B.cw(function(e,t){e.exports=function(e,t){return{enumerable:!(e&1),configurable:!(e&2),writable:!(e&4),value:t}}}),pr=B.cw(function(e,t){var n=vr(),r=ki(),i=fr();e.exports=function(e,t,a){n?r.f(e,t,i(0,a)):e[t]=a}}),mr=B.cw(function(e,t){var n=xi(),r=ki();e.exports=function(e,t,i){return i.get&&n(i.get,t,{getter:!0}),i.set&&n(i.set,t,{setter:!0}),r.f(e,t,i)}}),hr=B.cw(function(e,t){var n=ni(),r=ki(),i=xi(),a=_r();e.exports=function(e,t,o,s){s||={};var c=s.enumerable,l=s.name===void 0?t:s.name;if(n(o)&&i(o,l,s),s.global)c?e[t]=o:a(t,o);else{try{s.unsafe?e[t]&&(c=!0):delete e[t]}catch{}c?e[t]=o:r.f(e,t,{value:o,enumerable:!1,configurable:!s.nonConfigurable,writable:!s.nonWritable})}return e}}),gr=B.cw(function(e,t){var n=hr();e.exports=function(e,t,r){for(var i in t)n(e,i,t[i],r);return e}}),_r=B.cw(function(e,t){var n=Wr(),r=Object.defineProperty;e.exports=function(e,t){try{r(n,e,{value:t,configurable:!0,writable:!0})}catch{n[e]=t}return t}}),vr=B.cw(function(e,t){e.exports=!Dr()(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7})}),yr=B.cw(function(e,t){var n=Wr(),r=ai(),i=n.document,a=r(i)&&r(i.createElement);e.exports=function(e){return a?i.createElement(e):{}}}),br=()=>B(837),xr=()=>B(2),Sr=B.cw(function(e,t){e.exports=[`constructor`,`hasOwnProperty`,`isPrototypeOf`,`propertyIsEnumerable`,`toLocaleString`,`toString`,`valueOf`]}),Cr=B.cw(function(e,t){var n=Wr().navigator,r=n&&n.userAgent;e.exports=r?String(r):``}),wr=B.cw(function(e,t){var n=Wr(),r=Cr(),i=n.process,a=n.Deno,o=i&&i.versions||a&&a.version,s=o&&o.v8,c,l;s&&(c=s.split(`.`),l=c[0]>0&&c[0]<4?1:+(c[0]+c[1])),!l&&r&&(c=r.match(/Edge\/(\d+)/),(!c||c[1]>=74)&&(c=r.match(/Chrome\/(\d+)/),c&&(l=+c[1]))),e.exports=l}),Tr=B.cw(function(e,t){var n=Fr(),r=Error,i=n(``.replace),a=(function(e){return String(new r(e).stack)})(`zxcasd`),o=/\n\s*at [^:]*:[^\n]*/,s=o.test(a);e.exports=function(e,t){if(s&&typeof e==`string`&&!r.prepareStackTrace)for(;t--;)e=i(e,o,``);return e}}),Er=B.cw(function(e,t){var n=Wr(),r=Ai().f,i=dr(),a=hr(),o=_r(),s=cr(),c=ri();e.exports=function(e,t){var l=e.target,u=e.global,d=e.stat,f,p=u?n:d?n[l]||o(l,{}):n[l]&&n[l].prototype,m,h,g,_;if(p)for(m in t){if(g=t[m],e.dontCallGetSet?(_=r(p,m),h=_&&_.value):h=p[m],f=c(u?m:l+(d?`.`:`#`)+m,e.forced),!f&&h!==void 0){if(typeof g==typeof h)continue;s(g,h)}(e.sham||h&&h.sham)&&i(g,`sham`,!0),a(p,m,g,e)}}}),Dr=B.cw(function(e,t){e.exports=function(e){try{return!!e()}catch{return!0}}}),Or=B.cw(function(e,t){var n=Ar(),r=Function.prototype,i=r.apply,a=r.call;e.exports=typeof Reflect==`object`&&Reflect.apply||(n?a.bind(i):function(){return a.apply(i,arguments)})}),kr=B.cw(function(e,t){var n=Pr(),r=Rn(),i=Ar(),a=n(n.bind);e.exports=function(e,t){return r(e),t===void 0?e:i?a(e,t):function(){return e.apply(t,arguments)}}}),Ar=B.cw(function(e,t){e.exports=!Dr()(function(){var e=function(){}.bind();return typeof e!=`function`||e.hasOwnProperty(`prototype`)})}),jr=B.cw(function(e,t){var n=Ar(),r=Function.prototype.call;e.exports=n?r.bind(r):function(){return r.apply(r,arguments)}}),Mr=B.cw(function(e,t){var n=vr(),r=Gr(),i=Function.prototype,a=n&&Object.getOwnPropertyDescriptor,o=r(i,`name`);o&&function(){}.name,e.exports={CONFIGURABLE:o&&(!n||n&&a(i,`name`).configurable)}}),Nr=B.cw(function(e,t){var n=Fr(),r=Rn();e.exports=function(e,t,i){try{return n(r(Object.getOwnPropertyDescriptor(e,t)[i]))}catch{}}}),Pr=B.cw(function(e,t){var n=or(),r=Fr();e.exports=function(e){if(n(e)===`Function`)return r(e)}}),Fr=B.cw(function(e,t){var n=Ar(),r=Function.prototype,i=r.call,a=n&&r.bind.bind(i,i);e.exports=n?a:function(e){return function(){return i.apply(e,arguments)}}}),Ir=()=>B(944),Lr=B.cw(function(e,t){var n=Wr(),r=ni(),i=function(e){return r(e)?e:void 0};e.exports=function(e,t){return arguments.length<2?i(n[e]):n[e]&&n[e][t]}}),Rr=()=>B(767),zr=B.cw(function(e,t){var n=jr(),r=qn(),i=Rr(),a=Vr();e.exports=function(e,t){t&&typeof e==`string`||r(e);var o=a(e);return i(r(o===void 0?e:n(o,e)))}}),Br=B.cw(function(e,t){var n=jr(),r=ni(),i=qn(),a=ba(),o=Vr(),s=TypeError;e.exports=function(e,t){var c=arguments.length<2?o(e):t;if(r(c))return i(n(c,e));throw new s(a(e)+` is not iterable`)}}),Vr=B.cw(function(e,t){var n=or(),r=ii(),i=Hr(),a=Aa()(`iterator`),o=Array.prototype;e.exports=function(e){if(!r(e))return i(e,a)||i(e,`@@iterator`)||(n(e)===`Arguments`?o[a]:void 0)}}),Hr=B.cw(function(e,t){var n=Rn(),r=ii();e.exports=function(e,t){var i=e[t];return r(i)?void 0:n(i)}}),Ur=B.cw(function(e,t){var n=Rn(),r=qn(),i=jr(),a=fa(),o=Rr(),s=`Invalid size`,c=RangeError,l=TypeError,u=Math.max,d=function(e,t){this.set=e,this.size=u(t,0),this.has=n(e.has),this.keys=n(e.keys)};d.prototype={getIterator:function(){return o(r(i(this.keys,this.set)))},includes:function(e){return i(this.has,this.set,e)}},e.exports=function(e){r(e);var t=+e.size;if(t!==t)throw new l(s);var n=a(t);if(n<0)throw new c(s);return new d(e,n)}}),Wr=B.cw(function(e,t){var n=function(e){return e&&e.Math===Math&&e};e.exports=n(typeof globalThis==`object`&&globalThis)||n(typeof window==`object`&&window)||n(typeof self==`object`&&self)||n(typeof global==`object`&&global)||n(typeof this==`object`&&this)||(function(){return this})()||Function(`return this`)()}),Gr=B.cw(function(e,t){var n=Fr(),r=ma(),i=n({}.hasOwnProperty);e.exports=Object.hasOwn||function(e,t){return i(r(e),t)}}),Kr=B.cw(function(e,t){e.exports={}}),qr=B.cw(function(e,t){e.exports=Lr()(`document`,`documentElement`)}),Jr=B.cw(function(e,t){var n=vr(),r=Dr(),i=yr();e.exports=!n&&!r(function(){return Object.defineProperty(i(`div`),"a",{get:function(){return 7}}).a!==7})}),Yr=B.cw(function(e,t){var n=Fr(),r=Dr(),i=or(),a=Object,o=n(``.split);e.exports=r(function(){return!a(`z`).propertyIsEnumerable(0)})?function(e){return i(e)===`String`?o(e,``):a(e)}:a}),Xr=B.cw(function(e,t){var n=ni(),r=ai(),i=Ri();e.exports=function(e,t,a){var o,s;return i&&n(o=t.constructor)&&o!==a&&r(s=o.prototype)&&s!==a.prototype&&i(e,s),e}}),Zr=B.cw(function(e,t){var n=Fr(),r=ni(),i=aa(),a=n(Function.toString);r(i.inspectSource)||(i.inspectSource=function(e){return a(e)}),e.exports=i.inspectSource}),Qr=B.cw(function(e,t){var n=Oa(),r=Wr(),i=ai(),a=dr(),o=Gr(),s=aa(),c=ia(),l=Kr(),u=`Object already initialized`,d=r.TypeError,f=r.WeakMap,p,m,h,g=function(e){return h(e)?m(e):p(e,{})},_=function(e){return function(t){var n;if(!i(t)||(n=m(t)).type!==e)throw new d(`Incompatible receiver, `+e+` required`);return n}};if(n||s.state){var v=s.state||=new f;v.get=v.get,v.has=v.has,v.set=v.set,p=function(e,t){if(v.has(e))throw new d(u);return t.facade=e,v.set(e,t),t},m=function(e){return v.get(e)||{}},h=function(e){return v.has(e)}}else{var y=c(`state`);l[y]=!0,p=function(e,t){if(o(e,y))throw new d(u);return t.facade=e,a(e,y,t),t},m=function(e){return o(e,y)?e[y]:{}},h=function(e){return o(e,y)}}e.exports={set:p,get:m,has:h,enforce:g,getterFor:_}}),$r=B.cw(function(e,t){var n=Aa(),r=yi(),i=n(`iterator`),a=Array.prototype;e.exports=function(e){return e!==void 0&&(r.Array===e||a[i]===e)}}),ei=B.cw(function(e,t){var n=or();e.exports=Array.isArray||function(e){return n(e)===`Array`}}),ti=B.cw(function(e,t){var n=sr();e.exports=function(e){var t=n(e);return t===`BigInt64Array`||t===`BigUint64Array`}}),ni=B.cw(function(e,t){var n=typeof document==`object`&&document.all;e.exports=n===void 0&&n!==void 0?function(e){return typeof e==`function`||e===n}:function(e){return typeof e==`function`}}),ri=B.cw(function(e,t){var n=Dr(),r=ni(),i=/#|\.prototype\./,a=function(e,t){var i=s[o(e)];return i===l?!0:i===c?!1:r(t)?n(t):!!t},o=a.normalize=function(e){return String(e).replace(i,`.`).toLowerCase()},s=a.data={},c=a.NATIVE=`N`,l=a.POLYFILL=`P`;e.exports=a}),ii=()=>B(117),ai=B.cw(function(e,t){var n=ni();e.exports=function(e){return typeof e==`object`?e!==null:n(e)}}),oi=B.cw(function(e,t){var n=ai();e.exports=function(e){return n(e)||e===null}}),si=B.cw(function(e,t){e.exports=!1}),ci=B.cw(function(e,t){var n=ai(),r=Qr().get;e.exports=function(e){if(!n(e))return!1;var t=r(e);return!!t&&t.type===`RawJSON`}}),li=B.cw(function(e,t){var n=Lr(),r=ni(),i=Pi(),a=Ta(),o=Object;e.exports=a?function(e){return typeof e==`symbol`}:function(e){var t=n(`Symbol`);return r(t)&&i(t.prototype,o(e))}}),ui=B.cw(function(e,t){var n=jr();e.exports=function(e,t,r){for(var i=r?e:e.iterator,a=e.next,o,s;!(o=n(a,i)).done;)if(s=t(o.value),s!==void 0)return s}}),di=B.cw(function(e,t){var n=kr(),r=jr(),i=qn(),a=ba(),o=$r(),s=bi(),c=Pi(),l=Br(),u=Vr(),d=mi(),f=TypeError,p=function(e,t){this.stopped=e,this.result=t},m=p.prototype;e.exports=function(e,t,h){var g=h&&h.that,_=!!(h&&h.AS_ENTRIES),v=!!(h&&h.IS_RECORD),y=!!(h&&h.IS_ITERATOR),b=!!(h&&h.INTERRUPTED),x=n(t,g),S,C,w,T,E,D,O,k=function(e){var t=S;return S=void 0,t&&d(t,`normal`),new p(!0,e)},A=function(e){return _?(i(e),b?x(e[0],e[1],k):x(e[0],e[1])):b?x(e,k):x(e)};if(v)S=e.iterator;else if(y)S=e;else{if(C=u(e),!C)throw new f(a(e)+` is not iterable`);if(o(C)){for(w=0,T=s(e);T>w;w++)if(E=A(e[w]),E&&c(m,E))return E;return new p(!1)}S=l(e,C)}for(D=v?e.next:S.next;!(O=r(D,S)).done;){var j=O.value;try{E=A(j)}catch(e){if(S)d(S,`throw`,e);else throw e}if(typeof E==`object`&&E&&c(m,E))return E}return new p(!1)}}),fi=()=>B(859),pi=B.cw(function(e,t){var n=mi();e.exports=function(e,t,r){for(var i=e.length-1;i>=0;i--)if(e[i]!==void 0)try{r=n(e[i].iterator,t,r)}catch(e){t=`throw`,r=e}if(t===`throw`)throw r;return r}}),mi=B.cw(function(e,t){var n=jr(),r=qn(),i=Hr();e.exports=function(e,t,a){var o,s;r(e);try{if(o=i(e,`return`),!o){if(t===`throw`)throw a;return a}o=n(o,e)}catch(e){s=!0,o=e}if(t===`throw`)throw a;if(s)throw o;return r(o),a}}),hi=B.cw(function(e,t){var n=jr(),r=Di(),i=dr(),a=gr(),o=Aa(),s=Qr(),c=Hr(),l=vi().IteratorPrototype,u=ur(),d=mi(),f=pi(),p=fi(),m=o(`toStringTag`),h=`IteratorHelper`,g=`WrapForValidIterator`,_=`normal`,v=`throw`,y=s.set,b=function(e){var t=s.getterFor(e?g:h);return a(r(l),{next:function(){var n=t(this);if(e)return n.nextHandler();if(n.done)return u(void 0,!0);try{var r=n.nextHandler();return n.done&&p(n),n.returnHandlerResult?r:u(r,n.done)}catch(e){throw n.done=!0,p(n),e}},return:function(){var r=t(this),i=r.iterator,a=r.inner,o=r.openIters,s=r.done;if(r.done=!0,e){var l=c(i,`return`);return l?n(l,i):u(void 0,!0)}if(p(r),s)return u(void 0,!0);if(a)try{d(a.iterator,_)}catch(e){return d(i,v,e)}if(o)try{f(o,_)}catch(e){if(i)return d(i,v,e);throw e}return i&&d(i,_),u(void 0,!0)}})},x=b(!0),S=b(!1);i(S,m,`Iterator Helper`),e.exports=function(e,t,n){var r=function(r,i){i?(i.iterator=r.iterator,i.next=r.next):i=r,i.type=t?g:h,i.returnHandlerResult=!!n,i.nextHandler=e,i.counter=0,i.done=!1,y(this,i)};return r.prototype=t?x:S,r}}),gi=()=>B(684),_i=B.cw(function(e,t){var n=Wr();e.exports=function(e,t){var r=n.Iterator,i=r&&r.prototype,a=i&&i[e],o=!1;if(a)try{a.call({next:function(){return{done:!0}},return:function(){o=!0}},-1)}catch(e){e instanceof t||(o=!1)}if(!o)return a}}),vi=B.cw(function(e,t){var n=Dr(),r=ni(),i=ai(),a=Di(),o=Ni(),s=hr(),c=Aa(),l=si(),u=c(`iterator`),d,f,p;[].keys&&(p=[].keys(),`next`in p&&(f=o(o(p)),f!==Object.prototype&&(d=f))),!i(d)||n(function(){var e={};return d[u].call(e)!==e})?d={}:l&&(d=a(d)),r(d[u])||s(d,u,function(){return this}),e.exports={IteratorPrototype:d}}),yi=()=>B(269),bi=B.cw(function(e,t){var n=pa();e.exports=function(e){return n(e.length)}}),xi=B.cw(function(e,t){var n=Fr(),r=Dr(),i=ni(),a=Gr(),o=vr(),s=Mr().CONFIGURABLE,c=Zr(),l=Qr(),u=l.enforce,d=l.get,f=String,p=Object.defineProperty,m=n(``.slice),h=n(``.replace),g=n([].join),_=o&&!r(function(){return p(function(){},`length`,{value:8}).length!==8}),v=String(String).split(`String`),y=e.exports=function(e,t,n){m(f(t),0,7)===`Symbol(`&&(t=`[`+h(f(t),/^Symbol\(([^)]*)\).*$/,`$1`)+`]`),n&&n.getter&&(t=`get `+t),n&&n.setter&&(t=`set `+t),(!a(e,`name`)||s&&e.name!==t)&&(o?p(e,`name`,{value:t,configurable:!0}):e.name=t),_&&n&&a(n,`arity`)&&e.length!==n.arity&&p(e,`length`,{value:n.arity});try{n&&a(n,`constructor`)&&n.constructor?o&&p(e,`prototype`,{writable:!1}):e.prototype&&=void 0}catch{}var r=u(e);return a(r,`source`)||(r.source=g(v,typeof t==`string`?t:``)),e};Function.prototype.toString=y(function(){return i(this)&&d(this).source||c(this)},`toString`)}),Si=B.cw(function(e,t){var n=Fr(),r=Map.prototype;e.exports={Map,set:n(r.set),get:n(r.get),has:n(r.has),remove:n(r.delete),proto:r}}),Ci=B.cw(function(e,t){e.exports=!Dr()(function(){var e=`9007199254740993`,t=JSON.rawJSON(e);return!JSON.isRawJSON(t)||JSON.stringify(t)!==e})}),wi=B.cw(function(e,t){var n=Rn(),r=TypeError,i=function(e){var t,i;this.promise=new e(function(e,n){if(t!==void 0||i!==void 0)throw new r(`Bad Promise constructor`);t=e,i=n}),this.resolve=n(t),this.reject=n(i)};e.exports.f=function(e){return new i(e)}}),Ti=B.cw(function(e,t){var n=ya();e.exports=function(e,t){return e===void 0?arguments.length<2?``:t:n(e)}}),Ei=()=>B(149),Di=B.cw(function(e,t){var n=qn(),r=Oi(),i=Sr(),a=Kr(),o=qr(),s=yr(),c=ia(),l=`>`,u=`<`,d=`prototype`,f=`script`,p=c(`IE_PROTO`),m=function(){},h=function(e){return u+f+l+e+u+`/`+f+l},g=function(e){e.write(h(``)),e.close();var t=e.parentWindow.Object;return e=null,t},_=function(){var e=s(`iframe`),t=`java`+f+`:`,n;return e.style.display=`none`,o.appendChild(e),e.src=String(t),n=e.contentWindow.document,n.open(),n.write(h(`document.F=Object`)),n.close(),n.F},v,y=function(){try{v=new ActiveXObject(`htmlfile`)}catch{}y=typeof document<`u`?document.domain&&v?g(v):_():g(v);for(var e=i.length;e--;)delete y[d][i[e]];return y()};a[p]=!0,e.exports=Object.create||function(e,t){var i;return e===null?i=y():(m[d]=n(e),i=new m,m[d]=null,i[p]=e),t===void 0?i:r.f(i,t)}}),Oi=B.cw(function(e,t){var n=vr(),r=Ea(),i=ki(),a=qn(),o=da(),s=Ii();t.f=n&&!r?Object.defineProperties:function(e,t){a(e);for(var n=o(t),r=s(t),c=r.length,l=0,u;c>l;)i.f(e,u=r[l++],n[u]);return e}}),ki=B.cw(function(e,t){var n=vr(),r=Jr(),i=Ea(),a=qn(),o=_a(),s=TypeError,c=Object.defineProperty,l=Object.getOwnPropertyDescriptor,u=`enumerable`,d=`configurable`,f=`writable`;t.f=n?i?function(e,t,n){if(a(e),t=o(t),a(n),typeof e==`function`&&t===`prototype`&&`value`in n&&f in n&&!n[f]){var r=l(e,t);r&&r[f]&&(e[t]=n.value,n={configurable:d in n?n[d]:r[d],enumerable:u in n?n[u]:r[u],writable:!1})}return c(e,t,n)}:c:function(e,t,n){if(a(e),t=o(t),a(n),r)try{return c(e,t,n)}catch{}if(`get`in n||`set`in n)throw new s(`Accessors not supported`);return`value`in n&&(e[t]=n.value),e}}),Ai=B.cw(function(e,t){var n=vr(),r=jr(),i=Li(),a=fr(),o=da(),s=_a(),c=Gr(),l=Jr(),u=Object.getOwnPropertyDescriptor;t.f=n?u:function(e,t){if(e=o(e),t=s(t),l)try{return u(e,t)}catch{}if(c(e,t))return a(!r(i.f,e,t),e[t])}}),ji=B.cw(function(e,t){var n=Fi(),r=Sr().concat(`length`,`prototype`);t.f=Object.getOwnPropertyNames||function(e){return n(e,r)}}),Mi=()=>B(717),Ni=B.cw(function(e,t){var n=Gr(),r=ni(),i=ma(),a=ia(),o=lr(),s=a(`IE_PROTO`),c=Object,l=c.prototype;e.exports=o?c.getPrototypeOf:function(e){var t=i(e);if(n(t,s))return t[s];var a=t.constructor;return r(a)&&t instanceof a?a.prototype:t instanceof c?l:null}}),Pi=B.cw(function(e,t){e.exports=Fr()({}.isPrototypeOf)}),Fi=B.cw(function(e,t){var n=Fr(),r=Gr(),i=da(),a=tr().indexOf,o=Kr(),s=n([].push);e.exports=function(e,t){var n=i(e),c=0,l=[],u;for(u in n)!r(o,u)&&r(n,u)&&s(l,u);for(;t.length>c;)r(n,u=t[c++])&&(~a(l,u)||s(l,u));return l}}),Ii=B.cw(function(e,t){var n=Fi(),r=Sr();e.exports=Object.keys||function(e){return n(e,r)}}),Li=B.cw(function(e,t){var n={}.propertyIsEnumerable,r=Object.getOwnPropertyDescriptor;t.f=r&&!n.call({1:2},1)?function(e){var t=r(this,e);return!!t&&t.enumerable}:n}),Ri=B.cw(function(e,t){var n=Nr(),r=ai(),i=Wi(),a=zn();e.exports=Object.setPrototypeOf||(`__proto__`in{}?function(){var e=!1,t={},o;try{o=n(Object.prototype,`__proto__`,`set`),o(t,[]),e=t instanceof Array}catch{}return function(t,n){return i(t),a(n),r(t)&&(e?o(t,n):t.__proto__=n),t}}():void 0)}),zi=B.cw(function(e,t){var n=jr(),r=ni(),i=ai(),a=TypeError;e.exports=function(e,t){var o,s;if(t===`string`&&r(o=e.toString)&&!i(s=n(o,e))||r(o=e.valueOf)&&!i(s=n(o,e))||t!==`string`&&r(o=e.toString)&&!i(s=n(o,e)))return s;throw new a(`Can't convert object to primitive value`)}}),Bi=B.cw(function(e,t){var n=Lr(),r=Fr(),i=ji(),a=Mi(),o=qn(),s=r([].concat);e.exports=n(`Reflect`,`ownKeys`)||function(e){var t=i.f(o(e)),n=a.f;return n?s(t,n(e)):t}}),Vi=B.cw(function(e,t){var n=Fr(),r=Gr(),i=SyntaxError,a=parseInt,o=String.fromCharCode,s=n(``.charAt),c=n(``.slice),l=n(/./.exec),u={'\\"':`"`,"\\\\":`\\`,"\\/":`/`,"\\b":`\b`,"\\f":`\f`,"\\n":`
2
+ `,"\\r":`\r`,"\\t":` `},d=/^[\da-f]{4}$/i,f=/^[\u0000-\u001F]$/;e.exports=function(e,t){for(var n=!0,p=``;t<e.length;){var m=s(e,t);if(m===`\\`){var h=c(e,t,t+2);if(r(u,h))p+=u[h],t+=2;else if(h===`\\u`){t+=2;var g=c(e,t,t+4);if(!l(d,g))throw new i(`Bad Unicode escape at: `+t);p+=o(a(g,16)),t+=4}else throw new i(`Unknown escape sequence: "`+h+`"`)}else if(m===`"`){n=!1,t++;break}else{if(l(f,m))throw new i(`Bad control character in string literal at: `+t);p+=m,t++}}if(n)throw new i(`Unterminated string at: `+t);return{value:p,end:t}}}),Hi=()=>B(103),Ui=B.cw(function(e,t){var n=qn(),r=ai(),i=wi();e.exports=function(e,t){if(n(e),r(t)&&t.constructor===e)return t;var a=i.f(e),o=a.resolve;return o(t),a.promise}}),Wi=()=>B(750),Gi=B.cw(function(e,t){var n=qi(),r=Qi(),i=n.Set,a=n.add;e.exports=function(e){var t=new i;return r(e,function(e){a(t,e)}),t}}),Ki=B.cw(function(e,t){var n=Bn(),r=qi(),i=Gi(),a=ta(),o=Ur(),s=Qi(),c=ui(),l=r.has,u=r.remove;e.exports=function(e){var t=n(this),r=o(e),d=i(t);return a(d)<=r.size?s(d,function(e){r.includes(e)&&u(d,e)}):c(r.getIterator(),function(e){l(d,e)&&u(d,e)}),d}}),qi=B.cw(function(e,t){var n=Fr(),r=Set.prototype;e.exports={Set,add:n(r.add),has:n(r.has),remove:n(r.delete),proto:r}}),Ji=B.cw(function(e,t){var n=Bn(),r=qi(),i=ta(),a=Ur(),o=Qi(),s=ui(),c=r.Set,l=r.add,u=r.has;e.exports=function(e){var t=n(this),r=a(e),d=new c;return i(t)>r.size?s(r.getIterator(),function(e){u(t,e)&&l(d,e)}):o(t,function(e){r.includes(e)&&l(d,e)}),d}}),Yi=B.cw(function(e,t){var n=Bn(),r=qi().has,i=ta(),a=Ur(),o=Qi(),s=ui(),c=mi();e.exports=function(e){var t=n(this),l=a(e);if(i(t)<=l.size)return o(t,function(e){if(l.includes(e))return!1},!0)!==!1;var u=l.getIterator();return s(u,function(e){if(r(t,e))return c(u.iterator,`normal`,!1)})!==!1}}),Xi=B.cw(function(e,t){var n=Bn(),r=ta(),i=Qi(),a=Ur();e.exports=function(e){var t=n(this),o=a(e);return r(t)>o.size?!1:i(t,function(e){if(!o.includes(e))return!1},!0)!==!1}}),Zi=B.cw(function(e,t){var n=Bn(),r=qi().has,i=ta(),a=Ur(),o=ui(),s=mi();e.exports=function(e){var t=n(this),c=a(e);if(i(t)<c.size)return!1;var l=c.getIterator();return o(l,function(e){if(!r(t,e))return s(l.iterator,`normal`,!1)})!==!1}}),Qi=B.cw(function(e,t){var n=Fr(),r=ui(),i=qi(),a=i.Set,o=i.proto,s=n(o.forEach),c=n(o.keys),l=c(new a).next;e.exports=function(e,t,n){return n?r({iterator:c(e),next:l},t):s(e,t)}}),$i=B.cw(function(e,t){var n=Lr(),r=function(e){return{size:e,has:function(){return!1},keys:function(){return{next:function(){return{done:!0}}}}}},i=function(e){return{size:e,has:function(){return!0},keys:function(){throw Error(`e`)}}};e.exports=function(e,t){var a=n(`Set`);try{new a()[e](r(0));try{return new a()[e](r(-1)),!1}catch{if(!t)return!0;try{return new a()[e](i(-1/0)),!1}catch{return t(new a([1,2])[e](i(1/0)))}}}catch{return!1}}}),ea=()=>B(835),ta=B.cw(function(e,t){e.exports=Nr()(qi().proto,`size`,`get`)||function(e){return e.size}}),na=B.cw(function(e,t){var n=Bn(),r=qi(),i=Gi(),a=Ur(),o=ui(),s=r.add,c=r.has,l=r.remove;e.exports=function(e){var t=n(this),r=a(e).getIterator(),u=i(t);return o(r,function(e){c(t,e)?l(u,e):s(u,e)}),u}}),ra=B.cw(function(e,t){var n=Bn(),r=qi().add,i=Gi(),a=Ur(),o=ui();e.exports=function(e){var t=n(this),s=a(e).getIterator(),c=i(t);return o(s,function(e){r(c,e)}),c}}),ia=B.cw(function(e,t){var n=oa(),r=xa(),i=n(`keys`);e.exports=function(e){return i[e]||(i[e]=r(e))}}),aa=B.cw(function(e,t){var n=si(),r=Wr(),i=_r(),a=`__core-js_shared__`,o=e.exports=r[a]||i(a,{});(o.versions||=[]).push({version:`3.50.0`,mode:n?`pure`:`global`,copyright:`© 2013–2025 Denis Pushkarev (zloirock.ru), 2025–2026 CoreJS Company (core-js.io). All rights reserved.`,license:`https://github.com/zloirock/core-js/blob/v3.50.0/LICENSE`,source:`https://github.com/zloirock/core-js`})}),oa=B.cw(function(e,t){var n=aa(),r=Object.create||Object;e.exports=function(e,t){return n[e]||(n[e]=t||r(null))}}),sa=B.cw(function(e,t){var n=wr(),r=Dr(),i=Wr().String;e.exports=!!Object.getOwnPropertySymbols&&!r(function(){var e=Symbol(`symbol detection`);return!i(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&n&&n<41})}),ca=B.cw(function(e,t){e.exports=Fr()(1.1.valueOf)}),la=B.cw(function(e,t){var n=fa(),r=Math.max,i=Math.min;e.exports=function(e,t){var a=n(e);return a<0?r(a+t,0):i(a,t)}}),ua=B.cw(function(e,t){var n=ga(),r=TypeError;e.exports=function(e){var t=n(e,`number`);if(typeof t==`number`)throw new r(`Can't convert number to bigint`);return BigInt(t)}}),da=B.cw(function(e,t){var n=Yr(),r=Wi();e.exports=function(e){return n(r(e))}}),fa=()=>B(291),pa=()=>B(14),ma=()=>B(981),ha=()=>B(590),ga=B.cw(function(e,t){var n=jr(),r=ai(),i=li(),a=Hr(),o=zi(),s=Aa(),c=TypeError,l=s(`toPrimitive`);e.exports=function(e,t){if(!r(e)||i(e))return e;var s=a(e,l),u;if(s){if(t===void 0&&(t=`default`),u=n(s,e,t),!r(u)||i(u))return u;throw new c(`Can't convert object to primitive value`)}return t===void 0&&(t=`number`),o(e,t)}}),_a=B.cw(function(e,t){var n=ga(),r=li();e.exports=function(e){var t=n(e,`string`);return r(t)?t:t+``}}),va=B.cw(function(e,t){var n=Aa()(`toStringTag`),r={};r[n]=`z`,e.exports=String(r)===`[object z]`}),ya=B.cw(function(e,t){var n=sr(),r=String;e.exports=function(e){if(n(e)===`Symbol`)throw TypeError(`Cannot convert a Symbol value to a string`);return r(e)}}),ba=B.cw(function(e,t){var n=String;e.exports=function(e){try{return n(e)}catch{return`Object`}}}),xa=B.cw(function(e,t){var n=Fr(),r=0,i=Math.random(),a=n(1.1.toString);e.exports=function(e){return`Symbol(`+(e===void 0?``:e)+`)_`+a(++r+i,36)}}),Sa=B.cw(function(e,t){var n=Wr(),r=Fr(),i=Kn(),a=Vn(),o=Gr(),s=ir(),c=Ir(),l=Qn(),u=s.c2i,d=s.c2iUrl,f=n.SyntaxError,p=n.TypeError,m=n.Array,h=r(``.charAt),g=Math.floor,_=function(e,t){for(var n=e.length;t<n;t++){var r=h(e,t);if(r!==` `&&r!==` `&&r!==`
3
+ `&&r!==`\f`&&r!==`\r`)break}return t},v=function(e,t,n){var r=e.length;r<4&&(e+=r===2?`AA`:`A`);var i=(t[h(e,0)]<<18)+(t[h(e,1)]<<12)+(t[h(e,2)]<<6)+t[h(e,3)],a=[i>>16&255,i>>8&255,i&255];if(r===2){if(n&&a[1]!==0)throw new f(`Extra bits`);return[a[0]]}if(r===3){if(n&&a[2]!==0)throw new f(`Extra bits`);return[a[0],a[1]]}return a},y=function(e,t,n){for(var r=t.length,i=0;i<r;i++)e[n+i]=t[i];return n+r};e.exports=function(e,t,n,r){a(e),i(t);var s=c(t)===`base64`?u:d,b=t?t.lastChunkHandling:void 0;if(b===void 0&&(b=`loose`),b!==`loose`&&b!==`strict`&&b!==`stop-before-partial`)throw new p("Incorrect `lastChunkHandling` option");n&&l(n.buffer);var x=e.length,S=n||m(g(x*3/4)),C=0,w=0,T=``,E=0;if(r)for(;;){if(E=_(e,E),E===x){if(T.length>0){if(b===`stop-before-partial`)break;if(b===`loose`){if(T.length===1)throw new f(`Malformed padding: exactly one additional character`);C=y(S,v(T,s,!1),C)}else throw new f(`Missing padding`)}w=x;break}var D=h(e,E);if(++E,D===`=`){if(T.length<2)throw new f(`Padding is too early`);if(E=_(e,E),T.length===2){if(E===x){if(b===`stop-before-partial`)break;throw new f(`Malformed padding: only one =`)}h(e,E)===`=`&&(++E,E=_(e,E))}if(E<x)throw new f(`Unexpected character after padding`);C=y(S,v(T,s,b===`strict`),C),w=x;break}if(!o(s,D))throw new f(`Unexpected character`);var O=r-C;if(O===1&&T.length===2||O===2&&T.length===3||(T+=D,T.length===4&&(C=y(S,v(T,s,!1),C),T=``,w=E,C===r)))break}return n||(S.length=C),{bytes:S,read:w,written:C}}}),Ca=B.cw(function(e,t){var n=Wr(),r=Fr(),i=n.Uint8Array,a=n.SyntaxError,o=Math.min,s=r(``.match);e.exports=function(e,t){var n=e.length;if(n%2!=0)throw new a(`String should be an even number of characters`);for(var r=t?o(t.length,n/2):n/2,c=t||new i(r),l=s(e,/[\S\s]{2}/g),u=0;u<r;u++){var d=+(`0x`+l[u]+`0`);if(d!==d)throw new a(`String should only contain hex characters`);c[u]=d>>4}return{bytes:c,read:u<<1}}}),wa=B.cw(function(e,t){var n=Dr(),r=Aa(),i=vr(),a=si(),o=r(`iterator`);e.exports=!n(function(){var e=new URL(`b?a=1&b=2&c=3`,`https://a`),t=e.searchParams,n=new URLSearchParams(`a=1&a=2&b=3`),r=``;return e.pathname=`c%20d`,t.forEach(function(e,n){t.delete(`b`),r+=n+e}),n.delete(`a`,2),n.delete(`b`,void 0),a&&(!e.toJSON||!n.has(`a`,1)||n.has(`a`,2)||!n.has(`a`,void 0)||n.has(`b`))||!t.size&&(a||!i)||!t.sort||e.href!==`https://a/c%20d?a=1&c=3`||t.get(`c`)!==`3`||String(new URLSearchParams(`?a=1`))!==`a=1`||!t[o]||new URL(`https://a@b`).username!==`a`||new URLSearchParams(new URLSearchParams(`a=b`)).get(`a`)!==`b`||new URL(`https://тест`).host!==`xn--e1aybc`||new URL(`https://a#б`).hash!==`#%D0%B1`||r!==`a1c3`||new URL(`https://x`,void 0).host!==`x`})}),Ta=B.cw(function(e,t){e.exports=sa()&&!Symbol.sham&&typeof Symbol.iterator==`symbol`}),Ea=B.cw(function(e,t){var n=vr(),r=Dr();e.exports=n&&r(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42})}),Da=()=>B(812),Oa=B.cw(function(e,t){var n=Wr(),r=ni(),i=n.WeakMap;e.exports=r(i)&&/native code/.test(String(i))}),ka=B.cw(function(e,t){var n=Fr(),r=WeakMap.prototype;e.exports={WeakMap,set:n(r.set),get:n(r.get),has:n(r.has),remove:n(r.delete)}}),Aa=B.cw(function(e,t){var n=Wr(),r=oa(),i=Gr(),a=xa(),o=sa(),s=Ta(),c=n.Symbol,l=r(`wks`),u=s?c.for||c:c&&c.withoutSetter||a;e.exports=function(e){return i(l,e)||(l[e]=o&&i(c,e)?c[e]:u(`Symbol.`+e)),l[e]}}),ja=B.cw(function(e,t){var n=Er(),r=tr().includes,i=Dr(),a=Wn(),o=i(function(){return![,].includes()}),s=i(function(){return[,1].includes(void 0,1)});n({target:`Array`,proto:!0,forced:o||s},{includes:function(e){return r(this,e,arguments.length>1?arguments[1]:void 0)}}),a(`includes`)}),Ma=B.cw(function(e,t){var n=Er(),r=ma(),i=bi(),a=nr(),o=br();n({target:`Array`,proto:!0,arity:1,forced:Dr()(function(){return[].push.call({length:4294967296},1)!==4294967297})||!function(){try{Object.defineProperty([],"length",{writable:!1}).push()}catch(e){return e instanceof TypeError}}()},{push:function(e){var t=r(this),n=i(t),s=arguments.length;o(n+s);for(var c=0;c<s;c++)t[n]=arguments[c],n++;return a(t,n),n}})}),Na=B.cw(function(e,t){var n=Er(),r=Wr(),i=Gn(),a=qn(),o=ni(),s=Ni(),c=mr(),l=pr(),u=Dr(),d=Gr(),f=Aa(),p=vi().IteratorPrototype,m=vr(),h=si(),g=`constructor`,_=`Iterator`,v=f(`toStringTag`),y=TypeError,b=r[_],x=h||!o(b)||b.prototype!==p||!u(function(){b({})}),S=function(){if(i(this,p),s(this)===p)throw new y(`Abstract class Iterator not directly constructable`)},C=function(e,t){m?c(p,e,{configurable:!0,get:function(){return t},set:function(t){if(a(this),this===p)throw new y(`You can't redefine this property`);d(this,e)?this[e]=t:l(this,e,t)}}):p[e]=t};d(p,v)||C(v,_),(x||!d(p,g)||p[g]===Object)&&C(g,S),S.prototype=p,n({global:!0,constructor:!0,forced:x},{Iterator:S})}),Pa=B.cw(function(e,t){var n=Er(),r=jr(),i=qn(),a=Rr(),o=Ei(),s=ha(),c=mi(),l=hi(),u=gi(),d=_i(),f=si(),p=RangeError,m=1/0,h=!f&&!u(`drop`,0),g=!f&&!h&&d(`drop`,RangeError),_=f||h||g||!function(){try{Iterator.prototype.drop.call({next:function(){return{done:!0}}},9007199254740992)}catch(e){return e instanceof p}}(),v=l(function(){for(var e=this.iterator,t=this.next,n,a;this.remaining;)if(this.remaining--,n=i(r(t,e)),a=this.done=!!n.done,a)return;if(n=i(r(t,e)),a=this.done=!!n.done,!a)return n.value});n({target:`Iterator`,proto:!0,real:!0,forced:_},{drop:function(e){i(this);var t;try{if(t=s(o(+e)),t>9007199254740991&&t!==m)throw new p(`The argument should be a safe integer`)}catch(e){c(this,`throw`,e)}return g?r(g,this,t):new v(a(this),{remaining:t})}})}),Fa=B.cw(function(e,t){var n=Er(),r=jr(),i=di(),a=Rn(),o=qn(),s=Rr(),c=mi(),l=_i()(`every`,TypeError);n({target:`Iterator`,proto:!0,real:!0,forced:l},{every:function(e){o(this);try{a(e)}catch(e){c(this,`throw`,e)}if(l)return r(l,this,e);var t=s(this),n=0;return!i(t,function(t,r){if(!e(t,n++))return r()},{IS_RECORD:!0,INTERRUPTED:!0}).stopped}})}),Ia=B.cw(function(e,t){var n=Er(),r=jr(),i=Rn(),a=qn(),o=Rr(),s=hi(),c=ar(),l=si(),u=mi(),d=gi(),f=_i(),p=!l&&!d(`filter`,function(){}),m=!l&&!p&&f(`filter`,TypeError),h=l||p||m,g=s(function(){for(var e=this.iterator,t=this.predicate,n=this.next,i,o,s;;){if(i=a(r(n,e)),o=this.done=!!i.done,o)return;if(s=i.value,c(e,t,[s,this.counter++],!0))return s}});n({target:`Iterator`,proto:!0,real:!0,forced:h},{filter:function(e){a(this);try{i(e)}catch(e){u(this,`throw`,e)}return m?r(m,this,e):new g(o(this),{predicate:e})}})}),La=B.cw(function(e,t){var n=Er(),r=jr(),i=di(),a=Rn(),o=qn(),s=Rr(),c=mi(),l=_i()(`find`,TypeError);n({target:`Iterator`,proto:!0,real:!0,forced:l},{find:function(e){o(this);try{a(e)}catch(e){c(this,`throw`,e)}if(l)return r(l,this,e);var t=s(this),n=0;return i(t,function(t,r){if(e(t,n++))return r(t)},{IS_RECORD:!0,INTERRUPTED:!0}).result}})}),Ra=B.cw(function(e,t){var n=Er(),r=jr(),i=Rn(),a=qn(),o=Rr(),s=zr(),c=hi(),l=mi(),u=Dr(),d=si(),f=gi(),p=_i(),m=!d&&u(function(){return[1].values().flatMap(function(){return[1]}).find(function(){return!0})!==1}),h=!d&&!m&&!f(`flatMap`,function(){}),g=!d&&!m&&!h&&p(`flatMap`,TypeError),_=d||m||h||g,v=c(function(){for(var e=this.iterator,t=this.mapper,n,i;;){if(i=this.inner)try{if(n=a(r(i.next,i.iterator)),!n.done)return n.value;this.inner=null}catch(t){l(e,`throw`,t)}if(n=a(r(this.next,e)),this.done=!!n.done)return;try{this.inner=s(t(n.value,this.counter++),!1)}catch(t){l(e,`throw`,t)}}});n({target:`Iterator`,proto:!0,real:!0,forced:_},{flatMap:function(e){a(this);try{i(e)}catch(e){l(this,`throw`,e)}return g?r(g,this,e):new v(o(this),{mapper:e,inner:null})}})}),za=B.cw(function(e,t){var n=Er(),r=jr(),i=di(),a=Rn(),o=qn(),s=Rr(),c=mi(),l=_i()(`forEach`,TypeError);n({target:`Iterator`,proto:!0,real:!0,forced:l},{forEach:function(e){o(this);try{a(e)}catch(e){c(this,`throw`,e)}if(l)return r(l,this,e);var t=s(this),n=0;i(t,function(t){e(t,n++)},{IS_RECORD:!0})}})}),Ba=B.cw(function(e,t){var n=Er(),r=jr(),i=Rn(),a=qn(),o=Rr(),s=hi(),c=ar(),l=mi(),u=gi(),d=_i(),f=si(),p=!f&&!u(`map`,function(){}),m=!f&&!p&&d(`map`,TypeError),h=f||p||m,g=s(function(){var e=this.iterator,t=a(r(this.next,e));if(!(this.done=!!t.done))return c(e,this.mapper,[t.value,this.counter++],!0)});n({target:`Iterator`,proto:!0,real:!0,forced:h},{map:function(e){a(this);try{i(e)}catch(e){l(this,`throw`,e)}return m?r(m,this,e):new g(o(this),{mapper:e})}})}),Va=B.cw(function(e,t){var n=Er(),r=jr(),i=di(),a=Rn(),o=qn(),s=Rr(),c=mi(),l=_i()(`some`,TypeError);n({target:`Iterator`,proto:!0,real:!0,forced:l},{some:function(e){o(this);try{a(e)}catch(e){c(this,`throw`,e)}if(l)return r(l,this,e);var t=s(this),n=0;return i(t,function(t,r){if(e(t,n++))return r()},{IS_RECORD:!0,INTERRUPTED:!0}).stopped}})}),Ha=B.cw(function(e,t){var n=Er(),r=jr(),i=qn(),a=Rr(),o=Ei(),s=ha(),c=hi(),l=mi(),u=gi(),d=_i(),f=si(),p=RangeError,m=1/0,h=!f&&!u(`take`,1),g=!f&&!h&&d(`take`,RangeError),_=f||h||g||!function(){try{Iterator.prototype.take.call({next:function(){return{done:!0}}},9007199254740992)}catch(e){return e instanceof p}}(),v=c(function(){var e=this.iterator;if(!this.remaining--)return this.done=!0,l(e,`normal`,void 0);var t=i(r(this.next,e));if(!(this.done=!!t.done))return t.value});n({target:`Iterator`,proto:!0,real:!0,forced:_},{take:function(e){i(this);var t;try{if(t=s(o(+e)),t>9007199254740991&&t!==m)throw new p(`The argument should be a safe integer`)}catch(e){l(this,`throw`,e)}return g?r(g,this,t):new v(a(this),{remaining:t})}})}),Ua=B.cw(function(e,t){var n=Er(),r=qn(),i=pr(),a=di(),o=Rr();n({target:`Iterator`,proto:!0,real:!0},{toArray:function(){var e=[],t=0;return a(o(r(this)),function(n){i(e,t++,n)},{IS_RECORD:!0}),e}})}),Wa=B.cw(function(e,t){var n=Er(),r=vr(),i=Wr(),a=Lr(),o=Fr(),s=jr(),c=ni(),l=ai(),u=ei(),d=Gr(),f=ya(),p=bi(),m=pr(),h=Dr(),g=Vi(),_=sa(),v=i.JSON,y=i.Number,b=i.SyntaxError,x=v&&v.parse,S=a(`Object`,`keys`),C=Object.getOwnPropertyDescriptor,w=o(``.charAt),T=o(``.slice),E=o(/./.exec),D=o([].push),O=/^\d$/,k=/^[1-9]$/,A=/^[\d-]$/,j=/^[\t\n\r ]$/,M=0,N=1,P=function(e,t){e=f(e);var n=new re(e,0),r=n.parse(),i=r.value,a=n.skip(j,r.end);if(a<e.length)throw new b(`Unexpected extra character: "`+w(e,a)+`" after the parsed data at: `+a);return c(t)?ee({"":i},``,t,r):i},ee=function(e,t,n,r){var i=e[t],a=r&&i===r.value,o=a&&typeof r.source==`string`?{source:r.source}:{},c,f,m,h,g;if(l(i)){var _=u(i),v=a?r.nodes:_?[]:{};if(_)for(c=v.length,m=p(i),h=0;h<m;h++)te(i,h,ee(i,``+h,n,h<c?v[h]:void 0));else for(f=S(i),m=p(f),h=0;h<m;h++)g=f[h],te(i,g,ee(i,g,n,d(v,g)?v[g]:void 0))}return s(n,e,t,i,o)},te=function(e,t,n){if(r){var i=C(e,t);if(i&&!i.configurable)return}n===void 0?delete e[t]:m(e,t,n)},ne=function(e,t,n,r){this.value=e,this.end=t,this.source=n,this.nodes=r},re=function(e,t){this.source=e,this.index=t};re.prototype={fork:function(e){return new re(this.source,e)},parse:function(){var e=this.source,t=this.skip(j,this.index),n=this.fork(t),r=w(e,t);if(E(A,r))return n.number();switch(r){case`{`:return n.object();case`[`:return n.array();case`"`:return n.string();case`t`:return n.keyword(!0);case`f`:return n.keyword(!1);case`n`:return n.keyword(null)}throw new b(`Unexpected character: "`+r+`" at: `+t)},node:function(e,t,n,r,i){return new ne(t,r,e?null:T(this.source,n,r),i)},object:function(){for(var e=this.source,t=this.index+1,n=!1,r={},i={},a=!1;t<e.length;){if(t=this.until([`"`,`}`],t),w(e,t)===`}`&&!n){t++,a=!0;break}var o=this.fork(t).string(),s=o.value;t=o.end,t=this.until([`:`],t)+1,t=this.skip(j,t),o=this.fork(t).parse(),m(i,s,o),m(r,s,o.value),t=this.until([`,`,`}`],o.end);var c=w(e,t);if(c===`,`)n=!0,t++;else if(c===`}`){t++,a=!0;break}}if(!a)throw new b(`Unterminated object at: `+t);return this.node(N,r,this.index,t,i)},array:function(){for(var e=this.source,t=this.index+1,n=!1,r=[],i=[],a=!1;t<e.length;){if(t=this.skip(j,t),w(e,t)===`]`&&!n){t++,a=!0;break}var o=this.fork(t).parse();if(D(i,o),D(r,o.value),t=this.until([`,`,`]`],o.end),w(e,t)===`,`)n=!0,t++;else if(w(e,t)===`]`){t++,a=!0;break}}if(!a)throw new b(`Unterminated array at: `+t);return this.node(N,r,this.index,t,i)},string:function(){var e=this.index,t=g(this.source,this.index+1);return this.node(M,t.value,e,t.end)},number:function(){var e=this.source,t=this.index,n=t;if(w(e,n)===`-`&&n++,w(e,n)===`0`)n++;else if(E(k,w(e,n)))n=this.skip(O,n+1);else throw new b(`Failed to parse number at: `+n);if(w(e,n)===`.`){var r=n+1;if(n=this.skip(O,r),r===n)throw new b(`Failed to parse number's fraction at: `+n)}if(w(e,n)===`e`||w(e,n)===`E`){n++,(w(e,n)===`+`||w(e,n)===`-`)&&n++;var i=n;if(n=this.skip(O,n),i===n)throw new b(`Failed to parse number's exponent value at: `+n)}return this.node(M,y(T(e,t,n)),t,n)},keyword:function(e){var t=``+e,n=this.index,r=n+t.length;if(T(this.source,n,r)!==t)throw new b(`Failed to parse value at: `+n);return this.node(M,e,n,r)},skip:function(e,t){for(var n=this.source;t<n.length&&E(e,w(n,t));t++);return t},until:function(e,t){t=this.skip(j,t);for(var n=w(this.source,t),r=0;r<e.length;r++)if(e[r]===n)return t;throw new b(`Unexpected character: "`+n+`" at: `+t)}};var ie=h(function(){var e=`9007199254740993`,t;return x(e,function(e,n,r){t=r.source}),t!==e}),ae=_&&!h(function(){return 1/x(`-0 `)!=-1/0});n({target:`JSON`,stat:!0,forced:ie},{parse:function(e,t){return ae&&!c(t)?x(e):P(e,t)}})}),Ga=B.cw(function(e,t){var n=Er(),r=Lr(),i=jr(),a=Fr(),o=Dr(),s=ei(),c=ni(),l=ai(),u=Di(),d=ci(),f=li(),p=or(),m=ca(),h=tr().includes,g=Gr(),_=ya(),v=Vi(),y=xa(),b=sa(),x=Ci(),S=String,C=TypeError,w=r(`JSON`,`stringify`),T=r(`BigInt`),E=a(``.valueOf),D=a((!0).valueOf),O=T&&a(T.prototype.valueOf),k=a(/./.exec),A=a(``.charAt),j=a(``.charCodeAt),M=a(``.replace),N=a(``.slice),P=a([].push),ee=a([].pop),te=a(1.1.toString),ne=/[\uD800-\uDFFF]/g,re=/^[\uD800-\uDBFF]$/,ie=/^[\uDC00-\uDFFF]$/,ae=/^\d+$/,oe=y(),se=y(),ce=y(),le=oe.length,ue=se.length,de=!b||o(function(){var e=r(`Symbol`)(`stringify detection`);return w([e])!==`[null]`||w({a:e})!==`{}`||w(Object(e))!==`{}`}),fe=o(function(){return w(`\udf06\ud834`)!==`"\\udf06\\ud834"`||w(`\udead`)!==`"\\udead"`}),pe=x?r(`JSON`,`isRawJSON`):d,me=de?function(e,t,n){return w(e,function(e,n){var r=i(t,this,e,n);if(!f(r))return r},n)}:w,he=function(e,t,n){var r=A(n,t-1),i=A(n,t+1);return k(re,e)&&!k(ie,i)||k(ie,e)&&!k(re,r)?`\\u`+te(j(e,0),16):e},ge=function(e){if(s(e)){for(var t=e.length,n=[],r=u(null),i=0;i<t;i++){var a=e[i],o;if(typeof a==`string`)o=a;else if(typeof a==`number`||p(a)===`Number`||p(a)===`String`)o=_(a);else continue;g(r,o)||(r[o]=!0,P(n,o))}return n}},_e=function(e,t){try{return e(t),!0}catch{return!1}},F=function(e){var t=p(e);return t===`Number`&&_e(m,e)||t===`String`&&_e(E,e)||t===`Boolean`&&_e(D,e)||!!O&&t===`BigInt`&&_e(O,e)},ve=function(e){if(!l(e)||c(e)||s(e))return!1;try{return!F(e)}catch{return!0}},ye=function(e,t){return{toJSON:function(){var n=e[t];if(l(n)||typeof n==`bigint`){var r=n.toJSON;c(r)&&(n=i(r,n,t))}return n}}},be=function(e){for(var t=0,n=e.length;t<n;t++)if(k(ae,e[t]))return se;return``},xe=function(e,t,n){for(var r=u(null),i=0,a=t.length;i<a;i++){var o=t[i];r[n+o]=ye(e,o)}return r[ce]=null,r};w&&n({target:`JSON`,stat:!0,arity:3,forced:de||fe||!x},{stringify:function(e,t,n){var r=c(t)?t:void 0,a=r?void 0:ge(t),o=a&&be(a),l=[],u=[],d=[],f,p=!1,m=!0,g=me(e,function(e,t){if(e=S(e),a){if(e===ce){ee(u),f=ee(d);return}if(m)m=!1;else if(this!==f&&!s(this)&&!h(a,e))return}else r&&(t=i(r,this,e,t));if(pe(t))return x?t:(p=!0,oe+(P(l,t.rawJSON)-1));if(a&&ve(t)){if(h(u,t))throw new C(`Converting circular structure to JSON`);var n=xe(t,a,o);return P(u,t),P(d,f),f=n,o&&(p=!0),n}return t},n);if(typeof g!=`string`||(fe&&(g=M(g,ne,he)),!p))return g;for(var _=``,y=g.length,b=0;b<y;b++){var w=A(g,b);if(w===`"`){var T=v(g,++b).end-1,E=N(g,b,T);N(E,0,le)===oe?_+=l[N(E,le)]:N(E,0,ue)===se?_+=`"`+N(E,ue)+`"`:_+=`"`+E+`"`,b=T}else _+=w}return _}})}),Ka=B.cw(function(e,t){var n=Er(),r=Rn(),i=Si(),a=si(),o=i.get,s=i.has,c=i.set;n({target:`Map`,proto:!0,real:!0,forced:a},{getOrInsertComputed:function(e,t){var n=s(this,e);if(r(t),n)return o(this,e);e===0&&1/e==-1/0&&(e=0);var i=t(e);return c(this,e,i),i}})}),qa=B.cw(function(e,t){var n=Er(),r=Si(),i=si(),a=r.get,o=r.has,s=r.set;n({target:`Map`,proto:!0,real:!0,forced:i},{getOrInsert:function(e,t){return o(this,e)?a(this,e):(s(this,e,t),t)}})}),Ja=B.cw(function(e,t){var n=Er(),r=Fr(),i=di(),a=RangeError,o=TypeError,s=1/0,c=NaN,l=Math.abs,u=Math.pow,d=r([].push),f=u(2,1023),p=u(2,53)-1,m=Number.MAX_VALUE,h=u(2,971),g={},_={},v={},y={},b={},x=function(e,t){var n=e+t;return{hi:n,lo:t-(n-e)}};n({target:`Math`,stat:!0},{sumPrecise:function(e){var t=[],n=0,r=y;switch(i(e,function(e){if(++n>p)throw new a(`Maximum allowed index exceeded`);if(typeof e!=`number`)throw new o(`Value is not a number`);r!==g&&(e===e?e===s?r=r===_?g:v:e===-s?r=r===v?g:_:e===0&&1/e!==s||r!==y&&r!==b||(r=b,d(t,e)):r=g)}),r){case g:return c;case _:return-s;case v:return s;case y:return-0}for(var u=[],S=0,C,w,T,E,D,O,k=0;k<t.length;k++){C=t[k];for(var A=0,j=0;j<u.length;j++){if(w=u[j],l(C)<l(w)&&(O=C,C=w,w=O),T=x(C,w),E=T.hi,D=T.lo,l(E)===s){var M=E===s?1:-1;S+=M,C=C-M*f-M*f,l(C)<l(w)&&(O=C,C=w,w=O),T=x(C,w),E=T.hi,D=T.lo}D!==0&&(u[A++]=D),C=E}u.length=A,C!==0&&d(u,C)}var N=u.length-1;if(E=0,D=0,S!==0){var P=N>=0?u[N]:0;if(N--,l(S)>1||S>0&&P>0||S<0&&P<0)return S>0?s:-s;if(T=x(S*f,P/2),E=T.hi,D=T.lo,D*=2,l(2*E)===s)return E>0?E===f&&D===-(h/2)&&N>=0&&u[N]<0?m:s:E===-f&&D===h/2&&N>=0&&u[N]>0?-m:-s;D!==0&&(u[++N]=D,D=0),E*=2}for(;N>=0&&(T=x(E,u[N--]),E=T.hi,D=T.lo,D===0););return N>=0&&(D<0&&u[N]<0||D>0&&u[N]>0)&&(w=D*2,C=E+w,w===C-E&&(E=C)),E}})}),Ya=B.cw(function(e,t){var n=Er(),r=Wr(),i=Or(),a=rr(),o=Ui(),s=wi(),c=Rn(),l=Hi(),u=Dr(),d=r.Promise,f=!1;n({target:`Promise`,stat:!0,forced:!d||!d.try||u(function(){var e=d.resolve();return d.try(function(t){return f=t===8,e},8)!==e})||!f},{try:function(e){var t=arguments.length>1?a(arguments,1):[],n=l(function(){return i(c(e),void 0,t)});if(!n.error)return o(this,n.value);var r=s.f(this),u=r.reject;return u(n.value),r.promise}})}),Xa=B.cw(function(e,t){var n=Er(),r=Ki(),i=Dr();n({target:`Set`,proto:!0,real:!0,forced:!$i()(`difference`,function(e){return e.size===0})||i(function(){var e={size:1,has:function(){return!0},keys:function(){var e=0;return{next:function(){var n=e++>1;return t.has(1)&&t.clear(),{done:n,value:2}}}}},t=new Set([1,2,3,4]);return t.difference(e).size!==3})},{difference:r})}),Za=B.cw(function(e,t){var n=Er(),r=Dr(),i=Ji();n({target:`Set`,proto:!0,real:!0,forced:!$i()(`intersection`,function(e){return e.size===2&&e.has(1)&&e.has(2)})||r(function(){return String(Array.from(new Set([1,2,3]).intersection(new Set([3,2]))))!==`3,2`})},{intersection:i})}),Qa=B.cw(function(e,t){var n=Er(),r=Yi();n({target:`Set`,proto:!0,real:!0,forced:!$i()(`isDisjointFrom`,function(e){return!e})},{isDisjointFrom:r})}),$a=B.cw(function(e,t){var n=Er(),r=Xi();n({target:`Set`,proto:!0,real:!0,forced:!$i()(`isSubsetOf`,function(e){return e})},{isSubsetOf:r})}),eo=B.cw(function(e,t){var n=Er(),r=Zi();n({target:`Set`,proto:!0,real:!0,forced:!$i()(`isSupersetOf`,function(e){return!e})},{isSupersetOf:r})}),to=B.cw(function(e,t){var n=Er(),r=na(),i=ea();n({target:`Set`,proto:!0,real:!0,forced:!$i()(`symmetricDifference`)||!i(`symmetricDifference`)},{symmetricDifference:r})}),no=B.cw(function(e,t){var n=Er(),r=ra(),i=ea();n({target:`Set`,proto:!0,real:!0,forced:!$i()(`union`)||!i(`union`)},{union:r})}),ro=B.cw(function(e,t){var n=$n(),r=ti(),i=bi(),a=fa(),o=ua(),s=n.aTypedArray,c=n.getTypedArrayConstructor,l=n.exportTypedArrayMethod,u=RangeError,d=function(){try{new Int8Array(1).with(2,{valueOf:function(){throw 8}})}catch(e){return e===8}}(),f=d&&function(){try{new Int8Array(1).with(-.5,1)}catch{return!0}}();l(`with`,{with:function(e,t){var n=s(this),l=i(n),d=a(e),f=d<0?l+d:d,p=r(n)?o(t):+t;if(f>=l||f<0)throw new u(`Incorrect index`);for(var m=new(c(n))(l),h=0;h<l;h++)m[h]=h===f?p:n[h];return m}}.with,!d||f)}),io=B.cw(function(e,t){var n=Er(),r=Wr(),i=er(),a=Sa(),o=r.Uint8Array,s=!o||!o.fromBase64||!function(){try{o.fromBase64(`a`);return}catch{}try{o.fromBase64(``,null)}catch{return!0}}();o&&n({target:`Uint8Array`,stat:!0,forced:s},{fromBase64:function(e){return i(o,a(e,arguments.length>1?arguments[1]:void 0,null,9007199254740991).bytes)}})}),ao=B.cw(function(e,t){var n=Er(),r=Wr(),i=Sa(),a=Jn(),o=r.Uint8Array,s=!o||!o.prototype.setFromBase64||!function(){var e=new o([255,255,255,255,255]);try{e.setFromBase64(``,null);return}catch{}try{e.setFromBase64(`a`);return}catch{}try{e.setFromBase64(`MjYyZg===`)}catch{return e[0]===50&&e[1]===54&&e[2]===50&&e[3]===255&&e[4]===255}}();o&&n({target:`Uint8Array`,proto:!0,forced:s},{setFromBase64:function(e){a(this);var t=i(e,arguments.length>1?arguments[1]:void 0,this,this.length);return{read:t.read,written:t.written}}})}),oo=B.cw(function(e,t){var n=Er(),r=Wr(),i=Vn(),a=Jn(),o=Qn(),s=Ca();function c(){try{new Uint8Array(new ArrayBuffer(16,{maxByteLength:1024})).setFromHex(`cafed00d`)}catch{return!0}}r.Uint8Array&&n({target:`Uint8Array`,proto:!0,forced:c()},{setFromHex:function(e){a(this),i(e),o(this.buffer);var t=s(e,this).read;return{read:t,written:t/2}}})}),so=B.cw(function(e,t){var n=Er(),r=Wr(),i=Fr(),a=Kn(),o=Jn(),s=Qn(),c=ir(),l=Ir(),u=c.i2c,d=c.i2cUrl,f=Math.floor,p=Math.ceil,m=i(``.charAt),h=r.Uint8Array,g=r.Array,_=i([].join),v=!h||!h.prototype.toBase64||!function(){try{new h().toBase64(null)}catch{return!0}}();h&&n({target:`Uint8Array`,proto:!0,forced:v},{toBase64:function(){var e=o(this),t=arguments.length?a(arguments[0]):void 0,n=l(t)===`base64`?u:d,r=!!t&&!!t.omitPadding;s(this.buffer);for(var i=0,c=e.length,h=g(r?f(c/3)*4+(c%3?c%3+1:0):p(c/3)*4),v=0,y,b=function(e){return m(n,y>>6*e&63)};i+2<c;i+=3)y=(e[i]<<16)+(e[i+1]<<8)+e[i+2],h[v++]=b(3),h[v++]=b(2),h[v++]=b(1),h[v++]=b(0);return i+2===c?(y=(e[i]<<16)+(e[i+1]<<8),h[v++]=b(3),h[v++]=b(2),h[v++]=b(1),r||(h[v++]=`=`)):i+1===c&&(y=e[i]<<16,h[v++]=b(3),h[v++]=b(2),r||(h[v++]=`=`,h[v++]=`=`)),_(h,``)}})}),co=B.cw(function(e,t){var n=Er(),r=Wr(),i=Fr(),a=Jn(),o=Qn(),s=i(1.1.toString),c=i([].join),l=Array,u=r.Uint8Array,d=!u||!u.prototype.toHex||!(function(){try{return new u([255,255,255,255,255,255,255,255]).toHex()===`ffffffffffffffff`}catch{return!1}})();u&&n({target:`Uint8Array`,proto:!0,forced:d},{toHex:function(){a(this),o(this.buffer);for(var e=l(this.length),t=0,n=this.length;t<n;t++){var r=s(this[t],16);e[t]=r.length===1?`0`+r:r}return c(e,``)}})}),lo=B.cw(function(e,t){var n=Er(),r=Rn(),i=Un(),a=Hn(),o=ka(),s=si(),c=o.get,l=o.has,u=o.set;n({target:`WeakMap`,proto:!0,real:!0,forced:s||!function(){try{WeakMap.prototype.getOrInsertComputed&&new WeakMap().getOrInsertComputed(1,function(){throw 1})}catch(e){return e instanceof TypeError}}()},{getOrInsertComputed:function(e,t){if(s||i(this),a(e),r(t),l(this,e))return c(this,e);var n=t(e);return u(this,e,n),n}})}),uo=B.cw(function(e,t){var n=Er(),r=ka(),i=si(),a=r.get,o=r.has,s=r.set;n({target:`WeakMap`,proto:!0,real:!0,forced:i},{getOrInsert:function(e,t){return o(this,e)?a(this,e):(s(this,e,t),t)}})}),fo=B.cw(function(e,t){var n=Er(),r=Wr(),i=Lr(),a=fr(),o=ki().f,s=Gr(),c=Gn(),l=Xr(),u=Ti(),d=xr(),f=Tr(),p=vr(),m=si(),h=`DOMException`,g=i(`Error`),_=i(h),v=function(){c(this,y);var e=arguments.length,t=u(e<1?void 0:arguments[0]),n=new _(t,u(e<2?void 0:arguments[1],`Error`)),r=new g(t);return r.name=h,o(n,`stack`,a(1,f(r.stack,1))),l(n,this,v),n},y=v.prototype=_.prototype,b=`stack`in new g(h),x=`stack`in new _(1,2),S=_&&p&&Object.getOwnPropertyDescriptor(r,h),C=!!S&&!(S.writable&&S.configurable),w=b&&!C&&!x;n({global:!0,constructor:!0,forced:m||w},{DOMException:w?v:_});var T=i(h),E=T.prototype;if(E.constructor!==T){for(var D in m||o(E,`constructor`,a(1,T)),d)if(s(d,D)){var O=d[D],k=O.s;s(T,k)||o(T,k,a(6,O.c))}}}),po=B.cw(function(e,t){var n=Er(),r=Lr(),i=Da(),a=ya(),o=wa(),s=r(`URL`);n({target:`URL`,stat:!0,forced:!o},{parse:function(e){var t=i(arguments.length,1),n=a(e),r=t<2||arguments[1]===void 0?void 0:a(arguments[1]);try{return new s(n,r)}catch{return null}}})}),ja(),Ma(),Na(),Ia(),qa(),Ka(),Xa(),Za(),Qa(),$a(),eo(),to(),no(),ro(),ao(),oo(),so(),co(),po(),mo=typeof process==`object`&&process+``==`[object process]`&&!process.versions.nw&&!(process.versions.electron&&process.type&&process.type!==`browser`),ho=[1/0,1/0,-1/0,-1/0],go=new Float32Array(ho),_o=[.001,0,0,.001,0,0],vo=`http://www.w3.org/2000/svg`,yo={ANY:1,DISPLAY:2,PRINT:4,SAVE:8,ANNOTATIONS_FORMS:16,ANNOTATIONS_STORAGE:32,ANNOTATIONS_DISABLE:64,IS_EDITING:128,OPLIST:256},bo={DISABLE:0,ENABLE:1,ENABLE_FORMS:2,ENABLE_STORAGE:3},xo=`pdfjs_internal_id_`,So=`pdfjs_internal_editor_`,Co={DISABLE:-1,NONE:0,FREETEXT:3,HIGHLIGHT:9,STAMP:13,INK:15,POPUP:16,SIGNATURE:101,COMMENT:102},wo={RESIZE:1,CREATE:2,FREETEXT_SIZE:11,FREETEXT_COLOR:12,FREETEXT_OPACITY:13,INK_COLOR:21,INK_THICKNESS:22,INK_OPACITY:23,INK_COLOR_AND_OPACITY:24,HIGHLIGHT_COLOR:31,HIGHLIGHT_THICKNESS:32,HIGHLIGHT_FREE:33,HIGHLIGHT_SHOW_ALL:34,DRAW_STEP:41},To={PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048},Eo={FILL:0,STROKE:1,FILL_STROKE:2,INVISIBLE:3,FILL_ADD_TO_PATH:4,STROKE_ADD_TO_PATH:5,FILL_STROKE_ADD_TO_PATH:6,ADD_TO_PATH:7,FILL_STROKE_MASK:3,ADD_TO_PATH_FLAG:4},Do={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3},Oo={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,SOUND:18,MOVIE:19,WIDGET:20,SCREEN:21,PRINTERMARK:22,TRAPNET:23,WATERMARK:24,THREED:25,REDACT:26,RICHMEDIA:27},ko={SOLID:1,DASHED:2,BEVELED:3,INSET:4,UNDERLINE:5},Ao={ERRORS:0,WARNINGS:1,INFOS:5},jo={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,setStrokeTransparent:92,setFillTransparent:93,rawFillPath:94},Mo={moveTo:0,lineTo:1,curveTo:2,quadraticCurveTo:3,closePath:4},No={NEED_PASSWORD:1,INCORRECT_PASSWORD:2},Po=Ao.WARNINGS,Fo=function(){function e(e,t){this.message=e,this.name=t}return e.prototype=Error(),e.constructor=e,e}(),Io=class extends Fo{constructor(e,t){super(e,`PasswordException`),this.code=t}},Lo=class extends Fo{constructor(e,t){super(e,`UnknownErrorException`),this.details=t}},Ro=class extends Fo{constructor(e){super(e,`InvalidPDFException`)}},zo=class extends Fo{constructor(e,t,n){super(e,`ResponseException`),this.status=t,this.missing=n}},Bo=class extends Fo{constructor(e){super(e,`FormatError`)}},Vo=class extends Fo{constructor(e){super(e,`AbortException`)}},Ho=class{static get isLittleEndian(){let e=new Uint8Array(4);e[0]=1;let t=new Uint32Array(e.buffer,0,1);return V(this,`isLittleEndian`,t[0]===1)}static get isOffscreenCanvasSupported(){return V(this,`isOffscreenCanvasSupported`,typeof OffscreenCanvas<`u`)}static get isImageDecoderSupported(){return V(this,`isImageDecoderSupported`,typeof ImageDecoder<`u`)}static get isFloat16ArraySupported(){return V(this,`isFloat16ArraySupported`,typeof Float16Array<`u`)}static get isSanitizerSupported(){return V(this,`isSanitizerSupported`,typeof Sanitizer<`u`)}static get platform(){let{platform:e,userAgent:t}=navigator;return V(this,`platform`,{isAndroid:t.includes(`Android`),isLinux:e.includes(`Linux`),isMac:e.includes(`Mac`),isWindows:e.includes(`Win`),isFirefox:t.includes(`Firefox`)})}static get isCanvasFilterSupported(){let e;return this.isOffscreenCanvasSupported?e=new OffscreenCanvas(1,1).getContext(`2d`):typeof document<`u`&&(e=document.createElement(`canvas`).getContext(`2d`)),V(this,`isCanvasFilterSupported`,e?.filter!==void 0)}static get isAlphaColorInputSupported(){if(typeof document>`u`)return V(this,`isAlphaColorInputSupported`,!1);let e=document.createElement(`input`);return e.type=`color`,e.setAttribute(`alpha`,``),e.value=`#ff000080`,V(this,`isAlphaColorInputSupported`,e.value!==`#ff0000`)}static get isBackdropFilterSupported(){return V(this,`isBackdropFilterSupported`,typeof CSS<`u`&&CSS.supports(`backdrop-filter`,`blur(1px)`))}},H=class{static get hexNums(){return V(this,`hexNums`,Array.from({length:256},(e,t)=>t.toString(16).padStart(2,`0`)))}static makeHexColor(e,t,n){return`#${this.hexNums[e]}${this.hexNums[t]}${this.hexNums[n]}`}static transform(e,t){return[e[0]*t[0]+e[2]*t[1],e[1]*t[0]+e[3]*t[1],e[0]*t[2]+e[2]*t[3],e[1]*t[2]+e[3]*t[3],e[0]*t[4]+e[2]*t[5]+e[4],e[1]*t[4]+e[3]*t[5]+e[5]]}static multiplyByDOMMatrix(e,t){return[e[0]*t.a+e[2]*t.b,e[1]*t.a+e[3]*t.b,e[0]*t.c+e[2]*t.d,e[1]*t.c+e[3]*t.d,e[0]*t.e+e[2]*t.f+e[4],e[1]*t.e+e[3]*t.f+e[5]]}static applyTransform(e,t,n=0){let r=e[n],i=e[n+1];e[n]=r*t[0]+i*t[2]+t[4],e[n+1]=r*t[1]+i*t[3]+t[5]}static applyTransformToBezier(e,t,n=0){let r=t[0],i=t[1],a=t[2],o=t[3],s=t[4],c=t[5];for(let t=0;t<6;t+=2){let l=e[n+t],u=e[n+t+1];e[n+t]=l*r+u*a+s,e[n+t+1]=l*i+u*o+c}}static applyInverseTransform(e,t){let n=e[0],r=e[1],i=t[0]*t[3]-t[1]*t[2];e[0]=(n*t[3]-r*t[2]+t[2]*t[5]-t[4]*t[3])/i,e[1]=(-n*t[1]+r*t[0]+t[4]*t[1]-t[5]*t[0])/i}static axialAlignedBoundingBox(e,t,n){let r=t[0],i=t[1],a=t[2],o=t[3],s=t[4],c=t[5],l=e[0],u=e[1],d=e[2],f=e[3],p=r*l+s,m=p,h=r*d+s,g=h,_=o*u+c,v=_,y=o*f+c,b=y;if(i!==0||a!==0){let e=i*l,t=i*d,n=a*u,r=a*f;p+=n,g+=n,h+=r,m+=r,_+=e,b+=e,y+=t,v+=t}n[0]=Math.min(n[0],p,h,m,g),n[1]=Math.min(n[1],_,y,v,b),n[2]=Math.max(n[2],p,h,m,g),n[3]=Math.max(n[3],_,y,v,b)}static inverseTransform(e){let t=e[0]*e[3]-e[1]*e[2];return[e[3]/t,-e[1]/t,-e[2]/t,e[0]/t,(e[2]*e[5]-e[4]*e[3])/t,(e[4]*e[1]-e[5]*e[0])/t]}static singularValueDecompose2dScale(e,t){let n=e[0],r=e[1],i=e[2],a=e[3],o=n**2+r**2,s=n*i+r*a,c=i**2+a**2,l=(o+c)/2,u=Math.sqrt(l**2-(o*c-s**2));t[0]=Math.sqrt(l+u||1),t[1]=Math.sqrt(l-u||1)}static normalizeRect(e){let t=e.slice(0);return e[0]>e[2]&&(t[0]=e[2],t[2]=e[0]),e[1]>e[3]&&(t[1]=e[3],t[3]=e[1]),t}static intersect(e,t){let n=Math.max(Math.min(e[0],e[2]),Math.min(t[0],t[2])),r=Math.min(Math.max(e[0],e[2]),Math.max(t[0],t[2]));if(n>r)return null;let i=Math.max(Math.min(e[1],e[3]),Math.min(t[1],t[3])),a=Math.min(Math.max(e[1],e[3]),Math.max(t[1],t[3]));return i>a?null:[n,i,r,a]}static pointBoundingBox(e,t,n){n[0]=Math.min(n[0],e),n[1]=Math.min(n[1],t),n[2]=Math.max(n[2],e),n[3]=Math.max(n[3],t)}static rectBoundingBox(e,t,n,r,i){i[0]=Math.min(i[0],e,n),i[1]=Math.min(i[1],t,r),i[2]=Math.max(i[2],e,n),i[3]=Math.max(i[3],t,r)}static#e(e,t,n,r,i,a,o,s,c,l){if(c<=0||c>=1)return;let u=1-c,d=c*c,f=d*c,p=u*(u*(u*e+3*c*t)+3*d*n)+f*r,m=u*(u*(u*i+3*c*a)+3*d*o)+f*s;l[0]=Math.min(l[0],p),l[1]=Math.min(l[1],m),l[2]=Math.max(l[2],p),l[3]=Math.max(l[3],m)}static#t(e,t,n,r,i,a,o,s,c,l,u,d){if(Math.abs(c)<1e-12){Math.abs(l)>=1e-12&&this.#e(e,t,n,r,i,a,o,s,-u/l,d);return}let f=l**2-4*u*c;if(f<0)return;let p=Math.sqrt(f),m=2*c;this.#e(e,t,n,r,i,a,o,s,(-l+p)/m,d),this.#e(e,t,n,r,i,a,o,s,(-l-p)/m,d)}static bezierBoundingBox(e,t,n,r,i,a,o,s,c){c[0]=Math.min(c[0],e,o),c[1]=Math.min(c[1],t,s),c[2]=Math.max(c[2],e,o),c[3]=Math.max(c[3],t,s),this.#t(e,n,i,o,t,r,a,s,3*(-e+3*(n-i)+o),6*(e-2*n+i),3*(n-e),c),this.#t(e,n,i,o,t,r,a,s,3*(-t+3*(r-a)+s),6*(t-2*r+a),3*(r-t),c)}},Uo=null,Wo=null,Go=()=>[],Ko=()=>new Map,qo=()=>Object.create(null),Jo=()=>new Set,typeof Blob.prototype.bytes!=`function`&&(Blob.prototype.bytes=async function(){return new Uint8Array(await this.arrayBuffer())}),typeof Response.prototype.bytes!=`function`&&(Response.prototype.bytes=async function(){return new Uint8Array(await this.arrayBuffer())}),typeof Iterator.prototype.join!=`function`&&(Iterator.prototype.join=function(e){return[...this].join(e)}),Ba(),Yo=class e{constructor({viewBox:e,userUnit:t,scale:n,rotation:r,offsetX:i=0,offsetY:a=0,dontFlip:o=!1}){this.viewBox=e,this.userUnit=t,this.scale=n,this.rotation=r,this.offsetX=i,this.offsetY=a,n*=t;let s=(e[2]+e[0])/2,c=(e[3]+e[1])/2,l,u,d,f;switch(r%=360,r<0&&(r+=360),r){case 180:l=-1,u=0,d=0,f=1;break;case 90:l=0,u=1,d=1,f=0;break;case 270:l=0,u=-1,d=-1,f=0;break;case 0:l=1,u=0,d=0,f=-1;break;default:throw Error(`PageViewport: Invalid rotation, must be a multiple of 90 degrees.`)}o&&(d=-d,f=-f);let p,m,h,g;l===0?(p=Math.abs(c-e[1])*n+i,m=Math.abs(s-e[0])*n+a,h=(e[3]-e[1])*n,g=(e[2]-e[0])*n):(p=Math.abs(s-e[0])*n+i,m=Math.abs(c-e[1])*n+a,h=(e[2]-e[0])*n,g=(e[3]-e[1])*n),this.transform=[l*n,u*n,d*n,f*n,p-l*n*s-d*n*c,m-u*n*s-f*n*c],this.width=h,this.height=g}get rawDims(){let e=this.viewBox;return V(this,`rawDims`,{pageWidth:e[2]-e[0],pageHeight:e[3]-e[1],pageX:e[0],pageY:e[1]})}clone({scale:t=this.scale,rotation:n=this.rotation,offsetX:r=this.offsetX,offsetY:i=this.offsetY,dontFlip:a=!1}={}){return new e({viewBox:this.viewBox.slice(),userUnit:this.userUnit,scale:t,rotation:n,offsetX:r,offsetY:i,dontFlip:a})}convertToViewportPoint(e,t){let n=[e,t];return H.applyTransform(n,this.transform),n}convertToPdfPoint(e,t){let n=[e,t];return H.applyInverseTransform(n,this.transform),n}},Xo=class e{static textContent(t){let n=[],r={items:n,styles:Object.create(null)};function i(t){if(!t)return;let r=null,a=t.name;if(a===`#text`)r=t.value;else if(e.shouldBuildText(a))t?.attributes?.textContent?r=t.attributes.textContent:t.value&&(r=t.value);else return;if(r!==null&&n.push({str:r}),t.children)for(let e of t.children)i(e)}return i(t),r}static shouldBuildText(e){return e!==`textarea`&&e!==`input`&&e!==`option`&&e!==`select`}},Zo=/url\(|image-set\(/i,Qo=/^on/i,$o=class{static get _allowedHtmlElements(){return V(this,`_allowedHtmlElements`,new Set([`a`,`b`,`br`,`button`,`div`,`i`,`img`,`input`,`label`,`li`,`ol`,`option`,`p`,`select`,`span`,`sub`,`sup`,`textarea`,`ul`]))}static get _allowedSvgElements(){return V(this,`_allowedSvgElements`,new Set([`ellipse`,`line`,`path`,`rect`,`svg`]))}static get _allowedRichTextElements(){return V(this,`_allowedRichTextElements`,new Set([`a`,`b`,`br`,`div`,`i`,`li`,`ol`,`p`,`span`,`sub`,`sup`,`ul`]))}static get _allowedRichTextAttributes(){return V(this,`_allowedRichTextAttributes`,new Set([`class`,`dir`,`style`]))}static get _allowedRichTextStyles(){return V(this,`_allowedRichTextStyles`,new Set(`color.font.fontFamily.fontSize.fontStretch.fontStyle.fontWeight.kerningMode.letterSpacing.lineHeight.margin.marginBottom.marginLeft.marginRight.marginTop.orphans.paddingLeft.paddingRight.breakAfter.breakBefore.breakInside.tabInterval.tabStop.textAlign.textDecoration.textIndent.transform.verticalAlign.widows`.split(`.`)))}static setupStorage(e,t,n,r,i){let a=r.getValue(t,{value:null});switch(n.name){case`textarea`:if(a.value!==null&&(e.textContent=a.value),i===`print`)break;e.addEventListener(`input`,e=>{r.setValue(t,{value:e.target.value})});break;case`input`:if(n.attributes.type===`radio`||n.attributes.type===`checkbox`){if(a.value===n.attributes.xfaOn?e.setAttribute(`checked`,!0):a.value===n.attributes.xfaOff&&e.removeAttribute(`checked`),i===`print`)break;e.addEventListener(`change`,e=>{r.setValue(t,{value:e.target.checked?e.target.getAttribute(`xfaOn`):e.target.getAttribute(`xfaOff`)})})}else{if(a.value!==null&&e.setAttribute(`value`,a.value),i===`print`)break;e.addEventListener(`input`,e=>{r.setValue(t,{value:e.target.value})})}break;case`select`:if(a.value!==null){e.setAttribute(`value`,a.value);for(let e of n.children)e.attributes.value===a.value?e.attributes.selected=!0:Object.hasOwn(e.attributes,`selected`)&&delete e.attributes.selected}e.addEventListener(`input`,e=>{let n=e.target.options,i=n.selectedIndex===-1?``:n[n.selectedIndex].value;r.setValue(t,{value:i})})}}static setAttributes({html:e,element:t,storage:n=null,intent:r,linkService:i}){let{attributes:a}=t,o=e instanceof HTMLAnchorElement;a.type===`radio`&&(a.name=`${a.name}-${r}`);for(let[t,n]of Object.entries(a))if(!(n==null||Qo.test(t))&&(r!==`richText`||this._allowedRichTextAttributes.has(t)))switch(t){case`class`:n.length&&e.setAttribute(t,n.join(` `));break;case`dataId`:break;case`id`:e.setAttribute(`data-element-id`,n);break;case`style`:if(r===`richText`){let t=this._allowedRichTextStyles;for(let[r,i]of Object.entries(n))t.has(r)&&!Zo.test(i)&&(e.style[r]=i)}else Object.assign(e.style,n);break;case`textContent`:e.textContent=n;break;default:(!o||t!==`href`&&t!==`newWindow`)&&e.setAttribute(t,n)}o&&i?.addLinkAttributes(e,a.href,a.newWindow),n&&a.dataId&&this.setupStorage(e,a.dataId,t,n)}static#e(e,t,n){return n===`richText`?!t&&this._allowedRichTextElements.has(e)?document.createElement(e):null:t?t===vo&&this._allowedSvgElements.has(e)?document.createElementNS(vo,e):null:this._allowedHtmlElements.has(e)?document.createElement(e):null}static render(e){let t=e.annotationStorage,n=e.linkService,r=e.xfaHtml,i=e.intent||`display`,a=this.#e(r.name,r.attributes?.xmlns,i)??document.createElement(`div`);r.attributes&&this.setAttributes({html:a,element:r,intent:i,linkService:n});let o=i!==`richText`,s=e.div;if(s.append(a),e.viewport){let t=`matrix(${e.viewport.transform.join(`,`)})`;s.style.transform=t}o&&s.setAttribute(`class`,`xfaLayer xfaFont`);let c=[];if(r.children.length===0){if(r.value){let e=document.createTextNode(r.value);a.append(e),o&&Xo.shouldBuildText(r.name)&&c.push(e)}return{textDivs:c}}let l=[[r,-1,a]];for(;l.length>0;){let[e,r,a]=l.at(-1);if(r+1===e.children.length){l.pop();continue}let s=e.children[++l.at(-1)[1]];if(s===null)continue;let{name:u}=s;if(u===`#text`){let e=document.createTextNode(s.value);c.push(e),a.append(e);continue}let d=this.#e(u,s.attributes?.xmlns,i);if(d){if(a.append(d),s.attributes&&this.setAttributes({html:d,element:s,storage:t,intent:i,linkService:n}),s.children?.length>0)l.push([s,-1,d]);else if(s.value){let e=document.createTextNode(s.value);o&&Xo.shouldBuildText(u)&&c.push(e),d.append(e)}}}for(let e of s.querySelectorAll(`.xfaNonInteractive input, .xfaNonInteractive textarea`))e.setAttribute(`readOnly`,!0);return{textDivs:c}}static update(e){let t=`matrix(${e.viewport.transform.join(`,`)})`;e.div.style.transform=t,e.div.hidden=!1}static getPageViewport(e,{scale:t=1,rotation:n=0}){let{width:r,height:i}=e.attributes.style;return new Yo({viewBox:[0,0,parseInt(r,10),parseInt(i,10)],userUnit:1,scale:t,rotation:n})}},es=class{static CSS=96;static PDF=72;static PDF_TO_CSS_UNITS=this.CSS/this.PDF},ts=class extends Fo{constructor(e,t=0){super(e,`RenderingCancelledException`),this.extraDelay=t}},ns=class{#e=new Map;times=[];time(e){this.#e.has(e)&&Xe(`Timer is already running for ${e}`),this.#e.set(e,Date.now())}timeEnd(e){this.#e.has(e)||Xe(`Timer has not been started for ${e}`),this.times.push({name:e,start:this.#e.get(e),end:Date.now()}),this.#e.delete(e)}toString(){let e=Math.max(...this.times.map(e=>e.name.length));return this.times.map(t=>`${t.name.padEnd(e)} ${t.end-t.start}ms\n`).join(``)}},rs=class{static#e;static toDateObject(e){if(e instanceof Date)return e;if(!e||typeof e!=`string`)return null;this.#e||=RegExp(`^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+\\-])?(\\d{2})?'?(\\d{2})?'?`);let t=this.#e.exec(e);if(!t)return null;let n=parseInt(t[1],10),r=parseInt(t[2],10);r=r>=1&&r<=12?r-1:0;let i=parseInt(t[3],10);i=i>=1&&i<=31?i:1;let a=parseInt(t[4],10);a=a>=0&&a<=23?a:0;let o=parseInt(t[5],10);o=o>=0&&o<=59?o:0;let s=parseInt(t[6],10);s=s>=0&&s<=59?s:0;let c=t[7]||`Z`,l=parseInt(t[8],10);l=l>=0&&l<=23?l:0;let u=parseInt(t[9],10)||0;return u=u>=0&&u<=59?u:0,c===`-`?(a+=l,o+=u):c===`+`&&(a-=l,o-=u),new Date(Date.UTC(n,r,i,a,o,s))}},is=class e{constructor(){let{pixelRatio:t}=e;this.sx=t,this.sy=t}get scaled(){return this.sx!==1||this.sy!==1}get symmetric(){return this.sx===this.sy}limitCanvas(t,n,r,i,a=-1){let o=1/0,s=1/0,c=1/0;r=e.capPixels(r,a),r>0&&(o=Math.sqrt(r/(t*n))),i!==-1&&(s=i/t,c=i/n);let l=Math.min(o,s,c);return this.sx>l||this.sy>l?(this.sx=l,this.sy=l,!0):!1}static get pixelRatio(){return globalThis.devicePixelRatio||1}static capPixels(e,t){if(t>=0){let n=Math.ceil(window.screen.availWidth*window.screen.availHeight*this.pixelRatio**2*(1+t/100));return e>0?Math.min(e,n):n}return e}},as=new Set([`image/apng`,`image/avif`,`image/bmp`,`image/gif`,`image/jpeg`,`image/png`,`image/svg+xml`,`image/webp`,`image/x-icon`]),os=class{static get isDarkMode(){return V(this,`isDarkMode`,!!window?.matchMedia?.(`(prefers-color-scheme: dark)`).matches)}},ss=class{static get commentForegroundColor(){let e=document.createElement(`span`);e.classList.add(`comment`,`sidebar`);let{style:t}=e;t.width=t.height=`0`,t.display=`none`,t.color=`var(--comment-fg-color)`,document.body.append(e);let{color:n}=window.getComputedStyle(e);return e.remove(),V(this,`commentForegroundColor`,yt(n))}},cs=new Map,Ha(),uo(),lo(),fo(),Va(),Ga(),Pa(),Fa(),La(),Wa(),ls=class e{#e=null;#t=null;#n;#r=null;#i=null;#a=null;#o=null;#s=null;static#c=null;constructor(t){this.#n=t,e.#c||=Object.freeze({freetext:`pdfjs-editor-remove-freetext-button`,highlight:`pdfjs-editor-remove-highlight-button`,ink:`pdfjs-editor-remove-ink-button`,stamp:`pdfjs-editor-remove-stamp-button`,signature:`pdfjs-editor-remove-signature-button`})}render(){let t=this.#e=document.createElement(`div`);t.classList.add(`editToolbar`,`hidden`),t.setAttribute(`role`,`toolbar`);let n=this.#n._uiManager._signal;n instanceof AbortSignal&&!n.aborted&&(t.addEventListener(`contextmenu`,gt,{signal:n}),t.addEventListener(`pointerdown`,e.#l,{signal:n}));let r=this.#r=document.createElement(`div`);r.className=`buttons`,t.append(r);let i=this.#n.toolbarPosition;if(i){let{style:e}=t;e.insetInlineEnd=`${100*(this.#n._uiManager.direction===`ltr`?1-i[0]:i[0])}%`,e.top=`calc(${100*i[1]}% + var(--editor-toolbar-vert-offset))`}return t}get div(){return this.#e}static#l(e){e.stopPropagation()}#u(e){this.#n._focusEventsAllowed=!1,_t(e)}#d(e){this.#n._focusEventsAllowed=!0,_t(e)}#f(e){let t=this.#n._uiManager._signal;return!(t instanceof AbortSignal)||t.aborted?!1:(e.addEventListener(`focusin`,this.#u.bind(this),{capture:!0,signal:t}),e.addEventListener(`focusout`,this.#d.bind(this),{capture:!0,signal:t}),e.addEventListener(`contextmenu`,gt,{signal:t}),!0)}hide(){this.#e.classList.add(`hidden`),this.#t?.hideDropdown()}show(){this.#e.classList.remove(`hidden`),this.#i?.shown(),this.#a?.shown()}addDeleteButton(){let{editorType:t,_uiManager:n}=this.#n,r=document.createElement(`button`);r.classList.add(`basic`,`deleteButton`),r.tabIndex=0,r.setAttribute(`data-l10n-id`,e.#c[t]),this.#f(r)&&r.addEventListener(`click`,e=>{n.delete()},{signal:n._signal}),this.#r.append(r)}get#p(){let e=document.createElement(`div`);return e.className=`divider`,e}async addAltText(e){let t=await e.render();this.#f(t),this.#r.append(t,this.#p),this.#i=e}addComment(e,t=null){if(this.#a)return;let n=e.renderForToolbar();if(!n)return;this.#f(n);let r=this.#o=this.#p;t?(this.#r.insertBefore(n,t),this.#r.insertBefore(r,t)):this.#r.append(n,r),this.#a=e,e.toolbar=this}addColorPicker(e){if(this.#t)return;this.#t=e;let t=e.renderButton();this.#f(t),this.#r.append(t,this.#p)}async addEditSignatureButton(e){let t=this.#s=await e.renderEditButton(this.#n);t&&(this.#f(t),this.#r.append(t,this.#p))}removeButton(e){e===`comment`&&(this.#a?.removeToolbarCommentButton(),this.#a=null,this.#o?.remove(),this.#o=null)}async addButton(e,t){switch(e){case`colorPicker`:t&&this.addColorPicker(t);break;case`altText`:t&&await this.addAltText(t);break;case`editSignature`:t&&await this.addEditSignatureButton(t);break;case`delete`:this.addDeleteButton();break;case`comment`:t&&this.addComment(t)}}async addButtonBefore(e,t,n){if(!t&&e===`comment`)return;let r=this.#r.querySelector(n);r&&e===`comment`&&this.addComment(t,r)}updateEditSignatureButton(e){this.#s&&(this.#s.title=e)}remove(){this.#e.remove(),this.#t?.destroy(),this.#t=null}},us=class{#e=null;#t=null;#n;constructor(e){this.#n=e}#r(){let e=this.#t=document.createElement(`div`);e.className=`editToolbar`,e.setAttribute(`role`,`toolbar`),e.dir=this.#n.direction;let t=this.#n._signal;t instanceof AbortSignal&&!t.aborted&&e.addEventListener(`contextmenu`,gt,{signal:t});let n=this.#e=document.createElement(`div`);return n.className=`buttons`,e.append(n),this.#n.hasCommentManager()&&this.#a(`commentButton`,`pdfjs-comment-floating-button`,`pdfjs-comment-floating-button-label`,()=>{this.#n.commentSelection(`floating_button`)}),this.#a(`highlightButton`,`pdfjs-highlight-floating-button1`,`pdfjs-highlight-floating-button-label`,()=>{this.#n.highlightSelection(`floating_button`)}),e}#i(e,t){let n=0,r=0;for(let i of e){let e=i.y+i.height;if(e<n)continue;let a=i.x+(t?i.width:0);e>n?(r=a,n=e):t?a>r&&(r=a):a<r&&(r=a)}return[t?1-r:r,n]}show(e,t,n){let[r,i]=this.#i(t,n),{style:a}=this.#t||=this.#r();e.append(this.#t),a.insetInlineEnd=`${100*r}%`,a.top=`calc(${100*i}% + var(--editor-toolbar-vert-offset))`}hide(){this.#t.remove()}#a(e,t,n,r){let i=document.createElement(`button`);i.classList.add(`basic`,e),i.tabIndex=0,i.setAttribute(`data-l10n-id`,t);let a=document.createElement(`span`);i.append(a),a.className=`visuallyHidden`,a.setAttribute(`data-l10n-id`,n);let o=this.#n._signal;o instanceof AbortSignal&&!o.aborted&&(i.addEventListener(`contextmenu`,gt,{signal:o}),i.addEventListener(`click`,r,{signal:o})),this.#e.append(i)}},ds=Object.freeze({internal:`2837668c-d334-48d1-ba74-aa7deba483da`}),fs=class e{static#e=NaN;static#t=null;static#n=NaN;static#r=null;static initializeAndAddPointerId(t){(e.#t||=new Set).add(t)}static setPointer(t,n){e.#e||=n,e.#r??=t}static setTimeStamp(t){e.#n=t}static isSamePointerId(t){return e.#e===t}static isSamePointerIdOrRemove(t){return e.#e===t||(e.#t?.delete(t),!1)}static isSamePointerType(t){return e.#r===t}static isInitializedAndDifferentPointerType(t){return e.#r!==null&&!e.isSamePointerType(t)}static isSameTimeStamp(t){return e.#n===t}static isUsingMultiplePointers(){return e.#t?.size>=1}static clearPointerType(){e.#r=null}static clearPointerIds(){e.#e=NaN,e.#t=null}static clearTimeStamp(){e.#n=NaN}},ps=class{#e=0;get id(){return`${So}${this.#e++}`}},ms=class e{#e=st();#t=0;#n=null;static get _isSVGFittingCanvas(){let e=`data:image/svg+xml;charset=UTF-8,<svg viewBox="0 0 1 1" width="1" height="1" xmlns="${vo}"><rect width="1" height="1" style="fill:red;"/></svg>`,t=new OffscreenCanvas(1,3).getContext(`2d`,{willReadFrequently:!0}),n=new Image;n.src=e;let r=n.decode().then(()=>(t.drawImage(n,0,0,1,1,0,0,1,3),new Uint32Array(t.getImageData(0,0,1,1).data.buffer)[0]===0));return V(this,`_isSVGFittingCanvas`,r)}async#r(t,n){this.#n||=new Map;let r=this.#n.get(t);if(r===null)return null;if(r?.bitmap)return r.refCounter+=1,r;try{r||={bitmap:null,id:`image_${this.#e}_${this.#t++}`,refCounter:0,isSvg:!1};let t;if(typeof n==`string`?(r.url=n,t=await ut(n,`blob`)):n instanceof File?t=r.file=n:n instanceof Blob&&(t=n),t.type===`image/svg+xml`){let n=e._isSVGFittingCanvas,i=new FileReader,a=new Image,o=new Promise((e,t)=>{a.onload=()=>{r.bitmap=a,r.isSvg=!0,e()},i.onload=async()=>{let e=r.svgUrl=i.result;a.src=await n?`${e}#svgView(preserveAspectRatio(none))`:e},a.onerror=i.onerror=t});i.readAsDataURL(t),await o}else r.bitmap=await createImageBitmap(t);r.refCounter=1}catch(e){Xe(e),r=null}return this.#n.set(t,r),r&&this.#n.set(r.id,r),r}async getFromFile(e){let{lastModified:t,name:n,size:r,type:i}=e;return this.#r(`${t}_${n}_${r}_${i}`,e)}async getFromUrl(e){return this.#r(e,e)}async getFromBlob(e,t){let n=await t;return this.#r(e,n)}async getFromId(e){this.#n||=new Map;let t=this.#n.get(e);if(!t)return null;if(t.bitmap)return t.refCounter+=1,t;if(t.file)return this.getFromFile(t.file);if(t.blobPromise){let{blobPromise:e}=t;return delete t.blobPromise,this.getFromBlob(t.id,e)}return this.getFromUrl(t.url)}getFromCanvas(e,t){this.#n||=new Map;let n=this.#n.get(e);if(n?.bitmap)return n.refCounter+=1,n;let r=new OffscreenCanvas(t.width,t.height);return r.getContext(`2d`).drawImage(t,0,0),n={bitmap:r.transferToImageBitmap(),id:`image_${this.#e}_${this.#t++}`,refCounter:1,isSvg:!1},this.#n.set(e,n),this.#n.set(n.id,n),n}getSvgUrl(e){let t=this.#n.get(e);return t?.isSvg?t.svgUrl:null}deleteId(e){this.#n||=new Map;let t=this.#n.get(e);if(!t||(--t.refCounter,t.refCounter!==0))return;let{bitmap:n}=t;if(!t.url&&!t.file){let e=new OffscreenCanvas(n.width,n.height);e.getContext(`bitmaprenderer`).transferFromImageBitmap(n),t.blobPromise=e.convertToBlob()}n.close?.(),t.bitmap=null}isValidId(e){return e.startsWith(`image_${this.#e}_`)}},hs=class{#e=[];#t=!1;#n;#r=-1;constructor(e=128){this.#n=e}add({cmd:e,undo:t,post:n,mustExec:r,type:i=NaN,overwriteIfSameType:a=!1,keepUndo:o=!1}){if(r&&e(),this.#t)return;let s={cmd:e,undo:t,post:n,type:i};if(this.#r===-1){this.#e.length>0&&(this.#e.length=0),this.#r=0,this.#e.push(s);return}if(a&&this.#e[this.#r].type===i){o&&(s.undo=this.#e[this.#r].undo),this.#e[this.#r]=s;return}let c=this.#r+1;c===this.#n?this.#e.splice(0,1):(this.#r=c,c<this.#e.length&&this.#e.splice(c)),this.#e.push(s)}undo(){if(this.#r===-1)return;this.#t=!0;let{undo:e,post:t}=this.#e[this.#r];e(),t?.(),this.#t=!1,--this.#r}redo(){if(this.#r<this.#e.length-1){this.#r+=1,this.#t=!0;let{cmd:e,post:t}=this.#e[this.#r];e(),t?.(),this.#t=!1}}hasSomethingToUndo(){return this.#r!==-1}hasSomethingToRedo(){return this.#r<this.#e.length-1}cleanType(e){if(this.#r!==-1){for(let t=this.#r;t>=0;t--)if(this.#e[t].type!==e){this.#e.splice(t+1,this.#r-t),this.#r=t;return}this.#e.length=0,this.#r=-1}}destroy(){this.#e=null}},gs=class e{static ALT=1;static CTRL=2;static META=4;static SHIFT=8;constructor(t){this.callbacks=new Map;let{isMac:n}=Ho.platform;for(let[r,i,a={}]of t){let t=r.some(e=>e.startsWith(`mac+`));for(let o of r){let r=o;if(t){let e=o.startsWith(`mac+`);if(n!==e)continue;e&&(r=o.slice(4))}let[s,c]=e.#e(r);s!==null&&this.callbacks.getOrInsertComputed(s,Go).push({callback:i,options:a,modifiers:c})}}}static#e(t){let n=null,r=0;for(let i of t.split(`+`)){if(i=i.trim(),!i)continue;let a=i.toUpperCase(),o=e[a];if(o)r|=o;else{if(n!==null){Xe(`KeyboardManager: multiple keys in shortcut "${t}"`);break}n=a===`SPACE`?` `:i}}return n===null&&Xe(`KeyboardManager: no key found in shortcut "${t}"`),[n,r]}static#t(e){let t=/^(?:Key([A-Z])|(?:Digit|Numpad)(\d))$/.exec(e);return t?t[1]?.toLowerCase()??t[2]:null}exec(t,n){let r=this.callbacks.get(n.key);if(!r){if(/^[a-z]$/i.test(n.key))return;let t=e.#t(n.code);if(t===null||t===n.key||(r=this.callbacks.get(t),!r))return}let i=(n.altKey?e.ALT:0)|(n.ctrlKey?e.CTRL:0)|(n.metaKey?e.META:0)|(n.shiftKey?e.SHIFT:0),a=r.find(e=>e.modifiers===i);if(!a)return;let{callback:o,options:{bubbles:s=!1,args:c=[],checker:l=null}}=a;(!l||l(t,n))&&(o.bind(t,...c,n)(),s||_t(n))}},_s=class e{static _colorsMapping=new Map([[`CanvasText`,[0,0,0]],[`Canvas`,[255,255,255]]]);get _colors(){let e=new Map([[`CanvasText`,null],[`Canvas`,null]]);return bt(e),V(this,`_colors`,e)}convert(t){let n=yt(t);if(!window.matchMedia(`(forced-colors: active)`).matches)return n;for(let[t,r]of this._colors)if(r.every((e,t)=>e===n[t]))return e._colorsMapping.get(t);return n}getHexCode(e){let t=this._colors.get(e);return t?H.makeHexColor(...t):e}},vs=class e{#e=new AbortController;#t=null;#n=null;#r=new Map;#i=new Map;#a=null;#o=null;#s=null;#c=null;#l=null;#u=new hs;#d=null;#f=null;#p=null;#m=0;#h=new Set;#g=null;#_=null;#v=new Set;_editorUndoBar=null;#y=!1;#b=!1;#x=!1;#S=null;#C=null;#w=null;#T=null;#E=!1;#D=null;#O=new ps;#k=!1;#A=!1;#j=!1;#M=null;#N=null;#P=null;#F=null;#I=null;#L=Co.NONE;#R=new Set;#z=null;#B=null;#V=null;#H=null;#U=null;#W={isEditing:!1,isEmpty:!0,hasSomethingToUndo:!1,hasSomethingToRedo:!1,hasSelectedEditor:!1,hasSelectedText:!1};#G=[0,0];#K=null;#q=null;#J=null;#Y=null;#X=null;static TRANSLATE_SMALL=1;static TRANSLATE_BIG=10;static get _keyboardManager(){let t=e.prototype,n=e=>e.#q.contains(document.activeElement)&&document.activeElement.tagName!==`BUTTON`&&e.hasSomethingToControl(),r=(e,{target:t})=>{if(t instanceof HTMLInputElement){let{type:e}=t;return e!==`text`&&e!==`number`}return!0},i=this.TRANSLATE_SMALL,a=this.TRANSLATE_BIG;return V(this,`_keyboardManager`,new gs([[[`ctrl+a`,`mac+meta+a`],t.selectAll,{checker:r}],[[`ctrl+z`,`mac+meta+z`],t.undo,{checker:r}],[[`ctrl+y`,`ctrl+shift+z`,`mac+meta+shift+z`,`ctrl+shift+Z`,`mac+meta+shift+Z`],t.redo,{checker:r}],[[`Backspace`,`alt+Backspace`,`ctrl+Backspace`,`shift+Backspace`,`mac+Backspace`,`mac+alt+Backspace`,`mac+ctrl+Backspace`,`Delete`,`ctrl+Delete`,`shift+Delete`,`mac+Delete`],t.delete,{checker:r}],[[`Enter`],t.addNewEditorFromKeyboard,{checker:(e,{target:t})=>!(t instanceof HTMLButtonElement)&&e.#q.contains(t)&&!e.isEnterHandled}],[[`Space`],t.addNewEditorFromKeyboard,{checker:(e,{target:t})=>!(t instanceof HTMLButtonElement)&&e.#q.contains(document.activeElement)}],[[`Escape`],t.unselectAll],[[`ArrowLeft`],t.translateSelectedEditors,{args:[-i,0],checker:n}],[[`ctrl+ArrowLeft`,`mac+shift+ArrowLeft`],t.translateSelectedEditors,{args:[-a,0],checker:n}],[[`ArrowRight`],t.translateSelectedEditors,{args:[i,0],checker:n}],[[`ctrl+ArrowRight`,`mac+shift+ArrowRight`],t.translateSelectedEditors,{args:[a,0],checker:n}],[[`ArrowUp`],t.translateSelectedEditors,{args:[0,-i],checker:n}],[[`ctrl+ArrowUp`,`mac+shift+ArrowUp`],t.translateSelectedEditors,{args:[0,-a],checker:n}],[[`ArrowDown`],t.translateSelectedEditors,{args:[0,i],checker:n}],[[`ctrl+ArrowDown`,`mac+shift+ArrowDown`],t.translateSelectedEditors,{args:[0,a],checker:n}]]))}constructor(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h){let g=this._signal=this.#e.signal;this.#q=e,this.#J=t,this.#Y=n,this.#s=r,this.#d=i,this.#B=a,this.#U=s,this._eventBus=o;let _={signal:g,...ds};o.on(`editingaction`,this.onEditingAction.bind(this),_),o.on(`pagechanging`,this.onPageChanging.bind(this),_),o.on(`scalechanging`,this.onScaleChanging.bind(this),_),o.on(`rotationchanging`,this.onRotationChanging.bind(this),_),o.on(`setpreference`,this.onSetPreference.bind(this),_),o.on(`switchannotationeditorparams`,e=>this.updateParams(e.type,e.value),_),window.addEventListener(`pointerdown`,()=>{this.#A=!0},{capture:!0,signal:g}),window.addEventListener(`pointerup`,()=>{this.#A=!1},{capture:!0,signal:g}),window.addEventListener(`beforeunload`,this.endCurrentEditing.bind(this),{capture:!0,signal:g}),this.#ne(),this.#le(),this.#ae(),this.#c=s.annotationStorage,this.#S=s.filterFactory,this.#V=c,this.#T=l||null,this.#y=u,this.#b=d,this.#x=f,this.#I=p||null,this.viewParameters={realScale:es.PDF_TO_CSS_UNITS,rotation:0},this.isShiftKeyDown=!1,this._editorUndoBar=m||null,this._supportsPinchToZoom=h!==!1,i?.setSidebarUiManager(this)}destroy(){this.#X?.resolve(),this.#X=null,this.#e?.abort(),this.#e=null,this._signal=null;for(let e of this.#i.values())e.destroy();this.#i.clear(),this.#r.clear(),this.#v.clear(),this.#F?.clear(),this.#t=null,this.#R.clear(),this.#u.destroy(),this.#s?.destroy(),this.#d?.destroy(),this.#B?.destroy(),this.#D?.hide(),this.#D=null,this.#P?.destroy(),this.#P=null,this.#n=null,this.#C&&=(clearTimeout(this.#C),null),this.#K&&=(clearTimeout(this.#K),null),this._editorUndoBar?.destroy(),this.#U=null}combinedSignal(e){return AbortSignal.any([this._signal,e.signal])}get mlManager(){return this.#I}get useNewAltTextFlow(){return this.#b}get useNewAltTextWhenAddingImage(){return this.#x}get hcmFilter(){return V(this,`hcmFilter`,this.#V?this.#S.addHCMFilter(this.#V.foreground,this.#V.background):`none`)}get direction(){return V(this,`direction`,getComputedStyle(this.#q).direction)}get _highlightColors(){return V(this,`_highlightColors`,this.#T?new Map(this.#T.split(`,`).map(e=>(e=e.split(`=`).map(e=>e.trim()),e[1]=e[1].toUpperCase(),e))):null)}get highlightColors(){let{_highlightColors:e}=this;if(!e)return V(this,`highlightColors`,null);let t=new Map,n=!!this.#V;for(let[r,i]of e){let e=r.endsWith(`_HCM`);n&&e?t.set(r.replace(`_HCM`,``),i):!n&&!e&&t.set(r,i)}return V(this,`highlightColors`,t)}get highlightColorNames(){return V(this,`highlightColorNames`,this.highlightColors?new Map(Array.from(this.highlightColors,e=>e.reverse())):null)}getNonHCMColor(e){if(!this._highlightColors)return e;let t=this.highlightColorNames.get(e);return this._highlightColors.get(t)||e}getNonHCMColorName(e){return this.highlightColorNames.get(e)||e}setCurrentDrawingSession(e){e?(this.unselectAll(),this.disableUserSelect(!0)):this.disableUserSelect(!1),this.#p=e}setMainHighlightColorPicker(e){this.#P=e}editAltText(e,t=!1){this.#s?.editAltText(this,e,t)}hasCommentManager(){return!!this.#d}editComment(e,t,n,r){this.#d?.showDialog(this,e,t,n,r)}selectComment(e,t){(this.#i.get(e)?.getEditorByUID(t))?.toggleComment(!0,!0)}updateComment(e){this.#d?.updateComment(e.getData())}updatePopupColor(e){this.#d?.updatePopupColor(e)}removeComment(e){this.#d?.removeComments([e.uid])}deleteComment(e,t){let n=()=>{e.comment=t};this.addCommands({cmd:()=>{this._editorUndoBar?.show(n,`comment`),this.toggleComment(null),e.comment=null},undo:n,mustExec:!0})}toggleComment(e,t,n=void 0){this.#d?.toggleCommentPopup(e,t,n)}makeCommentColor(e,t){return e&&this.#d?.makeCommentColor(e,t)||null}getCommentDialogElement(){return this.#d?.dialogElement||null}async waitForEditorsRendered(e){if(this.#i.has(e-1))return;let{resolve:t,promise:n}=Promise.withResolvers(),r=n=>{n.pageNumber===e&&(this._eventBus.off(`editorsrendered`,r),t())};this._eventBus.on(`editorsrendered`,r,ds),await n}getSignature(e){this.#B?.getSignature({uiManager:this,editor:e})}get signatureManager(){return this.#B}switchToMode(e,t){this._eventBus.on(`annotationeditormodechanged`,t,{once:!0,signal:this._signal,...ds}),this._eventBus.dispatch(`showannotationeditorui`,{source:this,mode:e})}setPreference(e,t){this._eventBus.dispatch(`setpreference`,{source:this,name:e,value:t})}onSetPreference({name:e,value:t}){e===`enableNewAltTextWhenAddingImage`&&(this.#x=t)}onPageChanging({pageNumber:e}){this.#m=e-1}deletePage(e){for(let t of this.getEditors(e))t.remove();this.#i.delete(e),this.#m===e&&(this.#m=0)}focusMainContainer(){this.#q.focus()}findParent(e,t){for(let n of this.#i.values()){let{x:r,y:i,width:a,height:o}=n.div.getBoundingClientRect();if(e>=r&&e<=r+a&&t>=i&&t<=i+o)return n}return null}disableUserSelect(e=!1){this.#J.classList.toggle(`noUserSelect`,e)}addShouldRescale(e){this.#v.add(e)}removeShouldRescale(e){this.#v.delete(e)}onScaleChanging({scale:e}){this.commitOrRemove(),this.viewParameters.realScale=e*es.PDF_TO_CSS_UNITS;for(let e of this.#v)e.onScaleChanging();this.#p?.onScaleChanging()}onRotationChanging({pagesRotation:e}){this.commitOrRemove(),this.viewParameters.rotation=e}#Z({anchorNode:e}){return e.nodeType===Node.TEXT_NODE?e.parentElement:e}#Q(e){let{currentLayer:t}=this;if(t.hasTextLayer(e))return t;for(let t of this.#i.values())if(t.hasTextLayer(e))return t;return null}highlightSelection(e=``,t=!1){let n=document.getSelection();if(!n||n.isCollapsed)return;let{anchorNode:r,anchorOffset:i,focusNode:a,focusOffset:o}=n,s=n.toString(),c=this.#Z(n).closest(`.textLayer`),l=this.getSelectionBoxes(c);if(!l)return;n.empty();let u=this.#Q(c),d=this.#L===Co.NONE,f=()=>{let n=u?.createAndAddNewEditor({x:0,y:0},!1,{methodOfCreation:e,boxes:l,anchorNode:r,anchorOffset:i,focusNode:a,focusOffset:o,text:s});d&&this.showAllEditors(`highlight`,!0,!0),t&&n?.editComment()};d?this.switchToMode(Co.HIGHLIGHT,f):f()}commentSelection(e=``){this.highlightSelection(e,!0)}endCurrentEditing(){this.commitOrRemove(),this.currentLayer?.endDrawingSession(!1)}#$(){let e=document.getSelection();if(!e||e.isCollapsed)return;let t=this.#Z(e).closest(`.textLayer`),n=this.getSelectionBoxes(t);n&&(this.#D||=new us(this),this.#D.show(t,n,this.direction===`ltr`))}getAndRemoveDataFromAnnotationStorage(e){if(!this.#c)return null;let t=`${So}${e}`,n=this.#c.getRawValue(t);return n&&this.#c.remove(t),n}addToAnnotationStorage(e){!e.isEmpty()&&this.#c&&!this.#c.has(e.id)&&this.#c.setValue(e.id,e)}a11yAlert(e,t=null){let n=this.#Y;n&&(n.setAttribute(`data-l10n-id`,e),t?n.setAttribute(`data-l10n-args`,JSON.stringify(t)):n.removeAttribute(`data-l10n-args`))}#ee(){let e=document.getSelection();if(!e||e.isCollapsed){this.#z&&(this.#D?.hide(),this.#z=null,this.#ue({hasSelectedText:!1}));return}let{anchorNode:t}=e;if(t===this.#z)return;let n=this.#Z(e).closest(`.textLayer`);if(!n)this.#z&&(this.#D?.hide(),this.#z=null,this.#ue({hasSelectedText:!1}));else if(this.#D?.hide(),this.#z=t,this.#ue({hasSelectedText:!0}),(this.#L===Co.HIGHLIGHT||this.#L===Co.NONE)&&(this.#L===Co.HIGHLIGHT&&this.showAllEditors(`highlight`,!0,!0),this.#E=this.isShiftKeyDown,!this.isShiftKeyDown)){let e=this.#L===Co.HIGHLIGHT?this.#Q(n):null;if(e?.toggleDrawing(),this.#A){let t=new AbortController,n=this.combinedSignal(t),r=n=>{(n.type!==`pointerup`||n.button===0)&&(t.abort(),e?.toggleDrawing(!0),n.type===`pointerup`&&this.#te(`main_toolbar`))};window.addEventListener(`pointerup`,r,{signal:n}),window.addEventListener(`blur`,r,{signal:n})}else e?.toggleDrawing(!0),this.#te(`main_toolbar`)}}#te(e=``){this.#L===Co.HIGHLIGHT?this.highlightSelection(e):this.#y&&this.#$()}#ne(){document.addEventListener(`selectionchange`,this.#ee.bind(this),{signal:this._signal})}#re(){if(this.#w)return;this.#w=new AbortController;let e=this.combinedSignal(this.#w);window.addEventListener(`focus`,this.focus.bind(this),{signal:e}),window.addEventListener(`blur`,this.blur.bind(this),{signal:e})}#ie(){this.#w?.abort(),this.#w=null}blur(){if(this.isShiftKeyDown=!1,this.#E&&(this.#E=!1,this.#te(`main_toolbar`)),!this.hasSelection)return;let{activeElement:e}=document;for(let t of this.#R)if(t.div.contains(e)){this.#N=[t,e],t._focusEventsAllowed=!1;break}}focus(){if(!this.#N)return;let[e,t]=this.#N;this.#N=null,t.addEventListener(`focusin`,()=>{e._focusEventsAllowed=!0},{once:!0,signal:this._signal}),t.focus()}#ae(){if(this.#M)return;this.#M=new AbortController;let e=this.combinedSignal(this.#M);window.addEventListener(`keydown`,this.keydown.bind(this),{signal:e}),window.addEventListener(`keyup`,this.keyup.bind(this),{signal:e})}#oe(){this.#M?.abort(),this.#M=null}#se(){if(this.#f)return;this.#f=new AbortController;let e=this.combinedSignal(this.#f);document.addEventListener(`copy`,this.copy.bind(this),{signal:e}),document.addEventListener(`cut`,this.cut.bind(this),{signal:e}),document.addEventListener(`paste`,this.paste.bind(this),{signal:e})}#ce(){this.#f?.abort(),this.#f=null}#le(){let e=this._signal;document.addEventListener(`dragover`,this.dragOver.bind(this),{signal:e}),document.addEventListener(`drop`,this.drop.bind(this),{signal:e})}addEditListeners(){this.#ae(),this.setEditingState(!0)}removeEditListeners(){this.#oe(),this.setEditingState(!1)}dragOver(e){for(let{type:t}of e.dataTransfer.items)for(let n of this.#_)if(n.isHandlingMimeForPasting(t)){e.dataTransfer.dropEffect=`copy`,e.preventDefault();return}}drop(e){for(let t of e.dataTransfer.items)for(let n of this.#_)if(n.isHandlingMimeForPasting(t.type)){n.paste(t,this.currentLayer),e.preventDefault();return}}copy(e){if(e.preventDefault(),this.#t?.commitOrRemove(),!this.hasSelection)return;let t=[];for(let e of this.#R){let n=e.serialize(!0);n&&t.push(n)}t.length!==0&&e.clipboardData.setData(`application/pdfjs`,JSON.stringify(t))}cut(e){this.copy(e),this.delete()}async paste(e){e.preventDefault();let{clipboardData:t}=e;for(let e of t.items)for(let t of this.#_)if(t.isHandlingMimeForPasting(e.type)){t.paste(e,this.currentLayer);return}let n=t.getData(`application/pdfjs`);if(!n)return;try{n=JSON.parse(n)}catch(e){Xe(`paste: "${e.message}".`);return}if(!Array.isArray(n))return;this.unselectAll();let r=this.currentLayer;try{let e=[];for(let t of n){let n=await r.deserialize(t);if(!n)return;e.push(n)}this.addCommands({cmd:()=>{for(let t of e)this.#me(t);this.#_e(e)},undo:()=>{for(let t of e)t.remove()},mustExec:!0})}catch(e){Xe(`paste: "${e.message}".`)}}keydown(t){!this.isShiftKeyDown&&t.key===`Shift`&&(this.isShiftKeyDown=!0),this.#L!==Co.NONE&&!this.isEditorHandlingKeyboard&&e._keyboardManager.exec(this,t)}keyup(e){this.isShiftKeyDown&&e.key===`Shift`&&(this.isShiftKeyDown=!1,this.#E&&(this.#E=!1,this.#te(`main_toolbar`)))}onEditingAction({name:e}){switch(e){case`undo`:case`redo`:case`delete`:case`selectAll`:this[e]();break;case`highlightSelection`:this.highlightSelection(`context_menu`);break;case`commentSelection`:this.commentSelection(`context_menu`)}}updatePageIndex(e,t){for(let n of this.#o.get(e)||[])n.pageIndex=t;let n=this.#a.get(e);n&&(n.pageIndex=t,this.#i.set(t,n),this.#k?n.enable():n.disable())}startUpdatePages(){this.#a=new Map(this.#i),this.#i.clear();let e=this.#o=new Map,t=t=>{e.getOrInsertComputed(t.pageIndex,Go).push(t)};for(let e of this.#r.values())t(e);for(let[e,n]of this.#c)e.startsWith(So)&&!this.#r.has(e)&&Number.isInteger(n?.pageIndex)&&t(n)}endUpdatePages(){this.#a=null,this.#o=null}clonePage(e,t){for(let n of this.getEditors(e)){let e=n.serialize(n.mode!==Co.HIGHLIGHT);e&&(e.pageIndex=t,e.id=this.getId(),e.isClone=!0,delete e.popupRef,this.#c.setValue(e.id,e))}}findClonesForPage(e){let t=[],{pageIndex:n}=e;for(let[r,i]of this.#c)i.pageIndex===n&&i.isClone&&(this.#c.remove(r),t.push(e.deserialize(i).then(t=>{t&&(t.isClone=!0,e.addOrRebuild(t))})));return Promise.all(t)}#ue(e){Object.entries(e).some(([e,t])=>this.#W[e]!==t)&&(this._eventBus.dispatch(`editingstateschanged`,{source:this,details:Object.assign(this.#W,e)}),this.#L===Co.HIGHLIGHT&&e.hasSelectedEditor===!1&&this.#de([[wo.HIGHLIGHT_FREE,!0]]))}#de(e){this._eventBus.dispatch(`annotationeditorparamschanged`,{source:this,details:e})}setEditingState(e){e?(this.#re(),this.#se(),this.#ue({isEditing:this.#L!==Co.NONE,isEmpty:this.#ge(),hasSomethingToUndo:this.#u.hasSomethingToUndo(),hasSomethingToRedo:this.#u.hasSomethingToRedo(),hasSelectedEditor:!1})):(this.#ie(),this.#ce(),this.#ue({isEditing:!1}),this.disableUserSelect(!1))}registerEditorTypes(e){if(!this.#_){this.#_=e;for(let e of this.#_)this.#de(e.defaultPropertiesToUpdate)}}getId(){return this.#O.id}get currentLayer(){return this.#i.get(this.#m)}getLayer(e){return this.#i.get(e)}get currentPageIndex(){return this.#m}addLayer(e){this.#i.set(e.pageIndex,e),this.#k?e.enable():e.disable()}removeLayer(e){this.#i.delete(e.pageIndex)}async updateMode(e,t=null,n=!1,r=!1,i=!1,a=!1){if(this.#L!==e&&!(this.#X&&(await this.#X.promise,!this.#X))){if(this.#X=Promise.withResolvers(),this.#p?.commitOrRemove(),this.#L===Co.POPUP&&this.#d?.hideSidebar(),this.#d?.destroyPopup(),this.#L=e,e===Co.NONE){this.setEditingState(!1),this.#pe();for(let e of this.#r.values())e.hideStandaloneCommentButton();this._editorUndoBar?.hide(),this.toggleComment(null),this.#X.resolve()}else{for(let e of this.#r.values())e.addStandaloneCommentButton();e===Co.SIGNATURE&&await this.#B?.loadSignatures(),n&&fs.clearPointerType(),this.setEditingState(!0),await this.#fe(),this.unselectAll();for(let t of this.#i.values())t.updateMode(e);if(e===Co.POPUP){this.#n||=await this.#U.getAnnotationsByType(new Set(this.#_.map(e=>e._editorType)));let e=new Set,t=[];for(let n of this.#r.values()){let{annotationElementId:r,hasComment:i,deleted:a}=n;r&&e.add(r),i&&!a&&t.push(n.getData())}for(let n of this.#n){let{id:r,popupRef:i,contentsObj:a}=n;i&&a?.str&&!e.has(r)&&!this.#h.has(r)&&t.push(n)}this.#d?.showSidebar(t)}if(!t)r&&this.addNewEditorFromKeyboard(),this.#X.resolve();else{for(let e of this.#r.values())e.uid===t?(this.setSelected(e),a?e.editComment():i?e.enterInEditMode():e.focus()):e.unselect();this.#X.resolve()}}}}addNewEditorFromKeyboard(){this.currentLayer.canCreateNewEmptyEditor()&&this.currentLayer.addNewEditor()}updateToolbar(e){e.mode!==this.#L&&this._eventBus.dispatch(`switchannotationeditormode`,{source:this,...e})}updateParams(e,t){if(this.#_){switch(e){case wo.CREATE:this.currentLayer.addNewEditor(t);return;case wo.HIGHLIGHT_SHOW_ALL:this._eventBus.dispatch(`reporttelemetry`,{source:this,details:{type:`editing`,data:{type:`highlight`,action:`toggle_visibility`}}}),(this.#H||=new Map).set(e,t),this.showAllEditors(`highlight`,t)}if(this.hasSelection)for(let n of this.#R)n.updateParams(e,t);else for(let n of this.#_)n.updateDefaultParams(e,t)}}showAllEditors(e,t,n=!1){for(let n of this.#r.values())n.editorType===e&&n.show(t);(this.#H?.get(wo.HIGHLIGHT_SHOW_ALL)??!0)!==t&&this.#de([[wo.HIGHLIGHT_SHOW_ALL,t]])}enableWaiting(e=!1){if(this.#j!==e){this.#j=e;for(let t of this.#i.values())e?t.disableClick():t.enableClick(),t.div.classList.toggle(`waiting`,e)}}async#fe(){if(!this.#k){this.#k=!0;let e=[];for(let t of this.#i.values())e.push(t.enable());await Promise.all(e);for(let e of this.#r.values())e.enable()}}#pe(){if(this.unselectAll(),this.#k){this.#k=!1;for(let e of this.#i.values())e.disable();for(let e of this.#r.values())e.disable()}}*getEditors(e){for(let t of this.#r.values())t.pageIndex===e&&(yield t)}getEditor(e){return this.#r.get(e)}addEditor(e){this.#r.set(e.id,e)}removeEditor(e){e.div.contains(document.activeElement)&&(this.#C&&clearTimeout(this.#C),this.#C=setTimeout(()=>{this.focusMainContainer(),this.#C=null},0)),this.#r.delete(e.id),e.annotationElementId&&this.#F?.delete(e.annotationElementId),this.unselect(e),e.annotationElementId&&this.#h.has(e.annotationElementId)||this.#c?.remove(e.id)}addDeletedAnnotationElement(e){this.#h.add(e.annotationElementId),this.addChangedExistingAnnotation(e),e.deleted=!0}isDeletedAnnotationElement(e){return this.#h.has(e)}removeDeletedAnnotationElement(e){this.#h.delete(e.annotationElementId),this.removeChangedExistingAnnotation(e),e.deleted=!1}#me(e){let t=this.#i.get(e.pageIndex);t?t.addOrRebuild(e):(this.addEditor(e),this.addToAnnotationStorage(e))}setActiveEditor(e){this.#t!==e&&(this.#t=e,e&&this.#de(e.propertiesToUpdate))}get#he(){let e=null;for(e of this.#R);return e}updateUI(e){this.#he===e&&this.#de(e.propertiesToUpdate)}updateUIForDefaultProperties(e){this.#de(e.defaultPropertiesToUpdate)}toggleSelected(e){this.#R.has(e)?(this.#R.delete(e),e.unselect(),this.#ue({hasSelectedEditor:this.hasSelection})):(this.#R.add(e),e.select(),this.#de(e.propertiesToUpdate),this.#ue({hasSelectedEditor:!0}))}setSelected(e){this.updateToolbar({mode:e.mode,editId:e.uid}),this.#p?.commitOrRemove();for(let t of this.#R)t!==e&&t.unselect();this.#d?.destroyPopup(),this.#R.clear(),this.#R.add(e),e.select(),this.#de(e.propertiesToUpdate),this.#ue({hasSelectedEditor:!0})}get firstSelectedEditor(){return this.#R.values().next().value}unselect(e){e.unselect(),this.#R.delete(e),this.#ue({hasSelectedEditor:this.hasSelection})}get hasSelection(){return this.#R.size!==0}get isEnterHandled(){return this.#R.size===1&&this.firstSelectedEditor.isEnterHandled}undo(){this.#u.undo(),this.#ue({hasSomethingToUndo:this.#u.hasSomethingToUndo(),hasSomethingToRedo:!0,isEmpty:this.#ge()}),this._editorUndoBar?.hide()}redo(){this.#u.redo(),this.#ue({hasSomethingToUndo:!0,hasSomethingToRedo:this.#u.hasSomethingToRedo(),isEmpty:this.#ge()})}addCommands(e){this.#u.add(e),this.#ue({hasSomethingToUndo:!0,hasSomethingToRedo:!1,isEmpty:this.#ge()})}cleanUndoStack(e){this.#u.cleanType(e)}#ge(){if(this.#r.size===0)return!0;if(this.#r.size===1)for(let e of this.#r.values())return e.isEmpty();return!1}delete(){this.commitOrRemove();let e=this.currentLayer?.endDrawingSession(!0);if(!this.hasSelection&&!e)return;let t=e?[e]:[...this.#R],n=()=>{this._editorUndoBar?.show(r,t.length===1?t[0].editorType:t.length);for(let e of t)e.remove()},r=()=>{for(let e of t)this.#me(e)};this.addCommands({cmd:n,undo:r,mustExec:!0})}commitOrRemove(){this.#t?.commitOrRemove()}hasSomethingToControl(){return this.#t||this.hasSelection}#_e(e){for(let e of this.#R)e.unselect();this.#R.clear();for(let t of e)t.isEmpty()||(this.#R.add(t),t.select());this.#ue({hasSelectedEditor:this.hasSelection})}selectAll(){for(let e of this.#R)e.commit();this.#_e(this.#r.values())}unselectAll(){if(!(this.#t&&(this.#t.commitOrRemove(),this.#L!==Co.NONE))&&!this.#p?.commitOrRemove()&&(this.#d?.destroyPopup(),this.hasSelection)){for(let e of this.#R)e.unselect();this.#R.clear(),this.#ue({hasSelectedEditor:!1})}}translateSelectedEditors(e,t,n=!1){if(n||this.commitOrRemove(),!this.hasSelection)return;this.#G[0]+=e,this.#G[1]+=t;let[r,i]=this.#G,a=[...this.#R];this.#K&&clearTimeout(this.#K),this.#K=setTimeout(()=>{this.#K=null,this.#G[0]=this.#G[1]=0,this.addCommands({cmd:()=>{for(let e of a)this.#r.has(e.id)&&(e.translateInPage(r,i),e.translationDone())},undo:()=>{for(let e of a)this.#r.has(e.id)&&(e.translateInPage(-r,-i),e.translationDone())},mustExec:!1})},1e3);for(let n of a)n.translateInPage(e,t),n.translationDone()}setUpDragSession(){if(this.hasSelection){this.disableUserSelect(!0),this.#g=new Map;for(let e of this.#R)this.#g.set(e,{savedX:e.x,savedY:e.y,savedPageIndex:e.pageIndex,newX:0,newY:0,newPageIndex:-1})}}endDragSession(){if(!this.#g)return!1;this.disableUserSelect(!1);let e=this.#g;this.#g=null;let t=!1;for(let[{x:n,y:r,pageIndex:i},a]of e)a.newX=n,a.newY=r,a.newPageIndex=i,t||=n!==a.savedX||r!==a.savedY||i!==a.savedPageIndex;if(!t)return!1;let n=(e,t,n,r)=>{if(this.#r.has(e.id)){let i=this.#i.get(r);i?e._setParentAndPosition(i,t,n):(e.pageIndex=r,e.x=t,e.y=n)}};return this.addCommands({cmd:()=>{for(let[t,{newX:r,newY:i,newPageIndex:a}]of e)n(t,r,i,a)},undo:()=>{for(let[t,{savedX:r,savedY:i,savedPageIndex:a}]of e)n(t,r,i,a)},mustExec:!0}),!0}dragSelectedEditors(e,t){if(this.#g)for(let n of this.#g.keys())n.drag(e,t)}rebuild(e){if(e.parent===null){let t=this.getLayer(e.pageIndex);t?(t.changeParent(e),t.addOrRebuild(e)):(this.addEditor(e),this.addToAnnotationStorage(e),e.rebuild())}else e.parent.addOrRebuild(e)}get isEditorHandlingKeyboard(){return this.getActive()?.shouldGetKeyboardEvents()||this.#R.size===1&&this.firstSelectedEditor.shouldGetKeyboardEvents()}isActive(e){return this.#t===e}getActive(){return this.#t}getMode(){return this.#L}isEditingMode(){return this.#L!==Co.NONE}get imageManager(){return V(this,`imageManager`,new ms)}getSelectionBoxes(e){if(!e)return null;let t=document.getSelection();for(let n=0,r=t.rangeCount;n<r;n++)if(!e.contains(t.getRangeAt(n).commonAncestorContainer))return null;let{x:n,y:r,width:i,height:a}=e.getBoundingClientRect(),o;switch(e.getAttribute(`data-main-rotation`)){case`90`:o=(e,t,o,s)=>({x:(t-r)/a,y:1-(e+o-n)/i,width:s/a,height:o/i});break;case`180`:o=(e,t,o,s)=>({x:1-(e+o-n)/i,y:1-(t+s-r)/a,width:o/i,height:s/a});break;case`270`:o=(e,t,o,s)=>({x:1-(t+s-r)/a,y:(e-n)/i,width:s/a,height:o/i});break;default:o=(e,t,o,s)=>({x:(e-n)/i,y:(t-r)/a,width:o/i,height:s/a})}let s=[];for(let e=0,n=t.rangeCount;e<n;e++){let n=t.getRangeAt(e);if(!n.collapsed)for(let{x:e,y:t,width:r,height:i}of n.getClientRects())r!==0&&i!==0&&s.push(o(e,t,r,i))}return s.length===0?null:s}addChangedExistingAnnotation({annotationElementId:e,id:t}){(this.#l||=new Map).set(e,t)}removeChangedExistingAnnotation({annotationElementId:e}){this.#l?.delete(e)}renderAnnotationElement(e){let t=this.#l?.get(e.data.id);if(!t)return;let n=this.#c.getRawValue(t);n&&(this.#L!==Co.NONE||n.hasBeenModified)&&n.renderAnnotationElement(e)}setMissingCanvas(e,t,n){let r=this.#F?.get(e);r&&(r.setCanvas(t,n),this.#F.delete(e))}addMissingCanvas(e,t){(this.#F||=new Map).set(e,t)}},ys=class e{#e=null;#t=!1;#n=null;#r=null;#i=null;#a=null;#o=!1;#s=null;#c=null;#l=null;#u=null;#d=!1;static#f=null;static _l10n=null;constructor(t){this.#c=t,this.#d=t._uiManager.useNewAltTextFlow,e.#f||=Object.freeze({added:`pdfjs-editor-new-alt-text-added-button`,"added-label":`pdfjs-editor-new-alt-text-added-button-label`,missing:`pdfjs-editor-new-alt-text-missing-button`,"missing-label":`pdfjs-editor-new-alt-text-missing-button-label`,review:`pdfjs-editor-new-alt-text-to-review-button`,"review-label":`pdfjs-editor-new-alt-text-to-review-button-label`})}static initialize(t){e._l10n??=t}async render(){let t=this.#n=document.createElement(`button`);t.className=`altText`,t.tabIndex=`0`;let n=this.#r=document.createElement(`span`);t.append(n),this.#d?(t.classList.add(`new`),t.setAttribute(`data-l10n-id`,e.#f.missing),n.setAttribute(`data-l10n-id`,e.#f[`missing-label`])):(t.setAttribute(`data-l10n-id`,`pdfjs-editor-alt-text-button`),n.setAttribute(`data-l10n-id`,`pdfjs-editor-alt-text-button-label`));let r=this.#c._uiManager._signal;t.addEventListener(`contextmenu`,gt,{signal:r}),t.addEventListener(`pointerdown`,e=>e.stopPropagation(),{signal:r});let i=e=>{e.preventDefault(),this.#c._uiManager.editAltText(this.#c),this.#d&&this.#c._reportTelemetry({action:`pdfjs.image.alt_text.image_status_label_clicked`,data:{label:this.#p}})};return t.addEventListener(`click`,i,{capture:!0,signal:r}),t.addEventListener(`keydown`,e=>{e.target===t&&e.key===`Enter`&&(this.#o=!0,i(e))},{signal:r}),await this.#m(),t}get#p(){return this.#e&&`added`||this.#e===null&&this.guessedText&&`review`||`missing`}finish(){this.#n&&(this.#n.focus({focusVisible:this.#o}),this.#o=!1)}isEmpty(){return this.#d?this.#e===null:!this.#e&&!this.#t}hasData(){return this.#d?this.#e!==null||!!this.#l:this.isEmpty()}get guessedText(){return this.#l}async setGuessedText(t){this.#e===null&&(this.#l=t,this.#u=await e._l10n.get(`pdfjs-editor-new-alt-text-generated-alt-text-with-disclaimer`,{generatedAltText:t}),this.#m())}toggleAltTextBadge(e=!1){if(!this.#d||this.#e)this.#s?.remove(),this.#s=null;else{if(!this.#s){let e=this.#s=document.createElement(`div`);e.className=`noAltTextBadge`,this.#c.div.append(e)}this.#s.classList.toggle(`hidden`,!e)}}serialize(e){let t=this.#e;return!e&&this.#l===t&&(t=this.#u),{altText:t,decorative:this.#t,guessedText:this.#l,textWithDisclaimer:this.#u}}get data(){return{altText:this.#e,decorative:this.#t}}set data({altText:e,decorative:t,guessedText:n,textWithDisclaimer:r,cancel:i=!1}){n&&(this.#l=n,this.#u=r),(this.#e!==e||this.#t!==t)&&(i||(this.#e=e,this.#t=t),this.#m())}toggle(e=!1){this.#n&&(!e&&this.#a&&(clearTimeout(this.#a),this.#a=null),this.#n.disabled=!e)}shown(){this.#c._reportTelemetry({action:`pdfjs.image.alt_text.image_status_label_displayed`,data:{label:this.#p}})}destroy(){this.#n?.remove(),this.#n=null,this.#r=null,this.#i=null,this.#s?.remove(),this.#s=null}async#m(){let t=this.#n;if(!t)return;if(this.#d){if(t.classList.toggle(`done`,!!this.#e),t.setAttribute(`data-l10n-id`,e.#f[this.#p]),this.#r?.setAttribute(`data-l10n-id`,e.#f[`${this.#p}-label`]),!this.#e){this.#i?.remove();return}}else{if(!this.#e&&!this.#t){t.classList.remove(`done`),this.#i?.remove();return}t.classList.add(`done`),t.setAttribute(`data-l10n-id`,`pdfjs-editor-alt-text-edit-button`)}let n=this.#i;if(!n){this.#i=n=document.createElement(`span`),n.className=`tooltip`,n.setAttribute(`role`,`tooltip`),n.id=`alt-text-tooltip-${this.#c.id}`;let e=this.#c._uiManager._signal;e.addEventListener(`abort`,()=>{clearTimeout(this.#a),this.#a=null},{once:!0}),t.addEventListener(`mouseenter`,()=>{this.#a=setTimeout(()=>{this.#a=null,this.#i.classList.add(`show`),this.#c._reportTelemetry({action:`alt_text_tooltip`})},100)},{signal:e}),t.addEventListener(`mouseleave`,()=>{this.#a&&=(clearTimeout(this.#a),null),this.#i?.classList.remove(`show`)},{signal:e})}this.#t?n.setAttribute(`data-l10n-id`,`pdfjs-editor-alt-text-decorative-tooltip`):(n.removeAttribute(`data-l10n-id`),n.textContent=this.#e),n.parentNode||t.append(n),this.#c.getElementForAltText()?.setAttribute(`aria-describedby`,n.id)}},bs=class{#e=null;#t=null;#n=!1;#r=null;#i=null;#a=null;#o=null;#s=null;#c=!1;#l=null;constructor(e){this.#r=e}renderForToolbar(){let e=this.#t=document.createElement(`button`);return e.className=`comment`,this.#u(e,!1)}renderForStandalone(){let e=this.#e=document.createElement(`button`);e.className=`annotationCommentButton`;let t=this.#r.commentButtonPosition;if(t){let{style:n}=e;n.insetInlineEnd=`calc(${100*(this.#r._uiManager.direction===`ltr`?1-t[0]:t[0])}% - var(--comment-button-dim))`,n.top=`calc(${100*t[1]}% - var(--comment-button-dim))`;let r=this.#r.commentButtonColor;r&&(n.backgroundColor=r)}return this.#u(e,!0)}focusButton(){setTimeout(()=>{(this.#e??this.#t)?.focus()},0)}onUpdatedColor(){if(!this.#e)return;let e=this.#r.commentButtonColor;e&&(this.#e.style.backgroundColor=e),this.#r._uiManager.updatePopupColor(this.#r)}get commentButtonWidth(){return(this.#e?.getBoundingClientRect().width??0)/this.#r.parent.boundingClientRect.width}get commentPopupPositionInLayer(){if(this.#l)return this.#l;if(!this.#e)return null;let{x:e,y:t,height:n}=this.#e.getBoundingClientRect(),{x:r,y:i,width:a,height:o}=this.#r.parent.boundingClientRect;return[(e-r)/a,(t+n-i)/o]}set commentPopupPositionInLayer(e){this.#l=e}hasDefaultPopupPosition(){return this.#l===null}removeStandaloneCommentButton(){this.#e?.remove(),this.#e=null}removeToolbarCommentButton(){this.#t?.remove(),this.#t=null}setCommentButtonStates({selected:e,hasPopup:t}){this.#e&&(this.#e.classList.toggle(`selected`,e),this.#e.ariaExpanded=t)}#u(e,t){if(!this.#r._uiManager.hasCommentManager())return null;e.tabIndex=`0`,e.ariaHasPopup=`dialog`,t?(e.ariaControls=`commentPopup`,e.setAttribute(`data-l10n-id`,`pdfjs-show-comment-button`)):(e.ariaControlsElements=[this.#r._uiManager.getCommentDialogElement()],e.setAttribute(`data-l10n-id`,`pdfjs-editor-add-comment-button`));let n=this.#r._uiManager._signal;if(!(n instanceof AbortSignal)||n.aborted)return e;e.addEventListener(`contextmenu`,gt,{signal:n}),t&&(e.addEventListener(`focusin`,e=>{this.#r._focusEventsAllowed=!1,_t(e)},{capture:!0,signal:n}),e.addEventListener(`focusout`,e=>{this.#r._focusEventsAllowed=!0,_t(e)},{capture:!0,signal:n})),e.addEventListener(`pointerdown`,e=>e.stopPropagation(),{signal:n});let r=t=>{t.preventDefault(),e===this.#t?this.edit():this.#r.toggleComment(!0)};return e.addEventListener(`click`,r,{capture:!0,signal:n}),e.addEventListener(`keydown`,t=>{t.target===e&&t.key===`Enter`&&(this.#n=!0,r(t))},{signal:n}),e.addEventListener(`pointerenter`,()=>{this.#r.toggleComment(!1,!0)},{signal:n}),e.addEventListener(`pointerleave`,()=>{this.#r.toggleComment(!1,!1)},{signal:n}),e}edit(e){let t=this.commentPopupPositionInLayer,n,r;if(t)[n,r]=t;else{[n,r]=this.#r.commentButtonPosition;let{width:e,height:t,x:i,y:a}=this.#r;n=i+n*e,r=a+r*t}let i=this.#r.parent.boundingClientRect,{x:a,y:o,width:s,height:c}=i;this.#r._uiManager.editComment(this.#r,a+n*s,o+r*c,{...e,parentDimensions:i})}finish(){this.#t&&(this.#t.focus({focusVisible:this.#n}),this.#n=!1)}isDeleted(){return this.#c||this.#o===``}isEmpty(){return this.#o===null}hasBeenEdited(){return this.isDeleted()||this.#o!==this.#i}serialize(){return this.data}get data(){return{text:this.#o,richText:this.#a,date:this.#s,deleted:this.isDeleted()}}set data(e){e!==this.#o&&(this.#a=null),e===null?(this.#o=``,this.#c=!0):(this.#o=e,this.#s=new Date,this.#c=!1)}restoreData({text:e,richText:t,date:n}){this.#o=e,this.#a=t,this.#s=n,this.#c=!1}setInitialText(e,t=null){this.#i=e,this.data=e,this.#s=null,this.#a=t}shown(){}destroy(){this.#t?.remove(),this.#t=null,this.#e?.remove(),this.#e=null,this.#o=``,this.#a=null,this.#s=null,this.#r=null,this.#n=!1,this.#c=!1}},xs=1e-4,Ss=class{#e;#t=!1;#n=null;#r;#i;#a;#o;#s;#c=!1;#l=null;#u;#d=new Set;#f=null;#p;#m=null;#h=0;constructor({container:e,isPinchingDisabled:t=null,isPinchingStopped:n=null,onPinchStart:r=null,onPinching:i=null,onPinchEnd:a=null,onPanning:o=null,signal:s}){this.#e=e,this.#n=n,this.#r=t,this.#i=r,this.#a=i,this.#o=a,this.#s=o,this.#p=new AbortController,this.#u=AbortSignal.any([s,this.#p.signal]),e.addEventListener(`touchstart`,this.#g.bind(this),{passive:!1,signal:this.#u})}get MIN_TOUCH_DISTANCE_TO_PINCH(){return 35/is.pixelRatio}get MIN_TOUCH_DISTANCE_TO_SCALE(){return 4/is.pixelRatio}#g(e){if(this.#r?.())return;this.#v(e);let t=this.#d;for(let{identifier:n}of e.changedTouches)t.add(n);if(t.size===1)this.#_();else{if(!this.#m){this.#m=new AbortController;let e=AbortSignal.any([this.#u,this.#m.signal]),t=this.#e,n={signal:e,capture:!1,passive:!1};t.addEventListener(`touchmove`,this.#x.bind(this),n);let r=this.#S.bind(this);t.addEventListener(`touchend`,r,n),t.addEventListener(`touchcancel`,r,n),n.capture=!0,t.addEventListener(`pointerdown`,_t,n),t.addEventListener(`pointermove`,_t,n),t.addEventListener(`pointercancel`,Nt,n),t.addEventListener(`pointerup`,Nt,n),this.#i?.()}this.#c=Pt(e),this.#b(e)}}#_(){if(this.#l)return;let e=this.#l=new AbortController,t=AbortSignal.any([this.#u,e.signal]),n=this.#e,r={capture:!0,signal:t,passive:!1},i=e=>{e.pointerType===`touch`&&(this.#l?.abort(),this.#l=null)};n.addEventListener(`pointerdown`,e=>{e.pointerType===`touch`&&(_t(e),i(e))},r),n.addEventListener(`pointerup`,i,r),n.addEventListener(`pointercancel`,i,r)}#v(e){let t=this.#d;if(t.size===0)return;let n=this.#d=new Set;for(let{identifier:r}of e.touches)t.has(r)&&n.add(r)}#y(e){let t=this.#d,n=[];for(let r of e.touches)t.has(r.identifier)&&n.push(r);return n}#b(e){let t=this.#y(e);if(t.length!==2||this.#n?.()){this.#f=null;return}let[n,r]=t;this.#f={touch0X:n.screenX,touch0Y:n.screenY,touch1X:r.screenX,touch1Y:r.screenY,panX:(n.clientX+r.clientX)/2,panY:(n.clientY+r.clientY)/2,screenPanX:(n.screenX+r.screenX)/2,screenPanY:(n.screenY+r.screenY)/2}}#x(e){if(!this.#f)return;let t=this.#y(e);if(t.length!==2)return;let n=this.#c;if(this.#c=Pt(e),!this.#c)return;if(!n){this.#b(e);return}let[r,i]=t,{screenX:a,screenY:o}=r,{screenX:s,screenY:c}=i,l=this.#f,{touch0X:u,touch0Y:d,touch1X:f,touch1Y:p,panX:m,panY:h}=l,g=f-u,_=p-d,v=s-a,y=c-o,b=(r.clientX+i.clientX)/2,x=(r.clientY+i.clientY)/2;l.panX=b,l.panY=x;let S=b-m,C=x-h,w=(a+s)/2,T=(o+c)/2,E=Math.hypot(w-l.screenPanX,T-l.screenPanY);l.screenPanX=w,l.screenPanY=T;let D=Math.hypot(v,y),O=Math.hypot(g,_),k=this.#t?this.MIN_TOUCH_DISTANCE_TO_SCALE:this.MIN_TOUCH_DISTANCE_TO_PINCH+2*E;if(D<xs||O<xs||Math.abs(O-D)<=k){(S||C)&&this.#s?.(S,C);return}l.touch0X=a,l.touch0Y=o,l.touch1X=s,l.touch1Y=c;let A=Math.sign(D-O);if(!this.#t)this.#t=!0,this.#h=A,(S||C)&&this.#s?.(S,C);else{if(this.#h){let e=this.#h;if(this.#h=0,A!==e&&Math.abs(D-O)<=2*E){this.#t=!1,(S||C)&&this.#s?.(S,C);return}}this.#a?.([m,h],O,D,S,C)}}#S(e){if(this.#v(e),this.#d.size>=2){this.#b(e);return}let t=!!this.#f;this.#C(),this.#d.size===1&&this.#_(),t&&Pt(e)}#C(){this.#f=null,this.#t=!1,this.#h=0,this.#c=!1,this.#m&&(this.#m.abort(),this.#m=null,this.#o?.())}destroy(){this.#C(),this.#d.clear(),this.#p?.abort(),this.#p=null,this.#l?.abort(),this.#l=null}},Cs=class e{#e=null;#t=null;#n=null;#r=null;#i=null;#a=!1;#o=null;#s=``;#c=null;#l=null;#u=null;#d=null;#f=null;#p=``;#m=!1;#h=null;#g=!1;#_=!1;#v=!1;#y=null;#b=0;#x=0;#S=null;#C=null;isSelected=!1;_isCopy=!1;_editToolbar=null;_initialOptions=Object.create(null);_initialData=null;_isVisible=!0;_uiManager=null;_focusEventsAllowed=!0;static _l10n=null;static _l10nAlert=null;static _l10nResizer=null;#w=!1;#T=e._zIndex++;static _borderLineWidth=-1;static _colorManager=new _s;static _zIndex=1;static _telemetryTimeout=1e3;static get _resizerKeyboardManager(){let t=e.prototype._resizeWithKeyboard,n=vs.TRANSLATE_SMALL,r=vs.TRANSLATE_BIG;return V(this,`_resizerKeyboardManager`,new gs([[[`ArrowLeft`],t,{args:[-n,0]}],[[`ctrl+ArrowLeft`,`mac+shift+ArrowLeft`],t,{args:[-r,0]}],[[`ArrowRight`],t,{args:[n,0]}],[[`ctrl+ArrowRight`,`mac+shift+ArrowRight`],t,{args:[r,0]}],[[`ArrowUp`],t,{args:[0,-n]}],[[`ctrl+ArrowUp`,`mac+shift+ArrowUp`],t,{args:[0,-r]}],[[`ArrowDown`],t,{args:[0,n]}],[[`ctrl+ArrowDown`,`mac+shift+ArrowDown`],t,{args:[0,r]}],[[`Escape`],e.prototype._stopResizingWithKeyboard]]))}constructor(e){this.parent=e.parent,this.id=e.id,this.width=this.height=null,this.pageIndex=e.parent.pageIndex,this.name=e.name,this.div=null,this._uiManager=e.uiManager,this.annotationElementId=null,this._willKeepAspectRatio=!1,this._initialOptions.isCentered=e.isCentered,this._structTreeParentId=null,this.annotationElementId=e.annotationElementId||null,this.creationDate=e.creationDate||new Date,this.modificationDate=e.modificationDate||null,this.canAddComment=!0;let{rotation:t,rawDims:{pageWidth:n,pageHeight:r,pageX:i,pageY:a}}=this.parent.viewport;this.rotation=t,this.pageRotation=(360+t-this._uiManager.viewParameters.rotation)%360,this.pageDimensions=[n,r],this.pageTranslation=[i,a];let[o,s]=this.parentDimensions;this.x=e.x/o,this.y=e.y/s,this.isAttachedToDOM=!1,this.deleted=!1}updatePageIndex(e){this.pageIndex=e}get editorType(){return Object.getPrototypeOf(this).constructor._type}get mode(){return Object.getPrototypeOf(this).constructor._editorType}static get isDrawer(){return!1}static get _defaultLineColor(){return V(this,`_defaultLineColor`,this._colorManager.getHexCode(`CanvasText`))}static deleteAnnotationElement(e){let t=new ws({id:e._uiManager.getId(),parent:e.parent,uiManager:e._uiManager});t.annotationElementId=e.annotationElementId,t.deleted=!0,t._uiManager.addToAnnotationStorage(t)}static initialize(t,n){if(e._l10n??=t,e._l10nAlert??=Object.freeze({highlight:`pdfjs-editor-highlight-added-alert`,freetext:`pdfjs-editor-freetext-added-alert`,ink:`pdfjs-editor-ink-added-alert`,stamp:`pdfjs-editor-stamp-added-alert`,signature:`pdfjs-editor-signature-added-alert`}),e._l10nResizer??=Object.freeze({topLeft:`pdfjs-editor-resizer-top-left`,topMiddle:`pdfjs-editor-resizer-top-middle`,topRight:`pdfjs-editor-resizer-top-right`,middleRight:`pdfjs-editor-resizer-middle-right`,bottomRight:`pdfjs-editor-resizer-bottom-right`,bottomMiddle:`pdfjs-editor-resizer-bottom-middle`,bottomLeft:`pdfjs-editor-resizer-bottom-left`,middleLeft:`pdfjs-editor-resizer-middle-left`}),e._borderLineWidth!==-1)return;let r=getComputedStyle(document.documentElement);e._borderLineWidth=parseFloat(r.getPropertyValue(`--outline-width`))||0}static updateDefaultParams(e,t){}static get defaultPropertiesToUpdate(){return[]}static isHandlingMimeForPasting(e){return!1}static paste(e,t){Ze(`Not implemented`)}get propertiesToUpdate(){return[]}get _isDraggable(){return this.#w}set _isDraggable(e){this.#w=e,this.div?.classList.toggle(`draggable`,e)}get uid(){return this.annotationElementId||this.id}get isEnterHandled(){return!0}center(){let[e,t]=this.pageDimensions;switch(this.parentRotation){case 90:this.x-=this.height*t/(e*2),this.y+=this.width*e/(t*2);break;case 180:this.x+=this.width/2,this.y+=this.height/2;break;case 270:this.x+=this.height*t/(e*2),this.y-=this.width*e/(t*2);break;default:this.x-=this.width/2,this.y-=this.height/2}this.fixAndSetPosition()}addCommands(e){this._uiManager.addCommands(e)}get currentLayer(){return this._uiManager.currentLayer}setInBackground(){this.div.style.zIndex=0}setInForeground(){this.div.style.zIndex=this.#T}setParent(e){e===null?(this.#G(),this.#d?.remove(),this.#d=null):(this.pageIndex=e.pageIndex,this.pageDimensions=e.pageDimensions),this.parent=e}focusin(e){this._focusEventsAllowed&&(this.#m?this.#m=!1:this.parent.setSelected(this))}focusout(e){this._focusEventsAllowed&&this.isAttachedToDOM&&(e.relatedTarget?.closest(`#${this.id}`)||(e.preventDefault(),this.parent?.isMultipleSelection||this.commitOrRemove()))}commitOrRemove(){this.isEmpty()?this.remove():this.commit()}commit(){this.isInEditMode()&&this.addToAnnotationStorage()}addToAnnotationStorage(){this._uiManager.addToAnnotationStorage(this)}setAt(e,t,n,r){let[i,a]=this.parentDimensions;[n,r]=this.screenToPageTranslation(n,r),this.x=(e+n)/i,this.y=(t+r)/a,this.fixAndSetPosition()}_moveAfterPaste(e,t){if(this.isClone){delete this.isClone;return}let[n,r]=this.parentDimensions;this.setAt(e*n,t*r,this.width*n,this.height*r),this._onTranslated()}#E([e,t],n,r){[n,r]=this.screenToPageTranslation(n,r),this.x+=n/e,this.y+=r/t,this._onTranslating(this.x,this.y),this.fixAndSetPosition()}translate(e,t){this.#E(this.parentDimensions,e,t)}translateInPage(e,t){this.#h||=[this.x,this.y,this.width,this.height],this.#E(this.pageDimensions,e,t),this.div.scrollIntoView({block:`nearest`})}translationDone(){this._onTranslated(this.x,this.y)}drag(e,t){this.#h||=[this.x,this.y,this.width,this.height];let{div:n,parentDimensions:[r,i]}=this;if(this.x+=e/r,this.y+=t/i,this.parent&&(this.x<0||this.x>1||this.y<0||this.y>1)){let{x:e,y:t}=this.div.getBoundingClientRect();this.parent.findNewParent(this,e,t)&&(this.x-=Math.floor(this.x),this.y-=Math.floor(this.y))}let{x:a,y:o}=this,[s,c]=this.getBaseTranslation();a+=s,o+=c;let{style:l}=n;l.left=`${(100*a).toFixed(2)}%`,l.top=`${(100*o).toFixed(2)}%`,this._onTranslating(a,o)}_onTranslating(e,t){}_onTranslated(e,t){}get _hasBeenMoved(){return!!this.#h&&(this.#h[0]!==this.x||this.#h[1]!==this.y)}get _hasBeenResized(){return!!this.#h&&(this.#h[2]!==this.width||this.#h[3]!==this.height)}getBaseTranslation(){let[t,n]=this.parentDimensions,{_borderLineWidth:r}=e,i=r/t,a=r/n;switch(this.rotation){case 90:return[-i,a];case 180:return[i,a];case 270:return[i,-a];default:return[-i,-a]}}get _mustFixPosition(){return!0}fixAndSetPosition(e=this.rotation){let{div:{style:t},pageDimensions:[n,r]}=this,{x:i,y:a,width:o,height:s}=this;if(o*=n,s*=r,i*=n,a*=r,this._mustFixPosition)switch(e){case 0:i=lt(i,0,n-o),a=lt(a,0,r-s);break;case 90:i=lt(i,0,n-s),a=lt(a,o,r);break;case 180:i=lt(i,o,n),a=lt(a,s,r);break;case 270:i=lt(i,s,n),a=lt(a,0,r-o)}this.x=i/=n,this.y=a/=r;let[c,l]=this.getBaseTranslation();i+=c,a+=l,t.left=`${(100*i).toFixed(2)}%`,t.top=`${(100*a).toFixed(2)}%`,this.moveInDOM()}static#D(e,t,n){switch(n){case 90:return[t,-e];case 180:return[-e,-t];case 270:return[-t,e];default:return[e,t]}}screenToPageTranslation(t,n){return e.#D(t,n,this.parentRotation)}pageTranslationToScreen(t,n){return e.#D(t,n,360-this.parentRotation)}#O(e){switch(e){case 90:{let[e,t]=this.pageDimensions;return[0,-e/t,t/e,0]}case 180:return[-1,0,0,-1];case 270:{let[e,t]=this.pageDimensions;return[0,e/t,-t/e,0]}default:return[1,0,0,1]}}get parentScale(){return this._uiManager.viewParameters.realScale}get parentRotation(){return(this._uiManager.viewParameters.rotation+this.pageRotation)%360}get parentDimensions(){let{parentScale:e,pageDimensions:[t,n]}=this;return[t*e,n*e]}setDims(){let{div:{style:e},width:t,height:n}=this;e.width=`${(100*t).toFixed(2)}%`,e.height=`${(100*n).toFixed(2)}%`}getInitialTranslation(){return[0,0]}#k(){if(this.#c)return;this.#c=document.createElement(`div`),this.#c.classList.add(`resizers`);let e=this._willKeepAspectRatio?[`topLeft`,`topRight`,`bottomRight`,`bottomLeft`]:[`topLeft`,`topMiddle`,`topRight`,`middleRight`,`bottomRight`,`bottomMiddle`,`bottomLeft`,`middleLeft`],t=this._uiManager._signal;for(let n of e){let e=document.createElement(`div`);this.#c.append(e),e.classList.add(`resizer`,n),e.setAttribute(`data-resizer-name`,n),e.addEventListener(`pointerdown`,this.#A.bind(this,n),{signal:t}),e.addEventListener(`contextmenu`,gt,{signal:t}),e.tabIndex=-1}this.div.prepend(this.#c)}#A(e,t){t.preventDefault();let{isMac:n}=Ho.platform;if(t.button!==0||t.ctrlKey&&n)return;this.#n?.toggle(!1);let r=this._isDraggable;this._isDraggable=!1,this.#l=[t.screenX,t.screenY];let i=new AbortController,a=this._uiManager.combinedSignal(i);this.parent.togglePointerEvents(!1),window.addEventListener(`pointermove`,this.#N.bind(this,e),{passive:!0,capture:!0,signal:a}),window.addEventListener(`touchmove`,_t,{passive:!1,signal:a}),window.addEventListener(`contextmenu`,gt,{signal:a}),this.#u={savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height};let o=this.parent.div.style.cursor,s=this.div.style.cursor;this.div.style.cursor=this.parent.div.style.cursor=window.getComputedStyle(t.target).cursor;let c=()=>{i.abort(),this.parent.togglePointerEvents(!0),this.#n?.toggle(!0),this._isDraggable=r,this.parent.div.style.cursor=o,this.div.style.cursor=s,this.#M()};window.addEventListener(`pointerup`,c,{signal:a}),window.addEventListener(`blur`,c,{signal:a})}#j(e,t,n,r){this.width=n,this.height=r,this.x=e,this.y=t,this.setDims(),this.fixAndSetPosition(),this._onResized()}_onResized(){}#M(){if(!this.#u)return;let{savedX:e,savedY:t,savedWidth:n,savedHeight:r}=this.#u;this.#u=null;let i=this.x,a=this.y,o=this.width,s=this.height;(i!==e||a!==t||o!==n||s!==r)&&this.addCommands({cmd:this.#j.bind(this,i,a,o,s),undo:this.#j.bind(this,e,t,n,r),mustExec:!0})}static _round(e){return Math.round(e*1e4)/1e4}#N(t,n){let[r,i]=this.parentDimensions,a=this.x,o=this.y,s=this.width,c=this.height,l=e.MIN_SIZE/r,u=e.MIN_SIZE/i,d=this.#O(this.rotation),f=(e,t)=>[d[0]*e+d[2]*t,d[1]*e+d[3]*t],p=this.#O(360-this.rotation),m=(e,t)=>[p[0]*e+p[2]*t,p[1]*e+p[3]*t],h,g,_=!1,v=!1;switch(t){case`topLeft`:_=!0,h=(e,t)=>[0,0],g=(e,t)=>[e,t];break;case`topMiddle`:h=(e,t)=>[e/2,0],g=(e,t)=>[e/2,t];break;case`topRight`:_=!0,h=(e,t)=>[e,0],g=(e,t)=>[0,t];break;case`middleRight`:v=!0,h=(e,t)=>[e,t/2],g=(e,t)=>[0,t/2];break;case`bottomRight`:_=!0,h=(e,t)=>[e,t],g=(e,t)=>[0,0];break;case`bottomMiddle`:h=(e,t)=>[e/2,t],g=(e,t)=>[e/2,0];break;case`bottomLeft`:_=!0,h=(e,t)=>[0,t],g=(e,t)=>[e,0];break;case`middleLeft`:v=!0,h=(e,t)=>[0,t/2],g=(e,t)=>[e,t/2]}let y=h(s,c),b=g(s,c),x=f(...b),S=e._round(a+x[0]),C=e._round(o+x[1]),w=1,T=1,E,D;if(n.fromKeyboard)({deltaX:E,deltaY:D}=n);else{let{screenX:e,screenY:t}=n,[r,i]=this.#l;[E,D]=this.screenToPageTranslation(e-r,t-i),this.#l[0]=e,this.#l[1]=t}if([E,D]=m(E/r,D/i),_){let e=Math.hypot(s,c);w=T=Math.max(Math.min(Math.hypot(b[0]-y[0]-E,b[1]-y[1]-D)/e,1/s,1/c),l/s,u/c)}else v?w=lt(Math.abs(b[0]-y[0]-E),l,1)/s:T=lt(Math.abs(b[1]-y[1]-D),u,1)/c;let O=e._round(s*w),k=e._round(c*T);x=f(...g(O,k));let A=S-x[0],j=C-x[1];this.#h||=[this.x,this.y,this.width,this.height],this.width=O,this.height=k,this.x=A,this.y=j,this.setDims(),this.fixAndSetPosition(),this._onResizing()}_onResizing(){}altTextFinish(){this.#n?.finish()}get toolbarButtons(){return null}async addEditToolbar(){if(this._editToolbar||this.#_)return this._editToolbar;this._editToolbar=new ls(this),this.div.append(this._editToolbar.render());let{toolbarButtons:e}=this;if(e)for(let[t,n]of e)await this._editToolbar.addButton(t,n);return this.hasComment||this._editToolbar.addButton(`comment`,this.addCommentButton()),this._editToolbar.addButton(`delete`),this._editToolbar}addCommentButtonInToolbar(){this._editToolbar?.addButtonBefore(`comment`,this.addCommentButton(),`.deleteButton`)}removeCommentButtonFromToolbar(){this._editToolbar?.removeButton(`comment`)}removeEditToolbar(){this._editToolbar?.remove(),this._editToolbar=null,this.#n?.destroy()}addContainer(e){let t=this._editToolbar?.div;t?t.before(e):this.div.append(e)}getClientDimensions(){return this.div.getBoundingClientRect()}createAltText(){return this.#n||(ys.initialize(e._l10n),this.#n=new ys(this),this.#e&&=(this.#n.data=this.#e,null)),this.#n}get altTextData(){return this.#n?.data}set altTextData(e){this.#n&&(this.#n.data=e)}get guessedAltText(){return this.#n?.guessedText}async setGuessedAltText(e){await this.#n?.setGuessedText(e)}serializeAltText(e){return this.#n?.serialize(e)}hasAltText(){return!!this.#n&&!this.#n.isEmpty()}hasAltTextData(){return this.#n?.hasData()??!1}focusCommentButton(){this.#r?.focusButton()}addCommentButton(){return this.canAddComment?this.#r||=new bs(this):null}addStandaloneCommentButton(){this._uiManager.hasCommentManager()&&(this.#i?this._uiManager.isEditingMode()&&this.#i.classList.remove(`hidden`):this.hasComment&&(this.#i=this.#r.renderForStandalone(),this.div.append(this.#i)))}removeStandaloneCommentButton(){this.#r.removeStandaloneCommentButton(),this.#i=null}hideStandaloneCommentButton(){this.#i?.classList.add(`hidden`)}get comment(){if(!this.#r)return null;let{data:{richText:e,text:t,date:n,deleted:r}}=this.#r;return{text:t,richText:e,date:n,deleted:r,color:this.getNonHCMColor(),opacity:this.opacity??1}}set comment(e){this.#r||=new bs(this),typeof e==`object`&&e?this.#r.restoreData(e):this.#r.data=e,this.hasComment?(this.removeCommentButtonFromToolbar(),this.addStandaloneCommentButton(),this._uiManager.updateComment(this)):(this.addCommentButtonInToolbar(),this.removeStandaloneCommentButton(),this._uiManager.removeComment(this))}setCommentData({comment:e,popupRef:t,richText:n}){if(!t||(this.#r||=new bs(this),this.#r.setInitialText(e,n),!this.annotationElementId))return;let r=this._uiManager.getAndRemoveDataFromAnnotationStorage(this.annotationElementId);r&&this.updateFromAnnotationLayer(r)}get hasEditedComment(){return this.#r?.hasBeenEdited()}get hasDeletedComment(){return this.#r?.isDeleted()}get hasComment(){return!!this.#r&&!this.#r.isEmpty()&&!this.#r.isDeleted()}async editComment(e){this.#r||=new bs(this),this.#r.edit(e)}toggleComment(e,t=void 0){this.hasComment&&this._uiManager.toggleComment(this,e,t)}setSelectedCommentButton(e){this.#r.setSelectedButton(e)}addComment(e){if(this.hasEditedComment){let[,,,t]=e.rect,[n]=this.pageDimensions,[r]=this.pageTranslation,i=r+n+1,a=t-100,o=i+180;e.popup={contents:this.comment.text,deleted:this.comment.deleted,rect:[i,a,o,t]}}}updateFromAnnotationLayer({popup:{contents:e,deleted:t}}){this.#r.data=t?null:e}get parentBoundingClientRect(){return this.parent.boundingClientRect}render(){let e=this.div=document.createElement(`div`);e.setAttribute(`data-editor-rotation`,(360-this.rotation)%360),e.className=this.name,e.setAttribute(`id`,this.id),e.tabIndex=this.#a?-1:0,e.setAttribute(`role`,`application`),this.defaultL10nId&&e.setAttribute(`data-l10n-id`,this.defaultL10nId),this._isVisible||e.classList.add(`hidden`),this.setInForeground(),this.#z();let[t,n]=this.parentDimensions;this.parentRotation%180!=0&&(e.style.maxWidth=`${(100*n/t).toFixed(2)}%`,e.style.maxHeight=`${(100*t/n).toFixed(2)}%`);let[r,i]=this.getInitialTranslation();return this.translate(r,i),Mt(this,e,[`keydown`,`pointerdown`,`dblclick`]),this.#B(),this.addStandaloneCommentButton(),this._uiManager._editorUndoBar?.hide(),e}#P(){this.#u={savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height},this.#n?.toggle(!1),this.parent.togglePointerEvents(!1)}#F(t,n,r){let i=.7,a=r/n*i+1-i;if(a===1)return;let o=this.#O(this.rotation),s=(e,t)=>[o[0]*e+o[2]*t,o[1]*e+o[3]*t],[c,l]=this.parentDimensions,u=this.x,d=this.y,f=this.width,p=this.height,m=e.MIN_SIZE/c,h=e.MIN_SIZE/l;a=Math.max(Math.min(a,1/f,1/p),m/f,h/p);let g=e._round(f*a),_=e._round(p*a);if(g===f&&_===p)return;this.#h||=[u,d,f,p];let v=s(f/2,p/2),y=e._round(u+v[0]),b=e._round(d+v[1]),x=s(g/2,_/2);this.x=y-x[0],this.y=b-x[1],this.width=g,this.height=_,this.setDims(),this.fixAndSetPosition(),this._onResizing()}#I(){this.#n?.toggle(!0),this.parent.togglePointerEvents(!0),this.#M()}pointerdown(e){let{isMac:t}=Ho.platform;e.button!==0||e.ctrlKey&&t?e.preventDefault():(this.#m=!0,this._isDraggable?this.#R(e):this.#L(e))}#L(e){let{isMac:t}=Ho.platform;e.ctrlKey&&!t||e.shiftKey||e.metaKey&&t?this.parent.toggleSelected(this):this.parent.setSelected(this)}#R(e){let{isSelected:t}=this;this._uiManager.setUpDragSession();let n=!1,r=new AbortController,i=this._uiManager.combinedSignal(r),a={capture:!0,passive:!1,signal:i},o=e=>{r.abort(),this.#o=null,this.#m=!1,this._uiManager.endDragSession()||this.#L(e),n&&this._onStopDragging()};t&&(this.#b=e.clientX,this.#x=e.clientY,this.#o=e.pointerId,this.#s=e.pointerType,window.addEventListener(`pointermove`,e=>{n||(n=!0,this._uiManager.toggleComment(this,!0,!1),this._onStartDragging());let{clientX:t,clientY:r,pointerId:i}=e;if(i!==this.#o){_t(e);return}let[a,o]=this.screenToPageTranslation(t-this.#b,r-this.#x);this.#b=t,this.#x=r,this._uiManager.dragSelectedEditors(a,o),this.div.scrollIntoView({block:`nearest`})},a),window.addEventListener(`touchmove`,_t,a),window.addEventListener(`pointerdown`,e=>{e.pointerType===this.#s&&(this.#C||e.isPrimary)&&o(e),_t(e)},a));let s=e=>{!this.#o||this.#o===e.pointerId?o(e):_t(e)};window.addEventListener(`pointerup`,s,{signal:i}),window.addEventListener(`blur`,s,{signal:i})}_onStartDragging(){}_onStopDragging(){}moveInDOM(){this.#y&&clearTimeout(this.#y),this.#y=setTimeout(()=>{this.#y=null,this.parent?.moveEditorInDOM(this)},0)}_setParentAndPosition(e,t,n){e.changeParent(this),this.x=t,this.y=n,this.fixAndSetPosition(),this._onTranslated()}getRect(e,t,n=this.rotation){let r=this.parentScale,[i,a]=this.pageDimensions,[o,s]=this.pageTranslation,c=e/r,l=t/r,u=this.x*i,d=this.y*a,f=this.width*i,p=this.height*a;switch(n){case 0:return[u+c+o,a-d-l-p+s,u+c+f+o,a-d-l+s];case 90:return[u+l+o,a-d+c+s,u+l+p+o,a-d+c+f+s];case 180:return[u-c-f+o,a-d+l+s,u-c+o,a-d+l+p+s];case 270:return[u-l-p+o,a-d-c-f+s,u-l+o,a-d-c+s];default:throw Error(`Invalid rotation`)}}getRectInCurrentCoords(e,t){let[n,r,i,a]=e,o=i-n,s=a-r;switch(this.rotation){case 0:return[n,t-a,o,s];case 90:return[n,t-r,s,o];case 180:return[i,t-r,o,s];case 270:return[i,t-a,s,o];default:throw Error(`Invalid rotation`)}}getPDFRect(){return this.getRect(0,0)}getNonHCMColor(){return this.color&&e._colorManager.convert(this._uiManager.getNonHCMColor(this.color))}onUpdatedColor(){this.#r?.onUpdatedColor()}getData(){let{comment:{text:e,color:t,date:n,opacity:r,deleted:i,richText:a},uid:o,pageIndex:s,creationDate:c,modificationDate:l}=this;return{id:o,pageIndex:s,rect:this.getPDFRect(),richText:a,contentsObj:{str:e},creationDate:c,modificationDate:n||l,popupRef:!i,color:t,opacity:r}}onceAdded(e){}isEmpty(){return!1}enableEditMode(){return!this.isInEditMode()&&(this.parent.setEditingState(!1),this.#_=!0,!0)}disableEditMode(){return this.isInEditMode()?(this.parent.setEditingState(!0),this.#_=!1,!0):!1}isInEditMode(){return this.#_}shouldGetKeyboardEvents(){return this.#v}needsToBeRebuilt(){return this.div&&!this.isAttachedToDOM}get isOnScreen(){let{top:e,left:t,bottom:n,right:r}=this.getClientDimensions(),{innerHeight:i,innerWidth:a}=window;return t<a&&r>0&&e<i&&n>0}#z(){if(this.#f||!this.div)return;this.#f=new AbortController;let e=this._uiManager.combinedSignal(this.#f);this.div.addEventListener(`focusin`,this.focusin.bind(this),{signal:e}),this.div.addEventListener(`focusout`,this.focusout.bind(this),{signal:e})}#B(){this.#C||!this.div||!this.isResizable||!this._uiManager._supportsPinchToZoom||(this.#C=new Ss({container:this.div,isPinchingDisabled:()=>!this.isSelected,onPinchStart:this.#P.bind(this),onPinching:this.#F.bind(this),onPinchEnd:this.#I.bind(this),signal:this._uiManager._signal}))}rebuild(){this.#z(),this.#B()}rotate(e){}resize(){}serializeDeleted(){return{id:this.annotationElementId,deleted:!0,pageIndex:this.pageIndex,popupRef:this._initialData?.popupRef||``}}serialize(e=!1,t=null){return{annotationType:this.mode,pageIndex:this.pageIndex,rect:this.getPDFRect(),rotation:this.rotation,structTreeParentId:this._structTreeParentId,popupRef:this._initialData?.popupRef||``}}static async deserialize(e,t,n){let r=new this.prototype.constructor({parent:t,id:n.getId(),uiManager:n,annotationElementId:e.annotationElementId,creationDate:e.creationDate,modificationDate:e.modificationDate});r.rotation=e.rotation,r.#e=e.accessibilityData,r._isCopy=e.isCopy||!1;let[i,a]=r.pageDimensions,[o,s,c,l]=r.getRectInCurrentCoords(e.rect,a);return r.x=o/i,r.y=s/a,r.width=c/i,r.height=l/a,r}get hasBeenModified(){return!!this.annotationElementId&&(this.deleted||this.serialize()!==null)}remove(){if(this.#f?.abort(),this.#f=null,this.isEmpty()||this.commit(),this.#C?.destroy(),this.#C=null,this.parent?this.parent.remove(this):this._uiManager.removeEditor(this),this.hideCommentPopup(),this.#y&&=(clearTimeout(this.#y),null),this.#G(),this.removeEditToolbar(),this.#S){for(let e of this.#S.values())clearTimeout(e);this.#S=null}this.parent=null,this.#d?.remove(),this.#d=null}get isResizable(){return!1}makeResizable(){this.isResizable&&(this.#k(),this.#c.classList.remove(`hidden`))}get toolbarPosition(){return null}get commentButtonPosition(){return this._uiManager.direction===`ltr`?[1,0]:[0,0]}get commentButtonPositionInPage(){let{commentButtonPosition:[t,n]}=this,[r,i,a,o]=this.getPDFRect();return[e._round(r+(a-r)*t),e._round(i+(o-i)*(1-n))]}get commentButtonColor(){return this._uiManager.makeCommentColor(this.getNonHCMColor(),this.opacity)}get commentPopupPosition(){return this.#r.commentPopupPositionInLayer}set commentPopupPosition(e){this.#r.commentPopupPositionInLayer=e}hasDefaultPopupPosition(){return this.#r.hasDefaultPopupPosition()}get commentButtonWidth(){return this.#r.commentButtonWidth}get elementBeforePopup(){return this.div}setCommentButtonStates(e){this.#r?.setCommentButtonStates(e)}keydown(t){if(!this.isResizable||t.target!==this.div||t.key!==`Enter`)return;this._uiManager.setSelected(this),this.#u={savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height};let n=this.#c.children;if(!this.#t){this.#t=Array.from(n);let t=this.#V.bind(this),r=this.#H.bind(this),i=this._uiManager._signal;for(let n of this.#t){let a=n.getAttribute(`data-resizer-name`);n.setAttribute(`role`,`spinbutton`),n.addEventListener(`keydown`,t,{signal:i}),n.addEventListener(`blur`,r,{signal:i}),n.addEventListener(`focus`,this.#U.bind(this,a),{signal:i}),n.setAttribute(`data-l10n-id`,e._l10nResizer[a])}}let r=this.#t[0],i=0;for(let e of n){if(e===r)break;i++}let a=(360-this.rotation+this.parentRotation)%360/90*(this.#t.length/4);if(a!==i){if(a<i)for(let e=0;e<i-a;e++)this.#c.append(this.#c.firstElementChild);else if(a>i)for(let e=0;e<a-i;e++)this.#c.firstElementChild.before(this.#c.lastElementChild);let t=0;for(let r of n){let n=this.#t[t++].getAttribute(`data-resizer-name`);r.setAttribute(`data-l10n-id`,e._l10nResizer[n])}}this.#W(0),this.#v=!0,this.#c.firstElementChild.focus({focusVisible:!0}),t.preventDefault(),t.stopImmediatePropagation()}#V(t){e._resizerKeyboardManager.exec(this,t)}#H(e){this.#v&&e.relatedTarget?.parentNode!==this.#c&&this.#G()}#U(e){this.#p=this.#v?e:``}#W(e){if(this.#t)for(let t of this.#t)t.tabIndex=e}_resizeWithKeyboard(e,t){this.#v&&this.#N(this.#p,{deltaX:e,deltaY:t,fromKeyboard:!0})}#G(){this.#v=!1,this.#W(-1),this.#M()}_stopResizingWithKeyboard(){this.#G(),this.div.focus()}select(){this.isSelected&&this._editToolbar?this._editToolbar.show():(this.isSelected=!0,this.makeResizable(),this.div?.classList.add(`selectedEditor`),this._editToolbar?(this._editToolbar?.show(),this.#n?.toggleAltTextBadge(!1)):this.addEditToolbar().then(()=>{this.div?.classList.contains(`selectedEditor`)&&this._editToolbar?.show()}))}focus(){this.div&&!this.div.contains(document.activeElement)&&setTimeout(()=>this.div?.focus({preventScroll:!0}),0)}unselect(){this.isSelected&&(this.isSelected=!1,this.#c?.classList.add(`hidden`),this.div?.classList.remove(`selectedEditor`),this.div?.contains(document.activeElement)&&this._uiManager.currentLayer.div.focus({preventScroll:!0}),this._editToolbar?.hide(),this.#n?.toggleAltTextBadge(!0),this.hideCommentPopup())}hideCommentPopup(){this.hasComment&&this._uiManager.toggleComment(null)}updateParams(e,t){}disableEditing(){}enableEditing(){}get canChangeContent(){return!1}enterInEditMode(){this.canChangeContent&&(this.enableEditMode(),this.div.focus())}dblclick(e){e.target.nodeName!==`BUTTON`&&(this.enterInEditMode(),this.parent.updateToolbar({mode:this.constructor._editorType,editId:this.uid}))}getElementForAltText(){return this.div}get contentDiv(){return this.div}get isEditing(){return this.#g}set isEditing(e){this.#g=e,this.parent&&(e?(this.parent.setSelected(this),this.parent.setActiveEditor(this)):this.parent.setActiveEditor(null))}static get MIN_SIZE(){return 16}static canCreateNewEmptyEditor(){return!0}get telemetryInitialData(){return{action:`added`}}get telemetryFinalData(){return null}_reportTelemetry(t,n=!1){if(n){this.#S||=new Map;let{action:n}=t,r=this.#S.get(n);r&&clearTimeout(r),r=setTimeout(()=>{this._reportTelemetry(t),this.#S.delete(n),this.#S.size===0&&(this.#S=null)},e._telemetryTimeout),this.#S.set(n,r)}else t.type||=this.editorType,this._uiManager._eventBus.dispatch(`reporttelemetry`,{source:this,details:{type:`editing`,data:t}})}show(e=this._isVisible){this.div.classList.toggle(`hidden`,!e),this._isVisible=e}enable(){this.div&&(this.div.tabIndex=0),this.#a=!1}disable(){this.div&&(this.div.tabIndex=-1),this.#a=!0}updateFakeAnnotationElement(e){!this.#d&&!this.deleted?this.#d=e.addFakeAnnotation(this):this.deleted?(this.#d.remove(),this.#d=null):(this.hasEditedComment||this._hasBeenMoved||this._hasBeenResized)&&this.#d.updateEdited({rect:this.getPDFRect(),popup:this.comment})}renderAnnotationElement(e){if(this.deleted)return e.hide(),null;let t=e.container.querySelector(`.annotationContent`);if(!t)t=document.createElement(`div`),t.classList.add(`annotationContent`,this.editorType),e.container.prepend(t);else if(t.nodeName===`CANVAS`){let e=t;t=document.createElement(`div`),t.classList.add(`annotationContent`,this.editorType),e.before(t)}return t}resetAnnotationElement(e){let{firstElementChild:t}=e.container;t?.nodeName===`DIV`&&t.classList.contains(`annotationContent`)&&t.remove()}},ws=class extends Cs{constructor(e){super(e),this.annotationElementId=e.annotationElementId,this.deleted=!0}serialize(){return this.serializeDeleted()}},Ts=3285377520,Es=4294901760,Ds=65535,Os=class{constructor(e){this.h1=e?e|0:Ts,this.h2=e?e|0:Ts}update(e){let t,n;if(typeof e==`string`){t=new Uint8Array(e.length*2),n=0;for(let r=0,i=e.length;r<i;r++){let i=e.charCodeAt(r);i<=255?t[n++]=i:(t[n++]=i>>>8,t[n++]=i&255)}}else if(ArrayBuffer.isView(e))t=e.slice(),n=t.byteLength;else throw Error(`Invalid data format, must be a string or TypedArray.`);let r=n>>2,i=n-r*4,a=new Uint32Array(t.buffer,0,r),o=0,s=0,c=this.h1,l=this.h2,u=3432918353,d=461845907,f=11601,p=13715;for(let e=0;e<r;e++)e&1?(o=a[e],o=o*u&Es|o*f&Ds,o=o<<15|o>>>17,o=o*d&Es|o*p&Ds,c^=o,c=c<<13|c>>>19,c=c*5+3864292196):(s=a[e],s=s*u&Es|s*f&Ds,s=s<<15|s>>>17,s=s*d&Es|s*p&Ds,l^=s,l=l<<13|l>>>19,l=l*5+3864292196);switch(o=0,i){case 3:o^=t[r*4+2]<<16;case 2:o^=t[r*4+1]<<8;case 1:o^=t[r*4],o=o*u&Es|o*f&Ds,o=o<<15|o>>>17,o=o*d&Es|o*p&Ds,r&1?c^=o:l^=o}this.h1=c,this.h2=l}hexdigest(){let e=this.h1,t=this.h2;return e^=t>>>1,e=e*3981806797&Es|e*36045&Ds,t=t*4283543511&Es|((t<<16|e>>>16)*2950163797&Es)>>>16,e^=t>>>1,e=e*444984403&Es|e*60499&Ds,t=t*3301882366&Es|((t<<16|e>>>16)*3120437893&Es)>>>16,e^=t>>>1,(e>>>0).toString(16).padStart(8,`0`)+(t>>>0).toString(16).padStart(8,`0`)}},ks=Object.freeze({map:null,hash:``,transfer:void 0}),As=class{#e=!1;#t=null;#n=null;#r=new Map;onSetModified=null;onResetModified=null;onAnnotationEditor=null;getValue(e,t){let n=this.#r.get(e);return n===void 0?t:Object.assign(t,n)}getRawValue(e){return this.#r.get(e)}remove(e){let t=this.#r.get(e);t!==void 0&&(t instanceof Cs&&this.#n.delete(t.annotationElementId),this.#r.delete(e),this.#r.size===0&&this.resetModified(),!this.#r.values().some(e=>e instanceof Cs)&&this.onAnnotationEditor?.(null))}setValue(e,t){let n=this.#r.get(e),r=!1;if(n!==void 0)for(let[e,i]of Object.entries(t))n[e]!==i&&(r=!0,n[e]=i);else r=!0,this.#r.set(e,t);r&&this.#i(),t instanceof Cs&&((this.#n||=new Map).set(t.annotationElementId,t),this.onAnnotationEditor?.(t.constructor._type))}has(e){return this.#r.has(e)}get size(){return this.#r.size}#i(){this.#e||(this.#e=!0,this.onSetModified?.())}resetModified(){this.#e&&(this.#e=!1,this.onResetModified?.())}get print(){return new js(this)}get serializable(){if(this.#r.size===0)return ks;let e=new Map,t=new Os,n=[],r=Object.create(null),i=!1;for(let[n,a]of this.#r){let o=a instanceof Cs?a.serialize(!1,r):a;a.page&&(a.pageIndex=a.page._pageIndex,delete a.page),o&&(e.set(n,o),t.update(`${n}:${JSON.stringify(o)}`),i||=!!o.bitmap)}if(i)for(let t of e.values())t.bitmap&&n.push(t.bitmap);return e.size>0?{map:e,hash:t.hexdigest(),transfer:n}:ks}get editorStats(){let e=null,t=new Map,n=0,r=0;for(let i of this.#r.values()){if(!(i instanceof Cs)){i.popup&&(i.popup.deleted?r+=1:n+=1);continue}i.isCommentDeleted?r+=1:i.hasEditedComment&&(n+=1);let a=i.telemetryFinalData;if(!a)continue;let{type:o}=a;t.getOrInsertComputed(o,()=>Object.getPrototypeOf(i).constructor),e||=Object.create(null);let s=e[o]||=new Map;for(let[e,t]of Object.entries(a)){if(e===`type`)continue;let n=s.getOrInsertComputed(e,Ko);n.set(t,(n.get(t)??0)+1)}}if((r>0||n>0)&&(e||=Object.create(null),e.comments={deleted:r,edited:n}),!e)return null;for(let[n,r]of t)e[n]=r.computeTelemetryFinalData(e[n]);return e}resetModifiedIds(){this.#t=null}updateEditor(e,t){let n=this.#n?.get(e);return n?(n.updateFromAnnotationLayer(t),!0):!1}getEditor(e){return this.#n?.get(e)||null}get modifiedIds(){if(this.#t)return this.#t;let e=[];if(this.#n)for(let t of this.#n.values())t.serialize()&&e.push(t.annotationElementId);let t=``;if(e.length){let n=new Os;n.update(e.join(`,`)),t=n.hexdigest()}return this.#t={ids:new Set(e),hash:t}}[Symbol.iterator](){return this.#r.entries()}},js=class extends As{#e=ks;constructor(e){super();let{serializable:t}=e;if(t===ks)return;let{map:n,hash:r,transfer:i}=t,a=structuredClone(n,i?{transfer:i}:null);this.#e={map:a,hash:r,transfer:[]}}get print(){Ze(`Should not call PrintAnnotationStorage.print`)}get serializable(){return this.#e}get modifiedIds(){return V(this,`modifiedIds`,{ids:new Set,hash:``})}},za(),Ms=`__forcedDependency`,{floor:Ns,ceil:Ps}=Math,Fs=new Uint32Array(new Uint8Array([255,255,0,0]).buffer)[0],Is=class{#e;#t;constructor(e,t){this.#e=e,this.#t=t}get length(){return this.#e.length}isEmpty(e){return this.#e[e]===Fs}minX(e){return this.#t[e*4+0]/256}minY(e){return this.#t[e*4+1]/256}maxX(e){return(this.#t[e*4+2]+1)/256}maxY(e){return(this.#t[e*4+3]+1)/256}},Ls=(e,t)=>e?.getOrInsertComputed(t,()=>({dependencies:new Set,isRenderingOperation:!1})),Rs=class{#e=[[1,0,0,1,0,0]];#t=[-1/0,-1/0,1/0,1/0];#n=new Float64Array(ho);_pendingBBoxIdx=-1;#r;#i;#a;#o;_savesStack=[];_markedContentStack=[];constructor(e,t){this.#r=e.width,this.#i=e.height,this.#s(t)}growOperationsCount(e){e>=this.#o.length&&this.#s(e,this.#o)}#s(e,t){let n=new ArrayBuffer(e*4);this.#a=new Uint8ClampedArray(n),this.#o=new Uint32Array(n),t&&t.length>0?(this.#o.set(t),this.#o.fill(Fs,t.length)):this.#o.fill(Fs)}get clipBox(){return this.#t}save(e){return this.#t={__proto__:this.#t},this._savesStack.push(e),this}restore(e,t){let n=Object.getPrototypeOf(this.#t);if(n===null)return this;this.#t=n;let r=this._savesStack.pop();return r!==void 0&&(t?.(r,e),this.#o[e]=this.#o[r]),this}recordOpenMarker(e){return this._savesStack.push(e),this}getOpenMarker(){return this._savesStack.length===0?null:this._savesStack.at(-1)}recordCloseMarker(e,t){let n=this._savesStack.pop();return n!==void 0&&(t?.(n,e),this.#o[e]=this.#o[n]),this}beginMarkedContent(e){return this._markedContentStack.push(e),this}endMarkedContent(e,t){let n=this._markedContentStack.pop();return n!==void 0&&(t?.(n,e),this.#o[e]=this.#o[n]),this}pushBaseTransform(e){return this.#e.push(H.multiplyByDOMMatrix(this.#e.at(-1),e.getTransform())),this}popBaseTransform(){return this.#e.length>1&&this.#e.pop(),this}resetBBox(e){return this._pendingBBoxIdx!==e&&(this._pendingBBoxIdx=e,this.#n.set(ho,0)),this}recordClipBox(e,t,n,r,i,a){let o=H.multiplyByDOMMatrix(this.#e.at(-1),t.getTransform()),s=ho.slice();H.axialAlignedBoundingBox([n,i,r,a],o,s);let c=H.intersect(this.#t,s);return c?(this.#t[0]=c[0],this.#t[1]=c[1],this.#t[2]=c[2],this.#t[3]=c[3]):(this.#t[0]=this.#t[1]=1/0,this.#t[2]=this.#t[3]=-1/0),this}recordBBox(e,t,n,r,i,a){let o=this.#t;if(o[0]===1/0)return this;let s=H.multiplyByDOMMatrix(this.#e.at(-1),t.getTransform());if(o[0]===-1/0)return H.axialAlignedBoundingBox([n,i,r,a],s,this.#n),this;let c=ho.slice();return H.axialAlignedBoundingBox([n,i,r,a],s,c),this.#n[0]=lt(c[0],o[0],this.#n[0]),this.#n[1]=lt(c[1],o[1],this.#n[1]),this.#n[2]=lt(c[2],this.#n[2],o[2]),this.#n[3]=lt(c[3],this.#n[3],o[3]),this}recordFullPageBBox(e){return this.#n[0]=Math.max(0,this.#t[0]),this.#n[1]=Math.max(0,this.#t[1]),this.#n[2]=Math.min(this.#r,this.#t[2]),this.#n[3]=Math.min(this.#i,this.#t[3]),this}recordOperation(e,t=!1,n){if(this._pendingBBoxIdx!==e)return this;let r=Ns(this.#n[0]*256/this.#r),i=Ns(this.#n[1]*256/this.#i),a=Ps(this.#n[2]*256/this.#r),o=Ps(this.#n[3]*256/this.#i);if(Ft(this.#a,e,r,i,a,o),n)for(let t of n)for(let n of t)n!==e&&Ft(this.#a,n,r,i,a,o);return t||(this._pendingBBoxIdx=-1),this}bboxToClipBoxDropOperation(e){return this._pendingBBoxIdx===e&&(this._pendingBBoxIdx=-1,this.#t[0]=Math.max(this.#t[0],this.#n[0]),this.#t[1]=Math.max(this.#t[1],this.#n[1]),this.#t[2]=Math.min(this.#t[2],this.#n[2]),this.#t[3]=Math.min(this.#t[3],this.#n[3])),this}take(){return new Is(this.#o,this.#a)}takeDebugMetadata(){throw Error(`Unreachable`)}recordSimpleData(e,t){return this}recordIncrementalData(e,t){return this}resetIncrementalData(e,t){return this}recordNamedData(e,t){return this}recordSimpleDataFromNamed(e,t,n){return this}recordFutureForcedDependency(e,t){return this}inheritSimpleDataAsFutureForcedDependencies(e){return this}inheritPendingDependenciesAsFutureForcedDependencies(){return this}recordCharacterBBox(e,t,n,r=1,i=0,a=0,o){return this}getSimpleIndex(e){}recordDependencies(e,t){return this}recordNamedDependency(e,t){return this}recordShowTextOperation(e,t=!1){return this}},zs=class{#e={__proto__:null};#t={__proto__:null,transform:[],moveText:[],sameLineText:[],[Ms]:[]};#n=new Map;#r=new Set;#i=new Map;#a;#o;#s;constructor(e,t=!1){this.#s=e,t&&(this.#a=new Map,this.#o=(e,t)=>{Ls(this.#a,t).dependencies.add(e)})}get clipBox(){return this.#s.clipBox}growOperationsCount(e){this.#s.growOperationsCount(e)}save(e){return this.#e={__proto__:this.#e},this.#t={__proto__:this.#t,transform:{__proto__:this.#t.transform},moveText:{__proto__:this.#t.moveText},sameLineText:{__proto__:this.#t.sameLineText},[Ms]:{__proto__:this.#t[Ms]}},this.#s.save(e),this}restore(e){this.#s.restore(e,this.#o);let t=Object.getPrototypeOf(this.#e);return t===null||(this.#e=t,this.#t=Object.getPrototypeOf(this.#t)),this}recordOpenMarker(e){return this.#s.recordOpenMarker(e,this.#o),this}getOpenMarker(){return this.#s.getOpenMarker()}recordCloseMarker(e){return this.#s.recordCloseMarker(e,this.#o),this}beginMarkedContent(e){return this.#s.beginMarkedContent(e),this}endMarkedContent(e){return this.#s.endMarkedContent(e,this.#o),this}pushBaseTransform(e){return this.#s.pushBaseTransform(e),this}popBaseTransform(){return this.#s.popBaseTransform(),this}recordSimpleData(e,t){return this.#e[e]=t,this}recordIncrementalData(e,t){return this.#t[e].push(t),this}resetIncrementalData(e,t){return this.#t[e].length=0,this}recordNamedData(e,t){return this.#n.set(e,t),this}recordSimpleDataFromNamed(e,t,n){this.#e[e]=this.#n.get(t)??n}recordFutureForcedDependency(e,t){return this.recordIncrementalData(Ms,t),this}inheritSimpleDataAsFutureForcedDependencies(e){for(let t of e)t in this.#e&&this.recordFutureForcedDependency(t,this.#e[t]);return this}inheritPendingDependenciesAsFutureForcedDependencies(){for(let e of this.#r)this.recordFutureForcedDependency(Ms,e);return this}resetBBox(e){return this.#s.resetBBox(e),this}recordClipBox(e,t,n,r,i,a){return this.#s.recordClipBox(e,t,n,r,i,a),this}recordBBox(e,t,n,r,i,a){return this.#s.recordBBox(e,t,n,r,i,a),this}recordCharacterBBox(e,t,n,r=1,i=0,a=0,o){let s=n.bbox,c,l;if(s&&(c=s[2]!==s[0]&&s[3]!==s[1]&&this.#i.get(n),c!==!1&&(l=[0,0,0,0],H.axialAlignedBoundingBox(s,n.fontMatrix,l),(r!==1||i!==0||a!==0)&&It(r,-r,i,a,l),c)))return this.recordBBox(e,t,l[0],l[2],l[1],l[3]);if(!o)return this.recordFullPageBBox(e);let u=o();return s&&l&&c===void 0&&(c=l[0]<=i-u.actualBoundingBoxLeft&&l[2]>=i+u.actualBoundingBoxRight&&l[1]<=a-u.actualBoundingBoxAscent&&l[3]>=a+u.actualBoundingBoxDescent,this.#i.set(n,c),c)?this.recordBBox(e,t,l[0],l[2],l[1],l[3]):this.recordBBox(e,t,i-u.actualBoundingBoxLeft,i+u.actualBoundingBoxRight,a-u.actualBoundingBoxAscent,a+u.actualBoundingBoxDescent)}recordFullPageBBox(e){return this.#s.recordFullPageBBox(e),this}getSimpleIndex(e){return this.#e[e]}recordDependencies(e,t){let n=this.#r,r=this.#e,i=this.#t;for(let e of t)e in this.#e?n.add(r[e]):e in i&&i[e].forEach(n.add,n);return this}recordNamedDependency(e,t){return this.#n.has(t)&&this.#r.add(this.#n.get(t)),this}recordOperation(e,t=!1){if(this.recordDependencies(e,[Ms]),this.#a){let t=Ls(this.#a,e),{dependencies:n}=t;this.#r.forEach(n.add,n),this.#s._savesStack.forEach(n.add,n),this.#s._markedContentStack.forEach(n.add,n),n.delete(e),t.isRenderingOperation=!0}let n=!t&&e===this.#s._pendingBBoxIdx;return this.#s.recordOperation(e,t,[this.#r,this.#s._savesStack,this.#s._markedContentStack]),n&&this.#r.clear(),this}recordShowTextOperation(e,t=!1){let n=Array.from(this.#r);this.recordOperation(e,t),this.recordIncrementalData(`sameLineText`,e);for(let e of n)this.recordIncrementalData(`sameLineText`,e);return this}bboxToClipBoxDropOperation(e,t=!1){let n=!t&&e===this.#s._pendingBBoxIdx;return this.#s.bboxToClipBoxDropOperation(e),n&&this.#r.clear(),this}take(){return this.#i.clear(),this.#s.take()}takeDebugMetadata(){return this.#a}},Bs=class e{#e;#t;#n;#r=0;#i=0;constructor(t,n,r){if(t instanceof e&&t.#n===!!r)return t;this.#e=t,this.#t=n,this.#n=!!r}get clipBox(){return this.#e.clipBox}growOperationsCount(){throw Error(`Unreachable`)}save(e){return this.#i++,this.#e.save(this.#t),this}restore(e){return this.#i>0&&(this.#e.restore(this.#t),this.#i--),this}recordOpenMarker(e){return this.#r++,this}getOpenMarker(){return this.#r>0?this.#t:this.#e.getOpenMarker()}recordCloseMarker(e){return this.#r--,this}beginMarkedContent(e){return this}endMarkedContent(e){return this}pushBaseTransform(e){return this.#e.pushBaseTransform(e),this}popBaseTransform(){return this.#e.popBaseTransform(),this}recordSimpleData(e,t){return this.#e.recordSimpleData(e,this.#t),this}recordIncrementalData(e,t){return this.#e.recordIncrementalData(e,this.#t),this}resetIncrementalData(e,t){return this.#e.resetIncrementalData(e,this.#t),this}recordNamedData(e,t){return this}recordSimpleDataFromNamed(e,t,n){return this.#e.recordSimpleDataFromNamed(e,t,this.#t),this}recordFutureForcedDependency(e,t){return this.#e.recordFutureForcedDependency(e,this.#t),this}inheritSimpleDataAsFutureForcedDependencies(e){return this.#e.inheritSimpleDataAsFutureForcedDependencies(e),this}inheritPendingDependenciesAsFutureForcedDependencies(){return this.#e.inheritPendingDependenciesAsFutureForcedDependencies(),this}resetBBox(e){return this.#n||this.#e.resetBBox(this.#t),this}recordClipBox(e,t,n,r,i,a){return this.#n||this.#e.recordClipBox(this.#t,t,n,r,i,a),this}recordBBox(e,t,n,r,i,a){return this.#n||this.#e.recordBBox(this.#t,t,n,r,i,a),this}recordCharacterBBox(e,t,n,r,i,a,o){return this.#n||this.#e.recordCharacterBBox(this.#t,t,n,r,i,a,o),this}recordFullPageBBox(e){return this.#n||this.#e.recordFullPageBBox(this.#t),this}getSimpleIndex(e){return this.#e.getSimpleIndex(e)}recordDependencies(e,t){return this.#e.recordDependencies(this.#t,t),this}recordNamedDependency(e,t){return this.#e.recordNamedDependency(this.#t,t),this}recordOperation(e){return this.#e.recordOperation(this.#t,!0),this}recordShowTextOperation(e){return this.#e.recordShowTextOperation(this.#t,!0),this}bboxToClipBoxDropOperation(e){return this.#n||this.#e.bboxToClipBoxDropOperation(this.#t,!0),this}take(){throw Error(`Unreachable`)}takeDebugMetadata(){throw Error(`Unreachable`)}},Vs={stroke:[`path`,`transform`,`filter`,`strokeColor`,`strokeAlpha`,`lineWidth`,`lineCap`,`lineJoin`,`miterLimit`,`dash`],fill:[`path`,`transform`,`filter`,`fillColor`,`fillAlpha`,`globalCompositeOperation`,`SMask`],imageXObject:[`transform`,`SMask`,`filter`,`fillAlpha`,`strokeAlpha`,`globalCompositeOperation`],rawFillPath:[`filter`,`fillColor`,`fillAlpha`],showText:[`transform`,`leading`,`charSpacing`,`wordSpacing`,`hScale`,`textRise`,`moveText`,`textMatrix`,`font`,`fontObj`,`filter`,`fillColor`,`textRenderingMode`,`SMask`,`fillAlpha`,`strokeAlpha`,`globalCompositeOperation`,`sameLineText`],transform:[`transform`],transformAndFill:[`transform`,`filter`,`fillColor`]},Hs=class e{#e;#t;#n=4;#r=0;#i=new e.#a(this.#n*6);static#a=Ho.isFloat16ArraySupported?Float16Array:Float32Array;constructor(e){this.#e=e.width,this.#t=e.height}record(t,n,r,i){if(this.#r===this.#n){this.#n*=2;let t=new e.#a(this.#n*6);t.set(this.#i),this.#i=t}let a=xt(t),o;if(i[0]!==1/0){let e=ho.slice();H.axialAlignedBoundingBox([0,-r,n,0],a,e);let t=H.intersect(i,e);if(!t)return;let[s,c,l,u]=t;if(s!==e[0]||c!==e[1]||l!==e[2]||u!==e[3]){let e=Math.atan2(a[1],a[0]),t=Math.abs(Math.sin(e)),n=Math.abs(Math.cos(e));if(t<1e-6||n<1e-6||Math.abs(t-n)<1e-6)o=[s,c,s,u,l,c];else{let e=l-s,r=u-c,i=t*t,a=n*n,d=n*t,f=a-i,p=(r*a-e*d)/f;o=[s+(r*d-e*i)/f,c,s,c+p,l,u-p]}}}o||(o=[0,-r,0,0,n,-r],H.applyTransform(o,a,0),H.applyTransform(o,a,2),H.applyTransform(o,a,4)),o[0]/=this.#e,o[1]/=this.#t,o[2]/=this.#e,o[3]/=this.#t,o[4]/=this.#e,o[5]/=this.#t,this.#i.set(o,this.#r*6),this.#r++}take(){return this.#i.subarray(0,this.#r*6)}},Us=/\p{Cc}/u,Ws=class{#e=new Set;#t=new Set;#n=null;constructor({ownerDocument:e=globalThis.document,styleElement:t=null}){this._document=e,this.styleElement=null,this.loadingRequests=[],this.loadTestFontId=0}addNativeFontFace(e){this.#e.add(e),this._document.fonts.add(e)}removeNativeFontFace(e){this.#e.delete(e),this._document.fonts.delete(e)}insertRule(e){let t=this.#r();t.insertRule(e,t.cssRules.length)}#r(){if(this.#n)return this.#n;let e=this._document.defaultView?.CSSStyleSheet||globalThis.CSSStyleSheet;if(!this.styleElement&&e){let{adoptedStyleSheets:t}=this._document;if(t){let n=new e;return t.push(n),this.#n=n}}return this.styleElement||(this.styleElement=this._document.createElement(`style`),this._document.documentElement.getElementsByTagName(`head`)[0].append(this.styleElement)),this.#n=this.styleElement.sheet}clear(){for(let e of this.#e)this._document.fonts.delete(e);if(this.#e.clear(),this.#t.clear(),this.#n){let{adoptedStyleSheets:e}=this._document;e?.includes(this.#n)&&(this._document.adoptedStyleSheets=e.filter(e=>e!==this.#n)),this.#n=null}this.styleElement?.remove(),this.styleElement=null}async loadSystemFont({systemFontInfo:e,disableFontFace:t,_inspectFont:n}){if(e&&!this.#t.has(e.loadedName)){if(Qe(!t,"loadSystemFont shouldn't be called when `disableFontFace` is set."),this.isFontLoadingAPISupported){let{loadedName:t,src:r,style:i}=e,a=new FontFace(t,r,i);this.addNativeFontFace(a);try{await a.load(),this.#t.add(t),n?.(e)}catch{Xe(`Cannot load system font: ${e.baseFontName}, installing it could help to improve PDF rendering.`),this.removeNativeFontFace(a)}}else Ze(`Not implemented: loadSystemFont without the Font Loading API.`)}}async bind(e){if(e.attached||e.missingFile&&!e.systemFontInfo)return;if(e.attached=!0,e.systemFontInfo){await this.loadSystemFont(e);return}if(this.isFontLoadingAPISupported){let t=e.createNativeFontFace();if(t){this.addNativeFontFace(t);try{await t.loaded}catch(n){throw Xe(`Failed to load font '${t.family}': '${n}'.`),e.disableFontFace=!0,n}}return}let t=e.createFontFaceRule();if(t){if(this.insertRule(t),this.isSyncFontLoadingSupported)return;await this.#i(e)}}get isFontLoadingAPISupported(){return V(this,`isFontLoadingAPISupported`,!!this._document?.fonts)}get isSyncFontLoadingSupported(){return V(this,`isSyncFontLoadingSupported`,mo||Ho.platform.isFirefox)}#i(e){function t(){for(Qe(!a.done,`completeRequest() cannot be called twice.`),a.done=!0;n.length>0&&n[0].done;){let e=n.shift();setTimeout(e.resolve,0)}}let{loadingRequests:n}=this,{promise:r,resolve:i}=Promise.withResolvers(),a={done:!1,resolve:i};n.push(a),this._loadTestFont??=atob(`T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACMAooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4DIP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAAAAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUAAQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgABAAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABYAAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAAAC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAAAAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQACAQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTjFQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA==`);function o(e,t){return e.charCodeAt(t)<<24|e.charCodeAt(t+1)<<16|e.charCodeAt(t+2)<<8|e.charCodeAt(t+3)&255}function s(e){return String.fromCharCode(e>>24&255,e>>16&255,e>>8&255,e&255)}function c(e,t,n,r){let i=e.substring(0,t),a=e.substring(t+n);return i+r+a}let l,u,d=this._document.createElement(`canvas`);d.width=1,d.height=1;let f=d.getContext(`2d`),p=0;function m(e,t){++p>30?(Xe(`Load test font never loaded.`),t()):(f.font=`30px `+e,f.fillText(`.`,0,20),f.getImageData(0,0,1,1).data[3]>0?t():setTimeout(m.bind(null,e,t)))}let h=`lt${Date.now()}${this.loadTestFontId++}`,g=this._loadTestFont;g=c(g,976,h.length,h);let _=1482184792,v=o(g,16);for(l=0,u=h.length-3;l<u;l+=4)v=v-_+o(h,l)|0;l<h.length&&(v=v-_+o(h+`XXX`,l)|0),g=c(g,16,4,s(v));let y=`@font-face {font-family:"${h}";src:${`url(data:font/opentype;base64,${btoa(g)});`}}`;this.insertRule(y);let b=this._document.createElement(`div`);b.style.visibility=`hidden`,b.style.width=b.style.height=`10px`,b.style.position=`absolute`,b.style.top=b.style.left=`0px`;for(let t of[e.loadedName,h]){let e=this._document.createElement(`span`);e.textContent=`Hi`,e.style.fontFamily=t,b.append(e)}return this._document.body.append(b),m(h,()=>{b.remove(),t()}),r}},Gs=class{#e=new Map;#t;constructor(e,t=null,n,r){this.#t=e,this._inspectFont=t,n&&(this.charProcOperatorList=n),r&&Object.assign(this,r)}createNativeFontFace(){let{data:e}=this;if(!e||this.disableFontFace)return null;let t;if(!this.cssFontInfo)t=new FontFace(this.loadedName,e,{});else{let n={weight:this.cssFontInfo.fontWeight};this.cssFontInfo.italicAngle&&(n.style=`oblique ${this.cssFontInfo.italicAngle}deg`),t=new FontFace(Rt(this.cssFontInfo.fontFamily),e,n)}return this._inspectFont?.(this),t}createFontFaceRule(){let{data:e}=this;if(!e||this.disableFontFace)return null;let t=`url(data:${this.mimetype};base64,${e.toBase64()});`,n;if(!this.cssFontInfo)n=`@font-face {font-family:"${this.loadedName}";src:${t}}`;else{let e=`font-weight: ${this.cssFontInfo.fontWeight};`;this.cssFontInfo.italicAngle&&(e+=`font-style: oblique ${this.cssFontInfo.italicAngle}deg;`),n=`@font-face {font-family:${Rt(this.cssFontInfo.fontFamily)};${e}src:${t}}`}return this._inspectFont?.(this,t),n}getPathGenerator(e,t){let n=this.#e.get(t);if(n)return n;let r=`${this.loadedName}_path_${t}`,i;try{i=e.get(r)}catch(e){Xe(`getPathGenerator - ignoring character: "${e}".`)}return n=jt(i?.path),this.fontExtraProperties||e.delete(r),this.#e.set(t,n),n}get black(){return this.#t.black}get bold(){return this.#t.bold}get disableFontFace(){return this.#t.disableFontFace}set disableFontFace(e){V(this,`disableFontFace`,!!e)}get fontExtraProperties(){return this.#t.fontExtraProperties}get isInvalidPDFjsFont(){return this.#t.isInvalidPDFjsFont}get isType3Font(){return this.#t.isType3Font}get italic(){return this.#t.italic}get missingFile(){return this.#t.missingFile}get remeasure(){return this.#t.remeasure}get vertical(){return this.#t.vertical}get bbox(){return this.#t.bbox}get fontMatrix(){return this.#t.fontMatrix}get fallbackName(){return this.#t.fallbackName}get loadedName(){return this.#t.loadedName}get mimetype(){return this.missingFile?null:`font/opentype`}get data(){return this.#t.data}clearData(){this.#t.clearData()}get cssFontInfo(){return this.#t.cssFontInfo}get systemFontInfo(){return this.#t.systemFontInfo}},Ks=class{static strings=[`fontFamily`,`fontWeight`,`italicAngle`]},qs=class{static strings=[`css`,`loadedName`,`baseFontName`,`src`]},Js=class{static bools=[`black`,`bold`,`disableFontFace`,`fontExtraProperties`,`isInvalidPDFjsFont`,`isType3Font`,`italic`,`missingFile`,`remeasure`,`vertical`];static strings=[`fallbackName`,`loadedName`];static OFFSET_BBOX=Math.ceil(this.bools.length*2/8);static OFFSET_FONT_MATRIX=this.OFFSET_BBOX+1+8;static OFFSET_STRINGS=this.OFFSET_FONT_MATRIX+1+48},Ys=class{static KIND=0;static HAS_BBOX=1;static HAS_BACKGROUND=2;static SHADING_TYPE=3;static N_COORD=4;static N_COLOR=8;static N_STOP=12;static N_FIGURES=16},Xs=class{static get decoder(){return V(this,`decoder`,new TextDecoder)}static get encoder(){return V(this,`encoder`,new TextEncoder)}},Zs=class{#e;#t;constructor(e){this.#e=e,this.#t=new DataView(e)}#n(e){return Qe(e<Ks.strings.length,`Invalid string index`),zt(this.#e,this.#t,e)}get fontFamily(){return V(this,`fontFamily`,this.#n(0))}get fontWeight(){return V(this,`fontWeight`,this.#n(1))}get italicAngle(){return V(this,`italicAngle`,this.#n(2))}},Qs=class{#e;#t;constructor(e){this.#e=e,this.#t=new DataView(e)}#n(e){return Qe(e<qs.strings.length,`Invalid string index`),zt(this.#e,this.#t,e,4)}get css(){return V(this,`css`,this.#n(0))}get loadedName(){return V(this,`loadedName`,this.#n(1))}get baseFontName(){return V(this,`baseFontName`,this.#n(2))}get src(){return V(this,`src`,this.#n(3))}get style(){let e=0;e+=4+this.#t.getUint32(e);let t=zt(this.#e,this.#t,0,e),n=zt(this.#e,this.#t,1,e);return V(this,`style`,{style:t,weight:n})}},$s=class{#e;#t;constructor(e){this.#e=e,this.#t=new DataView(e)}#n(e){Qe(e<Js.bools.length,`Invalid boolean index`);let t=Math.floor(e/4),n=e*2%8,r=this.#t.getUint8(t)>>n&3;return r===0?void 0:r===2}get black(){return V(this,`black`,this.#n(0))}get bold(){return V(this,`bold`,this.#n(1))}get disableFontFace(){return V(this,`disableFontFace`,this.#n(2))}get fontExtraProperties(){return V(this,`fontExtraProperties`,this.#n(3))}get isInvalidPDFjsFont(){return V(this,`isInvalidPDFjsFont`,this.#n(4))}get isType3Font(){return V(this,`isType3Font`,this.#n(5))}get italic(){return V(this,`italic`,this.#n(6))}get missingFile(){return V(this,`missingFile`,this.#n(7))}get remeasure(){return V(this,`remeasure`,this.#n(8))}get vertical(){return V(this,`vertical`,this.#n(9))}#r(e,t,n,r){let i=this.#t.getUint8(e++);if(i===0)return;Qe(i===t,`Invalid array length.`);let a=Array(i);for(let t=0;t<i;t++)a[t]=this.#t[n](e,!0),e+=r;return a}get bbox(){return V(this,`bbox`,this.#r(Js.OFFSET_BBOX,4,`getInt16`,2))}get fontMatrix(){return V(this,`fontMatrix`,this.#r(Js.OFFSET_FONT_MATRIX,6,`getFloat64`,8))}#i(e){return Qe(e<Js.strings.length,`Invalid string index`),zt(this.#e,this.#t,e,Js.OFFSET_STRINGS+4)}get fallbackName(){return V(this,`fallbackName`,this.#i(0))}get loadedName(){return V(this,`loadedName`,this.#i(1))}#a(e){let t=Js.OFFSET_STRINGS;for(let n=0;n<=e;n++)t+=4+this.#t.getUint32(t);let n=this.#t.getUint32(t);return{offset:t,length:n}}get data(){let{offset:e,length:t}=this.#a(2);return t?new Uint8Array(this.#e,e+4,t):void 0}clearData(){let{offset:e,length:t}=this.#a(2);t&&(this.#t.setUint32(e,0),this.#e=new Uint8Array(this.#e,0,e+4).slice().buffer,this.#t=new DataView(this.#e))}get cssFontInfo(){let{offset:e,length:t}=this.#a(1),n=null;if(t){let r=new Uint8Array(this.#e,e+4,t).slice();n=new Zs(r.buffer)}return V(this,`cssFontInfo`,n)}get systemFontInfo(){let{offset:e,length:t}=this.#a(0),n=null;if(t){let r=new Uint8Array(this.#e,e+4,t).slice();n=new Qs(r.buffer)}return V(this,`systemFontInfo`,n)}},ec=class{constructor(e){this.buffer=e,this.view=new DataView(e),this.data=new Uint8Array(e)}getIR(){let e=this.view,t=this.data[Ys.KIND],n=!!this.data[Ys.HAS_BBOX],r=!!this.data[Ys.HAS_BACKGROUND],i=e.getUint32(Ys.N_COORD,!0),a=e.getUint32(Ys.N_COLOR,!0),o=e.getUint32(Ys.N_STOP,!0),s=20,c=new Float32Array(this.buffer,s,i*2);s+=i*8;let l=new Uint8Array(this.buffer,s,a*4);s+=a*4;let u=[];for(let t=0;t<o;++t){let t=e.getFloat32(s,!0);s+=4;let n=e.getUint32(s,!0);s+=4,u.push([t,`#${n.toString(16).padStart(6,`0`)}`])}let d=null;if(n){d=[];for(let t=0;t<4;++t)d.push(e.getFloat32(s,!0)),s+=4}let f=null;if(r&&(f=new Uint8Array(this.buffer,s,3),s+=3),t===1)return[`RadialAxial`,`axial`,d,u,[c[0],c[1]],[c[2],c[3]],null,null];if(t===2)return[`RadialAxial`,`radial`,d,u,[c[0],c[1]],[c[3],c[4]],c[2],c[5]];if(t===3){let e=this.data[Ys.SHADING_TYPE],t=null;if(c.length>0){t=ho.slice();for(let e=0,n=c.length;e<n;e+=2)H.pointBoundingBox(c[e],c[e+1],t)}return[`Mesh`,e,c,l,i,t,d,f]}throw Error(`Unsupported pattern kind: ${t}`)}},tc=class{#e;constructor(e){this.#e=e}get path(){return Ho.isFloat16ArraySupported?new Float16Array(this.#e):new Float32Array(this.#e)}},nc=e=>typeof e==`object`&&Number.isInteger(e?.num)&&e.num>=0&&Number.isInteger(e?.gen)&&e.gen>=0,rc=e=>typeof e==`object`&&typeof e?.name==`string`,ic=ct.bind(null,nc,rc),ac=class{#e=new Map;#t=Promise.resolve();postMessage(e,t){let n={data:structuredClone(e,t?{transfer:t}:null)};this.#t.then(()=>{for(let[e]of this.#e)e.call(this,n)})}addEventListener(e,t,n=null){let r=null;if(n?.signal instanceof AbortSignal){let{signal:i}=n;if(i.aborted){Xe("LoopbackPort - cannot use an `aborted` signal.");return}let a=()=>this.removeEventListener(e,t);r=()=>i.removeEventListener(`abort`,a),i.addEventListener(`abort`,a)}this.#e.set(t,r)}removeEventListener(e,t){this.#e.get(t)?.(),this.#e.delete(t)}terminate(){for(let[,e]of this.#e)e?.();this.#e.clear()}},Ya(),oc={DATA:1,ERROR:2},sc={CANCEL:1,CANCEL_COMPLETE:2,CLOSE:3,ENQUEUE:4,ERROR:5,PULL:6,PULL_COMPLETE:7,START_COMPLETE:8},cc=class{#e=new Map;#t=new Map;#n=1;#r;#i=new AbortController;#a;#o=new Map;#s=1;#c=new Map;#l;constructor(e,t,n){this.#a=e,this.#l=t,this.#r=n,n.addEventListener(`message`,this.#u.bind(this),{signal:this.#i.signal})}#u({data:e}){if(e.targetName!==this.#a)return;if(e.stream){this.#f(e);return}if(e.callback){let{callbackId:t,callback:n}=e,r=this.#t.get(t);if(!r)throw Error(`Cannot resolve callback ${t}`);if(this.#t.delete(t),n===oc.DATA)r.resolve(e.data);else if(n===oc.ERROR)r.reject(Wt(e.reason));else throw Error(`Unexpected callback case`);return}let t=this.#e.get(e.action);if(!t)throw Error(`Unknown action from worker: ${e.action}`);if(e.callbackId){let n=this.#a,r=e.sourceName,i=this.#r;Promise.try(t,e.data).then(t=>{i.postMessage({sourceName:n,targetName:r,callback:oc.DATA,callbackId:e.callbackId,data:t})},t=>{i.postMessage({sourceName:n,targetName:r,callback:oc.ERROR,callbackId:e.callbackId,reason:Wt(t)})})}else e.streamId?this.#d(e):t(e.data)}on(e,t){let n=this.#e;if(n.has(e))throw Error(`There is already a "${e}" handler.`);n.set(e,t)}send(e,t,n){this.#r.postMessage({sourceName:this.#a,targetName:this.#l,action:e,data:t},n)}sendWithPromise(e,t,n){let r=this.#n++,i=Promise.withResolvers();this.#t.set(r,i);try{this.#r.postMessage({sourceName:this.#a,targetName:this.#l,action:e,callbackId:r,data:t},n)}catch(e){i.reject(e)}return i.promise}sendWithStream(e,t,n,r){let i=this.#s++,a=this.#a,o=this.#l,s=this.#r;return new ReadableStream({start:n=>{let c=Promise.withResolvers();return this.#o.set(i,{controller:n,startCall:c,pullCall:null,cancelCall:null,isClosed:!1}),s.postMessage({sourceName:a,targetName:o,action:e,streamId:i,data:t,desiredSize:n.desiredSize},r),c.promise},pull:e=>{let t=Promise.withResolvers();return this.#o.get(i).pullCall=t,s.postMessage({sourceName:a,targetName:o,stream:sc.PULL,streamId:i,desiredSize:e.desiredSize}),t.promise},cancel:e=>{Qe(e instanceof Error,`cancel must have a valid reason`);let t=Promise.withResolvers();return this.#o.get(i).cancelCall=t,this.#o.get(i).isClosed=!0,s.postMessage({sourceName:a,targetName:o,stream:sc.CANCEL,streamId:i,reason:Wt(e)}),t.promise}},n)}#d(e){let t=e.streamId,n=this.#a,r=e.sourceName,i=this.#r,a=this.#c,o=this.#e.get(e.action),s={enqueue(e,a=1,o){if(this.isCancelled)return;let s=this.desiredSize;this.desiredSize-=a,s>0&&this.desiredSize<=0&&(this.sinkCapability=Promise.withResolvers(),this.ready=this.sinkCapability.promise),i.postMessage({sourceName:n,targetName:r,stream:sc.ENQUEUE,streamId:t,chunk:e},o)},close(){this.isCancelled||(this.isCancelled=!0,i.postMessage({sourceName:n,targetName:r,stream:sc.CLOSE,streamId:t}),a.delete(t))},error(e){Qe(e instanceof Error,`error must have a valid reason`),!this.isCancelled&&(this.isCancelled=!0,i.postMessage({sourceName:n,targetName:r,stream:sc.ERROR,streamId:t,reason:Wt(e)}))},sinkCapability:Promise.withResolvers(),onPull:null,onCancel:null,isCancelled:!1,desiredSize:e.desiredSize,ready:null};s.sinkCapability.resolve(),s.ready=s.sinkCapability.promise,a.set(t,s),Promise.try(o,e.data,s).then(()=>{i.postMessage({sourceName:n,targetName:r,stream:sc.START_COMPLETE,streamId:t,success:!0})},e=>{i.postMessage({sourceName:n,targetName:r,stream:sc.START_COMPLETE,streamId:t,reason:Wt(e)})})}#f(e){let t=e.streamId,n=this.#a,r=e.sourceName,i=this.#r,a=this.#o.get(t),o=this.#c.get(t);switch(e.stream){case sc.START_COMPLETE:e.success?a.startCall.resolve():a.startCall.reject(Wt(e.reason));break;case sc.PULL_COMPLETE:e.success?a.pullCall.resolve():a.pullCall.reject(Wt(e.reason));break;case sc.PULL:if(!o){i.postMessage({sourceName:n,targetName:r,stream:sc.PULL_COMPLETE,streamId:t,success:!0});break}o.desiredSize<=0&&e.desiredSize>0&&o.sinkCapability.resolve(),o.desiredSize=e.desiredSize,Promise.try(o.onPull||Ut).then(()=>{i.postMessage({sourceName:n,targetName:r,stream:sc.PULL_COMPLETE,streamId:t,success:!0})},e=>{i.postMessage({sourceName:n,targetName:r,stream:sc.PULL_COMPLETE,streamId:t,reason:Wt(e)})});break;case sc.ENQUEUE:if(Qe(a,`enqueue should have stream controller`),a.isClosed)break;a.controller.enqueue(e.chunk);break;case sc.CLOSE:if(Qe(a,`close should have stream controller`),a.isClosed)break;a.isClosed=!0,a.controller.close(),this.#p(a,t);break;case sc.ERROR:Qe(a,`error should have stream controller`),a.controller.error(Wt(e.reason)),this.#p(a,t);break;case sc.CANCEL_COMPLETE:e.success?a.cancelCall.resolve():a.cancelCall.reject(Wt(e.reason)),this.#p(a,t);break;case sc.CANCEL:if(!o)break;let s=Wt(e.reason);Promise.try(o.onCancel||Ut,s).then(()=>{i.postMessage({sourceName:n,targetName:r,stream:sc.CANCEL_COMPLETE,streamId:t,success:!0})},e=>{i.postMessage({sourceName:n,targetName:r,stream:sc.CANCEL_COMPLETE,streamId:t,reason:Wt(e)})}),o.sinkCapability.reject(s),o.isCancelled=!0,this.#c.delete(t);break;default:throw Error(`Unexpected stream case`)}}async#p(e,t){await Promise.allSettled([e.startCall?.promise,e.pullCall?.promise,e.cancelCall?.promise]),this.#o.delete(t)}destroy(){this.#i?.abort(),this.#i=null}},lc=class{#e=Object.freeze({cMapUrl:`CMap`,standardFontDataUrl:`font`,wasmUrl:`wasm`});constructor({cMapUrl:e=null,standardFontDataUrl:t=null,wasmUrl:n=null}){this.cMapUrl=e,this.standardFontDataUrl=t,this.wasmUrl=n}async fetch({kind:e,filename:t}){switch(e){case`cMapUrl`:case`standardFontDataUrl`:case`wasmUrl`:break;default:Ze(`Not implemented: ${e}`)}let n=this[e];if(!n)throw Error(`Ensure that the \`${e}\` API parameter is provided.`);let r=`${n}${t}`;return this._fetch(r,e).catch(t=>{throw Error(`Unable to load ${this.#e[e]} data at: ${r}`)})}async _fetch(e,t){Ze("Abstract method `_fetch` called.")}},uc=class extends lc{async _fetch(e,t){let n=await ut(e,t===`cMapUrl`&&!e.endsWith(`.bcmap`)?`text`:`bytes`);return n instanceof Uint8Array?n:it(n)}},dc=class{#e=!1;constructor({enableHWA:e=!1}){this.#e=e}create(e,t){if(e<=0||t<=0)throw Error(`Invalid canvas size`);let n=this._createCanvas(e,t);return{canvas:n,context:n.getContext(`2d`,{willReadFrequently:!this.#e})}}reset({canvas:e},t,n){if(!e)throw Error(`Canvas is not specified`);if(t<=0||n<=0)throw Error(`Invalid canvas size`);e.width=t,e.height=n}destroy(e){let{canvas:t}=e;if(!t)throw Error(`Canvas is not specified`);t.width=t.height=0,e.canvas=null,e.context=null}_createCanvas(e,t){Ze("Abstract method `_createCanvas` called.")}},fc=class extends dc{constructor({ownerDocument:e=globalThis.document,enableHWA:t=!1}){super({enableHWA:t}),this._document=e}_createCanvas(e,t){let n=this._document.createElement(`canvas`);return n.width=e,n.height=t,n}},pc=class{addFilter(e){return`none`}addHCMFilter(e,t){return`none`}addAlphaFilter(e){return`none`}addLuminosityFilter(e){return`none`}addKnockoutFilter(e=0){return`none`}addHighlightHCMFilter(e,t,n,r,i){return`none`}addSelectionHCMFilter(e,t){return`none`}addSelectionFilter(){return`none`}createSelectionStyle(e=null){return null}destroy(e=!1){}},mc=class extends pc{#e;#t;#n;#r;#i;#a;#o=0;constructor({docId:e,ownerDocument:t=globalThis.document}){super(),this.#r=e,this.#i=t}get#s(){return this.#t||=new Map}get#c(){return this.#a||=new Map}get#l(){if(!this.#n){let e=this.#i.createElement(`div`),{style:t}=e;t.colorScheme=`only light`,t.visibility=`hidden`,t.contain=`strict`,t.width=t.height=0,t.position=`absolute`,t.top=t.left=0,t.zIndex=-1;let n=this.#i.createElementNS(vo,`svg`);n.setAttribute(`width`,0),n.setAttribute(`height`,0),this.#n=this.#i.createElementNS(vo,`defs`),e.append(n),n.append(this.#n),this.#i.body.append(e)}return this.#n}#u(e){let t=e=>e&&Array.from(e,e=>e/255).join(`,`);if(e.length===1){let n=t(e[0]);return[n,n,n]}let[n,r,i]=e;return[t(n),t(r),t(i)]}#d(e){if(this.#e===void 0){this.#e=``;let e=this.#i.URL;e!==this.#i.baseURI&&(dt(e)?Xe(`#createUrl: ignore "data:"-URL for performance reasons.`):this.#e=tt(e,``))}return`url(${this.#e}#${e})`}addFilter(e){if(!e)return`none`;let t=this.#s.get(e);if(t)return t;let[n,r,i]=this.#u(e),a=e.length===1?n:`${n}${r}${i}`;if(t=this.#s.get(a),t)return this.#s.set(e,t),t;let o=`g_${this.#r}_transfer_map_${this.#o++}`,s=this.#d(o);this.#s.set(e,s),this.#s.set(a,s);let c=this.#m(o);return this.#g(n,r,i,c),s}addHCMFilter(e,t){let n=`${e}-${t}`,r=`base`,i=this.#c.get(r);if(i?.key===n||(i?(i.filter?.remove(),i.key=n,i.url=`none`,i.filter=null):(i={key:n,url:`none`,filter:null},this.#c.set(r,i)),!e||!t))return i.url;let a=this.#v(e);e=H.makeHexColor(...a);let o=this.#v(t);if(t=H.makeHexColor(...o),this.#b(),e===`#000000`&&t===`#ffffff`||e===t)return i.url;let s=Array.from({length:256},(e,t)=>Dt(t/255)).join(`,`),c=`g_${this.#r}_hcm_filter`,l=i.filter=this.#m(c);this.#g(s,s,s,l),this.#p(l);let u=(e,t)=>{let n=a[e]/255,r=o[e]/255,i=Array(t+1);for(let e=0;e<=t;e++)i[e]=n+e/t*(r-n);return i.join(`,`)};return this.#g(u(0,5),u(1,5),u(2,5),l),i.url=this.#d(c),i.url}addSelectionHCMFilter(e,t){return this.addHighlightHCMFilter(`selection`,e,t,`HighlightText`,`Highlight`)}addSelectionFilter(){return this.addHighlightHCMFilter(`selection_default`,`black`,`white`,`HighlightText`,`Highlight`)}createSelectionStyle(e=null){let t=e?this.addSelectionHCMFilter(e.foreground,e.background):this.addSelectionFilter();return t===`none`||!Ho.platform.isFirefox?null:{"backdrop-filter":t,"background-color":`transparent`}}addAlphaFilter(e){let t=this.#s.get(e);if(t)return t;let[n]=this.#u([e]),r=`alpha_${n}`;if(t=this.#s.get(r),t)return this.#s.set(e,t),t;let i=`g_${this.#r}_alpha_map_${this.#o++}`,a=this.#d(i);this.#s.set(e,a),this.#s.set(r,a);let o=this.#m(i);return this.#_(n,o),a}addLuminosityFilter(e){let t=this.#s.get(e||`luminosity`);if(t)return t;let n,r;if(e?([n]=this.#u([e]),r=`luminosity_${n}`):r=`luminosity`,t=this.#s.get(r),t)return this.#s.set(e,t),t;let i=`g_${this.#r}_luminosity_map_${this.#o++}`,a=this.#d(i);this.#s.set(e,a),this.#s.set(r,a);let o=this.#m(i);return this.#f(o),e&&this.#_(n,o),a}addKnockoutFilter(e=0){let t=e>0?Math.min(1/e,1e6):1e6,n=`knockout_${t}`,r=this.#s.get(n);if(r)return r;let i=`g_${this.#r}_knockout_filter_${this.#o++}`,a=this.#d(i);this.#s.set(n,a);let o=this.#m(i),s=this.#i.createElementNS(vo,`feComponentTransfer`);o.append(s);let c=this.#i.createElementNS(vo,`feFuncA`);return c.setAttribute(`type`,`linear`),c.setAttribute(`slope`,`${t}`),c.setAttribute(`intercept`,`0`),s.append(c),a}addHighlightHCMFilter(e,t,n,r,i){let a=`${t}-${n}-${r}-${i}`,o=this.#c.get(e);if(o?.key===a||(o?(o.filter?.remove(),o.key=a,o.url=`none`,o.filter=null):(o={key:a,url:`none`,filter:null},this.#c.set(e,o)),!t||!n))return o.url;let[s,c]=[t,n].map(this.#v.bind(this)),l=Math.round(.2126*s[0]+.7152*s[1]+.0722*s[2]),u=Math.round(.2126*c[0]+.7152*c[1]+.0722*c[2]),[d,f]=[r,i].map(this.#x.bind(this));u<l&&([l,u,d,f]=[u,l,f,d]),this.#b();let p=(e,t,n)=>{let r=Array(256),i=(u-l)/n,a=e/255,o=(t-e)/(255*n),s=0;for(let e=0;e<=n;e++){let t=Math.round(l+e*i),n=a+e*o;for(let e=s;e<=t;e++)r[e]=n;s=t+1}for(let e=s;e<256;e++)r[e]=r[s-1];return r.join(`,`)},m=`g_${this.#r}_hcm_${e}_filter`,h=o.filter=this.#m(m);return this.#p(h),this.#g(p(d[0],f[0],5),p(d[1],f[1],5),p(d[2],f[2],5),h),o.url=this.#d(m),o.url}destroy(e=!1){e&&this.#a?.size||(this.#n?.parentNode.parentNode.remove(),this.#n=null,this.#t?.clear(),this.#t=null,this.#a?.clear(),this.#a=null,this.#o=0)}#f(e){let t=this.#i.createElementNS(vo,`feColorMatrix`);t.setAttribute(`type`,`matrix`),t.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`),e.append(t)}#p(e){let t=this.#i.createElementNS(vo,`feColorMatrix`);t.setAttribute(`type`,`matrix`),t.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`),e.append(t)}#m(e){let t=this.#i.createElementNS(vo,`filter`);return t.setAttribute(`color-interpolation-filters`,`sRGB`),t.setAttribute(`id`,e),this.#l.append(t),t}#h(e,t,n){if(!n)return;let r=this.#i.createElementNS(vo,t);r.setAttribute(`type`,`discrete`),r.setAttribute(`tableValues`,n),e.append(r)}#g(e,t,n,r){let i=this.#i.createElementNS(vo,`feComponentTransfer`);r.append(i),this.#h(i,`feFuncR`,e),this.#h(i,`feFuncG`,t),this.#h(i,`feFuncB`,n)}#_(e,t){let n=this.#i.createElementNS(vo,`feComponentTransfer`);t.append(n),this.#h(n,`feFuncA`,e)}#v(e){return this.#l.style.color=`CanvasText`,this.#l.style.backgroundColor=e,yt(getComputedStyle(this.#l).getPropertyValue(`background-color`))}#y(e){return this.#l.style.color=`CanvasText`,this.#l.style.backgroundColor=e,vt(getComputedStyle(this.#l).getPropertyValue(`background-color`))}#b(){this.#l.style.color=``,this.#l.style.backgroundColor=``}#x(e){let[t,n,r,i]=this.#y(e);if(i===1)return[t,n,r];let[a,o,s]=this.#v(`Canvas`);return[Gt(t,a,i),Gt(n,o,i),Gt(r,s,i)]}},mo){let e;try{let t=process.getBuiltinModule(`module`).createRequire({}.url);try{e=t("@napi-rs/canvas")}catch(e){Xe(`Cannot load "@napi-rs/canvas" package: "${e}".`)}}catch(e){Xe(`Cannot access the \`require\` function: "${e}".`)}globalThis.DOMMatrix||(e?.DOMMatrix?globalThis.DOMMatrix=e.DOMMatrix:Xe("Cannot polyfill `DOMMatrix`, rendering may be broken.")),globalThis.Path2D||(e?.Path2D?globalThis.Path2D=e.Path2D:Xe("Cannot polyfill `Path2D`, rendering may be broken.")),globalThis.navigator?.language||(globalThis.navigator={language:`en-US`,platform:``,userAgent:``})}hc=class extends pc{},gc=class extends dc{_createCanvas(e,t){return process.getBuiltinModule(`module`).createRequire({}.url)(`@napi-rs/canvas`).createCanvas(e,t)}},_c=class extends lc{async _fetch(e,t){return Kt(e)}},vc=`
4
+ struct Uniforms {
5
+ offsetX : f32,
6
+ offsetY : f32,
7
+ scaleX : f32,
8
+ scaleY : f32,
9
+ paddedWidth : f32,
10
+ paddedHeight : f32,
11
+ borderSize : f32,
12
+ _pad : f32,
13
+ };
14
+
15
+ @group(0) @binding(0) var<uniform> u : Uniforms;
16
+
17
+ struct VertexInput {
18
+ @location(0) position : vec2<f32>,
19
+ @location(1) color : vec4<f32>,
20
+ };
21
+
22
+ struct VertexOutput {
23
+ @builtin(position) position : vec4<f32>,
24
+ @location(0) color : vec3<f32>,
25
+ };
26
+
27
+ @vertex
28
+ fn vs_main(in : VertexInput) -> VertexOutput {
29
+ var out : VertexOutput;
30
+ let cx = (in.position.x + u.offsetX) * u.scaleX;
31
+ let cy = (in.position.y + u.offsetY) * u.scaleY;
32
+ out.position = vec4<f32>(
33
+ ((cx + u.borderSize) / u.paddedWidth) * 2.0 - 1.0,
34
+ 1.0 - ((cy + u.borderSize) / u.paddedHeight) * 2.0,
35
+ 0.0,
36
+ 1.0
37
+ );
38
+ out.color = in.color.rgb;
39
+ return out;
40
+ }
41
+
42
+ @fragment
43
+ fn fs_main(in : VertexOutput) -> @location(0) vec4<f32> {
44
+ return vec4<f32>(in.color, 1.0);
45
+ }
46
+ `,yc=class{#e=null;#t=null;#n=null;#r=null;async#i(){if(!globalThis.navigator?.gpu)return!1;try{let e=await navigator.gpu.requestAdapter();return e?(this.#r=navigator.gpu.getPreferredCanvasFormat(),this.#t=await e.requestDevice(),!0):!1}catch{return!1}}init(){return this.#e||=this.#i()}get isReady(){return this.#t!==null}loadMeshShader(){if(!this.#t||this.#n)return;let e=this.#t.createShaderModule({code:vc});this.#n=this.#t.createRenderPipeline({layout:`auto`,vertex:{module:e,entryPoint:`vs_main`,buffers:[{arrayStride:8,attributes:[{shaderLocation:0,offset:0,format:`float32x2`}]},{arrayStride:4,attributes:[{shaderLocation:1,offset:0,format:`unorm8x4`}]}]},fragment:{module:e,entryPoint:`fs_main`,targets:[{format:this.#r}]},primitive:{topology:`triangle-list`}})}draw(e,t,n,r,i,a,o,s){this.loadMeshShader();let c=this.#t,{offsetX:l,offsetY:u,scaleX:d,scaleY:f}=r,p=c.createBuffer({size:Math.max(e.byteLength,4),usage:GPUBufferUsage.VERTEX|GPUBufferUsage.COPY_DST});e.byteLength>0&&c.queue.writeBuffer(p,0,e);let m=c.createBuffer({size:Math.max(t.byteLength,4),usage:GPUBufferUsage.VERTEX|GPUBufferUsage.COPY_DST});t.byteLength>0&&c.queue.writeBuffer(m,0,t);let h=c.createBuffer({size:32,usage:GPUBufferUsage.UNIFORM|GPUBufferUsage.COPY_DST});c.queue.writeBuffer(h,0,new Float32Array([l,u,d,f,a,o,s,0]));let g=c.createBindGroup({layout:this.#n.getBindGroupLayout(0),entries:[{binding:0,resource:{buffer:h}}]}),_=new OffscreenCanvas(a,o),v=_.getContext(`webgpu`);v.configure({device:c,format:this.#r,alphaMode:i?`opaque`:`premultiplied`});let y=i?{r:i[0]/255,g:i[1]/255,b:i[2]/255,a:1}:{r:0,g:0,b:0,a:0},b=c.createCommandEncoder(),x=b.beginRenderPass({colorAttachments:[{view:v.getCurrentTexture().createView(),clearValue:y,loadOp:`clear`,storeOp:`store`}]});return n>0&&(x.setPipeline(this.#n),x.setBindGroup(0,g),x.setVertexBuffer(0,p),x.setVertexBuffer(1,m),x.draw(n)),x.end(),c.queue.submit([b.finish()]),p.destroy(),m.destroy(),h.destroy(),_.transferToImageBitmap()}},bc=new yc,xc={FILL:`Fill`,STROKE:`Stroke`,SHADING:`Shading`},Sc=class{matrix=null;isModifyingCurrentTransform(){return!1}getPattern(){Ze("Abstract method `getPattern` called.")}},Cc=class extends Sc{constructor(e){super(),this._type=e[1],this._bbox=e[2],this._colorStops=e[3],this._p0=e[4],this._p1=e[5],this._r0=e[6],this._r1=e[7]}isOriginBased(){return this._p0[0]===0&&this._p0[1]===0&&(!this.isRadial()||this._p1[0]===0&&this._p1[1]===0)}isRadial(){return this._type===`radial`}areConic(){if(!this.isRadial())return!1;let e=Math.hypot(this._p0[0]-this._p1[0],this._p0[1]-this._p1[1]);return e+this._r1>this._r0&&e+this._r0>this._r1}_createGradient(e,t=null){let n,r=this._p0,i=this._p1;if(t&&(r=r.slice(),i=i.slice(),H.applyTransform(r,t),H.applyTransform(i,t)),this._type===`axial`)n=e.createLinearGradient(r[0],r[1],i[0],i[1]);else if(this._type===`radial`){let a=this._r0,o=this._r1;if(t){let e=new Float32Array(2);H.singularValueDecompose2dScale(t,e),a*=e[0],o*=e[0]}n=e.createRadialGradient(r[0],r[1],a,i[0],i[1],o)}for(let e of this._colorStops)n.addColorStop(e[0],e[1]);return n}_createReversedGradient(e,t=null){let n=this._p1,r=this._p0;t&&(n=n.slice(),r=r.slice(),H.applyTransform(n,t),H.applyTransform(r,t));let i=this._r1,a=this._r0;if(t){let e=new Float32Array(2);H.singularValueDecompose2dScale(t,e),i*=e[0],a*=e[0]}let o=e.createRadialGradient(n[0],n[1],i,r[0],r[1],a),s=this._colorStops.map(([e,t])=>[1-e,t]).reverse();for(let[e,t]of s)o.addColorStop(e,t);return o}_createRasterPattern(e,t,n,r,i,a){let o=Math.ceil(r[2]-r[0])||1,s=Math.ceil(r[3]-r[1])||1,c=t.canvasFactory.create(o,s),l=c.context;l.clearRect(0,0,o,s),l.beginPath(),l.rect(0,0,o,s),l.translate(-r[0],-r[1]),n=H.transform(n,[1,0,0,1,r[0],r[1]]),l.transform(...i),$t(l,this._bbox),this.areConic()&&(l.fillStyle=this._createReversedGradient(l),l.fill()),l.fillStyle=this._createGradient(l),l.fill(),a?.applyToCanvas(l);let u=e.createPattern(c.canvas,`no-repeat`);return t.canvasFactory.destroy(c),u.setTransform(new DOMMatrix(n)),u}getPattern(e,t,n,r){let i=t.current.transferMapsFallback;if(r===xc.STROKE||r===xc.FILL){if(this.isOriginBased()&&!i){let r=H.transform(n,t.baseTransform);this.matrix&&(r=H.transform(r,this.matrix));let i=.001,a=Math.hypot(r[0],r[1]),o=Math.hypot(r[2],r[3]),s=(r[0]*r[2]+r[1]*r[3])/(a*o);if(Math.abs(s)<i){if(this.isRadial()){if(Math.abs(a-o)<i)return this._createGradient(e,r)}else return this._createGradient(e,r)}}let a=t.current.getClippedPathBoundingBox(r,xt(e))||[0,0,0,0],o=this.matrix?H.transform(t.baseTransform,this.matrix):t.baseTransform;return this._createRasterPattern(e,t,n,a,o,i)}return i&&n?this._createRasterPattern(e,t,n,t.current.clipBox,xt(e),i):(this.areConic()&&(e.save(),$t(e,this._bbox),e.fillStyle=this._createReversedGradient(e),e.fillRect(-1e10,-1e10,2e10,2e10),e.restore()),$t(e,this._bbox),this._createGradient(e))}},wc=class extends Sc{constructor(e){super(),this._posData=e[2],this._colData=e[3],this._vertexCount=e[4],this._bounds=e[5],this._bbox=e[6],this._background=e[7],Zt()}_createMeshCanvas(e,t,n,r=null){let i=1.1,a=3e3,o=Math.floor(this._bounds[0]),s=Math.floor(this._bounds[1]),c=Math.ceil(this._bounds[2])-o,l=Math.ceil(this._bounds[3])-s,u=Math.min(Math.ceil(Math.abs(c*e[0]*i)),a)||1,d=Math.min(Math.ceil(Math.abs(l*e[1]*i)),a)||1,f=c?c/u:1,p=l?l/d:1,m={coords:this._posData,colors:this._colData,offsetX:-o,offsetY:-s,scaleX:1/f,scaleY:1/p},h=u+4,g=d+4,_=n.create(h,g);if(Xt()&&this._vertexCount>48)_.context.drawImage(Qt(this._posData,this._colData,this._vertexCount,m,t,h,g,2),0,0);else{let e=_.context.createImageData(u,d);if(t){let n=e.data;for(let e=0,r=n.length;e<r;e+=4)n[e]=t[0],n[e+1]=t[1],n[e+2]=t[2],n[e+3]=255}for(let t=0,n=this._vertexCount;t<n;t+=3)en(e,m,t,t+1,t+2,t,t+1,t+2);_.context.putImageData(e,2,2)}return r?.applyToCanvas(_.context),{canvas:_.canvas,offsetX:o-2*f,offsetY:s-2*p,scaleX:f,scaleY:p}}isModifyingCurrentTransform(){return!0}getPattern(e,t,n,r){$t(e,this._bbox);let i=new Float32Array(2);if(r===xc.SHADING)H.singularValueDecompose2dScale(xt(e),i);else if(this.matrix){H.singularValueDecompose2dScale(this.matrix,i);let[e,n]=i;H.singularValueDecompose2dScale(t.baseTransform,i),i[0]*=e,i[1]*=n}else H.singularValueDecompose2dScale(t.baseTransform,i);let a=this._createMeshCanvas(i,r===xc.SHADING?null:this._background,t.canvasFactory,t.current.transferMapsFallback);r!==xc.SHADING&&(e.setTransform(...t.baseTransform),this.matrix&&e.transform(...this.matrix)),e.translate(a.offsetX,a.offsetY),e.scale(a.scaleX,a.scaleY);let o=e.createPattern(a.canvas,`no-repeat`);return t.canvasFactory.destroy(a),o}},Tc=class extends Sc{getPattern(){return`hotpink`}},Ec={COLORED:1,UNCOLORED:2},Dc=class e{static MAX_PATTERN_SIZE=3e3;constructor(e,t,n,r){this.color=e[1],this.operatorList=e[2],this.matrix=e[3],this.bbox=e[4],this.xstep=e[5],this.ystep=e[6],this.paintType=e[7],this.tilingType=e[8],this.needsIsolation=e[9]??!0,this.ctx=t,this.canvasGraphicsFactory=n,this.baseTransform=r,this.patternBaseMatrix=this.matrix?H.transform(r,this.matrix):r}canSkipPatternCanvas([e,t,n,r]){let[i,a,o,s]=this.bbox,c=Math.abs(this.xstep),l=Math.abs(this.ystep);if(e>c+1e-6||t>l+1e-6)return null;let u=Math.floor((n-o)/c)+1,d=Math.ceil((n+e-i)/c)-1,f=Math.floor((r-s)/l)+1,p=Math.ceil((r+t-a)/l)-1;return d<=u&&p<=f?[u,f]:null}updatePatternDims(e,t){let n=ho.slice();H.axialAlignedBoundingBox(e,H.inverseTransform(this.patternBaseMatrix),n),t[0]=n[2]-n[0],t[1]=n[3]-n[1],t[2]=n[0],t[3]=n[1]}_renderTileCanvas(e,t,n,r){let[i,a,o,s]=this.bbox,c=e.canvasFactory.create(n.size,r.size),l=c.context,u=this.canvasGraphicsFactory.createCanvasGraphics(l,t);return u.groupLevel=e.groupLevel,u.current.transferMapsFallback=e.current.transferMapsFallback,this.setFillAndStrokeStyleToContext(u,this.paintType,this.color),l.translate(-n.scale*i,-r.scale*a),u.transform(0,n.scale,0,0,r.scale,0,0),l.save(),u.dependencyTracker?.save(),this.clipBbox(u,i,a,o,s),u.baseTransform=xt(u.ctx),u.executeOperatorList(this.operatorList),u.endDrawing(),u.dependencyTracker?.restore(),l.restore(),c}_getCombinedScales(){let e=new Float32Array(2);H.singularValueDecompose2dScale(this.matrix,e);let[t,n]=e;return H.singularValueDecompose2dScale(this.baseTransform,e),[t*e[0],n*e[1]]}drawPattern(e,t,n=!1,[r,i],a){let[o,s,c,l]=this.bbox,u=e.dependencyTracker;if(u&&(e.dependencyTracker=new Bs(u,a)),e.save(),n?e.ctx.clip(t,`evenodd`):e.ctx.clip(t),e.ctx.setTransform(...this.patternBaseMatrix),e.ctx.translate(r*this.xstep,i*this.ystep),this.needsIsolation||e.ctx.globalAlpha!==1||e.ctx.globalCompositeOperation!==`source-over`||e.inSMaskMode){let t=c-o,n=l-s,[r,i]=this._getCombinedScales(),u=this.getSizeAndScale(t,this.ctx.canvas.width,r),d=this.getSizeAndScale(n,this.ctx.canvas.height,i),f=this._renderTileCanvas(e,a,u,d);e.ctx.drawImage(f.canvas,o,s,t,n),e.canvasFactory.destroy(f)}else this.setFillAndStrokeStyleToContext(e,this.paintType,this.color),this.clipBbox(e,o,s,c,l),e.baseTransformStack.push(e.baseTransform),e.baseTransform=xt(e.ctx),e.executeOperatorList(this.operatorList),e.baseTransform=e.baseTransformStack.pop();e.restore(),u&&(e.dependencyTracker=u)}createPatternCanvas(e,t){let[n,r,i,a]=this.bbox,o=i-n,s=a-r,{xstep:c,ystep:l}=this;c=Math.abs(c),l=Math.abs(l),Ye(`TilingType: `+this.tilingType);let[u,d]=this._getCombinedScales(),f=o,p=s,m=!1,h=!1;Math.ceil(c*u)>=Math.ceil(o*u)?f=c:m=!0,Math.ceil(l*d)>=Math.ceil(s*d)?p=l:h=!0;let g=this.getSizeAndScale(f,this.ctx.canvas.width,u),_=this.getSizeAndScale(p,this.ctx.canvas.height,d),v=this._renderTileCanvas(e,t,g,_);if(m||h){let t=v.canvas;m&&(f=c),h&&(p=l);let i=this.getSizeAndScale(f,this.ctx.canvas.width,u),a=this.getSizeAndScale(p,this.ctx.canvas.height,d),g=i.size,_=a.size,y=e.canvasFactory.create(g,_),b=y.context,x=m?Math.min(Math.floor(o/c),Math.ceil(t.width/g)):0,S=h?Math.min(Math.floor(s/l),Math.ceil(t.height/_)):0,C=t,w=null;if(h){w=e.canvasFactory.create(t.width,_);let n=w.context;for(let e=S;e>=0;e--)n.drawImage(t,0,_*e,t.width,_,0,0,t.width,_);C=w.canvas}for(let e=x;e>=0;e--)b.drawImage(C,g*e,0,g,_,0,0,g,_);return w&&e.canvasFactory.destroy(w),e.canvasFactory.destroy(v),{canvas:y.canvas,canvasEntry:y,scaleX:i.scale,scaleY:a.scale,offsetX:n,offsetY:r}}return{canvas:v.canvas,canvasEntry:v,scaleX:g.scale,scaleY:_.scale,offsetX:n,offsetY:r}}getSizeAndScale(t,n,r){let i=Math.max(e.MAX_PATTERN_SIZE,n),a=Math.ceil(t*r);return a>=i?a=i:r=a/t,{scale:r,size:a}}clipBbox(e,t,n,r,i){let a=r-t,o=i-n,s=new Path2D;s.rect(t,n,a,o),H.axialAlignedBoundingBox([t,n,r,i],xt(e.ctx),e.current.minMax),e.ctx.clip(s),e.current.updateClipFromPath()}setFillAndStrokeStyleToContext(e,t,n){switch(t){case Ec.COLORED:n=`#000000`;break;case Ec.UNCOLORED:break;default:throw new Bo(`Unsupported paint type: ${t}`)}let{ctx:r,current:i}=e;i.patternFill=i.patternStroke=!1,r.fillStyle=r.strokeStyle=i.transferMapsFallback?.applyToColor(n)??n,i.fillColor=i.strokeColor=n}isModifyingCurrentTransform(){return!1}getPattern(e,t,n,r,i){let a=r===xc.SHADING?n:H.transform(n,this.patternBaseMatrix),o=this.createPatternCanvas(t,i),s=new DOMMatrix(a);s=s.translate(o.offsetX,o.offsetY),s=s.scale(1/o.scaleX,1/o.scaleY);let c=e.createPattern(o.canvas,`repeat`);return t.canvasFactory.destroy(o.canvasEntry),c.setTransform(s),c}},Oc=16,kc=100,Ac=15,jc=10,Mc=16,Nc=new Float32Array(2),Pc=class{alphaIsShape=!1;fontSize=0;fontSizeScale=1;textMatrix=null;textMatrixScale=1;fontMatrix=_o;leading=0;x=0;y=0;lineX=0;lineY=0;charSpacing=0;wordSpacing=0;textHScale=1;textRenderingMode=Eo.FILL;textRise=0;fillColor=`#000000`;strokeColor=`#000000`;tilingPatternDims=null;patternFill=!1;patternStroke=!1;fillAlpha=1;strokeAlpha=1;lineWidth=1;activeSMask=null;transferMaps=`none`;transferMapsFallback=null;minMax=go.slice();constructor(e,t){this.clipBox=new Float32Array([0,0,e,t])}clone(){let e=Object.create(this);return e.clipBox=this.clipBox.slice(),e.minMax=this.minMax.slice(),e.tilingPatternDims=this.tilingPatternDims?.slice(),e}getPathBoundingBox(e=xc.FILL,t=null){let n=this.minMax.slice();if(e===xc.STROKE){t||Ze(`Stroke bounding box must include transform.`),H.singularValueDecompose2dScale(t,Nc);let e=Nc[0]*this.lineWidth/2,r=Nc[1]*this.lineWidth/2;n[0]-=e,n[1]-=r,n[2]+=e,n[3]+=r}return n}updateClipFromPath(){let e=H.intersect(this.clipBox,this.getPathBoundingBox());this.startNewPathAndClipBox(e||[0,0,0,0])}isEmptyClip(){return this.minMax[0]===1/0}startNewPathAndClipBox(e){this.clipBox.set(e,0),this.minMax.set(go,0)}getClippedPathBoundingBox(e=xc.FILL,t=null){return H.intersect(this.clipBox,this.getPathBoundingBox(e,t))}},Fc=class e{#e;constructor(t){let[n,r=n,i=n]=t,{identityMap:a}=e;this.#e=[n||a,r||a,i||a]}static get identityMap(){return V(this,`identityMap`,Uint8Array.from({length:256},(e,t)=>t))}applyToColor(e){if(typeof e!=`string`||!e.startsWith(`#`))return e;let[t,n,r]=vt(e),[i,a,o]=this.#e;return H.makeHexColor(i[t],a[n],o[r])}applyToImageData({data:e}){let[t,n,r]=this.#e;for(let i=0,a=e.length;i<a;i+=4)e[i]=t[e[i]],e[i+1]=n[e[i+1]],e[i+2]=r[e[i+2]]}applyToCanvas(e){let{width:t,height:n}=e.canvas,r=e.getImageData(0,0,t,n);this.applyToImageData(r),e.putImageData(r,0,0)}},Ic=[`butt`,`round`,`square`],Lc=[`miter`,`round`,`bevel`],Rc={},zc={},Bc=class e{static#e=null;#t=0;#n=0;#r=null;#i=null;#a=null;#o=null;#s=1;#c;#l=null;#u=[];constructor(e,t,n,r,i,{optionalContentConfig:a,markedContentStack:o=null},s,c,l,u){this.ctx=e,this.current=new Pc(this.ctx.canvas.width,this.ctx.canvas.height),this.stateStack=[],this.pendingClip=null,this.pendingEOFill=!1,this.commonObjs=t,this.objs=n,this.canvasFactory=r,this.filterFactory=i,this.groupStack=[],this.baseTransform=null,this.baseTransformStack=[],this.groupLevel=0,this.smaskStack=[],this.tempSMask=null,this.smaskGroupCanvases=[],this.smaskPreparedEntry=null,this.smaskPreparedFor=null,this.smaskPreparedOffsetX=0,this.smaskPreparedOffsetY=0,this.smaskPreparedOOBAlpha=null,this.suspendedCtx=null,this.contentVisible=!0,this.markedContentStack=o||[],this.optionalContentConfig=a,this.cachedPatterns=new Map,this.annotationCanvasMap=s,this.viewportScale=1,this.outputScaleX=1,this.outputScaleY=1,this.pageColors=c,this._cachedScaleForStroking=[-1,0],this._cachedBitmapsMap=new Map,this.dependencyTracker=l??null,this.imagesTracker=u??null}getObject(e,t,n=null){return typeof t==`string`?(this.dependencyTracker?.recordNamedDependency(e,t),t.startsWith(`g_`)?this.commonObjs.get(t):this.objs.get(t)):n}beginDrawing({transform:e,viewport:t,transparency:n=!1,background:r=null}){let i=this.ctx.canvas.width,a=this.ctx.canvas.height,o=this.ctx.fillStyle;if(this.ctx.fillStyle=r||`#ffffff`,this.ctx.fillRect(0,0,i,a),this.ctx.fillStyle=o,n){let e=this.transparentCanvasEntry=this.canvasFactory.create(i,a);this.compositeCtx=this.ctx,{canvas:this.transparentCanvas,context:this.ctx}=e,this.ctx.save(),this.ctx.transform(...xt(this.compositeCtx))}this.ctx.save(),cn(this.ctx),e&&(this.ctx.transform(...e),this.outputScaleX=e[0],this.outputScaleY=e[3]),this.ctx.transform(...t.transform),this.viewportScale=t.scale,this.baseTransform=xt(this.ctx)}executeOperatorList(e,t,n,r,i){let a=e.argsArray,o=e.fnArray,s=t||0,c=a.length;if(c===s)return s;let l=c-s>jc&&typeof n==`function`,u=l?Date.now()+Ac:0,d=0,f=this.commonObjs,p=this.objs,m,h;for(;;){if(r!==void 0){if(s===r.nextBreakPoint)return r.breakIt(s,n),s;if(r.shouldSkip(s)){if(++s===c)return s;continue}}if(!i||i(s,e)){if(m=o[s],h=a[s]??null,m!==jo.dependency)h===null?this[m](s):this[m](s,...h);else for(let e of h){this.dependencyTracker?.recordNamedData(e,s);let t=e.startsWith(`g_`)?f:p;if(!t.has(e))return t.get(e,n),s}}if(s++,s===c)return s;if(l&&++d>jc){if(Date.now()>u)return n(),s;d=0}}}#d(){for(;this.stateStack.length||this.inSMaskMode;)this.restore();this.current.activeSMask=null,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.canvasFactory.destroy(this.transparentCanvasEntry),this.transparentCanvas=null,this.transparentCanvasEntry=null)}endDrawing(){this.#d();for(let e of this.smaskGroupCanvases)this.canvasFactory.destroy(e);this.smaskGroupCanvases.length=0,this._clearPreparedSMask(),this.tempSMask=null,this.smaskStack.length=0;for(let e of this.#u)this.#x(e);this.#u.length=0,this.#r=null,this.#i=null,this.#a=null,this.#o=null,this.#s=1,this.#l=null,this.#n=0,this.#t=0,this.cachedPatterns.clear();for(let e of this._cachedBitmapsMap.values()){for(let t of e.values())typeof HTMLCanvasElement<`u`&&t instanceof HTMLCanvasElement&&(t.width=t.height=0);e.clear()}this._cachedBitmapsMap.clear(),this.#f()}#f(){if(this.pageColors){let e=this.filterFactory.addHCMFilter(this.pageColors.foreground,this.pageColors.background);if(e!==`none`){let t=this.ctx.filter;this.ctx.filter=e,this.ctx.drawImage(this.ctx.canvas,0,0),this.ctx.filter=t}}}_scaleImage(e,t){let n=e.width??e.displayWidth,r=e.height??e.displayHeight,i=Math.max(Math.hypot(t[0],t[1]),1),a=Math.max(Math.hypot(t[2],t[3]),1),o=[],s=i,c=a,l=n,u=r;for(;s>2&&l>1||c>2&&u>1;){let e=l,t=u;s>2&&l>1&&(e=Math.ceil(l/2),s/=l/e),c>2&&u>1&&(t=Math.ceil(u/2),c/=u/t),o.push({newWidth:e,newHeight:t}),l=e,u=t}if(o.length===0)return{img:e,paintWidth:n,paintHeight:r,tmpCanvas:null};if(o.length===1){let{newWidth:t,newHeight:i}=o[0],a=this.canvasFactory.create(t,i);return a.context.drawImage(e,0,0,n,r,0,0,t,i),{img:a.canvas,paintWidth:t,paintHeight:i,tmpCanvas:a}}let d=this.canvasFactory.create(1,1),f=this.canvasFactory.create(1,1),p=n,m=r,h=e;for(let{newWidth:e,newHeight:t}of o)this.canvasFactory.reset(f,e,t),f.context.drawImage(h,0,0,p,m,0,0,e,t),[d,f]=[f,d],h=d.canvas,p=e,m=t;return this.canvasFactory.destroy(f),{img:d.canvas,paintWidth:p,paintHeight:m,tmpCanvas:d}}_createMaskCanvas(e,t){let n=this.ctx,{width:r,height:i}=t,a=this.current.patternFill,o=a?this.current.fillColor:n.fillStyle,s=xt(n),c,l,u,d;if((t.bitmap||t.data)&&t.count>1){let n=t.bitmap||t.data.buffer;l=JSON.stringify(a?s:[s.slice(0,4),o]),c=this._cachedBitmapsMap.getOrInsertComputed(n,Ko);let r=c.get(l);if(r&&!a){let t=Math.round(Math.min(s[0],s[2])+s[4]),n=Math.round(Math.min(s[1],s[3])+s[5]);return this.dependencyTracker?.recordDependencies(e,Vs.transformAndFill),{canvas:r,offsetX:t,offsetY:n}}u=r}u||(d=this.canvasFactory.create(r,i),on(d.context,t));let f=H.transform(s,[1/r,0,0,-1/i,0,0]);f=H.transform(f,[1,0,0,1,0,-i]);let p=go.slice();H.axialAlignedBoundingBox([0,0,r,i],f,p);let[m,h,g,_]=p,v=Math.round(g-m)||1,y=Math.round(_-h)||1,b=this.canvasFactory.create(v,y),x=b.context,S=m,C=h;x.translate(-S,-C),x.transform(...f);let w=null;if(!u){let e=this._scaleImage(d.canvas,St(x));u=e.img,w=e.tmpCanvas,u!==d.canvas&&(this.canvasFactory.destroy(d),d=null),c&&a&&(c.set(l,u),w=null,d=null)}x.imageSmoothingEnabled=ln(xt(x),t.interpolate),rn(x,u,0,0,u.width,u.height,0,0,r,i),w&&this.canvasFactory.destroy(w),d&&this.canvasFactory.destroy(d),x.globalCompositeOperation=`source-in`;let T=H.transform(St(x),[1,0,0,1,-S,-C]);return x.fillStyle=a?o.getPattern(n,this,T,xc.FILL,e):o,x.fillRect(0,0,r,i),c&&!a&&c.set(l,b.canvas),this.dependencyTracker?.recordDependencies(e,Vs.transformAndFill),{canvas:b.canvas,canvasEntry:c&&!a?null:b,offsetX:Math.round(S),offsetY:Math.round(C)}}setLineWidth(e,t){this.dependencyTracker?.recordSimpleData(`lineWidth`,e),t!==this.current.lineWidth&&(this._cachedScaleForStroking[0]=-1),this.current.lineWidth=t,this.ctx.lineWidth=t}setLineCap(e,t){this.dependencyTracker?.recordSimpleData(`lineCap`,e),this.ctx.lineCap=Ic[t]}setLineJoin(e,t){this.dependencyTracker?.recordSimpleData(`lineJoin`,e),this.ctx.lineJoin=Lc[t]}setMiterLimit(e,t){this.dependencyTracker?.recordSimpleData(`miterLimit`,e),this.ctx.miterLimit=t}setDash(e,t,n){this.dependencyTracker?.recordSimpleData(`dash`,e);let r=this.ctx;r.setLineDash!==void 0&&(r.setLineDash(t),r.lineDashOffset=n)}setRenderingIntent(e,t){}setFlatness(e,t){}setGState(e,t){for(let[n,r]of t)switch(n){case`LW`:this.setLineWidth(e,r);break;case`LC`:this.setLineCap(e,r);break;case`LJ`:this.setLineJoin(e,r);break;case`ML`:this.setMiterLimit(e,r);break;case`D`:this.setDash(e,r[0],r[1]);break;case`RI`:this.setRenderingIntent(e,r);break;case`FL`:this.setFlatness(e,r);break;case`Font`:this.setFont(e,r[0],r[1]);break;case`CA`:this.dependencyTracker?.recordSimpleData(`strokeAlpha`,e),this.current.strokeAlpha=r;break;case`ca`:this.dependencyTracker?.recordSimpleData(`fillAlpha`,e),this.ctx.globalAlpha=this.current.fillAlpha=r;break;case`BM`:this.dependencyTracker?.recordSimpleData(`globalCompositeOperation`,e),this.ctx.globalCompositeOperation=r;break;case`SMask`:this.dependencyTracker?.recordSimpleData(`SMask`,e),this.current.activeSMask=r?this.tempSMask:null,this.current.activeSMask&&(this.current.activeSMask.blendMode=this.ctx.globalCompositeOperation),this.tempSMask=null,this.checkSMaskState(e);break;case`TR`:{this.dependencyTracker?.recordSimpleData(`filter`,e);let t=this.filterFactory.addFilter(r);this.ctx.filter=t;let n=null;r&&(t===`none`||!Ho.isCanvasFilterSupported||this.ctx.filter===`none`||this.ctx.filter===``)&&(this.ctx.filter=t=`none`,n=new Fc(r)),this.current.transferMaps=t,(n||this.current.transferMapsFallback)&&(this.current.transferMapsFallback=n,this.current.patternFill||(this.ctx.fillStyle=this.#y(this.current.fillColor)),this.current.patternStroke||(this.ctx.strokeStyle=this.#y(this.current.strokeColor)));break}}}get inSMaskMode(){return!!this.suspendedCtx}_clearPreparedSMask(){this.smaskPreparedEntry&&=(this.canvasFactory.destroy(this.smaskPreparedEntry),null),this.smaskPreparedFor=null,this.smaskPreparedOffsetX=0,this.smaskPreparedOffsetY=0,this.smaskPreparedOOBAlpha=null}_ensurePreparedSMask(e){e!==this.smaskPreparedFor&&(this._clearPreparedSMask(),this._prepareSMaskCanvas(e))}checkSMaskState(e){let t=this.inSMaskMode;this.current.activeSMask&&!t?this.beginSMaskMode(e):!this.current.activeSMask&&t?this.endSMaskMode():this.current.activeSMask&&t&&this._ensurePreparedSMask(this.current.activeSMask)}_prepareSMaskCanvas(e){let{canvas:t,subtype:n,backdrop:r,transferMap:i}=e,a=n===`Luminosity`||n===`Alpha`&&i;if(!a&&!(n===`Luminosity`&&r)){this.smaskPreparedFor=e;return}let o;if(n===`Luminosity`&&r){let[e,t,n]=vt(r),a=Math.round(.3*e+.59*t+.11*n);o=i?.[a]??a}else o=i?.[0]??0;let{width:s,height:c}=this.ctx.canvas,l=t.width*t.height,u=s*c<4*l,d=a?{url:n===`Alpha`?this.filterFactory.addAlphaFilter(i):this.filterFactory.addLuminosityFilter(i),subtype:n,transferMap:i}:null,f=n===`Luminosity`?r:null,p,m,h;u?(p=this._bakeSMaskCanvas(t,e.offsetX,e.offsetY,s,c,f,d),m=0,h=0):(p=this._bakeSMaskCanvas(t,0,0,t.width,t.height,f,d),m=e.offsetX,h=e.offsetY),this.smaskPreparedEntry=p,this.smaskPreparedFor=e,this.smaskPreparedOffsetX=m,this.smaskPreparedOffsetY=h,this.smaskPreparedOOBAlpha=!u&&o!==0?o:null}_bakeSMaskCanvas(e,t,n,r,i,a,o){!a&&!o&&Ze(`_bakeSMaskCanvas with neither backdrop nor filter`);let s=this.canvasFactory.create(r,i),c=s.context;if(c.drawImage(e,t,n),a&&(c.globalCompositeOperation=`destination-atop`,c.fillStyle=a,c.fillRect(0,0,r,i)),!o)return s;let l=this.canvasFactory.create(r,i),u=l.context;u.filter=o.url;let d=Ho.isCanvasFilterSupported&&u.filter!==`none`&&u.filter!==``;if(u.drawImage(s.canvas,0,0),Ho.isCanvasFilterSupported&&(u.filter=`none`),!d){let e=u.getImageData(0,0,r,i),{data:t}=e,{transferMap:n}=o;if(o.subtype===`Luminosity`)for(let e=0,r=t.length;e<r;e+=4){let r=.3*t[e]+.59*t[e+1]+.11*t[e+2]+.5|0;t[e]=t[e+1]=t[e+2]=0,t[e+3]=n?.[r]??r}else for(let e=3,r=t.length;e<r;e+=4)t[e]=n[t[e]];u.putImageData(e,0,0)}return this.canvasFactory.destroy(s),l}beginSMaskMode(e){if(this.inSMaskMode)throw Error(`beginSMaskMode called while already in smask mode`);let{width:t,height:n}=this.ctx.canvas,r=this.canvasFactory.create(t,n);this.smaskScratchCanvas=r,this.suspendedCtx=this.ctx;let i=this.ctx=r.context;i.setTransform(this.suspendedCtx.getTransform()),sn(this.suspendedCtx,i),nn(i,this.suspendedCtx),this._ensurePreparedSMask(this.current.activeSMask),this.setGState(e,[[`BM`,`source-over`]])}endSMaskMode(){if(!this.inSMaskMode)throw Error(`endSMaskMode called while not in smask mode`);this.ctx._removeMirroring(),sn(this.ctx,this.suspendedCtx),this.ctx=this.suspendedCtx,this.suspendedCtx=null,this.canvasFactory.destroy(this.smaskScratchCanvas),this.smaskScratchCanvas=null,this._clearPreparedSMask()}#p(e,t=null,n=1){let{width:r,height:i}=e,a=t??this.canvasFactory.create(r,i),o=a.context;n=Math.round(n*255)/255;let s=n<1;s&&this.#c===void 0&&(this.#c=Ho.isCanvasFilterSupported?new Map:`none`);let c=`none`;if(s&&this.#c instanceof Map&&(c=this.#c.getOrInsertComputed(n,()=>this.filterFactory.addKnockoutFilter(n))),!s||c!==`none`)return t&&(o.save(),o.setTransform(1,0,0,1,0,0),o.clearRect(0,0,r,i),o.restore()),o.filter=c,o.drawImage(e,0,0),o.filter=`none`,a;let l=e.getContext(`2d`,{willReadFrequently:!0}).getImageData(0,0,r,i),u=o.createImageData(r,i),d=l.data,f=u.data,p=n>0?1/n:1e6;for(let e=3,t=d.length;e<t;e+=4)f[e]=Math.min(Math.round(d[e]*p),255);return o.putImageData(u,0,0),a}#m(e,t,n,r){let i=e?.[t]??null;if(i&&(i.canvas.width!==n||i.canvas.height!==r)&&(this.canvasFactory.destroy(i),i=null),!i)return i=this.canvasFactory.create(n,r),e&&(e[t]=i),i;let a=i.context;return a.save(),a.setTransform(1,0,0,1,0,0),a.clearRect(0,0,n,r),a.restore(),i}#h(e,t,n={}){let{backdropCanvas:r=null,destTransform:i=[1,0,0,1,0,0],backdropOffset:a=[0,0],reuseMaskEntry:o=null,poolMeta:s=null,sourceAlpha:c=1,sourceFilter:l=`none`,knockoutAlpha:u=1}=n,{width:d,height:f}=t,p=this.#p(t,o,u),m=e.globalCompositeOperation;if(e.save(),e.setTransform(...i),e.globalAlpha=1,Ho.isCanvasFilterSupported&&(e.filter=`none`),e.globalCompositeOperation=`destination-out`,e.drawImage(p.canvas,0,0),r){let[t,n]=a,i=this.#m(s,`knockoutBackdropEntry`,d,f),o=i.context;o.drawImage(r,t,n,d,f,0,0,d,f),o.globalCompositeOperation=`destination-in`,o.drawImage(p.canvas,0,0),o.globalCompositeOperation=`source-over`,e.globalCompositeOperation=`destination-over`,e.drawImage(i.canvas,0,0),s||this.canvasFactory.destroy(i)}e.globalCompositeOperation=m,e.globalAlpha=c,Ho.isCanvasFilterSupported&&(e.filter=l??`none`),e.drawImage(t,0,0),e.restore(),o||this.canvasFactory.destroy(p)}#g(e=1){if(this.#t===0||this.#n>0||!this.contentVisible)return!1;this.#n++,this.#s=e;let t=this.#u.at(-1),{canvas:n}=this.ctx,r=this.#m(t,`knockoutTempEntry`,n.width,n.height);this.#r=r;let i=r.context;return i.save(),i.setTransform(this.ctx.getTransform()),sn(this.ctx,i),this.#o=i.globalCompositeOperation,i.globalCompositeOperation=`source-over`,nn(i,this.ctx),this.#l=t,this.#i=this.ctx,this.#a=this.suspendedCtx,this.ctx=i,this.inSMaskMode&&(this.suspendedCtx=i),!0}#_(e){if(!e)return;let t=this.#r,n=this.#i,r=this.#a,i=t.context;this.#r=null,this.#i=null,this.#a=null,this.inSMaskMode&&this.suspendedCtx===i&&this.ctx!==i&&this.endSMaskMode(),this.inSMaskMode&&(this.suspendedCtx=r),this.ctx._removeMirroring(),this.ctx.globalCompositeOperation=this.#o,this.#o=null,sn(this.ctx,n),this.ctx=n;let a=this.#l;this.#l=null;let o=this.#s;this.#s=1;try{this.#h(r??n,t.canvas,{backdropCanvas:a?.backdropCtx?.canvas??null,backdropOffset:a?.backdropCtx?[a.offsetX,a.offsetY]:[0,0],reuseMaskEntry:a?.knockoutMaskEntry??null,poolMeta:a,knockoutAlpha:o})}finally{i.restore(),this.#n--,a||this.canvasFactory.destroy(t)}}compose(e){if(!this.current.activeSMask)return;e=e?[Math.floor(e[0]),Math.floor(e[1]),Math.ceil(e[2]),Math.ceil(e[3])]:[0,0,this.ctx.canvas.width,this.ctx.canvas.height];let t=this.current.activeSMask,n=this.suspendedCtx,r=this.#n>0&&n===this.ctx;this.composeSMask(r?null:n,t,this.ctx,e),!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(e,t,n,r){let i=r[0],a=r[1],o=r[2]-i,s=r[3]-a;if(o===0||s===0)return;let c=this.smaskPreparedEntry;if(c){let e=i,r=a,l=o,u=s,d=this.smaskPreparedOOBAlpha,f=d!==null;if(f){e=Math.max(i,t.offsetX),r=Math.max(a,t.offsetY);let n=Math.min(i+o,t.offsetX+t.canvas.width),c=Math.min(a+s,t.offsetY+t.canvas.height);l=n-e,u=c-r}if(l>0&&u>0){let t=e-this.smaskPreparedOffsetX,i=r-this.smaskPreparedOffsetY;n.save(),n.globalAlpha=1,n.setTransform(1,0,0,1,0,0);let a=new Path2D;a.rect(e,r,l,u),n.clip(a),n.globalCompositeOperation=`destination-in`,n.drawImage(c.canvas,t,i,l,u,e,r,l,u),n.restore()}f&&d<255&&this._applySMaskOOBAlpha(n,i,a,o,s,e,r,e+l,r+u,d)}else this.genericComposeSMask(t,n,o,s,i,a);e&&(e.save(),e.globalAlpha=1,e.globalCompositeOperation=t.blendMode||`source-over`,e.setTransform(1,0,0,1,0,0),e.drawImage(n.canvas,i,a,o,s,i,a,o,s),e.restore())}_applySMaskOOBAlpha(e,t,n,r,i,a,o,s,c,l){let u=a<s&&o<c;if(u&&a===t&&o===n&&s===t+r&&c===n+i)return;let d=new Path2D;d.rect(t,n,r,i),u&&d.rect(a,o,s-a,c-o),e.save(),e.globalAlpha=l/255,e.setTransform(1,0,0,1,0,0),e.clip(d,`evenodd`),e.globalCompositeOperation=`destination-in`,e.fillStyle=`#000000`,e.fillRect(t,n,r,i),e.restore()}genericComposeSMask(e,t,n,r,i,a){let{context:o,offsetX:s,offsetY:c}=e;t.save(),t.globalAlpha=1,t.setTransform(1,0,0,1,0,0);let l=new Path2D;l.rect(i,a,n,r),t.clip(l),t.globalCompositeOperation=`destination-in`,t.drawImage(o.canvas,i-s,a-c,n,r,i,a,n,r),t.restore()}save(e){this.inSMaskMode&&sn(this.ctx,this.suspendedCtx),this.ctx.save();let t=this.current;this.stateStack.push(t),this.current=t.clone(),this.dependencyTracker?.save(e)}restore(e){this.dependencyTracker?.restore(e),this.stateStack.length===0?this.inSMaskMode&&this.endSMaskMode():(this.current=this.stateStack.pop(),this.ctx.restore(),this.inSMaskMode&&(sn(this.suspendedCtx,this.ctx),this.ctx.setTransform(this.suspendedCtx.getTransform())),this.checkSMaskState(e),this.pendingClip=null,this._cachedScaleForStroking[0]=-1)}transform(e,t,n,r,i,a,o){this.dependencyTracker?.recordIncrementalData(`transform`,e),this.ctx.transform(t,n,r,i,a,o),this._cachedScaleForStroking[0]=-1}constructPath(e,t,n,r){let[i]=n;if(!r){i||=n[0]=new Path2D,t!==jo.stroke&&t!==jo.closeStroke&&(this.current.tilingPatternDims=null),this[t](e,i);return}if(this.dependencyTracker!==null){let n=t===jo.stroke?this.current.lineWidth/2:0;this.dependencyTracker.resetBBox(e).recordBBox(e,this.ctx,r[0]-n,r[2]+n,r[1]-n,r[3]+n).recordDependencies(e,[`transform`])}i instanceof Path2D||(i=n[0]=jt(i)),H.axialAlignedBoundingBox(r,xt(this.ctx),this.current.minMax);let a=this.current.tilingPatternDims;if(a&&t!==jo.stroke&&t!==jo.closeStroke&&this.current.fillColor instanceof Dc){let e=H.intersect(this.current.clipBox,this.current.minMax);e?this.current.fillColor.updatePatternDims(e,a):this.current.tilingPatternDims=null}this[t](e,i),this._pathStartIdx=e}closePath(e){this.ctx.closePath()}stroke(e,t,n=!0){let r=n&&this.#g(this.current.strokeAlpha),i=this.ctx,a=this.current.strokeColor;if(i.globalAlpha=this.current.strokeAlpha,this.contentVisible){if(typeof a==`object`&&a?.getPattern){let n=a.isModifyingCurrentTransform()?i.getTransform():null;if(i.save(),i.strokeStyle=a.getPattern(i,this,St(i),xc.STROKE,e),n){let e=new Path2D;e.addPath(t,i.getTransform().invertSelf().multiplySelf(n)),t=e}this.rescaleAndStroke(t,!1),i.restore()}else this.rescaleAndStroke(t,!0)}this.dependencyTracker?.recordDependencies(e,Vs.stroke),n&&this.consumePath(e,t,this.current.getClippedPathBoundingBox(xc.STROKE,xt(this.ctx))),i.globalAlpha=this.current.fillAlpha,this.#_(r)}closeStroke(e,t){this.stroke(e,t)}fill(e,t,n=!0){let r=n&&this.#g(this.current.fillAlpha),i=this.ctx,a=this.current.fillColor,o=this.current.patternFill,s=!1,c=this.current.getClippedPathBoundingBox();if(this.dependencyTracker?.recordDependencies(e,Vs.fill),o){let o=this.current.tilingPatternDims,l=o&&a.canSkipPatternCanvas(o);if(l){a.drawPattern(this,t,this.pendingEOFill,l,e),this.pendingEOFill=!1,n&&this.consumePath(e,t,c),this.current.tilingPatternDims=null,this.#_(r);return}let u=a.isModifyingCurrentTransform()?i.getTransform():null;if(this.dependencyTracker?.save(e),i.save(),i.fillStyle=a.getPattern(i,this,St(i),xc.FILL,e),u){let e=new Path2D;e.addPath(t,i.getTransform().invertSelf().multiplySelf(u)),t=e}s=!0}this.contentVisible&&c!==null&&(this.pendingEOFill?(i.fill(t,`evenodd`),this.pendingEOFill=!1):i.fill(t)),s&&(i.restore(),this.dependencyTracker?.restore(e)),n&&this.consumePath(e,t,c),this.#_(r)}eoFill(e,t){this.pendingEOFill=!0,this.fill(e,t)}fillStroke(e,t){let n=this.#g(Math.min(this.current.fillAlpha,this.current.strokeAlpha));this.fill(e,t,!1),this.stroke(e,t,!1),this.consumePath(e,t),this.#_(n)}eoFillStroke(e,t){this.pendingEOFill=!0,this.fillStroke(e,t)}closeFillStroke(e,t){this.fillStroke(e,t)}closeEOFillStroke(e,t){this.pendingEOFill=!0,this.fillStroke(e,t)}endPath(e,t){this.consumePath(e,t)}rawFillPath(e,t){let n=this.#g(this.current.fillAlpha);this.ctx.fill(t),this.dependencyTracker?.recordDependencies(e,Vs.rawFillPath).recordOperation(e),this.#_(n)}clip(e){this.dependencyTracker?.recordFutureForcedDependency(`clipMode`,e),this.pendingClip=Rc}eoClip(e){this.dependencyTracker?.recordFutureForcedDependency(`clipMode`,e),this.pendingClip=zc}beginText(e){this.current.textMatrix=null,this.current.textMatrixScale=1,this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0,this.dependencyTracker?.recordOpenMarker(e).resetIncrementalData(`sameLineText`).resetIncrementalData(`moveText`,e)}endText(e){let t=this.pendingTextPaths,n=this.ctx;if(this.dependencyTracker){let{dependencyTracker:n}=this;t!==void 0&&n.recordFutureForcedDependency(`textClip`,n.getOpenMarker()).recordFutureForcedDependency(`textClip`,e),n.recordCloseMarker(e)}if(t!==void 0){let e=new Path2D,r=n.getTransform().invertSelf();for(let{transform:n,x:i,y:a,fontSize:o,path:s}of t)s&&e.addPath(s,new DOMMatrix(n).preMultiplySelf(r).translate(i,a).scale(o,-o));n.clip(e)}delete this.pendingTextPaths}setCharSpacing(e,t){this.dependencyTracker?.recordSimpleData(`charSpacing`,e),this.current.charSpacing=t}setWordSpacing(e,t){this.dependencyTracker?.recordSimpleData(`wordSpacing`,e),this.current.wordSpacing=t}setHScale(e,t){this.dependencyTracker?.recordSimpleData(`hScale`,e),this.current.textHScale=t/100}setLeading(e,t){this.dependencyTracker?.recordSimpleData(`leading`,e),this.current.leading=-t}setFont(e,t,n){this.dependencyTracker?.recordSimpleData(`font`,e).recordSimpleDataFromNamed(`fontObj`,t,e);let r=this.commonObjs.get(t),i=this.current;if(!r)throw Error(`Can't find font for ${t}`);if(i.fontMatrix=r.fontMatrix||_o,(i.fontMatrix[0]===0||i.fontMatrix[3]===0)&&Xe(`Invalid font matrix for font `+t),n<0?(n=-n,i.fontDirection=-1):i.fontDirection=1,this.current.font=r,this.current.fontSize=n,r.isType3Font)return;let a=r.loadedName||`sans-serif`,o=r.systemFontInfo?.css||`"${a}", ${r.fallbackName}`,s=`normal`;r.black?s=`900`:r.bold&&(s=`bold`);let c=r.italic?`italic`:`normal`,l=lt(n,Oc,kc);this.current.fontSizeScale=n/l,this.ctx.font=`${c} ${s} ${l}px ${o}`}setTextRenderingMode(e,t){this.dependencyTracker?.recordSimpleData(`textRenderingMode`,e),this.current.textRenderingMode=t}setTextRise(e,t){this.dependencyTracker?.recordSimpleData(`textRise`,e),this.current.textRise=t}moveText(e,t,n){this.dependencyTracker?.resetIncrementalData(`sameLineText`).recordIncrementalData(`moveText`,e),this.current.x=this.current.lineX+=t,this.current.y=this.current.lineY+=n}setLeadingMoveText(e,t,n){this.setLeading(e,-n),this.moveText(e,t,n)}setTextMatrix(e,t){this.dependencyTracker?.resetIncrementalData(`sameLineText`).recordSimpleData(`textMatrix`,e);let{current:n}=this;n.textMatrix=t,n.textMatrixScale=Math.hypot(t[0],t[1]),n.x=n.lineX=0,n.y=n.lineY=0}nextLine(e){this.moveText(e,0,this.current.leading),this.dependencyTracker?.recordIncrementalData(`moveText`,this.dependencyTracker.getSimpleIndex(`leading`)??e)}#v(e,t,n){let r=new Path2D;return r.addPath(e,new DOMMatrix(n).invertSelf().multiplySelf(t)),r}paintChar(e,t,n,r,i,a){let o=this.ctx,s=this.current,c=s.font,l=s.textRenderingMode,u=s.fontSize/s.fontSizeScale,d=l&Eo.FILL_STROKE_MASK,f=!!(l&Eo.ADD_TO_PATH_FLAG),p=s.patternFill&&!c.missingFile,m=s.patternStroke&&!c.missingFile,h;if((c.disableFontFace||f||p||m)&&!c.missingFile&&(h=c.getPathGenerator(this.commonObjs,t)),h&&(c.disableFontFace||p||m)){o.save(),o.translate(n,r),o.scale(u,-u),this.dependencyTracker?.recordCharacterBBox(e,o,c);let t;if(d===Eo.FILL||d===Eo.FILL_STROKE){if(i){t=o.getTransform(),o.setTransform(...i);let e=this.#v(h,t,i);o.fill(e)}else o.fill(h)}if(d===Eo.STROKE||d===Eo.FILL_STROKE){if(a){t||=o.getTransform(),o.setTransform(...a);let{a:e,b:n,c:r,d:i}=t,s=H.inverseTransform(a),c=H.transform([e,n,r,i,0,0],s);H.singularValueDecompose2dScale(c,Nc),o.lineWidth*=Math.max(Nc[0],Nc[1])/u,o.stroke(this.#v(h,t,a))}else o.lineWidth/=u,o.stroke(h)}o.restore()}else(d===Eo.FILL||d===Eo.FILL_STROKE)&&(o.fillText(t,n,r),this.dependencyTracker?.recordCharacterBBox(e,o,c,u,n,r,()=>o.measureText(t))),(d===Eo.STROKE||d===Eo.FILL_STROKE)&&(this.dependencyTracker&&this.dependencyTracker?.recordCharacterBBox(e,o,c,u,n,r,()=>o.measureText(t)).recordDependencies(e,Vs.stroke),o.strokeText(t,n,r));f&&((this.pendingTextPaths||=[]).push({transform:xt(o),x:n,y:r,fontSize:u,path:h}),this.dependencyTracker?.recordCharacterBBox(e,o,c,u,n,r))}get isFontSubpixelAAEnabled(){let e=this.canvasFactory.create(10,10),t=e.context;t.scale(1.5,1),t.fillText(`I`,0,10);let n=t.getImageData(0,0,10,10).data;this.canvasFactory.destroy(e);let r=!1;for(let e=3;e<n.length;e+=4)if(n[e]>0&&n[e]<255){r=!0;break}return V(this,`isFontSubpixelAAEnabled`,r)}showText(e,t){this.dependencyTracker&&(this.dependencyTracker.recordDependencies(e,Vs.showText).resetBBox(e),this.current.textRenderingMode&Eo.ADD_TO_PATH_FLAG&&this.dependencyTracker.recordFutureForcedDependency(`textClip`,e).inheritPendingDependenciesAsFutureForcedDependencies());let n=this.current,r=n.font;if(r.isType3Font){let r=this.#g(n.fillAlpha);this.showType3Text(e,t),this.dependencyTracker?.recordShowTextOperation(e),this.#_(r);return}let i=n.fontSize;if(i===0){this.dependencyTracker?.recordOperation(e);return}let a=this.#g(n.fillAlpha),o=this.ctx,s=n.fontSizeScale,c=n.charSpacing,l=n.wordSpacing,u=n.fontDirection,d=n.textHScale*u,f=t.length,p=r.vertical,m=p?1:-1,h=i*n.fontMatrix[0],g=n.textRenderingMode===Eo.FILL&&!r.disableFontFace&&!n.patternFill;o.save(),n.textMatrix&&o.transform(...n.textMatrix),o.translate(n.x,n.y+n.textRise),u>0?o.scale(d,-1):o.scale(d,1);let _,v,y=n.textRenderingMode&Eo.FILL_STROKE_MASK,b=y===Eo.FILL||y===Eo.FILL_STROKE,x=y===Eo.STROKE||y===Eo.FILL_STROKE,S=n.lineWidth,C=n.textMatrixScale;if(C===0||S===0?x&&(S=this.getSinglePixelWidth()):S/=C,s!==1&&(o.scale(s,s),S/=s),o.lineWidth=S,b&&n.patternFill){o.save();let t=n.fillColor.getPattern(o,this,St(o),xc.FILL,e);_=xt(o),o.restore(),o.fillStyle=t}if(x&&n.patternStroke){o.save();let t=n.strokeColor.getPattern(o,this,St(o),xc.STROKE,e);v=xt(o),o.restore(),o.strokeStyle=t}if(r.isInvalidPDFjsFont){let r=[],i=0;for(let e of t)r.push(e.unicode),i+=e.width;let s=r.join(``);if(o.fillText(s,0,0),this.dependencyTracker!==null){let t=o.measureText(s);this.dependencyTracker.recordBBox(e,this.ctx,-t.actualBoundingBoxLeft,t.actualBoundingBoxRight,-t.actualBoundingBoxAscent,t.actualBoundingBoxDescent).recordShowTextOperation(e)}n.x+=i*h*d,o.restore(),this.compose(),this.#_(a);return}let w=0,T=0;for(;T<f;++T){let n=t[T];if(typeof n==`number`){w+=m*n*i/1e3;continue}let a=!1,d=(n.isSpace?l:0)+c,f=n.fontChar,y=n.accent,b,x,S=n.width;if(p){let e=n.vmetric,t=-e[1]*h,r=e[2]*h;S=-e[0],b=t/s,x=(w+r)/s}else b=w/s,x=0;let C;if(r.remeasure&&S>0){C=o.measureText(f);let e=C.width*1e3/i*s;if(S<e&&this.isFontSubpixelAAEnabled){let t=S/e;a=!0,o.save(),o.scale(t,1),b/=t}else S!==e&&(b+=(S-e)/2e3*i/s)}if(this.contentVisible&&(n.isInFont||r.missingFile)){if(g&&!y)o.fillText(f,b,x),this.dependencyTracker?.recordCharacterBBox(e,o,C?{bbox:null}:r,i/s,b,x,()=>C??o.measureText(f));else if(this.paintChar(e,f,b,x,_,v),y){let t=b+i*y.offset.x/s,n=x-i*y.offset.y/s;this.paintChar(e,y.fontChar,t,n,_,v)}}let E=p?S*h-d*u:S*h+d*u;w+=E,a&&o.restore()}p?n.y-=w:n.x+=w*d,o.restore(),this.compose(),this.dependencyTracker?.recordShowTextOperation(e),this.#_(a)}showType3Text(e,t){let n=this.ctx,r=this.current,i=r.font,a=r.fontSize,o=r.fontDirection,s=i.vertical?1:-1,c=r.charSpacing,l=r.wordSpacing,u=r.textHScale*o,d=r.fontMatrix||_o,f=t.length,p=r.textRenderingMode===Eo.INVISIBLE,m,h,g,_;if(p||a===0)return;this._cachedScaleForStroking[0]=-1,n.save(),r.textMatrix&&n.transform(...r.textMatrix),n.translate(r.x,r.y+r.textRise),n.scale(u,o);let v=this.dependencyTracker;for(this.dependencyTracker=v?new Bs(v,e):null,m=0;m<f;++m){if(h=t[m],typeof h==`number`){_=s*h*a/1e3,this.ctx.translate(_,0),r.x+=_*u;continue}let e=(h.isSpace?l:0)+c,o=i.charProcOperatorList.get(h.operatorListId);o?this.contentVisible&&(this.save(),o.fnArray[0]===jo.setCharWidth&&(r.fillAlpha=r.strokeAlpha=1,n.globalAlpha=1),n.scale(a,a),n.transform(...d),this.executeOperatorList(o),this.restore()):Xe(`Type3 character "${h.operatorListId}" is not available.`);let f=[h.width,0];H.applyTransform(f,d),g=f[0]*a+e,n.translate(g,0),r.x+=g*u}n.restore(),v&&(this.dependencyTracker=v)}setCharWidth(e,t,n){}setCharWidthAndBounds(e,t,n,r,i,a,o){let s=new Path2D;s.rect(r,i,a-r,o-i),this.ctx.clip(s),this.dependencyTracker?.recordBBox(e,this.ctx,r,a,i,o).recordClipBox(e,this.ctx,r,a,i,o),this.endPath(e)}getColorN_Pattern(t,n){let r;if(n[0]===`TilingPattern`){let t=this.baseTransform||xt(this.ctx);r=new Dc(n,this.ctx,{createCanvasGraphics:(t,n)=>new e(t,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:this.optionalContentConfig,markedContentStack:this.markedContentStack},void 0,void 0,this.dependencyTracker?new Bs(this.dependencyTracker,n,!0):null)},t)}else r=this._getPattern(t,n[1],n[2]);return r}setStrokeColorN(e,...t){this.dependencyTracker?.recordSimpleData(`strokeColor`,e),this.current.strokeColor=this.getColorN_Pattern(e,t),this.current.patternStroke=!0}setFillColorN(e,...t){this.dependencyTracker?.recordSimpleData(`fillColor`,e);let n=this.current.fillColor=this.getColorN_Pattern(e,t);this.current.patternFill=!0,this.current.tilingPatternDims=n instanceof Dc?[0,0,0,0]:null}#y(e){return this.current.transferMapsFallback?.applyToColor(e)??e}setStrokeRGBColor(e,t){this.dependencyTracker?.recordSimpleData(`strokeColor`,e),this.current.strokeColor=t,this.ctx.strokeStyle=this.#y(t),this.current.patternStroke=!1}setStrokeTransparent(e){this.dependencyTracker?.recordSimpleData(`strokeColor`,e),this.ctx.strokeStyle=this.current.strokeColor=`transparent`,this.current.patternStroke=!1}setFillRGBColor(e,t){this.dependencyTracker?.recordSimpleData(`fillColor`,e),this.current.fillColor=t,this.ctx.fillStyle=this.#y(t),this.current.patternFill=!1,this.current.tilingPatternDims=null}setFillTransparent(e){this.dependencyTracker?.recordSimpleData(`fillColor`,e),this.ctx.fillStyle=this.current.fillColor=`transparent`,this.current.patternFill=!1,this.current.tilingPatternDims=null}_getPattern(e,t,n=null){let r=this.cachedPatterns.getOrInsertComputed(t,()=>tn(this.getObject(e,t)));return n&&(r.matrix=n),r}shadingFill(e,t){if(!this.contentVisible)return;let n=this.#g(this.current.fillAlpha),r=this.ctx;this.save(e),r.fillStyle=this._getPattern(e,t).getPattern(r,this,St(r),xc.SHADING,e);let i=St(r);if(i){let{width:e,height:t}=r.canvas,n=go.slice();H.axialAlignedBoundingBox([0,0,e,t],i,n);let[a,o,s,c]=n;this.ctx.fillRect(a,o,s-a,c-o)}else this.ctx.fillRect(-1e10,-1e10,2e10,2e10);this.dependencyTracker?.resetBBox(e).recordFullPageBBox(e).recordDependencies(e,Vs.transform).recordDependencies(e,Vs.fill).recordOperation(e),this.compose(this.current.getClippedPathBoundingBox()),this.restore(e),this.#_(n)}beginInlineImage(){Ze(`Should not call beginInlineImage`)}beginImageData(){Ze(`Should not call beginImageData`)}paintFormXObjectBegin(e,t,n){if(this.contentVisible&&(this.save(e),this.baseTransformStack.push(this.baseTransform),t&&this.transform(e,...t),this.baseTransform=xt(this.ctx),n)){H.axialAlignedBoundingBox(n,this.baseTransform,this.current.minMax);let[t,r,i,a]=n,o=new Path2D;o.rect(t,r,i-t,a-r),this.ctx.clip(o),this.dependencyTracker?.recordClipBox(e,this.ctx,t,i,r,a),this.endPath(e)}}paintFormXObjectEnd(e){this.contentVisible&&(this.restore(e),this.baseTransform=this.baseTransformStack.pop())}beginGroup(e,t){if(!this.contentVisible)return;this.save(e);let{inSMaskMode:n}=this;n&&(this.endSMaskMode(),this.current.activeSMask=null);let r=this.ctx;if((!t.needsIsolation||!t.isolated&&!t.hasSoftMask)&&!t.knockout&&!t.isGray&&this.#t===0&&r.globalAlpha===1&&r.globalCompositeOperation===`source-over`&&!n){if(t.bbox){let e=new Path2D,[n,i,a,o]=t.bbox;if(e.rect(n,i,a-n,o-i),t.matrix){let n=new Path2D;n.addPath(e,new DOMMatrix(t.matrix)),e=n}r.clip(e)}this.groupStack.push(null),this.#u.push(null),this.groupLevel++;return}!t.isolated&&!t.knockout&&this.#t===0&&Ye(`TODO: Fully support non-isolated non-knockout groups.`);let i=xt(r);t.matrix&&r.transform(...t.matrix);let a=[0,0,r.canvas.width,r.canvas.height],o;t.bbox?(o=go.slice(),H.axialAlignedBoundingBox(t.bbox,xt(r),o),o=H.intersect(o,a)||[0,0,0,0]):o=a;let s=Math.floor(o[0]),c=Math.floor(o[1]),l=Math.max(Math.ceil(o[2])-s,1),u=Math.max(Math.ceil(o[3])-c,1);this.current.startNewPathAndClipBox([0,0,l,u]);let d=this.canvasFactory.create(l,u);t.smask&&this.smaskGroupCanvases.push(d);let f=d.context,p=t.knockout&&!t.isolated?r:null,m=!t.isolated&&!t.knockout&&!t.smask&&t.needsIsolation&&this.#t>0,h=t.knockout?this.canvasFactory.create(l,u):null,g=this.#t;t.knockout?this.#t++:this.#t=0,f.translate(-s,-c),f.transform(...i);let _=!t.isolated&&!t.smask&&t.needsIsolation,v=_&&!n&&g===0&&!t.knockout&&!t.isGray&&t.hasSoftMask&&r.globalAlpha===1&&r.globalCompositeOperation===`source-over`&&this.current.transferMaps===`none`&&!this.current.transferMapsFallback;if(_&&(n||v)&&(f.save(),f.setTransform(1,0,0,1,0,0),f.drawImage(r.canvas,-s,-c),f.restore()),t.bbox){let e=new Path2D,[n,r,i,a]=t.bbox;if(e.rect(n,r,i-n,a-r),t.matrix){let n=new Path2D;n.addPath(e,new DOMMatrix(t.matrix)),e=n}f.clip(e)}t.smask&&this.smaskStack.push({canvas:d.canvas,context:f,offsetX:s,offsetY:c,subtype:t.smask.subtype,backdrop:t.smask.backdrop,transferMap:t.smask.transferMap||null}),(!t.smask||this.dependencyTracker)&&(r.setTransform(1,0,0,1,0,0),r.translate(s,c),r.save()),sn(r,f),this.ctx=f,this.dependencyTracker?.inheritSimpleDataAsFutureForcedDependencies([`fillAlpha`,`strokeAlpha`,`globalCompositeOperation`]).pushBaseTransform(r),this.setGState(e,[[`BM`,`source-over`],[`ca`,1],[`CA`,1],[`TR`,null]]),this.groupStack.push(r),this.#u.push({backdropCtx:p,savedKnockoutLevel:g,offsetX:s,offsetY:c,hasInnerBackdrop:m,replaceBackdrop:v,knockoutMaskEntry:h,knockoutTempEntry:null,knockoutBackdropEntry:null}),this.groupLevel++}endGroup(e,t){if(!this.contentVisible)return;this.groupLevel--;let n=this.ctx,r=this.groupStack.pop(),i=this.#u.pop();if(i&&(this.#t=i.savedKnockoutLevel),r===null)this.restore(e);else if(t.isGray&&this.#b(n),this.ctx=r,this.ctx.imageSmoothingEnabled=!1,this.dependencyTracker?.popBaseTransform(),t.smask)this.tempSMask=this.smaskStack.pop(),this.restore(e),this.dependencyTracker&&(this.ctx.restore(),this.inSMaskMode&&this.ctx.setTransform(this.suspendedCtx.getTransform())),this.#x(i);else{this.ctx.restore();let t=xt(this.ctx);this.restore(e),this.current.transferMapsFallback?.applyToCanvas(n),this.ctx.save(),this.ctx.setTransform(...t);let a=go.slice();H.axialAlignedBoundingBox([0,0,n.canvas.width,n.canvas.height],t,a);let o=this.#u.at(-1);if(this.#t>0){if(i.hasInnerBackdrop){let{width:e,height:a}=n.canvas,o=this.canvasFactory.create(e,a),s=o.context;s.drawImage(r.canvas,i.offsetX,i.offsetY,e,a,0,0,e,a),s.globalCompositeOperation=`source-over`,s.drawImage(n.canvas,0,0);let c=this.#p(n.canvas);s.globalCompositeOperation=`destination-in`,s.drawImage(c.canvas,0,0);let l=this.ctx.globalCompositeOperation,u=this.ctx.globalAlpha,d=this.ctx.filter;this.ctx.save(),this.ctx.setTransform(...t),this.ctx.globalAlpha=1,Ho.isCanvasFilterSupported&&(this.ctx.filter=`none`),this.ctx.globalCompositeOperation=`destination-out`,this.ctx.drawImage(c.canvas,0,0),this.ctx.globalCompositeOperation=l,this.ctx.globalAlpha=u,Ho.isCanvasFilterSupported&&(this.ctx.filter=d??`none`),this.ctx.drawImage(o.canvas,0,0),this.ctx.restore(),this.canvasFactory.destroy(c),this.canvasFactory.destroy(o)}else{let e=o?.backdropCtx??null;this.#h(this.ctx,n.canvas,{backdropCanvas:e?.canvas??null,destTransform:t,backdropOffset:e?[o.offsetX+i.offsetX,o.offsetY+i.offsetY]:[0,0],sourceAlpha:this.ctx.globalAlpha,sourceFilter:this.ctx.filter})}}else{if(i.replaceBackdrop){let e=new Path2D;e.rect(0,0,n.canvas.width,n.canvas.height),this.ctx.clip(e),this.ctx.globalCompositeOperation=`copy`}this.ctx.drawImage(n.canvas,0,0)}this.ctx.restore(),this.canvasFactory.destroy({canvas:n.canvas,context:n}),this.#x(i),this.compose(a)}}#b(e){let{canvas:t}=e,{width:n,height:r}=t;if(Ho.isCanvasFilterSupported){e.save(),e.setTransform(1,0,0,1,0,0),e.filter=`grayscale(1)`,e.globalAlpha=1,e.globalCompositeOperation=`copy`,e.drawImage(t,0,0),e.restore();return}let i=e.getImageData(0,0,n,r),{data:a}=i;for(let e=0,t=a.length;e<t;e+=4){let t=a[e]*.2126+a[e+1]*.7152+a[e+2]*.0722+.5|0;a[e]=a[e+1]=a[e+2]=t}e.putImageData(i,0,0)}#x(e){e&&(e.knockoutMaskEntry&&=(this.canvasFactory.destroy(e.knockoutMaskEntry),null),e.knockoutTempEntry&&=(this.canvasFactory.destroy(e.knockoutTempEntry),null),e.knockoutBackdropEntry&&=(this.canvasFactory.destroy(e.knockoutBackdropEntry),null))}beginAnnotation(e,t,n,r,i,a,o){if(this.#d(),cn(this.ctx),this.ctx.save(),this.save(e),this.baseTransform&&this.ctx.setTransform(...this.baseTransform),n){let i=n[2]-n[0],s=n[3]-n[1];if(a&&this.annotationCanvasMap){r=r.slice(),r[4]-=n[0],r[5]-=n[1],H.singularValueDecompose2dScale(xt(this.ctx),Nc);let{viewportScale:e}=this,a=Math.ceil(i*this.outputScaleX*e),c=Math.ceil(s*this.outputScaleY*e);this.annotationCanvas=this.canvasFactory.create(a,c);let{canvas:l,context:u}=this.annotationCanvas;if(o){let e=this.annotationCanvasMap.getOrInsertComputed(t,Go);l.setAttribute(`data-canvas-name`,o);let n=e.findIndex(e=>e.getAttribute(`data-canvas-name`)===o);n===-1?e.push(l):e[n]=l}else this.annotationCanvasMap.set(t,l);this.annotationCanvas.savedCtx=this.ctx,this.ctx=u,this.ctx.save(),this.ctx.setTransform(Nc[0],0,0,-Nc[1],0,s*Nc[1]),cn(this.ctx)}else{cn(this.ctx),this.endPath(e);let t=new Path2D;t.rect(n[0],n[1],i,s),this.ctx.clip(t)}}this.current=new Pc(this.ctx.canvas.width,this.ctx.canvas.height),this.baseTransformStack.push(this.baseTransform),this.transform(e,...r),this.transform(e,...i),this.baseTransform=xt(this.ctx)}endAnnotation(e){this.annotationCanvas&&(this.ctx.restore(),this.#f(),this.ctx=this.annotationCanvas.savedCtx,delete this.annotationCanvas.savedCtx,delete this.annotationCanvas),this.baseTransform=this.baseTransformStack.pop()}paintImageMaskXObject(e,t){if(!this.contentVisible)return;let n=t.count;t=this.getObject(e,t.data,t),t.count=n;let r=this.#g(this.current.fillAlpha),i=this.ctx,a=this._createMaskCanvas(e,t),o=a.canvas;i.save(),i.setTransform(1,0,0,1,0,0),i.drawImage(o,a.offsetX,a.offsetY),this.dependencyTracker?.resetBBox(e).recordBBox(e,this.ctx,a.offsetX,a.offsetX+o.width,a.offsetY,a.offsetY+o.height).recordOperation(e),i.restore(),a.canvasEntry&&this.canvasFactory.destroy(a.canvasEntry),this.compose(),this.#_(r)}paintImageMaskXObjectRepeat(e,t,n,r=0,i=0,a,o){if(!this.contentVisible)return;t=this.getObject(e,t.data,t);let s=this.#g(this.current.fillAlpha),c=this.ctx;c.save();let l=xt(c);c.transform(n,r,i,a,0,0);let u=this._createMaskCanvas(e,t);c.setTransform(1,0,0,1,u.offsetX-l[4],u.offsetY-l[5]),this.dependencyTracker?.resetBBox(e);for(let t=0,s=o.length;t<s;t+=2){let s=H.transform(l,[n,r,i,a,o[t],o[t+1]]);c.drawImage(u.canvas,s[4],s[5]),this.dependencyTracker?.recordBBox(e,this.ctx,s[4],s[4]+u.canvas.width,s[5],s[5]+u.canvas.height)}c.restore(),u.canvasEntry&&this.canvasFactory.destroy(u.canvasEntry),this.compose(),this.dependencyTracker?.recordOperation(e),this.#_(s)}paintImageMaskXObjectGroup(e,t){if(!this.contentVisible)return;let n=this.#g(this.current.fillAlpha),r=this.ctx,i=this.current.patternFill,a=i?this.current.fillColor:r.fillStyle;this.dependencyTracker?.resetBBox(e).recordDependencies(e,Vs.transformAndFill);for(let n of t){let{data:t,width:o,height:s,transform:c}=n,l=this.canvasFactory.create(o,s),u=l.context;u.save(),on(u,this.getObject(e,t,n)),u.globalCompositeOperation=`source-in`,u.fillStyle=i?a.getPattern(u,this,St(r),xc.FILL,e):a,u.fillRect(0,0,o,s),u.restore(),r.save(),r.transform(...c),r.scale(1,-1),rn(r,l.canvas,0,0,o,s,0,-1,1,1),this.canvasFactory.destroy(l),this.dependencyTracker?.recordBBox(e,r,0,o,0,s),r.restore()}this.compose(),this.dependencyTracker?.recordOperation(e),this.#_(n)}paintImageXObject(e,t){if(!this.contentVisible)return;let n=this.getObject(e,t);n?this.paintInlineImageXObject(e,n):Xe(`Dependent image isn't ready yet`)}paintImageXObjectRepeat(e,t,n,r,i){if(!this.contentVisible)return;let a=this.getObject(e,t);if(!a){Xe(`Dependent image isn't ready yet`);return}let o=a.width,s=a.height,c=[];for(let e=0,t=i.length;e<t;e+=2)c.push({transform:[n,0,0,r,i[e],i[e+1]],x:0,y:0,w:o,h:s});this.paintInlineImageXObjectGroup(e,a,c)}applyTransferMapsToCanvas(e){return this.current.transferMaps===`none`?this.current.transferMapsFallback?.applyToCanvas(e):(e.filter=this.current.transferMaps,e.drawImage(e.canvas,0,0),e.filter=`none`),e.canvas}applyTransferMapsToBitmap(e){let{transferMaps:t,transferMapsFallback:n}=this.current;if(t===`none`&&!n)return{img:e.bitmap,canvasEntry:null};let{bitmap:r,width:i,height:a}=e,o=this.canvasFactory.create(i,a),s=o.context;return s.filter=t,s.drawImage(r,0,0),s.filter=`none`,n?.applyToCanvas(s),{img:o.canvas,canvasEntry:o}}paintInlineImageXObject(e,t){if(!this.contentVisible)return;let n=t.width,r=t.height,i=this.#g(this.current.fillAlpha),a=this.ctx;this.save(e);let{filter:o}=a;o!==`none`&&o!==``&&(a.filter=`none`),a.scale(1/n,-1/r);let s,c=null;if(t.bitmap){let e=this.applyTransferMapsToBitmap(t);s=e.img,c=e.canvasEntry}else{let e=this.canvasFactory.create(n,r);an(e.context,t),s=this.applyTransferMapsToCanvas(e.context),c=e}let l=this._scaleImage(s,St(a));a.imageSmoothingEnabled=ln(xt(a),t.interpolate),this.dependencyTracker&&(this.dependencyTracker.resetBBox(e).recordBBox(e,a,0,n,-r,0).recordDependencies(e,Vs.imageXObject).recordOperation(e),this.imagesTracker?.record(a,n,r,this.dependencyTracker.clipBox)),rn(a,l.img,0,0,l.paintWidth,l.paintHeight,0,-r,n,r),l.tmpCanvas&&this.canvasFactory.destroy(l.tmpCanvas),c&&this.canvasFactory.destroy(c),this.compose(),this.restore(e),this.#_(i)}paintInlineImageXObjectGroup(e,t,n){if(!this.contentVisible)return;let r=this.#g(this.current.fillAlpha),i=this.ctx,a,o=null;if(t.bitmap&&!this.current.transferMapsFallback)a=t.bitmap;else if(t.bitmap)({img:a,canvasEntry:o}=this.applyTransferMapsToBitmap(t));else{let e=t.width,n=t.height,r=this.canvasFactory.create(e,n);an(r.context,t),a=this.applyTransferMapsToCanvas(r.context),o=r}this.dependencyTracker?.resetBBox(e);for(let t of n)i.save(),i.transform(...t.transform),i.scale(1,-1),rn(i,a,t.x,t.y,t.w,t.h,0,-1,1,1),this.dependencyTracker?.recordBBox(e,i,0,1,-1,0),i.restore();o&&this.canvasFactory.destroy(o),this.dependencyTracker?.recordOperation(e),this.compose(),this.#_(r)}paintSolidColorImageMask(e){if(!this.contentVisible)return;let t=this.#g(this.current.fillAlpha);this.dependencyTracker?.resetBBox(e).recordBBox(e,this.ctx,0,1,0,1).recordDependencies(e,Vs.fill).recordOperation(e),this.ctx.fillRect(0,0,1,1),this.compose(),this.#_(t)}markPoint(e,t){}markPointProps(e,t,n){}beginMarkedContent(e,t){this.dependencyTracker?.beginMarkedContent(e),this.markedContentStack.push({visible:!0})}beginMarkedContentProps(e,t,n){this.dependencyTracker?.beginMarkedContent(e),t===`OC`?this.markedContentStack.push({visible:this.optionalContentConfig.isVisible(n)}):this.markedContentStack.push({visible:!0}),this.contentVisible=this.isContentVisible()}endMarkedContent(e){this.dependencyTracker?.endMarkedContent(e),this.markedContentStack.pop(),this.contentVisible=this.isContentVisible()}beginCompat(e){}endCompat(e){}consumePath(e,t,n){let r=this.current.isEmptyClip();this.pendingClip&&this.current.updateClipFromPath(),this.pendingClip||this.compose(n);let i=this.ctx;this.pendingClip?(r||(this.pendingClip===zc?i.clip(t,`evenodd`):i.clip(t)),this.pendingClip=null,this.dependencyTracker?.bboxToClipBoxDropOperation(e).recordFutureForcedDependency(`clipPath`,e)):this.dependencyTracker?.recordOperation(e),this.current.startNewPathAndClipBox(this.current.clipBox)}getSinglePixelWidth(){let e=xt(this.ctx);if(e[1]===0&&e[2]===0)return 1/Math.min(Math.abs(e[0]),Math.abs(e[3]));let t=Math.abs(e[0]*e[3]-e[2]*e[1]),n=Math.hypot(e[0],e[2]),r=Math.hypot(e[1],e[3]);return Math.max(n,r)/t}getScaleForStroking(){if(this._cachedScaleForStroking[0]===-1){let{lineWidth:e}=this.current,{a:t,b:n,c:r,d:i}=this.ctx.getTransform(),a,o;if(n===0&&r===0){let n=Math.abs(t),r=Math.abs(i);if(n===r){if(e===0)a=o=1/n;else{let t=n*e;a=o=t<1?1/t:1}}else if(e===0)a=1/n,o=1/r;else{let t=n*e,i=r*e;a=t<1?1/t:1,o=i<1?1/i:1}}else{let s=Math.abs(t*i-n*r),c=Math.hypot(t,n),l=Math.hypot(r,i);if(e===0)a=l/s,o=c/s;else{let t=e*s;a=l>t?l/t:1,o=c>t?c/t:1}}this._cachedScaleForStroking[0]=a,this._cachedScaleForStroking[1]=o}return this._cachedScaleForStroking}rescaleAndStroke(t,n){let{ctx:r,current:{lineWidth:i}}=this,[a,o]=this.getScaleForStroking();if(a===o){r.lineWidth=(i||1)*a,r.stroke(t);return}let s=e.#e??=new DOMMatrix,c=r.getLineDash();n&&r.save(),r.scale(a,o),s.a=1/a,s.d=1/o;let l=new Path2D;if(l.addPath(t,s),c.length>0){let e=Math.max(a,o);r.setLineDash(c.map(t=>t/e)),r.lineDashOffset/=e}r.lineWidth=i||1,r.stroke(l),n&&r.restore()}isContentVisible(){for(let e=this.markedContentStack.length-1;e>=0;e--)if(!this.markedContentStack[e].visible)return!1;return!0}};for(let e in jo)Bc.prototype[e]!==void 0&&(Bc.prototype[jo[e]]=Bc.prototype[e]);Vc=class{#e=null;#t=null;_fullReader=null;_rangeReaders=new Set;_source=null;constructor(e,t,n){this._source=e,this.#e=t,this.#t=n}get _progressiveDataLength(){return this._fullReader?._loaded??0}getFullReader(){return Qe(!this._fullReader,`BasePDFStream.getFullReader can only be called once.`),this._fullReader=new this.#e(this)}getRangeReader(e,t){if(t<=this._progressiveDataLength)return null;let n=new this.#t(this,e,t);return this._rangeReaders.add(n),n}cancelAllRequests(e){this._fullReader?.cancel(e);for(let t of new Set(this._rangeReaders))t.cancel(e)}},Hc=class{onProgress=null;_contentLength=0;_filename=null;_headersCapability=Promise.withResolvers();_isRangeSupported=!1;_isStreamingSupported=!1;_loaded=0;_stream=null;constructor(e){this._stream=e}_callOnProgress(){this.onProgress?.({loaded:this._loaded,total:this._contentLength})}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(){Ze("Abstract method `read` called")}cancel(e){Ze("Abstract method `cancel` called")}},Uc=class{_stream=null;constructor(e,t,n){this._stream=e}async read(){Ze("Abstract method `read` called")}cancel(e){Ze("Abstract method `cancel` called")}},Wc=class extends Vc{_responseOrigin=null;constructor(e){super(e,Gc,Kc);let{httpHeaders:t,url:n}=e;Qe(/https?:/.test(n.protocol),`PDFFetchStream only supports http(s):// URLs.`),this.headers=dn(!0,t)}},Gc=class extends Hc{_abortController=new AbortController;_reader=null;constructor(e){super(e);let{disableRange:t,disableStream:n,rangeChunkSize:r,url:i,withCredentials:a}=e._source;this._isStreamingSupported=!n,vn(i,new Headers(e.headers),a,this._abortController).then(n=>{e._responseOrigin=pn(n.url),yn(n.status,i),this._reader=n.body.getReader();let a=n.headers,{contentLength:o,isRangeSupported:s}=mn({responseHeaders:a,isHttp:!0,rangeChunkSize:r,disableRange:t});this._contentLength=o,this._isRangeSupported=s,this._filename=hn(a),!this._isStreamingSupported&&this._isRangeSupported&&this.cancel(new Vo(`Streaming is disabled.`)),this._headersCapability.resolve()}).catch(this._headersCapability.reject)}async read(){await this._headersCapability.promise;let{value:e,done:t}=await this._reader.read();return t?{value:e,done:t}:(this._loaded+=e.byteLength,this._callOnProgress(),{value:bn(e),done:!1})}cancel(e){this._reader?.cancel(e),this._abortController.abort()}},Kc=class extends Uc{_abortController=new AbortController;_readCapability=Promise.withResolvers();_reader=null;constructor(e,t,n){super(e,t,n);let{url:r,withCredentials:i}=e._source,a=new Headers(e.headers);a.append(`Range`,`bytes=${t}-${n-1}`),vn(r,a,i,this._abortController).then(t=>{_n(pn(t.url),e._responseOrigin),yn(t.status,r),this._reader=t.body.getReader(),this._readCapability.resolve()}).catch(this._readCapability.reject)}async read(){await this._readCapability.promise;let{value:e,done:t}=await this._reader.read();return t?{value:e,done:t}:{value:bn(e),done:!1}}cancel(e){this._reader?.cancel(e),this._abortController.abort()}},qc=class extends Vc{_progressiveDone=!1;_queuedChunks=[];constructor(e){super(e,Jc,Yc);let{pdfDataRangeTransport:t}=e,{initialData:n,progressiveDone:r}=t;if(n?.length>0){let e=xn(n);this._queuedChunks.push(e)}this._progressiveDone=r,t.transportReady(e=>{switch(e.type){case`range`:case`progressiveRead`:this.#e(e.begin,e.chunk);break;case`progressiveDone`:this._fullReader?.progressiveDone(),this._progressiveDone=!0}})}#e(e,t){let n=xn(t);if(e===void 0)this._fullReader?this._fullReader._enqueue(n):this._queuedChunks.push(n);else{let t=this._rangeReaders.keys().find(t=>t._begin===e);Qe(t,"#onReceiveData - no `PDFDataTransportStreamRangeReader` instance found."),t._enqueue(n)}}getFullReader(){let e=super.getFullReader();return this._queuedChunks=null,e}getRangeReader(e,t){let n=super.getRangeReader(e,t);return n&&(n.onDone=()=>this._rangeReaders.delete(n),this._source.pdfDataRangeTransport.requestDataRange(e,t)),n}cancelAllRequests(e){super.cancelAllRequests(e),this._source.pdfDataRangeTransport.abort()}},Jc=class extends Hc{#e=Sn.bind(this);_done=!1;_queuedChunks=null;_requests=[];constructor(e){super(e);let{pdfDataRangeTransport:t,disableRange:n,disableStream:r}=e._source,{length:i,contentDispositionFilename:a}=t;this._queuedChunks=e._queuedChunks||[];for(let e of this._queuedChunks)this._loaded+=e.byteLength;this._done=e._progressiveDone,this._contentLength=i,this._isStreamingSupported=!r,this._isRangeSupported=!n,ft(a)&&(this._filename=a),this._headersCapability.resolve();let o=this._loaded;Promise.resolve().then(()=>{o>0&&this._loaded===o&&this._callOnProgress()})}_enqueue(e){this._done||(this._requests.length>0?this._requests.shift().resolve({value:e,done:!1}):this._queuedChunks.push(e),this._loaded+=e.byteLength,this._callOnProgress())}async read(){if(this._queuedChunks.length>0)return{value:this._queuedChunks.shift(),done:!1};if(this._done)return{value:void 0,done:!0};let e=Promise.withResolvers();return this._requests.push(e),e.promise}cancel(e){this._done=!0,this.#e()}progressiveDone(){this._done||=!0,this._queuedChunks.length===0&&this.#e()}},Yc=class extends Uc{#e=Sn.bind(this);onDone=null;_begin=-1;_done=!1;_queuedChunk=null;_requests=[];constructor(e,t,n){super(e,t,n),this._begin=t}_enqueue(e){this._done||(this._requests.length===0?this._queuedChunk=e:(this._requests.shift().resolve({value:e,done:!1}),this.#e()),this._done=!0,this.onDone?.())}async read(){if(this._queuedChunk){let e=this._queuedChunk;return this._queuedChunk=null,{value:e,done:!1}}if(this._done)return{value:void 0,done:!0};let e=Promise.withResolvers();return this._requests.push(e),e.promise}cancel(e){this._done=!0,this.#e(),this.onDone?.()}},Xc=200,Zc=206,Qc=class extends Vc{#e=new WeakMap;_responseOrigin=null;constructor(e){super(e,$c,el);let{httpHeaders:t,url:n}=e;this.url=n,this.isHttp=/https?:/.test(n.protocol),this.headers=dn(this.isHttp,t)}_request(e){let t=new XMLHttpRequest,n={validateStatus:null,onHeadersReceived:e.onHeadersReceived,onDone:e.onDone,onError:e.onError,onProgress:e.onProgress};this.#e.set(t,n),t.open(`GET`,this.url),t.withCredentials=this._source.withCredentials;for(let[e,n]of this.headers)t.setRequestHeader(e,n);return this.isHttp&&`begin`in e&&`end`in e?(t.setRequestHeader(`Range`,`bytes=${e.begin}-${e.end-1}`),n.validateStatus=e=>e===Zc||e===Xc):n.validateStatus=e=>e===Xc,t.responseType=`arraybuffer`,Qe(e.onError,"Expected `onError` callback to be provided."),t.onerror=()=>e.onError(t.status),t.onreadystatechange=this.#n.bind(this,t),t.onprogress=this.#t.bind(this,t),t.send(null),t}#t(e,t){this.#e.get(e)?.onProgress?.(t)}#n(e,t){let n=this.#e.get(e);if(!n||(e.readyState>=2&&n.onHeadersReceived&&(n.onHeadersReceived(),delete n.onHeadersReceived),e.readyState!==4)||!this.#e.has(e))return;if(this.#e.delete(e),e.status===0&&this.isHttp){n.onError(e.status);return}let r=e.status||Xc;if(!n.validateStatus(r)){n.onError(e.status);return}let i=Cn(e.response);if(r===Zc){let t=e.getResponseHeader(`Content-Range`);/bytes \d+-\d+\/\d+/.test(t)?n.onDone(i):(Xe(`Missing or invalid "Content-Range" header.`),n.onError(0))}else i?n.onDone(i):n.onError(e.status)}_abortRequest(e){this.#e.has(e)&&(this.#e.delete(e),e.abort())}getRangeReader(e,t){let n=super.getRangeReader(e,t);return n&&(n.onClosed=()=>this._rangeReaders.delete(n)),n}},$c=class extends Hc{#e=Sn.bind(this);_cachedChunks=[];_done=!1;_requests=[];_storedError=null;constructor(e){super(e),this._fullRequestXhr=e._request({onHeadersReceived:this.#t.bind(this),onDone:this.#n.bind(this),onError:this.#r.bind(this),onProgress:this.#i.bind(this)})}#t(){let e=this._stream,{disableRange:t,rangeChunkSize:n}=e._source,r=this._fullRequestXhr;e._responseOrigin=pn(r.responseURL);let i=r.getAllResponseHeaders(),a=new Headers(i?fn(i.trimStart()).split(/[\r\n]+/).map(e=>{let[t,...n]=e.split(`: `);return[t,n.join(`: `)]}):[]),{contentLength:o,isRangeSupported:s}=mn({responseHeaders:a,isHttp:e.isHttp,rangeChunkSize:n,disableRange:t});this._contentLength=o,this._isRangeSupported=s,this._filename=hn(a),this._isRangeSupported&&e._abortRequest(r),this._headersCapability.resolve()}#n(e){this._requests.length>0?this._requests.shift().resolve({value:e,done:!1}):this._cachedChunks.push(e),this._done=!0,this._cachedChunks.length===0&&this.#e()}#r(e){this._storedError=gn(e,this._stream.url),this._headersCapability.reject(this._storedError);for(let e of this._requests)e.reject(this._storedError);this._requests.length=0,this._cachedChunks.length=0}#i(e){this.onProgress?.({loaded:e.loaded,total:e.lengthComputable?e.total:this._contentLength})}async read(){if(await this._headersCapability.promise,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 e=Promise.withResolvers();return this._requests.push(e),e.promise}cancel(e){this._done=!0,this._headersCapability.reject(e),this.#e(),this._stream._abortRequest(this._fullRequestXhr),this._fullRequestXhr=null}},el=class extends Uc{#e=Sn.bind(this);onClosed=null;_done=!1;_queuedChunk=null;_requests=[];_storedError=null;constructor(e,t,n){super(e,t,n),this._requestXhr=e._request({begin:t,end:n,onHeadersReceived:this.#t.bind(this),onDone:this.#n.bind(this),onError:this.#r.bind(this),onProgress:null})}#t(){let e=pn(this._requestXhr?.responseURL);try{_n(e,this._stream._responseOrigin)}catch(e){this._storedError=e,this.#r(0)}}#n(e){this._requests.length>0?this._requests.shift().resolve({value:e,done:!1}):this._queuedChunk=e,this._done=!0,this.#e(),this.onClosed?.()}#r(e){this._storedError??=gn(e,this._stream.url);for(let e of this._requests)e.reject(this._storedError);this._requests.length=0,this._queuedChunk=null}async read(){if(this._storedError)throw this._storedError;if(this._queuedChunk!==null){let e=this._queuedChunk;return this._queuedChunk=null,{value:e,done:!1}}if(this._done)return{value:void 0,done:!0};let e=Promise.withResolvers();return this._requests.push(e),e.promise}cancel(e){this._done=!0,this.#e(),this._stream._abortRequest(this._requestXhr),this.onClosed?.()}},tl=class extends Vc{constructor(e){super(e,nl,rl);let{url:t}=e;Qe(t.protocol===`file:`,`PDFNodeStream only supports file:// URLs.`)}},nl=class extends Hc{_reader=null;constructor(e){super(e);let{disableRange:t,disableStream:n,rangeChunkSize:r,url:i}=e._source;this._isStreamingSupported=!n,process.getBuiltinModule(`fs/promises`).lstat(i).then(e=>{let n=wn(i);this._reader=n.getReader();let{size:a}=e;this._contentLength=a,this._isRangeSupported=!t&&a>2*r,!this._isStreamingSupported&&this._isRangeSupported&&this.cancel(new Vo(`Streaming is disabled.`)),this._headersCapability.resolve()}).catch(e=>{e.code===`ENOENT`&&(e=gn(0,i)),this._headersCapability.reject(e)})}async read(){await this._headersCapability.promise;let{value:e,done:t}=await this._reader.read();return t?{value:e,done:t}:(this._loaded+=e.byteLength,this._callOnProgress(),{value:bn(e),done:!1})}cancel(e){this._reader?.cancel(e)}},rl=class extends Uc{_readCapability=Promise.withResolvers();_reader=null;constructor(e,t,n){super(e,t,n);let{url:r}=e._source;try{let e=wn(r,{start:t,end:n-1});this._reader=e.getReader(),this._readCapability.resolve()}catch(e){this._readCapability.reject(e)}}async read(){await this._readCapability.promise;let{value:e,done:t}=await this._reader.read();return t?{value:e,done:t}:{value:bn(e),done:!1}}cancel(e){this._reader?.cancel(e)}},il=class{static#e=null;static#t=``;static get workerPort(){return this.#e}static set workerPort(e){if(!(typeof Worker<`u`&&e instanceof Worker)&&e!==null)throw Error("Invalid `workerPort` type.");this.#e=e}static get workerSrc(){return this.#t}static set workerSrc(e){if(typeof e!=`string`)throw Error("Invalid `workerSrc` type.");this.#t=e}},al=class{#e;#t;constructor({parsedData:e,rawData:t}){this.#e=e,this.#t=t}getRaw(){return this.#t}get(e){return this.#e.get(e)??null}[Symbol.iterator](){return this.#e.entries()}},ol=Symbol(`INTERNAL`),sl=class{#e=!1;#t=!1;#n=!1;#r=!0;constructor(e,{name:t,intent:n,usage:r,rbGroups:i}){this.#e=!!(e&yo.DISPLAY),this.#t=!!(e&yo.PRINT),this.name=t,this.intent=n,this.usage=r,this.rbGroups=i}get visible(){if(this.#n)return this.#r;if(!this.#r)return!1;let{print:e,view:t}=this.usage;return this.#e?t?.viewState!==`OFF`:!this.#t||e?.printState!==`OFF`}_setVisible(e,t,n=!1){e!==ol&&Ze("Internal method `_setVisible` called."),this.#n=n,this.#r=t}get serializable(){return{userSet:this.#n,visible:this.#r}}},cl=class e{#e=null;#t=new Map;#n=null;#r=null;#i;creator=null;name=null;constructor(e,t=yo.DISPLAY,n=null){if(this.#i=e,this.renderingIntent=t,e!==null){this.name=e.name,this.creator=e.creator,this.#r=e.order;for(let n of e.groups)this.#t.set(n.id,new sl(t,n));if(n){n.size!==this.#t.size&&Ze(`Incorrect serialized groupState.`);for(let[e,t]of n)this.#t.get(e)._setVisible(ol,t.visible,t.userSet)}else{if(e.baseState===`OFF`)for(let e of this.#t.values())e._setVisible(ol,!1);for(let t of e.on)this.#t.get(t)._setVisible(ol,!0);for(let t of e.off)this.#t.get(t)._setVisible(ol,!1)}this.#n=this.getHash()}}#a(e){let t=e.length;if(t<2)return!0;let n=e[0];for(let r=1;r<t;r++){let t=e[r],i;if(Array.isArray(t))i=this.#a(t);else if(this.#t.has(t))i=this.#t.get(t).visible;else return Xe(`Optional content group not found: ${t}`),!0;switch(n){case`And`:if(!i)return!1;break;case`Or`:if(i)return!0;break;case`Not`:return!i;default:return!0}}return n===`And`}isVisible(e){if(this.#t.size===0)return!0;if(!e)return Ye(`Optional content group not defined.`),!0;if(e.type===`OCG`)return this.#t.has(e.id)?this.#t.get(e.id).visible:(Xe(`Optional content group not found: ${e.id}`),!0);if(e.type===`OCMD`){if(e.expression)return this.#a(e.expression);if(!e.policy||e.policy===`AnyOn`){for(let t of e.ids){if(!this.#t.has(t))return Xe(`Optional content group not found: ${t}`),!0;if(this.#t.get(t).visible)return!0}return!1}if(e.policy===`AllOn`){for(let t of e.ids){if(!this.#t.has(t))return Xe(`Optional content group not found: ${t}`),!0;if(!this.#t.get(t).visible)return!1}return!0}if(e.policy===`AnyOff`){for(let t of e.ids){if(!this.#t.has(t))return Xe(`Optional content group not found: ${t}`),!0;if(!this.#t.get(t).visible)return!0}return!1}if(e.policy===`AllOff`){for(let t of e.ids){if(!this.#t.has(t))return Xe(`Optional content group not found: ${t}`),!0;if(this.#t.get(t).visible)return!1}return!0}return Xe(`Unknown optional content policy ${e.policy}.`),!0}return Xe(`Unknown group type ${e.type}.`),!0}setVisibility(e,t=!0,n=!0){let r=this.#t.get(e);if(!r)Xe(`Optional content group not found: ${e}`);else{if(n&&t&&r.rbGroups.length)for(let t of r.rbGroups)for(let n of t)n!==e&&this.#t.get(n)?._setVisible(ol,!1,!0);r._setVisible(ol,!!t,!0),this.#e=null}}setOCGState({state:e,preserveRB:t}){let n;for(let r of e){switch(r){case`ON`:case`OFF`:case`Toggle`:n=r;continue}let e=this.#t.get(r);if(e)switch(n){case`ON`:this.setVisibility(r,!0,t);break;case`OFF`:this.setVisibility(r,!1,t);break;case`Toggle`:this.setVisibility(r,!e.visible,t)}}this.#e=null}get hasInitialVisibility(){return this.#n===null||this.getHash()===this.#n}getOrder(){return this.#t.size?this.#r?this.#r.slice():[...this.#t.keys()]:null}getGroup(e){return this.#t.get(e)||null}getHash(){if(this.#e!==null)return this.#e;let e=new Os;for(let[t,n]of this.#t)e.update(`${t}:${n.visible}`);return this.#e=e.hexdigest()}[Symbol.iterator](){return this.#t.entries()}get serializable(){let e=new Map;for(let[t,n]of this.#t)e.set(t,n.serializable);return{data:this.#i,renderingIntent:this.renderingIntent,groupState:e}}static fromSerializable({data:t,renderingIntent:n,groupState:r}){return new e(t,n,r)}},ll=class{#e=null;#t=null;#n=0;#r=null;#i=null;get pagesNumber(){return this.#n}set pagesNumber(e){this.#n!==e&&(this.#n=e,this.#e=null,this.#t=null)}#a(){if(this.#e)return;let e=this.#n,t=this.#e=new Uint32Array(e);for(let n=0;n<e;n++)t[n]=n+1;this.#t=new Int32Array(t)}#o(){let e=new Map,t=this.#e;for(let n=0,r=this.#n;n<r;n++){let r=t[n],i=e.get(r);i?i.push(n+1):e.set(r,[n+1])}return e}movePages(e,t,n){this.#a();let r=this.#e,i=t.length,a=new Uint32Array(i),o=0;for(let e=0;e<i;e++){let i=t[e]-1;a[e]=r[i],i<n&&o++}let s=this.#n,c=s-i,l=new Int32Array(s),u=lt(n-o,0,c);for(let t=0,n=0;t<s;t++)e.has(t+1)||(r[n]=r[t],l[n++]=t+1);r.copyWithin(u+i,u,c),r.set(a,u),l.copyWithin(u+i,u,c),l.set(t,u),this.#t=l,r.every((e,t)=>e===t+1)&&(this.#e=null)}deletePages(e){this.#a();let t=this.#e,n=this.#o();this.#i={pageNumberToId:t.slice(),pagesNumber:this.#n,prevPageNumbers:this.#t.slice()};let r=this.#n-e.length;this.#n=r;let i=this.#e=new Uint32Array(r);this.#t=new Int32Array(r);let a=0,o=0;for(let n of e){let e=n-1;e!==a&&(i.set(t.subarray(a,e),o),o+=e-a),a=e+1}a<t.length&&i.set(t.subarray(a),o),this.#s(n,new Set(e))}cancelDelete(){this.#i&&=(this.#e=this.#i.pageNumberToId,this.#n=this.#i.pagesNumber,this.#t=this.#i.prevPageNumbers,null)}cleanSavedData(){this.#i=null}copyPages(e){this.#a(),this.#r={pageNumbers:e,pageIds:e.map(e=>this.#e[e-1])}}cancelCopy(){this.#r=null}pastePages(e){this.#a();let t=this.#e,n=this.#o(),{pageNumbers:r,pageIds:i}=this.#r,a=this.#n+r.length;this.#n=a;let o=this.#e=new Uint32Array(a);this.#t=new Int32Array(a),o.set(t.subarray(0,e),0),o.set(i,e),o.set(t.subarray(e),e+r.length),this.#s(n,null,e,r),this.#r=null}#s(e,t=null,n=-1,r=null){let i=this.#t,a=this.#e,o=n+(r?.length??0),s=new Map;for(let c=0,l=this.#n;c<l;c++){if(c>=n&&c<o){i[c]=-r[c-n];continue}let l=a[c],u=e.get(l),d=s.get(l)||0;if(t&&u)for(;d<u.length&&t.has(u[d]);)d++;i[c]=u?.[d],s.set(l,d+1)}}hasBeenAltered(){return this.#e!==null}#c(e=null){if(!this.#e)return null;let t=new Int32Array(this.#n).fill(-1),n=new Map;if(e)for(let r of e){let e=this.getPageId(r),i=n.get(e)??0;n.set(e,i+1),t[r-1]=i}else for(let e=0,r=this.#n;e<r;e++){let r=this.#e[e],i=n.get(r)??0;n.set(r,i+1),t[e]=i}return t}getPageMappingForSaving(e=null,t=this.#c()){e??=this.#o();let n=0;for(let t of e.values())n=Math.max(n,t.length);let r=Array(n);for(let e=0;e<n;e++)r[e]={document:null,pageIndices:[],includePages:[]};for(let[t,n]of e)for(let e=0,i=n.length;e<i;e++)r[e].includePages.push([t-1,n[e]-1]);for(let{includePages:e,pageIndices:t}of r){e.sort((e,t)=>e[0]-t[0]);for(let n=0,r=e.length;n<r;n++)t.push(e[n][1]),e[n]=e[n][0]}return{pageInfos:r,copyLevels:t}}extractPages(e){e=Array.from(e).sort((e,t)=>e-t);let t=new Map;for(let n=0,r=e.length;n<r;n++){let r=this.getPageId(e[n]);t.getOrInsertComputed(r,Go).push(n+1)}return this.getPageMappingForSaving(t,this.#c(e))}getPrevPageNumber(e){return this.#t?.[e-1]??0}getPageNumber(e){if(!this.#e)return e;let t=this.#e;for(let n=0,r=this.#n;n<r;n++)if(t[n]===e)return n+1;return 0}getPageId(e){return this.#e?.[e-1]??e}getMapping(){return this.#e?.subarray(0,this.pagesNumber)}},ul=Symbol(`INITIAL_DATA`),dl=()=>({...Promise.withResolvers(),data:ul}),fl=class{#e=new Map;get(e,t=null){if(t){let n=this.#e.getOrInsertComputed(e,dl);return n.promise.then(()=>t(n.data)),null}let n=this.#e.get(e);if(!n||n.data===ul)throw Error(`Requesting object that isn't resolved yet ${e}.`);return n.data}has(e){let t=this.#e.get(e);return!!t&&t.data!==ul}delete(e){let t=this.#e.get(e);return!t||t.data===ul?!1:(this.#e.delete(e),!0)}resolve(e,t=null){let n=this.#e.getOrInsertComputed(e,dl);if(n.data!==ul)throw Error(`Object already resolved ${e}.`);n.data=t,n.resolve()}clear(){for(let{data:e}of this.#e.values())e?.bitmap?.close();this.#e.clear()}*[Symbol.iterator](){for(let[e,{data:t}]of this.#e)t!==ul&&(yield[e,t])}},pl=1e5,ml=30,hl=class e{#e=Promise.withResolvers();#t=null;#n=!1;#r=!!globalThis.FontInspector?.enabled;#i=null;#a=null;#o=null;#s=0;#c=0;#l=is.pixelRatio;#u=null;#d=null;#f=0;#p=0;#m=Object.create(null);#h=[];#g=null;#_=[];#v=new WeakMap;#y=null;static#b=new Map;static#x=new Map;static#S=new WeakMap;static#C=null;static#w=new Set;constructor({textContentSource:t,images:n,container:r,viewport:i}){if(t instanceof ReadableStream)this.#g=t;else if(typeof t==`object`)this.#g=new ReadableStream({start(e){e.enqueue(t),e.close()}});else throw Error(`No "textContentSource" parameter specified.`);this.#t=this.#d=r,this.#i=n,this.#p=i.scale*this.#l,this.#f=i.rotation,this.#o={div:null,properties:null,ctx:null};let{pageWidth:a,pageHeight:o,pageX:s,pageY:c}=i.rawDims;this.#y=[1,0,0,-1,-s,c+o],this.#c=a,this.#s=o,e.#j(),r.style.setProperty(`--min-font-size`,e.#C),Ct(r,i),this.#e.promise.finally(()=>{e.#w.delete(this),this.#o=null,this.#m=null}).catch(()=>{})}static get fontFamilyMap(){let{isWindows:e,isFirefox:t}=Ho.platform;return V(this,`fontFamilyMap`,new Map([[`sans-serif`,`${e&&t?`Calibri, `:``}sans-serif`],[`monospace`,`${e&&t?`Lucida Console, `:``}monospace`]]))}render(){this.#i&&this.#t.append(this.#i.render());let t=()=>{this.#u.read().then(({value:e,done:n})=>{n?this.#e.resolve():(this.#a??=e.lang,Object.assign(this.#m,e.styles),this.#T(e.items),t())},this.#e.reject)};return this.#u=this.#g.getReader(),e.#w.add(this),t(),this.#e.promise}update({viewport:t,onBefore:n=null}){let r=t.scale*is.pixelRatio,i=t.rotation;if(i!==this.#f&&(n?.(),this.#f=i,Ct(this.#d,{rotation:i})),r!==this.#p){n?.(),this.#p=r,this.#l=is.pixelRatio;let t={div:null,properties:null,ctx:e.#O(this.#a)};for(let e of this.#_)t.properties=this.#v.get(e),t.div=e,this.#D(t)}}cancel(){let e=new Vo(`TextLayer task cancelled.`);this.#u?.cancel(e).catch(()=>{}),this.#u=null,this.#e.reject(e)}get textDivs(){return this.#_}get textContentItemsStr(){return this.#h}#T(t){if(this.#n)return;this.#o.ctx??=e.#O(this.#a);let n=this.#_,r=this.#h;for(let e of t){if(n.length>pl){Xe(`Ignoring additional textDivs for performance reasons.`),this.#n=!0;return}if(e.str===void 0){if(e.type===`beginMarkedContentProps`||e.type===`beginMarkedContent`){let t=this.#t;this.#t=document.createElement(`span`),this.#t.classList.add(`markedContent`),e.id&&this.#t.setAttribute(`id`,e.id),e.tag===`Artifact`&&(this.#t.ariaHidden=!0),t.append(this.#t)}else e.type===`endMarkedContent`&&(this.#t=this.#t.parentNode)}else r.push(e.str),this.#E(e)}}#E(t){let n=document.createElement(`span`),r={angle:0,canvasWidth:0,hasText:t.str!==``,hasEOL:t.hasEOL,fontSize:0};this.#_.push(n);let i=H.transform(this.#y,t.transform),a=Math.atan2(i[1],i[0]),o=this.#m[t.fontName];o.vertical&&(a+=Math.PI/2);let s=this.#r&&o.fontSubstitution||o.fontFamily;s=e.fontFamilyMap.get(s)||s;let c=Math.hypot(i[2],i[3]),l=c*e.#M(s,o,this.#a),u,d;a===0?(u=i[4],d=i[5]-l):(u=i[4]+l*Math.sin(a),d=i[5]-l*Math.cos(a));let f=n.style;f.left=`${(100*u/this.#c).toFixed(2)}%`,f.top=`${(100*d/this.#s).toFixed(2)}%`;let p=Math.round(c*100)/100;f.setProperty(`--font-height`,`${p}px`),f.fontFamily=s,r.fontSize=p,n.setAttribute(`role`,`presentation`),n.textContent=t.str,n.dir=t.dir,this.#r&&(n.dataset.fontName=o.fontSubstitutionLoadedName||t.fontName),a!==0&&(r.angle=180/Math.PI*a);let m=!1;if(t.str.length>1)m=!0;else if(t.str!==` `&&t.transform[0]!==t.transform[3]){let e=Math.abs(t.transform[0]),n=Math.abs(t.transform[3]);e!==n&&Math.max(e,n)/Math.min(e,n)>1.5&&(m=!0)}if(m&&(r.canvasWidth=o.vertical?t.height:t.width),this.#v.set(n,r),this.#o.div=n,this.#o.properties=r,this.#D(this.#o),r.hasText&&this.#t.append(n),r.hasEOL){let e=document.createElement(`br`);e.setAttribute(`role`,`presentation`),this.#t.append(e)}}#D(t){let{div:n,properties:r,ctx:i}=t,{style:a}=n,{canvasWidth:o,fontSize:s}=r;if(o!==0&&s!==0&&r.hasText){let{fontFamily:t}=a,r=this.#l,c=e.#k(s*this.#p/r)*r;e.#A(i,c,t);let{width:l}=i.measureText(n.textContent);l>0&&a.setProperty(`--scale-x`,o*c/(l*s))}r.angle!==0&&a.setProperty(`--rotate`,`${r.angle}deg`)}static cleanup(){if(!(this.#w.size>0)){this.#b.clear();for(let{canvas:e}of this.#x.values())e.remove();this.#x.clear()}}static#O(e=null){let t=this.#x.get(e||=``);if(!t){let n=document.createElement(`canvas`);n.style.cssText=`position:absolute;top:0;left:0;width:0;height:0;display:none;letter-spacing:normal;word-spacing:normal`,n.lang=e,document.body.append(n),t=n.getContext(`2d`,{alpha:!1,willReadFrequently:!0}),this.#x.set(e,t),this.#S.set(t,{size:0,family:``})}return t}static#k(e){e=Math.fround(e);let t=Math.fround(e*131073);return Math.fround(t-Math.fround(t-e))}static#A(e,t,n){let r=this.#S.get(e);(t!==r.size||n!==r.family)&&(e.font=`${t}px ${n}`,r.size=t,r.family=n)}static#j(){if(this.#C!==null)return;let e=document.createElement(`div`);e.style.opacity=0,e.style.lineHeight=1,e.style.fontSize=`1px`,e.style.position=`absolute`,e.textContent=`X`,document.body.append(e),this.#C=e.getBoundingClientRect().height,e.remove()}static#M(e,t,n){let r=this.#b.get(e);if(r)return r;let i=this.#O(n);this.#A(i,ml,e);let a=i.measureText(``),o=a.fontBoundingBoxAscent,s=Math.abs(a.fontBoundingBoxDescent),c=.8;return o?c=o/(o+s):(Ho.platform.isFirefox&&Xe("Enable the `dom.textMetrics.fontBoundingBox.enabled` preference in `about:config` to improve TextLayer rendering."),t.ascent?c=t.ascent:t.descent&&(c=1+t.descent)),this.#b.set(e,c),c}},gl=100,_l=class e{static#e=0;_capability=Promise.withResolvers();_setupCapability=Promise.withResolvers();_transport=null;_worker=null;docId=`d${e.#e++}`;destroyed=!1;onPassword=null;onProgress=null;get promise(){return this._capability.promise}async destroy(){this.destroyed=!0,this._capability.promise.catch(()=>{});try{this._worker?.port&&(this._worker._pendingDestroy=!0),await this._setupCapability.promise,await this._transport?.destroy()}catch(e){throw this._worker?.port&&delete this._worker._pendingDestroy,e}this._transport=null,this._worker?.destroy(),this._worker=null}async getData(){return this._transport.getData()}},vl=class{#e=Promise.withResolvers();#t=null;constructor(e,t,n=!1,r=null){this.length=e,this.initialData=t,this.progressiveDone=n,this.contentDispositionFilename=r}onDataRange(e,t){this.#t({type:`range`,begin:e,chunk:t})}onDataProgressiveRead(e){this.#e.promise.then(()=>{this.#t({type:`progressiveRead`,chunk:e})})}onDataProgressiveDone(){this.#e.promise.then(()=>{this.#t({type:`progressiveDone`})})}transportReady(e){this.#t=e,this.#e.resolve()}requestDataRange(e,t){Ze(`Abstract method PDFDataRangeTransport.requestDataRange`)}abort(){}},yl=class{constructor(e,t){this._pdfInfo=e,this._transport=t}get pagesMapper(){return this._transport.pagesMapper}get annotationStorage(){return this._transport.annotationStorage}get canvasFactory(){return this._transport.canvasFactory}get filterFactory(){return this._transport.filterFactory}get numPages(){return this._pdfInfo.numPages}get fingerprints(){return this._pdfInfo.fingerprints}get isPureXfa(){return V(this,`isPureXfa`,!!this._transport._htmlForXfa)}get allXfaHtml(){return this._transport._htmlForXfa}getPage(e){return this._transport.getPage(e)}getPageIndex(e){return this._transport.getPageIndex(e)}getDestinations(){return this._transport.getDestinations()}getDestination(e){return this._transport.getDestination(e)}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()}getAttachmentContent(e){return this._transport.getAttachmentContent(e)}getAnnotationsByType(e,t){return this._transport.getAnnotationsByType(e,t)}getJSActions(){return this._transport.getDocJSActions()}getOutline(){return this._transport.getOutline()}getOptionalContentConfig({intent:e=`display`}={}){let{renderingIntent:t}=this._transport.getRenderingIntent(e);return this._transport.getOptionalContentConfig(t)}getPermissions(){return this._transport.getPermissions()}getMetadata(){return this._transport.getMetadata()}getMarkInfo(){return this._transport.getMarkInfo()}getData(){return this._transport.getData()}saveDocument(e){return this._transport.saveDocument(e)}extractPages(e,t=null){return this._transport.extractPages(e,t)}getDownloadInfo(){return this._transport.downloadInfoCapability.promise}cleanup(e=!1){return this._transport.startCleanup(e||this.isPureXfa)}cachedPageNumber(e){return this._transport.cachedPageNumber(e)}get loadingParams(){return this._transport.loadingParams}get loadingTask(){return this._transport.loadingTask}getFieldObjects(){return this._transport.getFieldObjects()}getSignatures(){return this._transport.getSignatures()}getSignatureData(e){return this._transport.getSignatureData(e)}hasJSActions(){return this._transport.hasJSActions()}getCalculationOrderIds(){return this._transport.getCalculationOrderIds()}},bl=class e{#e=!1;#t=null;static#n=0;constructor(t,n,r,i,a=!1){this._pageIndex=t,this._id=e.#n++,this._pageInfo=n,this._transport=r,this._stats=a?new ns:null,this._pdfBug=a,this.commonObjs=r.commonObjs,this.objs=new fl,this._intentStates=new Map,this.destroyed=!1,this.recordedBBoxes=null,this.#t=i,this.imageCoordinates=null}clone(t){let n=new e(t,this._pageInfo,this._transport,this.#t,this._pdfBug);return n.clonedFromIndex=this.clonedFromIndex??this._pageIndex,this._transport.updatePage(n),n}get pageNumber(){return this._pageIndex+1}set pageNumber(e){this._pageIndex=e-1,this._transport.updatePage(this)}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:e,rotation:t=this.rotate,offsetX:n=0,offsetY:r=0,dontFlip:i=!1}={}){return new Yo({viewBox:this.view,userUnit:this.userUnit,scale:e,rotation:t,offsetX:n,offsetY:r,dontFlip:i})}getAnnotations({intent:e=`display`}={}){let{renderingIntent:t}=this._transport.getRenderingIntent(e);return this._transport.getAnnotations(this._pageIndex,t)}getJSActions(){return this._transport.getPageJSActions(this._pageIndex)}get filterFactory(){return this._transport.filterFactory}get isPureXfa(){return V(this,`isPureXfa`,!!this._transport._htmlForXfa)}async getXfa(){return this._transport._htmlForXfa?.children[this._pageIndex]||null}render({canvasContext:e,canvas:t=e.canvas,viewport:n,intent:r=`display`,annotationMode:i=bo.ENABLE,transform:a=null,background:o=null,optionalContentConfigPromise:s=null,annotationCanvasMap:c=null,pageColors:l=null,printAnnotationStorage:u=null,isEditing:d=!1,recordImages:f=!1,recordOperations:p=!1,operationsFilter:m=null}){this._stats?.time(`Overall`);let h=this._transport.getRenderingIntent(r,i,u,d),{renderingIntent:g,cacheKey:_}=h;this.#e=!1,s||=this._transport.getOptionalContentConfig(g);let v=this._intentStates.getOrInsertComputed(_,qo);v.streamReaderCancelTimeout&&=(clearTimeout(v.streamReaderCancelTimeout),null);let y=!!(g&yo.PRINT);v.displayReadyCapability||(v.displayReadyCapability=Promise.withResolvers(),v.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},this._stats?.time(`Page Request`),this._pumpOperatorList(h));let b=!!(this._pdfBug&&globalThis.StepperManager?.enabled),x=!!t&&!this.recordedBBoxes&&(p||b),S=!!t&&!this.imageCoordinates&&f,C=e=>{if(v.renderTasks.delete(E),x){let e=E.gfx?.dependencyTracker.take();e&&(E.stepper?.setOperatorBBoxes(e,E.gfx.dependencyTracker.takeDebugMetadata()),p&&(this.recordedBBoxes=e))}S&&!e&&(this.imageCoordinates=E.gfx?.imagesTracker.take()),y&&(this.#e=!0),this.#r(),e?(E.capability.reject(e),this._abortOperatorList({intentState:v,reason:e instanceof Error?e:Error(e)})):E.capability.resolve(),this._stats&&(this._stats.timeEnd(`Rendering`),this._stats.timeEnd(`Overall`),globalThis.Stats?.enabled&&globalThis.Stats.add(this.pageNumber,this._stats))},w=null,T=null;(x||S)&&(T=new Rs(t,v.operatorList.length)),x&&(w=new zs(T,b));let E=new wl({callback:C,params:{canvas:t,canvasContext:e,dependencyTracker:w??T,imagesTracker:S?new Hs(t):null,viewport:n,transform:a,background:o},objs:this.objs,commonObjs:this.commonObjs,annotationCanvasMap:c,operatorList:v.operatorList,pageIndex:this._pageIndex,canvasFactory:this._transport.canvasFactory,filterFactory:this._transport.filterFactory,useRequestAnimationFrame:!y,pdfBug:this._pdfBug,pageColors:l,enableHWA:this._transport.enableHWA,operationsFilter:m});(v.renderTasks||=new Set).add(E);let D=E.task;return Promise.all([v.displayReadyCapability.promise,s]).then(([e,t])=>{if(this.destroyed)C();else{if(this._stats?.time(`Rendering`),!(t.renderingIntent&g))throw Error("Must use the same `intent`-argument when calling the `PDFPageProxy.render` and `PDFDocumentProxy.getOptionalContentConfig` methods.");E.initializeGraphics({transparency:e,optionalContentConfig:t}),E.operatorListChanged()}}).catch(C),D}getOperatorList({intent:e=`display`,annotationMode:t=bo.ENABLE,printAnnotationStorage:n=null,isEditing:r=!1}={}){function i(){o.operatorList.lastChunk&&(o.opListReadCapability.resolve(o.operatorList),o.renderTasks.delete(s))}let a=this._transport.getRenderingIntent(e,t,n,r,!0),o=this._intentStates.getOrInsertComputed(a.cacheKey,qo),s;return o.opListReadCapability||(s=Object.create(null),s.operatorListChanged=i,o.opListReadCapability=Promise.withResolvers(),(o.renderTasks||=new Set).add(s),o.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},this._stats?.time(`Page Request`),this._pumpOperatorList(a)),o.opListReadCapability.promise}streamTextContent({includeMarkedContent:e=!1,disableNormalization:t=!1}={}){return this._transport.messageHandler.sendWithStream(`GetTextContent`,{pageId:this.#t.getPageId(this._pageIndex+1)-1,pageIndex:this._pageIndex,includeMarkedContent:e===!0,disableNormalization:t===!0},{highWaterMark:100,size:e=>e.items.length})}async getTextContent(e={}){if(this._transport._htmlForXfa)return this.getXfa().then(e=>Xo.textContent(e));let t=this.streamTextContent(e),n={items:[],styles:Object.create(null),lang:null};for await(let e of t)n.lang??=e.lang,Object.assign(n.styles,e.styles),n.items.push(...e.items);return n}getStructTree(){return this._transport.getStructTree(this._pageIndex)}_destroy(){this.destroyed=!0;let e=[];for(let t of this._intentStates.values())if(this._abortOperatorList({intentState:t,reason:Error(`Page was destroyed.`),force:!0}),!t.opListReadCapability)for(let n of t.renderTasks)e.push(n.completed),n.cancel();return this.objs.clear(),this.#e=!1,Promise.all(e)}cleanup(e=!1){this.#e=!0;let t=this.#r();return e&&t&&(this._stats&&=new ns),t}#r(){if(!this.#e||this.destroyed)return!1;for(let{renderTasks:e,operatorList:t}of this._intentStates.values())if(e.size>0||!t.lastChunk)return!1;return this._intentStates.clear(),this.objs.clear(),this.#e=!1,!0}_startRenderPage(e,t){let n=this._intentStates.get(t);n&&(this._stats?.timeEnd(`Page Request`),n.displayReadyCapability?.resolve(e))}_renderPageChunk(e,t){for(let n=0,r=e.length;n<r;n++)t.operatorList.fnArray.push(e.fnArray[n]),t.operatorList.argsArray.push(e.argsArray[n]);t.operatorList.lastChunk=e.lastChunk,t.operatorList.separateAnnots=e.separateAnnots;for(let e of t.renderTasks)e.operatorListChanged();e.lastChunk&&this.#r()}_pumpOperatorList({renderingIntent:e,cacheKey:t,annotationStorageSerializable:n,modifiedIds:r}){let{map:i,transfer:a}=n,o=this._transport.messageHandler.sendWithStream(`GetOperatorList`,{pageId:this.#t.getPageId(this._pageIndex+1)-1,pageIndex:this._pageIndex,pageProxyId:this._id,intent:e,cacheKey:t,annotationStorage:i,modifiedIds:r},void 0,a).getReader(),s=this._intentStates.get(t);s.streamReader=o;let c=()=>{o.read().then(({value:e,done:t})=>{t?s.streamReader=null:this._transport.destroyed||(this._renderPageChunk(e,s),c())},e=>{if(s.streamReader=null,!this._transport.destroyed){if(s.operatorList){s.operatorList.lastChunk=!0;for(let e of s.renderTasks)e.operatorListChanged();this.#r()}if(s.displayReadyCapability)s.displayReadyCapability.reject(e);else if(s.opListReadCapability)s.opListReadCapability.reject(e);else throw e}})};c()}_abortOperatorList({intentState:e,reason:t,force:n=!1}){if(e.streamReader){if(e.streamReaderCancelTimeout&&=(clearTimeout(e.streamReaderCancelTimeout),null),!n){if(e.renderTasks.size>0)return;if(t instanceof ts){let n=gl;t.extraDelay>0&&t.extraDelay<1e3&&(n+=t.extraDelay),e.streamReaderCancelTimeout=setTimeout(()=>{e.streamReaderCancelTimeout=null,this._abortOperatorList({intentState:e,reason:t,force:!0})},n);return}}if(e.streamReader.cancel(new Vo(t.message)).catch(()=>{}),e.streamReader=null,!this._transport.destroyed){for(let[t,n]of this._intentStates)if(n===e){this._intentStates.delete(t);break}this.cleanup()}}}get stats(){return this._stats}},xl=class e{#e=Promise.withResolvers();#t=null;#n=null;#r=null;static#i=0;static#a=!1;static#o=new WeakMap;static{mo&&(this.#a=!0,il.workerSrc||=`./pdf.worker.mjs`),this._isSameOrigin=(e,t)=>{let n=URL.parse(e);if(!n?.origin||n.origin===`null`)return!1;let r=new URL(t,n);return n.origin===r.origin},this._createCDNWrapper=e=>{let t=`await import("${e}");`;return URL.createObjectURL(new Blob([t],{type:`text/javascript`}))}}constructor({name:t=null,port:n=null,verbosity:r=Je()}={}){if(this.name=t,this.destroyed=!1,this.verbosity=r,n){if(e.#o.has(n))throw Error(`Cannot use more than one PDFWorker per port.`);e.#o.set(n,this),this.#c(n)}else this.#l()}get promise(){return this.#e.promise}#s(){this.#e.resolve(),this.#t.send(`configure`,{verbosity:this.verbosity})}get port(){return this.#n}get messageHandler(){return this.#t}#c(e){this.#n=e,this.#t=new cc(`main`,`worker`,e),this.#t.on(`ready`,()=>{}),this.#s()}#l(){if(e.#a||e.#d){this.#u();return}let{workerSrc:t}=e;try{e._isSameOrigin(window.location,t)||(t=e._createCDNWrapper(new URL(t,window.location).href));let n=new Worker(t,{type:`module`}),r=new cc(`main`,`worker`,n),i=()=>{a.abort(),r.destroy(),n.terminate(),this.destroyed?this.#e.reject(Error(`Worker was destroyed`)):this.#u()},a=new AbortController;n.addEventListener(`error`,()=>{this.#r||i()},{signal:a.signal}),r.on(`ready`,e=>{a.abort(),this.destroyed||!(e instanceof Uint8Array)?i():(this.#t=r,this.#n=n,this.#r=n,this.#s())})}catch{Ye(`The worker has been disabled.`),this.#u()}}#u(){e.#a||=(Xe(`Setting up fake worker.`),!0),e._setupFakeWorkerGlobal.then(t=>{if(this.destroyed){this.#e.reject(Error(`Worker was destroyed`));return}let n=new ac;this.#n=n;let r=`fake${e.#i++}`,i=new cc(r+`_worker`,r,n);t.setup(i,n),this.#t=new cc(r,r+`_worker`,n),this.#s()}).catch(e=>{this.#e.reject(Error(`Setting up fake worker failed: "${e.message}".`))})}destroy(){this.destroyed=!0,this.#r?.terminate(),this.#r=null,e.#o.delete(this.#n),this.#n=null,this.#t?.destroy(),this.#t=null}static create(t){let n=this.#o.get(t?.port);if(n){if(n._pendingDestroy)throw Error("PDFWorker.create - the worker is being destroyed.\nPlease remember to await `PDFDocumentLoadingTask.destroy()`-calls.");return n}return new e(t)}static get workerSrc(){if(il.workerSrc)return il.workerSrc;throw Error(`No "GlobalWorkerOptions.workerSrc" specified.`)}static get#d(){try{return globalThis.pdfjsWorker?.WorkerMessageHandler||null}catch{return null}}static get _setupFakeWorkerGlobal(){return V(this,`_setupFakeWorkerGlobal`,(async()=>this.#d?this.#d:(await import(this.workerSrc)).WorkerMessageHandler)())}},Sl=class{downloadInfoCapability=Promise.withResolvers();#e=null;#t=new Map;#n=null;#r=new Map;#i=new Map;#a=new Map;#o=null;#s=null;constructor(e,t,n,r,i,a){this.messageHandler=e,this.loadingTask=t,this.#n=n,this.commonObjs=new fl,this.fontLoader=new Ws({ownerDocument:r.ownerDocument,styleElement:r.styleElement}),this.enableHWA=r.enableHWA,this.loadingParams=r.loadingParams,this._params=r,this.canvasFactory=i.canvasFactory,this.filterFactory=i.filterFactory,this.binaryDataFactory=i.binaryDataFactory,this.pagesMapper=a,this.destroyed=!1,this.destroyCapability=null,this.setupMessageHandler()}updatePage(e){this.#r.set(e._id,e),this.#i.set(e._pageIndex,Promise.resolve(e))}#c(e,t=null){return this.#t.getOrInsertComputed(e,()=>this.messageHandler.sendWithPromise(e,t))}#l({loaded:e,total:t}){this.loadingTask.onProgress?.({loaded:e,total:t,percent:t?lt(Math.round(e/t*100),0,100):NaN})}get annotationStorage(){return V(this,`annotationStorage`,new As)}getRenderingIntent(e,t=bo.ENABLE,n=null,r=!1,i=!1){let a=yo.DISPLAY,o=ks;switch(e){case`any`:a=yo.ANY;break;case`display`:break;case`print`:a=yo.PRINT;break;default:Xe(`getRenderingIntent - invalid intent: ${e}`)}let s=a&yo.PRINT&&n instanceof js?n:this.annotationStorage;switch(t){case bo.DISABLE:a+=yo.ANNOTATIONS_DISABLE;break;case bo.ENABLE:break;case bo.ENABLE_FORMS:a+=yo.ANNOTATIONS_FORMS;break;case bo.ENABLE_STORAGE:a+=yo.ANNOTATIONS_STORAGE,o=s.serializable;break;default:Xe(`getRenderingIntent - invalid annotationMode: ${t}`)}r&&(a+=yo.IS_EDITING),i&&(a+=yo.OPLIST);let{ids:c,hash:l}=s.modifiedIds,u=[a,o.hash,l];return{renderingIntent:a,cacheKey:u.join(`_`),annotationStorageSerializable:o,modifiedIds:c}}destroy(){if(this.destroyCapability)return this.destroyCapability.promise;this.destroyed=!0,this.destroyCapability=Promise.withResolvers(),this.#o?.reject(Error(`Worker was destroyed during onPassword callback`));let e=[];for(let t of this.#r.values())e.push(t._destroy());this.#r.clear(),this.#i.clear(),this.#a.clear(),Object.hasOwn(this,`annotationStorage`)&&this.annotationStorage.resetModified();let t=this.messageHandler.sendWithPromise(`Terminate`,null);return e.push(t),Promise.all(e).then(()=>{this.commonObjs.clear(),this.fontLoader.clear(),this.#t.clear(),this.filterFactory.destroy(),hl.cleanup(),this.#n?.cancelAllRequests(new Vo(`Worker was terminated.`)),this.messageHandler?.destroy(),this.messageHandler=null,this.destroyCapability.resolve()},this.destroyCapability.reject),this.destroyCapability.promise}setupMessageHandler(){let{messageHandler:e,loadingTask:t}=this;e.on(`GetReader`,(e,t)=>{Qe(this.#n,"GetReader - no `BasePDFStream` instance available."),this.#e=this.#n.getFullReader(),this.#e.onProgress=e=>this.#l(e),t.onPull=()=>{this.#e.read().then(function({value:e,done:n}){n?t.close():(Qe(e instanceof ArrayBuffer,`GetReader - expected an ArrayBuffer.`),t.enqueue(new Uint8Array(e),1,[e]))}).catch(e=>{t.error(e)})},t.onCancel=e=>{this.#e.cancel(e),t.ready.catch(e=>{if(!this.destroyed)throw e})}}),e.on(`ReaderHeadersReady`,async e=>{await this.#e.headersReady;let{isStreamingSupported:t,isRangeSupported:n,contentLength:r}=this.#e;return t&&n&&(this.#e.onProgress=null),{isStreamingSupported:t,isRangeSupported:n,contentLength:r}}),e.on(`GetRangeReader`,(e,t)=>{Qe(this.#n,"GetRangeReader - no `BasePDFStream` instance available.");let n=this.#n.getRangeReader(e.begin,e.end);n?(t.onPull=()=>{n.read().then(function({value:e,done:n}){n?t.close():(Qe(e instanceof ArrayBuffer,`GetRangeReader - expected an ArrayBuffer.`),t.enqueue(new Uint8Array(e),1,[e]))}).catch(e=>{t.error(e)})},t.onCancel=e=>{n.cancel(e),t.ready.catch(e=>{if(!this.destroyed)throw e})}):t.close()}),e.on(`GetDoc`,({pdfInfo:e})=>{this.pagesMapper.pagesNumber=e.numPages,this._numPages=e.numPages,this._htmlForXfa=e.htmlForXfa,delete e.htmlForXfa,t._capability.resolve(new yl(e,this))}),e.on(`DocException`,e=>{t._capability.reject(Wt(e))}),e.on(`PasswordRequest`,e=>{this.#o=Promise.withResolvers();try{if(!t.onPassword)throw Wt(e);t.onPassword(e=>{e instanceof Error?this.#o.reject(e):this.#o.resolve({password:e})},e.code)}catch(e){this.#o.reject(e)}return this.#o.promise}),e.on(`DataLoaded`,e=>{this.#l({loaded:e.length,total:e.length}),this.downloadInfoCapability.resolve(e)}),e.on(`StartRenderPage`,e=>{this.destroyed||this.#r.get(e.pageProxyId)._startRenderPage(e.transparency,e.cacheKey)}),e.on(`commonobj`,([t,n,r])=>{if(this.destroyed||this.commonObjs.has(t))return null;switch(n){case`Font`:if(`error`in r){let e=r.error;Xe(`Error during font loading: ${e}`),this.commonObjs.resolve(t,e);break}let i=new $s(r.buffer),a=this._params.pdfBug&&globalThis.FontInspector?.enabled?(e,t)=>globalThis.FontInspector.fontAdded(e,t):null,o=new Gs(i,a,r.charProcOperatorList,r.extra);this.fontLoader.bind(o).catch(()=>e.sendWithPromise(`FontFallback`,{id:t})).finally(()=>{o.fontExtraProperties||o.clearData(),this.commonObjs.resolve(t,o)});break;case`CopyLocalImage`:let{imageRef:s}=r;Qe(s,`The imageRef must be defined.`);for(let e of this.#r.values())for(let[,n]of e.objs){if(n?.ref!==s)continue;if(!n.dataLen)return null;let e=structuredClone(n);return this.commonObjs.resolve(t,e),n.dataLen}break;case`FontPath`:this.commonObjs.resolve(t,new tc(r));break;case`Image`:this.commonObjs.resolve(t,r);break;case`Pattern`:let c=new ec(r);this.commonObjs.resolve(t,c.getIR());break;default:throw Error(`Got unknown common object type ${n}`)}return null}),e.on(`obj`,([e,t,n,r])=>{if(this.destroyed)return;let i=this.#r.get(t);if(!i.objs.has(e)){if(i._intentStates.size===0)r?.bitmap?.close();else switch(n){case`Image`:case`Pattern`:i.objs.resolve(e,r);break;default:throw Error(`Got unknown object type ${n}`)}}}),e.on(`DocProgress`,e=>{this.destroyed||this.#l(e)}),e.on(`FetchBinaryData`,async e=>{if(this.destroyed)throw Error(`Worker was destroyed.`);if(!this.binaryDataFactory)throw Error("`BinaryDataFactory` not initialized, see the `useWorkerFetch` parameter.");return this.binaryDataFactory.fetch(e)})}getData(){return this.messageHandler.sendWithPromise(`GetData`,null)}saveDocument(e=null){this.annotationStorage.size<=0&&Xe("saveDocument called while `annotationStorage` is empty, please use the getData-method instead.");let{map:t,transfer:n}=this.annotationStorage.serializable;return this.messageHandler.sendWithPromise(`SaveDocument`,{isPureXfa:!!this._htmlForXfa,numPages:this._numPages,annotationStorage:t,supportsPrintToPDF:this.#s!==null,filename:this.#e?.filename??null},n).finally(()=>{this.#s=null,this.annotationStorage.resetModified()})}extractPages(e,t=null){let n={pageInfos:e},r,i=globalThis.ImageBitmap;if(typeof i==`function`){let t=Array.isArray(e)?e:[e];for(let e of t)e?.image instanceof i&&(r||=[]).push(e.image)}if(this.annotationStorage.size>0){let e=this.annotationStorage.serializable,{map:i}=e;e.transfer?.length&&(r?r.push(...e.transfer):r=e.transfer);let a=this.pagesMapper.getMapping();if(a){let e=new Map;for(let[n,r]of i){if(r?.pageIndex!==void 0&&r.pageIndex>=0&&r.pageIndex<a.length){let i=t?.[r.pageIndex]??0,o=a[r.pageIndex]-1;if(o!==r.pageIndex||i!==0){e.set(n,{...r,pageIndex:o,copyLevel:i});continue}}e.set(n,r)}i=e}n.annotationStorage=i}return this.messageHandler.sendWithPromise(`ExtractPages`,n,r).finally(()=>{this.annotationStorage.resetModified()})}getPage(e){if(!Number.isInteger(e)||e<=0||e>this.pagesMapper.pagesNumber)return Promise.reject(Error(`Invalid page request.`));let t=e-1,n=this.pagesMapper.getPageId(e)-1,r=this.#i.get(t);if(r)return r;let i=this.messageHandler.sendWithPromise(`GetPage`,{pageIndex:n}).then(e=>{if(this.destroyed)throw Error(`Transport destroyed`);e.refStr&&this.#a.set(e.refStr,n);let r=new bl(t,e,this,this.pagesMapper,this._params.pdfBug);return this.#r.set(r._id,r),r});return this.#i.set(t,i),i}async getPageIndex(e){if(!nc(e))throw Error(`Invalid pageIndex request.`);let t=await this.messageHandler.sendWithPromise(`GetPageIndex`,{num:e.num,gen:e.gen}),n=this.pagesMapper.getPageNumber(t+1);if(n===0)throw Error(`GetPageIndex: page has been removed.`);return n-1}getAnnotations(e,t){return this.messageHandler.sendWithPromise(`GetAnnotations`,{pageIndex:this.pagesMapper.getPageId(e+1)-1,intent:t})}getFieldObjects(){return this.#c(`GetFieldObjects`)}getSignatures(){return this.#c(`GetSignatures`)}getSignatureData(e){return this.messageHandler.sendWithPromise(`GetSignatureData`,e)}hasJSActions(){return this.#c(`HasJSActions`)}getCalculationOrderIds(){return this.messageHandler.sendWithPromise(`GetCalculationOrderIds`,null)}getDestinations(){return this.messageHandler.sendWithPromise(`GetDestinations`,null)}getDestination(e){return typeof e==`string`?this.messageHandler.sendWithPromise(`GetDestination`,{id:e}):Promise.reject(Error(`Invalid destination request.`))}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)}getAttachmentContent(e){return this.messageHandler.sendWithPromise(`GetAttachmentContent`,e)}getAnnotationsByType(e,t){return this.messageHandler.sendWithPromise(`GetAnnotationsByType`,{types:e,pageIndexesToSkip:t})}getDocJSActions(){return this.#c(`GetDocJSActions`)}getPageJSActions(e){return this.messageHandler.sendWithPromise(`GetPageJSActions`,{pageIndex:this.pagesMapper.getPageId(e+1)-1})}getStructTree(e){return this.messageHandler.sendWithPromise(`GetStructTree`,{pageIndex:this.pagesMapper.getPageId(e+1)-1})}getOutline(){return this.messageHandler.sendWithPromise(`GetOutline`,null)}getOptionalContentConfig(e){return this.#c(`GetOptionalContentConfig`).then(t=>new cl(t,e))}getPermissions(){return this.messageHandler.sendWithPromise(`GetPermissions`,null)}getMetadata(){let e=`GetMetadata`;return this.#t.getOrInsertComputed(e,()=>this.messageHandler.sendWithPromise(e,null).then(e=>({info:e[0],metadata:e[1]?new al(e[1]):null,contentDispositionFilename:this.#e?.filename??null,contentLength:this.#e?.contentLength??null,hasStructTree:e[2]})))}getMarkInfo(){return this.messageHandler.sendWithPromise(`GetMarkInfo`,null)}async startCleanup(e=!1){if(!this.destroyed){await this.messageHandler.sendWithPromise(`Cleanup`,null);for(let e of this.#r.values())if(!e.cleanup())throw Error(`startCleanup: Page ${e.pageNumber} is currently rendering.`);this.commonObjs.clear(),e||this.fontLoader.clear(),this.#t.clear(),this.filterFactory.destroy(!0),hl.cleanup()}}cachedPageNumber(e){if(!nc(e))return null;let t=e.gen===0?`${e.num}R`:`${e.num}R${e.gen}`,n=this.#a.get(t);if(n>=0){let e=this.pagesMapper.getPageNumber(n+1);if(e!==0)return e}return null}},Cl=class{_internalRenderTask=null;onContinue=null;onError=null;constructor(e){this._internalRenderTask=e}get promise(){return this._internalRenderTask.capability.promise}cancel(e=0){this._internalRenderTask.cancel(null,e)}get separateAnnots(){let{separateAnnots:e}=this._internalRenderTask.operatorList;if(!e)return!1;let{annotationCanvasMap:t}=this._internalRenderTask;return e.form||e.canvas&&t?.size>0}get imageCoordinates(){return this._internalRenderTask.imageCoordinates||null}},wl=class e{#e=null;static#t=new WeakSet;constructor({callback:e,params:t,objs:n,commonObjs:r,annotationCanvasMap:i,operatorList:a,pageIndex:o,canvasFactory:s,filterFactory:c,useRequestAnimationFrame:l=!1,pdfBug:u=!1,pageColors:d=null,enableHWA:f=!1,operationsFilter:p=null}){this.callback=e,this.params=t,this.objs=n,this.commonObjs=r,this.annotationCanvasMap=i,this.operatorListIdx=null,this.operatorList=a,this._pageIndex=o,this.canvasFactory=s,this.filterFactory=c,this._pdfBug=u,this.pageColors=d,this.running=!1,this.graphicsReadyCallback=null,this.graphicsReady=!1,this._useRequestAnimationFrame=l===!0&&typeof window<`u`,this.cancelled=!1,this.capability=Promise.withResolvers(),this.task=new Cl(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=t.canvas,this._canvasContext=t.canvas?null:t.canvasContext,this._enableHWA=f,this._dependencyTracker=t.dependencyTracker,this._imagesTracker=t.imagesTracker,this._operationsFilter=p}get completed(){return this.capability.promise.catch(()=>{})}initializeGraphics({transparency:t=!1,optionalContentConfig:n}){if(this.cancelled)return;if(this._canvas){if(e.#t.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.`);e.#t.add(this._canvas)}this._pdfBug&&globalThis.StepperManager?.enabled&&(this.stepper=globalThis.StepperManager.create(this._pageIndex),this.stepper.init(this.operatorList),this.stepper.nextBreakPoint=this.stepper.getNextBreakPoint());let{viewport:r,transform:i,background:a,dependencyTracker:o,imagesTracker:s}=this.params,c=this._canvasContext||this._canvas.getContext(`2d`,{alpha:!1,willReadFrequently:!this._enableHWA});this.gfx=new Bc(c,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:n},this.annotationCanvasMap,this.pageColors,o,s),this.gfx.beginDrawing({transform:i,viewport:r,transparency:t,background:a}),this.operatorListIdx=0,this.graphicsReady=!0,this.graphicsReadyCallback?.()}cancel(t=null,n=0){this.running=!1,this.cancelled=!0,this.gfx?.endDrawing(),this.#e&&=(window.cancelAnimationFrame(this.#e),null),e.#t.delete(this._canvas),t||=new ts(`Rendering cancelled, page ${this._pageIndex+1}`,n),this.callback(t),this.task.onError?.(t)}operatorListChanged(){this.graphicsReady?(this.gfx.dependencyTracker?.growOperationsCount(this.operatorList.fnArray.length),this.stepper?.updateOperatorList(this.operatorList),!this.running&&this._continue()):this.graphicsReadyCallback||=this._continueBound}_continue(){this.running=!0,!this.cancelled&&(this.task.onContinue?this.task.onContinue(this._scheduleNextBound):this._scheduleNext())}_scheduleNext(){this._useRequestAnimationFrame?this.#e=window.requestAnimationFrame(()=>{this.#e=null,this._nextBound().catch(this._cancelBound)}):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._operationsFilter),this.operatorListIdx===this.operatorList.argsArray.length&&(this.running=!1,this.operatorList.lastChunk&&(this.gfx.endDrawing(),e.#t.delete(this._canvas),this.callback())))}},Tl=`6.4.299`,El=`d0991a0d5`,Ja(),Dl=class e{#e=null;#t=null;#n;#r=null;#i=!1;#a=!1;#o=null;#s;#c=null;#l=null;static#u=null;static get _keyboardManager(){return V(this,`_keyboardManager`,new gs([[[`Escape`],e.prototype._hideDropdownFromKeyboard],[[`Space`],e.prototype._colorSelectFromKeyboard],[[`ArrowDown`,`ArrowRight`],e.prototype._moveToNext],[[`ArrowUp`,`ArrowLeft`],e.prototype._moveToPrevious],[[`Home`],e.prototype._moveToBeginning],[[`End`],e.prototype._moveToEnd]]))}constructor({editor:t=null,uiManager:n=null}){t?(this.#a=!1,this.#o=t):this.#a=!0,this.#l=t?._uiManager||n,this.#s=this.#l._eventBus,this.#n=t?.color?.toUpperCase()||this.#l?.highlightColors.values().next().value||`#FFFF98`,e.#u||=Object.freeze({blue:`pdfjs-editor-colorpicker-blue`,green:`pdfjs-editor-colorpicker-green`,pink:`pdfjs-editor-colorpicker-pink`,red:`pdfjs-editor-colorpicker-red`,yellow:`pdfjs-editor-colorpicker-yellow`})}renderButton(){let e=this.#e=document.createElement(`button`);e.className=`colorPicker`,e.tabIndex=`0`,e.setAttribute(`data-l10n-id`,`pdfjs-editor-colorpicker-button`),e.ariaHasPopup=`true`,this.#o&&(e.ariaControls=`${this.#o.id}_colorpicker_dropdown`);let t=this.#l._signal;e.addEventListener(`click`,this.#m.bind(this),{signal:t}),e.addEventListener(`keydown`,this.#p.bind(this),{signal:t});let n=this.#t=document.createElement(`span`);return n.className=`swatch`,n.ariaHidden=`true`,n.style.backgroundColor=this.#n,e.append(n),e}renderMainDropdown(){let e=this.#r=this.#d();return e.ariaOrientation=`horizontal`,e.ariaLabelledBy=`highlightColorPickerLabel`,e}#d(){let t=document.createElement(`div`),n=this.#l._signal;t.addEventListener(`contextmenu`,gt,{signal:n}),t.className=`dropdown`,t.role=`listbox`,t.ariaMultiSelectable=`false`,t.ariaOrientation=`vertical`,t.setAttribute(`data-l10n-id`,`pdfjs-editor-colorpicker-dropdown`),this.#o&&(t.id=`${this.#o.id}_colorpicker_dropdown`);for(let[r,i]of this.#l.highlightColors){let a=document.createElement(`button`);a.tabIndex=`0`,a.role=`option`,a.setAttribute(`data-color`,i),a.title=r,a.setAttribute(`data-l10n-id`,e.#u[r]);let o=document.createElement(`span`);a.append(o),o.className=`swatch`,o.style.backgroundColor=i,a.ariaSelected=i===this.#n,a.addEventListener(`click`,this.#f.bind(this,i),{signal:n}),t.append(a)}return t.addEventListener(`keydown`,this.#p.bind(this),{signal:n}),t}#f(e,t){t.stopPropagation(),this.#s.dispatch(`switchannotationeditorparams`,{source:this,type:wo.HIGHLIGHT_COLOR,value:e}),this.update(e)}_colorSelectFromKeyboard(e){if(e.target===this.#e){this.#m(e);return}let t=e.target.getAttribute(`data-color`);t&&this.#f(t,e)}_moveToNext(e){this.#g?e.target===this.#e?this.#r.firstElementChild?.focus():e.target.nextSibling?.focus():this.#m(e)}_moveToPrevious(e){e.target===this.#r?.firstElementChild||e.target===this.#e?this.#g&&this._hideDropdownFromKeyboard():(this.#g||this.#m(e),e.target.previousSibling?.focus())}_moveToBeginning(e){this.#g?this.#r.firstElementChild?.focus():this.#m(e)}_moveToEnd(e){this.#g?this.#r.lastElementChild?.focus():this.#m(e)}#p(t){e._keyboardManager.exec(this,t)}#m(e){if(this.#g){this.hideDropdown();return}if(this.#i=e.detail===0,this.#c||(this.#c=new AbortController,window.addEventListener(`pointerdown`,this.#h.bind(this),{signal:this.#l.combinedSignal(this.#c)})),this.#e.ariaExpanded=`true`,this.#r){this.#r.classList.remove(`hidden`);return}let t=this.#r=this.#d();this.#e.append(t)}#h(e){this.#r?.contains(e.target)||this.hideDropdown()}hideDropdown(){this.#r?.classList.add(`hidden`),this.#e.ariaExpanded=`false`,this.#c?.abort(),this.#c=null}get#g(){return this.#r&&!this.#r.classList.contains(`hidden`)}_hideDropdownFromKeyboard(){this.#a||(this.#g?(this.hideDropdown(),this.#e.focus({preventScroll:!0,focusVisible:this.#i})):this.#o?.unselect())}update(e){if(this.#t&&(this.#t.style.backgroundColor=e),!this.#r)return;let t=this.#l.highlightColors.values();for(let n of this.#r.children)n.ariaSelected=t.next().value===e.toUpperCase()}destroy(){this.#e?.remove(),this.#e=null,this.#t=null,this.#r?.remove(),this.#r=null}},Ol=class e{#e=null;#t=!1;#n=null;#r=null;static#i=null;constructor(t){this.#n=t,this.#r=t._uiManager,e.#i||=Object.freeze({freetext:`pdfjs-editor-color-picker-free-text-input`,ink:`pdfjs-editor-color-picker-ink-input`})}renderButton(){if(this.#e)return this.#e;let{editorType:t,colorType:n,colorAndOpacityType:r,opacityType:i,color:a,opacity:o}=this.#n,s=this.#t=Ho.isAlphaColorInputSupported&&i!==void 0,c=this.#e=document.createElement(`input`);if(c.type=`color`,s){c.setAttribute(`alpha`,``);let e=H.hexNums[Math.round((o??1)*255)];c.value=(a||`#000000`)+e}else c.value=a||`#000000`;return c.className=`basicColorPicker`,c.tabIndex=0,c.setAttribute(`data-l10n-id`,e.#i[t]),c.addEventListener(`input`,()=>{if(s){let e=vt(c.value);if(!e)return;let[t,a,o,s]=e,l=H.makeHexColor(t,a,o);r===void 0?(this.#r.updateParams(n,l),this.#r.updateParams(i,s)):this.#r.updateParams(r,{color:l,opacity:s})}else this.#r.updateParams(n,c.value)},{signal:this.#r._signal}),c}update(e){if(this.#e){if(this.#t){let t=H.hexNums[Math.round(this.#n.opacity*255)];this.#e.value=e+t}else this.#e.value=e}}updateOpacity(e){if(!this.#e||!this.#t)return;let t=H.hexNums[Math.round(e*255)];this.#e.value=this.#n.color+t}destroy(){this.#e?.remove(),this.#e=null}hideDropdown(){}},Ra(),kl=class{static CMYK_G([e,t,n,r]){return[`G`,1-Math.min(1,.3*e+.59*n+.11*t+r)]}static G_CMYK([e]){return[`CMYK`,0,0,0,1-e]}static G_RGB([e]){return[`RGB`,e,e,e]}static G_rgb([e]){return e=On(e),[e,e,e]}static G_HTML([e]){let t=Dn(e);return`#${t}${t}${t}`}static RGB_G([e,t,n]){return[`G`,.3*e+.59*t+.11*n]}static RGB_rgb(e){return e.map(On)}static RGB_HTML(e){return`#${e.map(Dn).join(``)}`}static T_HTML(){return`#00000000`}static T_rgb(){return[null]}static CMYK_RGB([e,t,n,r]){return[`RGB`,1-Math.min(1,e+r),1-Math.min(1,n+r),1-Math.min(1,t+r)]}static CMYK_rgb([e,t,n,r]){return[On(1-Math.min(1,e+r)),On(1-Math.min(1,n+r)),On(1-Math.min(1,t+r))]}static CMYK_HTML(e){let t=this.CMYK_RGB(e).slice(1);return this.RGB_HTML(t)}static RGB_CMYK([e,t,n]){let r=1-e,i=1-t,a=1-n;return[`CMYK`,r,i,a,Math.min(r,i,a)]}},Al=class{create(e,t,n=!1){if(e<=0||t<=0)throw Error(`Invalid SVG dimensions`);let r=this._createSVG(`svg:svg`);return r.setAttribute(`version`,`1.1`),n||(r.setAttribute(`width`,`${e}px`),r.setAttribute(`height`,`${t}px`)),r.setAttribute(`preserveAspectRatio`,`none`),r.setAttribute(`viewBox`,`0 0 ${e} ${t}`),r}createElement(e){if(typeof e!=`string`)throw Error(`Invalid SVG element type`);return this._createSVG(e)}_createSVG(e){Ze("Abstract method `_createSVG` called.")}},jl=class extends Al{_createSVG(e){return document.createElementNS(vo,e)}},Ml=9,Nl=new WeakSet,Pl=new Date().getTimezoneOffset()*60*1e3,Fl=class{static create(e){switch(e.data.annotationType){case Oo.LINK:return new Rl(e);case Oo.TEXT:return new zl(e);case Oo.WIDGET:switch(e.data.fieldType){case`Tx`:return new Vl(e);case`Btn`:return e.data.radioButton?new Wl(e):e.data.checkBox?new Ul(e):new Gl(e);case`Ch`:return new Kl(e);case`Sig`:return new Hl(e)}return new Bl(e);case Oo.POPUP:return new ql(e);case Oo.FREETEXT:return new Yl(e);case Oo.LINE:return new Xl(e);case Oo.SQUARE:return new Zl(e);case Oo.CIRCLE:return new Ql(e);case Oo.POLYLINE:return new $l(e);case Oo.CARET:return new tu(e);case Oo.INK:return new nu(e);case Oo.POLYGON:return new eu(e);case Oo.HIGHLIGHT:return new ru(e);case Oo.UNDERLINE:return new iu(e);case Oo.SQUIGGLY:return new au(e);case Oo.STRIKEOUT:return new ou(e);case Oo.STAMP:return new su(e);case Oo.FILEATTACHMENT:return new cu(e);case Oo.RICHMEDIA:case Oo.SCREEN:case Oo.SOUND:return new lu(e);default:return new Il(e)}}},Il=class e{#e=null;#t=!1;#n=null;constructor(e,{isRenderable:t=!1,ignoreBorder:n=!1,createQuadrilaterals:r=!1}={}){this.isRenderable=t,this.data=e.data,this.layer=e.layer,this.linkService=e.linkService,this.downloadManager=e.downloadManager,this.imageResourcesPath=e.imageResourcesPath,this.renderForms=e.renderForms,this.svgFactory=e.svgFactory,this.annotationStorage=e.annotationStorage,this.enableComment=e.enableComment,this.enableScripting=e.enableScripting,this.hasJSActions=e.hasJSActions,this._fieldObjects=e.fieldObjects,this.parent=e.parent,this.hasOwnCommentButton=!1,t&&(this.contentElement=this.container=this._createContainer(n)),r&&this._createQuadrilaterals()}static _hasPopupData({contentsObj:e,richText:t}){return!!(e?.str||t?.str)}get _isEditable(){return this.data.isEditable}get hasPopupData(){return e._hasPopupData(this.data)||this.enableComment&&!!this.commentText}get commentData(){let{data:e}=this,t=this.annotationStorage?.getEditor(e.id);return t?t.getData():e}get hasCommentButton(){return this.enableComment&&this.hasPopupElement}get commentButtonPosition(){let e=this.annotationStorage?.getEditor(this.data.id);if(e)return e.commentButtonPositionInPage;let{quadPoints:t,inkLists:n,rect:r}=this.data,i=-1/0,a=-1/0;if(t?.length>=8){for(let e=0;e<t.length;e+=8)t[e+1]>a?(a=t[e+1],i=t[e+2]):t[e+1]===a&&(i=Math.max(i,t[e+2]));return[i,a]}if(n?.length>=1){for(let e of n)for(let t=0,n=e.length;t<n;t+=2)e[t+1]>a?(a=e[t+1],i=e[t]):e[t+1]===a&&(i=Math.max(i,e[t]));if(i!==1/0)return[i,a]}return r?[r[2],r[3]]:null}_normalizePoint(e){let{page:{view:t},viewport:{rawDims:{pageWidth:n,pageHeight:r,pageX:i,pageY:a}}}=this.parent;return e[1]=t[3]-e[1]+t[1],e[0]=100*(e[0]-i)/n,e[1]=100*(e[1]-a)/r,e}get commentText(){let{data:e}=this;return this.annotationStorage.getRawValue(`${So}${e.id}`)?.popup?.contents||e.contentsObj?.str||``}set commentText(e){let{data:t}=this,n={deleted:!e,contents:e||``};this.annotationStorage.updateEditor(t.id,{popup:n})||this.annotationStorage.setValue(`${So}${t.id}`,{id:t.id,annotationType:t.annotationType,page:this.parent.page,popup:n,popupRef:t.popupRef,modificationDate:new Date}),e||this.removePopup()}removePopup(){(this.#n?.popup||this.popup)?.remove(),this.#n=this.popup=null}updateEdited(e){if(!this.container)return;e.rect&&(this.#e||={rect:this.data.rect.slice(0)});let{rect:t,popup:n}=e;t&&this.#r(t);let r=this.#n?.popup||this.popup;!r&&n?.text&&(this._createPopup(n),r=this.#n.popup),r&&(r.updateEdited(e),n?.deleted&&(r.remove(),this.#n=null,this.popup=null))}resetEdited(){this.#e&&=(this.#r(this.#e.rect),this.#n?.popup.resetEdited(),null)}#r(e){let{container:{style:t},data:{rect:n,rotation:r},parent:{viewport:{rawDims:{pageWidth:i,pageHeight:a,pageX:o,pageY:s}}}}=this;n?.splice(0,4,...e),t.left=`${100*(e[0]-o)/i}%`,t.top=`${100*(a-e[3]+s)/a}%`,r===0?(t.width=`${100*(e[2]-e[0])/i}%`,t.height=`${100*(e[3]-e[1])/a}%`):this.setRotation(r)}_createContainer(e){let{data:t,parent:{page:n,viewport:r}}=this,i=document.createElement(`section`);i.setAttribute(`data-annotation-id`,t.id),this instanceof Bl||this instanceof Rl||this instanceof lu||(i.tabIndex=0);let{style:a}=i;if(a.zIndex=this.parent.zIndex,this.parent.zIndex+=2,t.alternativeText&&(i.title=t.alternativeText),t.noRotate&&i.classList.add(`norotate`),!t.rect||this instanceof ql){let{rotation:e}=t;return!t.hasOwnCanvas&&e!==0&&this.setRotation(e,i),i}let{width:o,height:s}=this;if(!e&&t.borderStyle.width>0){a.borderWidth=`${t.borderStyle.width}px`;let e=t.borderStyle.horizontalCornerRadius,n=t.borderStyle.verticalCornerRadius;switch((e>0||n>0)&&(a.borderRadius=`calc(${e}px * var(--total-scale-factor)) / calc(${n}px * var(--total-scale-factor))`),t.borderStyle.style){case ko.SOLID:a.borderStyle=`solid`;break;case ko.DASHED:a.borderStyle=`dashed`;break;case ko.BEVELED:Xe(`Unimplemented border style: beveled`);break;case ko.INSET:Xe(`Unimplemented border style: inset`);break;case ko.UNDERLINE:a.borderBottomStyle=`solid`}let r=t.borderColor||null;r?(this.#t=!0,a.borderColor=H.makeHexColor(...r)):a.borderWidth=0}let c=H.normalizeRect([t.rect[0],n.view[3]-t.rect[1]+n.view[1],t.rect[2],n.view[3]-t.rect[3]+n.view[1]]),{pageWidth:l,pageHeight:u,pageX:d,pageY:f}=r.rawDims;a.left=`${100*(c[0]-d)/l}%`,a.top=`${100*(c[1]-f)/u}%`;let{rotation:p}=t;return t.hasOwnCanvas||p===0?(a.width=`${100*o/l}%`,a.height=`${100*s/u}%`):this.setRotation(p,i),i}setRotation(e,t=this.container){if(!this.data.rect)return;let{pageWidth:n,pageHeight:r}=this.parent.viewport.rawDims,{width:i,height:a}=this;e%180!=0&&([i,a]=[a,i]),t.style.width=`${100*i/n}%`,t.style.height=`${100*a/r}%`,t.setAttribute(`data-main-rotation`,(360-e)%360)}get _commonActions(){let e=(e,t,n)=>{let r=n.detail[e],i=r[0],a=r.slice(1);n.target.style[t]=kl[`${i}_HTML`](a),this.annotationStorage.setValue(this.data.id,{[t]:kl[`${i}_rgb`](a)})};return V(this,`_commonActions`,{display:e=>{let{display:t}=e.detail,n=t%2==1;this.container.style.visibility=n?`hidden`:`visible`,this.annotationStorage.setValue(this.data.id,{noView:n,noPrint:t===1||t===2})},print:e=>{this.annotationStorage.setValue(this.data.id,{noPrint:!e.detail.print})},hidden:e=>{let{hidden:t}=e.detail;this.container.style.visibility=t?`hidden`:`visible`,this.annotationStorage.setValue(this.data.id,{noPrint:t,noView:t})},focus:e=>{setTimeout(()=>e.target.focus({preventScroll:!1}),0)},userName:e=>{e.target.title=e.detail.userName},readonly:e=>{e.target.disabled=e.detail.readonly},required:e=>{this._setRequired(e.target,e.detail.required)},bgColor:t=>{e(`bgColor`,`backgroundColor`,t)},fillColor:t=>{e(`fillColor`,`backgroundColor`,t)},fgColor:t=>{e(`fgColor`,`color`,t)},textColor:t=>{e(`textColor`,`color`,t)},borderColor:t=>{e(`borderColor`,`borderColor`,t)},strokeColor:t=>{e(`strokeColor`,`borderColor`,t)},rotation:e=>{let t=e.detail.rotation;this.setRotation(t),this.annotationStorage.setValue(this.data.id,{rotation:t})}})}_dispatchEventFromSandbox(e,t){let n=this._commonActions;for(let r of Object.keys(t.detail))(e[r]||n[r])?.(t)}_setDefaultPropertiesFromJS(e){if(!this.enableScripting)return;let t=this.annotationStorage.getRawValue(this.data.id);if(!t)return;let n=this._commonActions;for(let[r,i]of Object.entries(t)){let a=n[r];a&&(a({detail:{[r]:i},target:e}),delete t[r])}}_createQuadrilaterals(){if(!this.container)return;let{quadPoints:e}=this.data;if(!e)return;let[t,n,r,i]=this.data.rect.map(Math.fround);if(e.length===8){let[a,o,s,c]=e.subarray(2,6);if(r===a&&i===o&&t===s&&n===c)return}let{style:a}=this.container,o;if(this.#t){let{borderColor:e,borderWidth:t}=a;a.borderWidth=0,o=[`url('data:image/svg+xml;utf8,`,`<svg xmlns="${vo}" preserveAspectRatio="none" viewBox="0 0 1 1">`,`<g fill="transparent" stroke="${e}" stroke-width="${t}">`],this.container.classList.add(`hasBorder`)}let s=r-t,c=i-n,{svgFactory:l}=this,u=l.createElement(`svg`);u.classList.add(`quadrilateralsContainer`),u.setAttribute(`width`,0),u.setAttribute(`height`,0),u.role=`none`;let d=l.createElement(`defs`);u.append(d);let f=l.createElement(`clipPath`),p=`clippath_${this.data.id}`;f.setAttribute(`id`,p),f.setAttribute(`clipPathUnits`,`objectBoundingBox`),d.append(f);for(let n=2,r=e.length;n<r;n+=8){let r=e[n],a=e[n+1],u=e[n+2],d=e[n+3],p=l.createElement(`rect`),m=(u-t)/s,h=(i-a)/c,g=(r-u)/s,_=(a-d)/c;p.setAttribute(`x`,m),p.setAttribute(`y`,h),p.setAttribute(`width`,g),p.setAttribute(`height`,_),f.append(p),o?.push(`<rect vector-effect="non-scaling-stroke" x="${m}" y="${h}" width="${g}" height="${_}"/>`)}this.#t&&(o.push(`</g></svg>')`),a.backgroundImage=o.join(``)),this.container.append(u),this.container.style.clipPath=`url(#${p})`}_createPopup(e=null){let{data:t}=this,n,r;e?(n={str:e.text},r=e.date):(n=t.contentsObj,r=t.modificationDate),this.#n=new ql({data:{color:t.color,titleObj:t.titleObj,modificationDate:r,contentsObj:n,richText:t.richText,parentRect:t.rect,borderStyle:0,id:`popup_${t.id}`,rotation:t.rotation,noRotate:!0},linkService:this.linkService,parent:this.parent,elements:[this]})}get hasPopupElement(){return!!(this.#n||this.popup||this.data.popupRef)}get extraPopupElement(){return this.#n}render(){Ze("Abstract method `AnnotationElement.render` called")}_getElementsByName(e,t=null){let n=[];if(this._fieldObjects){let r=this._fieldObjects.get(e)||[];for(let{page:e,id:i,exportValues:a}of r){if(e===-1||i===t)continue;let r=typeof a==`string`?a:null,o=document.querySelector(`[data-element-id="${i}"]`);o&&!Nl.has(o)?Xe(`_getElementsByName - element not allowed: ${i}`):n.push({id:i,exportValue:r,domElement:o})}return n}for(let r of document.getElementsByName(e)){let{exportValue:e}=r,i=r.getAttribute(`data-element-id`);i!==t&&Nl.has(r)&&n.push({id:i,exportValue:e,domElement:r})}return n}show(){this.container&&(this.container.hidden=!1),this.popup?.maybeShow()}hide(){this.container&&(this.container.hidden=!0),this.popup?.forceHide()}getElementsToTriggerPopup(){return this.container}addHighlightArea(){let e=this.getElementsToTriggerPopup();if(Array.isArray(e))for(let t of e)t.classList.add(`highlightArea`);else e.classList.add(`highlightArea`)}_editOnDoubleClick(){if(!this._isEditable)return;let{annotationEditorType:e,data:{id:t}}=this;this.container.addEventListener(`dblclick`,()=>{this.linkService.eventBus?.dispatch(`switchannotationeditormode`,{source:this,mode:e,editId:t,mustEnterInEditMode:!0})})}updateOC(e){this.data.oc&&e&&(e.isVisible(this.data.oc)?this.show():this.hide())}get width(){return this.data.rect[2]-this.data.rect[0]}get height(){return this.data.rect[3]-this.data.rect[1]}_setBackgroundColor(e){let t=this.data.backgroundColor||null;e.style.backgroundColor=t===null?`transparent`:H.makeHexColor(...t)}},Ll=class extends Il{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0}),this.editor=e.editor}render(){return this.container.className=`editorAnnotation`,this.container}createOrUpdatePopup(){let{editor:e}=this;e.hasComment&&this._createPopup(e.comment)}get hasCommentButton(){return this.enableComment&&this.editor.hasComment}get commentButtonPosition(){return this.editor.commentButtonPositionInPage}get commentText(){return this.editor.comment.text}set commentText(e){this.editor.comment=e,e||this.removePopup()}get commentData(){return this.editor.getData()}remove(){this.parent.removeAnnotation(this.data.id),this.container.remove(),this.container=null,this.removePopup()}},Rl=class extends Il{constructor(e,t=null){super(e,{isRenderable:!0,ignoreBorder:!!t?.ignoreBorder,createQuadrilaterals:!0}),this.isTooltipOnly=e.data.isTooltipOnly}render(){let{data:e,linkService:t}=this,n=document.createElement(`a`);n.setAttribute(`data-element-id`,e.id);let r=!1;return e.url?(t.addLinkAttributes(n,e.url,e.newWindow),r=!0):e.action?(this._bindNamedAction(n,e.action,e.overlaidText),r=!0):e.attachment?(this.#t(n,e.attachmentId,e.attachment,e.overlaidText,e.attachmentDest),r=!0):e.setOCGState?(this.#n(n,e.setOCGState,e.overlaidText),r=!0):e.dest?(this._bindLink(n,e.dest,e.overlaidText),r=!0):(e.actions&&(e.actions.has(`Action`)||e.actions.has(`Mouse Up`)||e.actions.has(`Mouse Down`))&&this.enableScripting&&this.hasJSActions&&(this._bindJSAction(n,e),r=!0),e.resetForm?(this._bindResetFormAction(n,e.resetForm),r=!0):this.isTooltipOnly&&!r&&(this._bindLink(n,``),r=!0)),this.container.classList.add(`linkAnnotation`),r&&(this.contentElement=n,this.container.append(n)),this.container}#e(){this.container.setAttribute(`data-internal-link`,``)}_bindLink(e,t,n=``){e.href=this.linkService.getDestinationHash(t),e.onclick=()=>(t&&this.linkService.goToDestination(t),!1),(t||t===``)&&this.#e(),n&&(e.title=n)}_bindNamedAction(e,t,n=``){e.href=this.linkService.getAnchorUrl(``),e.onclick=()=>(this.linkService.executeNamedAction(t),!1),n&&(e.title=n),this.#e()}#t(e,t,n,r=``,i=null){e.href=this.linkService.getAnchorUrl(``),n.description?e.title=n.description:r&&(e.title=r);let a=async()=>{let e=await this.linkService.getAttachmentContent(t);e&&this.downloadManager?.openOrDownloadData(e,n.filename,i)};e.onclick=()=>(a(),!1),this.#e()}#n(e,t,n=``){e.href=this.linkService.getAnchorUrl(``),e.onclick=()=>(this.linkService.executeSetOCGState(t),!1),n&&(e.title=n),this.#e()}_bindJSAction(e,{actions:t,id:n,overlaidText:r}){e.href=this.linkService.getAnchorUrl(``);let i=new Map([[`Action`,`onclick`],[`Mouse Up`,`onmouseup`],[`Mouse Down`,`onmousedown`]]);for(let r of t.keys()){let t=i.get(r);t&&(e[t]=()=>(this.linkService.eventBus?.dispatch(`dispatcheventinsandbox`,{source:this,detail:{id:n,name:r}}),!1))}r&&(e.title=r),e.onclick||=()=>!1,this.#e()}_bindResetFormAction(e,t){let n=e.onclick;n||(e.href=this.linkService.getAnchorUrl(``)),this.#e(),this._fieldObjects?e.onclick=()=>{n?.();let{fields:e,refs:r,include:i}=t,a=[];if(e.length!==0||r.length!==0){let t=new Set(r);for(let n of e){let e=this._fieldObjects.get(n)||[];for(let{id:n}of e)t.add(n)}let n=new Map;for(let e of this._fieldObjects.values())for(let{id:t,kidIds:r}of e)r&&n.set(t,r);for(let e of t)for(let r of n.get(e)||[])t.add(r);for(let e of this._fieldObjects.values())for(let n of e)t.has(n.id)===i&&a.push(n)}else for(let e of this._fieldObjects.values())a.push(...e);let o=this.annotationStorage,s=[];for(let e of a){let{id:t}=e;switch(s.push(t),e.type){case`text`:{let n=e.defaultValue||``;o.setValue(t,{value:n});break}case`checkbox`:case`radiobutton`:{let n=e.defaultValue===e.exportValues;o.setValue(t,{value:n});break}case`combobox`:case`listbox`:{let n=e.defaultValue||``;o.setValue(t,{value:n});break}default:continue}let n=document.querySelector(`[data-element-id="${t}"]`);n&&(Nl.has(n)?n.dispatchEvent(new Event(`resetform`)):Xe(`_bindResetFormAction - element not allowed: ${t}`))}return this.enableScripting&&this.linkService.eventBus?.dispatch(`dispatcheventinsandbox`,{source:this,detail:{id:`app`,ids:s,name:`ResetForm`}}),!1}:(Xe('_bindResetFormAction - "resetForm" action not supported, ensure that the `fieldObjects` parameter is provided.'),n||(e.onclick=()=>!1))}},zl=class extends Il{constructor(e){super(e,{isRenderable:!0})}render(){this.container.classList.add(`textAnnotation`);let e=document.createElement(`img`);return e.src=this.imageResourcesPath+`annotation-`+this.data.name.toLowerCase()+`.svg`,e.setAttribute(`data-l10n-id`,`pdfjs-text-annotation-type`),e.setAttribute(`data-l10n-args`,JSON.stringify({type:this.data.name})),!this.data.popupRef&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this.container.append(e),this.container}},Bl=class extends Il{render(){return this.container}_getKeyModifier(e){return Ho.platform.isMac?e.metaKey:e.ctrlKey}_setEventListener(e,t,n,r,i){n.includes(`mouse`)?e.addEventListener(n,e=>{this.linkService.eventBus?.dispatch(`dispatcheventinsandbox`,{source:this,detail:{id:this.data.id,name:r,value:i(e),shift:e.shiftKey,modifier:this._getKeyModifier(e)}})}):e.addEventListener(n,e=>{if(n===`blur`){if(!t.focused||!e.relatedTarget)return;t.focused=!1}else if(n===`focus`){if(t.focused)return;t.focused=!0}i&&this.linkService.eventBus?.dispatch(`dispatcheventinsandbox`,{source:this,detail:{id:this.data.id,name:r,value:i(e)}})})}_setEventListeners(e,t,n,r){let{actions:i}=this.data;for(let[a,o]of n)(o===`Action`||i?.has(o))&&((o===`Focus`||o===`Blur`)&&(t||={focused:!1}),this._setEventListener(e,t,a,o,r),o===`Focus`&&!i?.has(`Blur`)?this._setEventListener(e,t,`blur`,`Blur`,null):o===`Blur`&&!i?.has(`Focus`)&&this._setEventListener(e,t,`focus`,`Focus`,null))}_setTextStyle(e){let t=[`left`,`center`,`right`],{fontColor:n}=this.data.defaultAppearanceData,r=this.data.defaultAppearanceData.fontSize||Ml,i=e.style,a,o=e=>Math.round(10*e)/10;if(this.data.multiLine){let e=Math.abs(this.data.rect[3]-this.data.rect[1]-2),t=e/(Math.round(e/(1.35*r))||1);a=Math.min(r,o(t/1.35))}else{let e=Math.abs(this.data.rect[3]-this.data.rect[1]-2);a=Math.min(r,o(e/1.35))}i.fontSize=`calc(${a}px * var(--total-scale-factor))`,i.color=H.makeHexColor(...n),this.data.textAlignment!==null&&!this.data.comb&&(i.textAlign=t[this.data.textAlignment])}_setRequired(e,t){t?e.setAttribute(`required`,!0):e.removeAttribute(`required`),e.setAttribute(`aria-required`,t)}},Vl=class extends Bl{constructor(e){let t=e.renderForms||e.data.hasOwnCanvas||!e.data.hasAppearance&&!!e.data.fieldValue;super(e,{isRenderable:t})}setPropertyOnSiblings(e,t,n,r){let i=this.annotationStorage;for(let a of this._getElementsByName(e.name,e.id))a.domElement&&(a.domElement[t]=n),i.setValue(a.id,{[r]:n})}render(){let e=this.annotationStorage,t=this.data.id;this.container.classList.add(`textWidgetAnnotation`);let n=null;if(this.renderForms){let r=e.getValue(t,{value:this.data.fieldValue}),i=r.value||``,a=e.getValue(t,{charLimit:this.data.maxLen}).charLimit;a&&i.length>a&&(i=i.slice(0,a));let o=r.formattedValue||this.data.textContent?.join(`
47
+ `)||null;o&&this.data.comb&&(o=o.replaceAll(/\s+/g,``));let s={userValue:i,formattedValue:o,lastCommittedValue:null,commitKey:1,focused:!1};this.data.multiLine?(n=document.createElement(`textarea`),n.textContent=o??i,this.data.doNotScroll&&(n.style.overflowY=`hidden`)):(n=document.createElement(`input`),n.type=this.data.password?`password`:`text`,n.setAttribute(`value`,o??i),this.data.doNotScroll&&(n.style.overflowX=`hidden`)),this.data.hasOwnCanvas&&(this.container.classList.add(`hasOwnCanvas`),e.has(t)&&this.container.classList.add(`sandboxModified`)),Nl.add(n),this.contentElement=n,n.setAttribute(`data-element-id`,t),n.disabled=this.data.readOnly,n.name=this.data.fieldName,n.tabIndex=0;let{datetimeFormat:c,datetimeType:l,timeStep:u}=this.data,d=!!l&&this.enableScripting;c&&(n.title=c),this._setRequired(n,this.data.required),a&&(n.maxLength=a),n.addEventListener(`input`,r=>{e.setValue(t,{value:r.target.value}),this.setPropertyOnSiblings(n,`value`,r.target.value,`value`),s.formattedValue=null}),n.addEventListener(`resetform`,e=>{let t=this.data.defaultFieldValue??``;n.value=s.userValue=t,s.formattedValue=null});let f=e=>{let{formattedValue:t}=s;t!=null&&(e.target.value=t),e.target.scrollLeft=0};if(this.enableScripting&&this.hasJSActions){n.addEventListener(`focus`,e=>{if(s.focused)return;let{target:t}=e;if(d&&(t.type=l,u&&(t.step=u)),s.userValue){let e=s.userValue;if(d){if(l===`time`){let n=new Date(e);t.value=[n.getHours(),n.getMinutes(),n.getSeconds()].map(e=>e.toString().padStart(2,`0`)).join(`:`)}else t.value=new Date(e-Pl).toISOString().split(l===`date`?`T`:`.`,1)[0]}else t.value=e}s.lastCommittedValue=t.value,s.commitKey=1,this.data.actions?.has(`Focus`)||(s.focused=!0)}),n.addEventListener(`updatefromsandbox`,n=>{this.container.classList.add(`sandboxModified`),this._dispatchEventFromSandbox({value(n){s.userValue=n.detail.value??``,d||e.setValue(t,{value:s.userValue.toString()}),n.target.value=s.userValue},formattedValue(n){let{formattedValue:r}=n.detail;s.formattedValue=r,r!=null&&n.target!==document.activeElement&&(n.target.value=r);let i={formattedValue:r};d&&(i.value=r),e.setValue(t,i)},selRange(e){e.target.setSelectionRange(...e.detail.selRange)},charLimit:n=>{let{charLimit:r}=n.detail,{target:i}=n;if(r===0){i.removeAttribute(`maxLength`);return}i.setAttribute(`maxLength`,r);let a=s.userValue;!a||a.length<=r||(a=a.slice(0,r),i.value=s.userValue=a,e.setValue(t,{value:a}),this.linkService.eventBus?.dispatch(`dispatcheventinsandbox`,{source:this,detail:{id:t,name:`Keystroke`,value:a,willCommit:!0,commitKey:1,selStart:i.selectionStart,selEnd:i.selectionEnd}}))}},n)}),n.addEventListener(`keydown`,e=>{s.commitKey=1;let n=-1;if(e.key===`Escape`?n=0:e.key===`Enter`&&!this.data.multiLine?n=2:e.key===`Tab`&&(s.commitKey=3),n===-1)return;let{value:r}=e.target;s.lastCommittedValue!==r&&(s.lastCommittedValue=r,s.userValue=r,this.linkService.eventBus?.dispatch(`dispatcheventinsandbox`,{source:this,detail:{id:t,name:`Keystroke`,value:r,willCommit:!0,commitKey:n,selStart:e.target.selectionStart,selEnd:e.target.selectionEnd}}))});let r=f;f=null,n.addEventListener(`blur`,e=>{if(!s.focused||!e.relatedTarget)return;this.data.actions?.has(`Blur`)||(s.focused=!1);let{target:n}=e,{value:i}=n;if(d){if(i&&l===`time`){let e=i.split(`:`).map(e=>parseInt(e,10));i=new Date(2e3,0,1,e[0],e[1],e[2]||0).valueOf(),n.step=``}else i.includes(`T`)||(i=`${i}T00:00`),i=new Date(i).valueOf();n.type=`text`}s.userValue=i,s.lastCommittedValue!==i&&this.linkService.eventBus?.dispatch(`dispatcheventinsandbox`,{source:this,detail:{id:t,name:`Keystroke`,value:i,willCommit:!0,commitKey:s.commitKey,selStart:e.target.selectionStart,selEnd:e.target.selectionEnd}}),r(e)}),this.data.actions?.has(`Keystroke`)&&n.addEventListener(`beforeinput`,e=>{s.lastCommittedValue=null;let{data:n,target:r}=e,{value:i,selectionStart:a,selectionEnd:o}=r,c=a,l=o;switch(e.inputType){case`deleteWordBackward`:{let e=/\w/;for(;c>0&&!e.test(i[c-1]);)c--;for(;c>0&&e.test(i[c-1]);)c--;break}case`deleteWordForward`:{let e=i.substring(a).match(/^\W*\w*/);e&&(l+=e[0].length);break}case`deleteContentBackward`:a===o&&--c;break;case`deleteContentForward`:a===o&&(l+=1)}e.preventDefault(),this.linkService.eventBus?.dispatch(`dispatcheventinsandbox`,{source:this,detail:{id:t,name:`Keystroke`,value:i,change:n||``,willCommit:!1,selStart:c,selEnd:l}})}),this._setEventListeners(n,s,[[`focus`,`Focus`],[`blur`,`Blur`],[`mousedown`,`Mouse Down`],[`mouseenter`,`Mouse Enter`],[`mouseleave`,`Mouse Exit`],[`mouseup`,`Mouse Up`]],e=>e.target.value)}if(f&&n.addEventListener(`blur`,f),this.data.comb){let e=(this.data.rect[2]-this.data.rect[0])/a;n.classList.add(`comb`),n.style.setProperty(`--comb-width`,`calc(${e}px * var(--total-scale-factor))`);let t=this.data.textAlignment;if(t===1||t===2){let e=()=>{let e=a-n.value.length;n.style.setProperty(`--comb-offset`,`${t===1?e>>1:e}`)};e();for(let t of[`input`,`blur`,`resetform`,`updatefromsandbox`])n.addEventListener(t,e)}}}else n=document.createElement(`div`),n.textContent=this.data.fieldValue,n.style.verticalAlign=`middle`,n.style.display=`table-cell`,this.data.hasOwnCanvas&&(n.hidden=!0);return this._setTextStyle(n),this._setBackgroundColor(n),this._setDefaultPropertiesFromJS(n),this.container.append(n),this.container}},Hl=class extends Bl{constructor(e){super(e,{isRenderable:!!e.data.hasOwnCanvas})}},Ul=class extends Bl{constructor(e){super(e,{isRenderable:e.renderForms})}render(){let e=this.annotationStorage,t=this.data,n=t.id,r=e.getValue(n,{value:t.exportValue===t.fieldValue}).value;typeof r==`string`&&(r=r!==`Off`,e.setValue(n,{value:r})),this.container.classList.add(`buttonWidgetAnnotation`,`checkBox`);let i=document.createElement(`input`);return Nl.add(i),i.setAttribute(`data-element-id`,n),i.disabled=t.readOnly,this._setRequired(i,this.data.required),i.type=`checkbox`,i.name=t.fieldName,r&&i.setAttribute(`checked`,!0),i.setAttribute(`exportValue`,t.exportValue),i.tabIndex=0,i.addEventListener(`change`,r=>{let{name:i,checked:a}=r.target;for(let r of this._getElementsByName(i,n)){let n=a&&r.exportValue===t.exportValue;r.domElement&&(r.domElement.checked=n),e.setValue(r.id,{value:n})}e.setValue(n,{value:a})}),i.addEventListener(`resetform`,e=>{let n=t.defaultFieldValue||`Off`;e.target.checked=n===t.exportValue}),this.enableScripting&&this.hasJSActions&&(i.addEventListener(`updatefromsandbox`,t=>{this._dispatchEventFromSandbox({value(t){t.target.checked=t.detail.value!==`Off`,e.setValue(n,{value:t.target.checked})}},t)}),this._setEventListeners(i,null,[[`change`,`Validate`],[`change`,`Action`],[`focus`,`Focus`],[`blur`,`Blur`],[`mousedown`,`Mouse Down`],[`mouseenter`,`Mouse Enter`],[`mouseleave`,`Mouse Exit`],[`mouseup`,`Mouse Up`]],e=>e.target.checked)),this._setDefaultPropertiesFromJS(i),this.container.append(i),this.container}},Wl=class extends Bl{constructor(e){super(e,{isRenderable:e.renderForms})}render(){this.container.classList.add(`buttonWidgetAnnotation`,`radioButton`);let e=this.annotationStorage,t=this.data,n=t.id,r=e.getValue(n,{value:t.buttonValue!==null&&t.fieldValue===t.buttonValue}).value;if(typeof r==`string`&&(r=r!==t.buttonValue,e.setValue(n,{value:r})),r)for(let r of this._getElementsByName(t.fieldName,n))e.setValue(r.id,{value:!1});let i=document.createElement(`input`);if(Nl.add(i),i.setAttribute(`data-element-id`,n),i.disabled=t.readOnly,this._setRequired(i,this.data.required),i.type=`radio`,i.name=t.fieldName,r&&i.setAttribute(`checked`,!0),i.tabIndex=0,i.addEventListener(`change`,t=>{let{name:r,checked:i}=t.target;for(let t of this._getElementsByName(r,n))e.setValue(t.id,{value:!1});e.setValue(n,{value:i})}),i.addEventListener(`resetform`,e=>{let n=t.defaultFieldValue;e.target.checked=n!=null&&n===t.buttonValue}),this.enableScripting&&this.hasJSActions){let r=t.buttonValue;i.addEventListener(`updatefromsandbox`,t=>{this._dispatchEventFromSandbox({value:t=>{let i=r===t.detail.value;for(let r of this._getElementsByName(t.target.name)){let t=i&&r.id===n;r.domElement&&(r.domElement.checked=t),e.setValue(r.id,{value:t})}}},t)}),this._setEventListeners(i,null,[[`change`,`Validate`],[`change`,`Action`],[`focus`,`Focus`],[`blur`,`Blur`],[`mousedown`,`Mouse Down`],[`mouseenter`,`Mouse Enter`],[`mouseleave`,`Mouse Exit`],[`mouseup`,`Mouse Up`]],e=>e.target.checked)}return this._setDefaultPropertiesFromJS(i),this.container.append(i),this.container}},Gl=class extends Rl{constructor(e){super(e,{ignoreBorder:e.data.hasAppearance})}render(){let e=super.render();e.classList.add(`buttonWidgetAnnotation`,`pushButton`);let t=e.lastChild;return this.enableScripting&&this.hasJSActions&&t&&(this._setDefaultPropertiesFromJS(t),t.addEventListener(`updatefromsandbox`,e=>{this._dispatchEventFromSandbox({},e)})),e}},Kl=class extends Bl{constructor(e){super(e,{isRenderable:e.renderForms})}render(){this.container.classList.add(`choiceWidgetAnnotation`);let e=this.annotationStorage,t=this.data.id,n=e.getValue(t,{value:this.data.fieldValue}),r=document.createElement(`select`);Nl.add(r),r.setAttribute(`data-element-id`,t),r.disabled=this.data.readOnly,this._setRequired(r,this.data.required),r.name=this.data.fieldName,r.tabIndex=0;let i=this.data.combo&&this.data.options.length>0;this.data.combo||(r.size=this.data.options.length,this.data.multiSelect&&(r.multiple=!0)),r.addEventListener(`resetform`,e=>{let t=this.data.defaultFieldValue;for(let e of r.options)e.selected=e.value===t});let a=(e,t)=>{let n=t.replaceAll(` `,`\xA0`);e.textContent=n,n!==t&&e.setAttribute(`display-value`,t)};for(let e of this.data.options){let t=document.createElement(`option`);a(t,e.displayValue),t.value=e.exportValue,n.value.includes(e.exportValue)&&(t.setAttribute(`selected`,!0),i=!1),r.append(t)}let o=null;if(i){let e=document.createElement(`option`);e.value=` `,e.setAttribute(`hidden`,!0),e.setAttribute(`selected`,!0),r.prepend(e),o=()=>{e.remove(),r.removeEventListener(`input`,o),o=null},r.addEventListener(`input`,o)}let s=e=>{let t=e?`value`:`textContent`,{options:n,multiple:i}=r;return i?Array.prototype.filter.call(n,e=>e.selected).map(e=>e[t]):n.selectedIndex===-1?null:n[n.selectedIndex][t]},c=s(!1),l=e=>{let t=e.target.options;return Array.prototype.map.call(t,e=>({displayValue:e.getAttribute(`display-value`)||e.textContent,exportValue:e.value}))};return this.enableScripting&&this.hasJSActions?(r.addEventListener(`updatefromsandbox`,n=>{this._dispatchEventFromSandbox({value(n){o?.();let i=n.detail.value,a=new Set(Array.isArray(i)?i:[i]);for(let e of r.options)e.selected=a.has(e.value);e.setValue(t,{value:s(!0)}),c=s(!1)},multipleSelection(e){r.multiple=!0},remove(n){let i=r.options,a=n.detail.remove;i[a].selected=!1,r.remove(a),i.length>0&&Array.prototype.findIndex.call(i,e=>e.selected)===-1&&(i[0].selected=!0),e.setValue(t,{value:s(!0),items:l(n)}),c=s(!1)},clear(n){for(;r.length!==0;)r.remove(0);e.setValue(t,{value:null,items:[]}),c=s(!1)},insert(n){let{index:i,displayValue:o,exportValue:u}=n.detail.insert,d=r.children[i],f=document.createElement(`option`);a(f,o),f.value=u,d?d.before(f):r.append(f),e.setValue(t,{value:s(!0),items:l(n)}),c=s(!1)},items(n){let{items:i}=n.detail;for(;r.length!==0;)r.remove(0);for(let e of i){let{displayValue:t,exportValue:n}=e,i=document.createElement(`option`);a(i,t),i.value=n,r.append(i)}r.options.length>0&&(r.options[0].selected=!0),e.setValue(t,{value:s(!0),items:l(n)}),c=s(!1)},indices(n){let r=new Set(n.detail.indices);for(let e of n.target.options)e.selected=r.has(e.index);e.setValue(t,{value:s(!0)}),c=s(!1)},editable(e){e.target.disabled=!e.detail.editable}},n)}),r.addEventListener(`input`,n=>{let r=s(!0),i=s(!1);e.setValue(t,{value:r}),n.preventDefault(),this.linkService.eventBus?.dispatch(`dispatcheventinsandbox`,{source:this,detail:{id:t,name:`Keystroke`,value:c,change:i,changeEx:r,willCommit:!1,commitKey:1,keyDown:!1}})}),this._setEventListeners(r,null,[[`focus`,`Focus`],[`blur`,`Blur`],[`mousedown`,`Mouse Down`],[`mouseenter`,`Mouse Enter`],[`mouseleave`,`Mouse Exit`],[`mouseup`,`Mouse Up`],[`input`,`Action`],[`input`,`Validate`]],e=>e.target.value)):r.addEventListener(`input`,function(n){e.setValue(t,{value:s(!0)})}),this.data.combo&&this._setTextStyle(r),this._setBackgroundColor(r),this._setDefaultPropertiesFromJS(r),this.container.append(r),this.container}},ql=class extends Il{constructor(e){let{data:t,elements:n,parent:r}=e,i=!!r._commentManager;if(super(e,{isRenderable:!i&&Il._hasPopupData(t)}),this.elements=n,i&&Il._hasPopupData(t)){let e=this.popup=this.#e();for(let t of n)t.popup=e}else this.popup=null}#e(){return new Jl({container:this.container,color:this.data.color,titleObj:this.data.titleObj,modificationDate:this.data.modificationDate||this.data.creationDate,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,commentManager:this.parent._commentManager})}render(){let{container:e}=this;e.classList.add(`popupAnnotation`),e.role=`comment`;let t=this.popup=this.#e(),n=[];for(let e of this.elements)e.popup=t,e.container.ariaHasPopup=`dialog`,n.push(e.data.id),e.addHighlightArea();return this.container.setAttribute(`aria-controls`,n.map(e=>`${xo}${e}`).join(`,`)),this.container}},Jl=class{#e=null;#t=this.#P.bind(this);#n=this.#R.bind(this);#r=this.#L.bind(this);#i=this.#I.bind(this);#a=null;#o=null;#s=null;#c=null;#l=null;#u=null;#d=null;#f=!1;#p=null;#m=null;#h=null;#g=null;#_=null;#v=null;#y=null;#b=null;#x=null;#S=null;#C=!1;#w=null;#T=null;constructor({container:e,color:t,elements:n,titleObj:r,modificationDate:i,contentsObj:a,richText:o,parent:s,rect:c,parentRect:l,open:u,commentManager:d=null}){this.#o=e,this.#x=r,this.#s=a,this.#b=o,this.#u=s,this.#a=t,this.#y=c,this.#d=l,this.#l=n,this.#e=d,this.#w=n[0],this.#c=rs.toDateObject(i),this.trigger=n.flatMap(e=>e.getElementsToTriggerPopup()),d||(this.#E(),this.#o.hidden=!0,u&&this.#I())}#E(){if(this.#m)return;this.#m=new AbortController;let{signal:e}=this.#m;for(let t of this.trigger)t.addEventListener(`click`,this.#i,{signal:e}),t.addEventListener(`pointerenter`,this.#r,{signal:e}),t.addEventListener(`pointerleave`,this.#n,{signal:e}),t.classList.add(`popupTriggerArea`);for(let t of this.#l)t.container?.addEventListener(`keydown`,this.#t,{signal:e})}#D(){let e=this.#l.find(e=>e.hasCommentButton);e&&(this.#_=e._normalizePoint(e.commentButtonPosition))}renderCommentButton(){if(this.#g){this.#g.parentNode||this.#w.container.after(this.#g);return}if(this.#_||this.#D(),!this.#_)return;let{signal:e}=this.#m=new AbortController,t=this.#w.hasOwnCommentButton,n=()=>{this.#e.toggleCommentPopup(this,!0,void 0,!t)},r=()=>{this.#e.toggleCommentPopup(this,!1,!0,!t)},i=()=>{this.#e.toggleCommentPopup(this,!1,!1)};if(t){this.#g=this.#w.container;for(let t of this.trigger)t.ariaHasPopup=`dialog`,t.ariaControls=`commentPopup`,t.addEventListener(`keydown`,this.#t,{signal:e}),t.addEventListener(`click`,n,{signal:e}),t.addEventListener(`pointerenter`,r,{signal:e}),t.addEventListener(`pointerleave`,i,{signal:e}),t.classList.add(`popupTriggerArea`)}else{let t=this.#g=document.createElement(`button`);t.className=`annotationCommentButton`;let a=this.#w.container;t.style.zIndex=parseInt(a.style.zIndex,10)+1,t.tabIndex=0,t.ariaHasPopup=`dialog`,t.ariaControls=`commentPopup`,t.setAttribute(`data-l10n-id`,`pdfjs-show-comment-button`),this.#k(),this.#O(),t.addEventListener(`keydown`,this.#t,{signal:e}),t.addEventListener(`click`,n,{signal:e}),t.addEventListener(`pointerenter`,r,{signal:e}),t.addEventListener(`pointerleave`,i,{signal:e}),a.after(t)}}#O(){if(this.#w.extraPopupElement&&!this.#w.editor)return;this.#g||this.renderCommentButton();let[e,t]=this.#_,{style:n}=this.#g;n.left=`calc(${e}%)`,n.top=`calc(${t}% - var(--comment-button-dim))`}#k(){this.#w.extraPopupElement||(this.#g||this.renderCommentButton(),this.#g.style.backgroundColor=this.commentButtonColor||``)}get commentButtonColor(){let{color:e,opacity:t}=this.#w.commentData;return e?this.#u._commentManager.makeCommentColor(e,t):null}focusCommentButton(){setTimeout(()=>{this.#g?.focus()},0)}getData(){let{richText:e,color:t,opacity:n,creationDate:r,modificationDate:i}=this.#w.commentData;return{contentsObj:{str:this.comment},richText:e,color:t,opacity:n,creationDate:r,modificationDate:i}}get elementBeforePopup(){return this.#g}get comment(){return this.#T||=this.#w.commentText,this.#T}set comment(e){e!==this.comment&&(this.#w.commentText=this.#T=e)}focus(){this.#w.container?.focus()}get parentBoundingClientRect(){return this.#w.layer.getBoundingClientRect()}setCommentButtonStates({selected:e,hasPopup:t}){this.#g&&(this.#g.classList.toggle(`selected`,e),this.#g.ariaExpanded=t)}setSelectedCommentButton(e){this.#g.classList.toggle(`selected`,e)}get commentPopupPosition(){if(this.#v)return this.#v;let{x:e,y:t,height:n}=this.#g.getBoundingClientRect(),{x:r,y:i,width:a,height:o}=this.#w.layer.getBoundingClientRect();return[(e-r)/a,(t+n-i)/o]}set commentPopupPosition(e){this.#v=e}hasDefaultPopupPosition(){return this.#v===null}get commentButtonPosition(){return this.#_}get commentButtonWidth(){return this.#g.getBoundingClientRect().width/this.parentBoundingClientRect.width}editComment(e){let[t,n]=this.#v||this.commentButtonPosition.map(e=>e/100),r=this.parentBoundingClientRect,{x:i,y:a,width:o,height:s}=r;this.#e.showDialog(null,this,i+t*o,a+n*s,{...e,parentDimensions:r})}render(){if(this.#p)return;let e=this.#p=document.createElement(`div`);if(e.className=`popup`,this.#a){let t=e.style.outlineColor=H.makeHexColor(...this.#a);e.style.backgroundColor=`color-mix(in srgb, ${t} 30%, white)`}let t=document.createElement(`span`);if(t.className=`header`,this.#x?.str){let e=document.createElement(`span`);e.className=`title`,t.append(e),{dir:e.dir,str:e.textContent}=this.#x}if(e.append(t),this.#c){let e=document.createElement(`time`);e.className=`popupDate`,e.setAttribute(`data-l10n-id`,`pdfjs-annotation-date-time-string`),e.setAttribute(`data-l10n-args`,JSON.stringify({dateObj:this.#c.valueOf()})),e.dateTime=this.#c.toISOString(),t.append(e)}At({html:this.#A||this.#s.str,dir:this.#s?.dir,className:`popupContent`},e),this.#o.append(e)}get#A(){let e=this.#b,t=this.#s;return e?.str&&(!t?.str||t.str===e.str)&&this.#b.html||null}get#j(){return this.#A?.attributes?.style?.fontSize||0}get#M(){return this.#A?.attributes?.style?.color||null}#N(e){let t=[],n={str:e,html:{name:`div`,attributes:{dir:`auto`},children:[{name:`p`,children:t}]}},r={style:{color:this.#M,fontSize:this.#j?`calc(${this.#j}px * var(--total-scale-factor))`:``}};for(let n of e.split(`
48
+ `))t.push({name:`span`,value:n,attributes:r});return n}#P(e){e.altKey||e.shiftKey||e.ctrlKey||e.metaKey||(e.key===`Enter`||e.key===`Escape`&&this.#f)&&this.#I()}updateEdited({rect:e,popup:t,deleted:n}){this.#e?(n?(this.remove(),this.#T=null):t&&(t.deleted?this.remove():(this.#k(),this.#T=t.text)),e&&(this.#_=null,this.#D(),this.#O())):n||t?.deleted?this.remove():(this.#E(),this.#S||={contentsObj:this.#s,richText:this.#b},e&&(this.#h=null),t&&t.text&&(this.#b=this.#N(t.text),this.#c=rs.toDateObject(t.date),this.#s=null),this.#p?.remove(),this.#p=null)}resetEdited(){this.#S&&({contentsObj:this.#s,richText:this.#b}=this.#S,this.#S=null,this.#p?.remove(),this.#p=null,this.#h=null)}remove(){if(this.#m?.abort(),this.#m=null,this.#p?.remove(),this.#p=null,this.#C=!1,this.#f=!1,this.#g?.remove(),this.#g=null,this.trigger)for(let e of this.trigger)e.classList.remove(`popupTriggerArea`)}#F(){if(this.#h!==null)return;let{page:{view:e},viewport:{rawDims:{pageWidth:t,pageHeight:n,pageX:r,pageY:i}}}=this.#u,a=!!this.#d,o=a?this.#d:this.#y;for(let e of this.#l)if(!o||H.intersect(e.data.rect,o)!==null){o=e.data.rect,a=!0;break}let s=H.normalizeRect([o[0],e[3]-o[1]+e[1],o[2],e[3]-o[3]+e[1]]),c=a?o[2]-o[0]+5:0,l=s[0]+c,u=s[1];this.#h=[100*(l-r)/t,100*(u-i)/n];let{style:d}=this.#o;d.left=`${this.#h[0]}%`,d.top=`${this.#h[1]}%`}#I(){this.#e?this.#e.toggleCommentPopup(this,!1):(this.#f=!this.#f,this.#f?(this.#L(),this.#o.addEventListener(`click`,this.#i),this.#o.addEventListener(`keydown`,this.#t)):(this.#R(),this.#o.removeEventListener(`click`,this.#i),this.#o.removeEventListener(`keydown`,this.#t)))}#L(){this.#p||this.render(),this.isVisible?this.#f&&this.#o.classList.add(`focused`):(this.#F(),this.#o.hidden=!1,this.#o.style.zIndex=parseInt(this.#o.style.zIndex,10)+1e3)}#R(){this.#o.classList.remove(`focused`),!(this.#f||!this.isVisible)&&(this.#o.hidden=!0,this.#o.style.zIndex=parseInt(this.#o.style.zIndex,10)-1e3)}forceHide(){this.#C=this.isVisible,this.#C&&(this.#o.hidden=!0)}maybeShow(){this.#e||(this.#E(),this.#C&&(this.#p||this.#L(),this.#C=!1,this.#o.hidden=!1))}get isVisible(){return!this.#e&&this.#o.hidden===!1}},Yl=class extends Il{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0}),this.textContent=e.data.textContent,this.textPosition=e.data.textPosition,this.annotationEditorType=Co.FREETEXT}render(){if(this.container.classList.add(`freeTextAnnotation`),this.textContent){let e=this.contentElement=document.createElement(`div`);e.classList.add(`annotationTextContent`),e.setAttribute(`role`,`comment`);for(let t of this.textContent){let n=document.createElement(`span`);n.textContent=t,e.append(n)}this.container.append(e)}return!this.data.popupRef&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this._editOnDoubleClick(),this.container}},Xl=class extends Il{#e=null;constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0})}render(){this.container.classList.add(`lineAnnotation`);let{data:e,width:t,height:n}=this,r=this.svgFactory.create(t,n,!0),i=this.#e=this.svgFactory.createElement(`svg:line`);return i.setAttribute(`x1`,e.rect[2]-e.lineCoordinates[0]),i.setAttribute(`y1`,e.rect[3]-e.lineCoordinates[1]),i.setAttribute(`x2`,e.rect[2]-e.lineCoordinates[2]),i.setAttribute(`y2`,e.rect[3]-e.lineCoordinates[3]),i.setAttribute(`stroke-width`,e.borderStyle.width||1),i.setAttribute(`stroke`,`transparent`),i.setAttribute(`fill`,`transparent`),r.append(i),this.container.append(r),!e.popupRef&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this.container}getElementsToTriggerPopup(){return this.#e}addHighlightArea(){this.container.classList.add(`highlightArea`)}},Zl=class extends Il{#e=null;constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0})}render(){this.container.classList.add(`squareAnnotation`);let{data:e,width:t,height:n}=this,r=this.svgFactory.create(t,n,!0),i=e.borderStyle.width,a=this.#e=this.svgFactory.createElement(`svg:rect`);return a.setAttribute(`x`,i/2),a.setAttribute(`y`,i/2),a.setAttribute(`width`,t-i),a.setAttribute(`height`,n-i),a.setAttribute(`stroke-width`,i||1),a.setAttribute(`stroke`,`transparent`),a.setAttribute(`fill`,`transparent`),r.append(a),this.container.append(r),!e.popupRef&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this.container}getElementsToTriggerPopup(){return this.#e}addHighlightArea(){this.container.classList.add(`highlightArea`)}},Ql=class extends Il{#e=null;constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0})}render(){this.container.classList.add(`circleAnnotation`);let{data:e,width:t,height:n}=this,r=this.svgFactory.create(t,n,!0),i=e.borderStyle.width,a=this.#e=this.svgFactory.createElement(`svg:ellipse`);return a.setAttribute(`cx`,t/2),a.setAttribute(`cy`,n/2),a.setAttribute(`rx`,t/2-i/2),a.setAttribute(`ry`,n/2-i/2),a.setAttribute(`stroke-width`,i||1),a.setAttribute(`stroke`,`transparent`),a.setAttribute(`fill`,`transparent`),r.append(a),this.container.append(r),!e.popupRef&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this.container}getElementsToTriggerPopup(){return this.#e}addHighlightArea(){this.container.classList.add(`highlightArea`)}},$l=class extends Il{#e=null;constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0}),this.containerClassName=`polylineAnnotation`,this.svgElementName=`svg:polyline`}render(){this.container.classList.add(this.containerClassName);let{data:{rect:e,vertices:t,borderStyle:n,popupRef:r},width:i,height:a}=this;if(!t)return this.container;let o=this.svgFactory.create(i,a,!0),s=[];for(let n=0,r=t.length;n<r;n+=2){let r=t[n]-e[0],i=e[3]-t[n+1];s.push(`${r},${i}`)}s=s.join(` `);let c=this.#e=this.svgFactory.createElement(this.svgElementName);return c.setAttribute(`points`,s),c.setAttribute(`stroke-width`,n.width||1),c.setAttribute(`stroke`,`transparent`),c.setAttribute(`fill`,`transparent`),o.append(c),this.container.append(o),!r&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this.container}getElementsToTriggerPopup(){return this.#e}addHighlightArea(){this.container.classList.add(`highlightArea`)}},eu=class extends $l{constructor(e){super(e),this.containerClassName=`polygonAnnotation`,this.svgElementName=`svg:polygon`}},tu=class extends Il{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0})}render(){return this.container.classList.add(`caretAnnotation`),!this.data.popupRef&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this.container}},nu=class extends Il{#e=null;#t=[];constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0}),this.containerClassName=`inkAnnotation`,this.svgElementName=`svg:polyline`,this.annotationEditorType=this.data.it===`InkHighlight`?Co.HIGHLIGHT:Co.INK}#n(e,t){switch(e){case 90:return{transform:`rotate(90) translate(${-t[0]},${t[1]}) scale(1,-1)`,width:t[3]-t[1],height:t[2]-t[0]};case 180:return{transform:`rotate(180) translate(${-t[2]},${t[1]}) scale(1,-1)`,width:t[2]-t[0],height:t[3]-t[1]};case 270:return{transform:`rotate(270) translate(${-t[2]},${t[3]}) scale(1,-1)`,width:t[3]-t[1],height:t[2]-t[0]};default:return{transform:`translate(${-t[0]},${t[3]}) scale(1,-1)`,width:t[2]-t[0],height:t[3]-t[1]}}}render(){this.container.classList.add(this.containerClassName);let{data:{rect:e,rotation:t,inkLists:n,borderStyle:r,popupRef:i}}=this,{transform:a,width:o,height:s}=this.#n(t,e),c=this.svgFactory.create(o,s,!0),l=this.#e=this.svgFactory.createElement(`svg:g`);c.append(l),l.setAttribute(`stroke-width`,r.width||1),l.setAttribute(`stroke-linecap`,`round`),l.setAttribute(`stroke-linejoin`,`round`),l.setAttribute(`stroke-miterlimit`,10),l.setAttribute(`stroke`,`transparent`),l.setAttribute(`fill`,`transparent`),l.setAttribute(`transform`,a);for(let e of n){let t=this.svgFactory.createElement(this.svgElementName);this.#t.push(t),t.setAttribute(`points`,e.join(`,`)),l.append(t)}return!i&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this.container.append(c),this._editOnDoubleClick(),this.container}updateEdited(e){super.updateEdited(e);let{thickness:t,points:n,rect:r}=e,i=this.#e;if(t>=0&&i.setAttribute(`stroke-width`,t||1),n)for(let e=0,t=this.#t.length;e<t;e++)this.#t[e].setAttribute(`points`,n[e].join(`,`));if(r){let{transform:e,width:t,height:n}=this.#n(this.data.rotation,r);i.parentElement.setAttribute(`viewBox`,`0 0 ${t} ${n}`),i.setAttribute(`transform`,e)}}getElementsToTriggerPopup(){return this.#t}addHighlightArea(){this.container.classList.add(`highlightArea`)}},ru=class extends Il{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0}),this.annotationEditorType=Co.HIGHLIGHT}render(){let{data:{overlaidText:e,popupRef:t}}=this;if(!t&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this.container.classList.add(`highlightAnnotation`),this._editOnDoubleClick(),e){let t=document.createElement(`mark`);t.classList.add(`overlaidText`),t.textContent=e,this.container.append(t)}return this.container}},iu=class extends Il{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){let{data:{overlaidText:e,popupRef:t}}=this;if(!t&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this.container.classList.add(`underlineAnnotation`),e){let t=document.createElement(`u`);t.classList.add(`overlaidText`),t.textContent=e,this.container.append(t)}return this.container}},au=class extends Il{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){let{data:{overlaidText:e,popupRef:t}}=this;if(!t&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this.container.classList.add(`squigglyAnnotation`),e){let t=document.createElement(`u`);t.classList.add(`overlaidText`),t.textContent=e,this.container.append(t)}return this.container}},ou=class extends Il{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){let{data:{overlaidText:e,popupRef:t}}=this;if(!t&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this.container.classList.add(`strikeoutAnnotation`),e){let t=document.createElement(`s`);t.classList.add(`overlaidText`),t.textContent=e,this.container.append(t)}return this.container}},su=class extends Il{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0}),this.annotationEditorType=Co.STAMP}render(){return this.container.classList.add(`stampAnnotation`),this.container.setAttribute(`role`,`img`),!this.data.popupRef&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this._editOnDoubleClick(),this.container}},cu=class extends Il{#e=null;constructor(e){super(e,{isRenderable:!0});let{fileId:t,file:n}=this.data;this.filename=n.filename,this.content=n.content,this.fileId=t,this.linkService.eventBus?.dispatch(`fileattachmentannotation`,{source:this,attachmentId:this.fileId,...n})}render(){this.container.classList.add(`fileAttachmentAnnotation`);let{container:e,data:t}=this,n;t.hasAppearance||t.fillAlpha===0?n=document.createElement(`div`):(n=document.createElement(`img`),n.src=`${this.imageResourcesPath}annotation-${/paperclip/i.test(t.name)?`paperclip`:`pushpin`}.svg`,t.fillAlpha&&t.fillAlpha<1&&(n.style=`filter: opacity(${Math.round(t.fillAlpha*100)}%);`)),n.addEventListener(`dblclick`,this.#t.bind(this)),this.#e=n;let{isMac:r}=Ho.platform;return e.addEventListener(`keydown`,e=>{e.key===`Enter`&&(r?e.metaKey:e.ctrlKey)&&this.#t()}),!t.popupRef&&this.hasPopupData?(this.hasOwnCommentButton=!0,this._createPopup()):n.classList.add(`popupTriggerArea`),e.append(n),e}getElementsToTriggerPopup(){return this.#e}addHighlightArea(){this.container.classList.add(`highlightArea`)}async#t(){let{fileId:e,filename:t,content:n}=this,r=await this.linkService.getAttachmentContent(e)||n;r&&this.downloadManager?.openOrDownloadData(r,t)}},lu=class extends Il{#e=new AbortController;#t=null;#n=null;constructor(e){super(e,{isRenderable:!!e.data.richMedia})}render(){this.container.classList.add(`mediaAnnotation`);let{filename:e}=this.data.richMedia,t=document.createElement(`button`);return t.className=`mediaPlayButton`,t.type=`button`,t.title=t.ariaLabel=e,t.addEventListener(`click`,()=>this.#r(t),{signal:this.#e.signal}),this.container.append(t),this.container}async#r(e){let{fileId:t,filename:n,contentType:r}=this.data.richMedia;e.disabled=!0;let i;try{i=await this.linkService.getAttachmentContent(t)}catch{return}finally{e.disabled=!1}if(!i||!e.isConnected)return;let{signal:a}=this.#e,o=new Blob([i],{type:r});if(!/^(?:video|audio)\//.test(o.type))return;let s=URL.createObjectURL(o);this.#t=s;let c=o.type.startsWith(`audio/`),l=document.createElement(c?`audio`:`video`);if(this.#n=l,l.className=`mediaContent`,this._setBackgroundColor(l),l.src=s,l.title=n,l.controls=!0,l.autoplay=!0,l.tabIndex=0,c){let e=!1,t=!1,n=()=>{l.controls=e||t};this.container.addEventListener(`pointerenter`,()=>{e=!0,n()},{signal:a}),this.container.addEventListener(`pointerleave`,()=>{e=!1,n()},{signal:a}),this.container.addEventListener(`focusin`,()=>{t=!0,n()},{signal:a}),this.container.addEventListener(`focusout`,()=>{t=!1,n()},{signal:a})}l.addEventListener(`emptied`,()=>this.#i(s),{once:!0,signal:a}),e.replaceWith(l),l.play().catch(()=>{})}#i(e=this.#t){e&&e===this.#t&&(URL.revokeObjectURL(e),this.#t=null)}destroy(){this.#e.abort(),this.#n&&=(this.#n.pause(),this.#n.removeAttribute(`src`),this.#n.load(),null),this.#i()}},uu=class e{#e=null;#t=null;#n=null;#r=new Map;#i=null;#a=null;#o=[];#s=!1;zIndex=0;constructor({div:e,accessibilityManager:t,annotationCanvasMap:n,annotationEditorUIManager:r,page:i,viewport:a,structTreeLayer:o,commentManager:s,linkService:c,annotationStorage:l}){this.div=e,this.#e=t,this.#t=n,this.#i=o||null,this.#a=c||null,this.#n=l||new As,this.page=i,this.viewport=a,this._annotationEditorUIManager=r,this._commentManager=s||null}hasEditableAnnotations(){return this.#r.size>0}async render(e){let{annotations:t,optionalContentConfig:n}=e,r=this.div;Ct(r,this.viewport);let i=new Map,a=[],o={data:null,layer:r,linkService:this.#a,downloadManager:e.downloadManager,imageResourcesPath:e.imageResourcesPath||``,renderForms:e.renderForms!==!1,svgFactory:new jl,annotationStorage:this.#n,enableComment:e.enableComment===!0,enableScripting:e.enableScripting===!0,hasJSActions:e.hasJSActions,fieldObjects:e.fieldObjects,parent:this,elements:null};for(let e of t){if(e.noHTML)continue;let t=e.annotationType===Oo.POPUP;if(t){let t=i.get(e.id);if(!t)continue;if(!this._commentManager){a.push(e);continue}o.elements=t}else if(e.rect[2]===e.rect[0]||e.rect[3]===e.rect[1])continue;o.data=e;let r=Fl.create(o);if(!r.isRenderable)continue;t||(this.#o.push(r),e.popupRef&&i.getOrInsertComputed(e.popupRef,Go).push(r));let s=r.render();e.hidden&&(s.style.visibility=`hidden`),r.updateOC(n),r._isEditable&&(this.#r.set(r.data.id,r),this._annotationEditorUIManager?.renderAnnotationElement(r))}await this.#c();for(let e of a){let t=o.elements=i.get(e.id);o.data=e;let n=Fl.create(o);if(!n.isRenderable)continue;let r=n.render();n.contentElement.id=`${xo}${e.id}`,e.hidden&&(r.style.visibility=`hidden`),t.at(-1).container.after(r)}this.#l()}async#c(){if(this.#o.length===0)return;this.div.replaceChildren();let e=[];if(!this.#s){this.#s=!0;for(let{contentElement:t,data:{hidden:n,id:r,oc:i}}of this.#o){let a=t.id=`${xo}${r}`,o=t.localName===`a`&&!n&&!i;e.push(this.#i?.getAriaAttributes(a,{enableLinkOwnership:o}).then(e=>{if(e)for(let[n,r]of e)t.setAttribute(n,r)}))}}this.#o.sort(({data:{rect:[e,t,n,r]}},{data:{rect:[i,a,o,s]}})=>{if(e===n&&t===r)return 1;if(i===o&&a===s)return-1;let c=r,l=t,u=(t+r)/2,d=s,f=a,p=(a+s)/2;return u>=d&&p<=l?-1:p>=c&&u<=f?1:(e+n)/2-(i+o)/2});let t=document.createDocumentFragment();for(let e of this.#o)t.append(e.container),this._commentManager?(e.extraPopupElement?.popup||e.popup)?.renderCommentButton():e.extraPopupElement&&t.append(e.extraPopupElement.render());if(this.div.append(t),await Promise.all(e),this.#e){let e=await this.#i?.getAnnotationIds();for(let{contentElement:t}of this.#o)e?.has(t.id)||this.#e.addPointerInTextLayer(t,!1)}}async addLinkAnnotations(t){let n={data:null,layer:this.div,linkService:this.#a,svgFactory:new jl,parent:this};for(let r of t){r.borderStyle||=e._defaultBorderStyle,n.data=r;let t=Fl.create(n);t.isRenderable&&(t.render(),t.contentElement.id=`${xo}${r.id}`,this.#o.push(t))}await this.#c()}update({viewport:e,optionalContentConfig:t}){let n=this.div;this.viewport=e,Ct(n,{rotation:e.rotation});for(let e of this.#o)e.updateOC(t);this.#l(),n.hidden=!1}destroy(){for(let e of this.#o)e.destroy?.(),this.#e?.removePointerInTextLayer(e.contentElement);this.#o.length=0,this.#r.clear(),this.div.replaceChildren()}#l(){if(!this.#t)return;let e=this.div;for(let[t,n]of this.#t){let r=e.querySelector(`[data-annotation-id="${t}"]`);if(!r)continue;if(Array.isArray(n))for(let e of n)e.className=`annotationContent`,e.ariaHidden=!0;else n.className=`annotationContent`,n.ariaHidden=!0;let i=[];for(let e of r.children)e.nodeName===`CANVAS`&&i.push(e);for(let e of i)e.remove();let a=Array.isArray(n)?n[0]:n,{firstChild:o}=r;if(o?o.classList.contains(`annotationContent`)?o.after(a):o.before(a):r.append(a),Array.isArray(n)){let e=a;for(let t=1,r=n.length;t<r;t++)e.after(n[t]),e=n[t]}this.#t.delete(t);let s=this.#r.get(t);s&&(s._hasNoCanvas?(this._annotationEditorUIManager?.setMissingCanvas(t,r.id,n),s._hasNoCanvas=!1):s.canvas=n)}}refreshCanvases(){this.#l()}getEditableAnnotations(){return this.#r.values()}getEditableAnnotation(e){return this.#r.get(e)}addFakeAnnotation(e){let{div:t}=this,{id:n,rotation:r}=e,i=new Ll({data:{id:n,rect:e.getPDFRect(),rotation:r},editor:e,layer:t,parent:this,enableComment:!!this._commentManager,linkService:this.#a,annotationStorage:this.#n});return i.render(),i.contentElement.id=`${xo}${n}`,i.createOrUpdatePopup(),this.#o.push(i),i}removeAnnotation(e){let t=this.#o.findIndex(t=>t.data.id===e);if(t<0)return;let[n]=this.#o.splice(t,1);this.#e?.removePointerInTextLayer(n.contentElement)}updateFakeAnnotations(e){if(e.length!==0){for(let t of e)t.updateFakeAnnotationElement(this);this.#c()}}togglePointerEvents(e=!1){this.div.classList.toggle(`disabled`,!e)}static get _defaultBorderStyle(){return V(this,`_defaultBorderStyle`,Object.freeze({width:1,rawWidth:1,style:ko.SOLID,dashArray:[3],horizontalCornerRadius:0,verticalCornerRadius:0}))}},du=/\r\n?|\n/g,fu=class e extends Cs{#e=``;#t=`${this.id}-editor`;#n=null;#r;_colorPicker=null;static _freeTextDefaultContent=``;static _internalPadding=0;static _defaultColor=null;static _defaultFontSize=10;static get _keyboardManager(){let t=e.prototype,n=e=>e.isEmpty(),r=vs.TRANSLATE_SMALL,i=vs.TRANSLATE_BIG;return V(this,`_keyboardManager`,new gs([[[`ctrl+s`,`mac+meta+s`,`ctrl+p`,`mac+meta+p`],t.commitOrRemove,{bubbles:!0}],[[`ctrl+Enter`,`mac+meta+Enter`],t.commitOrRemove],[[`Escape`],t.commitOrRemove],[[`ArrowLeft`],t._translateEmpty,{args:[-r,0],checker:n}],[[`ctrl+ArrowLeft`,`mac+shift+ArrowLeft`],t._translateEmpty,{args:[-i,0],checker:n}],[[`ArrowRight`],t._translateEmpty,{args:[r,0],checker:n}],[[`ctrl+ArrowRight`,`mac+shift+ArrowRight`],t._translateEmpty,{args:[i,0],checker:n}],[[`ArrowUp`],t._translateEmpty,{args:[0,-r],checker:n}],[[`ctrl+ArrowUp`,`mac+shift+ArrowUp`],t._translateEmpty,{args:[0,-i],checker:n}],[[`ArrowDown`],t._translateEmpty,{args:[0,r],checker:n}],[[`ctrl+ArrowDown`,`mac+shift+ArrowDown`],t._translateEmpty,{args:[0,i],checker:n}]]))}static _type=`freetext`;static _editorType=Co.FREETEXT;constructor(t){super({...t,name:`freeTextEditor`}),this.color=t.color||e._defaultColor||Cs._defaultLineColor,this.#r=t.fontSize||e._defaultFontSize,this.annotationElementId||this._uiManager.a11yAlert(Cs._l10nAlert.freetext),this.canAddComment=!1}static initialize(e,t){Cs.initialize(e,t);let n=getComputedStyle(document.documentElement);this._internalPadding=parseFloat(n.getPropertyValue(`--freetext-padding`))}static updateDefaultParams(t,n){switch(t){case wo.FREETEXT_SIZE:e._defaultFontSize=n;break;case wo.FREETEXT_COLOR:e._defaultColor=n}}updateParams(e,t){switch(e){case wo.FREETEXT_SIZE:this.#i(t);break;case wo.FREETEXT_COLOR:this.#a(t)}}static get defaultPropertiesToUpdate(){return[[wo.FREETEXT_SIZE,e._defaultFontSize],[wo.FREETEXT_COLOR,e._defaultColor||Cs._defaultLineColor]]}get propertiesToUpdate(){return[[wo.FREETEXT_SIZE,this.#r],[wo.FREETEXT_COLOR,this.color]]}get toolbarButtons(){return this._colorPicker||=new Ol(this),[[`colorPicker`,this._colorPicker]]}get colorType(){return wo.FREETEXT_COLOR}#i(e){let t=e=>{this.editorDiv.style.fontSize=`calc(${e}px * var(--total-scale-factor))`,this.translate(0,-(e-this.#r)*this.parentScale),this.#r=e,this.#s()},n=this.#r;this.addCommands({cmd:t.bind(this,e),undo:t.bind(this,n),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:wo.FREETEXT_SIZE,overwriteIfSameType:!0,keepUndo:!0})}onUpdatedColor(){this.editorDiv.style.color=this.color,this._colorPicker?.update(this.color),super.onUpdatedColor()}#a(e){let t=e=>{this.color=e,this.onUpdatedColor()},n=this.color;this.addCommands({cmd:t.bind(this,e),undo:t.bind(this,n),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:wo.FREETEXT_COLOR,overwriteIfSameType:!0,keepUndo:!0})}_translateEmpty(e,t){this._uiManager.translateSelectedEditors(e,t,!0)}getInitialTranslation(){let t=this.parentScale;return[-e._internalPadding*t,-(e._internalPadding+this.#r)*t]}rebuild(){this.parent&&(super.rebuild(),this.div!==null&&(this.isAttachedToDOM||this.parent.add(this)))}enableEditMode(){if(!super.enableEditMode())return!1;this.overlayDiv.classList.remove(`enabled`),this.editorDiv.contentEditable=!0,this._isDraggable=!1,this.div.removeAttribute(`aria-activedescendant`),this.#n=new AbortController;let e=this._uiManager.combinedSignal(this.#n);return this.editorDiv.addEventListener(`keydown`,this.editorDivKeydown.bind(this),{signal:e}),this.editorDiv.addEventListener(`focus`,this.editorDivFocus.bind(this),{signal:e}),this.editorDiv.addEventListener(`blur`,this.editorDivBlur.bind(this),{signal:e}),this.editorDiv.addEventListener(`input`,this.editorDivInput.bind(this),{signal:e}),this.editorDiv.addEventListener(`paste`,this.editorDivPaste.bind(this),{signal:e}),!0}disableEditMode(){return super.disableEditMode()?(this.overlayDiv.classList.add(`enabled`),this.editorDiv.contentEditable=!1,this.div.setAttribute(`aria-activedescendant`,this.#t),this._isDraggable=!0,this.#n?.abort(),this.#n=null,this.div.focus({preventScroll:!0}),this.isEditing=!1,this.parent.div.classList.add(`freetextEditing`),!0):!1}focusin(e){this._focusEventsAllowed&&(super.focusin(e),e.target!==this.editorDiv&&this.editorDiv.focus())}onceAdded(e){this.width||(this.enableEditMode(),e&&this.editorDiv.focus(),this._initialOptions?.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()}#o(){let t=[];this.editorDiv.normalize();let n=null;for(let r of this.editorDiv.childNodes)(n?.nodeType!==Node.TEXT_NODE||r.nodeName!==`BR`)&&(t.push(e.#c(r)),n=r);return t.join(`
49
+ `)}#s(){let[e,t]=this.parentDimensions,n;if(this.isAttachedToDOM)n=this.div.getBoundingClientRect();else{let{currentLayer:e,div:t}=this,r=t.style.display,i=t.classList.contains(`hidden`);t.classList.remove(`hidden`),t.style.display=`hidden`,e.div.append(this.div),n=t.getBoundingClientRect(),t.remove(),t.style.display=r,t.classList.toggle(`hidden`,i)}this.rotation%180==this.parentRotation%180?(this.width=n.width/e,this.height=n.height/t):(this.width=n.height/e,this.height=n.width/t),this.fixAndSetPosition()}commit(){if(!this.isInEditMode())return;super.commit(),this.disableEditMode();let e=this.#e,t=this.#e=this.#o().trimEnd();if(e===t)return;let n=e=>{this.#e=e,e?(this.#l(),this._uiManager.rebuild(this),this.#s()):this.remove()};this.addCommands({cmd:()=>{n(t)},undo:()=>{n(e)},mustExec:!1}),this.#s()}shouldGetKeyboardEvents(){return this.isInEditMode()}enterInEditMode(){this.enableEditMode(),this.editorDiv.focus()}keydown(e){e.target===this.div&&e.key===`Enter`&&(this.enterInEditMode(),e.preventDefault())}editorDivKeydown(t){e._keyboardManager.exec(this,t)}editorDivFocus(e){this.isEditing=!0}editorDivBlur(e){this.isEditing=!1}editorDivInput(e){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)}get canChangeContent(){return!0}render(){if(this.div)return this.div;let e,t;(this._isCopy||this.annotationElementId)&&(e=this.x,t=this.y),super.render(),this.editorDiv=document.createElement(`div`),this.editorDiv.className=`internal`,this.editorDiv.setAttribute(`id`,this.#t),this.editorDiv.setAttribute(`data-l10n-id`,`pdfjs-free-text2`),this.editorDiv.setAttribute(`data-l10n-attrs`,`default-content`),this.enableEditing(),this.editorDiv.contentEditable=!0;let{style:n}=this.editorDiv;if(n.fontSize=`calc(${this.#r}px * var(--total-scale-factor))`,n.color=this.color,this.div.append(this.editorDiv),this.overlayDiv=document.createElement(`div`),this.overlayDiv.classList.add(`overlay`,`enabled`),this.div.append(this.overlayDiv),this._isCopy||this.annotationElementId){let[n,r]=this.parentDimensions;if(this.annotationElementId){let{position:i}=this._initialData,[a,o]=this.getInitialTranslation();[a,o]=this.pageTranslationToScreen(a,o);let[s,c]=this.pageDimensions,[l,u]=this.pageTranslation,d,f;switch(this.rotation){case 0:d=e+(i[0]-l)/s,f=t+this.height-(i[1]-u)/c;break;case 90:d=e+(i[0]-l)/s,f=t-(i[1]-u)/c,[a,o]=[o,-a];break;case 180:d=e-this.width+(i[0]-l)/s,f=t-(i[1]-u)/c,[a,o]=[-a,-o];break;case 270:d=e+(i[0]-l-this.height*c)/s,f=t+(i[1]-u-this.width*s)/c,[a,o]=[-o,a]}this.setAt(d*n,f*r,a,o)}else this._moveAfterPaste(e,t);this.#l(),this._isDraggable=!0,this.editorDiv.contentEditable=!1}else this._isDraggable=!1,this.editorDiv.contentEditable=!0;return this.div}static#c(e){return(e.nodeType===Node.TEXT_NODE?e.nodeValue:e.innerText).replaceAll(du,``)}editorDivPaste(t){let n=t.clipboardData||window.clipboardData,{types:r}=n;if(r.length===1&&r[0]===`text/plain`)return;t.preventDefault();let i=e.#d(n.getData(`text`)||``).replaceAll(du,`
50
+ `);if(!i)return;let a=window.getSelection();if(!a.rangeCount)return;this.editorDiv.normalize(),a.deleteFromDocument();let o=a.getRangeAt(0);if(!i.includes(`
51
+ `)){o.insertNode(document.createTextNode(i)),this.editorDiv.normalize(),a.collapseToStart();return}let{startContainer:s,startOffset:c}=o,l=[],u=[];if(s.nodeType===Node.TEXT_NODE){let t=s.parentElement;if(u.push(s.nodeValue.slice(c).replaceAll(du,``)),t!==this.editorDiv){let n=l;for(let r of this.editorDiv.childNodes)r===t?n=u:n.push(e.#c(r))}l.push(s.nodeValue.slice(0,c).replaceAll(du,``))}else if(s===this.editorDiv){let t=l,n=0;for(let r of this.editorDiv.childNodes)n++===c&&(t=u),t.push(e.#c(r))}this.#e=`${l.join(`
52
+ `)}${i}${u.join(`
53
+ `)}`,this.#l();let d=new Range,f=Math.sumPrecise(l.map(e=>e.length));for(let{firstChild:e}of this.editorDiv.childNodes)if(e.nodeType===Node.TEXT_NODE){let t=e.nodeValue.length;if(f<=t){d.setStart(e,f),d.setEnd(e,f);break}f-=t}a.removeAllRanges(),a.addRange(d)}#l(){if(this.editorDiv.replaceChildren(),this.#e)for(let e of this.#e.split(`
54
+ `)){let t=document.createElement(`div`);t.append(e?document.createTextNode(e):document.createElement(`br`)),this.editorDiv.append(t)}}#u(){return this.#e.replaceAll(`\xA0`,` `)}static#d(e){return e.replaceAll(` `,`\xA0`)}get contentDiv(){return this.editorDiv}getPDFRect(){let t=e._internalPadding*this.parentScale;return this.getRect(t,t)}static async deserialize(t,n,r){let i=null;if(t instanceof Yl){let{data:{defaultAppearanceData:{fontSize:e,fontColor:n},rect:r,rotation:a,id:o,popupRef:s,richText:c,contentsObj:l,creationDate:u,modificationDate:d},textContent:f,textPosition:p,parent:{page:{pageNumber:m}}}=t;if(!f?.length)return null;i=t={annotationType:Co.FREETEXT,color:Array.from(n),fontSize:e,value:f.join(`
55
+ `),position:p,pageIndex:m-1,rect:r.slice(0),rotation:a,annotationElementId:o,id:o,deleted:!1,popupRef:s,comment:l?.str||null,richText:c,creationDate:u,modificationDate:d}}let a=await super.deserialize(t,n,r);return a.#r=t.fontSize,a.color=H.makeHexColor(...t.color),a.#e=e.#d(t.value),a._initialData=i,t.comment&&a.setCommentData(t),a}serialize(e=!1){if(this.isEmpty())return null;if(this.deleted)return this.serializeDeleted();let t=Cs._colorManager.convert(this.isAttachedToDOM?getComputedStyle(this.editorDiv).color:this.color),n=Object.assign(super.serialize(e),{color:t,fontSize:this.#r,value:this.#u()});return this.addComment(n),e?(n.isCopy=!0,n):this.annotationElementId&&!this.#f(n)?null:(n.id=this.annotationElementId,n)}#f(e){let{value:t,fontSize:n,color:r,pageIndex:i}=this._initialData;return this.hasEditedComment||this._hasBeenMoved||e.value!==t||e.fontSize!==n||e.color.some((e,t)=>e!==r[t])||e.pageIndex!==i}renderAnnotationElement(e){let t=super.renderAnnotationElement(e);if(!t)return null;let{style:n}=t;n.fontSize=`calc(${this.#r}px * var(--total-scale-factor))`,n.color=this.color,t.replaceChildren();for(let e of this.#e.split(`
56
+ `)){let n=document.createElement(`div`);n.append(e?document.createTextNode(e):document.createElement(`br`)),t.append(n)}return e.updateEdited({rect:this.getPDFRect(),popup:this._uiManager.hasCommentManager()||this.hasEditedComment?this.comment:{text:this.#e}}),t}resetAnnotationElement(e){super.resetAnnotationElement(e),e.resetEdited()}},pu=class{#e=Object.create(null);updateProperty(e,t){this[e]=t,this.updateSVGProperty(e,t)}updateProperties(e){if(e)for(let[t,n]of Object.entries(e))t.startsWith(`_`)||this.updateProperty(t,n)}updateSVGProperty(e,t){this.#e[e]=t}toSVGProperties(){let e=this.#e;return this.#e=Object.create(null),{root:e}}reset(){this.#e=Object.create(null)}updateAll(e=this){this.updateProperties(e)}clone(){Ze(`Not implemented`)}},mu=class e extends Cs{#e=null;#t;_clipPathId=null;_colorPicker=null;_drawId=null;_drawOutlines=null;_focusDrawId=null;static _currentDrawId=-1;static _currentParent=null;static#n=null;static#r=null;static#i=null;static#a=null;static _INNER_MARGIN=3;constructor(e){super(e),this.#t=e.mustBeCommitted||!1,this._addOutlines(e)}onUpdatedColor(){this._colorPicker?.update(this.color),super.onUpdatedColor()}onUpdatedOpacity(){this._colorPicker?.updateOpacity?.(this.opacity)}_addOutlines(e){e.drawOutlines&&(this.#o(e),this.#m())}#o({drawOutlines:e,drawId:t,drawingOptions:n,clipPathId:r}){this._drawOutlines=e,this._drawingOptions||=n,this.annotationElementId||this._uiManager.a11yAlert(Cs._l10nAlert[this.editorType]),t>=0?(this._drawId=t,this._clipPathId=r??null,this.parent.drawLayer.finalizeDraw(t,e.defaultProperties),this.#c(this.parent)):this._drawId=this.#s(e,this.parent),this.#_(e.box)}#s(t,n){let{id:r,clipPathId:i}=n.drawLayer.draw(e._mergeSVGProperties(this._drawingOptions.toSVGProperties(),t.defaultSVGProperties),!1,this.constructor._hasClipPath);return this.constructor._hasClipPath&&(this._clipPathId=i),this.#c(n),r}#c(e){let t=this._drawOutlines.getFocusSVGProperties(this.#f);t&&(this._focusDrawId=e.drawLayer.drawOutline(t,this._drawOutlines.focusMustRemoveSelfIntersections))}#l(e=this.#f){this._focusDrawId!==null&&this.parent?.drawLayer.updateProperties(this._focusDrawId,this._drawOutlines.getFocusSVGProperties(e))}#u(e){this._focusDrawId!==null&&this.parent?.drawLayer.updateProperties(this._focusDrawId,{rootClass:e})}#d(){let{parent:e,_drawId:t,_focusDrawId:n,_isVisible:r}=this;if(!e||t===null)return;let i={hidden:!r};e.drawLayer.updateProperties(t,{rootClass:i}),n!==null&&e.drawLayer.updateProperties(n,{rootClass:i})}static _mergeSVGProperties(e,t){let n=new Set(Object.keys(e));for(let[r,i]of Object.entries(t))n.has(r)?Object.assign(e[r],i):e[r]=i;return e}static getDefaultDrawingOptions(e){Ze(`Not implemented`)}static get typesMap(){Ze(`Not implemented`)}static get isDrawer(){return!0}static get _hasClipPath(){return!1}static get _hasDrawClass(){return!0}static get supportMultipleDrawings(){return!1}get _drawRotation(){return this.rotation}get _opacityName(){return this.constructor.typesMap.get(this.opacityType)}get#f(){return(this.parentRotation-this._drawRotation+360)%360}static updateDefaultParams(t,n){let r=this.typesMap.get(t);r&&this._defaultDrawingOptions.updateProperty(r,n),this._currentParent&&(e.#n.updateProperty(r,n),this._currentParent.drawLayer.updateProperties(this._currentDrawId,this._defaultDrawingOptions.toSVGProperties()))}updateParams(e,t){let n=this.constructor.typesMap.get(e);n&&this._updateProperty(e,n,t)}static get defaultPropertiesToUpdate(){let e=[],t=this._defaultDrawingOptions;for(let[n,r]of this.typesMap)e.push([n,t[r]]);return e}get propertiesToUpdate(){let e=[],{_drawingOptions:t}=this;for(let[n,r]of this.constructor.typesMap)e.push([n,t[r]]);return e}_updateProperty(e,t,n){let r=this._drawingOptions,i=r[t],a=n=>{r.updateProperty(t,n);let i=this._drawOutlines.updateProperty(t,n);i&&this.#_(i),this.parent?.drawLayer.updateProperties(this._drawId,r.toSVGProperties()),e===this.colorType?this.onUpdatedColor():e===this.opacityType&&this.onUpdatedOpacity()};this.addCommands({cmd:a.bind(this,n),undo:a.bind(this,i),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:e,overwriteIfSameType:!0,keepUndo:!0})}_updateColorAndOpacity(e,t,n=this.colorAndOpacityType){let r=this.constructor.typesMap.get(this.colorType),i=this._opacityName,a=this._drawingOptions,o=a[r],s=a[i],c=(e,t)=>{a.updateProperty(r,e),a.updateProperty(i,t),this._drawOutlines.updateProperty(r,e),this._drawOutlines.updateProperty(i,t),this.parent?.drawLayer.updateProperties(this._drawId,a.toSVGProperties()),this.onUpdatedColor(),this.onUpdatedOpacity()};this.addCommands({cmd:c.bind(this,e,t),undo:c.bind(this,o,s),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:n,overwriteIfSameType:!0,keepUndo:!0})}_onResizing(){this.parent?.drawLayer.updateProperties(this._drawId,e._mergeSVGProperties(this._drawOutlines.getPathResizingSVGProperties(this.#g()),{bbox:this.#v()}))}_onResized(){this.parent?.drawLayer.updateProperties(this._drawId,e._mergeSVGProperties(this._drawOutlines.getPathResizedSVGProperties(this.#g()),{bbox:this.#v()})),this.#l()}_onTranslating(e,t){this.parent?.drawLayer.updateProperties(this._drawId,{bbox:this.#v()})}_onTranslated(){this.parent?.drawLayer.updateProperties(this._drawId,e._mergeSVGProperties(this._drawOutlines.getPathTranslatedSVGProperties(this.#g(),this.parentDimensions),{bbox:this.#v()}))}_onStartDragging(){this.parent?.drawLayer.updateProperties(this._drawId,{rootClass:{moving:!0}})}_onStopDragging(){this.parent?.drawLayer.updateProperties(this._drawId,{rootClass:{moving:!1}})}get _mustBeDisabledOnCommit(){return!0}commit(){super.commit(),this._mustBeDisabledOnCommit&&(this.disableEditMode(),this.disableEditing())}disableEditing(){super.disableEditing(),this.div.classList.toggle(`disabled`,!0)}enableEditing(){super.enableEditing(),this.div.classList.toggle(`disabled`,!1)}getBaseTranslation(){return[0,0]}get isResizable(){return!0}onceAdded(e){this.annotationElementId||this.parent.addUndoableEditor(this),this._isDraggable=!0,this.#t&&(this.#t=!1,this.commit(),this.parent.setSelected(this),e&&this.isOnScreen&&this.div.focus())}remove(){this._uiManager.removeShouldRescale(this),this.#p(),super.remove()}rebuild(){this.parent&&(super.rebuild(),this.div!==null&&(this.#m(),this.#_(this._drawOutlines.box),this.isAttachedToDOM||this.parent.add(this)))}setParent(e){let t=!1;this.parent&&!e?(this._uiManager.removeShouldRescale(this),this.#p()):e&&(this._uiManager.addShouldRescale(this),this.#m(e),t=!this.parent&&this.div?.classList.contains(`selectedEditor`)),super.setParent(e),this.#d(),t&&this.select()}#p(){if(this._drawId===null||!this.parent)return;let{drawLayer:e}=this.parent;e.remove(this._drawId),this._drawId=null,this._focusDrawId!==null&&(e.remove(this._focusDrawId),this._focusDrawId=null),this._drawingOptions.reset()}#m(e=this.parent){if(this._drawId===null||this.parent!==e){if(this._drawId!==null){let{drawLayer:t}=this.parent;t.updateParent(this._drawId,e.drawLayer),this._focusDrawId!==null&&t.updateParent(this._focusDrawId,e.drawLayer)}else this._drawingOptions.updateAll(),this._drawId=this.#s(this._drawOutlines,e),this._clipPathId&&this.#e&&(this.#e.style.clipPath=this._clipPathId)}}#h([e,t,n,r]){let{parentDimensions:[i,a],_drawRotation:o}=this;switch(o){case 90:return[t,1-e,a/i*n,i/a*r];case 180:return[1-e,1-t,n,r];case 270:return[1-t,e,a/i*n,i/a*r];default:return[e,t,n,r]}}#g(){let{x:e,y:t,width:n,height:r,parentDimensions:[i,a],_drawRotation:o}=this;switch(o){case 90:return[1-t,e,i/a*n,a/i*r];case 180:return[1-e,1-t,n,r];case 270:return[t,1-e,i/a*n,a/i*r];default:return[e,t,n,r]}}#_(e){[this.x,this.y,this.width,this.height]=this.#h(e),this.div&&(this.fixAndSetPosition(),this.setDims()),this._onResized()}#v(e=this.parentRotation){let{x:t,y:n,width:r,height:i,_drawRotation:a,parentDimensions:[o,s]}=this;switch((a*4+e)/90){case 1:return[1-n-i,t,i,r];case 2:return[1-t-r,1-n-i,r,i];case 3:return[n,1-t-r,i,r];case 4:return[t,n-o/s*r,s/o*i,o/s*r];case 5:return[1-n,t,o/s*r,s/o*i];case 6:return[1-t-s/o*i,1-n,s/o*i,o/s*r];case 7:return[n-o/s*r,1-t-s/o*i,o/s*r,s/o*i];case 8:return[t-r,n-i,r,i];case 9:return[1-n,t-r,i,r];case 10:return[1-t,1-n,r,i];case 11:return[n-i,1-t,i,r];case 12:return[t-s/o*i,n,s/o*i,o/s*r];case 13:return[1-n-o/s*r,t-s/o*i,o/s*r,s/o*i];case 14:return[1-t,1-n-o/s*r,s/o*i,o/s*r];case 15:return[n,1-t,o/s*r,s/o*i];default:return[t,n,r,i]}}rotate(t=this.parentRotation){if(!this.parent||this._drawId===null)return;let n=(t-this._drawRotation+360)%360;this.parent.drawLayer.updateProperties(this._drawId,e._mergeSVGProperties({bbox:this.#v(t)},this._drawOutlines.updateRotation(n))),this.#l(n)}show(e=this._isVisible){super.show(e),this.#d()}select(){super.select(),this.#u({hovered:!1,selected:!0})}unselect(){super.unselect(),this.#u({selected:!1})}pointerover(){this.isSelected||this.#u({hovered:!0})}pointerleave(){this.isSelected||this.#u({hovered:!1})}onScaleChanging(){if(!this.parent)return;let e=this._drawOutlines.updateParentDimensions(this.parentDimensions,this.parent.scale);e&&this.#_(e)}static onScaleChangingWhenDrawing(){}render(){if(this.div)return this.div;let e,t;this._isCopy&&(e=this.x,t=this.y);let n=super.render();this.constructor._hasDrawClass&&n.classList.add(`draw`);let r=this.#e=document.createElement(`div`);return n.append(r),r.setAttribute(`aria-hidden`,`true`),r.className=`internal`,this._clipPathId&&(r.style.clipPath=this._clipPathId),Mt(this,r,[`pointerover`,`pointerleave`]),this.setDims(),this._uiManager.addShouldRescale(this),this.disableEditing(),this._isCopy&&this._moveAfterPaste(e,t),n}static createDrawerInstance(e){Ze(`Not implemented`)}static _getDrawingTarget(e,{target:t}){return t}static _getPointerCoords({offsetX:e,offsetY:t,clientX:n,clientY:r},i=null){if(!i)return[e,t];let a=n-i.clientX,o=r-i.clientY;switch(this._currentParent.viewport.rotation){case 90:[a,o]=[o,-a];break;case 180:[a,o]=[-a,-o];break;case 270:[a,o]=[-o,a]}return[i.offsetX+a,i.offsetY+o]}static _addDrawingListeners(e,t){}static _endDrawingSession(e=!1){return this._currentParent.endDrawingSession(e)}static startDrawing(t,n,r,i){let{pointerId:a,pointerType:o}=i;if(fs.isInitializedAndDifferentPointerType(o))return;let s=this._getDrawingTarget(t,i),[c,l]=this._getPointerCoords(i),{viewport:{rotation:u}}=t,{x:d,y:f,width:p,height:m}=s.getBoundingClientRect(),h=e.#r=new AbortController,g=t.combinedSignal(h);if(fs.setPointer(o,a),window.addEventListener(`pointerup`,e=>{fs.isSamePointerIdOrRemove(e.pointerId)&&this._endDraw(e)},{signal:g}),window.addEventListener(`pointercancel`,e=>{fs.isSamePointerIdOrRemove(e.pointerId)&&this._endDrawingSession()},{signal:g}),window.addEventListener(`pointerdown`,t=>{fs.isSamePointerType(t.pointerType)&&(fs.initializeAndAddPointerId(t.pointerId),e.#n.isCancellable()&&(e.#n.removeLastElement(),e.#n.isEmpty()?this._endDrawingSession(!0):this._endDraw(null)))},{capture:!0,passive:!1,signal:g}),window.addEventListener(`contextmenu`,gt,{signal:g}),s.addEventListener(`pointermove`,this._drawMove.bind(this),{signal:g}),s.addEventListener(`touchmove`,e=>{fs.isSameTimeStamp(e.timeStamp)&&_t(e)},{signal:g}),this._addDrawingListeners(s,g),t.toggleDrawing(),n._editorUndoBar?.hide(),e.#n){t.drawLayer.updateProperties(this._currentDrawId,e.#n.startNew(c,l,p,m,u));return}n.updateUIForDefaultProperties(this),e.#n=this.createDrawerInstance({x:c,y:l,box:[d,f,p,m],rotation:u,parent:t,isLTR:r}),e.#i=this.getDefaultDrawingOptions(),this._currentParent=t;let{id:_,clipPathId:v}=t.drawLayer.draw(this._mergeSVGProperties(e.#i.toSVGProperties(),e.#n.defaultSVGProperties),!0,this._hasClipPath);this._currentDrawId=_,e.#a=this._hasClipPath?v:null}static _drawMove(t){if(fs.isSameTimeStamp(t.timeStamp),!e.#n||!fs.isSamePointerId(t.pointerId))return;if(fs.isUsingMultiplePointers()){this._endDraw(t);return}let n,r=t.getCoalescedEvents?.();if(r?.length){let i=[];for(let e of r)i.push(...this._getPointerCoords(e,t));n=e.#n.addPoints(i)}else n=e.#n.add(...this._getPointerCoords(t));this._currentParent.drawLayer.updateProperties(this._currentDrawId,n),fs.setTimeStamp(t.timeStamp),_t(t)}static _cleanup(t){t&&(this._currentDrawId=-1,this._currentParent=null,e.#n=null,e.#i=null,e.#a=null,fs.clearTimeStamp()),e.#r&&(e.#r.abort(),e.#r=null,fs.clearPointerIds())}static _endDraw(t){let n=this._currentParent;if(n){if(n.toggleDrawing(!0),this._cleanup(!1),n.drawLayer.updateProperties(this._currentDrawId,t?.target===n.div?e.#n.end(...this._getPointerCoords(t)):e.#n.end()),this.supportMultipleDrawings){let t=e.#n,r=this._currentDrawId,i=t.getLastElement();n.addCommands({cmd:()=>{n.drawLayer.updateProperties(r,t.setLastElement(i))},undo:()=>{n.drawLayer.updateProperties(r,t.removeLastElement())},mustExec:!1,type:wo.DRAW_STEP})}else this.endDrawing(!1)}}static endDrawing(t){let n=this._currentParent;if(!n)return null;if(n.toggleDrawing(!0),n.cleanUndoStack(wo.DRAW_STEP),!e.#n.isEmpty()){let{pageDimensions:[r,i],scale:a}=n,o=n.createAndAddNewEditor({offsetX:0,offsetY:0},!1,{drawId:this._currentDrawId,clipPathId:e.#a,drawOutlines:e.#n.getOutlines(r*a,i*a,a,this._INNER_MARGIN),drawingOptions:e.#i,mustBeCommitted:!t});return this._cleanup(!0),o}return n.drawLayer.remove(this._currentDrawId),this._cleanup(!0),null}createDrawingOptions(e){}static deserializeDraw(e,t,n,r,i,a,o){Ze(`Not implemented`)}static async deserialize(e,t,n){let{rawDims:{pageWidth:r,pageHeight:i,pageX:a,pageY:o}}=t.viewport,s=this.deserializeDraw(a,o,r,i,this._INNER_MARGIN,e,n),c=await super.deserialize(e,t,n);return c.createDrawingOptions(e),c.#o({drawOutlines:s}),c.#m(),c.onScaleChanging(),c.rotate(),c}serializeDraw(e){let[t,n]=this.pageTranslation,[r,i]=this.pageDimensions;return this._drawOutlines.serialize([t,n,r,i],e)}renderAnnotationElement(e){return e.updateEdited({rect:this.getPDFRect()}),null}static canCreateNewEmptyEditor(){return!1}},U=class{static PRECISION=1e-4;focusOutline=null;toSVGPath(){Ze("Abstract method `toSVGPath` must be implemented.")}get box(){Ze("Abstract getter `box` must be implemented.")}serialize(e,t){Ze("Abstract method `serialize` must be implemented.")}get defaultSVGProperties(){Ze("Abstract getter `defaultSVGProperties` must be implemented.")}get defaultProperties(){return this.defaultSVGProperties}getFocusSVGProperties(e){return null}get focusMustRemoveSelfIntersections(){return!1}updateProperty(e,t){return null}updateParentDimensions(e,t){return null}serializeQuadPoints(e,t){return null}updateRotation(e){return{}}getPathResizingSVGProperties(e){return{}}getPathResizedSVGProperties(e){return{}}getPathTranslatedSVGProperties(e,t){return{}}static _rotateBox([e,t,n,r],i){switch(i){case 90:return[1-t-r,e,r,n];case 180:return[1-e-n,1-t-r,n,r];case 270:return[t,1-e-n,r,n]}return[e,t,n,r]}static _rescale(e,t,n,r,i,a){a||=new Float32Array(e.length);for(let o=0,s=e.length;o<s;o+=2)a[o]=t+e[o]*r,a[o+1]=n+e[o+1]*i;return a}static _rescaleAndSwap(e,t,n,r,i,a){a||=new Float32Array(e.length);for(let o=0,s=e.length;o<s;o+=2)a[o]=t+e[o+1]*r,a[o+1]=n+e[o]*i;return a}static _translate(e,t,n,r){r||=new Float32Array(e.length);for(let i=0,a=e.length;i<a;i+=2)r[i]=t+e[i],r[i+1]=n+e[i+1];return r}static svgRound(e){return Math.round(e*1e4)}static _normalizePoint(e,t,n,r,i){switch(i){case 90:return[1-t/n,e/r];case 180:return[1-e/n,1-t/r];case 270:return[t/n,1-e/r];default:return[e/n,t/r]}}static createBezierPoints(e,t,n,r,i,a){return[(e+5*n)/6,(t+5*r)/6,(5*n+i)/6,(5*r+a)/6,(n+i)/2,(r+a)/2]}},hu=class e{#e;#t=[];#n;#r;#i=[];#a=new Float32Array(18);#o;#s;#c;#l;#u;#d;#f=[];static#p=8;static#m=2;static#h=e.#p+e.#m;constructor(t,n,r,i,a,o,s=0){this.#e=r,this.#d=a*i,this.#r=o,this.#a.set([NaN,NaN,NaN,NaN,t,n],6),this.#n=s,this.#l=e.#p*i,this.#c=e.#h*i,this.#u=i,this.#f.push(t,n)}isEmpty(){return isNaN(this.#a[8])}isCancellable(){return this.#f.length<=10}removeLastElement(){return this.#a.fill(NaN),this.#i.length=this.#t.length=this.#f.length=0,{path:{d:``}}}#g(){let e=this.#a.subarray(4,6),t=this.#a.subarray(16,18),[n,r,i,a]=this.#e;return[(this.#o+(e[0]-t[0])/2-n)/i,(this.#s+(e[1]-t[1])/2-r)/a,(this.#o+(t[0]-e[0])/2-n)/i,(this.#s+(t[1]-e[1])/2-r)/a]}add(e,t){this.#o=e,this.#s=t;let[n,r,i,a]=this.#e,[o,s,c,l]=this.#a.subarray(8,12),u=e-c,d=t-l,f=Math.hypot(u,d);if(f<this.#c)return!1;let p=f-this.#l,m=p/f,h=m*u,g=m*d,_=o,v=s;o=c,s=l,c+=h,l+=g,this.#f?.push(e,t);let y=-g/p,b=h/p,x=y*this.#d,S=b*this.#d;return this.#a.set(this.#a.subarray(2,8),0),this.#a.set([c+x,l+S],4),this.#a.set(this.#a.subarray(14,18),12),this.#a.set([c-x,l-S],16),isNaN(this.#a[6])?(this.#i.length===0&&(this.#a.set([o+x,s+S],2),this.#i.push(NaN,NaN,NaN,NaN,(o+x-n)/i,(s+S-r)/a),this.#a.set([o-x,s-S],14),this.#t.push(NaN,NaN,NaN,NaN,(o-x-n)/i,(s-S-r)/a)),this.#a.set([_,v,o,s,c,l],6),!this.isEmpty()):(this.#a.set([_,v,o,s,c,l],6),Math.abs(Math.atan2(v-s,_-o)-Math.atan2(g,h))<Math.PI/2?([o,s,c,l]=this.#a.subarray(2,6),this.#i.push(NaN,NaN,NaN,NaN,((o+c)/2-n)/i,((s+l)/2-r)/a),[o,s,_,v]=this.#a.subarray(14,18),this.#t.push(NaN,NaN,NaN,NaN,((_+o)/2-n)/i,((v+s)/2-r)/a),!0):([_,v,o,s,c,l]=this.#a.subarray(0,6),this.#i.push(((_+5*o)/6-n)/i,((v+5*s)/6-r)/a,((5*o+c)/6-n)/i,((5*s+l)/6-r)/a,((o+c)/2-n)/i,((s+l)/2-r)/a),[c,l,o,s,_,v]=this.#a.subarray(12,18),this.#t.push(((_+5*o)/6-n)/i,((v+5*s)/6-r)/a,((5*o+c)/6-n)/i,((5*s+l)/6-r)/a,((o+c)/2-n)/i,((s+l)/2-r)/a),!0))}toSVGPath(){if(this.isEmpty())return``;let e=this.#i,t=this.#t;if(isNaN(this.#a[6])&&!this.isEmpty())return this.#_();let n=[];n.push(`M${e[4]} ${e[5]}`);for(let t=6;t<e.length;t+=6)isNaN(e[t])?n.push(`L${e[t+4]} ${e[t+5]}`):n.push(`C${e[t]} ${e[t+1]} ${e[t+2]} ${e[t+3]} ${e[t+4]} ${e[t+5]}`);this.#y(n);for(let e=t.length-6;e>=6;e-=6)isNaN(t[e])?n.push(`L${t[e+4]} ${t[e+5]}`):n.push(`C${t[e]} ${t[e+1]} ${t[e+2]} ${t[e+3]} ${t[e+4]} ${t[e+5]}`);return this.#v(n),n.join(` `)}#_(){let[e,t,n,r]=this.#e,[i,a,o,s]=this.#g();return`M${(this.#a[2]-e)/n} ${(this.#a[3]-t)/r} L${(this.#a[4]-e)/n} ${(this.#a[5]-t)/r} L${i} ${a} L${o} ${s} L${(this.#a[16]-e)/n} ${(this.#a[17]-t)/r} L${(this.#a[14]-e)/n} ${(this.#a[15]-t)/r} Z`}#v(e){let t=this.#t;e.push(`L${t[4]} ${t[5]} Z`)}#y(e){let[t,n,r,i]=this.#e,a=this.#a.subarray(4,6),o=this.#a.subarray(16,18),[s,c,l,u]=this.#g();e.push(`L${(a[0]-t)/r} ${(a[1]-n)/i} L${s} ${c} L${l} ${u} L${(o[0]-t)/r} ${(o[1]-n)/i}`)}newFreeDrawOutline(e,t,n,r,i,a){return new gu(e,t,n,r,i,a)}getOutlines(){let e=this.#i,t=this.#t,n=this.#a,[r,i,a,o]=this.#e,s=new Float32Array((this.#f?.length??0)+2);for(let e=0,t=s.length-2;e<t;e+=2)s[e]=(this.#f[e]-r)/a,s[e+1]=(this.#f[e+1]-i)/o;if(s[s.length-2]=(this.#o-r)/a,s[s.length-1]=(this.#s-i)/o,isNaN(n[6])&&!this.isEmpty())return this.#b(s);let c=new Float32Array(this.#i.length+24+this.#t.length),l=e.length;for(let t=0;t<l;t+=2)isNaN(e[t])?c[t]=c[t+1]=NaN:(c[t]=e[t],c[t+1]=e[t+1]);l=this.#S(c,l);for(let e=t.length-6;e>=6;e-=6)for(let n=0;n<6;n+=2)isNaN(t[e+n])?(c[l]=c[l+1]=NaN,l+=2):(c[l]=t[e+n],c[l+1]=t[e+n+1],l+=2);return this.#x(c,l),this.newFreeDrawOutline(c,s,this.#e,this.#u,this.#n,this.#r)}#b(e){let t=this.#a,[n,r,i,a]=this.#e,[o,s,c,l]=this.#g(),u=new Float32Array(36);return u.set([NaN,NaN,NaN,NaN,(t[2]-n)/i,(t[3]-r)/a,NaN,NaN,NaN,NaN,(t[4]-n)/i,(t[5]-r)/a,NaN,NaN,NaN,NaN,o,s,NaN,NaN,NaN,NaN,c,l,NaN,NaN,NaN,NaN,(t[16]-n)/i,(t[17]-r)/a,NaN,NaN,NaN,NaN,(t[14]-n)/i,(t[15]-r)/a],0),this.newFreeDrawOutline(u,e,this.#e,this.#u,this.#n,this.#r)}#x(e,t){let n=this.#t;return e.set([NaN,NaN,NaN,NaN,n[4],n[5]],t),t+=6}#S(e,t){let n=this.#a.subarray(4,6),r=this.#a.subarray(16,18),[i,a,o,s]=this.#e,[c,l,u,d]=this.#g();return e.set([NaN,NaN,NaN,NaN,(n[0]-i)/o,(n[1]-a)/s,NaN,NaN,NaN,NaN,c,l,NaN,NaN,NaN,NaN,u,d,NaN,NaN,NaN,NaN,(r[0]-i)/o,(r[1]-a)/s],t),t+=24}},gu=class extends U{#e;#t=new Float32Array(4);#n;#r;#i;#a;#o;constructor(e,t,n,r,i,a){super(),this.#o=e,this.#i=t,this.#e=n,this.#a=r,this.#n=i,this.#r=a,this.firstPoint=[NaN,NaN],this.lastPoint=[NaN,NaN],this.#s(a);let[o,s,c,l]=this.#t;for(let t=0,n=e.length;t<n;t+=2)e[t]=(e[t]-o)/c,e[t+1]=(e[t+1]-s)/l;for(let e=0,n=t.length;e<n;e+=2)t[e]=(t[e]-o)/c,t[e+1]=(t[e+1]-s)/l}toSVGPath(){let e=[`M${this.#o[4]} ${this.#o[5]}`];for(let t=6,n=this.#o.length;t<n;t+=6)isNaN(this.#o[t])?e.push(`L${this.#o[t+4]} ${this.#o[t+5]}`):e.push(`C${this.#o[t]} ${this.#o[t+1]} ${this.#o[t+2]} ${this.#o[t+3]} ${this.#o[t+4]} ${this.#o[t+5]}`);return e.push(`Z`),e.join(` `)}serialize([e,t,n,r],i){let a=n-e,o=r-t,s,c;switch(i){case 0:s=U._rescale(this.#o,e,r,a,-o),c=U._rescale(this.#i,e,r,a,-o);break;case 90:s=U._rescaleAndSwap(this.#o,e,t,a,o),c=U._rescaleAndSwap(this.#i,e,t,a,o);break;case 180:s=U._rescale(this.#o,n,t,-a,o),c=U._rescale(this.#i,n,t,-a,o);break;case 270:s=U._rescaleAndSwap(this.#o,n,r,-a,-o),c=U._rescaleAndSwap(this.#i,n,r,-a,-o)}return{outline:Array.from(s),points:[Array.from(c)]}}#s(e){let t=this.#o,n=t[4],r=t[5],i=[n,r,n,r],a=n,o=r,s=n,c=r,l=e?Math.max:Math.min,u=new Float32Array(4);for(let e=6,d=t.length;e<d;e+=6){let d=t[e+4],f=t[e+5];isNaN(t[e])?(H.pointBoundingBox(d,f,i),o>f?(a=d,o=f):o===f&&(a=l(a,d)),c<f?(s=d,c=f):c===f&&(s=l(s,d))):(u.set(ho,0),H.bezierBoundingBox(n,r,...t.slice(e,e+6),u),H.rectBoundingBox(...u,i),o>u[1]?(a=u[0],o=u[1]):o===u[1]&&(a=l(a,u[0])),c<u[3]?(s=u[2],c=u[3]):c===u[3]&&(s=l(s,u[2]))),n=d,r=f}let d=this.#t;d[0]=i[0]-this.#n,d[1]=i[1]-this.#n,d[2]=i[2]-i[0]+2*this.#n,d[3]=i[3]-i[1]+2*this.#n,this.firstPoint=[a,o],this.lastPoint=[s,c]}get box(){return this.#t}newOutliner(e,t,n,r,i,a,o=0){return new hu(e,t,n,r,i,a,o)}updateThickness(e){let t=this.getNewOutline(e);return this.#o=t.#o,this.#i=t.#i,this.#t.set(t.#t),this.firstPoint=t.firstPoint,this.lastPoint=t.lastPoint,this.#t}getNewOutline(e,t){let[n,r,i,a]=this.#t,[o,s,c,l]=this.#e,u=i*c,d=a*l,f=n*c+o,p=r*l+s,m=this.#i,h=this.newOutliner(m[0]*u+f,m[1]*d+p,this.#e,this.#a,e,this.#r,t??this.#n);for(let e=2,t=m.length;e<t;e+=2)h.add(m[e]*u+f,m[e+1]*d+p);return h.getOutlines()}},_u=class{#e;#t;#n;#r=[];#i=[];constructor(e,t=0,n=0,r=!0){let i=ho.slice(),a=10**-4;for(let{x:n,y:r,width:o,height:s}of e){let e=Math.floor((n-t)/a)*a,c=Math.ceil((n+o+t)/a)*a,l=Math.floor((r-t)/a)*a,u=Math.ceil((r+s+t)/a)*a,d=[e,l,u,!0],f=[c,l,u,!1];this.#r.push(d,f),H.rectBoundingBox(e,l,c,u,i)}let o=i[2]-i[0]+2*n,s=i[3]-i[1]+2*n,c=i[0]-n,l=i[1]-n,u=r?-1/0:1/0,d=1/0,f=this.#r.at(r?-1:-2),p=[f[0],f[2]];for(let e of this.#r){let[t,n,i,a]=e;!a&&r?n<d?(d=n,u=t):n===d&&(u=Math.max(u,t)):a&&!r&&(n<d?(d=n,u=t):n===d&&(u=Math.min(u,t))),e[0]=(t-c)/o,e[1]=(n-l)/s,e[2]=(i-l)/s}this.#e=new Float32Array([c,l,o,s]),this.#t=[u,d],this.#n=p}getOutlines(){this.#r.sort((e,t)=>e[0]-t[0]||e[1]-t[1]||e[2]-t[2]);let e=[];for(let t of this.#r)t[3]?(e.push(...this.#l(t)),this.#s(t)):(this.#c(t),e.push(...this.#l(t)));return this.#a(e)}#a(e){let t=[],n=new Set;for(let n of e){let[e,r,i]=n;t.push([e,r,n],[e,i,n])}t.sort((e,t)=>e[1]-t[1]||e[0]-t[0]);for(let e=0,r=t.length;e<r;e+=2){let r=t[e][2],i=t[e+1][2];r.push(i),i.push(r),n.add(r),n.add(i)}let r=[];for(;n.size>0;){let e=n.values().next().value,[t,i,a,o,s]=e;n.delete(e);let c=t,l=i,u=[t,a];for(r.push(u);;){let e;if(n.has(o))e=o;else if(n.has(s))e=s;else break;n.delete(e),[t,i,a,o,s]=e,c!==t&&(u.push(c,l,t,l===i?i:a),c=t),l=l===i?a:i}u.push(c,l)}return new vu(r,this.#e,this.#t,this.#n)}#o(e){let t=this.#i,n=0,r=t.length-1;for(;n<=r;){let i=n+r>>1,a=t[i][0];if(a===e)return i;a<e?n=i+1:r=i-1}return r+1}#s([,e,t]){let n=this.#o(e);this.#i.splice(n,0,[e,t])}#c([,e,t]){let n=this.#o(e);for(let r=n;r<this.#i.length;r++){let[n,i]=this.#i[r];if(n!==e)break;if(n===e&&i===t){this.#i.splice(r,1);return}}for(let r=n-1;r>=0;r--){let[n,i]=this.#i[r];if(n!==e)break;if(n===e&&i===t){this.#i.splice(r,1);return}}}#l(e){let[t,n,r]=e,i=[[t,n,r]],a=this.#o(r);for(let e=0;e<a;e++){let[n,r]=this.#i[e];for(let e=0,a=i.length;e<a;e++){let[,o,s]=i[e];if(!(r<=o||s<=n)){if(o>=n){if(s>r)i[e][1]=r;else{if(a===1)return[];i.splice(e,1),e--,a--}}else i[e][2]=n,s>r&&i.push([t,r,s])}}}return i}},vu=class extends U{#e;#t=null;#n;constructor(e,t,n,r){super(),this.#n=e,this.#e=t,this.firstPoint=n,this.lastPoint=r}static build(e,t){let n=new _u(e,.001).getOutlines();return n.#t=e,n.focusOutline=new _u(e,.0025,.001,t).getOutlines(),n}get isFree(){return!1}get defaultSVGProperties(){return kn(this)}getFocusSVGProperties(e){return An(this,e)}updateRotation(e){return{root:{"data-main-rotation":e}}}serializeQuadPoints([e,t],[n,r]){let i=this.#t,a=new Float32Array(i.length*8),o=0;for(let{x:s,y:c,width:l,height:u}of i){let i=s*n+e,d=(1-c)*r+t;a[o]=a[o+4]=i,a[o+1]=a[o+3]=d,a[o+2]=a[o+6]=i+l*n,a[o+5]=a[o+7]=d-u*r,o+=8}return a}toSVGPath(){let e=[];for(let t of this.#n){let[n,r]=t;e.push(`M${n} ${r}`);for(let i=2;i<t.length;i+=2){let a=t[i],o=t[i+1];a===n?(e.push(`V${o}`),r=o):o===r&&(e.push(`H${a}`),n=a)}e.push(`Z`)}return e.join(` `)}serialize([e,t,n,r],i){let a=[],o=n-e,s=r-t;for(let t of this.#n){let n=Array(t.length);for(let i=0;i<t.length;i+=2)n[i]=e+t[i]*o,n[i+1]=r-t[i+1]*s;a.push(n)}return a}get box(){return this.#e}},yu=class extends hu{newFreeDrawOutline(e,t,n,r,i,a){return new xu(e,t,n,r,i,a)}},bu=class{#e;#t;constructor(e,t,n,r,i,a,o){this.#e=new yu(e,t,n,r,i,a,o),this.#t=i}add(e,t){return this.#e.add(e,t)?{path:{d:this.#e.toSVGPath()}}:null}addPoints(e){let t=!1;for(let n=0,r=e.length;n<r;n+=2)t=this.#e.add(e[n],e[n+1])||t;return t?{path:{d:this.#e.toSVGPath()}}:null}end(e,t){return e===void 0?null:this.add(e,t)}isEmpty(){return this.#e.isEmpty()}isCancellable(){return this.#e.isCancellable()}removeLastElement(){return this.#e.removeLastElement()}updateProperty(e,t){return null}getOutlines(){let e=this.#e.getOutlines();return e.buildFocusOutline(2*this.#t),e}get defaultSVGProperties(){return{bbox:[0,0,1,1],root:{viewBox:`0 0 1 1`},rootClass:{highlight:!0,free:!0},path:{d:this.#e.toSVGPath()}}}},xu=class e extends gu{static#e=1.5;newOutliner(e,t,n,r,i,a,o=0){return new yu(e,t,n,r,i,a,o)}get isFree(){return!0}buildFocusOutline(t){this.focusOutline=this.getNewOutline(t/2+e.#e,.0025)}get defaultSVGProperties(){return kn(this)}getFocusSVGProperties(e){return An(this,e)}get focusMustRemoveSelfIntersections(){return!0}updateRotation(e){return{root:{"data-main-rotation":e}}}updateProperty(e,t){if(e!==`thickness`)return null;let n=this.updateThickness(t/2);return this.buildFocusOutline(t),n}getPathResizedSVGProperties(){return{path:{d:this.toSVGPath()}}}},Su=class e extends pu{constructor(e=null){super(),super.updateProperties(e)}updateSVGProperty(e,t){e!==`thickness`&&super.updateSVGProperty(e,t)}clone(){let t=new e;return t.updateAll(this),t}},Cu=class e extends mu{#e=null;#t=0;#n=null;#r=0;#i=``;#a=``;static _DEFAULT_OPACITY=1;static _DEFAULT_THICKNESS=12;static _defaultDrawingOptions=null;static _type=`highlight`;static _editorType=Co.HIGHLIGHT;static get _keyboardManager(){let t=e.prototype;return V(this,`_keyboardManager`,new gs([[[`ArrowLeft`],t._moveCaret,{args:[0]}],[[`ArrowRight`],t._moveCaret,{args:[1]}],[[`ArrowUp`],t._moveCaret,{args:[2]}],[[`ArrowDown`],t._moveCaret,{args:[3]}]]))}constructor(e){super({...e,name:`highlightEditor`}),this.#e=e.anchorNode||null,this.#t=e.anchorOffset||0,this.#n=e.focusNode||null,this.#r=e.focusOffset||0,this.#i=e.methodOfCreation||(this._drawOutlines?.isFree?`main_toolbar`:``),this.#a=e.text||``,this._isDraggable=!1,this.defaultL10nId=`pdfjs-editor-highlight-editor`,this.rotate()}static initialize(t,n){Cs.initialize(t,n),this._defaultDrawingOptions||=new Su({fill:n.highlightColors?.values().next().value||`#fff066`,"fill-opacity":e._DEFAULT_OPACITY,thickness:e._DEFAULT_THICKNESS})}static getDefaultDrawingOptions(e){let t=this._defaultDrawingOptions.clone();return t.updateProperties(e),t}static get typesMap(){return V(this,`typesMap`,new Map([[wo.HIGHLIGHT_COLOR,`fill`],[wo.HIGHLIGHT_THICKNESS,`thickness`]]))}static get isDrawer(){return!1}static get _hasClipPath(){return!0}static get _hasDrawClass(){return!1}_addOutlines(t){let{boxes:n,drawOutlines:r}=t;(n||r)&&(this._drawingOptions||=t.drawingOptions||e.getDefaultDrawingOptions(),n&&(t={...t,drawOutlines:vu.build(n,this._uiManager.direction===`ltr`)}),super._addOutlines(t))}get colorType(){return wo.HIGHLIGHT_COLOR}get color(){return this._drawingOptions.fill}get opacity(){return this._drawingOptions[`fill-opacity`]}get _opacityName(){return`fill-opacity`}get _drawRotation(){return this._drawOutlines?.isFree?this.rotation:0}get isResizable(){return!1}get _mustBeDisabledOnCommit(){return!1}get _mustFixPosition(){return!this._drawOutlines?.isFree}get telemetryInitialData(){return{action:`added`,type:this._drawOutlines.isFree?`free_highlight`:`highlight`,color:this._uiManager.getNonHCMColorName(this.color),thickness:this._drawingOptions.thickness,methodOfCreation:this.#i}}get telemetryFinalData(){return{type:`highlight`,color:this._uiManager.getNonHCMColorName(this.color)}}static computeTelemetryFinalData(e){return{numberOfColors:e.get(`color`).size}}translateInPage(e,t){}get toolbarPosition(){return this.#o(this._drawOutlines.focusOutline.lastPoint)}get commentButtonPosition(){return this.#o(this._drawOutlines.firstPoint)}#o([e,t]){let[n,r,i,a]=this._drawOutlines.box;return[(e-n)/i,(t-r)/a]}updateParams(t,n){switch(t){case wo.HIGHLIGHT_COLOR:this._updateColorAndOpacity(n,e._DEFAULT_OPACITY,t),this._reportTelemetry({action:`color_changed`,color:this._uiManager.getNonHCMColorName(n)},!0);break;case wo.HIGHLIGHT_THICKNESS:super.updateParams(t,n),this._reportTelemetry({action:`thickness_changed`,thickness:n},!0)}}get propertiesToUpdate(){let e=super.propertiesToUpdate;return e.push([wo.HIGHLIGHT_FREE,this._drawOutlines.isFree]),e}get toolbarButtons(){return this._uiManager.highlightColors?(this._colorPicker=new Dl({editor:this}),[[`colorPicker`,this._colorPicker]]):super.toolbarButtons}fixAndSetPosition(){return super.fixAndSetPosition(this._drawRotation)}getRect(e,t){return super.getRect(e,t,this._drawRotation)}onceAdded(e){this.annotationElementId||this.parent.addUndoableEditor(this),e&&this.div.focus()}remove(){this._reportTelemetry({action:`deleted`}),super.remove()}render(){if(this.div)return this.div;let e=super.render();return this.#a&&(e.setAttribute(`aria-label`,this.#a),e.setAttribute(`role`,`mark`)),this._drawOutlines.isFree?e.classList.add(`free`):e.addEventListener(`keydown`,this.#s.bind(this),{signal:this._uiManager._signal}),this.enableEditing(),e}#s(t){e._keyboardManager.exec(this,t)}_moveCaret(e){switch(this.parent.unselect(this),e){case 0:case 2:this.#c(!0);break;case 1:case 3:this.#c(!1)}}#c(e){if(!this.#e)return;let t=window.getSelection();e?t.setPosition(this.#e,this.#t):t.setPosition(this.#n,this.#r)}unselect(){super.unselect(),this._drawOutlines.isFree||this.#c(!1)}static createDrawerInstance({x:e,y:t,box:n,parent:r,isLTR:i}){return new bu(e,t,n,r.scale,this._defaultDrawingOptions.thickness/2,i,.001)}static _getDrawingTarget(e,{target:t}){return t.closest(`.textLayer`)}static _getPointerCoords({x:e,y:t}){return[e,t]}static _addDrawingListeners(e,t){e.classList.add(`free`),t.addEventListener(`abort`,()=>e.classList.remove(`free`),{once:!0}),window.addEventListener(`blur`,()=>this._endDraw(null),{signal:t}),window.addEventListener(`pointerdown`,_t,{capture:!0,passive:!1,signal:t})}static _endDrawingSession(e=!1){return this.endDrawing(e)}createDrawingOptions({color:t,opacity:n,thickness:r}){let{_defaultDrawingOptions:i,_DEFAULT_OPACITY:a}=e;this._drawingOptions=e.getDefaultDrawingOptions({fill:H.makeHexColor(...t),"fill-opacity":n||a,thickness:r||i.thickness})}static deserializeDraw(e,t,n,r,i,a,o){let{quadPoints:s}=a;if(s){let i=[];for(let a=0,o=s.length;a<o;a+=8)i.push({x:(s[a]-e)/n,y:1-(s[a+1]-t)/r,width:(s[a+2]-s[a])/n,height:(s[a+1]-s[a+5])/r});return vu.build(i,o.direction===`ltr`)}let c=a.thickness||this._defaultDrawingOptions.thickness,l=(a.inkLists||a.outlines.points)[0],u=new yu(l[0]-e,r-(l[1]-t),[0,0,n,r],1,c/2,!0,.001);for(let n=0,i=l.length;n<i;n+=2)u.add(l[n]-e,r-(l[n+1]-t));let d=u.getOutlines();return d.buildFocusOutline(c),d}static async deserialize(e,t,n){let r=null;if(e instanceof ru){let{data:{quadPoints:t,rect:n,rotation:i,id:a,color:o,opacity:s,popupRef:c,richText:l,contentsObj:u,creationDate:d,modificationDate:f},parent:{page:{pageNumber:p}}}=e;r=e={annotationType:Co.HIGHLIGHT,color:Array.from(o),opacity:s,quadPoints:t,pageIndex:p-1,rect:n.slice(0),rotation:i,annotationElementId:a,id:a,deleted:!1,popupRef:c,richText:l,comment:u?.str||null,creationDate:d,modificationDate:f}}else if(e instanceof nu){let{data:{inkLists:t,rect:n,rotation:i,id:a,color:o,borderStyle:{rawWidth:s},popupRef:c,richText:l,contentsObj:u,creationDate:d,modificationDate:f},parent:{page:{pageNumber:p}}}=e;r=e={annotationType:Co.HIGHLIGHT,color:Array.from(o),thickness:s,inkLists:t,pageIndex:p-1,rect:n.slice(0),rotation:i,annotationElementId:a,id:a,deleted:!1,popupRef:c,richText:l,comment:u?.str||null,creationDate:d,modificationDate:f}}let i=await super.deserialize(e,t,n);return i._initialData=r,e.comment&&i.setCommentData(e),i}serialize(e=!1){if(this.isEmpty()||e)return null;if(this.deleted)return this.serializeDeleted();let t=super.serialize(e);return Object.assign(t,{color:Cs._colorManager.convert(this._uiManager.getNonHCMColor(this.color)),opacity:this.opacity,thickness:this._drawingOptions.thickness,quadPoints:this._drawOutlines.serializeQuadPoints(this.pageTranslation,this.pageDimensions),outlines:this._drawOutlines.serialize(t.rect,this._drawRotation)}),this.addComment(t),this.annotationElementId&&!this.#l(t)?null:(t.id=this.annotationElementId,t)}#l(e){let{color:t}=this._initialData;return this.hasEditedComment||e.color.some((e,n)=>e!==t[n])}renderAnnotationElement(e){return this.deleted?(e.hide(),null):(e.updateEdited({rect:this.getPDFRect(),popup:this.comment}),null)}},wu=class{#e=new Float64Array(6);#t=new Float64Array(2);#n;#r;#i;#a;#o;#s=``;#c=0;#l=new Tu;#u;#d;constructor(e,t,n,r,i,a){this.#u=n,this.#d=r,this.#i=i,this.#a=a,[e,t]=this.#f(e,t);let o=this.#n=[NaN,NaN,NaN,NaN,e,t];this.#o=[e,t],this.#r=[{line:o,points:this.#o}],this.#e.set(o,0),this.#t.set([e,t],0)}updateProperty(e,t){e===`stroke-width`&&(this.#a=t)}#f(e,t){return U._normalizePoint(e,t,this.#u,this.#d,this.#i)}isEmpty(){return!this.#r?.length}isCancellable(){return this.#o.length<=10}add(e,t){return this.#p(e,t)&&this.toSVGPath(),{path:{d:this.#m()}}}addPoints(e){let t=!1;for(let n=0,r=e.length;n<r;n+=2)this.#p(e[n],e[n+1])&&(t=!0,this.#o.length<=6&&(this.toSVGPath(),t=!1));return t&&this.toSVGPath(),{path:{d:this.#m()}}}#p(e,t){[e,t]=this.#f(e,t),this.#t.set([e,t],0);let[n,r,i,a]=this.#e.subarray(2,6),o=e-i,s=t-a;return Math.hypot(this.#u*o,this.#d*s)<=2?!1:(this.#o.push(e,t),isNaN(n)?(this.#e.set([i,a,e,t],2),this.#n.push(NaN,NaN,NaN,NaN,e,t),!0):(isNaN(this.#e[0])&&this.#n.splice(6,6),this.#e.set([n,r,i,a,e,t],0),this.#n.push(...U.createBezierPoints(n,r,i,a,e,t)),!0))}end(e,t){return e!==void 0&&this.#p(e,t)||this.#o.length===2?{path:{d:this.toSVGPath()}}:{path:{d:this.#s}}}startNew(e,t,n,r,i){this.#u=n,this.#d=r,this.#i=i,[e,t]=this.#f(e,t);let a=this.#n=[NaN,NaN,NaN,NaN,e,t];this.#o=[e,t],this.#t.set([e,t],0);let o=this.#r.at(-1);return o&&(o.line=new Float32Array(o.line),o.points=new Float32Array(o.points)),this.#r.push({line:a,points:this.#o}),this.#e.set(a,0),this.#c=0,this.toSVGPath(),null}getLastElement(){return this.#r.at(-1)}setLastElement(e){return this.#r?(this.#r.push(e),this.#n=e.line,this.#o=e.points,this.#c=0,{path:{d:this.toSVGPath()}}):this.#l.setLastElement(e)}removeLastElement(){if(!this.#r)return this.#l.removeLastElement();this.#r.pop(),this.#s=``;for(let e=0,t=this.#r.length;e<t;e++){let{line:t,points:n}=this.#r[e];this.#n=t,this.#o=n,this.#c=0,this.toSVGPath()}return{path:{d:this.#s}}}#m(){let e=U.svgRound(this.#t[0]),t=U.svgRound(this.#t[1]);if(this.#o.length===2){let n=U.svgRound(this.#n[4]),r=U.svgRound(this.#n[5]);return`${this.#s} M ${n} ${r} L ${e} ${t}`}return`${this.#s} L ${e} ${t}`}toSVGPath(){let e=U.svgRound(this.#n[4]),t=U.svgRound(this.#n[5]);if(this.#o.length===2)return this.#s=`${this.#s} M ${e} ${t} Z`,this.#s;if(this.#o.length<=6){let n=this.#s.lastIndexOf(`M`);this.#s=`${this.#s.slice(0,n)} M ${e} ${t}`,this.#c=6}if(this.#o.length===4){let e=U.svgRound(this.#n[10]),t=U.svgRound(this.#n[11]);return this.#s=`${this.#s} L ${e} ${t}`,this.#c=12,this.#s}let n=[];this.#c===0&&(n.push(`M ${e} ${t}`),this.#c=6);for(let e=this.#c,t=this.#n.length;e<t;e+=6){let[t,r,i,a,o,s]=this.#n.slice(e,e+6).map(U.svgRound);n.push(`C${t} ${r} ${i} ${a} ${o} ${s}`)}return this.#s+=n.join(` `),this.#c=this.#n.length,this.#s}getOutlines(e,t,n,r){let i=this.#r.at(-1);return i.line=new Float32Array(i.line),i.points=new Float32Array(i.points),this.#l.build(this.#r,e,t,n,this.#i,this.#a,r),this.#e=null,this.#n=null,this.#r=null,this.#s=null,this.#l}get defaultSVGProperties(){return{root:{viewBox:`0 0 10000 10000`},rootClass:{draw:!0},bbox:[0,0,1,1]}}},Tu=class extends U{#e;#t=0;#n;#r;#i;#a;#o;#s;#c;build(e,t,n,r,i,a,o){this.#i=t,this.#a=n,this.#o=r,this.#s=i,this.#c=a,this.#n=o??0,this.#r=e,this.#d()}get thickness(){return this.#c}setLastElement(e){return this.#r.push(e),{path:{d:this.toSVGPath()}}}removeLastElement(){return this.#r.pop(),{path:{d:this.toSVGPath()}}}toSVGPath(){let e=[];for(let{line:t}of this.#r)if(e.push(`M${U.svgRound(t[4])} ${U.svgRound(t[5])}`),t.length===6)e.push(`Z`);else if(t.length===12&&isNaN(t[6]))e.push(`L${U.svgRound(t[10])} ${U.svgRound(t[11])}`);else for(let n=6,r=t.length;n<r;n+=6){let[r,i,a,o,s,c]=t.subarray(n,n+6).map(U.svgRound);e.push(`C${r} ${i} ${a} ${o} ${s} ${c}`)}return e.join(``)}serialize([e,t,n,r],i){let a=[],o=[],[s,c,l,u]=this.#u(),d,f,p,m,h,g,_,v,y;switch(this.#s){case 0:y=U._rescale,d=e,f=t+r,p=n,m=-r,h=e+s*n,g=t+(1-c-u)*r,_=e+(s+l)*n,v=t+(1-c)*r;break;case 90:y=U._rescaleAndSwap,d=e,f=t,p=n,m=r,h=e+c*n,g=t+s*r,_=e+(c+u)*n,v=t+(s+l)*r;break;case 180:y=U._rescale,d=e+n,f=t,p=-n,m=r,h=e+(1-s-l)*n,g=t+c*r,_=e+(1-s)*n,v=t+(c+u)*r;break;case 270:y=U._rescaleAndSwap,d=e+n,f=t+r,p=-n,m=-r,h=e+(1-c-u)*n,g=t+(1-s-l)*r,_=e+(1-c)*n,v=t+(1-s)*r}for(let{line:e,points:t}of this.#r)a.push(y(e,d,f,p,m,i?Array(e.length):null)),o.push(y(t,d,f,p,m,i?Array(t.length):null));return{lines:a,points:o,rect:[h,g,_,v]}}static deserialize(e,t,n,r,i,{paths:{lines:a,points:o},rotation:s,thickness:c}){let l=[],u,d,f,p,m;switch(s){case 0:m=U._rescale,u=-e/n,d=t/r+1,f=1/n,p=-1/r;break;case 90:m=U._rescaleAndSwap,u=-t/r,d=-e/n,f=1/r,p=1/n;break;case 180:m=U._rescale,u=e/n+1,d=-t/r,f=-1/n,p=1/r;break;case 270:m=U._rescaleAndSwap,u=t/r+1,d=e/n+1,f=-1/r,p=-1/n}if(!a){a=[];for(let e of o){let t=e.length;if(t===2){a.push(new Float32Array([NaN,NaN,NaN,NaN,e[0],e[1]]));continue}if(t===4){a.push(new Float32Array([NaN,NaN,NaN,NaN,e[0],e[1],NaN,NaN,NaN,NaN,e[2],e[3]]));continue}let n=new Float32Array(3*(t-2));a.push(n);let[r,i,o,s]=e.subarray(0,4);n.set([NaN,NaN,NaN,NaN,r,i],0);for(let a=4;a<t;a+=2){let t=e[a],c=e[a+1];n.set(U.createBezierPoints(r,i,o,s,t,c),(a-2)*3),[r,i,o,s]=[o,s,t,c]}}}for(let e=0,t=a.length;e<t;e++)l.push({line:m(a[e].map(e=>e??NaN),u,d,f,p),points:m(o[e].map(e=>e??NaN),u,d,f,p)});let h=new this.prototype.constructor;return h.build(l,n,r,1,s,c,i),h}#l(e=this.#c){let t=this.#n+e/2*this.#o;return this.#s%180==0?[t/this.#i,t/this.#a]:[t/this.#a,t/this.#i]}#u(){let[e,t,n,r]=this.#e,[i,a]=this.#l(0);return[e+i,t+a,n-2*i,r-2*a]}#d(){let e=this.#e=go.slice();for(let{line:t}of this.#r){if(t.length<=12){for(let n=4,r=t.length;n<r;n+=6)H.pointBoundingBox(t[n],t[n+1],e);continue}let n=t[4],r=t[5];for(let i=6,a=t.length;i<a;i+=6){let[a,o,s,c,l,u]=t.subarray(i,i+6);H.bezierBoundingBox(n,r,a,o,s,c,l,u,e),n=l,r=u}}let[t,n]=this.#l();e[0]=lt(e[0]-t,0,1),e[1]=lt(e[1]-n,0,1),e[2]=lt(e[2]+t,0,1),e[3]=lt(e[3]+n,0,1),e[2]-=e[0],e[3]-=e[1]}get box(){return this.#e}updateProperty(e,t){return e===`stroke-width`?this.#f(t):null}#f(e){let[t,n]=this.#l();this.#c=e;let[r,i]=this.#l(),[a,o]=[r-t,i-n],s=this.#e;return s[0]-=a,s[1]-=o,s[2]+=2*a,s[3]+=2*o,s}updateParentDimensions([e,t],n){let[r,i]=this.#l();this.#i=e,this.#a=t,this.#o=n;let[a,o]=this.#l(),s=a-r,c=o-i,l=this.#e;return l[0]-=s,l[1]-=c,l[2]+=2*s,l[3]+=2*c,l}updateRotation(e){return this.#t=e,{path:{transform:this.rotationTransform}}}get viewBox(){return this.#e.map(U.svgRound).join(` `)}get defaultProperties(){let[e,t]=this.#e;return{root:{viewBox:this.viewBox},path:{"transform-origin":`${U.svgRound(e)} ${U.svgRound(t)}`}}}get rotationTransform(){let[,,e,t]=this.#e,n=0,r=0,i=0,a=0,o=0,s=0;switch(this.#t){case 90:r=t/e,i=-e/t,o=e;break;case 180:n=-1,a=-1,o=e,s=t;break;case 270:r=-t/e,i=e/t,s=t;break;default:return``}return`matrix(${n} ${r} ${i} ${a} ${U.svgRound(o)} ${U.svgRound(s)})`}getPathResizingSVGProperties([e,t,n,r]){let[i,a]=this.#l(),[o,s,c,l]=this.#e;if(Math.abs(c-i)<=U.PRECISION||Math.abs(l-a)<=U.PRECISION){let i=e+n/2-(o+c/2),a=t+r/2-(s+l/2);return{path:{"transform-origin":`${U.svgRound(e)} ${U.svgRound(t)}`,transform:`${this.rotationTransform} translate(${i} ${a})`}}}let u=(n-2*i)/(c-2*i),d=(r-2*a)/(l-2*a),f=c/n,p=l/r;return{path:{"transform-origin":`${U.svgRound(o)} ${U.svgRound(s)}`,transform:`${this.rotationTransform} scale(${f} ${p}) translate(${U.svgRound(i)} ${U.svgRound(a)}) scale(${u} ${d}) translate(${U.svgRound(-i)} ${U.svgRound(-a)})`}}}getPathResizedSVGProperties([e,t,n,r]){let[i,a]=this.#l(),o=this.#e,[s,c,l,u]=o;if(o[0]=e,o[1]=t,o[2]=n,o[3]=r,Math.abs(l-i)<=U.PRECISION||Math.abs(u-a)<=U.PRECISION){let i=e+n/2-(s+l/2),a=t+r/2-(c+u/2);for(let{line:e,points:t}of this.#r)U._translate(e,i,a,e),U._translate(t,i,a,t);return{root:{viewBox:this.viewBox},path:{"transform-origin":`${U.svgRound(e)} ${U.svgRound(t)}`,transform:this.rotationTransform||null,d:this.toSVGPath()}}}let d=(n-2*i)/(l-2*i),f=(r-2*a)/(u-2*a),p=-d*(s+i)+e+i,m=-f*(c+a)+t+a;if(d!==1||f!==1||p!==0||m!==0)for(let{line:e,points:t}of this.#r)U._rescale(e,p,m,d,f,e),U._rescale(t,p,m,d,f,t);return{root:{viewBox:this.viewBox},path:{"transform-origin":`${U.svgRound(e)} ${U.svgRound(t)}`,transform:this.rotationTransform||null,d:this.toSVGPath()}}}getPathTranslatedSVGProperties([e,t],n){let[r,i]=n,a=this.#e,o=e-a[0],s=t-a[1];if(this.#i===r&&this.#a===i)for(let{line:e,points:t}of this.#r)U._translate(e,o,s,e),U._translate(t,o,s,t);else{let e=this.#i/r,t=this.#a/i;this.#i=r,this.#a=i;for(let{line:n,points:r}of this.#r)U._rescale(n,o,s,e,t,n),U._rescale(r,o,s,e,t,r);a[2]*=e,a[3]*=t}return a[0]=e,a[1]=t,{root:{viewBox:this.viewBox},path:{d:this.toSVGPath(),"transform-origin":`${U.svgRound(e)} ${U.svgRound(t)}`}}}get defaultSVGProperties(){let e=this.#e;return{root:{viewBox:this.viewBox},rootClass:{draw:!0},path:{d:this.toSVGPath(),"transform-origin":`${U.svgRound(e[0])} ${U.svgRound(e[1])}`,transform:this.rotationTransform||null},bbox:e}}},Eu=class e extends pu{constructor(e){super(),this._viewParameters=e,super.updateProperties({fill:`none`,stroke:Cs._defaultLineColor,"stroke-opacity":1,"stroke-width":1,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-miterlimit":10})}updateSVGProperty(e,t){e===`stroke-width`&&(t??=this[`stroke-width`],t*=this._viewParameters.realScale),super.updateSVGProperty(e,t)}clone(){let t=new e(this._viewParameters);return t.updateAll(this),t}},Du=class e extends mu{static _type=`ink`;static _editorType=Co.INK;static _defaultDrawingOptions=null;constructor(e){super({...e,name:`inkEditor`}),this._willKeepAspectRatio=!0,this.defaultL10nId=`pdfjs-editor-ink-editor`}static initialize(e,t){Cs.initialize(e,t),this._defaultDrawingOptions=new Eu(t.viewParameters)}static getDefaultDrawingOptions(e){let t=this._defaultDrawingOptions.clone();return t.updateProperties(e),t}static get supportMultipleDrawings(){return!0}static get typesMap(){return V(this,`typesMap`,new Map([[wo.INK_THICKNESS,`stroke-width`],[wo.INK_COLOR,`stroke`],[wo.INK_OPACITY,`stroke-opacity`]]))}static createDrawerInstance({x:e,y:t,box:[,,n,r],rotation:i}){return new wu(e,t,n,r,i,this._defaultDrawingOptions[`stroke-width`])}static deserializeDraw(e,t,n,r,i,a){return Tu.deserialize(e,t,n,r,i,a)}static async deserialize(e,t,n){let r=null;if(e instanceof nu){let{data:{inkLists:t,rect:n,rotation:i,id:a,color:o,opacity:s,borderStyle:{rawWidth:c},popupRef:l,richText:u,contentsObj:d,creationDate:f,modificationDate:p},parent:{page:{pageNumber:m}}}=e;r=e={annotationType:Co.INK,color:Array.from(o),thickness:c,opacity:s,paths:{points:t},boxes:null,pageIndex:m-1,rect:n.slice(0),rotation:i,annotationElementId:a,id:a,deleted:!1,popupRef:l,richText:u,comment:d?.str||null,creationDate:f,modificationDate:p}}let i=await super.deserialize(e,t,n);return i._initialData=r,e.comment&&i.setCommentData(e),i}get toolbarButtons(){return this._colorPicker||=new Ol(this),[[`colorPicker`,this._colorPicker]]}get colorType(){return wo.INK_COLOR}get colorAndOpacityType(){return wo.INK_COLOR_AND_OPACITY}get opacityType(){return wo.INK_OPACITY}updateParams(e,t){e===wo.INK_COLOR_AND_OPACITY?this._updateColorAndOpacity(t.color,t.opacity):super.updateParams(e,t)}static updateDefaultParams(e,t){e===wo.INK_COLOR_AND_OPACITY?(super.updateDefaultParams(wo.INK_COLOR,t.color),super.updateDefaultParams(wo.INK_OPACITY,t.opacity)):super.updateDefaultParams(e,t)}get color(){return this._drawingOptions.stroke}get opacity(){return this._drawingOptions[`stroke-opacity`]}onScaleChanging(){if(!this.parent)return;super.onScaleChanging();let{_drawId:e,_drawingOptions:t,parent:n}=this;t.updateSVGProperty(`stroke-width`),n.drawLayer.updateProperties(e,t.toSVGProperties())}static onScaleChangingWhenDrawing(){let e=this._currentParent;e&&(super.onScaleChangingWhenDrawing(),this._defaultDrawingOptions.updateSVGProperty(`stroke-width`),e.drawLayer.updateProperties(this._currentDrawId,this._defaultDrawingOptions.toSVGProperties()))}createDrawingOptions({color:t,thickness:n,opacity:r}){this._drawingOptions=e.getDefaultDrawingOptions({stroke:H.makeHexColor(...t),"stroke-width":n,"stroke-opacity":r})}serialize(e=!1){if(this.isEmpty())return null;if(this.deleted)return this.serializeDeleted();let{lines:t,points:n}=this.serializeDraw(e),{_drawingOptions:{stroke:r,"stroke-opacity":i,"stroke-width":a}}=this,o=Object.assign(super.serialize(e),{color:Cs._colorManager.convert(r),opacity:i,thickness:a,paths:{lines:t,points:n}});return this.addComment(o),e?(o.isCopy=!0,o):this.annotationElementId&&!this.#e(o)?null:(o.id=this.annotationElementId,o)}#e(e){let{color:t,thickness:n,opacity:r,pageIndex:i}=this._initialData;return this.hasEditedComment||this._hasBeenMoved||this._hasBeenResized||e.color.some((e,n)=>e!==t[n])||e.thickness!==n||e.opacity!==r||e.pageIndex!==i}renderAnnotationElement(e){if(this.deleted)return e.hide(),null;let{points:t,rect:n}=this.serializeDraw(!1);return e.updateEdited({rect:n,thickness:this._drawingOptions[`stroke-width`],points:t,popup:this.comment}),null}},Ou=class extends Tu{toSVGPath(){let e=super.toSVGPath();return e.endsWith(`Z`)||(e+=`Z`),e}},io(),ku=8,Au=3,ju=class{static#e={maxDim:512,sigmaSFactor:.02,sigmaR:25,kernelSize:16};static#t(e,t,n,r){return n-=e,r-=t,n===0?r>0?0:4:n===1?r+6:2-r}static#n=new Int32Array([0,1,-1,1,-1,0,-1,-1,0,-1,1,-1,1,0,1,1]);static#r(e,t,n,r,i,a,o){let s=this.#t(n,r,i,a);for(let i=0;i<8;i++){let a=(-i+s-o+16)%8,c=this.#n[2*a],l=this.#n[2*a+1];if(e[(n+c)*t+(r+l)]!==0)return a}return-1}static#i(e,t,n,r,i,a,o){let s=this.#t(n,r,i,a);for(let i=0;i<8;i++){let a=(i+s+o+16)%8,c=this.#n[2*a],l=this.#n[2*a+1];if(e[(n+c)*t+(r+l)]!==0)return a}return-1}static#a(e,t,n,r){let i=e.length,a=new Int32Array(i);for(let t=0;t<i;t++)a[t]=+(e[t]<=r);for(let e=1;e<n-1;e++)a[e*t]=a[e*t+t-1]=0;for(let e=0;e<t;e++)a[e]=a[t*n-1-e]=0;let o=1,s,c=[];for(let e=1;e<n-1;e++){s=1;for(let n=1;n<t-1;n++){let r=e*t+n,i=a[r];if(i===0)continue;let l=e,u=n;if(i===1&&a[r-1]===0)o+=1,--u;else if(i>=1&&a[r+1]===0)o+=1,u+=1,i>1&&(s=i);else{i!==1&&(s=Math.abs(i));continue}let d=[n,e],f=u===n+1,p={isHole:f,points:d,id:o,parent:0};c.push(p);let m;for(let e of c)if(e.id===s){m=e;break}p.parent=m?m.isHole?f?m.parent:s:f?s:m.parent:f?s:0;let h=this.#r(a,t,e,n,l,u,0);if(h===-1){a[r]=-o,a[r]!==1&&(s=Math.abs(a[r]));continue}let g=this.#n[2*h],_=this.#n[2*h+1],v=e+g,y=n+_;l=v,u=y;let b=e,x=n;for(;;){let i=this.#i(a,t,b,x,l,u,1);g=this.#n[2*i],_=this.#n[2*i+1];let c=b+g,f=x+_;d.push(f,c);let p=b*t+x;if(a[p+1]===0?a[p]=-o:a[p]===1&&(a[p]=o),c===e&&f===n&&b===v&&x===y){a[r]!==1&&(s=Math.abs(a[r]));break}l=b,u=x,b=c,x=f}}}return c}static#o(e,t,n,r){if(n-t<=4){for(let i=t;i<n-2;i+=2)r.push(e[i],e[i+1]);return}let i=e[t],a=e[t+1],o=e[n-4]-i,s=e[n-3]-a,c=Math.hypot(o,s),l=o/c,u=s/c,d=l*a-u*i,f=s/o,p=1/c,m=Math.atan(f),h=Math.cos(m),g=Math.sin(m),_=p*(Math.abs(h)+Math.abs(g)),v=p*(1-_+_**2),y=Math.max(Math.atan(Math.abs(g+h)*v),Math.atan(Math.abs(g-h)*v)),b=0,x=t;for(let r=t+2;r<n-2;r+=2){let t=Math.abs(d-l*e[r+1]+u*e[r]);t>b&&(x=r,b=t)}b>(c*y)**2?(this.#o(e,t,x+2,r),this.#o(e,x,n,r)):r.push(i,a)}static#s(e){let t=[],n=e.length;return this.#o(e,0,n,t),t.push(e[n-2],e[n-1]),t.length<=4?null:t}static#c(e,t,n,r,i,a){let o=new Float32Array(a**2),s=-2*r**2,c=a>>1;for(let e=0;e<a;e++){let t=(e-c)**2;for(let n=0;n<a;n++)o[e*a+n]=Math.exp((t+(n-c)**2)/s)}let l=new Float32Array(256),u=-2*i**2;for(let e=0;e<256;e++)l[e]=Math.exp(e**2/u);let d=e.length,f=new Uint8Array(d),p=new Uint32Array(256);for(let r=0;r<n;r++)for(let i=0;i<t;i++){let s=r*t+i,u=e[s],d=0,m=0;for(let s=0;s<a;s++){let f=r+s-c;if(!(f<0||f>=n))for(let n=0;n<a;n++){let r=i+n-c;if(r<0||r>=t)continue;let p=e[f*t+r],h=o[s*a+n]*l[Math.abs(p-u)];d+=p*h,m+=h}}let h=f[s]=Math.round(d/m);p[h]++}return[f,p]}static#l(e){let t=new Uint32Array(256);for(let n of e)t[n]++;return t}static#u(e){let t=e.length,n=new Uint8ClampedArray(t>>2),r=-1/0,i=1/0;for(let t=0,a=n.length;t<a;t++){let a=n[t]=e[t<<2];r=Math.max(r,a),i=Math.min(i,a)}let a=255/(r-i);for(let e=0,t=n.length;e<t;e++)n[e]=(n[e]-i)*a;return n}static#d(e){let t,n=-1/0,r=-1/0,i=e.findIndex(e=>e!==0),a=i,o=i;for(t=i;t<256;t++){let i=e[t];i>n&&(t-a>r&&(r=t-a,o=t-1),n=i,a=t)}for(t=o-1;t>=0&&!(e[t]>e[t+1]);t--);return t}static#f(e){let t=e,{width:n,height:r}=e,{maxDim:i}=this.#e,a=n,o=r;if(n>i||r>i){let s=n,c=r,l=Math.log2(Math.max(n,r)/i),u=Math.floor(l);l=l===u?u-1:u;for(let n=0;n<l;n++){a=Math.ceil(s/2),o=Math.ceil(c/2);let n=new OffscreenCanvas(a,o);n.getContext(`2d`).drawImage(e,0,0,s,c,0,0,a,o),s=a,c=o,e!==t&&e.close(),e=n.transferToImageBitmap()}let d=Math.min(i/a,i/o);a=Math.round(a*d),o=Math.round(o*d)}let s=new OffscreenCanvas(a,o).getContext(`2d`,{willReadFrequently:!0});s.fillStyle=`white`,s.fillRect(0,0,a,o),s.filter=`grayscale(1)`,s.drawImage(e,0,0,e.width,e.height,0,0,a,o);let c=s.getImageData(0,0,a,o).data;return[this.#u(c),a,o]}static extractContoursFromText(e,{fontFamily:t,fontStyle:n,fontWeight:r},i,a,o,s){let c=new OffscreenCanvas(1,1),l=c.getContext(`2d`,{alpha:!1}),u=l.font=`${n} ${r} 200px ${t}`,{actualBoundingBoxLeft:d,actualBoundingBoxRight:f,actualBoundingBoxAscent:p,actualBoundingBoxDescent:m,fontBoundingBoxAscent:h,fontBoundingBoxDescent:g,width:_}=l.measureText(e),v=1.5,y=Math.ceil(Math.max(Math.abs(d)+Math.abs(f)||0,_)*v),b=Math.ceil(Math.max(Math.abs(p)+Math.abs(m)||200,Math.abs(h)+Math.abs(g)||200)*v);c=new OffscreenCanvas(y,b),l=c.getContext(`2d`,{alpha:!0,willReadFrequently:!0}),l.font=u,l.filter=`grayscale(1)`,l.fillStyle=`white`,l.fillRect(0,0,y,b),l.fillStyle=`black`,l.fillText(e,y*.5/2,b*1.5/2);let x=this.#u(l.getImageData(0,0,y,b).data),S=this.#l(x),C=this.#d(S),w=this.#a(x,y,b,C);return this.processDrawnLines({lines:{curves:w,width:y,height:b},pageWidth:i,pageHeight:a,rotation:o,innerMargin:s,mustSmooth:!0,areContours:!0})}static process(e,t,n,r,i){let[a,o,s]=this.#f(e),[c,l]=this.#c(a,o,s,Math.hypot(o,s)*this.#e.sigmaSFactor,this.#e.sigmaR,this.#e.kernelSize),u=this.#d(l),d=this.#a(c,o,s,u);return this.processDrawnLines({lines:{curves:d,width:o,height:s},pageWidth:t,pageHeight:n,rotation:r,innerMargin:i,mustSmooth:!0,areContours:!0})}static processDrawnLines({lines:e,pageWidth:t,pageHeight:n,rotation:r,innerMargin:i,mustSmooth:a,areContours:o}){r%180!=0&&([t,n]=[n,t]);let{curves:s,width:c,height:l}=e,u=e.thickness??0,d=[],f=Math.min(t/c,n/l),p=f/t,m=f/n,h=[];for(let{points:e}of s){let t=a?this.#s(e):e;if(!t)continue;h.push(t);let n=t.length,r=new Float32Array(n),i=new Float32Array(3*(n===2?2:n-2));if(d.push({line:i,points:r}),n===2){r[0]=t[0]*p,r[1]=t[1]*m,i.set([NaN,NaN,NaN,NaN,r[0],r[1]],0);continue}let[o,s,c,l]=t;o*=p,s*=m,c*=p,l*=m,r.set([o,s,c,l],0),i.set([NaN,NaN,NaN,NaN,o,s],0);for(let e=4;e<n;e+=2){let n=r[e]=t[e]*p,a=r[e+1]=t[e+1]*m;i.set(U.createBezierPoints(o,s,c,l,n,a),(e-2)*3),[o,s,c,l]=[c,l,n,a]}}if(d.length===0)return null;let g=o?new Ou:new Tu;return g.build(d,t,n,1,r,o?0:u,i),{outline:g,newCurves:h,areContours:o,thickness:u,width:c,height:l}}static async compressSignature({outlines:e,areContours:t,thickness:n,width:r,height:i}){let a=1/0,o=-1/0,s=0;for(let t of e){s+=t.length;for(let e=2,n=t.length;e<n;e++){let n=t[e]-t[e-2];a=Math.min(a,n),o=Math.max(o,n)}}let c;c=a>=-128&&o<=127?Int8Array:a>=-32768&&o<=32767?Int16Array:Int32Array;let l=e.length,u=ku+Au*l,d=new Uint32Array(u),f=0;d[f++]=u*Uint32Array.BYTES_PER_ELEMENT+(s-2*l)*c.BYTES_PER_ELEMENT,d[f++]=0,d[f++]=r,d[f++]=i,d[f++]=+!t,d[f++]=Math.max(0,Math.floor(n??0)),d[f++]=l,d[f++]=c.BYTES_PER_ELEMENT;for(let t of e)d[f++]=t.length-2,d[f++]=t[0],d[f++]=t[1];let p=new CompressionStream(`deflate-raw`),m=p.writable.getWriter();await m.ready,m.write(d);let h=c.prototype.constructor;for(let t of e){let e=new h(t.length-2);for(let n=2,r=t.length;n<r;n++)e[n-2]=t[n]-t[n-2];m.write(e)}return m.close(),(await new Response(p.readable).bytes()).toBase64()}static async decompressSignature(e){try{let t=Uint8Array.fromBase64(e),{readable:n,writable:r}=new DecompressionStream(`deflate-raw`),i=r.getWriter();await i.ready,i.write(t).then(async()=>{await i.ready,await i.close()}).catch(()=>{});let a=null,o=0;for await(let e of n)a||=new Uint8Array(new Uint32Array(e.buffer,0,4)[0]),a.set(e,o),o+=e.length;let s=new Uint32Array(a.buffer,0,a.length>>2),c=s[1];if(c!==0)throw Error(`Invalid version: ${c}`);let l=s[2],u=s[3],d=s[4]===0,f=s[5],p=s[6],m=s[7],h=[],g=(ku+Au*p)*Uint32Array.BYTES_PER_ELEMENT,_;switch(m){case Int8Array.BYTES_PER_ELEMENT:_=new Int8Array(a.buffer,g);break;case Int16Array.BYTES_PER_ELEMENT:_=new Int16Array(a.buffer,g);break;case Int32Array.BYTES_PER_ELEMENT:_=new Int32Array(a.buffer,g)}o=0;for(let e=0;e<p;e++){let t=s[Au*e+ku],n=new Float32Array(t+2);h.push(n);for(let t=0;t<2;t++)n[t]=s[Au*e+ku+t+1];for(let e=0;e<t;e++)n[e+2]=n[e]+_[o++]}return{areContours:d,thickness:f,outlines:h,width:l,height:u}}catch(e){return Xe(`decompressSignature: ${e}`),null}}},Mu=class e extends pu{constructor(){super(),super.updateProperties({fill:Cs._defaultLineColor,"stroke-width":0})}clone(){let t=new e;return t.updateAll(this),t}},Nu=class e extends Eu{constructor(e){super(e),super.updateProperties({stroke:Cs._defaultLineColor,"stroke-width":1})}clone(){let t=new e(this._viewParameters);return t.updateAll(this),t}},Pu=class e extends mu{#e=!1;#t=null;#n=null;#r=null;static _type=`signature`;static _editorType=Co.SIGNATURE;static _defaultDrawingOptions=null;constructor(e){super({...e,mustBeCommitted:!0,name:`signatureEditor`}),this._willKeepAspectRatio=!0,this.#n=e.signatureData||null,this.#t=null,this.defaultL10nId=`pdfjs-editor-signature-editor1`}static initialize(e,t){Cs.initialize(e,t),this._defaultDrawingOptions=new Mu,this._defaultDrawnSignatureOptions=new Nu(t.viewParameters)}static getDefaultDrawingOptions(e){let t=this._defaultDrawingOptions.clone();return t.updateProperties(e),t}static get supportMultipleDrawings(){return!1}static get typesMap(){return V(this,`typesMap`,new Map)}static get isDrawer(){return!1}get telemetryFinalData(){return{type:`signature`,hasDescription:!!this.#t}}static computeTelemetryFinalData(e){let t=e.get(`hasDescription`);return{hasAltText:t.get(!0)??0,hasNoAltText:t.get(!1)??0}}get isResizable(){return!0}onScaleChanging(){this._drawId!==null&&super.onScaleChanging()}render(){if(this.div)return this.div;let t,n,{_isCopy:r}=this;if(r&&(this._isCopy=!1,t=this.x,n=this.y),super.render(),this._drawId===null){if(this.#n){let{lines:t,mustSmooth:n,areContours:r,description:i,uuid:a,heightInPage:o}=this.#n,{rawDims:{pageWidth:s,pageHeight:c},rotation:l}=this.parent.viewport,u=ju.processDrawnLines({lines:t,pageWidth:s,pageHeight:c,rotation:l,innerMargin:e._INNER_MARGIN,mustSmooth:n,areContours:r});this.addSignature(u,o,i,a)}else this.div.setAttribute(`data-l10n-args`,JSON.stringify({description:``})),this.div.hidden=!0,this._uiManager.getSignature(this)}else this.div.setAttribute(`data-l10n-args`,JSON.stringify({description:this.#t||``}));return r&&(this._isCopy=!0,this._moveAfterPaste(t,n)),this.div}setUuid(e){this.#r=e,this.addEditToolbar()}getUuid(){return this.#r}get description(){return this.#t}set description(e){this.#t=e,this.div&&(this.div.setAttribute(`data-l10n-args`,JSON.stringify({description:e})),super.addEditToolbar().then(t=>{t?.updateEditSignatureButton(e)}))}getSignaturePreview(){let{newCurves:e,areContours:t,thickness:n,width:r,height:i}=this.#n,a=Math.max(r,i);return{areContours:t,outline:ju.processDrawnLines({lines:{curves:e.map(e=>({points:e})),thickness:n,width:r,height:i},pageWidth:a,pageHeight:a,rotation:0,innerMargin:0,mustSmooth:!1,areContours:t}).outline}}get toolbarButtons(){return this._uiManager.signatureManager?[[`editSignature`,this._uiManager.signatureManager]]:super.toolbarButtons}addSignature(t,n,r,i){let{x:a,y:o}=this,{outline:s}=this.#n=t;this.#e=s instanceof Ou,this.description=r;let c;this.#e?c=e.getDefaultDrawingOptions():(c=e._defaultDrawnSignatureOptions.clone(),c.updateProperties({"stroke-width":s.thickness})),this._addOutlines({drawOutlines:s,drawingOptions:c});let[,l]=this.pageDimensions,u=n/l;u=u>=1?.5:u,this.width*=u/this.height,this.width>=1&&(u*=.9/this.width,this.width=.9),this.height=u,this.setDims(),this.x=a,this.y=o,this.center(),this._onResized(),this.onScaleChanging(),this.rotate(),this._uiManager.addToAnnotationStorage(this),this.setUuid(i),this._reportTelemetry({action:`pdfjs.signature.inserted`,data:{hasBeenSaved:!!i,hasDescription:!!r}}),this.div.hidden=!1}getFromImage(t){let{rawDims:{pageWidth:n,pageHeight:r},rotation:i}=this.parent.viewport;return ju.process(t,n,r,i,e._INNER_MARGIN)}getFromText(t,n){let{rawDims:{pageWidth:r,pageHeight:i},rotation:a}=this.parent.viewport;return ju.extractContoursFromText(t,n,r,i,a,e._INNER_MARGIN)}getDrawnSignature(t){let{rawDims:{pageWidth:n,pageHeight:r},rotation:i}=this.parent.viewport;return ju.processDrawnLines({lines:t,pageWidth:n,pageHeight:r,rotation:i,innerMargin:e._INNER_MARGIN,mustSmooth:!1,areContours:!1})}createDrawingOptions({areContours:t,thickness:n}){t?this._drawingOptions=e.getDefaultDrawingOptions():(this._drawingOptions=e._defaultDrawnSignatureOptions.clone(),this._drawingOptions.updateProperties({"stroke-width":n}))}serialize(e=!1){if(this.isEmpty())return null;let{lines:t,points:n}=this.serializeDraw(e),{_drawingOptions:{"stroke-width":r}}=this,i=Object.assign(super.serialize(e),{isSignature:!0,areContours:this.#e,color:[0,0,0],thickness:this.#e?0:r});return this.addComment(i),e?(i.paths={lines:t,points:n},i.uuid=this.#r,i.isCopy=!0):i.lines=t,this.#t&&(i.accessibilityData={type:`Figure`,alt:this.#t}),i}static deserializeDraw(e,t,n,r,i,a){return a.areContours?Ou.deserialize(e,t,n,r,i,a):Tu.deserialize(e,t,n,r,i,a)}static async deserialize(e,t,n){let r=await super.deserialize(e,t,n);return r.#e=e.areContours,r.description=e.accessibilityData?.alt||``,r.#r=e.uuid,r}},Fu=class extends Cs{#e=null;#t=null;#n=null;#r=null;#i=null;#a=``;#o=null;#s=!1;#c=null;#l=!1;#u=!1;static _type=`stamp`;static _editorType=Co.STAMP;constructor(e){super({...e,name:`stampEditor`}),this.#r=e.bitmapUrl,this.#i=e.bitmapFile,this.defaultL10nId=`pdfjs-editor-stamp-editor`}static initialize(e,t){Cs.initialize(e,t)}static isHandlingMimeForPasting(e){return as.has(e)}static paste(e,t){t.pasteEditor({mode:Co.STAMP},{bitmapFile:e.getAsFile()})}altTextFinish(){this._uiManager.useNewAltTextFlow&&(this.div.hidden=!1),super.altTextFinish()}get telemetryFinalData(){return{type:`stamp`,hasAltText:!!this.altTextData?.altText}}static computeTelemetryFinalData(e){let t=e.get(`hasAltText`);return{hasAltText:t.get(!0)??0,hasNoAltText:t.get(!1)??0}}#d(e,t=!1){e?(this.#e=e.bitmap,t||(this.#t=e.id,this.#l=e.isSvg),e.file&&(this.#a=e.file.name),this.#m()):this.remove()}#f(){if(this.#n=null,this._uiManager.enableWaiting(!1),this.#o){if(this._uiManager.useNewAltTextWhenAddingImage&&this._uiManager.useNewAltTextFlow&&this.#e)this.addEditToolbar().then(()=>{this._editToolbar.hide(),this._uiManager.editAltText(this,!0)});else{if(!this._uiManager.useNewAltTextWhenAddingImage&&this._uiManager.useNewAltTextFlow&&this.#e){this._reportTelemetry({action:`pdfjs.image.image_added`,data:{alt_text_modal:!1,alt_text_type:`empty`}});try{this.mlGuessAltText()}catch{}}this.div.focus()}}}async mlGuessAltText(e=null,t=!0){if(this.hasAltTextData())return null;let{mlManager:n}=this._uiManager;if(!n)throw Error(`No ML.`);if(!await n.isEnabledFor(`altText`))throw Error(`ML isn't enabled for alt text.`);let{data:r,width:i,height:a}=e||this.copyCanvas(null,null,!0).imageData,o=await n.guess({name:`altText`,request:{data:r,width:i,height:a,channels:r.length/(i*a)}});if(!o)throw Error(`No response from the AI service.`);if(o.error)throw Error(`Error from the AI service.`);if(o.cancel)return null;if(!o.output)throw Error(`No valid response from the AI service.`);let s=o.output;return await this.setGuessedAltText(s),t&&!this.hasAltTextData()&&(this.altTextData={alt:s,decorative:!1}),s}#p(){if(this.#t){this._uiManager.enableWaiting(!0),this._uiManager.imageManager.getFromId(this.#t).then(e=>this.#d(e,!0)).finally(()=>this.#f());return}if(this.#r){let e=this.#r;this.#r=null,this._uiManager.enableWaiting(!0),this.#n=this._uiManager.imageManager.getFromUrl(e).then(e=>this.#d(e)).finally(()=>this.#f());return}if(this.#i){let e=this.#i;this.#i=null,this._uiManager.enableWaiting(!0),this.#n=this._uiManager.imageManager.getFromFile(e).then(e=>this.#d(e)).finally(()=>this.#f());return}let e=document.createElement(`input`);e.type=`file`,e.accept=as.keys().join(`,`);let t=this._uiManager._signal;this.#n=new Promise(n=>{e.addEventListener(`change`,async()=>{if(!e.files||e.files.length===0)this.remove();else{this._uiManager.enableWaiting(!0);let t=await this._uiManager.imageManager.getFromFile(e.files[0]);this._reportTelemetry({action:`pdfjs.image.image_selected`,data:{alt_text_modal:this._uiManager.useNewAltTextFlow}}),this.#d(t)}n()},{signal:t}),e.addEventListener(`cancel`,()=>{this.remove(),n()},{signal:t})}).finally(()=>this.#f()),e.click()}remove(){this.#t&&(this.#e=null,this._uiManager.imageManager.deleteId(this.#t),this.#o?.remove(),this.#o=null,this.#c&&=(clearTimeout(this.#c),null)),super.remove()}rebuild(){this.parent?(super.rebuild(),this.div!==null&&(this.#t&&this.#o===null&&this.#p(),this.isAttachedToDOM||this.parent.add(this))):this.#t&&this.#p()}onceAdded(e){this._isDraggable=!0,e&&this.div.focus()}isEmpty(){return!(this.#n||this.#e||this.#r||this.#i||this.#t||this.#s)}get toolbarButtons(){return[[`altText`,this.createAltText()]]}get isResizable(){return!0}render(){if(this.div)return this.div;let e,t;return this._isCopy&&(e=this.x,t=this.y),super.render(),this.div.hidden=!0,this.createAltText(),this.#s||(this.#e?this.#m():this.#p()),this._isCopy&&this._moveAfterPaste(e,t),this._uiManager.addShouldRescale(this),this.div}setCanvas(e,t){let{id:n,bitmap:r}=this._uiManager.imageManager.getFromCanvas(e,t);t.remove(),n&&this._uiManager.imageManager.isValidId(n)&&(this.#t=n,r&&(this.#e=r),this.#s=!1,this.#m())}_onResized(){this.onScaleChanging()}onScaleChanging(){this.parent&&(this.#c!==null&&clearTimeout(this.#c),this.#c=setTimeout(()=>{this.#c=null,this.#g()},200))}#m(){let{div:e}=this,{width:t,height:n}=this.#e,[r,i]=this.pageDimensions,a=.75;if(this.width)t=this.width*r,n=this.height*i;else if(t>a*r||n>a*i){let e=Math.min(a*r/t,a*i/n);t*=e,n*=e}this._uiManager.enableWaiting(!1);let o=this.#o=document.createElement(`canvas`);o.setAttribute(`role`,`img`),this.addContainer(o),this.width=t/r,this.height=n/i,this.setDims(),this._initialOptions?.isCentered?this.center():this.fixAndSetPosition(),this._initialOptions=null,this._uiManager.useNewAltTextWhenAddingImage&&this._uiManager.useNewAltTextFlow&&!this.annotationElementId||(e.hidden=!1),this.#g(),this.#u||=(this.parent.addUndoableEditor(this),!0),this._reportTelemetry({action:`inserted_image`}),this.#a&&this.div.setAttribute(`aria-description`,this.#a),this.annotationElementId||this._uiManager.a11yAlert(Cs._l10nAlert.stamp)}copyCanvas(e,t,n=!1){e||=224;let{width:r,height:i}=this.#e,a=new is,o=this.#e,s=r,c=i,l=null;if(t){if(r>t||i>t){let e=Math.min(t/r,t/i);s=Math.floor(r*e),c=Math.floor(i*e)}l=document.createElement(`canvas`);let e=l.width=Math.ceil(s*a.sx),n=l.height=Math.ceil(c*a.sy);this.#l||(o=this.#h(e,n));let u=l.getContext(`2d`);u.filter=this._uiManager.hcmFilter;let d=`white`,f=`#cfcfd8`;this._uiManager.hcmFilter===`none`?os.isDarkMode&&(d=`#8f8f9d`,f=`#42414d`):f=`black`;let p=15*a.sx,m=15*a.sy,h=new OffscreenCanvas(p*2,m*2),g=h.getContext(`2d`);g.fillStyle=d,g.fillRect(0,0,p*2,m*2),g.fillStyle=f,g.fillRect(0,0,p,m),g.fillRect(p,m,p,m),u.fillStyle=u.createPattern(h,`repeat`),u.fillRect(0,0,e,n),u.drawImage(o,0,0,o.width,o.height,0,0,e,n)}let u=null;if(n){let t,n;if(a.symmetric&&o.width<e&&o.height<e)t=o.width,n=o.height;else if(o=this.#e,r>e||i>e){let a=Math.min(e/r,e/i);t=Math.floor(r*a),n=Math.floor(i*a),this.#l||(o=this.#h(t,n))}let s=new OffscreenCanvas(t,n).getContext(`2d`,{willReadFrequently:!0});s.drawImage(o,0,0,o.width,o.height,0,0,t,n),u={width:t,height:n,data:s.getImageData(0,0,t,n).data}}return{canvas:l,width:s,height:c,imageData:u}}#h(e,t){let{width:n,height:r}=this.#e,i=n,a=r,o=this.#e;for(;i>2*e||a>2*t;){let n=i,r=a;i>2*e&&(i=Math.ceil(i/2)),a>2*t&&(a=Math.ceil(a/2));let s=new OffscreenCanvas(i,a);s.getContext(`2d`).drawImage(o,0,0,n,r,0,0,i,a),o=s.transferToImageBitmap()}return o}#g(){let[e,t]=this.parentDimensions,{width:n,height:r}=this,i=new is,a=Math.ceil(n*e*i.sx),o=Math.ceil(r*t*i.sy),s=this.#o;if(!s||s.width===a&&s.height===o)return;s.width=a,s.height=o;let c=this.#l?this.#e:this.#h(a,o),l=s.getContext(`2d`);l.filter=this._uiManager.hcmFilter,l.drawImage(c,0,0,c.width,c.height,0,0,a,o)}#_(e){if(e){if(this.#l){let e=this._uiManager.imageManager.getSvgUrl(this.#t);if(e)return e}let e=document.createElement(`canvas`);return{width:e.width,height:e.height}=this.#e,e.getContext(`2d`).drawImage(this.#e,0,0),e.toDataURL()}if(this.#l){let[e,t]=this.pageDimensions,n=Math.round(this.width*e*es.PDF_TO_CSS_UNITS),r=Math.round(this.height*t*es.PDF_TO_CSS_UNITS),i=new OffscreenCanvas(n,r);return i.getContext(`2d`).drawImage(this.#e,0,0,this.#e.width,this.#e.height,0,0,n,r),i.transferToImageBitmap()}return structuredClone(this.#e)}static async deserialize(e,t,n){let r=null,i=!1;if(e instanceof su){let{data:{rect:a,rotation:o,id:s,structParent:c,popupRef:l,richText:u,contentsObj:d,creationDate:f,modificationDate:p},container:m,parent:{page:{pageNumber:h}},canvas:g}=e,_,v;g?(delete e.canvas,{id:_,bitmap:v}=n.imageManager.getFromCanvas(m.id,g),g.remove()):(i=!0,e._hasNoCanvas=!0);let y=(await t._structTree.getAriaAttributes(`${xo}${s}`))?.get(`aria-label`)||``;r=e={annotationType:Co.STAMP,bitmapId:_,bitmap:v,pageIndex:h-1,rect:a.slice(0),rotation:o,annotationElementId:s,id:s,deleted:!1,accessibilityData:{decorative:!1,altText:y},isSvg:!1,structParent:c,popupRef:l,richText:u,comment:d?.str||null,creationDate:f,modificationDate:p}}let a=await super.deserialize(e,t,n),{rect:o,bitmap:s,bitmapUrl:c,bitmapId:l,isSvg:u,accessibilityData:d}=e;i?(n.addMissingCanvas(e.id,a),a.#s=!0):l&&n.imageManager.isValidId(l)?(a.#t=l,s&&(a.#e=s)):a.#r=c,a.#l=u;let[f,p]=a.pageDimensions;return a.width=(o[2]-o[0])/f,a.height=(o[3]-o[1])/p,d&&(a.altTextData=d),a._initialData=r,e.comment&&a.setCommentData(e),a.#u=!!r,a}serialize(e=!1,t=null){if(this.isEmpty())return null;if(this.deleted)return this.serializeDeleted();let n=Object.assign(super.serialize(e),{bitmapId:this.#t,isSvg:this.#l});if(this.addComment(n),e)return n.bitmapUrl=this.#_(!0),n.accessibilityData=this.serializeAltText(!0),n.isCopy=!0,n;let{decorative:r,altText:i}=this.serializeAltText(!1);if(!r&&i&&(n.accessibilityData={type:`Figure`,alt:i}),this.annotationElementId){let e=this.#v(n);return e.isSame?null:(e.isSameAltText?delete n.accessibilityData:n.accessibilityData.structParent=this._initialData.structParent??-1,n.id=this.annotationElementId,delete n.bitmapId,n)}if(t===null)return n;t.stamps||=new Map;let a=this.#l?(n.rect[2]-n.rect[0])*(n.rect[3]-n.rect[1]):null;if(!t.stamps.has(this.#t))t.stamps.set(this.#t,{area:a,serialized:n}),n.bitmap=this.#_(!1);else if(this.#l){let e=t.stamps.get(this.#t);a>e.area&&(e.area=a,e.serialized.bitmap.close(),e.serialized.bitmap=this.#_(!1))}return n}#v(e){let{pageIndex:t,accessibilityData:{altText:n}}=this._initialData,r=e.pageIndex===t,i=(e.accessibilityData?.alt||``)===n;return{isSame:!this.hasEditedComment&&!this._hasBeenMoved&&!this._hasBeenResized&&r&&i,isSameAltText:i}}renderAnnotationElement(e){return this.deleted?(e.hide(),null):(e.updateEdited({rect:this.getPDFRect(),popup:this.comment}),null)}},Iu=class e{#e;#t=!1;#n=null;#r=null;#i=null;#a=new Map;#o=!1;#s=!1;#c=!1;#l=null;#u=null;#d=null;#f=null;#p=null;#m=-1;#h;static _initialized=!1;static#g=new Map([fu,Du,Fu,Cu,Pu].map(e=>[e._editorType,e]));constructor({uiManager:t,pageIndex:n,div:r,structTreeLayer:i,accessibilityManager:a,annotationLayer:o,drawLayer:s,textLayer:c,viewport:l,l10n:u}){let d=[...e.#g.values()];if(!e._initialized){e._initialized=!0;for(let e of d)e.initialize(u,t)}t.registerEditorTypes(d),this.#h=t,this.pageIndex=n,this.div=r,this.#e=a,this.#n=o,this.viewport=l,this.#d=c,this.drawLayer=s,this._structTree=i,this.#h.addLayer(this)}get isEmpty(){return this.#a.size===0}get isInvisible(){return this.isEmpty&&this.#h.getMode()===Co.NONE}updateToolbar(e){this.#h.updateToolbar(e)}updateMode(t=this.#h.getMode()){switch(this.#S(),t){case Co.NONE:this.div.classList.toggle(`nonEditing`,!0),this.disableTextSelection(),this.togglePointerEvents(!1),this.toggleAnnotationLayerPointerEvents(!0),this.disableClick();return;case Co.INK:this.disableTextSelection(),this.togglePointerEvents(!0),this.enableClick();break;case Co.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;if(n.toggle(`nonEditing`,!1),t===Co.POPUP)n.toggle(`commentEditing`,!0);else{n.toggle(`commentEditing`,!1);for(let r of e.#g.values())n.toggle(`${r._type}Editing`,t===r._editorType)}this.div.hidden=!1}hasTextLayer(e){return e===this.#d?.div}setEditingState(e){this.#h.setEditingState(e)}addCommands(e){this.#h.addCommands(e)}cleanUndoStack(e){this.#h.cleanUndoStack(e)}toggleDrawing(e=!1){this.div.classList.toggle(`drawing`,!e)}togglePointerEvents(e=!1){this.div.classList.toggle(`disabled`,!e)}toggleAnnotationLayerPointerEvents(e=!1){this.#n?.togglePointerEvents(e)}get#_(){return this.#a.size===0?this.#h.getEditors(this.pageIndex):this.#a.values()}async enable(){this.#c=!0,this.div.tabIndex=0,this.togglePointerEvents(!0),this.div.classList.toggle(`nonEditing`,!1),this.#p?.abort(),this.#p=null;let e=new Set;for(let t of this.#_)t.enableEditing(),t.show(!0),t.annotationElementId&&(this.#h.removeChangedExistingAnnotation(t),e.add(t.annotationElementId));let t=this.#n;if(t)for(let n of t.getEditableAnnotations()){if(n.hide(),this.#h.isDeletedAnnotationElement(n.data.id)||e.has(n.data.id))continue;let t=await this.deserialize(n);t&&(this.addOrRebuild(t),t.enableEditing())}this.#c=!1,this.#h._eventBus.dispatch(`editorsrendered`,{source:this,pageNumber:this.pageIndex+1})}disable(){if(this.#s=!0,this.div.tabIndex=-1,this.togglePointerEvents(!1),this.div.classList.toggle(`nonEditing`,!0),this.#d&&!this.#p){this.#p=new AbortController;let e=this.#h.combinedSignal(this.#p);this.#d.div.addEventListener(`pointerdown`,e=>{let{clientX:t,clientY:n,timeStamp:r}=e;if(r-this.#m>500){this.#m=r;return}this.#m=-1;let{classList:i}=this.div;i.toggle(`getElements`,!0);let a=document.elementsFromPoint(t,n);if(i.toggle(`getElements`,!1),!this.div.contains(a[0]))return;let o,s=RegExp(`^${So}[0-9]+$`);for(let e of a)if(s.test(e.id)){o=e.id;break}if(!o)return;let c=this.#a.get(o);c?.annotationElementId===null&&(_t(e),c.dblclick(e))},{signal:e,capture:!0})}let t=this.#n,n=[];if(t){let e=new Map,r=new Map;for(let t of this.#_)t.disableEditing(),t.annotationElementId?t.serialize()===null?(r.set(t.annotationElementId,t),this.getEditableAnnotation(t.annotationElementId)?.show(),t.remove()):e.set(t.annotationElementId,t):n.push(t);for(let n of t.getEditableAnnotations()){let{id:t}=n.data;if(this.#h.isDeletedAnnotationElement(t)){n.updateEdited({deleted:!0});continue}let i=r.get(t);i?(i.resetAnnotationElement(n),i.show(!1),n.show()):(i=e.get(t),i&&(this.#h.addChangedExistingAnnotation(i),i.renderAnnotationElement(n)&&i.show(!1)),n.show())}}this.#S(),this.isEmpty&&(this.div.hidden=!0);let{classList:r}=this.div;for(let t of e.#g.values())r.remove(`${t._type}Editing`);this.disableTextSelection(),this.toggleAnnotationLayerPointerEvents(!0),t?.updateFakeAnnotations(n),this.#s=!1}getEditableAnnotation(e){return this.#n?.getEditableAnnotation(e)||null}setActiveEditor(e){this.#h.getActive()!==e&&this.#h.setActiveEditor(e)}enableTextSelection(){if(this.div.tabIndex=-1,this.#d?.div&&!this.#f){this.#f=new AbortController;let e=this.#h.combinedSignal(this.#f);this.#d.div.addEventListener(`pointerdown`,this.#v.bind(this),{signal:e}),this.#d.div.classList.add(`highlighting`)}}disableTextSelection(){this.div.tabIndex=0,this.#d?.div&&this.#f&&(this.#f.abort(),this.#f=null,this.#d.div.classList.remove(`highlighting`))}#v(e){this.#h.unselectAll();let{target:t}=e;if(t===this.#d.div||(t.getAttribute(`role`)===`img`||t.classList.contains(`endOfContent`)||t.classList.contains(`textLayerImages`)||t.classList.contains(`textLayerImagePlaceholder`))&&this.#d.div.contains(t)){let{isMac:t}=Ho.platform;if(e.button!==0||e.ctrlKey&&t)return;this.#h.showAllEditors(`highlight`,!0,!0),Cu.startDrawing(this,this.#h,this.#h.direction===`ltr`,e),e.preventDefault()}}enableClick(){if(this.#r)return;this.#r=new AbortController;let e=this.#h.combinedSignal(this.#r);this.div.addEventListener(`pointerdown`,this.pointerdown.bind(this),{signal:e});let t=this.pointerup.bind(this);this.div.addEventListener(`pointerup`,t,{signal:e}),this.div.addEventListener(`pointercancel`,t,{signal:e})}disableClick(){this.#r?.abort(),this.#r=null}attach(e){this.#a.set(e.id,e);let{annotationElementId:t}=e;t&&this.#h.isDeletedAnnotationElement(t)&&this.#h.removeDeletedAnnotationElement(e)}detach(e){this.#a.delete(e.id),this.#e?.removePointerInTextLayer(e.contentDiv),!this.#s&&e.annotationElementId&&this.#h.addDeletedAnnotationElement(e)}remove(e){this.detach(e),this.#h.removeEditor(e),e.div.remove(),e.isAttachedToDOM=!1}changeParent(e){e.parent!==this&&(e.parent&&e.annotationElementId&&(this.#h.addDeletedAnnotationElement(e),Cs.deleteAnnotationElement(e),e.annotationElementId=null),this.attach(e),e.parent?.detach(e),e.setParent(this),e.div&&e.isAttachedToDOM&&(e.div.remove(),this.div.append(e.div)))}add(e){if(!(e.parent===this&&e.isAttachedToDOM)){if(this.changeParent(e),this.#h.addEditor(e),this.attach(e),!e.isAttachedToDOM){let t=e.render();this.div.append(t),e.isAttachedToDOM=!0}e.fixAndSetPosition(),e.onceAdded(!this.#c),this.#h.addToAnnotationStorage(e),e._reportTelemetry(e.telemetryInitialData)}}moveEditorInDOM(e){if(!e.isAttachedToDOM)return;let{activeElement:t}=document;e.div.contains(t)&&!this.#i&&(e._focusEventsAllowed=!1,this.#i=setTimeout(()=>{this.#i=null,e.div.contains(document.activeElement)?e._focusEventsAllowed=!0:(e.div.addEventListener(`focusin`,()=>{e._focusEventsAllowed=!0},{once:!0,signal:this.#h._signal}),t.focus())},0)),e._structTreeParentId=this.#e?.moveElementInDOM(this.div,e.div,e.contentDiv,!0)}addOrRebuild(e){e.needsToBeRebuilt()?(e.parent||=this,e.rebuild(),e.show()):this.add(e)}addUndoableEditor(e){this.addCommands({cmd:()=>e._uiManager.rebuild(e),undo:()=>{e.remove()},mustExec:!1})}getEditorByUID(e){for(let t of this.#a.values())if(t.uid===e)return t;return null}get#y(){return e.#g.get(this.#h.getMode())}combinedSignal(e){return this.#h.combinedSignal(e)}#b(e){let t=this.#y;return t?new t.prototype.constructor(e):null}canCreateNewEmptyEditor(){return this.#y?.canCreateNewEmptyEditor()}async pasteEditor(e,t){this.updateToolbar(e),await this.#h.updateMode(e.mode);let{offsetX:n,offsetY:r}=this.#x(),i=this.#h.getId(),a=this.#b({parent:this,id:i,x:n,y:r,uiManager:this.#h,isCentered:!0,...t});a&&this.add(a)}async deserialize(t){return await e.#g.get(t.annotationType??t.annotationEditorType)?.deserialize(t,this,this.#h)||null}createAndAddNewEditor(e,t,n={}){let r=this.#h.getId(),i=this.#b({parent:this,id:r,x:e.offsetX,y:e.offsetY,uiManager:this.#h,isCentered:t,...n});return i&&this.add(i),i}get boundingClientRect(){return this.div.getBoundingClientRect()}#x(){let{x:e,y:t,width:n,height:r}=this.boundingClientRect,i=Math.max(0,e),a=Math.max(0,t),o=Math.min(window.innerWidth,e+n),s=Math.min(window.innerHeight,t+r),c=(i+o)/2-e,l=(a+s)/2-t,[u,d]=this.viewport.rotation%180==0?[c,l]:[l,c];return{offsetX:u,offsetY:d}}addNewEditor(e={}){this.createAndAddNewEditor(this.#x(),!0,e)}setSelected(e){this.#h.setSelected(e)}toggleSelected(e){this.#h.toggleSelected(e)}unselect(e){this.#h.unselect(e)}pointerup(e){let{isMac:t}=Ho.platform;if(e.button!==0||e.ctrlKey&&t||e.target!==this.div||!this.#o||(this.#o=!1,this.#y?.isDrawer&&this.#y.supportMultipleDrawings))return;if(!this.#t){this.#t=!0;return}let n=this.#h.getMode();n===Co.STAMP||n===Co.POPUP||n===Co.SIGNATURE?this.#h.unselectAll():this.createAndAddNewEditor(e,!1)}pointerdown(e){if(this.#h.getMode()===Co.HIGHLIGHT&&this.enableTextSelection(),this.#o){this.#o=!1;return}let{isMac:t}=Ho.platform;if(e.button!==0||e.ctrlKey&&t||e.target!==this.div)return;if(this.#o=!0,this.#y?.isDrawer){this.startDrawingSession(e);return}let n=this.#h.getActive();this.#t=!n||n.isEmpty()}startDrawingSession(e){if(this.div.focus({preventScroll:!0}),this.#l){this.#y.startDrawing(this,this.#h,!1,e);return}this.#h.setCurrentDrawingSession(this),this.#l=new AbortController;let t=this.#h.combinedSignal(this.#l);this.div.addEventListener(`blur`,({relatedTarget:e})=>{e&&!this.div.contains(e)&&(this.#u=null,this.commitOrRemove())},{signal:t}),this.#y.startDrawing(this,this.#h,!1,e)}pause(e){if(e){let{activeElement:e}=document;this.div.contains(e)&&(this.#u=e)}else this.#u&&setTimeout(()=>{this.#u?.focus(),this.#u=null},0)}endDrawingSession(e=!1){return this.#l?(this.#h.setCurrentDrawingSession(null),this.#l.abort(),this.#l=null,this.#u=null,this.#y.endDrawing(e)):null}findNewParent(e,t,n){let r=this.#h.findParent(t,n);return r===null||r===this?!1:(r.changeParent(e),!0)}commitOrRemove(){return this.#l?(this.endDrawingSession(),!0):!1}onScaleChanging(){this.#l&&this.#y.onScaleChangingWhenDrawing(this)}destroy(){this.commitOrRemove(),this.#h.getActive()?.parent===this&&(this.#h.commitOrRemove(),this.#h.setActiveEditor(null)),this.#i&&=(clearTimeout(this.#i),null);for(let e of this.#a.values())this.#e?.removePointerInTextLayer(e.contentDiv),e.setParent(null),e.isAttachedToDOM=!1,e.div.remove();this.div=null,this.#a.clear(),this.#h.removeLayer(this)}#S(){for(let e of this.#a.values())e.isEmpty()&&e.remove()}async render({viewport:e}){this.viewport=e,Ct(this.div,e);for(let e of this.#h.getEditors(this.pageIndex))this.add(e),e.rebuild();await this.#h.findClonesForPage(this),this.div.hidden=this.isEmpty,this.updateMode()}update({viewport:e}){this.#h.commitOrRemove(),this.#S();let t=this.viewport.rotation,n=e.rotation;if(this.viewport=e,Ct(this.div,{rotation:n}),t!==n)for(let e of this.#a.values())e.rotate(n)}get pageDimensions(){let{pageWidth:e,pageHeight:t}=this.viewport.rawDims;return[e,t]}get scale(){return this.#h.viewParameters.realScale}},Ua(),Lu=class e{#e=null;#t=new Map;#n=null;#r=null;#i=null;#a=null;#o=new Map;static#s=0;static#c=0;static#l=null;static#u=new Set;static#d=!1;static#f=new Set;static#p=new WeakMap;constructor({filterFactory:t=null,pageColors:n=null,pageIndex:r,textLayer:i=null}){if(this.pageIndex=r,this.#r=t,this.#i=n,i){let t=e.#p.get(i);if(t?.selectionDiv&&(t.selectionDiv.remove(),e.#u.delete(t.selectionDiv)),e.#p.set(i,{drawLayer:this}),e.#f.add(i),this.#n=i,this.#a=new MutationObserver(t=>{if(this.#e&&this.#n?.isConnected&&e.#h()){for(let{addedNodes:n}of t)for(let t of n)if(t.nodeType===Node.ELEMENT_NODE&&t.classList.contains(`endOfContent`)){e.#_();return}}}),this.#a.observe(i,{childList:!0}),e.#l===null){e.#l=new AbortController;let{signal:t}=e.#l;document.addEventListener(`selectionchange`,e.#_.bind(e),{signal:t}),document.addEventListener(`pointerdown`,()=>{e.#d=!0},{signal:t}),document.addEventListener(`pointerup`,()=>{e.#d=!1},{signal:t}),window.addEventListener(`blur`,()=>{e.#d=!1},{signal:t})}}}setParent(t){if(!this.#e)this.#e=t,this.#n?.isConnected&&e.#h()&&e.#_();else if(this.#e!==t){if(this.#t.size>0)for(let e of this.#t.values())e.remove(),t.append(e);this.#e=t}}static#m(e){let t=this.#p.get(e);t?.selectionDiv&&(t.selectionDiv.remove(),this.#u.delete(t.selectionDiv),t.selectionDiv=null,t.path=null)}static#h(){let e=document.getSelection();return!!e&&!e.isCollapsed}static#g(){return this.#f.keys().filter(e=>e.isConnected).toArray().sort(jn)}static#_(){let t=document.getSelection();if(!t||t.isCollapsed){for(let e of this.#u)e.remove();this.#u.clear();return}let n=new WeakMap,r=this.#g(),i=[];for(let e=0,n=t.rangeCount;e<n;e++){let n=t.getRangeAt(e);if(n.collapsed)continue;let{startContainer:a,startOffset:o,endContainer:s,endOffset:c}=n,l=Mn(a),u=Mn(s),d=l===null,f=u===null;if(this.#d&&d!==f)return;if(t.rangeCount===1){let{anchorNode:e,anchorOffset:n,focusNode:r,focusOffset:i}=t,d=Mn(e),f=Mn(r),p=Nn(e,n,r,i);d&&f&&p!==null&&(p?(a=e,o=n,l=d,s=r,c=i,u=f):(a=r,o=i,l=f,s=e,c=n,u=d))}let p=r.filter(e=>n.intersectsNode(e));if(p.length===0)continue;let m=!1;if(l||(l=p[0],a=l,o=0,m=!0),u||(u=p.at(-1),s=u,c=u.childNodes.length,m=!0),s.nodeType===Node.ELEMENT_NODE){if(s.classList.contains(`endOfContent`)){let e=s.previousSibling;if(!e)continue;s=e,c=e.nodeType===Node.TEXT_NODE?e.textContent.length:e.childNodes.length}else if(s.classList.contains(`textLayer`)&&s.childNodes.length===c){let e=Pn(s,c,u);if(!e)continue;s=e.container,c=e.offset}}if(a.nodeType===Node.ELEMENT_NODE){let e=Pn(a,o,l);if(!e)continue;a=e.container,o=e.offset}if(l===u&&!m&&p.includes(l))i.push([n,l]);else for(let e of p){let t=e.firstChild;if(!t)continue;let n=document.createRange();if(e===l?n.setStart(a,o):n.setStartBefore(t),e===u)n.setEnd(s,c);else{let t=e.lastChild;if(!t)continue;if(t.nodeType===Node.ELEMENT_NODE&&t.classList.contains(`endOfContent`)){let e=t.previousSibling;if(!e)continue;n.setEndAfter(e)}else n.setEndAfter(t)}n.collapsed||i.push([n,e])}}let a=new Set(i.map(e=>e[1]));for(let e of this.#f)a.has(e)||this.#m(e);for(let[t,r]of i){let i=e.#p.get(r);if(!i)continue;let a=n.get(r);if(!a){let e=r.getBoundingClientRect();a=(t,n,r,i)=>({x:(t-e.x)/e.width,y:(n-e.y)/e.height,width:r/e.width,height:i/e.height}),n.set(r,a)}let o=[];for(let{x:e,y:n,width:r,height:i}of t.getClientRects())r!==0&&i!==0&&({x:e,y:n,width:r,height:i}=a(e,n,r,i),(r!==1||i!==1)&&o.push(`M${e} ${n} h${r} v${i} h-${r} Z`));if(o.length===0)continue;let s=i.drawLayer,c=i.selectionDiv,l=i.path;if(!c){let t=`clip_selection_${e.#c++}`;c=document.createElement(`div`),c.className=`selection`,c.style.clipPath=`url(#${t})`;let n=s.#r?.createSelectionStyle(s.#i);if(n)for(let[e,t]of Object.entries(n))c.style.setProperty(e,t);let r=e._svgFactory.create(1,1,!0);r.setAttribute(`aria-hidden`,`true`),r.setAttribute(`width`,`100%`),r.setAttribute(`height`,`100%`);let a=e._svgFactory.createElement(`clipPath`);a.setAttribute(`id`,t),a.setAttribute(`clipPathUnits`,`objectBoundingBox`),l=e._svgFactory.createElement(`path`),a.append(l),r.append(a),c.append(r),i.path=l,i.selectionDiv=c}s.#e&&c.parentNode!==s.#e&&(s.#e.append(c),this.#u.add(c)),l.setAttribute(`d`,o.join(` `))}}static get _svgFactory(){return V(this,`_svgFactory`,new jl)}static#v(e,[t,n,r,i]){let{style:a}=e;a.top=`${100*n}%`,a.left=`${100*t}%`,a.width=`${100*r}%`,a.height=`${100*i}%`}#y(){let t=e._svgFactory.create(1,1,!0);return this.#e.append(t),t.setAttribute(`aria-hidden`,`true`),t}#b(t,n){let r=e._svgFactory.createElement(`clipPath`);t.append(r);let i=`clip_${n}`;r.setAttribute(`id`,i),r.setAttribute(`clipPathUnits`,`objectBoundingBox`);let a=e._svgFactory.createElement(`use`);return r.append(a),a.setAttribute(`href`,`#${n}`),a.classList.add(`clip`),i}#x(e,t){for(let[n,r]of Object.entries(t))r===null?e.removeAttribute(n):e.setAttribute(n,r)}draw(t,n=!1,r=!1){let i=e.#s++,a=this.#y(),o=e._svgFactory.createElement(`defs`);a.append(o);let s=e._svgFactory.createElement(`path`);o.append(s);let c=`path_${i}`;s.setAttribute(`id`,c),s.setAttribute(`vector-effect`,`non-scaling-stroke`),n&&this.#o.set(i,s);let l=r?this.#b(o,c):null,u=e._svgFactory.createElement(`use`);return a.append(u),u.setAttribute(`href`,`#${c}`),this.updateProperties(a,t),this.#t.set(i,a),{id:i,clipPathId:`url(#${l})`}}drawOutline(t,n){let r=e.#s++,i=this.#y(),a=e._svgFactory.createElement(`defs`);i.append(a);let o=e._svgFactory.createElement(`path`);a.append(o);let s=`path_${r}`;o.setAttribute(`id`,s),o.setAttribute(`vector-effect`,`non-scaling-stroke`);let c;if(n){let t=e._svgFactory.createElement(`mask`);a.append(t),c=`mask_${r}`,t.setAttribute(`id`,c),t.setAttribute(`maskUnits`,`objectBoundingBox`);let n=e._svgFactory.createElement(`rect`);t.append(n),n.setAttribute(`width`,`1`),n.setAttribute(`height`,`1`),n.setAttribute(`fill`,`white`);let i=e._svgFactory.createElement(`use`);t.append(i),i.setAttribute(`href`,`#${s}`),i.setAttribute(`stroke`,`none`),i.setAttribute(`fill`,`black`),i.setAttribute(`fill-rule`,`nonzero`),i.classList.add(`mask`)}let l=e._svgFactory.createElement(`use`);i.append(l),l.setAttribute(`href`,`#${s}`),c&&l.setAttribute(`mask`,`url(#${c})`);let u=l.cloneNode();return i.append(u),l.classList.add(`mainOutline`),u.classList.add(`secondaryOutline`),this.updateProperties(i,t),this.#t.set(r,i),r}finalizeDraw(e,t){this.#o.delete(e),this.updateProperties(e,t)}updateProperties(t,n){if(!n)return;let{root:r,bbox:i,rootClass:a,path:o}=n,s=typeof t==`number`?this.#t.get(t):t;if(s){if(r&&this.#x(s,r),i&&e.#v(s,i),a){let{classList:e}=s;for(let[t,n]of Object.entries(a))e.toggle(t,n)}if(o){let e=s.firstElementChild.firstElementChild;this.#x(e,o)}}}updateParent(e,t){if(t===this)return;let n=this.#t.get(e);n&&(t.#e.append(n),this.#t.delete(e),t.#t.set(e,n))}remove(e){this.#o.delete(e),this.#e!==null&&(this.#t.get(e).remove(),this.#t.delete(e))}destroy(){this.#e=null;for(let e of this.#t.values())e.remove();this.#t.clear(),this.#o.clear(),this.#a?.disconnect(),this.#a=null,this.#n&&=(e.#p.get(this.#n)?.drawLayer===this&&(e.#m(this.#n),e.#p.delete(this.#n),e.#f.delete(this.#n),e.#f.size===0&&(e.#l?.abort(),e.#l=null,e.#d=!1)),null)}},Ru=class e{#e=[];#t=new Map;#n=null;#r=0;#i=0;#a=0;static#o=null;constructor(e,t,n,r){this.#r=e,this.#e=t,this.#i=n.rawDims.pageWidth,this.#a=n.rawDims.pageHeight,this.#n=r}render(){let t=document.createElement(`div`);t.className=`textLayerImages`;for(let e=0;e<this.#e.length;e+=6){let n=this.#s(this.#e.subarray(e,e+6));n&&t.append(n)}return t.addEventListener(`contextmenu`,t=>{if(!(t.target instanceof HTMLCanvasElement))return;let n=t.target,r=this.#t.get(n);if(!r)return;let i=e.#o?.deref();if(i===n)return;i&&(i.width=0,i.height=0),e.#o=new WeakRef(n);let{inverseTransform:a,x1:o,y1:s,width:c,height:l}=r,u=this.#n(),d=Math.ceil(o*u.width),f=Math.ceil(s*u.height),p=Math.floor((o+c/this.#i)*u.width),m=Math.floor((s+l/this.#a)*u.height);n.width=p-d,n.height=m-f;let h=n.getContext(`2d`);h.setTransform(...a),h.translate(-d,-f),h.drawImage(u,0,0)}),t}#s([e,t,n,r,i,a]){let o=Math.hypot((i-e)*this.#i,(a-t)*this.#a),s=Math.hypot((n-e)*this.#i,(r-t)*this.#a);if(o<this.#r||s<this.#r)return null;let c=[(i-e)*this.#i/o,(a-t)*this.#a/o,(n-e)*this.#i/s,(r-t)*this.#a/s,0,0],l=H.inverseTransform(c),u=document.createElement(`canvas`);return u.className=`textLayerImagePlaceholder`,u.width=0,u.height=0,Object.assign(u.style,{opacity:0,position:`absolute`,left:Fn(e),top:Fn(t),width:Fn(o/this.#i),height:Fn(s/this.#a),transformOrigin:`0% 0%`,transform:`matrix(${c.join(`,`)})`}),this.#t.set(u,{inverseTransform:l,width:o,height:s,x1:e,y1:t}),u}},globalThis._pdfjsTestingUtils={HighlightOutliner:_u},globalThis.pdfjsLib={AbortException:Vo,AnnotationEditorLayer:Iu,AnnotationEditorParamsType:wo,AnnotationEditorType:Co,AnnotationEditorUIManager:vs,AnnotationLayer:uu,AnnotationMode:bo,AnnotationType:Oo,applyOpacity:wt,build:El,ColorPicker:Dl,createValidAbsoluteUrl:et,CSSConstants:ss,DOMSVGFactory:jl,DrawLayer:Lu,FeatureTest:Ho,fetchData:ut,findContrastColor:kt,getDocument:En,getFilenameFromUrl:pt,getPdfFilenameFromUrl:mt,getRGB:yt,getRGBA:vt,getUuid:st,GlobalWorkerOptions:il,ImageKind:Do,InvalidPDFException:Ro,isDataScheme:dt,isPdfFile:ft,isValidExplicitDest:ic,makeArr:Go,makeMap:Ko,makeObj:qo,makeSet:Jo,MathClamp:lt,noContextMenu:gt,normalizeUnicode:ot,OPS:jo,OutputScale:is,PasswordException:Io,PasswordResponses:No,PDFDataRangeTransport:vl,PDFDateString:rs,PDFWorker:xl,PermissionFlag:To,PixelsPerInch:es,RenderingCancelledException:ts,renderRichText:At,ResponseException:zo,setLayerDimensions:Ct,shadow:V,SignatureExtractor:ju,stopEvent:_t,SupportedImageMimeTypes:as,TextLayer:hl,TextLayerImages:Ru,TouchManager:Ss,updateUrlHash:tt,Util:H,VerbosityLevel:Ao,version:Tl,XfaLayer:$o}})),Bu,Vu;function Hu(){return Vu??=Promise.resolve().then(()=>(zu(),Ke)).then(e=>Bu=e,e=>{throw Vu=void 0,e}),Vu}function Uu(){if(!Bu)throw Error(`pdf.js is used before any document was opened.`);return Bu}async function Wu(e){if(typeof e==`string`){if(e.trim()===``)throw TypeError(`Document URL is empty.`);return{url:e}}if(e instanceof ArrayBuffer)return{data:new Uint8Array(e.slice(0))};if(ArrayBuffer.isView(e)){let t=e;return{data:new Uint8Array(t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength))}}if(typeof Blob<`u`&&e instanceof Blob)return{data:new Uint8Array(await e.arrayBuffer())};throw TypeError(`Unsupported document source: expected a URL string, File, Blob or ArrayBuffer.`)}var Gu=2,Ku=`pdfjs_internal_editor_`,qu=`./pdfjs/`,Ju,Yu=typeof document<`u`&&document.currentScript instanceof HTMLScriptElement?document.currentScript.src:void 0;function Xu(){return{}.url??Yu??document.baseURI}function Zu(e){Ju=e.endsWith(`/`)?e:`${e}/`}function Qu(){return Ju||Zu(new URL(qu,Xu()).href),Ju}var $u=0,ed=class e{task;proxy;id=++$u;constructor(e,t){this.task=e,this.proxy=t}static async open(t,n={}){let r=Qu(),{getDocument:i,GlobalWorkerOptions:a}=await Hu();a.workerSrc=`${r}pdf.worker.min.mjs`;let o=await Wu(t),s=i({...o,...`url`in o&&n.httpHeaders?{httpHeaders:n.httpHeaders}:{},...`url`in o&&n.withCredentials?{withCredentials:!0}:{},...n.password===void 0?{}:{password:n.password},cMapUrl:`${r}cmaps/`,cMapPacked:!0,standardFontDataUrl:`${r}standard_fonts/`,wasmUrl:`${r}wasm/`,iccUrl:`${r}iccs/`}),c=!1;s.onPassword=(e,t)=>{let r=n.requestPassword;r?r(t===Gu).then(t=>{t===null?(c=!0,s.destroy()):e(t)}):(c=!0,s.destroy())};try{return new e(s,await s.promise)}catch(e){throw c||e instanceof Error&&e.name===`PasswordException`?new De(n.password===void 0&&!n.requestPassword?"This PDF is password-protected. Pass its `password` to createViewer.":`This PDF is password-protected, and the right password was not entered.`):e instanceof Error&&/fake worker/i.test(e.message)?Error(`PDFCedar could not load its PDF engine from ${r}. Run "npx pdfcedar-assets public/pdfcedar" (or copy node_modules/pdfcedar/dist/pdfjs/ to any folder your app serves) and pass \`assetBaseUrl: "/pdfcedar/"\`.`,{cause:e}):e}}get pageCount(){return this.proxy.numPages}getPage(e){return this.proxy.getPage(e+1)}getData(){return this.proxy.getData()}async scanAnnotations(e,t=20){let n=new Map,r=[];for(let i=0;i<this.pageCount;i+=t){let a=Array.from({length:Math.min(t,this.pageCount-i)},(e,t)=>i+t),o=await Promise.all(a.map(async e=>[e,await(await this.getPage(e)).getAnnotations()]));for(let[t,i]of o){let a=[];for(let r of i)r.id&&r.subtype&&e.has(r.subtype)?n.set(r.id,{pageIndex:t,popupRef:r.popupRef??null}):Le(r)&&a.push(r);a.length>0&&r.push({pageIndex:t,widgets:a})}}return{annotations:n,widgets:r}}hideAnnotations(e){for(let[t,{pageIndex:n,popupRef:r}]of e)this.proxy.annotationStorage.setValue(`${Ku}pdfcedar-hidden-${t}`,{deleted:!0,id:t,popupRef:r,pageIndex:n})}async pageGeometry(e){let t=await this.getPage(e),{width:n,height:r}=t.getViewport({scale:1}),[i=0,a=0,o=n,s=r]=t.view;return{width:n,height:r,view:[i,a,o,s],rotation:Ve(t.rotate)}}async destroy(){await this.task.destroy()}};function td(e,t,n){let r=[],i=n,a=0;for(let o of e){let e=Math.round(o.width*t),s=Math.round(o.height*t);r.push({top:i,width:e,height:s}),i+=s+n,a=Math.max(a,e)}return{pages:r,totalHeight:i,maxWidth:a}}function nd(e,t){let{pages:n}=e,r=0,i=n.length-1;for(;r<i;){let e=r+i+1>>1;n[e].top<=t?r=e:i=e-1}return r}function rd(e,t,n){if(e.pages.length===0)return[0,-1];let r=nd(e,t),i=e.pages[r];i.top+i.height<t&&r<e.pages.length-1&&r++;let a=nd(e,t+n);return[r,Math.max(r,a)]}function id(e,t,n){return e.pages.length===0?0:nd(e,t+n/3)}function ad(e,t){let n=Ve(e.rotation+t),r=Ve(t)%180!=0;return{...e,rotation:n,width:r?e.height:e.width,height:r?e.width:e.height}}var od=class e{entries;constructor(e){this.entries=e}static of(t){return new e(Array.from({length:t.pageCount},(e,n)=>({key:`${t.id}:${n}`,doc:t,index:n,rotation:0})))}static fromEntries(t){return new e([...t])}get count(){return this.entries.length}at(e){let t=this.entries[e];if(!t)throw RangeError(`Page ${e+1} does not exist (document has ${this.count} pages).`);return t}async page(e){let t=this.at(e),n=await t.doc.getPage(t.index);return{proxy:n,rotation:Ve(n.rotate+t.rotation)}}async geometry(e){let t=this.at(e);return ad(await t.doc.pageGeometry(t.index),t.rotation)}rotated(t,n){let r=[...this.entries],i=this.at(t);return r[t]={...i,rotation:Ve(i.rotation+n)},new e(r)}without(t){if(this.at(t),this.count===1)throw RangeError(`The last page cannot be deleted.`);return new e(this.entries.filter((e,n)=>n!==t))}moved(t,n){let r=this.at(t);this.at(n);let i=this.entries.filter((e,n)=>n!==t);return i.splice(n,0,r),new e(i)}withDocument(t){return new e([...this.entries,...e.of(t).entries])}};Ne();var sd=`http://www.w3.org/2000/svg`;function cd(e,t={}){let n=document.createElementNS(sd,e);for(let[e,r]of Object.entries(t))n.setAttribute(e,String(r));return n}var ld=e=>`${e*100}%`;function ud(e,t,n){let r=He(t,n);Object.assign(e.style,{left:ld(r.left),top:ld(r.top),width:ld(r.width),height:ld(r.height)})}var dd=e=>`${e[0]},${e[1]} ${e[2]},${e[3]} ${e[6]},${e[7]} ${e[4]},${e[5]}`;function fd(e){if(e.length===1){let t=e[0];return`M${t.x} ${t.y}L${t.x+.01} ${t.y}`}return e.map((e,t)=>`${t===0?`M`:`L`}${e.x} ${e.y}`).join(``)}function pd(e,t,n){let[r,i]=I(e,t,n);return`M${r.x} ${r.y}L${t.x} ${t.y}L${i.x} ${i.y}`}var md=`<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M4 4h16a1 1 0 0 1 1 1v11a1 1 0 0 1-1 1H9l-5 4v-4H4a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1z" fill="currentColor" stroke="rgb(0 0 0 / 0.55)" stroke-width="1.2" stroke-linejoin="round"/><path d="M7 9h10M7 12.5h7" stroke="rgb(0 0 0 / 0.55)" stroke-width="1.4" stroke-linecap="round"/></svg>`;function hd(e){let t=(t,n)=>(t.setAttribute(`stroke`,e.color),t.setAttribute(`stroke-width`,String(n)),t.setAttribute(`fill`,`none`),t.setAttribute(`stroke-linecap`,`round`),t.setAttribute(`stroke-linejoin`,`round`),t);switch(e.type){case`highlight`:return e.quads.map(t=>cd(`polygon`,{points:dd(t),fill:e.color,class:`pl-markup`}));case`underline`:case`strikeout`:return e.quads.flatMap(n=>{let r=Math.hypot(n[0]-n[4],n[1]-n[5]),i=e.type===`underline`?.08:.45,a=cd(`line`,{x1:n[4]+(n[0]-n[4])*i,y1:n[5]+(n[1]-n[5])*i,x2:n[6]+(n[2]-n[6])*i,y2:n[7]+(n[3]-n[7])*i});return[cd(`polygon`,{points:dd(n),fill:`transparent`,class:`pl-hit-area`}),t(a,Math.max(.6,r*.07))]});case`ink`:return e.paths.map(n=>t(cd(`path`,{d:fd(n)}),e.strokeWidth));case`rectangle`:case`ellipse`:{let n=e.strokeWidth,{x:r,y:i,width:a,height:o}=e.rect,s={x:r+n/2,y:i+n/2,w:Math.max(0,a-n),h:Math.max(0,o-n)},c=e.type===`rectangle`?cd(`rect`,{x:s.x,y:s.y,width:s.w,height:s.h}):cd(`ellipse`,{cx:s.x+s.w/2,cy:s.y+s.h/2,rx:s.w/2,ry:s.h/2});return t(c,n),e.fillColor&&c.setAttribute(`fill`,e.fillColor),[c]}case`redaction`:{let{x:n,y:r,width:i,height:a}=e.rect,o=cd(`rect`,{x:n,y:r,width:i,height:a,class:e.applied?`pl-redaction pl-redaction-applied`:`pl-redaction`});return e.applied?o.setAttribute(`fill`,`#000`):(t(o,1.5),o.setAttribute(`fill`,e.color),o.setAttribute(`fill-opacity`,`0.15`)),[o]}case`line`:case`arrow`:{let n=[t(cd(`line`,{x1:e.start.x,y1:e.start.y,x2:e.end.x,y2:e.end.y}),e.strokeWidth)];return e.type===`arrow`&&n.push(t(cd(`path`,{d:pd(e.start,e.end,e.strokeWidth)}),e.strokeWidth)),n}default:return[]}}function gd(e){let t=e.cloneNode();return t.setAttribute(`stroke`,`transparent`),t.setAttribute(`stroke-width`,`12`),t.setAttribute(`vector-effect`,`non-scaling-stroke`),t.setAttribute(`fill`,`none`),t.setAttribute(`class`,`pl-hit`),t}var _d=class{svg;html;group;previewGroup;selection=null;constructor(e){this.svg=cd(`svg`,{class:`pl-annotations`,viewBox:`0 0 1 1`,preserveAspectRatio:`none`}),this.group=cd(`g`),this.previewGroup=cd(`g`,{class:`pl-preview`}),this.svg.append(this.group,this.previewGroup),this.html=document.createElement(`div`),this.html.className=`pl-annotations-html`,e.append(this.svg,this.html)}render(e,t,n={}){let r=`matrix(${Ge(t).join(` `)})`;this.group.setAttribute(`transform`,r),this.previewGroup.setAttribute(`transform`,r);let i=n.editingId?this.html.querySelector(`[data-annotation-id="${CSS.escape(n.editingId)}"]`):null;this.group.replaceChildren();for(let e of[...this.html.children])e!==i&&e!==this.selection&&e.remove();for(let r of e){if(r.type===`reply`)continue;if(r.type===`note`||r.type===`freeText`||r.type===`signature`){if(r.id===n.editingId&&i)continue;this.html.insertBefore(this.drawHtml(r,t,n.replyCounts?.get(r.id)??0),this.selection);continue}let e=cd(`g`,{class:`pl-annot`,"data-annotation-id":r.id,"data-type":r.type,opacity:r.opacity}),a=hd(r);if(e.append(...a),r.type!==`highlight`&&r.type!==`underline`&&r.type!==`strikeout`)for(let t of a)e.append(gd(t));this.group.append(e)}this.renderSelection(e.find(e=>e.id===n.selectedId)??null,t)}preview(e,t){if(this.previewGroup.replaceChildren(),this.html.querySelector(`.pl-preview-html`)?.remove(),!e)return;if(e.type===`note`||e.type===`freeText`||e.type===`signature`){let n=this.drawHtml(e,t,0);n.classList.add(`pl-preview-html`),n.removeAttribute(`data-annotation-id`),this.html.append(n);return}this.previewGroup.setAttribute(`transform`,`matrix(${Ge(t).join(` `)})`);let n=cd(`g`,{opacity:e.opacity});n.append(...hd(e)),this.previewGroup.append(n)}element(e){return this.svg.querySelector(`[data-annotation-id="${CSS.escape(e)}"]`)??this.html.querySelector(`[data-annotation-id="${CSS.escape(e)}"]`)}drawHtml(e,t,n){let r=document.createElement(`div`);if(r.dataset.annotationId=e.id,r.dataset.type=e.type,r.style.opacity=String(e.opacity),ud(r,e.rect,t),e.type===`note`){if(r.className=`pl-annot pl-note`,r.style.color=e.color,r.innerHTML=md,r.setAttribute(`role`,`button`),r.setAttribute(`aria-label`,`Comment by ${e.author||`unknown`}${e.contents?`: ${e.contents}`:``}`),n>0){let e=document.createElement(`span`);e.className=`pl-note-badge`,e.textContent=String(n),r.append(e)}}else if(e.type===`freeText`)r.className=`pl-annot pl-freetext`,Object.assign(r.style,{color:e.color,fontSize:`calc(var(--total-scale-factor) * ${e.fontSize}px)`,background:e.backgroundColor??`transparent`,borderColor:e.borderColor??`transparent`}),r.textContent=e.contents;else if(e.type===`signature`){r.className=`pl-annot pl-signature`;let t=document.createElement(`img`);t.src=e.image,t.alt=`Signature${e.author?` by ${e.author}`:``}`,t.draggable=!1,r.append(t)}return r}renderSelection(e,t){if(this.selection?.remove(),this.selection=null,!e||e.type===`reply`)return;let n=document.createElement(`div`);if(n.className=`pl-selection`,n.dataset.selectionFor=e.id,ud(n,e.rect,t),e.type===`line`||e.type===`arrow`){n.classList.add(`pl-selection-line`);for(let[r,i]of[[`start`,e.start],[`end`,e.end]]){let a=Ue(i,t),o=He(e.rect,t),s=document.createElement(`div`);s.className=`pl-handle`,s.dataset.handle=r,s.style.left=ld(o.width?(a.x-o.left)/o.width:.5),s.style.top=ld(o.height?(a.y-o.top)/o.height:.5),n.append(s)}}else if(ge(e)&&!e.locked)for(let t of _e(e)){let e=document.createElement(`div`);e.className=`pl-handle`,e.dataset.handle=t,n.append(e)}this.html.append(n),this.selection=n}},vd=16777216;function yd(e,t){let n=globalThis.devicePixelRatio||1,r=Math.sqrt(vd/Math.max(1,e*t));return Math.min(n,r)}function bd(e){return e instanceof Error&&e.name===`RenderingCancelledException`}async function xd(e,t,n,r=e.rotate){let i=e.getViewport({scale:t,rotation:r}),a=e.getViewport({scale:t*yd(i.width,i.height),rotation:r}),o=document.createElement(`canvas`);o.width=Math.floor(a.width),o.height=Math.floor(a.height);let s=e.render({canvas:o,viewport:a,annotationMode:Uu().AnnotationMode.ENABLE_STORAGE});n?.(s);try{return await s.promise,o}catch(e){if(Sd(o),bd(e))return null;throw e}}function Sd(e){e.width=0,e.height=0,e.remove()}var Cd=class{index;key;el;canvas=null;task=null;textLayer=null;textDiv=null;highlightDiv=null;highlights=new Map;currentHighlight=null;annotationLayer=null;formLayer=null;textMask=[];renderedScale=0;rendering=!1;renderedRotation=null;constructor(e,t){this.index=e,this.key=t,this.el=document.createElement(`div`),this.el.className=`pl-page`,this.setIndex(e)}setIndex(e){this.index=e,this.el.dataset.pageNumber=String(e+1)}isRenderedAt(e,t){return this.renderedScale===e&&this.renderedRotation===t}get forms(){return this.formLayer||(this.formLayer=document.createElement(`div`),this.formLayer.className=`pl-forms`,this.el.insertBefore(this.formLayer,this.el.querySelector(`.pl-annotations`))),this.formLayer}get annotations(){return this.annotationLayer??=new _d(this.el),this.annotationLayer}place(e,t){let{style:n}=this.el;n.setProperty(`--total-scale-factor`,String(t)),n.top=`${e.top}px`,n.width=`${e.width}px`,n.height=`${e.height}px`,n.left=`calc(50% - ${e.width/2}px)`}async render(e,t,n=e.rotate,r){this.cancel(),this.rendering=!0,this.renderedRotation!==null&&this.renderedRotation!==n&&this.dropTextLayer();try{let i=await xd(e,t,e=>this.task=e,n);if(!i)return;r?.(i),i.className=`pl-page-canvas`,this.canvas?(this.canvas.replaceWith(i),Sd(this.canvas)):this.el.prepend(i),this.canvas=i,this.renderedScale=t,this.renderedRotation=n,this.el.dataset.rendered=`true`}finally{this.task=null,this.rendering=!1}await this.renderText(e,t,n)}async renderText(e,t,n){let r=e.getViewport({scale:t,rotation:n});if(this.textLayer){this.textLayer.update({viewport:r});return}let i=document.createElement(`div`);i.className=`textLayer`;let a=new(Uu()).TextLayer({textContentSource:e.streamTextContent({includeMarkedContent:!0,disableNormalization:!0}),container:i,viewport:r});this.textLayer=a;try{await a.render()}catch(e){if(this.textLayer===a&&(this.textLayer=null),bd(e)||e instanceof Error&&e.name===`AbortException`)return;throw e}if(this.textLayer!==a)return;let o=document.createElement(`div`);o.className=`endOfContent`,i.append(o),this.el.append(i),this.textDiv=i,this.applyTextMask(),this.el.dataset.textLayer=`true`}setTextMask(e){this.textMask=e,this.applyTextMask()}applyTextMask(){if(!this.textDiv||this.textMask.length===0)return;let e=this.el.getBoundingClientRect();if(e.width&&e.height)for(let t of this.textDiv.querySelectorAll(`span`)){let n=t.getBoundingClientRect();if(!n.width||!n.height)continue;let r=(n.left-e.left)/e.width,i=(n.top-e.top)/e.height,a=r+n.width/e.width,o=i+n.height/e.height;this.textMask.some(e=>r<e.left+e.width&&e.left<a&&i<e.top+e.height&&e.top<o)&&t.remove()}}addHighlight(e,t){this.removeHighlight(e),this.highlightDiv||(this.highlightDiv=document.createElement(`div`),this.highlightDiv.className=`pl-highlights`,this.el.insertBefore(this.highlightDiv,this.textDiv));let n=t.map(t=>{let n=document.createElement(`div`);return n.className=`pl-search-hit`,n.dataset.highlightId=e,Object.assign(n.style,{left:`${t.left*100}%`,top:`${t.top*100}%`,width:`${t.width*100}%`,height:`${t.height*100}%`}),e===this.currentHighlight&&n.classList.add(`pl-current`),n});this.highlightDiv.append(...n),this.highlights.set(e,n)}removeHighlight(e){for(let t of this.highlights.get(e)??[])t.remove();this.highlights.delete(e)}clearHighlights(){this.highlightDiv?.remove(),this.highlightDiv=null,this.highlights.clear(),this.currentHighlight=null}setCurrentHighlight(e){for(let e of this.highlights.get(this.currentHighlight??``)??[])e.classList.remove(`pl-current`);this.currentHighlight=e;for(let t of this.highlights.get(e??``)??[])t.classList.add(`pl-current`)}cancel(){this.task?.cancel(),this.task=null}release(){this.cancel(),this.canvas&&Sd(this.canvas),this.canvas=null,this.renderedScale=0,this.renderedRotation=null,delete this.el.dataset.rendered,this.dropTextLayer()}dropTextLayer(){this.textLayer?.cancel(),this.textLayer=null,this.textDiv?.remove(),this.textDiv=null,delete this.el.dataset.textLayer}},wd=.1,Td=96/72;function Ed(e){if(!Number.isFinite(e))throw RangeError(`Zoom must be a finite number, got ${e}.`);return Math.min(8,Math.max(wd,e))}function Dd(e,t,n,r,i){let a=(n-2*i)/(t.width*Td);if(e===`width`)return Ed(a);let o=(r-2*i)/(t.height*Td);return Ed(Math.min(a,o))}var Od=12,kd=1,Ad=3,jd=2,Md=150,Nd=20,Pd=1.25,Fd=class e{pages;callbacks;scroller;spacer;views;sizes;known=new Map;generation=0;layout;zoom=1;zoomMode=`auto`;current=0;pinned=null;frame=0;rerenderTimer;rerenderBlockedUntil=0;activeRenders=0;destroyed=!1;resizeObserver;constructor(e,t,n,r){this.pages=t,this.callbacks=r,this.scroller=document.createElement(`div`),this.scroller.className=`pl-scroller`,this.scroller.tabIndex=0,this.spacer=document.createElement(`div`),this.spacer.className=`pl-pages`,this.scroller.append(this.spacer),e.append(this.scroller),t.at(0).rotation===0&&this.known.set(t.at(0).key,n),this.sizes=Array.from({length:t.count},()=>({...n})),this.views=t.entries.map((e,t)=>new Cd(t,e.key)),this.spacer.append(...this.views.map(e=>e.el)),this.zoom=this.zoomFor(`auto`),this.layout=this.relayout(),this.scroller.addEventListener(`scroll`,this.onScroll,{passive:!0}),this.resizeObserver=new ResizeObserver(()=>this.onResize()),this.resizeObserver.observe(this.scroller)}static async create(t,n,r={}){let i=new e(t,n,await n.geometry(0),r);return i.update(),i.loadPageSizes(),i}get pageCount(){return this.views.length}get currentIndex(){return this.current}get currentZoom(){return this.zoom}get fitMode(){return this.zoomMode===`width`||this.zoomMode===`page`?this.zoomMode:null}pageSize(e){return this.sizes[e]}decorateCanvas=null;setTextMask(e,t){this.views[e]?.setTextMask(t)}formLayer(e){return this.views[e]?.forms}annotationLayer(e){return this.views[e]?.annotations}pageElement(e){return this.views[e]?.el}pageIndexOf(e){let t=e instanceof Element?e.closest(`.pl-page`):null;return t&&this.spacer.contains(t)?Number(t.dataset.pageNumber)-1:-1}addHighlight(e,t,n){this.views[e]?.addHighlight(t,n)}setCurrentHighlight(e,t){for(let n of this.views)n.setCurrentHighlight(n.index===e?t:null)}clearHighlights(){for(let e of this.views)e.clearHighlights()}scrollToRect(e,t){let n=this.layout.pages[e];if(!n)return;let{scroller:r}=this,i=n.top+t.top*n.height,a=i+t.height*n.height;(i<r.scrollTop||a>r.scrollTop+r.clientHeight)&&(r.scrollTop=i-r.clientHeight/3);let o=Math.max(Od,(this.spacer.offsetWidth-n.width)/2)+t.left*n.width,s=o+t.width*n.width;(o<r.scrollLeft||s>r.scrollLeft+r.clientWidth)&&(r.scrollLeft=o-r.clientWidth/3),this.pinned={index:e,scrollTop:r.scrollTop},this.update()}goToPage(e){let t=this.layout.pages[e];if(!t)throw RangeError(`Page ${e+1} does not exist (document has ${this.pageCount} pages).`);this.scroller.scrollTop=t.top-Od,this.pinned={index:e,scrollTop:this.scroller.scrollTop},this.update()}setZoom(e){this.zoomMode=null,this.applyZoom(Ed(e))}zoomAt(e,t,n){let r=this.scroller.getBoundingClientRect();this.zoomMode=null,this.applyZoom(Ed(e),{x:t-r.left,y:n-r.top})}get zoomLevel(){return this.zoom}fit(e){if(e!==`width`&&e!==`page`)throw TypeError(`fit() expects 'width' or 'page', got ${String(e)}.`);this.zoomMode=e,this.applyZoom(this.zoomFor(e))}get pageList(){return this.pages}setPages(e){let t=this.views[nd(this.layout,this.scroller.scrollTop+this.scroller.clientHeight/2)]?.key,n=new Map(this.views.map(e=>[e.key,e])),r=this.sizes[0];this.views=e.entries.map((e,t)=>{let r=n.get(e.key)??new Cd(t,e.key);return n.delete(e.key),r.setIndex(t),r});for(let e of n.values())e.release(),e.el.remove();this.pages=e,this.sizes=e.entries.map(e=>{let t=this.known.get(e.key);return t?ad(t,e.rotation):{...r}}),this.spacer.replaceChildren(...this.views.map(e=>e.el)),this.current=Math.min(this.current,e.count-1),this.relayout();let i=this.views.findIndex(e=>e.key===t);i>=0&&(this.scroller.scrollTop=this.layout.pages[i].top-Od),this.callbacks.onSizesChange?.(),this.generation++,this.loadPageSizes(),this.update()}rerenderPages(e){for(let t of e)this.views[t]?.release();this.update()}destroy(){if(!this.destroyed){this.destroyed=!0,cancelAnimationFrame(this.frame),clearTimeout(this.rerenderTimer),this.resizeObserver.disconnect(),this.scroller.removeEventListener(`scroll`,this.onScroll);for(let e of this.views)e.release();this.scroller.remove()}}get cssScale(){return this.zoom*Td}zoomFor(e){let t=this.sizes[this.current]??this.sizes[0],n=this.scroller.clientWidth||800,r=this.scroller.clientHeight||600;return e===`auto`?Math.min(Dd(`width`,t,n,r,Od),Pd):Dd(e,t,n,r,Od)}relayout(){let e=td(this.sizes,this.cssScale,Od);this.spacer.style.height=`${e.totalHeight}px`,this.spacer.style.minWidth=`${e.maxWidth+24}px`;let t=this.cssScale;return e.pages.forEach((e,n)=>this.views[n].place(e,t)),this.layout=e,e}relayoutAnchored(e){let{scrollTop:t,scrollLeft:n,clientHeight:r,clientWidth:i}=this.scroller,a=e?.x??i/2,o=e?.y??r/2,s=t+o,c=nd(this.layout,s),l=this.layout.pages[c],u=(s-l.top)/l.height,d=this.pageLeft(l.width),f=l.width>0?(n+a-d)/l.width:.5,p=this.relayout().pages[c];this.scroller.scrollTop=p.top+u*p.height-o,this.scroller.scrollLeft=this.pageLeft(p.width)+f*p.width-a,this.pinned&&={index:this.pinned.index,scrollTop:this.scroller.scrollTop}}pageLeft(e){return Math.max(this.scroller.clientWidth,this.layout.maxWidth+24)/2-e/2}applyZoom(e,t){e!==this.zoom&&(this.zoom=e,this.relayoutAnchored(t),this.rerenderBlockedUntil=performance.now()+Md,clearTimeout(this.rerenderTimer),this.rerenderTimer=setTimeout(()=>this.update(),Md),this.callbacks.onZoomChange?.(e),this.update())}onScroll=()=>{this.frame||=requestAnimationFrame(()=>{this.frame=0,this.update()})};onResize(){this.destroyed||(this.zoomMode&&this.applyZoom(this.zoomFor(this.zoomMode)),this.update())}update(){if(this.destroyed||this.views.length===0)return;let{scrollTop:e,clientHeight:t}=this.scroller;this.pinned&&Math.abs(e-this.pinned.scrollTop)>1&&(this.pinned=null);let n=this.pinned?.index??id(this.layout,e,t);if(n!==this.current){let e=this.current;this.current=n,this.callbacks.onPageChange?.(n,e)}let[r,i]=rd(this.layout,e,t),a=r-Ad,o=i+Ad;for(let e of this.views)(e.renderedScale||e.rendering)&&(e.index<a||e.index>o)&&e.release();if(performance.now()<this.rerenderBlockedUntil)return;let s=[];for(let e=r;e<=i;e++)s.push(e);s.sort((e,t)=>Math.abs(e-n)-Math.abs(t-n));for(let e=1;e<=kd;e++)s.push(i+e,r-e);for(let e of s){if(this.activeRenders>=jd)break;let t=this.views[e];!t||t.rendering||t.isRenderedAt(this.cssScale,this.sizes[e].rotation)||this.renderPage(t)}}async renderPage(e){this.activeRenders++;try{let{proxy:t,rotation:n}=await this.pages.page(e.index);!this.destroyed&&this.views[e.index]===e&&await e.render(t,this.cssScale,n,t=>this.decorateCanvas?.(e.index,t))}catch(t){this.destroyed||console.error(`[pdfcedar] failed to render page ${e.index+1}`,t)}finally{this.activeRenders--,this.destroyed||this.update()}}async loadPageSizes(){let e=this.generation,t=this.pages.entries.map((e,t)=>[e,t]).filter(([e])=>!this.known.has(e.key));for(let n=0;n<t.length&&!this.destroyed;n+=Nd){let r=t.slice(n,n+Nd),i=await Promise.all(r.map(([e])=>e.doc.pageGeometry(e.index)));if(this.destroyed||e!==this.generation)return;let a=!1;i.forEach((e,t)=>{let[n,i]=r[t];this.known.set(n.key,e);let o=ad(e,n.rotation),s=this.sizes[i],c=s.width===o.width&&s.height===o.height;this.sizes[i]=o,c||(this.views[i].release(),a=!0)}),a&&(this.relayoutAnchored(),this.callbacks.onSizesChange?.(),this.update())}}},Id=e=>e.length;function Ld(e){let t=``,n=[];for(let r of e)typeof r.str==`string`&&r.transform&&(n.push({str:r.str,transform:r.transform,width:r.width??0,height:r.height??0,hasEOL:r.hasEOL??!1,start:t.length}),t+=r.str,r.hasEOL&&(t+=`
57
+ `));return{text:t,runs:n}}function Rd(e){let t=e.trim().split(/\s+/).filter(Boolean);if(t.length===0)return null;let n=t.map(e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`));return new RegExp(n.join(`\\s+`),`giu`)}function zd(e,t){let n=[];t.lastIndex=0;for(let r of e.matchAll(t))n.push({start:r.index,end:r.index+r[0].length});return n}function Bd(e,t,n=Id){let r=[];for(let i of e.runs){let e=i.start+i.str.length;if(e<=t.start||i.start>=t.end)continue;let a=Math.max(t.start,i.start)-i.start,o=Math.min(t.end,e)-i.start;a>=o||r.push(Vd(i,a,o,n))}return r}function Vd(e,t,n,r){let[i=1,a=0,o=0,s=1,c=0,l=0]=e.transform,u=r(e.str),d=t=>u>0?r(e.str.slice(0,t))/u:t/e.str.length,f=d(t)*e.width,p=d(n)*e.width,m=Math.hypot(o,s)||e.height,h=m*.8,g=m*.2,_=Math.atan2(a,i),[v,y]=[Math.cos(_),Math.sin(_)],[b,x]=[-y,v],S=[[c+v*f-b*g,l+y*f-x*g],[c+v*p-b*g,l+y*p-x*g],[c+v*p+b*h,l+y*p+x*h],[c+v*f+b*h,l+y*f+x*h]],C=S.map(e=>e[0]),w=S.map(e=>e[1]),T=Math.min(...C),E=Math.min(...w);return{x:T,y:E,width:Math.max(...C)-T,height:Math.max(...w)-E}}function Hd(e){return e.replace(/[­\0]/g,``).replace(/ /g,` `).normalize(`NFKC`)}var Ud=8;function Wd(){let e=typeof document<`u`?document.createElement(`canvas`).getContext(`2d`):null;return e?(e.font=`10px sans-serif`,t=>e.measureText(t).width):Id}var Gd=class{viewport;onChange;texts=new Map;measure=Wd();hits=[];current=-1;query=``;searching=!1;generation=0;hidden=null;constructor(e,t=()=>{}){this.viewport=e,this.onChange=t}get state(){return{query:this.query,total:this.hits.length,current:this.current,searching:this.searching}}async search(e){let t=++this.generation;this.reset();let n=Rd(e);if(this.query=e,!n)return this.emit(),[];this.searching=!0,this.emit();let r=[],i=this.viewport.pageList;for(let e=0;e<i.count;e++){for(let t=1;t<=Ud&&e+t<i.count;t++)this.pageText(i,e+t).catch(()=>{});let a=await this.pageText(i,e),o=zd(a.text,n);if(o.length===0)continue;let s=await i.geometry(e);if(i!==this.viewport.pageList)return r;let c=o.flatMap((n,i)=>{let o=Bd(a,n,this.measure);if(this.hidden?.(e,o))return[];let c={page:e+1,index:n.start,text:a.text.slice(n.start,n.end),rects:o};return r.push(c),[{result:c,pageIndex:e,id:`search-${t}-${e}-${i}`,fractions:o.map(e=>He(e,s))}]});if(c.length!==0&&t===this.generation){for(let e of c)this.viewport.addHighlight(e.pageIndex,e.id,e.fractions);this.hits.push(...c),this.current===-1?this.select(0):this.emit()}}return t===this.generation&&(this.searching=!1,this.emit()),r}next(){this.hits.length>0&&this.select((this.current+1)%this.hits.length)}previous(){this.hits.length>0&&this.select((this.current-1+this.hits.length)%this.hits.length)}clear(){this.generation++,this.reset(),this.query=``,this.emit()}select(e){let t=this.hits[e];if(!t)return;this.current=e,this.viewport.setCurrentHighlight(t.pageIndex,t.id);let n=t.fractions[0];n&&this.viewport.scrollToRect(t.pageIndex,n),this.emit()}reset(){this.viewport.clearHighlights(),this.hits=[],this.current=-1,this.searching=!1}pageText(e,t){let n=e.at(t),r=this.texts.get(n.key);return r||(r=n.doc.getPage(n.index).then(e=>e.getTextContent()).then(e=>Ld(e.items)),r.catch(()=>this.texts.delete(n.key)),this.texts.set(n.key,r)),r}emit(){this.onChange(this.state)}};async function Kd(e,t,n,r){let{proxy:i,rotation:a}=await e.page(t);return r?.aborted?null:xd(i,n/i.getViewport({scale:1,rotation:a}).width,e=>r?.addEventListener(`abort`,()=>e.cancel(),{once:!0}),a)}var qd=150,Jd=16777216,Yd=6e4,Xd=`
58
+ @media screen { .pl-print-root { display: none !important; } }
59
+ @media print {
60
+ @page { margin: 0; }
61
+ html, body { margin: 0 !important; padding: 0 !important; height: auto !important; overflow: visible !important; }
62
+ body > *:not(.pl-print-root) { display: none !important; }
63
+ .pl-print-root { display: block !important; }
64
+ .pl-print-page { break-after: page; page-break-after: always; display: flex; justify-content: center; }
65
+ .pl-print-page:last-child { break-after: auto; page-break-after: auto; }
66
+ .pl-print-page img { display: block; width: 100%; height: auto; }
67
+ }`,Zd=!1;async function Qd(e,t){if(Zd)return;Zd=!0;let n=null,r=document.createElement(`div`);r.className=`pl-print-root`,r.setAttribute(`aria-hidden`,`true`);let i=document.createElement(`style`);i.textContent=Xd;let a=[];try{n=await ed.open(e.slice().buffer);for(let e=0;e<n.pageCount;e++){let i=await n.getPage(e),o=i.getViewport({scale:1}),s=Math.min(qd/72,Math.sqrt(Jd/(o.width*o.height))),c=i.getViewport({scale:s}),l=document.createElement(`canvas`);l.width=Math.floor(c.width),l.height=Math.floor(c.height),await i.render({canvas:l,viewport:c,intent:`print`,annotationMode:Uu().AnnotationMode.ENABLE}).promise;let u=await new Promise(e=>l.toBlob(e,`image/png`));if(Sd(l),!u)throw Error(`Could not render page ${e+1} for printing.`);let d=URL.createObjectURL(u);a.push(d);let f=document.createElement(`div`);f.className=`pl-print-page`;let p=new Image;p.alt=`Page ${e+1}`,p.src=d,f.append(p),r.append(f),t?.(e+1,n.pageCount)}document.head.append(i),document.body.append(r),await Promise.all([...r.querySelectorAll(`img`)].map(e=>e.decode().catch(()=>void 0))),await new Promise(e=>{let t=()=>{clearTimeout(n),window.removeEventListener(`afterprint`,t),e()},n=setTimeout(t,Yd);window.addEventListener(`afterprint`,t),window.print()})}finally{r.remove(),i.remove();for(let e of a)URL.revokeObjectURL(e);await n?.destroy(),Zd=!1}}function $d(e,t={}){let n=e.scroller,r=new AbortController,{signal:i}=r,a=null,o=0,s=null,c=()=>{if(o=0,!s)return;let{zoom:t,mid:r,pan:i}=s;s=null,n.scrollLeft-=i.x,n.scrollTop-=i.y,e.zoomAt(t,r.x,r.y)},l=(e,t,n)=>{s=s?{zoom:e,mid:t,pan:{x:s.pan.x+n.x,y:s.pan.y+n.y}}:{zoom:e,mid:t,pan:n},o||=requestAnimationFrame(c)},u=e=>{let[t,n]=[e[0],e[1]];return{distance:Math.hypot(t.clientX-n.clientX,t.clientY-n.clientY),mid:{x:(t.clientX+n.clientX)/2,y:(t.clientY+n.clientY)/2}}};n.addEventListener(`touchstart`,n=>{if(n.touches.length!==2)return;let{distance:r,mid:i}=u(n.touches);r<1||(a={startDistance:r,startZoom:e.zoomLevel,mid:i},t.onPinchStart?.())},{signal:i,passive:!0}),n.addEventListener(`touchmove`,e=>{if(!a||e.touches.length<2)return;e.preventDefault();let{distance:t,mid:n}=u(e.touches),r={x:n.x-a.mid.x,y:n.y-a.mid.y};a.mid=n,l(a.startZoom*(t/a.startDistance),n,r)},{signal:i,passive:!1});let d=e=>{a&&e.touches.length<2&&(a=null)};n.addEventListener(`touchend`,d,{signal:i}),n.addEventListener(`touchcancel`,d,{signal:i}),n.addEventListener(`wheel`,t=>{if(!t.ctrlKey&&!t.metaKey)return;t.preventDefault();let n=t.deltaMode===1?t.deltaY*16:t.deltaY,r=Math.exp(-Math.max(-100,Math.min(100,n))*.01);l((s?.zoom??e.zoomLevel)*r,{x:t.clientX,y:t.clientY},{x:0,y:0})},{signal:i,passive:!1});let f=1;return n.addEventListener(`gesturestart`,t=>{t.preventDefault(),f=e.zoomLevel},{signal:i,passive:!1}),n.addEventListener(`gesturechange`,e=>{if(e.preventDefault(),a)return;let t=e;l(f*t.scale,{x:t.clientX,y:t.clientY},{x:0,y:0})},{signal:i,passive:!1}),()=>{r.abort(),cancelAnimationFrame(o)}}var ef=`pdfcedar-styles`,tf=`
68
+ .pdfcedar-viewer {
69
+ --pl-bg: #e7e9ee;
70
+ --pl-surface: #ffffff;
71
+ --pl-text: #1f2430;
72
+ --pl-muted: #6b7280;
73
+ --pl-border: #d4d7de;
74
+ --pl-accent: #2563eb;
75
+ --pl-page-shadow: 0 1px 3px rgb(0 0 0 / 0.18), 0 1px 2px rgb(0 0 0 / 0.1);
76
+ --pl-sidebar-width: 220px;
77
+ --pl-font: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
78
+
79
+ position: relative;
80
+ display: flex;
81
+ flex-direction: column;
82
+ width: 100%;
83
+ height: 100%;
84
+ min-height: 0;
85
+ overflow: hidden;
86
+ background: var(--pl-bg);
87
+ color: var(--pl-text);
88
+ font-family: var(--pl-font);
89
+ box-sizing: border-box;
90
+ }
91
+ .pdfcedar-viewer[data-theme='dark'] {
92
+ --pl-bg: #1b1e24;
93
+ --pl-surface: #262a32;
94
+ --pl-text: #e6e8ec;
95
+ --pl-muted: #9aa1ad;
96
+ --pl-border: #3a3f4a;
97
+ --pl-accent: #60a5fa;
98
+ --pl-page-shadow: 0 1px 4px rgb(0 0 0 / 0.6);
99
+ }
100
+ .pdfcedar-viewer *, .pdfcedar-viewer *::before, .pdfcedar-viewer *::after { box-sizing: inherit; }
101
+ .pdfcedar-viewer pl-main-toolbar { flex: none; }
102
+ .pdfcedar-viewer .pl-body { flex: 1; min-height: 0; display: flex; }
103
+ .pdfcedar-viewer .pl-main { position: relative; flex: 1; min-width: 0; display: flex; }
104
+ .pdfcedar-viewer .pl-trial-badge {
105
+ position: absolute; right: 12px; bottom: 12px; z-index: 5; pointer-events: auto; cursor: help;
106
+ padding: 2px 8px; border-radius: 999px; font: 600 11px/18px system-ui, sans-serif; letter-spacing: 0.04em;
107
+ text-transform: uppercase; color: #fff; background: rgb(220 38 38 / 0.85);
108
+ }
109
+ .pdfcedar-viewer .pl-scroller {
110
+ flex: 1;
111
+ overflow: auto;
112
+ outline: none;
113
+ overscroll-behavior: contain;
114
+ /* One finger scrolls natively; pinching is the viewer's own zoom (attachZoomGestures), not the page's. */
115
+ touch-action: pan-x pan-y;
116
+ -webkit-overflow-scrolling: touch;
117
+ }
118
+ .pdfcedar-viewer .pl-pages { position: relative; }
119
+ .pdfcedar-viewer .pl-page {
120
+ position: absolute;
121
+ background: #fff;
122
+ box-shadow: var(--pl-page-shadow);
123
+ overflow: hidden;
124
+ }
125
+ .pdfcedar-viewer .pl-page-canvas { display: block; width: 100%; height: 100%; }
126
+ /* Compact layout (narrow viewers): the sidebar is a drawer over the pages, and the annotation tools scroll
127
+ sideways in one row instead of wrapping. */
128
+ .pdfcedar-viewer[data-compact] .pl-body { position: relative; }
129
+ .pdfcedar-viewer[data-compact] pl-sidebar {
130
+ position: absolute;
131
+ inset: 0 auto 0 0;
132
+ z-index: 20;
133
+ width: min(var(--pl-sidebar-width), 80%);
134
+ box-shadow: 4px 0 16px rgb(0 0 0 / 0.2);
135
+ }
136
+ .pdfcedar-viewer[data-compact] pl-annotation-toolbar {
137
+ flex-wrap: nowrap;
138
+ overflow-x: auto;
139
+ overscroll-behavior-x: contain;
140
+ scrollbar-width: none;
141
+ border-bottom: 0;
142
+ }
143
+ /* Fixed width: min-width 0 stops long comment text from widening the sidebar. */
144
+ .pdfcedar-viewer pl-sidebar { flex: 0 0 var(--pl-sidebar-width); width: var(--pl-sidebar-width); min-width: 0; }
145
+ .pdfcedar-viewer .pl-page { --scale-round-x: 1px; --scale-round-y: 1px; }
146
+ .pdfcedar-viewer .pl-highlights { position: absolute; inset: 0; pointer-events: none; }
147
+ .pdfcedar-viewer .pl-search-hit {
148
+ position: absolute;
149
+ border-radius: 2px;
150
+ background: var(--pl-search-hit, rgb(255 200 0 / 0.4));
151
+ mix-blend-mode: multiply;
152
+ }
153
+ .pdfcedar-viewer .pl-search-hit.pl-current {
154
+ background: var(--pl-search-current, rgb(255 120 0 / 0.55));
155
+ outline: 2px solid var(--pl-search-current-outline, rgb(230 90 0));
156
+ }
157
+
158
+ /* Text layer, adapted from pdf.js web/pdf_viewer.css (Apache-2.0, Mozilla Foundation). */
159
+ .pdfcedar-viewer .textLayer {
160
+ position: absolute;
161
+ inset: 0;
162
+ overflow: clip;
163
+ line-height: 1;
164
+ text-align: initial;
165
+ letter-spacing: normal;
166
+ word-spacing: normal;
167
+ text-size-adjust: none;
168
+ -webkit-text-size-adjust: none;
169
+ forced-color-adjust: none;
170
+ transform-origin: 0 0;
171
+ caret-color: CanvasText;
172
+ z-index: 0;
173
+ --min-font-size: 1;
174
+ --text-scale-factor: calc(var(--total-scale-factor) * var(--min-font-size));
175
+ --min-font-size-inv: calc(1 / var(--min-font-size));
176
+ }
177
+ .pdfcedar-viewer .textLayer :is(span, br) {
178
+ color: transparent;
179
+ position: absolute;
180
+ white-space: pre;
181
+ cursor: text;
182
+ transform-origin: 0% 0%;
183
+ user-select: text;
184
+ -webkit-user-select: text;
185
+ }
186
+ .pdfcedar-viewer .textLayer > :not(.markedContent),
187
+ .pdfcedar-viewer .textLayer .markedContent span:not(.markedContent) {
188
+ z-index: 1;
189
+ --font-height: 0;
190
+ font-size: calc(var(--text-scale-factor) * var(--font-height));
191
+ --scale-x: 1;
192
+ --rotate: 0deg;
193
+ transform: rotate(var(--rotate)) scaleX(var(--scale-x)) scale(var(--min-font-size-inv));
194
+ }
195
+ .pdfcedar-viewer .textLayer .markedContent { display: contents; }
196
+ .pdfcedar-viewer .textLayer span[role='img'] { user-select: none; -webkit-user-select: none; cursor: default; }
197
+ .pdfcedar-viewer .textLayer ::selection { background: rgb(0 90 255 / 0.3); color: transparent; }
198
+ .pdfcedar-viewer .textLayer br::selection { background: transparent; }
199
+ .pdfcedar-viewer .textLayer .endOfContent {
200
+ display: block;
201
+ position: absolute;
202
+ inset: 100% 0 0;
203
+ z-index: 0;
204
+ cursor: default;
205
+ user-select: none;
206
+ -webkit-user-select: none;
207
+ }
208
+ .pdfcedar-viewer .textLayer.selecting .endOfContent { top: 0; }
209
+ .pdfcedar-viewer [data-main-rotation='90'] { transform: rotate(90deg) translateY(-100%); }
210
+ .pdfcedar-viewer [data-main-rotation='180'] { transform: rotate(180deg) translate(-100%, -100%); }
211
+ .pdfcedar-viewer [data-main-rotation='270'] { transform: rotate(270deg) translateX(-100%); }
212
+
213
+ /* Annotations. Layers stack: canvas, search hits, text layer, vector annotations, HTML annotations. */
214
+ .pdfcedar-viewer .pl-annotations {
215
+ position: absolute;
216
+ inset: 0;
217
+ width: 100%;
218
+ height: 100%;
219
+ overflow: visible;
220
+ z-index: 2;
221
+ pointer-events: none;
222
+ /* On the layer itself, so it blends with the page canvas below (a highlight darkens text, never hides
223
+ it). Inside the SVG it would only blend with the SVG's own empty backdrop. */
224
+ mix-blend-mode: multiply;
225
+ }
226
+ .pdfcedar-viewer .pl-annotations-html { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
227
+ .pdfcedar-viewer .pl-annotations-html > * { position: absolute; box-sizing: border-box; }
228
+
229
+ /* Form fields: above the text layer, under annotations (the form layer comes first in the page). */
230
+ .pdfcedar-viewer .pl-forms { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
231
+ .pdfcedar-viewer .pl-field {
232
+ position: absolute;
233
+ box-sizing: border-box;
234
+ margin: 0;
235
+ padding: 0 calc(var(--total-scale-factor) * 2px);
236
+ pointer-events: auto;
237
+ font-family: Helvetica, Arial, sans-serif;
238
+ line-height: 1.15;
239
+ border: 1px solid var(--pl-field-border, transparent);
240
+ border-radius: 0;
241
+ /* Fillable fields get Acrobat's familiar tint over their own background. */
242
+ --pl-field-tint: rgb(204 215 255 / 0.55);
243
+ background: linear-gradient(var(--pl-field-tint), var(--pl-field-tint)), var(--pl-field-bg, transparent);
244
+ color: #000;
245
+ outline: none;
246
+ appearance: none;
247
+ -webkit-appearance: none;
248
+ }
249
+ .pdfcedar-viewer .pl-field:hover { --pl-field-tint: rgb(170 188 255 / 0.6); }
250
+ .pdfcedar-viewer .pl-field:focus { box-shadow: 0 0 0 2px var(--pl-accent); }
251
+ .pdfcedar-viewer textarea.pl-field { resize: none; padding-top: calc(var(--total-scale-factor) * 2px); overflow: auto; }
252
+ .pdfcedar-viewer select.pl-field-dropdown {
253
+ /* A small caret, since appearance: none removes the native one. */
254
+ background:
255
+ linear-gradient(45deg, transparent 50%, currentColor 50%) no-repeat right calc(var(--total-scale-factor) * 9px) center / calc(var(--total-scale-factor) * 4px) calc(var(--total-scale-factor) * 4px),
256
+ linear-gradient(-45deg, transparent 50%, currentColor 50%) no-repeat right calc(var(--total-scale-factor) * 5px) center / calc(var(--total-scale-factor) * 4px) calc(var(--total-scale-factor) * 4px),
257
+ linear-gradient(var(--pl-field-tint), var(--pl-field-tint)),
258
+ var(--pl-field-bg, transparent);
259
+ }
260
+ .pdfcedar-viewer .pl-field-checkbox,
261
+ .pdfcedar-viewer .pl-field-radio { display: grid; place-content: center; cursor: pointer; padding: 0; }
262
+ .pdfcedar-viewer .pl-field-radio { border-radius: 50%; }
263
+ .pdfcedar-viewer .pl-field-checkbox::before,
264
+ .pdfcedar-viewer .pl-field-radio::before {
265
+ content: '';
266
+ width: calc(var(--total-scale-factor) * 9px);
267
+ height: calc(var(--total-scale-factor) * 9px);
268
+ background: currentColor;
269
+ transform: scale(0);
270
+ }
271
+ .pdfcedar-viewer .pl-field-checkbox::before { clip-path: polygon(12% 52%, 0 66%, 38% 100%, 100% 18%, 86% 4%, 38% 72%); }
272
+ .pdfcedar-viewer .pl-field-radio::before { border-radius: 50%; }
273
+ .pdfcedar-viewer .pl-field-checkbox:checked::before,
274
+ .pdfcedar-viewer .pl-field-radio:checked::before { transform: scale(1); }
275
+ /* Read-only and flattened fields look like the printed page. */
276
+ .pdfcedar-viewer .pl-field:disabled { --pl-field-tint: transparent; opacity: 1; cursor: default; -webkit-text-fill-color: currentColor; }
277
+ .pdfcedar-viewer .pl-field-flattened { border-color: transparent; }
278
+ /* While drawing, fields let the pointer through to the page. */
279
+ .pdfcedar-viewer:is([data-tool='note'], [data-tool='ink'], [data-tool='rectangle'], [data-tool='ellipse'], [data-tool='line'], [data-tool='arrow'], [data-tool='freeText'], [data-tool='signature'], [data-tool='redaction']) .pl-field {
280
+ pointer-events: none;
281
+ }
282
+ .pdfcedar-viewer[data-tool='select'] .pl-annot,
283
+ .pdfcedar-viewer[data-tool='select'] .pl-annot .pl-hit,
284
+ .pdfcedar-viewer[data-tool='select'] .pl-annot .pl-hit-area,
285
+ .pdfcedar-viewer[data-tool='select'] .pl-annot .pl-markup { pointer-events: auto; cursor: pointer; }
286
+ .pdfcedar-viewer[data-tool='select'] .pl-annot :is(rect, ellipse, line, path, polygon):not([fill='none']) { pointer-events: auto; }
287
+ .pdfcedar-viewer .pl-note { display: grid; place-items: center; }
288
+ .pdfcedar-viewer .pl-note svg { width: 100%; height: 100%; filter: drop-shadow(0 1px 1px rgb(0 0 0 / 0.25)); }
289
+ .pdfcedar-viewer .pl-note-badge {
290
+ position: absolute;
291
+ right: -6px;
292
+ top: -6px;
293
+ min-width: 14px;
294
+ padding: 0 3px;
295
+ border-radius: 7px;
296
+ background: var(--pl-accent);
297
+ color: #fff;
298
+ font: 600 10px/14px var(--pl-font);
299
+ text-align: center;
300
+ }
301
+ /* Signatures: the image fills its box exactly (its proportions are kept by placement and resizing). */
302
+ .pdfcedar-viewer .pl-signature img { display: block; width: 100%; height: 100%; user-select: none; -webkit-user-select: none; pointer-events: none; }
303
+ .pdfcedar-viewer .pl-freetext {
304
+ padding: 0.15em 0.25em;
305
+ border: 1px solid transparent;
306
+ font-family: Helvetica, Arial, sans-serif;
307
+ line-height: 1.2;
308
+ white-space: pre-wrap;
309
+ overflow-wrap: anywhere;
310
+ overflow: hidden;
311
+ }
312
+ .pdfcedar-viewer .pl-freetext[contenteditable='true'] {
313
+ overflow: visible;
314
+ outline: 2px solid var(--pl-accent);
315
+ cursor: text;
316
+ pointer-events: auto;
317
+ background: color-mix(in srgb, #fff 85%, transparent);
318
+ }
319
+ .pdfcedar-viewer .pl-selection {
320
+ outline: 1.5px solid var(--pl-accent);
321
+ outline-offset: 2px;
322
+ pointer-events: none;
323
+ }
324
+ .pdfcedar-viewer .pl-selection-line { outline: 1px dashed color-mix(in srgb, var(--pl-accent) 60%, transparent); }
325
+ .pdfcedar-viewer .pl-handle {
326
+ position: absolute;
327
+ width: 10px;
328
+ height: 10px;
329
+ margin: -5px 0 0 -5px;
330
+ background: #fff;
331
+ border: 1.5px solid var(--pl-accent);
332
+ border-radius: 2px;
333
+ pointer-events: auto;
334
+ touch-action: none;
335
+ }
336
+ /* Touch screens: finger-sized handles, and the selected annotation drags by its selection box. */
337
+ @media (pointer: coarse) {
338
+ .pdfcedar-viewer .pl-handle { width: 22px; height: 22px; margin: -11px 0 0 -11px; border-radius: 50%; }
339
+ .pdfcedar-viewer .pl-selection:not(.pl-selection-line) { pointer-events: auto; touch-action: none; }
340
+ }
341
+ .pdfcedar-viewer .pl-handle[data-handle='nw'] { left: 0; top: 0; cursor: nwse-resize; }
342
+ .pdfcedar-viewer .pl-handle[data-handle='n'] { left: 50%; top: 0; cursor: ns-resize; }
343
+ .pdfcedar-viewer .pl-handle[data-handle='ne'] { left: 100%; top: 0; cursor: nesw-resize; }
344
+ .pdfcedar-viewer .pl-handle[data-handle='e'] { left: 100%; top: 50%; cursor: ew-resize; }
345
+ .pdfcedar-viewer .pl-handle[data-handle='se'] { left: 100%; top: 100%; cursor: nwse-resize; }
346
+ .pdfcedar-viewer .pl-handle[data-handle='s'] { left: 50%; top: 100%; cursor: ns-resize; }
347
+ .pdfcedar-viewer .pl-handle[data-handle='sw'] { left: 0; top: 100%; cursor: nesw-resize; }
348
+ .pdfcedar-viewer .pl-handle[data-handle='w'] { left: 0; top: 50%; cursor: ew-resize; }
349
+ .pdfcedar-viewer .pl-handle:is([data-handle='start'], [data-handle='end']) { border-radius: 50%; cursor: move; }
350
+ .pdfcedar-viewer .pl-annot.pl-dragging { cursor: grabbing; }
351
+ /* Drawing tools: the page itself takes the pointer, and text can't be selected by accident. */
352
+ .pdfcedar-viewer:is([data-tool='note'], [data-tool='ink'], [data-tool='rectangle'], [data-tool='ellipse'], [data-tool='line'], [data-tool='arrow'], [data-tool='freeText'], [data-tool='signature'], [data-tool='redaction']) .pl-page {
353
+ cursor: crosshair;
354
+ touch-action: none;
355
+ }
356
+ .pdfcedar-viewer:is([data-tool='note'], [data-tool='ink'], [data-tool='rectangle'], [data-tool='ellipse'], [data-tool='line'], [data-tool='arrow'], [data-tool='freeText'], [data-tool='signature'], [data-tool='redaction']) .textLayer {
357
+ pointer-events: none;
358
+ user-select: none;
359
+ -webkit-user-select: none;
360
+ }
361
+ .pdfcedar-viewer[data-tool='freeText'] .pl-page { cursor: text; }
362
+ /* The annotation tools sit inside the main toolbar, so they lose their own bar styling. */
363
+ .pdfcedar-viewer pl-annotation-toolbar { --pl-annotation-toolbar-border: none; }
364
+
365
+ .pdfcedar-viewer .pl-message {
366
+ margin: auto;
367
+ padding: 24px;
368
+ max-width: 480px;
369
+ text-align: center;
370
+ color: var(--pl-muted);
371
+ }
372
+ `;function nf(e=document){if(e.getElementById(ef))return;let t=e.createElement(`style`);t.id=ef,t.textContent=tf,e.head.append(t)}function rf(e,t){if(t===void 0||typeof t==`string`)e.dataset.theme=t??`light`;else{e.dataset.theme=`custom`;for(let[n,r]of Object.entries(t))e.style.setProperty(n,r)}}var af=`pl-thumbnails`,of=112,sf=`
373
+ :host { display: flex; flex-direction: column; min-height: 0; font: 12px var(--pl-font); }
374
+ :host([hidden]) { display: none; }
375
+ .scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
376
+ ol { list-style: none; margin: 0; padding: 12px 0; }
377
+ li { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 6px 0; position: relative; }
378
+ .thumb { position: relative; }
379
+ .page {
380
+ all: unset;
381
+ cursor: pointer;
382
+ display: block;
383
+ background: #fff;
384
+ box-shadow: var(--pl-page-shadow);
385
+ outline: 2px solid transparent;
386
+ outline-offset: 2px;
387
+ border-radius: 2px;
388
+ overflow: hidden;
389
+ touch-action: none;
390
+ }
391
+ .page:focus-visible { outline-color: var(--pl-accent); }
392
+ li[aria-current='page'] .page { outline-color: var(--pl-accent); }
393
+ canvas { display: block; width: 100%; height: 100%; }
394
+ .num { color: var(--pl-muted); }
395
+ li[aria-current='page'] .num { color: var(--pl-accent); font-weight: 600; }
396
+ .tools { position: absolute; top: 4px; right: 4px; display: none; gap: 2px; }
397
+ :host([data-page-tools]) li:is(:hover, :focus-within) .tools { display: flex; }
398
+ .tool {
399
+ all: unset;
400
+ display: grid;
401
+ place-items: center;
402
+ width: 24px;
403
+ height: 24px;
404
+ border-radius: 6px;
405
+ cursor: pointer;
406
+ background: var(--pl-surface);
407
+ color: var(--pl-text);
408
+ box-shadow: 0 1px 3px rgb(0 0 0 / 0.25);
409
+ }
410
+ .tool:hover { color: var(--pl-accent); }
411
+ .tool:focus-visible { outline: 2px solid var(--pl-accent); }
412
+ .tool svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
413
+ li.dragging { opacity: 0.4; }
414
+ li.drop-before::before, li.drop-after::after {
415
+ content: '';
416
+ position: absolute;
417
+ left: 16px;
418
+ right: 16px;
419
+ height: 3px;
420
+ border-radius: 2px;
421
+ background: var(--pl-accent);
422
+ }
423
+ li.drop-before::before { top: -2px; }
424
+ li.drop-after::after { bottom: -2px; }
425
+ footer { flex: none; padding: 8px; border-top: 1px solid var(--pl-border); display: none; }
426
+ :host([data-page-tools]) footer { display: block; }
427
+ footer button {
428
+ width: 100%;
429
+ font: inherit;
430
+ padding: 6px;
431
+ border: 1px dashed var(--pl-border);
432
+ border-radius: 6px;
433
+ background: transparent;
434
+ color: var(--pl-text);
435
+ cursor: pointer;
436
+ }
437
+ footer button:hover { border-color: var(--pl-accent); color: var(--pl-accent); }
438
+ `,cf=`<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M20 11a8 8 0 1 1-2.3-5.6M20 4v5h-5"/></svg>`,lf=`<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M4 7h16M9 7V4h6v3M6 7l1 13h10l1-13"/></svg>`,uf=6;function df(){if(customElements.get(`pl-thumbnails`))return;class e extends HTMLElement{onSelect=null;onRotate=null;onDelete=null;onMove=null;onMerge=null;source=null;pageTools=!1;suppressClick=!1;scroller;items=[];list;observer=null;queue=new Set;rendered=new Set;abort=new AbortController;busy=!1;current=0;constructor(){super();let e=this.attachShadow({mode:`open`}),t=document.createElement(`style`);t.textContent=sf,this.list=document.createElement(`ol`),this.list.setAttribute(`aria-label`,`Pages`),this.scroller=document.createElement(`div`),this.scroller.className=`scroll`,this.scroller.append(this.list);let n=document.createElement(`footer`);n.innerHTML=`<button type="button">Add pages from a PDF…</button><input type="file" accept="application/pdf,.pdf" hidden />`,e.append(t,this.scroller,n);let r=n.querySelector(`input`);n.querySelector(`button`).addEventListener(`click`,()=>r.click()),r.addEventListener(`change`,()=>{let e=r.files?.[0];r.value=``,e&&this.onMerge?.(e)}),this.list.addEventListener(`click`,e=>{let t=e.target,n=t.closest(`li`);if(!n||this.suppressClick)return;let r=Number(n.dataset.index),i=t.closest(`.tool`)?.dataset.tool;i===`rotate`?this.onRotate?.(r):i===`delete`?this.onDelete?.(r):this.onSelect?.(r)}),this.list.addEventListener(`keydown`,e=>{if(!this.pageTools||!e.altKey||e.key!==`ArrowUp`&&e.key!==`ArrowDown`)return;let t=e.target.closest(`li`);if(!t)return;e.preventDefault();let n=Number(t.dataset.index),r=n+(e.key===`ArrowUp`?-1:1);r>=0&&r<this.items.length&&(this.onMove?.(n,r),requestAnimationFrame(()=>this.items[r]?.querySelector(`.page`)?.focus()))}),this.list.addEventListener(`pointerdown`,e=>this.startDrag(e))}setPageTools(e){this.pageTools=e,this.toggleAttribute(`data-page-tools`,e)}startDrag(e){let t=e.target.closest(`li`);if(!this.pageTools||!t||e.button!==0||e.target.closest(`.tool`))return;let n=Number(t.dataset.index),r=e.clientY,i=!1,a=n,o=()=>this.items.forEach(e=>e.classList.remove(`drop-before`,`drop-after`,`dragging`)),s=e=>{if(!i&&Math.abs(e.clientY-r)<uf)return;i=!0,o(),t.classList.add(`dragging`);let s=this.items.filter((e,t)=>t!==n);a=s.filter(t=>{let n=t.getBoundingClientRect();return n.top+n.height/2<e.clientY}).length,a<s.length?s[a].classList.add(`drop-before`):s.at(-1)?.classList.add(`drop-after`);let c=this.scroller.getBoundingClientRect();e.clientY<c.top+30?this.scroller.scrollTop-=12:e.clientY>c.bottom-30&&(this.scroller.scrollTop+=12)},c=()=>{document.removeEventListener(`pointermove`,s),document.removeEventListener(`pointerup`,c),document.removeEventListener(`pointercancel`,c),o(),i&&(this.suppressClick=!0,setTimeout(()=>this.suppressClick=!1,0),a!==n&&this.onMove?.(n,a))};document.addEventListener(`pointermove`,s),document.addEventListener(`pointerup`,c),document.addEventListener(`pointercancel`,c)}disconnectedCallback(){this.observer?.disconnect(),this.abort.abort()}setSource(e){this.observer?.disconnect(),this.abort.abort(),this.abort=new AbortController,this.queue.clear(),this.rendered.clear(),this.source=e,this.items=Array.from({length:e.pageCount},(e,t)=>{let n=document.createElement(`li`);n.dataset.index=String(t);let r=document.createElement(`div`);r.className=`thumb`;let i=document.createElement(`button`);i.type=`button`,i.className=`page`,i.setAttribute(`aria-label`,`Page ${t+1}`);let a=document.createElement(`div`);a.className=`tools`,a.innerHTML=`<button type="button" class="tool" data-tool="rotate" aria-label="Rotate page ${t+1}" title="Rotate clockwise">${cf}</button><button type="button" class="tool" data-tool="delete" aria-label="Delete page ${t+1}" title="Delete page">${lf}</button>`,r.append(i,a);let o=document.createElement(`span`);return o.className=`num`,o.textContent=String(t+1),n.append(r,o),n}),this.list.replaceChildren(...this.items),this.refreshSizes(),this.observer=new IntersectionObserver(e=>this.onIntersect(e),{root:this.scroller,rootMargin:`300px 0px`});for(let e of this.items)this.observer.observe(e);this.setCurrentPage(this.current<e.pageCount?this.current:0)}refreshSizes(){this.source&&(this.items.forEach((e,t)=>{let n=this.source.pageSize(t);if(!n)return;let r=e.querySelector(`.page`),i=Math.round(of*n.height/n.width);r.style.height!==`${i}px`&&this.rendered.has(t)&&(this.rendered.delete(t),r.replaceChildren(),this.queue.add(t)),r.style.width=`${of}px`,r.style.height=`${i}px`}),this.drain())}invalidate(e){for(let t of e)this.rendered.delete(t)&&this.queue.add(t);this.drain()}setCurrentPage(e){this.items[this.current]?.removeAttribute(`aria-current`),this.current=e;let t=this.items[e];if(!t)return;t.setAttribute(`aria-current`,`page`);let{scroller:n}=this,r=t.offsetTop,i=r+t.offsetHeight;r<n.scrollTop?n.scrollTop=r-8:i>n.scrollTop+n.clientHeight&&(n.scrollTop=i-n.clientHeight+8)}onIntersect(e){for(let t of e){let e=Number(t.target.dataset.index);t.isIntersecting&&!this.rendered.has(e)?this.queue.add(e):this.queue.delete(e)}this.drain()}async drain(){if(this.busy||!this.source)return;this.busy=!0;let{signal:e}=this.abort;try{for(;this.queue.size>0&&!e.aborted;){let t=[...this.queue].sort((e,t)=>Math.abs(e-this.current)-Math.abs(t-this.current))[0];this.queue.delete(t);let n=await this.source.render(t,of,e).catch(e=>(console.error(`[pdfcedar] thumbnail ${t+1} failed`,e),null));n&&!e.aborted&&(this.items[t]?.querySelector(`.page`)?.replaceChildren(n),this.rendered.add(t))}}finally{this.busy=!1,this.queue.size>0&&!this.abort.signal.aborted&&this.drain()}}}customElements.define(af,e)}function ff(){return df(),document.createElement(af)}var pf=`pl-search-bar`,mf=200,hf=`
439
+ :host {
440
+ position: absolute;
441
+ top: 8px;
442
+ right: 20px;
443
+ z-index: 10;
444
+ display: flex;
445
+ align-items: center;
446
+ gap: 4px;
447
+ padding: 4px 4px 4px 8px;
448
+ background: var(--pl-surface);
449
+ color: var(--pl-text);
450
+ border: 1px solid var(--pl-border);
451
+ border-radius: 8px;
452
+ box-shadow: 0 4px 12px rgb(0 0 0 / 0.15);
453
+ font: 13px var(--pl-font);
454
+ }
455
+ :host(:not([open])) { display: none; }
456
+ input {
457
+ width: 180px;
458
+ border: none;
459
+ outline: none;
460
+ background: transparent;
461
+ color: inherit;
462
+ font: inherit;
463
+ }
464
+ input::-webkit-search-cancel-button { display: none; } /* we have our own close button */
465
+ output { min-width: 56px; text-align: right; color: var(--pl-muted); font-variant-numeric: tabular-nums; }
466
+ button {
467
+ all: unset;
468
+ display: grid;
469
+ place-items: center;
470
+ width: 26px;
471
+ height: 26px;
472
+ border-radius: 6px;
473
+ cursor: pointer;
474
+ color: var(--pl-text);
475
+ }
476
+ button:hover { background: color-mix(in srgb, var(--pl-text) 10%, transparent); }
477
+ button:focus-visible { outline: 2px solid var(--pl-accent); }
478
+ button:disabled { opacity: 0.35; cursor: default; background: none; }
479
+ svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
480
+ `,gf=e=>`<svg viewBox="0 0 24 24" aria-hidden="true"><path d="${e}"/></svg>`;function _f(){if(customElements.get(`pl-search-bar`))return;class e extends HTMLElement{onQuery=null;onNext=null;onPrevious=null;onClose=null;input;output;prev;next;timer;lastQuery=``;constructor(){super();let e=this.attachShadow({mode:`open`});e.innerHTML=`
481
+ <style>${hf}</style>
482
+ <input type="search" placeholder="Find in document" aria-label="Find in document" autocomplete="off" spellcheck="false" />
483
+ <output aria-live="polite"></output>
484
+ <button type="button" data-action="previous" aria-label="Previous match" title="Previous (Shift+Enter)">${gf(`M18 15l-6-6-6 6`)}</button>
485
+ <button type="button" data-action="next" aria-label="Next match" title="Next (Enter)">${gf(`M6 9l6 6 6-6`)}</button>
486
+ <button type="button" data-action="close" aria-label="Close search" title="Close (Esc)">${gf(`M18 6L6 18M6 6l12 12`)}</button>`,this.input=e.querySelector(`input`),this.output=e.querySelector(`output`),this.prev=e.querySelector(`[data-action="previous"]`),this.next=e.querySelector(`[data-action="next"]`),this.input.addEventListener(`input`,()=>{clearTimeout(this.timer),this.timer=setTimeout(()=>this.submit(),mf)}),this.input.addEventListener(`keydown`,e=>{e.key===`Enter`?(e.preventDefault(),this.input.value===this.lastQuery?e.shiftKey?this.onPrevious?.():this.onNext?.():this.submit()):e.key===`Escape`&&(e.preventDefault(),this.close())}),e.addEventListener(`click`,e=>{let t=e.target.closest(`button`)?.dataset.action;t===`next`?this.onNext?.():t===`previous`?this.onPrevious?.():t===`close`&&this.close()})}connectedCallback(){this.setAttribute(`role`,`search`)}get isOpen(){return this.hasAttribute(`open`)}open(e){this.setAttribute(`open`,``),e!==void 0&&(this.input.value=e,this.lastQuery=e),this.input.focus(),this.input.select()}close(){this.isOpen&&(clearTimeout(this.timer),this.removeAttribute(`open`),this.lastQuery=``,this.onClose?.())}setStatus({total:e,current:t,searching:n}){let r=this.input.value.trim()!==``;this.output.textContent=r?e===0?n?`…`:`No results`:`${t+1} / ${e}${n?`+`:``}`:``,this.prev.disabled=e===0,this.next.disabled=e===0}submit(){clearTimeout(this.timer),this.lastQuery=this.input.value,this.onQuery?.(this.input.value)}}customElements.define(pf,e)}function vf(){return _f(),document.createElement(pf)}var yf=`pl-annotation-toolbar`,bf=[`select`,`highlight`,`underline`,`strikeout`,`note`,`ink`,`rectangle`,`ellipse`,`line`,`arrow`,`freeText`,`signature`,`redaction`];function xf(e,t){let n=0,r=0;for(let e of t){if(e instanceof HTMLStyleElement)continue;let t=getComputedStyle(e);t.display!==`none`&&t.position!==`absolute`&&(n+=e.getBoundingClientRect().width+parseFloat(t.marginLeft)+parseFloat(t.marginRight),r++)}let i=parseFloat(getComputedStyle(e).columnGap)||0;return n+i*Math.max(0,r-1)}var Sf=[`#ffd400`,`#f97316`,`#e11d48`,`#a855f7`,`#2563eb`,`#16a34a`,`#111827`],Cf=[1,2,4,8],wf={select:`Select`,highlight:`Highlight`,underline:`Underline`,strikeout:`Strikeout`,note:`Note`,ink:`Draw`,rectangle:`Rectangle`,ellipse:`Ellipse`,line:`Line`,arrow:`Arrow`,freeText:`Text box`,signature:`Signature`,redaction:`Redact`},Tf={select:`M5 3l14 8-6 1.5L10 19z`,highlight:`M4 20h16M7 15l7-11 4 3-7 11H7z`,underline:`M7 4v7a5 5 0 0 0 10 0V4M5 20h14`,strikeout:`M5 12h14M16 6.5C15 5 13.6 4.5 12 4.5c-2.5 0-4 1.3-4 3 0 4 8 2.8 8 7.5 0 2-1.8 3.5-4.2 3.5-1.8 0-3.3-.7-4.3-2`,note:`M4 4h16v12H9l-5 4z`,ink:`M3 17c3-6 5 4 8-2s5-8 10-6`,rectangle:`M4 6h16v12H4z`,ellipse:`M12 6c4.4 0 8 2.7 8 6s-3.6 6-8 6-8-2.7-8-6 3.6-6 8-6z`,line:`M5 19L19 5`,arrow:`M5 19L19 5M10 5h9v9`,freeText:`M5 6V4h14v2M12 4v16M9 20h6`,signature:`M3 17c2.5 0 3.5-9 6-9s1 8 3.5 8 2-4 4-4 1.5 3 4.5 3M3 21h18`,redaction:`M4 6h16v5H4zM4 14h7v4H4zM14 15h6`,comment:`M4 5h16v11H9l-5 4zM8 9h8M8 12h5`,delete:`M4 7h16M9 7V4h6v3M6 7l1 13h10l1-13`,undo:`M9 14L4 9l5-5M4 9h10a6 6 0 0 1 0 12h-3`,redo:`M15 14l5-5-5-5M20 9H10a6 6 0 0 0 0 12h3`},Ef=new Set([`ink`,`rectangle`,`ellipse`,`line`,`arrow`]);function Df(e){return Ef.has(e)}var Of=e=>`<svg viewBox="0 0 24 24" aria-hidden="true"><path d="${Tf[e]}"/></svg>`,kf=`
487
+ :host {
488
+ display: flex;
489
+ flex-wrap: wrap;
490
+ align-items: center;
491
+ gap: 2px;
492
+ padding: 0;
493
+ background: transparent;
494
+ border-bottom: var(--pl-annotation-toolbar-border, 1px solid var(--pl-border));
495
+ font: 13px var(--pl-font);
496
+ color: var(--pl-text);
497
+ }
498
+ .group { display: flex; align-items: center; gap: 2px; }
499
+ .sep { width: 1px; align-self: stretch; margin: 4px 6px; background: var(--pl-border); }
500
+ button {
501
+ all: unset;
502
+ box-sizing: border-box;
503
+ display: grid;
504
+ place-items: center;
505
+ width: 30px;
506
+ height: 30px;
507
+ border-radius: 6px;
508
+ cursor: pointer;
509
+ }
510
+ button:hover:not(:disabled) { background: color-mix(in srgb, var(--pl-text) 9%, transparent); }
511
+ button:focus-visible { outline: 2px solid var(--pl-accent); outline-offset: -2px; }
512
+ button[aria-pressed='true'] { background: color-mix(in srgb, var(--pl-accent) 18%, transparent); color: var(--pl-accent); }
513
+ button:disabled { opacity: 0.35; cursor: default; }
514
+ svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
515
+ .swatch { width: 22px; height: 22px; border-radius: 50%; }
516
+ .swatch span { width: 16px; height: 16px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgb(0 0 0 / 0.2); }
517
+ .swatch[aria-pressed='true'] { background: none; box-shadow: 0 0 0 2px var(--pl-accent); }
518
+ select {
519
+ height: 28px;
520
+ border: 1px solid var(--pl-border);
521
+ border-radius: 6px;
522
+ background: var(--pl-surface);
523
+ color: inherit;
524
+ font: inherit;
525
+ padding: 0 4px;
526
+ }
527
+ select:disabled { opacity: 0.35; }
528
+ button.apply { width: auto; padding: 0 10px; margin-left: 6px; border-radius: 6px; background: #b91c1c; color: #fff; font-weight: 600; white-space: nowrap; }
529
+ button.apply:hover { background: #991b1b; }
530
+ [hidden] { display: none !important; }
531
+ `;function Af(){if(customElements.get(`pl-annotation-toolbar`))return;class e extends HTMLElement{onTool=null;onColor=null;onStrokeWidth=null;onComment=null;onDelete=null;onUndo=null;onRedo=null;onApplyRedactions=null;root;constructor(){super(),this.root=this.attachShadow({mode:`open`});let e=bf.map(e=>`<button type="button" data-tool="${e}" aria-label="${wf[e]}" title="${wf[e]}" aria-pressed="false">${Of(e)}</button>`).join(``),t=Sf.map(e=>`<button type="button" class="swatch" data-color="${e}" aria-label="Color ${e}" title="${e}" aria-pressed="false"><span style="background:${e}"></span></button>`).join(``),n=Cf.map(e=>`<option value="${e}">${e} pt</option>`).join(``);this.root.innerHTML=`
532
+ <style>${kf}</style>
533
+ <div class="group" role="toolbar" aria-label="Annotation tools">${e}</div>
534
+ <div class="sep edit"></div>
535
+ <div class="group edit" role="group" aria-label="Color">${t}</div>
536
+ <select class="edit" aria-label="Line width" title="Line width">${n}</select>
537
+ <div class="sep edit"></div>
538
+ <div class="group edit">
539
+ <button type="button" data-action="comment" aria-label="Comment" title="Comment">${Of(`comment`)}</button>
540
+ <button type="button" data-action="delete" aria-label="Delete" title="Delete (Del)">${Of(`delete`)}</button>
541
+ </div>
542
+ <div class="sep edit"></div>
543
+ <div class="group edit">
544
+ <button type="button" data-action="undo" aria-label="Undo" title="Undo (Ctrl+Z)">${Of(`undo`)}</button>
545
+ <button type="button" data-action="redo" aria-label="Redo" title="Redo (Ctrl+Shift+Z)">${Of(`redo`)}</button>
546
+ </div>
547
+ <button type="button" class="apply" data-action="apply-redactions" hidden></button>`,this.root.addEventListener(`click`,e=>{let t=e.target.closest(`button`);if(!t||t.disabled)return;let{tool:n,color:r,action:i}=t.dataset;n?this.onTool?.(n):r?this.onColor?.(r):i===`comment`?this.onComment?.():i===`delete`?this.onDelete?.():i===`undo`?this.onUndo?.():i===`redo`?this.onRedo?.():i===`apply-redactions`&&this.onApplyRedactions?.()}),this.root.querySelector(`select`).addEventListener(`change`,e=>{this.onStrokeWidth?.(Number(e.target.value))}),this.root.addEventListener(`mousedown`,e=>{e.target.closest(`button`)&&e.preventDefault()})}setTools(e){for(let t of this.root.querySelectorAll(`[data-tool]`))t.hidden=!e.includes(t.dataset.tool)}setState(e){for(let t of this.root.querySelectorAll(`[data-tool]`))t.setAttribute(`aria-pressed`,String(t.dataset.tool===e.tool)),e.readOnly&&t.dataset.tool!==`select`&&(t.hidden=!0);for(let t of this.root.querySelectorAll(`[data-color]`))t.setAttribute(`aria-pressed`,String(t.dataset.color===e.color));let t=this.root.querySelector(`select`);if(t.querySelector(`[data-custom]`)?.remove(),!Cf.includes(e.strokeWidth)){let n=new Option(`${e.strokeWidth} pt`,String(e.strokeWidth));n.dataset.custom=``;let r=[...t.options].find(t=>Number(t.value)>e.strokeWidth)??null;t.add(n,r)}t.value=String(e.strokeWidth),t.disabled=!e.strokeEnabled,this.root.querySelector(`[data-action="comment"]`).disabled=!e.hasSelection,this.root.querySelector(`[data-action="delete"]`).disabled=!e.hasSelection,this.root.querySelector(`[data-action="undo"]`).disabled=!e.canUndo,this.root.querySelector(`[data-action="redo"]`).disabled=!e.canRedo;for(let t of this.root.querySelectorAll(`.edit`))t.hidden=e.readOnly;let n=this.root.querySelector(`.apply`),r=n.hidden;n.hidden=e.readOnly||e.pendingRedactions===0,n.textContent=`Apply ${e.pendingRedactions} redaction${e.pendingRedactions===1?``:`s`}`,(n.hidden!==r||e.readOnly)&&this.dispatchEvent(new Event(`pl-resize`,{bubbles:!0}))}naturalWidth(){return xf(this,this.root.children)}}customElements.define(yf,e)}function jf(){return Af(),document.createElement(yf)}var Mf=`pl-comment-thread`,Nf=400,Pf=`
548
+ :host {
549
+ position: absolute;
550
+ z-index: 20;
551
+ width: 280px;
552
+ max-height: min(420px, 70%);
553
+ display: flex;
554
+ flex-direction: column;
555
+ background: var(--pl-surface);
556
+ color: var(--pl-text);
557
+ border: 1px solid var(--pl-border);
558
+ border-radius: 10px;
559
+ box-shadow: 0 10px 30px rgb(0 0 0 / 0.2);
560
+ font: 13px/1.4 var(--pl-font);
561
+ }
562
+ :host(:not([open])) { display: none; }
563
+ header { display: flex; align-items: center; gap: 8px; padding: 10px 12px 6px; }
564
+ header strong { flex: 1; }
565
+ .meta { color: var(--pl-muted); font-size: 12px; }
566
+ .body { overflow: auto; padding: 0 12px 8px; }
567
+ textarea {
568
+ box-sizing: border-box;
569
+ width: 100%;
570
+ min-height: 54px;
571
+ resize: vertical;
572
+ border: 1px solid var(--pl-border);
573
+ border-radius: 6px;
574
+ padding: 6px 8px;
575
+ background: transparent;
576
+ color: inherit;
577
+ font: inherit;
578
+ }
579
+ textarea:focus { outline: 2px solid var(--pl-accent); outline-offset: -1px; border-color: transparent; }
580
+ textarea[readonly] { border-color: transparent; padding: 0; resize: none; min-height: 0; }
581
+ ol { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
582
+ li { border-top: 1px solid var(--pl-border); padding-top: 8px; }
583
+ li .who { display: flex; align-items: baseline; gap: 6px; }
584
+ li .who b { font-weight: 600; }
585
+ li .who .meta { flex: 1; }
586
+ li p { margin: 2px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
587
+ footer { display: flex; gap: 6px; align-items: flex-end; padding: 8px 12px 10px; border-top: 1px solid var(--pl-border); }
588
+ footer textarea { min-height: 32px; flex: 1; }
589
+ button {
590
+ font: inherit;
591
+ border: 1px solid var(--pl-border);
592
+ border-radius: 6px;
593
+ background: var(--pl-surface);
594
+ color: inherit;
595
+ padding: 4px 10px;
596
+ cursor: pointer;
597
+ }
598
+ button.primary { background: var(--pl-accent); border-color: var(--pl-accent); color: #fff; }
599
+ button.icon { border: none; background: none; padding: 2px 6px; color: var(--pl-muted); }
600
+ button.icon:hover { color: var(--pl-text); }
601
+ button:disabled { opacity: 0.4; cursor: default; }
602
+ [hidden] { display: none !important; }
603
+ `,Ff=new Intl.DateTimeFormat(void 0,{dateStyle:`medium`,timeStyle:`short`});function If(e){let t=new Date(e);return`<time datetime="${e}">${Number.isNaN(t.getTime())?``:Ff.format(t)}</time>`}function Lf(e){return e.replace(/[&<>"']/g,e=>`&#${e.charCodeAt(0)};`)}function Rf(){if(customElements.get(`pl-comment-thread`))return;class e extends HTMLElement{onContents=null;onReply=null;onDeleteReply=null;onDelete=null;onClose=null;root;data=null;timer;constructor(){super(),this.root=this.attachShadow({mode:`open`}),this.root.innerHTML=`
604
+ <style>${Pf}</style>
605
+ <header>
606
+ <strong data-part="label"></strong>
607
+ <button type="button" class="icon" data-action="close" aria-label="Close comment">✕</button>
608
+ </header>
609
+ <div class="body">
610
+ <div class="meta" data-part="meta"></div>
611
+ <textarea data-part="contents" aria-label="Comment" placeholder="Add a comment…"></textarea>
612
+ <ol data-part="replies" aria-label="Replies"></ol>
613
+ </div>
614
+ <footer data-part="footer">
615
+ <textarea data-part="reply" aria-label="Reply" placeholder="Reply…"></textarea>
616
+ <button type="button" class="primary" data-action="reply">Reply</button>
617
+ </footer>
618
+ <footer data-part="danger">
619
+ <button type="button" data-action="delete">Delete</button>
620
+ </footer>`;let e=this.$(`contents`);e.addEventListener(`input`,()=>{clearTimeout(this.timer),this.timer=setTimeout(()=>this.flush(),Nf)}),e.addEventListener(`blur`,()=>this.flush()),this.$(`reply`).addEventListener(`keydown`,e=>{e.key===`Enter`&&(e.ctrlKey||e.metaKey)&&(e.preventDefault(),this.submitReply())}),this.root.addEventListener(`keydown`,e=>{e.key===`Escape`&&(e.stopPropagation(),this.close()),e.stopPropagation()}),this.root.addEventListener(`click`,e=>{let t=e.target.closest(`button`);if(!t)return;let{action:n,replyId:r}=t.dataset;n===`close`?this.close():n===`reply`?this.submitReply():n===`delete`?this.onDelete?.():r&&this.onDeleteReply?.(r)}),this.addEventListener(`pointerdown`,e=>e.stopPropagation())}get isOpen(){return this.hasAttribute(`open`)}get threadId(){return this.isOpen?this.data?.root.id??null:null}open(e,t,n,r=null){this.isOpen&&this.data?.root.id!==e.root.id&&this.flush(),this.setAttribute(`open`,``),this.setAttribute(`role`,`dialog`),this.setAttribute(`aria-label`,`${e.root.label} comment thread`),this.style.left=`${t}px`,this.style.top=`${n}px`,this.$(`contents`).value=e.root.contents,this.$(`reply`).value=``,this.update(e),r&&this.$(r).focus()}update(e){this.data=e,this.$(`label`).textContent=e.root.label,this.$(`meta`).innerHTML=`${Lf(e.root.author||`Unknown`)} · ${If(e.root.modifiedAt)}`;let t=this.$(`contents`);this.root.activeElement!==t&&(t.value=e.root.contents),t.readOnly=e.readOnly,t.hidden=e.readOnly&&e.root.contents===``,this.$(`replies`).innerHTML=e.replies.map(t=>`<li data-reply="${Lf(t.id)}">
621
+ <div class="who"><b>${Lf(t.author||`Unknown`)}</b><span class="meta">${If(t.modifiedAt)}</span>
622
+ ${e.readOnly?``:`<button type="button" class="icon" data-reply-id="${Lf(t.id)}" aria-label="Delete reply">✕</button>`}</div>
623
+ <p>${Lf(t.contents)}</p>
624
+ </li>`).join(``),this.$(`footer`).hidden=e.readOnly,this.$(`danger`).hidden=e.readOnly}close(){this.isOpen&&(this.flush(),this.removeAttribute(`open`),this.onClose?.())}flush(){clearTimeout(this.timer);let e=this.$(`contents`).value;this.data&&!this.data.readOnly&&e!==this.data.root.contents&&(this.data={...this.data,root:{...this.data.root,contents:e}},this.onContents?.(e))}submitReply(){let e=this.$(`reply`),t=e.value.trim();t&&(e.value=``,this.onReply?.(t))}$(e){return this.root.querySelector(`[data-part="${e}"]`)}}customElements.define(Mf,e)}function zf(){return Rf(),document.createElement(Mf)}var Bf=`pl-main-toolbar`,Vf=[.5,.75,1,1.25,1.5,2,3,4];function Hf(e,t){let n=.001;return t>0?Vf.find(t=>t>e+n)??Vf.at(-1):[...Vf].reverse().find(t=>t<e-n)??Vf[0]}var Uf={sidebar:`M4 5h16v14H4zM9 5v14`,prev:`M15 18l-6-6 6-6`,next:`M9 18l6-6-6-6`,zoomOut:`M5 12h14`,zoomIn:`M12 5v14M5 12h14`,search:`M11 4a7 7 0 1 1 0 14 7 7 0 0 1 0-14zM20 20l-4-4`,download:`M12 4v11M7 10l5 5 5-5M5 20h14`,print:`M7 9V4h10v5M7 17H5a1 1 0 0 1-1-1v-6a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v6a1 1 0 0 1-1 1h-2M7 14h10v6H7z`,annotate:`M4 20h4L19 9l-4-4L4 16zM13.5 6.5l4 4`,more:`M5 12h.01M12 12h.01M19 12h.01`},Wf=e=>`<svg viewBox="0 0 24 24" aria-hidden="true"><path d="${Uf[e]}"/></svg>`,Gf=`
625
+ :host {
626
+ display: flex;
627
+ align-items: center;
628
+ gap: 4px;
629
+ flex-wrap: wrap;
630
+ padding: 4px 8px;
631
+ min-height: 44px;
632
+ box-sizing: border-box;
633
+ background: var(--pl-surface);
634
+ color: var(--pl-text);
635
+ border-bottom: 1px solid var(--pl-border);
636
+ font: 13px var(--pl-font);
637
+ }
638
+ .group { display: flex; align-items: center; gap: 2px; }
639
+ .sep { width: 1px; align-self: stretch; margin: 6px 4px; background: var(--pl-border); }
640
+ .spacer { flex: 1; }
641
+ button {
642
+ all: unset;
643
+ box-sizing: border-box;
644
+ display: grid;
645
+ place-items: center;
646
+ width: 30px;
647
+ height: 30px;
648
+ border-radius: 6px;
649
+ cursor: pointer;
650
+ }
651
+ button:hover:not(:disabled) { background: color-mix(in srgb, var(--pl-text) 9%, transparent); }
652
+ button:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--pl-accent); outline-offset: -2px; }
653
+ button[aria-pressed='true'] { color: var(--pl-accent); background: color-mix(in srgb, var(--pl-accent) 15%, transparent); }
654
+ button:disabled { opacity: 0.35; cursor: default; }
655
+ svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
656
+ input {
657
+ width: 3.2em;
658
+ height: 26px;
659
+ box-sizing: border-box;
660
+ text-align: center;
661
+ border: 1px solid var(--pl-border);
662
+ border-radius: 6px;
663
+ background: transparent;
664
+ color: inherit;
665
+ font: inherit;
666
+ -moz-appearance: textfield;
667
+ }
668
+ input::-webkit-inner-spin-button { display: none; }
669
+ .total { color: var(--pl-muted); padding: 0 4px; white-space: nowrap; font-variant-numeric: tabular-nums; }
670
+ select {
671
+ height: 28px;
672
+ border: 1px solid var(--pl-border);
673
+ border-radius: 6px;
674
+ background: var(--pl-surface);
675
+ color: inherit;
676
+ font: inherit;
677
+ padding: 0 4px;
678
+ }
679
+ ::slotted(*) { flex: 0 1 auto; }
680
+ [hidden] { display: none !important; }
681
+
682
+ /* Compact (narrow viewers, e.g. phones): pinch replaces the zoom controls, the annotation tools fold into a second
683
+ row behind "Annotate", and search/download/print move into a "More" menu. */
684
+ .compact-only { display: none; }
685
+ :host([compact]) .compact-only { display: grid; }
686
+ :host([compact]) .wide-only,
687
+ :host([compact]) .sep { display: none; }
688
+ :host([compact]) ::slotted([slot='tools']) { display: none; }
689
+ /* Too narrow for one row: the annotation tools get a row of their own, so search/download/print stay top right. */
690
+ :host([split]:not([compact])) ::slotted([slot='tools']) { order: 10; flex: 1 0 100%; min-width: 0; }
691
+ :host([compact][tools-open]) ::slotted([slot='tools']) { display: flex; order: 10; flex: 1 0 100%; min-width: 0; }
692
+ :host([compact]) button { width: 36px; height: 36px; }
693
+ .more { position: relative; }
694
+ .menu {
695
+ position: absolute;
696
+ right: 0;
697
+ top: calc(100% + 4px);
698
+ z-index: 30;
699
+ min-width: 160px;
700
+ padding: 4px;
701
+ display: grid;
702
+ background: var(--pl-surface);
703
+ border: 1px solid var(--pl-border);
704
+ border-radius: 8px;
705
+ box-shadow: 0 8px 24px rgb(0 0 0 / 0.18);
706
+ }
707
+ .menu button { width: auto; height: 36px; display: flex; align-items: center; gap: 10px; justify-content: flex-start; padding: 0 10px; white-space: nowrap; }
708
+ .menu svg { flex: none; }
709
+ `;function Kf(){if(customElements.get(`pl-main-toolbar`))return;class e extends HTMLElement{onSidebarToggle=null;onPage=null;onZoom=null;onSearch=null;onDownload=null;onPrint=null;root;state={page:1,pageCount:1,zoom:1,fit:null,sidebarOpen:!0};constructor(){super(),this.root=this.attachShadow({mode:`open`});let e=Vf.map(e=>`<option value="${e}">${Math.round(e*100)}%</option>`).join(``);this.root.innerHTML=`
710
+ <style>${Gf}</style>
711
+ <button type="button" data-action="sidebar" aria-label="Toggle sidebar" title="Sidebar">${Wf(`sidebar`)}</button>
712
+ <div class="sep"></div>
713
+ <div class="group" role="group" aria-label="Page navigation">
714
+ <button type="button" class="wide-only" data-action="prev" aria-label="Previous page" title="Previous page">${Wf(`prev`)}</button>
715
+ <input type="number" min="1" inputmode="numeric" aria-label="Page number" />
716
+ <span class="total"></span>
717
+ <button type="button" class="wide-only" data-action="next" aria-label="Next page" title="Next page">${Wf(`next`)}</button>
718
+ </div>
719
+ <div class="sep" data-feature="zoom"></div>
720
+ <div class="group wide-only" role="group" aria-label="Zoom" data-feature="zoom">
721
+ <button type="button" data-action="zoom-out" aria-label="Zoom out" title="Zoom out">${Wf(`zoomOut`)}</button>
722
+ <select aria-label="Zoom level">
723
+ <option value="width">Fit width</option>
724
+ <option value="page">Fit page</option>
725
+ ${e}
726
+ <option value="custom" hidden></option>
727
+ </select>
728
+ <button type="button" data-action="zoom-in" aria-label="Zoom in" title="Zoom in">${Wf(`zoomIn`)}</button>
729
+ </div>
730
+ <div class="sep"></div>
731
+ <slot name="tools"></slot>
732
+ <div class="spacer"></div>
733
+ <slot name="presence"></slot>
734
+ <button type="button" class="compact-only" data-action="tools" aria-label="Annotate" title="Annotate" aria-pressed="false">${Wf(`annotate`)}</button>
735
+ <div class="more compact-only">
736
+ <button type="button" data-action="more" aria-label="More" title="More" aria-haspopup="menu" aria-expanded="false">${Wf(`more`)}</button>
737
+ <div class="menu" role="menu" hidden>
738
+ <button type="button" role="menuitem" data-action="search" data-feature="search">${Wf(`search`)}Search</button>
739
+ <button type="button" role="menuitem" data-action="download" data-feature="download">${Wf(`download`)}Download</button>
740
+ <button type="button" role="menuitem" data-action="print" data-feature="print">${Wf(`print`)}Print</button>
741
+ </div>
742
+ </div>
743
+ <div class="group wide-only">
744
+ <button type="button" data-action="search" data-feature="search" aria-label="Search" title="Search (Ctrl+F)">${Wf(`search`)}</button>
745
+ <button type="button" data-action="download" data-feature="download" aria-label="Download" title="Download">${Wf(`download`)}</button>
746
+ <button type="button" data-action="print" data-feature="print" aria-label="Print" title="Print">${Wf(`print`)}</button>
747
+ </div>`,this.root.addEventListener(`click`,e=>{let t=e.target.closest(`button`)?.dataset.action,{page:n,zoom:r}=this.state;if(t!==`more`&&this.setMenu(!1),t===`tools`){let e=!this.hasAttribute(`tools-open`);this.toggleAttribute(`tools-open`,e),this.button(`tools`).setAttribute(`aria-pressed`,String(e))}else t===`more`?this.setMenu(this.root.querySelector(`.menu`).hidden===!0):t===`sidebar`?this.onSidebarToggle?.():t===`prev`?this.onPage?.(n-1):t===`next`?this.onPage?.(n+1):t===`zoom-in`?this.onZoom?.(Hf(r,1)):t===`zoom-out`?this.onZoom?.(Hf(r,-1)):t===`search`?this.onSearch?.():t===`download`?this.onDownload?.():t===`print`&&this.onPrint?.()});let t=this.root.querySelector(`input`),n=()=>{let e=Number(t.value);Number.isInteger(e)&&e>=1&&e<=this.state.pageCount?this.onPage?.(e):t.value=String(this.state.page)};t.addEventListener(`change`,n),t.addEventListener(`keydown`,e=>{e.key===`Enter`&&(e.preventDefault(),n(),t.select())}),this.root.querySelector(`select`).addEventListener(`change`,e=>{let t=e.target.value;t===`width`||t===`page`?this.onZoom?.(t):t!==`custom`&&this.onZoom?.(Number(t))})}setCompact(e){this.toggleAttribute(`compact`,e),e||this.setMenu(!1),this.scheduleLayout()}resizeObserver=null;layoutFrame=0;connectedCallback(){this.resizeObserver??=new ResizeObserver(()=>this.scheduleLayout()),this.resizeObserver.observe(this),this.root.addEventListener(`slotchange`,this.scheduleLayout),this.addEventListener(`pl-resize`,this.scheduleLayout),this.scheduleLayout()}disconnectedCallback(){this.resizeObserver?.disconnect(),this.root.removeEventListener(`slotchange`,this.scheduleLayout),this.removeEventListener(`pl-resize`,this.scheduleLayout),cancelAnimationFrame(this.layoutFrame)}scheduleLayout=()=>{cancelAnimationFrame(this.layoutFrame),this.layoutFrame=requestAnimationFrame(()=>this.layout())};layout(){let e=this.querySelector(`[slot="tools"]`);if(!e||this.hasAttribute(`compact`))return void this.toggleAttribute(`split`,!1);let t=[...this.root.children].filter(e=>!(e instanceof HTMLSlotElement)&&!e.classList.contains(`spacer`)),n=[...this.querySelectorAll(`[slot="presence"]`)],r=parseFloat(getComputedStyle(this).columnGap)||0,i=getComputedStyle(this),a=this.clientWidth-parseFloat(i.paddingLeft)-parseFloat(i.paddingRight),o=xf(this,[...t,...n])+r+(e.naturalWidth?.()??e.scrollWidth);this.toggleAttribute(`split`,o>a)}setMenu(e){let t=this.root.querySelector(`.menu`);if(t.hidden!==!e&&(t.hidden=!e,this.button(`more`).setAttribute(`aria-expanded`,String(e)),e)){let e=t=>{t instanceof KeyboardEvent&&t.key!==`Escape`||t.type===`pointerdown`&&t.composedPath().includes(this.root.querySelector(`.more`))||(this.setMenu(!1),document.removeEventListener(`pointerdown`,e,!0),document.removeEventListener(`keydown`,e,!0))};document.addEventListener(`pointerdown`,e,!0),document.addEventListener(`keydown`,e,!0),t.querySelector(`button:not([hidden])`)?.focus()}}setFeatures(e){for(let t of this.root.querySelectorAll(`[data-feature]`))t.hidden=!e[t.dataset.feature]}setState(e){this.state=e;let t=this.root.querySelector(`input`);this.root.activeElement!==t&&(t.value=String(e.page)),t.max=String(e.pageCount),this.root.querySelector(`.total`).textContent=`/ ${e.pageCount}`,this.button(`prev`).disabled=e.page<=1,this.button(`next`).disabled=e.page>=e.pageCount,this.button(`sidebar`).setAttribute(`aria-pressed`,String(e.sidebarOpen)),this.button(`zoom-in`).disabled=e.zoom>=Vf.at(-1)-.001,this.button(`zoom-out`).disabled=e.zoom<=Vf[0]+.001;let n=this.root.querySelector(`select`),r=Vf.find(t=>Math.abs(t-e.zoom)<.001),i=n.querySelector(`option[value="custom"]`);i.textContent=`${Math.round(e.zoom*100)}%`,n.value=e.fit??(r===void 0?`custom`:String(r))}button(e){return this.root.querySelector(`[data-action="${e}"]`)}}customElements.define(Bf,e)}function qf(){return Kf(),document.createElement(Bf)}var Jf=`pl-sidebar`,Yf=`
748
+ :host {
749
+ display: flex;
750
+ flex-direction: column;
751
+ min-height: 0;
752
+ background: var(--pl-surface);
753
+ color: var(--pl-text);
754
+ border-right: 1px solid var(--pl-border);
755
+ font: 13px var(--pl-font);
756
+ }
757
+ :host([hidden]) { display: none; }
758
+ [role='tablist'] { display: flex; border-bottom: 1px solid var(--pl-border); flex: none; }
759
+ [role='tab'] {
760
+ all: unset;
761
+ flex: 1;
762
+ padding: 8px 4px;
763
+ text-align: center;
764
+ cursor: pointer;
765
+ color: var(--pl-muted);
766
+ border-bottom: 2px solid transparent;
767
+ }
768
+ [role='tab'][aria-selected='true'] { color: var(--pl-text); border-bottom-color: var(--pl-accent); font-weight: 600; }
769
+ [role='tab']:focus-visible { outline: 2px solid var(--pl-accent); outline-offset: -2px; }
770
+ .panels { flex: 1; min-height: 0; display: flex; }
771
+ ::slotted(*) { flex: 1; min-height: 0; }
772
+ ::slotted([hidden]) { display: none !important; }
773
+ `;function Xf(){if(customElements.get(`pl-sidebar`))return;class e extends HTMLElement{onTabChange=null;current=`pages`;root;constructor(){super(),this.root=this.attachShadow({mode:`open`}),this.root.innerHTML=`
774
+ <style>${Yf}</style>
775
+ <div role="tablist" aria-label="Sidebar">
776
+ <button role="tab" id="tab-pages" data-tab="pages" aria-controls="pages">Pages</button>
777
+ <button role="tab" id="tab-comments" data-tab="comments" aria-controls="comments">Comments</button>
778
+ </div>
779
+ <div class="panels"><slot name="pages"></slot><slot name="comments"></slot></div>`,this.root.addEventListener(`click`,e=>{let t=e.target.closest(`[role="tab"]`)?.dataset.tab;t&&this.showTab(t)}),this.root.querySelector(`[role="tablist"]`).addEventListener(`keydown`,e=>{let t=e.key;(t===`ArrowLeft`||t===`ArrowRight`)&&(this.showTab(this.current===`pages`?`comments`:`pages`),this.root.querySelector(`[data-tab="${this.current}"]`).focus())})}connectedCallback(){this.showTab(this.current)}get tab(){return this.current}showTab(e){let t=e!==this.current;this.current=e;for(let t of this.root.querySelectorAll(`[role="tab"]`)){let n=t.dataset.tab===e;t.setAttribute(`aria-selected`,String(n)),t.tabIndex=n?0:-1}for(let t of this.children){let n=t.getAttribute(`slot`);(n===`pages`||n===`comments`)&&(t.hidden=n!==e,t.setAttribute(`role`,`tabpanel`))}t&&this.onTabChange?.(e)}}customElements.define(Jf,e)}function Zf(){return Xf(),document.createElement(Jf)}var Qf=`pl-comments-panel`,$f=`
780
+ :host { display: block; overflow-y: auto; overscroll-behavior: contain; font: 13px/1.35 var(--pl-font); color: var(--pl-text); }
781
+ :host([hidden]) { display: none; }
782
+ .empty { padding: 24px 12px; text-align: center; color: var(--pl-muted); }
783
+ h3 { margin: 0; padding: 10px 12px 4px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--pl-muted); }
784
+ ul { list-style: none; margin: 0; padding: 0 6px 6px; }
785
+ button {
786
+ all: unset;
787
+ box-sizing: border-box;
788
+ display: block;
789
+ width: 100%;
790
+ padding: 8px;
791
+ border-radius: 8px;
792
+ cursor: pointer;
793
+ }
794
+ button:hover { background: color-mix(in srgb, var(--pl-text) 6%, transparent); }
795
+ button:focus-visible { outline: 2px solid var(--pl-accent); outline-offset: -2px; }
796
+ button[aria-current='true'] { background: color-mix(in srgb, var(--pl-accent) 14%, transparent); }
797
+ .head { display: flex; align-items: center; gap: 4px 6px; flex-wrap: wrap; }
798
+ .dot { width: 10px; height: 10px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgb(0 0 0 / 0.2); flex: none; }
799
+ .label { font-weight: 600; }
800
+ .meta { color: var(--pl-muted); font-size: 12px; flex-basis: 100%; }
801
+ .text { margin-top: 3px; color: var(--pl-text); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
802
+ .text:empty { display: none; }
803
+ .foot { margin-top: 3px; color: var(--pl-muted); font-size: 12px; }
804
+ `,ep=new Intl.DateTimeFormat(void 0,{dateStyle:`medium`,timeStyle:`short`}),tp=e=>e.replace(/[&<>"']/g,e=>`&#${e.charCodeAt(0)};`);function np(){if(customElements.get(`pl-comments-panel`))return;class e extends HTMLElement{onSelect=null;root;selected=null;constructor(){super(),this.root=this.attachShadow({mode:`open`}),this.root.innerHTML=`<style>${$f}</style><div class="list"></div>`,this.root.addEventListener(`click`,e=>{let t=e.target.closest(`button[data-id]`)?.dataset.id;t&&this.onSelect?.(t)})}setItems(e){let t=this.root.querySelector(`.list`);if(e.length===0){t.innerHTML=`<p class="empty">No comments or markup yet.</p>`;return}let n=new Map;for(let t of e)n.set(t.page,[...n.get(t.page)??[],t]);t.innerHTML=[...n].sort(([e],[t])=>e-t).map(([e,t])=>`<h3>Page ${e}</h3><ul>${t.map(e=>`<li><button type="button" data-id="${tp(e.id)}" aria-current="${e.id===this.selected}">
805
+ <div class="head"><span class="dot" style="background:${tp(e.color)}"></span>
806
+ <span class="label">${tp(e.label)}</span>
807
+ <span class="meta">${tp(e.author||`Unknown`)} · <time datetime="${tp(e.modifiedAt)}">${tp(ep.format(new Date(e.modifiedAt)))}</time></span></div>
808
+ <div class="text">${tp(e.contents)}</div>
809
+ ${e.replies?`<div class="foot">${e.replies} ${e.replies===1?`reply`:`replies`}</div>`:``}
810
+ </button></li>`).join(``)}</ul>`).join(``)}setSelected(e){this.selected=e;for(let t of this.root.querySelectorAll(`button[data-id]`))t.setAttribute(`aria-current`,String(t.dataset.id===e))}}customElements.define(Qf,e)}function rp(){return np(),document.createElement(Qf)}var ip=`pl-signature-dialog`,ap=[{label:`Script`,css:`'Segoe Script', 'Snell Roundhand', 'Brush Script MT', 'URW Chancery L', cursive`},{label:`Hand`,css:`'Ink Free', 'Bradley Hand', 'Segoe Print', 'Comic Sans MS', cursive`},{label:`Formal`,css:`'Lucida Handwriting', 'Apple Chancery', 'Palatino Linotype', 'URW Palladio L', serif`}],op=[`#111827`,`#1d4ed8`],sp=`
811
+ dialog {
812
+ width: min(520px, calc(100vw - 32px));
813
+ box-sizing: border-box;
814
+ padding: 0;
815
+ border: 1px solid var(--pl-border);
816
+ border-radius: 12px;
817
+ background: var(--pl-surface);
818
+ color: var(--pl-text);
819
+ font: 14px/1.4 var(--pl-font);
820
+ box-shadow: 0 20px 50px rgb(0 0 0 / 0.25);
821
+ }
822
+ dialog::backdrop { background: rgb(0 0 0 / 0.35); }
823
+ header, footer { display: flex; align-items: center; gap: 8px; padding: 12px 16px; }
824
+ header { border-bottom: 1px solid var(--pl-border); }
825
+ h2 { margin: 0; font-size: 16px; flex: 1; }
826
+ footer { border-top: 1px solid var(--pl-border); justify-content: flex-end; }
827
+ footer label { margin-right: auto; display: flex; gap: 6px; align-items: center; color: var(--pl-muted); }
828
+ .body { padding: 12px 16px 16px; display: grid; gap: 12px; }
829
+ .saved { display: flex; gap: 8px; flex-wrap: wrap; }
830
+ .saved:empty { display: none; }
831
+ .saved-item { position: relative; }
832
+ .saved-item button.use-saved { width: 120px; height: 52px; display: grid; place-items: center; background: #fff; border: 1px solid var(--pl-border); border-radius: 8px; padding: 4px; }
833
+ .saved-item img { max-width: 100%; max-height: 100%; }
834
+ .saved-item button.remove { position: absolute; top: -6px; right: -6px; width: 20px; height: 20px; border-radius: 50%; font-size: 12px; line-height: 1; padding: 0; background: var(--pl-surface); border: 1px solid var(--pl-border); }
835
+ [role='tablist'] { display: flex; gap: 4px; border-bottom: 1px solid var(--pl-border); }
836
+ [role='tab'] { border: 0; background: none; padding: 8px 12px; border-bottom: 2px solid transparent; color: var(--pl-muted); }
837
+ [role='tab'][aria-selected='true'] { color: var(--pl-accent); border-bottom-color: var(--pl-accent); font-weight: 600; }
838
+ [role='tabpanel'][hidden] { display: none; }
839
+ .pad { position: relative; height: 180px; border: 1px dashed var(--pl-border); border-radius: 8px; background: #fff; touch-action: none; cursor: crosshair; }
840
+ .pad canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
841
+ .pad .hint { position: absolute; inset: auto 0 12px; text-align: center; color: #9ca3af; pointer-events: none; }
842
+ .pad-tools { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
843
+ .ink { width: 22px; height: 22px; border-radius: 50%; border: 2px solid transparent; padding: 0; }
844
+ .ink[aria-pressed='true'] { outline: 2px solid var(--pl-accent); outline-offset: 1px; }
845
+ input[type='text'] { width: 100%; box-sizing: border-box; padding: 8px 10px; font: inherit; border: 1px solid var(--pl-border); border-radius: 8px; background: var(--pl-surface); color: inherit; }
846
+ .fonts { display: grid; gap: 6px; margin-top: 8px; }
847
+ .fonts button { text-align: left; padding: 6px 12px; font-size: 28px; background: #fff; color: #111827; border: 1px solid var(--pl-border); border-radius: 8px; min-height: 52px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
848
+ .fonts button[aria-pressed='true'] { border-color: var(--pl-accent); box-shadow: 0 0 0 1px var(--pl-accent); }
849
+ .drop { display: grid; place-items: center; gap: 8px; height: 180px; border: 1px dashed var(--pl-border); border-radius: 8px; background: #fff; color: #4b5563; text-align: center; padding: 8px; }
850
+ .drop.over { border-color: var(--pl-accent); }
851
+ .drop img { max-width: 100%; max-height: 120px; }
852
+ button { font: inherit; cursor: pointer; color: inherit; border-radius: 8px; }
853
+ footer button, .pad-tools button.clear, .drop button { padding: 7px 14px; border: 1px solid var(--pl-border); background: var(--pl-surface); }
854
+ footer button.primary { background: var(--pl-accent); border-color: var(--pl-accent); color: #fff; }
855
+ button:disabled { opacity: 0.45; cursor: default; }
856
+ button:focus-visible, input:focus-visible { outline: 2px solid var(--pl-accent); outline-offset: 1px; }
857
+ .error { color: #b91c1c; margin: 0; }
858
+ .error:empty { display: none; }
859
+ `;function cp(e,t=8){let n=e.getContext(`2d`),{width:r,height:i}=e,{data:a}=n.getImageData(0,0,r,i),[o,s,c,l]=[r,i,-1,-1];for(let e=0;e<i;e++)for(let t=0;t<r;t++)a[(e*r+t)*4+3]>8&&(t<o&&(o=t),t>c&&(c=t),e<s&&(s=e),e>l&&(l=e));if(c<0)return null;let u=Math.max(0,o-t),d=Math.max(0,s-t),f=Math.min(r,c+t+1)-u,p=Math.min(i,l+t+1)-d,m=document.createElement(`canvas`);return m.width=f,m.height=p,m.getContext(`2d`).drawImage(e,u,d,f,p,0,0,f,p),m.toDataURL(`image/png`)}function lp(e,t,n=op[0]){let r=document.createElement(`canvas`),i=r.getContext(`2d`);i.font=`96px ${t}`;let a=Math.ceil(i.measureText(e).width)+96;return r.width=Math.min(a,4e3),r.height=173,i.font=`96px ${t}`,i.fillStyle=n,i.textBaseline=`middle`,i.fillText(e,48,r.height/2),cp(r)}function up(){if(customElements.get(`pl-signature-dialog`))return;class e extends HTMLElement{root;dialog;mode=`draw`;ink=op[0];font=0;drawn=!1;upload=null;finish=null;onRemove=()=>{};constructor(){super(),this.root=this.attachShadow({mode:`open`}),this.root.innerHTML=`<style>${sp}</style>
860
+ <dialog aria-labelledby="pl-sig-title">
861
+ <header><h2 id="pl-sig-title">Add signature</h2></header>
862
+ <div class="body">
863
+ <div class="saved" role="list" aria-label="Saved signatures"></div>
864
+ <div role="tablist" aria-label="How to sign">
865
+ <button type="button" role="tab" data-mode="draw" aria-selected="true">Draw</button>
866
+ <button type="button" role="tab" data-mode="type" aria-selected="false" tabindex="-1">Type</button>
867
+ <button type="button" role="tab" data-mode="upload" aria-selected="false" tabindex="-1">Upload</button>
868
+ </div>
869
+ <div role="tabpanel" data-panel="draw" aria-label="Draw">
870
+ <div class="pad"><canvas aria-label="Signature pad: draw with the mouse, a finger or a pen" role="img"></canvas><span class="hint">Sign here</span></div>
871
+ <div class="pad-tools">
872
+ ${op.map((e,t)=>`<button type="button" class="ink" data-ink="${e}" style="background:${e}" aria-label="Ink ${t===0?`black`:`blue`}" aria-pressed="${t===0}"></button>`).join(``)}
873
+ <button type="button" class="clear">Clear</button>
874
+ </div>
875
+ </div>
876
+ <div role="tabpanel" data-panel="type" aria-label="Type" hidden>
877
+ <input type="text" aria-label="Your name" placeholder="Type your name" maxlength="80" autocomplete="name" />
878
+ <div class="fonts" role="group" aria-label="Style">
879
+ ${ap.map((e,t)=>`<button type="button" data-font="${t}" aria-pressed="${t===0}" aria-label="${e.label} style" style="font-family:${e.css.replace(/"/g,`&quot;`)}">Your name</button>`).join(``)}
880
+ </div>
881
+ </div>
882
+ <div role="tabpanel" data-panel="upload" aria-label="Upload" hidden>
883
+ <div class="drop">
884
+ <span class="drop-text">Drop an image of your signature here<br />PNG, JPEG, WebP or SVG</span>
885
+ <button type="button" class="pick">Choose image…</button>
886
+ <input type="file" accept="image/*" hidden />
887
+ </div>
888
+ </div>
889
+ <p class="error" role="alert"></p>
890
+ </div>
891
+ <footer>
892
+ <label><input type="checkbox" class="remember" checked /> Save for reuse</label>
893
+ <button type="button" class="cancel">Cancel</button>
894
+ <button type="button" class="primary use" disabled>Use signature</button>
895
+ </footer>
896
+ </dialog>`,this.dialog=this.root.querySelector(`dialog`),this.wire()}choose(e,t){return this.finish?.(null),this.onRemove=t,this.renderSaved(e),this.reset(),this.dialog.showModal(),this.sizePad(),new Promise(e=>this.finish=e)}$(e){return this.root.querySelector(e)}close(e){let t=this.finish;this.finish=null,this.dialog.open&&this.dialog.close(),t?.(e)}wire(){this.dialog.addEventListener(`close`,()=>this.close(null)),this.$(`.cancel`).addEventListener(`click`,()=>this.close(null)),this.$(`.use`).addEventListener(`click`,()=>void this.use());let e=[...this.root.querySelectorAll(`[role="tab"]`)];for(let t of e)t.addEventListener(`click`,()=>this.setMode(t.dataset.mode));this.$(`[role="tablist"]`).addEventListener(`keydown`,t=>{let n=t;if(n.key!==`ArrowRight`&&n.key!==`ArrowLeft`)return;let r=e.findIndex(e=>e.dataset.mode===this.mode),i=e[(r+(n.key===`ArrowRight`?1:e.length-1))%e.length];this.setMode(i.dataset.mode),i.focus()}),this.wirePad();let t=this.$(`input[type="text"]`);t.addEventListener(`input`,()=>{for(let e of this.root.querySelectorAll(`[data-font]`))e.textContent=t.value||`Your name`;this.updateUse()});for(let e of this.root.querySelectorAll(`[data-font]`))e.addEventListener(`click`,()=>{this.font=Number(e.dataset.font);for(let t of this.root.querySelectorAll(`[data-font]`))t.setAttribute(`aria-pressed`,String(t===e))});let n=this.$(`input[type="file"]`),r=this.$(`.drop`);this.$(`.pick`).addEventListener(`click`,()=>n.click()),n.addEventListener(`change`,()=>n.files?.[0]&&this.setUpload(n.files[0])),r.addEventListener(`dragover`,e=>{e.preventDefault(),r.classList.add(`over`)}),r.addEventListener(`dragleave`,()=>r.classList.remove(`over`)),r.addEventListener(`drop`,e=>{e.preventDefault(),r.classList.remove(`over`);let t=e.dataTransfer?.files[0];t&&this.setUpload(t)})}wirePad(){let e=this.$(`.pad canvas`),t=()=>e.getContext(`2d`),n=null,r=null,i=t=>{let n=e.getBoundingClientRect();return{x:(t.clientX-n.left)/n.width*e.width,y:(t.clientY-n.top)/n.height*e.height}};e.addEventListener(`pointerdown`,a=>{e.setPointerCapture(a.pointerId),n=i(a),r=n;let o=t();o.fillStyle=this.ink,o.beginPath(),o.arc(n.x,n.y,o.lineWidth/2,0,Math.PI*2),o.fill(),this.markDrawn()}),e.addEventListener(`pointermove`,e=>{if(!n||!r)return;let a=i(e),o={x:(n.x+a.x)/2,y:(n.y+a.y)/2},s=t();s.strokeStyle=this.ink,s.beginPath(),s.moveTo(r.x,r.y),s.quadraticCurveTo(n.x,n.y,o.x,o.y),s.stroke(),n=a,r=o});let a=()=>{n=null,r=null};e.addEventListener(`pointerup`,a),e.addEventListener(`pointercancel`,a),this.$(`.clear`).addEventListener(`click`,()=>{t().clearRect(0,0,e.width,e.height),this.drawn=!1,this.$(`.hint`).hidden=!1,this.updateUse()});for(let e of this.root.querySelectorAll(`[data-ink]`))e.addEventListener(`click`,()=>{this.ink=e.dataset.ink;for(let t of this.root.querySelectorAll(`[data-ink]`))t.setAttribute(`aria-pressed`,String(t===e))})}markDrawn(){this.drawn=!0,this.$(`.hint`).hidden=!0,this.updateUse()}sizePad(){let e=this.$(`.pad canvas`),{width:t,height:n}=e.getBoundingClientRect(),r=Math.max(2,window.devicePixelRatio||1);e.width=Math.round(t*r),e.height=Math.round(n*r);let i=e.getContext(`2d`);i.lineWidth=2.5*r,i.lineCap=`round`,i.lineJoin=`round`}reset(){this.drawn=!1,this.upload=null,this.$(`.hint`).hidden=!1,this.$(`input[type="text"]`).value=``;for(let e of this.root.querySelectorAll(`[data-font]`))e.textContent=`Your name`;this.$(`input[type="file"]`).value=``,this.$(`.drop`).querySelector(`img`)?.remove(),this.$(`.error`).textContent=``,this.$(`.remember`).checked=!0,this.setMode(`draw`)}setMode(e){this.mode=e;for(let t of this.root.querySelectorAll(`[role="tab"]`)){let n=t.dataset.mode===e;t.setAttribute(`aria-selected`,String(n)),t.tabIndex=n?0:-1}for(let t of this.root.querySelectorAll(`[role="tabpanel"]`))t.hidden=t.dataset.panel!==e;e===`draw`&&this.sizePad(),this.updateUse()}setUpload(e){let t=this.$(`.error`);if(!e.type.startsWith(`image/`)){t.textContent=`That file is not an image.`;return}t.textContent=``,this.upload=e;let n=this.$(`.drop`);n.querySelector(`img`)?.remove();let r=document.createElement(`img`);r.alt=`Uploaded signature`,r.src=URL.createObjectURL(e),r.onload=()=>URL.revokeObjectURL(r.src),n.prepend(r),this.updateUse()}updateUse(){let e=this.mode===`draw`?this.drawn:this.mode===`type`?this.$(`input[type="text"]`).value.trim()!==``:!!this.upload;this.$(`.use`).disabled=!e}async use(){let e=null;e=this.mode===`draw`?cp(this.$(`.pad canvas`)):this.mode===`type`?lp(this.$(`input[type="text"]`).value.trim(),ap[this.font].css,this.ink):this.upload,e&&this.close({image:e,remember:this.$(`.remember`).checked})}renderSaved(e){this.$(`.saved`).replaceChildren(...e.map((e,t)=>{let n=document.createElement(`div`);n.className=`saved-item`,n.setAttribute(`role`,`listitem`);let r=document.createElement(`button`);r.type=`button`,r.className=`use-saved`,r.setAttribute(`aria-label`,`Use saved signature ${t+1}`);let i=document.createElement(`img`);i.src=e.image,i.alt=``,r.append(i),r.addEventListener(`click`,()=>this.close({image:e.image,remember:!1}));let a=document.createElement(`button`);return a.type=`button`,a.className=`remove`,a.textContent=`×`,a.setAttribute(`aria-label`,`Remove saved signature ${t+1}`),a.addEventListener(`click`,()=>{n.remove(),this.onRemove(e.id)}),n.append(r,a),n}))}}customElements.define(ip,e)}function dp(){return up(),document.createElement(ip)}var fp=`pl-confirm-dialog`,pp=`
897
+ dialog {
898
+ width: min(420px, calc(100vw - 32px));
899
+ box-sizing: border-box;
900
+ padding: 20px;
901
+ border: 1px solid var(--pl-border);
902
+ border-radius: 12px;
903
+ background: var(--pl-surface);
904
+ color: var(--pl-text);
905
+ font: 14px/1.45 var(--pl-font);
906
+ box-shadow: 0 20px 50px rgb(0 0 0 / 0.25);
907
+ }
908
+ dialog::backdrop { background: rgb(0 0 0 / 0.35); }
909
+ h2 { margin: 0 0 8px; font-size: 16px; }
910
+ p { margin: 0 0 20px; color: var(--pl-muted); white-space: pre-line; }
911
+ .actions { display: flex; justify-content: flex-end; gap: 8px; }
912
+ button { font: inherit; padding: 7px 14px; border-radius: 8px; border: 1px solid var(--pl-border); background: var(--pl-surface); color: inherit; cursor: pointer; }
913
+ button.confirm { background: var(--pl-accent); border-color: var(--pl-accent); color: #fff; }
914
+ button.confirm.danger { background: #b91c1c; border-color: #b91c1c; }
915
+ button:focus-visible { outline: 2px solid var(--pl-accent); outline-offset: 1px; }
916
+ `;function mp(){if(customElements.get(`pl-confirm-dialog`))return;class e extends HTMLElement{dialog;resolve=null;constructor(){super();let e=this.attachShadow({mode:`open`});e.innerHTML=`<style>${pp}</style>
917
+ <dialog role="alertdialog" aria-labelledby="t" aria-describedby="m">
918
+ <h2 id="t"></h2><p id="m"></p>
919
+ <div class="actions"><button type="button" class="cancel">Cancel</button><button type="button" class="confirm"></button></div>
920
+ </dialog>`,this.dialog=e.querySelector(`dialog`),e.querySelector(`.cancel`).addEventListener(`click`,()=>this.finish(!1)),e.querySelector(`.confirm`).addEventListener(`click`,()=>this.finish(!0)),this.dialog.addEventListener(`close`,()=>this.finish(!1))}ask(e){this.finish(!1);let t=this.shadowRoot;t.querySelector(`h2`).textContent=e.title,t.querySelector(`p`).textContent=e.message;let n=t.querySelector(`.confirm`);return n.textContent=e.confirmLabel,n.classList.toggle(`danger`,!!e.danger),this.dialog.showModal(),t.querySelector(`.cancel`).focus(),new Promise(e=>this.resolve=e)}finish(e){let t=this.resolve;this.resolve=null,this.dialog.open&&this.dialog.close(),t?.(e)}}customElements.define(fp,e)}function hp(){return mp(),document.createElement(fp)}var gp=`pl-password-dialog`,_p=`
921
+ dialog {
922
+ width: min(380px, calc(100vw - 32px));
923
+ box-sizing: border-box;
924
+ padding: 20px;
925
+ border: 1px solid var(--pl-border);
926
+ border-radius: 12px;
927
+ background: var(--pl-surface);
928
+ color: var(--pl-text);
929
+ font: 14px/1.45 var(--pl-font);
930
+ box-shadow: 0 20px 50px rgb(0 0 0 / 0.25);
931
+ }
932
+ dialog::backdrop { background: rgb(0 0 0 / 0.35); }
933
+ h2 { margin: 0 0 6px; font-size: 16px; }
934
+ p { margin: 0 0 14px; color: var(--pl-muted); }
935
+ label { display: block; font-weight: 600; margin-bottom: 6px; }
936
+ input { box-sizing: border-box; width: 100%; font: inherit; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--pl-border); background: var(--pl-surface); color: inherit; }
937
+ input:focus-visible { outline: 2px solid var(--pl-accent); outline-offset: 1px; }
938
+ .error { color: #b91c1c; margin: 8px 0 0; }
939
+ .error[hidden] { display: none; }
940
+ .actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
941
+ button { font: inherit; padding: 7px 14px; border-radius: 8px; border: 1px solid var(--pl-border); background: var(--pl-surface); color: inherit; cursor: pointer; }
942
+ button.open { background: var(--pl-accent); border-color: var(--pl-accent); color: #fff; }
943
+ button:disabled { opacity: 0.5; cursor: default; }
944
+ button:focus-visible { outline: 2px solid var(--pl-accent); outline-offset: 1px; }
945
+ `;function vp(){if(customElements.get(`pl-password-dialog`))return;class e extends HTMLElement{dialog;input;resolve=null;constructor(){super();let e=this.attachShadow({mode:`open`});e.innerHTML=`<style>${_p}</style>
946
+ <dialog aria-labelledby="t" aria-describedby="m">
947
+ <form method="dialog">
948
+ <h2 id="t">Password required</h2>
949
+ <p id="m">This document is protected. Enter its password to open it.</p>
950
+ <label for="pw">Document password</label>
951
+ <input id="pw" type="password" autocomplete="off" />
952
+ <p class="error" role="alert" hidden>That password is incorrect. Try again.</p>
953
+ <div class="actions"><button type="button" class="cancel">Cancel</button><button type="submit" class="open" disabled>Open</button></div>
954
+ </form>
955
+ </dialog>`,this.dialog=e.querySelector(`dialog`),this.input=e.querySelector(`input`);let t=e.querySelector(`.open`);this.input.addEventListener(`input`,()=>t.disabled=this.input.value===``),e.querySelector(`form`).addEventListener(`submit`,e=>{e.preventDefault(),this.input.value!==``&&this.finish(this.input.value)}),e.querySelector(`.cancel`).addEventListener(`click`,()=>this.finish(null)),this.dialog.addEventListener(`close`,()=>this.finish(null))}ask({incorrect:e}){this.finish(null);let t=this.shadowRoot;return t.querySelector(`.error`).hidden=!e,this.input.value=``,t.querySelector(`.open`).disabled=!0,this.dialog.showModal(),this.input.focus(),new Promise(e=>this.resolve=e)}finish(e){let t=this.resolve;this.resolve=null,this.dialog.open&&this.dialog.close(),this.input.value=``,t?.(e)}}customElements.define(gp,e)}function yp(){return vp(),document.createElement(gp)}var bp=`pl-presence`,xp=4,Sp={connecting:`Connecting…`,connected:`Live: changes are shared`,disconnected:`Offline: changes will sync when the connection is back`},Cp=`
956
+ :host { display: flex; align-items: center; gap: 6px; padding: 0 4px; font: 12px var(--pl-font); color: var(--pl-text); }
957
+ :host([hidden]) { display: none; }
958
+ .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: #9ca3af; }
959
+ .dot[data-status='connected'] { background: #16a34a; }
960
+ .dot[data-status='connecting'] { background: #f59e0b; animation: pulse 1.2s ease-in-out infinite; }
961
+ @keyframes pulse { 50% { opacity: 0.35; } }
962
+ .avatars { display: flex; }
963
+ .avatar {
964
+ width: 26px;
965
+ height: 26px;
966
+ margin-left: -6px;
967
+ border-radius: 50%;
968
+ display: grid;
969
+ place-items: center;
970
+ color: #fff;
971
+ font-weight: 600;
972
+ font-size: 11px;
973
+ box-shadow: 0 0 0 2px var(--pl-surface);
974
+ cursor: default;
975
+ user-select: none;
976
+ }
977
+ .avatar:first-child { margin-left: 0; }
978
+ .avatar.self { outline: 2px solid var(--pl-accent); outline-offset: 1px; }
979
+ .more { background: var(--pl-muted); }
980
+ @media (prefers-reduced-motion: reduce) { .dot { animation: none !important; } }
981
+ `,wp=e=>e.trim().split(/\s+/).slice(0,2).map(e=>[...e][0]?.toUpperCase()??``).join(``)||`?`;function Tp(){if(customElements.get(`pl-presence`))return;class e extends HTMLElement{root;constructor(){super(),this.root=this.attachShadow({mode:`open`}),this.root.innerHTML=`<style>${Cp}</style><span class="dot" role="status"></span><div class="avatars" role="list"></div>`,this.setStatus(`connecting`)}setStatus(e){let t=this.root.querySelector(`.dot`);t.dataset.status=e,t.title=Sp[e],t.setAttribute(`aria-label`,Sp[e])}setPeers(e){let t=this.root.querySelector(`.avatars`),n=e=>e.self?`${e.name} (you)`:e.name;if(t.replaceChildren(...e.slice(0,xp).map(e=>{let t=document.createElement(`span`);return t.className=e.self?`avatar self`:`avatar`,t.setAttribute(`role`,`listitem`),t.style.background=e.color,t.textContent=wp(e.name),t.title=n(e),t.setAttribute(`aria-label`,n(e)),t})),e.length>xp){let r=document.createElement(`span`);r.className=`avatar more`,r.setAttribute(`role`,`listitem`),r.textContent=`+${e.length-xp}`,r.title=e.slice(xp).map(n).join(`, `),t.append(r)}this.setAttribute(`aria-label`,`${e.length} ${e.length===1?`person`:`people`} here: ${e.map(n).join(`, `)}`)}}customElements.define(bp,e)}function Ep(){return Tp(),document.createElement(bp)}Ne();var Dp=new Set([`highlight`,`underline`,`strikeout`]),Op={highlight:`Highlight`,underline:`Underline`,strikeout:`Strikeout`,note:`Note`,reply:`Reply`,ink:`Drawing`,rectangle:`Rectangle`,ellipse:`Ellipse`,line:`Line`,arrow:`Arrow`,freeText:`Text box`,signature:`Signature`,redaction:`Redaction`},kp=24,Ap={width:200,height:28},jp=150,Mp=3,Np=2,Pp=class{o;toolbar;thread;onSelectionChange=null;tool=`select`;selectedId=null;editingId=null;strokeWidth=2;toolColors=new Map;gesture=null;stopGesture=null;dirtyPages=new Set;flushQueued=!1;abort=new AbortController;pendingSignature=null;constructor(e){this.o=e,this.toolbar=jf(),this.thread=zf(),e.main.append(this.thread),this.toolbar.setTools(e.tools),this.wireToolbar(),this.wireThread(),this.wireEvents(),this.setTool(`select`)}get currentTool(){return this.tool}setTool(e){this.o.readOnly&&e!==`select`||(this.finishEditing(),this.tool=e,this.o.root.dataset.tool=e,e!==`select`&&this.select(null),e===`signature`?this.armSignature():this.pendingSignature=null,(Dp.has(e)||e===`redaction`)&&this.applyMarkupToSelection(),this.syncToolbar())}focusAnnotation(e){let t=this.o.manager.get(e);if(!t)return;this.tool!==`select`&&this.setTool(`select`);let n=t.page-1;this.o.viewport.scrollToRect(n,He(t.rect,this.o.viewport.pageSize(n))),this.select(e),requestAnimationFrame(()=>this.openThread(e))}refreshAll(){for(let e of this.o.manager.list())this.markDirty(e.page-1)}destroy(){this.gesture?.cancel(),this.abort.abort(),this.toolbar.remove(),this.thread.remove()}markDirty(e){this.dirtyPages.add(e),!this.flushQueued&&(this.flushQueued=!0,queueMicrotask(()=>{this.flushQueued=!1;for(let e of this.dirtyPages)this.renderPage(e);this.dirtyPages.clear()}))}renderPage(e){let t=this.o.viewport.annotationLayer(e);if(!t)return;let n=this.o.manager.list({page:e+1}),r=new Map;for(let e of n)e.type===`reply`&&r.set(e.inReplyTo,(r.get(e.inReplyTo)??0)+1);t.render(n,this.o.viewport.pageSize(e),{selectedId:this.selectedId,replyCounts:r,editingId:this.editingId})}select(e){if(e===this.selectedId)return;let t=this.selectedId&&this.o.manager.get(this.selectedId);this.selectedId=e,e?this.o.root.dataset.selected=e:delete this.o.root.dataset.selected,t&&this.markDirty(t.page-1);let n=e&&this.o.manager.get(e);n&&this.markDirty(n.page-1),this.thread.threadId&&this.thread.threadId!==e&&this.thread.close(),this.syncToolbar(),this.onSelectionChange?.(e)}selected(){return this.selectedId?this.o.manager.get(this.selectedId):void 0}toolColor(e){return this.toolColors.get(e)??h[e===`select`?`note`:e]}syncToolbar(){let e=this.selected(),t=e&&`strokeWidth`in e;this.toolbar.setState({tool:this.tool,color:e?e.color:this.toolColor(this.tool),strokeWidth:t?e.strokeWidth:this.strokeWidth,strokeEnabled:!this.o.readOnly&&(t||Df(this.tool)),hasSelection:!!e&&!this.o.readOnly,canUndo:this.o.history.state.canUndo,canRedo:this.o.history.state.canRedo,readOnly:this.o.readOnly,pendingRedactions:this.o.tools.includes(`redaction`)?this.o.manager.list({type:`redaction`}).filter(e=>e.type===`redaction`&&!e.applied).length:0})}wireToolbar(){let{toolbar:e}=this;e.onTool=e=>this.setTool(e),e.onApplyRedactions=()=>this.o.applyRedactions?.(),e.onColor=e=>{let t=this.selected();t&&!this.o.readOnly?(this.o.manager.update(t.id,{color:e},`user`),this.toolColors.set(t.type,e)):(this.toolColors.set(this.tool,e),Dp.has(this.tool)&&this.applyMarkupToSelection()),this.syncToolbar()},e.onStrokeWidth=e=>{let t=this.selected();t&&`strokeWidth`in t&&!this.o.readOnly&&this.o.manager.update(t.id,{strokeWidth:e},`user`),this.strokeWidth=e,this.syncToolbar()},e.onDelete=()=>this.deleteSelected(),e.onComment=()=>this.selectedId&&this.openThread(this.selectedId,`contents`),e.onUndo=()=>this.o.history.undo(),e.onRedo=()=>this.o.history.redo(),this.o.history.onChange(()=>this.syncToolbar())}threadData(e){let t=this.o.manager.get(e);return t?{root:{...t,label:Op[t.type]},replies:this.o.manager.replies(e),readOnly:this.o.readOnly}:null}openThread(e,t=null){let n=this.threadData(e),r=this.threadPosition(e);n&&r&&this.thread.open(n,r.x,r.y,this.o.readOnly?null:t)}threadPosition(e){let t=this.o.manager.get(e),n=t&&this.o.viewport.annotationLayer(t.page-1)?.element(e);if(!n)return null;let r=n.getBoundingClientRect(),i=this.o.main.getBoundingClientRect(),a=r.right-i.left+8;a+280>i.width-8&&(a=Math.max(8,r.left-i.left-280-8));let o=Math.min(Math.max(56,r.top-i.top),Math.max(56,i.height-200));return{x:a,y:o}}wireThread(){let{thread:e,o:t}=this;e.onContents=n=>e.threadId&&t.manager.get(e.threadId)&&t.manager.update(e.threadId,{contents:n},`user`),e.onReply=n=>{e.threadId&&t.manager.add({type:`reply`,inReplyTo:e.threadId,contents:n},`user`)},e.onDeleteReply=e=>t.manager.remove(e,`user`),e.onDelete=()=>{let n=e.threadId;e.close(),n&&t.manager.remove(n,`user`)}}wireEvents(){let{o:e}=this,t=this.abort.signal;e.events.on(`annotationAdded`,({annotation:e})=>this.onChanged(e)),e.events.on(`annotationChanged`,({annotation:e,previous:t})=>{t.page!==e.page&&this.markDirty(t.page-1),this.onChanged(e)}),e.events.on(`annotationRemoved`,({annotation:e})=>{e.id===this.selectedId&&this.select(null),e.id===this.thread.threadId&&this.thread.close(),this.onChanged(e)}),e.viewport.scroller.addEventListener(`pointerdown`,e=>this.onPointerDown(e),{signal:t}),e.viewport.scroller.addEventListener(`dblclick`,e=>this.onDoubleClick(e),{signal:t}),e.viewport.scroller.addEventListener(`scroll`,()=>{let e=this.thread.threadId,t=e&&this.threadPosition(e);t&&Object.assign(this.thread.style,{left:`${t.x}px`,top:`${t.y}px`})},{passive:!0,signal:t}),document.addEventListener(`pointerup`,()=>{Dp.has(this.tool)&&setTimeout(()=>this.applyMarkupToSelection(),0)},{signal:t}),e.root.addEventListener(`keydown`,e=>this.onKeyDown(e),{signal:t})}onChanged(e){this.markDirty(e.page-1);let t=this.thread.threadId;if(t&&(e.id===t||e.type===`reply`&&e.inReplyTo===t)){let e=this.threadData(t);e&&this.thread.update(e)}e.id===this.selectedId&&this.syncToolbar()}onKeyDown(e){let t=e.composedPath()[0];t instanceof HTMLElement&&(t.isContentEditable||/^(INPUT|TEXTAREA|SELECT)$/.test(t.tagName))||((e.key===`Delete`||e.key===`Backspace`)&&this.selectedId?(e.preventDefault(),this.deleteSelected()):e.key===`Escape`&&(this.gesture?(this.gesture.cancel(),this.gesture=null):this.selectedId?this.select(null):this.tool!==`select`&&this.setTool(`select`)))}deleteSelected(){let e=this.selected();!e||this.o.readOnly||e.locked||this.o.manager.remove(e.id,`user`)}toPdf(e,t){let n=this.o.viewport.pageElement(e).getBoundingClientRect();return We({x:Math.min(1,Math.max(0,(t.clientX-n.left)/n.width)),y:Math.min(1,Math.max(0,(t.clientY-n.top)/n.height))},this.o.viewport.pageSize(e))}startGesture(e,t){this.gesture?.cancel(),this.gesture=t;let n=new AbortController;this.abort.signal.addEventListener(`abort`,()=>n.abort(),{once:!0});let r=()=>{n.abort(),this.gesture===t&&(this.gesture=null,this.stopGesture=null)};this.stopGesture=()=>{r(),t.cancel()};let i={signal:n.signal};document.addEventListener(`pointermove`,n=>n.pointerId===e.pointerId&&t.move(n),i),document.addEventListener(`pointerup`,n=>{n.pointerId===e.pointerId&&(r(),t.end(n))},i),document.addEventListener(`pointercancel`,n=>{n.pointerId===e.pointerId&&(r(),t.cancel())},i)}cancelGesture(){this.stopGesture?.()}onPointerDown(e){if(e.button!==0||e.pointerType===`touch`&&!e.isPrimary)return;let t=e.target;if(this.editingId&&t.closest(`[contenteditable="true"]`))return;this.finishEditing();let n=this.o.viewport.pageIndexOf(t);this.o.viewport.scroller.focus({preventScroll:!0});let r=t.closest(`.pl-handle`);if(r&&this.selectedId&&!this.o.readOnly){e.preventDefault(),this.startResize(e,this.selectedId,r.dataset.handle);return}if(this.tool===`select`){let r=t.closest(`[data-annotation-id]`)?.getAttribute(`data-annotation-id`)??t.closest(`.pl-selection`)?.getAttribute(`data-selection-for`);if(!r){this.select(null);return}e.preventDefault(),this.select(r);let i=this.o.manager.get(r);i.type===`note`&&this.openThread(r),ve(i)&&!i.locked&&!this.o.readOnly&&n>=0&&this.startMove(e,i,n);return}if(Dp.has(this.tool)||this.o.readOnly||n<0)return;e.preventDefault();let i=this.toPdf(n,e);switch(this.tool){case`note`:return this.placeNote(n,i);case`freeText`:return this.startFreeText(e,n,i);case`ink`:return this.startInk(e,n,i);case`signature`:return this.placeSignature(n,i);default:return this.startShape(e,n,i)}}onDoubleClick(e){if(this.tool!==`select`)return;let t=e.target,n=t.closest(`[data-annotation-id]`)?.getAttribute(`data-annotation-id`)??t.closest(`.pl-selection`)?.getAttribute(`data-selection-for`),r=n&&this.o.manager.get(n);r&&(r.type===`freeText`&&!this.o.readOnly&&!r.locked?this.editFreeText(r):this.openThread(r.id,`contents`))}draft(e){return j(e,{now:()=>``,newId:()=>`draft`})}style(e){return{color:this.toolColor(e),...Df(e)?{strokeWidth:this.strokeWidth}:{}}}armSignature(){this.pendingSignature=null;let e=this.o.chooseSignature;if(!e)return this.setTool(`select`);e().then(e=>{this.tool===`signature`&&(e?this.pendingSignature=e:this.setTool(`select`))},e=>{console.warn(`[pdfcedar] could not use that signature image.`,e),this.tool===`signature`&&this.setTool(`select`)})}placeSignature(e,t){let n=this.pendingSignature;if(!n)return;let r=this.o.viewport.pageSize(e),i=r.rotation===90||r.rotation===270,a=Math.min(jp,(i?r.height:r.width)*.8),o=a*n.height/n.width,[s,c]=i?[o,a]:[a,o],[l,u,d,f]=r.view,p=Math.min(Math.max(t.x-s/2,l),d-s),m=Math.min(Math.max(t.y-c/2,u),f-c),h=this.o.manager.add({type:`signature`,page:e+1,rect:{x:p,y:m,width:s,height:c},image:n.image},`user`);this.setTool(`select`),this.select(h.id)}placeNote(e,t){let n={x:t.x-kp/2,y:t.y-kp/2,width:kp,height:kp},r=this.o.manager.add({type:`note`,page:e+1,rect:n,color:this.toolColor(`note`)},`user`);this.setTool(`select`),this.select(r.id),queueMicrotask(()=>queueMicrotask(()=>this.openThread(r.id,`contents`)))}startInk(e,t,n){let r=this.o.viewport.annotationLayer(t),i=this.o.viewport.pageSize(t),a=[n],o={x:e.clientX,y:e.clientY},s=()=>({type:`ink`,page:t+1,paths:[a],...this.style(`ink`)});r.preview(this.draft(s()),i),this.startGesture(e,{move:e=>{let n=e.getCoalescedEvents?.();for(let r of n?.length?n:[e])Math.hypot(r.clientX-o.x,r.clientY-o.y)<Np||(o={x:r.clientX,y:r.clientY},a.push(this.toPdf(t,r)));r.preview(this.draft(s()),i)},end:()=>{r.preview(null,i),this.o.manager.add(s(),`user`)},cancel:()=>r.preview(null,i)})}startShape(e,t,n){let r=this.tool,i=this.o.viewport.annotationLayer(t),a=this.o.viewport.pageSize(t),o=n,s=()=>r===`line`||r===`arrow`?{type:r,page:t+1,start:n,end:o,...this.style(r)}:{type:r,page:t+1,rect:me(n,o),...this.style(r)};this.startGesture(e,{move:e=>{o=this.toPdf(t,e),i.preview(this.draft(s()),a)},end:()=>{i.preview(null,a),(r===`line`||r===`arrow`?Math.hypot(o.x-n.x,o.y-n.y)>=Mp:Math.abs(o.x-n.x)>=Mp&&Math.abs(o.y-n.y)>=Mp)&&this.o.manager.add(s(),`user`)},cancel:()=>i.preview(null,a)})}startMove(e,t,n){let r=this.o.viewport.annotationLayer(n),i=this.o.viewport.pageSize(n),a=this.toPdf(n,e),o={x:0,y:0},s=r.element(t.id);this.startGesture(e,{move:e=>{let c=this.toPdf(n,e);o={x:c.x-a.x,y:c.y-a.y},s&&(s.style.visibility=`hidden`),r.preview(this.draft({...t,...he(t,o.x,o.y)}),i)},end:()=>{r.preview(null,i),s&&(s.style.visibility=``),Math.hypot(o.x,o.y)>=.5&&this.o.manager.update(t.id,he(t,o.x,o.y),`user`)},cancel:()=>{r.preview(null,i),s&&(s.style.visibility=``)}})}startResize(e,t,n){let r=this.o.manager.get(t);if(!r||r.locked)return;let i=r.page-1,a=this.o.viewport.annotationLayer(i),o=this.o.viewport.pageSize(i),s=this.o.viewport.pageElement(i).getBoundingClientRect(),c=a.element(t),l=null,u=t=>{if((r.type===`line`||r.type===`arrow`)&&(n===`start`||n===`end`))return{[n]:this.toPdf(i,t)};if(!ge(r))return null;let a=He(r.rect,o),c={x:a.left,y:-(a.top+a.height),width:a.width,height:a.height},l=be(c,n,(t.clientX-e.clientX)/s.width,-(t.clientY-e.clientY)/s.height,4/s.width),u=r.type===`signature`?F(c,l,n):l,d=-(u.y+u.height),f=[We({x:u.x,y:d},o),We({x:u.x+u.width,y:d+u.height},o)];return ye(r,me(f[0],f[1]))};this.startGesture(e,{move:e=>{l=u(e),l&&(c&&(c.style.visibility=`hidden`),a.preview(this.draft({...r,...l}),o))},end:()=>{a.preview(null,o),c&&(c.style.visibility=``),l&&this.o.manager.update(t,l,`user`)},cancel:()=>{a.preview(null,o),c&&(c.style.visibility=``)}})}startFreeText(e,t,n){let r=this.o.viewport.annotationLayer(t),i=this.o.viewport.pageSize(t),a=n;this.startGesture(e,{move:e=>{a=this.toPdf(t,e),r.preview(this.draft({type:`freeText`,page:t+1,rect:me(n,a),color:this.toolColor(`freeText`)}),i)},end:()=>{r.preview(null,i);let e=Math.abs(a.x-n.x)>=9&&Math.abs(a.y-n.y)>=9,o=Ue(n,i),s=e?me(n,a):this.defaultTextRect(o,t);this.setTool(`select`),this.editFreeText(this.draft({type:`freeText`,page:t+1,rect:s,color:this.toolColor(`freeText`)}),!0)},cancel:()=>r.preview(null,i)})}defaultTextRect(e,t){let n=this.o.viewport.pageSize(t),r=Ap.width/n.width,i=Ap.height/n.height,a=Math.min(e.x,1-r),o=Math.min(e.y,1-i);return me(We({x:a,y:o},n),We({x:a+r,y:o+i},n))}editFreeText(e,t=!1){if(e.type!==`freeText`)return;let n=e.page-1,r=this.o.viewport.annotationLayer(n),i=this.o.viewport.pageSize(n),a;if(t?(r.preview(e,i),a=r.html.querySelector(`.pl-preview-html`)):(a=r.element(e.id),this.editingId=e.id,this.select(e.id)),!a)return;a.contentEditable=`true`,a.dataset.editing=`true`,a.setAttribute(`role`,`textbox`),a.setAttribute(`aria-label`,`Text box`),a.focus();let o=document.createRange();o.selectNodeContents(a),o.collapse(!1),document.getSelection()?.removeAllRanges(),document.getSelection()?.addRange(o);let s=()=>{a.removeEventListener(`blur`,s),a.removeEventListener(`keydown`,c);let o=a.innerText.replace(/\n$/,``);if(this.editingId=null,a.contentEditable=`false`,delete a.dataset.editing,t){if(r.preview(null,i),o.trim()){let t=this.o.manager.add({...e,id:void 0,contents:o,author:void 0,authorId:void 0,createdAt:void 0,modifiedAt:void 0},`user`);this.select(t.id)}}else o===e.contents?this.markDirty(n):this.o.manager.update(e.id,{contents:o},`user`)},c=e=>{e.stopPropagation(),(e.key===`Escape`||e.key===`Enter`&&(e.ctrlKey||e.metaKey))&&(e.preventDefault(),a.blur())};a.addEventListener(`blur`,s),a.addEventListener(`keydown`,c),this.finishEditing=()=>{this.finishEditing=()=>{},a.isContentEditable&&a.blur()}}finishEditing=()=>{};applyMarkupToSelection(){if(!Dp.has(this.tool)&&this.tool!==`redaction`||this.o.readOnly)return;let e=document.getSelection();if(!e||e.isCollapsed||e.rangeCount===0)return;let t=e.getRangeAt(0),n=new Map,r=document.createTreeWalker(this.o.viewport.scroller,NodeFilter.SHOW_TEXT,{acceptNode:e=>t.intersectsNode(e)&&e.parentElement?.closest(`.textLayer`)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT});for(let e=r.nextNode();e;e=r.nextNode()){let r=this.o.viewport.pageIndexOf(e.parentElement);if(r<0)continue;let i=document.createRange();if(i.selectNodeContents(e),e===t.startContainer&&i.setStart(e,t.startOffset),e===t.endContainer&&i.setEnd(e,t.endOffset),i.collapsed||!i.toString().trim())continue;let a=this.o.viewport.pageElement(r).getBoundingClientRect(),o=this.o.viewport.pageSize(r);for(let e of i.getClientRects()){let t=We({x:(e.left-a.left)/a.width,y:(e.top-a.top)/a.height},o),i=We({x:(e.right-a.left)/a.width,y:(e.bottom-a.top)/a.height},o),s=n.get(r)??[];s.push(me(t,i)),n.set(r,s)}}if(n.size===0)return;if(this.tool===`redaction`){this.o.history.transaction(`Mark for redaction`,()=>{for(let[e,t]of n)for(let n of Se(t)){let t={x:n.x-1,y:n.y-1,width:n.width+2,height:n.height+2};this.o.manager.add({type:`redaction`,page:e+1,rect:t,color:this.toolColor(`redaction`)},`user`)}}),e.removeAllRanges();return}let i=this.tool;this.o.history.transaction(`Add ${i}`,()=>{for(let[e,t]of n){let n=Se(t).map(xe);n.length>0&&this.o.manager.add({type:i,page:e+1,quads:n,color:this.toolColor(i)},`user`)}}),e.removeAllRanges()}},Fp=e=>`${e*100}%`,Ip=(e,t)=>e.multiline?12:Math.min(Math.max((t-3)/1.25,6),16),Lp=0,Rp=class{o;controls=new Map;radioPrefix=`pl-${++Lp}-`;unsubscribe;masked=null;constructor(e){this.o=e,this.unsubscribe=e.manager.onChange(e=>this.sync(e))}build(){for(let e of this.o.manager.fields)for(let t of e.widgets)t.hidden||this.controls.has(t.id)||this.controls.set(t.id,{field:e,widget:t,el:this.createControl(e,t)});this.layout(),this.sync(this.o.manager.fields.map(e=>e.name))}layout(){let e=new Map;this.o.viewport.pageList.entries.forEach((t,n)=>t.doc===this.o.doc&&e.set(t.index,n));for(let{widget:t,el:n}of this.controls.values()){let r=e.get(t.pageIndex);if(r===void 0||this.masked?.(t,r)){n.remove();continue}let i=this.o.viewport.formLayer(r);n.parentElement!==i&&i.append(n),this.place(n,t,r)}}commitPending(){let e=document.activeElement;for(let{el:t}of this.controls.values())t===e&&t.dispatchEvent(new Event(`change`))}destroy(){this.unsubscribe();for(let{el:e}of this.controls.values())e.remove();this.controls.clear()}place(e,t,n){let r=this.o.viewport.pageSize(n),i=He(t.rect,r),[a,o]=t.rotation===90||t.rotation===270?[t.rect.height,t.rect.width]:[t.rect.width,t.rect.height];Object.assign(e.style,{left:Fp(i.left+i.width/2),top:Fp(i.top+i.height/2),width:`calc(var(--total-scale-factor) * ${a}px)`,height:`calc(var(--total-scale-factor) * ${o}px)`,transform:`translate(-50%, -50%) rotate(${r.rotation-t.rotation}deg)`})}createControl(e,t){let n;switch(e.type){case`text`:e.multiline?n=document.createElement(`textarea`):(n=document.createElement(`input`),n.type=e.password?`password`:`text`),e.maxLength&&(n.maxLength=e.maxLength),n.spellcheck=!1;break;case`checkbox`:case`radio`:n=document.createElement(`input`),n.type=e.type,e.type===`radio`&&(n.name=this.radioPrefix+e.name);break;case`dropdown`:case`listbox`:n=document.createElement(`select`),n.multiple=e.type===`listbox`&&!!e.multiSelect,e.type===`listbox`?n.size=Math.max(2,e.options?.length??2):n.add(new Option(``,``));for(let t of e.options??[])n.add(new Option(t.label,t.value))}if(n.className=`pl-field pl-field-${e.type}`,n.dataset.field=e.name,n.dataset.widget=t.id,e.required&&(n.required=!0),n.setAttribute(`aria-label`,e.name),e.type===`text`||e.type===`dropdown`||e.type===`listbox`){let r=t.fontSize||Ip(e,t.rect.height);Object.assign(n.style,{fontSize:`calc(var(--total-scale-factor) * ${r}px)`,color:t.color,textAlign:t.align})}return t.background&&n.style.setProperty(`--pl-field-bg`,t.background),t.border&&n.style.setProperty(`--pl-field-border`,t.border),n.addEventListener(`change`,()=>this.commit(e,t,n)),n.addEventListener(`pointerdown`,e=>e.stopPropagation()),n}commit(e,t,n){let{manager:r}=this.o,i;i=n instanceof HTMLSelectElement?n.multiple?[...n.selectedOptions].map(e=>e.value):n.value:n instanceof HTMLInputElement&&n.type===`checkbox`?n.checked:n instanceof HTMLInputElement&&n.type===`radio`?n.checked?t.exportValue:r.value(e.name):n.value;try{r.setValues({[e.name]:i},`user`)}catch(t){console.warn(`[pdfcedar] form value rejected`,t),this.sync([e.name])}}sync(e){let{manager:t}=this.o,n=new Set(e),r=this.o.readOnly||t.flattened;for(let{field:e,widget:i,el:a}of this.controls.values()){if(!n.has(e.name))continue;let o=t.value(e.name);if(a instanceof HTMLSelectElement){let e=new Set(Array.isArray(o)?o:[o]);for(let t of a.options)t.selected=e.has(t.value);!a.multiple&&typeof o==`string`&&o!==``&&a.value!==o&&(a.add(new Option(o,o)),a.value=o)}else a instanceof HTMLInputElement&&a.type===`checkbox`?a.checked=o===!0:a instanceof HTMLInputElement&&a.type===`radio`?a.checked=o===i.exportValue:a.value!==o&&(a.value=String(o??``));a.disabled=r||e.readOnly,a.classList.toggle(`pl-field-flattened`,t.flattened)}}};Ne();var zp=1600,Bp=4194304;function Vp(e){return new Promise((t,n)=>{let r=new FileReader;r.onload=()=>t(r.result),r.onerror=()=>n(r.error??Error(`Could not read the image.`)),r.readAsDataURL(e)})}function Hp(e){let t=URL.createObjectURL(e);return new Promise((e,n)=>{let r=new Image;r.onload=()=>e(r),r.onerror=()=>n(TypeError("signatures.add: `image` is not an image the browser can read.")),r.src=t}).finally(()=>URL.revokeObjectURL(t))}async function Up(e){let t;if(e instanceof Blob)t=e;else if(typeof e==`string`&&e.startsWith(`data:`))t=Wp(e);else if(typeof e==`string`&&e!==``){let n=await fetch(e).catch(e=>{throw TypeError(`signatures.add: could not load the image (${e.message}).`)});if(!n.ok)throw TypeError(`signatures.add: could not load the image (HTTP ${n.status}).`);t=await n.blob()}else throw TypeError("signatures.add: `image` must be a data URL, an image URL or a Blob.");let n=await Hp(t),{naturalWidth:r,naturalHeight:i}=n;if(!r||!i)throw TypeError(`signatures.add: the image has no size.`);let a=(t.type===`image/png`||t.type===`image/jpeg`)&&Math.max(r,i)<=zp,o;if(a)o=await Vp(t);else{let e=Math.min(1,zp/Math.max(r,i)),a=document.createElement(`canvas`);a.width=Math.round(r*e),a.height=Math.round(i*e),a.getContext(`2d`).drawImage(n,0,0,a.width,a.height),o=t.type===`image/jpeg`?a.toDataURL(`image/jpeg`,.9):a.toDataURL(`image/png`)}if(o.length>Bp)throw TypeError(`signatures.add: the image is too large (over 4 MB).`);return o}function Wp(e){let t=/^data:([^;,]*)(;base64)?,(.*)$/s.exec(e);if(!t)throw TypeError("signatures.add: `image` is not a valid data URL.");let[,n=``,r,i=``]=t;if(!r)return new Blob([decodeURIComponent(i)],{type:n});let a=atob(i),o=new Uint8Array(a.length);for(let e=0;e<a.length;e++)o[e]=a.charCodeAt(e);return new Blob([o],{type:n})}async function Gp(e){let t=await Hp(Wp(e));return{width:t.naturalWidth,height:t.naturalHeight}}var Kp=new Map,qp=class{store;userId;list=null;loading=null;constructor(e,t){this.store=e,this.userId=t}async all(){return this.list?this.list:(this.loading??=(async()=>{try{let e=this.store?await this.store.load():Kp.get(this.userId)??[];this.list=Array.isArray(e)?e.filter(e=>typeof e?.image==`string`&&typeof e.id==`string`):[]}catch(e){console.warn(`[pdfcedar] signatureStore.load failed; starting with no saved signatures.`,e),this.list=[]}return this.list})(),this.loading)}async add(e){let t=await this.all();t.some(t=>t.image===e)||await this.persist([{id:N(),image:e,createdAt:new Date().toISOString()},...t])}async remove(e){await this.persist((await this.all()).filter(t=>t.id!==e))}async persist(e){if(this.list=e,!this.store)Kp.set(this.userId,e);else try{await this.store.save(e)}catch(e){console.warn(`[pdfcedar] signatureStore.save failed.`,e)}}},Jp={async decodeJpeg(e){try{let t=await createImageBitmap(new Blob([e],{type:`image/jpeg`}),{colorSpaceConversion:`none`}),n=document.createElement(`canvas`);n.width=t.width,n.height=t.height;let r=n.getContext(`2d`,{willReadFrequently:!0});r.drawImage(t,0,0),t.close();let{data:i}=r.getImageData(0,0,n.width,n.height);return{width:n.width,height:n.height,data:i}}catch{return null}},async encodeJpeg(e,t,n){let r=document.createElement(`canvas`);r.width=t,r.height=n,r.getContext(`2d`).putImageData(new ImageData(new Uint8ClampedArray(e),t,n),0,0);let i=await new Promise(e=>r.toBlob(e,`image/jpeg`,.92));if(!i)throw Error(`Could not encode the redacted image.`);return new Uint8Array(await i.arrayBuffer())}},Yp=new Set([90,180,270]),Xp=class{o;merged=[];constructor(e){this.o=e}get list(){return this.o.viewport.pageList}rotate(e,t,n=`api`){let r=this.index(`rotate`,e);if(!Yp.has(t))throw RangeError(`pages.rotate: expected 90, 180 or 270 degrees, got ${t}.`);this.commit(`Rotate page`,this.list.rotated(r,t))}delete(e,t=`api`){let n=this.index(`delete`,e),r=this.list.without(n),{manager:i,history:a}=this.o;a.transaction(`Delete page`,()=>{for(let n of i.list({page:e}))n.type!==`reply`&&i.remove(n.id,t,{withPage:!0});for(let n of i.list())n.type!==`reply`&&n.page>e&&i.update(n.id,{page:n.page-1},t);this.commit(`Delete page`,r)})}move(e,t,n=`api`){let r=this.index(`move`,e),i=this.index(`move`,t);if(r===i)return;let a=this.list,o=a.moved(r,i),s=new Map(o.entries.map((e,t)=>[e.key,t])),{manager:c,history:l}=this.o;l.transaction(`Move page`,()=>{for(let e of c.list()){if(e.type===`reply`)continue;let t=s.get(a.at(e.page-1).key)+1;t!==e.page&&c.update(e.id,{page:t},n)}this.commit(`Move page`,o)})}async merge(e){let t=await ed.open(e,this.o.open);this.merged.push(t),this.commit(`Insert pages`,this.list.withDocument(t))}plan(){let e=[];return{pages:this.list.entries.map(t=>{let n=0;return t.doc!==this.o.original&&(n=e.indexOf(t.doc)+1||e.push(t.doc)),{doc:n,index:t.index,rotation:t.rotation}}),documents:e}}get unchanged(){let{entries:e}=this.list;return e.length===this.o.original.pageCount&&e.every((e,t)=>e.doc===this.o.original&&e.index===t&&e.rotation===0)}destroy(){for(let e of this.merged)e.destroy()}index(e,t){if(!Number.isInteger(t)||t<1||t>this.list.count)throw RangeError(`pages.${e}: expected a page from 1 to ${this.list.count}, got ${t}.`);return t-1}commit(e,t){let n=this.list;this.apply(t),this.o.history.record({label:e,undo:()=>this.apply(n),redo:()=>this.apply(t)})}apply(e){this.o.viewport.setPages(e),this.o.onChange(e)}},Zp=`428a2f98d728ae22.7137449123ef65cd.b5c0fbcfec4d3b2f.e9b5dba58189dbbc.3956c25bf348b538.59f111f1b605d019.923f82a4af194f9b.ab1c5ed5da6d8118.d807aa98a3030242.12835b0145706fbe.243185be4ee4b28c.550c7dc3d5ffb4e2.72be5d74f27b896f.80deb1fe3b1696b1.9bdc06a725c71235.c19bf174cf692694.e49b69c19ef14ad2.efbe4786384f25e3.0fc19dc68b8cd5b5.240ca1cc77ac9c65.2de92c6f592b0275.4a7484aa6ea6e483.5cb0a9dcbd41fbd4.76f988da831153b5.983e5152ee66dfab.a831c66d2db43210.b00327c898fb213f.bf597fc7beef0ee4.c6e00bf33da88fc2.d5a79147930aa725.06ca6351e003826f.142929670a0e6e70.27b70a8546d22ffc.2e1b21385c26c926.4d2c6dfc5ac42aed.53380d139d95b3df.650a73548baf63de.766a0abb3c77b2a8.81c2c92e47edaee6.92722c851482353b.a2bfe8a14cf10364.a81a664bbc423001.c24b8b70d0f89791.c76c51a30654be30.d192e819d6ef5218.d69906245565a910.f40e35855771202a.106aa07032bbd1b8.19a4c116b8d2d0c8.1e376c085141ab53.2748774cdf8eeb99.34b0bcb5e19b48a8.391c0cb3c5c95a63.4ed8aa4ae3418acb.5b9cca4f7763e373.682e6ff3d6b2b8a3.748f82ee5defb2fc.78a5636f43172f60.84c87814a1f0ab72.8cc702081a6439ec.90befffa23631e28.a4506cebde82bde9.bef9a3f7b2c67915.c67178f2e372532b.ca273eceea26619c.d186b8c721c0c207.eada7dd6cde0eb1e.f57d4f7fee6ed178.06f067aa72176fba.0a637dc5a2c898a6.113f9804bef90dae.1b710b35131c471b.28db77f523047d84.32caab7b40c72493.3c9ebe0a15c9bebc.431d67c49c100d4c.4cc5d4becb3e42b6.597f299cfc657e2a.5fcb6fab3ad6faec.6c44198c4a475817`.split(`.`).map(e=>BigInt(`0x${e}`)),Qp=[`6a09e667f3bcc908`,`bb67ae8584caa73b`,`3c6ef372fe94f82b`,`a54ff53a5f1d36f1`,`510e527fade682d1`,`9b05688c2b3e6c1f`,`1f83d9abfb41bd6b`,`5be0cd19137e2179`].map(e=>BigInt(`0x${e}`)),$p=(1n<<64n)-1n,em=(e,t)=>(e>>t|e<<64n-t)&$p;function tm(e){let t=e.length,n=new Uint8Array(Math.ceil((t+17)/128)*128);n.set(e),n[t]=128;let r=new DataView(n.buffer);r.setBigUint64(n.length-8,BigInt(t)*8n);let i=[...Qp],a=Array(80);for(let e=0;e<n.length;e+=128){for(let t=0;t<16;t++)a[t]=r.getBigUint64(e+t*8);for(let e=16;e<80;e++){let t=em(a[e-15],1n)^em(a[e-15],8n)^a[e-15]>>7n,n=em(a[e-2],19n)^em(a[e-2],61n)^a[e-2]>>6n;a[e]=a[e-16]+t+a[e-7]+n&$p}let[t,n,o,s,c,l,u,d]=i;for(let e=0;e<80;e++){let r=em(c,14n)^em(c,18n)^em(c,41n),i=c&l^~c&$p&u,f=d+r+i+Zp[e]+a[e]&$p,p=(em(t,28n)^em(t,34n)^em(t,39n))+(t&n^t&o^n&o)&$p;d=u,u=l,l=c,c=s+f&$p,s=o,o=n,n=t,t=f+p&$p}let f=[t,n,o,s,c,l,u,d];for(let e=0;e<8;e++)i[e]=i[e]+f[e]&$p}let o=new Uint8Array(64),s=new DataView(o.buffer);return i.forEach((e,t)=>s.setBigUint64(t*8,e)),o}var nm=2n**255n-19n,rm=2n**252n+27742317777372353535851937790883648493n,im=(e,t=nm)=>(e%t+t)%t;function am(e,t){let n=1n;for(e=im(e);t>0n;)t&1n&&(n=im(n*e)),e=im(e*e),t>>=1n;return n}var om=e=>am(e,nm-2n),sm=im(-121665n*om(121666n)),cm=am(2n,(nm-1n)/4n),lm=[0n,1n,1n,0n],um=im(4n*om(5n)),dm=15112221349535400772501151409588531511454012693041857206046113283949847762202n,fm=[dm,um,1n,im(dm*um)];function pm([e,t,n,r],[i,a,o,s]){let c=im((t-e)*(a-i)),l=im((t+e)*(a+i)),u=im(r*2n*sm*s),d=im(n*2n*o),f=l-c,p=d-u,m=d+u,h=l+c;return[im(f*p),im(m*h),im(p*m),im(f*h)]}function mm(e,t){let n=lm;for(let r=e;t>0n;t>>=1n,r=pm(r,r))t&1n&&(n=pm(n,r));return n}var hm=([e,t,n],[r,i,a])=>im(e*a-r*n)===0n&&im(t*a-i*n)===0n,gm=e=>e.reduceRight((e,t)=>e<<8n|BigInt(t),0n);function _m(e){let t=gm(e),n=t&(1n<<255n)-1n,r=t>>255n;if(n>=nm)return null;let i=im(n*n-1n),a=im(sm*n*n+1n),o=im(i*am(a,3n)*am(i*am(a,7n),(nm-5n)/8n)),s=im(a*o*o);if(s===im(-i))o=im(o*cm);else if(s!==i)return null;return o===0n&&r===1n?null:((o&1n)!==r&&(o=nm-o),[o,n,1n,im(o*n)])}function vm(e,t,n){if(e.length!==32||t.length!==64)return!1;let r=_m(e),i=_m(t.subarray(0,32)),a=gm(t.subarray(32));if(!r||!i||a>=rm)return!1;let o=new Uint8Array(64+n.length);o.set(t.subarray(0,32)),o.set(e,32),o.set(n,64);let s=im(gm(tm(o)),rm);return hm(mm(fm,a),pm(i,mm(r,s)))}async function ym(e,t,n){let r=globalThis.crypto?.subtle;if(r)try{let i=await r.importKey(`raw`,e,{name:`Ed25519`},!1,[`verify`]);return await r.verify({name:`Ed25519`},i,t,n)}catch{}try{return vm(e,t,n)}catch{return!1}}var bm={pl1:{publicKey:`4mBfwMSTGjAgOv62c7Uf77mQY0RqnnIj9l0cc9dIgqg`},dev:{publicKey:`WSP-wWkxZG4imEW6mmmpKlFYnIX8qMXy-bNncfqHfJk`,loopbackOnly:!0}};function xm(e){if(!/^[A-Za-z0-9_-]*$/.test(e))return null;try{let t=atob(e.replace(/-/g,`+`).replace(/_/g,`/`));return Uint8Array.from(t,e=>e.charCodeAt(0))}catch{return null}}function Sm(e){let t=e.toLowerCase().replace(/\.$/,``);return t===`localhost`||t.endsWith(`.localhost`)||/^127(\.\d{1,3}){3}$/.test(t)||t===`[::1]`||t===`::1`}function Cm(e,t){let n=t.toLowerCase().replace(/\.$/,``);return e.some(e=>{let t=e.toLowerCase();return t===`*`?!0:t.startsWith(`*.`)?n.endsWith(t.slice(1))&&n.length>t.length-1:n===t})}function wm(e){if(typeof e!=`object`||!e)return null;let t=e,n=e=>typeof e==`string`&&/^\d{4}-\d{2}-\d{2}$/.test(e);return t.v!==1||typeof t.kid!=`string`||typeof t.id!=`string`||typeof t.licensee!=`string`||typeof t.plan!=`string`||!Array.isArray(t.domains)||!t.domains.every(e=>typeof e==`string`)||!n(t.issued)||t.expires!==void 0&&!n(t.expires)?null:{kid:t.kid,id:t.id,licensee:t.licensee,plan:t.plan,domains:t.domains,issued:t.issued,...t.expires?{expires:t.expires}:{}}}async function Tm(e,t={}){if(e==null||e.trim()===``)return{valid:!1,reason:`missing`};if(typeof e!=`string`)return{valid:!1,reason:`malformed`};let n=e.trim().split(`.`);if(n.length!==3||n[0]!==`PL1`)return{valid:!1,reason:`malformed`};let r=xm(n[1]),i=xm(n[2]);if(!r||!i)return{valid:!1,reason:`malformed`};let a;try{a=wm(JSON.parse(new TextDecoder(`utf-8`,{fatal:!0}).decode(r)))}catch{a=null}if(!a)return{valid:!1,reason:`malformed`};let{kid:o,...s}=a,c=t.keyring??bm,l=Object.hasOwn(c,o)?c[o]:void 0;if(!l)return{valid:!1,reason:`unknown-signer`,details:s};let u=xm(l.publicKey);if(!u||!await ym(u,i,r))return{valid:!1,reason:`bad-signature`};let d=t.now??new Date;if(s.expires&&d.getTime()>Date.parse(`${s.expires}T23:59:59.999-12:00`))return{valid:!1,reason:`expired`,details:s};let f=t.hostname??globalThis.location?.hostname??``;return(l.loopbackOnly?Sm(f):Sm(f)||Cm(s.domains,f))?{valid:!0,details:s}:{valid:!1,reason:`domain`,details:s}}var Em={missing:`no licence key was given`,malformed:`the licence key isn't in the right format (copy it again in full)`,"unknown-signer":`the licence key wasn't issued for this version of PDFCedar`,"bad-signature":`the licence key has been altered or is not genuine`,expired:`the licence key has expired`,domain:`the licence key isn't issued for this domain`},Dm=`PDFCedar trial`;function Om(e){let t=e.getContext(`2d`);if(!t)return;let{width:n,height:r}=e,i=Math.max(10,Math.round(Math.min(n,r)/14));t.save(),t.font=`600 ${i}px system-ui, sans-serif`,t.fillStyle=`rgba(220, 38, 38, 0.18)`,t.textAlign=`center`,t.textBaseline=`middle`,t.translate(n/2,r/2),t.rotate(-Math.atan2(r,n));let a=Math.hypot(n,r),o=i*4;for(let e=-a/2;e<=a/2;e+=o){let n=Math.round(e/o)%2*t.measureText(Dm).width*.6;for(let r=-a/2+n;r<=a/2;r+=t.measureText(Dm).width*1.6)t.fillText(Dm,r,e)}t.restore()}function W(e,t){Nm(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}function km(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function Am(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})}function jm(e,t){var n={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},r,i,a,o={next:s(0),throw:s(1),return:s(2)};return typeof Symbol==`function`&&(o[Symbol.iterator]=function(){return this}),o;function s(e){return function(t){return c([e,t])}}function c(o){if(r)throw TypeError(`Generator is already executing.`);for(;n;)try{if(r=1,i&&(a=o[0]&2?i.return:o[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,o[1])).done)return a;switch(i=0,a&&(o=[o[0]&2,a.value]),o[0]){case 0:case 1:a=o;break;case 4:return n.label++,{value:o[1],done:!1};case 5:n.label++,i=o[1],o=[0];continue;case 7:o=n.ops.pop(),n.trys.pop();continue;default:if(a=n.trys,!(a=a.length>0&&a[a.length-1])&&(o[0]===6||o[0]===2)){n=0;continue}if(o[0]===3&&(!a||o[1]>a[0]&&o[1]<a[3])){n.label=o[1];break}if(o[0]===6&&n.label<a[1]){n.label=a[1],a=o;break}if(a&&n.label<a[2]){n.label=a[2],n.ops.push(o);break}a[2]&&n.ops.pop(),n.trys.pop();continue}o=t.call(e,n)}catch(e){o=[6,e],i=0}finally{r=a=0}if(o[0]&5)throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}}function Mm(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;for(var r=Array(e),i=0,t=0;t<n;t++)for(var a=arguments[t],o=0,s=a.length;o<s;o++,i++)r[i]=a[o];return r}var Nm,Pm,G=s((()=>{Nm=function(e,t){return Nm=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},Nm(e,t)},Pm=function(){return Pm=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Pm.apply(this,arguments)}})),Fm,Im,Lm,Rm,zm,Bm,Vm,Hm=s((()=>{for(Fm=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,Im=new Uint8Array(256),Lm=0;Lm<Fm.length;Lm++)Im[Fm.charCodeAt(Lm)]=Lm;Rm=function(e){for(var t=``,n=e.length,r=0;r<n;r+=3)t+=Fm[e[r]>>2],t+=Fm[(e[r]&3)<<4|e[r+1]>>4],t+=Fm[(e[r+1]&15)<<2|e[r+2]>>6],t+=Fm[e[r+2]&63];return n%3==2?t=t.substring(0,t.length-1)+`=`:n%3==1&&(t=t.substring(0,t.length-2)+`==`),t},zm=function(e){var t=e.length*.75,n=e.length,r,i=0,a,o,s,c;e[e.length-1]===`=`&&(t--,e[e.length-2]===`=`&&t--);var l=new Uint8Array(t);for(r=0;r<n;r+=4)a=Im[e.charCodeAt(r)],o=Im[e.charCodeAt(r+1)],s=Im[e.charCodeAt(r+2)],c=Im[e.charCodeAt(r+3)],l[i++]=a<<2|o>>4,l[i++]=(o&15)<<4|s>>2,l[i++]=(s&3)<<6|c&63;return l},Bm=/^(data)?:?([\w\/\+]+)?;?(charset=[\w-]+|base64)?.*,/i,Vm=function(e){var t=e.trim(),n=t.substring(0,100).match(Bm);if(!n)return zm(t);var r=n[0];return zm(t.substring(r.length))}})),Um,Wm,Gm,Km,qm,Jm,Ym,Xm,Zm,Qm,$m,eh,th,nh,rh,ih,ah,oh,sh,ch,lh,uh=s((()=>{Um=function(e){return e.charCodeAt(0)},Wm=function(e){return e.codePointAt(0)},Gm=function(e,t){return Ym(e.toString(16),t,`0`).toUpperCase()},Km=function(e){return Gm(e,2)},qm=function(e){return String.fromCharCode(e)},Jm=function(e){return qm(parseInt(e,16))},Ym=function(e,t,n){for(var r=``,i=0,a=t-e.length;i<a;i++)r+=n;return r+e},Xm=function(e,t,n){for(var r=e.length,i=0;i<r;i++)t[n++]=e.charCodeAt(i);return r},Zm=function(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)},Qm=function(e){return e.replace(/\t|\u0085|\u2028|\u2029/g,` `).replace(/[\b\v]/g,``)},$m=[`\\n`,`\\f`,`\\r`,`\\u000B`],eh=function(e){return/^[\n\f\r\u000B]$/.test(e)},th=function(e){return e.split(/[\n\f\r\u000B]/)},nh=function(e){return e.replace(/[\n\f\r\u000B]/g,` `)},rh=function(e,t){var n=e.charCodeAt(t),r,i=t+1,a=1;return n>=55296&&n<=56319&&e.length>i&&(r=e.charCodeAt(i),r>=56320&&r<=57343&&(a=2)),[e.slice(t,t+a),a]},ih=function(e){for(var t=[],n=0,r=e.length;n<r;){var i=rh(e,n),a=i[0],o=i[1];t.push(a),n+=o}return t},ah=function(e){for(var t=$m.join(`|`),n=[`$`],r=0,i=e.length;r<i;r++){var a=e[r];if(eh(a))throw TypeError("`wordBreak` must not include "+t);n.push(a===``?`.`:Zm(a))}var o=n.join(`|`);return RegExp(`(`+t+`)|((.*?)(`+o+`))`,`gm`)},oh=function(e,t,n,r){for(var i=ah(t),a=Qm(e).match(i),o=``,s=0,c=[],l=function(){o!==``&&c.push(o),o=``,s=0},u=0,d=a.length;u<d;u++){var f=a[u];if(eh(f))l();else{var p=r(f);s+p>n&&l(),o+=f,s+=p}}return l(),c},sh=/^D:(\d\d\d\d)(\d\d)?(\d\d)?(\d\d)?(\d\d)?(\d\d)?([+\-Z])?(\d\d)?'?(\d\d)?'?$/,ch=function(e){var t=e.match(sh);if(t){var n=t[1],r=t[2],i=r===void 0?`01`:r,a=t[3],o=a===void 0?`01`:a,s=t[4],c=s===void 0?`00`:s,l=t[5],u=l===void 0?`00`:l,d=t[6],f=d===void 0?`00`:d,p=t[7],m=p===void 0?`Z`:p,h=t[8],g=h===void 0?`00`:h,_=t[9],v=_===void 0?`00`:_,y=m===`Z`?`Z`:``+m+g+`:`+v;return new Date(n+`-`+i+`-`+o+`T`+c+`:`+u+`:`+f+y)}},lh=function(e,t){for(var n=0,r;n<e.length;){var i=e.substring(n).match(t);if(!i)return{match:r,pos:n};r=i,n+=(i.index??0)+i[0].length}return{match:r,pos:n}}})),dh,fh,ph,mh,hh,gh,_h,vh,yh,bh,xh,Sh,Ch,wh=s((()=>{Hm(),uh(),dh=function(e){return e[e.length-1]},fh=function(e){if(e instanceof Uint8Array)return e;for(var t=e.length,n=new Uint8Array(t),r=0;r<t;r++)n[r]=e.charCodeAt(r);return n},ph=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var n=e.length,r=[],i=0;i<n;i++){var a=e[i];r[i]=a instanceof Uint8Array?a:fh(a)}for(var o=0,i=0;i<n;i++)o+=e[i].length;for(var s=new Uint8Array(o),c=0,l=0;l<n;l++)for(var u=r[l],d=0,f=u.length;d<f;d++)s[c++]=u[d];return s},mh=function(e){for(var t=0,n=0,r=e.length;n<r;n++)t+=e[n].length;for(var i=new Uint8Array(t),a=0,n=0,r=e.length;n<r;n++){var o=e[n];i.set(o,a),a+=o.length}return i},hh=function(e){for(var t=``,n=0,r=e.length;n<r;n++)t+=qm(e[n]);return t},gh=function(e,t){return e.id-t.id},_h=function(e,t){for(var n=[],r=0,i=e.length;r<i;r++){var a=e[r],o=e[r-1];(r===0||t(a)!==t(o))&&n.push(a)}return n},vh=function(e){for(var t=e.length,n=0,r=Math.floor(t/2);n<r;n++){var i=n,a=t-n-1,o=e[n];e[i]=e[a],e[a]=o}return e},yh=function(e){for(var t=0,n=0,r=e.length;n<r;n++)t+=e[n];return t},bh=function(e,t){for(var n=Array(t-e),r=0,i=n.length;r<i;r++)n[r]=e+r;return n},xh=function(e,t){for(var n=Array(t.length),r=0,i=t.length;r<i;r++)n[r]=e[t[r]];return n},Sh=function(e){return e instanceof Uint8Array||e instanceof ArrayBuffer||typeof e==`string`},Ch=function(e){if(typeof e==`string`)return Vm(e);if(e instanceof ArrayBuffer)return new Uint8Array(e);if(e instanceof Uint8Array)return e;throw TypeError("`input` must be one of `string | ArrayBuffer | Uint8Array`")}})),Th,Eh=s((()=>{Th=function(){return new Promise(function(e){setTimeout(function(){return e()},0)})}})),Dh,Oh,kh,Ah,jh,Mh,Nh,Ph,Fh,Ih,Lh,Rh,zh,Bh,Vh,Hh=s((()=>{uh(),Dh=function(e,t){t===void 0&&(t=!0);var n=[];t&&n.push(65279);for(var r=0,i=e.length;r<i;){var a=e.codePointAt(r);if(a<65536)n.push(a),r+=1;else if(a<1114112)n.push(Ah(a),jh(a)),r+=2;else throw Error(`Invalid code point: 0x`+Km(a))}return new Uint16Array(n)},Oh=function(e){return e>=0&&e<=65535},kh=function(e){return e>=65536&&e<=1114111},Ah=function(e){return Math.floor((e-65536)/1024)+55296},jh=function(e){return(e-65536)%1024+56320},(function(e){e.BigEndian=`BigEndian`,e.LittleEndian=`LittleEndian`})(Mh||={}),Nh=`�`.codePointAt(0),Ph=function(e,t){if(t===void 0&&(t=!0),e.length<=1)return String.fromCodePoint(Nh);for(var n=t?Rh(e):Mh.BigEndian,r=t?2:0,i=[];e.length-r>=2;){var a=Lh(e[r++],e[r++],n);if(Fh(a)){if(e.length-r<2)i.push(Nh);else{var o=Lh(e[r++],e[r++],n);Ih(o)?i.push(a,o):i.push(Nh)}}else Ih(a)?(r+=2,i.push(Nh)):i.push(a)}return r<e.length&&i.push(Nh),String.fromCodePoint.apply(String,i)},Fh=function(e){return e>=55296&&e<=56319},Ih=function(e){return e>=56320&&e<=57343},Lh=function(e,t,n){if(n===Mh.LittleEndian)return t<<8|e;if(n===Mh.BigEndian)return e<<8|t;throw Error(`Invalid byteOrder: `+n)},Rh=function(e){return zh(e)?Mh.BigEndian:Bh(e)?Mh.LittleEndian:Mh.BigEndian},zh=function(e){return e[0]===254&&e[1]===255},Bh=function(e){return e[0]===255&&e[1]===254},Vh=function(e){return zh(e)||Bh(e)}})),Uh,Wh,Gh,Kh=s((()=>{Uh=function(e){var t=String(e);if(Math.abs(e)<1){var n=parseInt(e.toString().split(`e-`)[1]);if(n){var r=e<0;r&&(e*=-1),e*=10**(n-1),t=`0.`+Array(n).join(`0`)+e.toString().substring(2),r&&(t=`-`+t)}}else{var n=parseInt(e.toString().split(`+`)[1]);n>20&&(n-=20,e/=10**n,t=e.toString()+Array(n+1).join(`0`))}return t},Wh=function(e){return Math.ceil(e.toString(2).length/8)},Gh=function(e){for(var t=new Uint8Array(Wh(e)),n=1;n<=t.length;n++)t[n-1]=e>>(t.length-n)*8;return t}})),qh,Jh=s((()=>{qh=function(e){throw Error(e)}})),Yh=c((e=>{var t=typeof Uint8Array<`u`&&typeof Uint16Array<`u`&&typeof Int32Array<`u`;function n(e,t){return Object.prototype.hasOwnProperty.call(e,t)}e.assign=function(e){for(var t=Array.prototype.slice.call(arguments,1);t.length;){var r=t.shift();if(r){if(typeof r!=`object`)throw TypeError(r+`must be non-object`);for(var i in r)n(r,i)&&(e[i]=r[i])}}return e},e.shrinkBuf=function(e,t){return e.length===t?e:e.subarray?e.subarray(0,t):(e.length=t,e)};var r={arraySet:function(e,t,n,r,i){if(t.subarray&&e.subarray)e.set(t.subarray(n,n+r),i);else for(var a=0;a<r;a++)e[i+a]=t[n+a]},flattenChunks:function(e){var t,n,r=0,i,a,o;for(t=0,n=e.length;t<n;t++)r+=e[t].length;for(o=new Uint8Array(r),i=0,t=0,n=e.length;t<n;t++)a=e[t],o.set(a,i),i+=a.length;return o}},i={arraySet:function(e,t,n,r,i){for(var a=0;a<r;a++)e[i+a]=t[n+a]},flattenChunks:function(e){return[].concat.apply([],e)}};e.setTyped=function(t){t?(e.Buf8=Uint8Array,e.Buf16=Uint16Array,e.Buf32=Int32Array,e.assign(e,r)):(e.Buf8=Array,e.Buf16=Array,e.Buf32=Array,e.assign(e,i))},e.setTyped(t)})),Xh=c((e=>{var t=Yh(),n=4,r=0,i=1,a=2;function o(e){for(var t=e.length;--t>=0;)e[t]=0}var s=0,c=1,l=2,u=3,d=258,f=29,p=256,m=p+1+f,h=30,g=19,_=2*m+1,v=15,y=16,b=7,x=256,S=16,C=17,w=18,T=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],E=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],D=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],O=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],k=512,A=Array((m+2)*2);o(A);var j=Array(h*2);o(j);var M=Array(k);o(M);var N=Array(d-u+1);o(N);var P=Array(f);o(P);var ee=Array(h);o(ee);function te(e,t,n,r,i){this.static_tree=e,this.extra_bits=t,this.extra_base=n,this.elems=r,this.max_length=i,this.has_stree=e&&e.length}var ne,re,ie;function ae(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function oe(e){return e<256?M[e]:M[256+(e>>>7)]}function se(e,t){e.pending_buf[e.pending++]=t&255,e.pending_buf[e.pending++]=t>>>8&255}function ce(e,t,n){e.bi_valid>y-n?(e.bi_buf|=t<<e.bi_valid&65535,se(e,e.bi_buf),e.bi_buf=t>>y-e.bi_valid,e.bi_valid+=n-y):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=n)}function le(e,t,n){ce(e,n[t*2],n[t*2+1])}function ue(e,t){var n=0;do n|=e&1,e>>>=1,n<<=1;while(--t>0);return n>>>1}function de(e){e.bi_valid===16?(se(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=e.bi_buf&255,e.bi_buf>>=8,e.bi_valid-=8)}function fe(e,t){var n=t.dyn_tree,r=t.max_code,i=t.stat_desc.static_tree,a=t.stat_desc.has_stree,o=t.stat_desc.extra_bits,s=t.stat_desc.extra_base,c=t.stat_desc.max_length,l,u,d,f,p,m,h=0;for(f=0;f<=v;f++)e.bl_count[f]=0;for(n[e.heap[e.heap_max]*2+1]=0,l=e.heap_max+1;l<_;l++)u=e.heap[l],f=n[n[u*2+1]*2+1]+1,f>c&&(f=c,h++),n[u*2+1]=f,!(u>r)&&(e.bl_count[f]++,p=0,u>=s&&(p=o[u-s]),m=n[u*2],e.opt_len+=m*(f+p),a&&(e.static_len+=m*(i[u*2+1]+p)));if(h!==0){do{for(f=c-1;e.bl_count[f]===0;)f--;e.bl_count[f]--,e.bl_count[f+1]+=2,e.bl_count[c]--,h-=2}while(h>0);for(f=c;f!==0;f--)for(u=e.bl_count[f];u!==0;)d=e.heap[--l],!(d>r)&&(n[d*2+1]!==f&&(e.opt_len+=(f-n[d*2+1])*n[d*2],n[d*2+1]=f),u--)}}function pe(e,t,n){for(var r=Array(v+1),i=0,a=1,o;a<=v;a++)r[a]=i=i+n[a-1]<<1;for(o=0;o<=t;o++){var s=e[o*2+1];s!==0&&(e[o*2]=ue(r[s]++,s))}}function me(){var e,t,n,r,i,a=Array(v+1);for(n=0,r=0;r<f-1;r++)for(P[r]=n,e=0;e<1<<T[r];e++)N[n++]=r;for(N[n-1]=r,i=0,r=0;r<16;r++)for(ee[r]=i,e=0;e<1<<E[r];e++)M[i++]=r;for(i>>=7;r<h;r++)for(ee[r]=i<<7,e=0;e<1<<E[r]-7;e++)M[256+i++]=r;for(t=0;t<=v;t++)a[t]=0;for(e=0;e<=143;)A[e*2+1]=8,e++,a[8]++;for(;e<=255;)A[e*2+1]=9,e++,a[9]++;for(;e<=279;)A[e*2+1]=7,e++,a[7]++;for(;e<=287;)A[e*2+1]=8,e++,a[8]++;for(pe(A,m+1,a),e=0;e<h;e++)j[e*2+1]=5,j[e*2]=ue(e,5);ne=new te(A,T,p+1,m,v),re=new te(j,E,0,h,v),ie=new te([],D,0,g,b)}function he(e){for(var t=0;t<m;t++)e.dyn_ltree[t*2]=0;for(t=0;t<h;t++)e.dyn_dtree[t*2]=0;for(t=0;t<g;t++)e.bl_tree[t*2]=0;e.dyn_ltree[x*2]=1,e.opt_len=e.static_len=0,e.last_lit=e.matches=0}function ge(e){e.bi_valid>8?se(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0}function _e(e,n,r,i){ge(e),i&&(se(e,r),se(e,~r)),t.arraySet(e.pending_buf,e.window,n,r,e.pending),e.pending+=r}function F(e,t,n,r){var i=t*2,a=n*2;return e[i]<e[a]||e[i]===e[a]&&r[t]<=r[n]}function ve(e,t,n){for(var r=e.heap[n],i=n<<1;i<=e.heap_len&&(i<e.heap_len&&F(t,e.heap[i+1],e.heap[i],e.depth)&&i++,!F(t,r,e.heap[i],e.depth));)e.heap[n]=e.heap[i],n=i,i<<=1;e.heap[n]=r}function ye(e,t,n){var r,i,a=0,o,s;if(e.last_lit!==0)do r=e.pending_buf[e.d_buf+a*2]<<8|e.pending_buf[e.d_buf+a*2+1],i=e.pending_buf[e.l_buf+a],a++,r===0?le(e,i,t):(o=N[i],le(e,o+p+1,t),s=T[o],s!==0&&(i-=P[o],ce(e,i,s)),r--,o=oe(r),le(e,o,n),s=E[o],s!==0&&(r-=ee[o],ce(e,r,s)));while(a<e.last_lit);le(e,x,t)}function be(e,t){var n=t.dyn_tree,r=t.stat_desc.static_tree,i=t.stat_desc.has_stree,a=t.stat_desc.elems,o,s,c=-1,l;for(e.heap_len=0,e.heap_max=_,o=0;o<a;o++)n[o*2]===0?n[o*2+1]=0:(e.heap[++e.heap_len]=c=o,e.depth[o]=0);for(;e.heap_len<2;)l=e.heap[++e.heap_len]=c<2?++c:0,n[l*2]=1,e.depth[l]=0,e.opt_len--,i&&(e.static_len-=r[l*2+1]);for(t.max_code=c,o=e.heap_len>>1;o>=1;o--)ve(e,n,o);l=a;do o=e.heap[1],e.heap[1]=e.heap[e.heap_len--],ve(e,n,1),s=e.heap[1],e.heap[--e.heap_max]=o,e.heap[--e.heap_max]=s,n[l*2]=n[o*2]+n[s*2],e.depth[l]=(e.depth[o]>=e.depth[s]?e.depth[o]:e.depth[s])+1,n[o*2+1]=n[s*2+1]=l,e.heap[1]=l++,ve(e,n,1);while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],fe(e,t),pe(n,c,e.bl_count)}function xe(e,t,n){var r,i=-1,a,o=t[1],s=0,c=7,l=4;for(o===0&&(c=138,l=3),t[(n+1)*2+1]=65535,r=0;r<=n;r++)a=o,o=t[(r+1)*2+1],!(++s<c&&a===o)&&(s<l?e.bl_tree[a*2]+=s:a===0?s<=10?e.bl_tree[C*2]++:e.bl_tree[w*2]++:(a!==i&&e.bl_tree[a*2]++,e.bl_tree[S*2]++),s=0,i=a,o===0?(c=138,l=3):a===o?(c=6,l=3):(c=7,l=4))}function Se(e,t,n){var r,i=-1,a,o=t[1],s=0,c=7,l=4;for(o===0&&(c=138,l=3),r=0;r<=n;r++)if(a=o,o=t[(r+1)*2+1],!(++s<c&&a===o)){if(s<l)do le(e,a,e.bl_tree);while(--s!==0);else a===0?s<=10?(le(e,C,e.bl_tree),ce(e,s-3,3)):(le(e,w,e.bl_tree),ce(e,s-11,7)):(a!==i&&(le(e,a,e.bl_tree),s--),le(e,S,e.bl_tree),ce(e,s-3,2));s=0,i=a,o===0?(c=138,l=3):a===o?(c=6,l=3):(c=7,l=4)}}function I(e){var t;for(xe(e,e.dyn_ltree,e.l_desc.max_code),xe(e,e.dyn_dtree,e.d_desc.max_code),be(e,e.bl_desc),t=g-1;t>=3&&e.bl_tree[O[t]*2+1]===0;t--);return e.opt_len+=3*(t+1)+5+5+4,t}function Ce(e,t,n,r){var i;for(ce(e,t-257,5),ce(e,n-1,5),ce(e,r-4,4),i=0;i<r;i++)ce(e,e.bl_tree[O[i]*2+1],3);Se(e,e.dyn_ltree,t-1),Se(e,e.dyn_dtree,n-1)}function L(e){for(var t=4093624447,n=0;n<=31;n++,t>>>=1)if(t&1&&e.dyn_ltree[n*2]!==0)return r;if(e.dyn_ltree[18]!==0||e.dyn_ltree[20]!==0||e.dyn_ltree[26]!==0)return i;for(n=32;n<p;n++)if(e.dyn_ltree[n*2]!==0)return i;return r}var R=!1;function we(e){R||=(me(),!0),e.l_desc=new ae(e.dyn_ltree,ne),e.d_desc=new ae(e.dyn_dtree,re),e.bl_desc=new ae(e.bl_tree,ie),e.bi_buf=0,e.bi_valid=0,he(e)}function Te(e,t,n,r){ce(e,(s<<1)+ +!!r,3),_e(e,t,n,!0)}function Ee(e){ce(e,c<<1,3),le(e,x,A),de(e)}function De(e,t,r,i){var o,s,u=0;e.level>0?(e.strm.data_type===a&&(e.strm.data_type=L(e)),be(e,e.l_desc),be(e,e.d_desc),u=I(e),o=e.opt_len+3+7>>>3,s=e.static_len+3+7>>>3,s<=o&&(o=s)):o=s=r+5,r+4<=o&&t!==-1?Te(e,t,r,i):e.strategy===n||s===o?(ce(e,(c<<1)+ +!!i,3),ye(e,A,j)):(ce(e,(l<<1)+ +!!i,3),Ce(e,e.l_desc.max_code+1,e.d_desc.max_code+1,u+1),ye(e,e.dyn_ltree,e.dyn_dtree)),he(e),i&&ge(e)}function z(e,t,n){return e.pending_buf[e.d_buf+e.last_lit*2]=t>>>8&255,e.pending_buf[e.d_buf+e.last_lit*2+1]=t&255,e.pending_buf[e.l_buf+e.last_lit]=n&255,e.last_lit++,t===0?e.dyn_ltree[n*2]++:(e.matches++,t--,e.dyn_ltree[(N[n]+p+1)*2]++,e.dyn_dtree[oe(t)*2]++),e.last_lit===e.lit_bufsize-1}e._tr_init=we,e._tr_stored_block=Te,e._tr_flush_block=De,e._tr_tally=z,e._tr_align=Ee})),Zh=c(((e,t)=>{function n(e,t,n,r){for(var i=e&65535,a=e>>>16&65535,o=0;n!==0;){o=n>2e3?2e3:n,n-=o;do i=i+t[r++]|0,a=a+i|0;while(--o);i%=65521,a%=65521}return i|a<<16}t.exports=n})),Qh=c(((e,t)=>{function n(){for(var e,t=[],n=0;n<256;n++){e=n;for(var r=0;r<8;r++)e=e&1?3988292384^e>>>1:e>>>1;t[n]=e}return t}var r=n();function i(e,t,n,i){var a=r,o=i+n;e^=-1;for(var s=i;s<o;s++)e=e>>>8^a[(e^t[s])&255];return e^-1}t.exports=i})),$h=c(((e,t)=>{t.exports={2:`need dictionary`,1:`stream end`,0:``,"-1":`file error`,"-2":`stream error`,"-3":`data error`,"-4":`insufficient memory`,"-5":`buffer error`,"-6":`incompatible version`}})),eg=c((e=>{var t=Yh(),n=Xh(),r=Zh(),i=Qh(),a=$h(),o=0,s=1,c=3,l=4,u=5,d=0,f=1,p=-2,m=-3,h=-5,g=-1,_=1,v=2,y=3,b=4,x=0,S=2,C=8,w=9,T=15,E=8,D=286,O=30,k=19,A=2*D+1,j=15,M=3,N=258,P=N+M+1,ee=32,te=42,ne=69,re=73,ie=91,ae=103,oe=113,se=666,ce=1,le=2,ue=3,de=4,fe=3;function pe(e,t){return e.msg=a[t],t}function me(e){return(e<<1)-(e>4?9:0)}function he(e){for(var t=e.length;--t>=0;)e[t]=0}function ge(e){var n=e.state,r=n.pending;r>e.avail_out&&(r=e.avail_out),r!==0&&(t.arraySet(e.output,n.pending_buf,n.pending_out,r,e.next_out),e.next_out+=r,n.pending_out+=r,e.total_out+=r,e.avail_out-=r,n.pending-=r,n.pending===0&&(n.pending_out=0))}function _e(e,t){n._tr_flush_block(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,ge(e.strm)}function F(e,t){e.pending_buf[e.pending++]=t}function ve(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=t&255}function ye(e,n,a,o){var s=e.avail_in;return s>o&&(s=o),s===0?0:(e.avail_in-=s,t.arraySet(n,e.input,e.next_in,s,a),e.state.wrap===1?e.adler=r(e.adler,n,s,a):e.state.wrap===2&&(e.adler=i(e.adler,n,s,a)),e.next_in+=s,e.total_in+=s,s)}function be(e,t){var n=e.max_chain_length,r=e.strstart,i,a,o=e.prev_length,s=e.nice_match,c=e.strstart>e.w_size-P?e.strstart-(e.w_size-P):0,l=e.window,u=e.w_mask,d=e.prev,f=e.strstart+N,p=l[r+o-1],m=l[r+o];e.prev_length>=e.good_match&&(n>>=2),s>e.lookahead&&(s=e.lookahead);do if(i=t,l[i+o]===m&&l[i+o-1]===p&&l[i]===l[r]&&l[++i]===l[r+1]){r+=2,i++;do;while(l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&r<f);if(a=N-(f-r),r=f-N,a>o){if(e.match_start=t,o=a,a>=s)break;p=l[r+o-1],m=l[r+o]}}while((t=d[t&u])>c&&--n!==0);return o<=e.lookahead?o:e.lookahead}function xe(e){var n=e.w_size,r,i,a,o,s;do{if(o=e.window_size-e.lookahead-e.strstart,e.strstart>=n+(n-P)){t.arraySet(e.window,e.window,n,n,0),e.match_start-=n,e.strstart-=n,e.block_start-=n,i=e.hash_size,r=i;do a=e.head[--r],e.head[r]=a>=n?a-n:0;while(--i);i=n,r=i;do a=e.prev[--r],e.prev[r]=a>=n?a-n:0;while(--i);o+=n}if(e.strm.avail_in===0)break;if(i=ye(e.strm,e.window,e.strstart+e.lookahead,o),e.lookahead+=i,e.lookahead+e.insert>=M)for(s=e.strstart-e.insert,e.ins_h=e.window[s],e.ins_h=(e.ins_h<<e.hash_shift^e.window[s+1])&e.hash_mask;e.insert&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[s+M-1])&e.hash_mask,e.prev[s&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=s,s++,e.insert--,!(e.lookahead+e.insert<M)););}while(e.lookahead<P&&e.strm.avail_in!==0)}function Se(e,t){var n=65535;for(n>e.pending_buf_size-5&&(n=e.pending_buf_size-5);;){if(e.lookahead<=1){if(xe(e),e.lookahead===0&&t===o)return ce;if(e.lookahead===0)break}e.strstart+=e.lookahead,e.lookahead=0;var r=e.block_start+n;if((e.strstart===0||e.strstart>=r)&&(e.lookahead=e.strstart-r,e.strstart=r,_e(e,!1),e.strm.avail_out===0)||e.strstart-e.block_start>=e.w_size-P&&(_e(e,!1),e.strm.avail_out===0))return ce}return e.insert=0,t===l?(_e(e,!0),e.strm.avail_out===0?ue:de):(e.strstart>e.block_start&&(_e(e,!1),e.strm.avail_out),ce)}function I(e,t){for(var r,i;;){if(e.lookahead<P){if(xe(e),e.lookahead<P&&t===o)return ce;if(e.lookahead===0)break}if(r=0,e.lookahead>=M&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+M-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),r!==0&&e.strstart-r<=e.w_size-P&&(e.match_length=be(e,r)),e.match_length>=M){if(i=n._tr_tally(e,e.strstart-e.match_start,e.match_length-M),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=M){e.match_length--;do e.strstart++,e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+M-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart;while(--e.match_length!==0);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+1])&e.hash_mask}else i=n._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(i&&(_e(e,!1),e.strm.avail_out===0))return ce}return e.insert=e.strstart<M-1?e.strstart:M-1,t===l?(_e(e,!0),e.strm.avail_out===0?ue:de):e.last_lit&&(_e(e,!1),e.strm.avail_out===0)?ce:le}function Ce(e,t){for(var r,i,a;;){if(e.lookahead<P){if(xe(e),e.lookahead<P&&t===o)return ce;if(e.lookahead===0)break}if(r=0,e.lookahead>=M&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+M-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=M-1,r!==0&&e.prev_length<e.max_lazy_match&&e.strstart-r<=e.w_size-P&&(e.match_length=be(e,r),e.match_length<=5&&(e.strategy===_||e.match_length===M&&e.strstart-e.match_start>4096)&&(e.match_length=M-1)),e.prev_length>=M&&e.match_length<=e.prev_length){a=e.strstart+e.lookahead-M,i=n._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-M),e.lookahead-=e.prev_length-1,e.prev_length-=2;do++e.strstart<=a&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+M-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart);while(--e.prev_length!==0);if(e.match_available=0,e.match_length=M-1,e.strstart++,i&&(_e(e,!1),e.strm.avail_out===0))return ce}else if(e.match_available){if(i=n._tr_tally(e,0,e.window[e.strstart-1]),i&&_e(e,!1),e.strstart++,e.lookahead--,e.strm.avail_out===0)return ce}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&=(i=n._tr_tally(e,0,e.window[e.strstart-1]),0),e.insert=e.strstart<M-1?e.strstart:M-1,t===l?(_e(e,!0),e.strm.avail_out===0?ue:de):e.last_lit&&(_e(e,!1),e.strm.avail_out===0)?ce:le}function L(e,t){for(var r,i,a,s,c=e.window;;){if(e.lookahead<=N){if(xe(e),e.lookahead<=N&&t===o)return ce;if(e.lookahead===0)break}if(e.match_length=0,e.lookahead>=M&&e.strstart>0&&(a=e.strstart-1,i=c[a],i===c[++a]&&i===c[++a]&&i===c[++a])){s=e.strstart+N;do;while(i===c[++a]&&i===c[++a]&&i===c[++a]&&i===c[++a]&&i===c[++a]&&i===c[++a]&&i===c[++a]&&i===c[++a]&&a<s);e.match_length=N-(s-a),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=M?(r=n._tr_tally(e,1,e.match_length-M),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(r=n._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),r&&(_e(e,!1),e.strm.avail_out===0))return ce}return e.insert=0,t===l?(_e(e,!0),e.strm.avail_out===0?ue:de):e.last_lit&&(_e(e,!1),e.strm.avail_out===0)?ce:le}function R(e,t){for(var r;;){if(e.lookahead===0&&(xe(e),e.lookahead===0)){if(t===o)return ce;break}if(e.match_length=0,r=n._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,r&&(_e(e,!1),e.strm.avail_out===0))return ce}return e.insert=0,t===l?(_e(e,!0),e.strm.avail_out===0?ue:de):e.last_lit&&(_e(e,!1),e.strm.avail_out===0)?ce:le}function we(e,t,n,r,i){this.good_length=e,this.max_lazy=t,this.nice_length=n,this.max_chain=r,this.func=i}var Te=[new we(0,0,0,0,Se),new we(4,4,8,4,I),new we(4,5,16,8,I),new we(4,6,32,32,I),new we(4,4,16,16,Ce),new we(8,16,32,32,Ce),new we(8,16,128,128,Ce),new we(8,32,128,256,Ce),new we(32,128,258,1024,Ce),new we(32,258,258,4096,Ce)];function Ee(e){e.window_size=2*e.w_size,he(e.head),e.max_lazy_match=Te[e.level].max_lazy,e.good_match=Te[e.level].good_length,e.nice_match=Te[e.level].nice_length,e.max_chain_length=Te[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=M-1,e.match_available=0,e.ins_h=0}function De(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=C,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new t.Buf16(A*2),this.dyn_dtree=new t.Buf16((2*O+1)*2),this.bl_tree=new t.Buf16((2*k+1)*2),he(this.dyn_ltree),he(this.dyn_dtree),he(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new t.Buf16(j+1),this.heap=new t.Buf16(2*D+1),he(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new t.Buf16(2*D+1),he(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function z(e){var t;return!e||!e.state?pe(e,p):(e.total_in=e.total_out=0,e.data_type=S,t=e.state,t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap?te:oe,e.adler=t.wrap===2?0:1,t.last_flush=o,n._tr_init(t),d)}function Oe(e){var t=z(e);return t===d&&Ee(e.state),t}function ke(e,t){return!e||!e.state||e.state.wrap!==2?p:(e.state.gzhead=t,d)}function Ae(e,n,r,i,a,o){if(!e)return p;var s=1;if(n===g&&(n=6),i<0?(s=0,i=-i):i>15&&(s=2,i-=16),a<1||a>w||r!==C||i<8||i>15||n<0||n>9||o<0||o>b)return pe(e,p);i===8&&(i=9);var c=new De;return e.state=c,c.strm=e,c.wrap=s,c.gzhead=null,c.w_bits=i,c.w_size=1<<c.w_bits,c.w_mask=c.w_size-1,c.hash_bits=a+7,c.hash_size=1<<c.hash_bits,c.hash_mask=c.hash_size-1,c.hash_shift=~~((c.hash_bits+M-1)/M),c.window=new t.Buf8(c.w_size*2),c.head=new t.Buf16(c.hash_size),c.prev=new t.Buf16(c.w_size),c.lit_bufsize=1<<a+6,c.pending_buf_size=c.lit_bufsize*4,c.pending_buf=new t.Buf8(c.pending_buf_size),c.d_buf=1*c.lit_bufsize,c.l_buf=3*c.lit_bufsize,c.level=n,c.strategy=o,c.method=r,Oe(e)}function je(e,t){return Ae(e,t,C,T,E,x)}function Me(e,t){var r,a,m,g;if(!e||!e.state||t>u||t<0)return e?pe(e,p):p;if(a=e.state,!e.output||!e.input&&e.avail_in!==0||a.status===se&&t!==l)return pe(e,e.avail_out===0?h:p);if(a.strm=e,r=a.last_flush,a.last_flush=t,a.status===te){if(a.wrap===2)e.adler=0,F(a,31),F(a,139),F(a,8),a.gzhead?(F(a,+!!a.gzhead.text+(a.gzhead.hcrc?2:0)+(a.gzhead.extra?4:0)+(a.gzhead.name?8:0)+(a.gzhead.comment?16:0)),F(a,a.gzhead.time&255),F(a,a.gzhead.time>>8&255),F(a,a.gzhead.time>>16&255),F(a,a.gzhead.time>>24&255),F(a,a.level===9?2:a.strategy>=v||a.level<2?4:0),F(a,a.gzhead.os&255),a.gzhead.extra&&a.gzhead.extra.length&&(F(a,a.gzhead.extra.length&255),F(a,a.gzhead.extra.length>>8&255)),a.gzhead.hcrc&&(e.adler=i(e.adler,a.pending_buf,a.pending,0)),a.gzindex=0,a.status=ne):(F(a,0),F(a,0),F(a,0),F(a,0),F(a,0),F(a,a.level===9?2:a.strategy>=v||a.level<2?4:0),F(a,fe),a.status=oe);else{var _=C+(a.w_bits-8<<4)<<8,b=-1;b=a.strategy>=v||a.level<2?0:a.level<6?1:a.level===6?2:3,_|=b<<6,a.strstart!==0&&(_|=ee),_+=31-_%31,a.status=oe,ve(a,_),a.strstart!==0&&(ve(a,e.adler>>>16),ve(a,e.adler&65535)),e.adler=1}}if(a.status===ne){if(a.gzhead.extra){for(m=a.pending;a.gzindex<(a.gzhead.extra.length&65535)&&!(a.pending===a.pending_buf_size&&(a.gzhead.hcrc&&a.pending>m&&(e.adler=i(e.adler,a.pending_buf,a.pending-m,m)),ge(e),m=a.pending,a.pending===a.pending_buf_size));)F(a,a.gzhead.extra[a.gzindex]&255),a.gzindex++;a.gzhead.hcrc&&a.pending>m&&(e.adler=i(e.adler,a.pending_buf,a.pending-m,m)),a.gzindex===a.gzhead.extra.length&&(a.gzindex=0,a.status=re)}else a.status=re}if(a.status===re){if(a.gzhead.name){m=a.pending;do{if(a.pending===a.pending_buf_size&&(a.gzhead.hcrc&&a.pending>m&&(e.adler=i(e.adler,a.pending_buf,a.pending-m,m)),ge(e),m=a.pending,a.pending===a.pending_buf_size)){g=1;break}g=a.gzindex<a.gzhead.name.length?a.gzhead.name.charCodeAt(a.gzindex++)&255:0,F(a,g)}while(g!==0);a.gzhead.hcrc&&a.pending>m&&(e.adler=i(e.adler,a.pending_buf,a.pending-m,m)),g===0&&(a.gzindex=0,a.status=ie)}else a.status=ie}if(a.status===ie){if(a.gzhead.comment){m=a.pending;do{if(a.pending===a.pending_buf_size&&(a.gzhead.hcrc&&a.pending>m&&(e.adler=i(e.adler,a.pending_buf,a.pending-m,m)),ge(e),m=a.pending,a.pending===a.pending_buf_size)){g=1;break}g=a.gzindex<a.gzhead.comment.length?a.gzhead.comment.charCodeAt(a.gzindex++)&255:0,F(a,g)}while(g!==0);a.gzhead.hcrc&&a.pending>m&&(e.adler=i(e.adler,a.pending_buf,a.pending-m,m)),g===0&&(a.status=ae)}else a.status=ae}if(a.status===ae&&(a.gzhead.hcrc?(a.pending+2>a.pending_buf_size&&ge(e),a.pending+2<=a.pending_buf_size&&(F(a,e.adler&255),F(a,e.adler>>8&255),e.adler=0,a.status=oe)):a.status=oe),a.pending!==0){if(ge(e),e.avail_out===0)return a.last_flush=-1,d}else if(e.avail_in===0&&me(t)<=me(r)&&t!==l)return pe(e,h);if(a.status===se&&e.avail_in!==0)return pe(e,h);if(e.avail_in!==0||a.lookahead!==0||t!==o&&a.status!==se){var x=a.strategy===v?R(a,t):a.strategy===y?L(a,t):Te[a.level].func(a,t);if((x===ue||x===de)&&(a.status=se),x===ce||x===ue)return e.avail_out===0&&(a.last_flush=-1),d;if(x===le&&(t===s?n._tr_align(a):t!==u&&(n._tr_stored_block(a,0,0,!1),t===c&&(he(a.head),a.lookahead===0&&(a.strstart=0,a.block_start=0,a.insert=0))),ge(e),e.avail_out===0))return a.last_flush=-1,d}return t===l?a.wrap<=0?f:(a.wrap===2?(F(a,e.adler&255),F(a,e.adler>>8&255),F(a,e.adler>>16&255),F(a,e.adler>>24&255),F(a,e.total_in&255),F(a,e.total_in>>8&255),F(a,e.total_in>>16&255),F(a,e.total_in>>24&255)):(ve(a,e.adler>>>16),ve(a,e.adler&65535)),ge(e),a.wrap>0&&(a.wrap=-a.wrap),a.pending===0?f:d):d}function Ne(e){var t;return!e||!e.state?p:(t=e.state.status,t!==te&&t!==ne&&t!==re&&t!==ie&&t!==ae&&t!==oe&&t!==se?pe(e,p):(e.state=null,t===oe?pe(e,m):d))}function Pe(e,n){var i=n.length,a,o,s,c,l,u,f,m;if(!e||!e.state||(a=e.state,c=a.wrap,c===2||c===1&&a.status!==te||a.lookahead))return p;for(c===1&&(e.adler=r(e.adler,n,i,0)),a.wrap=0,i>=a.w_size&&(c===0&&(he(a.head),a.strstart=0,a.block_start=0,a.insert=0),m=new t.Buf8(a.w_size),t.arraySet(m,n,i-a.w_size,a.w_size,0),n=m,i=a.w_size),l=e.avail_in,u=e.next_in,f=e.input,e.avail_in=i,e.next_in=0,e.input=n,xe(a);a.lookahead>=M;){o=a.strstart,s=a.lookahead-(M-1);do a.ins_h=(a.ins_h<<a.hash_shift^a.window[o+M-1])&a.hash_mask,a.prev[o&a.w_mask]=a.head[a.ins_h],a.head[a.ins_h]=o,o++;while(--s);a.strstart=o,a.lookahead=M-1,xe(a)}return a.strstart+=a.lookahead,a.block_start=a.strstart,a.insert=a.lookahead,a.lookahead=0,a.match_length=a.prev_length=M-1,a.match_available=0,e.next_in=u,e.input=f,e.avail_in=l,a.wrap=c,d}e.deflateInit=je,e.deflateInit2=Ae,e.deflateReset=Oe,e.deflateResetKeep=z,e.deflateSetHeader=ke,e.deflate=Me,e.deflateEnd=Ne,e.deflateSetDictionary=Pe,e.deflateInfo=`pako deflate (from Nodeca project)`})),tg=c((e=>{var t=Yh(),n=!0,r=!0;try{String.fromCharCode.apply(null,[0])}catch{n=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{r=!1}for(var i=new t.Buf8(256),a=0;a<256;a++)i[a]=a>=252?6:a>=248?5:a>=240?4:a>=224?3:a>=192?2:1;i[254]=i[254]=1,e.string2buf=function(e){var n,r,i,a,o,s=e.length,c=0;for(a=0;a<s;a++)r=e.charCodeAt(a),(r&64512)==55296&&a+1<s&&(i=e.charCodeAt(a+1),(i&64512)==56320&&(r=65536+(r-55296<<10)+(i-56320),a++)),c+=r<128?1:r<2048?2:r<65536?3:4;for(n=new t.Buf8(c),o=0,a=0;o<c;a++)r=e.charCodeAt(a),(r&64512)==55296&&a+1<s&&(i=e.charCodeAt(a+1),(i&64512)==56320&&(r=65536+(r-55296<<10)+(i-56320),a++)),r<128?n[o++]=r:r<2048?(n[o++]=192|r>>>6,n[o++]=128|r&63):r<65536?(n[o++]=224|r>>>12,n[o++]=128|r>>>6&63,n[o++]=128|r&63):(n[o++]=240|r>>>18,n[o++]=128|r>>>12&63,n[o++]=128|r>>>6&63,n[o++]=128|r&63);return n};function o(e,i){if(i<65534&&(e.subarray&&r||!e.subarray&&n))return String.fromCharCode.apply(null,t.shrinkBuf(e,i));for(var a=``,o=0;o<i;o++)a+=String.fromCharCode(e[o]);return a}e.buf2binstring=function(e){return o(e,e.length)},e.binstring2buf=function(e){for(var n=new t.Buf8(e.length),r=0,i=n.length;r<i;r++)n[r]=e.charCodeAt(r);return n},e.buf2string=function(e,t){var n,r,a,s,c=t||e.length,l=Array(c*2);for(r=0,n=0;n<c;)if(a=e[n++],a<128)l[r++]=a;else if(s=i[a],s>4)l[r++]=65533,n+=s-1;else{for(a&=s===2?31:s===3?15:7;s>1&&n<c;)a=a<<6|e[n++]&63,s--;s>1?l[r++]=65533:a<65536?l[r++]=a:(a-=65536,l[r++]=55296|a>>10&1023,l[r++]=56320|a&1023)}return o(l,r)},e.utf8border=function(e,t){var n;for(t||=e.length,t>e.length&&(t=e.length),n=t-1;n>=0&&(e[n]&192)==128;)n--;return n<0||n===0?t:n+i[e[n]]>t?n:t}})),ng=c(((e,t)=>{function n(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg=``,this.state=null,this.data_type=2,this.adler=0}t.exports=n})),rg=c((e=>{var t=eg(),n=Yh(),r=tg(),i=$h(),a=ng(),o=Object.prototype.toString,s=0,c=4,l=0,u=1,d=2,f=-1,p=0,m=8;function h(e){if(!(this instanceof h))return new h(e);this.options=n.assign({level:f,method:m,chunkSize:16384,windowBits:15,memLevel:8,strategy:p,to:``},e||{});var s=this.options;s.raw&&s.windowBits>0?s.windowBits=-s.windowBits:s.gzip&&s.windowBits>0&&s.windowBits<16&&(s.windowBits+=16),this.err=0,this.msg=``,this.ended=!1,this.chunks=[],this.strm=new a,this.strm.avail_out=0;var c=t.deflateInit2(this.strm,s.level,s.method,s.windowBits,s.memLevel,s.strategy);if(c!==l)throw Error(i[c]);if(s.header&&t.deflateSetHeader(this.strm,s.header),s.dictionary){var u=typeof s.dictionary==`string`?r.string2buf(s.dictionary):o.call(s.dictionary)===`[object ArrayBuffer]`?new Uint8Array(s.dictionary):s.dictionary;if(c=t.deflateSetDictionary(this.strm,u),c!==l)throw Error(i[c]);this._dict_set=!0}}h.prototype.push=function(e,i){var a=this.strm,f=this.options.chunkSize,p,m;if(this.ended)return!1;m=i===~~i?i:i===!0?c:s,a.input=typeof e==`string`?r.string2buf(e):o.call(e)===`[object ArrayBuffer]`?new Uint8Array(e):e,a.next_in=0,a.avail_in=a.input.length;do{if(a.avail_out===0&&(a.output=new n.Buf8(f),a.next_out=0,a.avail_out=f),p=t.deflate(a,m),p!==u&&p!==l)return this.onEnd(p),this.ended=!0,!1;(a.avail_out===0||a.avail_in===0&&(m===c||m===d))&&(this.options.to===`string`?this.onData(r.buf2binstring(n.shrinkBuf(a.output,a.next_out))):this.onData(n.shrinkBuf(a.output,a.next_out)))}while((a.avail_in>0||a.avail_out===0)&&p!==u);return m===c?(p=t.deflateEnd(this.strm),this.onEnd(p),this.ended=!0,p===l):(m===d&&(this.onEnd(l),a.avail_out=0),!0)},h.prototype.onData=function(e){this.chunks.push(e)},h.prototype.onEnd=function(e){e===l&&(this.result=this.options.to===`string`?this.chunks.join(``):n.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function g(e,t){var n=new h(t);if(n.push(e,!0),n.err)throw n.msg||i[n.err];return n.result}function _(e,t){return t||={},t.raw=!0,g(e,t)}function v(e,t){return t||={},t.gzip=!0,g(e,t)}e.Deflate=h,e.deflate=g,e.deflateRaw=_,e.gzip=v})),ig=c(((e,t)=>{t.exports=function(e,t){var n=e.state,r=e.next_in,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x,S,C,w,T=e.input,E;i=r+(e.avail_in-5),a=e.next_out,E=e.output,o=a-(t-e.avail_out),s=a+(e.avail_out-257),c=n.dmax,l=n.wsize,u=n.whave,d=n.wnext,f=n.window,p=n.hold,m=n.bits,h=n.lencode,g=n.distcode,_=(1<<n.lenbits)-1,v=(1<<n.distbits)-1;top:do{m<15&&(p+=T[r++]<<m,m+=8,p+=T[r++]<<m,m+=8),y=h[p&_];dolen:for(;;){if(b=y>>>24,p>>>=b,m-=b,b=y>>>16&255,b===0)E[a++]=y&65535;else if(b&16){x=y&65535,b&=15,b&&(m<b&&(p+=T[r++]<<m,m+=8),x+=p&(1<<b)-1,p>>>=b,m-=b),m<15&&(p+=T[r++]<<m,m+=8,p+=T[r++]<<m,m+=8),y=g[p&v];dodist:for(;;){if(b=y>>>24,p>>>=b,m-=b,b=y>>>16&255,b&16){if(S=y&65535,b&=15,m<b&&(p+=T[r++]<<m,m+=8,m<b&&(p+=T[r++]<<m,m+=8)),S+=p&(1<<b)-1,S>c){e.msg=`invalid distance too far back`,n.mode=30;break top}if(p>>>=b,m-=b,b=a-o,S>b){if(b=S-b,b>u&&n.sane){e.msg=`invalid distance too far back`,n.mode=30;break top}if(C=0,w=f,d===0){if(C+=l-b,b<x){x-=b;do E[a++]=f[C++];while(--b);C=a-S,w=E}}else if(d<b){if(C+=l+d-b,b-=d,b<x){x-=b;do E[a++]=f[C++];while(--b);if(C=0,d<x){b=d,x-=b;do E[a++]=f[C++];while(--b);C=a-S,w=E}}}else if(C+=d-b,b<x){x-=b;do E[a++]=f[C++];while(--b);C=a-S,w=E}for(;x>2;)E[a++]=w[C++],E[a++]=w[C++],E[a++]=w[C++],x-=3;x&&(E[a++]=w[C++],x>1&&(E[a++]=w[C++]))}else{C=a-S;do E[a++]=E[C++],E[a++]=E[C++],E[a++]=E[C++],x-=3;while(x>2);x&&(E[a++]=E[C++],x>1&&(E[a++]=E[C++]))}}else if(b&64){e.msg=`invalid distance code`,n.mode=30;break top}else{y=g[(y&65535)+(p&(1<<b)-1)];continue dodist}break}}else if(!(b&64)){y=h[(y&65535)+(p&(1<<b)-1)];continue dolen}else if(b&32){n.mode=12;break top}else{e.msg=`invalid literal/length code`,n.mode=30;break top}break}}while(r<i&&a<s);x=m>>3,r-=x,m-=x<<3,p&=(1<<m)-1,e.next_in=r,e.next_out=a,e.avail_in=r<i?5+(i-r):5-(r-i),e.avail_out=a<s?257+(s-a):257-(a-s),n.hold=p,n.bits=m}})),ag=c(((e,t)=>{var n=Yh(),r=15,i=852,a=592,o=0,s=1,c=2,l=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],u=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],d=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],f=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];t.exports=function(e,t,p,m,h,g,_,v){var y=v.bits,b=0,x=0,S=0,C=0,w=0,T=0,E=0,D=0,O=0,k=0,A,j,M,N,P,ee=null,te=0,ne,re=new n.Buf16(r+1),ie=new n.Buf16(r+1),ae=null,oe=0,se,ce,le;for(b=0;b<=r;b++)re[b]=0;for(x=0;x<m;x++)re[t[p+x]]++;for(w=y,C=r;C>=1&&re[C]===0;C--);if(w>C&&(w=C),C===0)return h[g++]=20971520,h[g++]=20971520,v.bits=1,0;for(S=1;S<C&&re[S]===0;S++);for(w<S&&(w=S),D=1,b=1;b<=r;b++)if(D<<=1,D-=re[b],D<0)return-1;if(D>0&&(e===o||C!==1))return-1;for(ie[1]=0,b=1;b<r;b++)ie[b+1]=ie[b]+re[b];for(x=0;x<m;x++)t[p+x]!==0&&(_[ie[t[p+x]]++]=x);if(e===o?(ee=ae=_,ne=19):e===s?(ee=l,te-=257,ae=u,oe-=257,ne=256):(ee=d,ae=f,ne=-1),k=0,x=0,b=S,P=g,T=w,E=0,M=-1,O=1<<w,N=O-1,e===s&&O>i||e===c&&O>a)return 1;for(;;){se=b-E,_[x]<ne?(ce=0,le=_[x]):_[x]>ne?(ce=ae[oe+_[x]],le=ee[te+_[x]]):(ce=96,le=0),A=1<<b-E,j=1<<T,S=j;do j-=A,h[P+(k>>E)+j]=se<<24|ce<<16|le;while(j!==0);for(A=1<<b-1;k&A;)A>>=1;if(A===0?k=0:(k&=A-1,k+=A),x++,--re[b]===0){if(b===C)break;b=t[p+_[x]]}if(b>w&&(k&N)!==M){for(E===0&&(E=w),P+=S,T=b-E,D=1<<T;T+E<C&&(D-=re[T+E],!(D<=0));)T++,D<<=1;if(O+=1<<T,e===s&&O>i||e===c&&O>a)return 1;M=k&N,h[M]=w<<24|T<<16|P-g}}return k!==0&&(h[P+k]=b-E<<24|4194304),v.bits=w,0}})),og=c((e=>{var t=Yh(),n=Zh(),r=Qh(),i=ig(),a=ag(),o=0,s=1,c=2,l=4,u=5,d=6,f=0,p=1,m=2,h=-2,g=-3,_=-4,v=-5,y=8,b=1,x=2,S=3,C=4,w=5,T=6,E=7,D=8,O=9,k=10,A=11,j=12,M=13,N=14,P=15,ee=16,te=17,ne=18,re=19,ie=20,ae=21,oe=22,se=23,ce=24,le=25,ue=26,de=27,fe=28,pe=29,me=30,he=31,ge=32,_e=852,F=592,ve=15;function ye(e){return(e>>>24&255)+(e>>>8&65280)+((e&65280)<<8)+((e&255)<<24)}function be(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new t.Buf16(320),this.work=new t.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function xe(e){var n;return!e||!e.state?h:(n=e.state,e.total_in=e.total_out=n.total=0,e.msg=``,n.wrap&&(e.adler=n.wrap&1),n.mode=b,n.last=0,n.havedict=0,n.dmax=32768,n.head=null,n.hold=0,n.bits=0,n.lencode=n.lendyn=new t.Buf32(_e),n.distcode=n.distdyn=new t.Buf32(F),n.sane=1,n.back=-1,f)}function Se(e){var t;return!e||!e.state?h:(t=e.state,t.wsize=0,t.whave=0,t.wnext=0,xe(e))}function I(e,t){var n,r;return!e||!e.state||(r=e.state,t<0?(n=0,t=-t):(n=(t>>4)+1,t<48&&(t&=15)),t&&(t<8||t>15))?h:(r.window!==null&&r.wbits!==t&&(r.window=null),r.wrap=n,r.wbits=t,Se(e))}function Ce(e,t){var n,r;return e?(r=new be,e.state=r,r.window=null,n=I(e,t),n!==f&&(e.state=null),n):h}function L(e){return Ce(e,ve)}var R=!0,we,Te;function Ee(e){if(R){var n;for(we=new t.Buf32(512),Te=new t.Buf32(32),n=0;n<144;)e.lens[n++]=8;for(;n<256;)e.lens[n++]=9;for(;n<280;)e.lens[n++]=7;for(;n<288;)e.lens[n++]=8;for(a(s,e.lens,0,288,we,0,e.work,{bits:9}),n=0;n<32;)e.lens[n++]=5;a(c,e.lens,0,32,Te,0,e.work,{bits:5}),R=!1}e.lencode=we,e.lenbits=9,e.distcode=Te,e.distbits=5}function De(e,n,r,i){var a,o=e.state;return o.window===null&&(o.wsize=1<<o.wbits,o.wnext=0,o.whave=0,o.window=new t.Buf8(o.wsize)),i>=o.wsize?(t.arraySet(o.window,n,r-o.wsize,o.wsize,0),o.wnext=0,o.whave=o.wsize):(a=o.wsize-o.wnext,a>i&&(a=i),t.arraySet(o.window,n,r-i,a,o.wnext),i-=a,i?(t.arraySet(o.window,n,r-i,i,0),o.wnext=i,o.whave=o.wsize):(o.wnext+=a,o.wnext===o.wsize&&(o.wnext=0),o.whave<o.wsize&&(o.whave+=a))),0}function z(e,_e){var F,ve,be,xe,Se,I,Ce,L,R,we,Te,z,Oe,ke,Ae=0,je,Me,Ne,Pe,Fe,Ie,Le,Re,ze=new t.Buf8(4),Be,Ve,He=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!e||!e.state||!e.output||!e.input&&e.avail_in!==0)return h;F=e.state,F.mode===j&&(F.mode=M),Se=e.next_out,be=e.output,Ce=e.avail_out,xe=e.next_in,ve=e.input,I=e.avail_in,L=F.hold,R=F.bits,we=I,Te=Ce,Re=f;inf_leave:for(;;)switch(F.mode){case b:if(F.wrap===0){F.mode=M;break}for(;R<16;){if(I===0)break inf_leave;I--,L+=ve[xe++]<<R,R+=8}if(F.wrap&2&&L===35615){F.check=0,ze[0]=L&255,ze[1]=L>>>8&255,F.check=r(F.check,ze,2,0),L=0,R=0,F.mode=x;break}if(F.flags=0,F.head&&(F.head.done=!1),!(F.wrap&1)||(((L&255)<<8)+(L>>8))%31){e.msg=`incorrect header check`,F.mode=me;break}if((L&15)!==y){e.msg=`unknown compression method`,F.mode=me;break}if(L>>>=4,R-=4,Le=(L&15)+8,F.wbits===0)F.wbits=Le;else if(Le>F.wbits){e.msg=`invalid window size`,F.mode=me;break}F.dmax=1<<Le,e.adler=F.check=1,F.mode=L&512?k:j,L=0,R=0;break;case x:for(;R<16;){if(I===0)break inf_leave;I--,L+=ve[xe++]<<R,R+=8}if(F.flags=L,(F.flags&255)!==y){e.msg=`unknown compression method`,F.mode=me;break}if(F.flags&57344){e.msg=`unknown header flags set`,F.mode=me;break}F.head&&(F.head.text=L>>8&1),F.flags&512&&(ze[0]=L&255,ze[1]=L>>>8&255,F.check=r(F.check,ze,2,0)),L=0,R=0,F.mode=S;case S:for(;R<32;){if(I===0)break inf_leave;I--,L+=ve[xe++]<<R,R+=8}F.head&&(F.head.time=L),F.flags&512&&(ze[0]=L&255,ze[1]=L>>>8&255,ze[2]=L>>>16&255,ze[3]=L>>>24&255,F.check=r(F.check,ze,4,0)),L=0,R=0,F.mode=C;case C:for(;R<16;){if(I===0)break inf_leave;I--,L+=ve[xe++]<<R,R+=8}F.head&&(F.head.xflags=L&255,F.head.os=L>>8),F.flags&512&&(ze[0]=L&255,ze[1]=L>>>8&255,F.check=r(F.check,ze,2,0)),L=0,R=0,F.mode=w;case w:if(F.flags&1024){for(;R<16;){if(I===0)break inf_leave;I--,L+=ve[xe++]<<R,R+=8}F.length=L,F.head&&(F.head.extra_len=L),F.flags&512&&(ze[0]=L&255,ze[1]=L>>>8&255,F.check=r(F.check,ze,2,0)),L=0,R=0}else F.head&&(F.head.extra=null);F.mode=T;case T:if(F.flags&1024&&(z=F.length,z>I&&(z=I),z&&(F.head&&(Le=F.head.extra_len-F.length,F.head.extra||(F.head.extra=Array(F.head.extra_len)),t.arraySet(F.head.extra,ve,xe,z,Le)),F.flags&512&&(F.check=r(F.check,ve,z,xe)),I-=z,xe+=z,F.length-=z),F.length))break inf_leave;F.length=0,F.mode=E;case E:if(F.flags&2048){if(I===0)break inf_leave;z=0;do Le=ve[xe+z++],F.head&&Le&&F.length<65536&&(F.head.name+=String.fromCharCode(Le));while(Le&&z<I);if(F.flags&512&&(F.check=r(F.check,ve,z,xe)),I-=z,xe+=z,Le)break inf_leave}else F.head&&(F.head.name=null);F.length=0,F.mode=D;case D:if(F.flags&4096){if(I===0)break inf_leave;z=0;do Le=ve[xe+z++],F.head&&Le&&F.length<65536&&(F.head.comment+=String.fromCharCode(Le));while(Le&&z<I);if(F.flags&512&&(F.check=r(F.check,ve,z,xe)),I-=z,xe+=z,Le)break inf_leave}else F.head&&(F.head.comment=null);F.mode=O;case O:if(F.flags&512){for(;R<16;){if(I===0)break inf_leave;I--,L+=ve[xe++]<<R,R+=8}if(L!==(F.check&65535)){e.msg=`header crc mismatch`,F.mode=me;break}L=0,R=0}F.head&&(F.head.hcrc=F.flags>>9&1,F.head.done=!0),e.adler=F.check=0,F.mode=j;break;case k:for(;R<32;){if(I===0)break inf_leave;I--,L+=ve[xe++]<<R,R+=8}e.adler=F.check=ye(L),L=0,R=0,F.mode=A;case A:if(F.havedict===0)return e.next_out=Se,e.avail_out=Ce,e.next_in=xe,e.avail_in=I,F.hold=L,F.bits=R,m;e.adler=F.check=1,F.mode=j;case j:if(_e===u||_e===d)break inf_leave;case M:if(F.last){L>>>=R&7,R-=R&7,F.mode=de;break}for(;R<3;){if(I===0)break inf_leave;I--,L+=ve[xe++]<<R,R+=8}switch(F.last=L&1,L>>>=1,--R,L&3){case 0:F.mode=N;break;case 1:if(Ee(F),F.mode=ie,_e===d){L>>>=2,R-=2;break inf_leave}break;case 2:F.mode=te;break;case 3:e.msg=`invalid block type`,F.mode=me}L>>>=2,R-=2;break;case N:for(L>>>=R&7,R-=R&7;R<32;){if(I===0)break inf_leave;I--,L+=ve[xe++]<<R,R+=8}if((L&65535)!=(L>>>16^65535)){e.msg=`invalid stored block lengths`,F.mode=me;break}if(F.length=L&65535,L=0,R=0,F.mode=P,_e===d)break inf_leave;case P:F.mode=ee;case ee:if(z=F.length,z){if(z>I&&(z=I),z>Ce&&(z=Ce),z===0)break inf_leave;t.arraySet(be,ve,xe,z,Se),I-=z,xe+=z,Ce-=z,Se+=z,F.length-=z;break}F.mode=j;break;case te:for(;R<14;){if(I===0)break inf_leave;I--,L+=ve[xe++]<<R,R+=8}if(F.nlen=(L&31)+257,L>>>=5,R-=5,F.ndist=(L&31)+1,L>>>=5,R-=5,F.ncode=(L&15)+4,L>>>=4,R-=4,F.nlen>286||F.ndist>30){e.msg=`too many length or distance symbols`,F.mode=me;break}F.have=0,F.mode=ne;case ne:for(;F.have<F.ncode;){for(;R<3;){if(I===0)break inf_leave;I--,L+=ve[xe++]<<R,R+=8}F.lens[He[F.have++]]=L&7,L>>>=3,R-=3}for(;F.have<19;)F.lens[He[F.have++]]=0;if(F.lencode=F.lendyn,F.lenbits=7,Be={bits:F.lenbits},Re=a(o,F.lens,0,19,F.lencode,0,F.work,Be),F.lenbits=Be.bits,Re){e.msg=`invalid code lengths set`,F.mode=me;break}F.have=0,F.mode=re;case re:for(;F.have<F.nlen+F.ndist;){for(;Ae=F.lencode[L&(1<<F.lenbits)-1],je=Ae>>>24,Me=Ae>>>16&255,Ne=Ae&65535,!(je<=R);){if(I===0)break inf_leave;I--,L+=ve[xe++]<<R,R+=8}if(Ne<16)L>>>=je,R-=je,F.lens[F.have++]=Ne;else{if(Ne===16){for(Ve=je+2;R<Ve;){if(I===0)break inf_leave;I--,L+=ve[xe++]<<R,R+=8}if(L>>>=je,R-=je,F.have===0){e.msg=`invalid bit length repeat`,F.mode=me;break}Le=F.lens[F.have-1],z=3+(L&3),L>>>=2,R-=2}else if(Ne===17){for(Ve=je+3;R<Ve;){if(I===0)break inf_leave;I--,L+=ve[xe++]<<R,R+=8}L>>>=je,R-=je,Le=0,z=3+(L&7),L>>>=3,R-=3}else{for(Ve=je+7;R<Ve;){if(I===0)break inf_leave;I--,L+=ve[xe++]<<R,R+=8}L>>>=je,R-=je,Le=0,z=11+(L&127),L>>>=7,R-=7}if(F.have+z>F.nlen+F.ndist){e.msg=`invalid bit length repeat`,F.mode=me;break}for(;z--;)F.lens[F.have++]=Le}}if(F.mode===me)break;if(F.lens[256]===0){e.msg=`invalid code -- missing end-of-block`,F.mode=me;break}if(F.lenbits=9,Be={bits:F.lenbits},Re=a(s,F.lens,0,F.nlen,F.lencode,0,F.work,Be),F.lenbits=Be.bits,Re){e.msg=`invalid literal/lengths set`,F.mode=me;break}if(F.distbits=6,F.distcode=F.distdyn,Be={bits:F.distbits},Re=a(c,F.lens,F.nlen,F.ndist,F.distcode,0,F.work,Be),F.distbits=Be.bits,Re){e.msg=`invalid distances set`,F.mode=me;break}if(F.mode=ie,_e===d)break inf_leave;case ie:F.mode=ae;case ae:if(I>=6&&Ce>=258){e.next_out=Se,e.avail_out=Ce,e.next_in=xe,e.avail_in=I,F.hold=L,F.bits=R,i(e,Te),Se=e.next_out,be=e.output,Ce=e.avail_out,xe=e.next_in,ve=e.input,I=e.avail_in,L=F.hold,R=F.bits,F.mode===j&&(F.back=-1);break}for(F.back=0;Ae=F.lencode[L&(1<<F.lenbits)-1],je=Ae>>>24,Me=Ae>>>16&255,Ne=Ae&65535,!(je<=R);){if(I===0)break inf_leave;I--,L+=ve[xe++]<<R,R+=8}if(Me&&!(Me&240)){for(Pe=je,Fe=Me,Ie=Ne;Ae=F.lencode[Ie+((L&(1<<Pe+Fe)-1)>>Pe)],je=Ae>>>24,Me=Ae>>>16&255,Ne=Ae&65535,!(Pe+je<=R);){if(I===0)break inf_leave;I--,L+=ve[xe++]<<R,R+=8}L>>>=Pe,R-=Pe,F.back+=Pe}if(L>>>=je,R-=je,F.back+=je,F.length=Ne,Me===0){F.mode=ue;break}if(Me&32){F.back=-1,F.mode=j;break}if(Me&64){e.msg=`invalid literal/length code`,F.mode=me;break}F.extra=Me&15,F.mode=oe;case oe:if(F.extra){for(Ve=F.extra;R<Ve;){if(I===0)break inf_leave;I--,L+=ve[xe++]<<R,R+=8}F.length+=L&(1<<F.extra)-1,L>>>=F.extra,R-=F.extra,F.back+=F.extra}F.was=F.length,F.mode=se;case se:for(;Ae=F.distcode[L&(1<<F.distbits)-1],je=Ae>>>24,Me=Ae>>>16&255,Ne=Ae&65535,!(je<=R);){if(I===0)break inf_leave;I--,L+=ve[xe++]<<R,R+=8}if(!(Me&240)){for(Pe=je,Fe=Me,Ie=Ne;Ae=F.distcode[Ie+((L&(1<<Pe+Fe)-1)>>Pe)],je=Ae>>>24,Me=Ae>>>16&255,Ne=Ae&65535,!(Pe+je<=R);){if(I===0)break inf_leave;I--,L+=ve[xe++]<<R,R+=8}L>>>=Pe,R-=Pe,F.back+=Pe}if(L>>>=je,R-=je,F.back+=je,Me&64){e.msg=`invalid distance code`,F.mode=me;break}F.offset=Ne,F.extra=Me&15,F.mode=ce;case ce:if(F.extra){for(Ve=F.extra;R<Ve;){if(I===0)break inf_leave;I--,L+=ve[xe++]<<R,R+=8}F.offset+=L&(1<<F.extra)-1,L>>>=F.extra,R-=F.extra,F.back+=F.extra}if(F.offset>F.dmax){e.msg=`invalid distance too far back`,F.mode=me;break}F.mode=le;case le:if(Ce===0)break inf_leave;if(z=Te-Ce,F.offset>z){if(z=F.offset-z,z>F.whave&&F.sane){e.msg=`invalid distance too far back`,F.mode=me;break}z>F.wnext?(z-=F.wnext,Oe=F.wsize-z):Oe=F.wnext-z,z>F.length&&(z=F.length),ke=F.window}else ke=be,Oe=Se-F.offset,z=F.length;z>Ce&&(z=Ce),Ce-=z,F.length-=z;do be[Se++]=ke[Oe++];while(--z);F.length===0&&(F.mode=ae);break;case ue:if(Ce===0)break inf_leave;be[Se++]=F.length,Ce--,F.mode=ae;break;case de:if(F.wrap){for(;R<32;){if(I===0)break inf_leave;I--,L|=ve[xe++]<<R,R+=8}if(Te-=Ce,e.total_out+=Te,F.total+=Te,Te&&(e.adler=F.check=F.flags?r(F.check,be,Te,Se-Te):n(F.check,be,Te,Se-Te)),Te=Ce,(F.flags?L:ye(L))!==F.check){e.msg=`incorrect data check`,F.mode=me;break}L=0,R=0}F.mode=fe;case fe:if(F.wrap&&F.flags){for(;R<32;){if(I===0)break inf_leave;I--,L+=ve[xe++]<<R,R+=8}if(L!==(F.total|0)){e.msg=`incorrect length check`,F.mode=me;break}L=0,R=0}F.mode=pe;case pe:Re=p;break inf_leave;case me:Re=g;break inf_leave;case he:return _;case ge:default:return h}return e.next_out=Se,e.avail_out=Ce,e.next_in=xe,e.avail_in=I,F.hold=L,F.bits=R,(F.wsize||Te!==e.avail_out&&F.mode<me&&(F.mode<de||_e!==l))&&De(e,e.output,e.next_out,Te-e.avail_out)?(F.mode=he,_):(we-=e.avail_in,Te-=e.avail_out,e.total_in+=we,e.total_out+=Te,F.total+=Te,F.wrap&&Te&&(e.adler=F.check=F.flags?r(F.check,be,Te,e.next_out-Te):n(F.check,be,Te,e.next_out-Te)),e.data_type=F.bits+(F.last?64:0)+(F.mode===j?128:0)+(F.mode===ie||F.mode===P?256:0),(we===0&&Te===0||_e===l)&&Re===f&&(Re=v),Re)}function Oe(e){if(!e||!e.state)return h;var t=e.state;return t.window&&=null,e.state=null,f}function ke(e,t){var n;return!e||!e.state||(n=e.state,!(n.wrap&2))?h:(n.head=t,t.done=!1,f)}function Ae(e,t){var r=t.length,i,a,o;return!e||!e.state||(i=e.state,i.wrap!==0&&i.mode!==A)?h:i.mode===A&&(a=1,a=n(a,t,r,0),a!==i.check)?g:(o=De(e,t,r,r),o?(i.mode=he,_):(i.havedict=1,f))}e.inflateReset=Se,e.inflateReset2=I,e.inflateResetKeep=xe,e.inflateInit=L,e.inflateInit2=Ce,e.inflate=z,e.inflateEnd=Oe,e.inflateGetHeader=ke,e.inflateSetDictionary=Ae,e.inflateInfo=`pako inflate (from Nodeca project)`})),sg=c(((e,t)=>{t.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}})),cg=c(((e,t)=>{function n(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name=``,this.comment=``,this.hcrc=0,this.done=!1}t.exports=n})),lg=c((e=>{var t=og(),n=Yh(),r=tg(),i=sg(),a=$h(),o=ng(),s=cg(),c=Object.prototype.toString;function l(e){if(!(this instanceof l))return new l(e);this.options=n.assign({chunkSize:16384,windowBits:0,to:``},e||{});var u=this.options;u.raw&&u.windowBits>=0&&u.windowBits<16&&(u.windowBits=-u.windowBits,u.windowBits===0&&(u.windowBits=-15)),u.windowBits>=0&&u.windowBits<16&&!(e&&e.windowBits)&&(u.windowBits+=32),u.windowBits>15&&u.windowBits<48&&(u.windowBits&15||(u.windowBits|=15)),this.err=0,this.msg=``,this.ended=!1,this.chunks=[],this.strm=new o,this.strm.avail_out=0;var d=t.inflateInit2(this.strm,u.windowBits);if(d!==i.Z_OK||(this.header=new s,t.inflateGetHeader(this.strm,this.header),u.dictionary&&(typeof u.dictionary==`string`?u.dictionary=r.string2buf(u.dictionary):c.call(u.dictionary)===`[object ArrayBuffer]`&&(u.dictionary=new Uint8Array(u.dictionary)),u.raw&&(d=t.inflateSetDictionary(this.strm,u.dictionary),d!==i.Z_OK))))throw Error(a[d])}l.prototype.push=function(e,a){var o=this.strm,s=this.options.chunkSize,l=this.options.dictionary,u,d,f,p,m,h=!1;if(this.ended)return!1;d=a===~~a?a:a===!0?i.Z_FINISH:i.Z_NO_FLUSH,o.input=typeof e==`string`?r.binstring2buf(e):c.call(e)===`[object ArrayBuffer]`?new Uint8Array(e):e,o.next_in=0,o.avail_in=o.input.length;do{if(o.avail_out===0&&(o.output=new n.Buf8(s),o.next_out=0,o.avail_out=s),u=t.inflate(o,i.Z_NO_FLUSH),u===i.Z_NEED_DICT&&l&&(u=t.inflateSetDictionary(this.strm,l)),u===i.Z_BUF_ERROR&&h===!0&&(u=i.Z_OK,h=!1),u!==i.Z_STREAM_END&&u!==i.Z_OK)return this.onEnd(u),this.ended=!0,!1;o.next_out&&(o.avail_out===0||u===i.Z_STREAM_END||o.avail_in===0&&(d===i.Z_FINISH||d===i.Z_SYNC_FLUSH))&&(this.options.to===`string`?(f=r.utf8border(o.output,o.next_out),p=o.next_out-f,m=r.buf2string(o.output,f),o.next_out=p,o.avail_out=s-p,p&&n.arraySet(o.output,o.output,f,p,0),this.onData(m)):this.onData(n.shrinkBuf(o.output,o.next_out))),o.avail_in===0&&o.avail_out===0&&(h=!0)}while((o.avail_in>0||o.avail_out===0)&&u!==i.Z_STREAM_END);return u===i.Z_STREAM_END&&(d=i.Z_FINISH),d===i.Z_FINISH?(u=t.inflateEnd(this.strm),this.onEnd(u),this.ended=!0,u===i.Z_OK):(d===i.Z_SYNC_FLUSH&&(this.onEnd(i.Z_OK),o.avail_out=0),!0)},l.prototype.onData=function(e){this.chunks.push(e)},l.prototype.onEnd=function(e){e===i.Z_OK&&(this.result=this.options.to===`string`?this.chunks.join(``):n.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function u(e,t){var n=new l(t);if(n.push(e,!0),n.err)throw n.msg||a[n.err];return n.result}function d(e,t){return t||={},t.raw=!0,u(e,t)}e.Inflate=l,e.inflate=u,e.inflateRaw=d,e.ungzip=u})),ug=c(((e,t)=>{var n=Yh().assign,r=rg(),i=lg(),a=sg(),o={};n(o,r,i,a),t.exports=o})),dg,fg,pg,mg,hg,gg,_g,vg,yg=s((()=>{for(dg=d(ug()),fg=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,pg=new Uint8Array(256),mg=0;mg<fg.length;mg++)pg[fg.charCodeAt(mg)]=mg;hg=function(e){var t=e.length*.75,n=e.length,r,i=0,a,o,s,c;e[e.length-1]===`=`&&(t--,e[e.length-2]===`=`&&t--);var l=new Uint8Array(t);for(r=0;r<n;r+=4)a=pg[e.charCodeAt(r)],o=pg[e.charCodeAt(r+1)],s=pg[e.charCodeAt(r+2)],c=pg[e.charCodeAt(r+3)],l[i++]=a<<2|o>>4,l[i++]=(o&15)<<4|s>>2,l[i++]=(s&3)<<6|c&63;return l},gg=function(e){for(var t=``,n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return t},_g=function(e){return gg(dg.default.inflate(hg(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FQCNiL1iHccBPV0DHhQH/JW8EW90dkyFKGywCJU0WkVSvSGeiSUODWFFD0HYdPQVoiRgfPMA+/nnRgiAyNYSjpWNQcNSMrtFCUH4ZIRpSCWocFCSuhCEY6hoUClc0WC52BJlCYYLQdhN+hygRRRlo5BKRRLS6oihSqh+ZzzRGG1Mo4Iz1LoP0qsxDGFzk0JE42ji0jCPejomJKCuwil4m5CiRMEUMVSzVLDUstSx1Juc0oVWMpqY295qVltmtWmWW2a1aZZbZrVplltmtWmWW2G1WZYbYbVZlhthtVmWG2G1WZYbYbVZlhtltVmWW2W1WZZbZbVZlltltVmWW2W1QYjQCh7E2aAQHeGhCFgPoNoy8KNb2wxBhmGKBxoUZXlLGsLI6AsftEDHV0wIURVbANLcTKlGGBIKPOAxCmhePCKUwFzAmpDFRQvjA9R06Hq8TONvshgKDCuRAZTXigUxjxNFfKRo3CLhnIJBMFRvMZpqpNBMlQJzGT5WFQMVQI/AikPMIhEU1aDjqJvQwmjSHB05cC9jbYwc5UtAHNLhDw41ha+lEqF4JaH3gmB61SYcqInxTDmQK8v08vjqv4zDf1N0w3Lf4A8/vwPpfK11w==`})),Jg,Yg,Xg,Zg,Qg=s((()=>{yg(),xg(),Cg(),Tg(),Dg(),kg(),jg(),Ng(),Fg(),Lg(),zg(),Vg(),Ug(),Gg(),qg(),Jg={Courier:Eg,"Courier-Bold":bg,"Courier-Oblique":wg,"Courier-BoldOblique":Sg,Helvetica:Pg,"Helvetica-Bold":Og,"Helvetica-Oblique":Mg,"Helvetica-BoldOblique":Ag,"Times-Roman":Hg,"Times-Bold":Ig,"Times-Italic":Bg,"Times-BoldItalic":Rg,Symbol:Wg,ZapfDingbats:Kg},(function(e){e.Courier=`Courier`,e.CourierBold=`Courier-Bold`,e.CourierOblique=`Courier-Oblique`,e.CourierBoldOblique=`Courier-BoldOblique`,e.Helvetica=`Helvetica`,e.HelveticaBold=`Helvetica-Bold`,e.HelveticaOblique=`Helvetica-Oblique`,e.HelveticaBoldOblique=`Helvetica-BoldOblique`,e.TimesRoman=`Times-Roman`,e.TimesRomanBold=`Times-Bold`,e.TimesRomanItalic=`Times-Italic`,e.TimesRomanBoldItalic=`Times-BoldItalic`,e.Symbol=`Symbol`,e.ZapfDingbats=`ZapfDingbats`})(Yg||={}),Xg={},Zg=function(){function e(){var e=this;this.getWidthOfGlyph=function(t){return e.CharWidths[t]},this.getXAxisKerningForPair=function(t,n){return(e.KernPairXAmounts[t]||{})[n]}}return e.load=function(t){var n=Xg[t];if(n)return n;var r=_g(Jg[t]),i=Object.assign(new e,JSON.parse(r));return i.CharWidths=i.CharMetrics.reduce(function(e,t){return e[t.N]=t.WX,e},{}),i.KernPairXAmounts=i.KernPairs.reduce(function(e,t){var n=t[0],r=t[1],i=t[2];return e[n]||(e[n]={}),e[n][r]=i,e},{}),Xg[t]=i,i},e}()})),$g,e_=s((()=>{$g=`eJztWsuy48iN/Ret74KZfHtX47meqfGjPHaXx4/wgpJ4JbooUU1JVXXb0f9u4JwESF13R7TD29koIpFi8gCJBHDA/Pvm+nraTuPmZ3/f5HHzs7/k8WlzvXS7fvPXp02eqyR/2vRfd2N3gqhUUfm0Od9P236+DoczxLWK66fNpZ93/fkGWaOy5mnTnUR67c57lRaZSItM/tnN/XnsX/DfIqg0JOk8HI4UK4BCAFzG+xWCQgXF02Y3nU4dJJVKKrx5mPgKBVMImOvYXY+QKJRCoHzXzxMErQrap810hqaloioF1e0L5kvFUwqe23Hu+Q+1TinWeZnuMwSKrRRsL8Nn/kOxlYLtOnzFWE1Viqmu/eceVioVaylYe1OwVKilQD0PCYgiLRtVcJz4kEItW13mNLi0UsCVAB77KyxTKeJKEPff3rsREkVcCeLD3He3HqArBV0J6G/v/fU2cK1WH23l0e3c7T71N9uUVv/c5i73bWlVs1Y0u5/3srO7aQb2EPUB+eUTva0TYgG5mGbbzZSUkJTpn75ygF4PThhq1SMGMds4HYZdN54n/rdWc8rv02bfH9I2hbqGsKbPnIYzHSc0qmTIxI6nuwpiAIQmU8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xT9dYcVJf7zCSjmbD+Iud2s1NPRb9E+0UICmizb8ZK/+5JOLOulSqwaw5VJr2vB8dSFn89fvv/8H0oq1dA==`})),t_,n_,r_,i_,a_=s((()=>{yg(),e_(),t_=_g($g),n_=JSON.parse(t_),r_=function(){function e(e,t){var n=this;this.canEncodeUnicodeCodePoint=function(e){return e in n.unicodeMappings},this.encodeUnicodeCodePoint=function(e){var t=n.unicodeMappings[e];if(!t){var r=String.fromCharCode(e),i=`0x`+vg(e.toString(16),4,`0`),a=n.name+` cannot encode "`+r+`" (`+i+`)`;throw Error(a)}return{code:t[0],name:t[1]}},this.name=e,this.supportedCodePoints=Object.keys(t).map(Number).sort(function(e,t){return e-t}),this.unicodeMappings=t}return e}(),i_={Symbol:new r_(`Symbol`,n_.symbol),ZapfDingbats:new r_(`ZapfDingbats`,n_.zapfdingbats),WinAnsi:new r_(`WinAnsi`,n_.win1252)}})),o_=s((()=>{Qg(),a_()})),s_,c_,l_,u_,d_=s((()=>{o_(),s_=function(e){return Object.keys(e).map(function(t){return e[t]})},c_=s_(Yg),l_=function(e){return c_.includes(e)},u_=function(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}})),f_,p_,m_,h_,g_,__,v_,y_,b_,x_,K,q,S_,C_,w_,T_,E_,D_,O_=s((()=>{d_(),f_=function(e){return"`"+e+"`"},p_=function(e){return`'`+e+`'`},m_=function(e){var t=typeof e;return t===`string`?p_(e):t===`undefined`?f_(e):e},h_=function(e,t,n){for(var r=Array(n.length),i=0,a=n.length;i<a;i++){var o=n[i];r[i]=m_(o)}var s=r.join(` or `);return f_(t)+` must be one of `+s+`, but was actually `+m_(e)},g_=function(e,t,n){Array.isArray(n)||(n=s_(n));for(var r=0,i=n.length;r<i;r++)if(e===n[r])return;throw TypeError(h_(e,t,n))},__=function(e,t,n){Array.isArray(n)||(n=s_(n)),g_(e,t,n.concat(void 0))},v_=function(e,t,n){Array.isArray(n)||(n=s_(n));for(var r=0,i=e.length;r<i;r++)g_(e[r],t,n)},y_=function(e){return e===null?`null`:e===void 0?`undefined`:typeof e==`string`?`string`:isNaN(e)?`NaN`:typeof e==`number`?`number`:typeof e==`boolean`?`boolean`:typeof e==`symbol`?`symbol`:typeof e==`bigint`?`bigint`:e.constructor&&e.constructor.name?e.constructor.name:e.name?e.name:e.constructor?String(e.constructor):String(e)},b_=function(e,t){return t===`null`?e===null:t===`undefined`?e===void 0:t===`string`?typeof e==`string`:t===`number`?typeof e==`number`&&!isNaN(e):t===`boolean`?typeof e==`boolean`:t===`symbol`?typeof e==`symbol`:t===`bigint`?typeof e==`bigint`:t===Date?e instanceof Date:t===Array?e instanceof Array:t===Uint8Array?e instanceof Uint8Array:t===ArrayBuffer?e instanceof ArrayBuffer:t===Function?e instanceof Function:e instanceof t[0]},x_=function(e,t,n){for(var r=Array(n.length),i=0,a=n.length;i<a;i++){var o=n[i];o===`null`&&(r[i]=f_(`null`)),o===`undefined`&&(r[i]=f_(`undefined`)),o===`string`?r[i]=f_(`string`):o===`number`?r[i]=f_(`number`):o===`boolean`?r[i]=f_(`boolean`):o===`symbol`?r[i]=f_(`symbol`):o===`bigint`?r[i]=f_(`bigint`):o===Array?r[i]=f_(`Array`):o===Uint8Array?r[i]=f_(`Uint8Array`):o===ArrayBuffer?r[i]=f_(`ArrayBuffer`):r[i]=f_(o[1])}var s=r.join(` or `);return f_(t)+` must be of type `+s+`, but was actually of type `+f_(y_(e))},K=function(e,t,n){for(var r=0,i=n.length;r<i;r++)if(b_(e,n[r]))return;throw TypeError(x_(e,t,n))},q=function(e,t,n){K(e,t,n.concat(`undefined`))},S_=function(e,t,n){for(var r=0,i=e.length;r<i;r++)K(e[r],t,n)},C_=function(e,t,n,r){if(K(e,t,[`number`]),K(n,`min`,[`number`]),K(r,`max`,[`number`]),r=Math.max(n,r),e<n||e>r)throw Error(f_(t)+` must be at least `+n+` and at most `+r+`, but was actually `+e)},w_=function(e,t,n,r){K(e,t,[`number`,`undefined`]),typeof e==`number`&&C_(e,t,n,r)},T_=function(e,t,n){if(K(e,t,[`number`]),e%n!==0)throw Error(f_(t)+` must be a multiple of `+n+`, but was actually `+e)},E_=function(e,t){if(!Number.isInteger(e))throw Error(f_(t)+` must be an integer, but was actually `+e)},D_=function(e,t){if(![1,0].includes(Math.sign(e)))throw Error(f_(t)+` must be a positive number or 0, but was actually `+e)}})),k_,A_,j_,M_=s((()=>{for(uh(),k_=new Uint16Array(256),A_=0;A_<256;A_++)k_[A_]=A_;k_[22]=Um(``),k_[24]=Um(`˘`),k_[25]=Um(`ˇ`),k_[26]=Um(`ˆ`),k_[27]=Um(`˙`),k_[28]=Um(`˝`),k_[29]=Um(`˛`),k_[30]=Um(`˚`),k_[31]=Um(`˜`),k_[127]=Um(`�`),k_[128]=Um(`•`),k_[129]=Um(`†`),k_[130]=Um(`‡`),k_[131]=Um(`…`),k_[132]=Um(`—`),k_[133]=Um(`–`),k_[134]=Um(`ƒ`),k_[135]=Um(`⁄`),k_[136]=Um(`‹`),k_[137]=Um(`›`),k_[138]=Um(`−`),k_[139]=Um(`‰`),k_[140]=Um(`„`),k_[141]=Um(`“`),k_[142]=Um(`”`),k_[143]=Um(`‘`),k_[144]=Um(`’`),k_[145]=Um(`‚`),k_[146]=Um(`™`),k_[147]=Um(`fi`),k_[148]=Um(`fl`),k_[149]=Um(`Ł`),k_[150]=Um(`Œ`),k_[151]=Um(`Š`),k_[152]=Um(`Ÿ`),k_[153]=Um(`Ž`),k_[154]=Um(`ı`),k_[155]=Um(`ł`),k_[156]=Um(`œ`),k_[157]=Um(`š`),k_[158]=Um(`ž`),k_[159]=Um(`�`),k_[160]=Um(`€`),k_[173]=Um(`�`),j_=function(e){for(var t=Array(e.length),n=0,r=e.length;n<r;n++)t[n]=k_[e[n]];return String.fromCodePoint.apply(String,t)}})),N_,P_=s((()=>{N_=function(){function e(e){this.populate=e,this.value=void 0}return e.prototype.getValue=function(){return this.value},e.prototype.access=function(){return this.value||=this.populate(),this.value},e.prototype.invalidate=function(){this.value=void 0},e.populatedBy=function(t){return new e(t)},e}()})),F_=s((()=>{wh(),Eh(),uh(),Hh(),Kh(),Jh(),Hm(),d_(),O_(),M_(),P_()})),I_,L_,R_,z_,B_,V_,H_,U_,W_,G_,K_,q_,J_,Y_,X_,Z_,Q_,$_,ev,tv,nv,rv,iv,av,ov,sv,cv,lv=s((()=>{G(),F_(),I_=function(e){W(t,e);function t(t,n){var r=this,i=`Method `+t+`.`+n+`() not implemented`;return r=e.call(this,i)||this,r}return t}(Error),L_=function(e){W(t,e);function t(t){var n=this,r=`Cannot construct `+t+` - it has a private constructor`;return n=e.call(this,r)||this,n}return t}(Error),R_=function(e){W(t,e);function t(t,n){var r=this,i=function(e){return e?.name??e?.constructor?.name},a=`Expected instance of `+(Array.isArray(t)?t.map(i):[i(t)]).join(` or `)+`, `+(`but got instance of `+(n&&i(n)));return r=e.call(this,a)||this,r}return t}(Error),z_=function(e){W(t,e);function t(t){var n=this,r=t+` stream encoding not supported`;return n=e.call(this,r)||this,n}return t}(Error),B_=function(e){W(t,e);function t(t,n){var r=this,i=`Cannot call `+t+`.`+n+`() more than once`;return r=e.call(this,i)||this,r}return t}(Error),function(e){W(t,e);function t(t){var n=this,r=`Missing catalog (ref=`+t+`)`;return n=e.call(this,r)||this,n}return t}(Error),V_=function(e){W(t,e);function t(){var t=this;return t=e.call(this,`Can't embed page with missing Contents`)||this,t}return t}(Error),H_=function(e){W(t,e);function t(t){var n=this,r=`Unrecognized stream type: `+(t?.contructor?.name??t?.name??t);return n=e.call(this,r)||this,n}return t}(Error),U_=function(e){W(t,e);function t(){var t=this;return t=e.call(this,"Found mismatched contexts while embedding pages. All pages in the array passed to `PDFDocument.embedPages()` must be from the same document.")||this,t}return t}(Error),W_=function(e){W(t,e);function t(t){var n=this,r=`Attempted to convert PDFArray with `+t+` elements to rectangle, but must have exactly 4 elements.`;return n=e.call(this,r)||this,n}return t}(Error),G_=function(e){W(t,e);function t(t){var n=this,r=`Attempted to convert "`+t+`" to a date, but it does not match the PDF date string format.`;return n=e.call(this,r)||this,n}return t}(Error),K_=function(e){W(t,e);function t(t,n){var r=this,i=`Invalid targetIndex specified: targetIndex=`+t+` must be less than Count=`+n;return r=e.call(this,i)||this,r}return t}(Error),q_=function(e){W(t,e);function t(t,n){var r=this,i=`Failed to `+n+` at targetIndex=`+t+` due to corrupt page tree: It is likely that one or more 'Count' entries are invalid`;return r=e.call(this,i)||this,r}return t}(Error),J_=function(e){W(t,e);function t(t,n,r){var i=this,a=`index should be at least `+n+` and at most `+r+`, but was actually `+t;return i=e.call(this,a)||this,i}return t}(Error),Y_=function(e){W(t,e);function t(){var t=this;return t=e.call(this,`Attempted to set invalid field value`)||this,t}return t}(Error),X_=function(e){W(t,e);function t(){var t=this;return t=e.call(this,`Attempted to select multiple values for single-select field`)||this,t}return t}(Error),Z_=function(e){W(t,e);function t(t){var n=this,r=`No /DA (default appearance) entry found for field: `+t;return n=e.call(this,r)||this,n}return t}(Error),Q_=function(e){W(t,e);function t(t){var n=this,r=`No Tf operator found for DA of field: `+t;return n=e.call(this,r)||this,n}return t}(Error),$_=function(e){W(t,e);function t(t,n){var r=this,i=`Failed to parse number `+(`(line:`+t.line+` col:`+t.column+` offset=`+t.offset+`): "`+n+`"`);return r=e.call(this,i)||this,r}return t}(Error),ev=function(e){W(t,e);function t(t,n){var r=this,i=`Failed to parse PDF document `+(`(line:`+t.line+` col:`+t.column+` offset=`+t.offset+`): `+n);return r=e.call(this,i)||this,r}return t}(Error),tv=function(e){W(t,e);function t(t,n,r){var i=this,a=`Expected next byte to be `+n+` but it was actually `+r;return i=e.call(this,t,a)||this,i}return t}(ev),nv=function(e){W(t,e);function t(t,n){var r=this,i=`Failed to parse PDF object starting with the following byte: `+n;return r=e.call(this,t,i)||this,r}return t}(ev),rv=function(e){W(t,e);function t(t){var n=this;return n=e.call(this,t,`Failed to parse invalid PDF object`)||this,n}return t}(ev),iv=function(e){W(t,e);function t(t){var n=this;return n=e.call(this,t,`Failed to parse PDF stream`)||this,n}return t}(ev),av=function(e){W(t,e);function t(t){var n=this;return n=e.call(this,t,`Failed to parse PDF literal string due to unbalanced parenthesis`)||this,n}return t}(ev),ov=function(e){W(t,e);function t(t){var n=this;return n=e.call(this,t,`Parser stalled`)||this,n}return t}(ev),sv=function(e){W(t,e);function t(t){var n=this;return n=e.call(this,t,`No PDF header found`)||this,n}return t}(ev),cv=function(e){W(t,e);function t(t,n){var r=this,i=`Did not find expected keyword '`+hh(n)+`'`;return r=e.call(this,t,i)||this,r}return t}(ev)})),uv,J,dv=s((()=>{(function(e){e[e.Null=0]=`Null`,e[e.Backspace=8]=`Backspace`,e[e.Tab=9]=`Tab`,e[e.Newline=10]=`Newline`,e[e.FormFeed=12]=`FormFeed`,e[e.CarriageReturn=13]=`CarriageReturn`,e[e.Space=32]=`Space`,e[e.ExclamationPoint=33]=`ExclamationPoint`,e[e.Hash=35]=`Hash`,e[e.Percent=37]=`Percent`,e[e.LeftParen=40]=`LeftParen`,e[e.RightParen=41]=`RightParen`,e[e.Plus=43]=`Plus`,e[e.Minus=45]=`Minus`,e[e.Dash=45]=`Dash`,e[e.Period=46]=`Period`,e[e.ForwardSlash=47]=`ForwardSlash`,e[e.Zero=48]=`Zero`,e[e.One=49]=`One`,e[e.Two=50]=`Two`,e[e.Three=51]=`Three`,e[e.Four=52]=`Four`,e[e.Five=53]=`Five`,e[e.Six=54]=`Six`,e[e.Seven=55]=`Seven`,e[e.Eight=56]=`Eight`,e[e.Nine=57]=`Nine`,e[e.LessThan=60]=`LessThan`,e[e.GreaterThan=62]=`GreaterThan`,e[e.A=65]=`A`,e[e.D=68]=`D`,e[e.E=69]=`E`,e[e.F=70]=`F`,e[e.O=79]=`O`,e[e.P=80]=`P`,e[e.R=82]=`R`,e[e.LeftSquareBracket=91]=`LeftSquareBracket`,e[e.BackSlash=92]=`BackSlash`,e[e.RightSquareBracket=93]=`RightSquareBracket`,e[e.a=97]=`a`,e[e.b=98]=`b`,e[e.d=100]=`d`,e[e.e=101]=`e`,e[e.f=102]=`f`,e[e.i=105]=`i`,e[e.j=106]=`j`,e[e.l=108]=`l`,e[e.m=109]=`m`,e[e.n=110]=`n`,e[e.o=111]=`o`,e[e.r=114]=`r`,e[e.s=115]=`s`,e[e.t=116]=`t`,e[e.u=117]=`u`,e[e.x=120]=`x`,e[e.LeftCurly=123]=`LeftCurly`,e[e.RightCurly=125]=`RightCurly`,e[e.Tilde=126]=`Tilde`})(uv||={}),J=uv})),fv,pv=s((()=>{dv(),F_(),fv=function(){function e(e,t){this.major=String(e),this.minor=String(t)}return e.prototype.toString=function(){var e=qm(129);return`%PDF-`+this.major+`.`+this.minor+`
982
+ %`+e+e+e+e},e.prototype.sizeInBytes=function(){return 12+this.major.length+this.minor.length},e.prototype.copyBytesInto=function(e,t){var n=t;return e[t++]=J.Percent,e[t++]=J.P,e[t++]=J.D,e[t++]=J.F,e[t++]=J.Dash,t+=Xm(this.major,e,t),e[t++]=J.Period,t+=Xm(this.minor,e,t),e[t++]=J.Newline,e[t++]=J.Percent,e[t++]=129,e[t++]=129,e[t++]=129,e[t++]=129,t-n},e.forVersion=function(t,n){return new e(t,n)},e}()})),mv,hv=s((()=>{lv(),mv=function(){function e(){}return e.prototype.clone=function(e){throw new I_(this.constructor.name,`clone`)},e.prototype.toString=function(){throw new I_(this.constructor.name,`toString`)},e.prototype.sizeInBytes=function(){throw new I_(this.constructor.name,`sizeInBytes`)},e.prototype.copyBytesInto=function(e,t){throw new I_(this.constructor.name,`copyBytesInto`)},e}()})),gv,_v=s((()=>{G(),F_(),hv(),gv=function(e){W(t,e);function t(t){var n=e.call(this)||this;return n.numberValue=t,n.stringValue=Uh(t),n}return t.prototype.asNumber=function(){return this.numberValue},t.prototype.value=function(){return this.numberValue},t.prototype.clone=function(){return t.of(this.numberValue)},t.prototype.toString=function(){return this.stringValue},t.prototype.sizeInBytes=function(){return this.stringValue.length},t.prototype.copyBytesInto=function(e,t){return t+=Xm(this.stringValue,e,t),this.stringValue.length},t.of=function(e){return new t(e)},t}(mv)})),Y,vv=s((()=>{G(),_v(),hv(),dv(),lv(),Y=function(e){W(t,e);function t(t){var n=e.call(this)||this;return n.array=[],n.context=t,n}return t.prototype.size=function(){return this.array.length},t.prototype.push=function(e){this.array.push(e)},t.prototype.insert=function(e,t){this.array.splice(e,0,t)},t.prototype.indexOf=function(e){var t=this.array.indexOf(e);return t===-1?void 0:t},t.prototype.remove=function(e){this.array.splice(e,1)},t.prototype.set=function(e,t){this.array[e]=t},t.prototype.get=function(e){return this.array[e]},t.prototype.lookupMaybe=function(e){for(var t,n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];return(t=this.context).lookupMaybe.apply(t,Mm([this.get(e)],n))},t.prototype.lookup=function(e){for(var t,n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];return(t=this.context).lookup.apply(t,Mm([this.get(e)],n))},t.prototype.asRectangle=function(){if(this.size()!==4)throw new W_(this.size());var e=this.lookup(0,gv).asNumber(),t=this.lookup(1,gv).asNumber(),n=this.lookup(2,gv).asNumber(),r=this.lookup(3,gv).asNumber();return{x:e,y:t,width:n-e,height:r-t}},t.prototype.asArray=function(){return this.array.slice()},t.prototype.clone=function(e){for(var n=t.withContext(e||this.context),r=0,i=this.size();r<i;r++)n.push(this.array[r]);return n},t.prototype.toString=function(){for(var e=`[ `,t=0,n=this.size();t<n;t++)e+=this.get(t).toString(),e+=` `;return e+=`]`,e},t.prototype.sizeInBytes=function(){for(var e=3,t=0,n=this.size();t<n;t++)e+=this.get(t).sizeInBytes()+1;return e},t.prototype.copyBytesInto=function(e,t){var n=t;e[t++]=J.LeftSquareBracket,e[t++]=J.Space;for(var r=0,i=this.size();r<i;r++)t+=this.get(r).copyBytesInto(e,t),e[t++]=J.Space;return e[t++]=J.RightSquareBracket,t-n},t.prototype.scalePDFNumbers=function(e,t){for(var n=0,r=this.size();n<r;n++){var i=this.lookup(n);if(i instanceof gv){var a=n%2==0?e:t;this.set(n,gv.of(i.asNumber()*a))}}},t.withContext=function(e){return new t(e)},t}(mv)})),yv,bv,xv=s((()=>{G(),lv(),hv(),dv(),yv={},bv=function(e){W(t,e);function t(t,n){var r=this;if(t!==yv)throw new L_(`PDFBool`);return r=e.call(this)||this,r.value=n,r}return t.prototype.asBoolean=function(){return this.value},t.prototype.clone=function(){return this},t.prototype.toString=function(){return String(this.value)},t.prototype.sizeInBytes=function(){return this.value?4:5},t.prototype.copyBytesInto=function(e,t){return this.value?(e[t++]=J.t,e[t++]=J.r,e[t++]=J.u,e[t++]=J.e,4):(e[t++]=J.f,e[t++]=J.a,e[t++]=J.l,e[t++]=J.s,e[t++]=J.e,5)},t.True=new t(yv,!0),t.False=new t(yv,!1),t}(mv)})),Sv,Cv=s((()=>{dv(),Sv=new Uint8Array(256),Sv[J.LeftParen]=1,Sv[J.RightParen]=1,Sv[J.LessThan]=1,Sv[J.GreaterThan]=1,Sv[J.LeftSquareBracket]=1,Sv[J.RightSquareBracket]=1,Sv[J.LeftCurly]=1,Sv[J.RightCurly]=1,Sv[J.ForwardSlash]=1,Sv[J.Percent]=1})),wv,Tv=s((()=>{dv(),wv=new Uint8Array(256),wv[J.Null]=1,wv[J.Tab]=1,wv[J.Newline]=1,wv[J.FormFeed]=1,wv[J.CarriageReturn]=1,wv[J.Space]=1})),Ev,Dv,Ov,kv=s((()=>{for(dv(),Cv(),Tv(),Ev=new Uint8Array(256),Dv=0,Ov=256;Dv<Ov;Dv++)Ev[Dv]=wv[Dv]||Sv[Dv]?1:0;Ev[J.Hash]=1})),Av,jv,Mv,Nv,X,Pv=s((()=>{G(),lv(),hv(),dv(),kv(),F_(),Av=function(e){return e.replace(/#([\dABCDEF]{2})/g,function(e,t){return Jm(t)})},jv=function(e){return e>=J.ExclamationPoint&&e<=J.Tilde&&!Ev[e]},Mv={},Nv=new Map,X=function(e){W(t,e);function t(t,n){var r=this;if(t!==Mv)throw new L_(`PDFName`);r=e.call(this)||this;for(var i=`/`,a=0,o=n.length;a<o;a++){var s=n[a],c=Um(s);i+=jv(c)?s:`#`+Km(c)}return r.encodedName=i,r}return t.prototype.asBytes=function(){for(var e=[],t=``,n=!1,r=function(t){t!==void 0&&e.push(t),n=!1},i=1,a=this.encodedName.length;i<a;i++){var o=this.encodedName[i],s=Um(o),c=this.encodedName[i+1];n?s>=J.Zero&&s<=J.Nine||s>=J.a&&s<=J.f||s>=J.A&&s<=J.F?(t+=o,t.length!==2&&(c>=`0`&&c<=`9`||c>=`a`&&c<=`f`||c>=`A`&&c<=`F`)||(r(parseInt(t,16)),t=``)):r(s):s===J.Hash?n=!0:r(s)}return new Uint8Array(e)},t.prototype.decodeText=function(){var e=this.asBytes();return String.fromCharCode.apply(String,Array.from(e))},t.prototype.asString=function(){return this.encodedName},t.prototype.value=function(){return this.encodedName},t.prototype.clone=function(){return this},t.prototype.toString=function(){return this.encodedName},t.prototype.sizeInBytes=function(){return this.encodedName.length},t.prototype.copyBytesInto=function(e,t){return t+=Xm(this.encodedName,e,t),this.encodedName.length},t.of=function(e){var n=Av(e),r=Nv.get(n);return r||(r=new t(Mv,n),Nv.set(n,r)),r},t.Length=t.of(`Length`),t.FlateDecode=t.of(`FlateDecode`),t.Resources=t.of(`Resources`),t.Font=t.of(`Font`),t.XObject=t.of(`XObject`),t.ExtGState=t.of(`ExtGState`),t.Contents=t.of(`Contents`),t.Type=t.of(`Type`),t.Parent=t.of(`Parent`),t.MediaBox=t.of(`MediaBox`),t.Page=t.of(`Page`),t.Annots=t.of(`Annots`),t.TrimBox=t.of(`TrimBox`),t.ArtBox=t.of(`ArtBox`),t.BleedBox=t.of(`BleedBox`),t.CropBox=t.of(`CropBox`),t.Rotate=t.of(`Rotate`),t.Title=t.of(`Title`),t.Author=t.of(`Author`),t.Subject=t.of(`Subject`),t.Creator=t.of(`Creator`),t.Keywords=t.of(`Keywords`),t.Producer=t.of(`Producer`),t.CreationDate=t.of(`CreationDate`),t.ModDate=t.of(`ModDate`),t}(mv)})),Fv,Iv,Lv=s((()=>{G(),hv(),dv(),Fv=function(e){W(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.asNull=function(){return null},t.prototype.clone=function(){return this},t.prototype.toString=function(){return`null`},t.prototype.sizeInBytes=function(){return 4},t.prototype.copyBytesInto=function(e,t){return e[t++]=J.n,e[t++]=J.u,e[t++]=J.l,e[t++]=J.l,4},t}(mv),Iv=new Fv})),Z,Rv=s((()=>{G(),Pv(),Lv(),hv(),dv(),Z=function(e){W(t,e);function t(t,n){var r=e.call(this)||this;return r.dict=t,r.context=n,r}return t.prototype.keys=function(){return Array.from(this.dict.keys())},t.prototype.values=function(){return Array.from(this.dict.values())},t.prototype.entries=function(){return Array.from(this.dict.entries())},t.prototype.set=function(e,t){this.dict.set(e,t)},t.prototype.get=function(e,t){t===void 0&&(t=!1);var n=this.dict.get(e);if(n!==Iv||t)return n},t.prototype.has=function(e){var t=this.dict.get(e);return t!==void 0&&t!==Iv},t.prototype.lookupMaybe=function(e){for(var t,n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];var i=n.includes(Iv),a=(t=this.context).lookupMaybe.apply(t,Mm([this.get(e,i)],n));if(a!==Iv||i)return a},t.prototype.lookup=function(e){for(var t,n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];var i=n.includes(Iv),a=(t=this.context).lookup.apply(t,Mm([this.get(e,i)],n));if(a!==Iv||i)return a},t.prototype.delete=function(e){return this.dict.delete(e)},t.prototype.asMap=function(){return new Map(this.dict)},t.prototype.uniqueKey=function(e){e===void 0&&(e=``);for(var t=this.keys(),n=X.of(this.context.addRandomSuffix(e,10));t.includes(n);)n=X.of(this.context.addRandomSuffix(e,10));return n},t.prototype.clone=function(e){for(var n=t.withContext(e||this.context),r=this.entries(),i=0,a=r.length;i<a;i++){var o=r[i],s=o[0],c=o[1];n.set(s,c)}return n},t.prototype.toString=function(){for(var e=`<<
983
+ `,t=this.entries(),n=0,r=t.length;n<r;n++){var i=t[n],a=i[0],o=i[1];e+=a.toString()+` `+o.toString()+`
984
+ `}return e+=`>>`,e},t.prototype.sizeInBytes=function(){for(var e=5,t=this.entries(),n=0,r=t.length;n<r;n++){var i=t[n],a=i[0],o=i[1];e+=a.sizeInBytes()+o.sizeInBytes()+2}return e},t.prototype.copyBytesInto=function(e,t){var n=t;e[t++]=J.LessThan,e[t++]=J.LessThan,e[t++]=J.Newline;for(var r=this.entries(),i=0,a=r.length;i<a;i++){var o=r[i],s=o[0],c=o[1];t+=s.copyBytesInto(e,t),e[t++]=J.Space,t+=c.copyBytesInto(e,t),e[t++]=J.Newline}return e[t++]=J.GreaterThan,e[t++]=J.GreaterThan,t-n},t.withContext=function(e){return new t(new Map,e)},t.fromMapWithContext=function(e,n){return new t(e,n)},t}(mv)})),zv,Bv=s((()=>{G(),lv(),Pv(),_v(),hv(),dv(),zv=function(e){W(t,e);function t(t){var n=e.call(this)||this;return n.dict=t,n}return t.prototype.clone=function(e){throw new I_(this.constructor.name,`clone`)},t.prototype.getContentsString=function(){throw new I_(this.constructor.name,`getContentsString`)},t.prototype.getContents=function(){throw new I_(this.constructor.name,`getContents`)},t.prototype.getContentsSize=function(){throw new I_(this.constructor.name,`getContentsSize`)},t.prototype.updateDict=function(){var e=this.getContentsSize();this.dict.set(X.Length,gv.of(e))},t.prototype.sizeInBytes=function(){return this.updateDict(),this.dict.sizeInBytes()+this.getContentsSize()+18},t.prototype.toString=function(){this.updateDict();var e=this.dict.toString();return e+=`
985
+ stream
986
+ `,e+=this.getContentsString(),e+=`
987
+ endstream`,e},t.prototype.copyBytesInto=function(e,t){this.updateDict();var n=t;t+=this.dict.copyBytesInto(e,t),e[t++]=J.Newline,e[t++]=J.s,e[t++]=J.t,e[t++]=J.r,e[t++]=J.e,e[t++]=J.a,e[t++]=J.m,e[t++]=J.Newline;for(var r=this.getContents(),i=0,a=r.length;i<a;i++)e[t++]=r[i];return e[t++]=J.Newline,e[t++]=J.e,e[t++]=J.n,e[t++]=J.d,e[t++]=J.s,e[t++]=J.t,e[t++]=J.r,e[t++]=J.e,e[t++]=J.a,e[t++]=J.m,t-n},t}(mv)})),Vv,Hv=s((()=>{G(),Bv(),F_(),Vv=function(e){W(t,e);function t(t,n){var r=e.call(this,t)||this;return r.contents=n,r}return t.prototype.asUint8Array=function(){return this.contents.slice()},t.prototype.clone=function(e){return t.of(this.dict.clone(e),this.contents.slice())},t.prototype.getContentsString=function(){return hh(this.contents)},t.prototype.getContents=function(){return this.contents},t.prototype.getContentsSize=function(){return this.contents.length},t.of=function(e,n){return new t(e,n)},t}(zv)})),Uv,Wv,Gv,Kv=s((()=>{G(),lv(),hv(),F_(),Uv={},Wv=new Map,Gv=function(e){W(t,e);function t(t,n,r){var i=this;if(t!==Uv)throw new L_(`PDFRef`);return i=e.call(this)||this,i.objectNumber=n,i.generationNumber=r,i.tag=n+` `+r+` R`,i}return t.prototype.clone=function(){return this},t.prototype.toString=function(){return this.tag},t.prototype.sizeInBytes=function(){return this.tag.length},t.prototype.copyBytesInto=function(e,t){return t+=Xm(this.tag,e,t),this.tag.length},t.of=function(e,n){n===void 0&&(n=0);var r=e+` `+n+` R`,i=Wv.get(r);return i||(i=new t(Uv,e,n),Wv.set(r,i)),i},t}(mv)})),qv,Jv=s((()=>{hv(),dv(),F_(),qv=function(){function e(e,t){this.name=e,this.args=t||[]}return e.prototype.clone=function(t){for(var n=Array(this.args.length),r=0,i=n.length;r<i;r++){var a=this.args[r];n[r]=a instanceof mv?a.clone(t):a}return e.of(this.name,n)},e.prototype.toString=function(){for(var e=``,t=0,n=this.args.length;t<n;t++)e+=String(this.args[t])+` `;return e+=this.name,e},e.prototype.sizeInBytes=function(){for(var e=0,t=0,n=this.args.length;t<n;t++){var r=this.args[t];e+=(r instanceof mv?r.sizeInBytes():r.length)+1}return e+=this.name.length,e},e.prototype.copyBytesInto=function(e,t){for(var n=t,r=0,i=this.args.length;r<i;r++){var a=this.args[r];a instanceof mv?t+=a.copyBytesInto(e,t):t+=Xm(a,e,t),e[t++]=J.Space}return t+=Xm(this.name,e,t),t-n},e.of=function(t,n){return new e(t,n)},e}()})),Yv,Xv,Zv=s((()=>{(function(e){e.NonStrokingColor=`sc`,e.NonStrokingColorN=`scn`,e.NonStrokingColorRgb=`rg`,e.NonStrokingColorGray=`g`,e.NonStrokingColorCmyk=`k`,e.NonStrokingColorspace=`cs`,e.StrokingColor=`SC`,e.StrokingColorN=`SCN`,e.StrokingColorRgb=`RG`,e.StrokingColorGray=`G`,e.StrokingColorCmyk=`K`,e.StrokingColorspace=`CS`,e.BeginMarkedContentSequence=`BDC`,e.BeginMarkedContent=`BMC`,e.EndMarkedContent=`EMC`,e.MarkedContentPointWithProps=`DP`,e.MarkedContentPoint=`MP`,e.DrawObject=`Do`,e.ConcatTransformationMatrix=`cm`,e.PopGraphicsState=`Q`,e.PushGraphicsState=`q`,e.SetFlatness=`i`,e.SetGraphicsStateParams=`gs`,e.SetLineCapStyle=`J`,e.SetLineDashPattern=`d`,e.SetLineJoinStyle=`j`,e.SetLineMiterLimit=`M`,e.SetLineWidth=`w`,e.SetTextMatrix=`Tm`,e.SetRenderingIntent=`ri`,e.AppendRectangle=`re`,e.BeginInlineImage=`BI`,e.BeginInlineImageData=`ID`,e.EndInlineImage=`EI`,e.ClipEvenOdd=`W*`,e.ClipNonZero=`W`,e.CloseAndStroke=`s`,e.CloseFillEvenOddAndStroke=`b*`,e.CloseFillNonZeroAndStroke=`b`,e.ClosePath=`h`,e.AppendBezierCurve=`c`,e.CurveToReplicateFinalPoint=`y`,e.CurveToReplicateInitialPoint=`v`,e.EndPath=`n`,e.FillEvenOddAndStroke=`B*`,e.FillEvenOdd=`f*`,e.FillNonZeroAndStroke=`B`,e.FillNonZero=`f`,e.LegacyFillNonZero=`F`,e.LineTo=`l`,e.MoveTo=`m`,e.ShadingFill=`sh`,e.StrokePath=`S`,e.BeginText=`BT`,e.EndText=`ET`,e.MoveText=`Td`,e.MoveTextSetLeading=`TD`,e.NextLine=`T*`,e.SetCharacterSpacing=`Tc`,e.SetFontAndSize=`Tf`,e.SetTextHorizontalScaling=`Tz`,e.SetTextLineHeight=`TL`,e.SetTextRenderingMode=`Tr`,e.SetTextRise=`Ts`,e.SetWordSpacing=`Tw`,e.ShowText=`Tj`,e.ShowTextAdjusted=`TJ`,e.ShowTextLine=`'`,e.ShowTextLineAndSpace=`"`,e.Type3D0=`d0`,e.Type3D1=`d1`,e.BeginCompatibilitySection=`BX`,e.EndCompatibilitySection=`EX`})(Yv||={}),Xv=Yv})),Qv,$v,ey=s((()=>{G(),Qv=d(ug()),lv(),Pv(),Bv(),F_(),$v=function(e){W(t,e);function t(t,n){var r=e.call(this,t)||this;return r.computeContents=function(){var e=r.getUnencodedContents();return r.encode?Qv.default.deflate(e):e},r.encode=n,n&&t.set(X.of(`Filter`),X.of(`FlateDecode`)),r.contentsCache=N_.populatedBy(r.computeContents),r}return t.prototype.getContents=function(){return this.contentsCache.access()},t.prototype.getContentsSize=function(){return this.contentsCache.access().length},t.prototype.getUnencodedContents=function(){throw new I_(this.constructor.name,`getUnencodedContents`)},t}(zv)})),ty,ny=s((()=>{G(),ey(),dv(),ty=function(e){W(t,e);function t(t,n,r){r===void 0&&(r=!0);var i=e.call(this,t,r)||this;return i.operators=n,i}return t.prototype.push=function(){for(var e,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];(e=this.operators).push.apply(e,t)},t.prototype.clone=function(e){for(var n=Array(this.operators.length),r=0,i=this.operators.length;r<i;r++)n[r]=this.operators[r].clone(e);var a=this,o=a.dict,s=a.encode;return t.of(o.clone(e),n,s)},t.prototype.getContentsString=function(){for(var e=``,t=0,n=this.operators.length;t<n;t++)e+=this.operators[t]+`
988
+ `;return e},t.prototype.getUnencodedContents=function(){for(var e=new Uint8Array(this.getUnencodedContentsSize()),t=0,n=0,r=this.operators.length;n<r;n++)t+=this.operators[n].copyBytesInto(e,t),e[t++]=J.Newline;return e},t.prototype.getUnencodedContentsSize=function(){for(var e=0,t=0,n=this.operators.length;t<n;t++)e+=this.operators[t].sizeInBytes()+1;return e},t.of=function(e,n,r){return r===void 0&&(r=!0),new t(e,n,r)},t}($v)})),ry,iy=s((()=>{ry=function(){function e(e){this.seed=e}return e.prototype.nextInt=function(){var e=Math.sin(this.seed++)*1e4;return e-Math.floor(e)},e.withSeed=function(t){return new e(t)},e}()})),ay,oy,sy,cy=s((()=>{G(),ay=d(ug()),pv(),lv(),vv(),xv(),Rv(),Pv(),Lv(),_v(),hv(),Hv(),Kv(),Jv(),Zv(),ny(),F_(),iy(),oy=function(e,t){var n=e[0],r=t[0];return n.objectNumber-r.objectNumber},sy=function(){function e(){this.largestObjectNumber=0,this.header=fv.forVersion(1,7),this.trailerInfo={},this.indirectObjects=new Map,this.rng=ry.withSeed(1)}return e.prototype.assign=function(e,t){this.indirectObjects.set(e,t),e.objectNumber>this.largestObjectNumber&&(this.largestObjectNumber=e.objectNumber)},e.prototype.nextRef=function(){return this.largestObjectNumber+=1,Gv.of(this.largestObjectNumber)},e.prototype.register=function(e){var t=this.nextRef();return this.assign(t,e),t},e.prototype.delete=function(e){return this.indirectObjects.delete(e)},e.prototype.lookupMaybe=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=t.includes(Iv),i=e instanceof Gv?this.indirectObjects.get(e):e;if(i&&(i!==Iv||r)){for(var a=0,o=t.length;a<o;a++){var s=t[a];if(s===Iv){if(i===Iv)return i}else if(i instanceof s)return i}throw new R_(t,i)}},e.prototype.lookup=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=e instanceof Gv?this.indirectObjects.get(e):e;if(t.length===0)return r;for(var i=0,a=t.length;i<a;i++){var o=t[i];if(o===Iv){if(r===Iv)return r}else if(r instanceof o)return r}throw new R_(t,r)},e.prototype.getObjectRef=function(e){for(var t=Array.from(this.indirectObjects.entries()),n=0,r=t.length;n<r;n++){var i=t[n],a=i[0];if(i[1]===e)return a}},e.prototype.enumerateIndirectObjects=function(){return Array.from(this.indirectObjects.entries()).sort(oy)},e.prototype.obj=function(e){if(e instanceof mv)return e;if(e==null)return Iv;if(typeof e==`string`)return X.of(e);if(typeof e==`number`)return gv.of(e);if(typeof e==`boolean`)return e?bv.True:bv.False;if(Array.isArray(e)){for(var t=Y.withContext(this),n=0,r=e.length;n<r;n++)t.push(this.obj(e[n]));return t}for(var i=Z.withContext(this),a=Object.keys(e),n=0,r=a.length;n<r;n++){var o=a[n],s=e[o];s!==void 0&&i.set(X.of(o),this.obj(s))}return i},e.prototype.stream=function(e,t){return t===void 0&&(t={}),Vv.of(this.obj(t),fh(e))},e.prototype.flateStream=function(e,t){return t===void 0&&(t={}),this.stream(ay.default.deflate(fh(e)),Pm(Pm({},t),{Filter:`FlateDecode`}))},e.prototype.contentStream=function(e,t){return t===void 0&&(t={}),ty.of(this.obj(t),e)},e.prototype.formXObject=function(e,t){return t===void 0&&(t={}),this.contentStream(e,Pm(Pm({BBox:this.obj([0,0,0,0]),Matrix:this.obj([1,0,0,1,0,0])},t),{Type:`XObject`,Subtype:`Form`}))},e.prototype.getPushGraphicsStateContentStream=function(){if(this.pushGraphicsStateContentStreamRef)return this.pushGraphicsStateContentStreamRef;var e=this.obj({}),t=qv.of(Xv.PushGraphicsState),n=ty.of(e,[t]);return this.pushGraphicsStateContentStreamRef=this.register(n),this.pushGraphicsStateContentStreamRef},e.prototype.getPopGraphicsStateContentStream=function(){if(this.popGraphicsStateContentStreamRef)return this.popGraphicsStateContentStreamRef;var e=this.obj({}),t=qv.of(Xv.PopGraphicsState),n=ty.of(e,[t]);return this.popGraphicsStateContentStreamRef=this.register(n),this.popGraphicsStateContentStreamRef},e.prototype.addRandomSuffix=function(e,t){return t===void 0&&(t=4),e+`-`+Math.floor(this.rng.nextInt()*10**t)},e.create=function(){return new e},e}()})),ly,uy=s((()=>{G(),vv(),Rv(),Pv(),_v(),Bv(),ly=function(e){W(t,e);function t(t,n,r){r===void 0&&(r=!0);var i=e.call(this,t,n)||this;return i.normalized=!1,i.autoNormalizeCTM=r,i}return t.prototype.clone=function(e){for(var n=t.fromMapWithContext(new Map,e||this.context,this.autoNormalizeCTM),r=this.entries(),i=0,a=r.length;i<a;i++){var o=r[i],s=o[0],c=o[1];n.set(s,c)}return n},t.prototype.Parent=function(){return this.lookupMaybe(X.Parent,Z)},t.prototype.Contents=function(){return this.lookup(X.of(`Contents`))},t.prototype.Annots=function(){return this.lookupMaybe(X.Annots,Y)},t.prototype.BleedBox=function(){return this.lookupMaybe(X.BleedBox,Y)},t.prototype.TrimBox=function(){return this.lookupMaybe(X.TrimBox,Y)},t.prototype.ArtBox=function(){return this.lookupMaybe(X.ArtBox,Y)},t.prototype.Resources=function(){var e=this.getInheritableAttribute(X.Resources);return this.context.lookupMaybe(e,Z)},t.prototype.MediaBox=function(){var e=this.getInheritableAttribute(X.MediaBox);return this.context.lookup(e,Y)},t.prototype.CropBox=function(){var e=this.getInheritableAttribute(X.CropBox);return this.context.lookupMaybe(e,Y)},t.prototype.Rotate=function(){var e=this.getInheritableAttribute(X.Rotate);return this.context.lookupMaybe(e,gv)},t.prototype.getInheritableAttribute=function(e){var t;return this.ascend(function(n){t||=n.get(e)}),t},t.prototype.setParent=function(e){this.set(X.Parent,e)},t.prototype.addContentStream=function(e){var t=this.normalizedEntries().Contents||this.context.obj([]);this.set(X.Contents,t),t.push(e)},t.prototype.wrapContentStreams=function(e,t){var n=this.Contents();return n instanceof Y&&(n.insert(0,e),n.push(t),!0)},t.prototype.addAnnot=function(e){this.normalizedEntries().Annots.push(e)},t.prototype.removeAnnot=function(e){var t=this.normalizedEntries().Annots,n=t.indexOf(e);n!==void 0&&t.remove(n)},t.prototype.setFontDictionary=function(e,t){this.normalizedEntries().Font.set(e,t)},t.prototype.newFontDictionaryKey=function(e){return this.normalizedEntries().Font.uniqueKey(e)},t.prototype.newFontDictionary=function(e,t){var n=this.newFontDictionaryKey(e);return this.setFontDictionary(n,t),n},t.prototype.setXObject=function(e,t){this.normalizedEntries().XObject.set(e,t)},t.prototype.newXObjectKey=function(e){return this.normalizedEntries().XObject.uniqueKey(e)},t.prototype.newXObject=function(e,t){var n=this.newXObjectKey(e);return this.setXObject(n,t),n},t.prototype.setExtGState=function(e,t){this.normalizedEntries().ExtGState.set(e,t)},t.prototype.newExtGStateKey=function(e){return this.normalizedEntries().ExtGState.uniqueKey(e)},t.prototype.newExtGState=function(e,t){var n=this.newExtGStateKey(e);return this.setExtGState(n,t),n},t.prototype.ascend=function(e){e(this);var t=this.Parent();t&&t.ascend(e)},t.prototype.normalize=function(){if(!this.normalized){var e=this.context,t=this.get(X.Contents);this.context.lookup(t)instanceof zv&&this.set(X.Contents,e.obj([t])),this.autoNormalizeCTM&&this.wrapContentStreams(this.context.getPushGraphicsStateContentStream(),this.context.getPopGraphicsStateContentStream());var n=this.getInheritableAttribute(X.Resources),r=e.lookupMaybe(n,Z)||e.obj({});this.set(X.Resources,r);var i=r.lookupMaybe(X.Font,Z)||e.obj({});r.set(X.Font,i);var a=r.lookupMaybe(X.XObject,Z)||e.obj({});r.set(X.XObject,a);var o=r.lookupMaybe(X.ExtGState,Z)||e.obj({});r.set(X.ExtGState,o);var s=this.Annots()||e.obj([]);this.set(X.Annots,s),this.normalized=!0}},t.prototype.normalizedEntries=function(){this.normalize();var e=this.Annots(),t=this.Resources();return{Annots:e,Resources:t,Contents:this.Contents(),Font:t.lookup(X.Font,Z),XObject:t.lookup(X.XObject,Z),ExtGState:t.lookup(X.ExtGState,Z)}},t.InheritableEntries=[`Resources`,`MediaBox`,`CropBox`,`Rotate`],t.withContextAndParent=function(e,n){var r=new Map;return r.set(X.Type,X.Page),r.set(X.Parent,n),r.set(X.Resources,e.obj({})),r.set(X.MediaBox,e.obj([0,0,612,792])),new t(r,e,!1)},t.fromMapWithContext=function(e,n,r){return r===void 0&&(r=!0),new t(e,n,r)},t}(Z)})),dy,fy=s((()=>{vv(),Rv(),Pv(),Kv(),Bv(),uy(),dy=function(){function e(e,t){var n=this;this.traversedObjects=new Map,this.copy=function(e){return e instanceof ly?n.copyPDFPage(e):e instanceof Z?n.copyPDFDict(e):e instanceof Y?n.copyPDFArray(e):e instanceof zv?n.copyPDFStream(e):e instanceof Gv?n.copyPDFIndirectObject(e):e.clone()},this.copyPDFPage=function(e){for(var t=e.clone(),r=ly.InheritableEntries,i=0,a=r.length;i<a;i++){var o=X.of(r[i]),s=t.getInheritableAttribute(o);!t.get(o)&&s&&t.set(o,s)}return t.delete(X.of(`Parent`)),n.copyPDFDict(t)},this.copyPDFDict=function(e){if(n.traversedObjects.has(e))return n.traversedObjects.get(e);var t=e.clone(n.dest);n.traversedObjects.set(e,t);for(var r=e.entries(),i=0,a=r.length;i<a;i++){var o=r[i],s=o[0],c=o[1];t.set(s,n.copy(c))}return t},this.copyPDFArray=function(e){if(n.traversedObjects.has(e))return n.traversedObjects.get(e);var t=e.clone(n.dest);n.traversedObjects.set(e,t);for(var r=0,i=e.size();r<i;r++){var a=e.get(r);t.set(r,n.copy(a))}return t},this.copyPDFStream=function(e){if(n.traversedObjects.has(e))return n.traversedObjects.get(e);var t=e.clone(n.dest);n.traversedObjects.set(e,t);for(var r=e.dict.entries(),i=0,a=r.length;i<a;i++){var o=r[i],s=o[0],c=o[1];t.dict.set(s,n.copy(c))}return t},this.copyPDFIndirectObject=function(e){if(!n.traversedObjects.has(e)){var t=n.dest.nextRef();n.traversedObjects.set(e,t);var r=n.src.lookup(e);if(r){var i=n.copy(r);n.dest.assign(t,i)}}return n.traversedObjects.get(e)},this.src=e,this.dest=t}return e.for=function(t,n){return new e(t,n)},e}()})),py,my=s((()=>{Kv(),dv(),F_(),py=function(){function e(e){this.subsections=e?[[e]]:[],this.chunkIdx=0,this.chunkLength=+!!e}return e.prototype.addEntry=function(e,t){this.append({ref:e,offset:t,deleted:!1})},e.prototype.addDeletedEntry=function(e,t){this.append({ref:e,offset:t,deleted:!0})},e.prototype.toString=function(){for(var e=`xref
989
+ `,t=0,n=this.subsections.length;t<n;t++){var r=this.subsections[t];e+=r[0].ref.objectNumber+` `+r.length+`
990
+ `;for(var i=0,a=r.length;i<a;i++){var o=r[i];e+=Ym(String(o.offset),10,`0`),e+=` `,e+=Ym(String(o.ref.generationNumber),5,`0`),e+=` `,e+=o.deleted?`f`:`n`,e+=`
991
+ `}}return e},e.prototype.sizeInBytes=function(){for(var e=5,t=0,n=this.subsections.length;t<n;t++){var r=this.subsections[t],i=r.length,a=r[0];e+=2,e+=String(a.ref.objectNumber).length,e+=String(i).length,e+=20*i}return e},e.prototype.copyBytesInto=function(e,t){var n=t;return e[t++]=J.x,e[t++]=J.r,e[t++]=J.e,e[t++]=J.f,e[t++]=J.Newline,t+=this.copySubsectionsIntoBuffer(this.subsections,e,t),t-n},e.prototype.copySubsectionsIntoBuffer=function(e,t,n){for(var r=n,i=e.length,a=0;a<i;a++){var o=this.subsections[a],s=String(o[0].ref.objectNumber);n+=Xm(s,t,n),t[n++]=J.Space;var c=String(o.length);n+=Xm(c,t,n),t[n++]=J.Newline,n+=this.copyEntriesIntoBuffer(o,t,n)}return n-r},e.prototype.copyEntriesIntoBuffer=function(e,t,n){for(var r=e.length,i=0;i<r;i++){var a=e[i],o=Ym(String(a.offset),10,`0`);n+=Xm(o,t,n),t[n++]=J.Space;var s=Ym(String(a.ref.generationNumber),5,`0`);n+=Xm(s,t,n),t[n++]=J.Space,t[n++]=a.deleted?J.f:J.n,t[n++]=J.Space,t[n++]=J.Newline}return 20*r},e.prototype.append=function(e){if(this.chunkLength===0)this.subsections.push([e]),this.chunkIdx=0,this.chunkLength=1;else{var t=this.subsections[this.chunkIdx],n=t[this.chunkLength-1];e.ref.objectNumber-n.ref.objectNumber>1?(this.subsections.push([e]),this.chunkIdx+=1,this.chunkLength=1):(t.push(e),this.chunkLength+=1)}},e.create=function(){return new e({ref:Gv.of(0,65535),offset:0,deleted:!0})},e.createEmpty=function(){return new e},e}()})),hy,gy=s((()=>{dv(),F_(),hy=function(){function e(e){this.lastXRefOffset=String(e)}return e.prototype.toString=function(){return`startxref
992
+ `+this.lastXRefOffset+`
993
+ %%EOF`},e.prototype.sizeInBytes=function(){return 16+this.lastXRefOffset.length},e.prototype.copyBytesInto=function(e,t){var n=t;return e[t++]=J.s,e[t++]=J.t,e[t++]=J.a,e[t++]=J.r,e[t++]=J.t,e[t++]=J.x,e[t++]=J.r,e[t++]=J.e,e[t++]=J.f,e[t++]=J.Newline,t+=Xm(this.lastXRefOffset,e,t),e[t++]=J.Newline,e[t++]=J.Percent,e[t++]=J.Percent,e[t++]=J.E,e[t++]=J.O,e[t++]=J.F,t-n},e.forLastCrossRefSectionOffset=function(t){return new e(t)},e}()})),_y,vy=s((()=>{dv(),_y=function(){function e(e){this.dict=e}return e.prototype.toString=function(){return`trailer
994
+ `+this.dict.toString()},e.prototype.sizeInBytes=function(){return 8+this.dict.sizeInBytes()},e.prototype.copyBytesInto=function(e,t){var n=t;return e[t++]=J.t,e[t++]=J.r,e[t++]=J.a,e[t++]=J.i,e[t++]=J.l,e[t++]=J.e,e[t++]=J.r,e[t++]=J.Newline,t+=this.dict.copyBytesInto(e,t),t-n},e.of=function(t){return new e(t)},e}()})),yy,by=s((()=>{G(),Pv(),_v(),ey(),dv(),F_(),yy=function(e){W(t,e);function t(t,n,r){r===void 0&&(r=!0);var i=e.call(this,t.obj({}),r)||this;return i.objects=n,i.offsets=i.computeObjectOffsets(),i.offsetsString=i.computeOffsetsString(),i.dict.set(X.of(`Type`),X.of(`ObjStm`)),i.dict.set(X.of(`N`),gv.of(i.objects.length)),i.dict.set(X.of(`First`),gv.of(i.offsetsString.length)),i}return t.prototype.getObjectsCount=function(){return this.objects.length},t.prototype.clone=function(e){return t.withContextAndObjects(e||this.dict.context,this.objects.slice(),this.encode)},t.prototype.getContentsString=function(){for(var e=this.offsetsString,t=0,n=this.objects.length;t<n;t++){var r=this.objects[t][1];e+=r+`
995
+ `}return e},t.prototype.getUnencodedContents=function(){for(var e=new Uint8Array(this.getUnencodedContentsSize()),t=Xm(this.offsetsString,e,0),n=0,r=this.objects.length;n<r;n++){var i=this.objects[n][1];t+=i.copyBytesInto(e,t),e[t++]=J.Newline}return e},t.prototype.getUnencodedContentsSize=function(){return this.offsetsString.length+dh(this.offsets)[1]+dh(this.objects)[1].sizeInBytes()+1},t.prototype.computeOffsetsString=function(){for(var e=``,t=0,n=this.offsets.length;t<n;t++){var r=this.offsets[t],i=r[0],a=r[1];e+=i+` `+a+` `}return e},t.prototype.computeObjectOffsets=function(){for(var e=0,t=Array(this.objects.length),n=0,r=this.objects.length;n<r;n++){var i=this.objects[n],a=i[0],o=i[1];t[n]=[a.objectNumber,e],e+=o.sizeInBytes()+1}return t},t.withContextAndObjects=function(e,n,r){return r===void 0&&(r=!0),new t(e,n,r)},t}($v)})),xy,Sy=s((()=>{G(),my(),pv(),gy(),vy(),by(),dv(),F_(),xy=function(){function e(e,t){var n=this;this.parsedObjects=0,this.shouldWaitForTick=function(e){return n.parsedObjects+=e,n.parsedObjects%n.objectsPerTick===0},this.context=e,this.objectsPerTick=t}return e.prototype.serializeToBuffer=function(){return Am(this,void 0,void 0,function(){var e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g;return jm(this,function(_){switch(_.label){case 0:return[4,this.computeBufferSize()];case 1:e=_.sent(),t=e.size,n=e.header,r=e.indirectObjects,i=e.xref,a=e.trailerDict,o=e.trailer,s=0,c=new Uint8Array(t),s+=n.copyBytesInto(c,s),c[s++]=J.Newline,c[s++]=J.Newline,l=0,u=r.length,_.label=2;case 2:return l<u?(d=r[l],f=d[0],p=d[1],m=String(f.objectNumber),s+=Xm(m,c,s),c[s++]=J.Space,h=String(f.generationNumber),s+=Xm(h,c,s),c[s++]=J.Space,c[s++]=J.o,c[s++]=J.b,c[s++]=J.j,c[s++]=J.Newline,s+=p.copyBytesInto(c,s),c[s++]=J.Newline,c[s++]=J.e,c[s++]=J.n,c[s++]=J.d,c[s++]=J.o,c[s++]=J.b,c[s++]=J.j,c[s++]=J.Newline,c[s++]=J.Newline,g=p instanceof yy?p.getObjectsCount():1,this.shouldWaitForTick(g)?[4,Th()]:[3,4]):[3,5];case 3:_.sent(),_.label=4;case 4:return l++,[3,2];case 5:return i&&(s+=i.copyBytesInto(c,s),c[s++]=J.Newline),a&&(s+=a.copyBytesInto(c,s),c[s++]=J.Newline,c[s++]=J.Newline),s+=o.copyBytesInto(c,s),[2,c]}})})},e.prototype.computeIndirectObjectSize=function(e){var t=e[0],n=e[1];return t.sizeInBytes()+3+(n.sizeInBytes()+9)},e.prototype.createTrailerDict=function(){return this.context.obj({Size:this.context.largestObjectNumber+1,Root:this.context.trailerInfo.Root,Encrypt:this.context.trailerInfo.Encrypt,Info:this.context.trailerInfo.Info,ID:this.context.trailerInfo.ID})},e.prototype.computeBufferSize=function(){return Am(this,void 0,void 0,function(){var e,t,n,r,i,a,o,s,c,l,u;return jm(this,function(d){switch(d.label){case 0:e=fv.forVersion(1,7),t=e.sizeInBytes()+2,n=py.create(),r=this.context.enumerateIndirectObjects(),i=0,a=r.length,d.label=1;case 1:return i<a?(o=r[i],s=o[0],n.addEntry(s,t),t+=this.computeIndirectObjectSize(o),this.shouldWaitForTick(1)?[4,Th()]:[3,3]):[3,4];case 2:d.sent(),d.label=3;case 3:return i++,[3,1];case 4:return c=t,t+=n.sizeInBytes()+1,l=_y.of(this.createTrailerDict()),t+=l.sizeInBytes()+2,u=hy.forLastCrossRefSectionOffset(c),t+=u.sizeInBytes(),[2,{size:t,header:e,indirectObjects:r,xref:n,trailerDict:l,trailer:u}]}})})},e.forContext=function(t,n){return new e(t,n)},e}()})),Cy,wy=s((()=>{G(),hv(),Cy=function(e){W(t,e);function t(t){var n=e.call(this)||this;return n.data=t,n}return t.prototype.clone=function(){return t.of(this.data.slice())},t.prototype.toString=function(){return`PDFInvalidObject(`+this.data.length+` bytes)`},t.prototype.sizeInBytes=function(){return this.data.length},t.prototype.copyBytesInto=function(e,t){for(var n=this.data.length,r=0;r<n;r++)e[t++]=this.data[r];return n},t.of=function(e){return new t(e)},t}(mv)})),Ty,Ey,Dy=s((()=>{G(),Pv(),Kv(),ey(),F_(),(function(e){e[e.Deleted=0]=`Deleted`,e[e.Uncompressed=1]=`Uncompressed`,e[e.Compressed=2]=`Compressed`})(Ty||={}),Ey=function(e){W(t,e);function t(t,n,r){r===void 0&&(r=!0);var i=e.call(this,t,r)||this;return i.computeIndex=function(){for(var e=[],t=0,n=0,r=i.entries.length;n<r;n++){var a=i.entries[n],o=i.entries[n-1];n===0?e.push(a.ref.objectNumber):a.ref.objectNumber-o.ref.objectNumber>1&&(e.push(t),e.push(a.ref.objectNumber),t=0),t+=1}return e.push(t),e},i.computeEntryTuples=function(){for(var e=Array(i.entries.length),t=0,n=i.entries.length;t<n;t++){var r=i.entries[t];if(r.type===Ty.Deleted){var a=r.type,o=r.nextFreeObjectNumber,s=r.ref;e[t]=[a,o,s.generationNumber]}if(r.type===Ty.Uncompressed){var a=r.type,c=r.offset,s=r.ref;e[t]=[a,c,s.generationNumber]}if(r.type===Ty.Compressed){var a=r.type,l=r.objectStreamRef,u=r.index;e[t]=[a,l.objectNumber,u]}}return e},i.computeMaxEntryByteWidths=function(){for(var e=i.entryTuplesCache.access(),t=[0,0,0],n=0,r=e.length;n<r;n++){var a=e[n],o=a[0],s=a[1],c=a[2],l=Wh(o),u=Wh(s),d=Wh(c);l>t[0]&&(t[0]=l),u>t[1]&&(t[1]=u),d>t[2]&&(t[2]=d)}return t},i.entries=n||[],i.entryTuplesCache=N_.populatedBy(i.computeEntryTuples),i.maxByteWidthsCache=N_.populatedBy(i.computeMaxEntryByteWidths),i.indexCache=N_.populatedBy(i.computeIndex),t.set(X.of(`Type`),X.of(`XRef`)),i}return t.prototype.addDeletedEntry=function(e,t){var n=Ty.Deleted;this.entries.push({type:n,ref:e,nextFreeObjectNumber:t}),this.entryTuplesCache.invalidate(),this.maxByteWidthsCache.invalidate(),this.indexCache.invalidate(),this.contentsCache.invalidate()},t.prototype.addUncompressedEntry=function(e,t){var n=Ty.Uncompressed;this.entries.push({type:n,ref:e,offset:t}),this.entryTuplesCache.invalidate(),this.maxByteWidthsCache.invalidate(),this.indexCache.invalidate(),this.contentsCache.invalidate()},t.prototype.addCompressedEntry=function(e,t,n){var r=Ty.Compressed;this.entries.push({type:r,ref:e,objectStreamRef:t,index:n}),this.entryTuplesCache.invalidate(),this.maxByteWidthsCache.invalidate(),this.indexCache.invalidate(),this.contentsCache.invalidate()},t.prototype.clone=function(e){var n=this,r=n.dict,i=n.entries,a=n.encode;return t.of(r.clone(e),i.slice(),a)},t.prototype.getContentsString=function(){for(var e=this.entryTuplesCache.access(),t=this.maxByteWidthsCache.access(),n=``,r=0,i=e.length;r<i;r++){for(var a=e[r],o=a[0],s=a[1],c=a[2],l=vh(Gh(o)),u=vh(Gh(s)),d=vh(Gh(c)),f=t[0]-1;f>=0;f--)n+=(l[f]||0).toString(2);for(var f=t[1]-1;f>=0;f--)n+=(u[f]||0).toString(2);for(var f=t[2]-1;f>=0;f--)n+=(d[f]||0).toString(2)}return n},t.prototype.getUnencodedContents=function(){for(var e=this.entryTuplesCache.access(),t=this.maxByteWidthsCache.access(),n=new Uint8Array(this.getUnencodedContentsSize()),r=0,i=0,a=e.length;i<a;i++){for(var o=e[i],s=o[0],c=o[1],l=o[2],u=vh(Gh(s)),d=vh(Gh(c)),f=vh(Gh(l)),p=t[0]-1;p>=0;p--)n[r++]=u[p]||0;for(var p=t[1]-1;p>=0;p--)n[r++]=d[p]||0;for(var p=t[2]-1;p>=0;p--)n[r++]=f[p]||0}return n},t.prototype.getUnencodedContentsSize=function(){var e=this.maxByteWidthsCache.access();return yh(e)*this.entries.length},t.prototype.updateDict=function(){e.prototype.updateDict.call(this);var t=this.maxByteWidthsCache.access(),n=this.indexCache.access(),r=this.dict.context;this.dict.set(X.of(`W`),r.obj(t)),this.dict.set(X.of(`Index`),r.obj(n))},t.create=function(e,n){n===void 0&&(n=!0);var r=new t(e,[],n);return r.addDeletedEntry(Gv.of(0,65535),0),r},t.of=function(e,n,r){return r===void 0&&(r=!0),new t(e,n,r)},t}($v)})),Oy,ky=s((()=>{G(),pv(),gy(),wy(),Pv(),_v(),Kv(),Bv(),Dy(),by(),Sy(),F_(),Oy=function(e){W(t,e);function t(t,n,r,i){var a=e.call(this,t,n)||this;return a.encodeStreams=r,a.objectsPerStream=i,a}return t.prototype.computeBufferSize=function(){return Am(this,void 0,void 0,function(){var e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,c,l,m,d,g,_,v,y;return jm(this,function(b){switch(b.label){case 0:e=this.context.largestObjectNumber+1,t=fv.forVersion(1,7),n=t.sizeInBytes()+2,r=Ey.create(this.createTrailerDict(),this.encodeStreams),i=[],a=[],o=[],s=this.context.enumerateIndirectObjects(),c=0,l=s.length,b.label=1;case 1:return c<l?(u=s[c],d=u[0],f=u[1],p=d===this.context.trailerInfo.Encrypt||f instanceof zv||f instanceof Cy||d.generationNumber!==0,p?(i.push(u),r.addUncompressedEntry(d,n),n+=this.computeIndirectObjectSize(u),this.shouldWaitForTick(1)?[4,Th()]:[3,3]):[3,4]):[3,6];case 2:b.sent(),b.label=3;case 3:return[3,5];case 4:m=dh(a),h=dh(o),m&&m.length%this.objectsPerStream!==0||(m=[],a.push(m),h=Gv.of(e++),o.push(h)),r.addCompressedEntry(d,h,m.length),m.push(u),b.label=5;case 5:return c++,[3,1];case 6:c=0,l=a.length,b.label=7;case 7:return c<l?(m=a[c],d=o[c],g=yy.withContextAndObjects(this.context,m,this.encodeStreams),r.addUncompressedEntry(d,n),n+=this.computeIndirectObjectSize([d,g]),i.push([d,g]),this.shouldWaitForTick(m.length)?[4,Th()]:[3,9]):[3,10];case 8:b.sent(),b.label=9;case 9:return c++,[3,7];case 10:return _=Gv.of(e++),r.dict.set(X.of(`Size`),gv.of(e)),r.addUncompressedEntry(_,n),v=n,n+=this.computeIndirectObjectSize([_,r]),i.push([_,r]),y=hy.forLastCrossRefSectionOffset(v),n+=y.sizeInBytes(),[2,{size:n,header:t,indirectObjects:i,trailer:y}]}})})},t.forContext=function(e,n,r,i){return r===void 0&&(r=!0),i===void 0&&(i=50),new t(e,n,r,i)},t}(xy)})),Ay,jy=s((()=>{G(),hv(),dv(),F_(),lv(),Ay=function(e){W(t,e);function t(t){var n=e.call(this)||this;return n.value=t,n}return t.prototype.asBytes=function(){for(var e=this.value+(this.value.length%2==1?`0`:``),t=e.length,n=new Uint8Array(e.length/2),r=0,i=0;r<t;){var a=parseInt(e.substring(r,r+2),16);n[i]=a,r+=2,i+=1}return n},t.prototype.decodeText=function(){var e=this.asBytes();return Vh(e)?Ph(e):j_(e)},t.prototype.decodeDate=function(){var e=this.decodeText(),t=ch(e);if(!t)throw new G_(e);return t},t.prototype.asString=function(){return this.value},t.prototype.clone=function(){return t.of(this.value)},t.prototype.toString=function(){return`<`+this.value+`>`},t.prototype.sizeInBytes=function(){return this.value.length+2},t.prototype.copyBytesInto=function(e,t){return e[t++]=J.LessThan,t+=Xm(this.value,e,t),e[t++]=J.GreaterThan,this.value.length+2},t.of=function(e){return new t(e)},t.fromText=function(e){for(var n=Dh(e),r=``,i=0,a=n.length;i<a;i++)r+=Gm(n[i],4);return new t(r)},t}(mv)})),My,Ny=s((()=>{o_(),jy(),F_(),My=function(){function e(e,t){this.encoding=e===Yg.ZapfDingbats?i_.ZapfDingbats:e===Yg.Symbol?i_.Symbol:i_.WinAnsi,this.font=Zg.load(e),this.fontName=this.font.FontName,this.customName=t}return e.prototype.encodeText=function(e){for(var t=this.encodeTextAsGlyphs(e),n=Array(t.length),r=0,i=t.length;r<i;r++)n[r]=Km(t[r].code);return Ay.of(n.join(``))},e.prototype.widthOfTextAtSize=function(e,t){for(var n=this.encodeTextAsGlyphs(e),r=0,i=0,a=n.length;i<a;i++){var o=n[i].name,s=(n[i+1]||{}).name,c=this.font.getXAxisKerningForPair(o,s)||0;r+=this.widthOfGlyph(o)+c}var l=t/1e3;return r*l},e.prototype.heightOfFontAtSize=function(e,t){t===void 0&&(t={});var n=t.descender,r=n===void 0||n,i=this.font,a=i.Ascender,o=i.Descender,s=i.FontBBox,c=(a||s[3])-(o||s[1]);return r||(c+=o||0),c/1e3*e},e.prototype.sizeOfFontAtHeight=function(e){var t=this.font,n=t.Ascender,r=t.Descender,i=t.FontBBox,a=n||i[3],o=r||i[1];return 1e3*e/(a-o)},e.prototype.embedIntoContext=function(e,t){var n=e.obj({Type:`Font`,Subtype:`Type1`,BaseFont:this.customName||this.fontName,Encoding:this.encoding===i_.WinAnsi?`WinAnsiEncoding`:void 0});return t?(e.assign(t,n),t):e.register(n)},e.prototype.widthOfGlyph=function(e){return this.font.getWidthOfGlyph(e)||250},e.prototype.encodeTextAsGlyphs=function(e){for(var t=Array.from(e),n=Array(t.length),r=0,i=t.length;r<i;r++){var a=Wm(t[r]);n[r]=this.encoding.encodeUnicodeCodePoint(a)}return n},e.for=function(t,n){return new e(t,n)},e}()})),Py,Fy,Iy,Ly,Ry,zy=s((()=>{F_(),Hh(),Py=function(e,t){for(var n=Array(e.length),r=0,i=e.length;r<i;r++){var a=e[r],o=Iy(Ly(t(a))),s=Iy.apply(void 0,a.codePoints.map(Ry));n[r]=[o,s]}return Fy(n)},Fy=function(e){return`/CIDInit /ProcSet findresource begin
996
+ 12 dict begin
997
+ begincmap
998
+ /CIDSystemInfo <<
999
+ /Registry (Adobe)
1000
+ /Ordering (UCS)
1001
+ /Supplement 0
1002
+ >> def
1003
+ /CMapName /Adobe-Identity-UCS def
1004
+ /CMapType 2 def
1005
+ 1 begincodespacerange
1006
+ <0000><ffff>
1007
+ endcodespacerange
1008
+ `+e.length+` beginbfchar
1009
+ `+e.map(function(e){var t=e[0],n=e[1];return t+` `+n}).join(`
1010
+ `)+`
1011
+ endbfchar
1012
+ endcmap
1013
+ CMapName currentdict /CMap defineresource pop
1014
+ end
1015
+ end`},Iy=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return`<`+e.join(``)+`>`},Ly=function(e){return Gm(e,4)},Ry=function(e){if(Oh(e))return Ly(e);if(kh(e)){var t=Ah(e),n=jh(e);return``+Ly(t)+Ly(n)}var r=`0x`+Km(e)+` is not a valid UTF-8 or UTF-16 codepoint.`;throw Error(r)}})),By,Vy,Hy=s((()=>{By=function(e){var t=0,n=function(e){t|=1<<e-1};return e.fixedPitch&&n(1),e.serif&&n(2),e.symbolic&&n(3),e.script&&n(4),e.nonsymbolic&&n(6),e.italic&&n(7),e.allCap&&n(17),e.smallCap&&n(18),e.forceBold&&n(19),t},Vy=function(e){var t=e[`OS/2`]?e[`OS/2`].sFamilyClass:0;return By({fixedPitch:e.post.isFixedPitch,serif:1<=t&&t<=7,symbolic:!0,script:t===10,italic:e.head.macStyle.italic})}})),Uy,Wy=s((()=>{G(),hv(),dv(),F_(),lv(),Uy=function(e){W(t,e);function t(t){var n=e.call(this)||this;return n.value=t,n}return t.prototype.asBytes=function(){for(var e=[],t=``,n=!1,r=function(t){t!==void 0&&e.push(t),n=!1},i=0,a=this.value.length;i<a;i++){var o=this.value[i],s=Um(o),c=this.value[i+1];n?s===J.Newline||s===J.CarriageReturn?r():s===J.n?r(J.Newline):s===J.r?r(J.CarriageReturn):s===J.t?r(J.Tab):s===J.b?r(J.Backspace):s===J.f?r(J.FormFeed):s===J.LeftParen?r(J.LeftParen):s===J.RightParen?r(J.RightParen):s===J.Backspace?r(J.BackSlash):s>=J.Zero&&s<=J.Seven?(t+=o,t.length!==3&&c>=`0`&&c<=`7`||(r(parseInt(t,8)),t=``)):r(s):s===J.BackSlash?n=!0:r(s)}return new Uint8Array(e)},t.prototype.decodeText=function(){var e=this.asBytes();return Vh(e)?Ph(e):j_(e)},t.prototype.decodeDate=function(){var e=this.decodeText(),t=ch(e);if(!t)throw new G_(e);return t},t.prototype.asString=function(){return this.value},t.prototype.clone=function(){return t.of(this.value)},t.prototype.toString=function(){return`(`+this.value+`)`},t.prototype.sizeInBytes=function(){return this.value.length+2},t.prototype.copyBytesInto=function(e,t){return e[t++]=J.LeftParen,t+=Xm(this.value,e,t),e[t++]=J.RightParen,this.value.length+2},t.of=function(e){return new t(e)},t.fromDate=function(e){var n=Ym(String(e.getUTCFullYear()),4,`0`),r=Ym(String(e.getUTCMonth()+1),2,`0`),i=Ym(String(e.getUTCDate()),2,`0`),a=Ym(String(e.getUTCHours()),2,`0`),o=Ym(String(e.getUTCMinutes()),2,`0`),s=Ym(String(e.getUTCSeconds()),2,`0`);return new t(`D:`+n+r+i+a+o+s+`Z`)},t}(mv)})),Gy,Ky=s((()=>{G(),zy(),Hy(),jy(),Wy(),F_(),Gy=function(){function e(e,t,n,r){var i=this;this.allGlyphsInFontSortedById=function(){for(var e=Array(i.font.characterSet.length),t=0,n=e.length;t<n;t++){var r=i.font.characterSet[t];e[t]=i.font.glyphForCodePoint(r)}return _h(e.sort(gh),function(e){return e.id})},this.font=e,this.scale=1e3/this.font.unitsPerEm,this.fontData=t,this.fontName=this.font.postscriptName||`Font`,this.customName=n,this.fontFeatures=r,this.baseFontName=``,this.glyphCache=N_.populatedBy(this.allGlyphsInFontSortedById)}return e.for=function(t,n,r,i){return Am(this,void 0,void 0,function(){var a;return jm(this,function(o){switch(o.label){case 0:return[4,t.create(n)];case 1:return a=o.sent(),[2,new e(a,n,r,i)]}})})},e.prototype.encodeText=function(e){for(var t=this.font.layout(e,this.fontFeatures).glyphs,n=Array(t.length),r=0,i=t.length;r<i;r++)n[r]=Gm(t[r].id,4);return Ay.of(n.join(``))},e.prototype.widthOfTextAtSize=function(e,t){for(var n=this.font.layout(e,this.fontFeatures).glyphs,r=0,i=0,a=n.length;i<a;i++)r+=n[i].advanceWidth*this.scale;var o=t/1e3;return r*o},e.prototype.heightOfFontAtSize=function(e,t){t===void 0&&(t={});var n=t.descender,r=n===void 0||n,i=this.font,a=i.ascent,o=i.descent,s=i.bbox,c=(a||s.maxY)*this.scale-(o||s.minY)*this.scale;return r||(c-=Math.abs(o)||0),c/1e3*e},e.prototype.sizeOfFontAtHeight=function(e){var t=this.font,n=t.ascent,r=t.descent,i=t.bbox,a=(n||i.maxY)*this.scale,o=(r||i.minY)*this.scale;return 1e3*e/(a-o)},e.prototype.embedIntoContext=function(e,t){return this.baseFontName=this.customName||e.addRandomSuffix(this.fontName),this.embedFontDict(e,t)},e.prototype.embedFontDict=function(e,t){return Am(this,void 0,void 0,function(){var n,r,i;return jm(this,function(a){switch(a.label){case 0:return[4,this.embedCIDFontDict(e)];case 1:return n=a.sent(),r=this.embedUnicodeCmap(e),i=e.obj({Type:`Font`,Subtype:`Type0`,BaseFont:this.baseFontName,Encoding:`Identity-H`,DescendantFonts:[n],ToUnicode:r}),t?(e.assign(t,i),[2,t]):[2,e.register(i)]}})})},e.prototype.isCFF=function(){return this.font.cff},e.prototype.embedCIDFontDict=function(e){return Am(this,void 0,void 0,function(){var t,n;return jm(this,function(r){switch(r.label){case 0:return[4,this.embedFontDescriptor(e)];case 1:return t=r.sent(),n=e.obj({Type:`Font`,Subtype:this.isCFF()?`CIDFontType0`:`CIDFontType2`,CIDToGIDMap:`Identity`,BaseFont:this.baseFontName,CIDSystemInfo:{Registry:Uy.of(`Adobe`),Ordering:Uy.of(`Identity`),Supplement:0},FontDescriptor:t,W:this.computeWidths()}),[2,e.register(n)]}})})},e.prototype.embedFontDescriptor=function(e){return Am(this,void 0,void 0,function(){var t,n,r,i,a,o,s,c,l,u,d,f,p,m,h;return jm(this,function(g){switch(g.label){case 0:return[4,this.embedFontStream(e)];case 1:return t=g.sent(),n=this.scale,r=this.font,i=r.italicAngle,a=r.ascent,o=r.descent,s=r.capHeight,c=r.xHeight,l=this.font.bbox,u=l.minX,d=l.minY,f=l.maxX,p=l.maxY,m=e.obj((h={Type:`FontDescriptor`,FontName:this.baseFontName,Flags:Vy(this.font),FontBBox:[u*n,d*n,f*n,p*n],ItalicAngle:i,Ascent:a*n,Descent:o*n,CapHeight:(s||a)*n,XHeight:(c||0)*n,StemV:0},h[this.isCFF()?`FontFile3`:`FontFile2`]=t,h)),[2,e.register(m)]}})})},e.prototype.serializeFont=function(){return Am(this,void 0,void 0,function(){return jm(this,function(e){return[2,this.fontData]})})},e.prototype.embedFontStream=function(e){return Am(this,void 0,void 0,function(){var t,n,r;return jm(this,function(i){switch(i.label){case 0:return r=(n=e).flateStream,[4,this.serializeFont()];case 1:return t=r.apply(n,[i.sent(),{Subtype:this.isCFF()?`CIDFontType0C`:void 0}]),[2,e.register(t)]}})})},e.prototype.embedUnicodeCmap=function(e){var t=Py(this.glyphCache.access(),this.glyphId.bind(this)),n=e.flateStream(t);return e.register(n)},e.prototype.glyphId=function(e){return e?e.id:-1},e.prototype.computeWidths=function(){for(var e=this.glyphCache.access(),t=[],n=[],r=0,i=e.length;r<i;r++){var a=e[r],o=e[r-1],s=this.glyphId(a),c=this.glyphId(o);r===0?t.push(s):s-c!==1&&(t.push(n),t.push(s),n=[]),n.push(a.advanceWidth*this.scale)}return t.push(n),t},e}()})),qy,Jy=s((()=>{G(),Ky(),jy(),F_(),qy=function(e){W(t,e);function t(t,n,r,i){var a=e.call(this,t,n,r,i)||this;return a.subset=a.font.createSubset(),a.glyphs=[],a.glyphCache=N_.populatedBy(function(){return a.glyphs}),a.glyphIdMap=new Map,a}return t.for=function(e,n,r,i){return Am(this,void 0,void 0,function(){var a;return jm(this,function(o){switch(o.label){case 0:return[4,e.create(n)];case 1:return a=o.sent(),[2,new t(a,n,r,i)]}})})},t.prototype.encodeText=function(e){for(var t=this.font.layout(e,this.fontFeatures).glyphs,n=Array(t.length),r=0,i=t.length;r<i;r++){var a=t[r],o=this.subset.includeGlyph(a);this.glyphs[o-1]=a,this.glyphIdMap.set(a.id,o),n[r]=Gm(o,4)}return this.glyphCache.invalidate(),Ay.of(n.join(``))},t.prototype.isCFF=function(){return this.subset.cff},t.prototype.glyphId=function(e){return e?this.glyphIdMap.get(e.id):-1},t.prototype.serializeFont=function(){var e=this;return new Promise(function(t,n){var r=[];e.subset.encodeStream().on(`data`,function(e){return r.push(e)}).on(`end`,function(){return t(mh(r))}).on(`error`,function(e){return n(e)})})},t}(Gy)})),Yy,Xy,Zy=s((()=>{G(),Wy(),jy(),(function(e){e.Source=`Source`,e.Data=`Data`,e.Alternative=`Alternative`,e.Supplement=`Supplement`,e.EncryptedPayload=`EncryptedPayload`,e.FormData=`EncryptedPayload`,e.Schema=`Schema`,e.Unspecified=`Unspecified`})(Yy||={}),Xy=function(){function e(e,t,n){n===void 0&&(n={}),this.fileData=e,this.fileName=t,this.options=n}return e.for=function(t,n,r){return r===void 0&&(r={}),new e(t,n,r)},e.prototype.embedIntoContext=function(e,t){return Am(this,void 0,void 0,function(){var n,r,i,a,o,s,c,l,u;return jm(this,function(d){return n=this.options,r=n.mimeType,i=n.description,a=n.creationDate,o=n.modificationDate,s=n.afRelationship,c=e.flateStream(this.fileData,{Type:`EmbeddedFile`,Subtype:r??void 0,Params:{Size:this.fileData.length,CreationDate:a?Uy.fromDate(a):void 0,ModDate:o?Uy.fromDate(o):void 0}}),l=e.register(c),u=e.obj({Type:`Filespec`,F:Uy.of(this.fileName),UF:Ay.fromText(this.fileName),EF:{F:l},Desc:i?Ay.fromText(i):void 0,AFRelationship:s??void 0}),t?(e.assign(t,u),[2,t]):[2,e.register(u)]})})},e}()})),Qy,$y,eb,tb,nb=s((()=>{G(),Qy=[65472,65473,65474,65475,65477,65478,65479,65480,65481,65482,65483,65484,65485,65486,65487],(function(e){e.DeviceGray=`DeviceGray`,e.DeviceRGB=`DeviceRGB`,e.DeviceCMYK=`DeviceCMYK`})($y||={}),eb={1:$y.DeviceGray,3:$y.DeviceRGB,4:$y.DeviceCMYK},tb=function(){function e(e,t,n,r,i){this.imageData=e,this.bitsPerComponent=t,this.width=n,this.height=r,this.colorSpace=i}return e.for=function(t){return Am(this,void 0,void 0,function(){var n,r,i,a,o,s,c,l,u,d;return jm(this,function(f){if(n=new DataView(t.buffer),r=n.getUint16(0),r!==65496)throw Error(`SOI not found in JPEG`);for(i=2;i<n.byteLength&&(a=n.getUint16(i),i+=2,!Qy.includes(a));)i+=n.getUint16(i);if(!Qy.includes(a))throw Error(`Invalid JPEG`);if(i+=2,o=n.getUint8(i++),s=n.getUint16(i),i+=2,c=n.getUint16(i),i+=2,l=n.getUint8(i++),u=eb[l],!u)throw Error(`Unknown JPEG channel.`);return d=u,[2,new e(t,o,c,s,d)]})})},e.prototype.embedIntoContext=function(e,t){return Am(this,void 0,void 0,function(){var n;return jm(this,function(r){return n=e.stream(this.imageData,{Type:`XObject`,Subtype:`Image`,BitsPerComponent:this.bitsPerComponent,Width:this.width,Height:this.height,ColorSpace:this.colorSpace,Filter:`DCTDecode`,Decode:this.colorSpace===$y.DeviceCMYK?[1,0,1,0,1,0,1,0]:void 0}),t?(e.assign(t,n),[2,t]):[2,e.register(n)]})})},e}()})),rb,Q,ib=s((()=>{rb=d(ug()),Q={},Q.toRGBA8=function(e){var t=e.width,n=e.height;if(e.tabs.acTL==null)return[Q.toRGBA8.decodeImage(e.data,t,n,e).buffer];var r=[];e.frames[0].data??(e.frames[0].data=e.data);for(var i=t*n*4,a=new Uint8Array(i),o=new Uint8Array(i),s=new Uint8Array(i),c=0;c<e.frames.length;c++){var l=e.frames[c],u=l.rect.x,d=l.rect.y,f=l.rect.width,p=l.rect.height,m=Q.toRGBA8.decodeImage(l.data,f,p,e);if(c!=0)for(var h=0;h<i;h++)s[h]=a[h];if(l.blend==0?Q._copyTile(m,f,p,a,t,n,u,d,0):l.blend==1&&Q._copyTile(m,f,p,a,t,n,u,d,1),r.push(a.buffer.slice(0)),l.dispose!=0){if(l.dispose==1)Q._copyTile(o,f,p,a,t,n,u,d,0);else if(l.dispose==2)for(var h=0;h<i;h++)a[h]=s[h]}}return r},Q.toRGBA8.decodeImage=function(e,t,n,r){var i=t*n,a=Q.decode._getBPP(r),o=Math.ceil(t*a/8),s=new Uint8Array(i*4),c=new Uint32Array(s.buffer),l=r.ctype,u=r.depth,d=Q._bin.readUshort;if(l==6){var f=i<<2;if(u==8)for(var p=0;p<f;p+=4)s[p]=e[p],s[p+1]=e[p+1],s[p+2]=e[p+2],s[p+3]=e[p+3];if(u==16)for(var p=0;p<f;p++)s[p]=e[p<<1]}else if(l==2){var m=r.tabs.tRNS;if(m==null){if(u==8)for(var p=0;p<i;p++){var h=p*3;c[p]=255<<24|e[h+2]<<16|e[h+1]<<8|e[h]}if(u==16)for(var p=0;p<i;p++){var h=p*6;c[p]=255<<24|e[h+4]<<16|e[h+2]<<8|e[h]}}else{var g=m[0],_=m[1],v=m[2];if(u==8)for(var p=0;p<i;p++){var y=p<<2,h=p*3;c[p]=255<<24|e[h+2]<<16|e[h+1]<<8|e[h],e[h]==g&&e[h+1]==_&&e[h+2]==v&&(s[y+3]=0)}if(u==16)for(var p=0;p<i;p++){var y=p<<2,h=p*6;c[p]=255<<24|e[h+4]<<16|e[h+2]<<8|e[h],d(e,h)==g&&d(e,h+2)==_&&d(e,h+4)==v&&(s[y+3]=0)}}}else if(l==3){var b=r.tabs.PLTE,x=r.tabs.tRNS,S=x?x.length:0;if(u==1)for(var C=0;C<n;C++)for(var w=C*o,T=C*t,p=0;p<t;p++){var y=T+p<<2,E=e[w+(p>>3)]>>7-(p&7)&1,D=3*E;s[y]=b[D],s[y+1]=b[D+1],s[y+2]=b[D+2],s[y+3]=E<S?x[E]:255}if(u==2)for(var C=0;C<n;C++)for(var w=C*o,T=C*t,p=0;p<t;p++){var y=T+p<<2,E=e[w+(p>>2)]>>6-((p&3)<<1)&3,D=3*E;s[y]=b[D],s[y+1]=b[D+1],s[y+2]=b[D+2],s[y+3]=E<S?x[E]:255}if(u==4)for(var C=0;C<n;C++)for(var w=C*o,T=C*t,p=0;p<t;p++){var y=T+p<<2,E=e[w+(p>>1)]>>4-((p&1)<<2)&15,D=3*E;s[y]=b[D],s[y+1]=b[D+1],s[y+2]=b[D+2],s[y+3]=E<S?x[E]:255}if(u==8)for(var p=0;p<i;p++){var y=p<<2,E=e[p],D=3*E;s[y]=b[D],s[y+1]=b[D+1],s[y+2]=b[D+2],s[y+3]=E<S?x[E]:255}}else if(l==4){if(u==8)for(var p=0;p<i;p++){var y=p<<2,O=p<<1,k=e[O];s[y]=k,s[y+1]=k,s[y+2]=k,s[y+3]=e[O+1]}if(u==16)for(var p=0;p<i;p++){var y=p<<2,O=p<<2,k=e[O];s[y]=k,s[y+1]=k,s[y+2]=k,s[y+3]=e[O+2]}}else if(l==0)for(var g=r.tabs.tRNS?r.tabs.tRNS:-1,C=0;C<n;C++){var A=C*o,j=C*t;if(u==1)for(var M=0;M<t;M++){var k=255*(e[A+(M>>>3)]>>>7-(M&7)&1),N=k==g*255?0:255;c[j+M]=N<<24|k<<16|k<<8|k}else if(u==2)for(var M=0;M<t;M++){var k=85*(e[A+(M>>>2)]>>>6-((M&3)<<1)&3),N=k==g*85?0:255;c[j+M]=N<<24|k<<16|k<<8|k}else if(u==4)for(var M=0;M<t;M++){var k=17*(e[A+(M>>>1)]>>>4-((M&1)<<2)&15),N=k==g*17?0:255;c[j+M]=N<<24|k<<16|k<<8|k}else if(u==8)for(var M=0;M<t;M++){var k=e[A+M],N=k==g?0:255;c[j+M]=N<<24|k<<16|k<<8|k}else if(u==16)for(var M=0;M<t;M++){var k=e[A+(M<<1)],N=d(e,A+(M<<p))==g?0:255;c[j+M]=N<<24|k<<16|k<<8|k}}return s},Q.decode=function(e){for(var t=new Uint8Array(e),n=8,r=Q._bin,i=r.readUshort,a=r.readUint,o={tabs:{},frames:[]},s=new Uint8Array(t.length),c=0,l,u=0,d=[137,80,78,71,13,10,26,10],f=0;f<8;f++)if(t[f]!=d[f])throw`The input is not a PNG file!`;for(;n<t.length;){var p=r.readUint(t,n);n+=4;var m=r.readASCII(t,n,4);if(n+=4,m==`IHDR`)Q.decode._IHDR(t,n,o);else if(m==`IDAT`){for(var f=0;f<p;f++)s[c+f]=t[n+f];c+=p}else if(m==`acTL`)o.tabs[m]={num_frames:a(t,n),num_plays:a(t,n+4)},l=new Uint8Array(t.length);else if(m==`fcTL`){if(u!=0){var h=o.frames[o.frames.length-1];h.data=Q.decode._decompress(o,l.slice(0,u),h.rect.width,h.rect.height),u=0}var g={x:a(t,n+12),y:a(t,n+16),width:a(t,n+4),height:a(t,n+8)},_=i(t,n+22);_=i(t,n+20)/(_==0?100:_);var v={rect:g,delay:Math.round(_*1e3),dispose:t[n+24],blend:t[n+25]};o.frames.push(v)}else if(m==`fdAT`){for(var f=0;f<p-4;f++)l[u+f]=t[n+f+4];u+=p-4}else if(m==`pHYs`)o.tabs[m]=[r.readUint(t,n),r.readUint(t,n+4),t[n+8]];else if(m==`cHRM`){o.tabs[m]=[];for(var f=0;f<8;f++)o.tabs[m].push(r.readUint(t,n+f*4))}else if(m==`tEXt`){o.tabs[m]??(o.tabs[m]={});var y=r.nextZero(t,n),b=r.readASCII(t,n,y-n),x=r.readASCII(t,y+1,n+p-y-1);o.tabs[m][b]=x}else if(m==`iTXt`){o.tabs[m]??(o.tabs[m]={});var y=0,S=n;y=r.nextZero(t,S);var b=r.readASCII(t,S,y-S);S=y+1,t[S],t[S+1],S+=2,y=r.nextZero(t,S),r.readASCII(t,S,y-S),S=y+1,y=r.nextZero(t,S),r.readUTF8(t,S,y-S),S=y+1;var x=r.readUTF8(t,S,p-(S-n));o.tabs[m][b]=x}else if(m==`PLTE`)o.tabs[m]=r.readBytes(t,n,p);else if(m==`hIST`){var C=o.tabs.PLTE.length/3;o.tabs[m]=[];for(var f=0;f<C;f++)o.tabs[m].push(i(t,n+f*2))}else if(m==`tRNS`)o.ctype==3?o.tabs[m]=r.readBytes(t,n,p):o.ctype==0?o.tabs[m]=i(t,n):o.ctype==2&&(o.tabs[m]=[i(t,n),i(t,n+2),i(t,n+4)]);else if(m==`gAMA`)o.tabs[m]=r.readUint(t,n)/1e5;else if(m==`sRGB`)o.tabs[m]=t[n];else if(m==`bKGD`)o.ctype==0||o.ctype==4?o.tabs[m]=[i(t,n)]:o.ctype==2||o.ctype==6?o.tabs[m]=[i(t,n),i(t,n+2),i(t,n+4)]:o.ctype==3&&(o.tabs[m]=t[n]);else if(m==`IEND`)break;n+=p,r.readUint(t,n),n+=4}if(u!=0){var h=o.frames[o.frames.length-1];h.data=Q.decode._decompress(o,l.slice(0,u),h.rect.width,h.rect.height),u=0}return o.data=Q.decode._decompress(o,s,o.width,o.height),delete o.compress,delete o.interlace,delete o.filter,o},Q.decode._decompress=function(e,t,n,r){var i=Q.decode._getBPP(e),a=Math.ceil(n*i/8),o=new Uint8Array((a+1+e.interlace)*r);return t=Q.decode._inflate(t,o),e.interlace==0?t=Q.decode._filterZero(t,e,0,n,r):e.interlace==1&&(t=Q.decode._readInterlace(t,e)),t},Q.decode._inflate=function(e,t){return Q.inflateRaw(new Uint8Array(e.buffer,2,e.length-6),t)},Q.inflateRaw=function(){var e={};return e.H={},e.H.N=function(t,n){var r=Uint8Array,i=0,a=0,o=0,s=0,c=0,l=0,u=0,d=0,f=0,p,m;if(t[0]==3&&t[1]==0)return n||new r(0);var h=e.H,g=h.b,_=h.e,v=h.R,y=h.n,b=h.A,x=h.Z,S=h.m,C=n==null;for(C&&(n=new r(t.length>>>2<<3));i==0;)if(i=g(t,f,1),a=g(t,f+1,2),f+=3,a==0){f&7&&(f+=8-(f&7));var w=(f>>>3)+4,T=t[w-4]|t[w-3]<<8;C&&(n=e.H.W(n,d+T)),n.set(new r(t.buffer,t.byteOffset+w,T),d),f=w+T<<3,d+=T}else{if(C&&(n=e.H.W(n,d+(1<<17))),a==1&&(p=S.J,m=S.h,l=511,u=31),a==2){o=_(t,f,5)+257,s=_(t,f+5,5)+1,c=_(t,f+10,4)+4,f+=14;for(var E=1,D=0;D<38;D+=2)S.Q[D]=0,S.Q[D+1]=0;for(var D=0;D<c;D++){var O=_(t,f+D*3,3);S.Q[(S.X[D]<<1)+1]=O,O>E&&(E=O)}f+=3*c,y(S.Q,E),b(S.Q,E,S.u),p=S.w,m=S.d,f=v(S.u,(1<<E)-1,o+s,t,f,S.v);var k=h.V(S.v,0,o,S.C);l=(1<<k)-1;var A=h.V(S.v,o,s,S.D);u=(1<<A)-1,y(S.C,k),b(S.C,k,p),y(S.D,A),b(S.D,A,m)}for(;;){var j=p[x(t,f)&l];f+=j&15;var M=j>>>4;if(!(M>>>8))n[d++]=M;else if(M==256)break;else{var N=d+M-254;if(M>264){var P=S.q[M-257];N=d+(P>>>3)+_(t,f,P&7),f+=P&7}var ee=m[x(t,f)&u];f+=ee&15;var te=ee>>>4,ne=S.c[te],re=(ne>>>4)+g(t,f,ne&15);for(f+=ne&15;d<N;)n[d]=n[d++-re],n[d]=n[d++-re],n[d]=n[d++-re],n[d]=n[d++-re];d=N}}}return n.length==d?n:n.slice(0,d)},e.H.W=function(e,t){var n=e.length;if(t<=n)return e;var r=new Uint8Array(n<<1);return r.set(e,0),r},e.H.R=function(t,n,r,i,a,o){for(var s=e.H.e,c=e.H.Z,l=0;l<r;){var u=t[c(i,a)&n];a+=u&15;var d=u>>>4;if(d<=15)o[l]=d,l++;else{var f=0,p=0;d==16?(p=3+s(i,a,2),a+=2,f=o[l-1]):d==17?(p=3+s(i,a,3),a+=3):d==18&&(p=11+s(i,a,7),a+=7);for(var m=l+p;l<m;)o[l]=f,l++}}return a},e.H.V=function(e,t,n,r){for(var i=0,a=0,o=r.length>>>1;a<n;){var s=e[a+t];r[a<<1]=0,r[(a<<1)+1]=s,s>i&&(i=s),a++}for(;a<o;)r[a<<1]=0,r[(a<<1)+1]=0,a++;return i},e.H.n=function(t,n){for(var r=e.H.m,i=t.length,a,o,s,c,l,u=r.j,c=0;c<=n;c++)u[c]=0;for(c=1;c<i;c+=2)u[t[c]]++;var d=r.K;for(a=0,u[0]=0,o=1;o<=n;o++)a=a+u[o-1]<<1,d[o]=a;for(s=0;s<i;s+=2)l=t[s+1],l!=0&&(t[s]=d[l],d[l]++)},e.H.A=function(t,n,r){for(var i=t.length,a=e.H.m.r,o=0;o<i;o+=2)if(t[o+1]!=0)for(var s=o>>1,c=t[o+1],l=s<<4|c,u=n-c,d=t[o]<<u,f=d+(1<<u);d!=f;){var p=a[d]>>>15-n;r[p]=l,d++}},e.H.l=function(t,n){for(var r=e.H.m.r,i=15-n,a=0;a<t.length;a+=2){var o=t[a]<<n-t[a+1];t[a]=r[o]>>>i}},e.H.M=function(e,t,n){n<<=t&7;var r=t>>>3;e[r]|=n,e[r+1]|=n>>>8},e.H.I=function(e,t,n){n<<=t&7;var r=t>>>3;e[r]|=n,e[r+1]|=n>>>8,e[r+2]|=n>>>16},e.H.e=function(e,t,n){return(e[t>>>3]|e[(t>>>3)+1]<<8)>>>(t&7)&(1<<n)-1},e.H.b=function(e,t,n){return(e[t>>>3]|e[(t>>>3)+1]<<8|e[(t>>>3)+2]<<16)>>>(t&7)&(1<<n)-1},e.H.Z=function(e,t){return(e[t>>>3]|e[(t>>>3)+1]<<8|e[(t>>>3)+2]<<16)>>>(t&7)},e.H.i=function(e,t){return(e[t>>>3]|e[(t>>>3)+1]<<8|e[(t>>>3)+2]<<16|e[(t>>>3)+3]<<24)>>>(t&7)},e.H.m=function(){var e=Uint16Array,t=Uint32Array;return{K:new e(16),j:new e(16),X:[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],S:[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,999,999,999],T:[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0],q:new e(32),p:[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,65535,65535],z:[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0],c:new t(32),J:new e(512),_:[],h:new e(32),$:[],w:new e(32768),C:[],v:[],d:new e(32768),D:[],u:new e(512),Q:[],r:new e(32768),s:new t(286),Y:new t(30),a:new t(19),t:new t(15e3),k:new e(65536),g:new e(32768)}}(),(function(){for(var t=e.H.m,n=32768,r=0;r<n;r++){var i=r;i=(i&2863311530)>>>1|(i&1431655765)<<1,i=(i&3435973836)>>>2|(i&858993459)<<2,i=(i&4042322160)>>>4|(i&252645135)<<4,i=(i&4278255360)>>>8|(i&16711935)<<8,t.r[r]=(i>>>16|i<<16)>>>17}function a(e,t,n){for(;t--!=0;)e.push(0,n)}for(var r=0;r<32;r++)t.q[r]=t.S[r]<<3|t.T[r],t.c[r]=t.p[r]<<4|t.z[r];a(t._,144,8),a(t._,112,9),a(t._,24,7),a(t._,8,8),e.H.n(t._,9),e.H.A(t._,9,t.J),e.H.l(t._,9),a(t.$,32,5),e.H.n(t.$,5),e.H.A(t.$,5,t.h),e.H.l(t.$,5),a(t.Q,19,0),a(t.C,286,0),a(t.D,30,0),a(t.v,320,0)})(),e.H.N}(),Q.decode._readInterlace=function(e,t){for(var n=t.width,r=t.height,i=Q.decode._getBPP(t),a=i>>3,o=Math.ceil(n*i/8),s=new Uint8Array(r*o),c=0,l=[0,0,4,0,2,0,1],u=[0,4,0,2,0,1,0],d=[8,8,8,4,4,2,2],f=[8,8,4,4,2,2,1],p=0;p<7;){for(var m=d[p],h=f[p],g=0,_=0,v=l[p];v<r;)v+=m,_++;for(var y=u[p];y<n;)y+=h,g++;var b=Math.ceil(g*i/8);Q.decode._filterZero(e,t,c,g,_);for(var x=0,S=l[p];S<r;){for(var C=u[p],w=c+x*b<<3;C<n;){if(i==1){var T=e[w>>3];T=T>>7-(w&7)&1,s[S*o+(C>>3)]|=T<<7-(C&7)}if(i==2){var T=e[w>>3];T=T>>6-(w&7)&3,s[S*o+(C>>2)]|=T<<6-((C&3)<<1)}if(i==4){var T=e[w>>3];T=T>>4-(w&7)&15,s[S*o+(C>>1)]|=T<<4-((C&1)<<2)}if(i>=8)for(var E=S*o+C*a,D=0;D<a;D++)s[E+D]=e[(w>>3)+D];w+=i,C+=h}x++,S+=m}g*_!=0&&(c+=_*(1+b)),p+=1}return s},Q.decode._getBPP=function(e){return[1,null,3,1,2,null,4][e.ctype]*e.depth},Q.decode._filterZero=function(e,t,n,r,i){var a=Q.decode._getBPP(t),o=Math.ceil(r*a/8),s=Q.decode._paeth;a=Math.ceil(a/8);var c=0,l=1,u=e[n],d=0;if(u>1&&(e[n]=[0,0,1][u-2]),u==3)for(d=a;d<o;d++)e[d+1]=e[d+1]+(e[d+1-a]>>>1)&255;for(var f=0;f<i;f++)if(c=n+f*o,l=c+f+1,u=e[l-1],d=0,u==0)for(;d<o;d++)e[c+d]=e[l+d];else if(u==1){for(;d<a;d++)e[c+d]=e[l+d];for(;d<o;d++)e[c+d]=e[l+d]+e[c+d-a]}else if(u==2)for(;d<o;d++)e[c+d]=e[l+d]+e[c+d-o];else if(u==3){for(;d<a;d++)e[c+d]=e[l+d]+(e[c+d-o]>>>1);for(;d<o;d++)e[c+d]=e[l+d]+(e[c+d-o]+e[c+d-a]>>>1)}else{for(;d<a;d++)e[c+d]=e[l+d]+s(0,e[c+d-o],0);for(;d<o;d++)e[c+d]=e[l+d]+s(e[c+d-a],e[c+d-o],e[c+d-a-o])}return e},Q.decode._paeth=function(e,t,n){var r=e+t-n,i=r-e,a=r-t,o=r-n;return i*i<=a*a&&i*i<=o*o?e:a*a<=o*o?t:n},Q.decode._IHDR=function(e,t,n){var r=Q._bin;n.width=r.readUint(e,t),t+=4,n.height=r.readUint(e,t),t+=4,n.depth=e[t],t++,n.ctype=e[t],t++,n.compress=e[t],t++,n.filter=e[t],t++,n.interlace=e[t],t++},Q._bin={nextZero:function(e,t){for(;e[t]!=0;)t++;return t},readUshort:function(e,t){return e[t]<<8|e[t+1]},writeUshort:function(e,t,n){e[t]=n>>8&255,e[t+1]=n&255},readUint:function(e,t){return e[t]*16777216+(e[t+1]<<16|e[t+2]<<8|e[t+3])},writeUint:function(e,t,n){e[t]=n>>24&255,e[t+1]=n>>16&255,e[t+2]=n>>8&255,e[t+3]=n&255},readASCII:function(e,t,n){for(var r=``,i=0;i<n;i++)r+=String.fromCharCode(e[t+i]);return r},writeASCII:function(e,t,n){for(var r=0;r<n.length;r++)e[t+r]=n.charCodeAt(r)},readBytes:function(e,t,n){for(var r=[],i=0;i<n;i++)r.push(e[t+i]);return r},pad:function(e){return e.length<2?`0`+e:e},readUTF8:function(e,t,n){for(var r=``,i,a=0;a<n;a++)r+=`%`+Q._bin.pad(e[t+a].toString(16));try{i=decodeURIComponent(r)}catch{return Q._bin.readASCII(e,t,n)}return i}},Q._copyTile=function(e,t,n,r,i,a,o,s,c){for(var l=Math.min(t,i),u=Math.min(n,a),d=0,f=0,p=0;p<u;p++)for(var m=0;m<l;m++)if(o>=0&&s>=0?(d=p*t+m<<2,f=(s+p)*i+o+m<<2):(d=(-s+p)*t-o+m<<2,f=p*i+m<<2),c==0)r[f]=e[d],r[f+1]=e[d+1],r[f+2]=e[d+2],r[f+3]=e[d+3];else if(c==1){var h=e[d+3]*(1/255),g=e[d]*h,_=e[d+1]*h,v=e[d+2]*h,y=r[f+3]*(1/255),b=r[f]*y,x=r[f+1]*y,S=r[f+2]*y,C=1-h,w=h+y*C,T=w==0?0:1/w;r[f+3]=255*w,r[f+0]=(g+b*C)*T,r[f+1]=(_+x*C)*T,r[f+2]=(v+S*C)*T}else if(c==2){var h=e[d+3],g=e[d],_=e[d+1],v=e[d+2],y=r[f+3],b=r[f],x=r[f+1],S=r[f+2];h==y&&g==b&&_==x&&v==S?(r[f]=0,r[f+1]=0,r[f+2]=0,r[f+3]=0):(r[f]=g,r[f+1]=_,r[f+2]=v,r[f+3]=h)}else if(c==3){var h=e[d+3],g=e[d],_=e[d+1],v=e[d+2],y=r[f+3],b=r[f],x=r[f+1],S=r[f+2];if(h==y&&g==b&&_==x&&v==S)continue;if(h<220&&y>20)return!1}return!0},Q.encode=function(e,t,n,r,i,a,o){r??=0,o??=!1;var s=Q.encode.compress(e,t,n,r,[!1,!1,!1,0,o]);return Q.encode.compressPNG(s,-1),Q.encode._main(s,t,n,i,a)},Q.encodeLL=function(e,t,n,r,i,a,o,s){for(var c={ctype:0+(r==1?0:2)+(i==0?0:4),depth:a,frames:[]},l=(r+i)*a,u=l*t,d=0;d<e.length;d++)c.frames.push({rect:{x:0,y:0,width:t,height:n},img:new Uint8Array(e[d]),blend:0,dispose:1,bpp:Math.ceil(l/8),bpl:Math.ceil(u/8)});return Q.encode.compressPNG(c,0,!0),Q.encode._main(c,t,n,o,s)},Q.encode._main=function(e,t,n,r,i){i??={};var a=Q.crc.crc,o=Q._bin.writeUint,s=Q._bin.writeUshort,c=Q._bin.writeASCII,l=8,u=e.frames.length>1,d=!1,f=33+(u?20:0);if(i.sRGB!=null&&(f+=13),i.pHYs!=null&&(f+=21),e.ctype==3){for(var p=e.plte.length,m=0;m<p;m++)e.plte[m]>>>24!=255&&(d=!0);f+=8+p*3+4+(d?8+p*1+4:0)}for(var h=0;h<e.frames.length;h++){var g=e.frames[h];u&&(f+=38),f+=g.cimg.length+12,h!=0&&(f+=4)}f+=12;for(var _=new Uint8Array(f),v=[137,80,78,71,13,10,26,10],m=0;m<8;m++)_[m]=v[m];if(o(_,l,13),l+=4,c(_,l,`IHDR`),l+=4,o(_,l,t),l+=4,o(_,l,n),l+=4,_[l]=e.depth,l++,_[l]=e.ctype,l++,_[l]=0,l++,_[l]=0,l++,_[l]=0,l++,o(_,l,a(_,l-17,17)),l+=4,i.sRGB!=null&&(o(_,l,1),l+=4,c(_,l,`sRGB`),l+=4,_[l]=i.sRGB,l++,o(_,l,a(_,l-5,5)),l+=4),i.pHYs!=null&&(o(_,l,9),l+=4,c(_,l,`pHYs`),l+=4,o(_,l,i.pHYs[0]),l+=4,o(_,l,i.pHYs[1]),l+=4,_[l]=i.pHYs[2],l++,o(_,l,a(_,l-13,13)),l+=4),u&&(o(_,l,8),l+=4,c(_,l,`acTL`),l+=4,o(_,l,e.frames.length),l+=4,o(_,l,i.loop==null?0:i.loop),l+=4,o(_,l,a(_,l-12,12)),l+=4),e.ctype==3){var p=e.plte.length;o(_,l,p*3),l+=4,c(_,l,`PLTE`),l+=4;for(var m=0;m<p;m++){var y=m*3,b=e.plte[m],x=b&255,S=b>>>8&255,C=b>>>16&255;_[l+y+0]=x,_[l+y+1]=S,_[l+y+2]=C}if(l+=p*3,o(_,l,a(_,l-p*3-4,p*3+4)),l+=4,d){o(_,l,p),l+=4,c(_,l,`tRNS`),l+=4;for(var m=0;m<p;m++)_[l+m]=e.plte[m]>>>24&255;l+=p,o(_,l,a(_,l-p-4,p+4)),l+=4}}for(var w=0,h=0;h<e.frames.length;h++){var g=e.frames[h];u&&(o(_,l,26),l+=4,c(_,l,`fcTL`),l+=4,o(_,l,w++),l+=4,o(_,l,g.rect.width),l+=4,o(_,l,g.rect.height),l+=4,o(_,l,g.rect.x),l+=4,o(_,l,g.rect.y),l+=4,s(_,l,r[h]),l+=2,s(_,l,1e3),l+=2,_[l]=g.dispose,l++,_[l]=g.blend,l++,o(_,l,a(_,l-30,30)),l+=4);var T=g.cimg,p=T.length;o(_,l,p+(h==0?0:4)),l+=4;var E=l;c(_,l,h==0?`IDAT`:`fdAT`),l+=4,h!=0&&(o(_,l,w++),l+=4),_.set(T,l),l+=p,o(_,l,a(_,E,l-E)),l+=4}return o(_,l,0),l+=4,c(_,l,`IEND`),l+=4,o(_,l,a(_,l-4,4)),l+=4,_.buffer},Q.encode.compressPNG=function(e,t,n){for(var r=0;r<e.frames.length;r++){var i=e.frames[r];i.rect.width;var a=i.rect.height,o=new Uint8Array(a*i.bpl+a);i.cimg=Q.encode._filterZero(i.img,a,i.bpp,i.bpl,o,t,n)}},Q.encode.compress=function(e,t,n,r,i){for(var a=i[0],o=i[1],s=i[2],c=i[3],l=i[4],u=6,d=8,f=255,p=0;p<e.length;p++)for(var m=new Uint8Array(e[p]),h=m.length,g=0;g<h;g+=4)f&=m[g+3];var _=f!=255,v=Q.encode.framize(e,t,n,a,o,s),y={},b=[],x=[];if(r!=0){for(var S=[],g=0;g<v.length;g++)S.push(v[g].img.buffer);for(var C=Q.encode.concatRGBA(S),w=Q.quantize(C,r),T=0,E=new Uint8Array(w.abuf),g=0;g<v.length;g++){var D=v[g].img,O=D.length;x.push(new Uint8Array(w.inds.buffer,T>>2,O>>2));for(var p=0;p<O;p+=4)D[p]=E[T+p],D[p+1]=E[T+p+1],D[p+2]=E[T+p+2],D[p+3]=E[T+p+3];T+=O}for(var g=0;g<w.plte.length;g++)b.push(w.plte[g].est.rgba)}else for(var p=0;p<v.length;p++){var k=v[p],A=new Uint32Array(k.img.buffer),j=k.rect.width,h=A.length,M=new Uint8Array(h);x.push(M);for(var g=0;g<h;g++){var N=A[g];if(g!=0&&N==A[g-1])M[g]=M[g-1];else if(g>j&&N==A[g-j])M[g]=M[g-j];else{var P=y[N];if(P==null&&(y[N]=P=b.length,b.push(N),b.length>=300))break;M[g]=P}}}var ee=b.length;ee<=256&&l==0&&(d=ee<=2?1:ee<=4?2:ee<=16?4:8,d=Math.max(d,c));for(var p=0;p<v.length;p++){var k=v[p];k.rect.x,k.rect.y;var j=k.rect.width,te=k.rect.height,ne=k.img;new Uint32Array(ne.buffer);var re=4*j,ie=4;if(ee<=256&&l==0){re=Math.ceil(d*j/8);for(var ae=new Uint8Array(re*te),oe=x[p],se=0;se<te;se++){var g=se*re,ce=se*j;if(d==8)for(var le=0;le<j;le++)ae[g+le]=oe[ce+le];else if(d==4)for(var le=0;le<j;le++)ae[g+(le>>1)]|=oe[ce+le]<<4-(le&1)*4;else if(d==2)for(var le=0;le<j;le++)ae[g+(le>>2)]|=oe[ce+le]<<6-(le&3)*2;else if(d==1)for(var le=0;le<j;le++)ae[g+(le>>3)]|=oe[ce+le]<<7-(le&7)*1}ne=ae,u=3,ie=1}else if(_==0&&v.length==1){for(var ae=new Uint8Array(j*te*3),ue=j*te,g=0;g<ue;g++){var D=g*3,de=g*4;ae[D]=ne[de],ae[D+1]=ne[de+1],ae[D+2]=ne[de+2]}ne=ae,u=2,ie=3,re=3*j}k.img=ne,k.bpl=re,k.bpp=ie}return{ctype:u,depth:d,plte:b,frames:v}},Q.encode.framize=function(e,t,n,r,i,a){for(var o=[],s=0;s<e.length;s++){var c=new Uint8Array(e[s]),l=new Uint32Array(c.buffer),u,d=0,f=0,p=t,m=n,h=+!!r;if(s!=0){for(var g=a||r||s==1||o[s-2].dispose!=0?1:2,_=0,v=1e9,y=0;y<g;y++){for(var b=new Uint8Array(e[s-1-y]),x=new Uint32Array(e[s-1-y]),S=t,C=n,w=-1,T=-1,E=0;E<n;E++)for(var D=0;D<t;D++){var O=E*t+D;l[O]!=x[O]&&(D<S&&(S=D),D>w&&(w=D),E<C&&(C=E),E>T&&(T=E))}w==-1&&(S=C=w=T=0),i&&((S&1)==1&&S--,(C&1)==1&&C--);var k=(w-S+1)*(T-C+1);k<v&&(v=k,_=y,d=S,f=C,p=w-S+1,m=T-C+1)}var b=new Uint8Array(e[s-1-_]);_==1&&(o[s-1].dispose=2),u=new Uint8Array(p*m*4),Q._copyTile(b,t,n,u,p,m,-d,-f,0),h=+!!Q._copyTile(c,t,n,u,p,m,-d,-f,3),h==1?Q.encode._prepareDiff(c,t,n,u,{x:d,y:f,width:p,height:m}):Q._copyTile(c,t,n,u,p,m,-d,-f,0)}else u=c.slice(0);o.push({rect:{x:d,y:f,width:p,height:m},img:u,blend:h,dispose:0})}if(r)for(var s=0;s<o.length;s++){var A=o[s];if(A.blend!=1){var j=A.rect,M=o[s-1].rect,N=Math.min(j.x,M.x),P=Math.min(j.y,M.y),ee=Math.max(j.x+j.width,M.x+M.width),te=Math.max(j.y+j.height,M.y+M.height),ne={x:N,y:P,width:ee-N,height:te-P};o[s-1].dispose=1,s-1!=0&&Q.encode._updateFrame(e,t,n,o,s-1,ne,i),Q.encode._updateFrame(e,t,n,o,s,ne,i)}}var re=0;if(e.length!=1)for(var O=0;O<o.length;O++){var A=o[O];re+=A.rect.width*A.rect.height}return o},Q.encode._updateFrame=function(e,t,n,r,i,a,o){for(var s=Uint8Array,c=Uint32Array,l=new s(e[i-1]),u=new c(e[i-1]),d=i+1<e.length?new s(e[i+1]):null,f=new s(e[i]),p=new c(f.buffer),m=t,h=n,g=-1,_=-1,v=0;v<a.height;v++)for(var y=0;y<a.width;y++){var b=a.x+y,x=a.y+v,S=x*t+b,C=p[S];C==0||r[i-1].dispose==0&&u[S]==C&&(d==null||d[S*4+3]!=0)||(b<m&&(m=b),b>g&&(g=b),x<h&&(h=x),x>_&&(_=x))}g==-1&&(m=h=g=_=0),o&&((m&1)==1&&m--,(h&1)==1&&h--),a={x:m,y:h,width:g-m+1,height:_-h+1};var w=r[i];w.rect=a,w.blend=1,w.img=new Uint8Array(a.width*a.height*4),r[i-1].dispose==0?(Q._copyTile(l,t,n,w.img,a.width,a.height,-a.x,-a.y,0),Q.encode._prepareDiff(f,t,n,w.img,a)):Q._copyTile(f,t,n,w.img,a.width,a.height,-a.x,-a.y,0)},Q.encode._prepareDiff=function(e,t,n,r,i){Q._copyTile(e,t,n,r,i.width,i.height,-i.x,-i.y,2)},Q.encode._filterZero=function(e,t,n,r,i,a,o){var s=[],c=[0,1,2,3,4];a==-1?(t*r>5e5||n==1)&&(c=[0]):c=[a];var l;o&&(l={level:0});for(var u=o&&UZIP!=null?UZIP:rb.default,d=0;d<c.length;d++){for(var f=0;f<t;f++)Q.encode._filterLine(i,e,f,r,n,c[d]);s.push(u.deflate(i,l))}for(var p,m=1e9,d=0;d<s.length;d++)s[d].length<m&&(p=d,m=s[d].length);return s[p]},Q.encode._filterLine=function(e,t,n,r,i,a){var o=n*r,s=o+n,c=Q.decode._paeth;if(e[s]=a,s++,a==0){if(r<500)for(var l=0;l<r;l++)e[s+l]=t[o+l];else e.set(new Uint8Array(t.buffer,o,r),s)}else if(a==1){for(var l=0;l<i;l++)e[s+l]=t[o+l];for(var l=i;l<r;l++)e[s+l]=t[o+l]-t[o+l-i]+256&255}else if(n==0){for(var l=0;l<i;l++)e[s+l]=t[o+l];if(a==2)for(var l=i;l<r;l++)e[s+l]=t[o+l];if(a==3)for(var l=i;l<r;l++)e[s+l]=t[o+l]-(t[o+l-i]>>1)+256&255;if(a==4)for(var l=i;l<r;l++)e[s+l]=t[o+l]-c(t[o+l-i],0,0)+256&255}else{if(a==2)for(var l=0;l<r;l++)e[s+l]=t[o+l]+256-t[o+l-r]&255;if(a==3){for(var l=0;l<i;l++)e[s+l]=t[o+l]+256-(t[o+l-r]>>1)&255;for(var l=i;l<r;l++)e[s+l]=t[o+l]+256-(t[o+l-r]+t[o+l-i]>>1)&255}if(a==4){for(var l=0;l<i;l++)e[s+l]=t[o+l]+256-c(0,t[o+l-r],0)&255;for(var l=i;l<r;l++)e[s+l]=t[o+l]+256-c(t[o+l-i],t[o+l-r],t[o+l-i-r])&255}}},Q.crc={table:(function(){for(var e=new Uint32Array(256),t=0;t<256;t++){for(var n=t,r=0;r<8;r++)n&1?n=3988292384^n>>>1:n>>>=1;e[t]=n}return e})(),update:function(e,t,n,r){for(var i=0;i<r;i++)e=Q.crc.table[(e^t[n+i])&255]^e>>>8;return e},crc:function(e,t,n){return Q.crc.update(4294967295,e,t,n)^4294967295}},Q.quantize=function(e,t){var n=new Uint8Array(e),r=n.slice(0),i=new Uint32Array(r.buffer),a=Q.quantize.getKDtree(r,t),o=a[0],s=a[1];Q.quantize.planeDst;for(var c=n,l=i,u=c.length,d=new Uint8Array(n.length>>2),f=0;f<u;f+=4){var p=c[f]*(1/255),m=c[f+1]*(1/255),h=c[f+2]*(1/255),g=c[f+3]*(1/255),_=Q.quantize.getNearest(o,p,m,h,g);d[f>>2]=_.ind,l[f>>2]=_.est.rgba}return{abuf:r.buffer,inds:d,plte:s}},Q.quantize.getKDtree=function(e,t,n){n??=1e-4;var r=new Uint32Array(e.buffer),i={i0:0,i1:e.length,bst:null,est:null,tdst:0,left:null,right:null};i.bst=Q.quantize.stats(e,i.i0,i.i1),i.est=Q.quantize.estats(i.bst);for(var a=[i];a.length<t;){for(var o=0,s=0,c=0;c<a.length;c++)a[c].est.L>o&&(o=a[c].est.L,s=c);if(o<n)break;var l=a[s],u=Q.quantize.splitPixels(e,r,l.i0,l.i1,l.est.e,l.est.eMq255);if(l.i0>=u||l.i1<=u)l.est.L=0;else{var d={i0:l.i0,i1:u,bst:null,est:null,tdst:0,left:null,right:null};d.bst=Q.quantize.stats(e,d.i0,d.i1),d.est=Q.quantize.estats(d.bst);var f={i0:u,i1:l.i1,bst:null,est:null,tdst:0,left:null,right:null};f.bst={R:[],m:[],N:l.bst.N-d.bst.N};for(var c=0;c<16;c++)f.bst.R[c]=l.bst.R[c]-d.bst.R[c];for(var c=0;c<4;c++)f.bst.m[c]=l.bst.m[c]-d.bst.m[c];f.est=Q.quantize.estats(f.bst),l.left=d,l.right=f,a[s]=d,a.push(f)}}a.sort(function(e,t){return t.bst.N-e.bst.N});for(var c=0;c<a.length;c++)a[c].ind=c;return[i,a]},Q.quantize.getNearest=function(e,t,n,r,i){if(e.left==null)return e.tdst=Q.quantize.dist(e.est.q,t,n,r,i),e;var a=Q.quantize.planeDst(e.est,t,n,r,i),o=e.left,s=e.right;a>0&&(o=e.right,s=e.left);var c=Q.quantize.getNearest(o,t,n,r,i);if(c.tdst<=a*a)return c;var l=Q.quantize.getNearest(s,t,n,r,i);return l.tdst<c.tdst?l:c},Q.quantize.planeDst=function(e,t,n,r,i){var a=e.e;return a[0]*t+a[1]*n+a[2]*r+a[3]*i-e.eMq},Q.quantize.dist=function(e,t,n,r,i){var a=t-e[0],o=n-e[1],s=r-e[2],c=i-e[3];return a*a+o*o+s*s+c*c},Q.quantize.splitPixels=function(e,t,n,r,i,a){var o=Q.quantize.vecDot;for(r-=4;n<r;){for(;o(e,n,i)<=a;)n+=4;for(;o(e,r,i)>a;)r-=4;if(n>=r)break;var s=t[n>>2];t[n>>2]=t[r>>2],t[r>>2]=s,n+=4,r-=4}for(;o(e,n,i)>a;)n-=4;return n+4},Q.quantize.vecDot=function(e,t,n){return e[t]*n[0]+e[t+1]*n[1]+e[t+2]*n[2]+e[t+3]*n[3]},Q.quantize.stats=function(e,t,n){for(var r=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],i=[0,0,0,0],a=n-t>>2,o=t;o<n;o+=4){var s=e[o]*(1/255),c=e[o+1]*(1/255),l=e[o+2]*(1/255),u=e[o+3]*(1/255);i[0]+=s,i[1]+=c,i[2]+=l,i[3]+=u,r[0]+=s*s,r[1]+=s*c,r[2]+=s*l,r[3]+=s*u,r[5]+=c*c,r[6]+=c*l,r[7]+=c*u,r[10]+=l*l,r[11]+=l*u,r[15]+=u*u}return r[4]=r[1],r[8]=r[2],r[9]=r[6],r[12]=r[3],r[13]=r[7],r[14]=r[11],{R:r,m:i,N:a}},Q.quantize.estats=function(e){var t=e.R,n=e.m,r=e.N,i=n[0],a=n[1],o=n[2],s=n[3],c=r==0?0:1/r,l=[t[0]-i*i*c,t[1]-i*a*c,t[2]-i*o*c,t[3]-i*s*c,t[4]-a*i*c,t[5]-a*a*c,t[6]-a*o*c,t[7]-a*s*c,t[8]-o*i*c,t[9]-o*a*c,t[10]-o*o*c,t[11]-o*s*c,t[12]-s*i*c,t[13]-s*a*c,t[14]-s*o*c,t[15]-s*s*c],u=l,d=Q.M4,f=[.5,.5,.5,.5],p=0,m=0;if(r!=0)for(var h=0;h<10&&(f=d.multVec(u,f),m=Math.sqrt(d.dot(f,f)),f=d.sml(1/m,f),!(Math.abs(m-p)<1e-9));h++)p=m;var g=[i*c,a*c,o*c,s*c],_=d.dot(d.sml(255,g),f);return{Cov:l,q:g,e:f,L:p,eMq255:_,eMq:d.dot(f,g),rgba:(Math.round(255*g[3])<<24|Math.round(255*g[2])<<16|Math.round(255*g[1])<<8|Math.round(255*g[0]))>>>0}},Q.M4={multVec:function(e,t){return[e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3],e[4]*t[0]+e[5]*t[1]+e[6]*t[2]+e[7]*t[3],e[8]*t[0]+e[9]*t[1]+e[10]*t[2]+e[11]*t[3],e[12]*t[0]+e[13]*t[1]+e[14]*t[2]+e[15]*t[3]]},dot:function(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]},sml:function(e,t){return[e*t[0],e*t[1],e*t[2],e*t[3]]}},Q.encode.concatRGBA=function(e){for(var t=0,n=0;n<e.length;n++)t+=e[n].byteLength;for(var r=new Uint8Array(t),i=0,n=0;n<e.length;n++){for(var a=new Uint8Array(e[n]),o=a.length,s=0;s<o;s+=4){var c=a[s],l=a[s+1],u=a[s+2],d=a[s+3];d==0&&(c=l=u=0),r[i+s]=c,r[i+s+1]=l,r[i+s+2]=u,r[i+s+3]=d}i+=o}return r.buffer}})),ab,ob,sb,cb,lb=s((()=>{ib(),ab=function(e){if(e===0)return sb.Greyscale;if(e===2)return sb.Truecolour;if(e===3)return sb.IndexedColour;if(e===4)return sb.GreyscaleWithAlpha;if(e===6)return sb.TruecolourWithAlpha;throw Error(`Unknown color type: `+e)},ob=function(e){for(var t=Math.floor(e.length/4),n=new Uint8Array(t*3),r=new Uint8Array(t*1),i=0,a=0,o=0;i<e.length;)n[a++]=e[i++],n[a++]=e[i++],n[a++]=e[i++],r[o++]=e[i++];return{rgbChannel:n,alphaChannel:r}},(function(e){e.Greyscale=`Greyscale`,e.Truecolour=`Truecolour`,e.IndexedColour=`IndexedColour`,e.GreyscaleWithAlpha=`GreyscaleWithAlpha`,e.TruecolourWithAlpha=`TruecolourWithAlpha`})(sb||={}),cb=function(){function e(e){var t=Q.decode(e),n=Q.toRGBA8(t);if(n.length>1)throw Error(`Animated PNGs are not supported`);var r=ob(new Uint8Array(n[0])),i=r.rgbChannel,a=r.alphaChannel;this.rgbChannel=i,a.some(function(e){return e<255})&&(this.alphaChannel=a),this.type=ab(t.ctype),this.width=t.width,this.height=t.height,this.bitsPerComponent=8}return e.load=function(t){return new e(t)},e}()})),ub,db=s((()=>{G(),lb(),ub=function(){function e(e){this.image=e,this.bitsPerComponent=e.bitsPerComponent,this.width=e.width,this.height=e.height,this.colorSpace=`DeviceRGB`}return e.for=function(t){return Am(this,void 0,void 0,function(){var n;return jm(this,function(r){return n=cb.load(t),[2,new e(n)]})})},e.prototype.embedIntoContext=function(e,t){return Am(this,void 0,void 0,function(){var n,r;return jm(this,function(i){return n=this.embedAlphaChannel(e),r=e.flateStream(this.image.rgbChannel,{Type:`XObject`,Subtype:`Image`,BitsPerComponent:this.image.bitsPerComponent,Width:this.image.width,Height:this.image.height,ColorSpace:this.colorSpace,SMask:n}),t?(e.assign(t,r),[2,t]):[2,e.register(r)]})})},e.prototype.embedAlphaChannel=function(e){if(this.image.alphaChannel){var t=e.flateStream(this.image.alphaChannel,{Type:`XObject`,Subtype:`Image`,Height:this.image.height,Width:this.image.width,BitsPerComponent:this.image.bitsPerComponent,ColorSpace:`DeviceGray`,Decode:[0,1]});return e.register(t)}},e}()})),fb,pb=s((()=>{fb=function(){function e(e,t,n){this.bytes=e,this.start=t||0,this.pos=this.start,this.end=t&&n?t+n:this.bytes.length}return Object.defineProperty(e.prototype,"length",{get:function(){return this.end-this.start},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isEmpty",{get:function(){return this.length===0},enumerable:!1,configurable:!0}),e.prototype.getByte=function(){return this.pos>=this.end?-1:this.bytes[this.pos++]},e.prototype.getUint16=function(){var e=this.getByte(),t=this.getByte();return e===-1||t===-1?-1:(e<<8)+t},e.prototype.getInt32=function(){var e=this.getByte(),t=this.getByte(),n=this.getByte(),r=this.getByte();return(e<<24)+(t<<16)+(n<<8)+r},e.prototype.getBytes=function(e,t){t===void 0&&(t=!1);var n=this.bytes,r=this.pos,i=this.end;if(e){var a=r+e;a>i&&(a=i),this.pos=a;var o=n.subarray(r,a);return t?new Uint8ClampedArray(o):o}var o=n.subarray(r,i);return t?new Uint8ClampedArray(o):o},e.prototype.peekByte=function(){var e=this.getByte();return this.pos--,e},e.prototype.peekBytes=function(e,t){t===void 0&&(t=!1);var n=this.getBytes(e,t);return this.pos-=n.length,n},e.prototype.skip=function(e){e||=1,this.pos+=e},e.prototype.reset=function(){this.pos=this.start},e.prototype.moveStart=function(){this.start=this.pos},e.prototype.makeSubStream=function(t,n){return new e(this.bytes,t,n)},e.prototype.decode=function(){return this.bytes},e}()})),mb,hb,gb=s((()=>{lv(),pb(),mb=new Uint8Array,hb=function(){function e(e){if(this.pos=0,this.bufferLength=0,this.eof=!1,this.buffer=mb,this.minBufferLength=512,e)for(;this.minBufferLength<e;)this.minBufferLength*=2}return Object.defineProperty(e.prototype,"isEmpty",{get:function(){for(;!this.eof&&this.bufferLength===0;)this.readBlock();return this.bufferLength===0},enumerable:!1,configurable:!0}),e.prototype.getByte=function(){for(var e=this.pos;this.bufferLength<=e;){if(this.eof)return-1;this.readBlock()}return this.buffer[this.pos++]},e.prototype.getUint16=function(){var e=this.getByte(),t=this.getByte();return e===-1||t===-1?-1:(e<<8)+t},e.prototype.getInt32=function(){var e=this.getByte(),t=this.getByte(),n=this.getByte(),r=this.getByte();return(e<<24)+(t<<16)+(n<<8)+r},e.prototype.getBytes=function(e,t){t===void 0&&(t=!1);var n,r=this.pos;if(e){for(this.ensureBuffer(r+e),n=r+e;!this.eof&&this.bufferLength<n;)this.readBlock();var i=this.bufferLength;n>i&&(n=i)}else{for(;!this.eof;)this.readBlock();n=this.bufferLength}this.pos=n;var a=this.buffer.subarray(r,n);return t&&!(a instanceof Uint8ClampedArray)?new Uint8ClampedArray(a):a},e.prototype.peekByte=function(){var e=this.getByte();return this.pos--,e},e.prototype.peekBytes=function(e,t){t===void 0&&(t=!1);var n=this.getBytes(e,t);return this.pos-=n.length,n},e.prototype.skip=function(e){e||=1,this.pos+=e},e.prototype.reset=function(){this.pos=0},e.prototype.makeSubStream=function(e,t){for(var n=e+t;this.bufferLength<=n&&!this.eof;)this.readBlock();return new fb(this.buffer,e,t)},e.prototype.decode=function(){for(;!this.eof;)this.readBlock();return this.buffer.subarray(0,this.bufferLength)},e.prototype.readBlock=function(){throw new I_(this.constructor.name,`readBlock`)},e.prototype.ensureBuffer=function(e){var t=this.buffer;if(e<=t.byteLength)return t;for(var n=this.minBufferLength;n<e;)n*=2;var r=new Uint8Array(n);return r.set(t),this.buffer=r},e}()})),_b,vb,yb=s((()=>{G(),gb(),_b=function(e){return e===32||e===9||e===13||e===10},vb=function(e){W(t,e);function t(t,n){var r=e.call(this,n)||this;return r.stream=t,r.input=new Uint8Array(5),n&&=.8*n,r}return t.prototype.readBlock=function(){for(var e=126,t=122,n=-1,r=this.stream,i=r.getByte();_b(i);)i=r.getByte();if(i===n||i===e)this.eof=!0;else{var a=this.bufferLength,o,s;if(i===t){for(o=this.ensureBuffer(a+4),s=0;s<4;++s)o[a+s]=0;this.bufferLength+=4}else{var c=this.input;for(c[0]=i,s=1;s<5;++s){for(i=r.getByte();_b(i);)i=r.getByte();if(c[s]=i,i===n||i===e)break}if(o=this.ensureBuffer(a+s-1),this.bufferLength+=s-1,s<5){for(;s<5;++s)c[s]=117;this.eof=!0}var l=0;for(s=0;s<5;++s)l=l*85+(c[s]-33);for(s=3;s>=0;--s)o[a+s]=l&255,l>>=8}}},t}(hb)})),bb,xb=s((()=>{G(),gb(),bb=function(e){W(t,e);function t(t,n){var r=e.call(this,n)||this;return r.stream=t,r.firstDigit=-1,n&&=.5*n,r}return t.prototype.readBlock=function(){var e=this.stream.getBytes(8e3);if(!e.length)this.eof=!0;else{for(var t=e.length+1>>1,n=this.ensureBuffer(this.bufferLength+t),r=this.bufferLength,i=this.firstDigit,a=0,o=e.length;a<o;a++){var s=e[a],c=void 0;if(s>=48&&s<=57)c=s&15;else if(s>=65&&s<=70||s>=97&&s<=102)c=(s&15)+9;else if(s===62){this.eof=!0;break}else continue;i<0?i=c:(n[r++]=i<<4|c,i=-1)}i>=0&&this.eof&&(n[r++]=i<<4,i=-1),this.firstDigit=i,this.bufferLength=r}},t}(hb)})),Sb,Cb,wb,Tb,Eb,Db,Ob=s((()=>{G(),gb(),Sb=new Int32Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Cb=new Int32Array([3,4,5,6,7,8,9,10,65547,65549,65551,65553,131091,131095,131099,131103,196643,196651,196659,196667,262211,262227,262243,262259,327811,327843,327875,327907,258,258,258]),wb=new Int32Array([1,2,3,4,65541,65543,131081,131085,196625,196633,262177,262193,327745,327777,393345,393409,459009,459137,524801,525057,590849,591361,657409,658433,724993,727041,794625,798721,868353,876545]),Tb=[new Int32Array([459008,524368,524304,524568,459024,524400,524336,590016,459016,524384,524320,589984,524288,524416,524352,590048,459012,524376,524312,589968,459028,524408,524344,590032,459020,524392,524328,59e4,524296,524424,524360,590064,459010,524372,524308,524572,459026,524404,524340,590024,459018,524388,524324,589992,524292,524420,524356,590056,459014,524380,524316,589976,459030,524412,524348,590040,459022,524396,524332,590008,524300,524428,524364,590072,459009,524370,524306,524570,459025,524402,524338,590020,459017,524386,524322,589988,524290,524418,524354,590052,459013,524378,524314,589972,459029,524410,524346,590036,459021,524394,524330,590004,524298,524426,524362,590068,459011,524374,524310,524574,459027,524406,524342,590028,459019,524390,524326,589996,524294,524422,524358,590060,459015,524382,524318,589980,459031,524414,524350,590044,459023,524398,524334,590012,524302,524430,524366,590076,459008,524369,524305,524569,459024,524401,524337,590018,459016,524385,524321,589986,524289,524417,524353,590050,459012,524377,524313,589970,459028,524409,524345,590034,459020,524393,524329,590002,524297,524425,524361,590066,459010,524373,524309,524573,459026,524405,524341,590026,459018,524389,524325,589994,524293,524421,524357,590058,459014,524381,524317,589978,459030,524413,524349,590042,459022,524397,524333,590010,524301,524429,524365,590074,459009,524371,524307,524571,459025,524403,524339,590022,459017,524387,524323,589990,524291,524419,524355,590054,459013,524379,524315,589974,459029,524411,524347,590038,459021,524395,524331,590006,524299,524427,524363,590070,459011,524375,524311,524575,459027,524407,524343,590030,459019,524391,524327,589998,524295,524423,524359,590062,459015,524383,524319,589982,459031,524415,524351,590046,459023,524399,524335,590014,524303,524431,524367,590078,459008,524368,524304,524568,459024,524400,524336,590017,459016,524384,524320,589985,524288,524416,524352,590049,459012,524376,524312,589969,459028,524408,524344,590033,459020,524392,524328,590001,524296,524424,524360,590065,459010,524372,524308,524572,459026,524404,524340,590025,459018,524388,524324,589993,524292,524420,524356,590057,459014,524380,524316,589977,459030,524412,524348,590041,459022,524396,524332,590009,524300,524428,524364,590073,459009,524370,524306,524570,459025,524402,524338,590021,459017,524386,524322,589989,524290,524418,524354,590053,459013,524378,524314,589973,459029,524410,524346,590037,459021,524394,524330,590005,524298,524426,524362,590069,459011,524374,524310,524574,459027,524406,524342,590029,459019,524390,524326,589997,524294,524422,524358,590061,459015,524382,524318,589981,459031,524414,524350,590045,459023,524398,524334,590013,524302,524430,524366,590077,459008,524369,524305,524569,459024,524401,524337,590019,459016,524385,524321,589987,524289,524417,524353,590051,459012,524377,524313,589971,459028,524409,524345,590035,459020,524393,524329,590003,524297,524425,524361,590067,459010,524373,524309,524573,459026,524405,524341,590027,459018,524389,524325,589995,524293,524421,524357,590059,459014,524381,524317,589979,459030,524413,524349,590043,459022,524397,524333,590011,524301,524429,524365,590075,459009,524371,524307,524571,459025,524403,524339,590023,459017,524387,524323,589991,524291,524419,524355,590055,459013,524379,524315,589975,459029,524411,524347,590039,459021,524395,524331,590007,524299,524427,524363,590071,459011,524375,524311,524575,459027,524407,524343,590031,459019,524391,524327,589999,524295,524423,524359,590063,459015,524383,524319,589983,459031,524415,524351,590047,459023,524399,524335,590015,524303,524431,524367,590079]),9],Eb=[new Int32Array([327680,327696,327688,327704,327684,327700,327692,327708,327682,327698,327690,327706,327686,327702,327694,0,327681,327697,327689,327705,327685,327701,327693,327709,327683,327699,327691,327707,327687,327703,327695,0]),5],Db=function(e){W(t,e);function t(t,n){var r=e.call(this,n)||this;r.stream=t;var i=t.getByte(),a=t.getByte();if(i===-1||a===-1)throw Error(`Invalid header in flate stream: `+i+`, `+a);if((i&15)!=8)throw Error(`Unknown compression method in flate stream: `+i+`, `+a);if(((i<<8)+a)%31!=0)throw Error(`Bad FCHECK in flate stream: `+i+`, `+a);if(a&32)throw Error(`FDICT bit set in flate stream: `+i+`, `+a);return r.codeSize=0,r.codeBuf=0,r}return t.prototype.readBlock=function(){var e,t,n=this.stream,r=this.getBits(3);if(r&1&&(this.eof=!0),r>>=1,r===0){var i=void 0;if((i=n.getByte())===-1)throw Error(`Bad block header in flate stream`);var a=i;if((i=n.getByte())===-1||(a|=i<<8,(i=n.getByte())===-1))throw Error(`Bad block header in flate stream`);var o=i;if((i=n.getByte())===-1)throw Error(`Bad block header in flate stream`);if(o|=i<<8,o!==(~a&65535)&&(a!==0||o!==0))throw Error(`Bad uncompressed block length in flate stream`);this.codeBuf=0,this.codeSize=0;var s=this.bufferLength;e=this.ensureBuffer(s+a);var c=s+a;if(this.bufferLength=c,a===0)n.peekByte()===-1&&(this.eof=!0);else for(var l=s;l<c;++l){if((i=n.getByte())===-1){this.eof=!0;break}e[l]=i}}else{var u,d;if(r===1)u=Tb,d=Eb;else if(r===2){var f=this.getBits(5)+257,p=this.getBits(5)+1,m=this.getBits(4)+4,h=new Uint8Array(Sb.length),g=void 0;for(g=0;g<m;++g)h[Sb[g]]=this.getBits(3);var _=this.generateHuffmanTable(h);t=0,g=0;for(var v=f+p,y=new Uint8Array(v),b=void 0,x=void 0,S=void 0;g<v;){var C=this.getCode(_);if(C===16)b=2,x=3,S=t;else if(C===17)b=3,x=3,S=t=0;else if(C===18)b=7,x=11,S=t=0;else{y[g++]=t=C;continue}for(var w=this.getBits(b)+x;w-->0;)y[g++]=S}u=this.generateHuffmanTable(y.subarray(0,f)),d=this.generateHuffmanTable(y.subarray(f,v))}else throw Error(`Unknown block type in flate stream`);e=this.buffer;for(var T=e?e.length:0,E=this.bufferLength;;){var D=this.getCode(u);if(D<256)E+1>=T&&(e=this.ensureBuffer(E+1),T=e.length),e[E++]=D;else{if(D===256){this.bufferLength=E;return}D-=257,D=Cb[D];var O=D>>16;O>0&&(O=this.getBits(O)),t=(D&65535)+O,D=this.getCode(d),D=wb[D],O=D>>16,O>0&&(O=this.getBits(O));var k=(D&65535)+O;E+t>=T&&(e=this.ensureBuffer(E+t),T=e.length);for(var A=0;A<t;++A,++E)e[E]=e[E-k]}}}},t.prototype.getBits=function(e){for(var t=this.stream,n=this.codeSize,r=this.codeBuf,i;n<e;){if((i=t.getByte())===-1)throw Error(`Bad encoding in flate stream`);r|=i<<n,n+=8}return i=r&(1<<e)-1,this.codeBuf=r>>e,this.codeSize=n-=e,i},t.prototype.getCode=function(e){for(var t=this.stream,n=e[0],r=e[1],i=this.codeSize,a=this.codeBuf,o;i<r&&(o=t.getByte())!==-1;)a|=o<<i,i+=8;var s=n[a&(1<<r)-1];typeof n==`number`&&console.log(`FLATE:`,s);var c=s>>16,l=s&65535;if(c<1||i<c)throw Error(`Bad encoding in flate stream`);return this.codeBuf=a>>c,this.codeSize=i-c,l},t.prototype.generateHuffmanTable=function(e){for(var t=e.length,n=0,r=0;r<t;++r)e[r]>n&&(n=e[r]);for(var i=1<<n,a=new Int32Array(i),o=1,s=0,c=2;o<=n;++o,s<<=1,c<<=1)for(var l=0;l<t;++l)if(e[l]===o){var u=0,d=s;for(r=0;r<o;++r)u=u<<1|d&1,d>>=1;for(r=u;r<i;r+=c)a[r]=o<<16|l;++s}return[a,n]},t}(hb)})),kb,Ab=s((()=>{G(),gb(),kb=function(e){W(t,e);function t(t,n,r){var i=e.call(this,n)||this;i.stream=t,i.cachedData=0,i.bitsCached=0;for(var a=4096,o={earlyChange:r,codeLength:9,nextCode:258,dictionaryValues:new Uint8Array(a),dictionaryLengths:new Uint16Array(a),dictionaryPrevCodes:new Uint16Array(a),currentSequence:new Uint8Array(a),currentSequenceLength:0},s=0;s<256;++s)o.dictionaryValues[s]=s,o.dictionaryLengths[s]=1;return i.lzwState=o,i}return t.prototype.readBlock=function(){var e=512,t=e*2,n=e,r,i,a,o=this.lzwState;if(o){var s=o.earlyChange,c=o.nextCode,l=o.dictionaryValues,u=o.dictionaryLengths,d=o.dictionaryPrevCodes,f=o.codeLength,p=o.prevCode,m=o.currentSequence,h=o.currentSequenceLength,g=0,_=this.bufferLength,v=this.ensureBuffer(this.bufferLength+t);for(r=0;r<e;r++){var y=this.readBits(f),b=h>0;if(!y||y<256)m[0]=y,h=1;else if(y>=258){if(y<c)for(h=u[y],i=h-1,a=y;i>=0;i--)m[i]=l[a],a=d[a];else m[h++]=m[0]}else if(y===256){f=9,c=258,h=0;continue}else{this.eof=!0,delete this.lzwState;break}if(b&&(d[c]=p,u[c]=u[p]+1,l[c]=m[0],c++,f=c+s&c+s-1?f:Math.min(Math.log(c+s)/.6931471805599453+1,12)|0),p=y,g+=h,t<g){do t+=n;while(t<g);v=this.ensureBuffer(this.bufferLength+t)}for(i=0;i<h;i++)v[_++]=m[i]}o.nextCode=c,o.codeLength=f,o.prevCode=p,o.currentSequenceLength=h,this.bufferLength=_}},t.prototype.readBits=function(e){for(var t=this.bitsCached,n=this.cachedData;t<e;){var r=this.stream.getByte();if(r===-1)return this.eof=!0,null;n=n<<8|r,t+=8}return this.bitsCached=t-=e,this.cachedData=n,n>>>t&(1<<e)-1},t}(hb)})),jb,Mb=s((()=>{G(),gb(),jb=function(e){W(t,e);function t(t,n){var r=e.call(this,n)||this;return r.stream=t,r}return t.prototype.readBlock=function(){var e=this.stream.getBytes(2);if(!e||e.length<2||e[0]===128)this.eof=!0;else{var t,n=this.bufferLength,r=e[0];if(r<128){if(t=this.ensureBuffer(n+r+1),t[n++]=e[1],r>0){var i=this.stream.getBytes(r);t.set(i,n),n+=r}}else{r=257-r;var a=e[1];t=this.ensureBuffer(n+r+1);for(var o=0;o<r;o++)t[n++]=a}this.bufferLength=n}},t}(hb)})),Nb,Pb,Fb=s((()=>{lv(),vv(),Rv(),Pv(),_v(),yb(),xb(),Ob(),Ab(),Mb(),pb(),Nb=function(e,t,n){if(t===X.of(`FlateDecode`))return new Db(e);if(t===X.of(`LZWDecode`)){var r=1;if(n instanceof Z){var i=n.lookup(X.of(`EarlyChange`));i instanceof gv&&(r=i.asNumber())}return new kb(e,void 0,r)}if(t===X.of(`ASCII85Decode`))return new vb(e);if(t===X.of(`ASCIIHexDecode`))return new bb(e);if(t===X.of(`RunLengthDecode`))return new jb(e);throw new z_(t.asString())},Pb=function(e){var t=e.dict,n=e.contents,r=new fb(n),i=t.lookup(X.of(`Filter`)),a=t.lookup(X.of(`DecodeParms`));if(i instanceof X)r=Nb(r,i,a);else if(i instanceof Y)for(var o=0,s=i.size();o<s;o++)r=Nb(r,i.lookup(o,X),a&&a.lookupMaybe(o,Z));else if(i)throw new R_([X,Y],i);return r}})),Ib,Lb,Rb,zb=s((()=>{G(),lv(),_v(),Hv(),Bv(),Fb(),ny(),dv(),F_(),Ib=function(e){var t=e.MediaBox();return{left:0,bottom:0,right:t.lookup(2,gv).asNumber()-t.lookup(0,gv).asNumber(),top:t.lookup(3,gv).asNumber()-t.lookup(1,gv).asNumber()}},Lb=function(e){return[1,0,0,1,-e.left,-e.bottom]},Rb=function(){function e(e,t,n){this.page=e;var r=t??Ib(e);this.width=r.right-r.left,this.height=r.top-r.bottom,this.boundingBox=r,this.transformationMatrix=n??Lb(r)}return e.for=function(t,n,r){return Am(this,void 0,void 0,function(){return jm(this,function(i){return[2,new e(t,n,r)]})})},e.prototype.embedIntoContext=function(e,t){return Am(this,void 0,void 0,function(){var n,r,i,a,o,s,c,l,u,d;return jm(this,function(f){if(n=this.page.normalizedEntries(),r=n.Contents,i=n.Resources,!r)throw new V_;return a=this.decodeContents(r),o=this.boundingBox,s=o.left,c=o.bottom,l=o.right,u=o.top,d=e.flateStream(a,{Type:`XObject`,Subtype:`Form`,FormType:1,BBox:[s,c,l,u],Matrix:this.transformationMatrix,Resources:i}),t?(e.assign(t,d),[2,t]):[2,e.register(d)]})})},e.prototype.decodeContents=function(e){for(var t=Uint8Array.of(J.Newline),n=[],r=0,i=e.size();r<i;r++){var a=e.lookup(r,zv),o=void 0;if(a instanceof Vv)o=Pb(a).decode();else if(a instanceof ty)o=a.getUnencodedContents();else throw new H_(a);n.push(o,t)}return ph.apply(void 0,n)},e}()})),Bb,Vb,Hb,Ub,Wb,Gb,Kb=s((()=>{vv(),xv(),Pv(),_v(),F_(),Bb=function(e,t){if(e!==void 0)return t[e]},(function(e){e.UseNone=`UseNone`,e.UseOutlines=`UseOutlines`,e.UseThumbs=`UseThumbs`,e.UseOC=`UseOC`})(Vb||={}),(function(e){e.L2R=`L2R`,e.R2L=`R2L`})(Hb||={}),(function(e){e.None=`None`,e.AppDefault=`AppDefault`})(Ub||={}),(function(e){e.Simplex=`Simplex`,e.DuplexFlipShortEdge=`DuplexFlipShortEdge`,e.DuplexFlipLongEdge=`DuplexFlipLongEdge`})(Wb||={}),Gb=function(){function e(e){this.dict=e}return e.prototype.lookupBool=function(e){var t=this.dict.lookup(X.of(e));if(t instanceof bv)return t},e.prototype.lookupName=function(e){var t=this.dict.lookup(X.of(e));if(t instanceof X)return t},e.prototype.HideToolbar=function(){return this.lookupBool(`HideToolbar`)},e.prototype.HideMenubar=function(){return this.lookupBool(`HideMenubar`)},e.prototype.HideWindowUI=function(){return this.lookupBool(`HideWindowUI`)},e.prototype.FitWindow=function(){return this.lookupBool(`FitWindow`)},e.prototype.CenterWindow=function(){return this.lookupBool(`CenterWindow`)},e.prototype.DisplayDocTitle=function(){return this.lookupBool(`DisplayDocTitle`)},e.prototype.NonFullScreenPageMode=function(){return this.lookupName(`NonFullScreenPageMode`)},e.prototype.Direction=function(){return this.lookupName(`Direction`)},e.prototype.PrintScaling=function(){return this.lookupName(`PrintScaling`)},e.prototype.Duplex=function(){return this.lookupName(`Duplex`)},e.prototype.PickTrayByPDFSize=function(){return this.lookupBool(`PickTrayByPDFSize`)},e.prototype.PrintPageRange=function(){var e=this.dict.lookup(X.of(`PrintPageRange`));if(e instanceof Y)return e},e.prototype.NumCopies=function(){var e=this.dict.lookup(X.of(`NumCopies`));if(e instanceof gv)return e},e.prototype.getHideToolbar=function(){return this.HideToolbar()?.asBoolean()??!1},e.prototype.getHideMenubar=function(){return this.HideMenubar()?.asBoolean()??!1},e.prototype.getHideWindowUI=function(){return this.HideWindowUI()?.asBoolean()??!1},e.prototype.getFitWindow=function(){return this.FitWindow()?.asBoolean()??!1},e.prototype.getCenterWindow=function(){return this.CenterWindow()?.asBoolean()??!1},e.prototype.getDisplayDocTitle=function(){return this.DisplayDocTitle()?.asBoolean()??!1},e.prototype.getNonFullScreenPageMode=function(){return Bb(this.NonFullScreenPageMode()?.decodeText(),Vb)??Vb.UseNone},e.prototype.getReadingDirection=function(){return Bb(this.Direction()?.decodeText(),Hb)??Hb.L2R},e.prototype.getPrintScaling=function(){return Bb(this.PrintScaling()?.decodeText(),Ub)??Ub.AppDefault},e.prototype.getDuplex=function(){return Bb(this.Duplex()?.decodeText(),Wb)},e.prototype.getPickTrayByPDFSize=function(){return this.PickTrayByPDFSize()?.asBoolean()},e.prototype.getPrintPageRange=function(){var e=this.PrintPageRange();if(!e)return[];for(var t=[],n=0;n<e.size();n+=2){var r=e.lookup(n,gv).asNumber(),i=e.lookup(n+1,gv).asNumber();t.push({start:r,end:i})}return t},e.prototype.getNumCopies=function(){return this.NumCopies()?.asNumber()??1},e.prototype.setHideToolbar=function(e){var t=this.dict.context.obj(e);this.dict.set(X.of(`HideToolbar`),t)},e.prototype.setHideMenubar=function(e){var t=this.dict.context.obj(e);this.dict.set(X.of(`HideMenubar`),t)},e.prototype.setHideWindowUI=function(e){var t=this.dict.context.obj(e);this.dict.set(X.of(`HideWindowUI`),t)},e.prototype.setFitWindow=function(e){var t=this.dict.context.obj(e);this.dict.set(X.of(`FitWindow`),t)},e.prototype.setCenterWindow=function(e){var t=this.dict.context.obj(e);this.dict.set(X.of(`CenterWindow`),t)},e.prototype.setDisplayDocTitle=function(e){var t=this.dict.context.obj(e);this.dict.set(X.of(`DisplayDocTitle`),t)},e.prototype.setNonFullScreenPageMode=function(e){g_(e,`nonFullScreenPageMode`,Vb);var t=X.of(e);this.dict.set(X.of(`NonFullScreenPageMode`),t)},e.prototype.setReadingDirection=function(e){g_(e,`readingDirection`,Hb);var t=X.of(e);this.dict.set(X.of(`Direction`),t)},e.prototype.setPrintScaling=function(e){g_(e,`printScaling`,Ub);var t=X.of(e);this.dict.set(X.of(`PrintScaling`),t)},e.prototype.setDuplex=function(e){g_(e,`duplex`,Wb);var t=X.of(e);this.dict.set(X.of(`Duplex`),t)},e.prototype.setPickTrayByPDFSize=function(e){var t=this.dict.context.obj(e);this.dict.set(X.of(`PickTrayByPDFSize`),t)},e.prototype.setPrintPageRange=function(e){Array.isArray(e)||(e=[e]);for(var t=[],n=0,r=e.length;n<r;n++)t.push(e[n].start),t.push(e[n].end);S_(t,`printPageRange`,[`number`]);var i=this.dict.context.obj(t);this.dict.set(X.of(`PrintPageRange`),i)},e.prototype.setNumCopies=function(e){C_(e,`numCopies`,1,Number.MAX_VALUE),E_(e,`numCopies`);var t=this.dict.context.obj(e);this.dict.set(X.of(`NumCopies`),t)},e.fromDict=function(t){return new e(t)},e.create=function(t){return new e(t.obj({}))},e}()})),qb,Jb,Yb=s((()=>{Rv(),Wy(),jy(),Pv(),_v(),vv(),Kv(),F_(),lv(),qb=/\/([^\0\t\n\f\r\ ]+)[\0\t\n\f\r\ ]*(\d*\.\d+|\d+)?[\0\t\n\f\r\ ]+Tf/,Jb=function(){function e(e,t){this.dict=e,this.ref=t}return e.prototype.T=function(){return this.dict.lookupMaybe(X.of(`T`),Uy,Ay)},e.prototype.Ff=function(){var e=this.getInheritableAttribute(X.of(`Ff`));return this.dict.context.lookupMaybe(e,gv)},e.prototype.V=function(){var e=this.getInheritableAttribute(X.of(`V`));return this.dict.context.lookup(e)},e.prototype.Kids=function(){return this.dict.lookupMaybe(X.of(`Kids`),Y)},e.prototype.DA=function(){var e=this.dict.lookup(X.of(`DA`));if(e instanceof Uy||e instanceof Ay)return e},e.prototype.setKids=function(e){this.dict.set(X.of(`Kids`),this.dict.context.obj(e))},e.prototype.getParent=function(){var t=this.dict.get(X.of(`Parent`));if(t instanceof Gv)return new e(this.dict.lookup(X.of(`Parent`),Z),t)},e.prototype.setParent=function(e){e?this.dict.set(X.of(`Parent`),e):this.dict.delete(X.of(`Parent`))},e.prototype.getFullyQualifiedName=function(){var e=this.getParent();return e?e.getFullyQualifiedName()+`.`+this.getPartialName():this.getPartialName()},e.prototype.getPartialName=function(){return this.T()?.decodeText()},e.prototype.setPartialName=function(e){e?this.dict.set(X.of(`T`),Ay.fromText(e)):this.dict.delete(X.of(`T`))},e.prototype.setDefaultAppearance=function(e){this.dict.set(X.of(`DA`),Uy.of(e))},e.prototype.getDefaultAppearance=function(){var e=this.DA();return e instanceof Ay?e.decodeText():e?.asString()},e.prototype.setFontSize=function(e){var t=this.getFullyQualifiedName()??``,n=this.getDefaultAppearance();if(!n)throw new Z_(t);var r=lh(n,qb);if(!r.match)throw new Q_(t);var i=n.slice(0,r.pos-r.match[0].length),a=r.pos<=n.length?n.slice(r.pos):``,o=r.match[1],s=i+` /`+o+` `+e+` Tf `+a;this.setDefaultAppearance(s)},e.prototype.getFlags=function(){return this.Ff()?.asNumber()??0},e.prototype.setFlags=function(e){this.dict.set(X.of(`Ff`),gv.of(e))},e.prototype.hasFlag=function(e){return(this.getFlags()&e)!==0},e.prototype.setFlag=function(e){var t=this.getFlags();this.setFlags(t|e)},e.prototype.clearFlag=function(e){var t=this.getFlags();this.setFlags(t&~e)},e.prototype.setFlagTo=function(e,t){t?this.setFlag(e):this.clearFlag(e)},e.prototype.getInheritableAttribute=function(e){var t;return this.ascend(function(n){t||=n.dict.get(e)}),t},e.prototype.ascend=function(e){e(this);var t=this.getParent();t&&t.ascend(e)},e}()})),Xb,Zb=s((()=>{Pv(),_v(),Xb=function(){function e(e){this.dict=e}return e.prototype.W=function(){var e=this.dict.lookup(X.of(`W`));if(e instanceof gv)return e},e.prototype.getWidth=function(){return this.W()?.asNumber()??1},e.prototype.setWidth=function(e){var t=this.dict.context.obj(e);this.dict.set(X.of(`W`),t)},e.fromDict=function(t){return new e(t)},e}()})),Qb,$b=s((()=>{Rv(),Pv(),Bv(),vv(),Kv(),_v(),Qb=function(){function e(e){this.dict=e}return e.prototype.Rect=function(){return this.dict.lookup(X.of(`Rect`),Y)},e.prototype.AP=function(){return this.dict.lookupMaybe(X.of(`AP`),Z)},e.prototype.F=function(){var e=this.dict.lookup(X.of(`F`));return this.dict.context.lookupMaybe(e,gv)},e.prototype.getRectangle=function(){return this.Rect()?.asRectangle()??{x:0,y:0,width:0,height:0}},e.prototype.setRectangle=function(e){var t=e.x,n=e.y,r=e.width,i=e.height,a=this.dict.context.obj([t,n,t+r,n+i]);this.dict.set(X.of(`Rect`),a)},e.prototype.getAppearanceState=function(){var e=this.dict.lookup(X.of(`AS`));if(e instanceof X)return e},e.prototype.setAppearanceState=function(e){this.dict.set(X.of(`AS`),e)},e.prototype.setAppearances=function(e){this.dict.set(X.of(`AP`),e)},e.prototype.ensureAP=function(){var e=this.AP();return e||(e=this.dict.context.obj({}),this.dict.set(X.of(`AP`),e)),e},e.prototype.getNormalAppearance=function(){var e=this.ensureAP().get(X.of(`N`));if(e instanceof Gv||e instanceof Z)return e;throw Error(`Unexpected N type: `+e?.constructor.name)},e.prototype.setNormalAppearance=function(e){this.ensureAP().set(X.of(`N`),e)},e.prototype.setRolloverAppearance=function(e){this.ensureAP().set(X.of(`R`),e)},e.prototype.setDownAppearance=function(e){this.ensureAP().set(X.of(`D`),e)},e.prototype.removeRolloverAppearance=function(){this.AP()?.delete(X.of(`R`))},e.prototype.removeDownAppearance=function(){this.AP()?.delete(X.of(`D`))},e.prototype.getAppearances=function(){var e=this.AP();if(e)return{normal:e.lookup(X.of(`N`),Z,zv),rollover:e.lookupMaybe(X.of(`R`),Z,zv),down:e.lookupMaybe(X.of(`D`),Z,zv)}},e.prototype.getFlags=function(){return this.F()?.asNumber()??0},e.prototype.setFlags=function(e){this.dict.set(X.of(`F`),gv.of(e))},e.prototype.hasFlag=function(e){return(this.getFlags()&e)!==0},e.prototype.setFlag=function(e){var t=this.getFlags();this.setFlags(t|e)},e.prototype.clearFlag=function(e){var t=this.getFlags();this.setFlags(t&~e)},e.prototype.setFlagTo=function(e,t){t?this.setFlag(e):this.clearFlag(e)},e.fromDict=function(t){return new e(t)},e}()})),ex,tx=s((()=>{Pv(),_v(),vv(),jy(),Wy(),ex=function(){function e(e){this.dict=e}return e.prototype.R=function(){var e=this.dict.lookup(X.of(`R`));if(e instanceof gv)return e},e.prototype.BC=function(){var e=this.dict.lookup(X.of(`BC`));if(e instanceof Y)return e},e.prototype.BG=function(){var e=this.dict.lookup(X.of(`BG`));if(e instanceof Y)return e},e.prototype.CA=function(){var e=this.dict.lookup(X.of(`CA`));if(e instanceof Ay||e instanceof Uy)return e},e.prototype.RC=function(){var e=this.dict.lookup(X.of(`RC`));if(e instanceof Ay||e instanceof Uy)return e},e.prototype.AC=function(){var e=this.dict.lookup(X.of(`AC`));if(e instanceof Ay||e instanceof Uy)return e},e.prototype.getRotation=function(){return this.R()?.asNumber()},e.prototype.getBorderColor=function(){var e=this.BC();if(e){for(var t=[],n=0,r=e?.size();n<r;n++){var i=e.get(n);i instanceof gv&&t.push(i.asNumber())}return t}},e.prototype.getBackgroundColor=function(){var e=this.BG();if(e){for(var t=[],n=0,r=e?.size();n<r;n++){var i=e.get(n);i instanceof gv&&t.push(i.asNumber())}return t}},e.prototype.getCaptions=function(){var e=this.CA(),t=this.RC(),n=this.AC();return{normal:e?.decodeText(),rollover:t?.decodeText(),down:n?.decodeText()}},e.prototype.setRotation=function(e){var t=this.dict.context.obj(e);this.dict.set(X.of(`R`),t)},e.prototype.setBorderColor=function(e){var t=this.dict.context.obj(e);this.dict.set(X.of(`BC`),t)},e.prototype.setBackgroundColor=function(e){var t=this.dict.context.obj(e);this.dict.set(X.of(`BG`),t)},e.prototype.setCaptions=function(e){var t=Ay.fromText(e.normal);if(this.dict.set(X.of(`CA`),t),e.rollover){var n=Ay.fromText(e.rollover);this.dict.set(X.of(`RC`),n)}else this.dict.delete(X.of(`RC`));if(e.down){var r=Ay.fromText(e.down);this.dict.set(X.of(`AC`),r)}else this.dict.delete(X.of(`AC`))},e.fromDict=function(t){return new e(t)},e}()})),nx,rx=s((()=>{G(),Rv(),Pv(),Kv(),Wy(),jy(),Zb(),$b(),tx(),nx=function(e){W(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.MK=function(){var e=this.dict.lookup(X.of(`MK`));if(e instanceof Z)return e},t.prototype.BS=function(){var e=this.dict.lookup(X.of(`BS`));if(e instanceof Z)return e},t.prototype.DA=function(){var e=this.dict.lookup(X.of(`DA`));if(e instanceof Uy||e instanceof Ay)return e},t.prototype.P=function(){var e=this.dict.get(X.of(`P`));if(e instanceof Gv)return e},t.prototype.setP=function(e){this.dict.set(X.of(`P`),e)},t.prototype.setDefaultAppearance=function(e){this.dict.set(X.of(`DA`),Uy.of(e))},t.prototype.getDefaultAppearance=function(){var e=this.DA();return e instanceof Ay?e.decodeText():e?.asString()},t.prototype.getAppearanceCharacteristics=function(){var e=this.MK();if(e)return ex.fromDict(e)},t.prototype.getOrCreateAppearanceCharacteristics=function(){var e=this.MK();if(e)return ex.fromDict(e);var t=ex.fromDict(this.dict.context.obj({}));return this.dict.set(X.of(`MK`),t.dict),t},t.prototype.getBorderStyle=function(){var e=this.BS();if(e)return Xb.fromDict(e)},t.prototype.getOrCreateBorderStyle=function(){var e=this.BS();if(e)return Xb.fromDict(e);var t=Xb.fromDict(this.dict.context.obj({}));return this.dict.set(X.of(`BS`),t.dict),t},t.prototype.getOnValue=function(){var e=this.getAppearances()?.normal;if(e instanceof Z)for(var t=e.keys(),n=0,r=t.length;n<r;n++){var i=t[n];if(i!==X.of(`Off`))return i}},t.fromDict=function(e){return new t(e)},t.create=function(e,n){return new t(e.obj({Type:`Annot`,Subtype:`Widget`,Rect:[0,0,0,0],Parent:n}))},t}(Qb)})),ix,ax=s((()=>{G(),Rv(),Pv(),Yb(),rx(),lv(),ix=function(e){W(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.FT=function(){var e=this.getInheritableAttribute(X.of(`FT`));return this.dict.context.lookup(e,X)},t.prototype.getWidgets=function(){var e=this.Kids();if(!e)return[nx.fromDict(this.dict)];for(var t=Array(e.size()),n=0,r=e.size();n<r;n++){var i=e.lookup(n,Z);t[n]=nx.fromDict(i)}return t},t.prototype.addWidget=function(e){this.normalizedEntries().Kids.push(e)},t.prototype.removeWidget=function(e){var t=this.Kids();if(t){if(e<0||e>t.size())throw new J_(e,0,t.size());t.remove(e)}else{if(e!==0)throw new J_(e,0,0);this.setKids([])}},t.prototype.normalizedEntries=function(){var e=this.Kids();return e||(e=this.dict.context.obj([this.ref]),this.dict.set(X.of(`Kids`),e)),{Kids:e}},t.fromDict=function(e,n){return new t(e,n)},t}(Jb)})),ox,sx=s((()=>{G(),Wy(),jy(),vv(),Pv(),ax(),lv(),ox=function(e){W(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.Opt=function(){return this.dict.lookupMaybe(X.of(`Opt`),Uy,Ay,Y)},t.prototype.setOpt=function(e){this.dict.set(X.of(`Opt`),this.dict.context.obj(e))},t.prototype.getExportValues=function(){var e=this.Opt();if(e){if(e instanceof Uy||e instanceof Ay)return[e];for(var t=[],n=0,r=e.size();n<r;n++){var i=e.lookup(n);(i instanceof Uy||i instanceof Ay)&&t.push(i)}return t}},t.prototype.removeExportValue=function(e){var t=this.Opt();if(t){if(t instanceof Uy||t instanceof Ay){if(e!==0)throw new J_(e,0,0);this.setOpt([])}else{if(e<0||e>t.size())throw new J_(e,0,t.size());t.remove(e)}}},t.prototype.normalizeExportValues=function(){for(var e=this.getExportValues()??[],t=[],n=this.getWidgets(),r=0,i=n.length;r<i;r++){var a=n[r],o=e[r]??Ay.fromText(a.getOnValue()?.decodeText()??``);t.push(o)}this.setOpt(t)},t.prototype.addOpt=function(e,t){this.normalizeExportValues();var n=e.decodeText(),r;if(t)for(var i=this.getExportValues()??[],a=0,o=i.length;a<o;a++)i[a].decodeText()===n&&(r=a);var s=this.Opt();return s.push(e),r??s.size()-1},t.prototype.addWidgetWithOpt=function(e,t,n){var r=this.addOpt(t,n),i=X.of(String(r));return this.addWidget(e),i},t}(ix)})),cx,lx=s((()=>{G(),Pv(),sx(),lv(),cx=function(e){W(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.setValue=function(e){if(e!==(this.getOnValue()??X.of(`Yes`))&&e!==X.of(`Off`))throw new Y_;this.dict.set(X.of(`V`),e);for(var t=this.getWidgets(),n=0,r=t.length;n<r;n++){var i=t[n],a=i.getOnValue()===e?e:X.of(`Off`);i.setAppearanceState(a)}},t.prototype.getValue=function(){var e=this.V();return e instanceof X?e:X.of(`Off`)},t.prototype.getOnValue=function(){return this.getWidgets()[0]?.getOnValue()},t.fromDict=function(e,n){return new t(e,n)},t.create=function(e){var n=e.obj({FT:`Btn`,Kids:[]});return new t(n,e.register(n))},t}(ox)})),ux,dx,fx,px,mx,hx=s((()=>{ux=function(e){return 1<<e},(function(e){e[e.ReadOnly=ux(0)]=`ReadOnly`,e[e.Required=ux(1)]=`Required`,e[e.NoExport=ux(2)]=`NoExport`})(dx||={}),(function(e){e[e.NoToggleToOff=ux(14)]=`NoToggleToOff`,e[e.Radio=ux(15)]=`Radio`,e[e.PushButton=ux(16)]=`PushButton`,e[e.RadiosInUnison=ux(25)]=`RadiosInUnison`})(fx||={}),(function(e){e[e.Multiline=ux(12)]=`Multiline`,e[e.Password=ux(13)]=`Password`,e[e.FileSelect=ux(20)]=`FileSelect`,e[e.DoNotSpellCheck=ux(22)]=`DoNotSpellCheck`,e[e.DoNotScroll=ux(23)]=`DoNotScroll`,e[e.Comb=ux(24)]=`Comb`,e[e.RichText=ux(25)]=`RichText`})(px||={}),(function(e){e[e.Combo=ux(17)]=`Combo`,e[e.Edit=ux(18)]=`Edit`,e[e.Sort=ux(19)]=`Sort`,e[e.MultiSelect=ux(21)]=`MultiSelect`,e[e.DoNotSpellCheck=ux(22)]=`DoNotSpellCheck`,e[e.CommitOnSelChange=ux(26)]=`CommitOnSelChange`})(mx||={})})),gx,_x=s((()=>{G(),ax(),jy(),Wy(),vv(),Pv(),hx(),lv(),gx=function(e){W(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.setValues=function(e){if(this.hasFlag(mx.Combo)&&!this.hasFlag(mx.Edit)&&!this.valuesAreValid(e))throw new Y_;if(e.length===0&&this.dict.delete(X.of(`V`)),e.length===1&&this.dict.set(X.of(`V`),e[0]),e.length>1){if(!this.hasFlag(mx.MultiSelect))throw new X_;this.dict.set(X.of(`V`),this.dict.context.obj(e))}this.updateSelectedIndices(e)},t.prototype.valuesAreValid=function(e){for(var t=this.getOptions(),n=function(n,r){var i=e[n].decodeText();if(!t.find(function(e){return i===(e.display||e.value).decodeText()}))return{value:!1}},r=0,i=e.length;r<i;r++){var a=n(r,i);if(typeof a==`object`)return a.value}return!0},t.prototype.updateSelectedIndices=function(e){if(e.length>1){for(var t=Array(e.length),n=this.getOptions(),r=function(r,i){var a=e[r].decodeText();t[r]=n.findIndex(function(e){return a===(e.display||e.value).decodeText()})},i=0,a=e.length;i<a;i++)r(i,a);this.dict.set(X.of(`I`),this.dict.context.obj(t.sort()))}else this.dict.delete(X.of(`I`))},t.prototype.getValues=function(){var e=this.V();if(e instanceof Uy||e instanceof Ay)return[e];if(e instanceof Y){for(var t=[],n=0,r=e.size();n<r;n++){var i=e.lookup(n);(i instanceof Uy||i instanceof Ay)&&t.push(i)}return t}return[]},t.prototype.Opt=function(){return this.dict.lookupMaybe(X.of(`Opt`),Uy,Ay,Y)},t.prototype.setOptions=function(e){for(var t=Array(e.length),n=0,r=e.length;n<r;n++){var i=e[n],a=i.value,o=i.display;t[n]=this.dict.context.obj([a,o||a])}this.dict.set(X.of(`Opt`),this.dict.context.obj(t))},t.prototype.getOptions=function(){var e=this.Opt();if(e instanceof Uy||e instanceof Ay)return[{value:e,display:e}];if(e instanceof Y){for(var t=[],n=0,r=e.size();n<r;n++){var i=e.lookup(n);if((i instanceof Uy||i instanceof Ay)&&t.push({value:i,display:i}),i instanceof Y&&i.size()>0){var a=i.lookup(0,Uy,Ay),o=i.lookupMaybe(1,Uy,Ay);t.push({value:a,display:o||a})}}return t}return[]},t}(ix)})),vx,yx=s((()=>{G(),_x(),hx(),vx=function(e){W(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.fromDict=function(e,n){return new t(e,n)},t.create=function(e){var n=e.obj({FT:`Ch`,Ff:mx.Combo,Kids:[]});return new t(n,e.register(n))},t}(gx)})),bx,xx=s((()=>{G(),Pv(),Yb(),bx=function(e){W(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.addField=function(e){this.normalizedEntries().Kids?.push(e)},t.prototype.normalizedEntries=function(){var e=this.Kids();return e||(e=this.dict.context.obj([]),this.dict.set(X.of(`Kids`),e)),{Kids:e}},t.fromDict=function(e,n){return new t(e,n)},t.create=function(e){var n=e.obj({});return new t(n,e.register(n))},t}(Jb)})),Sx,Cx=s((()=>{G(),ax(),Sx=function(e){W(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.fromDict=function(e,n){return new t(e,n)},t}(ix)})),wx,Tx=s((()=>{G(),_v(),Wy(),jy(),Pv(),ax(),wx=function(e){W(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.MaxLen=function(){var e=this.dict.lookup(X.of(`MaxLen`));if(e instanceof gv)return e},t.prototype.Q=function(){var e=this.dict.lookup(X.of(`Q`));if(e instanceof gv)return e},t.prototype.setMaxLength=function(e){this.dict.set(X.of(`MaxLen`),gv.of(e))},t.prototype.removeMaxLength=function(){this.dict.delete(X.of(`MaxLen`))},t.prototype.getMaxLength=function(){return this.MaxLen()?.asNumber()},t.prototype.setQuadding=function(e){this.dict.set(X.of(`Q`),gv.of(e))},t.prototype.getQuadding=function(){return this.Q()?.asNumber()},t.prototype.setValue=function(e){this.dict.set(X.of(`V`),e)},t.prototype.removeValue=function(){this.dict.delete(X.of(`V`))},t.prototype.getValue=function(){var e=this.V();if(e instanceof Uy||e instanceof Ay)return e},t.fromDict=function(e,n){return new t(e,n)},t.create=function(e){var n=e.obj({FT:`Tx`,Kids:[]});return new t(n,e.register(n))},t}(ix)})),Ex,Dx=s((()=>{G(),sx(),hx(),Ex=function(e){W(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.fromDict=function(e,n){return new t(e,n)},t.create=function(e){var n=e.obj({FT:`Btn`,Ff:fx.PushButton,Kids:[]});return new t(n,e.register(n))},t}(ox)})),Ox,kx=s((()=>{G(),Pv(),sx(),hx(),lv(),Ox=function(e){W(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.setValue=function(e){if(!this.getOnValues().includes(e)&&e!==X.of(`Off`))throw new Y_;this.dict.set(X.of(`V`),e);for(var t=this.getWidgets(),n=0,r=t.length;n<r;n++){var i=t[n],a=i.getOnValue()===e?e:X.of(`Off`);i.setAppearanceState(a)}},t.prototype.getValue=function(){var e=this.V();return e instanceof X?e:X.of(`Off`)},t.prototype.getOnValues=function(){for(var e=this.getWidgets(),t=[],n=0,r=e.length;n<r;n++){var i=e[n].getOnValue();i&&t.push(i)}return t},t.fromDict=function(e,n){return new t(e,n)},t.create=function(e){var n=e.obj({FT:`Btn`,Ff:fx.Radio,Kids:[]});return new t(n,e.register(n))},t}(ox)})),Ax,jx=s((()=>{G(),_x(),Ax=function(e){W(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.fromDict=function(e,n){return new t(e,n)},t.create=function(e){var n=e.obj({FT:`Ch`,Kids:[]});return new t(n,e.register(n))},t}(gx)})),Mx,Nx,Px,Fx,Ix,Lx,Rx,zx,Bx,Vx=s((()=>{_v(),Rv(),Pv(),vv(),Kv(),ax(),xx(),Cx(),Tx(),Dx(),kx(),lx(),yx(),jx(),hx(),Mx=function(e){if(!e)return[];for(var t=[],n=0,r=e.size();n<r;n++){var i=e.get(n),a=e.lookup(n);i instanceof Gv&&a instanceof Z&&t.push([Nx(a,i),i])}return t},Nx=function(e,t){return Px(e)?bx.fromDict(e,t):Fx(e,t)},Px=function(e){var t=e.lookup(X.of(`Kids`));if(t instanceof Y)for(var n=0,r=t.size();n<r;n++){var i=t.lookup(n);if(i instanceof Z&&i.has(X.of(`T`)))return!0}return!1},Fx=function(e,t){var n=zx(e,X.of(`FT`)),r=e.context.lookup(n,X);return r===X.of(`Btn`)?Ix(e,t):r===X.of(`Ch`)?Lx(e,t):r===X.of(`Tx`)?wx.fromDict(e,t):r===X.of(`Sig`)?Sx.fromDict(e,t):ix.fromDict(e,t)},Ix=function(e,t){var n=zx(e,X.of(`Ff`)),r=e.context.lookupMaybe(n,gv)?.asNumber()??0;return Rx(r,fx.PushButton)?Ex.fromDict(e,t):Rx(r,fx.Radio)?Ox.fromDict(e,t):cx.fromDict(e,t)},Lx=function(e,t){var n=zx(e,X.of(`Ff`)),r=e.context.lookupMaybe(n,gv);return Rx(r?.asNumber()??0,mx.Combo)?vx.fromDict(e,t):Ax.fromDict(e,t)},Rx=function(e,t){return(e&t)!==0},zx=function(e,t){var n;return Bx(e,function(e){n||=e.get(t)}),n},Bx=function(e,t){t(e);var n=e.lookupMaybe(X.of(`Parent`),Z);n&&Bx(n,t)}})),Hx,Ux=s((()=>{Rv(),vv(),Pv(),xx(),Vx(),Hx=function(){function e(e){this.dict=e}return e.prototype.Fields=function(){var e=this.dict.lookup(X.of(`Fields`));if(e instanceof Y)return e},e.prototype.getFields=function(){for(var e=this.normalizedEntries().Fields,t=Array(e.size()),n=0,r=e.size();n<r;n++){var i=e.get(n),a=e.lookup(n,Z);t[n]=[Nx(a,i),i]}return t},e.prototype.getAllFields=function(){var e=[],t=function(n){if(n)for(var r=0,i=n.length;r<i;r++){var a=n[r];e.push(a);var o=a[0];o instanceof bx&&t(Mx(o.Kids()))}};return t(this.getFields()),e},e.prototype.addField=function(e){this.normalizedEntries().Fields?.push(e)},e.prototype.removeField=function(e){var t=e.getParent(),n=t===void 0?this.normalizedEntries().Fields:t.Kids(),r=n?.indexOf(e.ref);if(n===void 0||r===void 0)throw Error(`Tried to remove inexistent field `+e.getFullyQualifiedName());n.remove(r),t!==void 0&&n.size()===0&&this.removeField(t)},e.prototype.normalizedEntries=function(){var e=this.Fields();return e||(e=this.dict.context.obj([]),this.dict.set(X.of(`Fields`),e)),{Fields:e}},e.fromDict=function(t){return new e(t)},e.create=function(t){return new e(t.obj({Fields:[]}))},e}()})),Wx=s((()=>{sx(),lx(),_x(),yx(),Yb(),Ux(),jx(),xx(),Dx(),kx(),Cx(),ax(),Tx(),hx(),Vx()})),Gx,Kx=s((()=>{G(),Rv(),Pv(),Wx(),Kb(),Gx=function(e){W(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.Pages=function(){return this.lookup(X.of(`Pages`),Z)},t.prototype.AcroForm=function(){return this.lookupMaybe(X.of(`AcroForm`),Z)},t.prototype.getAcroForm=function(){var e=this.AcroForm();if(e)return Hx.fromDict(e)},t.prototype.getOrCreateAcroForm=function(){var e=this.getAcroForm();if(!e){e=Hx.create(this.context);var t=this.context.register(e.dict);this.set(X.of(`AcroForm`),t)}return e},t.prototype.ViewerPreferences=function(){return this.lookupMaybe(X.of(`ViewerPreferences`),Z)},t.prototype.getViewerPreferences=function(){var e=this.ViewerPreferences();if(e)return Gb.fromDict(e)},t.prototype.getOrCreateViewerPreferences=function(){var e=this.getViewerPreferences();if(!e){e=Gb.create(this.context);var t=this.context.register(e.dict);this.set(X.of(`ViewerPreferences`),t)}return e},t.prototype.insertLeafNode=function(e,t){var n=this.get(X.of(`Pages`));return this.Pages().insertLeafNode(e,t)||n},t.prototype.removeLeafNode=function(e){this.Pages().removeLeafNode(e)},t.withContextAndPages=function(e,n){var r=new Map;return r.set(X.of(`Type`),X.of(`Catalog`)),r.set(X.of(`Pages`),n),new t(r,e)},t.fromMapWithContext=function(e,n){return new t(e,n)},t}(Z)})),qx,Jx=s((()=>{G(),vv(),Rv(),Pv(),_v(),uy(),lv(),qx=function(e){W(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.Parent=function(){return this.lookup(X.of(`Parent`))},t.prototype.Kids=function(){return this.lookup(X.of(`Kids`),Y)},t.prototype.Count=function(){return this.lookup(X.of(`Count`),gv)},t.prototype.pushTreeNode=function(e){this.Kids().push(e)},t.prototype.pushLeafNode=function(e){var t=this.Kids();this.insertLeafKid(t.size(),e)},t.prototype.insertLeafNode=function(e,n){var r=this.Kids(),i=this.Count().asNumber();if(n>i)throw new K_(n,i);for(var a=n,o=0,s=r.size();o<s;o++){if(a===0){this.insertLeafKid(o,e);return}var c=r.get(o),l=this.context.lookup(c);if(l instanceof t){if(l.Count().asNumber()>a)return l.insertLeafNode(e,a)||c;a-=l.Count().asNumber()}l instanceof ly&&--a}if(a===0)this.insertLeafKid(r.size(),e);else throw new q_(n,`insertLeafNode`)},t.prototype.removeLeafNode=function(e,n){n===void 0&&(n=!0);var r=this.Kids(),i=this.Count().asNumber();if(e>=i)throw new K_(e,i);for(var a=e,o=0,s=r.size();o<s;o++){var c=r.get(o),l=this.context.lookup(c);if(l instanceof t){if(l.Count().asNumber()>a){l.removeLeafNode(a,n),n&&l.Kids().size()===0&&r.remove(o);return}a-=l.Count().asNumber()}if(l instanceof ly){if(a===0){this.removeKid(o);return}--a}}throw new q_(e,`removeLeafNode`)},t.prototype.ascend=function(e){e(this);var t=this.Parent();t&&t.ascend(e)},t.prototype.traverse=function(e){for(var n=this.Kids(),r=0,i=n.size();r<i;r++){var a=n.get(r),o=this.context.lookup(a);o instanceof t&&o.traverse(e),e(o,a)}},t.prototype.insertLeafKid=function(e,t){var n=this.Kids();this.ascend(function(e){var t=e.Count().asNumber()+1;e.set(X.of(`Count`),gv.of(t))}),n.insert(e,t)},t.prototype.removeKid=function(e){var t=this.Kids();t.lookup(e)instanceof ly&&this.ascend(function(e){var t=e.Count().asNumber()-1;e.set(X.of(`Count`),gv.of(t))}),t.remove(e)},t.withContext=function(e,n){var r=new Map;return r.set(X.of(`Type`),X.of(`Pages`)),r.set(X.of(`Kids`),e.obj([])),r.set(X.of(`Count`),e.obj(0)),n&&r.set(X.of(`Parent`),n),new t(r,e)},t.fromMapWithContext=function(e,n){return new t(e,n)},t}(Z)})),Yx,Xx,Zx,Qx,$x,eS=s((()=>{for(dv(),Yx=new Uint8Array(256),Yx[J.Zero]=1,Yx[J.One]=1,Yx[J.Two]=1,Yx[J.Three]=1,Yx[J.Four]=1,Yx[J.Five]=1,Yx[J.Six]=1,Yx[J.Seven]=1,Yx[J.Eight]=1,Yx[J.Nine]=1,Xx=new Uint8Array(256),Xx[J.Period]=1,Xx[J.Plus]=1,Xx[J.Minus]=1,Zx=new Uint8Array(256),Qx=0,$x=256;Qx<$x;Qx++)Zx[Qx]=Yx[Qx]||Xx[Qx]?1:0})),tS,nS,rS,iS=s((()=>{lv(),dv(),eS(),Tv(),F_(),tS=J.Newline,nS=J.CarriageReturn,rS=function(){function e(e,t){t===void 0&&(t=!1),this.bytes=e,this.capNumbers=t}return e.prototype.parseRawInt=function(){for(var e=``;!this.bytes.done();){var t=this.bytes.peek();if(!Yx[t])break;e+=qm(this.bytes.next())}var n=Number(e);if(!e||!isFinite(n))throw new $_(this.bytes.position(),e);return n},e.prototype.parseRawNumber=function(){for(var e=``;!this.bytes.done();){var t=this.bytes.peek();if(!Zx[t]||(e+=qm(this.bytes.next()),t===J.Period))break}for(;!this.bytes.done();){var t=this.bytes.peek();if(!Yx[t])break;e+=qm(this.bytes.next())}var n=Number(e);if(!e||!isFinite(n))throw new $_(this.bytes.position(),e);if(n>2**53-1){if(this.capNumbers){var r=`Parsed number that is too large for some PDF readers: `+e+`, using Number.MAX_SAFE_INTEGER instead.`;return console.warn(r),2**53-1}var r=`Parsed number that is too large for some PDF readers: `+e+`, not capping.`;console.warn(r)}return n},e.prototype.skipWhitespace=function(){for(;!this.bytes.done()&&wv[this.bytes.peek()];)this.bytes.next()},e.prototype.skipLine=function(){for(;!this.bytes.done();){var e=this.bytes.peek();if(e===tS||e===nS)return;this.bytes.next()}},e.prototype.skipComment=function(){if(this.bytes.peek()!==J.Percent)return!1;for(;!this.bytes.done();){var e=this.bytes.peek();if(e===tS||e===nS)return!0;this.bytes.next()}return!0},e.prototype.skipWhitespaceAndComments=function(){for(this.skipWhitespace();this.skipComment();)this.skipWhitespace()},e.prototype.matchKeyword=function(e){for(var t=this.bytes.offset(),n=0,r=e.length;n<r;n++)if(this.bytes.done()||this.bytes.next()!==e[n])return this.bytes.moveTo(t),!1;return!0},e}()})),aS,oS=s((()=>{lv(),Fb(),dv(),aS=function(){function e(e){this.idx=0,this.line=0,this.column=0,this.bytes=e,this.length=this.bytes.length}return e.prototype.moveTo=function(e){this.idx=e},e.prototype.next=function(){var e=this.bytes[this.idx++];return e===J.Newline?(this.line+=1,this.column=0):this.column+=1,e},e.prototype.assertNext=function(e){if(this.peek()!==e)throw new tv(this.position(),e,this.peek());return this.next()},e.prototype.peek=function(){return this.bytes[this.idx]},e.prototype.peekAhead=function(e){return this.bytes[this.idx+e]},e.prototype.peekAt=function(e){return this.bytes[e]},e.prototype.done=function(){return this.idx>=this.length},e.prototype.offset=function(){return this.idx},e.prototype.slice=function(e,t){return this.bytes.slice(e,t)},e.prototype.position=function(){return{line:this.line,column:this.column,offset:this.idx}},e.of=function(t){return new e(t)},e.fromPDFRawStream=function(t){return e.of(Pb(t).decode())},e}()})),sS,cS,lS,uS,dS,fS,pS=s((()=>{G(),dv(),sS=J.Space,cS=J.CarriageReturn,lS=J.Newline,uS=[J.s,J.t,J.r,J.e,J.a,J.m],dS=[J.e,J.n,J.d,J.s,J.t,J.r,J.e,J.a,J.m],fS={header:[J.Percent,J.P,J.D,J.F,J.Dash],eof:[J.Percent,J.Percent,J.E,J.O,J.F],obj:[J.o,J.b,J.j],endobj:[J.e,J.n,J.d,J.o,J.b,J.j],xref:[J.x,J.r,J.e,J.f],trailer:[J.t,J.r,J.a,J.i,J.l,J.e,J.r],startxref:[J.s,J.t,J.a,J.r,J.t,J.x,J.r,J.e,J.f],true:[J.t,J.r,J.u,J.e],false:[J.f,J.a,J.l,J.s,J.e],null:[J.n,J.u,J.l,J.l],stream:uS,streamEOF1:Mm(uS,[sS,cS,lS]),streamEOF2:Mm(uS,[cS,lS]),streamEOF3:Mm(uS,[cS]),streamEOF4:Mm(uS,[lS]),endstream:dS,EOF1endstream:Mm([cS,lS],dS),EOF2endstream:Mm([cS],dS),EOF3endstream:Mm([lS],dS)}})),mS,hS=s((()=>{G(),lv(),vv(),xv(),Rv(),jy(),Pv(),Lv(),_v(),Hv(),Kv(),Wy(),iS(),oS(),Kx(),uy(),Jx(),dv(),Cv(),pS(),eS(),Tv(),F_(),mS=function(e){W(t,e);function t(t,n,r){r===void 0&&(r=!1);var i=e.call(this,t,r)||this;return i.context=n,i}return t.prototype.parseObject=function(){if(this.skipWhitespaceAndComments(),this.matchKeyword(fS.true))return bv.True;if(this.matchKeyword(fS.false))return bv.False;if(this.matchKeyword(fS.null))return Iv;var e=this.bytes.peek();if(e===J.LessThan&&this.bytes.peekAhead(1)===J.LessThan)return this.parseDictOrStream();if(e===J.LessThan)return this.parseHexString();if(e===J.LeftParen)return this.parseString();if(e===J.ForwardSlash)return this.parseName();if(e===J.LeftSquareBracket)return this.parseArray();if(Zx[e])return this.parseNumberOrRef();throw new nv(this.bytes.position(),e)},t.prototype.parseNumberOrRef=function(){var e=this.parseRawNumber();this.skipWhitespaceAndComments();var t=this.bytes.offset();if(Yx[this.bytes.peek()]){var n=this.parseRawNumber();if(this.skipWhitespaceAndComments(),this.bytes.peek()===J.R)return this.bytes.assertNext(J.R),Gv.of(e,n)}return this.bytes.moveTo(t),gv.of(e)},t.prototype.parseHexString=function(){var e=``;for(this.bytes.assertNext(J.LessThan);!this.bytes.done()&&this.bytes.peek()!==J.GreaterThan;)e+=qm(this.bytes.next());return this.bytes.assertNext(J.GreaterThan),Ay.of(e)},t.prototype.parseString=function(){for(var e=0,t=!1,n=``;!this.bytes.done();){var r=this.bytes.next();if(n+=qm(r),t||(r===J.LeftParen&&(e+=1),r===J.RightParen&&--e),r===J.BackSlash?t=!t:t&&=!1,e===0)return Uy.of(n.substring(1,n.length-1))}throw new av(this.bytes.position())},t.prototype.parseName=function(){this.bytes.assertNext(J.ForwardSlash);for(var e=``;!this.bytes.done();){var t=this.bytes.peek();if(wv[t]||Sv[t])break;e+=qm(t),this.bytes.next()}return X.of(e)},t.prototype.parseArray=function(){this.bytes.assertNext(J.LeftSquareBracket),this.skipWhitespaceAndComments();for(var e=Y.withContext(this.context);this.bytes.peek()!==J.RightSquareBracket;){var t=this.parseObject();e.push(t),this.skipWhitespaceAndComments()}return this.bytes.assertNext(J.RightSquareBracket),e},t.prototype.parseDict=function(){this.bytes.assertNext(J.LessThan),this.bytes.assertNext(J.LessThan),this.skipWhitespaceAndComments();for(var e=new Map;!this.bytes.done()&&this.bytes.peek()!==J.GreaterThan&&this.bytes.peekAhead(1)!==J.GreaterThan;){var t=this.parseName(),n=this.parseObject();e.set(t,n),this.skipWhitespaceAndComments()}this.skipWhitespaceAndComments(),this.bytes.assertNext(J.GreaterThan),this.bytes.assertNext(J.GreaterThan);var r=e.get(X.of(`Type`));return r===X.of(`Catalog`)?Gx.fromMapWithContext(e,this.context):r===X.of(`Pages`)?qx.fromMapWithContext(e,this.context):r===X.of(`Page`)?ly.fromMapWithContext(e,this.context):Z.fromMapWithContext(e,this.context)},t.prototype.parseDictOrStream=function(){var e=this.bytes.position(),t=this.parseDict();if(this.skipWhitespaceAndComments(),!this.matchKeyword(fS.streamEOF1)&&!this.matchKeyword(fS.streamEOF2)&&!this.matchKeyword(fS.streamEOF3)&&!this.matchKeyword(fS.streamEOF4)&&!this.matchKeyword(fS.stream))return t;var n=this.bytes.offset(),r,i=t.get(X.of(`Length`));i instanceof gv?(r=n+i.asNumber(),this.bytes.moveTo(r),this.skipWhitespaceAndComments(),this.matchKeyword(fS.endstream)||(this.bytes.moveTo(n),r=this.findEndOfStreamFallback(e))):r=this.findEndOfStreamFallback(e);var a=this.bytes.slice(n,r);return Vv.of(t,a)},t.prototype.findEndOfStreamFallback=function(e){for(var t=1,n=this.bytes.offset();!this.bytes.done()&&(n=this.bytes.offset(),this.matchKeyword(fS.stream)?t+=1:this.matchKeyword(fS.EOF1endstream)||this.matchKeyword(fS.EOF2endstream)||this.matchKeyword(fS.EOF3endstream)||this.matchKeyword(fS.endstream)?--t:this.bytes.next(),t!==0););if(t!==0)throw new iv(e);return n},t.forBytes=function(e,n,r){return new t(aS.of(e),n,r)},t.forByteStream=function(e,n,r){return r===void 0&&(r=!1),new t(e,n,r)},t}(rS)})),gS,_S=s((()=>{G(),lv(),Pv(),_v(),Kv(),oS(),hS(),F_(),gS=function(e){W(t,e);function t(t,n){var r=e.call(this,aS.fromPDFRawStream(t),t.dict.context)||this,i=t.dict;return r.alreadyParsed=!1,r.shouldWaitForTick=n||(function(){return!1}),r.firstOffset=i.lookup(X.of(`First`),gv).asNumber(),r.objectCount=i.lookup(X.of(`N`),gv).asNumber(),r}return t.prototype.parseIntoContext=function(){return Am(this,void 0,void 0,function(){var e,t,n,r,i,a,o,s;return jm(this,function(c){switch(c.label){case 0:if(this.alreadyParsed)throw new B_(`PDFObjectStreamParser`,`parseIntoContext`);this.alreadyParsed=!0,e=this.parseOffsetsAndObjectNumbers(),t=0,n=e.length,c.label=1;case 1:return t<n?(r=e[t],i=r.objectNumber,a=r.offset,this.bytes.moveTo(this.firstOffset+a),o=this.parseObject(),s=Gv.of(i,0),this.context.assign(s,o),this.shouldWaitForTick()?[4,Th()]:[3,3]):[3,4];case 2:c.sent(),c.label=3;case 3:return t++,[3,1];case 4:return[2]}})})},t.prototype.parseOffsetsAndObjectNumbers=function(){for(var e=[],t=0,n=this.objectCount;t<n;t++){this.skipWhitespaceAndComments();var r=this.parseRawInt();this.skipWhitespaceAndComments();var i=this.parseRawInt();e.push({objectNumber:r,offset:i})}return e},t.forStream=function(e,n){return new t(e,n)},t}(mS)})),vS,yS=s((()=>{lv(),vv(),Pv(),_v(),Kv(),oS(),vS=function(){function e(e){this.alreadyParsed=!1,this.dict=e.dict,this.bytes=aS.fromPDFRawStream(e),this.context=this.dict.context;var t=this.dict.lookup(X.of(`Size`),gv),n=this.dict.lookup(X.of(`Index`));if(n instanceof Y){this.subsections=[];for(var r=0,i=n.size();r<i;r+=2){var a=n.lookup(r+0,gv).asNumber(),o=n.lookup(r+1,gv).asNumber();this.subsections.push({firstObjectNumber:a,length:o})}}else this.subsections=[{firstObjectNumber:0,length:t.asNumber()}];var s=this.dict.lookup(X.of(`W`),Y);this.byteWidths=[-1,-1,-1];for(var r=0,i=s.size();r<i;r++)this.byteWidths[r]=s.lookup(r,gv).asNumber()}return e.prototype.parseIntoContext=function(){if(this.alreadyParsed)throw new B_(`PDFXRefStreamParser`,`parseIntoContext`);return this.alreadyParsed=!0,this.context.trailerInfo={Root:this.dict.get(X.of(`Root`)),Encrypt:this.dict.get(X.of(`Encrypt`)),Info:this.dict.get(X.of(`Info`)),ID:this.dict.get(X.of(`ID`))},this.parseEntries()},e.prototype.parseEntries=function(){for(var e=[],t=this.byteWidths,n=t[0],r=t[1],i=t[2],a=0,o=this.subsections.length;a<o;a++)for(var s=this.subsections[a],c=s.firstObjectNumber,l=s.length,u=0;u<l;u++){for(var d=0,f=0,p=n;f<p;f++)d=d<<8|this.bytes.next();for(var m=0,f=0,p=r;f<p;f++)m=m<<8|this.bytes.next();for(var h=0,f=0,p=i;f<p;f++)h=h<<8|this.bytes.next();n===0&&(d=1);var g=c+u,_={ref:Gv.of(g,h),offset:m,deleted:d===0,inObjectStream:d===2};e.push(_)}return e},e.forStream=function(t){return new e(t)},e}()})),bS,xS=s((()=>{G(),my(),pv(),gy(),lv(),Rv(),wy(),Pv(),Hv(),Kv(),oS(),hS(),_S(),yS(),cy(),dv(),pS(),eS(),F_(),bS=function(e){W(t,e);function t(t,n,r,i){n===void 0&&(n=1/0),r===void 0&&(r=!1),i===void 0&&(i=!1);var a=e.call(this,aS.of(t),sy.create(),i)||this;return a.alreadyParsed=!1,a.parsedObjects=0,a.shouldWaitForTick=function(){return a.parsedObjects+=1,a.parsedObjects%a.objectsPerTick===0},a.objectsPerTick=n,a.throwOnInvalidObject=r,a}return t.prototype.parseDocument=function(){return Am(this,void 0,void 0,function(){var e,t;return jm(this,function(n){switch(n.label){case 0:if(this.alreadyParsed)throw new B_(`PDFParser`,`parseDocument`);this.alreadyParsed=!0,this.context.header=this.parseHeader(),n.label=1;case 1:return this.bytes.done()?[3,3]:[4,this.parseDocumentSection()];case 2:if(n.sent(),t=this.bytes.offset(),t===e)throw new ov(this.bytes.position());return e=t,[3,1];case 3:return this.maybeRecoverRoot(),this.context.lookup(Gv.of(0))&&(console.warn(`Removing parsed object: 0 0 R`),this.context.delete(Gv.of(0))),[2,this.context]}})})},t.prototype.maybeRecoverRoot=function(){var e=function(e){return e instanceof Z&&e.lookup(X.of(`Type`))===X.of(`Catalog`)};if(!e(this.context.lookup(this.context.trailerInfo.Root)))for(var t=this.context.enumerateIndirectObjects(),n=0,r=t.length;n<r;n++){var i=t[n],a=i[0],o=i[1];e(o)&&(this.context.trailerInfo.Root=a)}},t.prototype.parseHeader=function(){for(;!this.bytes.done();){if(this.matchKeyword(fS.header)){var e=this.parseRawInt();this.bytes.assertNext(J.Period);var t=this.parseRawInt(),n=fv.forVersion(e,t);return this.skipBinaryHeaderComment(),n}this.bytes.next()}throw new sv(this.bytes.position())},t.prototype.parseIndirectObjectHeader=function(){this.skipWhitespaceAndComments();var e=this.parseRawInt();this.skipWhitespaceAndComments();var t=this.parseRawInt();if(this.skipWhitespaceAndComments(),!this.matchKeyword(fS.obj))throw new cv(this.bytes.position(),fS.obj);return Gv.of(e,t)},t.prototype.matchIndirectObjectHeader=function(){var e=this.bytes.offset();try{return this.parseIndirectObjectHeader(),!0}catch{return this.bytes.moveTo(e),!1}},t.prototype.parseIndirectObject=function(){return Am(this,void 0,void 0,function(){var e,t;return jm(this,function(n){switch(n.label){case 0:return e=this.parseIndirectObjectHeader(),this.skipWhitespaceAndComments(),t=this.parseObject(),this.skipWhitespaceAndComments(),this.matchKeyword(fS.endobj),t instanceof Vv&&t.dict.lookup(X.of(`Type`))===X.of(`ObjStm`)?[4,gS.forStream(t,this.shouldWaitForTick).parseIntoContext()]:[3,2];case 1:return n.sent(),[3,3];case 2:t instanceof Vv&&t.dict.lookup(X.of(`Type`))===X.of(`XRef`)?vS.forStream(t).parseIntoContext():this.context.assign(e,t),n.label=3;case 3:return[2,e]}})})},t.prototype.tryToParseInvalidIndirectObject=function(){var e=this.bytes.position(),t=`Trying to parse invalid object: `+JSON.stringify(e)+`)`;if(this.throwOnInvalidObject)throw Error(t);console.warn(t);var n=this.parseIndirectObjectHeader();console.warn(`Invalid object ref: `+n),this.skipWhitespaceAndComments();for(var r=this.bytes.offset(),i=!0;!this.bytes.done()&&(this.matchKeyword(fS.endobj)&&(i=!1),i);)this.bytes.next();if(i)throw new rv(e);var a=this.bytes.offset()-fS.endobj.length,o=Cy.of(this.bytes.slice(r,a));return this.context.assign(n,o),n},t.prototype.parseIndirectObjects=function(){return Am(this,void 0,void 0,function(){var e;return jm(this,function(t){switch(t.label){case 0:this.skipWhitespaceAndComments(),t.label=1;case 1:if(this.bytes.done()||!Yx[this.bytes.peek()])return[3,8];e=this.bytes.offset(),t.label=2;case 2:return t.trys.push([2,4,,5]),[4,this.parseIndirectObject()];case 3:return t.sent(),[3,5];case 4:return t.sent(),this.bytes.moveTo(e),this.tryToParseInvalidIndirectObject(),[3,5];case 5:return this.skipWhitespaceAndComments(),this.skipJibberish(),this.shouldWaitForTick()?[4,Th()]:[3,7];case 6:t.sent(),t.label=7;case 7:return[3,1];case 8:return[2]}})})},t.prototype.maybeParseCrossRefSection=function(){if(this.skipWhitespaceAndComments(),this.matchKeyword(fS.xref)){this.skipWhitespaceAndComments();for(var e=-1,t=py.createEmpty();!this.bytes.done()&&Yx[this.bytes.peek()];){var n=this.parseRawInt();this.skipWhitespaceAndComments();var r=this.parseRawInt();this.skipWhitespaceAndComments();var i=this.bytes.peek();if(i===J.n||i===J.f){var a=Gv.of(e,r);this.bytes.next()===J.n?t.addEntry(a,n):t.addDeletedEntry(a,n),e+=1}else e=n;this.skipWhitespaceAndComments()}return t}},t.prototype.maybeParseTrailerDict=function(){if(this.skipWhitespaceAndComments(),this.matchKeyword(fS.trailer)){this.skipWhitespaceAndComments();var e=this.parseDict(),t=this.context;t.trailerInfo={Root:e.get(X.of(`Root`))||t.trailerInfo.Root,Encrypt:e.get(X.of(`Encrypt`))||t.trailerInfo.Encrypt,Info:e.get(X.of(`Info`))||t.trailerInfo.Info,ID:e.get(X.of(`ID`))||t.trailerInfo.ID}}},t.prototype.maybeParseTrailer=function(){if(this.skipWhitespaceAndComments(),this.matchKeyword(fS.startxref)){this.skipWhitespaceAndComments();var e=this.parseRawInt();return this.skipWhitespace(),this.matchKeyword(fS.eof),this.skipWhitespaceAndComments(),this.matchKeyword(fS.eof),this.skipWhitespaceAndComments(),hy.forLastCrossRefSectionOffset(e)}},t.prototype.parseDocumentSection=function(){return Am(this,void 0,void 0,function(){return jm(this,function(e){switch(e.label){case 0:return[4,this.parseIndirectObjects()];case 1:return e.sent(),this.maybeParseCrossRefSection(),this.maybeParseTrailerDict(),this.maybeParseTrailer(),this.skipJibberish(),[2]}})})},t.prototype.skipJibberish=function(){for(this.skipWhitespaceAndComments();!this.bytes.done();){var e=this.bytes.offset(),t=this.bytes.peek();if(t>=J.Space&&t<=J.Tilde&&(this.matchKeyword(fS.xref)||this.matchKeyword(fS.trailer)||this.matchKeyword(fS.startxref)||this.matchIndirectObjectHeader())){this.bytes.moveTo(e);break}this.bytes.next()}},t.prototype.skipBinaryHeaderComment=function(){this.skipWhitespaceAndComments();try{var e=this.bytes.offset();this.parseIndirectObjectHeader(),this.bytes.moveTo(e)}catch{this.bytes.next(),this.skipWhitespaceAndComments()}},t.forBytesWithOptions=function(e,n,r,i){return new t(e,n,r,i)},t}(mS)})),SS,CS,wS=s((()=>{SS=function(e){return 1<<e},(function(e){e[e.Invisible=SS(0)]=`Invisible`,e[e.Hidden=SS(1)]=`Hidden`,e[e.Print=SS(2)]=`Print`,e[e.NoZoom=SS(3)]=`NoZoom`,e[e.NoRotate=SS(4)]=`NoRotate`,e[e.NoView=SS(5)]=`NoView`,e[e.ReadOnly=SS(6)]=`ReadOnly`,e[e.Locked=SS(7)]=`Locked`,e[e.ToggleNoView=SS(8)]=`ToggleNoView`,e[e.LockedContents=SS(9)]=`LockedContents`})(CS||={})})),TS=s((()=>{$b(),rx(),tx(),wS()})),ES=s((()=>{lv(),dv(),cy(),fy(),Sy(),ky(),pv(),gy(),vy(),my(),Ny(),Ky(),Jy(),Zy(),nb(),db(),zb(),Kb(),hv(),xv(),_v(),Wy(),jy(),Pv(),Lv(),vv(),Rv(),Kv(),wy(),Bv(),Hv(),Kx(),ny(),Dy(),by(),Jx(),uy(),ey(),Jv(),Zv(),hS(),_S(),xS(),yS(),Fb(),TS(),Wx()})),DS,OS,kS,AS=s((()=>{ES(),DS=function(e){return e instanceof X?e:X.of(e)},OS=function(e){return e instanceof gv?e:gv.of(e)},kS=function(e){return e instanceof gv?e.asNumber():e}})),jS,MS,NS,PS,FS,IS,LS,RS,zS,BS,VS,HS=s((()=>{F_(),(function(e){e.Degrees=`degrees`,e.Radians=`radians`})(jS||={}),MS=function(e){return K(e,`degreeAngle`,[`number`]),{type:jS.Degrees,angle:e}},NS=jS.Radians,PS=jS.Degrees,FS=function(e){return e*Math.PI/180},IS=function(e){return e*180/Math.PI},LS=function(e){return e.type===NS?e.angle:e.type===PS?FS(e.angle):qh(`Invalid rotation: `+JSON.stringify(e))},RS=function(e){return e.type===NS?IS(e.angle):e.type===PS?e.angle:qh(`Invalid rotation: `+JSON.stringify(e))},zS=function(e){e===void 0&&(e=0);var t=e/90%4;return t===0?0:t===1?90:t===2?180:t===3?270:0},BS=function(e,t){t===void 0&&(t=0);var n=zS(t);return n===90||n===270?{width:e.height,height:e.width}:{width:e.width,height:e.height}},VS=function(e,t,n){t===void 0&&(t=0),n===void 0&&(n=0);var r=e.x,i=e.y,a=e.width,o=e.height,s=zS(n),c=t/2;return s===0?{x:r-c,y:i-c,width:a,height:o}:s===90?{x:r-o+c,y:i-c,width:o,height:a}:s===180?{x:r-a+c,y:i-o+c,width:a,height:o}:s===270?{x:r-c,y:i-a+c,width:o,height:a}:{x:r-c,y:i-c,width:a,height:o}}})),US,WS,GS,KS,qS,JS,YS,XS,ZS,QS,$S,eC,tC,nC,rC,iC,aC,oC,sC,cC,lC,uC,dC,fC,pC,mC,hC,gC,_C,vC,yC,bC,xC,SC,CC,wC,TC,EC,DC,OC,kC,AC,jC,MC,NC,PC=s((()=>{AS(),HS(),ES(),US=function(){return qv.of(Xv.ClipNonZero)},WS=Math.cos,GS=Math.sin,KS=Math.tan,qS=function(e,t,n,r,i,a){return qv.of(Xv.ConcatTransformationMatrix,[OS(e),OS(t),OS(n),OS(r),OS(i),OS(a)])},JS=function(e,t){return qS(1,0,0,1,e,t)},YS=function(e,t){return qS(e,0,0,t,0,0)},XS=function(e){return qS(WS(kS(e)),GS(kS(e)),-GS(kS(e)),WS(kS(e)),0,0)},ZS=function(e){return XS(FS(kS(e)))},QS=function(e,t){return qS(1,KS(kS(e)),KS(kS(t)),1,0,0)},$S=function(e,t){return qv.of(Xv.SetLineDashPattern,[`[`+e.map(OS).join(` `)+`]`,OS(t)])},(function(e){e[e.Butt=0]=`Butt`,e[e.Round=1]=`Round`,e[e.Projecting=2]=`Projecting`})(eC||={}),tC=function(e){return qv.of(Xv.SetLineCapStyle,[OS(e)])},(function(e){e[e.Miter=0]=`Miter`,e[e.Round=1]=`Round`,e[e.Bevel=2]=`Bevel`})(nC||={}),rC=function(e){return qv.of(Xv.SetGraphicsStateParams,[DS(e)])},iC=function(){return qv.of(Xv.PushGraphicsState)},aC=function(){return qv.of(Xv.PopGraphicsState)},oC=function(e){return qv.of(Xv.SetLineWidth,[OS(e)])},sC=function(e,t,n,r,i,a){return qv.of(Xv.AppendBezierCurve,[OS(e),OS(t),OS(n),OS(r),OS(i),OS(a)])},cC=function(e,t,n,r){return qv.of(Xv.CurveToReplicateInitialPoint,[OS(e),OS(t),OS(n),OS(r)])},lC=function(){return qv.of(Xv.ClosePath)},uC=function(e,t){return qv.of(Xv.MoveTo,[OS(e),OS(t)])},dC=function(e,t){return qv.of(Xv.LineTo,[OS(e),OS(t)])},fC=function(){return qv.of(Xv.StrokePath)},pC=function(){return qv.of(Xv.FillNonZero)},mC=function(){return qv.of(Xv.FillNonZeroAndStroke)},hC=function(){return qv.of(Xv.EndPath)},gC=function(){return qv.of(Xv.NextLine)},_C=function(e){return qv.of(Xv.ShowText,[e])},vC=function(){return qv.of(Xv.BeginText)},yC=function(){return qv.of(Xv.EndText)},bC=function(e,t){return qv.of(Xv.SetFontAndSize,[DS(e),OS(t)])},xC=function(e){return qv.of(Xv.SetTextLineHeight,[OS(e)])},(function(e){e[e.Fill=0]=`Fill`,e[e.Outline=1]=`Outline`,e[e.FillAndOutline=2]=`FillAndOutline`,e[e.Invisible=3]=`Invisible`,e[e.FillAndClip=4]=`FillAndClip`,e[e.OutlineAndClip=5]=`OutlineAndClip`,e[e.FillAndOutlineAndClip=6]=`FillAndOutlineAndClip`,e[e.Clip=7]=`Clip`})(SC||={}),CC=function(e,t,n,r,i,a){return qv.of(Xv.SetTextMatrix,[OS(e),OS(t),OS(n),OS(r),OS(i),OS(a)])},wC=function(e,t,n,r,i){return CC(WS(kS(e)),GS(kS(e))+KS(kS(t)),-GS(kS(e))+KS(kS(n)),WS(kS(e)),r,i)},TC=function(e){return qv.of(Xv.DrawObject,[DS(e)])},EC=function(e){return qv.of(Xv.NonStrokingColorGray,[OS(e)])},DC=function(e){return qv.of(Xv.StrokingColorGray,[OS(e)])},OC=function(e,t,n){return qv.of(Xv.NonStrokingColorRgb,[OS(e),OS(t),OS(n)])},kC=function(e,t,n){return qv.of(Xv.StrokingColorRgb,[OS(e),OS(t),OS(n)])},AC=function(e,t,n,r){return qv.of(Xv.NonStrokingColorCmyk,[OS(e),OS(t),OS(n),OS(r)])},jC=function(e,t,n,r){return qv.of(Xv.StrokingColorCmyk,[OS(e),OS(t),OS(n),OS(r)])},MC=function(e){return qv.of(Xv.BeginMarkedContent,[DS(e)])},NC=function(){return qv.of(Xv.EndMarkedContent)}})),FC,IC,LC,RC,zC,BC,VC,HC,UC,WC,GC,KC=s((()=>{PC(),F_(),(function(e){e.Grayscale=`Grayscale`,e.RGB=`RGB`,e.CMYK=`CMYK`})(FC||={}),IC=function(e){return C_(e,`gray`,0,1),{type:FC.Grayscale,gray:e}},LC=function(e,t,n){return C_(e,`red`,0,1),C_(t,`green`,0,1),C_(n,`blue`,0,1),{type:FC.RGB,red:e,green:t,blue:n}},RC=function(e,t,n,r){return C_(e,`cyan`,0,1),C_(t,`magenta`,0,1),C_(n,`yellow`,0,1),C_(r,`key`,0,1),{type:FC.CMYK,cyan:e,magenta:t,yellow:n,key:r}},zC=FC.Grayscale,BC=FC.RGB,VC=FC.CMYK,HC=function(e){return e.type===zC?EC(e.gray):e.type===BC?OC(e.red,e.green,e.blue):e.type===VC?AC(e.cyan,e.magenta,e.yellow,e.key):qh(`Invalid color: `+JSON.stringify(e))},UC=function(e){return e.type===zC?DC(e.gray):e.type===BC?kC(e.red,e.green,e.blue):e.type===VC?jC(e.cyan,e.magenta,e.yellow,e.key):qh(`Invalid color: `+JSON.stringify(e))},WC=function(e,t){return t===void 0&&(t=1),e?.length===1?IC(e[0]*t):e?.length===3?LC(e[0]*t,e[1]*t,e[2]*t):e?.length===4?RC(e[0]*t,e[1]*t,e[2]*t,e[3]*t):void 0},GC=function(e){return e.type===zC?[e.gray]:e.type===BC?[e.red,e.green,e.blue]:e.type===VC?[e.cyan,e.magenta,e.yellow,e.key]:qh(`Invalid color: `+JSON.stringify(e))}})),$,qC,JC,YC,XC,ZC,QC,$C,ew,tw,nw,rw,iw,aw,ow=s((()=>{PC(),$=0,qC=0,JC=0,YC=0,XC=0,ZC=0,QC=new Map([[`A`,7],[`a`,7],[`C`,6],[`c`,6],[`H`,1],[`h`,1],[`L`,2],[`l`,2],[`M`,2],[`m`,2],[`Q`,4],[`q`,4],[`S`,4],[`s`,4],[`T`,2],[`t`,2],[`V`,1],[`v`,1],[`Z`,0],[`z`,0]]),$C=function(e){for(var t,n=[],r=[],i=``,a=!1,o=0,s=0,c=e;s<c.length;s++){var l=c[s];if(QC.has(l))o=QC.get(l),t&&(i.length>0&&(r[r.length]=+i),n[n.length]={cmd:t,args:r},r=[],i=``,a=!1),t=l;else if([` `,`,`].includes(l)||l===`-`&&i.length>0&&i[i.length-1]!==`e`||l===`.`&&a){if(i.length===0)continue;r.length===o?(n[n.length]={cmd:t,args:r},r=[+i],t===`M`&&(t=`L`),t===`m`&&(t=`l`)):r[r.length]=+i,a=l===`.`,i=[`-`,`.`].includes(l)?l:``}else i+=l,l===`.`&&(a=!0)}return i.length>0&&(r.length===o?(n[n.length]={cmd:t,args:r},r=[+i],t===`M`&&(t=`L`),t===`m`&&(t=`l`)):r[r.length]=+i),n[n.length]={cmd:t,args:r},n},ew=function(e){$=qC=JC=YC=XC=ZC=0;for(var t=[],n=0;n<e.length;n++){var r=e[n];if(r.cmd&&typeof tw[r.cmd]==`function`){var i=tw[r.cmd](r.args);Array.isArray(i)?t=t.concat(i):t.push(i)}}return t},tw={M:function(e){return $=e[0],qC=e[1],JC=YC=null,XC=$,ZC=qC,uC($,qC)},m:function(e){return $+=e[0],qC+=e[1],JC=YC=null,XC=$,ZC=qC,uC($,qC)},C:function(e){return $=e[4],qC=e[5],JC=e[2],YC=e[3],sC(e[0],e[1],e[2],e[3],e[4],e[5])},c:function(e){var t=sC(e[0]+$,e[1]+qC,e[2]+$,e[3]+qC,e[4]+$,e[5]+qC);return JC=$+e[2],YC=qC+e[3],$+=e[4],qC+=e[5],t},S:function(e){(JC===null||YC===null)&&(JC=$,YC=qC);var t=sC($-(JC-$),qC-(YC-qC),e[0],e[1],e[2],e[3]);return JC=e[0],YC=e[1],$=e[2],qC=e[3],t},s:function(e){(JC===null||YC===null)&&(JC=$,YC=qC);var t=sC($-(JC-$),qC-(YC-qC),$+e[0],qC+e[1],$+e[2],qC+e[3]);return JC=$+e[0],YC=qC+e[1],$+=e[2],qC+=e[3],t},Q:function(e){return JC=e[0],YC=e[1],$=e[2],qC=e[3],cC(e[0],e[1],$,qC)},q:function(e){var t=cC(e[0]+$,e[1]+qC,e[2]+$,e[3]+qC);return JC=$+e[0],YC=qC+e[1],$+=e[2],qC+=e[3],t},T:function(e){JC===null||YC===null?(JC=$,YC=qC):(JC=$-(JC-$),YC=qC-(YC-qC));var t=cC(JC,YC,e[0],e[1]);return JC=$-(JC-$),YC=qC-(YC-qC),$=e[0],qC=e[1],t},t:function(e){JC===null||YC===null?(JC=$,YC=qC):(JC=$-(JC-$),YC=qC-(YC-qC));var t=cC(JC,YC,$+e[0],qC+e[1]);return $+=e[0],qC+=e[1],t},A:function(e){var t=nw($,qC,e);return $=e[5],qC=e[6],t},a:function(e){e[5]+=$,e[6]+=qC;var t=nw($,qC,e);return $=e[5],qC=e[6],t},L:function(e){return $=e[0],qC=e[1],JC=YC=null,dC($,qC)},l:function(e){return $+=e[0],qC+=e[1],JC=YC=null,dC($,qC)},H:function(e){return $=e[0],JC=YC=null,dC($,qC)},h:function(e){return $+=e[0],JC=YC=null,dC($,qC)},V:function(e){return qC=e[0],JC=YC=null,dC($,qC)},v:function(e){return qC+=e[0],JC=YC=null,dC($,qC)},Z:function(){var e=lC();return $=XC,qC=ZC,e},z:function(){var e=lC();return $=XC,qC=ZC,e}},nw=function(e,t,n){for(var r=n[0],i=n[1],a=n[2],o=n[3],s=n[4],c=n[5],l=n[6],u=rw(c,l,r,i,o,s,a,e,t),d=[],f=0,p=u;f<p.length;f++){var m=p[f],h=iw.apply(void 0,m);d.push(sC.apply(void 0,h))}return d},rw=function(e,t,n,r,i,a,o,s,c){var l=Math.PI/180*o,u=Math.sin(l),d=Math.cos(l);n=Math.abs(n),r=Math.abs(r),JC=d*(s-e)*.5+u*(c-t)*.5,YC=d*(c-t)*.5-u*(s-e)*.5;var f=JC*JC/(n*n)+YC*YC/(r*r);f>1&&(f=Math.sqrt(f),n*=f,r*=f);var p=d/n,m=u/n,h=-u/r,g=d/r,_=p*s+m*c,v=h*s+g*c,y=p*e+m*t,b=h*e+g*t,x=1/((y-_)*(y-_)+(b-v)*(b-v))-.25;x<0&&(x=0);var S=Math.sqrt(x);a===i&&(S=-S);var C=.5*(_+y)-S*(b-v),w=.5*(v+b)+S*(y-_),T=Math.atan2(v-w,_-C),E=Math.atan2(b-w,y-C)-T;E<0&&a===1?E+=2*Math.PI:E>0&&a===0&&(E-=2*Math.PI);for(var D=Math.ceil(Math.abs(E/(Math.PI*.5+.001))),O=[],k=0;k<D;k++){var A=T+k*E/D,j=T+(k+1)*E/D;O[k]=[C,w,A,j,n,r,u,d]}return O},iw=function(e,t,n,r,i,a,o,s){var c=s*i,l=-o*a,u=o*i,d=s*a,f=.5*(r-n),p=8/3*Math.sin(f*.5)*Math.sin(f*.5)/Math.sin(f),m=e+Math.cos(n)-p*Math.sin(n),h=t+Math.sin(n)+p*Math.cos(n),g=e+Math.cos(r),_=t+Math.sin(r),v=g+p*Math.sin(r),y=_-p*Math.cos(r);return[c*m+l*h,u*m+d*h,c*v+l*y,u*v+d*y,c*g+l*_,u*g+d*_]},aw=function(e){return ew($C(e))}})),sw,cw,lw,uw,dw,fw,pw,mw,hw,gw,_w,vw,yw,bw,xw,Sw,Cw,ww,Tw=s((()=>{G(),KC(),PC(),HS(),ow(),AS(),sw=function(e,t){for(var n=[iC(),t.graphicsState&&rC(t.graphicsState),vC(),HC(t.color),bC(t.font,t.size),xC(t.lineHeight),wC(LS(t.rotate),LS(t.xSkew),LS(t.ySkew),t.x,t.y)].filter(Boolean),r=0,i=e.length;r<i;r++)n.push(_C(e[r]),gC());return n.push(yC(),aC()),n},cw=function(e,t){return[iC(),t.graphicsState&&rC(t.graphicsState),JS(t.x,t.y),XS(LS(t.rotate)),YS(t.width,t.height),QS(LS(t.xSkew),LS(t.ySkew)),TC(e),aC()].filter(Boolean)},lw=function(e,t){return[iC(),t.graphicsState&&rC(t.graphicsState),JS(t.x,t.y),XS(LS(t.rotate)),YS(t.xScale,t.yScale),QS(LS(t.xSkew),LS(t.ySkew)),TC(e),aC()].filter(Boolean)},uw=function(e){return[iC(),e.graphicsState&&rC(e.graphicsState),e.color&&UC(e.color),oC(e.thickness),$S(e.dashArray??[],e.dashPhase??0),uC(e.start.x,e.start.y),e.lineCap&&tC(e.lineCap),uC(e.start.x,e.start.y),dC(e.end.x,e.end.y),fC(),aC()].filter(Boolean)},dw=function(e){return[iC(),e.graphicsState&&rC(e.graphicsState),e.color&&HC(e.color),e.borderColor&&UC(e.borderColor),oC(e.borderWidth),e.borderLineCap&&tC(e.borderLineCap),$S(e.borderDashArray??[],e.borderDashPhase??0),JS(e.x,e.y),XS(LS(e.rotate)),QS(LS(e.xSkew),LS(e.ySkew)),uC(0,0),dC(0,e.height),dC(e.width,e.height),dC(e.width,0),lC(),e.color&&e.borderWidth?mC():e.color?pC():e.borderColor?fC():lC(),aC()].filter(Boolean)},fw=4*((Math.sqrt(2)-1)/3),pw=function(e){var t=kS(e.x),n=kS(e.y),r=kS(e.xScale),i=kS(e.yScale);t-=r,n-=i;var a=r*fw,o=i*fw,s=t+r*2,c=n+i*2,l=t+r,u=n+i;return[iC(),uC(t,u),sC(t,u-o,l-a,n,l,n),sC(l+a,n,s,u-o,s,u),sC(s,u+o,l+a,c,l,c),sC(l-a,c,t,u+o,t,u),aC()]},mw=function(e){var t=kS(e.x),n=kS(e.y),r=kS(e.xScale),i=kS(e.yScale),a=-r,o=-i,s=r*fw,c=i*fw,l=a+r*2,u=o+i*2,d=a+r,f=o+i;return[JS(t,n),XS(LS(e.rotate)),uC(a,f),sC(a,f-c,d-s,o,d,o),sC(d+s,o,l,f-c,l,f),sC(l,f+c,d+s,u,d,u),sC(d-s,u,a,f+c,a,f)]},hw=function(e){return Mm([iC(),e.graphicsState&&rC(e.graphicsState),e.color&&HC(e.color),e.borderColor&&UC(e.borderColor),oC(e.borderWidth),e.borderLineCap&&tC(e.borderLineCap),$S(e.borderDashArray??[],e.borderDashPhase??0)],e.rotate===void 0?pw({x:e.x,y:e.y,xScale:e.xScale,yScale:e.yScale}):mw({x:e.x,y:e.y,xScale:e.xScale,yScale:e.yScale,rotate:e.rotate??MS(0)}),[e.color&&e.borderWidth?mC():e.color?pC():e.borderColor?fC():lC(),aC()]).filter(Boolean)},gw=function(e,t){return Mm([iC(),t.graphicsState&&rC(t.graphicsState),JS(t.x,t.y),XS(LS(t.rotate??MS(0))),t.scale?YS(t.scale,-t.scale):YS(1,-1),t.color&&HC(t.color),t.borderColor&&UC(t.borderColor),t.borderWidth&&oC(t.borderWidth),t.borderLineCap&&tC(t.borderLineCap),$S(t.borderDashArray??[],t.borderDashPhase??0)],aw(e),[t.color&&t.borderWidth?mC():t.color?pC():t.borderColor?fC():lC(),aC()]).filter(Boolean)},_w=function(e){var t=kS(e.size),n=-.25,r=-.49,i=.475,a=.69,o=-.675,s=-((o-n)*(a-n))/(i-r)+r;return[iC(),e.color&&UC(e.color),oC(e.thickness),JS(e.x,e.y),uC(o*t,s*t),dC(n*t,r*t),dC(a*t,i*t),fC(),aC()].filter(Boolean)},vw=function(e){return e.rotation===0?[JS(0,0),ZS(0)]:e.rotation===90?[JS(e.width,0),ZS(90)]:e.rotation===180?[JS(e.width,e.height),ZS(180)]:e.rotation===270?[JS(0,e.height),ZS(270)]:[]},yw=function(e){var t=dw({x:e.x,y:e.y,width:e.width,height:e.height,borderWidth:e.borderWidth,color:e.color,borderColor:e.borderColor,rotate:MS(0),xSkew:MS(0),ySkew:MS(0)});if(!e.filled)return t;var n=kS(e.width),r=kS(e.height),i=Math.min(n,r)/2,a=_w({x:n/2,y:r/2,size:i,thickness:e.thickness,color:e.markColor});return Mm([iC()],t,a,[aC()])},bw=function(e){var t=kS(e.width),n=kS(e.height),r=Math.min(t,n)/2,i=hw({x:e.x,y:e.y,xScale:r,yScale:r,color:e.color,borderColor:e.borderColor,borderWidth:e.borderWidth});if(!e.filled)return i;var a=hw({x:e.x,y:e.y,xScale:r*.45,yScale:r*.45,color:e.dotColor,borderColor:void 0,borderWidth:0});return Mm([iC()],i,a,[aC()])},xw=function(e){var t=dw({x:kS(e.x),y:kS(e.y),width:kS(e.width),height:kS(e.height),borderWidth:e.borderWidth,color:e.color,borderColor:e.borderColor,rotate:MS(0),xSkew:MS(0),ySkew:MS(0)}),n=Sw(e.textLines,{color:e.textColor,font:e.font,size:e.fontSize,rotate:MS(0),xSkew:MS(0),ySkew:MS(0)});return Mm([iC()],t,n,[aC()])},Sw=function(e,t){for(var n=[vC(),HC(t.color),bC(t.font,t.size)],r=0,i=e.length;r<i;r++){var a=e[r],o=a.encoded,s=a.x,c=a.y;n.push(wC(LS(t.rotate),LS(t.xSkew),LS(t.ySkew),s,c),_C(o))}return n.push(yC()),n},Cw=function(e){var t=kS(e.x),n=kS(e.y),r=kS(e.width),i=kS(e.height),a=kS(e.borderWidth),o=kS(e.padding),s=t+a/2+o,c=n+a/2+o,l=r-(a/2+o)*2,u=i-(a/2+o)*2,d=[uC(s,c),dC(s,c+u),dC(s+l,c+u),dC(s+l,c),lC(),US(),hC()],f=dw({x:t,y:n,width:r,height:i,borderWidth:e.borderWidth,color:e.color,borderColor:e.borderColor,rotate:MS(0),xSkew:MS(0),ySkew:MS(0)}),p=Sw(e.textLines,{color:e.textColor,font:e.font,size:e.fontSize,rotate:MS(0),xSkew:MS(0),ySkew:MS(0)}),m=Mm([MC(`Tx`),iC()],p,[aC(),NC()]);return Mm([iC()],f,d,m,[aC()])},ww=function(e){for(var t=kS(e.x),n=kS(e.y),r=kS(e.width),i=kS(e.height),a=kS(e.lineHeight),o=kS(e.borderWidth),s=kS(e.padding),c=t+o/2+s,l=n+o/2+s,u=r-(o/2+s)*2,d=i-(o/2+s)*2,f=[uC(c,l),dC(c,l+d),dC(c+u,l+d),dC(c+u,l),lC(),US(),hC()],p=dw({x:t,y:n,width:r,height:i,borderWidth:e.borderWidth,color:e.color,borderColor:e.borderColor,rotate:MS(0),xSkew:MS(0),ySkew:MS(0)}),m=[],h=0,g=e.selectedLines.length;h<g;h++){var _=e.textLines[e.selectedLines[h]];m.push.apply(m,dw({x:_.x-s,y:_.y-(a-_.height)/2,width:r-o,height:_.height+(a-_.height)/2,borderWidth:0,color:e.selectedColor,borderColor:void 0,rotate:MS(0),xSkew:MS(0),ySkew:MS(0)}))}var v=Sw(e.textLines,{color:e.textColor,font:e.font,size:e.fontSize,rotate:MS(0),xSkew:MS(0),ySkew:MS(0)}),y=Mm([MC(`Tx`),iC()],v,[aC(),NC()]);return Mm([iC()],p,m,f,y,[aC()])}})),Ew,Dw,Ow,kw,Aw,jw,Mw,Nw,Pw,Fw,Iw,Lw,Rw=s((()=>{G(),Ew=function(e){W(t,e);function t(){var t=this;return t=e.call(this,"Input document to `PDFDocument.load` is encrypted. You can use `PDFDocument.load(..., { ignoreEncryption: true })` if you wish to load the document anyways.")||this,t}return t}(Error),Dw=function(e){W(t,e);function t(){var t=this;return t=e.call(this,"Input to `PDFDocument.embedFont` was a custom font, but no `fontkit` instance was found. You must register a `fontkit` instance with `PDFDocument.registerFontkit(...)` before embedding custom fonts.")||this,t}return t}(Error),Ow=function(e){W(t,e);function t(){var t=this;return t=e.call(this,"A `page` passed to `PDFDocument.addPage` or `PDFDocument.insertPage` was from a different (foreign) PDF document. If you want to copy pages from one PDFDocument to another, you must use `PDFDocument.copyPages(...)` to copy the pages before adding or inserting them.")||this,t}return t}(Error),kw=function(e){W(t,e);function t(){var t=this;return t=e.call(this,"PDFDocument has no pages so `PDFDocument.removePage` cannot be called")||this,t}return t}(Error),Aw=function(e){W(t,e);function t(t){var n=this,r=`PDFDocument has no form field with the name "`+t+`"`;return n=e.call(this,r)||this,n}return t}(Error),jw=function(e){W(t,e);function t(t,n,r){var i=this,a=n?.name,o=r?.constructor?.name??r,s=`Expected field "`+t+`" to be of type `+a+`, `+(`but it is actually of type `+o);return i=e.call(this,s)||this,i}return t}(Error),function(e){W(t,e);function t(t){var n=this,r=`Failed to select check box due to missing onValue: "`+t+`"`;return n=e.call(this,r)||this,n}return t}(Error),Mw=function(e){W(t,e);function t(t){var n=this,r=`A field already exists with the specified name: "`+t+`"`;return n=e.call(this,r)||this,n}return t}(Error),Nw=function(e){W(t,e);function t(t){var n=this,r=`Field name contains invalid component: "`+t+`"`;return n=e.call(this,r)||this,n}return t}(Error),function(e){W(t,e);function t(t){var n=this,r=`A non-terminal field already exists with the specified name: "`+t+`"`;return n=e.call(this,r)||this,n}return t}(Error),Pw=function(e){W(t,e);function t(t){var n=this,r=`Reading rich text fields is not supported: Attempted to read rich text field: `+t;return n=e.call(this,r)||this,n}return t}(Error),Fw=function(e){W(t,e);function t(t,n){var r=this,i=`Failed to layout combed text as lineLength=`+t+` is greater than cellCount=`+n;return r=e.call(this,i)||this,r}return t}(Error),Iw=function(e){W(t,e);function t(t,n,r){var i=this,a=`Attempted to set text with length=`+t+` for TextField with maxLength=`+n+` and name=`+r;return i=e.call(this,a)||this,i}return t}(Error),Lw=function(e){W(t,e);function t(t,n,r){var i=this,a=`Attempted to set maxLength=`+n+`, which is less than `+t+`, the length of this field's current value (name=`+r+`)`;return i=e.call(this,a)||this,i}return t}(Error)})),zw,Bw=s((()=>{(function(e){e[e.Left=0]=`Left`,e[e.Center=1]=`Center`,e[e.Right=2]=`Right`})(zw||={})})),Vw,Hw,Uw,Ww,Gw,Kw,qw,Jw,Yw,Xw=s((()=>{Rw(),Bw(),F_(),Vw=4,Hw=500,Uw=function(e,t,n,r){r===void 0&&(r=!1);for(var i=Vw;i<Hw;){for(var a=0,o=0,s=e.length;o<s;o++){a+=1;for(var c=e[o].split(` `),l=n.width,u=0,d=c.length;u<d;u++){var f=u===d-1?c[u]:c[u]+` `,p=t.widthOfTextAtSize(f,i);l-=p,l<=0&&(a+=1,l=n.width-p)}}if(!r&&a>e.length)return i-1;var m=t.heightAtSize(i);if((m+m*.2)*a>Math.abs(n.height))return i-1;i+=1}return i},Ww=function(e,t,n,r){for(var i=n.width/r,a=n.height,o=Vw,s=ih(e);o<Hw;){for(var c=0,l=s.length;c<l;c++){var u=s[c];if(t.widthOfTextAtSize(u,o)>i*.75)return o-1}if(t.heightAtSize(o,{descender:!1})>a)return o-1;o+=1}return o},Gw=function(e){for(var t=e.length;t>0;t--)if(/\s/.test(e[t]))return t},Kw=function(e,t,n,r){for(var i=e.length;i>0;){var a=e.substring(0,i),o=n.encodeText(a),s=n.widthOfTextAtSize(a,r);if(s<t)return{line:a,encoded:o,width:s,remainder:e.substring(i)||void 0};i=Gw(a)??0}return{line:e,encoded:n.encodeText(e),width:n.widthOfTextAtSize(e,r),remainder:void 0}},qw=function(e,t){var n=t.alignment,r=t.fontSize,i=t.font,a=t.bounds,o=th(Qm(e));(r===void 0||r===0)&&(r=Uw(o,i,a,!0));for(var s=i.heightAtSize(r),c=s+s*.2,l=[],u=a.x,d=a.y,f=a.x+a.width,p=a.y+a.height,m=a.y+a.height,h=0,g=o.length;h<g;h++)for(var _=o[h];_!==void 0;){var v=Kw(_,a.width,i,r),y=v.line,b=v.encoded,x=v.width,S=v.remainder,C=n===zw.Left?a.x:n===zw.Center?a.x+a.width/2-x/2:n===zw.Right?a.x+a.width-x:a.x;m-=c,C<u&&(u=C),m<d&&(d=m),C+x>f&&(f=C+x),m+s>p&&(p=m+s),l.push({text:y,encoded:b,width:x,height:s,x:C,y:m}),_=S?.trim()}return{fontSize:r,lineHeight:c,lines:l,bounds:{x:u,y:d,width:f-u,height:p-d}}},Jw=function(e,t){var n=t.fontSize,r=t.font,i=t.bounds,a=t.cellCount,o=nh(Qm(e));if(o.length>a)throw new Fw(o.length,a);(n===void 0||n===0)&&(n=Ww(o,r,i,a));for(var s=i.width/a,c=r.heightAtSize(n,{descender:!1}),l=i.y+(i.height/2-c/2),u=[],d=i.x,f=i.y,p=i.x+i.width,m=i.y+i.height,h=0,g=0;h<a;){var _=rh(o,g),v=_[0],y=_[1],b=r.encodeText(v),x=r.widthOfTextAtSize(v,n),S=i.x+(s*h+s/2)-x/2;S<d&&(d=S),l<f&&(f=l),S+x>p&&(p=S+x),l+c>m&&(m=l+c),u.push({text:o,encoded:b,width:x,height:c,x:S,y:l}),h+=1,g+=y}return{fontSize:n,cells:u,bounds:{x:d,y:f,width:p-d,height:m-f}}},Yw=function(e,t){var n=t.alignment,r=t.fontSize,i=t.font,a=t.bounds,o=nh(Qm(e));(r===void 0||r===0)&&(r=Uw([o],i,a));var s=i.encodeText(o),c=i.widthOfTextAtSize(o,r),l=i.heightAtSize(r,{descender:!1}),u=n===zw.Left?a.x:n===zw.Center?a.x+a.width/2-c/2:n===zw.Right?a.x+a.width-c:a.x,d=a.y+(a.height/2-l/2);return{fontSize:r,line:{text:o,encoded:s,width:c,height:l,x:u,y:d},bounds:{x:u,y:d,width:c,height:l}}}})),Zw,Qw,$w,eT,tT,nT,rT,iT,aT,oT,sT,cT,lT=s((()=>{G(),Tw(),KC(),HS(),Xw(),Bw(),PC(),F_(),Zw=function(e){return`normal`in e?e:{normal:e}},Qw=/\/([^\0\t\n\f\r\ ]+)[\0\t\n\f\r\ ]+(\d*\.\d+|\d+)[\0\t\n\f\r\ ]+Tf/,$w=function(e){var t=e.getDefaultAppearance()??``,n=lh(t,Qw).match??[],r=Number(n[2]);return isFinite(r)?r:void 0},eT=/(\d*\.\d+|\d+)[\0\t\n\f\r\ ]*(\d*\.\d+|\d+)?[\0\t\n\f\r\ ]*(\d*\.\d+|\d+)?[\0\t\n\f\r\ ]*(\d*\.\d+|\d+)?[\0\t\n\f\r\ ]+(g|rg|k)/,tT=function(e){var t=e.getDefaultAppearance()??``,n=lh(t,eT).match??[],r=n[1],i=n[2],a=n[3],o=n[4],s=n[5];if(s===`g`&&r)return IC(Number(r));if(s===`rg`&&r&&i&&a)return LC(Number(r),Number(i),Number(a));if(s===`k`&&r&&i&&a&&o)return RC(Number(r),Number(i),Number(a),Number(o))},nT=function(e,t,n,r){r===void 0&&(r=0);var i=[HC(t).toString(),bC(n?.name??`dummy__noop`,r).toString()].join(`
1016
+ `);e.setDefaultAppearance(i)},rT=function(e,t){var n=tT(t),r=tT(e.acroField),i=t.getRectangle(),a=t.getAppearanceCharacteristics(),o=t.getBorderStyle()?.getWidth()??0,s=zS(a?.getRotation()),c=BS(i,s),l=c.width,u=c.height,d=vw(Pm(Pm({},i),{rotation:s})),f=LC(0,0,0),p=WC(a?.getBorderColor())??f,m=WC(a?.getBackgroundColor()),h=WC(a?.getBackgroundColor(),.8),g=n??r??f;nT(n?t:e.acroField,g);var _={x:0+o/2,y:0+o/2,width:l-o,height:u-o,thickness:1.5,borderWidth:o,borderColor:p,markColor:g};return{normal:{on:Mm(d,yw(Pm(Pm({},_),{color:m,filled:!0}))),off:Mm(d,yw(Pm(Pm({},_),{color:m,filled:!1})))},down:{on:Mm(d,yw(Pm(Pm({},_),{color:h,filled:!0}))),off:Mm(d,yw(Pm(Pm({},_),{color:h,filled:!1})))}}},iT=function(e,t){var n=tT(t),r=tT(e.acroField),i=t.getRectangle(),a=t.getAppearanceCharacteristics(),o=t.getBorderStyle()?.getWidth()??0,s=zS(a?.getRotation()),c=BS(i,s),l=c.width,u=c.height,d=vw(Pm(Pm({},i),{rotation:s})),f=LC(0,0,0),p=WC(a?.getBorderColor())??f,m=WC(a?.getBackgroundColor()),h=WC(a?.getBackgroundColor(),.8),g=n??r??f;nT(n?t:e.acroField,g);var _={x:l/2,y:u/2,width:l-o,height:u-o,borderWidth:o,borderColor:p,dotColor:g};return{normal:{on:Mm(d,bw(Pm(Pm({},_),{color:m,filled:!0}))),off:Mm(d,bw(Pm(Pm({},_),{color:m,filled:!1})))},down:{on:Mm(d,bw(Pm(Pm({},_),{color:h,filled:!0}))),off:Mm(d,bw(Pm(Pm({},_),{color:h,filled:!1})))}}},aT=function(e,t,n){var r=tT(t),i=tT(e.acroField),a=$w(t),o=$w(e.acroField),s=t.getRectangle(),c=t.getAppearanceCharacteristics(),l=t.getBorderStyle(),u=c?.getCaptions(),d=u?.normal??``,f=u?.down??d??``,p=l?.getWidth()??0,m=zS(c?.getRotation()),h=BS(s,m),g=h.width,_=h.height,v=vw(Pm(Pm({},s),{rotation:m})),y=LC(0,0,0),b=WC(c?.getBorderColor()),x=WC(c?.getBackgroundColor()),S=WC(c?.getBackgroundColor(),.8),C={x:p,y:p,width:g-p*2,height:_-p*2},w=Yw(d,{alignment:zw.Center,fontSize:a??o,font:n,bounds:C}),T=Yw(f,{alignment:zw.Center,fontSize:a??o,font:n,bounds:C}),E=Math.min(w.fontSize,T.fontSize),D=r??i??y;nT(r||a!==void 0?t:e.acroField,D,n,E);var O={x:0+p/2,y:0+p/2,width:g-p,height:_-p,borderWidth:p,borderColor:b,textColor:D,font:n.name,fontSize:E};return{normal:Mm(v,xw(Pm(Pm({},O),{color:x,textLines:[w.line]}))),down:Mm(v,xw(Pm(Pm({},O),{color:S,textLines:[T.line]})))}},oT=function(e,t,n){var r=tT(t),i=tT(e.acroField),a=$w(t),o=$w(e.acroField),s=t.getRectangle(),c=t.getAppearanceCharacteristics(),l=t.getBorderStyle(),u=e.getText()??``,d=l?.getWidth()??0,f=zS(c?.getRotation()),p=BS(s,f),m=p.width,h=p.height,g=vw(Pm(Pm({},s),{rotation:f})),_=LC(0,0,0),v=WC(c?.getBorderColor()),y=WC(c?.getBackgroundColor()),b,x,S=+!e.isCombed(),C={x:d+S,y:d+S,width:m-(d+S)*2,height:h-(d+S)*2};if(e.isMultiline()){var w=qw(u,{alignment:e.getAlignment(),fontSize:a??o,font:n,bounds:C});b=w.lines,x=w.fontSize}else if(e.isCombed()){var w=Jw(u,{fontSize:a??o,font:n,bounds:C,cellCount:e.getMaxLength()??0});b=w.cells,x=w.fontSize}else{var w=Yw(u,{alignment:e.getAlignment(),fontSize:a??o,font:n,bounds:C});b=[w.line],x=w.fontSize}var T=r??i??_;nT(r||a!==void 0?t:e.acroField,T,n,x);var E={x:0+d/2,y:0+d/2,width:m-d,height:h-d,borderWidth:d??0,borderColor:v,textColor:T,font:n.name,fontSize:x,color:y,textLines:b,padding:S};return Mm(g,Cw(E))},sT=function(e,t,n){var r=tT(t),i=tT(e.acroField),a=$w(t),o=$w(e.acroField),s=t.getRectangle(),c=t.getAppearanceCharacteristics(),l=t.getBorderStyle(),u=e.getSelected()[0]??``,d=l?.getWidth()??0,f=zS(c?.getRotation()),p=BS(s,f),m=p.width,h=p.height,g=vw(Pm(Pm({},s),{rotation:f})),_=LC(0,0,0),v=WC(c?.getBorderColor()),y=WC(c?.getBackgroundColor()),b=1,x={x:d+b,y:d+b,width:m-(d+b)*2,height:h-(d+b)*2},S=Yw(u,{alignment:zw.Left,fontSize:a??o,font:n,bounds:x}),C=S.line,w=S.fontSize,T=r??i??_;nT(r||a!==void 0?t:e.acroField,T,n,w);var E={x:0+d/2,y:0+d/2,width:m-d,height:h-d,borderWidth:d??0,borderColor:v,textColor:T,font:n.name,fontSize:w,color:y,textLines:[C],padding:b};return Mm(g,Cw(E))},cT=function(e,t,n){var r=tT(t),i=tT(e.acroField),a=$w(t),o=$w(e.acroField),s=t.getRectangle(),c=t.getAppearanceCharacteristics(),l=t.getBorderStyle()?.getWidth()??0,u=zS(c?.getRotation()),d=BS(s,u),f=d.width,p=d.height,m=vw(Pm(Pm({},s),{rotation:u})),h=LC(0,0,0),g=WC(c?.getBorderColor()),_=WC(c?.getBackgroundColor()),v=e.getOptions(),y=e.getSelected();e.isSorted()&&v.sort();for(var b=``,x=0,S=v.length;x<S;x++)b+=v[x],x<S-1&&(b+=`
1017
+ `);for(var C=1,w={x:l+C,y:l+C,width:f-(l+C)*2,height:p-(l+C)*2},T=qw(b,{alignment:zw.Left,fontSize:a??o,font:n,bounds:w}),E=T.lines,D=T.fontSize,O=T.lineHeight,k=[],x=0,S=E.length;x<S;x++){var A=E[x];y.includes(A.text)&&k.push(x)}var j=LC(153/255,193/255,218/255),M=r??i??h;return nT(r||a!==void 0?t:e.acroField,M,n,D),Mm(m,ww({x:0+l/2,y:0+l/2,width:f-l,height:p-l,borderWidth:l??0,borderColor:g,textColor:M,font:n.name,fontSize:D,color:_,textLines:E,lineHeight:O,selectedColor:j,selectedLines:k,padding:C}))}})),uT,dT=s((()=>{G(),$T(),ES(),F_(),uT=function(){function e(e,t,n){this.alreadyEmbedded=!1,K(e,`ref`,[[Gv,`PDFRef`]]),K(t,`doc`,[[QT,`PDFDocument`]]),K(n,`embedder`,[[Rb,`PDFPageEmbedder`]]),this.ref=e,this.doc=t,this.width=n.width,this.height=n.height,this.embedder=n}return e.prototype.scale=function(e){return K(e,`factor`,[`number`]),{width:this.width*e,height:this.height*e}},e.prototype.size=function(){return this.scale(1)},e.prototype.embed=function(){return Am(this,void 0,void 0,function(){return jm(this,function(e){switch(e.label){case 0:return this.alreadyEmbedded?[3,2]:[4,this.embedder.embedIntoContext(this.doc.context,this.ref)];case 1:e.sent(),this.alreadyEmbedded=!0,e.label=2;case 2:return[2]}})})},e.of=function(t,n,r){return new e(t,n,r)},e}()})),fT,pT=s((()=>{G(),$T(),ES(),F_(),fT=function(){function e(e,t,n){this.modified=!0,K(e,`ref`,[[Gv,`PDFRef`]]),K(t,`doc`,[[QT,`PDFDocument`]]),K(n,`embedder`,[[Gy,`CustomFontEmbedder`],[My,`StandardFontEmbedder`]]),this.ref=e,this.doc=t,this.name=n.fontName,this.embedder=n}return e.prototype.encodeText=function(e){return K(e,`text`,[`string`]),this.modified=!0,this.embedder.encodeText(e)},e.prototype.widthOfTextAtSize=function(e,t){return K(e,`text`,[`string`]),K(t,`size`,[`number`]),this.embedder.widthOfTextAtSize(e,t)},e.prototype.heightAtSize=function(e,t){return K(e,`size`,[`number`]),q(t?.descender,`options.descender`,[`boolean`]),this.embedder.heightOfFontAtSize(e,{descender:t?.descender??!0})},e.prototype.sizeAtHeight=function(e){return K(e,`height`,[`number`]),this.embedder.sizeOfFontAtHeight(e)},e.prototype.getCharacterSet=function(){return this.embedder instanceof My?this.embedder.encoding.supportedCodePoints:this.embedder.font.characterSet},e.prototype.embed=function(){return Am(this,void 0,void 0,function(){return jm(this,function(e){switch(e.label){case 0:return this.modified?[4,this.embedder.embedIntoContext(this.doc.context,this.ref)]:[3,2];case 1:e.sent(),this.modified=!1,e.label=2;case 2:return[2]}})})},e.of=function(t,n,r){return new e(t,n,r)},e}()})),mT,hT=s((()=>{G(),$T(),ES(),F_(),mT=function(){function e(e,t,n){K(e,`ref`,[[Gv,`PDFRef`]]),K(t,`doc`,[[QT,`PDFDocument`]]),K(n,`embedder`,[[tb,`JpegEmbedder`],[ub,`PngEmbedder`]]),this.ref=e,this.doc=t,this.width=n.width,this.height=n.height,this.embedder=n}return e.prototype.scale=function(e){return K(e,`factor`,[`number`]),{width:this.width*e,height:this.height*e}},e.prototype.scaleToFit=function(e,t){K(e,`width`,[`number`]),K(t,`height`,[`number`]);var n=e/this.width,r=t/this.height,i=Math.min(n,r);return this.scale(i)},e.prototype.size=function(){return this.scale(1)},e.prototype.embed=function(){return Am(this,void 0,void 0,function(){var e,t,n;return jm(this,function(r){switch(r.label){case 0:return this.embedder?(this.embedTask||=(e=this,t=e.doc,n=e.ref,this.embedder.embedIntoContext(t.context,n)),[4,this.embedTask]):[2];case 1:return r.sent(),this.embedder=void 0,[2]}})})},e.of=function(t,n,r){return new e(t,n,r)},e}()})),gT,_T=s((()=>{(function(e){e[e.Left=0]=`Left`,e[e.Center=1]=`Center`,e[e.Right=2]=`Right`})(gT||={})})),vT=s((()=>{_T()})),yT,bT,xT=s((()=>{G(),$T(),KC(),HS(),ES(),F_(),vT(),Tw(),yT=function(e){q(e?.x,`options.x`,[`number`]),q(e?.y,`options.y`,[`number`]),q(e?.width,`options.width`,[`number`]),q(e?.height,`options.height`,[`number`]),q(e?.textColor,`options.textColor`,[[Object,`Color`]]),q(e?.backgroundColor,`options.backgroundColor`,[[Object,`Color`]]),q(e?.borderColor,`options.borderColor`,[[Object,`Color`]]),q(e?.borderWidth,`options.borderWidth`,[`number`]),q(e?.rotate,`options.rotate`,[[Object,`Rotation`]])},bT=function(){function e(e,t,n){K(e,`acroField`,[[ix,`PDFAcroTerminal`]]),K(t,`ref`,[[Gv,`PDFRef`]]),K(n,`doc`,[[QT,`PDFDocument`]]),this.acroField=e,this.ref=t,this.doc=n}return e.prototype.getName=function(){return this.acroField.getFullyQualifiedName()??``},e.prototype.isReadOnly=function(){return this.acroField.hasFlag(dx.ReadOnly)},e.prototype.enableReadOnly=function(){this.acroField.setFlagTo(dx.ReadOnly,!0)},e.prototype.disableReadOnly=function(){this.acroField.setFlagTo(dx.ReadOnly,!1)},e.prototype.isRequired=function(){return this.acroField.hasFlag(dx.Required)},e.prototype.enableRequired=function(){this.acroField.setFlagTo(dx.Required,!0)},e.prototype.disableRequired=function(){this.acroField.setFlagTo(dx.Required,!1)},e.prototype.isExported=function(){return!this.acroField.hasFlag(dx.NoExport)},e.prototype.enableExporting=function(){this.acroField.setFlagTo(dx.NoExport,!1)},e.prototype.disableExporting=function(){this.acroField.setFlagTo(dx.NoExport,!0)},e.prototype.needsAppearancesUpdate=function(){throw new I_(this.constructor.name,`needsAppearancesUpdate`)},e.prototype.defaultUpdateAppearances=function(e){throw new I_(this.constructor.name,`defaultUpdateAppearances`)},e.prototype.markAsDirty=function(){this.doc.getForm().markFieldAsDirty(this.ref)},e.prototype.markAsClean=function(){this.doc.getForm().markFieldAsClean(this.ref)},e.prototype.isDirty=function(){return this.doc.getForm().fieldIsDirty(this.ref)},e.prototype.createWidget=function(e){var t=e.textColor,n=e.backgroundColor,r=e.borderColor,i=e.borderWidth,a=RS(e.rotate),o=e.caption,s=e.x,c=e.y,l=e.width+i,u=e.height+i,d=!!e.hidden,f=e.page;T_(a,`degreesAngle`,90);var p=nx.create(this.doc.context,this.ref),m=VS({x:s,y:c,width:l,height:u},i,a);p.setRectangle(m),f&&p.setP(f);var h=p.getOrCreateAppearanceCharacteristics();n&&h.setBackgroundColor(GC(n)),h.setRotation(a),o&&h.setCaptions({normal:o}),r&&h.setBorderColor(GC(r));var g=p.getOrCreateBorderStyle();if(i!==void 0&&g.setWidth(i),p.setFlagTo(CS.Print,!0),p.setFlagTo(CS.Hidden,d),p.setFlagTo(CS.Invisible,!1),t){var _=(this.acroField.getDefaultAppearance()??``)+`
1018
+ `+HC(t).toString();this.acroField.setDefaultAppearance(_)}return p},e.prototype.updateWidgetAppearanceWithFont=function(e,t,n){var r=n.normal,i=n.rollover,a=n.down;this.updateWidgetAppearances(e,{normal:this.createAppearanceStream(e,r,t),rollover:i&&this.createAppearanceStream(e,i,t),down:a&&this.createAppearanceStream(e,a,t)})},e.prototype.updateOnOffWidgetAppearance=function(e,t,n){var r=n.normal,i=n.rollover,a=n.down;this.updateWidgetAppearances(e,{normal:this.createAppearanceDict(e,r,t),rollover:i&&this.createAppearanceDict(e,i,t),down:a&&this.createAppearanceDict(e,a,t)})},e.prototype.updateWidgetAppearances=function(e,t){var n=t.normal,r=t.rollover,i=t.down;e.setNormalAppearance(n),r?e.setRolloverAppearance(r):e.removeRolloverAppearance(),i?e.setDownAppearance(i):e.removeDownAppearance()},e.prototype.createAppearanceStream=function(e,t,n){var r,i=this.acroField.dict.context,a=e.getRectangle(),o=a.width,s=a.height,c=n&&{Font:(r={},r[n.name]=n.ref,r)},l=i.formXObject(t,{Resources:c,BBox:i.obj([0,0,o,s]),Matrix:i.obj([1,0,0,1,0,0])});return i.register(l)},e.prototype.createImageAppearanceStream=function(e,t,n){var r,i=this.acroField.dict.context,a=e.getRectangle(),o=e.getAppearanceCharacteristics(),s=e.getBorderStyle()?.getWidth()??0,c=zS(o?.getRotation()),l=vw(Pm(Pm({},a),{rotation:c})),u=BS(a,c),d=t.scaleToFit(u.width-s*2,u.height-s*2),f={x:s,y:s,width:d.width,height:d.height,rotate:MS(0),xSkew:MS(0),ySkew:MS(0)};n===gT.Center?(f.x+=(u.width-s*2)/2-d.width/2,f.y+=(u.height-s*2)/2-d.height/2):n===gT.Right&&(f.x=u.width-s-d.width,f.y=u.height-s-d.height);var p=this.doc.context.addRandomSuffix(`Image`,10),m=Mm(l,cw(p,f)),h={XObject:(r={},r[p]=t.ref,r)},g=i.formXObject(m,{Resources:h,BBox:i.obj([0,0,a.width,a.height]),Matrix:i.obj([1,0,0,1,0,0])});return i.register(g)},e.prototype.createAppearanceDict=function(e,t,n){var r=this.acroField.dict.context,i=this.createAppearanceStream(e,t.on),a=this.createAppearanceStream(e,t.off),o=r.obj({});return o.set(n,i),o.set(X.of(`Off`),a),o},e}()})),ST,CT=s((()=>{G(),rE(),lT(),KC(),HS(),xT(),ES(),F_(),ST=function(e){W(t,e);function t(t,n,r){var i=e.call(this,t,n,r)||this;return K(t,`acroCheckBox`,[[cx,`PDFAcroCheckBox`]]),i.acroField=t,i}return t.prototype.check=function(){var e=this.acroField.getOnValue()??X.of(`Yes`);this.markAsDirty(),this.acroField.setValue(e)},t.prototype.uncheck=function(){this.markAsDirty(),this.acroField.setValue(X.of(`Off`))},t.prototype.isChecked=function(){var e=this.acroField.getOnValue();return!!e&&e===this.acroField.getValue()},t.prototype.addToPage=function(e,t){K(e,`page`,[[nE,`PDFPage`]]),yT(t),t||={},`textColor`in t||(t.textColor=LC(0,0,0)),`backgroundColor`in t||(t.backgroundColor=LC(1,1,1)),`borderColor`in t||(t.borderColor=LC(0,0,0)),`borderWidth`in t||(t.borderWidth=1);var n=this.createWidget({x:t.x??0,y:t.y??0,width:t.width??50,height:t.height??50,textColor:t.textColor,backgroundColor:t.backgroundColor,borderColor:t.borderColor,borderWidth:t.borderWidth??0,rotate:t.rotate??MS(0),hidden:t.hidden,page:e.ref}),r=this.doc.context.register(n.dict);this.acroField.addWidget(r),n.setAppearanceState(X.of(`Off`)),this.updateWidgetAppearance(n,X.of(`Yes`)),e.node.addAnnot(r)},t.prototype.needsAppearancesUpdate=function(){for(var e=this.acroField.getWidgets(),t=0,n=e.length;t<n;t++){var r=e[t],i=r.getAppearanceState(),a=r.getAppearances()?.normal;if(!(a instanceof Z)||i&&!a.has(i))return!0}return!1},t.prototype.defaultUpdateAppearances=function(){this.updateAppearances()},t.prototype.updateAppearances=function(e){q(e,`provider`,[Function]);for(var t=this.acroField.getWidgets(),n=0,r=t.length;n<r;n++){var i=t[n],a=i.getOnValue()??X.of(`Yes`);a&&this.updateWidgetAppearance(i,a,e)}this.markAsClean()},t.prototype.updateWidgetAppearance=function(e,t,n){var r=Zw((n??rT)(this,e));this.updateOnOffWidgetAppearance(e,t,r)},t.of=function(e,n,r){return new t(e,n,r)},t}(bT)})),wT,TT=s((()=>{G(),rE(),pT(),xT(),lT(),KC(),HS(),ES(),F_(),wT=function(e){W(t,e);function t(t,n,r){var i=e.call(this,t,n,r)||this;return K(t,`acroComboBox`,[[vx,`PDFAcroComboBox`]]),i.acroField=t,i}return t.prototype.getOptions=function(){for(var e=this.acroField.getOptions(),t=Array(e.length),n=0,r=t.length;n<r;n++){var i=e[n],a=i.display,o=i.value;t[n]=(a??o).decodeText()}return t},t.prototype.getSelected=function(){for(var e=this.acroField.getValues(),t=Array(e.length),n=0,r=e.length;n<r;n++)t[n]=e[n].decodeText();return t},t.prototype.setOptions=function(e){K(e,`options`,[Array]);for(var t=Array(e.length),n=0,r=e.length;n<r;n++)t[n]={value:Ay.fromText(e[n])};this.acroField.setOptions(t)},t.prototype.addOptions=function(e){K(e,`options`,[`string`,Array]);for(var t=Array.isArray(e)?e:[e],n=this.acroField.getOptions(),r=Array(t.length),i=0,a=t.length;i<a;i++)r[i]={value:Ay.fromText(t[i])};this.acroField.setOptions(n.concat(r))},t.prototype.select=function(e,t){t===void 0&&(t=!1),K(e,`options`,[`string`,Array]),K(t,`merge`,[`boolean`]);var n=Array.isArray(e)?e:[e],r=this.getOptions();n.find(function(e){return!r.includes(e)})&&this.enableEditing(),this.markAsDirty(),(n.length>1||n.length===1&&t)&&this.enableMultiselect();for(var i=Array(n.length),a=0,o=n.length;a<o;a++)i[a]=Ay.fromText(n[a]);if(t){var s=this.acroField.getValues();this.acroField.setValues(s.concat(i))}else this.acroField.setValues(i)},t.prototype.clear=function(){this.markAsDirty(),this.acroField.setValues([])},t.prototype.setFontSize=function(e){D_(e,`fontSize`),this.acroField.setFontSize(e),this.markAsDirty()},t.prototype.isEditable=function(){return this.acroField.hasFlag(mx.Edit)},t.prototype.enableEditing=function(){this.acroField.setFlagTo(mx.Edit,!0)},t.prototype.disableEditing=function(){this.acroField.setFlagTo(mx.Edit,!1)},t.prototype.isSorted=function(){return this.acroField.hasFlag(mx.Sort)},t.prototype.enableSorting=function(){this.acroField.setFlagTo(mx.Sort,!0)},t.prototype.disableSorting=function(){this.acroField.setFlagTo(mx.Sort,!1)},t.prototype.isMultiselect=function(){return this.acroField.hasFlag(mx.MultiSelect)},t.prototype.enableMultiselect=function(){this.acroField.setFlagTo(mx.MultiSelect,!0)},t.prototype.disableMultiselect=function(){this.acroField.setFlagTo(mx.MultiSelect,!1)},t.prototype.isSpellChecked=function(){return!this.acroField.hasFlag(mx.DoNotSpellCheck)},t.prototype.enableSpellChecking=function(){this.acroField.setFlagTo(mx.DoNotSpellCheck,!1)},t.prototype.disableSpellChecking=function(){this.acroField.setFlagTo(mx.DoNotSpellCheck,!0)},t.prototype.isSelectOnClick=function(){return this.acroField.hasFlag(mx.CommitOnSelChange)},t.prototype.enableSelectOnClick=function(){this.acroField.setFlagTo(mx.CommitOnSelChange,!0)},t.prototype.disableSelectOnClick=function(){this.acroField.setFlagTo(mx.CommitOnSelChange,!1)},t.prototype.addToPage=function(e,t){K(e,`page`,[[nE,`PDFPage`]]),yT(t),t||={},`textColor`in t||(t.textColor=LC(0,0,0)),`backgroundColor`in t||(t.backgroundColor=LC(1,1,1)),`borderColor`in t||(t.borderColor=LC(0,0,0)),`borderWidth`in t||(t.borderWidth=1);var n=this.createWidget({x:t.x??0,y:t.y??0,width:t.width??200,height:t.height??50,textColor:t.textColor,backgroundColor:t.backgroundColor,borderColor:t.borderColor,borderWidth:t.borderWidth??0,rotate:t.rotate??MS(0),hidden:t.hidden,page:e.ref}),r=this.doc.context.register(n.dict);this.acroField.addWidget(r);var i=t.font??this.doc.getForm().getDefaultFont();this.updateWidgetAppearance(n,i),e.node.addAnnot(r)},t.prototype.needsAppearancesUpdate=function(){if(this.isDirty())return!0;for(var e=this.acroField.getWidgets(),t=0,n=e.length;t<n;t++)if(!(e[t].getAppearances()?.normal instanceof zv))return!0;return!1},t.prototype.defaultUpdateAppearances=function(e){K(e,`font`,[[fT,`PDFFont`]]),this.updateAppearances(e)},t.prototype.updateAppearances=function(e,t){K(e,`font`,[[fT,`PDFFont`]]),q(t,`provider`,[Function]);for(var n=this.acroField.getWidgets(),r=0,i=n.length;r<i;r++){var a=n[r];this.updateWidgetAppearance(a,e,t)}this.markAsClean()},t.prototype.updateWidgetAppearance=function(e,t,n){var r=Zw((n??sT)(this,e,t));this.updateWidgetAppearanceWithFont(e,t,r)},t.of=function(e,n,r){return new t(e,n,r)},t}(bT)})),ET,DT=s((()=>{G(),rE(),pT(),xT(),lT(),KC(),HS(),ES(),F_(),ET=function(e){W(t,e);function t(t,n,r){var i=e.call(this,t,n,r)||this;return K(t,`acroListBox`,[[Ax,`PDFAcroListBox`]]),i.acroField=t,i}return t.prototype.getOptions=function(){for(var e=this.acroField.getOptions(),t=Array(e.length),n=0,r=t.length;n<r;n++){var i=e[n],a=i.display,o=i.value;t[n]=(a??o).decodeText()}return t},t.prototype.getSelected=function(){for(var e=this.acroField.getValues(),t=Array(e.length),n=0,r=e.length;n<r;n++)t[n]=e[n].decodeText();return t},t.prototype.setOptions=function(e){K(e,`options`,[Array]),this.markAsDirty();for(var t=Array(e.length),n=0,r=e.length;n<r;n++)t[n]={value:Ay.fromText(e[n])};this.acroField.setOptions(t)},t.prototype.addOptions=function(e){K(e,`options`,[`string`,Array]),this.markAsDirty();for(var t=Array.isArray(e)?e:[e],n=this.acroField.getOptions(),r=Array(t.length),i=0,a=t.length;i<a;i++)r[i]={value:Ay.fromText(t[i])};this.acroField.setOptions(n.concat(r))},t.prototype.select=function(e,t){t===void 0&&(t=!1),K(e,`options`,[`string`,Array]),K(t,`merge`,[`boolean`]);var n=Array.isArray(e)?e:[e],r=this.getOptions();v_(n,`option`,r),this.markAsDirty(),(n.length>1||n.length===1&&t)&&this.enableMultiselect();for(var i=Array(n.length),a=0,o=n.length;a<o;a++)i[a]=Ay.fromText(n[a]);if(t){var s=this.acroField.getValues();this.acroField.setValues(s.concat(i))}else this.acroField.setValues(i)},t.prototype.clear=function(){this.markAsDirty(),this.acroField.setValues([])},t.prototype.setFontSize=function(e){D_(e,`fontSize`),this.acroField.setFontSize(e),this.markAsDirty()},t.prototype.isSorted=function(){return this.acroField.hasFlag(mx.Sort)},t.prototype.enableSorting=function(){this.acroField.setFlagTo(mx.Sort,!0)},t.prototype.disableSorting=function(){this.acroField.setFlagTo(mx.Sort,!1)},t.prototype.isMultiselect=function(){return this.acroField.hasFlag(mx.MultiSelect)},t.prototype.enableMultiselect=function(){this.acroField.setFlagTo(mx.MultiSelect,!0)},t.prototype.disableMultiselect=function(){this.acroField.setFlagTo(mx.MultiSelect,!1)},t.prototype.isSelectOnClick=function(){return this.acroField.hasFlag(mx.CommitOnSelChange)},t.prototype.enableSelectOnClick=function(){this.acroField.setFlagTo(mx.CommitOnSelChange,!0)},t.prototype.disableSelectOnClick=function(){this.acroField.setFlagTo(mx.CommitOnSelChange,!1)},t.prototype.addToPage=function(e,t){K(e,`page`,[[nE,`PDFPage`]]),yT(t),t||={},`textColor`in t||(t.textColor=LC(0,0,0)),`backgroundColor`in t||(t.backgroundColor=LC(1,1,1)),`borderColor`in t||(t.borderColor=LC(0,0,0)),`borderWidth`in t||(t.borderWidth=1);var n=this.createWidget({x:t.x??0,y:t.y??0,width:t.width??200,height:t.height??100,textColor:t.textColor,backgroundColor:t.backgroundColor,borderColor:t.borderColor,borderWidth:t.borderWidth??0,rotate:t.rotate??MS(0),hidden:t.hidden,page:e.ref}),r=this.doc.context.register(n.dict);this.acroField.addWidget(r);var i=t.font??this.doc.getForm().getDefaultFont();this.updateWidgetAppearance(n,i),e.node.addAnnot(r)},t.prototype.needsAppearancesUpdate=function(){if(this.isDirty())return!0;for(var e=this.acroField.getWidgets(),t=0,n=e.length;t<n;t++)if(!(e[t].getAppearances()?.normal instanceof zv))return!0;return!1},t.prototype.defaultUpdateAppearances=function(e){K(e,`font`,[[fT,`PDFFont`]]),this.updateAppearances(e)},t.prototype.updateAppearances=function(e,t){K(e,`font`,[[fT,`PDFFont`]]),q(t,`provider`,[Function]);for(var n=this.acroField.getWidgets(),r=0,i=n.length;r<i;r++){var a=n[r];this.updateWidgetAppearance(a,e,t)}this.markAsClean()},t.prototype.updateWidgetAppearance=function(e,t,n){var r=Zw((n??cT)(this,e,t));this.updateWidgetAppearanceWithFont(e,t,r)},t.of=function(e,n,r){return new t(e,n,r)},t}(bT)})),OT,kT=s((()=>{G(),rE(),xT(),lT(),KC(),HS(),ES(),F_(),OT=function(e){W(t,e);function t(t,n,r){var i=e.call(this,t,n,r)||this;return K(t,`acroRadioButton`,[[Ox,`PDFAcroRadioButton`]]),i.acroField=t,i}return t.prototype.getOptions=function(){var e=this.acroField.getExportValues();if(e){for(var t=Array(e.length),n=0,r=e.length;n<r;n++)t[n]=e[n].decodeText();return t}for(var i=this.acroField.getOnValues(),a=Array(i.length),n=0,r=a.length;n<r;n++)a[n]=i[n].decodeText();return a},t.prototype.getSelected=function(){var e=this.acroField.getValue();if(e!==X.of(`Off`)){var t=this.acroField.getExportValues();if(t){for(var n=this.acroField.getOnValues(),r=0,i=n.length;r<i;r++)if(n[r]===e)return t[r].decodeText()}return e.decodeText()}},t.prototype.select=function(e){K(e,`option`,[`string`]);var t=this.getOptions();g_(e,`option`,t),this.markAsDirty();var n=this.acroField.getOnValues(),r=this.acroField.getExportValues();if(r)for(var i=0,a=r.length;i<a;i++)r[i].decodeText()===e&&this.acroField.setValue(n[i]);else for(var i=0,a=n.length;i<a;i++){var o=n[i];o.decodeText()===e&&this.acroField.setValue(o)}},t.prototype.clear=function(){this.markAsDirty(),this.acroField.setValue(X.of(`Off`))},t.prototype.isOffToggleable=function(){return!this.acroField.hasFlag(fx.NoToggleToOff)},t.prototype.enableOffToggling=function(){this.acroField.setFlagTo(fx.NoToggleToOff,!1)},t.prototype.disableOffToggling=function(){this.acroField.setFlagTo(fx.NoToggleToOff,!0)},t.prototype.isMutuallyExclusive=function(){return!this.acroField.hasFlag(fx.RadiosInUnison)},t.prototype.enableMutualExclusion=function(){this.acroField.setFlagTo(fx.RadiosInUnison,!1)},t.prototype.disableMutualExclusion=function(){this.acroField.setFlagTo(fx.RadiosInUnison,!0)},t.prototype.addOptionToPage=function(e,t,n){K(e,`option`,[`string`]),K(t,`page`,[[nE,`PDFPage`]]),yT(n);var r=this.createWidget({x:n?.x??0,y:n?.y??0,width:n?.width??50,height:n?.height??50,textColor:n?.textColor??LC(0,0,0),backgroundColor:n?.backgroundColor??LC(1,1,1),borderColor:n?.borderColor??LC(0,0,0),borderWidth:n?.borderWidth??1,rotate:n?.rotate??MS(0),hidden:n?.hidden,page:t.ref}),i=this.doc.context.register(r.dict),a=this.acroField.addWidgetWithOpt(i,Ay.fromText(e),!this.isMutuallyExclusive());r.setAppearanceState(X.of(`Off`)),this.updateWidgetAppearance(r,a),t.node.addAnnot(i)},t.prototype.needsAppearancesUpdate=function(){for(var e=this.acroField.getWidgets(),t=0,n=e.length;t<n;t++){var r=e[t],i=r.getAppearanceState(),a=r.getAppearances()?.normal;if(!(a instanceof Z)||i&&!a.has(i))return!0}return!1},t.prototype.defaultUpdateAppearances=function(){this.updateAppearances()},t.prototype.updateAppearances=function(e){q(e,`provider`,[Function]);for(var t=this.acroField.getWidgets(),n=0,r=t.length;n<r;n++){var i=t[n],a=i.getOnValue();a&&this.updateWidgetAppearance(i,a,e)}},t.prototype.updateWidgetAppearance=function(e,t,n){var r=Zw((n??iT)(this,e));this.updateOnOffWidgetAppearance(e,t,r)},t.of=function(e,n,r){return new t(e,n,r)},t}(bT)})),AT,jT=s((()=>{G(),xT(),ES(),F_(),AT=function(e){W(t,e);function t(t,n,r){var i=e.call(this,t,n,r)||this;return K(t,`acroSignature`,[[Sx,`PDFAcroSignature`]]),i.acroField=t,i}return t.prototype.needsAppearancesUpdate=function(){return!1},t.of=function(e,n,r){return new t(e,n,r)},t}(bT)})),MT,NT=s((()=>{G(),rE(),pT(),xT(),lT(),KC(),HS(),Rw(),_T(),Bw(),ES(),F_(),MT=function(e){W(t,e);function t(t,n,r){var i=e.call(this,t,n,r)||this;return K(t,`acroText`,[[wx,`PDFAcroText`]]),i.acroField=t,i}return t.prototype.getText=function(){var e=this.acroField.getValue();if(!e&&this.isRichFormatted())throw new Pw(this.getName());return e?.decodeText()},t.prototype.setText=function(e){q(e,`text`,[`string`]);var t=this.getMaxLength();if(t!==void 0&&e&&e.length>t)throw new Iw(e.length,t,this.getName());this.markAsDirty(),this.disableRichFormatting(),e?this.acroField.setValue(Ay.fromText(e)):this.acroField.removeValue()},t.prototype.getAlignment=function(){var e=this.acroField.getQuadding();return e===0?zw.Left:e===1?zw.Center:e===2?zw.Right:zw.Left},t.prototype.setAlignment=function(e){g_(e,`alignment`,zw),this.markAsDirty(),this.acroField.setQuadding(e)},t.prototype.getMaxLength=function(){return this.acroField.getMaxLength()},t.prototype.setMaxLength=function(e){if(w_(e,`maxLength`,0,2**53-1),this.markAsDirty(),e===void 0)this.acroField.removeMaxLength();else{var t=this.getText();if(t&&t.length>e)throw new Lw(t.length,e,this.getName());this.acroField.setMaxLength(e)}},t.prototype.removeMaxLength=function(){this.markAsDirty(),this.acroField.removeMaxLength()},t.prototype.setImage=function(e){for(var t=this.getAlignment(),n=t===zw.Center?gT.Center:t===zw.Right?gT.Right:gT.Left,r=this.acroField.getWidgets(),i=0,a=r.length;i<a;i++){var o=r[i],s=this.createImageAppearanceStream(o,e,n);this.updateWidgetAppearances(o,{normal:s})}this.markAsClean()},t.prototype.setFontSize=function(e){D_(e,`fontSize`),this.acroField.setFontSize(e),this.markAsDirty()},t.prototype.isMultiline=function(){return this.acroField.hasFlag(px.Multiline)},t.prototype.enableMultiline=function(){this.markAsDirty(),this.acroField.setFlagTo(px.Multiline,!0)},t.prototype.disableMultiline=function(){this.markAsDirty(),this.acroField.setFlagTo(px.Multiline,!1)},t.prototype.isPassword=function(){return this.acroField.hasFlag(px.Password)},t.prototype.enablePassword=function(){this.acroField.setFlagTo(px.Password,!0)},t.prototype.disablePassword=function(){this.acroField.setFlagTo(px.Password,!1)},t.prototype.isFileSelector=function(){return this.acroField.hasFlag(px.FileSelect)},t.prototype.enableFileSelection=function(){this.acroField.setFlagTo(px.FileSelect,!0)},t.prototype.disableFileSelection=function(){this.acroField.setFlagTo(px.FileSelect,!1)},t.prototype.isSpellChecked=function(){return!this.acroField.hasFlag(px.DoNotSpellCheck)},t.prototype.enableSpellChecking=function(){this.acroField.setFlagTo(px.DoNotSpellCheck,!1)},t.prototype.disableSpellChecking=function(){this.acroField.setFlagTo(px.DoNotSpellCheck,!0)},t.prototype.isScrollable=function(){return!this.acroField.hasFlag(px.DoNotScroll)},t.prototype.enableScrolling=function(){this.acroField.setFlagTo(px.DoNotScroll,!1)},t.prototype.disableScrolling=function(){this.acroField.setFlagTo(px.DoNotScroll,!0)},t.prototype.isCombed=function(){return this.acroField.hasFlag(px.Comb)&&!this.isMultiline()&&!this.isPassword()&&!this.isFileSelector()&&this.getMaxLength()!==void 0},t.prototype.enableCombing=function(){this.getMaxLength()===void 0&&console.warn(`PDFTextFields must have a max length in order to be combed`),this.markAsDirty(),this.disableMultiline(),this.disablePassword(),this.disableFileSelection(),this.acroField.setFlagTo(px.Comb,!0)},t.prototype.disableCombing=function(){this.markAsDirty(),this.acroField.setFlagTo(px.Comb,!1)},t.prototype.isRichFormatted=function(){return this.acroField.hasFlag(px.RichText)},t.prototype.enableRichFormatting=function(){this.acroField.setFlagTo(px.RichText,!0)},t.prototype.disableRichFormatting=function(){this.acroField.setFlagTo(px.RichText,!1)},t.prototype.addToPage=function(e,t){K(e,`page`,[[nE,`PDFPage`]]),yT(t),t||={},`textColor`in t||(t.textColor=LC(0,0,0)),`backgroundColor`in t||(t.backgroundColor=LC(1,1,1)),`borderColor`in t||(t.borderColor=LC(0,0,0)),`borderWidth`in t||(t.borderWidth=1);var n=this.createWidget({x:t.x??0,y:t.y??0,width:t.width??200,height:t.height??50,textColor:t.textColor,backgroundColor:t.backgroundColor,borderColor:t.borderColor,borderWidth:t.borderWidth??0,rotate:t.rotate??MS(0),hidden:t.hidden,page:e.ref}),r=this.doc.context.register(n.dict);this.acroField.addWidget(r);var i=t.font??this.doc.getForm().getDefaultFont();this.updateWidgetAppearance(n,i),e.node.addAnnot(r)},t.prototype.needsAppearancesUpdate=function(){if(this.isDirty())return!0;for(var e=this.acroField.getWidgets(),t=0,n=e.length;t<n;t++)if(!(e[t].getAppearances()?.normal instanceof zv))return!0;return!1},t.prototype.defaultUpdateAppearances=function(e){K(e,`font`,[[fT,`PDFFont`]]),this.updateAppearances(e)},t.prototype.updateAppearances=function(e,t){K(e,`font`,[[fT,`PDFFont`]]),q(t,`provider`,[Function]);for(var n=this.acroField.getWidgets(),r=0,i=n.length;r<i;r++){var a=n[r];this.updateWidgetAppearance(a,e,t)}this.markAsClean()},t.prototype.updateWidgetAppearance=function(e,t,n){var r=Zw((n??oT)(this,e,t));this.updateWidgetAppearanceWithFont(e,t,r)},t.of=function(e,n,r){return new t(e,n,r)},t}(bT)})),PT,FT=s((()=>{(function(e){e.Courier=`Courier`,e.CourierBold=`Courier-Bold`,e.CourierOblique=`Courier-Oblique`,e.CourierBoldOblique=`Courier-BoldOblique`,e.Helvetica=`Helvetica`,e.HelveticaBold=`Helvetica-Bold`,e.HelveticaOblique=`Helvetica-Oblique`,e.HelveticaBoldOblique=`Helvetica-BoldOblique`,e.TimesRoman=`Times-Roman`,e.TimesRomanBold=`Times-Bold`,e.TimesRomanItalic=`Times-Italic`,e.TimesRomanBoldItalic=`Times-BoldItalic`,e.Symbol=`Symbol`,e.ZapfDingbats=`ZapfDingbats`})(PT||={})})),IT,LT,RT,zT,BT=s((()=>{G(),$T(),aE(),CT(),TT(),DT(),kT(),jT(),NT(),Rw(),pT(),FT(),Tw(),PC(),ES(),F_(),IT=function(){function e(e,t){var n=this;this.embedDefaultFont=function(){return n.doc.embedStandardFont(PT.Helvetica)},K(e,`acroForm`,[[Hx,`PDFAcroForm`]]),K(t,`doc`,[[QT,`PDFDocument`]]),this.acroForm=e,this.doc=t,this.dirtyFields=new Set,this.defaultFontCache=N_.populatedBy(this.embedDefaultFont)}return e.prototype.hasXFA=function(){return this.acroForm.dict.has(X.of(`XFA`))},e.prototype.deleteXFA=function(){this.acroForm.dict.delete(X.of(`XFA`))},e.prototype.getFields=function(){for(var e=this.acroForm.getAllFields(),t=[],n=0,r=e.length;n<r;n++){var i=e[n],a=i[0],o=i[1],s=LT(a,o,this.doc);s&&t.push(s)}return t},e.prototype.getFieldMaybe=function(e){K(e,`name`,[`string`]);for(var t=this.getFields(),n=0,r=t.length;n<r;n++){var i=t[n];if(i.getName()===e)return i}},e.prototype.getField=function(e){K(e,`name`,[`string`]);var t=this.getFieldMaybe(e);if(t)return t;throw new Aw(e)},e.prototype.getButton=function(e){K(e,`name`,[`string`]);var t=this.getField(e);if(t instanceof iE)return t;throw new jw(e,iE,t)},e.prototype.getCheckBox=function(e){K(e,`name`,[`string`]);var t=this.getField(e);if(t instanceof ST)return t;throw new jw(e,ST,t)},e.prototype.getDropdown=function(e){K(e,`name`,[`string`]);var t=this.getField(e);if(t instanceof wT)return t;throw new jw(e,wT,t)},e.prototype.getOptionList=function(e){K(e,`name`,[`string`]);var t=this.getField(e);if(t instanceof ET)return t;throw new jw(e,ET,t)},e.prototype.getRadioGroup=function(e){K(e,`name`,[`string`]);var t=this.getField(e);if(t instanceof OT)return t;throw new jw(e,OT,t)},e.prototype.getSignature=function(e){K(e,`name`,[`string`]);var t=this.getField(e);if(t instanceof AT)return t;throw new jw(e,AT,t)},e.prototype.getTextField=function(e){K(e,`name`,[`string`]);var t=this.getField(e);if(t instanceof MT)return t;throw new jw(e,MT,t)},e.prototype.createButton=function(e){K(e,`name`,[`string`]);var t=RT(e),n=this.findOrCreateNonTerminals(t.nonTerminal),r=Ex.create(this.doc.context);return r.setPartialName(t.terminal),zT(n,[r,r.ref],t.terminal),iE.of(r,r.ref,this.doc)},e.prototype.createCheckBox=function(e){K(e,`name`,[`string`]);var t=RT(e),n=this.findOrCreateNonTerminals(t.nonTerminal),r=cx.create(this.doc.context);return r.setPartialName(t.terminal),zT(n,[r,r.ref],t.terminal),ST.of(r,r.ref,this.doc)},e.prototype.createDropdown=function(e){K(e,`name`,[`string`]);var t=RT(e),n=this.findOrCreateNonTerminals(t.nonTerminal),r=vx.create(this.doc.context);return r.setPartialName(t.terminal),zT(n,[r,r.ref],t.terminal),wT.of(r,r.ref,this.doc)},e.prototype.createOptionList=function(e){K(e,`name`,[`string`]);var t=RT(e),n=this.findOrCreateNonTerminals(t.nonTerminal),r=Ax.create(this.doc.context);return r.setPartialName(t.terminal),zT(n,[r,r.ref],t.terminal),ET.of(r,r.ref,this.doc)},e.prototype.createRadioGroup=function(e){K(e,`name`,[`string`]);var t=RT(e),n=this.findOrCreateNonTerminals(t.nonTerminal),r=Ox.create(this.doc.context);return r.setPartialName(t.terminal),zT(n,[r,r.ref],t.terminal),OT.of(r,r.ref,this.doc)},e.prototype.createTextField=function(e){K(e,`name`,[`string`]);var t=RT(e),n=this.findOrCreateNonTerminals(t.nonTerminal),r=wx.create(this.doc.context);return r.setPartialName(t.terminal),zT(n,[r,r.ref],t.terminal),MT.of(r,r.ref,this.doc)},e.prototype.flatten=function(e){e===void 0&&(e={updateFieldAppearances:!0}),e.updateFieldAppearances&&this.updateFieldAppearances();for(var t=this.getFields(),n=0,r=t.length;n<r;n++){for(var i=t[n],a=i.acroField.getWidgets(),o=0,s=a.length;o<s;o++){var c=a[o],l=this.findWidgetPage(c),u=this.findWidgetAppearanceRef(i,c),d=l.node.newXObject(`FlatWidget`,u),f=c.getRectangle(),p=Mm([iC(),JS(f.x,f.y)],vw(Pm(Pm({},f),{rotation:0})),[TC(d),aC()]).filter(Boolean);l.pushOperators.apply(l,p)}this.removeField(i)}},e.prototype.removeField=function(e){for(var t=e.acroField.getWidgets(),n=new Set,r=0,i=t.length;r<i;r++){var a=t[r],o=this.findWidgetAppearanceRef(e,a),s=this.findWidgetPage(a);n.add(s),s.node.removeAnnot(o)}n.forEach(function(t){return t.node.removeAnnot(e.ref)}),this.acroForm.removeField(e.acroField);for(var c=e.acroField.normalizedEntries().Kids,l=c.size(),u=0;u<l;u++){var d=c.get(u);d instanceof Gv&&this.doc.context.delete(d)}this.doc.context.delete(e.ref)},e.prototype.updateFieldAppearances=function(e){q(e,`font`,[[fT,`PDFFont`]]),e??=this.getDefaultFont();for(var t=this.getFields(),n=0,r=t.length;n<r;n++){var i=t[n];i.needsAppearancesUpdate()&&i.defaultUpdateAppearances(e)}},e.prototype.markFieldAsDirty=function(e){q(e,`fieldRef`,[[Gv,`PDFRef`]]),this.dirtyFields.add(e)},e.prototype.markFieldAsClean=function(e){q(e,`fieldRef`,[[Gv,`PDFRef`]]),this.dirtyFields.delete(e)},e.prototype.fieldIsDirty=function(e){return q(e,`fieldRef`,[[Gv,`PDFRef`]]),this.dirtyFields.has(e)},e.prototype.getDefaultFont=function(){return this.defaultFontCache.access()},e.prototype.findWidgetPage=function(e){var t=e.P(),n=this.doc.getPages().find(function(e){return e.ref===t});if(n===void 0){var r=this.doc.context.getObjectRef(e.dict);if(r===void 0)throw Error(`Could not find PDFRef for PDFObject`);if(n=this.doc.findPageForAnnotationRef(r),n===void 0)throw Error(`Could not find page for PDFRef `+r)}return n},e.prototype.findWidgetAppearanceRef=function(e,t){var n=t.getNormalAppearance();if(n instanceof Z&&(e instanceof ST||e instanceof OT)){var r=e.acroField.getValue(),i=n.get(r)??n.get(X.of(`Off`));i instanceof Gv&&(n=i)}if(!(n instanceof Gv)){var a=e.getName();throw Error(`Failed to extract appearance ref for: `+a)}return n},e.prototype.findOrCreateNonTerminals=function(e){for(var t=[this.acroForm],n=0,r=e.length;n<r;n++){var i=e[n];if(!i)throw new Nw(i);var a=t[0],o=t[1],s=this.findNonTerminal(i,a);if(s)t=s;else{var c=bx.create(this.doc.context);c.setPartialName(i),c.setParent(o);var l=this.doc.context.register(c.dict);a.addField(l),t=[c,l]}}return t},e.prototype.findNonTerminal=function(e,t){for(var n=t instanceof Hx?this.acroForm.getFields():Mx(t.Kids()),r=0,i=n.length;r<i;r++){var a=n[r],o=a[0],s=a[1];if(o.getPartialName()===e){if(o instanceof bx)return[o,s];throw new Mw(e)}}},e.of=function(t,n){return new e(t,n)},e}(),LT=function(e,t,n){if(e instanceof Ex)return iE.of(e,t,n);if(e instanceof cx)return ST.of(e,t,n);if(e instanceof vx)return wT.of(e,t,n);if(e instanceof Ax)return ET.of(e,t,n);if(e instanceof wx)return MT.of(e,t,n);if(e instanceof Ox)return OT.of(e,t,n);if(e instanceof Sx)return AT.of(e,t,n)},RT=function(e){if(e.length===0)throw Error(`PDF field names must not be empty strings`);for(var t=e.split(`.`),n=0,r=t.length;n<r;n++)if(t[n]===``)throw Error(`Periods in PDF field names must be separated by at least one character: "`+e+`"`);return t.length===1?{nonTerminal:[],terminal:t[0]}:{nonTerminal:t.slice(0,t.length-1),terminal:t[t.length-1]}},zT=function(e,t,n){for(var r=e[0],i=e[1],a=t[0],o=t[1],s=r.normalizedEntries(),c=Mx(`Kids`in s?s.Kids:s.Fields),l=0,u=c.length;l<u;l++)if(c[l][0].getPartialName()===n)throw new Mw(n);r.addField(o),a.setParent(i)}})),VT,HT=s((()=>{VT={"4A0":[4767.87,6740.79],"2A0":[3370.39,4767.87],A0:[2383.94,3370.39],A1:[1683.78,2383.94],A2:[1190.55,1683.78],A3:[841.89,1190.55],A4:[595.28,841.89],A5:[419.53,595.28],A6:[297.64,419.53],A7:[209.76,297.64],A8:[147.4,209.76],A9:[104.88,147.4],A10:[73.7,104.88],B0:[2834.65,4008.19],B1:[2004.09,2834.65],B2:[1417.32,2004.09],B3:[1000.63,1417.32],B4:[708.66,1000.63],B5:[498.9,708.66],B6:[354.33,498.9],B7:[249.45,354.33],B8:[175.75,249.45],B9:[124.72,175.75],B10:[87.87,124.72],C0:[2599.37,3676.54],C1:[1836.85,2599.37],C2:[1298.27,1836.85],C3:[918.43,1298.27],C4:[649.13,918.43],C5:[459.21,649.13],C6:[323.15,459.21],C7:[229.61,323.15],C8:[161.57,229.61],C9:[113.39,161.57],C10:[79.37,113.39],RA0:[2437.8,3458.27],RA1:[1729.13,2437.8],RA2:[1218.9,1729.13],RA3:[864.57,1218.9],RA4:[609.45,864.57],SRA0:[2551.18,3628.35],SRA1:[1814.17,2551.18],SRA2:[1275.59,1814.17],SRA3:[907.09,1275.59],SRA4:[637.8,907.09],Executive:[521.86,756],Folio:[612,936],Legal:[612,1008],Letter:[612,792],Tabloid:[792,1224]}})),UT,WT=s((()=>{(function(e){e[e.Fastest=1/0]=`Fastest`,e[e.Fast=1500]=`Fast`,e[e.Medium=500]=`Medium`,e[e.Slow=100]=`Slow`})(UT||={})})),GT,KT=s((()=>{G(),ES(),GT=function(){function e(e,t,n){this.alreadyEmbedded=!1,this.ref=e,this.doc=t,this.embedder=n}return e.prototype.embed=function(){return Am(this,void 0,void 0,function(){var e,t,n,r,i;return jm(this,function(a){switch(a.label){case 0:return this.alreadyEmbedded?[3,2]:[4,this.embedder.embedIntoContext(this.doc.context,this.ref)];case 1:e=a.sent(),this.doc.catalog.has(X.of(`Names`))||this.doc.catalog.set(X.of(`Names`),this.doc.context.obj({})),t=this.doc.catalog.lookup(X.of(`Names`),Z),t.has(X.of(`EmbeddedFiles`))||t.set(X.of(`EmbeddedFiles`),this.doc.context.obj({})),n=t.lookup(X.of(`EmbeddedFiles`),Z),n.has(X.of(`Names`))||n.set(X.of(`Names`),this.doc.context.obj([])),r=n.lookup(X.of(`Names`),Y),r.push(Ay.fromText(this.embedder.fileName)),r.push(e),this.doc.catalog.has(X.of(`AF`))||this.doc.catalog.set(X.of(`AF`),this.doc.context.obj([])),i=this.doc.catalog.lookup(X.of(`AF`),Y),i.push(e),this.alreadyEmbedded=!0,a.label=2;case 2:return[2]}})})},e.of=function(t,n,r){return new e(t,n,r)},e}()})),qT,JT=s((()=>{G(),ES(),qT=function(){function e(e,t,n){this.alreadyEmbedded=!1,this.ref=e,this.doc=t,this.embedder=n}return e.prototype.embed=function(){return Am(this,void 0,void 0,function(){var e,t,n,r,i,a,o;return jm(this,function(s){switch(s.label){case 0:return this.alreadyEmbedded?[3,2]:(e=this.doc,t=e.catalog,n=e.context,[4,this.embedder.embedIntoContext(this.doc.context,this.ref)]);case 1:r=s.sent(),t.has(X.of(`Names`))||t.set(X.of(`Names`),n.obj({})),i=t.lookup(X.of(`Names`),Z),i.has(X.of(`JavaScript`))||i.set(X.of(`JavaScript`),n.obj({})),a=i.lookup(X.of(`JavaScript`),Z),a.has(X.of(`Names`))||a.set(X.of(`Names`),n.obj([])),o=a.lookup(X.of(`Names`),Y),o.push(Ay.fromText(this.embedder.scriptName)),o.push(r),this.alreadyEmbedded=!0,s.label=2;case 2:return[2]}})})},e.of=function(t,n,r){return new e(t,n,r)},e}()})),YT,XT=s((()=>{G(),jy(),YT=function(){function e(e,t){this.script=e,this.scriptName=t}return e.for=function(t,n){return new e(t,n)},e.prototype.embedIntoContext=function(e,t){return Am(this,void 0,void 0,function(){var n;return jm(this,function(r){return n=e.obj({Type:`Action`,S:`JavaScript`,JS:Ay.fromText(this.script)}),t?(e.assign(t,n),[2,t]):[2,e.register(n)]})})},e}()}));function ZT(e){if(!(e instanceof Ay)&&!(e instanceof Uy))throw new R_([Ay,Uy],e)}var QT,$T=s((()=>{G(),Rw(),dT(),pT(),hT(),rE(),BT(),HT(),ES(),WT(),F_(),Zy(),KT(),JT(),XT(),QT=function(){function e(e,t,n){var r=this;if(this.defaultWordBreaks=[` `],this.computePages=function(){var e=[];return r.catalog.Pages().traverse(function(t,n){if(t instanceof ly){var i=r.pageMap.get(t);i||(i=nE.of(t,n,r),r.pageMap.set(t,i)),e.push(i)}}),e},this.getOrCreateForm=function(){var e=r.catalog.getOrCreateAcroForm();return IT.of(e,r)},K(e,`context`,[[sy,`PDFContext`]]),K(t,`ignoreEncryption`,[`boolean`]),this.context=e,this.catalog=e.lookup(e.trailerInfo.Root),this.isEncrypted=!!e.lookup(e.trailerInfo.Encrypt),this.pageCache=N_.populatedBy(this.computePages),this.pageMap=new Map,this.formCache=N_.populatedBy(this.getOrCreateForm),this.fonts=[],this.images=[],this.embeddedPages=[],this.embeddedFiles=[],this.javaScripts=[],!t&&this.isEncrypted)throw new Ew;n&&this.updateInfoDict()}return e.load=function(t,n){return n===void 0&&(n={}),Am(this,void 0,void 0,function(){var r,i,a,o,s,c,l,u,d,f,p,m;return jm(this,function(h){switch(h.label){case 0:return r=n.ignoreEncryption,i=r!==void 0&&r,a=n.parseSpeed,o=a===void 0?UT.Slow:a,s=n.throwOnInvalidObject,c=s!==void 0&&s,l=n.updateMetadata,u=l===void 0||l,d=n.capNumbers,f=d!==void 0&&d,K(t,`pdf`,[`string`,Uint8Array,ArrayBuffer]),K(i,`ignoreEncryption`,[`boolean`]),K(o,`parseSpeed`,[`number`]),K(c,`throwOnInvalidObject`,[`boolean`]),p=Ch(t),[4,bS.forBytesWithOptions(p,o,c,f).parseDocument()];case 1:return m=h.sent(),[2,new e(m,i,u)]}})})},e.create=function(t){return t===void 0&&(t={}),Am(this,void 0,void 0,function(){var n,r,i,a,o,s;return jm(this,function(c){return n=t.updateMetadata,r=n===void 0||n,i=sy.create(),a=qx.withContext(i),o=i.register(a),s=Gx.withContextAndPages(i,o),i.trailerInfo.Root=i.register(s),[2,new e(i,!1,r)]})})},e.prototype.registerFontkit=function(e){this.fontkit=e},e.prototype.getForm=function(){var e=this.formCache.access();return e.hasXFA()&&(console.warn(`Removing XFA form data as pdf-lib does not support reading or writing XFA`),e.deleteXFA()),e},e.prototype.getTitle=function(){var e=this.getInfoDict().lookup(X.Title);if(e)return ZT(e),e.decodeText()},e.prototype.getAuthor=function(){var e=this.getInfoDict().lookup(X.Author);if(e)return ZT(e),e.decodeText()},e.prototype.getSubject=function(){var e=this.getInfoDict().lookup(X.Subject);if(e)return ZT(e),e.decodeText()},e.prototype.getKeywords=function(){var e=this.getInfoDict().lookup(X.Keywords);if(e)return ZT(e),e.decodeText()},e.prototype.getCreator=function(){var e=this.getInfoDict().lookup(X.Creator);if(e)return ZT(e),e.decodeText()},e.prototype.getProducer=function(){var e=this.getInfoDict().lookup(X.Producer);if(e)return ZT(e),e.decodeText()},e.prototype.getCreationDate=function(){var e=this.getInfoDict().lookup(X.CreationDate);if(e)return ZT(e),e.decodeDate()},e.prototype.getModificationDate=function(){var e=this.getInfoDict().lookup(X.ModDate);if(e)return ZT(e),e.decodeDate()},e.prototype.setTitle=function(e,t){K(e,`title`,[`string`]);var n=X.of(`Title`);this.getInfoDict().set(n,Ay.fromText(e)),t?.showInWindowTitleBar&&this.catalog.getOrCreateViewerPreferences().setDisplayDocTitle(!0)},e.prototype.setAuthor=function(e){K(e,`author`,[`string`]);var t=X.of(`Author`);this.getInfoDict().set(t,Ay.fromText(e))},e.prototype.setSubject=function(e){K(e,`author`,[`string`]);var t=X.of(`Subject`);this.getInfoDict().set(t,Ay.fromText(e))},e.prototype.setKeywords=function(e){K(e,`keywords`,[Array]);var t=X.of(`Keywords`);this.getInfoDict().set(t,Ay.fromText(e.join(` `)))},e.prototype.setCreator=function(e){K(e,`creator`,[`string`]);var t=X.of(`Creator`);this.getInfoDict().set(t,Ay.fromText(e))},e.prototype.setProducer=function(e){K(e,`creator`,[`string`]);var t=X.of(`Producer`);this.getInfoDict().set(t,Ay.fromText(e))},e.prototype.setLanguage=function(e){K(e,`language`,[`string`]);var t=X.of(`Lang`);this.catalog.set(t,Uy.of(e))},e.prototype.setCreationDate=function(e){K(e,`creationDate`,[[Date,`Date`]]);var t=X.of(`CreationDate`);this.getInfoDict().set(t,Uy.fromDate(e))},e.prototype.setModificationDate=function(e){K(e,`modificationDate`,[[Date,`Date`]]);var t=X.of(`ModDate`);this.getInfoDict().set(t,Uy.fromDate(e))},e.prototype.getPageCount=function(){return this.pageCount===void 0&&(this.pageCount=this.getPages().length),this.pageCount},e.prototype.getPages=function(){return this.pageCache.access()},e.prototype.getPage=function(e){var t=this.getPages();return C_(e,`index`,0,t.length-1),t[e]},e.prototype.getPageIndices=function(){return bh(0,this.getPageCount())},e.prototype.removePage=function(e){var t=this.getPageCount();if(this.pageCount===0)throw new kw;C_(e,`index`,0,t-1),this.catalog.removeLeafNode(e),this.pageCount=t-1},e.prototype.addPage=function(e){return K(e,`page`,[`undefined`,[nE,`PDFPage`],Array]),this.insertPage(this.getPageCount(),e)},e.prototype.insertPage=function(e,t){var n=this.getPageCount();if(C_(e,`index`,0,n),K(t,`page`,[`undefined`,[nE,`PDFPage`],Array]),!t||Array.isArray(t)){var r=Array.isArray(t)?t:VT.A4;t=nE.create(this),t.setSize.apply(t,r)}else if(t.doc!==this)throw new Ow;var i=this.catalog.insertLeafNode(t.ref,e);return t.node.setParent(i),this.pageMap.set(t.node,t),this.pageCache.invalidate(),this.pageCount=n+1,t},e.prototype.copyPages=function(t,n){return Am(this,void 0,void 0,function(){var r,i,a,o,s,c,l,u;return jm(this,function(d){switch(d.label){case 0:return K(t,`srcDoc`,[[e,`PDFDocument`]]),K(n,`indices`,[Array]),[4,t.flush()];case 1:for(d.sent(),r=dy.for(t.context,this.context),i=t.getPages(),a=Array(n.length),o=0,s=n.length;o<s;o++)c=i[n[o]],l=r.copy(c.node),u=this.context.register(l),a[o]=nE.of(l,u,this);return[2,a]}})})},e.prototype.copy=function(){return Am(this,void 0,void 0,function(){var t,n,r,i;return jm(this,function(a){switch(a.label){case 0:return[4,e.create()];case 1:return t=a.sent(),[4,t.copyPages(this,this.getPageIndices())];case 2:for(n=a.sent(),r=0,i=n.length;r<i;r++)t.addPage(n[r]);return this.getAuthor()!==void 0&&t.setAuthor(this.getAuthor()),this.getCreationDate()!==void 0&&t.setCreationDate(this.getCreationDate()),this.getCreator()!==void 0&&t.setCreator(this.getCreator()),this.getModificationDate()!==void 0&&t.setModificationDate(this.getModificationDate()),this.getProducer()!==void 0&&t.setProducer(this.getProducer()),this.getSubject()!==void 0&&t.setSubject(this.getSubject()),this.getTitle()!==void 0&&t.setTitle(this.getTitle()),t.defaultWordBreaks=this.defaultWordBreaks,[2,t]}})})},e.prototype.addJavaScript=function(e,t){K(e,`name`,[`string`]),K(t,`script`,[`string`]);var n=YT.for(t,e),r=this.context.nextRef(),i=qT.of(r,this,n);this.javaScripts.push(i)},e.prototype.attach=function(e,t,n){return n===void 0&&(n={}),Am(this,void 0,void 0,function(){var r,i,a,o;return jm(this,function(s){return K(e,`attachment`,[`string`,Uint8Array,ArrayBuffer]),K(t,`name`,[`string`]),q(n.mimeType,`mimeType`,[`string`]),q(n.description,`description`,[`string`]),q(n.creationDate,`options.creationDate`,[Date]),q(n.modificationDate,`options.modificationDate`,[Date]),__(n.afRelationship,`options.afRelationship`,Yy),r=Ch(e),i=Xy.for(r,t,n),a=this.context.nextRef(),o=GT.of(a,this,i),this.embeddedFiles.push(o),[2]})})},e.prototype.embedFont=function(e,t){return t===void 0&&(t={}),Am(this,void 0,void 0,function(){var n,r,i,a,o,s,c,l,u,d;return jm(this,function(f){switch(f.label){case 0:return n=t.subset,r=n!==void 0&&n,i=t.customName,a=t.features,K(e,`font`,[`string`,Uint8Array,ArrayBuffer]),K(r,`subset`,[`boolean`]),l_(e)?(o=My.for(e,i),[3,7]):[3,1];case 1:return Sh(e)?(s=Ch(e),c=this.assertFontkit(),r?[4,qy.for(c,s,i,a)]:[3,3]):[3,6];case 2:return l=f.sent(),[3,5];case 3:return[4,Gy.for(c,s,i,a)];case 4:l=f.sent(),f.label=5;case 5:return o=l,[3,7];case 6:throw TypeError("`font` must be one of `StandardFonts | string | Uint8Array | ArrayBuffer`");case 7:return u=this.context.nextRef(),d=fT.of(u,this,o),this.fonts.push(d),[2,d]}})})},e.prototype.embedStandardFont=function(e,t){if(K(e,`font`,[`string`]),!l_(e))throw TypeError("`font` must be one of type `StandardFonts`");var n=My.for(e,t),r=this.context.nextRef(),i=fT.of(r,this,n);return this.fonts.push(i),i},e.prototype.embedJpg=function(e){return Am(this,void 0,void 0,function(){var t,n,r,i;return jm(this,function(a){switch(a.label){case 0:return K(e,`jpg`,[`string`,Uint8Array,ArrayBuffer]),t=Ch(e),[4,tb.for(t)];case 1:return n=a.sent(),r=this.context.nextRef(),i=mT.of(r,this,n),this.images.push(i),[2,i]}})})},e.prototype.embedPng=function(e){return Am(this,void 0,void 0,function(){var t,n,r,i;return jm(this,function(a){switch(a.label){case 0:return K(e,`png`,[`string`,Uint8Array,ArrayBuffer]),t=Ch(e),[4,ub.for(t)];case 1:return n=a.sent(),r=this.context.nextRef(),i=mT.of(r,this,n),this.images.push(i),[2,i]}})})},e.prototype.embedPdf=function(t,n){return n===void 0&&(n=[0]),Am(this,void 0,void 0,function(){var r,i,a;return jm(this,function(o){switch(o.label){case 0:return K(t,`pdf`,[`string`,Uint8Array,ArrayBuffer,[e,`PDFDocument`]]),K(n,`indices`,[Array]),t instanceof e?(i=t,[3,3]):[3,1];case 1:return[4,e.load(t)];case 2:i=o.sent(),o.label=3;case 3:return r=i,a=xh(r.getPages(),n),[2,this.embedPages(a)]}})})},e.prototype.embedPage=function(e,t,n){return Am(this,void 0,void 0,function(){var r;return jm(this,function(i){switch(i.label){case 0:return K(e,`page`,[[nE,`PDFPage`]]),[4,this.embedPages([e],[t],[n])];case 1:return r=i.sent()[0],[2,r]}})})},e.prototype.embedPages=function(e,t,n){return t===void 0&&(t=[]),n===void 0&&(n=[]),Am(this,void 0,void 0,function(){var r,i,a,o,s,c,l,r,i,u,d,f,p,m,h;return jm(this,function(g){switch(g.label){case 0:if(e.length===0)return[2,[]];for(r=0,i=e.length-1;r<i;r++)if(a=e[r],o=e[r+1],a.node.context!==o.node.context)throw new U_;s=e[0].node.context,c=s===this.context?function(e){return e}:dy.for(s,this.context).copy,l=Array(e.length),r=0,i=e.length,g.label=1;case 1:return r<i?(u=c(e[r].node),d=t[r],f=n[r],[4,Rb.for(u,d,f)]):[3,4];case 2:p=g.sent(),m=this.context.nextRef(),l[r]=uT.of(m,this,p),g.label=3;case 3:return r++,[3,1];case 4:return(h=this.embeddedPages).push.apply(h,l),[2,l]}})})},e.prototype.flush=function(){return Am(this,void 0,void 0,function(){return jm(this,function(e){switch(e.label){case 0:return[4,this.embedAll(this.fonts)];case 1:return e.sent(),[4,this.embedAll(this.images)];case 2:return e.sent(),[4,this.embedAll(this.embeddedPages)];case 3:return e.sent(),[4,this.embedAll(this.embeddedFiles)];case 4:return e.sent(),[4,this.embedAll(this.javaScripts)];case 5:return e.sent(),[2]}})})},e.prototype.save=function(e){return e===void 0&&(e={}),Am(this,void 0,void 0,function(){var t,n,r,i,a,o,s,c,l,u;return jm(this,function(d){switch(d.label){case 0:return t=e.useObjectStreams,n=t===void 0||t,r=e.addDefaultPage,i=r===void 0||r,a=e.objectsPerTick,o=a===void 0?50:a,s=e.updateFieldAppearances,c=s===void 0||s,K(n,`useObjectStreams`,[`boolean`]),K(i,`addDefaultPage`,[`boolean`]),K(o,`objectsPerTick`,[`number`]),K(c,`updateFieldAppearances`,[`boolean`]),i&&this.getPageCount()===0&&this.addPage(),c&&(l=this.formCache.getValue(),l&&l.updateFieldAppearances()),[4,this.flush()];case 1:return d.sent(),u=n?Oy:xy,[2,u.forContext(this.context,o).serializeToBuffer()]}})})},e.prototype.saveAsBase64=function(e){return e===void 0&&(e={}),Am(this,void 0,void 0,function(){var t,n,r,i,a;return jm(this,function(o){switch(o.label){case 0:return t=e.dataUri,n=t!==void 0&&t,r=km(e,[`dataUri`]),K(n,`dataUri`,[`boolean`]),[4,this.save(r)];case 1:return i=o.sent(),a=Rm(i),[2,n?`data:application/pdf;base64,`+a:a]}})})},e.prototype.findPageForAnnotationRef=function(e){for(var t=this.getPages(),n=0,r=t.length;n<r;n++){var i=t[n];if(i.node.Annots()?.indexOf(e)!==void 0)return i}},e.prototype.embedAll=function(e){return Am(this,void 0,void 0,function(){var t,n;return jm(this,function(r){switch(r.label){case 0:t=0,n=e.length,r.label=1;case 1:return t<n?[4,e[t].embed()]:[3,4];case 2:r.sent(),r.label=3;case 3:return t++,[3,1];case 4:return[2]}})})},e.prototype.updateInfoDict=function(){var e=`pdf-lib (https://github.com/Hopding/pdf-lib)`,t=new Date,n=this.getInfoDict();this.setProducer(e),this.setModificationDate(t),n.get(X.of(`Creator`))||this.setCreator(e),n.get(X.of(`CreationDate`))||this.setCreationDate(t)},e.prototype.getInfoDict=function(){var e=this.context.lookup(this.context.trailerInfo.Info);if(e instanceof Z)return e;var t=this.context.obj({});return this.context.trailerInfo.Info=this.context.register(t),t},e.prototype.assertFontkit=function(){if(!this.fontkit)throw new Dw;return this.fontkit},e}()})),eE,tE=s((()=>{(function(e){e.Normal=`Normal`,e.Multiply=`Multiply`,e.Screen=`Screen`,e.Overlay=`Overlay`,e.Darken=`Darken`,e.Lighten=`Lighten`,e.ColorDodge=`ColorDodge`,e.ColorBurn=`ColorBurn`,e.HardLight=`HardLight`,e.SoftLight=`SoftLight`,e.Difference=`Difference`,e.Exclusion=`Exclusion`})(eE||={})})),nE,rE=s((()=>{G(),KC(),Tw(),PC(),$T(),dT(),pT(),hT(),tE(),HS(),FT(),ES(),F_(),nE=function(){function e(e,t,n){this.fontSize=24,this.fontColor=LC(0,0,0),this.lineHeight=24,this.x=0,this.y=0,K(e,`leafNode`,[[ly,`PDFPageLeaf`]]),K(t,`ref`,[[Gv,`PDFRef`]]),K(n,`doc`,[[QT,`PDFDocument`]]),this.node=e,this.ref=t,this.doc=n}return e.prototype.setRotation=function(e){var t=RS(e);T_(t,`degreesAngle`,90),this.node.set(X.of(`Rotate`),this.doc.context.obj(t))},e.prototype.getRotation=function(){var e=this.node.Rotate();return MS(e?e.asNumber():0)},e.prototype.setSize=function(e,t){K(e,`width`,[`number`]),K(t,`height`,[`number`]);var n=this.getMediaBox();this.setMediaBox(n.x,n.y,e,t);var r=this.getCropBox(),i=this.getBleedBox(),a=this.getTrimBox(),o=this.getArtBox(),s=this.node.CropBox(),c=this.node.BleedBox(),l=this.node.TrimBox(),u=this.node.ArtBox();s&&u_(r,n)&&this.setCropBox(n.x,n.y,e,t),c&&u_(i,n)&&this.setBleedBox(n.x,n.y,e,t),l&&u_(a,n)&&this.setTrimBox(n.x,n.y,e,t),u&&u_(o,n)&&this.setArtBox(n.x,n.y,e,t)},e.prototype.setWidth=function(e){K(e,`width`,[`number`]),this.setSize(e,this.getSize().height)},e.prototype.setHeight=function(e){K(e,`height`,[`number`]),this.setSize(this.getSize().width,e)},e.prototype.setMediaBox=function(e,t,n,r){K(e,`x`,[`number`]),K(t,`y`,[`number`]),K(n,`width`,[`number`]),K(r,`height`,[`number`]);var i=this.doc.context.obj([e,t,e+n,t+r]);this.node.set(X.MediaBox,i)},e.prototype.setCropBox=function(e,t,n,r){K(e,`x`,[`number`]),K(t,`y`,[`number`]),K(n,`width`,[`number`]),K(r,`height`,[`number`]);var i=this.doc.context.obj([e,t,e+n,t+r]);this.node.set(X.CropBox,i)},e.prototype.setBleedBox=function(e,t,n,r){K(e,`x`,[`number`]),K(t,`y`,[`number`]),K(n,`width`,[`number`]),K(r,`height`,[`number`]);var i=this.doc.context.obj([e,t,e+n,t+r]);this.node.set(X.BleedBox,i)},e.prototype.setTrimBox=function(e,t,n,r){K(e,`x`,[`number`]),K(t,`y`,[`number`]),K(n,`width`,[`number`]),K(r,`height`,[`number`]);var i=this.doc.context.obj([e,t,e+n,t+r]);this.node.set(X.TrimBox,i)},e.prototype.setArtBox=function(e,t,n,r){K(e,`x`,[`number`]),K(t,`y`,[`number`]),K(n,`width`,[`number`]),K(r,`height`,[`number`]);var i=this.doc.context.obj([e,t,e+n,t+r]);this.node.set(X.ArtBox,i)},e.prototype.getSize=function(){var e=this.getMediaBox();return{width:e.width,height:e.height}},e.prototype.getWidth=function(){return this.getSize().width},e.prototype.getHeight=function(){return this.getSize().height},e.prototype.getMediaBox=function(){return this.node.MediaBox().asRectangle()},e.prototype.getCropBox=function(){return this.node.CropBox()?.asRectangle()??this.getMediaBox()},e.prototype.getBleedBox=function(){return this.node.BleedBox()?.asRectangle()??this.getCropBox()},e.prototype.getTrimBox=function(){return this.node.TrimBox()?.asRectangle()??this.getCropBox()},e.prototype.getArtBox=function(){return this.node.ArtBox()?.asRectangle()??this.getCropBox()},e.prototype.translateContent=function(e,t){K(e,`x`,[`number`]),K(t,`y`,[`number`]),this.node.normalize(),this.getContentStream();var n=this.createContentStream(iC(),JS(e,t)),r=this.doc.context.register(n),i=this.createContentStream(aC()),a=this.doc.context.register(i);this.node.wrapContentStreams(r,a)},e.prototype.scale=function(e,t){K(e,`x`,[`number`]),K(t,`y`,[`number`]),this.setSize(this.getWidth()*e,this.getHeight()*t),this.scaleContent(e,t),this.scaleAnnotations(e,t)},e.prototype.scaleContent=function(e,t){K(e,`x`,[`number`]),K(t,`y`,[`number`]),this.node.normalize(),this.getContentStream();var n=this.createContentStream(iC(),YS(e,t)),r=this.doc.context.register(n),i=this.createContentStream(aC()),a=this.doc.context.register(i);this.node.wrapContentStreams(r,a)},e.prototype.scaleAnnotations=function(e,t){K(e,`x`,[`number`]),K(t,`y`,[`number`]);var n=this.node.Annots();if(n)for(var r=0;r<n.size();r++){var i=n.lookup(r);i instanceof Z&&this.scaleAnnot(i,e,t)}},e.prototype.resetPosition=function(){this.getContentStream(!1),this.x=0,this.y=0},e.prototype.setFont=function(e){K(e,`font`,[[fT,`PDFFont`]]),this.font=e,this.fontKey=this.node.newFontDictionary(this.font.name,this.font.ref)},e.prototype.setFontSize=function(e){K(e,`fontSize`,[`number`]),this.fontSize=e},e.prototype.setFontColor=function(e){K(e,`fontColor`,[[Object,`Color`]]),this.fontColor=e},e.prototype.setLineHeight=function(e){K(e,`lineHeight`,[`number`]),this.lineHeight=e},e.prototype.getPosition=function(){return{x:this.x,y:this.y}},e.prototype.getX=function(){return this.x},e.prototype.getY=function(){return this.y},e.prototype.moveTo=function(e,t){K(e,`x`,[`number`]),K(t,`y`,[`number`]),this.x=e,this.y=t},e.prototype.moveDown=function(e){K(e,`yDecrease`,[`number`]),this.y-=e},e.prototype.moveUp=function(e){K(e,`yIncrease`,[`number`]),this.y+=e},e.prototype.moveLeft=function(e){K(e,`xDecrease`,[`number`]),this.x-=e},e.prototype.moveRight=function(e){K(e,`xIncrease`,[`number`]),this.x+=e},e.prototype.pushOperators=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];S_(e,`operator`,[[qv,`PDFOperator`]]);var n=this.getContentStream();n.push.apply(n,e)},e.prototype.drawText=function(e,t){t===void 0&&(t={}),K(e,`text`,[`string`]),q(t.color,`options.color`,[[Object,`Color`]]),w_(t.opacity,`opacity.opacity`,0,1),q(t.font,`options.font`,[[fT,`PDFFont`]]),q(t.size,`options.size`,[`number`]),q(t.rotate,`options.rotate`,[[Object,`Rotation`]]),q(t.xSkew,`options.xSkew`,[[Object,`Rotation`]]),q(t.ySkew,`options.ySkew`,[[Object,`Rotation`]]),q(t.x,`options.x`,[`number`]),q(t.y,`options.y`,[`number`]),q(t.lineHeight,`options.lineHeight`,[`number`]),q(t.maxWidth,`options.maxWidth`,[`number`]),q(t.wordBreaks,`options.wordBreaks`,[Array]),__(t.blendMode,`options.blendMode`,eE);for(var n=this.setOrEmbedFont(t.font),r=n.oldFont,i=n.newFont,a=n.newFontKey,o=t.size||this.fontSize,s=t.wordBreaks||this.doc.defaultWordBreaks,c=t.maxWidth===void 0?th(Qm(e)):oh(e,s,t.maxWidth,function(e){return i.widthOfTextAtSize(e,o)}),l=Array(c.length),u=0,d=c.length;u<d;u++)l[u]=i.encodeText(c[u]);var f=this.maybeEmbedGraphicsState({opacity:t.opacity,blendMode:t.blendMode}),p=this.getContentStream();p.push.apply(p,sw(l,{color:t.color??this.fontColor,font:a,size:o,rotate:t.rotate??MS(0),xSkew:t.xSkew??MS(0),ySkew:t.ySkew??MS(0),x:t.x??this.x,y:t.y??this.y,lineHeight:t.lineHeight??this.lineHeight,graphicsState:f})),t.font&&(r?this.setFont(r):this.resetFont())},e.prototype.drawImage=function(e,t){t===void 0&&(t={}),K(e,`image`,[[mT,`PDFImage`]]),q(t.x,`options.x`,[`number`]),q(t.y,`options.y`,[`number`]),q(t.width,`options.width`,[`number`]),q(t.height,`options.height`,[`number`]),q(t.rotate,`options.rotate`,[[Object,`Rotation`]]),q(t.xSkew,`options.xSkew`,[[Object,`Rotation`]]),q(t.ySkew,`options.ySkew`,[[Object,`Rotation`]]),w_(t.opacity,`opacity.opacity`,0,1),__(t.blendMode,`options.blendMode`,eE);var n=this.node.newXObject(`Image`,e.ref),r=this.maybeEmbedGraphicsState({opacity:t.opacity,blendMode:t.blendMode}),i=this.getContentStream();i.push.apply(i,cw(n,{x:t.x??this.x,y:t.y??this.y,width:t.width??e.size().width,height:t.height??e.size().height,rotate:t.rotate??MS(0),xSkew:t.xSkew??MS(0),ySkew:t.ySkew??MS(0),graphicsState:r}))},e.prototype.drawPage=function(e,t){t===void 0&&(t={}),K(e,`embeddedPage`,[[uT,`PDFEmbeddedPage`]]),q(t.x,`options.x`,[`number`]),q(t.y,`options.y`,[`number`]),q(t.xScale,`options.xScale`,[`number`]),q(t.yScale,`options.yScale`,[`number`]),q(t.width,`options.width`,[`number`]),q(t.height,`options.height`,[`number`]),q(t.rotate,`options.rotate`,[[Object,`Rotation`]]),q(t.xSkew,`options.xSkew`,[[Object,`Rotation`]]),q(t.ySkew,`options.ySkew`,[[Object,`Rotation`]]),w_(t.opacity,`opacity.opacity`,0,1),__(t.blendMode,`options.blendMode`,eE);var n=this.node.newXObject(`EmbeddedPdfPage`,e.ref),r=this.maybeEmbedGraphicsState({opacity:t.opacity,blendMode:t.blendMode}),i=t.width===void 0?t.xScale===void 0?1:t.xScale:t.width/e.width,a=t.height===void 0?t.yScale===void 0?1:t.yScale:t.height/e.height,o=this.getContentStream();o.push.apply(o,lw(n,{x:t.x??this.x,y:t.y??this.y,xScale:i,yScale:a,rotate:t.rotate??MS(0),xSkew:t.xSkew??MS(0),ySkew:t.ySkew??MS(0),graphicsState:r}))},e.prototype.drawSvgPath=function(e,t){t===void 0&&(t={}),K(e,`path`,[`string`]),q(t.x,`options.x`,[`number`]),q(t.y,`options.y`,[`number`]),q(t.scale,`options.scale`,[`number`]),q(t.rotate,`options.rotate`,[[Object,`Rotation`]]),q(t.borderWidth,`options.borderWidth`,[`number`]),q(t.color,`options.color`,[[Object,`Color`]]),w_(t.opacity,`opacity.opacity`,0,1),q(t.borderColor,`options.borderColor`,[[Object,`Color`]]),q(t.borderDashArray,`options.borderDashArray`,[Array]),q(t.borderDashPhase,`options.borderDashPhase`,[`number`]),__(t.borderLineCap,`options.borderLineCap`,eC),w_(t.borderOpacity,`options.borderOpacity`,0,1),__(t.blendMode,`options.blendMode`,eE);var n=this.maybeEmbedGraphicsState({opacity:t.opacity,borderOpacity:t.borderOpacity,blendMode:t.blendMode});!(`color`in t)&&!(`borderColor`in t)&&(t.borderColor=LC(0,0,0));var r=this.getContentStream();r.push.apply(r,gw(e,{x:t.x??this.x,y:t.y??this.y,scale:t.scale,rotate:t.rotate??MS(0),color:t.color??void 0,borderColor:t.borderColor??void 0,borderWidth:t.borderWidth??0,borderDashArray:t.borderDashArray??void 0,borderDashPhase:t.borderDashPhase??void 0,borderLineCap:t.borderLineCap??void 0,graphicsState:n}))},e.prototype.drawLine=function(e){K(e.start,`options.start`,[[Object,`{ x: number, y: number }`]]),K(e.end,`options.end`,[[Object,`{ x: number, y: number }`]]),K(e.start.x,`options.start.x`,[`number`]),K(e.start.y,`options.start.y`,[`number`]),K(e.end.x,`options.end.x`,[`number`]),K(e.end.y,`options.end.y`,[`number`]),q(e.thickness,`options.thickness`,[`number`]),q(e.color,`options.color`,[[Object,`Color`]]),q(e.dashArray,`options.dashArray`,[Array]),q(e.dashPhase,`options.dashPhase`,[`number`]),__(e.lineCap,`options.lineCap`,eC),w_(e.opacity,`opacity.opacity`,0,1),__(e.blendMode,`options.blendMode`,eE);var t=this.maybeEmbedGraphicsState({borderOpacity:e.opacity,blendMode:e.blendMode});`color`in e||(e.color=LC(0,0,0));var n=this.getContentStream();n.push.apply(n,uw({start:e.start,end:e.end,thickness:e.thickness??1,color:e.color??void 0,dashArray:e.dashArray??void 0,dashPhase:e.dashPhase??void 0,lineCap:e.lineCap??void 0,graphicsState:t}))},e.prototype.drawRectangle=function(e){e===void 0&&(e={}),q(e.x,`options.x`,[`number`]),q(e.y,`options.y`,[`number`]),q(e.width,`options.width`,[`number`]),q(e.height,`options.height`,[`number`]),q(e.rotate,`options.rotate`,[[Object,`Rotation`]]),q(e.xSkew,`options.xSkew`,[[Object,`Rotation`]]),q(e.ySkew,`options.ySkew`,[[Object,`Rotation`]]),q(e.borderWidth,`options.borderWidth`,[`number`]),q(e.color,`options.color`,[[Object,`Color`]]),w_(e.opacity,`opacity.opacity`,0,1),q(e.borderColor,`options.borderColor`,[[Object,`Color`]]),q(e.borderDashArray,`options.borderDashArray`,[Array]),q(e.borderDashPhase,`options.borderDashPhase`,[`number`]),__(e.borderLineCap,`options.borderLineCap`,eC),w_(e.borderOpacity,`options.borderOpacity`,0,1),__(e.blendMode,`options.blendMode`,eE);var t=this.maybeEmbedGraphicsState({opacity:e.opacity,borderOpacity:e.borderOpacity,blendMode:e.blendMode});!(`color`in e)&&!(`borderColor`in e)&&(e.color=LC(0,0,0));var n=this.getContentStream();n.push.apply(n,dw({x:e.x??this.x,y:e.y??this.y,width:e.width??150,height:e.height??100,rotate:e.rotate??MS(0),xSkew:e.xSkew??MS(0),ySkew:e.ySkew??MS(0),borderWidth:e.borderWidth??0,color:e.color??void 0,borderColor:e.borderColor??void 0,borderDashArray:e.borderDashArray??void 0,borderDashPhase:e.borderDashPhase??void 0,graphicsState:t,borderLineCap:e.borderLineCap??void 0}))},e.prototype.drawSquare=function(e){e===void 0&&(e={});var t=e.size;q(t,`size`,[`number`]),this.drawRectangle(Pm(Pm({},e),{width:t,height:t}))},e.prototype.drawEllipse=function(e){e===void 0&&(e={}),q(e.x,`options.x`,[`number`]),q(e.y,`options.y`,[`number`]),q(e.xScale,`options.xScale`,[`number`]),q(e.yScale,`options.yScale`,[`number`]),q(e.rotate,`options.rotate`,[[Object,`Rotation`]]),q(e.color,`options.color`,[[Object,`Color`]]),w_(e.opacity,`opacity.opacity`,0,1),q(e.borderColor,`options.borderColor`,[[Object,`Color`]]),w_(e.borderOpacity,`options.borderOpacity`,0,1),q(e.borderWidth,`options.borderWidth`,[`number`]),q(e.borderDashArray,`options.borderDashArray`,[Array]),q(e.borderDashPhase,`options.borderDashPhase`,[`number`]),__(e.borderLineCap,`options.borderLineCap`,eC),__(e.blendMode,`options.blendMode`,eE);var t=this.maybeEmbedGraphicsState({opacity:e.opacity,borderOpacity:e.borderOpacity,blendMode:e.blendMode});!(`color`in e)&&!(`borderColor`in e)&&(e.color=LC(0,0,0));var n=this.getContentStream();n.push.apply(n,hw({x:e.x??this.x,y:e.y??this.y,xScale:e.xScale??100,yScale:e.yScale??100,rotate:e.rotate??void 0,color:e.color??void 0,borderColor:e.borderColor??void 0,borderWidth:e.borderWidth??0,borderDashArray:e.borderDashArray??void 0,borderDashPhase:e.borderDashPhase??void 0,borderLineCap:e.borderLineCap??void 0,graphicsState:t}))},e.prototype.drawCircle=function(e){e===void 0&&(e={});var t=e.size,n=t===void 0?100:t;q(n,`size`,[`number`]),this.drawEllipse(Pm(Pm({},e),{xScale:n,yScale:n}))},e.prototype.setOrEmbedFont=function(e){var t=this.font,n=this.fontKey;return e?this.setFont(e):this.getFont(),{oldFont:t,oldFontKey:n,newFont:this.font,newFontKey:this.fontKey}},e.prototype.getFont=function(){if(!this.font||!this.fontKey){var e=this.doc.embedStandardFont(PT.Helvetica);this.setFont(e)}return[this.font,this.fontKey]},e.prototype.resetFont=function(){this.font=void 0,this.fontKey=void 0},e.prototype.getContentStream=function(e){return e===void 0&&(e=!0),e&&this.contentStream||(this.contentStream=this.createContentStream(),this.contentStreamRef=this.doc.context.register(this.contentStream),this.node.addContentStream(this.contentStreamRef)),this.contentStream},e.prototype.createContentStream=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=this.doc.context.obj({});return ty.of(n,e)},e.prototype.maybeEmbedGraphicsState=function(e){var t=e.opacity,n=e.borderOpacity,r=e.blendMode;if(t!==void 0||n!==void 0||r!==void 0){var i=this.doc.context.obj({Type:`ExtGState`,ca:t,CA:n,BM:r});return this.node.newExtGState(`GS`,i)}},e.prototype.scaleAnnot=function(e,t,n){for(var r=[`RD`,`CL`,`Vertices`,`QuadPoints`,`L`,`Rect`],i=0,a=r.length;i<a;i++){var o=e.lookup(X.of(r[i]));o instanceof Y&&o.scalePDFNumbers(t,n)}var s=e.lookup(X.of(`InkList`));if(s instanceof Y)for(var i=0,a=s.size();i<a;i++){var c=s.lookup(i);c instanceof Y&&c.scalePDFNumbers(t,n)}},e.of=function(t,n,r){return new e(t,n,r)},e.create=function(t){K(t,`doc`,[[QT,`PDFDocument`]]);var n=Gv.of(-1),r=ly.withContextAndParent(t.context,n);return new e(r,t.context.register(r),t)},e}()})),iE,aE=s((()=>{G(),rE(),pT(),_T(),lT(),xT(),KC(),HS(),ES(),F_(),iE=function(e){W(t,e);function t(t,n,r){var i=e.call(this,t,n,r)||this;return K(t,`acroButton`,[[Ex,`PDFAcroPushButton`]]),i.acroField=t,i}return t.prototype.setImage=function(e,t){t===void 0&&(t=gT.Center);for(var n=this.acroField.getWidgets(),r=0,i=n.length;r<i;r++){var a=n[r],o=this.createImageAppearanceStream(a,e,t);this.updateWidgetAppearances(a,{normal:o})}this.markAsClean()},t.prototype.setFontSize=function(e){D_(e,`fontSize`),this.acroField.setFontSize(e),this.markAsDirty()},t.prototype.addToPage=function(e,t,n){q(e,`text`,[`string`]),q(t,`page`,[[nE,`PDFPage`]]),yT(n);var r=this.createWidget({x:(n?.x??0)-(n?.borderWidth??0)/2,y:(n?.y??0)-(n?.borderWidth??0)/2,width:n?.width??100,height:n?.height??50,textColor:n?.textColor??LC(0,0,0),backgroundColor:n?.backgroundColor??LC(.75,.75,.75),borderColor:n?.borderColor,borderWidth:n?.borderWidth??0,rotate:n?.rotate??MS(0),caption:e,hidden:n?.hidden,page:t.ref}),i=this.doc.context.register(r.dict);this.acroField.addWidget(i);var a=n?.font??this.doc.getForm().getDefaultFont();this.updateWidgetAppearance(r,a),t.node.addAnnot(i)},t.prototype.needsAppearancesUpdate=function(){if(this.isDirty())return!0;for(var e=this.acroField.getWidgets(),t=0,n=e.length;t<n;t++)if(!(e[t].getAppearances()?.normal instanceof zv))return!0;return!1},t.prototype.defaultUpdateAppearances=function(e){K(e,`font`,[[fT,`PDFFont`]]),this.updateAppearances(e)},t.prototype.updateAppearances=function(e,t){K(e,`font`,[[fT,`PDFFont`]]),q(t,`provider`,[Function]);for(var n=this.acroField.getWidgets(),r=0,i=n.length;r<i;r++){var a=n[r];this.updateWidgetAppearance(a,e,t)}},t.prototype.updateWidgetAppearance=function(e,t,n){var r=Zw((n??aT)(this,e,t));this.updateWidgetAppearanceWithFont(e,t,r)},t.of=function(e,n,r){return new t(e,n,r)},t}(bT)})),oE=s((()=>{lT(),aE(),CT(),TT(),xT(),BT(),DT(),kT(),jT(),NT()})),sE=s((()=>{Bw(),Xw()})),cE=s((()=>{oE(),sE(),KC(),Rw(),vT(),AS(),Tw(),PC(),HS(),HT(),tE(),WT(),FT(),$T(),pT(),hT(),rE(),dT(),JT()})),lE=s((()=>{})),uE=s((()=>{cE(),ES(),lE(),F_()}));function dE(e){let t=new Date(e),n=Number.isNaN(t.getTime())?new Date:t,r=e=>String(e).padStart(2,`0`);return`D:${n.getUTCFullYear()}${r(n.getUTCMonth()+1)}${r(n.getUTCDate())}${r(n.getUTCHours())}${r(n.getUTCMinutes())}${r(n.getUTCSeconds())}Z`}function fE(e){if(!e)return null;let t=/^(?:D:)?(\d{4})(\d{2})?(\d{2})?(\d{2})?(\d{2})?(\d{2})?(Z|[+-]\d{2}'?\d{0,2}'?)?/.exec(e.trim());if(!t)return null;let[,n,r=`01`,i=`01`,a=`00`,o=`00`,s=`00`,c]=t,l=`Z`;if(c&&c!==`Z`){let e=/([+-])(\d{2})'?(\d{2})?/.exec(c);l=`${e[1]}${e[2]}:${e[3]??`00`}`}let u=new Date(`${n}-${r}-${i}T${a}:${o}:${s}${l}`);return Number.isNaN(u.getTime())?null:u.toISOString()}function pE(e){let t=Number.parseInt(e.slice(1),16);return[(t>>16&255)/255,(t>>8&255)/255,(t&255)/255]}function mE(e){let t;if(e.length===1)t=[e[0],e[0],e[0]];else if(e.length===3)t=e;else if(e.length===4){let[n,r,i,a]=e;t=[(1-n)*(1-a),(1-r)*(1-a),(1-i)*(1-a)]}else return null;return t.some(e=>!Number.isFinite(e))?null:`#${t.map(e=>Math.round(Math.min(1,Math.max(0,e))*255).toString(16).padStart(2,`0`)).join(``)}`}function hE(e){if(!Number.isFinite(e))return`0`;let t=e.toFixed(4).replace(/\.?0+$/,``);return t===`-0`?`0`:t}var gE,_E=s((()=>{gE=class{ops=[];push(...e){return this.ops.push(e.map(e=>typeof e==`number`?hE(e):e).join(` `)),this}strokeColor(e){return this.push(...pE(e),`RG`)}fillColor(e){return this.push(...pE(e),`rg`)}moveTo(e,t){return this.push(e,t,`m`)}lineTo(e,t){return this.push(e,t,`l`)}curveTo(e,t,n,r,i,a){return this.push(e,t,n,r,i,a,`c`)}ellipse(e,t,n,r){let i=.5522847498,a=n/2,o=r/2,s=e+a,c=t+o;return this.moveTo(s+a,c).curveTo(s+a,c+o*i,s+a*i,c+o,s,c+o).curveTo(s-a*i,c+o,s-a,c+o*i,s-a,c).curveTo(s-a,c-o*i,s-a*i,c-o,s,c-o).curveTo(s+a*i,c-o,s+a,c-o*i,s+a,c).push(`h`)}toString(){return this.ops.join(`
1019
+ `)}}}));function vE(e){return[e.rect.x,e.rect.y,e.rect.x+e.rect.width,e.rect.y+e.rect.height]}function yE(e,t){let[n,...r]=t;if(n){e.moveTo(n.x,n.y),r.length===0&&e.lineTo(n.x+.01,n.y);for(let t of r)e.lineTo(t.x,t.y)}}function bE(e,t,n){let r=[];for(let i of e.split(/\r?\n/)){let e=``;for(let a of i.split(/(\s+)/).filter(e=>e!==``))if(n(e+a)<=t)e+=a;else if(/\s/.test(a))r.push(e.trimEnd()),e=``;else if(e.trim()!==``&&r.push(e.trimEnd()),e=``,n(a)<=t)e=a;else for(let i of a)e!==``&&n(e+i)>t&&(r.push(e),e=``),e+=i;r.push(e.trimEnd())}return r}function xE(e,t){let n=new gE,r={bbox:vE(e),opacity:e.opacity<1?e.opacity:null,multiply:!1,usesFont:!1};switch(e.type){case`highlight`:n.fillColor(e.color);for(let t of e.quads)n.moveTo(t[0],t[1]).lineTo(t[2],t[3]).lineTo(t[6],t[7]).lineTo(t[4],t[5]).push(`h`);return n.push(`f`),{...r,content:n.toString(),multiply:!0};case`underline`:case`strikeout`:{n.strokeColor(e.color);let t=e.type===`underline`?.08:.45;for(let r of e.quads){let e=Math.hypot(r[0]-r[4],r[1]-r[5]);n.push(Math.max(.6,e*.07),`w`).moveTo(r[4]+(r[0]-r[4])*t,r[5]+(r[1]-r[5])*t).lineTo(r[6]+(r[2]-r[6])*t,r[7]+(r[3]-r[7])*t).push(`S`)}return{...r,content:n.toString()}}case`ink`:n.strokeColor(e.color).push(e.strokeWidth,`w`).push(`1 J 1 j`);for(let t of e.paths)yE(n,t),n.push(`S`);return{...r,content:n.toString()};case`rectangle`:case`ellipse`:{let t=e.strokeWidth,{x:i,y:a,width:o,height:s}=e.rect,c=[i+t/2,a+t/2,Math.max(0,o-t),Math.max(0,s-t)];return n.strokeColor(e.color).push(t,`w`),e.fillColor&&n.fillColor(e.fillColor),e.type===`rectangle`?n.push(...c,`re`):n.ellipse(...c),n.push(e.fillColor?t>0?`B`:`f`:`S`),{...r,content:n.toString()}}case`redaction`:{let{x:t,y:i,width:a,height:o}=e.rect;return n.strokeColor(e.color).push(1.5,`w`).push(t+.75,i+.75,Math.max(0,a-1.5),Math.max(0,o-1.5),`re`).push(`S`),{...r,content:n.toString()}}case`line`:case`arrow`:if(n.strokeColor(e.color).push(e.strokeWidth,`w`).push(`1 J 1 j`),n.moveTo(e.start.x,e.start.y).lineTo(e.end.x,e.end.y).push(`S`),e.type===`arrow`){let[t,r]=I(e.start,e.end,e.strokeWidth);n.moveTo(t.x,t.y).lineTo(e.end.x,e.end.y).lineTo(r.x,r.y).push(`S`)}return{...r,content:n.toString()};case`note`:{let{x:t,y:i,width:a,height:o}=e.rect,s=(e,n)=>[t+e/24*a,i+(24-n)/24*o],c=[s(3,4),s(21,4),s(21,17),s(9,17),s(4,21),s(4,17),s(3,17)];n.fillColor(e.color).push(.45,.45,.45,`RG`).push(a/24*1.2,`w`).push(`1 j`),n.moveTo(...c[0]);for(let e of c.slice(1))n.lineTo(...e);return n.push(`h B`),n.push(a/24*1.4,`w`,`1 J`),n.moveTo(...s(7,9)).lineTo(...s(17,9)).moveTo(...s(7,12.5)).lineTo(...s(14,12.5)).push(`S`),{...r,content:n.toString()}}case`reply`:return{...r,content:``};case`freeText`:{let i=t.font;if(!i)throw Error(`A font is required for free-text appearances.`);let a=t.pageRotation%180!=0,o=a?e.rect.height:e.rect.width,s=a?e.rect.width:e.rect.height;e.backgroundColor&&n.fillColor(e.backgroundColor).push(0,0,o,s,`re f`),e.borderColor&&n.strokeColor(e.borderColor).push(1,`w`).push(.5,.5,Math.max(0,o-1),Math.max(0,s-1),`re S`);let c=e.fontSize,l=bE(e.contents,Math.max(1,o-8),e=>i.widthOfTextAtSize(e,c));n.push(SE,SE,Math.max(0,o-4),Math.max(0,s-4),`re W n`),n.push(`BT`).push(`/${i.name}`,c,`Tf`).fillColor(e.color),n.push(4,s-SE-c*.9,`Td`),l.forEach((e,t)=>{t>0&&n.push(0,-c*CE,`Td`),n.push(`<${i.encode(e)}>`,`Tj`)}),n.push(`ET`);let u=t.pageRotation*Math.PI/180,d=a||t.pageRotation===180?[Math.cos(u),Math.sin(u),-Math.sin(u),Math.cos(u),0,0]:void 0;return{...r,bbox:[0,0,o,s],...d?{matrix:d}:{},content:n.toString(),usesFont:!0}}}}var SE,CE,wE=s((()=>{Ne(),_E(),SE=2,CE=1.2}));function TE(e){return e.generationNumber===0?`${e.objectNumber}R`:`${e.objectNumber}R${e.generationNumber}`}function EE(e){let t=/^(\d+)R(\d*)$/.exec(e);return t?Gv.of(Number(t[1]),t[2]?Number(t[2]):0):null}function DE(e,t){return t instanceof Gv?e.lookup(t):t}function OE(e,t,n){let r=DE(e,t.get(X.of(n)));return r instanceof gv?r.asNumber():void 0}function kE(e,t,n){let r=DE(e,t.get(X.of(n)));return r instanceof X?r.decodeText():void 0}function AE(e,t,n){let r=DE(e,t.get(X.of(n)));return r instanceof Uy||r instanceof Ay?r.decodeText():void 0}function jE(e,t,n){let r=DE(e,t.get(X.of(n)));return r instanceof Y?r:void 0}function ME(e,t,n){let r=DE(e,t.get(X.of(n)));return r instanceof Z?r:void 0}function NE(e,t){if(!t)return[];let n=[];for(let r=0;r<t.size();r++){let i=DE(e,t.get(r));i instanceof gv&&n.push(i.asNumber())}return n}var PE,FE=s((()=>{uE(),PE=e=>Ay.fromText(e)}));function IE(e){let t=DE(e.context,e.catalog.get(X.of(`AcroForm`)));if(!(t instanceof Z))return;let n=new Set;for(let t of e.getPages()){let r=DE(e.context,t.node.get(X.of(`Annots`)));if(r instanceof Y)for(let e of r.asArray())e instanceof Gv&&n.add(e.toString())}let r=t=>{let i=DE(e.context,t);if(!(i instanceof Z))return!1;let a=DE(e.context,i.get(X.of(`Kids`)));if(a instanceof Y){let t=a.asArray().filter(r);return i.set(X.of(`Kids`),e.context.obj(t)),t.length>0}return t instanceof Gv&&n.has(t.toString())},i=DE(e.context,t.get(X.of(`Fields`)));i instanceof Y&&t.set(X.of(`Fields`),e.context.obj(i.asArray().filter(r)))}async function LE(e,t){let n=e.getForm(),r=[];for(let[i,a]of Object.entries(t.values)){let t=n.getFieldMaybe(i);t&&(RE(e,t,a),r.push(t))}let i=[],a;for(let t of r)if(t.needsAppearancesUpdate()){a??=await e.embedFont(PT.Helvetica);try{t.defaultUpdateAppearances(a)}catch{i.push(t.getName())}}return i.length>0&&n.acroForm.dict.set(X.of(`NeedAppearances`),e.context.obj(!0)),t.flatten&&n.flatten({updateFieldAppearances:!1}),i}function RE(e,t,n){if(t instanceof MT)t.setText(typeof n==`string`&&n!==``?n:void 0);else if(t instanceof ST)n===!0?t.check():t.uncheck();else if(t instanceof OT)typeof n==`string`&&n!==``?t.select(n):t.clear();else if(t instanceof wT||t instanceof ET){let r=Array.isArray(n)?n:typeof n==`string`&&n!==``?[n]:[],{dict:i}=t.acroField;r.length===0?i.delete(X.of(`V`)):i.set(X.of(`V`),r.length===1?Ay.fromText(r[0]):e.context.obj(r.map(e=>Ay.fromText(e)))),i.delete(X.of(`I`)),e.getForm().markFieldAsDirty(t.ref)}}var zE=s((()=>{uE(),FE()}));async function BE(e,t,n=[]){if(t.length===0)throw RangeError(`A document needs at least one page.`);let r=e.getPages(),i=await Promise.all(n.map(e=>QT.load(e,{ignoreEncryption:!0,updateMetadata:!1}))),a=new Map;for(let[n,r]of i.entries()){let i=[...new Set(t.filter(e=>e.doc===n+1).map(e=>e.index))];if(i.length===0)continue;let o=await e.copyPages(r,i);a.set(n+1,new Map(i.map((e,t)=>[e,o[t]])))}let o=t.map(e=>{let t=e.doc===0?r[e.index]:a.get(e.doc)?.get(e.index);if(!t)throw RangeError(`Page plan refers to page ${e.index+1} of document ${e.doc}, which doesn't exist.`);return{page:t,rotation:e.rotation}});for(let t=e.getPageCount()-1;t>=0;t--)e.removePage(t);for(let{page:t,rotation:n}of o)n%360!=0&&t.setRotation(MS(((t.getRotation().angle+n)%360+360)%360)),e.addPage(t)}var VE=s((()=>{uE()}));function HE(e){let t=e.replace(/^[A-Z]{6}\+/,``);if(KE.includes(t))return t;let[n=``,r=``]=t.split(/[,-]/),i=/bold/i.test(r),a=/italic|oblique/i.test(r),o=e=>e===`Times`?i&&a?`Times-BoldItalic`:i?`Times-Bold`:a?`Times-Italic`:`Times-Roman`:`${e}${i&&a?`-BoldOblique`:i?`-Bold`:a?`-Oblique`:``}`;return/^(Arial|Helvetica)/i.test(n)?o(`Helvetica`):/^(TimesNewRoman|Times)/i.test(n)?o(`Times`):/^(CourierNew|Courier)/i.test(n)?o(`Courier`):null}function UE(){if(!qE){qE=new Map;let{encoding:e}=My.for(`Helvetica`),t=e.unicodeMappings;for(let[e,n]of Object.values(t))qE.set(e,n)}return qE}function WE(e,t){let n={glyphs:()=>null,ascent:.9,descent:-.25},r=t?e.lookup(t):void 0;if(!(r instanceof Z))return n;let i=r.lookupMaybe(X.of(`Subtype`),X)?.asString().slice(1),a=e=>e.lookupMaybe(X.of(`FontDescriptor`),Z),o=(t,n=1/1e3)=>{let r=JE(e,t?.get(X.of(`Ascent`))),i=JE(e,t?.get(X.of(`Descent`)));return{ascent:r&&r>0?r*n:.9,descent:i&&i<0?i*n:-.25}};if(i===`Type0`){let t=r.lookupMaybe(X.of(`Encoding`),X)?.asString(),i=r.lookupMaybe(X.of(`DescendantFonts`),Y)?.lookupMaybe(0,Z);if(t!==`/Identity-H`||!i)return n;let s=JE(e,i.get(X.of(`DW`)))??1e3,c=new Map,l=i.lookupMaybe(X.of(`W`),Y);if(l){let t=l.asArray();for(let n=0;n<t.length;){let r=JE(e,t[n]),i=e.lookup(t[n+1]);if(r===void 0)break;if(i instanceof Y)i.asArray().forEach((t,n)=>c.set(r+n,JE(e,t)??s)),n+=2;else{let i=JE(e,t[n+1]),a=JE(e,t[n+2]);if(i===void 0||a===void 0)break;for(let e=r;e<=i&&e-r<65536;e++)c.set(e,a);n+=3}}}return{...o(a(i)),glyphs(e){if(e.length%2)return null;let t=[];for(let n=0;n<e.length;n+=2){let r=e[n]*256+e[n+1];t.push({bytes:e.subarray(n,n+2),width:(c.get(r)??s)/1e3,isSpace:!1})}return t}}}let s=i===`Type3`,c=s?JE(e,r.lookupMaybe(X.of(`FontMatrix`),Y)?.get(0))??.001:1/1e3,l=a(r),u=r.lookupMaybe(X.of(`Widths`),Y),d=JE(e,r.get(X.of(`FirstChar`)))??0,f=JE(e,l?.get(X.of(`MissingWidth`)))??0,p=null;if(u){let t=u.asArray().map(t=>JE(e,t)??f);p=e=>(t[e-d]??f)*c}else{let t=r.lookupMaybe(X.of(`BaseFont`),X)?.asString().slice(1),n=t?HE(t):null;if(n){let t=My.for(n),i=new Map(UE()),a=r.lookup(X.of(`Encoding`)),s=a instanceof Z?a.lookupMaybe(X.of(`Differences`),Y):void 0;if(s){let t=0;for(let n of s.asArray()){let r=JE(e,n);r===void 0?n instanceof X&&i.set(t++,n.asString().slice(1)):t=r}}let c=e=>{try{return t.font.getWidthOfGlyph(e)}catch{return}},u=n===`Symbol`||n===`ZapfDingbats`;return p=e=>((u?void 0:c(i.get(e)??``))??600)/1e3,{ascent:.9,descent:-.25,...l?o(l):{},glyphs:GE(p)}}}return p?{...o(l,s?c:1/1e3),glyphs:GE(p)}:n}function GE(e){return t=>Array.from(t,(n,r)=>({bytes:t.subarray(r,r+1),width:e(n),isSpace:n===32}))}var KE,qE,JE,YE=s((()=>{uE(),KE=[`Courier`,`Courier-Bold`,`Courier-Oblique`,`Courier-BoldOblique`,`Helvetica`,`Helvetica-Bold`,`Helvetica-Oblique`,`Helvetica-BoldOblique`,`Times-Roman`,`Times-Bold`,`Times-Italic`,`Times-BoldItalic`,`Symbol`,`ZapfDingbats`],qE=null,JE=(e,t)=>{let n=t?e.lookup(t):void 0;return n instanceof gv?n.asNumber():void 0}}));function XE(e){let t=0,n=[],r=[],i=-1,a=()=>{for(;t<e.length;){let n=e[t];if($E.has(n))t++;else if(n===37)for(;t<e.length&&e[t]!==10&&e[t]!==13;)t++;else break}},o=()=>{t++;let n=[],r=1;for(;t<e.length;){let i=e[t++];if(i===92){let r=e[t++];if(r===void 0)break;let i={110:10,114:13,116:9,98:8,102:12,40:40,41:41,92:92};if(r in i)n.push(i[r]);else if(r>=48&&r<=55){let i=r-48;for(let n=0;n<2&&e[t]>=48&&e[t]<=55;n++)i=i*8+(e[t++]-48);n.push(i&255)}else r===13?e[t]===10&&t++:r!==10&&n.push(r)}else if(i===40)r++,n.push(i);else if(i===41){if(--r===0)break;n.push(i)}else n.push(i)}return new Uint8Array(n)},s=()=>{t++;let n=[];for(;t<e.length&&e[t]!==62;){let r=e[t++],i=r>=48&&r<=57?r-48:r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:-1;i>=0&&n.push(i)}t++,n.length%2&&n.push(0);let r=new Uint8Array(n.length/2);for(let e=0;e<r.length;e++)r[e]=n[2*e]*16+n[2*e+1];return r},c=()=>{t++;let n=t;for(;t<e.length&&tD(e[t]);)t++;return nD(e,n,t).replace(/#([0-9a-fA-F]{2})/g,(e,t)=>String.fromCharCode(parseInt(t,16)))},l=()=>{a();let n=e[t];if(n===40)return{kind:`string`,bytes:o()};if(n===60&&e[t+1]===60){t+=2;let n=new Map;for(;a(),!(t>=e.length);){if(e[t]===62&&e[t+1]===62){t+=2;break}let r=l(),i=l();typeof r==`object`&&r.kind===`name`&&typeof i==`object`&&n.set(r.value,i)}return{kind:`dict`,entries:n}}if(n===60)return{kind:`string`,bytes:s()};if(n===47)return{kind:`name`,value:c()};if(n===91){t++;let n=[];for(;a(),!(t>=e.length);){if(e[t]===93){t++;break}let r=l();typeof r==`object`&&n.push(r)}return{kind:`array`,items:n}}if(n===41||n===62||n===93||n===123||n===125)return t++,l();let r=t;for(;t<e.length&&tD(e[t]);)t++;let i=nD(e,r,t);return/^[+-]?(\d+\.?\d*|\.\d+)$/.test(i)?{kind:`number`,value:Number(i)}:i===`true`||i===`false`?{kind:`bool`,value:i===`true`}:i===`null`?{kind:`null`}:i};for(;a(),!(t>=e.length);){i<0&&(i=t);let e=l();typeof e==`object`?r.push(e):e===``?t++:(e===`BI`?n.push(u(i)):n.push({operator:e,operands:r,start:i,end:t}),r=[],i=-1)}return n;function u(n){let r=new Map;for(;a(),!(t>=e.length);){let e=l();if(e===`ID`)break;let t=l();typeof e==`object`&&e.kind===`name`&&typeof t==`object`&&r.set(e.value,t)}t++;let i=t;for(;t<e.length&&!(e[t]===69&&e[t+1]===73&&$E.has(e[t-1]??32)&&(t+2>=e.length||$E.has(e[t+2])));)t++;let o=e.slice(i,Math.max(i,t-1));return t=Math.min(e.length,t+2),{operator:`BI`,operands:[],start:n,end:t,inlineImage:{dict:r,data:o}}}}function ZE(e){switch(e.kind){case`number`:return iD(e.value);case`name`:return aD(e.value);case`string`:return rD(e.bytes);case`array`:return`[${e.items.map(ZE).join(` `)}]`;case`dict`:return`<<${[...e.entries].map(([e,t])=>`${aD(e)} ${ZE(t)}`).join(` `)}>>`;case`bool`:return String(e.value);case`null`:return`null`}}function QE(e,t){return[...t.map(ZE),e].join(` `)}var $E,eD,tD,nD,rD,iD,aD,oD=s((()=>{$E=new Set([0,9,10,12,13,32]),eD=new Set([40,41,60,62,91,93,123,125,47,37]),tD=e=>!$E.has(e)&&!eD.has(e),nD=(e,t,n)=>String.fromCharCode(...e.subarray(t,n)),rD=e=>`<${Array.from(e,e=>e.toString(16).padStart(2,`0`)).join(``)}>`,iD=e=>String(Number.isInteger(e)?e:Math.round(e*1e4)/1e4),aD=e=>`/${e.replace(/[^!-~]|[()<>[\]{}/%#]/g,e=>`#${e.charCodeAt(0).toString(16).padStart(2,`0`)}`)}`}));function sD(e,t){return[e[0]*t[0]+e[1]*t[2],e[0]*t[1]+e[1]*t[3],e[2]*t[0]+e[3]*t[2],e[2]*t[1]+e[3]*t[3],e[4]*t[0]+e[5]*t[2]+t[4],e[4]*t[1]+e[5]*t[3]+t[5]]}function cD(e,t,n,r,i){let a=[hD(e,t,n),hD(e,r,n),hD(e,t,i),hD(e,r,i)],o=a.map(e=>e.x),s=a.map(e=>e.y),c=Math.min(...o),l=Math.min(...s);return{x:c,y:l,width:Math.max(...o)-c,height:Math.max(...s)-l}}function lD(e,t){let n=e.x+e.width/2,r=e.y+e.height/2,i=Math.max(e.width*e.height,1e-9);return t.some(t=>n>=t.x&&n<=t.x+t.width&&r>=t.y&&r<=t.y+t.height||gD(e,t)/i>=.25)}async function uD(e,t,n,r){let{context:i,marks:a}=r,o=XE(e),s=[],c=!1,l=!1,u=new Map,d=new Set,f=new Map,p=e=>s.push([e.start,e.end]),m=e=>{s.push(e),c=!0},h={ctm:n,font:null,fontSize:0,charSpacing:0,wordSpacing:0,scale:1,leading:0,rise:0},g=[],_=mD,v=mD,y=[],b=null,x=!1,S=(e,n)=>(t?.lookupMaybe(X.of(e),Z))?.get(X.of(n)),C=(e,t)=>{let n=hD(h.ctm,e,t);b=b?(()=>{let e=Math.min(b.x,n.x),t=Math.min(b.y,n.y);return{x:e,y:t,width:Math.max(b.x+b.width,n.x)-e,height:Math.max(b.y+b.height,n.y)-t}})():{x:n.x,y:n.y,width:0,height:0}},w=e=>{let{font:t,fontSize:n,charSpacing:i,wordSpacing:o,scale:s,rise:c}=h,u=[],d=!1,f=0,p=[],m=()=>{p.length&&u.push({kind:`string`,bytes:new Uint8Array(p)}),p=[]};for(let l of e){if(l.kind===`number`){m(),u.push(l),f+=-l.value/1e3*n*s;continue}if(l.kind!==`string`)continue;let e=t?.glyphs(l.bytes)??null;if(e){for(let r of e){let e=(r.width*n+i+(r.isSpace?o:0))*s;lD(cD(sD([n*s,0,0,n,f,c],sD(_,h.ctm)),0,t.descent,r.width,t.ascent),a)?(m(),u.push({kind:`number`,value:n&&s?-(e/s/n)*1e3:0}),d=!0):p.push(...r.bytes),f+=e}m()}else{let e=l.bytes.length*n*s,t=cD(sD([1,0,0,1,f,c],sD(_,h.ctm)),0,-.25*n,e,n);a.some(e=>_D(t,e))?(m(),u.push({kind:`number`,value:n?-(e/s/n)*1e3:0}),d=!0,r.report(`unmeasured-text`)):(m(),u.push(l)),f+=e}}if(_=sD([1,0,0,1,f,0],_),!d)return null;r.report(`text`),l=!0;let g=[];for(let e of u){let t=g.at(-1);e.kind===`number`&&t?.kind===`number`?g[g.length-1]={kind:`number`,value:t.value+e.value}:g.push(e)}return g},T=()=>{v=sD([1,0,0,1,0,-h.leading],v),_=v};for(let e of o){let t=e.operands;switch(e.operator){case`q`:g.push({...h}),p(e);break;case`Q`:h=g.pop()??h,p(e);break;case`cm`:h={...h,ctm:sD(t.map(yD),h.ctm)},p(e);break;case`BT`:_=mD,v=mD,p(e);break;case`Tf`:{let n=t[0]?.kind===`name`?t[0].value:``;f.has(n)||f.set(n,WE(i,S(`Font`,n))),h={...h,font:f.get(n),fontSize:yD(t[1])},p(e);break}case`Tc`:h={...h,charSpacing:yD(t[0])},p(e);break;case`Tw`:h={...h,wordSpacing:yD(t[0])},p(e);break;case`Tz`:h={...h,scale:yD(t[0])/100},p(e);break;case`TL`:h={...h,leading:yD(t[0])},p(e);break;case`Ts`:h={...h,rise:yD(t[0])},p(e);break;case`Td`:v=sD([1,0,0,1,yD(t[0]),yD(t[1])],v),_=v,p(e);break;case`TD`:h={...h,leading:-yD(t[1])},v=sD([1,0,0,1,yD(t[0]),yD(t[1])],v),_=v,p(e);break;case`Tm`:v=t.map(yD),_=v,p(e);break;case`T*`:T(),p(e);break;case`Tj`:case`TJ`:case`'`:case`"`:{let n=``,r;e.operator===`"`?(h={...h,wordSpacing:yD(t[0]),charSpacing:yD(t[1])},n=`${QE(`Tw`,[t[0]])} ${QE(`Tc`,[t[1]])} T* `,T(),r=t[2]?[t[2]]:[]):e.operator===`'`?(n=`T* `,T(),r=t[0]?[t[0]]:[]):r=e.operator===`TJ`?t[0]?.kind===`array`?t[0].items:[]:t[0]?[t[0]]:[];let i=w(r);i?m(n+QE(`TJ`,[{kind:`array`,items:i}])):p(e);break}case`Do`:{let n=t[0]?.kind===`name`?t[0].value:``,o=S(`XObject`,n),s=o?i.lookup(o):void 0;if(!(s instanceof zv)){d.add(n),p(e);break}let c=s.dict.lookupMaybe(X.of(`Subtype`),X)?.asString();if(c===`/Image`){let t=cD(h.ctm,0,0,1,1);if(!a.some(e=>_D(t,e))){d.add(n),p(e);break}let i=await r.redactImage(s,h.ctm);if(r.report(`image`),!i)m(``);else{let e=`PlRd${u.size+1}x${i.objectNumber}`;u.set(e,i),d.add(e),m(QE(`Do`,[{kind:`name`,value:e}]))}}else if(c===`/Form`){let t=await j(s);if(t){let e=`PlRd${u.size+1}x${t.objectNumber}`;u.set(e,t),d.add(e),m(QE(`Do`,[{kind:`name`,value:e}]))}else d.add(n),p(e)}else d.add(n),p(e);break}case`BI`:a.some(e=>_D(cD(h.ctm,0,0,1,1),e))?(r.report(`inline-image`),m(``)):p(e);break;default:if(bD.has(e.operator)){if(y.push(e),e.operator===`re`){let[e,n,r,i]=t.map(yD);C(e,n),C(e+r,n+i),C(e+r,n),C(e,n+i)}else if(e.operator!==`h`)for(let e=0;e+1<t.length;e+=2)C(yD(t[e]),yD(t[e+1]))}else if(e.operator===`W`||e.operator===`W*`)y.push(e),x=!0;else if(xD.has(e.operator)){let t=b;if(t&&e.operator!==`n`&&a.some(e=>vD(e,t)))r.report(`path`),m(x?y.map(e=>A(e)).join(` `)+` n`:``);else{for(let e of y)p(e);p(e)}y=[],b=null,x=!1}else p(e)}}for(let e of y)p(e);if(l)for(let e=0;e<s.length;e++){let t=s[e];if(typeof t==`string`)continue;let n=o.find(e=>e.start===t[0]&&e.end===t[1]);if(!n||n.operator!==`BDC`&&n.operator!==`DP`)continue;let r=n.operands[1];if(r?.kind===`dict`&&SD.some(e=>r.entries.has(e))){let t=new Map([...r.entries].filter(([e])=>!SD.includes(e)));s[e]=QE(n.operator,[n.operands[0],{kind:`dict`,entries:t}]),c=!0}}if(!c)return{bytes:e,changed:!1,xobjects:u,usedXObjects:d};let E=s.map(t=>typeof t==`string`?dD(t):e.subarray(t[0],t[1])),D=E.reduce((e,t)=>e+t.length+1,0),O=new Uint8Array(D),k=0;for(let e of E)O.set(e,k),k+=e.length,O[k++]=10;return{bytes:O,changed:!0,xobjects:u,usedXObjects:d};function A(t){return String.fromCharCode(...e.subarray(t.start,t.end))}async function j(e){let n=e.dict.lookupMaybe(X.of(`Matrix`),Y)?.asArray().map(e=>e.asNumber()),o=sD(n&&n.length===6?n:mD,h.ctm),s=e.dict.lookupMaybe(X.of(`BBox`),Y)?.asArray().map(e=>e.asNumber());if(s&&s.length===4){let e=cD(o,s[0],s[1],s[2],s[3]);if(!a.some(t=>_D(e,t)))return null}let c=e.dict.lookupMaybe(X.of(`Resources`),Z)??t,l=await uD(fD(e),c,o,r);if(!l.changed)return null;let u=e.dict.clone(i);return u.delete(X.of(`Filter`)),u.delete(X.of(`DecodeParms`)),u.delete(X.of(`Length`)),u.set(X.of(`Resources`),pD(i,c,l.xobjects,l.usedXObjects)),i.register(i.flateStream(l.bytes,Object.fromEntries([...u.entries()].map(([e,t])=>[e.asString().slice(1),t]))))}}function dD(e){let t=new Uint8Array(e.length);for(let n=0;n<e.length;n++)t[n]=e.charCodeAt(n)&255;return t}function fD(e){return e instanceof Vv?Pb(e).decode():e.getUnencodedContents()}function pD(e,t,n,r){let i=t?t.clone(e):e.obj({}),a=i.lookupMaybe(X.of(`XObject`),Z),o=e.obj({});for(let[e,t]of a?.entries()??[])r.has(e.asString().slice(1))&&o.set(e,t);for(let[e,t]of n)o.set(X.of(e),t);return i.set(X.of(`XObject`),o),i}var mD,hD,gD,_D,vD,yD,bD,xD,SD,CD=s((()=>{uE(),YE(),oD(),mD=[1,0,0,1,0,0],hD=(e,t,n)=>({x:e[0]*t+e[2]*n+e[4],y:e[1]*t+e[3]*n+e[5]}),gD=(e,t)=>Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x))*Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y)),_D=(e,t)=>e.x<t.x+t.width&&t.x<e.x+e.width&&e.y<t.y+t.height&&t.y<e.y+e.height,vD=(e,t)=>t.x>=e.x&&t.y>=e.y&&t.x+t.width<=e.x+e.width&&t.y+t.height<=e.y+e.height,yD=e=>e?.kind===`number`?e.value:0,bD=new Set([`m`,`l`,`c`,`v`,`y`,`h`,`re`]),xD=new Set([`S`,`s`,`f`,`F`,`f*`,`B`,`B*`,`b`,`b*`,`n`]),SD=[`ActualText`,`Alt`,`E`]}));function wD(e,t,n,r){let i=e[0]*e[3]-e[1]*e[2];if(Math.abs(i)<1e-12)return[];let a=[e[3]/i,-e[1]/i,-e[2]/i,e[0]/i,(e[2]*e[5]-e[3]*e[4])/i,(e[1]*e[4]-e[0]*e[5])/i],o=[];for(let e of r){let r=[hD(a,e.x,e.y),hD(a,e.x+e.width,e.y),hD(a,e.x,e.y+e.height),hD(a,e.x+e.width,e.y+e.height)],i=r.map(e=>e.x),s=r.map(e=>e.y),c=Math.max(0,Math.floor(Math.min(...i)*t)-1),l=Math.min(t,Math.ceil(Math.max(...i)*t)+1),u=Math.max(0,Math.floor((1-Math.max(...s))*n)-1),d=Math.min(n,Math.ceil((1-Math.min(...s))*n)+1);c<l&&u<d&&o.push([c,u,l,d])}return o}function TD(e,t,n,r){let i=AD(n,t?.get(X.of(`Predictor`)))??1;if(i<2)return e;if(i<10)return null;let a=AD(n,t?.get(X.of(`Colors`)))??r.colors,o=AD(n,t?.get(X.of(`BitsPerComponent`)))??r.bpc,s=AD(n,t?.get(X.of(`Columns`)))??r.columns,c=Math.max(1,Math.ceil(a*o/8)),l=Math.ceil(a*o*s/8),u=Math.floor(e.length/(l+1)),d=new Uint8Array(u*l),f=new Uint8Array(l);for(let t=0;t<u;t++){let n=e[t*(l+1)],r=e.subarray(t*(l+1)+1,(t+1)*(l+1)),i=d.subarray(t*l,(t+1)*l);for(let e=0;e<l;e++){let t=e>=c?i[e-c]:0,a=f[e],o=e>=c?f[e-c]:0,s=r[e];if(n===1)s+=t;else if(n===2)s+=a;else if(n===3)s+=t+a>>1;else if(n===4){let e=t+a-o,n=Math.abs(e-t),r=Math.abs(e-a),i=Math.abs(e-o);s+=n<=r&&n<=i?t:r<=i?a:o}else if(n!==0)return null;i[e]=s&255}f=i}return d}function ED(e,t,n){let r=2**n-1,i=t.get(X.of(`ColorSpace`));i=i?e.lookup(i):void 0;let a=t=>t instanceof X?t.asString().slice(1):t instanceof Y?e.lookup(t.get(0))?.asString().slice(1):void 0,o=a(i),s=0,c=[];if(o===`ICCBased`&&i instanceof Y){let t=e.lookup(i.get(1)),n=t instanceof zv?AD(e,t.dict.get(X.of(`N`))):void 0;o=n===1?`DeviceGray`:n===3?`DeviceRGB`:n===4?`DeviceCMYK`:void 0}if(o===`DeviceGray`||o===`CalGray`||o===`G`)[s,c]=[1,[0]];else if(o===`DeviceRGB`||o===`CalRGB`||o===`RGB`)[s,c]=[3,[0,0,0]];else if(o===`DeviceCMYK`||o===`CMYK`)[s,c]=[4,[0,0,0,1]];else if((o===`Separation`||o===`DeviceN`)&&i instanceof Y){let t=e.lookup(i.get(1));s=o===`Separation`?1:t instanceof Y?t.size():0,c=Array(s).fill(1)}else if(o===`Indexed`&&i instanceof Y){let t=a(e.lookup(i.get(1))),n=AD(e,i.get(2))??0,r=e.lookup(i.get(3)),o=r instanceof zv?r instanceof Vv?Pb(r).decode():null:r&&`asBytes`in r?r.asBytes():null,s=t===`DeviceRGB`?3:t===`DeviceGray`?1:t===`DeviceCMYK`?4:0;if(!o||!s)return null;let c=0,l=-1/0;for(let e=0;e<=n;e++){let t=Array.from(o.subarray(e*s,e*s+s)),n=s===4?t[3]+(t[0]+t[1]+t[2])/3:-t.reduce((e,t)=>e+t,0);n>l&&([c,l]=[e,n])}return{components:1,black:[c]}}else return null;let l=t.lookupMaybe(X.of(`Decode`),Y)?.asArray().map(t=>AD(e,t)??0);return{components:s,black:c.map((e,t)=>{let[n,i]=l&&l.length>=2*(t+1)?[l[2*t],l[2*t+1]]:[0,1];return i===n?0:Math.round(Math.min(1,Math.max(0,(e-n)/(i-n)))*r)})}}function DD(e,t,n,r,i,a,o,s){let c=(i*n+o)*r,l=a*t;if(r===8)e[l+(c>>3)]=s;else if(r===16)e[l+(c>>3)]=s>>8,e[l+(c>>3)+1]=s&255;else{let t=l+(c>>3),n=8-r-(c&7),i=(1<<r)-1<<n;e[t]=e[t]&~i|s<<n&i}}async function OD(e,t,n,r,i){let a=t.dict,o=AD(e,a.get(X.of(`Width`)))??0,s=AD(e,a.get(X.of(`Height`)))??0;if(!o||!s)return null;let c=wD(n,o,s,r),l=a.get(X.of(`Filter`))?e.lookup(a.get(X.of(`Filter`))):void 0,u=(l instanceof Y?l.asArray():l?[l]:[]).map(e=>e.asString().slice(1)),d=a.get(X.of(`DecodeParms`))?e.lookup(a.get(X.of(`DecodeParms`))):void 0,f=d instanceof Y?e.lookup(d.get(d.size()-1)):d,p=a.get(X.of(`SMask`)),m=p?e.lookup(p):void 0,h=m instanceof zv?await kD(e,m,n,r):void 0;if(m&&h===null)return null;let g=e=>{let t={};for(let[e,n]of a.entries()){let r=e.asString().slice(1);[`Filter`,`DecodeParms`,`Length`,`SMask`].includes(r)||(t[r]=n)}return h&&(t.SMask=h),{...t,...e}};if(u.length===1&&u[0]===`DCTDecode`){let n=a.get(X.of(`ColorSpace`))?e.lookup(a.get(X.of(`ColorSpace`)))?.toString():``;if(!i||/CMYK/.test(n??``))return null;let r=t.contents,l=await i.decodeJpeg(r);if(!l||l.width!==o||l.height!==s)return null;for(let[e,t,n,r]of c)for(let i=t;i<r;i++)for(let t=e;t<n;t++)l.data.set([0,0,0,255],(i*o+t)*4);let u=await i.encodeJpeg(l.data,o,s),d=g({ColorSpace:`DeviceRGB`,BitsPerComponent:8,Filter:`DCTDecode`});return delete d.Decode,e.register(e.stream(u,d))}if(!u.every(e=>[`FlateDecode`,`Fl`,`LZWDecode`,`LZW`,`ASCIIHexDecode`,`AHx`,`ASCII85Decode`,`A85`,`RunLengthDecode`,`RL`].includes(e)))return null;let _=jD(e,a.get(X.of(`ImageMask`))),v=_?1:AD(e,a.get(X.of(`BitsPerComponent`)))??8,y;if(_){let t=a.lookupMaybe(X.of(`Decode`),Y)?.asArray().map(t=>AD(e,t)??0);y={components:1,black:[t&&t[0]===1?0:1]}}else y=ED(e,a,v);if(!y||![1,2,4,8,16].includes(v))return null;let b;try{b=t instanceof Vv?Pb(t).decode():t.getUnencodedContents()}catch{return null}b=TD(b,f,e,{colors:y.components,bpc:v,columns:o});let x=Math.ceil(o*y.components*v/8);if(!b||b.length<x*s)return null;let S=b.slice(0,x*s);for(let[e,t,n,r]of c)for(let i=t;i<r;i++)for(let t=e;t<n;t++)for(let e=0;e<y.components;e++)DD(S,x,y.components,v,t,i,e,y.black[e]);return e.register(e.flateStream(S,g({})))}async function kD(e,t,n,r){let i=AD(e,t.dict.get(X.of(`Width`)))??0,a=AD(e,t.dict.get(X.of(`Height`)))??0,o=AD(e,t.dict.get(X.of(`BitsPerComponent`)))??8;if(!i||!a||![1,2,4,8,16].includes(o))return null;let s;try{s=t instanceof Vv?Pb(t).decode():t.getUnencodedContents()}catch{return null}let c=t.dict.lookupMaybe(X.of(`DecodeParms`),Z);s=TD(s,c,e,{colors:1,bpc:o,columns:i});let l=Math.ceil(i*o/8);if(!s||s.length<l*a)return null;let u=s.slice(0,l*a);for(let[e,t,s,c]of wD(n,i,a,r))for(let n=t;n<c;n++)for(let t=e;t<s;t++)DD(u,l,1,o,t,n,0,2**o-1);let d={};for(let[e,n]of t.dict.entries()){let t=e.asString().slice(1);[`Filter`,`DecodeParms`,`Length`].includes(t)||(d[t]=n)}return e.register(e.flateStream(u,d))}var AD,jD,MD=s((()=>{uE(),CD(),AD=(e,t)=>{let n=t?e.lookup(t):void 0;return n instanceof gv?n.asNumber():void 0},jD=(e,t)=>!!t&&e.lookup(t)?.toString()===`true`}));function ND(e,t){let n=t.lookupMaybe(X.of(`Rect`),Y)?.asArray().map(t=>Number(e.context.lookup(t)?.toString()));if(!n||n.length!==4||n.some(e=>!Number.isFinite(e)))return null;let[r,i,a,o]=n;return{x:Math.min(r,a),y:Math.min(i,o),width:Math.abs(a-r),height:Math.abs(o-i)}}async function PD(e,t,n){let r={removed:{text:0,image:0,path:0,"inline-image":0,"unmeasured-text":0,annotation:0},imagesRemovedWhole:[]},{context:i}=e,a=e.getPages();for(let[o,s]of t){let t=a[o];if(!t||s.length===0)continue;let c={context:i,marks:s,report:e=>r.removed[e]++,async redactImage(e,t){let a=await OD(i,e,t,s,n);return a||r.imagesRemovedWhole.push(o+1),a}},l=t.node.get(X.of(`Contents`)),u=l?i.lookup(l):void 0,d=(u instanceof Y?u.asArray().map(e=>i.lookup(e)):[u]).filter(e=>e instanceof zv).map(fD),f=new Uint8Array(d.reduce((e,t)=>e+t.length+1,0)),p=0;for(let e of d)f.set(e,p),p+=e.length,f[p++]=10;let m=t.node.Resources(),h=await uD(f,m,mD,c),g=s.map(e=>`${e.x} ${e.y} ${e.width} ${e.height} re`).join(`
1020
+ `),_=new TextEncoder().encode(`\nQ\nq 0 0 0 rg 0 0 0 RG\n${g}\nf\nQ\n`),v=new TextEncoder().encode(`q
1021
+ `),y=new Uint8Array(v.length+h.bytes.length+_.length);y.set(v,0),y.set(h.bytes,v.length),y.set(_,v.length+h.bytes.length),t.node.set(X.of(`Contents`),i.register(i.flateStream(y))),h.changed&&t.node.set(X.of(`Resources`),pD(i,m,h.xobjects,h.usedXObjects));let b=t.node.lookupMaybe(X.of(`Annots`),Y);if(b){let n=b.asArray().filter(t=>{let n=i.lookup(t);if(!(n instanceof Z))return!0;let a=ND(e,n),o=!!a&&s.some(e=>_D(a,e));return o&&r.removed.annotation++,!o});t.node.set(X.of(`Annots`),i.obj(n))}}return IE(e),r}function FD(e){let{context:t}=e,n=new Set,r=[],{Root:i,Info:a,Encrypt:o}=t.trailerInfo;for(let e of[i,a,o])e&&r.push(e);for(;r.length;){let e=r.pop();if(e instanceof Gv){let i=e.toString();if(n.has(i))continue;n.add(i);let a=t.lookup(e);a&&r.push(a)}else if(e instanceof Z)for(let[,t]of e.entries())r.push(t);else if(e instanceof Y)for(let t of e.asArray())r.push(t);else e instanceof zv&&r.push(e.dict)}for(let[e]of t.enumerateIndirectObjects())n.has(e.toString())||t.delete(e)}var ID=s((()=>{uE(),zE(),CD(),MD()}));function LD(e){let t=atob(e.slice(e.indexOf(`,`)+1)),n=new Uint8Array(t.length);for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e);return n}function RD(e,t){let{x:n,y:r,width:i,height:a}=e;switch((t%360+360)%360){case 90:return[0,a,-i,0,n+i,r];case 180:return[-i,0,0,-a,n+i,r+a];case 270:return[0,-a,i,0,n,r+a];default:return[i,0,0,a,n,r]}}async function zD(e,t){let n=e.getPages(),r=new Map,i=t=>{let n=r.get(t);if(!n){let i=LD(t);n=t.startsWith(`data:image/png`)?e.embedPng(i):e.embedJpg(i),r.set(t,n)}return n};for(let r of t){let t=n[r.page-1];if(!t)continue;t.node.normalize();let a=await i(r.image),o=[iC()];if(r.opacity<1){let n=t.node.newExtGState(`SigGS`,e.context.obj({Type:`ExtGState`,CA:r.opacity,ca:r.opacity}));o.push(rC(n))}o.push(qS(...RD(r.rect,t.getRotation().angle)),TC(t.node.newXObject(`Sig`,a.ref)),aC()),t.pushOperators(...o)}}var BD=s((()=>{uE()}));async function VD(e,t){let n=await e.embedFont(PT.HelveticaBold);for(let r of e.getPages()){let e=r.getCropBox(),i=Math.max(10,Math.min(e.width,e.height)/14),a=n.widthOfTextAtSize(t,i),o=Math.atan2(e.height,e.width),[s,c]=[Math.cos(o),Math.sin(o)],l=Math.hypot(e.width,e.height),[u,d]=[e.x+e.width/2,e.y+e.height/2],f=i*4;for(let e=-l/2,p=0;e<=l/2;e+=f,p++)for(let f=-l/2+p%2*a*.6;f<=l/2;f+=a*1.6)r.drawText(t,{x:u+f*s-e*c,y:d+f*c+e*s,size:i,font:n,color:LC(.86,.15,.15),opacity:.18,rotate:MS(o*180/Math.PI)})}}var HD=s((()=>{uE()}));async function UD(e,t,n={}){let r=await QT.load(e,{updateMetadata:!1,ignoreEncryption:!0});if(r.isEncrypted)throw new De;if(n.pages&&(await BE(r,n.pages,n.extraDocuments),IE(r)),n.form){let e=await LE(r,n.form);e.length>0&&console.warn(`[pdfcedar] these form fields need the reader to draw them (text outside the standard font):`,e)}let i=new Map;for(let e of t)e.type===`redaction`&&e.applied&&i.set(e.page-1,[...i.get(e.page-1)??[],e.rect]);if(i.size>0){let e=await PD(r,i,n.imageCodec);e.imagesRemovedWhole.length>0&&console.warn(`[pdfcedar] images under redactions that could not be decoded were removed whole, on pages:`,[...new Set(e.imagesRemovedWhole)])}let a=t.filter(e=>e.type===`signature`);return await YD(r,t.filter(e=>!(e.type===`redaction`&&e.applied)),n),await zD(r,a),n.watermark&&await VD(r,n.watermark),i.size>0&&FD(r),r.save({updateFieldAppearances:!1})}function WD(e){return(Math.round(e.getRotation().angle/90)*90%360+360)%360}function GD(e,t){let n=DE(e.context,t.node.get(X.of(`Annots`)));if(n instanceof Y)return n;let r=e.context.obj([]);return t.node.set(X.of(`Annots`),r),r}function KD(e,t){if(t.size===0)return;let n=e=>t.has(`${e.objectNumber} ${e.generationNumber}`);for(let t of e.getPages()){let r=DE(e.context,t.node.get(X.of(`Annots`)));if(!(r instanceof Y))continue;let i=r.asArray().filter(t=>{if(t instanceof Gv&&n(t))return!1;let r=DE(e.context,t),i=r instanceof Z?r.get(X.of(`Parent`)):void 0;return!(i instanceof Gv&&n(i)&&qD(r)===`Popup`)});t.node.set(X.of(`Annots`),e.context.obj(i))}}function qD(e){let t=e.get(X.of(`Subtype`));return t instanceof X?t.decodeText():void 0}function JD(e){let t=new Set(e.getCharacterSet()),n=e=>[...e].map(e=>t.has(e.codePointAt(0))?e:`?`).join(``);return{name:`Helv`,widthOfTextAtSize:(t,r)=>e.widthOfTextAtSize(n(t),r),encode:t=>e.encodeText(n(t)).toString().replace(/^<|>$/g,``)}}async function YD(e,t,n={}){let r=new Set;for(let e of n.replacedIds??[]){let t=EE(e);t&&r.add(`${t.objectNumber} ${t.generationNumber}`)}KD(e,r);let i=e.getPages(),a=t.some(e=>e.type===`freeText`)?await e.embedFont(PT.Helvetica):null,o=a?JD(a):void 0,{context:s}=e,c=new Map(t.map(e=>[e.id,s.nextRef()]));for(let n of t){let t=i[n.page-1];if(!t||n.type===`signature`||n.type===`redaction`&&n.applied)continue;let r=WD(t),l=xE(n,{pageRotation:r,...o?{font:o}:{}}),u={};(l.opacity!==null||l.multiply)&&(u.ExtGState={GS:{Type:`ExtGState`,...l.opacity===null?{}:{CA:l.opacity,ca:l.opacity},...l.multiply?{BM:`Multiply`}:{}}}),l.usesFont&&a&&(u.Font={Helv:a.ref});let d=(u.ExtGState?`/GS gs
1022
+ `:``)+l.content,f=s.flateStream(d,{Type:`XObject`,Subtype:`Form`,BBox:l.bbox,...l.matrix?{Matrix:l.matrix}:{},Resources:u}),{x:p,y:m,width:h,height:g}=n.rect,_=XD|(n.locked?ZD:0);(n.type===`note`||n.type===`reply`)&&(_|=24);let v={Type:`Annot`,Subtype:QD[n.type],Rect:[p,m,p+h,m+g],P:t.ref,NM:PE(n.id),T:PE(n.author),Contents:PE(n.contents),M:PE(dE(n.modifiedAt)),CreationDate:PE(dE(n.createdAt)),F:_,AP:{N:s.register(f)}};switch(n.opacity<1&&(v.CA=n.opacity),n.type!==`freeText`&&(v.C=pE(n.color)),n.type){case`highlight`:case`underline`:case`strikeout`:v.QuadPoints=n.quads.flat();break;case`note`:Object.assign(v,{Name:`Comment`,Open:!1});break;case`reply`:{let e=c.get(n.inReplyTo);Object.assign(v,{Name:`Comment`,Open:!1,RT:`R`}),e&&(v.IRT=e);break}case`ink`:Object.assign(v,{InkList:n.paths.map(e=>e.flatMap(e=>[e.x,e.y])),BS:{W:n.strokeWidth,S:`S`}});break;case`rectangle`:case`ellipse`:v.BS={W:n.strokeWidth,S:`S`},n.fillColor&&(v.IC=pE(n.fillColor));break;case`line`:case`arrow`:Object.assign(v,{L:[n.start.x,n.start.y,n.end.x,n.end.y],LE:[`None`,n.type===`arrow`?`OpenArrow`:`None`],BS:{W:n.strokeWidth,S:`S`}});break;case`freeText`:{let[e,t,i]=pE(n.color);Object.assign(v,{DA:PE(`/Helv ${n.fontSize} Tf ${e.toFixed(3)} ${t.toFixed(3)} ${i.toFixed(3)} rg`),Q:0,BS:{W:+!!n.borderColor,S:`S`},[$D]:PE(JSON.stringify({backgroundColor:n.backgroundColor,borderColor:n.borderColor}))}),n.backgroundColor&&(v.C=pE(n.backgroundColor)),r&&(v.Rotate=r);break}}let y=c.get(n.id);s.assign(y,s.obj(v)),GD(e,t).push(y)}}var XD,ZD,QD,$D,eO=s((()=>{Ne(),uE(),wE(),zE(),VE(),ID(),BD(),HD(),FE(),_E(),XD=4,ZD=128,QD={highlight:`Highlight`,underline:`Underline`,strikeout:`StrikeOut`,note:`Text`,reply:`Text`,ink:`Ink`,rectangle:`Square`,ellipse:`Circle`,line:`Line`,arrow:`Line`,freeText:`FreeText`,redaction:`Redact`},$D=`PDFCedarStyle`}));async function tO(e){return nO(await QT.load(e,{updateMetadata:!1,ignoreEncryption:!0,parseSpeed:UT.Medium}))}function nO(e,t=new Date().toISOString()){let{context:n}=e,r=[];e.getPages().forEach((e,t)=>{let i=DE(n,e.node.get(X.of(`Annots`)));if(i instanceof Y)for(let e of i.asArray()){if(!(e instanceof Gv))continue;let i=n.lookup(e);if(!(i instanceof Z))continue;let a=kE(n,i,`Subtype`),o=OE(n,i,`F`)??0;!a||!g.has(a)||o&iO||r.push({ref:e,dict:i,page:t+1,subtype:a})}});let i=new Map,a=new Set;for(let e of r){let t=AE(n,e.dict,`NM`)?.trim()||`pdf-${e.ref.objectNumber}-${e.ref.generationNumber}`;for(;a.has(t);)t=`${t}-${e.ref.objectNumber}`;a.add(t),i.set(TE(e.ref),t)}let o=[];for(let n of r){let r=rO(e,n,i,t);r&&o.push({annotation:r,pdfId:TE(n.ref)})}let s=new Set(o.map(e=>e.annotation.id)),c=o.filter(({annotation:e})=>e.type!==`reply`||s.has(e.inReplyTo));return{annotations:c.map(e=>e.annotation),ids:c.map(e=>e.pdfId)}}function rO(e,t,n,r){let{context:i}=e,{dict:a}=t,o=NE(i,jE(i,a,`Rect`));if(o.length!==4)return null;let[s,c,l,u]=o,d={x:Math.min(s,l),y:Math.min(c,u),width:Math.abs(l-s),height:Math.abs(u-c)},f=e=>mE(NE(i,jE(i,a,`C`)))??e,p=OE(i,a,`F`)??0,m=fE(AE(i,a,`CreationDate`))??fE(AE(i,a,`M`))??r,g=()=>OE(i,ME(i,a,`BS`)??a,`W`)??NE(i,jE(i,a,`Border`))[2]??1,_={id:n.get(TE(t.ref)),page:t.page,rect:d,opacity:Math.min(1,Math.max(0,OE(i,a,`CA`)??1)),contents:AE(i,a,`Contents`)??``,author:AE(i,a,`T`)??``,authorId:``,createdAt:m,modifiedAt:fE(AE(i,a,`M`))??m,locked:(p&aO)!==0};switch(t.subtype){case`Highlight`:case`Underline`:case`StrikeOut`:{let e=t.subtype===`Highlight`?`highlight`:t.subtype===`Underline`?`underline`:`strikeout`,n=NE(i,jE(i,a,`QuadPoints`)),r=[];for(let e=0;e+8<=n.length;e+=8)r.push(n.slice(e,e+8));return{..._,type:e,color:f(h[e]),quads:r.length?r:[xe(d)]}}case`Text`:{let e=a.get(X.of(`IRT`));if(e instanceof Gv){let t=n.get(TE(e));return t?{..._,type:`reply`,inReplyTo:t,color:f(h.reply)}:null}return{..._,type:`note`,color:f(h.note)}}case`Ink`:{let e=jE(i,a,`InkList`),t=[];for(let n of e?.asArray()??[]){let e=NE(i,DE(i,n)),r=[];for(let t=0;t+2<=e.length;t+=2)r.push({x:e[t],y:e[t+1]});r.length&&t.push(r)}return t.length?{..._,type:`ink`,color:f(h.ink),paths:t,strokeWidth:g()}:null}case`Redact`:return{..._,type:`redaction`,color:f(h.redaction),applied:!1};case`Square`:case`Circle`:{let[e=0,n=0,r=0,o=0]=NE(i,jE(i,a,`RD`)),s={x:d.x+e,y:d.y+n,width:Math.max(0,d.width-e-r),height:Math.max(0,d.height-n-o)},c=t.subtype===`Square`?`rectangle`:`ellipse`;return{..._,type:c,rect:s,color:f(h[c]),strokeWidth:g(),fillColor:mE(NE(i,jE(i,a,`IC`)))}}case`Line`:{let e=NE(i,jE(i,a,`L`));if(e.length!==4)return null;let t={x:e[0],y:e[1]},n={x:e[2],y:e[3]},r=(jE(i,a,`LE`)?.asArray()??[]).map(e=>{let t=DE(i,e);return t instanceof X?t.decodeText():``}),o=oO.has(r[0]??``),s=oO.has(r[1]??``);o&&!s&&([t,n]=[n,t]);let c=o||s?`arrow`:`line`;return{..._,type:c,color:f(h[c]),start:t,end:n,strokeWidth:g()}}case`FreeText`:{let e=AE(i,a,`DA`)??``,t=Number(/([\d.]+)\s+Tf/.exec(e)?.[1]),n=/([\d.]+)\s+([\d.]+)\s+([\d.]+)\s+rg/.exec(e),r=/([\d.]+)\s+g(?:\s|$)/.exec(e),o=n?mE([Number(n[1]),Number(n[2]),Number(n[3])]):r?mE([Number(r[1])]):null,s={};try{s=JSON.parse(AE(i,a,`PDFCedarStyle`)??`{}`)}catch{}let c=AE(i,a,$D)!==void 0,l=g()>0;return{..._,type:`freeText`,color:o??h.freeText,fontSize:Number.isFinite(t)&&t>0?t:14,backgroundColor:c?s.backgroundColor??null:null,borderColor:c?s.borderColor??null:l&&jE(i,a,`BS`)?o??h.freeText:null}}default:return null}}var iO,aO,oO,sO=s((()=>{Ne(),uE(),FE(),_E(),eO(),iO=2,aO=128,oO=new Set([`OpenArrow`,`ClosedArrow`])})),cO=l({EncryptedDocumentError:()=>De,STYLE_KEY:()=>$D,applyPagePlan:()=>BE,applyRedactions:()=>PD,buildAppearance:()=>xE,drawSignatures:()=>zD,parsePdfDate:()=>fE,pruneOrphanFields:()=>IE,readAnnotations:()=>tO,readFromDocument:()=>nO,removeUnreachable:()=>FD,saveDocument:()=>UD,signatureMatrix:()=>RD,toPdfDate:()=>dE,wrapText:()=>bE,writeAnnotations:()=>YD,writeForm:()=>LE}),lO=s((()=>{eO(),sO(),VE(),wE(),_E(),Ne(),BD(),zE(),ID()})),uO,dO,fO,pO,mO,hO=s((()=>{uO=()=>new Map,dO=e=>{let t=uO();return e.forEach((e,n)=>{t.set(n,e)}),t},fO=(e,t,n)=>{let r=e.get(t);return r===void 0&&e.set(t,r=n()),r},pO=(e,t)=>{let n=[];for(let[r,i]of e)n.push(t(i,r));return n},mO=(e,t)=>{for(let[n,r]of e)if(t(r,n))return!0;return!1}})),gO,_O=s((()=>{gO=()=>new Set})),vO,yO,bO,xO,SO,CO,wO,TO=s((()=>{vO=e=>e[e.length-1],yO=(e,t)=>{for(let n=0;n<t.length;n++)e.push(t[n])},bO=Array.from,xO=(e,t)=>{for(let n=0;n<e.length;n++)if(!t(e[n],n,e))return!1;return!0},SO=(e,t)=>{for(let n=0;n<e.length;n++)if(t(e[n],n,e))return!0;return!1},CO=(e,t)=>{let n=Array(e);for(let r=0;r<e;r++)n[r]=t(r,n);return n},wO=Array.isArray})),EO,DO,OO=s((()=>{hO(),_O(),TO(),EO=class{constructor(){this._observers=uO()}on(e,t){return fO(this._observers,e,gO).add(t),t}once(e,t){let n=(...r)=>{this.off(e,n),t(...r)};this.on(e,n)}off(e,t){let n=this._observers.get(e);n!==void 0&&(n.delete(t),n.size===0&&this._observers.delete(e))}emit(e,t){return bO((this._observers.get(e)||uO()).values()).forEach(e=>e(...t))}destroy(){this._observers=uO()}},DO=class{constructor(){this._observers=uO()}on(e,t){fO(this._observers,e,gO).add(t)}once(e,t){let n=(...r)=>{this.off(e,n),t(...r)};this.on(e,n)}off(e,t){let n=this._observers.get(e);n!==void 0&&(n.delete(t),n.size===0&&this._observers.delete(e))}emit(e,t){return bO((this._observers.get(e)||uO()).values()).forEach(e=>e(...t))}destroy(){this._observers=uO()}}})),kO,AO,jO,MO,NO,PO,FO=s((()=>{kO=Math.floor,AO=Math.abs,jO=(e,t)=>e<t?e:t,MO=(e,t)=>e>t?e:t,Number.isNaN,NO=Math.pow,PO=e=>e===0?1/e<0:e<0})),IO=s((()=>{})),LO,RO,zO,BO=s((()=>{FO(),LO=2**53-1,RO=-(2**53-1),zO=Number.isInteger||(e=>typeof e==`number`&&isFinite(e)&&kO(e)===e),Number.isNaN,Number.parseInt})),VO,HO,UO,WO,GO,KO,qO,JO,YO,XO,ZO,QO,$O=s((()=>{TO(),VO=String.fromCharCode,String.fromCodePoint,VO(65535),HO=e=>e.toLowerCase(),UO=/^\s*/g,WO=e=>e.replace(UO,``),GO=/([A-Z])/g,KO=(e,t)=>WO(e.replace(GO,e=>`${t}${HO(e)}`)),qO=e=>{let t=unescape(encodeURIComponent(e)),n=t.length,r=new Uint8Array(n);for(let e=0;e<n;e++)r[e]=t.codePointAt(e);return r},JO=typeof TextEncoder<`u`?new TextEncoder:null,YO=e=>JO.encode(e),XO=JO?YO:qO,ZO=typeof TextDecoder>`u`?null:new TextDecoder(`utf-8`,{fatal:!0,ignoreBOM:!0}),ZO&&ZO.decode(new Uint8Array).length===1&&(ZO=null),QO=(e,t)=>CO(t,()=>e).join(``)})),ek,tk,nk,rk,ik,ak,ok,sk,ck,lk,uk,dk,fk,pk,mk,hk,gk,_k,vk,yk,bk,xk,Sk,Ck,wk,Tk,Ek,Dk,Ok,kk=s((()=>{FO(),BO(),IO(),$O(),TO(),ek=class{constructor(){this.cpos=0,this.cbuf=new Uint8Array(100),this.bufs=[]}},tk=()=>new ek,nk=e=>{let t=e.cpos;for(let n=0;n<e.bufs.length;n++)t+=e.bufs[n].length;return t},rk=e=>{let t=new Uint8Array(nk(e)),n=0;for(let r=0;r<e.bufs.length;r++){let i=e.bufs[r];t.set(i,n),n+=i.length}return t.set(new Uint8Array(e.cbuf.buffer,0,e.cpos),n),t},ik=(e,t)=>{let n=e.cbuf.length;n-e.cpos<t&&(e.bufs.push(new Uint8Array(e.cbuf.buffer,0,e.cpos)),e.cbuf=new Uint8Array(MO(n,t)*2),e.cpos=0)},ak=(e,t)=>{let n=e.cbuf.length;e.cpos===n&&(e.bufs.push(e.cbuf),e.cbuf=new Uint8Array(n*2),e.cpos=0),e.cbuf[e.cpos++]=t},ok=ak,sk=(e,t)=>{for(;t>127;)ak(e,128|127&t),t=kO(t/128);ak(e,127&t)},ck=(e,t)=>{let n=PO(t);for(n&&(t=-t),ak(e,(t>63?128:0)|(n?64:0)|63&t),t=kO(t/64);t>0;)ak(e,(t>127?128:0)|127&t),t=kO(t/128)},lk=new Uint8Array(3e4),uk=lk.length/3,dk=(e,t)=>{if(t.length<uk){let n=JO.encodeInto(t,lk).written||0;sk(e,n);for(let t=0;t<n;t++)ak(e,lk[t])}else hk(e,XO(t))},fk=(e,t)=>{let n=unescape(encodeURIComponent(t)),r=n.length;sk(e,r);for(let t=0;t<r;t++)ak(e,n.codePointAt(t))},pk=JO&&JO.encodeInto?dk:fk,mk=(e,t)=>{let n=e.cbuf.length,r=e.cpos,i=jO(n-r,t.length),a=t.length-i;e.cbuf.set(t.subarray(0,i),r),e.cpos+=i,a>0&&(e.bufs.push(e.cbuf),e.cbuf=new Uint8Array(MO(n*2,a)),e.cbuf.set(t.subarray(i)),e.cpos=a)},hk=(e,t)=>{sk(e,t.byteLength),mk(e,t)},gk=(e,t)=>{ik(e,t);let n=new DataView(e.cbuf.buffer,e.cpos,t);return e.cpos+=t,n},_k=(e,t)=>gk(e,4).setFloat32(0,t,!1),vk=(e,t)=>gk(e,8).setFloat64(0,t,!1),yk=(e,t)=>gk(e,8).setBigInt64(0,t,!1),bk=new DataView(new ArrayBuffer(4)),xk=e=>(bk.setFloat32(0,e),bk.getFloat32(0)===e),Sk=(e,t)=>{switch(typeof t){case`string`:ak(e,119),pk(e,t);break;case`number`:zO(t)&&AO(t)<=2147483647?(ak(e,125),ck(e,t)):xk(t)?(ak(e,124),_k(e,t)):(ak(e,123),vk(e,t));break;case`bigint`:ak(e,122),yk(e,t);break;case`object`:if(t===null)ak(e,126);else if(wO(t)){ak(e,117),sk(e,t.length);for(let n=0;n<t.length;n++)Sk(e,t[n])}else if(t instanceof Uint8Array)ak(e,116),hk(e,t);else{ak(e,118);let n=Object.keys(t);sk(e,n.length);for(let r=0;r<n.length;r++){let i=n[r];pk(e,i),Sk(e,t[i])}}break;case`boolean`:ak(e,t?120:121);break;default:ak(e,127)}},Ck=class extends ek{constructor(e){super(),this.w=e,this.s=null,this.count=0}write(e){this.s===e?this.count++:(this.count>0&&sk(this,this.count-1),this.count=1,this.w(this,e),this.s=e)}},wk=e=>{e.count>0&&(ck(e.encoder,e.count===1?e.s:-e.s),e.count>1&&sk(e.encoder,e.count-2))},Tk=class{constructor(){this.encoder=new ek,this.s=0,this.count=0}write(e){this.s===e?this.count++:(wk(this),this.count=1,this.s=e)}toUint8Array(){return wk(this),rk(this.encoder)}},Ek=e=>{if(e.count>0){let t=e.diff*2+(e.count===1?0:1);ck(e.encoder,t),e.count>1&&sk(e.encoder,e.count-2)}},Dk=class{constructor(){this.encoder=new ek,this.s=0,this.count=0,this.diff=0}write(e){this.diff===e-this.s?(this.s=e,this.count++):(Ek(this),this.count=1,this.diff=e-this.s,this.s=e)}toUint8Array(){return Ek(this),rk(this.encoder)}},Ok=class{constructor(){this.sarr=[],this.s=``,this.lensE=new Tk}write(e){this.s+=e,this.s.length>19&&(this.sarr.push(this.s),this.s=``),this.lensE.write(e.length)}toUint8Array(){let e=new ek;return this.sarr.push(this.s),this.s=``,pk(e,this.sarr.join(``)),mk(e,this.lensE.toUint8Array()),rk(e)}}})),Ak,jk,Mk,Nk=s((()=>{Ak=e=>Error(e),jk=()=>{throw Ak(`Method unimplemented`)},Mk=()=>{throw Ak(`Unexpected case`)}})),Pk,Fk,Ik,Lk,Rk,zk,Bk,Vk,Hk,Uk,Wk,Gk,Kk,qk,Jk,Yk,Xk,Zk,Qk,$k,eA,tA,nA,rA,iA,aA=s((()=>{IO(),FO(),BO(),$O(),Nk(),Pk=Ak(`Unexpected end of array`),Fk=Ak(`Integer out of Range`),Ik=(e,t,n)=>{if(t<0||n<0||t+n>e.length)throw Pk;return new Uint8Array(e.buffer,e.byteOffset+t,n)},Lk=(e,t,n)=>{if(t<0||n<0||t+n>e.length)throw Pk;return new DataView(e.buffer,e.byteOffset+t,n)},Rk=class{constructor(e){this.arr=e,this.pos=0}},zk=e=>new Rk(e),Bk=e=>e.pos!==e.arr.length,Vk=(e,t)=>{let n=Ik(e.arr,e.pos,t);return e.pos+=t,n},Hk=e=>Vk(e,Wk(e)),Uk=e=>e.arr[e.pos++],Wk=e=>{let t=0,n=1,r=e.arr.length;for(;e.pos<r;){let r=e.arr[e.pos++];if(t+=(r&127)*n,n*=128,r<128)return t;if(t>LO)throw Fk}throw Pk},Gk=e=>{let t=e.arr[e.pos++],n=t&63,r=64,i=(t&64)>0?-1:1;if(!(t&128))return i*n;let a=e.arr.length;for(;e.pos<a;){if(t=e.arr[e.pos++],n+=(t&127)*r,r*=128,t<128)return i*n;if(n>LO)throw Fk}throw Pk},Kk=e=>{let t=Wk(e);if(t===0)return``;{let n=String.fromCodePoint(Uk(e));if(--t<100)for(;t--;)n+=String.fromCodePoint(Uk(e));else for(;t>0;){let r=t<1e4?t:1e4,i=e.arr.subarray(e.pos,e.pos+r);e.pos+=r,n+=String.fromCodePoint.apply(null,i),t-=r}return decodeURIComponent(escape(n))}},qk=e=>ZO.decode(Hk(e)),Jk=ZO?qk:Kk,Yk=(e,t)=>{let n=Lk(e.arr,e.pos,t);return e.pos+=t,n},Xk=e=>Yk(e,4).getFloat32(0,!1),Zk=e=>Yk(e,8).getFloat64(0,!1),Qk=e=>Yk(e,8).getBigInt64(0,!1),$k=[e=>void 0,e=>null,Gk,Xk,Zk,Qk,e=>!1,e=>!0,Jk,e=>{let t=Wk(e),n={};for(let r=0;r<t;r++){let t=Jk(e);n[t]=eA(e)}return n},e=>{let t=Wk(e),n=[];for(let r=0;r<t;r++)n.push(eA(e));return n},Hk],eA=e=>$k[127-Uk(e)](e),tA=class extends Rk{constructor(e,t){super(e),this.reader=t,this.s=null,this.count=0}read(){return this.count===0&&(this.s=this.reader(this),this.count=Bk(this)?Wk(this)+1:-1),this.count--,this.s}},nA=class extends Rk{constructor(e){super(e),this.s=0,this.count=0}read(){if(this.count===0){this.s=Gk(this);let e=PO(this.s);this.count=1,e&&(this.s=-this.s,this.count=Wk(this)+2)}return this.count--,this.s}},rA=class extends Rk{constructor(e){super(e),this.s=0,this.count=0,this.diff=0}read(){if(this.count===0){let e=Gk(this),t=e&1;this.diff=kO(e/2),this.count=1,t&&(this.count=Wk(this)+2)}return this.s+=this.diff,this.count--,this.s}},iA=class{constructor(e){this.decoder=new nA(e),this.str=Jk(this.decoder),this.spos=0}read(){let e=this.spos+this.decoder.read(),t=this.str.slice(this.spos,e);return this.spos=e,t}}})),oA,sA=s((()=>{crypto.subtle,oA=crypto.getRandomValues.bind(crypto)})),cA,lA,uA,dA=s((()=>{sA(),cA=()=>oA(new Uint32Array(1))[0],lA=`10000000-1000-4000-8000-100000000000`,uA=()=>lA.replace(/[018]/g,e=>(e^cA()&15>>e/4).toString(16))})),fA,pA=s((()=>{fA=Date.now})),mA,hA=s((()=>{mA=e=>new Promise(e),Promise.all.bind(Promise)})),gA,_A=s((()=>{gA=e=>e===void 0?null:e})),vA,yA,bA,xA,SA,CA,wA=s((()=>{vA=class{constructor(){this.map=new Map}setItem(e,t){this.map.set(e,t)}getItem(e){return this.map.get(e)}},yA=new vA,bA=!0;try{typeof localStorage<`u`&&localStorage&&(yA=localStorage,bA=!1)}catch{}xA=yA,SA=e=>bA||addEventListener(`storage`,e),CA=e=>bA||removeEventListener(`storage`,e)})),TA,EA,DA=s((()=>{TA=Symbol(`Equality`),EA=(e,t)=>e===t||!!e?.[TA]?.(t)||!1})),OA,kA,AA,jA,MA,NA,PA,FA,IA,LA,RA,zA,BA=s((()=>{DA(),OA=e=>typeof e==`object`,kA=Object.assign,AA=Object.keys,jA=(e,t)=>{for(let n in e)t(e[n],n)},MA=(e,t)=>{let n=[];for(let r in e)n.push(t(e[r],r));return n},NA=e=>AA(e).length,PA=e=>{for(let t in e)return!1;return!0},FA=(e,t)=>{for(let n in e)if(!t(e[n],n))return!1;return!0},IA=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),LA=(e,t)=>e===t||NA(e)===NA(t)&&FA(e,(e,n)=>(e!==void 0||IA(t,n))&&EA(t[n],e)),RA=Object.freeze,zA=e=>{for(let t in e){let n=e[t];(typeof n==`object`||typeof n==`function`)&&zA(e[t])}return RA(e)}})),VA,HA,UA,WA,GA=s((()=>{BA(),DA(),VA=(e,t,n=0)=>{try{for(;n<e.length;n++)e[n](...t)}finally{n<e.length&&VA(e,t,n+1)}},HA=e=>e,UA=(e,t)=>{if(e===t)return!0;if(e==null||t==null||e.constructor!==t.constructor&&(e.constructor||Object)!==(t.constructor||Object))return!1;if(e[TA]!=null)return e[TA](t);switch(e.constructor){case ArrayBuffer:e=new Uint8Array(e),t=new Uint8Array(t);case Uint8Array:if(e.byteLength!==t.byteLength)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;break;case Set:if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;break;case Map:if(e.size!==t.size)return!1;for(let n of e.keys())if(!t.has(n)||!UA(e.get(n),t.get(n)))return!1;break;case void 0:case Object:if(NA(e)!==NA(t))return!1;for(let n in e)if(!IA(e,n)||!UA(e[n],t[n]))return!1;break;case Array:if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!UA(e[n],t[n]))return!1;break;default:return!1}return!0},WA=(e,t)=>t.includes(e)})),KA,qA,JA,YA,XA,ZA,QA,$A,ej,tj,nj,rj=s((()=>{hO(),$O(),_A(),wA(),GA(),KA=typeof process<`u`&&process.release&&/node|io\.js/.test(process.release.name)&&Object.prototype.toString.call(typeof process<`u`?process:0)===`[object process]`,qA=typeof window<`u`&&typeof document<`u`&&!KA,typeof navigator<`u`&&/Mac/.test(navigator.platform),YA=[],XA=()=>{if(JA===void 0){if(KA){JA=uO();let e=process.argv,t=null;for(let n=0;n<e.length;n++){let r=e[n];r[0]===`-`?(t!==null&&JA.set(t,``),t=r):t===null?YA.push(r):(JA.set(t,r),t=null)}t!==null&&JA.set(t,``)}else typeof location==`object`?(JA=uO(),(location.search||`?`).slice(1).split(`&`).forEach(e=>{if(e.length!==0){let[t,n]=e.split(`=`);JA.set(`--${KO(t,`-`)}`,n),JA.set(`-${KO(t,`-`)}`,n)}})):JA=uO()}return JA},ZA=e=>XA().has(e),QA=e=>gA(KA?process.env[e.toUpperCase().replaceAll(`-`,`_`)]:xA.getItem(e)),$A=e=>ZA(`--`+e)||QA(e)!==null,ej=$A(`production`),tj=KA&&WA(process.env.FORCE_COLOR,[`true`,`1`,`2`]),nj=tj||!ZA(`--no-colors`)&&!$A(`no-color`)&&(!KA||process.stdout.isTTY)&&(!KA||ZA(`--color`)||QA(`COLORTERM`)!==null||(QA(`TERM`)||``).includes(`color`))})),ij,aj,oj,sj,cj,lj,uj,dj,fj,pj=s((()=>{$O(),rj(),ij=e=>new Uint8Array(e),aj=e=>new Uint8Array(e),oj=e=>{let t=``;for(let n=0;n<e.byteLength;n++)t+=VO(e[n]);return btoa(t)},sj=e=>Buffer.from(e.buffer,e.byteOffset,e.byteLength).toString(`base64`),cj=e=>{let t=atob(e),n=ij(t.length);for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e);return n},lj=e=>new Uint8Array(Buffer.from(e,`base64`)),uj=qA?oj:sj,dj=qA?cj:lj,fj=e=>{let t=ij(e.byteLength);return t.set(e),t}})),mj,hj,gj=s((()=>{mj=class{constructor(e,t){this.left=e,this.right=t}},hj=(e,t)=>new mj(e,t)})),_j,vj,yj,bj,xj,Sj,Cj,wj=s((()=>{$O(),FO(),_j=e=>e.next()>=.5,vj=(e,t,n)=>kO(e.next()*(n+1-t)+t),yj=(e,t,n)=>kO(e.next()*(n+1-t)+t),bj=(e,t,n)=>yj(e,t,n),xj=e=>VO(bj(e,97,122)),Sj=(e,t=0,n=20)=>{let r=bj(e,t,n),i=``;for(let t=0;t<r;t++)i+=xj(e);return i},Cj=(e,t)=>t[bj(e,0,t.length-1)]})),Tj,Ej,Dj,Oj,kj,Aj,jj,Mj,Nj,Pj,Fj,Ij,Lj,Rj,zj,Bj,Vj,Hj,Uj,Wj,Gj,Kj,qj,Jj,Yj,Xj,Zj,Qj,$j,eM,tM,nM,rM,iM,aM,oM,sM,cM,lM,uM,dM,fM,pM,mM,hM,gM,_M,vM,yM,bM,xM,SM,CM,wM,TM,EM,DM,OM,kM,AM,jM,MM,NM,PM=s((()=>{BA(),TO(),Nk(),rj(),DA(),GA(),$O(),wj(),BO(),Tj=Symbol(`0schema`),Ej=class{constructor(){this._rerrs=[]}extend(e,t,n,r=null){this._rerrs.push({path:e,expected:t,has:n,message:r})}toString(){let e=[];for(let t=this._rerrs.length-1;t>0;t--){let n=this._rerrs[t];e.push(QO(` `,(this._rerrs.length-t)*2)+`${n.path==null?``:`[${n.path}] `}${n.has} doesn't match ${n.expected}. ${n.message}`)}return e.join(`
1023
+ `)}},Dj=(e,t)=>e===t?!0:e==null||t==null||e.constructor!==t.constructor?!1:e[TA]?EA(e,t):wO(e)?xO(e,e=>SO(t,t=>Dj(e,t))):OA(e)?FA(e,(e,n)=>Dj(e,t[n])):!1,Oj=class{static _dilutes=!1;extends(e){let[t,n]=[this.shape,e.shape];return this.constructor._dilutes&&([n,t]=[t,n]),Dj(t,n)}equals(e){return this.constructor===e.constructor&&UA(this.shape,e.shape)}[Tj](){return!0}[TA](e){return this.equals(e)}validate(e){return this.check(e)}check(e,t){jk()}get nullable(){return uM(this,TM)}get optional(){return new Bj(this)}cast(e){return kM(e,this),e}expect(e){return kM(e,this),e}},kj=class extends Oj{constructor(e,t){super(),this.shape=e,this._c=t}check(e,t=void 0){let n=e?.constructor===this.shape&&(this._c==null||this._c(e));return!n&&t?.extend(null,this.shape.name,e?.constructor.name,e?.constructor===this.shape?`Check failed`:`Constructor match failed`),n}},Aj=(e,t=null)=>new kj(e,t),Aj(kj),jj=class extends Oj{constructor(e){super(),this.shape=e}check(e,t){let n=this.shape(e);return!n&&t?.extend(null,`custom prop`,e?.constructor.name,`failed to check custom prop`),n}},Mj=e=>new jj(e),Aj(jj),Nj=class extends Oj{constructor(e){super(),this.shape=e}check(e,t){let n=this.shape.some(t=>t===e);return!n&&t?.extend(null,this.shape.join(` | `),e.toString()),n}},Pj=(...e)=>new Nj(e),Fj=Aj(Nj),Ij=RegExp.escape||(e=>e.replace(/[().|&,$^[\]]/g,e=>`\\`+e)),Lj=e=>{if(bM.check(e))return[Ij(e)];if(Fj.check(e))return e.shape.map(e=>e+``);if(yM.check(e))return[`[+-]?\\d+.?\\d*`];if(xM.check(e))return[`.*`];if(dM.check(e))return e.shape.map(Lj).flat(1);Mk()},Rj=class extends Oj{constructor(e){super(),this.shape=e,this._r=RegExp(`^`+e.map(Lj).map(e=>`(${e.join(`|`)})`).join(``)+`$`)}check(e,t){let n=this._r.exec(e)!=null;return!n&&t?.extend(null,this._r.toString(),e.toString(),`String doesn't match string template.`),n}},Aj(Rj),zj=Symbol(`optional`),Bj=class extends Oj{constructor(e){super(),this.shape=e}check(e,t){let n=e===void 0||this.shape.check(e);return!n&&t?.extend(null,`undefined (optional)`,`()`),n}get[zj](){return!0}},Vj=Aj(Bj),Hj=class extends Oj{check(e,t){return t?.extend(null,`never`,typeof e),!1}},new Hj,Aj(Hj),Uj=class e extends Oj{constructor(e,t=!1){super(),this.shape=e,this._isPartial=t}static _dilutes=!0;get partial(){return new e(this.shape,!0)}check(e,t){return e==null?(t?.extend(null,`object`,`null`),!1):FA(this.shape,(n,r)=>{let i=this._isPartial&&!IA(e,r)||n.check(e[r],t);return!i&&t?.extend(r.toString(),n.toString(),typeof e[r],`Object property does not match`),i})}},Wj=e=>new Uj(e),Gj=Aj(Uj),Kj=Mj(e=>e!=null&&(e.constructor===Object||e.constructor==null)),qj=class extends Oj{constructor(e,t){super(),this.shape={keys:e,values:t}}check(e,t){return e!=null&&FA(e,(n,r)=>{let i=this.shape.keys.check(r,t);return!i&&t?.extend(r+``,`Record`,typeof e,i?`Key doesn't match schema`:`Value doesn't match value`),i&&this.shape.values.check(n,t)})}},Jj=(e,t)=>new qj(e,t),Yj=Aj(qj),Xj=class extends Oj{constructor(e){super(),this.shape=e}check(e,t){return e!=null&&FA(this.shape,(n,r)=>{let i=n.check(e[r],t);return!i&&t?.extend(r.toString(),`Tuple`,typeof n),i})}},Zj=(...e)=>new Xj(e),Aj(Xj),Qj=class extends Oj{constructor(e){super(),this.shape=e.length===1?e[0]:new lM(e)}check(e,t){let n=wO(e)&&xO(e,e=>this.shape.check(e));return!n&&t?.extend(null,`Array`,``),n}},$j=(...e)=>new Qj(e),eM=Aj(Qj),tM=Mj(e=>wO(e)),nM=class extends Oj{constructor(e,t){super(),this.shape=e,this._c=t}check(e,t){let n=e instanceof this.shape&&(this._c==null||this._c(e));return!n&&t?.extend(null,this.shape.name,e?.constructor.name),n}},rM=(e,t=null)=>new nM(e,t),Aj(nM),iM=rM(Oj),aM=class extends Oj{constructor(e){super(),this.len=e.length-1,this.args=Zj(...e.slice(-1)),this.res=e[this.len]}check(e,t){let n=e.constructor===Function&&e.length<=this.len;return!n&&t?.extend(null,`function`,typeof e),n}},oM=Aj(aM),sM=Mj(e=>typeof e==`function`),cM=class extends Oj{constructor(e){super(),this.shape=e}check(e,t){let n=xO(this.shape,n=>n.check(e,t));return!n&&t?.extend(null,`Intersectinon`,typeof e),n}},Aj(cM,e=>e.shape.length>0),lM=class extends Oj{static _dilutes=!0;constructor(e){super(),this.shape=e}check(e,t){let n=SO(this.shape,n=>n.check(e,t));return t?.extend(null,`Union`,typeof e),n}},uM=(...e)=>e.findIndex(e=>dM.check(e))>=0?uM(...e.map(e=>OM(e)).map(e=>dM.check(e)?e.shape:[e]).flat(1)):e.length===1?e[0]:new lM(e),dM=Aj(lM),fM=()=>!0,pM=Mj(fM),mM=Aj(jj,e=>e.shape===fM),hM=Mj(e=>typeof e==`bigint`),gM=Mj(e=>e===hM),_M=Mj(e=>typeof e==`symbol`),Mj(e=>e===_M),vM=Mj(e=>typeof e==`number`),yM=Mj(e=>e===vM),bM=Mj(e=>typeof e==`string`),xM=Mj(e=>e===bM),SM=Mj(e=>typeof e==`boolean`),CM=Mj(e=>e===SM),wM=Pj(void 0),Aj(Nj,e=>e.shape.length===1&&e.shape[0]===void 0),Pj(void 0),TM=Pj(null),EM=Aj(Nj,e=>e.shape.length===1&&e.shape[0]===null),Aj(Uint8Array),Aj(kj,e=>e.shape===Uint8Array),DM=uM(vM,bM,TM,wM,hM,SM,_M),(()=>{let e=$j(pM),t=Jj(bM,pM),n=uM(vM,bM,TM,SM,e,t);return e.shape=n,t.shape.values=n,n})(),OM=e=>{if(iM.check(e))return e;if(Kj.check(e)){let t={};for(let n in e)t[n]=OM(e[n]);return Wj(t)}if(tM.check(e))return uM(...e.map(OM));if(DM.check(e))return Pj(e);if(sM.check(e))return Aj(e);Mk()},kM=ej?()=>{}:(e,t)=>{let n=new Ej;if(!t.check(e,n))throw Ak(`Expected value to be of type ${t.constructor.name}.\n${n.toString()}`)},AM=class{constructor(e){this.patterns=[],this.$state=e}if(e,t){return this.patterns.push({if:OM(e),h:t}),this}else(e){return this.if(pM,e)}done(){return(e,t)=>{for(let n=0;n<this.patterns.length;n++){let r=this.patterns[n];if(r.if.check(e))return r.h(e,t)}throw Ak(`Unhandled pattern`)}}},jM=e=>new AM(e),MM=jM(pM).if(yM,(e,t)=>vj(t,RO,LO)).if(xM,(e,t)=>Sj(t)).if(CM,(e,t)=>_j(t)).if(gM,(e,t)=>BigInt(vj(t,RO,LO))).if(dM,(e,t)=>NM(t,Cj(t,e.shape))).if(Gj,(e,t)=>{let n={};for(let r in e.shape){let i=e.shape[r];if(Vj.check(i)){if(_j(t))continue;i=i.shape}n[r]=MM(i,t)}return n}).if(eM,(e,t)=>{let n=[],r=yj(t,0,42);for(let i=0;i<r;i++)n.push(NM(t,e.shape));return n}).if(Fj,(e,t)=>Cj(t,e.shape)).if(EM,(e,t)=>null).if(oM,(e,t)=>{let n=NM(t,e.res);return()=>n}).if(mM,(e,t)=>NM(t,Cj(t,[vM,bM,TM,wM,hM,SM,$j(vM),Jj(uM(`a`,`b`,`c`),vM)]))).if(Yj,(e,t)=>{let n={},r=vj(t,0,3);for(let i=0;i<r;i++){let r=NM(t,e.shape.keys);n[r]=NM(t,e.shape.values)}return n}).done(),NM=(e,t)=>MM(OM(t),e)})),FM,IM,LM,RM,zM,BM,VM=s((()=>{hO(),PM(),FM=typeof document<`u`?document:{},Mj(e=>e.nodeType===BM),typeof DOMParser<`u`&&new DOMParser,Mj(e=>e.nodeType===LM),Mj(e=>e.nodeType===RM),IM=e=>pO(e,(e,t)=>`${t}:${e};`).join(``),LM=FM.ELEMENT_NODE,RM=FM.TEXT_NODE,FM.CDATA_SECTION_NODE,FM.COMMENT_NODE,zM=FM.DOCUMENT_NODE,FM.DOCUMENT_TYPE_NODE,BM=FM.DOCUMENT_FRAGMENT_NODE,Mj(e=>e.nodeType===zM)})),HM,UM=s((()=>{HM=Symbol})),WM,GM,KM,qM,JM,YM,XM,ZM,QM,$M,eN=s((()=>{UM(),pA(),WM=HM(),GM=HM(),KM=HM(),qM=HM(),JM=HM(),YM=HM(),XM=HM(),ZM=HM(),QM=HM(),$M=e=>{e.length===1&&e[0]?.constructor===Function&&(e=e[0]());let t=[],n=[],r=0;for(;r<e.length;r++){let n=e[r];if(n===void 0)break;if(n.constructor===String||n.constructor===Number)t.push(n);else if(n.constructor===Object)break}for(r>0&&n.push(t.join(``));r<e.length;r++){let t=e[r];t instanceof Symbol||n.push(t)}return n},fA()})),tN,nN,rN,iN,aN,oN,sN=s((()=>{rj(),_O(),gj(),VM(),hO(),eN(),tN={[WM]:hj(`font-weight`,`bold`),[GM]:hj(`font-weight`,`normal`),[KM]:hj(`color`,`blue`),[JM]:hj(`color`,`green`),[qM]:hj(`color`,`grey`),[YM]:hj(`color`,`red`),[XM]:hj(`color`,`purple`),[ZM]:hj(`color`,`orange`),[QM]:hj(`color`,`black`)},nN=e=>{e.length===1&&e[0]?.constructor===Function&&(e=e[0]());let t=[],n=[],r=uO(),i=[],a=0;for(;a<e.length;a++){let i=e[a],o=tN[i];if(o!==void 0)r.set(o.left,o.right);else{if(i===void 0)break;if(i.constructor===String||i.constructor===Number){let e=IM(r);a>0||e.length>0?(t.push(`%c`+i),n.push(e)):t.push(i)}else break}}for(a>0&&(i=n,i.unshift(t.join(``)));a<e.length;a++){let t=e[a];t instanceof Symbol||i.push(t)}return i},rN=nj?nN:$M,iN=(...e)=>{console.log(...rN(e)),oN.forEach(t=>t.print(e))},aN=(...e)=>{console.warn(...rN(e)),e.unshift(ZM),oN.forEach(t=>t.print(e))},oN=gO()})),cN,lN,uN,dN=s((()=>{cN=e=>({[Symbol.iterator](){return this},next:e}),lN=(e,t)=>cN(()=>{let n;do n=e.next();while(!n.done&&!t(n.value));return n}),uN=(e,t)=>cN(()=>{let{done:n,value:r}=e.next();return{done:n,value:n?void 0:t(r)}})}));function*fN(e){let t=Wk(e.restDecoder);for(let n=0;n<t;n++){let t=Wk(e.restDecoder),n=e.readClient(),r=Wk(e.restDecoder);for(let i=0;i<t;i++){let t=e.readInfo();if(t===10){let t=Wk(e.restDecoder);yield new LI(oP(n,r),t),r+=t}else if(31&t){let i=!(t&192),a=new NI(oP(n,r),null,(t&128)==128?e.readLeftID():null,null,(t&64)==64?e.readRightID():null,i?e.readParentInfo()?e.readString():e.readLeftID():null,i&&(t&32)==32?e.readString():null,PI(e,t));yield a,r+=a.length}else{let t=e.readLen();yield new rI(oP(n,r),t),r+=t}}}}var pN,mN,hN,gN,_N,vN,yN,bN,xN,SN,CN,wN,TN,EN,DN,ON,kN,AN,jN,MN,NN,PN,FN,IN,LN,RN,zN,BN,VN,HN,UN,WN,GN,KN,qN,JN,YN,XN,ZN,QN,$N,eP,tP,nP,rP,iP,aP,oP,sP,cP,lP,uP,dP,fP,pP,mP,hP,gP,_P,vP,yP,bP,xP,SP,CP,wP,TP,EP,DP,OP,kP,AP,jP,MP,NP,PP,FP,IP,LP,RP,zP,BP,VP,HP,UP,WP,GP,KP,qP,JP,YP,XP,ZP,QP,$P,eF,tF,nF,rF,iF,aF,oF,sF,cF,lF,uF,dF,fF,pF,mF,hF,gF,_F,vF,yF,bF,xF,SF,CF,wF,TF,EF,DF,OF,kF,AF,jF,MF,NF,PF,FF,IF,LF,RF,zF,BF,VF,HF,UF,WF,GF,KF,qF,JF,YF,XF,ZF,QF,$F,eI,tI,nI,rI,iI,aI,oI,sI,cI,lI,uI,dI,fI,pI,mI,hI,gI,_I,vI,yI,bI,xI,SI,CI,wI,TI,EI,DI,OI,kI,AI,jI,MI,NI,PI,FI,II,LI,RI,zI,BI=s((()=>{OO(),TO(),FO(),hO(),kk(),aA(),dA(),hA(),pj(),Nk(),IO(),GA(),_O(),sN(),dN(),BA(),rj(),pN=class{constructor(e,t){this.clock=e,this.len=t}},mN=class{constructor(){this.clients=new Map}},hN=(e,t,n)=>t.clients.forEach((t,r)=>{let i=e.doc.store.clients.get(r);if(i!=null){let r=i[i.length-1],a=r.id.clock+r.length;for(let r=0,o=t[r];r<t.length&&o.clock<a;o=t[++r])CP(e,i,o.clock,o.len,n)}}),gN=(e,t)=>{let n=0,r=e.length-1;for(;n<=r;){let i=kO((n+r)/2),a=e[i],o=a.clock;if(o<=t){if(t<o+a.len)return i;n=i+1}else r=i-1}return null},_N=(e,t)=>{let n=e.clients.get(t.client);return n!==void 0&&gN(n,t.clock)!==null},vN=e=>{e.clients.forEach(e=>{e.sort((e,t)=>e.clock-t.clock);let t,n;for(t=1,n=1;t<e.length;t++){let r=e[n-1],i=e[t];r.clock+r.len>=i.clock?e[n-1]=new pN(r.clock,MO(r.len,i.clock+i.len-r.clock)):(n<t&&(e[n]=i),n++)}e.length=n})},yN=e=>{let t=new mN;for(let n=0;n<e.length;n++)e[n].clients.forEach((r,i)=>{if(!t.clients.has(i)){let a=r.slice();for(let t=n+1;t<e.length;t++)yO(a,e[t].clients.get(i)||[]);t.clients.set(i,a)}});return vN(t),t},bN=(e,t,n,r)=>{fO(e.clients,t,()=>[]).push(new pN(n,r))},xN=()=>new mN,SN=e=>{let t=xN();return e.clients.forEach((e,n)=>{let r=[];for(let t=0;t<e.length;t++){let n=e[t];if(n.deleted){let i=n.id.clock,a=n.length;if(t+1<e.length)for(let n=e[t+1];t+1<e.length&&n.deleted;n=e[++t+1])a+=n.length;r.push(new pN(i,a))}}r.length>0&&t.clients.set(n,r)}),t},CN=(e,t)=>{sk(e.restEncoder,t.clients.size),bO(t.clients.entries()).sort((e,t)=>t[0]-e[0]).forEach(([t,n])=>{e.resetDsCurVal(),sk(e.restEncoder,t);let r=n.length;sk(e.restEncoder,r);for(let t=0;t<r;t++){let r=n[t];e.writeDsClock(r.clock),e.writeDsLen(r.len)}})},wN=e=>{let t=new mN,n=Wk(e.restDecoder);for(let r=0;r<n;r++){e.resetDsCurVal();let n=Wk(e.restDecoder),r=Wk(e.restDecoder);if(r>0){let i=fO(t.clients,n,()=>[]);for(let t=0;t<r;t++)i.push(new pN(e.readDsClock(),e.readDsLen()))}}return t},TN=(e,t,n)=>{let r=new mN,i=Wk(e.restDecoder);for(let a=0;a<i;a++){e.resetDsCurVal();let i=Wk(e.restDecoder),a=Wk(e.restDecoder),o=n.clients.get(i)||[],s=mP(n,i);for(let n=0;n<a;n++){let n=e.readDsClock(),a=n+e.readDsLen();if(n<s){s<a&&bN(r,i,s,a-s);let e=gP(o,n),c=o[e];for(!c.deleted&&c.id.clock<n&&(o.splice(e+1,0,MI(t,c,n-c.id.clock)),e++);e<o.length&&(c=o[e++],c.id.clock<a);)c.deleted||(a<c.id.clock+c.length&&o.splice(e,0,MI(t,c,a-c.id.clock)),c.delete(t))}else bN(r,i,n,a-n)}}if(r.clients.size>0){let e=new FN;return sk(e.restEncoder,0),CN(e,r),e.toUint8Array()}return null},EN=cA,DN=class e extends EO{constructor({guid:e=uA(),collectionid:t=null,gc:n=!0,gcFilter:r=()=>!0,meta:i=null,autoLoad:a=!1,shouldLoad:o=!0}={}){super(),this.gc=n,this.gcFilter=r,this.clientID=EN(),this.guid=e,this.collectionid=t,this.share=new Map,this.store=new fP,this._transaction=null,this._transactionCleanups=[],this.subdocs=new Set,this._item=null,this.shouldLoad=o,this.autoLoad=a,this.meta=i,this.isLoaded=!1,this.isSynced=!1,this.isDestroyed=!1,this.whenLoaded=mA(e=>{this.on(`load`,()=>{this.isLoaded=!0,e(this)})});let s=()=>mA(e=>{let t=n=>{(n===void 0||n===!0)&&(this.off(`sync`,t),e())};this.on(`sync`,t)});this.on(`sync`,e=>{e===!1&&this.isSynced&&(this.whenSynced=s()),this.isSynced=e===void 0||e===!0,this.isSynced&&!this.isLoaded&&this.emit(`load`,[this])}),this.whenSynced=s()}load(){let e=this._item;e!==null&&!this.shouldLoad&&jP(e.parent.doc,e=>{e.subdocsLoaded.add(this)},null,!0),this.shouldLoad=!0}getSubdocs(){return this.subdocs}getSubdocGuids(){return new Set(bO(this.subdocs).map(e=>e.guid))}transact(e,t=null){return jP(this,e,t)}get(e,t=nF){let n=fO(this.share,e,()=>{let e=new t;return e._integrate(this,null),e}),r=n.constructor;if(t!==nF&&r!==t){if(r===nF){let r=new t;r._map=n._map,n._map.forEach(e=>{for(;e!==null;e=e.left)e.parent=r}),r._start=n._start;for(let e=r._start;e!==null;e=e.right)e.parent=r;return r._length=n._length,this.share.set(e,r),r._integrate(this,null),r}throw Error(`Type with the name ${e} has already been defined with a different constructor`)}return n}getArray(e=``){return this.get(e,SF)}getText(e=``){return this.get(e,UF)}getMap(e=``){return this.get(e,TF)}getXmlElement(e=``){return this.get(e,JF)}getXmlFragment(e=``){return this.get(e,KF)}toJSON(){let e={};return this.share.forEach((t,n)=>{e[n]=t.toJSON()}),e}destroy(){this.isDestroyed=!0,bO(this.subdocs).forEach(e=>e.destroy());let t=this._item;if(t!==null){this._item=null;let n=t.content;n.doc=new e({guid:this.guid,...n.opts,shouldLoad:!1}),n.doc._item=t,jP(t.parent.doc,e=>{let r=n.doc;t.deleted||e.subdocsAdded.add(r),e.subdocsRemoved.add(this)},null,!0)}this.emit(`destroyed`,[!0]),this.emit(`destroy`,[this]),super.destroy()}},ON=class{constructor(e){this.restDecoder=e}resetDsCurVal(){}readDsClock(){return Wk(this.restDecoder)}readDsLen(){return Wk(this.restDecoder)}},kN=class extends ON{readLeftID(){return oP(Wk(this.restDecoder),Wk(this.restDecoder))}readRightID(){return oP(Wk(this.restDecoder),Wk(this.restDecoder))}readClient(){return Wk(this.restDecoder)}readInfo(){return Uk(this.restDecoder)}readString(){return Jk(this.restDecoder)}readParentInfo(){return Wk(this.restDecoder)===1}readTypeRef(){return Wk(this.restDecoder)}readLen(){return Wk(this.restDecoder)}readAny(){return eA(this.restDecoder)}readBuf(){return fj(Hk(this.restDecoder))}readJSON(){return JSON.parse(Jk(this.restDecoder))}readKey(){return Jk(this.restDecoder)}},AN=class{constructor(e){this.dsCurrVal=0,this.restDecoder=e}resetDsCurVal(){this.dsCurrVal=0}readDsClock(){return this.dsCurrVal+=Wk(this.restDecoder),this.dsCurrVal}readDsLen(){let e=Wk(this.restDecoder)+1;return this.dsCurrVal+=e,e}},jN=class extends AN{constructor(e){super(e),this.keys=[],Wk(e),this.keyClockDecoder=new rA(Hk(e)),this.clientDecoder=new nA(Hk(e)),this.leftClockDecoder=new rA(Hk(e)),this.rightClockDecoder=new rA(Hk(e)),this.infoDecoder=new tA(Hk(e),Uk),this.stringDecoder=new iA(Hk(e)),this.parentInfoDecoder=new tA(Hk(e),Uk),this.typeRefDecoder=new nA(Hk(e)),this.lenDecoder=new nA(Hk(e))}readLeftID(){return new iP(this.clientDecoder.read(),this.leftClockDecoder.read())}readRightID(){return new iP(this.clientDecoder.read(),this.rightClockDecoder.read())}readClient(){return this.clientDecoder.read()}readInfo(){return this.infoDecoder.read()}readString(){return this.stringDecoder.read()}readParentInfo(){return this.parentInfoDecoder.read()===1}readTypeRef(){return this.typeRefDecoder.read()}readLen(){return this.lenDecoder.read()}readAny(){return eA(this.restDecoder)}readBuf(){return Hk(this.restDecoder)}readJSON(){return eA(this.restDecoder)}readKey(){let e=this.keyClockDecoder.read();if(e<this.keys.length)return this.keys[e];{let e=this.stringDecoder.read();return this.keys.push(e),e}}},MN=class{constructor(){this.restEncoder=tk()}toUint8Array(){return rk(this.restEncoder)}resetDsCurVal(){}writeDsClock(e){sk(this.restEncoder,e)}writeDsLen(e){sk(this.restEncoder,e)}},NN=class extends MN{writeLeftID(e){sk(this.restEncoder,e.client),sk(this.restEncoder,e.clock)}writeRightID(e){sk(this.restEncoder,e.client),sk(this.restEncoder,e.clock)}writeClient(e){sk(this.restEncoder,e)}writeInfo(e){ok(this.restEncoder,e)}writeString(e){pk(this.restEncoder,e)}writeParentInfo(e){sk(this.restEncoder,+!!e)}writeTypeRef(e){sk(this.restEncoder,e)}writeLen(e){sk(this.restEncoder,e)}writeAny(e){Sk(this.restEncoder,e)}writeBuf(e){hk(this.restEncoder,e)}writeJSON(e){pk(this.restEncoder,JSON.stringify(e))}writeKey(e){pk(this.restEncoder,e)}},PN=class{constructor(){this.restEncoder=tk(),this.dsCurrVal=0}toUint8Array(){return rk(this.restEncoder)}resetDsCurVal(){this.dsCurrVal=0}writeDsClock(e){let t=e-this.dsCurrVal;this.dsCurrVal=e,sk(this.restEncoder,t)}writeDsLen(e){e===0&&Mk(),sk(this.restEncoder,e-1),this.dsCurrVal+=e}},FN=class extends PN{constructor(){super(),this.keyMap=new Map,this.keyClock=0,this.keyClockEncoder=new Dk,this.clientEncoder=new Tk,this.leftClockEncoder=new Dk,this.rightClockEncoder=new Dk,this.infoEncoder=new Ck(ok),this.stringEncoder=new Ok,this.parentInfoEncoder=new Ck(ok),this.typeRefEncoder=new Tk,this.lenEncoder=new Tk}toUint8Array(){let e=tk();return sk(e,0),hk(e,this.keyClockEncoder.toUint8Array()),hk(e,this.clientEncoder.toUint8Array()),hk(e,this.leftClockEncoder.toUint8Array()),hk(e,this.rightClockEncoder.toUint8Array()),hk(e,rk(this.infoEncoder)),hk(e,this.stringEncoder.toUint8Array()),hk(e,rk(this.parentInfoEncoder)),hk(e,this.typeRefEncoder.toUint8Array()),hk(e,this.lenEncoder.toUint8Array()),mk(e,rk(this.restEncoder)),rk(e)}writeLeftID(e){this.clientEncoder.write(e.client),this.leftClockEncoder.write(e.clock)}writeRightID(e){this.clientEncoder.write(e.client),this.rightClockEncoder.write(e.clock)}writeClient(e){this.clientEncoder.write(e)}writeInfo(e){this.infoEncoder.write(e)}writeString(e){this.stringEncoder.write(e)}writeParentInfo(e){this.parentInfoEncoder.write(+!!e)}writeTypeRef(e){this.typeRefEncoder.write(e)}writeLen(e){this.lenEncoder.write(e)}writeAny(e){Sk(this.restEncoder,e)}writeBuf(e){hk(this.restEncoder,e)}writeJSON(e){Sk(this.restEncoder,e)}writeKey(e){let t=this.keyMap.get(e);t===void 0?(this.keyClockEncoder.write(this.keyClock++),this.stringEncoder.write(e)):this.keyClockEncoder.write(t)}},IN=(e,t,n,r)=>{r=MO(r,t[0].id.clock);let i=gP(t,r);sk(e.restEncoder,t.length-i),e.writeClient(n),sk(e.restEncoder,r);let a=t[i];a.write(e,r-a.id.clock);for(let n=i+1;n<t.length;n++)t[n].write(e,0)},LN=(e,t,n)=>{let r=new Map;n.forEach((e,n)=>{mP(t,n)>e&&r.set(n,e)}),pP(t).forEach((e,t)=>{n.has(t)||r.set(t,0)}),sk(e.restEncoder,r.size),bO(r.entries()).sort((e,t)=>t[0]-e[0]).forEach(([n,r])=>{IN(e,t.clients.get(n),n,r)})},RN=(e,t)=>{let n=uO(),r=Wk(e.restDecoder);for(let i=0;i<r;i++){let r=Wk(e.restDecoder),i=Array(r),a=e.readClient(),o=Wk(e.restDecoder);n.set(a,{i:0,refs:i});for(let n=0;n<r;n++){let r=e.readInfo();switch(31&r){case 0:{let t=e.readLen();i[n]=new rI(oP(a,o),t),o+=t;break}case 10:{let t=Wk(e.restDecoder);i[n]=new LI(oP(a,o),t),o+=t;break}default:{let s=!(r&192),c=new NI(oP(a,o),null,(r&128)==128?e.readLeftID():null,null,(r&64)==64?e.readRightID():null,s?e.readParentInfo()?t.get(e.readString()):e.readLeftID():null,s&&(r&32)==32?e.readString():null,PI(e,r));i[n]=c,o+=c.length}}}}return n},zN=(e,t,n)=>{let r=[],i=bO(n.keys()).sort((e,t)=>e-t);if(i.length===0)return null;let a=()=>{if(i.length===0)return null;let e=n.get(i[i.length-1]);for(;e.refs.length===e.i;)if(i.pop(),i.length>0)e=n.get(i[i.length-1]);else return null;return e},o=a();if(o===null)return null;let s=new fP,c=new Map,l=(e,t)=>{let n=c.get(e);(n==null||n>t)&&c.set(e,t)},u=o.refs[o.i++],d=new Map,f=()=>{for(let e of r){let t=e.id.client,r=n.get(t);r?(r.i--,s.clients.set(t,r.refs.slice(r.i)),n.delete(t),r.i=0,r.refs=[]):s.clients.set(t,[e]),i=i.filter(e=>e!==t)}r.length=0};for(;;){if(u.constructor!==LI){let i=fO(d,u.id.client,()=>mP(t,u.id.client))-u.id.clock;if(i<0)r.push(u),l(u.id.client,u.id.clock-1),f();else{let a=u.getMissing(e,t);if(a!==null){r.push(u);let e=n.get(a)||{refs:[],i:0};if(e.refs.length===e.i)l(a,mP(t,a)),f();else{u=e.refs[e.i++];continue}}else(i===0||i<u.length)&&(u.integrate(e,i),d.set(u.id.client,u.id.clock+u.length))}}if(r.length>0)u=r.pop();else if(o!==null&&o.i<o.refs.length)u=o.refs[o.i++];else{if(o=a(),o===null)break;u=o.refs[o.i++]}}if(s.clients.size>0){let e=new FN;return LN(e,s,new Map),sk(e.restEncoder,0),{missing:c,update:e.toUint8Array()}}return null},BN=(e,t)=>LN(e,t.doc.store,t.beforeState),VN=(e,t,n,r=new jN(e))=>jP(t,e=>{e.local=!1;let t=!1,n=e.doc,i=n.store,a=RN(r,n),o=zN(e,i,a),s=i.pendingStructs;if(s){for(let[e,n]of s.missing)if(n<mP(i,e)){t=!0;break}if(o){for(let[e,t]of o.missing){let n=s.missing.get(e);(n==null||n>t)&&s.missing.set(e,t)}s.update=IP([s.update,o.update])}}else i.pendingStructs=o;let c=TN(r,e,i);if(i.pendingDs){let t=new jN(zk(i.pendingDs));Wk(t.restDecoder);let n=TN(t,e,i);i.pendingDs=c&&n?IP([c,n]):c||n}else i.pendingDs=c;if(t){let t=i.pendingStructs.update;i.pendingStructs=null,HN(e.doc,t)}},n,!1),HN=(e,t,n,r=jN)=>{let i=zk(t);VN(i,e,n,new r(i))},UN=(e,t,n)=>HN(e,t,n,kN),WN=(e,t,n=new Map)=>{LN(e,t.store,n),CN(e,SN(t.store))},GN=(e,t=new Uint8Array([0]),n=new FN)=>{let r=JN(t);WN(n,e,r);let i=[n.toUint8Array()];if(e.store.pendingDs&&i.push(e.store.pendingDs),e.store.pendingStructs&&i.push(LP(e.store.pendingStructs.update,t)),i.length>1){if(n.constructor===NN)return PP(i.map((e,t)=>t===0?e:HP(e)));if(n.constructor===FN)return IP(i)}return i[0]},KN=(e,t)=>GN(e,t,new NN),qN=e=>{let t=new Map,n=Wk(e.restDecoder);for(let r=0;r<n;r++){let n=Wk(e.restDecoder),r=Wk(e.restDecoder);t.set(n,r)}return t},JN=e=>qN(new ON(zk(e))),YN=(e,t)=>(sk(e.restEncoder,t.size),bO(t.entries()).sort((e,t)=>t[0]-e[0]).forEach(([t,n])=>{sk(e.restEncoder,t),sk(e.restEncoder,n)}),e),XN=(e,t)=>YN(e,pP(t.store)),ZN=(e,t=new PN)=>(e instanceof Map?YN(t,e):XN(t,e),t.toUint8Array()),QN=e=>ZN(e,new MN),$N=class{constructor(){this.l=[]}},eP=()=>new $N,tP=(e,t)=>e.l.push(t),nP=(e,t)=>{let n=e.l,r=n.length;e.l=n.filter(e=>t!==e),r===e.l.length&&console.error(`[yjs] Tried to remove event handler that doesn't exist.`)},rP=(e,t,n)=>VA(e.l,[t,n]),iP=class{constructor(e,t){this.client=e,this.clock=t}},aP=(e,t)=>e===t||e!==null&&t!==null&&e.client===t.client&&e.clock===t.clock,oP=(e,t)=>new iP(e,t),sP=e=>{for(let[t,n]of e.doc.share.entries())if(n===e)return t;throw Mk()},cP=class{constructor(e,t){this.ds=e,this.sv=t}},lP=(e,t)=>new cP(e,t),lP(xN(),new Map),uP=(e,t)=>t===void 0?!e.deleted:t.sv.has(e.id.client)&&(t.sv.get(e.id.client)||0)>e.id.clock&&!_N(t.ds,e.id),dP=(e,t)=>{let n=fO(e.meta,dP,gO),r=e.doc.store;n.has(t)||(t.sv.forEach((t,n)=>{t<mP(r,n)&&bP(e,oP(n,t))}),hN(e,t.ds,e=>{}),n.add(t))},fP=class{constructor(){this.clients=new Map,this.pendingStructs=null,this.pendingDs=null}},pP=e=>{let t=new Map;return e.clients.forEach((e,n)=>{let r=e[e.length-1];t.set(n,r.id.clock+r.length)}),t},mP=(e,t)=>{let n=e.clients.get(t);if(n===void 0)return 0;let r=n[n.length-1];return r.id.clock+r.length},hP=(e,t)=>{let n=e.clients.get(t.id.client);if(n===void 0)n=[],e.clients.set(t.id.client,n);else{let e=n[n.length-1];if(e.id.clock+e.length!==t.id.clock)throw Mk()}n.push(t)},gP=(e,t)=>{let n=0,r=e.length-1,i=e[r],a=i.id.clock;if(a===t)return r;let o=kO(t/(a+i.length-1)*r);for(;n<=r;){if(i=e[o],a=i.id.clock,a<=t){if(t<a+i.length)return o;n=o+1}else r=o-1;o=kO((n+r)/2)}throw Mk()},_P=(e,t)=>{let n=e.clients.get(t.client);return n[gP(n,t.clock)]},vP=_P,yP=(e,t,n)=>{let r=gP(t,n),i=t[r];return i.id.clock<n&&i instanceof NI?(t.splice(r+1,0,MI(e,i,n-i.id.clock)),r+1):r},bP=(e,t)=>{let n=e.doc.store.clients.get(t.client);return n[yP(e,n,t.clock)]},xP=(e,t,n)=>{let r=t.clients.get(n.client),i=gP(r,n.clock),a=r[i];return n.clock!==a.id.clock+a.length-1&&a.constructor!==rI&&r.splice(i+1,0,MI(e,a,n.clock-a.id.clock+1)),a},SP=(e,t,n)=>{let r=e.clients.get(t.id.client);r[gP(r,t.id.clock)]=n},CP=(e,t,n,r,i)=>{if(r===0)return;let a=n+r,o=yP(e,t,n),s;do s=t[o++],a<s.id.clock+s.length&&yP(e,t,a),i(s);while(o<t.length&&t[o].id.clock<a)},wP=class{constructor(e,t,n){this.doc=e,this.deleteSet=new mN,this.beforeState=pP(e.store),this.afterState=new Map,this.changed=new Map,this.changedParentTypes=new Map,this._mergeStructs=[],this.origin=t,this.meta=new Map,this.local=n,this.subdocsAdded=new Set,this.subdocsRemoved=new Set,this.subdocsLoaded=new Set,this._needFormattingCleanup=!1}},TP=(e,t)=>t.deleteSet.clients.size===0&&!mO(t.afterState,(e,n)=>t.beforeState.get(n)!==e)?!1:(vN(t.deleteSet),BN(e,t),CN(e,t.deleteSet),!0),EP=(e,t,n)=>{let r=t._item;(r===null||r.id.clock<(e.beforeState.get(r.id.client)||0)&&!r.deleted)&&fO(e.changed,t,gO).add(n)},DP=(e,t)=>{let n=e[t],r=e[t-1],i=t;for(;i>0&&r.deleted===n.deleted&&r.constructor===n.constructor&&r.mergeWith(n);n=r,r=e[--i-1])n instanceof NI&&n.parentSub!==null&&n.parent._map.get(n.parentSub)===n&&n.parent._map.set(n.parentSub,r);let a=t-i;return a&&e.splice(t+1-a,a),a},OP=(e,t,n)=>{for(let[r,i]of e.clients.entries()){let e=t.clients.get(r);for(let r=i.length-1;r>=0;r--){let a=i[r],o=a.clock+a.len;for(let r=gP(e,a.clock),i=e[r];r<e.length&&i.id.clock<o;i=e[++r]){let i=e[r];if(a.clock+a.len<=i.id.clock)break;i instanceof NI&&i.deleted&&!i.keep&&n(i)&&i.gc(t,!1)}}}},kP=(e,t)=>{e.clients.forEach((e,n)=>{let r=t.clients.get(n);for(let t=e.length-1;t>=0;t--){let n=e[t],i=jO(r.length-1,1+gP(r,n.clock+n.len-1));for(let e=i,t=r[e];e>0&&t.id.clock>=n.clock;t=r[e])e-=1+DP(r,e)}})},AP=(e,t)=>{if(t<e.length){let n=e[t],r=n.doc,i=r.store,a=n.deleteSet,o=n._mergeStructs;try{vN(a),n.afterState=pP(n.doc.store),r.emit(`beforeObserverCalls`,[n,r]);let e=[];n.changed.forEach((t,r)=>e.push(()=>{r._item!==null&&r._item.deleted||r._callObserver(n,t)})),e.push(()=>{n.changedParentTypes.forEach((t,r)=>{r._dEH.l.length>0&&(r._item===null||!r._item.deleted)&&e.push(()=>{t=t.filter(e=>e.target._item===null||!e.target._item.deleted),t.forEach(e=>{e.currentTarget=r,e._path=null}),t.sort((e,t)=>e.path.length-t.path.length),rP(r._dEH,t,n)})}),e.push(()=>r.emit(`afterTransaction`,[n,r])),e.push(()=>{n._needFormattingCleanup&&BF(n)})}),VA(e,[])}finally{r.gc&&OP(a,i,r.gcFilter),kP(a,i),n.afterState.forEach((e,t)=>{let r=n.beforeState.get(t)||0;if(r!==e){let e=i.clients.get(t),n=MO(gP(e,r),1);for(let t=e.length-1;t>=n;)t-=1+DP(e,t)}});for(let e=o.length-1;e>=0;e--){let{client:t,clock:n}=o[e].id,r=i.clients.get(t),a=gP(r,n);a+1<r.length&&DP(r,a+1)>1||a>0&&DP(r,a)}if(!n.local&&n.afterState.get(r.clientID)!==n.beforeState.get(r.clientID)&&(iN(ZM,WM,`[yjs] `,GM,YM,`Changed the client-id because another client seems to be using it.`),r.clientID=EN()),r.emit(`afterTransactionCleanup`,[n,r]),r._observers.has(`update`)){let e=new NN;TP(e,n)&&r.emit(`update`,[e.toUint8Array(),n.origin,r,n])}if(r._observers.has(`updateV2`)){let e=new FN;TP(e,n)&&r.emit(`updateV2`,[e.toUint8Array(),n.origin,r,n])}let{subdocsAdded:s,subdocsLoaded:c,subdocsRemoved:l}=n;(s.size>0||l.size>0||c.size>0)&&(s.forEach(e=>{e.clientID=r.clientID,e.collectionid??=r.collectionid,r.subdocs.add(e)}),l.forEach(e=>r.subdocs.delete(e)),r.emit(`subdocs`,[{loaded:c,added:s,removed:l},r,n]),l.forEach(e=>e.destroy())),e.length<=t+1?(r._transactionCleanups=[],r.emit(`afterAllTransactions`,[r,e])):AP(e,t+1)}}},jP=(e,t,n=null,r=!0)=>{let i=e._transactionCleanups,a=!1,o=null;e._transaction===null&&(a=!0,e._transaction=new wP(e,n,r),i.push(e._transaction),i.length===1&&e.emit(`beforeAllTransactions`,[e]),e.emit(`beforeTransaction`,[e._transaction,e]));try{o=t(e._transaction)}finally{if(a){let t=e._transaction===i[0];e._transaction=null,t&&AP(i,0)}}return o},MP=class{constructor(e,t){this.gen=fN(e),this.curr=null,this.done=!1,this.filterSkips=t,this.next()}next(){do this.curr=this.gen.next().value||null;while(this.filterSkips&&this.curr!==null&&this.curr.constructor===LI);return this.curr}},NP=class{constructor(e){this.currClient=0,this.startClock=0,this.written=0,this.encoder=e,this.clientStructs=[]}},PP=e=>IP(e,kN,NN),FP=(e,t)=>{if(e.constructor===rI){let{client:n,clock:r}=e.id;return new rI(oP(n,r+t),e.length-t)}if(e.constructor===LI){let{client:n,clock:r}=e.id;return new LI(oP(n,r+t),e.length-t)}{let n=e,{client:r,clock:i}=n.id;return new NI(oP(r,i+t),null,oP(r,i+t-1),null,n.rightOrigin,n.parent,n.parentSub,n.content.splice(t))}},IP=(e,t=jN,n=FN)=>{if(e.length===1)return e[0];let r=e.map(e=>new t(zk(e))),i=r.map(e=>new MP(e,!0)),a=null,o=new n,s=new NP(o);for(;i=i.filter(e=>e.curr!==null),i.sort((e,t)=>{if(e.curr.id.client===t.curr.id.client){let n=e.curr.id.clock-t.curr.id.clock;return n===0?e.curr.constructor===t.curr.constructor?0:e.curr.constructor===LI?1:-1:n}return t.curr.id.client-e.curr.id.client}),i.length!==0;){let e=i[0],t=e.curr.id.client;if(a!==null){let n=e.curr,r=!1;for(;n!==null&&n.id.clock+n.length<=a.struct.id.clock+a.struct.length&&n.id.client>=a.struct.id.client;)n=e.next(),r=!0;if(n===null||n.id.client!==t||r&&n.id.clock>a.struct.id.clock+a.struct.length)continue;if(t!==a.struct.id.client)zP(s,a.struct,a.offset),a={struct:n,offset:0},e.next();else if(a.struct.id.clock+a.struct.length<n.id.clock){if(a.struct.constructor===LI)a.struct.length=n.id.clock+n.length-a.struct.id.clock;else{zP(s,a.struct,a.offset);let e=n.id.clock-a.struct.id.clock-a.struct.length;a={struct:new LI(oP(t,a.struct.id.clock+a.struct.length),e),offset:0}}}else{let t=a.struct.id.clock+a.struct.length-n.id.clock;t>0&&(a.struct.constructor===LI?a.struct.length-=t:n=FP(n,t)),a.struct.mergeWith(n)||(zP(s,a.struct,a.offset),a={struct:n,offset:0},e.next())}}else a={struct:e.curr,offset:0},e.next();for(let n=e.curr;n!==null&&n.id.client===t&&n.id.clock===a.struct.id.clock+a.struct.length&&n.constructor!==LI;n=e.next())zP(s,a.struct,a.offset),a={struct:n,offset:0}}a!==null&&(zP(s,a.struct,a.offset),a=null),BP(s);let c=r.map(e=>wN(e)),l=yN(c);return CN(o,l),o.toUint8Array()},LP=(e,t,n=jN,r=FN)=>{let i=JN(t),a=new r,o=new NP(a),s=new n(zk(e)),c=new MP(s,!1);for(;c.curr;){let e=c.curr,t=e.id.client,n=i.get(t)||0;if(c.curr.constructor===LI)c.next();else if(e.id.clock+e.length>n)for(zP(o,e,MO(n-e.id.clock,0)),c.next();c.curr&&c.curr.id.client===t;)zP(o,c.curr,0),c.next();else for(;c.curr&&c.curr.id.client===t&&c.curr.id.clock+c.curr.length<=n;)c.next()}BP(o);let l=wN(s);return CN(a,l),a.toUint8Array()},RP=e=>{e.written>0&&(e.clientStructs.push({written:e.written,restEncoder:rk(e.encoder.restEncoder)}),e.encoder.restEncoder=tk(),e.written=0)},zP=(e,t,n)=>{e.written>0&&e.currClient!==t.id.client&&RP(e),e.written===0&&(e.currClient=t.id.client,e.encoder.writeClient(t.id.client),sk(e.encoder.restEncoder,t.id.clock+n)),t.write(e.encoder,n),e.written++},BP=e=>{RP(e);let t=e.encoder.restEncoder;sk(t,e.clientStructs.length);for(let n=0;n<e.clientStructs.length;n++){let r=e.clientStructs[n];sk(t,r.written),mk(t,r.restEncoder)}},VP=(e,t,n,r)=>{let i=new n(zk(e)),a=new MP(i,!1),o=new r,s=new NP(o);for(let e=a.curr;e!==null;e=a.next())zP(s,t(e),0);BP(s);let c=wN(i);return CN(o,c),o.toUint8Array()},HP=e=>VP(e,HA,jN,NN),UP=`You must not compute changes after the event-handler fired.`,WP=class{constructor(e,t){this.target=e,this.currentTarget=e,this.transaction=t,this._changes=null,this._keys=null,this._delta=null,this._path=null}get path(){return this._path||=GP(this.currentTarget,this.target)}deletes(e){return _N(this.transaction.deleteSet,e.id)}get keys(){if(this._keys===null){if(this.transaction.doc._transactionCleanups.length===0)throw Ak(UP);let e=new Map,t=this.target;this.transaction.changed.get(t).forEach(n=>{if(n!==null){let r=t._map.get(n),i,a;if(this.adds(r)){let e=r.left;for(;e!==null&&this.adds(e);)e=e.left;if(this.deletes(r)){if(e!==null&&this.deletes(e))i=`delete`,a=vO(e.content.getContent());else return}else e!==null&&this.deletes(e)?(i=`update`,a=vO(e.content.getContent())):(i=`add`,a=void 0)}else if(this.deletes(r))i=`delete`,a=vO(r.content.getContent());else return;e.set(n,{action:i,oldValue:a})}}),this._keys=e}return this._keys}get delta(){return this.changes.delta}adds(e){return e.id.clock>=(this.transaction.beforeState.get(e.id.client)||0)}get changes(){let e=this._changes;if(e===null){if(this.transaction.doc._transactionCleanups.length===0)throw Ak(UP);let t=this.target,n=gO(),r=gO(),i=[];if(e={added:n,deleted:r,delta:i,keys:this.keys},this.transaction.changed.get(t).has(null)){let e=null,a=()=>{e&&i.push(e)};for(let i=t._start;i!==null;i=i.right)i.deleted?this.deletes(i)&&!this.adds(i)&&((e===null||e.delete===void 0)&&(a(),e={delete:0}),e.delete+=i.length,r.add(i)):this.adds(i)?((e===null||e.insert===void 0)&&(a(),e={insert:[]}),e.insert=e.insert.concat(i.content.getContent()),n.add(i)):((e===null||e.retain===void 0)&&(a(),e={retain:0}),e.retain+=i.length);e!==null&&e.retain===void 0&&a()}this._changes=e}return e}},GP=(e,t)=>{let n=[];for(;t._item!==null&&t!==e;){if(t._item.parentSub!==null)n.unshift(t._item.parentSub);else{let e=0,r=t._item.parent._start;for(;r!==t._item&&r!==null;)!r.deleted&&r.countable&&(e+=r.length),r=r.right;n.unshift(e)}t=t._item.parent}return n},KP=()=>{aN(`Invalid access: Add Yjs type to a document before reading data.`)},qP=80,JP=0,YP=class{constructor(e,t){e.marker=!0,this.p=e,this.index=t,this.timestamp=JP++}},XP=e=>{e.timestamp=JP++},ZP=(e,t,n)=>{e.p.marker=!1,e.p=t,t.marker=!0,e.index=n,e.timestamp=JP++},QP=(e,t,n)=>{if(e.length>=qP){let r=e.reduce((e,t)=>e.timestamp<t.timestamp?e:t);return ZP(r,t,n),r}{let r=new YP(t,n);return e.push(r),r}},$P=(e,t)=>{if(e._start===null||t===0||e._searchMarker===null)return null;let n=e._searchMarker.length===0?null:e._searchMarker.reduce((e,n)=>AO(t-e.index)<AO(t-n.index)?e:n),r=e._start,i=0;for(n!==null&&(r=n.p,i=n.index,XP(n));r.right!==null&&i<t;){if(!r.deleted&&r.countable){if(t<i+r.length)break;i+=r.length}r=r.right}for(;r.left!==null&&i>t;)r=r.left,!r.deleted&&r.countable&&(i-=r.length);for(;r.left!==null&&r.left.id.client===r.id.client&&r.left.id.clock+r.left.length===r.id.clock;)r=r.left,!r.deleted&&r.countable&&(i-=r.length);return n!==null&&AO(n.index-i)<r.parent.length/qP?(ZP(n,r,i),n):QP(e._searchMarker,r,i)},eF=(e,t,n)=>{for(let r=e.length-1;r>=0;r--){let i=e[r];if(n>0){let t=i.p;for(t.marker=!1;t&&(t.deleted||!t.countable);)t=t.left,t&&!t.deleted&&t.countable&&(i.index-=t.length);if(t===null||t.marker===!0){e.splice(r,1);continue}i.p=t,t.marker=!0}(t<i.index||n>0&&t===i.index)&&(i.index=MO(t,i.index+n))}},tF=(e,t,n)=>{let r=e,i=t.changedParentTypes;for(;fO(i,e,()=>[]).push(n),e._item!==null;)e=e._item.parent;rP(r._eH,n,t)},nF=class{constructor(){this._item=null,this._map=new Map,this._start=null,this.doc=null,this._length=0,this._eH=eP(),this._dEH=eP(),this._searchMarker=null}get parent(){return this._item?this._item.parent:null}_integrate(e,t){this.doc=e,this._item=t}_copy(){throw jk()}clone(){throw jk()}_write(e){}get _first(){let e=this._start;for(;e!==null&&e.deleted;)e=e.right;return e}_callObserver(e,t){!e.local&&this._searchMarker&&(this._searchMarker.length=0)}observe(e){tP(this._eH,e)}observeDeep(e){tP(this._dEH,e)}unobserve(e){nP(this._eH,e)}unobserveDeep(e){nP(this._dEH,e)}toJSON(){}},rF=(e,t,n)=>{e.doc??KP(),t<0&&(t=e._length+t),n<0&&(n=e._length+n);let r=n-t,i=[],a=e._start;for(;a!==null&&r>0;){if(a.countable&&!a.deleted){let e=a.content.getContent();if(e.length<=t)t-=e.length;else{for(let n=t;n<e.length&&r>0;n++)i.push(e[n]),r--;t=0}}a=a.right}return i},iF=e=>{e.doc??KP();let t=[],n=e._start;for(;n!==null;){if(n.countable&&!n.deleted){let e=n.content.getContent();for(let n=0;n<e.length;n++)t.push(e[n])}n=n.right}return t},aF=(e,t)=>{let n=0,r=e._start;for(e.doc??KP();r!==null;){if(r.countable&&!r.deleted){let i=r.content.getContent();for(let r=0;r<i.length;r++)t(i[r],n++,e)}r=r.right}},oF=(e,t)=>{let n=[];return aF(e,(r,i)=>{n.push(t(r,i,e))}),n},sF=e=>{let t=e._start,n=null,r=0;return{[Symbol.iterator](){return this},next:()=>{if(n===null){for(;t!==null&&t.deleted;)t=t.right;if(t===null)return{done:!0,value:void 0};n=t.content.getContent(),r=0,t=t.right}let e=n[r++];return n.length<=r&&(n=null),{done:!1,value:e}}}},cF=(e,t)=>{e.doc??KP();let n=$P(e,t),r=e._start;for(n!==null&&(r=n.p,t-=n.index);r!==null;r=r.right)if(!r.deleted&&r.countable){if(t<r.length)return r.content.getContent()[t];t-=r.length}},lF=(e,t,n,r)=>{let i=n,a=e.doc,o=a.clientID,s=a.store,c=n===null?t._start:n.right,l=[],u=()=>{l.length>0&&(i=new NI(oP(o,mP(s,o)),i,i&&i.lastId,c,c&&c.id,t,null,new vI(l)),i.integrate(e,0),l=[])};r.forEach(n=>{if(n===null)l.push(n);else switch(n.constructor){case Number:case Object:case Boolean:case Array:case String:l.push(n);break;default:switch(u(),n.constructor){case Uint8Array:case ArrayBuffer:i=new NI(oP(o,mP(s,o)),i,i&&i.lastId,c,c&&c.id,t,null,new iI(new Uint8Array(n))),i.integrate(e,0);break;case DN:i=new NI(oP(o,mP(s,o)),i,i&&i.lastId,c,c&&c.id,t,null,new lI(n)),i.integrate(e,0);break;default:if(n instanceof nF)i=new NI(oP(o,mP(s,o)),i,i&&i.lastId,c,c&&c.id,t,null,new AI(n)),i.integrate(e,0);else throw Error(`Unexpected content type in insert operation`)}}}),u()},uF=()=>Ak(`Length exceeded!`),dF=(e,t,n,r)=>{if(n>t._length)throw uF();if(n===0)return t._searchMarker&&eF(t._searchMarker,n,r.length),lF(e,t,null,r);let i=n,a=$P(t,n),o=t._start;for(a!==null&&(o=a.p,n-=a.index,n===0&&(o=o.prev,n+=o&&o.countable&&!o.deleted?o.length:0));o!==null;o=o.right)if(!o.deleted&&o.countable){if(n<=o.length){n<o.length&&bP(e,oP(o.id.client,o.id.clock+n));break}n-=o.length}return t._searchMarker&&eF(t._searchMarker,i,r.length),lF(e,t,o,r)},fF=(e,t,n)=>{let r=(t._searchMarker||[]).reduce((e,t)=>t.index>e.index?t:e,{index:0,p:t._start}).p;if(r)for(;r.right;)r=r.right;return lF(e,t,r,n)},pF=(e,t,n,r)=>{if(r===0)return;let i=n,a=r,o=$P(t,n),s=t._start;for(o!==null&&(s=o.p,n-=o.index);s!==null&&n>0;s=s.right)!s.deleted&&s.countable&&(n<s.length&&bP(e,oP(s.id.client,s.id.clock+n)),n-=s.length);for(;r>0&&s!==null;)s.deleted||(r<s.length&&bP(e,oP(s.id.client,s.id.clock+r)),s.delete(e),r-=s.length),s=s.right;if(r>0)throw uF();t._searchMarker&&eF(t._searchMarker,i,-a+r)},mF=(e,t,n)=>{let r=t._map.get(n);r!==void 0&&r.delete(e)},hF=(e,t,n,r)=>{let i=t._map.get(n)||null,a=e.doc,o=a.clientID,s;if(r==null)s=new vI([r]);else switch(r.constructor){case Number:case Object:case Boolean:case Array:case String:case Date:case BigInt:s=new vI([r]);break;case Uint8Array:s=new iI(r);break;case DN:s=new lI(r);break;default:if(r instanceof nF)s=new AI(r);else throw Error(`Unexpected content type`)}new NI(oP(o,mP(a.store,o)),i,i&&i.lastId,null,null,t,n,s).integrate(e,0)},gF=(e,t)=>{e.doc??KP();let n=e._map.get(t);return n!==void 0&&!n.deleted?n.content.getContent()[n.length-1]:void 0},_F=e=>{let t={};return e.doc??KP(),e._map.forEach((e,n)=>{e.deleted||(t[n]=e.content.getContent()[e.length-1])}),t},vF=(e,t)=>{e.doc??KP();let n=e._map.get(t);return n!==void 0&&!n.deleted},yF=(e,t)=>{let n={};return e._map.forEach((e,r)=>{let i=e;for(;i!==null&&(!t.sv.has(i.id.client)||i.id.clock>=(t.sv.get(i.id.client)||0));)i=i.left;i!==null&&uP(i,t)&&(n[r]=i.content.getContent()[i.length-1])}),n},bF=e=>(e.doc??KP(),lN(e._map.entries(),e=>!e[1].deleted)),xF=class extends WP{},SF=class e extends nF{constructor(){super(),this._prelimContent=[],this._searchMarker=[]}static from(t){let n=new e;return n.push(t),n}_integrate(e,t){super._integrate(e,t),this.insert(0,this._prelimContent),this._prelimContent=null}_copy(){return new e}clone(){let t=new e;return t.insert(0,this.toArray().map(e=>e instanceof nF?e.clone():e)),t}get length(){return this.doc??KP(),this._length}_callObserver(e,t){super._callObserver(e,t),tF(this,e,new xF(this,e))}insert(e,t){this.doc===null?this._prelimContent.splice(e,0,...t):jP(this.doc,n=>{dF(n,this,e,t)})}push(e){this.doc===null?this._prelimContent.push(...e):jP(this.doc,t=>{fF(t,this,e)})}unshift(e){this.insert(0,e)}delete(e,t=1){this.doc===null?this._prelimContent.splice(e,t):jP(this.doc,n=>{pF(n,this,e,t)})}get(e){return cF(this,e)}toArray(){return iF(this)}slice(e=0,t=this.length){return rF(this,e,t)}toJSON(){return this.map(e=>e instanceof nF?e.toJSON():e)}map(e){return oF(this,e)}forEach(e){aF(this,e)}[Symbol.iterator](){return sF(this)}_write(e){e.writeTypeRef(CI)}},CF=e=>new SF,wF=class extends WP{constructor(e,t,n){super(e,t),this.keysChanged=n}},TF=class e extends nF{constructor(e){super(),this._prelimContent=null,this._prelimContent=e===void 0?new Map:new Map(e)}_integrate(e,t){super._integrate(e,t),this._prelimContent.forEach((e,t)=>{this.set(t,e)}),this._prelimContent=null}_copy(){return new e}clone(){let t=new e;return this.forEach((e,n)=>{t.set(n,e instanceof nF?e.clone():e)}),t}_callObserver(e,t){tF(this,e,new wF(this,e,t))}toJSON(){this.doc??KP();let e={};return this._map.forEach((t,n)=>{if(!t.deleted){let r=t.content.getContent()[t.length-1];e[n]=r instanceof nF?r.toJSON():r}}),e}get size(){return[...bF(this)].length}keys(){return uN(bF(this),e=>e[0])}values(){return uN(bF(this),e=>e[1].content.getContent()[e[1].length-1])}entries(){return uN(bF(this),e=>[e[0],e[1].content.getContent()[e[1].length-1]])}forEach(e){this.doc??KP(),this._map.forEach((t,n)=>{t.deleted||e(t.content.getContent()[t.length-1],n,this)})}[Symbol.iterator](){return this.entries()}delete(e){this.doc===null?this._prelimContent.delete(e):jP(this.doc,t=>{mF(t,this,e)})}set(e,t){return this.doc===null?this._prelimContent.set(e,t):jP(this.doc,n=>{hF(n,this,e,t)}),t}get(e){return gF(this,e)}has(e){return vF(this,e)}clear(){this.doc===null?this._prelimContent.clear():jP(this.doc,e=>{this.forEach(function(t,n,r){mF(e,r,n)})})}_write(e){e.writeTypeRef(wI)}},EF=e=>new TF,DF=(e,t)=>e===t||typeof e==`object`&&typeof t==`object`&&e&&t&&LA(e,t),OF=class{constructor(e,t,n,r){this.left=e,this.right=t,this.index=n,this.currentAttributes=r}forward(){switch(this.right===null&&Mk(),this.right.content.constructor){case pI:this.right.deleted||MF(this.currentAttributes,this.right.content);break;default:this.right.deleted||(this.index+=this.right.length)}this.left=this.right,this.right=this.right.right}},kF=(e,t,n)=>{for(;t.right!==null&&n>0;){switch(t.right.content.constructor){case pI:t.right.deleted||MF(t.currentAttributes,t.right.content);break;default:t.right.deleted||(n<t.right.length&&bP(e,oP(t.right.id.client,t.right.id.clock+n)),t.index+=t.right.length,n-=t.right.length)}t.left=t.right,t.right=t.right.right}return t},AF=(e,t,n,r)=>{let i=new Map,a=r?$P(t,n):null;if(a){let t=new OF(a.p.left,a.p,a.index,i);return kF(e,t,n-a.index)}{let r=new OF(null,t._start,0,i);return kF(e,r,n)}},jF=(e,t,n,r)=>{for(;n.right!==null&&(n.right.deleted===!0||n.right.content.constructor===pI&&DF(r.get(n.right.content.key),n.right.content.value));)n.right.deleted||r.delete(n.right.content.key),n.forward();let i=e.doc,a=i.clientID;r.forEach((r,o)=>{let s=n.left,c=n.right,l=new NI(oP(a,mP(i.store,a)),s,s&&s.lastId,c,c&&c.id,t,null,new pI(o,r));l.integrate(e,0),n.right=l,n.forward()})},MF=(e,t)=>{let{key:n,value:r}=t;r===null?e.delete(n):e.set(n,r)},NF=(e,t)=>{for(;e.right!==null&&(e.right.deleted||e.right.content.constructor===pI&&DF(t[e.right.content.key]??null,e.right.content.value));)e.forward()},PF=(e,t,n,r)=>{let i=e.doc,a=i.clientID,o=new Map;for(let s in r){let c=r[s],l=n.currentAttributes.get(s)??null;if(!DF(l,c)){o.set(s,l);let{left:r,right:u}=n;n.right=new NI(oP(a,mP(i.store,a)),r,r&&r.lastId,u,u&&u.id,t,null,new pI(s,c)),n.right.integrate(e,0),n.forward()}}return o},FF=(e,t,n,r,i)=>{n.currentAttributes.forEach((e,t)=>{i[t]===void 0&&(i[t]=null)});let a=e.doc,o=a.clientID;NF(n,i);let s=PF(e,t,n,i),c=r.constructor===String?new bI(r):r instanceof nF?new AI(r):new dI(r),{left:l,right:u,index:d}=n;t._searchMarker&&eF(t._searchMarker,n.index,c.getLength()),u=new NI(oP(o,mP(a.store,o)),l,l&&l.lastId,u,u&&u.id,t,null,c),u.integrate(e,0),n.right=u,n.index=d,n.forward(),jF(e,t,n,s)},IF=(e,t,n,r,i)=>{let a=e.doc,o=a.clientID;NF(n,i);let s=PF(e,t,n,i);iterationLoop:for(;n.right!==null&&(r>0||s.size>0&&(n.right.deleted||n.right.content.constructor===pI));){if(!n.right.deleted)switch(n.right.content.constructor){case pI:{let{key:t,value:a}=n.right.content,o=i[t];if(o!==void 0){if(DF(o,a))s.delete(t);else{if(r===0)break iterationLoop;s.set(t,a)}n.right.delete(e)}else n.currentAttributes.set(t,a);break}default:r<n.right.length&&bP(e,oP(n.right.id.client,n.right.id.clock+r)),r-=n.right.length}n.forward()}if(r>0){let i=``;for(;r>0;r--)i+=`
1024
+ `;n.right=new NI(oP(o,mP(a.store,o)),n.left,n.left&&n.left.lastId,n.right,n.right&&n.right.id,t,null,new bI(i)),n.right.integrate(e,0),n.forward()}jF(e,t,n,s)},LF=(e,t,n,r,i)=>{let a=t,o=uO();for(;a&&(!a.countable||a.deleted);){if(!a.deleted&&a.content.constructor===pI){let e=a.content;o.set(e.key,e)}a=a.right}let s=0,c=!1;for(;t!==a;){if(n===t&&(c=!0),!t.deleted){let n=t.content;switch(n.constructor){case pI:{let{key:a,value:l}=n,u=r.get(a)??null;(o.get(a)!==n||u===l)&&(t.delete(e),s++,!c&&(i.get(a)??null)===l&&u!==l&&(u===null?i.delete(a):i.set(a,u))),!c&&!t.deleted&&MF(i,n);break}}}t=t.right}return s},RF=(e,t)=>{for(;t&&t.right&&(t.right.deleted||!t.right.countable);)t=t.right;let n=new Set;for(;t&&(t.deleted||!t.countable);){if(!t.deleted&&t.content.constructor===pI){let r=t.content.key;n.has(r)?t.delete(e):n.add(r)}t=t.left}},zF=e=>{let t=0;return jP(e.doc,n=>{let r=e._start,i=e._start,a=uO(),o=dO(a);for(;i;){if(i.deleted===!1)switch(i.content.constructor){case pI:MF(o,i.content);break;default:t+=LF(n,r,i,a,o),a=dO(o),r=i}i=i.right}}),t},BF=e=>{let t=new Set,n=e.doc;for(let[r,i]of e.afterState.entries()){let a=e.beforeState.get(r)||0;i!==a&&CP(e,n.store.clients.get(r),a,i,e=>{!e.deleted&&e.content.constructor===pI&&e.constructor!==rI&&t.add(e.parent)})}jP(n,n=>{hN(e,e.deleteSet,e=>{if(e instanceof rI||!e.parent._hasFormatting||t.has(e.parent))return;let r=e.parent;e.content.constructor===pI?t.add(r):RF(n,e)});for(let e of t)zF(e)})},VF=(e,t,n)=>{let r=n,i=dO(t.currentAttributes),a=t.right;for(;n>0&&t.right!==null;){if(t.right.deleted===!1)switch(t.right.content.constructor){case AI:case dI:case bI:n<t.right.length&&bP(e,oP(t.right.id.client,t.right.id.clock+n)),n-=t.right.length,t.right.delete(e)}t.forward()}a&&LF(e,a,t.right,i,t.currentAttributes);let o=(t.left||t.right).parent;return o._searchMarker&&eF(o._searchMarker,t.index,-r+n),t},HF=class extends WP{constructor(e,t,n){super(e,t),this.childListChanged=!1,this.keysChanged=new Set,n.forEach(e=>{e===null?this.childListChanged=!0:this.keysChanged.add(e)})}get changes(){if(this._changes===null){let e={keys:this.keys,delta:this.delta,added:new Set,deleted:new Set};this._changes=e}return this._changes}get delta(){if(this._delta===null){let e=this.target.doc,t=[];jP(e,e=>{let n=new Map,r=new Map,i=this.target._start,a=null,o={},s=``,c=0,l=0,u=()=>{if(a!==null){let e=null;switch(a){case`delete`:l>0&&(e={delete:l}),l=0;break;case`insert`:(typeof s==`object`||s.length>0)&&(e={insert:s},n.size>0&&(e.attributes={},n.forEach((t,n)=>{t!==null&&(e.attributes[n]=t)}))),s=``;break;case`retain`:c>0&&(e={retain:c},PA(o)||(e.attributes=kA({},o))),c=0}e&&t.push(e),a=null}};for(;i!==null;){switch(i.content.constructor){case AI:case dI:this.adds(i)?this.deletes(i)||(u(),a=`insert`,s=i.content.getContent()[0],u()):this.deletes(i)?(a!==`delete`&&(u(),a=`delete`),l+=1):i.deleted||(a!==`retain`&&(u(),a=`retain`),c+=1);break;case bI:this.adds(i)?this.deletes(i)||(a!==`insert`&&(u(),a=`insert`),s+=i.content.str):this.deletes(i)?(a!==`delete`&&(u(),a=`delete`),l+=i.length):i.deleted||(a!==`retain`&&(u(),a=`retain`),c+=i.length);break;case pI:{let{key:t,value:s}=i.content;if(this.adds(i)){if(!this.deletes(i)){let c=n.get(t)??null;DF(c,s)?s!==null&&i.delete(e):(a===`retain`&&u(),DF(s,r.get(t)??null)?delete o[t]:o[t]=s)}}else if(this.deletes(i)){r.set(t,s);let e=n.get(t)??null;DF(e,s)||(a===`retain`&&u(),o[t]=e)}else if(!i.deleted){r.set(t,s);let n=o[t];n!==void 0&&(DF(n,s)?n!==null&&i.delete(e):(a===`retain`&&u(),s===null?delete o[t]:o[t]=s))}i.deleted||(a===`insert`&&u(),MF(n,i.content));break}}i=i.right}for(u();t.length>0;){let e=t[t.length-1];if(e.retain!==void 0&&e.attributes===void 0)t.pop();else break}}),this._delta=t}return this._delta}},UF=class e extends nF{constructor(e){super(),this._pending=e===void 0?[]:[()=>this.insert(0,e)],this._searchMarker=[],this._hasFormatting=!1}get length(){return this.doc??KP(),this._length}_integrate(e,t){super._integrate(e,t);try{this._pending.forEach(e=>e())}catch(e){console.error(e)}this._pending=null}_copy(){return new e}clone(){let t=new e;return t.applyDelta(this.toDelta()),t}_callObserver(e,t){super._callObserver(e,t);let n=new HF(this,e,t);tF(this,e,n),!e.local&&this._hasFormatting&&(e._needFormattingCleanup=!0)}toString(){this.doc??KP();let e=``,t=this._start;for(;t!==null;)!t.deleted&&t.countable&&t.content.constructor===bI&&(e+=t.content.str),t=t.right;return e}toJSON(){return this.toString()}applyDelta(e,{sanitize:t=!0}={}){this.doc===null?this._pending.push(()=>this.applyDelta(e)):jP(this.doc,n=>{let r=new OF(null,this._start,0,new Map);for(let i=0;i<e.length;i++){let a=e[i];if(a.insert!==void 0){let o=!t&&typeof a.insert==`string`&&i===e.length-1&&r.right===null&&a.insert.slice(-1)===`
1025
+ `?a.insert.slice(0,-1):a.insert;(typeof o!=`string`||o.length>0)&&FF(n,this,r,o,a.attributes||{})}else a.retain===void 0?a.delete!==void 0&&VF(n,r,a.delete):IF(n,this,r,a.retain,a.attributes||{})}})}toDelta(e,t,n){this.doc??KP();let r=[],i=new Map,a=this.doc,o=``,s=this._start;function c(){if(o.length>0){let e={},t=!1;i.forEach((n,r)=>{t=!0,e[r]=n});let n={insert:o};t&&(n.attributes=e),r.push(n),o=``}}let l=()=>{for(;s!==null;){if(uP(s,e)||t!==void 0&&uP(s,t))switch(s.content.constructor){case bI:{let r=i.get(`ychange`);e!==void 0&&!uP(s,e)?(r===void 0||r.user!==s.id.client||r.type!==`removed`)&&(c(),i.set(`ychange`,n?n(`removed`,s.id):{type:`removed`})):t!==void 0&&!uP(s,t)?(r===void 0||r.user!==s.id.client||r.type!==`added`)&&(c(),i.set(`ychange`,n?n(`added`,s.id):{type:`added`})):r!==void 0&&(c(),i.delete(`ychange`)),o+=s.content.str;break}case AI:case dI:{c();let e={insert:s.content.getContent()[0]};if(i.size>0){let t={};e.attributes=t,i.forEach((e,n)=>{t[n]=e})}r.push(e);break}case pI:uP(s,e)&&(c(),MF(i,s.content))}s=s.right}c()};return e||t?jP(a,n=>{e&&dP(n,e),t&&dP(n,t),l()},`cleanup`):l(),r}insert(e,t,n){if(t.length<=0)return;let r=this.doc;r===null?this._pending.push(()=>this.insert(e,t,n)):jP(r,r=>{let i=AF(r,this,e,!n);n||(n={},i.currentAttributes.forEach((e,t)=>{n[t]=e})),FF(r,this,i,t,n)})}insertEmbed(e,t,n){let r=this.doc;r===null?this._pending.push(()=>this.insertEmbed(e,t,n||{})):jP(r,r=>{let i=AF(r,this,e,!n);FF(r,this,i,t,n||{})})}delete(e,t){if(t===0)return;let n=this.doc;n===null?this._pending.push(()=>this.delete(e,t)):jP(n,n=>{VF(n,AF(n,this,e,!0),t)})}format(e,t,n){if(t===0)return;let r=this.doc;r===null?this._pending.push(()=>this.format(e,t,n)):jP(r,r=>{let i=AF(r,this,e,!1);i.right!==null&&IF(r,this,i,t,n)})}removeAttribute(e){this.doc===null?this._pending.push(()=>this.removeAttribute(e)):jP(this.doc,t=>{mF(t,this,e)})}setAttribute(e,t){this.doc===null?this._pending.push(()=>this.setAttribute(e,t)):jP(this.doc,n=>{hF(n,this,e,t)})}getAttribute(e){return gF(this,e)}getAttributes(){return _F(this)}_write(e){e.writeTypeRef(TI)}},WF=e=>new UF,GF=class{constructor(e,t=()=>!0){this._filter=t,this._root=e,this._currentNode=e._start,this._firstCall=!0,e.doc??KP()}[Symbol.iterator](){return this}next(){let e=this._currentNode,t=e&&e.content&&e.content.type;if(e!==null&&(!this._firstCall||e.deleted||!this._filter(t)))do if(t=e.content.type,!e.deleted&&(t.constructor===JF||t.constructor===KF)&&t._start!==null)e=t._start;else for(;e!==null;){let t=e.next;if(t!==null){e=t;break}e=e.parent===this._root?null:e.parent._item}while(e!==null&&(e.deleted||!this._filter(e.content.type)));return this._firstCall=!1,e===null?{value:void 0,done:!0}:(this._currentNode=e,{value:e.content.type,done:!1})}},KF=class e extends nF{constructor(){super(),this._prelimContent=[]}get firstChild(){let e=this._first;return e?e.content.getContent()[0]:null}_integrate(e,t){super._integrate(e,t),this.insert(0,this._prelimContent),this._prelimContent=null}_copy(){return new e}clone(){let t=new e;return t.insert(0,this.toArray().map(e=>e instanceof nF?e.clone():e)),t}get length(){return this.doc??KP(),this._prelimContent===null?this._length:this._prelimContent.length}createTreeWalker(e){return new GF(this,e)}querySelector(e){e=e.toUpperCase();let t=new GF(this,t=>t.nodeName&&t.nodeName.toUpperCase()===e).next();return t.done?null:t.value}querySelectorAll(e){return e=e.toUpperCase(),bO(new GF(this,t=>t.nodeName&&t.nodeName.toUpperCase()===e))}_callObserver(e,t){tF(this,e,new XF(this,t,e))}toString(){return oF(this,e=>e.toString()).join(``)}toJSON(){return this.toString()}toDOM(e=document,t={},n){let r=e.createDocumentFragment();return n!==void 0&&n._createAssociation(r,this),aF(this,i=>{r.insertBefore(i.toDOM(e,t,n),null)}),r}insert(e,t){this.doc===null?this._prelimContent.splice(e,0,...t):jP(this.doc,n=>{dF(n,this,e,t)})}insertAfter(e,t){if(this.doc!==null)jP(this.doc,n=>{let r=e&&e instanceof nF?e._item:e;lF(n,this,r,t)});else{let n=this._prelimContent,r=e===null?0:n.findIndex(t=>t===e)+1;if(r===0&&e!==null)throw Ak(`Reference item not found`);n.splice(r,0,...t)}}delete(e,t=1){this.doc===null?this._prelimContent.splice(e,t):jP(this.doc,n=>{pF(n,this,e,t)})}toArray(){return iF(this)}push(e){this.insert(this.length,e)}unshift(e){this.insert(0,e)}get(e){return cF(this,e)}slice(e=0,t=this.length){return rF(this,e,t)}forEach(e){aF(this,e)}_write(e){e.writeTypeRef(DI)}},qF=e=>new KF,JF=class e extends KF{constructor(e=`UNDEFINED`){super(),this.nodeName=e,this._prelimAttrs=new Map}get nextSibling(){let e=this._item?this._item.next:null;return e?e.content.type:null}get prevSibling(){let e=this._item?this._item.prev:null;return e?e.content.type:null}_integrate(e,t){super._integrate(e,t),this._prelimAttrs.forEach((e,t)=>{this.setAttribute(t,e)}),this._prelimAttrs=null}_copy(){return new e(this.nodeName)}clone(){let t=new e(this.nodeName),n=this.getAttributes();return jA(n,(e,n)=>{t.setAttribute(n,e)}),t.insert(0,this.toArray().map(e=>e instanceof nF?e.clone():e)),t}toString(){let e=this.getAttributes(),t=[],n=[];for(let t in e)n.push(t);n.sort();let r=n.length;for(let i=0;i<r;i++){let r=n[i];t.push(r+`="`+e[r]+`"`)}let i=this.nodeName.toLocaleLowerCase();return`<${i}${t.length>0?` `+t.join(` `):``}>${super.toString()}</${i}>`}removeAttribute(e){this.doc===null?this._prelimAttrs.delete(e):jP(this.doc,t=>{mF(t,this,e)})}setAttribute(e,t){this.doc===null?this._prelimAttrs.set(e,t):jP(this.doc,n=>{hF(n,this,e,t)})}getAttribute(e){return gF(this,e)}hasAttribute(e){return vF(this,e)}getAttributes(e){return e?yF(this,e):_F(this)}toDOM(e=document,t={},n){let r=e.createElement(this.nodeName),i=this.getAttributes();for(let e in i){let t=i[e];typeof t==`string`&&r.setAttribute(e,t)}return aF(this,i=>{r.appendChild(i.toDOM(e,t,n))}),n!==void 0&&n._createAssociation(r,this),r}_write(e){e.writeTypeRef(EI),e.writeKey(this.nodeName)}},YF=e=>new JF(e.readKey()),XF=class extends WP{constructor(e,t,n){super(e,n),this.childListChanged=!1,this.attributesChanged=new Set,t.forEach(e=>{e===null?this.childListChanged=!0:this.attributesChanged.add(e)})}},ZF=class e extends TF{constructor(e){super(),this.hookName=e}_copy(){return new e(this.hookName)}clone(){let t=new e(this.hookName);return this.forEach((e,n)=>{t.set(n,e)}),t}toDOM(e=document,t={},n){let r=t[this.hookName],i;return i=r===void 0?document.createElement(this.hookName):r.createDom(this),i.setAttribute(`data-yjs-hook`,this.hookName),n!==void 0&&n._createAssociation(i,this),i}_write(e){e.writeTypeRef(OI),e.writeKey(this.hookName)}},QF=e=>new ZF(e.readKey()),$F=class e extends UF{get nextSibling(){let e=this._item?this._item.next:null;return e?e.content.type:null}get prevSibling(){let e=this._item?this._item.prev:null;return e?e.content.type:null}_copy(){return new e}clone(){let t=new e;return t.applyDelta(this.toDelta()),t}toDOM(e=document,t,n){let r=e.createTextNode(this.toString());return n!==void 0&&n._createAssociation(r,this),r}toString(){return this.toDelta().map(e=>{let t=[];for(let n in e.attributes){let r=[];for(let t in e.attributes[n])r.push({key:t,value:e.attributes[n][t]});r.sort((e,t)=>e.key<t.key?-1:1),t.push({nodeName:n,attrs:r})}t.sort((e,t)=>e.nodeName<t.nodeName?-1:1);let n=``;for(let e=0;e<t.length;e++){let r=t[e];n+=`<${r.nodeName}`;for(let e=0;e<r.attrs.length;e++){let t=r.attrs[e];n+=` ${t.key}="${t.value}"`}n+=`>`}n+=e.insert;for(let e=t.length-1;e>=0;e--)n+=`</${t[e].nodeName}>`;return n}).join(``)}toJSON(){return this.toString()}_write(e){e.writeTypeRef(kI)}},eI=e=>new $F,tI=class{constructor(e,t){this.id=e,this.length=t}get deleted(){throw jk()}mergeWith(e){return!1}write(e,t,n){throw jk()}integrate(e,t){throw jk()}},nI=0,rI=class extends tI{get deleted(){return!0}delete(){}mergeWith(e){return this.constructor===e.constructor&&(this.length+=e.length,!0)}integrate(e,t){t>0&&(this.id.clock+=t,this.length-=t),hP(e.doc.store,this)}write(e,t){e.writeInfo(nI),e.writeLen(this.length-t)}getMissing(e,t){return null}},iI=class e{constructor(e){this.content=e}getLength(){return 1}getContent(){return[this.content]}isCountable(){return!0}copy(){return new e(this.content)}splice(e){throw jk()}mergeWith(e){return!1}integrate(e,t){}delete(e){}gc(e){}write(e,t){e.writeBuf(this.content)}getRef(){return 3}},aI=e=>new iI(e.readBuf()),oI=class e{constructor(e){this.len=e}getLength(){return this.len}getContent(){return[]}isCountable(){return!1}copy(){return new e(this.len)}splice(t){let n=new e(this.len-t);return this.len=t,n}mergeWith(e){return this.len+=e.len,!0}integrate(e,t){bN(e.deleteSet,t.id.client,t.id.clock,this.len),t.markDeleted()}delete(e){}gc(e){}write(e,t){e.writeLen(this.len-t)}getRef(){return 1}},sI=e=>new oI(e.readLen()),cI=(e,t)=>new DN({guid:e,...t,shouldLoad:t.shouldLoad||t.autoLoad||!1}),lI=class e{constructor(e){e._item&&console.error(`This document was already integrated as a sub-document. You should create a second instance instead with the same guid.`),this.doc=e;let t={};this.opts=t,e.gc||(t.gc=!1),e.autoLoad&&(t.autoLoad=!0),e.meta!==null&&(t.meta=e.meta)}getLength(){return 1}getContent(){return[this.doc]}isCountable(){return!0}copy(){return new e(cI(this.doc.guid,this.opts))}splice(e){throw jk()}mergeWith(e){return!1}integrate(e,t){this.doc._item=t,e.subdocsAdded.add(this.doc),this.doc.shouldLoad&&e.subdocsLoaded.add(this.doc)}delete(e){e.subdocsAdded.has(this.doc)?e.subdocsAdded.delete(this.doc):e.subdocsRemoved.add(this.doc)}gc(e){}write(e,t){e.writeString(this.doc.guid),e.writeAny(this.opts)}getRef(){return 9}},uI=e=>new lI(cI(e.readString(),e.readAny())),dI=class e{constructor(e){this.embed=e}getLength(){return 1}getContent(){return[this.embed]}isCountable(){return!0}copy(){return new e(this.embed)}splice(e){throw jk()}mergeWith(e){return!1}integrate(e,t){}delete(e){}gc(e){}write(e,t){e.writeJSON(this.embed)}getRef(){return 5}},fI=e=>new dI(e.readJSON()),pI=class e{constructor(e,t){this.key=e,this.value=t}getLength(){return 1}getContent(){return[]}isCountable(){return!1}copy(){return new e(this.key,this.value)}splice(e){throw jk()}mergeWith(e){return!1}integrate(e,t){let n=t.parent;n._searchMarker=null,n._hasFormatting=!0}delete(e){}gc(e){}write(e,t){e.writeKey(this.key),e.writeJSON(this.value)}getRef(){return 6}},mI=e=>new pI(e.readKey(),e.readJSON()),hI=class e{constructor(e){this.arr=e}getLength(){return this.arr.length}getContent(){return this.arr}isCountable(){return!0}copy(){return new e(this.arr)}splice(t){let n=new e(this.arr.slice(t));return this.arr=this.arr.slice(0,t),n}mergeWith(e){return this.arr=this.arr.concat(e.arr),!0}integrate(e,t){}delete(e){}gc(e){}write(e,t){let n=this.arr.length;e.writeLen(n-t);for(let r=t;r<n;r++){let t=this.arr[r];e.writeString(t===void 0?`undefined`:JSON.stringify(t))}}getRef(){return 2}},gI=e=>{let t=e.readLen(),n=[];for(let r=0;r<t;r++){let t=e.readString();t===`undefined`?n.push(void 0):n.push(JSON.parse(t))}return new hI(n)},_I=QA(`node_env`)===`development`,vI=class e{constructor(e){this.arr=e,_I&&zA(e)}getLength(){return this.arr.length}getContent(){return this.arr}isCountable(){return!0}copy(){return new e(this.arr)}splice(t){let n=new e(this.arr.slice(t));return this.arr=this.arr.slice(0,t),n}mergeWith(e){return this.arr=this.arr.concat(e.arr),!0}integrate(e,t){}delete(e){}gc(e){}write(e,t){let n=this.arr.length;e.writeLen(n-t);for(let r=t;r<n;r++){let t=this.arr[r];e.writeAny(t)}}getRef(){return 8}},yI=e=>{let t=e.readLen(),n=[];for(let r=0;r<t;r++)n.push(e.readAny());return new vI(n)},bI=class e{constructor(e){this.str=e}getLength(){return this.str.length}getContent(){return this.str.split(``)}isCountable(){return!0}copy(){return new e(this.str)}splice(t){let n=new e(this.str.slice(t));this.str=this.str.slice(0,t);let r=this.str.charCodeAt(t-1);return r>=55296&&r<=56319&&(this.str=this.str.slice(0,t-1)+`�`,n.str=`�`+n.str.slice(1)),n}mergeWith(e){return this.str+=e.str,!0}integrate(e,t){}delete(e){}gc(e){}write(e,t){e.writeString(t===0?this.str:this.str.slice(t))}getRef(){return 4}},xI=e=>new bI(e.readString()),SI=[CF,EF,WF,YF,qF,QF,eI],CI=0,wI=1,TI=2,EI=3,DI=4,OI=5,kI=6,AI=class e{constructor(e){this.type=e}getLength(){return 1}getContent(){return[this.type]}isCountable(){return!0}copy(){return new e(this.type._copy())}splice(e){throw jk()}mergeWith(e){return!1}integrate(e,t){this.type._integrate(e.doc,t)}delete(e){let t=this.type._start;for(;t!==null;)t.deleted?t.id.clock<(e.beforeState.get(t.id.client)||0)&&e._mergeStructs.push(t):t.delete(e),t=t.right;this.type._map.forEach(t=>{t.deleted?t.id.clock<(e.beforeState.get(t.id.client)||0)&&e._mergeStructs.push(t):t.delete(e)}),e.changed.delete(this.type)}gc(e){let t=this.type._start;for(;t!==null;)t.gc(e,!0),t=t.right;this.type._start=null,this.type._map.forEach(t=>{for(;t!==null;)t.gc(e,!0),t=t.left}),this.type._map=new Map}write(e,t){this.type._write(e)}getRef(){return 7}},jI=e=>new AI(SI[e.readTypeRef()](e)),MI=(e,t,n)=>{let{client:r,clock:i}=t.id,a=new NI(oP(r,i+n),t,oP(r,i+n-1),t.right,t.rightOrigin,t.parent,t.parentSub,t.content.splice(n));return t.deleted&&a.markDeleted(),t.keep&&(a.keep=!0),t.redone!==null&&(a.redone=oP(t.redone.client,t.redone.clock+n)),t.right=a,a.right!==null&&(a.right.left=a),e._mergeStructs.push(a),a.parentSub!==null&&a.right===null&&a.parent._map.set(a.parentSub,a),t.length=n,a},NI=class e extends tI{constructor(e,t,n,r,i,a,o,s){super(e,s.getLength()),this.origin=n,this.left=t,this.right=r,this.rightOrigin=i,this.parent=a,this.parentSub=o,this.redone=null,this.content=s,this.info=this.content.isCountable()?2:0}set marker(e){(this.info&8)>0!==e&&(this.info^=8)}get marker(){return(this.info&8)>0}get keep(){return(this.info&1)>0}set keep(e){this.keep!==e&&(this.info^=1)}get countable(){return(this.info&2)>0}get deleted(){return(this.info&4)>0}set deleted(e){this.deleted!==e&&(this.info^=4)}markDeleted(){this.info|=4}getMissing(t,n){if(this.origin&&this.origin.client!==this.id.client&&this.origin.clock>=mP(n,this.origin.client))return this.origin.client;if(this.rightOrigin&&this.rightOrigin.client!==this.id.client&&this.rightOrigin.clock>=mP(n,this.rightOrigin.client))return this.rightOrigin.client;if(this.parent&&this.parent.constructor===iP&&this.id.client!==this.parent.client&&this.parent.clock>=mP(n,this.parent.client))return this.parent.client;if(this.origin&&=(this.left=xP(t,n,this.origin),this.left.lastId),this.rightOrigin&&=(this.right=bP(t,this.rightOrigin),this.right.id),this.left&&this.left.constructor===rI||this.right&&this.right.constructor===rI)this.parent=null;else if(!this.parent)this.left&&this.left.constructor===e?(this.parent=this.left.parent,this.parentSub=this.left.parentSub):this.right&&this.right.constructor===e&&(this.parent=this.right.parent,this.parentSub=this.right.parentSub);else if(this.parent.constructor===iP){let e=vP(n,this.parent);this.parent=e.constructor===rI?null:e.content.type}return null}integrate(e,t){if(t>0&&(this.id.clock+=t,this.left=xP(e,e.doc.store,oP(this.id.client,this.id.clock-1)),this.origin=this.left.lastId,this.content=this.content.splice(t),this.length-=t),this.parent){if(!this.left&&(!this.right||this.right.left!==null)||this.left&&this.left.right!==this.right){let t=this.left,n;if(t!==null)n=t.right;else if(this.parentSub!==null)for(n=this.parent._map.get(this.parentSub)||null;n!==null&&n.left!==null;)n=n.left;else n=this.parent._start;let r=new Set,i=new Set;for(;n!==null&&n!==this.right;){if(i.add(n),r.add(n),aP(this.origin,n.origin)){if(n.id.client<this.id.client)t=n,r.clear();else if(aP(this.rightOrigin,n.rightOrigin))break}else if(n.origin!==null&&i.has(vP(e.doc.store,n.origin)))r.has(vP(e.doc.store,n.origin))||(t=n,r.clear());else break;n=n.right}this.left=t}if(this.left!==null){let e=this.left.right;this.right=e,this.left.right=this}else{let e;if(this.parentSub!==null)for(e=this.parent._map.get(this.parentSub)||null;e!==null&&e.left!==null;)e=e.left;else e=this.parent._start,this.parent._start=this;this.right=e}this.right===null?this.parentSub!==null&&(this.parent._map.set(this.parentSub,this),this.left!==null&&this.left.delete(e)):this.right.left=this,this.parentSub===null&&this.countable&&!this.deleted&&(this.parent._length+=this.length),hP(e.doc.store,this),this.content.integrate(e,this),EP(e,this.parent,this.parentSub),(this.parent._item!==null&&this.parent._item.deleted||this.parentSub!==null&&this.right!==null)&&this.delete(e)}else new rI(this.id,this.length).integrate(e,0)}get next(){let e=this.right;for(;e!==null&&e.deleted;)e=e.right;return e}get prev(){let e=this.left;for(;e!==null&&e.deleted;)e=e.left;return e}get lastId(){return this.length===1?this.id:oP(this.id.client,this.id.clock+this.length-1)}mergeWith(e){if(this.constructor===e.constructor&&aP(e.origin,this.lastId)&&this.right===e&&aP(this.rightOrigin,e.rightOrigin)&&this.id.client===e.id.client&&this.id.clock+this.length===e.id.clock&&this.deleted===e.deleted&&this.redone===null&&e.redone===null&&this.content.constructor===e.content.constructor&&this.content.mergeWith(e.content)){let t=this.parent._searchMarker;return t&&t.forEach(t=>{t.p===e&&(t.p=this,!this.deleted&&this.countable&&(t.index-=this.length))}),e.keep&&(this.keep=!0),this.right=e.right,this.right!==null&&(this.right.left=this),this.length+=e.length,!0}return!1}delete(e){if(!this.deleted){let t=this.parent;this.countable&&this.parentSub===null&&(t._length-=this.length),this.markDeleted(),bN(e.deleteSet,this.id.client,this.id.clock,this.length),EP(e,t,this.parentSub),this.content.delete(e)}}gc(e,t){if(!this.deleted)throw Mk();this.content.gc(e),t?SP(e,this,new rI(this.id,this.length)):this.content=new oI(this.length)}write(e,t){let n=t>0?oP(this.id.client,this.id.clock+t-1):this.origin,r=this.rightOrigin,i=this.parentSub,a=this.content.getRef()&31|(n===null?0:128)|(r===null?0:64)|(i===null?0:32);if(e.writeInfo(a),n!==null&&e.writeLeftID(n),r!==null&&e.writeRightID(r),n===null&&r===null){let t=this.parent;if(t._item!==void 0){let n=t._item;if(n===null){let n=sP(t);e.writeParentInfo(!0),e.writeString(n)}else e.writeParentInfo(!1),e.writeLeftID(n.id)}else t.constructor===String?(e.writeParentInfo(!0),e.writeString(t)):t.constructor===iP?(e.writeParentInfo(!1),e.writeLeftID(t)):Mk();i!==null&&e.writeString(i)}this.content.write(e,t)}},PI=(e,t)=>FI[t&31](e),FI=[()=>{Mk()},sI,gI,aI,xI,fI,mI,jI,yI,uI,()=>{Mk()}],II=10,LI=class extends tI{get deleted(){return!0}delete(){}mergeWith(e){return this.constructor===e.constructor&&(this.length+=e.length,!0)}integrate(e,t){Mk()}write(e,t){e.writeInfo(II),sk(e.restEncoder,this.length-t)}getMissing(e,t){return null}},RI=typeof globalThis<`u`?globalThis:typeof window<`u`?window:typeof global<`u`?global:{},zI=`__ $YJS$ __`,RI[zI]===!0&&console.error(`Yjs was already imported. This breaks constructor checks and will lead to issues! - https://github.com/yjs/yjs/issues/438`),RI[zI]=!0})),VI,HI,UI,WI,GI,KI,qI,JI=s((()=>{hO(),_O(),pj(),wA(),VI=new Map,HI=class{constructor(e){this.room=e,this.onmessage=null,this._onChange=t=>t.key===e&&this.onmessage!==null&&this.onmessage({data:dj(t.newValue||``)}),SA(this._onChange)}postMessage(e){xA.setItem(this.room,uj(aj(e)))}close(){CA(this._onChange)}},UI=typeof BroadcastChannel>`u`?HI:BroadcastChannel,WI=e=>fO(VI,e,()=>{let t=gO(),n=new UI(e);return n.onmessage=e=>t.forEach(t=>t(e.data,`broadcastchannel`)),{bc:n,subs:t}}),GI=(e,t)=>(WI(e).subs.add(t),t),KI=(e,t)=>{let n=WI(e),r=n.subs.delete(t);return r&&n.subs.size===0&&(n.bc.close(),VI.delete(e)),r},qI=(e,t,n=null)=>{let r=WI(e);r.bc.postMessage(t),r.subs.forEach(e=>e(t,n))}})),YI,XI,ZI,QI,$I,eL,tL,nL=s((()=>{kk(),aA(),BI(),YI=(e,t)=>{sk(e,0);let n=QN(t);hk(e,n)},XI=(e,t,n)=>{sk(e,1),hk(e,KN(t,n))},ZI=(e,t,n)=>XI(t,n,Hk(e)),QI=(e,t,n,r)=>{try{UN(t,Hk(e),n)}catch(e){r?.(e),console.error(`Caught error while handling a Yjs update`,e)}},$I=(e,t)=>{sk(e,2),hk(e,t)},eL=QI,tL=(e,t,n,r,i)=>{let a=Wk(e);switch(a){case 0:ZI(e,t,n);break;case 1:QI(e,n,r,i);break;case 2:eL(e,n,r,i);break;default:throw Error(`Unknown message type`)}return a}})),rL,iL=s((()=>{aA(),rL=(e,t,n)=>{Wk(e)===0&&n(t,Jk(e))}})),aL,oL,sL,cL,lL,uL=s((()=>{kk(),aA(),pA(),FO(),OO(),GA(),aL=3e4,oL=class extends DO{constructor(e){super(),this.doc=e,this.clientID=e.clientID,this.states=new Map,this.meta=new Map,this._checkInterval=setInterval(()=>{let e=fA();this.getLocalState()!==null&&15e3<=e-this.meta.get(this.clientID).lastUpdated&&this.setLocalState(this.getLocalState());let t=[];this.meta.forEach((n,r)=>{r!==this.clientID&&3e4<=e-n.lastUpdated&&this.states.has(r)&&t.push(r)}),t.length>0&&sL(this,t,`timeout`)},kO(aL/10)),e.on(`destroy`,()=>{this.destroy()}),this.setLocalState({})}destroy(){this.emit(`destroy`,[this]),this.setLocalState(null),super.destroy(),clearInterval(this._checkInterval)}getLocalState(){return this.states.get(this.clientID)||null}setLocalState(e){let t=this.clientID,n=this.meta.get(t),r=n===void 0?0:n.clock+1,i=this.states.get(t);e===null?this.states.delete(t):this.states.set(t,e),this.meta.set(t,{clock:r,lastUpdated:fA()});let a=[],o=[],s=[],c=[];e===null?c.push(t):i==null?e!=null&&a.push(t):(o.push(t),UA(i,e)||s.push(t)),(a.length>0||s.length>0||c.length>0)&&this.emit(`change`,[{added:a,updated:s,removed:c},`local`]),this.emit(`update`,[{added:a,updated:o,removed:c},`local`])}setLocalStateField(e,t){let n=this.getLocalState();n!==null&&this.setLocalState({...n,[e]:t})}getStates(){return this.states}},sL=(e,t,n)=>{let r=[];for(let n=0;n<t.length;n++){let i=t[n];if(e.states.has(i)){if(e.states.delete(i),i===e.clientID){let t=e.meta.get(i);e.meta.set(i,{clock:t.clock+1,lastUpdated:fA()})}r.push(i)}}r.length>0&&(e.emit(`change`,[{added:[],updated:[],removed:r},n]),e.emit(`update`,[{added:[],updated:[],removed:r},n]))},cL=(e,t,n=e.states)=>{let r=t.length,i=tk();sk(i,r);for(let a=0;a<r;a++){let r=t[a],o=n.get(r)||null,s=e.meta.get(r).clock;sk(i,r),sk(i,s),pk(i,JSON.stringify(o))}return rk(i)},lL=(e,t,n)=>{let r=zk(t),i=fA(),a=[],o=[],s=[],c=[],l=Wk(r);for(let t=0;t<l;t++){let t=Wk(r),n=Wk(r),l=JSON.parse(Jk(r)),u=e.meta.get(t),d=e.states.get(t),f=u===void 0?0:u.clock;(f<n||f===n&&l===null&&e.states.has(t))&&(l===null?t===e.clientID&&e.getLocalState()!=null?n++:e.states.delete(t):e.states.set(t,l),e.meta.set(t,{clock:n,lastUpdated:i}),u===void 0&&l!==null?a.push(t):u!==void 0&&l===null?c.push(t):l!==null&&(UA(l,d)||s.push(t),o.push(t)))}(a.length>0||s.length>0||c.length>0)&&e.emit(`change`,[{added:a,updated:s,removed:c},n]),(a.length>0||o.length>0||c.length>0)&&e.emit(`update`,[{added:a,updated:o,removed:c},n])}})),dL,fL=s((()=>{BA(),dL=e=>MA(e,(e,t)=>`${encodeURIComponent(t)}=${encodeURIComponent(e)}`).join(`&`)})),pL,mL,hL,gL,_L,vL,yL,bL,xL,SL=s((()=>{JI(),pA(),kk(),aA(),nL(),iL(),uL(),OO(),FO(),fL(),rj(),pL=[],pL[0]=(e,t,n,r,i)=>{sk(e,0);let a=tL(t,e,n.doc,n);r&&a===1&&!n.synced&&(n.synced=!0)},pL[3]=(e,t,n,r,i)=>{sk(e,1),hk(e,cL(n.awareness,Array.from(n.awareness.getStates().keys())))},pL[1]=(e,t,n,r,i)=>{lL(n.awareness,Hk(t),n)},pL[2]=(e,t,n,r,i)=>{rL(t,n.doc,(e,t)=>hL(n,t))},mL=3e4,hL=(e,t)=>console.warn(`Permission denied to access ${e.url}.\n${t}`),gL=(e,t,n)=>{let r=zk(t),i=tk(),a=Wk(r),o=e.messageHandlers[a];return o?o(i,r,e,n,a):console.error(`Unable to compute message`),i},_L=e=>!(e.code>=4400&&e.code<4500),vL=(e,t,n)=>{if(t!==null&&t===e.ws){e.emit(`connection-close`,[n,e]),e.ws=null,t.onmessage=null,t.onopen=null,t.onclose=null,t.onerror=()=>{},t.close(),e.wsconnecting=!1,e.wsconnected&&(e.wsconnected=!1,e.synced=!1,sL(e.awareness,Array.from(e.awareness.getStates().keys()).filter(t=>t!==e.doc.clientID),e),e.emit(`status`,[{status:`disconnected`}])),e.wsUnsuccessfulReconnects++;let r=null;n!=null&&!e.shouldReconnect(n,e)&&(e.shouldConnect=!1,r={code:n.code,reason:n.reason}),setTimeout(yL,jO(NO(2,e.wsUnsuccessfulReconnects)*100,e.maxBackoffTime),e),r!==null&&e.emit(`closed`,[r,e])}},yL=e=>{if(e.shouldConnect&&e.ws===null){let t=new e._WS(e.url,e.protocols);t.binaryType=`arraybuffer`,e.ws=t,e.wsconnecting=!0,e.wsconnected=!1,e.synced=!1,t.onmessage=n=>{if(e.ws!==t)return;e.wsLastMessageReceived=fA();let r=gL(e,new Uint8Array(n.data),!0);nk(r)>1&&t.send(rk(r))},t.onerror=n=>{e.ws===t&&e.emit(`connection-error`,[n,e])},t.onclose=n=>{vL(e,t,n)},t.onopen=()=>{if(e.ws!==t)return;e.wsLastMessageReceived=fA(),e.wsconnecting=!1,e.wsconnected=!0,e.emit(`status`,[{status:`connected`}]);let n=tk();if(sk(n,0),YI(n,e.doc),t.send(rk(n)),e.awareness.getLocalState()!==null){let n=tk();sk(n,1),hk(n,cL(e.awareness,[e.doc.clientID])),t.send(rk(n))}},e.emit(`status`,[{status:`connecting`}])}},bL=(e,t)=>{let n=e.ws;e.wsconnected&&n&&n.readyState===n.OPEN&&n.send(t),e.bcconnected&&qI(e.bcChannel,t,e)},xL=class extends EO{constructor(e,t,n,{connect:r=!0,awareness:i=new oL(n),params:a={},protocols:o=[],WebSocketPolyfill:s=WebSocket,resyncInterval:c=-1,maxBackoffTime:l=2500,disableBc:u=!1,shouldReconnect:d=_L}={}){for(super();e[e.length-1]===`/`;)e=e.slice(0,e.length-1);this.serverUrl=e,this.bcChannel=e+`/`+t,this.maxBackoffTime=l,this.shouldReconnect=d,this.params=a,this.protocols=o,this.roomname=t,this.doc=n,this._WS=s,this.awareness=i,this.wsconnected=!1,this.wsconnecting=!1,this.bcconnected=!1,this.disableBc=u,this.wsUnsuccessfulReconnects=0,this.messageHandlers=pL.slice(),this._synced=!1,this.ws=null,this.wsLastMessageReceived=0,this.shouldConnect=r,this._resyncInterval=0,c>0&&(this._resyncInterval=setInterval(()=>{if(this.ws&&this.ws.readyState===WebSocket.OPEN){let e=tk();sk(e,0),YI(e,n),this.ws.send(rk(e))}},c)),this._bcSubscriber=(e,t)=>{if(t!==this){let t=gL(this,new Uint8Array(e),!1);nk(t)>1&&qI(this.bcChannel,rk(t),this)}},this._updateHandler=(e,t)=>{if(t!==this){let t=tk();sk(t,0),$I(t,e),bL(this,rk(t))}},this.doc.on(`update`,this._updateHandler),this._awarenessUpdateHandler=({added:e,updated:t,removed:n},r)=>{let a=e.concat(t).concat(n),o=tk();sk(o,1),hk(o,cL(i,a)),bL(this,rk(o))},this._exitHandler=()=>{sL(this.awareness,[n.clientID],`app closed`)},KA&&typeof process<`u`&&process.on(`exit`,this._exitHandler),i.on(`update`,this._awarenessUpdateHandler),this._checkInterval=setInterval(()=>{this.wsconnected&&mL<fA()-this.wsLastMessageReceived&&vL(this,this.ws,null)},mL/10),r&&this.connect()}get url(){let e=dL(this.params);return this.serverUrl+`/`+this.roomname+(e.length===0?``:`?`+e)}get synced(){return this._synced}set synced(e){this._synced!==e&&(this._synced=e,e&&(this.wsUnsuccessfulReconnects=0),this.emit(`synced`,[e]),this.emit(`sync`,[e]))}destroy(){this._resyncInterval!==0&&clearInterval(this._resyncInterval),clearInterval(this._checkInterval),this.disconnect(),KA&&typeof process<`u`&&process.off(`exit`,this._exitHandler),this.awareness.off(`update`,this._awarenessUpdateHandler),this.doc.off(`update`,this._updateHandler),super.destroy()}connectBc(){if(this.disableBc)return;this.bcconnected||=(GI(this.bcChannel,this._bcSubscriber),!0);let e=tk();sk(e,0),YI(e,this.doc),qI(this.bcChannel,rk(e),this);let t=tk();sk(t,0),XI(t,this.doc),qI(this.bcChannel,rk(t),this);let n=tk();sk(n,3),qI(this.bcChannel,rk(n),this);let r=tk();sk(r,1),hk(r,cL(this.awareness,[this.doc.clientID])),qI(this.bcChannel,rk(r),this)}disconnectBc(){let e=tk();sk(e,1),hk(e,cL(this.awareness,[this.doc.clientID],new Map)),bL(this,rk(e)),this.bcconnected&&=(KI(this.bcChannel,this._bcSubscriber),!1)}disconnect(){this.shouldConnect=!1,this.disconnectBc(),this.ws!==null&&vL(this,this.ws,null)}connect(){this.shouldConnect=!0,!this.wsconnected&&this.ws===null&&(yL(this),this.connectBc())}}})),CL=l({colorFor:()=>wL,startCollaboration:()=>TL});function wL(e){let t=0;for(let n of e)t=t*31+n.charCodeAt(0)|0;return EL[Math.abs(t)%EL.length]}function TL(e){let{bridge:t}=e,n=new DN,r=n.getMap(`annotations`),i=n.getMap(`fields`),a=n.getMap(`meta`),o=new xL(e.serverUrl.replace(/\/+$/,``),e.roomId,n,{...e.WebSocketPolyfill?{WebSocketPolyfill:e.WebSocketPolyfill}:{}}),{awareness:s}=o;s.setLocalStateField(`user`,{id:e.user.id,name:e.user.name,color:wL(e.user.id)});let c=new Set,l=()=>c.forEach(e=>e()),u=`connecting`;r.observe(e=>{if(e.transaction.origin===DL)return;let n=[],i=[];for(let[t,a]of e.changes.keys)a.action===`delete`?i.push(t):n.push(r.get(t));t.annotations.applyRemote({upsert:n,remove:i})}),i.observe(e=>{if(e.transaction.origin===DL)return;let n={};for(let[t,r]of e.changes.keys)r.action!==`delete`&&(n[t]=i.get(t));t.forms.applyRemote(n)});let d=[t.annotations.onLocal(({upsert:e,remove:t})=>n.transact(()=>{e&&r.set(e.id,OL(e)),t&&r.delete(t)},DL)),t.forms.onLocal((e,t)=>n.transact(()=>i.set(e,OL(t)),DL))],f=()=>{},p=new Promise(e=>f=e),m=e=>{if(e){if(o.off(`sync`,m),!a.get(`seeded`))n.transact(()=>{for(let e of t.annotations.list())r.set(e.id,OL(e));for(let[e,n]of Object.entries(t.forms.values()))i.set(e,OL(n));a.set(`seeded`,!0)},DL);else{let e=new Set(r.keys());t.annotations.applyRemote({upsert:[...r.values()],remove:t.annotations.list().filter(t=>!e.has(t.id)).map(e=>e.id)}),t.forms.applyRemote(i.toJSON())}f()}};return o.on(`sync`,m),o.on(`status`,({status:e})=>{u=e,l()}),s.on(`change`,l),{get status(){return u},get peers(){let e=[];for(let[t,r]of s.getStates()){let i=r.user;i&&typeof i.name==`string`&&e.push({clientId:t,id:String(i.id??t),name:i.name,color:typeof i.color==`string`&&/^#[0-9a-f]{6}$/i.test(i.color)?i.color:wL(String(t)),self:t===n.clientID})}return e.sort((e,t)=>Number(t.self)-Number(e.self)||e.name.localeCompare(t.name))},synced:p,onChange(e){return c.add(e),()=>c.delete(e)},destroy(){c.clear();for(let e of d)e();s.setLocalState(null),o.destroy(),s.destroy(),n.destroy()}}}var EL,DL,OL,kL=s((()=>{SL(),BI(),EL=[`#e11d48`,`#2563eb`,`#16a34a`,`#a855f7`,`#f97316`,`#0891b2`,`#ca8a04`,`#db2777`],DL=Symbol(`pdfcedar-local`),OL=e=>JSON.parse(JSON.stringify(e))}));Ne();var AL=`0.1.1-beta.0`,jL=()=>Promise.resolve().then(()=>(lO(),cO)),ML=()=>Promise.resolve().then(()=>(kL(),CL));function NL(e){let t=``;if(typeof File<`u`&&e instanceof File)t=e.name;else if(typeof e==`string`)try{t=decodeURIComponent(new URL(e,`http://x`).pathname.split(`/`).pop()??``)}catch{t=``}return t=t.trim()||`document.pdf`,/.pdf$/i.test(t)?t:`${t}.pdf`}function PL(e){return e instanceof HTMLElement?e.isContentEditable||e instanceof HTMLTextAreaElement||e instanceof HTMLInputElement&&e.type!==`checkbox`:!1}var FL=new WeakMap,IL=640,LL=()=>new DOMException(`createViewer: replaced by a newer viewer in the same container.`,`AbortError`),RL=`80vh`;function zL(e){if(e.getClientRects().length===0)return;let t=document.createElement(`div`);t.style.cssText=`flex: none; height: 10000px`,e.append(t);let n=e.getBoundingClientRect().height>=1e4;t.remove(),n&&(e.style.height=RL,e.dataset.heightFallback=``,console.warn(`[pdfcedar] The viewer's container has no height, so the viewer would grow to the whole document's length (slow for long PDFs). Using ${RL} for now. Give the container a height, e.g. style="height: 100vh", or make it a flex item that fills the space.`))}async function BL(e){if(!(e?.container instanceof HTMLElement))throw TypeError("createViewer: `container` must be an HTMLElement.");if(e.document==null)throw TypeError("createViewer: `document` is required.");let{container:t}=e;FL.get(t)?.();let n=!1,r=()=>{n=!0,a.remove()};FL.set(t,r),e.assetBaseUrl&&Zu(e.assetBaseUrl),nf();let i=new f,a=document.createElement(`div`);a.className=`pdfcedar-viewer`,a.dataset.pdfcedarVersion=AL,a.dataset.state=`loading`,rf(a,e.theme);let o=qf(),s=Zf(),c=ff();c.slot=`pages`;let l=rp();l.slot=`comments`,s.append(c,l);let u=document.createElement(`div`);u.className=`pl-main`;let d=document.createElement(`div`);d.className=`pl-body`,d.append(s,u),a.append(o,d),t.append(a),zL(a);let p=a.clientWidth>0&&a.clientWidth<IL;p&&(s.hidden=!0,a.toggleAttribute(`data-compact`,!0));let m=e.toolbar,h=e=>!m||m.includes(e),_=e.readOnly??!1,v=Tm(e.licenseKey),y={valid:!1,reason:`missing`},b=e=>{y.valid||Om(e)},x=yp();a.append(x);let S={...e.httpHeaders?{httpHeaders:e.httpHeaders}:{},...e.withCredentials?{withCredentials:!0}:{},requestPassword:e=>x.ask({incorrect:e})},C,w,T=()=>{},E=()=>{};try{if(C=await ed.open(e.document,{...S,...e.password===void 0?{}:{password:e.password}}),n)throw C.destroy(),LL();if(y=await v,w=await Fd.create(u,od.of(C),{onPageChange(e,t){a.dataset.page=String(e+1),c.setCurrentPage(e),E(),i.emit(`pageChanged`,{page:e+1,previousPage:t+1})},onZoomChange(e){a.dataset.zoom=String(e),E()},onSizesChange(){c.refreshSizes(),T()}}),w.decorateCanvas=(e,t)=>b(t),n)throw w.destroy(),C.destroy(),LL()}catch(e){if(a.remove(),FL.get(t)===r&&FL.delete(t),n)throw e instanceof DOMException?e:LL();if(e instanceof De)throw e;let i=e instanceof Error?e.message:String(e);throw Error(`createViewer: could not open the document (${i}).`,{cause:e})}if(a.dataset.state=`ready`,a.dataset.license=y.valid?`valid`:`trial`,!y.valid){a.dataset.licenseReason=y.reason;let e=document.createElement(`div`);e.className=`pl-trial-badge`,e.setAttribute(`role`,`note`),e.textContent=`Trial`,e.title=`PDFCedar is running in trial mode: ${Em[y.reason]}.`,u.append(e),console.warn(`[pdfcedar] Trial mode (pages are watermarked): ${Em[y.reason]}. Pass a valid \`licenseKey\` to createViewer.`)}a.dataset.page=`1`,a.dataset.pageCount=String(w.pageCount),a.dataset.zoom=String(w.currentZoom);let D=e=>c.setSource({pageCount:e.count,pageSize:e=>w.pageSize(e),render:async(t,n,r)=>{let i=await Kd(e,t,n,r);return i&&(se(i,t),b(i)),i}});D(w.pageList),c.onSelect=e=>{w.goToPage(e),pe&&me(!1)};let O=vf();u.append(O);let k=new Gd(w,e=>{O.setStatus(e),a.dataset.searchTotal=String(e.total),a.dataset.searchCurrent=String(e.current+1),a.dataset.searching=String(e.searching)});O.onQuery=e=>void k.search(e),O.onNext=()=>k.next(),O.onPrevious=()=>k.previous(),O.onClose=()=>{k.clear(),w.scroller.focus({preventScroll:!0})};let A=new we,j=()=>{a.dataset.canUndo=String(A.state.canUndo),a.dataset.canRedo=String(A.state.canRedo)};A.onChange(j),j();let M=new fe({undo:A,emit:(e,t)=>{if(i.emit(e,t),e===`annotationAdded`){let{annotation:e,source:n}=t;e.type===`signature`&&(n===`user`||n===`api`)&&i.emit(`signatureAdded`,{annotation:e})}},user:()=>e.user,pageCount:()=>w.pageCount}),N=dp();a.append(N);let P=new qp(e.signatureStore,e.user?.id??``),ee=new Pp({root:a,main:u,viewport:w,manager:M,history:A,events:i,tools:m?bf.filter(e=>e===`select`||m.includes(e)):bf,readOnly:_,applyRedactions:async()=>{let e=ae().length;await re.ask({title:`Apply ${e} redaction${e===1?``:`s`}?`,message:`The marked areas turn black, and what's under them is permanently removed when you save. Annotations and form fields under them are deleted. This can't be undone.`,confirmLabel:`Apply redactions`,danger:!0})&&await R.apply()},chooseSignature:async()=>{let e=await P.all(),t=await N.choose(e,e=>void P.remove(e));if(!t)return null;let n=await Up(t.image);return t.remember&&await P.add(n),{image:n,...await Gp(n)}}}),te=new je({undo:A,emit:e=>i.emit(`formFieldChanged`,e),available:e=>e.widgets.some(e=>w.pageList.entries.some(t=>t.doc===C&&t.index===e.pageIndex))}),ne=new Rp({viewport:w,manager:te,doc:C,readOnly:_}),re=hp();a.append(re);let ie=e=>M.list({page:e,type:`redaction`}).filter(e=>e.type===`redaction`&&e.applied),ae=()=>M.list({type:`redaction`}).filter(e=>e.type===`redaction`&&!e.applied),oe=(e,t)=>e.x<t.x+t.width&&t.x<e.x+e.width&&e.y<t.y+t.height&&t.y<e.y+e.height;function se(e,t){let n=ie(t+1);if(n.length===0)return;let r=e.getContext(`2d`);r.fillStyle=`#000`;for(let i of n){let n=He(i.rect,w.pageSize(t));r.fillRect(n.left*e.width,n.top*e.height,n.width*e.width,n.height*e.height)}}let ce=new Set,le=()=>{let e=new Set;for(let t of M.list({type:`redaction`}))t.type===`redaction`&&t.applied&&e.add(t.page-1);for(let t of new Set([...ce,...e]))w.setTextMask(t,ie(t+1).map(e=>He(e.rect,w.pageSize(t))));ce=e,ne.layout()};w.decorateCanvas=(e,t)=>{se(t,e),b(t)},k.hidden=(e,t)=>ie(e+1).some(e=>t.some(t=>oe(e.rect,t))),ne.masked=(e,t)=>ie(t+1).some(t=>oe(t.rect,e.rect)),T=()=>{ee.refreshAll(),le()},ee.toolbar.slot=`tools`,o.append(ee.toolbar);let ue=new Xp({viewport:w,manager:M,history:A,original:C,open:S,onChange(e){a.dataset.pageCount=String(e.count),D(e),c.setCurrentPage(w.currentIndex),k.clear(),ee.refreshAll(),E()}}),de=!0,pe=p,me=e=>{de=e,s.hidden=!e,a.dataset.sidebar=e?`open`:`closed`,E()};E=()=>o.setState({page:w.currentIndex+1,pageCount:w.pageCount,zoom:w.currentZoom,fit:w.fitMode,sidebarOpen:de}),o.setFeatures({zoom:h(`zoom`),search:h(`search`),download:h(`download`),print:h(`print`)}),o.onSidebarToggle=()=>me(!de);let he=e=>{e!==pe&&(pe=e,a.toggleAttribute(`data-compact`,e),o.setCompact(e),e&&me(!1))},ge=new ResizeObserver(([e])=>he((e?.contentRect.width??1e3)<IL));ge.observe(a),o.setCompact(pe);let _e=$d(w,{onPinchStart:()=>ee.cancelGesture()});o.onPage=e=>{e>=1&&e<=w.pageCount&&w.goToPage(e-1)},o.onZoom=e=>e===`width`||e===`page`?w.fit(e):w.setZoom(e),o.onSearch=()=>O.open();let F=e=>t=>console.error(`[pdfcedar] ${e} failed`,t);o.onDownload=()=>void z.download().catch(F(`download`)),o.onPrint=()=>void z.print().catch(F(`print`)),me(!pe),c.setPageTools(h(`pages`)&&!_),c.onRotate=e=>ue.rotate(e+1,90,`user`),c.onDelete=e=>{w.pageCount>1&&ue.delete(e+1,`user`)},c.onMove=(e,t)=>ue.move(e+1,t+1,`user`),c.onMerge=e=>void ue.merge(e).catch(F(`adding pages`));let ve=!1,ye=()=>{ve||(ve=!0,queueMicrotask(()=>{ve=!1;let e=M.list(),t=new Map;for(let n of e)n.type===`reply`&&t.set(n.inReplyTo,(t.get(n.inReplyTo)??0)+1);let n=e.filter(e=>e.type!==`reply`).sort((e,t)=>e.page-t.page||t.rect.y+t.rect.height-(e.rect.y+e.rect.height)||e.rect.x-t.rect.x).map(e=>({id:e.id,label:Op[e.type],page:e.page,color:e.color,author:e.author,modifiedAt:e.modifiedAt,contents:e.contents,replies:t.get(e.id)??0}));l.setItems(n)}))};for(let e of[`annotationAdded`,`annotationChanged`,`annotationRemoved`])i.on(e,ye);ye(),l.onSelect=e=>ee.focusAnnotation(e),ee.onSelectionChange=e=>l.setSelected(e);let be=new AbortController,{signal:xe}=be;a.addEventListener(`keydown`,e=>{if(!(e.ctrlKey||e.metaKey)||e.altKey)return;let t=e.key.toLowerCase();if(t===`f`){if(!h(`search`))return;e.preventDefault(),O.open()}else PL(e.composedPath()[0])||(t===`z`&&!e.shiftKey?(e.preventDefault(),A.undo()):(t===`z`&&e.shiftKey||t===`y`)&&(e.preventDefault(),A.redo()))},{signal:xe}),a.addEventListener(`copy`,e=>{let t=document.getSelection();t&&!t.isCollapsed&&e.clipboardData&&(e.clipboardData.setData(`text/plain`,Hd(t.toString())),e.preventDefault())},{signal:xe}),u.addEventListener(`pointerdown`,e=>e.target.closest(`.textLayer`)?.classList.add(`selecting`),{signal:xe}),document.addEventListener(`pointerup`,()=>u.querySelectorAll(`.textLayer.selecting`).forEach(e=>e.classList.remove(`selecting`)),{signal:xe});let Se=!1,I=[],Ce=(async()=>{try{let e=await C.scanAnnotations(g);if(Se)return;if(e.widgets.length>0){te.load(Be(e.widgets)),ne.build();let t=new Map(e.widgets.flatMap(({pageIndex:e,widgets:t})=>t.map(t=>[t.id,{pageIndex:e,popupRef:null}])));C.hideAnnotations(t);let n=new Map;w.pageList.entries.forEach((e,t)=>e.doc===C&&n.set(e.index,t));let r=new Set(e.widgets.flatMap(e=>n.has(e.pageIndex)?[n.get(e.pageIndex)]:[]));w.rerenderPages(r),c.invalidate(r)}if(e.annotations.size===0)return;let{readAnnotations:t}=await jL(),n=await t(await C.getData());if(Se)return;let r=new Map;w.pageList.entries.forEach((e,t)=>e.doc===C&&r.set(e.index,t));let i=n.annotations.flatMap((e,t)=>{let i=r.get(e.page-1);return i===void 0?[]:[{annotation:{...e,page:i+1},pdfId:n.ids[t]}]}),a=VL(M,A,i.map(e=>e.annotation)),o=new Map;for(let{annotation:t,pdfId:n}of i){let r=e.annotations.get(n);r&&a.has(t.id)&&o.set(n,r)}C.hideAnnotations(o),I=n.ids;let s=new Set([...o.values()].flatMap(e=>r.has(e.pageIndex)?[r.get(e.pageIndex)]:[]));w.rerenderPages(s),c.invalidate(s)}catch(e){console.warn(`[pdfcedar] could not load the annotations in this PDF; they stay visible but not editable.`,e)}})();Ce.then(()=>{Se||i.emit(`documentLoaded`,{pageCount:w.pageCount})});let L=null;if(e.collaboration){let{serverUrl:t,roomId:n}=e.collaboration,r=e.user??{id:`guest-${Math.random().toString(36).slice(2,10)}`,name:`Guest`},s=Ep();s.slot=`presence`,o.append(s),Ce.then(ML).then(({startCollaboration:e})=>{if(Se)return;let o=e({serverUrl:t,roomId:n,user:r,bridge:{annotations:{list:()=>M.export(),applyRemote:e=>{M.applyRemote(e);let t=(e.upsert??[]).filter(e=>{let t=e;return t.type===`redaction`&&t.applied===!0});if(t.length){A.clear(),le();let e=new Set(t.map(e=>e.page-1));w.rerenderPages(e),c.invalidate(e)}},onLocal:e=>{let t=({annotation:t,source:n})=>n!==`remote`&&e({upsert:t}),n=({annotation:t,source:n})=>n!==`remote`&&e({upsert:t}),r=({annotation:t,source:n})=>n!==`remote`&&e({remove:t.id});return i.on(`annotationAdded`,t),i.on(`annotationChanged`,n),i.on(`annotationRemoved`,r),()=>{i.off(`annotationAdded`,t),i.off(`annotationChanged`,n),i.off(`annotationRemoved`,r)}}},forms:{values:()=>te.values(),applyRemote:e=>te.applyRemote(e),onLocal:e=>{let t=({name:t,value:n,source:r})=>r!==`remote`&&e(t,n);return i.on(`formFieldChanged`,t),()=>i.off(`formFieldChanged`,t)}}}}),l=()=>{s.setStatus(o.status),s.setPeers(o.peers),a.dataset.collab=o.status};o.onChange(l),l(),L=o}).catch(e=>{s.setStatus(`disconnected`),console.error(`[pdfcedar] collaboration could not start`,e)})}let R={mark:({page:e,rect:t})=>M.add({type:`redaction`,page:e,rect:t},`api`),async apply(){let e=ae();if(e.length===0)return;A.untracked(()=>{for(let t of M.list())t.type!==`redaction`&&t.type!==`reply`&&e.some(e=>e.page===t.page&&oe(e.rect,t.rect))&&M.remove(t.id,`api`)}),M.markApplied(e.map(e=>e.id),`api`),A.clear(),le();let t=new Set(e.map(e=>e.page-1));w.rerenderPages(t),c.invalidate(t)}},Te=async()=>{await Ce,ne.commitPending();let{saveDocument:e}=await jL(),t=ue.unchanged?null:ue.plan(),n=te.changed(),r=te.flattened||Object.keys(n).length>0;return e(await C.getData(),M.export(),{replacedIds:I,imageCodec:Jp,...y.valid?{}:{watermark:`PDFCedar trial`},...r?{form:{values:n,flatten:te.flattened}}:{},...t?{pages:t.pages,extraDocuments:await Promise.all(t.documents.map(e=>e.getData()))}:{}})},Ee=async()=>{let e=await Te();return Se||i.emit(`saved`,{bytes:e}),e},z={on:(e,t)=>i.on(e,t),off:(e,t)=>i.off(e,t),goToPage(e){let t=w.pageCount;if(!Number.isInteger(e)||e<1||e>t)throw RangeError(`goToPage: expected an integer from 1 to ${t}, got ${e}.`);w.goToPage(e-1)},setZoom:e=>w.setZoom(e),fit:e=>w.fit(e),search(e){if(typeof e!=`string`)throw TypeError(`search: expected a string.`);return e.trim()===``?(O.close(),k.clear(),Promise.resolve([])):(O.open(e),k.search(e))},annotations:{add:e=>M.add(e),update:(e,t)=>M.update(e,t),remove:e=>M.remove(e),list:e=>M.list(e),export:()=>M.export(),import:(e,t)=>void M.import(e,t)},undo:()=>void A.undo(),redo:()=>void A.redo(),pages:{rotate:(e,t)=>ue.rotate(e,t),delete:e=>ue.delete(e),move:(e,t)=>ue.move(e,t),merge:e=>ue.merge(e)},forms:{getValues:()=>te.values(),setValues:e=>te.setValues(e,`api`),flatten:()=>te.flatten()},signatures:{async add({page:e,rect:t,image:n}){let r=await Up(n);if(Se)throw Error(`signatures.add: the viewer was destroyed.`);return M.add({type:`signature`,page:e,rect:t,image:r},`api`)}},redaction:R,save:Ee,async download(t){let n=await Ee(),r=URL.createObjectURL(new Blob([n],{type:`application/pdf`})),i=document.createElement(`a`);i.href=r,i.download=t??NL(e.document),i.rel=`noopener`,i.style.display=`none`,document.body.append(i),i.click(),i.remove(),setTimeout(()=>URL.revokeObjectURL(r),6e4)},async print(){await Qd(await Te())},destroy(){Se||(Se=!0,i.clear(),be.abort(),ge.disconnect(),L?.destroy(),_e(),ee.destroy(),ne.destroy(),ue.destroy(),k.clear(),w.destroy(),C.destroy(),a.remove(),FL.get(t)===Oe&&FL.delete(t))}},Oe=()=>z.destroy();return FL.set(t,Oe),E(),z}function VL(e,t,n){return t.untracked(()=>{try{return e.import(n,{},`document`),new Set(n.map(e=>e.id))}catch(t){console.warn(`[pdfcedar] some annotations in this PDF are invalid; loading the others.`,t);let r=new Set;for(let t of[...n].sort((e,t)=>Number(e.type===`reply`)-Number(t.type===`reply`)))try{e.import([t],{},`document`),r.add(t.id)}catch{}return r}})}Ne(),re(),z(),Me(),e.AnnotationValidationError=P,e.EncryptedDocumentError=De,e.FormValueError=ke,e.NotImplementedError=Ee,e.VERSION=AL,e.createViewer=BL});
1026
+ //# sourceMappingURL=index.umd.cjs.map