diff --git a/README.md b/README.md
index 6b1851e..677d0f5 100644
--- a/README.md
+++ b/README.md
@@ -30,6 +30,9 @@ There were a number of improvements I wanted to make. This was initially done fo
### Copy Any Message
- A copy button is now present on any message, allowing the user to copy it to their clipboard.
+### PDF Upload Queries
+- When using a GPT model, the user can upload a PDF, which is parsed for text entirely browser-side. Then the user may ask the AI questions about the contents of the PDF.
+
### Mid-conversation Editing
- Just like on the official UI, the user may edit any message. This branches the conversation at that point.
diff --git a/dist/assets/__vite-browser-external-b25bb000.js b/dist/assets/__vite-browser-external-b25bb000.js
new file mode 100644
index 0000000..b480ffe
--- /dev/null
+++ b/dist/assets/__vite-browser-external-b25bb000.js
@@ -0,0 +1 @@
+const e={};export{e as default};
diff --git a/dist/assets/index-0a8895ee.js b/dist/assets/index-0a8895ee.js
deleted file mode 100644
index 0743dd3..0000000
--- a/dist/assets/index-0a8895ee.js
+++ /dev/null
@@ -1,67 +0,0 @@
-(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const n of document.querySelectorAll('link[rel="modulepreload"]'))r(n);new MutationObserver(n=>{for(const i of n)if(i.type==="childList")for(const l of i.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&r(l)}).observe(document,{childList:!0,subtree:!0});function t(n){const i={};return n.integrity&&(i.integrity=n.integrity),n.referrerPolicy&&(i.referrerPolicy=n.referrerPolicy),n.crossOrigin==="use-credentials"?i.credentials="include":n.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(n){if(n.ep)return;n.ep=!0;const i=t(n);fetch(n.href,i)}})();function B(){}function et(s,e){for(const t in e)s[t]=e[t];return s}function Qs(s){return s()}function Tr(){return Object.create(null)}function De(s){s.forEach(Qs)}function Ys(s){return typeof s=="function"}function K(s,e){return s!=s?e==e:s!==e||s&&typeof s=="object"||typeof s=="function"}let Nt;function Pe(s,e){return Nt||(Nt=document.createElement("a")),Nt.href=e,s===Nt.href}function xi(s){return Object.keys(s).length===0}function Ks(s,...e){if(s==null)return B;const t=s.subscribe(...e);return t.unsubscribe?()=>t.unsubscribe():t}function V(s){let e;return Ks(s,t=>e=t)(),e}function _e(s,e,t){s.$$.on_destroy.push(Ks(e,t))}function de(s,e,t,r){if(s){const n=Zs(s,e,t,r);return s[0](n)}}function Zs(s,e,t,r){return s[1]&&r?et(t.ctx.slice(),s[1](r(e))):t.ctx}function he(s,e,t,r){if(s[2]&&r){const n=s[2](r(t));if(e.dirty===void 0)return n;if(typeof n=="object"){const i=[],l=Math.max(e.dirty.length,n.length);for(let a=0;a
OpenAI offers ChatGPT Plus for a monthly subscription, which allows you to use their UI to converse with ChatGPT. However, this comes with usage limits, and the $20/mo fee is expensive. Alternatively, you can use the OpenAI API, which is much more affordable with a pay-as-you-go rate. But, the API is not end-user friendly! It's designed for developers who can build apps around it.
-That's where SmoothGPT comes in! SmoothGPT provides a UI that is extremely similar to the ChatGPT official site.
- -Note on data storage: If you browse away while a response is streaming in, you will miss that data. If you refresh your page, TTS MP3 files are lost, but conversations are maintained. If you wipe your browser cache, ALL content is lost. You can download your session locally and restore it anytime.
`,f=C(),d=b("button"),d.textContent="Got it!",p(i,"class","icon-white w-8"),p(i,"alt","Close"),Pe(i.src,l=ln)||p(i,"src",l),p(n,"class","absolute top-0 right-0 mt-2 mr-2 text-gray-500 hover:text-gray-600"),p(o,"class","text-xl font-bold mb-4"),p(u,"class","text-left"),p(d,"class","bg-good hover:bg-good2 transition-colors duration-200 text-white py-2 px-4 mt-4 rounded"),p(r,"class","bg-primary text-white rounded-lg shadow-xl p-8 relative max-w-lg mx-4"),p(t,"class","flex items-center justify-center min-h-screen"),p(e,"class","fixed z-50 inset-0 overflow-y-auto animate-fade-in")},m(g,y){S(g,e,y),_(e,t),_(t,r),_(r,n),_(n,i),_(r,a),_(r,o),_(r,c),_(r,u),_(r,f),_(r,d),h||(m=[N(n,"click",s[0]),N(d,"click",s[0])],h=!0)},p:B,i:B,o:B,d(g){g&&O(e),h=!1,De(m)}}}function ua(s){function e(){tn.set(!1)}return[e]}class fa extends W{constructor(e){super(),Z(this,e,ua,ca,K,{})}}function da(){const s=console.warn;console.warn=e=>{e.includes("unknown prop")||e.includes("unexpected slot")||s(e)},an(()=>{console.warn=s})}function ws(s,e,t){const r=s.slice();return r[18]=e[t],r}function ys(s,e,t){const r=s.slice();return r[18]=e[t],r}function ks(s,e,t){const r=s.slice();return r[10]=e[t],r}function Os(s,e,t){const r=s.slice();return r[13]=e[t],r[15]=t,r}function Ss(s,e,t){const r=s.slice();return r[16]=e[t],r[15]=t,r}function As(s,e,t){const r=s.slice();return r[7]=e[t],r}function ha(s){let e,t,r,n;const i=[_a,ga,ma],l=[];function a(o,c){return o[0]==="table"?0:o[0]==="list"?1:2}return e=a(s),t=l[e]=i[e](s),{c(){t.c(),r=ye()},m(o,c){l[e].m(o,c),S(o,r,c),n=!0},p(o,c){let u=e;e=a(o),e===u?l[e].p(o,c):(se(),$(l[u],1,1,()=>{l[u]=null}),ie(),t=l[e],t?t.p(o,c):(t=l[e]=i[e](o),t.c()),v(t,1),t.m(r.parentNode,r))},i(o){n||(v(t),n=!0)},o(o){$(t),n=!1},d(o){l[e].d(o),o&&O(r)}}}function pa(s){let e,t,r=s[1],n=[];for(let l=0;l'+(r?e:Re(e,!0))+`
-`:""+(r?e:Re(e,!0))+`
-`}blockquote(e){return`-${e}-`}html(e){return e}heading(e,t,r,n){if(this.options.headerIds){const i=this.options.headerPrefix+n.slug(r);return`
${e}
-`}table(e,t){return t&&(t=`${t}`),`${e}
`}br(){return this.options.xhtml?"An error occurred:
"+Re(n.message+"",!0)+"";throw n}try{const n=Ke.lex(s,e);if(e.walkTokens){if(e.async)return Promise.all(L.walkTokens(n,e.walkTokens)).then(()=>Ye.parse(n,e)).catch(r);L.walkTokens(n,e.walkTokens)}return Ye.parse(n,e)}catch(n){r(n)}}L.options=L.setOptions=function(s){return Je(L.defaults,s),Fa(L.defaults),L};L.getDefaults=Si;L.defaults=Pt;L.use=function(...s){const e=L.defaults.extensions||{renderers:{},childTokens:{}};s.forEach(t=>{const r=Je({},t);if(r.async=L.defaults.async||r.async,t.extensions&&(t.extensions.forEach(n=>{if(!n.name)throw new Error("extension name required");if(n.renderer){const i=e.renderers[n.name];i?e.renderers[n.name]=function(...l){let a=n.renderer.apply(this,l);return a===!1&&(a=i.apply(this,l)),a}:e.renderers[n.name]=n.renderer}if(n.tokenizer){if(!n.level||n.level!=="block"&&n.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");e[n.level]?e[n.level].unshift(n.tokenizer):e[n.level]=[n.tokenizer],n.start&&(n.level==="block"?e.startBlock?e.startBlock.push(n.start):e.startBlock=[n.start]:n.level==="inline"&&(e.startInline?e.startInline.push(n.start):e.startInline=[n.start]))}n.childTokens&&(e.childTokens[n.name]=n.childTokens)}),r.extensions=e),t.renderer){const n=L.defaults.renderer||new hr;for(const i in t.renderer){const l=n[i];n[i]=(...a)=>{let o=t.renderer[i].apply(n,a);return o===!1&&(o=l.apply(n,a)),o}}r.renderer=n}if(t.tokenizer){const n=L.defaults.tokenizer||new dr;for(const i in t.tokenizer){const l=n[i];n[i]=(...a)=>{let o=t.tokenizer[i].apply(n,a);return o===!1&&(o=l.apply(n,a)),o}}r.tokenizer=n}if(t.walkTokens){const n=L.defaults.walkTokens;r.walkTokens=function(i){let l=[];return l.push(t.walkTokens.call(this,i)),n&&(l=l.concat(n.call(this,i))),l}}L.setOptions(r)})};L.walkTokens=function(s,e){let t=[];for(const r of s)switch(t=t.concat(e.call(L,r)),r.type){case"table":{for(const n of r.header)t=t.concat(L.walkTokens(n.tokens,e));for(const n of r.rows)for(const i of n)t=t.concat(L.walkTokens(i.tokens,e));break}case"list":{t=t.concat(L.walkTokens(r.items,e));break}default:L.defaults.extensions&&L.defaults.extensions.childTokens&&L.defaults.extensions.childTokens[r.type]?L.defaults.extensions.childTokens[r.type].forEach(function(n){t=t.concat(L.walkTokens(r[n],e))}):r.tokens&&(t=t.concat(L.walkTokens(r.tokens,e)))}return t};L.parseInline=function(s,e){if(typeof s>"u"||s===null)throw new Error("marked.parseInline(): input parameter is undefined or null");if(typeof s!="string")throw new Error("marked.parseInline(): input parameter is of type "+Object.prototype.toString.call(s)+", string expected");e=Je({},L.defaults,e||{}),Ti(e);try{const t=Ke.lexInline(s,e);return e.walkTokens&&L.walkTokens(t,e.walkTokens),Ye.parseInline(t,e)}catch(t){if(t.message+=` -Please report this to https://github.com/markedjs/marked.`,e.silent)return"
An error occurred:
"+Re(t.message+"",!0)+"";throw t}};L.Parser=Ye;L.parser=Ye.parse;L.Renderer=hr;L.TextRenderer=Pi;L.Lexer=Ke;L.lexer=Ke.lex;L.Tokenizer=dr;L.Slugger=pr;L.parse=L;L.options;L.setOptions;L.use;L.walkTokens;L.parseInline;Ye.parse;Ke.lex;const Ci={};function Za(s){let e;return{c(){e=ce(s[1])},m(t,r){S(t,e,r)},p(t,r){r&2&&Te(e,t[1])},i:B,o:B,d(t){t&&O(e)}}}function Wa(s){let e,t;const r=s[5].default,n=de(r,s,s[4],null);return{c(){e=b("h6"),n&&n.c(),p(e,"id",s[2])},m(i,l){S(i,e,l),n&&n.m(e,null),t=!0},p(i,l){n&&n.p&&(!t||l&16)&&pe(n,r,i,i[4],t?he(r,i[4],l,null):me(i[4]),null),(!t||l&4)&&p(e,"id",i[2])},i(i){t||(v(n,i),t=!0)},o(i){$(n,i),t=!1},d(i){i&&O(e),n&&n.d(i)}}}function Xa(s){let e,t;const r=s[5].default,n=de(r,s,s[4],null);return{c(){e=b("h5"),n&&n.c(),p(e,"id",s[2])},m(i,l){S(i,e,l),n&&n.m(e,null),t=!0},p(i,l){n&&n.p&&(!t||l&16)&&pe(n,r,i,i[4],t?he(r,i[4],l,null):me(i[4]),null),(!t||l&4)&&p(e,"id",i[2])},i(i){t||(v(n,i),t=!0)},o(i){$(n,i),t=!1},d(i){i&&O(e),n&&n.d(i)}}}function ec(s){let e,t;const r=s[5].default,n=de(r,s,s[4],null);return{c(){e=b("h4"),n&&n.c(),p(e,"id",s[2])},m(i,l){S(i,e,l),n&&n.m(e,null),t=!0},p(i,l){n&&n.p&&(!t||l&16)&&pe(n,r,i,i[4],t?he(r,i[4],l,null):me(i[4]),null),(!t||l&4)&&p(e,"id",i[2])},i(i){t||(v(n,i),t=!0)},o(i){$(n,i),t=!1},d(i){i&&O(e),n&&n.d(i)}}}function tc(s){let e,t;const r=s[5].default,n=de(r,s,s[4],null);return{c(){e=b("h3"),n&&n.c(),p(e,"id",s[2])},m(i,l){S(i,e,l),n&&n.m(e,null),t=!0},p(i,l){n&&n.p&&(!t||l&16)&&pe(n,r,i,i[4],t?he(r,i[4],l,null):me(i[4]),null),(!t||l&4)&&p(e,"id",i[2])},i(i){t||(v(n,i),t=!0)},o(i){$(n,i),t=!1},d(i){i&&O(e),n&&n.d(i)}}}function nc(s){let e,t;const r=s[5].default,n=de(r,s,s[4],null);return{c(){e=b("h2"),n&&n.c(),p(e,"id",s[2])},m(i,l){S(i,e,l),n&&n.m(e,null),t=!0},p(i,l){n&&n.p&&(!t||l&16)&&pe(n,r,i,i[4],t?he(r,i[4],l,null):me(i[4]),null),(!t||l&4)&&p(e,"id",i[2])},i(i){t||(v(n,i),t=!0)},o(i){$(n,i),t=!1},d(i){i&&O(e),n&&n.d(i)}}}function rc(s){let e,t;const r=s[5].default,n=de(r,s,s[4],null);return{c(){e=b("h1"),n&&n.c(),p(e,"id",s[2])},m(i,l){S(i,e,l),n&&n.m(e,null),t=!0},p(i,l){n&&n.p&&(!t||l&16)&&pe(n,r,i,i[4],t?he(r,i[4],l,null):me(i[4]),null),(!t||l&4)&&p(e,"id",i[2])},i(i){t||(v(n,i),t=!0)},o(i){$(n,i),t=!1},d(i){i&&O(e),n&&n.d(i)}}}function sc(s){let e,t,r,n;const i=[rc,nc,tc,ec,Xa,Wa,Za],l=[];function a(o,c){return o[0]===1?0:o[0]===2?1:o[0]===3?2:o[0]===4?3:o[0]===5?4:o[0]===6?5:6}return e=a(s),t=l[e]=i[e](s),{c(){t.c(),r=ye()},m(o,c){l[e].m(o,c),S(o,r,c),n=!0},p(o,[c]){let u=e;e=a(o),e===u?l[e].p(o,c):(se(),$(l[u],1,1,()=>{l[u]=null}),ie(),t=l[e],t?t.p(o,c):(t=l[e]=i[e](o),t.c()),v(t,1),t.m(r.parentNode,r))},i(o){n||(v(t),n=!0)},o(o){$(t),n=!1},d(o){l[e].d(o),o&&O(r)}}}function ic(s,e,t){let r,{$$slots:n={},$$scope:i}=e,{depth:l}=e,{raw:a}=e,{text:o}=e;const{slug:c,getOptions:u}=Di(Ci),f=u();return s.$$set=d=>{"depth"in d&&t(0,l=d.depth),"raw"in d&&t(1,a=d.raw),"text"in d&&t(3,o=d.text),"$$scope"in d&&t(4,i=d.$$scope)},s.$$.update=()=>{s.$$.dirty&8&&t(2,r=f.headerIds?f.headerPrefix+c(o):void 0)},[l,a,r,o,i,n]}class lc extends W{constructor(e){super(),Z(this,e,ic,sc,K,{depth:0,raw:1,text:3})}}function oc(s){let e,t;const r=s[1].default,n=de(r,s,s[0],null);return{c(){e=b("p"),n&&n.c()},m(i,l){S(i,e,l),n&&n.m(e,null),t=!0},p(i,[l]){n&&n.p&&(!t||l&1)&&pe(n,r,i,i[0],t?he(r,i[0],l,null):me(i[0]),null)},i(i){t||(v(n,i),t=!0)},o(i){$(n,i),t=!1},d(i){i&&O(e),n&&n.d(i)}}}function ac(s,e,t){let{$$slots:r={},$$scope:n}=e;return s.$$set=i=>{"$$scope"in i&&t(0,n=i.$$scope)},[n,r]}let cc=class extends W{constructor(e){super(),Z(this,e,ac,oc,K,{})}};function uc(s){let e;const t=s[3].default,r=de(t,s,s[2],null);return{c(){r&&r.c()},m(n,i){r&&r.m(n,i),e=!0},p(n,[i]){r&&r.p&&(!e||i&4)&&pe(r,t,n,n[2],e?he(t,n[2],i,null):me(n[2]),null)},i(n){e||(v(r,n),e=!0)},o(n){$(r,n),e=!1},d(n){r&&r.d(n)}}}function fc(s,e,t){let{$$slots:r={},$$scope:n}=e,{text:i}=e,{raw:l}=e;return s.$$set=a=>{"text"in a&&t(0,i=a.text),"raw"in a&&t(1,l=a.raw),"$$scope"in a&&t(2,n=a.$$scope)},[i,l,n,r]}class dc extends W{constructor(e){super(),Z(this,e,fc,uc,K,{text:0,raw:1})}}function hc(s){let e,t;return{c(){e=b("img"),Pe(e.src,t=s[0])||p(e,"src",t),p(e,"title",s[1]),p(e,"alt",s[2])},m(r,n){S(r,e,n)},p(r,[n]){n&1&&!Pe(e.src,t=r[0])&&p(e,"src",t),n&2&&p(e,"title",r[1]),n&4&&p(e,"alt",r[2])},i:B,o:B,d(r){r&&O(e)}}}function pc(s,e,t){let{href:r=""}=e,{title:n=void 0}=e,{text:i=""}=e;return s.$$set=l=>{"href"in l&&t(0,r=l.href),"title"in l&&t(1,n=l.title),"text"in l&&t(2,i=l.text)},[r,n,i]}class mc extends W{constructor(e){super(),Z(this,e,pc,hc,K,{href:0,title:1,text:2})}}function gc(s){let e,t;const r=s[3].default,n=de(r,s,s[2],null);return{c(){e=b("a"),n&&n.c(),p(e,"href",s[0]),p(e,"title",s[1])},m(i,l){S(i,e,l),n&&n.m(e,null),t=!0},p(i,[l]){n&&n.p&&(!t||l&4)&&pe(n,r,i,i[2],t?he(r,i[2],l,null):me(i[2]),null),(!t||l&1)&&p(e,"href",i[0]),(!t||l&2)&&p(e,"title",i[1])},i(i){t||(v(n,i),t=!0)},o(i){$(n,i),t=!1},d(i){i&&O(e),n&&n.d(i)}}}function _c(s,e,t){let{$$slots:r={},$$scope:n}=e,{href:i=""}=e,{title:l=void 0}=e;return s.$$set=a=>{"href"in a&&t(0,i=a.href),"title"in a&&t(1,l=a.title),"$$scope"in a&&t(2,n=a.$$scope)},[i,l,n,r]}class bc extends W{constructor(e){super(),Z(this,e,_c,gc,K,{href:0,title:1})}}function vc(s){let e,t;const r=s[1].default,n=de(r,s,s[0],null);return{c(){e=b("em"),n&&n.c()},m(i,l){S(i,e,l),n&&n.m(e,null),t=!0},p(i,[l]){n&&n.p&&(!t||l&1)&&pe(n,r,i,i[0],t?he(r,i[0],l,null):me(i[0]),null)},i(i){t||(v(n,i),t=!0)},o(i){$(n,i),t=!1},d(i){i&&O(e),n&&n.d(i)}}}function wc(s,e,t){let{$$slots:r={},$$scope:n}=e;return s.$$set=i=>{"$$scope"in i&&t(0,n=i.$$scope)},[n,r]}let yc=class extends W{constructor(e){super(),Z(this,e,wc,vc,K,{})}};function kc(s){let e,t;const r=s[1].default,n=de(r,s,s[0],null);return{c(){e=b("del"),n&&n.c()},m(i,l){S(i,e,l),n&&n.m(e,null),t=!0},p(i,[l]){n&&n.p&&(!t||l&1)&&pe(n,r,i,i[0],t?he(r,i[0],l,null):me(i[0]),null)},i(i){t||(v(n,i),t=!0)},o(i){$(n,i),t=!1},d(i){i&&O(e),n&&n.d(i)}}}function Oc(s,e,t){let{$$slots:r={},$$scope:n}=e;return s.$$set=i=>{"$$scope"in i&&t(0,n=i.$$scope)},[n,r]}class Sc extends W{constructor(e){super(),Z(this,e,Oc,kc,K,{})}}function Ac(s){let e,t=s[0].replace(/`/g,"")+"",r;return{c(){e=b("code"),r=ce(t)},m(n,i){S(n,e,i),_(e,r)},p(n,[i]){i&1&&t!==(t=n[0].replace(/`/g,"")+"")&&Te(r,t)},i:B,o:B,d(n){n&&O(e)}}}function $c(s,e,t){let{raw:r}=e;return s.$$set=n=>{"raw"in n&&t(0,r=n.raw)},[r]}class Ec extends W{constructor(e){super(),Z(this,e,$c,Ac,K,{raw:0})}}function Tc(s){let e,t;const r=s[1].default,n=de(r,s,s[0],null);return{c(){e=b("strong"),n&&n.c()},m(i,l){S(i,e,l),n&&n.m(e,null),t=!0},p(i,[l]){n&&n.p&&(!t||l&1)&&pe(n,r,i,i[0],t?he(r,i[0],l,null):me(i[0]),null)},i(i){t||(v(n,i),t=!0)},o(i){$(n,i),t=!1},d(i){i&&O(e),n&&n.d(i)}}}function Pc(s,e,t){let{$$slots:r={},$$scope:n}=e;return s.$$set=i=>{"$$scope"in i&&t(0,n=i.$$scope)},[n,r]}class Cc extends W{constructor(e){super(),Z(this,e,Pc,Tc,K,{})}}function Rc(s){let e,t;const r=s[1].default,n=de(r,s,s[0],null);return{c(){e=b("table"),n&&n.c()},m(i,l){S(i,e,l),n&&n.m(e,null),t=!0},p(i,[l]){n&&n.p&&(!t||l&1)&&pe(n,r,i,i[0],t?he(r,i[0],l,null):me(i[0]),null)},i(i){t||(v(n,i),t=!0)},o(i){$(n,i),t=!1},d(i){i&&O(e),n&&n.d(i)}}}function xc(s,e,t){let{$$slots:r={},$$scope:n}=e;return s.$$set=i=>{"$$scope"in i&&t(0,n=i.$$scope)},[n,r]}class Ic extends W{constructor(e){super(),Z(this,e,xc,Rc,K,{})}}function jc(s){let e,t;const r=s[1].default,n=de(r,s,s[0],null);return{c(){e=b("thead"),n&&n.c()},m(i,l){S(i,e,l),n&&n.m(e,null),t=!0},p(i,[l]){n&&n.p&&(!t||l&1)&&pe(n,r,i,i[0],t?he(r,i[0],l,null):me(i[0]),null)},i(i){t||(v(n,i),t=!0)},o(i){$(n,i),t=!1},d(i){i&&O(e),n&&n.d(i)}}}function Mc(s,e,t){let{$$slots:r={},$$scope:n}=e;return s.$$set=i=>{"$$scope"in i&&t(0,n=i.$$scope)},[n,r]}class Fc extends W{constructor(e){super(),Z(this,e,Mc,jc,K,{})}}function Uc(s){let e,t;const r=s[1].default,n=de(r,s,s[0],null);return{c(){e=b("tbody"),n&&n.c()},m(i,l){S(i,e,l),n&&n.m(e,null),t=!0},p(i,[l]){n&&n.p&&(!t||l&1)&&pe(n,r,i,i[0],t?he(r,i[0],l,null):me(i[0]),null)},i(i){t||(v(n,i),t=!0)},o(i){$(n,i),t=!1},d(i){i&&O(e),n&&n.d(i)}}}function Vc(s,e,t){let{$$slots:r={},$$scope:n}=e;return s.$$set=i=>{"$$scope"in i&&t(0,n=i.$$scope)},[n,r]}class Bc extends W{constructor(e){super(),Z(this,e,Vc,Uc,K,{})}}function Lc(s){let e,t;const r=s[1].default,n=de(r,s,s[0],null);return{c(){e=b("tr"),n&&n.c()},m(i,l){S(i,e,l),n&&n.m(e,null),t=!0},p(i,[l]){n&&n.p&&(!t||l&1)&&pe(n,r,i,i[0],t?he(r,i[0],l,null):me(i[0]),null)},i(i){t||(v(n,i),t=!0)},o(i){$(n,i),t=!1},d(i){i&&O(e),n&&n.d(i)}}}function Dc(s,e,t){let{$$slots:r={},$$scope:n}=e;return s.$$set=i=>{"$$scope"in i&&t(0,n=i.$$scope)},[n,r]}class qc extends W{constructor(e){super(),Z(this,e,Dc,Lc,K,{})}}function Nc(s){let e,t;const r=s[3].default,n=de(r,s,s[2],null);return{c(){e=b("td"),n&&n.c(),p(e,"align",s[1])},m(i,l){S(i,e,l),n&&n.m(e,null),t=!0},p(i,l){n&&n.p&&(!t||l&4)&&pe(n,r,i,i[2],t?he(r,i[2],l,null):me(i[2]),null),(!t||l&2)&&p(e,"align",i[1])},i(i){t||(v(n,i),t=!0)},o(i){$(n,i),t=!1},d(i){i&&O(e),n&&n.d(i)}}}function zc(s){let e,t;const r=s[3].default,n=de(r,s,s[2],null);return{c(){e=b("th"),n&&n.c(),p(e,"align",s[1])},m(i,l){S(i,e,l),n&&n.m(e,null),t=!0},p(i,l){n&&n.p&&(!t||l&4)&&pe(n,r,i,i[2],t?he(r,i[2],l,null):me(i[2]),null),(!t||l&2)&&p(e,"align",i[1])},i(i){t||(v(n,i),t=!0)},o(i){$(n,i),t=!1},d(i){i&&O(e),n&&n.d(i)}}}function Hc(s){let e,t,r,n;const i=[zc,Nc],l=[];function a(o,c){return o[0]?0:1}return e=a(s),t=l[e]=i[e](s),{c(){t.c(),r=ye()},m(o,c){l[e].m(o,c),S(o,r,c),n=!0},p(o,[c]){let u=e;e=a(o),e===u?l[e].p(o,c):(se(),$(l[u],1,1,()=>{l[u]=null}),ie(),t=l[e],t?t.p(o,c):(t=l[e]=i[e](o),t.c()),v(t,1),t.m(r.parentNode,r))},i(o){n||(v(t),n=!0)},o(o){$(t),n=!1},d(o){l[e].d(o),o&&O(r)}}}function Gc(s,e,t){let{$$slots:r={},$$scope:n}=e,{header:i}=e,{align:l}=e;return s.$$set=a=>{"header"in a&&t(0,i=a.header),"align"in a&&t(1,l=a.align),"$$scope"in a&&t(2,n=a.$$scope)},[i,l,n,r]}class Jc extends W{constructor(e){super(),Z(this,e,Gc,Hc,K,{header:0,align:1})}}function Qc(s){let e,t;const r=s[3].default,n=de(r,s,s[2],null);return{c(){e=b("ul"),n&&n.c()},m(i,l){S(i,e,l),n&&n.m(e,null),t=!0},p(i,l){n&&n.p&&(!t||l&4)&&pe(n,r,i,i[2],t?he(r,i[2],l,null):me(i[2]),null)},i(i){t||(v(n,i),t=!0)},o(i){$(n,i),t=!1},d(i){i&&O(e),n&&n.d(i)}}}function Yc(s){let e,t;const r=s[3].default,n=de(r,s,s[2],null);return{c(){e=b("ol"),n&&n.c(),p(e,"start",s[1])},m(i,l){S(i,e,l),n&&n.m(e,null),t=!0},p(i,l){n&&n.p&&(!t||l&4)&&pe(n,r,i,i[2],t?he(r,i[2],l,null):me(i[2]),null),(!t||l&2)&&p(e,"start",i[1])},i(i){t||(v(n,i),t=!0)},o(i){$(n,i),t=!1},d(i){i&&O(e),n&&n.d(i)}}}function Kc(s){let e,t,r,n;const i=[Yc,Qc],l=[];function a(o,c){return o[0]?0:1}return e=a(s),t=l[e]=i[e](s),{c(){t.c(),r=ye()},m(o,c){l[e].m(o,c),S(o,r,c),n=!0},p(o,[c]){let u=e;e=a(o),e===u?l[e].p(o,c):(se(),$(l[u],1,1,()=>{l[u]=null}),ie(),t=l[e],t?t.p(o,c):(t=l[e]=i[e](o),t.c()),v(t,1),t.m(r.parentNode,r))},i(o){n||(v(t),n=!0)},o(o){$(t),n=!1},d(o){l[e].d(o),o&&O(r)}}}function Zc(s,e,t){let{$$slots:r={},$$scope:n}=e,{ordered:i}=e,{start:l}=e;return s.$$set=a=>{"ordered"in a&&t(0,i=a.ordered),"start"in a&&t(1,l=a.start),"$$scope"in a&&t(2,n=a.$$scope)},[i,l,n,r]}class Wc extends W{constructor(e){super(),Z(this,e,Zc,Kc,K,{ordered:0,start:1})}}function Xc(s){let e,t;const r=s[1].default,n=de(r,s,s[0],null);return{c(){e=b("li"),n&&n.c()},m(i,l){S(i,e,l),n&&n.m(e,null),t=!0},p(i,[l]){n&&n.p&&(!t||l&1)&&pe(n,r,i,i[0],t?he(r,i[0],l,null):me(i[0]),null)},i(i){t||(v(n,i),t=!0)},o(i){$(n,i),t=!1},d(i){i&&O(e),n&&n.d(i)}}}function eu(s,e,t){let{$$slots:r={},$$scope:n}=e;return s.$$set=i=>{"$$scope"in i&&t(0,n=i.$$scope)},[n,r]}let tu=class extends W{constructor(e){super(),Z(this,e,eu,Xc,K,{})}};function nu(s){let e;return{c(){e=b("hr")},m(t,r){S(t,e,r)},p:B,i:B,o:B,d(t){t&&O(e)}}}class ru extends W{constructor(e){super(),Z(this,e,null,nu,K,{})}}function su(s){let e,t;return{c(){e=new Ui(!1),t=ye(),e.a=t},m(r,n){e.m(s[0],r,n),S(r,t,n)},p(r,[n]){n&1&&e.p(r[0])},i:B,o:B,d(r){r&&O(t),r&&e.d()}}}function iu(s,e,t){let{text:r}=e;return s.$$set=n=>{"text"in n&&t(0,r=n.text)},[r]}let lu=class extends W{constructor(e){super(),Z(this,e,iu,su,K,{text:0})}};function ou(s){let e,t;const r=s[1].default,n=de(r,s,s[0],null);return{c(){e=b("blockquote"),n&&n.c()},m(i,l){S(i,e,l),n&&n.m(e,null),t=!0},p(i,[l]){n&&n.p&&(!t||l&1)&&pe(n,r,i,i[0],t?he(r,i[0],l,null):me(i[0]),null)},i(i){t||(v(n,i),t=!0)},o(i){$(n,i),t=!1},d(i){i&&O(e),n&&n.d(i)}}}function au(s,e,t){let{$$slots:r={},$$scope:n}=e;return s.$$set=i=>{"$$scope"in i&&t(0,n=i.$$scope)},[n,r]}class cu extends W{constructor(e){super(),Z(this,e,au,ou,K,{})}}function uu(s){let e,t,r;return{c(){e=b("pre"),t=b("code"),r=ce(s[1]),p(e,"class",s[0])},m(n,i){S(n,e,i),_(e,t),_(t,r)},p(n,[i]){i&2&&Te(r,n[1]),i&1&&p(e,"class",n[0])},i:B,o:B,d(n){n&&O(e)}}}function fu(s,e,t){let{lang:r}=e,{text:n}=e;return s.$$set=i=>{"lang"in i&&t(0,r=i.lang),"text"in i&&t(1,n=i.text)},[r,n]}let du=class extends W{constructor(e){super(),Z(this,e,fu,uu,K,{lang:0,text:1})}};function hu(s){let e,t;const r=s[1].default,n=de(r,s,s[0],null);return{c(){e=b("br"),n&&n.c()},m(i,l){S(i,e,l),n&&n.m(i,l),t=!0},p(i,[l]){n&&n.p&&(!t||l&1)&&pe(n,r,i,i[0],t?he(r,i[0],l,null):me(i[0]),null)},i(i){t||(v(n,i),t=!0)},o(i){$(n,i),t=!1},d(i){i&&O(e),n&&n.d(i)}}}function pu(s,e,t){let{$$slots:r={},$$scope:n}=e;return s.$$set=i=>{"$$scope"in i&&t(0,n=i.$$scope)},[n,r]}class mu extends W{constructor(e){super(),Z(this,e,pu,hu,K,{})}}const gu={heading:lc,paragraph:cc,text:dc,image:mc,link:bc,em:yc,strong:Cc,codespan:Ec,del:Sc,table:Ic,tablehead:Fc,tablebody:Bc,tablerow:qc,tablecell:Jc,list:Wc,orderedlistitem:null,unorderedlistitem:null,listitem:tu,hr:ru,html:lu,blockquote:cu,code:du,br:mu},_u={baseUrl:null,breaks:!1,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,xhtml:!1};function bu(s){let e,t;return e=new gt({props:{tokens:s[0],renderers:s[1]}}),{c(){Y(e.$$.fragment)},m(r,n){J(e,r,n),t=!0},p(r,[n]){const i={};n&1&&(i.tokens=r[0]),n&2&&(i.renderers=r[1]),e.$set(i)},i(r){t||(v(e.$$.fragment,r),t=!0)},o(r){$(e.$$.fragment,r),t=!1},d(r){Q(e,r)}}}function vu(s,e,t){let r,n,i,l,{source:a=[]}=e,{renderers:o={}}=e,{options:c={}}=e,{isInline:u=!1}=e;const f=cn();let d,h,m;return Li(Ci,{slug:g=>n?n.slug(g):"",getOptions:()=>i}),an(()=>{t(7,m=!0)}),s.$$set=g=>{"source"in g&&t(2,a=g.source),"renderers"in g&&t(3,o=g.renderers),"options"in g&&t(4,c=g.options),"isInline"in g&&t(5,u=g.isInline)},s.$$.update=()=>{s.$$.dirty&4&&t(8,r=Array.isArray(a)),s.$$.dirty&4&&(n=a?new pr:void 0),s.$$.dirty&16&&t(9,i={..._u,...c}),s.$$.dirty&869&&(r?t(0,d=a):(t(6,h=new Ke(i)),t(0,d=u?h.inlineTokens(a):h.lex(a)),f("parsed",{tokens:d}))),s.$$.dirty&8&&t(1,l={...gu,...o}),s.$$.dirty&385&&m&&!r&&f("parsed",{tokens:d})},[d,l,a,o,c,u,h,m,r,i]}class wu extends W{constructor(e){super(),Z(this,e,vu,bu,K,{source:2,renderers:3,options:4,isInline:5})}}function yu(s){let e,t,r,n,i,l,a,o,c;return{c(){e=b("div"),t=b("div"),r=b("button"),r.textContent="Copy code",n=C(),i=b("pre"),l=b("code"),a=ce(s[0]),p(r,"class","svelte-hssbda"),p(t,"class","copycode svelte-hssbda"),p(i,"class","svelte-hssbda"),lt(e,"position","relative")},m(u,f){S(u,e,f),_(e,t),_(t,r),_(e,n),_(e,i),_(i,l),_(l,a),o||(c=N(r,"click",s[1]),o=!0)},p(u,[f]){f&1&&Te(a,u[0])},i:B,o:B,d(u){u&&O(e),o=!1,c()}}}function ku(s,e,t){let{text:r}=e;const n=async()=>{try{await navigator.clipboard.writeText(r)}catch(i){console.error("Error copying text: ",i)}};return s.$$set=i=>{"text"in i&&t(0,r=i.text)},[r,n]}class Ou extends W{constructor(e){super(),Z(this,e,ku,yu,K,{text:0})}}function Su(s){let e,t;const r=s[1].default,n=de(r,s,s[0],null);return{c(){e=b("em"),n&&n.c(),p(e,"class","svelte-djznuz")},m(i,l){S(i,e,l),n&&n.m(e,null),t=!0},p(i,[l]){n&&n.p&&(!t||l&1)&&pe(n,r,i,i[0],t?he(r,i[0],l,null):me(i[0]),null)},i(i){t||(v(n,i),t=!0)},o(i){$(n,i),t=!1},d(i){i&&O(e),n&&n.d(i)}}}function Au(s,e,t){let{$$slots:r={},$$scope:n}=e;return s.$$set=i=>{"$$scope"in i&&t(0,n=i.$$scope)},[n,r]}class $u extends W{constructor(e){super(),Z(this,e,Au,Su,K,{})}}function Eu(s){let e,t;const r=s[3].default,n=de(r,s,s[2],null);return{c(){e=b("ul"),n&&n.c(),p(e,"class","svelte-1dicnom")},m(i,l){S(i,e,l),n&&n.m(e,null),t=!0},p(i,l){n&&n.p&&(!t||l&4)&&pe(n,r,i,i[2],t?he(r,i[2],l,null):me(i[2]),null)},i(i){t||(v(n,i),t=!0)},o(i){$(n,i),t=!1},d(i){i&&O(e),n&&n.d(i)}}}function Tu(s){let e,t;const r=s[3].default,n=de(r,s,s[2],null);return{c(){e=b("ol"),n&&n.c(),p(e,"start",s[1]),p(e,"class","svelte-1dicnom")},m(i,l){S(i,e,l),n&&n.m(e,null),t=!0},p(i,l){n&&n.p&&(!t||l&4)&&pe(n,r,i,i[2],t?he(r,i[2],l,null):me(i[2]),null),(!t||l&2)&&p(e,"start",i[1])},i(i){t||(v(n,i),t=!0)},o(i){$(n,i),t=!1},d(i){i&&O(e),n&&n.d(i)}}}function Pu(s){let e,t,r,n;const i=[Tu,Eu],l=[];function a(o,c){return o[0]?0:1}return e=a(s),t=l[e]=i[e](s),{c(){t.c(),r=ye()},m(o,c){l[e].m(o,c),S(o,r,c),n=!0},p(o,[c]){let u=e;e=a(o),e===u?l[e].p(o,c):(se(),$(l[u],1,1,()=>{l[u]=null}),ie(),t=l[e],t?t.p(o,c):(t=l[e]=i[e](o),t.c()),v(t,1),t.m(r.parentNode,r))},i(o){n||(v(t),n=!0)},o(o){$(t),n=!1},d(o){l[e].d(o),o&&O(r)}}}function Cu(s,e,t){let{$$slots:r={},$$scope:n}=e,{ordered:i}=e,{start:l}=e;return s.$$set=a=>{"ordered"in a&&t(0,i=a.ordered),"start"in a&&t(1,l=a.start),"$$scope"in a&&t(2,n=a.$$scope)},[i,l,n,r]}class Ru extends W{constructor(e){super(),Z(this,e,Cu,Pu,K,{ordered:0,start:1})}}function xu(s){let e,t;const r=s[1].default,n=de(r,s,s[0],null);return{c(){e=b("li"),n&&n.c(),p(e,"class","svelte-fm7yqp")},m(i,l){S(i,e,l),n&&n.m(e,null),t=!0},p(i,[l]){n&&n.p&&(!t||l&1)&&pe(n,r,i,i[0],t?he(r,i[0],l,null):me(i[0]),null)},i(i){t||(v(n,i),t=!0)},o(i){$(n,i),t=!1},d(i){i&&O(e),n&&n.d(i)}}}function Iu(s,e,t){let{$$slots:r={},$$scope:n}=e;return s.$$set=i=>{"$$scope"in i&&t(0,n=i.$$scope)},[n,r]}class ju extends W{constructor(e){super(),Z(this,e,Iu,xu,K,{})}}function Mu(s){let e,t=s[0].replace(/`/g,"")+"",r;return{c(){e=b("code"),r=ce(t),p(e,"class","svelte-we39e")},m(n,i){S(n,e,i),_(e,r)},p(n,[i]){i&1&&t!==(t=n[0].replace(/`/g,"")+"")&&Te(r,t)},i:B,o:B,d(n){n&&O(e)}}}function Fu(s,e,t){let{raw:r}=e;return s.$$set=n=>{"raw"in n&&t(0,r=n.raw)},[r]}class Uu extends W{constructor(e){super(),Z(this,e,Fu,Mu,K,{raw:0})}}function Vu(s){let e,t;const r=s[1].default,n=de(r,s,s[0],null);return{c(){e=b("p"),n&&n.c(),p(e,"class","svelte-jw73bw")},m(i,l){S(i,e,l),n&&n.m(e,null),t=!0},p(i,[l]){n&&n.p&&(!t||l&1)&&pe(n,r,i,i[0],t?he(r,i[0],l,null):me(i[0]),null)},i(i){t||(v(n,i),t=!0)},o(i){$(n,i),t=!1},d(i){i&&O(e),n&&n.d(i)}}}function Bu(s,e,t){let{$$slots:r={},$$scope:n}=e;return s.$$set=i=>{"$$scope"in i&&t(0,n=i.$$scope)},[n,r]}class Lu extends W{constructor(e){super(),Z(this,e,Bu,Vu,K,{})}}function Du(s){let e;return{c(){e=ce(s[0])},m(t,r){S(t,e,r)},p(t,[r]){r&1&&Te(e,t[0])},i:B,o:B,d(t){t&&O(e)}}}function qu(s,e,t){let{text:r}=e;return s.$$set=n=>{"text"in n&&t(0,r=n.text)},[r]}class Nu extends W{constructor(e){super(),Z(this,e,qu,Du,K,{text:0})}}const zu="/assets/delete-f3f148b5.svg",Hu="/assets/CopyIcon-6270aedf.svg",Vs="/assets/UserIcon-57b535eb.svg",Bs="/assets/RobotIcon-76293781.svg",Gu="/assets/send-8e88dbd9.svg",Ju="/assets/wait-8f30b8f8.svg",Qu="/assets/upload-icon-8c25e619.svg";function Ls(s,e,t){const r=s.slice();return r[43]=e[t],r[45]=t,r}function Yu(s){let e;return{c(){e=ce("SmoothGPT")},m(t,r){S(t,e,r)},p:B,d(t){t&&O(e)}}}function Ku(s){let e=(s[2][s[1]].title||"SmoothGPT")+"",t;return{c(){t=ce(e)},m(r,n){S(r,t,n)},p(r,n){n[0]&6&&e!==(e=(r[2][r[1]].title||"SmoothGPT")+"")&&Te(t,e)},d(r){r&&O(t)}}}function Ds(s){let e,t;return e=new aa({}),e.$on("settings-changed",Uo),{c(){Y(e.$$.fragment)},m(r,n){J(e,r,n),t=!0},p:B,i(r){t||(v(e.$$.fragment,r),t=!0)},o(r){$(e.$$.fragment,r),t=!1},d(r){Q(e,r)}}}function qs(s){let e,t;return e=new fa({}),{c(){Y(e.$$.fragment)},m(r,n){J(e,r,n),t=!0},i(r){t||(v(e.$$.fragment,r),t=!0)},o(r){$(e.$$.fragment,r),t=!1},d(r){Q(e,r)}}}function Zu(s){let e;return{c(){e=b("div"),e.innerHTML="
No conversation selected. Start a new conversation.
",p(e,"class","flex justify-center items-center h-full")},m(t,r){S(t,e,r)},p:B,i:B,o:B,d(t){t&&O(e)}}}function Wu(s){let e,t,r,n=s[2][s[1]].history,i=[];for(let a=0;aOpenAI offers ChatGPT Plus for a monthly subscription, which allows you to use their UI to converse with ChatGPT. However, this comes with usage limits, and the $20/mo fee is expensive. Alternatively, you can use the OpenAI API, which is much more affordable with a pay-as-you-go rate. But, the API is not end-user friendly! It's designed for developers who can build apps around it.
+That's where SmoothGPT comes in! SmoothGPT provides a UI that is extremely similar to the ChatGPT official site.
+ +Note on data storage: If you browse away while a response is streaming in, you will miss that data. If you refresh your page, TTS MP3 files are lost, but conversations are maintained. Images generated by Dall-E are only available for 60 minutes. If you wipe your browser cache, ALL content is lost. You can download your session locally and restore it anytime.
`,f=$(),d=b("button"),d.textContent="Got it!",p(i,"class","icon-white w-8"),p(i,"alt","Close"),Ae(i.src,l=_n)||p(i,"src",l),p(n,"class","absolute top-0 right-0 mt-2 mr-2 text-gray-500 hover:text-gray-600"),p(o,"class","text-xl font-bold mb-4"),p(u,"class","text-left"),p(d,"class","bg-good hover:bg-good2 transition-colors duration-200 text-white py-2 px-4 mt-4 rounded"),p(r,"class","bg-primary text-white rounded-lg shadow-xl p-8 relative max-w-lg mx-4"),p(t,"class","flex items-center justify-center min-h-screen"),p(e,"class","fixed z-50 inset-0 overflow-y-auto animate-fade-in")},m(m,w){k(m,e,w),g(e,t),g(t,r),g(r,n),g(n,i),g(r,a),g(r,o),g(r,c),g(r,u),g(r,f),g(r,d),h||(_=[L(n,"click",s[0]),L(d,"click",s[0])],h=!0)},p:U,i:U,o:U,d(m){m&&y(e),h=!1,Ne(_)}}}function xa(s){function e(){hn.set(!1)}return[e]}class Ia extends ee{constructor(e){super(),X(this,e,xa,Ra,Z,{})}}function ja(){const s=console.warn;console.warn=e=>{e.includes("unknown prop")||e.includes("unexpected slot")||s(e)},vn(()=>{console.warn=s})}function js(s,e,t){const r=s.slice();return r[18]=e[t],r}function Fs(s,e,t){const r=s.slice();return r[18]=e[t],r}function Ms(s,e,t){const r=s.slice();return r[10]=e[t],r}function Us(s,e,t){const r=s.slice();return r[13]=e[t],r[15]=t,r}function Bs(s,e,t){const r=s.slice();return r[16]=e[t],r[15]=t,r}function Vs(s,e,t){const r=s.slice();return r[7]=e[t],r}function Fa(s){let e,t,r,n;const i=[Va,Ba,Ua],l=[];function a(o,c){return o[0]==="table"?0:o[0]==="list"?1:2}return e=a(s),t=l[e]=i[e](s),{c(){t.c(),r=ge()},m(o,c){l[e].m(o,c),k(o,r,c),n=!0},p(o,c){let u=e;e=a(o),e===u?l[e].p(o,c):(ie(),A(l[u],1,1,()=>{l[u]=null}),le(),t=l[e],t?t.p(o,c):(t=l[e]=i[e](o),t.c()),S(t,1),t.m(r.parentNode,r))},i(o){n||(S(t),n=!0)},o(o){A(t),n=!1},d(o){l[e].d(o),o&&y(r)}}}function Ma(s){let e,t,r=s[1],n=[];for(let l=0;lC.type==="space"),F=O.length>0&&O.some(C=>/\n.*\n/.test(C.raw));v.loose=F}if(v.loose)for(a=0;a
$/,"$1").replace(this.rules.inline._escapes,"$1"):"",i=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline._escapes,"$1"):t[3];return{type:"def",tag:r,raw:t[0],href:n,title:i}}}table(e){const t=this.rules.block.table.exec(e);if(t){const r={type:"table",header:Qs(t[1]).map(n=>({text:n})),align:t[2].replace(/^ *|\| *$/g,"").split(/ *\| */),rows:t[3]&&t[3].trim()?t[3].replace(/\n[ \t]*$/,"").split(`
+`):[]};if(r.header.length===r.align.length){r.raw=t[0];let n=r.align.length,i,l,a,o;for(i=0;i ${e} An error occurred: An error occurred: No conversation selected. Start a new conversation. it?a:nt*8-7,mt=gt&-8;let At=0,bt=0;for(;ut >8,l[h-2]=l[h-2]*p+n*w>>8,l[h-1]=l[h-1]*p+a*w>>8}}}function Q(l,e,n){const a=l.length,i=1/255;for(let h=3;h>8]>>8:e[i]*h>>16}}function at(l,e,n,a,i,h,p,w,E,R,P){const L=!!h,x=L?h[0]:0,k=L?h[1]:0,D=L?h[2]:0,j=i==="Luminosity"?K:Q,$=Math.min(a,Math.ceil(1048576/n));for(let tt=0;ttv&&typeof a=="function",P=R?Date.now()+f:0;let L=0;const x=this.commonObjs,k=this.objs;let D;for(;;){if(i!==void 0&&w===i.nextBreakPoint)return i.breakIt(w,a),w;if(D=p[w],D!==y.OPS.dependency)this[D].apply(this,h[w]);else for(const j of h[w]){const J=j.startsWith("g_")?x:k;if(!J.has(j))return J.get(j,a),w}if(w++,w===E)return w;if(R&&++L>v){if(Date.now()>P)return a(),w;L=0}}}#t(){for(;this.stateStack.length||this.inSMaskMode;)this.restore();this.ctx.restore(),this.transparentCanvas&&(this.ctx=this.compositeCtx,this.ctx.save(),this.ctx.setTransform(1,0,0,1,0,0),this.ctx.drawImage(this.transparentCanvas,0,0),this.ctx.restore(),this.transparentCanvas=null)}endDrawing(){this.#t(),this.cachedCanvases.clear(),this.cachedPatterns.clear();for(const e of this._cachedBitmapsMap.values()){for(const n of e.values())typeof HTMLCanvasElement<"u"&&n instanceof HTMLCanvasElement&&(n.width=n.height=0);e.clear()}this._cachedBitmapsMap.clear(),this.#e()}#e(){if(this.pageColors){const e=this.filterFactory.addHCMFilter(this.pageColors.foreground,this.pageColors.background);if(e!=="none"){const n=this.ctx.filter;this.ctx.filter=e,this.ctx.drawImage(this.ctx.canvas,0,0),this.ctx.filter=n}}}_scaleImage(e,n){const a=e.width,i=e.height;let h=Math.max(Math.hypot(n[0],n[1]),1),p=Math.max(Math.hypot(n[2],n[3]),1),w=a,E=i,R="prescale1",P,L;for(;h>2&&w>1||p>2&&E>1;){let x=w,k=E;h>2&&w>1&&(x=w>=16384?Math.floor(w/2)-1||1:Math.ceil(w/2),h/=w/x),p>2&&E>1&&(k=E>=16384?Math.floor(E/2)-1||1:Math.ceil(E)/2,p/=E/k),P=this.cachedCanvases.getCanvas(R,x,k),L=P.context,L.clearRect(0,0,x,k),L.drawImage(e,0,0,w,E,0,0,x,k),e=P.canvas,w=x,E=k,R=R==="prescale1"?"prescale2":"prescale1"}return{img:e,paintWidth:w,paintHeight:E}}_createMaskCanvas(e){const n=this.ctx,{width:a,height:i}=e,h=this.current.fillColor,p=this.current.patternFill,w=(0,z.getCurrentTransform)(n);let E,R,P,L;if((e.bitmap||e.data)&&e.count>1){const gt=e.bitmap||e.data.buffer;R=JSON.stringify(p?w:[w.slice(0,4),h]),E=this._cachedBitmapsMap.get(gt),E||(E=new Map,this._cachedBitmapsMap.set(gt,E));const mt=E.get(R);if(mt&&!p){const At=Math.round(Math.min(w[0],w[2])+w[4]),bt=Math.round(Math.min(w[1],w[3])+w[5]);return{canvas:mt,offsetX:At,offsetY:bt}}P=mt}P||(L=this.cachedCanvases.getCanvas("maskCanvas",a,i),X(L.context,e));let x=y.Util.transform(w,[1/a,0,0,-1/i,0,0]);x=y.Util.transform(x,[1,0,0,1,0,-i]);const[k,D,j,J]=y.Util.getAxialAlignedBoundingBox([0,0,a,i],x),$=Math.round(j-k)||1,tt=Math.round(J-D)||1,it=this.cachedCanvases.getCanvas("fillCanvas",$,tt),W=it.context,rt=k,nt=D;W.translate(-rt,-nt),W.transform(...x),P||(P=this._scaleImage(L.canvas,(0,z.getCurrentTransformInverse)(W)),P=P.img,E&&p&&E.set(R,P)),W.imageSmoothingEnabled=lt((0,z.getCurrentTransform)(W),e.interpolate),N(W,P,0,0,P.width,P.height,0,0,a,i),W.globalCompositeOperation="source-in";const ut=y.Util.transform((0,z.getCurrentTransformInverse)(W),[1,0,0,1,-rt,-nt]);return W.fillStyle=p?h.getPattern(n,this,ut,_.FILL):h,W.fillRect(0,0,a,i),E&&!p&&(this.cachedCanvases.delete("fillCanvas"),E.set(R,it.canvas)),{canvas:it.canvas,offsetX:Math.round(rt),offsetY:Math.round(nt)}}setLineWidth(e){e!==this.current.lineWidth&&(this._cachedScaleForStroking[0]=-1),this.current.lineWidth=e,this.ctx.lineWidth=e}setLineCap(e){this.ctx.lineCap=ht[e]}setLineJoin(e){this.ctx.lineJoin=ft[e]}setMiterLimit(e){this.ctx.miterLimit=e}setDash(e,n){const a=this.ctx;a.setLineDash!==void 0&&(a.setLineDash(e),a.lineDashOffset=n)}setRenderingIntent(e){}setFlatness(e){}setGState(e){for(const[n,a]of e)switch(n){case"LW":this.setLineWidth(a);break;case"LC":this.setLineCap(a);break;case"LJ":this.setLineJoin(a);break;case"ML":this.setMiterLimit(a);break;case"D":this.setDash(a[0],a[1]);break;case"RI":this.setRenderingIntent(a);break;case"FL":this.setFlatness(a);break;case"Font":this.setFont(a[0],a[1]);break;case"CA":this.current.strokeAlpha=a;break;case"ca":this.current.fillAlpha=a,this.ctx.globalAlpha=a;break;case"BM":this.ctx.globalCompositeOperation=a;break;case"SMask":this.current.activeSMask=a?this.tempSMask:null,this.tempSMask=null,this.checkSMaskState();break;case"TR":this.ctx.filter=this.current.transferMaps=this.filterFactory.addFilter(a);break}}get inSMaskMode(){return!!this.suspendedCtx}checkSMaskState(){const e=this.inSMaskMode;this.current.activeSMask&&!e?this.beginSMaskMode():!this.current.activeSMask&&e&&this.endSMaskMode()}beginSMaskMode(){if(this.inSMaskMode)throw new Error("beginSMaskMode called while already in smask mode");const e=this.ctx.canvas.width,n=this.ctx.canvas.height,a="smaskGroupAt"+this.groupLevel,i=this.cachedCanvases.getCanvas(a,e,n);this.suspendedCtx=this.ctx,this.ctx=i.context;const h=this.ctx;h.setTransform(...(0,z.getCurrentTransform)(this.suspendedCtx)),H(this.suspendedCtx,h),I(h,this.suspendedCtx),this.setGState([["BM","source-over"],["ca",1],["CA",1]])}endSMaskMode(){if(!this.inSMaskMode)throw new Error("endSMaskMode called while not in smask mode");this.ctx._removeMirroring(),H(this.ctx,this.suspendedCtx),this.ctx=this.suspendedCtx,this.suspendedCtx=null}compose(e){if(!this.current.activeSMask)return;e?(e[0]=Math.floor(e[0]),e[1]=Math.floor(e[1]),e[2]=Math.ceil(e[2]),e[3]=Math.ceil(e[3])):e=[0,0,this.ctx.canvas.width,this.ctx.canvas.height];const n=this.current.activeSMask,a=this.suspendedCtx;ot(a,n,this.ctx,e),this.ctx.save(),this.ctx.setTransform(1,0,0,1,0,0),this.ctx.clearRect(0,0,this.ctx.canvas.width,this.ctx.canvas.height),this.ctx.restore()}save(){this.inSMaskMode?(H(this.ctx,this.suspendedCtx),this.suspendedCtx.save()):this.ctx.save();const e=this.current;this.stateStack.push(e),this.current=e.clone()}restore(){this.stateStack.length===0&&this.inSMaskMode&&this.endSMaskMode(),this.stateStack.length!==0&&(this.current=this.stateStack.pop(),this.inSMaskMode?(this.suspendedCtx.restore(),H(this.suspendedCtx,this.ctx)):this.ctx.restore(),this.checkSMaskState(),this.pendingClip=null,this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null)}transform(e,n,a,i,h,p){this.ctx.transform(e,n,a,i,h,p),this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null}constructPath(e,n,a){const i=this.ctx,h=this.current;let p=h.x,w=h.y,E,R;const P=(0,z.getCurrentTransform)(i),L=P[0]===0&&P[3]===0||P[1]===0&&P[2]===0,x=L?a.slice(0):null;for(let k=0,D=0,j=e.length;k =w||c<0||c>=y?l<<=1:l=l<<1|r[o][c]}const g=k.readBit(C,l);t[s]=g}}return S}function decodeTextRegion(e,t,a,r,i,n,s,o,c,l,h,u,d,f,g,p,m,b,y){if(e&&t)throw new Jbig2Error("refinement with Huffman is not supported");const w=[];let x,S;for(x=0;x =n?_:_*(1<
+`:"'+(r?e:je(e,!0))+`
+`}blockquote(e){return`"+(r?e:je(e,!0))+`
+${e}
+`}html(e){return e}heading(e,t,r,n){if(this.options.headerIds){const i=this.options.headerPrefix+n.slug(r);return`
+`:`
+`}list(e,t,r){const n=t?"ol":"ul",i=t&&r!==1?' start="'+r+'"':"";return"<"+n+i+`>
+`+e+""+n+`>
+`}listitem(e){return`
+
+`+e+`
+`+t+`
+`}tablerow(e){return`
+${e}
+`}tablecell(e,t){const r=t.header?"th":"td";return(t.align?`<${r} align="${t.align}">`:`<${r}>`)+e+`${r}>
+`}strong(e){return`${e}`}em(e){return`${e}`}codespan(e){return`${e}
`}br(){return this.options.xhtml?"
":"
"}del(e){return`${e}`}link(e,t,r){if(e=Gs(this.options.sanitize,this.options.baseUrl,e),e===null)return r;let n='"+r+"",n}image(e,t,r){if(e=Gs(this.options.sanitize,this.options.baseUrl,e),e===null)return r;let n=`":">",n}text(e){return e}}class Ni{strong(e){return e}em(e){return e}codespan(e){return e}del(e){return e}html(e){return e}text(e){return e}link(e,t,r){return""+r}image(e,t,r){return""+r}br(){return""}}class $r{constructor(){this.seen={}}serialize(e){return e.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")}getNextSafeSlug(e,t){let r=e,n=0;if(this.seen.hasOwnProperty(r)){n=this.seen[e];do n++,r=e+"-"+n;while(this.seen.hasOwnProperty(r))}return t||(this.seen[e]=n,this.seen[r]=0),r}slug(e,t={}){const r=this.serialize(e);return this.getNextSafeSlug(r,t.dryrun)}}class it{constructor(e){this.options=e||Vt,this.options.renderer=this.options.renderer||new Tr,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Ni,this.slugger=new $r}static parse(e,t){return new it(t).parse(e)}static parseInline(e,t){return new it(t).parseInline(e)}parse(e,t=!0){let r="",n,i,l,a,o,c,u,f,d,h,_,m,w,v,E,P,O,F,C;const N=e.length;for(n=0;n"+je(n.message+"",!0)+"
";throw n}try{const n=lt.lex(s,e);if(e.walkTokens){if(e.async)return Promise.all(q.walkTokens(n,e.walkTokens)).then(()=>it.parse(n,e)).catch(r);q.walkTokens(n,e.walkTokens)}return it.parse(n,e)}catch(n){r(n)}}q.options=q.setOptions=function(s){return nt(q.defaults,s),sc(q.defaults),q};q.getDefaults=Ui;q.defaults=Vt;q.use=function(...s){const e=q.defaults.extensions||{renderers:{},childTokens:{}};s.forEach(t=>{const r=nt({},t);if(r.async=q.defaults.async||r.async,t.extensions&&(t.extensions.forEach(n=>{if(!n.name)throw new Error("extension name required");if(n.renderer){const i=e.renderers[n.name];i?e.renderers[n.name]=function(...l){let a=n.renderer.apply(this,l);return a===!1&&(a=i.apply(this,l)),a}:e.renderers[n.name]=n.renderer}if(n.tokenizer){if(!n.level||n.level!=="block"&&n.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");e[n.level]?e[n.level].unshift(n.tokenizer):e[n.level]=[n.tokenizer],n.start&&(n.level==="block"?e.startBlock?e.startBlock.push(n.start):e.startBlock=[n.start]:n.level==="inline"&&(e.startInline?e.startInline.push(n.start):e.startInline=[n.start]))}n.childTokens&&(e.childTokens[n.name]=n.childTokens)}),r.extensions=e),t.renderer){const n=q.defaults.renderer||new Tr;for(const i in t.renderer){const l=n[i];n[i]=(...a)=>{let o=t.renderer[i].apply(n,a);return o===!1&&(o=l.apply(n,a)),o}}r.renderer=n}if(t.tokenizer){const n=q.defaults.tokenizer||new Pr;for(const i in t.tokenizer){const l=n[i];n[i]=(...a)=>{let o=t.tokenizer[i].apply(n,a);return o===!1&&(o=l.apply(n,a)),o}}r.tokenizer=n}if(t.walkTokens){const n=q.defaults.walkTokens;r.walkTokens=function(i){let l=[];return l.push(t.walkTokens.call(this,i)),n&&(l=l.concat(n.call(this,i))),l}}q.setOptions(r)})};q.walkTokens=function(s,e){let t=[];for(const r of s)switch(t=t.concat(e.call(q,r)),r.type){case"table":{for(const n of r.header)t=t.concat(q.walkTokens(n.tokens,e));for(const n of r.rows)for(const i of n)t=t.concat(q.walkTokens(i.tokens,e));break}case"list":{t=t.concat(q.walkTokens(r.items,e));break}default:q.defaults.extensions&&q.defaults.extensions.childTokens&&q.defaults.extensions.childTokens[r.type]?q.defaults.extensions.childTokens[r.type].forEach(function(n){t=t.concat(q.walkTokens(r[n],e))}):r.tokens&&(t=t.concat(q.walkTokens(r.tokens,e)))}return t};q.parseInline=function(s,e){if(typeof s>"u"||s===null)throw new Error("marked.parseInline(): input parameter is undefined or null");if(typeof s!="string")throw new Error("marked.parseInline(): input parameter is of type "+Object.prototype.toString.call(s)+", string expected");e=nt({},q.defaults,e||{}),Li(e);try{const t=lt.lexInline(s,e);return e.walkTokens&&q.walkTokens(t,e.walkTokens),it.parseInline(t,e)}catch(t){if(t.message+=`
+Please report this to https://github.com/markedjs/marked.`,e.silent)return""+je(t.message+"",!0)+"
";throw t}};q.Parser=it;q.parser=it.parse;q.Renderer=Tr;q.TextRenderer=Ni;q.Lexer=lt;q.lexer=lt.lex;q.Tokenizer=Pr;q.Slugger=$r;q.parse=q;q.options;q.setOptions;q.use;q.walkTokens;q.parseInline;it.parse;lt.lex;const qi={};function vc(s){let e;return{c(){e=ae(s[1])},m(t,r){k(t,e,r)},p(t,r){r&2&&Pe(e,t[1])},i:U,o:U,d(t){t&&y(e)}}}function wc(s){let e,t;const r=s[5].default,n=de(r,s,s[4],null);return{c(){e=b("h6"),n&&n.c(),p(e,"id",s[2])},m(i,l){k(i,e,l),n&&n.m(e,null),t=!0},p(i,l){n&&n.p&&(!t||l&16)&&pe(n,r,i,i[4],t?he(r,i[4],l,null):me(i[4]),null),(!t||l&4)&&p(e,"id",i[2])},i(i){t||(S(n,i),t=!0)},o(i){A(n,i),t=!1},d(i){i&&y(e),n&&n.d(i)}}}function yc(s){let e,t;const r=s[5].default,n=de(r,s,s[4],null);return{c(){e=b("h5"),n&&n.c(),p(e,"id",s[2])},m(i,l){k(i,e,l),n&&n.m(e,null),t=!0},p(i,l){n&&n.p&&(!t||l&16)&&pe(n,r,i,i[4],t?he(r,i[4],l,null):me(i[4]),null),(!t||l&4)&&p(e,"id",i[2])},i(i){t||(S(n,i),t=!0)},o(i){A(n,i),t=!1},d(i){i&&y(e),n&&n.d(i)}}}function kc(s){let e,t;const r=s[5].default,n=de(r,s,s[4],null);return{c(){e=b("h4"),n&&n.c(),p(e,"id",s[2])},m(i,l){k(i,e,l),n&&n.m(e,null),t=!0},p(i,l){n&&n.p&&(!t||l&16)&&pe(n,r,i,i[4],t?he(r,i[4],l,null):me(i[4]),null),(!t||l&4)&&p(e,"id",i[2])},i(i){t||(S(n,i),t=!0)},o(i){A(n,i),t=!1},d(i){i&&y(e),n&&n.d(i)}}}function Oc(s){let e,t;const r=s[5].default,n=de(r,s,s[4],null);return{c(){e=b("h3"),n&&n.c(),p(e,"id",s[2])},m(i,l){k(i,e,l),n&&n.m(e,null),t=!0},p(i,l){n&&n.p&&(!t||l&16)&&pe(n,r,i,i[4],t?he(r,i[4],l,null):me(i[4]),null),(!t||l&4)&&p(e,"id",i[2])},i(i){t||(S(n,i),t=!0)},o(i){A(n,i),t=!1},d(i){i&&y(e),n&&n.d(i)}}}function Sc(s){let e,t;const r=s[5].default,n=de(r,s,s[4],null);return{c(){e=b("h2"),n&&n.c(),p(e,"id",s[2])},m(i,l){k(i,e,l),n&&n.m(e,null),t=!0},p(i,l){n&&n.p&&(!t||l&16)&&pe(n,r,i,i[4],t?he(r,i[4],l,null):me(i[4]),null),(!t||l&4)&&p(e,"id",i[2])},i(i){t||(S(n,i),t=!0)},o(i){A(n,i),t=!1},d(i){i&&y(e),n&&n.d(i)}}}function Ac(s){let e,t;const r=s[5].default,n=de(r,s,s[4],null);return{c(){e=b("h1"),n&&n.c(),p(e,"id",s[2])},m(i,l){k(i,e,l),n&&n.m(e,null),t=!0},p(i,l){n&&n.p&&(!t||l&16)&&pe(n,r,i,i[4],t?he(r,i[4],l,null):me(i[4]),null),(!t||l&4)&&p(e,"id",i[2])},i(i){t||(S(n,i),t=!0)},o(i){A(n,i),t=!1},d(i){i&&y(e),n&&n.d(i)}}}function Ec(s){let e,t,r,n;const i=[Ac,Sc,Oc,kc,yc,wc,vc],l=[];function a(o,c){return o[0]===1?0:o[0]===2?1:o[0]===3?2:o[0]===4?3:o[0]===5?4:o[0]===6?5:6}return e=a(s),t=l[e]=i[e](s),{c(){t.c(),r=ge()},m(o,c){l[e].m(o,c),k(o,r,c),n=!0},p(o,[c]){let u=e;e=a(o),e===u?l[e].p(o,c):(ie(),A(l[u],1,1,()=>{l[u]=null}),le(),t=l[e],t?t.p(o,c):(t=l[e]=i[e](o),t.c()),S(t,1),t.m(r.parentNode,r))},i(o){n||(S(t),n=!0)},o(o){A(t),n=!1},d(o){l[e].d(o),o&&y(r)}}}function Pc(s,e,t){let r,{$$slots:n={},$$scope:i}=e,{depth:l}=e,{raw:a}=e,{text:o}=e;const{slug:c,getOptions:u}=ll(qi),f=u();return s.$$set=d=>{"depth"in d&&t(0,l=d.depth),"raw"in d&&t(1,a=d.raw),"text"in d&&t(3,o=d.text),"$$scope"in d&&t(4,i=d.$$scope)},s.$$.update=()=>{s.$$.dirty&8&&t(2,r=f.headerIds?f.headerPrefix+c(o):void 0)},[l,a,r,o,i,n]}class Tc extends ee{constructor(e){super(),X(this,e,Pc,Ec,Z,{depth:0,raw:1,text:3})}}function $c(s){let e,t;const r=s[1].default,n=de(r,s,s[0],null);return{c(){e=b("p"),n&&n.c()},m(i,l){k(i,e,l),n&&n.m(e,null),t=!0},p(i,[l]){n&&n.p&&(!t||l&1)&&pe(n,r,i,i[0],t?he(r,i[0],l,null):me(i[0]),null)},i(i){t||(S(n,i),t=!0)},o(i){A(n,i),t=!1},d(i){i&&y(e),n&&n.d(i)}}}function Cc(s,e,t){let{$$slots:r={},$$scope:n}=e;return s.$$set=i=>{"$$scope"in i&&t(0,n=i.$$scope)},[n,r]}let Rc=class extends ee{constructor(e){super(),X(this,e,Cc,$c,Z,{})}};function xc(s){let e;const t=s[3].default,r=de(t,s,s[2],null);return{c(){r&&r.c()},m(n,i){r&&r.m(n,i),e=!0},p(n,[i]){r&&r.p&&(!e||i&4)&&pe(r,t,n,n[2],e?he(t,n[2],i,null):me(n[2]),null)},i(n){e||(S(r,n),e=!0)},o(n){A(r,n),e=!1},d(n){r&&r.d(n)}}}function Ic(s,e,t){let{$$slots:r={},$$scope:n}=e,{text:i}=e,{raw:l}=e;return s.$$set=a=>{"text"in a&&t(0,i=a.text),"raw"in a&&t(1,l=a.raw),"$$scope"in a&&t(2,n=a.$$scope)},[i,l,n,r]}class jc extends ee{constructor(e){super(),X(this,e,Ic,xc,Z,{text:0,raw:1})}}function Fc(s){let e,t;return{c(){e=b("img"),Ae(e.src,t=s[0])||p(e,"src",t),p(e,"title",s[1]),p(e,"alt",s[2])},m(r,n){k(r,e,n)},p(r,[n]){n&1&&!Ae(e.src,t=r[0])&&p(e,"src",t),n&2&&p(e,"title",r[1]),n&4&&p(e,"alt",r[2])},i:U,o:U,d(r){r&&y(e)}}}function Mc(s,e,t){let{href:r=""}=e,{title:n=void 0}=e,{text:i=""}=e;return s.$$set=l=>{"href"in l&&t(0,r=l.href),"title"in l&&t(1,n=l.title),"text"in l&&t(2,i=l.text)},[r,n,i]}class Uc extends ee{constructor(e){super(),X(this,e,Mc,Fc,Z,{href:0,title:1,text:2})}}function Bc(s){let e,t;const r=s[3].default,n=de(r,s,s[2],null);return{c(){e=b("a"),n&&n.c(),p(e,"href",s[0]),p(e,"title",s[1])},m(i,l){k(i,e,l),n&&n.m(e,null),t=!0},p(i,[l]){n&&n.p&&(!t||l&4)&&pe(n,r,i,i[2],t?he(r,i[2],l,null):me(i[2]),null),(!t||l&1)&&p(e,"href",i[0]),(!t||l&2)&&p(e,"title",i[1])},i(i){t||(S(n,i),t=!0)},o(i){A(n,i),t=!1},d(i){i&&y(e),n&&n.d(i)}}}function Vc(s,e,t){let{$$slots:r={},$$scope:n}=e,{href:i=""}=e,{title:l=void 0}=e;return s.$$set=a=>{"href"in a&&t(0,i=a.href),"title"in a&&t(1,l=a.title),"$$scope"in a&&t(2,n=a.$$scope)},[i,l,n,r]}class Dc extends ee{constructor(e){super(),X(this,e,Vc,Bc,Z,{href:0,title:1})}}function Lc(s){let e,t;const r=s[1].default,n=de(r,s,s[0],null);return{c(){e=b("em"),n&&n.c()},m(i,l){k(i,e,l),n&&n.m(e,null),t=!0},p(i,[l]){n&&n.p&&(!t||l&1)&&pe(n,r,i,i[0],t?he(r,i[0],l,null):me(i[0]),null)},i(i){t||(S(n,i),t=!0)},o(i){A(n,i),t=!1},d(i){i&&y(e),n&&n.d(i)}}}function Nc(s,e,t){let{$$slots:r={},$$scope:n}=e;return s.$$set=i=>{"$$scope"in i&&t(0,n=i.$$scope)},[n,r]}let qc=class extends ee{constructor(e){super(),X(this,e,Nc,Lc,Z,{})}};function zc(s){let e,t;const r=s[1].default,n=de(r,s,s[0],null);return{c(){e=b("del"),n&&n.c()},m(i,l){k(i,e,l),n&&n.m(e,null),t=!0},p(i,[l]){n&&n.p&&(!t||l&1)&&pe(n,r,i,i[0],t?he(r,i[0],l,null):me(i[0]),null)},i(i){t||(S(n,i),t=!0)},o(i){A(n,i),t=!1},d(i){i&&y(e),n&&n.d(i)}}}function Hc(s,e,t){let{$$slots:r={},$$scope:n}=e;return s.$$set=i=>{"$$scope"in i&&t(0,n=i.$$scope)},[n,r]}class Jc extends ee{constructor(e){super(),X(this,e,Hc,zc,Z,{})}}function Gc(s){let e,t=s[0].replace(/`/g,"")+"",r;return{c(){e=b("code"),r=ae(t)},m(n,i){k(n,e,i),g(e,r)},p(n,[i]){i&1&&t!==(t=n[0].replace(/`/g,"")+"")&&Pe(r,t)},i:U,o:U,d(n){n&&y(e)}}}function Qc(s,e,t){let{raw:r}=e;return s.$$set=n=>{"raw"in n&&t(0,r=n.raw)},[r]}class Yc extends ee{constructor(e){super(),X(this,e,Qc,Gc,Z,{raw:0})}}function Wc(s){let e,t;const r=s[1].default,n=de(r,s,s[0],null);return{c(){e=b("strong"),n&&n.c()},m(i,l){k(i,e,l),n&&n.m(e,null),t=!0},p(i,[l]){n&&n.p&&(!t||l&1)&&pe(n,r,i,i[0],t?he(r,i[0],l,null):me(i[0]),null)},i(i){t||(S(n,i),t=!0)},o(i){A(n,i),t=!1},d(i){i&&y(e),n&&n.d(i)}}}function Kc(s,e,t){let{$$slots:r={},$$scope:n}=e;return s.$$set=i=>{"$$scope"in i&&t(0,n=i.$$scope)},[n,r]}class Zc extends ee{constructor(e){super(),X(this,e,Kc,Wc,Z,{})}}function Xc(s){let e,t;const r=s[1].default,n=de(r,s,s[0],null);return{c(){e=b("table"),n&&n.c()},m(i,l){k(i,e,l),n&&n.m(e,null),t=!0},p(i,[l]){n&&n.p&&(!t||l&1)&&pe(n,r,i,i[0],t?he(r,i[0],l,null):me(i[0]),null)},i(i){t||(S(n,i),t=!0)},o(i){A(n,i),t=!1},d(i){i&&y(e),n&&n.d(i)}}}function eu(s,e,t){let{$$slots:r={},$$scope:n}=e;return s.$$set=i=>{"$$scope"in i&&t(0,n=i.$$scope)},[n,r]}class tu extends ee{constructor(e){super(),X(this,e,eu,Xc,Z,{})}}function nu(s){let e,t;const r=s[1].default,n=de(r,s,s[0],null);return{c(){e=b("thead"),n&&n.c()},m(i,l){k(i,e,l),n&&n.m(e,null),t=!0},p(i,[l]){n&&n.p&&(!t||l&1)&&pe(n,r,i,i[0],t?he(r,i[0],l,null):me(i[0]),null)},i(i){t||(S(n,i),t=!0)},o(i){A(n,i),t=!1},d(i){i&&y(e),n&&n.d(i)}}}function ru(s,e,t){let{$$slots:r={},$$scope:n}=e;return s.$$set=i=>{"$$scope"in i&&t(0,n=i.$$scope)},[n,r]}class su extends ee{constructor(e){super(),X(this,e,ru,nu,Z,{})}}function iu(s){let e,t;const r=s[1].default,n=de(r,s,s[0],null);return{c(){e=b("tbody"),n&&n.c()},m(i,l){k(i,e,l),n&&n.m(e,null),t=!0},p(i,[l]){n&&n.p&&(!t||l&1)&&pe(n,r,i,i[0],t?he(r,i[0],l,null):me(i[0]),null)},i(i){t||(S(n,i),t=!0)},o(i){A(n,i),t=!1},d(i){i&&y(e),n&&n.d(i)}}}function lu(s,e,t){let{$$slots:r={},$$scope:n}=e;return s.$$set=i=>{"$$scope"in i&&t(0,n=i.$$scope)},[n,r]}class ou extends ee{constructor(e){super(),X(this,e,lu,iu,Z,{})}}function au(s){let e,t;const r=s[1].default,n=de(r,s,s[0],null);return{c(){e=b("tr"),n&&n.c()},m(i,l){k(i,e,l),n&&n.m(e,null),t=!0},p(i,[l]){n&&n.p&&(!t||l&1)&&pe(n,r,i,i[0],t?he(r,i[0],l,null):me(i[0]),null)},i(i){t||(S(n,i),t=!0)},o(i){A(n,i),t=!1},d(i){i&&y(e),n&&n.d(i)}}}function cu(s,e,t){let{$$slots:r={},$$scope:n}=e;return s.$$set=i=>{"$$scope"in i&&t(0,n=i.$$scope)},[n,r]}class uu extends ee{constructor(e){super(),X(this,e,cu,au,Z,{})}}function fu(s){let e,t;const r=s[3].default,n=de(r,s,s[2],null);return{c(){e=b("td"),n&&n.c(),p(e,"align",s[1])},m(i,l){k(i,e,l),n&&n.m(e,null),t=!0},p(i,l){n&&n.p&&(!t||l&4)&&pe(n,r,i,i[2],t?he(r,i[2],l,null):me(i[2]),null),(!t||l&2)&&p(e,"align",i[1])},i(i){t||(S(n,i),t=!0)},o(i){A(n,i),t=!1},d(i){i&&y(e),n&&n.d(i)}}}function du(s){let e,t;const r=s[3].default,n=de(r,s,s[2],null);return{c(){e=b("th"),n&&n.c(),p(e,"align",s[1])},m(i,l){k(i,e,l),n&&n.m(e,null),t=!0},p(i,l){n&&n.p&&(!t||l&4)&&pe(n,r,i,i[2],t?he(r,i[2],l,null):me(i[2]),null),(!t||l&2)&&p(e,"align",i[1])},i(i){t||(S(n,i),t=!0)},o(i){A(n,i),t=!1},d(i){i&&y(e),n&&n.d(i)}}}function hu(s){let e,t,r,n;const i=[du,fu],l=[];function a(o,c){return o[0]?0:1}return e=a(s),t=l[e]=i[e](s),{c(){t.c(),r=ge()},m(o,c){l[e].m(o,c),k(o,r,c),n=!0},p(o,[c]){let u=e;e=a(o),e===u?l[e].p(o,c):(ie(),A(l[u],1,1,()=>{l[u]=null}),le(),t=l[e],t?t.p(o,c):(t=l[e]=i[e](o),t.c()),S(t,1),t.m(r.parentNode,r))},i(o){n||(S(t),n=!0)},o(o){A(t),n=!1},d(o){l[e].d(o),o&&y(r)}}}function pu(s,e,t){let{$$slots:r={},$$scope:n}=e,{header:i}=e,{align:l}=e;return s.$$set=a=>{"header"in a&&t(0,i=a.header),"align"in a&&t(1,l=a.align),"$$scope"in a&&t(2,n=a.$$scope)},[i,l,n,r]}class mu extends ee{constructor(e){super(),X(this,e,pu,hu,Z,{header:0,align:1})}}function gu(s){let e,t;const r=s[3].default,n=de(r,s,s[2],null);return{c(){e=b("ul"),n&&n.c()},m(i,l){k(i,e,l),n&&n.m(e,null),t=!0},p(i,l){n&&n.p&&(!t||l&4)&&pe(n,r,i,i[2],t?he(r,i[2],l,null):me(i[2]),null)},i(i){t||(S(n,i),t=!0)},o(i){A(n,i),t=!1},d(i){i&&y(e),n&&n.d(i)}}}function _u(s){let e,t;const r=s[3].default,n=de(r,s,s[2],null);return{c(){e=b("ol"),n&&n.c(),p(e,"start",s[1])},m(i,l){k(i,e,l),n&&n.m(e,null),t=!0},p(i,l){n&&n.p&&(!t||l&4)&&pe(n,r,i,i[2],t?he(r,i[2],l,null):me(i[2]),null),(!t||l&2)&&p(e,"start",i[1])},i(i){t||(S(n,i),t=!0)},o(i){A(n,i),t=!1},d(i){i&&y(e),n&&n.d(i)}}}function bu(s){let e,t,r,n;const i=[_u,gu],l=[];function a(o,c){return o[0]?0:1}return e=a(s),t=l[e]=i[e](s),{c(){t.c(),r=ge()},m(o,c){l[e].m(o,c),k(o,r,c),n=!0},p(o,[c]){let u=e;e=a(o),e===u?l[e].p(o,c):(ie(),A(l[u],1,1,()=>{l[u]=null}),le(),t=l[e],t?t.p(o,c):(t=l[e]=i[e](o),t.c()),S(t,1),t.m(r.parentNode,r))},i(o){n||(S(t),n=!0)},o(o){A(t),n=!1},d(o){l[e].d(o),o&&y(r)}}}function vu(s,e,t){let{$$slots:r={},$$scope:n}=e,{ordered:i}=e,{start:l}=e;return s.$$set=a=>{"ordered"in a&&t(0,i=a.ordered),"start"in a&&t(1,l=a.start),"$$scope"in a&&t(2,n=a.$$scope)},[i,l,n,r]}class wu extends ee{constructor(e){super(),X(this,e,vu,bu,Z,{ordered:0,start:1})}}function yu(s){let e,t;const r=s[1].default,n=de(r,s,s[0],null);return{c(){e=b("li"),n&&n.c()},m(i,l){k(i,e,l),n&&n.m(e,null),t=!0},p(i,[l]){n&&n.p&&(!t||l&1)&&pe(n,r,i,i[0],t?he(r,i[0],l,null):me(i[0]),null)},i(i){t||(S(n,i),t=!0)},o(i){A(n,i),t=!1},d(i){i&&y(e),n&&n.d(i)}}}function ku(s,e,t){let{$$slots:r={},$$scope:n}=e;return s.$$set=i=>{"$$scope"in i&&t(0,n=i.$$scope)},[n,r]}let Ou=class extends ee{constructor(e){super(),X(this,e,ku,yu,Z,{})}};function Su(s){let e;return{c(){e=b("hr")},m(t,r){k(t,e,r)},p:U,i:U,o:U,d(t){t&&y(e)}}}class Au extends ee{constructor(e){super(),X(this,e,null,Su,Z,{})}}function Eu(s){let e,t;return{c(){e=new nl(!1),t=ge(),e.a=t},m(r,n){e.m(s[0],r,n),k(r,t,n)},p(r,[n]){n&1&&e.p(r[0])},i:U,o:U,d(r){r&&y(t),r&&e.d()}}}function Pu(s,e,t){let{text:r}=e;return s.$$set=n=>{"text"in n&&t(0,r=n.text)},[r]}let Tu=class extends ee{constructor(e){super(),X(this,e,Pu,Eu,Z,{text:0})}};function $u(s){let e,t;const r=s[1].default,n=de(r,s,s[0],null);return{c(){e=b("blockquote"),n&&n.c()},m(i,l){k(i,e,l),n&&n.m(e,null),t=!0},p(i,[l]){n&&n.p&&(!t||l&1)&&pe(n,r,i,i[0],t?he(r,i[0],l,null):me(i[0]),null)},i(i){t||(S(n,i),t=!0)},o(i){A(n,i),t=!1},d(i){i&&y(e),n&&n.d(i)}}}function Cu(s,e,t){let{$$slots:r={},$$scope:n}=e;return s.$$set=i=>{"$$scope"in i&&t(0,n=i.$$scope)},[n,r]}class Ru extends ee{constructor(e){super(),X(this,e,Cu,$u,Z,{})}}function xu(s){let e,t,r;return{c(){e=b("pre"),t=b("code"),r=ae(s[1]),p(e,"class",s[0])},m(n,i){k(n,e,i),g(e,t),g(t,r)},p(n,[i]){i&2&&Pe(r,n[1]),i&1&&p(e,"class",n[0])},i:U,o:U,d(n){n&&y(e)}}}function Iu(s,e,t){let{lang:r}=e,{text:n}=e;return s.$$set=i=>{"lang"in i&&t(0,r=i.lang),"text"in i&&t(1,n=i.text)},[r,n]}let ju=class extends ee{constructor(e){super(),X(this,e,Iu,xu,Z,{lang:0,text:1})}};function Fu(s){let e,t;const r=s[1].default,n=de(r,s,s[0],null);return{c(){e=b("br"),n&&n.c()},m(i,l){k(i,e,l),n&&n.m(i,l),t=!0},p(i,[l]){n&&n.p&&(!t||l&1)&&pe(n,r,i,i[0],t?he(r,i[0],l,null):me(i[0]),null)},i(i){t||(S(n,i),t=!0)},o(i){A(n,i),t=!1},d(i){i&&y(e),n&&n.d(i)}}}function Mu(s,e,t){let{$$slots:r={},$$scope:n}=e;return s.$$set=i=>{"$$scope"in i&&t(0,n=i.$$scope)},[n,r]}class Uu extends ee{constructor(e){super(),X(this,e,Mu,Fu,Z,{})}}const Bu={heading:Tc,paragraph:Rc,text:jc,image:Uc,link:Dc,em:qc,strong:Zc,codespan:Yc,del:Jc,table:tu,tablehead:su,tablebody:ou,tablerow:uu,tablecell:mu,list:wu,orderedlistitem:null,unorderedlistitem:null,listitem:Ou,hr:Au,html:Tu,blockquote:Ru,code:ju,br:Uu},Vu={baseUrl:null,breaks:!1,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,xhtml:!1};function Du(s){let e,t;return e=new St({props:{tokens:s[0],renderers:s[1]}}),{c(){K(e.$$.fragment)},m(r,n){Y(e,r,n),t=!0},p(r,[n]){const i={};n&1&&(i.tokens=r[0]),n&2&&(i.renderers=r[1]),e.$set(i)},i(r){t||(S(e.$$.fragment,r),t=!0)},o(r){A(e.$$.fragment,r),t=!1},d(r){W(e,r)}}}function Lu(s,e,t){let r,n,i,l,{source:a=[]}=e,{renderers:o={}}=e,{options:c={}}=e,{isInline:u=!1}=e;const f=wn();let d,h,_;return il(qi,{slug:m=>n?n.slug(m):"",getOptions:()=>i}),vn(()=>{t(7,_=!0)}),s.$$set=m=>{"source"in m&&t(2,a=m.source),"renderers"in m&&t(3,o=m.renderers),"options"in m&&t(4,c=m.options),"isInline"in m&&t(5,u=m.isInline)},s.$$.update=()=>{s.$$.dirty&4&&t(8,r=Array.isArray(a)),s.$$.dirty&4&&(n=a?new $r:void 0),s.$$.dirty&16&&t(9,i={...Vu,...c}),s.$$.dirty&869&&(r?t(0,d=a):(t(6,h=new lt(i)),t(0,d=u?h.inlineTokens(a):h.lex(a)),f("parsed",{tokens:d}))),s.$$.dirty&8&&t(1,l={...Bu,...o}),s.$$.dirty&385&&_&&!r&&f("parsed",{tokens:d})},[d,l,a,o,c,u,h,_,r,i]}class zi extends ee{constructor(e){super(),X(this,e,Lu,Du,Z,{source:2,renderers:3,options:4,isInline:5})}}function Nu(s){let e,t,r,n,i,l,a,o,c;return{c(){e=b("div"),t=b("div"),r=b("button"),r.textContent="Copy code",n=$(),i=b("pre"),l=b("code"),a=ae(s[0]),p(r,"class","svelte-hssbda"),p(t,"class","copycode svelte-hssbda"),p(i,"class","svelte-hssbda"),rt(e,"position","relative")},m(u,f){k(u,e,f),g(e,t),g(t,r),g(e,n),g(e,i),g(i,l),g(l,a),o||(c=L(r,"click",s[1]),o=!0)},p(u,[f]){f&1&&Pe(a,u[0])},i:U,o:U,d(u){u&&y(e),o=!1,c()}}}function qu(s,e,t){let{text:r}=e;const n=async()=>{try{await navigator.clipboard.writeText(r)}catch(i){console.error("Error copying text: ",i)}};return s.$$set=i=>{"text"in i&&t(0,r=i.text)},[r,n]}class zu extends ee{constructor(e){super(),X(this,e,qu,Nu,Z,{text:0})}}function Hu(s){let e,t;return{c(){e=b("div"),t=ae(s[0]),rt(e,"position","relative")},m(r,n){k(r,e,n),g(e,t)},p(r,[n]){n&1&&Pe(t,r[0])},i:U,o:U,d(r){r&&y(e)}}}function Ju(s,e,t){let{text:r}=e;return s.$$set=n=>{"text"in n&&t(0,r=n.text)},[r]}class Gu extends ee{constructor(e){super(),X(this,e,Ju,Hu,Z,{text:0})}}function Qu(s){let e,t;const r=s[1].default,n=de(r,s,s[0],null);return{c(){e=b("em"),n&&n.c(),p(e,"class","svelte-djznuz")},m(i,l){k(i,e,l),n&&n.m(e,null),t=!0},p(i,[l]){n&&n.p&&(!t||l&1)&&pe(n,r,i,i[0],t?he(r,i[0],l,null):me(i[0]),null)},i(i){t||(S(n,i),t=!0)},o(i){A(n,i),t=!1},d(i){i&&y(e),n&&n.d(i)}}}function Yu(s,e,t){let{$$slots:r={},$$scope:n}=e;return s.$$set=i=>{"$$scope"in i&&t(0,n=i.$$scope)},[n,r]}class Hi extends ee{constructor(e){super(),X(this,e,Yu,Qu,Z,{})}}function Wu(s){let e,t;const r=s[3].default,n=de(r,s,s[2],null);return{c(){e=b("ul"),n&&n.c(),p(e,"class","svelte-1dicnom")},m(i,l){k(i,e,l),n&&n.m(e,null),t=!0},p(i,l){n&&n.p&&(!t||l&4)&&pe(n,r,i,i[2],t?he(r,i[2],l,null):me(i[2]),null)},i(i){t||(S(n,i),t=!0)},o(i){A(n,i),t=!1},d(i){i&&y(e),n&&n.d(i)}}}function Ku(s){let e,t;const r=s[3].default,n=de(r,s,s[2],null);return{c(){e=b("ol"),n&&n.c(),p(e,"start",s[1]),p(e,"class","svelte-1dicnom")},m(i,l){k(i,e,l),n&&n.m(e,null),t=!0},p(i,l){n&&n.p&&(!t||l&4)&&pe(n,r,i,i[2],t?he(r,i[2],l,null):me(i[2]),null),(!t||l&2)&&p(e,"start",i[1])},i(i){t||(S(n,i),t=!0)},o(i){A(n,i),t=!1},d(i){i&&y(e),n&&n.d(i)}}}function Zu(s){let e,t,r,n;const i=[Ku,Wu],l=[];function a(o,c){return o[0]?0:1}return e=a(s),t=l[e]=i[e](s),{c(){t.c(),r=ge()},m(o,c){l[e].m(o,c),k(o,r,c),n=!0},p(o,[c]){let u=e;e=a(o),e===u?l[e].p(o,c):(ie(),A(l[u],1,1,()=>{l[u]=null}),le(),t=l[e],t?t.p(o,c):(t=l[e]=i[e](o),t.c()),S(t,1),t.m(r.parentNode,r))},i(o){n||(S(t),n=!0)},o(o){A(t),n=!1},d(o){l[e].d(o),o&&y(r)}}}function Xu(s,e,t){let{$$slots:r={},$$scope:n}=e,{ordered:i}=e,{start:l}=e;return s.$$set=a=>{"ordered"in a&&t(0,i=a.ordered),"start"in a&&t(1,l=a.start),"$$scope"in a&&t(2,n=a.$$scope)},[i,l,n,r]}class Ji extends ee{constructor(e){super(),X(this,e,Xu,Zu,Z,{ordered:0,start:1})}}function ef(s){let e,t;const r=s[1].default,n=de(r,s,s[0],null);return{c(){e=b("li"),n&&n.c(),p(e,"class","svelte-fm7yqp")},m(i,l){k(i,e,l),n&&n.m(e,null),t=!0},p(i,[l]){n&&n.p&&(!t||l&1)&&pe(n,r,i,i[0],t?he(r,i[0],l,null):me(i[0]),null)},i(i){t||(S(n,i),t=!0)},o(i){A(n,i),t=!1},d(i){i&&y(e),n&&n.d(i)}}}function tf(s,e,t){let{$$slots:r={},$$scope:n}=e;return s.$$set=i=>{"$$scope"in i&&t(0,n=i.$$scope)},[n,r]}class Gi extends ee{constructor(e){super(),X(this,e,tf,ef,Z,{})}}function nf(s){let e,t=s[0].replace(/`/g,"")+"",r;return{c(){e=b("code"),r=ae(t),p(e,"class","svelte-we39e")},m(n,i){k(n,e,i),g(e,r)},p(n,[i]){i&1&&t!==(t=n[0].replace(/`/g,"")+"")&&Pe(r,t)},i:U,o:U,d(n){n&&y(e)}}}function rf(s,e,t){let{raw:r}=e;return s.$$set=n=>{"raw"in n&&t(0,r=n.raw)},[r]}class sf extends ee{constructor(e){super(),X(this,e,rf,nf,Z,{raw:0})}}function lf(s){let e,t;const r=s[1].default,n=de(r,s,s[0],null);return{c(){e=b("p"),n&&n.c(),p(e,"class","svelte-jw73bw")},m(i,l){k(i,e,l),n&&n.m(e,null),t=!0},p(i,[l]){n&&n.p&&(!t||l&1)&&pe(n,r,i,i[0],t?he(r,i[0],l,null):me(i[0]),null)},i(i){t||(S(n,i),t=!0)},o(i){A(n,i),t=!1},d(i){i&&y(e),n&&n.d(i)}}}function of(s,e,t){let{$$slots:r={},$$scope:n}=e;return s.$$set=i=>{"$$scope"in i&&t(0,n=i.$$scope)},[n,r]}class Qi extends ee{constructor(e){super(),X(this,e,of,lf,Z,{})}}function af(s){let e;return{c(){e=ae(s[0])},m(t,r){k(t,e,r)},p(t,[r]){r&1&&Pe(e,t[0])},i:U,o:U,d(t){t&&y(e)}}}function cf(s,e,t){let{text:r}=e;return s.$$set=n=>{"text"in n&&t(0,r=n.text)},[r]}class Yi extends ee{constructor(e){super(),X(this,e,cf,af,Z,{text:0})}}const uf="/assets/delete-f3f148b5.svg",ff="/assets/CopyIcon-6270aedf.svg",Zs="/assets/UserIcon-57b535eb.svg",Xs="/assets/RobotIcon-76293781.svg",df="/assets/send-8e88dbd9.svg",hf="/assets/wait-8f30b8f8.svg",pf="/assets/upload-icon-8c25e619.svg",mf="/assets/pdf-icon-d4c18e5d.svg",gf="modulepreload",_f=function(s){return"/"+s},ei={},bf=function(e,t,r){if(!t||t.length===0)return e();const n=document.getElementsByTagName("link");return Promise.all(t.map(i=>{if(i=_f(i),i in ei)return;ei[i]=!0;const l=i.endsWith(".css"),a=l?'[rel="stylesheet"]':"";if(!!r)for(let u=n.length-1;u>=0;u--){const f=n[u];if(f.href===i&&(!l||f.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${i}"]${a}`))return;const c=document.createElement("link");if(c.rel=l?"stylesheet":gf,l||(c.as="script",c.crossOrigin=""),c.href=i,document.head.appendChild(c),l)return new Promise((u,f)=>{c.addEventListener("load",u),c.addEventListener("error",()=>f(new Error(`Unable to preload CSS for ${i}`)))})})).then(()=>e())};async function vf(){const s=await bf(()=>import("./pdf-ea9598b5.js"),[]);return s.GlobalWorkerOptions.workerSrc="/workers/pdf.worker.min.mjs",s}function wf(s){const t=/^D:(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})/.exec(s);if(t){const r=parseInt(t[1],10),n=parseInt(t[2],10)-1,i=parseInt(t[3],10),l=parseInt(t[4],10),a=parseInt(t[5],10),o=parseInt(t[6],10);return new Date(r,n,i,l,a,o).toISOString().split("T")[0]}return"Unknown Date"}async function yf(s){try{const e=new FileReader,t=await vf();return new Promise((r,n)=>{e.onload=async i=>{const l=new Uint8Array(i.target.result),o=await t.getDocument({data:l}).promise,c=o.numPages;let u="";for(let E=1;E<=c;E++){const O=await(await o.getPage(E)).getTextContent();u+=O.items.map(F=>"str"in F?F.str:"").join(" ")}const f=u.split(/\s+/).length,h=(await o.getMetadata()).info,_=s.name,m=h.Title||"Untitled",w=h.Author||"Unknown Author",v=h.CreationDate?wf(h.CreationDate):"Unknown Date";r(`The user uploaded a PDF titled "${m}" with a file name of "${_}". It has ${c} pages and ${f} words. File metadata includes Author: "${w}" and creation date: ${v}. The extracted text is as follows: ${u}`)},e.onerror=n,e.readAsArrayBuffer(s)})}catch(e){return console.error("Error processing PDF:",e),Promise.reject("Failed to load the PDF file.")}}function ti(s,e,t){const r=s.slice();return r[53]=e[t],r[55]=t,r}function kf(s){let e;return{c(){e=ae("SmoothGPT")},m(t,r){k(t,e,r)},p:U,d(t){t&&y(e)}}}function Of(s){let e=(s[3][s[2]].title||"SmoothGPT")+"",t;return{c(){t=ae(e)},m(r,n){k(r,t,n)},p(r,n){n[0]&12&&e!==(e=(r[3][r[2]].title||"SmoothGPT")+"")&&Pe(t,e)},d(r){r&&y(t)}}}function ni(s){let e,t;return e=new Ca({}),e.$on("settings-changed",ra),{c(){K(e.$$.fragment)},m(r,n){Y(e,r,n),t=!0},p:U,i(r){t||(S(e.$$.fragment,r),t=!0)},o(r){A(e.$$.fragment,r),t=!1},d(r){W(e,r)}}}function ri(s){let e,t;return e=new Ia({}),{c(){K(e.$$.fragment)},m(r,n){Y(e,r,n),t=!0},i(r){t||(S(e.$$.fragment,r),t=!0)},o(r){A(e.$$.fragment,r),t=!1},d(r){W(e,r)}}}function Sf(s){let e;return{c(){e=b("div"),e.innerHTML="=t){if(S>r)b[c][1]=r;else{if(f===1)return[];b.splice(c,1),c--,f--}continue}b[c][2]=t,S>r&&b.push([o,r,S])}}}return b}}class _{toSVGPath(){throw new Error("Abstract method `toSVGPath` must be implemented.")}get box(){throw new Error("Abstract getter `box` must be implemented.")}serialize(A,o){throw new Error("Abstract method `serialize` must be implemented.")}get free(){return this instanceof C}}class U extends _{#t;#e;constructor(A,o){super(),this.#e=A,this.#t=o}toSVGPath(){const A=[];for(const o of this.#e){let[d,u]=o;A.push(`M${d} ${u}`);for(let b=2;b0){I=U-Math.floor(B/4/U);break}if(v.canvas.width=v.canvas.height=0,v.font=S,I){const B=I/(I+O);return C.set(c,B),B}return C.set(c,F),F}function u(c,f,v){const S=document.createElement("span"),M={angle:0,canvasWidth:0,hasText:f.str!=="",hasEOL:f.hasEOL,fontSize:0};c._textDivs.push(S);const I=y.Util.transform(c._transform,f.transform);let O=Math.atan2(I[1],I[0]);const N=v[f.fontName];N.vertical&&(O+=Math.PI/2);const B=c._fontInspectorEnabled&&N.fontSubstitution||N.fontFamily,q=Math.hypot(I[2],I[3]),st=q*d(B);let X,H;O===0?(X=I[4],H=I[5]-st):(X=I[4]+st*Math.sin(O),H=I[5]-st*Math.cos(O));const G="calc(var(--scale-factor)*",Y=S.style;c._container===c._rootContainer?(Y.left=`${(100*X/c._pageWidth).toFixed(2)}%`,Y.top=`${(100*H/c._pageHeight).toFixed(2)}%`):(Y.left=`${G}${X.toFixed(2)}px)`,Y.top=`${G}${H.toFixed(2)}px)`),Y.fontSize=`${G}${q.toFixed(2)}px)`,Y.fontFamily=B,M.fontSize=q,S.setAttribute("role","presentation"),S.textContent=f.str,S.dir=f.dir,c._fontInspectorEnabled&&(S.dataset.fontName=N.fontSubstitutionLoadedName||f.fontName),O!==0&&(M.angle=O*(180/Math.PI));let Q=!1;if(f.str.length>1)Q=!0;else if(f.str!==" "&&f.transform[0]!==f.transform[3]){const K=Math.abs(f.transform[0]),at=Math.abs(f.transform[3]);K!==at&&Math.max(K,at)/Math.min(K,at)>1.5&&(Q=!0)}Q&&(M.canvasWidth=N.vertical?f.height:f.width),c._textDivProperties.set(S,M),c._isReadableStream&&c._layoutText(S)}function b(c){const{div:f,scale:v,properties:S,ctx:M,prevFontSize:I,prevFontFamily:O}=c,{style:N}=f;let B="";if(S.canvasWidth!==0&&S.hasText){const{fontFamily:q}=N,{canvasWidth:st,fontSize:X}=S;(I!==X||O!==q)&&(M.font=`${X*v}px ${q}`,c.prevFontSize=X,c.prevFontFamily=q);const{width:H}=M.measureText(f.textContent);H>0&&(B=`scaleX(${st*v/H})`)}S.angle!==0&&(B=`rotate(${S.angle}deg) ${B}`),B.length>0&&(N.transform=B)}function s(c){if(c._canceled)return;const f=c._textDivs,v=c._capability;if(f.length>_){v.resolve();return}if(!c._isReadableStream)for(const M of f)c._layoutText(M);v.resolve()}class g{constructor({textContentSource:f,container:v,viewport:S,textDivs:M,textDivProperties:I,textContentItemsStr:O}){this._textContentSource=f,this._isReadableStream=f instanceof ReadableStream,this._container=this._rootContainer=v,this._textDivs=M||[],this._textContentItemsStr=O||[],this._fontInspectorEnabled=!!globalThis.FontInspector?.enabled,this._reader=null,this._textDivProperties=I||new WeakMap,this._canceled=!1,this._capability=Promise.withResolvers(),this._layoutTextParams={prevFontSize:null,prevFontFamily:null,div:null,scale:S.scale*(globalThis.devicePixelRatio||1),properties:null,ctx:A()};const{pageWidth:N,pageHeight:B,pageX:q,pageY:st}=S.rawDims;this._transform=[1,0,0,-1,-q,st+B],this._pageWidth=N,this._pageHeight=B,(0,z.setLayerDimensions)(v,S),this._capability.promise.finally(()=>{this._layoutTextParams=null}).catch(()=>{})}get promise(){return this._capability.promise}cancel(){this._canceled=!0,this._reader&&(this._reader.cancel(new y.AbortException("TextLayer task cancelled.")).catch(()=>{}),this._reader=null),this._capability.reject(new y.AbortException("TextLayer task cancelled."))}_processItems(f,v){for(const S of f){if(S.str===void 0){if(S.type==="beginMarkedContentProps"||S.type==="beginMarkedContent"){const M=this._container;this._container=document.createElement("span"),this._container.classList.add("markedContent"),S.id!==null&&this._container.setAttribute("id",`${S.id}`),M.append(this._container)}else S.type==="endMarkedContent"&&(this._container=this._container.parentNode);continue}this._textContentItemsStr.push(S.str),u(this,S,v)}}_layoutText(f){const v=this._layoutTextParams.properties=this._textDivProperties.get(f);if(this._layoutTextParams.div=f,b(this._layoutTextParams),v.hasText&&this._container.append(f),v.hasEOL){const S=document.createElement("br");S.setAttribute("role","presentation"),this._container.append(S)}}_render(){const{promise:f,resolve:v,reject:S}=Promise.withResolvers();let M=Object.create(null);if(this._isReadableStream){const I=()=>{this._reader.read().then(({value:O,done:N})=>{if(N){v();return}Object.assign(M,O.styles),this._processItems(O.items,M),I()},S)};this._reader=this._textContentSource.getReader(),I()}else if(this._textContentSource){const{items:I,styles:O}=this._textContentSource;this._processItems(I,O),v()}else throw new Error('No "textContentSource" parameter specified.');f.then(()=>{M=null,s(this)},this._capability.reject)}}function t(c){const f=new g(c);return f._render(),f}function r({container:c,viewport:f,textDivs:v,textDivProperties:S,mustRotate:M=!0,mustRescale:I=!0}){if(M&&(0,z.setLayerDimensions)(c,{rotation:f.rotation}),I){const O=A(),B={prevFontSize:null,prevFontFamily:null,div:null,scale:f.scale*(globalThis.devicePixelRatio||1),properties:null,ctx:O};for(const q of v)B.properties=S.get(q),B.div=q,b(B)}}},585:(dt,et,V)=>{V.d(et,{PDFDataTransportStream:()=>_});var y=V(292),z=V(419);class _{constructor(T,{disableRange:A=!1,disableStream:o=!1}){(0,y.assert)(T,'PDFDataTransportStream - missing required "pdfDataRangeTransport" argument.');const{length:d,initialData:u,progressiveDone:b,contentDispositionFilename:s}=T;if(this._queuedChunks=[],this._progressiveDone=b,this._contentDispositionFilename=s,u?.length>0){const g=u instanceof Uint8Array&&u.byteLength===u.buffer.byteLength?u.buffer:new Uint8Array(u).buffer;this._queuedChunks.push(g)}this._pdfDataRangeTransport=T,this._isStreamingSupported=!o,this._isRangeSupported=!A,this._contentLength=d,this._fullRequestReader=null,this._rangeReaders=[],T.addRangeListener((g,t)=>{this._onReceiveData({begin:g,chunk:t})}),T.addProgressListener((g,t)=>{this._onProgress({loaded:g,total:t})}),T.addProgressiveReadListener(g=>{this._onReceiveData({chunk:g})}),T.addProgressiveDoneListener(()=>{this._onProgressiveDone()}),T.transportReady()}_onReceiveData({begin:T,chunk:A}){const o=A instanceof Uint8Array&&A.byteLength===A.buffer.byteLength?A.buffer:new Uint8Array(A).buffer;if(T===void 0)this._fullRequestReader?this._fullRequestReader._enqueue(o):this._queuedChunks.push(o);else{const d=this._rangeReaders.some(function(u){return u._begin!==T?!1:(u._enqueue(o),!0)});(0,y.assert)(d,"_onReceiveData - no `PDFDataTransportStreamRangeReader` instance found.")}}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}_onProgress(T){T.total===void 0?this._rangeReaders[0]?.onProgress?.({loaded:T.loaded}):this._fullRequestReader?.onProgress?.({loaded:T.loaded,total:T.total})}_onProgressiveDone(){this._fullRequestReader?.progressiveDone(),this._progressiveDone=!0}_removeRangeReader(T){const A=this._rangeReaders.indexOf(T);A>=0&&this._rangeReaders.splice(A,1)}getFullReader(){(0,y.assert)(!this._fullRequestReader,"PDFDataTransportStream.getFullReader can only be called once.");const T=this._queuedChunks;return this._queuedChunks=null,new U(this,T,this._progressiveDone,this._contentDispositionFilename)}getRangeReader(T,A){if(A<=this._progressiveDataLength)return null;const o=new F(this,T,A);return this._pdfDataRangeTransport.requestDataRange(T,A),this._rangeReaders.push(o),o}cancelAllRequests(T){this._fullRequestReader?.cancel(T);for(const A of this._rangeReaders.slice(0))A.cancel(T);this._pdfDataRangeTransport.abort()}}class U{constructor(T,A,o=!1,d=null){this._stream=T,this._done=o||!1,this._filename=(0,z.isPdfFile)(d)?d:null,this._queuedChunks=A||[],this._loaded=0;for(const u of this._queuedChunks)this._loaded+=u.byteLength;this._requests=[],this._headersReady=Promise.resolve(),T._fullRequestReader=this,this.onProgress=null}_enqueue(T){this._done||(this._requests.length>0?this._requests.shift().resolve({value:T,done:!1}):this._queuedChunks.push(T),this._loaded+=T.byteLength)}get headersReady(){return this._headersReady}get filename(){return this._filename}get isRangeSupported(){return this._stream._isRangeSupported}get isStreamingSupported(){return this._stream._isStreamingSupported}get contentLength(){return this._stream._contentLength}async read(){if(this._queuedChunks.length>0)return{value:this._queuedChunks.shift(),done:!1};if(this._done)return{value:void 0,done:!0};const T=Promise.withResolvers();return this._requests.push(T),T.promise}cancel(T){this._done=!0;for(const A of this._requests)A.resolve({value:void 0,done:!0});this._requests.length=0}progressiveDone(){this._done||(this._done=!0)}}class F{constructor(T,A,o){this._stream=T,this._begin=A,this._end=o,this._queuedChunk=null,this._requests=[],this._done=!1,this.onProgress=null}_enqueue(T){if(!this._done){if(this._requests.length===0)this._queuedChunk=T;else{this._requests.shift().resolve({value:T,done:!1});for(const o of this._requests)o.resolve({value:void 0,done:!0});this._requests.length=0}this._done=!0,this._stream._removeRangeReader(this)}}get isStreamingSupported(){return!1}async read(){if(this._queuedChunk){const A=this._queuedChunk;return this._queuedChunk=null,{value:A,done:!1}}if(this._done)return{value:void 0,done:!0};const T=Promise.withResolvers();return this._requests.push(T),T.promise}cancel(T){this._done=!0;for(const A of this._requests)A.resolve({value:void 0,done:!0});this._requests.length=0,this._stream._removeRangeReader(this)}}},164:(dt,et,V)=>{V.d(et,{GlobalWorkerOptions:()=>y});class y{static#t=null;static#e="";static get workerPort(){return this.#t}static set workerPort(_){if(!(typeof Worker<"u"&&_ instanceof Worker)&&_!==null)throw new Error("Invalid `workerPort` type.");this.#t=_}static get workerSrc(){return this.#e}static set workerSrc(_){if(typeof _!="string")throw new Error("Invalid `workerSrc` type.");this.#e=_}}},284:(dt,et,V)=>{V.d(et,{XfaLayer:()=>z});var y=V(50);class z{static setupStorage(U,F,C,T,A){const o=T.getValue(F,{value:null});switch(C.name){case"textarea":if(o.value!==null&&(U.textContent=o.value),A==="print")break;U.addEventListener("input",d=>{T.setValue(F,{value:d.target.value})});break;case"input":if(C.attributes.type==="radio"||C.attributes.type==="checkbox"){if(o.value===C.attributes.xfaOn?U.setAttribute("checked",!0):o.value===C.attributes.xfaOff&&U.removeAttribute("checked"),A==="print")break;U.addEventListener("change",d=>{T.setValue(F,{value:d.target.checked?d.target.getAttribute("xfaOn"):d.target.getAttribute("xfaOff")})})}else{if(o.value!==null&&U.setAttribute("value",o.value),A==="print")break;U.addEventListener("input",d=>{T.setValue(F,{value:d.target.value})})}break;case"select":if(o.value!==null){U.setAttribute("value",o.value);for(const d of C.children)d.attributes.value===o.value?d.attributes.selected=!0:d.attributes.hasOwnProperty("selected")&&delete d.attributes.selected}U.addEventListener("input",d=>{const u=d.target.options,b=u.selectedIndex===-1?"":u[u.selectedIndex].value;T.setValue(F,{value:b})});break}}static setAttributes({html:U,element:F,storage:C=null,intent:T,linkService:A}){const{attributes:o}=F,d=U instanceof HTMLAnchorElement;o.type==="radio"&&(o.name=`${o.name}-${T}`);for(const[u,b]of Object.entries(o))if(b!=null)switch(u){case"class":b.length&&U.setAttribute(u,b.join(" "));break;case"dataId":break;case"id":U.setAttribute("data-element-id",b);break;case"style":Object.assign(U.style,b);break;case"textContent":U.textContent=b;break;default:(!d||u!=="href"&&u!=="newWindow")&&U.setAttribute(u,b)}d&&A.addLinkAttributes(U,o.href,o.newWindow),C&&o.dataId&&this.setupStorage(U,o.dataId,F,C)}static render(U){const F=U.annotationStorage,C=U.linkService,T=U.xfaHtml,A=U.intent||"display",o=document.createElement(T.name);T.attributes&&this.setAttributes({html:o,element:T,intent:A,linkService:C});const d=A!=="richText",u=U.div;if(u.append(o),U.viewport){const g=`matrix(${U.viewport.transform.join(",")})`;u.style.transform=g}d&&u.setAttribute("class","xfaLayer xfaFont");const b=[];if(T.children.length===0){if(T.value){const g=document.createTextNode(T.value);o.append(g),d&&y.XfaText.shouldBuildText(T.name)&&b.push(g)}return{textDivs:b}}const s=[[T,-1,o]];for(;s.length>0;){const[g,t,r]=s.at(-1);if(t+1===g.children.length){s.pop();continue}const c=g.children[++s.at(-1)[1]];if(c===null)continue;const{name:f}=c;if(f==="#text"){const S=document.createTextNode(c.value);b.push(S),r.append(S);continue}const v=c?.attributes?.xmlns?document.createElementNS(c.attributes.xmlns,f):document.createElement(f);if(r.append(v),c.attributes&&this.setAttributes({html:v,element:c,storage:F,intent:A,linkService:C}),c.children?.length>0)s.push([c,-1,v]);else if(c.value){const S=document.createTextNode(c.value);d&&y.XfaText.shouldBuildText(f)&&b.push(S),v.append(S)}}for(const g of u.querySelectorAll(".xfaNonInteractive input, .xfaNonInteractive textarea"))g.setAttribute("readOnly",!0);return{textDivs:b}}static update(U){const F=`matrix(${U.viewport.transform.join(",")})`;U.div.style.transform=F,U.div.hidden=!1}}},50:(dt,et,V)=>{V.d(et,{XfaText:()=>y});class y{static textContent(_){const U=[],F={items:U,styles:Object.create(null)};function C(T){if(!T)return;let A=null;const o=T.name;if(o==="#text")A=T.value;else if(y.shouldBuildText(o))T?.attributes?.textContent?A=T.attributes.textContent:T.value&&(A=T.value);else return;if(A!==null&&U.push({str:A}),!!T.children)for(const d of T.children)C(d)}return C(_),F}static shouldBuildText(_){return!(_==="textarea"||_==="input"||_==="option"||_==="select")}}},228:(dt,et,V)=>{V.a(dt,async(y,z)=>{try{V.d(et,{AbortException:()=>_.AbortException,AnnotationEditorLayer:()=>T.AnnotationEditorLayer,AnnotationEditorParamsType:()=>_.AnnotationEditorParamsType,AnnotationEditorType:()=>_.AnnotationEditorType,AnnotationEditorUIManager:()=>A.AnnotationEditorUIManager,AnnotationLayer:()=>o.AnnotationLayer,AnnotationMode:()=>_.AnnotationMode,CMapCompressionType:()=>_.CMapCompressionType,ColorPicker:()=>d.ColorPicker,DOMSVGFactory:()=>F.DOMSVGFactory,DrawLayer:()=>u.DrawLayer,FeatureTest:()=>_.FeatureTest,GlobalWorkerOptions:()=>b.GlobalWorkerOptions,ImageKind:()=>_.ImageKind,InvalidPDFException:()=>_.InvalidPDFException,MissingPDFException:()=>_.MissingPDFException,OPS:()=>_.OPS,Outliner:()=>s.Outliner,PDFDataRangeTransport:()=>U.PDFDataRangeTransport,PDFDateString:()=>F.PDFDateString,PDFWorker:()=>U.PDFWorker,PasswordResponses:()=>_.PasswordResponses,PermissionFlag:()=>_.PermissionFlag,PixelsPerInch:()=>F.PixelsPerInch,RenderingCancelledException:()=>F.RenderingCancelledException,UnexpectedResponseException:()=>_.UnexpectedResponseException,Util:()=>_.Util,VerbosityLevel:()=>_.VerbosityLevel,XfaLayer:()=>g.XfaLayer,build:()=>U.build,createValidAbsoluteUrl:()=>_.createValidAbsoluteUrl,fetchData:()=>F.fetchData,getDocument:()=>U.getDocument,getFilenameFromUrl:()=>F.getFilenameFromUrl,getPdfFilenameFromUrl:()=>F.getPdfFilenameFromUrl,getXfaPageViewport:()=>F.getXfaPageViewport,isDataScheme:()=>F.isDataScheme,isPdfFile:()=>F.isPdfFile,noContextMenu:()=>F.noContextMenu,normalizeUnicode:()=>_.normalizeUnicode,renderTextLayer:()=>C.renderTextLayer,setLayerDimensions:()=>F.setLayerDimensions,shadow:()=>_.shadow,updateTextLayer:()=>C.updateTextLayer,version:()=>U.version});var _=V(292),U=V(831),F=V(419),C=V(814),T=V(731),A=V(830),o=V(976),d=V(259),u=V(47),b=V(164),s=V(61),g=V(284),t=y([U]);U=(t.then?(await t)():t)[0];const r="4.1.392",c="fcb76a78d";z()}catch(r){z(r)}})},178:(dt,et,V)=>{V.d(et,{MessageHandler:()=>F});var y=V(292);const z={UNKNOWN:0,DATA:1,ERROR:2},_={UNKNOWN:0,CANCEL:1,CANCEL_COMPLETE:2,CLOSE:3,ENQUEUE:4,ERROR:5,PULL:6,PULL_COMPLETE:7,START_COMPLETE:8};function U(C){switch(C instanceof Error||typeof C=="object"&&C!==null||(0,y.unreachable)('wrapReason: Expected "reason" to be a (possibly cloned) Error.'),C.name){case"AbortException":return new y.AbortException(C.message);case"MissingPDFException":return new y.MissingPDFException(C.message);case"PasswordException":return new y.PasswordException(C.message,C.code);case"UnexpectedResponseException":return new y.UnexpectedResponseException(C.message,C.status);case"UnknownErrorException":return new y.UnknownErrorException(C.message,C.details);default:return new y.UnknownErrorException(C.message,C.toString())}}class F{constructor(T,A,o){this.sourceName=T,this.targetName=A,this.comObj=o,this.callbackId=1,this.streamId=1,this.streamSinks=Object.create(null),this.streamControllers=Object.create(null),this.callbackCapabilities=Object.create(null),this.actionHandler=Object.create(null),this._onComObjOnMessage=d=>{const u=d.data;if(u.targetName!==this.sourceName)return;if(u.stream){this.#e(u);return}if(u.callback){const s=u.callbackId,g=this.callbackCapabilities[s];if(!g)throw new Error(`Cannot resolve callback ${s}`);if(delete this.callbackCapabilities[s],u.callback===z.DATA)g.resolve(u.data);else if(u.callback===z.ERROR)g.reject(U(u.reason));else throw new Error("Unexpected callback case");return}const b=this.actionHandler[u.action];if(!b)throw new Error(`Unknown action from worker: ${u.action}`);if(u.callbackId){const s=this.sourceName,g=u.sourceName;new Promise(function(t){t(b(u.data))}).then(function(t){o.postMessage({sourceName:s,targetName:g,callback:z.DATA,callbackId:u.callbackId,data:t})},function(t){o.postMessage({sourceName:s,targetName:g,callback:z.ERROR,callbackId:u.callbackId,reason:U(t)})});return}if(u.streamId){this.#t(u);return}b(u.data)},o.addEventListener("message",this._onComObjOnMessage)}on(T,A){const o=this.actionHandler;if(o[T])throw new Error(`There is already an actionName called "${T}"`);o[T]=A}send(T,A,o){this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:T,data:A},o)}sendWithPromise(T,A,o){const d=this.callbackId++,u=Promise.withResolvers();this.callbackCapabilities[d]=u;try{this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:T,callbackId:d,data:A},o)}catch(b){u.reject(b)}return u.promise}sendWithStream(T,A,o,d){const u=this.streamId++,b=this.sourceName,s=this.targetName,g=this.comObj;return new ReadableStream({start:t=>{const r=Promise.withResolvers();return this.streamControllers[u]={controller:t,startCall:r,pullCall:null,cancelCall:null,isClosed:!1},g.postMessage({sourceName:b,targetName:s,action:T,streamId:u,data:A,desiredSize:t.desiredSize},d),r.promise},pull:t=>{const r=Promise.withResolvers();return this.streamControllers[u].pullCall=r,g.postMessage({sourceName:b,targetName:s,stream:_.PULL,streamId:u,desiredSize:t.desiredSize}),r.promise},cancel:t=>{(0,y.assert)(t instanceof Error,"cancel must have a valid reason");const r=Promise.withResolvers();return this.streamControllers[u].cancelCall=r,this.streamControllers[u].isClosed=!0,g.postMessage({sourceName:b,targetName:s,stream:_.CANCEL,streamId:u,reason:U(t)}),r.promise}},o)}#t(T){const A=T.streamId,o=this.sourceName,d=T.sourceName,u=this.comObj,b=this,s=this.actionHandler[T.action],g={enqueue(t,r=1,c){if(this.isCancelled)return;const f=this.desiredSize;this.desiredSize-=r,f>0&&this.desiredSize<=0&&(this.sinkCapability=Promise.withResolvers(),this.ready=this.sinkCapability.promise),u.postMessage({sourceName:o,targetName:d,stream:_.ENQUEUE,streamId:A,chunk:t},c)},close(){this.isCancelled||(this.isCancelled=!0,u.postMessage({sourceName:o,targetName:d,stream:_.CLOSE,streamId:A}),delete b.streamSinks[A])},error(t){(0,y.assert)(t instanceof Error,"error must have a valid reason"),!this.isCancelled&&(this.isCancelled=!0,u.postMessage({sourceName:o,targetName:d,stream:_.ERROR,streamId:A,reason:U(t)}))},sinkCapability:Promise.withResolvers(),onPull:null,onCancel:null,isCancelled:!1,desiredSize:T.desiredSize,ready:null};g.sinkCapability.resolve(),g.ready=g.sinkCapability.promise,this.streamSinks[A]=g,new Promise(function(t){t(s(T.data,g))}).then(function(){u.postMessage({sourceName:o,targetName:d,stream:_.START_COMPLETE,streamId:A,success:!0})},function(t){u.postMessage({sourceName:o,targetName:d,stream:_.START_COMPLETE,streamId:A,reason:U(t)})})}#e(T){const A=T.streamId,o=this.sourceName,d=T.sourceName,u=this.comObj,b=this.streamControllers[A],s=this.streamSinks[A];switch(T.stream){case _.START_COMPLETE:T.success?b.startCall.resolve():b.startCall.reject(U(T.reason));break;case _.PULL_COMPLETE:T.success?b.pullCall.resolve():b.pullCall.reject(U(T.reason));break;case _.PULL:if(!s){u.postMessage({sourceName:o,targetName:d,stream:_.PULL_COMPLETE,streamId:A,success:!0});break}s.desiredSize<=0&&T.desiredSize>0&&s.sinkCapability.resolve(),s.desiredSize=T.desiredSize,new Promise(function(g){g(s.onPull?.())}).then(function(){u.postMessage({sourceName:o,targetName:d,stream:_.PULL_COMPLETE,streamId:A,success:!0})},function(g){u.postMessage({sourceName:o,targetName:d,stream:_.PULL_COMPLETE,streamId:A,reason:U(g)})});break;case _.ENQUEUE:if((0,y.assert)(b,"enqueue should have stream controller"),b.isClosed)break;b.controller.enqueue(T.chunk);break;case _.CLOSE:if((0,y.assert)(b,"close should have stream controller"),b.isClosed)break;b.isClosed=!0,b.controller.close(),this.#s(b,A);break;case _.ERROR:(0,y.assert)(b,"error should have stream controller"),b.controller.error(U(T.reason)),this.#s(b,A);break;case _.CANCEL_COMPLETE:T.success?b.cancelCall.resolve():b.cancelCall.reject(U(T.reason)),this.#s(b,A);break;case _.CANCEL:if(!s)break;new Promise(function(g){g(s.onCancel?.(U(T.reason)))}).then(function(){u.postMessage({sourceName:o,targetName:d,stream:_.CANCEL_COMPLETE,streamId:A,success:!0})},function(g){u.postMessage({sourceName:o,targetName:d,stream:_.CANCEL_COMPLETE,streamId:A,reason:U(g)})}),s.sinkCapability.reject(U(T.reason)),s.isCancelled=!0,delete this.streamSinks[A];break;default:throw new Error("Unexpected stream case")}}async#s(T,A){await Promise.allSettled([T.startCall?.promise,T.pullCall?.promise,T.cancelCall?.promise]),delete this.streamControllers[A]}destroy(){this.comObj.removeEventListener("message",this._onComObjOnMessage)}}},651:(dt,et,V)=>{V.d(et,{MurmurHash3_64:()=>U});const y=3285377520,z=4294901760,_=65535;class U{constructor(C){this.h1=C?C&4294967295:y,this.h2=C?C&4294967295:y}update(C){let T,A;if(typeof C=="string"){T=new Uint8Array(C.length*2),A=0;for(let S=0,M=C.length;S
u&&"DeviceGray"!==this.name&&"DeviceRGB"!==this.name){const t=s<=8?new Uint8Array(u):new Uint16Array(u);for(let e=0;e=.99554525?1:this.#p(0,1,1.055*e**(1/2.4)-.055)}#p(e,t,a){return Math.max(e,Math.min(t,a))}#m(e){return e<0?-this.#m(-e):e>8?((e+16)/116)**3:e*CalRGBCS.#h}#b(e,t,a){if(0===e[0]&&0===e[1]&&0===e[2]){a[0]=t[0];a[1]=t[1];a[2]=t[2];return}const r=this.#m(0),i=(1-r)/(1-this.#m(e[0])),n=1-i,s=(1-r)/(1-this.#m(e[1])),o=1-s,c=(1-r)/(1-this.#m(e[2])),l=1-c;a[0]=t[0]*i+n;a[1]=t[1]*s+o;a[2]=t[2]*c+l}#y(e,t,a){if(1===e[0]&&1===e[2]){a[0]=t[0];a[1]=t[1];a[2]=t[2];return}const r=a;this.#u(CalRGBCS.#r,t,r);const i=CalRGBCS.#o;this.#d(e,r,i);this.#u(CalRGBCS.#i,i,a)}#w(e,t,a){const r=a;this.#u(CalRGBCS.#r,t,r);const i=CalRGBCS.#o;this.#f(e,r,i);this.#u(CalRGBCS.#i,i,a)}#a(e,t,a,r,i){const n=this.#p(0,1,e[t]*i),s=this.#p(0,1,e[t+1]*i),o=this.#p(0,1,e[t+2]*i),c=1===n?1:n**this.GR,l=1===s?1:s**this.GG,h=1===o?1:o**this.GB,u=this.MXA*c+this.MXB*l+this.MXC*h,d=this.MYA*c+this.MYB*l+this.MYC*h,f=this.MZA*c+this.MZB*l+this.MZC*h,g=CalRGBCS.#c;g[0]=u;g[1]=d;g[2]=f;const p=CalRGBCS.#l;this.#y(this.whitePoint,g,p);const m=CalRGBCS.#c;this.#b(this.blackPoint,p,m);const b=CalRGBCS.#l;this.#w(CalRGBCS.#s,m,b);const y=CalRGBCS.#c;this.#u(CalRGBCS.#n,b,y);a[r]=255*this.#g(y[0]);a[r+1]=255*this.#g(y[1]);a[r+2]=255*this.#g(y[2])}getRgbItem(e,t,a,r){this.#a(e,t,a,r,1)}getRgbBuffer(e,t,a,r,i,n,s){const o=1/((1<=0&&e0?Math.min(r.xcb,i.PPx-1):Math.min(r.xcb,i.PPx);i.ycb_=a>0?Math.min(r.ycb,i.PPy-1):Math.min(r.ycb,i.PPy);return i}function buildPrecincts(e,t,a){const r=1<0,o=t+10){c=a-i;s&&(r[c-1]+=16);o&&(r[c+1]+=16);r[c]+=4}if(e+1=0;t--){d[t]=o[a];a=l[a]}}else d[f++]=d[0]}if(i){l[s]=u;c[s]=c[u]+1;o[s]=d[0];s++;h=s+n&s+n-1?h:0|Math.min(Math.log(s+n)/.6931471805599453+1,12)}u=e;g+=f;if(r127))){n=0;break}}if(2!==n)continue;if(!t){warn("findDefaultInlineStreamEnd - `lexer.knownCommands` is undefined.");continue}const o=new Lexer(new Stream(a.slice()),t);o._hexStringWarn=()=>{};let c=0;for(;;){const e=o.getObj();if(e===da){n=0;break}if(e instanceof Cmd){const a=t[e.cmd];if(!a){n=0;break}if(a.variableArgs?c<=a.numArgs:c===a.numArgs)break;c=0}else c++}if(2===n)break}else n=0;if(-1===r){warn("findDefaultInlineStreamEnd: Reached the end of the stream without finding a valid EI marker");if(i){warn('... trying to recover by using the last "EI" occurrence.');e.skip(-(e.pos-i))}}let s=4;e.skip(-s);r=e.peekByte();e.skip(s);isWhiteSpace(r)||s--;return e.pos-s-a}findDCTDecodeInlineStreamEnd(e){const t=e.pos;let a,r,i=!1;for(;-1!==(a=e.getByte());)if(255===a){switch(e.getByte()){case 0:break;case 255:e.skip(-1);break;case 217:i=!0;break;case 192:case 193:case 194:case 195:case 197:case 198:case 199:case 201:case 202:case 203:case 205:case 206:case 207:case 196:case 204:case 218:case 219:case 220:case 221:case 222:case 223:case 224:case 225:case 226:case 227:case 228:case 229:case 230:case 231:case 232:case 233:case 234:case 235:case 236:case 237:case 238:case 239:case 254:r=e.getUint16();r>2?e.skip(r-2):e.skip(-2)}if(i)break}const n=e.pos-t;if(-1===a){warn("Inline DCTDecode image stream: EOI marker not found, searching for /EI/ instead.");e.skip(-n);return this.findDefaultInlineStreamEnd(e)}this.inlineStreamSkipEI(e);return n}findASCII85DecodeInlineStreamEnd(e){const t=e.pos;let a;for(;-1!==(a=e.getByte());)if(126===a){const t=e.pos;a=e.peekByte();for(;isWhiteSpace(a);){e.skip();a=e.peekByte()}if(62===a){e.skip();break}if(e.pos>t){const t=e.peekBytes(2);if(69===t[0]&&73===t[1])break}}const r=e.pos-t;if(-1===a){warn("Inline ASCII85Decode image stream: EOD marker not found, searching for /EI/ instead.");e.skip(-r);return this.findDefaultInlineStreamEnd(e)}this.inlineStreamSkipEI(e);return r}findASCIIHexDecodeInlineStreamEnd(e){const t=e.pos;let a;for(;-1!==(a=e.getByte())&&62!==a;);const r=e.pos-t;if(-1===a){warn("Inline ASCIIHexDecode image stream: EOD marker not found, searching for /EI/ instead.");e.skip(-r);return this.findDefaultInlineStreamEnd(e)}this.inlineStreamSkipEI(e);return r}inlineStreamSkipEI(e){let t,a=0;for(;-1!==(t=e.getByte());)if(0===a)a=69===t?1:0;else if(1===a)a=73===t?2:0;else if(2===a)break}makeInlineImage(e){const t=this.lexer,a=t.stream,r=Object.create(null);let i;for(;!isCmd(this.buf1,"ID")&&this.buf1!==da;){if(!(this.buf1 instanceof Name))throw new FormatError("Dictionary key must be a name object");const t=this.buf1.name;this.shift();if(this.buf1===da)break;r[t]=this.getObj(e)}-1!==t.beginInlineImagePos&&(i=a.pos-t.beginInlineImagePos);const n=this.xref.fetchIfRef(r.F||r.Filter);let s;if(n instanceof Name)s=n.name;else if(Array.isArray(n)){const e=this.xref.fetchIfRef(n[0]);e instanceof Name&&(s=e.name)}const o=a.pos;let c,l;switch(s){case"DCT":case"DCTDecode":c=this.findDCTDecodeInlineStreamEnd(a);break;case"A85":case"ASCII85Decode":c=this.findASCII85DecodeInlineStreamEnd(a);break;case"AHx":case"ASCIIHexDecode":c=this.findASCIIHexDecodeInlineStreamEnd(a);break;default:c=this.findDefaultInlineStreamEnd(a)}if(c<1e3&&i>0){const e=a.pos;a.pos=t.beginInlineImagePos;l=function getInlineImageCacheKey(e){const t=[],a=e.length;let r=0;for(;r>16;o+=2;i++}else if(14===c){if(i>=4){i-=4;if(this.seacAnalysisEnabled){e.seac=n.slice(i,i+4);return!1}}l=pr[c]}else if(c>=32&&c<=246){n[i]=c-139;i++}else if(c>=247&&c<=254){n[i]=c<251?(c-247<<8)+t[o]+108:-(c-251<<8)-t[o]-108;o++;i++}else if(255===c){n[i]=(t[o]<<24|t[o+1]<<16|t[o+2]<<8|t[o+3])/65536;o+=4;i++}else if(19===c||20===c){e.hints+=i>>1;if(0===e.hints){t.copyWithin(o-1,o,-1);o-=1;s-=1;continue}o+=e.hints+7>>3;i%=2;l=pr[c]}else{if(10===c||29===c){const t=10===c?a:r;if(!t){l=pr[c];warn("Missing subrsIndex for "+l.id);return!1}let s=32768;t.count<1240?s=107:t.count<33900&&(s=1131);const o=n[--i]+s;if(o<0||o>=t.count||isNaN(o)){l=pr[c];warn("Out of bounds subrIndex for "+l.id);return!1}e.stackSize=i;e.callDepth++;if(!this.parseCharString(e,t.get(o),a,r))return!1;e.callDepth--;i=e.stackSize;continue}if(11===c){e.stackSize=i;return!0}if(0===c&&o===t.length){t[o-1]=14;l=pr[14]}else{if(9===c){t.copyWithin(o-1,o,-1);o-=1;s-=1;continue}l=pr[c]}}if(l){if(l.stem){e.hints+=i>>1;if(3===c||23===c)e.hasVStems=!0;else if(e.hasVStems&&(1===c||18===c)){warn("CFF stem hints are in wrong order");t[o-1]=1===c?3:23}}if("min"in l&&!e.undefStack&&i