@embedpdf/engines 1.0.6 → 1.0.8

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.
@@ -232,6 +232,21 @@ class WebWorkerEngine {
232
232
  this.proxy(task, request);
233
233
  return task;
234
234
  }
235
+ updateAnnotationColor(doc, page, annotation, color, which = 0) {
236
+ this.logger.debug(LOG_SOURCE, LOG_CATEGORY, 'setAnnotationColor', doc, page, annotation, color);
237
+ const requestId = this.generateRequestId(doc.id);
238
+ const task = new WorkerTask(this.worker, requestId);
239
+ const request = {
240
+ id: requestId,
241
+ type: 'ExecuteRequest',
242
+ data: {
243
+ name: 'updateAnnotationColor',
244
+ args: [doc, page, annotation, color, which],
245
+ },
246
+ };
247
+ this.proxy(task, request);
248
+ return task;
249
+ }
235
250
  /**
236
251
  * {@inheritDoc @embedpdf/models!PdfEngine.getDocPermissions}
237
252
  *
@@ -352,6 +367,26 @@ class WebWorkerEngine {
352
367
  this.proxy(task, request);
353
368
  return task;
354
369
  }
370
+ /**
371
+ * {@inheritDoc @embedpdf/models!PdfEngine.renderAnnotation}
372
+ *
373
+ * @public
374
+ */
375
+ renderAnnotation(doc, page, annotation, scaleFactor, rotation, dpr, mode, imageType) {
376
+ this.logger.debug(LOG_SOURCE, LOG_CATEGORY, 'renderAnnotation', doc, page, annotation, scaleFactor, rotation, dpr, mode, imageType);
377
+ const requestId = this.generateRequestId(doc.id);
378
+ const task = new WorkerTask(this.worker, requestId);
379
+ const request = {
380
+ id: requestId,
381
+ type: 'ExecuteRequest',
382
+ data: {
383
+ name: 'renderAnnotation',
384
+ args: [doc, page, annotation, scaleFactor, rotation, dpr, mode, imageType],
385
+ },
386
+ };
387
+ this.proxy(task, request);
388
+ return task;
389
+ }
355
390
  /**
356
391
  * {@inheritDoc @embedpdf/models!PdfEngine.getAllAnnotations}
357
392
  *
@@ -412,21 +447,16 @@ class WebWorkerEngine {
412
447
  this.proxy(task, request);
413
448
  return task;
414
449
  }
415
- /**
416
- * {@inheritDoc @embedpdf/models!PdfEngine.transformPageAnnotation}
417
- *
418
- * @public
419
- */
420
- transformPageAnnotation(doc, page, annotation, transformation) {
421
- this.logger.debug(LOG_SOURCE, LOG_CATEGORY, 'transformPageAnnotation', doc, page, annotation, transformation);
450
+ updatePageAnnotation(doc, page, annotation) {
451
+ this.logger.debug(LOG_SOURCE, LOG_CATEGORY, 'updatePageAnnotation', doc, page, annotation);
422
452
  const requestId = this.generateRequestId(doc.id);
423
453
  const task = new WorkerTask(this.worker, requestId);
424
454
  const request = {
425
455
  id: requestId,
426
456
  type: 'ExecuteRequest',
427
457
  data: {
428
- name: 'transformPageAnnotation',
429
- args: [doc, page, annotation, transformation],
458
+ name: 'updatePageAnnotation',
459
+ args: [doc, page, annotation],
430
460
  },
431
461
  };
432
462
  this.proxy(task, request);
@@ -809,7 +839,7 @@ WebWorkerEngine.readyTaskId = '0';
809
839
  * const engine = createDefaultWorkerEngine('/wasm/pdfium.wasm');
810
840
  */
811
841
  function createPdfiumEngine(wasmUrl, logger) {
812
- const worker = new Worker(URL.createObjectURL(new Blob(["var e,t=(e=import.meta.url,async function(t={}){var n,r,o,i=t,a=new Promise(((e,t)=>{r=e,o=t}));[\"_FORM_CanRedo\",\"_FORM_CanUndo\",\"_FORM_DoDocumentAAction\",\"_FORM_DoDocumentJSAction\",\"_FORM_DoDocumentOpenAction\",\"_FORM_DoPageAAction\",\"_FORM_ForceToKillFocus\",\"_FORM_GetFocusedAnnot\",\"_FORM_GetFocusedText\",\"_FORM_GetSelectedText\",\"_FORM_IsIndexSelected\",\"_FORM_OnAfterLoadPage\",\"_FORM_OnBeforeClosePage\",\"_FORM_OnChar\",\"_FORM_OnFocus\",\"_FORM_OnKeyDown\",\"_FORM_OnKeyUp\",\"_FORM_OnLButtonDoubleClick\",\"_FORM_OnLButtonDown\",\"_FORM_OnLButtonUp\",\"_FORM_OnMouseMove\",\"_FORM_OnMouseWheel\",\"_FORM_OnRButtonDown\",\"_FORM_OnRButtonUp\",\"_FORM_Redo\",\"_FORM_ReplaceAndKeepSelection\",\"_FORM_ReplaceSelection\",\"_FORM_SelectAllText\",\"_FORM_SetFocusedAnnot\",\"_FORM_SetIndexSelected\",\"_FORM_Undo\",\"_FPDF_AddInstalledFont\",\"_FPDF_CloseDocument\",\"_FPDF_ClosePage\",\"_FPDF_CloseXObject\",\"_FPDF_CopyViewerPreferences\",\"_FPDF_CountNamedDests\",\"_FPDF_CreateClipPath\",\"_FPDF_CreateNewDocument\",\"_FPDF_DestroyClipPath\",\"_FPDF_DestroyLibrary\",\"_FPDF_DeviceToPage\",\"_FPDF_DocumentHasValidCrossReferenceTable\",\"_FPDF_FFLDraw\",\"_FPDF_FreeDefaultSystemFontInfo\",\"_FPDF_GetDefaultSystemFontInfo\",\"_FPDF_GetDefaultTTFMap\",\"_FPDF_GetDefaultTTFMapCount\",\"_FPDF_GetDefaultTTFMapEntry\",\"_FPDF_GetDocPermissions\",\"_FPDF_GetDocUserPermissions\",\"_FPDF_GetFileIdentifier\",\"_FPDF_GetFileVersion\",\"_FPDF_GetFormType\",\"_FPDF_GetLastError\",\"_FPDF_GetMetaText\",\"_FPDF_GetNamedDest\",\"_FPDF_GetNamedDestByName\",\"_FPDF_GetPageAAction\",\"_FPDF_GetPageBoundingBox\",\"_FPDF_GetPageCount\",\"_FPDF_GetPageHeight\",\"_FPDF_GetPageHeightF\",\"_FPDF_GetPageLabel\",\"_FPDF_GetPageSizeByIndex\",\"_FPDF_GetPageSizeByIndexF\",\"_FPDF_GetPageWidth\",\"_FPDF_GetPageWidthF\",\"_FPDF_GetSecurityHandlerRevision\",\"_FPDF_GetSignatureCount\",\"_FPDF_GetSignatureObject\",\"_FPDF_GetTrailerEnds\",\"_FPDF_GetXFAPacketContent\",\"_FPDF_GetXFAPacketCount\",\"_FPDF_GetXFAPacketName\",\"_FPDF_ImportNPagesToOne\",\"_FPDF_ImportPages\",\"_FPDF_ImportPagesByIndex\",\"_FPDF_InitLibrary\",\"_FPDF_InitLibraryWithConfig\",\"_FPDF_LoadCustomDocument\",\"_FPDF_LoadDocument\",\"_FPDF_LoadMemDocument\",\"_FPDF_LoadMemDocument64\",\"_FPDF_LoadPage\",\"_FPDF_LoadXFA\",\"_FPDF_MovePages\",\"_FPDF_NewFormObjectFromXObject\",\"_FPDF_NewXObjectFromPage\",\"_FPDF_PageToDevice\",\"_FPDF_RemoveFormFieldHighlight\",\"_FPDF_RenderPage_Close\",\"_FPDF_RenderPage_Continue\",\"_FPDF_RenderPageBitmap\",\"_FPDF_RenderPageBitmap_Start\",\"_FPDF_RenderPageBitmapWithColorScheme_Start\",\"_FPDF_RenderPageBitmapWithMatrix\",\"_FPDF_SaveAsCopy\",\"_FPDF_SaveWithVersion\",\"_FPDF_SetFormFieldHighlightAlpha\",\"_FPDF_SetFormFieldHighlightColor\",\"_FPDF_SetSandBoxPolicy\",\"_FPDF_SetSystemFontInfo\",\"_FPDF_StructElement_Attr_CountChildren\",\"_FPDF_StructElement_Attr_GetBlobValue\",\"_FPDF_StructElement_Attr_GetBooleanValue\",\"_FPDF_StructElement_Attr_GetChildAtIndex\",\"_FPDF_StructElement_Attr_GetCount\",\"_FPDF_StructElement_Attr_GetName\",\"_FPDF_StructElement_Attr_GetNumberValue\",\"_FPDF_StructElement_Attr_GetStringValue\",\"_FPDF_StructElement_Attr_GetType\",\"_FPDF_StructElement_Attr_GetValue\",\"_FPDF_StructElement_CountChildren\",\"_FPDF_StructElement_GetActualText\",\"_FPDF_StructElement_GetAltText\",\"_FPDF_StructElement_GetAttributeAtIndex\",\"_FPDF_StructElement_GetAttributeCount\",\"_FPDF_StructElement_GetChildAtIndex\",\"_FPDF_StructElement_GetChildMarkedContentID\",\"_FPDF_StructElement_GetID\",\"_FPDF_StructElement_GetLang\",\"_FPDF_StructElement_GetMarkedContentID\",\"_FPDF_StructElement_GetMarkedContentIdAtIndex\",\"_FPDF_StructElement_GetMarkedContentIdCount\",\"_FPDF_StructElement_GetObjType\",\"_FPDF_StructElement_GetParent\",\"_FPDF_StructElement_GetStringAttribute\",\"_FPDF_StructElement_GetTitle\",\"_FPDF_StructElement_GetType\",\"_FPDF_StructTree_Close\",\"_FPDF_StructTree_CountChildren\",\"_FPDF_StructTree_GetChildAtIndex\",\"_FPDF_StructTree_GetForPage\",\"_FPDF_VIEWERREF_GetDuplex\",\"_FPDF_VIEWERREF_GetName\",\"_FPDF_VIEWERREF_GetNumCopies\",\"_FPDF_VIEWERREF_GetPrintPageRange\",\"_FPDF_VIEWERREF_GetPrintPageRangeCount\",\"_FPDF_VIEWERREF_GetPrintPageRangeElement\",\"_FPDF_VIEWERREF_GetPrintScaling\",\"_FPDFAction_GetDest\",\"_FPDFAction_GetFilePath\",\"_FPDFAction_GetType\",\"_FPDFAction_GetURIPath\",\"_FPDFAnnot_AddFileAttachment\",\"_FPDFAnnot_AddInkStroke\",\"_FPDFAnnot_AppendAttachmentPoints\",\"_FPDFAnnot_AppendObject\",\"_FPDFAnnot_CountAttachmentPoints\",\"_FPDFAnnot_GetAP\",\"_FPDFAnnot_GetAttachmentPoints\",\"_FPDFAnnot_GetBorder\",\"_FPDFAnnot_GetColor\",\"_FPDFAnnot_GetFileAttachment\",\"_FPDFAnnot_GetFlags\",\"_FPDFAnnot_GetFocusableSubtypes\",\"_FPDFAnnot_GetFocusableSubtypesCount\",\"_FPDFAnnot_GetFontColor\",\"_FPDFAnnot_GetFontSize\",\"_FPDFAnnot_GetFormAdditionalActionJavaScript\",\"_FPDFAnnot_GetFormControlCount\",\"_FPDFAnnot_GetFormControlIndex\",\"_FPDFAnnot_GetFormFieldAlternateName\",\"_FPDFAnnot_GetFormFieldAtPoint\",\"_FPDFAnnot_GetFormFieldExportValue\",\"_FPDFAnnot_GetFormFieldFlags\",\"_FPDFAnnot_GetFormFieldName\",\"_FPDFAnnot_GetFormFieldType\",\"_FPDFAnnot_GetFormFieldValue\",\"_FPDFAnnot_GetInkListCount\",\"_FPDFAnnot_GetInkListPath\",\"_FPDFAnnot_GetLine\",\"_FPDFAnnot_GetLink\",\"_FPDFAnnot_GetLinkedAnnot\",\"_FPDFAnnot_GetNumberValue\",\"_FPDFAnnot_GetObject\",\"_FPDFAnnot_GetObjectCount\",\"_FPDFAnnot_GetOptionCount\",\"_FPDFAnnot_GetOptionLabel\",\"_FPDFAnnot_GetRect\",\"_FPDFAnnot_GetStringValue\",\"_FPDFAnnot_GetSubtype\",\"_FPDFAnnot_GetValueType\",\"_FPDFAnnot_GetVertices\",\"_FPDFAnnot_HasAttachmentPoints\",\"_FPDFAnnot_HasKey\",\"_FPDFAnnot_IsChecked\",\"_FPDFAnnot_IsObjectSupportedSubtype\",\"_FPDFAnnot_IsOptionSelected\",\"_FPDFAnnot_IsSupportedSubtype\",\"_FPDFAnnot_RemoveInkList\",\"_FPDFAnnot_RemoveObject\",\"_FPDFAnnot_SetAP\",\"_FPDFAnnot_SetAttachmentPoints\",\"_FPDFAnnot_SetBorder\",\"_FPDFAnnot_SetColor\",\"_FPDFAnnot_SetFlags\",\"_FPDFAnnot_SetFocusableSubtypes\",\"_FPDFAnnot_SetFormFieldFlags\",\"_FPDFAnnot_SetRect\",\"_FPDFAnnot_SetStringValue\",\"_FPDFAnnot_SetURI\",\"_FPDFAnnot_UpdateObject\",\"_FPDFAttachment_GetFile\",\"_FPDFAttachment_GetName\",\"_FPDFAttachment_GetStringValue\",\"_FPDFAttachment_GetSubtype\",\"_FPDFAttachment_GetValueType\",\"_FPDFAttachment_HasKey\",\"_FPDFAttachment_SetFile\",\"_FPDFAttachment_SetStringValue\",\"_FPDFAvail_Create\",\"_FPDFAvail_Destroy\",\"_FPDFAvail_GetDocument\",\"_FPDFAvail_GetFirstPageNum\",\"_FPDFAvail_IsDocAvail\",\"_FPDFAvail_IsFormAvail\",\"_FPDFAvail_IsLinearized\",\"_FPDFAvail_IsPageAvail\",\"_FPDFBitmap_Create\",\"_FPDFBitmap_CreateEx\",\"_FPDFBitmap_Destroy\",\"_FPDFBitmap_FillRect\",\"_FPDFBitmap_GetBuffer\",\"_FPDFBitmap_GetFormat\",\"_FPDFBitmap_GetHeight\",\"_FPDFBitmap_GetStride\",\"_FPDFBitmap_GetWidth\",\"_FPDFBookmark_Find\",\"_FPDFBookmark_GetAction\",\"_FPDFBookmark_GetCount\",\"_FPDFBookmark_GetDest\",\"_FPDFBookmark_GetFirstChild\",\"_FPDFBookmark_GetNextSibling\",\"_FPDFBookmark_GetTitle\",\"_FPDFCatalog_IsTagged\",\"_FPDFCatalog_SetLanguage\",\"_FPDFClipPath_CountPaths\",\"_FPDFClipPath_CountPathSegments\",\"_FPDFClipPath_GetPathSegment\",\"_FPDFDest_GetDestPageIndex\",\"_FPDFDest_GetLocationInPage\",\"_FPDFDest_GetView\",\"_FPDFDoc_AddAttachment\",\"_FPDFDoc_CloseJavaScriptAction\",\"_FPDFDoc_DeleteAttachment\",\"_FPDFDOC_ExitFormFillEnvironment\",\"_FPDFDoc_GetAttachment\",\"_FPDFDoc_GetAttachmentCount\",\"_FPDFDoc_GetJavaScriptAction\",\"_FPDFDoc_GetJavaScriptActionCount\",\"_FPDFDoc_GetPageMode\",\"_FPDFDOC_InitFormFillEnvironment\",\"_FPDFFont_Close\",\"_FPDFFont_GetAscent\",\"_FPDFFont_GetBaseFontName\",\"_FPDFFont_GetDescent\",\"_FPDFFont_GetFamilyName\",\"_FPDFFont_GetFlags\",\"_FPDFFont_GetFontData\",\"_FPDFFont_GetGlyphPath\",\"_FPDFFont_GetGlyphWidth\",\"_FPDFFont_GetIsEmbedded\",\"_FPDFFont_GetItalicAngle\",\"_FPDFFont_GetWeight\",\"_FPDFFormObj_CountObjects\",\"_FPDFFormObj_GetObject\",\"_FPDFGlyphPath_CountGlyphSegments\",\"_FPDFGlyphPath_GetGlyphPathSegment\",\"_FPDFImageObj_GetBitmap\",\"_FPDFImageObj_GetIccProfileDataDecoded\",\"_FPDFImageObj_GetImageDataDecoded\",\"_FPDFImageObj_GetImageDataRaw\",\"_FPDFImageObj_GetImageFilter\",\"_FPDFImageObj_GetImageFilterCount\",\"_FPDFImageObj_GetImageMetadata\",\"_FPDFImageObj_GetImagePixelSize\",\"_FPDFImageObj_GetRenderedBitmap\",\"_FPDFImageObj_LoadJpegFile\",\"_FPDFImageObj_LoadJpegFileInline\",\"_FPDFImageObj_SetBitmap\",\"_FPDFImageObj_SetMatrix\",\"_FPDFJavaScriptAction_GetName\",\"_FPDFJavaScriptAction_GetScript\",\"_FPDFLink_CloseWebLinks\",\"_FPDFLink_CountQuadPoints\",\"_FPDFLink_CountRects\",\"_FPDFLink_CountWebLinks\",\"_FPDFLink_Enumerate\",\"_FPDFLink_GetAction\",\"_FPDFLink_GetAnnot\",\"_FPDFLink_GetAnnotRect\",\"_FPDFLink_GetDest\",\"_FPDFLink_GetLinkAtPoint\",\"_FPDFLink_GetLinkZOrderAtPoint\",\"_FPDFLink_GetQuadPoints\",\"_FPDFLink_GetRect\",\"_FPDFLink_GetTextRange\",\"_FPDFLink_GetURL\",\"_FPDFLink_LoadWebLinks\",\"_FPDFPage_CloseAnnot\",\"_FPDFPage_CountObjects\",\"_FPDFPage_CreateAnnot\",\"_FPDFPage_Delete\",\"_FPDFPage_Flatten\",\"_FPDFPage_FormFieldZOrderAtPoint\",\"_FPDFPage_GenerateContent\",\"_FPDFPage_GetAnnot\",\"_FPDFPage_GetAnnotCount\",\"_FPDFPage_GetAnnotIndex\",\"_FPDFPage_GetArtBox\",\"_FPDFPage_GetBleedBox\",\"_FPDFPage_GetCropBox\",\"_FPDFPage_GetDecodedThumbnailData\",\"_FPDFPage_GetMediaBox\",\"_FPDFPage_GetObject\",\"_FPDFPage_GetRawThumbnailData\",\"_FPDFPage_GetRotation\",\"_FPDFPage_GetThumbnailAsBitmap\",\"_FPDFPage_GetTrimBox\",\"_FPDFPage_HasFormFieldAtPoint\",\"_FPDFPage_HasTransparency\",\"_FPDFPage_InsertClipPath\",\"_FPDFPage_InsertObject\",\"_FPDFPage_New\",\"_FPDFPage_RemoveAnnot\",\"_FPDFPage_RemoveObject\",\"_FPDFPage_SetArtBox\",\"_FPDFPage_SetBleedBox\",\"_FPDFPage_SetCropBox\",\"_FPDFPage_SetMediaBox\",\"_FPDFPage_SetRotation\",\"_FPDFPage_SetTrimBox\",\"_FPDFPage_TransformAnnots\",\"_FPDFPage_TransFormWithClip\",\"_FPDFPageObj_AddMark\",\"_FPDFPageObj_CountMarks\",\"_FPDFPageObj_CreateNewPath\",\"_FPDFPageObj_CreateNewRect\",\"_FPDFPageObj_CreateTextObj\",\"_FPDFPageObj_Destroy\",\"_FPDFPageObj_GetBounds\",\"_FPDFPageObj_GetClipPath\",\"_FPDFPageObj_GetDashArray\",\"_FPDFPageObj_GetDashCount\",\"_FPDFPageObj_GetDashPhase\",\"_FPDFPageObj_GetFillColor\",\"_FPDFPageObj_GetIsActive\",\"_FPDFPageObj_GetLineCap\",\"_FPDFPageObj_GetLineJoin\",\"_FPDFPageObj_GetMark\",\"_FPDFPageObj_GetMarkedContentID\",\"_FPDFPageObj_GetMatrix\",\"_FPDFPageObj_GetRotatedBounds\",\"_FPDFPageObj_GetStrokeColor\",\"_FPDFPageObj_GetStrokeWidth\",\"_FPDFPageObj_GetType\",\"_FPDFPageObj_HasTransparency\",\"_FPDFPageObj_NewImageObj\",\"_FPDFPageObj_NewTextObj\",\"_FPDFPageObj_RemoveMark\",\"_FPDFPageObj_SetBlendMode\",\"_FPDFPageObj_SetDashArray\",\"_FPDFPageObj_SetDashPhase\",\"_FPDFPageObj_SetFillColor\",\"_FPDFPageObj_SetIsActive\",\"_FPDFPageObj_SetLineCap\",\"_FPDFPageObj_SetLineJoin\",\"_FPDFPageObj_SetMatrix\",\"_FPDFPageObj_SetStrokeColor\",\"_FPDFPageObj_SetStrokeWidth\",\"_FPDFPageObj_Transform\",\"_FPDFPageObj_TransformClipPath\",\"_FPDFPageObj_TransformF\",\"_FPDFPageObjMark_CountParams\",\"_FPDFPageObjMark_GetName\",\"_FPDFPageObjMark_GetParamBlobValue\",\"_FPDFPageObjMark_GetParamIntValue\",\"_FPDFPageObjMark_GetParamKey\",\"_FPDFPageObjMark_GetParamStringValue\",\"_FPDFPageObjMark_GetParamValueType\",\"_FPDFPageObjMark_RemoveParam\",\"_FPDFPageObjMark_SetBlobParam\",\"_FPDFPageObjMark_SetIntParam\",\"_FPDFPageObjMark_SetStringParam\",\"_FPDFPath_BezierTo\",\"_FPDFPath_Close\",\"_FPDFPath_CountSegments\",\"_FPDFPath_GetDrawMode\",\"_FPDFPath_GetPathSegment\",\"_FPDFPath_LineTo\",\"_FPDFPath_MoveTo\",\"_FPDFPath_SetDrawMode\",\"_FPDFPathSegment_GetClose\",\"_FPDFPathSegment_GetPoint\",\"_FPDFPathSegment_GetType\",\"_FPDFSignatureObj_GetByteRange\",\"_FPDFSignatureObj_GetContents\",\"_FPDFSignatureObj_GetDocMDPPermission\",\"_FPDFSignatureObj_GetReason\",\"_FPDFSignatureObj_GetSubFilter\",\"_FPDFSignatureObj_GetTime\",\"_FPDFText_ClosePage\",\"_FPDFText_CountChars\",\"_FPDFText_CountRects\",\"_FPDFText_FindClose\",\"_FPDFText_FindNext\",\"_FPDFText_FindPrev\",\"_FPDFText_FindStart\",\"_FPDFText_GetBoundedText\",\"_FPDFText_GetCharAngle\",\"_FPDFText_GetCharBox\",\"_FPDFText_GetCharIndexAtPos\",\"_FPDFText_GetCharIndexFromTextIndex\",\"_FPDFText_GetCharOrigin\",\"_FPDFText_GetFillColor\",\"_FPDFText_GetFontInfo\",\"_FPDFText_GetFontSize\",\"_FPDFText_GetFontWeight\",\"_FPDFText_GetLooseCharBox\",\"_FPDFText_GetMatrix\",\"_FPDFText_GetRect\",\"_FPDFText_GetSchCount\",\"_FPDFText_GetSchResultIndex\",\"_FPDFText_GetStrokeColor\",\"_FPDFText_GetText\",\"_FPDFText_GetTextIndexFromCharIndex\",\"_FPDFText_GetTextObject\",\"_FPDFText_GetUnicode\",\"_FPDFText_HasUnicodeMapError\",\"_FPDFText_IsGenerated\",\"_FPDFText_IsHyphen\",\"_FPDFText_LoadCidType2Font\",\"_FPDFText_LoadFont\",\"_FPDFText_LoadPage\",\"_FPDFText_LoadStandardFont\",\"_FPDFText_SetCharcodes\",\"_FPDFText_SetText\",\"_FPDFTextObj_GetFont\",\"_FPDFTextObj_GetFontSize\",\"_FPDFTextObj_GetRenderedBitmap\",\"_FPDFTextObj_GetText\",\"_FPDFTextObj_GetTextRenderMode\",\"_FPDFTextObj_SetTextRenderMode\",\"_PDFiumExt_CloseFileWriter\",\"_PDFiumExt_CloseFormFillInfo\",\"_PDFiumExt_ExitFormFillEnvironment\",\"_PDFiumExt_GetFileWriterData\",\"_PDFiumExt_GetFileWriterSize\",\"_PDFiumExt_Init\",\"_PDFiumExt_InitFormFillEnvironment\",\"_PDFiumExt_OpenFileWriter\",\"_PDFiumExt_OpenFormFillInfo\",\"_PDFiumExt_SaveAsCopy\",\"_malloc\",\"_free\",\"_memory\",\"___indirect_function_table\",\"onRuntimeInitialized\"].forEach((e=>{Object.getOwnPropertyDescriptor(a,e)||Object.defineProperty(a,e,{get:()=>q(\"You are getting \"+e+\" on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js\"),set:()=>q(\"You are setting \"+e+\" on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js\")})}));var s=\"object\"==typeof window,F=\"function\"==typeof importScripts,u=\"object\"==typeof process&&\"object\"==typeof process.versions&&\"string\"==typeof process.versions.node&&\"renderer\"!=process.type,m=!s&&!u&&!F;if(u){const{createRequire:e}=await import(\"module\");let t=import.meta.url;t.startsWith(\"data:\")&&(t=\"/\");var l=e(t)}var d,_,P=Object.assign({},i),c=\"./this.program\",h=\"\";if(u){if(\"undefined\"==typeof process||!process.release||\"node\"!==process.release.name)throw new Error(\"not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)\");var g=process.versions.node,D=g.split(\".\").slice(0,3);if((D=1e4*D[0]+100*D[1]+1*D[2].split(\"-\")[0])<16e4)throw new Error(\"This emscripten-generated code requires node v16.0.0 (detected v\"+g+\")\");var b=l(\"fs\"),p=l(\"path\");import.meta.url.startsWith(\"data:\")||(h=p.dirname(l(\"url\").fileURLToPath(import.meta.url))+\"/\"),_=e=>{e=ne(e)?new URL(e):p.normalize(e);var t=b.readFileSync(e);return I(t.buffer),t},d=(e,t=!0)=>(e=ne(e)?new URL(e):p.normalize(e),new Promise(((n,r)=>{b.readFile(e,t?void 0:\"utf8\",((e,o)=>{e?r(e):n(t?o.buffer:o)}))}))),!i.thisProgram&&process.argv.length>1&&(c=process.argv[1].replace(/\\\\/g,\"/\")),process.argv.slice(2)}else if(m){if(\"object\"==typeof process&&\"function\"==typeof l||\"object\"==typeof window||\"function\"==typeof importScripts)throw new Error(\"not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)\");_=e=>{if(\"function\"==typeof readbuffer)return new Uint8Array(readbuffer(e));let t=read(e,\"binary\");return I(\"object\"==typeof t),t},d=e=>new Promise(((t,n)=>{setTimeout((()=>t(_(e))))})),globalThis.clearTimeout??=e=>{},globalThis.setTimeout??=e=>\"function\"==typeof e?e():q(),\"undefined\"!=typeof print&&(globalThis.console??={},console.log=print,console.warn=console.error=globalThis.printErr??print)}else{if(!s&&!F)throw new Error(\"environment detection error\");if(F?h=self.location.href:\"undefined\"!=typeof document&&document.currentScript&&(h=document.currentScript.src),e&&(h=e),h=h.startsWith(\"blob:\")?\"\":h.substr(0,h.replace(/[?#].*/,\"\").lastIndexOf(\"/\")+1),\"object\"!=typeof window&&\"function\"!=typeof importScripts)throw new Error(\"not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)\");F&&(_=e=>{var t=new XMLHttpRequest;return t.open(\"GET\",e,!1),t.responseType=\"arraybuffer\",t.send(null),new Uint8Array(t.response)}),d=e=>(I(!ne(e),\"readAsync does not work with file:// URLs\"),fetch(e,{credentials:\"same-origin\"}).then((e=>e.ok?e.arrayBuffer():Promise.reject(new Error(e.status+\" : \"+e.url)))))}var f,A=i.print||console.log.bind(console),G=i.printErr||console.error.bind(console);Object.assign(i,P),P=null,f=\"fetchSettings\",Object.getOwnPropertyDescriptor(i,f)&&q(`\\`Module.${f}\\` was supplied but \\`${f}\\` not included in INCOMING_MODULE_JS_API`),i.arguments&&i.arguments,se(\"arguments\",\"arguments_\"),i.thisProgram&&(c=i.thisProgram),se(\"thisProgram\",\"thisProgram\"),I(void 0===i.memoryInitializerPrefixURL,\"Module.memoryInitializerPrefixURL option was removed, use Module.locateFile instead\"),I(void 0===i.pthreadMainPrefixURL,\"Module.pthreadMainPrefixURL option was removed, use Module.locateFile instead\"),I(void 0===i.cdInitializerPrefixURL,\"Module.cdInitializerPrefixURL option was removed, use Module.locateFile instead\"),I(void 0===i.filePackagePrefixURL,\"Module.filePackagePrefixURL option was removed, use Module.locateFile instead\"),I(void 0===i.read,\"Module.read option was removed\"),I(void 0===i.readAsync,\"Module.readAsync option was removed (modify readAsync in JS)\"),I(void 0===i.readBinary,\"Module.readBinary option was removed (modify readBinary in JS)\"),I(void 0===i.setWindowTitle,\"Module.setWindowTitle option was removed (modify emscripten_set_window_title in JS)\"),I(void 0===i.TOTAL_MEMORY,\"Module.TOTAL_MEMORY has been renamed Module.INITIAL_MEMORY\"),se(\"asm\",\"wasmExports\"),se(\"readAsync\",\"readAsync\"),se(\"readBinary\",\"readBinary\"),se(\"setWindowTitle\",\"setWindowTitle\");var E,S=i.wasmBinary;se(\"wasmBinary\",\"wasmBinary\"),\"object\"!=typeof WebAssembly&&G(\"no native wasm support detected\");var T,M,C,y,O,x,v,w,R=!1;function I(e,t){e||q(\"Assertion failed\"+(t?\": \"+t:\"\"))}function k(){var e=E.buffer;i.HEAP8=T=new Int8Array(e),i.HEAP16=C=new Int16Array(e),i.HEAPU8=M=new Uint8Array(e),i.HEAPU16=y=new Uint16Array(e),i.HEAP32=O=new Int32Array(e),i.HEAPU32=x=new Uint32Array(e),i.HEAPF32=v=new Float32Array(e),i.HEAPF64=w=new Float64Array(e)}function j(){if(!R){var e=dt();0==e&&(e+=4);var t=x[e>>2],n=x[e+4>>2];34821223==t&&2310721022==n||q(`Stack overflow! Stack cookie has been overwritten at ${_e(e)}, expected hex dwords 0x89BACDFE and 0x2135467, but received ${_e(n)} ${_e(t)}`),1668509029!=x[0]&&q(\"Runtime error: The application has corrupted its heap memory area (address zero)!\")}}I(!i.STACK_SIZE,\"STACK_SIZE can no longer be set at runtime. Use -sSTACK_SIZE at link time\"),I(\"undefined\"!=typeof Int32Array&&\"undefined\"!=typeof Float64Array&&null!=Int32Array.prototype.subarray&&null!=Int32Array.prototype.set,\"JS engine does not provide full typed array support\"),I(!i.wasmMemory,\"Use of `wasmMemory` detected. Use -sIMPORTED_MEMORY to define wasmMemory externally\"),I(!i.INITIAL_MEMORY,\"Detected runtime INITIAL_MEMORY setting. Use -sIMPORTED_MEMORY to define wasmMemory dynamically\");var L=[],B=[],N=[],U=!1;function V(e){L.unshift(e)}function W(e){N.unshift(e)}I(Math.imul,\"This browser does not support Math.imul(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill\"),I(Math.fround,\"This browser does not support Math.fround(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill\"),I(Math.clz32,\"This browser does not support Math.clz32(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill\"),I(Math.trunc,\"This browser does not support Math.trunc(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill\");var z=0,H=null,$=null,X={};function K(e){for(var t=e;;){if(!X[e])return e;e=t+Math.random()}}function Y(e){z++,i.monitorRunDependencies?.(z),e?(I(!X[e]),X[e]=1,null===H&&\"undefined\"!=typeof setInterval&&(H=setInterval((()=>{if(R)return clearInterval(H),void(H=null);var e=!1;for(var t in X)e||(e=!0,G(\"still waiting on run dependencies:\")),G(`dependency: ${t}`);e&&G(\"(end of list)\")}),1e4))):G(\"warning: run dependency added without ID\")}function J(e){if(z--,i.monitorRunDependencies?.(z),e?(I(X[e]),delete X[e]):G(\"warning: run dependency removed without ID\"),0==z&&(null!==H&&(clearInterval(H),H=null),$)){var t=$;$=null,t()}}function q(e){i.onAbort?.(e),G(e=\"Aborted(\"+e+\")\"),R=!0;var t=new WebAssembly.RuntimeError(e);throw o(t),t}var Q,Z,ee,te=e=>e.startsWith(\"data:application/octet-stream;base64,\"),ne=e=>e.startsWith(\"file://\");function re(e,t){return(...n)=>{I(U,`native function \\`${e}\\` called before runtime initialization`);var r=ot[e];return I(r,`exported native function \\`${e}\\` not found`),I(n.length<=t,`native function \\`${e}\\` called with ${n.length} args but expects ${t}`),r(...n)}}function oe(){if(i.locateFile){var e=\"pdfium.wasm\";return te(e)?e:(t=e,i.locateFile?i.locateFile(t,h):h+t)}var t;return m?\"pdfium.wasm\":\"pdfium.wasm\"}function ie(e){if(e==Q&&S)return new Uint8Array(S);if(_)return _(e);throw\"both async and sync fetching of the wasm failed\"}function ae(e,t,n){return function(e){return S?Promise.resolve().then((()=>ie(e))):d(e).then((e=>new Uint8Array(e)),(()=>ie(e)))}(e).then((e=>WebAssembly.instantiate(e,t))).then(n,(e=>{G(`failed to asynchronously prepare wasm: ${e}`),ne(Q)&&G(`warning: Loading from a file URI (${Q}) is not supported in most browsers. See https://emscripten.org/docs/getting_started/FAQ.html#how-do-i-run-a-local-webserver-for-testing-why-does-my-program-stall-in-downloading-or-preparing`),q(e)}))}if((()=>{var e=new Int16Array(1),t=new Int8Array(e.buffer);if(e[0]=25459,115!==t[0]||99!==t[1])throw\"Runtime error: expected the system to be little-endian! (Run with -sSUPPORT_BIG_ENDIAN to bypass)\"})(),i.ENVIRONMENT)throw new Error(\"Module.ENVIRONMENT has been deprecated. To force the environment, use the ENVIRONMENT compile-time option (for example, -sENVIRONMENT=web or -sENVIRONMENT=node)\");function se(e,t,n=!0){Object.getOwnPropertyDescriptor(i,e)||Object.defineProperty(i,e,{configurable:!0,get(){q(`\\`Module.${e}\\` has been replaced by \\`${t}\\``+(n?\" (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)\":\"\"))}})}function Fe(e){return\"FS_createPath\"===e||\"FS_createDataFile\"===e||\"FS_createPreloadedFile\"===e||\"FS_unlink\"===e||\"addRunDependency\"===e||\"FS_createLazyFile\"===e||\"FS_createDevice\"===e||\"removeRunDependency\"===e}function ue(e,t){\"undefined\"==typeof globalThis||Object.getOwnPropertyDescriptor(globalThis,e)||Object.defineProperty(globalThis,e,{configurable:!0,get(){t()}})}function me(e,t){ue(e,(()=>{he(`\\`${e}\\` is not longer defined by emscripten. ${t}`)}))}function le(e){Object.getOwnPropertyDescriptor(i,e)||Object.defineProperty(i,e,{configurable:!0,get(){var t=`'${e}' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the Emscripten FAQ)`;Fe(e)&&(t+=\". Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you\"),q(t)}})}me(\"buffer\",\"Please use HEAP8.buffer or wasmMemory.buffer\"),me(\"asm\",\"Please use wasmExports instead\");var de=e=>{e.forEach((e=>e(i)))};i.noExitRuntime;var _e=e=>(I(\"number\"==typeof e),\"0x\"+(e>>>=0).toString(16).padStart(8,\"0\")),Pe=e=>_t(e),ce=()=>ct(),he=e=>{he.shown||={},he.shown[e]||(he.shown[e]=1,u&&(e=\"warning: \"+e),G(e))},ge=\"undefined\"!=typeof TextDecoder?new TextDecoder:void 0,De=(e,t=0,n=NaN)=>{for(var r=t+n,o=t;e[o]&&!(o>=r);)++o;if(o-t>16&&e.buffer&&ge)return ge.decode(e.subarray(t,o));for(var i=\"\";t<o;){var a=e[t++];if(128&a){var s=63&e[t++];if(192!=(224&a)){var F=63&e[t++];if(224==(240&a)?a=(15&a)<<12|s<<6|F:(240!=(248&a)&&he(\"Invalid UTF-8 leading byte \"+_e(a)+\" encountered when deserializing a UTF-8 string in wasm memory to a JS string!\"),a=(7&a)<<18|s<<12|F<<6|63&e[t++]),a<65536)i+=String.fromCharCode(a);else{var u=a-65536;i+=String.fromCharCode(55296|u>>10,56320|1023&u)}}else i+=String.fromCharCode((31&a)<<6|s)}else i+=String.fromCharCode(a)}return i},be=(e,t)=>(I(\"number\"==typeof e,`UTF8ToString expects a number (got ${typeof e})`),e?De(M,e,t):\"\");function pe(){I(null!=Be.varargs);var e=O[+Be.varargs>>2];return Be.varargs+=4,e}var fe=pe,Ae={isAbs:e=>\"/\"===e.charAt(0),splitPath:e=>/^(\\/?|)([\\s\\S]*?)((?:\\.{1,2}|[^\\/]+?|)(\\.[^.\\/]*|))(?:[\\/]*)$/.exec(e).slice(1),normalizeArray:(e,t)=>{for(var n=0,r=e.length-1;r>=0;r--){var o=e[r];\".\"===o?e.splice(r,1):\"..\"===o?(e.splice(r,1),n++):n&&(e.splice(r,1),n--)}if(t)for(;n;n--)e.unshift(\"..\");return e},normalize:e=>{var t=Ae.isAbs(e),n=\"/\"===e.substr(-1);return(e=Ae.normalizeArray(e.split(\"/\").filter((e=>!!e)),!t).join(\"/\"))||t||(e=\".\"),e&&n&&(e+=\"/\"),(t?\"/\":\"\")+e},dirname:e=>{var t=Ae.splitPath(e),n=t[0],r=t[1];return n||r?(r&&(r=r.substr(0,r.length-1)),n+r):\".\"},basename:e=>{if(\"/\"===e)return\"/\";var t=(e=(e=Ae.normalize(e)).replace(/\\/$/,\"\")).lastIndexOf(\"/\");return-1===t?e:e.substr(t+1)},join:(...e)=>Ae.normalize(e.join(\"/\")),join2:(e,t)=>Ae.normalize(e+\"/\"+t)},Ge=e=>(Ge=(()=>{if(\"object\"==typeof crypto&&\"function\"==typeof crypto.getRandomValues)return e=>crypto.getRandomValues(e);if(u)try{var e=l(\"crypto\");if(e.randomFillSync)return t=>e.randomFillSync(t);var t=e.randomBytes;return e=>(e.set(t(e.byteLength)),e)}catch(e){}q(\"no cryptographic support found for randomDevice. consider polyfilling it if you want to use something insecure like Math.random(), e.g. put this in a --pre-js: var crypto = { getRandomValues: (array) => { for (var i = 0; i < array.length; i++) array[i] = (Math.random()*256)|0 } };\")})())(e),Ee={resolve:(...e)=>{for(var t=\"\",n=!1,r=e.length-1;r>=-1&&!n;r--){var o=r>=0?e[r]:Le.cwd();if(\"string\"!=typeof o)throw new TypeError(\"Arguments to path.resolve must be strings\");if(!o)return\"\";t=o+\"/\"+t,n=Ae.isAbs(o)}return(n?\"/\":\"\")+(t=Ae.normalizeArray(t.split(\"/\").filter((e=>!!e)),!n).join(\"/\"))||\".\"},relative:(e,t)=>{function n(e){for(var t=0;t<e.length&&\"\"===e[t];t++);for(var n=e.length-1;n>=0&&\"\"===e[n];n--);return t>n?[]:e.slice(t,n-t+1)}e=Ee.resolve(e).substr(1),t=Ee.resolve(t).substr(1);for(var r=n(e.split(\"/\")),o=n(t.split(\"/\")),i=Math.min(r.length,o.length),a=i,s=0;s<i;s++)if(r[s]!==o[s]){a=s;break}var F=[];for(s=a;s<r.length;s++)F.push(\"..\");return(F=F.concat(o.slice(a))).join(\"/\")}},Se=[],Te=e=>{for(var t=0,n=0;n<e.length;++n){var r=e.charCodeAt(n);r<=127?t++:r<=2047?t+=2:r>=55296&&r<=57343?(t+=4,++n):t+=3}return t},Me=(e,t,n,r)=>{if(I(\"string\"==typeof e,`stringToUTF8Array expects a string (got ${typeof e})`),!(r>0))return 0;for(var o=n,i=n+r-1,a=0;a<e.length;++a){var s=e.charCodeAt(a);if(s>=55296&&s<=57343&&(s=65536+((1023&s)<<10)|1023&e.charCodeAt(++a)),s<=127){if(n>=i)break;t[n++]=s}else if(s<=2047){if(n+1>=i)break;t[n++]=192|s>>6,t[n++]=128|63&s}else if(s<=65535){if(n+2>=i)break;t[n++]=224|s>>12,t[n++]=128|s>>6&63,t[n++]=128|63&s}else{if(n+3>=i)break;s>1114111&&he(\"Invalid Unicode code point \"+_e(s)+\" encountered when serializing a JS string to a UTF-8 string in wasm memory! (Valid unicode code points should be in range 0-0x10FFFF).\"),t[n++]=240|s>>18,t[n++]=128|s>>12&63,t[n++]=128|s>>6&63,t[n++]=128|63&s}}return t[n]=0,n-o};function Ce(e,t,n){var r=n>0?n:Te(e)+1,o=new Array(r),i=Me(e,o,0,o.length);return t&&(o.length=i),o}var ye,Oe,xe={ttys:[],init(){},shutdown(){},register(e,t){xe.ttys[e]={input:[],output:[],ops:t},Le.registerDevice(e,xe.stream_ops)},stream_ops:{open(e){var t=xe.ttys[e.node.rdev];if(!t)throw new Le.ErrnoError(43);e.tty=t,e.seekable=!1},close(e){e.tty.ops.fsync(e.tty)},fsync(e){e.tty.ops.fsync(e.tty)},read(e,t,n,r,o){if(!e.tty||!e.tty.ops.get_char)throw new Le.ErrnoError(60);for(var i=0,a=0;a<r;a++){var s;try{s=e.tty.ops.get_char(e.tty)}catch(e){throw new Le.ErrnoError(29)}if(void 0===s&&0===i)throw new Le.ErrnoError(6);if(null==s)break;i++,t[n+a]=s}return i&&(e.node.timestamp=Date.now()),i},write(e,t,n,r,o){if(!e.tty||!e.tty.ops.put_char)throw new Le.ErrnoError(60);try{for(var i=0;i<r;i++)e.tty.ops.put_char(e.tty,t[n+i])}catch(e){throw new Le.ErrnoError(29)}return r&&(e.node.timestamp=Date.now()),i}},default_tty_ops:{get_char:e=>(()=>{if(!Se.length){var e=null;if(u){var t=Buffer.alloc(256),n=0,r=process.stdin.fd;try{n=b.readSync(r,t,0,256)}catch(e){if(!e.toString().includes(\"EOF\"))throw e;n=0}n>0&&(e=t.slice(0,n).toString(\"utf-8\"))}else\"undefined\"!=typeof window&&\"function\"==typeof window.prompt?null!==(e=window.prompt(\"Input: \"))&&(e+=\"\\n\"):\"function\"==typeof readline&&(e=readline())&&(e+=\"\\n\");if(!e)return null;Se=Ce(e,!0)}return Se.shift()})(),put_char(e,t){null===t||10===t?(A(De(e.output)),e.output=[]):0!=t&&e.output.push(t)},fsync(e){e.output&&e.output.length>0&&(A(De(e.output)),e.output=[])},ioctl_tcgets:e=>({c_iflag:25856,c_oflag:5,c_cflag:191,c_lflag:35387,c_cc:[3,28,127,21,4,0,1,0,17,19,26,0,18,15,23,22,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}),ioctl_tcsets:(e,t,n)=>0,ioctl_tiocgwinsz:e=>[24,80]},default_tty1_ops:{put_char(e,t){null===t||10===t?(G(De(e.output)),e.output=[]):0!=t&&e.output.push(t)},fsync(e){e.output&&e.output.length>0&&(G(De(e.output)),e.output=[])}}},ve=(e,t)=>(I(t,\"alignment argument is required\"),Math.ceil(e/t)*t),we=e=>{e=ve(e,65536);var t=Ft(65536,e);return t&&((e,t)=>{M.fill(0,e,e+t)})(t,e),t},Re={ops_table:null,mount:e=>Re.createNode(null,\"/\",16895,0),createNode(e,t,n,r){if(Le.isBlkdev(n)||Le.isFIFO(n))throw new Le.ErrnoError(63);Re.ops_table||={dir:{node:{getattr:Re.node_ops.getattr,setattr:Re.node_ops.setattr,lookup:Re.node_ops.lookup,mknod:Re.node_ops.mknod,rename:Re.node_ops.rename,unlink:Re.node_ops.unlink,rmdir:Re.node_ops.rmdir,readdir:Re.node_ops.readdir,symlink:Re.node_ops.symlink},stream:{llseek:Re.stream_ops.llseek}},file:{node:{getattr:Re.node_ops.getattr,setattr:Re.node_ops.setattr},stream:{llseek:Re.stream_ops.llseek,read:Re.stream_ops.read,write:Re.stream_ops.write,allocate:Re.stream_ops.allocate,mmap:Re.stream_ops.mmap,msync:Re.stream_ops.msync}},link:{node:{getattr:Re.node_ops.getattr,setattr:Re.node_ops.setattr,readlink:Re.node_ops.readlink},stream:{}},chrdev:{node:{getattr:Re.node_ops.getattr,setattr:Re.node_ops.setattr},stream:Le.chrdev_stream_ops}};var o=Le.createNode(e,t,n,r);return Le.isDir(o.mode)?(o.node_ops=Re.ops_table.dir.node,o.stream_ops=Re.ops_table.dir.stream,o.contents={}):Le.isFile(o.mode)?(o.node_ops=Re.ops_table.file.node,o.stream_ops=Re.ops_table.file.stream,o.usedBytes=0,o.contents=null):Le.isLink(o.mode)?(o.node_ops=Re.ops_table.link.node,o.stream_ops=Re.ops_table.link.stream):Le.isChrdev(o.mode)&&(o.node_ops=Re.ops_table.chrdev.node,o.stream_ops=Re.ops_table.chrdev.stream),o.timestamp=Date.now(),e&&(e.contents[t]=o,e.timestamp=o.timestamp),o},getFileDataAsTypedArray:e=>e.contents?e.contents.subarray?e.contents.subarray(0,e.usedBytes):new Uint8Array(e.contents):new Uint8Array(0),expandFileStorage(e,t){var n=e.contents?e.contents.length:0;if(!(n>=t)){t=Math.max(t,n*(n<1048576?2:1.125)>>>0),0!=n&&(t=Math.max(t,256));var r=e.contents;e.contents=new Uint8Array(t),e.usedBytes>0&&e.contents.set(r.subarray(0,e.usedBytes),0)}},resizeFileStorage(e,t){if(e.usedBytes!=t)if(0==t)e.contents=null,e.usedBytes=0;else{var n=e.contents;e.contents=new Uint8Array(t),n&&e.contents.set(n.subarray(0,Math.min(t,e.usedBytes))),e.usedBytes=t}},node_ops:{getattr(e){var t={};return t.dev=Le.isChrdev(e.mode)?e.id:1,t.ino=e.id,t.mode=e.mode,t.nlink=1,t.uid=0,t.gid=0,t.rdev=e.rdev,Le.isDir(e.mode)?t.size=4096:Le.isFile(e.mode)?t.size=e.usedBytes:Le.isLink(e.mode)?t.size=e.link.length:t.size=0,t.atime=new Date(e.timestamp),t.mtime=new Date(e.timestamp),t.ctime=new Date(e.timestamp),t.blksize=4096,t.blocks=Math.ceil(t.size/t.blksize),t},setattr(e,t){void 0!==t.mode&&(e.mode=t.mode),void 0!==t.timestamp&&(e.timestamp=t.timestamp),void 0!==t.size&&Re.resizeFileStorage(e,t.size)},lookup(e,t){throw Le.genericErrors[44]},mknod:(e,t,n,r)=>Re.createNode(e,t,n,r),rename(e,t,n){if(Le.isDir(e.mode)){var r;try{r=Le.lookupNode(t,n)}catch(e){}if(r)for(var o in r.contents)throw new Le.ErrnoError(55)}delete e.parent.contents[e.name],e.parent.timestamp=Date.now(),e.name=n,t.contents[n]=e,t.timestamp=e.parent.timestamp},unlink(e,t){delete e.contents[t],e.timestamp=Date.now()},rmdir(e,t){var n=Le.lookupNode(e,t);for(var r in n.contents)throw new Le.ErrnoError(55);delete e.contents[t],e.timestamp=Date.now()},readdir(e){var t=[\".\",\"..\"];for(var n of Object.keys(e.contents))t.push(n);return t},symlink(e,t,n){var r=Re.createNode(e,t,41471,0);return r.link=n,r},readlink(e){if(!Le.isLink(e.mode))throw new Le.ErrnoError(28);return e.link}},stream_ops:{read(e,t,n,r,o){var i=e.node.contents;if(o>=e.node.usedBytes)return 0;var a=Math.min(e.node.usedBytes-o,r);if(I(a>=0),a>8&&i.subarray)t.set(i.subarray(o,o+a),n);else for(var s=0;s<a;s++)t[n+s]=i[o+s];return a},write(e,t,n,r,o,i){if(I(!(t instanceof ArrayBuffer)),t.buffer===T.buffer&&(i=!1),!r)return 0;var a=e.node;if(a.timestamp=Date.now(),t.subarray&&(!a.contents||a.contents.subarray)){if(i)return I(0===o,\"canOwn must imply no weird position inside the file\"),a.contents=t.subarray(n,n+r),a.usedBytes=r,r;if(0===a.usedBytes&&0===o)return a.contents=t.slice(n,n+r),a.usedBytes=r,r;if(o+r<=a.usedBytes)return a.contents.set(t.subarray(n,n+r),o),r}if(Re.expandFileStorage(a,o+r),a.contents.subarray&&t.subarray)a.contents.set(t.subarray(n,n+r),o);else for(var s=0;s<r;s++)a.contents[o+s]=t[n+s];return a.usedBytes=Math.max(a.usedBytes,o+r),r},llseek(e,t,n){var r=t;if(1===n?r+=e.position:2===n&&Le.isFile(e.node.mode)&&(r+=e.node.usedBytes),r<0)throw new Le.ErrnoError(28);return r},allocate(e,t,n){Re.expandFileStorage(e.node,t+n),e.node.usedBytes=Math.max(e.node.usedBytes,t+n)},mmap(e,t,n,r,o){if(!Le.isFile(e.node.mode))throw new Le.ErrnoError(43);var i,a,s=e.node.contents;if(2&o||!s||s.buffer!==T.buffer){if(a=!0,!(i=we(t)))throw new Le.ErrnoError(48);s&&((n>0||n+t<s.length)&&(s=s.subarray?s.subarray(n,n+t):Array.prototype.slice.call(s,n,n+t)),T.set(s,i))}else a=!1,i=s.byteOffset;return{ptr:i,allocated:a}},msync:(e,t,n,r,o)=>(Re.stream_ops.write(e,t,0,r,n,!1),0)}},Ie=i.preloadPlugins||[],ke=(e,t)=>{var n=0;return e&&(n|=365),t&&(n|=146),n},je={EPERM:63,ENOENT:44,ESRCH:71,EINTR:27,EIO:29,ENXIO:60,E2BIG:1,ENOEXEC:45,EBADF:8,ECHILD:12,EAGAIN:6,EWOULDBLOCK:6,ENOMEM:48,EACCES:2,EFAULT:21,ENOTBLK:105,EBUSY:10,EEXIST:20,EXDEV:75,ENODEV:43,ENOTDIR:54,EISDIR:31,EINVAL:28,ENFILE:41,EMFILE:33,ENOTTY:59,ETXTBSY:74,EFBIG:22,ENOSPC:51,ESPIPE:70,EROFS:69,EMLINK:34,EPIPE:64,EDOM:18,ERANGE:68,ENOMSG:49,EIDRM:24,ECHRNG:106,EL2NSYNC:156,EL3HLT:107,EL3RST:108,ELNRNG:109,EUNATCH:110,ENOCSI:111,EL2HLT:112,EDEADLK:16,ENOLCK:46,EBADE:113,EBADR:114,EXFULL:115,ENOANO:104,EBADRQC:103,EBADSLT:102,EDEADLOCK:16,EBFONT:101,ENOSTR:100,ENODATA:116,ETIME:117,ENOSR:118,ENONET:119,ENOPKG:120,EREMOTE:121,ENOLINK:47,EADV:122,ESRMNT:123,ECOMM:124,EPROTO:65,EMULTIHOP:36,EDOTDOT:125,EBADMSG:9,ENOTUNIQ:126,EBADFD:127,EREMCHG:128,ELIBACC:129,ELIBBAD:130,ELIBSCN:131,ELIBMAX:132,ELIBEXEC:133,ENOSYS:52,ENOTEMPTY:55,ENAMETOOLONG:37,ELOOP:32,EOPNOTSUPP:138,EPFNOSUPPORT:139,ECONNRESET:15,ENOBUFS:42,EAFNOSUPPORT:5,EPROTOTYPE:67,ENOTSOCK:57,ENOPROTOOPT:50,ESHUTDOWN:140,ECONNREFUSED:14,EADDRINUSE:3,ECONNABORTED:13,ENETUNREACH:40,ENETDOWN:38,ETIMEDOUT:73,EHOSTDOWN:142,EHOSTUNREACH:23,EINPROGRESS:26,EALREADY:7,EDESTADDRREQ:17,EMSGSIZE:35,EPROTONOSUPPORT:66,ESOCKTNOSUPPORT:137,EADDRNOTAVAIL:4,ENETRESET:39,EISCONN:30,ENOTCONN:53,ETOOMANYREFS:141,EUSERS:136,EDQUOT:19,ESTALE:72,ENOTSUP:138,ENOMEDIUM:148,EILSEQ:25,EOVERFLOW:61,ECANCELED:11,ENOTRECOVERABLE:56,EOWNERDEAD:62,ESTRPIPE:135},Le={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:\"/\",initialized:!1,ignorePermissions:!0,ErrnoError:class extends Error{constructor(e){for(var t in super(U?(e=>be(ut(e)))(e):\"\"),this.name=\"ErrnoError\",this.errno=e,je)if(je[t]===e){this.code=t;break}}},genericErrors:{},filesystems:null,syncFSRequests:0,readFiles:{},FSStream:class{constructor(){this.shared={}}get object(){return this.node}set object(e){this.node=e}get isRead(){return 1!=(2097155&this.flags)}get isWrite(){return!!(2097155&this.flags)}get isAppend(){return 1024&this.flags}get flags(){return this.shared.flags}set flags(e){this.shared.flags=e}get position(){return this.shared.position}set position(e){this.shared.position=e}},FSNode:class{constructor(e,t,n,r){e||(e=this),this.parent=e,this.mount=e.mount,this.mounted=null,this.id=Le.nextInode++,this.name=t,this.mode=n,this.node_ops={},this.stream_ops={},this.rdev=r,this.readMode=365,this.writeMode=146}get read(){return(this.mode&this.readMode)===this.readMode}set read(e){e?this.mode|=this.readMode:this.mode&=~this.readMode}get write(){return(this.mode&this.writeMode)===this.writeMode}set write(e){e?this.mode|=this.writeMode:this.mode&=~this.writeMode}get isFolder(){return Le.isDir(this.mode)}get isDevice(){return Le.isChrdev(this.mode)}},lookupPath(e,t={}){if(!(e=Ee.resolve(e)))return{path:\"\",node:null};if((t=Object.assign({follow_mount:!0,recurse_count:0},t)).recurse_count>8)throw new Le.ErrnoError(32);for(var n=e.split(\"/\").filter((e=>!!e)),r=Le.root,o=\"/\",i=0;i<n.length;i++){var a=i===n.length-1;if(a&&t.parent)break;if(r=Le.lookupNode(r,n[i]),o=Ae.join2(o,n[i]),Le.isMountpoint(r)&&(!a||a&&t.follow_mount)&&(r=r.mounted.root),!a||t.follow)for(var s=0;Le.isLink(r.mode);){var F=Le.readlink(o);if(o=Ee.resolve(Ae.dirname(o),F),r=Le.lookupPath(o,{recurse_count:t.recurse_count+1}).node,s++>40)throw new Le.ErrnoError(32)}}return{path:o,node:r}},getPath(e){for(var t;;){if(Le.isRoot(e)){var n=e.mount.mountpoint;return t?\"/\"!==n[n.length-1]?`${n}/${t}`:n+t:n}t=t?`${e.name}/${t}`:e.name,e=e.parent}},hashName(e,t){for(var n=0,r=0;r<t.length;r++)n=(n<<5)-n+t.charCodeAt(r)|0;return(e+n>>>0)%Le.nameTable.length},hashAddNode(e){var t=Le.hashName(e.parent.id,e.name);e.name_next=Le.nameTable[t],Le.nameTable[t]=e},hashRemoveNode(e){var t=Le.hashName(e.parent.id,e.name);if(Le.nameTable[t]===e)Le.nameTable[t]=e.name_next;else for(var n=Le.nameTable[t];n;){if(n.name_next===e){n.name_next=e.name_next;break}n=n.name_next}},lookupNode(e,t){var n=Le.mayLookup(e);if(n)throw new Le.ErrnoError(n);for(var r=Le.hashName(e.id,t),o=Le.nameTable[r];o;o=o.name_next){var i=o.name;if(o.parent.id===e.id&&i===t)return o}return Le.lookup(e,t)},createNode(e,t,n,r){I(\"object\"==typeof e);var o=new Le.FSNode(e,t,n,r);return Le.hashAddNode(o),o},destroyNode(e){Le.hashRemoveNode(e)},isRoot:e=>e===e.parent,isMountpoint:e=>!!e.mounted,isFile:e=>32768==(61440&e),isDir:e=>16384==(61440&e),isLink:e=>40960==(61440&e),isChrdev:e=>8192==(61440&e),isBlkdev:e=>24576==(61440&e),isFIFO:e=>4096==(61440&e),isSocket:e=>!(49152&~e),flagsToPermissionString(e){var t=[\"r\",\"w\",\"rw\"][3&e];return 512&e&&(t+=\"w\"),t},nodePermissions:(e,t)=>Le.ignorePermissions||(!t.includes(\"r\")||292&e.mode)&&(!t.includes(\"w\")||146&e.mode)&&(!t.includes(\"x\")||73&e.mode)?0:2,mayLookup(e){if(!Le.isDir(e.mode))return 54;var t=Le.nodePermissions(e,\"x\");return t||(e.node_ops.lookup?0:2)},mayCreate(e,t){try{return Le.lookupNode(e,t),20}catch(e){}return Le.nodePermissions(e,\"wx\")},mayDelete(e,t,n){var r;try{r=Le.lookupNode(e,t)}catch(e){return e.errno}var o=Le.nodePermissions(e,\"wx\");if(o)return o;if(n){if(!Le.isDir(r.mode))return 54;if(Le.isRoot(r)||Le.getPath(r)===Le.cwd())return 10}else if(Le.isDir(r.mode))return 31;return 0},mayOpen:(e,t)=>e?Le.isLink(e.mode)?32:Le.isDir(e.mode)&&(\"r\"!==Le.flagsToPermissionString(t)||512&t)?31:Le.nodePermissions(e,Le.flagsToPermissionString(t)):44,MAX_OPEN_FDS:4096,nextfd(){for(var e=0;e<=Le.MAX_OPEN_FDS;e++)if(!Le.streams[e])return e;throw new Le.ErrnoError(33)},getStreamChecked(e){var t=Le.getStream(e);if(!t)throw new Le.ErrnoError(8);return t},getStream:e=>Le.streams[e],createStream:(e,t=-1)=>(I(t>=-1),e=Object.assign(new Le.FSStream,e),-1==t&&(t=Le.nextfd()),e.fd=t,Le.streams[t]=e,e),closeStream(e){Le.streams[e]=null},dupStream(e,t=-1){var n=Le.createStream(e,t);return n.stream_ops?.dup?.(n),n},chrdev_stream_ops:{open(e){var t=Le.getDevice(e.node.rdev);e.stream_ops=t.stream_ops,e.stream_ops.open?.(e)},llseek(){throw new Le.ErrnoError(70)}},major:e=>e>>8,minor:e=>255&e,makedev:(e,t)=>e<<8|t,registerDevice(e,t){Le.devices[e]={stream_ops:t}},getDevice:e=>Le.devices[e],getMounts(e){for(var t=[],n=[e];n.length;){var r=n.pop();t.push(r),n.push(...r.mounts)}return t},syncfs(e,t){\"function\"==typeof e&&(t=e,e=!1),Le.syncFSRequests++,Le.syncFSRequests>1&&G(`warning: ${Le.syncFSRequests} FS.syncfs operations in flight at once, probably just doing extra work`);var n=Le.getMounts(Le.root.mount),r=0;function o(e){return I(Le.syncFSRequests>0),Le.syncFSRequests--,t(e)}function i(e){if(e)return i.errored?void 0:(i.errored=!0,o(e));++r>=n.length&&o(null)}n.forEach((t=>{if(!t.type.syncfs)return i(null);t.type.syncfs(t,e,i)}))},mount(e,t,n){if(\"string\"==typeof e)throw e;var r,o=\"/\"===n,i=!n;if(o&&Le.root)throw new Le.ErrnoError(10);if(!o&&!i){var a=Le.lookupPath(n,{follow_mount:!1});if(n=a.path,r=a.node,Le.isMountpoint(r))throw new Le.ErrnoError(10);if(!Le.isDir(r.mode))throw new Le.ErrnoError(54)}var s={type:e,opts:t,mountpoint:n,mounts:[]},F=e.mount(s);return F.mount=s,s.root=F,o?Le.root=F:r&&(r.mounted=s,r.mount&&r.mount.mounts.push(s)),F},unmount(e){var t=Le.lookupPath(e,{follow_mount:!1});if(!Le.isMountpoint(t.node))throw new Le.ErrnoError(28);var n=t.node,r=n.mounted,o=Le.getMounts(r);Object.keys(Le.nameTable).forEach((e=>{for(var t=Le.nameTable[e];t;){var n=t.name_next;o.includes(t.mount)&&Le.destroyNode(t),t=n}})),n.mounted=null;var i=n.mount.mounts.indexOf(r);I(-1!==i),n.mount.mounts.splice(i,1)},lookup:(e,t)=>e.node_ops.lookup(e,t),mknod(e,t,n){var r=Le.lookupPath(e,{parent:!0}).node,o=Ae.basename(e);if(!o||\".\"===o||\"..\"===o)throw new Le.ErrnoError(28);var i=Le.mayCreate(r,o);if(i)throw new Le.ErrnoError(i);if(!r.node_ops.mknod)throw new Le.ErrnoError(63);return r.node_ops.mknod(r,o,t,n)},create:(e,t)=>(t=void 0!==t?t:438,t&=4095,t|=32768,Le.mknod(e,t,0)),mkdir:(e,t)=>(t=void 0!==t?t:511,t&=1023,t|=16384,Le.mknod(e,t,0)),mkdirTree(e,t){for(var n=e.split(\"/\"),r=\"\",o=0;o<n.length;++o)if(n[o]){r+=\"/\"+n[o];try{Le.mkdir(r,t)}catch(e){if(20!=e.errno)throw e}}},mkdev:(e,t,n)=>(void 0===n&&(n=t,t=438),t|=8192,Le.mknod(e,t,n)),symlink(e,t){if(!Ee.resolve(e))throw new Le.ErrnoError(44);var n=Le.lookupPath(t,{parent:!0}).node;if(!n)throw new Le.ErrnoError(44);var r=Ae.basename(t),o=Le.mayCreate(n,r);if(o)throw new Le.ErrnoError(o);if(!n.node_ops.symlink)throw new Le.ErrnoError(63);return n.node_ops.symlink(n,r,e)},rename(e,t){var n,r,o=Ae.dirname(e),i=Ae.dirname(t),a=Ae.basename(e),s=Ae.basename(t);if(n=Le.lookupPath(e,{parent:!0}).node,r=Le.lookupPath(t,{parent:!0}).node,!n||!r)throw new Le.ErrnoError(44);if(n.mount!==r.mount)throw new Le.ErrnoError(75);var F,u=Le.lookupNode(n,a),m=Ee.relative(e,i);if(\".\"!==m.charAt(0))throw new Le.ErrnoError(28);if(\".\"!==(m=Ee.relative(t,o)).charAt(0))throw new Le.ErrnoError(55);try{F=Le.lookupNode(r,s)}catch(e){}if(u!==F){var l=Le.isDir(u.mode),d=Le.mayDelete(n,a,l);if(d)throw new Le.ErrnoError(d);if(d=F?Le.mayDelete(r,s,l):Le.mayCreate(r,s))throw new Le.ErrnoError(d);if(!n.node_ops.rename)throw new Le.ErrnoError(63);if(Le.isMountpoint(u)||F&&Le.isMountpoint(F))throw new Le.ErrnoError(10);if(r!==n&&(d=Le.nodePermissions(n,\"w\")))throw new Le.ErrnoError(d);Le.hashRemoveNode(u);try{n.node_ops.rename(u,r,s),u.parent=r}catch(e){throw e}finally{Le.hashAddNode(u)}}},rmdir(e){var t=Le.lookupPath(e,{parent:!0}).node,n=Ae.basename(e),r=Le.lookupNode(t,n),o=Le.mayDelete(t,n,!0);if(o)throw new Le.ErrnoError(o);if(!t.node_ops.rmdir)throw new Le.ErrnoError(63);if(Le.isMountpoint(r))throw new Le.ErrnoError(10);t.node_ops.rmdir(t,n),Le.destroyNode(r)},readdir(e){var t=Le.lookupPath(e,{follow:!0}).node;if(!t.node_ops.readdir)throw new Le.ErrnoError(54);return t.node_ops.readdir(t)},unlink(e){var t=Le.lookupPath(e,{parent:!0}).node;if(!t)throw new Le.ErrnoError(44);var n=Ae.basename(e),r=Le.lookupNode(t,n),o=Le.mayDelete(t,n,!1);if(o)throw new Le.ErrnoError(o);if(!t.node_ops.unlink)throw new Le.ErrnoError(63);if(Le.isMountpoint(r))throw new Le.ErrnoError(10);t.node_ops.unlink(t,n),Le.destroyNode(r)},readlink(e){var t=Le.lookupPath(e).node;if(!t)throw new Le.ErrnoError(44);if(!t.node_ops.readlink)throw new Le.ErrnoError(28);return Ee.resolve(Le.getPath(t.parent),t.node_ops.readlink(t))},stat(e,t){var n=Le.lookupPath(e,{follow:!t}).node;if(!n)throw new Le.ErrnoError(44);if(!n.node_ops.getattr)throw new Le.ErrnoError(63);return n.node_ops.getattr(n)},lstat:e=>Le.stat(e,!0),chmod(e,t,n){var r;if(!(r=\"string\"==typeof e?Le.lookupPath(e,{follow:!n}).node:e).node_ops.setattr)throw new Le.ErrnoError(63);r.node_ops.setattr(r,{mode:4095&t|-4096&r.mode,timestamp:Date.now()})},lchmod(e,t){Le.chmod(e,t,!0)},fchmod(e,t){var n=Le.getStreamChecked(e);Le.chmod(n.node,t)},chown(e,t,n,r){var o;if(!(o=\"string\"==typeof e?Le.lookupPath(e,{follow:!r}).node:e).node_ops.setattr)throw new Le.ErrnoError(63);o.node_ops.setattr(o,{timestamp:Date.now()})},lchown(e,t,n){Le.chown(e,t,n,!0)},fchown(e,t,n){var r=Le.getStreamChecked(e);Le.chown(r.node,t,n)},truncate(e,t){if(t<0)throw new Le.ErrnoError(28);var n;if(!(n=\"string\"==typeof e?Le.lookupPath(e,{follow:!0}).node:e).node_ops.setattr)throw new Le.ErrnoError(63);if(Le.isDir(n.mode))throw new Le.ErrnoError(31);if(!Le.isFile(n.mode))throw new Le.ErrnoError(28);var r=Le.nodePermissions(n,\"w\");if(r)throw new Le.ErrnoError(r);n.node_ops.setattr(n,{size:t,timestamp:Date.now()})},ftruncate(e,t){var n=Le.getStreamChecked(e);if(!(2097155&n.flags))throw new Le.ErrnoError(28);Le.truncate(n.node,t)},utime(e,t,n){var r=Le.lookupPath(e,{follow:!0}).node;r.node_ops.setattr(r,{timestamp:Math.max(t,n)})},open(e,t,n){if(\"\"===e)throw new Le.ErrnoError(44);var r;if(n=64&(t=\"string\"==typeof t?(e=>{var t={r:0,\"r+\":2,w:577,\"w+\":578,a:1089,\"a+\":1090}[e];if(void 0===t)throw new Error(`Unknown file open mode: ${e}`);return t})(t):t)?4095&(n=void 0===n?438:n)|32768:0,\"object\"==typeof e)r=e;else{e=Ae.normalize(e);try{r=Le.lookupPath(e,{follow:!(131072&t)}).node}catch(e){}}var o=!1;if(64&t)if(r){if(128&t)throw new Le.ErrnoError(20)}else r=Le.mknod(e,n,0),o=!0;if(!r)throw new Le.ErrnoError(44);if(Le.isChrdev(r.mode)&&(t&=-513),65536&t&&!Le.isDir(r.mode))throw new Le.ErrnoError(54);if(!o){var a=Le.mayOpen(r,t);if(a)throw new Le.ErrnoError(a)}512&t&&!o&&Le.truncate(r,0),t&=-131713;var s=Le.createStream({node:r,path:Le.getPath(r),flags:t,seekable:!0,position:0,stream_ops:r.stream_ops,ungotten:[],error:!1});return s.stream_ops.open&&s.stream_ops.open(s),!i.logReadFiles||1&t||e in Le.readFiles||(Le.readFiles[e]=1),s},close(e){if(Le.isClosed(e))throw new Le.ErrnoError(8);e.getdents&&(e.getdents=null);try{e.stream_ops.close&&e.stream_ops.close(e)}catch(e){throw e}finally{Le.closeStream(e.fd)}e.fd=null},isClosed:e=>null===e.fd,llseek(e,t,n){if(Le.isClosed(e))throw new Le.ErrnoError(8);if(!e.seekable||!e.stream_ops.llseek)throw new Le.ErrnoError(70);if(0!=n&&1!=n&&2!=n)throw new Le.ErrnoError(28);return e.position=e.stream_ops.llseek(e,t,n),e.ungotten=[],e.position},read(e,t,n,r,o){if(I(n>=0),r<0||o<0)throw new Le.ErrnoError(28);if(Le.isClosed(e))throw new Le.ErrnoError(8);if(1==(2097155&e.flags))throw new Le.ErrnoError(8);if(Le.isDir(e.node.mode))throw new Le.ErrnoError(31);if(!e.stream_ops.read)throw new Le.ErrnoError(28);var i=void 0!==o;if(i){if(!e.seekable)throw new Le.ErrnoError(70)}else o=e.position;var a=e.stream_ops.read(e,t,n,r,o);return i||(e.position+=a),a},write(e,t,n,r,o,i){if(I(n>=0),r<0||o<0)throw new Le.ErrnoError(28);if(Le.isClosed(e))throw new Le.ErrnoError(8);if(!(2097155&e.flags))throw new Le.ErrnoError(8);if(Le.isDir(e.node.mode))throw new Le.ErrnoError(31);if(!e.stream_ops.write)throw new Le.ErrnoError(28);e.seekable&&1024&e.flags&&Le.llseek(e,0,2);var a=void 0!==o;if(a){if(!e.seekable)throw new Le.ErrnoError(70)}else o=e.position;var s=e.stream_ops.write(e,t,n,r,o,i);return a||(e.position+=s),s},allocate(e,t,n){if(Le.isClosed(e))throw new Le.ErrnoError(8);if(t<0||n<=0)throw new Le.ErrnoError(28);if(!(2097155&e.flags))throw new Le.ErrnoError(8);if(!Le.isFile(e.node.mode)&&!Le.isDir(e.node.mode))throw new Le.ErrnoError(43);if(!e.stream_ops.allocate)throw new Le.ErrnoError(138);e.stream_ops.allocate(e,t,n)},mmap(e,t,n,r,o){if(2&r&&!(2&o)&&2!=(2097155&e.flags))throw new Le.ErrnoError(2);if(1==(2097155&e.flags))throw new Le.ErrnoError(2);if(!e.stream_ops.mmap)throw new Le.ErrnoError(43);if(!t)throw new Le.ErrnoError(28);return e.stream_ops.mmap(e,t,n,r,o)},msync:(e,t,n,r,o)=>(I(n>=0),e.stream_ops.msync?e.stream_ops.msync(e,t,n,r,o):0),ioctl(e,t,n){if(!e.stream_ops.ioctl)throw new Le.ErrnoError(59);return e.stream_ops.ioctl(e,t,n)},readFile(e,t={}){if(t.flags=t.flags||0,t.encoding=t.encoding||\"binary\",\"utf8\"!==t.encoding&&\"binary\"!==t.encoding)throw new Error(`Invalid encoding type \"${t.encoding}\"`);var n,r=Le.open(e,t.flags),o=Le.stat(e).size,i=new Uint8Array(o);return Le.read(r,i,0,o,0),\"utf8\"===t.encoding?n=De(i):\"binary\"===t.encoding&&(n=i),Le.close(r),n},writeFile(e,t,n={}){n.flags=n.flags||577;var r=Le.open(e,n.flags,n.mode);if(\"string\"==typeof t){var o=new Uint8Array(Te(t)+1),i=Me(t,o,0,o.length);Le.write(r,o,0,i,void 0,n.canOwn)}else{if(!ArrayBuffer.isView(t))throw new Error(\"Unsupported data type\");Le.write(r,t,0,t.byteLength,void 0,n.canOwn)}Le.close(r)},cwd:()=>Le.currentPath,chdir(e){var t=Le.lookupPath(e,{follow:!0});if(null===t.node)throw new Le.ErrnoError(44);if(!Le.isDir(t.node.mode))throw new Le.ErrnoError(54);var n=Le.nodePermissions(t.node,\"x\");if(n)throw new Le.ErrnoError(n);Le.currentPath=t.path},createDefaultDirectories(){Le.mkdir(\"/tmp\"),Le.mkdir(\"/home\"),Le.mkdir(\"/home/web_user\")},createDefaultDevices(){Le.mkdir(\"/dev\"),Le.registerDevice(Le.makedev(1,3),{read:()=>0,write:(e,t,n,r,o)=>r}),Le.mkdev(\"/dev/null\",Le.makedev(1,3)),xe.register(Le.makedev(5,0),xe.default_tty_ops),xe.register(Le.makedev(6,0),xe.default_tty1_ops),Le.mkdev(\"/dev/tty\",Le.makedev(5,0)),Le.mkdev(\"/dev/tty1\",Le.makedev(6,0));var e=new Uint8Array(1024),t=0,n=()=>(0===t&&(t=Ge(e).byteLength),e[--t]);Le.createDevice(\"/dev\",\"random\",n),Le.createDevice(\"/dev\",\"urandom\",n),Le.mkdir(\"/dev/shm\"),Le.mkdir(\"/dev/shm/tmp\")},createSpecialDirectories(){Le.mkdir(\"/proc\");var e=Le.mkdir(\"/proc/self\");Le.mkdir(\"/proc/self/fd\"),Le.mount({mount(){var t=Le.createNode(e,\"fd\",16895,73);return t.node_ops={lookup(e,t){var n=+t,r=Le.getStreamChecked(n),o={parent:null,mount:{mountpoint:\"fake\"},node_ops:{readlink:()=>r.path}};return o.parent=o,o}},t}},{},\"/proc/self/fd\")},createStandardStreams(e,t,n){e?Le.createDevice(\"/dev\",\"stdin\",e):Le.symlink(\"/dev/tty\",\"/dev/stdin\"),t?Le.createDevice(\"/dev\",\"stdout\",null,t):Le.symlink(\"/dev/tty\",\"/dev/stdout\"),n?Le.createDevice(\"/dev\",\"stderr\",null,n):Le.symlink(\"/dev/tty1\",\"/dev/stderr\");var r=Le.open(\"/dev/stdin\",0),o=Le.open(\"/dev/stdout\",1),i=Le.open(\"/dev/stderr\",1);I(0===r.fd,`invalid handle for stdin (${r.fd})`),I(1===o.fd,`invalid handle for stdout (${o.fd})`),I(2===i.fd,`invalid handle for stderr (${i.fd})`)},staticInit(){[44].forEach((e=>{Le.genericErrors[e]=new Le.ErrnoError(e),Le.genericErrors[e].stack=\"<generic error, no stack>\"})),Le.nameTable=new Array(4096),Le.mount(Re,{},\"/\"),Le.createDefaultDirectories(),Le.createDefaultDevices(),Le.createSpecialDirectories(),Le.filesystems={MEMFS:Re}},init(e,t,n){I(!Le.initialized,\"FS.init was previously called. If you want to initialize later with custom parameters, remove any earlier calls (note that one is automatically added to the generated code)\"),Le.initialized=!0,e??=i.stdin,t??=i.stdout,n??=i.stderr,Le.createStandardStreams(e,t,n)},quit(){Le.initialized=!1,st(0);for(var e=0;e<Le.streams.length;e++){var t=Le.streams[e];t&&Le.close(t)}},findObject(e,t){var n=Le.analyzePath(e,t);return n.exists?n.object:null},analyzePath(e,t){try{e=(r=Le.lookupPath(e,{follow:!t})).path}catch(e){}var n={isRoot:!1,exists:!1,error:0,name:null,path:null,object:null,parentExists:!1,parentPath:null,parentObject:null};try{var r=Le.lookupPath(e,{parent:!0});n.parentExists=!0,n.parentPath=r.path,n.parentObject=r.node,n.name=Ae.basename(e),r=Le.lookupPath(e,{follow:!t}),n.exists=!0,n.path=r.path,n.object=r.node,n.name=r.node.name,n.isRoot=\"/\"===r.path}catch(e){n.error=e.errno}return n},createPath(e,t,n,r){e=\"string\"==typeof e?e:Le.getPath(e);for(var o=t.split(\"/\").reverse();o.length;){var i=o.pop();if(i){var a=Ae.join2(e,i);try{Le.mkdir(a)}catch(e){}e=a}}return a},createFile(e,t,n,r,o){var i=Ae.join2(\"string\"==typeof e?e:Le.getPath(e),t),a=ke(r,o);return Le.create(i,a)},createDataFile(e,t,n,r,o,i){var a=t;e&&(e=\"string\"==typeof e?e:Le.getPath(e),a=t?Ae.join2(e,t):e);var s=ke(r,o),F=Le.create(a,s);if(n){if(\"string\"==typeof n){for(var u=new Array(n.length),m=0,l=n.length;m<l;++m)u[m]=n.charCodeAt(m);n=u}Le.chmod(F,146|s);var d=Le.open(F,577);Le.write(d,n,0,n.length,0,i),Le.close(d),Le.chmod(F,s)}},createDevice(e,t,n,r){var o=Ae.join2(\"string\"==typeof e?e:Le.getPath(e),t),i=ke(!!n,!!r);Le.createDevice.major??=64;var a=Le.makedev(Le.createDevice.major++,0);return Le.registerDevice(a,{open(e){e.seekable=!1},close(e){r?.buffer?.length&&r(10)},read(e,t,r,o,i){for(var a=0,s=0;s<o;s++){var F;try{F=n()}catch(e){throw new Le.ErrnoError(29)}if(void 0===F&&0===a)throw new Le.ErrnoError(6);if(null==F)break;a++,t[r+s]=F}return a&&(e.node.timestamp=Date.now()),a},write(e,t,n,o,i){for(var a=0;a<o;a++)try{r(t[n+a])}catch(e){throw new Le.ErrnoError(29)}return o&&(e.node.timestamp=Date.now()),a}}),Le.mkdev(o,i,a)},forceLoadFile(e){if(e.isDevice||e.isFolder||e.link||e.contents)return!0;if(\"undefined\"!=typeof XMLHttpRequest)throw new Error(\"Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.\");try{e.contents=_(e.url),e.usedBytes=e.contents.length}catch(e){throw new Le.ErrnoError(29)}},createLazyFile(e,t,n,r,o){class i{constructor(){this.lengthKnown=!1,this.chunks=[]}get(e){if(!(e>this.length-1||e<0)){var t=e%this.chunkSize,n=e/this.chunkSize|0;return this.getter(n)[t]}}setDataGetter(e){this.getter=e}cacheLength(){var e=new XMLHttpRequest;if(e.open(\"HEAD\",n,!1),e.send(null),!(e.status>=200&&e.status<300||304===e.status))throw new Error(\"Couldn't load \"+n+\". Status: \"+e.status);var t,r=Number(e.getResponseHeader(\"Content-length\")),o=(t=e.getResponseHeader(\"Accept-Ranges\"))&&\"bytes\"===t,i=(t=e.getResponseHeader(\"Content-Encoding\"))&&\"gzip\"===t,a=1048576;o||(a=r);var s=this;s.setDataGetter((e=>{var t=e*a,o=(e+1)*a-1;if(o=Math.min(o,r-1),void 0===s.chunks[e]&&(s.chunks[e]=((e,t)=>{if(e>t)throw new Error(\"invalid range (\"+e+\", \"+t+\") or no bytes requested!\");if(t>r-1)throw new Error(\"only \"+r+\" bytes available! programmer error!\");var o=new XMLHttpRequest;if(o.open(\"GET\",n,!1),r!==a&&o.setRequestHeader(\"Range\",\"bytes=\"+e+\"-\"+t),o.responseType=\"arraybuffer\",o.overrideMimeType&&o.overrideMimeType(\"text/plain; charset=x-user-defined\"),o.send(null),!(o.status>=200&&o.status<300||304===o.status))throw new Error(\"Couldn't load \"+n+\". Status: \"+o.status);return void 0!==o.response?new Uint8Array(o.response||[]):Ce(o.responseText||\"\",!0)})(t,o)),void 0===s.chunks[e])throw new Error(\"doXHR failed!\");return s.chunks[e]})),!i&&r||(a=r=1,r=this.getter(0).length,a=r,A(\"LazyFiles on gzip forces download of the whole file when length is accessed\")),this._length=r,this._chunkSize=a,this.lengthKnown=!0}get length(){return this.lengthKnown||this.cacheLength(),this._length}get chunkSize(){return this.lengthKnown||this.cacheLength(),this._chunkSize}}if(\"undefined\"!=typeof XMLHttpRequest){if(!F)throw\"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc\";var a={isDevice:!1,contents:new i}}else a={isDevice:!1,url:n};var s=Le.createFile(e,t,a,r,o);a.contents?s.contents=a.contents:a.url&&(s.contents=null,s.url=a.url),Object.defineProperties(s,{usedBytes:{get:function(){return this.contents.length}}});var u={};function m(e,t,n,r,o){var i=e.node.contents;if(o>=i.length)return 0;var a=Math.min(i.length-o,r);if(I(a>=0),i.slice)for(var s=0;s<a;s++)t[n+s]=i[o+s];else for(s=0;s<a;s++)t[n+s]=i.get(o+s);return a}return Object.keys(s.stream_ops).forEach((e=>{var t=s.stream_ops[e];u[e]=(...e)=>(Le.forceLoadFile(s),t(...e))})),u.read=(e,t,n,r,o)=>(Le.forceLoadFile(s),m(e,t,n,r,o)),u.mmap=(e,t,n,r,o)=>{Le.forceLoadFile(s);var i=we(t);if(!i)throw new Le.ErrnoError(48);return m(e,T,i,t,n),{ptr:i,allocated:!0}},s.stream_ops=u,s},absolutePath(){q(\"FS.absolutePath has been removed; use PATH_FS.resolve instead\")},createFolder(){q(\"FS.createFolder has been removed; use FS.mkdir instead\")},createLink(){q(\"FS.createLink has been removed; use FS.symlink instead\")},joinPath(){q(\"FS.joinPath has been removed; use PATH.join instead\")},mmapAlloc(){q(\"FS.mmapAlloc has been replaced by the top level function mmapAlloc\")},standardizePath(){q(\"FS.standardizePath has been removed; use PATH.normalize instead\")}},Be={DEFAULT_POLLMASK:5,calculateAt(e,t,n){if(Ae.isAbs(t))return t;var r;if(r=-100===e?Le.cwd():Be.getStreamFromFD(e).path,0==t.length){if(!n)throw new Le.ErrnoError(44);return r}return Ae.join2(r,t)},doStat(e,t,n){var r=e(t);O[n>>2]=r.dev,O[n+4>>2]=r.mode,x[n+8>>2]=r.nlink,O[n+12>>2]=r.uid,O[n+16>>2]=r.gid,O[n+20>>2]=r.rdev,ee=[r.size>>>0,(Z=r.size,+Math.abs(Z)>=1?Z>0?+Math.floor(Z/4294967296)>>>0:~~+Math.ceil((Z-+(~~Z>>>0))/4294967296)>>>0:0)],O[n+24>>2]=ee[0],O[n+28>>2]=ee[1],O[n+32>>2]=4096,O[n+36>>2]=r.blocks;var o=r.atime.getTime(),i=r.mtime.getTime(),a=r.ctime.getTime();return ee=[Math.floor(o/1e3)>>>0,(Z=Math.floor(o/1e3),+Math.abs(Z)>=1?Z>0?+Math.floor(Z/4294967296)>>>0:~~+Math.ceil((Z-+(~~Z>>>0))/4294967296)>>>0:0)],O[n+40>>2]=ee[0],O[n+44>>2]=ee[1],x[n+48>>2]=o%1e3*1e3*1e3,ee=[Math.floor(i/1e3)>>>0,(Z=Math.floor(i/1e3),+Math.abs(Z)>=1?Z>0?+Math.floor(Z/4294967296)>>>0:~~+Math.ceil((Z-+(~~Z>>>0))/4294967296)>>>0:0)],O[n+56>>2]=ee[0],O[n+60>>2]=ee[1],x[n+64>>2]=i%1e3*1e3*1e3,ee=[Math.floor(a/1e3)>>>0,(Z=Math.floor(a/1e3),+Math.abs(Z)>=1?Z>0?+Math.floor(Z/4294967296)>>>0:~~+Math.ceil((Z-+(~~Z>>>0))/4294967296)>>>0:0)],O[n+72>>2]=ee[0],O[n+76>>2]=ee[1],x[n+80>>2]=a%1e3*1e3*1e3,ee=[r.ino>>>0,(Z=r.ino,+Math.abs(Z)>=1?Z>0?+Math.floor(Z/4294967296)>>>0:~~+Math.ceil((Z-+(~~Z>>>0))/4294967296)>>>0:0)],O[n+88>>2]=ee[0],O[n+92>>2]=ee[1],0},doMsync(e,t,n,r,o){if(!Le.isFile(t.node.mode))throw new Le.ErrnoError(43);if(2&r)return 0;var i=M.slice(e,e+n);Le.msync(t,i,o,n,r)},getStreamFromFD:e=>Le.getStreamChecked(e),varargs:void 0,getStr:e=>be(e)},Ne=(e,t)=>(I(e==e>>>0||e==(0|e)),I(t===(0|t)),t+2097152>>>0<4194305-!!e?(e>>>0)+4294967296*t:NaN),Ue=(e,t,n)=>(I(\"number\"==typeof n,\"stringToUTF8(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!\"),Me(e,M,t,n)),Ve=[0,31,60,91,121,152,182,213,244,274,305,335],We=[0,31,59,90,120,151,181,212,243,273,304,334],ze=e=>{var t=E.buffer,n=(e-t.byteLength+65535)/65536|0;try{return E.grow(n),k(),1}catch(n){G(`growMemory: Attempted to grow heap from ${t.byteLength} bytes to ${e} bytes, but got error: ${n}`)}},He={},$e=()=>{if(!$e.strings){var e={USER:\"web_user\",LOGNAME:\"web_user\",PATH:\"/\",PWD:\"/\",HOME:\"/home/web_user\",LANG:(\"object\"==typeof navigator&&navigator.languages&&navigator.languages[0]||\"C\").replace(\"-\",\"_\")+\".UTF-8\",_:c||\"./this.program\"};for(var t in He)void 0===He[t]?delete e[t]:e[t]=He[t];var n=[];for(var t in e)n.push(`${t}=${e[t]}`);$e.strings=n}return $e.strings},Xe=[],Ke=e=>{var t=Xe[e];return t||(e>=Xe.length&&(Xe.length=e+1),Xe[e]=t=ye.get(e)),I(ye.get(e)==t,\"JavaScript-side Wasm function table mirror is out of date!\"),t},Ye=\"undefined\"!=typeof TextDecoder?new TextDecoder(\"utf-16le\"):void 0,Je=(e,t)=>{I(e<16384),e<128?t.push(e):t.push(e%128|128,e>>7)},qe=(e,t)=>{if(I(!t.includes(\"j\"),\"i64 not permitted in function signatures when WASM_BIGINT is disabled\"),\"function\"==typeof WebAssembly.Function)return new WebAssembly.Function((e=>{I(!e.includes(\"j\"),\"i64 not permitted in function signatures when WASM_BIGINT is disabled\");for(var t={i:\"i32\",j:\"i64\",f:\"f32\",d:\"f64\",e:\"externref\",p:\"i32\"},n={parameters:[],results:\"v\"==e[0]?[]:[t[e[0]]]},r=1;r<e.length;++r)I(e[r]in t,\"invalid signature char: \"+e[r]),n.parameters.push(t[e[r]]);return n})(t),e);var n=[1];((e,t)=>{var n=e.slice(0,1),r=e.slice(1),o={i:127,p:127,j:126,f:125,d:124,e:111};t.push(96),Je(r.length,t);for(var i=0;i<r.length;++i)I(r[i]in o,\"invalid signature char: \"+r[i]),t.push(o[r[i]]);\"v\"==n?t.push(0):t.push(1,o[n])})(t,n);var r=[0,97,115,109,1,0,0,0,1];Je(n.length,r),r.push(...n),r.push(2,7,1,1,101,1,102,0,0,7,5,1,1,102,0,0);var o=new WebAssembly.Module(new Uint8Array(r));return new WebAssembly.Instance(o,{e:{f:e}}).exports.f},Qe=e=>(Oe||(Oe=new WeakMap,((e,t)=>{if(Oe)for(var n=e;n<e+t;n++){var r=Ke(n);r&&Oe.set(r,n)}})(0,ye.length)),Oe.get(e)||0),Ze=[],et=(e,t)=>{ye.set(e,t),Xe[e]=ye.get(e)},tt=e=>Pt(e),nt=(e,t,n,r,o)=>{var a={string:e=>{var t=0;return null!=e&&0!==e&&(t=(e=>{var t=Te(e)+1,n=tt(t);return Ue(e,n,t),n})(e)),t},array:e=>{var t,n,r=tt(e.length);return n=r,I((t=e).length>=0,\"writeArrayToMemory array must have a length (should be an array or typed array)\"),T.set(t,n),r}},s=(e=>{var t=i[\"_\"+e];return I(t,\"Cannot call unknown function \"+e+\", make sure it is exported\"),t})(e),F=[],u=0;if(I(\"array\"!==t,'Return type should not be \"array\".'),r)for(var m=0;m<r.length;m++){var l=a[n[m]];l?(0===u&&(u=ce()),F[m]=l(r[m])):F[m]=r[m]}var d=s(...F);return d=function(e){return 0!==u&&Pe(u),function(e){return\"string\"===t?be(e):\"boolean\"===t?Boolean(e):e}(e)}(d)};Le.createPreloadedFile=(e,t,n,r,o,i,a,s,F,u)=>{var m=t?Ee.resolve(Ae.join2(e,t)):e,l=K(`cp ${m}`);function _(n){function d(n){u?.(),s||((e,t,n,r,o,i)=>{Le.createDataFile(e,t,n,r,o,i)})(e,t,n,r,o,F),i?.(),J(l)}((e,t,n,r)=>{\"undefined\"!=typeof Browser&&Browser.init();var o=!1;return Ie.forEach((i=>{o||i.canHandle(t)&&(i.handle(e,t,n,r),o=!0)})),o})(n,m,d,(()=>{a?.(),J(l)}))||d(n)}Y(l),\"string\"==typeof n?((e,t,n,r)=>{var o=r?\"\":K(`al ${e}`);d(e).then((n=>{I(n,`Loading data file \"${e}\" failed (no arrayBuffer).`),t(new Uint8Array(n)),o&&J(o)}),(t=>{if(!n)throw`Loading data file \"${e}\" failed.`;n()})),o&&Y(o)})(n,_,a):_(n)},Le.staticInit();var rt={__assert_fail:(e,t,n,r)=>{q(`Assertion failed: ${be(e)}, at: `+[t?be(t):\"unknown filename\",n,r?be(r):\"unknown function\"])},__syscall_fcntl64:function(e,t,n){Be.varargs=n;try{var r=Be.getStreamFromFD(e);switch(t){case 0:if((o=pe())<0)return-28;for(;Le.streams[o];)o++;return Le.dupStream(r,o).fd;case 1:case 2:case 13:case 14:return 0;case 3:return r.flags;case 4:var o=pe();return r.flags|=o,0;case 12:return o=fe(),C[o+0>>1]=2,0}return-28}catch(e){if(void 0===Le||\"ErrnoError\"!==e.name)throw e;return-e.errno}},__syscall_fstat64:function(e,t){try{var n=Be.getStreamFromFD(e);return Be.doStat(Le.stat,n.path,t)}catch(e){if(void 0===Le||\"ErrnoError\"!==e.name)throw e;return-e.errno}},__syscall_ftruncate64:function(e,t,n){var r=Ne(t,n);try{return isNaN(r)?61:(Le.ftruncate(e,r),0)}catch(e){if(void 0===Le||\"ErrnoError\"!==e.name)throw e;return-e.errno}},__syscall_getdents64:function(e,t,n){try{var r=Be.getStreamFromFD(e);r.getdents||=Le.readdir(r.path);for(var o=280,i=0,a=Le.llseek(r,0,1),s=Math.floor(a/o);s<r.getdents.length&&i+o<=n;){var F,u,m=r.getdents[s];if(\".\"===m)F=r.node.id,u=4;else if(\"..\"===m)F=Le.lookupPath(r.path,{parent:!0}).node.id,u=4;else{var l=Le.lookupNode(r.node,m);F=l.id,u=Le.isChrdev(l.mode)?2:Le.isDir(l.mode)?4:Le.isLink(l.mode)?10:8}I(F),ee=[F>>>0,(Z=F,+Math.abs(Z)>=1?Z>0?+Math.floor(Z/4294967296)>>>0:~~+Math.ceil((Z-+(~~Z>>>0))/4294967296)>>>0:0)],O[t+i>>2]=ee[0],O[t+i+4>>2]=ee[1],ee=[(s+1)*o>>>0,(Z=(s+1)*o,+Math.abs(Z)>=1?Z>0?+Math.floor(Z/4294967296)>>>0:~~+Math.ceil((Z-+(~~Z>>>0))/4294967296)>>>0:0)],O[t+i+8>>2]=ee[0],O[t+i+12>>2]=ee[1],C[t+i+16>>1]=280,T[t+i+18]=u,Ue(m,t+i+19,256),i+=o,s+=1}return Le.llseek(r,s*o,0),i}catch(e){if(void 0===Le||\"ErrnoError\"!==e.name)throw e;return-e.errno}},__syscall_ioctl:function(e,t,n){Be.varargs=n;try{var r=Be.getStreamFromFD(e);switch(t){case 21509:case 21510:case 21511:case 21512:case 21524:case 21515:return r.tty?0:-59;case 21505:if(!r.tty)return-59;if(r.tty.ops.ioctl_tcgets){var o=r.tty.ops.ioctl_tcgets(r),i=fe();O[i>>2]=o.c_iflag||0,O[i+4>>2]=o.c_oflag||0,O[i+8>>2]=o.c_cflag||0,O[i+12>>2]=o.c_lflag||0;for(var a=0;a<32;a++)T[i+a+17]=o.c_cc[a]||0;return 0}return 0;case 21506:case 21507:case 21508:if(!r.tty)return-59;if(r.tty.ops.ioctl_tcsets){i=fe();var s=O[i>>2],F=O[i+4>>2],u=O[i+8>>2],m=O[i+12>>2],l=[];for(a=0;a<32;a++)l.push(T[i+a+17]);return r.tty.ops.ioctl_tcsets(r.tty,t,{c_iflag:s,c_oflag:F,c_cflag:u,c_lflag:m,c_cc:l})}return 0;case 21519:return r.tty?(i=fe(),O[i>>2]=0,0):-59;case 21520:return r.tty?-28:-59;case 21531:return i=fe(),Le.ioctl(r,t,i);case 21523:if(!r.tty)return-59;if(r.tty.ops.ioctl_tiocgwinsz){var d=r.tty.ops.ioctl_tiocgwinsz(r.tty);i=fe(),C[i>>1]=d[0],C[i+2>>1]=d[1]}return 0;default:return-28}}catch(e){if(void 0===Le||\"ErrnoError\"!==e.name)throw e;return-e.errno}},__syscall_lstat64:function(e,t){try{return e=Be.getStr(e),Be.doStat(Le.lstat,e,t)}catch(e){if(void 0===Le||\"ErrnoError\"!==e.name)throw e;return-e.errno}},__syscall_newfstatat:function(e,t,n,r){try{t=Be.getStr(t);var o=256&r,i=4096&r;return I(!(r&=-6401),`unknown flags in __syscall_newfstatat: ${r}`),t=Be.calculateAt(e,t,i),Be.doStat(o?Le.lstat:Le.stat,t,n)}catch(e){if(void 0===Le||\"ErrnoError\"!==e.name)throw e;return-e.errno}},__syscall_openat:function(e,t,n,r){Be.varargs=r;try{t=Be.getStr(t),t=Be.calculateAt(e,t);var o=r?pe():0;return Le.open(t,n,o).fd}catch(e){if(void 0===Le||\"ErrnoError\"!==e.name)throw e;return-e.errno}},__syscall_rmdir:function(e){try{return e=Be.getStr(e),Le.rmdir(e),0}catch(e){if(void 0===Le||\"ErrnoError\"!==e.name)throw e;return-e.errno}},__syscall_stat64:function(e,t){try{return e=Be.getStr(e),Be.doStat(Le.stat,e,t)}catch(e){if(void 0===Le||\"ErrnoError\"!==e.name)throw e;return-e.errno}},__syscall_unlinkat:function(e,t,n){try{return t=Be.getStr(t),t=Be.calculateAt(e,t),0===n?Le.unlink(t):512===n?Le.rmdir(t):q(\"Invalid flags passed to unlinkat\"),0}catch(e){if(void 0===Le||\"ErrnoError\"!==e.name)throw e;return-e.errno}},_abort_js:()=>{q(\"native code called abort()\")},_emscripten_memcpy_js:(e,t,n)=>M.copyWithin(e,t,t+n),_emscripten_throw_longjmp:()=>{throw 1/0},_gmtime_js:function(e,t,n){var r=Ne(e,t),o=new Date(1e3*r);O[n>>2]=o.getUTCSeconds(),O[n+4>>2]=o.getUTCMinutes(),O[n+8>>2]=o.getUTCHours(),O[n+12>>2]=o.getUTCDate(),O[n+16>>2]=o.getUTCMonth(),O[n+20>>2]=o.getUTCFullYear()-1900,O[n+24>>2]=o.getUTCDay();var i=Date.UTC(o.getUTCFullYear(),0,1,0,0,0,0),a=(o.getTime()-i)/864e5|0;O[n+28>>2]=a},_localtime_js:function(e,t,n){var r=Ne(e,t),o=new Date(1e3*r);O[n>>2]=o.getSeconds(),O[n+4>>2]=o.getMinutes(),O[n+8>>2]=o.getHours(),O[n+12>>2]=o.getDate(),O[n+16>>2]=o.getMonth(),O[n+20>>2]=o.getFullYear()-1900,O[n+24>>2]=o.getDay();var i=0|(e=>{var t;return((t=e.getFullYear())%4!=0||t%100==0&&t%400!=0?We:Ve)[e.getMonth()]+e.getDate()-1})(o);O[n+28>>2]=i,O[n+36>>2]=-60*o.getTimezoneOffset();var a=new Date(o.getFullYear(),0,1),s=new Date(o.getFullYear(),6,1).getTimezoneOffset(),F=a.getTimezoneOffset(),u=0|(s!=F&&o.getTimezoneOffset()==Math.min(F,s));O[n+32>>2]=u},_tzset_js:(e,t,n,r)=>{var o=(new Date).getFullYear(),i=new Date(o,0,1),a=new Date(o,6,1),s=i.getTimezoneOffset(),F=a.getTimezoneOffset(),u=Math.max(s,F);x[e>>2]=60*u,O[t>>2]=Number(s!=F);var m=e=>{var t=e>=0?\"-\":\"+\",n=Math.abs(e);return`UTC${t}${String(Math.floor(n/60)).padStart(2,\"0\")}${String(n%60).padStart(2,\"0\")}`},l=m(s),d=m(F);I(l),I(d),I(Te(l)<=16,`timezone name truncated to fit in TZNAME_MAX (${l})`),I(Te(d)<=16,`timezone name truncated to fit in TZNAME_MAX (${d})`),F<s?(Ue(l,n,17),Ue(d,r,17)):(Ue(l,r,17),Ue(d,n,17))},emscripten_date_now:()=>Date.now(),emscripten_resize_heap:e=>{var t=M.length;I((e>>>=0)>t);var n=2147483648;if(e>n)return G(`Cannot enlarge memory, requested ${e} bytes, but the limit is 2147483648 bytes!`),!1;for(var r=1;r<=4;r*=2){var o=t*(1+.2/r);o=Math.min(o,e+100663296);var i=Math.min(n,ve(Math.max(e,o),65536));if(ze(i))return!0}return G(`Failed to grow the heap from ${t} bytes to ${i} bytes, not enough memory!`),!1},environ_get:(e,t)=>{var n=0;return $e().forEach(((r,o)=>{var i=t+n;x[e+4*o>>2]=i,((e,t)=>{for(var n=0;n<e.length;++n)I(e.charCodeAt(n)===(255&e.charCodeAt(n))),T[t++]=e.charCodeAt(n);T[t]=0})(r,i),n+=r.length+1})),0},environ_sizes_get:(e,t)=>{var n=$e();x[e>>2]=n.length;var r=0;return n.forEach((e=>r+=e.length+1)),x[t>>2]=r,0},fd_close:function(e){try{var t=Be.getStreamFromFD(e);return Le.close(t),0}catch(e){if(void 0===Le||\"ErrnoError\"!==e.name)throw e;return e.errno}},fd_read:function(e,t,n,r){try{var o=((e,t,n,r)=>{for(var o=0,i=0;i<n;i++){var a=x[t>>2],s=x[t+4>>2];t+=8;var F=Le.read(e,T,a,s,r);if(F<0)return-1;if(o+=F,F<s)break;void 0!==r&&(r+=F)}return o})(Be.getStreamFromFD(e),t,n);return x[r>>2]=o,0}catch(e){if(void 0===Le||\"ErrnoError\"!==e.name)throw e;return e.errno}},fd_seek:function(e,t,n,r,o){var i=Ne(t,n);try{if(isNaN(i))return 61;var a=Be.getStreamFromFD(e);return Le.llseek(a,i,r),ee=[a.position>>>0,(Z=a.position,+Math.abs(Z)>=1?Z>0?+Math.floor(Z/4294967296)>>>0:~~+Math.ceil((Z-+(~~Z>>>0))/4294967296)>>>0:0)],O[o>>2]=ee[0],O[o+4>>2]=ee[1],a.getdents&&0===i&&0===r&&(a.getdents=null),0}catch(e){if(void 0===Le||\"ErrnoError\"!==e.name)throw e;return e.errno}},fd_sync:function(e){try{var t=Be.getStreamFromFD(e);return t.stream_ops?.fsync?t.stream_ops.fsync(t):0}catch(e){if(void 0===Le||\"ErrnoError\"!==e.name)throw e;return e.errno}},fd_write:function(e,t,n,r){try{var o=((e,t,n,r)=>{for(var o=0,i=0;i<n;i++){var a=x[t>>2],s=x[t+4>>2];t+=8;var F=Le.write(e,T,a,s,r);if(F<0)return-1;if(o+=F,F<s)break;void 0!==r&&(r+=F)}return o})(Be.getStreamFromFD(e),t,n);return x[r>>2]=o,0}catch(e){if(void 0===Le||\"ErrnoError\"!==e.name)throw e;return e.errno}},invoke_ii:function(e,t){var n=ce();try{return Ke(e)(t)}catch(e){if(Pe(n),e!==e+0)throw e;mt(1,0)}},invoke_iii:function(e,t,n){var r=ce();try{return Ke(e)(t,n)}catch(e){if(Pe(r),e!==e+0)throw e;mt(1,0)}},invoke_iiii:function(e,t,n,r){var o=ce();try{return Ke(e)(t,n,r)}catch(e){if(Pe(o),e!==e+0)throw e;mt(1,0)}},invoke_iiiii:function(e,t,n,r,o){var i=ce();try{return Ke(e)(t,n,r,o)}catch(e){if(Pe(i),e!==e+0)throw e;mt(1,0)}},invoke_v:function(e){var t=ce();try{Ke(e)()}catch(e){if(Pe(t),e!==e+0)throw e;mt(1,0)}},invoke_viii:function(e,t,n,r){var o=ce();try{Ke(e)(t,n,r)}catch(e){if(Pe(o),e!==e+0)throw e;mt(1,0)}},invoke_viiii:function(e,t,n,r,o){var i=ce();try{Ke(e)(t,n,r,o)}catch(e){if(Pe(i),e!==e+0)throw e;mt(1,0)}}},ot=function(){var e={env:rt,wasi_snapshot_preview1:rt};function t(e,t){var n;return ot=e.exports,i.wasmExports=ot,I(E=ot.memory,\"memory not found in wasm exports\"),k(),I(ye=ot.__indirect_function_table,\"table not found in wasm exports\"),n=ot.__wasm_call_ctors,B.unshift(n),J(\"wasm-instantiate\"),ot}Y(\"wasm-instantiate\");var n,r,a,s,F=i;if(i.instantiateWasm)try{return i.instantiateWasm(e,t)}catch(e){G(`Module.instantiateWasm callback failed with error: ${e}`),o(e)}return Q??=oe(),(n=S,r=Q,a=e,s=function(e){I(i===F,\"the Module object should not be replaced during async compilation - perhaps the order of HTML elements is wrong?\"),F=null,t(e.instance)},n||\"function\"!=typeof WebAssembly.instantiateStreaming||te(r)||u||\"function\"!=typeof fetch?ae(r,a,s):fetch(r,{credentials:\"same-origin\"}).then((e=>WebAssembly.instantiateStreaming(e,a).then(s,(function(e){return G(`wasm streaming compile failed: ${e}`),G(\"falling back to ArrayBuffer instantiation\"),ae(r,a,s)}))))).catch(o),{}}();i._PDFiumExt_Init=re(\"PDFiumExt_Init\",0),i._FPDF_InitLibraryWithConfig=re(\"FPDF_InitLibraryWithConfig\",1),i._PDFiumExt_OpenFileWriter=re(\"PDFiumExt_OpenFileWriter\",0),i._PDFiumExt_GetFileWriterSize=re(\"PDFiumExt_GetFileWriterSize\",1),i._PDFiumExt_GetFileWriterData=re(\"PDFiumExt_GetFileWriterData\",3),i._PDFiumExt_CloseFileWriter=re(\"PDFiumExt_CloseFileWriter\",1),i._PDFiumExt_SaveAsCopy=re(\"PDFiumExt_SaveAsCopy\",2),i._FPDF_SaveAsCopy=re(\"FPDF_SaveAsCopy\",3),i._PDFiumExt_OpenFormFillInfo=re(\"PDFiumExt_OpenFormFillInfo\",0),i._PDFiumExt_CloseFormFillInfo=re(\"PDFiumExt_CloseFormFillInfo\",1),i._PDFiumExt_InitFormFillEnvironment=re(\"PDFiumExt_InitFormFillEnvironment\",2),i._FPDFDOC_InitFormFillEnvironment=re(\"FPDFDOC_InitFormFillEnvironment\",2),i._PDFiumExt_ExitFormFillEnvironment=re(\"PDFiumExt_ExitFormFillEnvironment\",1),i._FPDFDOC_ExitFormFillEnvironment=re(\"FPDFDOC_ExitFormFillEnvironment\",1),i._FPDFAnnot_IsSupportedSubtype=re(\"FPDFAnnot_IsSupportedSubtype\",1),i._FPDFPage_CreateAnnot=re(\"FPDFPage_CreateAnnot\",2),i._FPDFPage_GetAnnotCount=re(\"FPDFPage_GetAnnotCount\",1),i._FPDFPage_GetAnnot=re(\"FPDFPage_GetAnnot\",2),i._FPDFPage_GetAnnotIndex=re(\"FPDFPage_GetAnnotIndex\",2),i._FPDFPage_CloseAnnot=re(\"FPDFPage_CloseAnnot\",1),i._FPDFPage_RemoveAnnot=re(\"FPDFPage_RemoveAnnot\",2),i._FPDFAnnot_GetSubtype=re(\"FPDFAnnot_GetSubtype\",1),i._FPDFAnnot_IsObjectSupportedSubtype=re(\"FPDFAnnot_IsObjectSupportedSubtype\",1),i._FPDFAnnot_UpdateObject=re(\"FPDFAnnot_UpdateObject\",2),i._FPDFAnnot_AddInkStroke=re(\"FPDFAnnot_AddInkStroke\",3),i._FPDFAnnot_RemoveInkList=re(\"FPDFAnnot_RemoveInkList\",1),i._FPDFAnnot_AppendObject=re(\"FPDFAnnot_AppendObject\",2),i._FPDFAnnot_GetObjectCount=re(\"FPDFAnnot_GetObjectCount\",1),i._FPDFAnnot_GetObject=re(\"FPDFAnnot_GetObject\",2),i._FPDFAnnot_RemoveObject=re(\"FPDFAnnot_RemoveObject\",2),i._FPDFAnnot_SetColor=re(\"FPDFAnnot_SetColor\",6),i._FPDFAnnot_GetColor=re(\"FPDFAnnot_GetColor\",6),i._FPDFAnnot_HasAttachmentPoints=re(\"FPDFAnnot_HasAttachmentPoints\",1),i._FPDFAnnot_SetAttachmentPoints=re(\"FPDFAnnot_SetAttachmentPoints\",3),i._FPDFAnnot_AppendAttachmentPoints=re(\"FPDFAnnot_AppendAttachmentPoints\",2),i._FPDFAnnot_CountAttachmentPoints=re(\"FPDFAnnot_CountAttachmentPoints\",1),i._FPDFAnnot_GetAttachmentPoints=re(\"FPDFAnnot_GetAttachmentPoints\",3),i._FPDFAnnot_SetRect=re(\"FPDFAnnot_SetRect\",2),i._FPDFAnnot_GetRect=re(\"FPDFAnnot_GetRect\",2),i._FPDFAnnot_GetVertices=re(\"FPDFAnnot_GetVertices\",3),i._FPDFAnnot_GetInkListCount=re(\"FPDFAnnot_GetInkListCount\",1),i._FPDFAnnot_GetInkListPath=re(\"FPDFAnnot_GetInkListPath\",4),i._FPDFAnnot_GetLine=re(\"FPDFAnnot_GetLine\",3),i._FPDFAnnot_SetBorder=re(\"FPDFAnnot_SetBorder\",4),i._FPDFAnnot_GetBorder=re(\"FPDFAnnot_GetBorder\",4),i._FPDFAnnot_HasKey=re(\"FPDFAnnot_HasKey\",2),i._FPDFAnnot_GetValueType=re(\"FPDFAnnot_GetValueType\",2),i._FPDFAnnot_SetStringValue=re(\"FPDFAnnot_SetStringValue\",3),i._FPDFAnnot_GetStringValue=re(\"FPDFAnnot_GetStringValue\",4),i._FPDFAnnot_GetNumberValue=re(\"FPDFAnnot_GetNumberValue\",3),i._FPDFAnnot_SetAP=re(\"FPDFAnnot_SetAP\",3),i._FPDFAnnot_GetAP=re(\"FPDFAnnot_GetAP\",4),i._FPDFAnnot_GetLinkedAnnot=re(\"FPDFAnnot_GetLinkedAnnot\",2),i._FPDFAnnot_GetFlags=re(\"FPDFAnnot_GetFlags\",1),i._FPDFAnnot_SetFlags=re(\"FPDFAnnot_SetFlags\",2),i._FPDFAnnot_GetFormFieldFlags=re(\"FPDFAnnot_GetFormFieldFlags\",2),i._FPDFAnnot_SetFormFieldFlags=re(\"FPDFAnnot_SetFormFieldFlags\",3),i._FPDFAnnot_GetFormFieldAtPoint=re(\"FPDFAnnot_GetFormFieldAtPoint\",3),i._FPDFAnnot_GetFormFieldName=re(\"FPDFAnnot_GetFormFieldName\",4),i._FPDFAnnot_GetFormFieldType=re(\"FPDFAnnot_GetFormFieldType\",2),i._FPDFAnnot_GetFormAdditionalActionJavaScript=re(\"FPDFAnnot_GetFormAdditionalActionJavaScript\",5),i._FPDFAnnot_GetFormFieldAlternateName=re(\"FPDFAnnot_GetFormFieldAlternateName\",4),i._FPDFAnnot_GetFormFieldValue=re(\"FPDFAnnot_GetFormFieldValue\",4),i._FPDFAnnot_GetOptionCount=re(\"FPDFAnnot_GetOptionCount\",2),i._FPDFAnnot_GetOptionLabel=re(\"FPDFAnnot_GetOptionLabel\",5),i._FPDFAnnot_IsOptionSelected=re(\"FPDFAnnot_IsOptionSelected\",3),i._FPDFAnnot_GetFontSize=re(\"FPDFAnnot_GetFontSize\",3),i._FPDFAnnot_GetFontColor=re(\"FPDFAnnot_GetFontColor\",5),i._FPDFAnnot_IsChecked=re(\"FPDFAnnot_IsChecked\",2),i._FPDFAnnot_SetFocusableSubtypes=re(\"FPDFAnnot_SetFocusableSubtypes\",3),i._FPDFAnnot_GetFocusableSubtypesCount=re(\"FPDFAnnot_GetFocusableSubtypesCount\",1),i._FPDFAnnot_GetFocusableSubtypes=re(\"FPDFAnnot_GetFocusableSubtypes\",3),i._FPDFAnnot_GetLink=re(\"FPDFAnnot_GetLink\",1),i._FPDFAnnot_GetFormControlCount=re(\"FPDFAnnot_GetFormControlCount\",2),i._FPDFAnnot_GetFormControlIndex=re(\"FPDFAnnot_GetFormControlIndex\",2),i._FPDFAnnot_GetFormFieldExportValue=re(\"FPDFAnnot_GetFormFieldExportValue\",4),i._FPDFAnnot_SetURI=re(\"FPDFAnnot_SetURI\",2),i._FPDFAnnot_GetFileAttachment=re(\"FPDFAnnot_GetFileAttachment\",1),i._FPDFAnnot_AddFileAttachment=re(\"FPDFAnnot_AddFileAttachment\",2),i._FPDFDoc_GetAttachmentCount=re(\"FPDFDoc_GetAttachmentCount\",1),i._FPDFDoc_AddAttachment=re(\"FPDFDoc_AddAttachment\",2),i._FPDFDoc_GetAttachment=re(\"FPDFDoc_GetAttachment\",2),i._FPDFDoc_DeleteAttachment=re(\"FPDFDoc_DeleteAttachment\",2),i._FPDFAttachment_GetName=re(\"FPDFAttachment_GetName\",3),i._FPDFAttachment_HasKey=re(\"FPDFAttachment_HasKey\",2),i._FPDFAttachment_GetValueType=re(\"FPDFAttachment_GetValueType\",2),i._FPDFAttachment_SetStringValue=re(\"FPDFAttachment_SetStringValue\",3),i._FPDFAttachment_GetStringValue=re(\"FPDFAttachment_GetStringValue\",4),i._FPDFAttachment_SetFile=re(\"FPDFAttachment_SetFile\",4),i._FPDFAttachment_GetFile=re(\"FPDFAttachment_GetFile\",4),i._FPDFAttachment_GetSubtype=re(\"FPDFAttachment_GetSubtype\",3),i._FPDFCatalog_IsTagged=re(\"FPDFCatalog_IsTagged\",1),i._FPDFCatalog_SetLanguage=re(\"FPDFCatalog_SetLanguage\",2),i._FPDFAvail_Create=re(\"FPDFAvail_Create\",2),i._FPDFAvail_Destroy=re(\"FPDFAvail_Destroy\",1),i._FPDFAvail_IsDocAvail=re(\"FPDFAvail_IsDocAvail\",2),i._FPDFAvail_GetDocument=re(\"FPDFAvail_GetDocument\",2),i._FPDFAvail_GetFirstPageNum=re(\"FPDFAvail_GetFirstPageNum\",1),i._FPDFAvail_IsPageAvail=re(\"FPDFAvail_IsPageAvail\",3),i._FPDFAvail_IsFormAvail=re(\"FPDFAvail_IsFormAvail\",2),i._FPDFAvail_IsLinearized=re(\"FPDFAvail_IsLinearized\",1),i._FPDFBookmark_GetFirstChild=re(\"FPDFBookmark_GetFirstChild\",2),i._FPDFBookmark_GetNextSibling=re(\"FPDFBookmark_GetNextSibling\",2),i._FPDFBookmark_GetTitle=re(\"FPDFBookmark_GetTitle\",3),i._FPDFBookmark_GetCount=re(\"FPDFBookmark_GetCount\",1),i._FPDFBookmark_Find=re(\"FPDFBookmark_Find\",2),i._FPDFBookmark_GetDest=re(\"FPDFBookmark_GetDest\",2),i._FPDFBookmark_GetAction=re(\"FPDFBookmark_GetAction\",1),i._FPDFAction_GetType=re(\"FPDFAction_GetType\",1),i._FPDFAction_GetDest=re(\"FPDFAction_GetDest\",2),i._FPDFAction_GetFilePath=re(\"FPDFAction_GetFilePath\",3),i._FPDFAction_GetURIPath=re(\"FPDFAction_GetURIPath\",4),i._FPDFDest_GetDestPageIndex=re(\"FPDFDest_GetDestPageIndex\",2),i._FPDFDest_GetView=re(\"FPDFDest_GetView\",3),i._FPDFDest_GetLocationInPage=re(\"FPDFDest_GetLocationInPage\",7),i._FPDFLink_GetLinkAtPoint=re(\"FPDFLink_GetLinkAtPoint\",3),i._FPDFLink_GetLinkZOrderAtPoint=re(\"FPDFLink_GetLinkZOrderAtPoint\",3),i._FPDFLink_GetDest=re(\"FPDFLink_GetDest\",2),i._FPDFLink_GetAction=re(\"FPDFLink_GetAction\",1),i._FPDFLink_Enumerate=re(\"FPDFLink_Enumerate\",3),i._FPDFLink_GetAnnot=re(\"FPDFLink_GetAnnot\",2),i._FPDFLink_GetAnnotRect=re(\"FPDFLink_GetAnnotRect\",2),i._FPDFLink_CountQuadPoints=re(\"FPDFLink_CountQuadPoints\",1),i._FPDFLink_GetQuadPoints=re(\"FPDFLink_GetQuadPoints\",3),i._FPDF_GetPageAAction=re(\"FPDF_GetPageAAction\",2),i._FPDF_GetFileIdentifier=re(\"FPDF_GetFileIdentifier\",4),i._FPDF_GetMetaText=re(\"FPDF_GetMetaText\",4),i._FPDF_GetPageLabel=re(\"FPDF_GetPageLabel\",4),i._FPDFPageObj_NewImageObj=re(\"FPDFPageObj_NewImageObj\",1),i._FPDFImageObj_LoadJpegFile=re(\"FPDFImageObj_LoadJpegFile\",4),i._FPDFImageObj_LoadJpegFileInline=re(\"FPDFImageObj_LoadJpegFileInline\",4),i._FPDFImageObj_SetMatrix=re(\"FPDFImageObj_SetMatrix\",7),i._FPDFImageObj_SetBitmap=re(\"FPDFImageObj_SetBitmap\",4),i._FPDFImageObj_GetBitmap=re(\"FPDFImageObj_GetBitmap\",1),i._FPDFImageObj_GetRenderedBitmap=re(\"FPDFImageObj_GetRenderedBitmap\",3),i._FPDFImageObj_GetImageDataDecoded=re(\"FPDFImageObj_GetImageDataDecoded\",3),i._FPDFImageObj_GetImageDataRaw=re(\"FPDFImageObj_GetImageDataRaw\",3),i._FPDFImageObj_GetImageFilterCount=re(\"FPDFImageObj_GetImageFilterCount\",1),i._FPDFImageObj_GetImageFilter=re(\"FPDFImageObj_GetImageFilter\",4),i._FPDFImageObj_GetImageMetadata=re(\"FPDFImageObj_GetImageMetadata\",3),i._FPDFImageObj_GetImagePixelSize=re(\"FPDFImageObj_GetImagePixelSize\",3),i._FPDFImageObj_GetIccProfileDataDecoded=re(\"FPDFImageObj_GetIccProfileDataDecoded\",5),i._FPDF_CreateNewDocument=re(\"FPDF_CreateNewDocument\",0),i._FPDFPage_Delete=re(\"FPDFPage_Delete\",2),i._FPDF_MovePages=re(\"FPDF_MovePages\",4),i._FPDFPage_New=re(\"FPDFPage_New\",4),i._FPDFPage_GetRotation=re(\"FPDFPage_GetRotation\",1),i._FPDFPage_InsertObject=re(\"FPDFPage_InsertObject\",2),i._FPDFPage_RemoveObject=re(\"FPDFPage_RemoveObject\",2),i._FPDFPage_CountObjects=re(\"FPDFPage_CountObjects\",1),i._FPDFPage_GetObject=re(\"FPDFPage_GetObject\",2),i._FPDFPage_HasTransparency=re(\"FPDFPage_HasTransparency\",1),i._FPDFPageObj_Destroy=re(\"FPDFPageObj_Destroy\",1),i._FPDFPageObj_GetMarkedContentID=re(\"FPDFPageObj_GetMarkedContentID\",1),i._FPDFPageObj_CountMarks=re(\"FPDFPageObj_CountMarks\",1),i._FPDFPageObj_GetMark=re(\"FPDFPageObj_GetMark\",2),i._FPDFPageObj_AddMark=re(\"FPDFPageObj_AddMark\",2),i._FPDFPageObj_RemoveMark=re(\"FPDFPageObj_RemoveMark\",2),i._FPDFPageObjMark_GetName=re(\"FPDFPageObjMark_GetName\",4),i._FPDFPageObjMark_CountParams=re(\"FPDFPageObjMark_CountParams\",1),i._FPDFPageObjMark_GetParamKey=re(\"FPDFPageObjMark_GetParamKey\",5),i._FPDFPageObjMark_GetParamValueType=re(\"FPDFPageObjMark_GetParamValueType\",2),i._FPDFPageObjMark_GetParamIntValue=re(\"FPDFPageObjMark_GetParamIntValue\",3),i._FPDFPageObjMark_GetParamStringValue=re(\"FPDFPageObjMark_GetParamStringValue\",5),i._FPDFPageObjMark_GetParamBlobValue=re(\"FPDFPageObjMark_GetParamBlobValue\",5),i._FPDFPageObj_HasTransparency=re(\"FPDFPageObj_HasTransparency\",1),i._FPDFPageObjMark_SetIntParam=re(\"FPDFPageObjMark_SetIntParam\",5),i._FPDFPageObjMark_SetStringParam=re(\"FPDFPageObjMark_SetStringParam\",5),i._FPDFPageObjMark_SetBlobParam=re(\"FPDFPageObjMark_SetBlobParam\",6),i._FPDFPageObjMark_RemoveParam=re(\"FPDFPageObjMark_RemoveParam\",3),i._FPDFPageObj_GetType=re(\"FPDFPageObj_GetType\",1),i._FPDFPageObj_GetIsActive=re(\"FPDFPageObj_GetIsActive\",2),i._FPDFPageObj_SetIsActive=re(\"FPDFPageObj_SetIsActive\",2),i._FPDFPage_GenerateContent=re(\"FPDFPage_GenerateContent\",1),i._FPDFPageObj_Transform=re(\"FPDFPageObj_Transform\",7),i._FPDFPageObj_TransformF=re(\"FPDFPageObj_TransformF\",2),i._FPDFPageObj_GetMatrix=re(\"FPDFPageObj_GetMatrix\",2),i._FPDFPageObj_SetMatrix=re(\"FPDFPageObj_SetMatrix\",2),i._FPDFPageObj_SetBlendMode=re(\"FPDFPageObj_SetBlendMode\",2),i._FPDFPage_TransformAnnots=re(\"FPDFPage_TransformAnnots\",7),i._FPDFPage_SetRotation=re(\"FPDFPage_SetRotation\",2),i._FPDFPageObj_SetFillColor=re(\"FPDFPageObj_SetFillColor\",5),i._FPDFPageObj_GetFillColor=re(\"FPDFPageObj_GetFillColor\",5),i._FPDFPageObj_GetBounds=re(\"FPDFPageObj_GetBounds\",5),i._FPDFPageObj_GetRotatedBounds=re(\"FPDFPageObj_GetRotatedBounds\",2),i._FPDFPageObj_SetStrokeColor=re(\"FPDFPageObj_SetStrokeColor\",5),i._FPDFPageObj_GetStrokeColor=re(\"FPDFPageObj_GetStrokeColor\",5),i._FPDFPageObj_SetStrokeWidth=re(\"FPDFPageObj_SetStrokeWidth\",2),i._FPDFPageObj_GetStrokeWidth=re(\"FPDFPageObj_GetStrokeWidth\",2),i._FPDFPageObj_GetLineJoin=re(\"FPDFPageObj_GetLineJoin\",1),i._FPDFPageObj_SetLineJoin=re(\"FPDFPageObj_SetLineJoin\",2),i._FPDFPageObj_GetLineCap=re(\"FPDFPageObj_GetLineCap\",1),i._FPDFPageObj_SetLineCap=re(\"FPDFPageObj_SetLineCap\",2),i._FPDFPageObj_GetDashPhase=re(\"FPDFPageObj_GetDashPhase\",2),i._FPDFPageObj_SetDashPhase=re(\"FPDFPageObj_SetDashPhase\",2),i._FPDFPageObj_GetDashCount=re(\"FPDFPageObj_GetDashCount\",1),i._FPDFPageObj_GetDashArray=re(\"FPDFPageObj_GetDashArray\",3),i._FPDFPageObj_SetDashArray=re(\"FPDFPageObj_SetDashArray\",4),i._FPDFFormObj_CountObjects=re(\"FPDFFormObj_CountObjects\",1),i._FPDFFormObj_GetObject=re(\"FPDFFormObj_GetObject\",2),i._FPDFPageObj_CreateNewPath=re(\"FPDFPageObj_CreateNewPath\",2),i._FPDFPageObj_CreateNewRect=re(\"FPDFPageObj_CreateNewRect\",4),i._FPDFPath_CountSegments=re(\"FPDFPath_CountSegments\",1),i._FPDFPath_GetPathSegment=re(\"FPDFPath_GetPathSegment\",2),i._FPDFPath_MoveTo=re(\"FPDFPath_MoveTo\",3),i._FPDFPath_LineTo=re(\"FPDFPath_LineTo\",3),i._FPDFPath_BezierTo=re(\"FPDFPath_BezierTo\",7),i._FPDFPath_Close=re(\"FPDFPath_Close\",1),i._FPDFPath_SetDrawMode=re(\"FPDFPath_SetDrawMode\",3),i._FPDFPath_GetDrawMode=re(\"FPDFPath_GetDrawMode\",3),i._FPDFPathSegment_GetPoint=re(\"FPDFPathSegment_GetPoint\",3),i._FPDFPathSegment_GetType=re(\"FPDFPathSegment_GetType\",1),i._FPDFPathSegment_GetClose=re(\"FPDFPathSegment_GetClose\",1),i._FPDFPageObj_NewTextObj=re(\"FPDFPageObj_NewTextObj\",3),i._FPDFText_SetText=re(\"FPDFText_SetText\",2),i._FPDFText_SetCharcodes=re(\"FPDFText_SetCharcodes\",3),i._FPDFText_LoadFont=re(\"FPDFText_LoadFont\",5),i._FPDFText_LoadStandardFont=re(\"FPDFText_LoadStandardFont\",2),i._FPDFText_LoadCidType2Font=re(\"FPDFText_LoadCidType2Font\",6),i._FPDFTextObj_GetFontSize=re(\"FPDFTextObj_GetFontSize\",2),i._FPDFTextObj_GetText=re(\"FPDFTextObj_GetText\",4),i._FPDFTextObj_GetRenderedBitmap=re(\"FPDFTextObj_GetRenderedBitmap\",4),i._FPDFFont_Close=re(\"FPDFFont_Close\",1),i._FPDFPageObj_CreateTextObj=re(\"FPDFPageObj_CreateTextObj\",3),i._FPDFTextObj_GetTextRenderMode=re(\"FPDFTextObj_GetTextRenderMode\",1),i._FPDFTextObj_SetTextRenderMode=re(\"FPDFTextObj_SetTextRenderMode\",2),i._FPDFTextObj_GetFont=re(\"FPDFTextObj_GetFont\",1),i._FPDFFont_GetBaseFontName=re(\"FPDFFont_GetBaseFontName\",3),i._FPDFFont_GetFamilyName=re(\"FPDFFont_GetFamilyName\",3),i._FPDFFont_GetFontData=re(\"FPDFFont_GetFontData\",4),i._FPDFFont_GetIsEmbedded=re(\"FPDFFont_GetIsEmbedded\",1),i._FPDFFont_GetFlags=re(\"FPDFFont_GetFlags\",1),i._FPDFFont_GetWeight=re(\"FPDFFont_GetWeight\",1),i._FPDFFont_GetItalicAngle=re(\"FPDFFont_GetItalicAngle\",2),i._FPDFFont_GetAscent=re(\"FPDFFont_GetAscent\",3),i._FPDFFont_GetDescent=re(\"FPDFFont_GetDescent\",3),i._FPDFFont_GetGlyphWidth=re(\"FPDFFont_GetGlyphWidth\",4),i._FPDFFont_GetGlyphPath=re(\"FPDFFont_GetGlyphPath\",3),i._FPDFGlyphPath_CountGlyphSegments=re(\"FPDFGlyphPath_CountGlyphSegments\",1),i._FPDFGlyphPath_GetGlyphPathSegment=re(\"FPDFGlyphPath_GetGlyphPathSegment\",2),i._FPDFDoc_GetPageMode=re(\"FPDFDoc_GetPageMode\",1),i._FPDFPage_Flatten=re(\"FPDFPage_Flatten\",2),i._FPDFPage_HasFormFieldAtPoint=re(\"FPDFPage_HasFormFieldAtPoint\",4),i._FPDFPage_FormFieldZOrderAtPoint=re(\"FPDFPage_FormFieldZOrderAtPoint\",4),i._malloc=re(\"malloc\",1),i._free=re(\"free\",1),i._FORM_OnMouseMove=re(\"FORM_OnMouseMove\",5),i._FORM_OnMouseWheel=re(\"FORM_OnMouseWheel\",6),i._FORM_OnFocus=re(\"FORM_OnFocus\",5),i._FORM_OnLButtonDown=re(\"FORM_OnLButtonDown\",5),i._FORM_OnLButtonUp=re(\"FORM_OnLButtonUp\",5),i._FORM_OnLButtonDoubleClick=re(\"FORM_OnLButtonDoubleClick\",5),i._FORM_OnRButtonDown=re(\"FORM_OnRButtonDown\",5),i._FORM_OnRButtonUp=re(\"FORM_OnRButtonUp\",5),i._FORM_OnKeyDown=re(\"FORM_OnKeyDown\",4),i._FORM_OnKeyUp=re(\"FORM_OnKeyUp\",4),i._FORM_OnChar=re(\"FORM_OnChar\",4),i._FORM_GetFocusedText=re(\"FORM_GetFocusedText\",4),i._FORM_GetSelectedText=re(\"FORM_GetSelectedText\",4),i._FORM_ReplaceAndKeepSelection=re(\"FORM_ReplaceAndKeepSelection\",3),i._FORM_ReplaceSelection=re(\"FORM_ReplaceSelection\",3),i._FORM_SelectAllText=re(\"FORM_SelectAllText\",2),i._FORM_CanUndo=re(\"FORM_CanUndo\",2),i._FORM_CanRedo=re(\"FORM_CanRedo\",2),i._FORM_Undo=re(\"FORM_Undo\",2),i._FORM_Redo=re(\"FORM_Redo\",2),i._FORM_ForceToKillFocus=re(\"FORM_ForceToKillFocus\",1),i._FORM_GetFocusedAnnot=re(\"FORM_GetFocusedAnnot\",3),i._FORM_SetFocusedAnnot=re(\"FORM_SetFocusedAnnot\",2),i._FPDF_FFLDraw=re(\"FPDF_FFLDraw\",9),i._FPDF_SetFormFieldHighlightColor=re(\"FPDF_SetFormFieldHighlightColor\",3),i._FPDF_SetFormFieldHighlightAlpha=re(\"FPDF_SetFormFieldHighlightAlpha\",2),i._FPDF_RemoveFormFieldHighlight=re(\"FPDF_RemoveFormFieldHighlight\",1),i._FORM_OnAfterLoadPage=re(\"FORM_OnAfterLoadPage\",2),i._FORM_OnBeforeClosePage=re(\"FORM_OnBeforeClosePage\",2),i._FORM_DoDocumentJSAction=re(\"FORM_DoDocumentJSAction\",1),i._FORM_DoDocumentOpenAction=re(\"FORM_DoDocumentOpenAction\",1),i._FORM_DoDocumentAAction=re(\"FORM_DoDocumentAAction\",2),i._FORM_DoPageAAction=re(\"FORM_DoPageAAction\",3),i._FORM_SetIndexSelected=re(\"FORM_SetIndexSelected\",4),i._FORM_IsIndexSelected=re(\"FORM_IsIndexSelected\",3),i._FPDFDoc_GetJavaScriptActionCount=re(\"FPDFDoc_GetJavaScriptActionCount\",1),i._FPDFDoc_GetJavaScriptAction=re(\"FPDFDoc_GetJavaScriptAction\",2),i._FPDFDoc_CloseJavaScriptAction=re(\"FPDFDoc_CloseJavaScriptAction\",1),i._FPDFJavaScriptAction_GetName=re(\"FPDFJavaScriptAction_GetName\",3),i._FPDFJavaScriptAction_GetScript=re(\"FPDFJavaScriptAction_GetScript\",3),i._FPDF_ImportPagesByIndex=re(\"FPDF_ImportPagesByIndex\",5),i._FPDF_ImportPages=re(\"FPDF_ImportPages\",4),i._FPDF_ImportNPagesToOne=re(\"FPDF_ImportNPagesToOne\",5),i._FPDF_NewXObjectFromPage=re(\"FPDF_NewXObjectFromPage\",3),i._FPDF_CloseXObject=re(\"FPDF_CloseXObject\",1),i._FPDF_NewFormObjectFromXObject=re(\"FPDF_NewFormObjectFromXObject\",1),i._FPDF_CopyViewerPreferences=re(\"FPDF_CopyViewerPreferences\",2),i._FPDF_RenderPageBitmapWithColorScheme_Start=re(\"FPDF_RenderPageBitmapWithColorScheme_Start\",10),i._FPDF_RenderPageBitmap_Start=re(\"FPDF_RenderPageBitmap_Start\",9),i._FPDF_RenderPage_Continue=re(\"FPDF_RenderPage_Continue\",2),i._FPDF_RenderPage_Close=re(\"FPDF_RenderPage_Close\",1),i._FPDF_SaveWithVersion=re(\"FPDF_SaveWithVersion\",4),i._FPDFText_GetCharIndexFromTextIndex=re(\"FPDFText_GetCharIndexFromTextIndex\",2),i._FPDFText_GetTextIndexFromCharIndex=re(\"FPDFText_GetTextIndexFromCharIndex\",2),i._FPDF_GetSignatureCount=re(\"FPDF_GetSignatureCount\",1),i._FPDF_GetSignatureObject=re(\"FPDF_GetSignatureObject\",2),i._FPDFSignatureObj_GetContents=re(\"FPDFSignatureObj_GetContents\",3),i._FPDFSignatureObj_GetByteRange=re(\"FPDFSignatureObj_GetByteRange\",3),i._FPDFSignatureObj_GetSubFilter=re(\"FPDFSignatureObj_GetSubFilter\",3),i._FPDFSignatureObj_GetReason=re(\"FPDFSignatureObj_GetReason\",3),i._FPDFSignatureObj_GetTime=re(\"FPDFSignatureObj_GetTime\",3),i._FPDFSignatureObj_GetDocMDPPermission=re(\"FPDFSignatureObj_GetDocMDPPermission\",1),i._FPDF_StructTree_GetForPage=re(\"FPDF_StructTree_GetForPage\",1),i._FPDF_StructTree_Close=re(\"FPDF_StructTree_Close\",1),i._FPDF_StructTree_CountChildren=re(\"FPDF_StructTree_CountChildren\",1),i._FPDF_StructTree_GetChildAtIndex=re(\"FPDF_StructTree_GetChildAtIndex\",2),i._FPDF_StructElement_GetAltText=re(\"FPDF_StructElement_GetAltText\",3),i._FPDF_StructElement_GetActualText=re(\"FPDF_StructElement_GetActualText\",3),i._FPDF_StructElement_GetID=re(\"FPDF_StructElement_GetID\",3),i._FPDF_StructElement_GetLang=re(\"FPDF_StructElement_GetLang\",3),i._FPDF_StructElement_GetAttributeCount=re(\"FPDF_StructElement_GetAttributeCount\",1),i._FPDF_StructElement_GetAttributeAtIndex=re(\"FPDF_StructElement_GetAttributeAtIndex\",2),i._FPDF_StructElement_GetStringAttribute=re(\"FPDF_StructElement_GetStringAttribute\",4),i._FPDF_StructElement_GetMarkedContentID=re(\"FPDF_StructElement_GetMarkedContentID\",1),i._FPDF_StructElement_GetType=re(\"FPDF_StructElement_GetType\",3),i._FPDF_StructElement_GetObjType=re(\"FPDF_StructElement_GetObjType\",3),i._FPDF_StructElement_GetTitle=re(\"FPDF_StructElement_GetTitle\",3),i._FPDF_StructElement_CountChildren=re(\"FPDF_StructElement_CountChildren\",1),i._FPDF_StructElement_GetChildAtIndex=re(\"FPDF_StructElement_GetChildAtIndex\",2),i._FPDF_StructElement_GetChildMarkedContentID=re(\"FPDF_StructElement_GetChildMarkedContentID\",2),i._FPDF_StructElement_GetParent=re(\"FPDF_StructElement_GetParent\",1),i._FPDF_StructElement_Attr_GetCount=re(\"FPDF_StructElement_Attr_GetCount\",1),i._FPDF_StructElement_Attr_GetName=re(\"FPDF_StructElement_Attr_GetName\",5),i._FPDF_StructElement_Attr_GetValue=re(\"FPDF_StructElement_Attr_GetValue\",2),i._FPDF_StructElement_Attr_GetType=re(\"FPDF_StructElement_Attr_GetType\",1),i._FPDF_StructElement_Attr_GetBooleanValue=re(\"FPDF_StructElement_Attr_GetBooleanValue\",2),i._FPDF_StructElement_Attr_GetNumberValue=re(\"FPDF_StructElement_Attr_GetNumberValue\",2),i._FPDF_StructElement_Attr_GetStringValue=re(\"FPDF_StructElement_Attr_GetStringValue\",4),i._FPDF_StructElement_Attr_GetBlobValue=re(\"FPDF_StructElement_Attr_GetBlobValue\",4),i._FPDF_StructElement_Attr_CountChildren=re(\"FPDF_StructElement_Attr_CountChildren\",1),i._FPDF_StructElement_Attr_GetChildAtIndex=re(\"FPDF_StructElement_Attr_GetChildAtIndex\",2),i._FPDF_StructElement_GetMarkedContentIdCount=re(\"FPDF_StructElement_GetMarkedContentIdCount\",1),i._FPDF_StructElement_GetMarkedContentIdAtIndex=re(\"FPDF_StructElement_GetMarkedContentIdAtIndex\",2),i._FPDF_AddInstalledFont=re(\"FPDF_AddInstalledFont\",3),i._FPDF_SetSystemFontInfo=re(\"FPDF_SetSystemFontInfo\",1),i._FPDF_GetDefaultTTFMap=re(\"FPDF_GetDefaultTTFMap\",0),i._FPDF_GetDefaultTTFMapCount=re(\"FPDF_GetDefaultTTFMapCount\",0),i._FPDF_GetDefaultTTFMapEntry=re(\"FPDF_GetDefaultTTFMapEntry\",1),i._FPDF_GetDefaultSystemFontInfo=re(\"FPDF_GetDefaultSystemFontInfo\",0),i._FPDF_FreeDefaultSystemFontInfo=re(\"FPDF_FreeDefaultSystemFontInfo\",1),i._FPDFText_LoadPage=re(\"FPDFText_LoadPage\",1),i._FPDFText_ClosePage=re(\"FPDFText_ClosePage\",1),i._FPDFText_CountChars=re(\"FPDFText_CountChars\",1),i._FPDFText_GetUnicode=re(\"FPDFText_GetUnicode\",2),i._FPDFText_GetTextObject=re(\"FPDFText_GetTextObject\",2),i._FPDFText_IsGenerated=re(\"FPDFText_IsGenerated\",2),i._FPDFText_IsHyphen=re(\"FPDFText_IsHyphen\",2),i._FPDFText_HasUnicodeMapError=re(\"FPDFText_HasUnicodeMapError\",2),i._FPDFText_GetFontSize=re(\"FPDFText_GetFontSize\",2),i._FPDFText_GetFontInfo=re(\"FPDFText_GetFontInfo\",5),i._FPDFText_GetFontWeight=re(\"FPDFText_GetFontWeight\",2),i._FPDFText_GetFillColor=re(\"FPDFText_GetFillColor\",6),i._FPDFText_GetStrokeColor=re(\"FPDFText_GetStrokeColor\",6),i._FPDFText_GetCharAngle=re(\"FPDFText_GetCharAngle\",2),i._FPDFText_GetCharBox=re(\"FPDFText_GetCharBox\",6),i._FPDFText_GetLooseCharBox=re(\"FPDFText_GetLooseCharBox\",3),i._FPDFText_GetMatrix=re(\"FPDFText_GetMatrix\",3),i._FPDFText_GetCharOrigin=re(\"FPDFText_GetCharOrigin\",4),i._FPDFText_GetCharIndexAtPos=re(\"FPDFText_GetCharIndexAtPos\",5),i._FPDFText_GetText=re(\"FPDFText_GetText\",4),i._FPDFText_CountRects=re(\"FPDFText_CountRects\",3),i._FPDFText_GetRect=re(\"FPDFText_GetRect\",6),i._FPDFText_GetBoundedText=re(\"FPDFText_GetBoundedText\",7),i._FPDFText_FindStart=re(\"FPDFText_FindStart\",4),i._FPDFText_FindNext=re(\"FPDFText_FindNext\",1),i._FPDFText_FindPrev=re(\"FPDFText_FindPrev\",1),i._FPDFText_GetSchResultIndex=re(\"FPDFText_GetSchResultIndex\",1),i._FPDFText_GetSchCount=re(\"FPDFText_GetSchCount\",1),i._FPDFText_FindClose=re(\"FPDFText_FindClose\",1),i._FPDFLink_LoadWebLinks=re(\"FPDFLink_LoadWebLinks\",1),i._FPDFLink_CountWebLinks=re(\"FPDFLink_CountWebLinks\",1),i._FPDFLink_GetURL=re(\"FPDFLink_GetURL\",4),i._FPDFLink_CountRects=re(\"FPDFLink_CountRects\",2),i._FPDFLink_GetRect=re(\"FPDFLink_GetRect\",7),i._FPDFLink_GetTextRange=re(\"FPDFLink_GetTextRange\",4),i._FPDFLink_CloseWebLinks=re(\"FPDFLink_CloseWebLinks\",1),i._FPDFPage_GetDecodedThumbnailData=re(\"FPDFPage_GetDecodedThumbnailData\",3),i._FPDFPage_GetRawThumbnailData=re(\"FPDFPage_GetRawThumbnailData\",3),i._FPDFPage_GetThumbnailAsBitmap=re(\"FPDFPage_GetThumbnailAsBitmap\",1),i._FPDFPage_SetMediaBox=re(\"FPDFPage_SetMediaBox\",5),i._FPDFPage_SetCropBox=re(\"FPDFPage_SetCropBox\",5),i._FPDFPage_SetBleedBox=re(\"FPDFPage_SetBleedBox\",5),i._FPDFPage_SetTrimBox=re(\"FPDFPage_SetTrimBox\",5),i._FPDFPage_SetArtBox=re(\"FPDFPage_SetArtBox\",5),i._FPDFPage_GetMediaBox=re(\"FPDFPage_GetMediaBox\",5),i._FPDFPage_GetCropBox=re(\"FPDFPage_GetCropBox\",5),i._FPDFPage_GetBleedBox=re(\"FPDFPage_GetBleedBox\",5),i._FPDFPage_GetTrimBox=re(\"FPDFPage_GetTrimBox\",5),i._FPDFPage_GetArtBox=re(\"FPDFPage_GetArtBox\",5),i._FPDFPage_TransFormWithClip=re(\"FPDFPage_TransFormWithClip\",3),i._FPDFPageObj_TransformClipPath=re(\"FPDFPageObj_TransformClipPath\",7),i._FPDFPageObj_GetClipPath=re(\"FPDFPageObj_GetClipPath\",1),i._FPDFClipPath_CountPaths=re(\"FPDFClipPath_CountPaths\",1),i._FPDFClipPath_CountPathSegments=re(\"FPDFClipPath_CountPathSegments\",2),i._FPDFClipPath_GetPathSegment=re(\"FPDFClipPath_GetPathSegment\",3),i._FPDF_CreateClipPath=re(\"FPDF_CreateClipPath\",4),i._FPDF_DestroyClipPath=re(\"FPDF_DestroyClipPath\",1),i._FPDFPage_InsertClipPath=re(\"FPDFPage_InsertClipPath\",2),i._FPDF_InitLibrary=re(\"FPDF_InitLibrary\",0),i._FPDF_DestroyLibrary=re(\"FPDF_DestroyLibrary\",0),i._FPDF_SetSandBoxPolicy=re(\"FPDF_SetSandBoxPolicy\",2),i._FPDF_LoadDocument=re(\"FPDF_LoadDocument\",2),i._FPDF_GetFormType=re(\"FPDF_GetFormType\",1),i._FPDF_LoadXFA=re(\"FPDF_LoadXFA\",1),i._FPDF_LoadMemDocument=re(\"FPDF_LoadMemDocument\",3),i._FPDF_LoadMemDocument64=re(\"FPDF_LoadMemDocument64\",3),i._FPDF_LoadCustomDocument=re(\"FPDF_LoadCustomDocument\",2),i._FPDF_GetFileVersion=re(\"FPDF_GetFileVersion\",2),i._FPDF_DocumentHasValidCrossReferenceTable=re(\"FPDF_DocumentHasValidCrossReferenceTable\",1),i._FPDF_GetDocPermissions=re(\"FPDF_GetDocPermissions\",1),i._FPDF_GetDocUserPermissions=re(\"FPDF_GetDocUserPermissions\",1),i._FPDF_GetSecurityHandlerRevision=re(\"FPDF_GetSecurityHandlerRevision\",1),i._FPDF_GetPageCount=re(\"FPDF_GetPageCount\",1),i._FPDF_LoadPage=re(\"FPDF_LoadPage\",2),i._FPDF_GetPageWidthF=re(\"FPDF_GetPageWidthF\",1),i._FPDF_GetPageWidth=re(\"FPDF_GetPageWidth\",1),i._FPDF_GetPageHeightF=re(\"FPDF_GetPageHeightF\",1),i._FPDF_GetPageHeight=re(\"FPDF_GetPageHeight\",1),i._FPDF_GetPageBoundingBox=re(\"FPDF_GetPageBoundingBox\",2),i._FPDF_RenderPageBitmap=re(\"FPDF_RenderPageBitmap\",8),i._FPDF_RenderPageBitmapWithMatrix=re(\"FPDF_RenderPageBitmapWithMatrix\",5),i._FPDF_ClosePage=re(\"FPDF_ClosePage\",1),i._FPDF_CloseDocument=re(\"FPDF_CloseDocument\",1),i._FPDF_GetLastError=re(\"FPDF_GetLastError\",0),i._FPDF_DeviceToPage=re(\"FPDF_DeviceToPage\",10),i._FPDF_PageToDevice=re(\"FPDF_PageToDevice\",10),i._FPDFBitmap_Create=re(\"FPDFBitmap_Create\",3),i._FPDFBitmap_CreateEx=re(\"FPDFBitmap_CreateEx\",5),i._FPDFBitmap_GetFormat=re(\"FPDFBitmap_GetFormat\",1),i._FPDFBitmap_FillRect=re(\"FPDFBitmap_FillRect\",6),i._FPDFBitmap_GetBuffer=re(\"FPDFBitmap_GetBuffer\",1),i._FPDFBitmap_GetWidth=re(\"FPDFBitmap_GetWidth\",1),i._FPDFBitmap_GetHeight=re(\"FPDFBitmap_GetHeight\",1),i._FPDFBitmap_GetStride=re(\"FPDFBitmap_GetStride\",1),i._FPDFBitmap_Destroy=re(\"FPDFBitmap_Destroy\",1),i._FPDF_GetPageSizeByIndexF=re(\"FPDF_GetPageSizeByIndexF\",3),i._FPDF_GetPageSizeByIndex=re(\"FPDF_GetPageSizeByIndex\",4),i._FPDF_VIEWERREF_GetPrintScaling=re(\"FPDF_VIEWERREF_GetPrintScaling\",1),i._FPDF_VIEWERREF_GetNumCopies=re(\"FPDF_VIEWERREF_GetNumCopies\",1),i._FPDF_VIEWERREF_GetPrintPageRange=re(\"FPDF_VIEWERREF_GetPrintPageRange\",1),i._FPDF_VIEWERREF_GetPrintPageRangeCount=re(\"FPDF_VIEWERREF_GetPrintPageRangeCount\",1),i._FPDF_VIEWERREF_GetPrintPageRangeElement=re(\"FPDF_VIEWERREF_GetPrintPageRangeElement\",2),i._FPDF_VIEWERREF_GetDuplex=re(\"FPDF_VIEWERREF_GetDuplex\",1),i._FPDF_VIEWERREF_GetName=re(\"FPDF_VIEWERREF_GetName\",4),i._FPDF_CountNamedDests=re(\"FPDF_CountNamedDests\",1),i._FPDF_GetNamedDestByName=re(\"FPDF_GetNamedDestByName\",2),i._FPDF_GetNamedDest=re(\"FPDF_GetNamedDest\",4),i._FPDF_GetXFAPacketCount=re(\"FPDF_GetXFAPacketCount\",1),i._FPDF_GetXFAPacketName=re(\"FPDF_GetXFAPacketName\",4),i._FPDF_GetXFAPacketContent=re(\"FPDF_GetXFAPacketContent\",5),i._FPDF_GetTrailerEnds=re(\"FPDF_GetTrailerEnds\",3);var it,at,st=re(\"fflush\",1),Ft=re(\"emscripten_builtin_memalign\",2),ut=re(\"strerror\",1),mt=re(\"setThrew\",2),lt=()=>(lt=ot.emscripten_stack_init)(),dt=()=>(dt=ot.emscripten_stack_get_end)(),_t=e=>(_t=ot._emscripten_stack_restore)(e),Pt=e=>(Pt=ot._emscripten_stack_alloc)(e),ct=()=>(ct=ot.emscripten_stack_get_current)();function ht(){var e;lt(),I(!(3&(e=dt()))),0==e&&(e+=4),x[e>>2]=34821223,x[e+4>>2]=2310721022,x[0]=1668509029}function gt(){var e;function t(){it||(it=1,i.calledRun=1,R||(I(!U),U=!0,j(),i.noFSInit||Le.initialized||Le.init(),Le.ignorePermissions=!1,de(B),r(i),i.onRuntimeInitialized?.(),I(!i._main,'compiled without a main, but one is present. if you added it from JS, use Module[\"onRuntimeInitialized\"]'),function(){j();var e=i.postRun;e&&(\"function\"==typeof e&&(e=[e]),e.forEach(W)),de(N)}()))}z>0||(ht(),!at&&(at=1,(e=i.preRun)&&(\"function\"==typeof e&&(e=[e]),e.forEach(V)),de(L),z>0)||(i.setStatus?(i.setStatus(\"Running...\"),setTimeout((()=>{setTimeout((()=>i.setStatus(\"\")),1),t()}),1)):t(),j()))}if(i.dynCall_ji=re(\"dynCall_ji\",2),i.dynCall_jij=re(\"dynCall_jij\",4),i.dynCall_iiij=re(\"dynCall_iiij\",5),i.dynCall_iij=re(\"dynCall_iij\",4),i.dynCall_j=re(\"dynCall_j\",1),i.dynCall_jji=re(\"dynCall_jji\",4),i.dynCall_iji=re(\"dynCall_iji\",4),i.dynCall_viijii=re(\"dynCall_viijii\",7),i.dynCall_iiji=re(\"dynCall_iiji\",5),i.dynCall_jiji=re(\"dynCall_jiji\",5),i.dynCall_iiiiij=re(\"dynCall_iiiiij\",7),i.dynCall_iiiiijj=re(\"dynCall_iiiiijj\",9),i.dynCall_iiiiiijj=re(\"dynCall_iiiiiijj\",10),i.dynCall_viji=re(\"dynCall_viji\",5),i.wasmExports=ot,i.ccall=nt,i.cwrap=(e,t,n,r)=>(...r)=>nt(e,t,n,r),i.addFunction=(e,t)=>{I(void 0!==e);var n=Qe(e);if(n)return n;var r=(()=>{if(Ze.length)return Ze.pop();try{ye.grow(1)}catch(e){if(!(e instanceof RangeError))throw e;throw\"Unable to grow wasm table. Set ALLOW_TABLE_GROWTH.\"}return ye.length-1})();try{et(r,e)}catch(n){if(!(n instanceof TypeError))throw n;I(void 0!==t,\"Missing signature argument to addFunction: \"+e);var o=qe(e,t);et(r,o)}return Oe.set(e,r),r},i.removeFunction=e=>{Oe.delete(Ke(e)),et(e,null),Ze.push(e)},i.setValue=function(e,t,n=\"i8\"){switch(n.endsWith(\"*\")&&(n=\"*\"),n){case\"i1\":case\"i8\":T[e]=t;break;case\"i16\":C[e>>1]=t;break;case\"i32\":O[e>>2]=t;break;case\"i64\":q(\"to do setValue(i64) use WASM_BIGINT\");case\"float\":v[e>>2]=t;break;case\"double\":w[e>>3]=t;break;case\"*\":x[e>>2]=t;break;default:q(`invalid type for setValue: ${n}`)}},i.getValue=function(e,t=\"i8\"){switch(t.endsWith(\"*\")&&(t=\"*\"),t){case\"i1\":case\"i8\":return T[e];case\"i16\":return C[e>>1];case\"i32\":return O[e>>2];case\"i64\":q(\"to do getValue(i64) use WASM_BIGINT\");case\"float\":return v[e>>2];case\"double\":return w[e>>3];case\"*\":return x[e>>2];default:q(`invalid type for getValue: ${t}`)}},i.UTF8ToString=be,i.stringToUTF8=Ue,i.UTF16ToString=(e,t)=>{I(e%2==0,\"Pointer passed to UTF16ToString must be aligned to two bytes!\");for(var n=e,r=n>>1,o=r+t/2;!(r>=o)&&y[r];)++r;if((n=r<<1)-e>32&&Ye)return Ye.decode(M.subarray(e,n));for(var i=\"\",a=0;!(a>=t/2);++a){var s=C[e+2*a>>1];if(0==s)break;i+=String.fromCharCode(s)}return i},i.stringToUTF16=(e,t,n)=>{if(I(t%2==0,\"Pointer passed to stringToUTF16 must be aligned to two bytes!\"),I(\"number\"==typeof n,\"stringToUTF16(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!\"),n??=2147483647,n<2)return 0;for(var r=t,o=(n-=2)<2*e.length?n/2:e.length,i=0;i<o;++i){var a=e.charCodeAt(i);C[t>>1]=a,t+=2}return C[t>>1]=0,t-r},[\"writeI53ToI64\",\"writeI53ToI64Clamped\",\"writeI53ToI64Signaling\",\"writeI53ToU64Clamped\",\"writeI53ToU64Signaling\",\"readI53FromI64\",\"readI53FromU64\",\"convertI32PairToI53\",\"convertU32PairToI53\",\"getTempRet0\",\"setTempRet0\",\"exitJS\",\"inetPton4\",\"inetNtop4\",\"inetPton6\",\"inetNtop6\",\"readSockaddr\",\"writeSockaddr\",\"emscriptenLog\",\"readEmAsmArgs\",\"jstoi_q\",\"listenOnce\",\"autoResumeAudioContext\",\"dynCallLegacy\",\"getDynCaller\",\"dynCall\",\"handleException\",\"keepRuntimeAlive\",\"runtimeKeepalivePush\",\"runtimeKeepalivePop\",\"callUserCallback\",\"maybeExit\",\"asmjsMangle\",\"HandleAllocator\",\"getNativeTypeSize\",\"STACK_SIZE\",\"STACK_ALIGN\",\"POINTER_SIZE\",\"ASSERTIONS\",\"reallyNegative\",\"unSign\",\"strLen\",\"reSign\",\"formatString\",\"intArrayToString\",\"AsciiToString\",\"lengthBytesUTF16\",\"UTF32ToString\",\"stringToUTF32\",\"lengthBytesUTF32\",\"stringToNewUTF8\",\"registerKeyEventCallback\",\"maybeCStringToJsString\",\"findEventTarget\",\"getBoundingClientRect\",\"fillMouseEventData\",\"registerMouseEventCallback\",\"registerWheelEventCallback\",\"registerUiEventCallback\",\"registerFocusEventCallback\",\"fillDeviceOrientationEventData\",\"registerDeviceOrientationEventCallback\",\"fillDeviceMotionEventData\",\"registerDeviceMotionEventCallback\",\"screenOrientation\",\"fillOrientationChangeEventData\",\"registerOrientationChangeEventCallback\",\"fillFullscreenChangeEventData\",\"registerFullscreenChangeEventCallback\",\"JSEvents_requestFullscreen\",\"JSEvents_resizeCanvasForFullscreen\",\"registerRestoreOldStyle\",\"hideEverythingExceptGivenElement\",\"restoreHiddenElements\",\"setLetterbox\",\"softFullscreenResizeWebGLRenderTarget\",\"doRequestFullscreen\",\"fillPointerlockChangeEventData\",\"registerPointerlockChangeEventCallback\",\"registerPointerlockErrorEventCallback\",\"requestPointerLock\",\"fillVisibilityChangeEventData\",\"registerVisibilityChangeEventCallback\",\"registerTouchEventCallback\",\"fillGamepadEventData\",\"registerGamepadEventCallback\",\"registerBeforeUnloadEventCallback\",\"fillBatteryEventData\",\"battery\",\"registerBatteryEventCallback\",\"setCanvasElementSize\",\"getCanvasElementSize\",\"jsStackTrace\",\"getCallstack\",\"convertPCtoSourceLocation\",\"checkWasiClock\",\"wasiRightsToMuslOFlags\",\"wasiOFlagsToMuslOFlags\",\"createDyncallWrapper\",\"safeSetTimeout\",\"setImmediateWrapped\",\"clearImmediateWrapped\",\"polyfillSetImmediate\",\"registerPostMainLoop\",\"registerPreMainLoop\",\"getPromise\",\"makePromise\",\"idsToPromises\",\"makePromiseCallback\",\"ExceptionInfo\",\"findMatchingCatch\",\"Browser_asyncPrepareDataCounter\",\"safeRequestAnimationFrame\",\"arraySum\",\"addDays\",\"getSocketFromFD\",\"getSocketAddress\",\"FS_unlink\",\"FS_mkdirTree\",\"_setNetworkCallback\",\"heapObjectForWebGLType\",\"toTypedArrayIndex\",\"webgl_enable_ANGLE_instanced_arrays\",\"webgl_enable_OES_vertex_array_object\",\"webgl_enable_WEBGL_draw_buffers\",\"webgl_enable_WEBGL_multi_draw\",\"webgl_enable_EXT_polygon_offset_clamp\",\"webgl_enable_EXT_clip_control\",\"webgl_enable_WEBGL_polygon_mode\",\"emscriptenWebGLGet\",\"computeUnpackAlignedImageSize\",\"colorChannelsInGlTextureFormat\",\"emscriptenWebGLGetTexPixelData\",\"emscriptenWebGLGetUniform\",\"webglGetUniformLocation\",\"webglPrepareUniformLocationsBeforeFirstUse\",\"webglGetLeftBracePos\",\"emscriptenWebGLGetVertexAttrib\",\"__glGetActiveAttribOrUniform\",\"writeGLArray\",\"registerWebGlEventCallback\",\"runAndAbortIfError\",\"ALLOC_NORMAL\",\"ALLOC_STACK\",\"allocate\",\"writeStringToMemory\",\"writeAsciiToMemory\",\"setErrNo\",\"demangle\",\"stackTrace\"].forEach((function(e){ue(e,(()=>{var t=`\\`${e}\\` is a library symbol and not included by default; add it to your library.js __deps or to DEFAULT_LIBRARY_FUNCS_TO_INCLUDE on the command line`,n=e;n.startsWith(\"_\")||(n=\"$\"+e),t+=` (e.g. -sDEFAULT_LIBRARY_FUNCS_TO_INCLUDE='${n}')`,Fe(e)&&(t+=\". Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you\"),he(t)})),le(e)})),[\"run\",\"addOnPreRun\",\"addOnInit\",\"addOnPreMain\",\"addOnExit\",\"addOnPostRun\",\"addRunDependency\",\"removeRunDependency\",\"out\",\"err\",\"callMain\",\"abort\",\"wasmMemory\",\"writeStackCookie\",\"checkStackCookie\",\"convertI32PairToI53Checked\",\"stackSave\",\"stackRestore\",\"stackAlloc\",\"ptrToString\",\"zeroMemory\",\"getHeapMax\",\"growMemory\",\"ENV\",\"ERRNO_CODES\",\"strError\",\"DNS\",\"Protocols\",\"Sockets\",\"initRandomFill\",\"randomFill\",\"timers\",\"warnOnce\",\"readEmAsmArgsArray\",\"jstoi_s\",\"getExecutableName\",\"asyncLoad\",\"alignMemory\",\"mmapAlloc\",\"wasmTable\",\"noExitRuntime\",\"getCFunc\",\"uleb128Encode\",\"sigToWasmTypes\",\"generateFuncType\",\"convertJsFunctionToWasm\",\"freeTableIndexes\",\"functionsInTableMap\",\"getEmptyTableSlot\",\"updateTableMap\",\"getFunctionAddress\",\"PATH\",\"PATH_FS\",\"UTF8Decoder\",\"UTF8ArrayToString\",\"stringToUTF8Array\",\"lengthBytesUTF8\",\"intArrayFromString\",\"stringToAscii\",\"UTF16Decoder\",\"stringToUTF8OnStack\",\"writeArrayToMemory\",\"JSEvents\",\"specialHTMLTargets\",\"findCanvasEventTarget\",\"currentFullscreenStrategy\",\"restoreOldWindowedStyle\",\"UNWIND_CACHE\",\"ExitStatus\",\"getEnvStrings\",\"doReadv\",\"doWritev\",\"promiseMap\",\"uncaughtExceptionCount\",\"exceptionLast\",\"exceptionCaught\",\"Browser\",\"getPreloadedImageData__data\",\"wget\",\"MONTH_DAYS_REGULAR\",\"MONTH_DAYS_LEAP\",\"MONTH_DAYS_REGULAR_CUMULATIVE\",\"MONTH_DAYS_LEAP_CUMULATIVE\",\"isLeapYear\",\"ydayFromDate\",\"SYSCALLS\",\"preloadPlugins\",\"FS_createPreloadedFile\",\"FS_modeStringToFlags\",\"FS_getMode\",\"FS_stdin_getChar_buffer\",\"FS_stdin_getChar\",\"FS_createPath\",\"FS_createDevice\",\"FS_readFile\",\"FS\",\"FS_createDataFile\",\"FS_createLazyFile\",\"MEMFS\",\"TTY\",\"PIPEFS\",\"SOCKFS\",\"tempFixedLengthArray\",\"miniTempWebGLFloatBuffers\",\"miniTempWebGLIntBuffers\",\"GL\",\"AL\",\"GLUT\",\"EGL\",\"GLEW\",\"IDBStore\",\"SDL\",\"SDL_gfx\",\"allocateUTF8\",\"allocateUTF8OnStack\",\"print\",\"printErr\"].forEach(le),$=function e(){it||gt(),it||($=e)},i.preInit)for(\"function\"==typeof i.preInit&&(i.preInit=[i.preInit]);i.preInit.length>0;)i.preInit.pop()();gt(),n=a;for(const e of Object.keys(i))e in t||Object.defineProperty(t,e,{configurable:!0,get(){q(`Access to module property ('${e}') is no longer possible via the module constructor argument; Instead, use the result of the module constructor.`)}});return n});const n={FORM_CanRedo:[[\"number\",\"number\"],\"boolean\"],FORM_CanUndo:[[\"number\",\"number\"],\"boolean\"],FORM_DoDocumentAAction:[[\"number\",\"number\"],null],FORM_DoDocumentJSAction:[[\"number\"],null],FORM_DoDocumentOpenAction:[[\"number\"],null],FORM_DoPageAAction:[[\"number\",\"number\",\"number\"],null],FORM_ForceToKillFocus:[[\"number\"],\"boolean\"],FORM_GetFocusedAnnot:[[\"number\",\"number\",\"number\"],\"boolean\"],FORM_GetFocusedText:[[\"number\",\"number\",\"number\",\"number\"],\"number\"],FORM_GetSelectedText:[[\"number\",\"number\",\"number\",\"number\"],\"number\"],FORM_IsIndexSelected:[[\"number\",\"number\",\"number\"],\"boolean\"],FORM_OnAfterLoadPage:[[\"number\",\"number\"],null],FORM_OnBeforeClosePage:[[\"number\",\"number\"],null],FORM_OnChar:[[\"number\",\"number\",\"number\",\"number\"],\"boolean\"],FORM_OnFocus:[[\"number\",\"number\",\"number\",\"number\",\"number\"],\"boolean\"],FORM_OnKeyDown:[[\"number\",\"number\",\"number\",\"number\"],\"boolean\"],FORM_OnKeyUp:[[\"number\",\"number\",\"number\",\"number\"],\"boolean\"],FORM_OnLButtonDoubleClick:[[\"number\",\"number\",\"number\",\"number\",\"number\"],\"boolean\"],FORM_OnLButtonDown:[[\"number\",\"number\",\"number\",\"number\",\"number\"],\"boolean\"],FORM_OnLButtonUp:[[\"number\",\"number\",\"number\",\"number\",\"number\"],\"boolean\"],FORM_OnMouseMove:[[\"number\",\"number\",\"number\",\"number\",\"number\"],\"boolean\"],FORM_OnMouseWheel:[[\"number\",\"number\",\"number\",\"number\",\"number\",\"number\"],\"boolean\"],FORM_OnRButtonDown:[[\"number\",\"number\",\"number\",\"number\",\"number\"],\"boolean\"],FORM_OnRButtonUp:[[\"number\",\"number\",\"number\",\"number\",\"number\"],\"boolean\"],FORM_Redo:[[\"number\",\"number\"],\"boolean\"],FORM_ReplaceAndKeepSelection:[[\"number\",\"number\",\"number\"],null],FORM_ReplaceSelection:[[\"number\",\"number\",\"number\"],null],FORM_SelectAllText:[[\"number\",\"number\"],\"boolean\"],FORM_SetFocusedAnnot:[[\"number\",\"number\"],\"boolean\"],FORM_SetIndexSelected:[[\"number\",\"number\",\"number\",\"boolean\"],\"boolean\"],FORM_Undo:[[\"number\",\"number\"],\"boolean\"],FPDF_AddInstalledFont:[[\"number\",\"number\",\"number\"],null],FPDF_CloseDocument:[[\"number\"],null],FPDF_ClosePage:[[\"number\"],null],FPDF_CloseXObject:[[\"number\"],null],FPDF_CopyViewerPreferences:[[\"number\",\"number\"],\"boolean\"],FPDF_CountNamedDests:[[\"number\"],\"number\"],FPDF_CreateClipPath:[[\"number\",\"number\",\"number\",\"number\"],\"number\"],FPDF_CreateNewDocument:[[],\"number\"],FPDF_DestroyClipPath:[[\"number\"],null],FPDF_DestroyLibrary:[[],null],FPDF_DeviceToPage:[[\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\"],\"boolean\"],FPDF_DocumentHasValidCrossReferenceTable:[[\"number\"],\"boolean\"],FPDF_FFLDraw:[[\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\"],null],FPDF_FreeDefaultSystemFontInfo:[[\"number\"],null],FPDF_GetDefaultSystemFontInfo:[[],\"number\"],FPDF_GetDefaultTTFMap:[[],\"number\"],FPDF_GetDefaultTTFMapCount:[[],\"number\"],FPDF_GetDefaultTTFMapEntry:[[\"number\"],\"number\"],FPDF_GetDocPermissions:[[\"number\"],\"number\"],FPDF_GetDocUserPermissions:[[\"number\"],\"number\"],FPDF_GetFileIdentifier:[[\"number\",\"number\",\"number\",\"number\"],\"number\"],FPDF_GetFileVersion:[[\"number\",\"number\"],\"boolean\"],FPDF_GetFormType:[[\"number\"],\"number\"],FPDF_GetLastError:[[],\"number\"],FPDF_GetMetaText:[[\"number\",\"string\",\"number\",\"number\"],\"number\"],FPDF_GetNamedDest:[[\"number\",\"number\",\"number\",\"number\"],\"number\"],FPDF_GetNamedDestByName:[[\"number\",\"string\"],\"number\"],FPDF_GetPageAAction:[[\"number\",\"number\"],\"number\"],FPDF_GetPageBoundingBox:[[\"number\",\"number\"],\"boolean\"],FPDF_GetPageCount:[[\"number\"],\"number\"],FPDF_GetPageHeight:[[\"number\"],\"number\"],FPDF_GetPageHeightF:[[\"number\"],\"number\"],FPDF_GetPageLabel:[[\"number\",\"number\",\"number\",\"number\"],\"number\"],FPDF_GetPageSizeByIndex:[[\"number\",\"number\",\"number\",\"number\"],\"number\"],FPDF_GetPageSizeByIndexF:[[\"number\",\"number\",\"number\"],\"boolean\"],FPDF_GetPageWidth:[[\"number\"],\"number\"],FPDF_GetPageWidthF:[[\"number\"],\"number\"],FPDF_GetSecurityHandlerRevision:[[\"number\"],\"number\"],FPDF_GetSignatureCount:[[\"number\"],\"number\"],FPDF_GetSignatureObject:[[\"number\",\"number\"],\"number\"],FPDF_GetTrailerEnds:[[\"number\",\"number\",\"number\"],\"number\"],FPDF_GetXFAPacketContent:[[\"number\",\"number\",\"number\",\"number\",\"number\"],\"boolean\"],FPDF_GetXFAPacketCount:[[\"number\"],\"number\"],FPDF_GetXFAPacketName:[[\"number\",\"number\",\"number\",\"number\"],\"number\"],FPDF_ImportNPagesToOne:[[\"number\",\"number\",\"number\",\"number\",\"number\"],\"number\"],FPDF_ImportPages:[[\"number\",\"number\",\"string\",\"number\"],\"boolean\"],FPDF_ImportPagesByIndex:[[\"number\",\"number\",\"number\",\"number\",\"number\"],\"boolean\"],FPDF_InitLibrary:[[],null],FPDF_InitLibraryWithConfig:[[\"number\"],null],FPDF_LoadCustomDocument:[[\"number\",\"string\"],\"number\"],FPDF_LoadDocument:[[\"number\",\"string\"],\"number\"],FPDF_LoadMemDocument:[[\"number\",\"number\",\"string\"],\"number\"],FPDF_LoadMemDocument64:[[\"number\",\"number\",\"string\"],\"number\"],FPDF_LoadPage:[[\"number\",\"number\"],\"number\"],FPDF_LoadXFA:[[\"number\"],\"boolean\"],FPDF_MovePages:[[\"number\",\"number\",\"number\",\"number\"],\"boolean\"],FPDF_NewFormObjectFromXObject:[[\"number\"],\"number\"],FPDF_NewXObjectFromPage:[[\"number\",\"number\",\"number\"],\"number\"],FPDF_PageToDevice:[[\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\"],\"boolean\"],FPDF_RemoveFormFieldHighlight:[[\"number\"],null],FPDF_RenderPage_Close:[[\"number\"],null],FPDF_RenderPage_Continue:[[\"number\",\"number\"],\"number\"],FPDF_RenderPageBitmap:[[\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\"],null],FPDF_RenderPageBitmap_Start:[[\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\"],\"number\"],FPDF_RenderPageBitmapWithColorScheme_Start:[[\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\"],\"number\"],FPDF_RenderPageBitmapWithMatrix:[[\"number\",\"number\",\"number\",\"number\",\"number\"],null],FPDF_SaveAsCopy:[[\"number\",\"number\",\"number\"],\"boolean\"],FPDF_SaveWithVersion:[[\"number\",\"number\",\"number\",\"number\"],\"boolean\"],FPDF_SetFormFieldHighlightAlpha:[[\"number\",\"number\"],null],FPDF_SetFormFieldHighlightColor:[[\"number\",\"number\",\"number\"],null],FPDF_SetSandBoxPolicy:[[\"number\",\"boolean\"],null],FPDF_SetSystemFontInfo:[[\"number\"],null],FPDF_StructElement_Attr_CountChildren:[[\"number\"],\"number\"],FPDF_StructElement_Attr_GetBlobValue:[[\"number\",\"number\",\"number\",\"number\"],\"boolean\"],FPDF_StructElement_Attr_GetBooleanValue:[[\"number\",\"number\"],\"boolean\"],FPDF_StructElement_Attr_GetChildAtIndex:[[\"number\",\"number\"],\"number\"],FPDF_StructElement_Attr_GetCount:[[\"number\"],\"number\"],FPDF_StructElement_Attr_GetName:[[\"number\",\"number\",\"number\",\"number\",\"number\"],\"boolean\"],FPDF_StructElement_Attr_GetNumberValue:[[\"number\",\"number\"],\"boolean\"],FPDF_StructElement_Attr_GetStringValue:[[\"number\",\"number\",\"number\",\"number\"],\"boolean\"],FPDF_StructElement_Attr_GetType:[[\"number\"],\"number\"],FPDF_StructElement_Attr_GetValue:[[\"number\",\"string\"],\"number\"],FPDF_StructElement_CountChildren:[[\"number\"],\"number\"],FPDF_StructElement_GetActualText:[[\"number\",\"number\",\"number\"],\"number\"],FPDF_StructElement_GetAltText:[[\"number\",\"number\",\"number\"],\"number\"],FPDF_StructElement_GetAttributeAtIndex:[[\"number\",\"number\"],\"number\"],FPDF_StructElement_GetAttributeCount:[[\"number\"],\"number\"],FPDF_StructElement_GetChildAtIndex:[[\"number\",\"number\"],\"number\"],FPDF_StructElement_GetChildMarkedContentID:[[\"number\",\"number\"],\"number\"],FPDF_StructElement_GetID:[[\"number\",\"number\",\"number\"],\"number\"],FPDF_StructElement_GetLang:[[\"number\",\"number\",\"number\"],\"number\"],FPDF_StructElement_GetMarkedContentID:[[\"number\"],\"number\"],FPDF_StructElement_GetMarkedContentIdAtIndex:[[\"number\",\"number\"],\"number\"],FPDF_StructElement_GetMarkedContentIdCount:[[\"number\"],\"number\"],FPDF_StructElement_GetObjType:[[\"number\",\"number\",\"number\"],\"number\"],FPDF_StructElement_GetParent:[[\"number\"],\"number\"],FPDF_StructElement_GetStringAttribute:[[\"number\",\"string\",\"number\",\"number\"],\"number\"],FPDF_StructElement_GetTitle:[[\"number\",\"number\",\"number\"],\"number\"],FPDF_StructElement_GetType:[[\"number\",\"number\",\"number\"],\"number\"],FPDF_StructTree_Close:[[\"number\"],null],FPDF_StructTree_CountChildren:[[\"number\"],\"number\"],FPDF_StructTree_GetChildAtIndex:[[\"number\",\"number\"],\"number\"],FPDF_StructTree_GetForPage:[[\"number\"],\"number\"],FPDF_VIEWERREF_GetDuplex:[[\"number\"],\"number\"],FPDF_VIEWERREF_GetName:[[\"number\",\"string\",\"number\",\"number\"],\"number\"],FPDF_VIEWERREF_GetNumCopies:[[\"number\"],\"number\"],FPDF_VIEWERREF_GetPrintPageRange:[[\"number\"],\"number\"],FPDF_VIEWERREF_GetPrintPageRangeCount:[[\"number\"],\"number\"],FPDF_VIEWERREF_GetPrintPageRangeElement:[[\"number\",\"number\"],\"number\"],FPDF_VIEWERREF_GetPrintScaling:[[\"number\"],\"boolean\"],FPDFAction_GetDest:[[\"number\",\"number\"],\"number\"],FPDFAction_GetFilePath:[[\"number\",\"number\",\"number\"],\"number\"],FPDFAction_GetType:[[\"number\"],\"number\"],FPDFAction_GetURIPath:[[\"number\",\"number\",\"number\",\"number\"],\"number\"],FPDFAnnot_AddFileAttachment:[[\"number\",\"number\"],\"number\"],FPDFAnnot_AddInkStroke:[[\"number\",\"number\",\"number\"],\"number\"],FPDFAnnot_AppendAttachmentPoints:[[\"number\",\"number\"],\"boolean\"],FPDFAnnot_AppendObject:[[\"number\",\"number\"],\"boolean\"],FPDFAnnot_CountAttachmentPoints:[[\"number\"],\"number\"],FPDFAnnot_GetAP:[[\"number\",\"number\",\"number\",\"number\"],\"number\"],FPDFAnnot_GetAttachmentPoints:[[\"number\",\"number\",\"number\"],\"boolean\"],FPDFAnnot_GetBorder:[[\"number\",\"number\",\"number\",\"number\"],\"boolean\"],FPDFAnnot_GetColor:[[\"number\",\"number\",\"number\",\"number\",\"number\",\"number\"],\"boolean\"],FPDFAnnot_GetFileAttachment:[[\"number\"],\"number\"],FPDFAnnot_GetFlags:[[\"number\"],\"number\"],FPDFAnnot_GetFocusableSubtypes:[[\"number\",\"number\",\"number\"],\"boolean\"],FPDFAnnot_GetFocusableSubtypesCount:[[\"number\"],\"number\"],FPDFAnnot_GetFontColor:[[\"number\",\"number\",\"number\",\"number\",\"number\"],\"boolean\"],FPDFAnnot_GetFontSize:[[\"number\",\"number\",\"number\"],\"boolean\"],FPDFAnnot_GetFormAdditionalActionJavaScript:[[\"number\",\"number\",\"number\",\"number\",\"number\"],\"number\"],FPDFAnnot_GetFormControlCount:[[\"number\",\"number\"],\"number\"],FPDFAnnot_GetFormControlIndex:[[\"number\",\"number\"],\"number\"],FPDFAnnot_GetFormFieldAlternateName:[[\"number\",\"number\",\"number\",\"number\"],\"number\"],FPDFAnnot_GetFormFieldAtPoint:[[\"number\",\"number\",\"number\"],\"number\"],FPDFAnnot_GetFormFieldExportValue:[[\"number\",\"number\",\"number\",\"number\"],\"number\"],FPDFAnnot_GetFormFieldFlags:[[\"number\",\"number\"],\"number\"],FPDFAnnot_GetFormFieldName:[[\"number\",\"number\",\"number\",\"number\"],\"number\"],FPDFAnnot_GetFormFieldType:[[\"number\",\"number\"],\"number\"],FPDFAnnot_GetFormFieldValue:[[\"number\",\"number\",\"number\",\"number\"],\"number\"],FPDFAnnot_GetInkListCount:[[\"number\"],\"number\"],FPDFAnnot_GetInkListPath:[[\"number\",\"number\",\"number\",\"number\"],\"number\"],FPDFAnnot_GetLine:[[\"number\",\"number\",\"number\"],\"boolean\"],FPDFAnnot_GetLink:[[\"number\"],\"number\"],FPDFAnnot_GetLinkedAnnot:[[\"number\",\"string\"],\"number\"],FPDFAnnot_GetNumberValue:[[\"number\",\"string\",\"number\"],\"boolean\"],FPDFAnnot_GetObject:[[\"number\",\"number\"],\"number\"],FPDFAnnot_GetObjectCount:[[\"number\"],\"number\"],FPDFAnnot_GetOptionCount:[[\"number\",\"number\"],\"number\"],FPDFAnnot_GetOptionLabel:[[\"number\",\"number\",\"number\",\"number\",\"number\"],\"number\"],FPDFAnnot_GetRect:[[\"number\",\"number\"],\"boolean\"],FPDFAnnot_GetStringValue:[[\"number\",\"string\",\"number\",\"number\"],\"number\"],FPDFAnnot_GetSubtype:[[\"number\"],\"number\"],FPDFAnnot_GetValueType:[[\"number\",\"string\"],\"number\"],FPDFAnnot_GetVertices:[[\"number\",\"number\",\"number\"],\"number\"],FPDFAnnot_HasAttachmentPoints:[[\"number\"],\"boolean\"],FPDFAnnot_HasKey:[[\"number\",\"string\"],\"boolean\"],FPDFAnnot_IsChecked:[[\"number\",\"number\"],\"boolean\"],FPDFAnnot_IsObjectSupportedSubtype:[[\"number\"],\"boolean\"],FPDFAnnot_IsOptionSelected:[[\"number\",\"number\",\"number\"],\"boolean\"],FPDFAnnot_IsSupportedSubtype:[[\"number\"],\"boolean\"],FPDFAnnot_RemoveInkList:[[\"number\"],\"boolean\"],FPDFAnnot_RemoveObject:[[\"number\",\"number\"],\"boolean\"],FPDFAnnot_SetAP:[[\"number\",\"number\",\"number\"],\"boolean\"],FPDFAnnot_SetAttachmentPoints:[[\"number\",\"number\",\"number\"],\"boolean\"],FPDFAnnot_SetBorder:[[\"number\",\"number\",\"number\",\"number\"],\"boolean\"],FPDFAnnot_SetColor:[[\"number\",\"number\",\"number\",\"number\",\"number\",\"number\"],\"boolean\"],FPDFAnnot_SetFlags:[[\"number\",\"number\"],\"boolean\"],FPDFAnnot_SetFocusableSubtypes:[[\"number\",\"number\",\"number\"],\"boolean\"],FPDFAnnot_SetFormFieldFlags:[[\"number\",\"number\",\"number\"],\"boolean\"],FPDFAnnot_SetRect:[[\"number\",\"number\"],\"boolean\"],FPDFAnnot_SetStringValue:[[\"number\",\"string\",\"number\"],\"boolean\"],FPDFAnnot_SetURI:[[\"number\",\"number\"],\"boolean\"],FPDFAnnot_UpdateObject:[[\"number\",\"number\"],\"boolean\"],FPDFAttachment_GetFile:[[\"number\",\"number\",\"number\",\"number\"],\"boolean\"],FPDFAttachment_GetName:[[\"number\",\"number\",\"number\"],\"number\"],FPDFAttachment_GetStringValue:[[\"number\",\"string\",\"number\",\"number\"],\"number\"],FPDFAttachment_GetSubtype:[[\"number\",\"number\",\"number\"],\"number\"],FPDFAttachment_GetValueType:[[\"number\",\"string\"],\"number\"],FPDFAttachment_HasKey:[[\"number\",\"string\"],\"boolean\"],FPDFAttachment_SetFile:[[\"number\",\"number\",\"number\",\"number\"],\"boolean\"],FPDFAttachment_SetStringValue:[[\"number\",\"string\",\"number\"],\"boolean\"],FPDFAvail_Create:[[\"number\",\"number\"],\"number\"],FPDFAvail_Destroy:[[\"number\"],null],FPDFAvail_GetDocument:[[\"number\",\"string\"],\"number\"],FPDFAvail_GetFirstPageNum:[[\"number\"],\"number\"],FPDFAvail_IsDocAvail:[[\"number\",\"number\"],\"number\"],FPDFAvail_IsFormAvail:[[\"number\",\"number\"],\"number\"],FPDFAvail_IsLinearized:[[\"number\"],\"number\"],FPDFAvail_IsPageAvail:[[\"number\",\"number\",\"number\"],\"number\"],FPDFBitmap_Create:[[\"number\",\"number\",\"number\"],\"number\"],FPDFBitmap_CreateEx:[[\"number\",\"number\",\"number\",\"number\",\"number\"],\"number\"],FPDFBitmap_Destroy:[[\"number\"],null],FPDFBitmap_FillRect:[[\"number\",\"number\",\"number\",\"number\",\"number\",\"number\"],\"boolean\"],FPDFBitmap_GetBuffer:[[\"number\"],\"number\"],FPDFBitmap_GetFormat:[[\"number\"],\"number\"],FPDFBitmap_GetHeight:[[\"number\"],\"number\"],FPDFBitmap_GetStride:[[\"number\"],\"number\"],FPDFBitmap_GetWidth:[[\"number\"],\"number\"],FPDFBookmark_Find:[[\"number\",\"number\"],\"number\"],FPDFBookmark_GetAction:[[\"number\"],\"number\"],FPDFBookmark_GetCount:[[\"number\"],\"number\"],FPDFBookmark_GetDest:[[\"number\",\"number\"],\"number\"],FPDFBookmark_GetFirstChild:[[\"number\",\"number\"],\"number\"],FPDFBookmark_GetNextSibling:[[\"number\",\"number\"],\"number\"],FPDFBookmark_GetTitle:[[\"number\",\"number\",\"number\"],\"number\"],FPDFCatalog_IsTagged:[[\"number\"],\"boolean\"],FPDFCatalog_SetLanguage:[[\"number\",\"string\"],\"boolean\"],FPDFClipPath_CountPaths:[[\"number\"],\"number\"],FPDFClipPath_CountPathSegments:[[\"number\",\"number\"],\"number\"],FPDFClipPath_GetPathSegment:[[\"number\",\"number\",\"number\"],\"number\"],FPDFDest_GetDestPageIndex:[[\"number\",\"number\"],\"number\"],FPDFDest_GetLocationInPage:[[\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\"],\"boolean\"],FPDFDest_GetView:[[\"number\",\"number\",\"number\"],\"number\"],FPDFDoc_AddAttachment:[[\"number\",\"number\"],\"number\"],FPDFDoc_CloseJavaScriptAction:[[\"number\"],null],FPDFDoc_DeleteAttachment:[[\"number\",\"number\"],\"boolean\"],FPDFDOC_ExitFormFillEnvironment:[[\"number\"],null],FPDFDoc_GetAttachment:[[\"number\",\"number\"],\"number\"],FPDFDoc_GetAttachmentCount:[[\"number\"],\"number\"],FPDFDoc_GetJavaScriptAction:[[\"number\",\"number\"],\"number\"],FPDFDoc_GetJavaScriptActionCount:[[\"number\"],\"number\"],FPDFDoc_GetPageMode:[[\"number\"],\"number\"],FPDFDOC_InitFormFillEnvironment:[[\"number\",\"number\"],\"number\"],FPDFFont_Close:[[\"number\"],null],FPDFFont_GetAscent:[[\"number\",\"number\",\"number\"],\"boolean\"],FPDFFont_GetBaseFontName:[[\"number\",\"number\",\"number\"],\"number\"],FPDFFont_GetDescent:[[\"number\",\"number\",\"number\"],\"boolean\"],FPDFFont_GetFamilyName:[[\"number\",\"number\",\"number\"],\"number\"],FPDFFont_GetFlags:[[\"number\"],\"number\"],FPDFFont_GetFontData:[[\"number\",\"number\",\"number\",\"number\"],\"boolean\"],FPDFFont_GetGlyphPath:[[\"number\",\"number\",\"number\"],\"number\"],FPDFFont_GetGlyphWidth:[[\"number\",\"number\",\"number\",\"number\"],\"boolean\"],FPDFFont_GetIsEmbedded:[[\"number\"],\"number\"],FPDFFont_GetItalicAngle:[[\"number\",\"number\"],\"boolean\"],FPDFFont_GetWeight:[[\"number\"],\"number\"],FPDFFormObj_CountObjects:[[\"number\"],\"number\"],FPDFFormObj_GetObject:[[\"number\",\"number\"],\"number\"],FPDFGlyphPath_CountGlyphSegments:[[\"number\"],\"number\"],FPDFGlyphPath_GetGlyphPathSegment:[[\"number\",\"number\"],\"number\"],FPDFImageObj_GetBitmap:[[\"number\"],\"number\"],FPDFImageObj_GetIccProfileDataDecoded:[[\"number\",\"number\",\"number\",\"number\",\"number\"],\"boolean\"],FPDFImageObj_GetImageDataDecoded:[[\"number\",\"number\",\"number\"],\"number\"],FPDFImageObj_GetImageDataRaw:[[\"number\",\"number\",\"number\"],\"number\"],FPDFImageObj_GetImageFilter:[[\"number\",\"number\",\"number\",\"number\"],\"number\"],FPDFImageObj_GetImageFilterCount:[[\"number\"],\"number\"],FPDFImageObj_GetImageMetadata:[[\"number\",\"number\",\"number\"],\"boolean\"],FPDFImageObj_GetImagePixelSize:[[\"number\",\"number\",\"number\"],\"boolean\"],FPDFImageObj_GetRenderedBitmap:[[\"number\",\"number\",\"number\"],\"number\"],FPDFImageObj_LoadJpegFile:[[\"number\",\"number\",\"number\",\"number\"],\"boolean\"],FPDFImageObj_LoadJpegFileInline:[[\"number\",\"number\",\"number\",\"number\"],\"boolean\"],FPDFImageObj_SetBitmap:[[\"number\",\"number\",\"number\",\"number\"],\"boolean\"],FPDFImageObj_SetMatrix:[[\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\"],\"boolean\"],FPDFJavaScriptAction_GetName:[[\"number\",\"number\",\"number\"],\"number\"],FPDFJavaScriptAction_GetScript:[[\"number\",\"number\",\"number\"],\"number\"],FPDFLink_CloseWebLinks:[[\"number\"],null],FPDFLink_CountQuadPoints:[[\"number\"],\"number\"],FPDFLink_CountRects:[[\"number\",\"number\"],\"number\"],FPDFLink_CountWebLinks:[[\"number\"],\"number\"],FPDFLink_Enumerate:[[\"number\",\"number\",\"number\"],\"boolean\"],FPDFLink_GetAction:[[\"number\"],\"number\"],FPDFLink_GetAnnot:[[\"number\",\"number\"],\"number\"],FPDFLink_GetAnnotRect:[[\"number\",\"number\"],\"boolean\"],FPDFLink_GetDest:[[\"number\",\"number\"],\"number\"],FPDFLink_GetLinkAtPoint:[[\"number\",\"number\",\"number\"],\"number\"],FPDFLink_GetLinkZOrderAtPoint:[[\"number\",\"number\",\"number\"],\"number\"],FPDFLink_GetQuadPoints:[[\"number\",\"number\",\"number\"],\"boolean\"],FPDFLink_GetRect:[[\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\"],\"boolean\"],FPDFLink_GetTextRange:[[\"number\",\"number\",\"number\",\"number\"],\"boolean\"],FPDFLink_GetURL:[[\"number\",\"number\",\"number\",\"number\"],\"number\"],FPDFLink_LoadWebLinks:[[\"number\"],\"number\"],FPDFPage_CloseAnnot:[[\"number\"],null],FPDFPage_CountObjects:[[\"number\"],\"number\"],FPDFPage_CreateAnnot:[[\"number\",\"number\"],\"number\"],FPDFPage_Delete:[[\"number\",\"number\"],null],FPDFPage_Flatten:[[\"number\",\"number\"],\"number\"],FPDFPage_FormFieldZOrderAtPoint:[[\"number\",\"number\",\"number\",\"number\"],\"number\"],FPDFPage_GenerateContent:[[\"number\"],\"boolean\"],FPDFPage_GetAnnot:[[\"number\",\"number\"],\"number\"],FPDFPage_GetAnnotCount:[[\"number\"],\"number\"],FPDFPage_GetAnnotIndex:[[\"number\",\"number\"],\"number\"],FPDFPage_GetArtBox:[[\"number\",\"number\",\"number\",\"number\",\"number\"],\"boolean\"],FPDFPage_GetBleedBox:[[\"number\",\"number\",\"number\",\"number\",\"number\"],\"boolean\"],FPDFPage_GetCropBox:[[\"number\",\"number\",\"number\",\"number\",\"number\"],\"boolean\"],FPDFPage_GetDecodedThumbnailData:[[\"number\",\"number\",\"number\"],\"number\"],FPDFPage_GetMediaBox:[[\"number\",\"number\",\"number\",\"number\",\"number\"],\"boolean\"],FPDFPage_GetObject:[[\"number\",\"number\"],\"number\"],FPDFPage_GetRawThumbnailData:[[\"number\",\"number\",\"number\"],\"number\"],FPDFPage_GetRotation:[[\"number\"],\"number\"],FPDFPage_GetThumbnailAsBitmap:[[\"number\"],\"number\"],FPDFPage_GetTrimBox:[[\"number\",\"number\",\"number\",\"number\",\"number\"],\"boolean\"],FPDFPage_HasFormFieldAtPoint:[[\"number\",\"number\",\"number\",\"number\"],\"number\"],FPDFPage_HasTransparency:[[\"number\"],\"boolean\"],FPDFPage_InsertClipPath:[[\"number\",\"number\"],null],FPDFPage_InsertObject:[[\"number\",\"number\"],null],FPDFPage_New:[[\"number\",\"number\",\"number\",\"number\"],\"number\"],FPDFPage_RemoveAnnot:[[\"number\",\"number\"],\"boolean\"],FPDFPage_RemoveObject:[[\"number\",\"number\"],\"boolean\"],FPDFPage_SetArtBox:[[\"number\",\"number\",\"number\",\"number\",\"number\"],null],FPDFPage_SetBleedBox:[[\"number\",\"number\",\"number\",\"number\",\"number\"],null],FPDFPage_SetCropBox:[[\"number\",\"number\",\"number\",\"number\",\"number\"],null],FPDFPage_SetMediaBox:[[\"number\",\"number\",\"number\",\"number\",\"number\"],null],FPDFPage_SetRotation:[[\"number\",\"number\"],null],FPDFPage_SetTrimBox:[[\"number\",\"number\",\"number\",\"number\",\"number\"],null],FPDFPage_TransformAnnots:[[\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\"],null],FPDFPage_TransFormWithClip:[[\"number\",\"number\",\"number\"],\"boolean\"],FPDFPageObj_AddMark:[[\"number\",\"string\"],\"number\"],FPDFPageObj_CountMarks:[[\"number\"],\"number\"],FPDFPageObj_CreateNewPath:[[\"number\",\"number\"],\"number\"],FPDFPageObj_CreateNewRect:[[\"number\",\"number\",\"number\",\"number\"],\"number\"],FPDFPageObj_CreateTextObj:[[\"number\",\"number\",\"number\"],\"number\"],FPDFPageObj_Destroy:[[\"number\"],null],FPDFPageObj_GetBounds:[[\"number\",\"number\",\"number\",\"number\",\"number\"],\"boolean\"],FPDFPageObj_GetClipPath:[[\"number\"],\"number\"],FPDFPageObj_GetDashArray:[[\"number\",\"number\",\"number\"],\"boolean\"],FPDFPageObj_GetDashCount:[[\"number\"],\"number\"],FPDFPageObj_GetDashPhase:[[\"number\",\"number\"],\"boolean\"],FPDFPageObj_GetFillColor:[[\"number\",\"number\",\"number\",\"number\",\"number\"],\"boolean\"],FPDFPageObj_GetIsActive:[[\"number\",\"number\"],\"boolean\"],FPDFPageObj_GetLineCap:[[\"number\"],\"number\"],FPDFPageObj_GetLineJoin:[[\"number\"],\"number\"],FPDFPageObj_GetMark:[[\"number\",\"number\"],\"number\"],FPDFPageObj_GetMarkedContentID:[[\"number\"],\"number\"],FPDFPageObj_GetMatrix:[[\"number\",\"number\"],\"boolean\"],FPDFPageObj_GetRotatedBounds:[[\"number\",\"number\"],\"boolean\"],FPDFPageObj_GetStrokeColor:[[\"number\",\"number\",\"number\",\"number\",\"number\"],\"boolean\"],FPDFPageObj_GetStrokeWidth:[[\"number\",\"number\"],\"boolean\"],FPDFPageObj_GetType:[[\"number\"],\"number\"],FPDFPageObj_HasTransparency:[[\"number\"],\"boolean\"],FPDFPageObj_NewImageObj:[[\"number\"],\"number\"],FPDFPageObj_NewTextObj:[[\"number\",\"string\",\"number\"],\"number\"],FPDFPageObj_RemoveMark:[[\"number\",\"number\"],\"boolean\"],FPDFPageObj_SetBlendMode:[[\"number\",\"string\"],null],FPDFPageObj_SetDashArray:[[\"number\",\"number\",\"number\",\"number\"],\"boolean\"],FPDFPageObj_SetDashPhase:[[\"number\",\"number\"],\"boolean\"],FPDFPageObj_SetFillColor:[[\"number\",\"number\",\"number\",\"number\",\"number\"],\"boolean\"],FPDFPageObj_SetIsActive:[[\"number\",\"boolean\"],\"boolean\"],FPDFPageObj_SetLineCap:[[\"number\",\"number\"],\"boolean\"],FPDFPageObj_SetLineJoin:[[\"number\",\"number\"],\"boolean\"],FPDFPageObj_SetMatrix:[[\"number\",\"number\"],\"boolean\"],FPDFPageObj_SetStrokeColor:[[\"number\",\"number\",\"number\",\"number\",\"number\"],\"boolean\"],FPDFPageObj_SetStrokeWidth:[[\"number\",\"number\"],\"boolean\"],FPDFPageObj_Transform:[[\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\"],null],FPDFPageObj_TransformClipPath:[[\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\"],null],FPDFPageObj_TransformF:[[\"number\",\"number\"],\"boolean\"],FPDFPageObjMark_CountParams:[[\"number\"],\"number\"],FPDFPageObjMark_GetName:[[\"number\",\"number\",\"number\",\"number\"],\"boolean\"],FPDFPageObjMark_GetParamBlobValue:[[\"number\",\"string\",\"number\",\"number\",\"number\"],\"boolean\"],FPDFPageObjMark_GetParamIntValue:[[\"number\",\"string\",\"number\"],\"boolean\"],FPDFPageObjMark_GetParamKey:[[\"number\",\"number\",\"number\",\"number\",\"number\"],\"boolean\"],FPDFPageObjMark_GetParamStringValue:[[\"number\",\"string\",\"number\",\"number\",\"number\"],\"boolean\"],FPDFPageObjMark_GetParamValueType:[[\"number\",\"string\"],\"number\"],FPDFPageObjMark_RemoveParam:[[\"number\",\"number\",\"string\"],\"boolean\"],FPDFPageObjMark_SetBlobParam:[[\"number\",\"number\",\"number\",\"string\",\"number\",\"number\"],\"boolean\"],FPDFPageObjMark_SetIntParam:[[\"number\",\"number\",\"number\",\"string\",\"number\"],\"boolean\"],FPDFPageObjMark_SetStringParam:[[\"number\",\"number\",\"number\",\"string\",\"string\"],\"boolean\"],FPDFPath_BezierTo:[[\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\"],\"boolean\"],FPDFPath_Close:[[\"number\"],\"boolean\"],FPDFPath_CountSegments:[[\"number\"],\"number\"],FPDFPath_GetDrawMode:[[\"number\",\"number\",\"number\"],\"boolean\"],FPDFPath_GetPathSegment:[[\"number\",\"number\"],\"number\"],FPDFPath_LineTo:[[\"number\",\"number\",\"number\"],\"boolean\"],FPDFPath_MoveTo:[[\"number\",\"number\",\"number\"],\"boolean\"],FPDFPath_SetDrawMode:[[\"number\",\"number\",\"boolean\"],\"boolean\"],FPDFPathSegment_GetClose:[[\"number\"],\"boolean\"],FPDFPathSegment_GetPoint:[[\"number\",\"number\",\"number\"],\"boolean\"],FPDFPathSegment_GetType:[[\"number\"],\"number\"],FPDFSignatureObj_GetByteRange:[[\"number\",\"number\",\"number\"],\"number\"],FPDFSignatureObj_GetContents:[[\"number\",\"number\",\"number\"],\"number\"],FPDFSignatureObj_GetDocMDPPermission:[[\"number\"],\"number\"],FPDFSignatureObj_GetReason:[[\"number\",\"number\",\"number\"],\"number\"],FPDFSignatureObj_GetSubFilter:[[\"number\",\"number\",\"number\"],\"number\"],FPDFSignatureObj_GetTime:[[\"number\",\"number\",\"number\"],\"number\"],FPDFText_ClosePage:[[\"number\"],null],FPDFText_CountChars:[[\"number\"],\"number\"],FPDFText_CountRects:[[\"number\",\"number\",\"number\"],\"number\"],FPDFText_FindClose:[[\"number\"],null],FPDFText_FindNext:[[\"number\"],\"boolean\"],FPDFText_FindPrev:[[\"number\"],\"boolean\"],FPDFText_FindStart:[[\"number\",\"number\",\"number\",\"number\"],\"number\"],FPDFText_GetBoundedText:[[\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\"],\"number\"],FPDFText_GetCharAngle:[[\"number\",\"number\"],\"number\"],FPDFText_GetCharBox:[[\"number\",\"number\",\"number\",\"number\",\"number\",\"number\"],\"boolean\"],FPDFText_GetCharIndexAtPos:[[\"number\",\"number\",\"number\",\"number\",\"number\"],\"number\"],FPDFText_GetCharIndexFromTextIndex:[[\"number\",\"number\"],\"number\"],FPDFText_GetCharOrigin:[[\"number\",\"number\",\"number\",\"number\"],\"boolean\"],FPDFText_GetFillColor:[[\"number\",\"number\",\"number\",\"number\",\"number\",\"number\"],\"boolean\"],FPDFText_GetFontInfo:[[\"number\",\"number\",\"number\",\"number\",\"number\"],\"number\"],FPDFText_GetFontSize:[[\"number\",\"number\"],\"number\"],FPDFText_GetFontWeight:[[\"number\",\"number\"],\"number\"],FPDFText_GetLooseCharBox:[[\"number\",\"number\",\"number\"],\"boolean\"],FPDFText_GetMatrix:[[\"number\",\"number\",\"number\"],\"boolean\"],FPDFText_GetRect:[[\"number\",\"number\",\"number\",\"number\",\"number\",\"number\"],\"boolean\"],FPDFText_GetSchCount:[[\"number\"],\"number\"],FPDFText_GetSchResultIndex:[[\"number\"],\"number\"],FPDFText_GetStrokeColor:[[\"number\",\"number\",\"number\",\"number\",\"number\",\"number\"],\"boolean\"],FPDFText_GetText:[[\"number\",\"number\",\"number\",\"number\"],\"number\"],FPDFText_GetTextIndexFromCharIndex:[[\"number\",\"number\"],\"number\"],FPDFText_GetTextObject:[[\"number\",\"number\"],\"number\"],FPDFText_GetUnicode:[[\"number\",\"number\"],\"number\"],FPDFText_HasUnicodeMapError:[[\"number\",\"number\"],\"number\"],FPDFText_IsGenerated:[[\"number\",\"number\"],\"number\"],FPDFText_IsHyphen:[[\"number\",\"number\"],\"number\"],FPDFText_LoadCidType2Font:[[\"number\",\"number\",\"number\",\"string\",\"number\",\"number\"],\"number\"],FPDFText_LoadFont:[[\"number\",\"number\",\"number\",\"number\",\"boolean\"],\"number\"],FPDFText_LoadPage:[[\"number\"],\"number\"],FPDFText_LoadStandardFont:[[\"number\",\"string\"],\"number\"],FPDFText_SetCharcodes:[[\"number\",\"number\",\"number\"],\"boolean\"],FPDFText_SetText:[[\"number\",\"number\"],\"boolean\"],FPDFTextObj_GetFont:[[\"number\"],\"number\"],FPDFTextObj_GetFontSize:[[\"number\",\"number\"],\"boolean\"],FPDFTextObj_GetRenderedBitmap:[[\"number\",\"number\",\"number\",\"number\"],\"number\"],FPDFTextObj_GetText:[[\"number\",\"number\",\"number\",\"number\"],\"number\"],FPDFTextObj_GetTextRenderMode:[[\"number\"],\"number\"],FPDFTextObj_SetTextRenderMode:[[\"number\",\"number\"],\"boolean\"],PDFiumExt_CloseFileWriter:[[\"number\"],null],PDFiumExt_CloseFormFillInfo:[[\"number\"],null],PDFiumExt_ExitFormFillEnvironment:[[\"number\"],null],PDFiumExt_GetFileWriterData:[[\"number\",\"number\",\"number\"],\"number\"],PDFiumExt_GetFileWriterSize:[[\"number\"],\"number\"],PDFiumExt_Init:[[],null],PDFiumExt_InitFormFillEnvironment:[[\"number\",\"number\"],\"number\"],PDFiumExt_OpenFileWriter:[[],\"number\"],PDFiumExt_OpenFormFillInfo:[[],\"number\"],PDFiumExt_SaveAsCopy:[[\"number\",\"number\"],\"number\"]};async function r(e){return async function(e){const t={pdfium:e};for(const r in n){const o=r,i=n[o][0],a=n[o][1];t[o]=e.cwrap(r,a,i)}return t}(await t(e))}var o=(e=>(e[e.Degree0=0]=\"Degree0\",e[e.Degree90=1]=\"Degree90\",e[e.Degree180=2]=\"Degree180\",e[e.Degree270=3]=\"Degree270\",e))(o||{});function i(e){return{width:Math.ceil(e.width),height:Math.ceil(e.height)}}function a(e){const{width:t,height:n}=e;return{width:n,height:t}}function s(e){const t=[e.p1.x,e.p2.x,e.p3.x,e.p4.x],n=[e.p1.y,e.p2.y,e.p3.y,e.p4.y];return{origin:{x:Math.min(...t),y:Math.min(...n)},size:{width:Math.max(...t)-Math.min(...t),height:Math.max(...n)-Math.min(...n)}}}function F(e,t,n,r){return function(e,t){return{origin:{x:e.origin.x*t,y:e.origin.y*t},size:{width:e.size.width*t,height:e.size.height*t}}}(function(e,t,n){let r=t.origin.x,o=t.origin.y,i=t.size;switch(n){case 0:break;case 1:r=e.height-t.origin.y-t.size.height,o=t.origin.x,i=a(t.size);break;case 2:r=e.width-t.origin.x-t.size.width,o=e.height-t.origin.y-t.size.height;break;case 3:r=t.origin.y,o=e.width-t.origin.x-t.size.width,i=a(t.size)}return{origin:{x:r,y:o},size:{width:i.width,height:i.height}}}(e,t,n),r)}var u=class{debug(){}info(){}warn(){}error(){}perf(){}},m=class extends Error{constructor(e){super(`Task aborted: ${JSON.stringify(e)}`),this.name=\"TaskAbortedError\"}},l=class extends Error{constructor(e){super(`Task rejected: ${JSON.stringify(e)}`),this.name=\"TaskRejectedError\"}},d=class{constructor(){this.state={stage:0},this.resolvedCallbacks=[],this.rejectedCallbacks=[],this._promise=null}toPromise(){return this._promise||(this._promise=new Promise(((e,t)=>{this.wait((t=>e(t)),(e=>{\"abort\"===e.type?t(new m(e.reason)):t(new l(e.reason))}))}))),this._promise}wait(e,t){switch(this.state.stage){case 0:this.resolvedCallbacks.push(e),this.rejectedCallbacks.push(t);break;case 1:e(this.state.result);break;case 2:t({type:\"reject\",reason:this.state.reason});break;case 3:t({type:\"abort\",reason:this.state.reason})}}resolve(e){if(0===this.state.stage){this.state={stage:1,result:e};for(const t of this.resolvedCallbacks)try{t(e)}catch(e){}this.resolvedCallbacks=[],this.rejectedCallbacks=[]}}reject(e){if(0===this.state.stage){this.state={stage:2,reason:e};for(const t of this.rejectedCallbacks)try{t({type:\"reject\",reason:e})}catch(e){}this.resolvedCallbacks=[],this.rejectedCallbacks=[]}}abort(e){if(0===this.state.stage){this.state={stage:3,reason:e};for(const t of this.rejectedCallbacks)try{t({type:\"abort\",reason:e})}catch(e){}this.resolvedCallbacks=[],this.rejectedCallbacks=[]}}fail(e){\"abort\"===e.type?this.abort(e.reason):this.reject(e.reason)}},_=Object.freeze([\"­\",\"​\",\"⁠\",\"\\ufeff\",\"￾\",\"￿\"]),P=new RegExp(`[${_.join(\"\")}]`,\"g\");var c=(e=>(e[e.Unknown=0]=\"Unknown\",e[e.XYZ=1]=\"XYZ\",e[e.FitPage=2]=\"FitPage\",e[e.FitHorizontal=3]=\"FitHorizontal\",e[e.FitVertical=4]=\"FitVertical\",e[e.FitRectangle=5]=\"FitRectangle\",e))(c||{}),h=(e=>(e[e.Unsupported=0]=\"Unsupported\",e[e.Goto=1]=\"Goto\",e[e.RemoteGoto=2]=\"RemoteGoto\",e[e.URI=3]=\"URI\",e[e.LaunchAppOrOpenFile=4]=\"LaunchAppOrOpenFile\",e))(h||{}),g=(e=>(e[e.UNKNOWN=0]=\"UNKNOWN\",e[e.TEXT=1]=\"TEXT\",e[e.LINK=2]=\"LINK\",e[e.FREETEXT=3]=\"FREETEXT\",e[e.LINE=4]=\"LINE\",e[e.SQUARE=5]=\"SQUARE\",e[e.CIRCLE=6]=\"CIRCLE\",e[e.POLYGON=7]=\"POLYGON\",e[e.POLYLINE=8]=\"POLYLINE\",e[e.HIGHLIGHT=9]=\"HIGHLIGHT\",e[e.UNDERLINE=10]=\"UNDERLINE\",e[e.SQUIGGLY=11]=\"SQUIGGLY\",e[e.STRIKEOUT=12]=\"STRIKEOUT\",e[e.STAMP=13]=\"STAMP\",e[e.CARET=14]=\"CARET\",e[e.INK=15]=\"INK\",e[e.POPUP=16]=\"POPUP\",e[e.FILEATTACHMENT=17]=\"FILEATTACHMENT\",e[e.SOUND=18]=\"SOUND\",e[e.MOVIE=19]=\"MOVIE\",e[e.WIDGET=20]=\"WIDGET\",e[e.SCREEN=21]=\"SCREEN\",e[e.PRINTERMARK=22]=\"PRINTERMARK\",e[e.TRAPNET=23]=\"TRAPNET\",e[e.WATERMARK=24]=\"WATERMARK\",e[e.THREED=25]=\"THREED\",e[e.RICHMEDIA=26]=\"RICHMEDIA\",e[e.XFAWIDGET=27]=\"XFAWIDGET\",e[e.REDACT=28]=\"REDACT\",e))(g||{}),D=(e=>(e[e.Created=0]=\"Created\",e[e.Committed=1]=\"Committed\",e))(D||{}),b=(e=>(e[e.Normal=0]=\"Normal\",e[e.Rollover=1]=\"Rollover\",e[e.Down=2]=\"Down\",e))(b||{}),p=(e=>(e[e.UNKNOWN=0]=\"UNKNOWN\",e[e.PUSHBUTTON=1]=\"PUSHBUTTON\",e[e.CHECKBOX=2]=\"CHECKBOX\",e[e.RADIOBUTTON=3]=\"RADIOBUTTON\",e[e.COMBOBOX=4]=\"COMBOBOX\",e[e.LISTBOX=5]=\"LISTBOX\",e[e.TEXTFIELD=6]=\"TEXTFIELD\",e[e.SIGNATURE=7]=\"SIGNATURE\",e[e.XFA=8]=\"XFA\",e[e.XFA_CHECKBOX=9]=\"XFA_CHECKBOX\",e[e.XFA_COMBOBOX=10]=\"XFA_COMBOBOX\",e[e.XFA_IMAGEFIELD=11]=\"XFA_IMAGEFIELD\",e[e.XFA_LISTBOX=12]=\"XFA_LISTBOX\",e[e.XFA_PUSHBUTTON=13]=\"XFA_PUSHBUTTON\",e[e.XFA_SIGNATURE=14]=\"XFA_SIGNATURE\",e[e.XFA_TEXTFIELD=15]=\"XFA_TEXTFIELD\",e))(p||{}),f=(e=>(e[e.UNKNOWN=0]=\"UNKNOWN\",e[e.TEXT=1]=\"TEXT\",e[e.PATH=2]=\"PATH\",e[e.IMAGE=3]=\"IMAGE\",e[e.SHADING=4]=\"SHADING\",e[e.FORM=5]=\"FORM\",e))(f||{}),A=(e=>(e[e.None=0]=\"None\",e[e.MatchCase=1]=\"MatchCase\",e[e.MatchWholeWord=2]=\"MatchWholeWord\",e[e.MatchConsecutive=4]=\"MatchConsecutive\",e))(A||{}),G=(e=>(e[e.Ok=0]=\"Ok\",e[e.Unknown=1]=\"Unknown\",e[e.NotFound=2]=\"NotFound\",e[e.WrongFormat=3]=\"WrongFormat\",e[e.Password=4]=\"Password\",e[e.Security=5]=\"Security\",e[e.PageError=6]=\"PageError\",e[e.XFALoad=7]=\"XFALoad\",e[e.XFALayout=8]=\"XFALayout\",e[e.Cancelled=9]=\"Cancelled\",e[e.Initialization=10]=\"Initialization\",e[e.NotReady=11]=\"NotReady\",e[e.NotSupport=12]=\"NotSupport\",e[e.LoadDoc=13]=\"LoadDoc\",e[e.DocNotOpen=14]=\"DocNotOpen\",e[e.CantCloseDoc=15]=\"CantCloseDoc\",e[e.CantCreateNewDoc=16]=\"CantCreateNewDoc\",e[e.CantImportPages=17]=\"CantImportPages\",e[e.CantCreateAnnot=18]=\"CantCreateAnnot\",e[e.CantSetAnnotRect=19]=\"CantSetAnnotRect\",e[e.CantSetAnnotContent=20]=\"CantSetAnnotContent\",e[e.CantRemoveInkList=21]=\"CantRemoveInkList\",e[e.CantAddInkStoke=22]=\"CantAddInkStoke\",e[e.CantReadAttachmentSize=23]=\"CantReadAttachmentSize\",e[e.CantReadAttachmentContent=24]=\"CantReadAttachmentContent\",e[e.CantFocusAnnot=25]=\"CantFocusAnnot\",e[e.CantSelectText=26]=\"CantSelectText\",e[e.CantSelectOption=27]=\"CantSelectOption\",e[e.CantCheckField=28]=\"CantCheckField\",e))(G||{}),E=class{static create(){return new d}static resolve(e){const t=new d;return t.resolve(e),t}static reject(e){const t=new d;return t.reject(e),t}static abort(e){const t=new d;return t.reject(e),t}};const S=\"WebWorkerEngineRunner\",T=\"Engine\";class M{constructor(e=new u){this.logger=e,this.execute=e=>{if(this.logger.debug(S,T,\"runner start exeucte request\"),!this.engine){const t={type:\"reject\",reason:{code:G.NotReady,message:\"engine has not started yet\"}},n={id:e.id,type:\"ExecuteResponse\",data:{type:\"error\",value:t}};return void this.respond(n)}const t=this.engine,{name:n,args:r}=e.data;if(!t[n]){const t={type:\"reject\",reason:{code:G.NotSupport,message:\"engine method has not supported yet\"}},n={id:e.id,type:\"ExecuteResponse\",data:{type:\"error\",value:t}};return void this.respond(n)}let o;switch(n){case\"isSupport\":case\"initialize\":case\"destroy\":case\"openDocumentUrl\":case\"openDocumentFromBuffer\":case\"openDocumentFromLoader\":case\"getDocPermissions\":case\"getDocUserPermissions\":case\"getMetadata\":case\"getBookmarks\":case\"getSignatures\":case\"renderPage\":case\"renderPageRect\":case\"renderThumbnail\":case\"getAllAnnotations\":case\"getPageAnnotations\":case\"createPageAnnotation\":case\"transformPageAnnotation\":case\"removePageAnnotation\":case\"getPageTextRects\":case\"searchAllPages\":case\"closeDocument\":case\"saveAsCopy\":case\"getAttachments\":case\"readAttachmentContent\":case\"setFormFieldValue\":case\"flattenPage\":case\"extractPages\":case\"extractText\":case\"getTextSlices\":case\"getPageGlyphs\":case\"getPageGeometry\":case\"merge\":case\"mergePages\":o=this.engine[n](...r)}o.wait((t=>{const n={id:e.id,type:\"ExecuteResponse\",data:{type:\"result\",value:t}};this.respond(n)}),(t=>{const n={id:e.id,type:\"ExecuteResponse\",data:{type:\"error\",value:t}};this.respond(n)}))}}listen(){self.onmessage=e=>this.handle(e)}handle(e){this.logger.debug(S,T,\"webworker receive message event: \",e.data);try{const t=e.data;if(\"ExecuteRequest\"===t.type)this.execute(t)}catch(e){this.logger.info(S,T,\"webworker met error when processing message event:\",e)}}ready(){this.listen(),this.respond({id:\"0\",type:\"ReadyResponse\"}),this.logger.debug(S,T,\"runner is ready\")}respond(e){this.logger.debug(S,T,\"runner respond: \",e),self.postMessage(e)}}function C(e,t,n,r=100){let o=e.wasmExports.malloc(r);for(let t=0;t<r;t++)e.HEAP8[o+t]=0;const i=t(o,r);let a;if(i>r){e.wasmExports.free(o),o=e.wasmExports.malloc(i);for(let t=0;t<i;t++)e.HEAP8[o+t]=0;t(o,i),a=n(o)}else a=n(o);return e.wasmExports.free(o),a}function y(e,t){const n=t(0,0),r=e.wasmExports.malloc(n);t(r,n);const o=new ArrayBuffer(n),i=new DataView(o);for(let t=0;t<n;t++)i.setInt8(t,e.getValue(r+t,\"i8\"));return e.wasmExports.free(r),o}class O{constructor(e){this.pdfium=e,this.docs=new Map}setDocument(e,t,n){let r=this.docs.get(e);r||(r=new x(t,n,this.pdfium),this.docs.set(e,r))}getContext(e){return this.docs.get(e)}closeDocument(e){const t=this.docs.get(e);return!!t&&(t.dispose(),this.docs.delete(e),!0)}}class x{constructor(e,t,n){this.filePtr=e,this.docPtr=t,this.pageCache=new v(n,t)}acquirePage(e){return this.pageCache.acquire(e)}dispose(){this.pageCache.forceReleaseAll(),this.pageCache.pdf.FPDF_CloseDocument(this.docPtr),this.pageCache.pdf.pdfium.wasmExports.free(this.filePtr)}}class v{constructor(e,t){this.pdf=e,this.docPtr=t,this.cache=new Map}acquire(e){let t=this.cache.get(e);if(!t){const n=this.pdf.FPDF_LoadPage(this.docPtr,e);t=new w(this.pdf,this.docPtr,e,n,(()=>{this.cache.delete(e)})),this.cache.set(e,t)}return t.clearExpiryTimer(),t.bumpRefCount(),t}forceReleaseAll(){for(const e of this.cache.values())e.disposeImmediate();this.cache.clear()}}class w{constructor(e,t,n,r,o){this.pdf=e,this.docPtr=t,this.pageIdx=n,this.pagePtr=r,this.onFinalDispose=o,this.refCount=0,this.disposed=!1}bumpRefCount(){if(this.disposed)throw new Error(\"Context already disposed\");this.refCount++}clearExpiryTimer(){this.expiryTimer&&(clearTimeout(this.expiryTimer),this.expiryTimer=void 0)}release(){this.disposed||(this.refCount--,0===this.refCount&&(this.expiryTimer=setTimeout((()=>this.disposeImmediate()),5e3)))}disposeImmediate(){this.disposed||(this.disposed=!0,void 0!==this.textPagePtr&&this.pdf.FPDFText_ClosePage(this.textPagePtr),void 0!==this.formHandle&&(this.pdf.FORM_OnBeforeClosePage(this.pagePtr,this.formHandle),this.pdf.PDFiumExt_ExitFormFillEnvironment(this.formHandle)),void 0!==this.formInfoPtr&&this.pdf.PDFiumExt_CloseFormFillInfo(this.formInfoPtr),this.pdf.FPDF_ClosePage(this.pagePtr),this.onFinalDispose())}getTextPage(){return this.ensureAlive(),void 0===this.textPagePtr&&(this.textPagePtr=this.pdf.FPDFText_LoadPage(this.pagePtr)),this.textPagePtr}getFormHandle(){return this.ensureAlive(),void 0===this.formHandle&&(this.formInfoPtr=this.pdf.PDFiumExt_OpenFormFillInfo(),this.formHandle=this.pdf.PDFiumExt_InitFormFillEnvironment(this.docPtr,this.formInfoPtr),this.pdf.FORM_OnAfterLoadPage(this.pagePtr,this.formHandle)),this.formHandle}withAnnotation(e,t){this.ensureAlive();const n=this.pdf.FPDFPage_GetAnnot(this.pagePtr,e);try{return t(n)}finally{this.pdf.FPDFPage_CloseAnnot(n)}}ensureAlive(){if(this.disposed)throw new Error(\"PageContext already disposed\")}}var R,I;!function(e){e[e.Bitmap_Gray=1]=\"Bitmap_Gray\",e[e.Bitmap_BGR=2]=\"Bitmap_BGR\",e[e.Bitmap_BGRx=3]=\"Bitmap_BGRx\",e[e.Bitmap_BGRA=4]=\"Bitmap_BGRA\"}(R||(R={})),function(e){e[e.ANNOT=1]=\"ANNOT\",e[e.LCD_TEXT=2]=\"LCD_TEXT\",e[e.NO_NATIVETEXT=4]=\"NO_NATIVETEXT\",e[e.GRAYSCALE=8]=\"GRAYSCALE\",e[e.DEBUG_INFO=128]=\"DEBUG_INFO\",e[e.NO_CATCH=256]=\"NO_CATCH\",e[e.RENDER_LIMITEDIMAGECACHE=512]=\"RENDER_LIMITEDIMAGECACHE\",e[e.RENDER_FORCEHALFTONE=1024]=\"RENDER_FORCEHALFTONE\",e[e.PRINTING=2048]=\"PRINTING\",e[e.REVERSE_BYTE_ORDER=16]=\"REVERSE_BYTE_ORDER\"}(I||(I={}));const k=\"PDFiumEngine\",j=\"Engine\";var L;!function(e){e[e.Success=0]=\"Success\",e[e.Unknown=1]=\"Unknown\",e[e.File=2]=\"File\",e[e.Format=3]=\"Format\",e[e.Password=4]=\"Password\",e[e.Security=5]=\"Security\",e[e.Page=6]=\"Page\",e[e.XFALoad=7]=\"XFALoad\",e[e.XFALayout=8]=\"XFALayout\"}(L||(L={}));const B=(e,t=\"image/webp\")=>{if(\"undefined\"==typeof OffscreenCanvas)throw new Error(\"OffscreenCanvas is not available in this environment. This converter is intended for browser use only. Please use createNodeImageDataToBlobConverter() or createNodeCanvasImageDataToBlobConverter() for Node.js.\");const n=new ImageData(e.data,e.width,e.height),r=new OffscreenCanvas(n.width,n.height);return r.getContext(\"2d\").putImageData(n,0,0),r.convertToBlob({type:t})};class N{constructor(e,t=new u,n=B){this.pdfiumModule=e,this.logger=t,this.imageDataConverter=n,this.cache=new O(this.pdfiumModule)}initialize(){return this.logger.debug(k,j,\"initialize\"),this.logger.perf(k,j,\"Initialize\",\"Begin\",\"General\"),this.pdfiumModule.PDFiumExt_Init(),this.logger.perf(k,j,\"Initialize\",\"End\",\"General\"),E.resolve(!0)}destroy(){return this.logger.debug(k,j,\"destroy\"),this.logger.perf(k,j,\"Destroy\",\"Begin\",\"General\"),this.pdfiumModule.FPDF_DestroyLibrary(),this.logger.perf(k,j,\"Destroy\",\"End\",\"General\"),E.resolve(!0)}openDocumentUrl(e,t){const n=t?.mode??\"auto\",r=t?.password??\"\";this.logger.debug(k,j,\"openDocumentUrl called\",e.url,n);const o=E.create();return(async()=>{try{if(\"full-fetch\"===n){(await this.fetchFullAndOpen(e,r)).wait((e=>o.resolve(e)),(e=>o.reject(e.reason)))}else if(\"range-request\"===n){(await this.openDocumentWithRangeRequest(e,r)).wait((e=>o.resolve(e)),(e=>o.reject(e.reason)))}else{const{supportsRanges:t,fileLength:n,content:i}=await this.checkRangeSupport(e.url);if(t){(await this.openDocumentWithRangeRequest(e,r,n)).wait((e=>o.resolve(e)),(e=>o.reject(e.reason)))}else if(i){const t={id:e.id,content:i};this.openDocumentFromBuffer(t,r).wait((e=>o.resolve(e)),(e=>o.reject(e.reason)))}else{(await this.fetchFullAndOpen(e,r)).wait((e=>o.resolve(e)),(e=>o.reject(e.reason)))}}}catch(e){this.logger.error(k,j,\"openDocumentUrl error\",e),o.reject({code:G.Unknown,message:String(e)})}})(),o}async checkRangeSupport(e){try{this.logger.debug(k,j,\"checkRangeSupport\",e);const t=await fetch(e,{method:\"HEAD\"}),n=t.headers.get(\"Content-Length\");if(\"bytes\"===t.headers.get(\"Accept-Ranges\"))return{supportsRanges:!0,fileLength:parseInt(n??\"0\"),content:null};const r=await fetch(e,{headers:{Range:\"bytes=0-1\"}});if(200===r.status){const e=await r.arrayBuffer();return{supportsRanges:!1,fileLength:parseInt(n??\"0\"),content:e}}return{supportsRanges:206===r.status,fileLength:parseInt(n??\"0\"),content:null}}catch(e){throw this.logger.error(k,j,\"checkRangeSupport failed\",e),new Error(\"Failed to check range support: \"+e)}}async fetchFullAndOpen(e,t){this.logger.debug(k,j,\"fetchFullAndOpen\",e.url);const n=await fetch(e.url);if(!n.ok)throw new Error(`Could not fetch PDF: ${n.statusText}`);const r=await n.arrayBuffer(),o={id:e.id,content:r};return this.openDocumentFromBuffer(o,t)}async openDocumentWithRangeRequest(e,t,n){this.logger.debug(k,j,\"openDocumentWithRangeRequest\",e.url);const r=n??(await this.retrieveFileLength(e.url)).fileLength;return this.openDocumentFromLoader({id:e.id,fileLength:r,callback:(t,n)=>{const r=new XMLHttpRequest;if(r.open(\"GET\",e.url,!1),r.overrideMimeType(\"text/plain; charset=x-user-defined\"),r.setRequestHeader(\"Range\",`bytes=${t}-${t+n-1}`),r.send(null),206===r.status||200===r.status)return this.convertResponseToUint8Array(r.responseText);throw new Error(`Range request failed with status ${r.status}`)}},t)}async retrieveFileLength(e){this.logger.debug(k,j,\"retrieveFileLength\",e);const t=await fetch(e,{method:\"HEAD\"});if(!t.ok)throw new Error(`Failed HEAD request for file length: ${t.statusText}`);const n=t.headers.get(\"Content-Length\")||\"0\",r=parseInt(n,10)||0;if(!r)throw new Error(\"Content-Length not found or zero.\");return{fileLength:r}}convertResponseToUint8Array(e){const t=new Uint8Array(e.length);for(let n=0;n<e.length;n++)t[n]=255&e.charCodeAt(n);return t}openDocumentFromBuffer(e,t=\"\"){this.logger.debug(k,j,\"openDocumentFromBuffer\",e,t),this.logger.perf(k,j,\"OpenDocumentFromBuffer\",\"Begin\",e.id);const n=new Uint8Array(e.content),r=n.length,o=this.malloc(r);this.pdfiumModule.pdfium.HEAPU8.set(n,o);const i=this.pdfiumModule.FPDF_LoadMemDocument(o,r,t);if(!i){const t=this.pdfiumModule.FPDF_GetLastError();return this.logger.error(k,j,`FPDF_LoadMemDocument failed with ${t}`),this.free(o),this.logger.perf(k,j,\"OpenDocumentFromBuffer\",\"End\",e.id),E.reject({code:t,message:\"FPDF_LoadMemDocument failed\"})}const a=this.pdfiumModule.FPDF_GetPageCount(i),s=[],F=this.malloc(8);for(let t=0;t<a;t++){if(!this.pdfiumModule.FPDF_GetPageSizeByIndexF(i,t,F)){const t=this.pdfiumModule.FPDF_GetLastError();return this.logger.error(k,j,`FPDF_GetPageSizeByIndexF failed with ${t}`),this.free(F),this.pdfiumModule.FPDF_CloseDocument(i),this.free(o),this.logger.perf(k,j,\"OpenDocumentFromBuffer\",\"End\",e.id),E.reject({code:t,message:\"FPDF_GetPageSizeByIndexF failed\"})}const n={index:t,size:{width:this.pdfiumModule.pdfium.getValue(F,\"float\"),height:this.pdfiumModule.pdfium.getValue(F+4,\"float\")}};s.push(n)}this.free(F);const u={id:e.id,pageCount:a,pages:s};return this.cache.setDocument(e.id,o,i),this.logger.perf(k,j,\"OpenDocumentFromBuffer\",\"End\",e.id),E.resolve(u)}openDocumentFromLoader(e,t=\"\"){const{fileLength:n,callback:r,...o}=e;this.logger.debug(k,j,\"openDocumentFromLoader\",o,t),this.logger.perf(k,j,\"OpenDocumentFromLoader\",\"Begin\",o.id);const i=this.pdfiumModule.pdfium.addFunction(((e,t,o,i)=>{try{if(this.logger.debug(k,j,\"readBlock\",t,i,o),t<0||t>=n)return this.logger.error(k,j,\"Offset out of bounds:\",t),0;const e=r(t,i);return new Uint8Array(this.pdfiumModule.pdfium.HEAPU8.buffer,o,e.length).set(e),e.length}catch(e){return this.logger.error(k,j,\"ReadBlock error:\",e),0}}),\"iiiii\"),a=this.malloc(12);this.pdfiumModule.pdfium.setValue(a,n,\"i32\"),this.pdfiumModule.pdfium.setValue(a+4,i,\"i32\"),this.pdfiumModule.pdfium.setValue(a+8,0,\"i32\");const s=this.pdfiumModule.FPDF_LoadCustomDocument(a,t);if(!s){const e=this.pdfiumModule.FPDF_GetLastError();return this.logger.error(k,j,`FPDF_LoadCustomDocument failed with ${e}`),this.free(a),this.logger.perf(k,j,\"OpenDocumentFromLoader\",\"End\",o.id),E.reject({code:e,message:\"FPDF_LoadCustomDocument failed\"})}const F=this.pdfiumModule.FPDF_GetPageCount(s),u=[],m=this.malloc(8);for(let e=0;e<F;e++){if(!this.pdfiumModule.FPDF_GetPageSizeByIndexF(s,e,m)){const e=this.pdfiumModule.FPDF_GetLastError();return this.logger.error(k,j,`FPDF_GetPageSizeByIndexF failed with ${e}`),this.free(m),this.pdfiumModule.FPDF_CloseDocument(s),this.free(a),this.logger.perf(k,j,\"OpenDocumentFromLoader\",\"End\",o.id),E.reject({code:e,message:\"FPDF_GetPageSizeByIndexF failed\"})}const t={index:e,size:{width:this.pdfiumModule.pdfium.getValue(m,\"float\"),height:this.pdfiumModule.pdfium.getValue(m+4,\"float\")}};u.push(t)}this.free(m);const l={id:o.id,pageCount:F,pages:u};return this.cache.setDocument(o.id,a,s),this.logger.perf(k,j,\"OpenDocumentFromLoader\",\"End\",o.id),E.resolve(l)}getMetadata(e){this.logger.debug(k,j,\"getMetadata\",e),this.logger.perf(k,j,\"GetMetadata\",\"Begin\",e.id);const t=this.cache.getContext(e.id);if(!t)return this.logger.perf(k,j,\"GetMetadata\",\"End\",e.id),E.reject({code:G.DocNotOpen,message:\"document does not open\"});const n={title:this.readMetaText(t.docPtr,\"Title\"),author:this.readMetaText(t.docPtr,\"Author\"),subject:this.readMetaText(t.docPtr,\"Subject\"),keywords:this.readMetaText(t.docPtr,\"Keywords\"),producer:this.readMetaText(t.docPtr,\"Producer\"),creator:this.readMetaText(t.docPtr,\"Creator\"),creationDate:this.readMetaText(t.docPtr,\"CreationDate\"),modificationDate:this.readMetaText(t.docPtr,\"ModDate\")};return this.logger.perf(k,j,\"GetMetadata\",\"End\",e.id),E.resolve(n)}getDocPermissions(e){this.logger.debug(k,j,\"getDocPermissions\",e),this.logger.perf(k,j,\"getDocPermissions\",\"Begin\",e.id);const t=this.cache.getContext(e.id);if(!t)return this.logger.perf(k,j,\"getDocPermissions\",\"End\",e.id),E.reject({code:G.DocNotOpen,message:\"document does not open\"});const n=this.pdfiumModule.FPDF_GetDocPermissions(t.docPtr);return E.resolve(n)}getDocUserPermissions(e){this.logger.debug(k,j,\"getDocUserPermissions\",e),this.logger.perf(k,j,\"getDocUserPermissions\",\"Begin\",e.id);const t=this.cache.getContext(e.id);if(!t)return this.logger.perf(k,j,\"getDocUserPermissions\",\"End\",e.id),E.reject({code:G.DocNotOpen,message:\"document does not open\"});const n=this.pdfiumModule.FPDF_GetDocUserPermissions(t.docPtr);return E.resolve(n)}getSignatures(e){this.logger.debug(k,j,\"getSignatures\",e),this.logger.perf(k,j,\"GetSignatures\",\"Begin\",e.id);const t=this.cache.getContext(e.id);if(!t)return this.logger.perf(k,j,\"GetSignatures\",\"End\",e.id),E.reject({code:G.DocNotOpen,message:\"document does not open\"});const n=[],r=this.pdfiumModule.FPDF_GetSignatureCount(t.docPtr);for(let e=0;e<r;e++){const r=this.pdfiumModule.FPDF_GetSignatureObject(t.docPtr,e),o=y(this.pdfiumModule.pdfium,((e,t)=>this.pdfiumModule.FPDFSignatureObj_GetContents(r,e,t))),i=y(this.pdfiumModule.pdfium,((e,t)=>4*this.pdfiumModule.FPDFSignatureObj_GetByteRange(r,e,t))),a=y(this.pdfiumModule.pdfium,((e,t)=>this.pdfiumModule.FPDFSignatureObj_GetSubFilter(r,e,t))),s=C(this.pdfiumModule.pdfium,((e,t)=>this.pdfiumModule.FPDFSignatureObj_GetReason(r,e,t)),this.pdfiumModule.pdfium.UTF16ToString),F=C(this.pdfiumModule.pdfium,((e,t)=>this.pdfiumModule.FPDFSignatureObj_GetTime(r,e,t)),this.pdfiumModule.pdfium.UTF8ToString),u=this.pdfiumModule.FPDFSignatureObj_GetDocMDPPermission(r);n.push({contents:o,byteRange:i,subFilter:a,reason:s,time:F,docMDP:u})}return this.logger.perf(k,j,\"GetSignatures\",\"End\",e.id),E.resolve(n)}getBookmarks(e){this.logger.debug(k,j,\"getBookmarks\",e),this.logger.perf(k,j,\"GetBookmarks\",\"Begin\",e.id);const t=this.cache.getContext(e.id);if(!t)return this.logger.perf(k,j,\"getBookmarks\",\"End\",e.id),E.reject({code:G.DocNotOpen,message:\"document does not open\"});const n=this.readPdfBookmarks(t.docPtr,0);return this.logger.perf(k,j,\"GetBookmarks\",\"End\",e.id),E.resolve({bookmarks:n})}renderPage(e,t,n=1,r=o.Degree0,i=1,a={withAnnotations:!1},s=\"image/webp\"){const F=new d;this.logger.debug(k,j,\"renderPage\",e,t,n,r,i,a),this.logger.perf(k,j,\"RenderPage\",\"Begin\",`${e.id}-${t.index}`);const u=this.cache.getContext(e.id);if(!u)return this.logger.perf(k,j,\"RenderPage\",\"End\",`${e.id}-${t.index}`),E.reject({code:G.DocNotOpen,message:\"document does not open\"});const m=this.renderPageRectToImageData(u,t,{origin:{x:0,y:0},size:t.size},n,r,i,a);return this.logger.perf(k,j,\"RenderPage\",\"End\",`${e.id}-${t.index}`),this.imageDataConverter(m,s).then((e=>F.resolve(e))),F}renderPageRect(e,t,n,r,o,i,a,s=\"image/webp\"){const F=new d;this.logger.debug(k,j,\"renderPageRect\",e,t,n,r,o,i,a),this.logger.perf(k,j,\"RenderPageRect\",\"Begin\",`${e.id}-${t.index}`);const u=this.cache.getContext(e.id);if(!u)return this.logger.perf(k,j,\"RenderPageRect\",\"End\",`${e.id}-${t.index}`),E.reject({code:G.DocNotOpen,message:\"document does not open\"});const m=this.renderPageRectToImageData(u,t,i,n,r,o,a);return this.logger.perf(k,j,\"RenderPageRect\",\"End\",`${e.id}-${t.index}`),this.imageDataConverter(m,s).then((e=>F.resolve(e))),F}getAllAnnotations(e){this.logger.debug(k,j,\"getAllAnnotations\",e),this.logger.perf(k,j,\"GetAllAnnotations\",\"Begin\",e.id);const t=this.cache.getContext(e.id);if(!t)return this.logger.perf(k,j,\"GetAllAnnotations\",\"End\",e.id),E.reject({code:G.DocNotOpen,message:\"document does not open\"});const n=this.readAllAnnotations(e,t);return this.logger.perf(k,j,\"GetAllAnnotations\",\"End\",e.id),E.resolve(n)}readAllAnnotations(e,t){const n={};for(let r=0;r<e.pageCount;r++){const o=this.readPageAnnotations(t,e.pages[r]);n[r]=o}return n}getPageAnnotations(e,t){this.logger.debug(k,j,\"getPageAnnotations\",e,t),this.logger.perf(k,j,\"GetPageAnnotations\",\"Begin\",`${e.id}-${t.index}`);const n=this.cache.getContext(e.id);if(!n)return this.logger.perf(k,j,\"GetPageAnnotations\",\"End\",`${e.id}-${t.index}`),E.reject({code:G.DocNotOpen,message:\"document does not open\"});const r=this.readPageAnnotations(n,t);return this.logger.perf(k,j,\"GetPageAnnotations\",\"End\",`${e.id}-${t.index}`),this.logger.debug(k,j,\"GetPageAnnotations\",`${e.id}-${t.index}`,r),E.resolve(r)}createPageAnnotation(e,t,n){this.logger.debug(k,j,\"createPageAnnotation\",e,t,n),this.logger.perf(k,j,\"CreatePageAnnotation\",\"Begin\",`${e.id}-${t.index}`);const r=this.cache.getContext(e.id);if(!r)return this.logger.perf(k,j,\"CreatePageAnnotation\",\"End\",`${e.id}-${t.index}`),E.reject({code:G.DocNotOpen,message:\"document does not open\"});const o=r.acquirePage(t.index),i=this.pdfiumModule.FPDFPage_CreateAnnot(o.pagePtr,n.type);if(!i)return this.logger.perf(k,j,\"CreatePageAnnotation\",\"End\",`${e.id}-${t.index}`),o.release(),E.reject({code:G.CantCreateAnnot,message:\"can not create annotation with specified type\"});if(!this.setPageAnnoRect(t,o.pagePtr,i,n.rect))return this.pdfiumModule.FPDFPage_CloseAnnot(i),o.release(),this.logger.perf(k,j,\"CreatePageAnnotation\",\"End\",`${e.id}-${t.index}`),E.reject({code:G.CantSetAnnotRect,message:\"can not set the rect of the annotation\"});let a=!1;switch(n.type){case g.INK:a=this.addInkStroke(t,o.pagePtr,i,n.inkList);break;case g.STAMP:a=this.addStampContent(r.docPtr,t,o.pagePtr,i,n.rect,n.contents)}return a?(this.pdfiumModule.FPDFPage_GenerateContent(o.pagePtr),this.pdfiumModule.FPDFPage_CloseAnnot(i),o.release(),this.logger.perf(k,j,\"CreatePageAnnotation\",\"End\",`${e.id}-${t.index}`),E.resolve(!0)):(this.pdfiumModule.FPDFPage_RemoveAnnot(o.pagePtr,i),o.release(),this.logger.perf(k,j,\"CreatePageAnnotation\",\"End\",`${e.id}-${t.index}`),E.reject({code:G.CantSetAnnotContent,message:\"can not add content of the annotation\"}))}transformPageAnnotation(e,t,n,r){this.logger.debug(k,j,\"transformPageAnnotation\",e,t,n,r),this.logger.perf(k,j,\"TransformPageAnnotation\",\"Begin\",`${e.id}-${t.index}`);const o=this.cache.getContext(e.id);if(!o)return this.logger.perf(k,j,\"TransformPageAnnotation\",\"End\",`${e.id}-${t.index}`),E.reject({code:G.DocNotOpen,message:\"document does not open\"});const i=o.acquirePage(t.index),a=this.pdfiumModule.FPDFPage_GetAnnot(i.pagePtr,n.id),s={origin:{x:n.rect.origin.x+r.offset.x,y:n.rect.origin.y+r.offset.y},size:{width:n.rect.size.width*r.scale.width,height:n.rect.size.height*r.scale.height}};if(!this.setPageAnnoRect(t,i.pagePtr,a,s))return this.pdfiumModule.FPDFPage_CloseAnnot(a),i.release(),this.logger.perf(k,j,\"TransformPageAnnotation\",\"End\",`${e.id}-${t.index}`),E.reject({code:G.CantSetAnnotRect,message:\"can not set the rect of the annotation\"});if(n.type===g.INK){if(!this.pdfiumModule.FPDFAnnot_RemoveInkList(a))return this.pdfiumModule.FPDFPage_CloseAnnot(a),i.release(),this.logger.perf(k,j,\"TransformPageAnnotation\",\"End\",`${e.id}-${t.index}`),E.reject({code:G.CantRemoveInkList,message:\"can not set the rect of the annotation\"});const o=n.inkList.map((e=>({points:e.points.map((e=>({x:s.origin.x+(e.x-n.rect.origin.x)*r.scale.width,y:s.origin.y+(e.y-n.rect.origin.y)*r.scale.height})))})));if(!this.addInkStroke(t,i.pagePtr,a,o))return this.pdfiumModule.FPDFPage_CloseAnnot(a),i.release(),this.logger.perf(k,j,\"TransformPageAnnotation\",\"End\",`${e.id}-${t.index}`),E.reject({code:G.CantAddInkStoke,message:\"can not add stroke to the ink list of annotation\"})}return this.pdfiumModule.FPDFPage_GenerateContent(i.pagePtr),this.pdfiumModule.FPDFPage_CloseAnnot(a),i.release(),this.logger.perf(k,j,\"TransformPageAnnotation\",\"End\",`${e.id}-${t.index}`),E.resolve(!0)}removePageAnnotation(e,t,n){this.logger.debug(k,j,\"removePageAnnotation\",e,t,n),this.logger.perf(k,j,\"RemovePageAnnotation\",\"Begin\",`${e.id}-${t.index}`);const r=this.cache.getContext(e.id);if(!r)return this.logger.perf(k,j,\"RemovePageAnnotation\",\"End\",`${e.id}-${t.index}`),E.reject({code:G.DocNotOpen,message:\"document does not open\"});const o=r.acquirePage(t.index);let i=!1;return i=this.pdfiumModule.FPDFPage_RemoveAnnot(o.pagePtr,n.id),i?(i=this.pdfiumModule.FPDFPage_GenerateContent(o.pagePtr),i||this.logger.error(k,j,\"FPDFPage_GenerateContent Failed\",`${e.id}-${t.index}`)):this.logger.error(k,j,\"FPDFPage_RemoveAnnot Failed\",`${e.id}-${t.index}`),o.release(),this.logger.perf(k,j,\"RemovePageAnnotation\",\"End\",`${e.id}-${t.index}`),E.resolve(i)}getPageTextRects(e,t,n,r){this.logger.debug(k,j,\"getPageTextRects\",e,t,n,r),this.logger.perf(k,j,\"GetPageTextRects\",\"Begin\",`${e.id}-${t.index}`);const o=this.cache.getContext(e.id);if(!o)return this.logger.perf(k,j,\"GetPageTextRects\",\"End\",`${e.id}-${t.index}`),E.reject({code:G.DocNotOpen,message:\"document does not open\"});const i=o.acquirePage(t.index),a=this.pdfiumModule.FPDFText_LoadPage(i.pagePtr),s=this.readPageTextRects(t,i.docPtr,i.pagePtr,a);return this.pdfiumModule.FPDFText_ClosePage(a),i.release(),this.logger.perf(k,j,\"GetPageTextRects\",\"End\",`${e.id}-${t.index}`),E.resolve(s)}renderThumbnail(e,t,n,r,o){this.logger.debug(k,j,\"renderThumbnail\",e,t,n,r,o),this.logger.perf(k,j,\"RenderThumbnail\",\"Begin\",`${e.id}-${t.index}`);if(!this.cache.getContext(e.id))return this.logger.perf(k,j,\"RenderThumbnail\",\"End\",`${e.id}-${t.index}`),E.reject({code:G.DocNotOpen,message:\"document does not open\"});n=Math.max(n,.5);const i=this.renderPage(e,t,n,r,o,{withAnnotations:!0});return this.logger.perf(k,j,\"RenderThumbnail\",\"End\",`${e.id}-${t.index}`),i}getAttachments(e){this.logger.debug(k,j,\"getAttachments\",e),this.logger.perf(k,j,\"GetAttachments\",\"Begin\",e.id);const t=this.cache.getContext(e.id);if(!t)return this.logger.perf(k,j,\"GetAttachments\",\"End\",e.id),E.reject({code:G.DocNotOpen,message:\"document does not open\"});const n=[],r=this.pdfiumModule.FPDFDoc_GetAttachmentCount(t.docPtr);for(let e=0;e<r;e++){const r=this.readPdfAttachment(t.docPtr,e);n.push(r)}return this.logger.perf(k,j,\"GetAttachments\",\"End\",e.id),E.resolve(n)}readAttachmentContent(e,t){this.logger.debug(k,j,\"readAttachmentContent\",e,t),this.logger.perf(k,j,\"ReadAttachmentContent\",\"Begin\",e.id);const n=this.cache.getContext(e.id);if(!n)return this.logger.perf(k,j,\"ReadAttachmentContent\",\"End\",e.id),E.reject({code:G.DocNotOpen,message:\"document does not open\"});const r=this.pdfiumModule.FPDFDoc_GetAttachment(n.docPtr,t.index),o=this.malloc(8);if(!this.pdfiumModule.FPDFAttachment_GetFile(r,0,0,o))return this.free(o),this.logger.perf(k,j,\"ReadAttachmentContent\",\"End\",e.id),E.reject({code:G.CantReadAttachmentSize,message:\"can not read attachment size\"});const i=this.pdfiumModule.pdfium.getValue(o,\"i64\"),a=this.malloc(i);if(!this.pdfiumModule.FPDFAttachment_GetFile(r,a,i,o))return this.free(o),this.free(a),this.logger.perf(k,j,\"ReadAttachmentContent\",\"End\",e.id),E.reject({code:G.CantReadAttachmentContent,message:\"can not read attachment content\"});const s=new ArrayBuffer(i),F=new DataView(s);for(let e=0;e<i;e++)F.setInt8(e,this.pdfiumModule.pdfium.getValue(a+e,\"i8\"));return this.free(o),this.free(a),this.logger.perf(k,j,\"ReadAttachmentContent\",\"End\",e.id),E.resolve(s)}setFormFieldValue(e,t,n,r){this.logger.debug(k,j,\"SetFormFieldValue\",e,n,r),this.logger.perf(k,j,\"SetFormFieldValue\",\"Begin\",`${e.id}-${n.id}`);const o=this.cache.getContext(e.id);if(!o)return this.logger.debug(k,j,\"SetFormFieldValue\",\"document is not opened\"),this.logger.perf(k,j,\"SetFormFieldValue\",\"End\",`${e.id}-${n.id}`),E.reject({code:G.DocNotOpen,message:\"document does not open\"});const i=this.pdfiumModule.PDFiumExt_OpenFormFillInfo(),a=this.pdfiumModule.PDFiumExt_InitFormFillEnvironment(o.docPtr,i),s=o.acquirePage(t.index);this.pdfiumModule.FORM_OnAfterLoadPage(s.pagePtr,a);const F=this.pdfiumModule.FPDFPage_GetAnnot(s.pagePtr,n.id);if(!this.pdfiumModule.FORM_SetFocusedAnnot(a,F))return this.logger.debug(k,j,\"SetFormFieldValue\",\"failed to set focused annotation\"),this.logger.perf(k,j,\"SetFormFieldValue\",\"End\",`${e.id}-${n.id}`),this.pdfiumModule.FPDFPage_CloseAnnot(F),this.pdfiumModule.FORM_OnBeforeClosePage(s.pagePtr,a),s.release(),this.pdfiumModule.PDFiumExt_ExitFormFillEnvironment(a),this.pdfiumModule.PDFiumExt_CloseFormFillInfo(i),E.reject({code:G.CantFocusAnnot,message:\"failed to set focused annotation\"});switch(r.kind){case\"text\":{if(!this.pdfiumModule.FORM_SelectAllText(a,s.pagePtr))return this.logger.debug(k,j,\"SetFormFieldValue\",\"failed to select all text\"),this.logger.perf(k,j,\"SetFormFieldValue\",\"End\",`${e.id}-${n.id}`),this.pdfiumModule.FORM_ForceToKillFocus(a),this.pdfiumModule.FPDFPage_CloseAnnot(F),this.pdfiumModule.FORM_OnBeforeClosePage(s.pagePtr,a),s.release(),this.pdfiumModule.PDFiumExt_ExitFormFillEnvironment(a),this.pdfiumModule.PDFiumExt_CloseFormFillInfo(i),E.reject({code:G.CantSelectText,message:\"failed to select all text\"});const t=2*(r.text.length+1),o=this.malloc(t);this.pdfiumModule.pdfium.stringToUTF16(r.text,o,t),this.pdfiumModule.FORM_ReplaceSelection(a,s.pagePtr,o),this.free(o)}break;case\"selection\":if(!this.pdfiumModule.FORM_SetIndexSelected(a,s.pagePtr,r.index,r.isSelected))return this.logger.debug(k,j,\"SetFormFieldValue\",\"failed to set index selected\"),this.logger.perf(k,j,\"SetFormFieldValue\",\"End\",`${e.id}-${n.id}`),this.pdfiumModule.FORM_ForceToKillFocus(a),this.pdfiumModule.FPDFPage_CloseAnnot(F),this.pdfiumModule.FORM_OnBeforeClosePage(s.pagePtr,a),s.release(),this.pdfiumModule.PDFiumExt_ExitFormFillEnvironment(a),this.pdfiumModule.PDFiumExt_CloseFormFillInfo(i),E.reject({code:G.CantSelectOption,message:\"failed to set index selected\"});break;case\"checked\":{const t=13;if(!this.pdfiumModule.FORM_OnChar(a,s.pagePtr,t,0))return this.logger.debug(k,j,\"SetFormFieldValue\",\"failed to set field checked\"),this.logger.perf(k,j,\"SetFormFieldValue\",\"End\",`${e.id}-${n.id}`),this.pdfiumModule.FORM_ForceToKillFocus(a),this.pdfiumModule.FPDFPage_CloseAnnot(F),this.pdfiumModule.FORM_OnBeforeClosePage(s.pagePtr,a),s.release(),this.pdfiumModule.PDFiumExt_ExitFormFillEnvironment(a),this.pdfiumModule.PDFiumExt_CloseFormFillInfo(i),E.reject({code:G.CantCheckField,message:\"failed to set field checked\"})}}return this.pdfiumModule.FORM_ForceToKillFocus(a),this.pdfiumModule.FPDFPage_CloseAnnot(F),this.pdfiumModule.FORM_OnBeforeClosePage(s.pagePtr,a),s.release(),this.pdfiumModule.PDFiumExt_ExitFormFillEnvironment(a),this.pdfiumModule.PDFiumExt_CloseFormFillInfo(i),E.resolve(!0)}flattenPage(e,t,n){this.logger.debug(k,j,\"flattenPage\",e,t,n),this.logger.perf(k,j,\"flattenPage\",\"Begin\",e.id);const r=this.cache.getContext(e.id);if(!r)return this.logger.perf(k,j,\"flattenPage\",\"End\",e.id),E.reject({code:G.DocNotOpen,message:\"document does not open\"});const o=r.acquirePage(t.index),i=this.pdfiumModule.FPDFPage_Flatten(o.pagePtr,n);return o.release(),this.logger.perf(k,j,\"flattenPage\",\"End\",e.id),E.resolve(i)}extractPages(e,t){this.logger.debug(k,j,\"extractPages\",e,t),this.logger.perf(k,j,\"ExtractPages\",\"Begin\",e.id);const n=this.cache.getContext(e.id);if(!n)return this.logger.perf(k,j,\"ExtractPages\",\"End\",e.id),E.reject({code:G.DocNotOpen,message:\"document does not open\"});const r=this.pdfiumModule.FPDF_CreateNewDocument();if(!r)return this.logger.perf(k,j,\"ExtractPages\",\"End\",e.id),E.reject({code:G.CantCreateNewDoc,message:\"can not create new document\"});const o=this.malloc(4*t.length);for(let e=0;e<t.length;e++)this.pdfiumModule.pdfium.setValue(o+4*e,t[e],\"i32\");if(!this.pdfiumModule.FPDF_ImportPagesByIndex(r,n.docPtr,o,t.length,0))return this.pdfiumModule.FPDF_CloseDocument(r),this.logger.perf(k,j,\"ExtractPages\",\"End\",e.id),E.reject({code:G.CantImportPages,message:\"can not import pages to new document\"});const i=this.saveDocument(r);return this.pdfiumModule.FPDF_CloseDocument(r),this.logger.perf(k,j,\"ExtractPages\",\"End\",e.id),E.resolve(i)}extractText(e,t){this.logger.debug(k,j,\"extractText\",e,t),this.logger.perf(k,j,\"ExtractText\",\"Begin\",e.id);const n=this.cache.getContext(e.id);if(!n)return this.logger.perf(k,j,\"ExtractText\",\"End\",e.id),E.reject({code:G.DocNotOpen,message:\"document does not open\"});const r=[];for(let e=0;e<t.length;e++){const o=n.acquirePage(t[e]),i=this.pdfiumModule.FPDFText_LoadPage(o.pagePtr),a=this.pdfiumModule.FPDFText_CountChars(i),s=this.malloc(2*(a+1));this.pdfiumModule.FPDFText_GetText(i,0,a,s);const F=this.pdfiumModule.pdfium.UTF16ToString(s);this.free(s),r.push(F),this.pdfiumModule.FPDFText_ClosePage(i),o.release()}const o=r.join(\"\\n\\n\");return this.logger.perf(k,j,\"ExtractText\",\"End\",e.id),E.resolve(o)}getTextSlices(e,t){if(this.logger.debug(k,j,\"getTextSlices\",e,t),this.logger.perf(k,j,\"GetTextSlices\",\"Begin\",e.id),0===t.length)return this.logger.perf(k,j,\"GetTextSlices\",\"End\",e.id),E.resolve([]);const n=this.cache.getContext(e.id);if(!n)return this.logger.perf(k,j,\"GetTextSlices\",\"End\",e.id),E.reject({code:G.DocNotOpen,message:\"document does not open\"});try{const r=new Array(t.length),o=new Map;t.forEach(((e,t)=>{(o.get(e.pageIndex)??o.set(e.pageIndex,[]).get(e.pageIndex)).push({slice:e,pos:t})}));for(const[e,t]of o){const o=n.acquirePage(e),i=o.getTextPage();for(const{slice:e,pos:n}of t){const t=this.malloc(2*(e.charCount+1));this.pdfiumModule.FPDFText_GetText(i,e.charIndex,e.charCount,t),r[n]=this.pdfiumModule.pdfium.UTF16ToString(t).replace(P,\"\"),this.free(t)}o.release()}return this.logger.perf(k,j,\"GetTextSlices\",\"End\",e.id),E.resolve(r)}catch(t){return this.logger.error(k,j,\"getTextSlices error\",t),this.logger.perf(k,j,\"GetTextSlices\",\"End\",e.id),E.reject({code:G.Unknown,message:String(t)})}}merge(e){this.logger.debug(k,j,\"merge\",e);const t=e.map((e=>e.id)).join(\".\");this.logger.perf(k,j,\"Merge\",\"Begin\",t);const n=this.pdfiumModule.FPDF_CreateNewDocument();if(!n)return this.logger.perf(k,j,\"Merge\",\"End\",t),E.reject({code:G.CantCreateNewDoc,message:\"can not create new document\"});const r=[];for(const o of e.reverse()){const e=new Uint8Array(o.content),i=e.length,a=this.malloc(i);this.pdfiumModule.pdfium.HEAPU8.set(e,a);const s=this.pdfiumModule.FPDF_LoadMemDocument(a,i,\"\");if(!s){const e=this.pdfiumModule.FPDF_GetLastError();this.logger.error(k,j,`FPDF_LoadMemDocument failed with ${e}`),this.free(a);for(const e of r)this.pdfiumModule.FPDF_CloseDocument(e.docPtr),this.free(e.filePtr);return this.logger.perf(k,j,\"Merge\",\"End\",t),E.reject({code:e,message:\"FPDF_LoadMemDocument failed\"})}if(r.push({filePtr:a,docPtr:s}),!this.pdfiumModule.FPDF_ImportPages(n,s,\"\",0)){this.pdfiumModule.FPDF_CloseDocument(n);for(const e of r)this.pdfiumModule.FPDF_CloseDocument(e.docPtr),this.free(e.filePtr);return this.logger.perf(k,j,\"Merge\",\"End\",t),E.reject({code:G.CantImportPages,message:\"can not import pages to new document\"})}}const o=this.saveDocument(n);this.pdfiumModule.FPDF_CloseDocument(n);for(const e of r)this.pdfiumModule.FPDF_CloseDocument(e.docPtr),this.free(e.filePtr);const i={id:`${Math.random()}`,content:o};return this.logger.perf(k,j,\"Merge\",\"End\",t),E.resolve(i)}mergePages(e){const t=e.map((e=>`${e.docId}:${e.pageIndices.join(\",\")}`)).join(\"|\");this.logger.debug(k,j,\"mergePages\",e),this.logger.perf(k,j,\"MergePages\",\"Begin\",t);const n=this.pdfiumModule.FPDF_CreateNewDocument();if(!n)return this.logger.perf(k,j,\"MergePages\",\"End\",t),E.reject({code:G.CantCreateNewDoc,message:\"Cannot create new document\"});try{for(const t of[...e].reverse()){const e=this.cache.getContext(t.docId);if(!e){this.logger.warn(k,j,`Document ${t.docId} is not open, skipping`);continue}const r=this.pdfiumModule.FPDF_GetPageCount(e.docPtr),o=t.pageIndices.filter((e=>e>=0&&e<r));if(0===o.length)continue;const i=o.map((e=>e+1)).join(\",\");try{if(!this.pdfiumModule.FPDF_ImportPages(n,e.docPtr,i,0))throw new Error(`Failed to import pages ${i} from document ${t.docId}`)}finally{}}const r=this.saveDocument(n),o={id:`${Math.random()}`,content:r};return this.logger.perf(k,j,\"MergePages\",\"End\",t),E.resolve(o)}catch(e){return this.logger.error(k,j,\"mergePages failed\",e),this.logger.perf(k,j,\"MergePages\",\"End\",t),E.reject({code:G.CantImportPages,message:e instanceof Error?e.message:\"Failed to merge pages\"})}finally{n&&this.pdfiumModule.FPDF_CloseDocument(n)}}saveAsCopy(e){this.logger.debug(k,j,\"saveAsCopy\",e),this.logger.perf(k,j,\"SaveAsCopy\",\"Begin\",e.id);const t=this.cache.getContext(e.id);if(!t)return this.logger.perf(k,j,\"SaveAsCopy\",\"End\",e.id),E.reject({code:G.DocNotOpen,message:\"document does not open\"});const n=this.saveDocument(t.docPtr);return this.logger.perf(k,j,\"SaveAsCopy\",\"End\",e.id),E.resolve(n)}closeDocument(e){this.logger.debug(k,j,\"closeDocument\",e),this.logger.perf(k,j,\"CloseDocument\",\"Begin\",e.id);const t=this.cache.getContext(e.id);return t?(t.dispose(),this.logger.perf(k,j,\"CloseDocument\",\"End\",e.id),E.resolve(!0)):(this.logger.perf(k,j,\"CloseDocument\",\"End\",e.id),E.reject({code:G.DocNotOpen,message:\"document does not open\"}))}malloc(e){const t=this.pdfiumModule.pdfium.wasmExports.malloc(e);for(let n=0;n<e;n++)this.pdfiumModule.pdfium.HEAP8[t+n]=0;return t}free(e){this.pdfiumModule.pdfium.wasmExports.free(e)}addInkStroke(e,t,n,r){for(const t of r){const r=t.points.length,o=this.malloc(8*r);for(let n=0;n<r;n++){const r=t.points[n],{x:i,y:a}=this.convertDevicePointToPagePoint(e,r);this.pdfiumModule.pdfium.setValue(o+8*n,i,\"float\"),this.pdfiumModule.pdfium.setValue(o+8*n+4,a,\"float\")}if(-1===this.pdfiumModule.FPDFAnnot_AddInkStroke(n,o,r))return this.free(o),!1;this.free(o)}return!0}addStampContent(e,t,n,r,o,i){for(const a of i)if(a.type===f.IMAGE)return this.addImageObject(e,t,n,r,o.origin,a.imageData);return!1}addImageObject(e,t,n,r,o,i){const a=i.width*i.height,s=this.malloc(4*a);if(!s)return!1;for(let e=0;e<a;e++){const t=i.data[4*e],n=i.data[4*e+1],r=i.data[4*e+2],o=i.data[4*e+3];this.pdfiumModule.pdfium.setValue(s+4*e,r,\"i8\"),this.pdfiumModule.pdfium.setValue(s+4*e+1,n,\"i8\"),this.pdfiumModule.pdfium.setValue(s+4*e+2,t,\"i8\"),this.pdfiumModule.pdfium.setValue(s+4*e+3,o,\"i8\")}const F=R.Bitmap_BGRA,u=this.pdfiumModule.FPDFBitmap_CreateEx(i.width,i.height,F,s,0);if(!u)return this.free(s),!1;const m=this.pdfiumModule.FPDFPageObj_NewImageObj(e);if(!m)return this.pdfiumModule.FPDFBitmap_Destroy(u),this.free(s),!1;if(!this.pdfiumModule.FPDFImageObj_SetBitmap(n,0,m,u))return this.pdfiumModule.FPDFBitmap_Destroy(u),this.pdfiumModule.FPDFPageObj_Destroy(m),this.free(s),!1;const l=this.malloc(24);return this.pdfiumModule.pdfium.setValue(l,i.width,\"float\"),this.pdfiumModule.pdfium.setValue(l+4,0,\"float\"),this.pdfiumModule.pdfium.setValue(l+8,0,\"float\"),this.pdfiumModule.pdfium.setValue(l+12,i.height,\"float\"),this.pdfiumModule.pdfium.setValue(l+16,0,\"float\"),this.pdfiumModule.pdfium.setValue(l+20,0,\"float\"),this.pdfiumModule.FPDFPageObj_SetMatrix(m,l)?(this.free(l),this.pdfiumModule.FPDFPageObj_Transform(m,1,0,0,1,o.x,o.y),this.pdfiumModule.FPDFAnnot_AppendObject(r,m)?(this.pdfiumModule.FPDFPage_GenerateContent(n),this.pdfiumModule.FPDFBitmap_Destroy(u),this.free(s),!0):(this.pdfiumModule.FPDFBitmap_Destroy(u),this.pdfiumModule.FPDFPageObj_Destroy(m),this.free(s),!1)):(this.free(l),this.pdfiumModule.FPDFBitmap_Destroy(u),this.pdfiumModule.FPDFPageObj_Destroy(m),this.free(s),!1)}saveDocument(e){const t=this.pdfiumModule.PDFiumExt_OpenFileWriter();this.pdfiumModule.PDFiumExt_SaveAsCopy(e,t);const n=this.pdfiumModule.PDFiumExt_GetFileWriterSize(t),r=this.malloc(n);this.pdfiumModule.PDFiumExt_GetFileWriterData(t,r,n);const o=new ArrayBuffer(n),i=new DataView(o);for(let e=0;e<n;e++)i.setInt8(e,this.pdfiumModule.pdfium.getValue(r+e,\"i8\"));return this.free(r),this.pdfiumModule.PDFiumExt_CloseFileWriter(t),o}readMetaText(e,t){return C(this.pdfiumModule.pdfium,((n,r)=>this.pdfiumModule.FPDF_GetMetaText(e,t,n,r)),this.pdfiumModule.pdfium.UTF16ToString)}readPdfBookmarks(e,t=0){let n=this.pdfiumModule.FPDFBookmark_GetFirstChild(e,t);const r=[];for(;n;){const t=this.readPdfBookmark(e,n);r.push(t);n=this.pdfiumModule.FPDFBookmark_GetNextSibling(e,n)}return r}readPdfBookmark(e,t){const n=C(this.pdfiumModule.pdfium,((e,n)=>this.pdfiumModule.FPDFBookmark_GetTitle(t,e,n)),this.pdfiumModule.pdfium.UTF16ToString),r=this.readPdfBookmarks(e,t);return{title:n,target:this.readPdfBookmarkTarget(e,(()=>this.pdfiumModule.FPDFBookmark_GetAction(t)),(()=>this.pdfiumModule.FPDFBookmark_GetDest(e,t))),children:r}}readPageTextRects(e,t,n,r){const o=this.pdfiumModule.FPDFText_CountRects(r,0,-1),i=[];for(let t=0;t<o;t++){const o=this.malloc(8),a=this.malloc(8),s=this.malloc(8),F=this.malloc(8);if(!this.pdfiumModule.FPDFText_GetRect(r,t,a,o,s,F)){this.free(a),this.free(o),this.free(s),this.free(F);continue}const u=this.pdfiumModule.pdfium.getValue(a,\"double\"),m=this.pdfiumModule.pdfium.getValue(o,\"double\"),l=this.pdfiumModule.pdfium.getValue(s,\"double\"),d=this.pdfiumModule.pdfium.getValue(F,\"double\");this.free(a),this.free(o),this.free(s),this.free(F);const _=this.malloc(4),P=this.malloc(4);this.pdfiumModule.FPDF_PageToDevice(n,0,0,e.size.width,e.size.height,0,u,m,_,P);const c=this.pdfiumModule.pdfium.getValue(_,\"i32\"),h=this.pdfiumModule.pdfium.getValue(P,\"i32\");this.free(_),this.free(P);const g={origin:{x:c,y:h},size:{width:Math.ceil(Math.abs(l-u)),height:Math.ceil(Math.abs(m-d))}},D=this.pdfiumModule.FPDFText_GetBoundedText(r,u,m,l,d,0,0),b=2*(D+1),p=this.malloc(b);this.pdfiumModule.FPDFText_GetBoundedText(r,u,m,l,d,p,D);const f=this.pdfiumModule.pdfium.UTF16ToString(p);this.free(p);const A=this.pdfiumModule.FPDFText_GetCharIndexAtPos(r,u,m,2,2);let G=\"\",E=g.size.height;if(A>=0){E=this.pdfiumModule.FPDFText_GetFontSize(r,A);const e=this.pdfiumModule.FPDFText_GetFontInfo(r,A,0,0,0)+1,t=this.malloc(e),n=this.malloc(4);this.pdfiumModule.FPDFText_GetFontInfo(r,A,t,e,n),G=this.pdfiumModule.pdfium.UTF8ToString(t),this.free(t),this.free(n)}const S={content:f,rect:g,font:{family:G,size:E}};i.push(S)}return i}getPageGeometry(e,t){const n=\"getPageGeometry\";this.logger.perf(k,j,n,\"Begin\",e.id);const r=this.cache.getContext(e.id);if(!r)return this.logger.perf(k,j,n,\"End\",e.id),E.reject({code:G.DocNotOpen,message:\"document does not open\"});const o=r.acquirePage(t.index),i=o.getTextPage(),a=this.pdfiumModule.FPDFText_CountChars(i),s=[];for(let e=0;e<a;e++){const n=this.readGlyphInfo(t,o.pagePtr,i,e);s.push(n)}const F=this.buildRunsFromGlyphs(s,i);return o.release(),this.logger.perf(k,j,n,\"End\",e.id),E.resolve({runs:F})}buildRunsFromGlyphs(e,t){const n=[];let r=null,o=null,i=null;for(let a=0;a<e.length;a++){const s=e[a],F=this.pdfiumModule.FPDFText_GetTextObject(t,a);if(F!==o&&(o=F,r={rect:{x:s.origin.x,y:s.origin.y,width:s.size.width,height:s.size.height},charStart:a,glyphs:[]},i={minX:s.origin.x,minY:s.origin.y,maxX:s.origin.x+s.size.width,maxY:s.origin.y+s.size.height},n.push(r)),r.glyphs.push({x:s.origin.x,y:s.origin.y,width:s.size.width,height:s.size.height,flags:s.isEmpty?2:s.isSpace?1:0}),s.isEmpty)continue;const u=s.origin.x+s.size.width,m=s.origin.y+s.size.height;i.minX=Math.min(i.minX,s.origin.x),i.minY=Math.min(i.minY,s.origin.y),i.maxX=Math.max(i.maxX,u),i.maxY=Math.max(i.maxY,m),r.rect.x=i.minX,r.rect.y=i.minY,r.rect.width=i.maxX-i.minX,r.rect.height=i.maxY-i.minY}return n}readGlyphInfo(e,t,n,r){const o=this.malloc(4),i=this.malloc(4),a=this.malloc(4),s=this.malloc(4),F=this.malloc(16);let u=0,m=0,l=0,d=0,_=!1;if(this.pdfiumModule.FPDFText_GetLooseCharBox(n,r,F)){const P=this.pdfiumModule.pdfium.getValue(F,\"float\"),c=this.pdfiumModule.pdfium.getValue(F+4,\"float\"),h=this.pdfiumModule.pdfium.getValue(F+8,\"float\"),g=this.pdfiumModule.pdfium.getValue(F+12,\"float\");if(P===h||c===g)return{origin:{x:0,y:0},size:{width:0,height:0},isEmpty:!0};this.pdfiumModule.FPDF_PageToDevice(t,0,0,e.size.width,e.size.height,0,P,c,o,i),this.pdfiumModule.FPDF_PageToDevice(t,0,0,e.size.width,e.size.height,0,h,g,a,s);const D=this.pdfiumModule.pdfium.getValue(o,\"i32\"),b=this.pdfiumModule.pdfium.getValue(i,\"i32\"),p=this.pdfiumModule.pdfium.getValue(a,\"i32\"),f=this.pdfiumModule.pdfium.getValue(s,\"i32\");u=Math.min(D,p),m=Math.min(b,f),l=Math.max(1,Math.abs(p-D)),d=Math.max(1,Math.abs(f-b));_=32===this.pdfiumModule.FPDFText_GetUnicode(n,r)}return[F,o,i,a,s].forEach((e=>this.free(e))),{origin:{x:u,y:m},size:{width:l,height:d},..._&&{isSpace:_}}}getPageGlyphs(e,t){this.logger.debug(k,j,\"getPageGlyphs\",e,t),this.logger.perf(k,j,\"getPageGlyphs\",\"Begin\",e.id);const n=this.cache.getContext(e.id);if(!n)return this.logger.perf(k,j,\"getPageGlyphs\",\"End\",e.id),E.reject({code:G.DocNotOpen,message:\"document does not open\"});const r=n.acquirePage(t.index),o=r.getTextPage(),i=this.pdfiumModule.FPDFText_CountChars(o),a=new Array(i);for(let e=0;e<i;e++){const n=this.readGlyphInfo(t,r.pagePtr,o,e);n.isEmpty||(a[e]={...n})}return r.release(),this.logger.perf(k,j,\"getPageGlyphs\",\"End\",e.id),E.resolve(a)}readCharBox(e,t,n,r){const o=this.malloc(8),i=this.malloc(8),a=this.malloc(8),s=this.malloc(8);let F=0,u=0,m=0,l=0;if(this.pdfiumModule.FPDFText_GetCharBox(n,r,i,s,a,o)){const n=this.pdfiumModule.pdfium.getValue(o,\"double\"),r=this.pdfiumModule.pdfium.getValue(i,\"double\"),d=this.pdfiumModule.pdfium.getValue(a,\"double\"),_=this.pdfiumModule.pdfium.getValue(s,\"double\"),P=this.malloc(4),c=this.malloc(4);this.pdfiumModule.FPDF_PageToDevice(t,0,0,e.size.width,e.size.height,0,r,n,P,c),F=this.pdfiumModule.pdfium.getValue(P,\"i32\"),u=this.pdfiumModule.pdfium.getValue(c,\"i32\"),this.free(P),this.free(c),m=Math.ceil(Math.abs(_-r)),l=Math.ceil(Math.abs(n-d))}return this.free(o),this.free(i),this.free(a),this.free(s),{origin:{x:F,y:u},size:{width:m,height:l}}}readPageAnnotations(e,t){const n=e.acquirePage(t.index),r=this.pdfiumModule.FPDFPage_GetAnnotCount(n.pagePtr),o=[];for(let e=0;e<r;e++)n.withAnnotation(e,(r=>{const i=this.readPageAnnotation(t,n,r,e);i&&o.push(i)}));return o}readPageAnnotation(e,t,n,r){const o=this.pdfiumModule.FPDFAnnot_GetSubtype(n);let i;switch(o){case g.TEXT:i=this.readPdfTextAnno(e,t.pagePtr,n,r);break;case g.FREETEXT:i=this.readPdfFreeTextAnno(e,t.pagePtr,n,r);break;case g.LINK:i=this.readPdfLinkAnno(e,t.docPtr,t.pagePtr,t.getTextPage(),n,r);break;case g.WIDGET:i=this.readPdfWidgetAnno(e,t.pagePtr,n,t.getFormHandle(),r);break;case g.FILEATTACHMENT:i=this.readPdfFileAttachmentAnno(e,t.pagePtr,n,r);break;case g.INK:i=this.readPdfInkAnno(e,t.pagePtr,n,r);break;case g.POLYGON:i=this.readPdfPolygonAnno(e,t.pagePtr,n,r);break;case g.POLYLINE:i=this.readPdfPolylineAnno(e,t.pagePtr,n,r);break;case g.LINE:i=this.readPdfLineAnno(e,t.pagePtr,n,r);break;case g.HIGHLIGHT:i=this.readPdfHighlightAnno(e,t.pagePtr,n,r);break;case g.STAMP:i=this.readPdfStampAnno(t.docPtr,e,t.pagePtr,n,r);break;case g.SQUARE:i=this.readPdfSquareAnno(e,t.pagePtr,n,r);break;case g.CIRCLE:i=this.readPdfCircleAnno(e,t.pagePtr,n,r);break;case g.UNDERLINE:i=this.readPdfUnderlineAnno(e,t.pagePtr,n,r);break;case g.SQUIGGLY:i=this.readPdfSquigglyAnno(e,t.pagePtr,n,r);break;case g.STRIKEOUT:i=this.readPdfStrikeOutAnno(e,t.pagePtr,n,r);break;case g.CARET:i=this.readPdfCaretAnno(e,t.pagePtr,n,r);break;case g.POPUP:break;default:i=this.readPdfAnno(e,t.pagePtr,o,n,r)}return i}readAnnotationColor(e){const t=this.malloc(4),n=this.malloc(4),r=this.malloc(4),o=this.malloc(4);let i;return this.pdfiumModule.FPDFAnnot_GetColor(e,0,t,n,r,o)&&(i={red:255&this.pdfiumModule.pdfium.getValue(t,\"i32\"),green:255&this.pdfiumModule.pdfium.getValue(n,\"i32\"),blue:255&this.pdfiumModule.pdfium.getValue(r,\"i32\"),alpha:255&this.pdfiumModule.pdfium.getValue(o,\"i32\")}),this.free(t),this.free(n),this.free(r),this.free(o),i}getColorFromPath(e){const t=this.malloc(4),n=this.malloc(4),r=this.malloc(4),o=this.malloc(4),i=this.pdfiumModule.FPDFPageObj_GetFillColor(e,t,n,r,o),a=!i&&this.pdfiumModule.FPDFPageObj_GetStrokeColor(e,t,n,r,o);let s;return(i||a)&&(s={red:255&this.pdfiumModule.pdfium.getValue(t,\"i32\"),green:255&this.pdfiumModule.pdfium.getValue(n,\"i32\"),blue:255&this.pdfiumModule.pdfium.getValue(r,\"i32\"),alpha:255&this.pdfiumModule.pdfium.getValue(o,\"i32\")}),this.free(t),this.free(n),this.free(r),this.free(o),s}walkPageObjTree(e){const t=this.pdfiumModule.FPDFPageObj_GetType(e);if(t===f.PATH)return this.getColorFromPath(e);if(t!==f.FORM)return;const n=this.pdfiumModule.FPDFFormObj_CountObjects(e);for(let t=0;t<n;t++){const n=this.pdfiumModule.FPDFFormObj_GetObject(e,t);if(!n)continue;const r=this.walkPageObjTree(n);if(r)return r}}colorFromAppearance(e){const t=this.pdfiumModule.FPDFAnnot_GetObjectCount(e);for(let n=0;n<t;n++){const t=this.pdfiumModule.FPDFAnnot_GetObject(e,n);if(!t)continue;const r=this.walkPageObjTree(t);if(r)return r}}resolveAnnotationColor(e,t={red:255,green:245,blue:155,alpha:255}){return this.readAnnotationColor(e)??this.colorFromAppearance(e)??t}readAnnotationQuads(e,t){const n=this.pdfiumModule.FPDFAnnot_CountAttachmentPoints(t);if(0===n)return[];const r=[];for(let o=0;o<n;o++){const n=this.malloc(32);if(this.pdfiumModule.FPDFAnnot_GetAttachmentPoints(t,o,n)){const t=[],o=[];for(let e=0;e<4;e++){const r=n+8*e;t.push(this.pdfiumModule.pdfium.getValue(r,\"float\")),o.push(this.pdfiumModule.pdfium.getValue(r+4,\"float\"))}const i=this.convertPagePointToDevicePoint(e,{x:t[0],y:o[0]}),a=this.convertPagePointToDevicePoint(e,{x:t[1],y:o[1]}),s=this.convertPagePointToDevicePoint(e,{x:t[2],y:o[2]}),F=this.convertPagePointToDevicePoint(e,{x:t[3],y:o[3]});r.push({p1:i,p2:a,p3:s,p4:F})}this.free(n)}return r}readPdfTextAnno(e,t,n,r){const o=this.readPageAnnoAppearanceStreams(n),i=this.readPageAnnoRect(n),a=this.convertPageRectToDeviceRect(e,t,i),s=this.getAnnotString(n,\"T\"),F=this.getAnnotString(n,\"M\"),u=this.toIsoDate(F),m=this.getAnnotString(n,\"Contents\")||\"\",l=this.getAnnotString(n,\"State\"),d=this.getAnnotString(n,\"StateModel\"),_=this.resolveAnnotationColor(n),P=this.getInReplyToId(t,n),c=P?void 0:this.readPdfAnnoLinkedPopup(e,t,n,r);return{status:D.Committed,pageIndex:e.index,id:r,type:g.TEXT,contents:m,color:_,rect:a,popup:c,appearances:o,inReplyToId:P,author:s,modified:u,state:l,stateModel:d}}readPdfFreeTextAnno(e,t,n,r){const o=this.readPageAnnoAppearanceStreams(n),i=this.readPageAnnoRect(n),a=this.convertPageRectToDeviceRect(e,t,i),s=this.getAnnotString(n,\"Contents\")||\"\",F=this.getAnnotString(n,\"T\"),u=this.getAnnotString(n,\"M\"),m=this.toIsoDate(u),l=this.readPdfAnnoLinkedPopup(e,t,n,r);return{status:D.Committed,pageIndex:e.index,id:r,type:g.FREETEXT,contents:s,author:F,modified:m,rect:a,popup:l,appearances:o}}readPdfLinkAnno(e,t,n,r,o,i){const a=this.pdfiumModule.FPDFAnnot_GetLink(o);if(!a)return;const s=this.readPageAnnoAppearanceStreams(o),F=this.readPageAnnoRect(o),{left:u,top:m,right:l,bottom:d}=F,_=this.convertPageRectToDeviceRect(e,n,F),P=this.getAnnotString(o,\"T\"),c=this.getAnnotString(o,\"M\"),h=this.toIsoDate(c),b=this.pdfiumModule.FPDFText_GetBoundedText(r,u,m,l,d,0,0),p=2*(b+1),f=this.malloc(p);this.pdfiumModule.FPDFText_GetBoundedText(r,u,m,l,d,f,b);const A=this.pdfiumModule.pdfium.UTF16ToString(f);this.free(f);const G=this.readPdfLinkAnnoTarget(t,(()=>this.pdfiumModule.FPDFLink_GetAction(a)),(()=>this.pdfiumModule.FPDFLink_GetDest(t,a))),E=this.readPdfAnnoLinkedPopup(e,n,o,i);return{status:D.Committed,pageIndex:e.index,id:i,type:g.LINK,text:A,target:G,rect:_,popup:E,appearances:s,author:P,modified:h}}readPdfWidgetAnno(e,t,n,r,o){const i=this.readPageAnnoAppearanceStreams(n),a=this.readPageAnnoRect(n),s=this.convertPageRectToDeviceRect(e,t,a),F=this.getAnnotString(n,\"T\"),u=this.getAnnotString(n,\"M\"),m=this.toIsoDate(u),l=this.readPdfAnnoLinkedPopup(e,t,n,o),d=this.readPdfWidgetAnnoField(r,n);return{status:D.Committed,pageIndex:e.index,id:o,type:g.WIDGET,rect:s,field:d,popup:l,appearances:i,author:F,modified:m}}readPdfFileAttachmentAnno(e,t,n,r){const o=this.readPageAnnoAppearanceStreams(n),i=this.readPageAnnoRect(n),a=this.convertPageRectToDeviceRect(e,t,i),s=this.getAnnotString(n,\"T\"),F=this.getAnnotString(n,\"M\"),u=this.toIsoDate(F),m=this.readPdfAnnoLinkedPopup(e,t,n,r);return{status:D.Committed,pageIndex:e.index,id:r,type:g.FILEATTACHMENT,rect:a,popup:m,appearances:o,author:s,modified:u}}readPdfInkAnno(e,t,n,r){const o=this.readPageAnnoAppearanceStreams(n),i=this.readPageAnnoRect(n),a=this.convertPageRectToDeviceRect(e,t,i),s=this.getAnnotString(n,\"T\"),F=this.getAnnotString(n,\"M\"),u=this.toIsoDate(F),m=this.readPdfAnnoLinkedPopup(e,t,n,r),l=[],d=this.pdfiumModule.FPDFAnnot_GetInkListCount(n);for(let t=0;t<d;t++){const r=[],o=this.pdfiumModule.FPDFAnnot_GetInkListPath(n,t,0,0);if(o>0){const i=8,a=this.malloc(o*i);this.pdfiumModule.FPDFAnnot_GetInkListPath(n,t,a,o);for(let t=0;t<o;t++){const n=this.pdfiumModule.pdfium.getValue(a+8*t,\"float\"),o=this.pdfiumModule.pdfium.getValue(a+8*t+4,\"float\"),{x:i,y:s}=this.convertPagePointToDevicePoint(e,{x:n,y:o});r.push({x:i,y:s})}this.free(a)}l.push({points:r})}return{status:D.Committed,pageIndex:e.index,id:r,type:g.INK,rect:a,popup:m,inkList:l,appearances:o,author:s,modified:u}}readPdfPolygonAnno(e,t,n,r){const o=this.readPageAnnoAppearanceStreams(n),i=this.readPageAnnoRect(n),a=this.convertPageRectToDeviceRect(e,t,i),s=this.getAnnotString(n,\"T\"),F=this.getAnnotString(n,\"M\"),u=this.toIsoDate(F),m=this.readPdfAnnoLinkedPopup(e,t,n,r),l=this.readPdfAnnoVertices(e,t,n);return{status:D.Committed,pageIndex:e.index,id:r,type:g.POLYGON,rect:a,popup:m,vertices:l,appearances:o,author:s,modified:u}}readPdfPolylineAnno(e,t,n,r){const o=this.readPageAnnoAppearanceStreams(n),i=this.readPageAnnoRect(n),a=this.convertPageRectToDeviceRect(e,t,i),s=this.getAnnotString(n,\"T\"),F=this.getAnnotString(n,\"M\"),u=this.toIsoDate(F),m=this.readPdfAnnoLinkedPopup(e,t,n,r),l=this.readPdfAnnoVertices(e,t,n);return{status:D.Committed,pageIndex:e.index,id:r,type:g.POLYLINE,rect:a,popup:m,vertices:l,appearances:o,author:s,modified:u}}readPdfLineAnno(e,t,n,r){const o=this.readPageAnnoAppearanceStreams(n),i=this.readPageAnnoRect(n),a=this.convertPageRectToDeviceRect(e,t,i),s=this.getAnnotString(n,\"T\"),F=this.getAnnotString(n,\"M\"),u=this.toIsoDate(F),m=this.readPdfAnnoLinkedPopup(e,t,n,r),l=this.malloc(8),d=this.malloc(8);this.pdfiumModule.FPDFAnnot_GetLine(n,l,d);const _=this.pdfiumModule.pdfium.getValue(l,\"float\"),P=this.pdfiumModule.pdfium.getValue(l+4,\"float\"),c=this.convertPagePointToDevicePoint(e,{x:_,y:P}),h=this.pdfiumModule.pdfium.getValue(d,\"float\"),b=this.pdfiumModule.pdfium.getValue(d+4,\"float\"),p=this.convertPagePointToDevicePoint(e,{x:h,y:b});return this.free(l),this.free(d),{status:D.Committed,pageIndex:e.index,id:r,type:g.LINE,rect:a,popup:m,startPoint:c,endPoint:p,appearances:o,author:s,modified:u}}readPdfHighlightAnno(e,t,n,r){const o=this.readPageAnnoAppearanceStreams(n),i=this.readPageAnnoRect(n),a=this.convertPageRectToDeviceRect(e,t,i),F=this.readAnnotationQuads(e,n),u=this.resolveAnnotationColor(n),m=this.readPdfAnnoLinkedPopup(e,t,n,r),l=this.getAnnotString(n,\"T\"),d=this.getAnnotString(n,\"M\"),_=this.toIsoDate(d);return{status:D.Committed,pageIndex:e.index,id:r,type:g.HIGHLIGHT,rect:a,popup:m,appearances:o,segmentRects:F.map(s),color:u,author:l,modified:_}}readPdfUnderlineAnno(e,t,n,r){const o=this.readPageAnnoAppearanceStreams(n),i=this.readPageAnnoRect(n),a=this.convertPageRectToDeviceRect(e,t,i),s=this.getAnnotString(n,\"T\"),F=this.getAnnotString(n,\"M\"),u=this.toIsoDate(F),m=this.readPdfAnnoLinkedPopup(e,t,n,r);return{status:D.Committed,pageIndex:e.index,id:r,type:g.UNDERLINE,rect:a,popup:m,appearances:o,author:s,modified:u}}readPdfStrikeOutAnno(e,t,n,r){const o=this.readPageAnnoAppearanceStreams(n),i=this.readPageAnnoRect(n),a=this.convertPageRectToDeviceRect(e,t,i),s=this.getAnnotString(n,\"T\"),F=this.getAnnotString(n,\"M\"),u=this.toIsoDate(F),m=this.readPdfAnnoLinkedPopup(e,t,n,r);return{status:D.Committed,pageIndex:e.index,id:r,type:g.STRIKEOUT,rect:a,popup:m,appearances:o,author:s,modified:u}}readPdfSquigglyAnno(e,t,n,r){const o=this.readPageAnnoAppearanceStreams(n),i=this.readPageAnnoRect(n),a=this.convertPageRectToDeviceRect(e,t,i),s=this.getAnnotString(n,\"T\"),F=this.getAnnotString(n,\"M\"),u=this.toIsoDate(F),m=this.readPdfAnnoLinkedPopup(e,t,n,r);return{status:D.Committed,pageIndex:e.index,id:r,type:g.SQUIGGLY,rect:a,popup:m,appearances:o,author:s,modified:u}}readPdfCaretAnno(e,t,n,r){const o=this.readPageAnnoAppearanceStreams(n),i=this.readPageAnnoRect(n),a=this.convertPageRectToDeviceRect(e,t,i),s=this.getAnnotString(n,\"T\"),F=this.getAnnotString(n,\"M\"),u=this.toIsoDate(F),m=this.readPdfAnnoLinkedPopup(e,t,n,r);return{status:D.Committed,pageIndex:e.index,id:r,type:g.CARET,rect:a,popup:m,appearances:o,author:s,modified:u}}readPdfStampAnno(e,t,n,r,o){const i=this.readPageAnnoAppearanceStreams(r),a=this.readPageAnnoRect(r),s=this.convertPageRectToDeviceRect(t,n,a),F=this.getAnnotString(r,\"T\"),u=this.getAnnotString(r,\"M\"),m=this.toIsoDate(u),l=this.readPdfAnnoLinkedPopup(t,n,r,o),d=[],_=this.pdfiumModule.FPDFAnnot_GetObjectCount(r);for(let e=0;e<_;e++){const t=this.pdfiumModule.FPDFAnnot_GetObject(r,e),n=this.readPdfPageObject(t);n&&d.push(n)}return{status:D.Committed,pageIndex:t.index,id:o,type:g.STAMP,rect:s,popup:l,contents:d,appearances:i,author:F,modified:m}}readPdfPageObject(e){switch(this.pdfiumModule.FPDFPageObj_GetType(e)){case f.PATH:return this.readPathObject(e);case f.IMAGE:return this.readImageObject(e);case f.FORM:return this.readFormObject(e)}}readPathObject(e){const t=this.pdfiumModule.FPDFPath_CountSegments(e),n=this.malloc(4),r=this.malloc(4),o=this.malloc(4),i=this.malloc(4);this.pdfiumModule.FPDFPageObj_GetBounds(e,n,r,o,i);const a={left:this.pdfiumModule.pdfium.getValue(n,\"float\"),bottom:this.pdfiumModule.pdfium.getValue(r,\"float\"),right:this.pdfiumModule.pdfium.getValue(o,\"float\"),top:this.pdfiumModule.pdfium.getValue(i,\"float\")};this.free(n),this.free(r),this.free(o),this.free(i);const s=[];for(let n=0;n<t;n++){const t=this.readPdfSegment(e,n);s.push(t)}const F=this.readPdfPageObjectTransformMatrix(e);return{type:f.PATH,bounds:a,segments:s,matrix:F}}readPdfSegment(e,t){const n=this.pdfiumModule.FPDFPath_GetPathSegment(e,t),r=this.pdfiumModule.FPDFPathSegment_GetType(n),o=this.pdfiumModule.FPDFPathSegment_GetClose(n),i=this.malloc(4),a=this.malloc(4);this.pdfiumModule.FPDFPathSegment_GetPoint(n,i,a);const s=this.pdfiumModule.pdfium.getValue(i,\"float\"),F=this.pdfiumModule.pdfium.getValue(a,\"float\");return this.free(i),this.free(a),{type:r,point:{x:s,y:F},isClosed:o}}readImageObject(e){const t=this.pdfiumModule.FPDFImageObj_GetBitmap(e),n=this.pdfiumModule.FPDFBitmap_GetBuffer(t),r=this.pdfiumModule.FPDFBitmap_GetWidth(t),o=this.pdfiumModule.FPDFBitmap_GetHeight(t),i=this.pdfiumModule.FPDFBitmap_GetFormat(t),a=r*o,s=new Uint8ClampedArray(4*a);for(let e=0;e<a;e++)if(i===R.Bitmap_BGR){const t=this.pdfiumModule.pdfium.getValue(n+3*e,\"i8\"),r=this.pdfiumModule.pdfium.getValue(n+3*e+1,\"i8\"),o=this.pdfiumModule.pdfium.getValue(n+3*e+2,\"i8\");s[4*e]=o,s[4*e+1]=r,s[4*e+2]=t,s[4*e+3]=100}const F=new ImageData(s,r,o),u=this.readPdfPageObjectTransformMatrix(e);return{type:f.IMAGE,imageData:F,matrix:u}}readFormObject(e){const t=this.pdfiumModule.FPDFFormObj_CountObjects(e),n=[];for(let r=0;r<t;r++){const t=this.pdfiumModule.FPDFFormObj_GetObject(e,r),o=this.readPdfPageObject(t);o&&n.push(o)}const r=this.readPdfPageObjectTransformMatrix(e);return{type:f.FORM,objects:n,matrix:r}}readPdfPageObjectTransformMatrix(e){const t=this.malloc(24);if(this.pdfiumModule.FPDFPageObj_GetMatrix(e,t)){const e=this.pdfiumModule.pdfium.getValue(t,\"float\"),n=this.pdfiumModule.pdfium.getValue(t+4,\"float\"),r=this.pdfiumModule.pdfium.getValue(t+8,\"float\"),o=this.pdfiumModule.pdfium.getValue(t+12,\"float\"),i=this.pdfiumModule.pdfium.getValue(t+16,\"float\"),a=this.pdfiumModule.pdfium.getValue(t+20,\"float\");return this.free(t),{a:e,b:n,c:r,d:o,e:i,f:a}}return this.free(t),{a:1,b:0,c:0,d:1,e:0,f:0}}readPdfCircleAnno(e,t,n,r){const o=this.readPageAnnoAppearanceStreams(n),i=this.readPageAnnoRect(n),a=this.convertPageRectToDeviceRect(e,t,i),s=this.getAnnotString(n,\"T\"),F=this.getAnnotString(n,\"M\"),u=this.toIsoDate(F),m=this.readPdfAnnoLinkedPopup(e,t,n,r);return{status:D.Committed,pageIndex:e.index,id:r,type:g.CIRCLE,rect:a,popup:m,appearances:o,author:s,modified:u}}readPdfSquareAnno(e,t,n,r){const o=this.readPageAnnoAppearanceStreams(n),i=this.readPageAnnoRect(n),a=this.convertPageRectToDeviceRect(e,t,i),s=this.getAnnotString(n,\"T\"),F=this.getAnnotString(n,\"M\"),u=this.toIsoDate(F),m=this.readPdfAnnoLinkedPopup(e,t,n,r);return{status:D.Committed,pageIndex:e.index,id:r,type:g.SQUARE,rect:a,popup:m,appearances:o,author:s,modified:u}}readPdfAnno(e,t,n,r,o){const i=this.readPageAnnoAppearanceStreams(r),a=this.readPageAnnoRect(r),s=this.convertPageRectToDeviceRect(e,t,a),F=this.getAnnotString(r,\"T\"),u=this.getAnnotString(r,\"M\"),m=this.toIsoDate(u),l=this.readPdfAnnoLinkedPopup(e,t,r,o);return{status:D.Committed,pageIndex:e.index,id:o,type:n,rect:s,popup:l,appearances:i,author:F,modified:m}}getInReplyToId(e,t){const n=this.pdfiumModule.FPDFAnnot_GetLinkedAnnot(t,\"IRT\");if(!n)return;const r=this.pdfiumModule.FPDFPage_GetAnnotIndex(e,n);return r>=0?r:void 0}toIsoDate(e){if(!e?.startsWith(\"D:\"))return;return`${e.substring(2,6)}-${e.substring(6,8)||\"01\"}-${e.substring(8,10)||\"01\"}T${e.substring(10,12)||\"00\"}:${e.substring(12,14)||\"00\"}:${e.substring(14,16)||\"00\"}`}getAnnotString(e,t){const n=this.pdfiumModule.FPDFAnnot_GetStringValue(e,t,0,0);if(0===n)return;const r=2*(n+1),o=this.malloc(r);this.pdfiumModule.FPDFAnnot_GetStringValue(e,t,o,r);const i=this.pdfiumModule.pdfium.UTF16ToString(o);return this.free(o),i||void 0}readPdfAnnoLinkedPopup(e,t,n,r){const o=this.readPageAnnoAppearanceStreams(n),i=this.pdfiumModule.FPDFAnnot_GetLinkedAnnot(n,\"Popup\");if(!i)return;const a=this.readPageAnnoRect(i),s=this.convertPageRectToDeviceRect(e,t,a),F=this.getAnnotString(n,\"T\"),u=this.getAnnotString(n,\"M\"),m=this.toIsoDate(u),l=this.getAnnotString(n,\"Contents\")||\"\",d=this.getAnnotString(n,\"Open\")||\"false\";return this.pdfiumModule.FPDFPage_CloseAnnot(i),{status:D.Committed,pageIndex:e.index,id:r,type:g.POPUP,rect:s,contents:l,open:\"true\"===d,appearances:o,author:F,modified:m}}readPdfAnnoVertices(e,t,n){const r=[],o=this.pdfiumModule.FPDFAnnot_GetVertices(n,0,0),i=this.malloc(8*o);this.pdfiumModule.FPDFAnnot_GetVertices(n,i,o);for(let t=0;t<o;t++){const n=this.pdfiumModule.pdfium.getValue(i+8*t,\"float\"),o=this.pdfiumModule.pdfium.getValue(i+8*t+4,\"float\"),{x:a,y:s}=this.convertPagePointToDevicePoint(e,{x:n,y:o});r.push({x:a,y:s})}return this.free(i),r}readPdfBookmarkTarget(e,t,n){const r=t();if(r){return{type:\"action\",action:this.readPdfAction(e,r)}}{const t=n();if(t){return{type:\"destination\",destination:this.readPdfDestination(e,t)}}}}readPdfWidgetAnnoField(e,t){const n=this.pdfiumModule.FPDFAnnot_GetFormFieldFlags(e,t),r=this.pdfiumModule.FPDFAnnot_GetFormFieldType(e,t),o=C(this.pdfiumModule.pdfium,((n,r)=>this.pdfiumModule.FPDFAnnot_GetFormFieldName(e,t,n,r)),this.pdfiumModule.pdfium.UTF16ToString),i=C(this.pdfiumModule.pdfium,((n,r)=>this.pdfiumModule.FPDFAnnot_GetFormFieldAlternateName(e,t,n,r)),this.pdfiumModule.pdfium.UTF16ToString),a=C(this.pdfiumModule.pdfium,((n,r)=>this.pdfiumModule.FPDFAnnot_GetFormFieldValue(e,t,n,r)),this.pdfiumModule.pdfium.UTF16ToString),s=[];if(r===p.COMBOBOX||r===p.LISTBOX){const n=this.pdfiumModule.FPDFAnnot_GetOptionCount(e,t);for(let r=0;r<n;r++){const n=C(this.pdfiumModule.pdfium,((n,o)=>this.pdfiumModule.FPDFAnnot_GetOptionLabel(e,t,r,n,o)),this.pdfiumModule.pdfium.UTF16ToString),o=this.pdfiumModule.FPDFAnnot_IsOptionSelected(e,t,r);s.push({label:n,isSelected:o})}}let F=!1;return r!==p.CHECKBOX&&r!==p.RADIOBUTTON||(F=this.pdfiumModule.FPDFAnnot_IsChecked(e,t)),{flag:n,type:r,name:o,alternateName:i,value:a,isChecked:F,options:s}}renderPageRectToImageData(e,t,n,r,o,s,u){const m=R.Bitmap_BGRA,l=(d=F(t.size,n,o,r*s),{origin:(_=d.origin,{x:Math.floor(_.x),y:Math.floor(_.y)}),size:i(d.size)});var d,_;const P=i(function(e,t,n){return{width:(e=t%2==0?e:a(e)).width*n,height:e.height*n}}(t.size,o,r*s)),c=l.size.width*l.size.height*4,h=this.malloc(c),g=this.pdfiumModule.FPDFBitmap_CreateEx(l.size.width,l.size.height,m,h,4*l.size.width);this.pdfiumModule.FPDFBitmap_FillRect(g,0,0,l.size.width,l.size.height,4294967295);let D=I.REVERSE_BYTE_ORDER;u?.withAnnotations&&(D|=I.ANNOT);const b=e.acquirePage(t.index);this.pdfiumModule.FPDF_RenderPageBitmap(g,b.pagePtr,-l.origin.x,-l.origin.y,P.width,P.height,o,D),this.pdfiumModule.FPDFBitmap_Destroy(g),b.release();const p=this.pdfiumModule.pdfium.HEAPU8.subarray(h,h+c),f={data:new Uint8ClampedArray(p),width:l.size.width,height:l.size.height};return this.free(h),f}readPdfLinkAnnoTarget(e,t,n){const r=n();if(r){return{type:\"destination\",destination:this.readPdfDestination(e,r)}}{const n=t();if(n){return{type:\"action\",action:this.readPdfAction(e,n)}}}}readPdfAction(e,t){let n;switch(this.pdfiumModule.FPDFAction_GetType(t)){case h.Unsupported:n={type:h.Unsupported};break;case h.Goto:{const r=this.pdfiumModule.FPDFAction_GetDest(e,t);if(r){const t=this.readPdfDestination(e,r);n={type:h.Goto,destination:t}}else n={type:h.Unsupported}}break;case h.RemoteGoto:n={type:h.Unsupported};break;case h.URI:{const r=C(this.pdfiumModule.pdfium,((n,r)=>this.pdfiumModule.FPDFAction_GetURIPath(e,t,n,r)),this.pdfiumModule.pdfium.UTF8ToString);n={type:h.URI,uri:r}}break;case h.LaunchAppOrOpenFile:{const e=C(this.pdfiumModule.pdfium,((e,n)=>this.pdfiumModule.FPDFAction_GetFilePath(t,e,n)),this.pdfiumModule.pdfium.UTF8ToString);n={type:h.LaunchAppOrOpenFile,path:e}}}return n}readPdfDestination(e,t){const n=this.pdfiumModule.FPDFDest_GetDestPageIndex(e,t),r=this.malloc(4),o=this.malloc(16),i=this.pdfiumModule.FPDFDest_GetView(t,r,o),a=this.pdfiumModule.pdfium.getValue(r,\"i32\"),s=[];for(let e=0;e<a;e++){const t=o+4*e;s.push(this.pdfiumModule.pdfium.getValue(t,\"float\"))}if(this.free(r),this.free(o),i===c.XYZ){const e=this.malloc(1),r=this.malloc(1),o=this.malloc(1),a=this.malloc(4),F=this.malloc(4),u=this.malloc(4);if(this.pdfiumModule.FPDFDest_GetLocationInPage(t,e,r,o,a,F,u)){const t=this.pdfiumModule.pdfium.getValue(e,\"i8\"),m=this.pdfiumModule.pdfium.getValue(r,\"i8\"),l=this.pdfiumModule.pdfium.getValue(o,\"i8\"),d=t?this.pdfiumModule.pdfium.getValue(a,\"float\"):0,_=m?this.pdfiumModule.pdfium.getValue(F,\"float\"):0,P=l?this.pdfiumModule.pdfium.getValue(u,\"float\"):0;return this.free(e),this.free(r),this.free(o),this.free(a),this.free(F),this.free(u),{pageIndex:n,zoom:{mode:i,params:{x:d,y:_,zoom:P}},view:s}}return this.free(e),this.free(r),this.free(o),this.free(a),this.free(F),this.free(u),{pageIndex:n,zoom:{mode:i,params:{x:0,y:0,zoom:0}},view:s}}return{pageIndex:n,zoom:{mode:i},view:s}}readPdfAttachment(e,t){const n=this.pdfiumModule.FPDFDoc_GetAttachment(e,t);return{index:t,name:C(this.pdfiumModule.pdfium,((e,t)=>this.pdfiumModule.FPDFAttachment_GetName(n,e,t)),this.pdfiumModule.pdfium.UTF16ToString),creationDate:C(this.pdfiumModule.pdfium,((e,t)=>this.pdfiumModule.FPDFAttachment_GetStringValue(n,\"CreationDate\",e,t)),this.pdfiumModule.pdfium.UTF16ToString),checksum:C(this.pdfiumModule.pdfium,((e,t)=>this.pdfiumModule.FPDFAttachment_GetStringValue(n,\"Checksum\",e,t)),this.pdfiumModule.pdfium.UTF16ToString)}}convertDevicePointToPagePoint(e,t){return{x:t.x,y:e.size.height-t.y}}convertPagePointToDevicePoint(e,t){return{x:t.x,y:e.size.height-t.y}}convertPageRectToDeviceRect(e,t,n){const{x:r,y:o}=this.convertPagePointToDevicePoint(e,{x:n.left,y:n.top});return{origin:{x:r,y:o},size:{width:Math.abs(n.right-n.left),height:Math.abs(n.top-n.bottom)}}}readPageAnnoAppearanceStreams(e){return{normal:this.readPageAnnoAppearanceStream(e,b.Normal),rollover:this.readPageAnnoAppearanceStream(e,b.Rollover),down:this.readPageAnnoAppearanceStream(e,b.Down)}}readPageAnnoAppearanceStream(e,t=b.Normal){const n=2*(this.pdfiumModule.FPDFAnnot_GetAP(e,t,0,0)+1),r=this.malloc(n);this.pdfiumModule.FPDFAnnot_GetAP(e,t,r,n);const o=this.pdfiumModule.pdfium.UTF16ToString(r);return this.free(r),o}setPageAnnoRect(e,t,n,r){const o=this.malloc(8),i=this.malloc(8);if(!this.pdfiumModule.FPDF_DeviceToPage(t,0,0,e.size.width,e.size.height,0,r.origin.x,r.origin.y,o,i))return this.free(o),this.free(i),!1;const a=this.pdfiumModule.pdfium.getValue(o,\"double\"),s=this.pdfiumModule.pdfium.getValue(i,\"double\");this.free(o),this.free(i);const F=this.malloc(16);return this.pdfiumModule.pdfium.setValue(F,a,\"float\"),this.pdfiumModule.pdfium.setValue(F+4,s,\"float\"),this.pdfiumModule.pdfium.setValue(F+8,a+r.size.width,\"float\"),this.pdfiumModule.pdfium.setValue(F+12,s-r.size.height,\"float\"),this.pdfiumModule.FPDFAnnot_SetRect(n,F)?(this.free(F),!0):(this.free(F),!1)}readPageAnnoRect(e){const t=this.malloc(16),n={left:0,top:0,right:0,bottom:0};return this.pdfiumModule.FPDFAnnot_GetRect(e,t)&&(n.left=this.pdfiumModule.pdfium.getValue(t,\"float\"),n.top=this.pdfiumModule.pdfium.getValue(t+4,\"float\"),n.right=this.pdfiumModule.pdfium.getValue(t+8,\"float\"),n.bottom=this.pdfiumModule.pdfium.getValue(t+12,\"float\")),this.free(t),n}getHighlightRects(e,t,n,r,o){const i=this.pdfiumModule.FPDFText_CountRects(n,r,o),a=[];for(let r=0;r<i;r++){const o=this.malloc(8),i=this.malloc(8),s=this.malloc(8),F=this.malloc(8);if(!this.pdfiumModule.FPDFText_GetRect(n,r,i,o,s,F)){this.free(i),this.free(o),this.free(s),this.free(F);continue}const u=this.pdfiumModule.pdfium.getValue(i,\"double\"),m=this.pdfiumModule.pdfium.getValue(o,\"double\"),l=this.pdfiumModule.pdfium.getValue(s,\"double\"),d=this.pdfiumModule.pdfium.getValue(F,\"double\");this.free(i),this.free(o),this.free(s),this.free(F);const _=this.malloc(4),P=this.malloc(4);this.pdfiumModule.FPDF_PageToDevice(t,0,0,e.size.width,e.size.height,0,u,m,_,P);const c=this.pdfiumModule.pdfium.getValue(_,\"i32\"),h=this.pdfiumModule.pdfium.getValue(P,\"i32\");this.free(_),this.free(P);const g=Math.ceil(Math.abs(l-u)),D=Math.ceil(Math.abs(m-d));a.push({origin:{x:c,y:h},size:{width:g,height:D}})}return a}searchAllPages(e,t,n=[]){this.logger.debug(k,j,\"searchAllPages\",e,t,n),this.logger.perf(k,j,\"SearchAllPages\",\"Begin\",e.id);const r=this.cache.getContext(e.id);if(!r)return this.logger.perf(k,j,\"SearchAllPages\",\"End\",e.id),E.resolve({results:[],total:0});const o=2*(t.length+1),i=this.malloc(o);this.pdfiumModule.pdfium.stringToUTF16(t,i,o);const a=n.reduce(((e,t)=>e|t),A.None),s=[],F=E.create();return(async()=>{for(let t=0;t<e.pageCount;t++){const n=this.searchAllInPage(r,e.pages[t],i,a);s.push(...n)}this.free(i),this.logger.perf(k,j,\"SearchAllPages\",\"End\",e.id),F.resolve({results:s,total:s.length})})().catch((t=>{this.free(i),this.logger.perf(k,j,\"SearchAllPages\",\"End\",e.id),F.reject({code:G.Unknown,message:`Error searching document: ${t}`})})),F}buildContext(e,t,n,r=30){const o=/[\\s\\u00A0.,;:!?()\\[\\]{}<>/\\\\\\-\"'`\"”\\u2013\\u2014]/;let i=t;for(;i>0&&o.test(e[i-1]);)i--;let a=0;for(;i>0&&a<r;)i--,o.test(e[i])||a++;i=(t=>{for(;t>0&&!o.test(e[t-1]);)t--;return t})(i);let s=t+n;for(;s<e.length&&o.test(e[s]);)s++;for(a=0;s<e.length&&a<r;)o.test(e[s])||a++,s++;s=(t=>{for(;t<e.length&&!o.test(e[t]);)t++;return t})(s);const F=e.slice(i,t).replace(/\\s+/g,\" \").trimStart(),u=e.slice(t,t+n),m=e.slice(t+n,s).replace(/\\s+/g,\" \").trimEnd();return{before:this.tidy(F),match:this.tidy(u),after:this.tidy(m),truncatedLeft:i>0,truncatedRight:s<e.length}}tidy(e){return e.replace(/-\\uFFFE\\s*/g,\"\").replace(/[\\uFFFE\\u00AD\\u200B\\u2060\\uFEFF]/g,\"\").replace(/\\s+/g,\" \")}searchAllInPage(e,t,n,r){const o=t.index,i=e.acquirePage(o),a=i.getTextPage(),s=this.pdfiumModule.FPDFText_CountChars(a),F=this.malloc(2*(s+1));this.pdfiumModule.FPDFText_GetText(a,0,s,F);const u=this.pdfiumModule.pdfium.UTF16ToString(F);this.free(F);const m=[],l=this.pdfiumModule.FPDFText_FindStart(a,n,r,0);for(;this.pdfiumModule.FPDFText_FindNext(l);){const e=this.pdfiumModule.FPDFText_GetSchResultIndex(l),n=this.pdfiumModule.FPDFText_GetSchCount(l),r=this.getHighlightRects(t,i.pagePtr,a,e,n),s=this.buildContext(u,e,n);m.push({pageIndex:o,charIndex:e,charCount:n,rects:r,context:s})}return this.pdfiumModule.FPDFText_FindClose(l),i.release(),m}}class U extends M{constructor(e){super(),this.wasmBinary=e}async prepare(){const e=this.wasmBinary,t=await r({wasmBinary:e});this.engine=new N(t),this.ready()}}let V=null;self.onmessage=async e=>{const{type:t,wasmUrl:n}=e.data;if(\"wasmInit\"===t&&n&&!V)try{const e=await fetch(n),t=await e.arrayBuffer();V=new U(t),await V.prepare()}catch(e){const t=e instanceof Error?e.message:String(e);self.postMessage({type:\"wasmError\",error:t})}};\n"], { type: 'application/javascript' })), {
842
+ const worker = new Worker(URL.createObjectURL(new Blob(["var e,t=(e=import.meta.url,async function(t={}){var n,r,o,i=t,a=new Promise(((e,t)=>{r=e,o=t}));[\"_EPDF_RenderAnnotBitmap\",\"_EPDFAnnot_GenerateAppearance\",\"_EPDFAnnot_GetBorderDashPattern\",\"_EPDFAnnot_GetBorderDashPatternCount\",\"_EPDFAnnot_GetBorderEffect\",\"_EPDFAnnot_GetBorderStyle\",\"_EPDFAnnot_GetColor\",\"_EPDFAnnot_GetRectangleDifferences\",\"_EPDFAnnot_SetBorderStyle\",\"_EPDFAnnot_SetColor\",\"_FORM_CanRedo\",\"_FORM_CanUndo\",\"_FORM_DoDocumentAAction\",\"_FORM_DoDocumentJSAction\",\"_FORM_DoDocumentOpenAction\",\"_FORM_DoPageAAction\",\"_FORM_ForceToKillFocus\",\"_FORM_GetFocusedAnnot\",\"_FORM_GetFocusedText\",\"_FORM_GetSelectedText\",\"_FORM_IsIndexSelected\",\"_FORM_OnAfterLoadPage\",\"_FORM_OnBeforeClosePage\",\"_FORM_OnChar\",\"_FORM_OnFocus\",\"_FORM_OnKeyDown\",\"_FORM_OnKeyUp\",\"_FORM_OnLButtonDoubleClick\",\"_FORM_OnLButtonDown\",\"_FORM_OnLButtonUp\",\"_FORM_OnMouseMove\",\"_FORM_OnMouseWheel\",\"_FORM_OnRButtonDown\",\"_FORM_OnRButtonUp\",\"_FORM_Redo\",\"_FORM_ReplaceAndKeepSelection\",\"_FORM_ReplaceSelection\",\"_FORM_SelectAllText\",\"_FORM_SetFocusedAnnot\",\"_FORM_SetIndexSelected\",\"_FORM_Undo\",\"_FPDF_AddInstalledFont\",\"_FPDF_CloseDocument\",\"_FPDF_ClosePage\",\"_FPDF_CloseXObject\",\"_FPDF_CopyViewerPreferences\",\"_FPDF_CountNamedDests\",\"_FPDF_CreateClipPath\",\"_FPDF_CreateNewDocument\",\"_FPDF_DestroyClipPath\",\"_FPDF_DestroyLibrary\",\"_FPDF_DeviceToPage\",\"_FPDF_DocumentHasValidCrossReferenceTable\",\"_FPDF_FFLDraw\",\"_FPDF_FreeDefaultSystemFontInfo\",\"_FPDF_GetDefaultSystemFontInfo\",\"_FPDF_GetDefaultTTFMap\",\"_FPDF_GetDefaultTTFMapCount\",\"_FPDF_GetDefaultTTFMapEntry\",\"_FPDF_GetDocPermissions\",\"_FPDF_GetDocUserPermissions\",\"_FPDF_GetFileIdentifier\",\"_FPDF_GetFileVersion\",\"_FPDF_GetFormType\",\"_FPDF_GetLastError\",\"_FPDF_GetMetaText\",\"_FPDF_GetNamedDest\",\"_FPDF_GetNamedDestByName\",\"_FPDF_GetPageAAction\",\"_FPDF_GetPageBoundingBox\",\"_FPDF_GetPageCount\",\"_FPDF_GetPageHeight\",\"_FPDF_GetPageHeightF\",\"_FPDF_GetPageLabel\",\"_FPDF_GetPageSizeByIndex\",\"_FPDF_GetPageSizeByIndexF\",\"_FPDF_GetPageWidth\",\"_FPDF_GetPageWidthF\",\"_FPDF_GetSecurityHandlerRevision\",\"_FPDF_GetSignatureCount\",\"_FPDF_GetSignatureObject\",\"_FPDF_GetTrailerEnds\",\"_FPDF_GetXFAPacketContent\",\"_FPDF_GetXFAPacketCount\",\"_FPDF_GetXFAPacketName\",\"_FPDF_ImportNPagesToOne\",\"_FPDF_ImportPages\",\"_FPDF_ImportPagesByIndex\",\"_FPDF_InitLibrary\",\"_FPDF_InitLibraryWithConfig\",\"_FPDF_LoadCustomDocument\",\"_FPDF_LoadDocument\",\"_FPDF_LoadMemDocument\",\"_FPDF_LoadMemDocument64\",\"_FPDF_LoadPage\",\"_FPDF_LoadXFA\",\"_FPDF_MovePages\",\"_FPDF_NewFormObjectFromXObject\",\"_FPDF_NewXObjectFromPage\",\"_FPDF_PageToDevice\",\"_FPDF_RemoveFormFieldHighlight\",\"_FPDF_RenderPage_Close\",\"_FPDF_RenderPage_Continue\",\"_FPDF_RenderPageBitmap\",\"_FPDF_RenderPageBitmap_Start\",\"_FPDF_RenderPageBitmapWithColorScheme_Start\",\"_FPDF_RenderPageBitmapWithMatrix\",\"_FPDF_SaveAsCopy\",\"_FPDF_SaveWithVersion\",\"_FPDF_SetFormFieldHighlightAlpha\",\"_FPDF_SetFormFieldHighlightColor\",\"_FPDF_SetSandBoxPolicy\",\"_FPDF_SetSystemFontInfo\",\"_FPDF_StructElement_Attr_CountChildren\",\"_FPDF_StructElement_Attr_GetBlobValue\",\"_FPDF_StructElement_Attr_GetBooleanValue\",\"_FPDF_StructElement_Attr_GetChildAtIndex\",\"_FPDF_StructElement_Attr_GetCount\",\"_FPDF_StructElement_Attr_GetName\",\"_FPDF_StructElement_Attr_GetNumberValue\",\"_FPDF_StructElement_Attr_GetStringValue\",\"_FPDF_StructElement_Attr_GetType\",\"_FPDF_StructElement_Attr_GetValue\",\"_FPDF_StructElement_CountChildren\",\"_FPDF_StructElement_GetActualText\",\"_FPDF_StructElement_GetAltText\",\"_FPDF_StructElement_GetAttributeAtIndex\",\"_FPDF_StructElement_GetAttributeCount\",\"_FPDF_StructElement_GetChildAtIndex\",\"_FPDF_StructElement_GetChildMarkedContentID\",\"_FPDF_StructElement_GetID\",\"_FPDF_StructElement_GetLang\",\"_FPDF_StructElement_GetMarkedContentID\",\"_FPDF_StructElement_GetMarkedContentIdAtIndex\",\"_FPDF_StructElement_GetMarkedContentIdCount\",\"_FPDF_StructElement_GetObjType\",\"_FPDF_StructElement_GetParent\",\"_FPDF_StructElement_GetStringAttribute\",\"_FPDF_StructElement_GetTitle\",\"_FPDF_StructElement_GetType\",\"_FPDF_StructTree_Close\",\"_FPDF_StructTree_CountChildren\",\"_FPDF_StructTree_GetChildAtIndex\",\"_FPDF_StructTree_GetForPage\",\"_FPDF_VIEWERREF_GetDuplex\",\"_FPDF_VIEWERREF_GetName\",\"_FPDF_VIEWERREF_GetNumCopies\",\"_FPDF_VIEWERREF_GetPrintPageRange\",\"_FPDF_VIEWERREF_GetPrintPageRangeCount\",\"_FPDF_VIEWERREF_GetPrintPageRangeElement\",\"_FPDF_VIEWERREF_GetPrintScaling\",\"_FPDFAction_GetDest\",\"_FPDFAction_GetFilePath\",\"_FPDFAction_GetType\",\"_FPDFAction_GetURIPath\",\"_FPDFAnnot_AddFileAttachment\",\"_FPDFAnnot_AddInkStroke\",\"_FPDFAnnot_AppendAttachmentPoints\",\"_FPDFAnnot_AppendObject\",\"_FPDFAnnot_CountAttachmentPoints\",\"_FPDFAnnot_GetAP\",\"_FPDFAnnot_GetAttachmentPoints\",\"_FPDFAnnot_GetBorder\",\"_FPDFAnnot_GetColor\",\"_FPDFAnnot_GetFileAttachment\",\"_FPDFAnnot_GetFlags\",\"_FPDFAnnot_GetFocusableSubtypes\",\"_FPDFAnnot_GetFocusableSubtypesCount\",\"_FPDFAnnot_GetFontColor\",\"_FPDFAnnot_GetFontSize\",\"_FPDFAnnot_GetFormAdditionalActionJavaScript\",\"_FPDFAnnot_GetFormControlCount\",\"_FPDFAnnot_GetFormControlIndex\",\"_FPDFAnnot_GetFormFieldAlternateName\",\"_FPDFAnnot_GetFormFieldAtPoint\",\"_FPDFAnnot_GetFormFieldExportValue\",\"_FPDFAnnot_GetFormFieldFlags\",\"_FPDFAnnot_GetFormFieldName\",\"_FPDFAnnot_GetFormFieldType\",\"_FPDFAnnot_GetFormFieldValue\",\"_FPDFAnnot_GetInkListCount\",\"_FPDFAnnot_GetInkListPath\",\"_FPDFAnnot_GetLine\",\"_FPDFAnnot_GetLink\",\"_FPDFAnnot_GetLinkedAnnot\",\"_FPDFAnnot_GetNumberValue\",\"_FPDFAnnot_GetObject\",\"_FPDFAnnot_GetObjectCount\",\"_FPDFAnnot_GetOptionCount\",\"_FPDFAnnot_GetOptionLabel\",\"_FPDFAnnot_GetRect\",\"_FPDFAnnot_GetStringValue\",\"_FPDFAnnot_GetSubtype\",\"_FPDFAnnot_GetValueType\",\"_FPDFAnnot_GetVertices\",\"_FPDFAnnot_HasAttachmentPoints\",\"_FPDFAnnot_HasKey\",\"_FPDFAnnot_IsChecked\",\"_FPDFAnnot_IsObjectSupportedSubtype\",\"_FPDFAnnot_IsOptionSelected\",\"_FPDFAnnot_IsSupportedSubtype\",\"_FPDFAnnot_RemoveInkList\",\"_FPDFAnnot_RemoveObject\",\"_FPDFAnnot_SetAP\",\"_FPDFAnnot_SetAttachmentPoints\",\"_FPDFAnnot_SetBorder\",\"_FPDFAnnot_SetColor\",\"_FPDFAnnot_SetFlags\",\"_FPDFAnnot_SetFocusableSubtypes\",\"_FPDFAnnot_SetFontColor\",\"_FPDFAnnot_SetFormFieldFlags\",\"_FPDFAnnot_SetRect\",\"_FPDFAnnot_SetStringValue\",\"_FPDFAnnot_SetURI\",\"_FPDFAnnot_UpdateObject\",\"_FPDFAttachment_GetFile\",\"_FPDFAttachment_GetName\",\"_FPDFAttachment_GetStringValue\",\"_FPDFAttachment_GetSubtype\",\"_FPDFAttachment_GetValueType\",\"_FPDFAttachment_HasKey\",\"_FPDFAttachment_SetFile\",\"_FPDFAttachment_SetStringValue\",\"_FPDFAvail_Create\",\"_FPDFAvail_Destroy\",\"_FPDFAvail_GetDocument\",\"_FPDFAvail_GetFirstPageNum\",\"_FPDFAvail_IsDocAvail\",\"_FPDFAvail_IsFormAvail\",\"_FPDFAvail_IsLinearized\",\"_FPDFAvail_IsPageAvail\",\"_FPDFBitmap_Create\",\"_FPDFBitmap_CreateEx\",\"_FPDFBitmap_Destroy\",\"_FPDFBitmap_FillRect\",\"_FPDFBitmap_GetBuffer\",\"_FPDFBitmap_GetFormat\",\"_FPDFBitmap_GetHeight\",\"_FPDFBitmap_GetStride\",\"_FPDFBitmap_GetWidth\",\"_FPDFBookmark_Find\",\"_FPDFBookmark_GetAction\",\"_FPDFBookmark_GetCount\",\"_FPDFBookmark_GetDest\",\"_FPDFBookmark_GetFirstChild\",\"_FPDFBookmark_GetNextSibling\",\"_FPDFBookmark_GetTitle\",\"_FPDFCatalog_IsTagged\",\"_FPDFCatalog_SetLanguage\",\"_FPDFClipPath_CountPaths\",\"_FPDFClipPath_CountPathSegments\",\"_FPDFClipPath_GetPathSegment\",\"_FPDFDest_GetDestPageIndex\",\"_FPDFDest_GetLocationInPage\",\"_FPDFDest_GetView\",\"_FPDFDoc_AddAttachment\",\"_FPDFDoc_CloseJavaScriptAction\",\"_FPDFDoc_DeleteAttachment\",\"_FPDFDOC_ExitFormFillEnvironment\",\"_FPDFDoc_GetAttachment\",\"_FPDFDoc_GetAttachmentCount\",\"_FPDFDoc_GetJavaScriptAction\",\"_FPDFDoc_GetJavaScriptActionCount\",\"_FPDFDoc_GetPageMode\",\"_FPDFDOC_InitFormFillEnvironment\",\"_FPDFFont_Close\",\"_FPDFFont_GetAscent\",\"_FPDFFont_GetBaseFontName\",\"_FPDFFont_GetDescent\",\"_FPDFFont_GetFamilyName\",\"_FPDFFont_GetFlags\",\"_FPDFFont_GetFontData\",\"_FPDFFont_GetGlyphPath\",\"_FPDFFont_GetGlyphWidth\",\"_FPDFFont_GetIsEmbedded\",\"_FPDFFont_GetItalicAngle\",\"_FPDFFont_GetWeight\",\"_FPDFFormObj_CountObjects\",\"_FPDFFormObj_GetObject\",\"_FPDFFormObj_RemoveObject\",\"_FPDFGlyphPath_CountGlyphSegments\",\"_FPDFGlyphPath_GetGlyphPathSegment\",\"_FPDFImageObj_GetBitmap\",\"_FPDFImageObj_GetIccProfileDataDecoded\",\"_FPDFImageObj_GetImageDataDecoded\",\"_FPDFImageObj_GetImageDataRaw\",\"_FPDFImageObj_GetImageFilter\",\"_FPDFImageObj_GetImageFilterCount\",\"_FPDFImageObj_GetImageMetadata\",\"_FPDFImageObj_GetImagePixelSize\",\"_FPDFImageObj_GetRenderedBitmap\",\"_FPDFImageObj_LoadJpegFile\",\"_FPDFImageObj_LoadJpegFileInline\",\"_FPDFImageObj_SetBitmap\",\"_FPDFImageObj_SetMatrix\",\"_FPDFJavaScriptAction_GetName\",\"_FPDFJavaScriptAction_GetScript\",\"_FPDFLink_CloseWebLinks\",\"_FPDFLink_CountQuadPoints\",\"_FPDFLink_CountRects\",\"_FPDFLink_CountWebLinks\",\"_FPDFLink_Enumerate\",\"_FPDFLink_GetAction\",\"_FPDFLink_GetAnnot\",\"_FPDFLink_GetAnnotRect\",\"_FPDFLink_GetDest\",\"_FPDFLink_GetLinkAtPoint\",\"_FPDFLink_GetLinkZOrderAtPoint\",\"_FPDFLink_GetQuadPoints\",\"_FPDFLink_GetRect\",\"_FPDFLink_GetTextRange\",\"_FPDFLink_GetURL\",\"_FPDFLink_LoadWebLinks\",\"_FPDFPage_CloseAnnot\",\"_FPDFPage_CountObjects\",\"_FPDFPage_CreateAnnot\",\"_FPDFPage_Delete\",\"_FPDFPage_Flatten\",\"_FPDFPage_FormFieldZOrderAtPoint\",\"_FPDFPage_GenerateContent\",\"_FPDFPage_GetAnnot\",\"_FPDFPage_GetAnnotCount\",\"_FPDFPage_GetAnnotIndex\",\"_FPDFPage_GetArtBox\",\"_FPDFPage_GetBleedBox\",\"_FPDFPage_GetCropBox\",\"_FPDFPage_GetDecodedThumbnailData\",\"_FPDFPage_GetMediaBox\",\"_FPDFPage_GetObject\",\"_FPDFPage_GetRawThumbnailData\",\"_FPDFPage_GetRotation\",\"_FPDFPage_GetThumbnailAsBitmap\",\"_FPDFPage_GetTrimBox\",\"_FPDFPage_HasFormFieldAtPoint\",\"_FPDFPage_HasTransparency\",\"_FPDFPage_InsertClipPath\",\"_FPDFPage_InsertObject\",\"_FPDFPage_InsertObjectAtIndex\",\"_FPDFPage_New\",\"_FPDFPage_RemoveAnnot\",\"_FPDFPage_RemoveObject\",\"_FPDFPage_SetArtBox\",\"_FPDFPage_SetBleedBox\",\"_FPDFPage_SetCropBox\",\"_FPDFPage_SetMediaBox\",\"_FPDFPage_SetRotation\",\"_FPDFPage_SetTrimBox\",\"_FPDFPage_TransformAnnots\",\"_FPDFPage_TransFormWithClip\",\"_FPDFPageObj_AddMark\",\"_FPDFPageObj_CountMarks\",\"_FPDFPageObj_CreateNewPath\",\"_FPDFPageObj_CreateNewRect\",\"_FPDFPageObj_CreateTextObj\",\"_FPDFPageObj_Destroy\",\"_FPDFPageObj_GetBounds\",\"_FPDFPageObj_GetClipPath\",\"_FPDFPageObj_GetDashArray\",\"_FPDFPageObj_GetDashCount\",\"_FPDFPageObj_GetDashPhase\",\"_FPDFPageObj_GetFillColor\",\"_FPDFPageObj_GetIsActive\",\"_FPDFPageObj_GetLineCap\",\"_FPDFPageObj_GetLineJoin\",\"_FPDFPageObj_GetMark\",\"_FPDFPageObj_GetMarkedContentID\",\"_FPDFPageObj_GetMatrix\",\"_FPDFPageObj_GetRotatedBounds\",\"_FPDFPageObj_GetStrokeColor\",\"_FPDFPageObj_GetStrokeWidth\",\"_FPDFPageObj_GetType\",\"_FPDFPageObj_HasTransparency\",\"_FPDFPageObj_NewImageObj\",\"_FPDFPageObj_NewTextObj\",\"_FPDFPageObj_RemoveMark\",\"_FPDFPageObj_SetBlendMode\",\"_FPDFPageObj_SetDashArray\",\"_FPDFPageObj_SetDashPhase\",\"_FPDFPageObj_SetFillColor\",\"_FPDFPageObj_SetIsActive\",\"_FPDFPageObj_SetLineCap\",\"_FPDFPageObj_SetLineJoin\",\"_FPDFPageObj_SetMatrix\",\"_FPDFPageObj_SetStrokeColor\",\"_FPDFPageObj_SetStrokeWidth\",\"_FPDFPageObj_Transform\",\"_FPDFPageObj_TransformClipPath\",\"_FPDFPageObj_TransformF\",\"_FPDFPageObjMark_CountParams\",\"_FPDFPageObjMark_GetName\",\"_FPDFPageObjMark_GetParamBlobValue\",\"_FPDFPageObjMark_GetParamIntValue\",\"_FPDFPageObjMark_GetParamKey\",\"_FPDFPageObjMark_GetParamStringValue\",\"_FPDFPageObjMark_GetParamValueType\",\"_FPDFPageObjMark_RemoveParam\",\"_FPDFPageObjMark_SetBlobParam\",\"_FPDFPageObjMark_SetIntParam\",\"_FPDFPageObjMark_SetStringParam\",\"_FPDFPath_BezierTo\",\"_FPDFPath_Close\",\"_FPDFPath_CountSegments\",\"_FPDFPath_GetDrawMode\",\"_FPDFPath_GetPathSegment\",\"_FPDFPath_LineTo\",\"_FPDFPath_MoveTo\",\"_FPDFPath_SetDrawMode\",\"_FPDFPathSegment_GetClose\",\"_FPDFPathSegment_GetPoint\",\"_FPDFPathSegment_GetType\",\"_FPDFSignatureObj_GetByteRange\",\"_FPDFSignatureObj_GetContents\",\"_FPDFSignatureObj_GetDocMDPPermission\",\"_FPDFSignatureObj_GetReason\",\"_FPDFSignatureObj_GetSubFilter\",\"_FPDFSignatureObj_GetTime\",\"_FPDFText_ClosePage\",\"_FPDFText_CountChars\",\"_FPDFText_CountRects\",\"_FPDFText_FindClose\",\"_FPDFText_FindNext\",\"_FPDFText_FindPrev\",\"_FPDFText_FindStart\",\"_FPDFText_GetBoundedText\",\"_FPDFText_GetCharAngle\",\"_FPDFText_GetCharBox\",\"_FPDFText_GetCharIndexAtPos\",\"_FPDFText_GetCharIndexFromTextIndex\",\"_FPDFText_GetCharOrigin\",\"_FPDFText_GetFillColor\",\"_FPDFText_GetFontInfo\",\"_FPDFText_GetFontSize\",\"_FPDFText_GetFontWeight\",\"_FPDFText_GetLooseCharBox\",\"_FPDFText_GetMatrix\",\"_FPDFText_GetRect\",\"_FPDFText_GetSchCount\",\"_FPDFText_GetSchResultIndex\",\"_FPDFText_GetStrokeColor\",\"_FPDFText_GetText\",\"_FPDFText_GetTextIndexFromCharIndex\",\"_FPDFText_GetTextObject\",\"_FPDFText_GetUnicode\",\"_FPDFText_HasUnicodeMapError\",\"_FPDFText_IsGenerated\",\"_FPDFText_IsHyphen\",\"_FPDFText_LoadCidType2Font\",\"_FPDFText_LoadFont\",\"_FPDFText_LoadPage\",\"_FPDFText_LoadStandardFont\",\"_FPDFText_SetCharcodes\",\"_FPDFText_SetText\",\"_FPDFTextObj_GetFont\",\"_FPDFTextObj_GetFontSize\",\"_FPDFTextObj_GetRenderedBitmap\",\"_FPDFTextObj_GetText\",\"_FPDFTextObj_GetTextRenderMode\",\"_FPDFTextObj_SetTextRenderMode\",\"_PDFiumExt_CloseFileWriter\",\"_PDFiumExt_CloseFormFillInfo\",\"_PDFiumExt_ExitFormFillEnvironment\",\"_PDFiumExt_GetFileWriterData\",\"_PDFiumExt_GetFileWriterSize\",\"_PDFiumExt_Init\",\"_PDFiumExt_InitFormFillEnvironment\",\"_PDFiumExt_OpenFileWriter\",\"_PDFiumExt_OpenFormFillInfo\",\"_PDFiumExt_SaveAsCopy\",\"_malloc\",\"_free\",\"_memory\",\"___indirect_function_table\",\"onRuntimeInitialized\"].forEach((e=>{Object.getOwnPropertyDescriptor(a,e)||Object.defineProperty(a,e,{get:()=>q(\"You are getting \"+e+\" on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js\"),set:()=>q(\"You are setting \"+e+\" on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js\")})}));var s=\"object\"==typeof window,u=\"function\"==typeof importScripts,F=\"object\"==typeof process&&\"object\"==typeof process.versions&&\"string\"==typeof process.versions.node&&\"renderer\"!=process.type,m=!s&&!F&&!u;if(F){const{createRequire:e}=await import(\"module\");let t=import.meta.url;t.startsWith(\"data:\")&&(t=\"/\");var l=e(t)}var d,_,P=Object.assign({},i),c=\"./this.program\",g=\"\";if(F){if(\"undefined\"==typeof process||!process.release||\"node\"!==process.release.name)throw new Error(\"not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)\");var h=process.versions.node,D=h.split(\".\").slice(0,3);if((D=1e4*D[0]+100*D[1]+1*D[2].split(\"-\")[0])<16e4)throw new Error(\"This emscripten-generated code requires node v16.0.0 (detected v\"+h+\")\");var b=l(\"fs\"),p=l(\"path\");import.meta.url.startsWith(\"data:\")||(g=p.dirname(l(\"url\").fileURLToPath(import.meta.url))+\"/\"),_=e=>{e=ne(e)?new URL(e):p.normalize(e);var t=b.readFileSync(e);return I(t.buffer),t},d=(e,t=!0)=>(e=ne(e)?new URL(e):p.normalize(e),new Promise(((n,r)=>{b.readFile(e,t?void 0:\"utf8\",((e,o)=>{e?r(e):n(t?o.buffer:o)}))}))),!i.thisProgram&&process.argv.length>1&&(c=process.argv[1].replace(/\\\\/g,\"/\")),process.argv.slice(2)}else if(m){if(\"object\"==typeof process&&\"function\"==typeof l||\"object\"==typeof window||\"function\"==typeof importScripts)throw new Error(\"not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)\");_=e=>{if(\"function\"==typeof readbuffer)return new Uint8Array(readbuffer(e));let t=read(e,\"binary\");return I(\"object\"==typeof t),t},d=e=>new Promise(((t,n)=>{setTimeout((()=>t(_(e))))})),globalThis.clearTimeout??=e=>{},globalThis.setTimeout??=e=>\"function\"==typeof e?e():q(),\"undefined\"!=typeof print&&(globalThis.console??={},console.log=print,console.warn=console.error=globalThis.printErr??print)}else{if(!s&&!u)throw new Error(\"environment detection error\");if(u?g=self.location.href:\"undefined\"!=typeof document&&document.currentScript&&(g=document.currentScript.src),e&&(g=e),g=g.startsWith(\"blob:\")?\"\":g.substr(0,g.replace(/[?#].*/,\"\").lastIndexOf(\"/\")+1),\"object\"!=typeof window&&\"function\"!=typeof importScripts)throw new Error(\"not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)\");u&&(_=e=>{var t=new XMLHttpRequest;return t.open(\"GET\",e,!1),t.responseType=\"arraybuffer\",t.send(null),new Uint8Array(t.response)}),d=e=>(I(!ne(e),\"readAsync does not work with file:// URLs\"),fetch(e,{credentials:\"same-origin\"}).then((e=>e.ok?e.arrayBuffer():Promise.reject(new Error(e.status+\" : \"+e.url)))))}var f,A=i.print||console.log.bind(console),E=i.printErr||console.error.bind(console);Object.assign(i,P),P=null,f=\"fetchSettings\",Object.getOwnPropertyDescriptor(i,f)&&q(`\\`Module.${f}\\` was supplied but \\`${f}\\` not included in INCOMING_MODULE_JS_API`),i.arguments&&i.arguments,se(\"arguments\",\"arguments_\"),i.thisProgram&&(c=i.thisProgram),se(\"thisProgram\",\"thisProgram\"),I(void 0===i.memoryInitializerPrefixURL,\"Module.memoryInitializerPrefixURL option was removed, use Module.locateFile instead\"),I(void 0===i.pthreadMainPrefixURL,\"Module.pthreadMainPrefixURL option was removed, use Module.locateFile instead\"),I(void 0===i.cdInitializerPrefixURL,\"Module.cdInitializerPrefixURL option was removed, use Module.locateFile instead\"),I(void 0===i.filePackagePrefixURL,\"Module.filePackagePrefixURL option was removed, use Module.locateFile instead\"),I(void 0===i.read,\"Module.read option was removed\"),I(void 0===i.readAsync,\"Module.readAsync option was removed (modify readAsync in JS)\"),I(void 0===i.readBinary,\"Module.readBinary option was removed (modify readBinary in JS)\"),I(void 0===i.setWindowTitle,\"Module.setWindowTitle option was removed (modify emscripten_set_window_title in JS)\"),I(void 0===i.TOTAL_MEMORY,\"Module.TOTAL_MEMORY has been renamed Module.INITIAL_MEMORY\"),se(\"asm\",\"wasmExports\"),se(\"readAsync\",\"readAsync\"),se(\"readBinary\",\"readBinary\"),se(\"setWindowTitle\",\"setWindowTitle\");var G,S=i.wasmBinary;se(\"wasmBinary\",\"wasmBinary\"),\"object\"!=typeof WebAssembly&&E(\"no native wasm support detected\");var C,y,T,M,O,v,x,w,R=!1;function I(e,t){e||q(\"Assertion failed\"+(t?\": \"+t:\"\"))}function k(){var e=G.buffer;i.HEAP8=C=new Int8Array(e),i.HEAP16=T=new Int16Array(e),i.HEAPU8=y=new Uint8Array(e),i.HEAPU16=M=new Uint16Array(e),i.HEAP32=O=new Int32Array(e),i.HEAPU32=v=new Uint32Array(e),i.HEAPF32=x=new Float32Array(e),i.HEAPF64=w=new Float64Array(e)}function j(){if(!R){var e=dt();0==e&&(e+=4);var t=v[e>>2],n=v[e+4>>2];34821223==t&&2310721022==n||q(`Stack overflow! Stack cookie has been overwritten at ${_e(e)}, expected hex dwords 0x89BACDFE and 0x2135467, but received ${_e(n)} ${_e(t)}`),1668509029!=v[0]&&q(\"Runtime error: The application has corrupted its heap memory area (address zero)!\")}}I(!i.STACK_SIZE,\"STACK_SIZE can no longer be set at runtime. Use -sSTACK_SIZE at link time\"),I(\"undefined\"!=typeof Int32Array&&\"undefined\"!=typeof Float64Array&&null!=Int32Array.prototype.subarray&&null!=Int32Array.prototype.set,\"JS engine does not provide full typed array support\"),I(!i.wasmMemory,\"Use of `wasmMemory` detected. Use -sIMPORTED_MEMORY to define wasmMemory externally\"),I(!i.INITIAL_MEMORY,\"Detected runtime INITIAL_MEMORY setting. Use -sIMPORTED_MEMORY to define wasmMemory dynamically\");var L=[],B=[],N=[],U=!1;function V(e){L.unshift(e)}function z(e){N.unshift(e)}I(Math.imul,\"This browser does not support Math.imul(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill\"),I(Math.fround,\"This browser does not support Math.fround(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill\"),I(Math.clz32,\"This browser does not support Math.clz32(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill\"),I(Math.trunc,\"This browser does not support Math.trunc(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill\");var W=0,H=null,$=null,X={};function K(e){for(var t=e;;){if(!X[e])return e;e=t+Math.random()}}function Y(e){W++,i.monitorRunDependencies?.(W),e?(I(!X[e]),X[e]=1,null===H&&\"undefined\"!=typeof setInterval&&(H=setInterval((()=>{if(R)return clearInterval(H),void(H=null);var e=!1;for(var t in X)e||(e=!0,E(\"still waiting on run dependencies:\")),E(`dependency: ${t}`);e&&E(\"(end of list)\")}),1e4))):E(\"warning: run dependency added without ID\")}function J(e){if(W--,i.monitorRunDependencies?.(W),e?(I(X[e]),delete X[e]):E(\"warning: run dependency removed without ID\"),0==W&&(null!==H&&(clearInterval(H),H=null),$)){var t=$;$=null,t()}}function q(e){i.onAbort?.(e),E(e=\"Aborted(\"+e+\")\"),R=!0;var t=new WebAssembly.RuntimeError(e);throw o(t),t}var Q,Z,ee,te=e=>e.startsWith(\"data:application/octet-stream;base64,\"),ne=e=>e.startsWith(\"file://\");function re(e,t){return(...n)=>{I(U,`native function \\`${e}\\` called before runtime initialization`);var r=ot[e];return I(r,`exported native function \\`${e}\\` not found`),I(n.length<=t,`native function \\`${e}\\` called with ${n.length} args but expects ${t}`),r(...n)}}function oe(){if(i.locateFile){var e=\"pdfium.wasm\";return te(e)?e:(t=e,i.locateFile?i.locateFile(t,g):g+t)}var t;return m?\"pdfium.wasm\":\"pdfium.wasm\"}function ie(e){if(e==Q&&S)return new Uint8Array(S);if(_)return _(e);throw\"both async and sync fetching of the wasm failed\"}function ae(e,t,n){return function(e){return S?Promise.resolve().then((()=>ie(e))):d(e).then((e=>new Uint8Array(e)),(()=>ie(e)))}(e).then((e=>WebAssembly.instantiate(e,t))).then(n,(e=>{E(`failed to asynchronously prepare wasm: ${e}`),ne(Q)&&E(`warning: Loading from a file URI (${Q}) is not supported in most browsers. See https://emscripten.org/docs/getting_started/FAQ.html#how-do-i-run-a-local-webserver-for-testing-why-does-my-program-stall-in-downloading-or-preparing`),q(e)}))}if((()=>{var e=new Int16Array(1),t=new Int8Array(e.buffer);if(e[0]=25459,115!==t[0]||99!==t[1])throw\"Runtime error: expected the system to be little-endian! (Run with -sSUPPORT_BIG_ENDIAN to bypass)\"})(),i.ENVIRONMENT)throw new Error(\"Module.ENVIRONMENT has been deprecated. To force the environment, use the ENVIRONMENT compile-time option (for example, -sENVIRONMENT=web or -sENVIRONMENT=node)\");function se(e,t,n=!0){Object.getOwnPropertyDescriptor(i,e)||Object.defineProperty(i,e,{configurable:!0,get(){q(`\\`Module.${e}\\` has been replaced by \\`${t}\\``+(n?\" (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)\":\"\"))}})}function ue(e){return\"FS_createPath\"===e||\"FS_createDataFile\"===e||\"FS_createPreloadedFile\"===e||\"FS_unlink\"===e||\"addRunDependency\"===e||\"FS_createLazyFile\"===e||\"FS_createDevice\"===e||\"removeRunDependency\"===e}function Fe(e,t){\"undefined\"==typeof globalThis||Object.getOwnPropertyDescriptor(globalThis,e)||Object.defineProperty(globalThis,e,{configurable:!0,get(){t()}})}function me(e,t){Fe(e,(()=>{ge(`\\`${e}\\` is not longer defined by emscripten. ${t}`)}))}function le(e){Object.getOwnPropertyDescriptor(i,e)||Object.defineProperty(i,e,{configurable:!0,get(){var t=`'${e}' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the Emscripten FAQ)`;ue(e)&&(t+=\". Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you\"),q(t)}})}me(\"buffer\",\"Please use HEAP8.buffer or wasmMemory.buffer\"),me(\"asm\",\"Please use wasmExports instead\");var de=e=>{e.forEach((e=>e(i)))};i.noExitRuntime;var _e=e=>(I(\"number\"==typeof e),\"0x\"+(e>>>=0).toString(16).padStart(8,\"0\")),Pe=e=>_t(e),ce=()=>ct(),ge=e=>{ge.shown||={},ge.shown[e]||(ge.shown[e]=1,F&&(e=\"warning: \"+e),E(e))},he=\"undefined\"!=typeof TextDecoder?new TextDecoder:void 0,De=(e,t=0,n=NaN)=>{for(var r=t+n,o=t;e[o]&&!(o>=r);)++o;if(o-t>16&&e.buffer&&he)return he.decode(e.subarray(t,o));for(var i=\"\";t<o;){var a=e[t++];if(128&a){var s=63&e[t++];if(192!=(224&a)){var u=63&e[t++];if(224==(240&a)?a=(15&a)<<12|s<<6|u:(240!=(248&a)&&ge(\"Invalid UTF-8 leading byte \"+_e(a)+\" encountered when deserializing a UTF-8 string in wasm memory to a JS string!\"),a=(7&a)<<18|s<<12|u<<6|63&e[t++]),a<65536)i+=String.fromCharCode(a);else{var F=a-65536;i+=String.fromCharCode(55296|F>>10,56320|1023&F)}}else i+=String.fromCharCode((31&a)<<6|s)}else i+=String.fromCharCode(a)}return i},be=(e,t)=>(I(\"number\"==typeof e,`UTF8ToString expects a number (got ${typeof e})`),e?De(y,e,t):\"\");function pe(){I(null!=Be.varargs);var e=O[+Be.varargs>>2];return Be.varargs+=4,e}var fe=pe,Ae={isAbs:e=>\"/\"===e.charAt(0),splitPath:e=>/^(\\/?|)([\\s\\S]*?)((?:\\.{1,2}|[^\\/]+?|)(\\.[^.\\/]*|))(?:[\\/]*)$/.exec(e).slice(1),normalizeArray:(e,t)=>{for(var n=0,r=e.length-1;r>=0;r--){var o=e[r];\".\"===o?e.splice(r,1):\"..\"===o?(e.splice(r,1),n++):n&&(e.splice(r,1),n--)}if(t)for(;n;n--)e.unshift(\"..\");return e},normalize:e=>{var t=Ae.isAbs(e),n=\"/\"===e.substr(-1);return(e=Ae.normalizeArray(e.split(\"/\").filter((e=>!!e)),!t).join(\"/\"))||t||(e=\".\"),e&&n&&(e+=\"/\"),(t?\"/\":\"\")+e},dirname:e=>{var t=Ae.splitPath(e),n=t[0],r=t[1];return n||r?(r&&(r=r.substr(0,r.length-1)),n+r):\".\"},basename:e=>{if(\"/\"===e)return\"/\";var t=(e=(e=Ae.normalize(e)).replace(/\\/$/,\"\")).lastIndexOf(\"/\");return-1===t?e:e.substr(t+1)},join:(...e)=>Ae.normalize(e.join(\"/\")),join2:(e,t)=>Ae.normalize(e+\"/\"+t)},Ee=e=>(Ee=(()=>{if(\"object\"==typeof crypto&&\"function\"==typeof crypto.getRandomValues)return e=>crypto.getRandomValues(e);if(F)try{var e=l(\"crypto\");if(e.randomFillSync)return t=>e.randomFillSync(t);var t=e.randomBytes;return e=>(e.set(t(e.byteLength)),e)}catch(e){}q(\"no cryptographic support found for randomDevice. consider polyfilling it if you want to use something insecure like Math.random(), e.g. put this in a --pre-js: var crypto = { getRandomValues: (array) => { for (var i = 0; i < array.length; i++) array[i] = (Math.random()*256)|0 } };\")})())(e),Ge={resolve:(...e)=>{for(var t=\"\",n=!1,r=e.length-1;r>=-1&&!n;r--){var o=r>=0?e[r]:Le.cwd();if(\"string\"!=typeof o)throw new TypeError(\"Arguments to path.resolve must be strings\");if(!o)return\"\";t=o+\"/\"+t,n=Ae.isAbs(o)}return(n?\"/\":\"\")+(t=Ae.normalizeArray(t.split(\"/\").filter((e=>!!e)),!n).join(\"/\"))||\".\"},relative:(e,t)=>{function n(e){for(var t=0;t<e.length&&\"\"===e[t];t++);for(var n=e.length-1;n>=0&&\"\"===e[n];n--);return t>n?[]:e.slice(t,n-t+1)}e=Ge.resolve(e).substr(1),t=Ge.resolve(t).substr(1);for(var r=n(e.split(\"/\")),o=n(t.split(\"/\")),i=Math.min(r.length,o.length),a=i,s=0;s<i;s++)if(r[s]!==o[s]){a=s;break}var u=[];for(s=a;s<r.length;s++)u.push(\"..\");return(u=u.concat(o.slice(a))).join(\"/\")}},Se=[],Ce=e=>{for(var t=0,n=0;n<e.length;++n){var r=e.charCodeAt(n);r<=127?t++:r<=2047?t+=2:r>=55296&&r<=57343?(t+=4,++n):t+=3}return t},ye=(e,t,n,r)=>{if(I(\"string\"==typeof e,`stringToUTF8Array expects a string (got ${typeof e})`),!(r>0))return 0;for(var o=n,i=n+r-1,a=0;a<e.length;++a){var s=e.charCodeAt(a);if(s>=55296&&s<=57343&&(s=65536+((1023&s)<<10)|1023&e.charCodeAt(++a)),s<=127){if(n>=i)break;t[n++]=s}else if(s<=2047){if(n+1>=i)break;t[n++]=192|s>>6,t[n++]=128|63&s}else if(s<=65535){if(n+2>=i)break;t[n++]=224|s>>12,t[n++]=128|s>>6&63,t[n++]=128|63&s}else{if(n+3>=i)break;s>1114111&&ge(\"Invalid Unicode code point \"+_e(s)+\" encountered when serializing a JS string to a UTF-8 string in wasm memory! (Valid unicode code points should be in range 0-0x10FFFF).\"),t[n++]=240|s>>18,t[n++]=128|s>>12&63,t[n++]=128|s>>6&63,t[n++]=128|63&s}}return t[n]=0,n-o};function Te(e,t,n){var r=n>0?n:Ce(e)+1,o=new Array(r),i=ye(e,o,0,o.length);return t&&(o.length=i),o}var Me,Oe,ve={ttys:[],init(){},shutdown(){},register(e,t){ve.ttys[e]={input:[],output:[],ops:t},Le.registerDevice(e,ve.stream_ops)},stream_ops:{open(e){var t=ve.ttys[e.node.rdev];if(!t)throw new Le.ErrnoError(43);e.tty=t,e.seekable=!1},close(e){e.tty.ops.fsync(e.tty)},fsync(e){e.tty.ops.fsync(e.tty)},read(e,t,n,r,o){if(!e.tty||!e.tty.ops.get_char)throw new Le.ErrnoError(60);for(var i=0,a=0;a<r;a++){var s;try{s=e.tty.ops.get_char(e.tty)}catch(e){throw new Le.ErrnoError(29)}if(void 0===s&&0===i)throw new Le.ErrnoError(6);if(null==s)break;i++,t[n+a]=s}return i&&(e.node.timestamp=Date.now()),i},write(e,t,n,r,o){if(!e.tty||!e.tty.ops.put_char)throw new Le.ErrnoError(60);try{for(var i=0;i<r;i++)e.tty.ops.put_char(e.tty,t[n+i])}catch(e){throw new Le.ErrnoError(29)}return r&&(e.node.timestamp=Date.now()),i}},default_tty_ops:{get_char:e=>(()=>{if(!Se.length){var e=null;if(F){var t=Buffer.alloc(256),n=0,r=process.stdin.fd;try{n=b.readSync(r,t,0,256)}catch(e){if(!e.toString().includes(\"EOF\"))throw e;n=0}n>0&&(e=t.slice(0,n).toString(\"utf-8\"))}else\"undefined\"!=typeof window&&\"function\"==typeof window.prompt?null!==(e=window.prompt(\"Input: \"))&&(e+=\"\\n\"):\"function\"==typeof readline&&(e=readline())&&(e+=\"\\n\");if(!e)return null;Se=Te(e,!0)}return Se.shift()})(),put_char(e,t){null===t||10===t?(A(De(e.output)),e.output=[]):0!=t&&e.output.push(t)},fsync(e){e.output&&e.output.length>0&&(A(De(e.output)),e.output=[])},ioctl_tcgets:e=>({c_iflag:25856,c_oflag:5,c_cflag:191,c_lflag:35387,c_cc:[3,28,127,21,4,0,1,0,17,19,26,0,18,15,23,22,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}),ioctl_tcsets:(e,t,n)=>0,ioctl_tiocgwinsz:e=>[24,80]},default_tty1_ops:{put_char(e,t){null===t||10===t?(E(De(e.output)),e.output=[]):0!=t&&e.output.push(t)},fsync(e){e.output&&e.output.length>0&&(E(De(e.output)),e.output=[])}}},xe=(e,t)=>(I(t,\"alignment argument is required\"),Math.ceil(e/t)*t),we=e=>{e=xe(e,65536);var t=ut(65536,e);return t&&((e,t)=>{y.fill(0,e,e+t)})(t,e),t},Re={ops_table:null,mount:e=>Re.createNode(null,\"/\",16895,0),createNode(e,t,n,r){if(Le.isBlkdev(n)||Le.isFIFO(n))throw new Le.ErrnoError(63);Re.ops_table||={dir:{node:{getattr:Re.node_ops.getattr,setattr:Re.node_ops.setattr,lookup:Re.node_ops.lookup,mknod:Re.node_ops.mknod,rename:Re.node_ops.rename,unlink:Re.node_ops.unlink,rmdir:Re.node_ops.rmdir,readdir:Re.node_ops.readdir,symlink:Re.node_ops.symlink},stream:{llseek:Re.stream_ops.llseek}},file:{node:{getattr:Re.node_ops.getattr,setattr:Re.node_ops.setattr},stream:{llseek:Re.stream_ops.llseek,read:Re.stream_ops.read,write:Re.stream_ops.write,allocate:Re.stream_ops.allocate,mmap:Re.stream_ops.mmap,msync:Re.stream_ops.msync}},link:{node:{getattr:Re.node_ops.getattr,setattr:Re.node_ops.setattr,readlink:Re.node_ops.readlink},stream:{}},chrdev:{node:{getattr:Re.node_ops.getattr,setattr:Re.node_ops.setattr},stream:Le.chrdev_stream_ops}};var o=Le.createNode(e,t,n,r);return Le.isDir(o.mode)?(o.node_ops=Re.ops_table.dir.node,o.stream_ops=Re.ops_table.dir.stream,o.contents={}):Le.isFile(o.mode)?(o.node_ops=Re.ops_table.file.node,o.stream_ops=Re.ops_table.file.stream,o.usedBytes=0,o.contents=null):Le.isLink(o.mode)?(o.node_ops=Re.ops_table.link.node,o.stream_ops=Re.ops_table.link.stream):Le.isChrdev(o.mode)&&(o.node_ops=Re.ops_table.chrdev.node,o.stream_ops=Re.ops_table.chrdev.stream),o.timestamp=Date.now(),e&&(e.contents[t]=o,e.timestamp=o.timestamp),o},getFileDataAsTypedArray:e=>e.contents?e.contents.subarray?e.contents.subarray(0,e.usedBytes):new Uint8Array(e.contents):new Uint8Array(0),expandFileStorage(e,t){var n=e.contents?e.contents.length:0;if(!(n>=t)){t=Math.max(t,n*(n<1048576?2:1.125)>>>0),0!=n&&(t=Math.max(t,256));var r=e.contents;e.contents=new Uint8Array(t),e.usedBytes>0&&e.contents.set(r.subarray(0,e.usedBytes),0)}},resizeFileStorage(e,t){if(e.usedBytes!=t)if(0==t)e.contents=null,e.usedBytes=0;else{var n=e.contents;e.contents=new Uint8Array(t),n&&e.contents.set(n.subarray(0,Math.min(t,e.usedBytes))),e.usedBytes=t}},node_ops:{getattr(e){var t={};return t.dev=Le.isChrdev(e.mode)?e.id:1,t.ino=e.id,t.mode=e.mode,t.nlink=1,t.uid=0,t.gid=0,t.rdev=e.rdev,Le.isDir(e.mode)?t.size=4096:Le.isFile(e.mode)?t.size=e.usedBytes:Le.isLink(e.mode)?t.size=e.link.length:t.size=0,t.atime=new Date(e.timestamp),t.mtime=new Date(e.timestamp),t.ctime=new Date(e.timestamp),t.blksize=4096,t.blocks=Math.ceil(t.size/t.blksize),t},setattr(e,t){void 0!==t.mode&&(e.mode=t.mode),void 0!==t.timestamp&&(e.timestamp=t.timestamp),void 0!==t.size&&Re.resizeFileStorage(e,t.size)},lookup(e,t){throw Le.genericErrors[44]},mknod:(e,t,n,r)=>Re.createNode(e,t,n,r),rename(e,t,n){if(Le.isDir(e.mode)){var r;try{r=Le.lookupNode(t,n)}catch(e){}if(r)for(var o in r.contents)throw new Le.ErrnoError(55)}delete e.parent.contents[e.name],e.parent.timestamp=Date.now(),e.name=n,t.contents[n]=e,t.timestamp=e.parent.timestamp},unlink(e,t){delete e.contents[t],e.timestamp=Date.now()},rmdir(e,t){var n=Le.lookupNode(e,t);for(var r in n.contents)throw new Le.ErrnoError(55);delete e.contents[t],e.timestamp=Date.now()},readdir(e){var t=[\".\",\"..\"];for(var n of Object.keys(e.contents))t.push(n);return t},symlink(e,t,n){var r=Re.createNode(e,t,41471,0);return r.link=n,r},readlink(e){if(!Le.isLink(e.mode))throw new Le.ErrnoError(28);return e.link}},stream_ops:{read(e,t,n,r,o){var i=e.node.contents;if(o>=e.node.usedBytes)return 0;var a=Math.min(e.node.usedBytes-o,r);if(I(a>=0),a>8&&i.subarray)t.set(i.subarray(o,o+a),n);else for(var s=0;s<a;s++)t[n+s]=i[o+s];return a},write(e,t,n,r,o,i){if(I(!(t instanceof ArrayBuffer)),t.buffer===C.buffer&&(i=!1),!r)return 0;var a=e.node;if(a.timestamp=Date.now(),t.subarray&&(!a.contents||a.contents.subarray)){if(i)return I(0===o,\"canOwn must imply no weird position inside the file\"),a.contents=t.subarray(n,n+r),a.usedBytes=r,r;if(0===a.usedBytes&&0===o)return a.contents=t.slice(n,n+r),a.usedBytes=r,r;if(o+r<=a.usedBytes)return a.contents.set(t.subarray(n,n+r),o),r}if(Re.expandFileStorage(a,o+r),a.contents.subarray&&t.subarray)a.contents.set(t.subarray(n,n+r),o);else for(var s=0;s<r;s++)a.contents[o+s]=t[n+s];return a.usedBytes=Math.max(a.usedBytes,o+r),r},llseek(e,t,n){var r=t;if(1===n?r+=e.position:2===n&&Le.isFile(e.node.mode)&&(r+=e.node.usedBytes),r<0)throw new Le.ErrnoError(28);return r},allocate(e,t,n){Re.expandFileStorage(e.node,t+n),e.node.usedBytes=Math.max(e.node.usedBytes,t+n)},mmap(e,t,n,r,o){if(!Le.isFile(e.node.mode))throw new Le.ErrnoError(43);var i,a,s=e.node.contents;if(2&o||!s||s.buffer!==C.buffer){if(a=!0,!(i=we(t)))throw new Le.ErrnoError(48);s&&((n>0||n+t<s.length)&&(s=s.subarray?s.subarray(n,n+t):Array.prototype.slice.call(s,n,n+t)),C.set(s,i))}else a=!1,i=s.byteOffset;return{ptr:i,allocated:a}},msync:(e,t,n,r,o)=>(Re.stream_ops.write(e,t,0,r,n,!1),0)}},Ie=i.preloadPlugins||[],ke=(e,t)=>{var n=0;return e&&(n|=365),t&&(n|=146),n},je={EPERM:63,ENOENT:44,ESRCH:71,EINTR:27,EIO:29,ENXIO:60,E2BIG:1,ENOEXEC:45,EBADF:8,ECHILD:12,EAGAIN:6,EWOULDBLOCK:6,ENOMEM:48,EACCES:2,EFAULT:21,ENOTBLK:105,EBUSY:10,EEXIST:20,EXDEV:75,ENODEV:43,ENOTDIR:54,EISDIR:31,EINVAL:28,ENFILE:41,EMFILE:33,ENOTTY:59,ETXTBSY:74,EFBIG:22,ENOSPC:51,ESPIPE:70,EROFS:69,EMLINK:34,EPIPE:64,EDOM:18,ERANGE:68,ENOMSG:49,EIDRM:24,ECHRNG:106,EL2NSYNC:156,EL3HLT:107,EL3RST:108,ELNRNG:109,EUNATCH:110,ENOCSI:111,EL2HLT:112,EDEADLK:16,ENOLCK:46,EBADE:113,EBADR:114,EXFULL:115,ENOANO:104,EBADRQC:103,EBADSLT:102,EDEADLOCK:16,EBFONT:101,ENOSTR:100,ENODATA:116,ETIME:117,ENOSR:118,ENONET:119,ENOPKG:120,EREMOTE:121,ENOLINK:47,EADV:122,ESRMNT:123,ECOMM:124,EPROTO:65,EMULTIHOP:36,EDOTDOT:125,EBADMSG:9,ENOTUNIQ:126,EBADFD:127,EREMCHG:128,ELIBACC:129,ELIBBAD:130,ELIBSCN:131,ELIBMAX:132,ELIBEXEC:133,ENOSYS:52,ENOTEMPTY:55,ENAMETOOLONG:37,ELOOP:32,EOPNOTSUPP:138,EPFNOSUPPORT:139,ECONNRESET:15,ENOBUFS:42,EAFNOSUPPORT:5,EPROTOTYPE:67,ENOTSOCK:57,ENOPROTOOPT:50,ESHUTDOWN:140,ECONNREFUSED:14,EADDRINUSE:3,ECONNABORTED:13,ENETUNREACH:40,ENETDOWN:38,ETIMEDOUT:73,EHOSTDOWN:142,EHOSTUNREACH:23,EINPROGRESS:26,EALREADY:7,EDESTADDRREQ:17,EMSGSIZE:35,EPROTONOSUPPORT:66,ESOCKTNOSUPPORT:137,EADDRNOTAVAIL:4,ENETRESET:39,EISCONN:30,ENOTCONN:53,ETOOMANYREFS:141,EUSERS:136,EDQUOT:19,ESTALE:72,ENOTSUP:138,ENOMEDIUM:148,EILSEQ:25,EOVERFLOW:61,ECANCELED:11,ENOTRECOVERABLE:56,EOWNERDEAD:62,ESTRPIPE:135},Le={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:\"/\",initialized:!1,ignorePermissions:!0,ErrnoError:class extends Error{constructor(e){for(var t in super(U?(e=>be(Ft(e)))(e):\"\"),this.name=\"ErrnoError\",this.errno=e,je)if(je[t]===e){this.code=t;break}}},genericErrors:{},filesystems:null,syncFSRequests:0,readFiles:{},FSStream:class{constructor(){this.shared={}}get object(){return this.node}set object(e){this.node=e}get isRead(){return 1!=(2097155&this.flags)}get isWrite(){return!!(2097155&this.flags)}get isAppend(){return 1024&this.flags}get flags(){return this.shared.flags}set flags(e){this.shared.flags=e}get position(){return this.shared.position}set position(e){this.shared.position=e}},FSNode:class{constructor(e,t,n,r){e||(e=this),this.parent=e,this.mount=e.mount,this.mounted=null,this.id=Le.nextInode++,this.name=t,this.mode=n,this.node_ops={},this.stream_ops={},this.rdev=r,this.readMode=365,this.writeMode=146}get read(){return(this.mode&this.readMode)===this.readMode}set read(e){e?this.mode|=this.readMode:this.mode&=~this.readMode}get write(){return(this.mode&this.writeMode)===this.writeMode}set write(e){e?this.mode|=this.writeMode:this.mode&=~this.writeMode}get isFolder(){return Le.isDir(this.mode)}get isDevice(){return Le.isChrdev(this.mode)}},lookupPath(e,t={}){if(!(e=Ge.resolve(e)))return{path:\"\",node:null};if((t=Object.assign({follow_mount:!0,recurse_count:0},t)).recurse_count>8)throw new Le.ErrnoError(32);for(var n=e.split(\"/\").filter((e=>!!e)),r=Le.root,o=\"/\",i=0;i<n.length;i++){var a=i===n.length-1;if(a&&t.parent)break;if(r=Le.lookupNode(r,n[i]),o=Ae.join2(o,n[i]),Le.isMountpoint(r)&&(!a||a&&t.follow_mount)&&(r=r.mounted.root),!a||t.follow)for(var s=0;Le.isLink(r.mode);){var u=Le.readlink(o);if(o=Ge.resolve(Ae.dirname(o),u),r=Le.lookupPath(o,{recurse_count:t.recurse_count+1}).node,s++>40)throw new Le.ErrnoError(32)}}return{path:o,node:r}},getPath(e){for(var t;;){if(Le.isRoot(e)){var n=e.mount.mountpoint;return t?\"/\"!==n[n.length-1]?`${n}/${t}`:n+t:n}t=t?`${e.name}/${t}`:e.name,e=e.parent}},hashName(e,t){for(var n=0,r=0;r<t.length;r++)n=(n<<5)-n+t.charCodeAt(r)|0;return(e+n>>>0)%Le.nameTable.length},hashAddNode(e){var t=Le.hashName(e.parent.id,e.name);e.name_next=Le.nameTable[t],Le.nameTable[t]=e},hashRemoveNode(e){var t=Le.hashName(e.parent.id,e.name);if(Le.nameTable[t]===e)Le.nameTable[t]=e.name_next;else for(var n=Le.nameTable[t];n;){if(n.name_next===e){n.name_next=e.name_next;break}n=n.name_next}},lookupNode(e,t){var n=Le.mayLookup(e);if(n)throw new Le.ErrnoError(n);for(var r=Le.hashName(e.id,t),o=Le.nameTable[r];o;o=o.name_next){var i=o.name;if(o.parent.id===e.id&&i===t)return o}return Le.lookup(e,t)},createNode(e,t,n,r){I(\"object\"==typeof e);var o=new Le.FSNode(e,t,n,r);return Le.hashAddNode(o),o},destroyNode(e){Le.hashRemoveNode(e)},isRoot:e=>e===e.parent,isMountpoint:e=>!!e.mounted,isFile:e=>32768==(61440&e),isDir:e=>16384==(61440&e),isLink:e=>40960==(61440&e),isChrdev:e=>8192==(61440&e),isBlkdev:e=>24576==(61440&e),isFIFO:e=>4096==(61440&e),isSocket:e=>!(49152&~e),flagsToPermissionString(e){var t=[\"r\",\"w\",\"rw\"][3&e];return 512&e&&(t+=\"w\"),t},nodePermissions:(e,t)=>Le.ignorePermissions||(!t.includes(\"r\")||292&e.mode)&&(!t.includes(\"w\")||146&e.mode)&&(!t.includes(\"x\")||73&e.mode)?0:2,mayLookup(e){if(!Le.isDir(e.mode))return 54;var t=Le.nodePermissions(e,\"x\");return t||(e.node_ops.lookup?0:2)},mayCreate(e,t){try{return Le.lookupNode(e,t),20}catch(e){}return Le.nodePermissions(e,\"wx\")},mayDelete(e,t,n){var r;try{r=Le.lookupNode(e,t)}catch(e){return e.errno}var o=Le.nodePermissions(e,\"wx\");if(o)return o;if(n){if(!Le.isDir(r.mode))return 54;if(Le.isRoot(r)||Le.getPath(r)===Le.cwd())return 10}else if(Le.isDir(r.mode))return 31;return 0},mayOpen:(e,t)=>e?Le.isLink(e.mode)?32:Le.isDir(e.mode)&&(\"r\"!==Le.flagsToPermissionString(t)||512&t)?31:Le.nodePermissions(e,Le.flagsToPermissionString(t)):44,MAX_OPEN_FDS:4096,nextfd(){for(var e=0;e<=Le.MAX_OPEN_FDS;e++)if(!Le.streams[e])return e;throw new Le.ErrnoError(33)},getStreamChecked(e){var t=Le.getStream(e);if(!t)throw new Le.ErrnoError(8);return t},getStream:e=>Le.streams[e],createStream:(e,t=-1)=>(I(t>=-1),e=Object.assign(new Le.FSStream,e),-1==t&&(t=Le.nextfd()),e.fd=t,Le.streams[t]=e,e),closeStream(e){Le.streams[e]=null},dupStream(e,t=-1){var n=Le.createStream(e,t);return n.stream_ops?.dup?.(n),n},chrdev_stream_ops:{open(e){var t=Le.getDevice(e.node.rdev);e.stream_ops=t.stream_ops,e.stream_ops.open?.(e)},llseek(){throw new Le.ErrnoError(70)}},major:e=>e>>8,minor:e=>255&e,makedev:(e,t)=>e<<8|t,registerDevice(e,t){Le.devices[e]={stream_ops:t}},getDevice:e=>Le.devices[e],getMounts(e){for(var t=[],n=[e];n.length;){var r=n.pop();t.push(r),n.push(...r.mounts)}return t},syncfs(e,t){\"function\"==typeof e&&(t=e,e=!1),Le.syncFSRequests++,Le.syncFSRequests>1&&E(`warning: ${Le.syncFSRequests} FS.syncfs operations in flight at once, probably just doing extra work`);var n=Le.getMounts(Le.root.mount),r=0;function o(e){return I(Le.syncFSRequests>0),Le.syncFSRequests--,t(e)}function i(e){if(e)return i.errored?void 0:(i.errored=!0,o(e));++r>=n.length&&o(null)}n.forEach((t=>{if(!t.type.syncfs)return i(null);t.type.syncfs(t,e,i)}))},mount(e,t,n){if(\"string\"==typeof e)throw e;var r,o=\"/\"===n,i=!n;if(o&&Le.root)throw new Le.ErrnoError(10);if(!o&&!i){var a=Le.lookupPath(n,{follow_mount:!1});if(n=a.path,r=a.node,Le.isMountpoint(r))throw new Le.ErrnoError(10);if(!Le.isDir(r.mode))throw new Le.ErrnoError(54)}var s={type:e,opts:t,mountpoint:n,mounts:[]},u=e.mount(s);return u.mount=s,s.root=u,o?Le.root=u:r&&(r.mounted=s,r.mount&&r.mount.mounts.push(s)),u},unmount(e){var t=Le.lookupPath(e,{follow_mount:!1});if(!Le.isMountpoint(t.node))throw new Le.ErrnoError(28);var n=t.node,r=n.mounted,o=Le.getMounts(r);Object.keys(Le.nameTable).forEach((e=>{for(var t=Le.nameTable[e];t;){var n=t.name_next;o.includes(t.mount)&&Le.destroyNode(t),t=n}})),n.mounted=null;var i=n.mount.mounts.indexOf(r);I(-1!==i),n.mount.mounts.splice(i,1)},lookup:(e,t)=>e.node_ops.lookup(e,t),mknod(e,t,n){var r=Le.lookupPath(e,{parent:!0}).node,o=Ae.basename(e);if(!o||\".\"===o||\"..\"===o)throw new Le.ErrnoError(28);var i=Le.mayCreate(r,o);if(i)throw new Le.ErrnoError(i);if(!r.node_ops.mknod)throw new Le.ErrnoError(63);return r.node_ops.mknod(r,o,t,n)},create:(e,t)=>(t=void 0!==t?t:438,t&=4095,t|=32768,Le.mknod(e,t,0)),mkdir:(e,t)=>(t=void 0!==t?t:511,t&=1023,t|=16384,Le.mknod(e,t,0)),mkdirTree(e,t){for(var n=e.split(\"/\"),r=\"\",o=0;o<n.length;++o)if(n[o]){r+=\"/\"+n[o];try{Le.mkdir(r,t)}catch(e){if(20!=e.errno)throw e}}},mkdev:(e,t,n)=>(void 0===n&&(n=t,t=438),t|=8192,Le.mknod(e,t,n)),symlink(e,t){if(!Ge.resolve(e))throw new Le.ErrnoError(44);var n=Le.lookupPath(t,{parent:!0}).node;if(!n)throw new Le.ErrnoError(44);var r=Ae.basename(t),o=Le.mayCreate(n,r);if(o)throw new Le.ErrnoError(o);if(!n.node_ops.symlink)throw new Le.ErrnoError(63);return n.node_ops.symlink(n,r,e)},rename(e,t){var n,r,o=Ae.dirname(e),i=Ae.dirname(t),a=Ae.basename(e),s=Ae.basename(t);if(n=Le.lookupPath(e,{parent:!0}).node,r=Le.lookupPath(t,{parent:!0}).node,!n||!r)throw new Le.ErrnoError(44);if(n.mount!==r.mount)throw new Le.ErrnoError(75);var u,F=Le.lookupNode(n,a),m=Ge.relative(e,i);if(\".\"!==m.charAt(0))throw new Le.ErrnoError(28);if(\".\"!==(m=Ge.relative(t,o)).charAt(0))throw new Le.ErrnoError(55);try{u=Le.lookupNode(r,s)}catch(e){}if(F!==u){var l=Le.isDir(F.mode),d=Le.mayDelete(n,a,l);if(d)throw new Le.ErrnoError(d);if(d=u?Le.mayDelete(r,s,l):Le.mayCreate(r,s))throw new Le.ErrnoError(d);if(!n.node_ops.rename)throw new Le.ErrnoError(63);if(Le.isMountpoint(F)||u&&Le.isMountpoint(u))throw new Le.ErrnoError(10);if(r!==n&&(d=Le.nodePermissions(n,\"w\")))throw new Le.ErrnoError(d);Le.hashRemoveNode(F);try{n.node_ops.rename(F,r,s),F.parent=r}catch(e){throw e}finally{Le.hashAddNode(F)}}},rmdir(e){var t=Le.lookupPath(e,{parent:!0}).node,n=Ae.basename(e),r=Le.lookupNode(t,n),o=Le.mayDelete(t,n,!0);if(o)throw new Le.ErrnoError(o);if(!t.node_ops.rmdir)throw new Le.ErrnoError(63);if(Le.isMountpoint(r))throw new Le.ErrnoError(10);t.node_ops.rmdir(t,n),Le.destroyNode(r)},readdir(e){var t=Le.lookupPath(e,{follow:!0}).node;if(!t.node_ops.readdir)throw new Le.ErrnoError(54);return t.node_ops.readdir(t)},unlink(e){var t=Le.lookupPath(e,{parent:!0}).node;if(!t)throw new Le.ErrnoError(44);var n=Ae.basename(e),r=Le.lookupNode(t,n),o=Le.mayDelete(t,n,!1);if(o)throw new Le.ErrnoError(o);if(!t.node_ops.unlink)throw new Le.ErrnoError(63);if(Le.isMountpoint(r))throw new Le.ErrnoError(10);t.node_ops.unlink(t,n),Le.destroyNode(r)},readlink(e){var t=Le.lookupPath(e).node;if(!t)throw new Le.ErrnoError(44);if(!t.node_ops.readlink)throw new Le.ErrnoError(28);return Ge.resolve(Le.getPath(t.parent),t.node_ops.readlink(t))},stat(e,t){var n=Le.lookupPath(e,{follow:!t}).node;if(!n)throw new Le.ErrnoError(44);if(!n.node_ops.getattr)throw new Le.ErrnoError(63);return n.node_ops.getattr(n)},lstat:e=>Le.stat(e,!0),chmod(e,t,n){var r;if(!(r=\"string\"==typeof e?Le.lookupPath(e,{follow:!n}).node:e).node_ops.setattr)throw new Le.ErrnoError(63);r.node_ops.setattr(r,{mode:4095&t|-4096&r.mode,timestamp:Date.now()})},lchmod(e,t){Le.chmod(e,t,!0)},fchmod(e,t){var n=Le.getStreamChecked(e);Le.chmod(n.node,t)},chown(e,t,n,r){var o;if(!(o=\"string\"==typeof e?Le.lookupPath(e,{follow:!r}).node:e).node_ops.setattr)throw new Le.ErrnoError(63);o.node_ops.setattr(o,{timestamp:Date.now()})},lchown(e,t,n){Le.chown(e,t,n,!0)},fchown(e,t,n){var r=Le.getStreamChecked(e);Le.chown(r.node,t,n)},truncate(e,t){if(t<0)throw new Le.ErrnoError(28);var n;if(!(n=\"string\"==typeof e?Le.lookupPath(e,{follow:!0}).node:e).node_ops.setattr)throw new Le.ErrnoError(63);if(Le.isDir(n.mode))throw new Le.ErrnoError(31);if(!Le.isFile(n.mode))throw new Le.ErrnoError(28);var r=Le.nodePermissions(n,\"w\");if(r)throw new Le.ErrnoError(r);n.node_ops.setattr(n,{size:t,timestamp:Date.now()})},ftruncate(e,t){var n=Le.getStreamChecked(e);if(!(2097155&n.flags))throw new Le.ErrnoError(28);Le.truncate(n.node,t)},utime(e,t,n){var r=Le.lookupPath(e,{follow:!0}).node;r.node_ops.setattr(r,{timestamp:Math.max(t,n)})},open(e,t,n){if(\"\"===e)throw new Le.ErrnoError(44);var r;if(n=64&(t=\"string\"==typeof t?(e=>{var t={r:0,\"r+\":2,w:577,\"w+\":578,a:1089,\"a+\":1090}[e];if(void 0===t)throw new Error(`Unknown file open mode: ${e}`);return t})(t):t)?4095&(n=void 0===n?438:n)|32768:0,\"object\"==typeof e)r=e;else{e=Ae.normalize(e);try{r=Le.lookupPath(e,{follow:!(131072&t)}).node}catch(e){}}var o=!1;if(64&t)if(r){if(128&t)throw new Le.ErrnoError(20)}else r=Le.mknod(e,n,0),o=!0;if(!r)throw new Le.ErrnoError(44);if(Le.isChrdev(r.mode)&&(t&=-513),65536&t&&!Le.isDir(r.mode))throw new Le.ErrnoError(54);if(!o){var a=Le.mayOpen(r,t);if(a)throw new Le.ErrnoError(a)}512&t&&!o&&Le.truncate(r,0),t&=-131713;var s=Le.createStream({node:r,path:Le.getPath(r),flags:t,seekable:!0,position:0,stream_ops:r.stream_ops,ungotten:[],error:!1});return s.stream_ops.open&&s.stream_ops.open(s),!i.logReadFiles||1&t||e in Le.readFiles||(Le.readFiles[e]=1),s},close(e){if(Le.isClosed(e))throw new Le.ErrnoError(8);e.getdents&&(e.getdents=null);try{e.stream_ops.close&&e.stream_ops.close(e)}catch(e){throw e}finally{Le.closeStream(e.fd)}e.fd=null},isClosed:e=>null===e.fd,llseek(e,t,n){if(Le.isClosed(e))throw new Le.ErrnoError(8);if(!e.seekable||!e.stream_ops.llseek)throw new Le.ErrnoError(70);if(0!=n&&1!=n&&2!=n)throw new Le.ErrnoError(28);return e.position=e.stream_ops.llseek(e,t,n),e.ungotten=[],e.position},read(e,t,n,r,o){if(I(n>=0),r<0||o<0)throw new Le.ErrnoError(28);if(Le.isClosed(e))throw new Le.ErrnoError(8);if(1==(2097155&e.flags))throw new Le.ErrnoError(8);if(Le.isDir(e.node.mode))throw new Le.ErrnoError(31);if(!e.stream_ops.read)throw new Le.ErrnoError(28);var i=void 0!==o;if(i){if(!e.seekable)throw new Le.ErrnoError(70)}else o=e.position;var a=e.stream_ops.read(e,t,n,r,o);return i||(e.position+=a),a},write(e,t,n,r,o,i){if(I(n>=0),r<0||o<0)throw new Le.ErrnoError(28);if(Le.isClosed(e))throw new Le.ErrnoError(8);if(!(2097155&e.flags))throw new Le.ErrnoError(8);if(Le.isDir(e.node.mode))throw new Le.ErrnoError(31);if(!e.stream_ops.write)throw new Le.ErrnoError(28);e.seekable&&1024&e.flags&&Le.llseek(e,0,2);var a=void 0!==o;if(a){if(!e.seekable)throw new Le.ErrnoError(70)}else o=e.position;var s=e.stream_ops.write(e,t,n,r,o,i);return a||(e.position+=s),s},allocate(e,t,n){if(Le.isClosed(e))throw new Le.ErrnoError(8);if(t<0||n<=0)throw new Le.ErrnoError(28);if(!(2097155&e.flags))throw new Le.ErrnoError(8);if(!Le.isFile(e.node.mode)&&!Le.isDir(e.node.mode))throw new Le.ErrnoError(43);if(!e.stream_ops.allocate)throw new Le.ErrnoError(138);e.stream_ops.allocate(e,t,n)},mmap(e,t,n,r,o){if(2&r&&!(2&o)&&2!=(2097155&e.flags))throw new Le.ErrnoError(2);if(1==(2097155&e.flags))throw new Le.ErrnoError(2);if(!e.stream_ops.mmap)throw new Le.ErrnoError(43);if(!t)throw new Le.ErrnoError(28);return e.stream_ops.mmap(e,t,n,r,o)},msync:(e,t,n,r,o)=>(I(n>=0),e.stream_ops.msync?e.stream_ops.msync(e,t,n,r,o):0),ioctl(e,t,n){if(!e.stream_ops.ioctl)throw new Le.ErrnoError(59);return e.stream_ops.ioctl(e,t,n)},readFile(e,t={}){if(t.flags=t.flags||0,t.encoding=t.encoding||\"binary\",\"utf8\"!==t.encoding&&\"binary\"!==t.encoding)throw new Error(`Invalid encoding type \"${t.encoding}\"`);var n,r=Le.open(e,t.flags),o=Le.stat(e).size,i=new Uint8Array(o);return Le.read(r,i,0,o,0),\"utf8\"===t.encoding?n=De(i):\"binary\"===t.encoding&&(n=i),Le.close(r),n},writeFile(e,t,n={}){n.flags=n.flags||577;var r=Le.open(e,n.flags,n.mode);if(\"string\"==typeof t){var o=new Uint8Array(Ce(t)+1),i=ye(t,o,0,o.length);Le.write(r,o,0,i,void 0,n.canOwn)}else{if(!ArrayBuffer.isView(t))throw new Error(\"Unsupported data type\");Le.write(r,t,0,t.byteLength,void 0,n.canOwn)}Le.close(r)},cwd:()=>Le.currentPath,chdir(e){var t=Le.lookupPath(e,{follow:!0});if(null===t.node)throw new Le.ErrnoError(44);if(!Le.isDir(t.node.mode))throw new Le.ErrnoError(54);var n=Le.nodePermissions(t.node,\"x\");if(n)throw new Le.ErrnoError(n);Le.currentPath=t.path},createDefaultDirectories(){Le.mkdir(\"/tmp\"),Le.mkdir(\"/home\"),Le.mkdir(\"/home/web_user\")},createDefaultDevices(){Le.mkdir(\"/dev\"),Le.registerDevice(Le.makedev(1,3),{read:()=>0,write:(e,t,n,r,o)=>r}),Le.mkdev(\"/dev/null\",Le.makedev(1,3)),ve.register(Le.makedev(5,0),ve.default_tty_ops),ve.register(Le.makedev(6,0),ve.default_tty1_ops),Le.mkdev(\"/dev/tty\",Le.makedev(5,0)),Le.mkdev(\"/dev/tty1\",Le.makedev(6,0));var e=new Uint8Array(1024),t=0,n=()=>(0===t&&(t=Ee(e).byteLength),e[--t]);Le.createDevice(\"/dev\",\"random\",n),Le.createDevice(\"/dev\",\"urandom\",n),Le.mkdir(\"/dev/shm\"),Le.mkdir(\"/dev/shm/tmp\")},createSpecialDirectories(){Le.mkdir(\"/proc\");var e=Le.mkdir(\"/proc/self\");Le.mkdir(\"/proc/self/fd\"),Le.mount({mount(){var t=Le.createNode(e,\"fd\",16895,73);return t.node_ops={lookup(e,t){var n=+t,r=Le.getStreamChecked(n),o={parent:null,mount:{mountpoint:\"fake\"},node_ops:{readlink:()=>r.path}};return o.parent=o,o}},t}},{},\"/proc/self/fd\")},createStandardStreams(e,t,n){e?Le.createDevice(\"/dev\",\"stdin\",e):Le.symlink(\"/dev/tty\",\"/dev/stdin\"),t?Le.createDevice(\"/dev\",\"stdout\",null,t):Le.symlink(\"/dev/tty\",\"/dev/stdout\"),n?Le.createDevice(\"/dev\",\"stderr\",null,n):Le.symlink(\"/dev/tty1\",\"/dev/stderr\");var r=Le.open(\"/dev/stdin\",0),o=Le.open(\"/dev/stdout\",1),i=Le.open(\"/dev/stderr\",1);I(0===r.fd,`invalid handle for stdin (${r.fd})`),I(1===o.fd,`invalid handle for stdout (${o.fd})`),I(2===i.fd,`invalid handle for stderr (${i.fd})`)},staticInit(){[44].forEach((e=>{Le.genericErrors[e]=new Le.ErrnoError(e),Le.genericErrors[e].stack=\"<generic error, no stack>\"})),Le.nameTable=new Array(4096),Le.mount(Re,{},\"/\"),Le.createDefaultDirectories(),Le.createDefaultDevices(),Le.createSpecialDirectories(),Le.filesystems={MEMFS:Re}},init(e,t,n){I(!Le.initialized,\"FS.init was previously called. If you want to initialize later with custom parameters, remove any earlier calls (note that one is automatically added to the generated code)\"),Le.initialized=!0,e??=i.stdin,t??=i.stdout,n??=i.stderr,Le.createStandardStreams(e,t,n)},quit(){Le.initialized=!1,st(0);for(var e=0;e<Le.streams.length;e++){var t=Le.streams[e];t&&Le.close(t)}},findObject(e,t){var n=Le.analyzePath(e,t);return n.exists?n.object:null},analyzePath(e,t){try{e=(r=Le.lookupPath(e,{follow:!t})).path}catch(e){}var n={isRoot:!1,exists:!1,error:0,name:null,path:null,object:null,parentExists:!1,parentPath:null,parentObject:null};try{var r=Le.lookupPath(e,{parent:!0});n.parentExists=!0,n.parentPath=r.path,n.parentObject=r.node,n.name=Ae.basename(e),r=Le.lookupPath(e,{follow:!t}),n.exists=!0,n.path=r.path,n.object=r.node,n.name=r.node.name,n.isRoot=\"/\"===r.path}catch(e){n.error=e.errno}return n},createPath(e,t,n,r){e=\"string\"==typeof e?e:Le.getPath(e);for(var o=t.split(\"/\").reverse();o.length;){var i=o.pop();if(i){var a=Ae.join2(e,i);try{Le.mkdir(a)}catch(e){}e=a}}return a},createFile(e,t,n,r,o){var i=Ae.join2(\"string\"==typeof e?e:Le.getPath(e),t),a=ke(r,o);return Le.create(i,a)},createDataFile(e,t,n,r,o,i){var a=t;e&&(e=\"string\"==typeof e?e:Le.getPath(e),a=t?Ae.join2(e,t):e);var s=ke(r,o),u=Le.create(a,s);if(n){if(\"string\"==typeof n){for(var F=new Array(n.length),m=0,l=n.length;m<l;++m)F[m]=n.charCodeAt(m);n=F}Le.chmod(u,146|s);var d=Le.open(u,577);Le.write(d,n,0,n.length,0,i),Le.close(d),Le.chmod(u,s)}},createDevice(e,t,n,r){var o=Ae.join2(\"string\"==typeof e?e:Le.getPath(e),t),i=ke(!!n,!!r);Le.createDevice.major??=64;var a=Le.makedev(Le.createDevice.major++,0);return Le.registerDevice(a,{open(e){e.seekable=!1},close(e){r?.buffer?.length&&r(10)},read(e,t,r,o,i){for(var a=0,s=0;s<o;s++){var u;try{u=n()}catch(e){throw new Le.ErrnoError(29)}if(void 0===u&&0===a)throw new Le.ErrnoError(6);if(null==u)break;a++,t[r+s]=u}return a&&(e.node.timestamp=Date.now()),a},write(e,t,n,o,i){for(var a=0;a<o;a++)try{r(t[n+a])}catch(e){throw new Le.ErrnoError(29)}return o&&(e.node.timestamp=Date.now()),a}}),Le.mkdev(o,i,a)},forceLoadFile(e){if(e.isDevice||e.isFolder||e.link||e.contents)return!0;if(\"undefined\"!=typeof XMLHttpRequest)throw new Error(\"Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.\");try{e.contents=_(e.url),e.usedBytes=e.contents.length}catch(e){throw new Le.ErrnoError(29)}},createLazyFile(e,t,n,r,o){class i{constructor(){this.lengthKnown=!1,this.chunks=[]}get(e){if(!(e>this.length-1||e<0)){var t=e%this.chunkSize,n=e/this.chunkSize|0;return this.getter(n)[t]}}setDataGetter(e){this.getter=e}cacheLength(){var e=new XMLHttpRequest;if(e.open(\"HEAD\",n,!1),e.send(null),!(e.status>=200&&e.status<300||304===e.status))throw new Error(\"Couldn't load \"+n+\". Status: \"+e.status);var t,r=Number(e.getResponseHeader(\"Content-length\")),o=(t=e.getResponseHeader(\"Accept-Ranges\"))&&\"bytes\"===t,i=(t=e.getResponseHeader(\"Content-Encoding\"))&&\"gzip\"===t,a=1048576;o||(a=r);var s=this;s.setDataGetter((e=>{var t=e*a,o=(e+1)*a-1;if(o=Math.min(o,r-1),void 0===s.chunks[e]&&(s.chunks[e]=((e,t)=>{if(e>t)throw new Error(\"invalid range (\"+e+\", \"+t+\") or no bytes requested!\");if(t>r-1)throw new Error(\"only \"+r+\" bytes available! programmer error!\");var o=new XMLHttpRequest;if(o.open(\"GET\",n,!1),r!==a&&o.setRequestHeader(\"Range\",\"bytes=\"+e+\"-\"+t),o.responseType=\"arraybuffer\",o.overrideMimeType&&o.overrideMimeType(\"text/plain; charset=x-user-defined\"),o.send(null),!(o.status>=200&&o.status<300||304===o.status))throw new Error(\"Couldn't load \"+n+\". Status: \"+o.status);return void 0!==o.response?new Uint8Array(o.response||[]):Te(o.responseText||\"\",!0)})(t,o)),void 0===s.chunks[e])throw new Error(\"doXHR failed!\");return s.chunks[e]})),!i&&r||(a=r=1,r=this.getter(0).length,a=r,A(\"LazyFiles on gzip forces download of the whole file when length is accessed\")),this._length=r,this._chunkSize=a,this.lengthKnown=!0}get length(){return this.lengthKnown||this.cacheLength(),this._length}get chunkSize(){return this.lengthKnown||this.cacheLength(),this._chunkSize}}if(\"undefined\"!=typeof XMLHttpRequest){if(!u)throw\"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc\";var a={isDevice:!1,contents:new i}}else a={isDevice:!1,url:n};var s=Le.createFile(e,t,a,r,o);a.contents?s.contents=a.contents:a.url&&(s.contents=null,s.url=a.url),Object.defineProperties(s,{usedBytes:{get:function(){return this.contents.length}}});var F={};function m(e,t,n,r,o){var i=e.node.contents;if(o>=i.length)return 0;var a=Math.min(i.length-o,r);if(I(a>=0),i.slice)for(var s=0;s<a;s++)t[n+s]=i[o+s];else for(s=0;s<a;s++)t[n+s]=i.get(o+s);return a}return Object.keys(s.stream_ops).forEach((e=>{var t=s.stream_ops[e];F[e]=(...e)=>(Le.forceLoadFile(s),t(...e))})),F.read=(e,t,n,r,o)=>(Le.forceLoadFile(s),m(e,t,n,r,o)),F.mmap=(e,t,n,r,o)=>{Le.forceLoadFile(s);var i=we(t);if(!i)throw new Le.ErrnoError(48);return m(e,C,i,t,n),{ptr:i,allocated:!0}},s.stream_ops=F,s},absolutePath(){q(\"FS.absolutePath has been removed; use PATH_FS.resolve instead\")},createFolder(){q(\"FS.createFolder has been removed; use FS.mkdir instead\")},createLink(){q(\"FS.createLink has been removed; use FS.symlink instead\")},joinPath(){q(\"FS.joinPath has been removed; use PATH.join instead\")},mmapAlloc(){q(\"FS.mmapAlloc has been replaced by the top level function mmapAlloc\")},standardizePath(){q(\"FS.standardizePath has been removed; use PATH.normalize instead\")}},Be={DEFAULT_POLLMASK:5,calculateAt(e,t,n){if(Ae.isAbs(t))return t;var r;if(r=-100===e?Le.cwd():Be.getStreamFromFD(e).path,0==t.length){if(!n)throw new Le.ErrnoError(44);return r}return Ae.join2(r,t)},doStat(e,t,n){var r=e(t);O[n>>2]=r.dev,O[n+4>>2]=r.mode,v[n+8>>2]=r.nlink,O[n+12>>2]=r.uid,O[n+16>>2]=r.gid,O[n+20>>2]=r.rdev,ee=[r.size>>>0,(Z=r.size,+Math.abs(Z)>=1?Z>0?+Math.floor(Z/4294967296)>>>0:~~+Math.ceil((Z-+(~~Z>>>0))/4294967296)>>>0:0)],O[n+24>>2]=ee[0],O[n+28>>2]=ee[1],O[n+32>>2]=4096,O[n+36>>2]=r.blocks;var o=r.atime.getTime(),i=r.mtime.getTime(),a=r.ctime.getTime();return ee=[Math.floor(o/1e3)>>>0,(Z=Math.floor(o/1e3),+Math.abs(Z)>=1?Z>0?+Math.floor(Z/4294967296)>>>0:~~+Math.ceil((Z-+(~~Z>>>0))/4294967296)>>>0:0)],O[n+40>>2]=ee[0],O[n+44>>2]=ee[1],v[n+48>>2]=o%1e3*1e3*1e3,ee=[Math.floor(i/1e3)>>>0,(Z=Math.floor(i/1e3),+Math.abs(Z)>=1?Z>0?+Math.floor(Z/4294967296)>>>0:~~+Math.ceil((Z-+(~~Z>>>0))/4294967296)>>>0:0)],O[n+56>>2]=ee[0],O[n+60>>2]=ee[1],v[n+64>>2]=i%1e3*1e3*1e3,ee=[Math.floor(a/1e3)>>>0,(Z=Math.floor(a/1e3),+Math.abs(Z)>=1?Z>0?+Math.floor(Z/4294967296)>>>0:~~+Math.ceil((Z-+(~~Z>>>0))/4294967296)>>>0:0)],O[n+72>>2]=ee[0],O[n+76>>2]=ee[1],v[n+80>>2]=a%1e3*1e3*1e3,ee=[r.ino>>>0,(Z=r.ino,+Math.abs(Z)>=1?Z>0?+Math.floor(Z/4294967296)>>>0:~~+Math.ceil((Z-+(~~Z>>>0))/4294967296)>>>0:0)],O[n+88>>2]=ee[0],O[n+92>>2]=ee[1],0},doMsync(e,t,n,r,o){if(!Le.isFile(t.node.mode))throw new Le.ErrnoError(43);if(2&r)return 0;var i=y.slice(e,e+n);Le.msync(t,i,o,n,r)},getStreamFromFD:e=>Le.getStreamChecked(e),varargs:void 0,getStr:e=>be(e)},Ne=(e,t)=>(I(e==e>>>0||e==(0|e)),I(t===(0|t)),t+2097152>>>0<4194305-!!e?(e>>>0)+4294967296*t:NaN),Ue=(e,t,n)=>(I(\"number\"==typeof n,\"stringToUTF8(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!\"),ye(e,y,t,n)),Ve=[0,31,60,91,121,152,182,213,244,274,305,335],ze=[0,31,59,90,120,151,181,212,243,273,304,334],We=e=>{var t=G.buffer,n=(e-t.byteLength+65535)/65536|0;try{return G.grow(n),k(),1}catch(n){E(`growMemory: Attempted to grow heap from ${t.byteLength} bytes to ${e} bytes, but got error: ${n}`)}},He={},$e=()=>{if(!$e.strings){var e={USER:\"web_user\",LOGNAME:\"web_user\",PATH:\"/\",PWD:\"/\",HOME:\"/home/web_user\",LANG:(\"object\"==typeof navigator&&navigator.languages&&navigator.languages[0]||\"C\").replace(\"-\",\"_\")+\".UTF-8\",_:c||\"./this.program\"};for(var t in He)void 0===He[t]?delete e[t]:e[t]=He[t];var n=[];for(var t in e)n.push(`${t}=${e[t]}`);$e.strings=n}return $e.strings},Xe=[],Ke=e=>{var t=Xe[e];return t||(e>=Xe.length&&(Xe.length=e+1),Xe[e]=t=Me.get(e)),I(Me.get(e)==t,\"JavaScript-side Wasm function table mirror is out of date!\"),t},Ye=\"undefined\"!=typeof TextDecoder?new TextDecoder(\"utf-16le\"):void 0,Je=(e,t)=>{I(e<16384),e<128?t.push(e):t.push(e%128|128,e>>7)},qe=(e,t)=>{if(I(!t.includes(\"j\"),\"i64 not permitted in function signatures when WASM_BIGINT is disabled\"),\"function\"==typeof WebAssembly.Function)return new WebAssembly.Function((e=>{I(!e.includes(\"j\"),\"i64 not permitted in function signatures when WASM_BIGINT is disabled\");for(var t={i:\"i32\",j:\"i64\",f:\"f32\",d:\"f64\",e:\"externref\",p:\"i32\"},n={parameters:[],results:\"v\"==e[0]?[]:[t[e[0]]]},r=1;r<e.length;++r)I(e[r]in t,\"invalid signature char: \"+e[r]),n.parameters.push(t[e[r]]);return n})(t),e);var n=[1];((e,t)=>{var n=e.slice(0,1),r=e.slice(1),o={i:127,p:127,j:126,f:125,d:124,e:111};t.push(96),Je(r.length,t);for(var i=0;i<r.length;++i)I(r[i]in o,\"invalid signature char: \"+r[i]),t.push(o[r[i]]);\"v\"==n?t.push(0):t.push(1,o[n])})(t,n);var r=[0,97,115,109,1,0,0,0,1];Je(n.length,r),r.push(...n),r.push(2,7,1,1,101,1,102,0,0,7,5,1,1,102,0,0);var o=new WebAssembly.Module(new Uint8Array(r));return new WebAssembly.Instance(o,{e:{f:e}}).exports.f},Qe=e=>(Oe||(Oe=new WeakMap,((e,t)=>{if(Oe)for(var n=e;n<e+t;n++){var r=Ke(n);r&&Oe.set(r,n)}})(0,Me.length)),Oe.get(e)||0),Ze=[],et=(e,t)=>{Me.set(e,t),Xe[e]=Me.get(e)},tt=e=>Pt(e),nt=(e,t,n,r,o)=>{var a={string:e=>{var t=0;return null!=e&&0!==e&&(t=(e=>{var t=Ce(e)+1,n=tt(t);return Ue(e,n,t),n})(e)),t},array:e=>{var t,n,r=tt(e.length);return n=r,I((t=e).length>=0,\"writeArrayToMemory array must have a length (should be an array or typed array)\"),C.set(t,n),r}},s=(e=>{var t=i[\"_\"+e];return I(t,\"Cannot call unknown function \"+e+\", make sure it is exported\"),t})(e),u=[],F=0;if(I(\"array\"!==t,'Return type should not be \"array\".'),r)for(var m=0;m<r.length;m++){var l=a[n[m]];l?(0===F&&(F=ce()),u[m]=l(r[m])):u[m]=r[m]}var d=s(...u);return d=function(e){return 0!==F&&Pe(F),function(e){return\"string\"===t?be(e):\"boolean\"===t?Boolean(e):e}(e)}(d)};Le.createPreloadedFile=(e,t,n,r,o,i,a,s,u,F)=>{var m=t?Ge.resolve(Ae.join2(e,t)):e,l=K(`cp ${m}`);function _(n){function d(n){F?.(),s||((e,t,n,r,o,i)=>{Le.createDataFile(e,t,n,r,o,i)})(e,t,n,r,o,u),i?.(),J(l)}((e,t,n,r)=>{\"undefined\"!=typeof Browser&&Browser.init();var o=!1;return Ie.forEach((i=>{o||i.canHandle(t)&&(i.handle(e,t,n,r),o=!0)})),o})(n,m,d,(()=>{a?.(),J(l)}))||d(n)}Y(l),\"string\"==typeof n?((e,t,n,r)=>{var o=r?\"\":K(`al ${e}`);d(e).then((n=>{I(n,`Loading data file \"${e}\" failed (no arrayBuffer).`),t(new Uint8Array(n)),o&&J(o)}),(t=>{if(!n)throw`Loading data file \"${e}\" failed.`;n()})),o&&Y(o)})(n,_,a):_(n)},Le.staticInit();var rt={__assert_fail:(e,t,n,r)=>{q(`Assertion failed: ${be(e)}, at: `+[t?be(t):\"unknown filename\",n,r?be(r):\"unknown function\"])},__syscall_fcntl64:function(e,t,n){Be.varargs=n;try{var r=Be.getStreamFromFD(e);switch(t){case 0:if((o=pe())<0)return-28;for(;Le.streams[o];)o++;return Le.dupStream(r,o).fd;case 1:case 2:case 13:case 14:return 0;case 3:return r.flags;case 4:var o=pe();return r.flags|=o,0;case 12:return o=fe(),T[o+0>>1]=2,0}return-28}catch(e){if(void 0===Le||\"ErrnoError\"!==e.name)throw e;return-e.errno}},__syscall_fstat64:function(e,t){try{var n=Be.getStreamFromFD(e);return Be.doStat(Le.stat,n.path,t)}catch(e){if(void 0===Le||\"ErrnoError\"!==e.name)throw e;return-e.errno}},__syscall_ftruncate64:function(e,t,n){var r=Ne(t,n);try{return isNaN(r)?61:(Le.ftruncate(e,r),0)}catch(e){if(void 0===Le||\"ErrnoError\"!==e.name)throw e;return-e.errno}},__syscall_getdents64:function(e,t,n){try{var r=Be.getStreamFromFD(e);r.getdents||=Le.readdir(r.path);for(var o=280,i=0,a=Le.llseek(r,0,1),s=Math.floor(a/o);s<r.getdents.length&&i+o<=n;){var u,F,m=r.getdents[s];if(\".\"===m)u=r.node.id,F=4;else if(\"..\"===m)u=Le.lookupPath(r.path,{parent:!0}).node.id,F=4;else{var l=Le.lookupNode(r.node,m);u=l.id,F=Le.isChrdev(l.mode)?2:Le.isDir(l.mode)?4:Le.isLink(l.mode)?10:8}I(u),ee=[u>>>0,(Z=u,+Math.abs(Z)>=1?Z>0?+Math.floor(Z/4294967296)>>>0:~~+Math.ceil((Z-+(~~Z>>>0))/4294967296)>>>0:0)],O[t+i>>2]=ee[0],O[t+i+4>>2]=ee[1],ee=[(s+1)*o>>>0,(Z=(s+1)*o,+Math.abs(Z)>=1?Z>0?+Math.floor(Z/4294967296)>>>0:~~+Math.ceil((Z-+(~~Z>>>0))/4294967296)>>>0:0)],O[t+i+8>>2]=ee[0],O[t+i+12>>2]=ee[1],T[t+i+16>>1]=280,C[t+i+18]=F,Ue(m,t+i+19,256),i+=o,s+=1}return Le.llseek(r,s*o,0),i}catch(e){if(void 0===Le||\"ErrnoError\"!==e.name)throw e;return-e.errno}},__syscall_ioctl:function(e,t,n){Be.varargs=n;try{var r=Be.getStreamFromFD(e);switch(t){case 21509:case 21510:case 21511:case 21512:case 21524:case 21515:return r.tty?0:-59;case 21505:if(!r.tty)return-59;if(r.tty.ops.ioctl_tcgets){var o=r.tty.ops.ioctl_tcgets(r),i=fe();O[i>>2]=o.c_iflag||0,O[i+4>>2]=o.c_oflag||0,O[i+8>>2]=o.c_cflag||0,O[i+12>>2]=o.c_lflag||0;for(var a=0;a<32;a++)C[i+a+17]=o.c_cc[a]||0;return 0}return 0;case 21506:case 21507:case 21508:if(!r.tty)return-59;if(r.tty.ops.ioctl_tcsets){i=fe();var s=O[i>>2],u=O[i+4>>2],F=O[i+8>>2],m=O[i+12>>2],l=[];for(a=0;a<32;a++)l.push(C[i+a+17]);return r.tty.ops.ioctl_tcsets(r.tty,t,{c_iflag:s,c_oflag:u,c_cflag:F,c_lflag:m,c_cc:l})}return 0;case 21519:return r.tty?(i=fe(),O[i>>2]=0,0):-59;case 21520:return r.tty?-28:-59;case 21531:return i=fe(),Le.ioctl(r,t,i);case 21523:if(!r.tty)return-59;if(r.tty.ops.ioctl_tiocgwinsz){var d=r.tty.ops.ioctl_tiocgwinsz(r.tty);i=fe(),T[i>>1]=d[0],T[i+2>>1]=d[1]}return 0;default:return-28}}catch(e){if(void 0===Le||\"ErrnoError\"!==e.name)throw e;return-e.errno}},__syscall_lstat64:function(e,t){try{return e=Be.getStr(e),Be.doStat(Le.lstat,e,t)}catch(e){if(void 0===Le||\"ErrnoError\"!==e.name)throw e;return-e.errno}},__syscall_newfstatat:function(e,t,n,r){try{t=Be.getStr(t);var o=256&r,i=4096&r;return I(!(r&=-6401),`unknown flags in __syscall_newfstatat: ${r}`),t=Be.calculateAt(e,t,i),Be.doStat(o?Le.lstat:Le.stat,t,n)}catch(e){if(void 0===Le||\"ErrnoError\"!==e.name)throw e;return-e.errno}},__syscall_openat:function(e,t,n,r){Be.varargs=r;try{t=Be.getStr(t),t=Be.calculateAt(e,t);var o=r?pe():0;return Le.open(t,n,o).fd}catch(e){if(void 0===Le||\"ErrnoError\"!==e.name)throw e;return-e.errno}},__syscall_rmdir:function(e){try{return e=Be.getStr(e),Le.rmdir(e),0}catch(e){if(void 0===Le||\"ErrnoError\"!==e.name)throw e;return-e.errno}},__syscall_stat64:function(e,t){try{return e=Be.getStr(e),Be.doStat(Le.stat,e,t)}catch(e){if(void 0===Le||\"ErrnoError\"!==e.name)throw e;return-e.errno}},__syscall_unlinkat:function(e,t,n){try{return t=Be.getStr(t),t=Be.calculateAt(e,t),0===n?Le.unlink(t):512===n?Le.rmdir(t):q(\"Invalid flags passed to unlinkat\"),0}catch(e){if(void 0===Le||\"ErrnoError\"!==e.name)throw e;return-e.errno}},_abort_js:()=>{q(\"native code called abort()\")},_emscripten_memcpy_js:(e,t,n)=>y.copyWithin(e,t,t+n),_emscripten_throw_longjmp:()=>{throw 1/0},_gmtime_js:function(e,t,n){var r=Ne(e,t),o=new Date(1e3*r);O[n>>2]=o.getUTCSeconds(),O[n+4>>2]=o.getUTCMinutes(),O[n+8>>2]=o.getUTCHours(),O[n+12>>2]=o.getUTCDate(),O[n+16>>2]=o.getUTCMonth(),O[n+20>>2]=o.getUTCFullYear()-1900,O[n+24>>2]=o.getUTCDay();var i=Date.UTC(o.getUTCFullYear(),0,1,0,0,0,0),a=(o.getTime()-i)/864e5|0;O[n+28>>2]=a},_localtime_js:function(e,t,n){var r=Ne(e,t),o=new Date(1e3*r);O[n>>2]=o.getSeconds(),O[n+4>>2]=o.getMinutes(),O[n+8>>2]=o.getHours(),O[n+12>>2]=o.getDate(),O[n+16>>2]=o.getMonth(),O[n+20>>2]=o.getFullYear()-1900,O[n+24>>2]=o.getDay();var i=0|(e=>{var t;return((t=e.getFullYear())%4!=0||t%100==0&&t%400!=0?ze:Ve)[e.getMonth()]+e.getDate()-1})(o);O[n+28>>2]=i,O[n+36>>2]=-60*o.getTimezoneOffset();var a=new Date(o.getFullYear(),0,1),s=new Date(o.getFullYear(),6,1).getTimezoneOffset(),u=a.getTimezoneOffset(),F=0|(s!=u&&o.getTimezoneOffset()==Math.min(u,s));O[n+32>>2]=F},_tzset_js:(e,t,n,r)=>{var o=(new Date).getFullYear(),i=new Date(o,0,1),a=new Date(o,6,1),s=i.getTimezoneOffset(),u=a.getTimezoneOffset(),F=Math.max(s,u);v[e>>2]=60*F,O[t>>2]=Number(s!=u);var m=e=>{var t=e>=0?\"-\":\"+\",n=Math.abs(e);return`UTC${t}${String(Math.floor(n/60)).padStart(2,\"0\")}${String(n%60).padStart(2,\"0\")}`},l=m(s),d=m(u);I(l),I(d),I(Ce(l)<=16,`timezone name truncated to fit in TZNAME_MAX (${l})`),I(Ce(d)<=16,`timezone name truncated to fit in TZNAME_MAX (${d})`),u<s?(Ue(l,n,17),Ue(d,r,17)):(Ue(l,r,17),Ue(d,n,17))},emscripten_date_now:()=>Date.now(),emscripten_resize_heap:e=>{var t=y.length;I((e>>>=0)>t);var n=2147483648;if(e>n)return E(`Cannot enlarge memory, requested ${e} bytes, but the limit is 2147483648 bytes!`),!1;for(var r=1;r<=4;r*=2){var o=t*(1+.2/r);o=Math.min(o,e+100663296);var i=Math.min(n,xe(Math.max(e,o),65536));if(We(i))return!0}return E(`Failed to grow the heap from ${t} bytes to ${i} bytes, not enough memory!`),!1},environ_get:(e,t)=>{var n=0;return $e().forEach(((r,o)=>{var i=t+n;v[e+4*o>>2]=i,((e,t)=>{for(var n=0;n<e.length;++n)I(e.charCodeAt(n)===(255&e.charCodeAt(n))),C[t++]=e.charCodeAt(n);C[t]=0})(r,i),n+=r.length+1})),0},environ_sizes_get:(e,t)=>{var n=$e();v[e>>2]=n.length;var r=0;return n.forEach((e=>r+=e.length+1)),v[t>>2]=r,0},fd_close:function(e){try{var t=Be.getStreamFromFD(e);return Le.close(t),0}catch(e){if(void 0===Le||\"ErrnoError\"!==e.name)throw e;return e.errno}},fd_read:function(e,t,n,r){try{var o=((e,t,n,r)=>{for(var o=0,i=0;i<n;i++){var a=v[t>>2],s=v[t+4>>2];t+=8;var u=Le.read(e,C,a,s,r);if(u<0)return-1;if(o+=u,u<s)break;void 0!==r&&(r+=u)}return o})(Be.getStreamFromFD(e),t,n);return v[r>>2]=o,0}catch(e){if(void 0===Le||\"ErrnoError\"!==e.name)throw e;return e.errno}},fd_seek:function(e,t,n,r,o){var i=Ne(t,n);try{if(isNaN(i))return 61;var a=Be.getStreamFromFD(e);return Le.llseek(a,i,r),ee=[a.position>>>0,(Z=a.position,+Math.abs(Z)>=1?Z>0?+Math.floor(Z/4294967296)>>>0:~~+Math.ceil((Z-+(~~Z>>>0))/4294967296)>>>0:0)],O[o>>2]=ee[0],O[o+4>>2]=ee[1],a.getdents&&0===i&&0===r&&(a.getdents=null),0}catch(e){if(void 0===Le||\"ErrnoError\"!==e.name)throw e;return e.errno}},fd_sync:function(e){try{var t=Be.getStreamFromFD(e);return t.stream_ops?.fsync?t.stream_ops.fsync(t):0}catch(e){if(void 0===Le||\"ErrnoError\"!==e.name)throw e;return e.errno}},fd_write:function(e,t,n,r){try{var o=((e,t,n,r)=>{for(var o=0,i=0;i<n;i++){var a=v[t>>2],s=v[t+4>>2];t+=8;var u=Le.write(e,C,a,s,r);if(u<0)return-1;if(o+=u,u<s)break;void 0!==r&&(r+=u)}return o})(Be.getStreamFromFD(e),t,n);return v[r>>2]=o,0}catch(e){if(void 0===Le||\"ErrnoError\"!==e.name)throw e;return e.errno}},invoke_ii:function(e,t){var n=ce();try{return Ke(e)(t)}catch(e){if(Pe(n),e!==e+0)throw e;mt(1,0)}},invoke_iii:function(e,t,n){var r=ce();try{return Ke(e)(t,n)}catch(e){if(Pe(r),e!==e+0)throw e;mt(1,0)}},invoke_iiii:function(e,t,n,r){var o=ce();try{return Ke(e)(t,n,r)}catch(e){if(Pe(o),e!==e+0)throw e;mt(1,0)}},invoke_iiiii:function(e,t,n,r,o){var i=ce();try{return Ke(e)(t,n,r,o)}catch(e){if(Pe(i),e!==e+0)throw e;mt(1,0)}},invoke_v:function(e){var t=ce();try{Ke(e)()}catch(e){if(Pe(t),e!==e+0)throw e;mt(1,0)}},invoke_viii:function(e,t,n,r){var o=ce();try{Ke(e)(t,n,r)}catch(e){if(Pe(o),e!==e+0)throw e;mt(1,0)}},invoke_viiii:function(e,t,n,r,o){var i=ce();try{Ke(e)(t,n,r,o)}catch(e){if(Pe(i),e!==e+0)throw e;mt(1,0)}}},ot=function(){var e={env:rt,wasi_snapshot_preview1:rt};function t(e,t){var n;return ot=e.exports,i.wasmExports=ot,I(G=ot.memory,\"memory not found in wasm exports\"),k(),I(Me=ot.__indirect_function_table,\"table not found in wasm exports\"),n=ot.__wasm_call_ctors,B.unshift(n),J(\"wasm-instantiate\"),ot}Y(\"wasm-instantiate\");var n,r,a,s,u=i;if(i.instantiateWasm)try{return i.instantiateWasm(e,t)}catch(e){E(`Module.instantiateWasm callback failed with error: ${e}`),o(e)}return Q??=oe(),(n=S,r=Q,a=e,s=function(e){I(i===u,\"the Module object should not be replaced during async compilation - perhaps the order of HTML elements is wrong?\"),u=null,t(e.instance)},n||\"function\"!=typeof WebAssembly.instantiateStreaming||te(r)||F||\"function\"!=typeof fetch?ae(r,a,s):fetch(r,{credentials:\"same-origin\"}).then((e=>WebAssembly.instantiateStreaming(e,a).then(s,(function(e){return E(`wasm streaming compile failed: ${e}`),E(\"falling back to ArrayBuffer instantiation\"),ae(r,a,s)}))))).catch(o),{}}();i._PDFiumExt_Init=re(\"PDFiumExt_Init\",0),i._FPDF_InitLibraryWithConfig=re(\"FPDF_InitLibraryWithConfig\",1),i._PDFiumExt_OpenFileWriter=re(\"PDFiumExt_OpenFileWriter\",0),i._PDFiumExt_GetFileWriterSize=re(\"PDFiumExt_GetFileWriterSize\",1),i._PDFiumExt_GetFileWriterData=re(\"PDFiumExt_GetFileWriterData\",3),i._PDFiumExt_CloseFileWriter=re(\"PDFiumExt_CloseFileWriter\",1),i._PDFiumExt_SaveAsCopy=re(\"PDFiumExt_SaveAsCopy\",2),i._FPDF_SaveAsCopy=re(\"FPDF_SaveAsCopy\",3),i._PDFiumExt_OpenFormFillInfo=re(\"PDFiumExt_OpenFormFillInfo\",0),i._PDFiumExt_CloseFormFillInfo=re(\"PDFiumExt_CloseFormFillInfo\",1),i._PDFiumExt_InitFormFillEnvironment=re(\"PDFiumExt_InitFormFillEnvironment\",2),i._FPDFDOC_InitFormFillEnvironment=re(\"FPDFDOC_InitFormFillEnvironment\",2),i._PDFiumExt_ExitFormFillEnvironment=re(\"PDFiumExt_ExitFormFillEnvironment\",1),i._FPDFDOC_ExitFormFillEnvironment=re(\"FPDFDOC_ExitFormFillEnvironment\",1),i._FPDFAnnot_IsSupportedSubtype=re(\"FPDFAnnot_IsSupportedSubtype\",1),i._FPDFPage_CreateAnnot=re(\"FPDFPage_CreateAnnot\",2),i._FPDFPage_GetAnnotCount=re(\"FPDFPage_GetAnnotCount\",1),i._FPDFPage_GetAnnot=re(\"FPDFPage_GetAnnot\",2),i._FPDFPage_GetAnnotIndex=re(\"FPDFPage_GetAnnotIndex\",2),i._FPDFPage_CloseAnnot=re(\"FPDFPage_CloseAnnot\",1),i._FPDFPage_RemoveAnnot=re(\"FPDFPage_RemoveAnnot\",2),i._FPDFAnnot_GetSubtype=re(\"FPDFAnnot_GetSubtype\",1),i._FPDFAnnot_IsObjectSupportedSubtype=re(\"FPDFAnnot_IsObjectSupportedSubtype\",1),i._FPDFAnnot_UpdateObject=re(\"FPDFAnnot_UpdateObject\",2),i._FPDFAnnot_AddInkStroke=re(\"FPDFAnnot_AddInkStroke\",3),i._FPDFAnnot_RemoveInkList=re(\"FPDFAnnot_RemoveInkList\",1),i._FPDFAnnot_AppendObject=re(\"FPDFAnnot_AppendObject\",2),i._FPDFAnnot_GetObjectCount=re(\"FPDFAnnot_GetObjectCount\",1),i._FPDFAnnot_GetObject=re(\"FPDFAnnot_GetObject\",2),i._FPDFAnnot_RemoveObject=re(\"FPDFAnnot_RemoveObject\",2),i._FPDFAnnot_SetColor=re(\"FPDFAnnot_SetColor\",6),i._FPDFAnnot_GetColor=re(\"FPDFAnnot_GetColor\",6),i._FPDFAnnot_HasAttachmentPoints=re(\"FPDFAnnot_HasAttachmentPoints\",1),i._FPDFAnnot_SetAttachmentPoints=re(\"FPDFAnnot_SetAttachmentPoints\",3),i._FPDFAnnot_AppendAttachmentPoints=re(\"FPDFAnnot_AppendAttachmentPoints\",2),i._FPDFAnnot_CountAttachmentPoints=re(\"FPDFAnnot_CountAttachmentPoints\",1),i._FPDFAnnot_GetAttachmentPoints=re(\"FPDFAnnot_GetAttachmentPoints\",3),i._FPDFAnnot_SetRect=re(\"FPDFAnnot_SetRect\",2),i._FPDFAnnot_GetRect=re(\"FPDFAnnot_GetRect\",2),i._FPDFAnnot_GetVertices=re(\"FPDFAnnot_GetVertices\",3),i._FPDFAnnot_GetInkListCount=re(\"FPDFAnnot_GetInkListCount\",1),i._FPDFAnnot_GetInkListPath=re(\"FPDFAnnot_GetInkListPath\",4),i._FPDFAnnot_GetLine=re(\"FPDFAnnot_GetLine\",3),i._FPDFAnnot_SetBorder=re(\"FPDFAnnot_SetBorder\",4),i._FPDFAnnot_GetBorder=re(\"FPDFAnnot_GetBorder\",4),i._FPDFAnnot_HasKey=re(\"FPDFAnnot_HasKey\",2),i._FPDFAnnot_GetValueType=re(\"FPDFAnnot_GetValueType\",2),i._FPDFAnnot_SetStringValue=re(\"FPDFAnnot_SetStringValue\",3),i._FPDFAnnot_GetStringValue=re(\"FPDFAnnot_GetStringValue\",4),i._FPDFAnnot_GetNumberValue=re(\"FPDFAnnot_GetNumberValue\",3),i._FPDFAnnot_SetAP=re(\"FPDFAnnot_SetAP\",3),i._FPDFAnnot_GetAP=re(\"FPDFAnnot_GetAP\",4),i._FPDFAnnot_GetLinkedAnnot=re(\"FPDFAnnot_GetLinkedAnnot\",2),i._FPDFAnnot_GetFlags=re(\"FPDFAnnot_GetFlags\",1),i._FPDFAnnot_SetFlags=re(\"FPDFAnnot_SetFlags\",2),i._FPDFAnnot_GetFormFieldFlags=re(\"FPDFAnnot_GetFormFieldFlags\",2),i._FPDFAnnot_SetFormFieldFlags=re(\"FPDFAnnot_SetFormFieldFlags\",3),i._FPDFAnnot_GetFormFieldAtPoint=re(\"FPDFAnnot_GetFormFieldAtPoint\",3),i._FPDFAnnot_GetFormFieldName=re(\"FPDFAnnot_GetFormFieldName\",4),i._FPDFAnnot_GetFormFieldType=re(\"FPDFAnnot_GetFormFieldType\",2),i._FPDFAnnot_GetFormAdditionalActionJavaScript=re(\"FPDFAnnot_GetFormAdditionalActionJavaScript\",5),i._FPDFAnnot_GetFormFieldAlternateName=re(\"FPDFAnnot_GetFormFieldAlternateName\",4),i._FPDFAnnot_GetFormFieldValue=re(\"FPDFAnnot_GetFormFieldValue\",4),i._FPDFAnnot_GetOptionCount=re(\"FPDFAnnot_GetOptionCount\",2),i._FPDFAnnot_GetOptionLabel=re(\"FPDFAnnot_GetOptionLabel\",5),i._FPDFAnnot_IsOptionSelected=re(\"FPDFAnnot_IsOptionSelected\",3),i._FPDFAnnot_GetFontSize=re(\"FPDFAnnot_GetFontSize\",3),i._FPDFAnnot_SetFontColor=re(\"FPDFAnnot_SetFontColor\",5),i._FPDFAnnot_GetFontColor=re(\"FPDFAnnot_GetFontColor\",5),i._FPDFAnnot_IsChecked=re(\"FPDFAnnot_IsChecked\",2),i._FPDFAnnot_SetFocusableSubtypes=re(\"FPDFAnnot_SetFocusableSubtypes\",3),i._FPDFAnnot_GetFocusableSubtypesCount=re(\"FPDFAnnot_GetFocusableSubtypesCount\",1),i._FPDFAnnot_GetFocusableSubtypes=re(\"FPDFAnnot_GetFocusableSubtypes\",3),i._FPDFAnnot_GetLink=re(\"FPDFAnnot_GetLink\",1),i._FPDFAnnot_GetFormControlCount=re(\"FPDFAnnot_GetFormControlCount\",2),i._FPDFAnnot_GetFormControlIndex=re(\"FPDFAnnot_GetFormControlIndex\",2),i._FPDFAnnot_GetFormFieldExportValue=re(\"FPDFAnnot_GetFormFieldExportValue\",4),i._FPDFAnnot_SetURI=re(\"FPDFAnnot_SetURI\",2),i._FPDFAnnot_GetFileAttachment=re(\"FPDFAnnot_GetFileAttachment\",1),i._FPDFAnnot_AddFileAttachment=re(\"FPDFAnnot_AddFileAttachment\",2),i._EPDFAnnot_SetColor=re(\"EPDFAnnot_SetColor\",6),i._EPDFAnnot_GetColor=re(\"EPDFAnnot_GetColor\",6),i._EPDFAnnot_GetBorderEffect=re(\"EPDFAnnot_GetBorderEffect\",2),i._EPDFAnnot_GetRectangleDifferences=re(\"EPDFAnnot_GetRectangleDifferences\",5),i._EPDFAnnot_GetBorderDashPatternCount=re(\"EPDFAnnot_GetBorderDashPatternCount\",1),i._EPDFAnnot_GetBorderDashPattern=re(\"EPDFAnnot_GetBorderDashPattern\",3),i._EPDFAnnot_GetBorderStyle=re(\"EPDFAnnot_GetBorderStyle\",2),i._EPDFAnnot_SetBorderStyle=re(\"EPDFAnnot_SetBorderStyle\",3),i._EPDFAnnot_GenerateAppearance=re(\"EPDFAnnot_GenerateAppearance\",1),i._FPDFDoc_GetAttachmentCount=re(\"FPDFDoc_GetAttachmentCount\",1),i._FPDFDoc_AddAttachment=re(\"FPDFDoc_AddAttachment\",2),i._FPDFDoc_GetAttachment=re(\"FPDFDoc_GetAttachment\",2),i._FPDFDoc_DeleteAttachment=re(\"FPDFDoc_DeleteAttachment\",2),i._FPDFAttachment_GetName=re(\"FPDFAttachment_GetName\",3),i._FPDFAttachment_HasKey=re(\"FPDFAttachment_HasKey\",2),i._FPDFAttachment_GetValueType=re(\"FPDFAttachment_GetValueType\",2),i._FPDFAttachment_SetStringValue=re(\"FPDFAttachment_SetStringValue\",3),i._FPDFAttachment_GetStringValue=re(\"FPDFAttachment_GetStringValue\",4),i._FPDFAttachment_SetFile=re(\"FPDFAttachment_SetFile\",4),i._FPDFAttachment_GetFile=re(\"FPDFAttachment_GetFile\",4),i._FPDFAttachment_GetSubtype=re(\"FPDFAttachment_GetSubtype\",3),i._FPDFCatalog_IsTagged=re(\"FPDFCatalog_IsTagged\",1),i._FPDFCatalog_SetLanguage=re(\"FPDFCatalog_SetLanguage\",2),i._FPDFAvail_Create=re(\"FPDFAvail_Create\",2),i._FPDFAvail_Destroy=re(\"FPDFAvail_Destroy\",1),i._FPDFAvail_IsDocAvail=re(\"FPDFAvail_IsDocAvail\",2),i._FPDFAvail_GetDocument=re(\"FPDFAvail_GetDocument\",2),i._FPDFAvail_GetFirstPageNum=re(\"FPDFAvail_GetFirstPageNum\",1),i._FPDFAvail_IsPageAvail=re(\"FPDFAvail_IsPageAvail\",3),i._FPDFAvail_IsFormAvail=re(\"FPDFAvail_IsFormAvail\",2),i._FPDFAvail_IsLinearized=re(\"FPDFAvail_IsLinearized\",1),i._FPDFBookmark_GetFirstChild=re(\"FPDFBookmark_GetFirstChild\",2),i._FPDFBookmark_GetNextSibling=re(\"FPDFBookmark_GetNextSibling\",2),i._FPDFBookmark_GetTitle=re(\"FPDFBookmark_GetTitle\",3),i._FPDFBookmark_GetCount=re(\"FPDFBookmark_GetCount\",1),i._FPDFBookmark_Find=re(\"FPDFBookmark_Find\",2),i._FPDFBookmark_GetDest=re(\"FPDFBookmark_GetDest\",2),i._FPDFBookmark_GetAction=re(\"FPDFBookmark_GetAction\",1),i._FPDFAction_GetType=re(\"FPDFAction_GetType\",1),i._FPDFAction_GetDest=re(\"FPDFAction_GetDest\",2),i._FPDFAction_GetFilePath=re(\"FPDFAction_GetFilePath\",3),i._FPDFAction_GetURIPath=re(\"FPDFAction_GetURIPath\",4),i._FPDFDest_GetDestPageIndex=re(\"FPDFDest_GetDestPageIndex\",2),i._FPDFDest_GetView=re(\"FPDFDest_GetView\",3),i._FPDFDest_GetLocationInPage=re(\"FPDFDest_GetLocationInPage\",7),i._FPDFLink_GetLinkAtPoint=re(\"FPDFLink_GetLinkAtPoint\",3),i._FPDFLink_GetLinkZOrderAtPoint=re(\"FPDFLink_GetLinkZOrderAtPoint\",3),i._FPDFLink_GetDest=re(\"FPDFLink_GetDest\",2),i._FPDFLink_GetAction=re(\"FPDFLink_GetAction\",1),i._FPDFLink_Enumerate=re(\"FPDFLink_Enumerate\",3),i._FPDFLink_GetAnnot=re(\"FPDFLink_GetAnnot\",2),i._FPDFLink_GetAnnotRect=re(\"FPDFLink_GetAnnotRect\",2),i._FPDFLink_CountQuadPoints=re(\"FPDFLink_CountQuadPoints\",1),i._FPDFLink_GetQuadPoints=re(\"FPDFLink_GetQuadPoints\",3),i._FPDF_GetPageAAction=re(\"FPDF_GetPageAAction\",2),i._FPDF_GetFileIdentifier=re(\"FPDF_GetFileIdentifier\",4),i._FPDF_GetMetaText=re(\"FPDF_GetMetaText\",4),i._FPDF_GetPageLabel=re(\"FPDF_GetPageLabel\",4),i._FPDFPageObj_NewImageObj=re(\"FPDFPageObj_NewImageObj\",1),i._FPDFImageObj_LoadJpegFile=re(\"FPDFImageObj_LoadJpegFile\",4),i._FPDFImageObj_LoadJpegFileInline=re(\"FPDFImageObj_LoadJpegFileInline\",4),i._FPDFImageObj_SetMatrix=re(\"FPDFImageObj_SetMatrix\",7),i._FPDFImageObj_SetBitmap=re(\"FPDFImageObj_SetBitmap\",4),i._FPDFImageObj_GetBitmap=re(\"FPDFImageObj_GetBitmap\",1),i._FPDFImageObj_GetRenderedBitmap=re(\"FPDFImageObj_GetRenderedBitmap\",3),i._FPDFImageObj_GetImageDataDecoded=re(\"FPDFImageObj_GetImageDataDecoded\",3),i._FPDFImageObj_GetImageDataRaw=re(\"FPDFImageObj_GetImageDataRaw\",3),i._FPDFImageObj_GetImageFilterCount=re(\"FPDFImageObj_GetImageFilterCount\",1),i._FPDFImageObj_GetImageFilter=re(\"FPDFImageObj_GetImageFilter\",4),i._FPDFImageObj_GetImageMetadata=re(\"FPDFImageObj_GetImageMetadata\",3),i._FPDFImageObj_GetImagePixelSize=re(\"FPDFImageObj_GetImagePixelSize\",3),i._FPDFImageObj_GetIccProfileDataDecoded=re(\"FPDFImageObj_GetIccProfileDataDecoded\",5),i._FPDF_CreateNewDocument=re(\"FPDF_CreateNewDocument\",0),i._FPDFPage_Delete=re(\"FPDFPage_Delete\",2),i._FPDF_MovePages=re(\"FPDF_MovePages\",4),i._FPDFPage_New=re(\"FPDFPage_New\",4),i._FPDFPage_GetRotation=re(\"FPDFPage_GetRotation\",1),i._FPDFPage_InsertObject=re(\"FPDFPage_InsertObject\",2),i._FPDFPage_InsertObjectAtIndex=re(\"FPDFPage_InsertObjectAtIndex\",3),i._FPDFPage_RemoveObject=re(\"FPDFPage_RemoveObject\",2),i._FPDFPage_CountObjects=re(\"FPDFPage_CountObjects\",1),i._FPDFPage_GetObject=re(\"FPDFPage_GetObject\",2),i._FPDFPage_HasTransparency=re(\"FPDFPage_HasTransparency\",1),i._FPDFPageObj_Destroy=re(\"FPDFPageObj_Destroy\",1),i._FPDFPageObj_GetMarkedContentID=re(\"FPDFPageObj_GetMarkedContentID\",1),i._FPDFPageObj_CountMarks=re(\"FPDFPageObj_CountMarks\",1),i._FPDFPageObj_GetMark=re(\"FPDFPageObj_GetMark\",2),i._FPDFPageObj_AddMark=re(\"FPDFPageObj_AddMark\",2),i._FPDFPageObj_RemoveMark=re(\"FPDFPageObj_RemoveMark\",2),i._FPDFPageObjMark_GetName=re(\"FPDFPageObjMark_GetName\",4),i._FPDFPageObjMark_CountParams=re(\"FPDFPageObjMark_CountParams\",1),i._FPDFPageObjMark_GetParamKey=re(\"FPDFPageObjMark_GetParamKey\",5),i._FPDFPageObjMark_GetParamValueType=re(\"FPDFPageObjMark_GetParamValueType\",2),i._FPDFPageObjMark_GetParamIntValue=re(\"FPDFPageObjMark_GetParamIntValue\",3),i._FPDFPageObjMark_GetParamStringValue=re(\"FPDFPageObjMark_GetParamStringValue\",5),i._FPDFPageObjMark_GetParamBlobValue=re(\"FPDFPageObjMark_GetParamBlobValue\",5),i._FPDFPageObj_HasTransparency=re(\"FPDFPageObj_HasTransparency\",1),i._FPDFPageObjMark_SetIntParam=re(\"FPDFPageObjMark_SetIntParam\",5),i._FPDFPageObjMark_SetStringParam=re(\"FPDFPageObjMark_SetStringParam\",5),i._FPDFPageObjMark_SetBlobParam=re(\"FPDFPageObjMark_SetBlobParam\",6),i._FPDFPageObjMark_RemoveParam=re(\"FPDFPageObjMark_RemoveParam\",3),i._FPDFPageObj_GetType=re(\"FPDFPageObj_GetType\",1),i._FPDFPageObj_GetIsActive=re(\"FPDFPageObj_GetIsActive\",2),i._FPDFPageObj_SetIsActive=re(\"FPDFPageObj_SetIsActive\",2),i._FPDFPage_GenerateContent=re(\"FPDFPage_GenerateContent\",1),i._FPDFPageObj_Transform=re(\"FPDFPageObj_Transform\",7),i._FPDFPageObj_TransformF=re(\"FPDFPageObj_TransformF\",2),i._FPDFPageObj_GetMatrix=re(\"FPDFPageObj_GetMatrix\",2),i._FPDFPageObj_SetMatrix=re(\"FPDFPageObj_SetMatrix\",2),i._FPDFPageObj_SetBlendMode=re(\"FPDFPageObj_SetBlendMode\",2),i._FPDFPage_TransformAnnots=re(\"FPDFPage_TransformAnnots\",7),i._FPDFPage_SetRotation=re(\"FPDFPage_SetRotation\",2),i._FPDFPageObj_SetFillColor=re(\"FPDFPageObj_SetFillColor\",5),i._FPDFPageObj_GetFillColor=re(\"FPDFPageObj_GetFillColor\",5),i._FPDFPageObj_GetBounds=re(\"FPDFPageObj_GetBounds\",5),i._FPDFPageObj_GetRotatedBounds=re(\"FPDFPageObj_GetRotatedBounds\",2),i._FPDFPageObj_SetStrokeColor=re(\"FPDFPageObj_SetStrokeColor\",5),i._FPDFPageObj_GetStrokeColor=re(\"FPDFPageObj_GetStrokeColor\",5),i._FPDFPageObj_SetStrokeWidth=re(\"FPDFPageObj_SetStrokeWidth\",2),i._FPDFPageObj_GetStrokeWidth=re(\"FPDFPageObj_GetStrokeWidth\",2),i._FPDFPageObj_GetLineJoin=re(\"FPDFPageObj_GetLineJoin\",1),i._FPDFPageObj_SetLineJoin=re(\"FPDFPageObj_SetLineJoin\",2),i._FPDFPageObj_GetLineCap=re(\"FPDFPageObj_GetLineCap\",1),i._FPDFPageObj_SetLineCap=re(\"FPDFPageObj_SetLineCap\",2),i._FPDFPageObj_GetDashPhase=re(\"FPDFPageObj_GetDashPhase\",2),i._FPDFPageObj_SetDashPhase=re(\"FPDFPageObj_SetDashPhase\",2),i._FPDFPageObj_GetDashCount=re(\"FPDFPageObj_GetDashCount\",1),i._FPDFPageObj_GetDashArray=re(\"FPDFPageObj_GetDashArray\",3),i._FPDFPageObj_SetDashArray=re(\"FPDFPageObj_SetDashArray\",4),i._FPDFFormObj_CountObjects=re(\"FPDFFormObj_CountObjects\",1),i._FPDFFormObj_GetObject=re(\"FPDFFormObj_GetObject\",2),i._FPDFFormObj_RemoveObject=re(\"FPDFFormObj_RemoveObject\",2),i._FPDFPageObj_CreateNewPath=re(\"FPDFPageObj_CreateNewPath\",2),i._FPDFPageObj_CreateNewRect=re(\"FPDFPageObj_CreateNewRect\",4),i._FPDFPath_CountSegments=re(\"FPDFPath_CountSegments\",1),i._FPDFPath_GetPathSegment=re(\"FPDFPath_GetPathSegment\",2),i._FPDFPath_MoveTo=re(\"FPDFPath_MoveTo\",3),i._FPDFPath_LineTo=re(\"FPDFPath_LineTo\",3),i._FPDFPath_BezierTo=re(\"FPDFPath_BezierTo\",7),i._FPDFPath_Close=re(\"FPDFPath_Close\",1),i._FPDFPath_SetDrawMode=re(\"FPDFPath_SetDrawMode\",3),i._FPDFPath_GetDrawMode=re(\"FPDFPath_GetDrawMode\",3),i._FPDFPathSegment_GetPoint=re(\"FPDFPathSegment_GetPoint\",3),i._FPDFPathSegment_GetType=re(\"FPDFPathSegment_GetType\",1),i._FPDFPathSegment_GetClose=re(\"FPDFPathSegment_GetClose\",1),i._FPDFPageObj_NewTextObj=re(\"FPDFPageObj_NewTextObj\",3),i._FPDFText_SetText=re(\"FPDFText_SetText\",2),i._FPDFText_SetCharcodes=re(\"FPDFText_SetCharcodes\",3),i._FPDFText_LoadFont=re(\"FPDFText_LoadFont\",5),i._FPDFText_LoadStandardFont=re(\"FPDFText_LoadStandardFont\",2),i._FPDFText_LoadCidType2Font=re(\"FPDFText_LoadCidType2Font\",6),i._FPDFTextObj_GetFontSize=re(\"FPDFTextObj_GetFontSize\",2),i._FPDFTextObj_GetText=re(\"FPDFTextObj_GetText\",4),i._FPDFTextObj_GetRenderedBitmap=re(\"FPDFTextObj_GetRenderedBitmap\",4),i._FPDFFont_Close=re(\"FPDFFont_Close\",1),i._FPDFPageObj_CreateTextObj=re(\"FPDFPageObj_CreateTextObj\",3),i._FPDFTextObj_GetTextRenderMode=re(\"FPDFTextObj_GetTextRenderMode\",1),i._FPDFTextObj_SetTextRenderMode=re(\"FPDFTextObj_SetTextRenderMode\",2),i._FPDFTextObj_GetFont=re(\"FPDFTextObj_GetFont\",1),i._FPDFFont_GetBaseFontName=re(\"FPDFFont_GetBaseFontName\",3),i._FPDFFont_GetFamilyName=re(\"FPDFFont_GetFamilyName\",3),i._FPDFFont_GetFontData=re(\"FPDFFont_GetFontData\",4),i._FPDFFont_GetIsEmbedded=re(\"FPDFFont_GetIsEmbedded\",1),i._FPDFFont_GetFlags=re(\"FPDFFont_GetFlags\",1),i._FPDFFont_GetWeight=re(\"FPDFFont_GetWeight\",1),i._FPDFFont_GetItalicAngle=re(\"FPDFFont_GetItalicAngle\",2),i._FPDFFont_GetAscent=re(\"FPDFFont_GetAscent\",3),i._FPDFFont_GetDescent=re(\"FPDFFont_GetDescent\",3),i._FPDFFont_GetGlyphWidth=re(\"FPDFFont_GetGlyphWidth\",4),i._FPDFFont_GetGlyphPath=re(\"FPDFFont_GetGlyphPath\",3),i._FPDFGlyphPath_CountGlyphSegments=re(\"FPDFGlyphPath_CountGlyphSegments\",1),i._FPDFGlyphPath_GetGlyphPathSegment=re(\"FPDFGlyphPath_GetGlyphPathSegment\",2),i._FPDFDoc_GetPageMode=re(\"FPDFDoc_GetPageMode\",1),i._FPDFPage_Flatten=re(\"FPDFPage_Flatten\",2),i._FPDFPage_HasFormFieldAtPoint=re(\"FPDFPage_HasFormFieldAtPoint\",4),i._FPDFPage_FormFieldZOrderAtPoint=re(\"FPDFPage_FormFieldZOrderAtPoint\",4),i._malloc=re(\"malloc\",1),i._free=re(\"free\",1),i._FORM_OnMouseMove=re(\"FORM_OnMouseMove\",5),i._FORM_OnMouseWheel=re(\"FORM_OnMouseWheel\",6),i._FORM_OnFocus=re(\"FORM_OnFocus\",5),i._FORM_OnLButtonDown=re(\"FORM_OnLButtonDown\",5),i._FORM_OnLButtonUp=re(\"FORM_OnLButtonUp\",5),i._FORM_OnLButtonDoubleClick=re(\"FORM_OnLButtonDoubleClick\",5),i._FORM_OnRButtonDown=re(\"FORM_OnRButtonDown\",5),i._FORM_OnRButtonUp=re(\"FORM_OnRButtonUp\",5),i._FORM_OnKeyDown=re(\"FORM_OnKeyDown\",4),i._FORM_OnKeyUp=re(\"FORM_OnKeyUp\",4),i._FORM_OnChar=re(\"FORM_OnChar\",4),i._FORM_GetFocusedText=re(\"FORM_GetFocusedText\",4),i._FORM_GetSelectedText=re(\"FORM_GetSelectedText\",4),i._FORM_ReplaceAndKeepSelection=re(\"FORM_ReplaceAndKeepSelection\",3),i._FORM_ReplaceSelection=re(\"FORM_ReplaceSelection\",3),i._FORM_SelectAllText=re(\"FORM_SelectAllText\",2),i._FORM_CanUndo=re(\"FORM_CanUndo\",2),i._FORM_CanRedo=re(\"FORM_CanRedo\",2),i._FORM_Undo=re(\"FORM_Undo\",2),i._FORM_Redo=re(\"FORM_Redo\",2),i._FORM_ForceToKillFocus=re(\"FORM_ForceToKillFocus\",1),i._FORM_GetFocusedAnnot=re(\"FORM_GetFocusedAnnot\",3),i._FORM_SetFocusedAnnot=re(\"FORM_SetFocusedAnnot\",2),i._FPDF_FFLDraw=re(\"FPDF_FFLDraw\",9),i._FPDF_SetFormFieldHighlightColor=re(\"FPDF_SetFormFieldHighlightColor\",3),i._FPDF_SetFormFieldHighlightAlpha=re(\"FPDF_SetFormFieldHighlightAlpha\",2),i._FPDF_RemoveFormFieldHighlight=re(\"FPDF_RemoveFormFieldHighlight\",1),i._FORM_OnAfterLoadPage=re(\"FORM_OnAfterLoadPage\",2),i._FORM_OnBeforeClosePage=re(\"FORM_OnBeforeClosePage\",2),i._FORM_DoDocumentJSAction=re(\"FORM_DoDocumentJSAction\",1),i._FORM_DoDocumentOpenAction=re(\"FORM_DoDocumentOpenAction\",1),i._FORM_DoDocumentAAction=re(\"FORM_DoDocumentAAction\",2),i._FORM_DoPageAAction=re(\"FORM_DoPageAAction\",3),i._FORM_SetIndexSelected=re(\"FORM_SetIndexSelected\",4),i._FORM_IsIndexSelected=re(\"FORM_IsIndexSelected\",3),i._FPDFDoc_GetJavaScriptActionCount=re(\"FPDFDoc_GetJavaScriptActionCount\",1),i._FPDFDoc_GetJavaScriptAction=re(\"FPDFDoc_GetJavaScriptAction\",2),i._FPDFDoc_CloseJavaScriptAction=re(\"FPDFDoc_CloseJavaScriptAction\",1),i._FPDFJavaScriptAction_GetName=re(\"FPDFJavaScriptAction_GetName\",3),i._FPDFJavaScriptAction_GetScript=re(\"FPDFJavaScriptAction_GetScript\",3),i._FPDF_ImportPagesByIndex=re(\"FPDF_ImportPagesByIndex\",5),i._FPDF_ImportPages=re(\"FPDF_ImportPages\",4),i._FPDF_ImportNPagesToOne=re(\"FPDF_ImportNPagesToOne\",5),i._FPDF_NewXObjectFromPage=re(\"FPDF_NewXObjectFromPage\",3),i._FPDF_CloseXObject=re(\"FPDF_CloseXObject\",1),i._FPDF_NewFormObjectFromXObject=re(\"FPDF_NewFormObjectFromXObject\",1),i._FPDF_CopyViewerPreferences=re(\"FPDF_CopyViewerPreferences\",2),i._FPDF_RenderPageBitmapWithColorScheme_Start=re(\"FPDF_RenderPageBitmapWithColorScheme_Start\",10),i._FPDF_RenderPageBitmap_Start=re(\"FPDF_RenderPageBitmap_Start\",9),i._FPDF_RenderPage_Continue=re(\"FPDF_RenderPage_Continue\",2),i._FPDF_RenderPage_Close=re(\"FPDF_RenderPage_Close\",1),i._FPDF_SaveWithVersion=re(\"FPDF_SaveWithVersion\",4),i._FPDFText_GetCharIndexFromTextIndex=re(\"FPDFText_GetCharIndexFromTextIndex\",2),i._FPDFText_GetTextIndexFromCharIndex=re(\"FPDFText_GetTextIndexFromCharIndex\",2),i._FPDF_GetSignatureCount=re(\"FPDF_GetSignatureCount\",1),i._FPDF_GetSignatureObject=re(\"FPDF_GetSignatureObject\",2),i._FPDFSignatureObj_GetContents=re(\"FPDFSignatureObj_GetContents\",3),i._FPDFSignatureObj_GetByteRange=re(\"FPDFSignatureObj_GetByteRange\",3),i._FPDFSignatureObj_GetSubFilter=re(\"FPDFSignatureObj_GetSubFilter\",3),i._FPDFSignatureObj_GetReason=re(\"FPDFSignatureObj_GetReason\",3),i._FPDFSignatureObj_GetTime=re(\"FPDFSignatureObj_GetTime\",3),i._FPDFSignatureObj_GetDocMDPPermission=re(\"FPDFSignatureObj_GetDocMDPPermission\",1),i._FPDF_StructTree_GetForPage=re(\"FPDF_StructTree_GetForPage\",1),i._FPDF_StructTree_Close=re(\"FPDF_StructTree_Close\",1),i._FPDF_StructTree_CountChildren=re(\"FPDF_StructTree_CountChildren\",1),i._FPDF_StructTree_GetChildAtIndex=re(\"FPDF_StructTree_GetChildAtIndex\",2),i._FPDF_StructElement_GetAltText=re(\"FPDF_StructElement_GetAltText\",3),i._FPDF_StructElement_GetActualText=re(\"FPDF_StructElement_GetActualText\",3),i._FPDF_StructElement_GetID=re(\"FPDF_StructElement_GetID\",3),i._FPDF_StructElement_GetLang=re(\"FPDF_StructElement_GetLang\",3),i._FPDF_StructElement_GetAttributeCount=re(\"FPDF_StructElement_GetAttributeCount\",1),i._FPDF_StructElement_GetAttributeAtIndex=re(\"FPDF_StructElement_GetAttributeAtIndex\",2),i._FPDF_StructElement_GetStringAttribute=re(\"FPDF_StructElement_GetStringAttribute\",4),i._FPDF_StructElement_GetMarkedContentID=re(\"FPDF_StructElement_GetMarkedContentID\",1),i._FPDF_StructElement_GetType=re(\"FPDF_StructElement_GetType\",3),i._FPDF_StructElement_GetObjType=re(\"FPDF_StructElement_GetObjType\",3),i._FPDF_StructElement_GetTitle=re(\"FPDF_StructElement_GetTitle\",3),i._FPDF_StructElement_CountChildren=re(\"FPDF_StructElement_CountChildren\",1),i._FPDF_StructElement_GetChildAtIndex=re(\"FPDF_StructElement_GetChildAtIndex\",2),i._FPDF_StructElement_GetChildMarkedContentID=re(\"FPDF_StructElement_GetChildMarkedContentID\",2),i._FPDF_StructElement_GetParent=re(\"FPDF_StructElement_GetParent\",1),i._FPDF_StructElement_Attr_GetCount=re(\"FPDF_StructElement_Attr_GetCount\",1),i._FPDF_StructElement_Attr_GetName=re(\"FPDF_StructElement_Attr_GetName\",5),i._FPDF_StructElement_Attr_GetValue=re(\"FPDF_StructElement_Attr_GetValue\",2),i._FPDF_StructElement_Attr_GetType=re(\"FPDF_StructElement_Attr_GetType\",1),i._FPDF_StructElement_Attr_GetBooleanValue=re(\"FPDF_StructElement_Attr_GetBooleanValue\",2),i._FPDF_StructElement_Attr_GetNumberValue=re(\"FPDF_StructElement_Attr_GetNumberValue\",2),i._FPDF_StructElement_Attr_GetStringValue=re(\"FPDF_StructElement_Attr_GetStringValue\",4),i._FPDF_StructElement_Attr_GetBlobValue=re(\"FPDF_StructElement_Attr_GetBlobValue\",4),i._FPDF_StructElement_Attr_CountChildren=re(\"FPDF_StructElement_Attr_CountChildren\",1),i._FPDF_StructElement_Attr_GetChildAtIndex=re(\"FPDF_StructElement_Attr_GetChildAtIndex\",2),i._FPDF_StructElement_GetMarkedContentIdCount=re(\"FPDF_StructElement_GetMarkedContentIdCount\",1),i._FPDF_StructElement_GetMarkedContentIdAtIndex=re(\"FPDF_StructElement_GetMarkedContentIdAtIndex\",2),i._FPDF_AddInstalledFont=re(\"FPDF_AddInstalledFont\",3),i._FPDF_SetSystemFontInfo=re(\"FPDF_SetSystemFontInfo\",1),i._FPDF_GetDefaultTTFMap=re(\"FPDF_GetDefaultTTFMap\",0),i._FPDF_GetDefaultTTFMapCount=re(\"FPDF_GetDefaultTTFMapCount\",0),i._FPDF_GetDefaultTTFMapEntry=re(\"FPDF_GetDefaultTTFMapEntry\",1),i._FPDF_GetDefaultSystemFontInfo=re(\"FPDF_GetDefaultSystemFontInfo\",0),i._FPDF_FreeDefaultSystemFontInfo=re(\"FPDF_FreeDefaultSystemFontInfo\",1),i._FPDFText_LoadPage=re(\"FPDFText_LoadPage\",1),i._FPDFText_ClosePage=re(\"FPDFText_ClosePage\",1),i._FPDFText_CountChars=re(\"FPDFText_CountChars\",1),i._FPDFText_GetUnicode=re(\"FPDFText_GetUnicode\",2),i._FPDFText_GetTextObject=re(\"FPDFText_GetTextObject\",2),i._FPDFText_IsGenerated=re(\"FPDFText_IsGenerated\",2),i._FPDFText_IsHyphen=re(\"FPDFText_IsHyphen\",2),i._FPDFText_HasUnicodeMapError=re(\"FPDFText_HasUnicodeMapError\",2),i._FPDFText_GetFontSize=re(\"FPDFText_GetFontSize\",2),i._FPDFText_GetFontInfo=re(\"FPDFText_GetFontInfo\",5),i._FPDFText_GetFontWeight=re(\"FPDFText_GetFontWeight\",2),i._FPDFText_GetFillColor=re(\"FPDFText_GetFillColor\",6),i._FPDFText_GetStrokeColor=re(\"FPDFText_GetStrokeColor\",6),i._FPDFText_GetCharAngle=re(\"FPDFText_GetCharAngle\",2),i._FPDFText_GetCharBox=re(\"FPDFText_GetCharBox\",6),i._FPDFText_GetLooseCharBox=re(\"FPDFText_GetLooseCharBox\",3),i._FPDFText_GetMatrix=re(\"FPDFText_GetMatrix\",3),i._FPDFText_GetCharOrigin=re(\"FPDFText_GetCharOrigin\",4),i._FPDFText_GetCharIndexAtPos=re(\"FPDFText_GetCharIndexAtPos\",5),i._FPDFText_GetText=re(\"FPDFText_GetText\",4),i._FPDFText_CountRects=re(\"FPDFText_CountRects\",3),i._FPDFText_GetRect=re(\"FPDFText_GetRect\",6),i._FPDFText_GetBoundedText=re(\"FPDFText_GetBoundedText\",7),i._FPDFText_FindStart=re(\"FPDFText_FindStart\",4),i._FPDFText_FindNext=re(\"FPDFText_FindNext\",1),i._FPDFText_FindPrev=re(\"FPDFText_FindPrev\",1),i._FPDFText_GetSchResultIndex=re(\"FPDFText_GetSchResultIndex\",1),i._FPDFText_GetSchCount=re(\"FPDFText_GetSchCount\",1),i._FPDFText_FindClose=re(\"FPDFText_FindClose\",1),i._FPDFLink_LoadWebLinks=re(\"FPDFLink_LoadWebLinks\",1),i._FPDFLink_CountWebLinks=re(\"FPDFLink_CountWebLinks\",1),i._FPDFLink_GetURL=re(\"FPDFLink_GetURL\",4),i._FPDFLink_CountRects=re(\"FPDFLink_CountRects\",2),i._FPDFLink_GetRect=re(\"FPDFLink_GetRect\",7),i._FPDFLink_GetTextRange=re(\"FPDFLink_GetTextRange\",4),i._FPDFLink_CloseWebLinks=re(\"FPDFLink_CloseWebLinks\",1),i._FPDFPage_GetDecodedThumbnailData=re(\"FPDFPage_GetDecodedThumbnailData\",3),i._FPDFPage_GetRawThumbnailData=re(\"FPDFPage_GetRawThumbnailData\",3),i._FPDFPage_GetThumbnailAsBitmap=re(\"FPDFPage_GetThumbnailAsBitmap\",1),i._FPDFPage_SetMediaBox=re(\"FPDFPage_SetMediaBox\",5),i._FPDFPage_SetCropBox=re(\"FPDFPage_SetCropBox\",5),i._FPDFPage_SetBleedBox=re(\"FPDFPage_SetBleedBox\",5),i._FPDFPage_SetTrimBox=re(\"FPDFPage_SetTrimBox\",5),i._FPDFPage_SetArtBox=re(\"FPDFPage_SetArtBox\",5),i._FPDFPage_GetMediaBox=re(\"FPDFPage_GetMediaBox\",5),i._FPDFPage_GetCropBox=re(\"FPDFPage_GetCropBox\",5),i._FPDFPage_GetBleedBox=re(\"FPDFPage_GetBleedBox\",5),i._FPDFPage_GetTrimBox=re(\"FPDFPage_GetTrimBox\",5),i._FPDFPage_GetArtBox=re(\"FPDFPage_GetArtBox\",5),i._FPDFPage_TransFormWithClip=re(\"FPDFPage_TransFormWithClip\",3),i._FPDFPageObj_TransformClipPath=re(\"FPDFPageObj_TransformClipPath\",7),i._FPDFPageObj_GetClipPath=re(\"FPDFPageObj_GetClipPath\",1),i._FPDFClipPath_CountPaths=re(\"FPDFClipPath_CountPaths\",1),i._FPDFClipPath_CountPathSegments=re(\"FPDFClipPath_CountPathSegments\",2),i._FPDFClipPath_GetPathSegment=re(\"FPDFClipPath_GetPathSegment\",3),i._FPDF_CreateClipPath=re(\"FPDF_CreateClipPath\",4),i._FPDF_DestroyClipPath=re(\"FPDF_DestroyClipPath\",1),i._FPDFPage_InsertClipPath=re(\"FPDFPage_InsertClipPath\",2),i._FPDF_InitLibrary=re(\"FPDF_InitLibrary\",0),i._FPDF_DestroyLibrary=re(\"FPDF_DestroyLibrary\",0),i._FPDF_SetSandBoxPolicy=re(\"FPDF_SetSandBoxPolicy\",2),i._FPDF_LoadDocument=re(\"FPDF_LoadDocument\",2),i._FPDF_GetFormType=re(\"FPDF_GetFormType\",1),i._FPDF_LoadXFA=re(\"FPDF_LoadXFA\",1),i._FPDF_LoadMemDocument=re(\"FPDF_LoadMemDocument\",3),i._FPDF_LoadMemDocument64=re(\"FPDF_LoadMemDocument64\",3),i._FPDF_LoadCustomDocument=re(\"FPDF_LoadCustomDocument\",2),i._FPDF_GetFileVersion=re(\"FPDF_GetFileVersion\",2),i._FPDF_DocumentHasValidCrossReferenceTable=re(\"FPDF_DocumentHasValidCrossReferenceTable\",1),i._FPDF_GetDocPermissions=re(\"FPDF_GetDocPermissions\",1),i._FPDF_GetDocUserPermissions=re(\"FPDF_GetDocUserPermissions\",1),i._FPDF_GetSecurityHandlerRevision=re(\"FPDF_GetSecurityHandlerRevision\",1),i._FPDF_GetPageCount=re(\"FPDF_GetPageCount\",1),i._FPDF_LoadPage=re(\"FPDF_LoadPage\",2),i._FPDF_GetPageWidthF=re(\"FPDF_GetPageWidthF\",1),i._FPDF_GetPageWidth=re(\"FPDF_GetPageWidth\",1),i._FPDF_GetPageHeightF=re(\"FPDF_GetPageHeightF\",1),i._FPDF_GetPageHeight=re(\"FPDF_GetPageHeight\",1),i._FPDF_GetPageBoundingBox=re(\"FPDF_GetPageBoundingBox\",2),i._FPDF_RenderPageBitmap=re(\"FPDF_RenderPageBitmap\",8),i._FPDF_RenderPageBitmapWithMatrix=re(\"FPDF_RenderPageBitmapWithMatrix\",5),i._EPDF_RenderAnnotBitmap=re(\"EPDF_RenderAnnotBitmap\",6),i._FPDF_ClosePage=re(\"FPDF_ClosePage\",1),i._FPDF_CloseDocument=re(\"FPDF_CloseDocument\",1),i._FPDF_GetLastError=re(\"FPDF_GetLastError\",0),i._FPDF_DeviceToPage=re(\"FPDF_DeviceToPage\",10),i._FPDF_PageToDevice=re(\"FPDF_PageToDevice\",10),i._FPDFBitmap_Create=re(\"FPDFBitmap_Create\",3),i._FPDFBitmap_CreateEx=re(\"FPDFBitmap_CreateEx\",5),i._FPDFBitmap_GetFormat=re(\"FPDFBitmap_GetFormat\",1),i._FPDFBitmap_FillRect=re(\"FPDFBitmap_FillRect\",6),i._FPDFBitmap_GetBuffer=re(\"FPDFBitmap_GetBuffer\",1),i._FPDFBitmap_GetWidth=re(\"FPDFBitmap_GetWidth\",1),i._FPDFBitmap_GetHeight=re(\"FPDFBitmap_GetHeight\",1),i._FPDFBitmap_GetStride=re(\"FPDFBitmap_GetStride\",1),i._FPDFBitmap_Destroy=re(\"FPDFBitmap_Destroy\",1),i._FPDF_GetPageSizeByIndexF=re(\"FPDF_GetPageSizeByIndexF\",3),i._FPDF_GetPageSizeByIndex=re(\"FPDF_GetPageSizeByIndex\",4),i._FPDF_VIEWERREF_GetPrintScaling=re(\"FPDF_VIEWERREF_GetPrintScaling\",1),i._FPDF_VIEWERREF_GetNumCopies=re(\"FPDF_VIEWERREF_GetNumCopies\",1),i._FPDF_VIEWERREF_GetPrintPageRange=re(\"FPDF_VIEWERREF_GetPrintPageRange\",1),i._FPDF_VIEWERREF_GetPrintPageRangeCount=re(\"FPDF_VIEWERREF_GetPrintPageRangeCount\",1),i._FPDF_VIEWERREF_GetPrintPageRangeElement=re(\"FPDF_VIEWERREF_GetPrintPageRangeElement\",2),i._FPDF_VIEWERREF_GetDuplex=re(\"FPDF_VIEWERREF_GetDuplex\",1),i._FPDF_VIEWERREF_GetName=re(\"FPDF_VIEWERREF_GetName\",4),i._FPDF_CountNamedDests=re(\"FPDF_CountNamedDests\",1),i._FPDF_GetNamedDestByName=re(\"FPDF_GetNamedDestByName\",2),i._FPDF_GetNamedDest=re(\"FPDF_GetNamedDest\",4),i._FPDF_GetXFAPacketCount=re(\"FPDF_GetXFAPacketCount\",1),i._FPDF_GetXFAPacketName=re(\"FPDF_GetXFAPacketName\",4),i._FPDF_GetXFAPacketContent=re(\"FPDF_GetXFAPacketContent\",5),i._FPDF_GetTrailerEnds=re(\"FPDF_GetTrailerEnds\",3);var it,at,st=re(\"fflush\",1),ut=re(\"emscripten_builtin_memalign\",2),Ft=re(\"strerror\",1),mt=re(\"setThrew\",2),lt=()=>(lt=ot.emscripten_stack_init)(),dt=()=>(dt=ot.emscripten_stack_get_end)(),_t=e=>(_t=ot._emscripten_stack_restore)(e),Pt=e=>(Pt=ot._emscripten_stack_alloc)(e),ct=()=>(ct=ot.emscripten_stack_get_current)();function gt(){var e;lt(),I(!(3&(e=dt()))),0==e&&(e+=4),v[e>>2]=34821223,v[e+4>>2]=2310721022,v[0]=1668509029}function ht(){var e;function t(){it||(it=1,i.calledRun=1,R||(I(!U),U=!0,j(),i.noFSInit||Le.initialized||Le.init(),Le.ignorePermissions=!1,de(B),r(i),i.onRuntimeInitialized?.(),I(!i._main,'compiled without a main, but one is present. if you added it from JS, use Module[\"onRuntimeInitialized\"]'),function(){j();var e=i.postRun;e&&(\"function\"==typeof e&&(e=[e]),e.forEach(z)),de(N)}()))}W>0||(gt(),!at&&(at=1,(e=i.preRun)&&(\"function\"==typeof e&&(e=[e]),e.forEach(V)),de(L),W>0)||(i.setStatus?(i.setStatus(\"Running...\"),setTimeout((()=>{setTimeout((()=>i.setStatus(\"\")),1),t()}),1)):t(),j()))}if(i.dynCall_ji=re(\"dynCall_ji\",2),i.dynCall_jij=re(\"dynCall_jij\",4),i.dynCall_iiij=re(\"dynCall_iiij\",5),i.dynCall_iij=re(\"dynCall_iij\",4),i.dynCall_j=re(\"dynCall_j\",1),i.dynCall_jji=re(\"dynCall_jji\",4),i.dynCall_iji=re(\"dynCall_iji\",4),i.dynCall_viijii=re(\"dynCall_viijii\",7),i.dynCall_iiji=re(\"dynCall_iiji\",5),i.dynCall_jiji=re(\"dynCall_jiji\",5),i.dynCall_iiiiij=re(\"dynCall_iiiiij\",7),i.dynCall_iiiiijj=re(\"dynCall_iiiiijj\",9),i.dynCall_iiiiiijj=re(\"dynCall_iiiiiijj\",10),i.dynCall_viji=re(\"dynCall_viji\",5),i.wasmExports=ot,i.ccall=nt,i.cwrap=(e,t,n,r)=>(...r)=>nt(e,t,n,r),i.addFunction=(e,t)=>{I(void 0!==e);var n=Qe(e);if(n)return n;var r=(()=>{if(Ze.length)return Ze.pop();try{Me.grow(1)}catch(e){if(!(e instanceof RangeError))throw e;throw\"Unable to grow wasm table. Set ALLOW_TABLE_GROWTH.\"}return Me.length-1})();try{et(r,e)}catch(n){if(!(n instanceof TypeError))throw n;I(void 0!==t,\"Missing signature argument to addFunction: \"+e);var o=qe(e,t);et(r,o)}return Oe.set(e,r),r},i.removeFunction=e=>{Oe.delete(Ke(e)),et(e,null),Ze.push(e)},i.setValue=function(e,t,n=\"i8\"){switch(n.endsWith(\"*\")&&(n=\"*\"),n){case\"i1\":case\"i8\":C[e]=t;break;case\"i16\":T[e>>1]=t;break;case\"i32\":O[e>>2]=t;break;case\"i64\":q(\"to do setValue(i64) use WASM_BIGINT\");case\"float\":x[e>>2]=t;break;case\"double\":w[e>>3]=t;break;case\"*\":v[e>>2]=t;break;default:q(`invalid type for setValue: ${n}`)}},i.getValue=function(e,t=\"i8\"){switch(t.endsWith(\"*\")&&(t=\"*\"),t){case\"i1\":case\"i8\":return C[e];case\"i16\":return T[e>>1];case\"i32\":return O[e>>2];case\"i64\":q(\"to do getValue(i64) use WASM_BIGINT\");case\"float\":return x[e>>2];case\"double\":return w[e>>3];case\"*\":return v[e>>2];default:q(`invalid type for getValue: ${t}`)}},i.UTF8ToString=be,i.stringToUTF8=Ue,i.UTF16ToString=(e,t)=>{I(e%2==0,\"Pointer passed to UTF16ToString must be aligned to two bytes!\");for(var n=e,r=n>>1,o=r+t/2;!(r>=o)&&M[r];)++r;if((n=r<<1)-e>32&&Ye)return Ye.decode(y.subarray(e,n));for(var i=\"\",a=0;!(a>=t/2);++a){var s=T[e+2*a>>1];if(0==s)break;i+=String.fromCharCode(s)}return i},i.stringToUTF16=(e,t,n)=>{if(I(t%2==0,\"Pointer passed to stringToUTF16 must be aligned to two bytes!\"),I(\"number\"==typeof n,\"stringToUTF16(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!\"),n??=2147483647,n<2)return 0;for(var r=t,o=(n-=2)<2*e.length?n/2:e.length,i=0;i<o;++i){var a=e.charCodeAt(i);T[t>>1]=a,t+=2}return T[t>>1]=0,t-r},[\"writeI53ToI64\",\"writeI53ToI64Clamped\",\"writeI53ToI64Signaling\",\"writeI53ToU64Clamped\",\"writeI53ToU64Signaling\",\"readI53FromI64\",\"readI53FromU64\",\"convertI32PairToI53\",\"convertU32PairToI53\",\"getTempRet0\",\"setTempRet0\",\"exitJS\",\"inetPton4\",\"inetNtop4\",\"inetPton6\",\"inetNtop6\",\"readSockaddr\",\"writeSockaddr\",\"emscriptenLog\",\"readEmAsmArgs\",\"jstoi_q\",\"listenOnce\",\"autoResumeAudioContext\",\"dynCallLegacy\",\"getDynCaller\",\"dynCall\",\"handleException\",\"keepRuntimeAlive\",\"runtimeKeepalivePush\",\"runtimeKeepalivePop\",\"callUserCallback\",\"maybeExit\",\"asmjsMangle\",\"HandleAllocator\",\"getNativeTypeSize\",\"STACK_SIZE\",\"STACK_ALIGN\",\"POINTER_SIZE\",\"ASSERTIONS\",\"reallyNegative\",\"unSign\",\"strLen\",\"reSign\",\"formatString\",\"intArrayToString\",\"AsciiToString\",\"lengthBytesUTF16\",\"UTF32ToString\",\"stringToUTF32\",\"lengthBytesUTF32\",\"stringToNewUTF8\",\"registerKeyEventCallback\",\"maybeCStringToJsString\",\"findEventTarget\",\"getBoundingClientRect\",\"fillMouseEventData\",\"registerMouseEventCallback\",\"registerWheelEventCallback\",\"registerUiEventCallback\",\"registerFocusEventCallback\",\"fillDeviceOrientationEventData\",\"registerDeviceOrientationEventCallback\",\"fillDeviceMotionEventData\",\"registerDeviceMotionEventCallback\",\"screenOrientation\",\"fillOrientationChangeEventData\",\"registerOrientationChangeEventCallback\",\"fillFullscreenChangeEventData\",\"registerFullscreenChangeEventCallback\",\"JSEvents_requestFullscreen\",\"JSEvents_resizeCanvasForFullscreen\",\"registerRestoreOldStyle\",\"hideEverythingExceptGivenElement\",\"restoreHiddenElements\",\"setLetterbox\",\"softFullscreenResizeWebGLRenderTarget\",\"doRequestFullscreen\",\"fillPointerlockChangeEventData\",\"registerPointerlockChangeEventCallback\",\"registerPointerlockErrorEventCallback\",\"requestPointerLock\",\"fillVisibilityChangeEventData\",\"registerVisibilityChangeEventCallback\",\"registerTouchEventCallback\",\"fillGamepadEventData\",\"registerGamepadEventCallback\",\"registerBeforeUnloadEventCallback\",\"fillBatteryEventData\",\"battery\",\"registerBatteryEventCallback\",\"setCanvasElementSize\",\"getCanvasElementSize\",\"jsStackTrace\",\"getCallstack\",\"convertPCtoSourceLocation\",\"checkWasiClock\",\"wasiRightsToMuslOFlags\",\"wasiOFlagsToMuslOFlags\",\"createDyncallWrapper\",\"safeSetTimeout\",\"setImmediateWrapped\",\"clearImmediateWrapped\",\"polyfillSetImmediate\",\"registerPostMainLoop\",\"registerPreMainLoop\",\"getPromise\",\"makePromise\",\"idsToPromises\",\"makePromiseCallback\",\"ExceptionInfo\",\"findMatchingCatch\",\"Browser_asyncPrepareDataCounter\",\"safeRequestAnimationFrame\",\"arraySum\",\"addDays\",\"getSocketFromFD\",\"getSocketAddress\",\"FS_unlink\",\"FS_mkdirTree\",\"_setNetworkCallback\",\"heapObjectForWebGLType\",\"toTypedArrayIndex\",\"webgl_enable_ANGLE_instanced_arrays\",\"webgl_enable_OES_vertex_array_object\",\"webgl_enable_WEBGL_draw_buffers\",\"webgl_enable_WEBGL_multi_draw\",\"webgl_enable_EXT_polygon_offset_clamp\",\"webgl_enable_EXT_clip_control\",\"webgl_enable_WEBGL_polygon_mode\",\"emscriptenWebGLGet\",\"computeUnpackAlignedImageSize\",\"colorChannelsInGlTextureFormat\",\"emscriptenWebGLGetTexPixelData\",\"emscriptenWebGLGetUniform\",\"webglGetUniformLocation\",\"webglPrepareUniformLocationsBeforeFirstUse\",\"webglGetLeftBracePos\",\"emscriptenWebGLGetVertexAttrib\",\"__glGetActiveAttribOrUniform\",\"writeGLArray\",\"registerWebGlEventCallback\",\"runAndAbortIfError\",\"ALLOC_NORMAL\",\"ALLOC_STACK\",\"allocate\",\"writeStringToMemory\",\"writeAsciiToMemory\",\"setErrNo\",\"demangle\",\"stackTrace\"].forEach((function(e){Fe(e,(()=>{var t=`\\`${e}\\` is a library symbol and not included by default; add it to your library.js __deps or to DEFAULT_LIBRARY_FUNCS_TO_INCLUDE on the command line`,n=e;n.startsWith(\"_\")||(n=\"$\"+e),t+=` (e.g. -sDEFAULT_LIBRARY_FUNCS_TO_INCLUDE='${n}')`,ue(e)&&(t+=\". Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you\"),ge(t)})),le(e)})),[\"run\",\"addOnPreRun\",\"addOnInit\",\"addOnPreMain\",\"addOnExit\",\"addOnPostRun\",\"addRunDependency\",\"removeRunDependency\",\"out\",\"err\",\"callMain\",\"abort\",\"wasmMemory\",\"writeStackCookie\",\"checkStackCookie\",\"convertI32PairToI53Checked\",\"stackSave\",\"stackRestore\",\"stackAlloc\",\"ptrToString\",\"zeroMemory\",\"getHeapMax\",\"growMemory\",\"ENV\",\"ERRNO_CODES\",\"strError\",\"DNS\",\"Protocols\",\"Sockets\",\"initRandomFill\",\"randomFill\",\"timers\",\"warnOnce\",\"readEmAsmArgsArray\",\"jstoi_s\",\"getExecutableName\",\"asyncLoad\",\"alignMemory\",\"mmapAlloc\",\"wasmTable\",\"noExitRuntime\",\"getCFunc\",\"uleb128Encode\",\"sigToWasmTypes\",\"generateFuncType\",\"convertJsFunctionToWasm\",\"freeTableIndexes\",\"functionsInTableMap\",\"getEmptyTableSlot\",\"updateTableMap\",\"getFunctionAddress\",\"PATH\",\"PATH_FS\",\"UTF8Decoder\",\"UTF8ArrayToString\",\"stringToUTF8Array\",\"lengthBytesUTF8\",\"intArrayFromString\",\"stringToAscii\",\"UTF16Decoder\",\"stringToUTF8OnStack\",\"writeArrayToMemory\",\"JSEvents\",\"specialHTMLTargets\",\"findCanvasEventTarget\",\"currentFullscreenStrategy\",\"restoreOldWindowedStyle\",\"UNWIND_CACHE\",\"ExitStatus\",\"getEnvStrings\",\"doReadv\",\"doWritev\",\"promiseMap\",\"uncaughtExceptionCount\",\"exceptionLast\",\"exceptionCaught\",\"Browser\",\"getPreloadedImageData__data\",\"wget\",\"MONTH_DAYS_REGULAR\",\"MONTH_DAYS_LEAP\",\"MONTH_DAYS_REGULAR_CUMULATIVE\",\"MONTH_DAYS_LEAP_CUMULATIVE\",\"isLeapYear\",\"ydayFromDate\",\"SYSCALLS\",\"preloadPlugins\",\"FS_createPreloadedFile\",\"FS_modeStringToFlags\",\"FS_getMode\",\"FS_stdin_getChar_buffer\",\"FS_stdin_getChar\",\"FS_createPath\",\"FS_createDevice\",\"FS_readFile\",\"FS\",\"FS_createDataFile\",\"FS_createLazyFile\",\"MEMFS\",\"TTY\",\"PIPEFS\",\"SOCKFS\",\"tempFixedLengthArray\",\"miniTempWebGLFloatBuffers\",\"miniTempWebGLIntBuffers\",\"GL\",\"AL\",\"GLUT\",\"EGL\",\"GLEW\",\"IDBStore\",\"SDL\",\"SDL_gfx\",\"allocateUTF8\",\"allocateUTF8OnStack\",\"print\",\"printErr\"].forEach(le),$=function e(){it||ht(),it||($=e)},i.preInit)for(\"function\"==typeof i.preInit&&(i.preInit=[i.preInit]);i.preInit.length>0;)i.preInit.pop()();ht(),n=a;for(const e of Object.keys(i))e in t||Object.defineProperty(t,e,{configurable:!0,get(){q(`Access to module property ('${e}') is no longer possible via the module constructor argument; Instead, use the result of the module constructor.`)}});return n});const n={EPDF_RenderAnnotBitmap:[[\"number\",\"number\",\"number\",\"number\",\"number\",\"number\"],\"boolean\"],EPDFAnnot_GenerateAppearance:[[\"number\"],\"boolean\"],EPDFAnnot_GetBorderDashPattern:[[\"number\",\"number\",\"number\"],\"boolean\"],EPDFAnnot_GetBorderDashPatternCount:[[\"number\"],\"number\"],EPDFAnnot_GetBorderEffect:[[\"number\",\"number\"],\"boolean\"],EPDFAnnot_GetBorderStyle:[[\"number\",\"number\"],\"number\"],EPDFAnnot_GetColor:[[\"number\",\"number\",\"number\",\"number\",\"number\",\"number\"],\"boolean\"],EPDFAnnot_GetRectangleDifferences:[[\"number\",\"number\",\"number\",\"number\",\"number\"],\"boolean\"],EPDFAnnot_SetBorderStyle:[[\"number\",\"number\",\"number\"],\"boolean\"],EPDFAnnot_SetColor:[[\"number\",\"number\",\"number\",\"number\",\"number\",\"number\"],\"boolean\"],FORM_CanRedo:[[\"number\",\"number\"],\"boolean\"],FORM_CanUndo:[[\"number\",\"number\"],\"boolean\"],FORM_DoDocumentAAction:[[\"number\",\"number\"],null],FORM_DoDocumentJSAction:[[\"number\"],null],FORM_DoDocumentOpenAction:[[\"number\"],null],FORM_DoPageAAction:[[\"number\",\"number\",\"number\"],null],FORM_ForceToKillFocus:[[\"number\"],\"boolean\"],FORM_GetFocusedAnnot:[[\"number\",\"number\",\"number\"],\"boolean\"],FORM_GetFocusedText:[[\"number\",\"number\",\"number\",\"number\"],\"number\"],FORM_GetSelectedText:[[\"number\",\"number\",\"number\",\"number\"],\"number\"],FORM_IsIndexSelected:[[\"number\",\"number\",\"number\"],\"boolean\"],FORM_OnAfterLoadPage:[[\"number\",\"number\"],null],FORM_OnBeforeClosePage:[[\"number\",\"number\"],null],FORM_OnChar:[[\"number\",\"number\",\"number\",\"number\"],\"boolean\"],FORM_OnFocus:[[\"number\",\"number\",\"number\",\"number\",\"number\"],\"boolean\"],FORM_OnKeyDown:[[\"number\",\"number\",\"number\",\"number\"],\"boolean\"],FORM_OnKeyUp:[[\"number\",\"number\",\"number\",\"number\"],\"boolean\"],FORM_OnLButtonDoubleClick:[[\"number\",\"number\",\"number\",\"number\",\"number\"],\"boolean\"],FORM_OnLButtonDown:[[\"number\",\"number\",\"number\",\"number\",\"number\"],\"boolean\"],FORM_OnLButtonUp:[[\"number\",\"number\",\"number\",\"number\",\"number\"],\"boolean\"],FORM_OnMouseMove:[[\"number\",\"number\",\"number\",\"number\",\"number\"],\"boolean\"],FORM_OnMouseWheel:[[\"number\",\"number\",\"number\",\"number\",\"number\",\"number\"],\"boolean\"],FORM_OnRButtonDown:[[\"number\",\"number\",\"number\",\"number\",\"number\"],\"boolean\"],FORM_OnRButtonUp:[[\"number\",\"number\",\"number\",\"number\",\"number\"],\"boolean\"],FORM_Redo:[[\"number\",\"number\"],\"boolean\"],FORM_ReplaceAndKeepSelection:[[\"number\",\"number\",\"number\"],null],FORM_ReplaceSelection:[[\"number\",\"number\",\"number\"],null],FORM_SelectAllText:[[\"number\",\"number\"],\"boolean\"],FORM_SetFocusedAnnot:[[\"number\",\"number\"],\"boolean\"],FORM_SetIndexSelected:[[\"number\",\"number\",\"number\",\"boolean\"],\"boolean\"],FORM_Undo:[[\"number\",\"number\"],\"boolean\"],FPDF_AddInstalledFont:[[\"number\",\"number\",\"number\"],null],FPDF_CloseDocument:[[\"number\"],null],FPDF_ClosePage:[[\"number\"],null],FPDF_CloseXObject:[[\"number\"],null],FPDF_CopyViewerPreferences:[[\"number\",\"number\"],\"boolean\"],FPDF_CountNamedDests:[[\"number\"],\"number\"],FPDF_CreateClipPath:[[\"number\",\"number\",\"number\",\"number\"],\"number\"],FPDF_CreateNewDocument:[[],\"number\"],FPDF_DestroyClipPath:[[\"number\"],null],FPDF_DestroyLibrary:[[],null],FPDF_DeviceToPage:[[\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\"],\"boolean\"],FPDF_DocumentHasValidCrossReferenceTable:[[\"number\"],\"boolean\"],FPDF_FFLDraw:[[\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\"],null],FPDF_FreeDefaultSystemFontInfo:[[\"number\"],null],FPDF_GetDefaultSystemFontInfo:[[],\"number\"],FPDF_GetDefaultTTFMap:[[],\"number\"],FPDF_GetDefaultTTFMapCount:[[],\"number\"],FPDF_GetDefaultTTFMapEntry:[[\"number\"],\"number\"],FPDF_GetDocPermissions:[[\"number\"],\"number\"],FPDF_GetDocUserPermissions:[[\"number\"],\"number\"],FPDF_GetFileIdentifier:[[\"number\",\"number\",\"number\",\"number\"],\"number\"],FPDF_GetFileVersion:[[\"number\",\"number\"],\"boolean\"],FPDF_GetFormType:[[\"number\"],\"number\"],FPDF_GetLastError:[[],\"number\"],FPDF_GetMetaText:[[\"number\",\"string\",\"number\",\"number\"],\"number\"],FPDF_GetNamedDest:[[\"number\",\"number\",\"number\",\"number\"],\"number\"],FPDF_GetNamedDestByName:[[\"number\",\"string\"],\"number\"],FPDF_GetPageAAction:[[\"number\",\"number\"],\"number\"],FPDF_GetPageBoundingBox:[[\"number\",\"number\"],\"boolean\"],FPDF_GetPageCount:[[\"number\"],\"number\"],FPDF_GetPageHeight:[[\"number\"],\"number\"],FPDF_GetPageHeightF:[[\"number\"],\"number\"],FPDF_GetPageLabel:[[\"number\",\"number\",\"number\",\"number\"],\"number\"],FPDF_GetPageSizeByIndex:[[\"number\",\"number\",\"number\",\"number\"],\"number\"],FPDF_GetPageSizeByIndexF:[[\"number\",\"number\",\"number\"],\"boolean\"],FPDF_GetPageWidth:[[\"number\"],\"number\"],FPDF_GetPageWidthF:[[\"number\"],\"number\"],FPDF_GetSecurityHandlerRevision:[[\"number\"],\"number\"],FPDF_GetSignatureCount:[[\"number\"],\"number\"],FPDF_GetSignatureObject:[[\"number\",\"number\"],\"number\"],FPDF_GetTrailerEnds:[[\"number\",\"number\",\"number\"],\"number\"],FPDF_GetXFAPacketContent:[[\"number\",\"number\",\"number\",\"number\",\"number\"],\"boolean\"],FPDF_GetXFAPacketCount:[[\"number\"],\"number\"],FPDF_GetXFAPacketName:[[\"number\",\"number\",\"number\",\"number\"],\"number\"],FPDF_ImportNPagesToOne:[[\"number\",\"number\",\"number\",\"number\",\"number\"],\"number\"],FPDF_ImportPages:[[\"number\",\"number\",\"string\",\"number\"],\"boolean\"],FPDF_ImportPagesByIndex:[[\"number\",\"number\",\"number\",\"number\",\"number\"],\"boolean\"],FPDF_InitLibrary:[[],null],FPDF_InitLibraryWithConfig:[[\"number\"],null],FPDF_LoadCustomDocument:[[\"number\",\"string\"],\"number\"],FPDF_LoadDocument:[[\"number\",\"string\"],\"number\"],FPDF_LoadMemDocument:[[\"number\",\"number\",\"string\"],\"number\"],FPDF_LoadMemDocument64:[[\"number\",\"number\",\"string\"],\"number\"],FPDF_LoadPage:[[\"number\",\"number\"],\"number\"],FPDF_LoadXFA:[[\"number\"],\"boolean\"],FPDF_MovePages:[[\"number\",\"number\",\"number\",\"number\"],\"boolean\"],FPDF_NewFormObjectFromXObject:[[\"number\"],\"number\"],FPDF_NewXObjectFromPage:[[\"number\",\"number\",\"number\"],\"number\"],FPDF_PageToDevice:[[\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\"],\"boolean\"],FPDF_RemoveFormFieldHighlight:[[\"number\"],null],FPDF_RenderPage_Close:[[\"number\"],null],FPDF_RenderPage_Continue:[[\"number\",\"number\"],\"number\"],FPDF_RenderPageBitmap:[[\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\"],null],FPDF_RenderPageBitmap_Start:[[\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\"],\"number\"],FPDF_RenderPageBitmapWithColorScheme_Start:[[\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\"],\"number\"],FPDF_RenderPageBitmapWithMatrix:[[\"number\",\"number\",\"number\",\"number\",\"number\"],null],FPDF_SaveAsCopy:[[\"number\",\"number\",\"number\"],\"boolean\"],FPDF_SaveWithVersion:[[\"number\",\"number\",\"number\",\"number\"],\"boolean\"],FPDF_SetFormFieldHighlightAlpha:[[\"number\",\"number\"],null],FPDF_SetFormFieldHighlightColor:[[\"number\",\"number\",\"number\"],null],FPDF_SetSandBoxPolicy:[[\"number\",\"boolean\"],null],FPDF_SetSystemFontInfo:[[\"number\"],null],FPDF_StructElement_Attr_CountChildren:[[\"number\"],\"number\"],FPDF_StructElement_Attr_GetBlobValue:[[\"number\",\"number\",\"number\",\"number\"],\"boolean\"],FPDF_StructElement_Attr_GetBooleanValue:[[\"number\",\"number\"],\"boolean\"],FPDF_StructElement_Attr_GetChildAtIndex:[[\"number\",\"number\"],\"number\"],FPDF_StructElement_Attr_GetCount:[[\"number\"],\"number\"],FPDF_StructElement_Attr_GetName:[[\"number\",\"number\",\"number\",\"number\",\"number\"],\"boolean\"],FPDF_StructElement_Attr_GetNumberValue:[[\"number\",\"number\"],\"boolean\"],FPDF_StructElement_Attr_GetStringValue:[[\"number\",\"number\",\"number\",\"number\"],\"boolean\"],FPDF_StructElement_Attr_GetType:[[\"number\"],\"number\"],FPDF_StructElement_Attr_GetValue:[[\"number\",\"string\"],\"number\"],FPDF_StructElement_CountChildren:[[\"number\"],\"number\"],FPDF_StructElement_GetActualText:[[\"number\",\"number\",\"number\"],\"number\"],FPDF_StructElement_GetAltText:[[\"number\",\"number\",\"number\"],\"number\"],FPDF_StructElement_GetAttributeAtIndex:[[\"number\",\"number\"],\"number\"],FPDF_StructElement_GetAttributeCount:[[\"number\"],\"number\"],FPDF_StructElement_GetChildAtIndex:[[\"number\",\"number\"],\"number\"],FPDF_StructElement_GetChildMarkedContentID:[[\"number\",\"number\"],\"number\"],FPDF_StructElement_GetID:[[\"number\",\"number\",\"number\"],\"number\"],FPDF_StructElement_GetLang:[[\"number\",\"number\",\"number\"],\"number\"],FPDF_StructElement_GetMarkedContentID:[[\"number\"],\"number\"],FPDF_StructElement_GetMarkedContentIdAtIndex:[[\"number\",\"number\"],\"number\"],FPDF_StructElement_GetMarkedContentIdCount:[[\"number\"],\"number\"],FPDF_StructElement_GetObjType:[[\"number\",\"number\",\"number\"],\"number\"],FPDF_StructElement_GetParent:[[\"number\"],\"number\"],FPDF_StructElement_GetStringAttribute:[[\"number\",\"string\",\"number\",\"number\"],\"number\"],FPDF_StructElement_GetTitle:[[\"number\",\"number\",\"number\"],\"number\"],FPDF_StructElement_GetType:[[\"number\",\"number\",\"number\"],\"number\"],FPDF_StructTree_Close:[[\"number\"],null],FPDF_StructTree_CountChildren:[[\"number\"],\"number\"],FPDF_StructTree_GetChildAtIndex:[[\"number\",\"number\"],\"number\"],FPDF_StructTree_GetForPage:[[\"number\"],\"number\"],FPDF_VIEWERREF_GetDuplex:[[\"number\"],\"number\"],FPDF_VIEWERREF_GetName:[[\"number\",\"string\",\"number\",\"number\"],\"number\"],FPDF_VIEWERREF_GetNumCopies:[[\"number\"],\"number\"],FPDF_VIEWERREF_GetPrintPageRange:[[\"number\"],\"number\"],FPDF_VIEWERREF_GetPrintPageRangeCount:[[\"number\"],\"number\"],FPDF_VIEWERREF_GetPrintPageRangeElement:[[\"number\",\"number\"],\"number\"],FPDF_VIEWERREF_GetPrintScaling:[[\"number\"],\"boolean\"],FPDFAction_GetDest:[[\"number\",\"number\"],\"number\"],FPDFAction_GetFilePath:[[\"number\",\"number\",\"number\"],\"number\"],FPDFAction_GetType:[[\"number\"],\"number\"],FPDFAction_GetURIPath:[[\"number\",\"number\",\"number\",\"number\"],\"number\"],FPDFAnnot_AddFileAttachment:[[\"number\",\"number\"],\"number\"],FPDFAnnot_AddInkStroke:[[\"number\",\"number\",\"number\"],\"number\"],FPDFAnnot_AppendAttachmentPoints:[[\"number\",\"number\"],\"boolean\"],FPDFAnnot_AppendObject:[[\"number\",\"number\"],\"boolean\"],FPDFAnnot_CountAttachmentPoints:[[\"number\"],\"number\"],FPDFAnnot_GetAP:[[\"number\",\"number\",\"number\",\"number\"],\"number\"],FPDFAnnot_GetAttachmentPoints:[[\"number\",\"number\",\"number\"],\"boolean\"],FPDFAnnot_GetBorder:[[\"number\",\"number\",\"number\",\"number\"],\"boolean\"],FPDFAnnot_GetColor:[[\"number\",\"number\",\"number\",\"number\",\"number\",\"number\"],\"boolean\"],FPDFAnnot_GetFileAttachment:[[\"number\"],\"number\"],FPDFAnnot_GetFlags:[[\"number\"],\"number\"],FPDFAnnot_GetFocusableSubtypes:[[\"number\",\"number\",\"number\"],\"boolean\"],FPDFAnnot_GetFocusableSubtypesCount:[[\"number\"],\"number\"],FPDFAnnot_GetFontColor:[[\"number\",\"number\",\"number\",\"number\",\"number\"],\"boolean\"],FPDFAnnot_GetFontSize:[[\"number\",\"number\",\"number\"],\"boolean\"],FPDFAnnot_GetFormAdditionalActionJavaScript:[[\"number\",\"number\",\"number\",\"number\",\"number\"],\"number\"],FPDFAnnot_GetFormControlCount:[[\"number\",\"number\"],\"number\"],FPDFAnnot_GetFormControlIndex:[[\"number\",\"number\"],\"number\"],FPDFAnnot_GetFormFieldAlternateName:[[\"number\",\"number\",\"number\",\"number\"],\"number\"],FPDFAnnot_GetFormFieldAtPoint:[[\"number\",\"number\",\"number\"],\"number\"],FPDFAnnot_GetFormFieldExportValue:[[\"number\",\"number\",\"number\",\"number\"],\"number\"],FPDFAnnot_GetFormFieldFlags:[[\"number\",\"number\"],\"number\"],FPDFAnnot_GetFormFieldName:[[\"number\",\"number\",\"number\",\"number\"],\"number\"],FPDFAnnot_GetFormFieldType:[[\"number\",\"number\"],\"number\"],FPDFAnnot_GetFormFieldValue:[[\"number\",\"number\",\"number\",\"number\"],\"number\"],FPDFAnnot_GetInkListCount:[[\"number\"],\"number\"],FPDFAnnot_GetInkListPath:[[\"number\",\"number\",\"number\",\"number\"],\"number\"],FPDFAnnot_GetLine:[[\"number\",\"number\",\"number\"],\"boolean\"],FPDFAnnot_GetLink:[[\"number\"],\"number\"],FPDFAnnot_GetLinkedAnnot:[[\"number\",\"string\"],\"number\"],FPDFAnnot_GetNumberValue:[[\"number\",\"string\",\"number\"],\"boolean\"],FPDFAnnot_GetObject:[[\"number\",\"number\"],\"number\"],FPDFAnnot_GetObjectCount:[[\"number\"],\"number\"],FPDFAnnot_GetOptionCount:[[\"number\",\"number\"],\"number\"],FPDFAnnot_GetOptionLabel:[[\"number\",\"number\",\"number\",\"number\",\"number\"],\"number\"],FPDFAnnot_GetRect:[[\"number\",\"number\"],\"boolean\"],FPDFAnnot_GetStringValue:[[\"number\",\"string\",\"number\",\"number\"],\"number\"],FPDFAnnot_GetSubtype:[[\"number\"],\"number\"],FPDFAnnot_GetValueType:[[\"number\",\"string\"],\"number\"],FPDFAnnot_GetVertices:[[\"number\",\"number\",\"number\"],\"number\"],FPDFAnnot_HasAttachmentPoints:[[\"number\"],\"boolean\"],FPDFAnnot_HasKey:[[\"number\",\"string\"],\"boolean\"],FPDFAnnot_IsChecked:[[\"number\",\"number\"],\"boolean\"],FPDFAnnot_IsObjectSupportedSubtype:[[\"number\"],\"boolean\"],FPDFAnnot_IsOptionSelected:[[\"number\",\"number\",\"number\"],\"boolean\"],FPDFAnnot_IsSupportedSubtype:[[\"number\"],\"boolean\"],FPDFAnnot_RemoveInkList:[[\"number\"],\"boolean\"],FPDFAnnot_RemoveObject:[[\"number\",\"number\"],\"boolean\"],FPDFAnnot_SetAP:[[\"number\",\"number\",\"number\"],\"boolean\"],FPDFAnnot_SetAttachmentPoints:[[\"number\",\"number\",\"number\"],\"boolean\"],FPDFAnnot_SetBorder:[[\"number\",\"number\",\"number\",\"number\"],\"boolean\"],FPDFAnnot_SetColor:[[\"number\",\"number\",\"number\",\"number\",\"number\",\"number\"],\"boolean\"],FPDFAnnot_SetFlags:[[\"number\",\"number\"],\"boolean\"],FPDFAnnot_SetFocusableSubtypes:[[\"number\",\"number\",\"number\"],\"boolean\"],FPDFAnnot_SetFontColor:[[\"number\",\"number\",\"number\",\"number\",\"number\"],\"boolean\"],FPDFAnnot_SetFormFieldFlags:[[\"number\",\"number\",\"number\"],\"boolean\"],FPDFAnnot_SetRect:[[\"number\",\"number\"],\"boolean\"],FPDFAnnot_SetStringValue:[[\"number\",\"string\",\"number\"],\"boolean\"],FPDFAnnot_SetURI:[[\"number\",\"number\"],\"boolean\"],FPDFAnnot_UpdateObject:[[\"number\",\"number\"],\"boolean\"],FPDFAttachment_GetFile:[[\"number\",\"number\",\"number\",\"number\"],\"boolean\"],FPDFAttachment_GetName:[[\"number\",\"number\",\"number\"],\"number\"],FPDFAttachment_GetStringValue:[[\"number\",\"string\",\"number\",\"number\"],\"number\"],FPDFAttachment_GetSubtype:[[\"number\",\"number\",\"number\"],\"number\"],FPDFAttachment_GetValueType:[[\"number\",\"string\"],\"number\"],FPDFAttachment_HasKey:[[\"number\",\"string\"],\"boolean\"],FPDFAttachment_SetFile:[[\"number\",\"number\",\"number\",\"number\"],\"boolean\"],FPDFAttachment_SetStringValue:[[\"number\",\"string\",\"number\"],\"boolean\"],FPDFAvail_Create:[[\"number\",\"number\"],\"number\"],FPDFAvail_Destroy:[[\"number\"],null],FPDFAvail_GetDocument:[[\"number\",\"string\"],\"number\"],FPDFAvail_GetFirstPageNum:[[\"number\"],\"number\"],FPDFAvail_IsDocAvail:[[\"number\",\"number\"],\"number\"],FPDFAvail_IsFormAvail:[[\"number\",\"number\"],\"number\"],FPDFAvail_IsLinearized:[[\"number\"],\"number\"],FPDFAvail_IsPageAvail:[[\"number\",\"number\",\"number\"],\"number\"],FPDFBitmap_Create:[[\"number\",\"number\",\"number\"],\"number\"],FPDFBitmap_CreateEx:[[\"number\",\"number\",\"number\",\"number\",\"number\"],\"number\"],FPDFBitmap_Destroy:[[\"number\"],null],FPDFBitmap_FillRect:[[\"number\",\"number\",\"number\",\"number\",\"number\",\"number\"],\"boolean\"],FPDFBitmap_GetBuffer:[[\"number\"],\"number\"],FPDFBitmap_GetFormat:[[\"number\"],\"number\"],FPDFBitmap_GetHeight:[[\"number\"],\"number\"],FPDFBitmap_GetStride:[[\"number\"],\"number\"],FPDFBitmap_GetWidth:[[\"number\"],\"number\"],FPDFBookmark_Find:[[\"number\",\"number\"],\"number\"],FPDFBookmark_GetAction:[[\"number\"],\"number\"],FPDFBookmark_GetCount:[[\"number\"],\"number\"],FPDFBookmark_GetDest:[[\"number\",\"number\"],\"number\"],FPDFBookmark_GetFirstChild:[[\"number\",\"number\"],\"number\"],FPDFBookmark_GetNextSibling:[[\"number\",\"number\"],\"number\"],FPDFBookmark_GetTitle:[[\"number\",\"number\",\"number\"],\"number\"],FPDFCatalog_IsTagged:[[\"number\"],\"boolean\"],FPDFCatalog_SetLanguage:[[\"number\",\"string\"],\"boolean\"],FPDFClipPath_CountPaths:[[\"number\"],\"number\"],FPDFClipPath_CountPathSegments:[[\"number\",\"number\"],\"number\"],FPDFClipPath_GetPathSegment:[[\"number\",\"number\",\"number\"],\"number\"],FPDFDest_GetDestPageIndex:[[\"number\",\"number\"],\"number\"],FPDFDest_GetLocationInPage:[[\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\"],\"boolean\"],FPDFDest_GetView:[[\"number\",\"number\",\"number\"],\"number\"],FPDFDoc_AddAttachment:[[\"number\",\"number\"],\"number\"],FPDFDoc_CloseJavaScriptAction:[[\"number\"],null],FPDFDoc_DeleteAttachment:[[\"number\",\"number\"],\"boolean\"],FPDFDOC_ExitFormFillEnvironment:[[\"number\"],null],FPDFDoc_GetAttachment:[[\"number\",\"number\"],\"number\"],FPDFDoc_GetAttachmentCount:[[\"number\"],\"number\"],FPDFDoc_GetJavaScriptAction:[[\"number\",\"number\"],\"number\"],FPDFDoc_GetJavaScriptActionCount:[[\"number\"],\"number\"],FPDFDoc_GetPageMode:[[\"number\"],\"number\"],FPDFDOC_InitFormFillEnvironment:[[\"number\",\"number\"],\"number\"],FPDFFont_Close:[[\"number\"],null],FPDFFont_GetAscent:[[\"number\",\"number\",\"number\"],\"boolean\"],FPDFFont_GetBaseFontName:[[\"number\",\"number\",\"number\"],\"number\"],FPDFFont_GetDescent:[[\"number\",\"number\",\"number\"],\"boolean\"],FPDFFont_GetFamilyName:[[\"number\",\"number\",\"number\"],\"number\"],FPDFFont_GetFlags:[[\"number\"],\"number\"],FPDFFont_GetFontData:[[\"number\",\"number\",\"number\",\"number\"],\"boolean\"],FPDFFont_GetGlyphPath:[[\"number\",\"number\",\"number\"],\"number\"],FPDFFont_GetGlyphWidth:[[\"number\",\"number\",\"number\",\"number\"],\"boolean\"],FPDFFont_GetIsEmbedded:[[\"number\"],\"number\"],FPDFFont_GetItalicAngle:[[\"number\",\"number\"],\"boolean\"],FPDFFont_GetWeight:[[\"number\"],\"number\"],FPDFFormObj_CountObjects:[[\"number\"],\"number\"],FPDFFormObj_GetObject:[[\"number\",\"number\"],\"number\"],FPDFFormObj_RemoveObject:[[\"number\",\"number\"],\"boolean\"],FPDFGlyphPath_CountGlyphSegments:[[\"number\"],\"number\"],FPDFGlyphPath_GetGlyphPathSegment:[[\"number\",\"number\"],\"number\"],FPDFImageObj_GetBitmap:[[\"number\"],\"number\"],FPDFImageObj_GetIccProfileDataDecoded:[[\"number\",\"number\",\"number\",\"number\",\"number\"],\"boolean\"],FPDFImageObj_GetImageDataDecoded:[[\"number\",\"number\",\"number\"],\"number\"],FPDFImageObj_GetImageDataRaw:[[\"number\",\"number\",\"number\"],\"number\"],FPDFImageObj_GetImageFilter:[[\"number\",\"number\",\"number\",\"number\"],\"number\"],FPDFImageObj_GetImageFilterCount:[[\"number\"],\"number\"],FPDFImageObj_GetImageMetadata:[[\"number\",\"number\",\"number\"],\"boolean\"],FPDFImageObj_GetImagePixelSize:[[\"number\",\"number\",\"number\"],\"boolean\"],FPDFImageObj_GetRenderedBitmap:[[\"number\",\"number\",\"number\"],\"number\"],FPDFImageObj_LoadJpegFile:[[\"number\",\"number\",\"number\",\"number\"],\"boolean\"],FPDFImageObj_LoadJpegFileInline:[[\"number\",\"number\",\"number\",\"number\"],\"boolean\"],FPDFImageObj_SetBitmap:[[\"number\",\"number\",\"number\",\"number\"],\"boolean\"],FPDFImageObj_SetMatrix:[[\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\"],\"boolean\"],FPDFJavaScriptAction_GetName:[[\"number\",\"number\",\"number\"],\"number\"],FPDFJavaScriptAction_GetScript:[[\"number\",\"number\",\"number\"],\"number\"],FPDFLink_CloseWebLinks:[[\"number\"],null],FPDFLink_CountQuadPoints:[[\"number\"],\"number\"],FPDFLink_CountRects:[[\"number\",\"number\"],\"number\"],FPDFLink_CountWebLinks:[[\"number\"],\"number\"],FPDFLink_Enumerate:[[\"number\",\"number\",\"number\"],\"boolean\"],FPDFLink_GetAction:[[\"number\"],\"number\"],FPDFLink_GetAnnot:[[\"number\",\"number\"],\"number\"],FPDFLink_GetAnnotRect:[[\"number\",\"number\"],\"boolean\"],FPDFLink_GetDest:[[\"number\",\"number\"],\"number\"],FPDFLink_GetLinkAtPoint:[[\"number\",\"number\",\"number\"],\"number\"],FPDFLink_GetLinkZOrderAtPoint:[[\"number\",\"number\",\"number\"],\"number\"],FPDFLink_GetQuadPoints:[[\"number\",\"number\",\"number\"],\"boolean\"],FPDFLink_GetRect:[[\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\"],\"boolean\"],FPDFLink_GetTextRange:[[\"number\",\"number\",\"number\",\"number\"],\"boolean\"],FPDFLink_GetURL:[[\"number\",\"number\",\"number\",\"number\"],\"number\"],FPDFLink_LoadWebLinks:[[\"number\"],\"number\"],FPDFPage_CloseAnnot:[[\"number\"],null],FPDFPage_CountObjects:[[\"number\"],\"number\"],FPDFPage_CreateAnnot:[[\"number\",\"number\"],\"number\"],FPDFPage_Delete:[[\"number\",\"number\"],null],FPDFPage_Flatten:[[\"number\",\"number\"],\"number\"],FPDFPage_FormFieldZOrderAtPoint:[[\"number\",\"number\",\"number\",\"number\"],\"number\"],FPDFPage_GenerateContent:[[\"number\"],\"boolean\"],FPDFPage_GetAnnot:[[\"number\",\"number\"],\"number\"],FPDFPage_GetAnnotCount:[[\"number\"],\"number\"],FPDFPage_GetAnnotIndex:[[\"number\",\"number\"],\"number\"],FPDFPage_GetArtBox:[[\"number\",\"number\",\"number\",\"number\",\"number\"],\"boolean\"],FPDFPage_GetBleedBox:[[\"number\",\"number\",\"number\",\"number\",\"number\"],\"boolean\"],FPDFPage_GetCropBox:[[\"number\",\"number\",\"number\",\"number\",\"number\"],\"boolean\"],FPDFPage_GetDecodedThumbnailData:[[\"number\",\"number\",\"number\"],\"number\"],FPDFPage_GetMediaBox:[[\"number\",\"number\",\"number\",\"number\",\"number\"],\"boolean\"],FPDFPage_GetObject:[[\"number\",\"number\"],\"number\"],FPDFPage_GetRawThumbnailData:[[\"number\",\"number\",\"number\"],\"number\"],FPDFPage_GetRotation:[[\"number\"],\"number\"],FPDFPage_GetThumbnailAsBitmap:[[\"number\"],\"number\"],FPDFPage_GetTrimBox:[[\"number\",\"number\",\"number\",\"number\",\"number\"],\"boolean\"],FPDFPage_HasFormFieldAtPoint:[[\"number\",\"number\",\"number\",\"number\"],\"number\"],FPDFPage_HasTransparency:[[\"number\"],\"boolean\"],FPDFPage_InsertClipPath:[[\"number\",\"number\"],null],FPDFPage_InsertObject:[[\"number\",\"number\"],null],FPDFPage_InsertObjectAtIndex:[[\"number\",\"number\",\"number\"],\"boolean\"],FPDFPage_New:[[\"number\",\"number\",\"number\",\"number\"],\"number\"],FPDFPage_RemoveAnnot:[[\"number\",\"number\"],\"boolean\"],FPDFPage_RemoveObject:[[\"number\",\"number\"],\"boolean\"],FPDFPage_SetArtBox:[[\"number\",\"number\",\"number\",\"number\",\"number\"],null],FPDFPage_SetBleedBox:[[\"number\",\"number\",\"number\",\"number\",\"number\"],null],FPDFPage_SetCropBox:[[\"number\",\"number\",\"number\",\"number\",\"number\"],null],FPDFPage_SetMediaBox:[[\"number\",\"number\",\"number\",\"number\",\"number\"],null],FPDFPage_SetRotation:[[\"number\",\"number\"],null],FPDFPage_SetTrimBox:[[\"number\",\"number\",\"number\",\"number\",\"number\"],null],FPDFPage_TransformAnnots:[[\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\"],null],FPDFPage_TransFormWithClip:[[\"number\",\"number\",\"number\"],\"boolean\"],FPDFPageObj_AddMark:[[\"number\",\"string\"],\"number\"],FPDFPageObj_CountMarks:[[\"number\"],\"number\"],FPDFPageObj_CreateNewPath:[[\"number\",\"number\"],\"number\"],FPDFPageObj_CreateNewRect:[[\"number\",\"number\",\"number\",\"number\"],\"number\"],FPDFPageObj_CreateTextObj:[[\"number\",\"number\",\"number\"],\"number\"],FPDFPageObj_Destroy:[[\"number\"],null],FPDFPageObj_GetBounds:[[\"number\",\"number\",\"number\",\"number\",\"number\"],\"boolean\"],FPDFPageObj_GetClipPath:[[\"number\"],\"number\"],FPDFPageObj_GetDashArray:[[\"number\",\"number\",\"number\"],\"boolean\"],FPDFPageObj_GetDashCount:[[\"number\"],\"number\"],FPDFPageObj_GetDashPhase:[[\"number\",\"number\"],\"boolean\"],FPDFPageObj_GetFillColor:[[\"number\",\"number\",\"number\",\"number\",\"number\"],\"boolean\"],FPDFPageObj_GetIsActive:[[\"number\",\"number\"],\"boolean\"],FPDFPageObj_GetLineCap:[[\"number\"],\"number\"],FPDFPageObj_GetLineJoin:[[\"number\"],\"number\"],FPDFPageObj_GetMark:[[\"number\",\"number\"],\"number\"],FPDFPageObj_GetMarkedContentID:[[\"number\"],\"number\"],FPDFPageObj_GetMatrix:[[\"number\",\"number\"],\"boolean\"],FPDFPageObj_GetRotatedBounds:[[\"number\",\"number\"],\"boolean\"],FPDFPageObj_GetStrokeColor:[[\"number\",\"number\",\"number\",\"number\",\"number\"],\"boolean\"],FPDFPageObj_GetStrokeWidth:[[\"number\",\"number\"],\"boolean\"],FPDFPageObj_GetType:[[\"number\"],\"number\"],FPDFPageObj_HasTransparency:[[\"number\"],\"boolean\"],FPDFPageObj_NewImageObj:[[\"number\"],\"number\"],FPDFPageObj_NewTextObj:[[\"number\",\"string\",\"number\"],\"number\"],FPDFPageObj_RemoveMark:[[\"number\",\"number\"],\"boolean\"],FPDFPageObj_SetBlendMode:[[\"number\",\"string\"],null],FPDFPageObj_SetDashArray:[[\"number\",\"number\",\"number\",\"number\"],\"boolean\"],FPDFPageObj_SetDashPhase:[[\"number\",\"number\"],\"boolean\"],FPDFPageObj_SetFillColor:[[\"number\",\"number\",\"number\",\"number\",\"number\"],\"boolean\"],FPDFPageObj_SetIsActive:[[\"number\",\"boolean\"],\"boolean\"],FPDFPageObj_SetLineCap:[[\"number\",\"number\"],\"boolean\"],FPDFPageObj_SetLineJoin:[[\"number\",\"number\"],\"boolean\"],FPDFPageObj_SetMatrix:[[\"number\",\"number\"],\"boolean\"],FPDFPageObj_SetStrokeColor:[[\"number\",\"number\",\"number\",\"number\",\"number\"],\"boolean\"],FPDFPageObj_SetStrokeWidth:[[\"number\",\"number\"],\"boolean\"],FPDFPageObj_Transform:[[\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\"],null],FPDFPageObj_TransformClipPath:[[\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\"],null],FPDFPageObj_TransformF:[[\"number\",\"number\"],\"boolean\"],FPDFPageObjMark_CountParams:[[\"number\"],\"number\"],FPDFPageObjMark_GetName:[[\"number\",\"number\",\"number\",\"number\"],\"boolean\"],FPDFPageObjMark_GetParamBlobValue:[[\"number\",\"string\",\"number\",\"number\",\"number\"],\"boolean\"],FPDFPageObjMark_GetParamIntValue:[[\"number\",\"string\",\"number\"],\"boolean\"],FPDFPageObjMark_GetParamKey:[[\"number\",\"number\",\"number\",\"number\",\"number\"],\"boolean\"],FPDFPageObjMark_GetParamStringValue:[[\"number\",\"string\",\"number\",\"number\",\"number\"],\"boolean\"],FPDFPageObjMark_GetParamValueType:[[\"number\",\"string\"],\"number\"],FPDFPageObjMark_RemoveParam:[[\"number\",\"number\",\"string\"],\"boolean\"],FPDFPageObjMark_SetBlobParam:[[\"number\",\"number\",\"number\",\"string\",\"number\",\"number\"],\"boolean\"],FPDFPageObjMark_SetIntParam:[[\"number\",\"number\",\"number\",\"string\",\"number\"],\"boolean\"],FPDFPageObjMark_SetStringParam:[[\"number\",\"number\",\"number\",\"string\",\"string\"],\"boolean\"],FPDFPath_BezierTo:[[\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\"],\"boolean\"],FPDFPath_Close:[[\"number\"],\"boolean\"],FPDFPath_CountSegments:[[\"number\"],\"number\"],FPDFPath_GetDrawMode:[[\"number\",\"number\",\"number\"],\"boolean\"],FPDFPath_GetPathSegment:[[\"number\",\"number\"],\"number\"],FPDFPath_LineTo:[[\"number\",\"number\",\"number\"],\"boolean\"],FPDFPath_MoveTo:[[\"number\",\"number\",\"number\"],\"boolean\"],FPDFPath_SetDrawMode:[[\"number\",\"number\",\"boolean\"],\"boolean\"],FPDFPathSegment_GetClose:[[\"number\"],\"boolean\"],FPDFPathSegment_GetPoint:[[\"number\",\"number\",\"number\"],\"boolean\"],FPDFPathSegment_GetType:[[\"number\"],\"number\"],FPDFSignatureObj_GetByteRange:[[\"number\",\"number\",\"number\"],\"number\"],FPDFSignatureObj_GetContents:[[\"number\",\"number\",\"number\"],\"number\"],FPDFSignatureObj_GetDocMDPPermission:[[\"number\"],\"number\"],FPDFSignatureObj_GetReason:[[\"number\",\"number\",\"number\"],\"number\"],FPDFSignatureObj_GetSubFilter:[[\"number\",\"number\",\"number\"],\"number\"],FPDFSignatureObj_GetTime:[[\"number\",\"number\",\"number\"],\"number\"],FPDFText_ClosePage:[[\"number\"],null],FPDFText_CountChars:[[\"number\"],\"number\"],FPDFText_CountRects:[[\"number\",\"number\",\"number\"],\"number\"],FPDFText_FindClose:[[\"number\"],null],FPDFText_FindNext:[[\"number\"],\"boolean\"],FPDFText_FindPrev:[[\"number\"],\"boolean\"],FPDFText_FindStart:[[\"number\",\"number\",\"number\",\"number\"],\"number\"],FPDFText_GetBoundedText:[[\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\"],\"number\"],FPDFText_GetCharAngle:[[\"number\",\"number\"],\"number\"],FPDFText_GetCharBox:[[\"number\",\"number\",\"number\",\"number\",\"number\",\"number\"],\"boolean\"],FPDFText_GetCharIndexAtPos:[[\"number\",\"number\",\"number\",\"number\",\"number\"],\"number\"],FPDFText_GetCharIndexFromTextIndex:[[\"number\",\"number\"],\"number\"],FPDFText_GetCharOrigin:[[\"number\",\"number\",\"number\",\"number\"],\"boolean\"],FPDFText_GetFillColor:[[\"number\",\"number\",\"number\",\"number\",\"number\",\"number\"],\"boolean\"],FPDFText_GetFontInfo:[[\"number\",\"number\",\"number\",\"number\",\"number\"],\"number\"],FPDFText_GetFontSize:[[\"number\",\"number\"],\"number\"],FPDFText_GetFontWeight:[[\"number\",\"number\"],\"number\"],FPDFText_GetLooseCharBox:[[\"number\",\"number\",\"number\"],\"boolean\"],FPDFText_GetMatrix:[[\"number\",\"number\",\"number\"],\"boolean\"],FPDFText_GetRect:[[\"number\",\"number\",\"number\",\"number\",\"number\",\"number\"],\"boolean\"],FPDFText_GetSchCount:[[\"number\"],\"number\"],FPDFText_GetSchResultIndex:[[\"number\"],\"number\"],FPDFText_GetStrokeColor:[[\"number\",\"number\",\"number\",\"number\",\"number\",\"number\"],\"boolean\"],FPDFText_GetText:[[\"number\",\"number\",\"number\",\"number\"],\"number\"],FPDFText_GetTextIndexFromCharIndex:[[\"number\",\"number\"],\"number\"],FPDFText_GetTextObject:[[\"number\",\"number\"],\"number\"],FPDFText_GetUnicode:[[\"number\",\"number\"],\"number\"],FPDFText_HasUnicodeMapError:[[\"number\",\"number\"],\"number\"],FPDFText_IsGenerated:[[\"number\",\"number\"],\"number\"],FPDFText_IsHyphen:[[\"number\",\"number\"],\"number\"],FPDFText_LoadCidType2Font:[[\"number\",\"number\",\"number\",\"string\",\"number\",\"number\"],\"number\"],FPDFText_LoadFont:[[\"number\",\"number\",\"number\",\"number\",\"boolean\"],\"number\"],FPDFText_LoadPage:[[\"number\"],\"number\"],FPDFText_LoadStandardFont:[[\"number\",\"string\"],\"number\"],FPDFText_SetCharcodes:[[\"number\",\"number\",\"number\"],\"boolean\"],FPDFText_SetText:[[\"number\",\"number\"],\"boolean\"],FPDFTextObj_GetFont:[[\"number\"],\"number\"],FPDFTextObj_GetFontSize:[[\"number\",\"number\"],\"boolean\"],FPDFTextObj_GetRenderedBitmap:[[\"number\",\"number\",\"number\",\"number\"],\"number\"],FPDFTextObj_GetText:[[\"number\",\"number\",\"number\",\"number\"],\"number\"],FPDFTextObj_GetTextRenderMode:[[\"number\"],\"number\"],FPDFTextObj_SetTextRenderMode:[[\"number\",\"number\"],\"boolean\"],PDFiumExt_CloseFileWriter:[[\"number\"],null],PDFiumExt_CloseFormFillInfo:[[\"number\"],null],PDFiumExt_ExitFormFillEnvironment:[[\"number\"],null],PDFiumExt_GetFileWriterData:[[\"number\",\"number\",\"number\"],\"number\"],PDFiumExt_GetFileWriterSize:[[\"number\"],\"number\"],PDFiumExt_Init:[[],null],PDFiumExt_InitFormFillEnvironment:[[\"number\",\"number\"],\"number\"],PDFiumExt_OpenFileWriter:[[],\"number\"],PDFiumExt_OpenFormFillInfo:[[],\"number\"],PDFiumExt_SaveAsCopy:[[\"number\",\"number\"],\"number\"]};async function r(e){return async function(e){const t={pdfium:e};for(const r in n){const o=r,i=n[o][0],a=n[o][1];t[o]=e.cwrap(r,a,i)}return t}(await t(e))}var o=(e=>(e[e.Degree0=0]=\"Degree0\",e[e.Degree90=1]=\"Degree90\",e[e.Degree180=2]=\"Degree180\",e[e.Degree270=3]=\"Degree270\",e))(o||{});function i(e){return{width:Math.ceil(e.width),height:Math.ceil(e.height)}}function a(e){return{origin:(t=e.origin,{x:Math.floor(t.x),y:Math.floor(t.y)}),size:i(e.size)};var t}function s(e){const{width:t,height:n}=e;return{width:n,height:t}}function u(e){const t=[e.p1.x,e.p2.x,e.p3.x,e.p4.x],n=[e.p1.y,e.p2.y,e.p3.y,e.p4.y];return{origin:{x:Math.min(...t),y:Math.min(...n)},size:{width:Math.max(...t)-Math.min(...t),height:Math.max(...n)-Math.min(...n)}}}function F(e,t,n,r){return function(e,t){return{origin:{x:e.origin.x*t,y:e.origin.y*t},size:{width:e.size.width*t,height:e.size.height*t}}}(function(e,t,n){let r=t.origin.x,o=t.origin.y,i=t.size;switch(n){case 0:break;case 1:r=e.height-t.origin.y-t.size.height,o=t.origin.x,i=s(t.size);break;case 2:r=e.width-t.origin.x-t.size.width,o=e.height-t.origin.y-t.size.height;break;case 3:r=t.origin.y,o=e.width-t.origin.x-t.size.width,i=s(t.size)}return{origin:{x:r,y:o},size:{width:i.width,height:i.height}}}(e,t,n),r)}var m=class{debug(){}info(){}warn(){}error(){}perf(){}},l=class extends Error{constructor(e){super(`Task aborted: ${JSON.stringify(e)}`),this.name=\"TaskAbortedError\"}},d=class extends Error{constructor(e){super(`Task rejected: ${JSON.stringify(e)}`),this.name=\"TaskRejectedError\"}},_=class e{constructor(){this.state={stage:0},this.resolvedCallbacks=[],this.rejectedCallbacks=[],this._promise=null}toPromise(){return this._promise||(this._promise=new Promise(((e,t)=>{this.wait((t=>e(t)),(e=>{\"abort\"===e.type?t(new l(e.reason)):t(new d(e.reason))}))}))),this._promise}wait(e,t){switch(this.state.stage){case 0:this.resolvedCallbacks.push(e),this.rejectedCallbacks.push(t);break;case 1:e(this.state.result);break;case 2:t({type:\"reject\",reason:this.state.reason});break;case 3:t({type:\"abort\",reason:this.state.reason})}}resolve(e){if(0===this.state.stage){this.state={stage:1,result:e};for(const t of this.resolvedCallbacks)try{t(e)}catch(e){}this.resolvedCallbacks=[],this.rejectedCallbacks=[]}}reject(e){if(0===this.state.stage){this.state={stage:2,reason:e};for(const t of this.rejectedCallbacks)try{t({type:\"reject\",reason:e})}catch(e){}this.resolvedCallbacks=[],this.rejectedCallbacks=[]}}abort(e){if(0===this.state.stage){this.state={stage:3,reason:e};for(const t of this.rejectedCallbacks)try{t({type:\"abort\",reason:e})}catch(e){}this.resolvedCallbacks=[],this.rejectedCallbacks=[]}}fail(e){\"abort\"===e.type?this.abort(e.reason):this.reject(e.reason)}static all(t){const n=new e;if(0===t.length)return n.resolve([]),n;const r=new Array(t.length);let o=0,i=!1;return t.forEach(((e,a)=>{e.wait((e=>{i||(r[a]=e,o++,o===t.length&&(i=!0,n.resolve(r)))}),(e=>{i||(i=!0,\"abort\"===e.type?n.abort(e.reason):n.reject(e.reason))}))})),n}static allSettled(t){const n=new e;if(0===t.length)return n.resolve([]),n;const r=new Array(t.length);let o=0;return t.forEach(((e,i)=>{e.wait((e=>{r[i]={status:\"resolved\",value:e},o++,o===t.length&&n.resolve(r)}),(e=>{r[i]={status:\"abort\"===e.type?\"aborted\":\"rejected\",reason:e.reason},o++,o===t.length&&n.resolve(r)}))})),n}static race(t){const n=new e;if(0===t.length)return n.reject(\"No tasks provided\"),n;let r=!1;return t.forEach((e=>{e.wait((e=>{r||(r=!0,n.resolve(e))}),(e=>{r||(r=!0,\"abort\"===e.type?n.abort(e.reason):n.reject(e.reason))}))})),n}static withProgress(t,n){const r=e.all(t);if(n){let e=0;t.forEach((r=>{r.wait((()=>{e++,n(e,t.length)}),(()=>{e++,n(e,t.length)}))}))}return r}},P=Object.freeze([\"­\",\"​\",\"⁠\",\"\\ufeff\",\"￾\",\"￿\"]),c=new RegExp(`[${P.join(\"\")}]`,\"g\");var g=(e=>(e[e.Unknown=0]=\"Unknown\",e[e.XYZ=1]=\"XYZ\",e[e.FitPage=2]=\"FitPage\",e[e.FitHorizontal=3]=\"FitHorizontal\",e[e.FitVertical=4]=\"FitVertical\",e[e.FitRectangle=5]=\"FitRectangle\",e))(g||{}),h=(e=>(e[e.Unsupported=0]=\"Unsupported\",e[e.Goto=1]=\"Goto\",e[e.RemoteGoto=2]=\"RemoteGoto\",e[e.URI=3]=\"URI\",e[e.LaunchAppOrOpenFile=4]=\"LaunchAppOrOpenFile\",e))(h||{}),D=(e=>(e[e.UNKNOWN=0]=\"UNKNOWN\",e[e.TEXT=1]=\"TEXT\",e[e.LINK=2]=\"LINK\",e[e.FREETEXT=3]=\"FREETEXT\",e[e.LINE=4]=\"LINE\",e[e.SQUARE=5]=\"SQUARE\",e[e.CIRCLE=6]=\"CIRCLE\",e[e.POLYGON=7]=\"POLYGON\",e[e.POLYLINE=8]=\"POLYLINE\",e[e.HIGHLIGHT=9]=\"HIGHLIGHT\",e[e.UNDERLINE=10]=\"UNDERLINE\",e[e.SQUIGGLY=11]=\"SQUIGGLY\",e[e.STRIKEOUT=12]=\"STRIKEOUT\",e[e.STAMP=13]=\"STAMP\",e[e.CARET=14]=\"CARET\",e[e.INK=15]=\"INK\",e[e.POPUP=16]=\"POPUP\",e[e.FILEATTACHMENT=17]=\"FILEATTACHMENT\",e[e.SOUND=18]=\"SOUND\",e[e.MOVIE=19]=\"MOVIE\",e[e.WIDGET=20]=\"WIDGET\",e[e.SCREEN=21]=\"SCREEN\",e[e.PRINTERMARK=22]=\"PRINTERMARK\",e[e.TRAPNET=23]=\"TRAPNET\",e[e.WATERMARK=24]=\"WATERMARK\",e[e.THREED=25]=\"THREED\",e[e.RICHMEDIA=26]=\"RICHMEDIA\",e[e.XFAWIDGET=27]=\"XFAWIDGET\",e[e.REDACT=28]=\"REDACT\",e))(D||{}),b=(e=>(e[e.Normal=0]=\"Normal\",e[e.Rollover=1]=\"Rollover\",e[e.Down=2]=\"Down\",e))(b||{}),p=(e=>(e[e.UNKNOWN=0]=\"UNKNOWN\",e[e.PUSHBUTTON=1]=\"PUSHBUTTON\",e[e.CHECKBOX=2]=\"CHECKBOX\",e[e.RADIOBUTTON=3]=\"RADIOBUTTON\",e[e.COMBOBOX=4]=\"COMBOBOX\",e[e.LISTBOX=5]=\"LISTBOX\",e[e.TEXTFIELD=6]=\"TEXTFIELD\",e[e.SIGNATURE=7]=\"SIGNATURE\",e[e.XFA=8]=\"XFA\",e[e.XFA_CHECKBOX=9]=\"XFA_CHECKBOX\",e[e.XFA_COMBOBOX=10]=\"XFA_COMBOBOX\",e[e.XFA_IMAGEFIELD=11]=\"XFA_IMAGEFIELD\",e[e.XFA_LISTBOX=12]=\"XFA_LISTBOX\",e[e.XFA_PUSHBUTTON=13]=\"XFA_PUSHBUTTON\",e[e.XFA_SIGNATURE=14]=\"XFA_SIGNATURE\",e[e.XFA_TEXTFIELD=15]=\"XFA_TEXTFIELD\",e))(p||{}),f=(e=>(e[e.Color=0]=\"Color\",e[e.InteriorColor=1]=\"InteriorColor\",e))(f||{}),A=(e=>(e[e.UNKNOWN=0]=\"UNKNOWN\",e[e.SOLID=1]=\"SOLID\",e[e.DASHED=2]=\"DASHED\",e[e.BEVELED=3]=\"BEVELED\",e[e.INSET=4]=\"INSET\",e[e.UNDERLINE=5]=\"UNDERLINE\",e[e.CLOUDY=6]=\"CLOUDY\",e))(A||{}),E=(e=>(e[e.UNKNOWN=0]=\"UNKNOWN\",e[e.TEXT=1]=\"TEXT\",e[e.PATH=2]=\"PATH\",e[e.IMAGE=3]=\"IMAGE\",e[e.SHADING=4]=\"SHADING\",e[e.FORM=5]=\"FORM\",e))(E||{}),G=Object.freeze({1:\"invisible\",2:\"hidden\",4:\"print\",8:\"noZoom\",16:\"noRotate\",32:\"noView\",64:\"readOnly\",128:\"locked\",256:\"toggleNoView\"});Object.entries(G).reduce(((e,[t,n])=>(e[n]=Number(t),e)),{});var S=(e=>(e[e.None=0]=\"None\",e[e.MatchCase=1]=\"MatchCase\",e[e.MatchWholeWord=2]=\"MatchWholeWord\",e[e.MatchConsecutive=4]=\"MatchConsecutive\",e))(S||{}),C=(e=>(e[e.Ok=0]=\"Ok\",e[e.Unknown=1]=\"Unknown\",e[e.NotFound=2]=\"NotFound\",e[e.WrongFormat=3]=\"WrongFormat\",e[e.Password=4]=\"Password\",e[e.Security=5]=\"Security\",e[e.PageError=6]=\"PageError\",e[e.XFALoad=7]=\"XFALoad\",e[e.XFALayout=8]=\"XFALayout\",e[e.Cancelled=9]=\"Cancelled\",e[e.Initialization=10]=\"Initialization\",e[e.NotReady=11]=\"NotReady\",e[e.NotSupport=12]=\"NotSupport\",e[e.LoadDoc=13]=\"LoadDoc\",e[e.DocNotOpen=14]=\"DocNotOpen\",e[e.CantCloseDoc=15]=\"CantCloseDoc\",e[e.CantCreateNewDoc=16]=\"CantCreateNewDoc\",e[e.CantImportPages=17]=\"CantImportPages\",e[e.CantCreateAnnot=18]=\"CantCreateAnnot\",e[e.CantSetAnnotRect=19]=\"CantSetAnnotRect\",e[e.CantSetAnnotContent=20]=\"CantSetAnnotContent\",e[e.CantRemoveInkList=21]=\"CantRemoveInkList\",e[e.CantAddInkStoke=22]=\"CantAddInkStoke\",e[e.CantReadAttachmentSize=23]=\"CantReadAttachmentSize\",e[e.CantReadAttachmentContent=24]=\"CantReadAttachmentContent\",e[e.CantFocusAnnot=25]=\"CantFocusAnnot\",e[e.CantSelectText=26]=\"CantSelectText\",e[e.CantSelectOption=27]=\"CantSelectOption\",e[e.CantCheckField=28]=\"CantCheckField\",e))(C||{}),y=class{static create(){return new _}static resolve(e){const t=new _;return t.resolve(e),t}static reject(e){const t=new _;return t.reject(e),t}static abort(e){const t=new _;return t.reject(e),t}};function T(e){if(!e?.startsWith(\"D:\")||e.length<16)return;const t=+e.slice(2,6),n=+e.slice(6,8)-1,r=+e.slice(8,10),o=+e.slice(10,12),i=+e.slice(12,14),a=+e.slice(14,16);return new Date(Date.UTC(t,n,r,o,i,a))}function M(e=new Date){const t=(e,t=2)=>e.toString().padStart(t,\"0\");return`D:${e.getUTCFullYear()}${t(e.getUTCMonth()+1)}${t(e.getUTCDate())}${t(e.getUTCHours())}${t(e.getUTCMinutes())}${t(e.getUTCSeconds())}`}const O=\"WebWorkerEngineRunner\",v=\"Engine\";class x{constructor(e=new m){this.logger=e,this.execute=e=>{if(this.logger.debug(O,v,\"runner start exeucte request\"),!this.engine){const t={type:\"reject\",reason:{code:C.NotReady,message:\"engine has not started yet\"}},n={id:e.id,type:\"ExecuteResponse\",data:{type:\"error\",value:t}};return void this.respond(n)}const t=this.engine,{name:n,args:r}=e.data;if(!t[n]){const t={type:\"reject\",reason:{code:C.NotSupport,message:`engine method ${n} is not supported yet`}},r={id:e.id,type:\"ExecuteResponse\",data:{type:\"error\",value:t}};return void this.respond(r)}let o;switch(n){case\"isSupport\":case\"initialize\":case\"destroy\":case\"openDocumentUrl\":case\"openDocumentFromBuffer\":case\"openDocumentFromLoader\":case\"getDocPermissions\":case\"getDocUserPermissions\":case\"getMetadata\":case\"getBookmarks\":case\"getSignatures\":case\"renderPage\":case\"renderPageRect\":case\"renderAnnotation\":case\"renderThumbnail\":case\"getAllAnnotations\":case\"getPageAnnotations\":case\"createPageAnnotation\":case\"updatePageAnnotation\":case\"removePageAnnotation\":case\"updateAnnotationColor\":case\"getPageTextRects\":case\"searchAllPages\":case\"closeDocument\":case\"saveAsCopy\":case\"getAttachments\":case\"readAttachmentContent\":case\"setFormFieldValue\":case\"flattenPage\":case\"extractPages\":case\"extractText\":case\"getTextSlices\":case\"getPageGlyphs\":case\"getPageGeometry\":case\"merge\":case\"mergePages\":o=this.engine[n](...r)}o.wait((t=>{const n={id:e.id,type:\"ExecuteResponse\",data:{type:\"result\",value:t}};this.respond(n)}),(t=>{const n={id:e.id,type:\"ExecuteResponse\",data:{type:\"error\",value:t}};this.respond(n)}))}}listen(){self.onmessage=e=>this.handle(e)}handle(e){this.logger.debug(O,v,\"webworker receive message event: \",e.data);try{const t=e.data;if(\"ExecuteRequest\"===t.type)this.execute(t)}catch(e){this.logger.info(O,v,\"webworker met error when processing message event:\",e)}}ready(){this.listen(),this.respond({id:\"0\",type:\"ReadyResponse\"}),this.logger.debug(O,v,\"runner is ready\")}respond(e){this.logger.debug(O,v,\"runner respond: \",e),self.postMessage(e)}}function w(e,t,n,r=100){let o=e.wasmExports.malloc(r);for(let t=0;t<r;t++)e.HEAP8[o+t]=0;const i=t(o,r);let a;if(i>r){e.wasmExports.free(o),o=e.wasmExports.malloc(i);for(let t=0;t<i;t++)e.HEAP8[o+t]=0;t(o,i),a=n(o)}else a=n(o);return e.wasmExports.free(o),a}function R(e,t){const n=t(0,0),r=e.wasmExports.malloc(n);t(r,n);const o=new ArrayBuffer(n),i=new DataView(o);for(let t=0;t<n;t++)i.setInt8(t,e.getValue(r+t,\"i8\"));return e.wasmExports.free(r),o}class I{constructor(e){this.pdfium=e,this.docs=new Map}setDocument(e,t,n){let r=this.docs.get(e);r||(r=new k(t,n,this.pdfium),this.docs.set(e,r))}getContext(e){return this.docs.get(e)}closeDocument(e){const t=this.docs.get(e);return!!t&&(t.dispose(),this.docs.delete(e),!0)}}class k{constructor(e,t,n){this.filePtr=e,this.docPtr=t,this.pageCache=new j(n,t)}acquirePage(e){return this.pageCache.acquire(e)}dispose(){this.pageCache.forceReleaseAll(),this.pageCache.pdf.FPDF_CloseDocument(this.docPtr),this.pageCache.pdf.pdfium.wasmExports.free(this.filePtr)}}class j{constructor(e,t){this.pdf=e,this.docPtr=t,this.cache=new Map}acquire(e){let t=this.cache.get(e);if(!t){const n=this.pdf.FPDF_LoadPage(this.docPtr,e);t=new L(this.pdf,this.docPtr,e,n,(()=>{this.cache.delete(e)})),this.cache.set(e,t)}return t.clearExpiryTimer(),t.bumpRefCount(),t}forceReleaseAll(){for(const e of this.cache.values())e.disposeImmediate();this.cache.clear()}}class L{constructor(e,t,n,r,o){this.pdf=e,this.docPtr=t,this.pageIdx=n,this.pagePtr=r,this.onFinalDispose=o,this.refCount=0,this.disposed=!1}bumpRefCount(){if(this.disposed)throw new Error(\"Context already disposed\");this.refCount++}clearExpiryTimer(){this.expiryTimer&&(clearTimeout(this.expiryTimer),this.expiryTimer=void 0)}release(){this.disposed||(this.refCount--,0===this.refCount&&(this.expiryTimer=setTimeout((()=>this.disposeImmediate()),5e3)))}disposeImmediate(){this.disposed||(this.disposed=!0,void 0!==this.textPagePtr&&this.pdf.FPDFText_ClosePage(this.textPagePtr),void 0!==this.formHandle&&(this.pdf.FORM_OnBeforeClosePage(this.pagePtr,this.formHandle),this.pdf.PDFiumExt_ExitFormFillEnvironment(this.formHandle)),void 0!==this.formInfoPtr&&this.pdf.PDFiumExt_CloseFormFillInfo(this.formInfoPtr),this.pdf.FPDF_ClosePage(this.pagePtr),this.onFinalDispose())}getTextPage(){return this.ensureAlive(),void 0===this.textPagePtr&&(this.textPagePtr=this.pdf.FPDFText_LoadPage(this.pagePtr)),this.textPagePtr}getFormHandle(){return this.ensureAlive(),void 0===this.formHandle&&(this.formInfoPtr=this.pdf.PDFiumExt_OpenFormFillInfo(),this.formHandle=this.pdf.PDFiumExt_InitFormFillEnvironment(this.docPtr,this.formInfoPtr),this.pdf.FORM_OnAfterLoadPage(this.pagePtr,this.formHandle)),this.formHandle}withAnnotation(e,t){this.ensureAlive();const n=this.pdf.FPDFPage_GetAnnot(this.pagePtr,e);try{return t(n)}finally{this.pdf.FPDFPage_CloseAnnot(n)}}ensureAlive(){if(this.disposed)throw new Error(\"PageContext already disposed\")}}var B,N;!function(e){e[e.Bitmap_Gray=1]=\"Bitmap_Gray\",e[e.Bitmap_BGR=2]=\"Bitmap_BGR\",e[e.Bitmap_BGRx=3]=\"Bitmap_BGRx\",e[e.Bitmap_BGRA=4]=\"Bitmap_BGRA\"}(B||(B={})),function(e){e[e.ANNOT=1]=\"ANNOT\",e[e.LCD_TEXT=2]=\"LCD_TEXT\",e[e.NO_NATIVETEXT=4]=\"NO_NATIVETEXT\",e[e.GRAYSCALE=8]=\"GRAYSCALE\",e[e.DEBUG_INFO=128]=\"DEBUG_INFO\",e[e.NO_CATCH=256]=\"NO_CATCH\",e[e.RENDER_LIMITEDIMAGECACHE=512]=\"RENDER_LIMITEDIMAGECACHE\",e[e.RENDER_FORCEHALFTONE=1024]=\"RENDER_FORCEHALFTONE\",e[e.PRINTING=2048]=\"PRINTING\",e[e.REVERSE_BYTE_ORDER=16]=\"REVERSE_BYTE_ORDER\"}(N||(N={}));const U=\"PDFiumEngine\",V=\"Engine\";var z;!function(e){e[e.Success=0]=\"Success\",e[e.Unknown=1]=\"Unknown\",e[e.File=2]=\"File\",e[e.Format=3]=\"Format\",e[e.Password=4]=\"Password\",e[e.Security=5]=\"Security\",e[e.Page=6]=\"Page\",e[e.XFALoad=7]=\"XFALoad\",e[e.XFALayout=8]=\"XFALayout\"}(z||(z={}));const W=(e,t=\"image/webp\")=>{if(\"undefined\"==typeof OffscreenCanvas)throw new Error(\"OffscreenCanvas is not available in this environment. This converter is intended for browser use only. Please use createNodeImageDataToBlobConverter() or createNodeCanvasImageDataToBlobConverter() for Node.js.\");const n=new ImageData(e.data,e.width,e.height),r=new OffscreenCanvas(n.width,n.height);return r.getContext(\"2d\").putImageData(n,0,0),r.convertToBlob({type:t})};class H{constructor(e,t=new m,n=W){this.pdfiumModule=e,this.logger=t,this.imageDataConverter=n,this.cache=new I(this.pdfiumModule)}initialize(){return this.logger.debug(U,V,\"initialize\"),this.logger.perf(U,V,\"Initialize\",\"Begin\",\"General\"),this.pdfiumModule.PDFiumExt_Init(),this.logger.perf(U,V,\"Initialize\",\"End\",\"General\"),y.resolve(!0)}destroy(){return this.logger.debug(U,V,\"destroy\"),this.logger.perf(U,V,\"Destroy\",\"Begin\",\"General\"),this.pdfiumModule.FPDF_DestroyLibrary(),this.logger.perf(U,V,\"Destroy\",\"End\",\"General\"),y.resolve(!0)}openDocumentUrl(e,t){const n=t?.mode??\"auto\",r=t?.password??\"\";this.logger.debug(U,V,\"openDocumentUrl called\",e.url,n);const o=y.create();return(async()=>{try{if(\"full-fetch\"===n){(await this.fetchFullAndOpen(e,r)).wait((e=>o.resolve(e)),(e=>o.reject(e.reason)))}else if(\"range-request\"===n){(await this.openDocumentWithRangeRequest(e,r)).wait((e=>o.resolve(e)),(e=>o.reject(e.reason)))}else{const{supportsRanges:t,fileLength:n,content:i}=await this.checkRangeSupport(e.url);if(t){(await this.openDocumentWithRangeRequest(e,r,n)).wait((e=>o.resolve(e)),(e=>o.reject(e.reason)))}else if(i){const t={id:e.id,content:i};this.openDocumentFromBuffer(t,r).wait((e=>o.resolve(e)),(e=>o.reject(e.reason)))}else{(await this.fetchFullAndOpen(e,r)).wait((e=>o.resolve(e)),(e=>o.reject(e.reason)))}}}catch(e){this.logger.error(U,V,\"openDocumentUrl error\",e),o.reject({code:C.Unknown,message:String(e)})}})(),o}async checkRangeSupport(e){try{this.logger.debug(U,V,\"checkRangeSupport\",e);const t=await fetch(e,{method:\"HEAD\"}),n=t.headers.get(\"Content-Length\");if(\"bytes\"===t.headers.get(\"Accept-Ranges\"))return{supportsRanges:!0,fileLength:parseInt(n??\"0\"),content:null};const r=await fetch(e,{headers:{Range:\"bytes=0-1\"}});if(200===r.status){const e=await r.arrayBuffer();return{supportsRanges:!1,fileLength:parseInt(n??\"0\"),content:e}}return{supportsRanges:206===r.status,fileLength:parseInt(n??\"0\"),content:null}}catch(e){throw this.logger.error(U,V,\"checkRangeSupport failed\",e),new Error(\"Failed to check range support: \"+e)}}async fetchFullAndOpen(e,t){this.logger.debug(U,V,\"fetchFullAndOpen\",e.url);const n=await fetch(e.url);if(!n.ok)throw new Error(`Could not fetch PDF: ${n.statusText}`);const r=await n.arrayBuffer(),o={id:e.id,content:r};return this.openDocumentFromBuffer(o,t)}async openDocumentWithRangeRequest(e,t,n){this.logger.debug(U,V,\"openDocumentWithRangeRequest\",e.url);const r=n??(await this.retrieveFileLength(e.url)).fileLength;return this.openDocumentFromLoader({id:e.id,fileLength:r,callback:(t,n)=>{const r=new XMLHttpRequest;if(r.open(\"GET\",e.url,!1),r.overrideMimeType(\"text/plain; charset=x-user-defined\"),r.setRequestHeader(\"Range\",`bytes=${t}-${t+n-1}`),r.send(null),206===r.status||200===r.status)return this.convertResponseToUint8Array(r.responseText);throw new Error(`Range request failed with status ${r.status}`)}},t)}async retrieveFileLength(e){this.logger.debug(U,V,\"retrieveFileLength\",e);const t=await fetch(e,{method:\"HEAD\"});if(!t.ok)throw new Error(`Failed HEAD request for file length: ${t.statusText}`);const n=t.headers.get(\"Content-Length\")||\"0\",r=parseInt(n,10)||0;if(!r)throw new Error(\"Content-Length not found or zero.\");return{fileLength:r}}convertResponseToUint8Array(e){const t=new Uint8Array(e.length);for(let n=0;n<e.length;n++)t[n]=255&e.charCodeAt(n);return t}openDocumentFromBuffer(e,t=\"\"){this.logger.debug(U,V,\"openDocumentFromBuffer\",e,t),this.logger.perf(U,V,\"OpenDocumentFromBuffer\",\"Begin\",e.id);const n=new Uint8Array(e.content),r=n.length,o=this.malloc(r);this.pdfiumModule.pdfium.HEAPU8.set(n,o);const i=this.pdfiumModule.FPDF_LoadMemDocument(o,r,t);if(!i){const t=this.pdfiumModule.FPDF_GetLastError();return this.logger.error(U,V,`FPDF_LoadMemDocument failed with ${t}`),this.free(o),this.logger.perf(U,V,\"OpenDocumentFromBuffer\",\"End\",e.id),y.reject({code:t,message:\"FPDF_LoadMemDocument failed\"})}const a=this.pdfiumModule.FPDF_GetPageCount(i),s=[],u=this.malloc(8);for(let t=0;t<a;t++){if(!this.pdfiumModule.FPDF_GetPageSizeByIndexF(i,t,u)){const t=this.pdfiumModule.FPDF_GetLastError();return this.logger.error(U,V,`FPDF_GetPageSizeByIndexF failed with ${t}`),this.free(u),this.pdfiumModule.FPDF_CloseDocument(i),this.free(o),this.logger.perf(U,V,\"OpenDocumentFromBuffer\",\"End\",e.id),y.reject({code:t,message:\"FPDF_GetPageSizeByIndexF failed\"})}const n={index:t,size:{width:this.pdfiumModule.pdfium.getValue(u,\"float\"),height:this.pdfiumModule.pdfium.getValue(u+4,\"float\")}};s.push(n)}this.free(u);const F={id:e.id,pageCount:a,pages:s};return this.cache.setDocument(e.id,o,i),this.logger.perf(U,V,\"OpenDocumentFromBuffer\",\"End\",e.id),y.resolve(F)}openDocumentFromLoader(e,t=\"\"){const{fileLength:n,callback:r,...o}=e;this.logger.debug(U,V,\"openDocumentFromLoader\",o,t),this.logger.perf(U,V,\"OpenDocumentFromLoader\",\"Begin\",o.id);const i=this.pdfiumModule.pdfium.addFunction(((e,t,o,i)=>{try{if(this.logger.debug(U,V,\"readBlock\",t,i,o),t<0||t>=n)return this.logger.error(U,V,\"Offset out of bounds:\",t),0;const e=r(t,i);return new Uint8Array(this.pdfiumModule.pdfium.HEAPU8.buffer,o,e.length).set(e),e.length}catch(e){return this.logger.error(U,V,\"ReadBlock error:\",e),0}}),\"iiiii\"),a=this.malloc(12);this.pdfiumModule.pdfium.setValue(a,n,\"i32\"),this.pdfiumModule.pdfium.setValue(a+4,i,\"i32\"),this.pdfiumModule.pdfium.setValue(a+8,0,\"i32\");const s=this.pdfiumModule.FPDF_LoadCustomDocument(a,t);if(!s){const e=this.pdfiumModule.FPDF_GetLastError();return this.logger.error(U,V,`FPDF_LoadCustomDocument failed with ${e}`),this.free(a),this.logger.perf(U,V,\"OpenDocumentFromLoader\",\"End\",o.id),y.reject({code:e,message:\"FPDF_LoadCustomDocument failed\"})}const u=this.pdfiumModule.FPDF_GetPageCount(s),F=[],m=this.malloc(8);for(let e=0;e<u;e++){if(!this.pdfiumModule.FPDF_GetPageSizeByIndexF(s,e,m)){const e=this.pdfiumModule.FPDF_GetLastError();return this.logger.error(U,V,`FPDF_GetPageSizeByIndexF failed with ${e}`),this.free(m),this.pdfiumModule.FPDF_CloseDocument(s),this.free(a),this.logger.perf(U,V,\"OpenDocumentFromLoader\",\"End\",o.id),y.reject({code:e,message:\"FPDF_GetPageSizeByIndexF failed\"})}const t={index:e,size:{width:this.pdfiumModule.pdfium.getValue(m,\"float\"),height:this.pdfiumModule.pdfium.getValue(m+4,\"float\")}};F.push(t)}this.free(m);const l={id:o.id,pageCount:u,pages:F};return this.cache.setDocument(o.id,a,s),this.logger.perf(U,V,\"OpenDocumentFromLoader\",\"End\",o.id),y.resolve(l)}getMetadata(e){this.logger.debug(U,V,\"getMetadata\",e),this.logger.perf(U,V,\"GetMetadata\",\"Begin\",e.id);const t=this.cache.getContext(e.id);if(!t)return this.logger.perf(U,V,\"GetMetadata\",\"End\",e.id),y.reject({code:C.DocNotOpen,message:\"document does not open\"});const n={title:this.readMetaText(t.docPtr,\"Title\"),author:this.readMetaText(t.docPtr,\"Author\"),subject:this.readMetaText(t.docPtr,\"Subject\"),keywords:this.readMetaText(t.docPtr,\"Keywords\"),producer:this.readMetaText(t.docPtr,\"Producer\"),creator:this.readMetaText(t.docPtr,\"Creator\"),creationDate:this.readMetaText(t.docPtr,\"CreationDate\"),modificationDate:this.readMetaText(t.docPtr,\"ModDate\")};return this.logger.perf(U,V,\"GetMetadata\",\"End\",e.id),y.resolve(n)}getDocPermissions(e){this.logger.debug(U,V,\"getDocPermissions\",e),this.logger.perf(U,V,\"getDocPermissions\",\"Begin\",e.id);const t=this.cache.getContext(e.id);if(!t)return this.logger.perf(U,V,\"getDocPermissions\",\"End\",e.id),y.reject({code:C.DocNotOpen,message:\"document does not open\"});const n=this.pdfiumModule.FPDF_GetDocPermissions(t.docPtr);return y.resolve(n)}getDocUserPermissions(e){this.logger.debug(U,V,\"getDocUserPermissions\",e),this.logger.perf(U,V,\"getDocUserPermissions\",\"Begin\",e.id);const t=this.cache.getContext(e.id);if(!t)return this.logger.perf(U,V,\"getDocUserPermissions\",\"End\",e.id),y.reject({code:C.DocNotOpen,message:\"document does not open\"});const n=this.pdfiumModule.FPDF_GetDocUserPermissions(t.docPtr);return y.resolve(n)}getSignatures(e){this.logger.debug(U,V,\"getSignatures\",e),this.logger.perf(U,V,\"GetSignatures\",\"Begin\",e.id);const t=this.cache.getContext(e.id);if(!t)return this.logger.perf(U,V,\"GetSignatures\",\"End\",e.id),y.reject({code:C.DocNotOpen,message:\"document does not open\"});const n=[],r=this.pdfiumModule.FPDF_GetSignatureCount(t.docPtr);for(let e=0;e<r;e++){const r=this.pdfiumModule.FPDF_GetSignatureObject(t.docPtr,e),o=R(this.pdfiumModule.pdfium,((e,t)=>this.pdfiumModule.FPDFSignatureObj_GetContents(r,e,t))),i=R(this.pdfiumModule.pdfium,((e,t)=>4*this.pdfiumModule.FPDFSignatureObj_GetByteRange(r,e,t))),a=R(this.pdfiumModule.pdfium,((e,t)=>this.pdfiumModule.FPDFSignatureObj_GetSubFilter(r,e,t))),s=w(this.pdfiumModule.pdfium,((e,t)=>this.pdfiumModule.FPDFSignatureObj_GetReason(r,e,t)),this.pdfiumModule.pdfium.UTF16ToString),u=w(this.pdfiumModule.pdfium,((e,t)=>this.pdfiumModule.FPDFSignatureObj_GetTime(r,e,t)),this.pdfiumModule.pdfium.UTF8ToString),F=this.pdfiumModule.FPDFSignatureObj_GetDocMDPPermission(r);n.push({contents:o,byteRange:i,subFilter:a,reason:s,time:u,docMDP:F})}return this.logger.perf(U,V,\"GetSignatures\",\"End\",e.id),y.resolve(n)}getBookmarks(e){this.logger.debug(U,V,\"getBookmarks\",e),this.logger.perf(U,V,\"GetBookmarks\",\"Begin\",e.id);const t=this.cache.getContext(e.id);if(!t)return this.logger.perf(U,V,\"getBookmarks\",\"End\",e.id),y.reject({code:C.DocNotOpen,message:\"document does not open\"});const n=this.readPdfBookmarks(t.docPtr,0);return this.logger.perf(U,V,\"GetBookmarks\",\"End\",e.id),y.resolve({bookmarks:n})}renderPage(e,t,n=1,r=o.Degree0,i=1,a={withAnnotations:!1},s=\"image/webp\"){const u=new _;this.logger.debug(U,V,\"renderPage\",e,t,n,r,i,a),this.logger.perf(U,V,\"RenderPage\",\"Begin\",`${e.id}-${t.index}`);const F=this.cache.getContext(e.id);if(!F)return this.logger.perf(U,V,\"RenderPage\",\"End\",`${e.id}-${t.index}`),y.reject({code:C.DocNotOpen,message:\"document does not open\"});const m=this.renderPageRectToImageData(F,t,{origin:{x:0,y:0},size:t.size},n,r,i,a);return this.logger.perf(U,V,\"RenderPage\",\"End\",`${e.id}-${t.index}`),this.imageDataConverter(m,s).then((e=>u.resolve(e))),u}renderPageRect(e,t,n,r,o,i,a,s=\"image/webp\"){const u=new _;this.logger.debug(U,V,\"renderPageRect\",e,t,n,r,o,i,a),this.logger.perf(U,V,\"RenderPageRect\",\"Begin\",`${e.id}-${t.index}`);const F=this.cache.getContext(e.id);if(!F)return this.logger.perf(U,V,\"RenderPageRect\",\"End\",`${e.id}-${t.index}`),y.reject({code:C.DocNotOpen,message:\"document does not open\"});const m=this.renderPageRectToImageData(F,t,i,n,r,o,a);return this.logger.perf(U,V,\"RenderPageRect\",\"End\",`${e.id}-${t.index}`),this.imageDataConverter(m,s).then((e=>u.resolve(e))),u}getAllAnnotations(e){this.logger.debug(U,V,\"getAllAnnotations\",e),this.logger.perf(U,V,\"GetAllAnnotations\",\"Begin\",e.id);const t=this.cache.getContext(e.id);if(!t)return this.logger.perf(U,V,\"GetAllAnnotations\",\"End\",e.id),y.reject({code:C.DocNotOpen,message:\"document does not open\"});const n=this.readAllAnnotations(e,t);return this.logger.perf(U,V,\"GetAllAnnotations\",\"End\",e.id),y.resolve(n)}readAllAnnotations(e,t){const n={};for(let r=0;r<e.pageCount;r++){const o=this.readPageAnnotations(t,e.pages[r]);n[r]=o}return n}getPageAnnotations(e,t){this.logger.debug(U,V,\"getPageAnnotations\",e,t),this.logger.perf(U,V,\"GetPageAnnotations\",\"Begin\",`${e.id}-${t.index}`);const n=this.cache.getContext(e.id);if(!n)return this.logger.perf(U,V,\"GetPageAnnotations\",\"End\",`${e.id}-${t.index}`),y.reject({code:C.DocNotOpen,message:\"document does not open\"});const r=this.readPageAnnotations(n,t);return this.logger.perf(U,V,\"GetPageAnnotations\",\"End\",`${e.id}-${t.index}`),this.logger.debug(U,V,\"GetPageAnnotations\",`${e.id}-${t.index}`,r),y.resolve(r)}createPageAnnotation(e,t,n){this.logger.debug(U,V,\"createPageAnnotation\",e,t,n),this.logger.perf(U,V,\"CreatePageAnnotation\",\"Begin\",`${e.id}-${t.index}`);const r=this.cache.getContext(e.id);if(!r)return this.logger.perf(U,V,\"CreatePageAnnotation\",\"End\",`${e.id}-${t.index}`),y.reject({code:C.DocNotOpen,message:\"document does not open\"});const o=r.acquirePage(t.index),i=this.pdfiumModule.FPDFPage_CreateAnnot(o.pagePtr,n.type);if(!i)return this.logger.perf(U,V,\"CreatePageAnnotation\",\"End\",`${e.id}-${t.index}`),o.release(),y.reject({code:C.CantCreateAnnot,message:\"can not create annotation with specified type\"});if(!this.setPageAnnoRect(t,o.pagePtr,i,n.rect))return this.pdfiumModule.FPDFPage_CloseAnnot(i),o.release(),this.logger.perf(U,V,\"CreatePageAnnotation\",\"End\",`${e.id}-${t.index}`),y.reject({code:C.CantSetAnnotRect,message:\"can not set the rect of the annotation\"});let a=!1;switch(n.type){case D.INK:a=this.addInkStroke(t,o.pagePtr,i,n);break;case D.STAMP:a=this.addStampContent(r.docPtr,t,o.pagePtr,i,n.rect,n.contents);break;case D.UNDERLINE:case D.STRIKEOUT:case D.SQUIGGLY:case D.HIGHLIGHT:a=this.addTextMarkupContent(t,o.pagePtr,i,n)}if(!a)return this.pdfiumModule.FPDFPage_RemoveAnnot(o.pagePtr,i),o.release(),this.logger.perf(U,V,\"CreatePageAnnotation\",\"End\",`${e.id}-${t.index}`),y.reject({code:C.CantSetAnnotContent,message:\"can not add content of the annotation\"});this.pdfiumModule.EPDFAnnot_GenerateAppearance(i),this.pdfiumModule.FPDFPage_GenerateContent(o.pagePtr);const s=this.pdfiumModule.FPDFPage_GetAnnotIndex(o.pagePtr,i);return this.pdfiumModule.FPDFPage_CloseAnnot(i),o.release(),this.logger.perf(U,V,\"CreatePageAnnotation\",\"End\",`${e.id}-${t.index}`),s>=0?y.resolve(s):y.reject({code:C.CantCreateAnnot,message:\"annotation created but index could not be determined\"})}updatePageAnnotation(e,t,n){this.logger.debug(U,V,\"updatePageAnnotation\",e,t,n),this.logger.perf(U,V,\"UpdatePageAnnotation\",\"Begin\",`${e.id}-${t.index}`);const r=this.cache.getContext(e.id);if(!r)return this.logger.perf(U,V,\"UpdatePageAnnotation\",\"End\",`${e.id}-${t.index}`),y.reject({code:C.DocNotOpen,message:\"document does not open\"});const o=r.acquirePage(t.index),i=this.pdfiumModule.FPDFPage_GetAnnot(o.pagePtr,n.id);if(!i)return o.release(),this.logger.perf(U,V,\"UpdatePageAnnotation\",\"End\",`${e.id}-${t.index}`),y.reject({code:C.NotFound,message:\"annotation not found\"});if(!this.setPageAnnoRect(t,o.pagePtr,i,n.rect))return this.pdfiumModule.FPDFPage_CloseAnnot(i),o.release(),this.logger.perf(U,V,\"UpdatePageAnnotation\",\"End\",`${e.id}-${t.index}`),y.reject({code:C.CantSetAnnotRect,message:\"failed to move annotation\"});let a=!1;switch(n.type){case D.INK:if(!this.pdfiumModule.FPDFAnnot_RemoveInkList(i))break;a=this.addInkStroke(t,o.pagePtr,i,n);break;case D.STAMP:for(let e=this.pdfiumModule.FPDFAnnot_GetObjectCount(i)-1;e>=0;e--)this.pdfiumModule.FPDFAnnot_RemoveObject(i,e);a=this.addStampContent(r.docPtr,t,o.pagePtr,i,n.rect,n.contents);break;case D.HIGHLIGHT:case D.UNDERLINE:case D.STRIKEOUT:case D.SQUIGGLY:a=this.addTextMarkupContent(t,o.pagePtr,i,n);break;default:a=!1}return a&&(this.pdfiumModule.EPDFAnnot_GenerateAppearance(i),this.pdfiumModule.FPDFPage_GenerateContent(o.pagePtr)),this.pdfiumModule.FPDFPage_CloseAnnot(i),o.release(),this.logger.perf(U,V,\"UpdatePageAnnotation\",\"End\",`${e.id}-${t.index}`),a?y.resolve(!0):y.reject({code:C.CantSetAnnotContent,message:\"failed to update annotation\"})}removePageAnnotation(e,t,n){this.logger.debug(U,V,\"removePageAnnotation\",e,t,n),this.logger.perf(U,V,\"RemovePageAnnotation\",\"Begin\",`${e.id}-${t.index}`);const r=this.cache.getContext(e.id);if(!r)return this.logger.perf(U,V,\"RemovePageAnnotation\",\"End\",`${e.id}-${t.index}`),y.reject({code:C.DocNotOpen,message:\"document does not open\"});const o=r.acquirePage(t.index);let i=!1;return i=this.pdfiumModule.FPDFPage_RemoveAnnot(o.pagePtr,n.id),i?(i=this.pdfiumModule.FPDFPage_GenerateContent(o.pagePtr),i||this.logger.error(U,V,\"FPDFPage_GenerateContent Failed\",`${e.id}-${t.index}`)):this.logger.error(U,V,\"FPDFPage_RemoveAnnot Failed\",`${e.id}-${t.index}`),o.release(),this.logger.perf(U,V,\"RemovePageAnnotation\",\"End\",`${e.id}-${t.index}`),y.resolve(i)}getPageTextRects(e,t,n,r){this.logger.debug(U,V,\"getPageTextRects\",e,t,n,r),this.logger.perf(U,V,\"GetPageTextRects\",\"Begin\",`${e.id}-${t.index}`);const o=this.cache.getContext(e.id);if(!o)return this.logger.perf(U,V,\"GetPageTextRects\",\"End\",`${e.id}-${t.index}`),y.reject({code:C.DocNotOpen,message:\"document does not open\"});const i=o.acquirePage(t.index),a=this.pdfiumModule.FPDFText_LoadPage(i.pagePtr),s=this.readPageTextRects(t,i.docPtr,i.pagePtr,a);return this.pdfiumModule.FPDFText_ClosePage(a),i.release(),this.logger.perf(U,V,\"GetPageTextRects\",\"End\",`${e.id}-${t.index}`),y.resolve(s)}renderThumbnail(e,t,n,r,o){this.logger.debug(U,V,\"renderThumbnail\",e,t,n,r,o),this.logger.perf(U,V,\"RenderThumbnail\",\"Begin\",`${e.id}-${t.index}`);if(!this.cache.getContext(e.id))return this.logger.perf(U,V,\"RenderThumbnail\",\"End\",`${e.id}-${t.index}`),y.reject({code:C.DocNotOpen,message:\"document does not open\"});n=Math.max(n,.5);const i=this.renderPage(e,t,n,r,o,{withAnnotations:!0});return this.logger.perf(U,V,\"RenderThumbnail\",\"End\",`${e.id}-${t.index}`),i}getAttachments(e){this.logger.debug(U,V,\"getAttachments\",e),this.logger.perf(U,V,\"GetAttachments\",\"Begin\",e.id);const t=this.cache.getContext(e.id);if(!t)return this.logger.perf(U,V,\"GetAttachments\",\"End\",e.id),y.reject({code:C.DocNotOpen,message:\"document does not open\"});const n=[],r=this.pdfiumModule.FPDFDoc_GetAttachmentCount(t.docPtr);for(let e=0;e<r;e++){const r=this.readPdfAttachment(t.docPtr,e);n.push(r)}return this.logger.perf(U,V,\"GetAttachments\",\"End\",e.id),y.resolve(n)}readAttachmentContent(e,t){this.logger.debug(U,V,\"readAttachmentContent\",e,t),this.logger.perf(U,V,\"ReadAttachmentContent\",\"Begin\",e.id);const n=this.cache.getContext(e.id);if(!n)return this.logger.perf(U,V,\"ReadAttachmentContent\",\"End\",e.id),y.reject({code:C.DocNotOpen,message:\"document does not open\"});const r=this.pdfiumModule.FPDFDoc_GetAttachment(n.docPtr,t.index),o=this.malloc(8);if(!this.pdfiumModule.FPDFAttachment_GetFile(r,0,0,o))return this.free(o),this.logger.perf(U,V,\"ReadAttachmentContent\",\"End\",e.id),y.reject({code:C.CantReadAttachmentSize,message:\"can not read attachment size\"});const i=this.pdfiumModule.pdfium.getValue(o,\"i64\"),a=this.malloc(i);if(!this.pdfiumModule.FPDFAttachment_GetFile(r,a,i,o))return this.free(o),this.free(a),this.logger.perf(U,V,\"ReadAttachmentContent\",\"End\",e.id),y.reject({code:C.CantReadAttachmentContent,message:\"can not read attachment content\"});const s=new ArrayBuffer(i),u=new DataView(s);for(let e=0;e<i;e++)u.setInt8(e,this.pdfiumModule.pdfium.getValue(a+e,\"i8\"));return this.free(o),this.free(a),this.logger.perf(U,V,\"ReadAttachmentContent\",\"End\",e.id),y.resolve(s)}setFormFieldValue(e,t,n,r){this.logger.debug(U,V,\"SetFormFieldValue\",e,n,r),this.logger.perf(U,V,\"SetFormFieldValue\",\"Begin\",`${e.id}-${n.id}`);const o=this.cache.getContext(e.id);if(!o)return this.logger.debug(U,V,\"SetFormFieldValue\",\"document is not opened\"),this.logger.perf(U,V,\"SetFormFieldValue\",\"End\",`${e.id}-${n.id}`),y.reject({code:C.DocNotOpen,message:\"document does not open\"});const i=this.pdfiumModule.PDFiumExt_OpenFormFillInfo(),a=this.pdfiumModule.PDFiumExt_InitFormFillEnvironment(o.docPtr,i),s=o.acquirePage(t.index);this.pdfiumModule.FORM_OnAfterLoadPage(s.pagePtr,a);const u=this.pdfiumModule.FPDFPage_GetAnnot(s.pagePtr,n.id);if(!this.pdfiumModule.FORM_SetFocusedAnnot(a,u))return this.logger.debug(U,V,\"SetFormFieldValue\",\"failed to set focused annotation\"),this.logger.perf(U,V,\"SetFormFieldValue\",\"End\",`${e.id}-${n.id}`),this.pdfiumModule.FPDFPage_CloseAnnot(u),this.pdfiumModule.FORM_OnBeforeClosePage(s.pagePtr,a),s.release(),this.pdfiumModule.PDFiumExt_ExitFormFillEnvironment(a),this.pdfiumModule.PDFiumExt_CloseFormFillInfo(i),y.reject({code:C.CantFocusAnnot,message:\"failed to set focused annotation\"});switch(r.kind){case\"text\":{if(!this.pdfiumModule.FORM_SelectAllText(a,s.pagePtr))return this.logger.debug(U,V,\"SetFormFieldValue\",\"failed to select all text\"),this.logger.perf(U,V,\"SetFormFieldValue\",\"End\",`${e.id}-${n.id}`),this.pdfiumModule.FORM_ForceToKillFocus(a),this.pdfiumModule.FPDFPage_CloseAnnot(u),this.pdfiumModule.FORM_OnBeforeClosePage(s.pagePtr,a),s.release(),this.pdfiumModule.PDFiumExt_ExitFormFillEnvironment(a),this.pdfiumModule.PDFiumExt_CloseFormFillInfo(i),y.reject({code:C.CantSelectText,message:\"failed to select all text\"});const t=2*(r.text.length+1),o=this.malloc(t);this.pdfiumModule.pdfium.stringToUTF16(r.text,o,t),this.pdfiumModule.FORM_ReplaceSelection(a,s.pagePtr,o),this.free(o)}break;case\"selection\":if(!this.pdfiumModule.FORM_SetIndexSelected(a,s.pagePtr,r.index,r.isSelected))return this.logger.debug(U,V,\"SetFormFieldValue\",\"failed to set index selected\"),this.logger.perf(U,V,\"SetFormFieldValue\",\"End\",`${e.id}-${n.id}`),this.pdfiumModule.FORM_ForceToKillFocus(a),this.pdfiumModule.FPDFPage_CloseAnnot(u),this.pdfiumModule.FORM_OnBeforeClosePage(s.pagePtr,a),s.release(),this.pdfiumModule.PDFiumExt_ExitFormFillEnvironment(a),this.pdfiumModule.PDFiumExt_CloseFormFillInfo(i),y.reject({code:C.CantSelectOption,message:\"failed to set index selected\"});break;case\"checked\":{const t=13;if(!this.pdfiumModule.FORM_OnChar(a,s.pagePtr,t,0))return this.logger.debug(U,V,\"SetFormFieldValue\",\"failed to set field checked\"),this.logger.perf(U,V,\"SetFormFieldValue\",\"End\",`${e.id}-${n.id}`),this.pdfiumModule.FORM_ForceToKillFocus(a),this.pdfiumModule.FPDFPage_CloseAnnot(u),this.pdfiumModule.FORM_OnBeforeClosePage(s.pagePtr,a),s.release(),this.pdfiumModule.PDFiumExt_ExitFormFillEnvironment(a),this.pdfiumModule.PDFiumExt_CloseFormFillInfo(i),y.reject({code:C.CantCheckField,message:\"failed to set field checked\"})}}return this.pdfiumModule.FORM_ForceToKillFocus(a),this.pdfiumModule.FPDFPage_CloseAnnot(u),this.pdfiumModule.FORM_OnBeforeClosePage(s.pagePtr,a),s.release(),this.pdfiumModule.PDFiumExt_ExitFormFillEnvironment(a),this.pdfiumModule.PDFiumExt_CloseFormFillInfo(i),y.resolve(!0)}flattenPage(e,t,n){this.logger.debug(U,V,\"flattenPage\",e,t,n),this.logger.perf(U,V,\"flattenPage\",\"Begin\",e.id);const r=this.cache.getContext(e.id);if(!r)return this.logger.perf(U,V,\"flattenPage\",\"End\",e.id),y.reject({code:C.DocNotOpen,message:\"document does not open\"});const o=r.acquirePage(t.index),i=this.pdfiumModule.FPDFPage_Flatten(o.pagePtr,n);return o.release(),this.logger.perf(U,V,\"flattenPage\",\"End\",e.id),y.resolve(i)}extractPages(e,t){this.logger.debug(U,V,\"extractPages\",e,t),this.logger.perf(U,V,\"ExtractPages\",\"Begin\",e.id);const n=this.cache.getContext(e.id);if(!n)return this.logger.perf(U,V,\"ExtractPages\",\"End\",e.id),y.reject({code:C.DocNotOpen,message:\"document does not open\"});const r=this.pdfiumModule.FPDF_CreateNewDocument();if(!r)return this.logger.perf(U,V,\"ExtractPages\",\"End\",e.id),y.reject({code:C.CantCreateNewDoc,message:\"can not create new document\"});const o=this.malloc(4*t.length);for(let e=0;e<t.length;e++)this.pdfiumModule.pdfium.setValue(o+4*e,t[e],\"i32\");if(!this.pdfiumModule.FPDF_ImportPagesByIndex(r,n.docPtr,o,t.length,0))return this.pdfiumModule.FPDF_CloseDocument(r),this.logger.perf(U,V,\"ExtractPages\",\"End\",e.id),y.reject({code:C.CantImportPages,message:\"can not import pages to new document\"});const i=this.saveDocument(r);return this.pdfiumModule.FPDF_CloseDocument(r),this.logger.perf(U,V,\"ExtractPages\",\"End\",e.id),y.resolve(i)}extractText(e,t){this.logger.debug(U,V,\"extractText\",e,t),this.logger.perf(U,V,\"ExtractText\",\"Begin\",e.id);const n=this.cache.getContext(e.id);if(!n)return this.logger.perf(U,V,\"ExtractText\",\"End\",e.id),y.reject({code:C.DocNotOpen,message:\"document does not open\"});const r=[];for(let e=0;e<t.length;e++){const o=n.acquirePage(t[e]),i=this.pdfiumModule.FPDFText_LoadPage(o.pagePtr),a=this.pdfiumModule.FPDFText_CountChars(i),s=this.malloc(2*(a+1));this.pdfiumModule.FPDFText_GetText(i,0,a,s);const u=this.pdfiumModule.pdfium.UTF16ToString(s);this.free(s),r.push(u),this.pdfiumModule.FPDFText_ClosePage(i),o.release()}const o=r.join(\"\\n\\n\");return this.logger.perf(U,V,\"ExtractText\",\"End\",e.id),y.resolve(o)}getTextSlices(e,t){if(this.logger.debug(U,V,\"getTextSlices\",e,t),this.logger.perf(U,V,\"GetTextSlices\",\"Begin\",e.id),0===t.length)return this.logger.perf(U,V,\"GetTextSlices\",\"End\",e.id),y.resolve([]);const n=this.cache.getContext(e.id);if(!n)return this.logger.perf(U,V,\"GetTextSlices\",\"End\",e.id),y.reject({code:C.DocNotOpen,message:\"document does not open\"});try{const r=new Array(t.length),o=new Map;t.forEach(((e,t)=>{(o.get(e.pageIndex)??o.set(e.pageIndex,[]).get(e.pageIndex)).push({slice:e,pos:t})}));for(const[e,t]of o){const o=n.acquirePage(e),i=o.getTextPage();for(const{slice:e,pos:n}of t){const t=this.malloc(2*(e.charCount+1));this.pdfiumModule.FPDFText_GetText(i,e.charIndex,e.charCount,t),r[n]=this.pdfiumModule.pdfium.UTF16ToString(t).replace(c,\"\"),this.free(t)}o.release()}return this.logger.perf(U,V,\"GetTextSlices\",\"End\",e.id),y.resolve(r)}catch(t){return this.logger.error(U,V,\"getTextSlices error\",t),this.logger.perf(U,V,\"GetTextSlices\",\"End\",e.id),y.reject({code:C.Unknown,message:String(t)})}}merge(e){this.logger.debug(U,V,\"merge\",e);const t=e.map((e=>e.id)).join(\".\");this.logger.perf(U,V,\"Merge\",\"Begin\",t);const n=this.pdfiumModule.FPDF_CreateNewDocument();if(!n)return this.logger.perf(U,V,\"Merge\",\"End\",t),y.reject({code:C.CantCreateNewDoc,message:\"can not create new document\"});const r=[];for(const o of e.reverse()){const e=new Uint8Array(o.content),i=e.length,a=this.malloc(i);this.pdfiumModule.pdfium.HEAPU8.set(e,a);const s=this.pdfiumModule.FPDF_LoadMemDocument(a,i,\"\");if(!s){const e=this.pdfiumModule.FPDF_GetLastError();this.logger.error(U,V,`FPDF_LoadMemDocument failed with ${e}`),this.free(a);for(const e of r)this.pdfiumModule.FPDF_CloseDocument(e.docPtr),this.free(e.filePtr);return this.logger.perf(U,V,\"Merge\",\"End\",t),y.reject({code:e,message:\"FPDF_LoadMemDocument failed\"})}if(r.push({filePtr:a,docPtr:s}),!this.pdfiumModule.FPDF_ImportPages(n,s,\"\",0)){this.pdfiumModule.FPDF_CloseDocument(n);for(const e of r)this.pdfiumModule.FPDF_CloseDocument(e.docPtr),this.free(e.filePtr);return this.logger.perf(U,V,\"Merge\",\"End\",t),y.reject({code:C.CantImportPages,message:\"can not import pages to new document\"})}}const o=this.saveDocument(n);this.pdfiumModule.FPDF_CloseDocument(n);for(const e of r)this.pdfiumModule.FPDF_CloseDocument(e.docPtr),this.free(e.filePtr);const i={id:`${Math.random()}`,content:o};return this.logger.perf(U,V,\"Merge\",\"End\",t),y.resolve(i)}mergePages(e){const t=e.map((e=>`${e.docId}:${e.pageIndices.join(\",\")}`)).join(\"|\");this.logger.debug(U,V,\"mergePages\",e),this.logger.perf(U,V,\"MergePages\",\"Begin\",t);const n=this.pdfiumModule.FPDF_CreateNewDocument();if(!n)return this.logger.perf(U,V,\"MergePages\",\"End\",t),y.reject({code:C.CantCreateNewDoc,message:\"Cannot create new document\"});try{for(const t of[...e].reverse()){const e=this.cache.getContext(t.docId);if(!e){this.logger.warn(U,V,`Document ${t.docId} is not open, skipping`);continue}const r=this.pdfiumModule.FPDF_GetPageCount(e.docPtr),o=t.pageIndices.filter((e=>e>=0&&e<r));if(0===o.length)continue;const i=o.map((e=>e+1)).join(\",\");try{if(!this.pdfiumModule.FPDF_ImportPages(n,e.docPtr,i,0))throw new Error(`Failed to import pages ${i} from document ${t.docId}`)}finally{}}const r=this.saveDocument(n),o={id:`${Math.random()}`,content:r};return this.logger.perf(U,V,\"MergePages\",\"End\",t),y.resolve(o)}catch(e){return this.logger.error(U,V,\"mergePages failed\",e),this.logger.perf(U,V,\"MergePages\",\"End\",t),y.reject({code:C.CantImportPages,message:e instanceof Error?e.message:\"Failed to merge pages\"})}finally{n&&this.pdfiumModule.FPDF_CloseDocument(n)}}saveAsCopy(e){this.logger.debug(U,V,\"saveAsCopy\",e),this.logger.perf(U,V,\"SaveAsCopy\",\"Begin\",e.id);const t=this.cache.getContext(e.id);if(!t)return this.logger.perf(U,V,\"SaveAsCopy\",\"End\",e.id),y.reject({code:C.DocNotOpen,message:\"document does not open\"});const n=this.saveDocument(t.docPtr);return this.logger.perf(U,V,\"SaveAsCopy\",\"End\",e.id),y.resolve(n)}closeDocument(e){this.logger.debug(U,V,\"closeDocument\",e),this.logger.perf(U,V,\"CloseDocument\",\"Begin\",e.id);const t=this.cache.getContext(e.id);return t?(t.dispose(),this.logger.perf(U,V,\"CloseDocument\",\"End\",e.id),y.resolve(!0)):(this.logger.perf(U,V,\"CloseDocument\",\"End\",e.id),y.reject({code:C.DocNotOpen,message:\"document does not open\"}))}malloc(e){const t=this.pdfiumModule.pdfium.wasmExports.malloc(e);for(let n=0;n<e;n++)this.pdfiumModule.pdfium.HEAP8[t+n]=0;return t}free(e){this.pdfiumModule.pdfium.wasmExports.free(e)}addInkStroke(e,t,n,r){return!!this.setBorderStyle(n,A.SOLID,r.strokeWidth)&&(!!this.setPageAnnoRect(e,t,n,r.rect)&&(!!this.setInkList(e,n,r.inkList)&&(!!this.setAnnotString(n,\"T\",r.author||\"\")&&(!!this.setAnnotString(n,\"M\",M(r.modified))&&!!this.setAnnotationColor(n,{color:r.color??\"#FFFF00\",opacity:r.opacity??1},f.Color)))))}addTextMarkupContent(e,t,n,r){return!!this.setPageAnnoRect(e,t,n,r.rect)&&(!!this.syncQuadPointsAnno(e,n,r.segmentRects)&&(!!this.setAnnotString(n,\"Contents\",r.contents??\"\")&&(!!this.setAnnotString(n,\"T\",r.author||\"\")&&(!!this.setAnnotString(n,\"M\",M(r.modified))&&!!this.setAnnotationColor(n,{color:r.color??\"#FFFF00\",opacity:r.opacity??1},f.Color)))))}addStampContent(e,t,n,r,o,i){for(const a of i)if(a.type===E.IMAGE)return this.addImageObject(e,t,n,r,o.origin,a.imageData);return!1}addImageObject(e,t,n,r,o,i){const a=i.width*i.height,s=this.malloc(4*a);if(!s)return!1;for(let e=0;e<a;e++){const t=i.data[4*e],n=i.data[4*e+1],r=i.data[4*e+2],o=i.data[4*e+3];this.pdfiumModule.pdfium.setValue(s+4*e,r,\"i8\"),this.pdfiumModule.pdfium.setValue(s+4*e+1,n,\"i8\"),this.pdfiumModule.pdfium.setValue(s+4*e+2,t,\"i8\"),this.pdfiumModule.pdfium.setValue(s+4*e+3,o,\"i8\")}const u=B.Bitmap_BGRA,F=this.pdfiumModule.FPDFBitmap_CreateEx(i.width,i.height,u,s,0);if(!F)return this.free(s),!1;const m=this.pdfiumModule.FPDFPageObj_NewImageObj(e);if(!m)return this.pdfiumModule.FPDFBitmap_Destroy(F),this.free(s),!1;if(!this.pdfiumModule.FPDFImageObj_SetBitmap(n,0,m,F))return this.pdfiumModule.FPDFBitmap_Destroy(F),this.pdfiumModule.FPDFPageObj_Destroy(m),this.free(s),!1;const l=this.malloc(24);return this.pdfiumModule.pdfium.setValue(l,i.width,\"float\"),this.pdfiumModule.pdfium.setValue(l+4,0,\"float\"),this.pdfiumModule.pdfium.setValue(l+8,0,\"float\"),this.pdfiumModule.pdfium.setValue(l+12,i.height,\"float\"),this.pdfiumModule.pdfium.setValue(l+16,0,\"float\"),this.pdfiumModule.pdfium.setValue(l+20,0,\"float\"),this.pdfiumModule.FPDFPageObj_SetMatrix(m,l)?(this.free(l),this.pdfiumModule.FPDFPageObj_Transform(m,1,0,0,1,o.x,o.y),this.pdfiumModule.FPDFAnnot_AppendObject(r,m)?(this.pdfiumModule.FPDFPage_GenerateContent(n),this.pdfiumModule.FPDFBitmap_Destroy(F),this.free(s),!0):(this.pdfiumModule.FPDFBitmap_Destroy(F),this.pdfiumModule.FPDFPageObj_Destroy(m),this.free(s),!1)):(this.free(l),this.pdfiumModule.FPDFBitmap_Destroy(F),this.pdfiumModule.FPDFPageObj_Destroy(m),this.free(s),!1)}saveDocument(e){const t=this.pdfiumModule.PDFiumExt_OpenFileWriter();this.pdfiumModule.PDFiumExt_SaveAsCopy(e,t);const n=this.pdfiumModule.PDFiumExt_GetFileWriterSize(t),r=this.malloc(n);this.pdfiumModule.PDFiumExt_GetFileWriterData(t,r,n);const o=new ArrayBuffer(n),i=new DataView(o);for(let e=0;e<n;e++)i.setInt8(e,this.pdfiumModule.pdfium.getValue(r+e,\"i8\"));return this.free(r),this.pdfiumModule.PDFiumExt_CloseFileWriter(t),o}readMetaText(e,t){return w(this.pdfiumModule.pdfium,((n,r)=>this.pdfiumModule.FPDF_GetMetaText(e,t,n,r)),this.pdfiumModule.pdfium.UTF16ToString)}readPdfBookmarks(e,t=0){let n=this.pdfiumModule.FPDFBookmark_GetFirstChild(e,t);const r=[];for(;n;){const t=this.readPdfBookmark(e,n);r.push(t);n=this.pdfiumModule.FPDFBookmark_GetNextSibling(e,n)}return r}readPdfBookmark(e,t){const n=w(this.pdfiumModule.pdfium,((e,n)=>this.pdfiumModule.FPDFBookmark_GetTitle(t,e,n)),this.pdfiumModule.pdfium.UTF16ToString),r=this.readPdfBookmarks(e,t);return{title:n,target:this.readPdfBookmarkTarget(e,(()=>this.pdfiumModule.FPDFBookmark_GetAction(t)),(()=>this.pdfiumModule.FPDFBookmark_GetDest(e,t))),children:r}}readPageTextRects(e,t,n,r){const o=this.pdfiumModule.FPDFText_CountRects(r,0,-1),i=[];for(let t=0;t<o;t++){const o=this.malloc(8),a=this.malloc(8),s=this.malloc(8),u=this.malloc(8);if(!this.pdfiumModule.FPDFText_GetRect(r,t,a,o,s,u)){this.free(a),this.free(o),this.free(s),this.free(u);continue}const F=this.pdfiumModule.pdfium.getValue(a,\"double\"),m=this.pdfiumModule.pdfium.getValue(o,\"double\"),l=this.pdfiumModule.pdfium.getValue(s,\"double\"),d=this.pdfiumModule.pdfium.getValue(u,\"double\");this.free(a),this.free(o),this.free(s),this.free(u);const _=this.malloc(4),P=this.malloc(4);this.pdfiumModule.FPDF_PageToDevice(n,0,0,e.size.width,e.size.height,0,F,m,_,P);const c=this.pdfiumModule.pdfium.getValue(_,\"i32\"),g=this.pdfiumModule.pdfium.getValue(P,\"i32\");this.free(_),this.free(P);const h={origin:{x:c,y:g},size:{width:Math.ceil(Math.abs(l-F)),height:Math.ceil(Math.abs(m-d))}},D=this.pdfiumModule.FPDFText_GetBoundedText(r,F,m,l,d,0,0),b=2*(D+1),p=this.malloc(b);this.pdfiumModule.FPDFText_GetBoundedText(r,F,m,l,d,p,D);const f=this.pdfiumModule.pdfium.UTF16ToString(p);this.free(p);const A=this.pdfiumModule.FPDFText_GetCharIndexAtPos(r,F,m,2,2);let E=\"\",G=h.size.height;if(A>=0){G=this.pdfiumModule.FPDFText_GetFontSize(r,A);const e=this.pdfiumModule.FPDFText_GetFontInfo(r,A,0,0,0)+1,t=this.malloc(e),n=this.malloc(4);this.pdfiumModule.FPDFText_GetFontInfo(r,A,t,e,n),E=this.pdfiumModule.pdfium.UTF8ToString(t),this.free(t),this.free(n)}const S={content:f,rect:h,font:{family:E,size:G}};i.push(S)}return i}getPageGeometry(e,t){const n=\"getPageGeometry\";this.logger.perf(U,V,n,\"Begin\",e.id);const r=this.cache.getContext(e.id);if(!r)return this.logger.perf(U,V,n,\"End\",e.id),y.reject({code:C.DocNotOpen,message:\"document does not open\"});const o=r.acquirePage(t.index),i=o.getTextPage(),a=this.pdfiumModule.FPDFText_CountChars(i),s=[];for(let e=0;e<a;e++){const n=this.readGlyphInfo(t,o.pagePtr,i,e);s.push(n)}const u=this.buildRunsFromGlyphs(s,i);return o.release(),this.logger.perf(U,V,n,\"End\",e.id),y.resolve({runs:u})}buildRunsFromGlyphs(e,t){const n=[];let r=null,o=null,i=null;for(let a=0;a<e.length;a++){const s=e[a],u=this.pdfiumModule.FPDFText_GetTextObject(t,a);if(u!==o&&(o=u,r={rect:{x:s.origin.x,y:s.origin.y,width:s.size.width,height:s.size.height},charStart:a,glyphs:[]},i={minX:s.origin.x,minY:s.origin.y,maxX:s.origin.x+s.size.width,maxY:s.origin.y+s.size.height},n.push(r)),r.glyphs.push({x:s.origin.x,y:s.origin.y,width:s.size.width,height:s.size.height,flags:s.isEmpty?2:s.isSpace?1:0}),s.isEmpty)continue;const F=s.origin.x+s.size.width,m=s.origin.y+s.size.height;i.minX=Math.min(i.minX,s.origin.x),i.minY=Math.min(i.minY,s.origin.y),i.maxX=Math.max(i.maxX,F),i.maxY=Math.max(i.maxY,m),r.rect.x=i.minX,r.rect.y=i.minY,r.rect.width=i.maxX-i.minX,r.rect.height=i.maxY-i.minY}return n}readGlyphInfo(e,t,n,r){const o=this.malloc(4),i=this.malloc(4),a=this.malloc(4),s=this.malloc(4),u=this.malloc(16);let F=0,m=0,l=0,d=0,_=!1;if(this.pdfiumModule.FPDFText_GetLooseCharBox(n,r,u)){const P=this.pdfiumModule.pdfium.getValue(u,\"float\"),c=this.pdfiumModule.pdfium.getValue(u+4,\"float\"),g=this.pdfiumModule.pdfium.getValue(u+8,\"float\"),h=this.pdfiumModule.pdfium.getValue(u+12,\"float\");if(P===g||c===h)return{origin:{x:0,y:0},size:{width:0,height:0},isEmpty:!0};this.pdfiumModule.FPDF_PageToDevice(t,0,0,e.size.width,e.size.height,0,P,c,o,i),this.pdfiumModule.FPDF_PageToDevice(t,0,0,e.size.width,e.size.height,0,g,h,a,s);const D=this.pdfiumModule.pdfium.getValue(o,\"i32\"),b=this.pdfiumModule.pdfium.getValue(i,\"i32\"),p=this.pdfiumModule.pdfium.getValue(a,\"i32\"),f=this.pdfiumModule.pdfium.getValue(s,\"i32\");F=Math.min(D,p),m=Math.min(b,f),l=Math.max(1,Math.abs(p-D)),d=Math.max(1,Math.abs(f-b));_=32===this.pdfiumModule.FPDFText_GetUnicode(n,r)}return[u,o,i,a,s].forEach((e=>this.free(e))),{origin:{x:F,y:m},size:{width:l,height:d},..._&&{isSpace:_}}}getPageGlyphs(e,t){this.logger.debug(U,V,\"getPageGlyphs\",e,t),this.logger.perf(U,V,\"getPageGlyphs\",\"Begin\",e.id);const n=this.cache.getContext(e.id);if(!n)return this.logger.perf(U,V,\"getPageGlyphs\",\"End\",e.id),y.reject({code:C.DocNotOpen,message:\"document does not open\"});const r=n.acquirePage(t.index),o=r.getTextPage(),i=this.pdfiumModule.FPDFText_CountChars(o),a=new Array(i);for(let e=0;e<i;e++){const n=this.readGlyphInfo(t,r.pagePtr,o,e);n.isEmpty||(a[e]={...n})}return r.release(),this.logger.perf(U,V,\"getPageGlyphs\",\"End\",e.id),y.resolve(a)}readCharBox(e,t,n,r){const o=this.malloc(8),i=this.malloc(8),a=this.malloc(8),s=this.malloc(8);let u=0,F=0,m=0,l=0;if(this.pdfiumModule.FPDFText_GetCharBox(n,r,i,s,a,o)){const n=this.pdfiumModule.pdfium.getValue(o,\"double\"),r=this.pdfiumModule.pdfium.getValue(i,\"double\"),d=this.pdfiumModule.pdfium.getValue(a,\"double\"),_=this.pdfiumModule.pdfium.getValue(s,\"double\"),P=this.malloc(4),c=this.malloc(4);this.pdfiumModule.FPDF_PageToDevice(t,0,0,e.size.width,e.size.height,0,r,n,P,c),u=this.pdfiumModule.pdfium.getValue(P,\"i32\"),F=this.pdfiumModule.pdfium.getValue(c,\"i32\"),this.free(P),this.free(c),m=Math.ceil(Math.abs(_-r)),l=Math.ceil(Math.abs(n-d))}return this.free(o),this.free(i),this.free(a),this.free(s),{origin:{x:u,y:F},size:{width:m,height:l}}}readPageAnnotations(e,t){const n=e.acquirePage(t.index),r=this.pdfiumModule.FPDFPage_GetAnnotCount(n.pagePtr),o=[];for(let e=0;e<r;e++)n.withAnnotation(e,(r=>{const i=this.readPageAnnotation(t,n,r,e);i&&o.push(i)}));return o}readPageAnnotation(e,t,n,r){const o=this.pdfiumModule.FPDFAnnot_GetSubtype(n);let i;switch(o){case D.TEXT:i=this.readPdfTextAnno(e,t.pagePtr,n,r);break;case D.FREETEXT:i=this.readPdfFreeTextAnno(e,t.pagePtr,n,r);break;case D.LINK:i=this.readPdfLinkAnno(e,t.docPtr,t.pagePtr,t.getTextPage(),n,r);break;case D.WIDGET:i=this.readPdfWidgetAnno(e,t.pagePtr,n,t.getFormHandle(),r);break;case D.FILEATTACHMENT:i=this.readPdfFileAttachmentAnno(e,t.pagePtr,n,r);break;case D.INK:i=this.readPdfInkAnno(e,t.pagePtr,n,r);break;case D.POLYGON:i=this.readPdfPolygonAnno(e,t.pagePtr,n,r);break;case D.POLYLINE:i=this.readPdfPolylineAnno(e,t.pagePtr,n,r);break;case D.LINE:i=this.readPdfLineAnno(e,t.pagePtr,n,r);break;case D.HIGHLIGHT:i=this.readPdfHighlightAnno(e,t.pagePtr,n,r);break;case D.STAMP:i=this.readPdfStampAnno(t.docPtr,e,t.pagePtr,n,r);break;case D.SQUARE:i=this.readPdfSquareAnno(e,t.pagePtr,n,r);break;case D.CIRCLE:i=this.readPdfCircleAnno(e,t.pagePtr,n,r);break;case D.UNDERLINE:i=this.readPdfUnderlineAnno(e,t.pagePtr,n,r);break;case D.SQUIGGLY:i=this.readPdfSquigglyAnno(e,t.pagePtr,n,r);break;case D.STRIKEOUT:i=this.readPdfStrikeOutAnno(e,t.pagePtr,n,r);break;case D.CARET:i=this.readPdfCaretAnno(e,t.pagePtr,n,r);break;default:i=this.readPdfAnno(e,t.pagePtr,o,n,r)}return i}readAnnotationColor(e,t=f.Color){const n=this.malloc(4),r=this.malloc(4),o=this.malloc(4),i=this.malloc(4);let a;return this.pdfiumModule.EPDFAnnot_GetColor(e,t,n,r,o,i)&&(a={red:255&this.pdfiumModule.pdfium.getValue(n,\"i32\"),green:255&this.pdfiumModule.pdfium.getValue(r,\"i32\"),blue:255&this.pdfiumModule.pdfium.getValue(o,\"i32\"),alpha:255&this.pdfiumModule.pdfium.getValue(i,\"i32\")}),this.free(n),this.free(r),this.free(o),this.free(i),a}resolveAnnotationColor(e,t=f.Color,n={red:255,green:245,blue:155,alpha:255}){return function(e){const t=e=>Math.max(0,Math.min(255,e)),n=e=>t(e).toString(16).padStart(2,\"0\");return{color:`#${n(e.red)}${n(e.green)}${n(e.blue)}`,opacity:t(e.alpha)/255}}(this.readAnnotationColor(e,t)??n)}setAnnotationColor(e,t,n=f.Color){const r=function({color:e,opacity:t}){/^#?[0-9a-f]{3}$/i.test(e)&&(e=e.replace(/^#?([0-9a-f])([0-9a-f])([0-9a-f])$/i,\"#$1$1$2$2$3$3\").toLowerCase());const[,n,r,o]=/^#?([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i.exec(e)??(()=>{throw new Error(`Invalid hex colour: “${e}”`)})();return{red:parseInt(n,16),green:parseInt(r,16),blue:parseInt(o,16),alpha:((e,t=255)=>Math.max(0,Math.min(t,e)))(Math.round(255*t))}}(t);return this.pdfiumModule.EPDFAnnot_SetColor(e,n,255&r.red,255&r.green,255&r.blue,255&(r.alpha??255))}getBorderStyle(e){const t=this.malloc(4);let n=0,r=A.UNKNOWN,o=!1;return r=this.pdfiumModule.EPDFAnnot_GetBorderStyle(e,t),n=this.pdfiumModule.pdfium.getValue(t,\"float\"),o=r!==A.UNKNOWN,this.free(t),{ok:o,style:r,width:n}}setBorderStyle(e,t,n){return this.pdfiumModule.EPDFAnnot_SetBorderStyle(e,t,n)}getBorderEffect(e){const t=this.malloc(4),n=!!this.pdfiumModule.EPDFAnnot_GetBorderEffect(e,t),r=n?this.pdfiumModule.pdfium.getValue(t,\"float\"):0;return this.free(t),{ok:n,intensity:r}}getRectangleDifferences(e){const t=this.malloc(4),n=this.malloc(4),r=this.malloc(4),o=this.malloc(4),i=!!this.pdfiumModule.EPDFAnnot_GetRectangleDifferences(e,t,n,r,o),a=this.pdfiumModule.pdfium,s=a.getValue(t,\"float\"),u=a.getValue(n,\"float\"),F=a.getValue(r,\"float\"),m=a.getValue(o,\"float\");return this.free(t),this.free(n),this.free(r),this.free(o),{ok:i,left:s,top:u,right:F,bottom:m}}getBorderDashPattern(e){const t=this.pdfiumModule.EPDFAnnot_GetBorderDashPatternCount(e);if(0===t)return{ok:!1,pattern:[]};const n=this.malloc(4*t),r=!!this.pdfiumModule.EPDFAnnot_GetBorderDashPattern(e,n,t),o=[];if(r){const e=this.pdfiumModule.pdfium;for(let r=0;r<t;r++)o.push(e.getValue(n+4*r,\"float\"))}return this.free(n),{ok:r,pattern:o}}getQuadPointsAnno(e,t){const n=this.pdfiumModule.FPDFAnnot_CountAttachmentPoints(t);if(0===n)return[];const r=[];for(let o=0;o<n;o++){const n=this.malloc(32);if(this.pdfiumModule.FPDFAnnot_GetAttachmentPoints(t,o,n)){const t=[],o=[];for(let e=0;e<4;e++){const r=n+8*e;t.push(this.pdfiumModule.pdfium.getValue(r,\"float\")),o.push(this.pdfiumModule.pdfium.getValue(r+4,\"float\"))}const i=this.convertPagePointToDevicePoint(e,{x:t[0],y:o[0]}),a=this.convertPagePointToDevicePoint(e,{x:t[1],y:o[1]}),s=this.convertPagePointToDevicePoint(e,{x:t[2],y:o[2]}),u=this.convertPagePointToDevicePoint(e,{x:t[3],y:o[3]});r.push({p1:i,p2:a,p3:s,p4:u})}this.free(n)}return r.map(u)}syncQuadPointsAnno(e,t,n){const r=this.pdfiumModule.pdfium,o=this.pdfiumModule.FPDFAnnot_CountAttachmentPoints(t),i=this.malloc(32),a=t=>{const n=function(e){return{p1:{x:e.origin.x,y:e.origin.y},p2:{x:e.origin.x+e.size.width,y:e.origin.y},p3:{x:e.origin.x+e.size.width,y:e.origin.y+e.size.height},p4:{x:e.origin.x,y:e.origin.y+e.size.height}}}(t),o=this.convertDevicePointToPagePoint(e,n.p1),a=this.convertDevicePointToPagePoint(e,n.p2),s=this.convertDevicePointToPagePoint(e,n.p3),u=this.convertDevicePointToPagePoint(e,n.p4);r.setValue(i+0,o.x,\"float\"),r.setValue(i+4,o.y,\"float\"),r.setValue(i+8,a.x,\"float\"),r.setValue(i+12,a.y,\"float\"),r.setValue(i+16,u.x,\"float\"),r.setValue(i+20,u.y,\"float\"),r.setValue(i+24,s.x,\"float\"),r.setValue(i+28,s.y,\"float\")},s=Math.min(o,n.length);for(let e=0;e<s;e++)if(a(n[e]),!this.pdfiumModule.FPDFAnnot_SetAttachmentPoints(t,e,i))return this.free(i),!1;for(let e=o;e<n.length;e++)if(a(n[e]),!this.pdfiumModule.FPDFAnnot_AppendAttachmentPoints(t,i))return this.free(i),!1;return this.free(i),!0}getInkList(e,t){const n=[],r=this.pdfiumModule.FPDFAnnot_GetInkListCount(t);for(let o=0;o<r;o++){const r=[],i=this.pdfiumModule.FPDFAnnot_GetInkListPath(t,o,0,0);if(i>0){const n=8,a=this.malloc(i*n);this.pdfiumModule.FPDFAnnot_GetInkListPath(t,o,a,i);for(let t=0;t<i;t++){const n=this.pdfiumModule.pdfium.getValue(a+8*t,\"float\"),o=this.pdfiumModule.pdfium.getValue(a+8*t+4,\"float\"),{x:i,y:s}=this.convertPagePointToDevicePoint(e,{x:n,y:o});r.push({x:i,y:s})}this.free(a)}n.push({points:r})}return n}setInkList(e,t,n){for(const r of n){const n=r.points.length,o=this.malloc(8*n);for(let t=0;t<n;t++){const n=r.points[t],{x:i,y:a}=this.convertDevicePointToPagePoint(e,n);this.pdfiumModule.pdfium.setValue(o+8*t,i,\"float\"),this.pdfiumModule.pdfium.setValue(o+8*t+4,a,\"float\")}if(-1===this.pdfiumModule.FPDFAnnot_AddInkStroke(t,o,n))return this.free(o),!1;this.free(o)}return!0}readPdfTextAnno(e,t,n,r){const o=this.readPageAnnoRect(n),i=this.convertPageRectToDeviceRect(e,t,o),a=this.getAnnotString(n,\"T\"),s=T(this.getAnnotString(n,\"M\")),u=this.getAnnotString(n,\"Contents\")||\"\",F=this.getAnnotString(n,\"State\"),m=this.getAnnotString(n,\"StateModel\"),l=this.resolveAnnotationColor(n),d=this.getInReplyToId(t,n);return{pageIndex:e.index,id:r,type:D.TEXT,contents:u,...l,rect:i,inReplyToId:d,author:a,modified:s,state:F,stateModel:m}}readPdfFreeTextAnno(e,t,n,r){const o=this.readPageAnnoRect(n),i=this.convertPageRectToDeviceRect(e,t,o),a=this.getAnnotString(n,\"Contents\")||\"\",s=this.getAnnotString(n,\"T\"),u=T(this.getAnnotString(n,\"M\"));return{pageIndex:e.index,id:r,type:D.FREETEXT,contents:a,author:s,modified:u,rect:i}}readPdfLinkAnno(e,t,n,r,o,i){const a=this.pdfiumModule.FPDFAnnot_GetLink(o);if(!a)return;const s=this.readPageAnnoRect(o),{left:u,top:F,right:m,bottom:l}=s,d=this.convertPageRectToDeviceRect(e,n,s),_=this.getAnnotString(o,\"T\"),P=T(this.getAnnotString(o,\"M\")),c=this.pdfiumModule.FPDFText_GetBoundedText(r,u,F,m,l,0,0),g=2*(c+1),h=this.malloc(g);this.pdfiumModule.FPDFText_GetBoundedText(r,u,F,m,l,h,c);const b=this.pdfiumModule.pdfium.UTF16ToString(h);this.free(h);const p=this.readPdfLinkAnnoTarget(t,(()=>this.pdfiumModule.FPDFLink_GetAction(a)),(()=>this.pdfiumModule.FPDFLink_GetDest(t,a)));return{pageIndex:e.index,id:i,type:D.LINK,text:b,target:p,rect:d,author:_,modified:P}}readPdfWidgetAnno(e,t,n,r,o){const i=this.readPageAnnoRect(n),a=this.convertPageRectToDeviceRect(e,t,i),s=this.getAnnotString(n,\"T\"),u=T(this.getAnnotString(n,\"M\")),F=this.readPdfWidgetAnnoField(r,n);return{pageIndex:e.index,id:o,type:D.WIDGET,rect:a,field:F,author:s,modified:u}}readPdfFileAttachmentAnno(e,t,n,r){const o=this.readPageAnnoRect(n),i=this.convertPageRectToDeviceRect(e,t,o),a=this.getAnnotString(n,\"T\"),s=T(this.getAnnotString(n,\"M\"));return{pageIndex:e.index,id:r,type:D.FILEATTACHMENT,rect:i,author:a,modified:s}}readPdfInkAnno(e,t,n,r){const o=this.readPageAnnoRect(n),i=this.convertPageRectToDeviceRect(e,t,o),a=this.getAnnotString(n,\"T\"),s=T(this.getAnnotString(n,\"M\")),u=this.resolveAnnotationColor(n),{width:F}=this.getBorderStyle(n),m=this.getInkList(e,n);return{pageIndex:e.index,id:r,type:D.INK,...u,strokeWidth:F,rect:i,inkList:m,author:a,modified:s}}readPdfPolygonAnno(e,t,n,r){const o=this.readPageAnnoRect(n),i=this.convertPageRectToDeviceRect(e,t,o),a=this.getAnnotString(n,\"T\"),s=T(this.getAnnotString(n,\"M\")),u=this.readPdfAnnoVertices(e,t,n);return{pageIndex:e.index,id:r,type:D.POLYGON,rect:i,vertices:u,author:a,modified:s}}readPdfPolylineAnno(e,t,n,r){const o=this.readPageAnnoRect(n),i=this.convertPageRectToDeviceRect(e,t,o),a=this.getAnnotString(n,\"T\"),s=T(this.getAnnotString(n,\"M\")),u=this.readPdfAnnoVertices(e,t,n);return{pageIndex:e.index,id:r,type:D.POLYLINE,rect:i,vertices:u,author:a,modified:s}}readPdfLineAnno(e,t,n,r){const o=this.readPageAnnoRect(n),i=this.convertPageRectToDeviceRect(e,t,o),a=this.getAnnotString(n,\"T\"),s=T(this.getAnnotString(n,\"M\")),u=this.malloc(8),F=this.malloc(8);this.pdfiumModule.FPDFAnnot_GetLine(n,u,F);const m=this.pdfiumModule.pdfium.getValue(u,\"float\"),l=this.pdfiumModule.pdfium.getValue(u+4,\"float\"),d=this.convertPagePointToDevicePoint(e,{x:m,y:l}),_=this.pdfiumModule.pdfium.getValue(F,\"float\"),P=this.pdfiumModule.pdfium.getValue(F+4,\"float\"),c=this.convertPagePointToDevicePoint(e,{x:_,y:P});return this.free(u),this.free(F),{pageIndex:e.index,id:r,type:D.LINE,rect:i,startPoint:d,endPoint:c,author:a,modified:s}}readPdfHighlightAnno(e,t,n,r){const o=this.readPageAnnoRect(n),i=this.convertPageRectToDeviceRect(e,t,o),a=this.getQuadPointsAnno(e,n),s=this.resolveAnnotationColor(n),u=this.getAnnotString(n,\"T\"),F=T(this.getAnnotString(n,\"M\")),m=this.getAnnotString(n,\"Contents\")||\"\";return{pageIndex:e.index,id:r,type:D.HIGHLIGHT,rect:i,contents:m,segmentRects:a,...s,author:u,modified:F}}readPdfUnderlineAnno(e,t,n,r){const o=this.readPageAnnoRect(n),i=this.convertPageRectToDeviceRect(e,t,o),a=this.getAnnotString(n,\"T\"),s=T(this.getAnnotString(n,\"M\")),u=this.getQuadPointsAnno(e,n),F=this.getAnnotString(n,\"Contents\")||\"\",m=this.resolveAnnotationColor(n);return{pageIndex:e.index,id:r,type:D.UNDERLINE,rect:i,contents:F,segmentRects:u,...m,author:a,modified:s}}readPdfStrikeOutAnno(e,t,n,r){const o=this.readPageAnnoRect(n),i=this.convertPageRectToDeviceRect(e,t,o),a=this.getAnnotString(n,\"T\"),s=T(this.getAnnotString(n,\"M\")),u=this.getQuadPointsAnno(e,n),F=this.getAnnotString(n,\"Contents\")||\"\",m=this.resolveAnnotationColor(n);return{pageIndex:e.index,id:r,type:D.STRIKEOUT,rect:i,contents:F,segmentRects:u,...m,author:a,modified:s}}readPdfSquigglyAnno(e,t,n,r){const o=this.readPageAnnoRect(n),i=this.convertPageRectToDeviceRect(e,t,o),a=this.getAnnotString(n,\"T\"),s=T(this.getAnnotString(n,\"M\")),u=this.getQuadPointsAnno(e,n),F=this.getAnnotString(n,\"Contents\")||\"\",m=this.resolveAnnotationColor(n);return{pageIndex:e.index,id:r,type:D.SQUIGGLY,rect:i,contents:F,segmentRects:u,...m,author:a,modified:s}}readPdfCaretAnno(e,t,n,r){const o=this.readPageAnnoRect(n),i=this.convertPageRectToDeviceRect(e,t,o),a=this.getAnnotString(n,\"T\"),s=T(this.getAnnotString(n,\"M\"));return{pageIndex:e.index,id:r,type:D.CARET,rect:i,author:a,modified:s}}readPdfStampAnno(e,t,n,r,o){const i=this.readPageAnnoRect(r),a=this.convertPageRectToDeviceRect(t,n,i),s=this.getAnnotString(r,\"T\"),u=T(this.getAnnotString(r,\"M\")),F=[],m=this.pdfiumModule.FPDFAnnot_GetObjectCount(r);for(let e=0;e<m;e++){const t=this.pdfiumModule.FPDFAnnot_GetObject(r,e),n=this.readPdfPageObject(t);n&&F.push(n)}return{pageIndex:t.index,id:o,type:D.STAMP,rect:a,contents:F,author:s,modified:u}}readPdfPageObject(e){switch(this.pdfiumModule.FPDFPageObj_GetType(e)){case E.PATH:return this.readPathObject(e);case E.IMAGE:return this.readImageObject(e);case E.FORM:return this.readFormObject(e)}}readPathObject(e){const t=this.pdfiumModule.FPDFPath_CountSegments(e),n=this.malloc(4),r=this.malloc(4),o=this.malloc(4),i=this.malloc(4);this.pdfiumModule.FPDFPageObj_GetBounds(e,n,r,o,i);const a={left:this.pdfiumModule.pdfium.getValue(n,\"float\"),bottom:this.pdfiumModule.pdfium.getValue(r,\"float\"),right:this.pdfiumModule.pdfium.getValue(o,\"float\"),top:this.pdfiumModule.pdfium.getValue(i,\"float\")};this.free(n),this.free(r),this.free(o),this.free(i);const s=[];for(let n=0;n<t;n++){const t=this.readPdfSegment(e,n);s.push(t)}const u=this.readPdfPageObjectTransformMatrix(e);return{type:E.PATH,bounds:a,segments:s,matrix:u}}readPdfSegment(e,t){const n=this.pdfiumModule.FPDFPath_GetPathSegment(e,t),r=this.pdfiumModule.FPDFPathSegment_GetType(n),o=this.pdfiumModule.FPDFPathSegment_GetClose(n),i=this.malloc(4),a=this.malloc(4);this.pdfiumModule.FPDFPathSegment_GetPoint(n,i,a);const s=this.pdfiumModule.pdfium.getValue(i,\"float\"),u=this.pdfiumModule.pdfium.getValue(a,\"float\");return this.free(i),this.free(a),{type:r,point:{x:s,y:u},isClosed:o}}readImageObject(e){const t=this.pdfiumModule.FPDFImageObj_GetBitmap(e),n=this.pdfiumModule.FPDFBitmap_GetBuffer(t),r=this.pdfiumModule.FPDFBitmap_GetWidth(t),o=this.pdfiumModule.FPDFBitmap_GetHeight(t),i=this.pdfiumModule.FPDFBitmap_GetFormat(t),a=r*o,s=new Uint8ClampedArray(4*a);for(let e=0;e<a;e++)if(i===B.Bitmap_BGR){const t=this.pdfiumModule.pdfium.getValue(n+3*e,\"i8\"),r=this.pdfiumModule.pdfium.getValue(n+3*e+1,\"i8\"),o=this.pdfiumModule.pdfium.getValue(n+3*e+2,\"i8\");s[4*e]=o,s[4*e+1]=r,s[4*e+2]=t,s[4*e+3]=100}const u=new ImageData(s,r,o),F=this.readPdfPageObjectTransformMatrix(e);return{type:E.IMAGE,imageData:u,matrix:F}}readFormObject(e){const t=this.pdfiumModule.FPDFFormObj_CountObjects(e),n=[];for(let r=0;r<t;r++){const t=this.pdfiumModule.FPDFFormObj_GetObject(e,r),o=this.readPdfPageObject(t);o&&n.push(o)}const r=this.readPdfPageObjectTransformMatrix(e);return{type:E.FORM,objects:n,matrix:r}}readPdfPageObjectTransformMatrix(e){const t=this.malloc(24);if(this.pdfiumModule.FPDFPageObj_GetMatrix(e,t)){const e=this.pdfiumModule.pdfium.getValue(t,\"float\"),n=this.pdfiumModule.pdfium.getValue(t+4,\"float\"),r=this.pdfiumModule.pdfium.getValue(t+8,\"float\"),o=this.pdfiumModule.pdfium.getValue(t+12,\"float\"),i=this.pdfiumModule.pdfium.getValue(t+16,\"float\"),a=this.pdfiumModule.pdfium.getValue(t+20,\"float\");return this.free(t),{a:e,b:n,c:r,d:o,e:i,f:a}}return this.free(t),{a:1,b:0,c:0,d:1,e:0,f:0}}getStrokeWidth(e){const t=this.malloc(4),n=this.malloc(4),r=this.malloc(4),o=this.pdfiumModule.FPDFAnnot_GetBorder(e,t,n,r)?this.pdfiumModule.pdfium.getValue(r,\"float\"):1;return this.free(t),this.free(n),this.free(r),o}getAnnotationFlags(e){const t=this.pdfiumModule.FPDFAnnot_GetFlags(e);return n=t,Object.keys(G).filter((e=>!!(n&e))).map((e=>G[e]));var n}readPdfCircleAnno(e,t,n,r){const o=this.getAnnotationFlags(n),i=this.readPageAnnoRect(n),a=this.convertPageRectToDeviceRect(e,t,i),s=this.getAnnotString(n,\"T\"),u=T(this.getAnnotString(n,\"M\")),{color:F,opacity:m}=this.resolveAnnotationColor(n,f.InteriorColor),{color:l}=this.resolveAnnotationColor(n);let d,_,P,{style:c,width:g}=this.getBorderStyle(n);if(c===A.CLOUDY||c===A.UNKNOWN){const{ok:e,intensity:t}=this.getBorderEffect(n);if(e){d=t,c=A.CLOUDY;const{ok:e,left:r,top:o,right:i,bottom:a}=this.getRectangleDifferences(n);e&&(_=[r,o,i,a])}}if(c===A.DASHED){const{ok:e,pattern:t}=this.getBorderDashPattern(n);e&&(P=t)}return{pageIndex:e.index,id:r,type:D.CIRCLE,flags:o,color:F,opacity:m,strokeWidth:g,strokeColor:l,strokeStyle:c,rect:a,author:s,modified:u,...void 0!==d&&{cloudyBorderIntensity:d},...void 0!==_&&{cloudyBorderInset:_},...void 0!==P&&{strokeDashArray:P}}}readPdfSquareAnno(e,t,n,r){const o=this.getAnnotationFlags(n),i=this.readPageAnnoRect(n),a=this.convertPageRectToDeviceRect(e,t,i),s=this.getAnnotString(n,\"T\"),u=T(this.getAnnotString(n,\"M\")),{color:F,opacity:m}=this.resolveAnnotationColor(n,f.InteriorColor),{color:l}=this.resolveAnnotationColor(n);let d,_,P,{style:c,width:g}=this.getBorderStyle(n);if(c===A.CLOUDY||c===A.UNKNOWN){const{ok:e,intensity:t}=this.getBorderEffect(n);if(e){d=t,c=A.CLOUDY;const{ok:e,left:r,top:o,right:i,bottom:a}=this.getRectangleDifferences(n);e&&(_=[r,o,i,a])}}if(c===A.DASHED){const{ok:e,pattern:t}=this.getBorderDashPattern(n);e&&(P=t)}return{pageIndex:e.index,id:r,type:D.SQUARE,flags:o,color:F,opacity:m,strokeColor:l,strokeWidth:g,strokeStyle:c,rect:a,author:s,modified:u,...void 0!==d&&{cloudyBorderIntensity:d},...void 0!==_&&{cloudyBorderInset:_},...void 0!==P&&{strokeDashArray:P}}}readPdfAnno(e,t,n,r,o){const i=this.readPageAnnoRect(r),a=this.convertPageRectToDeviceRect(e,t,i),s=this.getAnnotString(r,\"T\"),u=T(this.getAnnotString(r,\"M\"));return{pageIndex:e.index,id:o,type:n,rect:a,author:s,modified:u}}getInReplyToId(e,t){const n=this.pdfiumModule.FPDFAnnot_GetLinkedAnnot(t,\"IRT\");if(!n)return;const r=this.pdfiumModule.FPDFPage_GetAnnotIndex(e,n);return r>=0?r:void 0}getAnnotString(e,t){const n=this.pdfiumModule.FPDFAnnot_GetStringValue(e,t,0,0);if(0===n)return;const r=2*(n+1),o=this.malloc(r);this.pdfiumModule.FPDFAnnot_GetStringValue(e,t,o,r);const i=this.pdfiumModule.pdfium.UTF16ToString(o);return this.free(o),i||void 0}setAnnotString(e,t,n){const r=2*(n.length+1),o=this.malloc(r);this.pdfiumModule.pdfium.stringToUTF16(n,o,r);const i=this.pdfiumModule.FPDFAnnot_SetStringValue(e,t,o);return this.free(o),i}readPdfAnnoVertices(e,t,n){const r=[],o=this.pdfiumModule.FPDFAnnot_GetVertices(n,0,0),i=this.malloc(8*o);this.pdfiumModule.FPDFAnnot_GetVertices(n,i,o);for(let t=0;t<o;t++){const n=this.pdfiumModule.pdfium.getValue(i+8*t,\"float\"),o=this.pdfiumModule.pdfium.getValue(i+8*t+4,\"float\"),{x:a,y:s}=this.convertPagePointToDevicePoint(e,{x:n,y:o});r.push({x:a,y:s})}return this.free(i),r}readPdfBookmarkTarget(e,t,n){const r=t();if(r){return{type:\"action\",action:this.readPdfAction(e,r)}}{const t=n();if(t){return{type:\"destination\",destination:this.readPdfDestination(e,t)}}}}readPdfWidgetAnnoField(e,t){const n=this.pdfiumModule.FPDFAnnot_GetFormFieldFlags(e,t),r=this.pdfiumModule.FPDFAnnot_GetFormFieldType(e,t),o=w(this.pdfiumModule.pdfium,((n,r)=>this.pdfiumModule.FPDFAnnot_GetFormFieldName(e,t,n,r)),this.pdfiumModule.pdfium.UTF16ToString),i=w(this.pdfiumModule.pdfium,((n,r)=>this.pdfiumModule.FPDFAnnot_GetFormFieldAlternateName(e,t,n,r)),this.pdfiumModule.pdfium.UTF16ToString),a=w(this.pdfiumModule.pdfium,((n,r)=>this.pdfiumModule.FPDFAnnot_GetFormFieldValue(e,t,n,r)),this.pdfiumModule.pdfium.UTF16ToString),s=[];if(r===p.COMBOBOX||r===p.LISTBOX){const n=this.pdfiumModule.FPDFAnnot_GetOptionCount(e,t);for(let r=0;r<n;r++){const n=w(this.pdfiumModule.pdfium,((n,o)=>this.pdfiumModule.FPDFAnnot_GetOptionLabel(e,t,r,n,o)),this.pdfiumModule.pdfium.UTF16ToString),o=this.pdfiumModule.FPDFAnnot_IsOptionSelected(e,t,r);s.push({label:n,isSelected:o})}}let u=!1;return r!==p.CHECKBOX&&r!==p.RADIOBUTTON||(u=this.pdfiumModule.FPDFAnnot_IsChecked(e,t)),{flag:n,type:r,name:o,alternateName:i,value:a,isChecked:u,options:s}}renderAnnotation(e,t,n,r,o,i=1,s=b.Normal,u=\"image/webp\"){this.logger.debug(U,V,\"renderAnnotation\",e,t,n,r,o,i,s,u),this.logger.perf(U,V,\"RenderAnnotation\",\"Begin\",`${e.id}-${t.index}-${n.id}`);const m=new _,l=this.cache.getContext(e.id);if(!l)return this.logger.perf(U,V,\"RenderAnnotation\",\"End\",`${e.id}-${t.index}-${n.id}`),y.reject({code:C.DocNotOpen,message:\"document does not open\"});const d=l.acquirePage(t.index),P=this.pdfiumModule.FPDFPage_GetAnnot(d.pagePtr,n.id);if(!P)return d.release(),this.logger.perf(U,V,\"RenderAnnotation\",\"End\",`${e.id}-${t.index}-${n.id}`),y.reject({code:C.NotFound,message:\"annotation not found\"});const c=r*i,g=n.rect,h=a(F(t.size,g,o,c)),D=B.Bitmap_BGRA,p=h.size.width*h.size.height*4,f=this.malloc(p),A=this.pdfiumModule.FPDFBitmap_CreateEx(h.size.width,h.size.height,D,f,4*h.size.width);this.pdfiumModule.FPDFBitmap_FillRect(A,0,0,h.size.width,h.size.height,0);const E=((e,t,n)=>{const{width:r,height:o}=e.size;switch(t){case 0:return{a:n,b:0,c:0,d:-n,e:0,f:o*n};case 1:return{a:0,b:n,c:n,d:0,e:0,f:0};case 2:return{a:-n,b:0,c:0,d:n,e:r*n,f:0};case 3:return{a:0,b:-n,c:-n,d:0,e:o*n,f:r*n}}})(n.rect,o,c),G=this.malloc(24);new Float32Array(this.pdfiumModule.pdfium.HEAPF32.buffer,G,6).set([E.a,E.b,E.c,E.d,E.e,E.f]);const S=N.REVERSE_BYTE_ORDER,T=!!this.pdfiumModule.EPDF_RenderAnnotBitmap(A,d.pagePtr,P,s,G,S);if(this.free(G),this.pdfiumModule.FPDFBitmap_Destroy(A),this.pdfiumModule.FPDFPage_CloseAnnot(P),d.release(),!T)return this.free(f),this.logger.perf(U,V,\"RenderAnnotation\",\"End\",`${e.id}-${t.index}-${n.id}`),y.reject({code:C.Unknown,message:\"EPDF_RenderAnnotBitmap failed\"});const M=this.pdfiumModule.pdfium.HEAPU8.subarray(f,f+p),O={data:new Uint8ClampedArray(M),width:h.size.width,height:h.size.height};return this.free(f),this.logger.perf(U,V,\"RenderAnnotation\",\"End\",`${e.id}-${t.index}-${n.id}`),this.imageDataConverter(O,u).then((e=>m.resolve(e))).catch((e=>m.reject({code:C.Unknown,message:String(e)}))),m}renderPageRectToImageData(e,t,n,r,o,u,m){const l=B.Bitmap_BGRA,d=a(F(t.size,n,o,r*u)),_=i(function(e,t,n){return{width:(e=t%2==0?e:s(e)).width*n,height:e.height*n}}(t.size,o,r*u)),P=d.size.width*d.size.height*4,c=this.malloc(P),g=this.pdfiumModule.FPDFBitmap_CreateEx(d.size.width,d.size.height,l,c,4*d.size.width);this.pdfiumModule.FPDFBitmap_FillRect(g,0,0,d.size.width,d.size.height,4294967295);let h=N.REVERSE_BYTE_ORDER;m?.withAnnotations&&(h|=N.ANNOT);const D=e.acquirePage(t.index);this.pdfiumModule.FPDF_RenderPageBitmap(g,D.pagePtr,-d.origin.x,-d.origin.y,_.width,_.height,o,h),this.pdfiumModule.FPDFBitmap_Destroy(g),D.release();const b=this.pdfiumModule.pdfium.HEAPU8.subarray(c,c+P),p={data:new Uint8ClampedArray(b),width:d.size.width,height:d.size.height};return this.free(c),p}readPdfLinkAnnoTarget(e,t,n){const r=n();if(r){return{type:\"destination\",destination:this.readPdfDestination(e,r)}}{const n=t();if(n){return{type:\"action\",action:this.readPdfAction(e,n)}}}}readPdfAction(e,t){let n;switch(this.pdfiumModule.FPDFAction_GetType(t)){case h.Unsupported:n={type:h.Unsupported};break;case h.Goto:{const r=this.pdfiumModule.FPDFAction_GetDest(e,t);if(r){const t=this.readPdfDestination(e,r);n={type:h.Goto,destination:t}}else n={type:h.Unsupported}}break;case h.RemoteGoto:n={type:h.Unsupported};break;case h.URI:{const r=w(this.pdfiumModule.pdfium,((n,r)=>this.pdfiumModule.FPDFAction_GetURIPath(e,t,n,r)),this.pdfiumModule.pdfium.UTF8ToString);n={type:h.URI,uri:r}}break;case h.LaunchAppOrOpenFile:{const e=w(this.pdfiumModule.pdfium,((e,n)=>this.pdfiumModule.FPDFAction_GetFilePath(t,e,n)),this.pdfiumModule.pdfium.UTF8ToString);n={type:h.LaunchAppOrOpenFile,path:e}}}return n}readPdfDestination(e,t){const n=this.pdfiumModule.FPDFDest_GetDestPageIndex(e,t),r=this.malloc(4),o=this.malloc(16),i=this.pdfiumModule.FPDFDest_GetView(t,r,o),a=this.pdfiumModule.pdfium.getValue(r,\"i32\"),s=[];for(let e=0;e<a;e++){const t=o+4*e;s.push(this.pdfiumModule.pdfium.getValue(t,\"float\"))}if(this.free(r),this.free(o),i===g.XYZ){const e=this.malloc(1),r=this.malloc(1),o=this.malloc(1),a=this.malloc(4),u=this.malloc(4),F=this.malloc(4);if(this.pdfiumModule.FPDFDest_GetLocationInPage(t,e,r,o,a,u,F)){const t=this.pdfiumModule.pdfium.getValue(e,\"i8\"),m=this.pdfiumModule.pdfium.getValue(r,\"i8\"),l=this.pdfiumModule.pdfium.getValue(o,\"i8\"),d=t?this.pdfiumModule.pdfium.getValue(a,\"float\"):0,_=m?this.pdfiumModule.pdfium.getValue(u,\"float\"):0,P=l?this.pdfiumModule.pdfium.getValue(F,\"float\"):0;return this.free(e),this.free(r),this.free(o),this.free(a),this.free(u),this.free(F),{pageIndex:n,zoom:{mode:i,params:{x:d,y:_,zoom:P}},view:s}}return this.free(e),this.free(r),this.free(o),this.free(a),this.free(u),this.free(F),{pageIndex:n,zoom:{mode:i,params:{x:0,y:0,zoom:0}},view:s}}return{pageIndex:n,zoom:{mode:i},view:s}}readPdfAttachment(e,t){const n=this.pdfiumModule.FPDFDoc_GetAttachment(e,t);return{index:t,name:w(this.pdfiumModule.pdfium,((e,t)=>this.pdfiumModule.FPDFAttachment_GetName(n,e,t)),this.pdfiumModule.pdfium.UTF16ToString),creationDate:w(this.pdfiumModule.pdfium,((e,t)=>this.pdfiumModule.FPDFAttachment_GetStringValue(n,\"CreationDate\",e,t)),this.pdfiumModule.pdfium.UTF16ToString),checksum:w(this.pdfiumModule.pdfium,((e,t)=>this.pdfiumModule.FPDFAttachment_GetStringValue(n,\"Checksum\",e,t)),this.pdfiumModule.pdfium.UTF16ToString)}}convertDevicePointToPagePoint(e,t){return{x:t.x,y:e.size.height-t.y}}convertPagePointToDevicePoint(e,t){return{x:t.x,y:e.size.height-t.y}}convertPageRectToDeviceRect(e,t,n){const{x:r,y:o}=this.convertPagePointToDevicePoint(e,{x:n.left,y:n.top});return{origin:{x:r,y:o},size:{width:Math.abs(n.right-n.left),height:Math.abs(n.top-n.bottom)}}}readPageAnnoAppearanceStreams(e){return{normal:this.readPageAnnoAppearanceStream(e,b.Normal),rollover:this.readPageAnnoAppearanceStream(e,b.Rollover),down:this.readPageAnnoAppearanceStream(e,b.Down)}}readPageAnnoAppearanceStream(e,t=b.Normal){const n=2*(this.pdfiumModule.FPDFAnnot_GetAP(e,t,0,0)+1),r=this.malloc(n);this.pdfiumModule.FPDFAnnot_GetAP(e,t,r,n);const o=this.pdfiumModule.pdfium.UTF16ToString(r);return this.free(r),o}updateAnnotationColor(e,t,n,r,o=0){this.logger.debug(U,V,\"setAnnotationColor\",e,t,n,r,o),this.logger.perf(U,V,\"setAnnotationColor\",\"Begin\",e.id);const i=y.create();try{const a=this.cache.getContext(e.id);if(!a)return this.logger.perf(U,V,\"setAnnotationColor\",\"End\",e.id),this.logger.warn(U,V,\"setAnnotationColor: doc closed\"),i.resolve(!1),i;const s=a.acquirePage(t.index),u=this.pdfiumModule.FPDFPage_GetAnnot(s.pagePtr,n.id);if(!u)return this.logger.perf(U,V,\"setAnnotationColor\",\"End\",e.id),this.logger.warn(U,V,\"setAnnotationColor: annot not found\"),s.release(),i.resolve(!1),i;const F=this.setAnnotationColor(u,r,o);F&&this.pdfiumModule.FPDFPage_GenerateContent(s.pagePtr),this.pdfiumModule.FPDFPage_CloseAnnot(u),s.release(),this.logger.perf(U,V,\"setAnnotationColor\",\"End\",e.id),i.resolve(!!F)}catch(t){this.logger.perf(U,V,\"setAnnotationColor\",\"End\",e.id),this.logger.error(U,V,\"setAnnotationColor: error\",t),i.reject({code:C.Unknown,message:`Failed to set annotation color: ${t instanceof Error?t.message:String(t)}`})}return i}setPageAnnoRect(e,t,n,r){const o=this.malloc(8),i=this.malloc(8);if(!this.pdfiumModule.FPDF_DeviceToPage(t,0,0,e.size.width,e.size.height,0,r.origin.x,r.origin.y,o,i))return this.free(o),this.free(i),!1;const a=this.pdfiumModule.pdfium.getValue(o,\"double\"),s=this.pdfiumModule.pdfium.getValue(i,\"double\");this.free(o),this.free(i);const u=this.malloc(16);return this.pdfiumModule.pdfium.setValue(u,a,\"float\"),this.pdfiumModule.pdfium.setValue(u+4,s,\"float\"),this.pdfiumModule.pdfium.setValue(u+8,a+r.size.width,\"float\"),this.pdfiumModule.pdfium.setValue(u+12,s-r.size.height,\"float\"),this.pdfiumModule.FPDFAnnot_SetRect(n,u)?(this.free(u),!0):(this.free(u),!1)}readPageAnnoRect(e){const t=this.malloc(16),n={left:0,top:0,right:0,bottom:0};return this.pdfiumModule.FPDFAnnot_GetRect(e,t)&&(n.left=this.pdfiumModule.pdfium.getValue(t,\"float\"),n.top=this.pdfiumModule.pdfium.getValue(t+4,\"float\"),n.right=this.pdfiumModule.pdfium.getValue(t+8,\"float\"),n.bottom=this.pdfiumModule.pdfium.getValue(t+12,\"float\")),this.free(t),n}getHighlightRects(e,t,n,r,o){const i=this.pdfiumModule.FPDFText_CountRects(n,r,o),a=[];for(let r=0;r<i;r++){const o=this.malloc(8),i=this.malloc(8),s=this.malloc(8),u=this.malloc(8);if(!this.pdfiumModule.FPDFText_GetRect(n,r,i,o,s,u)){this.free(i),this.free(o),this.free(s),this.free(u);continue}const F=this.pdfiumModule.pdfium.getValue(i,\"double\"),m=this.pdfiumModule.pdfium.getValue(o,\"double\"),l=this.pdfiumModule.pdfium.getValue(s,\"double\"),d=this.pdfiumModule.pdfium.getValue(u,\"double\");this.free(i),this.free(o),this.free(s),this.free(u);const _=this.malloc(4),P=this.malloc(4);this.pdfiumModule.FPDF_PageToDevice(t,0,0,e.size.width,e.size.height,0,F,m,_,P);const c=this.pdfiumModule.pdfium.getValue(_,\"i32\"),g=this.pdfiumModule.pdfium.getValue(P,\"i32\");this.free(_),this.free(P);const h=Math.ceil(Math.abs(l-F)),D=Math.ceil(Math.abs(m-d));a.push({origin:{x:c,y:g},size:{width:h,height:D}})}return a}searchAllPages(e,t,n=[]){this.logger.debug(U,V,\"searchAllPages\",e,t,n),this.logger.perf(U,V,\"SearchAllPages\",\"Begin\",e.id);const r=this.cache.getContext(e.id);if(!r)return this.logger.perf(U,V,\"SearchAllPages\",\"End\",e.id),y.resolve({results:[],total:0});const o=2*(t.length+1),i=this.malloc(o);this.pdfiumModule.pdfium.stringToUTF16(t,i,o);const a=n.reduce(((e,t)=>e|t),S.None),s=[],u=y.create();return(async()=>{for(let t=0;t<e.pageCount;t++){const n=this.searchAllInPage(r,e.pages[t],i,a);s.push(...n)}this.free(i),this.logger.perf(U,V,\"SearchAllPages\",\"End\",e.id),u.resolve({results:s,total:s.length})})().catch((t=>{this.free(i),this.logger.perf(U,V,\"SearchAllPages\",\"End\",e.id),u.reject({code:C.Unknown,message:`Error searching document: ${t}`})})),u}buildContext(e,t,n,r=30){const o=/[\\s\\u00A0.,;:!?()\\[\\]{}<>/\\\\\\-\"'`\"”\\u2013\\u2014]/;let i=t;for(;i>0&&o.test(e[i-1]);)i--;let a=0;for(;i>0&&a<r;)i--,o.test(e[i])||a++;i=(t=>{for(;t>0&&!o.test(e[t-1]);)t--;return t})(i);let s=t+n;for(;s<e.length&&o.test(e[s]);)s++;for(a=0;s<e.length&&a<r;)o.test(e[s])||a++,s++;s=(t=>{for(;t<e.length&&!o.test(e[t]);)t++;return t})(s);const u=e.slice(i,t).replace(/\\s+/g,\" \").trimStart(),F=e.slice(t,t+n),m=e.slice(t+n,s).replace(/\\s+/g,\" \").trimEnd();return{before:this.tidy(u),match:this.tidy(F),after:this.tidy(m),truncatedLeft:i>0,truncatedRight:s<e.length}}tidy(e){return e.replace(/-\\uFFFE\\s*/g,\"\").replace(/[\\uFFFE\\u00AD\\u200B\\u2060\\uFEFF]/g,\"\").replace(/\\s+/g,\" \")}searchAllInPage(e,t,n,r){const o=t.index,i=e.acquirePage(o),a=i.getTextPage(),s=this.pdfiumModule.FPDFText_CountChars(a),u=this.malloc(2*(s+1));this.pdfiumModule.FPDFText_GetText(a,0,s,u);const F=this.pdfiumModule.pdfium.UTF16ToString(u);this.free(u);const m=[],l=this.pdfiumModule.FPDFText_FindStart(a,n,r,0);for(;this.pdfiumModule.FPDFText_FindNext(l);){const e=this.pdfiumModule.FPDFText_GetSchResultIndex(l),n=this.pdfiumModule.FPDFText_GetSchCount(l),r=this.getHighlightRects(t,i.pagePtr,a,e,n),s=this.buildContext(F,e,n);m.push({pageIndex:o,charIndex:e,charCount:n,rects:r,context:s})}return this.pdfiumModule.FPDFText_FindClose(l),i.release(),m}}class $ extends x{constructor(e){super(),this.wasmBinary=e}async prepare(){const e=this.wasmBinary,t=await r({wasmBinary:e});this.engine=new H(t),this.ready()}}let X=null;self.onmessage=async e=>{const{type:t,wasmUrl:n}=e.data;if(\"wasmInit\"===t&&n&&!X)try{const e=await fetch(n),t=await e.arrayBuffer();X=new $(t),await X.prepare()}catch(e){const t=e instanceof Error?e.message:String(e);self.postMessage({type:\"wasmError\",error:t})}};\n"], { type: 'application/javascript' })), {
813
843
  type: 'module',
814
844
  });
815
845
  // Send initialization message with WASM URL