CTL/web/sdk/office-viewer.js

2833 lines
545 KiB
JavaScript
Raw Normal View History

2024-06-21 09:05:50 +00:00
;/*!node_modules/office-viewer/lib/OpenXML.js*/
amis.define("5ab481b",(function(t,e,r,n){"use strict";function u(t){return t.getAttribute("w:val")||t.getAttribute("w14:val")||t.getAttribute("val")||""}function i(t,e){if(void 0===e&&(e=!1),"boolean"==typeof t)return t;if("string"==typeof t){switch(t){case"1":case"on":case"true":return!0;case"0":case"off":case"false":return!1}if("number"==typeof t)return 0!==t}return e}Object.defineProperty(e,"__esModule",{value:!0}),e.getAttrBoolean=function(t,e,r){return void 0===r&&(r=!0),i(t.getAttribute(e),r)},e.getAttrNumber=function(t,e,r){void 0===r&&(r=0);var n=t.getAttribute(e);return n?parseInt(n,10):r},e.getAttrPercent=function(t,e){var r=t.getAttribute(e);return r?r.endsWith("%")?parseInt(r,10)/100:parseInt(r,10)/1e5:1},e.getVal=u,e.getValBoolean=function(t,e){return void 0===e&&(e=!0),i(u(t),e)},e.getValHex=function(t){return parseInt(u(t)||"0",16)},e.getValNumber=function(t){return parseInt(u(t),10)},e.normalizeBoolean=i}));
;/*!node_modules/office-viewer/lib/openxml/word/Font.js*/
amis.define("5b576eb",(function(e,a,t,r){"use strict";Object.defineProperty(a,"__esModule",{value:!0});var n=e("9a586ef"),c=e("5ab481b");var o=function(){function e(){}return e.fromXML=function(a,t){var r,o,s=new e;s.name=t.getAttribute("w:name")||"";try{for(var l=n.__values(t.children),i=l.next();!i.done;i=l.next()){var u=i.value,b=u.tagName;switch(b){case"w:family":s.family=c.getVal(u);break;case"w:altName":s.altName=c.getVal(u);break;case"w:panose1":case"w:charset":case"w:sig":case"w:pitch":break;case"w:embedRegular":case"w:embedBold":case"w:embedItalic":case"w:embedBoldItalic":case"w:embedSystemFonts":case"w:embedTrueTypeFonts":var f=u.getAttribute("r:id")||"",w=u.getAttribute("w:fontKey")||"",d=a.loadFont(f,w);d&&(s.url=d);break;default:console.warn("parse Font: Unknown key",b,u)}}}catch(e){r={error:e}}finally{try{i&&!i.done&&(o=l.return)&&o.call(l)}finally{if(r)throw r.error}}return s},e}();a.Font=o,a.deobfuscate=function(e,a){for(var t=a.replace(/{|}|-/g,""),r=new Array(16),n=0;n<16;n++)r[16-n-1]=parseInt(t.substr(2*n,2),16);for(n=0;n<32;n++)e[n]=e[n]^r[n%16];return e}}));
;/*!node_modules/office-viewer/lib/openxml/word/FontTable.js*/
amis.define("16ce42c",(function(e,r,n,t){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var o=e("9a586ef"),a=e("5b576eb"),f=function(){function e(){this.fonts=[]}return e.fromXML=function(r,n){var t,f,u=Array.from(n.getElementsByTagName("w:font")),i=new e;try{for(var l=o.__values(u),c=l.next();!c.done;c=l.next()){var s=c.value,v=a.Font.fromXML(r,s);i.fonts.push(v)}}catch(e){t={error:e}}finally{try{c&&!c.done&&(f=l.return)&&f.call(l)}finally{if(t)throw t.error}}return i},e}();r.FontTable=f}));
;/*!node_modules/office-viewer/lib/parse/parseRelationship.js*/
amis.define("e02e5f6",(function(e,t,r,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=e("9a586ef");function n(e,t){return{id:e.getAttribute("Id")||"",type:e.getAttribute("Type")||"",target:e.getAttribute("Target")||"",targetMode:e.getAttribute("TargetMode")||"",part:t}}t.parseRelationship=n,t.parseRelationships=function(e,t){var r,a,o={},u=e.getElementsByTagName("Relationship");try{for(var l=i.__values(u),s=l.next();!s.done;s=l.next()){var f=n(s.value,t);o[f.id]=f}}catch(e){r={error:e}}finally{try{s&&!s.done&&(a=l.return)&&a.call(l)}finally{if(r)throw r.error}}return o}}));
;/*!node_modules/office-viewer/lib/openxml/ContentType.js*/
amis.define("38ffbcd",(function(e,r,t,a){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=e("9a586ef");r.parseContentType=function(e){var r,t,a={overrides:[]},i=[].slice.call(e.getElementsByTagName("Override"));try{for(var o=n.__values(i),l=o.next();!l.done;l=o.next()){var u=l.value;a.overrides.push({partName:u.getAttribute("PartName"),contentType:u.getAttribute("ContentType")})}}catch(e){r={error:e}}finally{try{l&&!l.done&&(t=o.return)&&t.call(o)}finally{if(r)throw r.error}}return a}}));
;/*!node_modules/office-viewer/lib/parse/parseSize.js*/
amis.define("5d393c3",(function(t,n,e,u){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i={Dxa:{mul:.066665,unit:"px"},Emu:{mul:1.3333/12700,unit:"px"},FontSize:{mul:.66665,unit:"px"},Border:{mul:.1666625,unit:"px"},Point:{mul:1.3333,unit:"px"},Percent:{mul:.02,unit:"%"},LineHeight:{mul:1/240,unit:""},VmlEmu:{mul:1/12700,unit:""}};function r(t,n){return void 0===n&&(n=i.Dxa),null==t||/.+(p[xt]|[%])$/.test(t)?t:"".concat((parseInt(t)*n.mul).toFixed(2)).concat(n.unit)}n.LengthUsage=i,n.convertAngle=function(t){return t?parseInt(t)/6e4:0},n.convertLength=r,n.parseSize=function(t,n,e){void 0===e&&(e=i.Dxa);var u=t.getAttribute(n);return u?r(String(u),e):""}}));
;/*!node_modules/office-viewer/lib/parse/parseCellMargin.js*/
amis.define("ebc0d65",(function(e,a,r,t){"use strict";Object.defineProperty(a,"__esModule",{value:!0});var i=e("9a586ef"),n=e("5d393c3");a.parseCellMargin=function(e,a){var r,t;try{for(var s=i.__values(e.children),c=s.next();!c.done;c=s.next()){var d=c.value;switch(d.tagName){case"w:left":case"w:start":a["padding-left"]=n.parseSize(d,"w:w");break;case"w:right":case"w:end":a["padding-right"]=n.parseSize(d,"w:w");break;case"w:top":a["padding-top"]=n.parseSize(d,"w:w");break;case"w:bottom":a["padding-bottom"]=n.parseSize(d,"w:w")}}}catch(e){r={error:e}}finally{try{c&&!c.done&&(t=s.return)&&t.call(s)}finally{if(r)throw r.error}}}}));
;/*!node_modules/office-viewer/lib/parse/colorNameMap.js*/
amis.define("65feb46",(function(e,f,a,d){"use strict";Object.defineProperty(f,"__esModule",{value:!0});f.PresetColorMap={aliceBlue:"#f0f8ff",antiqueWhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedAlmond:"#ffebcd",blue:"#0000ff",blueViolet:"#8a2be2",brown:"#a52a2a",burlyWood:"#deb887",cadetBlue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerBlue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00FFFF",darkBlue:"#00008B",dkBlue:"#00008B",darkCyan:"#008B8B",dkCyan:"#008B8B",darkGoldenrod:"#b8860b",dkGoldenrod:"#b8860b",darkGray:"#A9A9A9",dkGray:"#A9A9A9",darkGreen:"#006400",dkGreen:"#006400",darkGrey:"#a9a9a9",dkGrey:"#a9a9a9",darkKhaki:"#bdb76b",dkKhaki:"#bdb76b",darkMagenta:"#800080",dkMagenta:"#800080",darkOliveGreen:"#556b2f",dkOliveGreen:"#556b2f",darkOrange:"#ff8c00",dkOrange:"#ff8c00",darkOrchid:"#9932cc",dkOrchid:"#9932cc",darkRed:"#8B0000",dkRed:"#8B0000",darkSalmon:"#e9967a",dkSalmon:"#e9967a",darkSeaGreen:"#8fbc8f",dkSeaGreen:"#8fbc8f",darkSlateBlue:"#483d8b",dkSlateBlue:"#483d8b",darkSlateGray:"#2f4f4f",dkSlateGray:"#2f4f4f",darkSlateGrey:"#2f4f4f",dkSlateGrey:"#2f4f4f",darkTurquoise:"#00ced1",dkTurquoise:"#00ced1",darkViolet:"#9400d3",dkViolet:"#9400d3",darkYellow:"#808000",deepPink:"#ff1493",deepSkyBlue:"#00bfff",dimGray:"#696969",dimGrey:"#696969",dodgerBlue:"#1e90ff",firebrick:"#b22222",floralWhite:"#fffaf0",forestGreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostWhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenYellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotPink:"#ff69b4",indianRed:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderBlush:"#fff0f5",lawnGreen:"#7cfc00",lemonChiffon:"#fffacd",lightBlue:"#add8e6",ltBlue:"#add8e6",lightCoral:"#f08080",ltCoral:"#f08080",lightCyan:"#e0ffff",ltCyan:"#e0ffff",lightGoldenrodYellow:"#fafad2",ltGoldenrodYellow:"#fafad2",lightGray:"#D3D3D3",ltGray:"#D3D3D3",lightGreen:"#90ee90",ltGreen:"#90ee90",lightGrey:"#d3d3d3",ltGrey:"#d3d3d3",lightPink:"#ffb6c1",ltPink:"#ffb6c1",lightSalmon:"#ffa07a",ltSalmon:"#ffa07a",lightSeaGreen:"#20b2aa",ltSeaGreen:"#20b2aa",lightSkyBlue:"#87cefa",ltSkyBlue:"#87cefa",lightSlateGray:"#778899",ltSlateGray:"#778899",lightSlateGrey:"#778899",ltSlateGrey:"#778899",lightSteelBlue:"#b0c4de",ltSteelBlue:"#b0c4de",lightYellow:"#ffffe0",ltYellow:"#ffffe0",lime:"#00ff00",limeGreen:"#32cd32",linen:"#faf0e6",magenta:"#FF00FF",maroon:"#800000",mediumAquamarine:"#66cdaa",medAquamarine:"#66cdaa",mediumBlue:"#0000cd",medBlue:"#0000cd",mediumOrchid:"#ba55d3",medOrchid:"#ba55d3",mediumPurple:"#9370db",medPurple:"#9370db",mediumSeaGreen:"#3cb371",medSeaGreen:"#3cb371",mediumSlateBlue:"#7b68ee",medSlateBlue:"#7b68ee",mediumSpringGreen:"#00fa9a",medSpringGreen:"#00fa9a",mediumTurquoise:"#48d1cc",medTurquoise:"#48d1cc",mediumVioletRed:"#c71585",medVioletRed:"#c71585",midnightBlue:"#191970",mintCream:"#f5fffa",mistyRose:"#ffe4e1",moccasin:"#ffe4b5",navajoWhite:"#ffdead",navy:"#000080",none:"transparent",oldLace:"#fdf5e6",olive:"#808000",oliveDrab:"#6b8e23",orange:"#ffa500",orangeRed:"#ff4500",orchid:"#da70d6",paleGoldenrod:"#eee8aa",paleGreen:"#98fb98",paleTurquoise:"#afeeee",paleVioletRed:"#db7093",papayaWhip:"#ffefd5",peachPuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderBlue:"#b0e0e6",purple:"#800080",rebeccaPurple:"#663399",red:"#ff0000",rosyBrown:"#bc8f8f",royalBlue:"#4169e1",saddleBrown:"#8b4513",salmon:"#fa8072",sandyBrown:"#f4a460",seaGreen:"#2e8b57",seaShell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyBlue:"#87ceeb",slateBlue:"#6a5acd",slateGray:"#708090",slateGrey:"#708090",snow:"#fffafa",springGreen:"#00ff7f",steelBlue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whiteSmoke:"#f5f5f5",yellow:"#ffff00",yellowGreen:"#9acd32"}}));
;/*!node_modules/office-viewer/lib/parse/parseColor.js*/
amis.define("3d946ff",(function(t,e,r,c){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=t("5ab481b"),a=t("65feb46"),u=["black","blue","green","red","white","yellow"];function s(t,e,r,c){void 0===r&&(r="w:color"),void 0===c&&(c="black");var n=e.getAttribute(r);if(n)return"auto"==n?c:u.includes(n)?n:n in a.PresetColorMap?a.PresetColorMap[n]:"#".concat(n);var s=e.getAttribute("w:themeColor");return s?t.getThemeColor(s):""}function o(t,e){"FFFFFF"===t&&(t="000000");var r=parseInt(t.substring(0,2),16),c=parseInt(t.substring(2,4),16),n=parseInt(t.substring(4,6),16);return"rgba(".concat(r,", ").concat(c,", ").concat(n,", ").concat(e,")")}e.cssColors=u,e.parseColor=function(t,e){return s(t,e,"w:val")},e.parseColorAttr=s,e.parseShdColor=function(t,e){var r=e.getAttribute("w:fill")||"",c=n.getVal(e);if("auto"===r&&(r="FFFFFF"),6===r.length)switch(c){case"clear":return"#".concat(r);case"pct10":return o(r,.1);case"pct12":return o(r,.125);case"pct15":return o(r,.15);case"pct20":return o(r,.2);case"pct25":return o(r,.25);case"pct30":return o(r,.3);case"pct35":return o(r,.35);case"pct37":return o(r,.375);case"pct40":return o(r,.4);case"pct45":return o(r,.45);case"pct5":return o(r,.05);case"pct50":return o(r,.5);case"pct55":return o(r,.55);case"pct60":return o(r,.6);case"pct65":return o(r,.65);case"pct70":return o(r,.7);case"pct75":return o(r,.75);case"pct80":return o(r,.8);case"pct85":return o(r,.85);case"pct87":return o(r,.87);case"pct90":return o(r,.9);case"pct95":return o(r,.95);default:return console.warn("unsupport shd val",c),"#".concat(r)}return""}}));
;/*!node_modules/office-viewer/lib/parse/parseBorder.js*/
amis.define("abdff95",(function(e,r,a,t){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var o=e("9a586ef"),n=e("5ab481b"),c=e("3d946ff"),s=e("5d393c3");function d(e,r){var a=n.getVal(r);if("nil"===a||"none"===a)return"none";var t=c.parseColorAttr(e,r),o=s.parseSize(r,"w:sz",s.LengthUsage.Border);return"".concat(o," solid ").concat("auto"==t?"black":t)}r.parseBorder=d,r.parseBorders=function(e,r,a){var t,n;try{for(var c=o.__values(r.children),s=c.next();!s.done;s=c.next()){var i=s.value;switch(i.tagName){case"w:start":case"w:left":a["border-left"]=d(e,i);break;case"w:end":case"w:right":a["border-right"]=d(e,i);break;case"w:top":a["border-top"]=d(e,i);break;case"w:bottom":a["border-bottom"]=d(e,i)}}}catch(e){t={error:e}}finally{try{s&&!s.done&&(n=c.return)&&n.call(c)}finally{if(t)throw t.error}}}}));
;/*!node_modules/office-viewer/lib/parse/parseTextDirection.js*/
amis.define("859f742",(function(e,t,r,c){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseTextDirection=function(e,t){switch(e.getAttribute("w:val")){case"lr":case"lrV":case"btLr":case"lrTb":case"lrTbV":case"tbLrV":t.direction="ltr";break;case"rl":case"rlV":case"tbRl":case"tbRlV":t.direction="rtl"}}}));
;/*!node_modules/office-viewer/lib/parse/parseTblWidth.js*/
amis.define("c77c71a",(function(e,t,r,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=e("5d393c3");t.parseTblWidth=function(e){var t=e.getAttribute("w:type");return t&&"dxa"!==t?"pct"===t?i.parseSize(e,"w:w",i.LengthUsage.Percent):"auto"===t?"auto":(console.warn("parseTblWidth: ignore type",t,e),""):i.parseSize(e,"w:w")}}));
;/*!node_modules/office-viewer/lib/parse/parseInsideBorders.js*/
amis.define("ed2364b",(function(e,r,a,i){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var s=e("abdff95");r.parseInsideBorders=function(e,r){var a,i,t=r.getElementsByTagName("w:insideH").item(0);t&&(a=s.parseBorder(e,t));var n=r.getElementsByTagName("w:insideV").item(0);return n&&(i=s.parseBorder(e,n)),{H:a,V:i}}}));
;/*!node_modules/office-viewer/lib/parse/parseTcPr.js*/
amis.define("531b67e",(function(e,a,r,c){"use strict";Object.defineProperty(a,"__esModule",{value:!0});var t=e("9a586ef"),n=e("ebc0d65"),i=e("3d946ff"),s=e("5ab481b"),l=e("abdff95"),o=e("859f742"),d=e("c77c71a"),b=e("ed2364b");function p(e,a){switch(s.getVal(e)){case"bottom":a["vertical-align"]="bottom";break;case"center":a["vertical-align"]="middle";break;case"top":a["vertical-align"]="top"}}function f(e,a){var r=d.parseTblWidth(e);r&&(a.width=r)}a.parseTblCellSpacing=function(e,a){var r=d.parseTblWidth(e);r&&(a["cell-spacing"]=r)},a.parseTcPr=function(e,a){var r,c,d={},g={};d.cssStyle=g;try{for(var w=t.__values(a.children),k=w.next();!k.done;k=w.next()){var u=k.value,v=u.tagName;switch(v){case"w:tcMar":n.parseCellMargin(u,g);break;case"w:shd":g["background-color"]=i.parseShdColor(e,u);break;case"w:tcW":f(u,g);break;case"w:noWrap":s.getValBoolean(u)&&(g["white-space"]="nowrap");break;case"w:vAlign":p(u,g);break;case"w:tcBorders":l.parseBorders(e,u,g),d.insideBorder=b.parseInsideBorders(e,u);break;case"w:gridSpan":d.gridSpan=s.getValNumber(u);break;case"w:vMerge":d.vMerge=s.getVal(u)||"continue";break;case"w:textDirection":o.parseTextDirection(u,g);break;case"w:cnfStyle":break;case"w:hideMark":d.hideMark=s.getValBoolean(u,!0);break;default:console.warn("parseTcPr: ignore",v,u)}}}catch(e){r={error:e}}finally{try{k&&!k.done&&(c=w.return)&&c.call(w)}finally{if(r)throw r.error}}return d}}));
;/*!node_modules/office-viewer/lib/util/color.js*/
amis.define("cc1ca20",(function(t,n,r,i){"use strict";function s(t,n,r){t/=255,n/=255,r/=255;var i,s=Math.max(t,n,r),o=Math.min(t,n,r),h=0,e=(s+o)/2;if(s==o)h=i=0;else{var u=s-o;switch(i=e>.5?u/(2-s-o):u/(s+o),s){case t:h=(n-r)/u+(n<r?6:0);break;case n:h=(r-t)/u+2;break;case r:h=(t-n)/u+4}h/=6}return{h:h,s:i,l:e}}function o(t,n,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?t+6*(n-t)*r:r<.5?n:r<2/3?t+(n-t)*(2/3-r)*6:t}function h(t,n,r){var i,s,h;if(t>1&&(t/=360),0==n)i=s=h=r;else{var e=r<.5?r*(1+n):r+n-r*n,u=2*r-e;i=o(u,e,t+1/3),s=o(u,e,t),h=o(u,e,t-1/3)}return{r:255*i,g:255*s,b:255*h}}function e(t){return 1==t.length?"0"+t:""+t}function u(t,n,r){return[e(Math.round(t).toString(16)),e(Math.round(n).toString(16)),e(Math.round(r).toString(16))].join("").toUpperCase()}function c(t){return Math.min(Math.max(t,0),255)}Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function t(t){var n=t.match(/^#?([0-9a-f]{6})$/i);n&&(this.r=parseInt(n[1].substring(0,2),16),this.g=parseInt(n[1].substring(2,4),16),this.b=parseInt(n[1].substring(4,6),16),this.isValid=!0)}return t.fromHSL=function(n,r,i){var s=h(n,r,i);return new t("#".concat(u(s.r,s.g,s.b)))},t.fromRGB=function(n,r,i){var s=u(n,r,i);return new t("#".concat(s))},t.prototype.lum=function(t){return this.changeHsl(t,"l","set")},t.prototype.lumMod=function(t){return this.changeHsl(t,"l","mod")},t.prototype.lumOff=function(t){return this.changeHsl(t,"l","off")},t.prototype.hue=function(t){return this.changeHsl(t,"h","set")},t.prototype.hueMod=function(t){return this.changeHsl(t,"h","mod")},t.prototype.hueOff=function(t){return this.changeHsl(t,"h","off")},t.prototype.sat=function(t){return this.changeHsl(t,"s","set")},t.prototype.satMod=function(t){return this.changeHsl(t,"s","mod")},t.prototype.satOff=function(t){return this.changeHsl(t,"s","off")},t.prototype.changeHsl=function(t,n,r){var i=s(this.r,this.g,this.b);"set"===r?i[n]=t:"mod"===r?i[n]=i[n]*t:"off"===r&&(i[n]+=i[n]*t);var o=h(i.h,i.s,i.l);return this.r=o.r,this.g=o.g,this.b=o.b,this},t.prototype.comp=function(){var t=s(this.r,this.g,this.b);t.h=t.h+.5,t.h>1&&(t.h-=1);var n=h(t.h,t.s,t.l);return this.r=n.r,this.g=n.g,this.b=n.b,this},t.prototype.shade=function(t){this.r=c(this.r-256*t),this.g=c(this.g-256*t),this.b=c(this.b-256*t)},t.prototype.tint=function(t){this.r=c(this.r+256*t),this.g=c(this.g+256*t),this.b=c(this.b+256*t)},t.prototype.inv=function(){return this.r=255-this.r,this.g=255-this.g,this.b=255-this.b,this},t.prototype.toHex=function(){return"#"+u(this.r,this.g,this.b)},t.prototype.toRgba=function(t){return"rgba(".concat(this.r,", ").concat(this.g,", ").concat(this.b,", ").concat(t,")")},t}();n.Color=a}));
;/*!node_modules/office-viewer/lib/parse/modifyColor.js*/
amis.define("f8922e6",(function(e,a,t,r){"use strict";Object.defineProperty(a,"__esModule",{value:!0});var c=e("9a586ef"),l=e("5ab481b"),n=e("cc1ca20"),s=e("5d393c3");a.modifyColor=function(e,a){var t,r,o=new n.Color(a);if(o.isValid){var b=1;try{for(var g=c.__values(e.children),f=g.next();!f.done;f=g.next()){var u=f.value;switch(u.tagName){case"a:alpha":case"w14:alpha":b=l.getAttrPercent(u,"val");break;case"a:blue":o.b=256*l.getAttrPercent(u,"val");break;case"a:blueMod":o.b=o.b*l.getAttrPercent(u,"val");break;case"a:blueOff":o.b+=o.b*l.getAttrPercent(u,"val");break;case"a:comp":o.comp();break;case"a:green":o.g=256*l.getAttrPercent(u,"val");break;case"a:greenMod":o.g=o.g*l.getAttrPercent(u,"val");break;case"a:greenOff":o.g+=o.g*l.getAttrPercent(u,"val");break;case"a:red":o.r=256*l.getAttrPercent(u,"val");break;case"a:redMod":o.r=o.r*l.getAttrPercent(u,"val");break;case"a:redOff":o.r+=o.r*l.getAttrPercent(u,"val");break;case"a:lum":o.lum(l.getAttrPercent(u,"val"));break;case"a:lumMod":o.lumMod(l.getAttrPercent(u,"val"));break;case"a:lumOff":o.lumOff(l.getAttrPercent(u,"val"));break;case"a:hue":o.hue(s.convertAngle(u.getAttribute("hue"))/360);break;case"a:hueMod":o.hueMod(l.getAttrPercent(u,"val"));break;case"a:hueOff":o.hueOff(l.getAttrPercent(u,"val"));break;case"a:sat":o.sat(l.getAttrPercent(u,"val"));break;case"a:satMod":o.satMod(l.getAttrPercent(u,"val"));break;case"a:satOff":o.satOff(l.getAttrPercent(u,"val"));break;case"a:shade":o.shade(l.getAttrPercent(u,"val"));break;case"a:tint":o.tint(l.getAttrPercent(u,"val"));break;default:console.log("unknown color modify",u)}}}catch(e){t={error:e}}finally{try{f&&!f.done&&(r=g.return)&&r.call(g)}finally{if(t)throw t.error}}return 1!==b?o.toRgba(b):o.toHex()}return a}}));
;/*!node_modules/office-viewer/lib/parse/parseChildColor.js*/
amis.define("23086c1",(function(e,r,t,o){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var a=e("5ab481b"),l=e("cc1ca20"),n=e("65feb46"),s=e("f8922e6");r.parseChildColor=function(e,r){var t=r.firstElementChild;if(t){var o=t.tagName;switch(o){case"a:prstClr":var c=a.getVal(t)||"";if(c in n.PresetColorMap)return s.modifyColor(t,n.PresetColorMap[c]);console.warn("parseOutline: Unknown color ",c,t);break;case"a:srgbClr":case"a:scrgbClr":case"w14:srgbClr":var i=a.getVal(t);if(i)return s.modifyColor(t,"#"+i);var C=a.getAttrPercent(t,"r"),f=a.getAttrPercent(t,"g"),g=a.getAttrPercent(t,"b"),u=l.Color.fromRGB(C,f,g);return s.modifyColor(t,u.toHex());case"a:hslClr":var m=a.getAttrPercent(t,"r"),d=a.getAttrPercent(t,"g"),b=a.getAttrPercent(t,"b"),v=a.getVal(t);if(v)return s.modifyColor(t,"#"+v);var p=l.Color.fromHSL(m,d,b);return s.modifyColor(t,p.toHex());case"a:schemeClr":case"w14:schemeClr":var w=a.getVal(t);if(w)return s.modifyColor(t,e.getThemeColor(w));console.warn("parseOutline: Unknown schemeClr ",t);break;case"a:sysClr":return a.getVal(t);default:console.warn("parseOutline: Unknown color type ",o,t)}}return""}}));
;/*!node_modules/office-viewer/lib/parse/parseInd.js*/
amis.define("166430a",(function(e,i,t,n){"use strict";Object.defineProperty(i,"__esModule",{value:!0});var r=e("5d393c3");i.parseInd=function(e,i){var t=r.parseSize(e,"w:firstLine"),n=r.parseSize(e,"w:hanging"),a=r.parseSize(e,"w:left"),s=r.parseSize(e,"w:start"),d=r.parseSize(e,"w:right"),p=r.parseSize(e,"w:end");t&&(i["text-indent"]=t),n&&(i["text-indent"]="-".concat(n)),(a||s)&&(i["margin-left"]=a||s),(d||p)&&(i["margin-right"]=d||p)}}));
;/*!node_modules/office-viewer/lib/parse/parseSpacing.js*/
amis.define("4881f94",(function(e,t,i,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=e("5d393c3");t.parseSpacing=function(e,t,i){var r=a.parseSize(t,"w:before"),n=a.parseSize(t,"w:after"),o=t.getAttribute("w:lineRule");r&&(i["margin-top"]=r),n&&(i["margin-bottom"]=n);var c=t.getAttribute("w:line");if(c){if(e.renderOptions.forceLineHeight)return void(i["line-height"]=e.renderOptions.forceLineHeight);var s=parseInt(c,10),f=e.renderOptions.minLineHeight||1;switch(o){case"auto":var h=Math.max(f,s/240);i["line-height"]="".concat(h.toFixed(2));break;case"atLeast":break;default:var g=Math.max(f,s/20);i["line-height"]="".concat(g,"pt")}}}}));
;/*!node_modules/office-viewer/lib/parse/parseFont.js*/
amis.define("f28569d",(function(e,a,r,t){"use strict";Object.defineProperty(a,"__esModule",{value:!0});var n=e("9a586ef");a.parseFont=function(e,a,r){var t,s,i=[],c=e.renderOptions.fontMapping;try{for(var o=n.__values(a.attributes),f=o.next();!f.done;f=o.next()){var l=f.value,u=l.name,h=l.value;switch(u){case"w:ascii":case"w:cs":case"w:eastAsia":c&&h in c&&(h=c[h]),-1===h.indexOf(" ")?i.push(h):i.push('"'+h+'"');break;case"w:asciiTheme":case"w:csTheme":case"w:eastAsiaTheme":i.push("var(--docx-theme-font-".concat(h,")"))}}}catch(e){t={error:e}}finally{try{f&&!f.done&&(s=o.return)&&s.call(o)}finally{if(t)throw t.error}}i.length&&(r["font-family"]=Array.from(new Set(i)).join(", "))}}));
;/*!node_modules/office-viewer/lib/parse/parseTrHeight.js*/
amis.define("c261185",(function(e,t,i,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=e("5d393c3");t.parseTrHeight=function(e,t){var i=r.parseSize(e,"w:val"),a=e.getAttribute("w:hRule");"exact"===a?t.height=i:"atLeast"===a&&(t.height=i,t["min-height"]=i)}}));
;/*!node_modules/office-viewer/lib/parse/jcToTextAlign.js*/
amis.define("758cab5",(function(e,t,r,c){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.jcToTextAlign=function(e){switch(e){case"start":case"left":return"left";case"center":return"center";case"end":case"right":return"right";case"both":case"distribute":return"justify"}return e}}));
;/*!node_modules/office-viewer/lib/parse/parsePr.js*/
amis.define("c5cba64",(function(e,a,r,t){"use strict";Object.defineProperty(a,"__esModule",{value:!0});var s=e("9a586ef"),o=e("5d393c3"),c=e("5ab481b"),n=e("abdff95"),l=e("3d946ff"),i=e("23086c1"),w=e("166430a"),d=e("4881f94"),p=e("f28569d"),b=e("c261185"),k=e("758cab5"),g=e("859f742");function h(e,a,r){var t=c.getVal(a);if(null!=t){switch(t){case"dash":case"dashDotDotHeavy":case"dashDotHeavy":case"dashedHeavy":case"dashLong":case"dashLongHeavy":case"dotDash":case"dotDotDash":r["text-decoration-style"]="dashed";break;case"dotted":case"dottedHeavy":r["text-decoration-style"]="dotted";break;case"double":r["text-decoration-style"]="double";break;case"single":case"thick":case"words":r["text-decoration"]="underline";break;case"wave":case"wavyDouble":case"wavyHeavy":r["text-decoration-style"]="wavy";break;case"none":r["text-decoration"]="none"}var s=l.parseColorAttr(e,a);s&&(r["text-decoration-color"]=s)}}function u(e,a){var r,t;try{for(var c=s.__values(e.attributes),n=c.next();!n.done;n=c.next()){var l=n.value,i=l.name,w=l.value;switch(i){case"w:dropCap":"drop"===w&&(a.float="left");break;case"w:h":"object"!=typeof w||Array.isArray(w)||(a.height=o.parseSize(w,"w:h"));break;case"w:w":"object"!=typeof w||Array.isArray(w)||(a.width=o.parseSize(w,"w:w"));break;case"w:hAnchor":case"w:vAnchor":case"w:lines":break;case"w:wrap":"around"!==w&&console.warn("parseFrame: w:wrap not support "+w);break;default:console.warn("parseFrame: unknown attribute "+i,l)}}}catch(e){r={error:e}}finally{try{n&&!n.done&&(t=c.return)&&t.call(c)}finally{if(r)throw r.error}}}function x(e,a){switch(e){case"dot":case"underDot":a["text-emphasis"]="filled",a["text-emphasis-position"]="under right";break;case"comma":a["text-emphasis"]="filled sesame";break;case"circle":a["text-emphasis"]="open"}}a.parsePr=function(e,a,r){var t,f,v={};try{for(var y=s.__values(a.children),m=y.next();!m.done;m=y.next()){var A=m.value,S=A.tagName;switch(S){case"w:sz":case"w:szCs":v["font-size"]=o.parseSize(A,"w:val",o.LengthUsage.FontSize);break;case"w:jc":v["text-align"]=k.jcToTextAlign(c.getVal(A));break;case"w:framePr":u(A,v);break;case"w:pBdr":n.parseBorders(e,A,v);break;case"w:ind":w.parseInd(A,v);break;case"w:color":v.color=l.parseColor(e,A);break;case"w:shd":"background-color"in v||(v["background-color"]=l.parseShdColor(e,A));break;case"w:spacing":d.parseSpacing(e,A,v);break;case"w:highlight":v["background-color"]=l.parseColorAttr(e,A,"w:val","yellow");break;case"w:vertAlign":var B=c.getVal(A);"superscript"===B?v["vertical-align"]="super":"subscript"===B&&(v["vertical-align"]="sub");break;case"w:position":v["vertical-align"]=o.parseSize(A,"w:val",o.LengthUsage.FontSize);break;case"w:trHeight":b.parseTrHeight(A,v);break;case"w:strike":case"w:dstrike":v["text-decoration"]=c.getValBoolean(A)?"line-through":"none";break;case"w:b":v["font-weight"]=c.getValBoolean(A)?"bold":"normal";break;case"w:adjustRightInd":case"w:bCs":case"w:iCs":case"w:kern":case"w:pStyle":case"w:lang":case"w:noProof":case"w:keepLines":case"w:keepNext":case"w:widowControl":case"w:pageBreakBefore":case"w:outlineLvl":case"w:contextualSpacing":case"w:numPr":case"w:rStyle":case"w:tabs":case"w:snapToGrid":case"w:topLinePunct":case"w:cnfStyle":case"w:autoSpaceDE":case"w:autoSpaceDN":case"w:kinsoku":case"w:overflowPunct":case"w14:reflection":case"w14:textFill":case"w14:ligatures":break;case"w:i":v["font-style"]=c.getValBoolean(A)?"italic":"normal";break;case"w:caps":v["text-transform"]=c.getValBoolean(A)?"uppercase":"normal";break;case"w:smallCaps":v["text-transform"]=c.getValBoolean(A)?"lowercase":"normal";break;case"w:u":h(e,A,v);break;case"w:rFonts":p.parseFont(e,A,v);break;case"w:tblCellSpacing":v["border-spacing"]=o.parseSize(A,"w:w"),v["border-collapse"]="separate";break;case"w:bdr":v.border=n.parseBorder(e,A);break;case"w:vanish":c.getValBoolean(A)&&(v.display="none");break;case"w:rPr":var C=A.getElementsByTagName("w14:reflection").item(0);if(C){var V=o.parseSize(C,"w4:dist",o.LengthUsage.Emu)||"0px";v["-webkit-box-reflect"]="below ".concat(V," linear-gradient(transparent, white)")}break;case"w:webHidden":v
;/*!node_modules/office-viewer/lib/openxml/word/Bookmark.js*/
amis.define("6541de0",(function(n,e,t,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function n(n){this.name=n}return n.fromXML=function(e,t){var o=t.getAttribute("w:name");return o?new n(o):(console.warn("Bookmark without name"),new n("unknown"))},n}();e.BookmarkStart=r}));
;/*!node_modules/office-viewer/lib/openxml/word/Break.js*/
amis.define("545dd66",(function(e,n,t,r){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=function(){function e(){this.type="textWrapping"}return e.fromXML=function(n,t){return new e},e}();n.Break=i}));
;/*!node_modules/office-viewer/lib/openxml/drawing/Blip.js*/
amis.define("71b8d76",(function(e,t,n,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var u=function(){function e(){}return e.fromXML=function(t,n){var r=new e,u=n.getAttribute("r:embed")||"",i=t.getDocumentRels(u);return i&&(r.embled=i,r.src=t.loadImage(r.embled)),r},e}();t.Blip=u}));
;/*!node_modules/office-viewer/lib/openxml/drawing/BlipFill.js*/
amis.define("e6382c0",(function(e,i,n,t){"use strict";Object.defineProperty(i,"__esModule",{value:!0});var l=e("71b8d76"),r=function(){function e(){}return e.fromXML=function(i,n){var t=new e,r=null==n?void 0:n.getElementsByTagName("a:blip").item(0);return r&&(t.blip=l.Blip.fromXML(i,r)),t},e}();i.BlipFill=r}));
;/*!node_modules/office-viewer/lib/openxml/drawing/Transform.js*/
amis.define("c4007de",(function(e,a,r,t){"use strict";Object.defineProperty(a,"__esModule",{value:!0});var n=e("9a586ef"),c=e("5d393c3"),s=function(){function e(){}return e.fromXML=function(a,r){var t,s,f=new e;try{for(var o=n.__values(r.children),i=o.next();!i.done;i=o.next()){var u=i.value,g=u.tagName;switch(g){case"a:off":f.off={x:c.parseSize(u,"x",c.LengthUsage.Emu),y:c.parseSize(u,"y",c.LengthUsage.Emu)};break;case"a:ext":f.ext={cx:c.parseSize(u,"cx",c.LengthUsage.Emu),cy:c.parseSize(u,"cy",c.LengthUsage.Emu)};break;case"a:chOff":f.chOff={x:c.parseSize(u,"x",c.LengthUsage.Emu),y:c.parseSize(u,"y",c.LengthUsage.Emu)};break;case"a:chExt":f.chExt={cx:c.parseSize(u,"cx",c.LengthUsage.Emu),cy:c.parseSize(u,"cy",c.LengthUsage.Emu)};break;default:console.warn("Transform: Unknown tag ",g,u)}}}catch(e){t={error:e}}finally{try{i&&!i.done&&(s=o.return)&&s.call(o)}finally{if(t)throw t.error}}var h=r.getAttribute("rot");return h&&(f.rot=c.convertAngle(h)),f},e}();a.Transform=s}));
;/*!node_modules/office-viewer/lib/parse/parseShape.js*/
amis.define("e966875",(function(e,t,a,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=e("9a586ef"),s=e("5ab481b");function c(e){var t,a,r=[];try{for(var s=n.__values(e.children),c=s.next();!c.done;c=s.next()){var o=c.value,l=o.tagName;if("a:pt"===l||"pt"===l){var i=o.getAttribute("x"),u=o.getAttribute("y");i&&u&&r.push({x:i,y:u})}else console.warn("unknown pt",l,o)}}catch(e){t={error:e}}finally{try{c&&!c.done&&(a=s.return)&&a.call(s)}finally{if(t)throw t.error}}return r}function o(e){var t,a,r=[];try{for(var o=n.__values(e.children),l=o.next();!l.done;l=o.next()){var i=l.value,u=i.tagName;switch(u){case"a:moveTo":case"moveTo":var v=c(i);if(v.length){var h={type:"moveTo",pt:v[0]};r.push(h)}break;case"a:lnTo":case"lnTo":var f=c(i);if(f.length){var p={type:"lnTo",pt:f[0]};r.push(p)}break;case"a:quadBezTo":case"quadBezTo":var g=c(i);if(g.length){var b={type:"quadBezTo",pts:g};r.push(b)}break;case"a:cubicBezTo":case"cubicBezTo":var d=c(i);if(d.length){var y={type:"cubicBezTo",pts:d};r.push(y)}break;case"a:arcTo":case"arcTo":var A=i.getAttribute("wR"),w=i.getAttribute("hR"),k=i.getAttribute("stAng"),T=i.getAttribute("swAng");if(A&&w&&k&&T){var x={type:"arcTo",wR:A,hR:w,stAng:k,swAng:T};r.push(x)}break;case"a:close":case"close":r.push({type:"close"});break;default:console.warn("parsePath: unknown tag",u,i)}}}catch(e){t={error:e}}finally{try{l&&!l.done&&(a=o.return)&&a.call(o)}finally{if(t)throw t.error}}var _={defines:r},m=e.getAttribute("fill");m&&(_.fill=m),_.extrusionOk=s.getAttrBoolean(e,"extrusionOk",!1),_.stroke=s.getAttrBoolean(e,"stroke",!0);var L=e.getAttribute("w");L&&(_.w=parseInt(L,10));var B=e.getAttribute("h");return B&&(_.h=parseInt(B,10)),_}function l(e){var t,a,r=[];try{for(var s=n.__values(e.children),c=s.next();!c.done;c=s.next()){var l=c.value;switch(l.tagName){case"a:path":case"path":r.push(o(l))}}}catch(e){t={error:e}}finally{try{c&&!c.done&&(a=s.return)&&a.call(s)}finally{if(t)throw t.error}}return r}function i(e){var t,a,r=[];try{for(var s=n.__values(e.children),c=s.next();!c.done;c=s.next()){var o=c.value;switch(o.tagName){case"a:gd":case"gd":var l=o.getAttribute("name"),i=o.getAttribute("fmla");if(l&&i){var u={n:l,f:i};r.push(u)}}}}catch(e){t={error:e}}finally{try{c&&!c.done&&(a=s.return)&&a.call(s)}finally{if(t)throw t.error}}return r}t.parsePath=o,t.parsePathLst=l,t.parsePts=c,t.parseShape=function(e){var t,a,r={};try{for(var s=n.__values(e.children),c=s.next();!c.done;c=s.next()){var o=c.value;switch(o.tagName){case"a:avLst":case"avLst":r.avLst=i(o);break;case"a:gdLst":case"gdLst":r.gdLst=i(o);break;case"a:rect":case"react":var u={b:o.getAttribute("b")||"",l:o.getAttribute("l")||"",r:o.getAttribute("r")||"",t:o.getAttribute("t")||""};r.rect=u;break;case"a:pathLst":case"pathLst":r.pathLst=l(o)}}}catch(e){t={error:e}}finally{try{c&&!c.done&&(a=s.return)&&a.call(s)}finally{if(t)throw t.error}}return r},t.parseShapeGuide=i}));
;/*!node_modules/office-viewer/lib/openxml/drawing/Geom.js*/
amis.define("955b4bd",(function(e,r,t,n){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var a=e("9a586ef"),i=e("e966875"),o=function(){function e(){}return e.fromXML=function(r,t){var n,o,u=new e;u.prst=t.getAttribute("prst");try{for(var f=a.__values(t.children),l=f.next();!l.done;l=f.next()){var c=l.value;if("a:avLst"===c.tagName)u.avLst=i.parseShapeGuide(c)}}catch(e){n={error:e}}finally{try{l&&!l.done&&(o=f.return)&&o.call(f)}finally{if(n)throw n.error}}return u},e}();r.Geom=o}));
;/*!node_modules/office-viewer/lib/openxml/drawing/CustomGeom.js*/
amis.define("9ea6ed6",(function(e,n,r,t){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var u=e("e966875"),o=function(){function e(){}return e.fromXML=function(n,r){var t=new e;return t.shape=u.parseShape(r),t},e}();n.CustomGeom=o}));
;/*!node_modules/office-viewer/lib/openxml/drawing/ShapeProperties.js*/
amis.define("c43c851",(function(e,a,r,s){"use strict";Object.defineProperty(a,"__esModule",{value:!0});var o=e("9a586ef"),t=e("c4007de"),l=e("5d393c3"),n=e("955b4bd"),c=e("23086c1"),i=e("9ea6ed6");function d(e){var a="solid";switch(e){case"dash":case"dashDot":case"lgDash":case"lgDashDot":case"lgDashDotDot":case"sysDash":case"sysDashDot":case"sysDashDotDot":a="dashed";break;case"dot":case"sysDot":a="dotted"}return a}function u(e,a){var r,s,t={width:l.parseSize(a,"w",l.LengthUsage.Emu),style:"solid"};try{for(var n=o.__values(a.children),i=n.next();!i.done;i=n.next()){var u=i.value,f=u.tagName;switch(f){case"a:solidFill":t.color=c.parseChildColor(e,u);break;case"a:noFill":t.style="none";break;case"a:round":t.radius="8%";break;case"a:prstDash":t.style=d(u.getAttribute("val"));break;default:console.warn("parseOutline: Unknown tag ",f,u)}}}catch(e){r={error:e}}finally{try{i&&!i.done&&(s=n.return)&&s.call(n)}finally{if(r)throw r.error}}return t}var f=function(){function e(){}return e.fromXML=function(a,r){var s,l,d=new e;if(r)try{for(var f=o.__values(r.children),h=f.next();!h.done;h=f.next()){var m=h.value,y=m.tagName;switch(y){case"a:xfrm":d.xfrm=t.Transform.fromXML(a,m);break;case"a:prstGeom":d.geom=n.Geom.fromXML(a,m);break;case"a:custGeom":d.custGeom=i.CustomGeom.fromXML(a,m);break;case"a:ln":d.outline=u(a,m);break;case"a:noFill":d.noFill=!0;break;case"a:solidFill":d.fillColor=c.parseChildColor(a,m);break;default:console.warn("ShapePr: Unknown tag ",y,m)}}}catch(e){s={error:e}}finally{try{h&&!h.done&&(l=f.return)&&l.call(f)}finally{if(s)throw s.error}}return d},e}();a.ShapePr=f}));
;/*!node_modules/office-viewer/lib/openxml/drawing/Pic.js*/
amis.define("1efdfad",(function(e,t,i,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var l=e("5ab481b"),n=e("e6382c0"),a=e("c43c851"),c=function(){function e(){}return e.fromXML=function(t,i){var r=new e,c=null==i?void 0:i.getElementsByTagName("pic:cNvPr").item(0);if(c&&(r.alt=c.getAttribute("descr")||"",r.altVar=c.getAttribute("descrVar")||"",l.getAttrBoolean(c,"hidden",!1)))return r;return r.blipFill=n.BlipFill.fromXML(t,null==i?void 0:i.getElementsByTagName("pic:blipFill").item(0)),r.spPr=a.ShapePr.fromXML(t,null==i?void 0:i.getElementsByTagName("pic:spPr").item(0)),r},e}();t.Pic=c}));
;/*!node_modules/office-viewer/lib/openxml/word/Table.js*/
amis.define("1c1a6b2",(function(e,t,i,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){this.properties={},this.tblGrid=[],this.trs=[]};t.Table=r}));
;/*!node_modules/office-viewer/lib/openxml/word/table/Tr.js*/
amis.define("5718345",(function(e,t,i,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){this.properties={},this.tcs=[]};t.Tr=r}));
;/*!node_modules/office-viewer/lib/openxml/word/table/Tc.js*/
amis.define("3a3467f",(function(e,t,i,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(){this.properties={},this.children=[]}return e.prototype.add=function(e){e&&this.children.push(e)},e}();t.Tc=r}));
;/*!node_modules/office-viewer/lib/parse/parseTc.js*/
amis.define("35b58c8",(function(e,r,a,n){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var t=e("9a586ef"),i=e("3a3467f"),o=e("531b67e"),p=e("d78ccf3"),s=e("b7e52c8");r.parseTc=function(e,r,a,n){var c,d,l=new i.Tc;try{for(var f=t.__values(r.children),u=f.next();!u.done;u=f.next()){var v=u.value;switch(v.tagName){case"w:tcPr":l.properties=o.parseTcPr(e,v);break;case"w:p":l.add(p.Paragraph.fromXML(e,v));break;case"w:tbl":l.add(s.parseTable(e,v))}}}catch(e){c={error:e}}finally{try{u&&!u.done&&(d=f.return)&&d.call(f)}finally{if(c)throw c.error}}var w=n[a.index];if(l.properties.vMerge){if("restart"===l.properties.vMerge)l.properties.rowSpan=1,n[a.index]=l;else if(w){if(w.properties&&w.properties.rowSpan){w.properties.rowSpan=w.properties.rowSpan+1;var b=l.properties.gridSpan||1;return a.index+=b,null}console.warn("Tc.fromXML: continue but not found lastCol",a.index,l,n)}}else delete n[a.index];var x=l.properties.gridSpan||1;return a.index+=x,l}}));
;/*!node_modules/office-viewer/lib/parse/parseTablePr.js*/
amis.define("dc0d3b3",(function(e,a,t,r){"use strict";Object.defineProperty(a,"__esModule",{value:!0});var l=e("9a586ef"),o=e("5ab481b"),n=e("abdff95"),s=e("ed2364b"),c=e("c77c71a"),b=e("3d946ff"),i=e("5d393c3"),d=e("531b67e"),f=e("ebc0d65");function w(e,a){switch(o.getVal(e)){case"left":case"start":break;case"right":case"end":a.float="right"}}function u(e,a){var t=c.parseTblWidth(e);t&&(a["margin-left"]=t)}function p(e,a){var t=c.parseTblWidth(e);t&&(a.width=t)}function g(e){var a={},t=o.getValHex(e);return(o.getAttrBoolean(e,"firstRow",!1)||32&t)&&(a.firstRow=!0),(o.getAttrBoolean(e,"lastRow",!1)||64&t)&&(a.lastRow=!0),(o.getAttrBoolean(e,"firstColumn",!1)||128&t)&&(a.firstColumn=!0),(o.getAttrBoolean(e,"lastColumn",!1)||256&t)&&(a.lastColumn=!0),o.getAttrBoolean(e,"noHBand",!1)||512&t?a.noHBand=!0:a.noHBand=!1,o.getAttrBoolean(e,"noVBand",!1)||1024&t?a.noVBand=!0:a.noVBand=!1,a}function B(e,a,t){if(void 0===e.renderOptions.padding){var r=i.parseSize(a,"w:tblpX"),l=i.parseSize(a,"w:tblpY");t.top=l,t.left=r}}function k(e,a){"fixed"===e.getAttribute("w:type")&&(a["table-layout"]="fixed")}a.parseTablePr=function(e,a){var t,r,c={},i={},S={};c.tblLook={},c.cssStyle=i,c.tcCSSStyle=S;try{for(var y=l.__values(a.children),C=y.next();!C.done;C=y.next()){var h=C.value,v=h.tagName;switch(v){case"w:tblBorders":n.parseBorders(e,h,i),c.insideBorder=s.parseInsideBorders(e,h);break;case"w:tcBorders":n.parseBorders(e,h,i);break;case"w:tblInd":u(h,i);break;case"w:jc":w(h,i);break;case"w:tblCellMar":case"w:tcMar":f.parseCellMargin(h,S);break;case"w:tblStyle":c.pStyle=o.getVal(h);break;case"w:tblW":p(h,i);break;case"w:shd":i["background-color"]=b.parseShdColor(e,h);break;case"w:tblCaption":c.tblCaption=o.getVal(h);break;case"w:tblCellSpacing":d.parseTblCellSpacing(h,i);break;case"w:tblLayout":k(h,i);break;case"w:tblLook":c.tblLook=g(h);break;case"w:tblStyleRowBandSize":c.rowBandSize=o.getValNumber(h);break;case"w:tblStyleColBandSize":c.colBandSize=o.getValNumber(h);break;case"w:tblpPr":B(e,h,i);break;default:console.warn("parseTableProperties unknown tag",v,h)}}}catch(e){t={error:e}}finally{try{C&&!C.done&&(r=y.return)&&r.call(y)}finally{if(t)throw t.error}}return c}}));
;/*!node_modules/office-viewer/lib/parse/parseTrPr.js*/
amis.define("dc518ce",(function(e,a,r,t){"use strict";Object.defineProperty(a,"__esModule",{value:!0});var c=e("9a586ef"),l=e("5ab481b"),n=e("758cab5"),s=e("dc0d3b3"),i=e("531b67e"),b=e("c261185");a.parseTrPr=function(e,a){var r,t,o={},d={};try{for(var f=c.__values(a.children),g=f.next();!g.done;g=f.next()){var w=g.value,u=w.tagName;switch(u){case"w:hidden":l.getValBoolean(w)&&(o.display="none");break;case"w:trHeight":b.parseTrHeight(w,o);break;case"w:jc":o["text-align"]=n.jcToTextAlign(l.getVal(w));break;case"w:cantSplit":case"w:cnfStyle":break;case"w:tblPrEx":var p=s.parseTablePr(e,w);Object.assign(o,p.cssStyle);break;case"w:tblCellSpacing":i.parseTblCellSpacing(w,d);break;default:console.warn("Tr: Unknown tag ",u,w)}}}catch(e){r={error:e}}finally{try{g&&!g.done&&(t=f.return)&&t.call(f)}finally{if(r)throw r.error}}return{cssStyle:o}}}));
;/*!node_modules/office-viewer/lib/parse/mergeSdt.js*/
amis.define("6590f09",(function(e,r,a,t){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var l=e("9a586ef");function n(e){var r,a,t=e.slice(),c=0,i=!1;try{for(var s=l.__values(e),d=s.next();!d.done;d=s.next()){var o=d.value;switch(o.tagName){case"w:smartTag":case"w:customXml":var u=[].slice.call(o.children);t.splice.apply(t,l.__spreadArray([c,1],l.__read(u),!1)),c+=u.length;continue;case"w:sdt":var f=o.getElementsByTagName("w:sdtContent").item(0);if(o.getElementsByTagName("w:sdt").item(0)&&(i=!0),f){var m=[].slice.call(f.children);t.splice.apply(t,l.__spreadArray([c,1],l.__read(m),!1)),c+=m.length;continue}}c+=1}}catch(e){r={error:e}}finally{try{d&&!d.done&&(a=s.return)&&a.call(s)}finally{if(r)throw r.error}}return i?n(t):t}r.mergeSdt=function(e){return n([].slice.call(e.children))}}));
;/*!node_modules/office-viewer/lib/parse/parseTr.js*/
amis.define("ebebd2d",(function(e,r,a,t){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var s=e("9a586ef"),c=e("5718345"),n=e("35b58c8"),l=e("dc0d3b3"),o=e("dc518ce"),i=e("6590f09");r.parseTr=function(e,r,a){var t,d,b=new c.Tr,f={index:0};try{for(var u=s.__values(i.mergeSdt(r)),p=u.next();!p.done;p=u.next()){var v=p.value,w=v.tagName;switch(w){case"w:tc":var y=n.parseTc(e,v,f,a);y&&b.tcs.push(y);break;case"w:trPr":b.properties=o.parseTrPr(e,v);break;case"w:tblPrEx":var T=l.parseTablePr(e,v);Object.assign(b.properties.cssStyle||{},T.cssStyle);break;default:console.warn("Tr: Unknown tag ",w,v)}}}catch(e){t={error:e}}finally{try{p&&!p.done&&(d=u.return)&&d.call(u)}finally{if(t)throw t.error}}return b}}));
;/*!node_modules/office-viewer/lib/parse/parseTable.js*/
amis.define("b7e52c8",(function(e,r,a,t){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=e("9a586ef"),l=e("1c1a6b2"),o=e("ebebd2d"),c=e("dc0d3b3"),s=e("5d393c3"),i=e("6590f09");function u(e){var r,a,t=[],l=e.getElementsByTagName("w:gridCol");try{for(var o=n.__values(l),c=o.next();!c.done;c=o.next()){var i=c.value,u=s.parseSize(i,"w:w");t.push({w:u})}}catch(e){r={error:e}}finally{try{c&&!c.done&&(a=o.return)&&a.call(o)}finally{if(r)throw r.error}}return t}r.parseTable=function(e,r){var a,t,s=new l.Table,d={};try{for(var f=n.__values(i.mergeSdt(r)),b=f.next();!b.done;b=f.next()){var w=b.value,v=w.tagName;switch(v){case"w:tblPr":s.properties=c.parseTablePr(e,w);break;case"w:tr":s.trs.push(o.parseTr(e,w,d));break;case"w:tblGrid":s.tblGrid=u(w);break;default:console.warn("Table.fromXML unknown tag",v,w)}}}catch(e){a={error:e}}finally{try{b&&!b.done&&(t=f.return)&&t.call(f)}finally{if(a)throw a.error}}return s}}));
;/*!node_modules/office-viewer/lib/openxml/word/wps/WPSStyle.js*/
amis.define("d6f7eb2",(function(e,r,l,o){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var a=e("9a586ef"),n=e("23086c1"),t=function(){function e(){}return e.fromXML=function(r,l){var o,t,f=new e;try{for(var i=a.__values(l.children),c=i.next();!c.done;c=i.next()){var s=c.value;switch(s.tagName){case"a:fillRef":f.fillColor=n.parseChildColor(r,s);break;case"a:lnRef":f.lineColor=n.parseChildColor(r,s);break;case"a:fontRef":f.fontColor=n.parseChildColor(r,s)}}}catch(e){o={error:e}}finally{try{c&&!c.done&&(t=i.return)&&t.call(i)}finally{if(o)throw o.error}}return f},e}();r.WPSStyle=t}));
;/*!node_modules/office-viewer/lib/openxml/word/wps/WPS.js*/
amis.define("9727e64",(function(e,r,a,t){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=e("9a586ef"),c=e("d78ccf3"),o=e("c43c851"),l=e("b7e52c8"),s=e("5d393c3"),i=e("d6f7eb2");function v(e,r){var a,t;try{for(var c=n.__values(e.attributes),o=c.next();!o.done;o=c.next()){var l=o.value,i=l.name,v=l.value;switch(i){case"numCol":"1"!==v&&(r["column-count"]=v);break;case"vert":switch(v){case"vert":r["writing-mode"]="vertical-rl",r["text-orientation"]="sideways";break;case"vert270":case"eaVert":r["writing-mode"]="vertical-rl",r["text-orientation"]="mixed"}break;case"anchor":switch(v){case"b":r["vertical-align"]="bottom";break;case"t":r["vertical-align"]="top";break;case"ctr":r["vertical-align"]="middle"}break;case"rot":var f=s.convertAngle(v);f&&(r.transform="rotate(".concat(f,"deg)"))}}}catch(e){a={error:e}}finally{try{o&&!o.done&&(t=c.return)&&t.call(c)}finally{if(a)throw a.error}}}var f=function(){function e(){this.style={}}return e.fromXML=function(r,a){var t,s,f,u,b=new e;b.txbxContent=[];try{for(var w=n.__values(a.children),d=w.next();!d.done;d=w.next()){var h=d.value,y=h.tagName;switch(y){case"wps:cNvSpPr":case"wps:cNvPr":break;case"wps:spPr":b.spPr=o.ShapePr.fromXML(r,h);break;case"wps:txbx":var p=h.firstElementChild;if(p)try{for(var x=(f=void 0,n.__values(p.children)),m=x.next();!m.done;m=x.next()){var k=m.value;switch(k.tagName){case"w:p":b.txbxContent.push(c.Paragraph.fromXML(r,k));break;case"w:tbl":b.txbxContent.push(l.parseTable(r,k))}}}catch(e){f={error:e}}finally{try{m&&!m.done&&(u=x.return)&&u.call(x)}finally{if(f)throw f.error}}else console.warn("unknown wps:txbx",h);break;case"wps:style":b.wpsStyle=i.WPSStyle.fromXML(r,h);break;case"wps:bodyPr":v(h,b.style);break;default:console.warn("WPS: Unknown tag ",y,h)}}}catch(e){t={error:e}}finally{try{d&&!d.done&&(s=w.return)&&s.call(w)}finally{if(t)throw t.error}}return b},e}();r.WPS=f}));
;/*!node_modules/office-viewer/lib/openxml/drawing/diagram/Diagram.js*/
amis.define("8063b45",(function(e,r,t,n){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function e(){}return e.fromXML=function(r,t){var n=new e,o=t.getAttribute("r:dm");if(o){var i=r.getDocumentRels(o);if(i){var u=r.loadWordRelXML(i);console.log(u)}}return n},e}();r.Diagram=o}));
;/*!node_modules/office-viewer/lib/openxml/word/wps/WPG.js*/
amis.define("45e4f77",(function(r,e,a,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var c=r("9a586ef"),p=r("9727e64"),t=r("c43c851"),f=r("1efdfad"),o=function(){function r(){}return r.fromXML=function(e,a){var n,o,s=new r,i=[];s.wps=i,s.wpg=[];try{for(var u=c.__values(a.children),l=u.next();!l.done;l=u.next()){var w=l.value,d=w.tagName;switch(d){case"wpg:cNvGrpSpPr":break;case"wpg:grpSpPr":s.spPr=t.ShapePr.fromXML(e,w);break;case"wps:wsp":i.push(p.WPS.fromXML(e,w));break;case"pic:pic":s.pic=f.Pic.fromXML(e,w);break;case"wpg:grpSp":s.wpg.push(r.fromXML(e,w));break;default:console.warn("WPS: Unknown tag ",d,w)}}}catch(r){n={error:r}}finally{try{l&&!l.done&&(o=u.return)&&o.call(u)}finally{if(n)throw n.error}}return s},r}();e.WPG=o}));
;/*!node_modules/office-viewer/lib/openxml/drawing/Drawing.js*/
amis.define("c649ee4",(function(e,t,i,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n,r=e("9a586ef"),o=e("5d393c3"),s=e("5ab481b"),p=e("1efdfad"),l=e("9727e64"),c=e("8063b45"),g=e("45e4f77");t.Position=void 0,(n=t.Position||(t.Position={})).inline="inline",n.anchor="anchor";var u=function(){function e(){this.position=t.Position.inline}return e.fromXML=function(i,a){var n,u,f,m=new e,d={};m.containerStyle=d;var h=a.firstElementChild;if(h){if("wp:anchor"===h.tagName){m.position=t.Position.anchor,m.anchor=function(e){return{simplePos:s.getAttrBoolean(e,"simplePos",!1),hidden:s.getAttrBoolean(e,"hidden",!1),behindDoc:s.getAttrBoolean(e,"behindDoc",!1)}}(h);var w=s.getAttrNumber(h,"relativeHeight",1);d["z-index"]=w}try{for(var v=r.__values(h.children),b=v.next();!b.done;b=v.next()){var L=b.value,P=L.tagName;switch(P){case"wp:simplePos":(null===(f=m.anchor)||void 0===f?void 0:f.simplePos)&&(d.position="absolute",d.x=o.parseSize(L,"x",o.LengthUsage.Emu),d.y=o.parseSize(L,"y",o.LengthUsage.Emu));break;case"wp:positionH":var k=L.getAttribute("relativeFrom");if("column"===k||"page"===k||"margin"===k){if(y=L.firstElementChild){var E=y.tagName;d.position="absolute","wp:posOffset"===E?d.left=o.convertLength(y.innerHTML,o.LengthUsage.Emu):(d.left="0",console.warn("unsupport positionType",E))}}else console.warn("unsupport positionH relativeFrom",k);break;case"wp:positionV":var y,x=L.getAttribute("relativeFrom");if("paragraph"===x||"page"===x){if(m.relativeFromV=x,y=L.firstElementChild){E=y.tagName;d.position="absolute","wp:posOffset"===E?d.top=o.convertLength(y.innerHTML,o.LengthUsage.Emu):(d.top="0",console.warn("unsupport positionType",E))}}else console.warn("unsupport positionV relativeFrom",x);break;case"wp:docPr":m.id=L.getAttribute("id")||void 0,m.name=L.getAttribute("name")||void 0;break;case"wp:cNvGraphicFramePr":case"wp:effectExtent":case"wp:wrapNone":case"wp14:sizeRelH":case"wp14:sizeRelV":break;case"a:graphic":var A=L.firstElementChild,M=null==A?void 0:A.firstElementChild;if(M)switch(M.tagName){case"pic:pic":m.pic=p.Pic.fromXML(i,M);break;case"wps:wsp":m.wps=l.WPS.fromXML(i,M);break;case"wpg:wgp":m.wpg=g.WPG.fromXML(i,M);break;case"dgm:relIds":m.diagram=c.Diagram.fromXML(i,M);break;default:console.warn("unknown graphicData child tag",M)}break;case"wp:extent":d.width=o.parseSize(L,"cx",o.LengthUsage.Emu),d.height=o.parseSize(L,"cy",o.LengthUsage.Emu);break;default:console.warn("drawing unknown tag",P)}}}catch(e){n={error:e}}finally{try{b&&!b.done&&(u=v.return)&&u.call(v)}finally{if(n)throw n.error}}}return m},e}();t.Drawing=u}));
;/*!node_modules/office-viewer/lib/openxml/word/InstrText.js*/
amis.define("e9cfc4f",(function(e,t,i,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var c=function(e){this.text=e};t.InstrText=c}));
;/*!node_modules/office-viewer/lib/openxml/word/NoBreakHyphen.js*/
amis.define("a55ba63",(function(e,n,a,i){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var t=function(){};n.NoBreakHyphen=t}));
;/*!node_modules/office-viewer/lib/openxml/word/Pict.js*/
amis.define("b9cc761",(function(e,t,n,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(){}return e.fromXML=function(t,n){var i=new e,r=n.getElementsByTagName("v:imagedata").item(0);if(r){var a=r.getAttribute("r:id")||"",c=t.getDocumentRels(a);c&&(i.src=t.loadImage(c))}return i},e}();t.Pict=r}));
;/*!node_modules/office-viewer/lib/openxml/word/Ruby.js*/
amis.define("85a1717",(function(r,e,n,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var t=r("9a586ef"),o=r("300d0bd"),u=function(){function r(){}return r.fromXML=function(e,n){var a,u,l=new r;l.children=[];try{for(var c=t.__values(n.children),f=c.next();!f.done;f=c.next()){var i=f.value,s=i.tagName;if("w:r"===s){var y=o.Run.fromXML(e,i);y&&l.children.push(y)}else console.warn("parse Ruby: Unknown key",s,i)}}catch(r){a={error:r}}finally{try{f&&!f.done&&(u=c.return)&&u.call(c)}finally{if(a)throw a.error}}return l},r}();!function(r){function e(){return null!==r&&r.apply(this,arguments)||this}t.__extends(e,r)}(u);var l=function(){function r(){}return r.fromXML=function(e,n){var a,o,l=new r;try{for(var c=t.__values(n.children),f=c.next();!f.done;f=c.next()){var i=f.value,s=i.tagName;switch(s){case"w:rubyPr":break;case"w:rt":l.rt=u.fromXML(e,i);break;case"w:rubyBase":l.rubyBase=u.fromXML(e,i);break;default:console.warn("parse Ruby: Unknown key",s,i)}}}catch(r){a={error:r}}finally{try{f&&!f.done&&(o=c.return)&&o.call(c)}finally{if(a)throw a.error}}return l},r}();e.Ruby=l}));
;/*!node_modules/office-viewer/lib/openxml/word/Separator.js*/
amis.define("685cd67",(function(e,t,i,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){};t.Separator=r}));
;/*!node_modules/office-viewer/lib/openxml/word/SoftHyphen.js*/
amis.define("878c9f1",(function(e,n,t,f){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=function(){};n.SoftHyphen=i}));
;/*!node_modules/office-viewer/lib/openxml/word/Sym.js*/
amis.define("0571a6a",(function(t,e,n,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var u=function(){function t(){}return t.parseXML=function(e){var n=new t;return n.font=e.getAttribute("w:font")||"",n.char=e.getAttribute("w:char")||"",n},t}();e.Sym=u}));
;/*!node_modules/office-viewer/lib/openxml/word/Tab.js*/
amis.define("9b86c99",(function(e,t,r,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=e("5ab481b"),i=e("5d393c3"),u=function(){function e(){}return e.fromXML=function(t,r){var n=new e;return n.pos=i.parseSize(r,"w:pos"),n.type=a.getVal(r),n.leader=r.getAttribute("w:leader"),n},e}();t.Tab=u}));
;/*!node_modules/office-viewer/lib/openxml/word/Run.js*/
amis.define("300d0bd",(function(e,a,r,t){"use strict";Object.defineProperty(a,"__esModule",{value:!0});var n=e("9a586ef"),d=e("5ab481b"),i=e("c5cba64"),c=e("545dd66"),s=e("c649ee4"),o=e("e9cfc4f"),l=e("a55ba63"),w=e("b9cc761"),h=e("85a1717"),b=e("685cd67"),f=e("878c9f1"),p=e("0571a6a"),u=e("9b86c99"),k=function(e){this.preserveSpace=!1,this.text=String(e)},y=function(){function e(){this.properties={},this.children=[]}return e.prototype.addChild=function(e){e&&this.children.push(e)},e.parseRunPr=function(e,a){var r,t=i.parsePr(e,a),n=a.getElementsByTagName("w:rStyle").item(0);return n&&(r=d.getVal(n)),{cssStyle:t,rStyle:r}},e.fromXML=function(a,r){var t,d,i=new e;try{for(var y=n.__values(r.children),C=y.next();!C.done;C=y.next()){var m=C.value,g=m.tagName;switch(g){case"w:t":var v=m.textContent||"",M=new k(v);i.addChild(M);break;case"w:rPr":i.properties=e.parseRunPr(a,m);break;case"w:br":case"w:cr":i.addChild(c.Break.fromXML(a,m));break;case"w:drawing":i.addChild(s.Drawing.fromXML(a,m));break;case"w:tab":i.addChild(u.Tab.fromXML(a,m));break;case"w:fldChar":i.fldChar=m.getAttribute("w:fldCharType");break;case"w:instrText":i.addChild(new o.InstrText(m.textContent||""));break;case"w:lastRenderedPageBreak":var S=new c.Break;S.type="page",i.addChild(S);break;case"w:pict":i.addChild(w.Pict.fromXML(a,m));break;case"w:ruby":i.addChild(h.Ruby.fromXML(a,m));break;case"w:sym":i.addChild(p.Sym.parseXML(m));break;case"mc:AlternateContent":var x=m.getElementsByTagName("w:drawing").item(0);x&&i.addChild(s.Drawing.fromXML(a,x));break;case"w:softHyphen":i.addChild(new f.SoftHyphen);break;case"w:noBreakHyphen":i.addChild(new l.NoBreakHyphen);break;case"w:separator":i.addChild(new b.Separator);break;case"w:continuationSeparator":break;default:console.warn("parse Run: Unknown key",g,m)}}}catch(e){t={error:e}}finally{try{C&&!C.done&&(d=y.return)&&d.call(y)}finally{if(t)throw t.error}}return i},e}();a.Run=y,a.Text=k}));
;/*!node_modules/office-viewer/lib/openxml/word/Hyperlink.js*/
amis.define("08b2e1b",(function(e,r,t,n){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var i=e("9a586ef"),o=e("300d0bd"),a=function(){function e(){this.children=[]}return e.prototype.addChild=function(e){this.children.push(e)},e.fromXML=function(r,t){var n,a,l=new e,u=t.getAttribute("r:id");if(u){var c=r.getDocumentRels(u);c&&(l.relation=c)}var d=t.getAttribute("w:anchor");d&&(l.anchor=d);var f=t.getAttribute("w:tooltip");f&&(l.tooltip=f);try{for(var h=i.__values(t.children),s=h.next();!s.done;s=h.next()){var v=s.value,p=v.tagName;if("w:r"===p)l.addChild(o.Run.fromXML(r,v));else console.warn("parse Hyperlink: Unknown key",p,v)}}catch(e){n={error:e}}finally{try{s&&!s.done&&(a=h.return)&&a.call(h)}finally{if(n)throw n.error}}return l},e}();r.Hyperlink=a}));
;/*!node_modules/office-viewer/lib/openxml/word/numbering/NumberProperties.js*/
amis.define("fd7494c",(function(e,t,n,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=e("5ab481b"),i=function(){function e(){}return e.fromXML=function(t,n){var r=new e,i=n.getElementsByTagName("w:ilvl").item(0);i&&(r.ilvl=a.getVal(i));var u=n.getElementsByTagName("w:numId").item(0);return u&&(r.numId=a.getVal(u)),r},e}();t.NumberPr=i}));
;/*!node_modules/office-viewer/lib/openxml/word/InlineText.js*/
amis.define("e1375d7",(function(e,r,a,n){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var o=e("9a586ef"),t=e("6541de0"),d=e("08b2e1b"),i=e("300d0bd"),l=function(){function e(){this.children=[]}return e.prototype.addChild=function(e){this.children.push(e)},e.fromXML=function(r,a){var n,l,c=new e;try{for(var s=o.__values(a.children),f=s.next();!f.done;f=s.next()){var u=f.value,h=u.tagName;switch(h){case"w:r":c.addChild(i.Run.fromXML(r,u));break;case"w:hyperlink":c.addChild(d.Hyperlink.fromXML(r,u));break;case"w:bookmarkStart":c.addChild(t.BookmarkStart.fromXML(r,u));case"w:bookmarkEnd":case"w:proofErr":case"w:noProof":case"w:smartTagPr":case"w:del":break;default:console.warn("parse Inline: Unknown key",h,u)}}}catch(e){n={error:e}}finally{try{f&&!f.done&&(l=s.return)&&l.call(s)}finally{if(n)throw n.error}}return c},e}();r.InlineText=l}));
;/*!node_modules/office-viewer/lib/openxml/word/FldSimple.js*/
amis.define("7dc0eed",(function(e,n,t,i){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=e("e1375d7"),u=function(){function e(){}return e.fromXML=function(n,t){var i=new e;return i.inlineText=r.InlineText.fromXML(n,t),i.instr=t.getAttribute("w:instr")||"",i},e}();n.FldSimple=u}));
;/*!node_modules/office-viewer/lib/openxml/math/OMath.js*/
amis.define("131d858",(function(e,n,t,r){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var u=function(){function e(){}return e.fromXML=function(n,t){var r=new e;return r.element=t,r},e}();n.OMath=u}));
;/*!node_modules/office-viewer/lib/openxml/word/Paragraph.js*/
amis.define("d78ccf3",(function(e,a,r,t){"use strict";Object.defineProperty(a,"__esModule",{value:!0});var o=e("9a586ef"),n=e("5ab481b"),l=e("c5cba64"),s=e("6541de0"),c=e("08b2e1b"),d=e("fd7494c"),i=e("300d0bd"),m=e("9b86c99"),f=e("7dc0eed"),p=e("131d858"),u=e("6590f09");var h=function(){function e(){this.properties={},this.children=[],this.fldSimples=[]}return e.prototype.addChild=function(e){this.children.push(e)},e.parseParagraphPr=function(e,a){var r,t,s,c,i=l.parsePr(e,a),f=a.getElementsByTagName("w:pStyle").item(0);f&&(s=n.getVal(f));var p=a.getElementsByTagName("w:numPr").item(0);p&&(c=d.NumberPr.fromXML(e,p));var u=[],h=a.getElementsByTagName("w:tab");try{for(var w=o.__values(h),b=w.next();!b.done;b=w.next()){var y=b.value;u.push(m.Tab.fromXML(e,y))}}catch(e){r={error:e}}finally{try{b&&!b.done&&(t=w.return)&&t.call(w)}finally{if(r)throw r.error}}var v=function(e){var a=e.getElementsByTagName("w:autoSpaceDE").item(0),r=e.getElementsByTagName("w:autoSpaceDN").item(0);return!!a||!!r}(a);return{cssStyle:i,pStyle:s,numPr:c,tabs:u,autoSpace:v}},e.fromXML=function(a,r){var t,n,l=new e;l.fldSimples=[],l.paraId=r.getAttribute("w14:paraId")||"";try{for(var d=o.__values(u.mergeSdt(r)),m=d.next();!m.done;m=d.next()){var h=m.value,w=h.tagName;switch(w){case"w:pPr":l.properties=e.parseParagraphPr(a,h);break;case"w:r":l.addChild(i.Run.fromXML(a,h));break;case"w:hyperlink":l.addChild(c.Hyperlink.fromXML(a,h));break;case"w:bookmarkStart":l.addChild(s.BookmarkStart.fromXML(a,h));case"w:bookmarkEnd":case"w:proofErr":case"w:noProof":case"w:del":case"w:moveTo":case"w:moveFrom":break;case"w:fldSimple":l.fldSimples.push(f.FldSimple.fromXML(a,h));break;case"m:oMathPara":case"m:oMath":l.addChild(p.OMath.fromXML(a,h));break;default:console.warn("parse Paragraph: Unknown key",w,h)}}}catch(e){t={error:e}}finally{try{m&&!m.done&&(n=d.return)&&n.call(d)}finally{if(t)throw t.error}}return l},e}();a.Paragraph=h}));
;/*!node_modules/office-viewer/lib/openxml/Style.js*/
amis.define("470735b",(function(e,r,a,t){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=e("9a586ef"),l=e("531b67e"),s=e("5ab481b"),c=e("d78ccf3"),i=e("300d0bd"),u=e("dc0d3b3"),w=e("dc518ce");function P(e,r){var a,t,s={};try{for(var P=n.__values(r.children),y=P.next();!y.done;y=P.next()){var o=y.value;switch(o.tagName){case"w:rPr":s.rPr=i.Run.parseRunPr(e,o);break;case"w:pPr":s.pPr=c.Paragraph.parseParagraphPr(e,o);break;case"w:tblPr":s.tblPr=u.parseTablePr(e,o);break;case"w:tcPr":s.tcPr=l.parseTcPr(e,o);break;case"w:trPr":s.trPr=w.parseTrPr(e,o)}}}catch(e){a={error:e}}finally{try{y&&!y.done&&(t=P.return)&&t.call(P)}finally{if(a)throw a.error}}return s}function y(e,r){var a,t,l={};l.id=r.getAttribute("w:styleId")||"",l.type=r.getAttribute("w:type"),l.tblStylePr={},Object.assign(l,P(e,r));try{for(var c=n.__values(r.children),i=c.next();!i.done;i=c.next()){var u=i.value,w=u.tagName;switch(w){case"w:name":l.name=s.getVal(u);break;case"w:basedOn":l.basedOn=s.getVal(u);break;case"w:rPr":case"w:pPr":case"w:tblPr":case"w:tcPr":case"w:trPr":case"w:next":case"w:link":case"w:unhideWhenUsed":case"w:qFormat":case"w:rsid":case"w:uiPriority":case"w:semiHidden":case"w:autoRedefine":break;case"w:tblStylePr":var y=u.getAttribute("w:type");l.tblStylePr[y]=P(e,u);break;default:console.warn("parseStyle Unknown tag",w,u)}}}catch(e){a={error:e}}finally{try{i&&!i.done&&(t=c.return)&&t.call(c)}finally{if(a)throw a.error}}return l}r.parseStyles=function(e,r){var a,t,l={styleMap:{}},s=Array.from(r.getElementsByTagName("w:style"));try{for(var u=n.__values(s),w=u.next();!w.done;w=u.next()){var P=y(e,w.value);P.id&&(l.styleMap[P.id]=P)}}catch(e){a={error:e}}finally{try{w&&!w.done&&(t=u.return)&&t.call(u)}finally{if(a)throw a.error}}return l.defaultStyle=function(e,r){var a={};if(!r)return a;var t=r.getElementsByTagName("w:rPrDefault").item(0);if(t){var n=t.getElementsByTagName("w:rPr").item(0);n&&(a.rPr=i.Run.parseRunPr(e,n))}var l=r.getElementsByTagName("w:pPrDefault").item(0);if(l){var s=l.getElementsByTagName("w:pPr").item(0);s&&(a.pPr=c.Paragraph.parseParagraphPr(e,s))}return a}(e,r.getElementsByTagName("w:docDefaults").item(0)),l}}));
;/*!node_modules/office-viewer/lib/openxml/Theme.js*/
amis.define("2dd0f99",(function(e,t,r,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=e("9a586ef"),c=e("5d393c3"),l=e("5ab481b"),o=function(){this.colors={}};function s(e){var t={};return e&&(t.clrScheme=function(e){var t,r,n=new o;if(!e)return n;n.name=e.getAttribute("name")||"";try{for(var s=a.__values(e.children),m=s.next();!m.done;m=s.next()){var i=m.value,f=i.tagName.replace("a:",""),g=i.firstElementChild;if(g){var u=g.nodeName.replace("a:","");if("sysClr"===u)n.colors[f]=g.getAttribute("lastClr")||"";else if("srgbClr"===u)n.colors[f]="#"+g.getAttribute("val")||"";else if("scrgbClr"===u){var h=256*l.getAttrPercent(i,"r"),v=256*l.getAttrPercent(i,"g"),b=256*l.getAttrPercent(i,"b");n.colors[f]="rgb(".concat(h,", ").concat(v,", ").concat(b,")")}else if("hslClr"===u){var d=c.convertAngle(i.getAttribute("hue")),y=100*l.getAttrPercent(i,"sat"),A=100*l.getAttrPercent(i,"lum");n.colors[f]="hsl(".concat(d,", ").concat(y,"%, ").concat(A,"%)")}else"prstClr"===u?n.colors[f]=l.getVal(i):console.error("unknown clr name",u)}}}catch(e){t={error:e}}finally{try{m&&!m.done&&(r=s.return)&&r.call(s)}finally{if(t)throw t.error}}return n}(e.getElementsByTagName("a:clrScheme").item(0)),t.fontScheme=(e.getElementsByTagName("a:fontScheme").item(0),{}),t.fmtScheme=(e.getElementsByTagName("a:fmtScheme").item(0),{})),t}t.parseTheme=function(e){var t={};return t.themeElements=s(e.getElementsByTagName("a:themeElements").item(0)),t}}));
;/*!node_modules/office-viewer/lib/util/dom.js*/
amis.define("872e6b7",(function(e,n,t,a){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=e("9a586ef");n.addClassName=function(e,n){e&&n&&e.classList.add(n)},n.addClassNames=function(e,n){var t;e&&n&&(t=e.classList).add.apply(t,r.__spreadArray([],r.__read(n),!1))},n.appendChild=function(e,n){e&&n&&e.appendChild(n)},n.applyStyle=function(e,n){if(n)for(var t in n){var a=n[t];null!=a&&""!==a&&e.style.setProperty(t,String(a))}},n.createElement=function(e){return document.createElement(e)},n.createSVGElement=function(e){return document.createElementNS("http://www.w3.org/2000/svg",e)},n.removeChild=function(e,n){e&&n&&e.removeChild(n)},n.styleToText=function(e){void 0===e&&(e={});var n="";for(var t in e){var a=e[t];null!=a&&""!==a&&(n+="".concat(t,": ").concat(a,";\n"))}return n}}));
;/*!node_modules/office-viewer/lib/render/renderBr.js*/
amis.define("b910b8b",(function(e,r,t,n){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var a=e("872e6b7");r.renderBr=function(e,r){return"page"===r.type&&(e.breakPage=!0),a.createElement("br")}}));
;/*!node_modules/office-viewer/lib/render/renderStyle.js*/
amis.define("8ba8024",(function(n,t,c,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=n("9a586ef"),e=n("872e6b7");function r(n,t,c){var o="",a=c.tblPr,r=c.tcPr;if(a){var l=e.styleToText(a.cssStyle),s=e.styleToText(a.tcCSSStyle);if(o+="\n .".concat(n," .").concat(t," {\n border-collapse: collapse;\n ").concat(l,"\n }\n\n .").concat(n," .").concat(t," > tbody > tr > td {\n ").concat(s,"\n }\n "),a.insideBorder){var i=a.insideBorder;i.H&&(o+="\n .".concat(n," .").concat(t," > tbody > tr > td {\n border-top: ").concat(i.H,";\n }")),i.V&&(o+="\n .".concat(n," .").concat(t," > tbody > tr > td {\n border-left: ").concat(i.V,";\n }"))}}if(r){var d=e.styleToText(r.cssStyle);o+="\n .".concat(n," .").concat(t," > tbody > tr > td {\n ").concat(d,"\n }\n ")}return o}function l(n,t,c,o){var a,r,l,s,i,d,y="",v=e.styleToText(null===(a=o.trPr)||void 0===a?void 0:a.cssStyle),b="";switch(c){case"firstCol":b="enable-firstColumn";break;case"lastCol":b="enable-lastColumn";break;case"firstRow":b="enable-firstRow";break;case"lastRow":b="enable-lastRow";break;case"band1Horz":case"band2Horz":b="enable-hBand";break;case"band1Vert":case"band2Vert":b="enable-vBand"}v&&(y+="\n ".concat(n,".").concat(b," > tbody > tr.").concat(c,"{\n ").concat(v,"\n }\n "));var f=e.styleToText(null===(r=o.tcPr)||void 0===r?void 0:r.cssStyle);if(f&&(y+="\n ".concat(n,".").concat(b," > tbody > tr > td.").concat(c," {\n ").concat(f,"\n }\n "),null===(l=o.tcPr)||void 0===l?void 0:l.insideBorder)){var u=null===(s=o.tcPr)||void 0===s?void 0:s.insideBorder;u.H&&(y+="\n ".concat(n,".").concat(b," > tbody > tr > td.").concat(c," {\n border-top: ").concat(u.H,";\n }")),u.V&&("none"===u.V?y+="\n ".concat(n,".").concat(b," > tbody > tr > td.").concat(c," {\n border-left: none;\n border-right: none;\n }"):y+="\n ".concat(n,".").concat(b," > tbody > tr > td.").concat(c," {\n border-left: ").concat(u.V,";\n }"))}var T=e.styleToText(null===(i=o.pPr)||void 0===i?void 0:i.cssStyle);T&&(y+="\n ".concat(n,".").concat(b," > tbody > tr > td.").concat(c," > .").concat(t,"-p {\n ").concat(T,"\n }\n "));var S=e.styleToText(null===(d=o.rPr)||void 0===d?void 0:d.cssStyle);return S&&(y+="\n ".concat(n,".").concat(b," > tbody > tr > td.").concat(c," > .").concat(t,"-p > .").concat(t,"-r {\n ").concat(S,"\n }\n ")),y}var s=new Set(["wholeTable","band1Horz","band2Horz","band1Vert","band2Vert","firstCol","firstRow","lastCol","lastRow","neCell","nwCell","seCell","swCell"]);function i(n,t,c){var o,e;if(!c)return"";var r="",i=".".concat(n," .").concat(t);try{for(var d=a.__values(s),y=d.next();!y.done;y=d.next()){var v=y.value;if(v in c)r+=l(i,n,v,c[v])}}catch(n){o={error:n}}finally{try{y&&!y.done&&(e=d.return)&&e.call(d)}finally{if(o)throw o.error}}return r}t.generateTableStyle=r,t.renderStyle=function(n){var t=e.createElement("style"),c=function(n){var t,c=n.styles.defaultStyle,o="";(null==c?void 0:c.pPr)&&(o=e.styleToText(c.pPr.cssStyle));var a="";(null==c?void 0:c.rPr)&&(a=e.styleToText(c.rPr.cssStyle));var r=(null===(t=n.settings)||void 0===t?void 0:t.autoHyphenation)?"hyphens: auto;":"",l=n.getClassPrefix();return"\n\n\n /** docDefaults **/\n .".concat(l," {\n --docx-theme-font-minorHAnsi: Calibri, Helvetica, Arial, 'Helvetica Neue';\n --docx-theme-font-minorEastAsia: 'PingFang SC', 'Microsoft YaHei', 'Hiragino Sans GB', 'STHeiti',\n 'Microsoft YaHei';\n }\n\n .").concat(l," p {\n margin: 0;\n padding: 0;\n line-height: 1.5;\n ").concat(r,"\n }\n\n .").concat(l," .justify {\n text-align-last: left;\n }\n\n .").concat(l," table {\n border-spacing: 0;\n }\n\n .").concat(l," .").concat(l,"-p {\n ").concat(o,"\n }\n\n .").concat(l," .").concat(l,"-r {\n overflow-wrap: break-word;\n ").concat(a,"\n }\n ")}(n),o=function(n){var t=n.styles.styleMap,c=n.getClassPrefix(),o="";for(var a in t){var l=n.getStyleIdDisplayName(a),s=t[
;/*!node_modules/office-viewer/lib/render/setElementStyle.js*/
amis.define("cec919e",(function(e,s,t,l){"use strict";Object.defineProperty(s,"__esModule",{value:!0});var a=e("872e6b7");s.setElementStyle=function(e,s,t){t&&(t.cssStyle&&(a.applyStyle(s,t.cssStyle),"justify"===t.cssStyle["text-align"]&&a.addClassName(s,"justify")),t.pStyle&&a.addClassNames(s,e.getStyleClassName(t.pStyle)),t.rStyle&&a.addClassNames(s,e.getStyleClassName(t.rStyle)))}}));
;/*!node_modules/office-viewer/lib/render/renderTable.js*/
amis.define("03b19df",(function(e,a,t,l){"use strict";Object.defineProperty(a,"__esModule",{value:!0});var r=e("9a586ef"),n=e("d78ccf3"),d=e("1c1a6b2"),s=e("872e6b7"),o=e("88daac0"),i=e("8ba8024"),c=e("cec919e");function p(e,a,t,l,r,n,d){0===e&&0===a&&r.classList.add("nwCell"),0===e&&a===l-1&&r.classList.add("neCell"),e===t-1&&0===a&&r.classList.add("swCell"),e===t-1&&a===l-1&&r.classList.add("seCell"),0===e&&r.classList.add("firstRow"),e===t-1&&r.classList.add("lastRow"),0===a&&r.classList.add("firstCol"),a===l-1&&r.classList.add("lastCol"),f(e+1)&&r.classList.add("band1Horz"),f(e+1)||r.classList.add("band2Horz"),f(a+1)&&r.classList.add("band1Vert"),f(a+1)||r.classList.add("band2Vert")}function f(e,a){return!(e%2)}a.default=function e(a,t){var l,f,v,u,b,y,C=document.createElement("table"),h=t.properties;if(h.tblCaption){var L=document.createElement("caption");L.textContent=h.tblCaption,C.appendChild(L)}if(h.tblLook)for(var m in h.tblLook)"noHBand"===m?h.tblLook[m]||s.addClassName(C,"enable-hBand"):"noVBand"===m?h.tblLook[m]||s.addClassName(C,"enable-vBand"):h.tblLook[m]&&s.addClassName(C,"enable-"+m);c.setElementStyle(a,C,h);var S=a.genClassName();C.classList.add(S),a.appendStyle(i.generateTableStyle(a.getClassPrefix(),S,{tblPr:h}));var w=document.createElement("tbody");C.appendChild(w);var g=0;try{for(var x=r.__values(t.trs),_=x.next();!_.done;_=x.next()){var k=_.value,E=document.createElement("tr");w.appendChild(E);var B=0;try{for(var z=(v=void 0,r.__values(k.tcs)),N=z.next();!N.done;N=z.next()){var P=N.value,H=document.createElement("td");E.appendChild(H),p(g,B,t.trs.length,k.tcs.length,H,h.rowBandSize,h.colBandSize),k.properties.tcStyle&&s.applyStyle(H,k.properties.tcStyle);var V=P.properties;c.setElementStyle(a,H,V),V.gridSpan&&(H.colSpan=V.gridSpan),V.rowSpan&&(H.rowSpan=V.rowSpan);var M=!0;V.hideMark&&(M=!1);try{for(var R=(b=void 0,r.__values(P.children)),T=R.next();!T.done;T=R.next()){var j=T.value;if(j instanceof n.Paragraph){var O=o.default(a,j,M);s.appendChild(H,O)}else j instanceof d.Table?(M=!1,s.appendChild(H,e(a,j))):console.warn("unknown child type: "+j)}}catch(e){b={error:e}}finally{try{T&&!T.done&&(y=R.return)&&y.call(R)}finally{if(b)throw b.error}}V.rowSpan?B+=V.rowSpan:B++}}catch(e){v={error:e}}finally{try{N&&!N.done&&(u=z.return)&&u.call(z)}finally{if(v)throw v.error}}g++}}catch(e){l={error:e}}finally{try{_&&!_.done&&(f=x.return)&&f.call(x)}finally{if(l)throw l.error}}return C}}));
;/*!node_modules/office-viewer/lib/openxml/drawing/presetShape.js*/
amis.define("8499684",(function(n,t,y,x){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.presetShape={accentBorderCallout1:{avLst:[{n:"adj1",f:"val 18750"},{n:"adj2",f:"val -8333"},{n:"adj3",f:"val 112500"},{n:"adj4",f:"val -38333"}],gdLst:[{n:"y1",f:"*/ h adj1 100000"},{n:"x1",f:"*/ w adj2 100000"},{n:"y2",f:"*/ h adj3 100000"},{n:"x2",f:"*/ w adj4 100000"}],pathLst:[{defines:[{type:"moveTo",pt:{x:"l",y:"t"}},{type:"lnTo",pt:{x:"r",y:"t"}},{type:"lnTo",pt:{x:"r",y:"b"}},{type:"lnTo",pt:{x:"l",y:"b"}},{type:"close"}],extrusionOk:!1,stroke:!0},{defines:[{type:"moveTo",pt:{x:"x1",y:"t"}},{type:"close"},{type:"lnTo",pt:{x:"x1",y:"b"}}],fill:"none",extrusionOk:!1,stroke:!0},{defines:[{type:"moveTo",pt:{x:"x1",y:"y1"}},{type:"lnTo",pt:{x:"x2",y:"y2"}}],fill:"none",extrusionOk:!1,stroke:!0}]},accentBorderCallout2:{avLst:[{n:"adj1",f:"val 18750"},{n:"adj2",f:"val -8333"},{n:"adj3",f:"val 18750"},{n:"adj4",f:"val -16667"},{n:"adj5",f:"val 112500"},{n:"adj6",f:"val -46667"}],gdLst:[{n:"y1",f:"*/ h adj1 100000"},{n:"x1",f:"*/ w adj2 100000"},{n:"y2",f:"*/ h adj3 100000"},{n:"x2",f:"*/ w adj4 100000"},{n:"y3",f:"*/ h adj5 100000"},{n:"x3",f:"*/ w adj6 100000"}],pathLst:[{defines:[{type:"moveTo",pt:{x:"l",y:"t"}},{type:"lnTo",pt:{x:"r",y:"t"}},{type:"lnTo",pt:{x:"r",y:"b"}},{type:"lnTo",pt:{x:"l",y:"b"}},{type:"close"}],extrusionOk:!1,stroke:!0},{defines:[{type:"moveTo",pt:{x:"x1",y:"t"}},{type:"close"},{type:"lnTo",pt:{x:"x1",y:"b"}}],fill:"none",extrusionOk:!1,stroke:!0},{defines:[{type:"moveTo",pt:{x:"x1",y:"y1"}},{type:"lnTo",pt:{x:"x2",y:"y2"}},{type:"lnTo",pt:{x:"x3",y:"y3"}}],fill:"none",extrusionOk:!1,stroke:!0}]},accentBorderCallout3:{avLst:[{n:"adj1",f:"val 18750"},{n:"adj2",f:"val -8333"},{n:"adj3",f:"val 18750"},{n:"adj4",f:"val -16667"},{n:"adj5",f:"val 100000"},{n:"adj6",f:"val -16667"},{n:"adj7",f:"val 112963"},{n:"adj8",f:"val -8333"}],gdLst:[{n:"y1",f:"*/ h adj1 100000"},{n:"x1",f:"*/ w adj2 100000"},{n:"y2",f:"*/ h adj3 100000"},{n:"x2",f:"*/ w adj4 100000"},{n:"y3",f:"*/ h adj5 100000"},{n:"x3",f:"*/ w adj6 100000"},{n:"y4",f:"*/ h adj7 100000"},{n:"x4",f:"*/ w adj8 100000"}],pathLst:[{defines:[{type:"moveTo",pt:{x:"l",y:"t"}},{type:"lnTo",pt:{x:"r",y:"t"}},{type:"lnTo",pt:{x:"r",y:"b"}},{type:"lnTo",pt:{x:"l",y:"b"}},{type:"close"}],extrusionOk:!1,stroke:!0},{defines:[{type:"moveTo",pt:{x:"x1",y:"t"}},{type:"close"},{type:"lnTo",pt:{x:"x1",y:"b"}}],fill:"none",extrusionOk:!1,stroke:!0},{defines:[{type:"moveTo",pt:{x:"x1",y:"y1"}},{type:"lnTo",pt:{x:"x2",y:"y2"}},{type:"lnTo",pt:{x:"x3",y:"y3"}},{type:"lnTo",pt:{x:"x4",y:"y4"}}],fill:"none",extrusionOk:!1,stroke:!0}]},accentCallout1:{avLst:[{n:"adj1",f:"val 18750"},{n:"adj2",f:"val -8333"},{n:"adj3",f:"val 112500"},{n:"adj4",f:"val -38333"}],gdLst:[{n:"y1",f:"*/ h adj1 100000"},{n:"x1",f:"*/ w adj2 100000"},{n:"y2",f:"*/ h adj3 100000"},{n:"x2",f:"*/ w adj4 100000"}],pathLst:[{defines:[{type:"moveTo",pt:{x:"l",y:"t"}},{type:"lnTo",pt:{x:"r",y:"t"}},{type:"lnTo",pt:{x:"r",y:"b"}},{type:"lnTo",pt:{x:"l",y:"b"}},{type:"close"}],extrusionOk:!1,stroke:!1},{defines:[{type:"moveTo",pt:{x:"x1",y:"t"}},{type:"close"},{type:"lnTo",pt:{x:"x1",y:"b"}}],fill:"none",extrusionOk:!1,stroke:!0},{defines:[{type:"moveTo",pt:{x:"x1",y:"y1"}},{type:"lnTo",pt:{x:"x2",y:"y2"}}],fill:"none",extrusionOk:!1,stroke:!0}]},accentCallout2:{avLst:[{n:"adj1",f:"val 18750"},{n:"adj2",f:"val -8333"},{n:"adj3",f:"val 18750"},{n:"adj4",f:"val -16667"},{n:"adj5",f:"val 112500"},{n:"adj6",f:"val -46667"}],gdLst:[{n:"y1",f:"*/ h adj1 100000"},{n:"x1",f:"*/ w adj2 100000"},{n:"y2",f:"*/ h adj3 100000"},{n:"x2",f:"*/ w adj4 100000"},{n:"y3",f:"*/ h adj5 100000"},{n:"x3",f:"*/ w adj6 100000"}],pathLst:[{defines:[{type:"moveTo",pt:{x:"l",y:"t"}},{type:"lnTo",pt:{x:"r",y:"t"}},{type:"lnTo",pt:{x:"r",y:"b"}},{type:"lnTo",pt:{x:"l",y:"b"}},{type:"close"}],extrusionOk:!1,stroke:!1},{defines:[{type:"moveTo",pt:{x:"x1",y:"t"}},{type:"close"},{type:"lnTo",pt:{x:"x1",y:"b"}}],fill:"none",extrusionOk:!1,stroke:!0},{defines:[{type:"moveTo",pt:{x:"x1",y:"y1"}},{type:"lnTo",pt:{x:"x2",y:"y2"}},{type:"
;/*!node_modules/office-viewer/lib/openxml/drawing/svg/formulas.js*/
amis.define("4c59433",(function(n,t,r,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var u=1/6e4/180*Math.PI,e={"*/":function(n,t,r){return n*t/r},"+-":function(n,t,r){return n+t-r},"+/":function(n,t,r){return(n+t)/r},"?:":function(n,t,r){return n>0?t:r},abs:function(n){return Math.abs(n)},at2:function(n,t){return 180*Math.atan2(t,n)*6e4/Math.PI},cat2:function(n,t,r){return n*Math.cos(Math.atan2(r,t))},cos:function(n,t){return n*Math.cos(t*u)},max:function(n,t){return Math.max(n,t)},min:function(n,t){return Math.min(n,t)},mod:function(n,t,r){return Math.sqrt(Math.pow(n,2)+Math.pow(t,2)+Math.pow(r,2))},pin:function(n,t,r){return t<n?n:t>r?r:t},sat2:function(n,t,r){return n*Math.sin(Math.atan2(r,t))},sin:function(n,t){return n*Math.sin(t*u)},sqrt:function(n){return Math.sqrt(n)},tan:function(n,t){return n*Math.tan(t*u)},val:function(n){var t=parseInt(n,10);return isNaN(t),t}};t.evalFmla=function(n,t,r){var a=t.split(/[ ]+/);a.length<=1&&console.warn("fmla format error",t);var u=a[0],i=a.slice(1).map((function(n){if(n in r)return r[n];var a=parseInt(n,10);return isNaN(a)?(console.warn("fmla arg error",n,t),0):a}));if(u in e){var o=e[u].apply(null,i);if(isNaN(o))return console.warn("fmla eval error",t,n),0;r[n]=o}return 0},t.formulas=e}));
;/*!node_modules/office-viewer/lib/openxml/drawing/svg/arcToA.js*/
amis.define("1f3a61e",(function(t,a,n,c){"use strict";Object.defineProperty(a,"__esModule",{value:!0});var e=function(t){return Math.PI*(t/6e4/180)};function r(t,a){return[t[0][0]*a[0]+t[0][1]*a[1],t[1][0]*a[0]+t[1][1]*a[1]]}a.default=function(t,a,n,c,o,u){var h=e(n),i=e(c),s=e(n+c);(function(t,a){if(t===a)return!0;var n=Math.abs(t-a);return n<Number.EPSILON||n<=Number.EPSILON*Math.min(Math.abs(t),Math.abs(a))})(c,216e5)&&(s-=1e-4);var M=function(t,a,n,c,e,o,u){var h=n,i=c,s=[o,u],M=[[Math.cos(e),-Math.sin(e)],[Math.sin(e),Math.cos(e)]],f=[t*Math.cos(h),a*Math.sin(h)],b=r(M,f),v=[s[0]-b[0],s[1]-b[1]],d=[t*Math.cos(i),a*Math.sin(i)],P=r(M,d),m=[v[0]+P[0],v[1]+P[1]];return{x:m[0],y:m[1]}}(t,a,h,s,0,o,u),f=Math.abs(i)>Math.PI?1:0,b=c>0?1:0;return{path:"A ".concat(t," ").concat(a," 0 ").concat(f," ").concat(b," ").concat(M.x,",").concat(M.y),end:M}}}));
;/*!node_modules/office-viewer/lib/openxml/drawing/svg/generateDefines.js*/
amis.define("b9773d3",(function(e,a,t,n){"use strict";Object.defineProperty(a,"__esModule",{value:!0});var c=e("9a586ef"),s=e("1f3a61e");function r(e,a,t){var n=0;if(e in a)n=a[e];else if(n=parseInt(e,10),isNaN(n))return console.warn("var not found",e),0;return t?n*t:n}a.generateDefines=function(e,a,t){var n,o,u=e.defines,p=[],h=e.w,l=e.h,i=1,y=1;h&&(i=a.w/h),l&&(y=a.h/l);try{for(var f=c.__values(u),v=f.next();!v.done;v=f.next()){var x=v.value;switch(x.type){case"moveTo":var d=r((b=x.pt).x,a,i),g=r(b.y,a,y);p.push("M ".concat(d," ").concat(g)),t.push({x:d,y:g});break;case"lnTo":var b;d=r((b=x.pt).x,a,i),g=r(b.y,a,y);p.push("L ".concat(d," ").concat(g)),t.push({x:d,y:g});break;case"arcTo":var w=x,T=r(w.wR,a,i),k=r(w.hR,a,y),m=r(w.stAng,a),z=r(w.swAng,a),B={x:0,y:0};t.length>0&&(B=t[t.length-1]);var _=s.default(T,k,m,z,B.x,B.y);p.push(_.path),t.push({x:_.end.x,y:_.end.y});break;case"quadBezTo":var j=x;if(j.pts.length>=2){var q=j.pts[0],A=j.pts[1],M=r(q.x,a,i),N=r(q.y,a,y),R=r(A.x,a,i),C=r(A.y,a,y);if(p.push("Q ".concat(M,",").concat(N," ").concat(R,",").concat(C)),j.pts.length>2){var D=r((O=j.pts[2]).x,a,i),I=r(O.y,a,y);p.push("T ".concat(D,",").concat(I)),t.push({x:D,y:I})}else t.push({x:R,y:C})}else console.warn("quadBezTo pts length must large than 2",x);break;case"cubicBezTo":var L=x;if(3===L.pts.length){q=L.pts[0],A=L.pts[1];var O=L.pts[2];M=r(q.x,a,i),N=r(q.y,a,y),R=r(A.x,a,i),C=r(A.y,a,y),D=r(O.x,a,i),I=r(O.y,a,y);p.push("C ".concat(M,",").concat(N," ").concat(R,",").concat(C," ").concat(D,",").concat(I)),t.push({x:D,y:I})}else console.warn("cubicBezTo pts length must be 3",x);break;case"close":p.push("Z")}}}catch(e){n={error:e}}finally{try{v&&!v.done&&(o=f.return)&&o.call(f)}finally{if(n)throw n.error}}return p.join(" ")}}));
;/*!node_modules/office-viewer/lib/openxml/drawing/svg/presetVal.js*/
amis.define("6d4d4ca",(function(d,e,s,c){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.presetVal=function(d,e){var s=Math.min(d,e),c=s/6,t=s/6,h=s/8,w=s/32,a=s/16;return{t:0,"3cd4":162e5,"3cd8":81e5,"5cd8":135e5,"7cd8":189e5,b:e,cd2:108e5,cd4:54e5,cd8:27e5,h:e,hd2:e/2,hd3:e/3,hd4:e/4,hd6:e/6,hd8:e/8,l:0,ls:Math.max(d,e),r:d,ss:s,ssd2:c,ssd6:t,ssd8:h,ssd16:a,ssd32:w,hc:d/2,vc:e/2,w:d,wd2:d/2,wd3:d/3,wd4:d/4,wd6:d/6,wd8:d/8,wd10:d/10,wd16:d/16,wd32:d/32}}}));
;/*!node_modules/office-viewer/lib/openxml/drawing/svg/shapeToSVG.js*/
amis.define("5e35155",(function(e,t,r,l){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=e("9a586ef"),n=e("cc1ca20"),i=e("872e6b7"),a=e("4c59433"),s=e("b9773d3"),f=e("6d4d4ca");t.shapeToSVG=function(e,t,r,l,u,c){var b,v,d,y,h,A,x,k,p=i.createSVGElement("svg");p.style.display="block",p.setAttribute("style","display: block; overflow: visible; position: absolute; z-index: -1"),p.setAttribute("width",l.toString()+"px"),p.setAttribute("height",u.toString()+"px");var w=f.presetVal(l,u);try{for(var m=o.__values(e.avLst||[]),_=m.next();!_.done;_=m.next()){var g=_.value;a.evalFmla(g.n,g.f,w)}}catch(e){b={error:e}}finally{try{_&&!_.done&&(v=m.return)&&v.call(m)}finally{if(b)throw b.error}}try{for(var C=o.__values(t),L=C.next();!L.done;L=C.next()){g=L.value;a.evalFmla(g.n,g.f,w)}}catch(e){d={error:e}}finally{try{L&&!L.done&&(y=C.return)&&y.call(C)}finally{if(d)throw d.error}}try{for(var O=o.__values(e.gdLst||[]),S=O.next();!S.done;S=O.next()){g=S.value;a.evalFmla(g.n,g.f,w)}}catch(e){h={error:e}}finally{try{S&&!S.done&&(A=O.return)&&A.call(O)}finally{if(h)throw h.error}}var F=r.outline,H=[];try{for(var V=o.__values(e.pathLst||[]),G=V.next();!G.done;G=V.next()){var E=G.value,j=i.createSVGElement("path"),z=s.generateDefines(E,w,H);j.setAttribute("d",z),r.fillColor?j.setAttribute("fill",r.fillColor):c&&c.fillColor?j.setAttribute("fill",c.fillColor):j.setAttribute("fill","none"),F?(F.color&&j.setAttribute("stroke",F.color),F.width&&j.setAttribute("stroke-width",F.width),"none"===F.style&&j.setAttribute("stroke","none")):c&&c.lineColor?j.setAttribute("stroke",c.lineColor):j.setAttribute("stroke","none");var D=j.getAttribute("fill");if(D&&"none"!==D){var M=new n.Color(D),P=E.fill,T="";switch(P){case"darken":T=M.lumOff(-.5).toHex();break;case"darkenLess":T=M.lumOff(-.2).toHex();break;case"lighten":T=M.lumOff(.5).toHex();break;case"lightenLess":T=M.lumOff(.2).toHex()}T&&j.setAttribute("fill",T)}"none"===E.fill&&j.setAttribute("fill","none"),!1===E.stroke&&(j.setAttribute("stroke","none"),E.fill||j.setAttribute("fill","none")),r.noFill&&j.setAttribute("fill","none"),p.appendChild(j)}}catch(e){x={error:e}}finally{try{G&&!G.done&&(k=V.return)&&k.call(V)}finally{if(x)throw x.error}}return p}}));
;/*!node_modules/office-viewer/lib/render/renderGeom.js*/
amis.define("b52a486",(function(e,r,t,n){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var s=e("8499684"),a=e("5e35155");r.renderGeom=function(e,r,t,n,i){if(e.prst){var u=s.presetShape[e.prst];if(u)return a.shapeToSVG(u,e.avLst||[],r,t,n,i)}return null}}));
;/*!node_modules/office-viewer/lib/render/renderCustGeom.js*/
amis.define("b59bc81",(function(e,n,r,s){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var t=e("5e35155");n.renderCustGeom=function(e,n,r,s,u){return e.shape?t.shapeToSVG(e.shape,[],n,r,s,u):null}}));
;/*!node_modules/office-viewer/lib/render/renderDrawing.js*/
amis.define("fe8e389",(function(e,t,l,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=e("9a586ef"),i=e("d78ccf3"),n=e("872e6b7"),o=e("88daac0"),p=e("03b19df"),c=e("1c1a6b2"),s=e("b52a486"),d=e("b59bc81");function f(e,t,l){var r,a,i;void 0===l&&(l=null);var n=null===(r=e.blipFill)||void 0===r?void 0:r.blip;if(n&&n.src){var o=document.createElement("img");if(o.style.position="relative",o.alt=e.alt||"",o.src=n.src,e.alt&&t.renderOptions.enableVar)if(e.altVar)o.src=e.altVar;else if(e.alt.startsWith("{{")){var p=t.replaceText(e.alt);p&&(o.src=p)}var c=null===(a=e.spPr)||void 0===a?void 0:a.xfrm;if(c){if(l){var s=v(c,null===(i=l.spPr)||void 0===i?void 0:i.xfrm);s&&(o.style.position="absolute",o.style.left=s.left+"px",o.style.top=s.top+"px",o.style.width=s.width+"px",o.style.height=s.height+"px")}else{var d=c.off;d&&(o.style.left=d.x,o.style.top=d.y);var f=c.ext;f&&(o.style.width=f.cx,o.style.height=f.cy)}c.rot&&(o.style.transform="rotate(".concat(c.rot,"deg)"))}return o}return null}function v(e,t){var l=e.off,r=parseFloat(e.ext.cx.replace("px","")),a=parseFloat(e.ext.cy.replace("px",""));if(l&&t.chOff&&t.ext&&t.chExt){var i=parseFloat(t.ext.cx.replace("px",""))/parseFloat(t.chExt.cx.replace("px","")),n=parseFloat(t.ext.cy.replace("px",""))/parseFloat(t.chExt.cy.replace("px","")),o=parseFloat(t.chOff.x.replace("px","")),p=parseFloat(t.chOff.y.replace("px",""));return{left:i*(parseFloat(l.x.replace("px",""))-o),top:n*(parseFloat(l.y.replace("px",""))-p),width:i*r,height:n*a}}return null}function y(e,t,l,r){var f,y,x;void 0===r&&(r=null);var u=l.wpsStyle,h=l.spPr;if(n.applyStyle(t,l.style),(null==u?void 0:u.fontColor)&&(t.style.color=u.fontColor),null==h?void 0:h.xfrm){var m=h.xfrm.ext;if(m){var g=parseFloat(m.cx.replace("px","")),w=parseFloat(m.cy.replace("px",""));if(r){t.style.position="absolute";var b=v(h.xfrm,null===(x=r.spPr)||void 0===x?void 0:x.xfrm);b&&(t.style.left=b.left+"px",t.style.top=b.top+"px",g=b.width,w=b.height)}t.style.width=g+"px",t.style.height=w+"px",h.geom&&n.appendChild(t,s.renderGeom(h.geom,h,g,w,l.wpsStyle)),h.custGeom&&n.appendChild(t,d.renderCustGeom(h.custGeom,h,g,w,l.wpsStyle))}h.xfrm.rot&&(t.style.transform="rotate(".concat(h.xfrm.rot,"deg)"))}var C=l.txbxContent;if(C.length){var F=document.createElement("div");F.dataset.name="textContainer",t.style.display="table",F.style.display="table-cell",F.style.verticalAlign="middle",l.style&&l.style["vertical-align"]&&(F.style.verticalAlign=l.style["vertical-align"],t.style.verticalAlign=""),n.appendChild(t,F);try{for(var E=a.__values(C),_=E.next();!_.done;_=E.next()){var P=_.value;P instanceof i.Paragraph?n.appendChild(F,o.default(e,P)):P instanceof c.Table&&n.appendChild(F,p.default(e,P))}}catch(e){f={error:e}}finally{try{_&&!_.done&&(y=E.return)&&y.call(E)}finally{if(f)throw f.error}}}}function x(e,t){var l,r,i,o,p,c,s=document.createElement("div"),d=document.createElement("div"),v=t.spPr;if(null==v?void 0:v.xfrm){var u=null===(p=null==v?void 0:v.xfrm)||void 0===p?void 0:p.ext;u&&(d.style.width=u.cx,d.style.height=u.cy);var h=null===(c=null==v?void 0:v.xfrm)||void 0===c?void 0:c.rot;h&&(d.style.transform="rotate(".concat(h,"deg)"))}try{for(var m=a.__values(t.wps),g=m.next();!g.done;g=m.next()){var w=g.value,b=document.createElement("div");y(e,b,w,t),n.appendChild(d,b)}}catch(e){l={error:e}}finally{try{g&&!g.done&&(r=m.return)&&r.call(m)}finally{if(l)throw l.error}}try{for(var C=a.__values(t.wpg),F=C.next();!F.done;F=C.next()){var E=F.value;n.appendChild(s,x(e,E))}}catch(e){i={error:e}}finally{try{F&&!F.done&&(o=C.return)&&o.call(C)}finally{if(i)throw i.error}}return t.pic&&n.appendChild(d,f(t.pic,e,t)),n.appendChild(s,d),s}t.renderDrawing=function(e,t,l){var r=document.createElement("div");return"inline"===t.position?r.style.display="inline-block":t.position,t.pic&&n.appendChild(r,f(t.pic,e)),"page"===t.relativeFromV&&console.warn('暂不支持 drawing.relativeFromV === "page"'),n.applyStyle(r,t.containerStyle),r.dataset.id=t.id||"",r.dataset.name=t.name||"",t.wps&&y(e,r,t.wps),t.wpg&&n.appendChild(r,x(e,t.wpg)),0===r.children.len
;/*!node_modules/office-viewer/lib/render/renderTab.js*/
amis.define("9269b41",(function(e,t,r,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var s=e("872e6b7");t.renderTab=function(e,t,r){void 0===r&&(r=!1);var n=s.createElement("span");return n.style.display="inline-block",n.style.width="2em",n.innerHTML="&emsp;","dot"===t.leader&&(n.style.borderBottom="1pt dotted"),r&&t.pos&&("start"===t.type||"left"==t.type)&&(n.style.width=t.pos),n}}));
;/*!node_modules/office-viewer/lib/render/renderPict.js*/
amis.define("0b7d786",(function(e,r,t,n){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.renderPict=function(e,r){if(r.src){var t=document.createElement("img");return t.style.position="relative",t.src=r.src,t}return null}}));
;/*!node_modules/office-viewer/lib/render/renderRuby.js*/
amis.define("73ee52e",(function(e,r,n,a){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var t=e("9a586ef"),l=e("872e6b7"),i=e("08b74c1");r.renderRuby=function(e,r){var n,a,d,u,c=l.createElement("ruby");if(r.rubyBase){try{for(var f=t.__values(r.rubyBase.children),o=f.next();!o.done;o=f.next()){var p=o.value;c.appendChild(i.default(e,p))}}catch(e){n={error:e}}finally{try{o&&!o.done&&(a=f.return)&&a.call(f)}finally{if(n)throw n.error}}if(r.rt){var v=l.createElement("rp");v.innerText="(",c.appendChild(v);var y=l.createElement("rt");try{for(var h=t.__values(r.rt.children),s=h.next();!s.done;s=h.next()){p=s.value;y.appendChild(i.default(e,p))}}catch(e){d={error:e}}finally{try{s&&!s.done&&(u=h.return)&&u.call(h)}finally{if(d)throw d.error}}c.appendChild(y);var b=l.createElement("rp");b.innerText=")",c.appendChild(b)}}return c}}));
;/*!node_modules/office-viewer/lib/render/renderHyperLink.js*/
amis.define("a8083a8",(function(e,r,t,a){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=e("9a586ef"),l=e("872e6b7"),i=e("300d0bd"),o=e("08b74c1");r.renderHyperLink=function(e,r,t){var a,f,c=l.createElement("a");if(r.relation){var d=r.relation;d&&"External"===d.targetMode&&(c.href=d.target,c.target="_blank")}r.anchor&&(c.href="#"+r.anchor),r.tooltip&&(c.title=r.tooltip);try{for(var u=n.__values(r.children),v=u.next();!v.done;v=u.next()){var h=v.value;if(h instanceof i.Run){var p=o.default(e,h,t);l.appendChild(c,p)}}}catch(e){a={error:e}}finally{try{v&&!v.done&&(f=u.return)&&f.call(u)}finally{if(a)throw a.error}}return c}}));
;/*!node_modules/office-viewer/lib/render/renderBookmark.js*/
amis.define("0dd798c",(function(e,r,n,t){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var a=e("872e6b7");r.renderBookmarkStart=function(e,r){var n=r.name;if(n){var t=a.createElement("a");return t.name=n,t.id=n,t}return null}}));
;/*!node_modules/office-viewer/lib/render/renderInlineText.js*/
amis.define("b8adb25",(function(e,r,a,n){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var d=e("9a586ef"),t=e("872e6b7"),i=e("300d0bd"),l=e("6541de0"),f=e("08b2e1b"),o=e("08b74c1"),c=e("a8083a8"),u=e("0dd798c");r.default=function(e,r,a){var n,s;try{for(var p=d.__values(r.children),b=p.next();!b.done;b=p.next()){var v=b.value;if(v instanceof i.Run)t.appendChild(a,o.default(e,v));else if(v instanceof l.BookmarkStart)t.appendChild(a,u.renderBookmarkStart(e,v));else if(v instanceof f.Hyperlink){var y=c.renderHyperLink(e,v);t.appendChild(a,y)}}}catch(e){n={error:e}}finally{try{b&&!b.done&&(s=p.return)&&s.call(p)}finally{if(n)throw n.error}}}}));
;/*!node_modules/office-viewer/lib/render/renderInstrText.js*/
amis.define("31cb854",(function(e,r,t,n){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var a=e("9a586ef"),i=e("872e6b7"),l=e("b8adb25");r.renderInstrText=function(e,r){var t,n,f,o=r.text,s=i.createElement("span"),u=null===(f=e.currentParagraph)||void 0===f?void 0:f.fldSimples;if(u)try{for(var d=a.__values(u),c=d.next();!c.done;c=d.next()){var v=c.value;if(v.instr===o.trim()||o.startsWith(v.instr+" ")){l.default(e,v.inlineText,s);break}}}catch(e){t={error:e}}finally{try{c&&!c.done&&(n=d.return)&&n.call(d)}finally{if(t)throw t.error}}return s}}));
;/*!node_modules/office-viewer/lib/render/renderSym.js*/
amis.define("8840adb",(function(e,n,t,r){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var a=e("872e6b7");n.renderSym=function(e,n){var t=a.createElement("span");return t.style.fontFamily=n.font,t.innerHTML="&#x".concat(n.char,";"),t}}));
;/*!node_modules/office-viewer/lib/util/autoSpace.js*/
amis.define("30de101",(function(t,e,n,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var u=/\p{Punctuation}/u,i=/\p{Separator}/u,a=/\p{Script=Han}|\p{Script=Katakana}|\p{Script=Hiragana}|\p{Script=Hangul}/u;e.cjkspace=function(t){var e,n,r=t.filter((function(t){return void 0!==t&&""!==t}));return n=function(t,e){return function(t,e){return a.test(t)?!(u.test(e)||i.test(e)||a.test(e)):a.test(e)&&!u.test(t)&&!i.test(t)}(t,e)?" ":""},(e=r).reduce((function(t,r,u){return t+(0!==u?n(r,e[u-1]):"")+r}),"")}}));
;/*!node_modules/office-viewer/lib/render/renderSoftHyphen.js*/
amis.define("c675659",(function(e,n,r,t){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=e("872e6b7");n.renderSoftHyphen=function(){var e=i.createElement("span");return e.innerHTML="&shy;",e}}));
;/*!node_modules/office-viewer/lib/render/renderNoBreakHyphen.js*/
amis.define("2b68bdf",(function(e,n,r,t){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var a=e("872e6b7");n.renderNoBreakHyphen=function(){var e=a.createElement("span");return e.innerHTML="&ndash;",e}}));
;/*!node_modules/office-viewer/lib/render/renderSeparator.js*/
amis.define("bf0ca18",(function(e,r,t,n){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var a=e("872e6b7");r.renderSeparator=function(){var e=a.createElement("hr");return e.style.borderTop="1pt solid #bbb",e}}));
;/*!node_modules/office-viewer/lib/render/renderRun.js*/
amis.define("08b74c1",(function(e,n,r,t){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var a=e("9a586ef"),i=e("b910b8b"),d=e("872e6b7"),l=e("300d0bd"),o=e("545dd66"),c=e("c649ee4"),p=e("fe8e389"),s=e("cec919e"),f=e("9b86c99"),b=e("9269b41"),v=e("0b7d786"),h=e("b9cc761"),u=e("85a1717"),y=e("73ee52e"),x=e("e9cfc4f"),C=e("31cb854"),S=e("0571a6a"),T=e("8840adb"),g=e("30de101"),m=e("c675659"),H=e("878c9f1"),k=e("a55ba63"),w=e("2b68bdf"),P=e("685cd67"),B=e("bf0ca18"),E="variable";function _(e,n,r,t){var a;if(-1===r.indexOf("{{")){var i=void 0;i=(null===(a=null==t?void 0:t.properties)||void 0===a?void 0:a.autoSpace)?g.cjkspace(r.split("")):r,e.textContent=i}else e.dataset.originText=r,e.classList.add(E),e.textContent=n.replaceText(r);var d=e.innerHTML.split(" ").join("&nbsp;&nbsp;");e.innerHTML=d}n.default=function(e,n,r,t,g){var E,j,L,M,D=d.createElement("span");if(e.addClass(D,"r"),s.setElementStyle(e,D,n.properties),null===(L=n.properties)||void 0===L?void 0:L.rStyle){var I=e.getStyle(n.properties.rStyle);(null===(M=null==I?void 0:I.rPr)||void 0===M?void 0:M.cssStyle)&&d.applyStyle(D,I.rPr.cssStyle)}if(1===n.children.length&&n.children[0]instanceof l.Text)_(D,e,n.children[0].text,r);else try{for(var N=a.__values(n.children),O=N.next();!O.done;O=N.next()){var R=O.value;if(R instanceof l.Text){var q=d.createElement("span");_(q,e,R.text,r),d.appendChild(D,q)}else if(R instanceof o.Break){var A=i.renderBr(e,R);d.appendChild(D,A)}else R instanceof c.Drawing?d.appendChild(D,p.renderDrawing(e,R,g)):R instanceof f.Tab?d.appendChild(D,b.renderTab(e,R)):R instanceof h.Pict?d.appendChild(D,v.renderPict(e,R)):R instanceof u.Ruby?d.appendChild(D,y.renderRuby(e,R)):R instanceof x.InstrText?d.appendChild(D,C.renderInstrText(e,R)):R instanceof S.Sym?d.appendChild(D,T.renderSym(e,R)):R instanceof H.SoftHyphen?d.appendChild(D,m.renderSoftHyphen()):R instanceof k.NoBreakHyphen?d.appendChild(D,w.renderNoBreakHyphen()):R instanceof P.Separator?d.appendChild(D,B.renderSeparator()):console.warn("unknown child",R)}}catch(e){E={error:e}}finally{try{O&&!O.done&&(j=N.return)&&j.call(N)}finally{if(E)throw E.error}}return D},n.updateVariableText=function(e){for(var n=e.rootElement.querySelectorAll(".".concat(E)),r=0;r<n.length;r++){var t=n[r],a=t.dataset.originText||"";t.textContent=e.replaceText(a)}}}));
;/*!node_modules/office-viewer/lib/render/renderNumbering.js*/
amis.define("356e74c",(function(e,r,n,t){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var a=e("9a586ef"),l=e("872e6b7"),u=e("cec919e");function s(e){var r={M:1e3,CM:900,D:500,CD:400,C:100,XC:90,L:50,XL:40,X:10,IX:9,V:5,IV:4,I:1},n="";for(var t in r)for(;e>=r[t];)n+=t,e-=r[t];return n}function i(e,r){switch(e){case"decimal":default:return r.toString();case"lowerLetter":return String.fromCharCode(96+r);case"upperLetter":return String.fromCharCode(64+r);case"lowerRoman":return s(r).toLowerCase();case"upperRoman":return s(r).toUpperCase();case"bullet":return"&bull;"}}r.renderNumbering=function(e,r,n){var t=r.numbering,s=n.numId;if(!s)return console.warn("renderNumbering: numId is empty"),null;if(!t)return console.warn("renderNumbering: numbering is empty"),null;var o=t.nums[s];if(!o)return console.warn("renderNumbering: num is empty"),null;var m=t.abstractNums[o.abstractNumId].lvls;o.lvlOverride&&(m=a.__assign(a.__assign({},m),o.lvlOverride.lvls));var c=m[n.ilvl];if(!c)return console.warn("renderNumbering: lvl is empty"),null;var f=n.ilvl,v=t.numData[s];if(v[f])for(var p in v[f]+=1,v)parseInt(p)>parseInt(f)&&(v[p]=0);else v[f]=c.start;for(var d=l.createElement("span"),b=c.lvlText,g=parseInt(f),C=[],I=0;I<=g;I++){var L=v[I];if(L){var w=i(m[I].numFmt,L);c.isLgl&&(w=String(L)),C.push(w)}}for(I=0;I<C.length;I++){var S=C[I];b=b.replace("%".concat(I+1),S)}if(u.setElementStyle(r,e,c.pPr),u.setElementStyle(r,d,c.rPr),"bullet"!==c.numFmt||r.renderOptions.bulletUseFont)d.innerText=b;else{var y="&bull;",N=b.charCodeAt(0).toString(16).padStart(4,"0");"f06e"===N?y="&#9632;":"f075"===N?y="&#9670;":"f0d8"===N&&(y="&#9658;"),d.innerHTML=y}return"space"===c.suff?d.innerHTML+=" ":"tab"===c.suff&&(d.innerHTML+="&emsp;"),d}}));
;/*!node_modules/office-viewer/lib/util/xml.js*/
amis.define("da2035f",(function(e,r,i,n){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.buildXML=function(e){return(new XMLSerializer).serializeToString(e)},r.parseXML=function(e){return(new DOMParser).parseFromString(e,"application/xml")}}));
;/*!node_modules/office-viewer/lib/openxml/math/xsl.js*/
amis.define("57b8dfc",(function(e,t,n,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var l=e("da2035f").parseXML('\n<?xml version="1.0" encoding="UTF-8" ?>\n<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:mml="http://www.w3.org/1998/Math/MathML"\n\txmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math">\n <xsl:output method="xml" encoding="UTF-16" />\n\n \x3c!-- %% Global Definitions --\x3e\n\n \x3c!-- Every single unicode character that is recognized by OMML as an operator --\x3e\n <xsl:variable name="sOperators"\n\t\tselect="concat(\n \'&#x00A8;&#x0021;&#x0022;&#x0023;&#x0026;&#x0028;&#x0029;&#x002B;&#x002C;&#x002D;&#x002E;&#x002F;&#x003A;\',\n \'&#x003B;&#x003C;&#x003D;&#x003E;&#x003F;&#x0040;&#x005B;&#x005C;&#x005D;&#x005E;&#x005F;&#x0060;&#x007B;\',\n \'&#x007C;&#x007D;&#x007E;&#x00A1;&#x00A6;&#x00AC;&#x00AF;&#x00B0;&#x00B1;&#x00B2;&#x00B3;&#x00B4;&#x00B7;&#x00B9;&#x00BF;\',\n \'&#x00D7;&#x007E;&#x00F7;&#x02C7;&#x02D8;&#x02D9;&#x02DC;&#x02DD;&#x0300;&#x0301;&#x0302;&#x0303;&#x0304;&#x0305;&#x0306;&#x0307;&#x0308;&#x0309;\',\n \'&#x030A;&#x030B;&#x030C;&#x030D;&#x030E;&#x030F;&#x0310;&#x0311;&#x0312;&#x0313;&#x0314;&#x0315;\',\n \'&#x0316;&#x0317;&#x0318;&#x0319;&#x031A;&#x031B;&#x031C;&#x031D;&#x031E;&#x031F;&#x0320;&#x0321;\',\n \'&#x0322;&#x0323;&#x0324;&#x0325;&#x0326;&#x0327;&#x0328;&#x0329;&#x032A;&#x032B;&#x032C;&#x032D;\',\n \'&#x032E;&#x032F;&#x0330;&#x0331;&#x0332;&#x0333;&#x0334;&#x0335;&#x0336;&#x0337;&#x0338;&#x033F;\',\n \'&#x2000;&#x2001;&#x2002;&#x2003;&#x2004;&#x2005;&#x2006;&#x2009;&#x200A;&#x2010;&#x2012;&#x2013;\',\n \'&#x2014;&#x2016;&#x2020;&#x2021;&#x2022;&#x2024;&#x2025;&#x2026;&#x2032;&#x2033;&#x2034;&#x203C;\',\n \'&#x2040;&#x2044;&#x204E;&#x204F;&#x2050;&#x2057;&#x2061;&#x2062;&#x2063;&#x2070;&#x2074;&#x2075;\',\n \'&#x2076;&#x2077;&#x2078;&#x2079;&#x207A;&#x207B;&#x207C;&#x207D;&#x207E;&#x2080;&#x2081;&#x2082;\',\n \'&#x2083;&#x2084;&#x2085;&#x2086;&#x2087;&#x2088;&#x2089;&#x208A;&#x208B;&#x208C;&#x208D;&#x208E;\',\n \'&#x20D0;&#x20D1;&#x20D2;&#x20D3;&#x20D4;&#x20D5;&#x20D6;&#x20D7;&#x20D8;&#x20D9;&#x20DA;&#x20DB;\',\n \'&#x20DC;&#x20DD;&#x20DE;&#x20DF;&#x20E0;&#x20E1;&#x20E4;&#x20E5;&#x20E6;&#x20E7;&#x20E8;&#x20E9;\',\n \'&#x20EA;&#x2140;&#x2146;&#x2190;&#x2191;&#x2192;&#x2193;&#x2194;&#x2195;&#x2196;&#x2197;&#x2198;&#x2199;\',\n \'&#x219A;&#x219B;&#x219C;&#x219D;&#x219E;&#x219F;&#x21A0;&#x21A1;&#x21A2;&#x21A3;&#x21A4;&#x21A5;\',\n \'&#x21A6;&#x21A7;&#x21A8;&#x21A9;&#x21AA;&#x21AB;&#x21AC;&#x21AD;&#x21AE;&#x21AF;&#x21B0;&#x21B1;\',\n \'&#x21B2;&#x21B3;&#x21B6;&#x21B7;&#x21BA;&#x21BB;&#x21BC;&#x21BD;&#x21BE;&#x21BF;&#x21C0;&#x21C1;\',\n \'&#x21C2;&#x21C3;&#x21C4;&#x21C5;&#x21C6;&#x21C7;&#x21C8;&#x21C9;&#x21CA;&#x21CB;&#x21CC;&#x21CD;\',\n \'&#x21CE;&#x21CF;&#x21D0;&#x21D1;&#x21D2;&#x21D3;&#x21D4;&#x21D5;&#x21D6;&#x21D7;&#x21D8;&#x21D9;\',\n \'&#x21DA;&#x21DB;&#x21DC;&#x21DD;&#x21DE;&#x21DF;&#x21E0;&#x21E1;&#x21E2;&#x21E3;&#x21E4;&#x21E5;\',\n \'&#x21E6;&#x21E7;&#x21E8;&#x21E9;&#x21F3;&#x21F4;&#x21F5;&#x21F6;&#x21F7;&#x21F8;&#x21F9;&#x21FA;\',\n \'&#x21FB;&#x21FC;&#x21FD;&#x21FE;&#x21FF;&#x2200;&#x2201;&#x2202;&#x2203;&#x2204;&#x2206;&#x2207;\',\n \'&#x2208;&#x2209;&#x220A;&#x220B;&#x220C;&#x220D;&#x220F;&#x2210;&#x2211;&#x2212;&#x2213;&#x2214;\',\n \'&#x2215;&#x2216;&#x2217;&#x2218;&#x2219;&#x221A;&#x221B;&#x221C;&#x221D;&#x2223;&#x2224;&#x2225;\',\n \'&#x2226;&#x2227;&#x2228;&#x2229;&#x222A;&#x222B;&#x222C;&#x222D;&#x222E;&#x222F;&#x2230;&#x2231;\',\n \'&#x2232;&#x2233;&#x2234;&#x2235;&#x2236;&#x2237;&#x2238;&#x2239;&#x223A;&#x223B;&#x223C;&#x223D;\',\n \'&#x223E;&#x2240;&#x2241;&#x2242;&#x2243;&#x2244;&#x2245;&#x2246;&#x2247;&#x2248;&#x2249;&#x224A;\',\n \'&#x224B;&#x224C;&#x224D;&#x224E;&#x224F;&#x2250;&#x2251;&#x2252;&#x2253;&#x2254;&#x2255;&#x2256
;/*!node_modules/office-viewer/lib/openxml/math/convertOOML.js*/
amis.define("b321b71",(function(e,r,t,n){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var o=e("57b8dfc");r.convertOOXML=function(e){var r=new XSLTProcessor;return r.importStylesheet(o.xsl),r.transformToFragment(e,document)}}));
;/*!node_modules/office-viewer/lib/render/renderMath.js*/
amis.define("ade95ac",(function(e,n,t,r){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var a=e("b321b71");n.renderOMath=function(e,n){return a.convertOOXML(n.element)}}));
;/*!node_modules/office-viewer/lib/render/renderParagraph.js*/
amis.define("88daac0",(function(e,r,a,n){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var t=e("9a586ef"),d=e("872e6b7"),i=e("300d0bd"),l=e("6541de0"),o=e("08b2e1b"),p=e("08b74c1"),s=e("a8083a8"),c=e("0dd798c"),f=e("356e74c"),u=e("cec919e"),h=e("9269b41"),b=e("131d858"),v=e("ade95ac");r.default=function(e,r,a,n){var y,m;void 0===a&&(a=!0),void 0===n&&(n=!1),e.currentParagraph=r;var C=d.createElement("p");e.addClass(C,"p");var k=r.properties;u.setElementStyle(e,C,k),C.style.position="relative",k.numPr&&d.appendChild(C,f.renderNumbering(C,e,k.numPr));var g=!1;k.tabs&&k.tabs.length&&d.appendChild(C,h.renderTab(e,k.tabs[0],!0));try{for(var M=t.__values(r.children),H=M.next();!H.done;H=M.next()){var P=H.value;if(P instanceof i.Run)"begin"===P.fldChar?g=!0:P&&(g=!1),d.appendChild(C,p.default(e,P,r,g,n));else if(P instanceof l.BookmarkStart)d.appendChild(C,c.renderBookmarkStart(e,P));else if(P instanceof o.Hyperlink){var _=s.renderHyperLink(e,P,r);d.appendChild(C,_)}else P instanceof b.OMath?d.appendChild(C,v.renderOMath(e,P)):console.warn("unknow pargraph type",P)}}catch(e){y={error:e}}finally{try{H&&!H.done&&(m=M.return)&&m.call(M)}finally{if(y)throw y.error}}return""===C.innerHTML&&a&&(C.innerHTML="&nbsp;"),C}}));
;/*!node_modules/office-viewer/lib/render/renderHeader.js*/
amis.define("22704f6",(function(e,a,r,n){"use strict";Object.defineProperty(a,"__esModule",{value:!0});var l=e("9a586ef"),t=e("d78ccf3"),d=e("88daac0"),f=e("872e6b7"),i=e("03b19df"),c=e("1c1a6b2");a.renderHeader=function(e,a){var r,n,o=f.createElement("div");try{for(var u=l.__values(a.children),s=u.next();!s.done;s=u.next()){var v=s.value;if(v instanceof t.Paragraph){var h=d.default(e,v,!0,!0);f.appendChild(o,h)}else if(v instanceof c.Table){var p=i.default(e,v);f.appendChild(o,p)}else console.warn("unknown child",v)}}catch(e){r={error:e}}finally{try{s&&!s.done&&(n=u.return)&&n.call(u)}finally{if(r)throw r.error}}return o}}));
;/*!node_modules/office-viewer/lib/render/renderSection.js*/
amis.define("d38d2b1",(function(e,t,a,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=e("872e6b7"),n=e("22704f6");t.renderSection=function(e,t,a,r){var d=o.createElement("section");d.style.position="relative",t.backgroundColor&&(d.style.background=t.backgroundColor),r.page&&(r.pageMarginBottom&&(d.style.marginBottom=r.pageMarginBottom+"px"),r.pageShadow&&(d.style.boxShadow="0 0 8px rgba(0, 0, 0, 0.5)"),r.pageBackground&&(d.style.background=r.pageBackground));var i=a.properties,l=i.pageSize;l&&(r.ignoreWidth||(d.style.width=l.width),r.ignoreHeight||(d.style.height=l.height)),r.padding?d.style.padding=r.padding:(c=i.pageMargin)&&(d.style.paddingLeft=c.left||"0",d.style.paddingRight=c.right||"0",d.style.paddingTop=c.top||"0",d.style.paddingBottom=c.bottom||"0"),i.cols&&i.cols.num&&i.cols.num>1&&(d.style.columnCount=""+i.cols.num,i.cols.space&&(d.style.columnGap=i.cols.space)),e.currentPage++;var g="auto";if(i.pageSize&&i.pageSize.width&&(g=i.pageSize.width),i.headers&&r.page&&r.renderHeader){var s=i.headers,p=null;if(s.even&&e.currentPage%2==0?p=n.renderHeader(e,s.even):s.default?p=n.renderHeader(e,s.default):console.warn("can not find header",e.currentPage,i.headers),p)p.style.position="absolute",(c=i.pageMargin)&&c.header&&(p.style.top=c.header,p.style.width=g),d.appendChild(p)}if(i.footers&&r.page&&r.renderFooter){var c,u=i.footers,h=null;if(u.even&&e.currentPage%2==0?h=n.renderHeader(e,u.even):u.default?h=n.renderHeader(e,u.default):console.warn("can not find footer",e.currentPage,i.footers),h)h.style.position="absolute",(c=i.pageMargin)&&c.footer&&(h.style.bottom=c.footer,h.style.width=g),d.appendChild(h)}return d}}));
;/*!node_modules/office-viewer/lib/render/renderBody.js*/
amis.define("92a2854",(function(e,r,t,n){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var a=e("9a586ef"),i=e("872e6b7"),o=e("d78ccf3"),l=e("1c1a6b2"),c=e("88daac0"),d=e("d38d2b1"),f=e("03b19df");function s(e,r,t,n,a,o,l,c){var f=0===a.children.length;if(i.appendChild(a,c),!f&&function(e,r,t){if(e.breakPage)return e.breakPage=!1,!0;var n=t.getBoundingClientRect();return n.top+n.height>r.bottom||n.left>r.right}(e,o,c)){var s=c.cloneNode(!0);i.removeChild(a,c);var u=d.renderSection(e,r,l,t);return i.appendChild(n,u),i.appendChild(u,s),{sectionEl:u,sectionEnd:o=p(l,u)}}return{sectionEl:a,sectionEnd:o}}function p(e,r){var t=r.getBoundingClientRect(),n=e.properties.pageMargin,a=t.top+t.height;(null==n?void 0:n.bottom)&&(a-=parseInt(n.bottom.replace("px",""),10));var i=t.left+t.width;return(null==n?void 0:n.right)&&(i-=parseInt(n.right.replace("px",""),10)),{bottom:a,right:i}}function u(e,r,t){var n=r.properties,a=n.pageSize;if(t.zoomFitWidth&&!t.ignoreWidth){var i=null==a?void 0:a.width;if(e&&i){var o=parseInt(i.replace("px",""),10);if(n.pageMargin){var l=n.pageMargin;o+=l.left?parseInt(l.left.replace("px",""),10):0,o+=l.right?parseInt(l.right.replace("px",""),10):0}return e/o}}return 1}function h(e,r,t,n,i,d,u){setTimeout((function(){var h,v,g=p(d,i);try{for(var y=a.__values(d.children),m=y.next();!m.done;m=y.next()){var b=m.value;if(b instanceof o.Paragraph){var _=c.default(e,b),x=s(e,r,n,t,i,g,d,_);i=x.sectionEl,g=x.sectionEnd}else if(b instanceof l.Table){var w=f.default(e,b);x=s(e,r,n,t,i,g,d,w);i=x.sectionEl,g=x.sectionEnd}else console.warn("unknown child",b)}}catch(e){h={error:e}}finally{try{m&&!m.done&&(v=y.return)&&v.call(y)}finally{if(h)throw h.error}}u&&(i.style.marginBottom="0")}),0)}r.default=function(e,r,t,n,s,p){var v,g,y,m,b=p.page||!1,_=e.getBoundingClientRect().width-2*(p.pageWrapPadding||0),x=[],w=0,C=s.sections,E=C.length,M=!1;try{for(var P=a.__values(C),z=P.next();!z.done;z=P.next()){var I=z.value;x.push(u(_,I,p)),r.currentSection=I;var W=d.renderSection(r,n,I,p);if(i.appendChild(t,W),(w+=1)===E&&(M=!0),b)h(r,n,t,p,W,I,M);else try{for(var k=(y=void 0,a.__values(I.children)),B=k.next();!B.done;B=k.next()){var S=B.value;if(S instanceof o.Paragraph){var T=c.default(r,S);i.appendChild(W,T)}else if(S instanceof l.Table){var O=f.default(r,S);i.appendChild(W,O)}else console.warn("unknown child",S)}}catch(e){y={error:e}}finally{try{B&&!B.done&&(m=k.return)&&m.call(k)}finally{if(y)throw y.error}}}}catch(e){v={error:e}}finally{try{z&&!z.done&&(g=P.return)&&g.call(P)}finally{if(v)throw v.error}}setTimeout((function(){if(p.zoom)t.style.transformOrigin="0 0",t.style.transform="scale(".concat(p.zoom,")");else if(p.page&&p.zoomFitWidth&&!p.ignoreWidth){var e=Math.min.apply(Math,a.__spreadArray([],a.__read(x),!1));t.style.transformOrigin="0 0",t.style.transform="scale(".concat(e,")")}}),0)}}));
;/*!node_modules/office-viewer/lib/render/renderDocument.js*/
amis.define("f98d8af",(function(e,t,a,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var f=e("872e6b7"),n=e("92a2854");t.default=function(e,t,a,r){var u=f.createElement("article");return n.default(e,t,u,a,a.body,r),u}}));
;/*!node_modules/office-viewer/lib/util/blob.js*/
amis.define("0b37635",(function(e,d,n,o){"use strict";Object.defineProperty(d,"__esModule",{value:!0}),d.downloadBlob=function(e,d){void 0===d&&(d="file.txt");var n=URL.createObjectURL(e),o=document.createElement("a");o.href=n,o.download=d,document.body.appendChild(o),o.dispatchEvent(new MouseEvent("click",{bubbles:!0,cancelable:!0,view:window})),document.body.removeChild(o)}}));
;/*!node_modules/office-viewer/lib/openxml/word/numbering/Lvl.js*/
amis.define("f2987b2",(function(e,a,r,t){"use strict";Object.defineProperty(a,"__esModule",{value:!0});var l=e("9a586ef"),s=e("300d0bd"),n=e("5ab481b"),c=e("d78ccf3"),i=function(){function e(){this.start=1,this.lvlText="%1.",this.isLgl=!1,this.lvlJc="start",this.suff="space"}return e.fromXML=function(a,r){var t,i,u=new e;u.ilvl=r.getAttribute("w:ilvl");try{for(var o=l.__values(r.children),f=o.next();!f.done;f=o.next()){var v=f.value,b=v.tagName;switch(b){case"w:start":u.start=n.getValNumber(v);break;case"w:numFmt":u.numFmt=n.getVal(v);break;case"w:lvlText":u.lvlText=n.getVal(v);break;case"w:lvlJc":u.lvlJc=n.getVal(v);break;case"w:legacy":case"w:pStyle":break;case"w:pPr":u.pPr=c.Paragraph.parseParagraphPr(a,v);break;case"w:rPr":u.rPr=s.Run.parseRunPr(a,v);break;case"w:isLgl":u.isLgl=n.getValBoolean(v);break;default:console.warn("Lvl: Unknown tag ",b,v)}}}catch(e){t={error:e}}finally{try{f&&!f.done&&(i=o.return)&&i.call(o)}finally{if(t)throw t.error}}return u},e}();a.Lvl=i}));
;/*!node_modules/office-viewer/lib/openxml/word/numbering/AbstractNum.js*/
amis.define("451070a",(function(e,t,r,l){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=e("9a586ef"),n=e("f2987b2"),u=e("5ab481b"),i=function(){function e(){this.lvls={}}return e.fromXML=function(t,r){var l,i,v=new e;v.abstractNumId=r.getAttribute("w:abstractNumId")||"",v.multiLevelType=r.getAttribute("w:multiLevelType");var m=r.getElementsByTagName("w:lvl");try{for(var f=a.__values(m),o=f.next();!o.done;o=f.next()){var s=o.value,c=s.getAttribute("w:ilvl")||"";v.lvls[c]=n.Lvl.fromXML(t,s)}}catch(e){l={error:e}}finally{try{o&&!o.done&&(i=f.return)&&i.call(f)}finally{if(l)throw l.error}}var y=r.getElementsByTagName("w:multiLevelType").item(0);return y&&(v.multiLevelType=u.getVal(y)),v},e}();t.AbstractNum=i}));
;/*!node_modules/office-viewer/lib/openxml/word/numbering/Num.js*/
amis.define("628a81b",(function(e,r,t,l){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var a=e("9a586ef"),n=e("5ab481b"),v=e("f2987b2"),i=function(){function e(){this.lvlOverride={lvls:{}}}return e.fromXML=function(r,t){var l,i,u=new e;u.numId=t.getAttribute("w:numId")||"";var s=t.getElementsByTagName("w:abstractNumId").item(0);s&&(u.abstractNumId=n.getVal(s));var d=t.getElementsByTagName("w:lvlOverride").item(0);if(d)try{for(var m=a.__values(d.children),o=m.next();!o.done;o=m.next()){var c=o.value,f=c.tagName;switch(f){case"w:lvl":var b=c.getAttribute("w:lvlId")||"";u.lvlOverride.lvls[b]=v.Lvl.fromXML(r,c);break;case"w:startOverride":var w=c.getAttribute("w:lvlId")||"";u.lvlOverride.lvls[w]&&(u.lvlOverride.lvls[w].start=n.getValNumber(c));break;default:console.warn("Num: Unknown tag ",f,c)}}}catch(e){l={error:e}}finally{try{o&&!o.done&&(i=m.return)&&i.call(m)}finally{if(l)throw l.error}}return u},e}();r.Num=i}));
;/*!node_modules/office-viewer/lib/openxml/word/numbering/Numbering.js*/
amis.define("0865880",(function(r,t,e,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r("9a586ef"),u=r("451070a"),m=r("628a81b"),o=function(){function r(){this.abstractNums={},this.nums={},this.numData={}}return r.fromXML=function(t,e){var a,o,l,s,f=new r;try{for(var i=n.__values(e.getElementsByTagName("w:abstractNum")),c=i.next();!c.done;c=i.next()){var v=c.value,y=u.AbstractNum.fromXML(t,v);f.abstractNums[y.abstractNumId]=y}}catch(r){a={error:r}}finally{try{c&&!c.done&&(o=i.return)&&o.call(i)}finally{if(a)throw a.error}}try{for(var d=n.__values(e.getElementsByTagName("w:num")),N=d.next();!N.done;N=d.next()){var b=N.value,h=m.Num.fromXML(t,b);f.nums[h.numId]=h,f.numData[h.numId]={}}}catch(r){l={error:r}}finally{try{N&&!N.done&&(s=d.return)&&s.call(d)}finally{if(l)throw l.error}}return f},r}();t.Numbering=o}));
;/*!node_modules/office-viewer/lib/util/mergeRun.js*/
amis.define("8b82678",(function(e,r,t,a){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=e("9a586ef"),l=e("c5cba64");function i(e,r,t){var a=r?l.parsePr(e,r):{},n=t?l.parsePr(e,t):{};return JSON.stringify(a)===JSON.stringify(n)}function o(e,r){var t=e.getElementsByTagName("w:t")[0],a=r.getElementsByTagName("w:t")[0];if(t&&a){var n=a.textContent||"";t.textContent+=n||""}}function f(e){var r,t,a=e.tagName,l=e.children,i=!1,o=!1;try{for(var f=n.__values(l),u=f.next();!u.done;u=f.next()){var c=u.value;if("w:t"===c.tagName&&(i=!0,o="preserve"===c.getAttribute("xml:space")))break;if("w:tab"===c.tagName)return!1}}catch(e){r={error:e}}finally{try{u&&!u.done&&(t=f.return)&&t.call(f)}finally{if(r)throw r.error}}return"w:r"===a&&i&&!o}function u(e,r){var t,a,l,u,c=[],s=null;try{for(var v=n.__values(r.children),y=v.next();!y.done;y=v.next()){var g=y.value,m=g.tagName;if(f(g))if(s)i(e,s.getElementsByTagName("w:rPr")[0],g.getElementsByTagName("w:rPr")[0])?o(s,g):(s=g,c.push(g));else s=g,c.push(g);else"w:proofErr"!==m&&(s=null,c.push(g))}}catch(e){t={error:e}}finally{try{y&&!y.done&&(a=v.return)&&a.call(v)}finally{if(t)throw t.error}}r.innerHTML="";try{for(var d=n.__values(c),h=d.next();!h.done;h=d.next()){var w=h.value;r.appendChild(w)}}catch(e){l={error:e}}finally{try{h&&!h.done&&(u=d.return)&&u.call(d)}finally{if(l)throw l.error}}}r.canMerge=f,r.mergeRun=function(e,r){var t,a,l=r.getElementsByTagName("w:p");try{for(var i=n.__values(l),o=i.next();!o.done;o=i.next()){u(e,o.value)}}catch(e){t={error:e}}finally{try{o&&!o.done&&(a=i.return)&&a.call(i)}finally{if(t)throw t.error}}},r.mergeRunInP=u}));
;/*!node_modules/office-viewer/lib/openxml/word/Header.js*/
amis.define("2daffb4",(function(e,r,a,n){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var t=e("9a586ef"),f=e("6590f09"),c=e("b7e52c8"),l=e("d78ccf3"),o=function(){function e(){this.children=[]}return e.fromXML=function(r,a){var n,o,i=new e,d=[];i.children=d;var u=a,s=a.firstElementChild;!s||"w:hdr"!==s.tagName&&"w:ftr"!==s.tagName||(u=s);try{for(var h=t.__values(f.mergeSdt(u)),v=h.next();!v.done;v=h.next()){var m=v.value,w=m.tagName;switch(w){case"w:p":var b=l.Paragraph.fromXML(r,m);d.push(b);break;case"w:tbl":var p=c.parseTable(r,m);d.push(p);break;default:console.warn("Header.fromXML Unknown key",w,m)}}}catch(e){n={error:e}}finally{try{v&&!v.done&&(o=h.return)&&o.call(h)}finally{if(n)throw n.error}}return i},e}();r.Header=o}));
;/*!node_modules/office-viewer/lib/openxml/word/Section.js*/
amis.define("ee1c13c",(function(e,r,t,a){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var i=e("9a586ef"),o=e("5d393c3"),n=e("5ab481b"),s=e("2daffb4");function c(e,r,t){var a=r.getAttribute("w:type"),i=r.getAttribute("r:id");if(a&&i){var o=e.getDocumentRels(i);if(o){var n=e.getXML("/word/"+o.target);if(n)return{headerType:a,header:s.Header.fromXML(e,n)}}}return null}var p=function(){function e(){this.properties={},this.children=[]}return e.prototype.addChild=function(e){this.children.push(e)},e.parsePr=function(e,r,t){var a,s,p={headers:{},footers:{}};try{for(var d=i.__values(r.children),f=d.next();!f.done;f=d.next()){var h=f.value;switch(h.tagName){case"w:pgSz":p.pageSize={width:o.parseSize(h,"w:w"),height:o.parseSize(h,"w:h")};break;case"w:pgMar":p.pageMargin={left:o.parseSize(h,"w:left"),right:o.parseSize(h,"w:right"),top:o.parseSize(h,"w:top"),bottom:o.parseSize(h,"w:bottom"),header:o.parseSize(h,"w:header"),footer:o.parseSize(h,"w:footer"),gutter:o.parseSize(h,"w:gutter")};break;case"w:headerReference":var u=c(e,h);u&&(p.headers[u.headerType]=u.header);break;case"w:footerReference":var w=c(e,h);w&&(p.footers[w.headerType]=w.header);break;case"w:cols":var l={},g=n.getAttrNumber(h,"w:num",1);l.num=g;var v=o.parseSize(h,"w:space");v&&(l.space=v),p.cols=l}}}catch(e){a={error:e}}finally{try{f&&!f.done&&(s=d.return)&&s.call(d)}finally{if(a)throw a.error}}return p},e}();r.Section=p}));
;/*!node_modules/office-viewer/lib/openxml/word/Body.js*/
amis.define("ffa9a96",(function(e,t,r,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var c=e("9a586ef"),o=e("6590f09"),i=e("b7e52c8"),a=e("d78ccf3"),s=e("ee1c13c"),d=function(){function e(){this.sections=[],this.currentSection=new s.Section,this.sections.push(this.currentSection)}return e.prototype.addChild=function(e){this.currentSection.addChild(e)},e.prototype.addSection=function(e){this.currentSection.properties=e,this.currentSection=new s.Section,this.sections.push(this.currentSection)},e.fromXML=function(t,r){var n,d,u=new e;try{for(var f=c.__values(o.mergeSdt(r)),h=f.next();!h.done;h=f.next()){var l=h.value,p=l.tagName;switch(p){case"w:p":var S=a.Paragraph.fromXML(t,l);u.addChild(S);break;case"w:tbl":var w=i.parseTable(t,l);u.addChild(w);break;case"w:bookmarkStart":case"w:bookmarkEnd":break;case"w:sectPr":u.addSection(s.Section.parsePr(t,l,u));break;default:console.warn("Body.fromXML Unknown key",p,l)}}}catch(e){n={error:e}}finally{try{h&&!h.done&&(d=f.return)&&d.call(f)}finally{if(n)throw n.error}}return u.sections=u.sections.filter((function(e){return e.children.length>0})),u},e}();t.Body=d}));
;/*!node_modules/office-viewer/lib/openxml/word/WDocument.js*/
amis.define("df4980a",(function(e,r,o,t){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var a=e("9a586ef"),n=e("cc1ca20"),l=e("3d946ff"),c=e("ffa9a96");var i=function(){function e(){}return e.fromXML=function(r,o){var t,i,f,u,m=new e,h=o.getElementsByTagName("w:body").item(0);h&&(m.body=c.Body.fromXML(r,h));var d=o.getElementsByTagName("w:background").item(0);if(d){var s={};try{for(var w=a.__values(d.attributes),v=w.next();!v.done;v=w.next()){switch(v.value.name){case"w:color":s.color=l.parseColorAttr(r,d,"w:color");break;case"w:themeColor":s.themeColor=l.parseColorAttr(r,d,"w:themeColor");break;case"w:themeShade":s.themeShade=l.parseColorAttr(r,d,"w:themeShade");break;case"w:themeTint":s.themeTint=l.parseColorAttr(r,d,"w:themeTint");break;default:console.log("unknown background",d)}}}catch(e){t={error:e}}finally{try{v&&!v.done&&(i=w.return)&&i.call(w)}finally{if(t)throw t.error}}try{for(var y=a.__values(d.children),b=y.next();!b.done;b=y.next()){if("v:background"===b.value.tagName);else console.log("unknown background",d)}}catch(e){f={error:e}}finally{try{b&&!b.done&&(u=y.return)&&u.call(y)}finally{if(f)throw f.error}}m.backgroundColor=function(e){if(e.color)return e.color;if(e.themeColor){var r=e.themeColor;if(e.themeTint){var o=new n.Color(r),t=parseInt(e.themeTint,16);o.tint(t/256)}else e.themeShade&&(o=new n.Color(r),t=parseInt(e.themeShade,16),o.lumMod(t/256))}return"#FFFFF"}(s)}return m},e}();r.WDocument=i}));
;/*!node_modules/fflate/lib/worker.cjs*/
amis.define('node_modules/fflate/lib/worker.cjs', function(require, exports, module, define) {
"use strict";
var ch2 = {};
exports["default"] = (function (c, id, msg, transfer, cb) {
var w = new Worker(ch2[id] || (ch2[id] = URL.createObjectURL(new Blob([
c + ';addEventListener("error",function(e){e=e.error;postMessage({$e$:[e.message,e.code,e.stack]})})'
], { type: 'text/javascript' }))));
w.onmessage = function (e) {
var d = e.data, ed = d.$e$;
if (ed) {
var err = new Error(ed[0]);
err['code'] = ed[1];
err.stack = ed[2];
cb(err, null);
}
else
cb(null, d);
};
w.postMessage(msg, transfer);
return w;
});
});
;/*!node_modules/fflate/lib/index.cjs*/
amis.define('node_modules/fflate/lib/index.cjs', function(require, exports, module, define) {
"use strict";
// DEFLATE is a complex format; to read this code, you should probably check the RFC first:
// https://tools.ietf.org/html/rfc1951
// You may also wish to take a look at the guide I made about this program:
// https://gist.github.com/101arrowz/253f31eb5abc3d9275ab943003ffecad
// Some of the following code is similar to that of UZIP.js:
// https://github.com/photopea/UZIP.js
// However, the vast majority of the codebase has diverged from UZIP.js to increase performance and reduce bundle size.
// Sometimes 0 will appear where -1 would be more appropriate. This is because using a uint
// is better for memory in most engines (I *think*).
var node_worker_1 = require("node_modules/fflate/lib/worker.cjs");
// aliases for shorter compressed code (most minifers don't do this)
var u8 = Uint8Array, u16 = Uint16Array, u32 = Uint32Array;
// fixed length extra bits
var fleb = new u8([0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, /* unused */ 0, 0, /* impossible */ 0]);
// fixed distance extra bits
// see fleb note
var fdeb = new u8([0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, /* unused */ 0, 0]);
// code length index map
var clim = new u8([16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]);
// get base, reverse index map from extra bits
var freb = function (eb, start) {
var b = new u16(31);
for (var i = 0; i < 31; ++i) {
b[i] = start += 1 << eb[i - 1];
}
// numbers here are at max 18 bits
var r = new u32(b[30]);
for (var i = 1; i < 30; ++i) {
for (var j = b[i]; j < b[i + 1]; ++j) {
r[j] = ((j - b[i]) << 5) | i;
}
}
return [b, r];
};
var _a = freb(fleb, 2), fl = _a[0], revfl = _a[1];
// we can ignore the fact that the other numbers are wrong; they never happen anyway
fl[28] = 258, revfl[258] = 28;
var _b = freb(fdeb, 0), fd = _b[0], revfd = _b[1];
// map of value to reverse (assuming 16 bits)
var rev = new u16(32768);
for (var i = 0; i < 32768; ++i) {
// reverse table algorithm from SO
var x = ((i & 0xAAAA) >>> 1) | ((i & 0x5555) << 1);
x = ((x & 0xCCCC) >>> 2) | ((x & 0x3333) << 2);
x = ((x & 0xF0F0) >>> 4) | ((x & 0x0F0F) << 4);
rev[i] = (((x & 0xFF00) >>> 8) | ((x & 0x00FF) << 8)) >>> 1;
}
// create huffman tree from u8 "map": index -> code length for code index
// mb (max bits) must be at most 15
// TODO: optimize/split up?
var hMap = (function (cd, mb, r) {
var s = cd.length;
// index
var i = 0;
// u16 "map": index -> # of codes with bit length = index
var l = new u16(mb);
// length of cd must be 288 (total # of codes)
for (; i < s; ++i) {
if (cd[i])
++l[cd[i] - 1];
}
// u16 "map": index -> minimum code for bit length = index
var le = new u16(mb);
for (i = 0; i < mb; ++i) {
le[i] = (le[i - 1] + l[i - 1]) << 1;
}
var co;
if (r) {
// u16 "map": index -> number of actual bits, symbol for code
co = new u16(1 << mb);
// bits to remove for reverser
var rvb = 15 - mb;
for (i = 0; i < s; ++i) {
// ignore 0 lengths
if (cd[i]) {
// num encoding both symbol and bits read
var sv = (i << 4) | cd[i];
// free bits
var r_1 = mb - cd[i];
// start value
var v = le[cd[i] - 1]++ << r_1;
// m is end value
for (var m = v | ((1 << r_1) - 1); v <= m; ++v) {
// every 16 bit value starting with the code yields the same result
co[rev[v] >>> rvb] = sv;
}
}
}
}
else {
co = new u16(s);
for (i = 0; i < s; ++i) {
if (cd[i]) {
co[i] = rev[le[cd[i] - 1]++] >>> (15 - cd[i]);
}
}
}
return co;
});
// fixed length tree
var flt = new u8(288);
for (var i = 0; i < 144; ++i)
flt[i] = 8;
for (var i = 144; i < 256; ++i)
flt[i] = 9;
for (var i = 256; i < 280; ++i)
flt[i] = 7;
for (var i = 280; i < 288; ++i)
flt[i] = 8;
// fixed distance tree
var fdt = new u8(32);
for (var i = 0; i < 32; ++i)
fdt[i] = 5;
// fixed length map
var flm = /*#__PURE__*/ hMap(flt, 9, 0), flrm = /*#__PURE__*/ hMap(flt, 9, 1);
// fixed distance map
var fdm = /*#__PURE__*/ hMap(fdt, 5, 0), fdrm = /*#__PURE__*/ hMap(fdt, 5, 1);
// find max of array
var max = function (a) {
var m = a[0];
for (var i = 1; i < a.length; ++i) {
if (a[i] > m)
m = a[i];
}
return m;
};
// read d, starting at bit p and mask with m
var bits = function (d, p, m) {
var o = (p / 8) | 0;
return ((d[o] | (d[o + 1] << 8)) >> (p & 7)) & m;
};
// read d, starting at bit p continuing for at least 16 bits
var bits16 = function (d, p) {
var o = (p / 8) | 0;
return ((d[o] | (d[o + 1] << 8) | (d[o + 2] << 16)) >> (p & 7));
};
// get end of byte
var shft = function (p) { return ((p + 7) / 8) | 0; };
// typed array slice - allows garbage collector to free original reference,
// while being more compatible than .slice
var slc = function (v, s, e) {
if (s == null || s < 0)
s = 0;
if (e == null || e > v.length)
e = v.length;
// can't use .constructor in case user-supplied
var n = new (v.BYTES_PER_ELEMENT == 2 ? u16 : v.BYTES_PER_ELEMENT == 4 ? u32 : u8)(e - s);
n.set(v.subarray(s, e));
return n;
};
/**
* Codes for errors generated within this library
*/
exports.FlateErrorCode = {
UnexpectedEOF: 0,
InvalidBlockType: 1,
InvalidLengthLiteral: 2,
InvalidDistance: 3,
StreamFinished: 4,
NoStreamHandler: 5,
InvalidHeader: 6,
NoCallback: 7,
InvalidUTF8: 8,
ExtraFieldTooLong: 9,
InvalidDate: 10,
FilenameTooLong: 11,
StreamFinishing: 12,
InvalidZipData: 13,
UnknownCompressionMethod: 14
};
// error codes
var ec = [
'unexpected EOF',
'invalid block type',
'invalid length/literal',
'invalid distance',
'stream finished',
'no stream handler',
,
'no callback',
'invalid UTF-8 data',
'extra field too long',
'date not in range 1980-2099',
'filename too long',
'stream finishing',
'invalid zip data'
// determined by unknown compression method
];
;
var err = function (ind, msg, nt) {
var e = new Error(msg || ec[ind]);
e.code = ind;
if (Error.captureStackTrace)
Error.captureStackTrace(e, err);
if (!nt)
throw e;
return e;
};
// expands raw DEFLATE data
var inflt = function (dat, buf, st) {
// source length
var sl = dat.length;
if (!sl || (st && st.f && !st.l))
return buf || new u8(0);
// have to estimate size
var noBuf = !buf || st;
// no state
var noSt = !st || st.i;
if (!st)
st = {};
// Assumes roughly 33% compression ratio average
if (!buf)
buf = new u8(sl * 3);
// ensure buffer can fit at least l elements
var cbuf = function (l) {
var bl = buf.length;
// need to increase size to fit
if (l > bl) {
// Double or set to necessary, whichever is greater
var nbuf = new u8(Math.max(bl * 2, l));
nbuf.set(buf);
buf = nbuf;
}
};
// last chunk bitpos bytes
var final = st.f || 0, pos = st.p || 0, bt = st.b || 0, lm = st.l, dm = st.d, lbt = st.m, dbt = st.n;
// total bits
var tbts = sl * 8;
do {
if (!lm) {
// BFINAL - this is only 1 when last chunk is next
final = bits(dat, pos, 1);
// type: 0 = no compression, 1 = fixed huffman, 2 = dynamic huffman
var type = bits(dat, pos + 1, 3);
pos += 3;
if (!type) {
// go to end of byte boundary
var s = shft(pos) + 4, l = dat[s - 4] | (dat[s - 3] << 8), t = s + l;
if (t > sl) {
if (noSt)
err(0);
break;
}
// ensure size
if (noBuf)
cbuf(bt + l);
// Copy over uncompressed data
buf.set(dat.subarray(s, t), bt);
// Get new bitpos, update byte count
st.b = bt += l, st.p = pos = t * 8, st.f = final;
continue;
}
else if (type == 1)
lm = flrm, dm = fdrm, lbt = 9, dbt = 5;
else if (type == 2) {
// literal lengths
var hLit = bits(dat, pos, 31) + 257, hcLen = bits(dat, pos + 10, 15) + 4;
var tl = hLit + bits(dat, pos + 5, 31) + 1;
pos += 14;
// length+distance tree
var ldt = new u8(tl);
// code length tree
var clt = new u8(19);
for (var i = 0; i < hcLen; ++i) {
// use index map to get real code
clt[clim[i]] = bits(dat, pos + i * 3, 7);
}
pos += hcLen * 3;
// code lengths bits
var clb = max(clt), clbmsk = (1 << clb) - 1;
// code lengths map
var clm = hMap(clt, clb, 1);
for (var i = 0; i < tl;) {
var r = clm[bits(dat, pos, clbmsk)];
// bits read
pos += r & 15;
// symbol
var s = r >>> 4;
// code length to copy
if (s < 16) {
ldt[i++] = s;
}
else {
// copy count
var c = 0, n = 0;
if (s == 16)
n = 3 + bits(dat, pos, 3), pos += 2, c = ldt[i - 1];
else if (s == 17)
n = 3 + bits(dat, pos, 7), pos += 3;
else if (s == 18)
n = 11 + bits(dat, pos, 127), pos += 7;
while (n--)
ldt[i++] = c;
}
}
// length tree distance tree
var lt = ldt.subarray(0, hLit), dt = ldt.subarray(hLit);
// max length bits
lbt = max(lt);
// max dist bits
dbt = max(dt);
lm = hMap(lt, lbt, 1);
dm = hMap(dt, dbt, 1);
}
else
err(1);
if (pos > tbts) {
if (noSt)
err(0);
break;
}
}
// Make sure the buffer can hold this + the largest possible addition
// Maximum chunk size (practically, theoretically infinite) is 2^17;
if (noBuf)
cbuf(bt + 131072);
var lms = (1 << lbt) - 1, dms = (1 << dbt) - 1;
var lpos = pos;
for (;; lpos = pos) {
// bits read, code
var c = lm[bits16(dat, pos) & lms], sym = c >>> 4;
pos += c & 15;
if (pos > tbts) {
if (noSt)
err(0);
break;
}
if (!c)
err(2);
if (sym < 256)
buf[bt++] = sym;
else if (sym == 256) {
lpos = pos, lm = null;
break;
}
else {
var add = sym - 254;
// no extra bits needed if less
if (sym > 264) {
// index
var i = sym - 257, b = fleb[i];
add = bits(dat, pos, (1 << b) - 1) + fl[i];
pos += b;
}
// dist
var d = dm[bits16(dat, pos) & dms], dsym = d >>> 4;
if (!d)
err(3);
pos += d & 15;
var dt = fd[dsym];
if (dsym > 3) {
var b = fdeb[dsym];
dt += bits16(dat, pos) & ((1 << b) - 1), pos += b;
}
if (pos > tbts) {
if (noSt)
err(0);
break;
}
if (noBuf)
cbuf(bt + 131072);
var end = bt + add;
for (; bt < end; bt += 4) {
buf[bt] = buf[bt - dt];
buf[bt + 1] = buf[bt + 1 - dt];
buf[bt + 2] = buf[bt + 2 - dt];
buf[bt + 3] = buf[bt + 3 - dt];
}
bt = end;
}
}
st.l = lm, st.p = lpos, st.b = bt, st.f = final;
if (lm)
final = 1, st.m = lbt, st.d = dm, st.n = dbt;
} while (!final);
return bt == buf.length ? buf : slc(buf, 0, bt);
};
// starting at p, write the minimum number of bits that can hold v to d
var wbits = function (d, p, v) {
v <<= p & 7;
var o = (p / 8) | 0;
d[o] |= v;
d[o + 1] |= v >>> 8;
};
// starting at p, write the minimum number of bits (>8) that can hold v to d
var wbits16 = function (d, p, v) {
v <<= p & 7;
var o = (p / 8) | 0;
d[o] |= v;
d[o + 1] |= v >>> 8;
d[o + 2] |= v >>> 16;
};
// creates code lengths from a frequency table
var hTree = function (d, mb) {
// Need extra info to make a tree
var t = [];
for (var i = 0; i < d.length; ++i) {
if (d[i])
t.push({ s: i, f: d[i] });
}
var s = t.length;
var t2 = t.slice();
if (!s)
return [et, 0];
if (s == 1) {
var v = new u8(t[0].s + 1);
v[t[0].s] = 1;
return [v, 1];
}
t.sort(function (a, b) { return a.f - b.f; });
// after i2 reaches last ind, will be stopped
// freq must be greater than largest possible number of symbols
t.push({ s: -1, f: 25001 });
var l = t[0], r = t[1], i0 = 0, i1 = 1, i2 = 2;
t[0] = { s: -1, f: l.f + r.f, l: l, r: r };
// efficient algorithm from UZIP.js
// i0 is lookbehind, i2 is lookahead - after processing two low-freq
// symbols that combined have high freq, will start processing i2 (high-freq,
// non-composite) symbols instead
// see https://reddit.com/r/photopea/comments/ikekht/uzipjs_questions/
while (i1 != s - 1) {
l = t[t[i0].f < t[i2].f ? i0++ : i2++];
r = t[i0 != i1 && t[i0].f < t[i2].f ? i0++ : i2++];
t[i1++] = { s: -1, f: l.f + r.f, l: l, r: r };
}
var maxSym = t2[0].s;
for (var i = 1; i < s; ++i) {
if (t2[i].s > maxSym)
maxSym = t2[i].s;
}
// code lengths
var tr = new u16(maxSym + 1);
// max bits in tree
var mbt = ln(t[i1 - 1], tr, 0);
if (mbt > mb) {
// more algorithms from UZIP.js
// TODO: find out how this code works (debt)
// ind debt
var i = 0, dt = 0;
// left cost
var lft = mbt - mb, cst = 1 << lft;
t2.sort(function (a, b) { return tr[b.s] - tr[a.s] || a.f - b.f; });
for (; i < s; ++i) {
var i2_1 = t2[i].s;
if (tr[i2_1] > mb) {
dt += cst - (1 << (mbt - tr[i2_1]));
tr[i2_1] = mb;
}
else
break;
}
dt >>>= lft;
while (dt > 0) {
var i2_2 = t2[i].s;
if (tr[i2_2] < mb)
dt -= 1 << (mb - tr[i2_2]++ - 1);
else
++i;
}
for (; i >= 0 && dt; --i) {
var i2_3 = t2[i].s;
if (tr[i2_3] == mb) {
--tr[i2_3];
++dt;
}
}
mbt = mb;
}
return [new u8(tr), mbt];
};
// get the max length and assign length codes
var ln = function (n, l, d) {
return n.s == -1
? Math.max(ln(n.l, l, d + 1), ln(n.r, l, d + 1))
: (l[n.s] = d);
};
// length codes generation
var lc = function (c) {
var s = c.length;
// Note that the semicolon was intentional
while (s && !c[--s])
;
var cl = new u16(++s);
// ind num streak
var cli = 0, cln = c[0], cls = 1;
var w = function (v) { cl[cli++] = v; };
for (var i = 1; i <= s; ++i) {
if (c[i] == cln && i != s)
++cls;
else {
if (!cln && cls > 2) {
for (; cls > 138; cls -= 138)
w(32754);
if (cls > 2) {
w(cls > 10 ? ((cls - 11) << 5) | 28690 : ((cls - 3) << 5) | 12305);
cls = 0;
}
}
else if (cls > 3) {
w(cln), --cls;
for (; cls > 6; cls -= 6)
w(8304);
if (cls > 2)
w(((cls - 3) << 5) | 8208), cls = 0;
}
while (cls--)
w(cln);
cls = 1;
cln = c[i];
}
}
return [cl.subarray(0, cli), s];
};
// calculate the length of output from tree, code lengths
var clen = function (cf, cl) {
var l = 0;
for (var i = 0; i < cl.length; ++i)
l += cf[i] * cl[i];
return l;
};
// writes a fixed block
// returns the new bit pos
var wfblk = function (out, pos, dat) {
// no need to write 00 as type: TypedArray defaults to 0
var s = dat.length;
var o = shft(pos + 2);
out[o] = s & 255;
out[o + 1] = s >>> 8;
out[o + 2] = out[o] ^ 255;
out[o + 3] = out[o + 1] ^ 255;
for (var i = 0; i < s; ++i)
out[o + i + 4] = dat[i];
return (o + 4 + s) * 8;
};
// writes a block
var wblk = function (dat, out, final, syms, lf, df, eb, li, bs, bl, p) {
wbits(out, p++, final);
++lf[256];
var _a = hTree(lf, 15), dlt = _a[0], mlb = _a[1];
var _b = hTree(df, 15), ddt = _b[0], mdb = _b[1];
var _c = lc(dlt), lclt = _c[0], nlc = _c[1];
var _d = lc(ddt), lcdt = _d[0], ndc = _d[1];
var lcfreq = new u16(19);
for (var i = 0; i < lclt.length; ++i)
lcfreq[lclt[i] & 31]++;
for (var i = 0; i < lcdt.length; ++i)
lcfreq[lcdt[i] & 31]++;
var _e = hTree(lcfreq, 7), lct = _e[0], mlcb = _e[1];
var nlcc = 19;
for (; nlcc > 4 && !lct[clim[nlcc - 1]]; --nlcc)
;
var flen = (bl + 5) << 3;
var ftlen = clen(lf, flt) + clen(df, fdt) + eb;
var dtlen = clen(lf, dlt) + clen(df, ddt) + eb + 14 + 3 * nlcc + clen(lcfreq, lct) + (2 * lcfreq[16] + 3 * lcfreq[17] + 7 * lcfreq[18]);
if (flen <= ftlen && flen <= dtlen)
return wfblk(out, p, dat.subarray(bs, bs + bl));
var lm, ll, dm, dl;
wbits(out, p, 1 + (dtlen < ftlen)), p += 2;
if (dtlen < ftlen) {
lm = hMap(dlt, mlb, 0), ll = dlt, dm = hMap(ddt, mdb, 0), dl = ddt;
var llm = hMap(lct, mlcb, 0);
wbits(out, p, nlc - 257);
wbits(out, p + 5, ndc - 1);
wbits(out, p + 10, nlcc - 4);
p += 14;
for (var i = 0; i < nlcc; ++i)
wbits(out, p + 3 * i, lct[clim[i]]);
p += 3 * nlcc;
var lcts = [lclt, lcdt];
for (var it = 0; it < 2; ++it) {
var clct = lcts[it];
for (var i = 0; i < clct.length; ++i) {
var len = clct[i] & 31;
wbits(out, p, llm[len]), p += lct[len];
if (len > 15)
wbits(out, p, (clct[i] >>> 5) & 127), p += clct[i] >>> 12;
}
}
}
else {
lm = flm, ll = flt, dm = fdm, dl = fdt;
}
for (var i = 0; i < li; ++i) {
if (syms[i] > 255) {
var len = (syms[i] >>> 18) & 31;
wbits16(out, p, lm[len + 257]), p += ll[len + 257];
if (len > 7)
wbits(out, p, (syms[i] >>> 23) & 31), p += fleb[len];
var dst = syms[i] & 31;
wbits16(out, p, dm[dst]), p += dl[dst];
if (dst > 3)
wbits16(out, p, (syms[i] >>> 5) & 8191), p += fdeb[dst];
}
else {
wbits16(out, p, lm[syms[i]]), p += ll[syms[i]];
}
}
wbits16(out, p, lm[256]);
return p + ll[256];
};
// deflate options (nice << 13) | chain
var deo = /*#__PURE__*/ new u32([65540, 131080, 131088, 131104, 262176, 1048704, 1048832, 2114560, 2117632]);
// empty
var et = /*#__PURE__*/ new u8(0);
// compresses data into a raw DEFLATE buffer
var dflt = function (dat, lvl, plvl, pre, post, lst) {
var s = dat.length;
var o = new u8(pre + s + 5 * (1 + Math.ceil(s / 7000)) + post);
// writing to this writes to the output buffer
var w = o.subarray(pre, o.length - post);
var pos = 0;
if (!lvl || s < 8) {
for (var i = 0; i <= s; i += 65535) {
// end
var e = i + 65535;
if (e >= s) {
// write final block
w[pos >> 3] = lst;
}
pos = wfblk(w, pos + 1, dat.subarray(i, e));
}
}
else {
var opt = deo[lvl - 1];
var n = opt >>> 13, c = opt & 8191;
var msk_1 = (1 << plvl) - 1;
// prev 2-byte val map curr 2-byte val map
var prev = new u16(32768), head = new u16(msk_1 + 1);
var bs1_1 = Math.ceil(plvl / 3), bs2_1 = 2 * bs1_1;
var hsh = function (i) { return (dat[i] ^ (dat[i + 1] << bs1_1) ^ (dat[i + 2] << bs2_1)) & msk_1; };
// 24576 is an arbitrary number of maximum symbols per block
// 424 buffer for last block
var syms = new u32(25000);
// length/literal freq distance freq
var lf = new u16(288), df = new u16(32);
// l/lcnt exbits index l/lind waitdx bitpos
var lc_1 = 0, eb = 0, i = 0, li = 0, wi = 0, bs = 0;
for (; i < s; ++i) {
// hash value
// deopt when i > s - 3 - at end, deopt acceptable
var hv = hsh(i);
// index mod 32768 previous index mod
var imod = i & 32767, pimod = head[hv];
prev[imod] = pimod;
head[hv] = imod;
// We always should modify head and prev, but only add symbols if
// this data is not yet processed ("wait" for wait index)
if (wi <= i) {
// bytes remaining
var rem = s - i;
if ((lc_1 > 7000 || li > 24576) && rem > 423) {
pos = wblk(dat, w, 0, syms, lf, df, eb, li, bs, i - bs, pos);
li = lc_1 = eb = 0, bs = i;
for (var j = 0; j < 286; ++j)
lf[j] = 0;
for (var j = 0; j < 30; ++j)
df[j] = 0;
}
// len dist chain
var l = 2, d = 0, ch_1 = c, dif = (imod - pimod) & 32767;
if (rem > 2 && hv == hsh(i - dif)) {
var maxn = Math.min(n, rem) - 1;
var maxd = Math.min(32767, i);
// max possible length
// not capped at dif because decompressors implement "rolling" index population
var ml = Math.min(258, rem);
while (dif <= maxd && --ch_1 && imod != pimod) {
if (dat[i + l] == dat[i + l - dif]) {
var nl = 0;
for (; nl < ml && dat[i + nl] == dat[i + nl - dif]; ++nl)
;
if (nl > l) {
l = nl, d = dif;
// break out early when we reach "nice" (we are satisfied enough)
if (nl > maxn)
break;
// now, find the rarest 2-byte sequence within this
// length of literals and search for that instead.
// Much faster than just using the start
var mmd = Math.min(dif, nl - 2);
var md = 0;
for (var j = 0; j < mmd; ++j) {
var ti = (i - dif + j + 32768) & 32767;
var pti = prev[ti];
var cd = (ti - pti + 32768) & 32767;
if (cd > md)
md = cd, pimod = ti;
}
}
}
// check the previous match
imod = pimod, pimod = prev[imod];
dif += (imod - pimod + 32768) & 32767;
}
}
// d will be nonzero only when a match was found
if (d) {
// store both dist and len data in one Uint32
// Make sure this is recognized as a len/dist with 28th bit (2^28)
syms[li++] = 268435456 | (revfl[l] << 18) | revfd[d];
var lin = revfl[l] & 31, din = revfd[d] & 31;
eb += fleb[lin] + fdeb[din];
++lf[257 + lin];
++df[din];
wi = i + l;
++lc_1;
}
else {
syms[li++] = dat[i];
++lf[dat[i]];
}
}
}
pos = wblk(dat, w, lst, syms, lf, df, eb, li, bs, i - bs, pos);
// this is the easiest way to avoid needing to maintain state
if (!lst && pos & 7)
pos = wfblk(w, pos + 1, et);
}
return slc(o, 0, pre + shft(pos) + post);
};
// CRC32 table
var crct = /*#__PURE__*/ (function () {
var t = new Int32Array(256);
for (var i = 0; i < 256; ++i) {
var c = i, k = 9;
while (--k)
c = ((c & 1) && -306674912) ^ (c >>> 1);
t[i] = c;
}
return t;
})();
// CRC32
var crc = function () {
var c = -1;
return {
p: function (d) {
// closures have awful performance
var cr = c;
for (var i = 0; i < d.length; ++i)
cr = crct[(cr & 255) ^ d[i]] ^ (cr >>> 8);
c = cr;
},
d: function () { return ~c; }
};
};
// Alder32
var adler = function () {
var a = 1, b = 0;
return {
p: function (d) {
// closures have awful performance
var n = a, m = b;
var l = d.length | 0;
for (var i = 0; i != l;) {
var e = Math.min(i + 2655, l);
for (; i < e; ++i)
m += n += d[i];
n = (n & 65535) + 15 * (n >> 16), m = (m & 65535) + 15 * (m >> 16);
}
a = n, b = m;
},
d: function () {
a %= 65521, b %= 65521;
return (a & 255) << 24 | (a >>> 8) << 16 | (b & 255) << 8 | (b >>> 8);
}
};
};
;
// deflate with opts
var dopt = function (dat, opt, pre, post, st) {
return dflt(dat, opt.level == null ? 6 : opt.level, opt.mem == null ? Math.ceil(Math.max(8, Math.min(13, Math.log(dat.length))) * 1.5) : (12 + opt.mem), pre, post, !st);
};
// Walmart object spread
var mrg = function (a, b) {
var o = {};
for (var k in a)
o[k] = a[k];
for (var k in b)
o[k] = b[k];
return o;
};
// worker clone
// This is possibly the craziest part of the entire codebase, despite how simple it may seem.
// The only parameter to this function is a closure that returns an array of variables outside of the function scope.
// We're going to try to figure out the variable names used in the closure as strings because that is crucial for workerization.
// We will return an object mapping of true variable name to value (basically, the current scope as a JS object).
// The reason we can't just use the original variable names is minifiers mangling the toplevel scope.
// This took me three weeks to figure out how to do.
var wcln = function (fn, fnStr, td) {
var dt = fn();
var st = fn.toString();
var ks = st.slice(st.indexOf('[') + 1, st.lastIndexOf(']')).replace(/\s+/g, '').split(',');
for (var i = 0; i < dt.length; ++i) {
var v = dt[i], k = ks[i];
if (typeof v == 'function') {
fnStr += ';' + k + '=';
var st_1 = v.toString();
if (v.prototype) {
// for global objects
if (st_1.indexOf('[native code]') != -1) {
var spInd = st_1.indexOf(' ', 8) + 1;
fnStr += st_1.slice(spInd, st_1.indexOf('(', spInd));
}
else {
fnStr += st_1;
for (var t in v.prototype)
fnStr += ';' + k + '.prototype.' + t + '=' + v.prototype[t].toString();
}
}
else
fnStr += st_1;
}
else
td[k] = v;
}
return [fnStr, td];
};
var ch = [];
// clone bufs
var cbfs = function (v) {
var tl = [];
for (var k in v) {
if (v[k].buffer) {
tl.push((v[k] = new v[k].constructor(v[k])).buffer);
}
}
return tl;
};
// use a worker to execute code
var wrkr = function (fns, init, id, cb) {
var _a;
if (!ch[id]) {
var fnStr = '', td_1 = {}, m = fns.length - 1;
for (var i = 0; i < m; ++i)
_a = wcln(fns[i], fnStr, td_1), fnStr = _a[0], td_1 = _a[1];
ch[id] = wcln(fns[m], fnStr, td_1);
}
var td = mrg({}, ch[id][1]);
return node_worker_1["default"](ch[id][0] + ';onmessage=function(e){for(var k in e.data)self[k]=e.data[k];onmessage=' + init.toString() + '}', id, td, cbfs(td), cb);
};
// base async inflate fn
var bInflt = function () { return [u8, u16, u32, fleb, fdeb, clim, fl, fd, flrm, fdrm, rev, ec, hMap, max, bits, bits16, shft, slc, err, inflt, inflateSync, pbf, gu8]; };
var bDflt = function () { return [u8, u16, u32, fleb, fdeb, clim, revfl, revfd, flm, flt, fdm, fdt, rev, deo, et, hMap, wbits, wbits16, hTree, ln, lc, clen, wfblk, wblk, shft, slc, dflt, dopt, deflateSync, pbf]; };
// gzip extra
var gze = function () { return [gzh, gzhl, wbytes, crc, crct]; };
// gunzip extra
var guze = function () { return [gzs, gzl]; };
// zlib extra
var zle = function () { return [zlh, wbytes, adler]; };
// unzlib extra
var zule = function () { return [zlv]; };
// post buf
var pbf = function (msg) { return postMessage(msg, [msg.buffer]); };
// get u8
var gu8 = function (o) { return o && o.size && new u8(o.size); };
// async helper
var cbify = function (dat, opts, fns, init, id, cb) {
var w = wrkr(fns, init, id, function (err, dat) {
w.terminate();
cb(err, dat);
});
w.postMessage([dat, opts], opts.consume ? [dat.buffer] : []);
return function () { w.terminate(); };
};
// auto stream
var astrm = function (strm) {
strm.ondata = function (dat, final) { return postMessage([dat, final], [dat.buffer]); };
return function (ev) { return strm.push(ev.data[0], ev.data[1]); };
};
// async stream attach
var astrmify = function (fns, strm, opts, init, id) {
var t;
var w = wrkr(fns, init, id, function (err, dat) {
if (err)
w.terminate(), strm.ondata.call(strm, err);
else {
if (dat[1])
w.terminate();
strm.ondata.call(strm, err, dat[0], dat[1]);
}
});
w.postMessage(opts);
strm.push = function (d, f) {
if (!strm.ondata)
err(5);
if (t)
strm.ondata(err(4, 0, 1), null, !!f);
w.postMessage([d, t = f], [d.buffer]);
};
strm.terminate = function () { w.terminate(); };
};
// read 2 bytes
var b2 = function (d, b) { return d[b] | (d[b + 1] << 8); };
// read 4 bytes
var b4 = function (d, b) { return (d[b] | (d[b + 1] << 8) | (d[b + 2] << 16) | (d[b + 3] << 24)) >>> 0; };
var b8 = function (d, b) { return b4(d, b) + (b4(d, b + 4) * 4294967296); };
// write bytes
var wbytes = function (d, b, v) {
for (; v; ++b)
d[b] = v, v >>>= 8;
};
// gzip header
var gzh = function (c, o) {
var fn = o.filename;
c[0] = 31, c[1] = 139, c[2] = 8, c[8] = o.level < 2 ? 4 : o.level == 9 ? 2 : 0, c[9] = 3; // assume Unix
if (o.mtime != 0)
wbytes(c, 4, Math.floor(new Date(o.mtime || Date.now()) / 1000));
if (fn) {
c[3] = 8;
for (var i = 0; i <= fn.length; ++i)
c[i + 10] = fn.charCodeAt(i);
}
};
// gzip footer: -8 to -4 = CRC, -4 to -0 is length
// gzip start
var gzs = function (d) {
if (d[0] != 31 || d[1] != 139 || d[2] != 8)
err(6, 'invalid gzip data');
var flg = d[3];
var st = 10;
if (flg & 4)
st += d[10] | (d[11] << 8) + 2;
for (var zs = (flg >> 3 & 1) + (flg >> 4 & 1); zs > 0; zs -= !d[st++])
;
return st + (flg & 2);
};
// gzip length
var gzl = function (d) {
var l = d.length;
return ((d[l - 4] | d[l - 3] << 8 | d[l - 2] << 16) | (d[l - 1] << 24)) >>> 0;
};
// gzip header length
var gzhl = function (o) { return 10 + ((o.filename && (o.filename.length + 1)) || 0); };
// zlib header
var zlh = function (c, o) {
var lv = o.level, fl = lv == 0 ? 0 : lv < 6 ? 1 : lv == 9 ? 3 : 2;
c[0] = 120, c[1] = (fl << 6) | (fl ? (32 - 2 * fl) : 1);
};
// zlib valid
var zlv = function (d) {
if ((d[0] & 15) != 8 || (d[0] >>> 4) > 7 || ((d[0] << 8 | d[1]) % 31))
err(6, 'invalid zlib data');
if (d[1] & 32)
err(6, 'invalid zlib data: preset dictionaries not supported');
};
function AsyncCmpStrm(opts, cb) {
if (!cb && typeof opts == 'function')
cb = opts, opts = {};
this.ondata = cb;
return opts;
}
// zlib footer: -4 to -0 is Adler32
/**
* Streaming DEFLATE compression
*/
var Deflate = /*#__PURE__*/ (function () {
function Deflate(opts, cb) {
if (!cb && typeof opts == 'function')
cb = opts, opts = {};
this.ondata = cb;
this.o = opts || {};
}
Deflate.prototype.p = function (c, f) {
this.ondata(dopt(c, this.o, 0, 0, !f), f);
};
/**
* Pushes a chunk to be deflated
* @param chunk The chunk to push
* @param final Whether this is the last chunk
*/
Deflate.prototype.push = function (chunk, final) {
if (!this.ondata)
err(5);
if (this.d)
err(4);
this.d = final;
this.p(chunk, final || false);
};
return Deflate;
}());
exports.Deflate = Deflate;
/**
* Asynchronous streaming DEFLATE compression
*/
var AsyncDeflate = /*#__PURE__*/ (function () {
function AsyncDeflate(opts, cb) {
astrmify([
bDflt,
function () { return [astrm, Deflate]; }
], this, AsyncCmpStrm.call(this, opts, cb), function (ev) {
var strm = new Deflate(ev.data);
onmessage = astrm(strm);
}, 6);
}
return AsyncDeflate;
}());
exports.AsyncDeflate = AsyncDeflate;
function deflate(data, opts, cb) {
if (!cb)
cb = opts, opts = {};
if (typeof cb != 'function')
err(7);
return cbify(data, opts, [
bDflt,
], function (ev) { return pbf(deflateSync(ev.data[0], ev.data[1])); }, 0, cb);
}
exports.deflate = deflate;
/**
* Compresses data with DEFLATE without any wrapper
* @param data The data to compress
* @param opts The compression options
* @returns The deflated version of the data
*/
function deflateSync(data, opts) {
return dopt(data, opts || {}, 0, 0);
}
exports.deflateSync = deflateSync;
/**
* Streaming DEFLATE decompression
*/
var Inflate = /*#__PURE__*/ (function () {
/**
* Creates an inflation stream
* @param cb The callback to call whenever data is inflated
*/
function Inflate(cb) {
this.s = {};
this.p = new u8(0);
this.ondata = cb;
}
Inflate.prototype.e = function (c) {
if (!this.ondata)
err(5);
if (this.d)
err(4);
var l = this.p.length;
var n = new u8(l + c.length);
n.set(this.p), n.set(c, l), this.p = n;
};
Inflate.prototype.c = function (final) {
this.d = this.s.i = final || false;
var bts = this.s.b;
var dt = inflt(this.p, this.o, this.s);
this.ondata(slc(dt, bts, this.s.b), this.d);
this.o = slc(dt, this.s.b - 32768), this.s.b = this.o.length;
this.p = slc(this.p, (this.s.p / 8) | 0), this.s.p &= 7;
};
/**
* Pushes a chunk to be inflated
* @param chunk The chunk to push
* @param final Whether this is the final chunk
*/
Inflate.prototype.push = function (chunk, final) {
this.e(chunk), this.c(final);
};
return Inflate;
}());
exports.Inflate = Inflate;
/**
* Asynchronous streaming DEFLATE decompression
*/
var AsyncInflate = /*#__PURE__*/ (function () {
/**
* Creates an asynchronous inflation stream
* @param cb The callback to call whenever data is deflated
*/
function AsyncInflate(cb) {
this.ondata = cb;
astrmify([
bInflt,
function () { return [astrm, Inflate]; }
], this, 0, function () {
var strm = new Inflate();
onmessage = astrm(strm);
}, 7);
}
return AsyncInflate;
}());
exports.AsyncInflate = AsyncInflate;
function inflate(data, opts, cb) {
if (!cb)
cb = opts, opts = {};
if (typeof cb != 'function')
err(7);
return cbify(data, opts, [
bInflt
], function (ev) { return pbf(inflateSync(ev.data[0], gu8(ev.data[1]))); }, 1, cb);
}
exports.inflate = inflate;
/**
* Expands DEFLATE data with no wrapper
* @param data The data to decompress
* @param out Where to write the data. Saves memory if you know the decompressed size and provide an output buffer of that length.
* @returns The decompressed version of the data
*/
function inflateSync(data, out) {
return inflt(data, out);
}
exports.inflateSync = inflateSync;
// before you yell at me for not just using extends, my reason is that TS inheritance is hard to workerize.
/**
* Streaming GZIP compression
*/
var Gzip = /*#__PURE__*/ (function () {
function Gzip(opts, cb) {
this.c = crc();
this.l = 0;
this.v = 1;
Deflate.call(this, opts, cb);
}
/**
* Pushes a chunk to be GZIPped
* @param chunk The chunk to push
* @param final Whether this is the last chunk
*/
Gzip.prototype.push = function (chunk, final) {
Deflate.prototype.push.call(this, chunk, final);
};
Gzip.prototype.p = function (c, f) {
this.c.p(c);
this.l += c.length;
var raw = dopt(c, this.o, this.v && gzhl(this.o), f && 8, !f);
if (this.v)
gzh(raw, this.o), this.v = 0;
if (f)
wbytes(raw, raw.length - 8, this.c.d()), wbytes(raw, raw.length - 4, this.l);
this.ondata(raw, f);
};
return Gzip;
}());
exports.Gzip = Gzip;
exports.Compress = Gzip;
/**
* Asynchronous streaming GZIP compression
*/
var AsyncGzip = /*#__PURE__*/ (function () {
function AsyncGzip(opts, cb) {
astrmify([
bDflt,
gze,
function () { return [astrm, Deflate, Gzip]; }
], this, AsyncCmpStrm.call(this, opts, cb), function (ev) {
var strm = new Gzip(ev.data);
onmessage = astrm(strm);
}, 8);
}
return AsyncGzip;
}());
exports.AsyncGzip = AsyncGzip;
exports.AsyncCompress = AsyncGzip;
function gzip(data, opts, cb) {
if (!cb)
cb = opts, opts = {};
if (typeof cb != 'function')
err(7);
return cbify(data, opts, [
bDflt,
gze,
function () { return [gzipSync]; }
], function (ev) { return pbf(gzipSync(ev.data[0], ev.data[1])); }, 2, cb);
}
exports.gzip = gzip;
exports.compress = gzip;
/**
* Compresses data with GZIP
* @param data The data to compress
* @param opts The compression options
* @returns The gzipped version of the data
*/
function gzipSync(data, opts) {
if (!opts)
opts = {};
var c = crc(), l = data.length;
c.p(data);
var d = dopt(data, opts, gzhl(opts), 8), s = d.length;
return gzh(d, opts), wbytes(d, s - 8, c.d()), wbytes(d, s - 4, l), d;
}
exports.gzipSync = gzipSync;
exports.compressSync = gzipSync;
/**
* Streaming GZIP decompression
*/
var Gunzip = /*#__PURE__*/ (function () {
/**
* Creates a GUNZIP stream
* @param cb The callback to call whenever data is inflated
*/
function Gunzip(cb) {
this.v = 1;
Inflate.call(this, cb);
}
/**
* Pushes a chunk to be GUNZIPped
* @param chunk The chunk to push
* @param final Whether this is the last chunk
*/
Gunzip.prototype.push = function (chunk, final) {
Inflate.prototype.e.call(this, chunk);
if (this.v) {
var s = this.p.length > 3 ? gzs(this.p) : 4;
if (s >= this.p.length && !final)
return;
this.p = this.p.subarray(s), this.v = 0;
}
if (final) {
if (this.p.length < 8)
err(6, 'invalid gzip data');
this.p = this.p.subarray(0, -8);
}
// necessary to prevent TS from using the closure value
// This allows for workerization to function correctly
Inflate.prototype.c.call(this, final);
};
return Gunzip;
}());
exports.Gunzip = Gunzip;
/**
* Asynchronous streaming GZIP decompression
*/
var AsyncGunzip = /*#__PURE__*/ (function () {
/**
* Creates an asynchronous GUNZIP stream
* @param cb The callback to call whenever data is deflated
*/
function AsyncGunzip(cb) {
this.ondata = cb;
astrmify([
bInflt,
guze,
function () { return [astrm, Inflate, Gunzip]; }
], this, 0, function () {
var strm = new Gunzip();
onmessage = astrm(strm);
}, 9);
}
return AsyncGunzip;
}());
exports.AsyncGunzip = AsyncGunzip;
function gunzip(data, opts, cb) {
if (!cb)
cb = opts, opts = {};
if (typeof cb != 'function')
err(7);
return cbify(data, opts, [
bInflt,
guze,
function () { return [gunzipSync]; }
], function (ev) { return pbf(gunzipSync(ev.data[0])); }, 3, cb);
}
exports.gunzip = gunzip;
/**
* Expands GZIP data
* @param data The data to decompress
* @param out Where to write the data. GZIP already encodes the output size, so providing this doesn't save memory.
* @returns The decompressed version of the data
*/
function gunzipSync(data, out) {
return inflt(data.subarray(gzs(data), -8), out || new u8(gzl(data)));
}
exports.gunzipSync = gunzipSync;
/**
* Streaming Zlib compression
*/
var Zlib = /*#__PURE__*/ (function () {
function Zlib(opts, cb) {
this.c = adler();
this.v = 1;
Deflate.call(this, opts, cb);
}
/**
* Pushes a chunk to be zlibbed
* @param chunk The chunk to push
* @param final Whether this is the last chunk
*/
Zlib.prototype.push = function (chunk, final) {
Deflate.prototype.push.call(this, chunk, final);
};
Zlib.prototype.p = function (c, f) {
this.c.p(c);
var raw = dopt(c, this.o, this.v && 2, f && 4, !f);
if (this.v)
zlh(raw, this.o), this.v = 0;
if (f)
wbytes(raw, raw.length - 4, this.c.d());
this.ondata(raw, f);
};
return Zlib;
}());
exports.Zlib = Zlib;
/**
* Asynchronous streaming Zlib compression
*/
var AsyncZlib = /*#__PURE__*/ (function () {
function AsyncZlib(opts, cb) {
astrmify([
bDflt,
zle,
function () { return [astrm, Deflate, Zlib]; }
], this, AsyncCmpStrm.call(this, opts, cb), function (ev) {
var strm = new Zlib(ev.data);
onmessage = astrm(strm);
}, 10);
}
return AsyncZlib;
}());
exports.AsyncZlib = AsyncZlib;
function zlib(data, opts, cb) {
if (!cb)
cb = opts, opts = {};
if (typeof cb != 'function')
err(7);
return cbify(data, opts, [
bDflt,
zle,
function () { return [zlibSync]; }
], function (ev) { return pbf(zlibSync(ev.data[0], ev.data[1])); }, 4, cb);
}
exports.zlib = zlib;
/**
* Compress data with Zlib
* @param data The data to compress
* @param opts The compression options
* @returns The zlib-compressed version of the data
*/
function zlibSync(data, opts) {
if (!opts)
opts = {};
var a = adler();
a.p(data);
var d = dopt(data, opts, 2, 4);
return zlh(d, opts), wbytes(d, d.length - 4, a.d()), d;
}
exports.zlibSync = zlibSync;
/**
* Streaming Zlib decompression
*/
var Unzlib = /*#__PURE__*/ (function () {
/**
* Creates a Zlib decompression stream
* @param cb The callback to call whenever data is inflated
*/
function Unzlib(cb) {
this.v = 1;
Inflate.call(this, cb);
}
/**
* Pushes a chunk to be unzlibbed
* @param chunk The chunk to push
* @param final Whether this is the last chunk
*/
Unzlib.prototype.push = function (chunk, final) {
Inflate.prototype.e.call(this, chunk);
if (this.v) {
if (this.p.length < 2 && !final)
return;
this.p = this.p.subarray(2), this.v = 0;
}
if (final) {
if (this.p.length < 4)
err(6, 'invalid zlib data');
this.p = this.p.subarray(0, -4);
}
// necessary to prevent TS from using the closure value
// This allows for workerization to function correctly
Inflate.prototype.c.call(this, final);
};
return Unzlib;
}());
exports.Unzlib = Unzlib;
/**
* Asynchronous streaming Zlib decompression
*/
var AsyncUnzlib = /*#__PURE__*/ (function () {
/**
* Creates an asynchronous Zlib decompression stream
* @param cb The callback to call whenever data is deflated
*/
function AsyncUnzlib(cb) {
this.ondata = cb;
astrmify([
bInflt,
zule,
function () { return [astrm, Inflate, Unzlib]; }
], this, 0, function () {
var strm = new Unzlib();
onmessage = astrm(strm);
}, 11);
}
return AsyncUnzlib;
}());
exports.AsyncUnzlib = AsyncUnzlib;
function unzlib(data, opts, cb) {
if (!cb)
cb = opts, opts = {};
if (typeof cb != 'function')
err(7);
return cbify(data, opts, [
bInflt,
zule,
function () { return [unzlibSync]; }
], function (ev) { return pbf(unzlibSync(ev.data[0], gu8(ev.data[1]))); }, 5, cb);
}
exports.unzlib = unzlib;
/**
* Expands Zlib data
* @param data The data to decompress
* @param out Where to write the data. Saves memory if you know the decompressed size and provide an output buffer of that length.
* @returns The decompressed version of the data
*/
function unzlibSync(data, out) {
return inflt((zlv(data), data.subarray(2, -4)), out);
}
exports.unzlibSync = unzlibSync;
/**
* Streaming GZIP, Zlib, or raw DEFLATE decompression
*/
var Decompress = /*#__PURE__*/ (function () {
/**
* Creates a decompression stream
* @param cb The callback to call whenever data is decompressed
*/
function Decompress(cb) {
this.G = Gunzip;
this.I = Inflate;
this.Z = Unzlib;
this.ondata = cb;
}
/**
* Pushes a chunk to be decompressed
* @param chunk The chunk to push
* @param final Whether this is the last chunk
*/
Decompress.prototype.push = function (chunk, final) {
if (!this.ondata)
err(5);
if (!this.s) {
if (this.p && this.p.length) {
var n = new u8(this.p.length + chunk.length);
n.set(this.p), n.set(chunk, this.p.length);
}
else
this.p = chunk;
if (this.p.length > 2) {
var _this_1 = this;
var cb = function () { _this_1.ondata.apply(_this_1, arguments); };
this.s = (this.p[0] == 31 && this.p[1] == 139 && this.p[2] == 8)
? new this.G(cb)
: ((this.p[0] & 15) != 8 || (this.p[0] >> 4) > 7 || ((this.p[0] << 8 | this.p[1]) % 31))
? new this.I(cb)
: new this.Z(cb);
this.s.push(this.p, final);
this.p = null;
}
}
else
this.s.push(chunk, final);
};
return Decompress;
}());
exports.Decompress = Decompress;
/**
* Asynchronous streaming GZIP, Zlib, or raw DEFLATE decompression
*/
var AsyncDecompress = /*#__PURE__*/ (function () {
/**
* Creates an asynchronous decompression stream
* @param cb The callback to call whenever data is decompressed
*/
function AsyncDecompress(cb) {
this.G = AsyncGunzip;
this.I = AsyncInflate;
this.Z = AsyncUnzlib;
this.ondata = cb;
}
/**
* Pushes a chunk to be decompressed
* @param chunk The chunk to push
* @param final Whether this is the last chunk
*/
AsyncDecompress.prototype.push = function (chunk, final) {
Decompress.prototype.push.call(this, chunk, final);
};
return AsyncDecompress;
}());
exports.AsyncDecompress = AsyncDecompress;
function decompress(data, opts, cb) {
if (!cb)
cb = opts, opts = {};
if (typeof cb != 'function')
err(7);
return (data[0] == 31 && data[1] == 139 && data[2] == 8)
? gunzip(data, opts, cb)
: ((data[0] & 15) != 8 || (data[0] >> 4) > 7 || ((data[0] << 8 | data[1]) % 31))
? inflate(data, opts, cb)
: unzlib(data, opts, cb);
}
exports.decompress = decompress;
/**
* Expands compressed GZIP, Zlib, or raw DEFLATE data, automatically detecting the format
* @param data The data to decompress
* @param out Where to write the data. Saves memory if you know the decompressed size and provide an output buffer of that length.
* @returns The decompressed version of the data
*/
function decompressSync(data, out) {
return (data[0] == 31 && data[1] == 139 && data[2] == 8)
? gunzipSync(data, out)
: ((data[0] & 15) != 8 || (data[0] >> 4) > 7 || ((data[0] << 8 | data[1]) % 31))
? inflateSync(data, out)
: unzlibSync(data, out);
}
exports.decompressSync = decompressSync;
// flatten a directory structure
var fltn = function (d, p, t, o) {
for (var k in d) {
var val = d[k], n = p + k, op = o;
if (Array.isArray(val))
op = mrg(o, val[1]), val = val[0];
if (val instanceof u8)
t[n] = [val, op];
else {
t[n += '/'] = [new u8(0), op];
fltn(val, n, t, o);
}
}
};
// text encoder
var te = typeof TextEncoder != 'undefined' && /*#__PURE__*/ new TextEncoder();
// text decoder
var td = typeof TextDecoder != 'undefined' && /*#__PURE__*/ new TextDecoder();
// text decoder stream
var tds = 0;
try {
td.decode(et, { stream: true });
tds = 1;
}
catch (e) { }
// decode UTF8
var dutf8 = function (d) {
for (var r = '', i = 0;;) {
var c = d[i++];
var eb = (c > 127) + (c > 223) + (c > 239);
if (i + eb > d.length)
return [r, slc(d, i - 1)];
if (!eb)
r += String.fromCharCode(c);
else if (eb == 3) {
c = ((c & 15) << 18 | (d[i++] & 63) << 12 | (d[i++] & 63) << 6 | (d[i++] & 63)) - 65536,
r += String.fromCharCode(55296 | (c >> 10), 56320 | (c & 1023));
}
else if (eb & 1)
r += String.fromCharCode((c & 31) << 6 | (d[i++] & 63));
else
r += String.fromCharCode((c & 15) << 12 | (d[i++] & 63) << 6 | (d[i++] & 63));
}
};
/**
* Streaming UTF-8 decoding
*/
var DecodeUTF8 = /*#__PURE__*/ (function () {
/**
* Creates a UTF-8 decoding stream
* @param cb The callback to call whenever data is decoded
*/
function DecodeUTF8(cb) {
this.ondata = cb;
if (tds)
this.t = new TextDecoder();
else
this.p = et;
}
/**
* Pushes a chunk to be decoded from UTF-8 binary
* @param chunk The chunk to push
* @param final Whether this is the last chunk
*/
DecodeUTF8.prototype.push = function (chunk, final) {
if (!this.ondata)
err(5);
final = !!final;
if (this.t) {
this.ondata(this.t.decode(chunk, { stream: true }), final);
if (final) {
if (this.t.decode().length)
err(8);
this.t = null;
}
return;
}
if (!this.p)
err(4);
var dat = new u8(this.p.length + chunk.length);
dat.set(this.p);
dat.set(chunk, this.p.length);
var _a = dutf8(dat), ch = _a[0], np = _a[1];
if (final) {
if (np.length)
err(8);
this.p = null;
}
else
this.p = np;
this.ondata(ch, final);
};
return DecodeUTF8;
}());
exports.DecodeUTF8 = DecodeUTF8;
/**
* Streaming UTF-8 encoding
*/
var EncodeUTF8 = /*#__PURE__*/ (function () {
/**
* Creates a UTF-8 decoding stream
* @param cb The callback to call whenever data is encoded
*/
function EncodeUTF8(cb) {
this.ondata = cb;
}
/**
* Pushes a chunk to be encoded to UTF-8
* @param chunk The string data to push
* @param final Whether this is the last chunk
*/
EncodeUTF8.prototype.push = function (chunk, final) {
if (!this.ondata)
err(5);
if (this.d)
err(4);
this.ondata(strToU8(chunk), this.d = final || false);
};
return EncodeUTF8;
}());
exports.EncodeUTF8 = EncodeUTF8;
/**
* Converts a string into a Uint8Array for use with compression/decompression methods
* @param str The string to encode
* @param latin1 Whether or not to interpret the data as Latin-1. This should
* not need to be true unless decoding a binary string.
* @returns The string encoded in UTF-8/Latin-1 binary
*/
function strToU8(str, latin1) {
if (latin1) {
var ar_1 = new u8(str.length);
for (var i = 0; i < str.length; ++i)
ar_1[i] = str.charCodeAt(i);
return ar_1;
}
if (te)
return te.encode(str);
var l = str.length;
var ar = new u8(str.length + (str.length >> 1));
var ai = 0;
var w = function (v) { ar[ai++] = v; };
for (var i = 0; i < l; ++i) {
if (ai + 5 > ar.length) {
var n = new u8(ai + 8 + ((l - i) << 1));
n.set(ar);
ar = n;
}
var c = str.charCodeAt(i);
if (c < 128 || latin1)
w(c);
else if (c < 2048)
w(192 | (c >> 6)), w(128 | (c & 63));
else if (c > 55295 && c < 57344)
c = 65536 + (c & 1023 << 10) | (str.charCodeAt(++i) & 1023),
w(240 | (c >> 18)), w(128 | ((c >> 12) & 63)), w(128 | ((c >> 6) & 63)), w(128 | (c & 63));
else
w(224 | (c >> 12)), w(128 | ((c >> 6) & 63)), w(128 | (c & 63));
}
return slc(ar, 0, ai);
}
exports.strToU8 = strToU8;
/**
* Converts a Uint8Array to a string
* @param dat The data to decode to string
* @param latin1 Whether or not to interpret the data as Latin-1. This should
* not need to be true unless encoding to binary string.
* @returns The original UTF-8/Latin-1 string
*/
function strFromU8(dat, latin1) {
if (latin1) {
var r = '';
for (var i = 0; i < dat.length; i += 16384)
r += String.fromCharCode.apply(null, dat.subarray(i, i + 16384));
return r;
}
else if (td)
return td.decode(dat);
else {
var _a = dutf8(dat), out = _a[0], ext = _a[1];
if (ext.length)
err(8);
return out;
}
}
exports.strFromU8 = strFromU8;
;
// deflate bit flag
var dbf = function (l) { return l == 1 ? 3 : l < 6 ? 2 : l == 9 ? 1 : 0; };
// skip local zip header
var slzh = function (d, b) { return b + 30 + b2(d, b + 26) + b2(d, b + 28); };
// read zip header
var zh = function (d, b, z) {
var fnl = b2(d, b + 28), fn = strFromU8(d.subarray(b + 46, b + 46 + fnl), !(b2(d, b + 8) & 2048)), es = b + 46 + fnl, bs = b4(d, b + 20);
var _a = z && bs == 4294967295 ? z64e(d, es) : [bs, b4(d, b + 24), b4(d, b + 42)], sc = _a[0], su = _a[1], off = _a[2];
return [b2(d, b + 10), sc, su, fn, es + b2(d, b + 30) + b2(d, b + 32), off];
};
// read zip64 extra field
var z64e = function (d, b) {
for (; b2(d, b) != 1; b += 4 + b2(d, b + 2))
;
return [b8(d, b + 12), b8(d, b + 4), b8(d, b + 20)];
};
// extra field length
var exfl = function (ex) {
var le = 0;
if (ex) {
for (var k in ex) {
var l = ex[k].length;
if (l > 65535)
err(9);
le += l + 4;
}
}
return le;
};
// write zip header
var wzh = function (d, b, f, fn, u, c, ce, co) {
var fl = fn.length, ex = f.extra, col = co && co.length;
var exl = exfl(ex);
wbytes(d, b, ce != null ? 0x2014B50 : 0x4034B50), b += 4;
if (ce != null)
d[b++] = 20, d[b++] = f.os;
d[b] = 20, b += 2; // spec compliance? what's that?
d[b++] = (f.flag << 1) | (c < 0 && 8), d[b++] = u && 8;
d[b++] = f.compression & 255, d[b++] = f.compression >> 8;
var dt = new Date(f.mtime == null ? Date.now() : f.mtime), y = dt.getFullYear() - 1980;
if (y < 0 || y > 119)
err(10);
wbytes(d, b, (y << 25) | ((dt.getMonth() + 1) << 21) | (dt.getDate() << 16) | (dt.getHours() << 11) | (dt.getMinutes() << 5) | (dt.getSeconds() >>> 1)), b += 4;
if (c != -1) {
wbytes(d, b, f.crc);
wbytes(d, b + 4, c < 0 ? -c - 2 : c);
wbytes(d, b + 8, f.size);
}
wbytes(d, b + 12, fl);
wbytes(d, b + 14, exl), b += 16;
if (ce != null) {
wbytes(d, b, col);
wbytes(d, b + 6, f.attrs);
wbytes(d, b + 10, ce), b += 14;
}
d.set(fn, b);
b += fl;
if (exl) {
for (var k in ex) {
var exf = ex[k], l = exf.length;
wbytes(d, b, +k);
wbytes(d, b + 2, l);
d.set(exf, b + 4), b += 4 + l;
}
}
if (col)
d.set(co, b), b += col;
return b;
};
// write zip footer (end of central directory)
var wzf = function (o, b, c, d, e) {
wbytes(o, b, 0x6054B50); // skip disk
wbytes(o, b + 8, c);
wbytes(o, b + 10, c);
wbytes(o, b + 12, d);
wbytes(o, b + 16, e);
};
/**
* A pass-through stream to keep data uncompressed in a ZIP archive.
*/
var ZipPassThrough = /*#__PURE__*/ (function () {
/**
* Creates a pass-through stream that can be added to ZIP archives
* @param filename The filename to associate with this data stream
*/
function ZipPassThrough(filename) {
this.filename = filename;
this.c = crc();
this.size = 0;
this.compression = 0;
}
/**
* Processes a chunk and pushes to the output stream. You can override this
* method in a subclass for custom behavior, but by default this passes
* the data through. You must call this.ondata(err, chunk, final) at some
* point in this method.
* @param chunk The chunk to process
* @param final Whether this is the last chunk
*/
ZipPassThrough.prototype.process = function (chunk, final) {
this.ondata(null, chunk, final);
};
/**
* Pushes a chunk to be added. If you are subclassing this with a custom
* compression algorithm, note that you must push data from the source
* file only, pre-compression.
* @param chunk The chunk to push
* @param final Whether this is the last chunk
*/
ZipPassThrough.prototype.push = function (chunk, final) {
if (!this.ondata)
err(5);
this.c.p(chunk);
this.size += chunk.length;
if (final)
this.crc = this.c.d();
this.process(chunk, final || false);
};
return ZipPassThrough;
}());
exports.ZipPassThrough = ZipPassThrough;
// I don't extend because TypeScript extension adds 1kB of runtime bloat
/**
* Streaming DEFLATE compression for ZIP archives. Prefer using AsyncZipDeflate
* for better performance
*/
var ZipDeflate = /*#__PURE__*/ (function () {
/**
* Creates a DEFLATE stream that can be added to ZIP archives
* @param filename The filename to associate with this data stream
* @param opts The compression options
*/
function ZipDeflate(filename, opts) {
var _this_1 = this;
if (!opts)
opts = {};
ZipPassThrough.call(this, filename);
this.d = new Deflate(opts, function (dat, final) {
_this_1.ondata(null, dat, final);
});
this.compression = 8;
this.flag = dbf(opts.level);
}
ZipDeflate.prototype.process = function (chunk, final) {
try {
this.d.push(chunk, final);
}
catch (e) {
this.ondata(e, null, final);
}
};
/**
* Pushes a chunk to be deflated
* @param chunk The chunk to push
* @param final Whether this is the last chunk
*/
ZipDeflate.prototype.push = function (chunk, final) {
ZipPassThrough.prototype.push.call(this, chunk, final);
};
return ZipDeflate;
}());
exports.ZipDeflate = ZipDeflate;
/**
* Asynchronous streaming DEFLATE compression for ZIP archives
*/
var AsyncZipDeflate = /*#__PURE__*/ (function () {
/**
* Creates a DEFLATE stream that can be added to ZIP archives
* @param filename The filename to associate with this data stream
* @param opts The compression options
*/
function AsyncZipDeflate(filename, opts) {
var _this_1 = this;
if (!opts)
opts = {};
ZipPassThrough.call(this, filename);
this.d = new AsyncDeflate(opts, function (err, dat, final) {
_this_1.ondata(err, dat, final);
});
this.compression = 8;
this.flag = dbf(opts.level);
this.terminate = this.d.terminate;
}
AsyncZipDeflate.prototype.process = function (chunk, final) {
this.d.push(chunk, final);
};
/**
* Pushes a chunk to be deflated
* @param chunk The chunk to push
* @param final Whether this is the last chunk
*/
AsyncZipDeflate.prototype.push = function (chunk, final) {
ZipPassThrough.prototype.push.call(this, chunk, final);
};
return AsyncZipDeflate;
}());
exports.AsyncZipDeflate = AsyncZipDeflate;
// TODO: Better tree shaking
/**
* A zippable archive to which files can incrementally be added
*/
var Zip = /*#__PURE__*/ (function () {
/**
* Creates an empty ZIP archive to which files can be added
* @param cb The callback to call whenever data for the generated ZIP archive
* is available
*/
function Zip(cb) {
this.ondata = cb;
this.u = [];
this.d = 1;
}
/**
* Adds a file to the ZIP archive
* @param file The file stream to add
*/
Zip.prototype.add = function (file) {
var _this_1 = this;
if (!this.ondata)
err(5);
// finishing or finished
if (this.d & 2)
this.ondata(err(4 + (this.d & 1) * 8, 0, 1), null, false);
else {
var f = strToU8(file.filename), fl_1 = f.length;
var com = file.comment, o = com && strToU8(com);
var u = fl_1 != file.filename.length || (o && (com.length != o.length));
var hl_1 = fl_1 + exfl(file.extra) + 30;
if (fl_1 > 65535)
this.ondata(err(11, 0, 1), null, false);
var header = new u8(hl_1);
wzh(header, 0, file, f, u, -1);
var chks_1 = [header];
var pAll_1 = function () {
for (var _i = 0, chks_2 = chks_1; _i < chks_2.length; _i++) {
var chk = chks_2[_i];
_this_1.ondata(null, chk, false);
}
chks_1 = [];
};
var tr_1 = this.d;
this.d = 0;
var ind_1 = this.u.length;
var uf_1 = mrg(file, {
f: f,
u: u,
o: o,
t: function () {
if (file.terminate)
file.terminate();
},
r: function () {
pAll_1();
if (tr_1) {
var nxt = _this_1.u[ind_1 + 1];
if (nxt)
nxt.r();
else
_this_1.d = 1;
}
tr_1 = 1;
}
});
var cl_1 = 0;
file.ondata = function (err, dat, final) {
if (err) {
_this_1.ondata(err, dat, final);
_this_1.terminate();
}
else {
cl_1 += dat.length;
chks_1.push(dat);
if (final) {
var dd = new u8(16);
wbytes(dd, 0, 0x8074B50);
wbytes(dd, 4, file.crc);
wbytes(dd, 8, cl_1);
wbytes(dd, 12, file.size);
chks_1.push(dd);
uf_1.c = cl_1, uf_1.b = hl_1 + cl_1 + 16, uf_1.crc = file.crc, uf_1.size = file.size;
if (tr_1)
uf_1.r();
tr_1 = 1;
}
else if (tr_1)
pAll_1();
}
};
this.u.push(uf_1);
}
};
/**
* Ends the process of adding files and prepares to emit the final chunks.
* This *must* be called after adding all desired files for the resulting
* ZIP file to work properly.
*/
Zip.prototype.end = function () {
var _this_1 = this;
if (this.d & 2) {
this.ondata(err(4 + (this.d & 1) * 8, 0, 1), null, true);
return;
}
if (this.d)
this.e();
else
this.u.push({
r: function () {
if (!(_this_1.d & 1))
return;
_this_1.u.splice(-1, 1);
_this_1.e();
},
t: function () { }
});
this.d = 3;
};
Zip.prototype.e = function () {
var bt = 0, l = 0, tl = 0;
for (var _i = 0, _a = this.u; _i < _a.length; _i++) {
var f = _a[_i];
tl += 46 + f.f.length + exfl(f.extra) + (f.o ? f.o.length : 0);
}
var out = new u8(tl + 22);
for (var _b = 0, _c = this.u; _b < _c.length; _b++) {
var f = _c[_b];
wzh(out, bt, f, f.f, f.u, -f.c - 2, l, f.o);
bt += 46 + f.f.length + exfl(f.extra) + (f.o ? f.o.length : 0), l += f.b;
}
wzf(out, bt, this.u.length, tl, l);
this.ondata(null, out, true);
this.d = 2;
};
/**
* A method to terminate any internal workers used by the stream. Subsequent
* calls to add() will fail.
*/
Zip.prototype.terminate = function () {
for (var _i = 0, _a = this.u; _i < _a.length; _i++) {
var f = _a[_i];
f.t();
}
this.d = 2;
};
return Zip;
}());
exports.Zip = Zip;
function zip(data, opts, cb) {
if (!cb)
cb = opts, opts = {};
if (typeof cb != 'function')
err(7);
var r = {};
fltn(data, '', r, opts);
var k = Object.keys(r);
var lft = k.length, o = 0, tot = 0;
var slft = lft, files = new Array(lft);
var term = [];
var tAll = function () {
for (var i = 0; i < term.length; ++i)
term[i]();
};
var cbd = function (a, b) {
mt(function () { cb(a, b); });
};
mt(function () { cbd = cb; });
var cbf = function () {
var out = new u8(tot + 22), oe = o, cdl = tot - o;
tot = 0;
for (var i = 0; i < slft; ++i) {
var f = files[i];
try {
var l = f.c.length;
wzh(out, tot, f, f.f, f.u, l);
var badd = 30 + f.f.length + exfl(f.extra);
var loc = tot + badd;
out.set(f.c, loc);
wzh(out, o, f, f.f, f.u, l, tot, f.m), o += 16 + badd + (f.m ? f.m.length : 0), tot = loc + l;
}
catch (e) {
return cbd(e, null);
}
}
wzf(out, o, files.length, cdl, oe);
cbd(null, out);
};
if (!lft)
cbf();
var _loop_1 = function (i) {
var fn = k[i];
var _a = r[fn], file = _a[0], p = _a[1];
var c = crc(), size = file.length;
c.p(file);
var f = strToU8(fn), s = f.length;
var com = p.comment, m = com && strToU8(com), ms = m && m.length;
var exl = exfl(p.extra);
var compression = p.level == 0 ? 0 : 8;
var cbl = function (e, d) {
if (e) {
tAll();
cbd(e, null);
}
else {
var l = d.length;
files[i] = mrg(p, {
size: size,
crc: c.d(),
c: d,
f: f,
m: m,
u: s != fn.length || (m && (com.length != ms)),
compression: compression
});
o += 30 + s + exl + l;
tot += 76 + 2 * (s + exl) + (ms || 0) + l;
if (!--lft)
cbf();
}
};
if (s > 65535)
cbl(err(11, 0, 1), null);
if (!compression)
cbl(null, file);
else if (size < 160000) {
try {
cbl(null, deflateSync(file, p));
}
catch (e) {
cbl(e, null);
}
}
else
term.push(deflate(file, p, cbl));
};
// Cannot use lft because it can decrease
for (var i = 0; i < slft; ++i) {
_loop_1(i);
}
return tAll;
}
exports.zip = zip;
/**
* Synchronously creates a ZIP file. Prefer using `zip` for better performance
* with more than one file.
* @param data The directory structure for the ZIP archive
* @param opts The main options, merged with per-file options
* @returns The generated ZIP archive
*/
function zipSync(data, opts) {
if (!opts)
opts = {};
var r = {};
var files = [];
fltn(data, '', r, opts);
var o = 0;
var tot = 0;
for (var fn in r) {
var _a = r[fn], file = _a[0], p = _a[1];
var compression = p.level == 0 ? 0 : 8;
var f = strToU8(fn), s = f.length;
var com = p.comment, m = com && strToU8(com), ms = m && m.length;
var exl = exfl(p.extra);
if (s > 65535)
err(11);
var d = compression ? deflateSync(file, p) : file, l = d.length;
var c = crc();
c.p(file);
files.push(mrg(p, {
size: file.length,
crc: c.d(),
c: d,
f: f,
m: m,
u: s != fn.length || (m && (com.length != ms)),
o: o,
compression: compression
}));
o += 30 + s + exl + l;
tot += 76 + 2 * (s + exl) + (ms || 0) + l;
}
var out = new u8(tot + 22), oe = o, cdl = tot - o;
for (var i = 0; i < files.length; ++i) {
var f = files[i];
wzh(out, f.o, f, f.f, f.u, f.c.length);
var badd = 30 + f.f.length + exfl(f.extra);
out.set(f.c, f.o + badd);
wzh(out, o, f, f.f, f.u, f.c.length, f.o, f.m), o += 16 + badd + (f.m ? f.m.length : 0);
}
wzf(out, o, files.length, cdl, oe);
return out;
}
exports.zipSync = zipSync;
/**
* Streaming pass-through decompression for ZIP archives
*/
var UnzipPassThrough = /*#__PURE__*/ (function () {
function UnzipPassThrough() {
}
UnzipPassThrough.prototype.push = function (data, final) {
this.ondata(null, data, final);
};
UnzipPassThrough.compression = 0;
return UnzipPassThrough;
}());
exports.UnzipPassThrough = UnzipPassThrough;
/**
* Streaming DEFLATE decompression for ZIP archives. Prefer AsyncZipInflate for
* better performance.
*/
var UnzipInflate = /*#__PURE__*/ (function () {
/**
* Creates a DEFLATE decompression that can be used in ZIP archives
*/
function UnzipInflate() {
var _this_1 = this;
this.i = new Inflate(function (dat, final) {
_this_1.ondata(null, dat, final);
});
}
UnzipInflate.prototype.push = function (data, final) {
try {
this.i.push(data, final);
}
catch (e) {
this.ondata(e, null, final);
}
};
UnzipInflate.compression = 8;
return UnzipInflate;
}());
exports.UnzipInflate = UnzipInflate;
/**
* Asynchronous streaming DEFLATE decompression for ZIP archives
*/
var AsyncUnzipInflate = /*#__PURE__*/ (function () {
/**
* Creates a DEFLATE decompression that can be used in ZIP archives
*/
function AsyncUnzipInflate(_, sz) {
var _this_1 = this;
if (sz < 320000) {
this.i = new Inflate(function (dat, final) {
_this_1.ondata(null, dat, final);
});
}
else {
this.i = new AsyncInflate(function (err, dat, final) {
_this_1.ondata(err, dat, final);
});
this.terminate = this.i.terminate;
}
}
AsyncUnzipInflate.prototype.push = function (data, final) {
if (this.i.terminate)
data = slc(data, 0);
this.i.push(data, final);
};
AsyncUnzipInflate.compression = 8;
return AsyncUnzipInflate;
}());
exports.AsyncUnzipInflate = AsyncUnzipInflate;
/**
* A ZIP archive decompression stream that emits files as they are discovered
*/
var Unzip = /*#__PURE__*/ (function () {
/**
* Creates a ZIP decompression stream
* @param cb The callback to call whenever a file in the ZIP archive is found
*/
function Unzip(cb) {
this.onfile = cb;
this.k = [];
this.o = {
0: UnzipPassThrough
};
this.p = et;
}
/**
* Pushes a chunk to be unzipped
* @param chunk The chunk to push
* @param final Whether this is the last chunk
*/
Unzip.prototype.push = function (chunk, final) {
var _this_1 = this;
if (!this.onfile)
err(5);
if (!this.p)
err(4);
if (this.c > 0) {
var len = Math.min(this.c, chunk.length);
var toAdd = chunk.subarray(0, len);
this.c -= len;
if (this.d)
this.d.push(toAdd, !this.c);
else
this.k[0].push(toAdd);
chunk = chunk.subarray(len);
if (chunk.length)
return this.push(chunk, final);
}
else {
var f = 0, i = 0, is = void 0, buf = void 0;
if (!this.p.length)
buf = chunk;
else if (!chunk.length)
buf = this.p;
else {
buf = new u8(this.p.length + chunk.length);
buf.set(this.p), buf.set(chunk, this.p.length);
}
var l = buf.length, oc = this.c, add = oc && this.d;
var _loop_2 = function () {
var _a;
var sig = b4(buf, i);
if (sig == 0x4034B50) {
f = 1, is = i;
this_1.d = null;
this_1.c = 0;
var bf = b2(buf, i + 6), cmp_1 = b2(buf, i + 8), u = bf & 2048, dd = bf & 8, fnl = b2(buf, i + 26), es = b2(buf, i + 28);
if (l > i + 30 + fnl + es) {
var chks_3 = [];
this_1.k.unshift(chks_3);
f = 2;
var sc_1 = b4(buf, i + 18), su_1 = b4(buf, i + 22);
var fn_1 = strFromU8(buf.subarray(i + 30, i += 30 + fnl), !u);
if (sc_1 == 4294967295) {
_a = dd ? [-2] : z64e(buf, i), sc_1 = _a[0], su_1 = _a[1];
}
else if (dd)
sc_1 = -1;
i += es;
this_1.c = sc_1;
var d_1;
var file_1 = {
name: fn_1,
compression: cmp_1,
start: function () {
if (!file_1.ondata)
err(5);
if (!sc_1)
file_1.ondata(null, et, true);
else {
var ctr = _this_1.o[cmp_1];
if (!ctr)
file_1.ondata(err(14, 'unknown compression type ' + cmp_1, 1), null, false);
d_1 = sc_1 < 0 ? new ctr(fn_1) : new ctr(fn_1, sc_1, su_1);
d_1.ondata = function (err, dat, final) { file_1.ondata(err, dat, final); };
for (var _i = 0, chks_4 = chks_3; _i < chks_4.length; _i++) {
var dat = chks_4[_i];
d_1.push(dat, false);
}
if (_this_1.k[0] == chks_3 && _this_1.c)
_this_1.d = d_1;
else
d_1.push(et, true);
}
},
terminate: function () {
if (d_1 && d_1.terminate)
d_1.terminate();
}
};
if (sc_1 >= 0)
file_1.size = sc_1, file_1.originalSize = su_1;
this_1.onfile(file_1);
}
return "break";
}
else if (oc) {
if (sig == 0x8074B50) {
is = i += 12 + (oc == -2 && 8), f = 3, this_1.c = 0;
return "break";
}
else if (sig == 0x2014B50) {
is = i -= 4, f = 3, this_1.c = 0;
return "break";
}
}
};
var this_1 = this;
for (; i < l - 4; ++i) {
var state_1 = _loop_2();
if (state_1 === "break")
break;
}
this.p = et;
if (oc < 0) {
var dat = f ? buf.subarray(0, is - 12 - (oc == -2 && 8) - (b4(buf, is - 16) == 0x8074B50 && 4)) : buf.subarray(0, i);
if (add)
add.push(dat, !!f);
else
this.k[+(f == 2)].push(dat);
}
if (f & 2)
return this.push(buf.subarray(i), final);
this.p = buf.subarray(i);
}
if (final) {
if (this.c)
err(13);
this.p = null;
}
};
/**
* Registers a decoder with the stream, allowing for files compressed with
* the compression type provided to be expanded correctly
* @param decoder The decoder constructor
*/
Unzip.prototype.register = function (decoder) {
this.o[decoder.compression] = decoder;
};
return Unzip;
}());
exports.Unzip = Unzip;
var mt = typeof queueMicrotask == 'function' ? queueMicrotask : typeof setTimeout == 'function' ? setTimeout : function (fn) { fn(); };
function unzip(data, opts, cb) {
if (!cb)
cb = opts, opts = {};
if (typeof cb != 'function')
err(7);
var term = [];
var tAll = function () {
for (var i = 0; i < term.length; ++i)
term[i]();
};
var files = {};
var cbd = function (a, b) {
mt(function () { cb(a, b); });
};
mt(function () { cbd = cb; });
var e = data.length - 22;
for (; b4(data, e) != 0x6054B50; --e) {
if (!e || data.length - e > 65558) {
cbd(err(13, 0, 1), null);
return tAll;
}
}
;
var lft = b2(data, e + 8);
if (lft) {
var c = lft;
var o = b4(data, e + 16);
var z = o == 4294967295 || c == 65535;
if (z) {
var ze = b4(data, e - 12);
z = b4(data, ze) == 0x6064B50;
if (z) {
c = lft = b4(data, ze + 32);
o = b4(data, ze + 48);
}
}
var fltr = opts && opts.filter;
var _loop_3 = function (i) {
var _a = zh(data, o, z), c_1 = _a[0], sc = _a[1], su = _a[2], fn = _a[3], no = _a[4], off = _a[5], b = slzh(data, off);
o = no;
var cbl = function (e, d) {
if (e) {
tAll();
cbd(e, null);
}
else {
if (d)
files[fn] = d;
if (!--lft)
cbd(null, files);
}
};
if (!fltr || fltr({
name: fn,
size: sc,
originalSize: su,
compression: c_1
})) {
if (!c_1)
cbl(null, slc(data, b, b + sc));
else if (c_1 == 8) {
var infl = data.subarray(b, b + sc);
if (sc < 320000) {
try {
cbl(null, inflateSync(infl, new u8(su)));
}
catch (e) {
cbl(e, null);
}
}
else
term.push(inflate(infl, { size: su }, cbl));
}
else
cbl(err(14, 'unknown compression type ' + c_1, 1), null);
}
else
cbl(null, null);
};
for (var i = 0; i < c; ++i) {
_loop_3(i);
}
}
else
cbd(null, {});
return tAll;
}
exports.unzip = unzip;
/**
* Synchronously decompresses a ZIP archive. Prefer using `unzip` for better
* performance with more than one file.
* @param data The raw compressed ZIP file
* @param opts The ZIP extraction options
* @returns The decompressed files
*/
function unzipSync(data, opts) {
var files = {};
var e = data.length - 22;
for (; b4(data, e) != 0x6054B50; --e) {
if (!e || data.length - e > 65558)
err(13);
}
;
var c = b2(data, e + 8);
if (!c)
return {};
var o = b4(data, e + 16);
var z = o == 4294967295 || c == 65535;
if (z) {
var ze = b4(data, e - 12);
z = b4(data, ze) == 0x6064B50;
if (z) {
c = b4(data, ze + 32);
o = b4(data, ze + 48);
}
}
var fltr = opts && opts.filter;
for (var i = 0; i < c; ++i) {
var _a = zh(data, o, z), c_2 = _a[0], sc = _a[1], su = _a[2], fn = _a[3], no = _a[4], off = _a[5], b = slzh(data, off);
o = no;
if (!fltr || fltr({
name: fn,
size: sc,
originalSize: su,
compression: c_2
})) {
if (!c_2)
files[fn] = slc(data, b, b + sc);
else if (c_2 == 8)
files[fn] = inflateSync(data.subarray(b, b + sc), new u8(su));
else
err(14, 'unknown compression type ' + c_2);
}
}
return files;
}
exports.unzipSync = unzipSync;
});
;/*!node_modules/office-viewer/lib/package/ZipPackageParser.js*/
amis.define("b989834",(function(t,e,r,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=t("node_modules/fflate/lib/index.cjs"),o=function(){function t(){}return t.prototype.load=function(t){this.zip=i.unzipSync(new Uint8Array(t))},t.prototype.getXML=function(t){var e=this.getFileByType(t,"string"),r=(new DOMParser).parseFromString(e,"application/xml"),n=r.getElementsByTagName("parsererror").item(0);if(n)throw new Error(n.textContent||"can't parse xml");return r},t.prototype.getFileByType=function(t,e){t=t.startsWith("/")?t.slice(1):t;var r=this.zip[t];if(r){if("string"===e)return i.strFromU8(r);if("blob"===e)return new Blob([r]);if("uint8array"===e)return r}return console.warn("getFileByType",t,"not found"),null},t.prototype.saveFile=function(t,e){"string"==typeof e&&(e=i.strToU8(e)),this.zip[t]=e},t.prototype.fileExists=function(t){return(t=t.startsWith("/")?t.slice(1):t)in this.zip},t.prototype.generateZip=function(t){return this.zip["word/document.xml"]=i.strToU8(t),new Blob([i.zipSync(this.zip)])},t}();e.default=o}));
;/*!node_modules/office-viewer/lib/render/renderFont.js*/
amis.define("fff065a",(function(e,n,r,t){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var a=e("9a586ef"),f=e("872e6b7");n.renderFont=function(e){var n,r;if(!e)return null;var t=e.fonts;if(!t||!t.length)return null;var l=f.createElement("style"),o="/** embedded fonts **/";try{for(var c=a.__values(e.fonts),u=c.next();!u.done;u=c.next()){var i=u.value,s=i.name.replace(/['\\]/g,""),d=i.url;s&&d&&(o+="\n @font-face {\n font-family: '".concat(s,"';\n src: url('").concat(d,"');\n }\n "))}}catch(e){n={error:e}}finally{try{u&&!u.done&&(r=c.return)&&r.call(c)}finally{if(n)throw n.error}}return l.innerHTML=o,l}}));
;/*!node_modules/office-viewer/lib/util/createObject.js*/
amis.define("7d47830",(function(e,r,t,n){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var c=e("9a586ef");function a(e,r){void 0===r&&(r=!0);var t=e&&e.__super?Object.create(e.__super,{__super:{value:e.__super,writable:!1,enumerable:!1}}):Object.create(Object.prototype);return r&&e&&Object.keys(e).forEach((function(r){return t[r]=e[r]})),t}function u(e){var r=typeof e;return e&&"string"!==r&&"number"!==r&&"boolean"!==r&&"function"!==r&&!Array.isArray(e)}r.cloneObject=a,r.createObject=function(e,r,t){e&&Object.isFrozen(e)&&(e=a(e));var n=e?Object.create(e,c.__assign(c.__assign({},t),{__super:{value:e,writable:!1,enumerable:!1}})):Object.create(Object.prototype,t);return r&&u(r)&&Object.keys(r).forEach((function(e){return n[e]=r[e]})),n},r.isObject=u}));
;/*!node_modules/office-viewer/lib/util/replaceVar.js*/
amis.define("c918404",(function(e,r,t,n){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var a=e("9a586ef"),l=e("1efdfad"),o=e("7d47830");function i(e,r,t){var n=r.textContent||"";r.textContent=c(e,n,t)}function c(e,r,t){var n=e.renderOptions.evalVar;if(r.startsWith("{{")){var a=n(r=r.replace(/^{{/g,"").replace(/}}$/g,""),t);return null!=a?String(a):(console.warn("var error: [",r,"] not found in data"),"")}return r}var s=1;function u(e,r,t,n){return void 0===n&&(n=!1),a.__awaiter(this,void 0,void 0,(function(){var o,i,u,d,f,v,y;return a.__generator(this,(function(a){switch(a.label){case 0:return r.getAttribute("downloaded")?[2]:(o=r.getAttribute("descr")||"",i=c(e,o,t),r.setAttribute("descrVar",i),n&&i?(u=r.parentElement.parentElement,(d=u.getElementsByTagName("a:blip").item(0))?(f="rIdn".concat(s),d.setAttribute("r:embed",f),[4,fetch(i)]):[3,3]):[3,4]);case 1:return[4,a.sent().arrayBuffer()];case 2:v=a.sent(),e.saveNewImage(f,new Uint8Array(v)),r.setAttribute("downloaded","true"),s++,a.label=3;case 3:(y=l.Pic.fromXML(e,u))&&y.blipFill&&y.blipFill.blip&&y.blipFill.blip.embled,a.label=4;case 4:return[2]}}))}))}function d(e,r,t){return void 0===t&&(t=!1),a.__awaiter(this,void 0,void 0,(function(){var n,l,c,s,d,v,y,h,_,b,g,m,w,p,x,N,E,B,T,A,C,O,P,V,F,j,I,M,S,W,L,U,X,$,k,q,z,D,G;return a.__generator(this,(function(H){switch(H.label){case 0:n=e.renderOptions.evalVar,l=e.renderOptions.data,c=r.parentNode,s=r.getElementsByTagName("w:tc"),d=!1,v=[];try{for(y=a.__values(s),h=y.next();!h.done;h=y.next()){_=h.value,A=_.getElementsByTagName("w:t");try{for(U=void 0,b=a.__values(A),g=b.next();!g.done;g=b.next())V=g.value,(m=V.textContent||"").startsWith("{{#")&&(w=/{{#([^\}]+)}}/.exec(m))&&w.length>0&&(d=!0,p=w[1],x=n(p,l),Array.isArray(x)&&(v=x),V.textContent=V.textContent.replace("{{#".concat(p,"}}"),"")),-1!==m.indexOf("{{/}}")&&(V.textContent=V.textContent.replace("{{/}}",""))}catch(e){U={error:e}}finally{try{g&&!g.done&&(X=b.return)&&X.call(b)}finally{if(U)throw U.error}}}}catch(e){W={error:e}}finally{try{h&&!h.done&&(L=y.return)&&L.call(y)}finally{if(W)throw W.error}}if(!d)return[3,16];H.label=1;case 1:H.trys.push([1,13,14,15]),N=a.__values(v),E=N.next(),H.label=2;case 2:if(E.done)return[3,12];B=E.value,T=function(e){var r,t,n,l,o,i=e.cloneNode(!0);f(i);var c=[].slice.call(i.getElementsByTagName("w:p"));try{for(var s=a.__values(c),u=s.next();!u.done;u=s.next()){f(u.value)}}catch(e){r={error:e}}finally{try{u&&!u.done&&(t=s.return)&&t.call(s)}finally{if(r)throw r.error}}var d=[].slice.call(i.getElementsByTagName("w:cnfStyle"));try{for(var v=a.__values(d),y=v.next();!y.done;y=v.next()){var h=y.value;null===(o=h.parentElement)||void 0===o||o.removeChild(h)}}catch(e){n={error:e}}finally{try{y&&!y.done&&(l=v.return)&&l.call(v)}finally{if(n)throw n.error}}return i}(r),A=T.getElementsByTagName("w:t"),C=o.createObject(l,B);try{for(q=void 0,O=a.__values(A),P=O.next();!P.done;P=O.next())V=P.value,i(e,V,C)}catch(e){q={error:e}}finally{try{P&&!P.done&&(z=O.return)&&z.call(O)}finally{if(q)throw q.error}}H.label=3;case 3:H.trys.push([3,8,9,10]),D=void 0,F=a.__values(T.getElementsByTagName("pic:cNvPr")),j=F.next(),H.label=4;case 4:return j.done?[3,7]:(I=j.value,[4,u(e,I,C,t)]);case 5:H.sent(),H.label=6;case 6:return j=F.next(),[3,4];case 7:return[3,10];case 8:return M=H.sent(),D={error:M},[3,10];case 9:try{j&&!j.done&&(G=F.return)&&G.call(F)}finally{if(D)throw D.error}return[7];case 10:c.insertBefore(T,r),H.label=11;case 11:return E=N.next(),[3,2];case 12:return[3,15];case 13:return S=H.sent(),$={error:S},[3,15];case 14:try{E&&!E.done&&(k=N.return)&&k.call(N)}finally{if($)throw $.error}return[7];case 15:c.removeChild(r),H.label=16;case 16:return[2]}}))}))}function f(e){for(;e.attributes.length>0;)e.removeAttributeNode(e.attributes[0])}function v(e,r,t){return void 0===t&&(t=!1),a.__awaiter(this,void 0,void 0,(function(){var n,l,o,i,c,s,u;return a.__generator(this,(function(f){switch(f.label){case 0:n=[].slice.call(r.getElementsByTagName("w:tr")),f.label=1;case 1:f.trys.push([1,6,7,8]),l=a.__values(n),o=l.next(),f.label=2;case 2:r
;/*!node_modules/office-viewer/lib/openxml/word/Note.js*/
amis.define("2e5a29b",(function(e,r,a,n){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var t=e("9a586ef"),o=e("b7e52c8"),i=e("d78ccf3"),c=function(){function e(){this.children=[]}return e.prototype.addChild=function(e){this.children.push(e)},e.fromXML=function(r,a){var n,c,l=new e;try{for(var d=t.__values(a.children),f=d.next();!f.done;f=d.next()){var u=f.value,h=u.tagName;switch(h){case"w:p":var s=i.Paragraph.fromXML(r,u);l.addChild(s);break;case"w:tbl":var v=o.parseTable(r,u);l.addChild(v);break;default:console.warn("Note.fromXML unknown tag",h,u)}}}catch(e){n={error:e}}finally{try{f&&!f.done&&(c=d.return)&&c.call(d)}finally{if(n)throw n.error}}return l},e}();r.Note=c}));
;/*!node_modules/office-viewer/lib/parse/Footnotes.js*/
amis.define("81ac1b4",(function(e,t,r,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=e("9a586ef"),n=e("2e5a29b");t.parseFootnotes=function(e,t){var r,a,l={},i=[].slice.call(t.getElementsByTagName("w:footnote"));try{for(var f=o.__values(i),c=f.next();!c.done;c=f.next()){var u=c.value,s=n.Note.fromXML(e,u);l[u.getAttribute("w:id")]=s}}catch(e){r={error:e}}finally{try{c&&!c.done&&(a=f.return)&&a.call(f)}finally{if(r)throw r.error}}return l}}));
;/*!node_modules/office-viewer/lib/parse/parseEndnotes.js*/
amis.define("1ed385c",(function(e,r,t,n){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var a=e("9a586ef"),l=e("2e5a29b");r.parseEndnotes=function(e,r){var t,n,o={},i=[].slice.call(r.getElementsByTagName("w:endnote"));try{for(var c=a.__values(i),f=c.next();!f.done;f=c.next()){var u=f.value,d=l.Note.fromXML(e,u);o[u.getAttribute("w:id")]=d}}catch(e){t={error:e}}finally{try{f&&!f.done&&(n=c.return)&&n.call(c)}finally{if(t)throw t.error}}return o}}));
;/*!node_modules/office-viewer/lib/render/renderNotes.js*/
amis.define("10c0fad",(function(e,n,r,t){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var a=e("9a586ef"),o=e("d78ccf3"),f=e("1c1a6b2"),i=e("872e6b7"),d=e("88daac0"),l=e("03b19df");function c(e,n,r,t,c){var u,s,v=c.children,h=i.createElement("div"),p=i.createElement("a"),N=r+"-"+t;p.name=N,p.id=N,n.appendChild(h);try{for(var b=a.__values(v),m=b.next();!m.done;m=b.next()){var y=m.value;if(y instanceof o.Paragraph){var _=d.default(e,y);i.appendChild(h,_)}else y instanceof f.Table?i.appendChild(h,l.default(e,y)):console.warn("unknown child",y)}}catch(e){u={error:e}}finally{try{m&&!m.done&&(s=b.return)&&s.call(b)}finally{if(u)throw u.error}}}function u(e){if(!e)return!1;for(var n in e)if("0"!==n&&"-1"!==n)return!0;return!1}n.renderNotes=function(e){var n=i.createElement("div");if(u(e.footNotes))for(var r in e.footNotes)c(e,n,"footnote",r,e.footNotes[r]);if(u(e.endNotes))for(var r in e.endNotes||{})c(e,n,"endnote",r,e.endNotes[r]);return n.children.length?n:null}}));
;/*!node_modules/office-viewer/lib/util/print.js*/
amis.define("ca20bce",(function(n,e,t,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n("9a586ef");function o(n){return new Promise((function(e){var t=function(){n&&void 0!==n.naturalWidth&&0!==n.naturalWidth&&n.complete?e():setTimeout(t,500)};t()}))}function a(n){var e,t;null===(e=n.contentWindow)||void 0===e||e.print(),null===(t=n.parentNode)||void 0===t||t.removeChild(n)}e.printIframe=function(n){var e=n.contentDocument.getElementsByTagName("img");e.length>0?function(n){var e=this,t=n.map((function(n){return i.__awaiter(e,void 0,void 0,(function(){return i.__generator(this,(function(e){switch(e.label){case 0:return n.src&&n.src!==window.location.href?[4,o(n)]:[3,2];case 1:e.sent(),e.label=2;case 2:return[2]}}))}))}));return Promise.all(t)}(Array.from(e)).then((function(){return a(n)})):a(n)}}));
;/*!node_modules/office-viewer/lib/openxml/Settings.js*/
amis.define("c71a8fb",(function(e,t,r,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=e("9a586ef"),l=e("5ab481b");function i(e){var t,r,a={};try{for(var l=n.__values(e.attributes),i=l.next();!i.done;i=l.next()){var o=i.value,c=o.name.replace("w:",""),u=o.value;"light1"===u?u="lt1":"light2"===u?u="lt2":"dark1"===u?u="dk1":"dark2"===u&&(u="dk2"),a[c]=u}}catch(e){t={error:e}}finally{try{i&&!i.done&&(r=l.return)&&r.call(l)}finally{if(t)throw t.error}}return a.bg1||(a.bg1="lt1"),a.bg2||(a.bg2="lt2"),a.tx1||(a.tx1="dk1"),a}var o=function(){function e(){this.clrSchemeMapping={},this.autoHyphenation=!1}return e.parse=function(t,r){var a,o,c=new e,u=r;r.firstElementChild&&"w:settings"===r.firstElementChild.tagName&&(u=r.getElementsByTagName("w:settings").item(0));try{for(var s=n.__values(Array.from(u.children)),f=s.next();!f.done;f=s.next()){var h=f.value;switch(h.tagName){case"w:clrSchemeMapping":c.clrSchemeMapping=i(h);break;case"w:autoHyphenation":c.autoHyphenation=l.getValBoolean(h,!1)}}}catch(e){a={error:e}}finally{try{f&&!f.done&&(o=s.return)&&o.call(s)}finally{if(a)throw a.error}}return c},e}();t.Settings=o}));
;/*!node_modules/office-viewer/lib/util/get.js*/
amis.define("6a44a29",(function(e,t,n,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.get=function(e,t,n){void 0===n&&(n=void 0);var i=function(n){return String.prototype.split.call(t,n).filter(Boolean).reduce((function(e,t){return null!=e?e[t]:e}),e)},r=i(/[,[\]]+?/)||i(/[,[\].]+?/);return void 0===r||r===e?n:r}}));
;/*!node_modules/office-viewer/lib/util/fileType.js*/
amis.define("106ea56",(function(e,r,i,t){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=e("9a586ef");function a(e,r,i){var t,a;void 0===i&&(i={});var m=i.offset||0;try{for(var f=n.__values(r.entries()),o=f.next();!o.done;o=f.next()){var p=n.__read(o.value,2),u=p[0],d=p[1];if(i.mask){if(d!==(i.mask[u]&e[u+m]))return!1}else if(d!==e[u+m])return!1}}catch(e){t={error:e}}finally{try{o&&!o.done&&(a=f.return)&&a.call(f)}finally{if(t)throw t.error}}return!0}function m(e,r,i){return void 0===i&&(i={}),a(e,function(e){return n.__spreadArray([],n.__read(e),!1).map((function(e){return e.charCodeAt(0)}))}(r),i)}r.fileTypeFromBuffer=function(e){return a(e,[137,80,78,71,13,10,26,10])?{ext:"png",mime:"image/png"}:a(e,[255,216,255])?{ext:"jpg",mime:"image/jpeg"}:a(e,[71,73,70])?{ext:"gif",mime:"image/gif"}:a(e,[66,77])?{ext:"bmp",mime:"image/bmp"}:a(e,[197,208,211,198])?{ext:"eps",mime:"application/eps"}:m(e,"8BPS")?{ext:"psd",mime:"image/vnd.adobe.photoshop"}:m(e,"%PDF")?{ext:"pdf",mime:"application/pdf"}:null}}));
;/*!node_modules/office-viewer/lib/Word.js*/
amis.define("da80d42",(function(t,e,r,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=t("9a586ef"),s=t("16ce42c"),a=t("e02e5f6"),o=t("38ffbcd"),l=t("470735b"),p=t("2dd0f99"),h=t("f98d8af"),d=t("0b37635"),c=t("0865880"),u=t("872e6b7"),f=t("8ba8024"),g=t("8b82678"),m=t("df4980a"),y=t("08b74c1"),v=t("b989834"),b=t("da2035f"),w=t("5b576eb"),T=t("fff065a"),_=t("c918404"),x=t("81ac1b4"),N=t("1ed385c"),M=t("10c0fad"),L=t("ca20bce"),C=t("c71a8fb"),E=t("6a44a29"),R=t("106ea56"),S={classPrefix:"docx-viewer",page:!1,pageWrap:!0,bulletUseFont:!0,ignoreHeight:!0,ignoreWidth:!1,minLineHeight:1,enableVar:!1,debug:!1,pageWrapPadding:20,pageMarginBottom:20,pageShadow:!0,pageBackground:"#FFFFFF",pageWrapBackground:"#ECECEC",printWaitTime:100,zoomFitWidth:!1,renderHeader:!0,renderFooter:!0,data:{},evalVar:function(t,e){return E.get(e,t)}},O=function(){function t(e,r,i){void 0===i&&(i=new v.default),this.themes=[],this.styleIdMap={},this.styleIdNum=0,this.wrapClassName="docx-viewer-wrapper",this.footNotes={},this.endNotes={},this.inited=!1,this.breakPage=!1,this.DOCUMENT_RELS="/word/_rels/document.xml.rels",i.load(e),this.id=t.globalId++,this.parser=i,this.renderOptions=n.__assign(n.__assign({},S),r),this.renderOptions.page&&(this.renderOptions.ignoreHeight=!1,this.renderOptions.ignoreWidth=!1)}return t.prototype.init=function(){this.inited||(this.initContentType(),this.initRelation(),this.initSettings(),this.initTheme(),this.initFontTable(),this.initStyle(),this.initNumbering(),this.initNotes(),this.inited=!0)},t.prototype.initTheme=function(){var t,e;try{for(var r=n.__values(this.conentTypes.overrides),i=r.next();!i.done;i=r.next()){var s=i.value;if(s.partName.startsWith("/word/theme")){var a=this.parser.getXML(s.partName);this.themes.push(p.parseTheme(a))}}}catch(e){t={error:e}}finally{try{i&&!i.done&&(e=r.return)&&e.call(r)}finally{if(t)throw t.error}}},t.prototype.initStyle=function(){var t,e;try{for(var r=n.__values(this.conentTypes.overrides),i=r.next();!i.done;i=r.next()){i.value.partName.startsWith("/word/styles.xml")&&(this.styles=l.parseStyles(this,this.parser.getXML("/word/styles.xml")))}}catch(e){t={error:e}}finally{try{i&&!i.done&&(e=r.return)&&e.call(r)}finally{if(t)throw t.error}}},t.prototype.initSettings=function(){var t,e;try{for(var r=n.__values(this.conentTypes.overrides),i=r.next();!i.done;i=r.next()){i.value.partName.startsWith("/word/settings.xml")&&(this.settings=C.Settings.parse(this,this.parser.getXML("/word/settings.xml")))}}catch(e){t={error:e}}finally{try{i&&!i.done&&(e=r.return)&&e.call(r)}finally{if(t)throw t.error}}},t.prototype.initFontTable=function(){var t,e;try{for(var r=n.__values(this.conentTypes.overrides),i=r.next();!i.done;i=r.next()){i.value.partName.startsWith("/word/fontTable.xml")&&(this.fontTable=s.FontTable.fromXML(this,this.parser.getXML("/word/fontTable.xml")))}}catch(e){t={error:e}}finally{try{i&&!i.done&&(e=r.return)&&e.call(r)}finally{if(t)throw t.error}}},t.prototype.initRelation=function(){var t={};this.parser.fileExists("/_rels/.rels")&&(t=a.parseRelationships(this.parser.getXML("/_rels/.rels"),"root")),this.relationships=t;var e={};this.parser.fileExists(this.DOCUMENT_RELS)&&(e=a.parseRelationships(this.parser.getXML(this.DOCUMENT_RELS),"word")),this.documentRels=e;var r={};this.parser.fileExists("/word/_rels/fontTable.xml.rels")&&(r=a.parseRelationships(this.parser.getXML("/word/_rels/fontTable.xml.rels"),"word")),this.fontTableRels=r},t.prototype.initContentType=function(){var t=this.parser.getXML("[Content_Types].xml");this.conentTypes=o.parseContentType(t)},t.prototype.initNumbering=function(){var t,e;try{for(var r=n.__values(this.conentTypes.overrides),i=r.next();!i.done;i=r.next()){var s=i.value;if(s.partName.startsWith("/word/numbering")){var a=this.parser.getXML(s.partName);this.numbering=c.Numbering.fromXML(this,a)}}}catch(e){t={error:e}}finally{try{i&&!i.done&&(e=r.return)&&e.call(r)}finally{if(t)throw t.error}}},t.prototype.initNotes=function(){var t,e;try{for(var r=n.__values(this.conentTypes.overrides),i=r.next();!i.done;i=r.next()){var s=i.value;i
;/*!node_modules/office-viewer/lib/index.js*/
amis.define("856b7e2",(function(e,d,t,a){"use strict";Object.defineProperty(d,"__esModule",{value:!0});var u=e("da80d42"),f={Word:u.default};d.Word=u.default,d.default=f}));