All new
alle new
This commit is contained in:
1 parent
da64472251
commit
5b20adee48
1605 files changed
+396517
-1674
No files matched your search
+29
@@ -0,0 +1,29 @@
|
||||
/**
|
||||
* @licstart The following is the entire license notice for the
|
||||
* JavaScript code in this page
|
||||
*
|
||||
* Copyright 2024 Mozilla Foundation
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* @licend The above is the entire license notice for the
|
||||
* JavaScript code in this page
|
||||
*/
|
||||
/**
|
||||
* pdfjsVersion = 6.3.289
|
||||
* pdfjsBuild = 1c8020a7d
|
||||
*/
|
||||
class SandboxSupportBase{constructor(e){this.win=e;this.timeoutIds=new Map;this.commFun=null}destroy(){this.commFun=null;for(const e of this.timeoutIds.values())this.win.clearTimeout(e);this.timeoutIds=null}exportValueToSandbox(e){throw new Error("Not implemented")}importValueFromSandbox(e){throw new Error("Not implemented")}createErrorForSandbox(e){throw new Error("Not implemented")}callSandboxFunction(e,t){if(this.commFun)try{t=this.exportValueToSandbox(t);this.commFun(e,t)}catch(e){this.win.console.error(e)}}createSandboxExternals(){const e={setTimeout:(e,t)=>{if("number"!=typeof e||"number"!=typeof t)return;0===e&&this.win.clearTimeout(this.timeoutIds.get(e));const r=this.win.setTimeout(()=>{this.timeoutIds.delete(e);this.callSandboxFunction("timeoutCb",{callbackId:e,interval:!1})},t);this.timeoutIds.set(e,r)},clearTimeout:e=>{this.win.clearTimeout(this.timeoutIds.get(e));this.timeoutIds.delete(e)},setInterval:(e,t)=>{if("number"!=typeof e||"number"!=typeof t)return;const r=this.win.setInterval(()=>{this.callSandboxFunction("timeoutCb",{callbackId:e,interval:!0})},t);this.timeoutIds.set(e,r)},clearInterval:e=>{this.win.clearInterval(this.timeoutIds.get(e));this.timeoutIds.delete(e)},alert:e=>{"string"==typeof e&&this.win.alert(e)},confirm:e=>"string"==typeof e&&this.win.confirm(e),prompt:(e,t)=>"string"!=typeof e||"string"!=typeof t?null:this.win.prompt(e,t),parseURL:e=>{const t=new this.win.URL(e);return Object.fromEntries(["hash","host","hostname","href","origin","password","pathname","port","protocol","search","searchParams","username"].map(e=>[e,t[e].toString()]))},send:e=>{if(!e)return;const t=new this.win.CustomEvent("updatefromsandbox",{detail:this.importValueFromSandbox(e)});this.win.dispatchEvent(t)}};Object.setPrototypeOf(e,null);return(t,r)=>{try{const i=e[t](...r);return this.exportValueToSandbox(i)}catch(e){throw this.createErrorForSandbox(e?.toString()??"")}}}}class SandboxSupport extends SandboxSupportBase{exportValueToSandbox(e){return JSON.stringify(e,(e,t)=>t instanceof Map?Object.fromEntries(t):t)}importValueFromSandbox(e){return e}createErrorForSandbox(e){return new Error(e)}}class Sandbox{constructor(e,t){this.support=new SandboxSupport(e,this);t.externalCall=this.support.createSandboxExternals();this._module=t;this._alertOnError=0}create(e){const t=['const e=Object.freeze({s:"solid",d:"dashed",b:"beveled",i:"inset",u:"underline"}),t=Object.freeze({visible:0,hidden:1,delay:2}),r=Object.freeze({visible:0,hidden:1,noPrint:2,noView:3}),i=Object.freeze({Times:"Times-Roman",TimesB:"Times-Bold",TimesI:"Times-Italic",TimesBI:"Times-BoldItalic",Helv:"Helvetica",HelvB:"Helvetica-Bold",HelvI:"Helvetica-Oblique",HelvBI:"Helvetica-BoldOblique",Cour:"Courier",CourB:"Courier-Bold",CourI:"Courier-Oblique",CourBI:"Courier-BoldOblique",Symbol:"Symbol",ZapfD:"ZapfDingbats",KaGo:"HeiseiKakuGo-W5-UniJIS-UCS2-H",KaMi:"HeiseiMin-W3-UniJIS-UCS2-H"}),s=Object.freeze({n:"none",i:"invert",p:"push",o:"outline"}),n=Object.freeze({textOnly:0,iconOnly:1,iconTextV:2,textIconV:3,iconTextH:4,textIconH:5,overlay:6}),o=Object.freeze({proportional:0,anamorphic:1}),a=Object.freeze({always:0,never:1,tooBig:2,tooSmall:3}),l=Object.freeze({ch:"check",cr:"cross",di:"diamond",ci:"circle",st:"star",sq:"square"}),u=Object.freeze({blindsH:"BlindsHorizontal",blindsV:"BlindsVertical",boxI:"BoxIn",boxO:"BoxOut",dissolve:"Dissolve",glitterD:"GlitterDown",glitterR:"GlitterRight",glitterRD:"GlitterRightDown",random:"Random",replace:"Replace",splitHI:"SplitHorizontalIn",splitHO:"SplitHorizontalOut",splitVI:"SplitVerticalIn",splitVO:"SplitVerticalOut",wipeD:"WipeDown",wipeL:"WipeLeft",wipeR:"WipeRight",wipeU:"WipeUp"}),c=Object.freeze({none:"NoVary",fitP:"FitPage",fitW:"FitWidth",fitH:"FitHeight",fitV:"FitVisibleWidth",pref:"Preferred",refW:"ReflowWidth"}),h=Object.freeze({IDS_GREATER_THAN:"Invalid value: must be greater than or equal to % s.",IDS_GT_AND_LT:"Invalid value: must be greater than or equal to % s and less than or equal to % s.",IDS_LESS_THAN:"Invalid value: must be less than or equal to % s.",IDS_INVALID_MONTH:"** Invalid **",IDS_INVALID_DATE:"Invalid date / time: please ensure that the date / time exists. Field",IDS_INVALID_DATE2:" should match format ",IDS_INVALID_VALUE:"The value entered does not match the format of the field",IDS_AM:"am",IDS_PM:"pm",IDS_MONTH_INFO:"January[1] February[2] March[3] April[4] May[5] June[6] July[7] August[8] September[9] October[10] November[11] December[12] Sept[9] Jan[1] Feb[2] Mar[3] Apr[4] Jun[6] Jul[7] Aug[8] Sep[9] Oct[10] Nov[11] Dec[12]",IDS_STARTUP_CONSOLE_MSG:"** ^ _ ^ **",RE_NUMBER_ENTRY_DOT_SEP:["[+-]?\\\\d*\\\\.?\\\\d*"],RE_NUMBER_COMMIT_DOT_SEP:["[+-]?\\\\d+(\\\\.\\\\d+)?","[+-]?\\\\.\\\\d+","[+-]?\\\\d+\\\\."],RE_NUMBER_ENTRY_COMMA_SEP:["[+-]?\\\\d*,?\\\\d*"],RE_NUMBER_COMMIT_COMMA_SEP:["[+-]?\\\\d+([.,]\\\\d+)?","[+-]?[.,]\\\\d+","[+-]?\\\\d+[.,]"],RE_ZIP_ENTRY:["\\\\d{0,5}"],RE_ZIP_COMMIT:["\\\\d{5}"],RE_ZIP4_ENTRY:["\\\\d{0,5}(\\\\.|[- ])?\\\\d{0,4}"],RE_ZIP4_COMMIT:["\Line truncated
|
||||
/*webpackIgnore: true*/
|
||||
/*@vite-ignore*/
|
||||
`${e}quickjs-eval.js`),r=await t();return new Sandbox(window,r)}globalThis.pdfjsSandbox={QuickJSSandbox};export{QuickJSSandbox};
|
||||
Reference in new issue
Block a user