dwt
Version:
Dynamic Web TWAIN is a TWAIN/ICA/SANE-based scanning SDK software specifically designed for web applications running on Windows/macOS/Linux. With just a few lines of code, you can develop robust applications to scan documents from TWAIN/ICA/SANE-compatibl
11 lines • 141 kB
JavaScript
// @20191224 104520
/*
* Dynamsoft JavaScript Library
* Product: Dynamsoft Upload
* Web Site: http://www.dynamsoft.com
*
* Copyright 2020, Dynamsoft Corporation
* Author: Dynamsoft Support Team
* Version: 1.4.0.0107
*/
var dynamsoft=window.dynamsoft||{};(function(d){var b=d.uploadEnv||(d.uploadEnv={});b.initQueue=[];b.inited=!1;d.initOrder=d.initOrder||[]})(dynamsoft);var dynamsoft=dynamsoft||{};(function(e,b,a){var c=20190506;if(b._preDefine_ver){if(b._preDefine_ver>=c){return}}b._preDefine_ver=c;var d=function(g,j){for(var h in j){if(j.hasOwnProperty(h)){g[h]=j[h]}}return g},f=function(j){if(null==j||"object"!=typeof j){return j}var k,h,g;if(j instanceof Date){k=new Date();k.setTime(j.getTime());return k}else{if(j instanceof Array){k=[];g=j.length;for(h=0;h<g;h++){k[h]=f(j[h])}return k}else{if(j instanceof Object){k={};for(h in j){if(j.hasOwnProperty(h)){k[h]=f(j[h])}}return k}else{return 0}}}};if(!b.lib){b.lib={}}d(b.lib,{win:e,doc:e.document,debug:!1,nil:a,mix:d,clone:f,keys:Object.keys,guid:function(l){var k=[],g="0123456789abcdef",j,h;for(j=0;j<8;j++){k.push(g.substr(Math.floor(Math.random()*16),1))}k.push("-");for(j=0;j<4;j++){k.push(g.substr(Math.floor(Math.random()*16),1))}k.push("-4");for(j=0;j<3;j++){k.push(g.substr(Math.floor(Math.random()*16),1))}k.push("-");h=g.substr(Math.floor(Math.random()*16),1);h=g.substr((h&3)|8,1);k.push(h);for(j=0;j<3;j++){k.push(g.substr(Math.floor(Math.random()*16),1))}k.push("-");for(j=0;j<8;j++){k.push(g.substr(Math.floor(Math.random()*16),1))}k.unshift(l);return k.join("")},now:Date.now||function(){return +new Date()},noop:function(){}})})(typeof window!=="undefined"?window:this,dynamsoft);(function(d){var b=!({toString:1}.propertyIsEnumerable("toString")),c=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toString","toLocaleString","valueOf"];function a(f,e){return({}).hasOwnProperty.call(f,e)}d.keys=Object.keys||function(h){var e=[],g,f;for(g in h){if(a(h,g)){e.push(g)}}if(b){for(f=c.length-1;f>=0;f--){g=c[f];if(a(h,g)){e.push(g)}}}return e}})(dynamsoft.lib);(function(j,k){var f=20180508;if(j._isXXX_ver){if(j._isXXX_ver>=f){return}}j._isXXX_ver=f;var n=j.mix,l,g,i=!1,e=!0,d=i,c={}.hasOwnProperty,m={};function h(p){return p===k}function a(p){return p!==k}n(j,{isDef:a,isUndef:h,isUndefined:h,isNull:function(p){return(p===null)},isNaN:function(p){return isNaN(p)},type:function(p){if(p===null||p===k){return String(p)}return m[{}.toString.call(p)]||"object"},isPlainObject:function(r){if(!r||j.type(r)!=="object"||r.nodeType||r.window==r){return i}var o,p;try{if((p=r.constructor)&&!c(r,"constructor")&&!c(p.prototype,"isPrototypeOf")){return i}}catch(q){return i}for(o in r){}return(h(o)||c(r,o))}});function b(o,p){m["[object "+o+"]"]=(p=o.toLowerCase());j["is"+o]=function(q){return j.type(q)===p}}b("Function");j.each=l=function(s,u,o){if(s){var v,q,w,t=0,p=s.length,r=h(p)||j.isFunction(s);o=o||null;if(r){w=j.keys(s);for(;t<w.length;t++){v=w[t];if(u.call(o,s[v],v,s)===i){break}}}else{for(q=s[0];t<p;q=s[++t]){if(u.call(o,q,t,s)===i){break}}}}return s};g=["String","Object","Boolean","Number"];if(Array.isArray){j.isArray=Array.isArray}else{g.push("Array")}l(g,b)})(dynamsoft.lib);(function(c){var a=c.mix,b=c.win,e;var d=20180508;if(c._log_ver){if(c.isNumber(c._log_ver)&&c._log_ver>=d){return}}c._log_ver=d;if(c.isDef(b.console)){e=b.console;if(!c.isFunction(e.log)||!c.isFunction(e.error)){e=false}}a(c,{log:function(f){if(c.debug&&e){e.log(f)}},error:function(f){if(c.debug&&e){e.error(f)}},getLogger:function(){var f=c.log;return{warn:f,log:f,info:f,debug:f}}})})(dynamsoft.lib);(function(b){var a=20180508;if(b._random_ver){if(b._random_ver>=a){return}}b._random_ver=a;b.getRandom=function(){var d=b.now()%10000,c=[],f;for(var e=0;e<5;e++){f=Math.floor(Math.random()*10);if(e==0&&f==0){e=-1;continue}c.push(f)}if(d<10){c.push("000")}else{if(d<100){c.push("00")}else{if(d<1000){c.push("0")}}}c.push(d);return c.join("")}})(dynamsoft.lib);(function(b){var a=20180508;if(b._strUtil_ver){if(b.isNumber(b._strUtil_ver)&&b._strUtil_ver>=a){return}}b._strUtil_ver=a;b.mix(b,{startsWith:function(d,c){return d.lastIndexOf(c,0)===0},endsWith:function(e,d){var c=e.length-d.length;return c>=0&&e.indexOf(d,c)===c},replaceAll:function(e,d,c){return e.replace(new RegExp(d,"gi"),c)},upperCaseFirst:function(c){return c.charAt(0).toUpperCase()+c.substr(1)},makeArray:function(h){if(h==null){return[]}if(b.isArray(h)){return h}var c=typeof h.length,g=typeof h;if(c!=="number"||h.alert||g==="string"||(g==="function"&&!("item" in h&&c==="number"))){return[h]}var e=[];for(var f=0,d=h.length;f<d;f++){e[f]=h[f]}return e}})})(dynamsoft.lib);(function(j){var b=20180508;if(j._navInfo_ver){if(j.isNumber(j._navInfo_ver)&&j._navInfo_ver>=b){return}}j._navInfo_ver=b;var A="",I=!1,w=!0,E=j.win,h=j.doc,M=h&&h.documentElement,t=navigator,D=t.userAgent.toLowerCase(),v=t.platform.toLowerCase(),F=h.location.protocol,a=(F==="https:"),o=(F!=="https:"&&F!=="http:"),B=(v=="win32")||(v=="win64")||(v=="windows"),y=(v=="mac68k")||(v=="macppc")||(v=="macintosh")||(v=="macintel")||(v=="iphone"),K=(v.indexOf("linux")>=0),g=(v=="win64")||(D.indexOf("wow64")>=0)||(D.indexOf("x86_64")>=0)||(D.indexOf("win64")>=0)||(D.indexOf("x64")>=0),s=(D.indexOf("wow64")>=0),q=D.indexOf("msie"),z=D.indexOf("trident"),x=D.indexOf("rv:"),L=D.indexOf("edge"),G=D.match(/version\/([\d.]+).*safari/),l=G?w:I,n=G?G[1]:0,r=D.indexOf("firefox"),u=(r!=-1),k=B&&!u&&(L!=-1),C=D.indexOf("chrome"),e=!k&&(C!=-1),d=B&&!u&&!k&&!e&&(q!=-1||z!=-1||x!=-1),i="",c=0,m=D.match(/Gecko/)?w:I,f=I,H=A,p=I,J=E.JSON;if(k){G=D.slice(L+5);G=G.slice(0,G.indexOf(" "));i=G;G=G.slice(0,G.indexOf("."));if(G>=27){f=w}}else{if(e){G=D.slice(C+7);G=G.slice(0,G.indexOf(" "));H=G;G=G.slice(0,G.indexOf("."));if(G>=27){f=w}}else{if(u){G=D.slice(r+8);G=G.slice(0,G.indexOf(" "));H=G;G=G.slice(0,G.indexOf("."));if(G>=27){f=w}}else{if(d){if(q!=-1){G=D.slice(q+4);G=G.slice(0,G.indexOf(";"));i=G}else{if(x!=-1){G=D.slice(x+3);G=G.slice(0,G.indexOf(";"));G=G.slice(0,G.indexOf(")"));i=G}else{if(z!=-1){G=D.slice(z+7);G=G.slice(0,G.indexOf(";"));i=G}}}if(i===""||i>8){f=w}H=G}else{if(l){if(G){H=G[1]}G=n;G=G.slice(0,G.indexOf("."));if(G>=7){f=w}}}}}}if(k||d){if(h.documentMode){c=h.documentMode}else{c=5;if(h.compatMode){if(h.compatMode=="CSS1Compat"){c=7}}}}if(M&&M.querySelector&&(!d||d&&(H>8))){p=w}if(d&&H<9){J=null}dynamsoft.navInfo={host:E,bSSL:a,bFileSystem:o,bWin:B,bMac:y,bLinux:K,isX64:g,isWOW64:s,bIE:d,bEdge:k,bChrome:e,bFirefox:u,bSafari:l,bGecko:m,bHTML5Edition:f,strBrowserVersion:H,IEMode:c,bQuerySelectorSupported:p,nativeJson:J,nodejs:I,scrollBarWidth:I}})(dynamsoft.lib);(function(b){var a=20180508;if(b._extend_ver){if(b.isNumber(b._extend_ver)&&b._extend_ver>=a){return}}b._extend_ver=a;b.extend=function(c,d){var e=function(){c.apply(this,arguments);if(d){d.apply(this,arguments)}};b.each(c.prototype,function(g,f){e.prototype[f]=g});e.prototype.constructor=e;return e}})(dynamsoft.lib);(function(c){var a=20180508;if(c._attribute_ver){if(c.isNumber(c._attribute_ver)&&c._attribute_ver>=a){return}}c._attribute_ver=a;function b(e){var d=this,f=d.constructor;d.__attrs={};d.__attrVals={};d.userConfig=e;while(f){d.addAttrs(f.ATTRS);f=f.superclass?f.superclass.constructor:null}c.mix(d.__attrs,e)}c.mix(b.prototype,{get:function(e){var d=this;if(e in d.__attrs){return d.__attrs[e]}return""},set:function(f,e){var d=this;if(f in d.__attrs){d.__attrs[f]=e}},addAttrs:function(d){c.mix(this.__attrs,d)}});b.extend=function(f){var d=this,g,e;f=f||{};if(f.constructor){g=f.constructor}e=c.extend(d,g);c.mix(e,f);return e};c.Attributes=b})(dynamsoft.lib);(function(h){var m=20180508;if(h._json_ver){if(h._json_ver>=m){return}}h._json_ver=m;var j=h.win.JSON;if(j&&j.parse&&j.stringify){h.parse=j.parse;h.stringify=j.stringify;return}var l=(function(){var q={"\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t",'"':'\\"'},p={},r=/["\b\f\n\r\t\x00-\x1f]/g,o=/\\\\|\\\/|\\b|\\f|\\n|\\r|\\t|\\"|\\u[0-9a-zA-Z]{4}/g;h.each(q,function(s,t){p[s]=t});p["\\/"]="/";p["\\\\"]="\\";return{quote:function(s){return'"'+s.replace(r,function(t){var u;if(!(u=q[t])){u="\\u"+("0000"+t.charCodeAt(0).toString(16)).slice(0-4)}return u})+'"'},unQuote:function(s){return s.slice(1,s.length-1).replace(o,function(t){var u;if(!(u=p[t])){u=String.fromCharCode(parseInt(t.slice(2),16))}return u})}}})(),i;function b(o){return o<10?"0"+o:o}function f(F,z,r,E,D,t){var u=t;t+=E;var v,q,x=0,s;if(r!==undefined){v=r}else{v=h.keys(F)}var C=[];for(q=v.length;x<q;x++){s=v[x];var o=i(s,F,z,r,E,D,t);if(o!==undefined){var w=l.quote(s);w+=":";if(E){w+=" "}w+=o;C[C.length]=w}}var A;if(!C.length){A="{}"}else{if(!E){A="{"+C.join(",")+"}"}else{var y=",\n"+t;var B=C.join(y);A="{\n"+t+B+"\n"+u+"}"}}return A}function n(B,t,p,A,z,q){var r=q;q+=A;var y=[];var v=B.length;var u=0;while(u<v){var o=i(String(u),B,t,p,A,z,q);if(o===undefined){y[y.length]="null"}else{y[y.length]=o}++u}var w;if(!y.length){w="[]"}else{if(!A){w="["+y.join(",")+"]"}else{var s="\n,"+q;var x=y.join(s);w="[\n"+q+x+"\n"+r+"]"}}return w}i=function(r,q,u,s,v,p,o){var t=q[r];if(t&&typeof t==="object"){if(typeof t.toJSON==="function"){t=t.toJSON(r)}else{if(t instanceof Date){t=isFinite(t.valueOf())?t.getUTCFullYear()+"-"+b(t.getUTCMonth()+1)+"-"+b(t.getUTCDate())+"T"+b(t.getUTCHours())+":"+b(t.getUTCMinutes())+":"+b(t.getUTCSeconds())+"Z":null}else{if(t instanceof String||t instanceof Number||t instanceof Boolean){t=t.valueOf()}}}}if(u!==undefined){t=u.call(q,r,t)}switch(typeof t){case"number":return isFinite(t)?String(t):"null";case"string":return l.quote(t);case"boolean":return String(t);case"object":if(!t){return"null"}if(h.isArray(t)){return n(t,u,s,v,p,o)}return f(t,u,s,v,p,o)}return undefined};h.stringify=function(r,o,q){var t="";var p,s;if(o){if(typeof o==="function"){s=o}else{if(h.isArray(o)){p=o}}}if(typeof q==="number"){q=Math.min(10,q);t=new Array(q+1).join(" ")}else{if(typeof q==="string"){t=q.slice(0,10)}}return i("",{"":r},s,p,t,[],"")};var c={},d={SHIFT_TYPE:1,REDUCE_TYPE:2,ACCEPT_TYPE:0,TYPE_INDEX:0,PRODUCTION_INDEX:1,TO_INDEX:2},a;c.yy={unQuote:l.unQuote};a=function(o){var p=this;p.rules=[];h.mix(p,o);p.resetInput(p.input)};a.prototype={constructor:function(o){var p=this;p.rules=[];h.mix(p,o);p.resetInput(p.input)},resetInput:function(o){h.mix(this,{input:o,matched:"",stateStack:[a.STATIC.INITIAL],match:"",text:"",firstLine:1,lineNumber:1,lastLine:1,firstColumn:1,lastColumn:1})},getCurrentRules:function(){var o=this,p=o.stateStack[o.stateStack.length-1],q=[];p=o.mapState(p);h.each(o.rules,function(s){var t=s.state||s[3];if(!t){if(p==a.STATIC.INITIAL){q.push(s)}}else{if(h.inArray(p,t)){q.push(s)}}});return q},pushState:function(o){this.stateStack.push(o)},popState:function(){return this.stateStack.pop()},getStateStack:function(){return this.stateStack},showDebugInfo:function(){var q=this,s=a.STATIC.DEBUG_CONTEXT_LIMIT,o=q.matched,r=q.match,p=q.input;o=o.slice(0,o.length-r.length);var u=(o.length>s?"...":"")+o.slice(-s).replace(/\n/," "),t=r+p;t=t.slice(0,s)+(t.length>s?"...":"");return u+t+"\n"+new Array(u.length+1).join("-")+"^"},mapSymbol:function(q){var o=this,p=o.symbolMap;if(!p){return q}return p[q]||(p[q]=(++o.symbolId))},mapReverseSymbol:function(p){var o=this,r=o.symbolMap,q,s=o.reverseSymbolMap;if(!s&&r){s=o.reverseSymbolMap={};h.each(r,function(u,t){s[u]=t})}if(s){return s[p]}else{return p}},mapState:function(q){var o=this,p=o.stateMap;if(!p){return q}return p[q]||(p[q]=(++o.stateId))},lex:function(){var y=this,w=y.input,r,v,o,t,z,x=y.getCurrentRules();y.match=y.text="";if(!w){return y.mapSymbol(a.STATIC.END_TAG)}for(r=0;r<x.length;r++){v=x[r];var u=v.regexp||v[1],p=v.token||v[0],q=v.action||v[2]||undefined;if((o=w.match(u))){z=o[0].match(/\n.*/g);if(z){y.lineNumber+=z.length}h.mix(y,{firstLine:y.lastLine,lastLine:y.lineNumber+1,firstColumn:y.lastColumn,lastColumn:z?z[z.length-1].length-1:y.lastColumn+o[0].length});var s;s=y.match=o[0];y.matches=o;y.text=s;y.matched+=s;t=q&&q.call(y);if(t===undefined){t=p}else{t=y.mapSymbol(t)}w=w.slice(s.length);y.input=w;if(t){return t}else{return y.lex()}}}h.error("lex error at line "+y.lineNumber+":\n"+y.showDebugInfo());return undefined}};a.STATIC={INITIAL:"I",DEBUG_CONTEXT_LIMIT:20,END_TAG:"$EOF"};var e=new a({rules:[[2,/^"(\\"|\\\\|\\\/|\\b|\\f|\\n|\\r|\\t|\\u[0-9a-zA-Z]{4}|[^\\"\x00-\x1f])*"/,0],[0,/^[\t\r\n\x20]/,0],[3,/^,/,0],[4,/^:/,0],[5,/^\[/,0],[6,/^\]/,0],[7,/^\{/,0],[8,/^\}/,0],[9,/^-?\d+(?:\.\d+)?(?:e-?\d+)?/i,0],[10,/^true|false/,0],[11,/^null/,0],[12,/^./,0]]});c.lexer=e;e.symbolMap={"$EOF":1,STRING:2,COMMA:3,COLON:4,LEFT_BRACKET:5,RIGHT_BRACKET:6,LEFT_BRACE:7,RIGHT_BRACE:8,NUMBER:9,BOOLEAN:10,NULL:11,INVALID:12,"$START":13,json:14,value:15,object:16,array:17,elementList:18,member:19,memberList:20};c.productions=[[13,[14]],[14,[15],function(){return this.$1}],[15,[2],function(){return this.yy.unQuote(this.$1)}],[15,[9],function(){return parseFloat(this.$1)}],[15,[16],function(){return this.$1}],[15,[17],function(){return this.$1}],[15,[10],function(){return this.$1==="true"}],[15,[11],function(){return null}],[18,[15],function(){return[this.$1]}],[18,[18,3,15],function(){this.$1[this.$1.length]=this.$3;return this.$1}],[17,[5,6],function(){return[]}],[17,[5,18,6],function(){return this.$2}],[19,[2,4,15],function(){return{key:this.yy.unQuote(this.$1),value:this.$3}}],[20,[19],function(){var o={};o[this.$1.key]=this.$1.value;return o}],[20,[20,3,19],function(){this.$1[this.$3.key]=this.$3.value;return this.$1}],[16,[7,8],function(){return{}}],[16,[7,20,8],function(){return this.$2}]];c.table={gotos:{"0":{"14":7,"15":8,"16":9,"17":10},"2":{"15":12,"16":9,"17":10,"18":13},"3":{"19":16,"20":17},"18":{"15":23,"16":9,"17":10},"20":{"15":24,"16":9,"17":10},"21":{"19":25}},action:{"0":{"2":[1,0,1],"5":[1,0,2],"7":[1,0,3],"9":[1,0,4],"10":[1,0,5],"11":[1,0,6]},"1":{"1":[2,2,0],"3":[2,2,0],"6":[2,2,0],"8":[2,2,0]},"2":{"2":[1,0,1],"5":[1,0,2],"6":[1,0,11],"7":[1,0,3],"9":[1,0,4],"10":[1,0,5],"11":[1,0,6]},"3":{"2":[1,0,14],"8":[1,0,15]},"4":{"1":[2,3,0],"3":[2,3,0],"6":[2,3,0],"8":[2,3,0]},"5":{"1":[2,6,0],"3":[2,6,0],"6":[2,6,0],"8":[2,6,0]},"6":{"1":[2,7,0],"3":[2,7,0],"6":[2,7,0],"8":[2,7,0]},"7":{"1":[0,0,0]},"8":{"1":[2,1,0]},"9":{"1":[2,4,0],"3":[2,4,0],"6":[2,4,0],"8":[2,4,0]},"10":{"1":[2,5,0],"3":[2,5,0],"6":[2,5,0],"8":[2,5,0]},"11":{"1":[2,10,0],"3":[2,10,0],"6":[2,10,0],"8":[2,10,0]},"12":{"3":[2,8,0],"6":[2,8,0]},"13":{"3":[1,0,18],"6":[1,0,19]},"14":{"4":[1,0,20]},"15":{"1":[2,15,0],"3":[2,15,0],"6":[2,15,0],"8":[2,15,0]},"16":{"3":[2,13,0],"8":[2,13,0]},"17":{"3":[1,0,21],"8":[1,0,22]},"18":{"2":[1,0,1],"5":[1,0,2],"7":[1,0,3],"9":[1,0,4],"10":[1,0,5],"11":[1,0,6]},"19":{"1":[2,11,0],"3":[2,11,0],"6":[2,11,0],"8":[2,11,0]},"20":{"2":[1,0,1],"5":[1,0,2],"7":[1,0,3],"9":[1,0,4],"10":[1,0,5],"11":[1,0,6]},"21":{"2":[1,0,14]},"22":{"1":[2,16,0],"3":[2,16,0],"6":[2,16,0],"8":[2,16,0]},"23":{"3":[2,9,0],"6":[2,9,0]},"24":{"3":[2,12,0],"8":[2,12,0]},"25":{"3":[2,14,0],"8":[2,14,0]}}};c.parse=function g(y){var A=this,o=A.lexer,t,F,E,I=A.table,B=I.gotos,s=I.action,r=A.productions,u=[null],v=[0];o.resetInput(y);while(1){t=v[v.length-1];if(!F){F=o.lex()}if(!F){h.log("it is not a valid input: "+y,"error");return false}E=s[t]&&s[t][F];if(!E){var w=[],D;if(s[t]){h.each(s[t],function(L,M){w.push(A.lexer.mapReverseSymbol(M))})}D="Syntax error at line "+o.lineNumber+":\n"+o.showDebugInfo()+"\nexpect "+w.join(", ");h.log(D);return false}switch(E[d.TYPE_INDEX]){case d.SHIFT_TYPE:v.push(F);u.push(o.text);v.push(E[d.TO_INDEX]);F=null;break;case d.REDUCE_TYPE:var J=r[E[d.PRODUCTION_INDEX]],z=J.symbol||J[0],q=J.action||J[2],C=J.rhs||J[1],H=C.length,G=0,K,x=u[u.length-H];A.$$=x;K=undefined;for(;G<H;G++){A["$"+(H-G)]=u[u.length-1-G]}if(q){K=q.call(A)}if(K!==undefined){x=K}else{x=A.$$}if(H){v=v.slice(0,-1*H*2);u=u.slice(0,-1*H)}v.push(z);u.push(x);var p=B[v[v.length-2]][v[v.length-1]];v.push(p);break;case d.ACCEPT_TYPE:return x}}};function k(w,o,x){var s=w[o],t,v,u;if(typeof s==="object"){if(h.isArray(s)){t=0;v=s.length;var r=[];while(t<v){u=k(s,String(t),x);if(u!==undefined){r[r.length]=u}}s=r}else{var y=h.keys(s);t=0;for(v=y.length;t<v;t++){var q=y[t];u=k(s,q,x);if(u===undefined){delete s[q]}else{s[q]=u}}}}return x.call(w,o,s)}h.parse=function(q,o){var p=c.parse(String(q));if(o){return k({"":p},"",o)}else{return p}}})(dynamsoft.lib);(function(lib,nil){var _utilities_ver=20180508;if(lib._utilities_ver){if(lib._utilities_ver>=_utilities_ver){return}}lib._utilities_ver=_utilities_ver;var AP=Array.prototype,win=lib.win,doc=lib.doc,navInfo=dynamsoft.navInfo,EMPTY_STR="",FALSE=!1,TRUE=!0,mix=lib.mix;var RE_TRIM=/^[\s\xa0]+|[\s\xa0]+$/g,indexOf=AP.indexOf,lastIndexOf=AP.lastIndexOf,filter=AP.filter,every=AP.every,some=AP.some,map=AP.map;var logger=lib.getLogger(),location=win.location,domReady=0,callbacks=[],POLL_RETIRES=500,POLL_INTERVAL=40,RE_ID_STR=/^#?([\w-]+)$/,RE_NOT_WHITESPACE=/\S/,standardEventModel=!!(doc&&doc.addEventListener),DOM_READY_EVENT="DOMContentLoaded",READY_STATE_CHANGE_EVENT="readystatechange",LOAD_EVENT="load",COMPLETE="complete",addEventListener=standardEventModel?function(el,type,fn){el.addEventListener(type,fn,false)}:function(el,type,fn){el.attachEvent("on"+type,fn)},removeEventListener=standardEventModel?function(el,type,fn){el.removeEventListener(type,fn,false)}:function(el,type,fn){el.detachEvent("on"+type,fn)};lib.mix(lib,{isWindow:function(obj){return obj!=null&&obj==obj.window},globalEval:function(data){if(data&&RE_NOT_WHITESPACE.test(data)){if(win.execScript){win.execScript(data)}else{(function(data){win.eval.call(win,data)})(data)}}},ready:function(fn){if(domReady){try{fn(lib)}catch(e){lib.log(e.stack||e,"error");setTimeout(function(){throw e},0)}}else{callbacks.push(fn)}return this}});function fireReady(){if(domReady){return}if(doc&&!navInfo.nodejs){removeEventListener(win,LOAD_EVENT,fireReady)}domReady=1;for(var i=0;i<callbacks.length;i++){try{callbacks[i](lib)}catch(e){lib.log(e.stack||e,"error");setTimeout(function(){throw e},0)}}}function bindReady(){if(!doc||doc.readyState===COMPLETE){fireReady();return}addEventListener(win,LOAD_EVENT,fireReady);if(standardEventModel){var domReady=function(){removeEventListener(doc,DOM_READY_EVENT,domReady);fireReady()};addEventListener(doc,DOM_READY_EVENT,domReady)}else{var stateChange=function(){if(doc.readyState===COMPLETE){removeEventListener(doc,READY_STATE_CHANGE_EVENT,stateChange);fireReady()}};addEventListener(doc,READY_STATE_CHANGE_EVENT,stateChange);var notframe,docElem=doc&&doc.documentElement,doScroll=docElem&&docElem.doScroll;try{notframe=(win.frameElement===null)}catch(e){notframe=false}if(doScroll&¬frame){var readyScroll=function(){try{doScroll("left");fireReady()}catch(ex){setTimeout(readyScroll,POLL_INTERVAL)}};readyScroll()}}}bindReady();if(navInfo.bIE){try{doc.execCommand("BackgroundImageCache",false,true)}catch(e){}}})(dynamsoft.lib);(function(d){var c=20180508;if(d._domUtil_ver){if(d._domUtil_ver>=c){return}}d._domUtil_ver=c;var b="",a="none";d.mix(d,{get:function(e){return d.doc.getElementById(e)},hide:function(f){var e=d.isString(f)?d.get(f):f;if(e){e.style.display=a}},show:function(f){var e=d.isString(f)?d.get(f):f;if(e){e.style.display=b}},toggle:function(f){var e=d.isString(f)?d.get(f):f;if(e){if(e.style.display===a){e.style.display=b}else{e.style.display=a}}},empty:function(e){if(!e){return}while(e.firstChild){e.removeChild(e.firstChild)}}})})(dynamsoft.lib);(function(a,h){var g=a.lib,f=a.navInfo,b=20190110;if(g._ls_ver){if(g.isNumber(g._ls_ver)&&g._ls_ver>=b){return}}g._ls_ver=b;var i=false,d=false,j;if((f.bEdge&&f.bFileSystem)||(f.bIE&&f.strBrowserVersion<8)){}else{try{d=window.localStorage;i=d?true:false}catch(c){d=false}}g.LS={isSupportLS:function(){return i},item:function(k,l,e){var m=null;if(this.isSupportLS()){if(l){d.setItem(k,l);m=l}else{m=d.getItem(k)}if(m===null){return e}return m}else{return e}},removeItem:function(e){if(this.isSupportLS()){d.removeItem(e)}else{return false}return true}}})(dynamsoft);(function(e){var d=20190506;if(e._array_ver){if(e._array_ver>=d){return}}e._array_ver=d;var c=Array.prototype,b=c.indexOf,a=c.filter;if(!e.isFunction(b)){b=function(h,i){var g;if(this==null){return -1}var j=Object(this);var f=j.length>>>0;if(f===0){return -1}var l=+i||0;if(Math.abs(l)===Infinity){l=0}if(l>=f){return -1}g=Math.max(l>=0?l:f-Math.abs(l),0);while(g<f){if(g in j&&j[g]===h){return g}g++}return -1}}e.mix(e,{filter:a?function(f,h,g){return a.call(f,h,g||this)}:function(f,i,h){var g=[];e.each(f,function(l,k,j){if(i.call(h||this,l,k,j)){g.push(l)}});return g},indexOf:function(g,f){return b.call(f,g)},uniq:function(l){var k=[],f=l.length;for(var h=0;h<f;h++){for(var g=h+1;g<f;g++){if(l[h]===l[g]){h++;g=h}}k.push(l[h])}return k}})})(dynamsoft.lib);(function(d){var c=20190506;if(d._function_ver){if(d._function_ver>=c){return}}d._function_ver=c;var b=Array.prototype,a=Function.prototype;if(!d.isFunction(a.bind)){a.bind=function(g){var f=this;if(1<arguments.length){var e=b.slice.call(arguments,1);return function(){return f.apply(g,arguments.length?e.concat(b.slice.call(arguments)):e)}}return function(){return arguments.length?f.apply(g,arguments):f.call(g)}}}})(dynamsoft.lib);(function(f){var d=20190506;if(f._string_ver){if(f._string_ver>=d){return}}f._string_ver=d;var b=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,e=String.prototype,c="",a=e.trim;if(!a){a=e.trim=function(){return this.replace(b,c)}}f.trim=function(g){return g==null?c:a.call(g)}})(dynamsoft.lib);(function(g,c){var t="",j=!1,f=!0,s=g.getLogger(),l=g.isDef,a=g.each,k="&",m="=",p=16,d={"&":"&",">":">","<":"<","`":"`","/":"/",""":'"',"'":"'"},o={},h,i,b=/[\-#$\^*()+\[\]{}|\\,.?\s]/g;a(d,function(v,u){o[v]=u});function r(v){var u=typeof v;return v==null||(u!=="object"&&u!=="function")}function q(){if(h){return h}var u=t;a(d,function(v){u+=v+"|"});u=u.slice(0,-1);h=new RegExp(u,"g");return h}function n(){if(i){return i}var u=t;a(o,function(v){u+=v+"|"});u+="&#(\\d{1,5});";i=new RegExp(u,"g");return i}function e(u){return encodeURIComponent(String(u))}g.mix(g,{urlEncode:e,urlDecode:function(u){return decodeURIComponent(u.replace(/\+/g," "))},fromUnicode:function(u){return u.replace(/\\u([a-f\d]{4})/ig,function(v,w){return String.fromCharCode(parseInt(w,p))})},escapeHtml:function(u){return(u+"").replace(q(),function(v){return o[v]})},escapeRegExp:function(u){return u.replace(b,"\\$&")},unEscapeHtml:function(u){return u.replace(n(),function(v,w){return d[v]||String.fromCharCode(+w)})},param:function(y,x,v,u){x=x||k;v=v||m;if(g.isUndef(u)){u=f}var w=[];a(y,function(B,z){var A=e(z);if(r(B)){w.push(A);if(l(B)){w.push(v,e(B+t))}w.push(x)}else{if(g.isArray(B)&&B.length){a(B,function(C){if(r(C)){w.push(A,(u?e("[]"):t));if(l(C)){w.push(v,e(C+t))}w.push(x)}})}}});w.pop();return w.join(t)},unparam:function(B,F,E){if(!g.isString(B)||!(B=g.trim(B))){return{}}F=F||k;E=E||m;var A={},C,u=g.urlDecode,v=B.split(F),D,w,x=0,y=v.length;for(;x<y;++x){C=g.indexOf(E,v[x]);if(C===-1){D=u(v[x]);w=c}else{D=u(v[x].substring(0,C));w=v[x].substring(C+1);try{w=u(w)}catch(z){s.error("decodeURIComponent error : "+w);s.error(z)}if(g.endsWith(D,"[]")){D=D.substring(0,D.length-2)}}if(D in A){if(g.isArray(A[D])){A[D].push(w)}else{A[D]=[A[D],w]}}else{A[D]=w}}return A}})})(dynamsoft.lib);(function(d){var c=/^(\/?)([\s\S]+\/(?!$)|\/)?((?:\.{1,2}$|[\s\S]+?)?(\.[^.\/]*)?)$/;function b(j,e){var g=[];for(var f=0;f<j.length;f++){var h=j[f];if(!h||h==="."){continue}if(h===".."){if(g.length&&g[g.length-1]!==".."){g.pop()}else{if(e){g.push("..")}}}else{g.push(h)}}return g}var a=d.Path={resolve:function(){var h="",f,g,e=(arguments),j,k=0;for(g=e.length-1;g>=0&&!k;g--){j=e[g];if(d.isString(j)&&!!j){h=j+"/"+h;k=j.charAt(0)==="/"}}f=b(d.filter(h.split("/"),function(i){return !!i}),!k).join("/");return((k?"/":"")+f)||"."},normalize:function(f){var g=f.charAt(0)==="/",e=f.slice(-1)==="/";f=b(d.filter(f.split("/"),function(h){return !!h}),!g).join("/");if(!f&&!g){f="."}if(f&&e){f+="/"}return(g?"/":"")+f},join:function(){var e=d.makeArray(arguments);return a.normalize(d.filter(e,function(f){return f&&(d.isString(f))}).join("/"))},relative:function(l,k){l=a.normalize(l);k=a.normalize(k);var j=d.filter(l.split("/"),function(m){return !!m}),i=[],f,g,e=d.filter(k.split("/"),function(m){return !!m}),h=Math.min(j.length,e.length);for(f=0;f<h;f++){if(j[f]!==e[f]){break}}g=f;while(f<j.length){i.push("..");f++}i=i.concat(e.slice(g));return i.join("/")},basename:function(h,f){var e=h.match(c)||[],g;g=e[3]||"";if(f&&g&&g.slice(-1*f.length)===f){g=g.slice(0,-1*f.length)}return g},dirname:function(h){var e=h.match(c)||[],f=e[1]||"",g=e[2]||"";if(!f&&!g){return"."}if(g){g=g.substring(0,g.length-1)}return f+g},extname:function(e){return(e.match(c)||[])[4]||""}}})(dynamsoft.lib);(function(d,c){function b(e){if(!e._queryMap){e._queryMap=d.unparam(e._query)}}function a(e){this._query=e||""}a.prototype={constructor:a,clone:function(){return new a(this.toString())},reset:function(f){var e=this;e._query=f||"";e._queryMap=null;return e},count:function(){var e=this,f=0;b(e);d.each(e._queryMap,function(g){if(d.isArray(g)){f+=g.length}else{f++}});return f},has:function(f){var e=this,g;b(e);g=e._queryMap;if(f){return f in g}else{return !d.isEmptyObject(g)}},get:function(f){var e=this,g;b(e);g=e._queryMap;if(f){return g[f]}else{return g}},keys:function(){var e=this;b(e);return d.keys(e._queryMap)},set:function(f,g){var e=this,h;b(e);h=e._queryMap;if(d.isString(f)){e._queryMap[f]=g}else{if(f instanceof a){f=f.get()}d.each(f,function(j,i){h[i]=j})}return e},remove:function(f){var e=this;b(e);if(f){delete e._queryMap[f]}else{e._queryMap={}}return e},add:function(f,h){var e=this,i,g;if(d.isString(f)){b(e);i=e._queryMap;g=i[f];if(d.isUndef(g)){g=h}else{g=[].concat(g).concat(h)}i[f]=g}else{if(f instanceof a){f=f.get()}d.each(f,function(l,j){e.add(j,l)})}return e},toString:function(e){var f=this;b(f);return d.param(f._queryMap,c,c,e)}};d.uriQuery=a})(dynamsoft.lib);(function(j){var h=j.uriQuery,l=j.each,f=j.Path,n=j.getLogger(),o=/[#\/\?@]/g,c=/[#\?]/g,k=/[#@]/g,e=/#/g,g={scheme:1,userInfo:2,hostname:3,port:4,path:5,query:6,fragment:7},b=new RegExp("^(?:([\\w\\d+.-]+):)?(?://(?:([^/?#@]*)@)?([\\w\\d\\-\\u0100-\\uffff.+%]*|\\[[^\\]]+\\])(?::([0-9]+))?)?([^?#]+)?(?:\\?([^#]*))?(?:#(.*))?$");function a(p){return p.length===1?"0"+p:p}function i(q,p){return q.toLowerCase()===p.toLowerCase()}function m(q,p){return encodeURI(q).replace(p,function(r){return"%"+a(r.charCodeAt(0).toString(16))})}function d(r){if(r instanceof d){return r.clone()}var q,p=this;j.mix(p,{scheme:"",userInfo:"",hostname:"",port:"",path:"",query:"",fragment:""});q=d.getComponents(r);l(q,function(s,t){s=s||"";if(t==="query"){p.query=new h(s)}else{try{s=j.urlDecode(s)}catch(u){n.error(u+"urlDecode error : "+s)}p[t]=s}});return p}d.prototype={constructor:d,clone:function(){var q=new d(),p=this;l(g,function(r,s){q[s]=p[s]});q.query=q.query.clone();return q},resolve:function(t){if(j.isString(t)){t=new d(t)}var r=this,s=0,q,p=["scheme","userInfo","hostname","port","path","query","fragment"],u=r.clone();l(p,function(w){if(w==="path"){if(s){u[w]=t[w]}else{var v=t.path;if(v){s=1;if(!j.startsWith(v,"/")){if(u.hostname&&!u.path){v="/"+v}else{if(u.path){q=u.path.lastIndexOf("/");if(q!==-1){v=u.path.slice(0,q+1)+v}}}}u.path=f.normalize(v)}}}else{if(w==="query"){if(s||t.query.toString()){u.query=t.query.clone();s=1}}else{if(s||t[w]){u[w]=t[w];s=1}}}});return u},getScheme:function(){return this.scheme},setScheme:function(p){this.scheme=p;return this},getHostname:function(){return this.hostname},setHostname:function(p){this.hostname=p;return this},setUserInfo:function(p){this.userInfo=p;return this},getUserInfo:function(){return this.userInfo},setPort:function(p){this.port=p;return this},getPort:function(){return this.port},setPath:function(p){this.path=p;return this},getPath:function(){return this.path},setQuery:function(p){if(j.isString(p)){if(j.startsWith(p,"?")){p=p.slice(1)}p=new h(m(p,k))}this.query=p;return this},getQuery:function(){return this.query},getFragment:function(){return this.fragment},setFragment:function(q){var p=this;if(j.startsWith(q,"#")){q=q.slice(1)}p.fragment=q;return p},isSameOriginAs:function(p){var q=this;return i(q.hostname,p.hostname)&&i(q.scheme,p.scheme)&&i(q.port,p.port)},toString:function(s){var r=[],x=this,p,v,y,q,t,u,w;if((p=x.scheme)){r.push(m(p,o));r.push(":")}if((v=x.hostname)){r.push("//");if((w=x.userInfo)){r.push(m(w,o));r.push("@")}r.push(encodeURIComponent(v));if((q=x.port)){r.push(":");r.push(q)}}if((y=x.path)){if(v&&!j.startsWith(y,"/")){y="/"+y}y=f.normalize(y);r.push(m(y,c))}if((u=(x.query.toString.call(x.query,s)))){r.push("?");r.push(u)}if((t=x.fragment)){r.push("#");r.push(m(t,e))}return r.join("")}};d.getComponents=function(s){var r="";s=s||r;var p=s.match(b)||[],q={};l(g,function(t,u){q[u]=p[t]});return q};j.Uri=d})(dynamsoft.lib);(function(a){var d=a.lib,c=a.navInfo;var b=20180508;if(d._color_ver){if(d.isNumber(d._color_ver)&&d._color_ver>=b){return}}d._color_ver=b;d.colorStrToInt=function(j){var e="0x",g,f;if(/^(rgb|RGB)/.test(j)){var h=j.replace(/[^\d,.]/g,"").split(",");for(f=0;f<3;++f){g=Number(h[f]).toString(16);if(g.length==1){g="0"+g}e+=g}if(h.length==4){g=Math.round(Number(h[f])*255).toString(16);if(g.length==1){g="0"+g}e+=g}else{e+="ff"}}else{if(j=="transparent"){e+="00000000"}else{if(/^#[0-9a-fA-f]{6}$/.test(j)){e+=j.replace(/#/,"")+"ff"}else{if(/^#[0-9a-fA-f]{3}$/.test(j)){for(f=0;f<3;++f){e+=j[f]+j[f]}e+="ff"}else{e="-1"}}}}return Number(e)};d.IntToColorStr=function(e){if(e>4294967295||e<0){return null}var f;if(!c.bHTML5Edition){if(e%256==0){f="transparent"}else{f=Math.floor(e/256).toString(16);while(f.length!=6){f="0"+f}f="#"+f}}else{f="rgba("+Math.floor(e/16777216)+","+Math.floor(e/65536)%256+","+Math.floor(e/256)%256+","+(e%256)/255+")"}return f}})(dynamsoft);(function(o,q){var t=o.lib,B=20190506;if(t._ajax_ver){if(t.isNumber(t._ajax_ver)&&t._ajax_ver>=B){return}}t._ajax_ver=B;var d=o.navInfo,l=t.win,j=t.each,i=/^(?:about|app|app\-storage|.+\-extension|file|widget)$/,w=1,D=2,c=3,G=200,b=204,h=300,u=304,n=404,f=1223,s=500,y="open error: ",v="send error: ",g=new t.Uri(location.href),C=g&&i.test(g.getScheme()),E=false,k=function(){try{return new l.XMLHttpRequest()}catch(I){}},x=function(){try{var I=false;j(["Msxml2.XMLHTTP.6.0","Msxml2.XMLHTTP","Microsoft.XMLHTTP","Msxml2.XMLHTTP.3.0","Msxml3.XMLHTTP"],function(K){try{return(I=new l.ActiveXObject(K))}catch(L){t.error("new xhr error: "+L.message)}});return I}catch(J){}},r=(!C&&l.XMLHttpRequest)?("withCredentials" in (k()||[])):false,A=l.ActiveXObject?function(I){if(d.bIE&&(parseInt(d.strBrowserVersion)<=9)){return x()}if(!r&&I&&E){return new E()}return !C&&k()||x()}:k,p=function(I){return E&&(I instanceof E)},m=/^(?:GET|HEAD)$/,a=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,H={xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":"*/*"},z=q;if(d.bIE&&parseInt(d.strBrowserVersion)<=10){z=t.noop}function F(){}t.mix(F.prototype,{url:false,onSuccess:false,onError:false,onComplete:false,method:"GET",async:true,xhrFields:false,mimeType:false,username:false,password:false,data:false,dataType:"text",headers:false,contentType:"application/x-www-form-urlencoded; charset=UTF-8",beforeSend:false,afterSend:false,timeout:0,cache:true,crossDomain:false,retry:0,setRequestHeader:function(J,K){var I=this;I.headers[J]=K;return I},getAllResponseHeaders:function(){var I=this;return I.state===D?I.responseHeadersString:null},getNativeXhr:function(){var I=this;return I.nativeXhr},getResponseHeader:function(K){var J,I=this,L;K=K.toLowerCase();if(I.state===D){if(!(L=I.responseHeaders)){L=I.responseHeaders={};while((J=a.exec(I.responseHeadersString))){L[J[1].toLowerCase()]=J[2]}}J=L[K]}return J===undefined?null:J},overrideMimeType:function(J){var I=this;if(!I.state){I.mimeType=J}return I},abort:function(J){var I=this;J=J||"abort";I.state=c;I.status=0;I.statusText=J;if(I.nativeXhr){I.nativeXhr.abort()}I._callback();return I},_ioReady:function(J,M){var K=this,I=false;if(K.state===D||K.state===c){return}if(K.state===w){K.state=D}K.readyState=4;if(J>=G&&J<h||J===u){if(J===u){M="not modified";I=true}else{M="success";I=true}}else{if(J<0){J=0}}try{if(J>=G){K.handleResponseData()}}catch(L){t.error(L.stack||L,"error");M=L.message||"parser error"}if(J<G||!I){if(K.retry>0){K.retry=K.retry-1;setTimeout(function(){K.sendInternal()},200);return}}K.status=J;K.statusText=M;K._callback(I)},_callback:function(I){var J=this,K=J.timeoutTimer;if(K){clearTimeout(K);J.timeoutTimer=0}j([I?J.onSuccess:J.onError,J.onComplete],function(L){if(t.isFunction(L)){L.apply(J.context,[J.responseData,J.statusText,J])}});J.responseData=null},handleResponseData:function(){var K=this,I,J=K.dataType,M=K.nativeXhr;if(J==="blob"||J==="arraybuffer"){I=!!l.Blob?M.response:M.responseBody}else{if(J=="json"){if(M.responseType&&M.responseType.toLowerCase()=="json"){I=M.response}else{I=M.responseText?(((l.JSON&&l.JSON.parse)?l.JSON.parse:t.parse)(M.responseText)):{}}}else{if(J==="user-defined"){I=M.response!==undefined?M.response:M.responseText}else{K.responseText=I=M.responseText||"";try{var L=M.responseXML;if(L&&L.documentElement){K.responseXML=L}}catch(N){}}}}K.responseData=I},sendInternal:function(M){var Y=this,U,Q,J,K,X,V,W,L,R,P,O;U=Y._setup(M);J=U.method;K=U.url;X=U.dataType;L=U.mimeType;if(!t.isString(K)){return}Y.nativeXhr=V=A(U.crossDomain);if(!V){return}try{Y.state=w;if(U.username){V.open(J,K,U.async,U.username,U.password)}else{V.open(J,K,U.async)}if((U.async||d.bIE)&&X&&X!="user-defined"&&("responseType" in V)){try{V.responseType=X}catch(S){}}}catch(T){if(Y.state<2){t.error(T.stack||T,"error");Y._ioReady(-1,y+(t.isNumber(T.number)?"("+T.number+")":"")+(T.message||""))}else{t.error(T)}return}W=U.xhrFields||{};if("withCredentials" in W){if(!r){delete W.withCredentials}}j(W,function(ab,Z){try{V[Z]=ab}catch(aa){t.error(aa)}});if(L&&V.overrideMimeType){V.overrideMimeType(L)}R=U.headers||{};var N=R["X-Requested-With"];if(N===false){delete R["X-Requested-With"]}if("setRequestHeader" in V){if(U.contentType){V.setRequestHeader("Content-Type",U.contentType)}V.setRequestHeader("Accept",X&&H[X]?H[X]+(X==="*"?"":", */*; q=0.01"):H["*"]);j(R,function(aa,Z){V.setRequestHeader(Z,aa)})}if(!U.cache){V.setRequestHeader("If-Modified-Since","0");V.setRequestHeader("Cache-Control","no-cache")}P=!m.test(U.method);O=P&&U.data||null;if(P&&d.bIE&&parseInt(d.strBrowserVersion)<10){O=U.data}if(U.async&&U.timeout>0){if(U.timeout<300){U.timeout=300}Y.timeoutTimer=setTimeout(function(){Y.abort("timeout")},U.timeout)}try{Y.state=w;if(t.isFunction(Y.beforeSend)){var I=Y.beforeSend(V,Y);if(I===false){Y.abort("cancel");return}}V.send(O);O=null;U.data=null;if(t.isFunction(Y.afterSend)){Y.afterSend(Y)}}catch(S){if(Y.state<2){t.error(S.stack||S,"error");Y._ioReady(-1,v+(S.message||""))}else{t.error(S)}}if(!U.async||V.readyState===4){Y._xhrCallback()}else{if(p(V)){V.onload=function(){V.readyState=4;V.status=G;Y._xhrCallback()};V.onerror=function(){V.readyState=4;V.status=s;Y._xhrCallback()}}else{V.onreadystatechange=function(){Y._xhrCallback()}}}},_xhrCallback:function(J,O){var K=this,L=K.nativeXhr;try{if(L.readyState===4||O){if(p(L)){L.onerror=z;L.onload=z}else{L.onreadystatechange=z}if(O){if(L.readyState!==4){L.abort()}}else{if(!p(L)){K.responseHeadersString=L.getAllResponseHeaders()}var I=L.status,N;try{N=L.statusText}catch(M){t.error("xhr statusText error: ");t.error(M);N=""}K._ioReady(I,N)}}}catch(M){t.error(M.stack||M,"error");L.onreadystatechange=z;if(!O){K._ioReady(-1,M.message||"process error")}}},_setup:function(M){var J=this,I,L,O,K,N;if(M){J.context=M.context;delete M.context;if(M instanceof F){M=M.config}J.config=M;K=M.url;if(t.startsWith(K,"http://")||t.startsWith(K,"https://")){N=new t.Uri(K)}else{if(t.startsWith(K,"//")){M.url=K="http:"+K}N=g.resolve(K)}if(!M.dataType){I="text"}else{I=M.dataType.toLowerCase()}M.dataType=I;if(!M.method){M.method="GET"}else{M.method=M.method.toUpperCase()}if(!("crossDomain" in M)){M.crossDomain=!N.isSameOriginAs(g)}O=M.headers;for(L in O){if(t.isUndefined(O[L])){delete O[L]}}t.mix(J,M)}J.state=w;return J}});function e(J){if(!J||!t.isString(J.url)){t.log("the url is error.");return}var I=new F();I.sendInternal(J);return I}t.mix(t,{ajax:e,io:{get:function(J,K,L,I){return e({method:"GET",url:J,onSuccess:K,onError:L,dataType:I})},post:function(J,L,K,M,I){return e({method:"POST",data:L,url:J,onSuccess:K,onError:M,dataType:I})},put:function(J,L,K,M,I){return e({method:"PUT",data:L,url:J,onSuccess:K,onError:M,dataType:I})}}})})(dynamsoft);(function(h){var f=20180508;if(h._loadjs_ver){if(h._loadjs_ver>=f){return}}h._loadjs_ver=f;var b="",d=!0,g=h.doc,a=g&&g.documentElement,c=g.getElementsByTagName("head")[0]||a,e=g.createElement("script").readyState?function(j,k){var i=j.onreadystatechange;j.onreadystatechange=function(){var l=j.readyState;if(l==="loaded"||l==="complete"){j.onreadystatechange=null;if(i){i()}k.call(this)}}}:function(j,k){var i=!1;j.addEventListener("load",k,i);j.addEventListener("error",k,i)};h.getScript=function(j,l,m){var k,i;if(!h.isFunction(m)){m=function(){}}if(!h.isString(j)||j==b){m();return}k=g.createElement("script");i=["",j].join(b);k.src=i;if(l){k.async=d}k.charset="utf-8";e(k,m);c.insertBefore(k,c.firstChild);return k};h.getCss=function(j,m){var k,i,l=m;if(!h.isFunction(l)){l=!1}if(!h.isString(j)||j==b){if(l){l()}return}k=g.createElement("link");k.href=j;k.rel="stylesheet";k.async=d;if(l){e(k,l)}c.insertBefore(k,c.firstChild);return k}})(dynamsoft.lib);(function(c){var b=20180508;if(c._customEvt_ver){if(c.isNumber(c._customEvt_ver)&&c._customEvt_ver>=b){return}}c._customEvt_ver=b;var a={fire:function(f){var d=this,e;d.exec=d.exec||{};f=f.toLowerCase();e=Array.prototype.slice.call(arguments,1);c.each(d.exec[f]||[],function(i){var h=i.f,g=i.c||d;try{h.apply(g,e)}catch(j){c.log(j)}})},on:function(g,f,d){var e=this;e.exec=e.exec||{};g=g.toLowerCase();e.exec[g]=e.exec[g]||[];e.exec[g].push({f:f,c:d})},off:function(j,h,k){var f=this,e=f.exec;if(!e){return}if(!j){f.exec=null;return}j=j.toLowerCase();if(!h){e[j]=null;return}var d=e[j]||[];for(var g=d.length-1;g>=0;g--){if(d[g]===h){d.splice(g,1)}}}};c.obj={customEvent:a}})(dynamsoft.lib);(function(b){var h=b.lib,f=!1,d=!0,c=b.navInfo,g=h.win.document,e;var a=20180508;if(h._evtBase_ver){if(h.isNumber(h._evtBase_ver)&&h._evtBase_ver>=a){return}}h._evtBase_ver=a;e=function(i){return(c.bGecko&&"mousewheel"===i)?"DOMMouseScroll":i};h.mix(h,{addEventListener:g.addEventListener?function(j,l,k){var i=e(l);if(j){j.addEventListener(i,k,false)}}:function(j,l,k){var i=e(l);if(j){j.attachEvent("on"+i,k)}},removeEventListener:g.removeEventListener?function(j,l,k){var i=e(l);if(j){j.removeEventListener(i,k,false)}}:function(j,l,k){var i=e(l);if(j){j.detachEvent("on"+i,k)}},stopPropagation:function(i){var j=i||window.event;if(j.preventDefault){j.preventDefault()}if(j.stopPropagation){j.stopPropagation()}j.returnValue=false;j.cancelBubble=true},fireEvent:function(i,j){var k;if(g.createEvent){k=g.createEvent("HTMLEvents");k.initEvent(i,d,d);if(j.dispatchEvent){j.dispatchEvent(k)}}else{if(g.createEventObject){k=g.createEventObject();k.bubbles=d;k.cancelable=d;j.fireEvent(i,k)}else{k=new Event(i);if(j.dispatchEvent){j.dispatchEvent(k)}}}}})})(dynamsoft);(function(a){var c=a.lib,b=20180822;if(c._asyncQueue_ver){if(c.isNumber(c._asyncQueue_ver)&&c._asyncQueue_ver>=b){return}}c._asyncQueue_ver=b;var d={queue:[],doNextStarted:false,timer:false,pushToDo:function(g,f,e){d.queue.push({obj:g,method:f,args:e})},doNext:function(){if(!d.doNextStarted){clearTimeout(d.timer);d.timer=false;return}if(d.queue.length==0){d.timer=setTimeout(d.doNext,500);return}var h=d.queue[0],j=h.obj,k=h.method,f=h.args;d.queue.splice(0,1);if(c.isFunction(j[k])){if(f.length>2){var g=f[f.length-2],e=f[f.length-1];f[f.length-2]=function(){try{g.apply(j,arguments)}catch(l){}d.timer=setTimeout(d.doNext,0)};f[f.length-1]=function(){try{e.apply(j,arguments)}catch(l){}d.timer=setTimeout(d.doNext,0)}}try{j[k].apply(j,f)}catch(i){}return}else{c.log("not invoke a function: "+k);d.timer=setTimeout(d.doNext,0)}},start:function(){if(!d.doNextStarted){d.doNextStarted=true;d.timer=setTimeout(d.doNext,0)}},stop:function(){clearTimeout(d.timer);d.doNextStarted=false;d.queue=[]}};c.asyncQueue=d})(dynamsoft);(function(f){var d=20190507;if(f._sprintf_ver){if(f._sprintf_ver>=d){return}}f._sprintf_ver=d;var e,i={not_string:/[^s]/,not_bool:/[^t]/,not_type:/[^T]/,not_primitive:/[^v]/,number:/[diefg]/,numeric_arg:/[bcdiefguxX]/,json:/[j]/,not_json:/[^j]/,text:/^[^\x25]+/,modulo:/^\x25{2}/,placeholder:/^\x25(?:([1-9]\d*)\$|\(([^)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijostTuvxX])/,key:/^([a-z_][a-z_\d]*)/i,key_access:/^\.([a-z_][a-z_\d]*)/i,index_access:/^\[(\d+)\]/,sign:/^[+-]/};function g(m,l){if("_".repeat){return m.repeat(l)}var k=0,j=[];for(;k<l;k++){j.push(m)}return j.join("")}function c(s,r){var w=1,u=s.length,x,l="",p,n,q,m,t,v,o,j;for(p=0;p<u;p++){if(typeof s[p]==="string"){l+=s[p]}else{if(typeof s[p]==="object"){q=s[p];if(q.keys){x=r[w];for(n=0;n<q.keys.length;n++){if(x==undefined){throw new Error(e('[sprintf] Cannot access property "%s" of undefined value "%s"',q.keys[n],q.keys[n-1]))}x=x[q.keys[n]]}}else{if(q.param_no){x=r[q.param_no]}else{x=r[w++]}}if(i.not_type.test(q.type)&&i.not_primitive.test(q.type)&&x instanceof Function){x=x()}if(i.numeric_arg.test(q.type)&&(typeof x!=="number"&&isNaN(x))){throw new TypeError(e("[sprintf] expecting number but found %T",x))}if(i.number.test(q.type)){o=x>=0}switch(q.type){case"b":x=parseInt(x,10).toString(2);break;case"c":x=String.fromCharCode(parseInt(x,10));break;case"d":case"i":x=parseInt(x,10);break;case"j":x=JSON.stringify(x,null,q.width?parseInt(q.width):0);break;case"e":x=q.precision?parseFloat(x).toExponential(q.precision):parseFloat(x).toExponential();break;case"f":x=q.precision?parseFloat(x).toFixed(q.precision):parseFloat(x);break;case"g":x=q.precision?String(Number(x.toPrecision(q.precision))):parseFloat(x);break;case"o":x=(parseInt(x,10)>>>0).toString(8);break;case"s":x=String(x);x=(q.precision?x.substring(0,q.precision):x);break;case"t":x=String(!!x);x=(q.precision?x.substring(0,q.precision):x);break;case"T":x=Object.prototype.toString.call(x).slice(8,-1).toLowerCase();x=(q.precision?x.substring(0,q.precision):x);break;case"u":x=parseInt(x,10)>>>0;break;case"v":x=x.valueOf();x=(q.precision?x.substring(0,q.precision):x);break;case"x":x=(parseInt(x,10)>>>0).toString(16);break;case"X":x=(parseInt(x,10)>>>0).toString(16).toUpperCase();break}if(i.json.test(q.type)){l+=x}else{if(i.number.test(q.type)&&(!o||q.sign)){j=o?"+":"-";x=x.toString().replace(i.sign,"")}else{j=""}t=q.pad_char?q.pad_char==="0"?"0":q.pad_char.charAt(1):" ";v=q.width-(j+x).length;m=q.width?(v>0?g(t,v):""):"";l+=q.align?j+x+m:(t==="0"?j+m+x:m+j+x)}}}}return l}var h=Object.create?Object.create(null):{};function a(j){if(h[j]){return h[j]}var m=j,n,p=[],o=0;while(m){if((n=i.text.exec(m))!==null){p.push(n[0])}else{if((n=i.modulo.exec(m))!==null){p.push("%")}else{if((n=i.placeholder.exec(m))!==null){if(n[2]){o|=1;var q=[],l=n[2],k=[];if((k=i.key.exec(l))!==null){q.push(k[1]);while((l=l.substring(k[0].length))!==""){if((k=i.key_access.exec(l))!==null){q.push(k[1])}else{if((k=i.index_access.exec(l))!==null){q.push(k[1])}else{throw new SyntaxError("[sprintf] failed to parse named argument key")}}}}else{throw new SyntaxError("[sprintf] failed to parse named argument key")}n[2]=q}else{o|=2}if(o===3){throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported")}p.push({placeholder:n[0],param_no:n[1],keys:n[2],sign:n[3],pad_char:n[4],align:n[5],width:n[6],precision:n[7],type:n[8]})}else{throw new SyntaxError("[sprintf] unexpected placeholder")}}}m=m.substring(n[0].length)}h[j]=p;return p}e=function(j){return c(a(j),arguments)};function b(k,j){return e.apply(null,[k].concat(j||[]))}f.sprintf=e;f.vsprintf=b})(dynamsoft.lib);(function(l){var y=20190506;if(l._promise_ver){if(l._promise_ver>=y){return}}l._promise_ver=y;var r=!l.isUndef(r)?r:this,s=!l.isUndef(window)?window:!l.isUndef(s)?s:r,C=!l.isUndef(C)?C:0,v=!l.isUndef(v)?v:setTimeout,p,u;var o=s.Promise;var a=o&&"resolve" in o&&"reject" in o&&"all" in o&&"race" in o&&(function(){var E,D;D=new o(function(F){E=F});return typeof E==="function"})();var g="pending";var k="sealed";var b="fulfilled";var B="rejected";var n=function(){};function m(D){return Object.prototype.toString.call(D)==="[object Array]"}var q=v;var j=[];var c;function i(){for(var D=0;D<j.length;D++){j[D][0](j[D][1])}j=[];c=false}function A(E,D){j.push([E,D]);if(!c){c=true;q(i,0)}}function x(D){D.state_=b;u(D)}function h(D){D.state_=B;u(D)}function f(E,D){if(E.state_===g){E.state_=k;E.data_=D;A(h,E)}}function e(E,D){if(E.state_===g){E.state_=k;E.data_=D;A(x,E)}}function t(E,D){if(E===D||!p(E,D)){e(E,D)}}function z(H,G){function D(I){t(G,I)}function F(I){f(G,I)}try{H(D,F)}catch(E){F(E)}}p=function(H,E){var D;try{if(H===E){throw new TypeError("A promises callback cannot return that same promise.")}if(E&&(typeof E==="function"||typeof E==="object")){var G=E.then;if(typeof G==="function"){G.call(E,function(I){if(!D){D=true;if(E!==I){t(H,I)}else{e(H,I)}}},function(I){if(!D){D=true;f(H,I)}});return true}}}catch(F){if(!D){f(H,F)}return true}return false};function w(F){var E=F.owner;var D=E.state_;var G=E.data_;var J=F[D];var I=F.then;if(typeof J==="function"){D=b;try{G=J(G)}catch(H){f(I,H)}}if(!p(I,G)){if(D===b){t(I,G)}if(D===B){f(I,G)}}}u=function(F){var E=F.then_;F.then_=undefined;for(var D=0;D<E.length;D++){w(E[D])}};function d(D){if(typeof D!=="function"){throw new TypeError("Promise constructor takes a function argument")}if(this instanceof d===false){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}this.then_=[];z(D,this)}d.prototype={constructor:d,state_:g,then_:null,data_:undefined,then:function(F,E){var D={owner:this,then:new this.constructor(n),fulfilled:F,rejected:E};if(this.state_===b||this.state_===B){A(w,D)}else{this.then_.push(D)}return D.then},"catch":function(D){return this.then(null,D)}};d.all=function(E){var D=this;if(!m(E)){throw new TypeError("You must pass an array to Promise.all().")}return new D(function(J,I){var G=[];var H=0;function L(M){H++;return function(N){G[M]=N;if(!--H){J(G)}}}for(var F=0,K;F<E.length;F++){K=E[F];if(K&&typeof K.then==="function"){K.then(L(F),I)}else{G[F]=K}}if(!H){J(G)}})};d.race=function(E){var D=this;if(!m(E)){throw new TypeError("You must pass an array to Promise.race().")}return new D(function(H,G){for(var F=0,I;F<E.length;F++){I=E[F];if(I&&typeof I.then==="function"){I.then(H,G)}else{H(I)}}})};d.resolve=function(E){var D=this;if(E&&typeof E==="object"&&E.constructor===D){return E}return new D(function(F){F(E)})};d.reject=function(E){var D=this;return new D(function(G,F){F(E)})};if(C){C.Promise=a?o:d;C.Polyfill=d}else{if(typeof define=="function"&&define.amd){define(function(){return a?o:d})}else{if(!a){s.Promise=d}}}})(dynamsoft.lib);(function(g){var c=20180115,j=g.lib,e=g.navInfo;if(j._dialog_ie7_ver){if(j.isNumber(j._dialog_ie7_ver)&&j._dialog_ie7_ver>=c){return}}j._dialog_ie7_ver=c;var f=j.win,s=j.doc,i=!0,n=!1,k=(e.bIE&&e.IEMode<8),h=k&&(e.IEMode<7),l=500000,a=1000;function b(t){var w,v,u;w=s.body.scrollTop||s.documentElement.scrollTop;if(f.innerHeight){u=f.innerHeight}else{u=s.documentElement.clientHeight}v=w+(u-t.offsetHeight)/2;t.style.top=v+"px";t._dlgInfo.isTopOverridden=i}function m(t,v){for(var u=0;u<t.length;++u){if(t[u]==v){return i}}return n}function o(w){for(var x=0;x<s.styleSheets.length;++x){var C=s.styleSheets[x],z=n,u=n,B,D;try{z=C.cssRules;u=s.querySelectorAll}catch(y){}if(z&&u){for(var v=0;v<z.length;++v){B=z[v];D=n;try{D=u(B.selectorText)}catch(y){}if(D&&m(D,w)){var t=B.style.getPropertyValue("top"),A=B.style.getPropertyValue("bottom");if((t&&t!="auto")||(A&&A!="auto")){return i}}}}}return n}function p(u){var t=n;if(f.getComputedStyle){t=f.getComputedStyle(u)}else{if(u.currentStyle){t=u.currentStyle}}if(t&&t.position!="absolute"){return n}if((u.style.top!="auto"&&u.style.top!="")||(u.style.bottom!="auto"&&u.style.bottom!="")){return n}return !o(u)}function q(u){var t=s.createEvent("MouseEvents");t.initMouseEvent(u.type,u.bubbles,u.cancelable,f,u.detail,u.screenX,u.screenY,u.clientX,u.clientY,u.ctrlKey,u.altKey,u.shiftKey,u.metaKey,u.button,u.relatedTarget);return t}function r(){var u=this,t;u.pendingDialogStack=[];u.overlay=s.createElement(k?"iframe":"div");t=u.overlay.style;t.position=k?"absolute":"fixed";t.display="block";t.left=t.top=t.margin=t.padding=0;t.backgroundColor="#000";t.filter="alpha(opacity=30)";t.opacity=t.MozOpacity=0.3;t.zIndex=l;t.width="100%";if(k&&s.documentElement.clientHeight>0){t.height=s.documentElement.clientHeight+"px"}else{t.height="100%"}if(s.createEvent){j.addEventListener(u.overlay,"click",function(v){var w=q(v);s.body.dispatchEvent(w)})}}var d=r.prototype;d._blockDocument=function(){if(!s.body.contains(this.overlay)){s.body.appendChild(this.overlay)}};d._unblockDocument=function(){s.body.removeChild(this.overlay)};d._updateStacking=function(){var x=this,t,v,u,w;v=x.pendingDialogStack;if(v.length==0){x._unblockDocument();return}x._blockDocument();w=l;j.each(v,function(y){w++;y._dlgInfo.mask.style.zIndex=w++;y.style.zIndex=w})};d.pushDialog=function(u){var v=this,t;if(v.pendingDialogStack.length>=a){j.error("Too many modal dialogs.");return}t=s.createElement("div");t.className="dynamsoft-backdrop";if(k){t.style.position="absolute"}if(s.createEvent){j.addEventListener(t,"click",function(w){if(u.dispatchEvent){var x=q(w);u.dispatchEvent(x)}})}u.parentNode.insertBefore(t,u.nextSibling);u._dlgInfo.mask=t;v.pendingDialogStack.push(u);v._updateStacking()};d.removeDialog=function(v){var w=this,u,t;u=j.isArray(w.pendingDialogStack)?w.pendingDialogStack.indexOf(v):-1;if(u==-1){return}w.pendingDialogStack.splice(u,1);t=v._dlgInfo.mask;t.parentNode.removeChild(