/*!
 * Nutrient Web SDK 1.10.0 (https://www.nutrient.io/sdk/web)
 *
 * Copyright (c) 2016-2025 PSPDFKit GmbH. All rights reserved.
 *
 * THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
 * AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE PSPDFKIT LICENSE AGREEMENT.
 * UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
 * This notice may not be removed from this file.
 *
 * PSPDFKit uses several open source third-party components: https://www.nutrient.io/legal/acknowledgements/web-acknowledgements/
 */
"use strict";(globalThis.webpackChunkNutrientViewer=globalThis.webpackChunkNutrientViewer||[]).push([[11],{37979:(t,e,n)=>{n.d(e,{default:()=>a});var o=n(55512),r=n.n(o);function a(){return r()('/*!\n * Nutrient Web SDK 1.10.0 (https://www.nutrient.io/sdk/web)\n *\n * Copyright (c) 2016-2025 PSPDFKit GmbH. All rights reserved.\n *\n * THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW\n * AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE PSPDFKIT LICENSE AGREEMENT.\n * UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.\n * This notice may not be removed from this file.\n *\n * PSPDFKit uses several open source third-party components: https://www.nutrient.io/legal/acknowledgements/web-acknowledgements/\n */(()=>{"use strict";const t=function t(e){let n;return n=e instanceof Error?e:new Error(e),Object.setPrototypeOf(n,t.prototype),n};t.prototype=Object.create(Error.prototype,{name:{value:"PSPDFKitError",enumerable:!1}});const e=t;function n(t,n){if(!t)throw new e(`Assertion failed: ${n||"Condition not met"}\\n\\nFor further assistance, please go to: https://www.nutrient.io/support/request`)}["a[href]","area[href]","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])","iframe","object","embed","[contenteditable]",\'[tabindex]:not([tabindex^="-"])\'].join(",");new WeakMap;async function o(t){const n=(await async function(t){try{const n=await fetch(t).catch((n=>{throw new e(`Error fetching dynamic fonts file ${t}. ${n}`)}));if(200!==n.status)throw new e(`Error fetching dynamic fonts file ${t}. Status code: ${n.status}`);return n}catch(t){throw t}}(t)).json().catch((n=>{throw new e(`Error parsing dynamic fonts file ${t}. ${n}`)}));return n}let r=function(t){return t[t.pdf_a_1a=0]="pdf_a_1a",t[t.pdf_a_1b=1]="pdf_a_1b",t[t.pdf_a_2a=2]="pdf_a_2a",t[t.pdf_a_2u=3]="pdf_a_2u",t[t.pdf_a_2b=4]="pdf_a_2b",t[t.pdf_a_3a=5]="pdf_a_3a",t[t.pdf_a_3u=6]="pdf_a_3u",t[t.pdf_a_3b=7]="pdf_a_3b",t[t.pdf_a_4=8]="pdf_a_4",t[t.pdf_a_4e=9]="pdf_a_4e",t[t.pdf_a_4f=10]="pdf_a_4f",t}({});const a="/create.pdf",i="/save.pdf",s="/create.docx",c="/save.docx",l="/templateData.json",d="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope;let f=null,u=null;function p(t){let e;n(u,"GdPicture WebAssembly is not loaded.");for(var o=arguments.length,r=new Array(o>1?o-1:0),a=1;a<o;a++)r[a-1]=arguments[a];for(const t of r)e=Object.assign(r[0],t);const i=JSON.stringify({type:t,...e}),s=JSON.parse(u.CommandHandler(i));if(!s.success)throw new Error(s.errorReason+": "+s.errorMessage+"\\n"+s.error);return s}const m={allMarkup:0,simpleMarkup:1,noMarkup:2,original:3},y=m.noMarkup,_={documentMarkupMode:y};function w(t){if(!t)return _;if(!t.documentMarkupMode)return{...t,documentMarkupMode:y};if(!(t.documentMarkupMode in m))throw new Error(`Invalid documentMarkupMode value: ${t.documentMarkupMode}. Allowed values are: ${Object.keys(m).join(", ")}`);return{...t,documentMarkupMode:m[t.documentMarkupMode]}}const g={"application/msword":"doc","application/vnd.openxmlformats-officedocument.wordprocessingml.document":"docx","application/vnd.ms-excel":"xls","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":"xlsx","application/vnd.ms-powerpoint":"ppt","application/vnd.openxmlformats-officedocument.presentationml.presentation":"pptx","text/plain":"txt"},b=new class{_mountCustomFonts(t,e){n(f,"WebAssembly module not loaded."),f.FS.mkdir(e);{const n=d?f.FS.filesystems.WORKERFS:f.FS.filesystems.MEMFS;f.FS.mount(n,{blobs:t},e)}}async loadModule(t,e,n,r,a,i,s){const{Assemblies:c,Module:l}=await async function(t,e){if("string"==typeof t){const n="nutrient-viewer-lib/",o=`${n}gdpicture-174da64a/jit`,r=`${n}gdpicture-174da64a/aot`;let a,i;e?(a=`${t}${r}/initDotnet.js`,i=`${t}${r}`):(a=`${t}${o}/initDotnet.js`,i=`${t}${o}`);const{initDotnet:s}=await import(a);return s(i,((t,e,n,o,r)=>"blazor.boot.json"===e?fetch(n,{credentials:"same-origin"}):null))}throw new Error("GdPicture WASM loader not implemented")}(t,e);u=c.GdPictureWasm.API,f=l,p("gdpicture/setLicense",{origin:n},{licenseKey:r||"DEMO_PSPDFKIT_WEB"});const d=a?"/fonts":"";if(a&&!f.FS.analyzePath(d).exists&&(this._mountCustomFonts(a,d),p("gdpicture/setFonts",{fontPaths:[d]})),i){const t=await o(i);p("gdpicture/setDynamicFontLoading",{baseUrl:i.split("/").slice(0,-1).join("/"),allowedFonts:t.availableFonts,v:1})}s&&p("gdpicture/setFontSubstitutions",{fontSubstitutions:s})}toPdf(t,e,n,o,s){let c=a;if(s&&"pdf"!==s)c+=`.${s}`;else if(o&&"application/pdf"!==o){const t=o.toLowerCase(),e=g.hasOwnProperty(t)&&g[t];e&&(c+=`.${e}`)}f.FS.writeFile(c,new Uint8Array(t));const l={file:i,format:"pdf",conformance:e&&e in r?e:void 0,officeConversionSettings:w(n)};try{return p("gdpicture/process",{input:{file:c},output:l}),f.FS.readFile(i).buffer}finally{try{f.FS.unlink(i),f.FS.unlink(c)}catch(t){}}}toOffice(t,e){f.FS.writeFile(a,new Uint8Array(t));const n=`/save.${e}`;try{return p("gdpicture/process",{input:{file:a},output:{file:n,format:e}}),f.FS.readFile(n).buffer}finally{try{f.FS.unlink(n),f.FS.unlink(a)}catch(t){console.log(t.message)}}}async populateDocumentTemplate(t,e){let n;f.FS.writeFile(s,new Uint8Array(t));try{n=JSON.stringify(e,null,2)}catch(t){throw new Error("Invalid config data")}f.FS.writeFile(l,n);try{return p("gdpicture/process-office-template",{inputFile:s,modelAndConfigFile:l,outputFile:c}),f.FS.readFile(c).buffer}finally{try{f.FS.unlink(c),f.FS.unlink(l),f.FS.unlink(s)}catch(t){console.log(t.message)}}}},F=self;F.global=F,F.module={},F.onmessage=async t=>{let e,n,{data:o}=t;try{const t=await b[o.action](...o.args);if(e={id:o.id,result:t},Array.isArray(t)){const e=t.filter((t=>t instanceof ArrayBuffer));e.length>0&&(n=e)}t instanceof ArrayBuffer&&(n=[t])}catch(t){const r=[...o.args].filter((t=>t instanceof ArrayBuffer));r.length>0&&(n=r),e={id:o.id,error:t.message||t.toString(),callArgs:o.args}}F.postMessage(e,n)}})();',"Worker",void 0,void 0)}},55512:t=>{t.exports=function(t,e,n,o){var r=self||window;try{try{var a;try{a=new r.Blob([t])}catch(e){(a=new(r.BlobBuilder||r.WebKitBlobBuilder||r.MozBlobBuilder||r.MSBlobBuilder)).append(t),a=a.getBlob()}var i=r.URL||r.webkitURL,s=i.createObjectURL(a),c=new r[e](s,n);return i.revokeObjectURL(s),c}catch(o){return new r[e]("data:application/javascript,".concat(encodeURIComponent(t)),n)}}catch(t){if(!o)throw Error("Inline worker is not supported");return new r[e](o,n)}}}}]);